-
Couldn't load subscription status.
- Fork 639
SelectPanel: Add stories and tests for documentation purposes #4829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0003e59
wip
broccolinisoup 713b5ad
wip wip
broccolinisoup 6fc7f2b
add stories
broccolinisoup a246981
fix linting
broccolinisoup e209f47
add tests for groups
broccolinisoup 1012662
Merge branch 'main' into select-panel-story-and-tests
broccolinisoup 67dc5c9
Update story names for e2e tests
broccolinisoup c66feb5
oops remove unintended file
broccolinisoup 4fbb3c5
update story name
broccolinisoup 2d5e2b2
same - update story name
broccolinisoup cee7737
disable animations
broccolinisoup 9c972c3
test(vrt): update snapshots
broccolinisoup 6170f77
Merge branch 'main' into select-panel-story-and-tests
broccolinisoup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+38 KB
...ctPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39 KB
...SelectPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.9 KB
...anel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38 KB
...onents/SelectPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38 KB
...ctPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.7 KB
...tPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.4 KB
...nel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.7 KB
...nents/SelectPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.7 KB
...tPanel.test.ts-snapshots/SelectPanel-Above-Tall-Body-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23 KB
(280%)
...nts/SelectPanel.test.ts-snapshots/SelectPanel-Default-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23.9 KB
(290%)
...ponents/SelectPanel.test.ts-snapshots/SelectPanel-Default-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23 KB
(280%)
.../SelectPanel.test.ts-snapshots/SelectPanel-Default-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23 KB
(280%)
...ots/components/SelectPanel.test.ts-snapshots/SelectPanel-Default-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23 KB
(280%)
...nts/SelectPanel.test.ts-snapshots/SelectPanel-Default-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23.4 KB
(280%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-Default-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23.5 KB
(290%)
...SelectPanel.test.ts-snapshots/SelectPanel-Default-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23.4 KB
(280%)
...ts/components/SelectPanel.test.ts-snapshots/SelectPanel-Default-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23.4 KB
(280%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-Default-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.1 KB
(170%)
...ctPanel.test.ts-snapshots/SelectPanel-External-Anchor-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.3 KB
(180%)
...SelectPanel.test.ts-snapshots/SelectPanel-External-Anchor-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11.7 KB
(170%)
...anel.test.ts-snapshots/SelectPanel-External-Anchor-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.1 KB
(170%)
...onents/SelectPanel.test.ts-snapshots/SelectPanel-External-Anchor-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.1 KB
(170%)
...ctPanel.test.ts-snapshots/SelectPanel-External-Anchor-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.5 KB
(170%)
...tPanel.test.ts-snapshots/SelectPanel-External-Anchor-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.3 KB
(170%)
...nel.test.ts-snapshots/SelectPanel-External-Anchor-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.5 KB
(170%)
...nents/SelectPanel.test.ts-snapshots/SelectPanel-External-Anchor-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12.5 KB
(170%)
...tPanel.test.ts-snapshots/SelectPanel-External-Anchor-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.4 KB
...ots/SelectPanel-Height-Initial-with-Overflowing-Items-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.8 KB
...apshots/SelectPanel-Height-Initial-with-Overflowing-Items-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+29 KB
.../SelectPanel-Height-Initial-with-Overflowing-Items-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.4 KB
...t.ts-snapshots/SelectPanel-Height-Initial-with-Overflowing-Items-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.4 KB
...ots/SelectPanel-Height-Initial-with-Overflowing-Items-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.9 KB
...ts/SelectPanel-Height-Initial-with-Overflowing-Items-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.7 KB
...SelectPanel-Height-Initial-with-Overflowing-Items-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.9 KB
....ts-snapshots/SelectPanel-Height-Initial-with-Overflowing-Items-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.9 KB
...ts/SelectPanel-Height-Initial-with-Overflowing-Items-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+25.1 KB
...el-Height-Initial-with-Underflowing-Items-After-Fetch-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+26.3 KB
...tPanel-Height-Initial-with-Underflowing-Items-After-Fetch-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.7 KB
...Height-Initial-with-Underflowing-Items-After-Fetch-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+25.1 KB
...s/SelectPanel-Height-Initial-with-Underflowing-Items-After-Fetch-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+25.1 KB
...el-Height-Initial-with-Underflowing-Items-After-Fetch-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+25.5 KB
...l-Height-Initial-with-Underflowing-Items-After-Fetch-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+25.3 KB
...eight-Initial-with-Underflowing-Items-After-Fetch-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+25.5 KB
.../SelectPanel-Height-Initial-with-Underflowing-Items-After-Fetch-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+25.5 KB
...l-Height-Initial-with-Underflowing-Items-After-Fetch-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.1 KB
...ts/SelectPanel-Height-Initial-with-Underflowing-Items-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+28.4 KB
...pshots/SelectPanel-Height-Initial-with-Underflowing-Items-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+26.6 KB
...SelectPanel-Height-Initial-with-Underflowing-Items-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.1 KB
....ts-snapshots/SelectPanel-Height-Initial-with-Underflowing-Items-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.1 KB
...ts/SelectPanel-Height-Initial-with-Underflowing-Items-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.5 KB
...s/SelectPanel-Height-Initial-with-Underflowing-Items-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.3 KB
...electPanel-Height-Initial-with-Underflowing-Items-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.5 KB
...ts-snapshots/SelectPanel-Height-Initial-with-Underflowing-Items-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.5 KB
...s/SelectPanel-Height-Initial-with-Underflowing-Items-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.9 KB
...s-snapshots/SelectPanel-Height-Variantions-and-Scroll-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+34.2 KB
...st.ts-snapshots/SelectPanel-Height-Variantions-and-Scroll-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.7 KB
...napshots/SelectPanel-Height-Variantions-and-Scroll-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.9 KB
...anel.test.ts-snapshots/SelectPanel-Height-Variantions-and-Scroll-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.9 KB
...s-snapshots/SelectPanel-Height-Variantions-and-Scroll-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+33.1 KB
...-snapshots/SelectPanel-Height-Variantions-and-Scroll-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+33 KB
...apshots/SelectPanel-Height-Variantions-and-Scroll-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+33.1 KB
...nel.test.ts-snapshots/SelectPanel-Height-Variantions-and-Scroll-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+33.1 KB
...-snapshots/SelectPanel-Height-Variantions-and-Scroll-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12.3 KB
(170%)
...lectPanel.test.ts-snapshots/SelectPanel-Single-Select-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+13.4 KB
(180%)
...s/SelectPanel.test.ts-snapshots/SelectPanel-Single-Select-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
+11.9 KB
(170%)
...tPanel.test.ts-snapshots/SelectPanel-Single-Select-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12.3 KB
(170%)
...mponents/SelectPanel.test.ts-snapshots/SelectPanel-Single-Select-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12.3 KB
(170%)
...lectPanel.test.ts-snapshots/SelectPanel-Single-Select-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12.6 KB
(170%)
...ectPanel.test.ts-snapshots/SelectPanel-Single-Select-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12.6 KB
(170%)
...Panel.test.ts-snapshots/SelectPanel-Single-Select-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12.6 KB
(170%)
...ponents/SelectPanel.test.ts-snapshots/SelectPanel-Single-Select-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12.6 KB
(170%)
...ectPanel.test.ts-snapshots/SelectPanel-Single-Select-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.3 KB
...SelectPanel.test.ts-snapshots/SelectPanel-With-Footer-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+33.3 KB
...nts/SelectPanel.test.ts-snapshots/SelectPanel-With-Footer-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+32 KB
...ectPanel.test.ts-snapshots/SelectPanel-With-Footer-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.3 KB
...components/SelectPanel.test.ts-snapshots/SelectPanel-With-Footer-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.3 KB
...SelectPanel.test.ts-snapshots/SelectPanel-With-Footer-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.6 KB
...electPanel.test.ts-snapshots/SelectPanel-With-Footer-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.4 KB
...ctPanel.test.ts-snapshots/SelectPanel-With-Footer-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.6 KB
...omponents/SelectPanel.test.ts-snapshots/SelectPanel-With-Footer-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.6 KB
...electPanel.test.ts-snapshots/SelectPanel-With-Footer-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+45.1 KB
...SelectPanel.test.ts-snapshots/SelectPanel-With-Groups-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+45.4 KB
...nts/SelectPanel.test.ts-snapshots/SelectPanel-With-Groups-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+45.5 KB
...ectPanel.test.ts-snapshots/SelectPanel-With-Groups-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+45.1 KB
...components/SelectPanel.test.ts-snapshots/SelectPanel-With-Groups-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+45.1 KB
...SelectPanel.test.ts-snapshots/SelectPanel-With-Groups-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+46 KB
...electPanel.test.ts-snapshots/SelectPanel-With-Groups-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+46.5 KB
...ctPanel.test.ts-snapshots/SelectPanel-With-Groups-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+46 KB
...omponents/SelectPanel.test.ts-snapshots/SelectPanel-With-Groups-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+46 KB
...electPanel.test.ts-snapshots/SelectPanel-With-Groups-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.8 KB
...anel.test.ts-snapshots/SelectPanel-With-Item-Dividers-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.6 KB
...ectPanel.test.ts-snapshots/SelectPanel-With-Item-Dividers-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.9 KB
...l.test.ts-snapshots/SelectPanel-With-Item-Dividers-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.8 KB
...nts/SelectPanel.test.ts-snapshots/SelectPanel-With-Item-Dividers-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.8 KB
...anel.test.ts-snapshots/SelectPanel-With-Item-Dividers-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.2 KB
...nel.test.ts-snapshots/SelectPanel-With-Item-Dividers-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.3 KB
....test.ts-snapshots/SelectPanel-With-Item-Dividers-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.2 KB
...ts/SelectPanel.test.ts-snapshots/SelectPanel-With-Item-Dividers-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.2 KB
...nel.test.ts-snapshots/SelectPanel-With-Item-Dividers-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.7 KB
...test.ts-snapshots/SelectPanel-With-Placeholder-Select-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.5 KB
...nel.test.ts-snapshots/SelectPanel-With-Placeholder-Select-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.7 KB
...t.ts-snapshots/SelectPanel-With-Placeholder-Select-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.7 KB
...electPanel.test.ts-snapshots/SelectPanel-With-Placeholder-Select-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.7 KB
...test.ts-snapshots/SelectPanel-With-Placeholder-Select-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+31 KB
...est.ts-snapshots/SelectPanel-With-Placeholder-Select-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.1 KB
....ts-snapshots/SelectPanel-With-Placeholder-Select-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+31 KB
...lectPanel.test.ts-snapshots/SelectPanel-With-Placeholder-Select-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+31 KB
...est.ts-snapshots/SelectPanel-With-Placeholder-Select-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.7 KB
...apshots/SelectPanel-With-Placeholder-for-Search-Input-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.5 KB
...s-snapshots/SelectPanel-With-Placeholder-for-Search-Input-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.8 KB
...hots/SelectPanel-With-Placeholder-for-Search-Input-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.7 KB
....test.ts-snapshots/SelectPanel-With-Placeholder-for-Search-Input-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.7 KB
...apshots/SelectPanel-With-Placeholder-for-Search-Input-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.1 KB
...pshots/SelectPanel-With-Placeholder-for-Search-Input-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.2 KB
...ots/SelectPanel-With-Placeholder-for-Search-Input-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.1 KB
...test.ts-snapshots/SelectPanel-With-Placeholder-for-Search-Input-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.1 KB
...pshots/SelectPanel-With-Placeholder-for-Search-Input-light-tritanopia-linux.png
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
244 changes: 244 additions & 0 deletions
244
packages/react/src/SelectPanel/SelectPanel.examples.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,244 @@ | ||
| import React, {useState} from 'react' | ||
| import Box from '../Box' | ||
| import type {Meta} from '@storybook/react' | ||
| import {Button} from '../Button' | ||
| import type {ItemInput} from '../deprecated/ActionList/List' | ||
| import {SelectPanel} from './SelectPanel' | ||
| import type {OverlayProps} from '../Overlay' | ||
| import {TriangleDownIcon} from '@primer/octicons-react' | ||
|
|
||
| const meta = { | ||
| title: 'Components/SelectPanel/Examples', | ||
| component: SelectPanel, | ||
| } satisfies Meta<typeof SelectPanel> | ||
|
|
||
| export default meta | ||
|
|
||
| function getColorCircle(color: string) { | ||
| return function () { | ||
| return ( | ||
| <Box | ||
| bg={color} | ||
| borderColor={color} | ||
| width={14} | ||
| height={14} | ||
| borderRadius={10} | ||
| margin="auto" | ||
| borderWidth="1px" | ||
| borderStyle="solid" | ||
| /> | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| const items = [ | ||
| {leadingVisual: getColorCircle('#a2eeef'), text: 'enhancement', id: 1}, | ||
| {leadingVisual: getColorCircle('#d73a4a'), text: 'bug', id: 2}, | ||
| {leadingVisual: getColorCircle('#0cf478'), text: 'good first issue', id: 3}, | ||
| {leadingVisual: getColorCircle('#ffd78e'), text: 'design', id: 4}, | ||
| {leadingVisual: getColorCircle('#ff0000'), text: 'blocker', id: 5}, | ||
| {leadingVisual: getColorCircle('#a4f287'), text: 'backend', id: 6}, | ||
| {leadingVisual: getColorCircle('#8dc6fc'), text: 'frontend', id: 7}, | ||
| ] | ||
|
|
||
| export const HeightInitialWithOverflowingItemsStory = () => { | ||
| const [selected, setSelected] = React.useState<ItemInput | undefined>(items[0]) | ||
| const [filter, setFilter] = React.useState('') | ||
| const filteredItems = items.filter(item => item.text.toLowerCase().startsWith(filter.toLowerCase())) | ||
| const [open, setOpen] = useState(false) | ||
|
|
||
| return ( | ||
| <> | ||
| <h1>Single Select Panel</h1> | ||
| <div>Please select a label that describe your issue:</div> | ||
| <SelectPanel | ||
| renderAnchor={({children, 'aria-labelledby': ariaLabelledBy, ...anchorProps}) => ( | ||
| <Button trailingAction={TriangleDownIcon} aria-labelledby={` ${ariaLabelledBy}`} {...anchorProps}> | ||
| {children ?? 'Select Labels'} | ||
| </Button> | ||
| )} | ||
| placeholderText="Filter Labels" | ||
| open={open} | ||
| onOpenChange={setOpen} | ||
| items={filteredItems} | ||
| selected={selected} | ||
| onSelectedChange={setSelected} | ||
| onFilterChange={setFilter} | ||
| showItemDividers={true} | ||
| overlayProps={{width: 'small', height: 'initial', maxHeight: 'xsmall'}} | ||
| /> | ||
| </> | ||
| ) | ||
| } | ||
| HeightInitialWithOverflowingItemsStory.storyName = 'Height: Initial, Overflowing Items' | ||
|
|
||
| export const HeightInitialWithUnderflowingItemsStory = () => { | ||
| const underflowingItems = [items[0], items[1]] | ||
| const [selected, setSelected] = React.useState<ItemInput | undefined>(underflowingItems[0]) | ||
| const [filter, setFilter] = React.useState('') | ||
| const filteredItems = underflowingItems.filter(item => item.text.toLowerCase().startsWith(filter.toLowerCase())) | ||
| const [open, setOpen] = useState(false) | ||
|
|
||
| return ( | ||
| <> | ||
| <h1>Single Select Panel</h1> | ||
| <div>Please select a label that describe your issue:</div> | ||
| <SelectPanel | ||
| renderAnchor={({children, 'aria-labelledby': ariaLabelledBy, ...anchorProps}) => ( | ||
| <Button trailingAction={TriangleDownIcon} aria-labelledby={` ${ariaLabelledBy}`} {...anchorProps}> | ||
| {children ?? 'Select Labels'} | ||
| </Button> | ||
| )} | ||
| placeholderText="Filter Labels" | ||
| open={open} | ||
| onOpenChange={setOpen} | ||
| items={filteredItems} | ||
| selected={selected} | ||
| onSelectedChange={setSelected} | ||
| onFilterChange={setFilter} | ||
| showItemDividers={true} | ||
| overlayProps={{width: 'small', height: 'initial', maxHeight: 'xsmall'}} | ||
| /> | ||
| </> | ||
| ) | ||
| } | ||
| HeightInitialWithUnderflowingItemsStory.storyName = 'Height: Initial, Underflowing Items' | ||
|
|
||
| export const HeightInitialWithUnderflowingItemsAfterFetch = () => { | ||
| const [selected, setSelected] = React.useState<ItemInput | undefined>(items[0]) | ||
| const [filter, setFilter] = React.useState('') | ||
| const [fetchedItems, setFetchedItems] = useState<typeof items>([]) | ||
| const filteredItems = React.useMemo( | ||
| () => fetchedItems.filter(item => item.text.toLowerCase().startsWith(filter.toLowerCase())), | ||
| [fetchedItems, filter], | ||
| ) | ||
| const [open, setOpen] = useState(false) | ||
| const [height, setHeight] = useState<OverlayProps['height']>('auto') | ||
|
|
||
| const onOpenChange = () => { | ||
| setOpen(!open) | ||
| setTimeout(() => { | ||
| setFetchedItems([items[0], items[1]]) | ||
| setHeight('initial') | ||
| }, 1500) | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| <h1>Single Select Panel</h1> | ||
| <div>Please select a label that describe your issue:</div> | ||
| <SelectPanel | ||
| renderAnchor={({children, 'aria-labelledby': ariaLabelledBy, ...anchorProps}) => ( | ||
| <Button trailingAction={TriangleDownIcon} aria-labelledby={` ${ariaLabelledBy}`} {...anchorProps}> | ||
| {children ?? 'Select Labels'} | ||
| </Button> | ||
| )} | ||
| placeholderText="Filter Labels" | ||
| open={open} | ||
| onOpenChange={onOpenChange} | ||
| loading={filteredItems.length === 0} | ||
| items={filteredItems} | ||
| selected={selected} | ||
| onSelectedChange={setSelected} | ||
| onFilterChange={setFilter} | ||
| showItemDividers={true} | ||
| overlayProps={{width: 'small', height, maxHeight: 'xsmall'}} | ||
| /> | ||
| </> | ||
| ) | ||
| } | ||
| HeightInitialWithUnderflowingItemsAfterFetch.storyName = 'Height: Initial, Underflowing Items (After Fetch)' | ||
|
|
||
| export const AboveTallBody = () => { | ||
| const [selected, setSelected] = React.useState<ItemInput | undefined>(items[0]) | ||
| const [filter, setFilter] = React.useState('') | ||
| const filteredItems = items.filter(item => item.text.toLowerCase().startsWith(filter.toLowerCase())) | ||
| const [open, setOpen] = useState(false) | ||
|
|
||
| return ( | ||
| <> | ||
| <h1>Single Select Panel</h1> | ||
| <div>Please select a label that describe your issue:</div> | ||
| <SelectPanel | ||
| renderAnchor={({children, 'aria-labelledby': ariaLabelledBy, ...anchorProps}) => ( | ||
| <Button trailingAction={TriangleDownIcon} aria-labelledby={` ${ariaLabelledBy}`} {...anchorProps}> | ||
| {children ?? 'Select Labels'} | ||
| </Button> | ||
| )} | ||
| placeholderText="Filter Labels" | ||
| open={open} | ||
| onOpenChange={setOpen} | ||
| items={filteredItems} | ||
| selected={selected} | ||
| onSelectedChange={setSelected} | ||
| onFilterChange={setFilter} | ||
| showItemDividers={true} | ||
| overlayProps={{width: 'small', height: 'xsmall'}} | ||
| /> | ||
| <div | ||
| style={{ | ||
| backgroundColor: '#9c27b0', | ||
| height: '100vh', | ||
| padding: '20px', | ||
| margin: '20px', | ||
| color: 'white', | ||
| }} | ||
| > | ||
| This element makes the body really tall. This is to test that we do not have layout/focus issues if the Portal | ||
| is far down the page | ||
| </div> | ||
| </> | ||
| ) | ||
| } | ||
|
|
||
| export const HeightVariantionsAndScroll = () => { | ||
| const longItems = [...items, ...items, ...items, ...items, ...items, ...items, ...items, ...items] | ||
| const [selectedA, setSelectedA] = React.useState<ItemInput | undefined>(longItems[0]) | ||
| const [selectedB, setSelectedB] = React.useState<ItemInput | undefined>(longItems[0]) | ||
| const [filter, setFilter] = React.useState('') | ||
| const filteredItems = longItems.filter(item => item.text.toLowerCase().startsWith(filter.toLowerCase())) | ||
| const [openA, setOpenA] = useState(false) | ||
| const [openB, setOpenB] = useState(false) | ||
|
|
||
| return ( | ||
| <> | ||
| <h2>With height:medium</h2> | ||
| <SelectPanel | ||
| renderAnchor={({children, 'aria-labelledby': ariaLabelledBy, ...anchorProps}) => ( | ||
| <Button trailingAction={TriangleDownIcon} aria-labelledby={` ${ariaLabelledBy}`} {...anchorProps}> | ||
| {children ?? 'Select Labels'} | ||
| </Button> | ||
| )} | ||
| placeholderText="Filter Labels" | ||
| open={openA} | ||
| onOpenChange={setOpenA} | ||
| items={filteredItems} | ||
| selected={selectedA} | ||
| onSelectedChange={setSelectedA} | ||
| onFilterChange={setFilter} | ||
| showItemDividers={true} | ||
| overlayProps={{height: 'medium'}} | ||
| /> | ||
| <h2>With height:auto, maxheight:medium</h2> | ||
| <SelectPanel | ||
| renderAnchor={({children, 'aria-labelledby': ariaLabelledBy, ...anchorProps}) => ( | ||
| <Button trailingAction={TriangleDownIcon} aria-labelledby={` ${ariaLabelledBy}`} {...anchorProps}> | ||
| {children ?? 'Select Labels'} | ||
| </Button> | ||
| )} | ||
| placeholderText="Filter Labels" | ||
| open={openB} | ||
| onOpenChange={setOpenB} | ||
| items={filteredItems} | ||
| selected={selectedB} | ||
| onSelectedChange={setSelectedB} | ||
| onFilterChange={setFilter} | ||
| showItemDividers={true} | ||
| overlayProps={{ | ||
| height: 'auto', | ||
| maxHeight: 'medium', | ||
| }} | ||
| /> | ||
| </> | ||
| ) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(non blocker) Should we bring FilteredActionList into src/SelectPanel, it's not used anywhere else. (And we probably don't want it to be used anywhere else?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense to me! Perhaps in a follow-up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think we exported it recently? #4816
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.