@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
|
@@ -1,84 +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
|
-
const GridColumn = ({ index }: { index: number }) => (
|
|
13
|
-
<div className="h-12 bg-brand-primary/20 border border-brand-primary/40 rounded flex items-center justify-center">
|
|
14
|
-
<span className="text-xs font-mono text-brand-primary">{index + 1}</span>
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const GridVisualization = () => (
|
|
19
|
-
<div className="w-full bg-gray-100 py-8">
|
|
20
|
-
<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)]">
|
|
21
|
-
<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)]">
|
|
22
|
-
{Array.from({ length: 24 }).map((_, i) => (
|
|
23
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: Static grid columns never reorder
|
|
24
|
-
<GridColumn key={i} index={i} />
|
|
25
|
-
))}
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const meta = {
|
|
32
|
-
title: "Design System/Grid System",
|
|
33
|
-
component: GridVisualization,
|
|
34
|
-
parameters: {
|
|
35
|
-
layout: "fullscreen",
|
|
36
|
-
},
|
|
37
|
-
} satisfies Meta<typeof GridVisualization>;
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
40
|
-
type Story = StoryObj<typeof meta>;
|
|
41
|
-
|
|
42
|
-
export const Default: Story = {};
|
|
43
|
-
|
|
44
|
-
export const Desktop: Story = {
|
|
45
|
-
globals: { viewport: { value: "lg" } },
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const Tablet: Story = {
|
|
49
|
-
globals: { viewport: { value: "md" } },
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const Mobile: Story = {
|
|
53
|
-
globals: { viewport: { value: "sm" } },
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const ColumnSpans = () => (
|
|
57
|
-
<div className="w-full py-8 px-[var(--spatial-grid-large-margin)]">
|
|
58
|
-
<div className="max-w-[90rem] mx-auto grid grid-cols-24 gap-[var(--spatial-grid-large-gutter)]">
|
|
59
|
-
<div className="col-span-full h-12 bg-gray-200 rounded flex items-center px-4">
|
|
60
|
-
<code className="text-sm font-mono">col-span-full</code>
|
|
61
|
-
</div>
|
|
62
|
-
<div className="col-start-4 col-end-22 h-12 bg-gray-200 rounded flex items-center px-4">
|
|
63
|
-
<code className="text-sm font-mono">
|
|
64
|
-
col-start-4 col-end-22 (18 cols)
|
|
65
|
-
</code>
|
|
66
|
-
</div>
|
|
67
|
-
<div className="col-start-7 col-end-19 h-12 bg-gray-200 rounded flex items-center px-4">
|
|
68
|
-
<code className="text-sm font-mono">
|
|
69
|
-
col-start-7 col-end-19 (12 cols)
|
|
70
|
-
</code>
|
|
71
|
-
</div>
|
|
72
|
-
<div className="col-start-9 col-end-17 h-12 bg-gray-200 rounded flex items-center px-4">
|
|
73
|
-
<code className="text-sm font-mono">
|
|
74
|
-
col-start-9 col-end-17 (8 cols)
|
|
75
|
-
</code>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
export const Spans: Story = {
|
|
82
|
-
render: () => <ColumnSpans />,
|
|
83
|
-
globals: { viewport: { value: "lg" } },
|
|
84
|
-
};
|