@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
@@ -3,60 +3,415 @@ import type * as React from "react";
3
3
 
4
4
  import { cn } from "#shadcn/lib/utils";
5
5
 
6
- const iconBaseClasses =
7
- "absolute top-1/2 -translate-y-1/2 cursor-pointer z-10 flex items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0";
6
+ // Base icon styles
7
+ const iconBaseClasses = cn(
8
+ // Positioning
9
+ "absolute",
10
+ "top-1/2",
11
+ "-translate-y-1/2",
12
+ "z-10",
8
13
 
9
- const iconLeftPosition =
10
- "left-3 hover:text-text-tertiary hover:cursor-default transition-colors duration-300";
14
+ // Layout & Flexbox
15
+ "flex",
16
+ "items-center",
17
+ "justify-center",
11
18
 
12
- const iconRightContainer =
13
- "absolute right-3 top-1/2 -translate-y-1/2 flex gap-2 z-10";
19
+ // Cursor & Interactions
20
+ "cursor-default",
21
+ "[&_svg]:pointer-events-none",
14
22
 
15
- const iconNormalColor =
16
- "text-text-tertiary hover:text-fg-secondary transition-colors duration-300";
17
- const iconInvalidColor =
18
- "text-fg-tertiary hover:text-fg-secondary transition-colors duration-300";
19
- const iconDisabledColor =
20
- "text-text-disabled hover:cursor-not-allowed transition-colors duration-300";
23
+ // Sizing
24
+ "[&_svg:not([class*='size-'])]:size-4",
25
+ "shrink-0",
26
+ "[&_svg]:shrink-0",
27
+ );
28
+
29
+ // Left icon positioning
30
+ const iconLeftPosition = cn(
31
+ // Positioning
32
+ "left-3",
33
+
34
+ // Transitions
35
+ "transition-colors",
36
+ "duration-300",
37
+ );
38
+
39
+ // Right icon container
40
+ const iconRightContainer = cn(
41
+ // Positioning
42
+ "absolute",
43
+ "right-3",
44
+ "top-1/2",
45
+ "-translate-y-1/2",
46
+
47
+ // Layout & Flexbox
48
+ "flex",
49
+ "gap-2",
50
+
51
+ // Z-index
52
+ "z-10",
53
+ );
54
+
55
+ // Icon color states
56
+ const iconNormalColor = cn(
57
+ // Colors
58
+ "text-text-tertiary",
59
+
60
+ // Transitions
61
+ "transition-colors",
62
+ "duration-300",
63
+ );
64
+
65
+ const iconInvalidColor = cn(
66
+ // Colors
67
+ "text-text-tertiary",
68
+
69
+ // Transitions
70
+ "transition-colors",
71
+ "duration-300",
72
+ );
73
+
74
+ const iconDisabledColor = cn(
75
+ // Colors
76
+ "text-text-disabled",
77
+
78
+ // Cursor & Interactions
79
+ "hover:cursor-not-allowed",
80
+
81
+ // Transitions
82
+ "transition-colors",
83
+ "duration-300",
84
+ );
85
+
86
+ // Icon wrapper styles
87
+ const iconWrapperClasses = cn(
88
+ // Sizing
89
+ "flex",
90
+ "items-center",
91
+ "[&>svg]:w-full",
92
+ "[&>svg]:h-full",
93
+ "[&>svg]:stroke-[1.5]",
94
+ );
95
+
96
+ // Right icon item styles
97
+ const iconRightItemClasses = cn(
98
+ // Layout & Flexbox
99
+ "flex",
100
+ "items-center",
101
+ "justify-center",
102
+
103
+ // Transitions
104
+ "transition-colors",
105
+ "duration-300",
106
+ );
107
+
108
+ // Prefix styles
109
+ const prefixClasses = cn(
110
+ // Borders
111
+ "border-border-primary",
112
+ "border",
113
+ "border-r-0",
114
+
115
+ // Background & Colors
116
+ "bg-bg-tertiary",
117
+ "text-text-tertiary",
118
+
119
+ // Layout & Flexbox
120
+ "flex",
121
+ "items-center",
122
+
123
+ // Spacing & Sizing
124
+ "rounded-l-md",
125
+ "px-3",
126
+ "py-1",
127
+
128
+ // Typography
129
+ "typo-body",
130
+
131
+ // Cursor & Interactions
132
+ "cursor-default",
133
+
134
+ // Transitions
135
+ "transition-colors",
136
+ "duration-300",
137
+ );
138
+
139
+ // Suffix styles
140
+ const suffixClasses = cn(
141
+ // Borders
142
+ "border-border-primary",
143
+ "border",
144
+
145
+ // Background & Colors
146
+ "bg-bg-tertiary",
147
+ "text-text-tertiary",
148
+
149
+ // Layout & Flexbox
150
+ "flex",
151
+ "items-center",
152
+
153
+ // Spacing & Sizing
154
+ "rounded-r-md",
155
+ "px-3",
156
+ "py-1",
157
+
158
+ // Typography
159
+ "typo-body",
160
+
161
+ // Cursor & Interactions
162
+ "cursor-default",
163
+
164
+ // Transitions
165
+ "transition-colors",
166
+ "duration-300",
167
+ );
168
+
169
+ // Disabled prefix styles
170
+ const prefixDisabledClasses = cn(
171
+ // Borders
172
+ "border-border-primary",
173
+ "border",
174
+
175
+ // Background & Colors
176
+ "bg-bg-tertiary",
177
+ "text-text-disabled",
178
+
179
+ // Layout & Flexbox
180
+ "flex",
181
+ "items-center",
182
+
183
+ // Spacing & Sizing
184
+ "rounded-l-md",
185
+ "px-3",
186
+ "py-1",
187
+
188
+ // Typography
189
+ "typo-body",
190
+
191
+ // Cursor & Interactions
192
+ "hover:cursor-not-allowed",
193
+
194
+ // Transitions
195
+ "transition-colors",
196
+ "duration-300",
197
+ );
21
198
 
