@nypl/design-system-react-components 0.25.3 → 0.25.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +47 -11
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
  4. package/dist/components/Button/Button.d.ts +9 -6
  5. package/dist/components/Button/ButtonTypes.d.ts +2 -1
  6. package/dist/components/Card/Card.d.ts +0 -25
  7. package/dist/components/Icons/IconSvgs.d.ts +3 -0
  8. package/dist/components/Icons/IconTypes.d.ts +3 -0
  9. package/dist/components/Notification/Notification.d.ts +6 -4
  10. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
  11. package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
  12. package/dist/components/SearchBar/SearchBar.d.ts +3 -3
  13. package/dist/components/Slider/Slider.d.ts +57 -0
  14. package/dist/components/Tabs/Tabs.d.ts +1 -1
  15. package/dist/components/TextInput/TextInput.d.ts +6 -0
  16. package/dist/design-system-react-components.cjs.development.js +707 -454
  17. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  18. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  19. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  20. package/dist/design-system-react-components.esm.js +700 -441
  21. package/dist/design-system-react-components.esm.js.map +1 -1
  22. package/dist/index.d.ts +6 -3
  23. package/dist/resources.scss +180 -170
  24. package/dist/styles.css +1 -1
  25. package/dist/theme/components/button.d.ts +10 -0
  26. package/dist/theme/components/progressIndicator.d.ts +50 -0
  27. package/dist/theme/components/slider.d.ts +51 -0
  28. package/dist/theme/foundations/breakpoints.d.ts +8 -8
  29. package/dist/theme/foundations/global.d.ts +6 -1
  30. package/package.json +72 -84
  31. package/src/__tests__/setup.ts +2 -2
  32. package/src/components/Accordion/Accordion.stories.mdx +30 -34
  33. package/src/components/Autosuggest/Autosuggest.stories.mdx +3 -3
  34. package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -0
  35. package/src/components/Autosuggest/_Autosuggest.scss +5 -5
  36. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +5 -6
  37. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +23 -0
  38. package/src/components/Breadcrumbs/Breadcrumbs.tsx +5 -1
  39. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +198 -1
  40. package/src/components/Button/Button.stories.mdx +8 -6
  41. package/src/components/Button/Button.test.tsx +20 -0
  42. package/src/components/Button/Button.tsx +14 -23
  43. package/src/components/Button/ButtonTypes.tsx +1 -0
  44. package/src/components/Button/__snapshots__/Button.test.tsx.snap +29 -4
  45. package/src/components/Card/Card.stories.mdx +1 -1
  46. package/src/components/Card/Card.tsx +3 -3
  47. package/src/components/CardEdition/CardEdition.stories.tsx +15 -47
  48. package/src/components/CardEdition/_CardEdition.scss +22 -23
  49. package/src/components/Chakra/Box.stories.mdx +14 -15
  50. package/src/components/Chakra/Center.stories.mdx +15 -8
  51. package/src/components/Chakra/Grid.stories.mdx +16 -7
  52. package/src/components/Chakra/Stack.stories.mdx +35 -18
  53. package/src/components/DatePicker/DatePicker.test.tsx +31 -30
  54. package/src/components/DatePicker/DatePicker.tsx +7 -4
  55. package/src/components/DatePicker/_DatePicker.scss +4 -4
  56. package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +19 -5
  57. package/src/components/Form/Form.stories.mdx +4 -5
  58. package/src/components/Grid/SimpleGrid.stories.mdx +1 -0
  59. package/src/components/Hero/HeroTypes.tsx +1 -0
  60. package/src/components/HorizontalRule/HorizontalRule.stories.mdx +2 -3
  61. package/src/components/Icons/Icon.stories.mdx +2 -3
  62. package/src/components/Icons/IconSvgs.tsx +6 -0
  63. package/src/components/Icons/IconTypes.tsx +3 -0
  64. package/src/components/Image/Image.stories.mdx +2 -3
  65. package/src/components/Input/Input.stories.tsx +20 -64
  66. package/src/components/Input/_Input.scss +23 -14
  67. package/src/components/Modal/Modal.stories.mdx +3 -3
  68. package/src/components/Modal/_Modal.scss +2 -2
  69. package/src/components/Notification/Notification.stories.mdx +1 -1
  70. package/src/components/Notification/Notification.tsx +13 -4
  71. package/src/components/Pagination/Pagination.stories.mdx +3 -2
  72. package/src/components/Pagination/Pagination.stories.tsx +1 -2
  73. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +292 -0
  74. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +225 -0
  75. package/src/components/ProgressIndicator/ProgressIndicator.tsx +126 -0
  76. package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +8 -0
  77. package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +357 -0
  78. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +3 -0
  79. package/src/components/RadioGroup/RadioGroup.stories.mdx +2 -3
  80. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +4 -0
  81. package/src/components/SearchBar/SearchBar.Test.tsx +2 -1
  82. package/src/components/SearchBar/SearchBar.stories.mdx +109 -9
  83. package/src/components/SearchBar/SearchBar.tsx +11 -4
  84. package/src/components/Select/SelectTypes.tsx +1 -0
  85. package/src/components/Slider/Slider.stories.mdx +529 -0
  86. package/src/components/Slider/Slider.test.tsx +653 -0
  87. package/src/components/Slider/Slider.tsx +303 -0
  88. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +1946 -0
  89. package/src/components/StyleGuide/Bidirectionality.stories.mdx +1 -1
  90. package/src/components/StyleGuide/Breakpoints.stories.mdx +21 -7
  91. package/src/components/StyleGuide/Buttons.stories.mdx +9 -2
  92. package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
  93. package/src/components/Tabs/Tabs.tsx +5 -5
  94. package/src/components/Template/Template.stories.mdx +6 -6
  95. package/src/components/TextInput/TextInput.stories.mdx +1 -1
  96. package/src/components/TextInput/TextInput.tsx +15 -2
  97. package/src/components/TextInput/TextInputTypes.tsx +2 -0
  98. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -3
  99. package/src/docs/Chakra.stories.mdx +2 -2
  100. package/src/index.ts +10 -6
  101. package/src/resources.scss +5 -5
  102. package/src/styles/base/{_02-breakpoints.scss → _01-breakpoints.scss} +9 -10
  103. package/src/styles/base/{_03-mixins.scss → _02-mixins.scss} +16 -5
  104. package/src/styles/base/{_04-base.scss → _03-base.scss} +7 -2
  105. package/src/styles/base/{_05-focus.scss → _04-focus.scss} +0 -15
  106. package/src/styles/base/_place-holder.scss +14 -3
  107. package/src/styles/{03-space → space}/_space-inline.scss +14 -14
  108. package/src/styles/{03-space → space}/_space-inset.scss +10 -10
  109. package/src/styles/space/_space-stack.scss +116 -0
  110. package/src/styles.scss +13 -44
  111. package/src/theme/components/button.ts +10 -2
  112. package/src/theme/components/card.ts +11 -9
  113. package/src/theme/components/datePicker.ts +1 -1
  114. package/src/theme/components/list.ts +2 -2
  115. package/src/theme/components/notification.ts +5 -3
  116. package/src/theme/components/progressIndicator.ts +62 -0
  117. package/src/theme/components/skeletonLoader.ts +1 -1
  118. package/src/theme/components/slider.ts +79 -0
  119. package/src/theme/foundations/breakpoints.ts +8 -8
  120. package/src/theme/foundations/global.ts +6 -1
  121. package/src/theme/index.ts +4 -0
  122. package/src/utils/componentCategories.ts +3 -3
  123. package/src/styles/01-colors/_colors-brand.scss +0 -62
  124. package/src/styles/01-colors/_colors-utility.scss +0 -67
  125. package/src/styles/02-typography/_type-scale.css +0 -11
  126. package/src/styles/02-typography/_type-weight.css +0 -7
  127. package/src/styles/02-typography/_typefaces.css +0 -4
  128. package/src/styles/03-space/_space-stack.scss +0 -116
  129. package/src/styles/03-space/_space.css +0 -30
  130. package/src/styles/base/_card-grid.scss +0 -77
  131. 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(--typeface-body);
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-light-cool);
2
+ --color-place-holder: var(--nypl-colors-ui-gray-dark);
3
3
 
