-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Fieldset): update styles to support new 2.0 components (#2023)
- add in new props - update tests - add in warnings and assertions (with tests) - add in implementation examples for using radio buttons and checkboxes
- Loading branch information
1 parent
cc99f7e
commit e542b32
Showing
12 changed files
with
1,049 additions
and
284 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { generateSnapshots } from '@chanzuckerberg/story-utils'; | ||
import * as stories from './{{pascalCase name}}.stories'; | ||
import type { StoryFile } from '../../util/utility-types'; | ||
|
||
describe('<{{pascalCase name}} />', () => { | ||
generateSnapshots(stories); | ||
generateSnapshots(stories as StoryFile); | ||
}); |
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
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
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 |
---|---|---|
@@ -1,50 +1,38 @@ | ||
@import '../../design-tokens/mixins.css'; | ||
.fieldset__footer { | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
/*------------------------------------*\ | ||
# FIELDSET | ||
\*------------------------------------*/ | ||
|
||
/** | ||
* The fieldset groups a legend and several controls. | ||
*/ | ||
.fieldset { | ||
@mixin fieldsetStyles; | ||
/* Overrides default browser styling. */ | ||
margin: calc(var(--eds-size-2) / 16 * 1rem); | ||
margin-top: calc(var(--eds-size-3) / 16 * 1rem); | ||
} | ||
|
||
/*------------------------------------*\ | ||
# FIELDSET ITEMS | ||
\*------------------------------------*/ | ||
|
||
/** | ||
* The contents of the fieldset. Spaces them apart. | ||
*/ | ||
.fieldset-items > :not(:last-child) { | ||
margin-bottom: calc(var(--eds-size-1-and-half) / 16 * 1rem); | ||
margin-bottom: calc(var(--eds-size-2) / 16 * 1rem); | ||
} | ||
|
||
/*------------------------------------*\ | ||
# FIELDSET LEGEND | ||
\*------------------------------------*/ | ||
|
||
/** | ||
* A label that's rendered as a <legend> for fieldsets. | ||
* It contains the same characteristics as a label (ability to add flag for optional field, etc), | ||
* but semantically/stylistically a bit different. | ||
*/ | ||
.fieldset-legend { | ||
/* Removes some default browser styles. */ | ||
@mixin legendReset; | ||
font: var(--eds-theme-typography-form-label); | ||
/* Adjust margin between legend and option list */ | ||
margin-bottom: calc(var(--eds-size-2) / 16 * 1rem); | ||
margin-bottom: calc(var(--eds-size-3) / 16 * 1rem); | ||
} | ||
|
||
/** | ||
* Label flag to mark whether or not a field is required | ||
* or optional. Currently a flag is only present for optional fields | ||
* | ||
* TODO: remove as deprecated with v16 of EDS | ||
*/ | ||
.fieldset-legend__flag { | ||
font: var(--eds-theme-typography-body-sm); | ||
} | ||
|
||
.fieldset-legend__overline { | ||
display: flex; | ||
align-items: center; | ||
gap: calc(var(--eds-size-half) / 16 * 1rem); | ||
} |
Oops, something went wrong.