@nationaldesignstudio/react 0.0.17 → 0.1.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.
Files changed (41) hide show
  1. package/dist/component-registry.md +181 -29
  2. package/dist/components/atoms/accordion/accordion.d.ts +2 -2
  3. package/dist/components/atoms/background/background.d.ts +158 -0
  4. package/dist/components/atoms/button/button.d.ts +64 -82
  5. package/dist/components/atoms/button/icon-button.d.ts +128 -66
  6. package/dist/components/organisms/card/card.d.ts +130 -4
  7. package/dist/components/organisms/us-gov-banner/us-gov-banner.d.ts +120 -2
  8. package/dist/components/sections/hero/hero.d.ts +166 -150
  9. package/dist/components/sections/quote-block/quote-block.d.ts +152 -0
  10. package/dist/index.d.ts +6 -2
  11. package/dist/index.js +4068 -6052
  12. package/dist/index.js.map +1 -1
  13. package/dist/lib/utils.d.ts +1 -2
  14. package/dist/tokens.css +207 -16
  15. package/package.json +2 -4
  16. package/src/components/atoms/accordion/accordion.test.tsx +233 -0
  17. package/src/components/atoms/accordion/accordion.tsx +8 -8
  18. package/src/components/atoms/background/background.test.tsx +213 -0
  19. package/src/components/atoms/background/background.tsx +435 -0
  20. package/src/components/atoms/background/index.ts +22 -0
  21. package/src/components/atoms/button/button.stories.tsx +81 -32
  22. package/src/components/atoms/button/button.tsx +101 -49
  23. package/src/components/atoms/button/icon-button.stories.tsx +179 -28
  24. package/src/components/atoms/button/icon-button.test.tsx +254 -0
  25. package/src/components/atoms/button/icon-button.tsx +178 -59
  26. package/src/components/atoms/pager-control/pager-control.tsx +32 -3
  27. package/src/components/dev-tools/dev-toolbar/dev-toolbar.tsx +2 -0
  28. package/src/components/organisms/card/card.tsx +82 -24
  29. package/src/components/organisms/card/index.ts +7 -0
  30. package/src/components/organisms/navbar/navbar.tsx +2 -0
  31. package/src/components/organisms/us-gov-banner/index.ts +5 -1
  32. package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +72 -16
  33. package/src/components/sections/hero/hero.stories.tsx +124 -1
  34. package/src/components/sections/hero/hero.test.tsx +21 -18
  35. package/src/components/sections/hero/hero.tsx +188 -301
  36. package/src/components/sections/hero/index.ts +13 -0
  37. package/src/components/sections/quote-block/index.ts +5 -0
  38. package/src/components/sections/quote-block/quote-block.tsx +216 -0
  39. package/src/index.ts +40 -0
  40. package/src/lib/utils.ts +1 -6
  41. package/src/stories/ThemeProvider.stories.tsx +11 -5
@@ -6,16 +6,14 @@ import * as React from "react";
6
6
  * Button component based on Figma BaseKit / Interface / Buttons
7
7
  *
8
8
  * Variants:
9
- * - primary: Primary filled button using semantic color tokens
10
- * - primaryOutline: Outlined primary button (for light backgrounds)
11
- * - secondary: Secondary button using semantic color tokens
12
- * - charcoal: Dark filled button (for light backgrounds) - legacy
13
- * - charcoalOutline: Dark outlined button (for light backgrounds)
14
- * - charcoalOutlineQuiet: Subtle dark outlined button (for light backgrounds)
15
- * - ivory: Light filled button (for dark backgrounds)
16
- * - ivoryOutline: Light outlined button (for dark backgrounds)
17
- * - ivoryOutlineQuiet: Subtle light outlined button (for dark backgrounds)
18
- * - gray: Gray filled button (for dark backgrounds)
9
+ * - solid: Filled button
10
+ * - outline: Outlined button
11
+ * - ghost: No background/border, just text
12
+ * - subtle: Light background with subtle styling
13
+ *
14
+ * Color Schemes:
15
+ * - dark: Dark colors for use on light backgrounds (default)
16
+ * - light: Light colors for use on dark backgrounds
19
17
  *
