@nypl/design-system-react-components 0.25.0 → 0.25.1

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 (236) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/components/Accordion/Accordion.d.ts +14 -14
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -14
  4. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
  5. package/dist/components/Button/ButtonTypes.d.ts +2 -1
  6. package/dist/components/Card/Card.d.ts +1 -1
  7. package/dist/components/Card/CardTypes.d.ts +2 -2
  8. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +43 -0
  9. package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +4 -0
  10. package/dist/components/DatePicker/DatePicker.d.ts +3 -3
  11. package/dist/components/Form/Form.d.ts +13 -8
  12. package/dist/components/Form/FormTypes.d.ts +2 -8
  13. package/dist/components/Grid/GridTypes.d.ts +9 -0
  14. package/dist/components/Grid/SimpleGrid.d.ts +14 -0
  15. package/dist/components/Heading/Heading.d.ts +4 -4
  16. package/dist/components/Hero/Hero.d.ts +19 -14
  17. package/dist/components/Hero/HeroTypes.d.ts +10 -5
  18. package/dist/components/Icons/Icon.d.ts +13 -16
  19. package/dist/components/Icons/IconTypes.d.ts +78 -64
  20. package/dist/components/Label/Label.d.ts +5 -17
  21. package/dist/components/Link/Link.d.ts +8 -12
  22. package/dist/components/SearchBar/SearchBar.d.ts +45 -27
  23. package/dist/components/Select/Select.d.ts +32 -35
  24. package/dist/components/Select/SelectTypes.d.ts +4 -0
  25. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +1 -1
  26. package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +2 -2
  27. package/dist/components/StatusBadge/StatusBadge.d.ts +8 -6
  28. package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +5 -0
  29. package/dist/components/Template/Template.d.ts +91 -0
  30. package/dist/components/Text/Text.d.ts +16 -0
  31. package/dist/components/Text/TextTypes.d.ts +6 -0
  32. package/dist/components/TextInput/TextInput.d.ts +32 -31
  33. package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
  34. package/dist/design-system-react-components.cjs.development.js +2597 -1170
  35. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  36. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  37. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  38. package/dist/design-system-react-components.esm.js +2580 -1173
  39. package/dist/design-system-react-components.esm.js.map +1 -1
  40. package/dist/index.d.ts +8 -1
  41. package/dist/styles.css +1 -1
  42. package/dist/theme/components/accordion.d.ts +25 -0
  43. package/dist/theme/components/breadcrumb.d.ts +90 -0
  44. package/dist/theme/components/button.d.ts +17 -7
  45. package/dist/theme/components/checkbox.d.ts +7 -7
  46. package/dist/theme/components/customCheckboxGroup.d.ts +18 -0
  47. package/dist/theme/components/customRadioGroup.d.ts +4 -3
  48. package/dist/theme/components/global.d.ts +55 -0
  49. package/dist/theme/components/globalMixins.d.ts +15 -0
  50. package/dist/theme/components/heading.d.ts +50 -20
  51. package/dist/theme/components/hero.d.ts +492 -0
  52. package/dist/theme/components/icon.d.ts +13 -0
  53. package/dist/theme/components/label.d.ts +16 -0
  54. package/dist/theme/components/link.d.ts +45 -0
  55. package/dist/theme/components/radio.d.ts +8 -7
  56. package/dist/theme/components/searchBar.d.ts +20 -0
  57. package/dist/theme/components/select.d.ts +58 -0
  58. package/dist/theme/components/statusBadge.d.ts +25 -0
  59. package/dist/theme/components/tabs.d.ts +9 -9
  60. package/dist/theme/components/template.d.ts +105 -0
  61. package/dist/theme/components/text.d.ts +20 -0
  62. package/dist/theme/components/textInput.d.ts +105 -0
  63. package/dist/theme/foundations/global.d.ts +3 -0
  64. package/dist/theme/foundations/shadows.d.ts +4 -0
  65. package/dist/utils/utils.d.ts +6 -0
  66. package/package.json +3 -2
  67. package/src/components/Accordion/Accordion.stories.mdx +227 -33
  68. package/src/components/Accordion/Accordion.test.tsx +135 -19
  69. package/src/components/Accordion/Accordion.tsx +81 -56
  70. package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
  71. package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -1
  72. package/src/components/Autosuggest/_Autosuggest.scss +2 -2
  73. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +46 -52
  74. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +31 -25
  75. package/src/components/Breadcrumbs/Breadcrumbs.tsx +71 -73
  76. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +6 -0
  77. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +100 -0
  78. package/src/components/Button/Button.stories.mdx +31 -27
  79. package/src/components/Button/Button.test.tsx +17 -5
  80. package/src/components/Button/ButtonTypes.tsx +1 -0
  81. package/src/components/Button/_Button.scss +3 -27
  82. package/src/components/Button/__snapshots__/Button.test.tsx.snap +11 -0
  83. package/src/components/Card/Card.stories.mdx +24 -20
  84. package/src/components/Card/Card.test.tsx +13 -19
  85. package/src/components/Card/Card.tsx +1 -1
  86. package/src/components/Card/CardTypes.tsx +2 -2
  87. package/src/components/Card/_Card.scss +1 -1
  88. package/src/components/CardEdition/CardEdition.stories.tsx +11 -6
  89. package/src/components/CardEdition/CardEdition.test.tsx +23 -31
  90. package/src/components/CardEdition/_CardEdition.scss +2 -2
  91. package/src/components/Chakra/Center.stories.mdx +31 -14
  92. package/src/components/Chakra/Grid.stories.mdx +79 -0
  93. package/src/components/Chakra/Stack.stories.mdx +4 -4
  94. package/src/components/Checkbox/Checkbox.tsx +9 -12
  95. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +2 -5
  96. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +249 -0
  97. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +345 -0
  98. package/src/components/CheckboxGroup/CheckboxGroup.tsx +148 -0
  99. package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +4 -0
  100. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1360 -0
  101. package/src/components/DatePicker/DatePicker.test.tsx +4 -4
  102. package/src/components/DatePicker/DatePicker.tsx +13 -13
  103. package/src/components/DatePicker/_DatePicker.scss +1 -0
  104. package/src/components/Form/Form.stories.mdx +46 -21
  105. package/src/components/Form/Form.test.tsx +58 -45
  106. package/src/components/Form/Form.tsx +49 -21
  107. package/src/components/Form/FormTypes.tsx +3 -8
  108. package/src/components/Form/__snapshots__/Form.test.tsx.snap +24 -14
  109. package/src/components/Grid/GridTypes.tsx +9 -0
  110. package/src/components/Grid/SimpleGrid.stories.mdx +275 -0
  111. package/src/components/Grid/SimpleGrid.test.tsx +66 -0
  112. package/src/components/Grid/SimpleGrid.tsx +37 -0
  113. package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +8 -0
  114. package/src/components/Heading/Heading.stories.mdx +1 -0
  115. package/src/components/Heading/Heading.tsx +12 -6
  116. package/src/components/HelperErrorText/_HelperErrorText.scss +1 -1
  117. package/src/components/Hero/Hero.stories.mdx +188 -121
  118. package/src/components/Hero/Hero.test.tsx +537 -107
  119. package/src/components/Hero/Hero.tsx +79 -92
  120. package/src/components/Hero/HeroTypes.tsx +17 -5
  121. package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
  122. package/src/components/HorizontalRule/_HorizontalRule.scss +1 -1
  123. package/src/components/Icons/Icon.stories.mdx +83 -74
  124. package/src/components/Icons/Icon.test.tsx +30 -22
  125. package/src/components/Icons/Icon.tsx +63 -61
  126. package/src/components/Icons/IconTypes.tsx +80 -64
  127. package/src/components/Input/_Input.scss +2 -2
  128. package/src/components/Label/Label.stories.mdx +28 -7
  129. package/src/components/Label/Label.test.tsx +43 -12
  130. package/src/components/Label/Label.tsx +21 -34
  131. package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
  132. package/src/components/Link/Link.stories.mdx +41 -41
  133. package/src/components/Link/Link.test.tsx +33 -44
  134. package/src/components/Link/Link.tsx +114 -100
  135. package/src/components/List/List.stories.mdx +0 -2
  136. package/src/components/List/List.stories.tsx +5 -5
  137. package/src/components/List/_List.scss +3 -3
  138. package/src/components/Modal/_Modal.scss +1 -1
  139. package/src/components/Notification/Notification.stories.mdx +12 -1
  140. package/src/components/Notification/Notification.test.tsx +3 -16
  141. package/src/components/Notification/Notification.tsx +9 -10
  142. package/src/components/Notification/_Notification.scss +4 -4
  143. package/src/components/Pagination/Pagination.test.tsx +16 -10
  144. package/src/components/RadioGroup/RadioGroup.stories.mdx +1 -1
  145. package/src/components/RadioGroup/RadioGroup.tsx +2 -10
  146. package/src/components/SearchBar/SearchBar.Test.tsx +151 -16
  147. package/src/components/SearchBar/SearchBar.stories.mdx +189 -219
  148. package/src/components/SearchBar/SearchBar.tsx +151 -46
  149. package/src/components/Select/Select.stories.mdx +188 -170
  150. package/src/components/Select/Select.test.tsx +125 -380
  151. package/src/components/Select/Select.tsx +118 -165
  152. package/src/components/Select/SelectTypes.tsx +4 -0
  153. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +13 -25
  154. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -7
  155. package/src/components/SkeletonLoader/SkeletonLoader.tsx +4 -2
  156. package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +2 -2
  157. package/src/components/SkeletonLoader/_SkeletonLoader.scss +3 -3
  158. package/src/components/StatusBadge/StatusBadge.stories.mdx +91 -0
  159. package/src/components/StatusBadge/StatusBadge.test.tsx +35 -7
  160. package/src/components/StatusBadge/StatusBadge.tsx +24 -25
  161. package/src/components/StatusBadge/StatusBadgeTypes.tsx +5 -0
  162. package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +28 -0
  163. package/src/components/StyleGuide/Bidirectionality.stories.mdx +16 -16
  164. package/src/components/StyleGuide/Buttons.stories.mdx +15 -15
  165. package/src/components/StyleGuide/Colors.stories.mdx +336 -0
  166. package/src/components/StyleGuide/Iconography.stories.mdx +88 -90
  167. package/src/components/StyleGuide/UIDocCard.tsx +1 -1
  168. package/src/components/Tabs/Tabs.tsx +7 -9
  169. package/src/components/Template/Template.stories.mdx +574 -0
  170. package/src/components/Template/Template.test.tsx +124 -0
  171. package/src/components/Template/Template.tsx +226 -0
  172. package/src/components/Text/Text.stories.mdx +70 -0
  173. package/src/components/Text/Text.test.tsx +63 -0
  174. package/src/components/Text/Text.tsx +55 -0
  175. package/src/components/Text/TextTypes.tsx +6 -0
  176. package/src/components/Text/__snapshots__/Text.test.tsx.snap +33 -0
  177. package/src/components/TextInput/TextInput.stories.mdx +89 -90
  178. package/src/components/TextInput/TextInput.test.tsx +65 -86
  179. package/src/components/TextInput/TextInput.tsx +101 -95
  180. package/src/components/TextInput/TextInputTypes.tsx +6 -0
  181. package/src/components/VideoPlayer/_VideoPlayer.scss +1 -1
  182. package/src/docs/Chakra.stories.mdx +4 -4
  183. package/src/docs/Intro.stories.mdx +15 -13
  184. package/src/index.ts +20 -0
  185. package/src/styles/01-colors/_colors-brand.scss +6 -0
  186. package/src/styles/01-colors/_colors-utility.scss +14 -12
  187. package/src/styles/base/_04-base.scss +2 -1
  188. package/src/styles/base/_place-holder.scss +1 -1
  189. package/src/styles.scss +10 -12
  190. package/src/theme/components/accordion.ts +30 -0
  191. package/src/theme/components/breadcrumb.ts +77 -0
  192. package/src/theme/components/button.ts +77 -63
  193. package/src/theme/components/checkbox.ts +15 -27
  194. package/src/theme/components/customCheckboxGroup.ts +12 -0
  195. package/src/theme/components/customRadioGroup.ts +4 -10
  196. package/src/theme/components/global.ts +71 -0
  197. package/src/theme/components/globalMixins.ts +16 -0
  198. package/src/theme/components/heading.ts +15 -8
  199. package/src/theme/components/hero.ts +239 -0
  200. package/src/theme/components/icon.ts +79 -0
  201. package/src/theme/components/label.ts +17 -0
  202. package/src/theme/components/link.ts +47 -0
  203. package/src/theme/components/radio.ts +20 -31
  204. package/src/theme/components/searchBar.ts +21 -0
  205. package/src/theme/components/select.ts +50 -0
  206. package/src/theme/components/statusBadge.ts +27 -0
  207. package/src/theme/components/tabs.ts +72 -69
  208. package/src/theme/components/template.ts +114 -0
  209. package/src/theme/components/text.ts +31 -0
  210. package/src/theme/components/textInput.ts +61 -0
  211. package/src/theme/foundations/colors.ts +29 -13
  212. package/src/theme/foundations/global.ts +3 -0
  213. package/src/theme/foundations/shadows.ts +5 -0
  214. package/src/theme/index.ts +37 -7
  215. package/src/utils/componentCategories.ts +8 -2
  216. package/src/utils/utils.ts +13 -0
  217. package/dist/components/Accordion/Accordion.stories.d.ts +0 -6
  218. package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
  219. package/dist/components/StyleGuide/Colors.stories.d.ts +0 -25
  220. package/dist/components/Template/Template.stories.d.ts +0 -30
  221. package/src/components/Accordion/Accordion.stories.tsx +0 -66
  222. package/src/components/Accordion/_Accordion.scss +0 -81
  223. package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
  224. package/src/components/Form/_Form.scss +0 -67
  225. package/src/components/Hero/_Hero.scss +0 -256
  226. package/src/components/Icons/_Icons.scss +0 -116
  227. package/src/components/Label/_Label.scss +0 -22
  228. package/src/components/Link/_Link.scss +0 -73
  229. package/src/components/SearchBar/_SearchBar.scss +0 -16
  230. package/src/components/Select/_Select.scss +0 -82
  231. package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -34
  232. package/src/components/StatusBadge/_StatusBadge.scss +0 -23
  233. package/src/components/StyleGuide/Colors.stories.tsx +0 -289
  234. package/src/components/Template/Template.stories.tsx +0 -86
  235. package/src/components/Template/_Template.scss +0 -63
  236. package/src/components/TextInput/_TextInput.scss +0 -59