4
- @include space-stack-page;
5
- @include space-inset-s;
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
- * $space-xxs: $space / 4; // 4px
3
- * $space-xs: $space / 2; // 8px
4
- * $space-s: $space * 1; // 16px
5
- * $space-m: $space * 1.5; // 24px
6
- * $space-l: $space * 2; // 32px
7
- * $space-xl: $space * 3; // 48px
8
- * $space-xxl: $space * 4; // 64px
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
- * $space-xs: $space / 2; // 8px
3
- * $space-s: $space * 1; // 16px
4
- * $space-m: $space * 1.5; // 24px
5
- * $space-l: $space * 2; // 32px
6
- * $space-xl: $space * 3; // 48px
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/01-colors/_colors-brand";
30
- @import "./styles/01-colors/_colors-utility";
31
- @import "./styles/02-typography/_type-scale";
32
- @import "./styles/02-typography/_type-weight";
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/base/_typography";
45
- @import "./components/Input/_Input.scss";
46
- @import "./components/Autosuggest/_Autosuggest.scss";
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
- // Order not important
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";
@@ -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 ? "0 0 0 var(--space-m)" : "0 var(--space-m) 0 0",
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
  }
@@ -8,7 +8,7 @@ const DatePicker = {
8
8
  subLabels: {
9
9
  label: {
10
10
  fontSize: "12px",
11
- marginBottom: "xs",
11
+ marginBottom: "0",
12
12
  },
13
13
  },
14
14
  },
