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

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 (85) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -0
  3. package/dist/components/Icons/IconSvgs.d.ts +1 -0
  4. package/dist/components/Icons/IconTypes.d.ts +1 -0
  5. package/dist/components/Image/ImageTypes.d.ts +3 -1
  6. package/dist/components/Link/LinkTypes.d.ts +1 -0
  7. package/dist/components/Notification/Notification.d.ts +2 -0
  8. package/dist/components/Select/Select.d.ts +2 -0
  9. package/dist/components/Toggle/Toggle.d.ts +47 -0
  10. package/dist/components/Toggle/ToggleSizes.d.ts +4 -0
  11. package/dist/components/VideoPlayer/VideoPlayer.d.ts +5 -3
  12. package/dist/design-system-react-components.cjs.development.js +921 -360
  13. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  14. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  15. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  16. package/dist/design-system-react-components.esm.js +917 -353
  17. package/dist/design-system-react-components.esm.js.map +1 -1
  18. package/dist/index.d.ts +5 -0
  19. package/dist/theme/components/breadcrumb.d.ts +9 -0
  20. package/dist/theme/components/notification.d.ts +8 -4
  21. package/dist/theme/components/toggle.d.ts +68 -0
  22. package/dist/theme/foundations/spacing.d.ts +2 -0
  23. package/package.json +2 -2
  24. package/src/components/Accordion/Accordion.stories.mdx +1 -2
  25. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +20 -3
  26. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +20 -0
  27. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -0
  28. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +198 -0
  29. package/src/components/Button/Button.tsx +0 -1
  30. package/src/components/Card/Card.stories.mdx +74 -7
  31. package/src/components/Card/Card.tsx +9 -8
  32. package/src/components/Card/__snapshots__/Card.test.tsx.snap +67 -35
  33. package/src/components/Chakra/Grid.stories.mdx +11 -14
  34. package/src/components/DatePicker/DatePicker.test.tsx +8 -6
  35. package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +5 -4
  36. package/src/components/Icons/Icon.stories.mdx +3 -2
  37. package/src/components/Icons/IconSvgs.tsx +2 -0
  38. package/src/components/Icons/IconTypes.tsx +1 -0
  39. package/src/components/Image/Image.stories.mdx +152 -90
  40. package/src/components/Image/Image.test.tsx +10 -0
  41. package/src/components/Image/ImageTypes.ts +2 -0
  42. package/src/components/Image/__snapshots__/Image.test.tsx.snap +24 -8
  43. package/src/components/Label/Label.stories.mdx +1 -1
  44. package/src/components/Link/Link.stories.mdx +2 -3
  45. package/src/components/Link/Link.test.tsx +71 -0
  46. package/src/components/Link/Link.tsx +41 -9
  47. package/src/components/Link/LinkTypes.tsx +1 -0
  48. package/src/components/Link/__snapshots__/Link.test.tsx.snap +201 -0
  49. package/src/components/Notification/Notification.stories.mdx +36 -3
  50. package/src/components/Notification/Notification.test.tsx +62 -16
  51. package/src/components/Notification/Notification.tsx +17 -5
  52. package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +117 -0
  53. package/src/components/Pagination/Pagination.stories.mdx +1 -2
  54. package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +42 -0
  55. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +2 -3
  56. package/src/components/SearchBar/SearchBar.Test.tsx +64 -20
  57. package/src/components/SearchBar/SearchBar.stories.mdx +3 -4
  58. package/src/components/SearchBar/SearchBar.tsx +4 -1
  59. package/src/components/Select/Select.stories.mdx +132 -55
  60. package/src/components/Select/Select.test.tsx +2 -2
  61. package/src/components/Select/Select.tsx +6 -2
  62. package/src/components/Slider/Slider.stories.mdx +3 -2
  63. package/src/components/Slider/Slider.test.tsx +35 -0
  64. package/src/components/Slider/Slider.tsx +8 -2
  65. package/src/components/Template/Template.stories.mdx +1 -2
  66. package/src/components/Toggle/Toggle.stories.mdx +176 -0
  67. package/src/components/Toggle/Toggle.test.tsx +140 -0
  68. package/src/components/Toggle/Toggle.tsx +118 -0
  69. package/src/components/Toggle/ToggleSizes.tsx +4 -0
  70. package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +255 -0
  71. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +39 -18
  72. package/src/components/VideoPlayer/VideoPlayer.test.tsx +103 -1
  73. package/src/components/VideoPlayer/VideoPlayer.tsx +57 -17
  74. package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +48 -0
  75. package/src/index.ts +8 -0
  76. package/src/theme/components/breadcrumb.ts +11 -1
  77. package/src/theme/components/card.ts +4 -5
  78. package/src/theme/components/global.ts +1 -1
  79. package/src/theme/components/icon.ts +2 -2
  80. package/src/theme/components/image.ts +8 -0
  81. package/src/theme/components/notification.ts +8 -6
  82. package/src/theme/components/toggle.ts +65 -0
  83. package/src/theme/foundations/spacing.ts +3 -0
  84. package/src/theme/index.ts +2 -0
  85. package/src/utils/componentCategories.ts +3 -1
