@nypl/design-system-react-components 0.25.7 → 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 (80) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/components/Icons/IconSvgs.d.ts +1 -0
  3. package/dist/components/Icons/IconTypes.d.ts +1 -0
  4. package/dist/components/Image/ImageTypes.d.ts +3 -1
  5. package/dist/components/Link/LinkTypes.d.ts +1 -0
  6. package/dist/components/Notification/Notification.d.ts +2 -0
  7. package/dist/components/Select/Select.d.ts +2 -0
  8. package/dist/components/Toggle/Toggle.d.ts +47 -0
  9. package/dist/components/Toggle/ToggleSizes.d.ts +4 -0
  10. package/dist/components/VideoPlayer/VideoPlayer.d.ts +5 -3
  11. package/dist/design-system-react-components.cjs.development.js +613 -366
  12. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  13. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  14. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  15. package/dist/design-system-react-components.esm.js +606 -354
  16. package/dist/design-system-react-components.esm.js.map +1 -1
  17. package/dist/index.d.ts +3 -0
  18. package/dist/theme/components/notification.d.ts +8 -4
  19. package/dist/theme/components/toggle.d.ts +68 -0
  20. package/dist/theme/foundations/spacing.d.ts +2 -0
  21. package/package.json +1 -1
  22. package/src/components/Accordion/Accordion.stories.mdx +1 -2
  23. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +1 -1
  24. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +10 -0
  25. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +99 -0
  26. package/src/components/Button/Button.tsx +0 -1
  27. package/src/components/Card/Card.stories.mdx +74 -7
  28. package/src/components/Card/Card.tsx +9 -8
  29. package/src/components/Card/__snapshots__/Card.test.tsx.snap +67 -35
  30. package/src/components/Chakra/Grid.stories.mdx +11 -14
  31. package/src/components/DatePicker/DatePicker.test.tsx +8 -6
  32. package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +5 -4
  33. package/src/components/Icons/Icon.stories.mdx +3 -2
  34. package/src/components/Icons/IconSvgs.tsx +2 -0
  35. package/src/components/Icons/IconTypes.tsx +1 -0
  36. package/src/components/Image/Image.stories.mdx +152 -90
  37. package/src/components/Image/Image.test.tsx +10 -0
  38. package/src/components/Image/ImageTypes.ts +2 -0
  39. package/src/components/Image/__snapshots__/Image.test.tsx.snap +24 -8
  40. package/src/components/Label/Label.stories.mdx +1 -1
  41. package/src/components/Link/Link.stories.mdx +2 -3
  42. package/src/components/Link/Link.test.tsx +71 -0
  43. package/src/components/Link/Link.tsx +41 -9
  44. package/src/components/Link/LinkTypes.tsx +1 -0
  45. package/src/components/Link/__snapshots__/Link.test.tsx.snap +201 -0
  46. package/src/components/Notification/Notification.stories.mdx +36 -3
  47. package/src/components/Notification/Notification.test.tsx +62 -16
  48. package/src/components/Notification/Notification.tsx +17 -5
  49. package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +117 -0
  50. package/src/components/Pagination/Pagination.stories.mdx +1 -2
  51. package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +42 -0
  52. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +2 -3
  53. package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
  54. package/src/components/Select/Select.stories.mdx +132 -55
  55. package/src/components/Select/Select.test.tsx +2 -2
  56. package/src/components/Select/Select.tsx +6 -2
  57. package/src/components/Slider/Slider.stories.mdx +3 -2
  58. package/src/components/Slider/Slider.test.tsx +35 -0
  59. package/src/components/Slider/Slider.tsx +8 -2
  60. package/src/components/Template/Template.stories.mdx +1 -2
  61. package/src/components/Toggle/Toggle.stories.mdx +176 -0
  62. package/src/components/Toggle/Toggle.test.tsx +140 -0
  63. package/src/components/Toggle/Toggle.tsx +118 -0
  64. package/src/components/Toggle/ToggleSizes.tsx +4 -0
  65. package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +255 -0
  66. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +39 -18
  67. package/src/components/VideoPlayer/VideoPlayer.test.tsx +103 -1
  68. package/src/components/VideoPlayer/VideoPlayer.tsx +57 -17
  69. package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +48 -0
  70. package/src/index.ts +6 -0
  71. package/src/theme/components/breadcrumb.ts +1 -1
  72. package/src/theme/components/card.ts +4 -5
  73. package/src/theme/components/global.ts +1 -1
  74. package/src/theme/components/icon.ts +2 -2
  75. package/src/theme/components/image.ts +8 -0
  76. package/src/theme/components/notification.ts +8 -6
  77. package/src/theme/components/toggle.ts +65 -0
  78. package/src/theme/foundations/spacing.ts +3 -0
  79. package/src/theme/index.ts +2 -0
  80. package/src/utils/componentCategories.ts +3 -1
