-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CheckBoxOrRadioGroup): Convert CheckBoxOrRadioGroup to CSS modul…
…es behind feature flag (#5275) * Convert CheckboxOrRadioGroup to CSS modules Co-authored-by: Marie Lucca <francinelucca@users.noreply.github.com> Co-authored-by: Tyler Jones <TylerJDev@users.noreply.github.com> * Adding e2e test for sx prop stress test * test(vrt): update snapshots * Fix circular dependency * Create lovely-stingrays-jog.md --------- Co-authored-by: Marie Lucca <francinelucca@users.noreply.github.com> Co-authored-by: Tyler Jones <TylerJDev@users.noreply.github.com> Co-authored-by: jonrohan <jonrohan@users.noreply.github.com>
- Loading branch information
1 parent
1cfbf63
commit d1b7bce
Showing
17 changed files
with
393 additions
and
175 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
Convert CheckBoxOrRadioGroup to CSS modules behind feature flag |
Binary file added
BIN
+12 KB
...heckboxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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
+12 KB
...ts/CheckboxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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
+11.9 KB
...kboxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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
+12 KB
...omponents/CheckboxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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
+12 KB
...heckboxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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
+12 KB
...eckboxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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
+11.9 KB
...boxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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
+11.9 KB
...mponents/CheckboxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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
+12 KB
...eckboxGroup.test.ts-snapshots/CheckboxGroup-SX-Props-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.
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
49 changes: 49 additions & 0 deletions
49
packages/react/src/CheckboxGroup/CheckboxGroup.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,49 @@ | ||
import React from 'react' | ||
import type {Meta} from '@storybook/react' | ||
import {Checkbox, CheckboxGroup, FormControl} from '..' | ||
|
||
export default { | ||
title: 'Components/CheckboxGroup/Dev', | ||
component: CheckboxGroup, | ||
parameters: {controls: {exclude: ['aria-labelledby', 'id', 'onChange', 'sx']}}, | ||
} as Meta | ||
|
||
export const SxProps = () => ( | ||
<CheckboxGroup | ||
sx={{ | ||
color: 'var(--fgColor-default, var(--color-fg-default))', | ||
my: '15px', | ||
}} | ||
> | ||
<CheckboxGroup.Caption | ||
sx={{ | ||
color: 'fg.muted', | ||
fontSize: 0, | ||
fontWeight: 400, | ||
}} | ||
> | ||
Caption | ||
</CheckboxGroup.Caption> | ||
<CheckboxGroup.Label | ||
sx={{ | ||
color: 'var(--fgColor-default, var(--color-fg-default))', | ||
fontSize: ['14px'], | ||
fontWeight: 600, | ||
}} | ||
> | ||
Choices | ||
</CheckboxGroup.Label> | ||
<FormControl required> | ||
<Checkbox value="one" defaultChecked /> | ||
<FormControl.Label>Choice one</FormControl.Label> | ||
</FormControl> | ||
<FormControl> | ||
<Checkbox value="two" defaultChecked /> | ||
<FormControl.Label>Choice two</FormControl.Label> | ||
</FormControl> | ||
<FormControl> | ||
<Checkbox value="three" /> | ||
<FormControl.Label>Choice three</FormControl.Label> | ||
</FormControl> | ||
</CheckboxGroup> | ||
) |
47 changes: 47 additions & 0 deletions
47
packages/react/src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css
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,47 @@ | ||
.Body { | ||
display: flex; | ||
padding: 0; | ||
margin: 0; | ||
list-style: none; | ||
flex-direction: column; | ||
|
||
& > * + * { | ||
margin-top: var(--base-size-8); | ||
} | ||
} | ||
|
||
.GroupFieldset { | ||
padding: 0; | ||
margin: 0; | ||
border: none; | ||
|
||
&:where([data-validation]) { | ||
margin-bottom: var(--base-size-8); | ||
} | ||
} | ||
|
||
.GroupLegend { | ||
padding: 0; | ||
|
||
&:where([data-legend-visible]) { | ||
margin-bottom: var(--base-size-8); | ||
} | ||
} | ||
|
||
.CheckboxOrRadioGroupCaption { | ||
font-size: var(--text-body-size-medium); | ||
color: var(--fgColor-muted); | ||
} | ||
|
||
.RadioGroupLabel { | ||
display: block; | ||
font-size: var(--text-body-size-large); | ||
|
||
&:where([data-label-disabled]) { | ||
color: var(--fgColor-muted); | ||
} | ||
} | ||
|
||
.GroupLabelChildren { | ||
margin-right: var(--base-size-8); | ||
} |
Oops, something went wrong.