@nationaldesignstudio/react 0.5.2 → 0.5.3
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/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,309 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Spatial Grid System
|
|
5
|
-
*
|
|
6
|
-
* Responsive grid tokens that adapt across breakpoints:
|
|
7
|
-
* - Large (lg): 1440px+ - 24 columns, 72px margin, 24px gutter
|
|
8
|
-
* - Medium (md): 768px+ - 12 columns, 56px margin, 20px gutter
|
|
9
|
-
* - Small (sm): 320px+ - 4 columns, 24px margin, 12px gutter
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
// Enhanced grid column with solid color styling
|
|
13
|
-
const GridColumn = ({ index }: { index: number }) => {
|
|
14
|
-
const colors = [
|
|
15
|
-
"bg-blue-100",
|
|
16
|
-
"bg-indigo-100",
|
|
17
|
-
"bg-purple-100",
|
|
18
|
-
"bg-pink-100",
|
|
19
|
-
"bg-red-100",
|
|
20
|
-
"bg-orange-100",
|
|
21
|
-
"bg-amber-100",
|
|
22
|
-
"bg-yellow-100",
|
|
23
|
-
"bg-lime-100",
|
|
24
|
-
"bg-green-100",
|
|
25
|
-
"bg-emerald-100",
|
|
26
|
-
"bg-teal-100",
|
|
27
|
-
"bg-cyan-100",
|
|
28
|
-
"bg-sky-100",
|
|
29
|
-
"bg-blue-100",
|
|
30
|
-
"bg-indigo-100",
|
|
31
|
-
"bg-purple-100",
|
|
32
|
-
"bg-pink-100",
|
|
33
|
-
"bg-red-100",
|
|
34
|
-
"bg-orange-100",
|
|
35
|
-
"bg-amber-100",
|
|
36
|
-
"bg-yellow-100",
|
|
37
|
-
"bg-lime-100",
|
|
38
|
-
"bg-green-100",
|
|
39
|
-
];
|
|
40
|
-
return (
|
|
41
|
-
<div
|
|
42
|
-
className={`h-16 rounded-2 border-2 border-white/50 flex items-center justify-center shadow-sm transition-all hover:scale-105 ${colors[index % colors.length]}`}
|
|
43
|
-
>
|
|
44
|
-
<span className="text-xs font-bold font-mono text-gray-700">
|
|
45
|
-
{index + 1}
|
|
46
|
-
</span>
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// Grid visualization with better styling
|
|
52
|
-
const GridVisualization = () => (
|
|
53
|
-
<div className="w-full bg-gray-50 py-16">
|
|
54
|
-
<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)]">
|
|
55
|
-
<div className="mb-8">
|
|
56
|
-
<h2 className="typography-h3 text-gray-900 mb-2">
|
|
57
|
-
Responsive Grid System
|
|
58
|
-
</h2>
|
|
59
|
-
<p className="typography-body text-gray-600">
|
|
60
|
-
The grid adapts across breakpoints: 4 columns (mobile), 12 columns
|
|
61
|
-
(tablet), 24 columns (desktop)
|
|
62
|
-
</p>
|
|
63
|
-
</div>
|
|
64
|
-
<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)]">
|
|
65
|
-
{Array.from({ length: 24 }).map((_, i) => (
|
|
66
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: Static grid columns never reorder
|
|
67
|
-
<GridColumn key={i} index={i} />
|
|
68
|
-
))}
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
// Enhanced spans visualization with content examples
|
|
75
|
-
const ColumnSpans = () => (
|
|
76
|
-
<div className="w-full bg-white py-16">
|
|
77
|
-
<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)]">
|
|
78
|
-
<div className="mb-12">
|
|
79
|
-
<h2 className="typography-h3 text-gray-900 mb-2">
|
|
80
|
-
Column Spans & Positioning
|
|
81
|
-
</h2>
|
|
82
|
-
<p className="typography-body text-gray-600">
|
|
83
|
-
Use col-span and col-start/col-end to create flexible layouts
|
|
84
|
-
</p>
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
{/* Full width */}
|
|
88
|
-
<div className="mb-8 grid grid-cols-1 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)]">
|
|
89
|
-
<div className="col-span-full rounded-8 bg-blue-600 p-8 text-white shadow-lg">
|
|
90
|
-
<div className="flex items-center justify-between">
|
|
91
|
-
<div>
|
|
92
|
-
<code className="text-sm font-mono bg-white/20 px-3 py-1 rounded">
|
|
93
|
-
col-span-full
|
|
94
|
-
</code>
|
|
95
|
-
<p className="mt-4 typography-body-large">
|
|
96
|
-
Full-width hero section or banner
|
|
97
|
-
</p>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
{/* Centered wide content */}
|
|
104
|
-
<div className="mb-8 grid grid-cols-1 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)]">
|
|
105
|
-
<div className="col-span-full lg:col-start-4 lg:col-end-22 rounded-8 bg-purple-600 p-8 text-white shadow-lg">
|
|
106
|
-
<div>
|
|
107
|
-
<code className="text-sm font-mono bg-white/20 px-3 py-1 rounded mb-4 inline-block">
|
|
108
|
-
col-start-4 col-end-22 (18 cols)
|
|
109
|
-
</code>
|
|
110
|
-
<p className="typography-body-large">
|
|
111
|
-
Centered wide content area - perfect for dashboards or data tables
|
|
112
|
-
</p>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
{/* Two column layout */}
|
|
118
|
-
<div className="mb-8 grid grid-cols-1 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)]">
|
|
119
|
-
<div className="col-span-full lg:col-start-3 lg:col-end-13 rounded-8 bg-green-600 p-8 text-white shadow-lg">
|
|
120
|
-
<code className="text-sm font-mono bg-white/20 px-3 py-1 rounded mb-4 inline-block">
|
|
121
|
-
col-start-3 col-end-13 (10 cols)
|
|
122
|
-
</code>
|
|
123
|
-
<p className="typography-body">Left column content</p>
|
|
124
|
-
</div>
|
|
125
|
-
<div className="col-span-full lg:col-start-13 lg:col-end-23 rounded-8 bg-orange-600 p-8 text-white shadow-lg">
|
|
126
|
-
<code className="text-sm font-mono bg-white/20 px-3 py-1 rounded mb-4 inline-block">
|
|
127
|
-
col-start-13 col-end-23 (10 cols)
|
|
128
|
-
</code>
|
|
129
|
-
<p className="typography-body">Right column content</p>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
|
|
133
|
-
{/* Narrow centered content */}
|
|
134
|
-
<div className="grid grid-cols-1 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)]">
|
|
135
|
-
<div className="col-span-full lg:col-start-7 lg:col-end-19 rounded-8 bg-indigo-600 p-8 text-white shadow-lg">
|
|
136
|
-
<code className="text-sm font-mono bg-white/20 px-3 py-1 rounded mb-4 inline-block">
|
|
137
|
-
col-start-7 col-end-19 (12 cols)
|
|
138
|
-
</code>
|
|
139
|
-
<p className="typography-body">
|
|
140
|
-
Narrow centered content - ideal for reading or forms
|
|
141
|
-
</p>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
// Content layout utilities demonstration
|
|
149
|
-
const ContentLayoutsDemo = () => (
|
|
150
|
-
<div className="w-full bg-white py-16">
|
|
151
|
-
<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)]">
|
|
152
|
-
<div className="mb-12">
|
|
153
|
-
<h2 className="typography-h3 text-gray-900 mb-2">
|
|
154
|
-
Content Layout Utilities
|
|
155
|
-
</h2>
|
|
156
|
-
<p className="typography-body text-gray-600">
|
|
157
|
-
Pre-built utilities for common content widths: narrow, medium, and
|
|
158
|
-
wide
|
|
159
|
-
</p>
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
{/* Grid container */}
|
|
163
|
-
<div className="grid grid-cols-1 md:grid-cols-12 lg:grid-cols-24 gap-y-32 md:gap-y-48 lg:gap-y-64 gap-[var(--spatial-grid-small-gutter)] md:gap-[var(--spatial-grid-medium-gutter)] lg:gap-[var(--spatial-grid-large-gutter)]">
|
|
164
|
-
{/* Narrow content */}
|
|
165
|
-
<div className="grid-content-narrow">
|
|
166
|
-
<div className="rounded-8 bg-white border-2 border-gray-200 p-12 shadow-md">
|
|
167
|
-
<div className="mb-4">
|
|
168
|
-
<code className="text-sm font-mono text-blue-600 bg-blue-50 px-3 py-1 rounded">
|
|
169
|
-
grid-content-narrow
|
|
170
|
-
</code>
|
|
171
|
-
</div>
|
|
172
|
-
<h3 className="typography-h4 text-gray-900 mb-4">Narrow Content</h3>
|
|
173
|
-
<p className="typography-body text-gray-700">
|
|
174
|
-
Perfect for reading content, mission statements, or focused text
|
|
175
|
-
blocks. This layout centers content with optimal reading width.
|
|
176
|
-
</p>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
|
|
180
|
-
{/* Medium content */}
|
|
181
|
-
<div className="grid-content-medium">
|
|
182
|
-
<div className="rounded-8 bg-white border-2 border-gray-200 p-12 shadow-md">
|
|
183
|
-
<div className="mb-4">
|
|
184
|
-
<code className="text-sm font-mono text-green-600 bg-green-50 px-3 py-1 rounded">
|
|
185
|
-
grid-content-medium
|
|
186
|
-
</code>
|
|
187
|
-
</div>
|
|
188
|
-
<h3 className="typography-h4 text-gray-900 mb-4">Medium Content</h3>
|
|
189
|
-
<p className="typography-body text-gray-700">
|
|
190
|
-
Great for forms, general content, or sections that need a bit more
|
|
191
|
-
width than narrow but still maintain readability.
|
|
192
|
-
</p>
|
|
193
|
-
</div>
|
|
194
|
-
</div>
|
|
195
|
-
|
|
196
|
-
{/* Wide content */}
|
|
197
|
-
<div className="grid-content-wide">
|
|
198
|
-
<div className="rounded-8 bg-white border-2 border-gray-200 p-12 shadow-md">
|
|
199
|
-
<div className="mb-4">
|
|
200
|
-
<code className="text-sm font-mono text-purple-600 bg-purple-50 px-3 py-1 rounded">
|
|
201
|
-
grid-content-wide
|
|
202
|
-
</code>
|
|
203
|
-
</div>
|
|
204
|
-
<h3 className="typography-h4 text-gray-900 mb-4">Wide Content</h3>
|
|
205
|
-
<p className="typography-body text-gray-700">
|
|
206
|
-
Ideal for dashboards, data tables, or content that needs maximum
|
|
207
|
-
width while still respecting grid margins.
|
|
208
|
-
</p>
|
|
209
|
-
</div>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
// Real-world example
|
|
217
|
-
const RealWorldExampleDemo = () => (
|
|
218
|
-
<div className="w-full bg-white py-16">
|
|
219
|
-
<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)]">
|
|
220
|
-
<div className="mb-12">
|
|
221
|
-
<h2 className="typography-h3 text-gray-900 mb-2">Real-World Example</h2>
|
|
222
|
-
<p className="typography-body text-gray-600">
|
|
223
|
-
How the grid system is used in practice
|
|
224
|
-
</p>
|
|
225
|
-
</div>
|
|
226
|
-
|
|
227
|
-
<div className="grid grid-cols-1 md:grid-cols-12 lg:grid-cols-24 gap-y-32 md:gap-y-48 lg:gap-y-64 gap-[var(--spatial-grid-small-gutter)] md:gap-[var(--spatial-grid-medium-gutter)] lg:gap-[var(--spatial-grid-large-gutter)]">
|
|
228
|
-
{/* Hero section */}
|
|
229
|
-
<div className="col-span-full rounded-12 bg-blue-600 p-16 text-white shadow-xl">
|
|
230
|
-
<div className="max-w-3xl">
|
|
231
|
-
<h1 className="typography-h1 mb-6">Hero Section</h1>
|
|
232
|
-
<p className="typography-body-large opacity-90">
|
|
233
|
-
Full-width hero sections use col-span-full to create impactful
|
|
234
|
-
introductions.
|
|
235
|
-
</p>
|
|
236
|
-
</div>
|
|
237
|
-
</div>
|
|
238
|
-
|
|
239
|
-
{/* Narrow content section */}
|
|
240
|
-
<div className="grid-content-narrow">
|
|
241
|
-
<div className="space-y-6">
|
|
242
|
-
<h2 className="typography-h3 text-gray-900">Mission Statement</h2>
|
|
243
|
-
<p className="typography-body text-gray-700">
|
|
244
|
-
This narrow content area is perfect for focused reading. The
|
|
245
|
-
grid-content-narrow utility automatically centers the content with
|
|
246
|
-
optimal width for readability.
|
|
247
|
-
</p>
|
|
248
|
-
</div>
|
|
249
|
-
</div>
|
|
250
|
-
|
|
251
|
-
{/* Two-column card layout */}
|
|
252
|
-
<div className="col-span-full lg:col-start-3 lg:col-end-11 rounded-8 bg-white border-2 border-gray-200 p-8 shadow-md">
|
|
253
|
-
<div className="h-32 bg-blue-500 rounded-4 mb-4" />
|
|
254
|
-
<h3 className="typography-h4 text-gray-900 mb-2">Card Title</h3>
|
|
255
|
-
<p className="typography-body-small text-gray-600">
|
|
256
|
-
Card content spans 8 columns
|
|
257
|
-
</p>
|
|
258
|
-
</div>
|
|
259
|
-
<div className="col-span-full lg:col-start-13 lg:col-end-21 rounded-8 bg-white border-2 border-gray-200 p-8 shadow-md">
|
|
260
|
-
<div className="h-32 bg-purple-500 rounded-4 mb-4" />
|
|
261
|
-
<h3 className="typography-h4 text-gray-900 mb-2">Card Title</h3>
|
|
262
|
-
<p className="typography-body-small text-gray-600">
|
|
263
|
-
Card content spans 8 columns
|
|
264
|
-
</p>
|
|
265
|
-
</div>
|
|
266
|
-
</div>
|
|
267
|
-
</div>
|
|
268
|
-
</div>
|
|
269
|
-
);
|
|
270
|
-
|
|
271
|
-
const meta = {
|
|
272
|
-
title: "Design System/Grid System",
|
|
273
|
-
component: GridVisualization,
|
|
274
|
-
parameters: {
|
|
275
|
-
layout: "fullscreen",
|
|
276
|
-
},
|
|
277
|
-
} satisfies Meta<typeof GridVisualization>;
|
|
278
|
-
|
|
279
|
-
export default meta;
|
|
280
|
-
type Story = StoryObj<typeof meta>;
|
|
281
|
-
|
|
282
|
-
export const Default: Story = {};
|
|
283
|
-
|
|
284
|
-
export const Desktop: Story = {
|
|
285
|
-
globals: { viewport: { value: "lg" } },
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
export const Tablet: Story = {
|
|
289
|
-
globals: { viewport: { value: "md" } },
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
export const Mobile: Story = {
|
|
293
|
-
globals: { viewport: { value: "sm" } },
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
export const Spans: Story = {
|
|
297
|
-
render: () => <ColumnSpans />,
|
|
298
|
-
globals: { viewport: { value: "lg" } },
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
export const ContentLayouts: Story = {
|
|
302
|
-
render: () => <ContentLayoutsDemo />,
|
|
303
|
-
globals: { viewport: { value: "lg" } },
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
export const RealWorldExample: Story = {
|
|
307
|
-
render: () => <RealWorldExampleDemo />,
|
|
308
|
-
globals: { viewport: { value: "lg" } },
|
|
309
|
-
};
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
-
|
|
3
|
-
<Meta title="Introduction" />
|
|
4
|
-
|
|
5
|
-
# NDS Design System
|
|
6
|
-
|
|
7
|
-
Welcome to the **NDS Design System** component library. This Storybook documents all available components, their variants, and design tokens.
|
|
8
|
-
|
|
9
|
-
## Getting Started
|
|
10
|
-
|
|
11
|
-
### Installation
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
bun add @nationaldesignstudio/react
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### Setup Tailwind CSS v4
|
|
18
|
-
|
|
19
|
-
Import the generated tokens CSS in your main CSS file:
|
|
20
|
-
|
|
21
|
-
```css
|
|
22
|
-
/* app.css or globals.css */
|
|
23
|
-
@import "tailwindcss";
|
|
24
|
-
@import "@nationaldesignstudio/react/tokens.css";
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
This gives you access to all design tokens as CSS variables and Tailwind utilities.
|
|
28
|
-
|
|
29
|
-
### Using Components
|
|
30
|
-
|
|
31
|
-
```tsx
|
|
32
|
-
import { Button } from "@nationaldesignstudio/react";
|
|
33
|
-
|
|
34
|
-
function App() {
|
|
35
|
-
return <Button variant="primary">Click me</Button>;
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Typography Styles
|
|
40
|
-
|
|
41
|
-
The design system provides pre-built typography classes for consistent text styling. Typography utilities use the `typography-` prefix to avoid conflicts with Tailwind's `text-*` color utilities.
|
|
42
|
-
|
|
43
|
-
### Headings
|
|
44
|
-
|
|
45
|
-
For headlines and titles:
|
|
46
|
-
|
|
47
|
-
```html
|
|
48
|
-
<h1 class="typography-h1-display">Display Title</h1>
|
|
49
|
-
<h1 class="typography-h1">Page Title</h1>
|
|
50
|
-
<h2 class="typography-h2">Section Header</h2>
|
|
51
|
-
<h3 class="typography-h3">Subsection Header</h3>
|
|
52
|
-
<h4 class="typography-h4">Smaller Header</h4>
|
|
53
|
-
<h5 class="typography-h5">Smallest Header</h5>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Body Text
|
|
57
|
-
|
|
58
|
-
For body content:
|
|
59
|
-
|
|
60
|
-
```html
|
|
61
|
-
<p class="typography-body-large">Large body text...</p>
|
|
62
|
-
<p class="typography-body-medium">Standard body text...</p>
|
|
63
|
-
<p class="typography-body-small">Small body text...</p>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Supporting Text
|
|
67
|
-
|
|
68
|
-
For captions and labels:
|
|
69
|
-
|
|
70
|
-
```html
|
|
71
|
-
<span class="typography-caption">Caption text</span>
|
|
72
|
-
<span class="typography-overline">OVERLINE TEXT</span>
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### UI Typography
|
|
76
|
-
|
|
77
|
-
For buttons and interactive elements:
|
|
78
|
-
|
|
79
|
-
```html
|
|
80
|
-
<button class="typography-ui-button-large">Large Button</button>
|
|
81
|
-
<button class="typography-ui-button-medium">Medium Button</button>
|
|
82
|
-
<button class="typography-ui-button-small">Small Button</button>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## Color Tokens
|
|
86
|
-
|
|
87
|
-
All colors are available as Tailwind utilities:
|
|
88
|
-
|
|
89
|
-
```html
|
|
90
|
-
<div class="bg-blue-500 text-gray-900">...</div>
|
|
91
|
-
<div class="bg-alpha-black-50">Semi-transparent overlay</div>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
See **Design System > Tokens > Colors** for the full palette.
|
|
95
|
-
|
|
96
|
-
## Spacing Tokens
|
|
97
|
-
|
|
98
|
-
Consistent spacing values:
|
|
99
|
-
|
|
100
|
-
```html
|
|
101
|
-
<div class="p-spacing-16 m-spacing-24 gap-spacing-8">...</div>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Features
|
|
105
|
-
|
|
106
|
-
- **Design Tokens** - Comprehensive token system for colors, spacing, and typography
|
|
107
|
-
- **Accessibility** - Components tested for WCAG compliance
|
|
108
|
-
- **TypeScript** - Full type safety with detailed prop documentation
|
|
109
|
-
- **Tailwind CSS v4** - Built on modern Tailwind with CSS variables
|
|
110
|
-
|
|
111
|
-
## Structure
|
|
112
|
-
|
|
113
|
-
- **Components** - Reusable UI components (Button, etc.)
|
|
114
|
-
- **Design System > Tokens** - Visual token documentation
|
|
115
|
-
|
|
116
|
-
## Development
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
# Run Storybook locally
|
|
120
|
-
cd packages/react
|
|
121
|
-
bun run storybook
|
|
122
|
-
|
|
123
|
-
# Build tokens after changes
|
|
124
|
-
bun run build
|
|
125
|
-
|
|
126
|
-
# Run tests
|
|
127
|
-
bun run test
|
|
128
|
-
```
|