@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,197 +0,0 @@
|
|
|
1
|
-
import { render } from "@testing-library/react";
|
|
2
|
-
import { describe, expect, test } from "vitest";
|
|
3
|
-
import { page } from "vitest/browser";
|
|
4
|
-
import { Button } from "../../atoms/button";
|
|
5
|
-
import {
|
|
6
|
-
Card,
|
|
7
|
-
CardActions,
|
|
8
|
-
CardBody,
|
|
9
|
-
CardContent,
|
|
10
|
-
CardDescription,
|
|
11
|
-
CardEyebrow,
|
|
12
|
-
CardImage,
|
|
13
|
-
CardTitle,
|
|
14
|
-
} from "./card";
|
|
15
|
-
|
|
16
|
-
describe("Card Visual Regression", () => {
|
|
17
|
-
test("default vertical layout renders correctly", async () => {
|
|
18
|
-
render(
|
|
19
|
-
<div
|
|
20
|
-
style={{ width: "418px", backgroundColor: "#1a1a1a", padding: "20px" }}
|
|
21
|
-
>
|
|
22
|
-
<Card data-testid="card">
|
|
23
|
-
<CardImage />
|
|
24
|
-
<CardContent>
|
|
25
|
-
<CardBody>
|
|
26
|
-
<CardEyebrow>Optional Eyebrow</CardEyebrow>
|
|
27
|
-
<div className="flex flex-col gap-6">
|
|
28
|
-
<CardTitle>Card Title</CardTitle>
|
|
29
|
-
<CardDescription>
|
|
30
|
-
Use cards when citizens need to scan items at a glance.
|
|
31
|
-
</CardDescription>
|
|
32
|
-
</div>
|
|
33
|
-
</CardBody>
|
|
34
|
-
<CardActions>
|
|
35
|
-
<Button size="md" variant="primary">
|
|
36
|
-
Primary
|
|
37
|
-
</Button>
|
|
38
|
-
<Button size="md" variant="primary-outline">
|
|
39
|
-
Secondary
|
|
40
|
-
</Button>
|
|
41
|
-
</CardActions>
|
|
42
|
-
</CardContent>
|
|
43
|
-
</Card>
|
|
44
|
-
</div>,
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
await expect(page.getByTestId("card")).toMatchScreenshot(
|
|
48
|
-
"card-default-vertical",
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
test("horizontal layout renders correctly", async () => {
|
|
53
|
-
render(
|
|
54
|
-
<div
|
|
55
|
-
style={{ width: "700px", backgroundColor: "#1a1a1a", padding: "20px" }}
|
|
56
|
-
>
|
|
57
|
-
<Card layout="horizontal" data-testid="card">
|
|
58
|
-
<CardImage />
|
|
59
|
-
<CardContent>
|
|
60
|
-
<CardBody>
|
|
61
|
-
<CardEyebrow>Eyebrow</CardEyebrow>
|
|
62
|
-
<div className="flex flex-col gap-8">
|
|
63
|
-
<CardTitle>
|
|
64
|
-
Cards can support multi line headings easily.
|
|
65
|
-
</CardTitle>
|
|
66
|
-
<CardDescription>
|
|
67
|
-
Use cards when citizens need to scan items at a glance.
|
|
68
|
-
</CardDescription>
|
|
69
|
-
</div>
|
|
70
|
-
</CardBody>
|
|
71
|
-
<CardActions>
|
|
72
|
-
<Button size="sm" variant="primary">
|
|
73
|
-
Primary
|
|
74
|
-
</Button>
|
|
75
|
-
<Button size="sm" variant="primary-outline">
|
|
76
|
-
Secondary
|
|
77
|
-
</Button>
|
|
78
|
-
</CardActions>
|
|
79
|
-
</CardContent>
|
|
80
|
-
</Card>
|
|
81
|
-
</div>,
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
await expect(page.getByTestId("card")).toMatchScreenshot("card-horizontal");
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test("without image renders correctly", async () => {
|
|
88
|
-
render(
|
|
89
|
-
<div
|
|
90
|
-
style={{ width: "418px", backgroundColor: "#1a1a1a", padding: "20px" }}
|
|
91
|
-
>
|
|
92
|
-
<Card data-testid="card">
|
|
93
|
-
<CardContent>
|
|
94
|
-
<CardBody>
|
|
95
|
-
<CardEyebrow>Category</CardEyebrow>
|
|
96
|
-
<div className="flex flex-col gap-6">
|
|
97
|
-
<CardTitle>Card Without Image</CardTitle>
|
|
98
|
-
<CardDescription>
|
|
99
|
-
Cards can be used without images for text-focused content.
|
|
100
|
-
</CardDescription>
|
|
101
|
-
</div>
|
|
102
|
-
</CardBody>
|
|
103
|
-
<CardActions>
|
|
104
|
-
<Button size="md" variant="primary">
|
|
105
|
-
Learn More
|
|
106
|
-
</Button>
|
|
107
|
-
</CardActions>
|
|
108
|
-
</CardContent>
|
|
109
|
-
</Card>
|
|
110
|
-
</div>,
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
await expect(page.getByTestId("card")).toMatchScreenshot(
|
|
114
|
-
"card-without-image",
|
|
115
|
-
);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
test("without eyebrow renders correctly", async () => {
|
|
119
|
-
render(
|
|
120
|
-
<div
|
|
121
|
-
style={{ width: "418px", backgroundColor: "#1a1a1a", padding: "20px" }}
|
|
122
|
-
>
|
|
123
|
-
<Card data-testid="card">
|
|
124
|
-
<CardImage />
|
|
125
|
-
<CardContent>
|
|
126
|
-
<CardBody>
|
|
127
|
-
<div className="flex flex-col gap-6">
|
|
128
|
-
<CardTitle>Card Title</CardTitle>
|
|
129
|
-
<CardDescription>
|
|
130
|
-
The eyebrow is optional and can be omitted when not needed.
|
|
131
|
-
</CardDescription>
|
|
132
|
-
</div>
|
|
133
|
-
</CardBody>
|
|
134
|
-
<CardActions>
|
|
135
|
-
<Button size="md" variant="primary">
|
|
136
|
-
Primary
|
|
137
|
-
</Button>
|
|
138
|
-
</CardActions>
|
|
139
|
-
</CardContent>
|
|
140
|
-
</Card>
|
|
141
|
-
</div>,
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
await expect(page.getByTestId("card")).toMatchScreenshot(
|
|
145
|
-
"card-without-eyebrow",
|
|
146
|
-
);
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
test("without actions renders correctly", async () => {
|
|
150
|
-
render(
|
|
151
|
-
<div
|
|
152
|
-
style={{ width: "418px", backgroundColor: "#1a1a1a", padding: "20px" }}
|
|
153
|
-
>
|
|
154
|
-
<Card data-testid="card">
|
|
155
|
-
<CardImage />
|
|
156
|
-
<CardContent>
|
|
157
|
-
<CardBody>
|
|
158
|
-
<CardEyebrow>Information</CardEyebrow>
|
|
159
|
-
<div className="flex flex-col gap-6">
|
|
160
|
-
<CardTitle>Informational Card</CardTitle>
|
|
161
|
-
<CardDescription>
|
|
162
|
-
Cards without actions can be used for purely informational
|
|
163
|
-
content.
|
|
164
|
-
</CardDescription>
|
|
165
|
-
</div>
|
|
166
|
-
</CardBody>
|
|
167
|
-
</CardContent>
|
|
168
|
-
</Card>
|
|
169
|
-
</div>,
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
await expect(page.getByTestId("card")).toMatchScreenshot(
|
|
173
|
-
"card-without-actions",
|
|
174
|
-
);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
test("minimal card renders correctly", async () => {
|
|
178
|
-
render(
|
|
179
|
-
<div
|
|
180
|
-
style={{ width: "418px", backgroundColor: "#1a1a1a", padding: "20px" }}
|
|
181
|
-
>
|
|
182
|
-
<Card data-testid="card">
|
|
183
|
-
<CardContent>
|
|
184
|
-
<CardBody>
|
|
185
|
-
<CardTitle>Minimal Card</CardTitle>
|
|
186
|
-
<CardDescription>
|
|
187
|
-
A minimal card with just title and description.
|
|
188
|
-
</CardDescription>
|
|
189
|
-
</CardBody>
|
|
190
|
-
</CardContent>
|
|
191
|
-
</Card>
|
|
192
|
-
</div>,
|
|
193
|
-
);
|
|
194
|
-
|
|
195
|
-
await expect(page.getByTestId("card")).toMatchScreenshot("card-minimal");
|
|
196
|
-
});
|
|
197
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Card,
|
|
3
|
-
CardActions,
|
|
4
|
-
type CardActionsProps,
|
|
5
|
-
CardBody,
|
|
6
|
-
type CardBodyProps,
|
|
7
|
-
CardContent,
|
|
8
|
-
type CardContentProps,
|
|
9
|
-
CardDescription,
|
|
10
|
-
type CardDescriptionProps,
|
|
11
|
-
CardEyebrow,
|
|
12
|
-
type CardEyebrowProps,
|
|
13
|
-
CardImage,
|
|
14
|
-
type CardImageProps,
|
|
15
|
-
type CardProps,
|
|
16
|
-
CardTitle,
|
|
17
|
-
type CardTitleProps,
|
|
18
|
-
cardActionsVariants,
|
|
19
|
-
cardBodyVariants,
|
|
20
|
-
cardContentVariants,
|
|
21
|
-
cardDescriptionVariants,
|
|
22
|
-
cardEyebrowVariants,
|
|
23
|
-
cardImageVariants,
|
|
24
|
-
cardTitleVariants,
|
|
25
|
-
cardVariants,
|
|
26
|
-
} from "./card";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Navbar,
|
|
3
|
-
NavbarActions,
|
|
4
|
-
type NavbarActionsProps,
|
|
5
|
-
NavbarBrand,
|
|
6
|
-
type NavbarBrandProps,
|
|
7
|
-
NavbarLink,
|
|
8
|
-
type NavbarLinkProps,
|
|
9
|
-
NavbarLinks,
|
|
10
|
-
type NavbarLinksProps,
|
|
11
|
-
NavbarMobileMenu,
|
|
12
|
-
NavbarMobileMenuButton,
|
|
13
|
-
type NavbarMobileMenuButtonProps,
|
|
14
|
-
NavbarMobileMenuLink,
|
|
15
|
-
type NavbarMobileMenuLinkProps,
|
|
16
|
-
type NavbarMobileMenuProps,
|
|
17
|
-
type NavbarProps,
|
|
18
|
-
} from "./navbar";
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { IconButton } from "../../atoms/button/icon-button";
|
|
3
|
-
import { USGovBanner } from "../us-gov-banner";
|
|
4
|
-
import {
|
|
5
|
-
Navbar,
|
|
6
|
-
NavbarActions,
|
|
7
|
-
NavbarBrand,
|
|
8
|
-
NavbarLink,
|
|
9
|
-
NavbarLinks,
|
|
10
|
-
NavbarMobileMenu,
|
|
11
|
-
NavbarMobileMenuButton,
|
|
12
|
-
NavbarMobileMenuLink,
|
|
13
|
-
} from ".";
|
|
14
|
-
|
|
15
|
-
const meta: Meta<typeof Navbar> = {
|
|
16
|
-
title: "Organisms/Navbar",
|
|
17
|
-
component: Navbar,
|
|
18
|
-
parameters: {
|
|
19
|
-
layout: "fullscreen",
|
|
20
|
-
},
|
|
21
|
-
} as Meta<typeof Navbar>;
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<typeof Navbar>;
|
|
25
|
-
|
|
26
|
-
const SearchIcon = () => (
|
|
27
|
-
<svg
|
|
28
|
-
width="17"
|
|
29
|
-
height="17"
|
|
30
|
-
viewBox="0 0 17 17"
|
|
31
|
-
fill="none"
|
|
32
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
33
|
-
aria-hidden="true"
|
|
34
|
-
>
|
|
35
|
-
<circle cx="7" cy="7" r="5.5" stroke="currentColor" strokeWidth="1.5" />
|
|
36
|
-
<path
|
|
37
|
-
d="M11 11L15 15"
|
|
38
|
-
stroke="currentColor"
|
|
39
|
-
strokeWidth="1.5"
|
|
40
|
-
strokeLinecap="round"
|
|
41
|
-
/>
|
|
42
|
-
</svg>
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
const MenuIcon = () => (
|
|
46
|
-
<svg
|
|
47
|
-
width="20"
|
|
48
|
-
height="20"
|
|
49
|
-
viewBox="0 0 20 20"
|
|
50
|
-
fill="none"
|
|
51
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
52
|
-
aria-hidden="true"
|
|
53
|
-
>
|
|
54
|
-
<path
|
|
55
|
-
d="M3 5H17M3 10H17M3 15H17"
|
|
56
|
-
stroke="currentColor"
|
|
57
|
-
strokeWidth="1.5"
|
|
58
|
-
strokeLinecap="round"
|
|
59
|
-
/>
|
|
60
|
-
</svg>
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
const BrandPlaceholder = () => (
|
|
64
|
-
<div className="size-[46px] rounded-radius-8 bg-gray-300" />
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
// =============================================================================
|
|
68
|
-
// Default
|
|
69
|
-
// =============================================================================
|
|
70
|
-
|
|
71
|
-
export const Default: Story = {
|
|
72
|
-
render: () => (
|
|
73
|
-
<Navbar>
|
|
74
|
-
<NavbarBrand>
|
|
75
|
-
<BrandPlaceholder />
|
|
76
|
-
</NavbarBrand>
|
|
77
|
-
<NavbarLinks>
|
|
78
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
79
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
80
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
81
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
82
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
83
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
84
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
85
|
-
</NavbarLinks>
|
|
86
|
-
<NavbarActions>
|
|
87
|
-
<IconButton variant="ghost" size="lg" aria-label="Search">
|
|
88
|
-
<SearchIcon />
|
|
89
|
-
</IconButton>
|
|
90
|
-
</NavbarActions>
|
|
91
|
-
</Navbar>
|
|
92
|
-
),
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// =============================================================================
|
|
96
|
-
// With US Gov Banner
|
|
97
|
-
// =============================================================================
|
|
98
|
-
|
|
99
|
-
export const WithUSGovBanner: Story = {
|
|
100
|
-
render: () => (
|
|
101
|
-
<div className="flex w-full flex-col">
|
|
102
|
-
<USGovBanner />
|
|
103
|
-
<Navbar>
|
|
104
|
-
<NavbarBrand>
|
|
105
|
-
<BrandPlaceholder />
|
|
106
|
-
</NavbarBrand>
|
|
107
|
-
<NavbarLinks>
|
|
108
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
109
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
110
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
111
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
112
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
113
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
114
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
115
|
-
</NavbarLinks>
|
|
116
|
-
<NavbarActions>
|
|
117
|
-
<IconButton variant="ivoryOutlineQuiet" size="lg" aria-label="Search">
|
|
118
|
-
<SearchIcon />
|
|
119
|
-
</IconButton>
|
|
120
|
-
</NavbarActions>
|
|
121
|
-
</Navbar>
|
|
122
|
-
</div>
|
|
123
|
-
),
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
// =============================================================================
|
|
127
|
-
// Responsive Variants
|
|
128
|
-
// =============================================================================
|
|
129
|
-
|
|
130
|
-
export const Desktop: Story = {
|
|
131
|
-
render: () => (
|
|
132
|
-
<div className="flex w-full flex-col">
|
|
133
|
-
<USGovBanner />
|
|
134
|
-
<Navbar>
|
|
135
|
-
<NavbarBrand>
|
|
136
|
-
<BrandPlaceholder />
|
|
137
|
-
</NavbarBrand>
|
|
138
|
-
<NavbarLinks>
|
|
139
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
140
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
141
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
142
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
143
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
144
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
145
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
146
|
-
</NavbarLinks>
|
|
147
|
-
<NavbarActions>
|
|
148
|
-
<IconButton variant="ivoryOutlineQuiet" size="lg" aria-label="Search">
|
|
149
|
-
<SearchIcon />
|
|
150
|
-
</IconButton>
|
|
151
|
-
</NavbarActions>
|
|
152
|
-
</Navbar>
|
|
153
|
-
</div>
|
|
154
|
-
),
|
|
155
|
-
globals: {
|
|
156
|
-
viewport: { value: "lg", isRotated: false },
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export const Tablet: Story = {
|
|
161
|
-
render: () => (
|
|
162
|
-
<div className="flex w-full flex-col">
|
|
163
|
-
<USGovBanner />
|
|
164
|
-
<Navbar>
|
|
165
|
-
<NavbarBrand>
|
|
166
|
-
<BrandPlaceholder />
|
|
167
|
-
</NavbarBrand>
|
|
168
|
-
<NavbarLinks>
|
|
169
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
170
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
171
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
172
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
173
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
174
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
175
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
176
|
-
</NavbarLinks>
|
|
177
|
-
<NavbarActions>
|
|
178
|
-
<IconButton variant="ghost" size="default" aria-label="Search">
|
|
179
|
-
<SearchIcon />
|
|
180
|
-
</IconButton>
|
|
181
|
-
</NavbarActions>
|
|
182
|
-
</Navbar>
|
|
183
|
-
</div>
|
|
184
|
-
),
|
|
185
|
-
globals: {
|
|
186
|
-
viewport: { value: "md", isRotated: false },
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
export const Mobile: Story = {
|
|
191
|
-
render: () => (
|
|
192
|
-
<div className="flex w-full flex-col">
|
|
193
|
-
<USGovBanner />
|
|
194
|
-
<Navbar>
|
|
195
|
-
<NavbarBrand>
|
|
196
|
-
<div className="size-[26px] rounded-radius-8 bg-gray-300" />
|
|
197
|
-
</NavbarBrand>
|
|
198
|
-
<NavbarLinks>
|
|
199
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
200
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
201
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
202
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
203
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
204
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
205
|
-
<NavbarLink href="#">Link</NavbarLink>
|
|
206
|
-
</NavbarLinks>
|
|
207
|
-
<NavbarActions>
|
|
208
|
-
<NavbarMobileMenuButton asChild>
|
|
209
|
-
<IconButton variant="ghost" size="default" aria-label="Menu">
|
|
210
|
-
<MenuIcon />
|
|
211
|
-
</IconButton>
|
|
212
|
-
</NavbarMobileMenuButton>
|
|
213
|
-
</NavbarActions>
|
|
214
|
-
<NavbarMobileMenu>
|
|
215
|
-
<NavbarMobileMenuLink href="#">Home</NavbarMobileMenuLink>
|
|
216
|
-
<NavbarMobileMenuLink href="#">About</NavbarMobileMenuLink>
|
|
217
|
-
<NavbarMobileMenuLink href="#">Services</NavbarMobileMenuLink>
|
|
218
|
-
<NavbarMobileMenuLink href="#">Resources</NavbarMobileMenuLink>
|
|
219
|
-
<NavbarMobileMenuLink href="#">News</NavbarMobileMenuLink>
|
|
220
|
-
<NavbarMobileMenuLink href="#">Careers</NavbarMobileMenuLink>
|
|
221
|
-
<NavbarMobileMenuLink href="#">Contact</NavbarMobileMenuLink>
|
|
222
|
-
</NavbarMobileMenu>
|
|
223
|
-
</Navbar>
|
|
224
|
-
</div>
|
|
225
|
-
),
|
|
226
|
-
globals: {
|
|
227
|
-
viewport: { value: "sm", isRotated: false },
|
|
228
|
-
},
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
// =============================================================================
|
|
232
|
-
// With Active Link
|
|
233
|
-
// =============================================================================
|
|
234
|
-
|
|
235
|
-
export const WithActiveLink: Story = {
|
|
236
|
-
render: () => (
|
|
237
|
-
<Navbar>
|
|
238
|
-
<NavbarBrand>
|
|
239
|
-
<BrandPlaceholder />
|
|
240
|
-
</NavbarBrand>
|
|
241
|
-
<NavbarLinks>
|
|
242
|
-
<NavbarLink href="#" active>
|
|
243
|
-
Home
|
|
244
|
-
</NavbarLink>
|
|
245
|
-
<NavbarLink href="#">About</NavbarLink>
|
|
246
|
-
<NavbarLink href="#">Services</NavbarLink>
|
|
247
|
-
<NavbarLink href="#">Contact</NavbarLink>
|
|
248
|
-
</NavbarLinks>
|
|
249
|
-
<NavbarActions>
|
|
250
|
-
<IconButton variant="ghost" size="lg" aria-label="Search">
|
|
251
|
-
<SearchIcon />
|
|
252
|
-
</IconButton>
|
|
253
|
-
</NavbarActions>
|
|
254
|
-
</Navbar>
|
|
255
|
-
),
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
// =============================================================================
|
|
259
|
-
// Responsive with Mobile Menu
|
|
260
|
-
// =============================================================================
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Complete responsive navbar example.
|
|
264
|
-
* - Desktop: Shows inline links
|
|
265
|
-
* - Mobile: Shows hamburger menu that opens a full-screen navigation
|
|
266
|
-
*
|
|
267
|
-
* Resize the viewport or view in different viewport sizes to see the responsive behavior.
|
|
268
|
-
*/
|
|
269
|
-
export const ResponsiveWithMobileMenu: Story = {
|
|
270
|
-
render: () => (
|
|
271
|
-
<div className="flex w-full flex-col">
|
|
272
|
-
<USGovBanner />
|
|
273
|
-
<Navbar>
|
|
274
|
-
<NavbarBrand>
|
|
275
|
-
<BrandPlaceholder />
|
|
276
|
-
</NavbarBrand>
|
|
277
|
-
<NavbarLinks>
|
|
278
|
-
<NavbarLink href="#" active>
|
|
279
|
-
Home
|
|
280
|
-
</NavbarLink>
|
|
281
|
-
<NavbarLink href="#">About</NavbarLink>
|
|
282
|
-
<NavbarLink href="#">Services</NavbarLink>
|
|
283
|
-
<NavbarLink href="#">Resources</NavbarLink>
|
|
284
|
-
<NavbarLink href="#">Contact</NavbarLink>
|
|
285
|
-
</NavbarLinks>
|
|
286
|
-
<NavbarActions>
|
|
287
|
-
<IconButton
|
|
288
|
-
variant="ghost"
|
|
289
|
-
size="lg"
|
|
290
|
-
aria-label="Search"
|
|
291
|
-
className="hidden md:flex"
|
|
292
|
-
>
|
|
293
|
-
<SearchIcon />
|
|
294
|
-
</IconButton>
|
|
295
|
-
<NavbarMobileMenuButton asChild>
|
|
296
|
-
<IconButton variant="ghost" size="default" aria-label="Menu">
|
|
297
|
-
<MenuIcon />
|
|
298
|
-
</IconButton>
|
|
299
|
-
</NavbarMobileMenuButton>
|
|
300
|
-
</NavbarActions>
|
|
301
|
-
<NavbarMobileMenu>
|
|
302
|
-
<NavbarMobileMenuLink href="#" active>
|
|
303
|
-
Home
|
|
304
|
-
</NavbarMobileMenuLink>
|
|
305
|
-
<NavbarMobileMenuLink href="#">About</NavbarMobileMenuLink>
|
|
306
|
-
<NavbarMobileMenuLink href="#">Services</NavbarMobileMenuLink>
|
|
307
|
-
<NavbarMobileMenuLink href="#">Resources</NavbarMobileMenuLink>
|
|
308
|
-
<NavbarMobileMenuLink href="#">Contact</NavbarMobileMenuLink>
|
|
309
|
-
</NavbarMobileMenu>
|
|
310
|
-
</Navbar>
|
|
311
|
-
</div>
|
|
312
|
-
),
|
|
313
|
-
};
|