@@ -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 ? "calc(var(--space-m) + var(--space-s))" : null,
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;
@@ -92,7 +92,7 @@ const SkeletonLoader = {
92
92
  const fade = () =>
93
93
  keyframes({
94
94
  from: { opacity: 0.9 },
95
- ["50%"]: { opacity: 0.7 },
95
+ "50%": { opacity: 0.7 },
96
96
  to: { opacity: 0.9 },
97
97
  });
98
98
  // Overriding Chakra's Skeleton animation.
@@ -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;
@@ -1,16 +1,16 @@
1
1
  import { createBreakpoints } from "@chakra-ui/theme-tools";
2
2
 
3
3
  /**
4
- * Breakpoints from "src/styles/base/_02-breakpoints.scss"
4
+ * Breakpoints from "src/styles/base/_01-breakpoints.scss"
5
5
  * How to use Chakra responsive styles: https://chakra-ui.com/docs/features/responsive-styles
6
6
  *
7
- * Chakra Value | DS Variable | EM/PX value
8
- * --------------------------------------------------
9
- * sm | --breakpoint-small | 20em/320px
10
- * md | --breakpoint-medium | 38em/600px
11
- * lg | --breakpoint-large | 60em/960px
12
- * xl | --breakpoint-xl | 80em/1280px
13
- * 2xl | N/A | 96em/1536px
7
+ * Chakra Value | DS Variable | EM/PX value
8
+ * ------------------------------------------------------
9
+ * sm | --nypl-breakpoint-small | 20em/320px
10
+ * md | --nypl-breakpoint-medium | 38em/600px
11
+ * lg | --nypl-breakpoint-large | 60em/960px
12
+ * xl | --nypl-breakpoint-xl | 80em/1280px
13
+ * 2xl | N/A | 96em/1536px
14
14
  *
15
15
  * @Note Chakra provides a 2xl option while the DS does not. We don't
16
16
  * recommend using this value until further notice.