@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
@@ -1,18 +1,33 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
- import { CheckIcon } from "lucide-react";
4
+ import { CheckIcon, MinusIcon } from "lucide-react";
5
5
  import { cn } from "../../lib/utils.js";
6
6
  function Checkbox({ className, ...props }) {
7
7
  return /*#__PURE__*/ _jsx(CheckboxPrimitive.Root, {
8
8
  "data-slot": "checkbox",
9
- className: cn("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
9
+ className: cn(// Base styles
10
+ "peer", "size-5", "shrink-0", "rounded-md", "border-[1.5px]", "transition-all", "duration-200", "outline-none", "cursor-pointer", "text-white", // Click animation
11
+ "active:scale-90", "active:duration-75", // Default state
12
+ "border-border-primary", "bg-transparent", "hover:bg-bg-tertiary", // Checked state
13
+ "data-[state=checked]:bg-bg-link", "data-[state=checked]:border-border-link", "data-[state=checked]:text-white", // Indeterminate state
14
+ "data-[state=indeterminate]:bg-fg-link", "data-[state=indeterminate]:border-fg-link", "data-[state=indeterminate]:text-white", // Disabled states
15
+ "disabled:cursor-not-allowed", "disabled:active:scale-100", "disabled:border-border-secondary", "disabled:bg-transparent", "disabled:data-[state=checked]:bg-fg-tertiary", "disabled:data-[state=checked]:border-fg-tertiary", "disabled:data-[state=indeterminate]:bg-fg-tertiary", "disabled:data-[state=indeterminate]:border-fg-tertiary", // Focus state
16
+ "focus-visible:ring-2", "focus-visible:ring-utility-blue/70", className),
10
17
  ...props,
11
18
  children: /*#__PURE__*/ _jsx(CheckboxPrimitive.Indicator, {
12
19
  "data-slot": "checkbox-indicator",
13
- className: "flex items-center justify-center text-current transition-none",
14
- children: /*#__PURE__*/ _jsx(CheckIcon, {
15
- className: "size-3.5"
20
+ className: "flex items-center justify-center text-white",
21
+ children: props.checked === "indeterminate" ? /*#__PURE__*/ _jsx(MinusIcon, {
22
+ className: "size-3.5",
23
+ style: {
24
+ strokeWidth: 3
25
+ }
26
+ }) : /*#__PURE__*/ _jsx(CheckIcon, {
27
+ className: "size-3.5",
28
+ style: {
29
+ strokeWidth: 3
30
+ }
16
31
  })
17
32
  })
18
33
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shadcn/components/ui/checkbox.tsx"],"sourcesContent":["\"use client\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nfunction Checkbox({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n\treturn (\n\t\t<CheckboxPrimitive.Root\n\t\t\tdata-slot=\"checkbox\"\n\t\t\tclassName={cn(\n\t\t\t\t\"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow 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<CheckboxPrimitive.Indicator\n\t\t\t\tdata-slot=\"checkbox-indicator\"\n\t\t\t\tclassName=\"flex items-center justify-center text-current transition-none\"\n\t\t\t>\n\t\t\t\t<CheckIcon className=\"size-3.5\" />\n\t\t\t</CheckboxPrimitive.Indicator>\n\t\t</CheckboxPrimitive.Root>\n\t);\n}\n\nexport { Checkbox };\n"],"names":["CheckboxPrimitive","CheckIcon","cn","Checkbox","className","props","Root","data-slot","Indicator"],"mappings":"AAAA;;AACA,YAAYA,uBAAuB,2BAA2B;AAC9D,SAASC,SAAS,QAAQ,eAAe;AAGzC,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,SAASC,SAAS,EACjBC,SAAS,EACT,GAAGC,OACkD;IACrD,qBACC,KAACL,kBAAkBM,IAAI;QACtBC,aAAU;QACVH,WAAWF,GACV,+eACAE;QAEA,GAAGC,KAAK;kBAET,cAAA,KAACL,kBAAkBQ,SAAS;YAC3BD,aAAU;YACVH,WAAU;sBAEV,cAAA,KAACH;gBAAUG,WAAU;;;;AAIzB;AAEA,SAASD,QAAQ,GAAG"}
1
+ {"version":3,"sources":["../../../../../src/shadcn/components/ui/checkbox.tsx"],"sourcesContent":["\"use client\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon, MinusIcon } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nfunction Checkbox({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n\treturn (\n\t\t<CheckboxPrimitive.Root\n\t\t\tdata-slot=\"checkbox\"\n\t\t\tclassName={cn(\n\t\t\t\t// Base styles\n\t\t\t\t\"peer\",\n\t\t\t\t\"size-5\",\n\t\t\t\t\"shrink-0\",\n\t\t\t\t\"rounded-md\",\n\t\t\t\t\"border-[1.5px]\",\n\t\t\t\t\"transition-all\",\n\t\t\t\t\"duration-200\",\n\t\t\t\t\"outline-none\",\n\t\t\t\t\"cursor-pointer\",\n\t\t\t\t\"text-white\",\n\t\t\t\t// Click animation\n\t\t\t\t\"active:scale-90\",\n\t\t\t\t\"active:duration-75\",\n\t\t\t\t// Default state\n\t\t\t\t\"border-border-primary\",\n\t\t\t\t\"bg-transparent\",\n\t\t\t\t\"hover:bg-bg-tertiary\",\n\t\t\t\t// Checked state\n\t\t\t\t\"data-[state=checked]:bg-bg-link\",\n\t\t\t\t\"data-[state=checked]:border-border-link\",\n\t\t\t\t\"data-[state=checked]:text-white\",\n\t\t\t\t// Indeterminate state\n\t\t\t\t\"data-[state=indeterminate]:bg-fg-link\",\n\t\t\t\t\"data-[state=indeterminate]:border-fg-link\",\n\t\t\t\t\"data-[state=indeterminate]:text-white\",\n\t\t\t\t// Disabled states\n\t\t\t\t\"disabled:cursor-not-allowed\",\n\t\t\t\t\"disabled:active:scale-100\",\n\t\t\t\t\"disabled:border-border-secondary\",\n\t\t\t\t\"disabled:bg-transparent\",\n\t\t\t\t\"disabled:data-[state=checked]:bg-fg-tertiary\",\n\t\t\t\t\"disabled:data-[state=checked]:border-fg-tertiary\",\n\t\t\t\t\"disabled:data-[state=indeterminate]:bg-fg-tertiary\",\n\t\t\t\t\"disabled:data-[state=indeterminate]:border-fg-tertiary\",\n\t\t\t\t// Focus state\n\t\t\t\t\"focus-visible:ring-2\",\n\t\t\t\t\"focus-visible:ring-utility-blue/70\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<CheckboxPrimitive.Indicator\n\t\t\t\tdata-slot=\"checkbox-indicator\"\n\t\t\t\tclassName=\"flex items-center justify-center text-white\"\n\t\t\t>\n\t\t\t\t{props.checked === \"indeterminate\" ? (\n\t\t\t\t\t<MinusIcon className=\"size-3.5\" style={{ strokeWidth: 3 }} />\n\t\t\t\t) : (\n\t\t\t\t\t<CheckIcon className=\"size-3.5\" style={{ strokeWidth: 3 }} />\n\t\t\t\t)}\n\t\t\t</CheckboxPrimitive.Indicator>\n\t\t</CheckboxPrimitive.Root>\n\t);\n}\n\nexport { Checkbox };\n"],"names":["CheckboxPrimitive","CheckIcon","MinusIcon","cn","Checkbox","className","props","Root","data-slot","Indicator","checked","style","strokeWidth"],"mappings":"AAAA;;AACA,YAAYA,uBAAuB,2BAA2B;AAC9D,SAASC,SAAS,EAAEC,SAAS,QAAQ,eAAe;AAGpD,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,SAASC,SAAS,EACjBC,SAAS,EACT,GAAGC,OACkD;IACrD,qBACC,KAACN,kBAAkBO,IAAI;QACtBC,aAAU;QACVH,WAAWF,GACV,cAAc;QACd,QACA,UACA,YACA,cACA,kBACA,kBACA,gBACA,gBACA,kBACA,cACA,kBAAkB;QAClB,mBACA,sBACA,gBAAgB;QAChB,yBACA,kBACA,wBACA,gBAAgB;QAChB,mCACA,2CACA,mCACA,sBAAsB;QACtB,yCACA,6CACA,yCACA,kBAAkB;QAClB,+BACA,6BACA,oCACA,2BACA,gDACA,oDACA,sDACA,0DACA,cAAc;QACd,wBACA,sCACAE;QAEA,GAAGC,KAAK;kBAET,cAAA,KAACN,kBAAkBS,SAAS;YAC3BD,aAAU;YACVH,WAAU;sBAETC,MAAMI,OAAO,KAAK,gCAClB,KAACR;gBAAUG,WAAU;gBAAWM,OAAO;oBAAEC,aAAa;gBAAE;+BAExD,KAACX;gBAAUI,WAAU;gBAAWM,OAAO;oBAAEC,aAAa;gBAAE;;;;AAK7D;AAEA,SAASR,QAAQ,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.stories.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/checkbox.stories.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,IAAI;;CAEM,CAAC;AACjB,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,IAAI;;CAqCA,CAAC"}
1
+ {"version":3,"file":"checkbox.stories.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/checkbox.stories.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,IAAI;;CAEM,CAAC;AACjB,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,IAAI;;CAiCA,CAAC"}
@@ -17,65 +17,74 @@ export const Demo = {
17
17
  }),
18
18
  /*#__PURE__*/ _jsx(Label, {
19
19
  htmlFor: "terms",
20
- children: "Accept terms and conditions"
20
+ children: "Unchecked"
21
21
  })
22
22
  ]
23
23
  }),
