@health-samurai/react-components 0.0.0-alpha.4 → 0.0.0-alpha.5

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 (239) hide show
  1. package/dist/bundle.css +687 -446
  2. package/dist/src/components/code-editor/http/grammar/http.d.ts +3 -0
  3. package/dist/src/components/code-editor/http/grammar/http.d.ts.map +1 -0
  4. package/dist/src/components/code-editor/http/grammar/http.grammar +74 -0
  5. package/dist/src/components/code-editor/http/grammar/http.js +38 -0
  6. package/dist/src/components/code-editor/http/grammar/http.js.map +1 -0
  7. package/dist/src/components/code-editor/http/grammar/http.terms.d.ts +2 -0
  8. package/dist/src/components/code-editor/http/grammar/http.terms.d.ts.map +1 -0
  9. package/dist/src/components/code-editor/http/grammar/http.terms.js +4 -0
  10. package/dist/src/components/code-editor/http/grammar/http.terms.js.map +1 -0
  11. package/dist/src/components/code-editor/http/grammar/http.test.d.ts +2 -0
  12. package/dist/src/components/code-editor/http/grammar/http.test.d.ts.map +1 -0
  13. package/dist/src/components/code-editor/http/grammar/http.test.js +80 -0
  14. package/dist/src/components/code-editor/http/grammar/http.test.js.map +1 -0
  15. package/dist/src/components/code-editor/http/index.d.ts +4 -0
  16. package/dist/src/components/code-editor/http/index.d.ts.map +1 -0
  17. package/dist/src/components/code-editor/http/index.js +66 -0
  18. package/dist/src/components/code-editor/http/index.js.map +1 -0
  19. package/dist/src/components/code-editor/index.d.ts +13 -2
  20. package/dist/src/components/code-editor/index.d.ts.map +1 -1
  21. package/dist/src/components/code-editor/index.js +161 -20
  22. package/dist/src/components/code-editor/index.js.map +1 -1
  23. package/dist/src/components/code-editor.stories.js +3 -1
  24. package/dist/src/components/code-editor.stories.js.map +1 -1
  25. package/dist/src/components/request-line-editor.d.ts +11 -35
  26. package/dist/src/components/request-line-editor.d.ts.map +1 -1
  27. package/dist/src/components/request-line-editor.js +51 -49
  28. package/dist/src/components/request-line-editor.js.map +1 -1
  29. package/dist/src/components/request-line-editor.stories.d.ts.map +1 -1
  30. package/dist/src/components/request-line-editor.stories.js +17 -53
  31. package/dist/src/components/request-line-editor.stories.js.map +1 -1
  32. package/dist/src/components/tree-view.d.ts +16 -0
  33. package/dist/src/components/tree-view.d.ts.map +1 -0
  34. package/dist/src/components/tree-view.js +67 -0
  35. package/dist/src/components/tree-view.js.map +1 -0
  36. package/dist/src/components/tree-view.stories.d.ts +13 -0
  37. package/dist/src/components/tree-view.stories.d.ts.map +1 -0
  38. package/dist/src/components/tree-view.stories.js +274 -0
  39. package/dist/src/components/tree-view.stories.js.map +1 -0
  40. package/dist/src/icons.d.ts +3 -0
  41. package/dist/src/icons.d.ts.map +1 -0
  42. package/dist/src/icons.js +47 -0
  43. package/dist/src/icons.js.map +1 -0
  44. package/dist/src/index.css +42 -3
  45. package/dist/src/index.d.ts +1 -1
  46. package/dist/src/index.d.ts.map +1 -1
  47. package/dist/src/index.js +1 -1
  48. package/dist/src/index.js.map +1 -1
  49. package/dist/src/shadcn/components/ui/accordion.d.ts.map +1 -1
  50. package/dist/src/shadcn/components/ui/accordion.js +23 -5
  51. package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
  52. package/dist/src/shadcn/components/ui/alert.d.ts.map +1 -1
  53. package/dist/src/shadcn/components/ui/alert.js +12 -5
  54. package/dist/src/shadcn/components/ui/alert.js.map +1 -1
  55. package/dist/src/shadcn/components/ui/avatar.d.ts.map +1 -1
  56. package/dist/src/shadcn/components/ui/avatar.js +4 -3
  57. package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
  58. package/dist/src/shadcn/components/ui/badge.d.ts.map +1 -1
  59. package/dist/src/shadcn/components/ui/badge.js +16 -5
  60. package/dist/src/shadcn/components/ui/badge.js.map +1 -1
  61. package/dist/src/shadcn/components/ui/breadcrumb.d.ts.map +1 -1
  62. package/dist/src/shadcn/components/ui/breadcrumb.js +6 -6
  63. package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
  64. package/dist/src/shadcn/components/ui/button.d.ts.map +1 -1
  65. package/dist/src/shadcn/components/ui/button.js +19 -11
  66. package/dist/src/shadcn/components/ui/button.js.map +1 -1
  67. package/dist/src/shadcn/components/ui/card.d.ts.map +1 -1
  68. package/dist/src/shadcn/components/ui/card.js +14 -6
  69. package/dist/src/shadcn/components/ui/card.js.map +1 -1
  70. package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
  71. package/dist/src/shadcn/components/ui/checkbox.js +20 -5
  72. package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
  73. package/dist/src/shadcn/components/ui/checkbox.stories.d.ts.map +1 -1
  74. package/dist/src/shadcn/components/ui/checkbox.stories.js +44 -35
  75. package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
  76. package/dist/src/shadcn/components/ui/combobox.d.ts +18 -0
  77. package/dist/src/shadcn/components/ui/combobox.d.ts.map +1 -0
  78. package/dist/src/shadcn/components/ui/combobox.js +121 -0
  79. package/dist/src/shadcn/components/ui/combobox.js.map +1 -0
  80. package/dist/src/shadcn/components/ui/combobox.stories.d.ts +11 -0
  81. package/dist/src/shadcn/components/ui/combobox.stories.d.ts.map +1 -0
  82. package/dist/src/shadcn/components/ui/combobox.stories.js +16 -0
  83. package/dist/src/shadcn/components/ui/combobox.stories.js.map +1 -0
  84. package/dist/src/shadcn/components/ui/command.d.ts.map +1 -1
  85. package/dist/src/shadcn/components/ui/command.js +73 -12
  86. package/dist/src/shadcn/components/ui/command.js.map +1 -1
  87. package/dist/src/shadcn/components/ui/command.stories.js +0 -1
  88. package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
  89. package/dist/src/shadcn/components/ui/dialog.d.ts.map +1 -1
  90. package/dist/src/shadcn/components/ui/dialog.js +35 -7
  91. package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
  92. package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
  93. package/dist/src/shadcn/components/ui/drawer.js +26 -5
  94. package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
  95. package/dist/src/shadcn/components/ui/dropdown-menu.d.ts.map +1 -1
  96. package/dist/src/shadcn/components/ui/dropdown-menu.js +12 -1
  97. package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
  98. package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
  99. package/dist/src/shadcn/components/ui/form.js +12 -4
  100. package/dist/src/shadcn/components/ui/form.js.map +1 -1
  101. package/dist/src/shadcn/components/ui/input.d.ts.map +1 -1
  102. package/dist/src/shadcn/components/ui/input.js +87 -16
  103. package/dist/src/shadcn/components/ui/input.js.map +1 -1
  104. package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
  105. package/dist/src/shadcn/components/ui/label.js +8 -1
  106. package/dist/src/shadcn/components/ui/label.js.map +1 -1
  107. package/dist/src/shadcn/components/ui/menubar.d.ts.map +1 -1
  108. package/dist/src/shadcn/components/ui/menubar.js +35 -13
  109. package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
  110. package/dist/src/shadcn/components/ui/pagination.d.ts.map +1 -1
  111. package/dist/src/shadcn/components/ui/pagination.js +6 -6
  112. package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
  113. package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
  114. package/dist/src/shadcn/components/ui/popover.js +12 -1
  115. package/dist/src/shadcn/components/ui/popover.js.map +1 -1
  116. package/dist/src/shadcn/components/ui/progress.d.ts.map +1 -1
  117. package/dist/src/shadcn/components/ui/progress.js +6 -2
  118. package/dist/src/shadcn/components/ui/progress.js.map +1 -1
  119. package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
  120. package/dist/src/shadcn/components/ui/radio-group.js +11 -6
  121. package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
  122. package/dist/src/shadcn/components/ui/radio-group.stories.d.ts.map +1 -1
  123. package/dist/src/shadcn/components/ui/radio-group.stories.js +57 -34
  124. package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
  125. package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
  126. package/dist/src/shadcn/components/ui/scroll-area.js +9 -3
  127. package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
  128. package/dist/src/shadcn/components/ui/select.d.ts.map +1 -1
  129. package/dist/src/shadcn/components/ui/select.js +49 -14
  130. package/dist/src/shadcn/components/ui/select.js.map +1 -1
  131. package/dist/src/shadcn/components/ui/select.stories.d.ts.map +1 -1
  132. package/dist/src/shadcn/components/ui/select.stories.js +1 -4
  133. package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
  134. package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
  135. package/dist/src/shadcn/components/ui/separator.js +7 -1
  136. package/dist/src/shadcn/components/ui/separator.js.map +1 -1
  137. package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
  138. package/dist/src/shadcn/components/ui/sidebar.js +20 -6
  139. package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
  140. package/dist/src/shadcn/components/ui/skeleton.d.ts.map +1 -1
  141. package/dist/src/shadcn/components/ui/skeleton.js +3 -1
  142. package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
  143. package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
  144. package/dist/src/shadcn/components/ui/slider.js +34 -4
  145. package/dist/src/shadcn/components/ui/slider.js.map +1 -1
  146. package/dist/src/shadcn/components/ui/sonner.d.ts +16 -1
  147. package/dist/src/shadcn/components/ui/sonner.d.ts.map +1 -1
  148. package/dist/src/shadcn/components/ui/sonner.js +23 -3
  149. package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
  150. package/dist/src/shadcn/components/ui/sonner.stories.d.ts.map +1 -1
  151. package/dist/src/shadcn/components/ui/sonner.stories.js +19 -11
  152. package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
  153. package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
  154. package/dist/src/shadcn/components/ui/switch.js +18 -2
  155. package/dist/src/shadcn/components/ui/switch.js.map +1 -1
  156. package/dist/src/shadcn/components/ui/table.d.ts.map +1 -1
  157. package/dist/src/shadcn/components/ui/table.js +12 -8
  158. package/dist/src/shadcn/components/ui/table.js.map +1 -1
  159. package/dist/src/shadcn/components/ui/tabs.d.ts +21 -3
  160. package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
  161. package/dist/src/shadcn/components/ui/tabs.js +314 -9
  162. package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
  163. package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -1
  164. package/dist/src/shadcn/components/ui/tabs.stories.js +50 -1
  165. package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
  166. package/dist/src/shadcn/components/ui/textarea.d.ts.map +1 -1
  167. package/dist/src/shadcn/components/ui/textarea.js +15 -1
  168. package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
  169. package/dist/src/shadcn/components/ui/toggle-group.d.ts.map +1 -1
  170. package/dist/src/shadcn/components/ui/toggle-group.js +6 -2
  171. package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
  172. package/dist/src/shadcn/components/ui/toggle.d.ts.map +1 -1
  173. package/dist/src/shadcn/components/ui/toggle.js +18 -6
  174. package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
  175. package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
  176. package/dist/src/shadcn/components/ui/tooltip.js +11 -1
  177. package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
  178. package/dist/src/shadcn/components/ui/tree.d.ts +20 -0
  179. package/dist/src/shadcn/components/ui/tree.d.ts.map +1 -0
  180. package/dist/src/shadcn/components/ui/tree.js +111 -0
  181. package/dist/src/shadcn/components/ui/tree.js.map +1 -0
  182. package/package.json +9 -2
  183. package/src/components/code-editor/http/grammar/http.grammar +74 -0
  184. package/src/components/code-editor/http/grammar/http.terms.ts +9 -0
  185. package/src/components/code-editor/http/grammar/http.test.ts +110 -0
  186. package/src/components/code-editor/http/grammar/http.ts +21 -0
  187. package/src/components/code-editor/http/index.ts +87 -0
  188. package/src/components/code-editor/index.tsx +182 -21
  189. package/src/components/code-editor.stories.tsx +1 -1
  190. package/src/components/request-line-editor.stories.tsx +17 -27
  191. package/src/components/request-line-editor.tsx +72 -61
  192. package/src/components/tree-view.stories.tsx +260 -0
  193. package/src/components/tree-view.tsx +101 -0
  194. package/src/icons.tsx +45 -0
  195. package/src/index.css +42 -3
  196. package/src/index.tsx +1 -1
  197. package/src/shadcn/components/ui/accordion.tsx +66 -8
  198. package/src/shadcn/components/ui/alert.tsx +53 -15
  199. package/src/shadcn/components/ui/avatar.tsx +17 -6
  200. package/src/shadcn/components/ui/badge.tsx +67 -18
  201. package/src/shadcn/components/ui/breadcrumb.tsx +35 -7
  202. package/src/shadcn/components/ui/button.tsx +118 -57
  203. package/src/shadcn/components/ui/card.tsx +44 -13
  204. package/src/shadcn/components/ui/checkbox.stories.tsx +20 -24
  205. package/src/shadcn/components/ui/checkbox.tsx +45 -4
  206. package/src/shadcn/components/ui/combobox.stories.tsx +19 -0
  207. package/src/shadcn/components/ui/combobox.tsx +142 -0
  208. package/src/shadcn/components/ui/command.stories.tsx +1 -1
  209. package/src/shadcn/components/ui/command.tsx +192 -36
  210. package/src/shadcn/components/ui/dialog.tsx +101 -13
  211. package/src/shadcn/components/ui/drawer.tsx +93 -18
  212. package/src/shadcn/components/ui/dropdown-menu.tsx +38 -9
  213. package/src/shadcn/components/ui/form.tsx +16 -4
  214. package/src/shadcn/components/ui/input.tsx +281 -29
  215. package/src/shadcn/components/ui/label.tsx +21 -4
  216. package/src/shadcn/components/ui/menubar.tsx +188 -43
  217. package/src/shadcn/components/ui/pagination.tsx +12 -6
  218. package/src/shadcn/components/ui/popover.tsx +35 -4
  219. package/src/shadcn/components/ui/progress.tsx +21 -5
  220. package/src/shadcn/components/ui/radio-group.stories.tsx +22 -14
  221. package/src/shadcn/components/ui/radio-group.tsx +42 -5
  222. package/src/shadcn/components/ui/scroll-area.tsx +33 -5
  223. package/src/shadcn/components/ui/select.stories.tsx +0 -2
  224. package/src/shadcn/components/ui/select.tsx +184 -33
  225. package/src/shadcn/components/ui/separator.tsx +15 -5
  226. package/src/shadcn/components/ui/sidebar.tsx +68 -26
  227. package/src/shadcn/components/ui/skeleton.tsx +4 -1
  228. package/src/shadcn/components/ui/slider.tsx +82 -11
  229. package/src/shadcn/components/ui/sonner.stories.tsx +19 -15
  230. package/src/shadcn/components/ui/sonner.tsx +53 -3
  231. package/src/shadcn/components/ui/switch.tsx +53 -7
  232. package/src/shadcn/components/ui/table.tsx +38 -11
  233. package/src/shadcn/components/ui/tabs.stories.tsx +32 -0
  234. package/src/shadcn/components/ui/tabs.tsx +455 -17
  235. package/src/shadcn/components/ui/textarea.tsx +42 -4
  236. package/src/shadcn/components/ui/toggle-group.tsx +27 -5
  237. package/src/shadcn/components/ui/toggle.tsx +59 -18
  238. package/src/shadcn/components/ui/tooltip.tsx +33 -8
  239. package/src/shadcn/components/ui/tree.tsx +200 -0
