@nationaldesignstudio/react 0.0.19 → 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/components/atoms/accordion/accordion.d.ts +2 -2
- package/dist/components/atoms/background/background.d.ts +23 -0
- package/dist/components/atoms/button/icon-button.d.ts +44 -16
- package/dist/index.js +2140 -2014
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- 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 +85 -27
- package/src/components/atoms/button/button.tsx +10 -0
- package/src/components/atoms/button/icon-button.test.tsx +254 -0
- package/src/components/atoms/button/icon-button.tsx +79 -22
- 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/navbar/navbar.tsx +2 -0
- package/src/stories/ThemeProvider.stories.tsx +9 -3
|
@@ -53,8 +53,8 @@ export interface AccordionProps extends React.HTMLAttributes<HTMLDivElement>, Va
|
|
|
53
53
|
* Built on Base UI's Accordion primitive.
|
|
54
54
|
*
|
|
55
55
|
* Variants:
|
|
56
|
-
* -
|
|
57
|
-
* -
|
|
56
|
+
* - light: Light theme styling (default)
|
|
57
|
+
* - dark: Dark theme styling
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* ```tsx
|
|
@@ -25,10 +25,24 @@ export interface BackgroundImageProps extends Omit<React.ImgHTMLAttributes<HTMLI
|
|
|
25
25
|
* Object position (default: "center")
|
|
26
26
|
*/
|
|
27
27
|
position?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Custom render prop for element composition.
|
|
30
|
+
* Accepts a React element or render function.
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* // Element pattern
|
|
34
|
+
* <BackgroundImage render={<img className="custom" />} src="/bg.jpg" />
|
|
35
|
+
*
|
|
36
|
+
* // Callback pattern
|
|
37
|
+
* <BackgroundImage render={(props) => <img {...props} />} src="/bg.jpg" />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
render?: React.ReactElement | ((props: React.ImgHTMLAttributes<HTMLImageElement>) => React.ReactElement);
|
|
28
41
|
}
|
|
29
42
|
/**
|
|
30
43
|
* Background image layer using an actual img element with object-cover.
|
|
31
44
|
* Supports native lazy loading, srcset, and better accessibility.
|
|
45
|
+
* Supports render prop for element composition.
|
|
32
46
|
*/
|
|
33
47
|
declare const BackgroundImage: React.ForwardRefExoticComponent<BackgroundImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
34
48
|
declare const backgroundVideoVariants: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "absolute inset-0 size-full object-cover", import('tailwind-variants/dist/config.js').TVConfig<unknown, {} | {}>, {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "absolute inset-0 size-full object-cover", import('tailwind-variants/dist/config.js').TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
|
|
@@ -45,9 +59,18 @@ export interface BackgroundVideoProps extends Omit<React.VideoHTMLAttributes<HTM
|
|
|
45
59
|
* Poster image URL shown before video loads
|
|
46
60
|
*/
|
|
47
61
|
poster?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Custom render prop for element composition.
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <BackgroundVideo render={<video className="custom" />} src="/bg.mp4" />
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
render?: React.ReactElement | ((props: React.VideoHTMLAttributes<HTMLVideoElement>) => React.ReactElement);
|
|
48
70
|
}
|
|
49
71
|
/**
|
|
50
72
|
* Background video layer using HTML5 video element.
|
|
73
|
+
* Supports render prop for element composition.
|
|
51
74
|
*/
|
|
52
75
|
declare const BackgroundVideo: React.ForwardRefExoticComponent<BackgroundVideoProps & React.RefAttributes<HTMLVideoElement>>;
|
|
53
76
|
declare const backgroundStreamVariants: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "absolute inset-0 size-full border-0 scale-[1.5] object-cover", import('tailwind-variants/dist/config.js').TVConfig<unknown, {} | {}>, {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "absolute inset-0 size-full border-0 scale-[1.5] object-cover", import('tailwind-variants/dist/config.js').TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
|
|
@@ -28,9 +28,9 @@ import * as React from "react";
|
|
|
28
28
|
* - light: Light colors for use on dark backgrounds
|
|
29
29
|
*
|
|
30
30
|
* Sizes:
|
|
31
|
-
* - lg: Large (48x48)
|
|
32
|
-
* - default: Medium (40x40)
|
|
33
31
|
* - sm: Small (32x32)
|
|
32
|
+
* - default: Medium (40x40)
|
|
33
|
+
* - lg: Large (48x48)
|
|
34
34
|
*
|
|
35
35
|
* Rounded:
|
|
36
36
|
* - default: Standard border radius
|
|
@@ -49,9 +49,9 @@ declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
|
|
|
49
49
|
light: string;
|
|
50
50
|
};
|
|
51
51
|
size: {
|
|
52
|
-
lg: string;
|
|
53
|
-
default: string;
|
|
54
52
|
sm: string;
|
|
53
|
+
default: string;
|
|
54
|
+
lg: string;
|
|
55
55
|
};
|
|
56
56
|
rounded: {
|
|
57
57
|
default: string;
|
|
@@ -70,9 +70,9 @@ declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
|
|
|
70
70
|
light: string;
|
|
71
71
|
};
|
|
72
72
|
size: {
|
|
73
|
-
lg: string;
|
|
74
|
-
default: string;
|
|
75
73
|
sm: string;
|
|
74
|
+
default: string;
|
|
75
|
+
lg: string;
|
|
76
76
|
};
|
|
77
77
|
rounded: {
|
|
78
78
|
default: string;
|
|
@@ -91,9 +91,9 @@ declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
|
|
|
91
91
|
light: string;
|
|
92
92
|
};
|
|
93
93
|
size: {
|
|
94
|
-
lg: string;
|
|
95
|
-
default: string;
|
|
96
94
|
sm: string;
|
|
95
|
+
default: string;
|
|
96
|
+
lg: string;
|
|
97
97
|
};
|
|
98
98
|
rounded: {
|
|
99
99
|
default: string;
|
|
@@ -112,9 +112,9 @@ declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
|
|
|
112
112
|
light: string;
|
|
113
113
|
};
|
|
114
114
|
size: {
|
|
115
|
-
lg: string;
|
|
116
|
-
default: string;
|
|
117
115
|
sm: string;
|
|
116
|
+
default: string;
|
|
117
|
+
lg: string;
|
|
118
118
|
};
|
|
119
119
|
rounded: {
|
|
120
120
|
default: string;
|
|
@@ -133,9 +133,9 @@ declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
|
|
|
133
133
|
light: string;
|
|
134
134
|
};
|
|
135
135
|
size: {
|
|
136
|
-
lg: string;
|
|
137
|
-
default: string;
|
|
138
136
|
sm: string;
|
|
137
|
+
default: string;
|
|
138
|
+
lg: string;
|
|
139
139
|
};
|
|
140
140
|
rounded: {
|
|
141
141
|
default: string;
|
|
@@ -154,9 +154,9 @@ declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
|
|
|
154
154
|
light: string;
|
|
155
155
|
};
|
|
156
156
|
size: {
|
|
157
|
-
lg: string;
|
|
158
|
-
default: string;
|
|
159
157
|
sm: string;
|
|
158
|
+
default: string;
|
|
159
|
+
lg: string;
|
|
160
160
|
};
|
|
161
161
|
rounded: {
|
|
162
162
|
default: string;
|
|
@@ -175,9 +175,9 @@ declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
|
|
|
175
175
|
light: string;
|
|
176
176
|
};
|
|
177
177
|
size: {
|
|
178
|
-
lg: string;
|
|
179
|
-
default: string;
|
|
180
178
|
sm: string;
|
|
179
|
+
default: string;
|
|
180
|
+
lg: string;
|
|
181
181
|
};
|
|
182
182
|
rounded: {
|
|
183
183
|
default: string;
|
|
@@ -186,6 +186,34 @@ declare const iconButtonVariants: import('tailwind-variants').TVReturnType<{
|
|
|
186
186
|
};
|
|
187
187
|
}>, unknown, unknown, undefined>>;
|
|
188
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
|
+
*/
|
|
189
217
|
asChild?: boolean;
|
|
190
218
|
}
|
|
191
219
|
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|