@nypl/design-system-react-components 0.25.3 → 0.25.4

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.
Files changed (131) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +47 -11
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
  4. package/dist/components/Button/Button.d.ts +9 -6
  5. package/dist/components/Button/ButtonTypes.d.ts +2 -1
  6. package/dist/components/Card/Card.d.ts +0 -25
  7. package/dist/components/Icons/IconSvgs.d.ts +3 -0
  8. package/dist/components/Icons/IconTypes.d.ts +3 -0
  9. package/dist/components/Notification/Notification.d.ts +6 -4
  10. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
  11. package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
  12. package/dist/components/SearchBar/SearchBar.d.ts +3 -3
  13. package/dist/components/Slider/Slider.d.ts +57 -0
  14. package/dist/components/Tabs/Tabs.d.ts +1 -1
  15. package/dist/components/TextInput/TextInput.d.ts +6 -0
  16. package/dist/design-system-react-components.cjs.development.js +707 -454
  17. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  18. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  19. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  20. package/dist/design-system-react-components.esm.js +700 -441
  21. package/dist/design-system-react-components.esm.js.map +1 -1
  22. package/dist/index.d.ts +6 -3
  23. package/dist/resources.scss +180 -170
  24. package/dist/styles.css +1 -1
  25. package/dist/theme/components/button.d.ts +10 -0
  26. package/dist/theme/components/progressIndicator.d.ts +50 -0
  27. package/dist/theme/components/slider.d.ts +51 -0
  28. package/dist/theme/foundations/breakpoints.d.ts +8 -8
  29. package/dist/theme/foundations/global.d.ts +6 -1
  30. package/package.json +72 -84
  31. package/src/__tests__/setup.ts +2 -2
  32. package/src/components/Accordion/Accordion.stories.mdx +30 -34
  33. package/src/components/Autosuggest/Autosuggest.stories.mdx +3 -3
  34. package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -0
  35. package/src/components/Autosuggest/_Autosuggest.scss +5 -5
  36. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +5 -6
  37. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +23 -0
  38. package/src/components/Breadcrumbs/Breadcrumbs.tsx +5 -1
  39. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +198 -1
  40. package/src/components/Button/Button.stories.mdx +8 -6
  41. package/src/components/Button/Button.test.tsx +20 -0
  42. package/src/components/Button/Button.tsx +14 -23
  43. package/src/components/Button/ButtonTypes.tsx +1 -0
  44. package/src/components/Button/__snapshots__/Button.test.tsx.snap +29 -4
  45. package/src/components/Card/Card.stories.mdx +1 -1
  46. package/src/components/Card/Card.tsx +3 -3
  47. package/src/components/CardEdition/CardEdition.stories.tsx +15 -47
  48. package/src/components/CardEdition/_CardEdition.scss +22 -23
  49. package/src/components/Chakra/Box.stories.mdx +14 -15
  50. package/src/components/Chakra/Center.stories.mdx +15 -8
  51. package/src/components/Chakra/Grid.stories.mdx +16 -7
  52. package/src/components/Chakra/Stack.stories.mdx +35 -18
  53. package/src/components/DatePicker/DatePicker.test.tsx +31 -30
  54. package/src/components/DatePicker/DatePicker.tsx +7 -4
  55. package/src/components/DatePicker/_DatePicker.scss +4 -4
  56. package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +19 -5
  57. package/src/components/Form/Form.stories.mdx +4 -5
  58. package/src/components/Grid/SimpleGrid.stories.mdx +1 -0
  59. package/src/components/Hero/HeroTypes.tsx +1 -0
  60. package/src/components/HorizontalRule/HorizontalRule.stories.mdx +2 -3
  61. package/src/components/Icons/Icon.stories.mdx +2 -3
  62. package/src/components/Icons/IconSvgs.tsx +6 -0
  63. package/src/components/Icons/IconTypes.tsx +3 -0
  64. package/src/components/Image/Image.stories.mdx +2 -3
  65. package/src/components/Input/Input.stories.tsx +20 -64
  66. package/src/components/Input/_Input.scss +23 -14
  67. package/src/components/Modal/Modal.stories.mdx +3 -3
  68. package/src/components/Modal/_Modal.scss +2 -2
  69. package/src/components/Notification/Notification.stories.mdx +1 -1
  70. package/src/components/Notification/Notification.tsx +13 -4
  71. package/src/components/Pagination/Pagination.stories.mdx +3 -2
  72. package/src/components/Pagination/Pagination.stories.tsx +1 -2
  73. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +292 -0
  74. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +225 -0
  75. package/src/components/ProgressIndicator/ProgressIndicator.tsx +126 -0
  76. package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +8 -0
  77. package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +357 -0
  78. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +3 -0
  79. package/src/components/RadioGroup/RadioGroup.stories.mdx +2 -3
  80. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +4 -0
  81. package/src/components/SearchBar/SearchBar.Test.tsx +2 -1
  82. package/src/components/SearchBar/SearchBar.stories.mdx +109 -9
  83. package/src/components/SearchBar/SearchBar.tsx +11 -4
  84. package/src/components/Select/SelectTypes.tsx +1 -0
  85. package/src/components/Slider/Slider.stories.mdx +529 -0
  86. package/src/components/Slider/Slider.test.tsx +653 -0
  87. package/src/components/Slider/Slider.tsx +303 -0
  88. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +1946 -0
  89. package/src/components/StyleGuide/Bidirectionality.stories.mdx +1 -1
  90. package/src/components/StyleGuide/Breakpoints.stories.mdx +21 -7
  91. package/src/components/StyleGuide/Buttons.stories.mdx +9 -2
  92. package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
  93. package/src/components/Tabs/Tabs.tsx +5 -5
  94. package/src/components/Template/Template.stories.mdx +6 -6
  95. package/src/components/TextInput/TextInput.stories.mdx +1 -1
  96. package/src/components/TextInput/TextInput.tsx +15 -2
  97. package/src/components/TextInput/TextInputTypes.tsx +2 -0
  98. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -3
  99. package/src/docs/Chakra.stories.mdx +2 -2
  100. package/src/index.ts +10 -6
  101. package/src/resources.scss +5 -5
  102. package/src/styles/base/{_02-breakpoints.scss → _01-breakpoints.scss} +9 -10
  103. package/src/styles/base/{_03-mixins.scss → _02-mixins.scss} +16 -5
  104. package/src/styles/base/{_04-base.scss → _03-base.scss} +7 -2
  105. package/src/styles/base/{_05-focus.scss → _04-focus.scss} +0 -15
  106. package/src/styles/base/_place-holder.scss +14 -3
  107. package/src/styles/{03-space → space}/_space-inline.scss +14 -14
  108. package/src/styles/{03-space → space}/_space-inset.scss +10 -10
  109. package/src/styles/space/_space-stack.scss +116 -0
  110. package/src/styles.scss +13 -44
  111. package/src/theme/components/button.ts +10 -2
  112. package/src/theme/components/card.ts +11 -9
  113. package/src/theme/components/datePicker.ts +1 -1
  114. package/src/theme/components/list.ts +2 -2
  115. package/src/theme/components/notification.ts +5 -3
  116. package/src/theme/components/progressIndicator.ts +62 -0
  117. package/src/theme/components/skeletonLoader.ts +1 -1
  118. package/src/theme/components/slider.ts +79 -0
  119. package/src/theme/foundations/breakpoints.ts +8 -8
  120. package/src/theme/foundations/global.ts +6 -1
  121. package/src/theme/index.ts +4 -0
  122. package/src/utils/componentCategories.ts +3 -3
  123. package/src/styles/01-colors/_colors-brand.scss +0 -62
  124. package/src/styles/01-colors/_colors-utility.scss +0 -67
  125. package/src/styles/02-typography/_type-scale.css +0 -11
  126. package/src/styles/02-typography/_type-weight.css +0 -7
  127. package/src/styles/02-typography/_typefaces.css +0 -4
  128. package/src/styles/03-space/_space-stack.scss +0 -116
  129. package/src/styles/03-space/_space.css +0 -30
  130. package/src/styles/base/_card-grid.scss +0 -77
  131. package/src/styles/base/_typography.scss +0 -11