@@ -10,7 +10,12 @@ import { withDesign } from "storybook-addon-designs";
10
10
  import Button, { ButtonGroup } from "./Button";
11
11
  import { ButtonTypes } from "./ButtonTypes";
12
12
  import Icon from "../Icons/Icon";
13
- import { IconNames, IconRotationTypes } from "../Icons/IconTypes";
13
+ import {
14
+ IconNames,
15
+ IconRotationTypes,
16
+ IconAlign,
17
+ IconSizes,
18
+ } from "../Icons/IconTypes";
14
19
  import getCSSVariable from "../../helpers/getCSSVariable";
15
20
  import { getCategory } from "../../utils/componentCategories";
16
21
  import DSProvider from "../../theme/provider";
@@ -83,7 +88,7 @@ Controls for this Story section to preview a `Button` with the selected icon.
83
88
  args={{
84
89
  displayLeft: true,
85
90
  buttonText: "Button Text",
86
- iconType: IconNames.search,
91
+ iconType: IconNames.Search,
87
92
  }}
88
93
  argTypes={{
89
94
  iconType: {
@@ -99,16 +104,16 @@ Controls for this Story section to preview a `Button` with the selected icon.
99
104
  {args.displayLeft && (
100
105
  <Icon
101
106
  name={args.iconType}
102
- decorative={true}
103
- modifiers={["small", "icon-left"]}
107
+ align={IconAlign.Left}
108
+ size={IconSizes.Small}
104
109
  />
105
110
  )}
106
111
  {args.buttonText}
107
112
  {!args.displayLeft && (
108
113
  <Icon
109
114
  name={args.iconType}
110
- decorative={true}
111
- modifiers={["small", "icon-right"]}
115
+ align={IconAlign.Right}
116
+ size={IconSizes.Small}
112
117
  />
113
118
  )}
114
119
  </Button>
@@ -123,20 +128,20 @@ The icon can be placed to the left or the right of the button text.
123
128
  <ButtonGroup>
124
129
  <Button buttonType={ButtonTypes.Secondary}>
125
130
  <Icon
126
- name={IconNames.arrow}
127
- decorative={true}
128
- iconRotation={IconRotationTypes.rotate90}
129
- modifiers={["small", "icon-left"]}
131
+ name={IconNames.Arrow}
132
+ iconRotation={IconRotationTypes.Rotate90}
133
+ align={IconAlign.Left}
134
+ size={IconSizes.Small}
130
135
  />
131
136
  Previous
132
137
  </Button>
133
138
  <Button buttonType={ButtonTypes.Secondary}>
134
139
  Next
135
140
  <Icon
136
- name={IconNames.arrow}
137
- decorative={true}
138
- iconRotation={IconRotationTypes.rotate270}
139
- modifiers={["small", "icon-right"]}
141
+ name={IconNames.Arrow}
142
+ iconRotation={IconRotationTypes.Rotate270}
143
+ align={IconAlign.Right}
144
+ size={IconSizes.Small}
140
145
  />
141
146
  </Button>
142
147
  </ButtonGroup>
@@ -157,10 +162,9 @@ is an `aria-label` passed to the `Button` component through the `attributes` pro
157
162
  }}
158
163
  >
159
164
  <Icon
160
- name={IconNames.arrow}
161
- decorative={true}
162
- iconRotation={IconRotationTypes.rotate90}
163
- modifiers={["small"]}
165
+ name={IconNames.Arrow}
166
+ iconRotation={IconRotationTypes.Rotate90}
167
+ size={IconSizes.Small}
164
168
  />
165
169
  </Button>
166
170
  <Button
@@ -170,10 +174,9 @@ is an `aria-label` passed to the `Button` component through the `attributes` pro
170
174
  }}