@@ -6,16 +6,20 @@ exports[`Card Renders the UI snapshot correctly 1`] = `
6
6
  id="regularCard"
7
7
  >
8
8
  <div
9
- className="the-wrap css-0"
9
+ className="css-0"
10
10
  >
11
11
  <div
12
- className="the-crop css-0"
12
+ className="the-wrap css-0"
13
13
  >
14
- <img
15
- alt="Alt text"
16
- className="css-0"
17
- src="https://placeimg.com/400/200/arch"
18
- />
14
+ <div
15
+ className="the-crop css-0"
16
+ >
17
+ <img
18
+ alt="Alt text"
19
+ className="css-0"
20
+ src="https://placeimg.com/400/200/arch"
21
+ />
22
+ </div>
19
23
  </div>
20
24
  </div>
21
25
  <div
@@ -55,16 +59,20 @@ exports[`Card Renders the UI snapshot correctly 2`] = `
55
59
  id="cardWithExtendedStyles"
56
60
  >
57
61
  <div
58
- className="the-wrap css-0"
62
+ className="css-0"
59
63
  >
60
64
  <div
61
- className="the-crop css-0"
65
+ className="the-wrap css-0"
62
66
  >
63
- <img
64
- alt="Alt text"
65
- className="css-0"
66
- src="https://placeimg.com/300/400/arch"
67
- />
67
+ <div
68
+ className="the-crop css-0"
69
+ >
70
+ <img
71
+ alt="Alt text"
72
+ className="css-0"
73
+ src="https://placeimg.com/300/400/arch"
74
+ />
75
+ </div>
68
76
  </div>
69
77
  </div>
70
78
  <div
@@ -96,6 +104,8 @@ exports[`Card Renders the UI snapshot correctly 2`] = `
96
104
  className="css-0"
97
105
  href="online"
98
106
  id="link-online"
107
+ rel={null}
108
+ target={null}
99
109
  >
100
110
  Read Online
101
111
  </a>
@@ -103,6 +113,8 @@ exports[`Card Renders the UI snapshot correctly 2`] = `
103
113
  className="css-0"
104
114
  href="#url"
105
115
  id="link-icon"
116
+ rel={null}
117
+ target={null}
106
118
  >
107
119
  <svg
108
120
  aria-hidden={true}
