@trycompai/design-system 1.0.0 → 1.0.2

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 (101) hide show
  1. package/package.json +6 -3
  2. package/src/components/atoms/badge.tsx +49 -0
  3. package/src/components/{ui → atoms}/button.tsx +6 -1
  4. package/src/components/{ui → atoms}/checkbox.tsx +3 -3
  5. package/src/components/{ui → atoms}/heading.tsx +6 -6
  6. package/src/components/atoms/index.ts +21 -0
  7. package/src/components/atoms/kbd.tsx +21 -0
  8. package/src/components/atoms/logo.tsx +52 -0
  9. package/src/components/{ui → atoms}/slider.tsx +4 -4
  10. package/src/components/{ui → atoms}/spinner.tsx +3 -3
  11. package/src/components/atoms/stack.tsx +97 -0
  12. package/src/components/{ui → atoms}/switch.tsx +1 -1
  13. package/src/components/{ui → atoms}/text.tsx +5 -1
  14. package/src/components/{ui → atoms}/textarea.tsx +8 -2
  15. package/src/components/{ui → atoms}/toggle.tsx +3 -6
  16. package/src/components/{ui → molecules}/accordion.tsx +3 -3
  17. package/src/components/molecules/ai-chat.tsx +217 -0
  18. package/src/components/{ui → molecules}/alert.tsx +5 -5
  19. package/src/components/{ui → molecules}/breadcrumb.tsx +9 -8
  20. package/src/components/{ui → molecules}/card.tsx +24 -5
  21. package/src/components/molecules/command-search.tsx +147 -0
  22. package/src/components/molecules/empty.tsx +82 -0
  23. package/src/components/{ui → molecules}/field.tsx +16 -37
  24. package/src/components/{ui → molecules}/hover-card.tsx +2 -8
  25. package/src/components/molecules/index.ts +29 -0
  26. package/src/components/{ui → molecules}/input-group.tsx +1 -1
  27. package/src/components/molecules/input-otp.tsx +70 -0
  28. package/src/components/{ui → molecules}/item.tsx +18 -36
  29. package/src/components/molecules/page-header.tsx +80 -0
  30. package/src/components/{ui → molecules}/pagination.tsx +14 -23
  31. package/src/components/{ui → molecules}/popover.tsx +4 -2
  32. package/src/components/molecules/radio-group.tsx +33 -0
  33. package/src/components/{ui → molecules}/scroll-area.tsx +8 -11
  34. package/src/components/{ui → molecules}/section.tsx +3 -3
  35. package/src/components/{ui → molecules}/select.tsx +22 -10
  36. package/src/components/molecules/settings.tsx +169 -0
  37. package/src/components/{ui → molecules}/table.tsx +16 -3
  38. package/src/components/molecules/tabs.tsx +70 -0
  39. package/src/components/molecules/theme-switcher.tsx +176 -0
  40. package/src/components/{ui → molecules}/toggle-group.tsx +1 -1
  41. package/src/components/organisms/alert-dialog.tsx +135 -0
  42. package/src/components/organisms/app-shell.tsx +822 -0
  43. package/src/components/{ui → organisms}/calendar.tsx +6 -7
  44. package/src/components/{ui → organisms}/carousel.tsx +9 -11
  45. package/src/components/{ui → organisms}/chart.tsx +9 -24
  46. package/src/components/{ui → organisms}/combobox.tsx +7 -7
  47. package/src/components/{ui → organisms}/command.tsx +3 -3
  48. package/src/components/{ui → organisms}/context-menu.tsx +23 -53
  49. package/src/components/{ui → organisms}/dialog.tsx +3 -3
  50. package/src/components/{ui → organisms}/dropdown-menu.tsx +8 -6
  51. package/src/components/organisms/index.ts +17 -0
  52. package/src/components/{ui → organisms}/menubar.tsx +3 -3
  53. package/src/components/organisms/navigation-menu.tsx +137 -0
  54. package/src/components/organisms/page-layout.tsx +95 -0
  55. package/src/components/{ui → organisms}/sheet.tsx +7 -7
  56. package/src/components/{ui → organisms}/sidebar.tsx +61 -86
  57. package/src/components/organisms/sonner.tsx +41 -0
  58. package/src/components/ui/index.ts +3 -61
  59. package/src/fonts/TWKLausanne/TWKLausanne-300-Italic.woff +0 -0
  60. package/src/fonts/TWKLausanne/TWKLausanne-300-Italic.woff2 +0 -0
  61. package/src/fonts/TWKLausanne/TWKLausanne-300.woff +0 -0
  62. package/src/fonts/TWKLausanne/TWKLausanne-300.woff2 +0 -0
  63. package/src/fonts/TWKLausanne/TWKLausanne-350-Italic.woff +0 -0
  64. package/src/fonts/TWKLausanne/TWKLausanne-350-Italic.woff2 +0 -0
  65. package/src/fonts/TWKLausanne/TWKLausanne-350.woff +0 -0
  66. package/src/fonts/TWKLausanne/TWKLausanne-350.woff2 +0 -0
  67. package/src/fonts/TWKLausanne/TWKLausanne-400-Italic.woff +0 -0
  68. package/src/fonts/TWKLausanne/TWKLausanne-400-Italic.woff2 +0 -0
  69. package/src/fonts/TWKLausanne/TWKLausanne-400.woff +0 -0
  70. package/src/fonts/TWKLausanne/TWKLausanne-400.woff2 +0 -0
  71. package/src/fonts/TWKLausanne/TWKLausanne-700-Italic.woff +0 -0
  72. package/src/fonts/TWKLausanne/TWKLausanne-700-Italic.woff2 +0 -0
  73. package/src/fonts/TWKLausanne/TWKLausanne-700.woff +0 -0
  74. package/src/fonts/TWKLausanne/TWKLausanne-700.woff2 +0 -0
  75. package/src/styles/globals.css +167 -23
  76. package/src/components/ui/alert-dialog.tsx +0 -161
  77. package/src/components/ui/badge.tsx +0 -48
  78. package/src/components/ui/empty.tsx +0 -94
  79. package/src/components/ui/input-otp.tsx +0 -84
  80. package/src/components/ui/kbd.tsx +0 -26
  81. package/src/components/ui/navigation-menu.tsx +0 -147
  82. package/src/components/ui/page-header.tsx +0 -51
  83. package/src/components/ui/page-layout.tsx +0 -65
  84. package/src/components/ui/radio-group.tsx +0 -37
  85. package/src/components/ui/sonner.tsx +0 -43
  86. package/src/components/ui/stack.tsx +0 -72
  87. package/src/components/ui/tabs.tsx +0 -69
  88. /package/src/components/{ui → atoms}/aspect-ratio.tsx +0 -0
  89. /package/src/components/{ui → atoms}/avatar.tsx +0 -0
  90. /package/src/components/{ui → atoms}/container.tsx +0 -0
  91. /package/src/components/{ui → atoms}/input.tsx +0 -0
  92. /package/src/components/{ui → atoms}/label.tsx +0 -0
  93. /package/src/components/{ui → atoms}/progress.tsx +0 -0
  94. /package/src/components/{ui → atoms}/separator.tsx +0 -0
  95. /package/src/components/{ui → atoms}/skeleton.tsx +0 -0
  96. /package/src/components/{ui → molecules}/button-group.tsx +0 -0
  97. /package/src/components/{ui → molecules}/collapsible.tsx +0 -0
  98. /package/src/components/{ui → molecules}/grid.tsx +0 -0
  99. /package/src/components/{ui → molecules}/resizable.tsx +0 -0
  100. /package/src/components/{ui → molecules}/tooltip.tsx +0 -0
  101. /package/src/components/{ui → organisms}/drawer.tsx +0 -0