171
175
  >
172
176
  <Icon
173
- name={IconNames.arrow}
174
- decorative={true}
175
- iconRotation={IconRotationTypes.rotate270}
176
- modifiers={["small"]}
177
+ name={IconNames.Arrow}
178
+ iconRotation={IconRotationTypes.Rotate270}
179
+ size={IconSizes.Small}
177
180
  />
178
181
  </Button>
179
182
  <Button
@@ -182,7 +185,7 @@ is an `aria-label` passed to the `Button` component through the `attributes` pro
182
185
  "aria-label": "Close",
183
186
  }}
184
187
  >
185
- <Icon name={IconNames.close} decorative={true} modifiers={["small"]} />
188
+ <Icon name={IconNames.Close} size={IconSizes.Small} />
186
189
  </Button>
187
190
  </ButtonGroup>
188
191
  </DSProvider>
@@ -201,10 +204,11 @@ must include an up arrow icon on the right side.
201
204
  <Button buttonType={ButtonTypes.Secondary}>
202
205
  Back to Top
203
206
  <Icon
204
- name={IconNames.arrow}
205
- decorative={true}
206
- iconRotation={IconRotationTypes.rotate180}
207
- modifiers={["small", "icon-right"]}
207
+ name={IconNames.Arrow}
208
+ iconRotation={IconRotationTypes.Rotate180}
209
+ size={IconSizes.Small}
210
+ className="right"
211
+ align={IconAlign.Right}
208
212
  />
