@trycompai/design-system 1.0.0 → 1.0.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.
Files changed (72) hide show
  1. package/package.json +2 -2
  2. package/src/components/atoms/index.ts +19 -0
  3. package/src/components/atoms/kbd.tsx +21 -0
  4. package/src/components/{ui → atoms}/slider.tsx +4 -4
  5. package/src/components/{ui → atoms}/textarea.tsx +8 -2
  6. package/src/components/{ui → atoms}/toggle.tsx +2 -5
  7. package/src/components/{ui → molecules}/breadcrumb.tsx +1 -1
  8. package/src/components/molecules/empty.tsx +82 -0
  9. package/src/components/{ui → molecules}/field.tsx +16 -37
  10. package/src/components/{ui → molecules}/hover-card.tsx +2 -8
  11. package/src/components/molecules/index.ts +26 -0
  12. package/src/components/{ui → molecules}/input-group.tsx +1 -1
  13. package/src/components/molecules/input-otp.tsx +70 -0
  14. package/src/components/{ui → molecules}/item.tsx +18 -36
  15. package/src/components/{ui → molecules}/page-header.tsx +2 -2
  16. package/src/components/{ui → molecules}/pagination.tsx +10 -19
  17. package/src/components/{ui → molecules}/radio-group.tsx +4 -8
  18. package/src/components/{ui → molecules}/scroll-area.tsx +8 -11
  19. package/src/components/{ui → molecules}/section.tsx +2 -2
  20. package/src/components/{ui → molecules}/select.tsx +17 -5
  21. package/src/components/{ui → molecules}/table.tsx +11 -2
  22. package/src/components/{ui → molecules}/toggle-group.tsx +1 -1
  23. package/src/components/organisms/alert-dialog.tsx +135 -0
  24. package/src/components/{ui → organisms}/calendar.tsx +2 -3
  25. package/src/components/{ui → organisms}/carousel.tsx +6 -8
  26. package/src/components/{ui → organisms}/chart.tsx +9 -24
  27. package/src/components/{ui → organisms}/combobox.tsx +2 -2
  28. package/src/components/{ui → organisms}/context-menu.tsx +19 -49
  29. package/src/components/{ui → organisms}/dialog.tsx +1 -1
  30. package/src/components/organisms/index.ts +16 -0
  31. package/src/components/organisms/navigation-menu.tsx +137 -0
  32. package/src/components/{ui → organisms}/sheet.tsx +6 -6
  33. package/src/components/{ui → organisms}/sidebar.tsx +42 -83
  34. package/src/components/{ui → organisms}/sonner.tsx +7 -9
  35. package/src/components/ui/index.ts +3 -61
  36. package/src/styles/globals.css +12 -0
  37. package/src/components/ui/alert-dialog.tsx +0 -161
  38. package/src/components/ui/empty.tsx +0 -94
  39. package/src/components/ui/input-otp.tsx +0 -84
  40. package/src/components/ui/kbd.tsx +0 -26
  41. package/src/components/ui/navigation-menu.tsx +0 -147
  42. /package/src/components/{ui → atoms}/aspect-ratio.tsx +0 -0
  43. /package/src/components/{ui → atoms}/avatar.tsx +0 -0
  44. /package/src/components/{ui → atoms}/badge.tsx +0 -0
  45. /package/src/components/{ui → atoms}/button.tsx +0 -0
  46. /package/src/components/{ui → atoms}/checkbox.tsx +0 -0
  47. /package/src/components/{ui → atoms}/container.tsx +0 -0
  48. /package/src/components/{ui → atoms}/heading.tsx +0 -0
  49. /package/src/components/{ui → atoms}/input.tsx +0 -0
  50. /package/src/components/{ui → atoms}/label.tsx +0 -0
  51. /package/src/components/{ui → atoms}/progress.tsx +0 -0
  52. /package/src/components/{ui → atoms}/separator.tsx +0 -0
  53. /package/src/components/{ui → atoms}/skeleton.tsx +0 -0
  54. /package/src/components/{ui → atoms}/spinner.tsx +0 -0
  55. /package/src/components/{ui → atoms}/switch.tsx +0 -0
  56. /package/src/components/{ui → atoms}/text.tsx +0 -0
  57. /package/src/components/{ui → molecules}/accordion.tsx +0 -0
  58. /package/src/components/{ui → molecules}/alert.tsx +0 -0
  59. /package/src/components/{ui → molecules}/button-group.tsx +0 -0
  60. /package/src/components/{ui → molecules}/card.tsx +0 -0
  61. /package/src/components/{ui → molecules}/collapsible.tsx +0 -0
  62. /package/src/components/{ui → molecules}/grid.tsx +0 -0
  63. /package/src/components/{ui → molecules}/popover.tsx +0 -0
  64. /package/src/components/{ui → molecules}/resizable.tsx +0 -0
  65. /package/src/components/{ui → molecules}/stack.tsx +0 -0
  66. /package/src/components/{ui → molecules}/tabs.tsx +0 -0
  67. /package/src/components/{ui → molecules}/tooltip.tsx +0 -0
  68. /package/src/components/{ui → organisms}/command.tsx +0 -0
  69. /package/src/components/{ui → organisms}/drawer.tsx +0 -0
  70. /package/src/components/{ui → organisms}/dropdown-menu.tsx +0 -0
  71. /package/src/components/{ui → organisms}/menubar.tsx +0 -0
  72. /package/src/components/{ui → organisms}/page-layout.tsx +0 -0
