-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(SegmentedControl): Add dev stories and update e2e tests (#5334)
* chore(SegmentedControl): Add dev stories and update e2e tests * add dev file and update test id * test(vrt): update snapshots --------- Co-authored-by: hussam-i-am <hussam-i-am@users.noreply.github.com>
- Loading branch information
1 parent
f0603fd
commit 964bfcd
Showing
30 changed files
with
190 additions
and
491 deletions.
There are no files selected for viewing
Binary file added
BIN
+8.72 KB
...ntrol.test.ts-snapshots/SegmentedControl-Dev-With-Css-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
+8.66 KB
...edControl.test.ts-snapshots/SegmentedControl-Dev-With-Css-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
+8.73 KB
...ol.test.ts-snapshots/SegmentedControl-Dev-With-Css-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
+8.72 KB
...SegmentedControl.test.ts-snapshots/SegmentedControl-Dev-With-Css-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
+8.72 KB
...ntrol.test.ts-snapshots/SegmentedControl-Dev-With-Css-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
+8.73 KB
...trol.test.ts-snapshots/SegmentedControl-Dev-With-Css-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
+8.73 KB
...l.test.ts-snapshots/SegmentedControl-Dev-With-Css-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
+8.73 KB
...egmentedControl.test.ts-snapshots/SegmentedControl-Dev-With-Css-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
+8.73 KB
...trol.test.ts-snapshots/SegmentedControl-Dev-With-Css-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 added
BIN
+8.04 KB
...est.ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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
+7.91 KB
...ol.test.ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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
+7.92 KB
....ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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
+7.97 KB
...edControl.test.ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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
+8.04 KB
...est.ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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
+8.01 KB
...st.ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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
+8.11 KB
...ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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
+8.1 KB
...dControl.test.ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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
+8.01 KB
...st.ts-snapshots/SegmentedControl-Dev-With-Sx-And-Css-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 added
BIN
+8.04 KB
...ontrol.test.ts-snapshots/SegmentedControl-Dev-With-Sx-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
+7.91 KB
...tedControl.test.ts-snapshots/SegmentedControl-Dev-With-Sx-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
+7.92 KB
...rol.test.ts-snapshots/SegmentedControl-Dev-With-Sx-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
+7.97 KB
.../SegmentedControl.test.ts-snapshots/SegmentedControl-Dev-With-Sx-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
+8.04 KB
...ontrol.test.ts-snapshots/SegmentedControl-Dev-With-Sx-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
+8.01 KB
...ntrol.test.ts-snapshots/SegmentedControl-Dev-With-Sx-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
+8.11 KB
...ol.test.ts-snapshots/SegmentedControl-Dev-With-Sx-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
+8.1 KB
...SegmentedControl.test.ts-snapshots/SegmentedControl-Dev-With-Sx-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+8.01 KB
...ntrol.test.ts-snapshots/SegmentedControl-Dev-With-Sx-light-tritanopia-linux.png
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
packages/react/src/SegmentedControl/SegmentedControl.dev.stories.tsx
This file contains 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,78 @@ | ||
import React from 'react' | ||
import type {Meta} from '@storybook/react' | ||
import {SegmentedControl} from '.' | ||
import SegmentedControlIconButton from './SegmentedControlIconButton' | ||
import SegmentedControlButton from './SegmentedControlButton' | ||
import {EyeIcon, FileCodeIcon, PeopleIcon} from '@primer/octicons-react' | ||
|
||
const excludedControlKeys = ['variant'] | ||
|
||
export default { | ||
title: 'Components/SegmentedControl/Dev', | ||
component: SegmentedControl, | ||
subcomponents: {SegmentedControlButton, SegmentedControlIconButton}, | ||
parameters: {controls: {exclude: excludedControlKeys}}, | ||
} as Meta<typeof SegmentedControl> | ||
|
||
export const WithCss = () => ( | ||
<SegmentedControl aria-label="File view" className="testCustomClassnameMono"> | ||
<SegmentedControl.Button | ||
defaultSelected | ||
aria-label={'Preview'} | ||
leadingIcon={EyeIcon} | ||
className="testCustomClassnameColor" | ||
> | ||
Preview | ||
</SegmentedControl.Button> | ||
<SegmentedControl.Button aria-label={'Raw'} leadingIcon={FileCodeIcon} className="testCustomClassnameColor"> | ||
Raw | ||
</SegmentedControl.Button> | ||
<SegmentedControl.Button aria-label={'Blame'} leadingIcon={PeopleIcon} className="testCustomClassnameColor"> | ||
Blame | ||
</SegmentedControl.Button> | ||
</SegmentedControl> | ||
) | ||
|
||
export const WithSx = () => ( | ||
<SegmentedControl aria-label="File view" sx={{fontFamily: 'monospace'}}> | ||
<SegmentedControl.Button defaultSelected aria-label={'Preview'} leadingIcon={EyeIcon} sx={{color: 'success.fg'}}> | ||
Preview | ||
</SegmentedControl.Button> | ||
<SegmentedControl.Button aria-label={'Raw'} leadingIcon={FileCodeIcon} sx={{color: 'success.fg'}}> | ||
Raw | ||
</SegmentedControl.Button> | ||
<SegmentedControl.Button aria-label={'Blame'} leadingIcon={PeopleIcon} sx={{color: 'success.fg'}}> | ||
Blame | ||
</SegmentedControl.Button> | ||
</SegmentedControl> | ||
) | ||
|
||
export const WithSxAndCss = () => ( | ||
<SegmentedControl aria-label="File view" sx={{fontFamily: 'monospace'}} className="testCustomClassnameMono"> | ||
<SegmentedControl.Button | ||
defaultSelected | ||
aria-label={'Preview'} | ||
leadingIcon={EyeIcon} | ||
sx={{color: 'success.fg'}} | ||
className="testCustomClassnameColor" | ||
> | ||
Preview | ||
</SegmentedControl.Button> | ||
<SegmentedControl.Button | ||
aria-label={'Raw'} | ||
leadingIcon={FileCodeIcon} | ||
sx={{color: 'success.fg'}} | ||
className="testCustomClassnameColor" | ||
> | ||
Raw | ||
</SegmentedControl.Button> | ||
<SegmentedControl.Button | ||
aria-label={'Blame'} | ||
leadingIcon={PeopleIcon} | ||
sx={{color: 'success.fg'}} | ||
className="testCustomClassnameColor" | ||
> | ||
Blame | ||
</SegmentedControl.Button> | ||
</SegmentedControl> | ||
) |
This file contains 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