@nypl/design-system-react-components 0.23.4 → 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 (307) hide show
  1. package/CHANGELOG.md +98 -1
  2. package/README.md +46 -11
  3. package/dist/components/Accordion/Accordion.d.ts +14 -14
  4. package/dist/components/Autosuggest/Autosuggest.stories.d.ts +1 -0
  5. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -14
  6. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
  7. package/dist/components/Button/Button.d.ts +6 -13
  8. package/dist/components/Button/ButtonTypes.d.ts +5 -3
  9. package/dist/components/Card/Card.d.ts +59 -10
  10. package/dist/components/Card/CardTypes.d.ts +19 -0
  11. package/dist/components/CardEdition/CardEdition.d.ts +21 -0
  12. package/dist/components/{StyleGuide/Colors.stories.d.ts → CardEdition/CardEdition.stories.d.ts} +5 -2
  13. package/dist/components/Checkbox/Checkbox.d.ts +21 -16
  14. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +43 -0
  15. package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +4 -0
  16. package/dist/components/DatePicker/DatePicker.d.ts +79 -0
  17. package/dist/components/DatePicker/DatePickerTypes.d.ts +5 -0
  18. package/dist/components/Form/Form.d.ts +16 -8
  19. package/dist/components/Form/FormTypes.d.ts +2 -0
  20. package/dist/components/Grid/GridTypes.d.ts +9 -0
  21. package/dist/components/Grid/SimpleGrid.d.ts +14 -0
  22. package/dist/components/Heading/Heading.d.ts +9 -11
  23. package/dist/components/Heading/{HeadingDisplaySizes.d.ts → HeadingTypes.d.ts} +8 -0
  24. package/dist/components/HelperErrorText/HelperErrorText.stories.d.ts +2 -1
  25. package/dist/components/Hero/Hero.d.ts +19 -14
  26. package/dist/components/Hero/HeroTypes.d.ts +10 -5
  27. package/dist/components/Icons/Icon.d.ts +13 -16
  28. package/dist/components/Icons/IconSvgs.d.ts +4 -0
  29. package/dist/components/Icons/IconTypes.d.ts +78 -60
  30. package/dist/components/Image/Image.stories.d.ts +2 -1
  31. package/dist/components/Label/Label.d.ts +10 -26
  32. package/dist/components/Link/Link.d.ts +8 -12
  33. package/dist/components/List/List.stories.d.ts +1 -0
  34. package/dist/components/Radio/Radio.d.ts +30 -24
  35. package/dist/components/RadioGroup/RadioGroup.d.ts +40 -0
  36. package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +4 -0
  37. package/dist/components/SearchBar/SearchBar.d.ts +45 -27
  38. package/dist/components/Select/Select.d.ts +34 -35
  39. package/dist/components/Select/SelectTypes.d.ts +4 -0
  40. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +1 -1
  41. package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +2 -2
  42. package/dist/components/StatusBadge/StatusBadge.d.ts +8 -6
  43. package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +5 -0
  44. package/dist/components/Tabs/Tabs.d.ts +25 -0
  45. package/dist/components/Template/Template.d.ts +91 -0
  46. package/dist/components/Text/Text.d.ts +16 -0
  47. package/dist/components/Text/TextTypes.d.ts +6 -0
  48. package/dist/components/TextInput/TextInput.d.ts +37 -30
  49. package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
  50. package/dist/design-system-react-components.cjs.development.js +4102 -917
  51. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  52. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  53. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  54. package/dist/design-system-react-components.esm.js +4023 -920
  55. package/dist/design-system-react-components.esm.js.map +1 -1
  56. package/dist/index.d.ts +23 -5
  57. package/dist/resources.scss +133 -24
  58. package/dist/styles.css +1 -1
  59. package/dist/theme/components/accordion.d.ts +25 -0
  60. package/dist/theme/components/breadcrumb.d.ts +90 -0
  61. package/dist/theme/components/button.d.ts +109 -0
  62. package/dist/theme/components/checkbox.d.ts +91 -0
  63. package/dist/theme/components/customCheckboxGroup.d.ts +18 -0
  64. package/dist/theme/components/customRadioGroup.d.ts +18 -0
  65. package/dist/theme/components/global.d.ts +55 -0
  66. package/dist/theme/components/globalMixins.d.ts +15 -0
  67. package/dist/theme/components/heading.d.ts +110 -0
  68. package/dist/theme/components/hero.d.ts +492 -0
  69. package/dist/theme/components/icon.d.ts +13 -0
  70. package/dist/theme/components/label.d.ts +16 -0
  71. package/dist/theme/components/link.d.ts +45 -0
  72. package/dist/theme/components/radio.d.ts +95 -0
  73. package/dist/theme/components/searchBar.d.ts +20 -0
  74. package/dist/theme/components/select.d.ts +58 -0
  75. package/dist/theme/components/statusBadge.d.ts +25 -0
  76. package/dist/theme/components/tabs.d.ts +85 -0
  77. package/dist/theme/components/template.d.ts +105 -0
  78. package/dist/theme/components/text.d.ts +20 -0
  79. package/dist/theme/components/textInput.d.ts +105 -0
  80. package/dist/theme/foundations/breakpoints.d.ts +23 -0
  81. package/dist/theme/foundations/colors.d.ts +3 -0
  82. package/dist/theme/foundations/global.d.ts +23 -0
  83. package/dist/theme/foundations/shadows.d.ts +4 -0
  84. package/dist/theme/foundations/spacing.d.ts +77 -0
  85. package/dist/theme/foundations/typography.d.ts +8 -0
  86. package/dist/theme/index.d.ts +20 -0
  87. package/dist/theme/provider.d.ts +5 -0
  88. package/dist/theme/types.d.ts +1 -0
  89. package/dist/utils/utils.d.ts +6 -0
  90. package/package.json +9 -2
  91. package/src/components/Accordion/Accordion.stories.mdx +233 -33
  92. package/src/components/Accordion/Accordion.test.tsx +135 -19
  93. package/src/components/Accordion/Accordion.tsx +81 -56
  94. package/src/components/Autosuggest/Autosuggest.stories.mdx +4 -3
  95. package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -1
  96. package/src/components/Autosuggest/_Autosuggest.scss +2 -2
  97. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +57 -56
  98. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +31 -25
  99. package/src/components/Breadcrumbs/Breadcrumbs.tsx +71 -73
  100. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +6 -0
  101. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +100 -0
  102. package/src/components/Button/Button.stories.mdx +125 -138
  103. package/src/components/Button/Button.test.tsx +65 -11
  104. package/src/components/Button/Button.tsx +72 -68
  105. package/src/components/Button/ButtonTypes.tsx +4 -2
  106. package/src/components/Button/_Button.scss +7 -92
  107. package/src/components/Button/__snapshots__/Button.test.tsx.snap +58 -3
  108. package/src/components/Card/Card.stories.mdx +694 -0
  109. package/src/components/Card/Card.test.tsx +97 -102
  110. package/src/components/Card/Card.tsx +182 -31
  111. package/src/components/Card/CardTypes.tsx +21 -0
  112. package/src/components/Card/_Card.scss +234 -49
  113. package/src/components/{Card/Card.stories.tsx → CardEdition/CardEdition.stories.tsx} +32 -22
  114. package/src/components/CardEdition/CardEdition.test.tsx +395 -0
  115. package/src/components/CardEdition/CardEdition.tsx +60 -0
  116. package/src/components/CardEdition/_CardEdition.scss +138 -0
  117. package/src/components/Chakra/Box.stories.mdx +57 -0
  118. package/src/components/Chakra/Center.stories.mdx +99 -0
  119. package/src/components/Chakra/Grid.stories.mdx +79 -0
  120. package/src/components/Chakra/Stack.stories.mdx +93 -0
  121. package/src/components/Checkbox/Checkbox.stories.mdx +57 -35
  122. package/src/components/Checkbox/Checkbox.test.tsx +117 -147
  123. package/src/components/Checkbox/Checkbox.tsx +76 -50
  124. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +325 -0
  125. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +249 -0
  126. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +345 -0
  127. package/src/components/CheckboxGroup/CheckboxGroup.tsx +148 -0
  128. package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +4 -0
  129. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1360 -0
  130. package/src/components/DatePicker/DatePicker.stories.mdx +284 -0
  131. package/src/components/DatePicker/DatePicker.test.tsx +657 -0
  132. package/src/components/DatePicker/DatePicker.tsx +396 -0
  133. package/src/components/DatePicker/DatePickerTypes.tsx +5 -0
  134. package/src/components/DatePicker/_DatePicker.scss +76 -0
  135. package/src/components/Form/Form.stories.mdx +130 -27
  136. package/src/components/Form/Form.test.tsx +78 -36
  137. package/src/components/Form/Form.tsx +53 -19
  138. package/src/components/Form/FormTypes.tsx +3 -0
  139. package/src/components/Form/__snapshots__/Form.test.tsx.snap +38 -0
  140. package/src/components/Grid/GridTypes.tsx +9 -0
  141. package/src/components/Grid/SimpleGrid.stories.mdx +275 -0
  142. package/src/components/Grid/SimpleGrid.test.tsx +66 -0
  143. package/src/components/Grid/SimpleGrid.tsx +37 -0
  144. package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +8 -0
  145. package/src/components/Heading/Heading.stories.mdx +63 -33
  146. package/src/components/Heading/Heading.test.tsx +24 -16
  147. package/src/components/Heading/Heading.tsx +54 -38
  148. package/src/components/Heading/{HeadingDisplaySizes.tsx → HeadingTypes.tsx} +9 -0
  149. package/src/components/HelperErrorText/HelperErrorText.stories.tsx +2 -1
  150. package/src/components/HelperErrorText/_HelperErrorText.scss +1 -1
  151. package/src/components/Hero/Hero.stories.mdx +195 -85
  152. package/src/components/Hero/Hero.test.tsx +544 -113
  153. package/src/components/Hero/Hero.tsx +80 -93
  154. package/src/components/Hero/HeroTypes.tsx +17 -5
  155. package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
  156. package/src/components/HorizontalRule/HorizontalRule.stories.mdx +6 -1
  157. package/src/components/HorizontalRule/_HorizontalRule.scss +1 -1
  158. package/src/components/Icons/Icon.stories.mdx +89 -74
  159. package/src/components/Icons/Icon.test.tsx +30 -22
  160. package/src/components/Icons/Icon.tsx +63 -61
  161. package/src/components/Icons/IconSvgs.tsx +8 -0
  162. package/src/components/Icons/IconTypes.tsx +80 -60
  163. package/src/components/Image/Image.stories.tsx +2 -1
  164. package/src/components/Input/_Input.scss +2 -2
  165. package/src/components/Label/Label.stories.mdx +77 -0
  166. package/src/components/Label/Label.test.tsx +43 -12
  167. package/src/components/Label/Label.tsx +28 -45
  168. package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
  169. package/src/components/Link/Link.stories.mdx +47 -41
  170. package/src/components/Link/Link.test.tsx +33 -44
  171. package/src/components/Link/Link.tsx +114 -100
  172. package/src/components/List/List.stories.mdx +7 -3
  173. package/src/components/List/List.stories.tsx +14 -9
  174. package/src/components/List/List.test.tsx +12 -8
  175. package/src/components/List/List.tsx +9 -7
  176. package/src/components/List/_List.scss +3 -3
  177. package/src/components/Modal/Modal.stories.mdx +7 -3
  178. package/src/components/Modal/_Modal.scss +1 -1
  179. package/src/components/Notification/Notification.stories.mdx +99 -65
  180. package/src/components/Notification/Notification.test.tsx +3 -16
  181. package/src/components/Notification/Notification.tsx +12 -12
  182. package/src/components/Notification/_Notification.scss +5 -4
  183. package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +1 -1
  184. package/src/components/Pagination/Pagination.stories.mdx +7 -1
  185. package/src/components/Pagination/Pagination.test.tsx +16 -10
  186. package/src/components/Radio/Radio.stories.mdx +57 -46
  187. package/src/components/Radio/Radio.test.tsx +92 -138
  188. package/src/components/Radio/Radio.tsx +70 -69
  189. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +250 -0
  190. package/src/components/RadioGroup/RadioGroup.stories.mdx +247 -0
  191. package/src/components/RadioGroup/RadioGroup.test.tsx +327 -0
  192. package/src/components/RadioGroup/RadioGroup.tsx +154 -0
  193. package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +4 -0
  194. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1101 -0
  195. package/src/components/SearchBar/SearchBar.Test.tsx +151 -16
  196. package/src/components/SearchBar/SearchBar.stories.mdx +196 -224
  197. package/src/components/SearchBar/SearchBar.tsx +151 -46
  198. package/src/components/Select/Select.stories.mdx +193 -168
  199. package/src/components/Select/Select.test.tsx +129 -324
  200. package/src/components/Select/Select.tsx +120 -160
  201. package/src/components/Select/SelectTypes.tsx +4 -0
  202. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +18 -29
  203. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -7
  204. package/src/components/SkeletonLoader/SkeletonLoader.tsx +4 -2
  205. package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +2 -2
  206. package/src/components/SkeletonLoader/_SkeletonLoader.scss +3 -3
  207. package/src/components/StatusBadge/StatusBadge.stories.mdx +91 -0
  208. package/src/components/StatusBadge/StatusBadge.test.tsx +35 -7
  209. package/src/components/StatusBadge/StatusBadge.tsx +24 -25
  210. package/src/components/StatusBadge/StatusBadgeTypes.tsx +5 -0
  211. package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +28 -0
  212. package/src/components/StyleGuide/Bidirectionality.stories.mdx +112 -90
  213. package/src/components/StyleGuide/Buttons.stories.mdx +98 -100
  214. package/src/components/StyleGuide/Colors.stories.mdx +336 -0
  215. package/src/components/StyleGuide/Forms.stories.mdx +85 -0
  216. package/src/components/StyleGuide/Iconography.stories.mdx +86 -93
  217. package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
  218. package/src/components/StyleGuide/Typography.stories.mdx +164 -166
  219. package/src/components/StyleGuide/UIDocCard.tsx +4 -4
  220. package/src/components/Tabs/Tabs.stories.mdx +221 -0
  221. package/src/components/Tabs/Tabs.test.tsx +264 -0
  222. package/src/components/Tabs/Tabs.tsx +220 -0
  223. package/src/components/Template/Template.stories.mdx +574 -0
  224. package/src/components/Template/Template.test.tsx +124 -0
  225. package/src/components/Template/Template.tsx +226 -0
  226. package/src/components/Text/Text.stories.mdx +70 -0
  227. package/src/components/Text/Text.test.tsx +63 -0
  228. package/src/components/Text/Text.tsx +55 -0
  229. package/src/components/Text/TextTypes.tsx +6 -0
  230. package/src/components/Text/__snapshots__/Text.test.tsx.snap +33 -0
  231. package/src/components/TextInput/TextInput.stories.mdx +90 -90
  232. package/src/components/TextInput/TextInput.test.tsx +103 -83
  233. package/src/components/TextInput/TextInput.tsx +108 -91
  234. package/src/components/TextInput/TextInputTypes.tsx +6 -0
  235. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -1
  236. package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
  237. package/src/components/VideoPlayer/_VideoPlayer.scss +1 -1
  238. package/src/docs/Chakra.stories.mdx +341 -0
  239. package/src/docs/Intro.stories.mdx +31 -24
  240. package/src/index.ts +70 -5
  241. package/src/styles/01-colors/_colors-brand.scss +6 -4
  242. package/src/styles/01-colors/_colors-utility.scss +14 -15
  243. package/src/styles/03-space/_space-inline.scss +47 -7
  244. package/src/styles/03-space/_space-inset.scss +33 -5
  245. package/src/styles/03-space/_space-stack.scss +48 -8
  246. package/src/styles/base/_02-breakpoints.scss +5 -4
  247. package/src/styles/base/_04-base.scss +2 -1
  248. package/src/styles/base/_place-holder.scss +1 -1
  249. package/src/styles/base/_typography.scss +1 -29
  250. package/src/styles.scss +22 -25
  251. package/src/theme/components/accordion.ts +30 -0
  252. package/src/theme/components/breadcrumb.ts +77 -0
  253. package/src/theme/components/button.ts +125 -0
  254. package/src/theme/components/checkbox.ts +107 -0
  255. package/src/theme/components/customCheckboxGroup.ts +12 -0
  256. package/src/theme/components/customRadioGroup.ts +12 -0
  257. package/src/theme/components/global.ts +71 -0
  258. package/src/theme/components/globalMixins.ts +16 -0
  259. package/src/theme/components/heading.ts +72 -0
  260. package/src/theme/components/hero.ts +239 -0
  261. package/src/theme/components/icon.ts +79 -0
  262. package/src/theme/components/label.ts +17 -0
  263. package/src/theme/components/link.ts +47 -0
  264. package/src/theme/components/radio.ts +106 -0
  265. package/src/theme/components/searchBar.ts +21 -0
  266. package/src/theme/components/select.ts +50 -0
  267. package/src/theme/components/statusBadge.ts +27 -0
  268. package/src/theme/components/tabs.ts +79 -0
  269. package/src/theme/components/template.ts +114 -0
  270. package/src/theme/components/text.ts +31 -0
  271. package/src/theme/components/textInput.ts +61 -0
  272. package/src/theme/foundations/breakpoints.ts +24 -0
  273. package/src/theme/foundations/colors.ts +208 -0
  274. package/src/theme/foundations/global.ts +26 -0
  275. package/src/theme/foundations/shadows.ts +5 -0
  276. package/src/theme/foundations/spacing.ts +85 -0
  277. package/src/theme/foundations/typography.ts +35 -0
  278. package/src/theme/index.ts +88 -0
  279. package/src/theme/provider.tsx +9 -0
  280. package/src/theme/types.ts +1 -0
  281. package/src/utils/componentCategories.ts +56 -21
  282. package/src/utils/utils.ts +13 -0
  283. package/dist/components/Accordion/Accordion.stories.d.ts +0 -5
  284. package/dist/components/Card/Card.stories.d.ts +0 -27
  285. package/dist/components/Label/Label.stories.d.ts +0 -12
  286. package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
  287. package/dist/components/Template/Template.stories.d.ts +0 -29
  288. package/src/components/Accordion/Accordion.stories.tsx +0 -65
  289. package/src/components/Accordion/_Accordion.scss +0 -81
  290. package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
  291. package/src/components/Checkbox/_Checkbox.scss +0 -97
  292. package/src/components/Form/_Form.scss +0 -28
  293. package/src/components/Heading/_Heading.scss +0 -163
  294. package/src/components/Hero/_Hero.scss +0 -256
  295. package/src/components/Icons/_Icons.scss +0 -116
  296. package/src/components/Label/Label.stories.tsx +0 -30
  297. package/src/components/Label/_Label.scss +0 -22
  298. package/src/components/Link/_Link.scss +0 -73
  299. package/src/components/Radio/_Radio.scss +0 -84
  300. package/src/components/SearchBar/_SearchBar.scss +0 -16
  301. package/src/components/Select/_Select.scss +0 -82
  302. package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -33
  303. package/src/components/StatusBadge/_StatusBadge.scss +0 -23
  304. package/src/components/StyleGuide/Colors.stories.tsx +0 -288
  305. package/src/components/Template/Template.stories.tsx +0 -85
  306. package/src/components/Template/_Template.scss +0 -63
  307. package/src/components/TextInput/_TextInput.scss +0 -59
