@nationaldesignstudio/react 0.0.16 → 0.0.19

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 (33) hide show
  1. package/dist/component-registry.md +181 -29
  2. package/dist/components/atoms/background/background.d.ts +135 -0
  3. package/dist/components/atoms/button/button.d.ts +64 -82
  4. package/dist/components/atoms/button/icon-button.d.ts +100 -66
  5. package/dist/components/organisms/card/card.d.ts +130 -4
  6. package/dist/components/organisms/us-gov-banner/us-gov-banner.d.ts +120 -2
  7. package/dist/components/sections/hero/hero.d.ts +166 -150
  8. package/dist/components/sections/quote-block/quote-block.d.ts +152 -0
  9. package/dist/index.d.ts +6 -2
  10. package/dist/index.js +3868 -5978
  11. package/dist/index.js.map +1 -1
  12. package/dist/lib/utils.d.ts +1 -2
  13. package/dist/tokens.css +336 -145
  14. package/package.json +2 -4
  15. package/src/components/atoms/background/background.tsx +377 -0
  16. package/src/components/atoms/background/index.ts +22 -0
  17. package/src/components/atoms/button/button.stories.tsx +81 -32
  18. package/src/components/atoms/button/button.tsx +91 -49
  19. package/src/components/atoms/button/icon-button.stories.tsx +179 -28
  20. package/src/components/atoms/button/icon-button.tsx +111 -49
  21. package/src/components/organisms/card/card.tsx +82 -24
  22. package/src/components/organisms/card/index.ts +7 -0
  23. package/src/components/organisms/us-gov-banner/index.ts +5 -1
  24. package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +72 -16
  25. package/src/components/sections/hero/hero.stories.tsx +124 -1
  26. package/src/components/sections/hero/hero.test.tsx +21 -18
  27. package/src/components/sections/hero/hero.tsx +188 -301
  28. package/src/components/sections/hero/index.ts +13 -0
  29. package/src/components/sections/quote-block/index.ts +5 -0
  30. package/src/components/sections/quote-block/quote-block.tsx +216 -0
  31. package/src/index.ts +40 -0
  32. package/src/lib/utils.ts +1 -6
  33. package/src/stories/ThemeProvider.stories.tsx +5 -5
@@ -1,165 +1,171 @@
1
1
  import { VariantProps } from 'tailwind-variants';
2
2
  import { ComponentTheme } from '../../../lib/theme';
3
3
  import * as React from "react";
4
+ export { Background as HeroBackground, BackgroundGradient as HeroGradient, type BackgroundGradientProps as HeroGradientProps, BackgroundImage as HeroBackgroundImage, type BackgroundImageProps as HeroBackgroundImageProps, BackgroundOverlay as HeroOverlay, type BackgroundOverlayProps as HeroOverlayProps, BackgroundStream as HeroBackgroundStream, type BackgroundStreamProps as HeroBackgroundStreamProps, BackgroundVideo as HeroBackgroundVideo, type BackgroundVideoProps as HeroBackgroundVideoProps, } from '../../atoms/background';
4
5
  /**
5
6
  * Hero variants based on Figma BaseKit / Heros
6
7
  *
8
+ * Slots:
9
+ * - root: The outer container
10
+ * - top: Full-width slot at top for banners/nav (no padding)
11
+ * - content: Padded content area with alignment
12
+ *
7
13
  * Variants:
8
14
  * - A1: Content aligned at bottom (default)
9
15
  * - A2: Content aligned at top
10
- * - A3: Content aligned at center
11
- *
12
- * Each variant is responsive across breakpoints:
13
- * - sm (Mobile): 500px height, 20px padding
14
- * - md (Tablet): 650px height, 56px padding
15
- * - lg (Desktop): 700-850px height, 64-72px padding
16
+ * - A3: Content centered
16
17
  */