209
213
  </Button>
210
214
  </ButtonGroup>
@@ -6,7 +6,7 @@ import renderer from "react-test-renderer";
6
6
 
7
7
  import Button from "./Button";
8
8
  import Icon from "../Icons/Icon";
9
- import { IconNames } from "../Icons/IconTypes";
9
+ import { IconAlign, IconNames, IconSizes } from "../Icons/IconTypes";
10
10
  import { ButtonTypes } from "./ButtonTypes";
11
11
 
12
12
  describe("Button Accessibility", () => {
@@ -94,13 +94,13 @@ describe("padding for icon only button", () => {
94
94
  const { container } = render(
95
95
  <Button id="button" onClick={onClick} type="button">
96
96
  <Icon
97
- name={IconNames.check}
98
- decorative={true}
99
- modifiers={["small", "icon-left"]}
97
+ align={IconAlign.Left}
98
+ name={IconNames.Check}
99
+ size={IconSizes.Small}
100
100
  />
101
101
  </Button>
102
102
  );
103
- expect(container.querySelector(".button .icon")).toBeInTheDocument();
103
+ expect(container.querySelector(".button svg")).toBeInTheDocument();
104
104
  });
105
105
  });
106
106
 
@@ -149,11 +149,23 @@ describe("Button Snapshot", () => {
149
149
  </Button>
150
150
  )
151
151
  .toJSON();
152
+ const searchBar = renderer
153
+ .create(
154
+ <Button
155
+ id="button"
156
+ onClick={jest.fn()}
157
+ buttonType={ButtonTypes.SearchBar}
158
+ >
159
+ SearchBar
160
+ </Button>
161
+ )
162
+ .toJSON();
152
163
 
153
164
  expect(primary).toMatchSnapshot();
154
165
  expect(secondary).toMatchSnapshot();
155
166
  expect(callout).toMatchSnapshot();
156
167
  expect(pill).toMatchSnapshot();
157
168
  expect(link).toMatchSnapshot();
169
+ expect(searchBar).toMatchSnapshot();
158
170
  });