@@ -0,0 +1,79 @@
1
+ import React from "react";
2
+ import { DatePickerTypes } from "./DatePickerTypes";
3
+ import { TextInputRefType } from "../TextInput/TextInput";
4
+ interface FullDateType {
5
+ startDate: Date;
6
+ endDate?: Date;
7
+ }
8
+ interface DateRangeRowProps {
9
+ /** Whether to render a single date input or two for a range of two dates. */
10
+ dateRange?: boolean;
11
+ }
12
+ interface DatePickerWrapperProps extends DateRangeRowProps {
13
+ /** ID that other components can cross reference for accessibility purposes. */
14
+ id?: string;
15
+ /** Passed to the `TextInput` component to render a label associated with an input field. */
16
+ labelText: string;
17
+ /** Offers the ability to show the label onscreen or hide it. */
18
+ showLabel?: boolean;
19
+ /** Additional className for use with BEM. See how to work with blockNames and
20
+ * BEM here: http://getbem.com/introduction/ */
21
+ className?: string;
22
+ }
23
+ export interface DatePickerProps extends DatePickerWrapperProps {
24
+ /** DatePicker date types that can be rendered. */
25
+ dateType?: DatePickerTypes;
26
+ /** The date format to display. Defaults to "yyyy-MM-dd". */
27
+ dateFormat?: string;
28
+ /** Populates the `HelperErrorText` component in this component. */
29
+ helperText?: string;
30
+ /** Populates the `HelperErrorText` component in the "From" `TextInput` component. */
31
+ helperTextFrom?: string;
32
+ /** Populates the `HelperErrorText` component in the "To" `TextInput` component. */
33
+ helperTextTo?: string;
34
+ /** The initial date value. This must be in the mm/dd/yyyy format. */
35
+ initialDate?: string;
36
+ /** The initialTo date value used for date ranges.
37
+ * This must be in the mm/dd/yyyy format.
38
+ */
39
+ initialDateTo?: string;
40
+ /** The minimum date value that applies to both input fields.
41
+ * This must be in the mm/dd/yyyy format.
42
+ */
43
+ minDate?: string;
44
+ /** The maximum date value that applies to both input fields.
45
+ * This must be in the mm/dd/yyyy format.
46
+ */
47
+ maxDate?: string;
48
+ /** Populates the `HelperErrorText` error state for both "From" and "To" input components. */
49
+ invalidText?: string;
50
+ /** Helper for modifiers array; adds 'isInvalid' styling. */
51
+ isInvalid?: boolean;
52
+ /** Adds the 'required' property to the input element(s). */
53
+ required?: boolean;
54
+ /** Whether or not to display the "Required"/"Optional" text in the label text. */
55
+ showOptReqLabel?: boolean;
56
+ /** Adds the 'disabled' property to the input element(s). */
57
+ isDisabled?: boolean;
58
+ /** Modifiers array for use with BEM. See how to work with modifiers and BEM
59
+ * here: http://getbem.com/introduction/ */
60
+ modifiers?: string[];
61
+ /** BlockName for use with BEM. See how to work with blockNames and BEM
62
+ * here: http://getbem.com/introduction/ */
63
+ blockName?: string;
64
+ /** Value name for the single input field or the "From" input field in a date range. */
65
+ nameFrom?: string;
66
+ /** Value name for the "To" input field */
67
+ nameTo?: string;
68
+ /** An additional explicit React ref passed for a date range's "From" input field. */
69
+ refTo?: React.Ref<TextInputRefType>;
70
+ /** The action to perform on the `input`'s onChange function for both fields.
71
+ * This will return the data in an object with `startDate` and `endDate` keys.
72
+ */
73
+ onChange?: (data: FullDateType) => void;
74
+ }
75
+ /**
76
+ * Returns a single date input field or two date input fields for a date range.
77
+ */
78
+ declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<TextInputRefType>>;
79
+ export default DatePicker;
@@ -0,0 +1,5 @@
1
+ export declare enum DatePickerTypes {
2
+ Full = "full",
3
+ Month = "month",
4
+ Year = "year"
5
+ }
@@ -1,20 +1,28 @@
1
1
  import * as React from "react";