17
18
  declare const heroVariants: import('tailwind-variants').TVReturnType<{
18
19
  variant: {
19
- A1: string[];
20
- A2: string[];
21
- A3: string[];
20
+ A1: {
21
+ root: string;
22
+ content: string[];
23
+ };
24
+ A2: {
25
+ root: string;
26
+ content: string[];
27
+ };
28
+ A3: {
29
+ root: string;
30
+ content: string[];
31
+ };
22
32
  };
23
- }, undefined, string[], import('tailwind-variants/dist/config.js').TVConfig<{
33
+ }, {
34
+ root: string;
35
+ top: string;
36
+ content: string[];
37
+ }, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
24
38
  variant: {
25
- A1: string[];
26
- A2: string[];
27
- A3: string[];
39
+ A1: {
40
+ root: string;
41
+ content: string[];
42
+ };
43
+ A2: {
44
+ root: string;
45
+ content: string[];
46
+ };
47
+ A3: {
48
+ root: string;
49
+ content: string[];
50
+ };
28
51
  };
29
52
  }, {
30
53
  variant: {
31
- A1: string[];
32
- A2: string[];
33
- A3: string[];
54
+ A1: {
55
+ root: string;
56
+ content: string[];
57
+ };
58
+ A2: {
59
+ root: string;
60
+ content: string[];
61
+ };
62
+ A3: {
63
+ root: string;
64
+ content: string[];
65
+ };
34
66
  };
35
67
  }>, {
36
68
  variant: {
37
- A1: string[];
38
- A2: string[];
39
- A3: string[];
69
+ A1: {
70
+ root: string;
71
+ content: string[];
72
+ };
73
+ A2: {
74
+ root: string;
75
+ content: string[];
76
+ };
77
+ A3: {
78
+ root: string;
79
+ content: string[];
80
+ };
40
81
  };
41
- }, undefined, import('tailwind-variants').TVReturnType<{
82
+ }, {
83
+ root: string;
84
+ top: string;
85
+ content: string[];
86
+ }, import('tailwind-variants').TVReturnType<{
42
87
  variant: {
43
- A1: string[];
44
- A2: string[];
45
- A3: string[];
88
+ A1: {
89
+ root: string;
90
+ content: string[];
91
+ };
92
+ A2: {
93
+ root: string;
94
+ content: string[];
95
+ };
96
+ A3: {
97
+ root: string;
98
+ content: string[];
99
+ };
46
100
  };
47
- }, undefined, string[], import('tailwind-variants/dist/config.js').TVConfig<{
101
+ }, {
102
+ root: string;
103
+ top: string;
104
+ content: string[];
105
+ }, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
48
106
  variant: {
49
- A1: string[];
50
- A2: string[];
51
- A3: string[];
107
+ A1: {
108
+ root: string;
109
+ content: string[];
110
+ };
111
+ A2: {
112
+ root: string;
113
+ content: string[];
114
+ };
115
+ A3: {
116
+ root: string;
117
+ content: string[];
118
+ };
52
119
  };
53
120
  }, {
54
121
  variant: {
55
- A1: string[];
56
- A2: string[];
57
- A3: string[];
122
+ A1: {
123
+ root: string;
124
+ content: string[];
125
+ };
126
+ A2: {
127
+ root: string;
128
+ content: string[];
129
+ };
130
+ A3: {
131
+ root: string;
132
+ content: string[];
133
+ };
58
134
  };
59
135
  }>, unknown, unknown, undefined>>;
60
- export interface HeroBackgroundImageProps extends React.HTMLAttributes<HTMLDivElement> {
61
- /**
62
- * URL for the background image
63
- */
64
- src: string;
65
- /**
66
- * CSS background-position value (default: "center")
67
- */
68
- position?: string;
69
- /**
70
- * Alt text for accessibility (used in aria-label)
71
- */
72
- alt?: string;
73
- }
74
- export interface HeroBackgroundVideoProps extends Omit<React.VideoHTMLAttributes<HTMLVideoElement>, "children"> {
75
- /**
76
- * URL for the video source
77
- */
78
- src: string;
79
- /**
80
- * Video MIME type (default: auto-detected from src)
81
- */
82
- type?: string;
83
- /**
84
- * Poster image URL shown before video loads
85
- */
86
- poster?: string;
136
+ declare const heroHeaderVariants: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "relative z-10 w-full", import('tailwind-variants/dist/config.js').TVConfig<unknown, {} | {}>, {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "relative z-10 w-full", import('tailwind-variants/dist/config.js').TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
137
+ declare const heroContentVariants: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], import('tailwind-variants/dist/config.js').TVConfig<unknown, {} | {}>, {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], import('tailwind-variants/dist/config.js').TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
138
+ export interface HeroHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
87
139
  }
