@nypl/design-system-react-components 0.25.12 → 0.25.13

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 (194) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/dist/components/Accordion/Accordion.d.ts +5 -3
  3. package/dist/components/Accordion/AccordionTypes.d.ts +5 -0
  4. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  5. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -1
  6. package/dist/components/Card/Card.d.ts +11 -20
  7. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  8. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +4 -2
  9. package/dist/components/Heading/Heading.d.ts +4 -4
  10. package/dist/components/Heading/HeadingTypes.d.ts +1 -1
  11. package/dist/components/Hero/Hero.d.ts +7 -4
  12. package/dist/components/Icons/IconTypes.d.ts +1 -0
  13. package/dist/components/Image/Image.d.ts +25 -7
  14. package/dist/components/Image/ImageTypes.d.ts +4 -4
  15. package/dist/components/Logo/LogoTypes.d.ts +2 -2
  16. package/dist/components/Notification/Notification.d.ts +4 -4
  17. package/dist/components/Radio/Radio.d.ts +1 -1
  18. package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
  19. package/dist/components/Select/Select.d.ts +2 -2
  20. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -3
  21. package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -4
  22. package/dist/components/StructuredContent/StructuredContent.d.ts +9 -22
  23. package/dist/components/Tabs/Tabs.d.ts +3 -3
  24. package/dist/components/Template/Template.d.ts +13 -5
  25. package/dist/components/Text/Text.d.ts +3 -3
  26. package/dist/components/Text/TextTypes.d.ts +1 -1
  27. package/dist/components/TextInput/TextInput.d.ts +2 -2
  28. package/dist/components/Toggle/Toggle.d.ts +6 -7
  29. package/dist/components/Toggle/{ToggleSizes.d.ts → ToggleTypes.d.ts} +1 -1
  30. package/dist/design-system-react-components.cjs.development.js +505 -422
  31. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  32. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  33. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  34. package/dist/design-system-react-components.esm.js +514 -435
  35. package/dist/design-system-react-components.esm.js.map +1 -1
  36. package/dist/helpers/enums.d.ts +4 -0
  37. package/dist/index.d.ts +7 -8
  38. package/dist/theme/components/accordion.d.ts +7 -12
  39. package/dist/theme/components/breadcrumb.d.ts +3 -0
  40. package/dist/theme/components/card.d.ts +4 -4
  41. package/dist/theme/components/checkbox.d.ts +1 -0
  42. package/dist/theme/components/checkboxGroup.d.ts +3 -1
  43. package/dist/theme/components/global.d.ts +2 -1
  44. package/dist/theme/components/hero.d.ts +1 -1
  45. package/dist/theme/components/image.d.ts +1 -1
  46. package/dist/theme/components/notification.d.ts +4 -4
  47. package/dist/theme/components/pagination.d.ts +2 -5
  48. package/dist/theme/components/radio.d.ts +1 -0
  49. package/dist/theme/components/radioGroup.d.ts +3 -1
  50. package/dist/theme/components/select.d.ts +3 -0
  51. package/dist/theme/components/toggle.d.ts +13 -1
  52. package/package.json +1 -1
  53. package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +34 -0
  54. package/src/components/Accordion/Accordion.stories.mdx +150 -66
  55. package/src/components/Accordion/Accordion.test.tsx +44 -17
  56. package/src/components/Accordion/Accordion.tsx +50 -20
  57. package/src/components/Accordion/AccordionTypes.tsx +5 -0
  58. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +244 -2
  59. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +17 -15
  60. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +6 -6
  61. package/src/components/Breadcrumbs/Breadcrumbs.tsx +6 -6
  62. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -1
  63. package/src/components/Card/Card.stories.mdx +236 -165
  64. package/src/components/Card/Card.test.tsx +36 -18
  65. package/src/components/Card/Card.tsx +84 -59
  66. package/src/components/Card/__snapshots__/Card.test.tsx.snap +25 -65
  67. package/src/components/Chakra/Center.stories.mdx +2 -2
  68. package/src/components/Checkbox/Checkbox.stories.mdx +13 -1
  69. package/src/components/Checkbox/Checkbox.test.tsx +58 -2
  70. package/src/components/Checkbox/Checkbox.tsx +6 -1
  71. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +76 -0
  72. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +73 -9
  73. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +79 -9
  74. package/src/components/CheckboxGroup/CheckboxGroup.tsx +10 -7
  75. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +169 -0
  76. package/src/components/ComponentWrapper/ComponentWrapper.tsx +1 -1
  77. package/src/components/DatePicker/DatePicker.test.tsx +5 -2
  78. package/src/components/DatePicker/DatePicker.tsx +5 -2
  79. package/src/components/Form/Form.stories.mdx +47 -9
  80. package/src/components/Form/Form.test.tsx +1 -1
  81. package/src/components/Form/Form.tsx +3 -1
  82. package/src/components/Grid/SimpleGrid.stories.mdx +53 -35
  83. package/src/components/Grid/SimpleGrid.test.tsx +15 -9
  84. package/src/components/Heading/Heading.stories.mdx +21 -23
  85. package/src/components/Heading/Heading.test.tsx +7 -7
  86. package/src/components/Heading/Heading.tsx +10 -14
  87. package/src/components/Heading/HeadingTypes.tsx +1 -1
  88. package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +1 -1
  89. package/src/components/Hero/Hero.stories.mdx +27 -27
  90. package/src/components/Hero/Hero.test.tsx +113 -58
  91. package/src/components/Hero/Hero.tsx +43 -20
  92. package/src/components/HorizontalRule/HorizontalRule.test.tsx +6 -4
  93. package/src/components/HorizontalRule/HorizontalRule.tsx +3 -2
  94. package/src/components/Icons/Icon.stories.mdx +50 -18
  95. package/src/components/Icons/Icon.test.tsx +13 -2
  96. package/src/components/Icons/Icon.tsx +11 -6
  97. package/src/components/Icons/IconTypes.tsx +1 -0
  98. package/src/components/Image/Image.stories.mdx +133 -68
  99. package/src/components/Image/Image.test.tsx +32 -48
  100. package/src/components/Image/Image.tsx +46 -26
  101. package/src/components/Image/ImageTypes.ts +4 -4
  102. package/src/components/Image/__snapshots__/Image.test.tsx.snap +60 -13
  103. package/src/components/Link/Link.tsx +8 -1
  104. package/src/components/List/List.stories.mdx +1 -1
  105. package/src/components/List/List.test.tsx +7 -4
  106. package/src/components/List/List.tsx +7 -4
  107. package/src/components/Logo/Logo.stories.mdx +13 -13
  108. package/src/components/Logo/Logo.test.tsx +12 -2
  109. package/src/components/Logo/Logo.tsx +10 -5
  110. package/src/components/Logo/LogoTypes.tsx +1 -1
  111. package/src/components/Notification/Notification.stories.mdx +5 -5
  112. package/src/components/Notification/Notification.tsx +10 -10
  113. package/src/components/Pagination/Pagination.stories.mdx +4 -3
  114. package/src/components/Pagination/Pagination.test.tsx +30 -2
  115. package/src/components/Pagination/Pagination.tsx +6 -3
  116. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +1 -1
  117. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +6 -2
  118. package/src/components/ProgressIndicator/ProgressIndicator.tsx +3 -1
  119. package/src/components/Radio/Radio.stories.mdx +13 -1
  120. package/src/components/Radio/Radio.test.tsx +56 -2
  121. package/src/components/Radio/Radio.tsx +6 -1
  122. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +61 -0
  123. package/src/components/RadioGroup/RadioGroup.stories.mdx +73 -9
  124. package/src/components/RadioGroup/RadioGroup.test.tsx +72 -7
  125. package/src/components/RadioGroup/RadioGroup.tsx +10 -7
  126. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +140 -0
  127. package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
  128. package/src/components/SearchBar/SearchBar.tsx +3 -3
  129. package/src/components/Select/Select.stories.mdx +26 -16
  130. package/src/components/Select/Select.test.tsx +1 -36
  131. package/src/components/Select/Select.tsx +4 -16
  132. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +12 -14
  133. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +6 -8
  134. package/src/components/SkeletonLoader/SkeletonLoader.tsx +5 -7
  135. package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
  136. package/src/components/Slider/Slider.stories.mdx +41 -8
  137. package/src/components/Slider/Slider.tsx +4 -4
  138. package/src/components/StatusBadge/StatusBadge.test.tsx +3 -1
  139. package/src/components/StatusBadge/StatusBadge.tsx +1 -1
  140. package/src/components/StructuredContent/StructuredContent.stories.mdx +103 -54
  141. package/src/components/StructuredContent/StructuredContent.test.tsx +129 -102
  142. package/src/components/StructuredContent/StructuredContent.tsx +43 -53
  143. package/src/components/StyleGuide/ColorCard.tsx +3 -3
  144. package/src/components/StyleGuide/Typography.stories.mdx +17 -12
  145. package/src/components/Table/Table.test.tsx +1 -1
  146. package/src/components/Table/Table.tsx +3 -1
  147. package/src/components/Tabs/Tabs.stories.mdx +8 -8
  148. package/src/components/Tabs/Tabs.test.tsx +13 -11
  149. package/src/components/Tabs/Tabs.tsx +18 -15
  150. package/src/components/Template/Template.stories.mdx +62 -25
  151. package/src/components/Template/Template.test.tsx +35 -5
  152. package/src/components/Template/Template.tsx +26 -13
  153. package/src/components/Template/__snapshots__/Template.test.tsx.snap +4 -2
  154. package/src/components/Text/Text.stories.mdx +13 -15
  155. package/src/components/Text/Text.test.tsx +6 -15
  156. package/src/components/Text/Text.tsx +7 -12
  157. package/src/components/Text/TextTypes.tsx +1 -1
  158. package/src/components/TextInput/TextInput.stories.mdx +9 -9
  159. package/src/components/TextInput/TextInput.test.tsx +28 -27
  160. package/src/components/TextInput/TextInput.tsx +4 -4
  161. package/src/components/Toggle/Toggle.stories.mdx +12 -22
  162. package/src/components/Toggle/Toggle.test.tsx +15 -2
  163. package/src/components/Toggle/Toggle.tsx +8 -9
  164. package/src/components/Toggle/{ToggleSizes.tsx → ToggleTypes.tsx} +1 -1
  165. package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +64 -0
  166. package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -6
  167. package/src/components/VideoPlayer/VideoPlayer.tsx +14 -7
  168. package/src/docs/{Intro.stories.mdx → Welcome.stories.mdx} +5 -9
  169. package/src/{components/Card/CardTypes.tsx → helpers/enums.ts} +2 -2
  170. package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
  171. package/src/hooks/useCarouselStyles.stories.mdx +10 -0
  172. package/src/hooks/useNYPLTheme.ts +1 -1
  173. package/src/index.ts +7 -14
  174. package/src/theme/components/accordion.ts +7 -12
  175. package/src/theme/components/breadcrumb.ts +3 -0
  176. package/src/theme/components/card.ts +29 -20
  177. package/src/theme/components/checkboxGroup.ts +3 -1
  178. package/src/theme/components/global.ts +4 -3
  179. package/src/theme/components/hero.ts +1 -1
  180. package/src/theme/components/icon.ts +5 -2
  181. package/src/theme/components/image.ts +1 -1
  182. package/src/theme/components/list.ts +1 -1
  183. package/src/theme/components/notification.ts +5 -5
  184. package/src/theme/components/pagination.ts +2 -5
  185. package/src/theme/components/progressIndicator.ts +3 -3
  186. package/src/theme/components/radioGroup.ts +3 -1
  187. package/src/theme/components/select.ts +6 -0
  188. package/src/theme/components/toggle.ts +26 -3
  189. package/src/utils/componentCategories.ts +27 -19
  190. package/dist/components/Card/CardTypes.d.ts +0 -4
  191. package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +0 -4
  192. package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +0 -4
  193. package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +0 -4
  194. package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +0 -4
