@nypl/design-system-react-components 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/dist/components/Button/Button.d.ts +2 -10
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +22 -0
- package/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +10 -8
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +2 -2
- package/dist/components/Grid/SimpleGrid.d.ts +6 -3
- package/dist/components/Heading/Heading.d.ts +2 -5
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +1 -5
- package/dist/components/Hero/Hero.d.ts +13 -9
- package/dist/components/Icons/Icon.d.ts +6 -5
- package/dist/components/Icons/IconSvgs.d.ts +21 -21
- package/dist/components/Image/Image.d.ts +8 -5
- package/dist/components/Link/Link.d.ts +1 -9
- package/dist/components/List/List.d.ts +7 -11
- package/dist/components/Logo/Logo.d.ts +2 -5
- package/dist/components/Logo/LogoSvgs.d.ts +39 -39
- package/dist/components/Notification/Notification.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +2 -5
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -4
- package/dist/components/SkipNavigation/SkipNavigation.d.ts +17 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +2 -3
- package/dist/components/StructuredContent/StructuredContent.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Template/Template.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +21 -9
- package/dist/components/Toggle/Toggle.d.ts +1 -5
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +856 -1155
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +858 -1220
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/helpers/types.d.ts +1 -0
- package/dist/index.d.ts +26 -47
- package/dist/theme/components/buttonGroup.d.ts +11 -0
- package/dist/theme/components/card.d.ts +104 -8
- package/dist/theme/components/componentWrapper.d.ts +4 -3
- package/dist/theme/components/customTable.d.ts +11 -14
- package/dist/theme/components/fieldset.d.ts +4 -3
- package/dist/theme/components/helperErrorText.d.ts +4 -3
- package/dist/theme/components/hero.d.ts +1 -1
- package/dist/theme/components/horizontalRule.d.ts +4 -3
- package/dist/theme/components/icon.d.ts +47743 -1
- package/dist/theme/components/image.d.ts +563 -10
- package/dist/theme/components/label.d.ts +4 -3
- package/dist/theme/components/list.d.ts +6 -7
- package/dist/theme/components/logo.d.ts +474 -1
- package/dist/theme/components/notification.d.ts +20 -16
- package/dist/theme/components/progressIndicator.d.ts +6 -4
- package/dist/theme/components/select.d.ts +4 -4
- package/dist/theme/components/skeletonLoader.d.ts +14 -10
- package/dist/theme/components/skipNavigation.d.ts +22 -0
- package/dist/theme/components/slider.d.ts +7 -6
- package/dist/theme/components/structuredContent.d.ts +10 -9
- package/dist/theme/components/text.d.ts +7 -1
- package/dist/theme/components/toggle.d.ts +6 -4
- package/dist/theme/provider.d.ts +2 -4
- package/dist/utils/componentCategories.d.ts +1 -1
- package/dist/utils/interfaces.d.ts +5 -0
- package/dist/utils/utils.d.ts +2 -18
- package/package.json +2 -2
- package/src/__tests__/setup.ts +3 -3
- package/src/__tests__/utils/utils.test.ts +1 -23
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +22 -14
- package/src/components/Accordion/Accordion.stories.mdx +43 -44
- package/src/components/Accordion/Accordion.test.tsx +5 -13
- package/src/components/Accordion/Accordion.tsx +14 -18
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +6 -6
- package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
- package/src/components/Autosuggest/Autosuggest.stories.tsx +23 -25
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +21 -37
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +4 -17
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +18 -21
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +1 -100
- package/src/components/Button/Button.stories.mdx +89 -126
- package/src/components/Button/Button.test.tsx +16 -30
- package/src/components/Button/Button.tsx +14 -20
- package/src/components/ButtonGroup/ButtonGroup.stories.mdx +147 -0
- package/src/components/ButtonGroup/ButtonGroup.test.tsx +141 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +99 -0
- package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +117 -0
- package/src/components/Card/Card.stories.mdx +143 -177
- package/src/components/Card/Card.test.tsx +36 -97
- package/src/components/Card/Card.tsx +78 -74
- package/src/components/Chakra/Box.stories.mdx +2 -6
- package/src/components/Chakra/Center.stories.mdx +5 -23
- package/src/components/Chakra/Flex.stories.mdx +4 -6
- package/src/components/Chakra/Stack.stories.mdx +9 -10
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +20 -13
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +6 -17
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -7
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +33 -29
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +0 -11
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +3 -10
- package/src/components/DatePicker/DatePicker.stories.mdx +23 -37
- package/src/components/DatePicker/DatePicker.test.tsx +21 -19
- package/src/components/DatePicker/DatePicker.tsx +57 -49
- package/src/components/Form/Form.stories.mdx +46 -31
- package/src/components/Form/Form.test.tsx +1 -18
- package/src/components/Form/Form.tsx +7 -7
- package/src/components/Grid/SimpleGrid.stories.mdx +73 -49
- package/src/components/Grid/SimpleGrid.test.tsx +7 -9
- package/src/components/Grid/SimpleGrid.tsx +14 -11
- package/src/components/Heading/Heading.stories.mdx +27 -72
- package/src/components/Heading/Heading.test.tsx +18 -44
- package/src/components/Heading/Heading.tsx +7 -10
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -3
- package/src/components/HelperErrorText/HelperErrorText.tsx +1 -5
- package/src/components/Hero/Hero.stories.mdx +219 -216
- package/src/components/Hero/Hero.test.tsx +107 -223
- package/src/components/Hero/Hero.tsx +63 -61
- package/src/components/Icons/Icon.stories.mdx +172 -118
- package/src/components/Icons/Icon.test.tsx +8 -16
- package/src/components/Icons/Icon.tsx +75 -29
- package/src/components/Icons/IconSvgs.tsx +42 -42
- package/src/components/Image/Image.stories.mdx +45 -132
- package/src/components/Image/Image.test.tsx +16 -31
- package/src/components/Image/Image.tsx +28 -12
- package/src/components/Link/Link.stories.mdx +30 -80
- package/src/components/Link/Link.test.tsx +25 -53
- package/src/components/Link/Link.tsx +43 -56
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +1 -2
- package/src/components/List/List.stories.mdx +20 -31
- package/src/components/List/List.test.tsx +24 -43
- package/src/components/List/List.tsx +25 -36
- package/src/components/Logo/Logo.stories.mdx +94 -50
- package/src/components/Logo/Logo.test.tsx +10 -19
- package/src/components/Logo/Logo.tsx +50 -17
- package/src/components/Logo/LogoSvgs.tsx +78 -78
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +4 -4
- package/src/components/Modal/Modal.stories.mdx +8 -9
- package/src/components/Modal/Modal.test.tsx +5 -10
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Notification/Notification.stories.mdx +10 -28
- package/src/components/Notification/Notification.test.tsx +9 -12
- package/src/components/Notification/Notification.tsx +34 -37
- package/src/components/Pagination/Pagination.stories.mdx +2 -2
- package/src/components/Pagination/Pagination.tsx +15 -10
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +27 -53
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +9 -10
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +17 -21
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +0 -10
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/Radio/Radio.tsx +9 -6
- package/src/components/RadioGroup/RadioGroup.stories.mdx +15 -16
- package/src/components/RadioGroup/RadioGroup.test.tsx +2 -8
- package/src/components/RadioGroup/RadioGroup.tsx +28 -24
- package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
- package/src/components/SearchBar/SearchBar.test.tsx +1 -1
- package/src/components/SearchBar/SearchBar.tsx +14 -22
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +0 -12
- package/src/components/Select/Select.stories.mdx +8 -23
- package/src/components/Select/Select.test.tsx +6 -7
- package/src/components/Select/Select.tsx +13 -26
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +17 -56
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -21
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +9 -8
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +33 -33
- package/src/components/SkipNavigation/SkipNavigation.stories.mdx +90 -0
- package/src/components/SkipNavigation/SkipNavigation.test.tsx +63 -0
- package/src/components/SkipNavigation/SkipNavigation.tsx +51 -0
- package/src/components/SkipNavigation/__snapshots__/SkipNavigation.test.tsx.snap +130 -0
- package/src/components/Slider/Slider.stories.mdx +19 -53
- package/src/components/Slider/Slider.test.tsx +2 -2
- package/src/components/Slider/Slider.tsx +10 -12
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +2 -9
- package/src/components/StatusBadge/StatusBadge.stories.mdx +6 -21
- package/src/components/StatusBadge/StatusBadge.test.tsx +2 -3
- package/src/components/StatusBadge/StatusBadge.tsx +3 -10
- package/src/components/StructuredContent/StructuredContent.stories.mdx +30 -58
- package/src/components/StructuredContent/StructuredContent.test.tsx +42 -44
- package/src/components/StructuredContent/StructuredContent.tsx +9 -18
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +9 -23
- package/src/components/StyleGuide/Buttons.stories.mdx +62 -62
- package/src/components/StyleGuide/ColorCard.tsx +2 -4
- package/src/components/StyleGuide/Colors.stories.mdx +7 -8
- package/src/components/StyleGuide/DesignTokens.stories.mdx +5 -7
- package/src/components/StyleGuide/Forms.stories.mdx +0 -1
- package/src/components/StyleGuide/Iconography.stories.mdx +59 -77
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
- package/src/components/StyleGuide/Typography.stories.mdx +15 -18
- package/src/components/Table/Table.stories.mdx +85 -1
- package/src/components/Table/Table.test.tsx +57 -1
- package/src/components/Table/Table.tsx +7 -4
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +121 -0
- package/src/components/Tabs/Tabs.stories.mdx +1 -1
- package/src/components/Tabs/Tabs.test.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +26 -27
- package/src/components/Template/Template.stories.mdx +49 -54
- package/src/components/Template/Template.tsx +9 -3
- package/src/components/Text/Text.stories.mdx +5 -11
- package/src/components/Text/Text.test.tsx +3 -6
- package/src/components/Text/Text.tsx +3 -5
- package/src/components/TextInput/TextInput.stories.mdx +10 -22
- package/src/components/TextInput/TextInput.test.tsx +32 -62
- package/src/components/TextInput/TextInput.tsx +61 -30
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +1 -0
- package/src/components/Toggle/Toggle.stories.mdx +5 -16
- package/src/components/Toggle/Toggle.test.tsx +2 -3
- package/src/components/Toggle/Toggle.tsx +9 -10
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +13 -29
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -23
- package/src/components/VideoPlayer/VideoPlayer.tsx +13 -10
- package/src/docs/Chakra.stories.mdx +14 -11
- package/src/docs/Welcome.stories.mdx +23 -43
- package/src/helpers/types.ts +1 -0
- package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
- package/src/hooks/useNYPLTheme.stories.mdx +3 -6
- package/src/index.ts +51 -45
- package/src/theme/components/buttonGroup.ts +10 -0
- package/src/theme/components/card.ts +50 -15
- package/src/theme/components/componentWrapper.ts +5 -1
- package/src/theme/components/customTable.ts +8 -2
- package/src/theme/components/fieldset.ts +5 -1
- package/src/theme/components/helperErrorText.ts +5 -1
- package/src/theme/components/hero.ts +2 -2
- package/src/theme/components/horizontalRule.ts +5 -1
- package/src/theme/components/icon.ts +7 -1
- package/src/theme/components/image.ts +14 -3
- package/src/theme/components/label.ts +5 -1
- package/src/theme/components/list.ts +8 -2
- package/src/theme/components/logo.ts +5 -1
- package/src/theme/components/notification.ts +38 -14
- package/src/theme/components/progressIndicator.ts +10 -5
- package/src/theme/components/select.ts +5 -2
- package/src/theme/components/skeletonLoader.ts +8 -2
- package/src/theme/components/skipNavigation.ts +26 -0
- package/src/theme/components/slider.ts +13 -1
- package/src/theme/components/structuredContent.ts +11 -1
- package/src/theme/components/text.ts +12 -5
- package/src/theme/components/toggle.ts +9 -3
- package/src/theme/index.ts +4 -0
- package/src/theme/provider.tsx +1 -1
- package/src/utils/componentCategories.ts +13 -5
- package/src/utils/interfaces.ts +5 -0
- package/src/utils/utils.ts +2 -32
- package/dist/components/Accordion/AccordionTypes.d.ts +0 -5
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +0 -8
- package/dist/components/Button/ButtonTypes.d.ts +0 -8
- package/dist/components/DatePicker/DatePickerTypes.d.ts +0 -5
- package/dist/components/Form/FormTypes.d.ts +0 -2
- package/dist/components/Grid/GridTypes.d.ts +0 -9
- package/dist/components/Heading/HeadingTypes.d.ts +0 -14
- package/dist/components/Hero/HeroTypes.d.ts +0 -12
- package/dist/components/Icons/IconTypes.d.ts +0 -77
- package/dist/components/Image/ImageTypes.d.ts +0 -22
- package/dist/components/Link/LinkTypes.d.ts +0 -8
- package/dist/components/List/ListTypes.d.ts +0 -5
- package/dist/components/Logo/LogoTypes.d.ts +0 -54
- package/dist/components/Notification/NotificationTypes.d.ts +0 -5
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +0 -8
- package/dist/components/Select/SelectTypes.d.ts +0 -8
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -5
- package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +0 -5
- package/dist/components/StructuredContent/StructuredContentTypes.d.ts +0 -5
- package/dist/components/Text/TextTypes.d.ts +0 -6
- package/dist/components/TextInput/TextInputTypes.d.ts +0 -25
- package/dist/components/Toggle/ToggleTypes.d.ts +0 -4
- package/dist/components/VideoPlayer/VideoPlayerTypes.d.ts +0 -9
- package/dist/helpers/enums.d.ts +0 -4
- package/dist/utils/siteSections.d.ts +0 -2
- package/src/components/Accordion/AccordionTypes.tsx +0 -5
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +0 -8
- package/src/components/Button/ButtonTypes.tsx +0 -8
- package/src/components/DatePicker/DatePickerTypes.tsx +0 -5
- package/src/components/Form/FormTypes.tsx +0 -3
- package/src/components/Grid/GridTypes.tsx +0 -9
- package/src/components/Heading/HeadingTypes.tsx +0 -15
- package/src/components/Hero/HeroTypes.tsx +0 -20
- package/src/components/Icons/IconTypes.tsx +0 -83
- package/src/components/Image/ImageTypes.ts +0 -24
- package/src/components/Link/LinkTypes.tsx +0 -8
- package/src/components/List/ListTypes.tsx +0 -5
- package/src/components/Logo/LogoTypes.tsx +0 -56
- package/src/components/Notification/NotificationTypes.tsx +0 -5
- package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +0 -8
- package/src/components/Select/SelectTypes.tsx +0 -10
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
- package/src/components/StatusBadge/StatusBadgeTypes.tsx +0 -5
- package/src/components/StructuredContent/StructuredContentTypes.tsx +0 -5
- package/src/components/Text/TextTypes.tsx +0 -6
- package/src/components/TextInput/TextInputTypes.tsx +0 -48
- package/src/components/Toggle/ToggleTypes.tsx +0 -4
- package/src/components/VideoPlayer/VideoPlayerTypes.tsx +0 -10
- package/src/helpers/enums.ts +0 -4
- package/src/utils/siteSections.ts +0 -10
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
2
|
+
import bplBlack from "../../../icons/svg/logo-bpl-black.svg";
|
|
3
|
+
import bplWhite from "../../../icons/svg/logo-bpl-white.svg";
|
|
4
|
+
import cleverColor from "../../../icons/svg/logo-clever-color.svg";
|
|
5
|
+
import cleverWhite from "../../../icons/svg/logo-clever-white.svg";
|
|
6
|
+
import firstbookColor from "../../../icons/svg/logo-firstbook-color.svg";
|
|
7
|
+
import firstbookColorNegative from "../../../icons/svg/logo-firstbook-color-negative.svg";
|
|
8
|
+
import lpaColor from "../../../icons/svg/logo-lpa-color.svg";
|
|
9
|
+
import lpaBlack from "../../../icons/svg/logo-lpa-black.svg";
|
|
10
|
+
import lpaWhite from "../../../icons/svg/logo-lpa-white.svg";
|
|
11
|
+
import mlnBlack from "../../../icons/svg/logo-mln-black.svg";
|
|
12
|
+
import mlnWhite from "../../../icons/svg/logo-mln-white.svg";
|
|
13
|
+
import nyplFullBlack from "../../../icons/svg/logo-nypl-full-black.svg";
|
|
14
|
+
import nyplFullWhite from "../../../icons/svg/logo-nypl-full-white.svg";
|
|
15
|
+
import nyplLionBlack from "../../../icons/svg/logo-nypl-lion-black.svg";
|
|
16
|
+
import nyplLionWhite from "../../../icons/svg/logo-nypl-lion-white.svg";
|
|
17
|
+
import openebooksColor from "../../../icons/svg/logo-openebooks-color.svg";
|
|
18
|
+
import openebooksNegative from "../../../icons/svg/logo-openebooks-negative.svg";
|
|
19
|
+
import openebooksWithTextColor from "../../../icons/svg/logo-openebooks-with-text-color.svg";
|
|
20
|
+
import openebooksWithTextNegative from "../../../icons/svg/logo-openebooks-with-text-negative.svg";
|
|
21
|
+
import qplAltBlack from "../../../icons/svg/logo-qpl-alt-black.svg";
|
|
22
|
+
import qplAltWhite from "../../../icons/svg/logo-qpl-alt-white.svg";
|
|
23
|
+
import qplBlack from "../../../icons/svg/logo-qpl-black.svg";
|
|
24
|
+
import qplColor from "../../../icons/svg/logo-qpl-color.svg";
|
|
25
|
+
import qplWhite from "../../../icons/svg/logo-qpl-white.svg";
|
|
26
|
+
import reservoirIconColor from "../../../icons/svg/logo-reservoir-icon-color.svg";
|
|
27
|
+
import reservoirVerticalColor from "../../../icons/svg/logo-reservoir-vertical-color.svg";
|
|
28
|
+
import schomburgBlack from "../../../icons/svg/logo-schomburg-black.svg";
|
|
29
|
+
import schomburgCircleBlack from "../../../icons/svg/logo-schomburg-circle-black.svg";
|
|
30
|
+
import schomburgCircleColor from "../../../icons/svg/logo-schomburg-circle-color.svg";
|
|
31
|
+
import schomburgCircleWhite from "../../../icons/svg/logo-schomburg-circle-white.svg";
|
|
32
|
+
import schomburgColor from "../../../icons/svg/logo-schomburg-color.svg";
|
|
33
|
+
import schomburgWhite from "../../../icons/svg/logo-schomburg-white.svg";
|
|
34
|
+
import simplyeBlack from "../../../icons/svg/logo-simplye-black.svg";
|
|
35
|
+
import simplyeWhite from "../../../icons/svg/logo-simplye-white.svg";
|
|
36
|
+
import simplyeColor from "../../../icons/svg/logo-simplye-color.svg";
|
|
37
|
+
import snflBlack from "../../../icons/svg/logo-snfl-black.svg";
|
|
38
|
+
import snflWhite from "../../../icons/svg/logo-snfl-white.svg";
|
|
39
|
+
import treasuresColor from "../../../icons/svg/logo-treasures-color.svg";
|
|
40
|
+
import treasuresColorNegative from "../../../icons/svg/logo-treasures-color-negative.svg";
|
|
41
41
|
|
|
42
42
|
export default {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
43
|
+
bplBlack,
|
|
44
|
+
bplWhite,
|
|
45
|
+
cleverColor,
|
|
46
|
+
cleverWhite,
|
|
47
|
+
firstbookColor,
|
|
48
|
+
firstbookColorNegative,
|
|
49
|
+
lpaBlack,
|
|
50
|
+
lpaColor,
|
|
51
|
+
lpaWhite,
|
|
52
|
+
mlnBlack,
|
|
53
|
+
mlnWhite,
|
|
54
|
+
nyplFullBlack,
|
|
55
|
+
nyplFullWhite,
|
|
56
|
+
nyplLionBlack,
|
|
57
|
+
nyplLionWhite,
|
|
58
|
+
openebooksColor,
|
|
59
|
+
openebooksNegative,
|
|
60
|
+
openebooksWithTextColor,
|
|
61
|
+
openebooksWithTextNegative,
|
|
62
|
+
qplAltBlack,
|
|
63
|
+
qplAltWhite,
|
|
64
|
+
qplBlack,
|
|
65
|
+
qplColor,
|
|
66
|
+
qplWhite,
|
|
67
|
+
reservoirIconColor,
|
|
68
|
+
reservoirVerticalColor,
|
|
69
|
+
schomburgBlack,
|
|
70
|
+
schomburgCircleBlack,
|
|
71
|
+
schomburgCircleColor,
|
|
72
|
+
schomburgCircleWhite,
|
|
73
|
+
schomburgColor,
|
|
74
|
+
schomburgWhite,
|
|
75
|
+
simplyeBlack,
|
|
76
|
+
simplyeWhite,
|
|
77
|
+
simplyeColor,
|
|
78
|
+
snflBlack,
|
|
79
|
+
snflWhite,
|
|
80
|
+
treasuresColor,
|
|
81
|
+
treasuresColorNegative,
|
|
82
82
|
};
|
|
@@ -7,7 +7,7 @@ exports[`Logo renders the UI snapshot correctly 1`] = `
|
|
|
7
7
|
focusable={false}
|
|
8
8
|
id="test-logo"
|
|
9
9
|
role="img"
|
|
10
|
-
title="
|
|
10
|
+
title="nyplFullBlack logo"
|
|
11
11
|
viewBox="0 0 24 24"
|
|
12
12
|
>
|
|
13
13
|
<g
|
|
@@ -42,7 +42,7 @@ exports[`Logo renders the UI snapshot correctly 2`] = `
|
|
|
42
42
|
focusable={false}
|
|
43
43
|
id="test-logo-size"
|
|
44
44
|
role="img"
|
|
45
|
-
title="
|
|
45
|
+
title="nyplFullBlack logo"
|
|
46
46
|
viewBox="0 0 24 24"
|
|
47
47
|
>
|
|
48
48
|
<g
|
|
@@ -77,7 +77,7 @@ exports[`Logo renders the UI snapshot correctly 3`] = `
|
|
|
77
77
|
focusable={false}
|
|
78
78
|
id="chakra"
|
|
79
79
|
role="img"
|
|
80
|
-
title="
|
|
80
|
+
title="nyplFullBlack logo"
|
|
81
81
|
viewBox="0 0 24 24"
|
|
82
82
|
>
|
|
83
83
|
<g
|
|
@@ -113,7 +113,7 @@ exports[`Logo renders the UI snapshot correctly 4`] = `
|
|
|
113
113
|
focusable={false}
|
|
114
114
|
id="props"
|
|
115
115
|
role="img"
|
|
116
|
-
title="
|
|
116
|
+
title="nyplFullBlack logo"
|
|
117
117
|
viewBox="0 0 24 24"
|
|
118
118
|
>
|
|
119
119
|
<g
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ButtonGroup } from "@chakra-ui/react";
|
|
2
1
|
import {
|
|
3
2
|
ArgsTable,
|
|
4
3
|
Canvas,
|
|
@@ -9,7 +8,7 @@ import {
|
|
|
9
8
|
import { useState } from "react";
|
|
10
9
|
|
|
11
10
|
import Button from "../Button/Button";
|
|
12
|
-
import
|
|
11
|
+
import ButtonGroup from "../ButtonGroup/ButtonGroup";
|
|
13
12
|
import Heading from "../Heading/Heading";
|
|
14
13
|
import Link from "../Link/Link";
|
|
15
14
|
import { ModalTrigger, useModal } from "./Modal";
|
|
@@ -61,12 +60,12 @@ import { ModalTrigger } from "@nypl/design-system-react-components";
|
|
|
61
60
|
buttonText="Button Text"
|
|
62
61
|
id="modal-trigger"
|
|
63
62
|
modalProps={{
|
|
64
|
-
bodyContent
|
|
65
|
-
closeButtonLabel
|
|
66
|
-
headingText
|
|
67
|
-
onClose
|
|
63
|
+
bodyContent: "body text",
|
|
64
|
+
closeButtonLabel: "Close Button",
|
|
65
|
+
headingText: "Modal Heading Text",
|
|
66
|
+
onClose: () => {
|
|
68
67
|
console.log("custom close");
|
|
69
|
-
}
|
|
68
|
+
},
|
|
70
69
|
}}
|
|
71
70
|
/>;
|
|
72
71
|
```
|
|
@@ -139,7 +138,7 @@ export const ModalStory = (args) => {
|
|
|
139
138
|
<Button id="1" onClick={onOpen}>
|
|
140
139
|
Open Modal
|
|
141
140
|
</Button>
|
|
142
|
-
<Button buttonType=
|
|
141
|
+
<Button buttonType="secondary" id="2" onClick={onOpen}>
|
|
143
142
|
I can open the modal, too
|
|
144
143
|
</Button>
|
|
145
144
|
</ButtonGroup>
|
|
@@ -180,7 +179,7 @@ export const ModalStory = (args) => {
|
|
|
180
179
|
<Button id="1" onClick={onOpen}>
|
|
181
180
|
Open Modal
|
|
182
181
|
</Button>
|
|
183
|
-
<Button buttonType=
|
|
182
|
+
<Button buttonType="secondary" id="2" onClick={onOpen}>
|
|
184
183
|
I can open the modal, too
|
|
185
184
|
</Button>
|
|
186
185
|
</ButtonGroup>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { render, screen } from "@testing-library/react";
|
|
3
2
|
import { renderHook } from "@testing-library/react-hooks";
|
|
4
3
|
import { axe } from "jest-axe";
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
import renderer from "react-test-renderer";
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import { ButtonTypes } from "../Button/ButtonTypes";
|
|
7
|
+
import Button from "../Button/Button";
|
|
9
8
|
import { ModalTrigger, useModal } from "./Modal";
|
|
10
9
|
|
|
11
10
|
describe("Modal Accessibility", () => {
|
|
@@ -37,11 +36,7 @@ describe("Modal Accessibility", () => {
|
|
|
37
36
|
Go back
|
|
38
37
|
</Button>
|
|
39
38
|
<p>This is the body content.</p>
|
|
40
|
-
<Button
|
|
41
|
-
buttonType={ButtonTypes.NoBrand}
|
|
42
|
-
id="custom-close2"
|
|
43
|
-
onClick={onClose}
|
|
44
|
-
>
|
|
39
|
+
<Button buttonType="noBrand" id="custom-close2" onClick={onClose}>
|
|
45
40
|
This is a custom close button.
|
|
46
41
|
</Button>
|
|
47
42
|
</>
|
|
@@ -55,7 +50,7 @@ describe("Modal Accessibility", () => {
|
|
|
55
50
|
};
|
|
56
51
|
const { container } = render(
|
|
57
52
|
<>
|
|
58
|
-
<Button id="1" onClick={onOpen} buttonType=
|
|
53
|
+
<Button id="1" onClick={onOpen} buttonType="noBrand">
|
|
59
54
|
Open Modal
|
|
60
55
|
</Button>
|
|
61
56
|
<Modal {...modalProps} />
|
|
@@ -128,7 +123,7 @@ describe("useModal", () => {
|
|
|
128
123
|
};
|
|
129
124
|
const useModalComponent = (
|
|
130
125
|
<>
|
|
131
|
-
<Button id="1" onClick={onOpen} buttonType=
|
|
126
|
+
<Button id="1" onClick={onOpen} buttonType="noBrand">
|
|
132
127
|
Open Modal
|
|
133
128
|
</Button>
|
|
134
129
|
<Modal {...modalProps} />
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
ModalBody,
|
|
9
9
|
ModalCloseButton,
|
|
10
10
|
useDisclosure,
|
|
11
|
-
ButtonGroup,
|
|
12
11
|
} from "@chakra-ui/react";
|
|
13
12
|
import * as React from "react";
|
|
14
13
|
|
|
15
14
|
import Button from "../Button/Button";
|
|
15
|
+
import ButtonGroup from "../ButtonGroup/ButtonGroup";
|
|
16
16
|
import useWindowSize from "../../hooks/useWindowSize";
|
|
17
17
|
|
|
18
18
|
interface BaseModalProps {
|
|
@@ -8,18 +8,10 @@ import {
|
|
|
8
8
|
import { withDesign } from "storybook-addon-designs";
|
|
9
9
|
|
|
10
10
|
import Icon from "../Icons/Icon";
|
|
11
|
-
import { IconColors, IconNames } from "../Icons/IconTypes";
|
|
12
11
|
import Link from "../Link/Link";
|
|
13
12
|
import Notification from "./Notification";
|
|
14
|
-
import { NotificationTypes } from "./NotificationTypes";
|
|
15
13
|
import { getCategory } from "../../utils/componentCategories";
|
|
16
14
|
import DSProvider from "../../theme/provider";
|
|
17
|
-
import { getStorybookEnumValues } from "../../utils/utils";
|
|
18
|
-
|
|
19
|
-
export const enumValues = getStorybookEnumValues(
|
|
20
|
-
NotificationTypes,
|
|
21
|
-
"NotificationTypes"
|
|
22
|
-
);
|
|
23
15
|
|
|
24
16
|
<Meta
|
|
25
17
|
title={getCategory("Notification")}
|
|
@@ -47,9 +39,7 @@ export const enumValues = getStorybookEnumValues(
|
|
|
47
39
|
},
|
|
48
40
|
notificationContent: { control: false },
|
|
49
41
|
notificationType: {
|
|
50
|
-
|
|
51
|
-
table: { defaultValue: { summary: "NotificationTypes.Standard" } },
|
|
52
|
-
options: enumValues.options,
|
|
42
|
+
table: { defaultValue: { summary: "standard" } },
|
|
53
43
|
},
|
|
54
44
|
}}
|
|
55
45
|
/>
|
|
@@ -59,7 +49,7 @@ export const enumValues = getStorybookEnumValues(
|
|
|
59
49
|
| Component Version | DS Version |
|
|
60
50
|
| ----------------- | ---------- |
|
|
61
51
|
| Added | `0.23.2` |
|
|
62
|
-
| Latest | `0.
|
|
52
|
+
| Latest | `0.28.0` |
|
|
63
53
|
|
|
64
54
|
## Table of Contents
|
|
65
55
|
|
|
@@ -105,16 +95,13 @@ within a parent element.
|
|
|
105
95
|
nisi erat porttitor ligula.
|
|
106
96
|
</>
|
|
107
97
|
),
|
|
108
|
-
notificationType: "
|
|
98
|
+
notificationType: "standard",
|
|
109
99
|
showIcon: true,
|
|
110
100
|
}}
|
|
111
101
|
>
|
|
112
102
|
{(args) => (
|
|
113
103
|
<div style={{ border: "1px solid #ccc" }}>
|
|
114
|
-
<Notification
|
|
115
|
-
{...args}
|
|
116
|
-
notificationType={enumValues.getValue(args.notificationType)}
|
|
117
|
-
/>
|
|
104
|
+
<Notification {...args} />
|
|
118
105
|
</div>
|
|
119
106
|
)}
|
|
120
107
|
</Story>
|
|
@@ -172,7 +159,7 @@ Resources:
|
|
|
172
159
|
<Canvas>
|
|
173
160
|
<DSProvider>
|
|
174
161
|
<Notification
|
|
175
|
-
notificationType=
|
|
162
|
+
notificationType="announcement"
|
|
176
163
|
notificationHeading="Announcement Notification"
|
|
177
164
|
notificationContent={
|
|
178
165
|
<>
|
|
@@ -191,7 +178,7 @@ Resources:
|
|
|
191
178
|
<Canvas>
|
|
192
179
|
<DSProvider>
|
|
193
180
|
<Notification
|
|
194
|
-
notificationType=
|
|
181
|
+
notificationType="warning"
|
|
195
182
|
notificationHeading="Warning Notification"
|
|
196
183
|
notificationContent={
|
|
197
184
|
<>
|
|
@@ -229,7 +216,7 @@ Resources:
|
|
|
229
216
|
<Canvas>
|
|
230
217
|
<DSProvider>
|
|
231
218
|
<Notification
|
|
232
|
-
notificationType=
|
|
219
|
+
notificationType="announcement"
|
|
233
220
|
notificationContent={
|
|
234
221
|
<>
|
|
235
222
|
This is an "announcement" Notification without a heading. Cras mattis
|
|
@@ -247,7 +234,7 @@ Resources:
|
|
|
247
234
|
<Canvas>
|
|
248
235
|
<DSProvider>
|
|
249
236
|
<Notification
|
|
250
|
-
notificationType=
|
|
237
|
+
notificationType="warning"
|
|
251
238
|
notificationContent={
|
|
252
239
|
<>
|
|
253
240
|
This is a "warning" Notification without a heading. Cras mattis
|
|
@@ -330,12 +317,7 @@ The default icon can be overridden by using the `icon` prop to pass a custom `Ic
|
|
|
330
317
|
<Canvas>
|
|
331
318
|
<Story name="Custom Icons">
|
|
332
319
|
<Notification
|
|
333
|
-
icon={
|
|
334
|
-
<Icon
|
|
335
|
-
name={IconNames.Check}
|
|
336
|
-
color={IconColors.SectionResearchSecondary}
|
|
337
|
-
/>
|
|
338
|
-
}
|
|
320
|
+
icon={<Icon name="check" color="section.research.secondary" />}
|
|
339
321
|
notificationHeading="Custom Icon"
|
|
340
322
|
notificationContent={
|
|
341
323
|
<>
|
|
@@ -370,7 +352,7 @@ appears once.
|
|
|
370
352
|
nascetur ridiculus mus.
|
|
371
353
|
</>
|
|
372
354
|
}
|
|
373
|
-
notificationType=
|
|
355
|
+
notificationType="announcement"
|
|
374
356
|
/>
|
|
375
357
|
</Story>
|
|
376
358
|
</Canvas>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { render, RenderResult, screen } from "@testing-library/react";
|
|
3
3
|
import { axe } from "jest-axe";
|
|
4
4
|
import renderer from "react-test-renderer";
|
|
5
5
|
|
|
6
6
|
import Notification from "./Notification";
|
|
7
|
-
import { NotificationTypes } from "./NotificationTypes";
|
|
8
7
|
import Icon from "../Icons/Icon";
|
|
9
|
-
import { IconNames, IconColors, IconSizes } from "../Icons/IconTypes";
|
|
10
8
|
|
|
11
9
|
describe("Notification Accessibility", () => {
|
|
12
10
|
it("passes axe accessibility test with heading", async () => {
|
|
@@ -56,7 +54,7 @@ describe("Notification Accessibility", () => {
|
|
|
56
54
|
});
|
|
57
55
|
|
|
58
56
|
describe("Notification", () => {
|
|
59
|
-
let utils;
|
|
57
|
+
let utils: RenderResult;
|
|
60
58
|
beforeEach(() => {
|
|
61
59
|
utils = render(
|
|
62
60
|
<Notification
|
|
@@ -107,9 +105,9 @@ describe("Notification", () => {
|
|
|
107
105
|
<Icon
|
|
108
106
|
id="custom-icon"
|
|
109
107
|
className="custom-icon"
|
|
110
|
-
color=
|
|
111
|
-
name=
|
|
112
|
-
size=
|
|
108
|
+
color="brand.primary"
|
|
109
|
+
name="check"
|
|
110
|
+
size="large"
|
|
113
111
|
/>
|
|
114
112
|
}
|
|
115
113
|
id="notificationID"
|
|
@@ -130,7 +128,7 @@ describe("Notification", () => {
|
|
|
130
128
|
id="notificationID"
|
|
131
129
|
notificationContent={<>Notification content.</>}
|
|
132
130
|
notificationHeading="Notification Heading"
|
|
133
|
-
notificationType=
|
|
131
|
+
notificationType="announcement"
|
|
134
132
|
/>
|
|
135
133
|
);
|
|
136
134
|
|
|
@@ -146,7 +144,7 @@ describe("Notification", () => {
|
|
|
146
144
|
id="notificationID"
|
|
147
145
|
notificationContent={<>Notification content.</>}
|
|
148
146
|
notificationHeading="Notification Heading"
|
|
149
|
-
notificationType=
|
|
147
|
+
notificationType="warning"
|
|
150
148
|
/>
|
|
151
149
|
);
|
|
152
150
|
|
|
@@ -170,7 +168,6 @@ describe("Notification", () => {
|
|
|
170
168
|
id="notificationID"
|
|
171
169
|
notificationContent={<>Notification content.</>}
|
|
172
170
|
notificationHeading="Notification Heading"
|
|
173
|
-
notificationType={NotificationTypes.Standard}
|
|
174
171
|
/>
|
|
175
172
|
);
|
|
176
173
|
|
|
@@ -197,7 +194,7 @@ describe("Notification", () => {
|
|
|
197
194
|
id="notificationID2"
|
|
198
195
|
notificationContent={<>Notification content.</>}
|
|
199
196
|
notificationHeading="Notification Heading"
|
|
200
|
-
notificationType=
|
|
197
|
+
notificationType="announcement"
|
|
201
198
|
/>
|
|
202
199
|
)
|
|
203
200
|
.toJSON();
|
|
@@ -207,7 +204,7 @@ describe("Notification", () => {
|
|
|
207
204
|
id="notificationID3"
|
|
208
205
|
notificationContent={<>Notification content.</>}
|
|
209
206
|
notificationHeading="Notification Heading"
|
|
210
|
-
notificationType=
|
|
207
|
+
notificationType="warning"
|
|
211
208
|
/>
|
|
212
209
|
)
|
|
213
210
|
.toJSON();
|
|
@@ -2,12 +2,10 @@ import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
|
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
|
|
4
4
|
import Button from "../Button/Button";
|
|
5
|
-
import { ButtonTypes } from "../Button/ButtonTypes";
|
|
6
5
|
import Heading from "../Heading/Heading";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { NotificationTypes } from "./NotificationTypes";
|
|
6
|
+
import Icon, { IconColors, IconNames, IconSizes } from "../Icons/Icon";
|
|
7
|
+
|
|
8
|
+
export type NotificationTypes = "standard" | "announcement" | "warning";
|
|
11
9
|
interface BaseProps {
|
|
12
10
|
/** Optional prop to control text alignment in `NotificationContent` */
|
|
13
11
|
alignText?: boolean;
|
|
@@ -61,11 +59,7 @@ export const NotificationHeading = chakra(
|
|
|
61
59
|
return (
|
|
62
60
|
<Box as="header" __css={styles} {...rest}>
|
|
63
61
|
{icon}
|
|
64
|
-
<Heading
|
|
65
|
-
additionalStyles={styles.heading}
|
|
66
|
-
id={`${id}-heading`}
|
|
67
|
-
level={HeadingLevels.Four}
|
|
68
|
-
>
|
|
62
|
+
<Heading id={`${id}-heading`} level="four" __css={styles.heading}>
|
|
69
63
|
{children}
|
|
70
64
|
</Heading>
|
|
71
65
|
</Box>
|
|
@@ -108,7 +102,7 @@ export const Notification = chakra((props: NotificationProps) => {
|
|
|
108
102
|
noMargin = false,
|
|
109
103
|
notificationContent,
|
|
110
104
|
notificationHeading,
|
|
111
|
-
notificationType =
|
|
105
|
+
notificationType = "standard",
|
|
112
106
|
showIcon = true,
|
|
113
107
|
...rest
|
|
114
108
|
} = props;
|
|
@@ -122,12 +116,12 @@ export const Notification = chakra((props: NotificationProps) => {
|
|
|
122
116
|
});
|
|
123
117
|
const iconElement = () => {
|
|
124
118
|
const baseIconProps = {
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
size: "large" as IconSizes,
|
|
120
|
+
__css: styles.icon,
|
|
127
121
|
};
|
|
128
|
-
// If the icon should not display, return
|
|
122
|
+
// If the icon should not display, return undefined.
|
|
129
123
|
if (!showIcon) {
|
|
130
|
-
return
|
|
124
|
+
return undefined;
|
|
131
125
|
}
|
|
132
126
|
// If a custom icon is passed, add specific `Notification` styles.
|
|
133
127
|
if (icon)
|
|
@@ -135,45 +129,48 @@ export const Notification = chakra((props: NotificationProps) => {
|
|
|
135
129
|
id: `${id}-custom-notification-icon`,
|
|
136
130
|
...baseIconProps,
|
|
137
131
|
});
|
|
132
|
+
interface IconProps {
|
|
133
|
+
color: IconColors;
|
|
134
|
+
name: IconNames;
|
|
135
|
+
title: string;
|
|
136
|
+
}
|
|
138
137
|
const iconProps = {
|
|
139
|
-
|
|
140
|
-
color:
|
|
141
|
-
name:
|
|
138
|
+
announcement: {
|
|
139
|
+
color: "section.research.secondary",
|
|
140
|
+
name: "speakerNotes",
|
|
142
141
|
title: "Notification announcement icon",
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
color:
|
|
146
|
-
name:
|
|
142
|
+
} as IconProps,
|
|
143
|
+
standard: {
|
|
144
|
+
color: "ui.black",
|
|
145
|
+
name: "alertNotificationImportant",
|
|
147
146
|
title: "Notification standard icon",
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
color:
|
|
151
|
-
name:
|
|
147
|
+
} as IconProps,
|
|
148
|
+
warning: {
|
|
149
|
+
color: "brand.primary",
|
|
150
|
+
name: "errorFilled",
|
|
152
151
|
title: "Notification warning icon",
|
|
153
|
-
},
|
|
152
|
+
} as IconProps,
|
|
154
153
|
};
|
|
155
154
|
return (
|
|
156
155
|
<Icon
|
|
157
156
|
id={`${id}-notification-icon`}
|
|
158
|
-
{...baseIconProps}
|
|
159
157
|
{...iconProps[notificationType]}
|
|
158
|
+
{...baseIconProps}
|
|
160
159
|
/>
|
|
161
160
|
);
|
|
162
161
|
};
|
|
163
162
|
const dismissibleButton = dismissible && (
|
|
164
163
|
<Button
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
"aria-label": "Close the notification",
|
|
168
|
-
}}
|
|
169
|
-
buttonType={ButtonTypes.Link}
|
|
164
|
+
aria-label="Close the notification"
|
|
165
|
+
buttonType="link"
|
|
170
166
|
id={`${id}-notification-dismissible-button`}
|
|
171
167
|
onClick={handleClose}
|
|
168
|
+
__css={styles.dismissibleButton}
|
|
172
169
|
>
|
|
173
170
|
<Icon
|
|
174
171
|
id={`${id}-dismissible-notification-icon`}
|
|
175
|
-
name=
|
|
176
|
-
size=
|
|
172
|
+
name="close"
|
|
173
|
+
size="large"
|
|
177
174
|
title="Notification close icon"
|
|
178
175
|
/>
|
|
179
176
|
</Button>
|
|
@@ -190,11 +187,11 @@ export const Notification = chakra((props: NotificationProps) => {
|
|
|
190
187
|
</NotificationHeading>
|
|
191
188
|
);
|
|
192
189
|
// Specific alignment styles for the content.
|
|
193
|
-
const alignText = childHeading && showIcon && (!!icon || !isCentered);
|
|
190
|
+
const alignText = !!(childHeading && showIcon && (!!icon || !isCentered));
|
|
194
191
|
const childContent = (
|
|
195
192
|
<NotificationContent
|
|
196
193
|
alignText={alignText}
|
|
197
|
-
icon={!childHeading ? iconElem :
|
|
194
|
+
icon={!childHeading ? iconElem : undefined}
|
|
198
195
|
notificationType={notificationType}
|
|
199
196
|
>
|
|
200
197
|
{notificationContent}
|
|
@@ -43,7 +43,7 @@ export const hrefProps = getStorybookHrefProps(10);
|
|
|
43
43
|
| Component Version | DS Version |
|
|
44
44
|
| ----------------- | ---------- |
|
|
45
45
|
| Added | `0.0.10` |
|
|
46
|
-
| Latest | `0.
|
|
46
|
+
| Latest | `0.28.0` |
|
|
47
47
|
|
|
48
48
|
## Table of Contents
|
|
49
49
|
|
|
@@ -170,7 +170,7 @@ export function CurrentPagePaginationExample() {
|
|
|
170
170
|
currentPage={page}
|
|
171
171
|
onPageChange={(selectedPage) => handleSelection(selectedPage)}
|
|
172
172
|
/>
|
|
173
|
-
<Button type="button"
|
|
173
|
+
<Button type="button" onClick={handleClick}>
|
|
174
174
|
Go to Page 1
|
|
175
175
|
</Button>
|
|
176
176
|
</VStack>
|