@nypl/design-system-react-components 0.25.0 → 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 +30 -0
- package/dist/components/Accordion/Accordion.d.ts +14 -14
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -14
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
- package/dist/components/Button/ButtonTypes.d.ts +2 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/CardTypes.d.ts +2 -2
- 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 +3 -3
- package/dist/components/Form/Form.d.ts +13 -8
- package/dist/components/Form/FormTypes.d.ts +2 -8
- 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 +4 -4
- 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/IconTypes.d.ts +78 -64
- package/dist/components/Label/Label.d.ts +5 -17
- package/dist/components/Link/Link.d.ts +8 -12
- package/dist/components/SearchBar/SearchBar.d.ts +45 -27
- package/dist/components/Select/Select.d.ts +32 -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/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 +32 -31
- package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
- package/dist/design-system-react-components.cjs.development.js +2597 -1170
- 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 +2580 -1173
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +8 -1
- 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 +17 -7
- package/dist/theme/components/checkbox.d.ts +7 -7
- package/dist/theme/components/customCheckboxGroup.d.ts +18 -0
- package/dist/theme/components/customRadioGroup.d.ts +4 -3
- 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 +50 -20
- 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 +8 -7
- 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 +9 -9
- 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/global.d.ts +3 -0
- package/dist/theme/foundations/shadows.d.ts +4 -0
- package/dist/utils/utils.d.ts +6 -0
- package/package.json +3 -2
- package/src/components/Accordion/Accordion.stories.mdx +227 -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 +1 -1
- package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -1
- package/src/components/Autosuggest/_Autosuggest.scss +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +46 -52
- 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 +31 -27
- package/src/components/Button/Button.test.tsx +17 -5
- package/src/components/Button/ButtonTypes.tsx +1 -0
- package/src/components/Button/_Button.scss +3 -27
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +11 -0
- package/src/components/Card/Card.stories.mdx +24 -20
- package/src/components/Card/Card.test.tsx +13 -19
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Card/CardTypes.tsx +2 -2
- package/src/components/Card/_Card.scss +1 -1
- package/src/components/CardEdition/CardEdition.stories.tsx +11 -6
- package/src/components/CardEdition/CardEdition.test.tsx +23 -31
- package/src/components/CardEdition/_CardEdition.scss +2 -2
- package/src/components/Chakra/Center.stories.mdx +31 -14
- package/src/components/Chakra/Grid.stories.mdx +79 -0
- package/src/components/Chakra/Stack.stories.mdx +4 -4
- package/src/components/Checkbox/Checkbox.tsx +9 -12
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +2 -5
- 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.test.tsx +4 -4
- package/src/components/DatePicker/DatePicker.tsx +13 -13
- package/src/components/DatePicker/_DatePicker.scss +1 -0
- package/src/components/Form/Form.stories.mdx +46 -21
- package/src/components/Form/Form.test.tsx +58 -45
- package/src/components/Form/Form.tsx +49 -21
- package/src/components/Form/FormTypes.tsx +3 -8
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +24 -14
- 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 +1 -0
- package/src/components/Heading/Heading.tsx +12 -6
- package/src/components/HelperErrorText/_HelperErrorText.scss +1 -1
- package/src/components/Hero/Hero.stories.mdx +188 -121
- package/src/components/Hero/Hero.test.tsx +537 -107
- package/src/components/Hero/Hero.tsx +79 -92
- package/src/components/Hero/HeroTypes.tsx +17 -5
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
- package/src/components/HorizontalRule/_HorizontalRule.scss +1 -1
- package/src/components/Icons/Icon.stories.mdx +83 -74
- package/src/components/Icons/Icon.test.tsx +30 -22
- package/src/components/Icons/Icon.tsx +63 -61
- package/src/components/Icons/IconTypes.tsx +80 -64
- package/src/components/Input/_Input.scss +2 -2
- package/src/components/Label/Label.stories.mdx +28 -7
- package/src/components/Label/Label.test.tsx +43 -12
- package/src/components/Label/Label.tsx +21 -34
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
- package/src/components/Link/Link.stories.mdx +41 -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 +0 -2
- package/src/components/List/List.stories.tsx +5 -5
- package/src/components/List/_List.scss +3 -3
- package/src/components/Modal/_Modal.scss +1 -1
- package/src/components/Notification/Notification.stories.mdx +12 -1
- package/src/components/Notification/Notification.test.tsx +3 -16
- package/src/components/Notification/Notification.tsx +9 -10
- package/src/components/Notification/_Notification.scss +4 -4
- package/src/components/Pagination/Pagination.test.tsx +16 -10
- package/src/components/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/components/RadioGroup/RadioGroup.tsx +2 -10
- package/src/components/SearchBar/SearchBar.Test.tsx +151 -16
- package/src/components/SearchBar/SearchBar.stories.mdx +189 -219
- package/src/components/SearchBar/SearchBar.tsx +151 -46
- package/src/components/Select/Select.stories.mdx +188 -170
- package/src/components/Select/Select.test.tsx +125 -380
- package/src/components/Select/Select.tsx +118 -165
- package/src/components/Select/SelectTypes.tsx +4 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +13 -25
- 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 +16 -16
- package/src/components/StyleGuide/Buttons.stories.mdx +15 -15
- package/src/components/StyleGuide/Colors.stories.mdx +336 -0
- package/src/components/StyleGuide/Iconography.stories.mdx +88 -90
- package/src/components/StyleGuide/UIDocCard.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +7 -9
- 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 +89 -90
- package/src/components/TextInput/TextInput.test.tsx +65 -86
- package/src/components/TextInput/TextInput.tsx +101 -95
- package/src/components/TextInput/TextInputTypes.tsx +6 -0
- package/src/components/VideoPlayer/_VideoPlayer.scss +1 -1
- package/src/docs/Chakra.stories.mdx +4 -4
- package/src/docs/Intro.stories.mdx +15 -13
- package/src/index.ts +20 -0
- package/src/styles/01-colors/_colors-brand.scss +6 -0
- package/src/styles/01-colors/_colors-utility.scss +14 -12
- package/src/styles/base/_04-base.scss +2 -1
- package/src/styles/base/_place-holder.scss +1 -1
- package/src/styles.scss +10 -12
- package/src/theme/components/accordion.ts +30 -0
- package/src/theme/components/breadcrumb.ts +77 -0
- package/src/theme/components/button.ts +77 -63
- package/src/theme/components/checkbox.ts +15 -27
- package/src/theme/components/customCheckboxGroup.ts +12 -0
- package/src/theme/components/customRadioGroup.ts +4 -10
- package/src/theme/components/global.ts +71 -0
- package/src/theme/components/globalMixins.ts +16 -0
- package/src/theme/components/heading.ts +15 -8
- 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 +20 -31
- 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 +72 -69
- 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/colors.ts +29 -13
- package/src/theme/foundations/global.ts +3 -0
- package/src/theme/foundations/shadows.ts +5 -0
- package/src/theme/index.ts +37 -7
- package/src/utils/componentCategories.ts +8 -2
- package/src/utils/utils.ts +13 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -6
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
- package/dist/components/StyleGuide/Colors.stories.d.ts +0 -25
- package/dist/components/Template/Template.stories.d.ts +0 -30
- package/src/components/Accordion/Accordion.stories.tsx +0 -66
- package/src/components/Accordion/_Accordion.scss +0 -81
- package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
- package/src/components/Form/_Form.scss +0 -67
- package/src/components/Hero/_Hero.scss +0 -256
- package/src/components/Icons/_Icons.scss +0 -116
- package/src/components/Label/_Label.scss +0 -22
- package/src/components/Link/_Link.scss +0 -73
- package/src/components/SearchBar/_SearchBar.scss +0 -16
- package/src/components/Select/_Select.scss +0 -82
- package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -34
- package/src/components/StatusBadge/_StatusBadge.scss +0 -23
- package/src/components/StyleGuide/Colors.stories.tsx +0 -289
- package/src/components/Template/Template.stories.tsx +0 -86
- package/src/components/Template/_Template.scss +0 -63
- package/src/components/TextInput/_TextInput.scss +0 -59
|
@@ -11,41 +11,6 @@ var uuid = require('uuid');
|
|
|
11
11
|
var ReactDatePicker = _interopDefault(require('react-datepicker'));
|
|
12
12
|
var themeTools = require('@chakra-ui/theme-tools');
|
|
13
13
|
|
|
14
|
-
// Re-written in TS from https://github.com/drupal-pattern-lab/bem-twig-extension
|
|
15
|
-
function bem(baseClass, modifiers, blockName, extra) {
|
|
16
|
-
var classes = []; // If using a blockname to override default class.
|
|
17
|
-
|
|
18
|
-
if (blockName) {
|
|
19
|
-
classes.push(blockName.concat("__").concat(baseClass)); // Set blockname--modifier classes for each modifier.
|
|
20
|
-
|
|
21
|
-
if ((modifiers == null ? void 0 : modifiers.length) > 0) {
|
|
22
|
-
modifiers.forEach(function (modifier) {
|
|
23
|
-
classes.push(blockName.concat("__").concat(baseClass).concat("--").concat(modifier));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
} // If not overriding base class.
|
|
27
|
-
else {
|
|
28
|
-
// Set base class.
|
|
29
|
-
classes.push(baseClass);
|
|
30
|
-
|
|
31
|
-
if ((modifiers == null ? void 0 : modifiers.length) > 0) {
|
|
32
|
-
modifiers.forEach(function (modifier) {
|
|
33
|
-
classes.push(baseClass.concat("--").concat(modifier));
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
} // If extra non-BEM classes are added.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if ((extra == null ? void 0 : extra.length) > 0) {
|
|
40
|
-
extra.forEach(function (extraClass) {
|
|
41
|
-
classes.push(extraClass);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var attributes = classes.join(" ");
|
|
46
|
-
return attributes;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
14
|
function _extends() {
|
|
50
15
|
_extends = Object.assign || function (target) {
|
|
51
16
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -99,6 +64,103 @@ function generateUUID() {
|
|
|
99
64
|
return uuid.v4();
|
|
100
65
|
}
|
|
101
66
|
|
|
67
|
+
/* eslint-disable camelcase */
|
|
68
|
+
var IconAlign;
|
|
69
|
+
|
|
70
|
+
(function (IconAlign) {
|
|
71
|
+
IconAlign["Left"] = "left";
|
|
72
|
+
IconAlign["Right"] = "right";
|
|
73
|
+
IconAlign["None"] = "none";
|
|
74
|
+
})(IconAlign || (IconAlign = {}));
|
|
75
|
+
|
|
76
|
+
var IconTypes;
|
|
77
|
+
|
|
78
|
+
(function (IconTypes) {
|
|
79
|
+
IconTypes["Default"] = "default";
|
|
80
|
+
IconTypes["Breadcrumbs"] = "breadcrumbs";
|
|
81
|
+
})(IconTypes || (IconTypes = {}));
|
|
82
|
+
|
|
83
|
+
(function (IconRotationTypes) {
|
|
84
|
+
IconRotationTypes["Rotate0"] = "rotate0";
|
|
85
|
+
IconRotationTypes["Rotate90"] = "rotate90";
|
|
86
|
+
IconRotationTypes["Rotate180"] = "rotate180";
|
|
87
|
+
IconRotationTypes["Rotate270"] = "rotate270";
|
|
88
|
+
})(exports.IconRotationTypes || (exports.IconRotationTypes = {}));
|
|
89
|
+
|
|
90
|
+
(function (IconColors) {
|
|
91
|
+
IconColors["UiBlack"] = "ui.black";
|
|
92
|
+
IconColors["UiWhite"] = "ui.white";
|
|
93
|
+
IconColors["BrandPrimary"] = "brand.primary";
|
|
94
|
+
IconColors["BrandSecondary"] = "brand.secondary";
|
|
95
|
+
IconColors["SectionWhatsOnPrimary"] = "section.whats-on.primary";
|
|
96
|
+
IconColors["SectionWhatsOnSecondary"] = "section.whats-on.secondary";
|
|
97
|
+
IconColors["SectionBooksAndMorePrimary"] = "section.books-and-more.primary";
|
|
98
|
+
IconColors["SectionBooksAndMoreSecondary"] = "section.books-and-more.secondary";
|
|
99
|
+
IconColors["SectionResearchPrimary"] = "section.research.primary";
|
|
100
|
+
IconColors["SectionResearchSecondary"] = "section.research.secondary";
|
|
101
|
+
IconColors["SectionLocationsPrimary"] = "section.locations.primary";
|
|
102
|
+
IconColors["SectionLocationsSecondary"] = "section.locations.secondary";
|
|
103
|
+
IconColors["SectionBlogsPrimary"] = "section.blogs.primary";
|
|
104
|
+
IconColors["SectionBlogsSecondary"] = "section.blogs.secondary";
|
|
105
|
+
IconColors["SectionResearchLibraryLpa"] = "section.research-library.lpa";
|
|
106
|
+
IconColors["SectionResearchLibrarySchomburg"] = "section.research-library.schomburg";
|
|
107
|
+
IconColors["SectionResearchLibrarySchwartzman"] = "section.research-library.schwartzman";
|
|
108
|
+
})(exports.IconColors || (exports.IconColors = {}));
|
|
109
|
+
|
|
110
|
+
(function (IconSizes) {
|
|
111
|
+
IconSizes["Small"] = "small";
|
|
112
|
+
IconSizes["Medium"] = "medium";
|
|
113
|
+
IconSizes["Large"] = "large";
|
|
114
|
+
IconSizes["ExtraLarge"] = "xlarge";
|
|
115
|
+
IconSizes["ExtraExtraLarge"] = "xxlarge";
|
|
116
|
+
IconSizes["ExtraExtraExtraLarge"] = "xxxlarge";
|
|
117
|
+
})(exports.IconSizes || (exports.IconSizes = {}));
|
|
118
|
+
|
|
119
|
+
(function (IconNames) {
|
|
120
|
+
IconNames["AccessibilityFull"] = "accessibility_full";
|
|
121
|
+
IconNames["AccessibilityPartial"] = "accessibility_partial";
|
|
122
|
+
IconNames["Arrow"] = "arrow";
|
|
123
|
+
IconNames["Check"] = "check";
|
|
124
|
+
IconNames["Clock"] = "clock";
|
|
125
|
+
IconNames["Close"] = "close";
|
|
126
|
+
IconNames["Download"] = "download";
|
|
127
|
+
IconNames["ErrorFilled"] = "error_filled";
|
|
128
|
+
IconNames["ErrorOutline"] = "error_outline";
|
|
129
|
+
IconNames["Headset"] = "headset";
|
|
130
|
+
IconNames["Minus"] = "minus";
|
|
131
|
+
IconNames["Plus"] = "plus";
|
|
132
|
+
IconNames["Search"] = "search";
|
|
133
|
+
IconNames["SpeakerNotes"] = "speaker_notes";
|
|
134
|
+
IconNames["UtilityAccountFilled"] = "utility_account_filled";
|
|
135
|
+
IconNames["UtilityAccountUnfilled"] = "utility_account_unfilled";
|
|
136
|
+
IconNames["UtilityHamburger"] = "utility_hamburger";
|
|
137
|
+
IconNames["UtilitySearch"] = "utility_search";
|
|
138
|
+
})(exports.IconNames || (exports.IconNames = {}));
|
|
139
|
+
|
|
140
|
+
(function (LogoNames) {
|
|
141
|
+
LogoNames["Brooklyn"] = "brooklyn";
|
|
142
|
+
LogoNames["LogoBrooklyn"] = "logo_brooklyn";
|
|
143
|
+
LogoNames["LogoNypl"] = "logo_nypl";
|
|
144
|
+
LogoNames["LogoNyplNegative"] = "logo_nypl_negative";
|
|
145
|
+
LogoNames["LogoQueens"] = "logo_queens";
|
|
146
|
+
LogoNames["LpaNegative"] = "lpa_negative";
|
|
147
|
+
LogoNames["LpaPositive"] = "lpa_positive";
|
|
148
|
+
LogoNames["NyplCircleNegative"] = "nypl_circle_negative";
|
|
149
|
+
LogoNames["NyplCirclePositive"] = "nypl_circle_positive";
|
|
150
|
+
LogoNames["NyplFullLockUpNegative"] = "nypl_full_lock_up_negative";
|
|
151
|
+
LogoNames["NyplFullLockUp"] = "nypl_full_lock_up";
|
|
152
|
+
LogoNames["NyplNoLionNegative"] = "nypl_no_lion_negative";
|
|
153
|
+
LogoNames["NyplNoLionPositive"] = "nypl_no_lion_positive";
|
|
154
|
+
LogoNames["QueensLong"] = "queens_long";
|
|
155
|
+
LogoNames["QueensStacked"] = "queens_stacked";
|
|
156
|
+
LogoNames["SchomburgCircle"] = "schomburg_circle";
|
|
157
|
+
LogoNames["SchomburgPositive"] = "schomburg_positive";
|
|
158
|
+
LogoNames["SimplyeBlack"] = "simplye_black";
|
|
159
|
+
LogoNames["SimplyeColor"] = "simplye_color";
|
|
160
|
+
LogoNames["SnflNegative"] = "snfl_negative";
|
|
161
|
+
LogoNames["SnflPositive"] = "snfl_positive";
|
|
162
|
+
})(exports.LogoNames || (exports.LogoNames = {}));
|
|
163
|
+
|
|
102
164
|
var _path, _path2, _path3;
|
|
103
165
|
|
|
104
166
|
function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
@@ -1195,247 +1257,279 @@ var iconSvgs = {
|
|
|
1195
1257
|
*/
|
|
1196
1258
|
|
|
1197
1259
|
function Icon(props) {
|
|
1198
|
-
var
|
|
1199
|
-
_props$
|
|
1200
|
-
|
|
1260
|
+
var _props$align = props.align,
|
|
1261
|
+
align = _props$align === void 0 ? "none" : _props$align,
|
|
1262
|
+
children = props.children,
|
|
1201
1263
|
className = props.className,
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
_props$
|
|
1207
|
-
|
|
1264
|
+
_props$color = props.color,
|
|
1265
|
+
color = _props$color === void 0 ? exports.IconColors.UiBlack : _props$color,
|
|
1266
|
+
_props$decorative = props.decorative,
|
|
1267
|
+
decorative = _props$decorative === void 0 ? true : _props$decorative,
|
|
1268
|
+
_props$iconRotation = props.iconRotation,
|
|
1269
|
+
iconRotation = _props$iconRotation === void 0 ? exports.IconRotationTypes.Rotate0 : _props$iconRotation,
|
|
1270
|
+
_props$id = props.id,
|
|
1271
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
1208
1272
|
name = props.name,
|
|
1209
|
-
|
|
1210
|
-
_props$
|
|
1211
|
-
|
|
1273
|
+
_props$size = props.size,
|
|
1274
|
+
size = _props$size === void 0 ? exports.IconSizes.Medium : _props$size,
|
|
1275
|
+
_props$type = props.type,
|
|
1276
|
+
type = _props$type === void 0 ? IconTypes.Default : _props$type;
|
|
1277
|
+
var styles = react.useStyleConfig("Icon", {
|
|
1278
|
+
align: align,
|
|
1279
|
+
color: color,
|
|
1280
|
+
iconRotation: iconRotation,
|
|
1281
|
+
size: size,
|
|
1282
|
+
variant: type
|
|
1283
|
+
});
|
|
1284
|
+
var iconProps = {
|
|
1285
|
+
"aria-hidden": decorative,
|
|
1286
|
+
className: className,
|
|
1287
|
+
id: id,
|
|
1288
|
+
role: "img"
|
|
1289
|
+
};
|
|
1290
|
+
var childSVG = null; // Component prop validation
|
|
1291
|
+
|
|
1292
|
+
if (name && children) {
|
|
1293
|
+
console.warn("Icon accepts either a `name` prop or an `svg` element child, not both.");
|
|
1294
|
+
return null;
|
|
1295
|
+
} else if (!name && !children) {
|
|
1296
|
+
console.warn("Pass an icon `name` prop or an SVG child to `Icon` to ensure an icon appears.");
|
|
1297
|
+
return null;
|
|
1298
|
+
} // The user wants to render an existing icon. Load the icon and render it
|
|
1299
|
+
// as a component through Chakra's Icon component. Otherwise, we're going to
|
|
1300
|
+
// render the SVG child with NYPL-theme styling.
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
if (name) {
|
|
1304
|
+
var SvgComponent = iconSvgs[name];
|
|
1305
|
+
return React.createElement(react.Icon, Object.assign({
|
|
1306
|
+
as: SvgComponent
|
|
1307
|
+
}, iconProps, {
|
|
1308
|
+
__css: styles
|
|
1309
|
+
}));
|
|
1310
|
+
} // If no `name` prop was passed, we expect a child SVG element to be passed.
|
|
1311
|
+
// Apply icon props to the SVG child.
|
|
1212
1312
|
|
|
1213
|
-
if (iconRotation) {
|
|
1214
|
-
modifiers.push(iconRotation);
|
|
1215
|
-
}
|
|
1216
1313
|
|
|
1217
|
-
if (
|
|
1218
|
-
|
|
1314
|
+
if (children.type === "svg" || children.props.type === "svg" || children.props.mdxType === "svg") {
|
|
1315
|
+
childSVG = React.cloneElement(children, _extends({}, iconProps));
|
|
1316
|
+
} else {
|
|
1317
|
+
console.warn("You must pass an `svg` element to the `Icon` component.");
|
|
1219
1318
|
}
|
|
1220
1319
|
|
|
1221
|
-
|
|
1222
|
-
|
|
1320
|
+
return React.createElement(react.Box, {
|
|
1321
|
+
__css: styles
|
|
1322
|
+
}, childSVG);
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* Get the minus or plus icon depending on whether the accordion
|
|
1327
|
+
* is open or closed.
|
|
1328
|
+
*/
|
|
1329
|
+
|
|
1330
|
+
var getIcon = function getIcon(isExpanded) {
|
|
1331
|
+
if (isExpanded === void 0) {
|
|
1332
|
+
isExpanded = false;
|
|
1223
1333
|
}
|
|
1224
1334
|
|
|
1225
|
-
var
|
|
1335
|
+
var iconName = isExpanded ? exports.IconNames.Minus : exports.IconNames.Plus;
|
|
1336
|
+
return React.createElement(Icon, {
|
|
1337
|
+
name: iconName,
|
|
1338
|
+
size: exports.IconSizes.Small
|
|
1339
|
+
});
|
|
1340
|
+
};
|
|
1341
|
+
/**
|
|
1342
|
+
* Returns `AccordionItems` for every accordion object in the data
|
|
1343
|
+
* array. This automatically creates the `AccordionButton` and `AccordionPanel`
|
|
1344
|
+
* combination that is required for the Chakra `Accordion` component.
|
|
1345
|
+
*/
|
|
1346
|
+
|
|
1226
1347
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
id: iconID,
|
|
1230
|
-
role: "img",
|
|
1231
|
-
title: titleText || null,
|
|
1232
|
-
"aria-hidden": decorative
|
|
1233
|
-
}, attributes); // Apply icon props to SVG that was passed as a child.
|
|
1348
|
+
var getElementsFromContentData = function getElementsFromContentData(data) {
|
|
1349
|
+
var _data;
|
|
1234
1350
|
|
|
1351
|
+
if (data === void 0) {
|
|
1352
|
+
data = [];
|
|
1353
|
+
}
|
|
1235
1354
|
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1355
|
+
// For FAQ-style multiple accordions, the button should be bigger.
|
|
1356
|
+
// Otherwise, use the default.
|
|
1357
|
+
var multiplePadding = ((_data = data) == null ? void 0 : _data.length) > 1 ? 4 : null;
|
|
1358
|
+
return data.map(function (content, index) {
|
|
1359
|
+
// This is done to support both string and DOM element input.
|
|
1360
|
+
var panel = typeof content.panel === "string" ? React.createElement(react.AccordionPanel, {
|
|
1361
|
+
key: index,
|
|
1362
|
+
dangerouslySetInnerHTML: {
|
|
1363
|
+
__html: content.panel
|
|
1364
|
+
}
|
|
1365
|
+
}) : React.createElement(react.AccordionPanel, {
|
|
1366
|
+
key: index
|
|
1367
|
+
}, content.panel);
|
|
1368
|
+
return React.createElement(react.AccordionItem, {
|
|
1369
|
+
key: index
|
|
1370
|
+
}, function (_ref) {
|
|
1371
|
+
var isExpanded = _ref.isExpanded;
|
|
1372
|
+
return React.createElement(React.Fragment, null, React.createElement(react.AccordionButton, {
|
|
1373
|
+
padding: multiplePadding
|
|
1374
|
+
}, React.createElement(react.Box, {
|
|
1375
|
+
flex: "1",
|
|
1376
|
+
textAlign: "left"
|
|
1377
|
+
}, content.label), getIcon(isExpanded)), panel);
|
|
1239
1378
|
});
|
|
1240
|
-
};
|
|
1379
|
+
});
|
|
1380
|
+
};
|
|
1381
|
+
/**
|
|
1382
|
+
* Accordion component that shows content on toggle. Can be used to display
|
|
1383
|
+
* multiple accordion items together.
|
|
1384
|
+
*/
|
|
1241
1385
|
|
|
1242
1386
|
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
// were passed to this component.
|
|
1387
|
+
function Accordion(props) {
|
|
1388
|
+
var contentData = props.contentData,
|
|
1389
|
+
_props$id = props.id,
|
|
1390
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
1391
|
+
_props$isDefaultOpen = props.isDefaultOpen,
|
|
1392
|
+
isDefaultOpen = _props$isDefaultOpen === void 0 ? false : _props$isDefaultOpen; // Pass `0` to open the first accordion in the 0-index based array.
|
|
1250
1393
|
|
|
1394
|
+
var openFirstAccordion = isDefaultOpen ? 0 : undefined;
|
|
1395
|
+
return React.createElement(react.Accordion, {
|
|
1396
|
+
id: id,
|
|
1397
|
+
defaultIndex: [openFirstAccordion],
|
|
1398
|
+
allowMultiple: true
|
|
1399
|
+
}, getElementsFromContentData(contentData));
|
|
1400
|
+
}
|
|
1251
1401
|
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1402
|
+
var ColorVariants;
|
|
1403
|
+
|
|
1404
|
+
(function (ColorVariants) {
|
|
1405
|
+
ColorVariants["BooksAndMore"] = "booksAndMore";
|
|
1406
|
+
ColorVariants["Locations"] = "locations";
|
|
1407
|
+
ColorVariants["Research"] = "research";
|
|
1408
|
+
ColorVariants["WhatsOn"] = "whatsOn";
|
|
1409
|
+
})(ColorVariants || (ColorVariants = {}));
|
|
1410
|
+
|
|
1411
|
+
// Utility functions to use throughout the codebase
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* range
|
|
1415
|
+
* Get an array of values from `start` to `stop` - 1 with an optional
|
|
1416
|
+
* `step` between values.
|
|
1417
|
+
*/
|
|
1418
|
+
var range = function range(start, stop, step) {
|
|
1419
|
+
if (step === void 0) {
|
|
1420
|
+
step = 1;
|
|
1255
1421
|
}
|
|
1256
1422
|
|
|
1257
|
-
|
|
1258
|
-
|
|
1423
|
+
if (!start) {
|
|
1424
|
+
return [];
|
|
1425
|
+
}
|
|
1259
1426
|
|
|
1260
|
-
|
|
1427
|
+
return Array(Math.ceil((stop - start) / step)).fill(start).map(function (x, y) {
|
|
1428
|
+
return x + y * step;
|
|
1429
|
+
});
|
|
1430
|
+
};
|
|
1431
|
+
/**
|
|
1432
|
+
* Map an enum value to a component's Chakra theme variant object. If a wrong
|
|
1433
|
+
* value is passed (typically in non-Typescript scenarios), then the "fallback"
|
|
1434
|
+
* value, if provided, will be used.
|
|
1435
|
+
*/
|
|
1261
1436
|
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
IconRotationTypes["rotate270"] = "rotate-270";
|
|
1267
|
-
})(exports.IconRotationTypes || (exports.IconRotationTypes = {}));
|
|
1437
|
+
var getVariant = function getVariant(variant, collection, fallback) {
|
|
1438
|
+
if (fallback === void 0) {
|
|
1439
|
+
fallback = null;
|
|
1440
|
+
}
|
|
1268
1441
|
|
|
1269
|
-
|
|
1270
|
-
IconNames["accessibility_full"] = "accessibility_full";
|
|
1271
|
-
IconNames["accessibility_partial"] = "accessibility_partial";
|
|
1272
|
-
IconNames["arrow"] = "arrow";
|
|
1273
|
-
IconNames["check"] = "check";
|
|
1274
|
-
IconNames["clock"] = "clock";
|
|
1275
|
-
IconNames["close"] = "close";
|
|
1276
|
-
IconNames["download"] = "download";
|
|
1277
|
-
IconNames["error_filled"] = "error_filled";
|
|
1278
|
-
IconNames["error_outline"] = "error_outline";
|
|
1279
|
-
IconNames["headset"] = "headset";
|
|
1280
|
-
IconNames["minus"] = "minus";
|
|
1281
|
-
IconNames["plus"] = "plus";
|
|
1282
|
-
IconNames["search"] = "search";
|
|
1283
|
-
IconNames["speaker_notes"] = "speaker_notes";
|
|
1284
|
-
IconNames["utility_account_filled"] = "utility_account_filled";
|
|
1285
|
-
IconNames["utility_account_unfilled"] = "utility_account_unfilled";
|
|
1286
|
-
IconNames["utility_hamburger"] = "utility_hamburger";
|
|
1287
|
-
IconNames["utility_search"] = "utility_search";
|
|
1288
|
-
})(exports.IconNames || (exports.IconNames = {}));
|
|
1442
|
+
var variantMap = {};
|
|
1289
1443
|
|
|
1290
|
-
(
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
LogoNames["logo_nypl"] = "logo_nypl";
|
|
1294
|
-
LogoNames["logo_nypl_negative"] = "logo_nypl_negative";
|
|
1295
|
-
LogoNames["logo_queens"] = "logo_queens";
|
|
1296
|
-
LogoNames["lpa_negative"] = "lpa_negative";
|
|
1297
|
-
LogoNames["lpa_positive"] = "lpa_positive";
|
|
1298
|
-
LogoNames["nypl_circle_negative"] = "nypl_circle_negative";
|
|
1299
|
-
LogoNames["nypl_circle_positive"] = "nypl_circle_positive";
|
|
1300
|
-
LogoNames["nypl_full_lock_up_negative"] = "nypl_full_lock_up_negative";
|
|
1301
|
-
LogoNames["nypl_full_lock_up"] = "nypl_full_lock_up";
|
|
1302
|
-
LogoNames["nypl_no_lion_negative"] = "nypl_no_lion_negative";
|
|
1303
|
-
LogoNames["nypl_no_lion_positive"] = "nypl_no_lion_positive";
|
|
1304
|
-
LogoNames["queens_long"] = "queens_long";
|
|
1305
|
-
LogoNames["queens_stacked"] = "queens_stacked";
|
|
1306
|
-
LogoNames["schomburg_circle"] = "schomburg_circle";
|
|
1307
|
-
LogoNames["schomburg_positive"] = "schomburg_positive";
|
|
1308
|
-
LogoNames["simplye_black"] = "simplye_black";
|
|
1309
|
-
LogoNames["simplye_color"] = "simplye_color";
|
|
1310
|
-
LogoNames["snfl_negative"] = "snfl_negative";
|
|
1311
|
-
LogoNames["snfl_positive"] = "snfl_positive";
|
|
1312
|
-
})(exports.LogoNames || (exports.LogoNames = {}));
|
|
1444
|
+
for (var type in collection) {
|
|
1445
|
+
variantMap[collection[type]] = collection[type];
|
|
1446
|
+
}
|
|
1313
1447
|
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
IconColors["ui_white"] = "ui-white";
|
|
1317
|
-
IconColors["brand_primary"] = "brand-primary";
|
|
1318
|
-
IconColors["brand_secondary"] = "brand-secondary";
|
|
1319
|
-
IconColors["section_whats_on_primary"] = "section-whats-on-primary";
|
|
1320
|
-
IconColors["section_books_and_more_primary"] = "section-books-and-more-primary";
|
|
1321
|
-
IconColors["section_research_primary"] = "section-research-primary";
|
|
1322
|
-
IconColors["section_research_secondary"] = "section-research-secondary";
|
|
1323
|
-
IconColors["section_locations_primary"] = "section-locations-primary";
|
|
1324
|
-
IconColors["section_research_library_lpa"] = "section-research-library-lpa";
|
|
1325
|
-
IconColors["section_research_library_schomburg"] = "section-research-library-schomburg";
|
|
1326
|
-
IconColors["section_research_library_schwartzman"] = "section-research-library-schwartzman";
|
|
1327
|
-
})(exports.IconColors || (exports.IconColors = {}));
|
|
1448
|
+
return variantMap[variant] || fallback;
|
|
1449
|
+
};
|
|
1328
1450
|
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
IconSizes["xlarge"] = "xlarge";
|
|
1334
|
-
IconSizes["xxlarge"] = "xxlarge";
|
|
1335
|
-
IconSizes["xxxlarge"] = "xxxlarge";
|
|
1336
|
-
})(exports.IconSizes || (exports.IconSizes = {}));
|
|
1451
|
+
var getElementsFromData = function getElementsFromData(data, breadcrumbsID) {
|
|
1452
|
+
if (!(data != null && data.length)) {
|
|
1453
|
+
return {};
|
|
1454
|
+
}
|
|
1337
1455
|
|
|
1338
|
-
|
|
1456
|
+
var breadcrumbItems = data.map(function (breadcrumbData, index) {
|
|
1457
|
+
return React.createElement(react.BreadcrumbItem, {
|
|
1458
|
+
key: index,
|
|
1459
|
+
isCurrentPage: index === data.length - 1 ? true : false
|
|
1460
|
+
}, React.createElement(react.BreadcrumbLink, {
|
|
1461
|
+
href: breadcrumbData.url
|
|
1462
|
+
}, index === data.length - 2 && React.createElement(Icon, {
|
|
1463
|
+
name: exports.IconNames.Arrow,
|
|
1464
|
+
size: exports.IconSizes.Small,
|
|
1465
|
+
iconRotation: exports.IconRotationTypes.Rotate90,
|
|
1466
|
+
id: breadcrumbsID + "__backarrow",
|
|
1467
|
+
className: "breadcrumbs-icon",
|
|
1468
|
+
type: IconTypes.Breadcrumbs
|
|
1469
|
+
}), React.createElement("span", {
|
|
1470
|
+
className: "breadcrumb-label"
|
|
1471
|
+
}, breadcrumbData.text)));
|
|
1472
|
+
});
|
|
1473
|
+
return breadcrumbItems;
|
|
1474
|
+
};
|
|
1339
1475
|
|
|
1340
|
-
function
|
|
1341
|
-
var
|
|
1342
|
-
modifiers = _props$modifiers === void 0 ? [] : _props$modifiers,
|
|
1343
|
-
blockName = props.blockName,
|
|
1344
|
-
id = props.id,
|
|
1476
|
+
function Breadcrumbs(props) {
|
|
1477
|
+
var breadcrumbsData = props.breadcrumbsData,
|
|
1345
1478
|
className = props.className,
|
|
1346
|
-
|
|
1347
|
-
_props$
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
children = props.children;
|
|
1351
|
-
return React.createElement("div", {
|
|
1352
|
-
id: id,
|
|
1353
|
-
className: bem("accordion", modifiers, blockName, [className])
|
|
1354
|
-
}, React.createElement("input", {
|
|
1355
|
-
id: "accordion-" + inputId,
|
|
1356
|
-
className: bem("input", modifiers, "accordion"),
|
|
1357
|
-
type: "checkbox",
|
|
1358
|
-
defaultChecked: defaultOpen
|
|
1359
|
-
}), React.createElement("label", {
|
|
1360
|
-
htmlFor: "accordion-" + inputId,
|
|
1361
|
-
className: bem("label", modifiers, "accordion")
|
|
1362
|
-
}, accordionLabel, React.createElement(Icon, {
|
|
1363
|
-
decorative: true,
|
|
1364
|
-
name: exports.IconNames.minus,
|
|
1365
|
-
modifiers: ["small", "" + exports.IconNames.minus]
|
|
1366
|
-
}), React.createElement(Icon, {
|
|
1367
|
-
decorative: true,
|
|
1368
|
-
name: exports.IconNames.plus,
|
|
1369
|
-
modifiers: ["small", "" + exports.IconNames.plus]
|
|
1370
|
-
})), React.createElement("div", {
|
|
1371
|
-
className: bem("content", modifiers, "accordion")
|
|
1372
|
-
}, children));
|
|
1373
|
-
}
|
|
1479
|
+
colorVariant = props.colorVariant,
|
|
1480
|
+
_props$id = props.id,
|
|
1481
|
+
id = _props$id === void 0 ? generateUUID() : _props$id;
|
|
1482
|
+
var variant = getVariant(colorVariant, ColorVariants);
|
|
1374
1483
|
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
}
|
|
1484
|
+
if (!breadcrumbsData || breadcrumbsData.length === 0) {
|
|
1485
|
+
throw new Error("You must use the `breadcrumbsData` prop to pass a data object to the Breadcrumbs component. That prop is current empty.");
|
|
1486
|
+
}
|
|
1378
1487
|
|
|
1379
|
-
var
|
|
1380
|
-
|
|
1488
|
+
var styles = react.useStyleConfig("Breadcrumb", {
|
|
1489
|
+
variant: variant
|
|
1490
|
+
});
|
|
1491
|
+
var breadcrumbItems = getElementsFromData(breadcrumbsData, id);
|
|
1492
|
+
return React.createElement(react.Breadcrumb, {
|
|
1493
|
+
className: className,
|
|
1494
|
+
__css: styles,
|
|
1495
|
+
id: id
|
|
1496
|
+
}, breadcrumbItems);
|
|
1497
|
+
}
|
|
1381
1498
|
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1499
|
+
// Re-written in TS from https://github.com/drupal-pattern-lab/bem-twig-extension
|
|
1500
|
+
function bem(baseClass, modifiers, blockName, extra) {
|
|
1501
|
+
var classes = []; // If using a blockname to override default class.
|
|
1385
1502
|
|
|
1386
|
-
|
|
1503
|
+
if (blockName) {
|
|
1504
|
+
classes.push(blockName.concat("__").concat(baseClass)); // Set blockname--modifier classes for each modifier.
|
|
1387
1505
|
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1506
|
+
if ((modifiers == null ? void 0 : modifiers.length) > 0) {
|
|
1507
|
+
modifiers.forEach(function (modifier) {
|
|
1508
|
+
classes.push(blockName.concat("__").concat(baseClass).concat("--").concat(modifier));
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
} // If not overriding base class.
|
|
1512
|
+
else {
|
|
1513
|
+
// Set base class.
|
|
1514
|
+
classes.push(baseClass);
|
|
1396
1515
|
|
|
1397
|
-
if (
|
|
1398
|
-
|
|
1516
|
+
if ((modifiers == null ? void 0 : modifiers.length) > 0) {
|
|
1517
|
+
modifiers.forEach(function (modifier) {
|
|
1518
|
+
classes.push(baseClass.concat("--").concat(modifier));
|
|
1519
|
+
});
|
|
1399
1520
|
}
|
|
1521
|
+
} // If extra non-BEM classes are added.
|
|
1400
1522
|
|
|
1401
|
-
breadcrumbs.forEach(function (item, index) {
|
|
1402
|
-
var last = index === breadcrumbs.length - 1;
|
|
1403
|
-
var linkComponent;
|
|
1404
|
-
|
|
1405
|
-
if (isTextBreadcrumb(item)) {
|
|
1406
|
-
linkComponent = item.url ? React.createElement("a", {
|
|
1407
|
-
href: item.url,
|
|
1408
|
-
className: bem("link", [], baseClass)
|
|
1409
|
-
}, item.text) : item.text;
|
|
1410
|
-
} else {
|
|
1411
|
-
var props = {
|
|
1412
|
-
className: bem("link", [], baseClass)
|
|
1413
|
-
};
|
|
1414
|
-
linkComponent = React.createElement(item.type, _extends({}, props, item.props), item.props.children);
|
|
1415
|
-
}
|
|
1416
1523
|
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
}, last && React.createElement(Icon, {
|
|
1421
|
-
name: exports.IconNames.arrow,
|
|
1422
|
-
blockName: baseClass,
|
|
1423
|
-
modifiers: ["small"],
|
|
1424
|
-
decorative: true
|
|
1425
|
-
}), linkComponent));
|
|
1524
|
+
if ((extra == null ? void 0 : extra.length) > 0) {
|
|
1525
|
+
extra.forEach(function (extraClass) {
|
|
1526
|
+
classes.push(extraClass);
|
|
1426
1527
|
});
|
|
1427
|
-
|
|
1428
|
-
className: bem(baseClass, modifiers, blockName, [className]),
|
|
1429
|
-
role: "navigation",
|
|
1430
|
-
"aria-label": "Breadcrumbs"
|
|
1431
|
-
}, React.createElement("ul", {
|
|
1432
|
-
className: bem("list", [], baseClass)
|
|
1433
|
-
}, breadcrumbItems));
|
|
1434
|
-
};
|
|
1528
|
+
}
|
|
1435
1529
|
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1530
|
+
var attributes = classes.join(" ");
|
|
1531
|
+
return attributes;
|
|
1532
|
+
}
|
|
1439
1533
|
|
|
1440
1534
|
(function (ButtonTypes) {
|
|
1441
1535
|
ButtonTypes["Primary"] = "primary";
|
|
@@ -1443,6 +1537,7 @@ Breadcrumbs.defaultProps = {};
|
|
|
1443
1537
|
ButtonTypes["Callout"] = "callout";
|
|
1444
1538
|
ButtonTypes["Pill"] = "pill";
|
|
1445
1539
|
ButtonTypes["Link"] = "link";
|
|
1540
|
+
ButtonTypes["SearchBar"] = "searchBar";
|
|
1446
1541
|
})(exports.ButtonTypes || (exports.ButtonTypes = {}));
|
|
1447
1542
|
|
|
1448
1543
|
var variantMap = {};
|
|
@@ -1457,7 +1552,7 @@ for (var type in exports.ButtonTypes) {
|
|
|
1457
1552
|
*/
|
|
1458
1553
|
|
|
1459
1554
|
|
|
1460
|
-
var getVariant = function getVariant(buttonType) {
|
|
1555
|
+
var getVariant$1 = function getVariant(buttonType) {
|
|
1461
1556
|
return variantMap[buttonType] || exports.ButtonTypes.Primary;
|
|
1462
1557
|
};
|
|
1463
1558
|
/** Renders a simple `button` element with custom classes and modifiers. */
|
|
@@ -1499,7 +1594,7 @@ function Button(props) {
|
|
|
1499
1594
|
if (childCount === 1 && hasIcon) {
|
|
1500
1595
|
variant = "icon-only";
|
|
1501
1596
|
} else {
|
|
1502
|
-
variant = getVariant(buttonType);
|
|
1597
|
+
variant = getVariant$1(buttonType);
|
|
1503
1598
|
}
|
|
1504
1599
|
|
|
1505
1600
|
styles = react.useStyleConfig("Button", {
|
|
@@ -1530,8 +1625,6 @@ function Button(props) {
|
|
|
1530
1625
|
HeadingLevels[HeadingLevels["Six"] = 6] = "Six";
|
|
1531
1626
|
})(exports.HeadingLevels || (exports.HeadingLevels = {}));
|
|
1532
1627
|
|
|
1533
|
-
// MT-82, MT 225, etc
|
|
1534
|
-
|
|
1535
1628
|
var variantMap$1 = {};
|
|
1536
1629
|
|
|
1537
1630
|
for (var type$1 in exports.HeadingDisplaySizes) {
|
|
@@ -1544,7 +1637,7 @@ for (var type$1 in exports.HeadingDisplaySizes) {
|
|
|
1544
1637
|
*/
|
|
1545
1638
|
|
|
1546
1639
|
|
|
1547
|
-
var getVariant$
|
|
1640
|
+
var getVariant$2 = function getVariant(displaySize) {
|
|
1548
1641
|
return variantMap$1[displaySize] || null;
|
|
1549
1642
|
};
|
|
1550
1643
|
|
|
@@ -1554,13 +1647,19 @@ function Heading(props) {
|
|
|
1554
1647
|
id = props.id,
|
|
1555
1648
|
_props$level = props.level,
|
|
1556
1649
|
level = _props$level === void 0 ? exports.HeadingLevels.Two : _props$level,
|
|
1650
|
+
_props$sx = props.sx,
|
|
1651
|
+
sx = _props$sx === void 0 ? {} : _props$sx,
|
|
1557
1652
|
text = props.text,
|
|
1558
1653
|
url = props.url,
|
|
1559
1654
|
urlClass = props.urlClass;
|
|
1560
|
-
var variant = displaySize ? getVariant$
|
|
1655
|
+
var variant = displaySize ? getVariant$2(displaySize) : "h" + level;
|
|
1561
1656
|
var styles = react.useStyleConfig("Heading", {
|
|
1562
1657
|
variant: variant
|
|
1563
|
-
});
|
|
1658
|
+
}); // Combine native base styles with any additional styles.
|
|
1659
|
+
// This is used only in the `Hero` component, for now.
|
|
1660
|
+
|
|
1661
|
+
var finalStyles = _extends({}, styles, sx);
|
|
1662
|
+
|
|
1564
1663
|
var asHeading = "h" + level;
|
|
1565
1664
|
|
|
1566
1665
|
if (level < 1 || level > 6) {
|
|
@@ -1588,7 +1687,7 @@ function Heading(props) {
|
|
|
1588
1687
|
return React.createElement(react.Heading, {
|
|
1589
1688
|
id: id,
|
|
1590
1689
|
as: asHeading,
|
|
1591
|
-
sx:
|
|
1690
|
+
sx: finalStyles,
|
|
1592
1691
|
className: className
|
|
1593
1692
|
}, content);
|
|
1594
1693
|
}
|
|
@@ -1734,8 +1833,8 @@ function Card(props) {
|
|
|
1734
1833
|
}
|
|
1735
1834
|
|
|
1736
1835
|
(function (CardLayouts) {
|
|
1737
|
-
CardLayouts["
|
|
1738
|
-
CardLayouts["
|
|
1836
|
+
CardLayouts["Row"] = "row";
|
|
1837
|
+
CardLayouts["Column"] = "column";
|
|
1739
1838
|
})(exports.CardLayouts || (exports.CardLayouts = {}));
|
|
1740
1839
|
|
|
1741
1840
|
(function (CardImageRatios) {
|
|
@@ -1819,12 +1918,14 @@ function HelperErrorText(props) {
|
|
|
1819
1918
|
}, attributes), props.children);
|
|
1820
1919
|
}
|
|
1821
1920
|
|
|
1822
|
-
var _excluded$1 = ["isIndeterminate"];
|
|
1921
|
+
var _excluded$1 = ["isIndeterminate", "isChecked"];
|
|
1823
1922
|
var onChangeDefault = function onChangeDefault() {
|
|
1824
1923
|
return;
|
|
1825
1924
|
};
|
|
1826
1925
|
|
|
1827
1926
|
function CheckboxIcon(props) {
|
|
1927
|
+
// Don't need the `isChecked` prop but it causes
|
|
1928
|
+
// rendering issues on the SVG element.
|
|
1828
1929
|
var isIndeterminate = props.isIndeterminate,
|
|
1829
1930
|
rest = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
1830
1931
|
|
|
@@ -1841,7 +1942,8 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
1841
1942
|
var className = props.className,
|
|
1842
1943
|
errorText = props.errorText,
|
|
1843
1944
|
helperText = props.helperText,
|
|
1844
|
-
id = props.id,
|
|
1945
|
+
_props$id = props.id,
|
|
1946
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
1845
1947
|
isChecked = props.isChecked,
|
|
1846
1948
|
_props$isDisabled = props.isDisabled,
|
|
1847
1949
|
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
@@ -1857,17 +1959,16 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
1857
1959
|
var styles = react.useMultiStyleConfig("Checkbox", {});
|
|
1858
1960
|
var footnote = isInvalid ? errorText : helperText;
|
|
1859
1961
|
var attributes = {};
|
|
1860
|
-
var checkboxID = id || generateUUID();
|
|
1861
1962
|
var onChange = props.onChange || onChangeDefault;
|
|
1862
1963
|
|
|
1863
1964
|
if (!showLabel) {
|
|
1864
1965
|
attributes["aria-label"] = labelText && footnote ? labelText + " - " + footnote : labelText;
|
|
1865
1966
|
} else {
|
|
1866
|
-
if (footnote) attributes["aria-describedby"] =
|
|
1967
|
+
if (footnote) attributes["aria-describedby"] = id + "-helperText";
|
|
1867
1968
|
}
|
|
1868
1969
|
|
|
1869
1970
|
return React.createElement(React.Fragment, null, React.createElement(react.Checkbox, Object.assign({
|
|
1870
|
-
id:
|
|
1971
|
+
id: id,
|
|
1871
1972
|
className: className,
|
|
1872
1973
|
name: name || "default",
|
|
1873
1974
|
isDisabled: isDisabled,
|
|
@@ -1882,66 +1983,303 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
1882
1983
|
defaultIsChecked: false
|
|
1883
1984
|
}, {
|
|
1884
1985
|
icon: React.createElement(CheckboxIcon, null),
|
|
1885
|
-
//iconColor="ui.focus"
|
|
1886
1986
|
__css: styles
|
|
1887
1987
|
}, attributes), showLabel && labelText), footnote && showLabel && React.createElement(react.Box, {
|
|
1888
1988
|
__css: styles.helper,
|
|
1889
1989
|
"aria-disabled": isDisabled
|
|
1890
1990
|
}, React.createElement(HelperErrorText, {
|
|
1891
1991
|
isError: isInvalid,
|
|
1892
|
-
id:
|
|
1992
|
+
id: id + "-helperText"
|
|
1893
1993
|
}, footnote)));
|
|
1894
1994
|
});
|
|
1895
1995
|
Checkbox.displayName = "Checkbox";
|
|
1896
1996
|
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1997
|
+
/**
|
|
1998
|
+
* This is based on:
|
|
1999
|
+
* root size of 16px or 1rem
|
|
2000
|
+
* 1 spacing unit is 4px or 0.25rem
|
|
2001
|
+
*
|
|
2002
|
+
* Chakra's mental model: If you need a spacing of 40px, divide it by 4.
|
|
2003
|
+
* That'll give you 10. Then use it in your component.
|
|
2004
|
+
*
|
|
2005
|
+
* The DS uses eight CSS variables/values found in "src/styles/03-space/_space.css":
|
|
2006
|
+
* --space-xxs = 4px or 0.25rem
|
|
2007
|
+
* --space-xs = 8px or 0.5rem
|
|
2008
|
+
* --space-s = 16px or 1rem
|
|
2009
|
+
* --space-m = 24px or 1.5rem
|
|
2010
|
+
* --space-l = 32px or 2rem
|
|
2011
|
+
* --space-xl = 48px or 3rem
|
|
2012
|
+
* --space-xxl = 64px or 4rem
|
|
2013
|
+
* --space-xxxl = 96px or 6rem
|
|
2014
|
+
*
|
|
2015
|
+
* @note Even though all the following values are available through Chakra,
|
|
2016
|
+
* we recommend to only use the spacing values that map to the DS values
|
|
2017
|
+
* declared above.
|
|
2018
|
+
*
|
|
2019
|
+
* Chakra Number Value | Chakra Name value | DS Variable
|
|
2020
|
+
* ------------------- | ----------------- | -----------------
|
|
2021
|
+
* 1 | xxs | --space-xxs
|
|
2022
|
+
* 2 | xs | --space-xs
|
|
2023
|
+
* 4 | s | --space-s
|
|
2024
|
+
* 6 | m | --space-m
|
|
2025
|
+
* 8 | l | --space-l
|
|
2026
|
+
* 12 | xl | --space-xl
|
|
2027
|
+
* 16 | xxl | --space-xxl
|
|
2028
|
+
* 24 | xxxl | --space-xxxl
|
|
2029
|
+
*/
|
|
2030
|
+
var spacing = {
|
|
2031
|
+
px: "1px",
|
|
2032
|
+
0: "0",
|
|
2033
|
+
0.5: "0.125rem",
|
|
2034
|
+
// --space-xxs = 4px
|
|
2035
|
+
xxs: "0.25rem",
|
|
2036
|
+
1: "0.25rem",
|
|
2037
|
+
1.5: "0.375rem",
|
|
2038
|
+
// --space-xs = 8px
|
|
2039
|
+
xs: "0.5rem",
|
|
2040
|
+
2: "0.5rem",
|
|
2041
|
+
2.5: "0.625rem",
|
|
2042
|
+
3: "0.75rem",
|
|
2043
|
+
3.5: "0.875rem",
|
|
2044
|
+
// --space-s = 16px
|
|
2045
|
+
s: "1rem",
|
|
2046
|
+
4: "1rem",
|
|
2047
|
+
5: "1.25rem",
|
|
2048
|
+
// --space-m = 24px
|
|
2049
|
+
m: "1.5rem",
|
|
2050
|
+
6: "1.5rem",
|
|
2051
|
+
7: "1.75rem",
|
|
2052
|
+
// --space-l = 32px
|
|
2053
|
+
l: "2rem",
|
|
2054
|
+
8: "2rem",
|
|
2055
|
+
9: "2.25rem",
|
|
2056
|
+
10: "2.5rem",
|
|
2057
|
+
// --space-xl = 48px
|
|
2058
|
+
xl: "3rem",
|
|
2059
|
+
12: "3rem",
|
|
2060
|
+
14: "3.5rem",
|
|
2061
|
+
// --space-xxl = 64px
|
|
2062
|
+
xxl: "4rem",
|
|
2063
|
+
16: "4rem",
|
|
2064
|
+
20: "5rem",
|
|
2065
|
+
// --space-xxxl = 96px
|
|
2066
|
+
xxxl: "6rem",
|
|
2067
|
+
24: "6rem",
|
|
2068
|
+
28: "7rem",
|
|
2069
|
+
32: "8rem",
|
|
2070
|
+
36: "9rem",
|
|
2071
|
+
40: "10rem",
|
|
2072
|
+
44: "11rem",
|
|
2073
|
+
48: "12rem",
|
|
2074
|
+
52: "13rem",
|
|
2075
|
+
56: "14rem",
|
|
2076
|
+
60: "15rem",
|
|
2077
|
+
64: "16rem",
|
|
2078
|
+
72: "18rem",
|
|
2079
|
+
80: "20rem",
|
|
2080
|
+
96: "24rem"
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
(function (CheckboxGroupLayoutTypes) {
|
|
2084
|
+
CheckboxGroupLayoutTypes["Column"] = "column";
|
|
2085
|
+
CheckboxGroupLayoutTypes["Row"] = "row";
|
|
2086
|
+
})(exports.CheckboxGroupLayoutTypes || (exports.CheckboxGroupLayoutTypes = {}));
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* Wrapper component to wrap `Checkbox` components. Can be displayed in a
|
|
2090
|
+
* column or in a row. The `CheckboxGroup` component renders all the necessary
|
|
2091
|
+
* wrapping and associated text elements, but the checkbox input elements
|
|
2092
|
+
* _need_ to be child `Checkbox` components from the NYPL Design System.
|
|
2093
|
+
*/
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
var CheckboxGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
2097
|
+
var children = props.children,
|
|
2098
|
+
_props$defaultValue = props.defaultValue,
|
|
2099
|
+
defaultValue = _props$defaultValue === void 0 ? [] : _props$defaultValue,
|
|
2100
|
+
invalidText = props.invalidText,
|
|
2101
|
+
helperText = props.helperText,
|
|
2102
|
+
_props$id = props.id,
|
|
2103
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
2104
|
+
_props$isDisabled = props.isDisabled,
|
|
2105
|
+
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
2106
|
+
_props$isInvalid = props.isInvalid,
|
|
2107
|
+
isInvalid = _props$isInvalid === void 0 ? false : _props$isInvalid,
|
|
2108
|
+
_props$isRequired = props.isRequired,
|
|
2109
|
+
isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
|
|
2110
|
+
labelText = props.labelText,
|
|
2111
|
+
_props$layout = props.layout,
|
|
2112
|
+
layout = _props$layout === void 0 ? exports.CheckboxGroupLayoutTypes.Column : _props$layout,
|
|
2113
|
+
name = props.name,
|
|
2114
|
+
onChange = props.onChange,
|
|
2115
|
+
_props$optReqFlag = props.optReqFlag,
|
|
2116
|
+
optReqFlag = _props$optReqFlag === void 0 ? true : _props$optReqFlag,
|
|
2117
|
+
_props$showLabel = props.showLabel,
|
|
2118
|
+
showLabel = _props$showLabel === void 0 ? true : _props$showLabel;
|
|
2119
|
+
var footnote = isInvalid ? invalidText : helperText;
|
|
2120
|
+
var spacingProp = layout === exports.CheckboxGroupLayoutTypes.Column ? spacing.s : spacing.l;
|
|
2121
|
+
var newChildren = [];
|
|
2122
|
+
var checkboxProps = defaultValue && onChange ? {
|
|
2123
|
+
defaultValue: defaultValue,
|
|
2124
|
+
onChange: onChange
|
|
2125
|
+
} : {}; // Go through the Checkbox children and update them as needed.
|
|
2126
|
+
|
|
2127
|
+
React.Children.map(children, function (child, i) {
|
|
2128
|
+
if (child.type !== Checkbox) {
|
|
2129
|
+
// Special case for Storybook MDX documentation.
|
|
2130
|
+
if (child.props.mdxType && child.props.mdxType === "Checkbox") ; else {
|
|
2131
|
+
console.warn("Only `Checkbox` components are allowed inside the `CheckboxGroup` component.");
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
if (child !== undefined && child !== null) {
|
|
2136
|
+
var newProps = {
|
|
2137
|
+
key: i,
|
|
2138
|
+
id: id + "-" + i,
|
|
2139
|
+
name: name,
|
|
2140
|
+
isDisabled: isDisabled,
|
|
2141
|
+
isInvalid: isInvalid,
|
|
2142
|
+
isRequired: isRequired
|
|
2143
|
+
};
|
|
2144
|
+
newChildren.push(React.cloneElement(child, newProps));
|
|
2145
|
+
}
|
|
2146
|
+
}); // Get the Chakra-based styles for all the custom elements in this component.
|
|
2147
|
+
|
|
2148
|
+
var styles = react.useMultiStyleConfig("CustomCheckboxGroup", {});
|
|
2149
|
+
return React.createElement(react.Box, {
|
|
2150
|
+
as: "fieldset",
|
|
2151
|
+
id: "checkbox-group-" + id,
|
|
2152
|
+
__css: styles
|
|
2153
|
+
}, React.createElement("legend", {
|
|
2154
|
+
className: showLabel ? "" : "sr-only"
|
|
2155
|
+
}, React.createElement("span", null, labelText), optReqFlag && React.createElement(react.Box, {
|
|
2156
|
+
as: "span",
|
|
2157
|
+
__css: styles.required
|
|
2158
|
+
}, isRequired ? "Required" : "Optional")), React.createElement(react.CheckboxGroup, Object.assign({}, checkboxProps), React.createElement(react.Stack, {
|
|
2159
|
+
id: id,
|
|
2160
|
+
"data-testid": "checkbox-group",
|
|
2161
|
+
direction: [layout],
|
|
2162
|
+
spacing: spacingProp,
|
|
2163
|
+
ref: ref,
|
|
2164
|
+
"aria-label": !showLabel ? labelText : null
|
|
2165
|
+
}, newChildren)), footnote && React.createElement(react.Box, {
|
|
2166
|
+
__css: styles.helper
|
|
2167
|
+
}, React.createElement(HelperErrorText, {
|
|
2168
|
+
isError: isInvalid
|
|
2169
|
+
}, footnote)));
|
|
2170
|
+
});
|
|
2171
|
+
|
|
2172
|
+
(function (GridGaps) {
|
|
2173
|
+
GridGaps["ExtraExtraSmall"] = "xxs";
|
|
2174
|
+
GridGaps["ExtraSmall"] = "xs";
|
|
2175
|
+
GridGaps["Small"] = "s";
|
|
2176
|
+
GridGaps["Medium"] = "m";
|
|
2177
|
+
GridGaps["Large"] = "l";
|
|
2178
|
+
GridGaps["ExtraLarge"] = "xl";
|
|
2179
|
+
GridGaps["ExtraExtraLarge"] = "xxl";
|
|
2180
|
+
})(exports.GridGaps || (exports.GridGaps = {}));
|
|
2181
|
+
|
|
2182
|
+
function SimpleGrid(props) {
|
|
2183
|
+
var children = props.children,
|
|
2184
|
+
columns = props.columns,
|
|
2185
|
+
className = props.className,
|
|
2186
|
+
_props$gap = props.gap,
|
|
2187
|
+
gap = _props$gap === void 0 ? exports.GridGaps.Large : _props$gap,
|
|
2188
|
+
id = props.id;
|
|
2189
|
+
var responsiveCols = columns ? {
|
|
2190
|
+
base: 1,
|
|
2191
|
+
md: columns
|
|
2192
|
+
} : {
|
|
2193
|
+
base: 1,
|
|
2194
|
+
md: 2,
|
|
2195
|
+
lg: 3
|
|
2196
|
+
};
|
|
2197
|
+
return React.createElement(react.SimpleGrid, {
|
|
2198
|
+
columns: responsiveCols,
|
|
2199
|
+
gap: gap,
|
|
2200
|
+
id: id || generateUUID(),
|
|
2201
|
+
className: className
|
|
2202
|
+
}, children);
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
/** FormRow child-component */
|
|
2206
|
+
|
|
2207
|
+
function FormRow(props) {
|
|
2208
|
+
var children = props.children,
|
|
2209
|
+
className = props.className,
|
|
2210
|
+
gap = props.gap,
|
|
2211
|
+
id = props.id;
|
|
2212
|
+
var count = React.Children.count(children);
|
|
2213
|
+
var alteredChildren = React.Children.map(children, function (child, i) {
|
|
2214
|
+
return React.cloneElement(child, {
|
|
2215
|
+
id: id + "-grandchild" + i
|
|
2216
|
+
});
|
|
2217
|
+
});
|
|
2218
|
+
return React.createElement(SimpleGrid, {
|
|
2219
|
+
columns: count,
|
|
2220
|
+
className: className,
|
|
2221
|
+
gap: gap,
|
|
2222
|
+
id: id
|
|
2223
|
+
}, alteredChildren);
|
|
2224
|
+
}
|
|
2225
|
+
/** FormField child-component */
|
|
2226
|
+
|
|
2227
|
+
function FormField(props) {
|
|
2228
|
+
var children = props.children,
|
|
2229
|
+
className = props.className,
|
|
2230
|
+
gap = props.gap,
|
|
2231
|
+
id = props.id;
|
|
2232
|
+
return React.createElement(SimpleGrid, {
|
|
2233
|
+
columns: 1,
|
|
2234
|
+
className: className,
|
|
2235
|
+
gap: gap,
|
|
2236
|
+
id: id
|
|
2237
|
+
}, children);
|
|
2238
|
+
}
|
|
2239
|
+
/** main Form component */
|
|
2240
|
+
|
|
2241
|
+
function Form(props) {
|
|
2242
|
+
var action = props.action,
|
|
2243
|
+
children = props.children,
|
|
2244
|
+
className = props.className,
|
|
2245
|
+
_props$id = props.id,
|
|
2246
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
2247
|
+
method = props.method,
|
|
2248
|
+
spacing = props.spacing;
|
|
2249
|
+
var attributes = {};
|
|
2250
|
+
action && (attributes["action"] = action);
|
|
2251
|
+
method && (method === "get" || method === "post") && (attributes["method"] = method);
|
|
2252
|
+
var alteredChildren = React.Children.map(children, function (child, i) {
|
|
2253
|
+
return React.cloneElement(child, {
|
|
2254
|
+
gap: spacing,
|
|
2255
|
+
id: id + "-child" + i
|
|
2256
|
+
});
|
|
2257
|
+
});
|
|
2258
|
+
return React.createElement(react.Box, Object.assign({
|
|
2259
|
+
as: "form",
|
|
2260
|
+
"aria-label": "form",
|
|
2261
|
+
id: id
|
|
2262
|
+
}, attributes, {
|
|
2263
|
+
className: className
|
|
2264
|
+
}), React.createElement(SimpleGrid, {
|
|
2265
|
+
columns: 1,
|
|
2266
|
+
gap: spacing,
|
|
2267
|
+
id: id + "-parent"
|
|
2268
|
+
}, alteredChildren));
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
(function (DatePickerTypes) {
|
|
2272
|
+
DatePickerTypes["Full"] = "full";
|
|
2273
|
+
DatePickerTypes["Month"] = "month";
|
|
2274
|
+
DatePickerTypes["Year"] = "year";
|
|
2275
|
+
})(exports.DatePickerTypes || (exports.DatePickerTypes = {}));
|
|
2276
|
+
|
|
2277
|
+
// HTML Input types as defined by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
|
|
2278
|
+
|
|
2279
|
+
(function (TextInputTypes) {
|
|
2280
|
+
TextInputTypes["email"] = "email";
|
|
2281
|
+
TextInputTypes["hidden"] = "hidden"; // eslint-disable-next-line id-blacklist
|
|
2282
|
+
|
|
1945
2283
|
TextInputTypes["number"] = "number";
|
|
1946
2284
|
TextInputTypes["password"] = "password";
|
|
1947
2285
|
TextInputTypes["text"] = "text";
|
|
@@ -1963,6 +2301,14 @@ var TextInputFormats;
|
|
|
1963
2301
|
TextInputFormats["textarea"] = "";
|
|
1964
2302
|
TextInputFormats["url"] = "https://domain.com";
|
|
1965
2303
|
})(TextInputFormats || (TextInputFormats = {}));
|
|
2304
|
+
|
|
2305
|
+
var TextInputVariants;
|
|
2306
|
+
|
|
2307
|
+
(function (TextInputVariants) {
|
|
2308
|
+
TextInputVariants["Default"] = "default";
|
|
2309
|
+
TextInputVariants["SearchBar"] = "searchBar";
|
|
2310
|
+
TextInputVariants["SearchBarSelect"] = "searchBarSelect";
|
|
2311
|
+
})(TextInputVariants || (TextInputVariants = {}));
|
|
1966
2312
|
/*
|
|
1967
2313
|
export enum TextInputPatterns {
|
|
1968
2314
|
// eslint-disable-next-line prettier/prettier
|
|
@@ -1984,95 +2330,90 @@ export enum TextInputPatterns {
|
|
|
1984
2330
|
*/
|
|
1985
2331
|
|
|
1986
2332
|
function Label(props) {
|
|
1987
|
-
var
|
|
1988
|
-
blockName = props.blockName,
|
|
1989
|
-
children = props.children,
|
|
2333
|
+
var children = props.children,
|
|
1990
2334
|
className = props.className,
|
|
1991
2335
|
htmlFor = props.htmlFor,
|
|
1992
|
-
id = props.id,
|
|
1993
|
-
_props$
|
|
1994
|
-
modifiers = _props$modifiers === void 0 ? [] : _props$modifiers,
|
|
2336
|
+
_props$id = props.id,
|
|
2337
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
1995
2338
|
optReqFlag = props.optReqFlag;
|
|
1996
|
-
var
|
|
1997
|
-
|
|
1998
|
-
|
|
2339
|
+
var styles = react.useMultiStyleConfig("Label", {});
|
|
2340
|
+
return React.createElement(react.Box, {
|
|
2341
|
+
as: "label",
|
|
2342
|
+
id: id,
|
|
2343
|
+
className: className,
|
|
1999
2344
|
htmlFor: htmlFor,
|
|
2000
|
-
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
if (optReqFlag) {
|
|
2005
|
-
helperString = React.createElement("div", {
|
|
2006
|
-
className: bem("required-helper", [], baseClass)
|
|
2007
|
-
}, optReqFlag);
|
|
2008
|
-
}
|
|
2009
|
-
|
|
2010
|
-
return React.createElement("label", labelAttributes, attributes, children, helperString);
|
|
2345
|
+
__css: styles
|
|
2346
|
+
}, children, optReqFlag && React.createElement(react.Box, {
|
|
2347
|
+
__css: styles.helper
|
|
2348
|
+
}, optReqFlag));
|
|
2011
2349
|
}
|
|
2012
2350
|
|
|
2013
|
-
/**
|
|
2014
|
-
*
|
|
2015
|
-
*
|
|
2351
|
+
/**
|
|
2352
|
+
* Renders either an `input` element with a specified type or a `textarea`
|
|
2353
|
+
* element. All types will render an accessible `Label` component and an
|
|
2354
|
+
* optional `HelperErrorText` component.
|
|
2016
2355
|
*/
|
|
2017
2356
|
|
|
2018
2357
|
var TextInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
2019
2358
|
var _props$attributes = props.attributes,
|
|
2020
2359
|
attributes = _props$attributes === void 0 ? {} : _props$attributes,
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2360
|
+
className = props.className,
|
|
2361
|
+
helperText = props.helperText,
|
|
2362
|
+
_props$id = props.id,
|
|
2363
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
2364
|
+
invalidText = props.invalidText,
|
|
2365
|
+
_props$isDisabled = props.isDisabled,
|
|
2366
|
+
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
2367
|
+
_props$isInvalid = props.isInvalid,
|
|
2368
|
+
isInvalid = _props$isInvalid === void 0 ? false : _props$isInvalid,
|
|
2369
|
+
_props$isRequired = props.isRequired,
|
|
2370
|
+
isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
|
|
2024
2371
|
labelText = props.labelText,
|
|
2372
|
+
onChange = props.onChange,
|
|
2373
|
+
placeholder = props.placeholder,
|
|
2025
2374
|
_props$showLabel = props.showLabel,
|
|
2026
2375
|
showLabel = _props$showLabel === void 0 ? true : _props$showLabel,
|
|
2027
2376
|
_props$showOptReqLabe = props.showOptReqLabel,
|
|
2028
2377
|
showOptReqLabel = _props$showOptReqLabe === void 0 ? true : _props$showOptReqLabe,
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
placeholder = props.placeholder,
|
|
2378
|
+
_props$type = props.type,
|
|
2379
|
+
type = _props$type === void 0 ? exports.TextInputTypes.text : _props$type,
|
|
2032
2380
|
value = props.value,
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
modifiers = _props$modifiers === void 0 ? [] : _props$modifiers,
|
|
2039
|
-
_props$id = props.id,
|
|
2040
|
-
id = _props$id === void 0 ? generateUUID() : _props$id;
|
|
2381
|
+
_props$variantType = props.variantType,
|
|
2382
|
+
variantType = _props$variantType === void 0 ? TextInputVariants.Default : _props$variantType;
|
|
2383
|
+
var styles = react.useMultiStyleConfig("TextInput", {
|
|
2384
|
+
variant: variantType
|
|
2385
|
+
});
|
|
2041
2386
|
var isTextArea = type === exports.TextInputTypes.textarea;
|
|
2042
2387
|
var isHidden = type === exports.TextInputTypes.hidden;
|
|
2043
|
-
var optReqFlag =
|
|
2044
|
-
var
|
|
2045
|
-
var footnote;
|
|
2388
|
+
var optReqFlag = isRequired ? "Required" : "Optional";
|
|
2389
|
+
var finalInvalidText = invalidText ? invalidText : "There is an error related to this field.";
|
|
2390
|
+
var footnote = isInvalid ? finalInvalidText : helperText;
|
|
2391
|
+
var fieldOutput;
|
|
2046
2392
|
var options;
|
|
2047
|
-
if (!showLabel) attributes["aria-label"] = labelText;
|
|
2048
|
-
if (helperText) attributes["aria-describedby"] = helperText;
|
|
2049
|
-
|
|
2050
|
-
if (errored) {
|
|
2051
|
-
modifiers.push("error");
|
|
2052
|
-
}
|
|
2053
2393
|
|
|
2054
|
-
if (
|
|
2055
|
-
|
|
2056
|
-
}
|
|
2057
|
-
|
|
2058
|
-
if (errored) {
|
|
2059
|
-
footnote = errorOutput;
|
|
2060
|
-
} else {
|
|
2061
|
-
footnote = helperText;
|
|
2394
|
+
if (!showLabel) {
|
|
2395
|
+
attributes["aria-label"] = labelText && footnote ? labelText + " - " + footnote : labelText;
|
|
2396
|
+
} else if (helperText) {
|
|
2397
|
+
attributes["aria-describedby"] = id + "-helperText";
|
|
2062
2398
|
}
|
|
2063
2399
|
|
|
2064
2400
|
if (type === exports.TextInputTypes.tel || type === exports.TextInputTypes.url || type === exports.TextInputTypes.email) {
|
|
2065
2401
|
var example = TextInputFormats[type];
|
|
2066
2402
|
footnote = React.createElement(React.Fragment, null, "Ex: ", example, React.createElement("br", null), footnote);
|
|
2067
|
-
}
|
|
2403
|
+
} // When the type is "hidden", the input element needs fewer attributes.
|
|
2404
|
+
|
|
2068
2405
|
|
|
2069
|
-
options =
|
|
2406
|
+
options = isHidden ? {
|
|
2070
2407
|
id: id,
|
|
2071
|
-
className: bem("inputfield", modifiers, "", [className]),
|
|
2072
|
-
"aria-required": required,
|
|
2073
2408
|
"aria-hidden": isHidden,
|
|
2074
|
-
|
|
2075
|
-
|
|
2409
|
+
onChange: onChange,
|
|
2410
|
+
ref: ref
|
|
2411
|
+
} : _extends({
|
|
2412
|
+
id: id,
|
|
2413
|
+
"aria-required": isRequired,
|
|
2414
|
+
isDisabled: isDisabled,
|
|
2415
|
+
isRequired: isRequired,
|
|
2416
|
+
isInvalid: isInvalid,
|
|
2076
2417
|
placeholder: placeholder,
|
|
2077
2418
|
onChange: onChange,
|
|
2078
2419
|
ref: ref
|
|
@@ -2084,22 +2425,30 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
2084
2425
|
type: type,
|
|
2085
2426
|
value: value
|
|
2086
2427
|
}, options);
|
|
2428
|
+
fieldOutput = React.createElement(react.Input, Object.assign({}, options, {
|
|
2429
|
+
__css: styles.input
|
|
2430
|
+
}));
|
|
2431
|
+
} else {
|
|
2432
|
+
fieldOutput = React.createElement(react.Textarea, Object.assign({}, options, {
|
|
2433
|
+
__css: styles.textarea
|
|
2434
|
+
}), value);
|
|
2087
2435
|
}
|
|
2088
2436
|
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
className:
|
|
2437
|
+
return React.createElement(react.Box, {
|
|
2438
|
+
__css: styles,
|
|
2439
|
+
className: className
|
|
2092
2440
|
}, labelText && showLabel && !isHidden && React.createElement(Label, {
|
|
2093
2441
|
htmlFor: id,
|
|
2094
2442
|
optReqFlag: showOptReqLabel && optReqFlag,
|
|
2095
2443
|
id: id + "-label"
|
|
2096
|
-
}, labelText), fieldOutput,
|
|
2097
|
-
|
|
2444
|
+
}, labelText), fieldOutput, footnote && !isHidden && React.createElement(react.Box, {
|
|
2445
|
+
__css: styles.helper,
|
|
2446
|
+
"aria-disabled": isDisabled
|
|
2447
|
+
}, React.createElement(HelperErrorText, {
|
|
2448
|
+
isError: isInvalid,
|
|
2098
2449
|
id: id + "-helperText"
|
|
2099
|
-
}, footnote));
|
|
2100
|
-
return transformedInput;
|
|
2450
|
+
}, footnote)));
|
|
2101
2451
|
});
|
|
2102
|
-
TextInput.displayName = "TextInput";
|
|
2103
2452
|
|
|
2104
2453
|
/**
|
|
2105
2454
|
* A Design System `TextInput` component that is used as the custom input
|
|
@@ -2118,10 +2467,10 @@ var CustomTextInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2118
2467
|
onChange = _ref.onChange,
|
|
2119
2468
|
value = _ref.value,
|
|
2120
2469
|
labelText = _ref.labelText,
|
|
2121
|
-
|
|
2470
|
+
isDisabled = _ref.isDisabled,
|
|
2122
2471
|
dsRequired = _ref.dsRequired,
|
|
2123
2472
|
showOptReqLabel = _ref.showOptReqLabel,
|
|
2124
|
-
|
|
2473
|
+
isInvalid = _ref.isInvalid,
|
|
2125
2474
|
helperText = _ref.helperText,
|
|
2126
2475
|
invalidText = _ref.invalidText,
|
|
2127
2476
|
onClick = _ref.onClick,
|
|
@@ -2134,10 +2483,10 @@ var CustomTextInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2134
2483
|
onChange: onChange,
|
|
2135
2484
|
value: value,
|
|
2136
2485
|
labelText: labelText,
|
|
2137
|
-
|
|
2138
|
-
|
|
2486
|
+
isDisabled: isDisabled,
|
|
2487
|
+
isRequired: dsRequired,
|
|
2139
2488
|
showOptReqLabel: showOptReqLabel,
|
|
2140
|
-
|
|
2489
|
+
isInvalid: isInvalid,
|
|
2141
2490
|
helperText: helperText,
|
|
2142
2491
|
invalidText: invalidText,
|
|
2143
2492
|
// Use either the specific prop-based or the forwardRef value.
|
|
@@ -2211,11 +2560,11 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2211
2560
|
helperTextFrom = props.helperTextFrom,
|
|
2212
2561
|
helperTextTo = props.helperTextTo,
|
|
2213
2562
|
invalidText = props.invalidText,
|
|
2214
|
-
|
|
2563
|
+
isInvalid = props.isInvalid,
|
|
2215
2564
|
required = props.required,
|
|
2216
2565
|
_props$showOptReqLabe = props.showOptReqLabel,
|
|
2217
2566
|
showOptReqLabel = _props$showOptReqLabe === void 0 ? true : _props$showOptReqLabe,
|
|
2218
|
-
|
|
2567
|
+
isDisabled = props.isDisabled,
|
|
2219
2568
|
nameFrom = props.nameFrom,
|
|
2220
2569
|
nameTo = props.nameTo,
|
|
2221
2570
|
blockName = props.blockName,
|
|
@@ -2269,7 +2618,7 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2269
2618
|
minDate: minDate ? new Date(minDate) : null,
|
|
2270
2619
|
maxDate: maxDate ? new Date(maxDate) : null,
|
|
2271
2620
|
dateFormat: dateFormat,
|
|
2272
|
-
|
|
2621
|
+
isDisabled: isDisabled
|
|
2273
2622
|
}; // Both TextInput components share some props.
|
|
2274
2623
|
|
|
2275
2624
|
var baseCustomTextInputAttrs = {
|
|
@@ -2278,8 +2627,8 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2278
2627
|
// Always display the labels or the input fields when
|
|
2279
2628
|
// the DatePicker component is a `dateRange` type.
|
|
2280
2629
|
showLabel: dateRange ? true : showLabel,
|
|
2281
|
-
|
|
2282
|
-
|
|
2630
|
+
isDisabled: isDisabled,
|
|
2631
|
+
isInvalid: isInvalid,
|
|
2283
2632
|
helperText: dateRange ? helperTextFrom : helperText,
|
|
2284
2633
|
invalidText: invalidText
|
|
2285
2634
|
};
|
|
@@ -2373,92 +2722,89 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2373
2722
|
}, helperText));
|
|
2374
2723
|
});
|
|
2375
2724
|
|
|
2376
|
-
(function (FormSpacing) {
|
|
2377
|
-
FormSpacing["ExtraExtraSmall"] = "extra-extra-small";
|
|
2378
|
-
FormSpacing["ExtraSmall"] = "extra-small";
|
|
2379
|
-
FormSpacing["Small"] = "small";
|
|
2380
|
-
FormSpacing["Medium"] = "medium";
|
|
2381
|
-
FormSpacing["Large"] = "large";
|
|
2382
|
-
FormSpacing["ExtraLarge"] = "extra-large";
|
|
2383
|
-
})(exports.FormSpacing || (exports.FormSpacing = {}));
|
|
2384
|
-
|
|
2385
2725
|
(function (HeroTypes) {
|
|
2386
|
-
HeroTypes["
|
|
2387
|
-
HeroTypes["
|
|
2388
|
-
HeroTypes["
|
|
2389
|
-
HeroTypes["
|
|
2390
|
-
HeroTypes["
|
|
2726
|
+
HeroTypes["Primary"] = "primary";
|
|
2727
|
+
HeroTypes["Secondary"] = "secondary";
|
|
2728
|
+
HeroTypes["SecondaryBooksAndMore"] = "secondaryBooksAndMore";
|
|
2729
|
+
HeroTypes["SecondaryLocations"] = "secondaryLocations";
|
|
2730
|
+
HeroTypes["SecondaryResearch"] = "secondaryResearch";
|
|
2731
|
+
HeroTypes["SecondaryWhatsOn"] = "secondaryWhatsOn";
|
|
2732
|
+
HeroTypes["Tertiary"] = "tertiary";
|
|
2733
|
+
HeroTypes["Campaign"] = "campaign";
|
|
2734
|
+
HeroTypes["FiftyFifty"] = "fiftyfifty";
|
|
2391
2735
|
})(exports.HeroTypes || (exports.HeroTypes = {}));
|
|
2392
2736
|
|
|
2393
|
-
|
|
2737
|
+
var HeroSecondaryTypes = [exports.HeroTypes.Secondary, exports.HeroTypes.SecondaryBooksAndMore, exports.HeroTypes.SecondaryLocations, exports.HeroTypes.SecondaryResearch, exports.HeroTypes.SecondaryWhatsOn];
|
|
2738
|
+
|
|
2739
|
+
var variantMap$2 = {};
|
|
2740
|
+
|
|
2741
|
+
for (var type$2 in exports.HeroTypes) {
|
|
2742
|
+
variantMap$2[exports.HeroTypes[type$2]] = exports.HeroTypes[type$2];
|
|
2743
|
+
}
|
|
2744
|
+
/**
|
|
2745
|
+
* Map the HeroTypes to the Hero Chakra theme variant object. If a wrong
|
|
2746
|
+
* value is passed (typically in non-Typescript scenarios), then the default
|
|
2747
|
+
* is the "primary" variant.
|
|
2748
|
+
*/
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
var getVariant$3 = function getVariant(type) {
|
|
2752
|
+
return variantMap$2[type] || exports.HeroTypes.Primary;
|
|
2753
|
+
};
|
|
2754
|
+
|
|
2394
2755
|
function Hero(props) {
|
|
2395
|
-
var heroBaseClass = "hero";
|
|
2396
2756
|
var backgroundColor = props.backgroundColor,
|
|
2397
2757
|
backgroundImageSrc = props.backgroundImageSrc,
|
|
2398
|
-
blockName = props.blockName,
|
|
2399
|
-
className = props.className,
|
|
2400
2758
|
foregroundColor = props.foregroundColor,
|
|
2401
2759
|
heading = props.heading,
|
|
2402
2760
|
heroType = props.heroType,
|
|
2403
2761
|
image = props.image,
|
|
2404
|
-
_props$modifiers = props.modifiers,
|
|
2405
|
-
modifiers = _props$modifiers === void 0 ? [] : _props$modifiers,
|
|
2406
2762
|
locationDetails = props.locationDetails,
|
|
2407
2763
|
subHeaderText = props.subHeaderText;
|
|
2764
|
+
var variant = getVariant$3(heroType);
|
|
2765
|
+
var styles = react.useMultiStyleConfig("Hero", {
|
|
2766
|
+
variant: variant
|
|
2767
|
+
});
|
|
2768
|
+
var headingStyles = styles.heading; // We want to add `Hero`-specific styling to the `Heading` component.
|
|
2408
2769
|
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
modifiers.push("tertiary");
|
|
2415
|
-
} else if (heroType === exports.HeroTypes.FiftyFifty) {
|
|
2416
|
-
modifiers.push("50-50");
|
|
2417
|
-
} else if (heroType === exports.HeroTypes.Campaign) {
|
|
2418
|
-
modifiers.push("campaign");
|
|
2419
|
-
}
|
|
2770
|
+
var finalHeading = heading && React.cloneElement(heading, {
|
|
2771
|
+
sx: headingStyles
|
|
2772
|
+
});
|
|
2773
|
+
var backgroundImageStyle = {};
|
|
2774
|
+
var contentBoxStyling = {};
|
|
2420
2775
|
|
|
2421
|
-
if (heroType === exports.HeroTypes.Primary
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2776
|
+
if (heroType === exports.HeroTypes.Primary) {
|
|
2777
|
+
if (!backgroundImageSrc) {
|
|
2778
|
+
console.warn("Warning: it is recommended to use the \"backgroundImageSrc\" prop for PRIMARY hero.");
|
|
2779
|
+
}
|
|
2425
2780
|
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2781
|
+
if (image) {
|
|
2782
|
+
console.warn("Warning: the \"image\" prop has been passed, but PRIMARY hero will not use it.");
|
|
2783
|
+
}
|
|
2784
|
+
} else if (locationDetails) {
|
|
2785
|
+
console.warn("Warning: Please provide \"locationDetails\" only to PRIMARY hero.");
|
|
2429
2786
|
}
|
|
2430
2787
|
|
|
2431
|
-
if (heroType
|
|
2432
|
-
console.warn("Warning: the \"backgroundImageSrc\" prop has been passed, but SECONDARY hero will not use it");
|
|
2433
|
-
modifiers.push("warning");
|
|
2788
|
+
if (HeroSecondaryTypes.includes(heroType) && backgroundImageSrc) {
|
|
2789
|
+
console.warn("Warning: the \"backgroundImageSrc\" prop has been passed, but SECONDARY hero will not use it.");
|
|
2434
2790
|
}
|
|
2435
2791
|
|
|
2436
2792
|
if (heroType === exports.HeroTypes.Tertiary && (backgroundImageSrc || image)) {
|
|
2437
|
-
console.warn("Warning: TERTIARY hero will not use any of the image props");
|
|
2438
|
-
modifiers.push("warning");
|
|
2439
|
-
}
|
|
2440
|
-
|
|
2441
|
-
if (heroType === exports.HeroTypes.FiftyFifty && backgroundImageSrc) {
|
|
2442
|
-
console.warn("Warning: the \"backgroundImageSrc\" prop has been passed, but FIFTYFIFTY hero will not use it");
|
|
2443
|
-
modifiers.push("warning");
|
|
2793
|
+
console.warn("Warning: TERTIARY hero will not use any of the image props.");
|
|
2444
2794
|
}
|
|
2445
2795
|
|
|
2446
2796
|
if (heroType === exports.HeroTypes.Campaign && (!backgroundImageSrc || !image)) {
|
|
2447
|
-
console.warn("Warning: it is recommended to use both \"backgroundImageSrc\" and \"image\" props for CAMPAIGN hero");
|
|
2448
|
-
modifiers.push("warning");
|
|
2797
|
+
console.warn("Warning: it is recommended to use both \"backgroundImageSrc\" and \"image\" props for CAMPAIGN hero.");
|
|
2449
2798
|
}
|
|
2450
2799
|
|
|
2451
|
-
if (heroType
|
|
2452
|
-
console.warn("Warning:
|
|
2453
|
-
modifiers.push("warning");
|
|
2800
|
+
if (heroType === exports.HeroTypes.FiftyFifty && backgroundImageSrc) {
|
|
2801
|
+
console.warn("Warning: the \"backgroundImageSrc\" prop has been passed, but FIFTYFIFTY hero will not use it.");
|
|
2454
2802
|
}
|
|
2455
2803
|
|
|
2456
|
-
var backgroundImageStyle = {};
|
|
2457
|
-
|
|
2458
2804
|
if (heroType === exports.HeroTypes.Primary) {
|
|
2459
2805
|
backgroundImageStyle = backgroundImageSrc ? {
|
|
2460
2806
|
backgroundImage: "url(" + backgroundImageSrc + ")"
|
|
2461
|
-
} :
|
|
2807
|
+
} : {};
|
|
2462
2808
|
} else if (heroType === exports.HeroTypes.Campaign) {
|
|
2463
2809
|
backgroundImageStyle = backgroundImageSrc ? {
|
|
2464
2810
|
backgroundImage: "url(" + backgroundImageSrc + ")"
|
|
@@ -2471,30 +2817,29 @@ function Hero(props) {
|
|
|
2471
2817
|
};
|
|
2472
2818
|
}
|
|
2473
2819
|
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
if (heroType === exports.HeroTypes.Primary || heroType === exports.HeroTypes.Tertiary || heroType === exports.HeroTypes.FiftyFifty || heroType === exports.HeroTypes.Campaign) {
|
|
2820
|
+
if (!HeroSecondaryTypes.includes(heroType)) {
|
|
2477
2821
|
contentBoxStyling = {
|
|
2478
2822
|
color: foregroundColor,
|
|
2479
2823
|
backgroundColor: backgroundColor
|
|
2480
2824
|
};
|
|
2481
|
-
} else {
|
|
2482
|
-
|
|
2483
|
-
console.warn("Warning: the \"foregroundColor\" and/or \"backgroundColor\" props have been passed, but SECONDARY Hero will not use them");
|
|
2484
|
-
modifiers.push("warning");
|
|
2485
|
-
}
|
|
2825
|
+
} else if (foregroundColor || backgroundColor) {
|
|
2826
|
+
console.warn("Warning: the \"foregroundColor\" and/or \"backgroundColor\" props have been passed, but SECONDARY Hero will not use them.");
|
|
2486
2827
|
}
|
|
2487
2828
|
|
|
2488
|
-
var childrenToRender = heroType === exports.HeroTypes.Campaign ? React.createElement(React.Fragment, null, image, React.createElement(
|
|
2489
|
-
|
|
2490
|
-
},
|
|
2491
|
-
|
|
2492
|
-
|
|
2829
|
+
var childrenToRender = heroType === exports.HeroTypes.Campaign ? React.createElement(React.Fragment, null, image, React.createElement(react.Box, {
|
|
2830
|
+
__css: styles.interior
|
|
2831
|
+
}, finalHeading, subHeaderText)) : React.createElement(React.Fragment, null, heroType !== exports.HeroTypes.Primary && heroType !== exports.HeroTypes.Tertiary && image, finalHeading, heroType === exports.HeroTypes.Tertiary && subHeaderText ? React.createElement("p", null, subHeaderText) : React.createElement(react.Box, {
|
|
2832
|
+
__css: styles.bodyText
|
|
2833
|
+
}, subHeaderText));
|
|
2834
|
+
return React.createElement(react.Box, {
|
|
2835
|
+
"data-testid": "hero",
|
|
2493
2836
|
"data-responsive-background-image": true,
|
|
2494
|
-
style: backgroundImageStyle
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2837
|
+
style: backgroundImageStyle,
|
|
2838
|
+
__css: styles
|
|
2839
|
+
}, React.createElement(react.Box, {
|
|
2840
|
+
"data-testid": "hero-content",
|
|
2841
|
+
style: contentBoxStyling,
|
|
2842
|
+
__css: styles.content
|
|
2498
2843
|
}, childrenToRender), locationDetails);
|
|
2499
2844
|
}
|
|
2500
2845
|
|
|
@@ -2582,90 +2927,99 @@ Input.displayName = "Input";
|
|
|
2582
2927
|
})(exports.LinkTypes || (exports.LinkTypes = {}));
|
|
2583
2928
|
|
|
2584
2929
|
/**
|
|
2585
|
-
*
|
|
2586
|
-
*
|
|
2930
|
+
* Renders the `Link` children components with a direction arrow icon based
|
|
2931
|
+
* on the `Backwards` or `Forwards` `LinkTypes` type.
|
|
2932
|
+
*/
|
|
2933
|
+
|
|
2934
|
+
function getWithDirectionIcon(children, type) {
|
|
2935
|
+
var iconRotation;
|
|
2936
|
+
var iconAlign;
|
|
2937
|
+
var icon = null; // An icon needs a position in order for it to be created and
|
|
2938
|
+
// rendered in the link.
|
|
2939
|
+
|
|
2940
|
+
if (type === exports.LinkTypes.Backwards) {
|
|
2941
|
+
iconRotation = exports.IconRotationTypes.Rotate90;
|
|
2942
|
+
iconAlign = IconAlign.Left;
|
|
2943
|
+
} else if (type === exports.LinkTypes.Forwards) {
|
|
2944
|
+
iconRotation = exports.IconRotationTypes.Rotate270;
|
|
2945
|
+
iconAlign = IconAlign.Right;
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
icon = React.createElement(Icon, {
|
|
2949
|
+
name: exports.IconNames.Arrow,
|
|
2950
|
+
align: iconAlign,
|
|
2951
|
+
iconRotation: iconRotation,
|
|
2952
|
+
className: "more-link"
|
|
2953
|
+
});
|
|
2954
|
+
return React.createElement(React.Fragment, null, type === exports.LinkTypes.Backwards && icon, children, type === exports.LinkTypes.Forwards && icon);
|
|
2955
|
+
}
|
|
2956
|
+
/**
|
|
2957
|
+
* A component that uses an `href` prop or a child anchor element, to create
|
|
2958
|
+
* an anchor element with added styling and conventions.
|
|
2587
2959
|
*/
|
|
2588
2960
|
|
|
2961
|
+
|
|
2589
2962
|
var Link = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
2590
2963
|
var attributes = props.attributes,
|
|
2591
|
-
|
|
2964
|
+
children = props.children,
|
|
2592
2965
|
className = props.className,
|
|
2593
2966
|
href = props.href,
|
|
2594
|
-
id = props.id,
|
|
2967
|
+
_props$id = props.id,
|
|
2968
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
2595
2969
|
_props$type = props.type,
|
|
2596
|
-
type = _props$type === void 0 ? exports.LinkTypes.Default : _props$type
|
|
2597
|
-
_props$modifiers = props.modifiers,
|
|
2598
|
-
modifiers = _props$modifiers === void 0 ? [] : _props$modifiers,
|
|
2599
|
-
children = props.children; // Merge the necessary props alongside any extra props for the
|
|
2970
|
+
type = _props$type === void 0 ? exports.LinkTypes.Default : _props$type; // Merge the necessary props alongside any extra props for the
|
|
2600
2971
|
// anchor element.
|
|
2601
2972
|
|
|
2602
2973
|
var linkProps = _extends({
|
|
2603
2974
|
id: id,
|
|
2604
2975
|
href: href
|
|
2605
|
-
}, attributes);
|
|
2976
|
+
}, attributes); // The LinkTypes.Default type.
|
|
2977
|
+
|
|
2606
2978
|
|
|
2607
|
-
var
|
|
2608
|
-
var childProps = {};
|
|
2979
|
+
var variant = "link";
|
|
2609
2980
|
|
|
2610
2981
|
if (typeof children === "string" && !href) {
|
|
2611
2982
|
throw new Error("Link needs prop 'href'");
|
|
2612
2983
|
}
|
|
2613
2984
|
|
|
2614
2985
|
if (type === exports.LinkTypes.Action || type === exports.LinkTypes.Forwards || type === exports.LinkTypes.Backwards) {
|
|
2615
|
-
|
|
2986
|
+
variant = "moreLink";
|
|
2616
2987
|
} else if (type === exports.LinkTypes.Button) {
|
|
2617
|
-
|
|
2618
|
-
}
|
|
2619
|
-
|
|
2620
|
-
var iconRotation, iconPosition, iconLeft, iconRight; // An icon needs a position in order for it to be created and
|
|
2621
|
-
// rendered in the link.
|
|
2622
|
-
|
|
2623
|
-
if (type === exports.LinkTypes.Backwards) {
|
|
2624
|
-
iconRotation = exports.IconRotationTypes.rotate90;
|
|
2625
|
-
iconPosition = "left";
|
|
2626
|
-
} else if (type === exports.LinkTypes.Forwards) {
|
|
2627
|
-
iconRotation = exports.IconRotationTypes.rotate270;
|
|
2628
|
-
iconPosition = "right";
|
|
2988
|
+
variant = "button";
|
|
2629
2989
|
}
|
|
2630
2990
|
|
|
2631
|
-
var
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
decorative: true
|
|
2636
|
-
};
|
|
2637
|
-
|
|
2638
|
-
if (type === exports.LinkTypes.Backwards) {
|
|
2639
|
-
iconLeft = React.createElement(Icon, Object.assign({}, navigationIconProps));
|
|
2640
|
-
} else if (type === exports.LinkTypes.Forwards) {
|
|
2641
|
-
iconRight = React.createElement(Icon, Object.assign({}, navigationIconProps));
|
|
2642
|
-
}
|
|
2991
|
+
var style = react.useStyleConfig("Link", {
|
|
2992
|
+
variant: variant
|
|
2993
|
+
}); // Render with specific direction arrows only if the type
|
|
2994
|
+
// is Forwards or Backwards.
|
|
2643
2995
|
|
|
2644
|
-
var
|
|
2996
|
+
var newChildren = type === exports.LinkTypes.Forwards || type === exports.LinkTypes.Backwards ? getWithDirectionIcon(children, type) : children;
|
|
2645
2997
|
|
|
2646
|
-
if (!
|
|
2647
|
-
// React Types error makes this fail:
|
|
2648
|
-
//
|
|
2649
|
-
|
|
2650
|
-
|
|
2998
|
+
if (!href) {
|
|
2999
|
+
// React Types error makes this fail:
|
|
3000
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/32832
|
|
3001
|
+
// let children = React.Children.only(children);
|
|
3002
|
+
if (React.Children.count(children) > 1) {
|
|
3003
|
+
throw new Error("Please pass only one child into `Link`.");
|
|
2651
3004
|
}
|
|
2652
3005
|
|
|
2653
|
-
var
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
className: linkClassName
|
|
3006
|
+
var childrenToClone = children[0] ? children[0] : children;
|
|
3007
|
+
var childProps = childrenToClone.props;
|
|
3008
|
+
return React.cloneElement(childrenToClone, _extends({
|
|
3009
|
+
className: className
|
|
2658
3010
|
}, linkProps, childProps, {
|
|
2659
3011
|
ref: ref
|
|
2660
|
-
}), [
|
|
3012
|
+
}), [childrenToClone.props.children]);
|
|
2661
3013
|
} else {
|
|
2662
|
-
return React.createElement(
|
|
2663
|
-
|
|
3014
|
+
return React.createElement(react.Box, Object.assign({
|
|
3015
|
+
as: "a",
|
|
3016
|
+
className: className,
|
|
2664
3017
|
ref: ref
|
|
2665
|
-
}
|
|
3018
|
+
}, linkProps, {
|
|
3019
|
+
__css: style
|
|
3020
|
+
}), newChildren);
|
|
2666
3021
|
}
|
|
2667
3022
|
});
|
|
2668
|
-
Link.displayName = "Link";
|
|
2669
3023
|
|
|
2670
3024
|
(function (ListTypes) {
|
|
2671
3025
|
ListTypes["Ordered"] = "ol";
|
|
@@ -2885,18 +3239,18 @@ function Notification(props) {
|
|
|
2885
3239
|
return React__default.createElement(Icon, {
|
|
2886
3240
|
decorative: false,
|
|
2887
3241
|
className: "notification-icon",
|
|
2888
|
-
name: exports.IconNames.
|
|
2889
|
-
color: exports.IconColors.
|
|
2890
|
-
|
|
3242
|
+
name: exports.IconNames.SpeakerNotes,
|
|
3243
|
+
color: exports.IconColors.SectionResearchSecondary,
|
|
3244
|
+
size: exports.IconSizes.Large
|
|
2891
3245
|
});
|
|
2892
3246
|
|
|
2893
3247
|
case "warning":
|
|
2894
3248
|
return React__default.createElement(Icon, {
|
|
2895
3249
|
decorative: false,
|
|
2896
3250
|
className: "notification-icon",
|
|
2897
|
-
name: exports.IconNames.
|
|
2898
|
-
color: exports.IconColors.
|
|
2899
|
-
|
|
3251
|
+
name: exports.IconNames.ErrorFilled,
|
|
3252
|
+
color: exports.IconColors.BrandPrimary,
|
|
3253
|
+
size: exports.IconSizes.Large
|
|
2900
3254
|
});
|
|
2901
3255
|
|
|
2902
3256
|
default:
|
|
@@ -2946,34 +3300,12 @@ function Notification(props) {
|
|
|
2946
3300
|
className: "dismissible-button",
|
|
2947
3301
|
onClick: handleClose
|
|
2948
3302
|
}, React__default.createElement(Icon, {
|
|
2949
|
-
modifiers: ["medium"],
|
|
2950
3303
|
decorative: false,
|
|
2951
|
-
name: exports.IconNames.
|
|
2952
|
-
|
|
3304
|
+
name: exports.IconNames.Close,
|
|
3305
|
+
size: exports.IconSizes.Large
|
|
2953
3306
|
})) : null);
|
|
2954
3307
|
}
|
|
2955
3308
|
|
|
2956
|
-
// Utility functions to use throughout the codebase
|
|
2957
|
-
|
|
2958
|
-
/**
|
|
2959
|
-
* range
|
|
2960
|
-
* Get an array of values from `start` to `stop` - 1 with an optional
|
|
2961
|
-
* `step` between values.
|
|
2962
|
-
*/
|
|
2963
|
-
var range = function range(start, stop, step) {
|
|
2964
|
-
if (step === void 0) {
|
|
2965
|
-
step = 1;
|
|
2966
|
-
}
|
|
2967
|
-
|
|
2968
|
-
if (!start) {
|
|
2969
|
-
return [];
|
|
2970
|
-
}
|
|
2971
|
-
|
|
2972
|
-
return Array(Math.ceil((stop - start) / step)).fill(start).map(function (x, y) {
|
|
2973
|
-
return x + y * step;
|
|
2974
|
-
});
|
|
2975
|
-
};
|
|
2976
|
-
|
|
2977
3309
|
/** A component that provides a navigational list of page items. */
|
|
2978
3310
|
|
|
2979
3311
|
var Pagination = function Pagination(props) {
|
|
@@ -3170,92 +3502,6 @@ var Radio = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
3170
3502
|
}, footnote)));
|
|
3171
3503
|
});
|
|
3172
3504
|
|
|
3173
|
-
/**
|
|
3174
|
-
* This is based on:
|
|
3175
|
-
* root size of 16px or 1rem
|
|
3176
|
-
* 1 spacing unit is 4px or 0.25rem
|
|
3177
|
-
*
|
|
3178
|
-
* Chakra's mental model: If you need a spacing of 40px, divide it by 4.
|
|
3179
|
-
* That'll give you 10. Then use it in your component.
|
|
3180
|
-
*
|
|
3181
|
-
* The DS uses eight CSS variables/values found in "src/styles/03-space/_space.css":
|
|
3182
|
-
* --space-xxs = 4px or 0.25rem
|
|
3183
|
-
* --space-xs = 8px or 0.5rem
|
|
3184
|
-
* --space-s = 16px or 1rem
|
|
3185
|
-
* --space-m = 24px or 1.5rem
|
|
3186
|
-
* --space-l = 32px or 2rem
|
|
3187
|
-
* --space-xl = 48px or 3rem
|
|
3188
|
-
* --space-xxl = 64px or 4rem
|
|
3189
|
-
* --space-xxxl = 96px or 6rem
|
|
3190
|
-
*
|
|
3191
|
-
* @note Even though all the following values are available through Chakra,
|
|
3192
|
-
* we recommend to only use the spacing values that map to the DS values
|
|
3193
|
-
* declared above.
|
|
3194
|
-
*
|
|
3195
|
-
* Chakra Number Value | Chakra Name value | DS Variable
|
|
3196
|
-
* ------------------- | ----------------- | -----------------
|
|
3197
|
-
* 1 | xxs | --space-xxs
|
|
3198
|
-
* 2 | xs | --space-xs
|
|
3199
|
-
* 4 | s | --space-s
|
|
3200
|
-
* 6 | m | --space-m
|
|
3201
|
-
* 8 | l | --space-l
|
|
3202
|
-
* 12 | xl | --space-xl
|
|
3203
|
-
* 16 | xxl | --space-xxl
|
|
3204
|
-
* 24 | xxxl | --space-xxxl
|
|
3205
|
-
*/
|
|
3206
|
-
var spacing = {
|
|
3207
|
-
px: "1px",
|
|
3208
|
-
0: "0",
|
|
3209
|
-
0.5: "0.125rem",
|
|
3210
|
-
// --space-xxs = 4px
|
|
3211
|
-
xxs: "0.25rem",
|
|
3212
|
-
1: "0.25rem",
|
|
3213
|
-
1.5: "0.375rem",
|
|
3214
|
-
// --space-xs = 8px
|
|
3215
|
-
xs: "0.5rem",
|
|
3216
|
-
2: "0.5rem",
|
|
3217
|
-
2.5: "0.625rem",
|
|
3218
|
-
3: "0.75rem",
|
|
3219
|
-
3.5: "0.875rem",
|
|
3220
|
-
// --space-s = 16px
|
|
3221
|
-
s: "1rem",
|
|
3222
|
-
4: "1rem",
|
|
3223
|
-
5: "1.25rem",
|
|
3224
|
-
// --space-m = 24px
|
|
3225
|
-
m: "1.5rem",
|
|
3226
|
-
6: "1.5rem",
|
|
3227
|
-
7: "1.75rem",
|
|
3228
|
-
// --space-l = 32px
|
|
3229
|
-
l: "2rem",
|
|
3230
|
-
8: "2rem",
|
|
3231
|
-
9: "2.25rem",
|
|
3232
|
-
10: "2.5rem",
|
|
3233
|
-
// --space-xl = 48px
|
|
3234
|
-
xl: "3rem",
|
|
3235
|
-
12: "3rem",
|
|
3236
|
-
14: "3.5rem",
|
|
3237
|
-
// --space-xxl = 64px
|
|
3238
|
-
xxl: "4rem",
|
|
3239
|
-
16: "4rem",
|
|
3240
|
-
20: "5rem",
|
|
3241
|
-
// --space-xxxl = 96px
|
|
3242
|
-
xxxl: "6rem",
|
|
3243
|
-
24: "6rem",
|
|
3244
|
-
28: "7rem",
|
|
3245
|
-
32: "8rem",
|
|
3246
|
-
36: "9rem",
|
|
3247
|
-
40: "10rem",
|
|
3248
|
-
44: "11rem",
|
|
3249
|
-
48: "12rem",
|
|
3250
|
-
52: "13rem",
|
|
3251
|
-
56: "14rem",
|
|
3252
|
-
60: "15rem",
|
|
3253
|
-
64: "16rem",
|
|
3254
|
-
72: "18rem",
|
|
3255
|
-
80: "20rem",
|
|
3256
|
-
96: "24rem"
|
|
3257
|
-
};
|
|
3258
|
-
|
|
3259
3505
|
(function (RadioGroupLayoutTypes) {
|
|
3260
3506
|
RadioGroupLayoutTypes["Column"] = "column";
|
|
3261
3507
|
RadioGroupLayoutTypes["Row"] = "row";
|
|
@@ -3315,22 +3561,14 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
3315
3561
|
var chakraRadioProps = getRadioProps({
|
|
3316
3562
|
value: child.props.value
|
|
3317
3563
|
});
|
|
3318
|
-
var newProps = {
|
|
3319
|
-
key: i
|
|
3320
|
-
};
|
|
3321
3564
|
|
|
3322
3565
|
if (child !== undefined && child !== null) {
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
}
|
|
3330
|
-
|
|
3331
|
-
if (isRequired) {
|
|
3332
|
-
newProps["isRequired"] = true;
|
|
3333
|
-
}
|
|
3566
|
+
var newProps = {
|
|
3567
|
+
key: i,
|
|
3568
|
+
isDisabled: isDisabled,
|
|
3569
|
+
isInvalid: isInvalid,
|
|
3570
|
+
isRequired: isRequired
|
|
3571
|
+
};
|
|
3334
3572
|
|
|
3335
3573
|
if (child.props.value === defaultValue) {
|
|
3336
3574
|
newProps["checked"] = true;
|
|
@@ -3363,57 +3601,219 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
3363
3601
|
}, footnote)));
|
|
3364
3602
|
});
|
|
3365
3603
|
|
|
3366
|
-
|
|
3367
|
-
* `Input`, and `Button` components together. */
|
|
3368
|
-
|
|
3369
|
-
function SearchBar(props) {
|
|
3370
|
-
var ariaLabel = props.ariaLabel,
|
|
3371
|
-
ariaLabelledBy = props.ariaLabelledBy,
|
|
3372
|
-
blockName = props.blockName,
|
|
3373
|
-
children = props.children,
|
|
3374
|
-
className = props.className,
|
|
3375
|
-
id = props.id,
|
|
3376
|
-
_props$modifiers = props.modifiers,
|
|
3377
|
-
modifiers = _props$modifiers === void 0 ? [] : _props$modifiers,
|
|
3378
|
-
onSubmit = props.onSubmit,
|
|
3379
|
-
attributes = props.attributes,
|
|
3380
|
-
method = props.method,
|
|
3381
|
-
action = props.action;
|
|
3382
|
-
var baseClass = "search-bar";
|
|
3383
|
-
return React.createElement("form", Object.assign({
|
|
3384
|
-
className: bem(baseClass, modifiers, blockName, [className]),
|
|
3385
|
-
id: id,
|
|
3386
|
-
role: "search",
|
|
3387
|
-
"aria-label": ariaLabel,
|
|
3388
|
-
"aria-labelledby": ariaLabelledBy,
|
|
3389
|
-
onSubmit: onSubmit,
|
|
3390
|
-
method: method,
|
|
3391
|
-
action: action
|
|
3392
|
-
}, attributes), children);
|
|
3393
|
-
}
|
|
3604
|
+
var SelectTypes;
|
|
3394
3605
|
|
|
3395
|
-
(function (
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
})(
|
|
3606
|
+
(function (SelectTypes) {
|
|
3607
|
+
SelectTypes["Default"] = "default";
|
|
3608
|
+
SelectTypes["SearchBar"] = "searchbar";
|
|
3609
|
+
})(SelectTypes || (SelectTypes = {}));
|
|
3399
3610
|
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
})(exports.SkeletonLoaderImageRatios || (exports.SkeletonLoaderImageRatios = {}));
|
|
3611
|
+
/**
|
|
3612
|
+
* Component that renders Chakra's `Select` component along with an accessible
|
|
3613
|
+
* `Label` and optional `HelperErrorText` component.
|
|
3614
|
+
*/
|
|
3405
3615
|
|
|
3406
|
-
function
|
|
3407
|
-
var
|
|
3616
|
+
var Select = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
3617
|
+
var children = props.children,
|
|
3408
3618
|
className = props.className,
|
|
3409
|
-
|
|
3410
|
-
|
|
3619
|
+
helperText = props.helperText,
|
|
3620
|
+
_props$id = props.id,
|
|
3621
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
3622
|
+
invalidText = props.invalidText,
|
|
3623
|
+
_props$isDisabled = props.isDisabled,
|
|
3624
|
+
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
3625
|
+
_props$isInvalid = props.isInvalid,
|
|
3626
|
+
isInvalid = _props$isInvalid === void 0 ? false : _props$isInvalid,
|
|
3627
|
+
_props$isRequired = props.isRequired,
|
|
3628
|
+
isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
|
|
3629
|
+
labelText = props.labelText,
|
|
3630
|
+
name = props.name,
|
|
3631
|
+
onChange = props.onChange,
|
|
3632
|
+
_props$showLabel = props.showLabel,
|
|
3633
|
+
showLabel = _props$showLabel === void 0 ? true : _props$showLabel,
|
|
3634
|
+
_props$showOptReqLabe = props.showOptReqLabel,
|
|
3635
|
+
showOptReqLabel = _props$showOptReqLabe === void 0 ? true : _props$showOptReqLabe,
|
|
3636
|
+
_props$type = props.type,
|
|
3637
|
+
type = _props$type === void 0 ? SelectTypes.Default : _props$type,
|
|
3638
|
+
value = props.value;
|
|
3639
|
+
var ariaAttributes = {};
|
|
3640
|
+
var optReqFlag = isRequired ? "Required" : "Optional";
|
|
3641
|
+
var styles = react.useMultiStyleConfig("CustomSelect", {
|
|
3642
|
+
variant: type
|
|
3643
|
+
});
|
|
3644
|
+
var finalInvalidText = invalidText ? invalidText : "There is an error related to this field.";
|
|
3645
|
+
var footnote = isInvalid ? finalInvalidText : helperText; // To control the `Select` component, both `onChange` and `value`
|
|
3646
|
+
// must be passed.
|
|
3647
|
+
|
|
3648
|
+
var controlledProps = onChange && value ? {
|
|
3649
|
+
onChange: onChange,
|
|
3650
|
+
value: value
|
|
3651
|
+
} : {};
|
|
3652
|
+
|
|
3653
|
+
if (!showLabel) {
|
|
3654
|
+
ariaAttributes["aria-label"] = labelText && footnote ? labelText + " - " + footnote : labelText;
|
|
3655
|
+
} else if (helperText) {
|
|
3656
|
+
ariaAttributes["aria-describedby"] = id + "-helperText";
|
|
3657
|
+
}
|
|
3658
|
+
|
|
3659
|
+
if (React__default.Children.count(children) > 10) {
|
|
3660
|
+
console.warn("NYPL DS recommends that <select> fields have no more than 10 options; an auto-complete text input is a good alternative for 11 or more options.");
|
|
3661
|
+
}
|
|
3662
|
+
|
|
3663
|
+
if (React__default.Children.count(children) < 4) {
|
|
3664
|
+
console.warn("NYPL DS recommends that <select> fields have at least 4 options; a radio button group is a good alternative for 3 or fewer options.");
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3667
|
+
return React__default.createElement(react.Box, {
|
|
3668
|
+
className: className,
|
|
3669
|
+
__css: styles
|
|
3670
|
+
}, showLabel && React__default.createElement(Label, {
|
|
3671
|
+
id: id + "-label",
|
|
3672
|
+
htmlFor: id,
|
|
3673
|
+
optReqFlag: showOptReqLabel && optReqFlag
|
|
3674
|
+
}, labelText), React__default.createElement(react.Select, Object.assign({
|
|
3675
|
+
id: id,
|
|
3676
|
+
variant: "outline",
|
|
3677
|
+
isRequired: isRequired,
|
|
3678
|
+
isDisabled: isDisabled,
|
|
3679
|
+
isInvalid: isInvalid,
|
|
3680
|
+
name: name,
|
|
3681
|
+
ref: ref
|
|
3682
|
+
}, controlledProps, ariaAttributes, {
|
|
3683
|
+
icon: React__default.createElement(Icon, {
|
|
3684
|
+
name: exports.IconNames.Arrow,
|
|
3685
|
+
size: exports.IconSizes.Medium
|
|
3686
|
+
}),
|
|
3687
|
+
__css: styles.select
|
|
3688
|
+
}), children), footnote && React__default.createElement(react.Box, {
|
|
3689
|
+
__css: styles.helper,
|
|
3690
|
+
"aria-disabled": isDisabled
|
|
3691
|
+
}, React__default.createElement(HelperErrorText, {
|
|
3692
|
+
isError: isInvalid,
|
|
3693
|
+
id: id + "-helperText"
|
|
3694
|
+
}, footnote)));
|
|
3695
|
+
});
|
|
3696
|
+
|
|
3697
|
+
/**
|
|
3698
|
+
* Renders a wrapper `form` element to be used with `Select` (optional),
|
|
3699
|
+
* `Input`, and `Button` components together.
|
|
3700
|
+
*/
|
|
3701
|
+
|
|
3702
|
+
function SearchBar(props) {
|
|
3703
|
+
var action = props.action,
|
|
3704
|
+
_props$buttonOnClick = props.buttonOnClick,
|
|
3705
|
+
buttonOnClick = _props$buttonOnClick === void 0 ? null : _props$buttonOnClick,
|
|
3706
|
+
className = props.className,
|
|
3707
|
+
helperErrorText = props.helperErrorText,
|
|
3708
|
+
_props$id = props.id,
|
|
3709
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
3710
|
+
invalidText = props.invalidText,
|
|
3711
|
+
_props$isDisabled = props.isDisabled,
|
|
3712
|
+
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
3713
|
+
_props$isInvalid = props.isInvalid,
|
|
3714
|
+
isInvalid = _props$isInvalid === void 0 ? false : _props$isInvalid,
|
|
3715
|
+
_props$isRequired = props.isRequired,
|
|
3716
|
+
isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
|
|
3717
|
+
labelText = props.labelText,
|
|
3718
|
+
method = props.method,
|
|
3719
|
+
onSubmit = props.onSubmit,
|
|
3720
|
+
selectProps = props.selectProps,
|
|
3721
|
+
textInputElement = props.textInputElement,
|
|
3722
|
+
textInputProps = props.textInputProps;
|
|
3723
|
+
var styles = react.useMultiStyleConfig("SearchBar", {
|
|
3724
|
+
hasSelect: selectProps
|
|
3725
|
+
});
|
|
3726
|
+
var stateProps = {
|
|
3727
|
+
isDisabled: isDisabled,
|
|
3728
|
+
isInvalid: isInvalid,
|
|
3729
|
+
isRequired: isRequired
|
|
3730
|
+
};
|
|
3731
|
+
var helperErrorTextID = generateUUID();
|
|
3732
|
+
var ariaDescribedby = helperErrorTextID;
|
|
3733
|
+
var footnote = isInvalid ? invalidText : helperErrorText;
|
|
3734
|
+
var finalAriaLabel = footnote ? labelText + " - " + footnote : labelText; // Render the `Select` component.
|
|
3735
|
+
|
|
3736
|
+
var selectElem = selectProps && React.createElement(Select, Object.assign({
|
|
3737
|
+
id: generateUUID(),
|
|
3738
|
+
name: selectProps == null ? void 0 : selectProps.name,
|
|
3739
|
+
labelText: selectProps == null ? void 0 : selectProps.labelText,
|
|
3740
|
+
showLabel: false,
|
|
3741
|
+
helperText: "",
|
|
3742
|
+
type: SelectTypes.SearchBar
|
|
3743
|
+
}, stateProps), selectProps == null ? void 0 : selectProps.optionsData.map(function (option) {
|
|
3744
|
+
return React.createElement("option", {
|
|
3745
|
+
key: option,
|
|
3746
|
+
value: option
|
|
3747
|
+
}, option);
|
|
3748
|
+
})); // Render the `TextInput` component.
|
|
3749
|
+
|
|
3750
|
+
var textInputNative = textInputProps && React.createElement(TextInput, Object.assign({
|
|
3751
|
+
id: generateUUID(),
|
|
3752
|
+
labelText: textInputProps == null ? void 0 : textInputProps.labelText,
|
|
3753
|
+
placeholder: textInputProps == null ? void 0 : textInputProps.placeholder,
|
|
3754
|
+
type: exports.TextInputTypes.text,
|
|
3755
|
+
variantType: selectElem ? TextInputVariants.SearchBarSelect : TextInputVariants.SearchBar,
|
|
3756
|
+
helperText: "",
|
|
3757
|
+
showLabel: false
|
|
3758
|
+
}, stateProps)); // Render the `Button` component.
|
|
3759
|
+
|
|
3760
|
+
var buttonElem = React.createElement(Button, {
|
|
3761
|
+
id: generateUUID(),
|
|
3762
|
+
buttonType: exports.ButtonTypes.SearchBar,
|
|
3763
|
+
type: "submit",
|
|
3764
|
+
onClick: buttonOnClick,
|
|
3765
|
+
disabled: isDisabled
|
|
3766
|
+
}, React.createElement(Icon, {
|
|
3767
|
+
name: exports.IconNames.Search,
|
|
3768
|
+
size: exports.IconSizes.Small,
|
|
3769
|
+
align: IconAlign.Left
|
|
3770
|
+
}), "Search"); // Render the `HelperErrorText` component.
|
|
3771
|
+
|
|
3772
|
+
var helperErrorTextElem = footnote && React.createElement(HelperErrorText, {
|
|
3773
|
+
id: helperErrorTextID,
|
|
3774
|
+
isError: isInvalid
|
|
3775
|
+
}, footnote); // If a custom input element was passed, use that instead of the
|
|
3776
|
+
// `TextInput` component.
|
|
3777
|
+
|
|
3778
|
+
var textInputElem = textInputElement || textInputNative;
|
|
3779
|
+
return React.createElement(react.Box, {
|
|
3780
|
+
as: "form",
|
|
3781
|
+
id: id,
|
|
3782
|
+
className: className,
|
|
3783
|
+
role: "search",
|
|
3784
|
+
"aria-label": finalAriaLabel,
|
|
3785
|
+
"aria-describedby": ariaDescribedby,
|
|
3786
|
+
onSubmit: onSubmit,
|
|
3787
|
+
method: method,
|
|
3788
|
+
action: action,
|
|
3789
|
+
__css: styles
|
|
3790
|
+
}, React.createElement(react.Box, {
|
|
3791
|
+
__css: styles.topRow
|
|
3792
|
+
}, selectElem, textInputElem, buttonElem), helperErrorTextElem);
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3795
|
+
(function (SkeletonLoaderLayouts) {
|
|
3796
|
+
SkeletonLoaderLayouts["Row"] = "row";
|
|
3797
|
+
SkeletonLoaderLayouts["Column"] = "column";
|
|
3798
|
+
})(exports.SkeletonLoaderLayouts || (exports.SkeletonLoaderLayouts = {}));
|
|
3799
|
+
|
|
3800
|
+
(function (SkeletonLoaderImageRatios) {
|
|
3801
|
+
SkeletonLoaderImageRatios["Landscape"] = "landscape";
|
|
3802
|
+
SkeletonLoaderImageRatios["Portrait"] = "portrait";
|
|
3803
|
+
SkeletonLoaderImageRatios["Square"] = "square";
|
|
3804
|
+
})(exports.SkeletonLoaderImageRatios || (exports.SkeletonLoaderImageRatios = {}));
|
|
3805
|
+
|
|
3806
|
+
function SkeletonLoader(props) {
|
|
3807
|
+
var border = props.border,
|
|
3808
|
+
className = props.className,
|
|
3809
|
+
_props$contentSize = props.contentSize,
|
|
3810
|
+
contentSize = _props$contentSize === void 0 ? 3 : _props$contentSize,
|
|
3411
3811
|
_props$headingSize = props.headingSize,
|
|
3412
3812
|
headingSize = _props$headingSize === void 0 ? 1 : _props$headingSize,
|
|
3413
3813
|
_props$imageAspectRat = props.imageAspectRatio,
|
|
3414
3814
|
imageAspectRatio = _props$imageAspectRat === void 0 ? exports.SkeletonLoaderImageRatios.Square : _props$imageAspectRat,
|
|
3415
3815
|
_props$layout = props.layout,
|
|
3416
|
-
layout = _props$layout === void 0 ? exports.SkeletonLoaderLayouts.
|
|
3816
|
+
layout = _props$layout === void 0 ? exports.SkeletonLoaderLayouts.Column : _props$layout,
|
|
3417
3817
|
_props$showButton = props.showButton,
|
|
3418
3818
|
showButton = _props$showButton === void 0 ? false : _props$showButton,
|
|
3419
3819
|
_props$showContent = props.showContent,
|
|
@@ -3434,6 +3834,7 @@ function SkeletonLoader(props) {
|
|
|
3434
3834
|
|
|
3435
3835
|
for (var i = 0; i < headingSize; i++) {
|
|
3436
3836
|
headingItems.push(React.createElement("div", {
|
|
3837
|
+
key: "heading-" + i,
|
|
3437
3838
|
className: bem("skeleton-loader-heading", imageModifiers, "", ["skeleton-element"])
|
|
3438
3839
|
}));
|
|
3439
3840
|
}
|
|
@@ -3442,6 +3843,7 @@ function SkeletonLoader(props) {
|
|
|
3442
3843
|
|
|
3443
3844
|
for (var _i = 0; _i < contentSize; _i++) {
|
|
3444
3845
|
contentItems.push(React.createElement("div", {
|
|
3846
|
+
key: "content-" + _i,
|
|
3445
3847
|
className: bem("skeleton-loader-content", imageModifiers, "", ["skeleton-element"])
|
|
3446
3848
|
}));
|
|
3447
3849
|
}
|
|
@@ -3470,124 +3872,34 @@ function SkeletonLoader(props) {
|
|
|
3470
3872
|
}))));
|
|
3471
3873
|
}
|
|
3472
3874
|
|
|
3473
|
-
var
|
|
3474
|
-
var _props$ariaLabel = props.ariaLabel,
|
|
3475
|
-
ariaLabel = _props$ariaLabel === void 0 ? null : _props$ariaLabel,
|
|
3476
|
-
blockName = props.blockName,
|
|
3477
|
-
children = props.children,
|
|
3478
|
-
className = props.className,
|
|
3479
|
-
errored = props.errored,
|
|
3480
|
-
invalidText = props.invalidText,
|
|
3481
|
-
helperText = props.helperText,
|
|
3482
|
-
helperTextId = props.helperTextId,
|
|
3483
|
-
isRequired = props.isRequired,
|
|
3484
|
-
labelId = props.labelId,
|
|
3485
|
-
labelText = props.labelText,
|
|
3486
|
-
onBlur = props.onBlur,
|
|
3487
|
-
onChange = props.onChange,
|
|
3488
|
-
name = props.name,
|
|
3489
|
-
required = props.required,
|
|
3490
|
-
_props$attributes = props.attributes,
|
|
3491
|
-
attributes = _props$attributes === void 0 ? {} : _props$attributes,
|
|
3492
|
-
_props$disabled = props.disabled,
|
|
3493
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
3494
|
-
selectedOption = props.selectedOption,
|
|
3495
|
-
showLabel = props.showLabel,
|
|
3496
|
-
_props$showOptReqLabe = props.showOptReqLabel,
|
|
3497
|
-
showOptReqLabel = _props$showOptReqLabe === void 0 ? true : _props$showOptReqLabe;
|
|
3498
|
-
var modifiers = props.modifiers ? props.modifiers : [];
|
|
3499
|
-
var id = props.id || generateUUID();
|
|
3500
|
-
var ariaLabelledBy = null;
|
|
3501
|
-
if (!showLabel) attributes["aria-label"] = labelText;
|
|
3502
|
-
if (helperText && showLabel) attributes["aria-describedby"] = id + "-helperText";
|
|
3503
|
-
if (errored) modifiers.push("error");
|
|
3504
|
-
var req = isRequired || required;
|
|
3505
|
-
var optReqFlag = req ? "Required" : "Optional";
|
|
3506
|
-
var errorOutput = invalidText ? invalidText : "There is an error related to this field.";
|
|
3507
|
-
var footnote = errored ? errorOutput : helperText; // Support for deprecated prop
|
|
3508
|
-
|
|
3509
|
-
if (ariaLabel) attributes["aria-label"] = ariaLabel; // Support for deprecated props
|
|
3510
|
-
|
|
3511
|
-
if (labelId && !helperTextId) {
|
|
3512
|
-
ariaLabelledBy = labelId;
|
|
3513
|
-
} else if (helperTextId && !labelId) {
|
|
3514
|
-
ariaLabelledBy = helperTextId;
|
|
3515
|
-
} else if (labelId && helperTextId) {
|
|
3516
|
-
ariaLabelledBy = labelId + " " + helperTextId;
|
|
3517
|
-
}
|
|
3518
|
-
|
|
3519
|
-
if (React__default.Children.count(children) > 10) {
|
|
3520
|
-
console.warn("NYPL DS recommends that <select> fields have no more than 10 options; an auto-complete text input is a good alternative for 11 or more options.");
|
|
3521
|
-
}
|
|
3522
|
-
|
|
3523
|
-
if (React__default.Children.count(children) < 4) {
|
|
3524
|
-
console.warn("NYPL DS recommends that <select> fields have at least 4 options; a radio button group is a good alternative for 3 or fewer options.");
|
|
3525
|
-
}
|
|
3526
|
-
|
|
3527
|
-
if (ariaLabel) {
|
|
3528
|
-
console.warn("The ariaLabel prop has been deprecated in the Select component and will be removed in a future release. Check the documentation for updated props.");
|
|
3529
|
-
}
|
|
3530
|
-
|
|
3531
|
-
if (helperTextId) {
|
|
3532
|
-
console.warn("The helperTextId prop has been deprecated in the Select component and will be removed in a future release. Check the documentation for updated props.");
|
|
3533
|
-
}
|
|
3534
|
-
|
|
3535
|
-
if (isRequired === true || isRequired === false) {
|
|
3536
|
-
console.warn("The isRequired prop has been deprecated in the Select component and will be removed in a future release. Check the documentation for updated props.");
|
|
3537
|
-
}
|
|
3538
|
-
|
|
3539
|
-
if (labelId) {
|
|
3540
|
-
console.warn("The labelId prop has been deprecated in the Select component and will be removed in a future release. Check the documentation for updated props.");
|
|
3541
|
-
}
|
|
3875
|
+
var StatusBadgeTypes;
|
|
3542
3876
|
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
id: id + "-label"
|
|
3549
|
-
}, labelText), React__default.createElement("select", Object.assign({
|
|
3550
|
-
name: name,
|
|
3551
|
-
id: id,
|
|
3552
|
-
className: bem("selectfield", modifiers, blockName, [className]),
|
|
3553
|
-
"aria-required": req,
|
|
3554
|
-
required: req,
|
|
3555
|
-
disabled: disabled,
|
|
3556
|
-
"aria-label": ariaLabel,
|
|
3557
|
-
"aria-labelledby": ariaLabelledBy,
|
|
3558
|
-
value: selectedOption,
|
|
3559
|
-
ref: ref,
|
|
3560
|
-
onBlur: onBlur,
|
|
3561
|
-
onChange: onChange
|
|
3562
|
-
}, attributes), React__default.Children.map(children, function (child, key) {
|
|
3563
|
-
return React__default.cloneElement(child, {
|
|
3564
|
-
"aria-selected": children[key] ? children[key].props.children === selectedOption : false
|
|
3565
|
-
});
|
|
3566
|
-
})), (helperText || errored) && React__default.createElement(HelperErrorText, {
|
|
3567
|
-
isError: errored,
|
|
3568
|
-
id: id + "-helperText"
|
|
3569
|
-
}, footnote));
|
|
3570
|
-
});
|
|
3571
|
-
Select.displayName = "Select";
|
|
3877
|
+
(function (StatusBadgeTypes) {
|
|
3878
|
+
StatusBadgeTypes["Low"] = "low";
|
|
3879
|
+
StatusBadgeTypes["Medium"] = "medium";
|
|
3880
|
+
StatusBadgeTypes["High"] = "high";
|
|
3881
|
+
})(StatusBadgeTypes || (StatusBadgeTypes = {}));
|
|
3572
3882
|
|
|
3573
3883
|
function StatusBadge(props) {
|
|
3574
|
-
var
|
|
3884
|
+
var children = props.children,
|
|
3575
3885
|
className = props.className,
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
}
|
|
3886
|
+
_props$id = props.id,
|
|
3887
|
+
id = _props$id === void 0 ? generateUUID() : _props$id,
|
|
3888
|
+
_props$level = props.level,
|
|
3889
|
+
level = _props$level === void 0 ? StatusBadgeTypes.Low : _props$level;
|
|
3890
|
+
var styles = react.useStyleConfig("StatusBadge", {
|
|
3891
|
+
variant: level
|
|
3892
|
+
});
|
|
3583
3893
|
|
|
3584
|
-
if (
|
|
3585
|
-
|
|
3894
|
+
if (!children) {
|
|
3895
|
+
console.warn("Status Badge has no children.");
|
|
3586
3896
|
}
|
|
3587
3897
|
|
|
3588
|
-
return React.createElement(
|
|
3589
|
-
|
|
3590
|
-
|
|
3898
|
+
return React.createElement(react.Box, {
|
|
3899
|
+
id: id,
|
|
3900
|
+
className: className,
|
|
3901
|
+
__css: styles
|
|
3902
|
+
}, children);
|
|
3591
3903
|
}
|
|
3592
3904
|
|
|
3593
3905
|
/**
|
|
@@ -3604,7 +3916,7 @@ var onClickHash = function onClickHash(tabHash) {
|
|
|
3604
3916
|
*/
|
|
3605
3917
|
|
|
3606
3918
|
|
|
3607
|
-
var getElementsFromContentData = function getElementsFromContentData(data, useHash) {
|
|
3919
|
+
var getElementsFromContentData$1 = function getElementsFromContentData(data, useHash) {
|
|
3608
3920
|
var tabs = [];
|
|
3609
3921
|
var panels = [];
|
|
3610
3922
|
|
|
@@ -3699,7 +4011,7 @@ function Tabs(props) {
|
|
|
3699
4011
|
useHash = _props$useHash === void 0 ? false : _props$useHash;
|
|
3700
4012
|
var styles = react.useMultiStyleConfig("Tabs", {});
|
|
3701
4013
|
|
|
3702
|
-
var _ref = contentData ? getElementsFromContentData(contentData, useHash) : getElementsFromChildren(children),
|
|
4014
|
+
var _ref = contentData ? getElementsFromContentData$1(contentData, useHash) : getElementsFromChildren(children),
|
|
3703
4015
|
tabs = _ref.tabs,
|
|
3704
4016
|
panels = _ref.panels;
|
|
3705
4017
|
|
|
@@ -3727,20 +4039,18 @@ function Tabs(props) {
|
|
|
3727
4039
|
"aria-label": "Previous"
|
|
3728
4040
|
}, styles.buttonArrows)
|
|
3729
4041
|
}, React.createElement(Icon, {
|
|
3730
|
-
name: exports.IconNames.
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
modifiers: ["small"]
|
|
4042
|
+
name: exports.IconNames.Arrow,
|
|
4043
|
+
iconRotation: exports.IconRotationTypes.Rotate90,
|
|
4044
|
+
size: exports.IconSizes.Small
|
|
3734
4045
|
})), React.createElement(react.TabList, null, tabs), React.createElement(Button, {
|
|
3735
4046
|
buttonType: exports.ButtonTypes.Primary,
|
|
3736
4047
|
attributes: _extends({
|
|
3737
4048
|
"aria-label": "Next"
|
|
3738
4049
|
}, styles.buttonArrows)
|
|
3739
4050
|
}, React.createElement(Icon, {
|
|
3740
|
-
name: exports.IconNames.
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
modifiers: ["small"]
|
|
4051
|
+
name: exports.IconNames.Arrow,
|
|
4052
|
+
iconRotation: exports.IconRotationTypes.Rotate270,
|
|
4053
|
+
size: exports.IconSizes.Small
|
|
3744
4054
|
}))), React.createElement(react.TabPanels, null, panels)) : React.createElement(React.Fragment, null, React.createElement(react.Box, {
|
|
3745
4055
|
__css: styles.tablistWrapper,
|
|
3746
4056
|
sx: {
|
|
@@ -3751,6 +4061,208 @@ function Tabs(props) {
|
|
|
3751
4061
|
}, tabs), panels));
|
|
3752
4062
|
}
|
|
3753
4063
|
|
|
4064
|
+
(function (TextDisplaySizes) {
|
|
4065
|
+
TextDisplaySizes["Default"] = "default";
|
|
4066
|
+
TextDisplaySizes["Caption"] = "caption";
|
|
4067
|
+
TextDisplaySizes["Tag"] = "tag";
|
|
4068
|
+
TextDisplaySizes["Mini"] = "mini";
|
|
4069
|
+
})(exports.TextDisplaySizes || (exports.TextDisplaySizes = {}));
|
|
4070
|
+
|
|
4071
|
+
function Text(props) {
|
|
4072
|
+
var children = props.children,
|
|
4073
|
+
_props$className = props.className,
|
|
4074
|
+
className = _props$className === void 0 ? "" : _props$className,
|
|
4075
|
+
_props$displaySize = props.displaySize,
|
|
4076
|
+
displaySize = _props$displaySize === void 0 ? exports.TextDisplaySizes.Default : _props$displaySize,
|
|
4077
|
+
isBold = props.isBold,
|
|
4078
|
+
isItalic = props.isItalic,
|
|
4079
|
+
noSpace = props.noSpace;
|
|
4080
|
+
var variant = getVariant(displaySize, exports.TextDisplaySizes, exports.TextDisplaySizes.Default);
|
|
4081
|
+
var styles = react.useStyleConfig("Text", {
|
|
4082
|
+
variant: variant,
|
|
4083
|
+
isBold: isBold,
|
|
4084
|
+
isItalic: isItalic,
|
|
4085
|
+
noSpace: noSpace
|
|
4086
|
+
});
|
|
4087
|
+
|
|
4088
|
+
if (!children) {
|
|
4089
|
+
console.warn("The Text component has no children and will not render correctly.");
|
|
4090
|
+
}
|
|
4091
|
+
|
|
4092
|
+
return React.createElement(react.Text, {
|
|
4093
|
+
className: className,
|
|
4094
|
+
sx: styles
|
|
4095
|
+
}, children);
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
/**
|
|
4099
|
+
* The main top-level parent component that wraps all template-related
|
|
4100
|
+
* components. For backwards compatibility, this renders a `nypl-ds` CSS class.
|
|
4101
|
+
*/
|
|
4102
|
+
|
|
4103
|
+
var Template = function Template(props) {
|
|
4104
|
+
var styles = react.useStyleConfig("Template", {});
|
|
4105
|
+
return React.createElement(react.Box, {
|
|
4106
|
+
__css: styles,
|
|
4107
|
+
className: "nypl-ds"
|
|
4108
|
+
}, props.children);
|
|
4109
|
+
};
|
|
4110
|
+
/**
|
|
4111
|
+
* This optional component should be the first child of the `Template`
|
|
4112
|
+
* component. This is rendered as an HTML `<header>` element.
|
|
4113
|
+
*/
|
|
4114
|
+
|
|
4115
|
+
|
|
4116
|
+
var TemplateHeader = function TemplateHeader(props) {
|
|
4117
|
+
var styles = react.useStyleConfig("TemplateHeader", {});
|
|
4118
|
+
return React.createElement(react.Box, {
|
|
4119
|
+
as: "header",
|
|
4120
|
+
__css: styles
|
|
4121
|
+
}, props.children);
|
|
4122
|
+
};
|
|
4123
|
+
/**
|
|
4124
|
+
* This optional component should be used inside the `TemplateHeader` component.
|
|
4125
|
+
* This is meant to render its children from edge to edge and is most useful
|
|
4126
|
+
* for the `Breadcrumbs` and `Hero` components, and other banner-like components.
|
|
4127
|
+
*/
|
|
4128
|
+
|
|
4129
|
+
|
|
4130
|
+
var TemplateBreakout = function TemplateBreakout(props) {
|
|
4131
|
+
var styles = react.useStyleConfig("TemplateBreakout", {});
|
|
4132
|
+
return React.createElement(react.Box, {
|
|
4133
|
+
__css: styles
|
|
4134
|
+
}, props.children);
|
|
4135
|
+
};
|
|
4136
|
+
/**
|
|
4137
|
+
* This component is most useful to render content on the page. This renders an
|
|
4138
|
+
* HTML `<main>` element and takes a `sidebar` prop with optional "left" or
|
|
4139
|
+
* "right" values. This will set the correct styling needed for the
|
|
4140
|
+
* `TemplateContentPrimary` and `TemplateContentSidebar` components. Note that
|
|
4141
|
+
* `TemplateContentPrimary` and `TemplateContentSidebar` must be ordered
|
|
4142
|
+
* correctly as children elements for the appropriate styles to take effect.
|
|
4143
|
+
*/
|
|
4144
|
+
|
|
4145
|
+
|
|
4146
|
+
var TemplateContent = function TemplateContent(props) {
|
|
4147
|
+
var _props$sidebar = props.sidebar,
|
|
4148
|
+
sidebar = _props$sidebar === void 0 ? "none" : _props$sidebar,
|
|
4149
|
+
children = props.children;
|
|
4150
|
+
var styles = react.useStyleConfig("TemplateContent", {
|
|
4151
|
+
variant: sidebar !== "none" ? "sidebar" : null
|
|
4152
|
+
}); // Manually pass in the `sidebar` prop to the `TemplateContentPrimary` and
|
|
4153
|
+
// `TemplateContentSidebar` components.
|
|
4154
|
+
|
|
4155
|
+
var newChildren = React.Children.map(children, function (child) {
|
|
4156
|
+
var _child$props, _child$props2;
|
|
4157
|
+
|
|
4158
|
+
var newChild = child;
|
|
4159
|
+
|
|
4160
|
+
if (child && (child == null ? void 0 : child.type) === TemplateContentPrimary || child != null && child.props && ((_child$props = child.props) == null ? void 0 : _child$props.mdxType) === "TemplateContentPrimary" || (child == null ? void 0 : child.type) === TemplateContentSidebar || child != null && child.props && ((_child$props2 = child.props) == null ? void 0 : _child$props2.mdxType) === "TemplateContentSidebar") {
|
|
4161
|
+
newChild = React.cloneElement(child, {
|
|
4162
|
+
sidebar: sidebar
|
|
4163
|
+
});
|
|
4164
|
+
}
|
|
4165
|
+
|
|
4166
|
+
return newChild;
|
|
4167
|
+
});
|
|
4168
|
+
return React.createElement(react.Box, {
|
|
4169
|
+
as: "main",
|
|
4170
|
+
__css: styles
|
|
4171
|
+
}, newChildren);
|
|
4172
|
+
};
|
|
4173
|
+
/**
|
|
4174
|
+
* This optional component must be used inside the `TemplateContent` component.
|
|
4175
|
+
* This renders content in the main width of the container and will always render
|
|
4176
|
+
* above the primary component and the sidebar component (if any).
|
|
4177
|
+
*/
|
|
4178
|
+
|
|
4179
|
+
|
|
4180
|
+
var TemplateContentTop = function TemplateContentTop(props) {
|
|
4181
|
+
var styles = react.useStyleConfig("TemplateContentTop", {});
|
|
4182
|
+
return React.createElement(react.Box, {
|
|
4183
|
+
__css: styles
|
|
4184
|
+
}, props.children);
|
|
4185
|
+
};
|
|
4186
|
+
/**
|
|
4187
|
+
* This component is used to render content in a column when there must be a
|
|
4188
|
+
* sidebar component on either its left or right side. It must go inside the
|
|
4189
|
+
* `TemplateContent` component. An optional `sidebar` prop value of "left" or
|
|
4190
|
+
* "right" can be passed to render the correct CSS styles. If the `sidebar`
|
|
4191
|
+
* prop is used in the `TemplateContent` component, there is no need to pass
|
|
4192
|
+
* the `sidebar` prop to this component -- `TemplateContent` will handle it.
|
|
4193
|
+
*/
|
|
4194
|
+
|
|
4195
|
+
|
|
4196
|
+
var TemplateContentPrimary = function TemplateContentPrimary(props) {
|
|
4197
|
+
var sidebar = props.sidebar;
|
|
4198
|
+
var styles = react.useStyleConfig("TemplateContentPrimary", {
|
|
4199
|
+
variant: sidebar
|
|
4200
|
+
});
|
|
4201
|
+
return React.createElement(react.Box, {
|
|
4202
|
+
__css: styles
|
|
4203
|
+
}, props.children);
|
|
4204
|
+
};
|
|
4205
|
+
/**
|
|
4206
|
+
* This component is used to render content in a sidebar column. It must go
|
|
4207
|
+
* inside the `TemplateContent` component and must be paired with the
|
|
4208
|
+
* `TemplateContentPrimary` component. If this is a left sidebar, it needs to be
|
|
4209
|
+
* rendered before the `TemplateContentPrimary` component. If this is a right
|
|
4210
|
+
* sidebar, it needs to be rendered after the `TemplateContentPrimary` component.
|
|
4211
|
+
* An optional `sidebar` prop value of "left" or "right" can be passed to render
|
|
4212
|
+
* the correct CSS styles. If the `sidebar` prop is used in the `TemplateContent`
|
|
4213
|
+
* component, there is no need to pass the `sidebar` prop to this component --
|
|
4214
|
+
* `TemplateContent` will handle it.
|
|
4215
|
+
*/
|
|
4216
|
+
|
|
4217
|
+
|
|
4218
|
+
var TemplateContentSidebar = function TemplateContentSidebar(props) {
|
|
4219
|
+
var sidebar = props.sidebar;
|
|
4220
|
+
var styles = react.useStyleConfig("TemplateContentSidebar", {
|
|
4221
|
+
variant: sidebar
|
|
4222
|
+
});
|
|
4223
|
+
return React.createElement(react.Box, {
|
|
4224
|
+
__css: styles
|
|
4225
|
+
}, props.children);
|
|
4226
|
+
};
|
|
4227
|
+
/**
|
|
4228
|
+
* This optional component should be the last child of the `Template`
|
|
4229
|
+
* component. This is rendered as an HTML `<footer>` element and spans the full
|
|
4230
|
+
* width of the page.
|
|
4231
|
+
*/
|
|
4232
|
+
|
|
4233
|
+
|
|
4234
|
+
var TemplateFooter = function TemplateFooter(props) {
|
|
4235
|
+
return React.createElement(react.Box, {
|
|
4236
|
+
as: "footer"
|
|
4237
|
+
}, props.children);
|
|
4238
|
+
};
|
|
4239
|
+
/**
|
|
4240
|
+
* This single component can be used instead of all the individual template
|
|
4241
|
+
* components. Instead of importing and rendering the needed "template"
|
|
4242
|
+
* components, each section is passed as a prop to the section where it should
|
|
4243
|
+
* be rendered. For example, if you want to render content in the
|
|
4244
|
+
* `TemplateContentPrimary` section, then pass it as a prop to `contentPrimary`.
|
|
4245
|
+
*/
|
|
4246
|
+
|
|
4247
|
+
|
|
4248
|
+
var TemplateAppContainer = function TemplateAppContainer(props) {
|
|
4249
|
+
var breakout = props.breakout,
|
|
4250
|
+
contentPrimary = props.contentPrimary,
|
|
4251
|
+
contentSidebar = props.contentSidebar,
|
|
4252
|
+
contentTop = props.contentTop,
|
|
4253
|
+
footer = props.footer,
|
|
4254
|
+
header = props.header,
|
|
4255
|
+
_props$sidebar2 = props.sidebar,
|
|
4256
|
+
sidebar = _props$sidebar2 === void 0 ? "none" : _props$sidebar2;
|
|
4257
|
+
var breakoutElem = breakout && React.createElement(TemplateBreakout, null, breakout);
|
|
4258
|
+
var contentTopElem = contentTop && React.createElement(TemplateContentTop, null, contentTop);
|
|
4259
|
+
var contentPrimaryElem = contentPrimary && React.createElement(TemplateContentPrimary, null, contentPrimary);
|
|
4260
|
+
var contentSidebarElem = contentSidebar && React.createElement(TemplateContentSidebar, null, contentSidebar);
|
|
4261
|
+
return React.createElement(Template, null, (header || breakoutElem) && React.createElement(TemplateHeader, null, header, breakoutElem), React.createElement(TemplateContent, {
|
|
4262
|
+
sidebar: sidebar
|
|
4263
|
+
}, contentTopElem, sidebar === "left" && contentSidebarElem, contentPrimaryElem, sidebar === "right" && contentSidebarElem), footer && React.createElement(TemplateFooter, null, footer));
|
|
4264
|
+
};
|
|
4265
|
+
|
|
3754
4266
|
(function (VideoPlayerTypes) {
|
|
3755
4267
|
VideoPlayerTypes["Vimeo"] = "vimeo";
|
|
3756
4268
|
VideoPlayerTypes["YouTube"] = "youtube";
|
|
@@ -3826,20 +4338,76 @@ function VideoPlayer(props) {
|
|
|
3826
4338
|
}
|
|
3827
4339
|
|
|
3828
4340
|
/**
|
|
3829
|
-
*
|
|
3830
|
-
*
|
|
3831
|
-
*
|
|
3832
|
-
*
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
4341
|
+
* These rules affect all the global elements on the `body` element of the
|
|
4342
|
+
* page when the `DSProvider` component is used. This means that even if the
|
|
4343
|
+
* `nypl-ds` CSS class name is not used in a consuming application, these
|
|
4344
|
+
* rules will still take effect.
|
|
4345
|
+
*/
|
|
4346
|
+
var global = {
|
|
4347
|
+
// styles for the `body` element
|
|
4348
|
+
body: {
|
|
4349
|
+
bg: "ui.white",
|
|
4350
|
+
color: "ui.black",
|
|
4351
|
+
fontFamily: "body",
|
|
4352
|
+
fontSize: 0,
|
|
4353
|
+
fontWeight: "300",
|
|
4354
|
+
lineHeight: "1.5"
|
|
4355
|
+
},
|
|
4356
|
+
// styles for the `a` element
|
|
4357
|
+
a: {
|
|
4358
|
+
color: "ui.link.primary"
|
|
4359
|
+
},
|
|
4360
|
+
svg: {
|
|
4361
|
+
display: "inline"
|
|
4362
|
+
}
|
|
4363
|
+
};
|
|
4364
|
+
|
|
4365
|
+
/**
|
|
4366
|
+
* Breakpoints from "src/styles/base/_02-breakpoints.scss"
|
|
4367
|
+
* How to use Chakra responsive styles: https://chakra-ui.com/docs/features/responsive-styles
|
|
4368
|
+
*
|
|
4369
|
+
* Chakra Value | DS Variable | EM/PX value
|
|
4370
|
+
* --------------------------------------------------
|
|
4371
|
+
* sm | --breakpoint-small | 20em/320px
|
|
4372
|
+
* md | --breakpoint-medium | 38em/600px
|
|
4373
|
+
* lg | --breakpoint-large | 60em/960px
|
|
4374
|
+
* xl | --breakpoint-xl | 80em/1280px
|
|
4375
|
+
* 2xl | N/A | 96em/1536px
|
|
4376
|
+
*
|
|
4377
|
+
* @Note Chakra provides a 2xl option while the DS does not. We don't
|
|
4378
|
+
* recommend using this value until further notice.
|
|
4379
|
+
*/
|
|
4380
|
+
|
|
4381
|
+
var breakpoints = /*#__PURE__*/themeTools.createBreakpoints({
|
|
4382
|
+
sm: "20em",
|
|
4383
|
+
md: "38em",
|
|
4384
|
+
lg: "60em",
|
|
4385
|
+
xl: "80em",
|
|
4386
|
+
"2xl": "96em"
|
|
4387
|
+
});
|
|
4388
|
+
|
|
4389
|
+
/**
|
|
4390
|
+
* Colors taken from "../../styles/01-colors/*.scss"
|
|
4391
|
+
*
|
|
4392
|
+
* All UI colors can be found in Storybook:
|
|
4393
|
+
* https://nypl.github.io/nypl-design-system/storybook-static/?path=/story/documentation-style-guide-colors--colors-utility
|
|
4394
|
+
* and in Figma:
|
|
4395
|
+
* https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=14989%3A37
|
|
4396
|
+
*
|
|
4397
|
+
* All Brand colors can be found in Storybook:
|
|
4398
|
+
* https://nypl.github.io/nypl-design-system/storybook-static/?path=/story/documentation-style-guide-colors--colors-brand
|
|
4399
|
+
* and in Figma:
|
|
4400
|
+
* https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=15454%3A47007
|
|
4401
|
+
*
|
|
4402
|
+
* At the end of this file, there are objects that extend Chakra's default
|
|
4403
|
+
* color shade palette for individual colors. WE DO NOT RECOMMEND to use them
|
|
3837
4404
|
* and only recommend to use the colors defined by the Design System such as the
|
|
3838
4405
|
* following "ui", "brand", and "section" colors below.
|
|
3839
4406
|
*/
|
|
3840
4407
|
// Reusable variables:
|
|
3841
|
-
var
|
|
3842
|
-
var
|
|
4408
|
+
var grayLightCool = "#E0E0E0";
|
|
4409
|
+
var grayxxLightCool = "#FAFAFA";
|
|
4410
|
+
var grayMedium = "#BDBDBD";
|
|
3843
4411
|
var brandPrimary = "#C60917";
|
|
3844
4412
|
var brandSecondary = "#760000";
|
|
3845
4413
|
var brandObj = {
|
|
@@ -3854,10 +4422,13 @@ var colors = {
|
|
|
3854
4422
|
white: "#fff",
|
|
3855
4423
|
/// State and link utilities
|
|
3856
4424
|
disabled: {
|
|
3857
|
-
primary:
|
|
3858
|
-
secondary:
|
|
4425
|
+
primary: grayLightCool,
|
|
4426
|
+
secondary: grayxxLightCool
|
|
4427
|
+
},
|
|
4428
|
+
error: {
|
|
4429
|
+
primary: "#97272C",
|
|
4430
|
+
secondary: "#6F0106"
|
|
3859
4431
|
},
|
|
3860
|
-
error: "#97272C",
|
|
3861
4432
|
focus: "#4181F1",
|
|
3862
4433
|
link: {
|
|
3863
4434
|
primary: "#0576D3",
|
|
@@ -3880,12 +4451,12 @@ var colors = {
|
|
|
3880
4451
|
gray: {
|
|
3881
4452
|
xdark: "#424242",
|
|
3882
4453
|
dark: "#616161",
|
|
3883
|
-
medium:
|
|
3884
|
-
light:
|
|
3885
|
-
"warm
|
|
3886
|
-
|
|
3887
|
-
"warm
|
|
3888
|
-
|
|
4454
|
+
medium: grayMedium,
|
|
4455
|
+
"light-cool": grayLightCool,
|
|
4456
|
+
"light-warm": "#EFEDEB",
|
|
4457
|
+
"x-light-cool": "#F5F5F5",
|
|
4458
|
+
"x-light-warm": "#F8F8F7",
|
|
4459
|
+
"xx-light-cool": grayxxLightCool
|
|
3889
4460
|
}
|
|
3890
4461
|
},
|
|
3891
4462
|
|
|
@@ -3914,6 +4485,12 @@ var colors = {
|
|
|
3914
4485
|
* the exceptions of some research libraries. */
|
|
3915
4486
|
locations: brandObj,
|
|
3916
4487
|
|
|
4488
|
+
/** Blogs is used for the Blogs section. */
|
|
4489
|
+
blogs: {
|
|
4490
|
+
primary: grayLightCool,
|
|
4491
|
+
secondary: grayMedium
|
|
4492
|
+
},
|
|
4493
|
+
|
|
3917
4494
|
/** Research libraries with specific brand colors to adhere to. */
|
|
3918
4495
|
"research-library": {
|
|
3919
4496
|
lpa: "#005d53",
|
|
@@ -4016,26 +4593,8 @@ var colors = {
|
|
|
4016
4593
|
}
|
|
4017
4594
|
};
|
|
4018
4595
|
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
* page when the `DSProvider` component is used. This means that even if the
|
|
4022
|
-
* `nypl-ds` CSS class name is not used in a consuming application, these
|
|
4023
|
-
* rules will still take effect.
|
|
4024
|
-
*/
|
|
4025
|
-
var global = {
|
|
4026
|
-
// styles for the `body` element
|
|
4027
|
-
body: {
|
|
4028
|
-
bg: "ui.white",
|
|
4029
|
-
color: "ui.black",
|
|
4030
|
-
fontFamily: "body"
|
|
4031
|
-
},
|
|
4032
|
-
// styles for the `a` element
|
|
4033
|
-
a: {
|
|
4034
|
-
color: "ui.link.primary"
|
|
4035
|
-
},
|
|
4036
|
-
svg: {
|
|
4037
|
-
display: "inline"
|
|
4038
|
-
}
|
|
4596
|
+
var shadows = {
|
|
4597
|
+
outline: "none"
|
|
4039
4598
|
};
|
|
4040
4599
|
|
|
4041
4600
|
var typography = {
|
|
@@ -4064,31 +4623,133 @@ var typography = {
|
|
|
4064
4623
|
}
|
|
4065
4624
|
};
|
|
4066
4625
|
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4626
|
+
var containerStyles = {
|
|
4627
|
+
borderLeftWidth: "1px",
|
|
4628
|
+
borderRightWidth: "1px",
|
|
4629
|
+
borderColor: "ui.gray.medium",
|
|
4630
|
+
width: "100%"
|
|
4631
|
+
};
|
|
4632
|
+
var buttonStyles = {
|
|
4633
|
+
border: "none",
|
|
4634
|
+
fontWeight: 500,
|
|
4635
|
+
_hover: {
|
|
4636
|
+
bg: "ui.gray.light-cool"
|
|
4637
|
+
}
|
|
4638
|
+
};
|
|
4639
|
+
var panelStyles = {
|
|
4640
|
+
paddingTop: "xs",
|
|
4641
|
+
paddingRight: "xxxl",
|
|
4642
|
+
paddingLeft: "s",
|
|
4643
|
+
paddingBottom: "xs"
|
|
4644
|
+
};
|
|
4645
|
+
var Accordion$1 = {
|
|
4646
|
+
parts: ["container", "button", "panel"],
|
|
4647
|
+
baseStyle: {
|
|
4648
|
+
container: containerStyles,
|
|
4649
|
+
button: buttonStyles,
|
|
4650
|
+
panel: panelStyles
|
|
4651
|
+
}
|
|
4652
|
+
};
|
|
4082
4653
|
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
}
|
|
4654
|
+
// Variant styling
|
|
4655
|
+
var booksAndMore = {
|
|
4656
|
+
bg: "section.books-and-more.secondary"
|
|
4657
|
+
};
|
|
4658
|
+
var locations = {
|
|
4659
|
+
bg: "section.locations.secondary"
|
|
4660
|
+
};
|
|
4661
|
+
var research = {
|
|
4662
|
+
bg: "section.research.secondary"
|
|
4663
|
+
};
|
|
4664
|
+
var whatsOn = {
|
|
4665
|
+
bg: "section.whats-on.secondary"
|
|
4666
|
+
};
|
|
4667
|
+
var Breadcrumb = {
|
|
4668
|
+
baseStyle: {
|
|
4669
|
+
bg: "ui.black",
|
|
4670
|
+
color: "ui.white",
|
|
4671
|
+
fontSize: "-1",
|
|
4672
|
+
fontWeight: "regular",
|
|
4673
|
+
paddingBottom: "xs",
|
|
4674
|
+
paddingTop: "xs",
|
|
4675
|
+
ol: {
|
|
4676
|
+
alignItems: {
|
|
4677
|
+
base: "center",
|
|
4678
|
+
md: "unset"
|
|
4679
|
+
},
|
|
4680
|
+
display: {
|
|
4681
|
+
base: "flex",
|
|
4682
|
+
md: "block"
|
|
4683
|
+
},
|
|
4684
|
+
margin: "auto",
|
|
4685
|
+
maxWidth: "1280px",
|
|
4686
|
+
paddingLeft: "s",
|
|
4687
|
+
paddingRight: "s"
|
|
4688
|
+
},
|
|
4689
|
+
a: {
|
|
4690
|
+
_hover: {
|
|
4691
|
+
color: "ui.gray.light-cool"
|
|
4692
|
+
}
|
|
4693
|
+
},
|
|
4694
|
+
"li:last-child": {
|
|
4695
|
+
fontWeight: {
|
|
4696
|
+
base: "regular",
|
|
4697
|
+
md: "bold"
|
|
4698
|
+
},
|
|
4699
|
+
".chakra-breadcrumb__link": {
|
|
4700
|
+
_hover: {
|
|
4701
|
+
cursor: "default",
|
|
4702
|
+
textDecoration: "none"
|
|
4703
|
+
}
|
|
4704
|
+
},
|
|
4705
|
+
".icon": {
|
|
4706
|
+
display: "none"
|
|
4707
|
+
}
|
|
4708
|
+
},
|
|
4709
|
+
"li:not(:last-child)": {
|
|
4710
|
+
display: {
|
|
4711
|
+
base: "none",
|
|
4712
|
+
md: "inline-block"
|
|
4713
|
+
},
|
|
4714
|
+
a: {
|
|
4715
|
+
marginRight: {
|
|
4716
|
+
base: "xs",
|
|
4717
|
+
md: "0"
|
|
4718
|
+
}
|
|
4719
|
+
},
|
|
4720
|
+
".icon": {
|
|
4721
|
+
display: {
|
|
4722
|
+
base: "inline",
|
|
4723
|
+
md: "none"
|
|
4724
|
+
}
|
|
4725
|
+
},
|
|
4726
|
+
"span:not(.breadcrumb-label)": {
|
|
4727
|
+
marginInlineEnd: "xxs",
|
|
4728
|
+
marginInlineStart: "xxs"
|
|
4729
|
+
}
|
|
4730
|
+
},
|
|
4731
|
+
"li:nth-last-child(2)": {
|
|
4732
|
+
display: "inline-block",
|
|
4733
|
+
span: {
|
|
4734
|
+
display: {
|
|
4735
|
+
base: "none",
|
|
4736
|
+
md: "inline"
|
|
4737
|
+
}
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4740
|
+
},
|
|
4741
|
+
// Available variants:
|
|
4742
|
+
variants: {
|
|
4743
|
+
booksAndMore: booksAndMore,
|
|
4744
|
+
locations: locations,
|
|
4745
|
+
research: research,
|
|
4746
|
+
whatsOn: whatsOn
|
|
4747
|
+
}
|
|
4748
|
+
};
|
|
4749
|
+
|
|
4750
|
+
var _variants;
|
|
4090
4751
|
|
|
4091
|
-
//
|
|
4752
|
+
// Style object for base or default style
|
|
4092
4753
|
var baseStyle = {
|
|
4093
4754
|
borderRadius: "2px",
|
|
4094
4755
|
lineHeight: "1.5",
|
|
@@ -4096,10 +4757,14 @@ var baseStyle = {
|
|
|
4096
4757
|
cursor: "pointer",
|
|
4097
4758
|
color: "ui.white",
|
|
4098
4759
|
justifyContent: "center",
|
|
4099
|
-
py:
|
|
4100
|
-
px:
|
|
4760
|
+
py: "xs",
|
|
4761
|
+
px: "s",
|
|
4101
4762
|
textDecoration: "none",
|
|
4102
4763
|
wordWrap: "normal",
|
|
4764
|
+
svg: {
|
|
4765
|
+
fill: "currentColor",
|
|
4766
|
+
marginTop: "xxs"
|
|
4767
|
+
},
|
|
4103
4768
|
_hover: {
|
|
4104
4769
|
bg: "ui.link.secondary"
|
|
4105
4770
|
},
|
|
@@ -4107,88 +4772,96 @@ var baseStyle = {
|
|
|
4107
4772
|
color: "ui.white"
|
|
4108
4773
|
},
|
|
4109
4774
|
_disabled: {
|
|
4110
|
-
bg: "ui.gray.light",
|
|
4775
|
+
bg: "ui.gray.light-cool",
|
|
4111
4776
|
color: "ui.gray.dark",
|
|
4112
4777
|
pointerEvents: "none",
|
|
4113
4778
|
opacity: "1"
|
|
4114
4779
|
}
|
|
4115
|
-
}; //
|
|
4780
|
+
}; // Styles for different "lg" size
|
|
4116
4781
|
|
|
4117
4782
|
var sizes = {
|
|
4118
4783
|
lg: {
|
|
4119
4784
|
width: "150px"
|
|
4120
4785
|
}
|
|
4121
|
-
}; //
|
|
4122
|
-
// primary, secondary, link, pill, icon-only
|
|
4786
|
+
}; // Styles for different visual variants:
|
|
4787
|
+
// primary, secondary, link, pill, icon-only, callout
|
|
4123
4788
|
|
|
4124
|
-
var
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4789
|
+
var primary = {
|
|
4790
|
+
bg: "ui.link.primary",
|
|
4791
|
+
minWidth: "none",
|
|
4792
|
+
height: "none"
|
|
4793
|
+
};
|
|
4794
|
+
var secondary = {
|
|
4795
|
+
bg: "ui.white",
|
|
4796
|
+
border: "1px solid",
|
|
4797
|
+
borderColor: "ui.gray.light-cool",
|
|
4798
|
+
color: "inherit",
|
|
4799
|
+
_hover: {
|
|
4800
|
+
bg: "ui.gray.xx-light-cool"
|
|
4801
|
+
}
|
|
4802
|
+
};
|
|
4803
|
+
var link = {
|
|
4804
|
+
bg: "transparent",
|
|
4805
|
+
lineHeight: "2.5",
|
|
4806
|
+
color: "ui.link.primary",
|
|
4807
|
+
textDecoration: "underline",
|
|
4808
|
+
_disabled: {
|
|
4809
|
+
bg: "transparent"
|
|
4138
4810
|
},
|
|
4139
|
-
|
|
4811
|
+
_hover: {
|
|
4140
4812
|
bg: "transparent",
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4813
|
+
color: "ui.link.secondary"
|
|
4814
|
+
}
|
|
4815
|
+
};
|
|
4816
|
+
var pill = {
|
|
4817
|
+
bg: "ui.white",
|
|
4818
|
+
border: "1px solid",
|
|
4819
|
+
borderColor: "ui.gray.light-cool",
|
|
4820
|
+
color: "inherit",
|
|
4821
|
+
borderRadius: "20px",
|
|
4822
|
+
py: "xs",
|
|
4823
|
+
paddingInlineStart: "m",
|
|
4824
|
+
paddingInlineEnd: "m",
|
|
4825
|
+
_hover: {
|
|
4826
|
+
bg: "ui.gray.xx-light-cool"
|
|
4827
|
+
}
|
|
4828
|
+
};
|
|
4829
|
+
var iconOnly = {
|
|
4830
|
+
bg: "ui.white",
|
|
4831
|
+
border: "1px solid",
|
|
4832
|
+
borderColor: "ui.gray.light-cool",
|
|
4833
|
+
color: "inherit",
|
|
4834
|
+
_hover: {
|
|
4835
|
+
bg: "ui.gray.xx-light-cool"
|
|
4164
4836
|
},
|
|
4165
|
-
"
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
},
|
|
4173
|
-
paddingInlineStart: 1,
|
|
4174
|
-
paddingInlineEnd: 1
|
|
4837
|
+
paddingInlineStart: "xs",
|
|
4838
|
+
paddingInlineEnd: "xs"
|
|
4839
|
+
};
|
|
4840
|
+
var callout = {
|
|
4841
|
+
bg: "brand.primary",
|
|
4842
|
+
_hover: {
|
|
4843
|
+
bg: "brand.secondary"
|
|
4175
4844
|
},
|
|
4176
|
-
|
|
4177
|
-
bg: "brand.
|
|
4178
|
-
_hover: {
|
|
4179
|
-
bg: "brand.secondary"
|
|
4180
|
-
},
|
|
4181
|
-
_active: {
|
|
4182
|
-
bg: "brand.secondary"
|
|
4183
|
-
}
|
|
4845
|
+
_active: {
|
|
4846
|
+
bg: "brand.secondary"
|
|
4184
4847
|
}
|
|
4185
4848
|
};
|
|
4849
|
+
|
|
4850
|
+
var searchBar = /*#__PURE__*/_extends({}, primary, {
|
|
4851
|
+
borderLeftRadius: "0"
|
|
4852
|
+
});
|
|
4853
|
+
|
|
4186
4854
|
var Button$1 = {
|
|
4187
4855
|
baseStyle: baseStyle,
|
|
4188
4856
|
sizes: sizes,
|
|
4189
4857
|
// Available variants:
|
|
4190
|
-
//
|
|
4191
|
-
variants:
|
|
4858
|
+
// primary, secondary, link, pill, icon-only, searchBar
|
|
4859
|
+
variants: (_variants = {
|
|
4860
|
+
primary: primary,
|
|
4861
|
+
secondary: secondary,
|
|
4862
|
+
link: link,
|
|
4863
|
+
pill: pill
|
|
4864
|
+
}, _variants["icon-only"] = iconOnly, _variants.callout = callout, _variants.searchBar = searchBar, _variants),
|
|
4192
4865
|
// Default values
|
|
4193
4866
|
defaultProps: {
|
|
4194
4867
|
size: "md",
|
|
@@ -4197,9 +4870,80 @@ var Button$1 = {
|
|
|
4197
4870
|
}
|
|
4198
4871
|
};
|
|
4199
4872
|
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4873
|
+
/**
|
|
4874
|
+
* These objects are also SCSS mixins but are now JS objects in the
|
|
4875
|
+
* context of css-in-js and the custom NYPL-theme.
|
|
4876
|
+
*/
|
|
4877
|
+
var wrapperStyles = {
|
|
4878
|
+
marginY: "0",
|
|
4879
|
+
marginX: "auto",
|
|
4880
|
+
maxWidth: "1280px",
|
|
4881
|
+
paddingTop: "0",
|
|
4882
|
+
paddingBottom: "0",
|
|
4883
|
+
paddingRight: "0",
|
|
4884
|
+
paddingLeft: "0",
|
|
4885
|
+
width: "100%"
|
|
4886
|
+
};
|
|
4887
|
+
|
|
4888
|
+
/** Reusable component styles. */
|
|
4889
|
+
// Used in `Select` and `TextInput`.
|
|
4890
|
+
|
|
4891
|
+
var activeFocus = {
|
|
4892
|
+
border: "1px solid",
|
|
4893
|
+
borderColor: "ui.focus",
|
|
4894
|
+
zIndex: "9999",
|
|
4895
|
+
outline: "1px solid",
|
|
4896
|
+
outlineColor: "ui.focus"
|
|
4897
|
+
}; // Used in `Select` and `TextInput`.
|
|
4898
|
+
|
|
4899
|
+
var helperTextMargin = {
|
|
4900
|
+
marginTop: "xs",
|
|
4901
|
+
marginBottom: "0"
|
|
4902
|
+
}; // Used in `Checkbox` and `Radio`.
|
|
4903
|
+
|
|
4904
|
+
var checkboxRadioLabelStyles = {
|
|
4905
|
+
userSelect: "none",
|
|
4906
|
+
fontSize: "0",
|
|
4907
|
+
fontWeight: "light",
|
|
4908
|
+
marginBottom: "0",
|
|
4909
|
+
marginLeft: "xs",
|
|
4910
|
+
verticalAlign: "middle",
|
|
4911
|
+
_disabled: {
|
|
4912
|
+
color: "ui.gray.dark",
|
|
4913
|
+
opacity: 1,
|
|
4914
|
+
fontStyle: "italic"
|
|
4915
|
+
},
|
|
4916
|
+
_invalid: {
|
|
4917
|
+
color: "ui.error.primary"
|
|
4918
|
+
}
|
|
4919
|
+
}; // Custom values not in the spacing theme.
|
|
4920
|
+
// Used in `Checkbox` and `Radio`.
|
|
4921
|
+
|
|
4922
|
+
var checkboxRadioControlSize = {
|
|
4923
|
+
h: "1.375rem",
|
|
4924
|
+
w: "1.375rem"
|
|
4925
|
+
}; // Used in `CheckboxGroup` and `RadioGroup`.
|
|
4926
|
+
|
|
4927
|
+
var checkboxRadioGroupLayout = {
|
|
4928
|
+
legend: {
|
|
4929
|
+
fontSize: "14px",
|
|
4930
|
+
marginBottom: "s"
|
|
4931
|
+
},
|
|
4932
|
+
required: {
|
|
4933
|
+
marginLeft: "m"
|
|
4934
|
+
},
|
|
4935
|
+
helper: {
|
|
4936
|
+
marginTop: "s"
|
|
4937
|
+
}
|
|
4938
|
+
}; // Used in `Checkbox` and `Radio`.
|
|
4939
|
+
|
|
4940
|
+
var checkboxRadioHelperStyle = /*#__PURE__*/_extends({}, helperTextMargin, {
|
|
4941
|
+
marginLeft: "30px",
|
|
4942
|
+
_disabled: {
|
|
4943
|
+
fontStyle: "italic"
|
|
4944
|
+
}
|
|
4945
|
+
});
|
|
4946
|
+
|
|
4203
4947
|
var baseStyleIcon = {
|
|
4204
4948
|
transitionProperty: "transform",
|
|
4205
4949
|
transitionDuration: "normal",
|
|
@@ -4228,83 +4972,577 @@ var baseStyleControl = {
|
|
|
4228
4972
|
color: "ui.gray.medium"
|
|
4229
4973
|
}
|
|
4230
4974
|
},
|
|
4231
|
-
_indeterminate: {
|
|
4232
|
-
bg: "ui.white",
|
|
4233
|
-
borderColor: "ui.gray.medium"
|
|
4975
|
+
_indeterminate: {
|
|
4976
|
+
bg: "ui.white",
|
|
4977
|
+
borderColor: "ui.gray.medium"
|
|
4978
|
+
},
|
|
4979
|
+
_disabled: {
|
|
4980
|
+
bg: "ui.white",
|
|
4981
|
+
borderColor: "ui.gray.medium"
|
|
4982
|
+
},
|
|
4983
|
+
_focus: {
|
|
4984
|
+
borderColor: "ui.focus",
|
|
4985
|
+
boxShadow: "none",
|
|
4986
|
+
outlineColor: "ui.focus"
|
|
4987
|
+
},
|
|
4988
|
+
_invalid: {
|
|
4989
|
+
borderColor: "ui.error.primary",
|
|
4990
|
+
color: "ui.error.primary"
|
|
4991
|
+
}
|
|
4992
|
+
}; // Style object for the Checkbox's label
|
|
4993
|
+
|
|
4994
|
+
var baseStyleLabel = /*#__PURE__*/_extends({}, checkboxRadioLabelStyles); // Style object for the Checkbox's helper text
|
|
4995
|
+
|
|
4996
|
+
|
|
4997
|
+
var baseStyleHelper = /*#__PURE__*/_extends({}, checkboxRadioHelperStyle);
|
|
4998
|
+
|
|
4999
|
+
var baseStyle$1 = {
|
|
5000
|
+
icon: baseStyleIcon,
|
|
5001
|
+
control: baseStyleControl,
|
|
5002
|
+
label: baseStyleLabel,
|
|
5003
|
+
helper: baseStyleHelper
|
|
5004
|
+
}; // Sticking to "lg" for the default size.
|
|
5005
|
+
|
|
5006
|
+
var sizes$1 = {
|
|
5007
|
+
lg: {
|
|
5008
|
+
// Controls the width/height of the checkbox itself.
|
|
5009
|
+
control: /*#__PURE__*/_extends({}, checkboxRadioControlSize, {
|
|
5010
|
+
borderRadius: "3px"
|
|
5011
|
+
}),
|
|
5012
|
+
// Controls the font-size of the label only.
|
|
5013
|
+
label: {
|
|
5014
|
+
fontSize: "md"
|
|
5015
|
+
}
|
|
5016
|
+
}
|
|
5017
|
+
};
|
|
5018
|
+
var Checkbox$1 = {
|
|
5019
|
+
parts: ["icon", "control", "label", "helper"],
|
|
5020
|
+
baseStyle: baseStyle$1,
|
|
5021
|
+
sizes: sizes$1,
|
|
5022
|
+
// Default values
|
|
5023
|
+
defaultProps: {
|
|
5024
|
+
size: "lg",
|
|
5025
|
+
colorScheme: "white"
|
|
5026
|
+
}
|
|
5027
|
+
};
|
|
5028
|
+
|
|
5029
|
+
var CustomCheckboxGroup = {
|
|
5030
|
+
parts: ["legend", "required", "helper"],
|
|
5031
|
+
baseStyle: /*#__PURE__*/_extends({}, checkboxRadioGroupLayout),
|
|
5032
|
+
sizes: {},
|
|
5033
|
+
defaultProps: {}
|
|
5034
|
+
};
|
|
5035
|
+
|
|
5036
|
+
var CustomRadioGroup = {
|
|
5037
|
+
parts: ["legend", "required", "helper"],
|
|
5038
|
+
baseStyle: /*#__PURE__*/_extends({}, checkboxRadioGroupLayout),
|
|
5039
|
+
sizes: {},
|
|
5040
|
+
defaultProps: {}
|
|
5041
|
+
};
|
|
5042
|
+
|
|
5043
|
+
var select = {
|
|
5044
|
+
borderRadius: "2px",
|
|
5045
|
+
borderColor: "ui.gray.medium",
|
|
5046
|
+
paddingTop: "xs",
|
|
5047
|
+
paddingRight: "xl",
|
|
5048
|
+
paddingBottom: "xs",
|
|
5049
|
+
paddingLeft: "s",
|
|
5050
|
+
_hover: {
|
|
5051
|
+
borderColor: "ui.gray.medium"
|
|
5052
|
+
},
|
|
5053
|
+
_active: activeFocus,
|
|
5054
|
+
_focus: activeFocus,
|
|
5055
|
+
_disabled: {
|
|
5056
|
+
color: "ui.gray.xdark",
|
|
5057
|
+
bg: "ui.gray.xx-light-cool",
|
|
5058
|
+
opacity: "1"
|
|
5059
|
+
},
|
|
5060
|
+
_invalid: {
|
|
5061
|
+
border: "1px solid",
|
|
5062
|
+
borderColor: "ui.error.primary",
|
|
5063
|
+
boxShadow: "none"
|
|
5064
|
+
}
|
|
5065
|
+
};
|
|
5066
|
+
var Select$1 = {
|
|
5067
|
+
parts: ["select", "helper"],
|
|
5068
|
+
baseStyle: {
|
|
5069
|
+
marginBottom: "xs",
|
|
5070
|
+
helper: /*#__PURE__*/_extends({}, helperTextMargin),
|
|
5071
|
+
select: select
|
|
5072
|
+
},
|
|
5073
|
+
variants: {
|
|
5074
|
+
searchbar: {
|
|
5075
|
+
select: {
|
|
5076
|
+
flex: "1 1 20%",
|
|
5077
|
+
borderRight: "none",
|
|
5078
|
+
borderRightRadius: "0"
|
|
5079
|
+
}
|
|
5080
|
+
}
|
|
5081
|
+
},
|
|
5082
|
+
defaultProps: {
|
|
5083
|
+
size: "md"
|
|
5084
|
+
}
|
|
5085
|
+
};
|
|
5086
|
+
|
|
5087
|
+
var margins = {
|
|
5088
|
+
marginTop: "0",
|
|
5089
|
+
marginLeft: "0",
|
|
5090
|
+
marginRight: "0",
|
|
5091
|
+
marginBottom: "s"
|
|
5092
|
+
}; // Heading Styles
|
|
5093
|
+
|
|
5094
|
+
var headings = {
|
|
5095
|
+
h1: /*#__PURE__*/_extends({
|
|
5096
|
+
fontSize: "4",
|
|
5097
|
+
fontWeight: "light",
|
|
5098
|
+
letterSpacing: "0",
|
|
5099
|
+
lineHeight: "1.1"
|
|
5100
|
+
}, margins, {
|
|
5101
|
+
width: "auto"
|
|
5102
|
+
}),
|
|
5103
|
+
h2: /*#__PURE__*/_extends({
|
|
5104
|
+
fontSize: "3",
|
|
5105
|
+
fontWeight: "medium",
|
|
5106
|
+
lineHeight: "1.25"
|
|
5107
|
+
}, margins, {
|
|
5108
|
+
width: "auto"
|
|
5109
|
+
}),
|
|
5110
|
+
h3: /*#__PURE__*/_extends({
|
|
5111
|
+
fontSize: "2",
|
|
5112
|
+
fontWeight: "medium",
|
|
5113
|
+
lineHeight: "1.25"
|
|
5114
|
+
}, margins, {
|
|
5115
|
+
width: "auto"
|
|
5116
|
+
}),
|
|
5117
|
+
h4: /*#__PURE__*/_extends({
|
|
5118
|
+
fontSize: "1",
|
|
5119
|
+
fontWeight: "medium",
|
|
5120
|
+
lineHeight: "1.15"
|
|
5121
|
+
}, margins, {
|
|
5122
|
+
width: "auto"
|
|
5123
|
+
}),
|
|
5124
|
+
fallback: /*#__PURE__*/_extends({
|
|
5125
|
+
fontSize: "1",
|
|
5126
|
+
fontWeight: "regular",
|
|
5127
|
+
lineHeight: "1.15"
|
|
5128
|
+
}, margins, {
|
|
5129
|
+
width: "auto"
|
|
5130
|
+
})
|
|
5131
|
+
}; // Styles for different visual variants
|
|
5132
|
+
|
|
5133
|
+
var variants = {
|
|
5134
|
+
h1: headings.h1,
|
|
5135
|
+
h2: headings.h2,
|
|
5136
|
+
h3: headings.h3,
|
|
5137
|
+
h4: headings.h4,
|
|
5138
|
+
h5: headings.fallback,
|
|
5139
|
+
h6: headings.fallback,
|
|
5140
|
+
primary: headings.h1,
|
|
5141
|
+
secondary: headings.h2,
|
|
5142
|
+
tertiary: headings.h3,
|
|
5143
|
+
callout: headings.h4
|
|
5144
|
+
};
|
|
5145
|
+
var Heading$1 = {
|
|
5146
|
+
// Available variants:
|
|
5147
|
+
// h1, h2, h3, h4, h5, h6,
|
|
5148
|
+
// primary, secondary, tertiary, callout
|
|
5149
|
+
variants: variants,
|
|
5150
|
+
defaultProps: {
|
|
5151
|
+
variant: "secondary"
|
|
5152
|
+
}
|
|
5153
|
+
};
|
|
5154
|
+
|
|
5155
|
+
var secondaryBase = {
|
|
5156
|
+
overflowX: "hidden",
|
|
5157
|
+
content: /*#__PURE__*/_extends({}, wrapperStyles, {
|
|
5158
|
+
paddingRight: "s",
|
|
5159
|
+
paddingLeft: "s",
|
|
5160
|
+
display: "flex",
|
|
5161
|
+
flexFlow: {
|
|
5162
|
+
base: "column nowrap",
|
|
5163
|
+
md: "row wrap"
|
|
5164
|
+
},
|
|
5165
|
+
img: {
|
|
5166
|
+
flex: {
|
|
5167
|
+
base: "1 1 100%",
|
|
5168
|
+
md: "0 0 250px"
|
|
5169
|
+
},
|
|
5170
|
+
order: {
|
|
5171
|
+
md: "3"
|
|
5172
|
+
},
|
|
5173
|
+
height: "150px",
|
|
5174
|
+
minWidth: "0",
|
|
5175
|
+
objectFit: "cover",
|
|
5176
|
+
width: "100%"
|
|
5177
|
+
}
|
|
5178
|
+
}),
|
|
5179
|
+
bodyText: {
|
|
5180
|
+
marginTop: "xs",
|
|
5181
|
+
marginRight: {
|
|
5182
|
+
md: "xs"
|
|
5183
|
+
},
|
|
5184
|
+
flex: {
|
|
5185
|
+
md: "1 1 50%"
|
|
5186
|
+
},
|
|
5187
|
+
order: {
|
|
5188
|
+
md: "2"
|
|
5189
|
+
}
|
|
5190
|
+
}
|
|
5191
|
+
}; // Used for all "secondary" variants' heading component.
|
|
5192
|
+
|
|
5193
|
+
var secondaryHeadingBase = {
|
|
5194
|
+
marginBottom: "0",
|
|
5195
|
+
bg: "ui.black",
|
|
5196
|
+
color: "ui.white",
|
|
5197
|
+
flex: "1 1 100%",
|
|
5198
|
+
marginTop: "0",
|
|
5199
|
+
paddingBottom: "xxs",
|
|
5200
|
+
position: "relative",
|
|
5201
|
+
zIndex: "0",
|
|
5202
|
+
order: {
|
|
5203
|
+
md: "1"
|
|
5204
|
+
},
|
|
5205
|
+
_before: {
|
|
5206
|
+
bg: "ui.black",
|
|
5207
|
+
content: "\"\"",
|
|
5208
|
+
height: "100%",
|
|
5209
|
+
left: "-2000px",
|
|
5210
|
+
position: "absolute",
|
|
5211
|
+
width: "4000px",
|
|
5212
|
+
zIndex: "-1"
|
|
5213
|
+
}
|
|
5214
|
+
}; // Get all the styles for the specific Secondary variant but
|
|
5215
|
+
// update the background color.
|
|
5216
|
+
|
|
5217
|
+
var getSecondaryVariantStyles = function getSecondaryVariantStyles(bgColor) {
|
|
5218
|
+
return _extends({}, secondaryBase, {
|
|
5219
|
+
heading: _extends({}, secondaryHeadingBase, {
|
|
5220
|
+
bg: bgColor,
|
|
5221
|
+
_before: _extends({}, secondaryHeadingBase["_before"], {
|
|
5222
|
+
bg: bgColor
|
|
5223
|
+
})
|
|
5224
|
+
})
|
|
5225
|
+
});
|
|
5226
|
+
}; // Variant styling
|
|
5227
|
+
|
|
5228
|
+
|
|
5229
|
+
var primary$1 = {
|
|
5230
|
+
alignItems: "center",
|
|
5231
|
+
display: "flex",
|
|
5232
|
+
flexFlow: {
|
|
5233
|
+
base: "column nowrap",
|
|
5234
|
+
md: "row nowrap"
|
|
5235
|
+
},
|
|
5236
|
+
justifyContent: "center",
|
|
5237
|
+
minHeight: "350px",
|
|
5238
|
+
content: {
|
|
5239
|
+
bg: "ui.black",
|
|
5240
|
+
color: "ui.white",
|
|
5241
|
+
flex: {
|
|
5242
|
+
base: "0 0 100%",
|
|
5243
|
+
md: "0 0 60%"
|
|
5244
|
+
},
|
|
5245
|
+
maxWidth: {
|
|
5246
|
+
md: "960px"
|
|
5247
|
+
},
|
|
5248
|
+
paddingTop: "xxl",
|
|
5249
|
+
paddingBottom: "xxl",
|
|
5250
|
+
paddingRight: "l",
|
|
5251
|
+
paddingLeft: "l",
|
|
5252
|
+
a: {
|
|
5253
|
+
color: "inherit",
|
|
5254
|
+
display: "inline-block"
|
|
5255
|
+
},
|
|
5256
|
+
heading: {
|
|
5257
|
+
marginBottom: "0"
|
|
5258
|
+
},
|
|
5259
|
+
bodyText: {
|
|
5260
|
+
marginBottom: "0"
|
|
5261
|
+
}
|
|
5262
|
+
}
|
|
5263
|
+
};
|
|
5264
|
+
|
|
5265
|
+
var secondary$1 = /*#__PURE__*/_extends({}, secondaryBase, {
|
|
5266
|
+
heading: /*#__PURE__*/_extends({}, secondaryHeadingBase)
|
|
5267
|
+
});
|
|
5268
|
+
|
|
5269
|
+
var secondaryBooksAndMore = /*#__PURE__*/getSecondaryVariantStyles("section.books-and-more.primary");
|
|
5270
|
+
var secondaryLocations = /*#__PURE__*/getSecondaryVariantStyles("section.locations.primary");
|
|
5271
|
+
var secondaryResearch = /*#__PURE__*/getSecondaryVariantStyles("section.research.primary");
|
|
5272
|
+
var secondaryWhatsOn = /*#__PURE__*/getSecondaryVariantStyles("section.whats-on.primary");
|
|
5273
|
+
var tertiary = {
|
|
5274
|
+
bg: "ui.gray.xdark",
|
|
5275
|
+
content: /*#__PURE__*/_extends({}, wrapperStyles, {
|
|
5276
|
+
color: "ui.white",
|
|
5277
|
+
display: "flex",
|
|
5278
|
+
flexFlow: "column nowrap",
|
|
5279
|
+
paddingTop: "l",
|
|
5280
|
+
paddingBottom: "l",
|
|
5281
|
+
paddingRight: "s",
|
|
5282
|
+
paddingLeft: "s",
|
|
5283
|
+
p: {
|
|
5284
|
+
marginBottom: "0"
|
|
5285
|
+
}
|
|
5286
|
+
}),
|
|
5287
|
+
heading: {
|
|
5288
|
+
marginBottom: "s",
|
|
5289
|
+
_lastChild: {
|
|
5290
|
+
marginBottom: "0"
|
|
5291
|
+
}
|
|
5292
|
+
},
|
|
5293
|
+
p: {
|
|
5294
|
+
marginBottom: "0"
|
|
5295
|
+
}
|
|
5296
|
+
};
|
|
5297
|
+
var campaign = {
|
|
5298
|
+
alignItems: "center",
|
|
5299
|
+
display: "flex",
|
|
5300
|
+
justifyContent: "center",
|
|
5301
|
+
marginBottom: "xxl",
|
|
5302
|
+
minHeight: "300px",
|
|
5303
|
+
overflow: "visible",
|
|
5304
|
+
padding: {
|
|
5305
|
+
base: "l",
|
|
5306
|
+
md: "0"
|
|
5307
|
+
},
|
|
5308
|
+
position: "relative",
|
|
5309
|
+
content: {
|
|
5310
|
+
alignItems: "center",
|
|
5311
|
+
bg: "ui.black",
|
|
5312
|
+
color: "ui.white",
|
|
5313
|
+
display: "flex",
|
|
5314
|
+
flexFlow: {
|
|
5315
|
+
base: "column nowrap",
|
|
5316
|
+
md: "row nowrap"
|
|
5317
|
+
},
|
|
5318
|
+
minHeight: "320px",
|
|
5319
|
+
flex: {
|
|
5320
|
+
md: "0 0 90%"
|
|
5321
|
+
},
|
|
5322
|
+
maxWidth: {
|
|
5323
|
+
md: "1280px"
|
|
5324
|
+
},
|
|
5325
|
+
position: {
|
|
5326
|
+
md: "relative"
|
|
5327
|
+
},
|
|
5328
|
+
top: {
|
|
5329
|
+
md: "xxl"
|
|
5330
|
+
}
|
|
5331
|
+
},
|
|
5332
|
+
a: {
|
|
5333
|
+
color: "inherit",
|
|
5334
|
+
display: "inline-block"
|
|
5335
|
+
},
|
|
5336
|
+
img: {
|
|
5337
|
+
flex: {
|
|
5338
|
+
base: "1 1 100%",
|
|
5339
|
+
md: "0 0 50%"
|
|
5340
|
+
},
|
|
5341
|
+
minWidth: "0",
|
|
5342
|
+
objectFit: "cover",
|
|
5343
|
+
width: "100%",
|
|
5344
|
+
height: {
|
|
5345
|
+
md: "320px"
|
|
5346
|
+
}
|
|
5347
|
+
},
|
|
5348
|
+
interior: {
|
|
5349
|
+
flex: {
|
|
5350
|
+
base: "0 0 100%",
|
|
5351
|
+
md: "0 0 50%"
|
|
5352
|
+
},
|
|
5353
|
+
padding: "l",
|
|
5354
|
+
maxWidth: {
|
|
5355
|
+
md: "960px"
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
};
|
|
5359
|
+
var fiftyfifty = {
|
|
5360
|
+
content: /*#__PURE__*/_extends({}, wrapperStyles, {
|
|
5361
|
+
alignItems: "center",
|
|
5362
|
+
display: "flex",
|
|
5363
|
+
flexFlow: {
|
|
5364
|
+
base: "column nowrap",
|
|
5365
|
+
lg: "row nowrap"
|
|
5366
|
+
},
|
|
5367
|
+
paddingBottom: "s",
|
|
5368
|
+
paddingRight: "s",
|
|
5369
|
+
paddingLeft: "s",
|
|
5370
|
+
padding: {
|
|
5371
|
+
lg: "unset"
|
|
5372
|
+
}
|
|
5373
|
+
}),
|
|
5374
|
+
img: {
|
|
5375
|
+
marginBottom: {
|
|
5376
|
+
base: "s",
|
|
5377
|
+
lg: "unset"
|
|
5378
|
+
},
|
|
5379
|
+
marginRight: {
|
|
5380
|
+
lg: "s"
|
|
5381
|
+
},
|
|
5382
|
+
maxWidth: {
|
|
5383
|
+
base: "fit-content",
|
|
5384
|
+
lg: "50%"
|
|
5385
|
+
}
|
|
5386
|
+
}
|
|
5387
|
+
};
|
|
5388
|
+
var Hero$1 = {
|
|
5389
|
+
baseStyle: {
|
|
5390
|
+
bg: "ui.gray.x-light-warm"
|
|
5391
|
+
},
|
|
5392
|
+
// Available variants:
|
|
5393
|
+
variants: {
|
|
5394
|
+
primary: primary$1,
|
|
5395
|
+
secondary: secondary$1,
|
|
5396
|
+
secondaryBooksAndMore: secondaryBooksAndMore,
|
|
5397
|
+
secondaryLocations: secondaryLocations,
|
|
5398
|
+
secondaryResearch: secondaryResearch,
|
|
5399
|
+
secondaryWhatsOn: secondaryWhatsOn,
|
|
5400
|
+
tertiary: tertiary,
|
|
5401
|
+
campaign: campaign,
|
|
5402
|
+
fiftyfifty: fiftyfifty
|
|
5403
|
+
}
|
|
5404
|
+
};
|
|
5405
|
+
|
|
5406
|
+
var svgBase = {
|
|
5407
|
+
display: "inline-block",
|
|
5408
|
+
fill: "currentColor",
|
|
5409
|
+
width: "24px",
|
|
5410
|
+
height: "24px"
|
|
5411
|
+
};
|
|
5412
|
+
var align = {
|
|
5413
|
+
none: {},
|
|
5414
|
+
left: {
|
|
5415
|
+
marginRight: "xs"
|
|
5416
|
+
},
|
|
5417
|
+
right: {
|
|
5418
|
+
marginLeft: "xs"
|
|
5419
|
+
}
|
|
5420
|
+
};
|
|
5421
|
+
var iconRotation = {
|
|
5422
|
+
rotate180: {
|
|
5423
|
+
transform: "rotate(180deg)"
|
|
4234
5424
|
},
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
borderColor: "ui.gray.medium"
|
|
5425
|
+
rotate270: {
|
|
5426
|
+
transform: "rotate(270deg)"
|
|
4238
5427
|
},
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
boxShadow: "none",
|
|
4242
|
-
outlineColor: "ui.focus"
|
|
5428
|
+
rotate0: {
|
|
5429
|
+
transform: "rotate(0deg)"
|
|
4243
5430
|
},
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
color: "ui.error"
|
|
5431
|
+
rotate90: {
|
|
5432
|
+
transform: "rotate(90deg)"
|
|
4247
5433
|
}
|
|
4248
|
-
};
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
fontWeight: "light",
|
|
4254
|
-
marginBottom: 0,
|
|
4255
|
-
marginLeft: 2,
|
|
4256
|
-
verticalAlign: "middle",
|
|
4257
|
-
_disabled: {
|
|
4258
|
-
color: "ui.gray.dark",
|
|
4259
|
-
opacity: 1,
|
|
4260
|
-
fontStyle: "italic"
|
|
5434
|
+
};
|
|
5435
|
+
var size = {
|
|
5436
|
+
xxxlarge: {
|
|
5437
|
+
height: "var(--space-xxl)",
|
|
5438
|
+
width: "var(--space-xxl)"
|
|
4261
5439
|
},
|
|
4262
|
-
|
|
4263
|
-
|
|
5440
|
+
xxlarge: {
|
|
5441
|
+
height: "var(--space-xl)",
|
|
5442
|
+
width: "var(--space-xl)"
|
|
5443
|
+
},
|
|
5444
|
+
xlarge: {
|
|
5445
|
+
height: "var(--space-l)",
|
|
5446
|
+
width: "var(--space-l)"
|
|
5447
|
+
},
|
|
5448
|
+
large: {
|
|
5449
|
+
height: "var(--space-m)",
|
|
5450
|
+
width: "var(--space-m)"
|
|
5451
|
+
},
|
|
5452
|
+
medium: {
|
|
5453
|
+
height: "1.125rem",
|
|
5454
|
+
width: "1.125rem"
|
|
5455
|
+
},
|
|
5456
|
+
small: {
|
|
5457
|
+
height: "0.875rem",
|
|
5458
|
+
width: "0.875rem"
|
|
4264
5459
|
}
|
|
4265
|
-
};
|
|
5460
|
+
};
|
|
5461
|
+
var Icon$1 = {
|
|
5462
|
+
baseStyle: function baseStyle(props) {
|
|
5463
|
+
var allStyles = _extends({}, svgBase, align[props.align], {
|
|
5464
|
+
fill: props.color
|
|
5465
|
+
}, iconRotation[props.iconRotation], size[props.size]);
|
|
5466
|
+
|
|
5467
|
+
return _extends({}, allStyles, {
|
|
5468
|
+
// We still want to style any custom SVG element that was
|
|
5469
|
+
// passed to the `Icon` component.
|
|
5470
|
+
svg: _extends({}, allStyles)
|
|
5471
|
+
});
|
|
5472
|
+
},
|
|
5473
|
+
variants: {
|
|
5474
|
+
"default": {},
|
|
5475
|
+
breadcrumbs: {
|
|
5476
|
+
fill: "var(--ui-white)",
|
|
5477
|
+
display: {
|
|
5478
|
+
md: "none"
|
|
5479
|
+
}
|
|
5480
|
+
}
|
|
5481
|
+
}
|
|
5482
|
+
};
|
|
4266
5483
|
|
|
4267
|
-
var
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
5484
|
+
var Label$1 = {
|
|
5485
|
+
parts: ["helper"],
|
|
5486
|
+
baseStyle: {
|
|
5487
|
+
marginBottom: "xs",
|
|
5488
|
+
alignItems: "baseline",
|
|
5489
|
+
display: "flex",
|
|
5490
|
+
fontWeight: "500",
|
|
5491
|
+
justifyContent: "space-between",
|
|
5492
|
+
fontSize: "14px",
|
|
5493
|
+
helper: {
|
|
5494
|
+
fontWeight: "300",
|
|
5495
|
+
fontSize: "-1"
|
|
5496
|
+
}
|
|
4273
5497
|
}
|
|
4274
5498
|
};
|
|
4275
|
-
var baseStyle$1 = {
|
|
4276
|
-
icon: baseStyleIcon,
|
|
4277
|
-
control: baseStyleControl,
|
|
4278
|
-
label: baseStyleLabel,
|
|
4279
|
-
helper: baseStyleHelper
|
|
4280
|
-
}; // Sticking to "lg" for the default size.
|
|
4281
5499
|
|
|
4282
|
-
var
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
5500
|
+
var variants$1 = {
|
|
5501
|
+
link: {},
|
|
5502
|
+
moreLink: {
|
|
5503
|
+
alignItems: "center",
|
|
5504
|
+
display: "inline-flex",
|
|
5505
|
+
svg: {
|
|
5506
|
+
height: "s",
|
|
5507
|
+
width: "s",
|
|
5508
|
+
textDecoration: "none",
|
|
5509
|
+
fill: "currentColor"
|
|
4289
5510
|
},
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
5511
|
+
_hover: {
|
|
5512
|
+
textDecoration: "underline"
|
|
5513
|
+
}
|
|
5514
|
+
},
|
|
5515
|
+
button: {
|
|
5516
|
+
width: "100px",
|
|
5517
|
+
borderRadius: "2px",
|
|
5518
|
+
lineHeight: "1.5",
|
|
5519
|
+
display: "flex",
|
|
5520
|
+
cursor: "pointer",
|
|
5521
|
+
color: "ui.white",
|
|
5522
|
+
justifyContent: "center",
|
|
5523
|
+
py: "xs",
|
|
5524
|
+
px: "xs",
|
|
5525
|
+
textDecoration: "none",
|
|
5526
|
+
fontWeight: 500,
|
|
5527
|
+
bg: "ui.link.primary",
|
|
5528
|
+
_hover: {
|
|
5529
|
+
color: "ui.white",
|
|
5530
|
+
bg: "ui.link.secondary",
|
|
5531
|
+
textDecoration: "none"
|
|
4293
5532
|
}
|
|
4294
5533
|
}
|
|
4295
5534
|
};
|
|
4296
|
-
var
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
5535
|
+
var Link$1 = {
|
|
5536
|
+
baseStyle: {
|
|
5537
|
+
color: "ui.link.primary",
|
|
5538
|
+
textDecoration: "underline",
|
|
5539
|
+
_hover: {
|
|
5540
|
+
color: "ui.link.secondary"
|
|
5541
|
+
}
|
|
5542
|
+
},
|
|
5543
|
+
variants: variants$1
|
|
4305
5544
|
};
|
|
4306
5545
|
|
|
4307
|
-
// Style object for the Radio's "control" or visual icon.
|
|
4308
5546
|
var baseStyleControl$1 = {
|
|
4309
5547
|
verticalAlign: "middle",
|
|
4310
5548
|
transitionProperty: "box-shadow",
|
|
@@ -4328,11 +5566,11 @@ var baseStyleControl$1 = {
|
|
|
4328
5566
|
},
|
|
4329
5567
|
_invalid: {
|
|
4330
5568
|
_hover: {
|
|
4331
|
-
borderColor: "ui.error"
|
|
5569
|
+
borderColor: "ui.error.primary"
|
|
4332
5570
|
},
|
|
4333
5571
|
_before: {
|
|
4334
|
-
borderColor: "ui.error",
|
|
4335
|
-
bg: "ui.error"
|
|
5572
|
+
borderColor: "ui.error.primary",
|
|
5573
|
+
bg: "ui.error.primary"
|
|
4336
5574
|
}
|
|
4337
5575
|
},
|
|
4338
5576
|
_hover: {
|
|
@@ -4341,8 +5579,8 @@ var baseStyleControl$1 = {
|
|
|
4341
5579
|
_before: {
|
|
4342
5580
|
content: "\"\"",
|
|
4343
5581
|
display: "block",
|
|
4344
|
-
w: 3,
|
|
4345
|
-
h: 3,
|
|
5582
|
+
w: "3",
|
|
5583
|
+
h: "3",
|
|
4346
5584
|
borderRadius: "100%",
|
|
4347
5585
|
bg: "ui.focus"
|
|
4348
5586
|
}
|
|
@@ -4356,51 +5594,30 @@ var baseStyleControl$1 = {
|
|
|
4356
5594
|
borderColor: "ui.focus"
|
|
4357
5595
|
},
|
|
4358
5596
|
_invalid: {
|
|
4359
|
-
borderColor: "ui.error"
|
|
5597
|
+
borderColor: "ui.error.primary"
|
|
4360
5598
|
}
|
|
4361
5599
|
}; // Style object for the Radio's label
|
|
4362
5600
|
|
|
4363
|
-
var baseStyleLabel$1 = {
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
marginLeft: 2,
|
|
4369
|
-
verticalAlign: "middle",
|
|
4370
|
-
_disabled: {
|
|
4371
|
-
color: "ui.gray.dark",
|
|
4372
|
-
opacity: 1,
|
|
4373
|
-
fontStyle: "italic"
|
|
4374
|
-
},
|
|
4375
|
-
_invalid: {
|
|
4376
|
-
color: "ui.error"
|
|
4377
|
-
}
|
|
4378
|
-
};
|
|
5601
|
+
var baseStyleLabel$1 = /*#__PURE__*/_extends({}, checkboxRadioLabelStyles); // Style object for the Radio's helper text
|
|
5602
|
+
|
|
5603
|
+
|
|
5604
|
+
var baseStyleHelper$1 = /*#__PURE__*/_extends({}, checkboxRadioHelperStyle);
|
|
5605
|
+
|
|
4379
5606
|
var baseStyle$2 = {
|
|
4380
5607
|
// Chakra-inserted elements in the Chakra Radio component
|
|
4381
5608
|
control: baseStyleControl$1,
|
|
4382
5609
|
label: baseStyleLabel$1,
|
|
4383
5610
|
// Custom element in the DS Radio component.
|
|
4384
|
-
helper:
|
|
4385
|
-
marginTop: 2,
|
|
4386
|
-
marginBottom: 0,
|
|
4387
|
-
marginLeft: "30px",
|
|
4388
|
-
_disabled: {
|
|
4389
|
-
fontStyle: "italic"
|
|
4390
|
-
}
|
|
4391
|
-
}
|
|
5611
|
+
helper: baseStyleHelper$1
|
|
4392
5612
|
}; // Sticking to "md" for the default size.
|
|
4393
5613
|
|
|
4394
5614
|
var sizes$2 = {
|
|
4395
5615
|
md: {
|
|
4396
|
-
control: {
|
|
4397
|
-
// Custom values not in the spacing theme.
|
|
4398
|
-
h: "1.375rem",
|
|
4399
|
-
w: "1.375rem"
|
|
4400
|
-
}
|
|
5616
|
+
control: /*#__PURE__*/_extends({}, checkboxRadioControlSize)
|
|
4401
5617
|
}
|
|
4402
5618
|
};
|
|
4403
5619
|
var Radio$1 = {
|
|
5620
|
+
parts: ["control", "label", "helper"],
|
|
4404
5621
|
baseStyle: baseStyle$2,
|
|
4405
5622
|
sizes: sizes$2,
|
|
4406
5623
|
// Default values
|
|
@@ -4409,171 +5626,343 @@ var Radio$1 = {
|
|
|
4409
5626
|
}
|
|
4410
5627
|
};
|
|
4411
5628
|
|
|
4412
|
-
var
|
|
4413
|
-
parts: ["
|
|
5629
|
+
var SearchBar$1 = {
|
|
5630
|
+
parts: ["topRow"],
|
|
5631
|
+
baseStyle: {
|
|
5632
|
+
topRow: {
|
|
5633
|
+
display: "flex",
|
|
5634
|
+
marginBottom: {
|
|
5635
|
+
base: "xs",
|
|
5636
|
+
md: "auto"
|
|
5637
|
+
},
|
|
5638
|
+
flexFlow: {
|
|
5639
|
+
base: "column nowrap",
|
|
5640
|
+
md: "row nowrap"
|
|
5641
|
+
}
|
|
5642
|
+
},
|
|
5643
|
+
button: {
|
|
5644
|
+
marginBottom: "auto"
|
|
5645
|
+
}
|
|
5646
|
+
}
|
|
5647
|
+
};
|
|
5648
|
+
|
|
5649
|
+
var StatusBadge$1 = {
|
|
4414
5650
|
baseStyle: {
|
|
4415
|
-
|
|
4416
|
-
|
|
5651
|
+
// Temporary until NYPL-theme radius values are configured.
|
|
5652
|
+
borderRadius: "4px",
|
|
5653
|
+
color: "ui.black",
|
|
5654
|
+
display: "block",
|
|
5655
|
+
fontSize: "-1",
|
|
5656
|
+
fontStyle: "italic",
|
|
5657
|
+
py: "xxs",
|
|
5658
|
+
px: "xs",
|
|
5659
|
+
textAlign: "center",
|
|
5660
|
+
width: "fit-content"
|
|
5661
|
+
},
|
|
5662
|
+
variants: {
|
|
5663
|
+
low: {
|
|
5664
|
+
bg: "ui.gray.light-cool"
|
|
4417
5665
|
},
|
|
4418
|
-
|
|
4419
|
-
|
|
5666
|
+
medium: {
|
|
5667
|
+
bg: "ui.status.primary"
|
|
4420
5668
|
},
|
|
4421
|
-
|
|
4422
|
-
|
|
5669
|
+
high: {
|
|
5670
|
+
bg: "ui.status.secondary"
|
|
4423
5671
|
}
|
|
5672
|
+
}
|
|
5673
|
+
};
|
|
5674
|
+
|
|
5675
|
+
var tab = {
|
|
5676
|
+
color: "black !important",
|
|
5677
|
+
paddingInlineStart: "4",
|
|
5678
|
+
paddingLeft: "4",
|
|
5679
|
+
background: "transparent",
|
|
5680
|
+
border: "0",
|
|
5681
|
+
borderBottom: "1px solid",
|
|
5682
|
+
borderColor: "red",
|
|
5683
|
+
marginRight: {
|
|
5684
|
+
base: "0",
|
|
5685
|
+
md: "1px"
|
|
5686
|
+
},
|
|
5687
|
+
paddingRight: {
|
|
5688
|
+
base: "4",
|
|
5689
|
+
md: "8",
|
|
5690
|
+
lg: "12"
|
|
5691
|
+
},
|
|
5692
|
+
whiteSpace: "nowrap",
|
|
5693
|
+
_hover: {
|
|
5694
|
+
bg: "ui.gray.x-light-warm",
|
|
5695
|
+
borderTopRadius: "2",
|
|
5696
|
+
borderBottom: "1px solid",
|
|
5697
|
+
borderBottomColor: "ui.black"
|
|
5698
|
+
},
|
|
5699
|
+
_selected: {
|
|
5700
|
+
fontWeight: "bold",
|
|
5701
|
+
bg: "ui.gray.light-warm",
|
|
5702
|
+
border: "0",
|
|
5703
|
+
borderTopRadius: "2",
|
|
5704
|
+
borderBottom: "3px solid",
|
|
5705
|
+
borderBottomColor: "ui.black",
|
|
5706
|
+
paddingBottom: "5px"
|
|
5707
|
+
},
|
|
5708
|
+
_focus: {
|
|
5709
|
+
boxShadow: "0"
|
|
5710
|
+
}
|
|
5711
|
+
}; // Only display the previous/next arrow buttons on mobile.
|
|
5712
|
+
|
|
5713
|
+
var buttonArrows = {
|
|
5714
|
+
border: "0",
|
|
5715
|
+
display: {
|
|
5716
|
+
// "inline-block" - hiding until the full "arrow" functionality is built out
|
|
5717
|
+
base: "none",
|
|
5718
|
+
// After 38em/600px, don't display the arrow button anymore.
|
|
5719
|
+
md: "none"
|
|
5720
|
+
},
|
|
5721
|
+
height: "44px",
|
|
5722
|
+
width: "44px !important"
|
|
5723
|
+
}; // Styles to better align the mobile arrow buttons with the tablist.
|
|
5724
|
+
|
|
5725
|
+
var tablistWrapper = {
|
|
5726
|
+
display: "flex",
|
|
5727
|
+
alignItems: "center",
|
|
5728
|
+
borderBottom: {
|
|
5729
|
+
base: "0",
|
|
5730
|
+
md: "1px solid black"
|
|
5731
|
+
},
|
|
5732
|
+
margin: {
|
|
5733
|
+
base: "-4px",
|
|
5734
|
+
md: "0"
|
|
5735
|
+
},
|
|
5736
|
+
overflowX: {
|
|
5737
|
+
base: "auto",
|
|
5738
|
+
md: "visible"
|
|
5739
|
+
},
|
|
5740
|
+
paddingBottom: {
|
|
5741
|
+
base: "5px",
|
|
5742
|
+
md: "0"
|
|
5743
|
+
},
|
|
5744
|
+
paddingLeft: {
|
|
5745
|
+
base: "xxs",
|
|
5746
|
+
md: "0"
|
|
5747
|
+
},
|
|
5748
|
+
paddingRight: {
|
|
5749
|
+
base: "xxs",
|
|
5750
|
+
md: "0"
|
|
5751
|
+
},
|
|
5752
|
+
paddingTop: {
|
|
5753
|
+
base: "xxs",
|
|
5754
|
+
md: "0"
|
|
5755
|
+
}
|
|
5756
|
+
};
|
|
5757
|
+
var CustomTabs = {
|
|
5758
|
+
parts: ["tab", "buttonArrows", "tablistWrapper"],
|
|
5759
|
+
baseStyle: {
|
|
5760
|
+
tab: tab,
|
|
5761
|
+
buttonArrows: buttonArrows,
|
|
5762
|
+
tablistWrapper: tablistWrapper
|
|
4424
5763
|
},
|
|
4425
|
-
sizes: {},
|
|
4426
5764
|
defaultProps: {}
|
|
4427
5765
|
};
|
|
4428
5766
|
|
|
4429
|
-
|
|
5767
|
+
// From @mixin breakout:
|
|
5768
|
+
// Used for elements that should be edge-to-edge.
|
|
5769
|
+
var breakout = {
|
|
5770
|
+
marginLeft: "calc(-50vw + 50%)",
|
|
5771
|
+
marginRight: "calc(-50vw + 50%)"
|
|
5772
|
+
}; // From the `wrapper` SCSS mixin.
|
|
5773
|
+
// TODO: Eventually we may be able to put shared JS style objects
|
|
5774
|
+
// into a utils file for other mixins that are shared.
|
|
5775
|
+
|
|
5776
|
+
var wrapperStyles$1 = {
|
|
5777
|
+
marginY: 0,
|
|
5778
|
+
marginX: "auto",
|
|
5779
|
+
maxWidth: "1280px",
|
|
5780
|
+
paddingTop: 0,
|
|
5781
|
+
paddingBottom: 0,
|
|
5782
|
+
paddingRight: 0,
|
|
5783
|
+
paddingLeft: 0,
|
|
5784
|
+
width: "100%"
|
|
5785
|
+
};
|
|
5786
|
+
var Template$1 = {
|
|
4430
5787
|
baseStyle: {
|
|
4431
|
-
|
|
5788
|
+
boxSizing: "border-box",
|
|
5789
|
+
color: "ui.black",
|
|
5790
|
+
// Users with non-overlay scrollbars have a small horizontal scrollbar from
|
|
5791
|
+
// our breakout mixin. Fix identified here: https://cloudfour.com/thinks/breaking-out-with-viewport-units-and-calc/#one-big-dumb-caveat
|
|
5792
|
+
overflowX: "hidden",
|
|
5793
|
+
"*": {
|
|
5794
|
+
boxSizing: "inherit"
|
|
4432
5795
|
},
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
5796
|
+
"*::after": {
|
|
5797
|
+
boxSizing: "inherit"
|
|
5798
|
+
},
|
|
5799
|
+
"*::before": {
|
|
5800
|
+
boxSizing: "inherit"
|
|
5801
|
+
}
|
|
5802
|
+
},
|
|
5803
|
+
sizes: {},
|
|
5804
|
+
defaultProps: {}
|
|
5805
|
+
};
|
|
5806
|
+
var TemplateHeader$1 = {
|
|
5807
|
+
baseStyle: {
|
|
5808
|
+
marginBottom: 8
|
|
5809
|
+
}
|
|
5810
|
+
};
|
|
5811
|
+
var TemplateBreakout$1 = {
|
|
5812
|
+
baseStyle: /*#__PURE__*/_extends({}, breakout, {
|
|
5813
|
+
width: "100vw",
|
|
5814
|
+
marginBottom: 8
|
|
5815
|
+
})
|
|
5816
|
+
};
|
|
5817
|
+
var TemplateContent$1 = {
|
|
5818
|
+
baseStyle: /*#__PURE__*/_extends({}, wrapperStyles$1, {
|
|
5819
|
+
display: "block",
|
|
5820
|
+
marginBottom: 8
|
|
5821
|
+
}),
|
|
5822
|
+
variants: {
|
|
5823
|
+
sidebar: {
|
|
5824
|
+
display: "flex",
|
|
5825
|
+
flexFlow: {
|
|
5826
|
+
base: "column nowrap",
|
|
5827
|
+
md: "row wrap"
|
|
5828
|
+
}
|
|
5829
|
+
}
|
|
5830
|
+
}
|
|
5831
|
+
};
|
|
5832
|
+
var TemplateContentTop$1 = {
|
|
5833
|
+
baseStyle: {
|
|
5834
|
+
flex: "1 0 100%",
|
|
5835
|
+
marginBottom: 8
|
|
5836
|
+
}
|
|
5837
|
+
};
|
|
5838
|
+
var TemplateContentPrimary$1 = {
|
|
5839
|
+
baseStyle: {
|
|
5840
|
+
flex: "1 1",
|
|
5841
|
+
marginBottom: 8
|
|
5842
|
+
},
|
|
5843
|
+
variants: {
|
|
5844
|
+
left: {
|
|
5845
|
+
display: "flex",
|
|
5846
|
+
flexFlow: "column nowrap",
|
|
5847
|
+
order: "1",
|
|
4441
5848
|
marginRight: {
|
|
4442
|
-
|
|
4443
|
-
md: "1px"
|
|
4444
|
-
},
|
|
4445
|
-
paddingRight: {
|
|
4446
|
-
base: 4,
|
|
4447
|
-
md: 8,
|
|
4448
|
-
lg: 12
|
|
4449
|
-
},
|
|
4450
|
-
whiteSpace: "nowrap",
|
|
4451
|
-
_hover: {
|
|
4452
|
-
bg: "ui.gray.warm-xlight",
|
|
4453
|
-
borderTopRadius: 2,
|
|
4454
|
-
borderBottom: "1px solid",
|
|
4455
|
-
borderBottomColor: "ui.black"
|
|
4456
|
-
},
|
|
4457
|
-
_selected: {
|
|
4458
|
-
fontWeight: "bold",
|
|
4459
|
-
bg: "ui.gray.warm-light",
|
|
4460
|
-
border: "0",
|
|
4461
|
-
borderTopRadius: 2,
|
|
4462
|
-
borderBottom: "3px solid",
|
|
4463
|
-
borderBottomColor: "ui.black",
|
|
4464
|
-
paddingBottom: "5px"
|
|
5849
|
+
md: 0
|
|
4465
5850
|
},
|
|
4466
|
-
|
|
4467
|
-
|
|
5851
|
+
minWidth: {
|
|
5852
|
+
md: 0
|
|
4468
5853
|
}
|
|
5854
|
+
}
|
|
5855
|
+
}
|
|
5856
|
+
};
|
|
5857
|
+
var TemplateContentSidebar$1 = {
|
|
5858
|
+
baseStyle: {
|
|
5859
|
+
flex: "0 0 255px",
|
|
5860
|
+
order: {
|
|
5861
|
+
md: "1"
|
|
4469
5862
|
},
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
md:
|
|
4477
|
-
}
|
|
4478
|
-
height: "44px",
|
|
4479
|
-
width: "44px !important"
|
|
5863
|
+
marginBottom: 8
|
|
5864
|
+
},
|
|
5865
|
+
variants: {
|
|
5866
|
+
left: {
|
|
5867
|
+
marginRight: {
|
|
5868
|
+
base: 0,
|
|
5869
|
+
md: 12
|
|
5870
|
+
}
|
|
4480
5871
|
},
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
borderBottom: {
|
|
4486
|
-
base: "0",
|
|
4487
|
-
md: "1px solid black"
|
|
4488
|
-
},
|
|
4489
|
-
margin: {
|
|
4490
|
-
base: "-4px",
|
|
4491
|
-
md: "0"
|
|
4492
|
-
},
|
|
4493
|
-
overflowX: {
|
|
4494
|
-
base: "auto",
|
|
4495
|
-
md: "visible"
|
|
4496
|
-
},
|
|
4497
|
-
paddingBottom: {
|
|
4498
|
-
base: "5px",
|
|
4499
|
-
md: "0"
|
|
4500
|
-
},
|
|
4501
|
-
paddingLeft: {
|
|
4502
|
-
base: "4px",
|
|
4503
|
-
md: "0"
|
|
4504
|
-
},
|
|
4505
|
-
paddingRight: {
|
|
4506
|
-
base: "4px",
|
|
4507
|
-
md: "0"
|
|
4508
|
-
},
|
|
4509
|
-
paddingTop: {
|
|
4510
|
-
base: "4px",
|
|
4511
|
-
md: "0"
|
|
5872
|
+
right: {
|
|
5873
|
+
marginLeft: {
|
|
5874
|
+
base: 0,
|
|
5875
|
+
md: 12
|
|
4512
5876
|
}
|
|
4513
5877
|
}
|
|
4514
|
-
}
|
|
4515
|
-
|
|
5878
|
+
}
|
|
5879
|
+
};
|
|
5880
|
+
var TemplateStyles = {
|
|
5881
|
+
Template: Template$1,
|
|
5882
|
+
TemplateHeader: TemplateHeader$1,
|
|
5883
|
+
TemplateBreakout: TemplateBreakout$1,
|
|
5884
|
+
TemplateContent: TemplateContent$1,
|
|
5885
|
+
TemplateContentTop: TemplateContentTop$1,
|
|
5886
|
+
TemplateContentPrimary: TemplateContentPrimary$1,
|
|
5887
|
+
TemplateContentSidebar: TemplateContentSidebar$1
|
|
4516
5888
|
};
|
|
4517
5889
|
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
fontSize: "
|
|
4522
|
-
fontWeight: "light",
|
|
4523
|
-
letterSpacing: "0",
|
|
4524
|
-
lineHeight: "1.1",
|
|
4525
|
-
margin: "0 0 0.5em",
|
|
4526
|
-
width: "auto"
|
|
5890
|
+
var variants$2 = {
|
|
5891
|
+
"default": {},
|
|
5892
|
+
caption: {
|
|
5893
|
+
fontSize: "-1"
|
|
4527
5894
|
},
|
|
4528
|
-
|
|
4529
|
-
fontSize: "
|
|
4530
|
-
fontWeight: "medium",
|
|
4531
|
-
lineHeight: "1.25",
|
|
4532
|
-
margin: "0 0 0.5em",
|
|
4533
|
-
width: "auto"
|
|
5895
|
+
tag: {
|
|
5896
|
+
fontSize: "-2"
|
|
4534
5897
|
},
|
|
4535
|
-
|
|
4536
|
-
fontSize: "
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
5898
|
+
mini: {
|
|
5899
|
+
fontSize: "-3"
|
|
5900
|
+
}
|
|
5901
|
+
};
|
|
5902
|
+
var Text$1 = {
|
|
5903
|
+
baseStyle: function baseStyle(props) {
|
|
5904
|
+
var fontWeight = props.isBold ? "bold" : props.variant === "tag" || props.variant === "min" ? "regular" : null;
|
|
5905
|
+
var fontStyle = props.isItalic ? "italic" : null;
|
|
5906
|
+
return {
|
|
5907
|
+
fontStyle: fontStyle,
|
|
5908
|
+
fontWeight: fontWeight,
|
|
5909
|
+
marginBottom: props.noSpace ? "0 !important" : null
|
|
5910
|
+
};
|
|
4541
5911
|
},
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
5912
|
+
variants: variants$2
|
|
5913
|
+
};
|
|
5914
|
+
|
|
5915
|
+
var input = {
|
|
5916
|
+
border: "1px solid",
|
|
5917
|
+
borderColor: "ui.gray.medium",
|
|
5918
|
+
borderRadius: "2px",
|
|
5919
|
+
py: "xs",
|
|
5920
|
+
px: "s",
|
|
5921
|
+
_hover: {
|
|
5922
|
+
borderColor: "ui.gray.dark"
|
|
4548
5923
|
},
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
5924
|
+
_disabled: {
|
|
5925
|
+
bgColor: "ui.gray.xx-light-cool",
|
|
5926
|
+
color: "ui.gray.xdark",
|
|
5927
|
+
opacity: "1"
|
|
5928
|
+
},
|
|
5929
|
+
_active: activeFocus,
|
|
5930
|
+
_focus: activeFocus,
|
|
5931
|
+
_placeholder: {
|
|
5932
|
+
color: "ui.gray.dark",
|
|
5933
|
+
fontStyle: "italic",
|
|
5934
|
+
lineHeight: "21px"
|
|
5935
|
+
},
|
|
5936
|
+
_invalid: {
|
|
5937
|
+
border: "1px solid",
|
|
5938
|
+
borderColor: "ui.error.primary",
|
|
5939
|
+
boxShadow: "none"
|
|
4555
5940
|
}
|
|
4556
|
-
}; // styles for different visual variants:
|
|
4557
|
-
// primary, secondary, tertiary, callout
|
|
4558
|
-
|
|
4559
|
-
var variants$1 = {
|
|
4560
|
-
h1: headings.h1,
|
|
4561
|
-
h2: headings.h2,
|
|
4562
|
-
h3: headings.h3,
|
|
4563
|
-
h4: headings.h4,
|
|
4564
|
-
h5: headings.fallback,
|
|
4565
|
-
h6: headings.fallback,
|
|
4566
|
-
primary: headings.h1,
|
|
4567
|
-
secondary: headings.h2,
|
|
4568
|
-
tertiary: headings.h3,
|
|
4569
|
-
callout: headings.h4
|
|
4570
5941
|
};
|
|
4571
|
-
var
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
5942
|
+
var TextInput$1 = {
|
|
5943
|
+
parts: ["helper", "input", "textarea"],
|
|
5944
|
+
baseStyle: {
|
|
5945
|
+
marginBottom: "xs",
|
|
5946
|
+
helper: /*#__PURE__*/_extends({}, helperTextMargin),
|
|
5947
|
+
input: input,
|
|
5948
|
+
textarea: /*#__PURE__*/_extends({}, input, {
|
|
5949
|
+
lineheight: "1.5",
|
|
5950
|
+
minHeight: "xxl"
|
|
5951
|
+
})
|
|
5952
|
+
},
|
|
5953
|
+
variants: {
|
|
5954
|
+
searchBar: {
|
|
5955
|
+
flex: "1 1 80%",
|
|
5956
|
+
input: {
|
|
5957
|
+
borderRightRadius: "0"
|
|
5958
|
+
}
|
|
5959
|
+
},
|
|
5960
|
+
searchBarSelect: {
|
|
5961
|
+
flex: "1 1 80%",
|
|
5962
|
+
input: {
|
|
5963
|
+
borderRadius: "0"
|
|
5964
|
+
}
|
|
5965
|
+
}
|
|
4577
5966
|
}
|
|
4578
5967
|
};
|
|
4579
5968
|
|
|
@@ -4601,22 +5990,35 @@ var theme = /*#__PURE__*/react.extendTheme( /*#__PURE__*/_extends({
|
|
|
4601
5990
|
global: global
|
|
4602
5991
|
},
|
|
4603
5992
|
breakpoints: breakpoints,
|
|
4604
|
-
colors: colors
|
|
5993
|
+
colors: colors,
|
|
5994
|
+
shadows: shadows,
|
|
5995
|
+
space: spacing
|
|
4605
5996
|
}, typography, {
|
|
4606
|
-
space: spacing,
|
|
4607
|
-
|
|
4608
5997
|
/**
|
|
4609
5998
|
* Chakra documentation on component styles:
|
|
4610
5999
|
* https://chakra-ui.com/docs/theming/component-style
|
|
4611
6000
|
*/
|
|
4612
|
-
components: {
|
|
6001
|
+
components: /*#__PURE__*/_extends({
|
|
6002
|
+
Accordion: Accordion$1,
|
|
6003
|
+
Breadcrumb: Breadcrumb,
|
|
4613
6004
|
Button: Button$1,
|
|
4614
6005
|
Checkbox: Checkbox$1,
|
|
6006
|
+
CustomCheckboxGroup: CustomCheckboxGroup,
|
|
6007
|
+
CustomRadioGroup: CustomRadioGroup,
|
|
6008
|
+
CustomSelect: Select$1,
|
|
4615
6009
|
Heading: Heading$1,
|
|
6010
|
+
Hero: Hero$1,
|
|
6011
|
+
Icon: Icon$1,
|
|
6012
|
+
Label: Label$1,
|
|
6013
|
+
Link: Link$1,
|
|
4616
6014
|
Radio: Radio$1,
|
|
4617
|
-
|
|
6015
|
+
SearchBar: SearchBar$1,
|
|
6016
|
+
StatusBadge: StatusBadge$1,
|
|
4618
6017
|
Tabs: CustomTabs
|
|
4619
|
-
}
|
|
6018
|
+
}, TemplateStyles, {
|
|
6019
|
+
Text: Text$1,
|
|
6020
|
+
TextInput: TextInput$1
|
|
6021
|
+
})
|
|
4620
6022
|
}));
|
|
4621
6023
|
|
|
4622
6024
|
var DSProvider = function DSProvider(_ref) {
|
|
@@ -4650,6 +6052,18 @@ Object.defineProperty(exports, 'Circle', {
|
|
|
4650
6052
|
return react.Circle;
|
|
4651
6053
|
}
|
|
4652
6054
|
});
|
|
6055
|
+
Object.defineProperty(exports, 'Grid', {
|
|
6056
|
+
enumerable: true,
|
|
6057
|
+
get: function () {
|
|
6058
|
+
return react.Grid;
|
|
6059
|
+
}
|
|
6060
|
+
});
|
|
6061
|
+
Object.defineProperty(exports, 'GridItem', {
|
|
6062
|
+
enumerable: true,
|
|
6063
|
+
get: function () {
|
|
6064
|
+
return react.GridItem;
|
|
6065
|
+
}
|
|
6066
|
+
});
|
|
4653
6067
|
Object.defineProperty(exports, 'HStack', {
|
|
4654
6068
|
enumerable: true,
|
|
4655
6069
|
get: function () {
|
|
@@ -4707,11 +6121,13 @@ exports.CardContent = CardContent;
|
|
|
4707
6121
|
exports.CardEdition = CardEdition;
|
|
4708
6122
|
exports.CardHeading = CardHeading;
|
|
4709
6123
|
exports.Checkbox = Checkbox;
|
|
6124
|
+
exports.CheckboxGroup = CheckboxGroup;
|
|
4710
6125
|
exports.DSProvider = DSProvider;
|
|
4711
6126
|
exports.DatePicker = DatePicker;
|
|
4712
6127
|
exports.Form = Form;
|
|
4713
6128
|
exports.FormField = FormField;
|
|
4714
6129
|
exports.FormRow = FormRow;
|
|
6130
|
+
exports.FormSpacing = exports.GridGaps;
|
|
4715
6131
|
exports.Heading = Heading;
|
|
4716
6132
|
exports.HelperErrorText = HelperErrorText;
|
|
4717
6133
|
exports.Hero = Hero;
|
|
@@ -4731,9 +6147,20 @@ exports.Radio = Radio;
|
|
|
4731
6147
|
exports.RadioGroup = RadioGroup;
|
|
4732
6148
|
exports.SearchBar = SearchBar;
|
|
4733
6149
|
exports.Select = Select;
|
|
6150
|
+
exports.SimpleGrid = SimpleGrid;
|
|
4734
6151
|
exports.SkeletonLoader = SkeletonLoader;
|
|
4735
6152
|
exports.StatusBadge = StatusBadge;
|
|
4736
6153
|
exports.Tabs = Tabs;
|
|
6154
|
+
exports.Template = Template;
|
|
6155
|
+
exports.TemplateAppContainer = TemplateAppContainer;
|
|
6156
|
+
exports.TemplateBreakout = TemplateBreakout;
|
|
6157
|
+
exports.TemplateContent = TemplateContent;
|
|
6158
|
+
exports.TemplateContentPrimary = TemplateContentPrimary;
|
|
6159
|
+
exports.TemplateContentSidebar = TemplateContentSidebar;
|
|
6160
|
+
exports.TemplateContentTop = TemplateContentTop;
|
|
6161
|
+
exports.TemplateFooter = TemplateFooter;
|
|
6162
|
+
exports.TemplateHeader = TemplateHeader;
|
|
6163
|
+
exports.Text = Text;
|
|
4737
6164
|
exports.TextInput = TextInput;
|
|
4738
6165
|
exports.VideoPlayer = VideoPlayer;
|
|
4739
6166
|
//# sourceMappingURL=design-system-react-components.cjs.development.js.map
|