@nationaldesignstudio/react 0.0.9 → 0.0.11

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.
Files changed (170) hide show
  1. package/dist/component-registry.md +2405 -0
  2. package/dist/components/atoms/accordion/accordion.d.ts +44 -3
  3. package/dist/components/atoms/button/button.d.ts +155 -11
  4. package/dist/components/atoms/button/icon-button.d.ts +114 -5
  5. package/dist/components/atoms/ndstudio-footer/ndstudio-footer.d.ts +30 -0
  6. package/dist/components/atoms/pager-control/pager-control.d.ts +116 -9
  7. package/dist/components/dev-tools/dev-toolbar/dev-toolbar.d.ts +4 -0
  8. package/dist/components/dev-tools/grid-overlay/grid-overlay.d.ts +6 -0
  9. package/dist/components/organisms/card/card.d.ts +40 -4
  10. package/dist/components/sections/banner/banner.d.ts +39 -6
  11. package/dist/components/sections/card-grid/card-grid.d.ts +37 -4
  12. package/dist/components/sections/faq-section/faq-section.d.ts +2 -2
  13. package/dist/components/sections/hero/hero.d.ts +167 -16
  14. package/dist/components/sections/river/river.d.ts +37 -4
  15. package/dist/components/sections/tout/tout.d.ts +86 -6
  16. package/dist/components/sections/two-column-section/two-column-section.d.ts +80 -6
  17. package/dist/hooks/index.d.ts +1 -0
  18. package/dist/hooks/use-event-listener.d.ts +24 -0
  19. package/dist/index.d.ts +9 -2
  20. package/dist/index.js +12034 -5934
  21. package/dist/index.js.map +1 -1
  22. package/dist/lib/theme.d.ts +330 -0
  23. package/dist/tailwind.css +1 -15
  24. package/dist/tokens.css +13057 -6852
  25. package/package.json +12 -23
  26. package/src/App.css +0 -0
  27. package/src/App.tsx +0 -7
  28. package/src/assets/fonts/PPNeueMontreal-Variable.woff2 +0 -0
  29. package/src/assets/react.svg +0 -1
  30. package/src/components/atoms/accordion/accordion.stories.tsx +0 -228
  31. package/src/components/atoms/accordion/accordion.tsx +0 -137
  32. package/src/components/atoms/accordion/index.ts +0 -6
  33. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-chromium-darwin.png +0 -0
  34. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-chromium-linux.png +0 -0
  35. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-chromium-darwin.png +0 -0
  36. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-chromium-linux.png +0 -0
  37. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-quiet-chromium-darwin.png +0 -0
  38. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-charcoal-outline-quiet-chromium-linux.png +0 -0
  39. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-disabled-chromium-darwin.png +0 -0
  40. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-disabled-chromium-linux.png +0 -0
  41. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-chromium-darwin.png +0 -0
  42. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-chromium-linux.png +0 -0
  43. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-chromium-darwin.png +0 -0
  44. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-chromium-linux.png +0 -0
  45. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-quiet-chromium-darwin.png +0 -0
  46. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-ivory-outline-quiet-chromium-linux.png +0 -0
  47. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-large-chromium-darwin.png +0 -0
  48. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-large-chromium-linux.png +0 -0
  49. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-medium-chromium-darwin.png +0 -0
  50. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-medium-chromium-linux.png +0 -0
  51. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-small-chromium-darwin.png +0 -0
  52. package/src/components/atoms/button/__screenshots__/button.visual.test.tsx/button-size-small-chromium-linux.png +0 -0
  53. package/src/components/atoms/button/button.stories.tsx +0 -84
  54. package/src/components/atoms/button/button.test.tsx +0 -141
  55. package/src/components/atoms/button/button.tsx +0 -95
  56. package/src/components/atoms/button/button.visual.test.tsx +0 -102
  57. package/src/components/atoms/button/icon-button.stories.tsx +0 -166
  58. package/src/components/atoms/button/icon-button.tsx +0 -125
  59. package/src/components/atoms/button/index.ts +0 -6
  60. package/src/components/atoms/pager-control/index.ts +0 -5
  61. package/src/components/atoms/pager-control/pager-control.stories.tsx +0 -209
  62. package/src/components/atoms/pager-control/pager-control.test.tsx +0 -149
  63. package/src/components/atoms/pager-control/pager-control.tsx +0 -328
  64. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-default-vertical-chromium-darwin.png +0 -0
  65. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-default-vertical-chromium-linux.png +0 -0
  66. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-horizontal-chromium-darwin.png +0 -0
  67. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-horizontal-chromium-linux.png +0 -0
  68. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-minimal-chromium-darwin.png +0 -0
  69. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-minimal-chromium-linux.png +0 -0
  70. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-actions-chromium-darwin.png +0 -0
  71. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-actions-chromium-linux.png +0 -0
  72. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-eyebrow-chromium-darwin.png +0 -0
  73. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-eyebrow-chromium-linux.png +0 -0
  74. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-image-chromium-darwin.png +0 -0
  75. package/src/components/organisms/card/__screenshots__/card.visual.test.tsx/card-without-image-chromium-linux.png +0 -0
  76. package/src/components/organisms/card/card.stories.tsx +0 -293
  77. package/src/components/organisms/card/card.test.tsx +0 -245
  78. package/src/components/organisms/card/card.tsx +0 -227
  79. package/src/components/organisms/card/card.visual.test.tsx +0 -197
  80. package/src/components/organisms/card/index.ts +0 -19
  81. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-active-link-chromium-darwin.png +0 -0
  82. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-active-link-chromium-linux.png +0 -0
  83. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-brand-only-chromium-darwin.png +0 -0
  84. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-brand-only-chromium-linux.png +0 -0
  85. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-default-chromium-darwin.png +0 -0
  86. package/src/components/organisms/navbar/__screenshots__/navbar.visual.test.tsx/navbar-default-chromium-linux.png +0 -0
  87. package/src/components/organisms/navbar/index.ts +0 -18
  88. package/src/components/organisms/navbar/navbar.stories.tsx +0 -313
  89. package/src/components/organisms/navbar/navbar.test.tsx +0 -190
  90. package/src/components/organisms/navbar/navbar.tsx +0 -317
  91. package/src/components/organisms/navbar/navbar.visual.test.tsx +0 -85
  92. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-icon-chromium-darwin.png +0 -0
  93. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-icon-chromium-linux.png +0 -0
  94. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-text-chromium-darwin.png +0 -0
  95. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-custom-text-chromium-linux.png +0 -0
  96. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-default-chromium-darwin.png +0 -0
  97. package/src/components/organisms/us-gov-banner/__screenshots__/us-gov-banner.visual.test.tsx/us-gov-banner-default-chromium-linux.png +0 -0
  98. package/src/components/organisms/us-gov-banner/index.ts +0 -1
  99. package/src/components/organisms/us-gov-banner/us-gov-banner.stories.tsx +0 -35
  100. package/src/components/organisms/us-gov-banner/us-gov-banner.test.tsx +0 -107
  101. package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +0 -73
  102. package/src/components/organisms/us-gov-banner/us-gov-banner.visual.test.tsx +0 -46
  103. package/src/components/sections/banner/banner.stories.tsx +0 -150
  104. package/src/components/sections/banner/banner.test.tsx +0 -185
  105. package/src/components/sections/banner/banner.tsx +0 -130
  106. package/src/components/sections/banner/index.ts +0 -2
  107. package/src/components/sections/card-grid/card-grid.stories.tsx +0 -351
  108. package/src/components/sections/card-grid/card-grid.tsx +0 -118
  109. package/src/components/sections/card-grid/index.ts +0 -1
  110. package/src/components/sections/faq-section/faq-section.tsx +0 -77
  111. package/src/components/sections/faq-section/index.ts +0 -2
  112. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-desktop-chromium-darwin.png +0 -0
  113. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-desktop-chromium-linux.png +0 -0
  114. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-mobile-chromium-darwin.png +0 -0
  115. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-mobile-chromium-linux.png +0 -0
  116. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-tablet-chromium-darwin.png +0 -0
  117. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a1-tablet-chromium-linux.png +0 -0
  118. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-desktop-chromium-darwin.png +0 -0
  119. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-desktop-chromium-linux.png +0 -0
  120. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-mobile-chromium-darwin.png +0 -0
  121. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-mobile-chromium-linux.png +0 -0
  122. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-tablet-chromium-darwin.png +0 -0
  123. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a2-tablet-chromium-linux.png +0 -0
  124. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-desktop-chromium-darwin.png +0 -0
  125. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-desktop-chromium-linux.png +0 -0
  126. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-mobile-chromium-darwin.png +0 -0
  127. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-mobile-chromium-linux.png +0 -0
  128. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-tablet-chromium-darwin.png +0 -0
  129. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-a3-tablet-chromium-linux.png +0 -0
  130. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-custom-class-chromium-darwin.png +0 -0
  131. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-custom-class-chromium-linux.png +0 -0
  132. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-default-chromium-linux.png +0 -0
  133. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-long-title-chromium-darwin.png +0 -0
  134. package/src/components/sections/hero/__screenshots__/hero.visual.test.tsx/hero-long-title-chromium-linux.png +0 -0
  135. package/src/components/sections/hero/hero.stories.tsx +0 -145
  136. package/src/components/sections/hero/hero.test.tsx +0 -135
  137. package/src/components/sections/hero/hero.tsx +0 -191
  138. package/src/components/sections/hero/hero.visual.test.tsx +0 -140
  139. package/src/components/sections/hero/index.ts +0 -1
  140. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-h3-heading-chromium-darwin.png +0 -0
  141. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-h3-heading-chromium-linux.png +0 -0
  142. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-paragraphs-chromium-darwin.png +0 -0
  143. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-paragraphs-chromium-linux.png +0 -0
  144. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-sections-chromium-darwin.png +0 -0
  145. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-multiple-sections-chromium-linux.png +0 -0
  146. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-single-section-chromium-darwin.png +0 -0
  147. package/src/components/sections/prose/__screenshots__/prose.visual.test.tsx/prose-single-section-chromium-linux.png +0 -0
  148. package/src/components/sections/prose/index.ts +0 -6
  149. package/src/components/sections/prose/prose.stories.tsx +0 -144
  150. package/src/components/sections/prose/prose.test.tsx +0 -178
  151. package/src/components/sections/prose/prose.tsx +0 -88
  152. package/src/components/sections/prose/prose.visual.test.tsx +0 -105
  153. package/src/components/sections/river/index.ts +0 -1
  154. package/src/components/sections/river/river.stories.tsx +0 -237
  155. package/src/components/sections/river/river.test.tsx +0 -268
  156. package/src/components/sections/river/river.tsx +0 -175
  157. package/src/components/sections/tout/index.ts +0 -1
  158. package/src/components/sections/tout/tout.stories.tsx +0 -154
  159. package/src/components/sections/tout/tout.test.tsx +0 -242
  160. package/src/components/sections/tout/tout.tsx +0 -206
  161. package/src/components/sections/two-column-section/index.ts +0 -5
  162. package/src/components/sections/two-column-section/two-column-section.stories.tsx +0 -285
  163. package/src/components/sections/two-column-section/two-column-section.tsx +0 -152
  164. package/src/index.ts +0 -98
  165. package/src/lib/utils.ts +0 -6
  166. package/src/main.tsx +0 -13
  167. package/src/stories/Introduction.mdx +0 -114
  168. package/src/stories/TokenShowcase.stories.tsx +0 -92
  169. package/src/stories/TokenShowcase.tsx +0 -1352
  170. package/src/styles.css +0 -11
