@yomologic/react-ui 0.2.5 → 0.2.6

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
@@ -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,53 @@ interface SectionLayoutProps {
179
186
  */
180
187
  declare function SectionLayout({ children, hasStickyPreview, }: SectionLayoutProps): react_jsx_runtime.JSX.Element | null;
181
188
 
189
+ interface NavItem$1 {
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$1[];
200
+ render?: () => React.ReactNode;
201
+ }
202
+ interface NavProps extends React.HTMLAttributes<HTMLElement> {
203
+ items: NavItem$1[];
204
+ variant?: "primary" | "secondary" | "outline" | "ghost";
205
+ orientation?: "horizontal" | "vertical";
206
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
207
+ mobileBreakpoint?: "sm" | "md" | "lg";
208
+ logo?: React.ReactNode;
209
+ actions?: React.ReactNode;
210
+ sticky?: boolean;
211
+ activeId?: string;
212
+ onItemClick?: (item: NavItem$1) => void;
213
+ }
214
+ declare const Nav: React.ForwardRefExoticComponent<NavProps & React.RefAttributes<HTMLElement>>;
215
+
182
216
  interface NavItem {
183
217
  id: string;
184
218
  label: string;
185
219
  icon?: React.ReactNode;
186
220
  }
221
+ interface NavSection {
222
+ title: string;
223
+ items: NavItem[];
224
+ }
187
225
  interface SidebarNavProps {
188
226
  title: string;
189
227
  subtitle?: string;
190
- items: NavItem[];
228
+ items?: NavItem[];
229
+ sections?: NavSection[];
191
230
  activeItem: string;
192
231
  onItemClick: (itemId: string) => void;
193
232
  footer?: React.ReactNode;
194
233
  position?: "left" | "right";
195
234
  }
196
- declare function SidebarNav({ title, subtitle, items, activeItem, onItemClick, footer, position, }: SidebarNavProps): react_jsx_runtime.JSX.Element;
235
+ declare function SidebarNav({ title, subtitle, items, sections, activeItem, onItemClick, footer, position, }: SidebarNavProps): react_jsx_runtime.JSX.Element;
197
236
 
198
237
  interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
199
238
  icon?: React.ReactNode;
@@ -203,6 +242,319 @@ interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
203
242
  }
204
243
  declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
205
244
 