@@ -149,16 +161,20 @@ exports[`Card Renders the UI snapshot correctly 3`] = `
149
161
  id="cardWithNoCTAs"
150
162
  >
151
163
  <div
152
- className="the-wrap css-0"
164
+ className="css-0"
153
165
  >
154
166
  <div
155
- className="the-crop css-0"
167
+ className="the-wrap css-0"
156
168
  >
157
- <img
158
- alt="Alt text"
159
- className="css-0"
160
- src="https://placeimg.com/300/400/arch"
161
- />
169
+ <div
170
+ className="the-crop css-0"
171
+ >
172
+ <img
173
+ alt="Alt text"
174
+ className="css-0"
175
+ src="https://placeimg.com/300/400/arch"
176
+ />
177
+ </div>
162
178
  </div>
163
179
  </div>
164
180
  <div
@@ -193,16 +209,20 @@ exports[`Card Renders the UI snapshot correctly 4`] = `
193
209
  id="cardWithNoContent"
194
210
  >
195
211
  <div
196
- className="the-wrap css-0"
212
+ className="css-0"
197
213
  >
198
214
  <div
199
- className="the-crop css-0"
215
+ className="the-wrap css-0"
200
216
  >
201
- <img
202
- alt="Alt text"
203
- className="css-0"
204
- src="https://placeimg.com/300/400/arch"
205
- />
217
+ <div
218
+ className="the-crop css-0"
219
+ >
220
+ <img
221
+ alt="Alt text"
222
+ className="css-0"
223
+ src="https://placeimg.com/300/400/arch"
224
+ />
225
+ </div>
206
226
  </div>
207
227
  </div>
208
228
  <div
@@ -226,6 +246,8 @@ exports[`Card Renders the UI snapshot correctly 4`] = `
226
246
  className="css-0"
227
247
  href="online"
228
248
  id="link-online"
249
+ rel={null}
250
+ target={null}
229
251
  >
230
252
  Read Online
231
253
  </a>
@@ -233,6 +255,8 @@ exports[`Card Renders the UI snapshot correctly 4`] = `
233
255
  className="css-0"
234
256
  href="#url"
235
257
  id="link-icon"
258
+ rel={null}
259
+ target={null}
236
260
  >
237
261
  <svg
238
262
  aria-hidden={true}
@@ -304,6 +328,8 @@ exports[`Card Renders the UI snapshot correctly 5`] = `
304
328
  className="css-0"
305
329
  href="online"
306
330
  id="link-online"
331
+ rel={null}
332
+ target={null}
307
333
  >
308
334
  Read Online
309
335
  </a>
@@ -311,6 +337,8 @@ exports[`Card Renders the UI snapshot correctly 5`] = `
311
337
  className="css-0"
312
338
  href="#url"
313
339
  id="link-icon"
340
+ rel={null}
341
+ target={null}
314
342
  >
315
343
  <svg
316
344
  aria-hidden={true}
