@nypl/design-system-react-components 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/dist/components/Button/Button.d.ts +2 -10
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +22 -0
- package/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +10 -8
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +2 -2
- package/dist/components/Grid/SimpleGrid.d.ts +6 -3
- package/dist/components/Heading/Heading.d.ts +2 -5
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +1 -5
- package/dist/components/Hero/Hero.d.ts +13 -9
- package/dist/components/Icons/Icon.d.ts +6 -5
- package/dist/components/Icons/IconSvgs.d.ts +21 -21
- package/dist/components/Image/Image.d.ts +8 -5
- package/dist/components/Link/Link.d.ts +1 -9
- package/dist/components/List/List.d.ts +7 -11
- package/dist/components/Logo/Logo.d.ts +2 -5
- package/dist/components/Logo/LogoSvgs.d.ts +39 -39
- package/dist/components/Notification/Notification.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +2 -5
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -4
- package/dist/components/SkipNavigation/SkipNavigation.d.ts +17 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +2 -3
- package/dist/components/StructuredContent/StructuredContent.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Template/Template.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +21 -9
- package/dist/components/Toggle/Toggle.d.ts +1 -5
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +856 -1155
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +858 -1220
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/helpers/types.d.ts +1 -0
- package/dist/index.d.ts +26 -47
- package/dist/theme/components/buttonGroup.d.ts +11 -0
- package/dist/theme/components/card.d.ts +104 -8
- package/dist/theme/components/componentWrapper.d.ts +4 -3
- package/dist/theme/components/customTable.d.ts +11 -14
- package/dist/theme/components/fieldset.d.ts +4 -3
- package/dist/theme/components/helperErrorText.d.ts +4 -3
- package/dist/theme/components/hero.d.ts +1 -1
- package/dist/theme/components/horizontalRule.d.ts +4 -3
- package/dist/theme/components/icon.d.ts +47743 -1
- package/dist/theme/components/image.d.ts +563 -10
- package/dist/theme/components/label.d.ts +4 -3
- package/dist/theme/components/list.d.ts +6 -7
- package/dist/theme/components/logo.d.ts +474 -1
- package/dist/theme/components/notification.d.ts +20 -16
- package/dist/theme/components/progressIndicator.d.ts +6 -4
- package/dist/theme/components/select.d.ts +4 -4
- package/dist/theme/components/skeletonLoader.d.ts +14 -10
- package/dist/theme/components/skipNavigation.d.ts +22 -0
- package/dist/theme/components/slider.d.ts +7 -6
- package/dist/theme/components/structuredContent.d.ts +10 -9
- package/dist/theme/components/text.d.ts +7 -1
- package/dist/theme/components/toggle.d.ts +6 -4
- package/dist/theme/provider.d.ts +2 -4
- package/dist/utils/componentCategories.d.ts +1 -1
- package/dist/utils/interfaces.d.ts +5 -0
- package/dist/utils/utils.d.ts +2 -18
- package/package.json +2 -2
- package/src/__tests__/setup.ts +3 -3
- package/src/__tests__/utils/utils.test.ts +1 -23
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +22 -14
- package/src/components/Accordion/Accordion.stories.mdx +43 -44
- package/src/components/Accordion/Accordion.test.tsx +5 -13
- package/src/components/Accordion/Accordion.tsx +14 -18
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +6 -6
- package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
- package/src/components/Autosuggest/Autosuggest.stories.tsx +23 -25
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +21 -37
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +4 -17
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +18 -21
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +1 -100
- package/src/components/Button/Button.stories.mdx +89 -126
- package/src/components/Button/Button.test.tsx +16 -30
- package/src/components/Button/Button.tsx +14 -20
- package/src/components/ButtonGroup/ButtonGroup.stories.mdx +147 -0
- package/src/components/ButtonGroup/ButtonGroup.test.tsx +141 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +99 -0
- package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +117 -0
- package/src/components/Card/Card.stories.mdx +143 -177
- package/src/components/Card/Card.test.tsx +36 -97
- package/src/components/Card/Card.tsx +78 -74
- package/src/components/Chakra/Box.stories.mdx +2 -6
- package/src/components/Chakra/Center.stories.mdx +5 -23
- package/src/components/Chakra/Flex.stories.mdx +4 -6
- package/src/components/Chakra/Stack.stories.mdx +9 -10
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +20 -13
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +6 -17
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -7
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +33 -29
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +0 -11
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +3 -10
- package/src/components/DatePicker/DatePicker.stories.mdx +23 -37
- package/src/components/DatePicker/DatePicker.test.tsx +21 -19
- package/src/components/DatePicker/DatePicker.tsx +57 -49
- package/src/components/Form/Form.stories.mdx +46 -31
- package/src/components/Form/Form.test.tsx +1 -18
- package/src/components/Form/Form.tsx +7 -7
- package/src/components/Grid/SimpleGrid.stories.mdx +73 -49
- package/src/components/Grid/SimpleGrid.test.tsx +7 -9
- package/src/components/Grid/SimpleGrid.tsx +14 -11
- package/src/components/Heading/Heading.stories.mdx +27 -72
- package/src/components/Heading/Heading.test.tsx +18 -44
- package/src/components/Heading/Heading.tsx +7 -10
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -3
- package/src/components/HelperErrorText/HelperErrorText.tsx +1 -5
- package/src/components/Hero/Hero.stories.mdx +219 -216
- package/src/components/Hero/Hero.test.tsx +107 -223
- package/src/components/Hero/Hero.tsx +63 -61
- package/src/components/Icons/Icon.stories.mdx +172 -118
- package/src/components/Icons/Icon.test.tsx +8 -16
- package/src/components/Icons/Icon.tsx +75 -29
- package/src/components/Icons/IconSvgs.tsx +42 -42
- package/src/components/Image/Image.stories.mdx +45 -132
- package/src/components/Image/Image.test.tsx +16 -31
- package/src/components/Image/Image.tsx +28 -12
- package/src/components/Link/Link.stories.mdx +30 -80
- package/src/components/Link/Link.test.tsx +25 -53
- package/src/components/Link/Link.tsx +43 -56
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +1 -2
- package/src/components/List/List.stories.mdx +20 -31
- package/src/components/List/List.test.tsx +24 -43
- package/src/components/List/List.tsx +25 -36
- package/src/components/Logo/Logo.stories.mdx +94 -50
- package/src/components/Logo/Logo.test.tsx +10 -19
- package/src/components/Logo/Logo.tsx +50 -17
- package/src/components/Logo/LogoSvgs.tsx +78 -78
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +4 -4
- package/src/components/Modal/Modal.stories.mdx +8 -9
- package/src/components/Modal/Modal.test.tsx +5 -10
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Notification/Notification.stories.mdx +10 -28
- package/src/components/Notification/Notification.test.tsx +9 -12
- package/src/components/Notification/Notification.tsx +34 -37
- package/src/components/Pagination/Pagination.stories.mdx +2 -2
- package/src/components/Pagination/Pagination.tsx +15 -10
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +27 -53
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +9 -10
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +17 -21
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +0 -10
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/Radio/Radio.tsx +9 -6
- package/src/components/RadioGroup/RadioGroup.stories.mdx +15 -16
- package/src/components/RadioGroup/RadioGroup.test.tsx +2 -8
- package/src/components/RadioGroup/RadioGroup.tsx +28 -24
- package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
- package/src/components/SearchBar/SearchBar.test.tsx +1 -1
- package/src/components/SearchBar/SearchBar.tsx +14 -22
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +0 -12
- package/src/components/Select/Select.stories.mdx +8 -23
- package/src/components/Select/Select.test.tsx +6 -7
- package/src/components/Select/Select.tsx +13 -26
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +17 -56
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -21
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +9 -8
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +33 -33
- package/src/components/SkipNavigation/SkipNavigation.stories.mdx +90 -0
- package/src/components/SkipNavigation/SkipNavigation.test.tsx +63 -0
- package/src/components/SkipNavigation/SkipNavigation.tsx +51 -0
- package/src/components/SkipNavigation/__snapshots__/SkipNavigation.test.tsx.snap +130 -0
- package/src/components/Slider/Slider.stories.mdx +19 -53
- package/src/components/Slider/Slider.test.tsx +2 -2
- package/src/components/Slider/Slider.tsx +10 -12
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +2 -9
- package/src/components/StatusBadge/StatusBadge.stories.mdx +6 -21
- package/src/components/StatusBadge/StatusBadge.test.tsx +2 -3
- package/src/components/StatusBadge/StatusBadge.tsx +3 -10
- package/src/components/StructuredContent/StructuredContent.stories.mdx +30 -58
- package/src/components/StructuredContent/StructuredContent.test.tsx +42 -44
- package/src/components/StructuredContent/StructuredContent.tsx +9 -18
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +9 -23
- package/src/components/StyleGuide/Buttons.stories.mdx +62 -62
- package/src/components/StyleGuide/ColorCard.tsx +2 -4
- package/src/components/StyleGuide/Colors.stories.mdx +7 -8
- package/src/components/StyleGuide/DesignTokens.stories.mdx +5 -7
- package/src/components/StyleGuide/Forms.stories.mdx +0 -1
- package/src/components/StyleGuide/Iconography.stories.mdx +59 -77
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
- package/src/components/StyleGuide/Typography.stories.mdx +15 -18
- package/src/components/Table/Table.stories.mdx +85 -1
- package/src/components/Table/Table.test.tsx +57 -1
- package/src/components/Table/Table.tsx +7 -4
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +121 -0
- package/src/components/Tabs/Tabs.stories.mdx +1 -1
- package/src/components/Tabs/Tabs.test.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +26 -27
- package/src/components/Template/Template.stories.mdx +49 -54
- package/src/components/Template/Template.tsx +9 -3
- package/src/components/Text/Text.stories.mdx +5 -11
- package/src/components/Text/Text.test.tsx +3 -6
- package/src/components/Text/Text.tsx +3 -5
- package/src/components/TextInput/TextInput.stories.mdx +10 -22
- package/src/components/TextInput/TextInput.test.tsx +32 -62
- package/src/components/TextInput/TextInput.tsx +61 -30
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +1 -0
- package/src/components/Toggle/Toggle.stories.mdx +5 -16
- package/src/components/Toggle/Toggle.test.tsx +2 -3
- package/src/components/Toggle/Toggle.tsx +9 -10
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +13 -29
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -23
- package/src/components/VideoPlayer/VideoPlayer.tsx +13 -10
- package/src/docs/Chakra.stories.mdx +14 -11
- package/src/docs/Welcome.stories.mdx +23 -43
- package/src/helpers/types.ts +1 -0
- package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
- package/src/hooks/useNYPLTheme.stories.mdx +3 -6
- package/src/index.ts +51 -45
- package/src/theme/components/buttonGroup.ts +10 -0
- package/src/theme/components/card.ts +50 -15
- package/src/theme/components/componentWrapper.ts +5 -1
- package/src/theme/components/customTable.ts +8 -2
- package/src/theme/components/fieldset.ts +5 -1
- package/src/theme/components/helperErrorText.ts +5 -1
- package/src/theme/components/hero.ts +2 -2
- package/src/theme/components/horizontalRule.ts +5 -1
- package/src/theme/components/icon.ts +7 -1
- package/src/theme/components/image.ts +14 -3
- package/src/theme/components/label.ts +5 -1
- package/src/theme/components/list.ts +8 -2
- package/src/theme/components/logo.ts +5 -1
- package/src/theme/components/notification.ts +38 -14
- package/src/theme/components/progressIndicator.ts +10 -5
- package/src/theme/components/select.ts +5 -2
- package/src/theme/components/skeletonLoader.ts +8 -2
- package/src/theme/components/skipNavigation.ts +26 -0
- package/src/theme/components/slider.ts +13 -1
- package/src/theme/components/structuredContent.ts +11 -1
- package/src/theme/components/text.ts +12 -5
- package/src/theme/components/toggle.ts +9 -3
- package/src/theme/index.ts +4 -0
- package/src/theme/provider.tsx +1 -1
- package/src/utils/componentCategories.ts +13 -5
- package/src/utils/interfaces.ts +5 -0
- package/src/utils/utils.ts +2 -32
- package/dist/components/Accordion/AccordionTypes.d.ts +0 -5
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +0 -8
- package/dist/components/Button/ButtonTypes.d.ts +0 -8
- package/dist/components/DatePicker/DatePickerTypes.d.ts +0 -5
- package/dist/components/Form/FormTypes.d.ts +0 -2
- package/dist/components/Grid/GridTypes.d.ts +0 -9
- package/dist/components/Heading/HeadingTypes.d.ts +0 -14
- package/dist/components/Hero/HeroTypes.d.ts +0 -12
- package/dist/components/Icons/IconTypes.d.ts +0 -77
- package/dist/components/Image/ImageTypes.d.ts +0 -22
- package/dist/components/Link/LinkTypes.d.ts +0 -8
- package/dist/components/List/ListTypes.d.ts +0 -5
- package/dist/components/Logo/LogoTypes.d.ts +0 -54
- package/dist/components/Notification/NotificationTypes.d.ts +0 -5
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +0 -8
- package/dist/components/Select/SelectTypes.d.ts +0 -8
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -5
- package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +0 -5
- package/dist/components/StructuredContent/StructuredContentTypes.d.ts +0 -5
- package/dist/components/Text/TextTypes.d.ts +0 -6
- package/dist/components/TextInput/TextInputTypes.d.ts +0 -25
- package/dist/components/Toggle/ToggleTypes.d.ts +0 -4
- package/dist/components/VideoPlayer/VideoPlayerTypes.d.ts +0 -9
- package/dist/helpers/enums.d.ts +0 -4
- package/dist/utils/siteSections.d.ts +0 -2
- package/src/components/Accordion/AccordionTypes.tsx +0 -5
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +0 -8
- package/src/components/Button/ButtonTypes.tsx +0 -8
- package/src/components/DatePicker/DatePickerTypes.tsx +0 -5
- package/src/components/Form/FormTypes.tsx +0 -3
- package/src/components/Grid/GridTypes.tsx +0 -9
- package/src/components/Heading/HeadingTypes.tsx +0 -15
- package/src/components/Hero/HeroTypes.tsx +0 -20
- package/src/components/Icons/IconTypes.tsx +0 -83
- package/src/components/Image/ImageTypes.ts +0 -24
- package/src/components/Link/LinkTypes.tsx +0 -8
- package/src/components/List/ListTypes.tsx +0 -5
- package/src/components/Logo/LogoTypes.tsx +0 -56
- package/src/components/Notification/NotificationTypes.tsx +0 -5
- package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +0 -8
- package/src/components/Select/SelectTypes.tsx +0 -10
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
- package/src/components/StatusBadge/StatusBadgeTypes.tsx +0 -5
- package/src/components/StructuredContent/StructuredContentTypes.tsx +0 -5
- package/src/components/Text/TextTypes.tsx +0 -6
- package/src/components/TextInput/TextInputTypes.tsx +0 -48
- package/src/components/Toggle/ToggleTypes.tsx +0 -4
- package/src/components/VideoPlayer/VideoPlayerTypes.tsx +0 -10
- package/src/helpers/enums.ts +0 -4
- package/src/utils/siteSections.ts +0 -10
package/src/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import "./styles.scss";
|
|
|
4
4
|
// components for usage in consuming applications.
|
|
5
5
|
export {
|
|
6
6
|
Box,
|
|
7
|
-
ButtonGroup,
|
|
8
7
|
Center,
|
|
9
8
|
Circle,
|
|
10
9
|
Flex,
|
|
@@ -16,12 +15,16 @@ export {
|
|
|
16
15
|
Stack,
|
|
17
16
|
VStack,
|
|
18
17
|
} from "@chakra-ui/react";
|
|
19
|
-
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
|
|
18
|
+
export {
|
|
19
|
+
default as Accordion,
|
|
20
|
+
AccordionTypes,
|
|
21
|
+
} from "./components/Accordion/Accordion";
|
|
22
|
+
export {
|
|
23
|
+
default as Breadcrumbs,
|
|
24
|
+
BreadcrumbsTypes,
|
|
25
|
+
} from "./components/Breadcrumbs/Breadcrumbs";
|
|
26
|
+
export { default as Button, ButtonTypes } from "./components/Button/Button";
|
|
27
|
+
export { default as ButtonGroup } from "./components/ButtonGroup/ButtonGroup";
|
|
25
28
|
export {
|
|
26
29
|
default as Card,
|
|
27
30
|
CardActions,
|
|
@@ -32,65 +35,70 @@ export { default as Checkbox } from "./components/Checkbox/Checkbox";
|
|
|
32
35
|
export { default as CheckboxGroup } from "./components/CheckboxGroup/CheckboxGroup";
|
|
33
36
|
export {
|
|
34
37
|
default as DatePicker,
|
|
38
|
+
DatePickerTypes,
|
|
35
39
|
FullDateType,
|
|
36
40
|
} from "./components/DatePicker/DatePicker";
|
|
37
|
-
export { DatePickerTypes } from "./components/DatePicker/DatePickerTypes";
|
|
38
41
|
export { default as DSProvider } from "./theme/provider";
|
|
39
42
|
export { default as Fieldset } from "./components/Fieldset/Fieldset";
|
|
40
43
|
export { default as Form, FormField, FormRow } from "./components/Form/Form";
|
|
41
|
-
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
export {
|
|
45
|
+
default as Heading,
|
|
46
|
+
HeadingSizes,
|
|
47
|
+
HeadingLevels,
|
|
48
|
+
} from "./components/Heading/Heading";
|
|
45
49
|
export { default as HelperErrorText } from "./components/HelperErrorText/HelperErrorText";
|
|
46
|
-
export { default as Hero } from "./components/Hero/Hero";
|
|
47
|
-
export { HeroTypes } from "./components/Hero/HeroTypes";
|
|
50
|
+
export { default as Hero, HeroTypes } from "./components/Hero/Hero";
|
|
48
51
|
export { default as HorizontalRule } from "./components/HorizontalRule/HorizontalRule";
|
|
49
|
-
export { default as Icon } from "./components/Icons/Icon";
|
|
50
52
|
export {
|
|
53
|
+
default as Icon,
|
|
51
54
|
IconAlign,
|
|
52
55
|
IconColors,
|
|
53
56
|
IconNames,
|
|
54
57
|
IconRotationTypes,
|
|
55
58
|
IconSizes,
|
|
56
59
|
IconTypes,
|
|
57
|
-
} from "./components/Icons/
|
|
58
|
-
export { default as Image } from "./components/Image/Image";
|
|
60
|
+
} from "./components/Icons/Icon";
|
|
59
61
|
export {
|
|
62
|
+
default as Image,
|
|
60
63
|
ImageRatios,
|
|
61
64
|
ImageSizes,
|
|
62
65
|
ImageTypes,
|
|
63
|
-
} from "./components/Image/
|
|
66
|
+
} from "./components/Image/Image";
|
|
64
67
|
export { default as Label } from "./components/Label/Label";
|
|
65
|
-
export { LayoutTypes } from "./helpers/
|
|
66
|
-
export { default as Link } from "./components/Link/Link";
|
|
67
|
-
export {
|
|
68
|
-
export { default as
|
|
69
|
-
export { ListTypes } from "./components/List/ListTypes";
|
|
70
|
-
export { default as Logo } from "./components/Logo/Logo";
|
|
71
|
-
export { LogoColors, LogoNames, LogoSizes } from "./components/Logo/LogoTypes";
|
|
68
|
+
export { LayoutTypes } from "./helpers/types";
|
|
69
|
+
export { default as Link, LinkTypes } from "./components/Link/Link";
|
|
70
|
+
export { default as List, ListTypes } from "./components/List/List";
|
|
71
|
+
export { default as Logo, LogoNames, LogoSizes } from "./components/Logo/Logo";
|
|
72
72
|
export { ModalTrigger, useModal } from "./components/Modal/Modal";
|
|
73
|
-
export {
|
|
74
|
-
|
|
73
|
+
export {
|
|
74
|
+
default as Notification,
|
|
75
|
+
NotificationTypes,
|
|
76
|
+
} from "./components/Notification/Notification";
|
|
75
77
|
export { default as Pagination } from "./components/Pagination/Pagination";
|
|
76
|
-
export { default as ProgressIndicator } from "./components/ProgressIndicator/ProgressIndicator";
|
|
77
78
|
export {
|
|
79
|
+
default as ProgressIndicator,
|
|
78
80
|
ProgressIndicatorSizes,
|
|
79
81
|
ProgressIndicatorTypes,
|
|
80
|
-
} from "./components/ProgressIndicator/
|
|
82
|
+
} from "./components/ProgressIndicator/ProgressIndicator";
|
|
81
83
|
export { default as Radio } from "./components/Radio/Radio";
|
|
82
84
|
export { default as RadioGroup } from "./components/RadioGroup/RadioGroup";
|
|
83
85
|
export { default as SearchBar } from "./components/SearchBar/SearchBar";
|
|
84
|
-
export { default as Select } from "./components/Select/Select";
|
|
85
|
-
export {
|
|
86
|
-
export {
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
export { default as Select, LabelPositions } from "./components/Select/Select";
|
|
87
|
+
export { default as SimpleGrid, GridGaps } from "./components/Grid/SimpleGrid";
|
|
88
|
+
export {
|
|
89
|
+
default as SkeletonLoader,
|
|
90
|
+
SkeletonLoaderImageRatios,
|
|
91
|
+
} from "./components/SkeletonLoader/SkeletonLoader";
|
|
92
|
+
export { default as SkipNavigation } from "./components/SkipNavigation/SkipNavigation";
|
|
89
93
|
export { default as Slider } from "./components/Slider/Slider";
|
|
90
|
-
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
export {
|
|
95
|
+
default as StatusBadge,
|
|
96
|
+
StatusBadgeTypes,
|
|
97
|
+
} from "./components/StatusBadge/StatusBadge";
|
|
98
|
+
export {
|
|
99
|
+
default as StructuredContent,
|
|
100
|
+
StructuredContentImagePosition,
|
|
101
|
+
} from "./components/StructuredContent/StructuredContent";
|
|
94
102
|
export {
|
|
95
103
|
default as Tabs,
|
|
96
104
|
TabList,
|
|
@@ -110,21 +118,19 @@ export {
|
|
|
110
118
|
TemplateContentSidebar,
|
|
111
119
|
TemplateFooter,
|
|
112
120
|
} from "./components/Template/Template";
|
|
113
|
-
export { default as Text } from "./components/Text/Text";
|
|
114
|
-
export { TextSizes } from "./components/Text/TextTypes";
|
|
121
|
+
export { default as Text, TextSizes } from "./components/Text/Text";
|
|
115
122
|
export {
|
|
116
123
|
default as TextInput,
|
|
117
124
|
TextInputRefType,
|
|
125
|
+
TextInputTypes,
|
|
118
126
|
} from "./components/TextInput/TextInput";
|
|
119
|
-
export {
|
|
120
|
-
export { default as Toggle } from "./components/Toggle/Toggle";
|
|
121
|
-
export { ToggleSizes } from "./components/Toggle/ToggleTypes";
|
|
127
|
+
export { default as Toggle, ToggleSizes } from "./components/Toggle/Toggle";
|
|
122
128
|
export { default as useCarouselStyles } from "./hooks/useCarouselStyles";
|
|
123
129
|
export { default as useNYPLTheme } from "./hooks/useNYPLTheme";
|
|
124
130
|
export { default as useWindowSize } from "./hooks/useWindowSize";
|
|
125
|
-
export { default as VideoPlayer } from "./components/VideoPlayer/VideoPlayer";
|
|
126
131
|
export {
|
|
132
|
+
default as VideoPlayer,
|
|
127
133
|
VideoPlayerAspectRatios,
|
|
128
134
|
VideoPlayerTypes,
|
|
129
|
-
} from "./components/VideoPlayer/
|
|
135
|
+
} from "./components/VideoPlayer/VideoPlayer";
|
|
130
136
|
export { default as Table } from "./components/Table/Table";
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
interface CardBaseStyleProps {
|
|
2
|
+
hasImage: boolean;
|
|
3
|
+
imageIsAtEnd: boolean;
|
|
4
|
+
isBordered: boolean;
|
|
5
|
+
isCentered: boolean;
|
|
6
|
+
layout: string;
|
|
7
|
+
mainActionLink: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface BodyPaddingProps {
|
|
10
|
+
hasImage: boolean;
|
|
11
|
+
imageIsAtEnd: boolean;
|
|
12
|
+
isBordered: boolean;
|
|
13
|
+
isRow: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface CardImageBaseStyleProps {
|
|
16
|
+
imageIsAtEnd: boolean;
|
|
17
|
+
isCentered: boolean;
|
|
18
|
+
size: keyof typeof imageSizes;
|
|
19
|
+
layout: string;
|
|
20
|
+
}
|
|
21
|
+
interface CardActionsBaseStyleProps {
|
|
22
|
+
bottomBorder: boolean;
|
|
23
|
+
isCentered: boolean;
|
|
24
|
+
layout: string;
|
|
25
|
+
topBorder: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
1
28
|
const imageSizes = {
|
|
2
29
|
xxsmall: { flex: { base: "0 0 100%", md: "0 0 64px" }, width: "100%" },
|
|
3
30
|
xsmall: { flex: { md: "0 0 96px" } },
|
|
@@ -8,10 +35,10 @@ const imageSizes = {
|
|
|
8
35
|
// This is complicated and can be refactored later...
|
|
9
36
|
const getBodyPaddingStyles = ({
|
|
10
37
|
hasImage,
|
|
11
|
-
isBordered,
|
|
12
38
|
imageIsAtEnd,
|
|
39
|
+
isBordered,
|
|
13
40
|
isRow,
|
|
14
|
-
}) => {
|
|
41
|
+
}: BodyPaddingProps) => {
|
|
15
42
|
let bodyPadding = null;
|
|
16
43
|
if (isBordered) {
|
|
17
44
|
bodyPadding = "inset.default";
|
|
@@ -39,15 +66,14 @@ const getBodyPaddingStyles = ({
|
|
|
39
66
|
};
|
|
40
67
|
const Card = {
|
|
41
68
|
parts: ["actions", "body", "heading"],
|
|
42
|
-
baseStyle: (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} = props;
|
|
69
|
+
baseStyle: ({
|
|
70
|
+
hasImage,
|
|
71
|
+
imageIsAtEnd,
|
|
72
|
+
isBordered,
|
|
73
|
+
isCentered,
|
|
74
|
+
layout,
|
|
75
|
+
mainActionLink,
|
|
76
|
+
}: CardBaseStyleProps) => {
|
|
51
77
|
const isRow = layout === "row";
|
|
52
78
|
const layoutStyles = isRow
|
|
53
79
|
? {
|
|
@@ -107,8 +133,12 @@ const Card = {
|
|
|
107
133
|
};
|
|
108
134
|
|
|
109
135
|
const CardActions = {
|
|
110
|
-
baseStyle: (
|
|
111
|
-
|
|
136
|
+
baseStyle: ({
|
|
137
|
+
bottomBorder,
|
|
138
|
+
isCentered,
|
|
139
|
+
layout,
|
|
140
|
+
topBorder,
|
|
141
|
+
}: CardActionsBaseStyleProps) => {
|
|
112
142
|
let justifyContent = null;
|
|
113
143
|
// Only center in the column layout.
|
|
114
144
|
if (layout === "row") {
|
|
@@ -154,9 +184,14 @@ const CardContent = {
|
|
|
154
184
|
};
|
|
155
185
|
|
|
156
186
|
const CardImage = {
|
|
157
|
-
baseStyle: ({
|
|
187
|
+
baseStyle: ({
|
|
188
|
+
imageIsAtEnd,
|
|
189
|
+
isCentered,
|
|
190
|
+
layout,
|
|
191
|
+
size,
|
|
192
|
+
}: CardImageBaseStyleProps) => {
|
|
158
193
|
// These sizes are only for the "row" layout.
|
|
159
|
-
const imageSize = imageSizes[size]
|
|
194
|
+
const imageSize = size ? imageSizes[size] : {};
|
|
160
195
|
const layoutStyles =
|
|
161
196
|
layout === "row"
|
|
162
197
|
? {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
interface ComponentWrapperProps {
|
|
2
|
+
hasChildren: boolean;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
const ComponentWrapper = {
|
|
2
6
|
parts: ["helperErrorText"],
|
|
3
|
-
baseStyle: ({ hasChildren }) => ({
|
|
7
|
+
baseStyle: ({ hasChildren }: ComponentWrapperProps) => ({
|
|
4
8
|
helperErrorText: {
|
|
5
9
|
marginTop: hasChildren ? "xs" : "0",
|
|
6
10
|
},
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
interface BaseStyleProps {
|
|
2
|
+
columnHeadersTextColor?: string;
|
|
3
|
+
showRowDividers?: boolean;
|
|
4
|
+
useRowHeaders?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
export const baseTHStyles = (
|
|
2
8
|
showRowDividers = false,
|
|
3
|
-
columnHeadersTextColor =
|
|
9
|
+
columnHeadersTextColor = ""
|
|
4
10
|
) => ({
|
|
5
11
|
border: showRowDividers ? undefined : "none",
|
|
6
12
|
borderBottom: showRowDividers ? undefined : "0px",
|
|
@@ -38,7 +44,7 @@ export const baseStyle = ({
|
|
|
38
44
|
columnHeadersTextColor,
|
|
39
45
|
showRowDividers,
|
|
40
46
|
useRowHeaders,
|
|
41
|
-
}) => ({
|
|
47
|
+
}: BaseStyleProps) => ({
|
|
42
48
|
// Headers `th` can be rendered as the first cell in every row through the
|
|
43
49
|
// `useRowHeaders`. Whereas the header `th` in the `thead` can be rendered
|
|
44
50
|
// with a custom color, the row header `th` in the `tbody` should always
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { labelLegendText } from "./global";
|
|
2
2
|
import { screenreaderOnly } from "./globalMixins";
|
|
3
3
|
|
|
4
|
+
interface FieldSetProps {
|
|
5
|
+
isLegendHidden?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
const Fieldset = {
|
|
5
|
-
baseStyle: ({ isLegendHidden }) => {
|
|
9
|
+
baseStyle: ({ isLegendHidden }: FieldSetProps) => {
|
|
6
10
|
const screenreaderStyles = isLegendHidden ? screenreaderOnly : {};
|
|
7
11
|
|
|
8
12
|
return {
|
|
@@ -187,7 +187,7 @@ const campaign = {
|
|
|
187
187
|
maxWidth: { md: "960px" },
|
|
188
188
|
},
|
|
189
189
|
};
|
|
190
|
-
const
|
|
190
|
+
const fiftyFifty = {
|
|
191
191
|
content: {
|
|
192
192
|
...wrapperStyles,
|
|
193
193
|
alignItems: "center",
|
|
@@ -231,7 +231,7 @@ const Hero = {
|
|
|
231
231
|
secondaryWhatsOn,
|
|
232
232
|
tertiary,
|
|
233
233
|
campaign,
|
|
234
|
-
|
|
234
|
+
fiftyFifty,
|
|
235
235
|
},
|
|
236
236
|
};
|
|
237
237
|
|
|
@@ -52,8 +52,14 @@ const size = {
|
|
|
52
52
|
width: "0.875rem",
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
|
+
interface IconBaseStyle {
|
|
56
|
+
align: keyof typeof align;
|
|
57
|
+
color: string;
|
|
58
|
+
iconRotation: keyof typeof iconRotation;
|
|
59
|
+
size: keyof typeof size;
|
|
60
|
+
}
|
|
55
61
|
const Icon = {
|
|
56
|
-
baseStyle: (props) => {
|
|
62
|
+
baseStyle: (props: IconBaseStyle) => {
|
|
57
63
|
const allStyles = {
|
|
58
64
|
...svgBase,
|
|
59
65
|
...align[props.align],
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
interface CustomImageBaseStyle {
|
|
2
|
+
size: keyof typeof imageSizes;
|
|
3
|
+
}
|
|
4
|
+
interface CustomImageWrapperBaseStyle {
|
|
5
|
+
ratio: keyof typeof imageRatios;
|
|
6
|
+
size: keyof typeof imageSizes;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
const imageWrap = {
|
|
2
10
|
position: "relative",
|
|
3
11
|
width: "100%",
|
|
@@ -75,7 +83,7 @@ const CustomImage = {
|
|
|
75
83
|
},
|
|
76
84
|
},
|
|
77
85
|
},
|
|
78
|
-
baseStyle: ({ size = "default" }) => ({
|
|
86
|
+
baseStyle: ({ size = "default" }: CustomImageBaseStyle) => ({
|
|
79
87
|
figure: {
|
|
80
88
|
margin: "auto",
|
|
81
89
|
...imageSizes[size],
|
|
@@ -96,13 +104,16 @@ const CustomImage = {
|
|
|
96
104
|
...imageSizes[size],
|
|
97
105
|
},
|
|
98
106
|
captionWrappers: {
|
|
99
|
-
|
|
107
|
+
marginTop: "xxs",
|
|
100
108
|
},
|
|
101
109
|
}),
|
|
102
110
|
};
|
|
103
111
|
const CustomImageWrapper = {
|
|
104
112
|
parts: ["crop"],
|
|
105
|
-
baseStyle: ({
|
|
113
|
+
baseStyle: ({
|
|
114
|
+
ratio = "original",
|
|
115
|
+
size = "default",
|
|
116
|
+
}: CustomImageWrapperBaseStyle) => ({
|
|
106
117
|
marginLeft: "auto",
|
|
107
118
|
marginRight: "auto",
|
|
108
119
|
width: "100%",
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { labelLegendText } from "./global";
|
|
2
2
|
|
|
3
|
+
interface LabelBaseStyle {
|
|
4
|
+
isInlined: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
const Label = {
|
|
4
|
-
baseStyle: ({ isInlined }) => ({
|
|
8
|
+
baseStyle: ({ isInlined }: LabelBaseStyle) => ({
|
|
5
9
|
...labelLegendText,
|
|
6
10
|
flex: isInlined ? "1" : null,
|
|
7
11
|
whiteSpace: isInlined ? "nowrap" : null,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { textMargin } from "./global";
|
|
2
2
|
|
|
3
|
+
interface ListBaseStyle {
|
|
4
|
+
inline?: boolean;
|
|
5
|
+
noStyling: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
export const baseListStyles = (inline = false, noStyling = false) => ({
|
|
4
9
|
// Browser automatically applies margin, so by default we unset it.
|
|
5
10
|
margin: noStyling ? "0" : "unset",
|
|
@@ -71,9 +76,10 @@ export const baseDefinitionStyles = {
|
|
|
71
76
|
};
|
|
72
77
|
|
|
73
78
|
const List = {
|
|
74
|
-
baseStyle: ({ inline, noStyling }) =>
|
|
79
|
+
baseStyle: ({ inline, noStyling }: ListBaseStyle) =>
|
|
80
|
+
baseListStyles(inline, noStyling),
|
|
75
81
|
variants: {
|
|
76
|
-
ul: ({ noStyling }) => baseUnorderedStyles(noStyling),
|
|
82
|
+
ul: ({ noStyling }: ListBaseStyle) => baseUnorderedStyles(noStyling),
|
|
77
83
|
ol: textMargin,
|
|
78
84
|
dl: baseDefinitionStyles,
|
|
79
85
|
},
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
interface LogoBaseStyle {
|
|
2
|
+
size: keyof typeof size;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
const svgBase = {
|
|
2
6
|
display: "inline-block",
|
|
3
7
|
height: "auto",
|
|
@@ -35,7 +39,7 @@ const size = {
|
|
|
35
39
|
},
|
|
36
40
|
};
|
|
37
41
|
const Logo = {
|
|
38
|
-
baseStyle: (props) => {
|
|
42
|
+
baseStyle: (props: LogoBaseStyle) => {
|
|
39
43
|
const allStyles = {
|
|
40
44
|
...svgBase,
|
|
41
45
|
...size[props.size],
|
|
@@ -1,13 +1,32 @@
|
|
|
1
|
-
import { NotificationTypes } from "../../components/Notification/
|
|
1
|
+
import { NotificationTypes } from "../../components/Notification/Notification";
|
|
2
|
+
|
|
3
|
+
interface NotificationBaseStyle {
|
|
4
|
+
dismissible: boolean;
|
|
5
|
+
isCentered: boolean;
|
|
6
|
+
noMargin: boolean;
|
|
7
|
+
notificationType: NotificationTypes;
|
|
8
|
+
}
|
|
9
|
+
interface NotificationContentBaseStyle {
|
|
10
|
+
alignText: boolean;
|
|
11
|
+
icon: boolean;
|
|
12
|
+
notificationType: NotificationTypes;
|
|
13
|
+
}
|
|
14
|
+
interface NotificationHeadingBaseStyle {
|
|
15
|
+
icon: boolean;
|
|
16
|
+
isCentered: boolean;
|
|
17
|
+
notificationType: NotificationTypes;
|
|
18
|
+
}
|
|
2
19
|
|
|
3
20
|
const Notification = {
|
|
4
21
|
parts: ["container", "dismissibleButton", "icon"],
|
|
5
|
-
baseStyle: ({
|
|
22
|
+
baseStyle: ({
|
|
23
|
+
dismissible,
|
|
24
|
+
isCentered,
|
|
25
|
+
noMargin,
|
|
26
|
+
notificationType,
|
|
27
|
+
}: NotificationBaseStyle) => {
|
|
6
28
|
let bg = "ui.status.primary";
|
|
7
|
-
if (
|
|
8
|
-
notificationType === NotificationTypes.Announcement ||
|
|
9
|
-
notificationType === NotificationTypes.Warning
|
|
10
|
-
) {
|
|
29
|
+
if (notificationType === "announcement" || notificationType === "warning") {
|
|
11
30
|
bg = "ui.gray.x-light-cool";
|
|
12
31
|
}
|
|
13
32
|
return {
|
|
@@ -55,14 +74,15 @@ const Notification = {
|
|
|
55
74
|
|
|
56
75
|
const NotificationContent = {
|
|
57
76
|
parts: ["content"],
|
|
58
|
-
baseStyle: ({
|
|
77
|
+
baseStyle: ({
|
|
78
|
+
alignText,
|
|
79
|
+
icon,
|
|
80
|
+
notificationType,
|
|
81
|
+
}: NotificationContentBaseStyle) => ({
|
|
59
82
|
display: "flex",
|
|
60
83
|
justifyContent: "center",
|
|
61
84
|
content: {
|
|
62
|
-
color:
|
|
63
|
-
notificationType === NotificationTypes.Warning
|
|
64
|
-
? "brand.primary"
|
|
65
|
-
: "currentColor",
|
|
85
|
+
color: notificationType === "warning" ? "brand.primary" : "currentColor",
|
|
66
86
|
marginTop: icon ? "xxxs" : "0",
|
|
67
87
|
paddingLeft: alignText
|
|
68
88
|
? "calc(var(--nypl-space-m) + var(--nypl-space-s))"
|
|
@@ -81,11 +101,15 @@ const NotificationContent = {
|
|
|
81
101
|
|
|
82
102
|
const NotificationHeading = {
|
|
83
103
|
parts: ["heading"],
|
|
84
|
-
baseStyle: ({
|
|
104
|
+
baseStyle: ({
|
|
105
|
+
icon,
|
|
106
|
+
isCentered,
|
|
107
|
+
notificationType,
|
|
108
|
+
}: NotificationHeadingBaseStyle) => {
|
|
85
109
|
let color = "ui.black";
|
|
86
|
-
if (notificationType ===
|
|
110
|
+
if (notificationType === "announcement") {
|
|
87
111
|
color = "section.research.secondary";
|
|
88
|
-
} else if (notificationType ===
|
|
112
|
+
} else if (notificationType === "warning") {
|
|
89
113
|
color = "brand.primary";
|
|
90
114
|
}
|
|
91
115
|
return {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { ProgressIndicatorSizes } from "../../components/ProgressIndicator/
|
|
1
|
+
import { ProgressIndicatorSizes } from "../../components/ProgressIndicator/ProgressIndicator";
|
|
2
|
+
|
|
3
|
+
interface ProgressIndicatorBaseStyle {
|
|
4
|
+
darkMode: boolean;
|
|
5
|
+
size: ProgressIndicatorSizes;
|
|
6
|
+
}
|
|
2
7
|
|
|
3
8
|
const ProgressIndicator = {
|
|
4
9
|
parts: [
|
|
@@ -8,15 +13,15 @@ const ProgressIndicator = {
|
|
|
8
13
|
"linearContainer",
|
|
9
14
|
"linearPercentage",
|
|
10
15
|
],
|
|
11
|
-
baseStyle: ({ darkMode, size }) => {
|
|
16
|
+
baseStyle: ({ darkMode, size }: ProgressIndicatorBaseStyle) => {
|
|
12
17
|
return {
|
|
13
18
|
color: darkMode ? "ui.white" : "ui.black",
|
|
14
19
|
circular: {
|
|
15
20
|
// Note: we have to target the SVG HTMl elements in order
|
|
16
21
|
// to override the default styles.
|
|
17
22
|
svg: {
|
|
18
|
-
height: size ===
|
|
19
|
-
width: size ===
|
|
23
|
+
height: size === "default" ? "48px" : "24px",
|
|
24
|
+
width: size === "default" ? "48px" : "24px",
|
|
20
25
|
display: "block",
|
|
21
26
|
circle: {
|
|
22
27
|
_first: {
|
|
@@ -44,7 +49,7 @@ const ProgressIndicator = {
|
|
|
44
49
|
bg: darkMode ? "ui.gray.dark" : "ui.gray.light-cool",
|
|
45
50
|
height: {
|
|
46
51
|
base: "4px",
|
|
47
|
-
md: size ===
|
|
52
|
+
md: size === "default" ? "8px" : "4px",
|
|
48
53
|
},
|
|
49
54
|
},
|
|
50
55
|
linearContainer: {
|
|
@@ -3,6 +3,10 @@ import {
|
|
|
3
3
|
selectTextInputFocusStyles,
|
|
4
4
|
} from "./global";
|
|
5
5
|
|
|
6
|
+
interface SelectBaseStyle {
|
|
7
|
+
labelPosition: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
const select = {
|
|
7
11
|
backgroundColor: "ui.white",
|
|
8
12
|
borderRadius: "sm",
|
|
@@ -29,9 +33,8 @@ const select = {
|
|
|
29
33
|
|
|
30
34
|
const Select = {
|
|
31
35
|
parts: ["helperText", "inline", "select"],
|
|
32
|
-
baseStyle: ({ labelPosition }) => {
|
|
36
|
+
baseStyle: ({ labelPosition }: SelectBaseStyle) => {
|
|
33
37
|
return {
|
|
34
|
-
marginBottom: "xs",
|
|
35
38
|
// The backgroundColor set to "ui.white" hides the arrow SVG icon when
|
|
36
39
|
// the component is focused. The background is added for dark mode and
|
|
37
40
|
// so we need to add specific selector.
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { keyframes } from "@chakra-ui/system";
|
|
2
2
|
|
|
3
|
+
interface SkeletonLoaderBaseStyle {
|
|
4
|
+
imageAspectRatio: keyof typeof imagePaddingBottomStyles;
|
|
5
|
+
isBordered: boolean;
|
|
6
|
+
showImage?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
const element = {
|
|
4
10
|
borderRadius: "2px",
|
|
5
11
|
boxSizing: "border-box",
|
|
@@ -23,7 +29,7 @@ const imageRowHeightStyles = {
|
|
|
23
29
|
// NYPL's skeleton loader component.
|
|
24
30
|
const SkeletonLoader = {
|
|
25
31
|
parts: ["section", "image", "container", "heading", "content", "button"],
|
|
26
|
-
baseStyle: ({ imageAspectRatio, isBordered }) => {
|
|
32
|
+
baseStyle: ({ imageAspectRatio, isBordered }: SkeletonLoaderBaseStyle) => {
|
|
27
33
|
const borderStyles = isBordered ? { ...borderRules } : {};
|
|
28
34
|
|
|
29
35
|
return {
|
|
@@ -67,7 +73,7 @@ const SkeletonLoader = {
|
|
|
67
73
|
};
|
|
68
74
|
},
|
|
69
75
|
variants: {
|
|
70
|
-
row: ({ imageAspectRatio, showImage }) => ({
|
|
76
|
+
row: ({ imageAspectRatio, showImage }: SkeletonLoaderBaseStyle) => ({
|
|
71
77
|
alignItems: "flex-start",
|
|
72
78
|
display: { md: "flex" },
|
|
73
79
|
image: {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const SkipNavigation = {
|
|
2
|
+
baseStyle: {
|
|
3
|
+
// Don't display links by default...
|
|
4
|
+
a: {
|
|
5
|
+
backgroundColor: "ui.white",
|
|
6
|
+
height: "1px",
|
|
7
|
+
left: "-10000px",
|
|
8
|
+
overflow: "hidden",
|
|
9
|
+
position: "absolute",
|
|
10
|
+
top: "auto",
|
|
11
|
+
width: "1px",
|
|
12
|
+
// Only display when the user focuses on the links.
|
|
13
|
+
_focus: {
|
|
14
|
+
border: "1px solid var(—nypl-colors-ui-gray-dark)",
|
|
15
|
+
height: "auto",
|
|
16
|
+
left: "2rem",
|
|
17
|
+
padding:
|
|
18
|
+
"var(--nypl-space-inset-extranarrow) var(--nypl-space-inset-narrow)",
|
|
19
|
+
top: "3rem",
|
|
20
|
+
width: "auto",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default SkipNavigation;
|