package/CHANGELOG.md CHANGED
@@ -8,9 +8,71 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
8
8
 
9
9
  ## Prerelease
10
10
 
11
+ ## 0.25.13 (April 1, 2022)
12
+
13
+ ### Adds
14
+
15
+ - Adds a `contentId` prop to the `TemplateAppContainer` component and adds an `id` prop to the `TemplateContent` component. The default value of these `id`s are both set to "mainContent" and it will render as an attribute on the `main` HTML element. This is used as the target for the skip navigation link in consuming applications.
16
+ - Adds an `Accessibility Guide` section to Storybook with a "Skip Navigation" page.
17
+ - Adds the `isFullWidth` prop to the `CheckboxGroup` and `RadioGroup` components. This sets the wrapper element to be full width for labels that need to span its container.
18
+ - Adds an optional key – `accordionType` to the `Accordion`'s `contentData` prop, which allows users to switch the background color of the `Accordion`'s button.
19
+ - Created new `LayoutTypes` enum for row and column layouts.
20
+ - Adds the value "Default" to the `IconSizes` enum.
21
+
22
+ ### Changes
23
+
24
+ - Updates Storybook's sidebar categories and documentation.
25
+ - Updates the `Image`'s caption font size to "12px" (`text.tag`).
26
+ - Updates the `Checkbox`'s and `Radio`'s `labelText` prop to accept strings and JSX Elements.
27
+ - Updates the `Toggle`'s internal styling for the default and small sizes.
28
+ - Updates the `Accordion` button's background color when expanded, adds a border color when hovered over, and adjusts the padding.
29
+ - Updates the `CardImage`'s margin bottom in the row and column layouts for mobile to be the same.
30
+ - Updates the `CardImage` to have width 100% on mobile regardless of size.
31
+ - Updates all the console warnings with consistent NYPL branding prefix label.
32
+ - Renames the `Accordion` prop `contentData` to `accordionData`.
33
+ - Renames the `Breadcrumbs` prop `colorVariant` to `breadcrumbsType`.
34
+ - Renames the `Card` prop `center` to `isCentered`.
35
+ - Updates the `Card` prop `layout` to use the `LayoutTypes` enum instead of `CardLayouts`.
36
+ - Updates the `CheckboxGroup` prop `layout` to use the `LayoutTypes` enum instead of `CheckboxGroupLayoutTypes`.
37
+ - Renames the `Heading` prop `displaySize` to `size.
38
+ - Renames the `HeadingDisplaySizes` enum to `HeadingSizes.
39
+ - Renames the `Hero` prop `image` to `imageComponent`.
40
+ - Renames the `Image` prop `imageSize` to `size`.
41
+ - Renames the `Notification` prop `centered` to `isCentered`.
42
+ - Updates the `RadioGroup` prop `layout` to use the `LayoutTypes` enum instead of `RadioGroupLayoutTypes`.
43
+ - Internal updates to the `SearchBar` component based on updates from the `Select` and `TextInput` components.
44
+ - Renames the `Select` prop `type` to `selectType`.
45
+ - Updates the `SkeletonLoader` prop `layout` to use the `LayoutTypes` enum instead of `SkeletonLoaderLayouts`.
46
+ - Renames the `StructuredContentImage` prop `imageSize` to `size` (this component is based on the `Image` component).
47
+ - Internal updates to the `StructuredContent` component based on updates from the `Image` and `Heading` components.
48
+ - Renames the `Tabs` prop `contentData` to `tabsData`.
49
+ - Renames the `Text` prop `displaySize` to `size`.
50
+ - Renames the `TextInput` prop `variant` to `textInputType`.
51
+ - Updates the `Card` image-related props into one main prop named `imageProps`. This new prop contains the following properties: alt, aspectRatio, caption, component, credit, isAtEnd, size, and src.
52
+ - Updates the `Hero` prop `image` to `imageAlt` and `imageSrc`. Internally, an `Image` component is created.
53
+ - Renames the `Image` component props `imageAspectRatio` to `aspectRatio`, `imageCaption` to `caption`, and `imageCredit` to `credit`.
54
+ - Updates the `StructuredContent` image-related props into one main prop named `imageProps`. This new prop contains the following properties: alt, aspectRatio, caption, component, credit, position, size, and src.
55
+ - Renames the `ToggleSizes.tsx` file to `ToggleTypes.tsx`. Updates the values from `Large` and `Small` to `Default` and `Small`.
56
+ - Minor update to the logic for the `ProgressIndicator` sizing prop and styles.
57
+
58
+ ### Fixes
59
+
60
+ - Fixes bug where the Next button in `Pagination` would navigate to the previous page.
61
+ - Fixes the alignment of the first link in the `Pagination` component.
62
+ - Fixes the `Breadcrumbs`' SVG arrow icon fill color for the "Blogs" variant.
63
+ - Fixes the margin right value for list items in the `List` component for the inline style.
64
+ - Fixes bug in the `Select` component where the SVG arrow hides when the component is focused.
65
+ - Fixes the extra bottom spacing in the `HeroTypes.Campaign` `Hero` variant for the mobile view.
66
+ - Fixes the `Slider` component so it doesn't cause a stack overflow client-side issue when updating the slider thumbs through the keyboard arrows. The values are now returned through Chakra's `onChange` callback instead of the `onChangeEnd` callback.
67
+
68
+ ### Removals
69
+
70
+ - Removes the `CardLayouts`, `CheckboxGroupLayoutTypes`, `RadioGroupLayoutTypes`, and `SkeletonLoaderLayouts` enums.
71
+ - Removes the `CardTypes.tsx`,` CheckboxGroupLayoutTypes.tsx`, and `RadioGroupLayoutTypes.tsx` files.
72
+
11
73
  ## 0.25.12 (March 18, 2022)
