@nypl/design-system-react-components 0.28.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +10 -10
- package/dist/components/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +8 -0
- package/dist/components/Heading/Heading.d.ts +2 -0
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/LogoSvgs.d.ts +4 -0
- package/dist/design-system-react-components.cjs.development.js +1021 -683
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +1022 -684
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/theme/components/button.d.ts +1 -0
- package/dist/theme/components/card.d.ts +98 -13
- package/dist/theme/components/checkboxGroup.d.ts +1 -1
- package/dist/theme/components/global.d.ts +1 -1
- package/dist/theme/components/heading.d.ts +4 -16
- package/dist/theme/components/image.d.ts +6 -0
- package/dist/theme/components/radioGroup.d.ts +1 -1
- package/dist/theme/components/skipNavigation.d.ts +3 -0
- package/dist/theme/components/structuredContent.d.ts +0 -5
- package/dist/utils/utils.d.ts +15 -0
- package/package.json +6 -6
- package/src/components/Accordion/Accordion.stories.mdx +18 -46
- package/src/components/Accordion/Accordion.tsx +3 -2
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +12 -12
- package/src/components/Button/Button.stories.mdx +1 -1
- package/src/components/ButtonGroup/ButtonGroup.stories.mdx +33 -2
- package/src/components/ButtonGroup/ButtonGroup.tsx +2 -1
- package/src/components/Card/Card.stories.mdx +2 -4
- package/src/components/Card/Card.tsx +2 -1
- package/src/components/Chakra/Box.stories.mdx +1 -1
- package/src/components/Chakra/Center.stories.mdx +1 -1
- package/src/components/Chakra/Flex.stories.mdx +1 -1
- package/src/components/Chakra/Grid.stories.mdx +1 -1
- package/src/components/Chakra/Stack.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +42 -11
- package/src/components/Checkbox/Checkbox.tsx +25 -39
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +589 -544
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +1 -1
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1540 -1420
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +12 -3
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +5 -0
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +36 -17
- package/src/components/Grid/SimpleGrid.stories.mdx +1 -3
- package/src/components/Heading/Heading.stories.mdx +4 -1
- package/src/components/Heading/Heading.tsx +4 -1
- package/src/components/Image/Image.stories.mdx +1 -1
- package/src/components/Logo/Logo.stories.mdx +10 -5
- package/src/components/Logo/Logo.tsx +4 -0
- package/src/components/Logo/LogoSvgs.tsx +8 -0
- package/src/components/Modal/Modal.stories.mdx +83 -90
- package/src/components/Pagination/Pagination.stories.mdx +1 -1
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/Radio/Radio.tsx +22 -31
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +405 -365
- package/src/components/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/components/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1236 -1116
- package/src/components/SearchBar/SearchBar.stories.mdx +3 -3
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +32 -10
- package/src/components/Select/Select.stories.mdx +1 -1
- package/src/components/Select/Select.tsx +24 -22
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +21 -11
- package/src/components/SkipNavigation/SkipNavigation.stories.mdx +2 -2
- package/src/components/Slider/Slider.stories.mdx +1 -1
- package/src/components/Slider/Slider.tsx +14 -14
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +66 -33
- package/src/components/StyleGuide/Buttons.stories.mdx +1 -1
- package/src/components/StyleGuide/Colors.stories.mdx +2 -2
- package/src/components/StyleGuide/Forms.stories.mdx +2 -1
- package/src/components/StyleGuide/Iconography.stories.mdx +2 -2
- package/src/components/StyleGuide/Spacing.stories.mdx +1 -1
- package/src/components/StyleGuide/Typography.stories.mdx +1 -1
- package/src/components/Table/Table.stories.mdx +1 -5
- package/src/components/Table/Table.test.tsx +33 -0
- package/src/components/Table/Table.tsx +21 -0
- package/src/components/Template/Template.stories.mdx +9 -5
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/TextInput/TextInput.tsx +21 -21
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +19 -9
- package/src/components/Toggle/Toggle.stories.mdx +1 -1
- package/src/components/Toggle/Toggle.tsx +22 -20
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +400 -372
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +1 -0
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +5 -0
- package/src/docs/Chakra.stories.mdx +2 -2
- package/src/theme/components/button.ts +1 -0
- package/src/theme/components/card.ts +9 -3
- package/src/theme/components/componentWrapper.ts +1 -1
- package/src/theme/components/global.ts +1 -1
- package/src/theme/components/heading.ts +3 -3
- package/src/theme/components/image.ts +1 -0
- package/src/theme/components/skipNavigation.ts +3 -0
- package/src/theme/foundations/colors.ts +6 -9
- package/src/utils/utils.ts +40 -0
|
@@ -164,8 +164,8 @@ screenreaders to pick up this entire search form.
|
|
|
164
164
|
|
|
165
165
|
Resources:
|
|
166
166
|
|
|
167
|
-
- [Reservoir Select](https://nypl.github.io/nypl-design-system/
|
|
168
|
-
- [Reservoir TextInput](https://nypl.github.io/nypl-design-system/
|
|
167
|
+
- [Reservoir Select](https://nypl.github.io/nypl-design-system/reservoir/v1/?path=/docs/components-form-elements-select--select-with-controls)
|
|
168
|
+
- [Reservoir TextInput](https://nypl.github.io/nypl-design-system/reservoir/v1/?path=/docs/components-form-elements-textinput--text-input-with-controls)
|
|
169
169
|
- [a11ymatters Accessible Search Form](https://www.a11ymatters.com/pattern/accessible-search/)
|
|
170
170
|
- [MDN ARIA: search role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/search_role)
|
|
171
171
|
|
|
@@ -310,7 +310,7 @@ const helperText = "";
|
|
|
310
310
|
While the Design System does not implement an `Autosuggest` or `Autocomplete`
|
|
311
311
|
component, it does show a pattern for using the `react-autosuggest` package.
|
|
312
312
|
In this example, we're using the `react-autosuggest` example found in the
|
|
313
|
-
[Basic Autosuggest story](https://nypl.github.io/nypl-design-system/
|
|
313
|
+
[Basic Autosuggest story](https://nypl.github.io/nypl-design-system/reservoir/v1/?path=/docs/development-guide-autosuggest--autosuggest-library)
|
|
314
314
|
as the main component inside the `SearchBar` component.
|
|
315
315
|
|
|
316
316
|
In order to render this custom input element in the `SearchBar` component, pass
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
exports[`SearchBar renders the UI snapshot correctly 1`] = `
|
|
4
4
|
<div
|
|
5
5
|
className="css-1xdhyk6"
|
|
6
|
+
id="basic-wrapper"
|
|
6
7
|
>
|
|
7
8
|
<form
|
|
8
9
|
aria-label="SearchBar label - Search for items in Animal Crossing New Horizons"
|
|
@@ -12,7 +13,8 @@ exports[`SearchBar renders the UI snapshot correctly 1`] = `
|
|
|
12
13
|
role="search"
|
|
13
14
|
>
|
|
14
15
|
<div
|
|
15
|
-
className="css-
|
|
16
|
+
className="css-1u8qly9"
|
|
17
|
+
id="searchbar-textinput-basic-wrapper"
|
|
16
18
|
>
|
|
17
19
|
<input
|
|
18
20
|
aria-label="Item Search"
|
|
@@ -89,6 +91,7 @@ exports[`SearchBar renders the UI snapshot correctly 1`] = `
|
|
|
89
91
|
exports[`SearchBar renders the UI snapshot correctly 2`] = `
|
|
90
92
|
<div
|
|
91
93
|
className="css-1xdhyk6"
|
|
94
|
+
id="withSelect-wrapper"
|
|
92
95
|
>
|
|
93
96
|
<form
|
|
94
97
|
aria-label="SearchBar label - Search for items in Animal Crossing New Horizons"
|
|
@@ -98,7 +101,8 @@ exports[`SearchBar renders the UI snapshot correctly 2`] = `
|
|
|
98
101
|
role="search"
|
|
99
102
|
>
|
|
100
103
|
<div
|
|
101
|
-
className="css-
|
|
104
|
+
className="css-1u8qly9"
|
|
105
|
+
id="searchbar-select-withSelect-wrapper"
|
|
102
106
|
>
|
|
103
107
|
<div
|
|
104
108
|
className="css-0"
|
|
@@ -217,7 +221,8 @@ exports[`SearchBar renders the UI snapshot correctly 2`] = `
|
|
|
217
221
|
|
|
218
222
|
</div>
|
|
219
223
|
<div
|
|
220
|
-
className="css-
|
|
224
|
+
className="css-1u8qly9"
|
|
225
|
+
id="searchbar-textinput-withSelect-wrapper"
|
|
221
226
|
>
|
|
222
227
|
<input
|
|
223
228
|
aria-label="Item Search"
|
|
@@ -294,6 +299,7 @@ exports[`SearchBar renders the UI snapshot correctly 2`] = `
|
|
|
294
299
|
exports[`SearchBar renders the UI snapshot correctly 3`] = `
|
|
295
300
|
<div
|
|
296
301
|
className="css-1xdhyk6"
|
|
302
|
+
id="withoutHelperText-wrapper"
|
|
297
303
|
>
|
|
298
304
|
<form
|
|
299
305
|
aria-label="SearchBar label"
|
|
@@ -303,7 +309,8 @@ exports[`SearchBar renders the UI snapshot correctly 3`] = `
|
|
|
303
309
|
role="search"
|
|
304
310
|
>
|
|
305
311
|
<div
|
|
306
|
-
className="css-
|
|
312
|
+
className="css-1u8qly9"
|
|
313
|
+
id="searchbar-textinput-withoutHelperText-wrapper"
|
|
307
314
|
>
|
|
308
315
|
<input
|
|
309
316
|
aria-label="Item Search"
|
|
@@ -368,6 +375,7 @@ exports[`SearchBar renders the UI snapshot correctly 3`] = `
|
|
|
368
375
|
exports[`SearchBar renders the UI snapshot correctly 4`] = `
|
|
369
376
|
<div
|
|
370
377
|
className="css-1xdhyk6"
|
|
378
|
+
id="invalidState-wrapper"
|
|
371
379
|
>
|
|
372
380
|
<form
|
|
373
381
|
aria-label="SearchBar label"
|
|
@@ -377,7 +385,8 @@ exports[`SearchBar renders the UI snapshot correctly 4`] = `
|
|
|
377
385
|
role="search"
|
|
378
386
|
>
|
|
379
387
|
<div
|
|
380
|
-
className="css-
|
|
388
|
+
className="css-1u8qly9"
|
|
389
|
+
id="searchbar-textinput-invalidState-wrapper"
|
|
381
390
|
>
|
|
382
391
|
<input
|
|
383
392
|
aria-invalid={true}
|
|
@@ -442,6 +451,7 @@ exports[`SearchBar renders the UI snapshot correctly 4`] = `
|
|
|
442
451
|
exports[`SearchBar renders the UI snapshot correctly 5`] = `
|
|
443
452
|
<div
|
|
444
453
|
className="css-1xdhyk6"
|
|
454
|
+
id="disabledState-wrapper"
|
|
445
455
|
>
|
|
446
456
|
<form
|
|
447
457
|
aria-label="SearchBar label"
|
|
@@ -451,7 +461,8 @@ exports[`SearchBar renders the UI snapshot correctly 5`] = `
|
|
|
451
461
|
role="search"
|
|
452
462
|
>
|
|
453
463
|
<div
|
|
454
|
-
className="css-
|
|
464
|
+
className="css-1u8qly9"
|
|
465
|
+
id="searchbar-textinput-disabledState-wrapper"
|
|
455
466
|
>
|
|
456
467
|
<input
|
|
457
468
|
aria-label="Item Search"
|
|
@@ -517,6 +528,7 @@ exports[`SearchBar renders the UI snapshot correctly 5`] = `
|
|
|
517
528
|
exports[`SearchBar renders the UI snapshot correctly 6`] = `
|
|
518
529
|
<div
|
|
519
530
|
className="css-1xdhyk6"
|
|
531
|
+
id="requiredState-wrapper"
|
|
520
532
|
>
|
|
521
533
|
<form
|
|
522
534
|
aria-label="SearchBar label"
|
|
@@ -526,7 +538,8 @@ exports[`SearchBar renders the UI snapshot correctly 6`] = `
|
|
|
526
538
|
role="search"
|
|
527
539
|
>
|
|
528
540
|
<div
|
|
529
|
-
className="css-
|
|
541
|
+
className="css-1u8qly9"
|
|
542
|
+
id="searchbar-textinput-requiredState-wrapper"
|
|
530
543
|
>
|
|
531
544
|
<input
|
|
532
545
|
aria-label="Item Search"
|
|
@@ -593,6 +606,7 @@ exports[`SearchBar renders the UI snapshot correctly 6`] = `
|
|
|
593
606
|
exports[`SearchBar renders the UI snapshot correctly 7`] = `
|
|
594
607
|
<div
|
|
595
608
|
className="css-1xdhyk6"
|
|
609
|
+
id="noBrandButtonType-wrapper"
|
|
596
610
|
>
|
|
597
611
|
<form
|
|
598
612
|
aria-label="SearchBar label"
|
|
@@ -602,7 +616,8 @@ exports[`SearchBar renders the UI snapshot correctly 7`] = `
|
|
|
602
616
|
role="search"
|
|
603
617
|
>
|
|
604
618
|
<div
|
|
605
|
-
className="css-
|
|
619
|
+
className="css-1u8qly9"
|
|
620
|
+
id="searchbar-textinput-noBrandButtonType-wrapper"
|
|
606
621
|
>
|
|
607
622
|
<input
|
|
608
623
|
aria-label="Item Search"
|
|
@@ -669,6 +684,7 @@ exports[`SearchBar renders the UI snapshot correctly 7`] = `
|
|
|
669
684
|
exports[`SearchBar renders the UI snapshot correctly 8`] = `
|
|
670
685
|
<div
|
|
671
686
|
className="css-1xdhyk6"
|
|
687
|
+
id="withHeading-wrapper"
|
|
672
688
|
>
|
|
673
689
|
<h2
|
|
674
690
|
className="chakra-heading css-1xdhyk6"
|
|
@@ -730,6 +746,7 @@ exports[`SearchBar renders the UI snapshot correctly 8`] = `
|
|
|
730
746
|
exports[`SearchBar renders the UI snapshot correctly 9`] = `
|
|
731
747
|
<div
|
|
732
748
|
className="css-1xdhyk6"
|
|
749
|
+
id="withDescription-wrapper"
|
|
733
750
|
>
|
|
734
751
|
<p
|
|
735
752
|
className="chakra-text css-1xdhyk6"
|
|
@@ -790,6 +807,7 @@ exports[`SearchBar renders the UI snapshot correctly 9`] = `
|
|
|
790
807
|
exports[`SearchBar renders the UI snapshot correctly 10`] = `
|
|
791
808
|
<div
|
|
792
809
|
className="css-1xdhyk6"
|
|
810
|
+
id="withHeadingAndDescription-wrapper"
|
|
793
811
|
>
|
|
794
812
|
<h2
|
|
795
813
|
className="chakra-heading css-1xdhyk6"
|
|
@@ -856,6 +874,7 @@ exports[`SearchBar renders the UI snapshot correctly 10`] = `
|
|
|
856
874
|
exports[`SearchBar renders the UI snapshot correctly 11`] = `
|
|
857
875
|
<div
|
|
858
876
|
className="css-1xdhyk6"
|
|
877
|
+
id="chakra-wrapper"
|
|
859
878
|
>
|
|
860
879
|
<form
|
|
861
880
|
aria-label="SearchBar label - Search for items in Animal Crossing New Horizons"
|
|
@@ -865,7 +884,8 @@ exports[`SearchBar renders the UI snapshot correctly 11`] = `
|
|
|
865
884
|
role="search"
|
|
866
885
|
>
|
|
867
886
|
<div
|
|
868
|
-
className="css-
|
|
887
|
+
className="css-1u8qly9"
|
|
888
|
+
id="searchbar-textinput-chakra-wrapper"
|
|
869
889
|
>
|
|
870
890
|
<input
|
|
871
891
|
aria-label="Item Search"
|
|
@@ -943,6 +963,7 @@ exports[`SearchBar renders the UI snapshot correctly 12`] = `
|
|
|
943
963
|
<div
|
|
944
964
|
className="css-1xdhyk6"
|
|
945
965
|
data-testid="props"
|
|
966
|
+
id="props-wrapper"
|
|
946
967
|
>
|
|
947
968
|
<form
|
|
948
969
|
aria-label="SearchBar label - Search for items in Animal Crossing New Horizons"
|
|
@@ -952,7 +973,8 @@ exports[`SearchBar renders the UI snapshot correctly 12`] = `
|
|
|
952
973
|
role="search"
|
|
953
974
|
>
|
|
954
975
|
<div
|
|
955
|
-
className="css-
|
|
976
|
+
className="css-1u8qly9"
|
|
977
|
+
id="searchbar-textinput-props-wrapper"
|
|
956
978
|
>
|
|
957
979
|
<input
|
|
958
980
|
aria-label="Item Search"
|
|
@@ -6,12 +6,11 @@ import {
|
|
|
6
6
|
} from "@chakra-ui/react";
|
|
7
7
|
import React, { useEffect, useState, useRef } from "react";
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
} from "../HelperErrorText/HelperErrorText";
|
|
9
|
+
import ComponentWrapper from "../ComponentWrapper/ComponentWrapper";
|
|
10
|
+
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
12
11
|
import Icon from "../Icons/Icon";
|
|
13
12
|
import Label from "../Label/Label";
|
|
14
|
-
import {
|
|
13
|
+
import { getAriaAttrs } from "../../utils/utils";
|
|
15
14
|
|
|
16
15
|
export type SelectTypes = "default" | "searchbar";
|
|
17
16
|
export type LabelPositions = "default" | "inline";
|
|
@@ -89,7 +88,6 @@ export const Select = chakra(
|
|
|
89
88
|
value = "",
|
|
90
89
|
...rest
|
|
91
90
|
} = props;
|
|
92
|
-
const ariaAttributes: AriaAttributes = {};
|
|
93
91
|
const [labelWidth, setLabelWidth] = useState<number>(0);
|
|
94
92
|
const labelRef = useRef<HTMLDivElement>(null);
|
|
95
93
|
const styles = useMultiStyleConfig("CustomSelect", {
|
|
@@ -100,6 +98,13 @@ export const Select = chakra(
|
|
|
100
98
|
? invalidText
|
|
101
99
|
: "There is an error related to this field.";
|
|
102
100
|
const footnote = isInvalid ? finalInvalidText : helperText;
|
|
101
|
+
const ariaAttributes = getAriaAttrs({
|
|
102
|
+
footnote,
|
|
103
|
+
id,
|
|
104
|
+
labelText,
|
|
105
|
+
name: "Select",
|
|
106
|
+
showLabel,
|
|
107
|
+
});
|
|
103
108
|
// To control the `Select` component, both `onChange` and `value`
|
|
104
109
|
// must be passed.
|
|
105
110
|
const controlledProps = onChange ? { onChange, value } : {};
|
|
@@ -108,13 +113,6 @@ export const Select = chakra(
|
|
|
108
113
|
// when the labelPosition is inline (equivalent to --nypl-space-xs).
|
|
109
114
|
const labelSelectGap = 8;
|
|
110
115
|
|
|
111
|
-
if (!showLabel) {
|
|
112
|
-
ariaAttributes["aria-label"] =
|
|
113
|
-
labelText && footnote ? `${labelText} - ${footnote}` : labelText;
|
|
114
|
-
} else if (helperText) {
|
|
115
|
-
ariaAttributes["aria-describedby"] = `${id}-helperText`;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
116
|
if (!id) {
|
|
119
117
|
console.warn(
|
|
120
118
|
"NYPL Reservoir Select: This component's required `id` prop was not passed."
|
|
@@ -133,7 +131,19 @@ export const Select = chakra(
|
|
|
133
131
|
}, [labelPosition]);
|
|
134
132
|
|
|
135
133
|
return (
|
|
136
|
-
<
|
|
134
|
+
<ComponentWrapper
|
|
135
|
+
className={className}
|
|
136
|
+
helperText={helperText}
|
|
137
|
+
helperTextStyles={{
|
|
138
|
+
marginLeft: { sm: "auto", md: `${labelWidth}px` },
|
|
139
|
+
}}
|
|
140
|
+
id={id}
|
|
141
|
+
invalidText={finalInvalidText}
|
|
142
|
+
isInvalid={isInvalid}
|
|
143
|
+
showHelperInvalidText={showHelperInvalidText}
|
|
144
|
+
__css={styles}
|
|
145
|
+
{...rest}
|
|
146
|
+
>
|
|
137
147
|
<Box __css={labelPosition === "inline" && styles.inline}>
|
|
138
148
|
{showLabel && (
|
|
139
149
|
<Box ref={labelRef}>
|
|
@@ -164,15 +174,7 @@ export const Select = chakra(
|
|
|
164
174
|
{children}
|
|
165
175
|
</ChakraSelect>
|
|
166
176
|
</Box>
|
|
167
|
-
|
|
168
|
-
<HelperErrorText
|
|
169
|
-
id={`${id}-helperText`}
|
|
170
|
-
isInvalid={isInvalid}
|
|
171
|
-
text={footnote}
|
|
172
|
-
ml={{ sm: "auto", md: `${labelWidth}px` }}
|
|
173
|
-
/>
|
|
174
|
-
)}
|
|
175
|
-
</Box>
|
|
177
|
+
</ComponentWrapper>
|
|
176
178
|
);
|
|
177
179
|
}
|
|
178
180
|
)
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Select Renders the UI snapshot correctly 1`] = `
|
|
4
4
|
<div
|
|
5
|
-
className="css-
|
|
5
|
+
className="css-1u8qly9"
|
|
6
|
+
id="select-wrapper"
|
|
6
7
|
>
|
|
7
8
|
<div
|
|
8
9
|
className="css-0"
|
|
@@ -96,7 +97,8 @@ exports[`Select Renders the UI snapshot correctly 1`] = `
|
|
|
96
97
|
|
|
97
98
|
exports[`Select Renders the UI snapshot correctly 2`] = `
|
|
98
99
|
<div
|
|
99
|
-
className="css-
|
|
100
|
+
className="css-1u8qly9"
|
|
101
|
+
id="select-wrapper"
|
|
100
102
|
>
|
|
101
103
|
<div
|
|
102
104
|
className="css-0"
|
|
@@ -191,7 +193,8 @@ exports[`Select Renders the UI snapshot correctly 2`] = `
|
|
|
191
193
|
|
|
192
194
|
exports[`Select Renders the UI snapshot correctly 3`] = `
|
|
193
195
|
<div
|
|
194
|
-
className="css-
|
|
196
|
+
className="css-1u8qly9"
|
|
197
|
+
id="select-wrapper"
|
|
195
198
|
>
|
|
196
199
|
<div
|
|
197
200
|
className="css-0"
|
|
@@ -211,6 +214,7 @@ exports[`Select Renders the UI snapshot correctly 3`] = `
|
|
|
211
214
|
className="chakra-select__wrapper css-42b2qy"
|
|
212
215
|
>
|
|
213
216
|
<select
|
|
217
|
+
aria-describedby="select-helperText"
|
|
214
218
|
aria-invalid={true}
|
|
215
219
|
className="chakra-select css-1ik61og"
|
|
216
220
|
disabled={false}
|
|
@@ -284,7 +288,7 @@ exports[`Select Renders the UI snapshot correctly 3`] = `
|
|
|
284
288
|
<div
|
|
285
289
|
aria-atomic={true}
|
|
286
290
|
aria-live="polite"
|
|
287
|
-
className="css-
|
|
291
|
+
className="css-1sax8hu"
|
|
288
292
|
dangerouslySetInnerHTML={
|
|
289
293
|
Object {
|
|
290
294
|
"__html": "Tom doesn't count as a sibling :(.",
|
|
@@ -298,7 +302,8 @@ exports[`Select Renders the UI snapshot correctly 3`] = `
|
|
|
298
302
|
|
|
299
303
|
exports[`Select Renders the UI snapshot correctly 4`] = `
|
|
300
304
|
<div
|
|
301
|
-
className="css-
|
|
305
|
+
className="css-1u8qly9"
|
|
306
|
+
id="select-wrapper"
|
|
302
307
|
>
|
|
303
308
|
<div
|
|
304
309
|
className="css-0"
|
|
@@ -391,7 +396,7 @@ exports[`Select Renders the UI snapshot correctly 4`] = `
|
|
|
391
396
|
<div
|
|
392
397
|
aria-atomic={true}
|
|
393
398
|
aria-live="off"
|
|
394
|
-
className="css-
|
|
399
|
+
className="css-1sax8hu"
|
|
395
400
|
dangerouslySetInnerHTML={
|
|
396
401
|
Object {
|
|
397
402
|
"__html": "Remember, Logan will judge you no matter who you pick.",
|
|
@@ -405,7 +410,8 @@ exports[`Select Renders the UI snapshot correctly 4`] = `
|
|
|
405
410
|
|
|
406
411
|
exports[`Select Renders the UI snapshot correctly 5`] = `
|
|
407
412
|
<div
|
|
408
|
-
className="css-
|
|
413
|
+
className="css-1u8qly9"
|
|
414
|
+
id="select-wrapper"
|
|
409
415
|
>
|
|
410
416
|
<div
|
|
411
417
|
className="css-0"
|
|
@@ -503,7 +509,8 @@ exports[`Select Renders the UI snapshot correctly 5`] = `
|
|
|
503
509
|
|
|
504
510
|
exports[`Select Renders the UI snapshot correctly 6`] = `
|
|
505
511
|
<div
|
|
506
|
-
className="css-
|
|
512
|
+
className="css-1u8qly9"
|
|
513
|
+
id="select-wrapper"
|
|
507
514
|
>
|
|
508
515
|
<div
|
|
509
516
|
className="css-0"
|
|
@@ -601,7 +608,8 @@ exports[`Select Renders the UI snapshot correctly 6`] = `
|
|
|
601
608
|
|
|
602
609
|
exports[`Select Renders the UI snapshot correctly 7`] = `
|
|
603
610
|
<div
|
|
604
|
-
className="css-
|
|
611
|
+
className="css-1u8qly9"
|
|
612
|
+
id="select-wrapper"
|
|
605
613
|
>
|
|
606
614
|
<div
|
|
607
615
|
className="css-0"
|
|
@@ -697,7 +705,8 @@ exports[`Select Renders the UI snapshot correctly 7`] = `
|
|
|
697
705
|
|
|
698
706
|
exports[`Select Renders the UI snapshot correctly 8`] = `
|
|
699
707
|
<div
|
|
700
|
-
className="css-
|
|
708
|
+
className="css-1y4kn3e"
|
|
709
|
+
id="chakra-wrapper"
|
|
701
710
|
>
|
|
702
711
|
<div
|
|
703
712
|
className="css-0"
|
|
@@ -791,8 +800,9 @@ exports[`Select Renders the UI snapshot correctly 8`] = `
|
|
|
791
800
|
|
|
792
801
|
exports[`Select Renders the UI snapshot correctly 9`] = `
|
|
793
802
|
<div
|
|
794
|
-
className="css-
|
|
803
|
+
className="css-1u8qly9"
|
|
795
804
|
data-testid="props"
|
|
805
|
+
id="props-wrapper"
|
|
796
806
|
>
|
|
797
807
|
<div
|
|
798
808
|
className="css-0"
|
|
@@ -29,7 +29,7 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
29
29
|
| Component Version | DS Version |
|
|
30
30
|
| ----------------- | ---------- |
|
|
31
31
|
| Added | `0.28.0` |
|
|
32
|
-
| Latest | `0.
|
|
32
|
+
| Latest | `1.0.2` |
|
|
33
33
|
|
|
34
34
|
## Table of Contents
|
|
35
35
|
|
|
@@ -59,7 +59,7 @@ intentional as the links should initially be visually hidden.**
|
|
|
59
59
|
>
|
|
60
60
|
{(args) => (
|
|
61
61
|
<>
|
|
62
|
-
<Button>Focus on me and then press "tab"</Button>
|
|
62
|
+
<Button id="example-btn">Focus on me and then press "tab"</Button>
|
|
63
63
|
<SkipNavigation {...args} />
|
|
64
64
|
</>
|
|
65
65
|
)}
|
|
@@ -13,10 +13,9 @@ import {
|
|
|
13
13
|
} from "@chakra-ui/react";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
|
|
16
|
+
import ComponentWrapper from "../ComponentWrapper/ComponentWrapper";
|
|
16
17
|
import Label from "../Label/Label";
|
|
17
|
-
import HelperErrorText
|
|
18
|
-
HelperErrorTextType,
|
|
19
|
-
} from "../HelperErrorText/HelperErrorText";
|
|
18
|
+
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
20
19
|
import TextInput, { TextInputTypes } from "../TextInput/TextInput";
|
|
21
20
|
|
|
22
21
|
export interface SliderProps {
|
|
@@ -120,7 +119,7 @@ export const Slider = chakra((props: React.PropsWithChildren<SliderProps>) => {
|
|
|
120
119
|
if (isRangeSlider && currentValue[0] > currentValue[1]) {
|
|
121
120
|
finalIsInvalid = true;
|
|
122
121
|
}
|
|
123
|
-
const footnote = finalIsInvalid ? invalidText : helperText;
|
|
122
|
+
// const footnote = finalIsInvalid ? invalidText : helperText;
|
|
124
123
|
const styles = useMultiStyleConfig("CustomSlider", {
|
|
125
124
|
isDisabled,
|
|
126
125
|
isInvalid: finalIsInvalid,
|
|
@@ -276,7 +275,16 @@ export const Slider = chakra((props: React.PropsWithChildren<SliderProps>) => {
|
|
|
276
275
|
};
|
|
277
276
|
|
|
278
277
|
return (
|
|
279
|
-
<
|
|
278
|
+
<ComponentWrapper
|
|
279
|
+
className={className}
|
|
280
|
+
helperText={helperText}
|
|
281
|
+
id={id}
|
|
282
|
+
invalidText={invalidText}
|
|
283
|
+
isInvalid={finalIsInvalid}
|
|
284
|
+
showHelperInvalidText={showHelperInvalidText}
|
|
285
|
+
__css={styles}
|
|
286
|
+
{...rest}
|
|
287
|
+
>
|
|
280
288
|
{showLabel && (
|
|
281
289
|
<Label
|
|
282
290
|
id={`${id}-label`}
|
|
@@ -307,15 +315,7 @@ export const Slider = chakra((props: React.PropsWithChildren<SliderProps>) => {
|
|
|
307
315
|
|
|
308
316
|
{showBoxes && getTextInput("end")}
|
|
309
317
|
</Box>
|
|
310
|
-
|
|
311
|
-
{footnote && showHelperInvalidText && (
|
|
312
|
-
<HelperErrorText
|
|
313
|
-
id={`${id}-helperText`}
|
|
314
|
-
isInvalid={finalIsInvalid}
|
|
315
|
-
text={footnote}
|
|
316
|
-
/>
|
|
317
|
-
)}
|
|
318
|
-
</Box>
|
|
318
|
+
</ComponentWrapper>
|
|
319
319
|
);
|
|
320
320
|
});
|
|
321
321
|
|