@nypl/design-system-react-components 0.25.3 → 0.25.7
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 +65 -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 -6
- package/dist/components/Button/ButtonTypes.d.ts +2 -1
- package/dist/components/Card/Card.d.ts +0 -25
- package/dist/components/Icons/IconSvgs.d.ts +3 -0
- package/dist/components/Icons/IconTypes.d.ts +3 -0
- package/dist/components/Notification/Notification.d.ts +6 -4
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
- package/dist/components/SearchBar/SearchBar.d.ts +3 -3
- 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 +6 -0
- package/dist/design-system-react-components.cjs.development.js +1022 -455
- 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 +1015 -444
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +8 -3
- 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 +10 -0
- package/dist/theme/components/progressIndicator.d.ts +50 -0
- package/dist/theme/components/slider.d.ts +51 -0
- package/dist/theme/foundations/breakpoints.d.ts +8 -8
- package/dist/theme/foundations/global.d.ts +6 -1
- package/package.json +71 -83
- package/src/__tests__/setup.ts +2 -2
- package/src/components/Accordion/Accordion.stories.mdx +30 -34
- 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 +297 -1
- package/src/components/Button/Button.stories.mdx +8 -6
- package/src/components/Button/Button.test.tsx +20 -0
- package/src/components/Button/Button.tsx +14 -23
- package/src/components/Button/ButtonTypes.tsx +1 -0
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +29 -4
- package/src/components/Card/Card.stories.mdx +1 -1
- package/src/components/Card/Card.tsx +3 -3
- 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/DatePicker/DatePicker.test.tsx +31 -30
- package/src/components/DatePicker/DatePicker.tsx +7 -4
- package/src/components/DatePicker/_DatePicker.scss +4 -4
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +19 -5
- package/src/components/Form/Form.stories.mdx +4 -5
- package/src/components/Grid/SimpleGrid.stories.mdx +1 -0
- package/src/components/Hero/HeroTypes.tsx +1 -0
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +2 -3
- package/src/components/Icons/Icon.stories.mdx +2 -3
- package/src/components/Icons/IconSvgs.tsx +6 -0
- package/src/components/Icons/IconTypes.tsx +3 -0
- package/src/components/Image/Image.stories.mdx +2 -3
- package/src/components/Input/Input.stories.tsx +20 -64
- package/src/components/Input/_Input.scss +23 -14
- 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 -1
- package/src/components/Notification/Notification.tsx +13 -4
- package/src/components/Pagination/Pagination.stories.mdx +3 -2
- package/src/components/Pagination/Pagination.stories.tsx +1 -2
- 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 +2 -3
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +4 -0
- package/src/components/SearchBar/SearchBar.Test.tsx +66 -21
- package/src/components/SearchBar/SearchBar.stories.mdx +110 -11
- package/src/components/SearchBar/SearchBar.tsx +15 -5
- package/src/components/Select/SelectTypes.tsx +1 -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 +9 -2
- package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Template/Template.stories.mdx +6 -6
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/TextInput/TextInput.tsx +15 -2
- 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 +12 -6
- 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 -44
- package/src/theme/components/breadcrumb.ts +10 -0
- package/src/theme/components/button.ts +10 -2
- package/src/theme/components/card.ts +11 -9
- package/src/theme/components/datePicker.ts +1 -1
- package/src/theme/components/list.ts +2 -2
- package/src/theme/components/notification.ts +5 -3
- package/src/theme/components/progressIndicator.ts +62 -0
- package/src/theme/components/skeletonLoader.ts +1 -1
- package/src/theme/components/slider.ts +79 -0
- package/src/theme/foundations/breakpoints.ts +8 -8
- package/src/theme/foundations/global.ts +6 -1
- package/src/theme/index.ts +4 -0
- package/src/utils/componentCategories.ts +3 -3
- 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
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
// Kept for backwards compatibility.
|
|
1
2
|
.nypl-ds {
|
|
2
3
|
box-sizing: border-box;
|
|
3
|
-
color: var(--ui-black);
|
|
4
|
-
font-family: var(--
|
|
4
|
+
color: var(--nypl-colors-ui-black);
|
|
5
|
+
font-family: var(--nypl-fonts-body);
|
|
5
6
|
|
|
6
7
|
// Sets up the base font-size, 1rem, for the system
|
|
7
8
|
font-size: 16px;
|
|
@@ -12,6 +13,10 @@
|
|
|
12
13
|
// our breakout mixin. Fix identified here: https://cloudfour.com/thinks/breaking-out-with-viewport-units-and-calc/#one-big-dumb-caveat
|
|
13
14
|
overflow-x: hidden;
|
|
14
15
|
|
|
16
|
+
p {
|
|
17
|
+
margin: 0 0 var(--nypl-space-s);
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
*,
|
|
16
21
|
*::after,
|
|
17
22
|
*::before {
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
// Focus state mixin
|
|
2
|
-
@mixin focus-outline($darkBackground: false) {
|
|
3
|
-
outline: 2px solid var(--ui-focus);
|
|
4
|
-
outline-offset: 2px;
|
|
5
|
-
z-index: 9999;
|
|
6
|
-
|
|
7
|
-
@if $darkBackground {
|
|
8
|
-
outline-color: var(--ui-white);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
1
|
// Apply :focus behavior to focusable elements only (For IE 11)
|
|
13
2
|
.nypl-ds {
|
|
14
3
|
input,
|
|
@@ -31,7 +20,3 @@
|
|
|
31
20
|
}
|
|
32
21
|
}
|
|
33
22
|
}
|
|
34
|
-
|
|
35
|
-
.focus {
|
|
36
|
-
@include focus-outline;
|
|
37
|
-
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
.placeholder {
|
|
2
|
-
--color-place-holder: var(--ui-gray-
|
|
2
|
+
--color-place-holder: var(--nypl-colors-ui-gray-dark);
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
@include
|
|
4
|
+
margin-bottom: var(--nypl-space-l);
|
|
5
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
6
|
+
margin-bottom: var(--nypl-space-xl);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&--full {
|
|
10
|
+
margin-bottom: var(--nypl-space-xxl);
|
|
11
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
12
|
+
margin-bottom: var(--nypl-space-xxxl);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
padding: var(--nypl-space-s);
|
|
6
17
|
|
|
7
18
|
align-items: center;
|
|
8
19
|
border: 4px dashed var(--color-place-holder);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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 * 1.5; // 24px or 1.5rem
|
|
6
|
+
* --nypl-space-l: --nypl-space * 2; // 32px or 2rem
|
|
7
|
+
* --nypl-space-xl: --nypl-space * 3; // 48px or 3rem
|
|
8
|
+
* --nypl-space-xxl: --nypl-space * 4; // 64px or 4rem
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
@mixin space-inline-none {
|
|
@@ -13,31 +13,31 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@mixin space-inline-xxs {
|
|
16
|
-
margin-right: var(--space-xxs);
|
|
16
|
+
margin-right: var(--nypl-space-xxs);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@mixin space-inline-xs {
|
|
20
|
-
margin-right: var(--space-xs);
|
|
20
|
+
margin-right: var(--nypl-space-xs);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@mixin space-inline-s {
|
|
24
|
-
margin-right: var(--space-s);
|
|
24
|
+
margin-right: var(--nypl-space-s);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
@mixin space-inline-m {
|
|
28
|
-
margin-right: var(--space-m);
|
|
28
|
+
margin-right: var(--nypl-space-m);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@mixin space-inline-l {
|
|
32
|
-
margin-right: var(--space-l);
|
|
32
|
+
margin-right: var(--nypl-space-l);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@mixin space-inline-xl {
|
|
36
|
-
margin-right: var(--space-xl);
|
|
36
|
+
margin-right: var(--nypl-space-xl);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
@mixin space-inline-xxl {
|
|
40
|
-
margin-right: var(--space-xxl);
|
|
40
|
+
margin-right: var(--nypl-space-xxl);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
@mixin get-space-inline($id) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* --nypl-space-xs: --nypl-space-s / 2 // 8px or 0.5rem
|
|
3
|
+
* --nypl-space-s: --nypl-space-s * 1; // 16px or 1rem
|
|
4
|
+
* --nypl-space-m: --nypl-space * 1.5; // 24px or 1.5rem
|
|
5
|
+
* --nypl-space-l: --nypl-space * 2; // 32px or 2rem
|
|
6
|
+
* --nypl-space-xl: --nypl-space * 3; // 48px or 3rem
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
@mixin space-inset-none {
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
@mixin space-inset-xs {
|
|
14
|
-
padding: var(--space-xs);
|
|
14
|
+
padding: var(--nypl-space-xs);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
@mixin space-inset-s {
|
|
18
|
-
padding: var(--space-s);
|
|
18
|
+
padding: var(--nypl-space-s);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
@mixin space-inset-m {
|
|
22
|
-
padding: var(--space-m);
|
|
22
|
+
padding: var(--nypl-space-m);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@mixin space-inset-l {
|
|
26
|
-
padding: var(--space-l);
|
|
26
|
+
padding: var(--nypl-space-l);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@mixin space-inset-xl {
|
|
30
|
-
padding: var(--space-xl);
|
|
30
|
+
padding: var(--nypl-space-xl);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
@mixin get-space-inset($id) {
|
|
@@ -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,60 +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
|
-
|
|
48
|
-
// Used in `Input.tsx`
|
|
49
|
-
.fieldset {
|
|
50
|
-
@include fieldset-reset;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.legend {
|
|
54
|
-
border: 0;
|
|
55
|
-
font-weight: 500;
|
|
56
|
-
}
|
|
19
|
+
@import "./styles/space/_space-inline";
|
|
20
|
+
@import "./styles/space/_space-inset";
|
|
21
|
+
@import "./styles/space/_space-stack";
|
|
57
22
|
|
|
58
|
-
//
|
|
23
|
+
// Legacy/deprecated components:
|
|
59
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
|
|
60
29
|
@import "./components/DatePicker/_DatePicker.scss";
|
|
61
30
|
@import "./components/Modal/_Modal.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,
|
|
@@ -29,7 +29,7 @@ const baseStyle = {
|
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
// Styles for different visual variants:
|
|
32
|
-
// primary, secondary, link, pill, iconOnly, callout
|
|
32
|
+
// primary, secondary, link, pill, iconOnly, callout, searchbar, noBrand
|
|
33
33
|
const primary = {
|
|
34
34
|
bg: "ui.link.primary",
|
|
35
35
|
minWidth: "none",
|
|
@@ -100,11 +100,18 @@ const searchBar = {
|
|
|
100
100
|
borderRightRadius: { base: "none", md: "sm" },
|
|
101
101
|
lineHeight: "1.75",
|
|
102
102
|
};
|
|
103
|
+
const noBrand = {
|
|
104
|
+
...primary,
|
|
105
|
+
bg: "ui.black",
|
|
106
|
+
color: "ui.white",
|
|
107
|
+
_hover: {
|
|
108
|
+
bg: "ui.gray.xdark",
|
|
109
|
+
},
|
|
110
|
+
};
|
|
103
111
|
|
|
104
112
|
const Button = {
|
|
105
113
|
baseStyle,
|
|
106
114
|
// Available variants:
|
|
107
|
-
// primary, secondary, link, pill, iconOnly, searchBar
|
|
108
115
|
variants: {
|
|
109
116
|
primary,
|
|
110
117
|
secondary,
|
|
@@ -113,6 +120,7 @@ const Button = {
|
|
|
113
120
|
iconOnly,
|
|
114
121
|
callout,
|
|
115
122
|
searchBar,
|
|
123
|
+
noBrand,
|
|
116
124
|
},
|
|
117
125
|
// Default values
|
|
118
126
|
defaultProps: {
|
|
@@ -9,21 +9,21 @@ const getBodyPaddingStyles = ({ border, hasImage, imageAtEnd, isRow }) => {
|
|
|
9
9
|
if (border) {
|
|
10
10
|
bodyPadding = "s";
|
|
11
11
|
if (hasImage) {
|
|
12
|
-
bodyPadding = "0 var(--space-s) var(--space-s)";
|
|
12
|
+
bodyPadding = "0 var(--nypl-space-s) var(--nypl-space-s)";
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
if (isRow && border) {
|
|
16
|
-
bodyPadding = "var(--space-s)";
|
|
16
|
+
bodyPadding = "var(--nypl-space-s)";
|
|
17
17
|
}
|
|
18
18
|
if (isRow && border && hasImage) {
|
|
19
19
|
bodyPadding = {
|
|
20
|
-
base: "0 var(--space-s) var(--space-s)",
|
|
21
|
-
md: "var(--space-s) var(--space-s) var(--space-s) 0",
|
|
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
22
|
};
|
|
23
23
|
if (imageAtEnd) {
|
|
24
24
|
bodyPadding = {
|
|
25
|
-
base: "var(--space-s) var(--space-s) 0",
|
|
26
|
-
md: "var(--space-s) 0 var(--space-s) var(--space-s)",
|
|
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
27
|
};
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -108,7 +108,7 @@ const CardActions = {
|
|
|
108
108
|
: {};
|
|
109
109
|
return {
|
|
110
110
|
marginBottom: "xs",
|
|
111
|
-
columnGap: "var(--space-xs)",
|
|
111
|
+
columnGap: "var(--nypl-space-xs)",
|
|
112
112
|
display: "flex",
|
|
113
113
|
_last: {
|
|
114
114
|
marginBottom: "0",
|
|
@@ -147,8 +147,10 @@ const CardImage = {
|
|
|
147
147
|
textAlign: "left",
|
|
148
148
|
alignItems: center ? "center" : null,
|
|
149
149
|
margin: {
|
|
150
|
-
base: imageAtEnd ? "var(--space-m) 0 0" : null,
|
|
151
|
-
md: imageAtEnd
|
|
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",
|
|
152
154
|
},
|
|
153
155
|
...size,
|
|
154
156
|
}
|
|
@@ -41,13 +41,13 @@ const List = {
|
|
|
41
41
|
borderTop: "3px solid",
|
|
42
42
|
borderColor: "section.research.primary",
|
|
43
43
|
margin: "0",
|
|
44
|
-
padding: "var(--space-xs) 0 0",
|
|
44
|
+
padding: "var(--nypl-space-xs) 0 0",
|
|
45
45
|
},
|
|
46
46
|
dl: {
|
|
47
47
|
display: "grid",
|
|
48
48
|
gridTemplateColumns: { base: "100%", md: "max(250px) 1fr" },
|
|
49
49
|
gridTemplateRows: "1fr",
|
|
50
|
-
margin: "var(--space-xs) 0 0",
|
|
50
|
+
margin: "var(--nypl-space-xs) 0 0",
|
|
51
51
|
},
|
|
52
52
|
dt: {
|
|
53
53
|
borderTop: "1px solid",
|
|
@@ -13,7 +13,7 @@ const Notification = {
|
|
|
13
13
|
bg,
|
|
14
14
|
display: "flex",
|
|
15
15
|
fontSize: "-1",
|
|
16
|
-
padding: "var(--space) var(--space-l)",
|
|
16
|
+
padding: "var(--nypl-space-s) var(--nypl-space-l)",
|
|
17
17
|
position: "relative",
|
|
18
18
|
textAlign: centered ? "center" : null,
|
|
19
19
|
borderRadius: noMargin ? "0" : "4px",
|
|
@@ -21,7 +21,7 @@ const Notification = {
|
|
|
21
21
|
container: {
|
|
22
22
|
margin: "auto",
|
|
23
23
|
width: "100%",
|
|
24
|
-
maxWidth: "var(--breakpoint-large)",
|
|
24
|
+
maxWidth: "var(--nypl-breakpoint-large)",
|
|
25
25
|
},
|
|
26
26
|
dismissibleButton: {
|
|
27
27
|
border: "none",
|
|
@@ -54,7 +54,9 @@ const NotificationContent = {
|
|
|
54
54
|
justifyContent: "center",
|
|
55
55
|
content: {
|
|
56
56
|
width: "100%",
|
|
57
|
-
paddingLeft: alignText
|
|
57
|
+
paddingLeft: alignText
|
|
58
|
+
? "calc(var(--nypl-space-m) + var(--nypl-space-s))"
|
|
59
|
+
: null,
|
|
58
60
|
color:
|
|
59
61
|
notificationType === NotificationTypes.Warning
|
|
60
62
|
? "brand.primary"
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ProgressIndicatorSizes } from "../../components/ProgressIndicator/ProgressIndicatorTypes";
|
|
2
|
+
|
|
3
|
+
const ProgressIndicator = {
|
|
4
|
+
parts: [
|
|
5
|
+
"circular",
|
|
6
|
+
"circularLabel",
|
|
7
|
+
"linear",
|
|
8
|
+
"linearContainer",
|
|
9
|
+
"linearPercentage",
|
|
10
|
+
],
|
|
11
|
+
baseStyle: ({ darkMode, size }) => {
|
|
12
|
+
return {
|
|
13
|
+
color: darkMode ? "ui.white" : "ui.black",
|
|
14
|
+
circular: {
|
|
15
|
+
// Note: we have to target the SVG HTMl elements in order
|
|
16
|
+
// to override the default styles.
|
|
17
|
+
svg: {
|
|
18
|
+
height: size === ProgressIndicatorSizes.Small ? "24px" : "48px",
|
|
19
|
+
width: size === ProgressIndicatorSizes.Small ? "24px" : "48px",
|
|
20
|
+
display: "block",
|
|
21
|
+
circle: {
|
|
22
|
+
_first: {
|
|
23
|
+
stroke: darkMode ? "ui.gray.dark" : "ui.gray.light-cool",
|
|
24
|
+
},
|
|
25
|
+
_last: {
|
|
26
|
+
stroke: darkMode ? "ui.white" : "ui.link.primary",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
circularContainer: {
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
width: "fit-content",
|
|
36
|
+
},
|
|
37
|
+
linear: {
|
|
38
|
+
// Hard to target this specific element without using
|
|
39
|
+
// "Progress" as the key name in index.ts
|
|
40
|
+
"> div": {
|
|
41
|
+
bg: darkMode ? "ui.white" : "ui.link.primary",
|
|
42
|
+
},
|
|
43
|
+
flex: 25,
|
|
44
|
+
bg: darkMode ? "ui.gray.dark" : "ui.gray.light-cool",
|
|
45
|
+
height: {
|
|
46
|
+
base: "4px",
|
|
47
|
+
md: size === ProgressIndicatorSizes.Small ? "4px" : "8px",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
linearContainer: {
|
|
51
|
+
display: "flex",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
},
|
|
54
|
+
linearPercentage: {
|
|
55
|
+
padding: "0 var(--nypl-space-xs)",
|
|
56
|
+
flex: 1,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default ProgressIndicator;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Margins around the static display values.
|
|
2
|
+
const staticValues = {
|
|
3
|
+
marginTop: "xs",
|
|
4
|
+
marginBottom: "xs",
|
|
5
|
+
marginRight: "s",
|
|
6
|
+
marginLeft: "s",
|
|
7
|
+
};
|
|
8
|
+
const CustomSlider = {
|
|
9
|
+
parts: [
|
|
10
|
+
"container",
|
|
11
|
+
"helper",
|
|
12
|
+
"leftValue",
|
|
13
|
+
"rightValue",
|
|
14
|
+
"textInput",
|
|
15
|
+
"filledTrack",
|
|
16
|
+
"track",
|
|
17
|
+
"thumb",
|
|
18
|
+
],
|
|
19
|
+
baseStyle: ({ isDisabled, isInvalid, isRangeSlider, showBoxes }) => {
|
|
20
|
+
let baseColor = "ui.link.primary";
|
|
21
|
+
if (isInvalid) {
|
|
22
|
+
baseColor = "ui.error.primary";
|
|
23
|
+
} else if (isDisabled) {
|
|
24
|
+
baseColor = "ui.gray.light-cool";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
container: {
|
|
29
|
+
display: "flex",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
},
|
|
32
|
+
helper: {
|
|
33
|
+
marginTop: "xs",
|
|
34
|
+
},
|
|
35
|
+
leftValue: {
|
|
36
|
+
...staticValues,
|
|
37
|
+
// If the text input boxes are shown, then there already is a
|
|
38
|
+
// margin, so we can set this static value to "0". But for the
|
|
39
|
+
// single Slider, we *do* need the margin set.
|
|
40
|
+
marginLeft: showBoxes && isRangeSlider ? "0" : "s",
|
|
41
|
+
},
|
|
42
|
+
rightValue: {
|
|
43
|
+
...staticValues,
|
|
44
|
+
// If the text input boxes are shown, then there already is
|
|
45
|
+
// a margin, so we can set this static value to "0".
|
|
46
|
+
marginRight: showBoxes ? "0" : "s",
|
|
47
|
+
},
|
|
48
|
+
textInput: {
|
|
49
|
+
// Allows for three or more digits present in the
|
|
50
|
+
// min or max value text input.
|
|
51
|
+
minWidth: "65px",
|
|
52
|
+
color: isInvalid ? "ui.error.primary" : "ui.black",
|
|
53
|
+
},
|
|
54
|
+
// Filled track doesn't have a _disabled or _invalid state...
|
|
55
|
+
// so we manually do it through the props.
|
|
56
|
+
filledTrack: {
|
|
57
|
+
bgColor: baseColor,
|
|
58
|
+
},
|
|
59
|
+
track: {
|
|
60
|
+
bgColor: "ui.gray.light-cool",
|
|
61
|
+
_disabled: {
|
|
62
|
+
bgColor: "ui.gray.light-cool",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
thumb: {
|
|
66
|
+
border: "1px solid",
|
|
67
|
+
// Thumb doesn't have an _invalid state...
|
|
68
|
+
// so we manually do it through the props.
|
|
69
|
+
borderColor: baseColor,
|
|
70
|
+
boxShadow: "none",
|
|
71
|
+
_active: {
|
|
72
|
+
transform: "translateY(-50%) scale(1.0)",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default CustomSlider;
|