159
171
  });
@@ -4,4 +4,5 @@ export enum ButtonTypes {
4
4
  Callout = "callout",
5
5
  Pill = "pill",
6
6
  Link = "link",
7
+ SearchBar = "searchBar",
7
8
  }
@@ -13,7 +13,7 @@
13
13
  @include button-base;
14
14
 
15
15
  background-color: var(--ui-white);
16
- border: 1px solid var(--ui-gray-light);
16
+ border: 1px solid var(--ui-gray-light-cool);
17
17
  color: inherit;
18
18
 
19
19
  &:visited {
@@ -21,36 +21,12 @@
21
21
  }
22
22
 
23
23
  &:hover {
24
- background-color: var(--ui-gray-xxlight);
24
+ background-color: var(--ui-gray-xx-light-cool);
25
25
  }
26
26
 
27
27
  &:disabled {
28
- background-color: var(--ui-gray-light);
28
+ background-color: var(--ui-gray-light-cool);
29
29
  color: var(--ui-gray-dark);
30
30
  pointer-events: none;
31
31
  }
32
32
  }
33
-
34
- .button {
35
- // These `icon` rules are a better fit for the Icon
36
- // component but we'll keep them here for now.
37
- .icon {
38
- @include icon;
39
-
40
- fill: currentColor;
41
-
42
- &--small,
43
- &--icon-left,
44
- &--icon-right {
45
- margin-top: var(--space-xxs);
46
- }
47
-
48
- &--icon-left {
49
- margin-right: var(--space-xs);
50
- }
51
-
52
- &--icon-right {
53
- margin-left: var(--space-xs);
54
- }
55
- }
56
- }
@@ -54,3 +54,14 @@ exports[`Button Snapshot Renders the UI snapshot correctly 5`] = `
54
54
  Link
55
55
  </button>
56
56
  `;
57
+
58
+ exports[`Button Snapshot Renders the UI snapshot correctly 6`] = `
59
+ <button
60
+ className="chakra-button button css-0"
61
+ id="button"
62
+ onClick={[MockFunction]}
63
+ type="button"
64
+ >
65
+ SearchBar
66
+ </button>
67
+ `;
@@ -19,7 +19,6 @@ import HorizontalRule from "../HorizontalRule/HorizontalRule";
19
19
  import { LinkTypes } from "../Link/LinkTypes";
20
20
  import { HeadingDisplaySizes, HeadingLevels } from "../Heading/HeadingTypes";
21
21
  import Icon from "../Icons/Icon";
22
- import { IconRotationTypes, IconNames } from "../Icons/IconTypes";
23
22
  import Image from "../Image/Image";
24
23
  import { getCategory } from "../../utils/componentCategories";
25
24
 
@@ -81,7 +80,7 @@ The `CardContent` component should be used to display all content other than hea
81
80
  name="Card Props"
