@nypl/design-system-react-components 0.25.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/components/Accordion/Accordion.d.ts +14 -14
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -14
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
- package/dist/components/Button/ButtonTypes.d.ts +2 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/CardTypes.d.ts +2 -2
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +43 -0
- package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.d.ts +3 -3
- package/dist/components/Form/Form.d.ts +13 -8
- package/dist/components/Form/FormTypes.d.ts +2 -8
- package/dist/components/Grid/GridTypes.d.ts +9 -0
- package/dist/components/Grid/SimpleGrid.d.ts +14 -0
- package/dist/components/Heading/Heading.d.ts +4 -4
- package/dist/components/Hero/Hero.d.ts +19 -14
- package/dist/components/Hero/HeroTypes.d.ts +10 -5
- package/dist/components/Icons/Icon.d.ts +13 -16
- package/dist/components/Icons/IconTypes.d.ts +78 -64
- package/dist/components/Label/Label.d.ts +5 -17
- package/dist/components/Link/Link.d.ts +8 -12
- package/dist/components/SearchBar/SearchBar.d.ts +45 -27
- package/dist/components/Select/Select.d.ts +32 -35
- package/dist/components/Select/SelectTypes.d.ts +4 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +1 -1
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +2 -2
- package/dist/components/StatusBadge/StatusBadge.d.ts +8 -6
- package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +5 -0
- package/dist/components/Template/Template.d.ts +91 -0
- package/dist/components/Text/Text.d.ts +16 -0
- package/dist/components/Text/TextTypes.d.ts +6 -0
- package/dist/components/TextInput/TextInput.d.ts +32 -31
- package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
- package/dist/design-system-react-components.cjs.development.js +2597 -1170
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +2580 -1173
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/styles.css +1 -1
- package/dist/theme/components/accordion.d.ts +25 -0
- package/dist/theme/components/breadcrumb.d.ts +90 -0
- package/dist/theme/components/button.d.ts +17 -7
- package/dist/theme/components/checkbox.d.ts +7 -7
- package/dist/theme/components/customCheckboxGroup.d.ts +18 -0
- package/dist/theme/components/customRadioGroup.d.ts +4 -3
- package/dist/theme/components/global.d.ts +55 -0
- package/dist/theme/components/globalMixins.d.ts +15 -0
- package/dist/theme/components/heading.d.ts +50 -20
- package/dist/theme/components/hero.d.ts +492 -0
- package/dist/theme/components/icon.d.ts +13 -0
- package/dist/theme/components/label.d.ts +16 -0
- package/dist/theme/components/link.d.ts +45 -0
- package/dist/theme/components/radio.d.ts +8 -7
- package/dist/theme/components/searchBar.d.ts +20 -0
- package/dist/theme/components/select.d.ts +58 -0
- package/dist/theme/components/statusBadge.d.ts +25 -0
- package/dist/theme/components/tabs.d.ts +9 -9
- package/dist/theme/components/template.d.ts +105 -0
- package/dist/theme/components/text.d.ts +20 -0
- package/dist/theme/components/textInput.d.ts +105 -0
- package/dist/theme/foundations/global.d.ts +3 -0
- package/dist/theme/foundations/shadows.d.ts +4 -0
- package/dist/utils/utils.d.ts +6 -0
- package/package.json +3 -2
- package/src/components/Accordion/Accordion.stories.mdx +227 -33
- package/src/components/Accordion/Accordion.test.tsx +135 -19
- package/src/components/Accordion/Accordion.tsx +81 -56
- package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
- package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -1
- package/src/components/Autosuggest/_Autosuggest.scss +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +46 -52
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +31 -25
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +71 -73
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +6 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +100 -0
- package/src/components/Button/Button.stories.mdx +31 -27
- package/src/components/Button/Button.test.tsx +17 -5
- package/src/components/Button/ButtonTypes.tsx +1 -0
- package/src/components/Button/_Button.scss +3 -27
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +11 -0
- package/src/components/Card/Card.stories.mdx +24 -20
- package/src/components/Card/Card.test.tsx +13 -19
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Card/CardTypes.tsx +2 -2
- package/src/components/Card/_Card.scss +1 -1
- package/src/components/CardEdition/CardEdition.stories.tsx +11 -6
- package/src/components/CardEdition/CardEdition.test.tsx +23 -31
- package/src/components/CardEdition/_CardEdition.scss +2 -2
- package/src/components/Chakra/Center.stories.mdx +31 -14
- package/src/components/Chakra/Grid.stories.mdx +79 -0
- package/src/components/Chakra/Stack.stories.mdx +4 -4
- package/src/components/Checkbox/Checkbox.tsx +9 -12
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +2 -5
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +249 -0
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +345 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +148 -0
- package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +4 -0
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1360 -0
- package/src/components/DatePicker/DatePicker.test.tsx +4 -4
- package/src/components/DatePicker/DatePicker.tsx +13 -13
- package/src/components/DatePicker/_DatePicker.scss +1 -0
- package/src/components/Form/Form.stories.mdx +46 -21
- package/src/components/Form/Form.test.tsx +58 -45
- package/src/components/Form/Form.tsx +49 -21
- package/src/components/Form/FormTypes.tsx +3 -8
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +24 -14
- package/src/components/Grid/GridTypes.tsx +9 -0
- package/src/components/Grid/SimpleGrid.stories.mdx +275 -0
- package/src/components/Grid/SimpleGrid.test.tsx +66 -0
- package/src/components/Grid/SimpleGrid.tsx +37 -0
- package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +8 -0
- package/src/components/Heading/Heading.stories.mdx +1 -0
- package/src/components/Heading/Heading.tsx +12 -6
- package/src/components/HelperErrorText/_HelperErrorText.scss +1 -1
- package/src/components/Hero/Hero.stories.mdx +188 -121
- package/src/components/Hero/Hero.test.tsx +537 -107
- package/src/components/Hero/Hero.tsx +79 -92
- package/src/components/Hero/HeroTypes.tsx +17 -5
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
- package/src/components/HorizontalRule/_HorizontalRule.scss +1 -1
- package/src/components/Icons/Icon.stories.mdx +83 -74
- package/src/components/Icons/Icon.test.tsx +30 -22
- package/src/components/Icons/Icon.tsx +63 -61
- package/src/components/Icons/IconTypes.tsx +80 -64
- package/src/components/Input/_Input.scss +2 -2
- package/src/components/Label/Label.stories.mdx +28 -7
- package/src/components/Label/Label.test.tsx +43 -12
- package/src/components/Label/Label.tsx +21 -34
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
- package/src/components/Link/Link.stories.mdx +41 -41
- package/src/components/Link/Link.test.tsx +33 -44
- package/src/components/Link/Link.tsx +114 -100
- package/src/components/List/List.stories.mdx +0 -2
- package/src/components/List/List.stories.tsx +5 -5
- package/src/components/List/_List.scss +3 -3
- package/src/components/Modal/_Modal.scss +1 -1
- package/src/components/Notification/Notification.stories.mdx +12 -1
- package/src/components/Notification/Notification.test.tsx +3 -16
- package/src/components/Notification/Notification.tsx +9 -10
- package/src/components/Notification/_Notification.scss +4 -4
- package/src/components/Pagination/Pagination.test.tsx +16 -10
- package/src/components/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/components/RadioGroup/RadioGroup.tsx +2 -10
- package/src/components/SearchBar/SearchBar.Test.tsx +151 -16
- package/src/components/SearchBar/SearchBar.stories.mdx +189 -219
- package/src/components/SearchBar/SearchBar.tsx +151 -46
- package/src/components/Select/Select.stories.mdx +188 -170
- package/src/components/Select/Select.test.tsx +125 -380
- package/src/components/Select/Select.tsx +118 -165
- package/src/components/Select/SelectTypes.tsx +4 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +13 -25
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -7
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +4 -2
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +2 -2
- package/src/components/SkeletonLoader/_SkeletonLoader.scss +3 -3
- package/src/components/StatusBadge/StatusBadge.stories.mdx +91 -0
- package/src/components/StatusBadge/StatusBadge.test.tsx +35 -7
- package/src/components/StatusBadge/StatusBadge.tsx +24 -25
- package/src/components/StatusBadge/StatusBadgeTypes.tsx +5 -0
- package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +28 -0
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +16 -16
- package/src/components/StyleGuide/Buttons.stories.mdx +15 -15
- package/src/components/StyleGuide/Colors.stories.mdx +336 -0
- package/src/components/StyleGuide/Iconography.stories.mdx +88 -90
- package/src/components/StyleGuide/UIDocCard.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +7 -9
- package/src/components/Template/Template.stories.mdx +574 -0
- package/src/components/Template/Template.test.tsx +124 -0
- package/src/components/Template/Template.tsx +226 -0
- package/src/components/Text/Text.stories.mdx +70 -0
- package/src/components/Text/Text.test.tsx +63 -0
- package/src/components/Text/Text.tsx +55 -0
- package/src/components/Text/TextTypes.tsx +6 -0
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +33 -0
- package/src/components/TextInput/TextInput.stories.mdx +89 -90
- package/src/components/TextInput/TextInput.test.tsx +65 -86
- package/src/components/TextInput/TextInput.tsx +101 -95
- package/src/components/TextInput/TextInputTypes.tsx +6 -0
- package/src/components/VideoPlayer/_VideoPlayer.scss +1 -1
- package/src/docs/Chakra.stories.mdx +4 -4
- package/src/docs/Intro.stories.mdx +15 -13
- package/src/index.ts +20 -0
- package/src/styles/01-colors/_colors-brand.scss +6 -0
- package/src/styles/01-colors/_colors-utility.scss +14 -12
- package/src/styles/base/_04-base.scss +2 -1
- package/src/styles/base/_place-holder.scss +1 -1
- package/src/styles.scss +10 -12
- package/src/theme/components/accordion.ts +30 -0
- package/src/theme/components/breadcrumb.ts +77 -0
- package/src/theme/components/button.ts +77 -63
- package/src/theme/components/checkbox.ts +15 -27
- package/src/theme/components/customCheckboxGroup.ts +12 -0
- package/src/theme/components/customRadioGroup.ts +4 -10
- package/src/theme/components/global.ts +71 -0
- package/src/theme/components/globalMixins.ts +16 -0
- package/src/theme/components/heading.ts +15 -8
- package/src/theme/components/hero.ts +239 -0
- package/src/theme/components/icon.ts +79 -0
- package/src/theme/components/label.ts +17 -0
- package/src/theme/components/link.ts +47 -0
- package/src/theme/components/radio.ts +20 -31
- package/src/theme/components/searchBar.ts +21 -0
- package/src/theme/components/select.ts +50 -0
- package/src/theme/components/statusBadge.ts +27 -0
- package/src/theme/components/tabs.ts +72 -69
- package/src/theme/components/template.ts +114 -0
- package/src/theme/components/text.ts +31 -0
- package/src/theme/components/textInput.ts +61 -0
- package/src/theme/foundations/colors.ts +29 -13
- package/src/theme/foundations/global.ts +3 -0
- package/src/theme/foundations/shadows.ts +5 -0
- package/src/theme/index.ts +37 -7
- package/src/utils/componentCategories.ts +8 -2
- package/src/utils/utils.ts +13 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -6
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
- package/dist/components/StyleGuide/Colors.stories.d.ts +0 -25
- package/dist/components/Template/Template.stories.d.ts +0 -30
- package/src/components/Accordion/Accordion.stories.tsx +0 -66
- package/src/components/Accordion/_Accordion.scss +0 -81
- package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
- package/src/components/Form/_Form.scss +0 -67
- package/src/components/Hero/_Hero.scss +0 -256
- package/src/components/Icons/_Icons.scss +0 -116
- package/src/components/Label/_Label.scss +0 -22
- package/src/components/Link/_Link.scss +0 -73
- package/src/components/SearchBar/_SearchBar.scss +0 -16
- package/src/components/Select/_Select.scss +0 -82
- package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -34
- package/src/components/StatusBadge/_StatusBadge.scss +0 -23
- package/src/components/StyleGuide/Colors.stories.tsx +0 -289
- package/src/components/Template/Template.stories.tsx +0 -86
- package/src/components/Template/_Template.scss +0 -63
- package/src/components/TextInput/_TextInput.scss +0 -59
|
@@ -1,289 +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 { HeadingLevels } from "../Heading/HeadingTypes";
|
|
11
|
-
import { ListTypes } from "../List/ListTypes";
|
|
12
|
-
import { CSSVariablesInterface } from "../../interfaces";
|
|
13
|
-
import sections from "../../utils/siteSections";
|
|
14
|
-
import { getCategory } from "../../utils/componentCategories";
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
title: getCategory("Colors"),
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const uiVariables: CSSVariablesInterface = {};
|
|
21
|
-
const grayScaleVariables: CSSVariablesInterface = {};
|
|
22
|
-
|
|
23
|
-
for (const [key, value] of Object.entries(cssVariables)) {
|
|
24
|
-
if (key.startsWith(" --ui-gray")) {
|
|
25
|
-
grayScaleVariables[key] = value;
|
|
26
|
-
} else if (key.startsWith(" --ui")) {
|
|
27
|
-
uiVariables[key] = value;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const uiVariableDocs = [];
|
|
32
|
-
const grayscaleDocs = [];
|
|
33
|
-
|
|
34
|
-
const makeUIDocCard = function (key, value, docArray: React.ReactElement[]) {
|
|
35
|
-
docArray.push(
|
|
36
|
-
<li style={{ textAlign: "center" }}>
|
|
37
|
-
<UIDocCard backgroundColor={value}>
|
|
38
|
-
{key}: {value}
|
|
39
|
-
</UIDocCard>
|
|
40
|
-
</li>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
for (const [key, value] of Object.entries(uiVariables)) {
|
|
45
|
-
makeUIDocCard(key, value, uiVariableDocs);
|
|
46
|
-
}
|
|
47
|
-
for (const [key, value] of Object.entries(grayScaleVariables)) {
|
|
48
|
-
makeUIDocCard(key, value, grayscaleDocs);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const sectionDefault = sections[3];
|
|
52
|
-
|
|
53
|
-
export const colorsBrand = () => (
|
|
54
|
-
<>
|
|
55
|
-
<Heading level={HeadingLevels.One}>Brand</Heading>
|
|
56
|
-
<p>Brand fills are the NYPL primary and secondary colors.</p>
|
|
57
|
-
<List
|
|
58
|
-
type={ListTypes.Unordered}
|
|
59
|
-
modifiers={["no-list-styling"]}
|
|
60
|
-
className="card-grid__cards"
|
|
61
|
-
>
|
|
62
|
-
<li style={{ textAlign: "center" }}>
|
|
63
|
-
<UIDocCard backgroundColor={getCSSVariable("--brand-primary")}>
|
|
64
|
-
--brand-primary: {getCSSVariable("--brand-primary")}
|
|
65
|
-
</UIDocCard>
|
|
66
|
-
</li>
|
|
67
|
-
<li style={{ textAlign: "center" }}>
|
|
68
|
-
<UIDocCard backgroundColor={getCSSVariable("--brand-secondary")}>
|
|
69
|
-
--brand-secondary: {getCSSVariable("--brand-secondary")}
|
|
70
|
-
</UIDocCard>
|
|
71
|
-
</li>
|
|
72
|
-
</List>
|
|
73
|
-
<Heading level={HeadingLevels.One}>Section Colors</Heading>
|
|
74
|
-
<Heading level={HeadingLevels.Two}>{"What's On"}</Heading>
|
|
75
|
-
<p>
|
|
76
|
-
Section colors are branding colors only in use at NYPL. Certain
|
|
77
|
-
components, such as Breadcrumbs below, change color based on the modifier
|
|
78
|
-
applied the body tag.
|
|
79
|
-
</p>
|
|
80
|
-
<div
|
|
81
|
-
className={
|
|
82
|
-
select("Section", sections, sectionDefault) +
|
|
83
|
-
" storybook-breadcrumbsExample"
|
|
84
|
-
}
|
|
85
|
-
style={{ marginBottom: "2%", display: "flex", width: "100%" }}
|
|
86
|
-
>
|
|
87
|
-
<Breadcrumbs
|
|
88
|
-
breadcrumbs={[
|
|
89
|
-
{ url: "#", text: "Parent" },
|
|
90
|
-
{ url: "#", text: "Home" },
|
|
91
|
-
]}
|
|
92
|
-
/>
|
|
93
|
-
<div
|
|
94
|
-
style={{
|
|
95
|
-
flex: "1 1 50%",
|
|
96
|
-
backgroundColor: "var(--ui-gray-xlight)",
|
|
97
|
-
padding: "2%",
|
|
98
|
-
}}
|
|
99
|
-
>
|
|
100
|
-
<pre>
|
|
101
|
-
<code>
|
|
102
|
-
{"<div className="}
|
|
103
|
-
{"'" + select("Section", sections, sectionDefault) + "'"}
|
|
104
|
-
{">\n"}
|
|
105
|
-
{" <Breadcrumbs...></Breadcrumbs>"}
|
|
106
|
-
{"\n"}
|
|
107
|
-
{"</div>"}
|
|
108
|
-
</code>
|
|
109
|
-
</pre>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
<p>What's On is used for Events, Exhibitions & Audio Guides.</p>
|
|
113
|
-
<List
|
|
114
|
-
type={ListTypes.Unordered}
|
|
115
|
-
modifiers={["no-list-styling"]}
|
|
116
|
-
className="card-grid__cards"
|
|
117
|
-
>
|
|
118
|
-
<li style={{ textAlign: "center" }}>
|
|
119
|
-
<UIDocCard
|
|
120
|
-
backgroundColor={getCSSVariable("--section-whats-on-primary")}
|
|
121
|
-
>
|
|
122
|
-
--section-whats-on-primary:{" "}
|
|
123
|
-
{getCSSVariable("--section-whats-on-primary")}
|
|
124
|
-
</UIDocCard>
|
|
125
|
-
</li>
|
|
126
|
-
<li style={{ textAlign: "center" }}>
|
|
127
|
-
<UIDocCard
|
|
128
|
-
backgroundColor={getCSSVariable("--section-whats-on-secondary")}
|
|
129
|
-
>
|
|
130
|
-
--section-whats-on-secondary:{" "}
|
|
131
|
-
{getCSSVariable("--section-whats-on-secondary")}
|
|
132
|
-
</UIDocCard>
|
|
133
|
-
</li>
|
|
134
|
-
</List>
|
|
135
|
-
<Heading level={HeadingLevels.Two}>Books and More</Heading>
|
|
136
|
-
<p>
|
|
137
|
-
Books and More is used for the Catalog, Staff Picks, Recommendations, New
|
|
138
|
-
Arrivals, and E-Book Central.
|
|
139
|
-
</p>
|
|
140
|
-
<List
|
|
141
|
-
type={ListTypes.Unordered}
|
|
142
|
-
modifiers={["no-list-styling"]}
|
|
143
|
-
className="card-grid__cards"
|
|
144
|
-
>
|
|
145
|
-
<li style={{ textAlign: "center" }}>
|
|
146
|
-
<UIDocCard
|
|
147
|
-
backgroundColor={getCSSVariable("--section-books-and-more-primary")}
|
|
148
|
-
>
|
|
149
|
-
--section-books-and-more-primary:{" "}
|
|
150
|
-
{getCSSVariable("--section-books-and-more-primary")}
|
|
151
|
-
</UIDocCard>
|
|
152
|
-
</li>
|
|
153
|
-
<li style={{ textAlign: "center" }}>
|
|
154
|
-
<UIDocCard
|
|
155
|
-
backgroundColor={getCSSVariable("--section-books-and-more-secondary")}
|
|
156
|
-
>
|
|
157
|
-
--section-books-and-more-secondary:{" "}
|
|
158
|
-
{getCSSVariable("--section-books-and-more-secondary")}
|
|
159
|
-
</UIDocCard>
|
|
160
|
-
</li>
|
|
161
|
-
</List>
|
|
162
|
-
<Heading level={HeadingLevels.Two}>Research</Heading>
|
|
163
|
-
<p>Research is used for the Research Catalog and SCC.</p>
|
|
164
|
-
<List
|
|
165
|
-
type={ListTypes.Unordered}
|
|
166
|
-
modifiers={["no-list-styling"]}
|
|
167
|
-
className="card-grid__cards"
|
|
168
|
-
>
|
|
169
|
-
<li style={{ textAlign: "center" }}>
|
|
170
|
-
<UIDocCard
|
|
171
|
-
backgroundColor={getCSSVariable("--section-research-primary")}
|
|
172
|
-
>
|
|
173
|
-
--section-research-primary:{" "}
|
|
174
|
-
{getCSSVariable("--section-research-primary")}
|
|
175
|
-
</UIDocCard>
|
|
176
|
-
</li>
|
|
177
|
-
<li style={{ textAlign: "center" }}>
|
|
178
|
-
<UIDocCard
|
|
179
|
-
backgroundColor={getCSSVariable("--section-research-secondary")}
|
|
180
|
-
>
|
|
181
|
-
--section-research-secondary:{" "}
|
|
182
|
-
{getCSSVariable("--section-research-secondary")}
|
|
183
|
-
</UIDocCard>
|
|
184
|
-
</li>
|
|
185
|
-
</List>
|
|
186
|
-
<Heading level={HeadingLevels.Two}>Locations</Heading>
|
|
187
|
-
<p>
|
|
188
|
-
Locations is used for Location Finder and all branch pages with the
|
|
189
|
-
exceptions of some research libraries.
|
|
190
|
-
</p>
|
|
191
|
-
<List
|
|
192
|
-
type={ListTypes.Unordered}
|
|
193
|
-
modifiers={["no-list-styling"]}
|
|
194
|
-
className="card-grid__cards"
|
|
195
|
-
>
|
|
196
|
-
<li style={{ textAlign: "center" }}>
|
|
197
|
-
<UIDocCard
|
|
198
|
-
backgroundColor={getCSSVariable("--section-locations-primary")}
|
|
199
|
-
>
|
|
200
|
-
--section-locations-primary:{" "}
|
|
201
|
-
{getCSSVariable("--section-locations-primary")}
|
|
202
|
-
</UIDocCard>
|
|
203
|
-
</li>
|
|
204
|
-
<li style={{ textAlign: "center" }}>
|
|
205
|
-
<UIDocCard
|
|
206
|
-
backgroundColor={getCSSVariable("--section-locations-secondary")}
|
|
207
|
-
>
|
|
208
|
-
--section-locations-secondary:{" "}
|
|
209
|
-
{getCSSVariable("--section-locations-secondary")}
|
|
210
|
-
</UIDocCard>
|
|
211
|
-
</li>
|
|
212
|
-
</List>
|
|
213
|
-
<Heading level={HeadingLevels.Two}>Research Libraries</Heading>
|
|
214
|
-
<p>Research libraries with specific brand colors to adhere to.</p>
|
|
215
|
-
<List
|
|
216
|
-
type={ListTypes.Unordered}
|
|
217
|
-
modifiers={["no-list-styling"]}
|
|
218
|
-
className="card-grid__cards"
|
|
219
|
-
>
|
|
220
|
-
<li style={{ textAlign: "center" }}>
|
|
221
|
-
<UIDocCard
|
|
222
|
-
backgroundColor={getCSSVariable("--section-research-library-lpa")}
|
|
223
|
-
>
|
|
224
|
-
--section-research-library-lpa:{" "}
|
|
225
|
-
{getCSSVariable("--section-research-library-lpa")}
|
|
226
|
-
</UIDocCard>
|
|
227
|
-
</li>
|
|
228
|
-
<li style={{ textAlign: "center" }}>
|
|
229
|
-
<UIDocCard
|
|
230
|
-
backgroundColor={getCSSVariable(
|
|
231
|
-
"--section-research-library-schomburg"
|
|
232
|
-
)}
|
|
233
|
-
>
|
|
234
|
-
--section-research-library-schomburg:{" "}
|
|
235
|
-
{getCSSVariable("--section-research-library-schomburg")}
|
|
236
|
-
</UIDocCard>
|
|
237
|
-
</li>
|
|
238
|
-
<li style={{ textAlign: "center" }}>
|
|
239
|
-
<UIDocCard
|
|
240
|
-
backgroundColor={getCSSVariable(
|
|
241
|
-
"--section-research-library-schwartzman"
|
|
242
|
-
)}
|
|
243
|
-
>
|
|
244
|
-
--section-research-library-schwartzman:{" "}
|
|
245
|
-
{getCSSVariable("--section-research-library-schwartzman")}
|
|
246
|
-
</UIDocCard>
|
|
247
|
-
</li>
|
|
248
|
-
</List>
|
|
249
|
-
</>
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
colorsBrand.storyName = "Colors—Brand";
|
|
253
|
-
colorsBrand.parameters = {
|
|
254
|
-
design: {
|
|
255
|
-
type: "figma",
|
|
256
|
-
url:
|
|
257
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=15454%3A47007",
|
|
258
|
-
},
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export const colorsUtility = () => (
|
|
262
|
-
<>
|
|
263
|
-
<Heading level={HeadingLevels.One}>Utility Colors</Heading>
|
|
264
|
-
<List
|
|
265
|
-
type={ListTypes.Unordered}
|
|
266
|
-
modifiers={["no-list-styling"]}
|
|
267
|
-
className="card-grid__cards"
|
|
268
|
-
>
|
|
269
|
-
{uiVariableDocs}
|
|
270
|
-
</List>
|
|
271
|
-
<Heading level={HeadingLevels.One}>Grayscale</Heading>
|
|
272
|
-
<List
|
|
273
|
-
type={ListTypes.Unordered}
|
|
274
|
-
modifiers={["no-list-styling"]}
|
|
275
|
-
className="card-grid__cards"
|
|
276
|
-
>
|
|
277
|
-
{grayscaleDocs}
|
|
278
|
-
</List>
|
|
279
|
-
</>
|
|
280
|
-
);
|
|
281
|
-
|
|
282
|
-
colorsUtility.storyName = "Colors—Utility";
|
|
283
|
-
colorsUtility.parameters = {
|
|
284
|
-
design: {
|
|
285
|
-
type: "figma",
|
|
286
|
-
url:
|
|
287
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=14989%3A37",
|
|
288
|
-
},
|
|
289
|
-
};
|
|
@@ -1,86 +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
|
-
import { getCategory } from "../../utils/componentCategories";
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: getCategory("Template"),
|
|
10
|
-
decorators: [withDesign],
|
|
11
|
-
} as Meta;
|
|
12
|
-
|
|
13
|
-
export const Template = ({ showSidebar, sidebarSide }) => (
|
|
14
|
-
<>
|
|
15
|
-
<div className={bem("layout-container nypl-ds")}>
|
|
16
|
-
<header className={bem("header")}>
|
|
17
|
-
<Placeholder modifiers={["short"]}>NYPL Header</Placeholder>
|
|
18
|
-
|
|
19
|
-
<div className="content-header">
|
|
20
|
-
{<Placeholder modifiers={["short"]}>Breadcrumbs</Placeholder>}
|
|
21
|
-
{<Placeholder modifiers={["short"]}>Hero</Placeholder>}
|
|
22
|
-
</div>
|
|
23
|
-
</header>
|
|
24
|
-
|
|
25
|
-
<main className={showSidebar ? bem("main", ["with-sidebar"]) : "main"}>
|
|
26
|
-
<div className="content-top">
|
|
27
|
-
{<Placeholder>Content Top</Placeholder>}
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
{showSidebar && sidebarSide === "left" && (
|
|
31
|
-
<div className={bem("content-secondary", ["with-sidebar-left"])}>
|
|
32
|
-
<Placeholder>Left Sidebar</Placeholder>
|
|
33
|
-
</div>
|
|
34
|
-
)}
|
|
35
|
-
|
|
36
|
-
{showSidebar && sidebarSide === "left" && (
|
|
37
|
-
<div className={bem("content-primary", ["with-sidebar-left"])}>
|
|
38
|
-
<Placeholder>Main Content</Placeholder>
|
|
39
|
-
<div className="content-bottom">
|
|
40
|
-
{<Placeholder>Content Bottom</Placeholder>}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
)}
|
|
44
|
-
{showSidebar && sidebarSide === "right" && (
|
|
45
|
-
<div className={bem("content-primary", ["with-sidebar-right"])}>
|
|
46
|
-
<Placeholder>Main Content</Placeholder>
|
|
47
|
-
<div className="content-bottom">
|
|
48
|
-
{<Placeholder>Content Bottom</Placeholder>}
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
)}
|
|
52
|
-
{!showSidebar && (
|
|
53
|
-
<div className={bem("content-primary")}>
|
|
54
|
-
<Placeholder>Main Content</Placeholder>
|
|
55
|
-
<div className="content-bottom">
|
|
56
|
-
{<Placeholder>Content Bottom</Placeholder>}
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
)}
|
|
60
|
-
|
|
61
|
-
{showSidebar && sidebarSide === "right" && (
|
|
62
|
-
<div className={bem("content-secondary", ["with-sidebar-right"])}>
|
|
63
|
-
<Placeholder>Right Sidebar</Placeholder>
|
|
64
|
-
</div>
|
|
65
|
-
)}
|
|
66
|
-
</main>
|
|
67
|
-
</div>
|
|
68
|
-
<footer className={bem("footer")}>
|
|
69
|
-
<Placeholder>Footer</Placeholder>
|
|
70
|
-
</footer>
|
|
71
|
-
</>
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
Template.args = { showSidebar: true, sidebarSide: "left" };
|
|
75
|
-
Template.argTypes = {
|
|
76
|
-
sidebarSide: { control: { type: "select", options: ["left", "right"] } },
|
|
77
|
-
};
|
|
78
|
-
Template.storyName = "Template";
|
|
79
|
-
Template.parameters = {
|
|
80
|
-
design: {
|
|
81
|
-
type: "figma",
|
|
82
|
-
url:
|
|
83
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11982%3A47778",
|
|
84
|
-
},
|
|
85
|
-
layout: "fullscreen",
|
|
86
|
-
};
|
|
@@ -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
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
$break-input-mobile: 400px;
|
|
2
|
-
|
|
3
|
-
.textinput {
|
|
4
|
-
@include space-stack-xs;
|
|
5
|
-
|
|
6
|
-
.inputfield {
|
|
7
|
-
@include placeholder {
|
|
8
|
-
color: var(--ui-gray-dark);
|
|
9
|
-
font-style: italic;
|
|
10
|
-
line-height: 21px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
border: 1px solid var(--ui-gray-medium);
|
|
14
|
-
padding: var(--space-xs) var(--space-s);
|
|
15
|
-
width: 100%;
|
|
16
|
-
|
|
17
|
-
&--textarea {
|
|
18
|
-
line-height: 1.5;
|
|
19
|
-
min-height: var(--space-xxl);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&:hover {
|
|
23
|
-
border-color: var(--ui-gray-dark);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&:disabled {
|
|
27
|
-
background-color: var(--ui-gray-xxlight);
|
|
28
|
-
color: var(--ui-gray-xdark);
|
|
29
|
-
pointer-events: none;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:active,
|
|
33
|
-
&:focus,
|
|
34
|
-
&:active:hover,
|
|
35
|
-
&:focus:hover {
|
|
36
|
-
border: 1px solid var(--ui-focus);
|
|
37
|
-
box-shadow: 0;
|
|
38
|
-
outline: 1px solid var(--ui-focus);
|
|
39
|
-
z-index: 9999;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&--error {
|
|
43
|
-
border: 1px solid var(--ui-error);
|
|
44
|
-
|
|
45
|
-
&:hover,
|
|
46
|
-
&:active,
|
|
47
|
-
&:focus,
|
|
48
|
-
&:active:hover,
|
|
49
|
-
&:focus:hover {
|
|
50
|
-
border: 1px solid var(--ui-error);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
> .helper-text {
|
|
56
|
-
margin-bottom: 0;
|
|
57
|
-
margin-top: var(--space-xs);
|
|
58
|
-
}
|
|
59
|
-
}
|