@yomologic/react-ui 0.2.5 → 0.2.7

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/README.md CHANGED
@@ -60,7 +60,8 @@ function App() {
60
60
 
61
61
  - **Container** - Responsive page container
62
62
  - **SectionLayout** - Layout wrapper for sections
63
- - **SidebarNav** - Navigation sidebar
63
+ - **Drawer** - Navigation drawer/sidebar
64
+ - **SidebarNav** - (Deprecated, use Drawer instead)
64
65
 
65
66
  ### Shared Components
66
67
 
package/dist/index.d.mts CHANGED
@@ -4,7 +4,7 @@ import { ClassValue } from 'clsx';
4
4
 
5
5
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
6
  variant?: "primary" | "secondary" | "outline" | "ghost" | "danger";
7
- size?: "sm" | "md" | "lg";
7
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
8
8
  isLoading?: boolean;
9
9
  leftIcon?: React.ReactNode;
10
10
  rightIcon?: React.ReactNode;
@@ -35,7 +35,7 @@ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<H
35
35
 
36
36
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
37
37
  variant?: "default" | "primary" | "success" | "warning" | "danger" | "info";
38
- size?: "sm" | "md" | "lg";
38
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
39
39
  dot?: boolean;
40
40
  }
41
41
  declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
@@ -47,8 +47,9 @@ interface CheckboxProps {
47
47
  disabled?: boolean;
48
48
  className?: string;
49
49
  id?: string;
50
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
50
51
  }