82
81
  args={{
83
82
  id: "custom-card",
84
- layout: CardLayouts.Horizontal,
83
+ layout: CardLayouts.Row,
85
84
  imageSrc: "https://placeimg.com/400/300/animals",
86
85
  imageAspectRatio: CardImageRatios.ThreeByFour,
87
86
  imageAlt: "Alt text",
@@ -132,9 +131,12 @@ The `CardContent` component should be used to display all content other than hea
132
131
 
133
132
  ## Image Position
134
133
 
135
- By default, the image is always the first element within a `Card`. This means the image is at the top of a vertical `Card` and on the left size of a horizontal `Card`. However, you can use the `imageAtEnd` prop to override the default placement and move the image to the last element within a `Card`.
134
+ By default, the image is always the first element within a `Card`. This means
135
+ the image is at the top of a `Card` with a column layout and on the left side of
136
+ a `Card` with a row layout. However, you can use the `imageAtEnd` prop to override
137
+ the default placement and move the image to the last element within a `Card`.
136
138
 
137
- ### Vertical Cards
139
+ ### Column Cards
138
140
 
139
141
  <Preview>
140
142
  <Story name="Card Image Position">
@@ -176,7 +178,7 @@ By default, the image is always the first element within a `Card`. This means th
176
178
  </Story>
177
179
  </Preview>
178
180
 
179
- ### Horizontal Cards
181
+ ### Row Cards
180
182
 
181
183
  <Preview>
182
184
  <div
@@ -187,7 +189,7 @@ By default, the image is always the first element within a `Card`. This means th
187
189
  }}
188
190
  >
189
191
  <Card
190
- layout={CardLayouts.Horizontal}
192
+ layout={CardLayouts.Row}
191
193
  center
192
194
  imageSrc="https://placeimg.com/400/200/animals"
193
195
  imageAlt="Alt text"
@@ -203,7 +205,7 @@ By default, the image is always the first element within a `Card`. This means th
203
205
  </CardContent>
204
206
  </Card>
205
207
  <Card
206
- layout={CardLayouts.Horizontal}
208
+ layout={CardLayouts.Row}
207
209
  center
208
210
  imageSrc="https://placeimg.com/410/210/animals"
209
211
  imageAlt="Alt text"
@@ -224,9 +226,11 @@ By default, the image is always the first element within a `Card`. This means th
224
226
 
225
227
  ## Image Size
226
228
 
227
- By default, the image width is `100%` for a vertical `Card` and `225px` for a horizontal `Card`. However, you can use the `imageSize` prop to override the default width.
229
+ By default, the image width is `100%` for a `Card` with a column layout and
230
+ `225px` for a `Card` with a row layout. However, you can use the `imageSize`
231
+ prop to override the default width.
228
232
 
229
- ### Vertical Cards
233
+ ### Column Cards
230
234
 
231
235
  <Preview>
232
236
  <Story name="Card Image Size">
@@ -313,7 +317,7 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
313
317
  </Story>
314
318
  </Preview>
315
319
 
316
- ### Horizontal Cards
320
+ ### Row Cards
317
321
 
318
322
  <Preview>
319
323
  <div
@@ -324,7 +328,7 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
324
328
  }}
325
329
  >
326
330
  <Card
327
- layout={CardLayouts.Horizontal}
331
+ layout={CardLayouts.Row}
328
332
  center
329
333
  imageSrc="https://placeimg.com/400/200/animals"
330
334
  imageAlt="Alt text"
@@ -342,7 +346,7 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
342
346
  </CardContent>
343
347
  </Card>
344
348
  <Card
345
- layout={CardLayouts.Horizontal}
349
+ layout={CardLayouts.Row}
346
350
  center
347
351
  imageSrc="https://placeimg.com/410/210/animals"
348
352
  imageAlt="Alt text"
@@ -361,7 +365,7 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
361
365
  </CardContent>
362
366
  </Card>
363
367
  <Card
364
- layout={CardLayouts.Horizontal}
368
+ layout={CardLayouts.Row}
365
369
  center
366
370
  imageSrc="https://placeimg.com/400/250/animals"
367
371
  imageAlt="Alt text"
@@ -381,7 +385,7 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
381
385
  </CardContent>
382
386
  </Card>
383
387
  <Card
384
- layout={CardLayouts.Horizontal}
388
+ layout={CardLayouts.Row}
385
389
  center
386
390
  imageSrc="https://placeimg.com/450/250/animals"
387
391
  imageAlt="Alt text"
@@ -507,7 +511,7 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
507
511
  }}
508
512
  >
509
513
  <Card
510
- layout={CardLayouts.Horizontal}
514
+ layout={CardLayouts.Row}
511
515
  center
512
516
  imageSrc="https://placeimg.com/400/200/animals"
513
517
  imageAlt="Alt text"
@@ -523,7 +527,7 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
523
527
  </CardContent>
524
528
  </Card>
525
529
  <Card
526
- layout={CardLayouts.Horizontal}
530
+ layout={CardLayouts.Row}
527
531
  center
528
532
  imageSrc="https://placeimg.com/410/210/animals"
529
533
  imageAlt="Alt text"
@@ -539,7 +543,7 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
539
543
  </CardContent>
540
544
  </Card>
541
545
  <Card
542
- layout={CardLayouts.Horizontal}
546
+ layout={CardLayouts.Row}
543
547
  center
544
548
  imageSrc="https://placeimg.com/420/220/animals"
545
549
  imageAlt="Alt text"
@@ -646,7 +650,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
646
650
  "grid-template-columns": "repeat(1, 1fr)",
647
651
  }}
648
652
  >
649
- <Card layout={CardLayouts.Horizontal} border>
653
+ <Card layout={CardLayouts.Row} border>
650
654
  <CardHeading level={HeadingLevels.Three} id="heading1">
