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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/dist/bundle.css +1375 -484
  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 +14 -2
  20. package/dist/src/components/code-editor/index.d.ts.map +1 -1
  21. package/dist/src/components/code-editor/index.js +309 -20
  22. package/dist/src/components/code-editor/index.js.map +1 -1
  23. package/dist/src/components/code-editor.stories.d.ts +1 -0
  24. package/dist/src/components/code-editor.stories.d.ts.map +1 -1
  25. package/dist/src/components/code-editor.stories.js +255 -2
  26. package/dist/src/components/code-editor.stories.js.map +1 -1
  27. package/dist/src/components/copy-icon.d.ts +5 -1
  28. package/dist/src/components/copy-icon.d.ts.map +1 -1
  29. package/dist/src/components/copy-icon.js +41 -3
  30. package/dist/src/components/copy-icon.js.map +1 -1
  31. package/dist/src/components/data-table.d.ts +8 -0
  32. package/dist/src/components/data-table.d.ts.map +1 -0
  33. package/dist/src/components/data-table.js +65 -0
  34. package/dist/src/components/data-table.js.map +1 -0
  35. package/dist/src/components/data-table.stories.d.ts +7 -0
  36. package/dist/src/components/data-table.stories.d.ts.map +1 -0
  37. package/dist/src/components/data-table.stories.js +44 -0
  38. package/dist/src/components/data-table.stories.js.map +1 -0
  39. package/dist/src/components/fhir-structure-view.d.ts +34 -0
  40. package/dist/src/components/fhir-structure-view.d.ts.map +1 -0
  41. package/dist/src/components/fhir-structure-view.js +229 -0
  42. package/dist/src/components/fhir-structure-view.js.map +1 -0
  43. package/dist/src/components/fhir-structure-view.stories.d.ts +7 -0
  44. package/dist/src/components/fhir-structure-view.stories.d.ts.map +1 -0
  45. package/dist/src/components/fhir-structure-view.stories.js +447 -0
  46. package/dist/src/components/fhir-structure-view.stories.js.map +1 -0
  47. package/dist/src/components/patient-table.d.ts +73 -0
  48. package/dist/src/components/patient-table.d.ts.map +1 -0
  49. package/dist/src/components/patient-table.js +921 -0
  50. package/dist/src/components/patient-table.js.map +1 -0
  51. package/dist/src/components/patient-table.stories.d.ts +111 -0
  52. package/dist/src/components/patient-table.stories.d.ts.map +1 -0
  53. package/dist/src/components/patient-table.stories.js +172 -0
  54. package/dist/src/components/patient-table.stories.js.map +1 -0
  55. package/dist/src/components/request-line-editor.d.ts +13 -35
  56. package/dist/src/components/request-line-editor.d.ts.map +1 -1
  57. package/dist/src/components/request-line-editor.js +72 -49
  58. package/dist/src/components/request-line-editor.js.map +1 -1
  59. package/dist/src/components/request-line-editor.stories.d.ts.map +1 -1
  60. package/dist/src/components/request-line-editor.stories.js +17 -53
  61. package/dist/src/components/request-line-editor.stories.js.map +1 -1
  62. package/dist/src/components/segment-control.d.ts +16 -0
  63. package/dist/src/components/segment-control.d.ts.map +1 -0
  64. package/dist/src/components/segment-control.js +48 -0
  65. package/dist/src/components/segment-control.js.map +1 -0
  66. package/dist/src/components/segment-control.stories.d.ts +15 -0
  67. package/dist/src/components/segment-control.stories.d.ts.map +1 -0
  68. package/dist/src/components/segment-control.stories.js +33 -0
  69. package/dist/src/components/segment-control.stories.js.map +1 -0
  70. package/dist/src/components/split-button.d.ts +5 -0
  71. package/dist/src/components/split-button.d.ts.map +1 -0
  72. package/dist/src/components/split-button.js +12 -0
  73. package/dist/src/components/split-button.js.map +1 -0
  74. package/dist/src/components/split-button.stories.d.ts +7 -0
  75. package/dist/src/components/split-button.stories.d.ts.map +1 -0
  76. package/dist/src/components/split-button.stories.js +57 -0
  77. package/dist/src/components/split-button.stories.js.map +1 -0
  78. package/dist/src/components/tree-view.d.ts +22 -0
  79. package/dist/src/components/tree-view.d.ts.map +1 -0
  80. package/dist/src/components/tree-view.js +101 -0
  81. package/dist/src/components/tree-view.js.map +1 -0
  82. package/dist/src/components/tree-view.stories.d.ts +13 -0
  83. package/dist/src/components/tree-view.stories.d.ts.map +1 -0
  84. package/dist/src/components/tree-view.stories.js +274 -0
  85. package/dist/src/components/tree-view.stories.js.map +1 -0
  86. package/dist/src/icons.d.ts +9 -0
  87. package/dist/src/icons.d.ts.map +1 -0
  88. package/dist/src/icons.js +279 -0
  89. package/dist/src/icons.js.map +1 -0
  90. package/dist/src/index.css +42 -3
  91. package/dist/src/index.d.ts +9 -1
  92. package/dist/src/index.d.ts.map +1 -1
  93. package/dist/src/index.js +9 -1
  94. package/dist/src/index.js.map +1 -1
  95. package/dist/src/shadcn/components/ui/accordion.d.ts.map +1 -1
  96. package/dist/src/shadcn/components/ui/accordion.js +23 -5
  97. package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
  98. package/dist/src/shadcn/components/ui/alert-dialog.d.ts +3 -1
  99. package/dist/src/shadcn/components/ui/alert-dialog.d.ts.map +1 -1
  100. package/dist/src/shadcn/components/ui/alert-dialog.js +5 -2
  101. package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
  102. package/dist/src/shadcn/components/ui/alert.d.ts.map +1 -1
  103. package/dist/src/shadcn/components/ui/alert.js +12 -5
  104. package/dist/src/shadcn/components/ui/alert.js.map +1 -1
  105. package/dist/src/shadcn/components/ui/avatar.d.ts.map +1 -1
  106. package/dist/src/shadcn/components/ui/avatar.js +4 -3
  107. package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
  108. package/dist/src/shadcn/components/ui/badge.d.ts.map +1 -1
  109. package/dist/src/shadcn/components/ui/badge.js +16 -5
  110. package/dist/src/shadcn/components/ui/badge.js.map +1 -1
  111. package/dist/src/shadcn/components/ui/breadcrumb.d.ts.map +1 -1
  112. package/dist/src/shadcn/components/ui/breadcrumb.js +6 -6
  113. package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
  114. package/dist/src/shadcn/components/ui/button.d.ts.map +1 -1
  115. package/dist/src/shadcn/components/ui/button.js +19 -11
  116. package/dist/src/shadcn/components/ui/button.js.map +1 -1
  117. package/dist/src/shadcn/components/ui/card.d.ts.map +1 -1
  118. package/dist/src/shadcn/components/ui/card.js +14 -6
  119. package/dist/src/shadcn/components/ui/card.js.map +1 -1
  120. package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
  121. package/dist/src/shadcn/components/ui/checkbox.js +20 -5
  122. package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
  123. package/dist/src/shadcn/components/ui/checkbox.stories.d.ts.map +1 -1
  124. package/dist/src/shadcn/components/ui/checkbox.stories.js +44 -35
  125. package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
  126. package/dist/src/shadcn/components/ui/combobox.d.ts +18 -0
  127. package/dist/src/shadcn/components/ui/combobox.d.ts.map +1 -0
  128. package/dist/src/shadcn/components/ui/combobox.js +121 -0
  129. package/dist/src/shadcn/components/ui/combobox.js.map +1 -0
  130. package/dist/src/shadcn/components/ui/combobox.stories.d.ts +11 -0
  131. package/dist/src/shadcn/components/ui/combobox.stories.d.ts.map +1 -0
  132. package/dist/src/shadcn/components/ui/combobox.stories.js +16 -0
  133. package/dist/src/shadcn/components/ui/combobox.stories.js.map +1 -0
  134. package/dist/src/shadcn/components/ui/command.d.ts.map +1 -1
  135. package/dist/src/shadcn/components/ui/command.js +73 -12
  136. package/dist/src/shadcn/components/ui/command.js.map +1 -1
  137. package/dist/src/shadcn/components/ui/command.stories.js +0 -1
  138. package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
  139. package/dist/src/shadcn/components/ui/dialog.d.ts.map +1 -1
  140. package/dist/src/shadcn/components/ui/dialog.js +35 -7
  141. package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
  142. package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
  143. package/dist/src/shadcn/components/ui/drawer.js +26 -5
  144. package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
  145. package/dist/src/shadcn/components/ui/dropdown-menu.d.ts.map +1 -1
  146. package/dist/src/shadcn/components/ui/dropdown-menu.js +12 -1
  147. package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
  148. package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
  149. package/dist/src/shadcn/components/ui/form.js +12 -4
  150. package/dist/src/shadcn/components/ui/form.js.map +1 -1
  151. package/dist/src/shadcn/components/ui/input.d.ts +3 -1
  152. package/dist/src/shadcn/components/ui/input.d.ts.map +1 -1
  153. package/dist/src/shadcn/components/ui/input.js +126 -17
  154. package/dist/src/shadcn/components/ui/input.js.map +1 -1
  155. package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
  156. package/dist/src/shadcn/components/ui/label.js +8 -1
  157. package/dist/src/shadcn/components/ui/label.js.map +1 -1
  158. package/dist/src/shadcn/components/ui/menubar.d.ts.map +1 -1
  159. package/dist/src/shadcn/components/ui/menubar.js +35 -13
  160. package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
  161. package/dist/src/shadcn/components/ui/pagination.d.ts.map +1 -1
  162. package/dist/src/shadcn/components/ui/pagination.js +6 -6
  163. package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
  164. package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
  165. package/dist/src/shadcn/components/ui/popover.js +12 -1
  166. package/dist/src/shadcn/components/ui/popover.js.map +1 -1
  167. package/dist/src/shadcn/components/ui/progress.d.ts.map +1 -1
  168. package/dist/src/shadcn/components/ui/progress.js +6 -2
  169. package/dist/src/shadcn/components/ui/progress.js.map +1 -1
  170. package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
  171. package/dist/src/shadcn/components/ui/radio-group.js +11 -6
  172. package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
  173. package/dist/src/shadcn/components/ui/radio-group.stories.d.ts.map +1 -1
  174. package/dist/src/shadcn/components/ui/radio-group.stories.js +57 -34
  175. package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
  176. package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
  177. package/dist/src/shadcn/components/ui/scroll-area.js +9 -3
  178. package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
  179. package/dist/src/shadcn/components/ui/select.d.ts.map +1 -1
  180. package/dist/src/shadcn/components/ui/select.js +49 -14
  181. package/dist/src/shadcn/components/ui/select.js.map +1 -1
  182. package/dist/src/shadcn/components/ui/select.stories.d.ts.map +1 -1
  183. package/dist/src/shadcn/components/ui/select.stories.js +1 -4
  184. package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
  185. package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
  186. package/dist/src/shadcn/components/ui/separator.js +7 -1
  187. package/dist/src/shadcn/components/ui/separator.js.map +1 -1
  188. package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
  189. package/dist/src/shadcn/components/ui/sidebar.js +20 -6
  190. package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
  191. package/dist/src/shadcn/components/ui/skeleton.d.ts.map +1 -1
  192. package/dist/src/shadcn/components/ui/skeleton.js +3 -1
  193. package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
  194. package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
  195. package/dist/src/shadcn/components/ui/slider.js +34 -4
  196. package/dist/src/shadcn/components/ui/slider.js.map +1 -1
  197. package/dist/src/shadcn/components/ui/sonner.d.ts +16 -1
  198. package/dist/src/shadcn/components/ui/sonner.d.ts.map +1 -1
  199. package/dist/src/shadcn/components/ui/sonner.js +23 -3
  200. package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
  201. package/dist/src/shadcn/components/ui/sonner.stories.d.ts.map +1 -1
  202. package/dist/src/shadcn/components/ui/sonner.stories.js +19 -11
  203. package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
  204. package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
  205. package/dist/src/shadcn/components/ui/switch.js +18 -2
  206. package/dist/src/shadcn/components/ui/switch.js.map +1 -1
  207. package/dist/src/shadcn/components/ui/table.d.ts.map +1 -1
  208. package/dist/src/shadcn/components/ui/table.js +12 -8
  209. package/dist/src/shadcn/components/ui/table.js.map +1 -1
  210. package/dist/src/shadcn/components/ui/tabs.d.ts +21 -3
  211. package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
  212. package/dist/src/shadcn/components/ui/tabs.js +315 -9
  213. package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
  214. package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -1
  215. package/dist/src/shadcn/components/ui/tabs.stories.js +50 -1
  216. package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
  217. package/dist/src/shadcn/components/ui/textarea.d.ts.map +1 -1
  218. package/dist/src/shadcn/components/ui/textarea.js +15 -1
  219. package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
  220. package/dist/src/shadcn/components/ui/toggle-group.d.ts.map +1 -1
  221. package/dist/src/shadcn/components/ui/toggle-group.js +6 -2
  222. package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
  223. package/dist/src/shadcn/components/ui/toggle.d.ts.map +1 -1
  224. package/dist/src/shadcn/components/ui/toggle.js +18 -6
  225. package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
  226. package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
  227. package/dist/src/shadcn/components/ui/tooltip.js +11 -1
  228. package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
  229. package/dist/src/shadcn/components/ui/tree.d.ts +28 -0
  230. package/dist/src/shadcn/components/ui/tree.d.ts.map +1 -0
  231. package/dist/src/shadcn/components/ui/tree.js +122 -0
  232. package/dist/src/shadcn/components/ui/tree.js.map +1 -0
  233. package/dist/src/typography.css +12 -0
  234. package/package.json +13 -2
  235. package/src/components/code-editor/http/grammar/http.grammar +74 -0
  236. package/src/components/code-editor/http/grammar/http.terms.ts +9 -0
  237. package/src/components/code-editor/http/grammar/http.test.ts +110 -0
  238. package/src/components/code-editor/http/grammar/http.ts +21 -0
  239. package/src/components/code-editor/http/index.ts +87 -0
  240. package/src/components/code-editor/index.tsx +307 -21
  241. package/src/components/code-editor.stories.tsx +295 -1
  242. package/src/components/copy-icon.tsx +57 -3
  243. package/src/components/data-table.stories.tsx +38 -0
  244. package/src/components/data-table.tsx +117 -0
  245. package/src/components/fhir-structure-view.stories.tsx +439 -0
  246. package/src/components/fhir-structure-view.tsx +231 -0
  247. package/src/components/patient-table.stories.tsx +111 -0
  248. package/src/components/patient-table.tsx +1301 -0
  249. package/src/components/request-line-editor.stories.tsx +17 -27
  250. package/src/components/request-line-editor.tsx +98 -61
  251. package/src/components/segment-control.stories.tsx +29 -0
  252. package/src/components/segment-control.tsx +80 -0
  253. package/src/components/split-button.stories.tsx +49 -0
  254. package/src/components/split-button.tsx +17 -0
  255. package/src/components/tree-view.stories.tsx +259 -0
  256. package/src/components/tree-view.tsx +172 -0
  257. package/src/icons.tsx +287 -0
  258. package/src/index.css +42 -3
  259. package/src/index.tsx +9 -2
  260. package/src/shadcn/components/ui/accordion.tsx +66 -8
  261. package/src/shadcn/components/ui/alert-dialog.tsx +6 -2
  262. package/src/shadcn/components/ui/alert.tsx +53 -15
  263. package/src/shadcn/components/ui/avatar.tsx +17 -6
  264. package/src/shadcn/components/ui/badge.tsx +67 -18
  265. package/src/shadcn/components/ui/breadcrumb.tsx +35 -7
  266. package/src/shadcn/components/ui/button.tsx +118 -57
  267. package/src/shadcn/components/ui/card.tsx +44 -13
  268. package/src/shadcn/components/ui/checkbox.stories.tsx +20 -24
  269. package/src/shadcn/components/ui/checkbox.tsx +45 -4
  270. package/src/shadcn/components/ui/combobox.stories.tsx +19 -0
  271. package/src/shadcn/components/ui/combobox.tsx +142 -0
  272. package/src/shadcn/components/ui/command.stories.tsx +1 -1
  273. package/src/shadcn/components/ui/command.tsx +192 -36
  274. package/src/shadcn/components/ui/dialog.tsx +101 -13
  275. package/src/shadcn/components/ui/drawer.tsx +93 -18
  276. package/src/shadcn/components/ui/dropdown-menu.tsx +37 -9
  277. package/src/shadcn/components/ui/form.tsx +16 -4
  278. package/src/shadcn/components/ui/input.tsx +400 -29
  279. package/src/shadcn/components/ui/label.tsx +21 -4
  280. package/src/shadcn/components/ui/menubar.tsx +188 -43
  281. package/src/shadcn/components/ui/pagination.tsx +12 -6
  282. package/src/shadcn/components/ui/popover.tsx +35 -4
  283. package/src/shadcn/components/ui/progress.tsx +21 -5
  284. package/src/shadcn/components/ui/radio-group.stories.tsx +22 -14
  285. package/src/shadcn/components/ui/radio-group.tsx +42 -5
  286. package/src/shadcn/components/ui/scroll-area.tsx +33 -5
  287. package/src/shadcn/components/ui/select.stories.tsx +0 -2
  288. package/src/shadcn/components/ui/select.tsx +184 -33
  289. package/src/shadcn/components/ui/separator.tsx +15 -5
  290. package/src/shadcn/components/ui/sidebar.tsx +68 -26
  291. package/src/shadcn/components/ui/skeleton.tsx +4 -1
  292. package/src/shadcn/components/ui/slider.tsx +82 -11
  293. package/src/shadcn/components/ui/sonner.stories.tsx +19 -15
  294. package/src/shadcn/components/ui/sonner.tsx +53 -3
  295. package/src/shadcn/components/ui/switch.tsx +53 -7
  296. package/src/shadcn/components/ui/table.tsx +38 -11
  297. package/src/shadcn/components/ui/tabs.stories.tsx +32 -0
  298. package/src/shadcn/components/ui/tabs.tsx +456 -17
  299. package/src/shadcn/components/ui/textarea.tsx +42 -4
  300. package/src/shadcn/components/ui/toggle-group.tsx +27 -5
  301. package/src/shadcn/components/ui/toggle.tsx +59 -18
  302. package/src/shadcn/components/ui/tooltip.tsx +33 -8
  303. package/src/shadcn/components/ui/tree.tsx +233 -0
  304. package/src/typography.css +12 -0