@@ -18,7 +18,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 1`] = `
18
18
  </div>
19
19
  </legend>
20
20
  <div
21
- className="css-7ft6bq"
21
+ className="css-ahcv85"
22
22
  id="basic-form-row"
23
23
  >
24
24
  <div
@@ -50,6 +50,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 1`] = `
50
50
  onClick={[Function]}
51
51
  onFocus={[Function]}
52
52
  required={false}
53
+ step={null}
53
54
  type="text"
54
55
  value="1988-01-02"
55
56
  />
@@ -86,6 +87,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 1`] = `
86
87
  onClick={[Function]}
87
88
  onFocus={[Function]}
88
89
  required={false}
90
+ step={null}
89
91
  type="text"
90
92
  value="1988-02-02"
91
93
  />
@@ -116,7 +118,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 2`] = `
116
118
  </div>
117
119
  </legend>
118
120
  <div
119
- className="css-7ft6bq"
121
+ className="css-ahcv85"
120
122
  id="no-label-form-row"
121
123
  >
122
124
  <div
@@ -148,6 +150,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 2`] = `
148
150
  onClick={[Function]}
149
151
  onFocus={[Function]}
150
152
  required={false}
153
+ step={null}
151
154
  type="text"
152
155
  value="1988-01-02"
153
156
  />
