@nypl/design-system-react-components 0.25.2 → 0.25.6
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 +101 -0
- package/README.md +47 -11
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +9 -8
- package/dist/components/Button/ButtonTypes.d.ts +2 -1
- package/dist/components/Card/Card.d.ts +36 -52
- package/dist/components/Card/CardTypes.d.ts +0 -15
- package/dist/components/Checkbox/Checkbox.d.ts +8 -9
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +2 -2
- package/dist/components/DatePicker/DatePicker.d.ts +36 -36
- package/dist/components/Fieldset/Fieldset.d.ts +25 -0
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +4 -0
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +10 -3
- package/dist/components/Icons/Icon.d.ts +4 -0
- package/dist/components/Icons/IconSvgs.d.ts +11 -0
- package/dist/components/Icons/IconTypes.d.ts +11 -0
- package/dist/components/Image/Image.d.ts +19 -9
- package/dist/components/Image/ImageTypes.d.ts +20 -0
- package/dist/components/Link/Link.d.ts +4 -0
- package/dist/components/List/List.d.ts +7 -1
- package/dist/components/Notification/Notification.d.ts +6 -4
- package/dist/components/Pagination/Pagination.d.ts +16 -13
- package/dist/components/Pagination/Pagination.stories.d.ts +2 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
- package/dist/components/SearchBar/SearchBar.d.ts +3 -3
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +18 -14
- package/dist/components/Slider/Slider.d.ts +57 -0
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +10 -0
- package/dist/design-system-react-components.cjs.development.js +3058 -936
- 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 +3049 -921
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +12 -6
- package/dist/resources.scss +180 -170
- package/dist/styles.css +1 -1
- package/dist/theme/components/breadcrumb.d.ts +9 -0
- package/dist/theme/components/button.d.ts +22 -8
- package/dist/theme/components/card.d.ts +168 -0
- package/dist/theme/components/checkbox.d.ts +5 -1
- package/dist/theme/components/checkboxGroup.d.ts +12 -0
- package/dist/theme/components/datePicker.d.ts +16 -0
- package/dist/theme/components/fieldset.d.ts +27 -0
- package/dist/theme/components/global.d.ts +23 -13
- package/dist/theme/components/globalMixins.d.ts +9 -1
- package/dist/theme/components/heading.d.ts +5 -0
- package/dist/theme/components/image.d.ts +31 -0
- package/dist/theme/components/label.d.ts +5 -3
- package/dist/theme/components/link.d.ts +4 -0
- package/dist/theme/components/list.d.ts +5 -1
- package/dist/theme/components/notification.d.ts +4 -14
- package/dist/theme/components/pagination.d.ts +19 -0
- package/dist/theme/components/progressIndicator.d.ts +50 -0
- package/dist/theme/components/radioGroup.d.ts +12 -0
- package/dist/theme/components/select.d.ts +11 -2
- package/dist/theme/components/skeletonLoader.d.ts +98 -0
- package/dist/theme/components/slider.d.ts +51 -0
- package/dist/theme/components/textInput.d.ts +8 -0
- package/dist/theme/foundations/breakpoints.d.ts +8 -8
- package/dist/theme/foundations/global.d.ts +6 -1
- package/package.json +72 -84
- package/src/__tests__/setup.ts +2 -2
- package/src/components/Accordion/Accordion.stories.mdx +39 -42
- package/src/components/Autosuggest/Autosuggest.stories.mdx +3 -3
- package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -0
- package/src/components/Autosuggest/_Autosuggest.scss +5 -5
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +24 -8
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +33 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +5 -1
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +298 -1
- package/src/components/Button/Button.stories.mdx +15 -10
- package/src/components/Button/Button.test.tsx +21 -7
- package/src/components/Button/Button.tsx +18 -33
- package/src/components/Button/ButtonTypes.tsx +1 -0
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +41 -10
- package/src/components/Card/Card.stories.mdx +296 -259
- package/src/components/Card/Card.test.tsx +156 -84
- package/src/components/Card/Card.tsx +195 -145
- package/src/components/Card/CardTypes.tsx +0 -17
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +410 -0
- package/src/components/CardEdition/CardEdition.stories.tsx +15 -47
- package/src/components/CardEdition/_CardEdition.scss +22 -23
- package/src/components/Chakra/Box.stories.mdx +14 -15
- package/src/components/Chakra/Center.stories.mdx +15 -8
- package/src/components/Chakra/Grid.stories.mdx +16 -7
- package/src/components/Chakra/Stack.stories.mdx +35 -18
- package/src/components/Checkbox/Checkbox.stories.mdx +33 -11
- package/src/components/Checkbox/Checkbox.test.tsx +30 -3
- package/src/components/Checkbox/Checkbox.tsx +27 -27
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +90 -2
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +82 -2
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +14 -15
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +44 -80
- package/src/components/DatePicker/DatePicker.stories.mdx +163 -62
- package/src/components/DatePicker/DatePicker.test.tsx +248 -65
- package/src/components/DatePicker/DatePicker.tsx +158 -130
- package/src/components/DatePicker/_DatePicker.scss +33 -67
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +818 -0
- package/src/components/Fieldset/Fieldset.stories.mdx +55 -0
- package/src/components/Fieldset/Fieldset.test.tsx +125 -0
- package/src/components/Fieldset/Fieldset.tsx +52 -0
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +68 -0
- package/src/components/Form/Form.stories.mdx +4 -5
- package/src/components/Form/Form.tsx +1 -0
- package/src/components/Grid/SimpleGrid.stories.mdx +32 -39
- package/src/components/Grid/SimpleGrid.test.tsx +4 -4
- package/src/components/Heading/Heading.stories.mdx +3 -4
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -1
- package/src/components/HelperErrorText/HelperErrorText.tsx +5 -1
- package/src/components/Hero/HeroTypes.tsx +1 -0
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +7 -7
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +6 -5
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +17 -0
- package/src/components/HorizontalRule/HorizontalRule.tsx +21 -4
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +5 -5
- package/src/components/Icons/Icon.stories.mdx +11 -3
- package/src/components/Icons/Icon.test.tsx +18 -0
- package/src/components/Icons/Icon.tsx +6 -0
- package/src/components/Icons/IconSvgs.tsx +22 -0
- package/src/components/Icons/IconTypes.tsx +11 -0
- package/src/components/Image/Image.stories.mdx +220 -0
- package/src/components/Image/Image.test.tsx +131 -29
- package/src/components/Image/Image.tsx +84 -56
- package/src/components/Image/ImageTypes.ts +22 -0
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +190 -0
- package/src/components/Input/Input.stories.tsx +20 -64
- package/src/components/Input/_Input.scss +23 -14
- package/src/components/Link/Link.tsx +4 -1
- package/src/components/List/List.stories.mdx +1 -1
- package/src/components/List/List.tsx +11 -4
- package/src/components/Modal/Modal.stories.mdx +3 -3
- package/src/components/Modal/_Modal.scss +2 -2
- package/src/components/Notification/Notification.stories.mdx +1 -3
- package/src/components/Notification/Notification.tsx +24 -9
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +2 -0
- package/src/components/Pagination/Pagination.stories.mdx +26 -27
- package/src/components/Pagination/Pagination.stories.tsx +11 -16
- package/src/components/Pagination/Pagination.test.tsx +276 -146
- package/src/components/Pagination/Pagination.tsx +174 -154
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +285 -0
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +292 -0
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +225 -0
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +126 -0
- package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +8 -0
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +357 -0
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +3 -0
- package/src/components/RadioGroup/RadioGroup.stories.mdx +3 -4
- package/src/components/RadioGroup/RadioGroup.tsx +11 -16
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +39 -71
- package/src/components/SearchBar/SearchBar.Test.tsx +66 -21
- package/src/components/SearchBar/SearchBar.stories.mdx +114 -10
- package/src/components/SearchBar/SearchBar.tsx +15 -5
- package/src/components/Select/SelectTypes.tsx +1 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +28 -59
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +97 -177
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +74 -71
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +739 -0
- package/src/components/Slider/Slider.stories.mdx +529 -0
- package/src/components/Slider/Slider.test.tsx +653 -0
- package/src/components/Slider/Slider.tsx +303 -0
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +1946 -0
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +1 -1
- package/src/components/StyleGuide/Breakpoints.stories.mdx +21 -7
- package/src/components/StyleGuide/Buttons.stories.mdx +69 -15
- package/src/components/StyleGuide/ColorCard.tsx +0 -1
- package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
- package/src/components/StyleGuide/Iconography.stories.mdx +51 -62
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Template/Template.stories.mdx +11 -16
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/TextInput/TextInput.tsx +23 -6
- package/src/components/TextInput/TextInputTypes.tsx +2 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -3
- package/src/docs/Chakra.stories.mdx +2 -2
- package/src/index.ts +20 -12
- package/src/resources.scss +5 -5
- package/src/styles/base/{_02-breakpoints.scss → _01-breakpoints.scss} +9 -10
- package/src/styles/base/{_03-mixins.scss → _02-mixins.scss} +16 -5
- package/src/styles/base/{_04-base.scss → _03-base.scss} +7 -2
- package/src/styles/base/{_05-focus.scss → _04-focus.scss} +0 -15
- package/src/styles/base/_place-holder.scss +14 -3
- package/src/styles/{03-space → space}/_space-inline.scss +14 -14
- package/src/styles/{03-space → space}/_space-inset.scss +10 -10
- package/src/styles/space/_space-stack.scss +116 -0
- package/src/styles.scss +13 -55
- package/src/theme/components/breadcrumb.ts +10 -0
- package/src/theme/components/button.ts +18 -12
- package/src/theme/components/card.ts +174 -0
- package/src/theme/components/checkbox.ts +7 -2
- package/src/theme/components/checkboxGroup.ts +8 -0
- package/src/theme/components/datePicker.ts +17 -0
- package/src/theme/components/fieldset.ts +18 -0
- package/src/theme/components/global.ts +26 -15
- package/src/theme/components/globalMixins.ts +9 -1
- package/src/theme/components/heading.ts +5 -0
- package/src/theme/components/image.ts +116 -0
- package/src/theme/components/label.ts +3 -10
- package/src/theme/components/link.ts +4 -0
- package/src/theme/components/list.ts +6 -3
- package/src/theme/components/notification.ts +12 -14
- package/src/theme/components/pagination.ts +20 -0
- package/src/theme/components/progressIndicator.ts +62 -0
- package/src/theme/components/radioGroup.ts +8 -0
- package/src/theme/components/select.ts +5 -2
- package/src/theme/components/skeletonLoader.ts +107 -0
- package/src/theme/components/slider.ts +79 -0
- package/src/theme/components/textInput.ts +2 -0
- package/src/theme/foundations/breakpoints.ts +8 -8
- package/src/theme/foundations/global.ts +6 -1
- package/src/theme/index.ts +22 -4
- package/src/utils/componentCategories.ts +4 -3
- package/dist/components/Image/Image.stories.d.ts +0 -18
- package/dist/theme/components/customCheckboxGroup.d.ts +0 -18
- package/dist/theme/components/customRadioGroup.d.ts +0 -18
- package/src/components/Button/_Button.scss +0 -32
- package/src/components/Card/_Card.scss +0 -308
- package/src/components/Image/Image.stories.tsx +0 -54
- package/src/components/Image/_Image.scss +0 -38
- package/src/components/Pagination/_Pagination.scss +0 -40
- package/src/components/SkeletonLoader/_SkeletonLoader.scss +0 -142
- package/src/styles/01-colors/_colors-brand.scss +0 -62
- package/src/styles/01-colors/_colors-utility.scss +0 -67
- package/src/styles/02-typography/_type-scale.css +0 -11
- package/src/styles/02-typography/_type-weight.css +0 -7
- package/src/styles/02-typography/_typefaces.css +0 -4
- package/src/styles/03-space/_space-stack.scss +0 -116
- package/src/styles/03-space/_space.css +0 -30
- package/src/styles/base/_card-grid.scss +0 -77
- package/src/styles/base/_typography.scss +0 -11
- package/src/theme/components/customCheckboxGroup.ts +0 -12
- package/src/theme/components/customRadioGroup.ts +0 -12
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Card Renders the UI snapshot correctly 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
className="css-0"
|
|
6
|
+
id="regularCard"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
className="the-wrap css-0"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
className="the-crop css-0"
|
|
13
|
+
>
|
|
14
|
+
<img
|
|
15
|
+
alt="Alt text"
|
|
16
|
+
className="css-0"
|
|
17
|
+
src="https://placeimg.com/400/200/arch"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div
|
|
22
|
+
className="card-body css-0"
|
|
23
|
+
>
|
|
24
|
+
<h3
|
|
25
|
+
className="chakra-heading css-0"
|
|
26
|
+
id="heading1"
|
|
27
|
+
>
|
|
28
|
+
The Card Heading
|
|
29
|
+
</h3>
|
|
30
|
+
<div
|
|
31
|
+
className="css-0"
|
|
32
|
+
>
|
|
33
|
+
middle column content
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
className="css-0"
|
|
37
|
+
>
|
|
38
|
+
<button
|
|
39
|
+
className="chakra-button css-0"
|
|
40
|
+
data-testid="button"
|
|
41
|
+
id="button1"
|
|
42
|
+
onClick={[Function]}
|
|
43
|
+
type="submit"
|
|
44
|
+
>
|
|
45
|
+
Example CTA
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
exports[`Card Renders the UI snapshot correctly 2`] = `
|
|
53
|
+
<div
|
|
54
|
+
className="edition-card css-0"
|
|
55
|
+
id="cardWithExtendedStyles"
|
|
56
|
+
>
|
|
57
|
+
<div
|
|
58
|
+
className="the-wrap css-0"
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
className="the-crop css-0"
|
|
62
|
+
>
|
|
63
|
+
<img
|
|
64
|
+
alt="Alt text"
|
|
65
|
+
className="css-0"
|
|
66
|
+
src="https://placeimg.com/300/400/arch"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
className="card-body css-0"
|
|
72
|
+
>
|
|
73
|
+
<h2
|
|
74
|
+
className="chakra-heading css-0"
|
|
75
|
+
id="editioncardheading1"
|
|
76
|
+
>
|
|
77
|
+
The Card Heading
|
|
78
|
+
</h2>
|
|
79
|
+
<div
|
|
80
|
+
className="css-0"
|
|
81
|
+
>
|
|
82
|
+
<div>
|
|
83
|
+
Published in New York by Random House
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
Written in English
|
|
87
|
+
</div>
|
|
88
|
+
<div>
|
|
89
|
+
License: Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<div
|
|
93
|
+
className="css-0"
|
|
94
|
+
>
|
|
95
|
+
<a
|
|
96
|
+
className="css-0"
|
|
97
|
+
href="online"
|
|
98
|
+
id="link-online"
|
|
99
|
+
>
|
|
100
|
+
Read Online
|
|
101
|
+
</a>
|
|
102
|
+
<a
|
|
103
|
+
className="css-0"
|
|
104
|
+
href="#url"
|
|
105
|
+
id="link-icon"
|
|
106
|
+
>
|
|
107
|
+
<svg
|
|
108
|
+
aria-hidden={true}
|
|
109
|
+
className="chakra-icon css-onkibi"
|
|
110
|
+
focusable={false}
|
|
111
|
+
id="icon-cardWithExtendedStyles"
|
|
112
|
+
role="img"
|
|
113
|
+
title="download icon"
|
|
114
|
+
viewBox="0 0 24 24"
|
|
115
|
+
>
|
|
116
|
+
<g
|
|
117
|
+
stroke="currentColor"
|
|
118
|
+
strokeWidth="1.5"
|
|
119
|
+
>
|
|
120
|
+
<path
|
|
121
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
122
|
+
fill="none"
|
|
123
|
+
strokeLinecap="round"
|
|
124
|
+
/>
|
|
125
|
+
<path
|
|
126
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
127
|
+
fill="currentColor"
|
|
128
|
+
strokeLinecap="round"
|
|
129
|
+
/>
|
|
130
|
+
<circle
|
|
131
|
+
cx="12"
|
|
132
|
+
cy="12"
|
|
133
|
+
fill="none"
|
|
134
|
+
r="11.25"
|
|
135
|
+
strokeMiterlimit="10"
|
|
136
|
+
/>
|
|
137
|
+
</g>
|
|
138
|
+
</svg>
|
|
139
|
+
Download
|
|
140
|
+
</a>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
`;
|
|
145
|
+
|
|
146
|
+
exports[`Card Renders the UI snapshot correctly 3`] = `
|
|
147
|
+
<div
|
|
148
|
+
className="edition-card css-0"
|
|
149
|
+
id="cardWithNoCTAs"
|
|
150
|
+
>
|
|
151
|
+
<div
|
|
152
|
+
className="the-wrap css-0"
|
|
153
|
+
>
|
|
154
|
+
<div
|
|
155
|
+
className="the-crop css-0"
|
|
156
|
+
>
|
|
157
|
+
<img
|
|
158
|
+
alt="Alt text"
|
|
159
|
+
className="css-0"
|
|
160
|
+
src="https://placeimg.com/300/400/arch"
|
|
161
|
+
/>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
<div
|
|
165
|
+
className="card-body css-0"
|
|
166
|
+
>
|
|
167
|
+
<h2
|
|
168
|
+
className="chakra-heading css-0"
|
|
169
|
+
id="editioncardheading1"
|
|
170
|
+
>
|
|
171
|
+
The Card Heading
|
|
172
|
+
</h2>
|
|
173
|
+
<div
|
|
174
|
+
className="css-0"
|
|
175
|
+
>
|
|
176
|
+
<p>
|
|
177
|
+
Published in New York by Random House
|
|
178
|
+
</p>
|
|
179
|
+
<p>
|
|
180
|
+
Written in English
|
|
181
|
+
</p>
|
|
182
|
+
<p>
|
|
183
|
+
Under Creative Commons License
|
|
184
|
+
</p>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
`;
|
|
189
|
+
|
|
190
|
+
exports[`Card Renders the UI snapshot correctly 4`] = `
|
|
191
|
+
<div
|
|
192
|
+
className="edition-card css-0"
|
|
193
|
+
id="cardWithNoContent"
|
|
194
|
+
>
|
|
195
|
+
<div
|
|
196
|
+
className="the-wrap css-0"
|
|
197
|
+
>
|
|
198
|
+
<div
|
|
199
|
+
className="the-crop css-0"
|
|
200
|
+
>
|
|
201
|
+
<img
|
|
202
|
+
alt="Alt text"
|
|
203
|
+
className="css-0"
|
|
204
|
+
src="https://placeimg.com/300/400/arch"
|
|
205
|
+
/>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
<div
|
|
209
|
+
className="card-body css-0"
|
|
210
|
+
>
|
|
211
|
+
<h2
|
|
212
|
+
className="chakra-heading css-0"
|
|
213
|
+
id="editioncardheading1"
|
|
214
|
+
>
|
|
215
|
+
<a
|
|
216
|
+
className="chakra-link css-1xdhyk6"
|
|
217
|
+
href="#edition-link"
|
|
218
|
+
>
|
|
219
|
+
The Card Heading
|
|
220
|
+
</a>
|
|
221
|
+
</h2>
|
|
222
|
+
<div
|
|
223
|
+
className="css-0"
|
|
224
|
+
>
|
|
225
|
+
<a
|
|
226
|
+
className="css-0"
|
|
227
|
+
href="online"
|
|
228
|
+
id="link-online"
|
|
229
|
+
>
|
|
230
|
+
Read Online
|
|
231
|
+
</a>
|
|
232
|
+
<a
|
|
233
|
+
className="css-0"
|
|
234
|
+
href="#url"
|
|
235
|
+
id="link-icon"
|
|
236
|
+
>
|
|
237
|
+
<svg
|
|
238
|
+
aria-hidden={true}
|
|
239
|
+
className="chakra-icon css-onkibi"
|
|
240
|
+
focusable={false}
|
|
241
|
+
id="icon-cardWithNoContent"
|
|
242
|
+
role="img"
|
|
243
|
+
title="download 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
|
+
Download
|
|
270
|
+
</a>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
`;
|
|
275
|
+
|
|
276
|
+
exports[`Card Renders the UI snapshot correctly 5`] = `
|
|
277
|
+
<div
|
|
278
|
+
className="edition-card css-0"
|
|
279
|
+
id="cardWithNoImage"
|
|
280
|
+
>
|
|
281
|
+
<div
|
|
282
|
+
className="card-body css-0"
|
|
283
|
+
>
|
|
284
|
+
<h2
|
|
285
|
+
className="chakra-heading css-0"
|
|
286
|
+
id="editioncardheading1"
|
|
287
|
+
>
|
|
288
|
+
<a
|
|
289
|
+
className="chakra-link css-1xdhyk6"
|
|
290
|
+
href="#edition-link"
|
|
291
|
+
>
|
|
292
|
+
The Card Heading
|
|
293
|
+
</a>
|
|
294
|
+
</h2>
|
|
295
|
+
<div
|
|
296
|
+
className="css-0"
|
|
297
|
+
>
|
|
298
|
+
middle column content
|
|
299
|
+
</div>
|
|
300
|
+
<div
|
|
301
|
+
className="css-0"
|
|
302
|
+
>
|
|
303
|
+
<a
|
|
304
|
+
className="css-0"
|
|
305
|
+
href="online"
|
|
306
|
+
id="link-online"
|
|
307
|
+
>
|
|
308
|
+
Read Online
|
|
309
|
+
</a>
|
|
310
|
+
<a
|
|
311
|
+
className="css-0"
|
|
312
|
+
href="#url"
|
|
313
|
+
id="link-icon"
|
|
314
|
+
>
|
|
315
|
+
<svg
|
|
316
|
+
aria-hidden={true}
|
|
317
|
+
className="chakra-icon css-onkibi"
|
|
318
|
+
focusable={false}
|
|
319
|
+
id="icon-cardWithNoImage"
|
|
320
|
+
role="img"
|
|
321
|
+
title="download icon"
|
|
322
|
+
viewBox="0 0 24 24"
|
|
323
|
+
>
|
|
324
|
+
<g
|
|
325
|
+
stroke="currentColor"
|
|
326
|
+
strokeWidth="1.5"
|
|
327
|
+
>
|
|
328
|
+
<path
|
|
329
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
330
|
+
fill="none"
|
|
331
|
+
strokeLinecap="round"
|
|
332
|
+
/>
|
|
333
|
+
<path
|
|
334
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
335
|
+
fill="currentColor"
|
|
336
|
+
strokeLinecap="round"
|
|
337
|
+
/>
|
|
338
|
+
<circle
|
|
339
|
+
cx="12"
|
|
340
|
+
cy="12"
|
|
341
|
+
fill="none"
|
|
342
|
+
r="11.25"
|
|
343
|
+
strokeMiterlimit="10"
|
|
344
|
+
/>
|
|
345
|
+
</g>
|
|
346
|
+
</svg>
|
|
347
|
+
Download
|
|
348
|
+
</a>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
</div>
|
|
352
|
+
`;
|
|
353
|
+
|
|
354
|
+
exports[`Card Renders the UI snapshot correctly 6`] = `
|
|
355
|
+
<div
|
|
356
|
+
className="chakra-linkbox css-10n1vic"
|
|
357
|
+
>
|
|
358
|
+
<div
|
|
359
|
+
className="css-0"
|
|
360
|
+
id="fullclick"
|
|
361
|
+
>
|
|
362
|
+
<div
|
|
363
|
+
className="the-wrap css-0"
|
|
364
|
+
>
|
|
365
|
+
<div
|
|
366
|
+
className="the-crop css-0"
|
|
367
|
+
>
|
|
368
|
+
<img
|
|
369
|
+
alt="Alt text"
|
|
370
|
+
className="css-0"
|
|
371
|
+
src="https://placeimg.com/400/200/arch"
|
|
372
|
+
/>
|
|
373
|
+
</div>
|
|
374
|
+
</div>
|
|
375
|
+
<div
|
|
376
|
+
className="card-body css-0"
|
|
377
|
+
>
|
|
378
|
+
<h3
|
|
379
|
+
className="chakra-heading css-0"
|
|
380
|
+
id="heading1"
|
|
381
|
+
>
|
|
382
|
+
<a
|
|
383
|
+
className="chakra-linkbox__overlay css-1hnz6hu"
|
|
384
|
+
href="http://nypl.org"
|
|
385
|
+
>
|
|
386
|
+
The Card Heading
|
|
387
|
+
</a>
|
|
388
|
+
</h3>
|
|
389
|
+
<div
|
|
390
|
+
className="css-0"
|
|
391
|
+
>
|
|
392
|
+
middle column content
|
|
393
|
+
</div>
|
|
394
|
+
<div
|
|
395
|
+
className="css-0"
|
|
396
|
+
>
|
|
397
|
+
<button
|
|
398
|
+
className="chakra-button css-0"
|
|
399
|
+
data-testid="button"
|
|
400
|
+
id="button1"
|
|
401
|
+
onClick={[Function]}
|
|
402
|
+
type="submit"
|
|
403
|
+
>
|
|
404
|
+
Example CTA
|
|
405
|
+
</button>
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
`;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { action } from "@storybook/addon-actions";
|
|
3
|
-
import { text, boolean, select } from "@storybook/addon-knobs";
|
|
4
3
|
|
|
5
4
|
import CardEdition from "./CardEdition";
|
|
6
5
|
import Heading from "../Heading/Heading";
|
|
@@ -24,10 +23,6 @@ export default {
|
|
|
24
23
|
component: CardEdition,
|
|
25
24
|
};
|
|
26
25
|
|
|
27
|
-
let showCTAs, showImage, showHeader, showFooter;
|
|
28
|
-
|
|
29
|
-
const headerLevels = [1, 2, 3, 4, 5, 6];
|
|
30
|
-
|
|
31
26
|
const imageRatios = {
|
|
32
27
|
"1x1": "https://placeimg.com/100/100/animals",
|
|
33
28
|
"2x1": "https://placeimg.com/200/100/animals",
|
|
@@ -39,48 +34,23 @@ const imageRatios = {
|
|
|
39
34
|
|
|
40
35
|
export const cardEdition = () => (
|
|
41
36
|
<>
|
|
42
|
-
{boolean("Show Header", true) ? (showHeader = true) : (showHeader = false)}
|
|
43
|
-
{boolean("Show Image", true) ? (showImage = true) : (showImage = false)}
|
|
44
|
-
{boolean("Show CTAs", true) ? (showCTAs = true) : (showCTAs = false)}
|
|
45
|
-
{boolean("Show Footer", true) ? (showFooter = true) : (showFooter = false)}
|
|
46
37
|
<CardEdition
|
|
47
38
|
id="cardID"
|
|
48
|
-
heading={
|
|
49
|
-
|
|
50
|
-
<Heading
|
|
51
|
-
level={select("Header Level", headerLevels, headerLevels[2])}
|
|
52
|
-
id="heading1"
|
|
53
|
-
text={text("Header Content", "Optional Header")}
|
|
54
|
-
/>
|
|
55
|
-
) : (
|
|
56
|
-
false
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
image={
|
|
60
|
-
showImage ? (
|
|
61
|
-
<Image
|
|
62
|
-
src={select("Image Ratio", imageRatios, imageRatios[2])}
|
|
63
|
-
alt={""}
|
|
64
|
-
/>
|
|
65
|
-
) : null
|
|
66
|
-
}
|
|
39
|
+
heading={<Heading level={2} id="heading1" text="Header Content" />}
|
|
40
|
+
image={<Image src={imageRatios[2]} alt="" />}
|
|
67
41
|
ctas={
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</Button>
|
|
77
|
-
) : null
|
|
78
|
-
}
|
|
79
|
-
footer={
|
|
80
|
-
showFooter ? <>{text("Footer content: ", "Optional footer")}</> : null
|
|
42
|
+
<Button
|
|
43
|
+
onClick={action("clicked")}
|
|
44
|
+
id="button1"
|
|
45
|
+
buttonType={ButtonTypes.Primary}
|
|
46
|
+
type="submit"
|
|
47
|
+
>
|
|
48
|
+
CTA Button Text
|
|
49
|
+
</Button>
|
|
81
50
|
}
|
|
51
|
+
footer={<>Footer content: </>}
|
|
82
52
|
>
|
|
83
|
-
|
|
53
|
+
Card Content:
|
|
84
54
|
</CardEdition>
|
|
85
55
|
</>
|
|
86
56
|
);
|
|
@@ -90,8 +60,7 @@ cardEdition.storyName = "CardEdition";
|
|
|
90
60
|
cardEdition.parameters = {
|
|
91
61
|
design: {
|
|
92
62
|
type: "figma",
|
|
93
|
-
url:
|
|
94
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=17167%3A58131",
|
|
63
|
+
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=17167%3A58131",
|
|
95
64
|
},
|
|
96
65
|
};
|
|
97
66
|
|
|
@@ -117,7 +86,7 @@ export const ExampleCardEdition = () => (
|
|
|
117
86
|
<Heading
|
|
118
87
|
level={HeadingLevels.Two}
|
|
119
88
|
id="heading1"
|
|
120
|
-
text=
|
|
89
|
+
text="The Year of Magical Thinking"
|
|
121
90
|
/>
|
|
122
91
|
<div className="book__callout">A portrait of loss and grief</div>
|
|
123
92
|
<div>
|
|
@@ -148,7 +117,6 @@ ExampleCardEdition.storyName = "Example Card Edition";
|
|
|
148
117
|
ExampleCardEdition.parameters = {
|
|
149
118
|
design: {
|
|
150
119
|
type: "figma",
|
|
151
|
-
url:
|
|
152
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=17167%3A58131",
|
|
120
|
+
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=17167%3A58131",
|
|
153
121
|
},
|
|
154
122
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
.card-edition {
|
|
2
|
-
|
|
2
|
+
margin-bottom: var(--nypl-space-s);
|
|
3
3
|
|
|
4
4
|
align-items: flex-start;
|
|
5
|
-
border: 1px solid var(--ui-gray-light-cool);
|
|
5
|
+
border: 1px solid var(--nypl-colors-ui-gray-light-cool);
|
|
6
6
|
border-radius: 5px;
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-flow: column wrap;
|
|
9
|
-
padding: var(--space) var(--space-l);
|
|
9
|
+
padding: var(--nypl-space-s) var(--nypl-space-l);
|
|
10
10
|
|
|
11
11
|
&__heading,
|
|
12
12
|
&__footer {
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
justify-content: space-between;
|
|
20
20
|
width: 100%;
|
|
21
21
|
|
|
22
|
-
@include breakpoint($breakpoint-medium) {
|
|
22
|
+
@include breakpoint($nypl-breakpoint-medium) {
|
|
23
23
|
flex-flow: row wrap;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&__columns + &__footer {
|
|
28
|
-
margin-top: var(--space-xs);
|
|
28
|
+
margin-top: var(--nypl-space-xs);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
&__image {
|
|
32
|
-
|
|
32
|
+
margin-bottom: var(--nypl-space-s);
|
|
33
33
|
|
|
34
34
|
align-items: center;
|
|
35
|
-
background-color: var(--ui-gray-x-light-cool);
|
|
35
|
+
background-color: var(--nypl-colors-ui-gray-x-light-cool);
|
|
36
36
|
display: flex;
|
|
37
37
|
flex: 0 0 150px;
|
|
38
38
|
height: 150px;
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
max-width: 100%;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
@include breakpoint($breakpoint-medium) {
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
@include breakpoint($nypl-breakpoint-medium) {
|
|
47
|
+
margin-bottom: 0;
|
|
48
|
+
margin-right: var(--nypl-space-s);
|
|
49
49
|
|
|
50
50
|
align-self: center;
|
|
51
51
|
width: 150px;
|
|
@@ -53,45 +53,44 @@
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&__content {
|
|
56
|
-
|
|
56
|
+
margin-bottom: var(--nypl-space-s);
|
|
57
57
|
|
|
58
58
|
flex: 1 1;
|
|
59
59
|
|
|
60
|
-
@include breakpoint($breakpoint-medium) {
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
@include breakpoint($nypl-breakpoint-medium) {
|
|
61
|
+
margin-right: var(--nypl-space-s);
|
|
62
|
+
margin-bottom: 0;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&__ctas {
|
|
67
67
|
flex: 0 1 20%;
|
|
68
68
|
|
|
69
|
-
@include breakpoint($breakpoint-medium) {
|
|
70
|
-
|
|
69
|
+
@include breakpoint($nypl-breakpoint-medium) {
|
|
70
|
+
margin-right: var(--nypl-space-s);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
&__content + &__ctas {
|
|
75
|
-
|
|
75
|
+
margin-right: var(--nypl-space-s);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// Stories-only styles
|
|
80
80
|
.sb-show-main {
|
|
81
81
|
.var-docs {
|
|
82
|
-
padding: 0 0 var(--space) 0;
|
|
82
|
+
padding: 0 0 var(--nypl-space-s) 0;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.example-card-edition {
|
|
86
86
|
.card__content {
|
|
87
87
|
> * {
|
|
88
|
-
|
|
88
|
+
margin-bottom: var(--nypl-space-xxs);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.book__callout {
|
|
93
|
-
|
|
94
|
-
font-size: var(--font-size-1);
|
|
93
|
+
font-size: var(--nypl-fontSizes-1);
|
|
95
94
|
font-weight: 400;
|
|
96
95
|
line-height: 1.15;
|
|
97
96
|
margin: 0 0 0.5em;
|
|
@@ -123,12 +122,12 @@
|
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
> * {
|
|
126
|
-
|
|
125
|
+
margin-bottom: var(--nypl-space-xxs);
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
.book__filetype {
|
|
131
|
-
|
|
130
|
+
margin-bottom: var(--nypl-space-s);
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
.book__description {
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
VideoPlayerTypes,
|
|
8
8
|
VideoPlayerAspectRatios,
|
|
9
9
|
} from "../VideoPlayer/VideoPlayerTypes";
|
|
10
|
+
import DSProvider from "../../theme/provider";
|
|
10
11
|
|
|
11
12
|
<Meta title={getCategory("Box")} component={Box} />
|
|
12
13
|
|
|
@@ -16,7 +17,8 @@ import {
|
|
|
16
17
|
| ----------------- | ---------- |
|
|
17
18
|
| Added | `0.24.0` |
|
|
18
19
|
|
|
19
|
-
Note: This needs the use of the `DSProvider` component. See the
|
|
20
|
+
Note: This needs the use of the `DSProvider` component. See the
|
|
21
|
+
[README](https://nypl.github.io/nypl-design-system/storybook-static/?path=/story/chakra-ui--page#dsprovider)
|
|
20
22
|
for more information.
|
|
21
23
|
|
|
22
24
|
This component is directly exported from Chakra UI. The `Box` is a simple and
|
|
@@ -30,28 +32,25 @@ guide on the Chakra UI site.
|
|
|
30
32
|
<Story
|
|
31
33
|
name="Box"
|
|
32
34
|
args={{
|
|
33
|
-
|
|
35
|
+
padding: "s",
|
|
34
36
|
bg: "var(--nypl-colors-brand-primary)",
|
|
35
37
|
color: "white",
|
|
36
38
|
}}
|
|
37
39
|
>
|
|
38
|
-
{(args) =>
|
|
39
|
-
<Box {...args}>
|
|
40
|
-
So when I look up at the stars, I just wonder...what will they all
|
|
41
|
-
become someday?
|
|
42
|
-
</Box>
|
|
43
|
-
)}
|
|
40
|
+
{(args) => <Box {...args}>This text is inside a `Box` component.</Box>}
|
|
44
41
|
</Story>
|
|
45
42
|
</Canvas>
|
|
46
43
|
|
|
47
44
|
## With VideoPlayer Component Example
|
|
48
45
|
|
|
49
46
|
<Canvas>
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
<DSProvider>
|
|
48
|
+
<Box borderWidth="3px" padding="s" borderRadius="lg" overflow="hidden">
|
|
49
|
+
<VideoPlayer
|
|
50
|
+
videoId="nm-dD2tx6bk"
|
|
51
|
+
videoType={VideoPlayerTypes.YouTube}
|
|
52
|
+
aspectRatio={VideoPlayerAspectRatios.SixteenByNine}
|
|
53
|
+
/>
|
|
54
|
+
</Box>
|
|
55
|
+
</DSProvider>
|
|
57
56
|
</Canvas>
|