@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.
- package/CHANGELOG.md +52 -0
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -0
- package/dist/components/Icons/IconSvgs.d.ts +1 -0
- package/dist/components/Icons/IconTypes.d.ts +1 -0
- package/dist/components/Image/ImageTypes.d.ts +3 -1
- package/dist/components/Link/LinkTypes.d.ts +1 -0
- package/dist/components/Notification/Notification.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Toggle/Toggle.d.ts +47 -0
- package/dist/components/Toggle/ToggleSizes.d.ts +4 -0
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +5 -3
- package/dist/design-system-react-components.cjs.development.js +921 -360
- 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 +917 -353
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/theme/components/breadcrumb.d.ts +9 -0
- package/dist/theme/components/notification.d.ts +8 -4
- package/dist/theme/components/toggle.d.ts +68 -0
- package/dist/theme/foundations/spacing.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.stories.mdx +1 -2
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +20 -3
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +20 -0
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +198 -0
- package/src/components/Button/Button.tsx +0 -1
- package/src/components/Card/Card.stories.mdx +74 -7
- package/src/components/Card/Card.tsx +9 -8
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +67 -35
- package/src/components/Chakra/Grid.stories.mdx +11 -14
- package/src/components/DatePicker/DatePicker.test.tsx +8 -6
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +5 -4
- package/src/components/Icons/Icon.stories.mdx +3 -2
- package/src/components/Icons/IconSvgs.tsx +2 -0
- package/src/components/Icons/IconTypes.tsx +1 -0
- package/src/components/Image/Image.stories.mdx +152 -90
- package/src/components/Image/Image.test.tsx +10 -0
- package/src/components/Image/ImageTypes.ts +2 -0
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +24 -8
- package/src/components/Label/Label.stories.mdx +1 -1
- package/src/components/Link/Link.stories.mdx +2 -3
- package/src/components/Link/Link.test.tsx +71 -0
- package/src/components/Link/Link.tsx +41 -9
- package/src/components/Link/LinkTypes.tsx +1 -0
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +201 -0
- package/src/components/Notification/Notification.stories.mdx +36 -3
- package/src/components/Notification/Notification.test.tsx +62 -16
- package/src/components/Notification/Notification.tsx +17 -5
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +117 -0
- package/src/components/Pagination/Pagination.stories.mdx +1 -2
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +42 -0
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +2 -3
- package/src/components/SearchBar/SearchBar.Test.tsx +64 -20
- package/src/components/SearchBar/SearchBar.stories.mdx +3 -4
- package/src/components/SearchBar/SearchBar.tsx +4 -1
- package/src/components/Select/Select.stories.mdx +132 -55
- package/src/components/Select/Select.test.tsx +2 -2
- package/src/components/Select/Select.tsx +6 -2
- package/src/components/Slider/Slider.stories.mdx +3 -2
- package/src/components/Slider/Slider.test.tsx +35 -0
- package/src/components/Slider/Slider.tsx +8 -2
- package/src/components/Template/Template.stories.mdx +1 -2
- package/src/components/Toggle/Toggle.stories.mdx +176 -0
- package/src/components/Toggle/Toggle.test.tsx +140 -0
- package/src/components/Toggle/Toggle.tsx +118 -0
- package/src/components/Toggle/ToggleSizes.tsx +4 -0
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +255 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +39 -18
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +103 -1
- package/src/components/VideoPlayer/VideoPlayer.tsx +57 -17
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +48 -0
- package/src/index.ts +8 -0
- package/src/theme/components/breadcrumb.ts +11 -1
- package/src/theme/components/card.ts +4 -5
- package/src/theme/components/global.ts +1 -1
- package/src/theme/components/icon.ts +2 -2
- package/src/theme/components/image.ts +8 -0
- package/src/theme/components/notification.ts +8 -6
- package/src/theme/components/toggle.ts +65 -0
- package/src/theme/foundations/spacing.ts +3 -0
- package/src/theme/index.ts +2 -0
- package/src/utils/componentCategories.ts +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export { default as Modal } from "./components/Modal/Modal";
|
|
|
39
39
|
export { default as Notification } from "./components/Notification/Notification";
|
|
40
40
|
export { NotificationTypes } from "./components/Notification/NotificationTypes";
|
|
41
41
|
export { default as Pagination } from "./components/Pagination/Pagination";
|
|
42
|
+
export { default as ProgressIndicator } from "./components/ProgressIndicator/ProgressIndicator";
|
|
43
|
+
export { ProgressIndicatorSizes, ProgressIndicatorTypes, } from "./components/ProgressIndicator/ProgressIndicatorTypes";
|
|
42
44
|
export { default as Radio } from "./components/Radio/Radio";
|
|
43
45
|
export { default as RadioGroup } from "./components/RadioGroup/RadioGroup";
|
|
44
46
|
export { RadioGroupLayoutTypes } from "./components/RadioGroup/RadioGroupLayoutTypes";
|
|
@@ -47,6 +49,7 @@ export { default as Select } from "./components/Select/Select";
|
|
|
47
49
|
export { default as SimpleGrid } from "./components/Grid/SimpleGrid";
|
|
48
50
|
export { default as SkeletonLoader } from "./components/SkeletonLoader/SkeletonLoader";
|
|
49
51
|
export { SkeletonLoaderImageRatios, SkeletonLoaderLayouts, } from "./components/SkeletonLoader/SkeletonLoaderTypes";
|
|
52
|
+
export { default as Slider } from "./components/Slider/Slider";
|
|
50
53
|
export { default as StatusBadge } from "./components/StatusBadge/StatusBadge";
|
|
51
54
|
export { StatusBadgeTypes } from "./components/StatusBadge/StatusBadgeTypes";
|
|
52
55
|
export { Tabs, TabList, Tab, TabPanels, TabPanel, } from "./components/Tabs/Tabs";
|
|
@@ -55,6 +58,8 @@ export { default as Text } from "./components/Text/Text";
|
|
|
55
58
|
export { TextDisplaySizes } from "./components/Text/TextTypes";
|
|
56
59
|
export { default as TextInput, TextInputRefType, } from "./components/TextInput/TextInput";
|
|
57
60
|
export { TextInputTypes } from "./components/TextInput/TextInputTypes";
|
|
61
|
+
export { default as Toggle } from "./components/Toggle/Toggle";
|
|
62
|
+
export { ToggleSizes } from "./components/Toggle/ToggleSizes";
|
|
58
63
|
export { default as useNYPLTheme } from "./hooks/useNYPLTheme";
|
|
59
64
|
export { default as VideoPlayer } from "./components/VideoPlayer/VideoPlayer";
|
|
60
65
|
export { VideoPlayerAspectRatios, VideoPlayerTypes, } from "./components/VideoPlayer/VideoPlayerTypes";
|
|
@@ -43,23 +43,26 @@ declare const _default: {
|
|
|
43
43
|
};
|
|
44
44
|
NotificationContent: {
|
|
45
45
|
parts: string[];
|
|
46
|
-
baseStyle: ({ alignText, notificationType }: {
|
|
46
|
+
baseStyle: ({ alignText, icon, notificationType }: {
|
|
47
47
|
alignText: any;
|
|
48
|
+
icon: any;
|
|
48
49
|
notificationType: any;
|
|
49
50
|
}) => {
|
|
50
51
|
display: string;
|
|
51
52
|
justifyContent: string;
|
|
52
53
|
content: {
|
|
53
|
-
width: string;
|
|
54
|
-
paddingLeft: string;
|
|
55
54
|
color: string;
|
|
55
|
+
marginTop: string;
|
|
56
|
+
paddingLeft: string;
|
|
57
|
+
width: string;
|
|
56
58
|
};
|
|
57
59
|
};
|
|
58
60
|
};
|
|
59
61
|
NotificationHeading: {
|
|
60
62
|
parts: string[];
|
|
61
|
-
baseStyle: ({ centered, notificationType }: {
|
|
63
|
+
baseStyle: ({ centered, icon, notificationType }: {
|
|
62
64
|
centered: any;
|
|
65
|
+
icon: any;
|
|
63
66
|
notificationType: any;
|
|
64
67
|
}) => {
|
|
65
68
|
display: string;
|
|
@@ -67,6 +70,7 @@ declare const _default: {
|
|
|
67
70
|
justifyContent: string;
|
|
68
71
|
heading: {
|
|
69
72
|
marginBottom: string;
|
|
73
|
+
marginTop: string;
|
|
70
74
|
color: string;
|
|
71
75
|
};
|
|
72
76
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
Toggle: {
|
|
3
|
+
parts: string[];
|
|
4
|
+
baseStyle: {
|
|
5
|
+
label: {
|
|
6
|
+
display: string;
|
|
7
|
+
alignItems: string;
|
|
8
|
+
width: string;
|
|
9
|
+
};
|
|
10
|
+
helper: {
|
|
11
|
+
marginLeft: string;
|
|
12
|
+
marginTop: string;
|
|
13
|
+
marginBottom: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
defaultProps: {
|
|
17
|
+
size: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
Switch: {
|
|
21
|
+
baseStyle: {
|
|
22
|
+
opacity: number;
|
|
23
|
+
track: {
|
|
24
|
+
p: string;
|
|
25
|
+
border: string;
|
|
26
|
+
borderColor: string;
|
|
27
|
+
_checked: {
|
|
28
|
+
borderColor: string;
|
|
29
|
+
bg: string;
|
|
30
|
+
opacity: number;
|
|
31
|
+
};
|
|
32
|
+
_invalid: {
|
|
33
|
+
borderColor: string;
|
|
34
|
+
bg: string;
|
|
35
|
+
"> span": {
|
|
36
|
+
bg: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
_disabled: {
|
|
40
|
+
borderColor: string;
|
|
41
|
+
bg: string;
|
|
42
|
+
_checked: {
|
|
43
|
+
opacity: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
_focus: {
|
|
47
|
+
outline: string;
|
|
48
|
+
outlineColor: string;
|
|
49
|
+
outlineOffset: string;
|
|
50
|
+
zIndex: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
label: {
|
|
54
|
+
fontSize: number;
|
|
55
|
+
marginLeft: string;
|
|
56
|
+
};
|
|
57
|
+
thumb: {
|
|
58
|
+
_disabled: {
|
|
59
|
+
bg: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
defaultProps: {
|
|
64
|
+
colorScheme: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export default _default;
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* Chakra Number Value | Chakra Name value | DS Variable
|
|
24
24
|
* ------------------- | ----------------- | -----------------
|
|
25
|
+
* 0.5 | xxxs | --nypl-space-xxxs
|
|
25
26
|
* 1 | xxs | --nypl-space-xxs
|
|
26
27
|
* 2 | xs | --nypl-space-xs
|
|
27
28
|
* 4 | s | --nypl-space-s
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
export declare const spacing: {
|
|
35
36
|
px: string;
|
|
36
37
|
0: string;
|
|
38
|
+
xxxs: string;
|
|
37
39
|
0.5: string;
|
|
38
40
|
xxs: string;
|
|
39
41
|
1: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nypl/design-system-react-components",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.8",
|
|
4
4
|
"description": "Design System React Components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"src"
|
|
15
15
|
],
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">10
|
|
17
|
+
"node": ">10"
|
|
18
18
|
},
|
|
19
19
|
"author": "NYPL",
|
|
20
20
|
"license": "Apache-2.0",
|
|
@@ -22,8 +22,7 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
22
22
|
parameters={{
|
|
23
23
|
design: {
|
|
24
24
|
type: "figma",
|
|
25
|
-
url:
|
|
26
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=10734%3A2520",
|
|
25
|
+
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=10734%3A2520",
|
|
27
26
|
},
|
|
28
27
|
jest: ["Accordion.test.tsx"],
|
|
29
28
|
}}
|
|
@@ -38,7 +38,7 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
38
38
|
| Component Version | DS Version |
|
|
39
39
|
| ----------------- | ---------- |
|
|
40
40
|
| Added | `0.0.3` |
|
|
41
|
-
| Latest | `0.25.
|
|
41
|
+
| Latest | `0.25.8` |
|
|
42
42
|
|
|
43
43
|
<Description of={Breadcrumbs} />
|
|
44
44
|
|
|
@@ -91,12 +91,12 @@ The `Breadcrumbs` component background color can be set using the `colorVariant`
|
|
|
91
91
|
<Story
|
|
92
92
|
name="Color Variations"
|
|
93
93
|
args={{
|
|
94
|
-
colorVariant: ColorVariants.
|
|
94
|
+
colorVariant: ColorVariants.Blogs,
|
|
95
95
|
}}
|
|
96
96
|
>
|
|
97
97
|
{(args) => (
|
|
98
98
|
<>
|
|
99
|
-
<Heading level={HeadingLevels.Three}>
|
|
99
|
+
<Heading level={HeadingLevels.Three}>Blogs</Heading>
|
|
100
100
|
<Breadcrumbs
|
|
101
101
|
breadcrumbsData={[
|
|
102
102
|
{ url: "#", text: "Parent" },
|
|
@@ -113,6 +113,23 @@ The `Breadcrumbs` component background color can be set using the `colorVariant`
|
|
|
113
113
|
</Story>
|
|
114
114
|
</Canvas>
|
|
115
115
|
|
|
116
|
+
<Canvas>
|
|
117
|
+
<DSProvider>
|
|
118
|
+
<Heading level={HeadingLevels.Three}>Books and More</Heading>
|
|
119
|
+
<Breadcrumbs
|
|
120
|
+
breadcrumbsData={[
|
|
121
|
+
{ url: "#", text: "Parent" },
|
|
122
|
+
{ url: "#", text: "Child" },
|
|
123
|
+
{
|
|
124
|
+
url: "#",
|
|
125
|
+
text: "Grandchild",
|
|
126
|
+
},
|
|
127
|
+
]}
|
|
128
|
+
colorVariant={ColorVariants.BooksAndMore}
|
|
129
|
+
/>
|
|
130
|
+
</DSProvider>
|
|
131
|
+
</Canvas>
|
|
132
|
+
|
|
116
133
|
<Canvas>
|
|
117
134
|
<DSProvider>
|
|
118
135
|
<Heading level={HeadingLevels.Three}>Locations</Heading>
|
|
@@ -41,6 +41,24 @@ describe("Breadcrumbs Snapshot", () => {
|
|
|
41
41
|
/>
|
|
42
42
|
)
|
|
43
43
|
.toJSON();
|
|
44
|
+
const breadcrumbsBlogsVariant = renderer
|
|
45
|
+
.create(
|
|
46
|
+
<Breadcrumbs
|
|
47
|
+
breadcrumbsData={breadcrumbsData}
|
|
48
|
+
colorVariant={ColorVariants.Blogs}
|
|
49
|
+
id="breadcrumbs-test"
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
.toJSON();
|
|
53
|
+
const breadcrumbsLocationsVariant = renderer
|
|
54
|
+
.create(
|
|
55
|
+
<Breadcrumbs
|
|
56
|
+
breadcrumbsData={breadcrumbsData}
|
|
57
|
+
colorVariant={ColorVariants.Blogs}
|
|
58
|
+
id="breadcrumbs-test"
|
|
59
|
+
/>
|
|
60
|
+
)
|
|
61
|
+
.toJSON();
|
|
44
62
|
const breadcrumbsAdditionalStyles = renderer
|
|
45
63
|
.create(
|
|
46
64
|
<Breadcrumbs
|
|
@@ -55,6 +73,8 @@ describe("Breadcrumbs Snapshot", () => {
|
|
|
55
73
|
|
|
56
74
|
expect(breadcrumbsSnapshot).toMatchSnapshot();
|
|
57
75
|
expect(breadcrumbsVariantColor).toMatchSnapshot();
|
|
76
|
+
expect(breadcrumbsBlogsVariant).toMatchSnapshot();
|
|
77
|
+
expect(breadcrumbsLocationsVariant).toMatchSnapshot();
|
|
58
78
|
expect(breadcrumbsAdditionalStyles).toMatchSnapshot();
|
|
59
79
|
});
|
|
60
80
|
});
|
|
@@ -199,6 +199,204 @@ exports[`Breadcrumbs Snapshot Renders the UI snapshot correctly 2`] = `
|
|
|
199
199
|
`;
|
|
200
200
|
|
|
201
201
|
exports[`Breadcrumbs Snapshot Renders the UI snapshot correctly 3`] = `
|
|
202
|
+
<nav
|
|
203
|
+
aria-label="breadcrumb"
|
|
204
|
+
className="chakra-breadcrumb css-0"
|
|
205
|
+
id="breadcrumbs-test"
|
|
206
|
+
>
|
|
207
|
+
<ol
|
|
208
|
+
className="chakra-breadcrumb__list css-0"
|
|
209
|
+
>
|
|
210
|
+
<li
|
|
211
|
+
className="chakra-breadcrumb__list-item css-18biwo"
|
|
212
|
+
>
|
|
213
|
+
<a
|
|
214
|
+
className="chakra-breadcrumb__link css-0"
|
|
215
|
+
href="#string1"
|
|
216
|
+
>
|
|
217
|
+
<span
|
|
218
|
+
className="breadcrumb-label"
|
|
219
|
+
>
|
|
220
|
+
string1
|
|
221
|
+
</span>
|
|
222
|
+
</a>
|
|
223
|
+
<span
|
|
224
|
+
className="css-t4q1nq"
|
|
225
|
+
role="presentation"
|
|
226
|
+
>
|
|
227
|
+
/
|
|
228
|
+
</span>
|
|
229
|
+
</li>
|
|
230
|
+
<li
|
|
231
|
+
className="chakra-breadcrumb__list-item css-18biwo"
|
|
232
|
+
>
|
|
233
|
+
<a
|
|
234
|
+
className="chakra-breadcrumb__link css-0"
|
|
235
|
+
href="#string2"
|
|
236
|
+
>
|
|
237
|
+
<svg
|
|
238
|
+
aria-hidden={true}
|
|
239
|
+
className="chakra-icon breadcrumbs-icon css-onkibi"
|
|
240
|
+
focusable={false}
|
|
241
|
+
id="breadcrumbs-test__backarrow"
|
|
242
|
+
role="img"
|
|
243
|
+
title="arrow icon"
|
|
244
|
+
viewBox="0 0 24 24"
|
|
245
|
+
>
|
|
246
|
+
<g
|
|
247
|
+
stroke="currentColor"
|
|
248
|
+
strokeWidth="1.5"
|
|
249
|
+
>
|
|
250
|
+
<path
|
|
251
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
252
|
+
fill="none"
|
|
253
|
+
strokeLinecap="round"
|
|
254
|
+
/>
|
|
255
|
+
<path
|
|
256
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
257
|
+
fill="currentColor"
|
|
258
|
+
strokeLinecap="round"
|
|
259
|
+
/>
|
|
260
|
+
<circle
|
|
261
|
+
cx="12"
|
|
262
|
+
cy="12"
|
|
263
|
+
fill="none"
|
|
264
|
+
r="11.25"
|
|
265
|
+
strokeMiterlimit="10"
|
|
266
|
+
/>
|
|
267
|
+
</g>
|
|
268
|
+
</svg>
|
|
269
|
+
<span
|
|
270
|
+
className="breadcrumb-label"
|
|
271
|
+
>
|
|
272
|
+
string2
|
|
273
|
+
</span>
|
|
274
|
+
</a>
|
|
275
|
+
<span
|
|
276
|
+
className="css-t4q1nq"
|
|
277
|
+
role="presentation"
|
|
278
|
+
>
|
|
279
|
+
/
|
|
280
|
+
</span>
|
|
281
|
+
</li>
|
|
282
|
+
<li
|
|
283
|
+
className="chakra-breadcrumb__list-item css-18biwo"
|
|
284
|
+
>
|
|
285
|
+
<span
|
|
286
|
+
aria-current="page"
|
|
287
|
+
className="chakra-breadcrumb__link css-0"
|
|
288
|
+
>
|
|
289
|
+
<span
|
|
290
|
+
className="breadcrumb-label"
|
|
291
|
+
>
|
|
292
|
+
string3
|
|
293
|
+
</span>
|
|
294
|
+
</span>
|
|
295
|
+
</li>
|
|
296
|
+
</ol>
|
|
297
|
+
</nav>
|
|
298
|
+
`;
|
|
299
|
+
|
|
300
|
+
exports[`Breadcrumbs Snapshot Renders the UI snapshot correctly 4`] = `
|
|
301
|
+
<nav
|
|
302
|
+
aria-label="breadcrumb"
|
|
303
|
+
className="chakra-breadcrumb css-0"
|
|
304
|
+
id="breadcrumbs-test"
|
|
305
|
+
>
|
|
306
|
+
<ol
|
|
307
|
+
className="chakra-breadcrumb__list css-0"
|
|
308
|
+
>
|
|
309
|
+
<li
|
|
310
|
+
className="chakra-breadcrumb__list-item css-18biwo"
|
|
311
|
+
>
|
|
312
|
+
<a
|
|
313
|
+
className="chakra-breadcrumb__link css-0"
|
|
314
|
+
href="#string1"
|
|
315
|
+
>
|
|
316
|
+
<span
|
|
317
|
+
className="breadcrumb-label"
|
|
318
|
+
>
|
|
319
|
+
string1
|
|
320
|
+
</span>
|
|
321
|
+
</a>
|
|
322
|
+
<span
|
|
323
|
+
className="css-t4q1nq"
|
|
324
|
+
role="presentation"
|
|
325
|
+
>
|
|
326
|
+
/
|
|
327
|
+
</span>
|
|
328
|
+
</li>
|
|
329
|
+
<li
|
|
330
|
+
className="chakra-breadcrumb__list-item css-18biwo"
|
|
331
|
+
>
|
|
332
|
+
<a
|
|
333
|
+
className="chakra-breadcrumb__link css-0"
|
|
334
|
+
href="#string2"
|
|
335
|
+
>
|
|
336
|
+
<svg
|
|
337
|
+
aria-hidden={true}
|
|
338
|
+
className="chakra-icon breadcrumbs-icon css-onkibi"
|
|
339
|
+
focusable={false}
|
|
340
|
+
id="breadcrumbs-test__backarrow"
|
|
341
|
+
role="img"
|
|
342
|
+
title="arrow icon"
|
|
343
|
+
viewBox="0 0 24 24"
|
|
344
|
+
>
|
|
345
|
+
<g
|
|
346
|
+
stroke="currentColor"
|
|
347
|
+
strokeWidth="1.5"
|
|
348
|
+
>
|
|
349
|
+
<path
|
|
350
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
351
|
+
fill="none"
|
|
352
|
+
strokeLinecap="round"
|
|
353
|
+
/>
|
|
354
|
+
<path
|
|
355
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
356
|
+
fill="currentColor"
|
|
357
|
+
strokeLinecap="round"
|
|
358
|
+
/>
|
|
359
|
+
<circle
|
|
360
|
+
cx="12"
|
|
361
|
+
cy="12"
|
|
362
|
+
fill="none"
|
|
363
|
+
r="11.25"
|
|
364
|
+
strokeMiterlimit="10"
|
|
365
|
+
/>
|
|
366
|
+
</g>
|
|
367
|
+
</svg>
|
|
368
|
+
<span
|
|
369
|
+
className="breadcrumb-label"
|
|
370
|
+
>
|
|
371
|
+
string2
|
|
372
|
+
</span>
|
|
373
|
+
</a>
|
|
374
|
+
<span
|
|
375
|
+
className="css-t4q1nq"
|
|
376
|
+
role="presentation"
|
|
377
|
+
>
|
|
378
|
+
/
|
|
379
|
+
</span>
|
|
380
|
+
</li>
|
|
381
|
+
<li
|
|
382
|
+
className="chakra-breadcrumb__list-item css-18biwo"
|
|
383
|
+
>
|
|
384
|
+
<span
|
|
385
|
+
aria-current="page"
|
|
386
|
+
className="chakra-breadcrumb__link css-0"
|
|
387
|
+
>
|
|
388
|
+
<span
|
|
389
|
+
className="breadcrumb-label"
|
|
390
|
+
>
|
|
391
|
+
string3
|
|
392
|
+
</span>
|
|
393
|
+
</span>
|
|
394
|
+
</li>
|
|
395
|
+
</ol>
|
|
396
|
+
</nav>
|
|
397
|
+
`;
|
|
398
|
+
|
|
399
|
+
exports[`Breadcrumbs Snapshot Renders the UI snapshot correctly 5`] = `
|
|
202
400
|
<nav
|
|
203
401
|
aria-label="breadcrumb"
|
|
204
402
|
className="chakra-breadcrumb css-1f2fw9u"
|
|
@@ -31,8 +31,7 @@ import DSProvider from "../../theme/provider";
|
|
|
31
31
|
parameters={{
|
|
32
32
|
design: {
|
|
33
33
|
type: "figma",
|
|
34
|
-
url:
|
|
35
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36835%3A25747",
|
|
34
|
+
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36835%3A25747",
|
|
36
35
|
},
|
|
37
36
|
}}
|
|
38
37
|
argTypes={{
|
|
@@ -49,7 +48,7 @@ import DSProvider from "../../theme/provider";
|
|
|
49
48
|
| Component Version | DS Version |
|
|
50
49
|
| ----------------- | ---------- |
|
|
51
50
|
| Added | `0.24.0` |
|
|
52
|
-
| Latest | `0.25.
|
|
51
|
+
| Latest | `0.25.8` |
|
|
53
52
|
|
|
54
53
|
<Description of={Card} />
|
|
55
54
|
|
|
@@ -221,6 +220,44 @@ prop to override the default width.
|
|
|
221
220
|
<Canvas>
|
|
222
221
|
<Story name="Card Image Size">
|
|
223
222
|
<SimpleGrid columns={1}>
|
|
223
|
+
<Card
|
|
224
|
+
center
|
|
225
|
+
imageSrc="https://placeimg.com/400/200/animals"
|
|
226
|
+
imageAlt="Alt text"
|
|
227
|
+
imageAspectRatio={ImageRatios.Square}
|
|
228
|
+
imageSize={ImageSizes.ExtraExtraSmall}
|
|
229
|
+
>
|
|
230
|
+
<CardHeading level={HeadingLevels.Three} id="column-heading1">
|
|
231
|
+
Extra Extra Small Image
|
|
232
|
+
</CardHeading>
|
|
233
|
+
<CardHeading level={HeadingLevels.Four} id="column-heading2">
|
|
234
|
+
Max-Width: 64px
|
|
235
|
+
</CardHeading>
|
|
236
|
+
<CardContent>
|
|
237
|
+
Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
|
|
238
|
+
libero, a pharetra augue.
|
|
239
|
+
</CardContent>
|
|
240
|
+
</Card>
|
|
241
|
+
<HorizontalRule />
|
|
242
|
+
<Card
|
|
243
|
+
center
|
|
244
|
+
imageSrc="https://placeimg.com/400/200/animals"
|
|
245
|
+
imageAlt="Alt text"
|
|
246
|
+
imageAspectRatio={ImageRatios.Square}
|
|
247
|
+
imageSize={ImageSizes.ExtraSmall}
|
|
248
|
+
>
|
|
249
|
+
<CardHeading level={HeadingLevels.Three} id="column-heading1">
|
|
250
|
+
Extra Small Image
|
|
251
|
+
</CardHeading>
|
|
252
|
+
<CardHeading level={HeadingLevels.Four} id="column-heading2">
|
|
253
|
+
Max-Width: 96px
|
|
254
|
+
</CardHeading>
|
|
255
|
+
<CardContent>
|
|
256
|
+
Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
|
|
257
|
+
libero, a pharetra augue.
|
|
258
|
+
</CardContent>
|
|
259
|
+
</Card>
|
|
260
|
+
<HorizontalRule />
|
|
224
261
|
<Card
|
|
225
262
|
center
|
|
226
263
|
imageSrc="https://placeimg.com/400/200/animals"
|
|
@@ -306,7 +343,40 @@ prop to override the default width.
|
|
|
306
343
|
<SimpleGrid columns={1}>
|
|
307
344
|
<Card
|
|
308
345
|
layout={CardLayouts.Row}
|
|
309
|
-
|
|
346
|
+
imageSrc="https://placeimg.com/400/200/animals"
|
|
347
|
+
imageAlt="Alt text"
|
|
348
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
349
|
+
imageSize={ImageSizes.ExtraExtraSmall}
|
|
350
|
+
>
|
|
351
|
+
<CardHeading level={HeadingLevels.Three} id="row2-heading1">
|
|
352
|
+
Extra Extra Small Image
|
|
353
|
+
</CardHeading>
|
|
354
|
+
<CardHeading level={HeadingLevels.Four} id="row2-heading2">
|
|
355
|
+
Max-Width: 64px
|
|
356
|
+
</CardHeading>
|
|
357
|
+
<CardContent>
|
|
358
|
+
Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
|
|
359
|
+
</CardContent>
|
|
360
|
+
</Card>
|
|
361
|
+
<Card
|
|
362
|
+
layout={CardLayouts.Row}
|
|
363
|
+
imageSrc="https://placeimg.com/400/200/animals"
|
|
364
|
+
imageAlt="Alt text"
|
|
365
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
366
|
+
imageSize={ImageSizes.ExtraSmall}
|
|
367
|
+
>
|
|
368
|
+
<CardHeading level={HeadingLevels.Three} id="row2-heading1">
|
|
369
|
+
Extra Small Image
|
|
370
|
+
</CardHeading>
|
|
371
|
+
<CardHeading level={HeadingLevels.Four} id="row2-heading2">
|
|
372
|
+
Max-Width: 96px
|
|
373
|
+
</CardHeading>
|
|
374
|
+
<CardContent>
|
|
375
|
+
Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
|
|
376
|
+
</CardContent>
|
|
377
|
+
</Card>
|
|
378
|
+
<Card
|
|
379
|
+
layout={CardLayouts.Row}
|
|
310
380
|
imageSrc="https://placeimg.com/400/200/animals"
|
|
311
381
|
imageAlt="Alt text"
|
|
312
382
|
imageAspectRatio={ImageRatios.TwoByOne}
|
|
@@ -324,7 +394,6 @@ prop to override the default width.
|
|
|
324
394
|
</Card>
|
|
325
395
|
<Card
|
|
326
396
|
layout={CardLayouts.Row}
|
|
327
|
-
center
|
|
328
397
|
imageSrc="https://placeimg.com/410/210/animals"
|
|
329
398
|
imageAlt="Alt text"
|
|
330
399
|
imageAspectRatio={ImageRatios.TwoByOne}
|
|
@@ -343,7 +412,6 @@ prop to override the default width.
|
|
|
343
412
|
</Card>
|
|
344
413
|
<Card
|
|
345
414
|
layout={CardLayouts.Row}
|
|
346
|
-
center
|
|
347
415
|
imageSrc="https://placeimg.com/400/250/animals"
|
|
348
416
|
imageAlt="Alt text"
|
|
349
417
|
imageAspectRatio={ImageRatios.TwoByOne}
|
|
@@ -363,7 +431,6 @@ prop to override the default width.
|
|
|
363
431
|
</Card>
|
|
364
432
|
<Card
|
|
365
433
|
layout={CardLayouts.Row}
|
|
366
|
-
center
|
|
367
434
|
imageSrc="https://placeimg.com/450/250/animals"
|
|
368
435
|
imageAlt="Alt text"
|
|
369
436
|
imageAspectRatio={ImageRatios.TwoByOne}
|
|
@@ -91,14 +91,15 @@ function CardImage(props: React.ComponentProps<"img"> & CardImageProps) {
|
|
|
91
91
|
layout,
|
|
92
92
|
});
|
|
93
93
|
return (
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
<Box __css={styles}>
|
|
95
|
+
<Image
|
|
96
|
+
alt={alt}
|
|
97
|
+
component={component}
|
|
98
|
+
imageAspectRatio={imageAspectRatio}
|
|
99
|
+
imageSize={imageSize}
|
|
100
|
+
src={src}
|
|
101
|
+
/>
|
|
102
|
+
</Box>
|
|
102
103
|
);
|
|
103
104
|
}
|
|
104
105
|
|