@@ -184,6 +187,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 2`] = `
184
187
  onClick={[Function]}
185
188
  onFocus={[Function]}
186
189
  required={false}
190
+ step={null}
187
191
  type="text"
188
192
  value="1988-02-02"
189
193
  />
@@ -214,7 +218,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 3`] = `
214
218
  </div>
215
219
  </legend>
216
220
  <div
217
- className="css-7ft6bq"
221
+ className="css-ahcv85"
218
222
  id="custom-format-form-row"
219
223
  >
220
224
  <div
@@ -246,6 +250,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 3`] = `
246
250
  onClick={[Function]}
247
251
  onFocus={[Function]}
248
252
  required={false}
253
+ step={null}
249
254
  type="text"
250
255
  value="1988/02/01"
251
256
  />
@@ -282,6 +287,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 3`] = `
282
287
  onClick={[Function]}
283
288
  onFocus={[Function]}
284
289
  required={false}
290
+ step={null}
285
291
  type="text"
286
292
  value="1988/02/02"
287
293
  />
@@ -312,7 +318,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 4`] = `
312
318
  </div>
313
319
  </legend>
314
320
  <div
315
- className="css-7ft6bq"
321
+ className="css-ahcv85"
316
322
  id="invalid-form-row"
317
323
  >
318
324
  <div
@@ -345,6 +351,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 4`] = `
345
351
  onClick={[Function]}
346
352
  onFocus={[Function]}
347
353
  required={false}
354
+ step={null}
348
355
  type="text"
349
356
  value="1988-01-02"
350
357
  />
@@ -396,6 +403,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 4`] = `
396
403
  onClick={[Function]}
397
404
  onFocus={[Function]}
398
405
  required={false}
406
+ step={null}
399
407
  type="text"
400
408
  value="1988-02-02"
401
409
  />
@@ -449,7 +457,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 5`] = `
449
457
  </div>
450
458
  </legend>
451
459
  <div
452
- className="css-7ft6bq"
460
+ className="css-ahcv85"
453
461
  id="disabled-form-row"
454
462
  >
455
463
  <div
@@ -481,6 +489,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 5`] = `
481
489
  onClick={[Function]}
482
490
  onFocus={[Function]}
483
491
  required={false}
492
+ step={null}
484
493
  type="text"
485
494
  value="1988-01-02"
486
495
  />
@@ -517,6 +526,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 5`] = `
517
526
  onClick={[Function]}
518
527
  onFocus={[Function]}
519
528
  required={false}
529
+ step={null}
520
530
  type="text"
521
531
  value="1988-02-02"
522
532
  />