24
24
  /*#__PURE__*/ _jsxs("div", {
25
- className: "flex items-start gap-3",
25
+ className: "flex items-center gap-3",
26
26
  children: [
27
27
  /*#__PURE__*/ _jsx(Checkbox, {
28
28
  id: "terms-2",
29
29
  defaultChecked: true
30
30
  }),
31
- /*#__PURE__*/ _jsxs("div", {
32
- className: "grid gap-2",
33
- children: [
34
- /*#__PURE__*/ _jsx(Label, {
35
- htmlFor: "terms-2",
36
- children: "Accept terms and conditions"
37
- }),
38
- /*#__PURE__*/ _jsx("p", {
39
- className: "text-muted-foreground text-sm",
40
- children: "By clicking this checkbox, you agree to the terms and conditions."
41
- })
42
- ]
31
+ /*#__PURE__*/ _jsx(Label, {
32
+ htmlFor: "terms-2",
33
+ children: "Checked"
43
34
  })
44
35
  ]
45
36
  }),
46
37
  /*#__PURE__*/ _jsxs("div", {
47
- className: "flex items-start gap-3",
38
+ className: "flex items-center gap-3",
48
39
  children: [
49
40
  /*#__PURE__*/ _jsx(Checkbox, {
50
- id: "toggle",
41
+ id: "indeterminate",
42
+ checked: "indeterminate"
43
+ }),
44
+ /*#__PURE__*/ _jsx(Label, {
45
+ htmlFor: "indeterminate",
46
+ children: "Indeterminate"
47
+ })
48
+ ]
49
+ }),
50
+ /*#__PURE__*/ _jsxs("div", {
51
+ className: "flex items-center gap-3",
52
+ children: [
53
+ /*#__PURE__*/ _jsx(Checkbox, {
54
+ id: "disabled",
51
55
  disabled: true
52
56
  }),
53
57
  /*#__PURE__*/ _jsx(Label, {
54
- htmlFor: "toggle",
55
- children: "Enable notifications"
58
+ htmlFor: "disabled",
59
+ children: "Disabled unchecked"
56
60
  })
57
61
  ]
58
62
  }),
59
- /*#__PURE__*/ _jsxs(Label, {
60
- className: "hover:bg-accent/50 flex items-start gap-3 rounded-lg border p-3 has-[[aria-checked=true]]:border-blue-600 has-[[aria-checked=true]]:bg-blue-50 dark:has-[[aria-checked=true]]:border-blue-900 dark:has-[[aria-checked=true]]:bg-blue-950",
63
+ /*#__PURE__*/ _jsxs("div", {
64
+ className: "flex items-center gap-3",
65
+ children: [
66
+ /*#__PURE__*/ _jsx(Checkbox, {
67
+ id: "disabled-checked",
68
+ disabled: true,
69
+ defaultChecked: true
70
+ }),
71
+ /*#__PURE__*/ _jsx(Label, {
72
+ htmlFor: "disabled-checked",
73
+ children: "Disabled checked"
74
+ })
75
+ ]
76
+ }),
77
+ /*#__PURE__*/ _jsxs("div", {
78
+ className: "flex items-center gap-3",
61
79
  children: [
62
80
  /*#__PURE__*/ _jsx(Checkbox, {
63
- id: "toggle-2",
64
- defaultChecked: true,
65
- className: "data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 data-[state=checked]:text-white dark:data-[state=checked]:border-blue-700 dark:data-[state=checked]:bg-blue-700"
81
+ id: "disabled-indeterminate",
82
+ disabled: true,
83
+ checked: "indeterminate"
66
84
  }),
67
- /*#__PURE__*/ _jsxs("div", {
68
- className: "grid gap-1.5 font-normal",
69
- children: [
70
- /*#__PURE__*/ _jsx("p", {
71
- className: "text-sm leading-none font-medium",
72
- children: "Enable notifications"
73
- }),
74
- /*#__PURE__*/ _jsx("p", {
75
- className: "text-muted-foreground text-sm",
76
- children: "You can enable or disable notifications at any time."
77
- })
78
- ]
85
+ /*#__PURE__*/ _jsx(Label, {
86
+ htmlFor: "disabled-indeterminate",
87
+ children: "Disabled indeterminate"
79
88
  })
80
89
  ]
81
90
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shadcn/components/ui/checkbox.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { Checkbox } from \"#shadcn/components/ui/checkbox\";\nimport { Label } from \"#shadcn/components/ui/label\";\n\nconst meta = {\n\ttitle: \"Component/Checkbox\",\n} satisfies Meta;\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Demo = {\n\trender: () => (\n\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t<div className=\"flex items-center gap-3\">\n\t\t\t\t<Checkbox id=\"terms\" />\n\t\t\t\t<Label htmlFor=\"terms\">Accept terms and conditions</Label>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-start gap-3\">\n\t\t\t\t<Checkbox id=\"terms-2\" defaultChecked />\n\t\t\t\t<div className=\"grid gap-2\">\n\t\t\t\t\t<Label htmlFor=\"terms-2\">Accept terms and conditions</Label>\n\t\t\t\t\t<p className=\"text-muted-foreground text-sm\">\n\t\t\t\t\t\tBy clicking this checkbox, you agree to the terms and conditions.\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-start gap-3\">\n\t\t\t\t<Checkbox id=\"toggle\" disabled />\n\t\t\t\t<Label htmlFor=\"toggle\">Enable notifications</Label>\n\t\t\t</div>\n\t\t\t<Label className=\"hover:bg-accent/50 flex items-start gap-3 rounded-lg border p-3 has-[[aria-checked=true]]:border-blue-600 has-[[aria-checked=true]]:bg-blue-50 dark:has-[[aria-checked=true]]:border-blue-900 dark:has-[[aria-checked=true]]:bg-blue-950\">\n\t\t\t\t<Checkbox\n\t\t\t\t\tid=\"toggle-2\"\n\t\t\t\t\tdefaultChecked\n\t\t\t\t\tclassName=\"data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 data-[state=checked]:text-white dark:data-[state=checked]:border-blue-700 dark:data-[state=checked]:bg-blue-700\"\n\t\t\t\t/>\n\t\t\t\t<div className=\"grid gap-1.5 font-normal\">\n\t\t\t\t\t<p className=\"text-sm leading-none font-medium\">\n\t\t\t\t\t\tEnable notifications\n\t\t\t\t\t</p>\n\t\t\t\t\t<p className=\"text-muted-foreground text-sm\">\n\t\t\t\t\t\tYou can enable or disable notifications at any time.\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</Label>\n\t\t</div>\n\t),\n} satisfies Story;\n"],"names":["Checkbox","Label","meta","title","Demo","render","div","className","id","htmlFor","defaultChecked","p","disabled"],"mappings":";AACA,SAASA,QAAQ,QAAQ,gBAAiC;AAC1D,SAASC,KAAK,QAAQ,aAA8B;AAEpD,MAAMC,OAAO;IACZC,OAAO;AACR;AACA,eAAeD,KAAK;AAIpB,OAAO,MAAME,OAAO;IACnBC,QAAQ,kBACP,MAACC;YAAIC,WAAU;;8BACd,MAACD;oBAAIC,WAAU;;sCACd,KAACP;4BAASQ,IAAG;;sCACb,KAACP;4BAAMQ,SAAQ;sCAAQ;;;;8BAExB,MAACH;oBAAIC,WAAU;;sCACd,KAACP;4BAASQ,IAAG;4BAAUE,cAAc;;sCACrC,MAACJ;4BAAIC,WAAU;;8CACd,KAACN;oCAAMQ,SAAQ;8CAAU;;8CACzB,KAACE;oCAAEJ,WAAU;8CAAgC;;;;;;8BAK/C,MAACD;oBAAIC,WAAU;;sCACd,KAACP;4BAASQ,IAAG;4BAASI,QAAQ;;sCAC9B,KAACX;4BAAMQ,SAAQ;sCAAS;;;;8BAEzB,MAACR;oBAAMM,WAAU;;sCAChB,KAACP;4BACAQ,IAAG;4BACHE,cAAc;4BACdH,WAAU;;sCAEX,MAACD;4BAAIC,WAAU;;8CACd,KAACI;oCAAEJ,WAAU;8CAAmC;;8CAGhD,KAACI;oCAAEJ,WAAU;8CAAgC;;;;;;;;AAOlD,EAAkB"}
1
+ {"version":3,"sources":["../../../../../src/shadcn/components/ui/checkbox.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { Checkbox } from \"#shadcn/components/ui/checkbox\";\nimport { Label } from \"#shadcn/components/ui/label\";\n\nconst meta = {\n\ttitle: \"Component/Checkbox\",\n} satisfies Meta;\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Demo = {\n\trender: () => (\n\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t<div className=\"flex items-center gap-3\">\n\t\t\t\t<Checkbox id=\"terms\" />\n\t\t\t\t<Label htmlFor=\"terms\">Unchecked</Label>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-center gap-3\">\n\t\t\t\t<Checkbox id=\"terms-2\" defaultChecked />\n\t\t\t\t<Label htmlFor=\"terms-2\">Checked</Label>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-center gap-3\">\n\t\t\t\t<Checkbox id=\"indeterminate\" checked=\"indeterminate\" />\n\t\t\t\t<Label htmlFor=\"indeterminate\">Indeterminate</Label>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-center gap-3\">\n\t\t\t\t<Checkbox id=\"disabled\" disabled />\n\t\t\t\t<Label htmlFor=\"disabled\">Disabled unchecked</Label>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-center gap-3\">\n\t\t\t\t<Checkbox id=\"disabled-checked\" disabled defaultChecked />\n\t\t\t\t<Label htmlFor=\"disabled-checked\">Disabled checked</Label>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-center gap-3\">\n\t\t\t\t<Checkbox\n\t\t\t\t\tid=\"disabled-indeterminate\"\n\t\t\t\t\tdisabled\n\t\t\t\t\tchecked=\"indeterminate\"\n\t\t\t\t/>\n\t\t\t\t<Label htmlFor=\"disabled-indeterminate\">Disabled indeterminate</Label>\n\t\t\t</div>\n\t\t</div>\n\t),\n} satisfies Story;\n"],"names":["Checkbox","Label","meta","title","Demo","render","div","className","id","htmlFor","defaultChecked","checked","disabled"],"mappings":";AACA,SAASA,QAAQ,QAAQ,gBAAiC;AAC1D,SAASC,KAAK,QAAQ,aAA8B;AAEpD,MAAMC,OAAO;IACZC,OAAO;AACR;AACA,eAAeD,KAAK;AAIpB,OAAO,MAAME,OAAO;IACnBC,QAAQ,kBACP,MAACC;YAAIC,WAAU;;8BACd,MAACD;oBAAIC,WAAU;;sCACd,KAACP;4BAASQ,IAAG;;sCACb,KAACP;4BAAMQ,SAAQ;sCAAQ;;;;8BAExB,MAACH;oBAAIC,WAAU;;sCACd,KAACP;4BAASQ,IAAG;4BAAUE,cAAc;;sCACrC,KAACT;4BAAMQ,SAAQ;sCAAU;;;;8BAE1B,MAACH;oBAAIC,WAAU;;sCACd,KAACP;4BAASQ,IAAG;4BAAgBG,SAAQ;;sCACrC,KAACV;4BAAMQ,SAAQ;sCAAgB;;;;8BAEhC,MAACH;oBAAIC,WAAU;;sCACd,KAACP;4BAASQ,IAAG;4BAAWI,QAAQ;;sCAChC,KAACX;4BAAMQ,SAAQ;sCAAW;;;;8BAE3B,MAACH;oBAAIC,WAAU;;sCACd,KAACP;4BAASQ,IAAG;4BAAmBI,QAAQ;4BAACF,cAAc;;sCACvD,KAACT;4BAAMQ,SAAQ;sCAAmB;;;;8BAEnC,MAACH;oBAAIC,WAAU;;sCACd,KAACP;4BACAQ,IAAG;4BACHI,QAAQ;4BACRD,SAAQ;;sCAET,KAACV;4BAAMQ,SAAQ;sCAAyB;;;;;;AAI5C,EAAkB"}
@@ -0,0 +1,18 @@
1
+ export interface ComboboxOption {
2
+ value: string;
3
+ label: string;
4
+ }
5
+ interface ComboboxProps {
6
+ options: ComboboxOption[];
7
+ value?: string;
8
+ onValueChange?: (value: string) => void;
9
+ placeholder?: string;
10
+ searchPlaceholder?: string;
11
+ emptyText?: string;
12
+ disabled?: boolean;
13
+ className?: string;
14
+ }
15
+ export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, disabled, className, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function ComboboxDemo(): import("react/jsx-runtime").JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/combobox.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd;AAED,UAAU,aAAa;IACtB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,QAAQ,CAAC,EACxB,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAAgC,EAChC,iBAA+B,EAC/B,SAA+B,EAC/B,QAAgB,EAChB,SAAS,GACT,EAAE,aAAa,2CA0Ef;AAWD,wBAAgB,YAAY,4CAY3B"}
@@ -0,0 +1,121 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { CheckIcon } from "lucide-react";
4
+ import * as React from "react";
5
+ import { Command, CommandEmpty, CommandInput, CommandItem, CommandList } from "./command.js";
6
+ import { Select, SelectContent, SelectTrigger, SelectValue } from "./select.js";
7
+ import { cn } from "../../lib/utils.js";
8
+ export function Combobox({ options, value, onValueChange, placeholder = "Select option...", searchPlaceholder = "Search...", emptyText = "No options found.", disabled = false, className }) {
9
+ const [open, setOpen] = React.useState(false);
10
+ const [searchValue, setSearchValue] = React.useState("");
11
+ const inputRef = React.useRef(null);
12
+ const filteredOptions = React.useMemo(()=>{
13
+ if (!searchValue) return options;
14
+ return options.filter((option)=>option.label.toLowerCase().includes(searchValue.toLowerCase()));
15
+ }, [
16
+ options,
17
+ searchValue
18
+ ]);
19
+ const selectedOption = options.find((option)=>option.value === value);
20
+ // Reset search when closing and auto-focus when opening
21
+ React.useEffect(()=>{
22
+ if (!open) {
23
+ setSearchValue("");
24
+ } else {
25
+ // Auto-focus on search input when opening
26
+ setTimeout(()=>{
27
+ inputRef.current?.focus();
28
+ }, 0);
29
+ }
30
+ }, [
31
+ open
32
+ ]);
33
+ return /*#__PURE__*/ _jsxs(Select, {
34
+ value: value || "",
35
+ ...onValueChange && {
36
+ onValueChange
37
+ },
38
+ disabled: disabled,
39
+ open: open,
40
+ onOpenChange: setOpen,
41
+ children: [
42
+ /*#__PURE__*/ _jsx(SelectTrigger, {
43
+ className: className,
44
+ children: /*#__PURE__*/ _jsx(SelectValue, {
45
+ placeholder: placeholder,
46
+ children: selectedOption?.label
47
+ })
48
+ }),
49
+ /*#__PURE__*/ _jsx(SelectContent, {
50
+ className: "p-0 [&_[data-radix-select-viewport]]:p-0",
51
+ children: /*#__PURE__*/ _jsxs(Command, {
52
+ className: "w-full",
53
+ children: [
54
+ /*#__PURE__*/ _jsx(CommandInput, {
55
+ ref: inputRef,
56
+ placeholder: searchPlaceholder,
57
+ value: searchValue,
58
+ onValueChange: setSearchValue
59
+ }),
60
+ /*#__PURE__*/ _jsxs(CommandList, {
61
+ children: [
62
+ /*#__PURE__*/ _jsx(CommandEmpty, {
63
+ children: emptyText
64
+ }),
65
+ filteredOptions.map((option)=>/*#__PURE__*/ _jsxs(CommandItem, {
66
+ value: option.value,
67
+ "data-state": value === option.value ? "checked" : undefined,
68
+ onSelect: (currentValue)=>{
69
+ onValueChange?.(currentValue);
70
+ setOpen(false);
71
+ },
72
+ children: [
73
+ option.label,
74
+ /*#__PURE__*/ _jsx(CheckIcon, {
75
+ className: cn("ml-auto size-4", value === option.value ? "opacity-100" : "opacity-0")
76
+ })
77
+ ]
78
+ }, option.value))
79
+ ]
80
+ })
81
+ ]
82
+ })
83
+ })
84
+ ]
85
+ });
86
+ }
87
+ // Demo component for Storybook
88
+ const demoOptions = [
89
+ {
90
+ value: "next.js",
91
+ label: "Next.js"
92
+ },
93
+ {
94
+ value: "sveltekit",
95
+ label: "SvelteKit"
96
+ },
97
+ {
98
+ value: "nuxt.js",
99
+ label: "Nuxt.js"
100
+ },
101
+ {
102
+ value: "remix",
103
+ label: "Remix"
104
+ },
105
+ {
106
+ value: "astro",
107
+ label: "Astro"
108
+ }
109
+ ];
110
+ export function ComboboxDemo() {
111
+ const [value, setValue] = React.useState("");
112
+ return /*#__PURE__*/ _jsx(Combobox, {
113
+ options: demoOptions,
114
+ value: value,
115
+ onValueChange: setValue,
116
+ placeholder: "Select framework...",
117
+ searchPlaceholder: "Search framework..."
118
+ });
119
+ }
120
+
121
+ //# sourceMappingURL=combobox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/shadcn/components/ui/combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n} from \"#shadcn/components/ui/command\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectTrigger,\n\tSelectValue,\n} from \"#shadcn/components/ui/select\";\nimport { cn } from \"#shadcn/lib/utils\";\n\nexport interface ComboboxOption {\n\tvalue: string;\n\tlabel: string;\n}\n\ninterface ComboboxProps {\n\toptions: ComboboxOption[];\n\tvalue?: string;\n\tonValueChange?: (value: string) => void;\n\tplaceholder?: string;\n\tsearchPlaceholder?: string;\n\temptyText?: string;\n\tdisabled?: boolean;\n\tclassName?: string;\n}\n\nexport function Combobox({\n\toptions,\n\tvalue,\n\tonValueChange,\n\tplaceholder = \"Select option...\",\n\tsearchPlaceholder = \"Search...\",\n\temptyText = \"No options found.\",\n\tdisabled = false,\n\tclassName,\n}: ComboboxProps) {\n\tconst [open, setOpen] = React.useState(false);\n\tconst [searchValue, setSearchValue] = React.useState(\"\");\n\tconst inputRef = React.useRef<HTMLInputElement>(null);\n\n\tconst filteredOptions = React.useMemo(() => {\n\t\tif (!searchValue) return options;\n\t\treturn options.filter((option) =>\n\t\t\toption.label.toLowerCase().includes(searchValue.toLowerCase()),\n\t\t);\n\t}, [options, searchValue]);\n\n\tconst selectedOption = options.find((option) => option.value === value);\n\n\t// Reset search when closing and auto-focus when opening\n\tReact.useEffect(() => {\n\t\tif (!open) {\n\t\t\tsetSearchValue(\"\");\n\t\t} else {\n\t\t\t// Auto-focus on search input when opening\n\t\t\tsetTimeout(() => {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}, 0);\n\t\t}\n\t}, [open]);\n\n\treturn (\n\t\t<Select\n\t\t\tvalue={value || \"\"}\n\t\t\t{...(onValueChange && { onValueChange })}\n\t\t\tdisabled={disabled}\n\t\t\topen={open}\n\t\t\tonOpenChange={setOpen}\n\t\t>\n\t\t\t<SelectTrigger className={className}>\n\t\t\t\t<SelectValue placeholder={placeholder}>\n\t\t\t\t\t{selectedOption?.label}\n\t\t\t\t</SelectValue>\n\t\t\t</SelectTrigger>\n\t\t\t<SelectContent className=\"p-0 [&_[data-radix-select-viewport]]:p-0\">\n\t\t\t\t<Command className=\"w-full\">\n\t\t\t\t\t<CommandInput\n\t\t\t\t\t\tref={inputRef}\n\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\tonValueChange={setSearchValue}\n\t\t\t\t\t/>\n\t\t\t\t\t<CommandList>\n\t\t\t\t\t\t<CommandEmpty>{emptyText}</CommandEmpty>\n\n\t\t\t\t\t\t{filteredOptions.map((option) => (\n\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\t\tdata-state={value === option.value ? \"checked\" : undefined}\n\t\t\t\t\t\t\t\tonSelect={(currentValue) => {\n\t\t\t\t\t\t\t\t\tonValueChange?.(currentValue);\n\t\t\t\t\t\t\t\t\tsetOpen(false);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t<CheckIcon\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\"ml-auto size-4\",\n\t\t\t\t\t\t\t\t\t\tvalue === option.value ? \"opacity-100\" : \"opacity-0\",\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</CommandList>\n\t\t\t\t</Command>\n\t\t\t</SelectContent>\n\t\t</Select>\n\t);\n}\n\n// Demo component for Storybook\nconst demoOptions = [\n\t{ value: \"next.js\", label: \"Next.js\" },\n\t{ value: \"sveltekit\", label: \"SvelteKit\" },\n\t{ value: \"nuxt.js\", label: \"Nuxt.js\" },\n\t{ value: \"remix\", label: \"Remix\" },\n\t{ value: \"astro\", label: \"Astro\" },\n];\n\nexport function ComboboxDemo() {\n\tconst [value, setValue] = React.useState(\"\");\n\n\treturn (\n\t\t<Combobox\n\t\t\toptions={demoOptions}\n\t\t\tvalue={value}\n\t\t\tonValueChange={setValue}\n\t\t\tplaceholder=\"Select framework...\"\n\t\t\tsearchPlaceholder=\"Search framework...\"\n\t\t/>\n\t);\n}\n"],"names":["CheckIcon","React","Command","CommandEmpty","CommandInput","CommandItem","CommandList","Select","SelectContent","SelectTrigger","SelectValue","cn","Combobox","options","value","onValueChange","placeholder","searchPlaceholder","emptyText","disabled","className","open","setOpen","useState","searchValue","setSearchValue","inputRef","useRef","filteredOptions","useMemo","filter","option","label","toLowerCase","includes","selectedOption","find","useEffect","setTimeout","current","focus","onOpenChange","ref","map","data-state","undefined","onSelect","currentValue","demoOptions","ComboboxDemo","setValue"],"mappings":"AAAA;;AAEA,SAASA,SAAS,QAAQ,eAAe;AACzC,YAAYC,WAAW,QAAQ;AAC/B,SACCC,OAAO,EACPC,YAAY,EACZC,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;;sCAClB,KAAChB;4BACAsC,KAAKhB;4BACLV,aAAaC;4BACbH,OAAOU;4BACPT,eAAeU;;sCAEhB,MAACnB;;8CACA,KAACH;8CAAce;;gCAEdU,gBAAgBe,GAAG,CAAC,CAACZ,uBACrB,MAAC1B;wCAEAS,OAAOiB,OAAOjB,KAAK;wCACnB8B,cAAY9B,UAAUiB,OAAOjB,KAAK,GAAG,YAAY+B;wCACjDC,UAAU,CAACC;4CACVhC,gBAAgBgC;4CAChBzB,QAAQ;wCACT;;4CAECS,OAAOC,KAAK;0DACb,KAAChC;gDACAoB,WAAWT,GACV,kBACAG,UAAUiB,OAAOjB,KAAK,GAAG,gBAAgB;;;uCAZtCiB,OAAOjB,KAAK;;;;;;;;AAsBzB;AAEA,+BAA+B;AAC/B,MAAMkC,cAAc;IACnB;QAAElC,OAAO;QAAWkB,OAAO;IAAU;IACrC;QAAElB,OAAO;QAAakB,OAAO;IAAY;IACzC;QAAElB,OAAO;QAAWkB,OAAO;IAAU;IACrC;QAAElB,OAAO;QAASkB,OAAO;IAAQ;IACjC;QAAElB,OAAO;QAASkB,OAAO;IAAQ;CACjC;AAED,OAAO,SAASiB;IACf,MAAM,CAACnC,OAAOoC,SAAS,GAAGjD,MAAMsB,QAAQ,CAAC;IAEzC,qBACC,KAACX;QACAC,SAASmC;QACTlC,OAAOA;QACPC,eAAemC;QACflC,aAAY;QACZC,mBAAkB;;AAGrB"}
@@ -0,0 +1,11 @@
1
+ import { ComboboxDemo } from "./combobox";
2
+ declare const meta: {
3
+ title: string;
4
+ component: typeof ComboboxDemo;
5
+ argTypes: {};
6
+ };
7
+ export default meta;
8
+ export declare const Default: {
9
+ render: () => import("react/jsx-runtime").JSX.Element;
10
+ };
11
+ //# sourceMappingURL=combobox.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox.stories.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/combobox.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,QAAA,MAAM,IAAI;;;;CAIM,CAAC;AACjB,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,OAAO;;CAMH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ComboboxDemo } from "./combobox.js";
3
+ const meta = {
4
+ title: "Component/Combobox",
5
+ component: ComboboxDemo,
6
+ argTypes: {}
7
+ };
8
+ export default meta;
9
+ export const Default = {
10
+ render: ()=>/*#__PURE__*/ _jsx("div", {
11
+ className: "w-[560px]",
12
+ children: /*#__PURE__*/ _jsx(ComboboxDemo, {})
13
+ })
14
+ };
15
+
16
+ //# sourceMappingURL=combobox.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/shadcn/components/ui/combobox.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { ComboboxDemo } from \"./combobox\";\n\nconst meta = {\n\ttitle: \"Component/Combobox\",\n\tcomponent: ComboboxDemo,\n\targTypes: {},\n} satisfies Meta;\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default = {\n\trender: () => (\n\t\t<div className=\"w-[560px]\">\n\t\t\t<ComboboxDemo />\n\t\t</div>\n\t),\n} satisfies Story;\n"],"names":["ComboboxDemo","meta","title","component","argTypes","Default","render","div","className"],"mappings":";AACA,SAASA,YAAY,QAAQ,gBAAa;AAE1C,MAAMC,OAAO;IACZC,OAAO;IACPC,WAAWH;IACXI,UAAU,CAAC;AACZ;AACA,eAAeH,KAAK;AAIpB,OAAO,MAAMI,UAAU;IACtBC,QAAQ,kBACP,KAACC;YAAIC,WAAU;sBACd,cAAA,KAACR;;AAGJ,EAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/command.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,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EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAepD;AAED,iBAAS,eAAe,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAW9B;AAED,OAAO,EACN,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GAChB,CAAC"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/command.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EACN,MAAM,EAKN,MAAM,8BAA8B,CAAC;AAuLtC,iBAAS,OAAO,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,2CAQ/C;AAED,iBAAS,aAAa,CAAC,EACtB,KAAyB,EACzB,WAA8C,EAC9C,QAAQ,EACR,SAAS,EACT,eAAsB,EACtB,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B,2CAeA;AAED,iBAAS,YAAY,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,2CAcrD;AAED,iBAAS,WAAW,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAQpD;AAED,iBAAS,YAAY,CAAC,EACrB,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,2CAQrD;AAED,iBAAS,YAAY,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,2CAQrD;AAED,iBAAS,gBAAgB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,2CAQzD;AAED,iBAAS,WAAW,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAQpD;AAED,iBAAS,eAAe,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAQ9B;AAED,OAAO,EACN,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GAChB,CAAC"}
@@ -3,10 +3,71 @@ import { Command as CommandPrimitive } from "cmdk";
3
3
  import { SearchIcon } from "lucide-react";
4
4
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./dialog.js";
5
5
  import { cn } from "../../lib/utils.js";
6
+ // Command Root
7
+ const commandStyles = cn(// Layout
8
+ "flex", "h-full", "w-full", "flex-col", "overflow-hidden", "rounded-md", // Colors
9
+ "bg-bg-primary", "text-text-primary");
10
+ // Command Dialog
11
+ const commandDialogContentStyles = cn(// Layout
12
+ "overflow-hidden", "p-0");
13
+ const commandDialogCommandStyles = cn(// Group headings
14
+ "[&_[cmdk-group-heading]]:text-muted-foreground", "[&_[cmdk-group-heading]]:px-2", "[&_[cmdk-group-heading]]:font-medium", // Groups
15
+ "[&_[cmdk-group]]:px-2", "[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0", // Input wrapper
16
+ "[&_[cmdk-input-wrapper]]:h-12", "**:data-[slot=command-input-wrapper]:h-12", // Input wrapper SVG
17
+ "[&_[cmdk-input-wrapper]_svg]:h-5", "[&_[cmdk-input-wrapper]_svg]:w-5", // Input
18
+ "[&_[cmdk-input]]:h-12", // Items
19
+ "[&_[cmdk-item]]:px-2", "[&_[cmdk-item]]:py-3", // Item SVG
20
+ "[&_[cmdk-item]_svg]:h-5", "[&_[cmdk-item]_svg]:w-5");
21
+ // Command Input Wrapper
22
+ const commandInputWrapperStyles = cn(// Layout
23
+ "flex", "h-9", "items-center", "gap-2", "px-3", // Border
24
+ "border-b", "border-border-separator", // Animation
25
+ "transition-colors", "duration-300");
26
+ // Command Input Icon
27
+ const commandInputIconStyles = cn(// Size
28
+ "size-4", "shrink-0", // Colors
29
+ "text-text-tertiary");
30
+ // Command Input
31
+ const commandInputStyles = cn(// Layout
32
+ "flex", "h-10", "w-full", "rounded-md", "py-3", // Background
33
+ "bg-transparent", // Typography
34
+ "typo-body", // Colors
35
+ "text-text-primary", "placeholder:text-text-quternary", "file:text-text-primary", // States
36
+ "outline-hidden", "disabled:cursor-not-allowed", "disabled:opacity-50");
37
+ // Command List
38
+ const commandListStyles = cn(// Layout
39
+ "max-h-[300px]", "scroll-py-1", // Overflow
40
+ "overflow-x-hidden", "overflow-y-auto", "p-2");
41
+ // Command Empty
42
+ const commandEmptyStyles = cn(// Layout
43
+ "py-6", "text-center", // Typography
44
+ "typo-body", // Colors
45
+ "text-text-tertiary");
46
+ // Command Group
47
+ const commandGroupStyles = cn(// Layout
48
+ "overflow-hidden", "p-1", "group", // Colors
49
+ "text-text-tertiary", // Group heading styles
50
+ "[&_[cmdk-group-heading]]:text-text-quaternary", "[&_[cmdk-group-heading]]:px-2", "[&_[cmdk-group-heading]]:py-1.5", "[&_[cmdk-group-heading]]:text-xs");
51
+ // Command Separator
52
+ const commandSeparatorStyles = cn(// Layout
53
+ "-mx-1", "h-px", // Colors
54
+ "bg-border-separator");
55
+ // Command Item
56
+ const commandItemStyles = cn(// Layout
57
+ "relative", "flex", "cursor-default", "items-center", "gap-2", "rounded-md", "px-2", "py-1.5", "select-none", // Typography
58
+ "typo-body", // Colors
59
+ "text-text-primary", // States
60
+ "outline-hidden", "data-[state=checked]:bg-bg-tertiary", "group-hover:data-[state=checked]:bg-transparent", "hover:bg-bg-tertiary", "data-[state=checked]:text-text-primary", "data-[disabled=true]:pointer-events-none", "data-[disabled=true]:opacity-50", // SVG styles
61
+ "[&_svg:not([class*='text-'])]:text-text-quaternary", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*='size-'])]:size-4");
62
+ // Command Shortcut
63
+ const commandShortcutStyles = cn(// Layout
64
+ "ml-auto", // Typography
65
+ "typo-body", "tracking-widest", // Colors
66
+ "text-text-quaternary");
6
67
  function Command({ className, ...props }) {
7
68
  return /*#__PURE__*/ _jsx(CommandPrimitive, {
8
69
  "data-slot": "command",
9
- className: cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className),
70
+ className: cn(commandStyles, className),
10
71
  ...props
11
72
  });
12
73
  }
@@ -26,10 +87,10 @@ function CommandDialog({ title = "Command Palette", description = "Search for a
26
87
  ]
27
88
  }),
28
89
  /*#__PURE__*/ _jsx(DialogContent, {
29
- className: cn("overflow-hidden p-0", className),
90
+ className: cn(commandDialogContentStyles, className),
30
91
  showCloseButton: showCloseButton,
31
92
  children: /*#__PURE__*/ _jsx(Command, {
32
- className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
93
+ className: commandDialogCommandStyles,
33
94
  children: children
34
95
  })
35
96
  })
@@ -39,14 +100,14 @@ function CommandDialog({ title = "Command Palette", description = "Search for a
39
100
  function CommandInput({ className, ...props }) {
40
101
  return /*#__PURE__*/ _jsxs("div", {
41
102
  "data-slot": "command-input-wrapper",
42
- className: "flex h-9 items-center gap-2 border-b px-3",
103
+ className: commandInputWrapperStyles,
43
104
  children: [
44
105
  /*#__PURE__*/ _jsx(SearchIcon, {
45
- className: "size-4 shrink-0 opacity-50"
106
+ className: commandInputIconStyles
46
107
  }),
47
108
  /*#__PURE__*/ _jsx(CommandPrimitive.Input, {
48
109
  "data-slot": "command-input",
49
- className: cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className),
110
+ className: cn(commandInputStyles, className),
50
111
  ...props
51
112
  })
52
113
  ]
@@ -55,42 +116,42 @@ function CommandInput({ className, ...props }) {
55
116
  function CommandList({ className, ...props }) {
56
117
  return /*#__PURE__*/ _jsx(CommandPrimitive.List, {
57
118
  "data-slot": "command-list",
58
- className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className),
119
+ className: cn(commandListStyles, className),
59
120
  ...props
60
121
  });
61
122
  }
62
123
  function CommandEmpty({ ...props }) {
63
124
  return /*#__PURE__*/ _jsx(CommandPrimitive.Empty, {
64
125
  "data-slot": "command-empty",
65
- className: "py-6 text-center text-sm",
126
+ className: commandEmptyStyles,
66
127
  ...props
67
128
  });
68
129
  }
69
130
  function CommandGroup({ className, ...props }) {
70
131
  return /*#__PURE__*/ _jsx(CommandPrimitive.Group, {
71
132
  "data-slot": "command-group",
72
- className: cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className),
133
+ className: cn(commandGroupStyles, className),
73
134
  ...props
74
135
  });
75
136
  }
76
137
  function CommandSeparator({ className, ...props }) {
77
138
  return /*#__PURE__*/ _jsx(CommandPrimitive.Separator, {
78
139
  "data-slot": "command-separator",
79
- className: cn("bg-border -mx-1 h-px", className),
140
+ className: cn(commandSeparatorStyles, className),
80
141
  ...props
81
142
  });
82
143
  }
83
144
  function CommandItem({ className, ...props }) {
84
145
  return /*#__PURE__*/ _jsx(CommandPrimitive.Item, {
85
146
  "data-slot": "command-item",
86
- className: cn("data-[selected=true]:bg-(--color-surface-1) text-(--color-elements-assistive)", "data-[selected=true]:text-(--color-elements-readable) [&_svg:not([class*='text-'])]:text-muted-foreground", "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none", "data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none", "[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
147
+ className: cn(commandItemStyles, className),
87
148
  ...props
88
149
  });
89
150
  }
90
151
  function CommandShortcut({ className, ...props }) {
91
152
  return /*#__PURE__*/ _jsx("span", {
92
153
  "data-slot": "command-shortcut",
93
- className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
154
+ className: cn(commandShortcutStyles, className),
94
155
  ...props
95
156
  });
96
157
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shadcn/components/ui/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from \"cmdk\";\nimport { SearchIcon } from \"lucide-react\";\nimport type * as React from \"react\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogHeader,\n\tDialogTitle,\n} from \"#shadcn/components/ui/dialog\";\nimport { cn } from \"#shadcn/lib/utils\";\n\nfunction Command({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n\treturn (\n\t\t<CommandPrimitive\n\t\t\tdata-slot=\"command\"\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandDialog({\n\ttitle = \"Command Palette\",\n\tdescription = \"Search for a command to run...\",\n\tchildren,\n\tclassName,\n\tshowCloseButton = true,\n\t...props\n}: React.ComponentProps<typeof Dialog> & {\n\ttitle?: string;\n\tdescription?: string;\n\tclassName?: string;\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<Dialog {...props}>\n\t\t\t<DialogHeader className=\"sr-only\">\n\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t</DialogHeader>\n\t\t\t<DialogContent\n\t\t\t\tclassName={cn(\"overflow-hidden p-0\", className)}\n\t\t\t\tshowCloseButton={showCloseButton}\n\t\t\t>\n\t\t\t\t<Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n\t\t\t\t\t{children}\n\t\t\t\t</Command>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n\nfunction CommandInput({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"command-input-wrapper\"\n\t\t\tclassName=\"flex h-9 items-center gap-2 border-b px-3\"\n\t\t>\n\t\t\t<SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n\t\t\t<CommandPrimitive.Input\n\t\t\t\tdata-slot=\"command-input\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction CommandList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n\treturn (\n\t\t<CommandPrimitive.List\n\t\t\tdata-slot=\"command-list\"\n\t\t\tclassName={cn(\n\t\t\t\t\"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandEmpty({\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn (\n\t\t<CommandPrimitive.Empty\n\t\t\tdata-slot=\"command-empty\"\n\t\t\tclassName=\"py-6 text-center text-sm\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn (\n\t\t<CommandPrimitive.Group\n\t\t\tdata-slot=\"command-group\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandSeparator({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n\treturn (\n\t\t<CommandPrimitive.Separator\n\t\t\tdata-slot=\"command-separator\"\n\t\t\tclassName={cn(\"bg-border -mx-1 h-px\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandItem({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn (\n\t\t<CommandPrimitive.Item\n\t\t\tdata-slot=\"command-item\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[selected=true]:bg-(--color-surface-1) text-(--color-elements-assistive)\",\n\t\t\t\t\"data-[selected=true]:text-(--color-elements-readable) [&_svg:not([class*='text-'])]:text-muted-foreground\",\n\t\t\t\t\"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none\",\n\t\t\t\t\"data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none\",\n\t\t\t\t\"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"span\">) {\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"command-shortcut\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-muted-foreground ml-auto text-xs tracking-widest\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCommand,\n\tCommandDialog,\n\tCommandInput,\n\tCommandList,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandItem,\n\tCommandShortcut,\n\tCommandSeparator,\n};\n"],"names":["Command","CommandPrimitive","SearchIcon","Dialog","DialogContent","DialogDescription","DialogHeader","DialogTitle","cn","className","props","data-slot","CommandDialog","title","description","children","showCloseButton","CommandInput","div","Input","CommandList","List","CommandEmpty","Empty","CommandGroup","Group","CommandSeparator","Separator","CommandItem","Item","CommandShortcut","span"],"mappings":";AAAA,SAASA,WAAW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C,KAACT,iBAAiBwB,KAAK;QACtBd,aAAU;QACVF,WAAWD,GACV,0NACAC;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASgB,iBAAiB,EACzBjB,SAAS,EACT,GAAGC,OACsD;IACzD,qBACC,KAACT,iBAAiB0B,SAAS;QAC1BhB,aAAU;QACVF,WAAWD,GAAG,wBAAwBC;QACrC,GAAGC,KAAK;;AAGZ;AAEA,SAASkB,YAAY,EACpBnB,SAAS,EACT,GAAGC,OACiD;IACpD,qBACC,KAACT,iBAAiB4B,IAAI;QACrBlB,aAAU;QACVF,WAAWD,GACV,iFACA,6GACA,6GACA,wGACA,yDACAC;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SAASoB,gBAAgB,EACxBrB,SAAS,EACT,GAAGC,OAC2B;IAC9B,qBACC,KAACqB;QACApB,aAAU;QACVF,WAAWD,GACV,yDACAC;QAEA,GAAGC,KAAK;;AAGZ;AAEA,SACCV,OAAO,EACPY,aAAa,EACbK,YAAY,EACZG,WAAW,EACXE,YAAY,EACZE,YAAY,EACZI,WAAW,EACXE,eAAe,EACfJ,gBAAgB,GACf"}
1
+ {"version":3,"sources":["../../../../../src/shadcn/components/ui/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from \"cmdk\";\nimport { SearchIcon } from \"lucide-react\";\nimport type * as React from \"react\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogHeader,\n\tDialogTitle,\n} from \"#shadcn/components/ui/dialog\";\nimport { cn } from \"#shadcn/lib/utils\";\n\n// Command Root\nconst commandStyles = cn(\n\t// Layout\n\t\"flex\",\n\t\"h-full\",\n\t\"w-full\",\n\t\"flex-col\",\n\t\"overflow-hidden\",\n\t\"rounded-md\",\n\t// Colors\n\t\"bg-bg-primary\",\n\t\"text-text-primary\",\n);\n\n// Command Dialog\nconst commandDialogContentStyles = cn(\n\t// Layout\n\t\"overflow-hidden\",\n\t\"p-0\",\n);\n\nconst commandDialogCommandStyles = cn(\n\t// Group headings\n\t\"[&_[cmdk-group-heading]]:text-muted-foreground\",\n\t\"[&_[cmdk-group-heading]]:px-2\",\n\t\"[&_[cmdk-group-heading]]:font-medium\",\n\t// Groups\n\t\"[&_[cmdk-group]]:px-2\",\n\t\"[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0\",\n\t// Input wrapper\n\t\"[&_[cmdk-input-wrapper]]:h-12\",\n\t\"**:data-[slot=command-input-wrapper]:h-12\",\n\t// Input wrapper SVG\n\t\"[&_[cmdk-input-wrapper]_svg]:h-5\",\n\t\"[&_[cmdk-input-wrapper]_svg]:w-5\",\n\t// Input\n\t\"[&_[cmdk-input]]:h-12\",\n\t// Items\n\t\"[&_[cmdk-item]]:px-2\",\n\t\"[&_[cmdk-item]]:py-3\",\n\t// Item SVG\n\t\"[&_[cmdk-item]_svg]:h-5\",\n\t\"[&_[cmdk-item]_svg]:w-5\",\n);\n\n// Command Input Wrapper\nconst commandInputWrapperStyles = cn(\n\t// Layout\n\t\"flex\",\n\t\"h-9\",\n\t\"items-center\",\n\t\"gap-2\",\n\t\"px-3\",\n\t// Border\n\t\"border-b\",\n\t\"border-border-separator\",\n\t// Animation\n\t\"transition-colors\",\n\t\"duration-300\",\n);\n\n// Command Input Icon\nconst commandInputIconStyles = cn(\n\t// Size\n\t\"size-4\",\n\t\"shrink-0\",\n\t// Colors\n\t\"text-text-tertiary\",\n);\n\n// Command Input\nconst commandInputStyles = cn(\n\t// Layout\n\t\"flex\",\n\t\"h-10\",\n\t\"w-full\",\n\t\"rounded-md\",\n\t\"py-3\",\n\t// Background\n\t\"bg-transparent\",\n\t// Typography\n\t\"typo-body\",\n\t// Colors\n\t\"text-text-primary\",\n\t\"placeholder:text-text-quternary\",\n\t\"file:text-text-primary\",\n\t// States\n\t\"outline-hidden\",\n\t\"disabled:cursor-not-allowed\",\n\t\"disabled:opacity-50\",\n);\n\n// Command List\nconst commandListStyles = cn(\n\t// Layout\n\t\"max-h-[300px]\",\n\t\"scroll-py-1\",\n\t// Overflow\n\t\"overflow-x-hidden\",\n\t\"overflow-y-auto\",\n\t\"p-2\",\n);\n\n// Command Empty\nconst commandEmptyStyles = cn(\n\t// Layout\n\t\"py-6\",\n\t\"text-center\",\n\t// Typography\n\t\"typo-body\",\n\t// Colors\n\t\"text-text-tertiary\",\n);\n\n// Command Group\nconst commandGroupStyles = cn(\n\t// Layout\n\t\"overflow-hidden\",\n\t\"p-1\",\n\t\"group\",\n\t// Colors\n\t\"text-text-tertiary\",\n\t// Group heading styles\n\t\"[&_[cmdk-group-heading]]:text-text-quaternary\",\n\t\"[&_[cmdk-group-heading]]:px-2\",\n\t\"[&_[cmdk-group-heading]]:py-1.5\",\n\t\"[&_[cmdk-group-heading]]:text-xs\",\n);\n\n// Command Separator\nconst commandSeparatorStyles = cn(\n\t// Layout\n\t\"-mx-1\",\n\t\"h-px\",\n\t// Colors\n\t\"bg-border-separator\",\n);\n\n// Command Item\nconst commandItemStyles = cn(\n\t// Layout\n\t\"relative\",\n\t\"flex\",\n\t\"cursor-default\",\n\t\"items-center\",\n\t\"gap-2\",\n\t\"rounded-md\",\n\t\"px-2\",\n\t\"py-1.5\",\n\t\"select-none\",\n\t// Typography\n\t\"typo-body\",\n\t// Colors\n\t\"text-text-primary\",\n\t// States\n\t\"outline-hidden\",\n\t\"data-[state=checked]:bg-bg-tertiary\",\n\t\"group-hover:data-[state=checked]:bg-transparent\",\n\t\"hover:bg-bg-tertiary\",\n\t\"data-[state=checked]:text-text-primary\",\n\t\"data-[disabled=true]:pointer-events-none\",\n\t\"data-[disabled=true]:opacity-50\",\n\t// SVG styles\n\t\"[&_svg:not([class*='text-'])]:text-text-quaternary\",\n\t\"[&_svg]:pointer-events-none\",\n\t\"[&_svg]:shrink-0\",\n\t\"[&_svg:not([class*='size-'])]:size-4\",\n);\n\n// Command Shortcut\nconst commandShortcutStyles = cn(\n\t// Layout\n\t\"ml-auto\",\n\t// Typography\n\t\"typo-body\",\n\t\"tracking-widest\",\n\t// Colors\n\t\"text-text-quaternary\",\n);\n\nfunction Command({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n\treturn (\n\t\t<CommandPrimitive\n\t\t\tdata-slot=\"command\"\n\t\t\tclassName={cn(commandStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandDialog({\n\ttitle = \"Command Palette\",\n\tdescription = \"Search for a command to run...\",\n\tchildren,\n\tclassName,\n\tshowCloseButton = true,\n\t...props\n}: React.ComponentProps<typeof Dialog> & {\n\ttitle?: string;\n\tdescription?: string;\n\tclassName?: string;\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<Dialog {...props}>\n\t\t\t<DialogHeader className=\"sr-only\">\n\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t</DialogHeader>\n\t\t\t<DialogContent\n\t\t\t\tclassName={cn(commandDialogContentStyles, className)}\n\t\t\t\tshowCloseButton={showCloseButton}\n\t\t\t>\n\t\t\t\t<Command className={commandDialogCommandStyles}>{children}</Command>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n\nfunction CommandInput({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"command-input-wrapper\"\n\t\t\tclassName={commandInputWrapperStyles}\n\t\t>\n\t\t\t<SearchIcon className={commandInputIconStyles} />\n\t\t\t<CommandPrimitive.Input\n\t\t\t\tdata-slot=\"command-input\"\n\t\t\t\tclassName={cn(commandInputStyles, className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction CommandList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n\treturn (\n\t\t<CommandPrimitive.List\n\t\t\tdata-slot=\"command-list\"\n\t\t\tclassName={cn(commandListStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandEmpty({\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn (\n\t\t<CommandPrimitive.Empty\n\t\t\tdata-slot=\"command-empty\"\n\t\t\tclassName={commandEmptyStyles}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn (\n\t\t<CommandPrimitive.Group\n\t\t\tdata-slot=\"command-group\"\n\t\t\tclassName={cn(commandGroupStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandSeparator({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n\treturn (\n\t\t<CommandPrimitive.Separator\n\t\t\tdata-slot=\"command-separator\"\n\t\t\tclassName={cn(commandSeparatorStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandItem({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn (\n\t\t<CommandPrimitive.Item\n\t\t\tdata-slot=\"command-item\"\n\t\t\tclassName={cn(commandItemStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"span\">) {\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"command-shortcut\"\n\t\t\tclassName={cn(commandShortcutStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCommand,\n\tCommandDialog,\n\tCommandInput,\n\tCommandList,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandItem,\n\tCommandShortcut,\n\tCommandSeparator,\n};\n"],"names":["Command","CommandPrimitive","SearchIcon","Dialog","DialogContent","DialogDescription","DialogHeader","DialogTitle","cn","commandStyles","commandDialogContentStyles","commandDialogCommandStyles","commandInputWrapperStyles","commandInputIconStyles","commandInputStyles","commandListStyles","commandEmptyStyles","commandGroupStyles","commandSeparatorStyles","commandItemStyles","commandShortcutStyles","className","props","data-slot","CommandDialog","title","description","children","showCloseButton","CommandInput","div","Input","CommandList","List","CommandEmpty","Empty","CommandGroup","Group","CommandSeparator","Separator","CommandItem","Item","CommandShortcut","span"],"mappings":";AAAA,SAASA,WAAWC,gBAAgB,QAAQ,OAAO;AACnD,SAASC,UAAU,QAAQ,eAAe;AAE1C,SACCC,MAAM,EACNC,aAAa,EACbC,iBAAiB,EACjBC,YAAY,EACZC,WAAW,QACL,cAA+B;AACtC,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,eAAe;AACf,MAAMC,gBAAgBD,GACrB,SAAS;AACT,QACA,UACA,UACA,YACA,mBACA,cACA,SAAS;AACT,iBACA;AAGD,iBAAiB;AACjB,MAAME,6BAA6BF,GAClC,SAAS;AACT,mBACA;AAGD,MAAMG,6BAA6BH,GAClC,iBAAiB;AACjB,kDACA,iCACA,wCACA,SAAS;AACT,yBACA,qDACA,gBAAgB;AAChB,iCACA,6CACA,oBAAoB;AACpB,oCACA,oCACA,QAAQ;AACR,yBACA,QAAQ;AACR,wBACA,wBACA,WAAW;AACX,2BACA;AAGD,wBAAwB;AACxB,MAAMI,4BAA4BJ,GACjC,SAAS;AACT,QACA,OACA,gBACA,SACA,QACA,SAAS;AACT,YACA,2BACA,YAAY;AACZ,qBACA;AAGD,qBAAqB;AACrB,MAAMK,yBAAyBL,GAC9B,OAAO;AACP,UACA,YACA,SAAS;AACT;AAGD,gBAAgB;AAChB,MAAMM,qBAAqBN,GAC1B,SAAS;AACT,QACA,QACA,UACA,cACA,QACA,aAAa;AACb,kBACA,aAAa;AACb,aACA,SAAS;AACT,qBACA,mCACA,0BACA,SAAS;AACT,kBACA,+BACA;AAGD,eAAe;AACf,MAAMO,oBAAoBP,GACzB,SAAS;AACT,iBACA,eACA,WAAW;AACX,qBACA,mBACA;AAGD,gBAAgB;AAChB,MAAMQ,qBAAqBR,GAC1B,SAAS;AACT,QACA,eACA,aAAa;AACb,aACA,SAA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