51
- declare function Checkbox({ label, checked, onChange, disabled, className, id, }: CheckboxProps): react_jsx_runtime.JSX.Element;
52
+ declare function Checkbox({ label, checked, onChange, disabled, className, id, size, }: CheckboxProps): react_jsx_runtime.JSX.Element;
52
53
  interface CheckboxOption {
53
54
  value: string;
54
55
  label: string;
@@ -64,8 +65,9 @@ interface CheckboxGroupProps {
64
65
  orientation?: "vertical" | "horizontal";
65
66
  required?: boolean;
66
67
  disabled?: boolean;
68
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
67
69
  }
68
- declare function CheckboxGroup({ label, name, options, value, onChange, className, orientation, required, disabled, }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
70
+ declare function CheckboxGroup({ label, name, options, value, onChange, className, orientation, required, disabled, size, }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
69
71
 
70
72
  interface RadioOption {
71
73
  value: string;
@@ -82,8 +84,9 @@ interface RadioGroupProps {
82
84
  orientation?: "vertical" | "horizontal";
83
85
  required?: boolean;
84
86
  disabled?: boolean;
87
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
85
88
  }
86
- declare function RadioGroup({ label, name, options, value, onChange, className, orientation, required, disabled, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
89
+ declare function RadioGroup({ label, name, options, value, onChange, className, orientation, required, disabled, size, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
87
90
 
88
91
  interface DropdownOption {
89
92
  value: string | number;
@@ -131,12 +134,16 @@ interface DropdownProps {
131
134
  * Mark the field as required
132
135
  */
133
136
  required?: boolean;
137
+ /**
138
+ * Size of the dropdown
139
+ */
140
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
134
141
  /**
135
142
  * Additional CSS classes
136
143
  */
137
144
  className?: string;
138
145
  }
139
- declare function Dropdown({ label, placeholder, options, value, onChange, children, disabled, error, helperText, required, className, }: DropdownProps): react_jsx_runtime.JSX.Element;
146
+ declare function Dropdown({ label, placeholder, options, value, onChange, children, disabled, error, helperText, required, size, className, }: DropdownProps): react_jsx_runtime.JSX.Element;
140
147
 
141
148
  interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
142
149
  size?: "sm" | "md" | "lg" | "xl";
@@ -179,21 +186,75 @@ interface SectionLayoutProps {
179
186
  */
180
187
  declare function SectionLayout({ children, hasStickyPreview, }: SectionLayoutProps): react_jsx_runtime.JSX.Element | null;
181
188
 
189
+ interface NavItem$2 {
190
+ id: string;
191
+ label?: string;
192
+ type?: "link" | "button" | "dropdown" | "divider" | "custom";
193
+ href?: string;
194
+ onClick?: () => void;
195
+ icon?: React.ReactNode;
196
+ badge?: string | number;
197
+ disabled?: boolean;
198
+ target?: "_blank" | "_self";
199
+ children?: NavItem$2[];
200
+ render?: () => React.ReactNode;
201
+ }
202
+ interface NavProps extends React.HTMLAttributes<HTMLElement> {
203
+ items: NavItem$2[];
204
+ variant?: "primary" | "secondary" | "outline" | "ghost";
205
+ orientation?: "horizontal" | "vertical";
206
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
207
+ mobileBreakpoint?: "sm" | "md" | "lg";
208
+ mobileMenuDirection?: "top" | "left" | "right";
209
+ logo?: React.ReactNode;
210
+ actions?: React.ReactNode;
211
+ sticky?: boolean;
212
+ activeId?: string;
213
+ onItemClick?: (item: NavItem$2) => void;
214
+ }
215
+ declare const Nav: React.ForwardRefExoticComponent<NavProps & React.RefAttributes<HTMLElement>>;
216
+
217
+ interface NavItem$1 {
218
+ id: string;
219
+ label: string;
220
+ icon?: React.ReactNode;
221
+ }
222
+ interface NavSection$1 {
223
+ title: string;
224
+ items: NavItem$1[];
225
+ }
226
+ interface DrawerProps {
227
+ title: string;
228
+ subtitle?: string;
229
+ items?: NavItem$1[];
230
+ sections?: NavSection$1[];
231
+ activeItem: string;
232
+ onItemClick: (itemId: string) => void;
233
+ footer?: React.ReactNode;
234
+ position?: "left" | "right";
235
+ }
236
+ declare function Drawer({ title, subtitle, items, sections, activeItem, onItemClick, footer, position, }: DrawerProps): react_jsx_runtime.JSX.Element;
237
+
182
238
  interface NavItem {
183
239
  id: string;
184
240
  label: string;
185
241
  icon?: React.ReactNode;
186
242
  }
243
+ interface NavSection {
244
+ title: string;
245
+ items: NavItem[];
246
+ }
187
247
  interface SidebarNavProps {
188
248
  title: string;
189
249
  subtitle?: string;
190
- items: NavItem[];
250
+ items?: NavItem[];
251
+ sections?: NavSection[];
191
252
  activeItem: string;
192
253
  onItemClick: (itemId: string) => void;
193
254
  footer?: React.ReactNode;
194
255
  position?: "left" | "right";
195
256
  }
196
- declare function SidebarNav({ title, subtitle, items, activeItem, onItemClick, footer, position, }: SidebarNavProps): react_jsx_runtime.JSX.Element;
257
+ declare function SidebarNav({ title, subtitle, items, sections, activeItem, onItemClick, footer, position, }: SidebarNavProps): react_jsx_runtime.JSX.Element;
197
258
 
198
259
  interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
199
260
  icon?: React.ReactNode;
@@ -203,6 +264,337 @@ interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
203
264
  }
204
265
  declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
205
266
 
267
+ /**
268
+ * Theme System Types
269
+ *
270
+ * This defines the structure for customizable themes that can be
271
+ * edited in the Theme Builder and applied across all components.
272
+ */
273
+ interface ColorShades {
274
+ 50?: string;
275
+ 100?: string;
276
+ 200?: string;
277
+ 300?: string;
278
+ 400?: string;
279
+ 500: string;
280
+ 600?: string;
281
+ 700?: string;
282
+ 800?: string;
283
+ 900?: string;
284
+ }
285
+ interface ThemeColors {
286
+ primary: ColorShades;
287
+ secondary: ColorShades;
288
+ success: string;
289
+ error: string;
290
+ warning: string;
291
+ info: string;
292
+ gray: ColorShades;
293
+ background: string;
294
+ foreground: string;
295
+ muted: string;
296
+ mutedForeground: string;
297
+ }
298
+ interface ThemeSpacing {
299
+ xs: string;
300
+ sm: string;
301
+ md: string;
302
+ lg: string;
303
+ xl: string;
304
+ '2xl': string;
305
+ }
306
+ interface ThemeBorderRadius {
307
+ none: string;
308
+ sm: string;
309
+ md: string;
310
+ lg: string;
311
+ xl: string;
312
+ full: string;
313
+ }
314
+ interface ThemeTypography {
315
+ fontFamily: {
316
+ sans: string[];
317
+ mono: string[];
318
+ };
319
+ fontSize: {
320
+ xs: string;
321
+ sm: string;
322
+ base: string;
323
+ lg: string;
324
+ xl: string;
325
+ '2xl': string;
326
+ '3xl': string;
327
+ };
328
+ fontWeight: {
329
+ normal: string;
330
+ medium: string;
331
+ semibold: string;
332
+ bold: string;
333
+ };
334
+ }
335
+ interface ButtonTheme {
336
+ padding: {
337
+ xs: {
338
+ x: string;
339
+ y: string;
340
+ };
341
+ sm: {
342
+ x: string;
343
+ y: string;
344
+ };
345
+ md: {
346
+ x: string;
347
+ y: string;
348
+ };
349
+ lg: {
350
+ x: string;
351
+ y: string;
352
+ };
353
+ xl: {
354
+ x: string;
355
+ y: string;
356
+ };
357
+ };
358
+ fontSize: {
359
+ xs: string;
360
+ sm: string;
361
+ md: string;
362
+ lg: string;
363
+ xl: string;
364
+ };
365
+ borderRadius: string;
366
+ fontWeight: string;
367
+ }
368
+ interface CardTheme {
369
+ padding: {
370
+ none: string;
371
+ sm: string;
372
+ md: string;
373
+ lg: string;
374
+ };
375
+ borderRadius: string;
376
+ borderWidth: string;
377
+ shadow: {
378
+ flat: string;
379
+ elevated: string;
380
+ };
381
+ }
382
+ interface InputTheme {
383
+ padding: {
384
+ xs: string;
385
+ sm: string;
386
+ md: string;
387
+ lg: string;
388
+ xl: string;
389
+ };
390
+ fontSize: {
391
+ xs: string;
392
+ sm: string;
393
+ md: string;
394
+ lg: string;
395
+ xl: string;
396
+ };
397
+ borderRadius: string;
398
+ borderWidth: string;
399
+ }
400
+ interface CheckboxTheme {
401
+ size: {
402
+ xs: string;
403
+ sm: string;
404
+ md: string;
405
+ lg: string;
406
+ xl: string;
407
+ };
408
+ labelSpacing: {
409
+ xs: string;
410
+ sm: string;
411
+ md: string;
412
+ lg: string;
413
+ xl: string;
414
+ };
415
+ labelFontSize: {
416
+ xs: string;
417
+ sm: string;
418
+ md: string;
419
+ lg: string;
420
+ xl: string;
421
+ };
422
+ borderRadius: string;
423
+ }
424
+ interface RadioTheme {
425
+ size: {
426
+ xs: string;
427
+ sm: string;
428
+ md: string;
429
+ lg: string;
430
+ xl: string;
431
+ };
432
+ labelSpacing: {
433
+ xs: string;
434
+ sm: string;
435
+ md: string;
436
+ lg: string;
437
+ xl: string;
438
+ };
439
+ labelFontSize: {
440
+ xs: string;
441
+ sm: string;
442
+ md: string;
443
+ lg: string;
444
+ xl: string;
445
+ };
446
+ }
447
+ interface DropdownTheme {
448
+ padding: {
449
+ xs: {
450
+ x: string;
451
+ y: string;
452
+ };
453
+ sm: {
454
+ x: string;
455
+ y: string;
456
+ };
457
+ md: {
458
+ x: string;
459
+ y: string;
460
+ };
461
+ lg: {
462
+ x: string;
463
+ y: string;
464
+ };
465
+ xl: {
466
+ x: string;
467
+ y: string;
468
+ };
469
+ };
470
+ fontSize: {
471
+ xs: string;
472
+ sm: string;
473
+ md: string;
474
+ lg: string;
475
+ xl: string;
476
+ };
477
+ iconSize: {
478
+ xs: string;
479
+ sm: string;
480
+ md: string;
481
+ lg: string;
482
+ xl: string;
483
+ };
484
+ optionPadding: {
485
+ xs: {
486
+ x: string;
487
+ y: string;
488
+ };
489
+ sm: {
490
+ x: string;
491
+ y: string;
492
+ };
493
+ md: {
494
+ x: string;
495
+ y: string;
496
+ };
497
+ lg: {
498
+ x: string;
499
+ y: string;
500
+ };
501
+ xl: {
502
+ x: string;
503
+ y: string;
504
+ };
505
+ };
506
+ optionFontSize: {
507
+ xs: string;
508
+ sm: string;
509
+ md: string;
510
+ lg: string;
511
+ xl: string;
512
+ };
513
+ borderRadius: string;
514
+ borderWidth: string;
515
+ }
516
+ interface NavTheme {
517
+ height: string;
518
+ itemPadding: {
519
+ xs: {
520
+ x: string;
521
+ y: string;
522
+ };
523
+ sm: {
524
+ x: string;
525
+ y: string;
526
+ };
527
+ md: {
528
+ x: string;
529
+ y: string;
530
+ };
531
+ lg: {
532
+ x: string;
533
+ y: string;
534
+ };
535
+ xl: {
536
+ x: string;
537
+ y: string;
538
+ };
539
+ };
540
+ fontSize: {
541
+ xs: string;
542
+ sm: string;
543
+ md: string;
544
+ lg: string;
545
+ xl: string;
546
+ };
547
+ borderRadius: string;
548
+ gap: string;
549
+ }
550
+ interface ZIndexScale {
551
+ dropdown: number;
552
+ popover: number;
553
+ tooltip: number;
554
+ overlay: number;
555
+ nav: number;
556
+ navMobileOverlay: number;
557
+ navMobileMenu: number;
558
+ drawerHeader: number;
559
+ drawerButton: number;
560
+ drawerOverlay: number;
561
+ drawerPanel: number;
562
+ modalBackdrop: number;
563
+ modal: number;
564
+ snackbar: number;
565
+ toast: number;
566
+ }
567
+ interface ComponentThemes {
568
+ button: ButtonTheme;
569
+ card: CardTheme;
570
+ input: InputTheme;
571
+ checkbox: CheckboxTheme;
572
+ radio: RadioTheme;
573
+ dropdown: DropdownTheme;
574
+ nav: NavTheme;
575
+ }
576
+ interface Theme {
577
+ name: string;
578
+ version: string;
579
+ colors: ThemeColors;
580
+ spacing: ThemeSpacing;
581
+ borderRadius: ThemeBorderRadius;
582
+ typography: ThemeTypography;
583
+ zIndex: ZIndexScale;
584
+ components: ComponentThemes;
585
+ }
586
+
587
+ interface ThemeContextType {
588
+ theme: Theme;
589
+ setTheme: (theme: Theme) => void;
590
+ applyTheme: (theme: Theme) => void;
591
+ resetTheme: () => void;
592
+ }
593
+ declare function ThemeProvider({ children }: {
594
+ children: ReactNode;
595
+ }): react_jsx_runtime.JSX.Element;
596
+ declare function useTheme(): ThemeContextType;
597
+
206
598
  declare function cn(...inputs: ClassValue[]): string;
207
599
 
208
- export { Alert, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Dropdown, EmptyState, Input, type NavItem, RadioGroup, SectionLayout, SidebarNav, Spinner, cn };
600
+ export { Alert, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Drawer, type NavItem$1 as DrawerNavItem, type NavSection$1 as DrawerNavSection, type DrawerProps, Dropdown, EmptyState, Input, Nav, type NavItem$2 as NavItem, type NavProps, type NavSection, RadioGroup, SectionLayout, SidebarNav, type NavItem as SidebarNavItem, Spinner, type Theme, ThemeProvider, cn, useTheme };