651
655
  Card Heading
652
656
  </CardHeading>
@@ -659,7 +663,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
659
663
  eget metus.
660
664
  </CardContent>
661
665
  </Card>
662
- <Card layout={CardLayouts.Horizontal} border>
666
+ <Card layout={CardLayouts.Row} border>
663
667
  <CardHeading level={HeadingLevels.Three} id="heading1">
664
668
  Card Heading
665
669
  </CardHeading>
@@ -672,7 +676,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
672
676
  eget metus.
673
677
  </CardContent>
674
678
  </Card>
675
- <Card layout={CardLayouts.Horizontal} border>
679
+ <Card layout={CardLayouts.Row} border>
676
680
  <CardHeading level={HeadingLevels.Three} id="heading1">
677
681
  Card Heading
678
682
  </CardHeading>
@@ -9,7 +9,7 @@ import Button from "../Button/Button";
9
9
  import { ButtonTypes } from "../Button/ButtonTypes";
10
10
  import { HeadingLevels } from "../Heading/HeadingTypes";
11
11
  import Icon from "../Icons/Icon";
12
- import { IconRotationTypes, IconNames } from "../Icons/IconTypes";
12
+ import { IconRotationTypes, IconNames, IconAlign } from "../Icons/IconTypes";
13
13
 
