@nypl/design-system-react-components 0.26.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 +56 -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/Modal/Modal.d.ts +28 -8
- 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 +977 -1213
- 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 +976 -1276
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/helpers/types.d.ts +1 -0
- package/dist/index.d.ts +27 -48
- package/dist/styles.css +1 -1
- 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 -10
- 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 +15 -16
- 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/Card/__snapshots__/Card.test.tsx.snap +1 -1
- 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/Checkbox/__snapshots__/Checkbox.test.tsx.snap +9 -9
- 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 +24 -35
- 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 -94
- package/src/components/Link/Link.test.tsx +25 -75
- 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 +245 -139
- package/src/components/Modal/Modal.test.tsx +147 -10
- package/src/components/Modal/Modal.tsx +140 -20
- package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +25 -0
- 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 +3 -4
- 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 +1 -13
- package/src/components/Select/Select.stories.mdx +10 -25
- package/src/components/Select/Select.test.tsx +6 -7
- package/src/components/Select/Select.tsx +28 -35
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +24 -24
- 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 +52 -46
- package/src/styles.scss +0 -1
- 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 -6
- 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/Modal/_Modal.scss +0 -18
- 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
|
@@ -2,27 +2,13 @@ import { Meta } from "@storybook/addon-docs";
|
|
|
2
2
|
|
|
3
3
|
import { Box, Center, Circle, VStack, Square } from "@chakra-ui/react";
|
|
4
4
|
import Card, { CardHeading, CardContent } from "../components/Card/Card";
|
|
5
|
-
import Hero from "../components/Hero/Hero";
|
|
6
|
-
import { HeroTypes } from "../components/Hero/HeroTypes";
|
|
7
5
|
import Heading from "../components/Heading/Heading";
|
|
8
|
-
import {
|
|
9
|
-
HeadingLevels,
|
|
10
|
-
HeadingSizes,
|
|
11
|
-
} from "../components/Heading/HeadingTypes";
|
|
12
6
|
import Icon from "../components/Icons/Icon";
|
|
13
|
-
import {
|
|
14
|
-
IconColors,
|
|
15
|
-
IconNames,
|
|
16
|
-
IconSizes,
|
|
17
|
-
} from "../components/Icons/IconTypes";
|
|
18
7
|
import Image from "../components/Image/Image";
|
|
19
8
|
import Link from "../components/Link/Link";
|
|
20
|
-
import { LinkTypes } from "../components/Link/LinkTypes";
|
|
21
9
|
import Logo from "../components/Logo/Logo";
|
|
22
|
-
import { LogoNames, LogoSizes } from "../components/Logo/LogoTypes";
|
|
23
10
|
import SimpleGrid from "../components/Grid/SimpleGrid";
|
|
24
11
|
import Text from "../components/Text/Text";
|
|
25
|
-
import { TextSizes } from "../components/Text/TextTypes";
|
|
26
12
|
import DSProvider from "../theme/provider";
|
|
27
13
|
|
|
28
14
|
<Meta title="Welcome" />
|
|
@@ -30,11 +16,11 @@ import DSProvider from "../theme/provider";
|
|
|
30
16
|
<DSProvider>
|
|
31
17
|
<VStack spacing="s">
|
|
32
18
|
<Center>
|
|
33
|
-
<Logo name=
|
|
19
|
+
<Logo name="reservoirVerticalColor" size="small" />
|
|
34
20
|
</Center>
|
|
35
21
|
<Box>
|
|
36
22
|
<Center>
|
|
37
|
-
<Heading level=
|
|
23
|
+
<Heading level="one" size="tertiary">
|
|
38
24
|
The React Component Library of the New York Public Library
|
|
39
25
|
</Heading>
|
|
40
26
|
</Center>
|
|
@@ -57,31 +43,29 @@ import DSProvider from "../theme/provider";
|
|
|
57
43
|
}}
|
|
58
44
|
>
|
|
59
45
|
<Icon
|
|
60
|
-
name=
|
|
61
|
-
size=
|
|
62
|
-
color=
|
|
63
|
-
|
|
64
|
-
marginBottom: "s",
|
|
65
|
-
}}
|
|
46
|
+
name="actionCheckCircle"
|
|
47
|
+
size="xxlarge"
|
|
48
|
+
color="section.education.secondary"
|
|
49
|
+
marginBottom="s"
|
|
66
50
|
/>
|
|
67
51
|
<Card isCentered>
|
|
68
|
-
<CardHeading id="main-heading1" level=
|
|
52
|
+
<CardHeading id="main-heading1" level="three">
|
|
69
53
|
Get Started
|
|
70
54
|
</CardHeading>
|
|
71
55
|
<CardContent>
|
|
72
|
-
<Text size=
|
|
56
|
+
<Text size="caption">
|
|
73
57
|
To start using Reservoir Design System, refer to Reservoir's
|
|
74
58
|
Github{" "}
|
|
75
59
|
<Link
|
|
76
60
|
href="https://github.com/NYPL/nypl-design-system/wiki"
|
|
77
|
-
type=
|
|
61
|
+
type="external"
|
|
78
62
|
>
|
|
79
63
|
Wiki
|
|
80
64
|
</Link>{" "}
|
|
81
65
|
and{" "}
|
|
82
66
|
<Link
|
|
83
67
|
href="https://github.com/NYPL/nypl-design-system/blob/development/README.md"
|
|
84
|
-
type=
|
|
68
|
+
type="external"
|
|
85
69
|
>
|
|
86
70
|
ReadMe
|
|
87
71
|
</Link>{" "}
|
|
@@ -101,19 +85,17 @@ import DSProvider from "../theme/provider";
|
|
|
101
85
|
}}
|
|
102
86
|
>
|
|
103
87
|
<Icon
|
|
104
|
-
name=
|
|
105
|
-
size=
|
|
106
|
-
color=
|
|
107
|
-
|
|
108
|
-
marginBottom: "s",
|
|
109
|
-
}}
|
|
88
|
+
name="search"
|
|
89
|
+
size="xxlarge"
|
|
90
|
+
color="section.education.secondary"
|
|
91
|
+
marginBottom="s"
|
|
110
92
|
/>
|
|
111
93
|
<Card isCentered>
|
|
112
|
-
<CardHeading id="main-heading1" level=
|
|
94
|
+
<CardHeading id="main-heading1" level="three">
|
|
113
95
|
Find Components
|
|
114
96
|
</CardHeading>
|
|
115
97
|
<CardContent>
|
|
116
|
-
<Text size=
|
|
98
|
+
<Text size="caption">
|
|
117
99
|
For your convenience, the Reservoir Design System components have
|
|
118
100
|
been organized into logical categories based on both form and
|
|
119
101
|
function. Please refer to the <b>COMPONENTS</b> section in the
|
|
@@ -132,15 +114,13 @@ import DSProvider from "../theme/provider";
|
|
|
132
114
|
}}
|
|
133
115
|
>
|
|
134
116
|
<Icon
|
|
135
|
-
name=
|
|
136
|
-
size=
|
|
137
|
-
color=
|
|
138
|
-
|
|
139
|
-
marginBottom: "s",
|
|
140
|
-
}}
|
|
117
|
+
name="fileTypeSpreadsheet"
|
|
118
|
+
size="xxlarge"
|
|
119
|
+
color="section.education.secondary"
|
|
120
|
+
marginBottom="s"
|
|
141
121
|
/>
|
|
142
122
|
<Card isCentered>
|
|
143
|
-
<CardHeading id="main-heading1" level=
|
|
123
|
+
<CardHeading id="main-heading1" level="three">
|
|
144
124
|
View the Code
|
|
145
125
|
</CardHeading>
|
|
146
126
|
<CardContent>
|
|
@@ -149,13 +129,13 @@ import DSProvider from "../theme/provider";
|
|
|
149
129
|
published on{" "}
|
|
150
130
|
<Link
|
|
151
131
|
href="https://www.npmjs.com/package/@nypl/design-system-react-components"
|
|
152
|
-
type=
|
|
132
|
+
type="external"
|
|
153
133
|
>
|
|
154
134
|
npm
|
|
155
135
|
</Link>
|
|
156
136
|
. If you're looking to contribute to this project, checkout the <Link
|
|
157
137
|
href="https://github.com/NYPL/nypl-design-system"
|
|
158
|
-
type=
|
|
138
|
+
type="external"
|
|
159
139
|
>
|
|
160
140
|
nypl-design-system
|
|
161
141
|
</Link> repo on Github for more information.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LayoutTypes = "column" | "row";
|
|
@@ -20,7 +20,7 @@ describe("useNYPLTheme", () => {
|
|
|
20
20
|
wrapper: ({ children }) => <DSProvider>{children}</DSProvider>,
|
|
21
21
|
});
|
|
22
22
|
const allKeys = Object.keys(result.current);
|
|
23
|
-
const colorsKeys = Object.keys(result.current.colors);
|
|
23
|
+
const colorsKeys = Object.keys((result.current as any).colors);
|
|
24
24
|
|
|
25
25
|
expect(allKeys).toEqual([
|
|
26
26
|
"breakpoints",
|
|
@@ -55,8 +55,7 @@ This will allow you to use NYPL-specific styles in your components through CSS-i
|
|
|
55
55
|
All DS components _should_ be used with their current styles. If a DS component
|
|
56
56
|
needs an updated style, first contact the Design System and UX teams about this
|
|
57
57
|
update. If you really _need_ to update a style and there is no available
|
|
58
|
-
variant, then you can add styles directly
|
|
59
|
-
moment, not all DS components have this prop or feature.
|
|
58
|
+
variant, then you can add styles directly as style prop.
|
|
60
59
|
|
|
61
60
|
For example, if the `Heading` component should render the text in NYPL's green
|
|
62
61
|
color used for "success primary" and add a bold font weight, then you can do
|
|
@@ -70,10 +69,8 @@ return (
|
|
|
70
69
|
<div>
|
|
71
70
|
<Heading
|
|
72
71
|
level={2}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
fontWeight: theme.fontWeights.bold,
|
|
76
|
-
}}
|
|
72
|
+
color={theme.colors.ui.success.primary}
|
|
73
|
+
fontWeight={theme.fontWeights.bold}
|
|
77
74
|
>
|
|
78
75
|
Get a Digital Library Card Today in a Few Easy Steps
|
|
79
76
|
</Heading>
|
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 {
|
|
70
|
-
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export { NotificationTypes } from "./components/Notification/NotificationTypes";
|
|
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
|
+
export { ModalTrigger, useModal } from "./components/Modal/Modal";
|
|
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";
|
package/src/styles.scss
CHANGED
|
@@ -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],
|