Skip to content

Commit 648a731

Browse files
jhp0621Ji Hye ParkJi Hye ParkJi Hye Parkchawes13
authored
Labeled field updates (#595)
* Allows LabeledField to accept optional as prop and updates Checkbox+Radio Group * Uses css to visually hide label if set to false for Checkbox+Radio Groups to preserve html semantics * Displays required indicator and hint if provided * Updates dropdown-checkbox-group to match the same semantics as regular checkbox-group * Remove dropdown-checkbox-group component * Add Dropdown in storybook * Remove unused css files * Update styling * Define checkbox group container outside of component * Remove test suite re: missing legend * Set group role on labeled field and simplify classname logic * Move dropdown test suite into checkbox-group test file * Update comment * Update version * Update helper comment * Undo defining variable outside * use prepare for yarn run build * update comments * explicitly set true on useDropdown * update select component to use fieldset and legend * update tests to use test id for labeled field component * undo updates in select * rename prop * use option.value for key * update test * add dropdown checkboxgroup tests * add test units for updated legend * rename prop rename * update proptype * add migration guide * use shorthand assignment * add & update migration guide * use describe * conditionally set field-wrapper class name and remove data-testid * add visually hidden class assertion * replace example in test to use grouped elements * update param sentence * be explicit with allowed proptypes for wrapper element * fix typo * use markup for components * pass in is-active conditional classname on higher level * update dropdown select so the labels populate * Add a section about dropdown selection changes in migration guide * Update comments * wrap tests under describe * Use the correct labels for dropdown test * Pass in id for checkbox label that matches input id * Use labels for safe guard check --------- Co-authored-by: Ji Hye Park <jihyepark@Jis-MacBook-Pro.local> Co-authored-by: Ji Hye Park <jihyepark@jis-macbook-pro.attlocal.net> Co-authored-by: Ji Hye Park <jihyepark@Jis-MacBook-Pro.AN-700-AP-I-AC> Co-authored-by: Conor <conor@launchpadlab.com>
1 parent 9c27a1d commit 648a731

28 files changed

+1160
-1236
lines changed

.storybook/styles/application.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ $output-bourbon-deprecation-warnings: false;
4848
@import 'components/progress-circle';
4949
@import 'components/login';
5050
@import 'components/pagination';
51-
@import 'components/sidebar-content';
5251
@import 'components/radio';
5352
@import 'components/tabs';
53+
@import 'components/visually-hidden';
5454

5555
// Page Styles
5656
@import 'pages/main';
57-
@import 'pages/styleguide';

.storybook/styles/components/_forms.scss

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-----------------------
2-
Fieldset
2+
Fieldsets and Field Wrappers
33
-----------------------*/
4-
fieldset {
4+
fieldset, .field-wrapper {
55
display: inline-block;
66
@include rem(margin-top, 15px);
77
position: relative;
@@ -64,12 +64,17 @@ Input Icon
6464
@include rem(padding-left, 30px);
6565
}
6666

67-
i {
68-
@include position(absolute, 1px null null 10px);
69-
background-repeat: no-repeat;
70-
background-size: 15px;
71-
height: 20px;
72-
width: 20px;
67+
.input-wrapper {
68+
position: relative;
69+
70+
i {
71+
@include position(absolute, 3px null null 10px);
72+
background-repeat: no-repeat;
73+
background-size: 15px;
74+
display: inline-block;
75+
height: 20px;
76+
width: 20px;
77+
}
7378
}
7479

7580
.mail-icon:after {
@@ -404,29 +409,6 @@ Button Area
404409
width: 135px;
405410
}
406411

407-
/*-----------------------
408-
Input Icon
409-
-----------------------*/
410-
.icon-label {
411-
position: relative;
412-
input {
413-
@include rem(padding-left, 30px);
414-
}
415-
416-
.input-wrapper {
417-
position: relative;
418-
419-
i {
420-
@include position(absolute, 3px null null 10px);
421-
background-repeat: no-repeat;
422-
background-size: 15px;
423-
display: inline-block;
424-
height: 20px;
425-
width: 20px;
426-
}
427-
}
428-
}
429-
430412
/*-----------------------
431413
Custom Dropdown Select
432414
-----------------------*/
@@ -571,13 +553,8 @@ Custom Dropdown Select
571553
}
572554
}
573555

574-
fieldset.checkbox,
575-
fieldset.CheckboxGroup {
576-
width: 100% !important;
577-
578-
input {
579-
border: 1px solid $white-med;
580-
}
556+
.checkbox {
557+
width: 100%;
581558
}
582559
}
583560

.storybook/styles/components/_sidebar-content.scss

Lines changed: 0 additions & 107 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Visually Hidden Element
2+
// https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
3+
4+
// In the rare case that this is applied to an interactive element, show the
5+
// element temporarily when it receives focus (for keyboard users)
6+
7+
.visually-hidden:not(:focus):not(:active) {
8+
clip: rect(0 0 0 0) !important;
9+
clip-path: inset(50%) !important;
10+
height: 1px !important;
11+
width: 1px !important;
12+
overflow: hidden !important;
13+
position: absolute !important;
14+
white-space: nowrap !important;
15+
border: 0 !important;
16+
padding: 0 !important;
17+
}

.storybook/styles/pages/_styleguide.scss

Lines changed: 0 additions & 53 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Documentation and usage info can be found in [docs.md](docs.md).
2929
- [v7.0.0](migration-guides/v7.0.0.md)
3030
- [v8.0.0](migration-guides/v8.0.0.md)
3131
- [v9.0.0](migration-guides/v9.0.0.md)
32+
- [v10.0.0](migration-guides/v10.0.0.md)
3233

3334
## Contribution
3435

0 commit comments

Comments
 (0)