88
- export interface HeroBackgroundStreamProps extends React.IframeHTMLAttributes<HTMLIFrameElement> {
89
- /**
90
- * Cloudflare Stream video ID
91
- */
92
- videoId: string;
93
- /**
94
- * Poster image URL (Cloudflare Stream thumbnail or custom)
95
- */
96
- poster?: string;
97
- /**
98
- * Whether the video should autoplay (default: true)
99
- */
100
- autoplay?: boolean;
101
- /**
102
- * Whether the video should loop (default: true)
103
- */
104
- loop?: boolean;
105
- /**
106
- * Whether the video should be muted (default: true)
107
- */
108
- muted?: boolean;
109
- /**
110
- * Whether to show playback controls (default: false)
111
- */
112
- controls?: boolean;
113
- /**
114
- * Custom Cloudflare customer subdomain (if using custom domains)
115
- */
116
- customerSubdomain?: string;
140
+ /**
141
+ * Header slot for Hero - used for navigation, gov banners, etc.
142
+ * Full-width with no padding, sits at the top of the hero.
143
+ */
144
+ declare const HeroHeader: React.ForwardRefExoticComponent<HeroHeaderProps & React.RefAttributes<HTMLDivElement>>;
145
+ export interface HeroContentProps extends React.HTMLAttributes<HTMLDivElement> {
117
146
  }
118
147
  /**
119
- * Compound component for Hero backgrounds
120
- *
121
- * Provides sub-components for different background types:
122
- * - `HeroBackground.Image` - Static image backgrounds
123
- * - `HeroBackground.Video` - HTML5 video backgrounds
124
- * - `HeroBackground.Stream` - Cloudflare Stream video backgrounds
125
- *
126
- * @example
127
- * ```tsx
128
- * // Image background
129
- * <Hero
130
- * title="Welcome"
131
- * background={<HeroBackground.Image src="/hero.jpg" />}
132
- * />
133
- *
134
- * // Video background
135
- * <Hero
136
- * title="Welcome"
137
- * background={<HeroBackground.Video src="/hero.mp4" />}
138
- * />
139
- *
140
- * // Cloudflare Stream background
141
- * <Hero
142
- * title="Welcome"
143
- * background={<HeroBackground.Stream videoId="abc123" />}
144
- * />
145
- * ```
148
+ * Content container for Hero - use for main content.
149
+ * Has padding and sits above backgrounds with z-10.
146
150
  */
147
- declare const HeroBackground: {
148
- Image: React.ForwardRefExoticComponent<HeroBackgroundImageProps & React.RefAttributes<HTMLDivElement>>;
149
- Video: React.ForwardRefExoticComponent<HeroBackgroundVideoProps & React.RefAttributes<HTMLVideoElement>>;
150
- Stream: React.ForwardRefExoticComponent<HeroBackgroundStreamProps & React.RefAttributes<HTMLIFrameElement>>;
151
- };
152
- export interface HeroProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof heroVariants> {
151
+ declare const HeroContent: React.ForwardRefExoticComponent<HeroContentProps & React.RefAttributes<HTMLDivElement>>;
152
+ export interface HeroProps extends Omit<React.HTMLAttributes<HTMLElement>, "title">, VariantProps<typeof heroVariants> {
153
153
  /**
154
- * The title text displayed in the hero
154
+ * The title text displayed in the hero.
155
+ * If provided, renders an h1 with default typography.
156
+ * Omit to use children for custom content composition.
155
157
  */
156
- title: string;
158
+ title?: string;
157
159
  /**
158
160
  * Custom typography class for the title using primitive tokens.
159
- * Use primitive typography classes like "text-128 leading-128 tracking-128"
160
- * Default: "text-64 leading-64 tracking-64 md:text-128 md:leading-128 md:tracking-128 xl:text-192 xl:leading-192 xl:tracking-192"
161
+ * Default: "text-64 leading-64 tracking-64 md:text-128 md:leading-128 md:tracking-128 lg:text-192 lg:leading-192 lg:tracking-192"
161
162
  */
162
163
  titleClassName?: string;
164
+ /**
165
+ * Content for the top slot (full-width, no padding).
166
+ * Use for USGovBanner, Navigation, etc.
167
+ */
168
+ top?: React.ReactNode;
163
169
  /**
164
170
  * Background for the hero. Can be:
165
171
  * - A color string (hex, rgb, etc.) for solid backgrounds
@@ -175,50 +181,60 @@ export interface HeroProps extends React.HTMLAttributes<HTMLElement>, VariantPro
175
181
  * Color of the overlay (default: "black")
176
182
  */
177
183
  overlayColor?: string;
184
+ /**
185
+ * Border radius for the hero container
186
+ * Useful for designs with rounded bottom corners
187
+ */
188
+ borderRadius?: string;
178
189
  /**
179
190
  * Theme overrides for component styling via CSS custom properties
180
191
  */
181
192
  theme?: ComponentTheme;
182
193
  }
194
+ /**
195
+ * Default responsive typography for hero title using primitive tokens
196
+ * Mobile: 64px, Tablet: 128px, Desktop: 192px
197
+ */
198
+ declare const DEFAULT_TITLE_TYPOGRAPHY = "text-64 leading-64 tracking-64 md:text-128 md:leading-128 md:tracking-128 lg:text-192 lg:leading-192 lg:tracking-192 font-medium";
183
199
  /**
184
200
  * Hero component for page headers with large display typography.
185
201
  *
186
- * Features responsive sizing across three variants:
202
+ * Slots:
203
+ * - `top`: Full-width slot at top for USGovBanner, Navigation (no padding)
204
+ * - `children`: Main content slot with padding and alignment
205
+ *
206
+ * The `title` prop is a convenience for simple heroes - it renders an h1 with
207
+ * responsive typography. Children are always rendered, so you can use both
208
+ * or just children for full control.
209
+ *
210
+ * Variants:
187
211
  * - A1: Content at bottom (default)
188
212
  * - A2: Content at top
189
213
  * - A3: Content centered
190
214
  *
191
- * Each variant responds to breakpoints:
192
- * - Mobile: 500px height, 20px padding, 64px typography
193
- * - Tablet (768px+): 650px height, 56px padding, 128-148px typography
194
- * - Desktop (1440px+): 700-800px height, 64-72px padding, 148-192px typography
195
- *
196
215
  * @example
197
216
  * ```tsx
198
- * // Simple hero with solid color
199
- * <Hero title="Welcome" variant="A1" background="#1a1a1a" />
217
+ * // Simple - just title and background
218
+ * <Hero title="Welcome" background="#1a1a1a" />
200
219
  *
201
- * // With background image
220
+ * // With top slot for banner/nav
202
221
  * <Hero
203
- * title="Welcome"
204
222
  * variant="A1"
205
223
  * background={<HeroBackground.Image src="/hero.jpg" />}
206
- * overlayOpacity={0.4}
207
- * />
208
- *
209
- * // With Cloudflare Stream video
210
- * <Hero
211
- * title="Welcome"
212
- * variant="A1"
213
- * background={<HeroBackground.Stream videoId="abc123" />}
214
- * overlayOpacity={0.3}
215
- * />
224
+ * top={
225
+ * <>
226
+ * <USGovBanner variant="inverted" />
227
+ * <Navigation />
228
+ * </>
229
+ * }
230
+ * >
231
+ * <h1>Board of Peace</h1>
232
+ * <p>Subtitle goes here</p>
233
+ * </Hero>
216
234
  * ```
217
235
  */
218
- /**
219
- * Default responsive typography for hero title using primitive tokens
220
- * Mobile: 64px, Tablet: 128px, Desktop: 192px
221
- */
222
- declare const DEFAULT_TITLE_TYPOGRAPHY = "text-64 leading-64 tracking-64 md:text-128 md:leading-128 md:tracking-128 xl:text-192 xl:leading-192 xl:tracking-192 font-medium";
223
- declare const Hero: React.ForwardRefExoticComponent<HeroProps & React.RefAttributes<HTMLElement>>;
224
- export { Hero, HeroBackground, heroVariants, DEFAULT_TITLE_TYPOGRAPHY };
236
+ declare const Hero: React.ForwardRefExoticComponent<HeroProps & React.RefAttributes<HTMLElement>> & {
237
+ Header: typeof HeroHeader;
238
+ Content: typeof HeroContent;
239
+ };
240
+ export { Hero, heroVariants, heroContentVariants, heroHeaderVariants, DEFAULT_TITLE_TYPOGRAPHY, HeroHeader, HeroContent, };
@@ -0,0 +1,152 @@
1
+ import { VariantProps } from 'tailwind-variants';
2
+ import * as React from "react";
3
+ declare const quoteBlockVariants: import('tailwind-variants').TVReturnType<{
4
+ size: {
5
+ default: {
6
+ root: string;
7
+ };
8
+ compact: {
9
+ root: string;
10
+ };
11
+ };
12
+ }, {
13
+ root: string;
14
+ content: string[];
15
+ quoteWrapper: string;
16
+ quote: string[];
17
+ openQuote: string[];
18
+ attribution: string;
19
+ signature: string;
20
+ byline: string;
21
+ bylineName: string;
22
+ bylineTitle: string;
23
+ }, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
24
+ size: {
25
+ default: {
26
+ root: string;
27
+ };
28
+ compact: {
29
+ root: string;
30
+ };
31
+ };
32
+ }, {
33
+ size: {
34
+ default: {
35
+ root: string;
36
+ };
37
+ compact: {
38
+ root: string;
39
+ };
40
+ };
41
+ }>, {
42
+ size: {
43
+ default: {
44
+ root: string;
45
+ };
46
+ compact: {
47
+ root: string;
48
+ };
49
+ };
50
+ }, {
51
+ root: string;
52
+ content: string[];
53
+ quoteWrapper: string;
54
+ quote: string[];
55
+ openQuote: string[];
56
+ attribution: string;
57
+ signature: string;
58
+ byline: string;
59
+ bylineName: string;
60
+ bylineTitle: string;
61
+ }, import('tailwind-variants').TVReturnType<{
62
+ size: {
63
+ default: {
64
+ root: string;
65
+ };
66
+ compact: {
67
+ root: string;
68
+ };
69
+ };
70
+ }, {
71
+ root: string;
72
+ content: string[];
73
+ quoteWrapper: string;
74
+ quote: string[];
75
+ openQuote: string[];
76
+ attribution: string;
77
+ signature: string;
78
+ byline: string;
79
+ bylineName: string;
80
+ bylineTitle: string;
81
+ }, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
82
+ size: {
83
+ default: {
84
+ root: string;
85
+ };
86
+ compact: {
87
+ root: string;
88
+ };
89
+ };
90
+ }, {
91
+ size: {
92
+ default: {
93
+ root: string;
94
+ };
95
+ compact: {
96
+ root: string;
97
+ };
98
+ };
99
+ }>, unknown, unknown, undefined>>;
100
+ export interface QuoteBlockProps extends Omit<React.HTMLAttributes<HTMLElement>, "children">, VariantProps<typeof quoteBlockVariants> {
101
+ /**
102
+ * The quote text to display
103
+ */
104
+ quote: string;
105
+ /**
106
+ * Whether to show decorative quote marks
107
+ * @default true
108
+ */
109
+ showQuoteMarks?: boolean;
110
+ /**
111
+ * Signature image URL (optional)
112
+ */
113
+ signatureImage?: string;
114
+ /**
115
+ * Alt text for signature image
116
+ */
117
+ signatureAlt?: string;
118
+ /**
119
+ * Attribution name (e.g., "Donald J. Trump")
120
+ */
121
+ attributionName?: string;
122
+ /**
123
+ * Attribution title (e.g., "45 & 47 President of the United States")
124
+ */
125
+ attributionTitle?: string;
126
+ /**
127
+ * Background element - use BackgroundImage or similar
128
+ */
129
+ background?: React.ReactNode;
130
+ /**
131
+ * Overlay opacity (0-1)
132
+ */
133
+ overlayOpacity?: number;
134
+ /**
135
+ * Overlay color
136
+ */
137
+ overlayColor?: string;
138
+ /**
139
+ * Custom class for the quote text
140
+ */
141
+ quoteClassName?: string;
142
+ /**
143
+ * Custom class for the byline name
144
+ */
145
+ bylineNameClassName?: string;
146
+ /**
147
+ * Custom class for the byline title
148
+ */
149
+ bylineTitleClassName?: string;
150
+ }
151
+ declare const QuoteBlock: React.ForwardRefExoticComponent<QuoteBlockProps & React.RefAttributes<HTMLElement>>;
152
+ export { QuoteBlock, quoteBlockVariants };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export type { AccordionItemProps, AccordionProps, } from './components/atoms/accordion';
2
2
  export { Accordion, AccordionItem } from './components/atoms/accordion';