@@ -360,16 +388,20 @@ exports[`Card Renders the UI snapshot correctly 6`] = `
360
388
  id="fullclick"
361
389
  >
362
390
  <div
363
- className="the-wrap css-0"
391
+ className="css-0"
364
392
  >
365
393
  <div
366
- className="the-crop css-0"
394
+ className="the-wrap css-0"
367
395
  >
368
- <img
369
- alt="Alt text"
370
- className="css-0"
371
- src="https://placeimg.com/400/200/arch"
372
- />
396
+ <div
397
+ className="the-crop css-0"
398
+ >
399
+ <img
400
+ alt="Alt text"
401
+ className="css-0"
402
+ src="https://placeimg.com/400/200/arch"
403
+ />
404
+ </div>
373
405
  </div>
374
406
  </div>
375
407
  <div
@@ -11,6 +11,7 @@ import DSProvider from "../../theme/provider";
11
11
  | Component Version | DS Version |
12
12
  | ----------------- | ---------- |
13
13
  | Added | `0.25.1` |
14
+ | Latest | `0.25.1` |
14
15
 
15
16
  Note: This needs the use of the `DSProvider` component. See the
16
17
  [README](https://nypl.github.io/nypl-design-system/storybook-static/?path=/story/chakra-ui--page#dsprovider)
@@ -63,16 +64,12 @@ the `templateColumns` and `templateRows`.
63
64
  height="200px"
64
65
  templateRows="repeat(2, 1fr)"
65
66
  templateColumns="repeat(5, 1fr)"
66
- gap="32"
67
+ gap="l"
67
68
  >
68
- <GridItem
69
- rowSpan={2}
70
- colSpan={1}
71
- bg="var(--nypl-colors-ui-link-primary)"
72
- />
73
- <GridItem colSpan={2} bg="var(--nypl-colors-ui-success-primary)" />
74
- <GridItem colSpan={2} bg="var(--nypl-colors-ui-success-secondary)" />
75
- <GridItem colSpan={4} bg="var(--nypl-colors-ui-link-secondary)" />
69
+ <GridItem rowSpan={2} colSpan={1} bg="ui.link.primary" />
70
+ <GridItem colSpan={2} bg="ui.success.primary" />
71
+ <GridItem colSpan={2} bg="ui.success.secondary" />
72
+ <GridItem colSpan={4} bg="ui.link.secondary" />
76
73
  </Grid>
77
74
  </DSProvider>
78
75
  </Canvas>
@@ -82,11 +79,11 @@ the `templateColumns` and `templateRows`.
82
79
  height="200px"
83
80
  templateRows="repeat(2, 1fr)"
84
81
  templateColumns="repeat(5, 1fr)"
85
- gap="32"
82
+ gap="l"
86
83
  >
87
- <GridItem rowSpan={2} colSpan={1} bg="var(--nypl-colors-ui-link-primary)" />
88
- <GridItem colSpan={2} bg="var(--nypl-colors-ui-success-primary)" />
89
- <GridItem colSpan={2} bg="var(--nypl-colors-ui-success-secondary)" />
90
- <GridItem colSpan={4} bg="var(--nypl-colors-ui-link-secondary)" />
84
+ <GridItem rowSpan={2} colSpan={1} bg="ui.link.primary" />
85
+ <GridItem colSpan={2} bg="ui.success.primary" />
86
+ <GridItem colSpan={2} bg="ui.success.secondary" />
87
+ <GridItem colSpan={4} bg="ui.link.secondary" />
91
88
  </Grid>
92
89
  ```