22
- const iconWrapperClasses = "[&>svg]:w-full [&>svg]:h-full [&>svg]:stroke-[1.5]";
199
+ // Disabled suffix styles
200
+ const suffixDisabledClasses = cn(
201
+ // Borders
202
+ "border-border-primary",
203
+ "border",
23
204
 
24
- const iconRightItemClasses =
25
- "cursor-pointer flex items-center justify-center transition-colors duration-300";
205
+ // Background & Colors
206
+ "bg-bg-tertiary",
207
+ "text-text-disabled",
26
208
 
27
- const suffixClasses =
28
- "border-border-primary bg-bg-tertiary text-text-tertiary flex items-center rounded-r-md border px-3 py-1 typo-body cursor-default transition-colors duration-300";
209
+ // Layout & Flexbox
210
+ "flex",
211
+ "items-center",
29
212
 
30
- const suffixDisabledClasses =
31
- "border-border-primary bg-bg-tertiary text-text-disabled flex items-center rounded-r-md border px-3 py-1 typo-body hover:cursor-not-allowed transition-colors duration-300";
213
+ // Spacing & Sizing
214
+ "rounded-r-md",
215
+ "px-3",
216
+ "py-1",
32
217
 
33
- const suffixInvalidClasses =
34
- "border-border-error bg-bg-secondary flex items-center rounded-r-md border px-3 py-1 text-text-tertiary typo-body cursor-default transition-colors duration-300";
218
+ // Typography
219
+ "typo-body",
220
+
221
+ // Cursor & Interactions
222
+ "hover:cursor-not-allowed",
223
+
224
+ // Transitions
225
+ "transition-colors",
226
+ "duration-300",
227
+ );
228
+
229
+ // Invalid prefix styles
230
+ const prefixInvalidClasses = cn(
231
+ // Borders
232
+ "border-border-error",
233
+ "border",
234
+
235
+ // Background & Colors
236
+ "bg-bg-secondary",
237
+ "text-text-tertiary",
238
+
239
+ // Layout & Flexbox
240
+ "flex",
241
+ "items-center",
242
+
243
+ // Spacing & Sizing
244
+ "rounded-l-md",
245
+ "px-3",
246
+ "py-1",
247
+
248
+ // Typography
249
+ "typo-body",
250
+
251
+ // Cursor & Interactions
252
+ "cursor-default",
253
+
254
+ // Transitions
255
+ "transition-colors",
256
+ "duration-300",
257
+ );
258
+
259
+ // Invalid suffix styles
260
+ const suffixInvalidClasses = cn(
261
+ // Borders
262
+ "border-border-error",
263
+ "border",
264
+
265
+ // Background & Colors
266
+ "bg-bg-secondary",
267
+ "text-text-tertiary",
268
+
269
+ // Layout & Flexbox
270
+ "flex",
271
+ "items-center",
272
+
273
+ // Spacing & Sizing
274
+ "rounded-r-md",
275
+ "px-3",
276
+ "py-1",
277
+
278
+ // Typography
279
+ "typo-body",
280
+
281
+ // Cursor & Interactions
282
+ "cursor-default",
283
+
284
+ // Transitions
285
+ "transition-colors",
286
+ "duration-300",
287
+ );
35
288
 