20
18
  * Sizes:
21
19
  * - lg: Large buttons
@@ -26,23 +24,19 @@ import * as React from "react";
26
24
  *
27
25
  * Theme Support:
28
26
  * Pass a `theme` prop to override default colors via CSS custom properties.
29
- * Surface tokens (--radius-surface-button, --surface-button-stroke) control
30
- * border radius and stroke width across all variants.
31
27
  */
32
28
  declare const buttonVariants: import('tailwind-variants').TVReturnType<{
33
29
  variant: {
34
- primary: string;
35
- primaryOutline: string;
36
- secondary: string;
37
- charcoal: string;
38
- charcoalOutline: string;
39
- charcoalOutlineQuiet: string;
40
- ivory: string;
41
- ivoryOutline: string;
42
- ivoryOutlineQuiet: string;
43
- gray: string;
30
+ solid: string;
31
+ outline: string;
32
+ ghost: string;
33
+ subtle: string;
44
34
  themed: string;
45
35
  };
36
+ colorScheme: {
37
+ dark: string;
38
+ light: string;
39
+ };
46
40
  size: {
47
41
  lg: string;
48
42
  default: string;
@@ -50,18 +44,16 @@ declare const buttonVariants: import('tailwind-variants').TVReturnType<{
50
44
  };
51
45
  }, undefined, "inline-flex items-center justify-center gap-spacing-8 whitespace-nowrap transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 rounded-surface-button stroke-surface-button border-solid", import('tailwind-variants/dist/config.js').TVConfig<{
52
46
  variant: {
53
- primary: string;
54
- primaryOutline: string;
55
- secondary: string;
56
- charcoal: string;
57
- charcoalOutline: string;
58
- charcoalOutlineQuiet: string;
59
- ivory: string;
60
- ivoryOutline: string;
61
- ivoryOutlineQuiet: string;
62
- gray: string;
47
+ solid: string;
48
+ outline: string;
49
+ ghost: string;
50
+ subtle: string;
63
51
  themed: string;
64
52
  };
53
+ colorScheme: {
54
+ dark: string;
55
+ light: string;
56
+ };
65
57
  size: {
66
58
  lg: string;
67
59
  default: string;
@@ -69,18 +61,16 @@ declare const buttonVariants: import('tailwind-variants').TVReturnType<{
69
61
  };
70
62
  }, {
71
63
  variant: {
72
- primary: string;
73
- primaryOutline: string;
74
- secondary: string;
75
- charcoal: string;
76
- charcoalOutline: string;
77
- charcoalOutlineQuiet: string;
78
- ivory: string;
79
- ivoryOutline: string;
80
- ivoryOutlineQuiet: string;
81
- gray: string;
64
+ solid: string;
65
+ outline: string;
66
+ ghost: string;
67
+ subtle: string;
82
68
  themed: string;
83
69
  };
70
+ colorScheme: {
71
+ dark: string;
72
+ light: string;
73
+ };
84
74
  size: {
85
75
  lg: string;
86
76
  default: string;
@@ -88,18 +78,16 @@ declare const buttonVariants: import('tailwind-variants').TVReturnType<{
88
78
  };
89
79
  }>, {
90
80
  variant: {
91
- primary: string;
92
- primaryOutline: string;
93
- secondary: string;
94
- charcoal: string;
95
- charcoalOutline: string;
96
- charcoalOutlineQuiet: string;
97
- ivory: string;
98
- ivoryOutline: string;
99
- ivoryOutlineQuiet: string;
100
- gray: string;
81
+ solid: string;
82
+ outline: string;
83
+ ghost: string;
84
+ subtle: string;
101
85
  themed: string;
102
86
  };
87
+ colorScheme: {
88
+ dark: string;
89
+ light: string;
90
+ };
103
91
  size: {
104
92
  lg: string;
105
93
  default: string;
@@ -107,18 +95,16 @@ declare const buttonVariants: import('tailwind-variants').TVReturnType<{
107
95
  };
108
96
  }, undefined, import('tailwind-variants').TVReturnType<{
109
97
  variant: {
110
- primary: string;
111
- primaryOutline: string;
112
- secondary: string;
113
- charcoal: string;
114
- charcoalOutline: string;
115
- charcoalOutlineQuiet: string;
116
- ivory: string;
117
- ivoryOutline: string;
118
- ivoryOutlineQuiet: string;
119
- gray: string;
98
+ solid: string;
99
+ outline: string;
100
+ ghost: string;
101
+ subtle: string;
120
102
  themed: string;
121
103
  };
104
+ colorScheme: {
105
+ dark: string;
106
+ light: string;
107
+ };
122
108
  size: {
123
109
  lg: string;
124
110
  default: string;
@@ -126,18 +112,16 @@ declare const buttonVariants: import('tailwind-variants').TVReturnType<{
126
112
  };
127
113
  }, undefined, "inline-flex items-center justify-center gap-spacing-8 whitespace-nowrap transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 rounded-surface-button stroke-surface-button border-solid", import('tailwind-variants/dist/config.js').TVConfig<{
128
114
  variant: {
129
- primary: string;
130
- primaryOutline: string;
131
- secondary: string;
132
- charcoal: string;
133
- charcoalOutline: string;
134
- charcoalOutlineQuiet: string;
135
- ivory: string;
136
- ivoryOutline: string;
137
- ivoryOutlineQuiet: string;
138
- gray: string;
115
+ solid: string;
116
+ outline: string;
117
+ ghost: string;
118
+ subtle: string;
139
119
  themed: string;
140
120
  };
121
+ colorScheme: {
122
+ dark: string;
123
+ light: string;
124
+ };
141
125
  size: {
142
126
  lg: string;
143
127
  default: string;
@@ -145,18 +129,16 @@ declare const buttonVariants: import('tailwind-variants').TVReturnType<{
145
129
  };
146
130
  }, {
147
131
  variant: {
148
- primary: string;
149
- primaryOutline: string;
150
- secondary: string;
151
- charcoal: string;
152
- charcoalOutline: string;
153
- charcoalOutlineQuiet: string;
154
- ivory: string;
155
- ivoryOutline: string;
156
- ivoryOutlineQuiet: string;
157
- gray: string;
132
+ solid: string;
133
+ outline: string;
134
+ ghost: string;
135
+ subtle: string;
158
136
  themed: string;
159
137
  };
138
+ colorScheme: {
139
+ dark: string;
140
+ light: string;
141
+ };
160
142
  size: {
161
143
  lg: string;
162
144
  default: string;
@@ -15,143 +15,205 @@ import * as React from "react";
15
15
  * <IconButton aria-label="Close menu">
16
16
  * <CloseIcon />
17
17
  * </IconButton>
18
- *
19
- * // Correct usage with aria-labelledby
20
- * <IconButton aria-labelledby="close-label">
21
- * <CloseIcon />
22
- * </IconButton>
23
- * <span id="close-label" className="sr-only">Close menu</span>
24
18
  * ```
25
19
  *
26
20
  * Variants:
27
- * - charcoal: Dark filled button (for light backgrounds)
28
- * - charcoalOutline: Dark outlined button (for light backgrounds)
29
- * - charcoalOutlineQuiet: Subtle dark outlined button (for light backgrounds)
30
- * - ghost: No background/border, just icon (for light backgrounds)
31
- * - ghostDark: No background/border, just icon (for dark backgrounds)
32
- * - ivory: Light filled button (for dark backgrounds)
33
- * - ivoryOutline: Light outlined button (for dark backgrounds)
34
- * - ivoryOutlineQuiet: Subtle light outlined button (for dark backgrounds)
21
+ * - solid: Filled button
22
+ * - outline: Outlined button
23
+ * - ghost: No background/border, just icon
24
+ * - subtle: Subtle outlined button
25
+ *
26
+ * Color Schemes:
27
+ * - dark: Dark colors for use on light backgrounds (default)
28
+ * - light: Light colors for use on dark backgrounds
35
29
  *
36
30
  * Sizes:
37
- * - lg: Large (46x46)
38
- * - default: Medium (36x36)
39
- * - sm: Small (29x29)
31
+ * - sm: Small (32x32)
32
+ * - default: Medium (40x40)
33
+ * - lg: Large (48x48)
34
+ *
35
+ * Rounded:
36
+ * - default: Standard border radius
37
+ * - sm: Smaller border radius
38
+ * - full: Fully circular
40
39
  */
41
40
  declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
42
41
  variant: {
43
- charcoal: string;
44
- charcoalOutline: string;
45
- charcoalOutlineQuiet: string;
42
+ solid: string;
43
+ outline: string;
46
44
  ghost: string;
47
- ghostDark: string;
48
- ivory: string;
49
- ivoryOutline: string;
50
- ivoryOutlineQuiet: string;
45
+ subtle: string;
46
+ };
47
+ colorScheme: {
48
+ dark: string;
49
+ light: string;
51
50
  };
52
51
  size: {
52
+ sm: string;
53
+ default: string;
53
54
  lg: string;
55
+ };
56
+ rounded: {
54
57
  default: string;
55
58
  sm: string;
59
+ full: string;
56
60
  };
57
61
  }, undefined, "inline-flex items-center justify-center whitespace-nowrap transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", import('tailwind-variants/dist/config.js').TVConfig<{
58
62
  variant: {
59
- charcoal: string;
60
- charcoalOutline: string;
61
- charcoalOutlineQuiet: string;
63
+ solid: string;
64
+ outline: string;
62
65
  ghost: string;
63
- ghostDark: string;
64
- ivory: string;
65
- ivoryOutline: string;
66
- ivoryOutlineQuiet: string;
66
+ subtle: string;
67
+ };
68
+ colorScheme: {
69
+ dark: string;
70
+ light: string;
67
71
  };
68
72
  size: {
73
+ sm: string;
74
+ default: string;
69
75
  lg: string;
76
+ };
77
+ rounded: {
70
78
  default: string;
71
79
  sm: string;
80
+ full: string;
72
81
  };
73
82
  }, {
74
83
  variant: {
75
- charcoal: string;
76
- charcoalOutline: string;
77
- charcoalOutlineQuiet: string;
84
+ solid: string;
85
+ outline: string;
78
86
  ghost: string;
79
- ghostDark: string;
80
- ivory: string;
81
- ivoryOutline: string;
82
- ivoryOutlineQuiet: string;
87
+ subtle: string;
88
+ };
89
+ colorScheme: {
90
+ dark: string;
91
+ light: string;
83
92
  };
84
93
  size: {
94
+ sm: string;
95
+ default: string;
85
96
  lg: string;
97
+ };
98
+ rounded: {
86
99
  default: string;
87
100
  sm: string;
101
+ full: string;
88
102
  };
89
103
  }>, {
90
104
  variant: {
91
- charcoal: string;
92
- charcoalOutline: string;
93
- charcoalOutlineQuiet: string;
105
+ solid: string;
106
+ outline: string;
94
107
  ghost: string;
95
- ghostDark: string;
96
- ivory: string;
97
- ivoryOutline: string;
98
- ivoryOutlineQuiet: string;
108
+ subtle: string;
109
+ };
110
+ colorScheme: {
111
+ dark: string;
112
+ light: string;
99
113
  };
100
114
  size: {
115
+ sm: string;
116
+ default: string;
101
117
  lg: string;
118
+ };
119
+ rounded: {
102
120
  default: string;
103
121
  sm: string;
122
+ full: string;
104
123
  };
105
124
  }, undefined, import('tailwind-variants').TVReturnType<{
106
125
  variant: {
107
- charcoal: string;
108
- charcoalOutline: string;
109
- charcoalOutlineQuiet: string;
126
+ solid: string;
127
+ outline: string;
110
128
  ghost: string;
111
- ghostDark: string;
112
- ivory: string;
113
- ivoryOutline: string;
114
- ivoryOutlineQuiet: string;
129
+ subtle: string;
130
+ };
131
+ colorScheme: {
132
+ dark: string;
133
+ light: string;
115
134
  };
116
135
  size: {
136
+ sm: string;
137
+ default: string;
117
138
  lg: string;
139
+ };
140
+ rounded: {
118
141
  default: string;
119
142
  sm: string;
143
+ full: string;
120
144
  };
121
145
  }, undefined, "inline-flex items-center justify-center whitespace-nowrap transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", import('tailwind-variants/dist/config.js').TVConfig<{
122
146
  variant: {
123
- charcoal: string;
124
- charcoalOutline: string;
125
- charcoalOutlineQuiet: string;
147
+ solid: string;
148
+ outline: string;
126
149
  ghost: string;
127
- ghostDark: string;
128
- ivory: string;
129
- ivoryOutline: string;
130
- ivoryOutlineQuiet: string;
150
+ subtle: string;
151
+ };
152
+ colorScheme: {
153
+ dark: string;
154
+ light: string;
131
155
  };
132
156
  size: {
157
+ sm: string;
158
+ default: string;
133
159
  lg: string;
160
+ };
161
+ rounded: {
134
162
  default: string;
135
163
  sm: string;
164
+ full: string;
136
165
  };
137
166
  }, {
138
167
  variant: {
139
- charcoal: string;
140
- charcoalOutline: string;
141
- charcoalOutlineQuiet: string;
168
+ solid: string;
169
+ outline: string;
142
170
  ghost: string;
143
- ghostDark: string;
144
- ivory: string;
145
- ivoryOutline: string;
146
- ivoryOutlineQuiet: string;
171
+ subtle: string;
172
+ };
173
+ colorScheme: {
174
+ dark: string;
175
+ light: string;
147
176
  };
148
177
  size: {
178
+ sm: string;
179
+ default: string;
149
180
  lg: string;
181
+ };
182
+ rounded: {
150
183
  default: string;
151
184
  sm: string;
185
+ full: string;
152
186
  };
153
187
  }>, unknown, unknown, undefined>>;
154
188
  export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof iconButtonVariants> {
189
+ /**
190
+ * Custom render prop for element composition.
191
+ * Accepts a React element or render function.
192
+ * @example
193
+ * ```tsx
194
+ * // Render as a link
195
+ * <IconButton render={<a href="/contact" />} aria-label="Contact">
196
+ * <LinkIcon />
197
+ * </IconButton>
198
+ *
199
+ * // Render with custom element
200
+ * <IconButton render={(props) => <Link {...props} to="/home" />} aria-label="Home">
201
+ * <HomeIcon />
202
+ * </IconButton>
203
+ * ```
204
+ */
205
+ render?: React.ReactElement | ((props: React.ButtonHTMLAttributes<HTMLButtonElement>) => React.ReactElement);
206
+ /**
207
+ * @deprecated Use `render` prop instead for element composition.
208
+ * @example
209
+ * ```tsx
210
+ * // Old (deprecated)
211
+ * <IconButton asChild><a href="/link">...</a></IconButton>
212
+ *
213
+ * // New (recommended)
214
+ * <IconButton render={<a href="/link" />}>...</IconButton>
215
+ * ```
216
+ */
155
217
  asChild?: boolean;
156
218
  }
157
219
  declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;