@raxrai/stylelab-ui 0.1.1 → 0.3.1

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/index.d.mts CHANGED
@@ -57,6 +57,10 @@ declare const Badge: react.ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElem
57
57
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
58
58
  dot?: boolean;
59
59
  theme?: StyleLabTheme;
60
+ /** Override background (e.g. hex) when you need a specific color. */
61
+ bgOverride?: string;
62
+ /** Override text color (e.g. hex). */
63
+ textOverride?: string;
60
64
  } & react.RefAttributes<HTMLSpanElement>>;
61
65
 
62
66
  declare function BentoGrid({ children, className, style, }: {
@@ -108,6 +112,22 @@ type CalendarProps = {
108
112
  };
109
113
  declare function Calendar({ value: controlledValue, defaultValue, onSelect, min, max, className, theme: themeProp, }: CalendarProps): react.JSX.Element;
110
114
 
115
+ declare const cardVariants: (props?: ({
116
+ padding?: "none" | "sm" | "md" | null | undefined;
117
+ isHoverable?: boolean | null | undefined;
118
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
119
+ type CardClassNames = {
120
+ root?: string;
121
+ header?: string;
122
+ body?: string;
123
+ footer?: string;
124
+ };
125
+ type CardProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof cardVariants> & {
126
+ header?: ReactNode;
127
+ footer?: ReactNode;
128
+ theme?: StyleLabTheme;
129
+ classNames?: CardClassNames;
130
+ };
111
131
  declare const Card: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
112
132
  padding?: "none" | "sm" | "md" | null | undefined;
113
133
  isHoverable?: boolean | null | undefined;
@@ -115,6 +135,7 @@ declare const Card: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElemen
115
135
  header?: ReactNode;
116
136
  footer?: ReactNode;
117
137
  theme?: StyleLabTheme;
138
+ classNames?: CardClassNames;
118
139
  } & react.RefAttributes<HTMLDivElement>>;
119
140
 
120
141
  type DashboardNavItem = {
@@ -182,17 +203,29 @@ type DropdownItem = {
182
203
  label: ReactNode;
183
204
  disabled?: boolean;
184
205
  };
206
+ type DropdownClassNames = {
207
+ trigger?: string;
208
+ popover?: string;
209
+ item?: string;
210
+ };
185
211
  type DropdownProps = {
186
- trigger: ReactNode;
212
+ /** Custom trigger node. If omitted, a default button is shown using placeholder or selected label. */
213
+ trigger?: ReactNode;
214
+ /** Placeholder when no value is selected (used with default trigger). */
215
+ placeholder?: string;
187
216
  items: DropdownItem[];
188
217
  value?: string;
189
218
  defaultValue?: string;
190
219
  onValueChange?: (value: string) => void;
220
+ /** When true, the dropdown does not open and the trigger is non-interactive. */
221
+ disabled?: boolean;
191
222
  className?: string;
192
223
  style?: React.CSSProperties;
193
224
  theme?: StyleLabTheme;
225
+ /** Slot classNames for trigger, popover, and item. */
226
+ classNames?: DropdownClassNames;
194
227
  };
195
- declare function Dropdown({ trigger, items, value: controlledValue, defaultValue, onValueChange, className, style, theme: themeProp, }: DropdownProps): react.JSX.Element;
228
+ declare function Dropdown({ trigger: triggerProp, placeholder, items, value: controlledValue, defaultValue, onValueChange, disabled, className, style, theme: themeProp, classNames, }: DropdownProps): react.JSX.Element;
196
229
 
197
230
  type FlashcardProps = {
198
231
  question: string;
@@ -231,11 +264,23 @@ type ModalProps = VariantProps<typeof modalVariants> & {
231
264
  };
232
265
  declare function Modal({ open, onClose, title, size, className, style, children, theme: themeProp, }: ModalProps): react.JSX.Element | null;
233
266
 
234
- declare function Navbar({ children, className, style, }: {
235
- children: React.ReactNode;
267
+ type NavbarItem = {
268
+ href: string;
269
+ label: ReactNode;
270
+ };
271
+ type NavbarProps = {
272
+ /** Main content when using custom layout (no logo/items). */
273
+ children?: ReactNode;
274
+ /** Logo/brand node (left side). Used when `items` is provided. */
275
+ logo?: ReactNode;
276
+ /** Nav links. When provided, desktop shows horizontal links; mobile shows hamburger that toggles a menu. */
277
+ items?: NavbarItem[];
278
+ /** Optional slot for right side (e.g. theme switcher, user menu). Shown after nav items on desktop, in header row on mobile. */
279
+ right?: ReactNode;
236
280
  className?: string;
237
281
  style?: React.CSSProperties;
238
- }): react.JSX.Element;
282
+ };
283
+ declare function Navbar({ children, logo, items, right, className, style, }: NavbarProps): react.JSX.Element;
239
284
 
240
285
  type Tier = {
241
286
  name: string;
@@ -252,14 +297,18 @@ declare function PricingCard({ tier, onSelect, className, style, }: {
252
297
  style?: React.CSSProperties;
253
298
  }): react.JSX.Element;
254
299
 
255
- type Props = {
300
+ type ProgressBarProps = {
256
301
  value: number;
257
302
  max?: number;
258
303
  segmented?: boolean;
259
304
  className?: string;
260
305
  style?: React.CSSProperties;
306
+ /** Override track background (e.g. hex). */
307
+ trackColor?: string;
308
+ /** Override fill/active bar color (e.g. hex). */
309
+ activeColor?: string;
261
310
  };
262
- declare function ProgressBar({ value, max, segmented, className, style, }: Props): react.JSX.Element;
311
+ declare function ProgressBar({ value, max, segmented, className, style, trackColor, activeColor, }: ProgressBarProps): react.JSX.Element;
263
312
 
264
313
  declare function SectionHeader({ title, subtitle, className, style, }: {
265
314
  title: string;
@@ -368,12 +417,39 @@ type ThemeContextValue = {
368
417
  theme: StyleLabTheme;
369
418
  setTheme: (theme: StyleLabTheme) => void;
370
419
  };
371
- declare function ThemeProvider({ children, defaultTheme, }: {
420
+ declare function ThemeProvider({ children, defaultTheme, storageKey, }: {
372
421
  children: ReactNode;
373
422
  defaultTheme?: StyleLabTheme;
423
+ /** localStorage key for persisting theme. Defaults to "stylelab-theme". */
424
+ storageKey?: string;
374
425
  }): react.JSX.Element;
375
426
  declare function useTheme(): ThemeContextValue;
376
427
 
428
+ /**
429
+ * Background and UI color recommendations per theme.
430
+ * Use these as guidelines when laying out pages so components look correct.
431
+ */
432
+
433
+ type ThemeRecommendation = {
434
+ /** Recommended page or main wrapper background (matches gallery). */
435
+ background: string;
436
+ /** Recommended surface for cards, modals, panels. */
437
+ surface: string;
438
+ /** Recommended body/text color (matches gallery). */
439
+ text: string;
440
+ /** Primary accent color for CTAs and highlights. */
441
+ accent: string;
442
+ /** Recommended navbar styling (from theme-resolver navbar default). */
443
+ navbar: string;
444
+ /** Optional short guideline. */
445
+ notes?: string;
446
+ };
447
+ /** Background + text classes used in the gallery for each theme. Use these for page layout. */
448
+ declare const THEME_BACKGROUNDS: Record<StyleLabTheme, string>;
449
+ /** Navbar default class per theme (from theme-resolver). */
450
+ declare const THEME_NAVBAR: Record<StyleLabTheme, string>;
451
+ declare const THEME_RECOMMENDATIONS: Record<StyleLabTheme, ThemeRecommendation>;
452
+
377
453
  /**
378
454
  * Merges class names with Tailwind-aware deduplication.
379
455
  * Use for all component className composition.
@@ -415,4 +491,4 @@ declare function useKeyboardNavigation(options: {
415
491
  */
416
492
  declare function getNextListIndex(current: number, direction: "up" | "down", length: number): number;
417
493
 
418
- export { Accordion, Alert, Avatar, AvatarGroup, Badge, BentoGrid, Breadcrumbs, Button, Calendar, Card, CommandPalette, type ComponentName, DashboardShell, DataTable, DocumentAccordion, Dropdown, Flashcard, GraphicCard, Input, Modal, Navbar, PricingCard, ProgressBar, SectionHeader, Sidebar, Skeleton, Slider, StatsCard, type StyleLabTheme, THEMES, Tabs, Terminal, ThemeProvider, Timeline, Toast, Toggle, Tooltip, cn, getNextListIndex, getThemeClass, useClickOutside, useFocusTrap, useKeyboardNavigation, useTheme };
494
+ export { Accordion, Alert, Avatar, AvatarGroup, Badge, BentoGrid, Breadcrumbs, Button, Calendar, Card, type CardClassNames, type CardProps, CommandPalette, type ComponentName, DashboardShell, DataTable, DocumentAccordion, Dropdown, type DropdownClassNames, type DropdownItem, type DropdownProps, Flashcard, GraphicCard, Input, Modal, Navbar, type NavbarItem, type NavbarProps, PricingCard, ProgressBar, SectionHeader, Sidebar, Skeleton, Slider, StatsCard, type StyleLabTheme, THEMES, THEME_BACKGROUNDS, THEME_NAVBAR, THEME_RECOMMENDATIONS, Tabs, Terminal, ThemeProvider, type ThemeRecommendation, Timeline, Toast, Toggle, Tooltip, cn, getNextListIndex, getThemeClass, useClickOutside, useFocusTrap, useKeyboardNavigation, useTheme };
package/dist/index.d.ts CHANGED
@@ -57,6 +57,10 @@ declare const Badge: react.ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElem
57
57
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
58
58
  dot?: boolean;
59
59
  theme?: StyleLabTheme;
60
+ /** Override background (e.g. hex) when you need a specific color. */
61
+ bgOverride?: string;
62
+ /** Override text color (e.g. hex). */
63
+ textOverride?: string;
60
64
  } & react.RefAttributes<HTMLSpanElement>>;
61
65
 
62
66
  declare function BentoGrid({ children, className, style, }: {
@@ -108,6 +112,22 @@ type CalendarProps = {
108
112
  };
109
113
  declare function Calendar({ value: controlledValue, defaultValue, onSelect, min, max, className, theme: themeProp, }: CalendarProps): react.JSX.Element;
110
114
 
115
+ declare const cardVariants: (props?: ({
116
+ padding?: "none" | "sm" | "md" | null | undefined;
117
+ isHoverable?: boolean | null | undefined;
118
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
119
+ type CardClassNames = {
120
+ root?: string;
121
+ header?: string;
122
+ body?: string;
123
+ footer?: string;
124
+ };
125
+ type CardProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof cardVariants> & {
126
+ header?: ReactNode;
127
+ footer?: ReactNode;
128
+ theme?: StyleLabTheme;
129
+ classNames?: CardClassNames;
130
+ };
111
131
  declare const Card: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
112
132
  padding?: "none" | "sm" | "md" | null | undefined;
113
133
  isHoverable?: boolean | null | undefined;
@@ -115,6 +135,7 @@ declare const Card: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElemen
115
135
  header?: ReactNode;
116
136
  footer?: ReactNode;
117
137
  theme?: StyleLabTheme;
138
+ classNames?: CardClassNames;
118
139
  } & react.RefAttributes<HTMLDivElement>>;
119
140
 
120
141
  type DashboardNavItem = {
@@ -182,17 +203,29 @@ type DropdownItem = {
182
203
  label: ReactNode;
183
204
  disabled?: boolean;
184
205
  };
206
+ type DropdownClassNames = {
207
+ trigger?: string;
208
+ popover?: string;
209
+ item?: string;
210
+ };
185
211
  type DropdownProps = {
186
- trigger: ReactNode;
212
+ /** Custom trigger node. If omitted, a default button is shown using placeholder or selected label. */
213
+ trigger?: ReactNode;
214
+ /** Placeholder when no value is selected (used with default trigger). */
215
+ placeholder?: string;
187
216
  items: DropdownItem[];
188
217
  value?: string;
189
218
  defaultValue?: string;
190
219
  onValueChange?: (value: string) => void;
220
+ /** When true, the dropdown does not open and the trigger is non-interactive. */
221
+ disabled?: boolean;
191
222
  className?: string;
192
223
  style?: React.CSSProperties;
193
224
  theme?: StyleLabTheme;
225
+ /** Slot classNames for trigger, popover, and item. */
226
+ classNames?: DropdownClassNames;
194
227
  };
195
- declare function Dropdown({ trigger, items, value: controlledValue, defaultValue, onValueChange, className, style, theme: themeProp, }: DropdownProps): react.JSX.Element;
228
+ declare function Dropdown({ trigger: triggerProp, placeholder, items, value: controlledValue, defaultValue, onValueChange, disabled, className, style, theme: themeProp, classNames, }: DropdownProps): react.JSX.Element;
196
229
 
197
230
  type FlashcardProps = {
198
231
  question: string;
@@ -231,11 +264,23 @@ type ModalProps = VariantProps<typeof modalVariants> & {
231
264
  };
232
265
  declare function Modal({ open, onClose, title, size, className, style, children, theme: themeProp, }: ModalProps): react.JSX.Element | null;
233
266
 
234
- declare function Navbar({ children, className, style, }: {
235
- children: React.ReactNode;
267
+ type NavbarItem = {
268
+ href: string;
269
+ label: ReactNode;
270
+ };
271
+ type NavbarProps = {
272
+ /** Main content when using custom layout (no logo/items). */
273
+ children?: ReactNode;
274
+ /** Logo/brand node (left side). Used when `items` is provided. */
275
+ logo?: ReactNode;
276
+ /** Nav links. When provided, desktop shows horizontal links; mobile shows hamburger that toggles a menu. */
277
+ items?: NavbarItem[];
278
+ /** Optional slot for right side (e.g. theme switcher, user menu). Shown after nav items on desktop, in header row on mobile. */
279
+ right?: ReactNode;
236
280
  className?: string;
237
281
  style?: React.CSSProperties;
238
- }): react.JSX.Element;
282
+ };
283
+ declare function Navbar({ children, logo, items, right, className, style, }: NavbarProps): react.JSX.Element;
239
284
 
240
285
  type Tier = {
241
286
  name: string;
@@ -252,14 +297,18 @@ declare function PricingCard({ tier, onSelect, className, style, }: {
252
297
  style?: React.CSSProperties;
253
298
  }): react.JSX.Element;
254
299
 
255
- type Props = {
300
+ type ProgressBarProps = {
256
301
  value: number;
257
302
  max?: number;
258
303
  segmented?: boolean;
259
304
  className?: string;
260
305
  style?: React.CSSProperties;
306
+ /** Override track background (e.g. hex). */
307
+ trackColor?: string;
308
+ /** Override fill/active bar color (e.g. hex). */
309
+ activeColor?: string;
261
310
  };
262
- declare function ProgressBar({ value, max, segmented, className, style, }: Props): react.JSX.Element;
311
+ declare function ProgressBar({ value, max, segmented, className, style, trackColor, activeColor, }: ProgressBarProps): react.JSX.Element;
263
312
 
264
313
  declare function SectionHeader({ title, subtitle, className, style, }: {
265
314
  title: string;
@@ -368,12 +417,39 @@ type ThemeContextValue = {
368
417
  theme: StyleLabTheme;
369
418
  setTheme: (theme: StyleLabTheme) => void;
370
419
  };
371
- declare function ThemeProvider({ children, defaultTheme, }: {
420
+ declare function ThemeProvider({ children, defaultTheme, storageKey, }: {
372
421
  children: ReactNode;
373
422
  defaultTheme?: StyleLabTheme;
423
+ /** localStorage key for persisting theme. Defaults to "stylelab-theme". */
424
+ storageKey?: string;
374
425
  }): react.JSX.Element;
375
426
  declare function useTheme(): ThemeContextValue;
376
427
 
428
+ /**
429
+ * Background and UI color recommendations per theme.
430
+ * Use these as guidelines when laying out pages so components look correct.
431
+ */
432
+
433
+ type ThemeRecommendation = {
434
+ /** Recommended page or main wrapper background (matches gallery). */
435
+ background: string;
436
+ /** Recommended surface for cards, modals, panels. */
437
+ surface: string;
438
+ /** Recommended body/text color (matches gallery). */
439
+ text: string;
440
+ /** Primary accent color for CTAs and highlights. */
441
+ accent: string;
442
+ /** Recommended navbar styling (from theme-resolver navbar default). */
443
+ navbar: string;
444
+ /** Optional short guideline. */
445
+ notes?: string;
446
+ };
447
+ /** Background + text classes used in the gallery for each theme. Use these for page layout. */
448
+ declare const THEME_BACKGROUNDS: Record<StyleLabTheme, string>;
449
+ /** Navbar default class per theme (from theme-resolver). */
450
+ declare const THEME_NAVBAR: Record<StyleLabTheme, string>;
451
+ declare const THEME_RECOMMENDATIONS: Record<StyleLabTheme, ThemeRecommendation>;
452
+
377
453
  /**
378
454
  * Merges class names with Tailwind-aware deduplication.
379
455
  * Use for all component className composition.
@@ -415,4 +491,4 @@ declare function useKeyboardNavigation(options: {
415
491
  */
416
492
  declare function getNextListIndex(current: number, direction: "up" | "down", length: number): number;
417
493
 
418
- export { Accordion, Alert, Avatar, AvatarGroup, Badge, BentoGrid, Breadcrumbs, Button, Calendar, Card, CommandPalette, type ComponentName, DashboardShell, DataTable, DocumentAccordion, Dropdown, Flashcard, GraphicCard, Input, Modal, Navbar, PricingCard, ProgressBar, SectionHeader, Sidebar, Skeleton, Slider, StatsCard, type StyleLabTheme, THEMES, Tabs, Terminal, ThemeProvider, Timeline, Toast, Toggle, Tooltip, cn, getNextListIndex, getThemeClass, useClickOutside, useFocusTrap, useKeyboardNavigation, useTheme };
494
+ export { Accordion, Alert, Avatar, AvatarGroup, Badge, BentoGrid, Breadcrumbs, Button, Calendar, Card, type CardClassNames, type CardProps, CommandPalette, type ComponentName, DashboardShell, DataTable, DocumentAccordion, Dropdown, type DropdownClassNames, type DropdownItem, type DropdownProps, Flashcard, GraphicCard, Input, Modal, Navbar, type NavbarItem, type NavbarProps, PricingCard, ProgressBar, SectionHeader, Sidebar, Skeleton, Slider, StatsCard, type StyleLabTheme, THEMES, THEME_BACKGROUNDS, THEME_NAVBAR, THEME_RECOMMENDATIONS, Tabs, Terminal, ThemeProvider, type ThemeRecommendation, Timeline, Toast, Toggle, Tooltip, cn, getNextListIndex, getThemeClass, useClickOutside, useFocusTrap, useKeyboardNavigation, useTheme };