@@ -368,7 +368,7 @@ describe("DatePicker", () => {
368
368
  // Note: Have to add an initial date so that the snapshot tests always
369
369
  // pass. Otherwise, it'll use the _current_ date which changes
370
370
  // based on the day it is tested and is not what we want.
371
- it.skip("renders the UI snapshot correctly", () => {
371
+ it("renders the UI snapshot correctly", () => {
372
372
  const basic = renderer
373
373
  .create(
374
374
  <DatePicker
@@ -805,10 +805,12 @@ describe("DatePicker", () => {
805
805
  const input = screen.getByLabelText(
806
806
  /Select the year you want to visit NYPL/i
807
807
  );
808
- const [year] = getTodaysValues();
808
+ const mockYear = 2021;
809
809
 
810
810
  expect(
811
- screen.queryByText(`${(year as any) - 4} - ${(year as any) + 7}`)
811
+ screen.queryByText(
812
+ `${(mockYear as any) - 4} - ${(mockYear as any) + 7}`
813
+ )
812
814
  ).not.toBeInTheDocument();
813
815
 
814
816
  userEvent.click(input);
@@ -817,16 +819,16 @@ describe("DatePicker", () => {
817
819
  // before the current year to seven years after the current year. For year
818
820
  // 2021, it will display 2017 - 2028.
819
821
  expect(
820
- screen.getByText(`${(year as any) - 4} - ${(year as any) + 7}`)
822
+ screen.getByText(`${(mockYear as any) - 4} - ${(mockYear as any) + 7}`)
821
823
  ).toBeInTheDocument();
822
824
  // This calendar displays 12 years to select from.
823
825
  // It should display the four previous years from the current year.
824
826
  for (let i = 4; i > 0; i--) {
825
- expect(screen.getByText((year as any) - i)).toBeInTheDocument();
827
+ expect(screen.getByText((mockYear as any) - i)).toBeInTheDocument();
826
828
  }
827
829
  // It should display the eight next years from the current year.
828
830
  for (let i = 0; i < 8; i++) {
829
- expect(screen.getByText((year as any) + i)).toBeInTheDocument();
831
+ expect(screen.getByText((mockYear as any) + i)).toBeInTheDocument();
830
832
  }
831
833
  });
832
834
 
@@ -587,6 +587,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 1`] = `
587
587
  onClick={[Function]}
588
588
  onFocus={[Function]}
589
589
  required={false}
590
+ step={null}
590
591
  type="text"
591
592
  value="1988-01-02"
592
593
  />
@@ -625,12 +626,9 @@ exports[`DatePicker Single input renders the UI snapshot correctly 2`] = `
625
626
  onClick={[Function]}
626
627
  onFocus={[Function]}
627
628
  required={false}
629
+ step={null}
628
630
  type="text"
629
- <<<<<<< HEAD
630
- value="2021-11-17"
631
- =======
632
631
  value="1988-01-02"
633
- >>>>>>> development
634
632
  />
635
633
  </div>
636
634
  </div>
@@ -678,6 +676,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 3`] = `
678
676
  onClick={[Function]}
679
677
  onFocus={[Function]}
680
678
  required={false}
679
+ step={null}
681
680
  type="text"
682
681
  value="1988/02/01"
683
682
  />
@@ -729,6 +728,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 4`] = `
729
728
  onClick={[Function]}
730
729
  onFocus={[Function]}
731
730
  required={false}
731
+ step={null}
732
732
  type="text"
733
733
  value="1988-01-02"
734
734
  />
@@ -793,6 +793,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 5`] = `
793
793
  onClick={[Function]}
794
794
  onFocus={[Function]}
795
795
  required={false}
796
+ step={null}
796
797
  type="text"
797
798
  value="1988-01-02"
798
799
  />
@@ -28,7 +28,8 @@ import { getCategory } from "../../utils/componentCategories";
28
28
  parameters={{
29
29
  design: {
30
30
  type: "figma",
31
- url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=10734%3A3945",
31
+ url:
32
+ "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=10734%3A3945",
32
33
  },
33
34
  jest: ["Icon.test.tsx"],
34
35
  }}
@@ -44,7 +45,7 @@ import { getCategory } from "../../utils/componentCategories";
44
45
  | Component Version | DS Version |
45
46
  | ----------------- | ---------- |
46
47
  | Added | `0.0.4` |
47
- | Latest | `0.25.4` |
48
+ | Latest | `0.25.8` |
48
49
 
49
50
  <Description of={Icon} />
50
51
 
@@ -5,6 +5,7 @@ import action_check_circle from "../../../icons/svg/action_check_circle.svg";
5
5
  import action_help_default from "../../../icons/svg/action_help_default.svg";
6
6
  import action_help_outline from "../../../icons/svg/action_help_outline.svg";
7
7
  import action_launch from "../../../icons/svg/action_launch.svg";
8
+ import alert_notification_important from "../../../icons/svg/alert_notification_important.svg";
8
9
  import arrow from "../../../icons/svg/arrow.svg";
9
10
  import brooklyn from "../../../icons/svg/brooklyn.svg";
10
11
  import check from "../../../icons/svg/check.svg";
@@ -57,6 +58,7 @@ export default {
57
58
  action_help_default,
58
59
  action_help_outline,
59
60
  action_launch,
61
+ alert_notification_important,
60
62
  arrow,
61
63
  brooklyn,
62
64
  check,
@@ -52,6 +52,7 @@ export enum IconNames {
52
52
  ActionCheckCircle = "action_check_circle",
53
53
  ActionHelpDefault = "action_help_default",
54
54
  ActionHelpOutline = "action_help_outline",
55
+ AlertNotificationImportant = "alert_notification_important",
55
56
  ActionLaunch = "action_launch",
56
57
  Arrow = "arrow",
57
58
  Check = "check",
@@ -11,8 +11,16 @@ import { VStack } from "@chakra-ui/react";
11
11
  import Image from "./Image";
12
12
  import { ImageRatios, ImageSizes, ImageTypes } from "./ImageTypes";
13
13
  import Heading from "../Heading/Heading";
14
+ import SimpleGrid from "../Grid/SimpleGrid";
14
15
  import { getCategory } from "../../utils/componentCategories";
15
16
 
17
+ export const imageBlockStyles = {
18
+ margin: "auto",
19
+ maxWidth: "360px",
20
+ textAlign: "center",
21
+ width: "100%",
22
+ };
23
+
16
24
  <Meta
17
25
  title={getCategory("Image")}
18
26
  component={Image}
@@ -20,7 +28,8 @@ import { getCategory } from "../../utils/componentCategories";
20
28
  parameters={{
21
29
  design: {
22
30
  type: "figma",
23
- url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11896%3A45379",
31
+ url:
32
+ "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11896%3A45379",
24
33
  },
25
34
  jest: ["Image.test.tsx"],
26
35
  }}
@@ -36,7 +45,7 @@ import { getCategory } from "../../utils/componentCategories";
36
45
  | Component Version | DS Version |
37
46
  | ----------------- | ---------- |
38
47
  | Added | `0.0.6` |
39
- | Latest | `0.25.3` |
48
+ | Latest | `0.25.8` |
40
49
 
41
50
  <Description of={Image} />
42
51
 
@@ -102,28 +111,61 @@ Use the `ImageSizes` prop to set the desired size.
102
111
 
103
112
  <Canvas>
104
113
  <Story name="Image Sizes">
105
- <VStack spacing="xs">
106
- <Heading id="Small" text="ImageSizes.Small" />
107
- <Image
108
- alt="Alt text"
109
- imageSize={ImageSizes.Small}
110
- src="https://placeimg.com/400/300/animals"
111
- />
112
- <Heading id="Medium" text="ImageSizes.Medium" />
113
- <Image
114
- alt="Alt text"
115
- imageSize={ImageSizes.Medium}
116
- src="https://placeimg.com/400/300/animals"
117
- />
118
- <Heading id="Large" text="ImageSizes.Large" />
119
- <Image
120
- alt="Alt text"
121
- imageSize={ImageSizes.Large}
122
- src="https://placeimg.com/400/300/animals"
123
- />
124
- <Heading id="Default" text="ImageSizes.Default" />
125
- <Image alt="Alt text" src="https://placeimg.com/400/300/animals" />
126
- </VStack>
114
+ <SimpleGrid columns={1}>
115
+ <div style={{ textAlign: "center" }}>
116
+ <Heading id="ExtraExtraSmall" text="ImageSizes.ExtraExtraSmall" />
117
+ <Image
118
+ alt="Alt text"
119
+ imageCaption="64px"
120
+ imageSize={ImageSizes.ExtraExtraSmall}
121
+ src="https://placeimg.com/400/300/animals"
122
+ />
123
+ </div>
124
+ <div style={{ textAlign: "center" }}>
125
+ <Heading id="ExtraSmall" text="ImageSizes.ExtraSmall" />
126
+ <Image
127
+ alt="Alt text"
128
+ imageCaption="96px"
129
+ imageSize={ImageSizes.ExtraSmall}
130
+ src="https://placeimg.com/400/300/animals"
131
+ />
132
+ </div>
133
+ <div style={{ textAlign: "center" }}>
134
+ <Heading id="Small" text="ImageSizes.Small" />
135
+ <Image
136
+ alt="Alt text"
137
+ imageCaption="165px"
138
+ imageSize={ImageSizes.Small}
139
+ src="https://placeimg.com/400/300/animals"
140
+ />
141
+ </div>
142
+ <div style={{ textAlign: "center" }}>
143
+ <Heading id="Medium" text="ImageSizes.Medium" />
144
+ <Image
145
+ alt="Alt text"
146
+ imageCaption="225px"
147
+ imageSize={ImageSizes.Medium}
148
+ src="https://placeimg.com/400/300/animals"
149
+ />
150
+ </div>
151
+ <div style={{ textAlign: "center" }}>
152
+ <Heading id="Large" text="ImageSizes.Large" />
153
+ <Image
154
+ alt="Alt text"
155
+ imageCaption="360px"
156
+ imageSize={ImageSizes.Large}
157
+ src="https://placeimg.com/400/300/animals"
158
+ />
159
+ </div>
160
+ <div style={{ textAlign: "center" }}>
161
+ <Heading id="Default" text="ImageSizes.Default" />
162
+ <Image
163
+ alt="Alt text"
164
+ imageCaption="100%"
165
+ src="https://placeimg.com/400/300/animals"
166
+ />
167
+ </div>
168
+ </SimpleGrid>
127
169
  </Story>
128
170
  </Canvas>
129
171
 
@@ -137,56 +179,72 @@ in an element with a fixed width value.
137
179
 
138
180
  <Canvas>
139
181
  <Story name="Image Aspect Ratios">
140
- <VStack spacing="xs" maxWidth="360px" margin="auto">
141
- <Heading id="fourbythree" text="ImageRatios.FourByThree" />
142
- <Image
143
- alt="Alt text"
144
- imageAspectRatio={ImageRatios.FourByThree}
145
- src="https://placeimg.com/400/300/animals"
146
- />
147
- <Heading id="onebytwo" text="ImageRatios.OneByTwo" />
148
- <Image
149
- alt="Alt text"
150
- imageAspectRatio={ImageRatios.OneByTwo}
151
- src="https://placeimg.com/400/300/animals"
152
- />
153
- <Heading id="original" text="ImageRatios.Original" />
154
- <Image
155
- alt="Alt text"
156
- imageAspectRatio={ImageRatios.Original}
157
- src="https://placeimg.com/400/300/animals"
158
- />
159
- <Heading id="sixteenbynine" text="ImageRatios.SixteenByNine" />
160
- <Image
161
- alt="Alt text"
162
- imageAspectRatio={ImageRatios.SixteenByNine}
163
- src="https://placeimg.com/400/300/animals"
164
- />
165
- <Heading id="square" text="ImageRatios.Square" />
166
- <Image
167
- alt="Alt text"
168
- imageAspectRatio={ImageRatios.Square}
169
- src="https://placeimg.com/400/300/animals"
170
- />
171
- <Heading id="threebyfour" text="ImageRatios.ThreeByFour" />
172
- <Image
173
- alt="Alt text"
174
- imageAspectRatio={ImageRatios.ThreeByFour}
175
- src="https://placeimg.com/400/300/animals"
176
- />
177
- <Heading id="threebytwo" text="ImageRatios.ThreeByTwo" />
178
- <Image
179
- alt="Alt text"
180
- imageAspectRatio={ImageRatios.ThreeByTwo}
181
- src="https://placeimg.com/400/300/animals"
182
- />
183
- <Heading id="twobyone" text="ImageRatios.TwoByOne" />
184
- <Image
185
- alt="Alt text"
186
- imageAspectRatio={ImageRatios.TwoByOne}
187
- src="https://placeimg.com/400/300/animals"
188
- />
189
- </VStack>
182
+ <SimpleGrid columns={1}>
183
+ <div style={imageBlockStyles}>
184
+ <Heading id="fourbythree" text="ImageRatios.FourByThree" />
185
+ <Image
186
+ alt="Alt text"
187
+ imageAspectRatio={ImageRatios.FourByThree}
188
+ src="https://placeimg.com/400/300/animals"
189
+ />
190
+ </div>
191
+ <div style={imageBlockStyles}>
192
+ <Heading id="onebytwo" text="ImageRatios.OneByTwo" />
193
+ <Image
194
+ alt="Alt text"
195
+ imageAspectRatio={ImageRatios.OneByTwo}
196
+ src="https://placeimg.com/400/300/animals"
197
+ />
198
+ </div>
199
+ <div style={imageBlockStyles}>
200
+ <Heading id="original" text="ImageRatios.Original" />
201
+ <Image
202
+ alt="Alt text"
203
+ imageAspectRatio={ImageRatios.Original}
204
+ src="https://placeimg.com/400/300/animals"
205
+ />
206
+ </div>
207
+ <div style={imageBlockStyles}>
208
+ <Heading id="sixteenbynine" text="ImageRatios.SixteenByNine" />
209
+ <Image
210
+ alt="Alt text"
211
+ imageAspectRatio={ImageRatios.SixteenByNine}
212
+ src="https://placeimg.com/400/300/animals"
213
+ />
214
+ </div>
215
+ <div style={imageBlockStyles}>
216
+ <Heading id="square" text="ImageRatios.Square" />
217
+ <Image
218
+ alt="Alt text"
219
+ imageAspectRatio={ImageRatios.Square}
220
+ src="https://placeimg.com/400/300/animals"
221
+ />
222
+ </div>
223
+ <div style={imageBlockStyles}>
224
+ <Heading id="threebyfour" text="ImageRatios.ThreeByFour" />
225
+ <Image
226
+ alt="Alt text"
227
+ imageAspectRatio={ImageRatios.ThreeByFour}
228
+ src="https://placeimg.com/400/300/animals"
229
+ />
230
+ </div>
231
+ <div style={imageBlockStyles}>
232
+ <Heading id="threebytwo" text="ImageRatios.ThreeByTwo" />
233
+ <Image
234
+ alt="Alt text"
235
+ imageAspectRatio={ImageRatios.ThreeByTwo}
236
+ src="https://placeimg.com/400/300/animals"
237
+ />
238
+ </div>
239
+ <div style={imageBlockStyles}>
240
+ <Heading id="twobyone" text="ImageRatios.TwoByOne" />
241
+ <Image
242
+ alt="Alt text"
243
+ imageAspectRatio={ImageRatios.TwoByOne}
244
+ src="https://placeimg.com/400/300/animals"
245
+ />
246
+ </div>
247
+ </SimpleGrid>
190
248
  </Story>
191
249
  </Canvas>
192
250
 
@@ -200,21 +258,25 @@ in an element with a fixed width value.
200
258
 
201
259
  <Canvas>
202
260
  <Story name="Image Types">
203
- <VStack spacing="xs" maxWidth="360px" margin="auto">
204
- <Heading id="default" text="ImageTypes.Default" />
205
- <Image
206
- alt="Alt text"
207
- imageAspectRatio={ImageRatios.Square}
208
- imageType={ImageTypes.Default}
209
- src="https://placeimg.com/400/400/animals"
210
- />
211
- <Heading id="circle" text="ImageTypes.Circle" />
212
- <Image
213
- alt="Alt text"
214
- imageAspectRatio={ImageRatios.Square}
215
- imageType={ImageTypes.Circle}
216
- src="https://placeimg.com/400/400/animals"
217
- />
218
- </VStack>
261
+ <SimpleGrid columns={1}>
262
+ <div style={imageBlockStyles}>
263
+ <Heading id="default" text="ImageTypes.Default" />
264
+ <Image
265
+ alt="Alt text"
266
+ imageAspectRatio={ImageRatios.Square}
267
+ imageType={ImageTypes.Default}
268
+ src="https://placeimg.com/400/400/animals"
269
+ />
270
+ </div>
271
+ <div style={imageBlockStyles}>
272
+ <Heading id="circle" text="ImageTypes.Circle" />
273
+ <Image
274
+ alt="Alt text"
275
+ imageAspectRatio={ImageRatios.Square}
276
+ imageType={ImageTypes.Circle}
277
+ src="https://placeimg.com/400/400/animals"
278
+ />
279
+ </div>
280
+ </SimpleGrid>
219
281
  </Story>
220
282
  </Canvas>