@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.
- package/CHANGELOG.md +98 -1
- package/README.md +46 -11
- package/dist/components/Accordion/Accordion.d.ts +14 -14
- package/dist/components/Autosuggest/Autosuggest.stories.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -14
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
- package/dist/components/Button/Button.d.ts +6 -13
- package/dist/components/Button/ButtonTypes.d.ts +5 -3
- package/dist/components/Card/Card.d.ts +59 -10
- package/dist/components/Card/CardTypes.d.ts +19 -0
- package/dist/components/CardEdition/CardEdition.d.ts +21 -0
- package/dist/components/{StyleGuide/Colors.stories.d.ts → CardEdition/CardEdition.stories.d.ts} +5 -2
- package/dist/components/Checkbox/Checkbox.d.ts +21 -16
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +43 -0
- package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.d.ts +79 -0
- package/dist/components/DatePicker/DatePickerTypes.d.ts +5 -0
- package/dist/components/Form/Form.d.ts +16 -8
- package/dist/components/Form/FormTypes.d.ts +2 -0
- package/dist/components/Grid/GridTypes.d.ts +9 -0
- package/dist/components/Grid/SimpleGrid.d.ts +14 -0
- package/dist/components/Heading/Heading.d.ts +9 -11
- package/dist/components/Heading/{HeadingDisplaySizes.d.ts → HeadingTypes.d.ts} +8 -0
- package/dist/components/HelperErrorText/HelperErrorText.stories.d.ts +2 -1
- package/dist/components/Hero/Hero.d.ts +19 -14
- package/dist/components/Hero/HeroTypes.d.ts +10 -5
- package/dist/components/Icons/Icon.d.ts +13 -16
- package/dist/components/Icons/IconSvgs.d.ts +4 -0
- package/dist/components/Icons/IconTypes.d.ts +78 -60
- package/dist/components/Image/Image.stories.d.ts +2 -1
- package/dist/components/Label/Label.d.ts +10 -26
- package/dist/components/Link/Link.d.ts +8 -12
- package/dist/components/List/List.stories.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +30 -24
- package/dist/components/RadioGroup/RadioGroup.d.ts +40 -0
- package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +4 -0
- package/dist/components/SearchBar/SearchBar.d.ts +45 -27
- package/dist/components/Select/Select.d.ts +34 -35
- package/dist/components/Select/SelectTypes.d.ts +4 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +1 -1
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +2 -2
- package/dist/components/StatusBadge/StatusBadge.d.ts +8 -6
- package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +5 -0
- package/dist/components/Tabs/Tabs.d.ts +25 -0
- package/dist/components/Template/Template.d.ts +91 -0
- package/dist/components/Text/Text.d.ts +16 -0
- package/dist/components/Text/TextTypes.d.ts +6 -0
- package/dist/components/TextInput/TextInput.d.ts +37 -30
- package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
- package/dist/design-system-react-components.cjs.development.js +4102 -917
- 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 +4023 -920
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +23 -5
- package/dist/resources.scss +133 -24
- package/dist/styles.css +1 -1
- package/dist/theme/components/accordion.d.ts +25 -0
- package/dist/theme/components/breadcrumb.d.ts +90 -0
- package/dist/theme/components/button.d.ts +109 -0
- package/dist/theme/components/checkbox.d.ts +91 -0
- package/dist/theme/components/customCheckboxGroup.d.ts +18 -0
- package/dist/theme/components/customRadioGroup.d.ts +18 -0
- package/dist/theme/components/global.d.ts +55 -0
- package/dist/theme/components/globalMixins.d.ts +15 -0
- package/dist/theme/components/heading.d.ts +110 -0
- package/dist/theme/components/hero.d.ts +492 -0
- package/dist/theme/components/icon.d.ts +13 -0
- package/dist/theme/components/label.d.ts +16 -0
- package/dist/theme/components/link.d.ts +45 -0
- package/dist/theme/components/radio.d.ts +95 -0
- package/dist/theme/components/searchBar.d.ts +20 -0
- package/dist/theme/components/select.d.ts +58 -0
- package/dist/theme/components/statusBadge.d.ts +25 -0
- package/dist/theme/components/tabs.d.ts +85 -0
- package/dist/theme/components/template.d.ts +105 -0
- package/dist/theme/components/text.d.ts +20 -0
- package/dist/theme/components/textInput.d.ts +105 -0
- package/dist/theme/foundations/breakpoints.d.ts +23 -0
- package/dist/theme/foundations/colors.d.ts +3 -0
- package/dist/theme/foundations/global.d.ts +23 -0
- package/dist/theme/foundations/shadows.d.ts +4 -0
- package/dist/theme/foundations/spacing.d.ts +77 -0
- package/dist/theme/foundations/typography.d.ts +8 -0
- package/dist/theme/index.d.ts +20 -0
- package/dist/theme/provider.d.ts +5 -0
- package/dist/theme/types.d.ts +1 -0
- package/dist/utils/utils.d.ts +6 -0
- package/package.json +9 -2
- package/src/components/Accordion/Accordion.stories.mdx +233 -33
- package/src/components/Accordion/Accordion.test.tsx +135 -19
- package/src/components/Accordion/Accordion.tsx +81 -56
- package/src/components/Autosuggest/Autosuggest.stories.mdx +4 -3
- package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -1
- package/src/components/Autosuggest/_Autosuggest.scss +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +57 -56
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +31 -25
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +71 -73
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +6 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +100 -0
- package/src/components/Button/Button.stories.mdx +125 -138
- package/src/components/Button/Button.test.tsx +65 -11
- package/src/components/Button/Button.tsx +72 -68
- package/src/components/Button/ButtonTypes.tsx +4 -2
- package/src/components/Button/_Button.scss +7 -92
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +58 -3
- package/src/components/Card/Card.stories.mdx +694 -0
- package/src/components/Card/Card.test.tsx +97 -102
- package/src/components/Card/Card.tsx +182 -31
- package/src/components/Card/CardTypes.tsx +21 -0
- package/src/components/Card/_Card.scss +234 -49
- package/src/components/{Card/Card.stories.tsx → CardEdition/CardEdition.stories.tsx} +32 -22
- package/src/components/CardEdition/CardEdition.test.tsx +395 -0
- package/src/components/CardEdition/CardEdition.tsx +60 -0
- package/src/components/CardEdition/_CardEdition.scss +138 -0
- package/src/components/Chakra/Box.stories.mdx +57 -0
- package/src/components/Chakra/Center.stories.mdx +99 -0
- package/src/components/Chakra/Grid.stories.mdx +79 -0
- package/src/components/Chakra/Stack.stories.mdx +93 -0
- package/src/components/Checkbox/Checkbox.stories.mdx +57 -35
- package/src/components/Checkbox/Checkbox.test.tsx +117 -147
- package/src/components/Checkbox/Checkbox.tsx +76 -50
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +325 -0
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +249 -0
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +345 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +148 -0
- package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +4 -0
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1360 -0
- package/src/components/DatePicker/DatePicker.stories.mdx +284 -0
- package/src/components/DatePicker/DatePicker.test.tsx +657 -0
- package/src/components/DatePicker/DatePicker.tsx +396 -0
- package/src/components/DatePicker/DatePickerTypes.tsx +5 -0
- package/src/components/DatePicker/_DatePicker.scss +76 -0
- package/src/components/Form/Form.stories.mdx +130 -27
- package/src/components/Form/Form.test.tsx +78 -36
- package/src/components/Form/Form.tsx +53 -19
- package/src/components/Form/FormTypes.tsx +3 -0
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +38 -0
- package/src/components/Grid/GridTypes.tsx +9 -0
- package/src/components/Grid/SimpleGrid.stories.mdx +275 -0
- package/src/components/Grid/SimpleGrid.test.tsx +66 -0
- package/src/components/Grid/SimpleGrid.tsx +37 -0
- package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +8 -0
- package/src/components/Heading/Heading.stories.mdx +63 -33
- package/src/components/Heading/Heading.test.tsx +24 -16
- package/src/components/Heading/Heading.tsx +54 -38
- package/src/components/Heading/{HeadingDisplaySizes.tsx → HeadingTypes.tsx} +9 -0
- package/src/components/HelperErrorText/HelperErrorText.stories.tsx +2 -1
- package/src/components/HelperErrorText/_HelperErrorText.scss +1 -1
- package/src/components/Hero/Hero.stories.mdx +195 -85
- package/src/components/Hero/Hero.test.tsx +544 -113
- package/src/components/Hero/Hero.tsx +80 -93
- package/src/components/Hero/HeroTypes.tsx +17 -5
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +6 -1
- package/src/components/HorizontalRule/_HorizontalRule.scss +1 -1
- package/src/components/Icons/Icon.stories.mdx +89 -74
- package/src/components/Icons/Icon.test.tsx +30 -22
- package/src/components/Icons/Icon.tsx +63 -61
- package/src/components/Icons/IconSvgs.tsx +8 -0
- package/src/components/Icons/IconTypes.tsx +80 -60
- package/src/components/Image/Image.stories.tsx +2 -1
- package/src/components/Input/_Input.scss +2 -2
- package/src/components/Label/Label.stories.mdx +77 -0
- package/src/components/Label/Label.test.tsx +43 -12
- package/src/components/Label/Label.tsx +28 -45
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
- package/src/components/Link/Link.stories.mdx +47 -41
- package/src/components/Link/Link.test.tsx +33 -44
- package/src/components/Link/Link.tsx +114 -100
- package/src/components/List/List.stories.mdx +7 -3
- package/src/components/List/List.stories.tsx +14 -9
- package/src/components/List/List.test.tsx +12 -8
- package/src/components/List/List.tsx +9 -7
- package/src/components/List/_List.scss +3 -3
- package/src/components/Modal/Modal.stories.mdx +7 -3
- package/src/components/Modal/_Modal.scss +1 -1
- package/src/components/Notification/Notification.stories.mdx +99 -65
- package/src/components/Notification/Notification.test.tsx +3 -16
- package/src/components/Notification/Notification.tsx +12 -12
- package/src/components/Notification/_Notification.scss +5 -4
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +1 -1
- package/src/components/Pagination/Pagination.stories.mdx +7 -1
- package/src/components/Pagination/Pagination.test.tsx +16 -10
- package/src/components/Radio/Radio.stories.mdx +57 -46
- package/src/components/Radio/Radio.test.tsx +92 -138
- package/src/components/Radio/Radio.tsx +70 -69
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +250 -0
- package/src/components/RadioGroup/RadioGroup.stories.mdx +247 -0
- package/src/components/RadioGroup/RadioGroup.test.tsx +327 -0
- package/src/components/RadioGroup/RadioGroup.tsx +154 -0
- package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +4 -0
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1101 -0
- package/src/components/SearchBar/SearchBar.Test.tsx +151 -16
- package/src/components/SearchBar/SearchBar.stories.mdx +196 -224
- package/src/components/SearchBar/SearchBar.tsx +151 -46
- package/src/components/Select/Select.stories.mdx +193 -168
- package/src/components/Select/Select.test.tsx +129 -324
- package/src/components/Select/Select.tsx +120 -160
- package/src/components/Select/SelectTypes.tsx +4 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +18 -29
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -7
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +4 -2
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +2 -2
- package/src/components/SkeletonLoader/_SkeletonLoader.scss +3 -3
- package/src/components/StatusBadge/StatusBadge.stories.mdx +91 -0
- package/src/components/StatusBadge/StatusBadge.test.tsx +35 -7
- package/src/components/StatusBadge/StatusBadge.tsx +24 -25
- package/src/components/StatusBadge/StatusBadgeTypes.tsx +5 -0
- package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +28 -0
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +112 -90
- package/src/components/StyleGuide/Buttons.stories.mdx +98 -100
- package/src/components/StyleGuide/Colors.stories.mdx +336 -0
- package/src/components/StyleGuide/Forms.stories.mdx +85 -0
- package/src/components/StyleGuide/Iconography.stories.mdx +86 -93
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
- package/src/components/StyleGuide/Typography.stories.mdx +164 -166
- package/src/components/StyleGuide/UIDocCard.tsx +4 -4
- package/src/components/Tabs/Tabs.stories.mdx +221 -0
- package/src/components/Tabs/Tabs.test.tsx +264 -0
- package/src/components/Tabs/Tabs.tsx +220 -0
- package/src/components/Template/Template.stories.mdx +574 -0
- package/src/components/Template/Template.test.tsx +124 -0
- package/src/components/Template/Template.tsx +226 -0
- package/src/components/Text/Text.stories.mdx +70 -0
- package/src/components/Text/Text.test.tsx +63 -0
- package/src/components/Text/Text.tsx +55 -0
- package/src/components/Text/TextTypes.tsx +6 -0
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +33 -0
- package/src/components/TextInput/TextInput.stories.mdx +90 -90
- package/src/components/TextInput/TextInput.test.tsx +103 -83
- package/src/components/TextInput/TextInput.tsx +108 -91
- package/src/components/TextInput/TextInputTypes.tsx +6 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -1
- package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
- package/src/components/VideoPlayer/_VideoPlayer.scss +1 -1
- package/src/docs/Chakra.stories.mdx +341 -0
- package/src/docs/Intro.stories.mdx +31 -24
- package/src/index.ts +70 -5
- package/src/styles/01-colors/_colors-brand.scss +6 -4
- package/src/styles/01-colors/_colors-utility.scss +14 -15
- package/src/styles/03-space/_space-inline.scss +47 -7
- package/src/styles/03-space/_space-inset.scss +33 -5
- package/src/styles/03-space/_space-stack.scss +48 -8
- package/src/styles/base/_02-breakpoints.scss +5 -4
- package/src/styles/base/_04-base.scss +2 -1
- package/src/styles/base/_place-holder.scss +1 -1
- package/src/styles/base/_typography.scss +1 -29
- package/src/styles.scss +22 -25
- package/src/theme/components/accordion.ts +30 -0
- package/src/theme/components/breadcrumb.ts +77 -0
- package/src/theme/components/button.ts +125 -0
- package/src/theme/components/checkbox.ts +107 -0
- package/src/theme/components/customCheckboxGroup.ts +12 -0
- package/src/theme/components/customRadioGroup.ts +12 -0
- package/src/theme/components/global.ts +71 -0
- package/src/theme/components/globalMixins.ts +16 -0
- package/src/theme/components/heading.ts +72 -0
- package/src/theme/components/hero.ts +239 -0
- package/src/theme/components/icon.ts +79 -0
- package/src/theme/components/label.ts +17 -0
- package/src/theme/components/link.ts +47 -0
- package/src/theme/components/radio.ts +106 -0
- package/src/theme/components/searchBar.ts +21 -0
- package/src/theme/components/select.ts +50 -0
- package/src/theme/components/statusBadge.ts +27 -0
- package/src/theme/components/tabs.ts +79 -0
- package/src/theme/components/template.ts +114 -0
- package/src/theme/components/text.ts +31 -0
- package/src/theme/components/textInput.ts +61 -0
- package/src/theme/foundations/breakpoints.ts +24 -0
- package/src/theme/foundations/colors.ts +208 -0
- package/src/theme/foundations/global.ts +26 -0
- package/src/theme/foundations/shadows.ts +5 -0
- package/src/theme/foundations/spacing.ts +85 -0
- package/src/theme/foundations/typography.ts +35 -0
- package/src/theme/index.ts +88 -0
- package/src/theme/provider.tsx +9 -0
- package/src/theme/types.ts +1 -0
- package/src/utils/componentCategories.ts +56 -21
- package/src/utils/utils.ts +13 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -5
- package/dist/components/Card/Card.stories.d.ts +0 -27
- package/dist/components/Label/Label.stories.d.ts +0 -12
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
- package/dist/components/Template/Template.stories.d.ts +0 -29
- package/src/components/Accordion/Accordion.stories.tsx +0 -65
- package/src/components/Accordion/_Accordion.scss +0 -81
- package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
- package/src/components/Checkbox/_Checkbox.scss +0 -97
- package/src/components/Form/_Form.scss +0 -28
- package/src/components/Heading/_Heading.scss +0 -163
- package/src/components/Hero/_Hero.scss +0 -256
- package/src/components/Icons/_Icons.scss +0 -116
- package/src/components/Label/Label.stories.tsx +0 -30
- package/src/components/Label/_Label.scss +0 -22
- package/src/components/Link/_Link.scss +0 -73
- package/src/components/Radio/_Radio.scss +0 -84
- package/src/components/SearchBar/_SearchBar.scss +0 -16
- package/src/components/Select/_Select.scss +0 -82
- package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -33
- package/src/components/StatusBadge/_StatusBadge.scss +0 -23
- package/src/components/StyleGuide/Colors.stories.tsx +0 -288
- package/src/components/Template/Template.stories.tsx +0 -85
- package/src/components/Template/_Template.scss +0 -63
- package/src/components/TextInput/_TextInput.scss +0 -59
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import CardEdition from "../CardEdition/CardEdition";
|
|
4
4
|
import Heading from "../Heading/Heading";
|
|
5
|
+
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
5
6
|
import Icon from "../Icons/Icon";
|
|
6
|
-
import { IconNames } from "../Icons/IconTypes";
|
|
7
|
+
import { IconAlign, IconNames, IconSizes } from "../Icons/IconTypes";
|
|
7
8
|
import Image from "../Image/Image";
|
|
8
9
|
import Link from "../Link/Link";
|
|
9
10
|
import { LinkTypes } from "../Link/LinkTypes";
|
|
@@ -88,7 +89,7 @@ export const listRenderer = (args) => (
|
|
|
88
89
|
);
|
|
89
90
|
|
|
90
91
|
const exampleCard = (
|
|
91
|
-
<
|
|
92
|
+
<CardEdition
|
|
92
93
|
className="example-card"
|
|
93
94
|
image={<Image src="https://placeimg.com/300/400/arch" alt={""} />}
|
|
94
95
|
ctas={
|
|
@@ -104,7 +105,11 @@ const exampleCard = (
|
|
|
104
105
|
}
|
|
105
106
|
>
|
|
106
107
|
<>
|
|
107
|
-
<Heading
|
|
108
|
+
<Heading
|
|
109
|
+
level={HeadingLevels.Two}
|
|
110
|
+
id="heading1"
|
|
111
|
+
text={"The Year of Magical Thinking"}
|
|
112
|
+
/>
|
|
108
113
|
<div className="book__callout">A portrait of loss and grief</div>
|
|
109
114
|
<div>
|
|
110
115
|
By <Link href="#joan-didion">Joan Didion</Link>,{" "}
|
|
@@ -113,10 +118,10 @@ const exampleCard = (
|
|
|
113
118
|
</div>
|
|
114
119
|
<div className="book__filetype">
|
|
115
120
|
<Icon
|
|
116
|
-
name={IconNames.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
name={IconNames.Headset}
|
|
122
|
+
align={IconAlign.Left}
|
|
123
|
+
size={IconSizes.Small}
|
|
124
|
+
/>
|
|
120
125
|
Audiobook
|
|
121
126
|
</div>
|
|
122
127
|
<div className="book__description">
|
|
@@ -125,7 +130,7 @@ const exampleCard = (
|
|
|
125
130
|
<Link href="#">Read More</Link>
|
|
126
131
|
</div>
|
|
127
132
|
</>
|
|
128
|
-
</
|
|
133
|
+
</CardEdition>
|
|
129
134
|
);
|
|
130
135
|
|
|
131
136
|
export const cardsList = [];
|
|
@@ -31,21 +31,23 @@ describe("List", () => {
|
|
|
31
31
|
];
|
|
32
32
|
|
|
33
33
|
it("renders unordered list", () => {
|
|
34
|
-
render(
|
|
34
|
+
const utils = render(
|
|
35
35
|
<List type={ListTypes.Unordered}>
|
|
36
36
|
<li>Mahi-mahi</li>
|
|
37
37
|
<li>Golden trout</li>
|
|
38
38
|
</List>
|
|
39
39
|
);
|
|
40
|
-
expect(
|
|
40
|
+
expect(utils.container.querySelector(".list")).toBeInTheDocument();
|
|
41
41
|
expect(screen.getAllByRole("listitem")).toHaveLength(2);
|
|
42
42
|
expect(screen.getByText("Mahi-mahi")).toBeInTheDocument();
|
|
43
43
|
expect(screen.getByText("Golden trout")).toBeInTheDocument();
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
it("renders unordered list with the `listItems` prop", () => {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const utils = render(
|
|
48
|
+
<List type={ListTypes.Unordered} listItems={fishArray} />
|
|
49
|
+
);
|
|
50
|
+
expect(utils.container.querySelector(".list")).toBeInTheDocument();
|
|
49
51
|
expect(screen.getAllByRole("listitem")).toHaveLength(4);
|
|
50
52
|
expect(screen.getByText("Mahi-mahi")).toBeInTheDocument();
|
|
51
53
|
expect(screen.getByText("Golden trout")).toBeInTheDocument();
|
|
@@ -54,21 +56,23 @@ describe("List", () => {
|
|
|
54
56
|
});
|
|
55
57
|
|
|
56
58
|
it("renders ordered list", () => {
|
|
57
|
-
render(
|
|
59
|
+
const utils = render(
|
|
58
60
|
<List type={ListTypes.Ordered}>
|
|
59
61
|
<li>Mahi-mahi</li>
|
|
60
62
|
<li>Golden trout</li>
|
|
61
63
|
</List>
|
|
62
64
|
);
|
|
63
|
-
expect(
|
|
65
|
+
expect(utils.container.querySelector(".list")).toBeInTheDocument();
|
|
64
66
|
expect(screen.getAllByRole("listitem")).toHaveLength(2);
|
|
65
67
|
expect(screen.getByText("Mahi-mahi")).toBeInTheDocument();
|
|
66
68
|
expect(screen.getByText("Golden trout")).toBeInTheDocument();
|
|
67
69
|
});
|
|
68
70
|
|
|
69
71
|
it("renders ordered list with the `listItems` prop", () => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
const utils = render(
|
|
73
|
+
<List type={ListTypes.Ordered} listItems={fishArray} />
|
|
74
|
+
);
|
|
75
|
+
expect(utils.container.querySelector(".list")).toBeInTheDocument();
|
|
72
76
|
expect(screen.getAllByRole("listitem")).toHaveLength(4);
|
|
73
77
|
expect(screen.getByText("Mahi-mahi")).toBeInTheDocument();
|
|
74
78
|
expect(screen.getByText("Golden trout")).toBeInTheDocument();
|
|
@@ -3,6 +3,8 @@ import * as React from "react";
|
|
|
3
3
|
import bem from "../../utils/bem";
|
|
4
4
|
import { ListTypes } from "./ListTypes";
|
|
5
5
|
import Heading from "../Heading/Heading";
|
|
6
|
+
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
7
|
+
|
|
6
8
|
interface DefinitionProps {
|
|
7
9
|
term: string;
|
|
8
10
|
definition: string;
|
|
@@ -56,7 +58,7 @@ export default function List(props: React.PropsWithChildren<ListProps>) {
|
|
|
56
58
|
|
|
57
59
|
const baseClass = "list";
|
|
58
60
|
let listTag;
|
|
59
|
-
let
|
|
61
|
+
let invalidText = "";
|
|
60
62
|
/**
|
|
61
63
|
* This returns either the `children` elements passed to the `List` component
|
|
62
64
|
* first, and if that is not passed, it will check and render the data passed
|
|
@@ -87,10 +89,10 @@ export default function List(props: React.PropsWithChildren<ListProps>) {
|
|
|
87
89
|
* Checks for `li` element type and throws an error if it is a different type.
|
|
88
90
|
*/
|
|
89
91
|
const checkLiChildrenError = (listType) => {
|
|
90
|
-
|
|
92
|
+
invalidText = `Direct children of \`List\` (${listType}) should be \`<li>\`s`;
|
|
91
93
|
React.Children.map(children, function (child: React.ReactElement) {
|
|
92
|
-
if (child
|
|
93
|
-
throw new Error(
|
|
94
|
+
if (child?.type !== "li" && child?.props?.mdxType !== "li") {
|
|
95
|
+
throw new Error(invalidText);
|
|
94
96
|
}
|
|
95
97
|
});
|
|
96
98
|
};
|
|
@@ -119,7 +121,7 @@ export default function List(props: React.PropsWithChildren<ListProps>) {
|
|
|
119
121
|
);
|
|
120
122
|
break;
|
|
121
123
|
case ListTypes.Definition:
|
|
122
|
-
|
|
124
|
+
invalidText =
|
|
123
125
|
"Direct children of `List` (definition) should be `<dt>`s or `<dd>`s";
|
|
124
126
|
React.Children.map(children, function (child: React.ReactElement) {
|
|
125
127
|
if (
|
|
@@ -130,7 +132,7 @@ export default function List(props: React.PropsWithChildren<ListProps>) {
|
|
|
130
132
|
child.props.mdxType !== "dd" &&
|
|
131
133
|
child.props.mdxType !== React.Fragment
|
|
132
134
|
) {
|
|
133
|
-
throw new Error(
|
|
135
|
+
throw new Error(invalidText);
|
|
134
136
|
}
|
|
135
137
|
});
|
|
136
138
|
listTag = (
|
|
@@ -139,7 +141,7 @@ export default function List(props: React.PropsWithChildren<ListProps>) {
|
|
|
139
141
|
className={bem("definition-list", modifiers, baseClass)}
|
|
140
142
|
>
|
|
141
143
|
{title && (
|
|
142
|
-
<Heading id={`${id}-heading`} level={
|
|
144
|
+
<Heading id={`${id}-heading`} level={HeadingLevels.Two}>
|
|
143
145
|
{title}
|
|
144
146
|
</Heading>
|
|
145
147
|
)}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
margin: unset; // browser automatically applies margin
|
|
12
12
|
|
|
13
13
|
&__definition-list {
|
|
14
|
-
border-bottom: 1px solid var(--ui-gray-light);
|
|
14
|
+
border-bottom: 1px solid var(--ui-gray-light-cool);
|
|
15
15
|
|
|
16
16
|
h2 {
|
|
17
17
|
border-top: 3px solid var(--section-research-primary);
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
margin: var(--space-xs) 0 0;
|
|
27
27
|
|
|
28
28
|
dt {
|
|
29
|
-
border-top: 1px solid var(--ui-gray-light);
|
|
29
|
+
border-top: 1px solid var(--ui-gray-light-cool);
|
|
30
30
|
font-size: var(--font-size-0);
|
|
31
31
|
font-weight: bold;
|
|
32
32
|
padding-bottom: 0;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
padding-bottom: var(--space-s);
|
|
46
46
|
|
|
47
47
|
@include breakpoint($breakpoint-medium) {
|
|
48
|
-
border-top: 1px solid var(--ui-gray-light);
|
|
48
|
+
border-top: 1px solid var(--ui-gray-light-cool);
|
|
49
49
|
padding-top: var(--space-s);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from "@storybook/addon-docs/blocks";
|
|
9
9
|
import Modal from "./Modal";
|
|
10
10
|
import Button from "../Button/Button";
|
|
11
|
-
import {
|
|
11
|
+
import { getCategory } from "../../utils/componentCategories";
|
|
12
12
|
|
|
13
13
|
<Meta
|
|
14
|
-
title="Modal"
|
|
14
|
+
title={getCategory("Modal")}
|
|
15
15
|
component={Modal}
|
|
16
16
|
argTypes={{
|
|
17
17
|
children: { table: { disable: true } },
|
|
@@ -23,6 +23,11 @@ import { ExampleCard } from "../Card/Card.stories";
|
|
|
23
23
|
|
|
24
24
|
# Modal
|
|
25
25
|
|
|
26
|
+
| Component Version | DS Version |
|
|
27
|
+
| ----------------- | ---------- |
|
|
28
|
+
| Added | `0.1.0` |
|
|
29
|
+
| Latest | `0.3.5` |
|
|
30
|
+
|
|
26
31
|
<Description of={Modal} />
|
|
27
32
|
|
|
28
33
|
export const ModalStory = (args) => {
|
|
@@ -34,7 +39,6 @@ export const ModalStory = (args) => {
|
|
|
34
39
|
<Button id="1" onClick={openModal}>
|
|
35
40
|
Open Modal
|
|
36
41
|
</Button>
|
|
37
|
-
<ExampleCard />
|
|
38
42
|
<p>
|
|
39
43
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
|
|
40
44
|
tempor incididunt ut labore et dolore magna aliqua. Tempus quam
|
|
@@ -15,9 +15,17 @@ import Notification, {
|
|
|
15
15
|
} from "./Notification";
|
|
16
16
|
import { NotificationTypes } from "./NotificationTypes";
|
|
17
17
|
import Icon from "../Icons/Icon";
|
|
18
|
+
import {
|
|
19
|
+
IconSizes,
|
|
20
|
+
IconColors,
|
|
21
|
+
IconNames,
|
|
22
|
+
IconAlign,
|
|
23
|
+
} from "../Icons/IconTypes";
|
|
24
|
+
import { getCategory } from "../../utils/componentCategories";
|
|
25
|
+
import DSProvider from "../../theme/provider";
|
|
18
26
|
|
|
19
27
|
<Meta
|
|
20
|
-
title="Notification"
|
|
28
|
+
title={getCategory("Notification")}
|
|
21
29
|
component={Notification}
|
|
22
30
|
decorators={[withDesign]}
|
|
23
31
|
parameters={{
|
|
@@ -32,13 +40,17 @@ import Icon from "../Icons/Icon";
|
|
|
32
40
|
|
|
33
41
|
# Notification
|
|
34
42
|
|
|
43
|
+
| Component Version | DS Version |
|
|
44
|
+
| ----------------- | ---------- |
|
|
45
|
+
| Added | `0.23.2` |
|
|
46
|
+
|
|
35
47
|
<Description of={Notification} />
|
|
36
48
|
|
|
37
49
|
The `Notification` component is a configurable callout that should be used to display important messages.
|
|
38
50
|
|
|
39
51
|
In the preview below, the border around the `Notification` is not part of the component. It has been added to help illustrate how the `Notification` sits within a parent element.
|
|
40
52
|
|
|
41
|
-
<
|
|
53
|
+
<Canvas>
|
|
42
54
|
<Story
|
|
43
55
|
name="Notification Props"
|
|
44
56
|
args={{
|
|
@@ -66,7 +78,7 @@ In the preview below, the border around the `Notification` is not part of the co
|
|
|
66
78
|
</div>
|
|
67
79
|
)}
|
|
68
80
|
</Story>
|
|
69
|
-
</
|
|
81
|
+
</Canvas>
|
|
70
82
|
|
|
71
83
|
<ArgsTable story="Notification Props" />
|
|
72
84
|
|
|
@@ -75,92 +87,114 @@ In the preview below, the border around the `Notification` is not part of the co
|
|
|
75
87
|
### With NotificationHeading
|
|
76
88
|
|
|
77
89
|
<Canvas>
|
|
78
|
-
<
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
<DSProvider>
|
|
91
|
+
<Notification>
|
|
92
|
+
<NotificationHeading>Standard Notification</NotificationHeading>
|
|
93
|
+
<NotificationContent>
|
|
94
|
+
This is a "standard" Notification with a heading. Cras mattis
|
|
95
|
+
consectetur purus sit amet fermentum. Maecenas faucibus mollis interdum.
|
|
96
|
+
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cum sociis
|
|
97
|
+
natoque penatibus et magnis dis parturient montes, nascetur ridiculus
|
|
98
|
+
mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor
|
|
99
|
+
auctor.
|
|
100
|
+
</NotificationContent>
|
|
101
|
+
</Notification>
|
|
102
|
+
</DSProvider>
|
|
88
103
|
</Canvas>
|
|
89
104
|
|
|
90
105
|
<Canvas>
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
<DSProvider>
|
|
107
|
+
<Notification notificationType={NotificationTypes.Announcement}>
|
|
108
|
+
<NotificationHeading>Announcement Notification</NotificationHeading>
|
|
109
|
+
<NotificationContent>
|
|
110
|
+
This is an "announcement" Notification with a heading. Cras mattis
|
|
111
|
+
consectetur purus sit amet fermentum. Maecenas faucibus mollis interdum.
|
|
112
|
+
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cum sociis
|
|
113
|
+
natoque penatibus et magnis dis parturient montes, nascetur ridiculus
|
|
114
|
+
mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor
|
|
115
|
+
auctor.
|
|
116
|
+
</NotificationContent>
|
|
117
|
+
</Notification>
|
|
118
|
+
</DSProvider>
|
|
101
119
|
</Canvas>
|
|
102
120
|
|
|
103
121
|
<Canvas>
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
122
|
+
<DSProvider>
|
|
123
|
+
<Notification notificationType={NotificationTypes.Warning}>
|
|
124
|
+
<NotificationHeading>Warning Notification</NotificationHeading>
|
|
125
|
+
<NotificationContent>
|
|
126
|
+
This is a "warning" Notification with a heading. Cras mattis consectetur
|
|
127
|
+
purus sit amet fermentum. Maecenas faucibus mollis interdum. Morbi leo
|
|
128
|
+
risus, porta ac consectetur ac, vestibulum at eros. Cum sociis natoque
|
|
129
|
+
penatibus et magnis dis parturient montes, nascetur ridiculus mus.
|
|
130
|
+
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
|
|
131
|
+
</NotificationContent>
|
|
132
|
+
</Notification>
|
|
133
|
+
</DSProvider>
|
|
114
134
|
</Canvas>
|
|
115
135
|
|
|
116
136
|
### Without NotificationHeading
|
|
117
137
|
|
|
118
138
|
<Canvas>
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
<DSProvider>
|
|
140
|
+
<Notification>
|
|
141
|
+
<NotificationContent>
|
|
142
|
+
This is a "standard" Notification without a heading. Cras mattis
|
|
143
|
+
consectetur purus sit amet fermentum. Maecenas faucibus mollis interdum.
|
|
144
|
+
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cum sociis
|
|
145
|
+
natoque penatibus et magnis dis parturient montes, nascetur ridiculus
|
|
146
|
+
mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor
|
|
147
|
+
auctor.
|
|
148
|
+
</NotificationContent>
|
|
149
|
+
</Notification>
|
|
150
|
+
</DSProvider>
|
|
128
151
|
</Canvas>
|
|
129
152
|
|
|
130
153
|
<Canvas>
|
|
131
|
-
<
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
<DSProvider>
|
|
155
|
+
<Notification notificationType={NotificationTypes.Announcement}>
|
|
156
|
+
<NotificationContent>
|
|
157
|
+
This is an "announcement" Notification without a heading. Cras mattis
|
|
158
|
+
consectetur purus sit amet fermentum. Maecenas faucibus mollis interdum.
|
|
159
|
+
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cum sociis
|
|
160
|
+
natoque penatibus et magnis dis parturient montes, nascetur ridiculus
|
|
161
|
+
mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor
|
|
162
|
+
auctor.
|
|
163
|
+
</NotificationContent>
|
|
164
|
+
</Notification>
|
|
165
|
+
</DSProvider>
|
|
140
166
|
</Canvas>
|
|
141
167
|
|
|
142
168
|
<Canvas>
|
|
143
|
-
<
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
169
|
+
<DSProvider>
|
|
170
|
+
<Notification notificationType={NotificationTypes.Warning}>
|
|
171
|
+
<NotificationContent>
|
|
172
|
+
This is a "warning" Notification without a heading. Cras mattis
|
|
173
|
+
consectetur purus sit amet fermentum. Maecenas faucibus mollis interdum.
|
|
174
|
+
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cum sociis
|
|
175
|
+
natoque penatibus et magnis dis parturient montes, nascetur ridiculus
|
|
176
|
+
mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor
|
|
177
|
+
auctor.
|
|
178
|
+
</NotificationContent>
|
|
179
|
+
</Notification>
|
|
180
|
+
</DSProvider>
|
|
152
181
|
</Canvas>
|
|
153
182
|
|
|
154
183
|
## Custom Icon
|
|
155
184
|
|
|
156
185
|
The default icon can be overridden by using the `icon` prop to pass a custom `Icon` component.
|
|
157
186
|
|
|
158
|
-
<
|
|
187
|
+
<Canvas>
|
|
159
188
|
<Story name="Custom Icons">
|
|
160
189
|
{(args) => (
|
|
161
190
|
<Notification
|
|
162
191
|
icon={
|
|
163
|
-
<Icon
|
|
192
|
+
<Icon
|
|
193
|
+
align={IconAlign.Left}
|
|
194
|
+
name={IconNames.Check}
|
|
195
|
+
size={IconSizes.Large}
|
|
196
|
+
color={IconColors.SectionResearchSecondary}
|
|
197
|
+
/>
|
|
164
198
|
}
|
|
165
199
|
>
|
|
166
200
|
<NotificationHeading>Custom Icon</NotificationHeading>
|
|
@@ -173,13 +207,13 @@ The default icon can be overridden by using the `icon` prop to pass a custom `Ic
|
|
|
173
207
|
</Notification>
|
|
174
208
|
)}
|
|
175
209
|
</Story>
|
|
176
|
-
</
|
|
210
|
+
</Canvas>
|
|
177
211
|
|
|
178
212
|
## Development Errors
|
|
179
213
|
|
|
180
214
|
The `Notification` component will only accept one `NotificationHeading` child and one `NotificationContent` child.
|
|
181
215
|
|
|
182
|
-
<
|
|
216
|
+
<Canvas>
|
|
183
217
|
<Story name="Development Errors">
|
|
184
218
|
{(args) => (
|
|
185
219
|
<Notification>
|
|
@@ -190,4 +224,4 @@ The `Notification` component will only accept one `NotificationHeading` child an
|
|
|
190
224
|
</Notification>
|
|
191
225
|
)}
|
|
192
226
|
</Story>
|
|
193
|
-
</
|
|
227
|
+
</Canvas>
|
|
@@ -86,13 +86,6 @@ describe("Notification: check for Announcement Notification", () => {
|
|
|
86
86
|
utils.container.querySelector(".notification--announcement")
|
|
87
87
|
).toBeInTheDocument();
|
|
88
88
|
});
|
|
89
|
-
it("Renders Icon with proper color", () => {
|
|
90
|
-
expect(
|
|
91
|
-
utils.container.querySelector(
|
|
92
|
-
".notification-icon.icon--section-research-secondary"
|
|
93
|
-
)
|
|
94
|
-
).toBeInTheDocument();
|
|
95
|
-
});
|
|
96
89
|
});
|
|
97
90
|
|
|
98
91
|
describe("Notification: check for Warning Notification", () => {
|
|
@@ -114,12 +107,6 @@ describe("Notification: check for Warning Notification", () => {
|
|
|
114
107
|
utils.container.querySelector(".notification--warning")
|
|
115
108
|
).toBeInTheDocument();
|
|
116
109
|
});
|
|
117
|
-
|
|
118
|
-
it("Renders Icon with proper color", () => {
|
|
119
|
-
expect(
|
|
120
|
-
utils.container.querySelector(".notification-icon.icon--brand-primary")
|
|
121
|
-
).toBeInTheDocument();
|
|
122
|
-
});
|
|
123
110
|
});
|
|
124
111
|
|
|
125
112
|
describe("Notification: check for custom Icon", () => {
|
|
@@ -130,9 +117,9 @@ describe("Notification: check for custom Icon", () => {
|
|
|
130
117
|
id="notificationID"
|
|
131
118
|
icon={
|
|
132
119
|
<Icon
|
|
133
|
-
name={IconNames.
|
|
134
|
-
size={IconSizes.
|
|
135
|
-
color={IconColors.
|
|
120
|
+
name={IconNames.Check}
|
|
121
|
+
size={IconSizes.Large}
|
|
122
|
+
color={IconColors.BrandPrimary}
|
|
136
123
|
className="custom-icon"
|
|
137
124
|
/>
|
|
138
125
|
}
|
|
@@ -4,8 +4,9 @@ import bem from "../../utils/bem";
|
|
|
4
4
|
import Button from "../Button/Button";
|
|
5
5
|
import { ButtonTypes } from "../Button/ButtonTypes";
|
|
6
6
|
import Heading from "../Heading/Heading";
|
|
7
|
+
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
7
8
|
import Icon from "../Icons/Icon";
|
|
8
|
-
import { IconColors, IconNames } from "../Icons/IconTypes";
|
|
9
|
+
import { IconColors, IconNames, IconSizes } from "../Icons/IconTypes";
|
|
9
10
|
import { NotificationTypes } from "./NotificationTypes";
|
|
10
11
|
|
|
11
12
|
export interface NotificationProps {
|
|
@@ -34,7 +35,7 @@ export function NotificationHeading(props) {
|
|
|
34
35
|
const { children, className } = props;
|
|
35
36
|
return (
|
|
36
37
|
<Heading
|
|
37
|
-
level={
|
|
38
|
+
level={HeadingLevels.Four}
|
|
38
39
|
className={bem("notification-heading", [], "", [className])}
|
|
39
40
|
>
|
|
40
41
|
{children}
|
|
@@ -42,7 +43,7 @@ export function NotificationHeading(props) {
|
|
|
42
43
|
);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
//
|
|
46
|
+
// NotificationContent child-component
|
|
46
47
|
export function NotificationContent(props) {
|
|
47
48
|
const { children, className } = props;
|
|
48
49
|
return (
|
|
@@ -94,9 +95,9 @@ export default function Notification(
|
|
|
94
95
|
<Icon
|
|
95
96
|
decorative={false}
|
|
96
97
|
className="notification-icon"
|
|
97
|
-
name={IconNames.
|
|
98
|
-
color={IconColors.
|
|
99
|
-
|
|
98
|
+
name={IconNames.SpeakerNotes}
|
|
99
|
+
color={IconColors.SectionResearchSecondary}
|
|
100
|
+
size={IconSizes.Large}
|
|
100
101
|
/>
|
|
101
102
|
);
|
|
102
103
|
case "warning":
|
|
@@ -104,9 +105,9 @@ export default function Notification(
|
|
|
104
105
|
<Icon
|
|
105
106
|
decorative={false}
|
|
106
107
|
className="notification-icon"
|
|
107
|
-
name={IconNames.
|
|
108
|
-
color={IconColors.
|
|
109
|
-
|
|
108
|
+
name={IconNames.ErrorFilled}
|
|
109
|
+
color={IconColors.BrandPrimary}
|
|
110
|
+
size={IconSizes.Large}
|
|
110
111
|
/>
|
|
111
112
|
);
|
|
112
113
|
default:
|
|
@@ -189,10 +190,9 @@ export default function Notification(
|
|
|
189
190
|
onClick={handleClose}
|
|
190
191
|
>
|
|
191
192
|
<Icon
|
|
192
|
-
modifiers={["medium"]}
|
|
193
193
|
decorative={false}
|
|
194
|
-
name={IconNames.
|
|
195
|
-
|
|
194
|
+
name={IconNames.Close}
|
|
195
|
+
size={IconSizes.Large}
|
|
196
196
|
/>
|
|
197
197
|
</Button>
|
|
198
198
|
) : null}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&--announcement {
|
|
48
|
-
background-color: var(--ui-gray-light);
|
|
48
|
+
background-color: var(--ui-gray-light-cool);
|
|
49
49
|
|
|
50
50
|
.notification-heading {
|
|
51
51
|
color: var(--section-research-secondary);
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&--warning {
|
|
56
|
-
background-color: var(--ui-gray-
|
|
56
|
+
background-color: var(--ui-gray-xx-light-cool);
|
|
57
57
|
|
|
58
58
|
.notification-heading {
|
|
59
59
|
color: var(--brand-primary);
|
|
@@ -79,13 +79,14 @@
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
.icon {
|
|
82
|
+
.chakra-icon {
|
|
83
83
|
flex-shrink: 0;
|
|
84
84
|
margin-right: var(--space-s);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.dismissible-button {
|
|
88
88
|
align-items: center;
|
|
89
|
+
background-color: inherit;
|
|
89
90
|
color: var(--ui-black);
|
|
90
91
|
display: flex;
|
|
91
92
|
height: var(--space-l);
|
|
@@ -100,7 +101,7 @@
|
|
|
100
101
|
width: var(--space-m);
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
.icon {
|
|
104
|
+
.chakra-icon {
|
|
104
105
|
height: var(--space-m);
|
|
105
106
|
margin-right: 0;
|
|
106
107
|
width: var(--space-m);
|