14
14
  describe("Card Accessibility", () => {
15
15
  it("passes axe accessibility test", async () => {
@@ -92,12 +92,10 @@ describe("Card", () => {
92
92
  <div className="edition-card__download">
93
93
  <Link href="#url" type={LinkTypes.Action}>
94
94
  <Icon
95
- name={IconNames.download}
96
- blockName="more-link"
97
- decorative={true}
98
- modifiers={["left"]}
99
- iconRotation={IconRotationTypes.rotate0}
100
- ></Icon>
95
+ name={IconNames.Download}
96
+ align={IconAlign.Left}
97
+ iconRotation={IconRotationTypes.Rotate0}
98
+ />
101
99
  Download
102
100
  </Link>
103
101
  </div>
@@ -144,12 +142,10 @@ describe("Card", () => {
144
142
  <div className="edition-card__download">
145
143
  <Link href="#url" type={LinkTypes.Action}>
146
144
  <Icon
147
- name={IconNames.download}
148
- blockName="more-link"
149
- decorative={true}
150
- modifiers={["left"]}
151
- iconRotation={IconRotationTypes.rotate0}
152
- ></Icon>
145
+ name={IconNames.Download}
146
+ align={IconAlign.Left}
147
+ iconRotation={IconRotationTypes.Rotate0}
148
+ />
153
149
  Download
154
150
  </Link>
155
151
  </div>
@@ -175,12 +171,10 @@ describe("Card", () => {
175
171
  <div className="edition-card__download">
176
172
  <Link href="#url" type={LinkTypes.Action}>
177
173
  <Icon
178
- name={IconNames.download}
179
- blockName="more-link"
180
- decorative={true}
181
- modifiers={["left"]}
182
- iconRotation={IconRotationTypes.rotate0}
183
- ></Icon>
174
+ name={IconNames.Download}
175
+ align={IconAlign.Left}
176
+ iconRotation={IconRotationTypes.Rotate0}
177
+ />
184
178
  Download
185
179
  </Link>
186
180
  </div>
@@ -63,7 +63,7 @@ export interface CardProps {
63
63
  imageSize?: CardImageSizes;
64
64
  /** The path to the image displayed with the card */
65
65
  imageSrc?: string;
66
- /** Optional value to control the position of the image placeholder; default value is `vertical` */
66
+ /** Optional value to control the position of the image placeholder; default value is `column` */
67
67
  layout?: CardLayouts;
68
68
  /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
69
69
  modifiers?: string[];
@@ -1,6 +1,6 @@
1
1
  export enum CardLayouts {
2
- Horizontal = "horizontal",
3
- Vertical = "vertical",
2
+ Row = "row",
3
+ Column = "column",
4
4
  }
5
5
 
6
6
  export enum CardImageRatios {
@@ -167,7 +167,7 @@
167
167
  }
168
168
  }
169
169
 
170
- &.card--horizontal {
170
+ &.card--row {
171
171
  display: flex;
172
172
  flex-flow: column nowrap;
173
173
  max-width: 100%;
@@ -9,7 +9,12 @@ import Image from "../Image/Image";
9
9
  import Button from "../Button/Button";
10
10
  import Link from "../Link/Link";
11
11
  import Icon from "../Icons/Icon";
12
- import { IconRotationTypes, IconNames } from "../Icons/IconTypes";
12
+ import {
13
+ IconRotationTypes,
14
+ IconNames,
15
+ IconSizes,
16
+ IconAlign,
17
+ } from "../Icons/IconTypes";
13
18
  import { LinkTypes } from "../Link/LinkTypes";
14
19
  import { ButtonTypes } from "../Button/ButtonTypes";
15
20
  import { getCategory } from "../../utils/componentCategories";
@@ -122,11 +127,11 @@ export const ExampleCardEdition = () => (
122
127
  </div>
123
128
  <div className="book__filetype">
124
129
  <Icon
125
- name={IconNames.headset}
126
- decorative={true}
127
- modifiers={["left", "small"]}
128
- iconRotation={IconRotationTypes.rotate0}
129
- ></Icon>
130
+ name={IconNames.Headset}
131
+ size={IconSizes.Small}
132
+ align={IconAlign.Left}
133
+ iconRotation={IconRotationTypes.Rotate0}
134
+ />
130
135
  Audiobook
131
136
  </div>
132
137
  <div className="book__description">
@@ -11,7 +11,7 @@ import Image from "../Image/Image";
11
11
  import Button from "../Button/Button";
12
12
  import { ButtonTypes } from "../Button/ButtonTypes";
13
13
  import Icon from "../Icons/Icon";
14
- import { IconRotationTypes, IconNames } from "../Icons/IconTypes";
14
+ import { IconRotationTypes, IconNames, IconAlign } from "../Icons/IconTypes";
15
15
 
16
16
  describe("CardEdition Accessibility", () => {
17
17
  const regularCard = (
@@ -99,12 +99,11 @@ describe("CardEdition", () => {
99
99
  <div className="edition-card__download">
100
100
  <Link href="#url" type={LinkTypes.Action}>
101
101
  <Icon
102
- name={IconNames.download}
103
- blockName="more-link"
104
- decorative={true}
105
- modifiers={["left"]}
106
- iconRotation={IconRotationTypes.rotate0}
107
- ></Icon>
102
+ name={IconNames.Download}
103
+ // blockName="more-link"
104
+ align={IconAlign.Left}
105
+ iconRotation={IconRotationTypes.Rotate0}
106
+ />
108
107
  Download
109
108
  </Link>
110
109
  </div>
@@ -164,12 +163,11 @@ describe("CardEdition", () => {
164
163
  <div className="edition-card__download">
165
164
  <Link href="#url" type={LinkTypes.Action}>
166
165
  <Icon
167
- name={IconNames.download}
168
- blockName="more-link"
169
- decorative={true}
170
- modifiers={["left"]}
171
- iconRotation={IconRotationTypes.rotate0}
172
- ></Icon>
166
+ name={IconNames.Download}
167
+ // blockName="more-link"
168
+ align={IconAlign.Left}
169
+ iconRotation={IconRotationTypes.Rotate0}
170
+ />
173
171
  Download
174
172
  </Link>
175
173
  </div>
@@ -198,12 +196,10 @@ describe("CardEdition", () => {
198
196
  <div className="edition-card__download">
199
197
  <Link href="#url" type={LinkTypes.Action}>
200
198
  <Icon
201
- name={IconNames.download}
202
- blockName="more-link"
203
- decorative={true}
204
- modifiers={["left"]}
205
- iconRotation={IconRotationTypes.rotate0}
206
- ></Icon>
199
+ name={IconNames.Download}
200
+ align={IconAlign.Left}
201
+ iconRotation={IconRotationTypes.Rotate0}
202
+ />
207
203
  Download
208
204
  </Link>
209
205
  </div>
@@ -227,12 +223,10 @@ describe("CardEdition", () => {
227
223
  <div className="edition-card__download">
228
224
  <Link href="#url" type={LinkTypes.Action}>
229
225
  <Icon
230
- name={IconNames.download}
231
- blockName="more-link"
232
- decorative={true}
233
- modifiers={["left"]}
234
- iconRotation={IconRotationTypes.rotate0}
235
- ></Icon>
226
+ name={IconNames.Download}
227
+ align={IconAlign.Left}
228
+ iconRotation={IconRotationTypes.Rotate0}
229
+ />
236
230
  Download
237
231
  </Link>
238
232
  </div>
@@ -265,12 +259,10 @@ describe("CardEdition", () => {
265
259
  <div className="edition-card__download">
266
260
  <Link href="#url" type={LinkTypes.Action}>
267
261
  <Icon
268
- name={IconNames.download}
269
- blockName="more-link"
270
- decorative={true}
271
- modifiers={["left"]}
272
- iconRotation={IconRotationTypes.rotate0}
273
- ></Icon>
262
+ name={IconNames.Download}
263
+ align={IconAlign.Left}
264
+ iconRotation={IconRotationTypes.Rotate0}
265
+ />
274
266
  Download
275
267
  </Link>
276
268
  </div>
@@ -2,7 +2,7 @@
2
2
  @include space-stack-s;
3
3
 
4
4
  align-items: flex-start;
5
- border: 1px solid var(--ui-gray-light);
5
+ border: 1px solid var(--ui-gray-light-cool);
6
6
  border-radius: 5px;
7
7
  display: flex;
8
8
  flex-flow: column wrap;
@@ -32,7 +32,7 @@
32
32
  @include space-stack-s;
33
33
 
34
34
  align-items: center;
35
- background-color: var(--ui-gray-xlight);
35
+ background-color: var(--ui-gray-x-light-cool);
36
36
  display: flex;
37
37
  flex: 0 0 150px;
38
38
  height: 150px;