@@ -477,35 +477,77 @@ function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
477
477
  );
478
478
  }
479
479
 
480
- const sidebarMenuButtonVariants = cva(
481
- cn(
482
- "typo-body text-text-secondary flex items-center gap-2 overflow-hidden rounded-lg py-2 px-[0.44rem] outline-hidden ",
483
- "ring-sidebar-ring transition-all focus-visible:ring-2 active:bg-bg-quaternary disabled:pointer-events-none",
484
- "disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50",
485
- "data-[active=true]:bg-bg-brand-secondary data-[active=true]:text-text-primary data-[state=open]:hover:bg-sidebar-accent",
486
- "data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:py-2! group-data-[collapsible=icon]:px-[0.44rem]!",
487
- "[&>span:last-child]:truncate [&>svg]:size-5 [&>svg]:shrink-0 hover:bg-bg-secondary hover:text-text-primary",
488
- "data-[active=true]:[&>svg]:text-text-brand-primary w-full",
489
- ),
490
- {
491
- variants: {
492
- variant: {
493
- default: "",
494
- outline:
495
- "shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
496
- },
497
- size: {
498
- default: "",
499
- sm: "",
500
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
501
- },
480
+ // Base sidebar menu button styles
481
+ const baseSidebarMenuButtonStyles = cn(
482
+ // Layout
483
+ "flex",
484
+ "items-center",
485
+ "gap-2",
486
+ "w-full",
487
+ "overflow-hidden",
488
+ // Shape
489
+ "rounded-lg",
490
+ // Spacing
491
+ "py-2",
492
+ "px-[0.44rem]",
493
+ // Typography
494
+ "typo-body",
495
+ "text-text-secondary",
496
+ // Interaction
497
+ "outline-hidden",
498
+ "transition-all",
499
+ "cursor-pointer",
500
+ // Focus
501
+ "focus-visible:ring-2",
502
+ "focus-visible:ring-utility-blue/70",
503
+ // Hover
504
+ "hover:bg-bg-secondary",
505
+ "hover:text-text-primary",
506
+ // Active
507
+ "active:bg-bg-quaternary",
508
+ "data-[active=true]:bg-bg-brand-secondary",
509
+ "data-[active=true]:text-text-primary",
510
+ "data-[active=true]:[&>svg]:text-text-brand-primary",
511
+ // Open state
512
+ "data-[state=open]:hover:bg-bg-secondary",
513
+ "data-[state=open]:hover:text-text-primary",
514
+ // Disabled
515
+ "disabled:pointer-events-none",
516
+ "disabled:opacity-50",
517
+ "aria-disabled:pointer-events-none",
518
+ "aria-disabled:opacity-50",
519
+ // Group styles
520
+ "group-has-data-[sidebar=menu-action]/menu-item:pr-8",
521
+ "group-data-[collapsible=icon]:py-2!",
522
+ "group-data-[collapsible=icon]:px-[0.44rem]!",
523
+ // Content styles
524
+ "[&>span:last-child]:truncate",
525
+ "[&>svg]:size-5",
526
+ "[&>svg]:shrink-0",
527
+ );
528
+
529
+ const sidebarMenuButtonVariants = cva(baseSidebarMenuButtonStyles, {
530
+ variants: {
531
+ variant: {
532
+ default: cn(""),
533
+ outline: cn(
534
+ "shadow-[0_0_0_1px_hsl(var(--sidebar-border))]",
535
+ "hover:bg-bg-secondary",
536
+ "hover:text-text-primary",
537
+ "hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
538
+ ),
502
539
  },
503
- defaultVariants: {
504
- variant: "default",
505
- size: "default",
540
+ size: {
541
+ default: cn(""),
542
+ sm: cn(""),
543
+ lg: cn("h-12", "text-sm", "group-data-[collapsible=icon]:p-0!"),
506
544
  },
507
545
  },
508
- );
546
+ defaultVariants: {
547
+ variant: "default",
548
+ size: "default",
549
+ },
550
+ });
509
551
 
510
552
  function SidebarMenuButton({
511
553
  asChild = false,
@@ -1,10 +1,13 @@
1
1
  import { cn } from "#shadcn/lib/utils";
2
2
 
3
+ // Skeleton styles
4
+ const skeletonStyles = cn("bg-bg-tertiary", "animate-pulse", "rounded-md");
5
+
3
6
  function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
7
  return (
5
8
  <div
6
9
  data-slot="skeleton"
7
- className={cn("bg-accent animate-pulse rounded-md", className)}
10
+ className={cn(skeletonStyles, className)}
8
11
  {...props}
9
12
  />
10
13
  );
@@ -4,6 +4,84 @@ import * as React from "react";
4
4
 
5
5
  import { cn } from "#shadcn/lib/utils";
6
6
 
7
+ // Slider root styles
8
+ const sliderRootStyles = cn(
9
+ // Layout
10
+ "relative",
11
+ "flex",
12
+ "w-full",
13
+ "items-center",
14
+ // Interaction
15
+ "touch-none",
16
+ "select-none",
17
+ // Disabled
18
+ "data-[disabled]:opacity-50",
19
+ // Vertical orientation
20
+ "data-[orientation=vertical]:h-full",
21
+ "data-[orientation=vertical]:min-h-44",
22
+ "data-[orientation=vertical]:w-auto",
23
+ "data-[orientation=vertical]:flex-col",
24
+ );
25
+
26
+ // Slider track styles
27
+ const sliderTrackStyles = cn(
28
+ // Background
29
+ "bg-bg-quaternary",
30
+ // Layout
31
+ "relative",
32
+ "grow",
33
+ "overflow-hidden",
34
+ // Shape
35
+ "rounded-full",
36
+ // Horizontal orientation
37
+ "data-[orientation=horizontal]:h-1.5",
38
+ "data-[orientation=horizontal]:w-full",
39
+ // Vertical orientation
40
+ "data-[orientation=vertical]:h-full",
41
+ "data-[orientation=vertical]:w-1.5",
42
+ );
43
+
44
+ // Slider range styles
45
+ const sliderRangeStyles = cn(
46
+ // Background
47
+ "bg-bg-link",
48
+ // Layout
49
+ "absolute",
50
+ // Horizontal orientation
51
+ "data-[orientation=horizontal]:h-full",
52
+ // Vertical orientation
53
+ "data-[orientation=vertical]:w-full",
54
+ );
55
+
56
+ // Slider thumb styles
57
+ const sliderThumbStyles = cn(
58
+ // Layout
59
+ "block",
60
+ "size-4",
61
+ "shrink-0",
62
+ // Shape
63
+ "rounded-full",
64
+ // Borders
65
+ "border",
66
+ "border-border-link",
67
+ // Background
68
+ "bg-bg-primary",
69
+ // Shadow
70
+ "shadow-sm",
71
+ // Transitions
72
+ "transition-[color,box-shadow]",
73
+ // Hover
74
+ "hover:ring-4",
75
+ "hover:ring-utility-blue/70",
76
+ // Focus
77
+ "focus-visible:ring-4",
78
+ "focus-visible:ring-utility-blue/70",
79
+ "focus-visible:outline-hidden",
80
+ // Disabled
81
+ "disabled:pointer-events-none",
82
+ "disabled:opacity-50",
83
+ );
84
+
7
85
  function Slider({
8
86
  className,
9
87
  defaultValue,
@@ -29,23 +107,16 @@ function Slider({
29
107
  {...(value !== undefined ? { value } : {})}
30
108
  min={min}
31
109
  max={max}
32
- className={cn(
33
- "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
34
- className,
35
- )}
110
+ className={cn(sliderRootStyles, className)}
36
111
  {...props}
37
112
  >
38
113
  <SliderPrimitive.Track
39
114
  data-slot="slider-track"
40
- className={cn(
41
- "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
42
- )}
115
+ className={sliderTrackStyles}
43
116
  >
44
117
  <SliderPrimitive.Range
45
118
  data-slot="slider-range"
46
- className={cn(
47
- "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
48
- )}
119
+ className={sliderRangeStyles}
49
120
  />
50
121
  </SliderPrimitive.Track>
51
122
  {Array.from({ length: _values.length }, (_, index) => (
@@ -53,7 +124,7 @@ function Slider({
53
124
  data-slot="slider-thumb"
54
125
  // biome-ignore lint/suspicious/noArrayIndexKey: FIXME: unchanged shadcn
55
126
  key={index}
56
- className="border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
127
+ className={sliderThumbStyles}
57
128
  />
58
129
  ))}
59
130
  </SliderPrimitive.Root>
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { toast } from "sonner";
3
2
  import { Button } from "#shadcn/components/ui/button";
3
+ import { Toaster, toast } from "#shadcn/components/ui/sonner";
4
4
 
5
5
  const meta = {
6
6
  title: "Component/Sonner",
@@ -11,19 +11,23 @@ type Story = StoryObj<typeof meta>;
11
11
 
12
12
  export const Demo = {
13
13
  render: () => (
14
- <Button
15
- variant="secondary"
16
- onClick={() =>
17
- toast("Event has been created", {
18
- description: "Sunday, December 03, 2023 at 9:00 AM",
19
- action: {
20
- label: "Undo",
21
- onClick: () => console.log("Undo"),
22
- },
23
- })
24
- }
25
- >
26
- Show Toast
27
- </Button>
14
+ <div>
15
+ <Button
16
+ variant="secondary"
17
+ onClick={() =>
18
+ toast("Event has been created", {
19
+ description: "Sunday, December 03, 2023 at 9:00 AM",
20
+ action: {
21
+ label: "Undo",
22
+ variant: "primary",
23
+ onClick: () => console.log("Undo"),
24
+ },
25
+ })
26
+ }
27
+ >
28
+ Show Toast
29
+ </Button>
30
+ <Toaster position="top-center" />
31
+ </div>
28
32
  ),
29
33
  } satisfies Story;
@@ -1,12 +1,22 @@
1
+ "use client";
2
+
3
+ import type { VariantProps } from "class-variance-authority";
1
4
  import { useTheme } from "next-themes";
2
- import { Toaster as Sonner, type ToasterProps } from "sonner";
5
+ import {
6
+ Toaster as Sonner,
7
+ toast as sonnerToast,
8
+ type ToasterProps,
9
+ } from "sonner";
10
+ import { Button, type buttonVariants } from "./button";
3
11
 
4
12
  const Toaster = ({ ...props }: ToasterProps) => {
5
13
  const { theme = "system" } = useTheme();
6
14
 
7
15
  return (
8
16
  <Sonner
9
- theme={theme as ToasterProps["theme"] & {}}
17
+ theme={
18
+ theme === "system" ? "system" : theme === "dark" ? "dark" : "light"
19
+ }
10
20
  className="toaster group"
11
21
  style={
12
22
  {
@@ -20,4 +30,44 @@ const Toaster = ({ ...props }: ToasterProps) => {
20
30
  );
21
31
  };
22
32
 
23
- export { Toaster };
33
+ // Custom toast wrapper with our buttons
34
+ const toast = (
35
+ message: string,
36
+ options?: {
37
+ description?: string;
38
+ action?: {
39
+ label: string;
40
+ onClick: () => void;
41
+ variant?: VariantProps<typeof buttonVariants>["variant"];
42
+ };
43
+ cancel?: {
44
+ label: string;
45
+ onClick: () => void;
46
+ variant?: VariantProps<typeof buttonVariants>["variant"];
47
+ };
48
+ },
49
+ ) => {
50
+ return sonnerToast(message, {
51
+ ...options,
52
+ action: options?.action ? (
53
+ <Button
54
+ variant={options.action.variant || "secondary"}
55
+ size="small"
56
+ onClick={options.action.onClick}
57
+ >
58
+ {options.action.label}
59
+ </Button>
60
+ ) : undefined,
61
+ cancel: options?.cancel ? (
62
+ <Button
63
+ variant={options.cancel.variant || "ghost"}
64
+ size="small"
65
+ onClick={options.cancel.onClick}
66
+ >
67
+ {options.cancel.label}
68
+ </Button>
69
+ ) : undefined,
70
+ });
71
+ };
72
+
73
+ export { Toaster, toast };
@@ -4,6 +4,57 @@ import type * as React from "react";
4
4
 
5
5
  import { cn } from "#shadcn/lib/utils";
6
6
 
7
+ // Switch root styles
8
+ const switchRootStyles = cn(
9
+ // Layout
10
+ "peer",
11
+ "inline-flex",
12
+ "items-center",
13
+ "shrink-0",
14
+ // Size
15
+ "h-[1.15rem]",
16
+ "w-8",
17
+ // Shape
18
+ "rounded-full",
19
+ "border",
20
+ "border-transparent",
21
+ // Interaction
22
+ "transition-all",
23
+ "outline-none",
24
+ "cursor-pointer",
25
+ // States
26
+ "data-[state=unchecked]:bg-bg-quaternary",
27
+ "data-[state=checked]:bg-bg-link",
28
+ "hover:data-[state=unchecked]:bg-bg-tertiary",
29
+ "hover:data-[state=checked]:bg-bg-link_hover",
30
+ // Focus
31
+ "focus-visible:ring-2",
32
+ "focus-visible:ring-utility-blue/70",
33
+ // Disabled
34
+ "disabled:cursor-not-allowed",
35
+ "disabled:opacity-50",
36
+ "disabled:data-[state=checked]:bg-bg-disabled",
37
+ "disabled:data-[state=unchecked]:bg-bg-disabled",
38
+ );
39
+
40
+ // Switch thumb styles
41
+ const switchThumbStyles = cn(
42
+ // Layout
43
+ "pointer-events-none",
44
+ "block",
45
+ // Size
46
+ "size-4",
47
+ // Shape
48
+ "rounded-full",
49
+ "ring-0",
50
+ // Color
51
+ "bg-bg-primary",
52
+ // Animation
53
+ "transition-transform",
54
+ "data-[state=checked]:translate-x-[calc(100%-2px)]",
55
+ "data-[state=unchecked]:translate-x-0",
56
+ );
57
+
7
58
  function Switch({
8
59
  className,
9
60
  ...props
@@ -11,17 +62,12 @@ function Switch({
11
62
  return (
12
63
  <SwitchPrimitive.Root
13
64
  data-slot="switch"
14
- className={cn(
15
- "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
16
- className,
17
- )}
65
+ className={cn(switchRootStyles, className)}
18
66
  {...props}
19
67
  >
20
68
  <SwitchPrimitive.Thumb
21
69
  data-slot="switch-thumb"
22
- className={cn(
23
- "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0",
24
- )}
70
+ className={switchThumbStyles}
25
71
  />
26
72
  </SwitchPrimitive.Root>
27
73
  );
@@ -2,15 +2,18 @@ import type * as React from "react";
2
2
 
3
3
  import { cn } from "#shadcn/lib/utils";
4
4
 
5
+ // Table container styles
6
+ const tableContainerStyles = cn("relative", "w-full", "overflow-x-auto");
7
+
8
+ // Table styles
9
+ const tableStyles = cn("w-full", "caption-bottom", "text-sm");
10
+
5
11
  function Table({ className, ...props }: React.ComponentProps<"table">) {
6
12
  return (
7
- <div
8
- data-slot="table-container"
9
- className="relative w-full overflow-x-auto"
10
- >
13
+ <div data-slot="table-container" className={tableContainerStyles}>
11
14
  <table
12
15
  data-slot="table"
13
- className={cn("w-full caption-bottom text-sm", className)}
16
+ className={cn(tableStyles, className)}
14
17
  {...props}
15
18
  />
16
19
  </div>
@@ -21,7 +24,11 @@ function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
21
24
  return (
22
25
  <thead
23
26
  data-slot="table-header"
24
- className={cn("[&_tr]:border-b", className)}
27
+ className={cn(
28
+ "[&_tr]:border-b",
29
+ "[&_tr]:border-border-primary",
30
+ className,
31
+ )}
25
32
  {...props}
26
33
  />
27
34
  );
@@ -42,7 +49,11 @@ function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
42
49
  <tfoot
43
50
  data-slot="table-footer"
44
51
  className={cn(
45
- "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
52
+ "bg-bg-tertiary/50",
53
+ "border-t",
54
+ "border-border-primary",
55
+ "font-medium",
56
+ "[&>tr]:last:border-b-0",
46
57
  className,
47
58
  )}
48
59
  {...props}
@@ -55,7 +66,11 @@ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
55
66
  <tr
56
67
  data-slot="table-row"
57
68
  className={cn(
58
- "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
69
+ "hover:bg-bg-tertiary/50",
70
+ "data-[state=selected]:bg-bg-tertiary",
71
+ "border-b",
72
+ "border-border-primary",
73
+ "transition-colors",
59
74
  className,
60
75
  )}
61
76
  {...props}
@@ -68,7 +83,15 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
68
83
  <th
69
84
  data-slot="table-head"
70
85
  className={cn(
71
- "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
86
+ "text-text-primary",
87
+ "h-10",
88
+ "px-2",
89
+ "text-left",
90
+ "align-middle",
91
+ "font-medium",
92
+ "whitespace-nowrap",
93
+ "[&:has([role=checkbox])]:pr-0",
94
+ "[&>[role=checkbox]]:translate-y-[2px]",
72
95
  className,
73
96
  )}
74
97
  {...props}
@@ -81,7 +104,11 @@ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
81
104
  <td
82
105
  data-slot="table-cell"
83
106
  className={cn(
84
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
107
+ "p-2",
108
+ "align-middle",
109
+ "whitespace-nowrap",
110
+ "[&:has([role=checkbox])]:pr-0",
111
+ "[&>[role=checkbox]]:translate-y-[2px]",
85
112
  className,
86
113
  )}
87
114
  {...props}
@@ -96,7 +123,7 @@ function TableCaption({
96
123
  return (
97
124
  <caption
98
125
  data-slot="table-caption"
99
- className={cn("text-muted-foreground mt-4 text-sm", className)}
126
+ className={cn("text-text-secondary", "mt-4", "text-sm", className)}
100
127
  {...props}
101
128
  />
102
129
  );
@@ -16,6 +16,7 @@ import {
16
16
  TabsAddButton,
17
17
  TabsContent,
18
18
  TabsList,
19
+ TabsListDropdown,
19
20
  TabsTrigger,
20
21
  } from "#shadcn/components/ui/tabs";
21
22
 
@@ -144,6 +145,37 @@ export const Browser = {
144
145
  </TabsTrigger>
145
146
  </TabsList>
146
147
  <TabsAddButton onClick={BrowserTabOnAdd} />
148
+ <TabsListDropdown
149
+ tabs={[
150
+ {
151
+ id: "first",
152
+ content: (
153
+ <span className="flex items-center gap-1">
154
+ <span className="text-utility-green">GET</span>
155
+ <span>/fhir/Patient</span>
156
+ </span>
157
+ ),
158
+ },
159
+ {
160
+ id: "second",
161
+ content: (
162
+ <span className="flex items-center gap-1">
163
+ <span className="text-utility-yellow">POST</span>
164
+ <span>/fhir</span>
165
+ </span>
166
+ ),
167
+ },
168
+ {
169
+ id: "third",
170
+ content: (
171
+ <span className="flex items-center gap-1">
172
+ <span className="text-utility-yellow">POST</span>
173
+ <span>/$graphql</span>
174
+ </span>
175
+ ),
176
+ },
177
+ ]}
178
+ />
147
179
  </Tabs>
148
180
  ),
149
181
  } satisfies Story;