@@ -2,14 +2,30 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as SwitchPrimitive from "@radix-ui/react-switch";
4
4
  import { cn } from "../../lib/utils.js";
5
+ // Switch root styles
6
+ const switchRootStyles = cn(// Layout
7
+ "peer", "inline-flex", "items-center", "shrink-0", // Size
8
+ "h-[1.15rem]", "w-8", // Shape
9
+ "rounded-full", "border", "border-transparent", // Interaction
10
+ "transition-all", "outline-none", "cursor-pointer", // States
11
+ "data-[state=unchecked]:bg-bg-quaternary", "data-[state=checked]:bg-bg-link", "hover:data-[state=unchecked]:bg-bg-tertiary", "hover:data-[state=checked]:bg-bg-link_hover", // Focus
12
+ "focus-visible:ring-2", "focus-visible:ring-utility-blue/70", // Disabled
13
+ "disabled:cursor-not-allowed", "disabled:opacity-50", "disabled:data-[state=checked]:bg-bg-disabled", "disabled:data-[state=unchecked]:bg-bg-disabled");
14
+ // Switch thumb styles
15
+ const switchThumbStyles = cn(// Layout
16
+ "pointer-events-none", "block", // Size
17
+ "size-4", // Shape
18
+ "rounded-full", "ring-0", // Color
19
+ "bg-bg-primary", // Animation
20
+ "transition-transform", "data-[state=checked]:translate-x-[calc(100%-2px)]", "data-[state=unchecked]:translate-x-0");
5
21
  function Switch({ className, ...props }) {
6
22
  return /*#__PURE__*/ _jsx(SwitchPrimitive.Root, {
7
23
  "data-slot": "switch",
8
- className: cn("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", className),
24
+ className: cn(switchRootStyles, className),
9
25
  ...props,
10
26
  children: /*#__PURE__*/ _jsx(SwitchPrimitive.Thumb, {
11
27
  "data-slot": "switch-thumb",
12
- className: cn("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")
28
+ className: switchThumbStyles
13
29
  })
14
30
  });
15
31
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shadcn/components/ui/switch.tsx"],"sourcesContent":["\"use client\";\nimport * as SwitchPrimitive from \"@radix-ui/react-switch\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nfunction Switch({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n\treturn (\n\t\t<SwitchPrimitive.Root\n\t\t\tdata-slot=\"switch\"\n\t\t\tclassName={cn(\n\t\t\t\t\"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\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SwitchPrimitive.Thumb\n\t\t\t\tdata-slot=\"switch-thumb\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"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\",\n\t\t\t\t)}\n\t\t\t/>\n\t\t</SwitchPrimitive.Root>\n\t);\n}\n\nexport { Switch };\n"],"names":["SwitchPrimitive","cn","Switch","className","props","Root","data-slot","Thumb"],"mappings":"AAAA;;AACA,YAAYA,qBAAqB,yBAAyB;AAG1D,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,SAASC,OAAO,EACfC,SAAS,EACT,GAAGC,OACgD;IACnD,qBACC,KAACJ,gBAAgBK,IAAI;QACpBC,aAAU;QACVH,WAAWF,GACV,6WACAE;QAEA,GAAGC,KAAK;kBAET,cAAA,KAACJ,gBAAgBO,KAAK;YACrBD,aAAU;YACVH,WAAWF,GACV;;;AAKL;AAEA,SAASC,MAAM,GAAG"}
1
+ {"version":3,"sources":["../../../../../src/shadcn/components/ui/switch.tsx"],"sourcesContent":["\"use client\";\nimport * as SwitchPrimitive from \"@radix-ui/react-switch\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\n// Switch root styles\nconst switchRootStyles = cn(\n\t// Layout\n\t\"peer\",\n\t\"inline-flex\",\n\t\"items-center\",\n\t\"shrink-0\",\n\t// Size\n\t\"h-[1.15rem]\",\n\t\"w-8\",\n\t// Shape\n\t\"rounded-full\",\n\t\"border\",\n\t\"border-transparent\",\n\t// Interaction\n\t\"transition-all\",\n\t\"outline-none\",\n\t\"cursor-pointer\",\n\t// States\n\t\"data-[state=unchecked]:bg-bg-quaternary\",\n\t\"data-[state=checked]:bg-bg-link\",\n\t\"hover:data-[state=unchecked]:bg-bg-tertiary\",\n\t\"hover:data-[state=checked]:bg-bg-link_hover\",\n\t// Focus\n\t\"focus-visible:ring-2\",\n\t\"focus-visible:ring-utility-blue/70\",\n\t// Disabled\n\t\"disabled:cursor-not-allowed\",\n\t\"disabled:opacity-50\",\n\t\"disabled:data-[state=checked]:bg-bg-disabled\",\n\t\"disabled:data-[state=unchecked]:bg-bg-disabled\",\n);\n\n// Switch thumb styles\nconst switchThumbStyles = cn(\n\t// Layout\n\t\"pointer-events-none\",\n\t\"block\",\n\t// Size\n\t\"size-4\",\n\t// Shape\n\t\"rounded-full\",\n\t\"ring-0\",\n\t// Color\n\t\"bg-bg-primary\",\n\t// Animation\n\t\"transition-transform\",\n\t\"data-[state=checked]:translate-x-[calc(100%-2px)]\",\n\t\"data-[state=unchecked]:translate-x-0\",\n);\n\nfunction Switch({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n\treturn (\n\t\t<SwitchPrimitive.Root\n\t\t\tdata-slot=\"switch\"\n\t\t\tclassName={cn(switchRootStyles, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SwitchPrimitive.Thumb\n\t\t\t\tdata-slot=\"switch-thumb\"\n\t\t\t\tclassName={switchThumbStyles}\n\t\t\t/>\n\t\t</SwitchPrimitive.Root>\n\t);\n}\n\nexport { Switch };\n"],"names":["SwitchPrimitive","cn","switchRootStyles","switchThumbStyles","Switch","className","props","Root","data-slot","Thumb"],"mappings":"AAAA;;AACA,YAAYA,qBAAqB,yBAAyB;AAG1D,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,qBAAqB;AACrB,MAAMC,mBAAmBD,GACxB,SAAS;AACT,QACA,eACA,gBACA,YACA,OAAO;AACP,eACA,OACA,QAAQ;AACR,gBACA,UACA,sBACA,cAAc;AACd,kBACA,gBACA,kBACA,SAAS;AACT,2CACA,mCACA,+CACA,+CACA,QAAQ;AACR,wBACA,sCACA,WAAW;AACX,+BACA,uBACA,gDACA;AAGD,sBAAsB;AACtB,MAAME,oBAAoBF,GACzB,SAAS;AACT,uBACA,SACA,OAAO;AACP,UACA,QAAQ;AACR,gBACA,UACA,QAAQ;AACR,iBACA,YAAY;AACZ,wBACA,qDACA;AAGD,SAASG,OAAO,EACfC,SAAS,EACT,GAAGC,OACgD;IACnD,qBACC,KAACN,gBAAgBO,IAAI;QACpBC,aAAU;QACVH,WAAWJ,GAAGC,kBAAkBG;QAC/B,GAAGC,KAAK;kBAET,cAAA,KAACN,gBAAgBS,KAAK;YACrBD,aAAU;YACVH,WAAWF;;;AAIf;AAEA,SAASC,MAAM,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAapE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAQ1E;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAQxE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAW1E;AAED,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWpE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWrE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWrE;AAED,iBAAS,YAAY,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,2CAQjC;AAED,OAAO,EACN,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACZ,CAAC"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAUpC,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAUpE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAY1E;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAQxE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAe1E;AAED,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAepE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAmBrE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAerE;AAED,iBAAS,YAAY,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,2CAQjC;AAED,OAAO,EACN,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACZ,CAAC"}
@@ -1,12 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../../lib/utils.js";
3
+ // Table container styles
4
+ const tableContainerStyles = cn("relative", "w-full", "overflow-x-auto");
5
+ // Table styles
6
+ const tableStyles = cn("w-full", "caption-bottom", "text-sm");
3
7
  function Table({ className, ...props }) {
4
8
  return /*#__PURE__*/ _jsx("div", {
5
9
  "data-slot": "table-container",
6
- className: "relative w-full overflow-x-auto",
10
+ className: tableContainerStyles,
7
11
  children: /*#__PURE__*/ _jsx("table", {
8
12
  "data-slot": "table",
9
- className: cn("w-full caption-bottom text-sm", className),
13
+ className: cn(tableStyles, className),
10
14
  ...props
11
15
  })
12
16
  });
@@ -14,7 +18,7 @@ function Table({ className, ...props }) {
14
18
  function TableHeader({ className, ...props }) {
15
19
  return /*#__PURE__*/ _jsx("thead", {
16
20
  "data-slot": "table-header",
17
- className: cn("[&_tr]:border-b", className),
21
+ className: cn("[&_tr]:border-b", "[&_tr]:border-border-primary", className),
18
22
  ...props
19
23
  });
20
24
  }
@@ -28,35 +32,35 @@ function TableBody({ className, ...props }) {
28
32
  function TableFooter({ className, ...props }) {
29
33
  return /*#__PURE__*/ _jsx("tfoot", {
30
34
  "data-slot": "table-footer",
31
- className: cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className),
35
+ className: cn("bg-bg-tertiary/50", "border-t", "border-border-primary", "font-medium", "[&>tr]:last:border-b-0", className),
32
36
  ...props
33
37
  });
34
38
  }
35
39
  function TableRow({ className, ...props }) {
36
40
  return /*#__PURE__*/ _jsx("tr", {
37
41
  "data-slot": "table-row",
38
- className: cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className),
42
+ className: cn("hover:bg-bg-tertiary/50", "data-[state=selected]:bg-bg-tertiary", "border-b", "border-border-primary", "transition-colors", className),
39
43
  ...props
40
44
  });
41
45
  }
42
46
  function TableHead({ className, ...props }) {
43
47
  return /*#__PURE__*/ _jsx("th", {
44
48
  "data-slot": "table-head",
45
- className: cn("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
49
+ className: cn("text-text-primary", "h-10", "px-2", "text-left", "align-middle", "font-medium", "whitespace-nowrap", "[&:has([role=checkbox])]:pr-0", "[&>[role=checkbox]]:translate-y-[2px]", className),
46
50
  ...props
47
51
  });
48
52
  }
49
53
  function TableCell({ className, ...props }) {
50
54
  return /*#__PURE__*/ _jsx("td", {
51
55
  "data-slot": "table-cell",
52
- className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
56
+ className: cn("p-2", "align-middle", "whitespace-nowrap", "[&:has([role=checkbox])]:pr-0", "[&>[role=checkbox]]:translate-y-[2px]", className),
53
57
  ...props
54
58
  });
55
59
  }
56
60
  function TableCaption({ className, ...props }) {
57
61
  return /*#__PURE__*/ _jsx("caption", {
58
62
  "data-slot": "table-caption",
59
- className: cn("text-muted-foreground mt-4 text-sm", className),
63
+ className: cn("text-text-secondary", "mt-4", "text-sm", className),
60
64
  ...props
61
65
  });
62
66
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shadcn/components/ui/table.tsx"],"sourcesContent":["import type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"table-container\"\n\t\t\tclassName=\"relative w-full overflow-x-auto\"\n\t\t>\n\t\t\t<table\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tclassName={cn(\"w-full caption-bottom text-sm\", className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n\treturn (\n\t\t<thead\n\t\t\tdata-slot=\"table-header\"\n\t\t\tclassName={cn(\"[&_tr]:border-b\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n\treturn (\n\t\t<tbody\n\t\t\tdata-slot=\"table-body\"\n\t\t\tclassName={cn(\"[&_tr:last-child]:border-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n\treturn (\n\t\t<tfoot\n\t\t\tdata-slot=\"table-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-row\"\n\t\t\tclassName={cn(\n\t\t\t\t\"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n\treturn (\n\t\t<th\n\t\t\tdata-slot=\"table-head\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n\treturn (\n\t\t<td\n\t\t\tdata-slot=\"table-cell\"\n\t\t\tclassName={cn(\n\t\t\t\t\"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCaption({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"caption\">) {\n\treturn (\n\t\t<caption\n\t\t\tdata-slot=\"table-caption\"\n\t\t\tclassName={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tTable,\n\tTableHeader,\n\tTableBody,\n\tTableFooter,\n\tTableHead,\n\tTableRow,\n\tTableCell,\n\tTableCaption,\n};\n"],"names":["cn","Table","className","props","div","data-slot","table","TableHeader","thead","TableBody","tbody","TableFooter","tfoot","TableRow","tr","TableHead","th","TableCell","td","TableCaption","caption"],"mappings":";AAEA,SAASA,EAAE,QAAQ,qBAAoB;AAEvC,SAASC,MAAM,EAAEC,SAAS,EAAE,GAAGC,OAAsC;IACpE,qBACC,KAACC;QACAC,aAAU;QACVH,WAAU;kBAEV,cAAA,KAACI;YACAD,aAAU;YACVH,WAAWF,GAAG,iCAAiCE;YAC9C,GAAGC,KAAK;;;AAIb;AAEA,SAASI,YAAY,EAAEL,SAAS,EAAE,GAAGC,OAAsC;IAC1E,qBACC,KAACK;QACAH,aAAU;QACVH,WAAWF,GAAG,mBAAmBE;QAChC,GAAGC,KAAK;;AAGZ;AAEA,SAASM,UAAU,EAAEP,SAAS,EAAE,GAAGC,OAAsC;IACxE,qBACC,KAACO;QACAL,aAAU;QACVH,WAAWF,GAAG,8BAA8BE;QAC3C,GAAGC,KAAK;;AAGZ;AAEA,SAASQ,YAAY,EAAET,SAAS,EAAE,GAAGC,OAAsC;IAC1E,qBACC,KAACS;QACAP,aAAU;QACVH,WAAWF,GACV,2DACAE;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASU,SAAS,EAAEX,SAAS,EAAE,GAAGC,OAAmC;IACpE,qBACC,KAACW;QACAT,aAAU;QACVH,WAAWF,GACV,+EACAE;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASY,UAAU,EAAEb,SAAS,EAAE,GAAGC,OAAmC;IACrE,qBACC,KAACa;QACAX,aAAU;QACVH,WAAWF,GACV,sJACAE;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASc,UAAU,EAAEf,SAAS,EAAE,GAAGC,OAAmC;IACrE,qBACC,KAACe;QACAb,aAAU;QACVH,WAAWF,GACV,0GACAE;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASgB,aAAa,EACrBjB,SAAS,EACT,GAAGC,OAC8B;IACjC,qBACC,KAACiB;QACAf,aAAU;QACVH,WAAWF,GAAG,sCAAsCE;QACnD,GAAGC,KAAK;;AAGZ;AAEA,SACCF,KAAK,EACLM,WAAW,EACXE,SAAS,EACTE,WAAW,EACXI,SAAS,EACTF,QAAQ,EACRI,SAAS,EACTE,YAAY,GACX"}
1
+ {"version":3,"sources":["../../../../../src/shadcn/components/ui/table.tsx"],"sourcesContent":["import type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\n// Table container styles\nconst tableContainerStyles = cn(\"relative\", \"w-full\", \"overflow-x-auto\");\n\n// Table styles\nconst tableStyles = cn(\"w-full\", \"caption-bottom\", \"text-sm\");\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n\treturn (\n\t\t<div data-slot=\"table-container\" className={tableContainerStyles}>\n\t\t\t<table\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tclassName={cn(tableStyles, className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n\treturn (\n\t\t<thead\n\t\t\tdata-slot=\"table-header\"\n\t\t\tclassName={cn(\n\t\t\t\t\"[&_tr]:border-b\",\n\t\t\t\t\"[&_tr]:border-border-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n\treturn (\n\t\t<tbody\n\t\t\tdata-slot=\"table-body\"\n\t\t\tclassName={cn(\"[&_tr:last-child]:border-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n\treturn (\n\t\t<tfoot\n\t\t\tdata-slot=\"table-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-bg-tertiary/50\",\n\t\t\t\t\"border-t\",\n\t\t\t\t\"border-border-primary\",\n\t\t\t\t\"font-medium\",\n\t\t\t\t\"[&>tr]:last:border-b-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-row\"\n\t\t\tclassName={cn(\n\t\t\t\t\"hover:bg-bg-tertiary/50\",\n\t\t\t\t\"data-[state=selected]:bg-bg-tertiary\",\n\t\t\t\t\"border-b\",\n\t\t\t\t\"border-border-primary\",\n\t\t\t\t\"transition-colors\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n\treturn (\n\t\t<th\n\t\t\tdata-slot=\"table-head\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-text-primary\",\n\t\t\t\t\"h-10\",\n\t\t\t\t\"px-2\",\n\t\t\t\t\"text-left\",\n\t\t\t\t\"align-middle\",\n\t\t\t\t\"font-medium\",\n\t\t\t\t\"whitespace-nowrap\",\n\t\t\t\t\"[&:has([role=checkbox])]:pr-0\",\n\t\t\t\t\"[&>[role=checkbox]]:translate-y-[2px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n\treturn (\n\t\t<td\n\t\t\tdata-slot=\"table-cell\"\n\t\t\tclassName={cn(\n\t\t\t\t\"p-2\",\n\t\t\t\t\"align-middle\",\n\t\t\t\t\"whitespace-nowrap\",\n\t\t\t\t\"[&:has([role=checkbox])]:pr-0\",\n\t\t\t\t\"[&>[role=checkbox]]:translate-y-[2px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCaption({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"caption\">) {\n\treturn (\n\t\t<caption\n\t\t\tdata-slot=\"table-caption\"\n\t\t\tclassName={cn(\"text-text-secondary\", \"mt-4\", \"text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tTable,\n\tTableHeader,\n\tTableBody,\n\tTableFooter,\n\tTableHead,\n\tTableRow,\n\tTableCell,\n\tTableCaption,\n};\n"],"names":["cn","tableContainerStyles","tableStyles","Table","className","props","div","data-slot","table","TableHeader","thead","TableBody","tbody","TableFooter","tfoot","TableRow","tr","TableHead","th","TableCell","td","TableCaption","caption"],"mappings":";AAEA,SAASA,EAAE,QAAQ,qBAAoB;AAEvC,yBAAyB;AACzB,MAAMC,uBAAuBD,GAAG,YAAY,UAAU;AAEtD,eAAe;AACf,MAAME,cAAcF,GAAG,UAAU,kBAAkB;AAEnD,SAASG,MAAM,EAAEC,SAAS,EAAE,GAAGC,OAAsC;IACpE,qBACC,KAACC;QAAIC,aAAU;QAAkBH,WAAWH;kBAC3C,cAAA,KAACO;YACAD,aAAU;YACVH,WAAWJ,GAAGE,aAAaE;YAC1B,GAAGC,KAAK;;;AAIb;AAEA,SAASI,YAAY,EAAEL,SAAS,EAAE,GAAGC,OAAsC;IAC1E,qBACC,KAACK;QACAH,aAAU;QACVH,WAAWJ,GACV,mBACA,gCACAI;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASM,UAAU,EAAEP,SAAS,EAAE,GAAGC,OAAsC;IACxE,qBACC,KAACO;QACAL,aAAU;QACVH,WAAWJ,GAAG,8BAA8BI;QAC3C,GAAGC,KAAK;;AAGZ;AAEA,SAASQ,YAAY,EAAET,SAAS,EAAE,GAAGC,OAAsC;IAC1E,qBACC,KAACS;QACAP,aAAU;QACVH,WAAWJ,GACV,qBACA,YACA,yBACA,eACA,0BACAI;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASU,SAAS,EAAEX,SAAS,EAAE,GAAGC,OAAmC;IACpE,qBACC,KAACW;QACAT,aAAU;QACVH,WAAWJ,GACV,2BACA,wCACA,YACA,yBACA,qBACAI;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASY,UAAU,EAAEb,SAAS,EAAE,GAAGC,OAAmC;IACrE,qBACC,KAACa;QACAX,aAAU;QACVH,WAAWJ,GACV,qBACA,QACA,QACA,aACA,gBACA,eACA,qBACA,iCACA,yCACAI;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASc,UAAU,EAAEf,SAAS,EAAE,GAAGC,OAAmC;IACrE,qBACC,KAACe;QACAb,aAAU;QACVH,WAAWJ,GACV,OACA,gBACA,qBACA,iCACA,yCACAI;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASgB,aAAa,EACrBjB,SAAS,EACT,GAAGC,OAC8B;IACjC,qBACC,KAACiB;QACAf,aAAU;QACVH,WAAWJ,GAAG,uBAAuB,QAAQ,WAAWI;QACvD,GAAGC,KAAK;;AAGZ;AAEA,SACCF,KAAK,EACLM,WAAW,EACXE,SAAS,EACTE,WAAW,EACXI,SAAS,EACTF,QAAQ,EACRI,SAAS,EACTE,YAAY,GACX"}
@@ -1,16 +1,34 @@
1
1
  import * as TabsPrimitive from "@radix-ui/react-tabs";
2
2
  import { type VariantProps } from "class-variance-authority";
3
- import type * as React from "react";
3
+ import * as React from "react";
4
4
  import { Button } from "./button";
5
5
  declare const tabsVariants: (props?: ({
6
6
  variant?: "browser" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  declare function Tabs({ className, variant, ...props }: React.ComponentProps<typeof TabsPrimitive.Root> & VariantProps<typeof tabsVariants>): import("react/jsx-runtime").JSX.Element;
9
9
  export declare function TabsAddButton(props: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
10
- declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): import("react/jsx-runtime").JSX.Element;
10
+ type EdgeScrollPosition = "touch" | "depart";
11
+ type FlowType = "overflow" | "underflow";
12
+ type TabsListProps = {
13
+ onLeftEdge?: (position: EdgeScrollPosition) => void;
14
+ onRightEdge?: (position: EdgeScrollPosition) => void;
15
+ onFlow?: (flow: FlowType) => void;
16
+ onResize?: (entries: ResizeObserverEntry[]) => void;
17
+ onTabChange?: (mutationRecords: MutationRecord[]) => void;
18
+ } & React.ComponentProps<typeof TabsPrimitive.List>;
19
+ declare function TabsList({ className, onLeftEdge, onRightEdge, onResize, onFlow, onTabChange, ...props }: TabsListProps): import("react/jsx-runtime").JSX.Element;
20
+ declare function TabsBrowserList({ className, children, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): import("react/jsx-runtime").JSX.Element;
21
+ export declare function TabsListDropdown({ tabs, handleTabSelect, handleCloseTab, }: {
22
+ tabs: {
23
+ id: string;
24
+ content: React.ReactNode;
25
+ }[];
26
+ handleTabSelect?: (tabId: string) => void;
27
+ handleCloseTab?: (tabId: string) => void;
28
+ }): import("react/jsx-runtime").JSX.Element;
11
29
  declare function TabsTrigger({ className, onClose, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger> & {
12
30
  onClose?: (value: string) => void;
13
31
  }): import("react/jsx-runtime").JSX.Element;
14
32
  declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
15
- export { Tabs, TabsList, TabsTrigger, TabsContent };
33
+ export { Tabs, TabsList, TabsTrigger, TabsContent, TabsBrowserList };
16
34
  //# sourceMappingURL=tabs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,YAAY;;8EAsBhB,CAAC;AAEH,iBAAS,IAAI,CAAC,EACb,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,GACjD,YAAY,CAAC,OAAO,YAAY,CAAC,2CAQjC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,2CAavE;AAED,iBAAS,QAAQ,CAAC,EACjB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,2CAQjD;AAED,iBAAS,WAAW,CAAC,EACpB,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,2CAsCA;AAED,iBAAS,WAAW,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,2CAQpD;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA2ElC,QAAA,MAAM,YAAY;;8EAwBhB,CAAC;AAEH,iBAAS,IAAI,CAAC,EACb,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,GACjD,YAAY,CAAC,OAAO,YAAY,CAAC,2CAQjC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,2CAavE;AAiDD,KAAK,kBAAkB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC7C,KAAK,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAEzC,KAAK,aAAa,GAAG;IACpB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACrD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CAC1D,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAEpD,iBAAS,QAAQ,CAAC,EACjB,SAAS,EACT,UAAU,EACV,WAAW,EACX,QAAQ,EACR,MAAM,EACN,WAAW,EACX,GAAG,KAAK,EACR,EAAE,aAAa,2CA6If;AAyCD,iBAAS,eAAe,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,2CAsEjD;AAED,wBAAgB,gBAAgB,CAAC,EAChC,IAAI,EACJ,eAAe,EACf,cAAc,GACd,EAAE;IACF,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,EAAE,CAAC;IACjD,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,2CA4CA;AAED,iBAAS,WAAW,CAAC,EACpB,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,2CA+BA;AAED,iBAAS,WAAW,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,2CAQpD;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
@@ -2,9 +2,31 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as TabsPrimitive from "@radix-ui/react-tabs";
4
4
  import { cva } from "class-variance-authority";
5
- import { Plus, X } from "lucide-react";
5
+ import { ChevronDownIcon, ChevronLeft, ChevronRight, Plus, X } from "lucide-react";
6
+ import * as React from "react";
6
7
  import { cn } from "../../lib/utils.js";
7
8
  import { Button } from "./button.js";
9
+ import { Command, CommandEmpty, CommandInput, CommandItem, CommandList } from "./command.js";
10
+ import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
11
+ // Base tabs styles
12
+ const baseTabsStyles = cn("flex", "flex-col", "h-full");
13
+ // Tabs add button container styles
14
+ const tabsAddButtonContainerStyles = cn("grow", "h-full", "bg-bg-secondary", "border-l", "border-b");
15
+ // Tabs list styles
16
+ const tabsListStyles = cn("inline-flex", "w-fit", "items-center", "no-scrollbar");
17
+ // Base tabs trigger styles
18
+ const baseTabsTriggerStyles = cn(// Layout & Sizing
19
+ "box-border", "flex-1", "h-10", "inline-flex", "items-center", "justify-center", "px-3", "whitespace-nowrap", // Spacing & Padding
20
+ "pb-2", "pt-2.5", // Typography
21
+ "typo-body", // Colors & States
22
+ "cursor-pointer", "text-text-tertiary", "hover:bg-bg-secondary/60", "hover:text-text-tertiary_hover", "data-[state=active]:text-text-primary", "data-[state=active]:border-b-border-brand", "disabled:opacity-50", "disabled:pointer-events-none", // Borders
23
+ "border-b-2", "border-b-transparent", // Focus & Accessibility
24
+ "focus-visible:ring-2", "focus-visible:ring-utility-blue/70", "focus-visible:outline-1", // Transitions
25
+ "transition-[color,box-shadow]", // Icons
26
+ "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*='size-'])]:size-4", // Groups
27
+ "group/tabs-trigger");
28
+ // Tabs content styles
29
+ const tabsContentStyles = cn("grow", "outline-none", "overflow-auto");
8
30
  const tabsVariants = cva("", {
9
31
  variants: {
10
32
  variant: {
@@ -16,7 +38,9 @@ const tabsVariants = cva("", {
16
38
  `**:data-[slot=tabs-list]:overflow-x-auto
17
39
  **:data-[slot=tabs-list]:divide-x`, // TabsTrigger
18
40
  `**:data-[slot=tabs-trigger]:max-w-80
41
+ **:data-[slot=tabs-trigger]:w-60
19
42
  **:data-[slot=tabs-trigger]:min-w-40
43
+ **:data-[slot=tabs-trigger]:data-[state=inactive]:text-text-secondary
20
44
  **:data-[slot=tabs-trigger]:data-[state=inactive]:border-b-1
21
45
  **:data-[slot=tabs-trigger]:data-[state=inactive]:border-b-border-secondary
22
46
  **:data-[slot=tabs-trigger]:data-[state=inactive]:pt-[9px]
@@ -27,7 +51,7 @@ const tabsVariants = cva("", {
27
51
  function Tabs({ className, variant, ...props }) {
28
52
  return /*#__PURE__*/ _jsx(TabsPrimitive.Root, {
29
53
  "data-slot": "tabs",
30
- className: cn("flex flex-col", tabsVariants({
54
+ className: cn(baseTabsStyles, tabsVariants({
31
55
  variant
32
56
  }), className),
33
57
  ...props
@@ -35,7 +59,7 @@ function Tabs({ className, variant, ...props }) {
35
59
  }
36
60
  export function TabsAddButton(props) {
37
61
  return /*#__PURE__*/ _jsx("div", {
38
- className: "grow h-full bg-bg-secondary border-l border-b",
62
+ className: tabsAddButtonContainerStyles,
39
63
  children: /*#__PURE__*/ _jsx(Button, {
40
64
  "data-slot": "tabs-add-button",
41
65
  variant: "link",
@@ -45,17 +69,299 @@ export function TabsAddButton(props) {
45
69
  })
46
70
  });
47
71
  }
48
- function TabsList({ className, ...props }) {
72
+ const horizontalScroll = (event)=>{
73
+ const mode = event.deltaMode;
74
+ let deltaPx = 0;
75
+ if (mode === 0) {
76
+ deltaPx = event.deltaY;
77
+ } else if (mode === 1) {
78
+ deltaPx = event.deltaY * 160;
79
+ } else if (mode === 2) {
80
+ deltaPx = event.currentTarget.clientWidth;
81
+ }
82
+ const newScrollLeft = event.currentTarget.scrollLeft + deltaPx;
83
+ event.currentTarget.scrollTo({
84
+ left: newScrollLeft,
85
+ behavior: "smooth"
86
+ });
87
+ };
88
+ const performHorizontalScroll = (tabsListRef, direction)=>{
89
+ if (!tabsListRef.current) return;
90
+ const scrollAmount = 160;
91
+ let newScrollLeft = tabsListRef.current.scrollLeft;
92
+ if (direction === "left") {
93
+ newScrollLeft -= scrollAmount;
94
+ newScrollLeft -= newScrollLeft % scrollAmount;
95
+ } else {
96
+ newScrollLeft += scrollAmount;
97
+ const rightCoord = newScrollLeft + tabsListRef.current.clientWidth;
98
+ if (rightCoord % scrollAmount !== 0) {
99
+ newScrollLeft += scrollAmount - rightCoord % scrollAmount;
100
+ }
101
+ }
102
+ tabsListRef.current.scrollTo({
103
+ left: newScrollLeft,
104
+ behavior: "smooth"
105
+ });
106
+ };
107
+ function TabsList({ className, onLeftEdge, onRightEdge, onResize, onFlow, onTabChange, ...props }) {
108
+ const tabListRef = React.useRef(null);
109
+ const onLeftEdgeRef = React.useRef(onLeftEdge);
110
+ React.useEffect(()=>{
111
+ onLeftEdgeRef.current = onLeftEdge;
112
+ }, [
113
+ onLeftEdge
114
+ ]);
115
+ const onResizeRef = React.useRef(onResize);
116
+ React.useEffect(()=>{
117
+ onResizeRef.current = onResize;
118
+ }, [
119
+ onResize
120
+ ]);
121
+ const onRightEdgeRef = React.useRef(onRightEdge);
122
+ React.useEffect(()=>{
123
+ onRightEdgeRef.current = onRightEdge;
124
+ }, [
125
+ onRightEdge
126
+ ]);
127
+ const onFlowRef = React.useRef(onFlow);
128
+ React.useEffect(()=>{
129
+ onFlowRef.current = onFlow;
130
+ }, [
131
+ onFlow
132
+ ]);
133
+ const onTabChangeRef = React.useRef(onTabChange);
134
+ React.useEffect(()=>{
135
+ onTabChangeRef.current = onTabChange;
136
+ }, [
137
+ onTabChange
138
+ ]);
139
+ React.useEffect(()=>{
140
+ if (tabListRef.current === null) {
141
+ return;
142
+ }
143
+ const tabList = tabListRef.current;
144
+ let last = null;
145
+ const handleScroll = ()=>{
146
+ if (onLeftEdgeRef.current) {
147
+ const newState = tabList.scrollLeft < 1 ? "touch" : "depart";
148
+ if (last === null) {
149
+ onLeftEdgeRef.current(newState);
150
+ } else {
151
+ const lastState = last.scrollLeft < 1 ? "touch" : "depart";
152
+ if (lastState !== newState) {
153
+ onLeftEdgeRef.current(newState);
154
+ }
155
+ }
156
+ }
157
+ if (onRightEdgeRef.current) {
158
+ const newState = tabList.scrollWidth - tabList.clientWidth - tabList.scrollLeft < 1 ? "touch" : "depart";
159
+ if (last === null) {
160
+ onRightEdgeRef.current(newState);
161
+ } else {
162
+ const lastState = last.scrollWidth - last.clientWidth - last.scrollLeft < 1 ? "touch" : "depart";
163
+ if (lastState !== newState) {
164
+ onRightEdgeRef.current(newState);
165
+ }
166
+ }
167
+ }
168
+ if (onFlowRef.current) {
169
+ const newState = tabList.scrollWidth > tabList.clientWidth ? "overflow" : "underflow";
170
+ if (last === null) {
171
+ onFlowRef.current(newState);
172
+ } else {
173
+ const lastState = last.scrollWidth > last.clientWidth ? "overflow" : "underflow";
174
+ if (lastState !== newState) {
175
+ onFlowRef.current(newState);
176
+ }
177
+ }
178
+ }
179
+ last = {
180
+ scrollLeft: tabList.scrollLeft,
181
+ scrollWidth: tabList.scrollWidth,
182
+ clientWidth: tabList.clientWidth
183
+ };
184
+ };
185
+ const scrollCallback = (_ev)=>handleScroll();
186
+ const resizeObserver = new ResizeObserver((entries)=>{
187
+ handleScroll();
188
+ if (onResizeRef.current) {
189
+ onResizeRef.current(entries);
190
+ }
191
+ });
192
+ const mutationObserver = new MutationObserver((mutationRecords)=>{
193
+ handleScroll();
194
+ if (onTabChangeRef.current) {
195
+ onTabChangeRef.current(mutationRecords);
196
+ }
197
+ });
198
+ tabList.addEventListener("scroll", scrollCallback, {
199
+ passive: true
200
+ });
201
+ resizeObserver.observe(tabList);
202
+ mutationObserver.observe(tabList, {
203
+ childList: true
204
+ });
205
+ return ()=>{
206
+ tabList.removeEventListener("scroll", scrollCallback);
207
+ resizeObserver.disconnect();
208
+ mutationObserver.disconnect();
209
+ };
210
+ }, []);
49
211
  return /*#__PURE__*/ _jsx(TabsPrimitive.List, {
50
212
  "data-slot": "tabs-list",
51
213
  className: cn("inline-flex w-fit items-center", className),
52
- ...props
214
+ ...props,
215
+ ref: (element)=>{
216
+ tabListRef.current = element;
217
+ if (props.ref !== undefined && props.ref !== null) {
218
+ if (typeof props.ref === "function") {
219
+ props.ref(element);
220
+ } else {
221
+ props.ref.current = element;
222
+ }
223
+ }
224
+ }
225
+ });
226
+ }
227
+ function TabScrollLeftButton({ disabled, onClick }) {
228
+ return /*#__PURE__*/ _jsx(Button, {
229
+ variant: "link",
230
+ size: "small",
231
+ disabled: disabled,
232
+ className: "h-full border-r border-b bg-bg-secondary",
233
+ onClick: onClick,
234
+ children: /*#__PURE__*/ _jsx(ChevronLeft, {})
235
+ });
236
+ }
237
+ function TabScrollRightButton({ disabled, onClick }) {
238
+ return /*#__PURE__*/ _jsx(Button, {
239
+ variant: "link",
240
+ size: "small",
241
+ disabled: disabled,
242
+ className: "h-full border-l border-b bg-bg-secondary",
243
+ onClick: onClick,
244
+ children: /*#__PURE__*/ _jsx(ChevronRight, {})
245
+ });
246
+ }
247
+ function TabsBrowserList({ className, children, ...props }) {
248
+ const tabsListRef = React.useRef(null);
249
+ const [showScrollButtons, setShowScrollButtons] = React.useState(false);
250
+ const [canScrollLeft, setCanScrollLeft] = React.useState(false);
251
+ const [canScrollRight, setCanScrollRight] = React.useState(false);
252
+ return /*#__PURE__*/ _jsxs(React.Fragment, {
253
+ children: [
254
+ showScrollButtons && /*#__PURE__*/ _jsx(TabScrollLeftButton, {
255
+ disabled: !canScrollLeft,
256
+ onClick: ()=>performHorizontalScroll(tabsListRef, "left")
257
+ }),
258
+ /*#__PURE__*/ _jsx(TabsList, {
259
+ onLeftEdge: (edgeState)=>{
260
+ if (edgeState === "touch") {
261
+ setCanScrollLeft(false);
262
+ } else {
263
+ setCanScrollLeft(true);
264
+ }
265
+ },
266
+ onRightEdge: (edgeState)=>{
267
+ if (edgeState === "touch") {
268
+ setCanScrollRight(false);
269
+ } else {
270
+ setCanScrollRight(true);
271
+ }
272
+ },
273
+ onFlow: (flow)=>{
274
+ if (flow === "overflow") {
275
+ setShowScrollButtons(true);
276
+ } else {
277
+ setShowScrollButtons(false);
278
+ }
279
+ },
280
+ onResize: ()=>{
281
+ tabsListRef.current?.querySelector('button[data-state="active"]')?.scrollIntoView();
282
+ },
283
+ onTabChange: (entries)=>{
284
+ if (entries.filter((entry)=>entry.addedNodes.length !== 0).length !== 0) {
285
+ tabsListRef.current?.querySelector('button[data-state="active"]')?.scrollIntoView();
286
+ }
287
+ },
288
+ "data-slot": "tabs-list",
289
+ className: cn(tabsListStyles, className),
290
+ onWheel: (event)=>horizontalScroll(event),
291
+ ...props,
292
+ ref: tabsListRef,
293
+ children: children
294
+ }),
295
+ showScrollButtons && /*#__PURE__*/ _jsx(TabScrollRightButton, {
296
+ disabled: !canScrollRight,
297
+ onClick: ()=>performHorizontalScroll(tabsListRef, "right")
298
+ })
299
+ ]
300
+ });
301
+ }
302
+ export function TabsListDropdown({ tabs, handleTabSelect, handleCloseTab }) {
303
+ const [isMenuOpen, setIsMenuOpen] = React.useState(false);
304
+ return /*#__PURE__*/ _jsxs(Popover, {
305
+ open: isMenuOpen,
306
+ onOpenChange: setIsMenuOpen,
307
+ children: [
308
+ /*#__PURE__*/ _jsx(PopoverTrigger, {
309
+ asChild: true,
310
+ children: /*#__PURE__*/ _jsx(Button, {
311
+ variant: "link",
312
+ className: "bg-bg-secondary h-full border-b pr-6",
313
+ children: /*#__PURE__*/ _jsx(ChevronDownIcon, {
314
+ className: "size-4"
315
+ })
316
+ })
317
+ }),
318
+ /*#__PURE__*/ _jsx(PopoverContent, {
319
+ className: "w-80 p-0 mr-3",
320
+ align: "end",
321
+ children: /*#__PURE__*/ _jsxs(Command, {
322
+ children: [
323
+ /*#__PURE__*/ _jsx(CommandInput, {
324
+ placeholder: "Search tabs..."
325
+ }),
326
+ /*#__PURE__*/ _jsxs(CommandList, {
327
+ children: [
328
+ /*#__PURE__*/ _jsx(CommandEmpty, {
329
+ children: "Not tabs found."
330
+ }),
331
+ tabs.map((tab)=>/*#__PURE__*/ _jsxs(CommandItem, {
332
+ onSelect: ()=>{
333
+ handleTabSelect?.(tab.id);
334
+ setIsMenuOpen(false);
335
+ },
336
+ className: "group flex items-center justify-between",
337
+ children: [
338
+ tab.content,
339
+ tabs.length > 1 && /*#__PURE__*/ _jsx(Button, {
340
+ variant: "ghost",
341
+ size: "small",
342
+ className: "opacity-0 group-hover:opacity-100 transition-opacity p-1 ml-2",
343
+ onClick: (e)=>{
344
+ e.stopPropagation();
345
+ handleCloseTab?.(tab.id);
346
+ },
347
+ children: /*#__PURE__*/ _jsx(X, {
348
+ className: "size-3"
349
+ })
350
+ })
351
+ ]
352
+ }, tab.id))
353
+ ]
354
+ })
355
+ ]
356
+ })
357
+ })
358
+ ]
53
359
  });
54
360
  }
55
361
  function TabsTrigger({ className, onClose, ...props }) {
56
362
  return /*#__PURE__*/ _jsxs(TabsPrimitive.Trigger, {
57
363
  "data-slot": "tabs-trigger",
58
- className: cn("group/tabs-trigger", "box-border h-10 typo-body px-3 pb-2 pt-2.5 cursor-pointer text-text-tertiary data-[state=active]:text-text-primary", "data-[state=active]:border-b-border-brand border-b-2 border-b-transparent hover:text-text-tertiary-hover focus-visible:border-ring", "focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:text-muted-foreground", "inline-flex flex-1 items-center justify-center whitespace-nowrap transition-[color,box-shadow]", "focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "hover:bg-bg-secondary/60", onClose ? "justify-between" : "", className),
364
+ className: cn(baseTabsTriggerStyles, onClose ? "justify-between" : "justify-start", className),
59
365
  ...props,
60
366
  children: [
61
367
  props.children,
@@ -66,7 +372,7 @@ function TabsTrigger({ className, onClose, ...props }) {
66
372
  },
67
373
  variant: "link",
68
374
  size: "small",
69
- className: "p-0 ml-2",
375
+ className: "p-0 ml-2 opacity-0 group-hover/tabs-trigger:opacity-100 transition-opacity",
70
376
  asChild: true,
71
377
  children: /*#__PURE__*/ _jsx("span", {
72
378
  children: /*#__PURE__*/ _jsx(X, {})
@@ -78,10 +384,10 @@ function TabsTrigger({ className, onClose, ...props }) {
78
384
  function TabsContent({ className, ...props }) {
79
385
  return /*#__PURE__*/ _jsx(TabsPrimitive.Content, {
80
386
  "data-slot": "tabs-content",
81
- className: cn("flex-1 outline-none", className),
387
+ className: cn(tabsContentStyles, className),
82
388
  ...props
83
389
  });
84
390
  }
85
- export { Tabs, TabsList, TabsTrigger, TabsContent };
391
+ export { Tabs, TabsList, TabsTrigger, TabsContent, TabsBrowserList };
86
392
 
87
393
  //# sourceMappingURL=tabs.js.map