@@ -10,9 +10,9 @@ import * as React from 'react';
10
10
  import { PanelLeftIcon } from 'lucide-react';
11
11
  import { useIsMobile } from '../../../hooks/use-mobile';
12
12
  import { cn } from '../../../lib/utils';
13
- import { buttonVariants } from './button';
13
+ import { buttonVariants } from '../atoms/button';
14
+ import { Tooltip, TooltipContent, TooltipTrigger } from '../molecules/tooltip';
14
15
  import { Sheet } from './sheet';
15
- import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip';
16
16
 
17
17
  const SIDEBAR_COOKIE_NAME = 'sidebar_state';
18
18
  const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
@@ -46,11 +46,10 @@ function SidebarProvider({
46
46
  defaultOpen = true,
47
47
  open: openProp,
48
48
  onOpenChange: setOpenProp,
49
- className,
50
49
  style,
51
50
  children,
52
51
  ...props
53
- }: React.ComponentProps<'div'> & {
52
+ }: Omit<React.ComponentProps<'div'>, 'className'> & {
54
53
  defaultOpen?: boolean;
55
54
  open?: boolean;
56
55
  onOpenChange?: (open: boolean) => void;
@@ -123,10 +122,7 @@ function SidebarProvider({
123
122
  ...style,
124
123
  } as React.CSSProperties
125
124
  }
126
- className={cn(
127
- 'group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full',
128
- className,
129
- )}
125
+ className="group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full"
130
126
  {...props}
131
127
  >
132
128
  {children}
@@ -139,10 +135,9 @@ function Sidebar({
139
135
  side = 'left',
140
136
  variant = 'sidebar',
141
137
  collapsible = 'offExamples',
142
- className,
143
138
  children,
144
139
  ...props
145
- }: React.ComponentProps<'div'> & {
140
+ }: Omit<React.ComponentProps<'div'>, 'className'> & {
146
141
  side?: 'left' | 'right';
147
142
  variant?: 'sidebar' | 'floating' | 'inset';
148
143
  collapsible?: 'offExamples' | 'icon' | 'none';
@@ -153,10 +148,7 @@ function Sidebar({
153
148
  return (
154
149
  <div
155
150
  data-slot="sidebar"
156
- className={cn(
157
- 'bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col',
158
- className,
159
- )}
151
+ className="bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col"
160
152
  {...props}
161
153
  >
162
154
  {children}
@@ -241,7 +233,6 @@ function Sidebar({
241
233
  variant === 'floating' || variant === 'inset'
242
234
  ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'
243
235
  : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l',
244
- className,
245
236
  )}
246
237
  {...props}
247
238
  >
@@ -277,7 +268,7 @@ function SidebarTrigger({ onClick, ...props }: Omit<ButtonPrimitive.Props, 'clas
277
268
  );
278
269
  }
279
270
 
280
- function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {
271
+ function SidebarRail({ ...props }: Omit<React.ComponentProps<'button'>, 'className'>) {
281
272
  const { toggleSidebar } = useSidebar();
282
273
 
283
274
  return (
@@ -288,28 +279,17 @@ function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {
288
279
  tabIndex={-1}
289
280
  onClick={toggleSidebar}
290
281
  title="Toggle Sidebar"
291
- className={cn(
292
- 'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex',
293
- 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
294
- '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
295
- 'hover:group-data-[collapsible=offExamples]:bg-sidebar group-data-[collapsible=offExamples]:translate-x-0 group-data-[collapsible=offExamples]:after:left-full',
296
- '[[data-side=left][data-collapsible=offExamples]_&]:-right-2',
297
- '[[data-side=right][data-collapsible=offExamples]_&]:-left-2',
298
- className,
299
- )}
282
+ className="hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize [[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize hover:group-data-[collapsible=offExamples]:bg-sidebar group-data-[collapsible=offExamples]:translate-x-0 group-data-[collapsible=offExamples]:after:left-full [[data-side=left][data-collapsible=offExamples]_&]:-right-2 [[data-side=right][data-collapsible=offExamples]_&]:-left-2"
300
283
  {...props}
301
284
  />
302
285
  );
303
286
  }
304
287
 
305
- function SidebarInset({ className, ...props }: React.ComponentProps<'main'>) {
288
+ function SidebarInset({ ...props }: Omit<React.ComponentProps<'main'>, 'className'>) {
306
289
  return (
307
290
  <main
308
291
  data-slot="sidebar-inset"
309
- className={cn(
310
- 'bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col',
311
- className,
312
- )}
292
+ className="bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col"
313
293
  {...props}
314
294
  />
315
295
  );
@@ -326,23 +306,23 @@ function SidebarInput({ ...props }: Omit<React.ComponentProps<'input'>, 'classNa
326
306
  );
327
307
  }
328
308
 
329
- function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>) {
309
+ function SidebarHeader({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
330
310
  return (
331
311
  <div
332
312
  data-slot="sidebar-header"
333
313
  data-sidebar="header"
334
- className={cn('gap-2 p-2 flex flex-col', className)}
314
+ className="gap-2 p-2 flex flex-col"
335
315
  {...props}
336
316
  />
337
317
  );
338
318
  }
339
319
 
340
- function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {
320
+ function SidebarFooter({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
341
321
  return (
342
322
  <div
343
323
  data-slot="sidebar-footer"
344
324
  data-sidebar="footer"
345
- className={cn('gap-2 p-2 flex flex-col', className)}
325
+ className="gap-2 p-2 flex flex-col"
346
326
  {...props}
347
327
  />
348
328
  );
@@ -359,44 +339,38 @@ function SidebarSeparator({ ...props }: Omit<SeparatorPrimitive.Props, 'classNam
359
339
  );
360
340
  }
361
341
 
362
- function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {
342
+ function SidebarContent({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
363
343
  return (
364
344
  <div
365
345
  data-slot="sidebar-content"
366
346
  data-sidebar="content"
367
- className={cn(
368
- 'no-scrollbar gap-2 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden',
369
- className,
370
- )}
347
+ className="no-scrollbar gap-2 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden"
371
348
  {...props}
372
349
  />
373
350
  );
374
351
  }
375
352
 
376
- function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>) {
353
+ function SidebarGroup({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
377
354
  return (
378
355
  <div
379
356
  data-slot="sidebar-group"
380
357
  data-sidebar="group"
381
- className={cn('p-2 relative flex w-full min-w-0 flex-col', className)}
358
+ className="p-2 relative flex w-full min-w-0 flex-col"
382
359
  {...props}
383
360
  />
384
361
  );
385
362
  }
386
363
 
387
364
  function SidebarGroupLabel({
388
- className,
389
365
  render,
390
366
  ...props
391
- }: useRender.ComponentProps<'div'> & React.ComponentProps<'div'>) {
367
+ }: Omit<useRender.ComponentProps<'div'>, 'className'> & Omit<React.ComponentProps<'div'>, 'className'>) {
392
368
  return useRender({
393
369
  defaultTagName: 'div',
394
370
  props: mergeProps<'div'>(
395
371
  {
396
- className: cn(
372
+ className:
397
373
  'text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0',
398
- className,
399
- ),
400
374
  },
401
375
  props,
402
376
  ),
@@ -409,18 +383,15 @@ function SidebarGroupLabel({
409
383
  }
410
384
 
411
385
  function SidebarGroupAction({
412
- className,
413
386
  render,
414
387
  ...props
415
- }: useRender.ComponentProps<'button'> & React.ComponentProps<'button'>) {
388
+ }: Omit<useRender.ComponentProps<'button'>, 'className'> & Omit<React.ComponentProps<'button'>, 'className'>) {
416
389
  return useRender({
417
390
  defaultTagName: 'button',
418
391
  props: mergeProps<'button'>(
419
392
  {
420
- className: cn(
393
+ className:
421
394
  'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 w-5 rounded-md p-0 focus-visible:ring-2 [&>svg]:size-4 flex aspect-square items-center justify-center outline-hidden transition-transform [&>svg]:shrink-0 after:absolute after:-inset-2 md:after:hidden group-data-[collapsible=icon]:hidden',
422
- className,
423
- ),
424
395
  },
425
396
  props,
426
397
  ),
@@ -432,34 +403,34 @@ function SidebarGroupAction({
432
403
  });
433
404
  }
434
405
 
435
- function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>) {
406
+ function SidebarGroupContent({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
436
407
  return (
437
408
  <div
438
409
  data-slot="sidebar-group-content"
439
410
  data-sidebar="group-content"
440
- className={cn('text-sm w-full', className)}
411
+ className="text-sm w-full"
441
412
  {...props}
442
413
  />
443
414
  );
444
415
  }
445
416
 
446
- function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {
417
+ function SidebarMenu({ ...props }: Omit<React.ComponentProps<'ul'>, 'className'>) {
447
418
  return (
448
419
  <ul
449
420
  data-slot="sidebar-menu"
450
421
  data-sidebar="menu"
451
- className={cn('gap-1 flex w-full min-w-0 flex-col', className)}
422
+ className="gap-1 flex w-full min-w-0 flex-col"
452
423
  {...props}
453
424
  />
454
425
  );
455
426
  }
456
427
 
457
- function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {
428
+ function SidebarMenuItem({ ...props }: Omit<React.ComponentProps<'li'>, 'className'>) {
458
429
  return (
459
430
  <li
460
431
  data-slot="sidebar-menu-item"
461
432
  data-sidebar="menu-item"
462
- className={cn('group/menu-item relative', className)}
433
+ className="group/menu-item relative"
463
434
  {...props}
464
435
  />
465
436
  );
@@ -493,10 +464,9 @@ function SidebarMenuButton({
493
464
  variant = 'default',
494
465
  size = 'default',
495
466
  tooltip,
496
- className,
497
467
  ...props
498
- }: useRender.ComponentProps<'button'> &
499
- React.ComponentProps<'button'> & {
468
+ }: Omit<useRender.ComponentProps<'button'>, 'className'> &
469
+ Omit<React.ComponentProps<'button'>, 'className'> & {
500
470
  isActive?: boolean;
501
471
  tooltip?: string | React.ComponentProps<typeof TooltipContent>;
502
472
  } & VariantProps<typeof sidebarMenuButtonVariants>) {
@@ -505,7 +475,7 @@ function SidebarMenuButton({
505
475
  defaultTagName: 'button',
506
476
  props: mergeProps<'button'>(
507
477
  {
508
- className: cn(sidebarMenuButtonVariants({ variant, size }), className),
478
+ className: sidebarMenuButtonVariants({ variant, size }),
509
479
  },
510
480
  props,
511
481
  ),
@@ -542,12 +512,11 @@ function SidebarMenuButton({
542
512
  }
543
513
 
544
514
  function SidebarMenuAction({
545
- className,
546
515
  render,
547
516
  showOnHover = false,
548
517
  ...props
549
- }: useRender.ComponentProps<'button'> &
550
- React.ComponentProps<'button'> & {
518
+ }: Omit<useRender.ComponentProps<'button'>, 'className'> &
519
+ Omit<React.ComponentProps<'button'>, 'className'> & {
551
520
  showOnHover?: boolean;
552
521
  }) {
553
522
  return useRender({
@@ -558,7 +527,6 @@ function SidebarMenuAction({
558
527
  'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0',
559
528
  showOnHover &&
560
529
  'peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-open:opacity-100 md:opacity-0',
561
- className,
562
530
  ),
563
531
  },
564
532
  props,
@@ -571,15 +539,12 @@ function SidebarMenuAction({
571
539
  });
572
540
  }
573
541
 
574
- function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>) {
542
+ function SidebarMenuBadge({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
575
543
  return (
576
544
  <div
577
545
  data-slot="sidebar-menu-badge"
578
546
  data-sidebar="menu-badge"
579
- className={cn(
580
- 'text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 rounded-md px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 flex items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden',
581
- className,
582
- )}
547
+ className="text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 rounded-md px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 flex items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden"
583
548
  {...props}
584
549
  />
585
550
  );
@@ -622,26 +587,23 @@ function SidebarMenuSkeleton({
622
587
  );
623
588
  }
624
589
 
625
- function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {
590
+ function SidebarMenuSub({ ...props }: Omit<React.ComponentProps<'ul'>, 'className'>) {
626
591
  return (
627
592
  <ul
628
593
  data-slot="sidebar-menu-sub"
629
594
  data-sidebar="menu-sub"
630
- className={cn(
631
- 'border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col',
632
- className,
633
- )}
595
+ className="border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col"
634
596
  {...props}
635
597
  />
636
598
  );
637
599
  }
638
600
 
639
- function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>) {
601
+ function SidebarMenuSubItem({ ...props }: Omit<React.ComponentProps<'li'>, 'className'>) {
640
602
  return (
641
603
  <li
642
604
  data-slot="sidebar-menu-sub-item"
643
605
  data-sidebar="menu-sub-item"
644
- className={cn('group/menu-sub-item relative', className)}
606
+ className="group/menu-sub-item relative"
645
607
  {...props}
646
608
  />
647
609
  );
@@ -651,10 +613,9 @@ function SidebarMenuSubButton({
651
613
  render,
652
614
  size = 'md',
653
615
  isActive = false,
654
- className,
655
616
  ...props
656
- }: useRender.ComponentProps<'a'> &
657
- React.ComponentProps<'a'> & {
617
+ }: Omit<useRender.ComponentProps<'a'>, 'className'> &
618
+ Omit<React.ComponentProps<'a'>, 'className'> & {
658
619
  size?: 'sm' | 'md';
659
620
  isActive?: boolean;
660
621
  }) {
@@ -662,10 +623,8 @@ function SidebarMenuSubButton({
662
623
  defaultTagName: 'a',
663
624
  props: mergeProps<'a'>(
664
625
  {
665
- className: cn(
626
+ className:
666
627
  'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0',
667
- className,
668
- ),
669
628
  },
670
629
  props,
671
630
  ),
@@ -5,21 +5,18 @@ import {
5
5
  OctagonXIcon,
6
6
  TriangleAlertIcon,
7
7
  } from 'lucide-react';
8
- import { useTheme } from 'next-themes';
9
8
  import { Toaster as Sonner, type ToasterProps } from 'sonner';
10
9
 
11
- const Toaster = ({ ...props }: ToasterProps) => {
12
- const { theme = 'system' } = useTheme();
13
-
10
+ const Toaster = ({ theme = 'system', ...props }: ToasterProps) => {
14
11
  return (
15
12
  <Sonner
16
- theme={theme as ToasterProps['theme']}
13
+ theme={theme}
17
14
  className="toaster group"
18
15
  icons={{
19
- success: <CircleCheckIcon className="size-4" />,
20
- info: <InfoIcon className="size-4" />,
21
- warning: <TriangleAlertIcon className="size-4" />,
22
- error: <OctagonXIcon className="size-4" />,
16
+ success: <CircleCheckIcon className="size-4 text-success" />,
17
+ info: <InfoIcon className="size-4 text-info" />,
18
+ warning: <TriangleAlertIcon className="size-4 text-warning" />,
19
+ error: <OctagonXIcon className="size-4 text-destructive" />,
23
20
  loading: <Loader2Icon className="size-4 animate-spin" />,
24
21
  }}
25
22
  style={
@@ -33,6 +30,7 @@ const Toaster = ({ ...props }: ToasterProps) => {
33
30
  toastOptions={{
34
31
  classNames: {
35
32
  toast: 'cn-toast',
33
+ description: '!text-muted-foreground',
36
34
  },
37
35
  }}
38
36
  {...props}
@@ -1,61 +1,3 @@
1
- export * from './accordion';
2
- export * from './alert';
3
- export * from './alert-dialog';
4
- export * from './aspect-ratio';
5
- export * from './avatar';
6
- export * from './badge';
7
- export * from './breadcrumb';
8
- export * from './button';
9
- export * from './button-group';
10
- export * from './calendar';
11
- export * from './card';
12
- export * from './carousel';
13
- export * from './chart';
14
- export * from './checkbox';
15
- export * from './collapsible';
16
- export * from './combobox';
17
- export * from './command';
18
- export * from './container';
19
- export * from './context-menu';
20
- export * from './dialog';
21
- export * from './drawer';
22
- export * from './dropdown-menu';
23
- export * from './empty';
24
- export * from './field';
25
- export * from './grid';
26
- export * from './heading';
27
- export * from './hover-card';
28
- export * from './input';
29
- export * from './input-group';
30
- export * from './input-otp';
31
- export * from './item';
32
- export * from './kbd';
33
- export * from './label';
34
- export * from './menubar';
35
- export * from './navigation-menu';
36
- export * from './page-header';
37
- export * from './page-layout';
38
- export * from './pagination';
39
- export * from './popover';
40
- export * from './progress';
41
- export * from './radio-group';
42
- export * from './resizable';
43
- export * from './scroll-area';
44
- export * from './section';
45
- export * from './select';
46
- export * from './separator';
47
- export * from './sheet';
48
- export * from './sidebar';
49
- export * from './skeleton';
50
- export * from './slider';
51
- export * from './sonner';
52
- export * from './spinner';
53
- export * from './stack';
54
- export * from './switch';
55
- export * from './table';
56
- export * from './tabs';
57
- export * from './text';
58
- export * from './textarea';
59
- export * from './toggle';
60
- export * from './toggle-group';
61
- export * from './tooltip';
1
+ export * from '../atoms';
2
+ export * from '../molecules';
3
+ export * from '../organisms';
@@ -1,6 +1,9 @@
1
1
  @import 'tailwindcss';
2
2
  @import 'tw-animate-css';
3
3
 
4
+ /* Include design system components in Tailwind's content scan */
5
+ @source "../components/**/*.tsx";
6
+
4
7
  @custom-variant dark (&:is(.dark *));
5
8
 
6
9
  @layer base {
@@ -20,6 +23,9 @@
20
23
  --accent: oklch(0.97 0 0);
21
24
  --accent-foreground: oklch(0.205 0 0);
22
25
  --destructive: oklch(0.58 0.22 27);
26
+ --success: oklch(0.6 0.16 145);
27
+ --warning: oklch(0.75 0.15 85);
28
+ --info: oklch(0.6 0.15 250);
23
29
  --border: oklch(0.922 0 0);
24
30
  --input: oklch(0.922 0 0);
25
31
  --ring: oklch(0.708 0 0);
@@ -54,6 +60,9 @@
54
60
  --accent: oklch(0.371 0 0);
55
61
  --accent-foreground: oklch(0.985 0 0);
56
62
  --destructive: oklch(0.704 0.191 22.216);
63
+ --success: oklch(0.7 0.16 145);
64
+ --warning: oklch(0.8 0.15 85);
65
+ --info: oklch(0.7 0.15 250);
57
66
  --border: oklch(1 0 0 / 10%);
58
67
  --input: oklch(1 0 0 / 15%);
59
68
  --ring: oklch(0.556 0 0);
@@ -90,6 +99,9 @@
90
99
  --color-accent-foreground: var(--accent-foreground);
91
100
  --color-destructive: var(--destructive);
92
101
  --color-destructive-foreground: var(--destructive-foreground);
102
+ --color-success: var(--success);
103
+ --color-warning: var(--warning);
104
+ --color-info: var(--info);
93
105
  --color-border: var(--border);
94
106
  --color-input: var(--input);
95
107
  --color-ring: var(--ring);
@@ -1,161 +0,0 @@
1
- import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
2
- import * as React from 'react';
3
-
4
- import { cn } from '../../../lib/utils';
5
- import { Button } from './button';
6
-
7
- function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
8
- return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
9
- }
10
-
11
- function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
12
- return <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />;
13
- }
14
-
15
- function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
16
- return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />;
17
- }
18
-
19
- function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.Backdrop.Props) {
20
- return (
21
- <AlertDialogPrimitive.Backdrop
22
- data-slot="alert-dialog-overlay"
23
- className={cn(
24
- 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50',
25
- className,
26
- )}
27
- {...props}
28
- />
29
- );
30
- }
31
-
32
- function AlertDialogContent({
33
- className,
34
- size = 'default',
35
- ...props
36
- }: AlertDialogPrimitive.Popup.Props & {
37
- size?: 'default' | 'sm';
38
- }) {
39
- return (
40
- <AlertDialogPortal>
41
- <AlertDialogOverlay />
42
- <AlertDialogPrimitive.Popup
43
- data-slot="alert-dialog-content"
44
- data-size={size}
45
- className={cn(
46
- 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none',
47
- className,
48
- )}
49
- {...props}
50
- />
51
- </AlertDialogPortal>
52
- );
53
- }
54
-
55
- function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
56
- return (
57
- <div
58
- data-slot="alert-dialog-header"
59
- className={cn(
60
- 'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',
61
- className,
62
- )}
63
- {...props}
64
- />
65
- );
66
- }
67
-
68
- function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
69
- return (
70
- <div
71
- data-slot="alert-dialog-footer"
72
- className={cn(
73
- 'bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end',
74
- className,
75
- )}
76
- {...props}
77
- />
78
- );
79
- }
80
-
81
- function AlertDialogMedia({ className, ...props }: React.ComponentProps<'div'>) {
82
- return (
83
- <div
84
- data-slot="alert-dialog-media"
85
- className={cn(
86
- "bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
87
- className,
88
- )}
89
- {...props}
90
- />
91
- );
92
- }
93
-
94
- function AlertDialogTitle({
95
- className,
96
- ...props
97
- }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
98
- return (
99
- <AlertDialogPrimitive.Title
100
- data-slot="alert-dialog-title"
101
- className={cn(
102
- 'text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',
103
- className,
104
- )}
105
- {...props}
106
- />
107
- );
108
- }
109
-
110
- function AlertDialogDescription({
111
- className,
112
- ...props
113
- }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
114
- return (
115
- <AlertDialogPrimitive.Description
116
- data-slot="alert-dialog-description"
117
- className={cn(
118
- 'text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3',
119
- className,
120
- )}
121
- {...props}
122
- />
123
- );
124
- }
125
-
126
- function AlertDialogAction({
127
- variant = 'default',
128
- ...props
129
- }: Omit<React.ComponentProps<typeof Button>, 'className'>) {
130
- return <Button data-slot="alert-dialog-action" variant={variant} {...props} />;
131
- }
132
-
133
- function AlertDialogCancel({
134
- variant = 'secondary',
135
- size = 'default',
136
- ...props
137
- }: Omit<AlertDialogPrimitive.Close.Props, 'className'> &
138
- Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
139
- return (
140
- <AlertDialogPrimitive.Close
141
- data-slot="alert-dialog-cancel"
142
- render={<Button variant={variant} size={size} />}
143
- {...props}
144
- />
145
- );
146
- }
147
-
148
- export {
149
- AlertDialog,
150
- AlertDialogAction,
151
- AlertDialogCancel,
152
- AlertDialogContent,
153
- AlertDialogDescription,
154
- AlertDialogFooter,
155
- AlertDialogHeader,
156
- AlertDialogMedia,
157
- AlertDialogOverlay,
158
- AlertDialogPortal,
159
- AlertDialogTitle,
160
- AlertDialogTrigger,
161
- };