@nationaldesignstudio/react 0.2.0 → 0.5.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/dist/component-registry.md +1310 -127
- package/dist/components/atoms/background/background.d.ts +13 -27
- package/dist/components/atoms/button/button.d.ts +64 -72
- package/dist/components/atoms/button/button.figma.d.ts +1 -0
- package/dist/components/atoms/button/icon-button.d.ts +62 -110
- package/dist/components/atoms/input/input-group.d.ts +278 -0
- package/dist/components/atoms/input/input.d.ts +121 -0
- package/dist/components/atoms/popover/popover.d.ts +195 -0
- package/dist/components/atoms/select/select.d.ts +131 -0
- package/dist/components/atoms/tooltip/tooltip.d.ts +161 -0
- package/dist/components/organisms/card/card.d.ts +3 -3
- package/dist/components/sections/hero/hero.d.ts +2 -2
- package/dist/components/sections/prose/prose.d.ts +3 -3
- package/dist/components/sections/river/river.d.ts +1 -1
- package/dist/components/sections/tout/tout.d.ts +4 -4
- package/dist/components/shared/floating-arrow.d.ts +34 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +13935 -7622
- package/dist/index.js.map +1 -1
- package/dist/lib/form-control.d.ts +106 -0
- package/dist/tokens.css +4725 -19065
- package/package.json +2 -1
- package/src/components/atoms/accordion/accordion.stories.tsx +1 -1
- package/src/components/atoms/accordion/accordion.tsx +2 -2
- package/src/components/atoms/background/background.tsx +71 -109
- package/src/components/atoms/button/button.figma.tsx +37 -0
- package/src/components/atoms/button/button.stories.tsx +253 -115
- package/src/components/atoms/button/button.test.tsx +289 -5
- package/src/components/atoms/button/button.tsx +40 -101
- package/src/components/atoms/button/button.visual.test.tsx +28 -32
- package/src/components/atoms/button/icon-button.stories.tsx +44 -101
- package/src/components/atoms/button/icon-button.test.tsx +26 -94
- package/src/components/atoms/button/icon-button.tsx +81 -224
- package/src/components/atoms/input/index.ts +17 -0
- package/src/components/atoms/input/input-group.stories.tsx +646 -0
- package/src/components/atoms/input/input-group.test.tsx +362 -0
- package/src/components/atoms/input/input-group.tsx +409 -0
- package/src/components/atoms/input/input.stories.tsx +228 -0
- package/src/components/atoms/input/input.test.tsx +167 -0
- package/src/components/atoms/input/input.tsx +104 -0
- package/src/components/atoms/pager-control/pager-control.stories.tsx +6 -8
- package/src/components/atoms/pager-control/pager-control.tsx +12 -12
- package/src/components/atoms/popover/index.ts +30 -0
- package/src/components/atoms/popover/popover.stories.tsx +531 -0
- package/src/components/atoms/popover/popover.test.tsx +486 -0
- package/src/components/atoms/popover/popover.tsx +488 -0
- package/src/components/atoms/select/index.ts +18 -0
- package/src/components/atoms/select/select.stories.tsx +455 -0
- package/src/components/atoms/select/select.tsx +324 -0
- package/src/components/atoms/tooltip/index.ts +24 -0
- package/src/components/atoms/tooltip/tooltip.stories.tsx +348 -0
- package/src/components/atoms/tooltip/tooltip.test.tsx +363 -0
- package/src/components/atoms/tooltip/tooltip.tsx +347 -0
- package/src/components/dev-tools/dev-toolbar/dev-toolbar.stories.tsx +8 -17
- package/src/components/dev-tools/dev-toolbar/dev-toolbar.tsx +3 -3
- package/src/components/foundation/typography/typography.stories.tsx +401 -0
- package/src/components/organisms/card/card.stories.tsx +19 -19
- package/src/components/organisms/card/card.test.tsx +1 -1
- package/src/components/organisms/card/card.tsx +3 -3
- package/src/components/organisms/card/card.visual.test.tsx +11 -11
- package/src/components/organisms/navbar/navbar.tsx +2 -2
- package/src/components/organisms/navbar/navbar.visual.test.tsx +2 -2
- package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +2 -2
- package/src/components/sections/banner/banner.stories.tsx +1 -5
- package/src/components/sections/banner/banner.test.tsx +2 -2
- package/src/components/sections/banner/banner.tsx +6 -6
- package/src/components/sections/card-grid/card-grid.tsx +5 -5
- package/src/components/sections/faq-section/faq-section.tsx +2 -2
- package/src/components/sections/hero/hero.stories.tsx +7 -7
- package/src/components/sections/hero/hero.test.tsx +5 -5
- package/src/components/sections/hero/hero.tsx +10 -11
- package/src/components/sections/prose/prose.test.tsx +2 -2
- package/src/components/sections/prose/prose.tsx +6 -7
- package/src/components/sections/river/river.stories.tsx +8 -8
- package/src/components/sections/river/river.test.tsx +4 -4
- package/src/components/sections/river/river.tsx +8 -16
- package/src/components/sections/tout/tout.stories.tsx +7 -31
- package/src/components/sections/tout/tout.test.tsx +1 -1
- package/src/components/sections/tout/tout.tsx +11 -11
- package/src/components/sections/two-column-section/two-column-section.tsx +7 -9
- package/src/components/shared/floating-arrow.tsx +78 -0
- package/src/components/shared/index.ts +5 -0
- package/src/index.ts +98 -0
- package/src/lib/form-control.ts +71 -0
- package/src/stories/grid-system.stories.tsx +309 -0
- package/src/stories/{Introduction.mdx → introduction.mdx} +29 -15
- package/src/stories/{ThemeProvider.stories.tsx → theme-provider.stories.tsx} +8 -22
- package/src/stories/{TokenShowcase.stories.tsx → token-showcase.stories.tsx} +1 -20
- package/src/stories/token-showcase.tsx +777 -0
- package/src/styles.css +3 -0
- package/src/tests/token-resolution.test.tsx +298 -0
- package/src/theme/hooks.ts +1 -1
- package/src/theme/index.ts +1 -1
- package/src/theme/theme-provider.test.tsx +270 -0
- package/src/theme/{ThemeProvider.tsx → theme-provider.tsx} +18 -2
- package/src/stories/GridSystem.stories.tsx +0 -84
- package/src/stories/TokenShowcase.tsx +0 -1429
|
@@ -18,34 +18,25 @@ export default meta;
|
|
|
18
18
|
type Story = StoryObj<typeof meta>;
|
|
19
19
|
|
|
20
20
|
const DemoContent = () => (
|
|
21
|
-
<div className="min-h-screen bg-gray-100 py-
|
|
21
|
+
<div className="min-h-screen bg-gray-100 py-64">
|
|
22
22
|
<div className="w-full max-w-[90rem] mx-auto px-[var(--spatial-grid-small-margin)] md:px-[var(--spatial-grid-medium-margin)] lg:px-[var(--spatial-grid-large-margin)]">
|
|
23
|
-
<h1 className="typography-
|
|
24
|
-
|
|
25
|
-
</h1>
|
|
26
|
-
<p className="typography-body-medium text-gray-600 mb-spacing-8">
|
|
23
|
+
<h1 className="typography-h2 mb-16">Dev Toolbar Demo</h1>
|
|
24
|
+
<p className="typography-body-medium text-gray-600 mb-8">
|
|
27
25
|
Click the bar at the bottom to expand, then toggle the Grid overlay.
|
|
28
26
|
</p>
|
|
29
|
-
<p className="typography-body-medium text-gray-600 mb-
|
|
27
|
+
<p className="typography-body-medium text-gray-600 mb-32">
|
|
30
28
|
Keyboard shortcut:{" "}
|
|
31
|
-
<kbd className="px-
|
|
32
|
-
|
|
33
|
-
</kbd>{" "}
|
|
34
|
-
or{" "}
|
|
35
|
-
<kbd className="px-spacing-8 py-spacing-4 bg-gray-200 rounded-radius-8">
|
|
36
|
-
Ctrl+G
|
|
37
|
-
</kbd>
|
|
29
|
+
<kbd className="px-8 py-4 bg-gray-200 rounded-radius-8">⌘G</kbd> or{" "}
|
|
30
|
+
<kbd className="px-8 py-4 bg-gray-200 rounded-radius-8">Ctrl+G</kbd>
|
|
38
31
|
</p>
|
|
39
32
|
|
|
40
33
|
<div className="grid grid-cols-4 md:grid-cols-12 lg:grid-cols-24 gap-[var(--spatial-grid-small-gutter)] md:gap-[var(--spatial-grid-medium-gutter)] lg:gap-[var(--spatial-grid-large-gutter)]">
|
|
41
34
|
{["alpha", "beta", "gamma", "delta", "epsilon", "zeta"].map((id) => (
|
|
42
35
|
<div
|
|
43
36
|
key={id}
|
|
44
|
-
className="col-span-4 md:col-span-4 lg:col-span-8 bg-white p-
|
|
37
|
+
className="col-span-4 md:col-span-4 lg:col-span-8 bg-white p-16 rounded-radius-12 shadow"
|
|
45
38
|
>
|
|
46
|
-
<h3 className="typography-
|
|
47
|
-
Card {id}
|
|
48
|
-
</h3>
|
|
39
|
+
<h3 className="typography-h4 mb-8">Card {id}</h3>
|
|
49
40
|
<p className="typography-body-small text-gray-500">
|
|
50
41
|
Sample content to visualize how the grid overlay aligns with your
|
|
51
42
|
layout.
|
|
@@ -152,7 +152,7 @@ export function DevToolbar({ defaultExpanded = false }: DevToolbarProps) {
|
|
|
152
152
|
data-testid="dev-toolbar"
|
|
153
153
|
>
|
|
154
154
|
<div
|
|
155
|
-
className={`bg-gray-1100 rounded-radius-16 shadow-lg flex flex-col items-center overflow-hidden px-
|
|
155
|
+
className={`bg-gray-1100 rounded-radius-16 shadow-lg flex flex-col items-center overflow-hidden px-12 py-8 ${isExpanded ? "gap-4" : ""}`}
|
|
156
156
|
>
|
|
157
157
|
<div
|
|
158
158
|
className={`
|
|
@@ -165,7 +165,7 @@ export function DevToolbar({ defaultExpanded = false }: DevToolbarProps) {
|
|
|
165
165
|
type="button"
|
|
166
166
|
onClick={toggleGrid}
|
|
167
167
|
className={`
|
|
168
|
-
size-
|
|
168
|
+
size-40 rounded-full flex items-center justify-center transition-colors
|
|
169
169
|
${
|
|
170
170
|
showGrid
|
|
171
171
|
? "text-gray-50"
|
|
@@ -186,7 +186,7 @@ export function DevToolbar({ defaultExpanded = false }: DevToolbarProps) {
|
|
|
186
186
|
onTouchStart={handleBarTouchStart}
|
|
187
187
|
onClick={handleBarClick}
|
|
188
188
|
className={`
|
|
189
|
-
w-
|
|
189
|
+
w-32 h-4 bg-gray-50 rounded-full transition-opacity
|
|
190
190
|
${isDragging ? "opacity-100 cursor-grabbing" : "opacity-60 hover:opacity-100 cursor-grab"}
|
|
191
191
|
`}
|
|
192
192
|
aria-label={isExpanded ? "Close dev tools" : "Open dev tools"}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
const meta: Meta = {
|
|
4
|
+
title: "Foundation/Typography",
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: "padded",
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Typography Scale showcases all typography styles in the design system.
|
|
14
|
+
* Each style is shown with its class name and a sample text.
|
|
15
|
+
*/
|
|
16
|
+
export const TypeScale: StoryObj = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<div className="space-y-48 p-24">
|
|
19
|
+
{/* Headings */}
|
|
20
|
+
<section>
|
|
21
|
+
<h2 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
22
|
+
Headings
|
|
23
|
+
</h2>
|
|
24
|
+
<div className="space-y-24">
|
|
25
|
+
<div>
|
|
26
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
27
|
+
typography-h1-display
|
|
28
|
+
</code>
|
|
29
|
+
<p className="typography-h1-display text-gray-900">
|
|
30
|
+
Display Heading
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
35
|
+
typography-h1
|
|
36
|
+
</code>
|
|
37
|
+
<p className="typography-h1 text-gray-900">Heading 1</p>
|
|
38
|
+
</div>
|
|
39
|
+
<div>
|
|
40
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
41
|
+
typography-h2
|
|
42
|
+
</code>
|
|
43
|
+
<p className="typography-h2 text-gray-900">Heading 2</p>
|
|
44
|
+
</div>
|
|
45
|
+
<div>
|
|
46
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
47
|
+
typography-h3
|
|
48
|
+
</code>
|
|
49
|
+
<p className="typography-h3 text-gray-900">Heading 3</p>
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
53
|
+
typography-h4
|
|
54
|
+
</code>
|
|
55
|
+
<p className="typography-h4 text-gray-900">Heading 4</p>
|
|
56
|
+
</div>
|
|
57
|
+
<div>
|
|
58
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
59
|
+
typography-h5
|
|
60
|
+
</code>
|
|
61
|
+
<p className="typography-h5 text-gray-900">Heading 5</p>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</section>
|
|
65
|
+
|
|
66
|
+
{/* Body Text */}
|
|
67
|
+
<section>
|
|
68
|
+
<h2 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
69
|
+
Body Text
|
|
70
|
+
</h2>
|
|
71
|
+
<div className="space-y-24">
|
|
72
|
+
<div>
|
|
73
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
74
|
+
typography-body-large
|
|
75
|
+
</code>
|
|
76
|
+
<p className="typography-body-large text-gray-900 max-w-640">
|
|
77
|
+
Body large is used for important introductory text. The quick
|
|
78
|
+
brown fox jumps over the lazy dog.
|
|
79
|
+
</p>
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
83
|
+
typography-body-medium
|
|
84
|
+
</code>
|
|
85
|
+
<p className="typography-body-medium text-gray-900 max-w-640">
|
|
86
|
+
Body medium is the default body text size for most content. The
|
|
87
|
+
quick brown fox jumps over the lazy dog.
|
|
88
|
+
</p>
|
|
89
|
+
</div>
|
|
90
|
+
<div>
|
|
91
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
92
|
+
typography-body-small
|
|
93
|
+
</code>
|
|
94
|
+
<p className="typography-body-small text-gray-900 max-w-640">
|
|
95
|
+
Body small is used for secondary text and compact layouts. The
|
|
96
|
+
quick brown fox jumps over the lazy dog.
|
|
97
|
+
</p>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</section>
|
|
101
|
+
|
|
102
|
+
{/* Supporting Text */}
|
|
103
|
+
<section>
|
|
104
|
+
<h2 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
105
|
+
Supporting Text
|
|
106
|
+
</h2>
|
|
107
|
+
<div className="space-y-24">
|
|
108
|
+
<div>
|
|
109
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
110
|
+
typography-overline
|
|
111
|
+
</code>
|
|
112
|
+
<p className="typography-overline text-gray-700 uppercase tracking-wide">
|
|
113
|
+
Overline Text
|
|
114
|
+
</p>
|
|
115
|
+
</div>
|
|
116
|
+
<div>
|
|
117
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
118
|
+
typography-caption
|
|
119
|
+
</code>
|
|
120
|
+
<p className="typography-caption text-gray-600">
|
|
121
|
+
Caption text for supplementary information
|
|
122
|
+
</p>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</section>
|
|
126
|
+
|
|
127
|
+
{/* UI Typography */}
|
|
128
|
+
<section>
|
|
129
|
+
<h2 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
130
|
+
UI Typography
|
|
131
|
+
</h2>
|
|
132
|
+
<div className="space-y-24">
|
|
133
|
+
<div>
|
|
134
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
135
|
+
typography-ui-button-large
|
|
136
|
+
</code>
|
|
137
|
+
<p className="typography-ui-button-large text-gray-900">
|
|
138
|
+
Large Button Text
|
|
139
|
+
</p>
|
|
140
|
+
</div>
|
|
141
|
+
<div>
|
|
142
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
143
|
+
typography-ui-button-medium
|
|
144
|
+
</code>
|
|
145
|
+
<p className="typography-ui-button-medium text-gray-900">
|
|
146
|
+
Medium Button Text
|
|
147
|
+
</p>
|
|
148
|
+
</div>
|
|
149
|
+
<div>
|
|
150
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
151
|
+
typography-ui-button-small
|
|
152
|
+
</code>
|
|
153
|
+
<p className="typography-ui-button-small text-gray-900">
|
|
154
|
+
Small Button Text
|
|
155
|
+
</p>
|
|
156
|
+
</div>
|
|
157
|
+
<div>
|
|
158
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
159
|
+
typography-ui-label
|
|
160
|
+
</code>
|
|
161
|
+
<p className="typography-ui-label text-gray-900">Form Label</p>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</section>
|
|
165
|
+
</div>
|
|
166
|
+
),
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Responsive Typography demonstrates how typography scales across breakpoints.
|
|
171
|
+
* Resize the viewport to see the typography adapt.
|
|
172
|
+
*/
|
|
173
|
+
export const ResponsiveTypography: StoryObj = {
|
|
174
|
+
render: () => (
|
|
175
|
+
<div className="space-y-32 p-24">
|
|
176
|
+
<div className="bg-gray-100 p-16 rounded-8">
|
|
177
|
+
<p className="typography-body-small text-gray-700 mb-8">
|
|
178
|
+
Resize the viewport to see responsive typography in action
|
|
179
|
+
</p>
|
|
180
|
+
<p className="typography-caption text-gray-500">
|
|
181
|
+
Mobile (<768px) | Tablet (768px-1440px) | Desktop (>1440px)
|
|
182
|
+
</p>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<section>
|
|
186
|
+
<h3 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
187
|
+
Responsive Headings
|
|
188
|
+
</h3>
|
|
189
|
+
<div className="space-y-24">
|
|
190
|
+
<div className="border-l-4 border-indigo-500 pl-16">
|
|
191
|
+
<code className="text-12 text-gray-500 block mb-4">
|
|
192
|
+
typography-h1 (responsive)
|
|
193
|
+
</code>
|
|
194
|
+
<p className="typography-h1 text-gray-900">Responsive H1</p>
|
|
195
|
+
<p className="typography-caption text-gray-500 mt-4">
|
|
196
|
+
48px (sm) → 72px (md) → 96px (lg)
|
|
197
|
+
</p>
|
|
198
|
+
</div>
|
|
199
|
+
<div className="border-l-4 border-indigo-500 pl-16">
|
|
200
|
+
<code className="text-12 text-gray-500 block mb-4">
|
|
201
|
+
typography-h2 (responsive)
|
|
202
|
+
</code>
|
|
203
|
+
<p className="typography-h2 text-gray-900">Responsive H2</p>
|
|
204
|
+
<p className="typography-caption text-gray-500 mt-4">
|
|
205
|
+
48px (sm) → 64px (md) → 72px (lg)
|
|
206
|
+
</p>
|
|
207
|
+
</div>
|
|
208
|
+
<div className="border-l-4 border-indigo-500 pl-16">
|
|
209
|
+
<code className="text-12 text-gray-500 block mb-4">
|
|
210
|
+
typography-h3 (responsive)
|
|
211
|
+
</code>
|
|
212
|
+
<p className="typography-h3 text-gray-900">Responsive H3</p>
|
|
213
|
+
<p className="typography-caption text-gray-500 mt-4">
|
|
214
|
+
32px (sm) → 48px (md) → 64px (lg)
|
|
215
|
+
</p>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
</section>
|
|
219
|
+
|
|
220
|
+
<section>
|
|
221
|
+
<h3 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
222
|
+
Breakpoint-Specific Utilities
|
|
223
|
+
</h3>
|
|
224
|
+
<div className="space-y-16">
|
|
225
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-16">
|
|
226
|
+
<div className="bg-gray-50 p-16 rounded-8">
|
|
227
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
228
|
+
typography-h4-small
|
|
229
|
+
</code>
|
|
230
|
+
<p className="typography-h4-small text-gray-900">H4 Small</p>
|
|
231
|
+
</div>
|
|
232
|
+
<div className="bg-gray-50 p-16 rounded-8">
|
|
233
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
234
|
+
typography-h4-medium
|
|
235
|
+
</code>
|
|
236
|
+
<p className="typography-h4-medium text-gray-900">H4 Medium</p>
|
|
237
|
+
</div>
|
|
238
|
+
<div className="bg-gray-50 p-16 rounded-8">
|
|
239
|
+
<code className="text-12 text-gray-500 block mb-8">
|
|
240
|
+
typography-h4-large
|
|
241
|
+
</code>
|
|
242
|
+
<p className="typography-h4-large text-gray-900">H4 Large</p>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
</section>
|
|
247
|
+
</div>
|
|
248
|
+
),
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Typography specimen shows a sample page layout using the typography system.
|
|
253
|
+
*/
|
|
254
|
+
export const Specimen: StoryObj = {
|
|
255
|
+
render: () => (
|
|
256
|
+
<article className="max-w-800 mx-auto p-32">
|
|
257
|
+
<header className="mb-48">
|
|
258
|
+
<p className="typography-overline text-indigo-600 uppercase tracking-wide mb-8">
|
|
259
|
+
Design System
|
|
260
|
+
</p>
|
|
261
|
+
<h1 className="typography-h1 text-gray-900 mb-16">
|
|
262
|
+
Typography Specimen
|
|
263
|
+
</h1>
|
|
264
|
+
<p className="typography-body-large text-gray-700">
|
|
265
|
+
A demonstration of the typography system in a realistic content
|
|
266
|
+
layout, showing how different styles work together.
|
|
267
|
+
</p>
|
|
268
|
+
</header>
|
|
269
|
+
|
|
270
|
+
<section className="mb-48">
|
|
271
|
+
<h2 className="typography-h3 text-gray-900 mb-16">
|
|
272
|
+
The Foundation of Good Design
|
|
273
|
+
</h2>
|
|
274
|
+
<p className="typography-body-medium text-gray-800 mb-16">
|
|
275
|
+
Typography is the art and technique of arranging type to make written
|
|
276
|
+
language legible, readable, and appealing when displayed. The
|
|
277
|
+
arrangement of type involves selecting typefaces, point sizes, line
|
|
278
|
+
lengths, line-spacing, and letter-spacing.
|
|
279
|
+
</p>
|
|
280
|
+
<p className="typography-body-medium text-gray-800 mb-16">
|
|
281
|
+
The term typography is also applied to the style, arrangement, and
|
|
282
|
+
appearance of the letters, numbers, and symbols created by the
|
|
283
|
+
process. Type design is a closely related craft, sometimes considered
|
|
284
|
+
part of typography.
|
|
285
|
+
</p>
|
|
286
|
+
</section>
|
|
287
|
+
|
|
288
|
+
<section className="mb-48">
|
|
289
|
+
<h3 className="typography-h4 text-gray-900 mb-16">Key Principles</h3>
|
|
290
|
+
<p className="typography-body-medium text-gray-800 mb-16">
|
|
291
|
+
Most typefaces can be classified into one of four basic groups: those
|
|
292
|
+
with serifs, those without serifs, scripts and decorative styles.
|
|
293
|
+
</p>
|
|
294
|
+
|
|
295
|
+
<div className="bg-gray-50 p-24 rounded-8 mb-16">
|
|
296
|
+
<h4 className="typography-h5 text-gray-900 mb-8">
|
|
297
|
+
Hierarchy Matters
|
|
298
|
+
</h4>
|
|
299
|
+
<p className="typography-body-small text-gray-700">
|
|
300
|
+
Visual hierarchy guides readers through content by creating clear
|
|
301
|
+
distinctions between headings, body text, and supporting elements.
|
|
302
|
+
</p>
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
<p className="typography-body-medium text-gray-800">
|
|
306
|
+
Good typography requires attention to detail and an understanding of
|
|
307
|
+
how type creates meaning and emotion.
|
|
308
|
+
</p>
|
|
309
|
+
</section>
|
|
310
|
+
|
|
311
|
+
<footer className="border-t border-gray-200 pt-24">
|
|
312
|
+
<p className="typography-caption text-gray-500">
|
|
313
|
+
Typography specimen created for the NDS Design System
|
|
314
|
+
</p>
|
|
315
|
+
</footer>
|
|
316
|
+
</article>
|
|
317
|
+
),
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Font comparison shows the different font families in the design system.
|
|
322
|
+
*/
|
|
323
|
+
export const FontFamilies: StoryObj = {
|
|
324
|
+
render: () => (
|
|
325
|
+
<div className="space-y-48 p-24">
|
|
326
|
+
<section>
|
|
327
|
+
<h2 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
328
|
+
Heading Font: Inter Tight
|
|
329
|
+
</h2>
|
|
330
|
+
<div className="space-y-16">
|
|
331
|
+
<p className="typography-h2 text-gray-900">
|
|
332
|
+
The quick brown fox jumps over the lazy dog
|
|
333
|
+
</p>
|
|
334
|
+
<p className="typography-h4 text-gray-800">
|
|
335
|
+
ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
336
|
+
</p>
|
|
337
|
+
<p className="typography-h4 text-gray-700">
|
|
338
|
+
abcdefghijklmnopqrstuvwxyz
|
|
339
|
+
</p>
|
|
340
|
+
<p className="typography-h4 text-gray-600">0123456789</p>
|
|
341
|
+
</div>
|
|
342
|
+
</section>
|
|
343
|
+
|
|
344
|
+
<section>
|
|
345
|
+
<h2 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
346
|
+
Body Font: Inter
|
|
347
|
+
</h2>
|
|
348
|
+
<div className="space-y-16">
|
|
349
|
+
<p className="typography-body-large text-gray-900">
|
|
350
|
+
The quick brown fox jumps over the lazy dog
|
|
351
|
+
</p>
|
|
352
|
+
<p className="typography-body-medium text-gray-800">
|
|
353
|
+
ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
354
|
+
</p>
|
|
355
|
+
<p className="typography-body-medium text-gray-700">
|
|
356
|
+
abcdefghijklmnopqrstuvwxyz
|
|
357
|
+
</p>
|
|
358
|
+
<p className="typography-body-medium text-gray-600">0123456789</p>
|
|
359
|
+
</div>
|
|
360
|
+
</section>
|
|
361
|
+
|
|
362
|
+
<section>
|
|
363
|
+
<h2 className="typography-h5 text-gray-500 mb-24 uppercase tracking-wide">
|
|
364
|
+
Font Weights
|
|
365
|
+
</h2>
|
|
366
|
+
<div className="grid grid-cols-2 gap-24">
|
|
367
|
+
<div>
|
|
368
|
+
<p className="typography-caption text-gray-500 mb-4">
|
|
369
|
+
Regular (400)
|
|
370
|
+
</p>
|
|
371
|
+
<p className="typography-body-medium font-normal text-gray-900">
|
|
372
|
+
The quick brown fox
|
|
373
|
+
</p>
|
|
374
|
+
</div>
|
|
375
|
+
<div>
|
|
376
|
+
<p className="typography-caption text-gray-500 mb-4">
|
|
377
|
+
Medium (500)
|
|
378
|
+
</p>
|
|
379
|
+
<p className="typography-body-medium font-medium text-gray-900">
|
|
380
|
+
The quick brown fox
|
|
381
|
+
</p>
|
|
382
|
+
</div>
|
|
383
|
+
<div>
|
|
384
|
+
<p className="typography-caption text-gray-500 mb-4">
|
|
385
|
+
Semibold (600)
|
|
386
|
+
</p>
|
|
387
|
+
<p className="typography-body-medium font-semibold text-gray-900">
|
|
388
|
+
The quick brown fox
|
|
389
|
+
</p>
|
|
390
|
+
</div>
|
|
391
|
+
<div>
|
|
392
|
+
<p className="typography-caption text-gray-500 mb-4">Bold (700)</p>
|
|
393
|
+
<p className="typography-body-medium font-bold text-gray-900">
|
|
394
|
+
The quick brown fox
|
|
395
|
+
</p>
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
</section>
|
|
399
|
+
</div>
|
|
400
|
+
),
|
|
401
|
+
};
|
|
@@ -34,7 +34,7 @@ export const Default: Story = {
|
|
|
34
34
|
<CardContent>
|
|
35
35
|
<CardBody>
|
|
36
36
|
<CardEyebrow>Optional Eyebrow</CardEyebrow>
|
|
37
|
-
<div className="flex flex-col gap-
|
|
37
|
+
<div className="flex flex-col gap-6">
|
|
38
38
|
<CardTitle>Card Title</CardTitle>
|
|
39
39
|
<CardDescription>
|
|
40
40
|
Use cards when citizens need to scan items at a glance, either
|
|
@@ -43,10 +43,10 @@ export const Default: Story = {
|
|
|
43
43
|
</div>
|
|
44
44
|
</CardBody>
|
|
45
45
|
<CardActions>
|
|
46
|
-
<Button size="
|
|
46
|
+
<Button size="md" variant="primary">
|
|
47
47
|
Primary
|
|
48
48
|
</Button>
|
|
49
|
-
<Button size="
|
|
49
|
+
<Button size="md" variant="primary-outline">
|
|
50
50
|
Secondary
|
|
51
51
|
</Button>
|
|
52
52
|
</CardActions>
|
|
@@ -68,7 +68,7 @@ export const Vertical: Story = {
|
|
|
68
68
|
<CardContent>
|
|
69
69
|
<CardBody>
|
|
70
70
|
<CardEyebrow>Optional Eyebrow</CardEyebrow>
|
|
71
|
-
<div className="flex flex-col gap-
|
|
71
|
+
<div className="flex flex-col gap-6">
|
|
72
72
|
<CardTitle>Card Title</CardTitle>
|
|
73
73
|
<CardDescription>
|
|
74
74
|
Use cards when citizens need to scan items at a glance, either
|
|
@@ -77,10 +77,10 @@ export const Vertical: Story = {
|
|
|
77
77
|
</div>
|
|
78
78
|
</CardBody>
|
|
79
79
|
<CardActions>
|
|
80
|
-
<Button size="
|
|
80
|
+
<Button size="md" variant="primary">
|
|
81
81
|
Primary
|
|
82
82
|
</Button>
|
|
83
|
-
<Button size="
|
|
83
|
+
<Button size="md" variant="primary-outline">
|
|
84
84
|
Secondary
|
|
85
85
|
</Button>
|
|
86
86
|
</CardActions>
|
|
@@ -98,7 +98,7 @@ export const Horizontal: Story = {
|
|
|
98
98
|
<CardContent>
|
|
99
99
|
<CardBody>
|
|
100
100
|
<CardEyebrow>Eyebrow</CardEyebrow>
|
|
101
|
-
<div className="flex flex-col gap-
|
|
101
|
+
<div className="flex flex-col gap-8">
|
|
102
102
|
<CardTitle>
|
|
103
103
|
Cards can support multi line headings easily.
|
|
104
104
|
</CardTitle>
|
|
@@ -109,10 +109,10 @@ export const Horizontal: Story = {
|
|
|
109
109
|
</div>
|
|
110
110
|
</CardBody>
|
|
111
111
|
<CardActions>
|
|
112
|
-
<Button size="sm" variant="
|
|
112
|
+
<Button size="sm" variant="primary">
|
|
113
113
|
Primary
|
|
114
114
|
</Button>
|
|
115
|
-
<Button size="sm" variant="
|
|
115
|
+
<Button size="sm" variant="primary-outline">
|
|
116
116
|
Secondary
|
|
117
117
|
</Button>
|
|
118
118
|
</CardActions>
|
|
@@ -133,7 +133,7 @@ export const WithoutImage: Story = {
|
|
|
133
133
|
<CardContent>
|
|
134
134
|
<CardBody>
|
|
135
135
|
<CardEyebrow>Category</CardEyebrow>
|
|
136
|
-
<div className="flex flex-col gap-
|
|
136
|
+
<div className="flex flex-col gap-6">
|
|
137
137
|
<CardTitle>Card Without Image</CardTitle>
|
|
138
138
|
<CardDescription>
|
|
139
139
|
Cards can be used without images for text-focused content.
|
|
@@ -141,7 +141,7 @@ export const WithoutImage: Story = {
|
|
|
141
141
|
</div>
|
|
142
142
|
</CardBody>
|
|
143
143
|
<CardActions>
|
|
144
|
-
<Button size="
|
|
144
|
+
<Button size="md" variant="primary">
|
|
145
145
|
Learn More
|
|
146
146
|
</Button>
|
|
147
147
|
</CardActions>
|
|
@@ -158,7 +158,7 @@ export const WithoutEyebrow: Story = {
|
|
|
158
158
|
<CardImage />
|
|
159
159
|
<CardContent>
|
|
160
160
|
<CardBody>
|
|
161
|
-
<div className="flex flex-col gap-
|
|
161
|
+
<div className="flex flex-col gap-6">
|
|
162
162
|
<CardTitle>Card Title</CardTitle>
|
|
163
163
|
<CardDescription>
|
|
164
164
|
The eyebrow is optional and can be omitted when not needed.
|
|
@@ -166,7 +166,7 @@ export const WithoutEyebrow: Story = {
|
|
|
166
166
|
</div>
|
|
167
167
|
</CardBody>
|
|
168
168
|
<CardActions>
|
|
169
|
-
<Button size="
|
|
169
|
+
<Button size="md" variant="primary">
|
|
170
170
|
Primary
|
|
171
171
|
</Button>
|
|
172
172
|
</CardActions>
|
|
@@ -184,7 +184,7 @@ export const WithoutActions: Story = {
|
|
|
184
184
|
<CardContent>
|
|
185
185
|
<CardBody>
|
|
186
186
|
<CardEyebrow>Information</CardEyebrow>
|
|
187
|
-
<div className="flex flex-col gap-
|
|
187
|
+
<div className="flex flex-col gap-6">
|
|
188
188
|
<CardTitle>Informational Card</CardTitle>
|
|
189
189
|
<CardDescription>
|
|
190
190
|
Cards without actions can be used for purely informational
|
|
@@ -228,7 +228,7 @@ export const CardGrid: Story = {
|
|
|
228
228
|
<CardContent>
|
|
229
229
|
<CardBody>
|
|
230
230
|
<CardEyebrow>Category {i}</CardEyebrow>
|
|
231
|
-
<div className="flex flex-col gap-
|
|
231
|
+
<div className="flex flex-col gap-6">
|
|
232
232
|
<CardTitle>Card Title {i}</CardTitle>
|
|
233
233
|
<CardDescription>
|
|
234
234
|
Brief description of the card content goes here.
|
|
@@ -236,7 +236,7 @@ export const CardGrid: Story = {
|
|
|
236
236
|
</div>
|
|
237
237
|
</CardBody>
|
|
238
238
|
<CardActions>
|
|
239
|
-
<Button size="sm" variant="
|
|
239
|
+
<Button size="sm" variant="primary">
|
|
240
240
|
Action
|
|
241
241
|
</Button>
|
|
242
242
|
</CardActions>
|
|
@@ -262,7 +262,7 @@ export const Playground: Story = {
|
|
|
262
262
|
<CardContent>
|
|
263
263
|
<CardBody>
|
|
264
264
|
<CardEyebrow>Eyebrow</CardEyebrow>
|
|
265
|
-
<div className="flex flex-col gap-
|
|
265
|
+
<div className="flex flex-col gap-6">
|
|
266
266
|
<CardTitle>Card Title</CardTitle>
|
|
267
267
|
<CardDescription>
|
|
268
268
|
Use cards when citizens need to scan items at a glance.
|
|
@@ -270,10 +270,10 @@ export const Playground: Story = {
|
|
|
270
270
|
</div>
|
|
271
271
|
</CardBody>
|
|
272
272
|
<CardActions>
|
|
273
|
-
<Button size="
|
|
273
|
+
<Button size="md" variant="primary">
|
|
274
274
|
Primary
|
|
275
275
|
</Button>
|
|
276
|
-
<Button size="
|
|
276
|
+
<Button size="md" variant="primary-outline">
|
|
277
277
|
Secondary
|
|
278
278
|
</Button>
|
|
279
279
|
</CardActions>
|
|
@@ -142,7 +142,7 @@ const CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(
|
|
|
142
142
|
CardContent.displayName = "CardContent";
|
|
143
143
|
|
|
144
144
|
const cardEyebrowVariants = tv({
|
|
145
|
-
base: "typography-
|
|
145
|
+
base: "typography-overline text-text-muted uppercase tracking-wider",
|
|
146
146
|
});
|
|
147
147
|
|
|
148
148
|
export interface CardEyebrowProps
|
|
@@ -165,7 +165,7 @@ const CardEyebrow = React.forwardRef<HTMLParagraphElement, CardEyebrowProps>(
|
|
|
165
165
|
CardEyebrow.displayName = "CardEyebrow";
|
|
166
166
|
|
|
167
167
|
const cardTitleVariants = tv({
|
|
168
|
-
base: "typography-
|
|
168
|
+
base: "typography-h5 text-text-primary",
|
|
169
169
|
});
|
|
170
170
|
|
|
171
171
|
export interface CardTitleProps
|
|
@@ -240,7 +240,7 @@ const CardBody = React.forwardRef<HTMLDivElement, CardBodyProps>(
|
|
|
240
240
|
CardBody.displayName = "CardBody";
|
|
241
241
|
|
|
242
242
|
const cardActionsVariants = tv({
|
|
243
|
-
base: "flex gap-
|
|
243
|
+
base: "flex gap-12",
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
export interface CardActionsProps
|