@@ -616,7 +626,11 @@ exports[`DatePicker Single input renders the UI snapshot correctly 2`] = `
616
626
  onFocus={[Function]}
617
627
  required={false}
618
628
  type="text"
629
+ <<<<<<< HEAD
630
+ value="2021-11-17"
631
+ =======
619
632
  value="1988-01-02"
633
+ >>>>>>> development
620
634
  />
621
635
  </div>
622
636
  </div>
@@ -3,7 +3,6 @@ import {
3
3
  Story,
4
4
  Canvas,
5
5
  ArgsTable,
6
- Preview,
7
6
  Description,
8
7
  } from "@storybook/addon-docs/blocks";
9
8
  import { withDesign } from "storybook-addon-designs";
@@ -57,7 +56,7 @@ The `Form` component renders a standard `<form>` element and should be used to h
57
56
 
58
57
  `FormRow` should be used as a parent of multiple `FormField` components when you need to render multiple input components in a horizontal row.
59
58
 
60
- <Preview withToolbar>
59
+ <Canvas withToolbar>
61
60
  <Story
62
61
  name="Form"
63
62
  args={{
@@ -187,7 +186,7 @@ The `Form` component renders a standard `<form>` element and should be used to h
187
186
  </Form>
188
187
  )}
189
188
  </Story>
190
- </Preview>
189
+ </Canvas>
191
190
 
192
191
  <ArgsTable story="Form" />
193
192
 
@@ -254,7 +253,7 @@ By default, the `Form` component will handle the NYPL spacing around form input
254
253
 
255
254
  Below are the spacing variants available with the `FormSpacing` enum.
256
255
 
257
- <Preview>
256
+ <Canvas>
258
257
  <Story
259
258
  name="Spacing Variants"
260
259
  args={{
@@ -263,7 +262,7 @@ Below are the spacing variants available with the `FormSpacing` enum.
263
262
  >
264
263
  {getForms(sizes)}
265
264
  </Story>
266
- </Preview>
265
+ </Canvas>
267
266
 
268
267
  ## Example Code
269
268
 
@@ -161,6 +161,7 @@ for (const icon in IconNames) {
161
161
  const iname = `Example icon: ${IconNames[icon]}`;
162
162
  const iconRender = (
163
163
  <Icon
164
+ key={icon}
164
165
  name={IconNames[icon]}
165
166
  size={IconSizes.ExtraExtraExtraLarge}
166
167
  titleText={iname}
@@ -10,6 +10,7 @@ export enum HeroTypes {
10
10
  FiftyFifty = "fiftyfifty",
11
11
  }
12
12
 
13
+ // Only used for internal purposes.
13
14
  export const HeroSecondaryTypes = [
14
15
  HeroTypes.Secondary,
15
16
  HeroTypes.SecondaryBooksAndMore,
@@ -3,7 +3,6 @@ import {
3
3
  Story,
4
4
  Canvas,
5
5
  ArgsTable,
6
- Preview,
7
6
  Description,
8
7
  } from "@storybook/addon-docs/blocks";
9
8
  import { withDesign } from "storybook-addon-designs";
@@ -43,8 +42,8 @@ The `HorizontalRule` component renders a basic `<hr>` element. The `height`,
43
42
  number, a `px` value, a `em` value, or a `rem` value. Otherwise, the default
44
43
  value of "2px" will be used.
45
44
 
46
- <Preview withToolbar>
45
+ <Canvas withToolbar>
47
46
  <Story name="HorizontalRule">{(args) => <HorizontalRule {...args} />}</Story>
48
- </Preview>
47
+ </Canvas>
49
48
 
50
49
  <ArgsTable story="HorizontalRule" />
@@ -28,8 +28,7 @@ import { getCategory } from "../../utils/componentCategories";
28
28
  parameters={{
29
29
  design: {
30
30
  type: "figma",
31
- url:
32
- "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=10734%3A3945",
31
+ url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=10734%3A3945",
33
32
  },
34
33
  jest: ["Icon.test.tsx"],
35
34
  }}
@@ -45,7 +44,7 @@ import { getCategory } from "../../utils/componentCategories";
45
44
  | Component Version | DS Version |
46
45
  | ----------------- | ---------- |
47
46
  | Added | `0.0.4` |
48
- | Latest | `0.25.3` |
47
+ | Latest | `0.25.4` |
49
48
 
50
49
  <Description of={Icon} />
51
50
 
@@ -2,6 +2,9 @@
2
2
  import accessibility_full from "../../../icons/svg/accessibility_full.svg";
3
3
  import accessibility_partial from "../../../icons/svg/accessibility_partial.svg";
4
4
  import action_check_circle from "../../../icons/svg/action_check_circle.svg";
5
+ import action_help_default from "../../../icons/svg/action_help_default.svg";
6
+ import action_help_outline from "../../../icons/svg/action_help_outline.svg";
7
+ import action_launch from "../../../icons/svg/action_launch.svg";
5
8
  import arrow from "../../../icons/svg/arrow.svg";
6
9
  import brooklyn from "../../../icons/svg/brooklyn.svg";
7
10
  import check from "../../../icons/svg/check.svg";
@@ -51,6 +54,9 @@ export default {
51
54
  accessibility_full,
52
55
  accessibility_partial,
53
56
  action_check_circle,
57
+ action_help_default,
58
+ action_help_outline,
59
+ action_launch,
54
60
  arrow,
55
61
  brooklyn,
56
62
  check,
@@ -50,6 +50,9 @@ export enum IconNames {
50
50
  AccessibilityFull = "accessibility_full",
51
51
  AccessibilityPartial = "accessibility_partial",
52
52
  ActionCheckCircle = "action_check_circle",
53
+ ActionHelpDefault = "action_help_default",
54
+ ActionHelpOutline = "action_help_outline",
55
+ ActionLaunch = "action_launch",
53
56
  Arrow = "arrow",
54
57
  Check = "check",
55
58
  Clock = "clock",
@@ -20,8 +20,7 @@ import { getCategory } from "../../utils/componentCategories";
20
20
  parameters={{
21
21
  design: {
22
22
  type: "figma",
23
- url:
24
- "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11896%3A45379",
23
+ url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11896%3A45379",
25
24
  },
26
25
  jest: ["Image.test.tsx"],
27
26
  }}
@@ -37,7 +36,7 @@ import { getCategory } from "../../utils/componentCategories";
37
36
  | Component Version | DS Version |
38
37
  | ----------------- | ---------- |
39
38
  | Added | `0.0.6` |
40
- | Latest | `0.25.2` |
39
+ | Latest | `0.25.3` |
41
40
 
42
41
  <Description of={Image} />
43
42
 
@@ -6,8 +6,6 @@ import Label from "../Label/Label";
6
6
  import Button from "../Button/Button";
7
7
  import { ButtonTypes } from "../Button/ButtonTypes";
8
8
  import HelperErrorText from "../HelperErrorText/HelperErrorText";
9
- // eslint-disable-next-line id-blacklist
10
- import { text, boolean, select, number } from "@storybook/addon-knobs";
11
9
  import { action } from "@storybook/addon-actions";
12
10
  import { getCategory } from "../../utils/componentCategories";
13
11
 
@@ -16,47 +14,24 @@ export default {
16
14
  component: Input,
17
15
  };
18
16
 
19
- let showLabel, showHelperText;
20
-
21
17
  export const input = () => (
22
18
  <>
23
- {boolean("Show Label", true) ? (showLabel = true) : (showLabel = false)}
24
- {showLabel && (
25
- <Label
26
- htmlFor="inputID"
27
- optReqFlag={select(
28
- "Optional/Required Flag",
29
- ["Required", "Optional", ""],
30
- "Required"
31
- )}
32
- id={"label"}
33
- >
34
- {text("Input Label", "Choose your islander name: ")}
35
- </Label>
36
- )}
19
+ <Label htmlFor="inputID" optReqFlag="Required" id={"label"}>
20
+ Choose your islander name:
21
+ </Label>
37
22
  <Input
38
23
  id="inputID"
39
24
  ariaLabel="Input Label"
40
25
  ariaLabelledBy={"helperText"}
41
- required={boolean("Input Required", false)}
42
- placeholder={text("Input Placeholder", "CoolPerson99")}
43
- type={select("Input Type", InputTypes, InputTypes.text)}
44
- disabled={boolean("Disabled", false)}
26
+ required={false}
27
+ placeholder="CoolPerson99"
28
+ type={InputTypes.text}
29
+ disabled={false}
45
30
  ></Input>
46
- {boolean("Show Helper Text", true)
47
- ? (showHelperText = true)
48
- : (showHelperText = false)}
49
- {showHelperText && (
50
- <HelperErrorText
51
- isInvalid={boolean("Helper Text Errored", false)}
52
- id={"helperText"}
53
- >
54
- {text(
55
- "Helper Text Content",
56
- "Once you pick a name for your islander it cannot be changed, so choose wisely!"
57
- )}
58
- </HelperErrorText>
59
- )}
31
+ <HelperErrorText isInvalid={false} id={"helperText"}>
32
+ Once you pick a name for your islander it cannot be changed, so choose
33
+ wisely!
34
+ </HelperErrorText>
60
35
  </>
61
36
  );
62
37
 
@@ -64,8 +39,7 @@ input.storyName = "Input";
64
39
  input.parameters = {
65
40
  design: {
66
41
  type: "figma",
67
- url:
68
- "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11895%3A547",
42
+ url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11895%3A547",
69
43
  },
70
44
  jest: ["Input.test.tsx"],
71
45
  };
@@ -74,12 +48,7 @@ let groupErrored;
74
48
 
75
49
  export const inputGroup = () => (
76
50
  <fieldset className="fieldset">
77
- {boolean("Input Group Errored", false)
78
- ? (groupErrored = true)
79
- : (groupErrored = false)}
80
- <legend className="legend">
81
- {text("Input Group Label", "Construction Time Request Form: ")}
82
- </legend>
51
+ <legend className="legend">Construction Time Request Form:</legend>
83
52
  <div className="input-group">
84
53
  <div style={{ flex: "1" }}>
85
54
  <Label htmlFor="input1" id={"label1"}>
@@ -87,17 +56,13 @@ export const inputGroup = () => (
87
56
  </Label>
88
57
  <Input
89
58
  id="input1"
90
- ariaLabelledBy={
91
- groupErrored
92
- ? "helperText1 sharedHelperText label1"
93
- : "helperText1 label1"
94
- }
59
+ ariaLabelledBy="helperText1 sharedHelperText label1"
95
60
  errored={groupErrored ? true : false}
96
61
  required={true}
97
62
  type={InputTypes.text}
98
63
  ></Input>
99
64
  <HelperErrorText isInvalid={false} id={"helperText1"}>
100
- {text("Input 1 Helper Text", "E.g., 10am")}
65
+ "E.g., 10am"
101
66
  </HelperErrorText>
102
67
  </div>
103
68
 
@@ -112,23 +77,15 @@ export const inputGroup = () => (
112
77
  ? "helperText2 sharedHelperText label2"
113
78
  : "helperText2 label2"
114
79
  }
115
- errored={groupErrored ? true : false}
80
+ errored={false}
116
81
  required={true}
117
82
  type={InputTypes.text}
118
83
  ></Input>
119
84
  <HelperErrorText isInvalid={false} id={"helperText2"}>
120
- {text("Input 2 Helper Text", "E.g., 11am")}
85
+ E.g., 11am
121
86
  </HelperErrorText>
122
87
  </div>
123
88
  </div>
124
- {groupErrored && (
125
- <HelperErrorText isInvalid={true} id={"sharedHelperText"}>
126
- {text(
127
- "Additional Error Text",
128
- "Sorry villager! Those times are not available right now."
129
- )}
130
- </HelperErrorText>
131
- )}
132
89
  <Button
133
90
  onClick={action("clicked")}
134
91
  id="button"
@@ -144,8 +101,7 @@ inputGroup.storyName = "Input Group";
144
101
  inputGroup.parameters = {
145
102
  design: {
146
103
  type: "figma",
147
- url:
148
- "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11895%3A547",
104
+ url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11895%3A547",
149
105
  },
150
106
  jest: ["Input.test.tsx"],
151
107
  };
@@ -165,8 +121,8 @@ export const inputAttributes = () => (
165
121
  attributes={{
166
122
  onBlur: action("onBlur"),
167
123
  onChange: action("onChange"),
168
- maxLength: number("maxLength", 10),
169
- tabIndex: number("tabIndex", 0),
124
+ maxLength: 10,
125
+ tabIndex: 0,
170
126
  }}
171
127
  ></Input>
172
128
  <HelperErrorText isInvalid={false} id="helperText-attrs">
@@ -1,10 +1,10 @@
1
1
  $break-input-mobile: 400px;
2
2
 
3
3
  .input {
4
- @include space-inset-xs;
5
- @include space-stack-xs;
4
+ padding: var(--nypl-space-xs);
5
+ margin-bottom: var(--nypl-space-xs);
6
6
 
7
- border: 1px solid var(--ui-gray-medium);
7
+ border: 1px solid var(--nypl-colors-ui-gray-medium);
8
8
 
9
9
  &[type="text"],
10
10
  &[type="number"],
@@ -17,43 +17,43 @@ $break-input-mobile: 400px;
17
17
 
18
18
  + .label {
19
19
  display: unset;
20
- margin-left: var(--space-s);
20
+ margin-left: var(--nypl-space-s);
21
21
  }
22
22
  }
23
23
 
24
24
  &::-webkit-input-placeholder {
25
- color: var(--ui-gray-dark);
25
+ color: var(--nypl-colors-ui-gray-dark);
26
26
  }
27
27
 
28
28
  &:-moz-placeholder {
29
- color: var(--ui-gray-dark);
29
+ color: var(--nypl-colors-ui-gray-dark);
30
30
  }
31
31
 
32
32
  &:-ms-input-placeholder {
33
- color: var(--ui-gray-dark);
33
+ color: var(--nypl-colors-ui-gray-dark);
34
34
  }
35
35
 
36
36
  &:hover {
37
- border-color: var(--ui-gray-dark);
37
+ border-color: var(--nypl-colors-ui-gray-dark);
38
38
  }
39
39
 
40
40
  &:disabled {
41
- background-color: var(--ui-gray-xx-light-cool);
42
- color: var(--ui-gray-xdark);
41
+ background-color: var(--nypl-colors-ui-gray-xx-light-cool);
42
+ color: var(--nypl-colors-ui-gray-xdark);
43
43
  }
44
44
 
45
45
  &:active,
46
46
  &:focus,
47
47
  &:active:hover,
48
48
  &:focus:hover {
49
- border: 1px solid var(--ui-focus);
49
+ border: 1px solid var(--nypl-colors-ui-focus);
50
50
  box-shadow: 0;
51
- outline: 1px solid var(--ui-focus);
51
+ outline: 1px solid var(--nypl-colors-ui-focus);
52
52
  z-index: 9999;
53
53
  }
54
54
 
55
55
  &--error {
56
- border: 1px solid var(--ui-error-primary);
56
+ border: 1px solid var(--nypl-colors-ui-error-primary);
57
57
  }
58
58
  }
59
59
 
@@ -63,7 +63,16 @@ $break-input-mobile: 400px;
63
63
  justify-content: space-between;
64
64
 
65
65
  > *:not(:last-child) {
66
- @include space-inline-m;
66
+ margin-right: var(--nypl-space-m);
67
67
  }
68
68
  }
69
69
  }
70
+
71
+ // Used in `Input.stories.tsx`
72
+ .fieldset {
73
+ @include fieldset-reset;
74
+ }
75
+ .legend {
76
+ border: 0;
77
+ font-weight: 500;
78
+ }
@@ -3,7 +3,7 @@ import {
3
3
  Meta,
4
4
  Story,
5
5
  ArgsTable,
6
- Preview,
6
+ Canvas,
7
7
  Description,
8
8
  } from "@storybook/addon-docs/blocks";
9
9
  import Modal from "./Modal";
@@ -118,11 +118,11 @@ export const ModalStory = (args) => {
118
118
  );
119
119
  };
120
120
 
121
- <Preview withToolbar>
121
+ <Canvas withToolbar>
122
122
  <Story name="Basic" args={{ open: false }}>
123
123
  {(args) => <ModalStory {...args} />}
124
124
  </Story>
125
- </Preview>
125
+ </Canvas>
126
126
 
127
127
  <ArgsTable story="Basic" />
128
128
 
@@ -5,9 +5,9 @@
5
5
  }
6
6
 
7
7
  .modal {
8
- @include space-inset-s;
8
+ padding: var(--nypl-space-s);
9
9
 
10
- background-color: var(--ui-gray-x-light-warm);
10
+ background-color: var(--nypl-colors-ui-gray-x-light-warm);
11
11
  height: 100vh;
12
12
  left: 0;
13
13
  overflow-y: auto;
@@ -39,7 +39,7 @@ import DSProvider from "../../theme/provider";
39
39
  | Component Version | DS Version |
40
40
  | ----------------- | ---------- |
41
41
  | Added | `0.23.2` |
42
- | Latest | `0.25.2` |
42
+ | Latest | `0.25.4` |
43
43
 
44
44
  <Description of={Notification} />
45
45
 
@@ -11,7 +11,7 @@ import { NotificationTypes } from "./NotificationTypes";
11
11
  import generateUUID from "../../helpers/generateUUID";
12
12
 
13
13
  interface BaseProps {
14
- /** Optional prop to control text alignment of the `Notification` content */
14
+ /** Optional prop to control text alignment in `NotificationContent` */
15
15
  alignText?: boolean;
16
16
  /** Optional prop to control horizontal alignment of the `Notification` content */
17
17
  centered?: boolean;
@@ -22,7 +22,12 @@ interface BaseProps {
22
22
  notificationType?: NotificationTypes;
23
23
  }
24
24
 
25
- export interface NotificationProps extends BaseProps {
25
+ // Used for `NotificationHeading` and `Notification`
26
+ type BasePropsWithoutAlignText = Omit<BaseProps, "alignText">;
27
+ // Used for `NotificationContent`
28
+ type BasePropsWithoutCentered = Omit<BaseProps, "centered">;
29
+
30
+ export interface NotificationProps extends BasePropsWithoutAlignText {
26
31
  /** Additional `className` to add. */
27
32
  className?: string;
28
33
  /** Optional prop to control whether a `Notification` can be dismissed
@@ -43,7 +48,9 @@ export interface NotificationProps extends BaseProps {
43
48
  /**
44
49
  * NotificationHeading child-component.
45
50
  */
46
- export function NotificationHeading(props: React.PropsWithChildren<BaseProps>) {
51
+ export function NotificationHeading(
52
+ props: React.PropsWithChildren<BasePropsWithoutAlignText>
53
+ ) {
47
54
  const { centered, children, icon, notificationType } = props;
48
55
  const styles = useMultiStyleConfig("NotificationHeading", {
49
56
  centered,
@@ -62,7 +69,9 @@ export function NotificationHeading(props: React.PropsWithChildren<BaseProps>) {
62
69
  /**
63
70
  * NotificationContent child-component.
64
71
  */
65
- export function NotificationContent(props: React.PropsWithChildren<BaseProps>) {
72
+ export function NotificationContent(
73
+ props: React.PropsWithChildren<BasePropsWithoutCentered>
74
+ ) {
66
75
  const { alignText, children, icon, notificationType } = props;
67
76
  const styles = useMultiStyleConfig("NotificationContent", {
68
77
  alignText,
@@ -35,7 +35,7 @@ import { getCategory } from "../../utils/componentCategories";
35
35
  | Component Version | DS Version |
36
36
  | ----------------- | ---------- |
37
37
  | Added | `0.0.10` |
38
- | Latest | `0.25.2` |
38
+ | Latest | `0.25.3` |
39
39
 
40
40
  <Description of={Pagination} />
41
41
 
@@ -60,7 +60,8 @@ named anything but you have to pick up the value in the wrapper component.
60
60
  ```tsx
61
61
  // Example in a search results page.
62
62
  const getPageHref = (selectedPage: number) => {
63
- // This should be updated for your router system, if any.
63
+ // This should be updated for your router system, if any, including the
64
+ // base or origin URL.
64
65
  return `${location.origin}?q=celeste&page=${selectedPage}`;
65
66
  };
66
67
  ```
@@ -23,8 +23,7 @@ export const PaginationGetPageHref: Story<PaginationProps> = (args) => {
23
23
  // Passing this function into `Pagination` makes the URL to change
24
24
  // and refreshes the page.
25
25
  const getPageHref = (selectedPage) => {
26
- const currentStoryId = urlParams.get("id");
27
- return `${location.origin}?path=/story/${currentStoryId}&page=${selectedPage}`;
26
+ return `${location.href}&page=${selectedPage}`;
28
27
  };
29
28
 
30
29
  return (