12
74
 
13
- ## Adds
75
+ ### Adds
14
76
 
15
77
  - Adds `Education` section colors to the color palette theme object.
16
78
  - Adds a `currentPage` prop to the `Pagination` component, a value that updates the selected page programmatically without the user explicitly requesting it.
@@ -1,11 +1,13 @@
1
1
  import * as React from "react";
2
- export interface AccordionContentDataProps {
2
+ import { AccordionTypes } from "./AccordionTypes";
3
+ export interface AccordionDataProps {
4
+ accordionType?: AccordionTypes;
3
5
  label: string;
4
6
  panel: string | React.ReactNode;
5
7
  }
6
8
  export interface AccordionProps {
7
- /** Array of data to display */
8
- contentData: AccordionContentDataProps[];
9
+ /** Array of data to display, and an optional accordionType */
10
+ accordionData: AccordionDataProps[];
9
11
  /** ID that other components can cross reference for accessibility purposes */
10
12
  id?: string;
11
13
  /** Whether the accordion is open by default only on its initial rendering */
@@ -0,0 +1,5 @@
1
+ export declare enum AccordionTypes {
2
+ Default = "default",
3
+ Warning = "warning",
4
+ Error = "error"
5
+ }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { ColorVariants } from "./BreadcrumbsTypes";
2
+ import { BreadcrumbsTypes } from "./BreadcrumbsTypes";
3
3
  export interface BreadcrumbsDataProps {
4
4
  url: string;
5
5
  text: string | React.ReactNode;
@@ -11,12 +11,12 @@ export interface BreadcrumbProps {
11
11
  };
12
12
  /** Breadcrumb links as an array */
13
13
  breadcrumbsData: BreadcrumbsDataProps[];
14
+ /** Used to control how the `Hero` component will be rendered. */
15
+ breadcrumbsType?: BreadcrumbsTypes;
14
16
  /** className you can add in addition to 'input' */
15
17
  className?: string;
16
18
  /** ID that other components can cross reference for accessibility purposes */
17
19
  id?: string;
18
- /** Used to control how the `Hero` component will be rendered. */
19
- colorVariant?: ColorVariants;
20
20
  }
21
21
  declare function Breadcrumbs(props: React.PropsWithChildren<BreadcrumbProps>): JSX.Element;
22
22
  export default Breadcrumbs;
@@ -1,4 +1,4 @@
1
- export declare enum ColorVariants {
1
+ export declare enum BreadcrumbsTypes {
2
2
  Blogs = "blogs",
3
3
  BooksAndMore = "booksAndMore",
4
4
  Education = "education",
@@ -1,18 +1,22 @@
1
1
  import * as React from "react";
2
- import { CardLayouts } from "./CardTypes";
2
+ import { LayoutTypes } from "../../helpers/enums";
3
3
  import Heading from "../Heading/Heading";
4
- import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
4
+ import { ComponentImageProps } from "../Image/Image";
5
5
  interface CardBaseProps {
6
6
  /** Optional value to control the alignment of the text and elements. */
7
- center?: boolean;
7
+ isCentered?: boolean;
8
8
  /** Optional value to render the layout in a row or column.
9
- * Default is `CardLayouts.Column`. */
10
- layout?: CardLayouts;
9
+ * Default is `LayoutTypes.Column`. */
10
+ layout?: LayoutTypes;
11
11
  }
12
12
  interface CardLinkBoxProps {
13
13
  /** Main link to use when the full `Card` component should be clickable. */
14
14
  mainActionLink?: string;
15
15
  }
16
+ interface CardImageProps extends ComponentImageProps {
17
+ /** Optional boolean value to control the position of the `CardImage`. */
18
+ isAtEnd?: boolean;
19
+ }
16
20
  interface CardActionsProps extends CardBaseProps {
17
21
  /** Optional boolean value to control visibility of border on the bottom edge
18
22
  * of the card actions element */
@@ -33,21 +37,8 @@ export interface CardProps extends CardBaseProps, CardLinkBoxProps {
33
37
  foregroundColor?: string;
34
38
  /** ID that other components can cross reference for accessibility purposes. */
35
39
  id?: string;
36
- /** Text description of the image; to follow best practices for accessibility,
37
- * this prop should not be left blank if `imageSrc` is passed. */
38
- imageAlt?: string;
39
- /** Optional value to control the aspect ratio of the `CardImage`; default
40
- * value is `ImageRatios.Square`. */
41
- imageAspectRatio?: ImageRatios;
42
- /** Optional boolean value to control the position of the `CardImage`. */
43
- imageAtEnd?: boolean;
44
- /** Custom image component used in place of DS `Image` component. */
45
- imageComponent?: JSX.Element;
46
- /** Optional value to control the size of the `CardImage`. Default value is
47
- * `ImageSizes.Default`. */
48
- imageSize?: ImageSizes;
49
- /** The path to the image displayed within the `Card` component. */
50
- imageSrc?: string;
40
+ /** Object used to create and render the `Image` component. */
41
+ imageProps?: CardImageProps;
51
42
  }
52
43
  export declare const CardHeading: typeof Heading;
53
44
  export declare function CardContent(props: React.PropsWithChildren<{}>): JSX.Element;
@@ -27,7 +27,7 @@ export interface CheckboxProps {
27
27
  isRequired?: boolean;
28
28
  /** The checkbox's label. This will serve as the text content for a `<label>`
29
29
  * element if `showlabel` is true, or an "aria-label" if `showLabel` is false. */
30
- labelText: string;
30
+ labelText: string | JSX.Element;
31
31
  /** The name prop indicates into which group of checkboxes this checkbox
32
32
  * belongs. If none is specified, 'default' will be used */
33
33
  name?: string;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { CheckboxGroupLayoutTypes } from "./CheckboxGroupLayoutTypes";
3
2
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ import { LayoutTypes } from "../../helpers/enums";
4
4
  export interface CheckboxGroupProps {
5
5
  /** Any child node passed to the component. */
6
6
  children: React.ReactNode;
@@ -14,6 +14,8 @@ export interface CheckboxGroupProps {
14
14
  invalidText?: HelperErrorTextType;
15
15
  /** Adds the 'disabled' prop to the input when true. */
16
16
  isDisabled?: boolean;
17
+ /** Set's the `Checkbox`s' wrapper to be full width. */
18
+ isFullWidth?: boolean;
17
19
  /** A`dds the 'aria-invalid' attribute to the input and
18
20
  * sets the error state when true. */
19
21
  isInvalid?: boolean;
@@ -23,7 +25,7 @@ export interface CheckboxGroupProps {
23
25
  * true, or an "aria-label" if `showLabel` is false. */
24
26
  labelText: string;
25
27
  /** Renders the checkbox buttons in a row or column (default). */
26
- layout?: CheckboxGroupLayoutTypes;
28
+ layout?: LayoutTypes;
27
29
  /** The `name` prop indicates the form group for all the `Checkbox` children. */
28
30
  name: string;
29
31
  /** The action to perform on the `<input>`'s onChange function */
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { HeadingDisplaySizes, HeadingLevels } from "./HeadingTypes";
2
+ import { HeadingSizes, HeadingLevels } from "./HeadingTypes";
3
3
  export interface HeadingProps {
4
4
  /** Optionally pass in additional Chakra-based styles. */
5
5
  additionalStyles?: {
@@ -7,14 +7,14 @@ export interface HeadingProps {
7
7
  };
8
8
  /** Optional className that appears in addition to `heading` */
9
9
  className?: string;
10
- /** Optional size used to override the default styles of the semantic HTM
11
- * `<h>` elements */
12
- displaySize?: HeadingDisplaySizes;
13
10
  /** Optional ID that other components can cross reference for accessibility purposes */
14
11
  id?: string;
15
12
  /** Optional number 1-6 used to create the `<h*>` tag; if prop is not passed,
16
13
  * `Heading` will default to `<h2>` */
17
14
  level?: HeadingLevels;
15
+ /** Optional size used to override the default styles of the semantic HTM
16
+ * `<h>` elements */
17
+ size?: HeadingSizes;
18
18
  /** Inner text of the `<h*>` element */
19
19
  text?: string;
20
20
  /** Optional URL that header points to; when `url` prop is passed to
@@ -1,4 +1,4 @@
1
- export declare enum HeadingDisplaySizes {
1
+ export declare enum HeadingSizes {
2
2
  Primary = "primary",
3
3
  Secondary = "secondary",
4
4
  Tertiary = "tertiary",
@@ -17,11 +17,14 @@ export interface HeroProps {
17
17
  heading?: JSX.Element;
18
18
  /** Used to control how the `Hero` component will be rendered. */
19
19
  heroType?: HeroTypes;
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.
20
+ /** Text description of the image; to follow best practices for accessibility,
21
+ * this prop should not be left blank if `imageSrc` is passed. */
22
+ imageAlt?: string;
23
+ /** Optional `imageSrc` used for SECONDARY, FIFTYFIFTY and CAMPAIGN
24
+ * `Hero` types; Note: `imageSrc` can only be used in conjunction with
25
+ * `backgroundImageSrc` for the CAMPAIGN `Hero` type.
23
26
  * Note: not all `Hero` variations utilize this prop. */
24
- image?: JSX.Element;
27
+ imageSrc?: string;
25
28
  /** Optional details area that contains location data.
26
29
  * Note: not all `Hero` variations utilize this prop. */
27
30
  locationDetails?: JSX.Element;
@@ -35,6 +35,7 @@ export declare enum IconColors {
35
35
  SectionWhatsOnSecondary = "section.whats-on.secondary"
36
36
  }
37
37
  export declare enum IconSizes {
38
+ Default = "default",
38
39
  Small = "small",
39
40
  Medium = "medium",
40
41
  Large = "large",
@@ -1,5 +1,25 @@
1
1
  /// <reference types="react" />
2
2
  import { ImageRatios, ImageSizes, ImageTypes } from "./ImageTypes";
3
+ export interface ComponentImageProps {
4
+ /** String value used to populate the `alt` attribute of the internal `Image`
5
+ * component's `img` element. @NOTE if an image is used, this value must be passed. */
6
+ alt?: string;
7
+ /** Optional value to control the aspect ratio of the internal `Image` component.
8
+ * Defaults to `ImageRatios.Square`. */
9
+ aspectRatio?: ImageRatios;
10
+ /** Optional value to render as a caption for the internal `Image` component. */
11
+ caption?: string;
12
+ /** Optional DOM element to use instead of the DS `Image` component. */
13
+ component?: JSX.Element;
14
+ /** Optional value to render as a credit for the internal `Image` component. */
15
+ credit?: string;
16
+ /** Optional value to control the size of the internal `Image` component.
17
+ * Defaults to `ImageSizes.Medium`. */
18
+ size?: ImageSizes;
19
+ /** Optional value that contains the path to an image. If omitted, the internal
20
+ * DS `Image` component will not render. */
21
+ src?: string;
22
+ }
3
23
  interface ImageWrapperProps {
4
24
  /** Optionally pass in additional Chakra-based styles. */
5
25
  additionalWrapperStyles?: {
@@ -8,9 +28,9 @@ interface ImageWrapperProps {
8
28
  /** ClassName you can add in addition to 'image' */
9
29
  className?: string;
10
30
  /** Optional value to control the aspect ratio of the cartd image; default value is `square` */
11
- imageAspectRatio?: ImageRatios;
31
+ aspectRatio?: ImageRatios;
12
32
  /** Optional value to control the size of the image */
13
- imageSize?: ImageSizes;
33
+ size?: ImageSizes;
14
34
  }
15
35
  export interface ImageProps extends ImageWrapperProps {
16
36
  /** Optionally pass in additional Chakra-based styles only for the figure. */
@@ -23,14 +43,12 @@ export interface ImageProps extends ImageWrapperProps {
23
43
  };
24
44
  /** Alternate text description of the image */
25
45
  alt: string;
46
+ /** Adding will wrap the image in a <figure> */
47
+ caption?: string;
26
48
  /** Custom image component */
27
49
  component?: JSX.Element | null;
28
50
  /** Adding will wrap the image in a <figure> */
29
- imageCaption?: string;
30
- /** Adding will wrap the image in a <figure> */
31
- imageCredit?: string;
32
- /** Optional value to control the size of the image */
33
- imageSize?: ImageSizes;
51
+ credit?: string;
34
52
  /** Optional value for the image type */
35
53
  imageType?: ImageTypes;
36
54
  /** The src attribute is required, and contains the path to the image you want to embed. */
@@ -10,11 +10,11 @@ export declare enum ImageRatios {
10
10
  }
11
11
  export declare enum ImageSizes {
12
12
  Default = "default",
13
- Large = "large",
14
- Medium = "medium",
15
- Small = "small",
13
+ ExtraExtraSmall = "xxsmall",
16
14
  ExtraSmall = "xsmall",
17
- ExtraExtraSmall = "xxsmall"
15
+ Small = "small",
16
+ Medium = "medium",
17
+ Large = "large"
18
18
  }
19
19
  export declare enum ImageTypes {
20
20
  Default = "default",
@@ -4,12 +4,12 @@ export declare enum LogoColors {
4
4
  UiWhite = "ui.white"
5
5
  }
6
6
  export declare enum LogoSizes {
7
+ Default = "default",
7
8
  ExtraExtraSmall = "xxsmall",
8
9
  ExtraSmall = "xsmall",
9
10
  Small = "small",
10
11
  Medium = "medium",
11
- Large = "large",
12
- Default = "default"
12
+ Large = "large"
13
13
  }
14
14
  export declare enum LogoNames {
15
15
  BrooklynPublicLibraryBlack = "logo_bpl_black",
@@ -3,18 +3,18 @@ import { NotificationTypes } from "./NotificationTypes";
3
3
  interface BaseProps {
4
4
  /** Optional prop to control text alignment in `NotificationContent` */
5
5
  alignText?: boolean;
6
- /** Optional prop to control horizontal alignment of the `Notification` content */
7
- centered?: boolean;
8
6
  /** Optional custom `Icon` that will override the default `Icon`. */
9
7
  icon?: JSX.Element;
10
8
  /** ID that other components can cross reference for accessibility purposes. */
11
9
  id?: string;
10
+ /** Optional prop to control horizontal alignment of the `Notification` content */
11
+ isCentered?: boolean;
12
12
  /** Optional prop to control the coloring of the `Notification` text and the
13
13
  * visibility of an applicable icon. */
14
14
  notificationType?: NotificationTypes;
15
15
  }
16
16
  declare type BasePropsWithoutAlignText = Omit<BaseProps, "alignText">;
17
- declare type BasePropsWithoutCentered = Omit<BaseProps, "centered">;
17
+ declare type BasePropsWithoutIsCentered = Omit<BaseProps, "isCentered">;
18
18
  export interface NotificationProps extends BasePropsWithoutAlignText {
19
19
  /** Label used to describe the `Notification`'s aside HTML element. */
20
20
  ariaLabel?: string;
@@ -41,7 +41,7 @@ export declare function NotificationHeading(props: React.PropsWithChildren<BaseP
41
41
  /**
42
42
  * NotificationContent child-component.
43
43
  */
44
- export declare function NotificationContent(props: React.PropsWithChildren<BasePropsWithoutCentered>): JSX.Element;
44
+ export declare function NotificationContent(props: React.PropsWithChildren<BasePropsWithoutIsCentered>): JSX.Element;
45
45
  /**
46
46
  * Component used to present users with three different levels of notifications:
47
47
  * standard, announcement, and warning.
@@ -28,7 +28,7 @@ export interface RadioProps {
28
28
  /** The radio button's label. This will serve as the text content for the
29
29
  * `<label>` element if `showlabel` is true, or an "aria-label" if `showLabel`
30
30
  * is false. */
31
- labelText: string;
31
+ labelText: string | JSX.Element;
32
32
  /** Used to reference the input element in forms. */
33
33
  name?: string;
34
34
  /** Should be passed along with `isChecked` for controlled components. */
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
- import { RadioGroupLayoutTypes } from "./RadioGroupLayoutTypes";
3
+ import { LayoutTypes } from "../../helpers/enums";
4
4
  export interface RadioGroupProps {
5
5
  /** Additional class name. */
6
6
  className?: string;
@@ -14,6 +14,8 @@ export interface RadioGroupProps {
14
14
  invalidText?: HelperErrorTextType;
15
15
  /** Adds the 'disabled' prop to the input when true. */
16
16
  isDisabled?: boolean;
17
+ /** Set's the `Radio`s' wrapper to be full width. */
18
+ isFullWidth?: boolean;
17
19
  /** Adds the 'aria-invalid' attribute to the input and
18
20
  * sets the error state when true. */
19
21
  isInvalid?: boolean;
@@ -23,7 +25,7 @@ export interface RadioGroupProps {
23
25
  * true, or an "aria-label" if `showLabel` is false. */
24
26
  labelText: string;
25
27
  /** Renders the Radio buttons in a row or column (default). */
26
- layout?: RadioGroupLayoutTypes;
28
+ layout?: LayoutTypes;
27
29
  /** The `name` prop indicates the form group for all the Radio children. */
28
30
  name: string;
29
31
  /** The action to perform on the `<input>`'s onChange function */
@@ -33,6 +33,8 @@ export interface SelectProps {
33
33
  onChange?: (event: React.FormEvent) => void;
34
34
  /** Placeholder text in the select element. */
35
35
  placeholder?: string;
36
+ /** The variant to display. */
37
+ selectType?: SelectTypes;
36
38
  /** Offers the ability to hide the helper/invalid text. */
37
39
  showHelperInvalidText?: boolean;
38
40
  /** Offers the ability to show the select's label onscreen or hide it. Refer
@@ -40,8 +42,6 @@ export interface SelectProps {
40
42
  showLabel?: boolean;
41
43
  /** Whether or not to display the "Required"/"Optional" text in the label text. */
42
44
  showOptReqLabel?: boolean;
43
- /** The variant to display. */
44
- type?: SelectTypes;
45
45
  /** The value of the selected option.
46
46
  * Should be passed along with `onChange` for controlled components. */
47
47
  value?: string;
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
- import { SkeletonLoaderImageRatios, SkeletonLoaderLayouts } from "./SkeletonLoaderTypes";
2
+ import { SkeletonLoaderImageRatios } from "./SkeletonLoaderTypes";
3
+ import { LayoutTypes } from "../../helpers/enums";
3
4
  export interface SkeletonLoaderProps {
4
5
  /** Optional boolean value to control visibility of border around skeleton loader. */
5
6
  border?: boolean;
@@ -15,8 +16,8 @@ export interface SkeletonLoaderProps {
15
16
  * default value is `SkeletonLoaderImageRatios.Square`. */
16
17
  imageAspectRatio?: SkeletonLoaderImageRatios;
17
18
  /** Optional value to control the position of the image placeholder;
18
- * default value is `SkeletonLoaderLayouts.Column`. */
19
- layout?: SkeletonLoaderLayouts;
19
+ * default value is `LayoutTypes.Column`. */
20
+ layout?: LayoutTypes;
20
21
  /** Optional boolean value to control visibility of button placeholder. */
21
22
  showButton?: boolean;
22
23
  /** Optional boolean value to control visibility of content placeholder. */
@@ -1,7 +1,3 @@
1
- export declare enum SkeletonLoaderLayouts {
2
- Row = "row",
3
- Column = "column"
4
- }
5
1
  export declare enum SkeletonLoaderImageRatios {
6
2
  Landscape = "landscape",
7
3
  Portrait = "portrait",
@@ -1,6 +1,11 @@
1
1
  import * as React from "react";
2
- import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
2
+ import { ComponentImageProps } from "../Image/Image";
3
3
  import { StructuredContentImagePosition } from "./StructuredContentTypes";
4
+ interface StructuredContentImageProps extends ComponentImageProps {
5
+ /** Optional value to control the positioning of the internal `Image` component.
6
+ * Defaults to `StructuredContentImagePosition.Left`. */
7
+ position?: StructuredContentImagePosition;
8
+ }
4
9
  export interface StructuredContentProps {
5
10
  /** Optional value to set the text for the callout heading text. */
6
11
  calloutText?: string;
@@ -10,27 +15,8 @@ export interface StructuredContentProps {
10
15
  headingText?: string;
11
16
  /** ID that other components can cross reference for accessibility purposes. */
12
17
  id?: string;
13
- /** String value used to populate the `alt` attribute of the internal `Image`
14
- * component's `img` element. @NOTE if an image is used, this value must be passed. */
15
- imageAlt?: string;
16
- /** Optional value to control the aspect ratio of the internal `Image` component.
17
- * Defaults to `ImageRatios.Square`. */
18
- imageAspectRatio?: ImageRatios;
19
- /** Optional value to render as a caption for the internal `Image` component. */
20
- imageCaption?: string;
21
- /** Optional DOM element to use instead of the DS `Image` component. */
22
- imageComponent?: JSX.Element;
23
- /** Optional value to render as a credit for the internal `Image` component. */
24
- imageCredit?: string;
25
- /** Optional value to control the positioning of the internal `Image` component.
26
- * Defaults to `StructuredContentImagePosition.Left`. */
27
- imagePosition?: StructuredContentImagePosition;
28
- /** Optional value to control the size of the internal `Image` component.
29
- * Defaults to `ImageSizes.Medium`. */
30
- imageSize?: ImageSizes;
31
- /** Optional value that contains the path to an image. If omitted, the internal
32
- * DS `Image` component will not render. */
33
- imageSrc?: string;
18
+ /** Object used to create and render the `Image` component. */
19
+ imageProps?: StructuredContentImageProps;
34
20
  /** Required value to set the text for the body content. */
35
21
  bodyContent: string | JSX.Element;
36
22
  }
@@ -39,3 +25,4 @@ export interface StructuredContentProps {
39
25
  * an image, and body content. All are optional except for body content.
40
26
  */
41
27
  export default function StructuredContent(props: React.PropsWithChildren<StructuredContentProps>): JSX.Element;
28
+ export {};
@@ -1,18 +1,18 @@
1
1
  import * as React from "react";
2
2
  import { Tab, TabList, TabPanels, TabPanel } from "@chakra-ui/react";
3
- export interface TabsContentDataProps {
3
+ export interface TabsDataProps {
4
4
  label: string;
5
5
  content: string | React.ReactNode;
6
6
  }
7
7
  export interface TabsProps {
8
- /** Array of data to display */
9
- contentData?: TabsContentDataProps[];
10
8
  /** The index of the tab to display for controlled situations. */
11
9
  defaultIndex?: number;
12
10
  /** ID that other components can cross reference for accessibility purposes */
13
11
  id?: string;
14
12
  /** The callback function invoked on every tab change event. */
15
13
  onChange?: (index: number) => any;
14
+ /** Array of data to display */
15
+ tabsData?: TabsDataProps[];
16
16
  /** Render a hash in the url for each tab. Only available when data is
17
17
  * passed through the `data` props. */
18
18
  useHash?: boolean;
@@ -15,6 +15,9 @@ export interface TemplateSidebarProps {
15
15
  sidebar?: "none" | "left" | "right";
16
16
  }
17
17
  export interface TemplateContentProps extends TemplateSidebarProps {
18
+ /** ID used for the `main` HTML element. Defaults to "mainContent". Useful
19
+ * anchor for the application skip navigation. */
20
+ id?: string;
18
21
  }
19
22
  export interface TemplateAppContainerProps extends TemplateFooterProps, TemplateHeaderProps, TemplateSidebarProps {
20
23
  /** DOM that will be rendered before the rest of the components in
@@ -22,6 +25,9 @@ export interface TemplateAppContainerProps extends TemplateFooterProps, Template
22
25
  aboveHeader?: React.ReactElement;
23
26
  /** DOM that will be rendered in the `TemplateBreakout` component section. */
24
27
  breakout?: React.ReactElement;
28
+ /** ID used for the `main` HTML element. Defaults to "mainContent". Useful
29
+ * anchor for the application skip navigation. */
30
+ contentId?: string;
25
31
  /** DOM that will be rendered in the `TemplateContentPrimary` component section. */
26
32
  contentPrimary?: React.ReactElement;
27
33
  /** DOM that will be rendered in the `TemplateContentSidebar` component section. */
@@ -63,11 +69,13 @@ declare const TemplateHeader: ({ children, renderHeaderElement, }: React.PropsWi
63
69
  declare const TemplateBreakout: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
64
70
  /**
65
71
  * This component is most useful to render content on the page. This renders an
66
- * HTML `<main>` element and takes a `sidebar` prop with optional "left" or
67
- * "right" values. This will set the correct styling needed for the
68
- * `TemplateContentPrimary` and `TemplateContentSidebar` components. Note that
69
- * `TemplateContentPrimary` and `TemplateContentSidebar` must be ordered
70
- * correctly as children elements for the appropriate styles to take effect.
72
+ * HTML `<main>` element with an id of "mainContent". The "mainContent" id should
73
+ * be used as the consuming application's skip navigation link. The `TemplateContent`
74
+ * component also takes a `sidebar` prop with optional "left" or "right" values.
75
+ * This will set the correct *styling* needed for the `TemplateContentPrimary`
76
+ * and `TemplateContentSidebar` components. Note that `TemplateContentPrimary`
77
+ * and `TemplateContentSidebar` must be ordered correctly as children elements
78
+ * for the appropriate styles to take effect.
71
79
  */
72
80
  declare const TemplateContent: (props: React.PropsWithChildren<TemplateContentProps>) => JSX.Element;
73
81
  /**
@@ -1,16 +1,16 @@
1
1
  import * as React from "react";
2
- import { TextDisplaySizes } from "./TextTypes";
2
+ import { TextSizes } from "./TextTypes";
3
3
  export interface TextProps {
4
4
  /** Additional class name to render in the `Text` component. */
5
5
  className?: string;
6
- /** Optional prop to control the text styling */
7
- displaySize?: TextDisplaySizes;
8
6
  /** Optional prop used to show bolded text */
9
7
  isBold?: boolean;
10
8
  /** Optional prop used to show itlicized text */
11
9
  isItalic?: boolean;
12
10
  /** Optional prop used to remove default spacing */
13
11
  noSpace?: boolean;
12
+ /** Optional prop to control the text styling */
13
+ size?: TextSizes;
14
14
  }
15
15
  declare function Text(props: React.PropsWithChildren<TextProps>): JSX.Element;
16
16
  export default Text;
@@ -1,4 +1,4 @@
1
- export declare enum TextDisplaySizes {
1
+ export declare enum TextSizes {
2
2
  Default = "default",
3
3
  Caption = "caption",
4
4
  Tag = "tag",
@@ -45,12 +45,12 @@ export interface InputProps {
45
45
  showOptReqLabel?: boolean;
46
46
  /** The amount to increase or decrease when using the number type. */
47
47
  step?: number;
48
+ /** FOR INTERNAL DS USE ONLY: the input variant to display. */
49
+ textInputType?: TextInputVariants;
48
50
  /** HTML Input types as defined by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input */
49
51
  type?: TextInputTypes;
50
52
  /** Populates the value of the input/textarea elements */
51
53
  value?: string;
52
- /** FOR INTERNAL DS USE ONLY: the input variant to display. */
53
- variantType?: TextInputVariants;
54
54
  }
55
55
  /**
56
56
  * The type used for `ref`s. We want to extend both `input` and `textarea`