245
+ /**
246
+ * Theme System Types
247
+ *
248
+ * This defines the structure for customizable themes that can be
249
+ * edited in the Theme Builder and applied across all components.
250
+ */
251
+ interface ColorShades {
252
+ 50?: string;
253
+ 100?: string;
254
+ 200?: string;
255
+ 300?: string;
256
+ 400?: string;
257
+ 500: string;
258
+ 600?: string;
259
+ 700?: string;
260
+ 800?: string;
261
+ 900?: string;
262
+ }
263
+ interface ThemeColors {
264
+ primary: ColorShades;
265
+ secondary: ColorShades;
266
+ success: string;
267
+ error: string;
268
+ warning: string;
269
+ info: string;
270
+ gray: ColorShades;
271
+ background: string;
272
+ foreground: string;
273
+ muted: string;
274
+ mutedForeground: string;
275
+ }
276
+ interface ThemeSpacing {
277
+ xs: string;
278
+ sm: string;
279
+ md: string;
280
+ lg: string;
281
+ xl: string;
282
+ '2xl': string;
283
+ }
284
+ interface ThemeBorderRadius {
285
+ none: string;
286
+ sm: string;
287
+ md: string;
288
+ lg: string;
289
+ xl: string;
290
+ full: string;
291
+ }
292
+ interface ThemeTypography {
293
+ fontFamily: {
294
+ sans: string[];
295
+ mono: string[];
296
+ };
297
+ fontSize: {
298
+ xs: string;
299
+ sm: string;
300
+ base: string;
301
+ lg: string;
302
+ xl: string;
303
+ '2xl': string;
304
+ '3xl': string;
305
+ };
306
+ fontWeight: {
307
+ normal: string;
308
+ medium: string;
309
+ semibold: string;
310
+ bold: string;
311
+ };
312
+ }
313
+ interface ButtonTheme {
314
+ padding: {
315
+ xs: {
316
+ x: string;
317
+ y: string;
318
+ };
319
+ sm: {
320
+ x: string;
321
+ y: string;
322
+ };
323
+ md: {
324
+ x: string;
325
+ y: string;
326
+ };
327
+ lg: {
328
+ x: string;
329
+ y: string;
330
+ };
331
+ xl: {
332
+ x: string;
333
+ y: string;
334
+ };
335
+ };
336
+ fontSize: {
337
+ xs: string;
338
+ sm: string;
339
+ md: string;
340
+ lg: string;
341
+ xl: string;
342
+ };
343
+ borderRadius: string;
344
+ fontWeight: string;
345
+ }
346
+ interface CardTheme {
347
+ padding: {
348
+ none: string;
349
+ sm: string;
350
+ md: string;
351
+ lg: string;
352
+ };
353
+ borderRadius: string;
354
+ borderWidth: string;
355
+ shadow: {
356
+ flat: string;
357
+ elevated: string;
358
+ };
359
+ }
360
+ interface InputTheme {
361
+ padding: {
362
+ xs: string;
363
+ sm: string;
364
+ md: string;
365
+ lg: string;
366
+ xl: string;
367
+ };
368
+ fontSize: {
369
+ xs: string;
370
+ sm: string;
371
+ md: string;
372
+ lg: string;
373
+ xl: string;
374
+ };
375
+ borderRadius: string;
376
+ borderWidth: string;
377
+ }
378
+ interface CheckboxTheme {
379
+ size: {
380
+ xs: string;
381
+ sm: string;
382
+ md: string;
383
+ lg: string;
384
+ xl: string;
385
+ };
386
+ labelSpacing: {
387
+ xs: string;
388
+ sm: string;
389
+ md: string;
390
+ lg: string;
391
+ xl: string;
392
+ };
393
+ labelFontSize: {
394
+ xs: string;
395
+ sm: string;
396
+ md: string;
397
+ lg: string;
398
+ xl: string;
399
+ };
400
+ borderRadius: string;
401
+ }
402
+ interface RadioTheme {
403
+ size: {
404
+ xs: string;
405
+ sm: string;
406
+ md: string;
407
+ lg: string;
408
+ xl: string;
409
+ };
410
+ labelSpacing: {
411
+ xs: string;
412
+ sm: string;
413
+ md: string;
414
+ lg: string;
415
+ xl: string;
416
+ };
417
+ labelFontSize: {
418
+ xs: string;
419
+ sm: string;
420
+ md: string;
421
+ lg: string;
422
+ xl: string;
423
+ };
424
+ }
425
+ interface DropdownTheme {
426
+ padding: {
427
+ xs: {
428
+ x: string;
429
+ y: string;
430
+ };
431
+ sm: {
432
+ x: string;
433
+ y: string;
434
+ };
435
+ md: {
436
+ x: string;
437
+ y: string;
438
+ };
439
+ lg: {
440
+ x: string;
441
+ y: string;
442
+ };
443
+ xl: {
444
+ x: string;
445
+ y: string;
446
+ };
447
+ };
448
+ fontSize: {
449
+ xs: string;
450
+ sm: string;
451
+ md: string;
452
+ lg: string;
453
+ xl: string;
454
+ };
455
+ iconSize: {
456
+ xs: string;
457
+ sm: string;
458
+ md: string;
459
+ lg: string;
460
+ xl: string;
461
+ };
462
+ optionPadding: {
463
+ xs: {
464
+ x: string;
465
+ y: string;
466
+ };
467
+ sm: {
468
+ x: string;
469
+ y: string;
470
+ };
471
+ md: {
472
+ x: string;
473
+ y: string;
474
+ };
475
+ lg: {
476
+ x: string;
477
+ y: string;
478
+ };
479
+ xl: {
480
+ x: string;
481
+ y: string;
482
+ };
483
+ };
484
+ optionFontSize: {
485
+ xs: string;
486
+ sm: string;
487
+ md: string;
488
+ lg: string;
489
+ xl: string;
490
+ };
491
+ borderRadius: string;
492
+ borderWidth: string;
493
+ }
494
+ interface NavTheme {
495
+ height: string;
496
+ itemPadding: {
497
+ xs: {
498
+ x: string;
499
+ y: string;
500
+ };
501
+ sm: {
502
+ x: string;
503
+ y: string;
504
+ };
505
+ md: {
506
+ x: string;
507
+ y: string;
508
+ };
509
+ lg: {
510
+ x: string;
511
+ y: string;
512
+ };
513
+ xl: {
514
+ x: string;
515
+ y: string;
516
+ };
517
+ };
518
+ fontSize: {
519
+ xs: string;
520
+ sm: string;
521
+ md: string;
522
+ lg: string;
523
+ xl: string;
524
+ };
525
+ borderRadius: string;
526
+ gap: string;
527
+ }
528
+ interface ComponentThemes {
529
+ button: ButtonTheme;
530
+ card: CardTheme;
531
+ input: InputTheme;
532
+ checkbox: CheckboxTheme;
533
+ radio: RadioTheme;
534
+ dropdown: DropdownTheme;
535
+ nav: NavTheme;
536
+ }
537
+ interface Theme {
538
+ name: string;
539
+ version: string;
540
+ colors: ThemeColors;
541
+ spacing: ThemeSpacing;
542
+ borderRadius: ThemeBorderRadius;
543
+ typography: ThemeTypography;
544
+ components: ComponentThemes;
545
+ }
546
+
547
+ interface ThemeContextType {
548
+ theme: Theme;
549
+ setTheme: (theme: Theme) => void;
550
+ applyTheme: (theme: Theme) => void;
551
+ resetTheme: () => void;
552
+ }
553
+ declare function ThemeProvider({ children }: {
554
+ children: ReactNode;
555
+ }): react_jsx_runtime.JSX.Element;
556
+ declare function useTheme(): ThemeContextType;
557
+
206
558
  declare function cn(...inputs: ClassValue[]): string;
207
559
 
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 };
560
+ export { Alert, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Dropdown, EmptyState, Input, Nav, type NavItem$1 as NavItem, type NavProps, type NavSection, RadioGroup, SectionLayout, SidebarNav, type NavItem as SidebarNavItem, Spinner, type Theme, ThemeProvider, cn, useTheme };