@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,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --nypl-space-xxs: --nypl-space-s / 4 // 4px or 0.25rem
|
|
3
|
+
* --nypl-space-xs: --nypl-space-s / 2 // 8px or 0.5rem
|
|
4
|
+
* --nypl-space-s: --nypl-space-s * 1; // 16px or 1rem
|
|
5
|
+
* --nypl-space-m: --nypl-space-s * 1.5; // 24px or 1.5rem
|
|
6
|
+
* --nypl-space-l: --nypl-space-s * 2; // 32px or 2rem
|
|
7
|
+
* --nypl-space-xl: --nypl-space-s * 3; // 48px or 3rem
|
|
8
|
+
* --nypl-space-xxl: --nypl-space-s * 4; // 64px or 4rem
|
|
9
|
+
* --nypl-space-xxxl: --nypl-space-s * 6; // 96px or 6rem
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
@mixin space-stack-none {
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@mixin space-stack-xxs {
|
|
17
|
+
margin-bottom: var(--nypl-space-xxs);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@mixin space-stack-xs {
|
|
21
|
+
margin-bottom: var(--nypl-space-xs);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin space-stack-s {
|
|
25
|
+
margin-bottom: var(--nypl-space-s);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin space-stack-m {
|
|
29
|
+
margin-bottom: var(--nypl-space-m);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@mixin space-stack-l {
|
|
33
|
+
margin-bottom: var(--nypl-space-l);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@mixin space-stack-xl {
|
|
37
|
+
margin-bottom: var(--nypl-space-xl);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@mixin space-stack-xxl {
|
|
41
|
+
margin-bottom: var(--nypl-space-xxl);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@mixin space-stack-xxxl {
|
|
45
|
+
margin-bottom: var(--nypl-space-xxxl);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@mixin space-stack-page {
|
|
49
|
+
@include space-stack-l;
|
|
50
|
+
|
|
51
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
52
|
+
@include space-stack-xl;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--full {
|
|
56
|
+
@include space-stack-xxl;
|
|
57
|
+
|
|
58
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
59
|
+
@include space-stack-xxxl;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@mixin remove-stack-page {
|
|
65
|
+
margin-top: calc(-1 * 32px);
|
|
66
|
+
|
|
67
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
68
|
+
margin-top: calc(-1 * 48px);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&--full {
|
|
72
|
+
margin-top: calc(-1 * 64px);
|
|
73
|
+
|
|
74
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
75
|
+
margin-top: calc(-1 * 96px);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@mixin get-space-stack($id) {
|
|
81
|
+
@if $id == "none" {
|
|
82
|
+
@include space-stack-none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@if $id == "xxs" {
|
|
86
|
+
@include space-stack-xxs;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@if $id == "xs" {
|
|
90
|
+
@include space-stack-xs;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@if $id == "s" {
|
|
94
|
+
@include space-stack-s;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@if $id == "m" {
|
|
98
|
+
@include space-stack-m;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@if $id == "l" {
|
|
102
|
+
@include space-stack-l;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@if $id == "xl" {
|
|
106
|
+
@include space-stack-xl;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@if $id == "xxl" {
|
|
110
|
+
@include space-stack-xxl;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@if $id == "xxxl" {
|
|
114
|
+
@include space-stack-xxxl;
|
|
115
|
+
}
|
|
116
|
+
}
|
package/src/styles.scss
CHANGED
|
@@ -2,71 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
// Better style reset
|
|
4
4
|
@import "~normalize.css/normalize";
|
|
5
|
-
|
|
6
5
|
// A cleaner way to do breakpoints/media queries, http://breakpoint-sass.com/
|
|
7
6
|
@import "~breakpoint-sass/stylesheets/breakpoint";
|
|
8
7
|
@import "~system-font-css/_system-font.scss";
|
|
9
|
-
|
|
10
8
|
// For the React DatePicker package.
|
|
11
9
|
@import "~react-datepicker/dist/react-datepicker.css";
|
|
12
|
-
// End libs
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
* The `css-vars` mixins have been included here
|
|
16
|
-
* because they are utilized in the colors SCSS files.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
// generates a collection of CSS vars
|
|
20
|
-
@mixin css-vars($map, $prefix) {
|
|
21
|
-
$prefix: str-insert($prefix, "-", str-length($prefix) + 1);
|
|
22
|
-
|
|
23
|
-
@each $name, $color in $map {
|
|
24
|
-
--#{$prefix}#{$name}: #{$color};
|
|
25
|
-
}
|
|
26
|
-
}
|
|
11
|
+
// End libs
|
|
27
12
|
|
|
28
13
|
// Order important
|
|
29
|
-
@import "./styles/
|
|
30
|
-
@import "./styles/
|
|
31
|
-
@import "./styles/
|
|
32
|
-
@import "./styles/
|
|
33
|
-
@import "./styles/02-typography/_typefaces";
|
|
34
|
-
@import "./styles/03-space/_space";
|
|
35
|
-
@import "./styles/03-space/_space-inline";
|
|
36
|
-
@import "./styles/03-space/_space-inset";
|
|
37
|
-
@import "./styles/03-space/_space-stack";
|
|
38
|
-
@import "./styles/base/_02-breakpoints";
|
|
39
|
-
@import "./styles/base/_03-mixins";
|
|
40
|
-
@import "./styles/base/_04-base";
|
|
41
|
-
@import "./styles/base/_05-focus";
|
|
42
|
-
@import "./styles/base/_card-grid";
|
|
14
|
+
@import "./styles/base/_01-breakpoints";
|
|
15
|
+
@import "./styles/base/_02-mixins";
|
|
16
|
+
@import "./styles/base/_03-base";
|
|
17
|
+
@import "./styles/base/_04-focus";
|
|
43
18
|
@import "./styles/base/_place-holder";
|
|
44
|
-
@import "./styles/
|
|
45
|
-
@import "./
|
|
46
|
-
@import "./
|
|
47
|
-
@import "./components/Autosuggest/_Autosuggest.scss";
|
|
48
|
-
|
|
49
|
-
fieldset {
|
|
50
|
-
.sr-only {
|
|
51
|
-
@include screenreader-only();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Copied over from Label.scss
|
|
56
|
-
.fieldset {
|
|
57
|
-
@include fieldset-reset;
|
|
58
|
-
}
|
|
19
|
+
@import "./styles/space/_space-inline";
|
|
20
|
+
@import "./styles/space/_space-inset";
|
|
21
|
+
@import "./styles/space/_space-stack";
|
|
59
22
|
|
|
60
|
-
|
|
61
|
-
border: 0;
|
|
62
|
-
font-weight: 500;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Order not important
|
|
66
|
-
@import "./components/Card/_Card.scss";
|
|
23
|
+
// Legacy/deprecated components:
|
|
67
24
|
@import "./components/CardEdition/_CardEdition.scss";
|
|
25
|
+
@import "./components/Input/_Input.scss";
|
|
26
|
+
|
|
27
|
+
// Components.
|
|
28
|
+
@import "./components/Autosuggest/_Autosuggest.scss"; // Depends on _Input.scss
|
|
68
29
|
@import "./components/DatePicker/_DatePicker.scss";
|
|
69
|
-
@import "./components/Image/_Image.scss";
|
|
70
30
|
@import "./components/Modal/_Modal.scss";
|
|
71
|
-
@import "./components/Pagination/_Pagination.scss";
|
|
72
|
-
@import "./components/SkeletonLoader/_SkeletonLoader.scss";
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
// Variant styling
|
|
2
|
+
const blogs = {
|
|
3
|
+
bg: "section.blogs.secondary",
|
|
4
|
+
color: "ui.black",
|
|
5
|
+
a: {
|
|
6
|
+
_hover: {
|
|
7
|
+
color: "ui.gray.xdark",
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
};
|
|
2
11
|
const booksAndMore = {
|
|
3
12
|
bg: "section.books-and-more.secondary",
|
|
4
13
|
};
|
|
@@ -67,6 +76,7 @@ const Breadcrumb = {
|
|
|
67
76
|
},
|
|
68
77
|
// Available variants:
|
|
69
78
|
variants: {
|
|
79
|
+
blogs,
|
|
70
80
|
booksAndMore,
|
|
71
81
|
locations,
|
|
72
82
|
research,
|
|
@@ -10,6 +10,7 @@ const baseStyle = {
|
|
|
10
10
|
px: "s",
|
|
11
11
|
textDecoration: "none",
|
|
12
12
|
wordWrap: "normal",
|
|
13
|
+
fontWeight: "regular",
|
|
13
14
|
svg: {
|
|
14
15
|
fill: "currentColor",
|
|
15
16
|
marginTop: "xxs",
|
|
@@ -27,24 +28,20 @@ const baseStyle = {
|
|
|
27
28
|
opacity: "1",
|
|
28
29
|
},
|
|
29
30
|
};
|
|
30
|
-
// Styles for different "lg" size
|
|
31
|
-
const sizes = {
|
|
32
|
-
lg: {
|
|
33
|
-
width: "150px",
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
31
|
// Styles for different visual variants:
|
|
37
|
-
// primary, secondary, link, pill,
|
|
32
|
+
// primary, secondary, link, pill, iconOnly, callout, searchbar, noBrand
|
|
38
33
|
const primary = {
|
|
39
34
|
bg: "ui.link.primary",
|
|
40
35
|
minWidth: "none",
|
|
41
36
|
height: "none",
|
|
37
|
+
fontSize: "-1",
|
|
42
38
|
};
|
|
43
39
|
const secondary = {
|
|
44
40
|
bg: "ui.white",
|
|
45
41
|
border: "1px solid",
|
|
46
42
|
borderColor: "ui.gray.light-cool",
|
|
47
43
|
color: "inherit",
|
|
44
|
+
fontSize: "-1",
|
|
48
45
|
_hover: {
|
|
49
46
|
bg: "ui.gray.xx-light-cool",
|
|
50
47
|
},
|
|
@@ -71,6 +68,7 @@ const pill = {
|
|
|
71
68
|
py: "xs",
|
|
72
69
|
paddingInlineStart: "m",
|
|
73
70
|
paddingInlineEnd: "m",
|
|
71
|
+
fontSize: "-1",
|
|
74
72
|
_hover: {
|
|
75
73
|
bg: "ui.gray.xx-light-cool",
|
|
76
74
|
},
|
|
@@ -88,6 +86,7 @@ const iconOnly = {
|
|
|
88
86
|
};
|
|
89
87
|
const callout = {
|
|
90
88
|
bg: "brand.primary",
|
|
89
|
+
fontSize: "-1",
|
|
91
90
|
_hover: {
|
|
92
91
|
bg: "brand.secondary",
|
|
93
92
|
},
|
|
@@ -98,27 +97,34 @@ const callout = {
|
|
|
98
97
|
const searchBar = {
|
|
99
98
|
...primary,
|
|
100
99
|
borderLeftRadius: "none",
|
|
100
|
+
borderRightRadius: { base: "none", md: "sm" },
|
|
101
|
+
lineHeight: "1.75",
|
|
102
|
+
};
|
|
103
|
+
const noBrand = {
|
|
104
|
+
...primary,
|
|
105
|
+
bg: "ui.black",
|
|
106
|
+
color: "ui.white",
|
|
107
|
+
_hover: {
|
|
108
|
+
bg: "ui.gray.xdark",
|
|
109
|
+
},
|
|
101
110
|
};
|
|
102
111
|
|
|
103
112
|
const Button = {
|
|
104
113
|
baseStyle,
|
|
105
|
-
sizes,
|
|
106
114
|
// Available variants:
|
|
107
|
-
// primary, secondary, link, pill, icon-only, searchBar
|
|
108
115
|
variants: {
|
|
109
116
|
primary,
|
|
110
117
|
secondary,
|
|
111
118
|
link,
|
|
112
119
|
pill,
|
|
113
|
-
|
|
120
|
+
iconOnly,
|
|
114
121
|
callout,
|
|
115
122
|
searchBar,
|
|
123
|
+
noBrand,
|
|
116
124
|
},
|
|
117
125
|
// Default values
|
|
118
126
|
defaultProps: {
|
|
119
|
-
size: "md",
|
|
120
127
|
variant: "primary",
|
|
121
|
-
colorScheme: "blue",
|
|
122
128
|
},
|
|
123
129
|
};
|
|
124
130
|
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
const imageSizes = {
|
|
2
|
+
small: { flex: { md: "0 0 165px" } },
|
|
3
|
+
medium: { flex: { md: "0 0 225px" } },
|
|
4
|
+
large: { flex: { md: "0 0 360px" } },
|
|
5
|
+
};
|
|
6
|
+
// This is complicated and can be refactored later...
|
|
7
|
+
const getBodyPaddingStyles = ({ border, hasImage, imageAtEnd, isRow }) => {
|
|
8
|
+
let bodyPadding = null;
|
|
9
|
+
if (border) {
|
|
10
|
+
bodyPadding = "s";
|
|
11
|
+
if (hasImage) {
|
|
12
|
+
bodyPadding = "0 var(--nypl-space-s) var(--nypl-space-s)";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (isRow && border) {
|
|
16
|
+
bodyPadding = "var(--nypl-space-s)";
|
|
17
|
+
}
|
|
18
|
+
if (isRow && border && hasImage) {
|
|
19
|
+
bodyPadding = {
|
|
20
|
+
base: "0 var(--nypl-space-s) var(--nypl-space-s)",
|
|
21
|
+
md: "var(--nypl-space-s) var(--nypl-space-s) var(--nypl-space-s) 0",
|
|
22
|
+
};
|
|
23
|
+
if (imageAtEnd) {
|
|
24
|
+
bodyPadding = {
|
|
25
|
+
base: "var(--nypl-space-s) var(--nypl-space-s) 0",
|
|
26
|
+
md: "var(--nypl-space-s) 0 var(--nypl-space-s) var(--nypl-space-s)",
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return bodyPadding;
|
|
31
|
+
};
|
|
32
|
+
const Card = {
|
|
33
|
+
parts: ["body", "heading"],
|
|
34
|
+
baseStyle: (props) => {
|
|
35
|
+
const { border, center, hasImage, imageAtEnd, layout } = props;
|
|
36
|
+
const isRow = layout === "row";
|
|
37
|
+
const layoutStyles = isRow
|
|
38
|
+
? {
|
|
39
|
+
display: "flex",
|
|
40
|
+
flexFlow: {
|
|
41
|
+
base: "column nowrap",
|
|
42
|
+
md: "row",
|
|
43
|
+
},
|
|
44
|
+
maxWidth: "100%",
|
|
45
|
+
textAlign: "left",
|
|
46
|
+
alignItems: center ? "center" : null,
|
|
47
|
+
}
|
|
48
|
+
: {};
|
|
49
|
+
const baseBorderStyles = border
|
|
50
|
+
? {
|
|
51
|
+
border: "1px solid",
|
|
52
|
+
borderColor: "ui.gray.medium",
|
|
53
|
+
}
|
|
54
|
+
: {};
|
|
55
|
+
const bodyPadding = getBodyPaddingStyles({
|
|
56
|
+
border,
|
|
57
|
+
hasImage,
|
|
58
|
+
imageAtEnd,
|
|
59
|
+
isRow,
|
|
60
|
+
});
|
|
61
|
+
let bodyMargin = null;
|
|
62
|
+
if (center) {
|
|
63
|
+
bodyMargin = "auto";
|
|
64
|
+
if (isRow) {
|
|
65
|
+
bodyMargin = "0";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
alignItems: "flex-start",
|
|
70
|
+
display: "flex",
|
|
71
|
+
flexFlow: "column wrap",
|
|
72
|
+
textAlign: center ? "center" : null,
|
|
73
|
+
heading: {
|
|
74
|
+
marginBottom: "xs",
|
|
75
|
+
},
|
|
76
|
+
body: {
|
|
77
|
+
display: { md: "block" },
|
|
78
|
+
flexFlow: { md: "row nowrap" },
|
|
79
|
+
margin: bodyMargin,
|
|
80
|
+
padding: bodyPadding,
|
|
81
|
+
},
|
|
82
|
+
...baseBorderStyles,
|
|
83
|
+
...layoutStyles,
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const CardActions = {
|
|
89
|
+
baseStyle: (props) => {
|
|
90
|
+
const { bottomBorder, center, layout, topBorder } = props;
|
|
91
|
+
let justifyContent = null;
|
|
92
|
+
if (center) {
|
|
93
|
+
justifyContent = "center";
|
|
94
|
+
} else if (layout === "row") {
|
|
95
|
+
justifyContent = "left";
|
|
96
|
+
}
|
|
97
|
+
const topBorderStyles = topBorder
|
|
98
|
+
? {
|
|
99
|
+
borderTop: "1px solid",
|
|
100
|
+
paddingTop: "xs",
|
|
101
|
+
}
|
|
102
|
+
: {};
|
|
103
|
+
const bottomBorderStyles = bottomBorder
|
|
104
|
+
? {
|
|
105
|
+
borderBottom: "1px solid",
|
|
106
|
+
paddingBottom: "xs",
|
|
107
|
+
}
|
|
108
|
+
: {};
|
|
109
|
+
return {
|
|
110
|
+
marginBottom: "xs",
|
|
111
|
+
columnGap: "var(--nypl-space-xs)",
|
|
112
|
+
display: "flex",
|
|
113
|
+
_last: {
|
|
114
|
+
marginBottom: "0",
|
|
115
|
+
},
|
|
116
|
+
...topBorderStyles,
|
|
117
|
+
...bottomBorderStyles,
|
|
118
|
+
justifyContent,
|
|
119
|
+
borderColor: "ui.gray.medium",
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const CardContent = {
|
|
125
|
+
baseStyle: {
|
|
126
|
+
marginBottom: "xs",
|
|
127
|
+
_last: {
|
|
128
|
+
marginBottom: "0",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const CardImage = {
|
|
134
|
+
baseStyle: ({ center, imageSize, imageAtEnd, layout }) => {
|
|
135
|
+
// These sizes are only for the "row" layout.
|
|
136
|
+
const size = imageSizes[imageSize] || {};
|
|
137
|
+
const layoutStyles =
|
|
138
|
+
layout === "row"
|
|
139
|
+
? {
|
|
140
|
+
display: "flex",
|
|
141
|
+
flexFlow: {
|
|
142
|
+
base: "column nowrap",
|
|
143
|
+
md: "row",
|
|
144
|
+
},
|
|
145
|
+
flex: { md: "0 0 225px" },
|
|
146
|
+
maxWidth: { base: "100%", md: "50%" },
|
|
147
|
+
textAlign: "left",
|
|
148
|
+
alignItems: center ? "center" : null,
|
|
149
|
+
margin: {
|
|
150
|
+
base: imageAtEnd ? "var(--nypl-space-m) 0 0" : null,
|
|
151
|
+
md: imageAtEnd
|
|
152
|
+
? "0 0 0 var(--nypl-space-m)"
|
|
153
|
+
: "0 var(--nypl-space-m) 0 0",
|
|
154
|
+
},
|
|
155
|
+
...size,
|
|
156
|
+
}
|
|
157
|
+
: {
|
|
158
|
+
marginBottom: "xs",
|
|
159
|
+
};
|
|
160
|
+
const imageAtEndStyles = imageAtEnd
|
|
161
|
+
? {
|
|
162
|
+
marginBottom: "0",
|
|
163
|
+
marginTop: "s",
|
|
164
|
+
order: "2",
|
|
165
|
+
}
|
|
166
|
+
: {};
|
|
167
|
+
return {
|
|
168
|
+
...imageAtEndStyles,
|
|
169
|
+
...layoutStyles,
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export default { Card, CardActions, CardContent, CardImage };
|
|
@@ -39,11 +39,16 @@ const baseStyleControl = {
|
|
|
39
39
|
borderColor: "ui.gray.medium",
|
|
40
40
|
color: "ui.gray.medium",
|
|
41
41
|
},
|
|
42
|
+
|
|
43
|
+
_indeterminate: {
|
|
44
|
+
color: "ui.focus",
|
|
45
|
+
borderColor: "ui.focus",
|
|
46
|
+
},
|
|
42
47
|
},
|
|
43
48
|
|
|
44
49
|
_indeterminate: {
|
|
45
|
-
|
|
46
|
-
borderColor: "ui.
|
|
50
|
+
color: "ui.focus",
|
|
51
|
+
borderColor: "ui.focus",
|
|
47
52
|
},
|
|
48
53
|
|
|
49
54
|
_disabled: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note: these styles are only used when the
|
|
3
|
+
* DatePicker is in "date range" mode.
|
|
4
|
+
*/
|
|
5
|
+
const DatePicker = {
|
|
6
|
+
parts: ["subLabels"],
|
|
7
|
+
baseStyle: {
|
|
8
|
+
subLabels: {
|
|
9
|
+
label: {
|
|
10
|
+
fontSize: "12px",
|
|
11
|
+
marginBottom: "0",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default DatePicker;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { labelLegendText } from "./global";
|
|
2
|
+
import { screenreaderOnly } from "./globalMixins";
|
|
3
|
+
|
|
4
|
+
const Fieldset = {
|
|
5
|
+
parts: ["helper"],
|
|
6
|
+
baseStyle: ({ isLegendHidden }) => {
|
|
7
|
+
const screenreaderStyles = isLegendHidden ? screenreaderOnly : {};
|
|
8
|
+
return {
|
|
9
|
+
legend: {
|
|
10
|
+
...labelLegendText,
|
|
11
|
+
...screenreaderStyles,
|
|
12
|
+
},
|
|
13
|
+
helper: { ...labelLegendText.helper },
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default Fieldset;
|
|
@@ -39,19 +39,6 @@ const checkboxRadioControlSize = {
|
|
|
39
39
|
h: "1.375rem",
|
|
40
40
|
w: "1.375rem",
|
|
41
41
|
};
|
|
42
|
-
// Used in `CheckboxGroup` and `RadioGroup`.
|
|
43
|
-
const checkboxRadioGroupLayout = {
|
|
44
|
-
legend: {
|
|
45
|
-
fontSize: "14px",
|
|
46
|
-
marginBottom: "s",
|
|
47
|
-
},
|
|
48
|
-
required: {
|
|
49
|
-
marginLeft: "m",
|
|
50
|
-
},
|
|
51
|
-
helper: {
|
|
52
|
-
marginTop: "s",
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
42
|
// Used in `Checkbox` and `Radio`.
|
|
56
43
|
const checkboxRadioHelperStyle = {
|
|
57
44
|
...helperTextMargin,
|
|
@@ -60,12 +47,36 @@ const checkboxRadioHelperStyle = {
|
|
|
60
47
|
fontStyle: "italic",
|
|
61
48
|
},
|
|
62
49
|
};
|
|
50
|
+
// Used in `Label` and `Fieldset`.
|
|
51
|
+
const labelLegendText = {
|
|
52
|
+
alignItems: "baseline",
|
|
53
|
+
width: "100%",
|
|
54
|
+
marginBottom: "s",
|
|
55
|
+
fontSize: "14px",
|
|
56
|
+
fontWeight: "medium",
|
|
57
|
+
display: "flex",
|
|
58
|
+
justifyContent: "space-between",
|
|
59
|
+
helper: {
|
|
60
|
+
marginLeft: "m",
|
|
61
|
+
fontWeight: "300",
|
|
62
|
+
fontSize: "-1",
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
const checkboxRadioGroupStyles = {
|
|
66
|
+
helper: {
|
|
67
|
+
marginTop: "s",
|
|
68
|
+
},
|
|
69
|
+
stack: {
|
|
70
|
+
width: "fit-content",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
63
73
|
|
|
64
74
|
export {
|
|
65
75
|
activeFocus,
|
|
66
|
-
checkboxRadioLabelStyles,
|
|
67
76
|
checkboxRadioControlSize,
|
|
68
|
-
|
|
77
|
+
checkboxRadioGroupStyles,
|
|
69
78
|
checkboxRadioHelperStyle,
|
|
79
|
+
checkboxRadioLabelStyles,
|
|
70
80
|
helperTextMargin,
|
|
81
|
+
labelLegendText,
|
|
71
82
|
};
|
|
@@ -12,5 +12,13 @@ const wrapperStyles = {
|
|
|
12
12
|
paddingLeft: "0",
|
|
13
13
|
width: "100%",
|
|
14
14
|
};
|
|
15
|
+
const screenreaderOnly = {
|
|
16
|
+
clip: "rect(1px, 1px, 1px, 1px)",
|
|
17
|
+
height: "1px",
|
|
18
|
+
overflow: "hidden",
|
|
19
|
+
position: "absolute !important",
|
|
20
|
+
width: "1px",
|
|
21
|
+
wordWrap: "normal",
|
|
22
|
+
};
|
|
15
23
|
|
|
16
|
-
export { wrapperStyles };
|
|
24
|
+
export { screenreaderOnly, wrapperStyles };
|