36
289
  const inputVariants = cva(
37
290
  cn(
38
- "h-9 file:text-text-primary placeholder:text-text-quternary disabled:placeholder:text-text-disabled selection:bg-bg-primary selection:text-text-primary-foreground border-border-primary hover:border-border-primary_hover flex w-full min-w-0 border bg-transparent px-3 py-2 typo-body text-base transition-all duration-300 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-md file:font-medium disabled:bg-bg-secondary disabled:cursor-not-allowed disabled:border-border-primary md:text-md selection:bg-selection",
39
- "focus-visible:ring-4 focus-visible:ring-ring-blue focus-visible:border-border-link",
40
- "aria-invalid:ring-destructive aria-invalid:text-text-error-primary aria-invalid:border-border-error-primary",
41
- "",
291
+ // Sizing & Layout
292
+ "h-9",
293
+ "flex",
294
+ "w-full",
295
+ "min-w-0",
296
+
297
+ // Spacing & Padding
298
+ "px-3",
299
+ "py-2",
300
+
301
+ // Borders
302
+ "border",
303
+ "border-border-primary",
304
+
305
+ // Background & Colors
306
+ "bg-transparent",
307
+ "text-base",
308
+
309
+ // Typography
310
+ "typo-body",
311
+ "md:text-md",
312
+
313
+ // File input styles
314
+ "file:text-text-primary",
315
+ "file:inline-flex",
316
+ "file:h-7",
317
+ "file:border-0",
318
+ "file:bg-transparent",
319
+ "file:text-md",
320
+ "file:font-medium",
321
+
322
+ // Placeholder styles
323
+ "placeholder:text-text-quternary",
324
+
325
+ // Selection styles
326
+ "selection:bg-bg-primary",
327
+ "selection:text-text-primary-foreground",
328
+ "selection:bg-selection",
329
+
330
+ // Hover states
331
+ "hover:border-border-primary_hover",
332
+
333
+ // Focus states
334
+
335
+ "focus-visible:border-border-link",
336
+
337
+ // Invalid states
338
+ "aria-invalid:ring-destructive",
339
+ "aria-invalid:text-text-error-primary",
340
+ "aria-invalid:border-border-error-primary",
341
+
342
+ // Disabled states
343
+ "disabled:bg-bg-secondary",
344
+ "disabled:cursor-not-allowed",
345
+ "disabled:border-border-primary",
346
+ "disabled:text-text-disabled",
347
+ "disabled:placeholder:text-text-disabled",
348
+
349
+ // Transitions
350
+ "transition-all",
351
+ "duration-300",
352
+
353
+ // Outline
354
+ "outline-none",
355
+
356
+ // Border radius
42
357
  "rounded-md",
43
358
  ),
44
359
  {
45
360
  variants: {
46
361
  hasLeftSlot: {
47
- true: "pl-9",
362
+ true: cn(
363
+ // Left padding for icon
364
+ "pl-9",
365
+ ),
48
366
  },
49
367
  hasRightSlot: {
50
- true: "pr-9",
368
+ true: cn(
369
+ // Right padding for icon
370
+ "pr-9",
371
+ ),
372
+ },
373
+ hasPrefix: {
374
+ true: cn(
375
+ // Border adjustments for prefix
376
+ "rounded-r-md",
377
+ "rounded-l-none",
378
+
379
+ // Focus adjustments
380
+ "focus-visible:ring-offset-0",
381
+ "focus-visible:border-l-1",
382
+ ),
51
383
  },
52
384
  hasSuffix: {
53
- true: "border-r-0 focus-visible:ring-offset-0 rounded-l-md rounded-r-none focus-visible:border-r-1",
385
+ true: cn(
386
+ // Border adjustments for suffix
387
+ "border-r-0",
388
+ "rounded-l-md",
389
+ "rounded-r-none",
390
+
391
+ // Focus adjustments
392
+ "focus-visible:ring-offset-0",
393
+ "focus-visible:border-r-1",
394
+ ),
54
395
  },
55
396
  invalid: {
56
- true: "border-border-error focus-visible:ring-4 focus-visible:ring-ring-red focus-visible:border-border-error hover:border-border-error_inverse transition-all duration-300",
397
+ true: cn(
398
+ // Invalid border colors
399
+ "border-border-error",
400
+ "hover:border-border-error_inverse",
401
+
402
+ // Invalid focus states
403
+ "focus-visible:ring-4",
404
+ "focus-visible:ring-ring-red",
405
+ "focus-visible:border-border-error",
406
+
407
+ // Transitions
408
+ "transition-all",
409
+ "duration-300",
410
+ ),
57
411
  },
58
412
  },
59
413
  defaultVariants: {
414
+ hasPrefix: false,
60
415
  hasSuffix: false,
61
416
  invalid: false,
62
417
  },
@@ -67,6 +422,7 @@ interface InputProps
67
422
  extends React.ComponentProps<"input">,
68
423
  VariantProps<typeof inputVariants> {
69
424
  type?: "text" | "password";
425
+ prefixValue?: React.ReactNode;
70
426
  suffix?: string;
71
427
  invalid?: boolean;
72
428
  leftSlot?: React.ReactNode;
@@ -77,6 +433,7 @@ function Input({
77
433
  className,
78
434
  type,
79
435
  invalid,
436
+ prefixValue,
80
437
  suffix,
81
438
  leftSlot,
82
439
  rightSlot,
@@ -138,6 +495,7 @@ function Input({
138
495
  invalid,
139
496
  hasLeftSlot: !!leftSlot,
140
497
  hasRightSlot: !!rightSlot,
498
+ hasPrefix: !!prefixValue,
141
499
  hasSuffix: !!suffix,
142
500
  className,
143
501
  }),
@@ -148,6 +506,19 @@ function Input({
148
506
 
149
507
  return (
150
508
  <div className="flex w-full min-w-0">
509
+ {prefixValue && (
510
+ <div
511
+ className={
512
+ props.disabled
513
+ ? prefixDisabledClasses
514
+ : invalid
515
+ ? prefixInvalidClasses
516
+ : prefixClasses
517
+ }
518
+ >
519
+ {prefixValue}
520
+ </div>
521
+ )}
151
522
  <div className="flex-1 relative">
152
523
  {renderLeftSlot()}
153
524
  {inputElement}
@@ -4,6 +4,26 @@ import type * as React from "react";
4
4
 
5
5
  import { cn } from "#shadcn/lib/utils";
6
6
 
7
+ // Label styles
8
+ const labelStyles = cn(
9
+ // Layout
10
+ "flex",
11
+ "items-center",
12
+ "gap-2",
13
+ // Typography
14
+ "text-text-primary",
15
+ "typo-label",
16
+ "leading-none",
17
+ // Interaction
18
+ "select-none",
19
+ // Group disabled states
20
+ "group-data-[disabled=true]:pointer-events-none",
21
+ "group-data-[disabled=true]:opacity-50",
22
+ // Peer disabled states
23
+ "peer-disabled:cursor-not-allowed",
24
+ "peer-disabled:opacity-50",
25
+ );
26
+
7
27
  function Label({
8
28
  className,
9
29
  ...props
@@ -11,10 +31,7 @@ function Label({
11
31
  return (
12
32
  <LabelPrimitive.Root
13
33
  data-slot="label"
14
- className={cn(
15
- "flex items-center gap-2 text-text-primary typo-label leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
16
- className,
17
- )}
34
+ className={cn(labelStyles, className)}
18
35
  {...props}
19
36
  />
20
37
  );