3
+ export type { BackgroundGradientProps, BackgroundImageProps, BackgroundOverlayProps, BackgroundProps, BackgroundStreamProps, BackgroundVideoProps, } from './components/atoms/background';
4
+ export { Background, BackgroundGradient, BackgroundImage, BackgroundOverlay, BackgroundStream, BackgroundVideo, backgroundGradientVariants, backgroundImageVariants, backgroundOverlayVariants, backgroundStreamVariants, backgroundVariants, backgroundVideoVariants, } from './components/atoms/background';
3
5
  export type { ButtonProps, IconButtonProps } from './components/atoms/button';
4
6
  export { Button, buttonVariants, IconButton, iconButtonVariants, } from './components/atoms/button';
5
7
  export type { NdstudioFooterProps } from './components/atoms/ndstudio-footer';
@@ -20,10 +22,12 @@ export type { CardGridProps } from './components/sections/card-grid';
20
22
  export { CardGrid, cardGridVariants } from './components/sections/card-grid';
21
23
  export type { FaqSectionProps } from './components/sections/faq-section';
22
24
  export { FaqSection } from './components/sections/faq-section';
23
- export type { HeroBackgroundImageProps, HeroBackgroundStreamProps, HeroBackgroundVideoProps, HeroProps, } from './components/sections/hero';
24
- export { DEFAULT_TITLE_TYPOGRAPHY, Hero, HeroBackground, heroVariants, } from './components/sections/hero';
25
+ export type { HeroBackgroundImageProps, HeroBackgroundStreamProps, HeroBackgroundVideoProps, HeroContentProps, HeroGradientProps, HeroHeaderProps, HeroOverlayProps, HeroProps, } from './components/sections/hero';
26
+ export { DEFAULT_TITLE_TYPOGRAPHY, Hero, HeroBackground, HeroBackgroundImage, HeroBackgroundStream, HeroBackgroundVideo, HeroContent, HeroGradient, HeroHeader, HeroOverlay, heroContentVariants, heroHeaderVariants, heroVariants, } from './components/sections/hero';
25
27
  export type { ProseProps, ProseSectionProps, } from './components/sections/prose';
26
28
  export { Prose, ProseSection } from './components/sections/prose';
29
+ export type { QuoteBlockProps } from './components/sections/quote-block';
30
+ export { QuoteBlock, quoteBlockVariants, } from './components/sections/quote-block';
27
31
  export type { RiverProps } from './components/sections/river';
28
32
  export { River, riverVariants } from './components/sections/river';
29
33
  export type { ToutProps } from './components/sections/tout';