@@ -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>
@@ -74,6 +74,14 @@ describe("Image", () => {
74
74
  const figCaption = renderer
75
75
  .create(<Image src="test.png" alt="" imageCaption="Caption" />)
76
76
  .toJSON();
77
+ const sizeExtraExtraSmall = renderer
78
+ .create(
79
+ <Image src="test.png" alt="" imageSize={ImageSizes.ExtraExtraSmall} />
80
+ )
81
+ .toJSON();
82
+ const sizeExtraSmall = renderer
83
+ .create(<Image src="test.png" alt="" imageSize={ImageSizes.ExtraSmall} />)
84
+ .toJSON();
77
85
  const sizeSmall = renderer
78
86
  .create(<Image src="test.png" alt="" imageSize={ImageSizes.Small} />)
79
87
  .toJSON();
@@ -152,6 +160,8 @@ describe("Image", () => {
152
160
  .toJSON();
153
161
  expect(basic).toMatchSnapshot();
154
162
  expect(figCaption).toMatchSnapshot();
163
+ expect(sizeExtraExtraSmall).toMatchSnapshot();
164
+ expect(sizeExtraSmall).toMatchSnapshot();
155
165
  expect(sizeSmall).toMatchSnapshot();
156
166
  expect(sizeMedium).toMatchSnapshot();
157
167
  expect(sizeLarge).toMatchSnapshot();
@@ -14,6 +14,8 @@ export enum ImageSizes {
14
14
  Large = "large",
15
15
  Medium = "medium",
16
16
  Small = "small",
17
+ ExtraSmall = "xsmall",
18
+ ExtraExtraSmall = "xxsmall",
17
19
  }
18
20
 
19
21
  export enum ImageTypes {
@@ -54,6 +54,22 @@ exports[`Image Renders the UI snapshot correctly 5`] = `
54
54
  `;
55
55
 
56
56
  exports[`Image Renders the UI snapshot correctly 6`] = `
57
+ <img
58
+ alt=""
59
+ className="css-0"
60
+ src="test.png"
61
+ />
62
+ `;
63
+
64
+ exports[`Image Renders the UI snapshot correctly 7`] = `
65
+ <img
66
+ alt=""
67
+ className="css-0"
68
+ src="test.png"
69
+ />
70
+ `;
71
+
72
+ exports[`Image Renders the UI snapshot correctly 8`] = `
57
73
  <div
58
74
  className="the-wrap css-0"
59
75
  >
@@ -69,7 +85,7 @@ exports[`Image Renders the UI snapshot correctly 6`] = `
69
85
  </div>
70
86
  `;
71
87
 
72
- exports[`Image Renders the UI snapshot correctly 7`] = `
88
+ exports[`Image Renders the UI snapshot correctly 9`] = `
73
89
  <div
74
90
  className="the-wrap css-0"
75
91
  >
@@ -85,7 +101,7 @@ exports[`Image Renders the UI snapshot correctly 7`] = `
85
101
  </div>
86
102
  `;
87
103
 
88
- exports[`Image Renders the UI snapshot correctly 8`] = `
104
+ exports[`Image Renders the UI snapshot correctly 10`] = `
89
105
  <img
90
106
  alt=""
91
107
  className="css-0"
@@ -93,7 +109,7 @@ exports[`Image Renders the UI snapshot correctly 8`] = `
93
109
  />
94
110
  `;
95
111
 
96
- exports[`Image Renders the UI snapshot correctly 9`] = `
112
+ exports[`Image Renders the UI snapshot correctly 11`] = `
97
113
  <div
98
114
  className="the-wrap css-0"
99
115
  >
@@ -109,7 +125,7 @@ exports[`Image Renders the UI snapshot correctly 9`] = `
109
125
  </div>
110
126
  `;
111
127
 
112
- exports[`Image Renders the UI snapshot correctly 10`] = `
128
+ exports[`Image Renders the UI snapshot correctly 12`] = `
113
129
  <div
114
130
  className="the-wrap css-0"
115
131
  >
@@ -125,7 +141,7 @@ exports[`Image Renders the UI snapshot correctly 10`] = `
125
141
  </div>
126
142
  `;
127
143
 
128
- exports[`Image Renders the UI snapshot correctly 11`] = `
144
+ exports[`Image Renders the UI snapshot correctly 13`] = `
129
145
  <div
130
146
  className="the-wrap css-0"
131
147
  >
@@ -141,7 +157,7 @@ exports[`Image Renders the UI snapshot correctly 11`] = `
141
157
  </div>
142
158
  `;
143
159
 
144
- exports[`Image Renders the UI snapshot correctly 12`] = `
160
+ exports[`Image Renders the UI snapshot correctly 14`] = `
145
161
  <div
146
162
  className="the-wrap css-0"
147
163
  >
@@ -157,7 +173,7 @@ exports[`Image Renders the UI snapshot correctly 12`] = `
157
173
  </div>
158
174
  `;
159
175
 
160
- exports[`Image Renders the UI snapshot correctly 13`] = `
176
+ exports[`Image Renders the UI snapshot correctly 15`] = `
161
177
  <div
162
178
  className="the-wrap css-0"
163
179
  >
@@ -173,7 +189,7 @@ exports[`Image Renders the UI snapshot correctly 13`] = `
173
189
  </div>
174
190
  `;
175
191
 
176
- exports[`Image Renders the UI snapshot correctly 14`] = `
192
+ exports[`Image Renders the UI snapshot correctly 16`] = `
177
193
  <div
178
194
  className="the-wrap css-0"
179
195
  >
@@ -27,7 +27,7 @@ import { getCategory } from "../../utils/componentCategories";
27
27
  | Component Version | DS Version |
28
28
  | ----------------- | ---------- |
29
29
  | Added | `0.0.10` |
30
- | Latest | `0.25.1` |
30
+ | Latest | `0.25.8` |
31
31
 
32
32
  <Description of={Label} />
33
33
 
@@ -26,8 +26,7 @@ import DSProvider from "../../theme/provider";
26
26
  parameters={{
27
27
  design: {
28
28
  type: "figma",
29
- url:
30
- "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36854%3A24387",
29
+ url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36854%3A24387",
31
30
  },
32
31
  jest: ["Link.test.tsx"],
33
32
  }}
@@ -48,7 +47,7 @@ import DSProvider from "../../theme/provider";
48
47
  | Component Version | DS Version |
49
48
  | ----------------- | ---------- |
50
49
  | Added | `0.0.4` |
51
- | Latest | `0.25.1` |
50
+ | Latest | `0.25.8` |
52
51
 
53
52
  <Description of={Link} />
54
53