@nypl/design-system-react-components 0.23.4 → 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 +98 -1
- package/README.md +46 -11
- package/dist/components/Accordion/Accordion.d.ts +14 -14
- package/dist/components/Autosuggest/Autosuggest.stories.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -14
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
- package/dist/components/Button/Button.d.ts +6 -13
- package/dist/components/Button/ButtonTypes.d.ts +5 -3
- package/dist/components/Card/Card.d.ts +59 -10
- package/dist/components/Card/CardTypes.d.ts +19 -0
- package/dist/components/CardEdition/CardEdition.d.ts +21 -0
- package/dist/components/{StyleGuide/Colors.stories.d.ts → CardEdition/CardEdition.stories.d.ts} +5 -2
- package/dist/components/Checkbox/Checkbox.d.ts +21 -16
- 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 +79 -0
- package/dist/components/DatePicker/DatePickerTypes.d.ts +5 -0
- package/dist/components/Form/Form.d.ts +16 -8
- package/dist/components/Form/FormTypes.d.ts +2 -0
- 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 +9 -11
- package/dist/components/Heading/{HeadingDisplaySizes.d.ts → HeadingTypes.d.ts} +8 -0
- package/dist/components/HelperErrorText/HelperErrorText.stories.d.ts +2 -1
- 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/IconSvgs.d.ts +4 -0
- package/dist/components/Icons/IconTypes.d.ts +78 -60
- package/dist/components/Image/Image.stories.d.ts +2 -1
- package/dist/components/Label/Label.d.ts +10 -26
- package/dist/components/Link/Link.d.ts +8 -12
- package/dist/components/List/List.stories.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +30 -24
- package/dist/components/RadioGroup/RadioGroup.d.ts +40 -0
- package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +4 -0
- package/dist/components/SearchBar/SearchBar.d.ts +45 -27
- package/dist/components/Select/Select.d.ts +34 -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/Tabs/Tabs.d.ts +25 -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 +37 -30
- package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
- package/dist/design-system-react-components.cjs.development.js +4102 -917
- 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 +4023 -920
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +23 -5
- package/dist/resources.scss +133 -24
- 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 +109 -0
- package/dist/theme/components/checkbox.d.ts +91 -0
- package/dist/theme/components/customCheckboxGroup.d.ts +18 -0
- package/dist/theme/components/customRadioGroup.d.ts +18 -0
- 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 +110 -0
- 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 +95 -0
- 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 +85 -0
- 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/breakpoints.d.ts +23 -0
- package/dist/theme/foundations/colors.d.ts +3 -0
- package/dist/theme/foundations/global.d.ts +23 -0
- package/dist/theme/foundations/shadows.d.ts +4 -0
- package/dist/theme/foundations/spacing.d.ts +77 -0
- package/dist/theme/foundations/typography.d.ts +8 -0
- package/dist/theme/index.d.ts +20 -0
- package/dist/theme/provider.d.ts +5 -0
- package/dist/theme/types.d.ts +1 -0
- package/dist/utils/utils.d.ts +6 -0
- package/package.json +9 -2
- package/src/components/Accordion/Accordion.stories.mdx +233 -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 +4 -3
- package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -1
- package/src/components/Autosuggest/_Autosuggest.scss +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +57 -56
- 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 +125 -138
- package/src/components/Button/Button.test.tsx +65 -11
- package/src/components/Button/Button.tsx +72 -68
- package/src/components/Button/ButtonTypes.tsx +4 -2
- package/src/components/Button/_Button.scss +7 -92
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +58 -3
- package/src/components/Card/Card.stories.mdx +694 -0
- package/src/components/Card/Card.test.tsx +97 -102
- package/src/components/Card/Card.tsx +182 -31
- package/src/components/Card/CardTypes.tsx +21 -0
- package/src/components/Card/_Card.scss +234 -49
- package/src/components/{Card/Card.stories.tsx → CardEdition/CardEdition.stories.tsx} +32 -22
- package/src/components/CardEdition/CardEdition.test.tsx +395 -0
- package/src/components/CardEdition/CardEdition.tsx +60 -0
- package/src/components/CardEdition/_CardEdition.scss +138 -0
- package/src/components/Chakra/Box.stories.mdx +57 -0
- package/src/components/Chakra/Center.stories.mdx +99 -0
- package/src/components/Chakra/Grid.stories.mdx +79 -0
- package/src/components/Chakra/Stack.stories.mdx +93 -0
- package/src/components/Checkbox/Checkbox.stories.mdx +57 -35
- package/src/components/Checkbox/Checkbox.test.tsx +117 -147
- package/src/components/Checkbox/Checkbox.tsx +76 -50
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +325 -0
- 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.stories.mdx +284 -0
- package/src/components/DatePicker/DatePicker.test.tsx +657 -0
- package/src/components/DatePicker/DatePicker.tsx +396 -0
- package/src/components/DatePicker/DatePickerTypes.tsx +5 -0
- package/src/components/DatePicker/_DatePicker.scss +76 -0
- package/src/components/Form/Form.stories.mdx +130 -27
- package/src/components/Form/Form.test.tsx +78 -36
- package/src/components/Form/Form.tsx +53 -19
- package/src/components/Form/FormTypes.tsx +3 -0
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +38 -0
- 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 +63 -33
- package/src/components/Heading/Heading.test.tsx +24 -16
- package/src/components/Heading/Heading.tsx +54 -38
- package/src/components/Heading/{HeadingDisplaySizes.tsx → HeadingTypes.tsx} +9 -0
- package/src/components/HelperErrorText/HelperErrorText.stories.tsx +2 -1
- package/src/components/HelperErrorText/_HelperErrorText.scss +1 -1
- package/src/components/Hero/Hero.stories.mdx +195 -85
- package/src/components/Hero/Hero.test.tsx +544 -113
- package/src/components/Hero/Hero.tsx +80 -93
- package/src/components/Hero/HeroTypes.tsx +17 -5
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +6 -1
- package/src/components/HorizontalRule/_HorizontalRule.scss +1 -1
- package/src/components/Icons/Icon.stories.mdx +89 -74
- package/src/components/Icons/Icon.test.tsx +30 -22
- package/src/components/Icons/Icon.tsx +63 -61
- package/src/components/Icons/IconSvgs.tsx +8 -0
- package/src/components/Icons/IconTypes.tsx +80 -60
- package/src/components/Image/Image.stories.tsx +2 -1
- package/src/components/Input/_Input.scss +2 -2
- package/src/components/Label/Label.stories.mdx +77 -0
- package/src/components/Label/Label.test.tsx +43 -12
- package/src/components/Label/Label.tsx +28 -45
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
- package/src/components/Link/Link.stories.mdx +47 -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 +7 -3
- package/src/components/List/List.stories.tsx +14 -9
- package/src/components/List/List.test.tsx +12 -8
- package/src/components/List/List.tsx +9 -7
- package/src/components/List/_List.scss +3 -3
- package/src/components/Modal/Modal.stories.mdx +7 -3
- package/src/components/Modal/_Modal.scss +1 -1
- package/src/components/Notification/Notification.stories.mdx +99 -65
- package/src/components/Notification/Notification.test.tsx +3 -16
- package/src/components/Notification/Notification.tsx +12 -12
- package/src/components/Notification/_Notification.scss +5 -4
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +1 -1
- package/src/components/Pagination/Pagination.stories.mdx +7 -1
- package/src/components/Pagination/Pagination.test.tsx +16 -10
- package/src/components/Radio/Radio.stories.mdx +57 -46
- package/src/components/Radio/Radio.test.tsx +92 -138
- package/src/components/Radio/Radio.tsx +70 -69
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +250 -0
- package/src/components/RadioGroup/RadioGroup.stories.mdx +247 -0
- package/src/components/RadioGroup/RadioGroup.test.tsx +327 -0
- package/src/components/RadioGroup/RadioGroup.tsx +154 -0
- package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +4 -0
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1101 -0
- package/src/components/SearchBar/SearchBar.Test.tsx +151 -16
- package/src/components/SearchBar/SearchBar.stories.mdx +196 -224
- package/src/components/SearchBar/SearchBar.tsx +151 -46
- package/src/components/Select/Select.stories.mdx +193 -168
- package/src/components/Select/Select.test.tsx +129 -324
- package/src/components/Select/Select.tsx +120 -160
- package/src/components/Select/SelectTypes.tsx +4 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +18 -29
- 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 +112 -90
- package/src/components/StyleGuide/Buttons.stories.mdx +98 -100
- package/src/components/StyleGuide/Colors.stories.mdx +336 -0
- package/src/components/StyleGuide/Forms.stories.mdx +85 -0
- package/src/components/StyleGuide/Iconography.stories.mdx +86 -93
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
- package/src/components/StyleGuide/Typography.stories.mdx +164 -166
- package/src/components/StyleGuide/UIDocCard.tsx +4 -4
- package/src/components/Tabs/Tabs.stories.mdx +221 -0
- package/src/components/Tabs/Tabs.test.tsx +264 -0
- package/src/components/Tabs/Tabs.tsx +220 -0
- 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 +90 -90
- package/src/components/TextInput/TextInput.test.tsx +103 -83
- package/src/components/TextInput/TextInput.tsx +108 -91
- package/src/components/TextInput/TextInputTypes.tsx +6 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -1
- package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
- package/src/components/VideoPlayer/_VideoPlayer.scss +1 -1
- package/src/docs/Chakra.stories.mdx +341 -0
- package/src/docs/Intro.stories.mdx +31 -24
- package/src/index.ts +70 -5
- package/src/styles/01-colors/_colors-brand.scss +6 -4
- package/src/styles/01-colors/_colors-utility.scss +14 -15
- package/src/styles/03-space/_space-inline.scss +47 -7
- package/src/styles/03-space/_space-inset.scss +33 -5
- package/src/styles/03-space/_space-stack.scss +48 -8
- package/src/styles/base/_02-breakpoints.scss +5 -4
- package/src/styles/base/_04-base.scss +2 -1
- package/src/styles/base/_place-holder.scss +1 -1
- package/src/styles/base/_typography.scss +1 -29
- package/src/styles.scss +22 -25
- package/src/theme/components/accordion.ts +30 -0
- package/src/theme/components/breadcrumb.ts +77 -0
- package/src/theme/components/button.ts +125 -0
- package/src/theme/components/checkbox.ts +107 -0
- package/src/theme/components/customCheckboxGroup.ts +12 -0
- package/src/theme/components/customRadioGroup.ts +12 -0
- package/src/theme/components/global.ts +71 -0
- package/src/theme/components/globalMixins.ts +16 -0
- package/src/theme/components/heading.ts +72 -0
- 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 +106 -0
- 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 +79 -0
- 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/breakpoints.ts +24 -0
- package/src/theme/foundations/colors.ts +208 -0
- package/src/theme/foundations/global.ts +26 -0
- package/src/theme/foundations/shadows.ts +5 -0
- package/src/theme/foundations/spacing.ts +85 -0
- package/src/theme/foundations/typography.ts +35 -0
- package/src/theme/index.ts +88 -0
- package/src/theme/provider.tsx +9 -0
- package/src/theme/types.ts +1 -0
- package/src/utils/componentCategories.ts +56 -21
- package/src/utils/utils.ts +13 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -5
- package/dist/components/Card/Card.stories.d.ts +0 -27
- package/dist/components/Label/Label.stories.d.ts +0 -12
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
- package/dist/components/Template/Template.stories.d.ts +0 -29
- package/src/components/Accordion/Accordion.stories.tsx +0 -65
- package/src/components/Accordion/_Accordion.scss +0 -81
- package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
- package/src/components/Checkbox/_Checkbox.scss +0 -97
- package/src/components/Form/_Form.scss +0 -28
- package/src/components/Heading/_Heading.scss +0 -163
- package/src/components/Hero/_Hero.scss +0 -256
- package/src/components/Icons/_Icons.scss +0 -116
- package/src/components/Label/Label.stories.tsx +0 -30
- package/src/components/Label/_Label.scss +0 -22
- package/src/components/Link/_Link.scss +0 -73
- package/src/components/Radio/_Radio.scss +0 -84
- package/src/components/SearchBar/_SearchBar.scss +0 -16
- package/src/components/Select/_Select.scss +0 -82
- package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -33
- package/src/components/StatusBadge/_StatusBadge.scss +0 -23
- package/src/components/StyleGuide/Colors.stories.tsx +0 -288
- package/src/components/Template/Template.stories.tsx +0 -85
- package/src/components/Template/_Template.scss +0 -63
- package/src/components/TextInput/_TextInput.scss +0 -59
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
.radio {
|
|
2
|
-
-webkit-appearance: none;
|
|
3
|
-
border: 2px solid $black;
|
|
4
|
-
border-radius: 50%;
|
|
5
|
-
display: inline-block;
|
|
6
|
-
height: 1.375rem;
|
|
7
|
-
outline: none;
|
|
8
|
-
position: relative;
|
|
9
|
-
vertical-align: middle;
|
|
10
|
-
width: 1.375rem;
|
|
11
|
-
|
|
12
|
-
&:before {
|
|
13
|
-
border-radius: 100%;
|
|
14
|
-
content: "";
|
|
15
|
-
display: block;
|
|
16
|
-
height: 0.75rem;
|
|
17
|
-
left: 50%;
|
|
18
|
-
position: absolute;
|
|
19
|
-
top: 50%;
|
|
20
|
-
transform: translate(-50%, -50%);
|
|
21
|
-
width: 0.75rem;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&:checked {
|
|
25
|
-
border-color: $focus;
|
|
26
|
-
|
|
27
|
-
&:before {
|
|
28
|
-
background-color: $focus;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
+ label {
|
|
33
|
-
display: inline-block;
|
|
34
|
-
font-size: var(--font-size-0);
|
|
35
|
-
font-weight: 300;
|
|
36
|
-
margin-bottom: 0px;
|
|
37
|
-
margin-left: var(--space-xs);
|
|
38
|
-
vertical-align: middle;
|
|
39
|
-
|
|
40
|
-
+ .helper-text {
|
|
41
|
-
margin-bottom: 0;
|
|
42
|
-
margin-left: calc(22px + var(--space-xs));
|
|
43
|
-
margin-top: var(--space-xs);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&--error {
|
|
48
|
-
border-color: $error;
|
|
49
|
-
|
|
50
|
-
+ label {
|
|
51
|
-
color: $error;
|
|
52
|
-
|
|
53
|
-
+ .helper-text {
|
|
54
|
-
color: $error;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&:checked {
|
|
59
|
-
border-color: $error;
|
|
60
|
-
|
|
61
|
-
&:before {
|
|
62
|
-
background-color: $error;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&:disabled {
|
|
68
|
-
border-color: $gray-medium;
|
|
69
|
-
|
|
70
|
-
&:before {
|
|
71
|
-
background-color: $gray-medium;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
+ label {
|
|
75
|
-
color: $gray-dark;
|
|
76
|
-
font-style: italic;
|
|
77
|
-
|
|
78
|
-
+ .helper-text {
|
|
79
|
-
color: $gray-dark;
|
|
80
|
-
font-style: italic;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// CSS-only select styling (from https://github.com/filamentgroup/select-css)
|
|
2
|
-
.select {
|
|
3
|
-
@include space-stack-xs;
|
|
4
|
-
|
|
5
|
-
.selectfield {
|
|
6
|
-
-moz-appearance: none;
|
|
7
|
-
-webkit-appearance: none;
|
|
8
|
-
appearance: none;
|
|
9
|
-
background-color: var(--ui-white);
|
|
10
|
-
/* Arrow svg */
|
|
11
|
-
/* More info here: https://css-tricks.com/probably-dont-base64-svg/ */
|
|
12
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E%3Cpath d='M10.526 12.871L.263 1.676 1.737.324 12 11.52 22.263.324l1.474 1.352L13.474 12.87a2 2 0 01-2.948 0z'/%3E%3C/svg%3E");
|
|
13
|
-
background-position: right 0.7em top 70%;
|
|
14
|
-
background-repeat: no-repeat;
|
|
15
|
-
background-size: var(--space) auto;
|
|
16
|
-
border: 1px solid var(--ui-gray-medium);
|
|
17
|
-
border-radius: 2px;
|
|
18
|
-
display: block;
|
|
19
|
-
font-size: 1rem;
|
|
20
|
-
padding: var(--space-xs) var(--space-xl) var(--space-xs) var(--space-s);
|
|
21
|
-
width: 100%;
|
|
22
|
-
|
|
23
|
-
/* Hide arrow icon in IE browsers */
|
|
24
|
-
&::-ms-expand {
|
|
25
|
-
display: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:hover {
|
|
29
|
-
border-color: var(--ui-gray-medium);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:active,
|
|
33
|
-
&:focus {
|
|
34
|
-
border: 1px solid var(--ui-focus);
|
|
35
|
-
box-shadow: 0;
|
|
36
|
-
outline: 1px solid var(--ui-focus);
|
|
37
|
-
z-index: 9999;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&:disabled {
|
|
41
|
-
background-color: var(--ui-gray-xxlight);
|
|
42
|
-
color: var(--ui-gray-xdark);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&--error {
|
|
46
|
-
border: 1px solid var(--ui-error);
|
|
47
|
-
|
|
48
|
-
&:hover,
|
|
49
|
-
&:active,
|
|
50
|
-
&:focus,
|
|
51
|
-
&:active:hover,
|
|
52
|
-
&:focus:hover {
|
|
53
|
-
border: 1px solid var(--ui-error);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
> .helper-text {
|
|
59
|
-
margin-bottom: 0;
|
|
60
|
-
margin-top: var(--space-xs);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* Support for rtl text, explicit support for Arabic and Hebrew */
|
|
65
|
-
*[dir="rtl"] .nypl-ds .select,
|
|
66
|
-
:root:lang(ar) .nypl-ds .select,
|
|
67
|
-
:root:lang(iw) .nypl-ds .select {
|
|
68
|
-
background-position: left 0.7em top 70%;
|
|
69
|
-
padding: var(--space-xs) var(--space-l) var(--space-xs) var(--space-s);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Disabled styles */
|
|
73
|
-
.select-css:disabled,
|
|
74
|
-
.select-css[aria-disabled="true"] {
|
|
75
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.526 12.871L.263 1.676 1.737.324 12 11.52 22.263.324l1.474 1.352L13.474 12.87a2 2 0 01-2.948 0z'/%3E%3C/svg%3E");
|
|
76
|
-
color: var(--ui-gray-xdark);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.select-css:disabled:hover,
|
|
80
|
-
.select-css[aria-disabled="true"] {
|
|
81
|
-
border-color: #aaa;
|
|
82
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { Story } from "@storybook/react/types-6-0";
|
|
4
|
-
import StatusBadge, { StatusBadgeProps } from "./StatusBadge";
|
|
5
|
-
import { withDesign } from "storybook-addon-designs";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: "Status Badge",
|
|
9
|
-
component: StatusBadge,
|
|
10
|
-
decorators: [withDesign],
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const StatusBadgeTemplate: Story<StatusBadgeProps> = (args) => (
|
|
14
|
-
<StatusBadge {...args} />
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export const statusBadge = StatusBadgeTemplate.bind({});
|
|
18
|
-
|
|
19
|
-
// The `args` allow these props to be updated in the UI through the
|
|
20
|
-
// "Controls" tab.
|
|
21
|
-
statusBadge.args = {
|
|
22
|
-
children: "Location is temporarily closed",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
statusBadge.storyName = "Status Badge";
|
|
26
|
-
statusBadge.parameters = {
|
|
27
|
-
design: {
|
|
28
|
-
type: "figma",
|
|
29
|
-
url:
|
|
30
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=11256%3A0",
|
|
31
|
-
},
|
|
32
|
-
jest: ["StatusBadge.test.tsx"],
|
|
33
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.status-badge {
|
|
2
|
-
border-radius: var(--space-xxs);
|
|
3
|
-
color: var(--ui-black);
|
|
4
|
-
display: block;
|
|
5
|
-
font-size: var(--font-size--1);
|
|
6
|
-
font-style: italic;
|
|
7
|
-
padding: var(--space-xxs) var(--space-xs);
|
|
8
|
-
text-align: center;
|
|
9
|
-
width: fit-content;
|
|
10
|
-
width: -moz-fit-content;
|
|
11
|
-
|
|
12
|
-
&--low {
|
|
13
|
-
background-color: var(--ui-gray-light);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&--medium {
|
|
17
|
-
background-color: #f9e08e;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&--high {
|
|
21
|
-
background-color: #fbe7e1;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { select } from "@storybook/addon-knobs";
|
|
4
|
-
import cssVariables from "../../helpers/CSSVariablesHelper";
|
|
5
|
-
import getCSSVariable from "../../helpers/getCSSVariable";
|
|
6
|
-
import UIDocCard from "./UIDocCard";
|
|
7
|
-
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
|
8
|
-
import List from "../List/List";
|
|
9
|
-
import Heading from "../Heading/Heading";
|
|
10
|
-
import { ListTypes } from "../List/ListTypes";
|
|
11
|
-
import { CSSVariablesInterface } from "../../interfaces";
|
|
12
|
-
import sections from "../../utils/siteSections";
|
|
13
|
-
import { getCategory } from "../../utils/componentCategories";
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
title: getCategory("Colors"),
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const uiVariables: CSSVariablesInterface = {};
|
|
20
|
-
const grayScaleVariables: CSSVariablesInterface = {};
|
|
21
|
-
|
|
22
|
-
for (const [key, value] of Object.entries(cssVariables)) {
|
|
23
|
-
if (key.startsWith(" --ui-gray")) {
|
|
24
|
-
grayScaleVariables[key] = value;
|
|
25
|
-
} else if (key.startsWith(" --ui")) {
|
|
26
|
-
uiVariables[key] = value;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const uiVariableDocs = [];
|
|
31
|
-
const grayscaleDocs = [];
|
|
32
|
-
|
|
33
|
-
const makeUIDocCard = function (key, value, docArray: React.ReactElement[]) {
|
|
34
|
-
docArray.push(
|
|
35
|
-
<li style={{ textAlign: "center" }}>
|
|
36
|
-
<UIDocCard backgroundColor={value}>
|
|
37
|
-
{key}: {value}
|
|
38
|
-
</UIDocCard>
|
|
39
|
-
</li>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
for (const [key, value] of Object.entries(uiVariables)) {
|
|
44
|
-
makeUIDocCard(key, value, uiVariableDocs);
|
|
45
|
-
}
|
|
46
|
-
for (const [key, value] of Object.entries(grayScaleVariables)) {
|
|
47
|
-
makeUIDocCard(key, value, grayscaleDocs);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const sectionDefault = sections[3];
|
|
51
|
-
|
|
52
|
-
export const colorsBrand = () => (
|
|
53
|
-
<>
|
|
54
|
-
<Heading level={1}>Brand</Heading>
|
|
55
|
-
<p>Brand fills are the NYPL primary and secondary colors.</p>
|
|
56
|
-
<List
|
|
57
|
-
type={ListTypes.Unordered}
|
|
58
|
-
modifiers={["no-list-styling"]}
|
|
59
|
-
className="card-grid__cards"
|
|
60
|
-
>
|
|
61
|
-
<li style={{ textAlign: "center" }}>
|
|
62
|
-
<UIDocCard backgroundColor={getCSSVariable("--brand-primary")}>
|
|
63
|
-
--brand-primary: {getCSSVariable("--brand-primary")}
|
|
64
|
-
</UIDocCard>
|
|
65
|
-
</li>
|
|
66
|
-
<li style={{ textAlign: "center" }}>
|
|
67
|
-
<UIDocCard backgroundColor={getCSSVariable("--brand-secondary")}>
|
|
68
|
-
--brand-secondary: {getCSSVariable("--brand-secondary")}
|
|
69
|
-
</UIDocCard>
|
|
70
|
-
</li>
|
|
71
|
-
</List>
|
|
72
|
-
<Heading level={1}>Section Colors</Heading>
|
|
73
|
-
<Heading level={2}>{"What's On"}</Heading>
|
|
74
|
-
<p>
|
|
75
|
-
Section colors are branding colors only in use at NYPL. Certain
|
|
76
|
-
components, such as Breadcrumbs below, change color based on the modifier
|
|
77
|
-
applied the body tag.
|
|
78
|
-
</p>
|
|
79
|
-
<div
|
|
80
|
-
className={
|
|
81
|
-
select("Section", sections, sectionDefault) +
|
|
82
|
-
" storybook-breadcrumbsExample"
|
|
83
|
-
}
|
|
84
|
-
style={{ marginBottom: "2%", display: "flex", width: "100%" }}
|
|
85
|
-
>
|
|
86
|
-
<Breadcrumbs
|
|
87
|
-
breadcrumbs={[
|
|
88
|
-
{ url: "#", text: "Parent" },
|
|
89
|
-
{ url: "#", text: "Home" },
|
|
90
|
-
]}
|
|
91
|
-
/>
|
|
92
|
-
<div
|
|
93
|
-
style={{
|
|
94
|
-
flex: "1 1 50%",
|
|
95
|
-
backgroundColor: "var(--ui-gray-xlight)",
|
|
96
|
-
padding: "2%",
|
|
97
|
-
}}
|
|
98
|
-
>
|
|
99
|
-
<pre>
|
|
100
|
-
<code>
|
|
101
|
-
{"<div className="}
|
|
102
|
-
{"'" + select("Section", sections, sectionDefault) + "'"}
|
|
103
|
-
{">\n"}
|
|
104
|
-
{" <Breadcrumbs...></Breadcrumbs>"}
|
|
105
|
-
{"\n"}
|
|
106
|
-
{"</div>"}
|
|
107
|
-
</code>
|
|
108
|
-
</pre>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
<p>What's On is used for Events, Exhibitions & Audio Guides.</p>
|
|
112
|
-
<List
|
|
113
|
-
type={ListTypes.Unordered}
|
|
114
|
-
modifiers={["no-list-styling"]}
|
|
115
|
-
className="card-grid__cards"
|
|
116
|
-
>
|
|
117
|
-
<li style={{ textAlign: "center" }}>
|
|
118
|
-
<UIDocCard
|
|
119
|
-
backgroundColor={getCSSVariable("--section-whats-on-primary")}
|
|
120
|
-
>
|
|
121
|
-
--section-whats-on-primary:{" "}
|
|
122
|
-
{getCSSVariable("--section-whats-on-primary")}
|
|
123
|
-
</UIDocCard>
|
|
124
|
-
</li>
|
|
125
|
-
<li style={{ textAlign: "center" }}>
|
|
126
|
-
<UIDocCard
|
|
127
|
-
backgroundColor={getCSSVariable("--section-whats-on-secondary")}
|
|
128
|
-
>
|
|
129
|
-
--section-whats-on-secondary:{" "}
|
|
130
|
-
{getCSSVariable("--section-whats-on-secondary")}
|
|
131
|
-
</UIDocCard>
|
|
132
|
-
</li>
|
|
133
|
-
</List>
|
|
134
|
-
<Heading level={2}>Books and More</Heading>
|
|
135
|
-
<p>
|
|
136
|
-
Books and More is used for the Catalog, Staff Picks, Recommendations, New
|
|
137
|
-
Arrivals, and E-Book Central.
|
|
138
|
-
</p>
|
|
139
|
-
<List
|
|
140
|
-
type={ListTypes.Unordered}
|
|
141
|
-
modifiers={["no-list-styling"]}
|
|
142
|
-
className="card-grid__cards"
|
|
143
|
-
>
|
|
144
|
-
<li style={{ textAlign: "center" }}>
|
|
145
|
-
<UIDocCard
|
|
146
|
-
backgroundColor={getCSSVariable("--section-books-and-more-primary")}
|
|
147
|
-
>
|
|
148
|
-
--section-books-and-more-primary:{" "}
|
|
149
|
-
{getCSSVariable("--section-books-and-more-primary")}
|
|
150
|
-
</UIDocCard>
|
|
151
|
-
</li>
|
|
152
|
-
<li style={{ textAlign: "center" }}>
|
|
153
|
-
<UIDocCard
|
|
154
|
-
backgroundColor={getCSSVariable("--section-books-and-more-secondary")}
|
|
155
|
-
>
|
|
156
|
-
--section-books-and-more-secondary:{" "}
|
|
157
|
-
{getCSSVariable("--section-books-and-more-secondary")}
|
|
158
|
-
</UIDocCard>
|
|
159
|
-
</li>
|
|
160
|
-
</List>
|
|
161
|
-
<Heading level={2}>Research</Heading>
|
|
162
|
-
<p>Research is used for the Research Catalog and SCC.</p>
|
|
163
|
-
<List
|
|
164
|
-
type={ListTypes.Unordered}
|
|
165
|
-
modifiers={["no-list-styling"]}
|
|
166
|
-
className="card-grid__cards"
|
|
167
|
-
>
|
|
168
|
-
<li style={{ textAlign: "center" }}>
|
|
169
|
-
<UIDocCard
|
|
170
|
-
backgroundColor={getCSSVariable("--section-research-primary")}
|
|
171
|
-
>
|
|
172
|
-
--section-research-primary:{" "}
|
|
173
|
-
{getCSSVariable("--section-research-primary")}
|
|
174
|
-
</UIDocCard>
|
|
175
|
-
</li>
|
|
176
|
-
<li style={{ textAlign: "center" }}>
|
|
177
|
-
<UIDocCard
|
|
178
|
-
backgroundColor={getCSSVariable("--section-research-secondary")}
|
|
179
|
-
>
|
|
180
|
-
--section-research-secondary:{" "}
|
|
181
|
-
{getCSSVariable("--section-research-secondary")}
|
|
182
|
-
</UIDocCard>
|
|
183
|
-
</li>
|
|
184
|
-
</List>
|
|
185
|
-
<Heading level={2}>Locations</Heading>
|
|
186
|
-
<p>
|
|
187
|
-
Locations is used for Location Finder and all branch pages with the
|
|
188
|
-
exceptions of some research libraries.
|
|
189
|
-
</p>
|
|
190
|
-
<List
|
|
191
|
-
type={ListTypes.Unordered}
|
|
192
|
-
modifiers={["no-list-styling"]}
|
|
193
|
-
className="card-grid__cards"
|
|
194
|
-
>
|
|
195
|
-
<li style={{ textAlign: "center" }}>
|
|
196
|
-
<UIDocCard
|
|
197
|
-
backgroundColor={getCSSVariable("--section-locations-primary")}
|
|
198
|
-
>
|
|
199
|
-
--section-locations-primary:{" "}
|
|
200
|
-
{getCSSVariable("--section-locations-primary")}
|
|
201
|
-
</UIDocCard>
|
|
202
|
-
</li>
|
|
203
|
-
<li style={{ textAlign: "center" }}>
|
|
204
|
-
<UIDocCard
|
|
205
|
-
backgroundColor={getCSSVariable("--section-locations-secondary")}
|
|
206
|
-
>
|
|
207
|
-
--section-locations-secondary:{" "}
|
|
208
|
-
{getCSSVariable("--section-locations-secondary")}
|
|
209
|
-
</UIDocCard>
|
|
210
|
-
</li>
|
|
211
|
-
</List>
|
|
212
|
-
<Heading level={2}>Research Libraries</Heading>
|
|
213
|
-
<p>Research libraries with specific brand colors to adhere to.</p>
|
|
214
|
-
<List
|
|
215
|
-
type={ListTypes.Unordered}
|
|
216
|
-
modifiers={["no-list-styling"]}
|
|
217
|
-
className="card-grid__cards"
|
|
218
|
-
>
|
|
219
|
-
<li style={{ textAlign: "center" }}>
|
|
220
|
-
<UIDocCard
|
|
221
|
-
backgroundColor={getCSSVariable("--section-research-library-lpa")}
|
|
222
|
-
>
|
|
223
|
-
--section-research-library-lpa:{" "}
|
|
224
|
-
{getCSSVariable("--section-research-library-lpa")}
|
|
225
|
-
</UIDocCard>
|
|
226
|
-
</li>
|
|
227
|
-
<li style={{ textAlign: "center" }}>
|
|
228
|
-
<UIDocCard
|
|
229
|
-
backgroundColor={getCSSVariable(
|
|
230
|
-
"--section-research-library-schomburg"
|
|
231
|
-
)}
|
|
232
|
-
>
|
|
233
|
-
--section-research-library-schomburg:{" "}
|
|
234
|
-
{getCSSVariable("--section-research-library-schomburg")}
|
|
235
|
-
</UIDocCard>
|
|
236
|
-
</li>
|
|
237
|
-
<li style={{ textAlign: "center" }}>
|
|
238
|
-
<UIDocCard
|
|
239
|
-
backgroundColor={getCSSVariable(
|
|
240
|
-
"--section-research-library-schwartzman"
|
|
241
|
-
)}
|
|
242
|
-
>
|
|
243
|
-
--section-research-library-schwartzman:{" "}
|
|
244
|
-
{getCSSVariable("--section-research-library-schwartzman")}
|
|
245
|
-
</UIDocCard>
|
|
246
|
-
</li>
|
|
247
|
-
</List>
|
|
248
|
-
</>
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
colorsBrand.storyName = "Colors—Brand";
|
|
252
|
-
colorsBrand.parameters = {
|
|
253
|
-
design: {
|
|
254
|
-
type: "figma",
|
|
255
|
-
url:
|
|
256
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=15454%3A47007",
|
|
257
|
-
},
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
export const colorsUtility = () => (
|
|
261
|
-
<>
|
|
262
|
-
<Heading level={1}>Utility Colors</Heading>
|
|
263
|
-
<List
|
|
264
|
-
type={ListTypes.Unordered}
|
|
265
|
-
modifiers={["no-list-styling"]}
|
|
266
|
-
className="card-grid__cards"
|
|
267
|
-
>
|
|
268
|
-
{uiVariableDocs}
|
|
269
|
-
</List>
|
|
270
|
-
<Heading level={1}>Grayscale</Heading>
|
|
271
|
-
<List
|
|
272
|
-
type={ListTypes.Unordered}
|
|
273
|
-
modifiers={["no-list-styling"]}
|
|
274
|
-
className="card-grid__cards"
|
|
275
|
-
>
|
|
276
|
-
{grayscaleDocs}
|
|
277
|
-
</List>
|
|
278
|
-
</>
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
colorsUtility.storyName = "Colors—Utility";
|
|
282
|
-
colorsUtility.parameters = {
|
|
283
|
-
design: {
|
|
284
|
-
type: "figma",
|
|
285
|
-
url:
|
|
286
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=14989%3A37",
|
|
287
|
-
},
|
|
288
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import bem from "../../utils/bem";
|
|
3
|
-
import Placeholder from "../Placeholder/Placeholder";
|
|
4
|
-
import { withDesign } from "storybook-addon-designs";
|
|
5
|
-
import { Meta } from "@storybook/react/types-6-0";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: "Template",
|
|
9
|
-
decorators: [withDesign],
|
|
10
|
-
} as Meta;
|
|
11
|
-
|
|
12
|
-
export const Template = ({ showSidebar, sidebarSide }) => (
|
|
13
|
-
<>
|
|
14
|
-
<div className={bem("layout-container nypl-ds")}>
|
|
15
|
-
<header className={bem("header")}>
|
|
16
|
-
<Placeholder modifiers={["short"]}>NYPL Header</Placeholder>
|
|
17
|
-
|
|
18
|
-
<div className="content-header">
|
|
19
|
-
{<Placeholder modifiers={["short"]}>Breadcrumbs</Placeholder>}
|
|
20
|
-
{<Placeholder modifiers={["short"]}>Hero</Placeholder>}
|
|
21
|
-
</div>
|
|
22
|
-
</header>
|
|
23
|
-
|
|
24
|
-
<main className={showSidebar ? bem("main", ["with-sidebar"]) : "main"}>
|
|
25
|
-
<div className="content-top">
|
|
26
|
-
{<Placeholder>Content Top</Placeholder>}
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
{showSidebar && sidebarSide === "left" && (
|
|
30
|
-
<div className={bem("content-secondary", ["with-sidebar-left"])}>
|
|
31
|
-
<Placeholder>Left Sidebar</Placeholder>
|
|
32
|
-
</div>
|
|
33
|
-
)}
|
|
34
|
-
|
|
35
|
-
{showSidebar && sidebarSide === "left" && (
|
|
36
|
-
<div className={bem("content-primary", ["with-sidebar-left"])}>
|
|
37
|
-
<Placeholder>Main Content</Placeholder>
|
|
38
|
-
<div className="content-bottom">
|
|
39
|
-
{<Placeholder>Content Bottom</Placeholder>}
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
)}
|
|
43
|
-
{showSidebar && sidebarSide === "right" && (
|
|
44
|
-
<div className={bem("content-primary", ["with-sidebar-right"])}>
|
|
45
|
-
<Placeholder>Main Content</Placeholder>
|
|
46
|
-
<div className="content-bottom">
|
|
47
|
-
{<Placeholder>Content Bottom</Placeholder>}
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
)}
|
|
51
|
-
{!showSidebar && (
|
|
52
|
-
<div className={bem("content-primary")}>
|
|
53
|
-
<Placeholder>Main Content</Placeholder>
|
|
54
|
-
<div className="content-bottom">
|
|
55
|
-
{<Placeholder>Content Bottom</Placeholder>}
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
)}
|
|
59
|
-
|
|
60
|
-
{showSidebar && sidebarSide === "right" && (
|
|
61
|
-
<div className={bem("content-secondary", ["with-sidebar-right"])}>
|
|
62
|
-
<Placeholder>Right Sidebar</Placeholder>
|
|
63
|
-
</div>
|
|
64
|
-
)}
|
|
65
|
-
</main>
|
|
66
|
-
</div>
|
|
67
|
-
<footer className={bem("footer")}>
|
|
68
|
-
<Placeholder>Footer</Placeholder>
|
|
69
|
-
</footer>
|
|
70
|
-
</>
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
Template.args = { showSidebar: true, sidebarSide: "left" };
|
|
74
|
-
Template.argTypes = {
|
|
75
|
-
sidebarSide: { control: { type: "select", options: ["left", "right"] } },
|
|
76
|
-
};
|
|
77
|
-
Template.storyName = "Template";
|
|
78
|
-
Template.parameters = {
|
|
79
|
-
design: {
|
|
80
|
-
type: "figma",
|
|
81
|
-
url:
|
|
82
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11982%3A47778",
|
|
83
|
-
},
|
|
84
|
-
layout: "fullscreen",
|
|
85
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
$sidebar-width: 25%;
|
|
2
|
-
$sidebar-width-s: calc(25% - calc(4 * var(--space-s)));
|
|
3
|
-
|
|
4
|
-
.main {
|
|
5
|
-
@include wrapper;
|
|
6
|
-
|
|
7
|
-
display: block; // Fix for IE weirdness
|
|
8
|
-
|
|
9
|
-
&--with-sidebar {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-flow: column nowrap;
|
|
12
|
-
|
|
13
|
-
@include breakpoint($breakpoint-medium) {
|
|
14
|
-
flex-flow: row wrap;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.content-header {
|
|
20
|
-
@include breakout;
|
|
21
|
-
|
|
22
|
-
width: 100vw;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.content-top {
|
|
26
|
-
flex: 1 0 100%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.content-primary {
|
|
30
|
-
flex: 1 1;
|
|
31
|
-
width: 100%;
|
|
32
|
-
|
|
33
|
-
&--with-sidebar-left {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-flow: column nowrap;
|
|
36
|
-
order: 1;
|
|
37
|
-
|
|
38
|
-
@include breakpoint($breakpoint-medium) {
|
|
39
|
-
@include space-inline-none;
|
|
40
|
-
|
|
41
|
-
min-width: 0;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.content-secondary {
|
|
47
|
-
flex: 0 0 $sidebar-width;
|
|
48
|
-
|
|
49
|
-
@include breakpoint($breakpoint-medium) {
|
|
50
|
-
order: 1;
|
|
51
|
-
|
|
52
|
-
&--with-sidebar-left {
|
|
53
|
-
@include space-inline-l;
|
|
54
|
-
|
|
55
|
-
flex-basis: $sidebar-width-s;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&--with-sidebar-right {
|
|
59
|
-
flex-basis: $sidebar-width-s;
|
|
60
|
-
margin-left: var(--space-l);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|