@@ -1,351 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { Button } from "../../atoms/button";
3
- import {
4
- Card,
5
- CardActions,
6
- CardBody,
7
- CardContent,
8
- CardDescription,
9
- CardEyebrow,
10
- CardImage,
11
- CardTitle,
12
- } from "../../organisms/card";
13
- import { CardGrid } from ".";
14
-
15
- const meta: Meta<typeof CardGrid> = {
16
- title: "Sections/CardGrid",
17
- component: CardGrid,
18
- parameters: {
19
- layout: "fullscreen",
20
- },
21
- argTypes: {
22
- variant: {
23
- control: "select",
24
- options: ["A", "B"],
25
- description:
26
- "Layout variant: A = 3 cols on desktop, B = 2 cols on desktop",
27
- },
28
- title: {
29
- control: "text",
30
- description: "The title text displayed above the cards",
31
- },
32
- },
33
- } as Meta<typeof CardGrid>;
34
-
35
- export default meta;
36
- type Story = StoryObj<typeof CardGrid>;
37
-
38
- const SampleCard = ({
39
- title,
40
- description,
41
- }: {
42
- title: string;
43
- description: string;
44
- }) => (
45
- <Card>
46
- <CardImage src="https://images.unsplash.com/photo-1551434678-e076c223a692?w=800&h=450&fit=crop" />
47
- <CardContent>
48
- <CardBody>
49
- <CardEyebrow>Category</CardEyebrow>
50
- <CardTitle>{title}</CardTitle>
51
- <CardDescription>{description}</CardDescription>
52
- </CardBody>
53
- <CardActions>
54
- <Button size="sm">Learn More</Button>
55
- </CardActions>
56
- </CardContent>
57
- </Card>
58
- );
59
-
60
- const PlaceholderCard = ({
61
- title,
62
- description,
63
- }: {
64
- title: string;
65
- description: string;
66
- }) => (
67
- <Card>
68
- <CardImage>
69
- <div className="absolute inset-0 bg-gray-200 flex items-center justify-center">
70
- <span className="text-gray-500 typography-body-small">
71
- Image Placeholder
72
- </span>
73
- </div>
74
- </CardImage>
75
- <CardContent>
76
- <CardBody>
77
- <CardEyebrow>Category</CardEyebrow>
78
- <CardTitle>{title}</CardTitle>
79
- <CardDescription>{description}</CardDescription>
80
- </CardBody>
81
- <CardActions>
82
- <Button size="sm">Learn More</Button>
83
- </CardActions>
84
- </CardContent>
85
- </Card>
86
- );
87
-
88
- const sampleCards = [
89
- <PlaceholderCard
90
- key="1"
91
- title="First Card"
92
- description="This is a sample card description that provides context about the content."
93
- />,
94
- <PlaceholderCard
95
- key="2"
96
- title="Second Card"
97
- description="Another card with a brief description explaining its purpose."
98
- />,
99
- <PlaceholderCard
100
- key="3"
101
- title="Third Card"
102
- description="A third card to demonstrate the grid layout behavior."
103
- />,
104
- <PlaceholderCard
105
- key="4"
106
- title="Fourth Card"
107
- description="The final card in this example grid layout."
108
- />,
109
- ];
110
-
111
- export const Playground: Story = {
112
- render: (args) => <CardGrid {...args} />,
113
- };
114
- Playground.args = {
115
- variant: "A",
116
- title: "Featured Content",
117
- cards: sampleCards,
118
- };
119
-
120
- // =============================================================================
121
- // Variants
122
- // =============================================================================
123
-
124
- /**
125
- * Variant A: 3 columns on desktop, 2 on tablet, 1 on mobile
126
- */
127
- export const VariantA: Story = {
128
- render: () => (
129
- <CardGrid
130
- variant="A"
131
- title="Our Services"
132
- cards={sampleCards.slice(0, 4)}
133
- />
134
- ),
135
- };
136
-
137
- /**
138
- * Variant B: 2 columns on desktop/tablet, 1 on mobile
139
- */
140
- export const VariantB: Story = {
141
- render: () => (
142
- <CardGrid
143
- variant="B"
144
- title="Featured Articles"
145
- cards={sampleCards.slice(0, 4)}
146
- />
147
- ),
148
- };
149
-
150
- export const VariantBDesktop: Story = {
151
- render: () => (
152
- <CardGrid
153
- variant="B"
154
- title="Desktop View (Variant B)"
155
- cards={[
156
- <PlaceholderCard
157
- key="1"
158
- title="Card One"
159
- description="Variant B displays 2 columns on desktop instead of 3."
160
- />,
161
- <PlaceholderCard
162
- key="2"
163
- title="Card Two"
164
- description="This is useful for larger card layouts or featured content."
165
- />,
166
- ]}
167
- />
168
- ),
169
- globals: {
170
- viewport: { value: "lg", isRotated: false },
171
- },
172
- };
173
-
174
- // =============================================================================
175
- // Responsive Variants
176
- // =============================================================================
177
-
178
- export const VariantADesktop: Story = {
179
- render: () => (
180
- <CardGrid
181
- variant="A"
182
- title="Desktop View"
183
- cards={[
184
- <PlaceholderCard
185
- key="1"
186
- title="Card One"
187
- description="On desktop (lg, 1440px), cards are displayed in a 2-column grid with 12 columns each."
188
- />,
189
- <PlaceholderCard
190
- key="2"
191
- title="Card Two"
192
- description="The layout uses 128px vertical padding and 64px gap between title and cards."
193
- />,
194
- <PlaceholderCard
195
- key="3"
196
- title="Card Three"
197
- description="The layout uses 128px vertical padding and 64px gap between title and cards."
198
- />,
199
- ]}
200
- />
201
- ),
202
- globals: {
203
- viewport: { value: "lg", isRotated: false },
204
- },
205
- };
206
-
207
- export const VariantATablet: Story = {
208
- render: () => (
209
- <CardGrid
210
- variant="A"
211
- title="Tablet View"
212
- cards={[
213
- <PlaceholderCard
214
- key="1"
215
- title="Card One"
216
- description="On tablet (md, 768px), cards are in a 2-column layout with 56px gap from title."
217
- />,
218
- <PlaceholderCard
219
- key="2"
220
- title="Card Two"
221
- description="Cards maintain the 12/12 column split on tablet viewports."
222
- />,
223
- ]}
224
- />
225
- ),
226
- globals: {
227
- viewport: { value: "md", isRotated: false },
228
- },
229
- };
230
-
231
- export const VariantAMobile: Story = {
232
- render: () => (
233
- <CardGrid
234
- variant="A"
235
- title="Mobile View"
236
- cards={[
237
- <PlaceholderCard
238
- key="1"
239
- title="Card One"
240
- description="On mobile (sm, 320px), cards stack in a single column."
241
- />,
242
- <PlaceholderCard
243
- key="2"
244
- title="Card Two"
245
- description="Each card takes full width on mobile devices."
246
- />,
247
- ]}
248
- />
249
- ),
250
- globals: {
251
- viewport: { value: "sm", isRotated: false },
252
- },
253
- };
254
-
255
- // =============================================================================
256
- // Examples
257
- // =============================================================================
258
-
259
- /**
260
- * Two cards in grid
261
- */
262
- export const TwoCards: Story = {
263
- render: () => (
264
- <CardGrid
265
- variant="A"
266
- title="Two Card Layout"
267
- cards={sampleCards.slice(0, 2)}
268
- />
269
- ),
270
- };
271
-
272
- /**
273
- * Four cards in grid (2 rows)
274
- */
275
- export const FourCards: Story = {
276
- render: () => (
277
- <CardGrid variant="A" title="Four Card Layout" cards={sampleCards} />
278
- ),
279
- };
280
-
281
- /**
282
- * Six cards in grid (3 rows)
283
- */
284
- export const SixCards: Story = {
285
- render: () => (
286
- <CardGrid
287
- variant="A"
288
- title="Six Card Layout"
289
- cards={[
290
- ...sampleCards,
291
- <PlaceholderCard
292
- key="5"
293
- title="Fifth Card"
294
- description="Additional card to show multiple rows."
295
- />,
296
- <PlaceholderCard
297
- key="6"
298
- title="Sixth Card"
299
- description="The grid handles any number of cards."
300
- />,
301
- ]}
302
- />
303
- ),
304
- };
305
-
306
- /**
307
- * With actual images
308
- */
309
- export const WithImages: Story = {
310
- render: () => (
311
- <CardGrid
312
- variant="A"
313
- title="Featured Resources"
314
- cards={[
315
- <SampleCard
316
- key="1"
317
- title="Getting Started Guide"
318
- description="Learn the basics and get up and running quickly with our comprehensive guide."
319
- />,
320
- <SampleCard
321
- key="2"
322
- title="Best Practices"
323
- description="Discover proven strategies and techniques to maximize your results."
324
- />,
325
- <SampleCard
326
- key="3"
327
- title="Advanced Topics"
328
- description="Deep dive into advanced features and configurations."
329
- />,
330
- <SampleCard
331
- key="4"
332
- title="Case Studies"
333
- description="See how others have achieved success with real-world examples."
334
- />,
335
- ]}
336
- />
337
- ),
338
- };
339
-
340
- /**
341
- * Odd number of cards
342
- */
343
- export const OddNumberOfCards: Story = {
344
- render: () => (
345
- <CardGrid
346
- variant="A"
347
- title="Three Card Layout"
348
- cards={sampleCards.slice(0, 3)}
349
- />
350
- ),
351
- };
@@ -1,118 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import * as React from "react";
3
- import { cn } from "@/lib/utils";
4
-
5
- /**
6
- * CardGrid component for displaying cards in a responsive grid layout
7
- *
8
- * Variants:
9
- * - A: 3 columns on desktop, 2 on tablet, 1 on mobile
10
- * - B: 2 columns on desktop/tablet, 1 on mobile
11
- *
12
- * Uses the 24-column grid system with grid-container as root.
13
- */
14
- const cardGridVariants = cva(
15
- // Base styles - grid-container for proper grid context
16
- [
17
- "grid-container",
18
- // Small (mobile): 72px y padding
19
- "py-spacing-72",
20
- // Large (desktop): 128px y padding
21
- "lg:py-spacing-128",
22
- ],
23
- {
24
- variants: {
25
- variant: {
26
- A: "",
27
- B: "",
28
- },
29
- },
30
- defaultVariants: {
31
- variant: "A",
32
- },
33
- },
34
- );
35
-
36
- export interface CardGridProps
37
- extends React.HTMLAttributes<HTMLElement>,
38
- VariantProps<typeof cardGridVariants> {
39
- /**
40
- * The title text displayed above the cards
41
- */
42
- title: string;
43
- /**
44
- * The card elements to display in the grid
45
- */
46
- cards: React.ReactNode[];
47
- }
48
-
49
- /**
50
- * CardGrid component for displaying cards in a responsive grid layout.
51
- *
52
- * Uses the 24-column grid system with grid-container as root.
53
- *
54
- * Layout (Variant A):
55
- * - Mobile (sm): Single column, py-72
56
- * - Tablet (md): 2 columns, gap-56 between title and cards, gap-y-20 between cards
57
- * - Desktop (lg+): 3 columns, py-128, gap-64 between title and cards, gap-y-20 between cards
58
- *
59
- * Layout (Variant B):
60
- * - Mobile (sm): Single column, py-72
61
- * - Tablet (md): 2 columns, gap-56 between title and cards, gap-y-20 between cards
62
- * - Desktop (lg+): 2 columns, py-128, gap-64 between title and cards, gap-y-20 between cards
63
- *
64
- * @example
65
- * ```tsx
66
- * <CardGrid
67
- * variant="A"
68
- * title="Featured Cards"
69
- * cards={[
70
- * <Card key="1">...</Card>,
71
- * <Card key="2">...</Card>,
72
- * ]}
73
- * />
74
- * ```
75
- */
76
- const CardGrid = React.forwardRef<HTMLElement, CardGridProps>(
77
- ({ className, variant, title, cards, ...props }, ref) => {
78
- return (
79
- <section
80
- ref={ref}
81
- className={cn(cardGridVariants({ variant }), className)}
82
- {...props}
83
- >
84
- {/* Title - col-full within grid */}
85
- <h2
86
- className={cn(
87
- "col-full",
88
- "typography-headline-small text-gray-900",
89
- // Gap after title: mobile default, md: 56px, lg: 64px
90
- "mb-spacing-36 md:mb-spacing-56 lg:mb-spacing-64",
91
- )}
92
- >
93
- {title}
94
- </h2>
95
-
96
- {/* Inner grid for cards */}
97
- <div
98
- className={cn(
99
- "col-full",
100
- // Mobile: single column
101
- "grid grid-cols-1 gap-spacing-20",
102
- // Tablet: 2 columns
103
- "md:grid-cols-2",
104
- // Desktop: 3 columns for variant A, 2 columns for variant B
105
- variant === "A" && "lg:grid-cols-3",
106
- )}
107
- >
108
- {React.Children.toArray(cards).map((card) => (
109
- <div key={(card as React.ReactElement).key}>{card}</div>
110
- ))}
111
- </div>
112
- </section>
113
- );
114
- },
115
- );
116
- CardGrid.displayName = "CardGrid";
117
-
118
- export { CardGrid, cardGridVariants };
@@ -1 +0,0 @@
1
- export { CardGrid, type CardGridProps, cardGridVariants } from "./card-grid";
@@ -1,77 +0,0 @@
1
- import * as React from "react";
2
- import { cn } from "@/lib/utils";
3
- import { TwoColumnSection } from "../two-column-section";
4
- import type { VariantProps } from "class-variance-authority";
5
- import { twoColumnSectionVariants } from "../two-column-section/two-column-section";
6
-
7
- export interface FaqSectionProps
8
- extends Omit<React.HTMLAttributes<HTMLElement>, "title">,
9
- VariantProps<typeof twoColumnSectionVariants> {
10
- /**
11
- * The title text displayed in the left column
12
- * @default "Frequently Asked Questions"
13
- */
14
- title?: string;
15
- /**
16
- * The FAQ content - typically an Accordion with AccordionItems
17
- */
18
- children: React.ReactNode;
19
- }
20
-
21
- /**
22
- * FaqSection component for displaying FAQ content in a two-column layout.
23
- *
24
- * Wraps TwoColumnSection with FAQ-specific defaults and typography.
25
- *
26
- * Layout:
27
- * - Mobile/Tablet: Stacked (title above content)
28
- * - Desktop (lg+): Title left (~40%), FAQ content right (~60%)
29
- *
30
- * @example
31
- * ```tsx
32
- * <FaqSection>
33
- * <Accordion defaultExpanded="faq-1">
34
- * <AccordionItem id="faq-1" title="What is the US Tech Force?">
35
- * Tech Force will be an elite group of technology specialists...
36
- * </AccordionItem>
37
- * <AccordionItem id="faq-2" title="What skills are required?">
38
- * We're looking for expertise in software engineering...
39
- * </AccordionItem>
40
- * </Accordion>
41
- * </FaqSection>
42
- *
43
- * // With custom title
44
- * <FaqSection title="Common Questions" theme="light">
45
- * ...
46
- * </FaqSection>
47
- * ```
48
- */
49
- const FaqSection = React.forwardRef<HTMLElement, FaqSectionProps>(
50
- (
51
- { className, theme = "dark", title = "Frequently Asked Questions", children, layout, ...props },
52
- ref,
53
- ) => {
54
- return (
55
- <TwoColumnSection
56
- ref={ref}
57
- theme={theme}
58
- layout={layout ?? undefined}
59
- title={title}
60
- className={cn(
61
- // Override title typography to be larger
62
- "[&_h2]:typography-subheading-large",
63
- // Accordion typography overrides
64
- "[&_button]:typography-body-large [&_button]:md:typography-subheading-small",
65
- "[&_[data-accordion-panel]]:typography-body-medium [&_[data-accordion-panel]]:md:typography-body-large",
66
- className,
67
- )}
68
- {...props}
69
- >
70
- {children}
71
- </TwoColumnSection>
72
- );
73
- },
74
- );
75
- FaqSection.displayName = "FaqSection";
76
-
77
- export { FaqSection };
@@ -1,2 +0,0 @@
1
- export { FaqSection } from "./faq-section";
2
- export type { FaqSectionProps } from "./faq-section";