@nationaldesignstudio/react 0.5.2 → 0.5.4
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/package.json +10 -2
- package/src/components/organisms/navbar/navbar.tsx +8 -8
- package/src/App.css +0 -0
- package/src/App.tsx +0 -7
- package/src/assets/fonts/PPNeueMontreal-Variable.woff2 +0 -0
- package/src/assets/react.svg +0 -1
- package/src/components/atoms/accordion/accordion.stories.tsx +0 -228
- package/src/components/atoms/accordion/accordion.test.tsx +0 -231
- package/src/components/atoms/accordion/index.ts +0 -6
- package/src/components/atoms/background/background.test.tsx +0 -213
- package/src/components/atoms/background/index.ts +0 -22
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-quiet-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-quiet-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-disabled-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-disabled-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-quiet-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-quiet-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-large-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-large-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-medium-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-medium-chromium-linux.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-small-chromium-darwin.png +0 -0
- package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-small-chromium-linux.png +0 -0
- package/src/components/atoms/button/button.stories.tsx +0 -289
- package/src/components/atoms/button/button.test.tsx +0 -419
- package/src/components/atoms/button/button.visual.test.tsx +0 -98
- package/src/components/atoms/button/icon-button.stories.tsx +0 -260
- package/src/components/atoms/button/icon-button.test.tsx +0 -186
- package/src/components/atoms/button/index.ts +0 -6
- package/src/components/atoms/input/index.ts +0 -17
- package/src/components/atoms/input/input-group.stories.tsx +0 -646
- package/src/components/atoms/input/input-group.test.tsx +0 -362
- package/src/components/atoms/input/input.stories.tsx +0 -228
- package/src/components/atoms/input/input.test.tsx +0 -167
- package/src/components/atoms/ndstudio-footer/index.ts +0 -1
- package/src/components/atoms/pager-control/index.ts +0 -5
- package/src/components/atoms/pager-control/pager-control.stories.tsx +0 -207
- package/src/components/atoms/pager-control/pager-control.test.tsx +0 -130
- package/src/components/atoms/popover/index.ts +0 -30
- package/src/components/atoms/popover/popover.stories.tsx +0 -531
- package/src/components/atoms/popover/popover.test.tsx +0 -486
- package/src/components/atoms/select/index.ts +0 -18
- package/src/components/atoms/select/select.stories.tsx +0 -455
- package/src/components/atoms/tooltip/index.ts +0 -24
- package/src/components/atoms/tooltip/tooltip.stories.tsx +0 -348
- package/src/components/atoms/tooltip/tooltip.test.tsx +0 -363
- package/src/components/dev-tools/dev-toolbar/dev-toolbar.stories.tsx +0 -73
- package/src/components/dev-tools/dev-toolbar/index.ts +0 -1
- package/src/components/dev-tools/grid-overlay/index.ts +0 -1
- package/src/components/dev-tools/index.ts +0 -2
- package/src/components/foundation/typography/typography.stories.tsx +0 -401
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-default-vertical-chromium-darwin.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-default-vertical-chromium-linux.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-horizontal-chromium-darwin.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-horizontal-chromium-linux.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-minimal-chromium-darwin.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-minimal-chromium-linux.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-actions-chromium-darwin.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-actions-chromium-linux.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-eyebrow-chromium-darwin.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-eyebrow-chromium-linux.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-image-chromium-darwin.png +0 -0
- package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-image-chromium-linux.png +0 -0
- package/src/components/organisms/card/card.stories.tsx +0 -293
- package/src/components/organisms/card/card.test.tsx +0 -247
- package/src/components/organisms/card/card.visual.test.tsx +0 -197
- package/src/components/organisms/card/index.ts +0 -26
- package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-active-link-chromium-darwin.png +0 -0
- package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-active-link-chromium-linux.png +0 -0
- package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-brand-only-chromium-darwin.png +0 -0
- package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-brand-only-chromium-linux.png +0 -0
- package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-default-chromium-darwin.png +0 -0
- package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-default-chromium-linux.png +0 -0
- package/src/components/organisms/navbar/index.ts +0 -18
- package/src/components/organisms/navbar/navbar.stories.tsx +0 -313
- package/src/components/organisms/navbar/navbar.test.tsx +0 -190
- package/src/components/organisms/navbar/navbar.visual.test.tsx +0 -85
- package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-icon-chromium-darwin.png +0 -0
- package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-icon-chromium-linux.png +0 -0
- package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-text-chromium-darwin.png +0 -0
- package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-text-chromium-linux.png +0 -0
- package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-default-chromium-darwin.png +0 -0
- package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-default-chromium-linux.png +0 -0
- package/src/components/organisms/us-gov-banner/index.ts +0 -5
- package/src/components/organisms/us-gov-banner/us-gov-banner.stories.tsx +0 -35
- package/src/components/organisms/us-gov-banner/us-gov-banner.test.tsx +0 -107
- package/src/components/organisms/us-gov-banner/us-gov-banner.visual.test.tsx +0 -46
- package/src/components/sections/banner/banner.stories.tsx +0 -150
- package/src/components/sections/banner/banner.test.tsx +0 -185
- package/src/components/sections/banner/index.ts +0 -2
- package/src/components/sections/card-grid/card-grid.stories.tsx +0 -351
- package/src/components/sections/card-grid/index.ts +0 -1
- package/src/components/sections/faq-section/faq-section.stories.tsx +0 -453
- package/src/components/sections/faq-section/index.ts +0 -2
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-desktop-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-desktop-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-mobile-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-mobile-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-tablet-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-tablet-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-desktop-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-desktop-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-mobile-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-mobile-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-tablet-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-tablet-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-desktop-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-desktop-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-mobile-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-mobile-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-tablet-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-tablet-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-custom-class-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-custom-class-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-default-chromium-linux.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-long-title-chromium-darwin.png +0 -0
- package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-long-title-chromium-linux.png +0 -0
- package/src/components/sections/hero/hero.stories.tsx +0 -397
- package/src/components/sections/hero/hero.test.tsx +0 -138
- package/src/components/sections/hero/hero.visual.test.tsx +0 -140
- package/src/components/sections/hero/index.ts +0 -23
- package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-h3-heading-chromium-darwin.png +0 -0
- package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-h3-heading-chromium-linux.png +0 -0
- package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-paragraphs-chromium-darwin.png +0 -0
- package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-paragraphs-chromium-linux.png +0 -0
- package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-sections-chromium-darwin.png +0 -0
- package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-sections-chromium-linux.png +0 -0
- package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-single-section-chromium-darwin.png +0 -0
- package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-single-section-chromium-linux.png +0 -0
- package/src/components/sections/prose/index.ts +0 -6
- package/src/components/sections/prose/prose.stories.tsx +0 -144
- package/src/components/sections/prose/prose.test.tsx +0 -178
- package/src/components/sections/prose/prose.visual.test.tsx +0 -105
- package/src/components/sections/quote-block/index.ts +0 -5
- package/src/components/sections/river/index.ts +0 -1
- package/src/components/sections/river/river.stories.tsx +0 -237
- package/src/components/sections/river/river.test.tsx +0 -268
- package/src/components/sections/tout/index.ts +0 -1
- package/src/components/sections/tout/tout.stories.tsx +0 -171
- package/src/components/sections/tout/tout.test.tsx +0 -242
- package/src/components/sections/two-column-section/index.ts +0 -5
- package/src/components/sections/two-column-section/two-column-section.stories.tsx +0 -285
- package/src/components/shared/index.ts +0 -5
- package/src/index.ts +0 -293
- package/src/main.tsx +0 -13
- package/src/stories/grid-system.stories.tsx +0 -309
- package/src/stories/introduction.mdx +0 -128
- package/src/stories/theme-provider.stories.tsx +0 -349
- package/src/stories/token-showcase.stories.tsx +0 -73
- package/src/stories/token-showcase.tsx +0 -777
- package/src/styles.css +0 -14
- package/src/tests/token-resolution.test.tsx +0 -298
- package/src/theme/theme-provider.test.tsx +0 -270
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Button } from "../components/atoms/button";
|
|
3
|
-
import {
|
|
4
|
-
Card,
|
|
5
|
-
CardActions,
|
|
6
|
-
CardBody,
|
|
7
|
-
CardContent,
|
|
8
|
-
CardDescription,
|
|
9
|
-
CardTitle,
|
|
10
|
-
} from "../components/organisms/card";
|
|
11
|
-
import { ThemeProvider } from "../theme";
|
|
12
|
-
|
|
13
|
-
function ThemeDemo({ title }: { title?: string }) {
|
|
14
|
-
return (
|
|
15
|
-
<div className="p-6">
|
|
16
|
-
<div className="bg-bg-page p-6 rounded-lg min-h-[300px]">
|
|
17
|
-
{title && (
|
|
18
|
-
<h2 className="typography-h5 text-text-primary mb-4">{title}</h2>
|
|
19
|
-
)}
|
|
20
|
-
|
|
21
|
-
{/* Typography showcase */}
|
|
22
|
-
<div className="mb-6">
|
|
23
|
-
<p className="typography-body-large text-text-primary mb-2">
|
|
24
|
-
Primary text using typography tokens
|
|
25
|
-
</p>
|
|
26
|
-
<p className="typography-body-small text-text-secondary">
|
|
27
|
-
Secondary text for supporting content
|
|
28
|
-
</p>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
{/* Button variants */}
|
|
32
|
-
<div className="flex flex-wrap gap-3 mb-6">
|
|
33
|
-
<Button variant="primary">Primary</Button>
|
|
34
|
-
<Button variant="primary-outline">Primary Outline</Button>
|
|
35
|
-
<Button variant="ghost">Ghost</Button>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
{/* Card component */}
|
|
39
|
-
<Card className="max-w-sm">
|
|
40
|
-
<CardContent>
|
|
41
|
-
<CardBody>
|
|
42
|
-
<CardTitle>Card Title</CardTitle>
|
|
43
|
-
<CardDescription>
|
|
44
|
-
This card demonstrates surface tokens including border radius
|
|
45
|
-
and stroke width.
|
|
46
|
-
</CardDescription>
|
|
47
|
-
</CardBody>
|
|
48
|
-
<CardActions>
|
|
49
|
-
<Button variant="primary" size="sm">
|
|
50
|
-
Action
|
|
51
|
-
</Button>
|
|
52
|
-
<Button variant="primary-outline" size="sm">
|
|
53
|
-
Cancel
|
|
54
|
-
</Button>
|
|
55
|
-
</CardActions>
|
|
56
|
-
</CardContent>
|
|
57
|
-
</Card>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const meta: Meta<typeof ThemeProvider> = {
|
|
64
|
-
title: "Theme/ThemeProvider",
|
|
65
|
-
component: ThemeProvider,
|
|
66
|
-
parameters: {
|
|
67
|
-
layout: "fullscreen",
|
|
68
|
-
docs: {
|
|
69
|
-
description: {
|
|
70
|
-
component: `
|
|
71
|
-
The ThemeProvider component applies theme tokens as CSS variables using type-safe theme names.
|
|
72
|
-
|
|
73
|
-
## Props
|
|
74
|
-
|
|
75
|
-
- \`color\`: Color theme name - "base" | "dark" | "institution" | "civic" (defaults to "base")
|
|
76
|
-
- \`surface\`: Surface theme name - "base" | "sharp" | "framed" | "soft" (defaults to "base")
|
|
77
|
-
|
|
78
|
-
## Usage
|
|
79
|
-
|
|
80
|
-
\`\`\`tsx
|
|
81
|
-
import { ThemeProvider, useCSSVars } from '@nationaldesignstudio/react';
|
|
82
|
-
|
|
83
|
-
// Use defaults (base themes)
|
|
84
|
-
function App() {
|
|
85
|
-
return (
|
|
86
|
-
<ThemeProvider>
|
|
87
|
-
<Layout />
|
|
88
|
-
</ThemeProvider>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Use specific themes
|
|
93
|
-
function ThemedApp() {
|
|
94
|
-
return (
|
|
95
|
-
<ThemeProvider color="civic" surface="sharp">
|
|
96
|
-
<Layout />
|
|
97
|
-
</ThemeProvider>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function Layout() {
|
|
102
|
-
const cssVars = useCSSVars();
|
|
103
|
-
return (
|
|
104
|
-
<div style={cssVars}>
|
|
105
|
-
<Button variant="primary">Click me</Button>
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
\`\`\`
|
|
110
|
-
`,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
tags: ["autodocs"],
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export default meta;
|
|
118
|
-
type Story = StoryObj<typeof ThemeProvider>;
|
|
119
|
-
|
|
120
|
-
// =============================================================================
|
|
121
|
-
// Color Theme Stories
|
|
122
|
-
// =============================================================================
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Base color theme - the default light color palette.
|
|
126
|
-
*/
|
|
127
|
-
export const BaseColor: Story = {
|
|
128
|
-
render: () => (
|
|
129
|
-
<ThemeProvider color="base">
|
|
130
|
-
<ThemeDemo title="Base Color Theme" />
|
|
131
|
-
</ThemeProvider>
|
|
132
|
-
),
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Dark color theme - inverted colors for dark mode.
|
|
137
|
-
*/
|
|
138
|
-
export const DarkColor: Story = {
|
|
139
|
-
render: () => (
|
|
140
|
-
<ThemeProvider color="dark">
|
|
141
|
-
<ThemeDemo title="Dark Color Theme" />
|
|
142
|
-
</ThemeProvider>
|
|
143
|
-
),
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Institution color theme - warm brown palette with green accents.
|
|
148
|
-
*/
|
|
149
|
-
export const InstitutionColor: Story = {
|
|
150
|
-
render: () => (
|
|
151
|
-
<ThemeProvider color="institution">
|
|
152
|
-
<ThemeDemo title="Institution Color Theme" />
|
|
153
|
-
</ThemeProvider>
|
|
154
|
-
),
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Civic color theme - for government/public sector applications.
|
|
159
|
-
*/
|
|
160
|
-
export const CivicColor: Story = {
|
|
161
|
-
render: () => (
|
|
162
|
-
<ThemeProvider color="civic">
|
|
163
|
-
<ThemeDemo title="Civic Color Theme" />
|
|
164
|
-
</ThemeProvider>
|
|
165
|
-
),
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Color theme comparison - all color variants side by side.
|
|
170
|
-
*/
|
|
171
|
-
export const ColorComparison: Story = {
|
|
172
|
-
render: () => (
|
|
173
|
-
<div className="grid grid-cols-2 gap-4">
|
|
174
|
-
<ThemeProvider color="base">
|
|
175
|
-
<ThemeDemo title="Base" />
|
|
176
|
-
</ThemeProvider>
|
|
177
|
-
<ThemeProvider color="dark">
|
|
178
|
-
<ThemeDemo title="Dark" />
|
|
179
|
-
</ThemeProvider>
|
|
180
|
-
<ThemeProvider color="institution">
|
|
181
|
-
<ThemeDemo title="Institution" />
|
|
182
|
-
</ThemeProvider>
|
|
183
|
-
<ThemeProvider color="civic">
|
|
184
|
-
<ThemeDemo title="Civic" />
|
|
185
|
-
</ThemeProvider>
|
|
186
|
-
</div>
|
|
187
|
-
),
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
// =============================================================================
|
|
191
|
-
// Surface Theme Stories
|
|
192
|
-
// =============================================================================
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Base surface theme - default border radius and stroke widths.
|
|
196
|
-
*/
|
|
197
|
-
export const BaseSurface: Story = {
|
|
198
|
-
render: () => (
|
|
199
|
-
<ThemeProvider surface="base">
|
|
200
|
-
<ThemeDemo title="Base Surface Theme" />
|
|
201
|
-
</ThemeProvider>
|
|
202
|
-
),
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Sharp surface theme - minimal border radius for an angular look.
|
|
207
|
-
*/
|
|
208
|
-
export const SharpSurface: Story = {
|
|
209
|
-
render: () => (
|
|
210
|
-
<ThemeProvider surface="sharp">
|
|
211
|
-
<ThemeDemo title="Sharp Surface Theme" />
|
|
212
|
-
</ThemeProvider>
|
|
213
|
-
),
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Framed surface theme - heavier borders and no button radius.
|
|
218
|
-
*/
|
|
219
|
-
export const FramedSurface: Story = {
|
|
220
|
-
render: () => (
|
|
221
|
-
<ThemeProvider surface="framed">
|
|
222
|
-
<ThemeDemo title="Framed Surface Theme" />
|
|
223
|
-
</ThemeProvider>
|
|
224
|
-
),
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Soft surface theme - large rounded corners and minimal strokes.
|
|
229
|
-
*/
|
|
230
|
-
export const SoftSurface: Story = {
|
|
231
|
-
render: () => (
|
|
232
|
-
<ThemeProvider surface="soft">
|
|
233
|
-
<ThemeDemo title="Soft Surface Theme" />
|
|
234
|
-
</ThemeProvider>
|
|
235
|
-
),
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Surface theme comparison - all surface variants side by side.
|
|
240
|
-
* Notice the different border radius and stroke widths on buttons and cards.
|
|
241
|
-
*/
|
|
242
|
-
export const SurfaceComparison: Story = {
|
|
243
|
-
render: () => (
|
|
244
|
-
<div className="grid grid-cols-2 gap-4">
|
|
245
|
-
<ThemeProvider surface="base">
|
|
246
|
-
<ThemeDemo title="Base" />
|
|
247
|
-
</ThemeProvider>
|
|
248
|
-
<ThemeProvider surface="sharp">
|
|
249
|
-
<ThemeDemo title="Sharp" />
|
|
250
|
-
</ThemeProvider>
|
|
251
|
-
<ThemeProvider surface="framed">
|
|
252
|
-
<ThemeDemo title="Framed" />
|
|
253
|
-
</ThemeProvider>
|
|
254
|
-
<ThemeProvider surface="soft">
|
|
255
|
-
<ThemeDemo title="Soft" />
|
|
256
|
-
</ThemeProvider>
|
|
257
|
-
</div>
|
|
258
|
-
),
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
// =============================================================================
|
|
262
|
-
// Combined Theme Stories
|
|
263
|
-
// =============================================================================
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Civic color + Sharp surface - example of combining color and surface themes.
|
|
267
|
-
*/
|
|
268
|
-
export const CivicSharp: Story = {
|
|
269
|
-
render: () => (
|
|
270
|
-
<ThemeProvider color="civic" surface="sharp">
|
|
271
|
-
<ThemeDemo title="Civic + Sharp" />
|
|
272
|
-
</ThemeProvider>
|
|
273
|
-
),
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Institution color + Framed surface - example of combining color and surface themes.
|
|
278
|
-
*/
|
|
279
|
-
export const InstitutionFramed: Story = {
|
|
280
|
-
render: () => (
|
|
281
|
-
<ThemeProvider color="institution" surface="framed">
|
|
282
|
-
<ThemeDemo title="Institution + Framed" />
|
|
283
|
-
</ThemeProvider>
|
|
284
|
-
),
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Dark color + Sharp surface - angular dark mode.
|
|
289
|
-
*/
|
|
290
|
-
export const DarkSharp: Story = {
|
|
291
|
-
render: () => (
|
|
292
|
-
<ThemeProvider color="dark" surface="sharp">
|
|
293
|
-
<ThemeDemo title="Dark + Sharp" />
|
|
294
|
-
</ThemeProvider>
|
|
295
|
-
),
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Civic color + Soft surface - rounded, friendly civic theme.
|
|
300
|
-
*/
|
|
301
|
-
export const CivicSoft: Story = {
|
|
302
|
-
render: () => (
|
|
303
|
-
<ThemeProvider color="civic" surface="soft">
|
|
304
|
-
<ThemeDemo title="Civic + Soft" />
|
|
305
|
-
</ThemeProvider>
|
|
306
|
-
),
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* Default theme - no props needed, uses base for both.
|
|
311
|
-
*/
|
|
312
|
-
export const Default: Story = {
|
|
313
|
-
render: () => (
|
|
314
|
-
<ThemeProvider>
|
|
315
|
-
<ThemeDemo title="Default (Base + Base)" />
|
|
316
|
-
</ThemeProvider>
|
|
317
|
-
),
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
// =============================================================================
|
|
321
|
-
// Interactive Playground
|
|
322
|
-
// =============================================================================
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Interactive playground - use controls to select any combination of themes.
|
|
326
|
-
*/
|
|
327
|
-
export const Playground: Story = {
|
|
328
|
-
args: {
|
|
329
|
-
color: "base",
|
|
330
|
-
surface: "base",
|
|
331
|
-
},
|
|
332
|
-
argTypes: {
|
|
333
|
-
color: {
|
|
334
|
-
control: "select",
|
|
335
|
-
options: ["base", "dark", "institution", "civic"],
|
|
336
|
-
description: "Color theme",
|
|
337
|
-
},
|
|
338
|
-
surface: {
|
|
339
|
-
control: "select",
|
|
340
|
-
options: ["base", "sharp", "framed", "soft"],
|
|
341
|
-
description: "Surface theme",
|
|
342
|
-
},
|
|
343
|
-
},
|
|
344
|
-
render: (args) => (
|
|
345
|
-
<ThemeProvider color={args.color} surface={args.surface}>
|
|
346
|
-
<ThemeDemo title={`${args.color} + ${args.surface}`} />
|
|
347
|
-
</ThemeProvider>
|
|
348
|
-
),
|
|
349
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import type { ComponentProps } from "react";
|
|
3
|
-
import {
|
|
4
|
-
ColorTokens,
|
|
5
|
-
ResponsiveTypography,
|
|
6
|
-
SpacingTokens,
|
|
7
|
-
TokenShowcase,
|
|
8
|
-
TypographyTokens,
|
|
9
|
-
} from "./token-showcase";
|
|
10
|
-
|
|
11
|
-
const meta = {
|
|
12
|
-
title: "Design System/Tokens",
|
|
13
|
-
component: TokenShowcase,
|
|
14
|
-
parameters: {
|
|
15
|
-
layout: "fullscreen",
|
|
16
|
-
docs: {
|
|
17
|
-
description: {
|
|
18
|
-
component:
|
|
19
|
-
"Design tokens from the design system. These tokens provide a consistent foundation for colors, spacing, and typography across the application.",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
tags: ["autodocs"],
|
|
24
|
-
} satisfies Meta<ComponentProps<typeof TokenShowcase>>;
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
export const AllTokens: Story = {};
|
|
30
|
-
|
|
31
|
-
export const Colors: Story = {
|
|
32
|
-
render: () => (
|
|
33
|
-
<div className="p-8">
|
|
34
|
-
<ColorTokens />
|
|
35
|
-
</div>
|
|
36
|
-
),
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Spacing: Story = {
|
|
40
|
-
render: () => (
|
|
41
|
-
<div className="p-8 min-h-screen">
|
|
42
|
-
<div className="max-w-4xl mx-auto">
|
|
43
|
-
<SpacingTokens />
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
),
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const Typography: Story = {
|
|
50
|
-
render: () => (
|
|
51
|
-
<div className="p-8 min-h-screen">
|
|
52
|
-
<div className="max-w-6xl mx-auto">
|
|
53
|
-
<TypographyTokens />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
),
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const Breakpoints: Story = {
|
|
60
|
-
render: () => (
|
|
61
|
-
<div className="p-8">
|
|
62
|
-
<ResponsiveTypography />
|
|
63
|
-
</div>
|
|
64
|
-
),
|
|
65
|
-
parameters: {
|
|
66
|
-
docs: {
|
|
67
|
-
description: {
|
|
68
|
-
story:
|
|
69
|
-
"Typography that adapts across breakpoints. Use the viewport toolbar to switch between sm (320px), md (768px), and lg (1440px).",
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
};
|