@nypl/design-system-react-components 0.25.10 → 0.25.11
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 +21 -1
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/Logo/LogoSvgs.d.ts +17 -1
- package/dist/components/Logo/LogoTypes.d.ts +17 -1
- package/dist/components/Notification/Notification.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +4 -0
- package/dist/design-system-react-components.cjs.development.js +1215 -317
- 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 +1217 -319
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/theme/components/notification.d.ts +13 -4
- package/dist/theme/components/searchBar.d.ts +4 -0
- package/dist/theme/components/structuredContent.d.ts +9 -9
- package/dist/theme/components/textInput.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +1 -1
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +9 -6
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +28 -20
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -1
- package/src/components/Icons/Icon.stories.mdx +1 -1
- package/src/components/Icons/Icon.test.tsx +1 -1
- package/src/components/Icons/Icon.tsx +1 -1
- package/src/components/List/List.stories.mdx +24 -5
- package/src/components/List/List.test.tsx +1 -1
- package/src/components/List/List.tsx +1 -1
- package/src/components/List/__snapshots__/List.test.tsx.snap +3 -1
- package/src/components/Logo/Logo.stories.mdx +7 -5
- package/src/components/Logo/LogoSvgs.tsx +33 -1
- package/src/components/Logo/LogoTypes.tsx +16 -0
- package/src/components/Notification/Notification.stories.mdx +68 -1
- package/src/components/Notification/Notification.test.tsx +49 -1
- package/src/components/Notification/Notification.tsx +16 -8
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
- package/src/components/SearchBar/SearchBar.tsx +2 -1
- package/src/components/Select/Select.stories.mdx +1 -1
- package/src/components/Select/Select.tsx +4 -1
- package/src/components/Slider/Slider.stories.mdx +1 -1
- package/src/components/StructuredContent/StructuredContent.stories.mdx +1 -1
- package/src/components/Tabs/Tabs.stories.mdx +1 -1
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/Toggle/Toggle.stories.mdx +1 -1
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +4 -4
- package/src/theme/components/global.ts +1 -1
- package/src/theme/components/list.ts +2 -2
- package/src/theme/components/notification.ts +18 -8
- package/src/theme/components/searchBar.ts +4 -0
- package/src/theme/components/structuredContent.ts +26 -6
- package/src/theme/components/textInput.ts +1 -0
- package/src/theme/components/toggle.ts +1 -1
- package/src/theme/foundations/typography.ts +1 -1
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
Notification: {
|
|
3
3
|
parts: string[];
|
|
4
|
-
baseStyle: ({ centered, noMargin, notificationType }: {
|
|
4
|
+
baseStyle: ({ centered, dismissible, noMargin, notificationType }: {
|
|
5
5
|
centered: any;
|
|
6
|
+
dismissible: any;
|
|
6
7
|
noMargin: any;
|
|
7
8
|
notificationType: any;
|
|
8
9
|
}) => {
|
|
9
10
|
bg: string;
|
|
10
11
|
display: string;
|
|
11
12
|
fontSize: string;
|
|
12
|
-
padding: string;
|
|
13
13
|
position: string;
|
|
14
14
|
textAlign: string;
|
|
15
15
|
borderRadius: string;
|
|
16
16
|
margin: string;
|
|
17
17
|
container: {
|
|
18
18
|
margin: string;
|
|
19
|
-
width: string;
|
|
20
19
|
maxWidth: string;
|
|
20
|
+
padding: string;
|
|
21
|
+
paddingRight: string;
|
|
22
|
+
paddingLeft: string;
|
|
23
|
+
width: string;
|
|
21
24
|
};
|
|
22
25
|
dismissibleButton: {
|
|
23
26
|
border: string;
|
|
24
|
-
alignItems: string;
|
|
25
27
|
bgColor: string;
|
|
28
|
+
alignItems: string;
|
|
26
29
|
color: string;
|
|
27
30
|
display: string;
|
|
28
31
|
height: string;
|
|
@@ -55,6 +58,12 @@ declare const _default: {
|
|
|
55
58
|
marginTop: string;
|
|
56
59
|
paddingLeft: string;
|
|
57
60
|
width: string;
|
|
61
|
+
a: {
|
|
62
|
+
color: string;
|
|
63
|
+
_hover: {
|
|
64
|
+
color: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
58
67
|
};
|
|
59
68
|
};
|
|
60
69
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const SearchBar: {
|
|
2
|
+
parts: string[];
|
|
2
3
|
baseStyle: {
|
|
3
4
|
display: string;
|
|
4
5
|
marginBottom: {
|
|
@@ -9,6 +10,9 @@ declare const SearchBar: {
|
|
|
9
10
|
base: string;
|
|
10
11
|
md: string;
|
|
11
12
|
};
|
|
13
|
+
select: {
|
|
14
|
+
marginBottom: string;
|
|
15
|
+
};
|
|
12
16
|
};
|
|
13
17
|
};
|
|
14
18
|
export default SearchBar;
|
|
@@ -8,24 +8,24 @@ declare const StructuredContent: {
|
|
|
8
8
|
imageFigure: {
|
|
9
9
|
marginBottom: string;
|
|
10
10
|
maxWidth?: string;
|
|
11
|
-
float: any;
|
|
12
|
-
marginLeft: string;
|
|
13
|
-
marginRight: string;
|
|
11
|
+
float: any[];
|
|
12
|
+
marginLeft: string[];
|
|
13
|
+
marginRight: string[];
|
|
14
14
|
width: string;
|
|
15
15
|
};
|
|
16
16
|
imageWrapper: {
|
|
17
17
|
marginBottom: string;
|
|
18
18
|
maxWidth?: string;
|
|
19
|
-
float: any;
|
|
20
|
-
marginLeft: string;
|
|
21
|
-
marginRight: string;
|
|
19
|
+
float: any[];
|
|
20
|
+
marginLeft: string[];
|
|
21
|
+
marginRight: string[];
|
|
22
22
|
width: string;
|
|
23
23
|
};
|
|
24
24
|
image: {
|
|
25
25
|
maxWidth?: string;
|
|
26
|
-
float: any;
|
|
27
|
-
marginLeft: string;
|
|
28
|
-
marginRight: string;
|
|
26
|
+
float: any[];
|
|
27
|
+
marginLeft: string[];
|
|
28
|
+
marginRight: string[];
|
|
29
29
|
marginBottom: string;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
@@ -10,6 +10,7 @@ declare const TextInput: {
|
|
|
10
10
|
border: string;
|
|
11
11
|
borderColor: string;
|
|
12
12
|
borderRadius: string;
|
|
13
|
+
fontSize: string;
|
|
13
14
|
py: string;
|
|
14
15
|
px: string;
|
|
15
16
|
_hover: {
|
|
@@ -52,6 +53,7 @@ declare const TextInput: {
|
|
|
52
53
|
border: string;
|
|
53
54
|
borderColor: string;
|
|
54
55
|
borderRadius: string;
|
|
56
|
+
fontSize: string;
|
|
55
57
|
py: string;
|
|
56
58
|
px: string;
|
|
57
59
|
_hover: {
|
package/package.json
CHANGED
|
@@ -8,12 +8,13 @@ import { FormGaps } from "../Form/FormTypes";
|
|
|
8
8
|
import HelperErrorText, {
|
|
9
9
|
HelperErrorTextType,
|
|
10
10
|
} from "../HelperErrorText/HelperErrorText";
|
|
11
|
+
import { helperTextMargin } from "../../theme/components/global";
|
|
11
12
|
import TextInput, {
|
|
12
13
|
InputProps,
|
|
13
14
|
TextInputRefType,
|
|
14
15
|
} from "../TextInput/TextInput";
|
|
15
16
|
import generateUUID from "../../helpers/generateUUID";
|
|
16
|
-
import { useMultiStyleConfig } from "@chakra-ui/
|
|
17
|
+
import { Box, useMultiStyleConfig } from "@chakra-ui/react";
|
|
17
18
|
|
|
18
19
|
// The object shape for the DatePicker's start and end date state values.
|
|
19
20
|
export interface FullDateType {
|
|
@@ -416,11 +417,13 @@ const DatePicker = React.forwardRef<TextInputRefType, DatePickerProps>(
|
|
|
416
417
|
)}
|
|
417
418
|
</DateRangeRow>
|
|
418
419
|
{helperText && isDateRange && showHelperInvalidText && (
|
|
419
|
-
<
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
420
|
+
<Box __css={helperTextMargin}>
|
|
421
|
+
<HelperErrorText
|
|
422
|
+
id={`${id}-helper-text`}
|
|
423
|
+
isInvalid={false}
|
|
424
|
+
text={helperText}
|
|
425
|
+
/>
|
|
426
|
+
</Box>
|
|
424
427
|
)}
|
|
425
428
|
</DatePickerWrapper>
|
|
426
429
|
);
|
|
@@ -433,17 +433,21 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 4`] = `
|
|
|
433
433
|
</div>
|
|
434
434
|
</div>
|
|
435
435
|
<div
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
436
|
+
className="css-fjhuh4"
|
|
437
|
+
>
|
|
438
|
+
<div
|
|
439
|
+
aria-atomic={true}
|
|
440
|
+
aria-live="off"
|
|
441
|
+
className=" css-0"
|
|
442
|
+
dangerouslySetInnerHTML={
|
|
443
|
+
Object {
|
|
444
|
+
"__html": "Note that the Library may be closed on Sundays.",
|
|
445
|
+
}
|
|
442
446
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
+
data-isinvalid={false}
|
|
448
|
+
id="invalid-helper-text"
|
|
449
|
+
/>
|
|
450
|
+
</div>
|
|
447
451
|
</fieldset>
|
|
448
452
|
</div>
|
|
449
453
|
`;
|
|
@@ -545,17 +549,21 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 5`] = `
|
|
|
545
549
|
</div>
|
|
546
550
|
</div>
|
|
547
551
|
<div
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
className="css-fjhuh4"
|
|
553
|
+
>
|
|
554
|
+
<div
|
|
555
|
+
aria-atomic={true}
|
|
556
|
+
aria-live="off"
|
|
557
|
+
className=" css-0"
|
|
558
|
+
dangerouslySetInnerHTML={
|
|
559
|
+
Object {
|
|
560
|
+
"__html": "Note that the Library may be closed on Sundays.",
|
|
561
|
+
}
|
|
554
562
|
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
563
|
+
data-isinvalid={false}
|
|
564
|
+
id="disabled-helper-text"
|
|
565
|
+
/>
|
|
566
|
+
</div>
|
|
559
567
|
</fieldset>
|
|
560
568
|
</div>
|
|
561
569
|
`;
|
|
@@ -35,7 +35,7 @@ describe("Icon", () => {
|
|
|
35
35
|
const warn = jest.spyOn(console, "warn");
|
|
36
36
|
render(<Icon />);
|
|
37
37
|
expect(warn).toHaveBeenCalledWith(
|
|
38
|
-
"Pass an icon `name` prop or an SVG child to
|
|
38
|
+
"Icon: Pass an icon `name` prop or an SVG child to ensure an icon appears."
|
|
39
39
|
);
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -82,7 +82,7 @@ export default function Icon(props: React.PropsWithChildren<IconProps>) {
|
|
|
82
82
|
return null;
|
|
83
83
|
} else if (!name && !children) {
|
|
84
84
|
console.warn(
|
|
85
|
-
"Pass an icon `name` prop or an SVG child to
|
|
85
|
+
"Icon: Pass an icon `name` prop or an SVG child to ensure an icon appears."
|
|
86
86
|
);
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
@@ -51,7 +51,7 @@ export const enumValues = getStorybookEnumValues(ListTypes, "ListTypes");
|
|
|
51
51
|
| Component Version | DS Version |
|
|
52
52
|
| ----------------- | ---------- |
|
|
53
53
|
| Added | `0.7.0` |
|
|
54
|
-
| Latest | `0.25.
|
|
54
|
+
| Latest | `0.25.11` |
|
|
55
55
|
|
|
56
56
|
<Description of={List} />
|
|
57
57
|
|
|
@@ -63,8 +63,15 @@ export const animalCrossingDefinitions = [
|
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
term: "Golden trout",
|
|
66
|
-
definition:
|
|
67
|
-
|
|
66
|
+
definition: (
|
|
67
|
+
<p>
|
|
68
|
+
The golden trout is a <b>beautifully</b> colored fish that can only live
|
|
69
|
+
in very clean waters. They are difficult to come across since they are
|
|
70
|
+
found only in high mountain streams. As a side note, I find it much
|
|
71
|
+
easier to appreciate fish that aren't such prima donnas about
|
|
72
|
+
everything.
|
|
73
|
+
</p>
|
|
74
|
+
),
|
|
68
75
|
},
|
|
69
76
|
{
|
|
70
77
|
term: "Rainbowfish",
|
|
@@ -73,8 +80,20 @@ export const animalCrossingDefinitions = [
|
|
|
73
80
|
},
|
|
74
81
|
{
|
|
75
82
|
term: "Suckerfish",
|
|
76
|
-
definition:
|
|
77
|
-
|
|
83
|
+
definition: (
|
|
84
|
+
<p>
|
|
85
|
+
The{" "}
|
|
86
|
+
<Link href="https://animalcrossing.fandom.com/wiki/Suckerfish">
|
|
87
|
+
suckerfish
|
|
88
|
+
</Link>{" "}
|
|
89
|
+
is a curious fish that likes to attach itself with its sucker mouth to
|
|
90
|
+
larger marine animals. The benefit to the suckerfish is that it gets to
|
|
91
|
+
eat smaller parasites and dead skin off the host's body. Amusingly, some
|
|
92
|
+
people have used suckerfish on cords to catch large turtles with the
|
|
93
|
+
fish's own suction! I imagine this practice is the cause of some awkward
|
|
94
|
+
conversations between fish and turtle, eh wot?
|
|
95
|
+
</p>
|
|
96
|
+
),
|
|
78
97
|
},
|
|
79
98
|
];
|
|
80
99
|
export const itemGroups = [
|
|
@@ -10,7 +10,7 @@ const fishArray = ["Mahi-mahi", "Golden trout", "Rainbowfish", "Suckerfish"];
|
|
|
10
10
|
const fishDefinitions = [
|
|
11
11
|
{
|
|
12
12
|
term: "Mahi-mahi",
|
|
13
|
-
definition:
|
|
13
|
+
definition: <p>The mahi-mahi is an ocean fish known...</p>,
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
term: "Golden trout",
|
|
@@ -57,7 +57,7 @@ export const sizesEnumValues = getStorybookEnumValues(LogoSizes, "LogoSizes");
|
|
|
57
57
|
| Component Version | DS Version |
|
|
58
58
|
| ----------------- | ---------- |
|
|
59
59
|
| Added | `0.25.9` |
|
|
60
|
-
| Latest | `0.25.
|
|
60
|
+
| Latest | `0.25.11` |
|
|
61
61
|
|
|
62
62
|
<Description of={Logo} />
|
|
63
63
|
|
|
@@ -77,11 +77,13 @@ export const sizesEnumValues = getStorybookEnumValues(LogoSizes, "LogoSizes");
|
|
|
77
77
|
{(args) => (
|
|
78
78
|
<div
|
|
79
79
|
style={
|
|
80
|
-
args.name.indexOf("White") !== -1
|
|
80
|
+
args.name.indexOf("White") !== -1 ||
|
|
81
|
+
args.name.indexOf("Negative") !== -1
|
|
81
82
|
? {
|
|
82
83
|
backgroundColor: "var(--nypl-colors-ui-gray-xdark)",
|
|
83
84
|
display: "inline-block",
|
|
84
85
|
padding: "var(--nypl-space-l)",
|
|
86
|
+
width: "100%",
|
|
85
87
|
}
|
|
86
88
|
: undefined
|
|
87
89
|
}
|
|
@@ -104,11 +106,11 @@ export const logoRow = (logo, opts = {}) => {
|
|
|
104
106
|
const styles = { textAlign: "center" };
|
|
105
107
|
const { size = LogoSizes.Large, displayValue } = opts;
|
|
106
108
|
let key = logo;
|
|
107
|
-
if (logo.indexOf("White") !== -1) {
|
|
109
|
+
if (logo.indexOf("White") !== -1 || logo.indexOf("Negative") !== -1) {
|
|
108
110
|
styles.backgroundColor = "var(--nypl-colors-ui-gray-xdark)";
|
|
109
|
-
styles.paddingBottom = "32px";
|
|
110
|
-
styles.paddingTop = "32px";
|
|
111
111
|
styles.color = "var(--nypl-colors-ui-white)";
|
|
112
|
+
styles.paddingBottom = "var(--nypl-space-l)";
|
|
113
|
+
styles.paddingTop = "var(--nypl-space-l)";
|
|
112
114
|
}
|
|
113
115
|
if (size !== LogoSizes.Large) {
|
|
114
116
|
key += `-${size}`;
|
|
@@ -1,34 +1,66 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
2
|
import logo_bpl_black from "../../../icons/svg/logo_bpl_black.svg";
|
|
3
|
+
import logo_bpl_white from "../../../icons/svg/logo_bpl_white.svg";
|
|
4
|
+
import logo_clever_color from "../../../icons/svg/logo_clever_color.svg";
|
|
5
|
+
import logo_clever_white from "../../../icons/svg/logo_clever_white.svg";
|
|
3
6
|
import logo_lpa_color from "../../../icons/svg/logo_lpa_color.svg";
|
|
7
|
+
import logo_lpa_black from "../../../icons/svg/logo_lpa_black.svg";
|
|
4
8
|
import logo_lpa_white from "../../../icons/svg/logo_lpa_white.svg";
|
|
9
|
+
import logo_mln_black from "../../../icons/svg/logo_mln_black.svg";
|
|
10
|
+
import logo_mln_white from "../../../icons/svg/logo_mln_white.svg";
|
|
5
11
|
import logo_nypl_full_black from "../../../icons/svg/logo_nypl_full_black.svg";
|
|
6
12
|
import logo_nypl_full_white from "../../../icons/svg/logo_nypl_full_white.svg";
|
|
7
13
|
import logo_nypl_lion_black from "../../../icons/svg/logo_nypl_lion_black.svg";
|
|
8
14
|
import logo_nypl_lion_white from "../../../icons/svg/logo_nypl_lion_white.svg";
|
|
9
15
|
import logo_qpl_alt_black from "../../../icons/svg/logo_qpl_alt_black.svg";
|
|
16
|
+
import logo_qpl_alt_white from "../../../icons/svg/logo_qpl_alt_white.svg";
|
|
17
|
+
import logo_qpl_black from "../../../icons/svg/logo_qpl_black.svg";
|
|
10
18
|
import logo_qpl_color from "../../../icons/svg/logo_qpl_color.svg";
|
|
19
|
+
import logo_qpl_white from "../../../icons/svg/logo_qpl_white.svg";
|
|
20
|
+
import logo_schomburg_black from "../../../icons/svg/logo_schomburg_black.svg";
|
|
21
|
+
import logo_schomburg_circle_black from "../../../icons/svg/logo_schomburg_circle_black.svg";
|
|
11
22
|
import logo_schomburg_circle_color from "../../../icons/svg/logo_schomburg_circle_color.svg";
|
|
23
|
+
import logo_schomburg_circle_white from "../../../icons/svg/logo_schomburg_circle_white.svg";
|
|
12
24
|
import logo_schomburg_color from "../../../icons/svg/logo_schomburg_color.svg";
|
|
25
|
+
import logo_schomburg_white from "../../../icons/svg/logo_schomburg_white.svg";
|
|
13
26
|
import logo_simplye_black from "../../../icons/svg/logo_simplye_black.svg";
|
|
27
|
+
import logo_simplye_white from "../../../icons/svg/logo_simplye_white.svg";
|
|
14
28
|
import logo_simplye_color from "../../../icons/svg/logo_simplye_color.svg";
|
|
15
29
|
import logo_snfl_black from "../../../icons/svg/logo_snfl_black.svg";
|
|
16
30
|
import logo_snfl_white from "../../../icons/svg/logo_snfl_white.svg";
|
|
31
|
+
import logo_treasures_color from "../../../icons/svg/logo_treasures_color.svg";
|
|
32
|
+
import logo_treasures_color_negative from "../../../icons/svg/logo_treasures_color_negative.svg";
|
|
17
33
|
|
|
18
34
|
export default {
|
|
19
35
|
logo_bpl_black,
|
|
36
|
+
logo_bpl_white,
|
|
37
|
+
logo_clever_color,
|
|
38
|
+
logo_clever_white,
|
|
39
|
+
logo_lpa_black,
|
|
20
40
|
logo_lpa_color,
|
|
21
41
|
logo_lpa_white,
|
|
42
|
+
logo_mln_black,
|
|
43
|
+
logo_mln_white,
|
|
22
44
|
logo_nypl_full_black,
|
|
23
45
|
logo_nypl_full_white,
|
|
24
|
-
logo_nypl_lion_white,
|
|
25
46
|
logo_nypl_lion_black,
|
|
47
|
+
logo_nypl_lion_white,
|
|
26
48
|
logo_qpl_alt_black,
|
|
49
|
+
logo_qpl_alt_white,
|
|
50
|
+
logo_qpl_black,
|
|
27
51
|
logo_qpl_color,
|
|
52
|
+
logo_qpl_white,
|
|
53
|
+
logo_schomburg_black,
|
|
54
|
+
logo_schomburg_circle_black,
|
|
28
55
|
logo_schomburg_circle_color,
|
|
56
|
+
logo_schomburg_circle_white,
|
|
29
57
|
logo_schomburg_color,
|
|
58
|
+
logo_schomburg_white,
|
|
30
59
|
logo_simplye_black,
|
|
60
|
+
logo_simplye_white,
|
|
31
61
|
logo_simplye_color,
|
|
32
62
|
logo_snfl_black,
|
|
33
63
|
logo_snfl_white,
|
|
64
|
+
logo_treasures_color,
|
|
65
|
+
logo_treasures_color_negative,
|
|
34
66
|
};
|
|
@@ -15,18 +15,34 @@ export enum LogoSizes {
|
|
|
15
15
|
|
|
16
16
|
export enum LogoNames {
|
|
17
17
|
BrooklynPublicLibraryBlack = "logo_bpl_black",
|
|
18
|
+
BrooklynPublicLibraryWhite = "logo_bpl_white",
|
|
19
|
+
CleverColor = "logo_clever_color",
|
|
20
|
+
CleverWhite = "logo_clever_white",
|
|
18
21
|
LPAColor = "logo_lpa_color",
|
|
22
|
+
LPABlack = "logo_lpa_black",
|
|
19
23
|
LPAWhite = "logo_lpa_white",
|
|
24
|
+
MyLibraryNYCBlack = "logo_mln_black",
|
|
25
|
+
MyLibraryNYCWhite = "logo_mln_white",
|
|
20
26
|
NYPLBlack = "logo_nypl_full_black",
|
|
21
27
|
NYPLWhite = "logo_nypl_full_white",
|
|
22
28
|
NYPLLionBlack = "logo_nypl_lion_black",
|
|
23
29
|
NYPLLionWhite = "logo_nypl_lion_white",
|
|
24
30
|
QueensPublicLibraryColor = "logo_qpl_color",
|
|
31
|
+
QueensPublicLibraryBlack = "logo_qpl_black",
|
|
32
|
+
QueensPublicLibraryWhite = "logo_qpl_white",
|
|
25
33
|
QueensPublicLibraryAltBlack = "logo_qpl_alt_black",
|
|
34
|
+
QueensPublicLibraryAltWhite = "logo_qpl_alt_white",
|
|
26
35
|
SchomburgColor = "logo_schomburg_color",
|
|
36
|
+
SchomburgBlack = "logo_schomburg_black",
|
|
37
|
+
SchomburgWhite = "logo_schomburg_white",
|
|
27
38
|
SchomburgCircleColor = "logo_schomburg_circle_color",
|
|
39
|
+
SchomburgCircleBlack = "logo_schomburg_circle_black",
|
|
40
|
+
SchomburgCircleWhite = "logo_schomburg_circle_white",
|
|
28
41
|
SimplyEColor = "logo_simplye_color",
|
|
29
42
|
SimplyEBlack = "logo_simplye_black",
|
|
43
|
+
SimplyEWhite = "logo_simplye_white",
|
|
30
44
|
SNFLBlack = "logo_snfl_black",
|
|
31
45
|
SNFLWhite = "logo_snfl_white",
|
|
46
|
+
TreasuresColor = "logo_treasures_color",
|
|
47
|
+
TreasuresColorNegative = "logo_treasures_color_negative",
|
|
32
48
|
}
|
|
@@ -9,6 +9,7 @@ import { withDesign } from "storybook-addon-designs";
|
|
|
9
9
|
|
|
10
10
|
import Icon from "../Icons/Icon";
|
|
11
11
|
import { IconColors, IconNames } from "../Icons/IconTypes";
|
|
12
|
+
import Link from "../Link/Link";
|
|
12
13
|
import Notification from "./Notification";
|
|
13
14
|
import { NotificationTypes } from "./NotificationTypes";
|
|
14
15
|
import { getCategory } from "../../utils/componentCategories";
|
|
@@ -44,6 +45,7 @@ export const enumValues = getStorybookEnumValues(
|
|
|
44
45
|
noMargin: {
|
|
45
46
|
table: { defaultValue: { summary: false } },
|
|
46
47
|
},
|
|
48
|
+
notificationContent: { control: false },
|
|
47
49
|
notificationType: {
|
|
48
50
|
control: { type: "select" },
|
|
49
51
|
table: { defaultValue: { summary: "NotificationTypes.Standard" } },
|
|
@@ -57,7 +59,7 @@ export const enumValues = getStorybookEnumValues(
|
|
|
57
59
|
| Component Version | DS Version |
|
|
58
60
|
| ----------------- | ---------- |
|
|
59
61
|
| Added | `0.23.2` |
|
|
60
|
-
| Latest | `0.25.
|
|
62
|
+
| Latest | `0.25.11` |
|
|
61
63
|
|
|
62
64
|
<Description of={Notification} />
|
|
63
65
|
|
|
@@ -72,6 +74,7 @@ within a parent element.
|
|
|
72
74
|
<Story
|
|
73
75
|
name="Notification with Controls"
|
|
74
76
|
args={{
|
|
77
|
+
ariaLabel: "Notification label",
|
|
75
78
|
centered: false,
|
|
76
79
|
className: undefined,
|
|
77
80
|
dismissible: false,
|
|
@@ -89,6 +92,7 @@ within a parent element.
|
|
|
89
92
|
nisi erat porttitor ligula.
|
|
90
93
|
</>
|
|
91
94
|
),
|
|
95
|
+
notificationType: "NotificationTypes.Standard",
|
|
92
96
|
showIcon: true,
|
|
93
97
|
}}
|
|
94
98
|
>
|
|
@@ -105,6 +109,15 @@ within a parent element.
|
|
|
105
109
|
|
|
106
110
|
<ArgsTable story="Notification with Controls" />
|
|
107
111
|
|
|
112
|
+
## Accessibility
|
|
113
|
+
|
|
114
|
+
The `Notification` component renders with an HTML `aside` element as its wrapper.
|
|
115
|
+
This is an HTML landmark element that is similar to adding an attribute of
|
|
116
|
+
`role="complementary"`. For accessibility purposes, landmark elements should not
|
|
117
|
+
be rendered inside other landmark elements such as the `header` and `footer`
|
|
118
|
+
landmark elements. Adding a `Notification` component inside an HTML `main` landmark
|
|
119
|
+
element is acceptable.
|
|
120
|
+
|
|
108
121
|
## Variants
|
|
109
122
|
|
|
110
123
|
### With NotificationHeading
|
|
@@ -253,6 +266,34 @@ The `Notification` icon can be hidden with the `showIcon` prop set to `false`.
|
|
|
253
266
|
</DSProvider>
|
|
254
267
|
</Canvas>
|
|
255
268
|
|
|
269
|
+
### With HTML content
|
|
270
|
+
|
|
271
|
+
The `notificationContent` prop can accept HTML.
|
|
272
|
+
|
|
273
|
+
<Canvas>
|
|
274
|
+
<DSProvider>
|
|
275
|
+
<Notification
|
|
276
|
+
notificationHeading="Standard Notification with HTML content"
|
|
277
|
+
notificationContent={
|
|
278
|
+
<>
|
|
279
|
+
<p>
|
|
280
|
+
Cras mattis consectetur purus sit amet fermentum. Maecenas faucibus
|
|
281
|
+
mollis interdum.
|
|
282
|
+
</p>
|
|
283
|
+
<p>
|
|
284
|
+
Morbi leo risus, porta ac consectetur ac, vestibulum at eros.{" "}
|
|
285
|
+
<b>
|
|
286
|
+
Cum sociis natoque penatibus et magnis dis parturient montes,
|
|
287
|
+
nascetur ridiculus mus
|
|
288
|
+
</b>
|
|
289
|
+
. <Link href="#">This is a link</Link>.
|
|
290
|
+
</p>
|
|
291
|
+
</>
|
|
292
|
+
}
|
|
293
|
+
/>
|
|
294
|
+
</DSProvider>
|
|
295
|
+
</Canvas>
|
|
296
|
+
|
|
256
297
|
## Custom Icon
|
|
257
298
|
|
|
258
299
|
The default icon can be overridden by using the `icon` prop to pass a custom `Icon` component.
|
|
@@ -278,3 +319,29 @@ The default icon can be overridden by using the `icon` prop to pass a custom `Ic
|
|
|
278
319
|
/>
|
|
279
320
|
</Story>
|
|
280
321
|
</Canvas>
|
|
322
|
+
|
|
323
|
+
## Dismissible
|
|
324
|
+
|
|
325
|
+
A dismissible `Notification` component can be created by setting the
|
|
326
|
+
`dismissible` prop to `true`. Once the "X" close icon on the upper right is
|
|
327
|
+
clicked, the `Notification` will be removed from the DOM, therefore it only
|
|
328
|
+
appears once.
|
|
329
|
+
|
|
330
|
+
<Canvas>
|
|
331
|
+
<Story name="Dismissible">
|
|
332
|
+
<Notification
|
|
333
|
+
dismissible
|
|
334
|
+
notificationHeading="Dismissible Notification"
|
|
335
|
+
notificationContent={
|
|
336
|
+
<>
|
|
337
|
+
This is a dismissible Notification with an X icon. Cras mattis
|
|
338
|
+
consectetur purus sit amet fermentum. Maecenas faucibus mollis
|
|
339
|
+
interdum. Morbi leo risus, porta ac consectetur ac, vestibulum at
|
|
340
|
+
eros. Cum sociis natoque penatibus et magnis dis parturient montes,
|
|
341
|
+
nascetur ridiculus mus.
|
|
342
|
+
</>
|
|
343
|
+
}
|
|
344
|
+
notificationType={NotificationTypes.Announcement}
|
|
345
|
+
/>
|
|
346
|
+
</Story>
|
|
347
|
+
</Canvas>
|