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