2
+ import { FormSpacing } from "./FormTypes";
3
+ export interface FormChildProps {
4
+ /** className to be applied to FormRow */
5
+ className?: string;
6
+ /** Spacing size (internal use) */
7
+ gap?: FormSpacing;
8
+ /** ID that other components can cross reference (internal use) */
9
+ id?: string;
10
+ }
2
11
  export interface FormProps {
3
12
  /** Optional form `action` attribute */
4
13
  action?: string;
5
- /** Optional additional attributes passed to the `<form>` element */
6
- attributes?: {
7
- [key: string]: any;
8
- };
9
14
  /** Optional className you can add in addition to `form` */
10
15
  className?: string;
11
16
  /** Optional ID that other components can cross reference */
12
17
  id?: string;
13
18
  /** Optional form `method` attribute */
14
19
  method?: "get" | "post";
15
- /** Optional modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
16
- modifiers?: string[];
20
+ /** Optional spacing size; if omitted, the default `large` (2rem / 32px) spacing will be used; ```IMPORTANT: for general form layout, this prop should not be used``` */
21
+ spacing?: FormSpacing;
17
22
  }
18
- export declare function FormRow(props: any): JSX.Element;
19
- export declare function FormField(props: any): JSX.Element;
23
+ /** FormRow child-component */
24
+ export declare function FormRow(props: React.PropsWithChildren<FormChildProps>): JSX.Element;
25
+ /** FormField child-component */
26
+ export declare function FormField(props: React.PropsWithChildren<FormChildProps>): JSX.Element;
27
+ /** main Form component */
20
28
  export default function Form(props: React.ComponentProps<"form"> & FormProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { GridGaps as FormSpacing } from "../Grid/GridTypes";
2
+ export { FormSpacing };
@@ -0,0 +1,9 @@
1
+ export declare enum GridGaps {
2
+ ExtraExtraSmall = "xxs",
3
+ ExtraSmall = "xs",
4
+ Small = "s",
5
+ Medium = "m",
6
+ Large = "l",
7
+ ExtraLarge = "xl",
8
+ ExtraExtraLarge = "xxl"
9
+ }
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { GridGaps } from "./GridTypes";
3
+ export interface SimpleGridProps {
4
+ /** Additional class name. */
5
+ className?: string;
6
+ /** Optional numeric value to override the default column count; the default column count is 3 */
7
+ columns?: number;
8
+ /** Optional gap size; if omitted, the default `large` (2rem / 32px) spacing will be used; ```IMPORTANT: for standard grid layouts, this prop should not be used``` */
9
+ gap?: GridGaps;
10
+ /** ID that other components can cross reference for accessibility purposes */
11
+ id?: string;
12
+ }
13
+ declare function SimpleGrid(props: React.PropsWithChildren<SimpleGridProps>): JSX.Element;
14
+ export default SimpleGrid;
@@ -1,18 +1,18 @@
1
1
  import * as React from "react";
2
- import { HeadingDisplaySizes } from "./HeadingDisplaySizes";
2
+ import { HeadingDisplaySizes, HeadingLevels } from "./HeadingTypes";
3
3
  export interface HeadingProps {
4
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
5
- blockName?: string;
6
4
  /** Optional className that appears in addition to `heading` */
7
5
  className?: string;
8
6
  /** Optional size used to override the default styles of the semantic HTML `<h>` elements */
9
7
  displaySize?: HeadingDisplaySizes;
10
8
  /** Optional ID that other components can cross reference for accessibility purposes */
11
9
  id?: string;
12
- /** Number 1-6; used to create the `<h*>` tag */
13
- level: number;
14
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
15
- modifiers?: string[];
10
+ /** Optional number 1-6 used to create the `<h*>` tag; if prop is not passed, `Heading` will default to `<h2>` */
11
+ level?: HeadingLevels;
12
+ /** Optionally pass in additional Chakra-based styles. */
13
+ sx?: {
14
+ [key: string]: any;
15
+ };
16
16
  /** Inner text of the `<h*>` element */
17
17
  text?: string;
18
18
  /** Optional URL that header points to; when `url` prop is passed to `Heading`, a child `<a>` element is created and the heading text becomes an active link */
@@ -20,7 +20,5 @@ export interface HeadingProps {
20
20
  /** Optional className for the URL when the `url` prop is passed */
21
21
  urlClass?: string;
22
22
  }
23
- export default function Heading(props: React.PropsWithChildren<HeadingProps>): React.ReactElement<{
24
- className: string;
25
- id: string;
26
- }, string | ((props: any) => React.ReactElement<any, any>) | (new (props: any) => React.Component<any, any, any>)>;
23
+ declare function Heading(props: React.PropsWithChildren<HeadingProps>): JSX.Element;
24
+ export default Heading;
@@ -4,3 +4,11 @@ export declare enum HeadingDisplaySizes {
4
4
  Tertiary = "tertiary",
5
5
  Callout = "callout"
6
6
  }
7
+ export declare enum HeadingLevels {
8
+ One = 1,
9
+ Two = 2,
10
+ Three = 3,
11
+ Four = 4,
12
+ Five = 5,
13
+ Six = 6
14
+ }
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  import HelperErrorText from "./HelperErrorText";
2
3
  declare const _default: {
3
- title: string;
4
+ title: any;
4
5
  component: typeof HelperErrorText;
5
6
  };
6
7
  export default _default;
@@ -1,27 +1,32 @@
1
1
  import * as React from "react";
2
2
  import { HeroTypes } from "./HeroTypes";
3
3
  export interface HeroProps {
4
- /** Optional hex color value used to override the default background color for a given `Hero` variation; Note: not all `Hero` variations utilize this prop */
4
+ /** Optional hex color value used to override the default background
5
+ * color for a given `Hero` variation.
6
+ * Note: not all `Hero` variations utilize this prop. */
5
7
  backgroundColor?: string;
6
- /** Optional path to an image that will be used as a background image for the `Hero` component; Note: not all `Hero` variations utilize this prop */
8
+ /** Optional path to an image that will be used as a background image for the
9
+ * `Hero` component.
10
+ * Note: not all `Hero` variations utilize this prop. */
7
11
  backgroundImageSrc?: string;
8
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
9
- blockName?: string;
10
- /** Optional className that appears in addition to `hero` */
11
- className?: string;
12
- /** Optional hex color value used to override the default text color for a given `Hero` variation; Note: not all `Hero` variations utilize this prop */
12
+ /** Optional hex color value used to override the default text color for a
13
+ * given `Hero` variation.
14
+ * Note: not all `Hero` variations utilize this prop. */
13
15
  foregroundColor?: string;
14
- /** Required heading element. */
16
+ /** Optional heading element. */
15
17
  heading?: JSX.Element;
16
18
  /** Used to control how the `Hero` component will be rendered. */
17
19
  heroType?: HeroTypes;
18
- /** Optional `Image` component used for SECONDARY, FIFTYFIFTY and CAMPAIGN `Hero` types; Note: `image` can only be used in conjunction with `backgroundImageSrc` for CAMPAIGN Hero type; Note: not all `Hero` variations utilize this prop */
20
+ /** Optional `Image` component used for SECONDARY, FIFTYFIFTY and CAMPAIGN
21
+ * `Hero` types; Note: `image` can only be used in conjunction with
22
+ * `backgroundImageSrc` for CAMPAIGN the `Hero` type.
23
+ * Note: not all `Hero` variations utilize this prop. */
19
24
  image?: JSX.Element;
20
- /** Optional details area that contains location data; Note: not all `Hero` variations utilize this prop */
25
+ /** Optional details area that contains location data.
26
+ * Note: not all `Hero` variations utilize this prop. */
21
27
  locationDetails?: JSX.Element;
22
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
23
- modifiers?: string[];
24
- /** Optional string used for the subheader that displays underneath the heading element */
25
- subHeaderText?: JSX.Element;
28
+ /** Optional string used for the subheader that displays
29
+ * underneath the heading element. */
30
+ subHeaderText?: string | JSX.Element;
26
31
  }
27
32
  export default function Hero(props: React.PropsWithChildren<HeroProps>): JSX.Element;
@@ -1,7 +1,12 @@
1
1
  export declare enum HeroTypes {
2
- Campaign = "CAMPAIGN",
3
- FiftyFifty = "FIFTYFIFTY",
4
- Primary = "PRIMARY",
5
- Secondary = "SECONDARY",
6
- Tertiary = "TERTIARY"
2
+ Primary = "primary",
3
+ Secondary = "secondary",
4
+ SecondaryBooksAndMore = "secondaryBooksAndMore",
5
+ SecondaryLocations = "secondaryLocations",
6
+ SecondaryResearch = "secondaryResearch",
7
+ SecondaryWhatsOn = "secondaryWhatsOn",
8
+ Tertiary = "tertiary",
9
+ Campaign = "campaign",
10
+ FiftyFifty = "fiftyfifty"
7
11
  }
12
+ export declare const HeroSecondaryTypes: HeroTypes[];
@@ -1,28 +1,25 @@
1
1
  import * as React from "react";
2
- import { IconRotationTypes, IconNames, LogoNames, IconColors, IconSizes } from "./IconTypes";
2
+ import { IconAlign, IconColors, IconNames, IconRotationTypes, IconSizes, IconTypes, LogoNames } from "./IconTypes";
3
3
  export interface IconProps {
4
- /** Additional attributes to pass to the `<svg>` tag. */
5
- attributes?: {
6
- [key: string]: any;
7
- };
8
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
9
- blockName?: string;
10
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
11
- modifiers?: string[];
4
+ /** Aligns the icon. */
5
+ align?: IconAlign;
12
6
  /** className that appears in addition to "icon" */
13
7
  className?: string;
14
- /** Icons designated as decorative will be ignored by screenreaders */
8
+ /** Overrides default icon color (black). */
9
+ color?: IconColors;
10
+ /** Icons designated as decorative will be ignored by screenreaders. True
11
+ * by default. */
15
12
  decorative?: boolean;
16
- /** This text will be added as a child `<title>` element inside the `<svg>` tag. It is recommended to do this for increased accessibility. */
17
- titleText?: string;
18
13
  /** Rotates the icon clockwise in increments of 90deg */
19
14
  iconRotation?: IconRotationTypes;
20
- /** Overrides default icon color (black). */
21
- color?: IconColors;
22
- /** Sets the icon size. */
23
- size?: IconSizes;
15
+ /** ID that other components can cross reference for accessibility purposes */
16
+ id?: string;
24
17
  /** The name of the icon you want to use. */
25
18
  name?: IconNames | LogoNames;
19
+ /** Sets the icon size. */
20
+ size?: IconSizes;
21
+ /** Sets the icon variant type. */
22
+ type?: IconTypes;
26
23
  }
27
24
  /**
28
25
  * Renders SVG-based icons.
@@ -34,5 +34,9 @@ declare const _default: {
34
34
  snfl_negative: string;
35
35
  snfl_positive: string;
36
36
  speaker_notes: string;
37
+ utility_account_filled: string;
38
+ utility_account_unfilled: string;
39
+ utility_hamburger: string;
40
+ utility_search: string;
37
41
  };
38
42
  export default _default;
@@ -1,67 +1,85 @@
1
- export declare enum IconRotationTypes {
2
- rotate0 = "rotate-0",
3
- rotate90 = "rotate-90",
4
- rotate180 = "rotate-180",
5
- rotate270 = "rotate-270"
1
+ export declare enum IconAlign {
2
+ Left = "left",
3
+ Right = "right",
4
+ None = "none"
6
5
  }
7
- export declare enum IconNames {
8
- accessibility_full = "accessibility_full",
9
- accessibility_partial = "accessibility_partial",
10
- arrow = "arrow",
11
- check = "check",
12
- clock = "clock",
13
- close = "close",
14
- download = "download",
15
- error_filled = "error_filled",
16
- error_outline = "error_outline",
17
- headset = "headset",
18
- minus = "minus",
19
- plus = "plus",
20
- search = "search",
21
- speaker_notes = "speaker_notes"
6
+ export declare enum IconTypes {
7
+ Default = "default",
8
+ Breadcrumbs = "breadcrumbs"
22
9
  }
23
- export declare enum LogoNames {
24
- brooklyn = "brooklyn",
25
- logo_brooklyn = "logo_brooklyn",
26
- logo_nypl = "logo_nypl",
27
- logo_nypl_negative = "logo_nypl_negative",
28
- logo_queens = "logo_queens",
29
- lpa_negative = "lpa_negative",
30
- lpa_positive = "lpa_positive",
31
- nypl_circle_negative = "nypl_circle_negative",
32
- nypl_circle_positive = "nypl_circle_positive",
33
- nypl_full_lock_up_negative = "nypl_full_lock_up_negative",
34
- nypl_full_lock_up = "nypl_full_lock_up",
35
- nypl_no_lion_negative = "nypl_no_lion_negative",
36
- nypl_no_lion_positive = "nypl_no_lion_positive",
37
- queens_long = "queens_long",
38
- queens_stacked = "queens_stacked",
39
- schomburg_circle = "schomburg_circle",
40
- schomburg_positive = "schomburg_positive",
41
- simplye_black = "simplye_black",
42
- simplye_color = "simplye_color",
43
- snfl_negative = "snfl_negative",
44
- snfl_positive = "snfl_positive"
10
+ export declare enum IconRotationTypes {
11
+ Rotate0 = "rotate0",
12
+ Rotate90 = "rotate90",
13
+ Rotate180 = "rotate180",
14
+ Rotate270 = "rotate270"
45
15
  }
46
16
  export declare enum IconColors {
47
- ui_black = "ui-black",
48
- ui_white = "ui-white",
49
- brand_primary = "brand-primary",
50
- brand_secondary = "brand-secondary",
51
- section_whats_on_primary = "section-whats-on-primary",
52
- section_books_and_more_primary = "section-books-and-more-primary",
53
- section_research_primary = "section-research-primary",
54
- section_research_secondary = "section-research-secondary",
55
- section_locations_primary = "section-locations-primary",
56
- section_research_library_lpa = "section-research-library-lpa",
57
- section_research_library_schomburg = "section-research-library-schomburg",
58
- section_research_library_schwartzman = "section-research-library-schwartzman"
17
+ UiBlack = "ui.black",
18
+ UiWhite = "ui.white",
19
+ BrandPrimary = "brand.primary",
20
+ BrandSecondary = "brand.secondary",
21
+ SectionWhatsOnPrimary = "section.whats-on.primary",
22
+ SectionWhatsOnSecondary = "section.whats-on.secondary",
23
+ SectionBooksAndMorePrimary = "section.books-and-more.primary",
24
+ SectionBooksAndMoreSecondary = "section.books-and-more.secondary",
25
+ SectionResearchPrimary = "section.research.primary",
26
+ SectionResearchSecondary = "section.research.secondary",
27
+ SectionLocationsPrimary = "section.locations.primary",
28
+ SectionLocationsSecondary = "section.locations.secondary",
29
+ SectionBlogsPrimary = "section.blogs.primary",
30
+ SectionBlogsSecondary = "section.blogs.secondary",
31
+ SectionResearchLibraryLpa = "section.research-library.lpa",
32
+ SectionResearchLibrarySchomburg = "section.research-library.schomburg",
33
+ SectionResearchLibrarySchwartzman = "section.research-library.schwartzman"
59
34
  }
60
35
  export declare enum IconSizes {
61
- small = "small",
62
- medium = "medium",
63
- large = "large",
64
- xlarge = "xlarge",
65
- xxlarge = "xxlarge",
66
- xxxlarge = "xxxlarge"
36
+ Small = "small",
37
+ Medium = "medium",
38
+ Large = "large",
39
+ ExtraLarge = "xlarge",
40
+ ExtraExtraLarge = "xxlarge",
41
+ ExtraExtraExtraLarge = "xxxlarge"
42
+ }
43
+ export declare enum IconNames {
44
+ AccessibilityFull = "accessibility_full",
45
+ AccessibilityPartial = "accessibility_partial",
46
+ Arrow = "arrow",
47
+ Check = "check",
48
+ Clock = "clock",
49
+ Close = "close",
50
+ Download = "download",
51
+ ErrorFilled = "error_filled",
52
+ ErrorOutline = "error_outline",
53
+ Headset = "headset",
54
+ Minus = "minus",
55
+ Plus = "plus",
56
+ Search = "search",
57
+ SpeakerNotes = "speaker_notes",
58
+ UtilityAccountFilled = "utility_account_filled",
59
+ UtilityAccountUnfilled = "utility_account_unfilled",
60
+ UtilityHamburger = "utility_hamburger",
61
+ UtilitySearch = "utility_search"
62
+ }
63
+ export declare enum LogoNames {
64
+ Brooklyn = "brooklyn",
65
+ LogoBrooklyn = "logo_brooklyn",
66
+ LogoNypl = "logo_nypl",
67
+ LogoNyplNegative = "logo_nypl_negative",
68
+ LogoQueens = "logo_queens",
69
+ LpaNegative = "lpa_negative",
70
+ LpaPositive = "lpa_positive",
71
+ NyplCircleNegative = "nypl_circle_negative",
72
+ NyplCirclePositive = "nypl_circle_positive",
73
+ NyplFullLockUpNegative = "nypl_full_lock_up_negative",
74
+ NyplFullLockUp = "nypl_full_lock_up",
75
+ NyplNoLionNegative = "nypl_no_lion_negative",
76
+ NyplNoLionPositive = "nypl_no_lion_positive",
77
+ QueensLong = "queens_long",
78
+ QueensStacked = "queens_stacked",
79
+ SchomburgCircle = "schomburg_circle",
80
+ SchomburgPositive = "schomburg_positive",
81
+ SimplyeBlack = "simplye_black",
82
+ SimplyeColor = "simplye_color",
83
+ SnflNegative = "snfl_negative",
84
+ SnflPositive = "snfl_positive"
67
85
  }
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  import Image from "./Image";
2
3
  declare const _default: {
3
- title: string;
4
+ title: any;
4
5
  component: typeof Image;
5
6
  };
6
7
  export default _default;
@@ -1,33 +1,17 @@
1
1
  import * as React from "react";
2
- export interface LabelOptions {
3
- labelContent?: JSX.Element;
4
- id?: string;
5
- htmlFor?: string;
6
- }
2
+ declare type optReqFlagType = "Required" | "Optional" | "" | undefined;
7
3
  interface LabelProps {
8
- /** Additional attributes to pass to the <label> tag */
9
- attributes?: {
10
- [key: string]: any;
11
- };
12
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
13
- blockName?: string;
14
- /** className that appears in addition to "label" */
4
+ /** Additional CSS class name to render in the `label` element. */
15
5
  className?: string;
16
- /** The id of the html element that this Label is describing */
17
- htmlFor?: string;
6
+ /** The id of the html element that this `Label` is describing. */
7
+ htmlFor: string;
18
8
  /** ID that other components can cross reference for accessibility purposes */
19
9
  id?: string;
20
- /** Modifiers for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
21
- modifiers?: string[];
22
- /** Displays "Required" or "Optional" string alongside label */
23
- optReqFlag?: string;
10
+ /** Displays "Required" or "Optional" string alongside the label */
11
+ optReqFlag?: optReqFlagType;
24
12
  }
25
- /** A Label for form inputs.
26
- * It should never be used alone.
13
+ /**
14
+ * A label for form inputs. It should never be used alone.
27
15
  */
28
- export default function Label(props: React.PropsWithChildren<LabelProps>): React.DetailedReactHTMLElement<{
29
- id: string;
30
- htmlFor: string;
31
- className: string;
32
- }, HTMLElement>;
33
- export {};
16
+ declare function Label(props: React.PropsWithChildren<LabelProps>): JSX.Element;
17
+ export default Label;
@@ -5,24 +5,20 @@ export interface LinkProps {
5
5
  attributes?: {
6
6
  [key: string]: any;
7
7
  };
8
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
9
- blockName?: string;
10
- /** className that appears in addition to "link" */
8
+ /** Any child node passed to the component. */
9
+ children: React.ReactNode;
10
+ /** Additional class name to render in the `Link` component. */
11
11
  className?: string;
12
- /** Href attribute */
12
+ /** The `href` attribute for the anchor element. */
13
13
  href?: string;
14
- /** ID */
14
+ /** ID used for accessibility purposes. */
15
15
  id?: string;
16
- /** Controls the link visualsaction, button, or default. */
16
+ /** Controls the link visuals: action, button, backwards, forwards, or default. */
17
17
  type?: LinkTypes;
18
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
19
- modifiers?: string[];
20
- /** Any child node passed to the component. */
21
- children: React.ReactNode;
22
18
  }
23
19
  /**
24
- * A component that uses an `href` prop or a child anchor element, to create an
25
- * anchor element with added styling and conventions.
20
+ * A component that uses an `href` prop or a child anchor element, to create
21
+ * an anchor element with added styling and conventions.
26
22
  */
27
23
  declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
28
24
  export default Link;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const animalCrossingDefinitions: {
2
3
  term: string;
3
4
  definition: string;