@@ -7,12 +7,12 @@ import { useRender } from '@base-ui/react/use-render';
7
7
  import { cva, type VariantProps } from 'class-variance-authority';
8
8
  import * as React from 'react';
9
9
 
10
- import { PanelLeftIcon } from 'lucide-react';
10
+ import { SidePanelOpen } from '@carbon/icons-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}
@@ -211,7 +203,7 @@ function Sidebar({
211
203
 
212
204
  return (
213
205
  <div
214
- className="group peer text-sidebar-foreground hidden md:block"
206
+ className="group peer text-sidebar-foreground hidden w-fit md:block"
215
207
  data-state={state}
216
208
  data-collapsible={state === 'collapsed' ? collapsible : ''}
217
209
  data-variant={variant}
@@ -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
  >
@@ -271,13 +262,13 @@ function SidebarTrigger({ onClick, ...props }: Omit<ButtonPrimitive.Props, 'clas
271
262
  }}
272
263
  {...props}
273
264
  >
274
- <PanelLeftIcon />
265
+ <SidePanelOpen />
275
266
  <span className="sr-only">Toggle Sidebar</span>
276
267
  </ButtonPrimitive>
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,53 @@ 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
+ const sidebarGroupVariants = cva('relative flex w-full min-w-0 flex-col', {
354
+ variants: {
355
+ padding: {
356
+ default: 'p-2',
357
+ none: 'p-0',
358
+ },
359
+ },
360
+ defaultVariants: {
361
+ padding: 'default',
362
+ },
363
+ });
364
+
365
+ function SidebarGroup({
366
+ padding = 'default',
367
+ ...props
368
+ }: Omit<React.ComponentProps<'div'>, 'className'> & VariantProps<typeof sidebarGroupVariants>) {
377
369
  return (
378
370
  <div
379
371
  data-slot="sidebar-group"
380
372
  data-sidebar="group"
381
- className={cn('p-2 relative flex w-full min-w-0 flex-col', className)}
373
+ className={sidebarGroupVariants({ padding })}
382
374
  {...props}
383
375
  />
384
376
  );
385
377
  }
386
378
 
387
379
  function SidebarGroupLabel({
388
- className,
389
380
  render,
390
381
  ...props
391
- }: useRender.ComponentProps<'div'> & React.ComponentProps<'div'>) {
382
+ }: Omit<useRender.ComponentProps<'div'>, 'className'> & Omit<React.ComponentProps<'div'>, 'className'>) {
392
383
  return useRender({
393
384
  defaultTagName: 'div',
394
385
  props: mergeProps<'div'>(
395
386
  {
396
- className: cn(
387
+ className:
397
388
  '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
389
  },
401
390
  props,
402
391
  ),
@@ -409,18 +398,15 @@ function SidebarGroupLabel({
409
398
  }
410
399
 
411
400
  function SidebarGroupAction({
412
- className,
413
401
  render,
414
402
  ...props
415
- }: useRender.ComponentProps<'button'> & React.ComponentProps<'button'>) {
403
+ }: Omit<useRender.ComponentProps<'button'>, 'className'> & Omit<React.ComponentProps<'button'>, 'className'>) {
416
404
  return useRender({
417
405
  defaultTagName: 'button',
418
406
  props: mergeProps<'button'>(
419
407
  {
420
- className: cn(
408
+ className:
421
409
  '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
410
  },
425
411
  props,
426
412
  ),
@@ -432,34 +418,34 @@ function SidebarGroupAction({
432
418
  });
433
419
  }
434
420
 
435
- function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>) {
421
+ function SidebarGroupContent({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
436
422
  return (
437
423
  <div
438
424
  data-slot="sidebar-group-content"
439
425
  data-sidebar="group-content"
440
- className={cn('text-sm w-full', className)}
426
+ className="text-sm w-full"
441
427
  {...props}
442
428
  />
443
429
  );
444
430
  }
445
431
 
446
- function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {
432
+ function SidebarMenu({ ...props }: Omit<React.ComponentProps<'ul'>, 'className'>) {
447
433
  return (
448
434
  <ul
449
435
  data-slot="sidebar-menu"
450
436
  data-sidebar="menu"
451
- className={cn('gap-1 flex w-full min-w-0 flex-col', className)}
437
+ className="gap-1 flex w-full min-w-0 flex-col"
452
438
  {...props}
453
439
  />
454
440
  );
455
441
  }
456
442
 
457
- function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {
443
+ function SidebarMenuItem({ ...props }: Omit<React.ComponentProps<'li'>, 'className'>) {
458
444
  return (
459
445
  <li
460
446
  data-slot="sidebar-menu-item"
461
447
  data-sidebar="menu-item"
462
- className={cn('group/menu-item relative', className)}
448
+ className="group/menu-item relative"
463
449
  {...props}
464
450
  />
465
451
  );
@@ -493,10 +479,9 @@ function SidebarMenuButton({
493
479
  variant = 'default',
494
480
  size = 'default',
495
481
  tooltip,
496
- className,
497
482
  ...props
498
- }: useRender.ComponentProps<'button'> &
499
- React.ComponentProps<'button'> & {
483
+ }: Omit<useRender.ComponentProps<'button'>, 'className'> &
484
+ Omit<React.ComponentProps<'button'>, 'className'> & {
500
485
  isActive?: boolean;
501
486
  tooltip?: string | React.ComponentProps<typeof TooltipContent>;
502
487
  } & VariantProps<typeof sidebarMenuButtonVariants>) {
@@ -505,7 +490,7 @@ function SidebarMenuButton({
505
490
  defaultTagName: 'button',
506
491
  props: mergeProps<'button'>(
507
492
  {
508
- className: cn(sidebarMenuButtonVariants({ variant, size }), className),
493
+ className: sidebarMenuButtonVariants({ variant, size }),
509
494
  },
510
495
  props,
511
496
  ),
@@ -542,12 +527,11 @@ function SidebarMenuButton({
542
527
  }
543
528
 
544
529
  function SidebarMenuAction({
545
- className,
546
530
  render,
547
531
  showOnHover = false,
548
532
  ...props
549
- }: useRender.ComponentProps<'button'> &
550
- React.ComponentProps<'button'> & {
533
+ }: Omit<useRender.ComponentProps<'button'>, 'className'> &
534
+ Omit<React.ComponentProps<'button'>, 'className'> & {
551
535
  showOnHover?: boolean;
552
536
  }) {
553
537
  return useRender({
@@ -558,7 +542,6 @@ function SidebarMenuAction({
558
542
  '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
543
  showOnHover &&
560
544
  '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
545
  ),
563
546
  },
564
547
  props,
@@ -571,15 +554,12 @@ function SidebarMenuAction({
571
554
  });
572
555
  }
573
556
 
574
- function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>) {
557
+ function SidebarMenuBadge({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
575
558
  return (
576
559
  <div
577
560
  data-slot="sidebar-menu-badge"
578
561
  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
- )}
562
+ 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 items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden"
583
563
  {...props}
584
564
  />
585
565
  );
@@ -622,26 +602,23 @@ function SidebarMenuSkeleton({
622
602
  );
623
603
  }
624
604
 
625
- function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {
605
+ function SidebarMenuSub({ ...props }: Omit<React.ComponentProps<'ul'>, 'className'>) {
626
606
  return (
627
607
  <ul
628
608
  data-slot="sidebar-menu-sub"
629
609
  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
- )}
610
+ 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
611
  {...props}
635
612
  />
636
613
  );
637
614
  }
638
615
 
639
- function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>) {
616
+ function SidebarMenuSubItem({ ...props }: Omit<React.ComponentProps<'li'>, 'className'>) {
640
617
  return (
641
618
  <li
642
619
  data-slot="sidebar-menu-sub-item"
643
620
  data-sidebar="menu-sub-item"
644
- className={cn('group/menu-sub-item relative', className)}
621
+ className="group/menu-sub-item relative"
645
622
  {...props}
646
623
  />
647
624
  );
@@ -651,10 +628,9 @@ function SidebarMenuSubButton({
651
628
  render,
652
629
  size = 'md',
653
630
  isActive = false,
654
- className,
655
631
  ...props
656
- }: useRender.ComponentProps<'a'> &
657
- React.ComponentProps<'a'> & {
632
+ }: Omit<useRender.ComponentProps<'a'>, 'className'> &
633
+ Omit<React.ComponentProps<'a'>, 'className'> & {
658
634
  size?: 'sm' | 'md';
659
635
  isActive?: boolean;
660
636
  }) {
@@ -662,10 +638,8 @@ function SidebarMenuSubButton({
662
638
  defaultTagName: 'a',
663
639
  props: mergeProps<'a'>(
664
640
  {
665
- className: cn(
641
+ className:
666
642
  '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
643
  },
670
644
  props,
671
645
  ),
@@ -684,6 +658,7 @@ export {
684
658
  SidebarContent,
685
659
  SidebarFooter,
686
660
  SidebarGroup,
661
+ sidebarGroupVariants,
687
662
  SidebarGroupAction,
688
663
  SidebarGroupContent,
689
664
  SidebarGroupLabel,
@@ -0,0 +1,41 @@
1
+ import {
2
+ CheckmarkFilled,
3
+ Information,
4
+ Misuse,
5
+ Renew,
6
+ Warning,
7
+ } from '@carbon/icons-react';
8
+ import { Toaster as Sonner, type ToasterProps } from 'sonner';
9
+
10
+ const Toaster = ({ theme = 'system', ...props }: ToasterProps) => {
11
+ return (
12
+ <Sonner
13
+ theme={theme}
14
+ className="toaster group"
15
+ icons={{
16
+ success: <CheckmarkFilled className="size-4 text-success" />,
17
+ info: <Information className="size-4 text-info" />,
18
+ warning: <Warning className="size-4 text-warning" />,
19
+ error: <Misuse className="size-4 text-destructive" />,
20
+ loading: <Renew className="size-4 animate-spin" />,
21
+ }}
22
+ style={
23
+ {
24
+ '--normal-bg': 'var(--popover)',
25
+ '--normal-text': 'var(--popover-foreground)',
26
+ '--normal-border': 'var(--border)',
27
+ '--border-radius': 'var(--radius)',
28
+ } as React.CSSProperties
29
+ }
30
+ toastOptions={{
31
+ classNames: {
32
+ toast: 'cn-toast',
33
+ description: '!text-muted-foreground',
34
+ },
35
+ }}
36
+ {...props}
37
+ />
38
+ );
39
+ };
40
+
41
+ export { Toaster };
@@ -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';