@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.
- package/dist/component-registry.md +181 -29
- package/dist/components/atoms/accordion/accordion.d.ts +2 -2
- package/dist/components/atoms/background/background.d.ts +158 -0
- package/dist/components/atoms/button/button.d.ts +64 -82
- package/dist/components/atoms/button/icon-button.d.ts +128 -66
- package/dist/components/organisms/card/card.d.ts +130 -4
- package/dist/components/organisms/us-gov-banner/us-gov-banner.d.ts +120 -2
- package/dist/components/sections/hero/hero.d.ts +166 -150
- package/dist/components/sections/quote-block/quote-block.d.ts +152 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +4068 -6052
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts +1 -2
- package/dist/tokens.css +207 -16
- package/package.json +2 -4
- package/src/components/atoms/accordion/accordion.test.tsx +233 -0
- package/src/components/atoms/accordion/accordion.tsx +8 -8
- package/src/components/atoms/background/background.test.tsx +213 -0
- package/src/components/atoms/background/background.tsx +435 -0
- package/src/components/atoms/background/index.ts +22 -0
- package/src/components/atoms/button/button.stories.tsx +81 -32
- package/src/components/atoms/button/button.tsx +101 -49
- package/src/components/atoms/button/icon-button.stories.tsx +179 -28
- package/src/components/atoms/button/icon-button.test.tsx +254 -0
- package/src/components/atoms/button/icon-button.tsx +178 -59
- package/src/components/atoms/pager-control/pager-control.tsx +32 -3
- package/src/components/dev-tools/dev-toolbar/dev-toolbar.tsx +2 -0
- package/src/components/organisms/card/card.tsx +82 -24
- package/src/components/organisms/card/index.ts +7 -0
- package/src/components/organisms/navbar/navbar.tsx +2 -0
- package/src/components/organisms/us-gov-banner/index.ts +5 -1
- package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +72 -16
- package/src/components/sections/hero/hero.stories.tsx +124 -1
- package/src/components/sections/hero/hero.test.tsx +21 -18
- package/src/components/sections/hero/hero.tsx +188 -301
- package/src/components/sections/hero/index.ts +13 -0
- package/src/components/sections/quote-block/index.ts +5 -0
- package/src/components/sections/quote-block/quote-block.tsx +216 -0
- package/src/index.ts +40 -0
- package/src/lib/utils.ts +1 -6
- 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
|
-
* -
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
* -
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
30
|
-
* -
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* -
|
|
34
|
-
* -
|
|
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
|
-
* -
|
|
38
|
-
* - default: Medium (
|
|
39
|
-
* -
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
charcoalOutlineQuiet: string;
|
|
42
|
+
solid: string;
|
|
43
|
+
outline: string;
|
|
46
44
|
ghost: string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
charcoalOutlineQuiet: string;
|
|
63
|
+
solid: string;
|
|
64
|
+
outline: string;
|
|
62
65
|
ghost: string;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
charcoalOutlineQuiet: string;
|
|
84
|
+
solid: string;
|
|
85
|
+
outline: string;
|
|
78
86
|
ghost: string;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
charcoalOutlineQuiet: string;
|
|
105
|
+
solid: string;
|
|
106
|
+
outline: string;
|
|
94
107
|
ghost: string;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
charcoalOutlineQuiet: string;
|
|
126
|
+
solid: string;
|
|
127
|
+
outline: string;
|
|
110
128
|
ghost: string;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
charcoalOutlineQuiet: string;
|
|
147
|
+
solid: string;
|
|
148
|
+
outline: string;
|
|
126
149
|
ghost: string;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
charcoalOutlineQuiet: string;
|
|
168
|
+
solid: string;
|
|
169
|
+
outline: string;
|
|
142
170
|
ghost: string;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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>>;
|