@health-samurai/react-components 0.0.0-alpha.1 → 0.0.0-alpha.3

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 (251) hide show
  1. package/dist/bundle.css +100 -7
  2. package/dist/src/components/code-editor/index.js +53 -29
  3. package/dist/src/components/code-editor/index.js.map +1 -1
  4. package/dist/src/components/code-editor.stories.js +22 -7
  5. package/dist/src/components/code-editor.stories.js.map +1 -1
  6. package/dist/src/components/copy-icon.js +11 -4
  7. package/dist/src/components/copy-icon.js.map +1 -1
  8. package/dist/src/components/request-line-editor.js +56 -14
  9. package/dist/src/components/request-line-editor.js.map +1 -1
  10. package/dist/src/components/request-line-editor.stories.js +71 -22
  11. package/dist/src/components/request-line-editor.stories.js.map +1 -1
  12. package/dist/src/global.d.js +2 -0
  13. package/dist/src/global.d.js.map +1 -0
  14. package/dist/src/index.css +6 -0
  15. package/dist/src/index.d.ts +1 -0
  16. package/dist/src/index.d.ts.map +1 -1
  17. package/dist/src/index.js +52 -50
  18. package/dist/src/index.js.map +1 -1
  19. package/dist/src/index.stories.js +8 -5
  20. package/dist/src/index.stories.js.map +1 -1
  21. package/dist/src/shadcn/components/ui/accordion.js +34 -5
  22. package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
  23. package/dist/src/shadcn/components/ui/accordion.stories.js +68 -3
  24. package/dist/src/shadcn/components/ui/accordion.stories.js.map +1 -1
  25. package/dist/src/shadcn/components/ui/alert-dialog.js +61 -14
  26. package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
  27. package/dist/src/shadcn/components/ui/alert-dialog.stories.js +39 -4
  28. package/dist/src/shadcn/components/ui/alert-dialog.stories.js.map +1 -1
  29. package/dist/src/shadcn/components/ui/alert.js +24 -8
  30. package/dist/src/shadcn/components/ui/alert.js.map +1 -1
  31. package/dist/src/shadcn/components/ui/alert.stories.js +57 -3
  32. package/dist/src/shadcn/components/ui/alert.stories.js.map +1 -1
  33. package/dist/src/shadcn/components/ui/aspect-ratio.d.ts.map +1 -1
  34. package/dist/src/shadcn/components/ui/aspect-ratio.js +6 -1
  35. package/dist/src/shadcn/components/ui/aspect-ratio.js.map +1 -1
  36. package/dist/src/shadcn/components/ui/aspect-ratio.stories.js +12 -3
  37. package/dist/src/shadcn/components/ui/aspect-ratio.stories.js.map +1 -1
  38. package/dist/src/shadcn/components/ui/avatar.js +17 -4
  39. package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
  40. package/dist/src/shadcn/components/ui/avatar.stories.js +69 -3
  41. package/dist/src/shadcn/components/ui/avatar.stories.js.map +1 -1
  42. package/dist/src/shadcn/components/ui/badge.js +13 -6
  43. package/dist/src/shadcn/components/ui/badge.js.map +1 -1
  44. package/dist/src/shadcn/components/ui/badge.stories.js +55 -3
  45. package/dist/src/shadcn/components/ui/badge.stories.js.map +1 -1
  46. package/dist/src/shadcn/components/ui/breadcrumb.js +56 -11
  47. package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
  48. package/dist/src/shadcn/components/ui/breadcrumb.stories.js +69 -4
  49. package/dist/src/shadcn/components/ui/breadcrumb.stories.js.map +1 -1
  50. package/dist/src/shadcn/components/ui/button.js +23 -13
  51. package/dist/src/shadcn/components/ui/button.js.map +1 -1
  52. package/dist/src/shadcn/components/ui/button.stories.js +190 -10
  53. package/dist/src/shadcn/components/ui/button.stories.js.map +1 -1
  54. package/dist/src/shadcn/components/ui/calendar.d.ts.map +1 -1
  55. package/dist/src/shadcn/components/ui/calendar.js +76 -33
  56. package/dist/src/shadcn/components/ui/calendar.js.map +1 -1
  57. package/dist/src/shadcn/components/ui/calendar.stories.js +12 -5
  58. package/dist/src/shadcn/components/ui/calendar.stories.js.map +1 -1
  59. package/dist/src/shadcn/components/ui/card.js +38 -9
  60. package/dist/src/shadcn/components/ui/card.js.map +1 -1
  61. package/dist/src/shadcn/components/ui/card.stories.js +91 -6
  62. package/dist/src/shadcn/components/ui/card.stories.js.map +1 -1
  63. package/dist/src/shadcn/components/ui/carousel.js +99 -39
  64. package/dist/src/shadcn/components/ui/carousel.js.map +1 -1
  65. package/dist/src/shadcn/components/ui/carousel.stories.js +30 -6
  66. package/dist/src/shadcn/components/ui/carousel.stories.js.map +1 -1
  67. package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -1
  68. package/dist/src/shadcn/components/ui/chart.js +119 -55
  69. package/dist/src/shadcn/components/ui/chart.js.map +1 -1
  70. package/dist/src/shadcn/components/ui/chart.stories.js +72 -12
  71. package/dist/src/shadcn/components/ui/chart.stories.js.map +1 -1
  72. package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
  73. package/dist/src/shadcn/components/ui/checkbox.js +15 -2
  74. package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
  75. package/dist/src/shadcn/components/ui/checkbox.stories.js +79 -4
  76. package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
  77. package/dist/src/shadcn/components/ui/collapsible.js +13 -3
  78. package/dist/src/shadcn/components/ui/collapsible.js.map +1 -1
  79. package/dist/src/shadcn/components/ui/collapsible.stories.js +54 -6
  80. package/dist/src/shadcn/components/ui/collapsible.stories.js.map +1 -1
  81. package/dist/src/shadcn/components/ui/command.js +77 -12
  82. package/dist/src/shadcn/components/ui/command.js.map +1 -1
  83. package/dist/src/shadcn/components/ui/command.stories.js +88 -4
  84. package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
  85. package/dist/src/shadcn/components/ui/context-menu.d.ts.map +1 -1
  86. package/dist/src/shadcn/components/ui/context-menu.js +107 -17
  87. package/dist/src/shadcn/components/ui/context-menu.js.map +1 -1
  88. package/dist/src/shadcn/components/ui/context-menu.stories.js +101 -3
  89. package/dist/src/shadcn/components/ui/context-menu.stories.js.map +1 -1
  90. package/dist/src/shadcn/components/ui/dialog.js +69 -12
  91. package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
  92. package/dist/src/shadcn/components/ui/dialog.stories.js +82 -6
  93. package/dist/src/shadcn/components/ui/dialog.stories.js.map +1 -1
  94. package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
  95. package/dist/src/shadcn/components/ui/drawer.js +62 -12
  96. package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
  97. package/dist/src/shadcn/components/ui/drawer.stories.js +154 -21
  98. package/dist/src/shadcn/components/ui/drawer.stories.js.map +1 -1
  99. package/dist/src/shadcn/components/ui/dropdown-menu.js +107 -17
  100. package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
  101. package/dist/src/shadcn/components/ui/dropdown-menu.stories.js +119 -4
  102. package/dist/src/shadcn/components/ui/dropdown-menu.stories.js.map +1 -1
  103. package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
  104. package/dist/src/shadcn/components/ui/form.js +59 -18
  105. package/dist/src/shadcn/components/ui/form.js.map +1 -1
  106. package/dist/src/shadcn/components/ui/form.stories.js +45 -11
  107. package/dist/src/shadcn/components/ui/form.stories.js.map +1 -1
  108. package/dist/src/shadcn/components/ui/hover-card.d.ts.map +1 -1
  109. package/dist/src/shadcn/components/ui/hover-card.js +21 -4
  110. package/dist/src/shadcn/components/ui/hover-card.js.map +1 -1
  111. package/dist/src/shadcn/components/ui/hover-card.stories.js +51 -5
  112. package/dist/src/shadcn/components/ui/hover-card.stories.js.map +1 -1
  113. package/dist/src/shadcn/components/ui/input-otp.js +35 -7
  114. package/dist/src/shadcn/components/ui/input-otp.js.map +1 -1
  115. package/dist/src/shadcn/components/ui/input-otp.stories.js +35 -3
  116. package/dist/src/shadcn/components/ui/input-otp.stories.js.map +1 -1
  117. package/dist/src/shadcn/components/ui/input.js +59 -40
  118. package/dist/src/shadcn/components/ui/input.js.map +1 -1
  119. package/dist/src/shadcn/components/ui/input.stories.js +391 -23
  120. package/dist/src/shadcn/components/ui/input.stories.js.map +1 -1
  121. package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
  122. package/dist/src/shadcn/components/ui/label.js +8 -2
  123. package/dist/src/shadcn/components/ui/label.js.map +1 -1
  124. package/dist/src/shadcn/components/ui/label.stories.js +18 -4
  125. package/dist/src/shadcn/components/ui/label.stories.js.map +1 -1
  126. package/dist/src/shadcn/components/ui/menubar.js +116 -19
  127. package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
  128. package/dist/src/shadcn/components/ui/menubar.stories.js +216 -3
  129. package/dist/src/shadcn/components/ui/menubar.stories.js.map +1 -1
  130. package/dist/src/shadcn/components/ui/navigation-menu.js +62 -10
  131. package/dist/src/shadcn/components/ui/navigation-menu.js.map +1 -1
  132. package/dist/src/shadcn/components/ui/navigation-menu.stories.js +263 -11
  133. package/dist/src/shadcn/components/ui/navigation-menu.stories.js.map +1 -1
  134. package/dist/src/shadcn/components/ui/pagination.js +73 -16
  135. package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
  136. package/dist/src/shadcn/components/ui/pagination.stories.js +41 -3
  137. package/dist/src/shadcn/components/ui/pagination.stories.js.map +1 -1
  138. package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
  139. package/dist/src/shadcn/components/ui/popover.js +24 -5
  140. package/dist/src/shadcn/components/ui/popover.js.map +1 -1
  141. package/dist/src/shadcn/components/ui/popover.stories.js +99 -6
  142. package/dist/src/shadcn/components/ui/popover.stories.js.map +1 -1
  143. package/dist/src/shadcn/components/ui/progress.js +14 -2
  144. package/dist/src/shadcn/components/ui/progress.js.map +1 -1
  145. package/dist/src/shadcn/components/ui/progress.stories.js +12 -8
  146. package/dist/src/shadcn/components/ui/progress.stories.js.map +1 -1
  147. package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
  148. package/dist/src/shadcn/components/ui/radio-group.js +20 -3
  149. package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
  150. package/dist/src/shadcn/components/ui/radio-group.stories.js +48 -4
  151. package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
  152. package/dist/src/shadcn/components/ui/resizable.js +22 -4
  153. package/dist/src/shadcn/components/ui/resizable.js.map +1 -1
  154. package/dist/src/shadcn/components/ui/resizable.stories.js +49 -3
  155. package/dist/src/shadcn/components/ui/resizable.stories.js.map +1 -1
  156. package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
  157. package/dist/src/shadcn/components/ui/scroll-area.js +27 -5
  158. package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
  159. package/dist/src/shadcn/components/ui/scroll-area.stories.js +30 -5
  160. package/dist/src/shadcn/components/ui/scroll-area.stories.js.map +1 -1
  161. package/dist/src/shadcn/components/ui/select.js +98 -19
  162. package/dist/src/shadcn/components/ui/select.js.map +1 -1
  163. package/dist/src/shadcn/components/ui/select.stories.js +84 -5
  164. package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
  165. package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
  166. package/dist/src/shadcn/components/ui/separator.js +10 -2
  167. package/dist/src/shadcn/components/ui/separator.js.map +1 -1
  168. package/dist/src/shadcn/components/ui/separator.stories.js +43 -3
  169. package/dist/src/shadcn/components/ui/separator.stories.js.map +1 -1
  170. package/dist/src/shadcn/components/ui/sheet.js +69 -16
  171. package/dist/src/shadcn/components/ui/sheet.js.map +1 -1
  172. package/dist/src/shadcn/components/ui/sheet.stories.js +77 -6
  173. package/dist/src/shadcn/components/ui/sheet.stories.js.map +1 -1
  174. package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
  175. package/dist/src/shadcn/components/ui/sidebar.js +305 -79
  176. package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
  177. package/dist/src/shadcn/components/ui/sidebar.stories.js +321 -59
  178. package/dist/src/shadcn/components/ui/sidebar.stories.js.map +1 -1
  179. package/dist/src/shadcn/components/ui/skeleton.js +7 -2
  180. package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
  181. package/dist/src/shadcn/components/ui/skeleton.stories.js +22 -3
  182. package/dist/src/shadcn/components/ui/skeleton.stories.js.map +1 -1
  183. package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
  184. package/dist/src/shadcn/components/ui/slider.js +41 -7
  185. package/dist/src/shadcn/components/ui/slider.js.map +1 -1
  186. package/dist/src/shadcn/components/ui/slider.stories.js +11 -3
  187. package/dist/src/shadcn/components/ui/slider.stories.js.map +1 -1
  188. package/dist/src/shadcn/components/ui/sonner.js +10 -4
  189. package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
  190. package/dist/src/shadcn/components/ui/sonner.stories.js +14 -9
  191. package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
  192. package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
  193. package/dist/src/shadcn/components/ui/switch.js +12 -2
  194. package/dist/src/shadcn/components/ui/switch.js.map +1 -1
  195. package/dist/src/shadcn/components/ui/switch.stories.js +16 -4
  196. package/dist/src/shadcn/components/ui/switch.stories.js.map +1 -1
  197. package/dist/src/shadcn/components/ui/table.js +47 -10
  198. package/dist/src/shadcn/components/ui/table.js.map +1 -1
  199. package/dist/src/shadcn/components/ui/table.stories.js +72 -11
  200. package/dist/src/shadcn/components/ui/table.stories.js.map +1 -1
  201. package/dist/src/shadcn/components/ui/tabs.d.ts +9 -5
  202. package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
  203. package/dist/src/shadcn/components/ui/tabs.js +76 -18
  204. package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
  205. package/dist/src/shadcn/components/ui/tabs.stories.d.ts +6 -0
  206. package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -1
  207. package/dist/src/shadcn/components/ui/tabs.stories.js +221 -10
  208. package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
  209. package/dist/src/shadcn/components/ui/textarea.js +7 -2
  210. package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
  211. package/dist/src/shadcn/components/ui/textarea.stories.js +6 -3
  212. package/dist/src/shadcn/components/ui/textarea.stories.js.map +1 -1
  213. package/dist/src/shadcn/components/ui/toggle-group.js +29 -8
  214. package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
  215. package/dist/src/shadcn/components/ui/toggle-group.stories.js +30 -3
  216. package/dist/src/shadcn/components/ui/toggle-group.stories.js.map +1 -1
  217. package/dist/src/shadcn/components/ui/toggle.js +16 -7
  218. package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
  219. package/dist/src/shadcn/components/ui/toggle.stories.js +9 -3
  220. package/dist/src/shadcn/components/ui/toggle.stories.js.map +1 -1
  221. package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
  222. package/dist/src/shadcn/components/ui/tooltip.js +27 -5
  223. package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
  224. package/dist/src/shadcn/components/ui/tooltip.stories.js +20 -4
  225. package/dist/src/shadcn/components/ui/tooltip.stories.js.map +1 -1
  226. package/dist/src/shadcn/hooks/use-mobile.js +4 -3
  227. package/dist/src/shadcn/hooks/use-mobile.js.map +1 -1
  228. package/dist/src/shadcn/lib/utils.js +1 -0
  229. package/dist/src/shadcn/lib/utils.js.map +1 -1
  230. package/package.json +8 -4
  231. package/src/index.css +6 -0
  232. package/src/index.tsx +1 -0
  233. package/src/shadcn/components/ui/aspect-ratio.tsx +1 -0
  234. package/src/shadcn/components/ui/calendar.tsx +1 -0
  235. package/src/shadcn/components/ui/chart.tsx +1 -0
  236. package/src/shadcn/components/ui/checkbox.tsx +1 -0
  237. package/src/shadcn/components/ui/context-menu.tsx +1 -0
  238. package/src/shadcn/components/ui/drawer.tsx +1 -0
  239. package/src/shadcn/components/ui/form.tsx +1 -0
  240. package/src/shadcn/components/ui/hover-card.tsx +1 -0
  241. package/src/shadcn/components/ui/label.tsx +1 -0
  242. package/src/shadcn/components/ui/popover.tsx +1 -0
  243. package/src/shadcn/components/ui/radio-group.tsx +1 -0
  244. package/src/shadcn/components/ui/scroll-area.tsx +1 -0
  245. package/src/shadcn/components/ui/separator.tsx +1 -0
  246. package/src/shadcn/components/ui/sidebar.tsx +1 -0
  247. package/src/shadcn/components/ui/slider.tsx +1 -0
  248. package/src/shadcn/components/ui/switch.tsx +1 -0
  249. package/src/shadcn/components/ui/tabs.stories.tsx +57 -0
  250. package/src/shadcn/components/ui/tabs.tsx +77 -26
  251. package/src/shadcn/components/ui/tooltip.tsx +1 -0
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cva } from "class-variance-authority";
3
- import { cn } from "#shadcn/lib/utils";
3
+ import { cn } from "../../lib/utils.js";
4
4
  const iconBaseClasses = "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";
5
5
  const iconLeftPosition = "left-3 hover:text-text-tertiary hover:cursor-default transition-colors duration-300";
6
6
  const iconRightContainer = "absolute right-3 top-1/2 -translate-y-1/2 flex gap-2 z-10";
@@ -15,65 +15,84 @@ const suffixInvalidClasses = "border-border-error bg-bg-secondary flex items-cen
15
15
  const inputVariants = cva(cn("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", "focus-visible:ring-4 focus-visible:ring-ring-blue focus-visible:border-border-link", "aria-invalid:ring-destructive aria-invalid:text-text-error-primary aria-invalid:border-border-error-primary", "", "rounded-md"), {
16
16
  variants: {
17
17
  hasLeftSlot: {
18
- true: "pl-9",
18
+ true: "pl-9"
19
19
  },
20
20
  hasRightSlot: {
21
- true: "pr-9",
21
+ true: "pr-9"
22
22
  },
23
23
  hasSuffix: {
24
- true: "border-r-0 focus-visible:ring-offset-0 rounded-l-md rounded-r-none focus-visible:border-r-1",
24
+ true: "border-r-0 focus-visible:ring-offset-0 rounded-l-md rounded-r-none focus-visible:border-r-1"
25
25
  },
26
26
  invalid: {
27
- 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",
28
- },
27
+ 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"
28
+ }
29
29
  },
30
30
  defaultVariants: {
31
31
  hasSuffix: false,
32
- invalid: false,
33
- },
32
+ invalid: false
33
+ }
34
34
  });
35
35
  function Input({ className, type, invalid, suffix, leftSlot, rightSlot, ...props }) {
36
36
  const processedLeftSlot = leftSlot === "None" ? undefined : leftSlot;
37
37
  const processedRightSlot = rightSlot === "None" ? undefined : rightSlot;
38
- const hasLeftIcon = processedLeftSlot &&
39
- processedLeftSlot !== null &&
40
- processedLeftSlot !== undefined;
41
- const hasRightIcon = processedRightSlot &&
42
- processedRightSlot !== null &&
43
- processedRightSlot !== undefined;
44
- const renderLeftSlot = () => {
45
- if (!hasLeftIcon)
46
- return null;
47
- const colorClasses = props.disabled
48
- ? iconDisabledColor
49
- : invalid
50
- ? iconInvalidColor
51
- : iconNormalColor;
52
- return (_jsx("div", { className: `${iconBaseClasses} ${iconLeftPosition} ${colorClasses}`, children: _jsx("div", { className: iconWrapperClasses, children: processedLeftSlot }) }));
38
+ const hasLeftIcon = processedLeftSlot && processedLeftSlot !== null && processedLeftSlot !== undefined;
39
+ const hasRightIcon = processedRightSlot && processedRightSlot !== null && processedRightSlot !== undefined;
40
+ const renderLeftSlot = ()=>{
41
+ if (!hasLeftIcon) return null;
42
+ const colorClasses = props.disabled ? iconDisabledColor : invalid ? iconInvalidColor : iconNormalColor;
43
+ return /*#__PURE__*/ _jsx("div", {
44
+ className: `${iconBaseClasses} ${iconLeftPosition} ${colorClasses}`,
45
+ children: /*#__PURE__*/ _jsx("div", {
46
+ className: iconWrapperClasses,
47
+ children: processedLeftSlot
48
+ })
49
+ });
53
50
  };
54
- const renderRightSlot = () => {
55
- if (!hasRightIcon)
56
- return null;
57
- const colorClasses = props.disabled
58
- ? iconDisabledColor
59
- : invalid
60
- ? iconInvalidColor
61
- : iconNormalColor;
62
- return (_jsx("div", { className: `${iconRightContainer} ${iconBaseClasses}`, children: hasRightIcon && (_jsx("div", { className: `${iconRightItemClasses} ${colorClasses}`, children: _jsx("div", { className: iconWrapperClasses, children: processedRightSlot }) })) }));
51
+ const renderRightSlot = ()=>{
52
+ if (!hasRightIcon) return null;
53
+ const colorClasses = props.disabled ? iconDisabledColor : invalid ? iconInvalidColor : iconNormalColor;
54
+ return /*#__PURE__*/ _jsx("div", {
55
+ className: `${iconRightContainer} ${iconBaseClasses}`,
56
+ children: hasRightIcon && /*#__PURE__*/ _jsx("div", {
57
+ className: `${iconRightItemClasses} ${colorClasses}`,
58
+ children: /*#__PURE__*/ _jsx("div", {
59
+ className: iconWrapperClasses,
60
+ children: processedRightSlot
61
+ })
62
+ })
63
+ });
63
64
  };
64
65
  // Input tag
65
- const inputElement = (_jsx("input", { type: type, "data-slot": "input", className: cn(inputVariants({
66
+ const inputElement = /*#__PURE__*/ _jsx("input", {
67
+ type: type,
68
+ "data-slot": "input",
69
+ className: cn(inputVariants({
66
70
  invalid,
67
71
  hasLeftSlot: !!leftSlot,
68
72
  hasRightSlot: !!rightSlot,
69
73
  hasSuffix: !!suffix,
70
- className,
71
- })), ...props }));
72
- return (_jsxs("div", { className: "flex w-full min-w-0", children: [_jsxs("div", { className: "flex-1 relative", children: [renderLeftSlot(), inputElement, renderRightSlot()] }), suffix && (_jsx("div", { className: props.disabled
73
- ? suffixDisabledClasses
74
- : invalid
75
- ? suffixInvalidClasses
76
- : suffixClasses, children: suffix }))] }));
74
+ className
75
+ })),
76
+ ...props
77
+ });
78
+ return /*#__PURE__*/ _jsxs("div", {
79
+ className: "flex w-full min-w-0",
80
+ children: [
81
+ /*#__PURE__*/ _jsxs("div", {
82
+ className: "flex-1 relative",
83
+ children: [
84
+ renderLeftSlot(),
85
+ inputElement,
86
+ renderRightSlot()
87
+ ]
88
+ }),
89
+ suffix && /*#__PURE__*/ _jsx("div", {
90
+ className: props.disabled ? suffixDisabledClasses : invalid ? suffixInvalidClasses : suffixClasses,
91
+ children: suffix
92
+ })
93
+ ]
94
+ });
77
95
  }
78
96
  export { Input, inputVariants };
97
+
79
98
  //# sourceMappingURL=input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/input.tsx"],"names":[],"mappings":"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"}
1
+ {"version":3,"sources":["../../../../../src/shadcn/components/ui/input.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nconst iconBaseClasses =\n\t\"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\";\n\nconst iconLeftPosition =\n\t\"left-3 hover:text-text-tertiary hover:cursor-default transition-colors duration-300\";\n\nconst iconRightContainer =\n\t\"absolute right-3 top-1/2 -translate-y-1/2 flex gap-2 z-10\";\n\nconst iconNormalColor =\n\t\"text-text-tertiary hover:text-fg-secondary transition-colors duration-300\";\nconst iconInvalidColor =\n\t\"text-fg-tertiary hover:text-fg-secondary transition-colors duration-300\";\nconst iconDisabledColor =\n\t\"text-text-disabled hover:cursor-not-allowed transition-colors duration-300\";\n\nconst iconWrapperClasses = \"[&>svg]:w-full [&>svg]:h-full [&>svg]:stroke-[1.5]\";\n\nconst iconRightItemClasses =\n\t\"cursor-pointer flex items-center justify-center transition-colors duration-300\";\n\nconst suffixClasses =\n\t\"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\";\n\nconst suffixDisabledClasses =\n\t\"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\";\n\nconst suffixInvalidClasses =\n\t\"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\";\n\nconst inputVariants = cva(\n\tcn(\n\t\t\"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\",\n\t\t\"focus-visible:ring-4 focus-visible:ring-ring-blue focus-visible:border-border-link\",\n\t\t\"aria-invalid:ring-destructive aria-invalid:text-text-error-primary aria-invalid:border-border-error-primary\",\n\t\t\"\",\n\t\t\"rounded-md\",\n\t),\n\t{\n\t\tvariants: {\n\t\t\thasLeftSlot: {\n\t\t\t\ttrue: \"pl-9\",\n\t\t\t},\n\t\t\thasRightSlot: {\n\t\t\t\ttrue: \"pr-9\",\n\t\t\t},\n\t\t\thasSuffix: {\n\t\t\t\ttrue: \"border-r-0 focus-visible:ring-offset-0 rounded-l-md rounded-r-none focus-visible:border-r-1\",\n\t\t\t},\n\t\t\tinvalid: {\n\t\t\t\ttrue: \"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\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\thasSuffix: false,\n\t\t\tinvalid: false,\n\t\t},\n\t},\n);\n\ninterface InputProps\n\textends React.ComponentProps<\"input\">,\n\t\tVariantProps<typeof inputVariants> {\n\ttype?: \"text\" | \"password\";\n\tsuffix?: string;\n\tinvalid?: boolean;\n\tleftSlot?: React.ReactNode;\n\trightSlot?: React.ReactNode;\n}\n\nfunction Input({\n\tclassName,\n\ttype,\n\tinvalid,\n\tsuffix,\n\tleftSlot,\n\trightSlot,\n\t...props\n}: InputProps) {\n\tconst processedLeftSlot = leftSlot === \"None\" ? undefined : leftSlot;\n\tconst processedRightSlot = rightSlot === \"None\" ? undefined : rightSlot;\n\n\tconst hasLeftIcon =\n\t\tprocessedLeftSlot &&\n\t\tprocessedLeftSlot !== null &&\n\t\tprocessedLeftSlot !== undefined;\n\tconst hasRightIcon =\n\t\tprocessedRightSlot &&\n\t\tprocessedRightSlot !== null &&\n\t\tprocessedRightSlot !== undefined;\n\n\tconst renderLeftSlot = () => {\n\t\tif (!hasLeftIcon) return null;\n\t\tconst colorClasses = props.disabled\n\t\t\t? iconDisabledColor\n\t\t\t: invalid\n\t\t\t\t? iconInvalidColor\n\t\t\t\t: iconNormalColor;\n\t\treturn (\n\t\t\t<div className={`${iconBaseClasses} ${iconLeftPosition} ${colorClasses}`}>\n\t\t\t\t<div className={iconWrapperClasses}>{processedLeftSlot}</div>\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderRightSlot = () => {\n\t\tif (!hasRightIcon) return null;\n\n\t\tconst colorClasses = props.disabled\n\t\t\t? iconDisabledColor\n\t\t\t: invalid\n\t\t\t\t? iconInvalidColor\n\t\t\t\t: iconNormalColor;\n\n\t\treturn (\n\t\t\t<div className={`${iconRightContainer} ${iconBaseClasses}`}>\n\t\t\t\t{hasRightIcon && (\n\t\t\t\t\t<div className={`${iconRightItemClasses} ${colorClasses}`}>\n\t\t\t\t\t\t<div className={iconWrapperClasses}>{processedRightSlot}</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// Input tag\n\tconst inputElement = (\n\t\t<input\n\t\t\ttype={type}\n\t\t\tdata-slot=\"input\"\n\t\t\tclassName={cn(\n\t\t\t\tinputVariants({\n\t\t\t\t\tinvalid,\n\t\t\t\t\thasLeftSlot: !!leftSlot,\n\t\t\t\t\thasRightSlot: !!rightSlot,\n\t\t\t\t\thasSuffix: !!suffix,\n\t\t\t\t\tclassName,\n\t\t\t\t}),\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n\n\treturn (\n\t\t<div className=\"flex w-full min-w-0\">\n\t\t\t<div className=\"flex-1 relative\">\n\t\t\t\t{renderLeftSlot()}\n\t\t\t\t{inputElement}\n\t\t\t\t{renderRightSlot()}\n\t\t\t</div>\n\t\t\t{suffix && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tprops.disabled\n\t\t\t\t\t\t\t? suffixDisabledClasses\n\t\t\t\t\t\t\t: invalid\n\t\t\t\t\t\t\t\t? suffixInvalidClasses\n\t\t\t\t\t\t\t\t: suffixClasses\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{suffix}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport { Input, inputVariants };\n"],"names":["cva","cn","iconBaseClasses","iconLeftPosition","iconRightContainer","iconNormalColor","iconInvalidColor","iconDisabledColor","iconWrapperClasses","iconRightItemClasses","suffixClasses","suffixDisabledClasses","suffixInvalidClasses","inputVariants","variants","hasLeftSlot","true","hasRightSlot","hasSuffix","invalid","defaultVariants","Input","className","type","suffix","leftSlot","rightSlot","props","processedLeftSlot","undefined","processedRightSlot","hasLeftIcon","hasRightIcon","renderLeftSlot","colorClasses","disabled","div","renderRightSlot","inputElement","input","data-slot"],"mappings":";AAAA,SAASA,GAAG,QAA2B,2BAA2B;AAGlE,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,MAAMC,kBACL;AAED,MAAMC,mBACL;AAED,MAAMC,qBACL;AAED,MAAMC,kBACL;AACD,MAAMC,mBACL;AACD,MAAMC,oBACL;AAED,MAAMC,qBAAqB;AAE3B,MAAMC,uBACL;AAED,MAAMC,gBACL;AAED,MAAMC,wBACL;AAED,MAAMC,uBACL;AAED,MAAMC,gBAAgBb,IACrBC,GACC,8hBACA,sFACA,+GACA,IACA,eAED;IACCa,UAAU;QACTC,aAAa;YACZC,MAAM;QACP;QACAC,cAAc;YACbD,MAAM;QACP;QACAE,WAAW;YACVF,MAAM;QACP;QACAG,SAAS;YACRH,MAAM;QACP;IACD;IACAI,iBAAiB;QAChBF,WAAW;QACXC,SAAS;IACV;AACD;AAaD,SAASE,MAAM,EACdC,SAAS,EACTC,IAAI,EACJJ,OAAO,EACPK,MAAM,EACNC,QAAQ,EACRC,SAAS,EACT,GAAGC,OACS;IACZ,MAAMC,oBAAoBH,aAAa,SAASI,YAAYJ;IAC5D,MAAMK,qBAAqBJ,cAAc,SAASG,YAAYH;IAE9D,MAAMK,cACLH,qBACAA,sBAAsB,QACtBA,sBAAsBC;IACvB,MAAMG,eACLF,sBACAA,uBAAuB,QACvBA,uBAAuBD;IAExB,MAAMI,iBAAiB;QACtB,IAAI,CAACF,aAAa,OAAO;QACzB,MAAMG,eAAeP,MAAMQ,QAAQ,GAChC5B,oBACAY,UACCb,mBACAD;QACJ,qBACC,KAAC+B;YAAId,WAAW,GAAGpB,gBAAgB,CAAC,EAAEC,iBAAiB,CAAC,EAAE+B,cAAc;sBACvE,cAAA,KAACE;gBAAId,WAAWd;0BAAqBoB;;;IAGxC;IAEA,MAAMS,kBAAkB;QACvB,IAAI,CAACL,cAAc,OAAO;QAE1B,MAAME,eAAeP,MAAMQ,QAAQ,GAChC5B,oBACAY,UACCb,mBACAD;QAEJ,qBACC,KAAC+B;YAAId,WAAW,GAAGlB,mBAAmB,CAAC,EAAEF,iBAAiB;sBACxD8B,8BACA,KAACI;gBAAId,WAAW,GAAGb,qBAAqB,CAAC,EAAEyB,cAAc;0BACxD,cAAA,KAACE;oBAAId,WAAWd;8BAAqBsB;;;;IAK1C;IAEA,YAAY;IACZ,MAAMQ,6BACL,KAACC;QACAhB,MAAMA;QACNiB,aAAU;QACVlB,WAAWrB,GACVY,cAAc;YACbM;YACAJ,aAAa,CAAC,CAACU;YACfR,cAAc,CAAC,CAACS;YAChBR,WAAW,CAAC,CAACM;YACbF;QACD;QAEA,GAAGK,KAAK;;IAIX,qBACC,MAACS;QAAId,WAAU;;0BACd,MAACc;gBAAId,WAAU;;oBACbW;oBACAK;oBACAD;;;YAEDb,wBACA,KAACY;gBACAd,WACCK,MAAMQ,QAAQ,GACXxB,wBACAQ,UACCP,uBACAF;0BAGJc;;;;AAKN;AAEA,SAASH,KAAK,EAAER,aAAa,GAAG"}
@@ -1,19 +1,39 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CircleX, Copy, Mail } from "lucide-react";
3
- import { Badge } from "#shadcn/components/ui/badge";
4
- import { Input } from "#shadcn/components/ui/input";
5
- import { Label } from "#shadcn/components/ui/label";
6
- function InputWithLabel({ label = "Label", description = "This is a hint text to help user.", invalid = false, disabled = false, placeholder = "Placeholder", leftSlot, rightSlot, suffix, }) {
7
- const descriptionColor = invalid
8
- ? "text-text-error-primary"
9
- : disabled
10
- ? "text-text-disabled"
11
- : "text-text-secondary";
12
- return (_jsx("div", { className: "flex w-full", children: _jsxs("div", { className: "space-y-2 w-full", children: [_jsx(Label, { children: label }), _jsx(Input, { placeholder: placeholder, leftSlot: leftSlot, rightSlot: rightSlot, ...(suffix && { suffix }), invalid: invalid, disabled: disabled }), _jsx("p", { className: `typo-body ${descriptionColor}`, children: description })] }) }));
3
+ import { Badge } from "./badge.js";
4
+ import { Input } from "./input.js";
5
+ import { Label } from "./label.js";
6
+ function InputWithLabel({ label = "Label", description = "This is a hint text to help user.", invalid = false, disabled = false, placeholder = "Placeholder", leftSlot, rightSlot, suffix }) {
7
+ const descriptionColor = invalid ? "text-text-error-primary" : disabled ? "text-text-disabled" : "text-text-secondary";
8
+ return /*#__PURE__*/ _jsx("div", {
9
+ className: "flex w-full",
10
+ children: /*#__PURE__*/ _jsxs("div", {
11
+ className: "space-y-2 w-full",
12
+ children: [
13
+ /*#__PURE__*/ _jsx(Label, {
14
+ children: label
15
+ }),
16
+ /*#__PURE__*/ _jsx(Input, {
17
+ placeholder: placeholder,
18
+ leftSlot: leftSlot,
19
+ rightSlot: rightSlot,
20
+ ...suffix && {
21
+ suffix
22
+ },
23
+ invalid: invalid,
24
+ disabled: disabled
25
+ }),
26
+ /*#__PURE__*/ _jsx("p", {
27
+ className: `typo-body ${descriptionColor}`,
28
+ children: description
29
+ })
30
+ ]
31
+ })
32
+ });
13
33
  }
14
34
  const meta = {
15
35
  title: "Component/Input",
16
- component: Input,
36
+ component: Input
17
37
  };
18
38
  export default meta;
19
39
  export const Default = {
@@ -21,19 +41,367 @@ export const Default = {
21
41
  type: "text",
22
42
  placeholder: "Placeholder",
23
43
  leftSlot: undefined,
24
- rightSlot: undefined,
25
- },
44
+ rightSlot: undefined
45
+ }
26
46
  };
27
47
  export const Demo = {
28
- render: () => (_jsx("div", { className: "p-6 min-h-screen flex justify-center items-center", children: _jsxs("div", { className: "rounded-lg p-6 shadow-sm w-280", children: [_jsxs("div", { className: "flex items-center mb-4 justify-between", children: [_jsx("div", { className: "w-40 text-left", children: "Inputs without labels" }), _jsxs("div", { className: "w-70 text-left text-sm text-text-secondary", children: ["Invalid:", _jsx(Badge, { variant: "outline", className: "text-xs ml-2", children: "false" })] }), _jsxs("div", { className: "w-70 text-left text-sm text-text-secondary", children: ["Invalid:", _jsx(Badge, { variant: "outline", className: "text-xs ml-2", children: "true" })] }), _jsxs("div", { className: "w-70 text-left text-sm text-text-secondary", children: ["Disabled:", _jsx(Badge, { variant: "outline", className: "text-xs ml-2", children: "true" })] })] }), ["none", "left", "right", "both", "left-double-right"].map((variant) => {
29
- const variantLabel = {
30
- none: "None",
31
- left: "leftSlot",
32
- right: "rightSlot",
33
- both: "leftSlot + rightSlot",
34
- "left-double-right": "BothPlusExtra",
35
- }[variant];
36
- return (_jsx("div", { className: "items-center gap-3 py-3 border-gray-l00 border-t border-border-separator", children: _jsxs("div", { className: "flex gap-3 items-center py-2 justify-between", children: [_jsx("div", { className: "w-40 text-sm text-text-secondary", children: _jsxs("div", { className: "flex", children: [_jsx("div", { className: "w-15", children: "Slots:" }), _jsx(Badge, { variant: "outline", className: "text-xs", children: variantLabel })] }) }), _jsxs("div", { className: "w-70 flex gap-3 justify-center", children: [variant === "none" && _jsx(Input, { placeholder: "Placeholder" }), variant === "left" && (_jsx(Input, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}) })), variant === "right" && (_jsx(Input, { placeholder: "Placeholder", rightSlot: _jsx(CircleX, {}) })), variant === "both" && (_jsx(Input, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}) })), variant === "left-double-right" && (_jsx(Input, { placeholder: "Placeholder", className: "pr-15", leftSlot: _jsx(Mail, {}), rightSlot: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CircleX, {}), _jsx(Copy, {})] }), suffix: "milliseconds" }))] }), _jsxs("div", { className: "w-70 flex gap-3 justify-center", children: [variant === "none" && (_jsx(Input, { placeholder: "Placeholder", invalid: true })), variant === "left" && (_jsx(Input, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), invalid: true })), variant === "right" && (_jsx(Input, { placeholder: "Placeholder", rightSlot: _jsx(CircleX, {}), invalid: true })), variant === "both" && (_jsx(Input, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), invalid: true })), variant === "left-double-right" && (_jsx(Input, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), suffix: "milliseconds", invalid: true }))] }), _jsxs("div", { className: "w-70 flex gap-3 justify-center", children: [variant === "none" && (_jsx(Input, { placeholder: "Aidbox", disabled: true })), variant === "left" && (_jsx(Input, { placeholder: "Aidbox", leftSlot: _jsx(Mail, {}), disabled: true })), variant === "right" && (_jsx(Input, { placeholder: "Aidbox", rightSlot: _jsx(CircleX, {}), disabled: true })), variant === "both" && (_jsx(Input, { placeholder: "Aidbox", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), disabled: true })), variant === "left-double-right" && (_jsx(Input, { placeholder: "Aidbox", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), suffix: "milliseconds", disabled: true }))] })] }) }, variant));
37
- }), _jsxs("div", { className: "mt-8", children: [_jsxs("div", { className: "flex items-center mb-4 justify-between", children: [_jsx("div", { className: "w-40 text-left", children: "Input + Label + Description" }), _jsxs("div", { className: "w-70 text-left text-sm text-text-secondary", children: ["Invalid:", _jsx(Badge, { variant: "outline", className: "text-xs", children: "false" })] }), _jsxs("div", { className: "w-70 text-left text-sm text-text-secondary", children: ["Invalid:", _jsx(Badge, { variant: "outline", className: "text-xs", children: "true" })] }), _jsxs("div", { className: "w-70 text-left text-sm text-text-secondary", children: ["Disabled:", _jsx(Badge, { variant: "outline", className: "text-xs", children: "true" })] })] }), ["none", "left", "right", "both", "left-double-right"].map((variant) => (_jsx("div", { className: "items-center gap-3 py-3 border-gray-l00 border-t border-border-separator", children: _jsxs("div", { className: "flex gap-3 items-center py-2 justify-between", children: [_jsx("div", { className: "w-40 text-sm text-text-secondary", children: _jsxs("div", { className: "flex", children: [_jsx("div", { className: "w-15", children: "Slots:" }), _jsx(Badge, { variant: "outline", className: "text-xs", children: variant })] }) }), _jsxs("div", { className: "w-70 flex gap-3 justify-center", children: [variant === "none" && (_jsx(InputWithLabel, { placeholder: "Placeholder" })), variant === "left" && (_jsx(InputWithLabel, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}) })), variant === "right" && (_jsx(InputWithLabel, { placeholder: "Placeholder", rightSlot: _jsx(CircleX, {}) })), variant === "both" && (_jsx(InputWithLabel, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}) })), variant === "left-double-right" && (_jsx(InputWithLabel, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), suffix: "milliseconds" }))] }), _jsxs("div", { className: "w-70 flex gap-3 justify-center", children: [variant === "none" && (_jsx(InputWithLabel, { placeholder: "Placeholder", invalid: true })), variant === "left" && (_jsx(InputWithLabel, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), invalid: true })), variant === "right" && (_jsx(InputWithLabel, { placeholder: "Placeholder", rightSlot: _jsx(CircleX, {}), invalid: true })), variant === "both" && (_jsx(InputWithLabel, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), invalid: true })), variant === "left-double-right" && (_jsx(InputWithLabel, { placeholder: "Placeholder", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), suffix: "milliseconds", invalid: true }))] }), _jsxs("div", { className: "w-70 flex gap-3 justify-center", children: [variant === "none" && (_jsx(InputWithLabel, { placeholder: "Aidbox", disabled: true })), variant === "left" && (_jsx(InputWithLabel, { placeholder: "Aidbox", leftSlot: _jsx(Mail, {}), disabled: true })), variant === "right" && (_jsx(InputWithLabel, { placeholder: "Aidbox", rightSlot: _jsx(CircleX, {}), disabled: true })), variant === "both" && (_jsx(InputWithLabel, { placeholder: "Aidbox", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), disabled: true })), variant === "left-double-right" && (_jsx(InputWithLabel, { placeholder: "Aidbox", leftSlot: _jsx(Mail, {}), rightSlot: _jsx(CircleX, {}), suffix: "milliseconds", disabled: true }))] })] }) }, `label-${variant}`)))] })] }) })),
48
+ render: ()=>/*#__PURE__*/ _jsx("div", {
49
+ className: "p-6 min-h-screen flex justify-center items-center",
50
+ children: /*#__PURE__*/ _jsxs("div", {
51
+ className: "rounded-lg p-6 shadow-sm w-280",
52
+ children: [
53
+ /*#__PURE__*/ _jsxs("div", {
54
+ className: "flex items-center mb-4 justify-between",
55
+ children: [
56
+ /*#__PURE__*/ _jsx("div", {
57
+ className: "w-40 text-left",
58
+ children: "Inputs without labels"
59
+ }),
60
+ /*#__PURE__*/ _jsxs("div", {
61
+ className: "w-70 text-left text-sm text-text-secondary",
62
+ children: [
63
+ "Invalid:",
64
+ /*#__PURE__*/ _jsx(Badge, {
65
+ variant: "outline",
66
+ className: "text-xs ml-2",
67
+ children: "false"
68
+ })
69
+ ]
70
+ }),
71
+ /*#__PURE__*/ _jsxs("div", {
72
+ className: "w-70 text-left text-sm text-text-secondary",
73
+ children: [
74
+ "Invalid:",
75
+ /*#__PURE__*/ _jsx(Badge, {
76
+ variant: "outline",
77
+ className: "text-xs ml-2",
78
+ children: "true"
79
+ })
80
+ ]
81
+ }),
82
+ /*#__PURE__*/ _jsxs("div", {
83
+ className: "w-70 text-left text-sm text-text-secondary",
84
+ children: [
85
+ "Disabled:",
86
+ /*#__PURE__*/ _jsx(Badge, {
87
+ variant: "outline",
88
+ className: "text-xs ml-2",
89
+ children: "true"
90
+ })
91
+ ]
92
+ })
93
+ ]
94
+ }),
95
+ [
96
+ "none",
97
+ "left",
98
+ "right",
99
+ "both",
100
+ "left-double-right"
101
+ ].map((variant)=>{
102
+ const variantLabel = {
103
+ none: "None",
104
+ left: "leftSlot",
105
+ right: "rightSlot",
106
+ both: "leftSlot + rightSlot",
107
+ "left-double-right": "BothPlusExtra"
108
+ }[variant];
109
+ return /*#__PURE__*/ _jsx("div", {
110
+ className: "items-center gap-3 py-3 border-gray-l00 border-t border-border-separator",
111
+ children: /*#__PURE__*/ _jsxs("div", {
112
+ className: "flex gap-3 items-center py-2 justify-between",
113
+ children: [
114
+ /*#__PURE__*/ _jsx("div", {
115
+ className: "w-40 text-sm text-text-secondary",
116
+ children: /*#__PURE__*/ _jsxs("div", {
117
+ className: "flex",
118
+ children: [
119
+ /*#__PURE__*/ _jsx("div", {
120
+ className: "w-15",
121
+ children: "Slots:"
122
+ }),
123
+ /*#__PURE__*/ _jsx(Badge, {
124
+ variant: "outline",
125
+ className: "text-xs",
126
+ children: variantLabel
127
+ })
128
+ ]
129
+ })
130
+ }),
131
+ /*#__PURE__*/ _jsxs("div", {
132
+ className: "w-70 flex gap-3 justify-center",
133
+ children: [
134
+ variant === "none" && /*#__PURE__*/ _jsx(Input, {
135
+ placeholder: "Placeholder"
136
+ }),
137
+ variant === "left" && /*#__PURE__*/ _jsx(Input, {
138
+ placeholder: "Placeholder",
139
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {})
140
+ }),
141
+ variant === "right" && /*#__PURE__*/ _jsx(Input, {
142
+ placeholder: "Placeholder",
143
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {})
144
+ }),
145
+ variant === "both" && /*#__PURE__*/ _jsx(Input, {
146
+ placeholder: "Placeholder",
147
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
148
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {})
149
+ }),
150
+ variant === "left-double-right" && /*#__PURE__*/ _jsx(Input, {
151
+ placeholder: "Placeholder",
152
+ className: "pr-15",
153
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
154
+ rightSlot: /*#__PURE__*/ _jsxs("div", {
155
+ className: "flex items-center gap-2",
156
+ children: [
157
+ /*#__PURE__*/ _jsx(CircleX, {}),
158
+ /*#__PURE__*/ _jsx(Copy, {})
159
+ ]
160
+ }),
161
+ suffix: "milliseconds"
162
+ })
163
+ ]
164
+ }),
165
+ /*#__PURE__*/ _jsxs("div", {
166
+ className: "w-70 flex gap-3 justify-center",
167
+ children: [
168
+ variant === "none" && /*#__PURE__*/ _jsx(Input, {
169
+ placeholder: "Placeholder",
170
+ invalid: true
171
+ }),
172
+ variant === "left" && /*#__PURE__*/ _jsx(Input, {
173
+ placeholder: "Placeholder",
174
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
175
+ invalid: true
176
+ }),
177
+ variant === "right" && /*#__PURE__*/ _jsx(Input, {
178
+ placeholder: "Placeholder",
179
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
180
+ invalid: true
181
+ }),
182
+ variant === "both" && /*#__PURE__*/ _jsx(Input, {
183
+ placeholder: "Placeholder",
184
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
185
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
186
+ invalid: true
187
+ }),
188
+ variant === "left-double-right" && /*#__PURE__*/ _jsx(Input, {
189
+ placeholder: "Placeholder",
190
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
191
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
192
+ suffix: "milliseconds",
193
+ invalid: true
194
+ })
195
+ ]
196
+ }),
197
+ /*#__PURE__*/ _jsxs("div", {
198
+ className: "w-70 flex gap-3 justify-center",
199
+ children: [
200
+ variant === "none" && /*#__PURE__*/ _jsx(Input, {
201
+ placeholder: "Aidbox",
202
+ disabled: true
203
+ }),
204
+ variant === "left" && /*#__PURE__*/ _jsx(Input, {
205
+ placeholder: "Aidbox",
206
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
207
+ disabled: true
208
+ }),
209
+ variant === "right" && /*#__PURE__*/ _jsx(Input, {
210
+ placeholder: "Aidbox",
211
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
212
+ disabled: true
213
+ }),
214
+ variant === "both" && /*#__PURE__*/ _jsx(Input, {
215
+ placeholder: "Aidbox",
216
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
217
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
218
+ disabled: true
219
+ }),
220
+ variant === "left-double-right" && /*#__PURE__*/ _jsx(Input, {
221
+ placeholder: "Aidbox",
222
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
223
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
224
+ suffix: "milliseconds",
225
+ disabled: true
226
+ })
227
+ ]
228
+ })
229
+ ]
230
+ })
231
+ }, variant);
232
+ }),
233
+ /*#__PURE__*/ _jsxs("div", {
234
+ className: "mt-8",
235
+ children: [
236
+ /*#__PURE__*/ _jsxs("div", {
237
+ className: "flex items-center mb-4 justify-between",
238
+ children: [
239
+ /*#__PURE__*/ _jsx("div", {
240
+ className: "w-40 text-left",
241
+ children: "Input + Label + Description"
242
+ }),
243
+ /*#__PURE__*/ _jsxs("div", {
244
+ className: "w-70 text-left text-sm text-text-secondary",
245
+ children: [
246
+ "Invalid:",
247
+ /*#__PURE__*/ _jsx(Badge, {
248
+ variant: "outline",
249
+ className: "text-xs",
250
+ children: "false"
251
+ })
252
+ ]
253
+ }),
254
+ /*#__PURE__*/ _jsxs("div", {
255
+ className: "w-70 text-left text-sm text-text-secondary",
256
+ children: [
257
+ "Invalid:",
258
+ /*#__PURE__*/ _jsx(Badge, {
259
+ variant: "outline",
260
+ className: "text-xs",
261
+ children: "true"
262
+ })
263
+ ]
264
+ }),
265
+ /*#__PURE__*/ _jsxs("div", {
266
+ className: "w-70 text-left text-sm text-text-secondary",
267
+ children: [
268
+ "Disabled:",
269
+ /*#__PURE__*/ _jsx(Badge, {
270
+ variant: "outline",
271
+ className: "text-xs",
272
+ children: "true"
273
+ })
274
+ ]
275
+ })
276
+ ]
277
+ }),
278
+ [
279
+ "none",
280
+ "left",
281
+ "right",
282
+ "both",
283
+ "left-double-right"
284
+ ].map((variant)=>/*#__PURE__*/ _jsx("div", {
285
+ className: "items-center gap-3 py-3 border-gray-l00 border-t border-border-separator",
286
+ children: /*#__PURE__*/ _jsxs("div", {
287
+ className: "flex gap-3 items-center py-2 justify-between",
288
+ children: [
289
+ /*#__PURE__*/ _jsx("div", {
290
+ className: "w-40 text-sm text-text-secondary",
291
+ children: /*#__PURE__*/ _jsxs("div", {
292
+ className: "flex",
293
+ children: [
294
+ /*#__PURE__*/ _jsx("div", {
295
+ className: "w-15",
296
+ children: "Slots:"
297
+ }),
298
+ /*#__PURE__*/ _jsx(Badge, {
299
+ variant: "outline",
300
+ className: "text-xs",
301
+ children: variant
302
+ })
303
+ ]
304
+ })
305
+ }),
306
+ /*#__PURE__*/ _jsxs("div", {
307
+ className: "w-70 flex gap-3 justify-center",
308
+ children: [
309
+ variant === "none" && /*#__PURE__*/ _jsx(InputWithLabel, {
310
+ placeholder: "Placeholder"
311
+ }),
312
+ variant === "left" && /*#__PURE__*/ _jsx(InputWithLabel, {
313
+ placeholder: "Placeholder",
314
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {})
315
+ }),
316
+ variant === "right" && /*#__PURE__*/ _jsx(InputWithLabel, {
317
+ placeholder: "Placeholder",
318
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {})
319
+ }),
320
+ variant === "both" && /*#__PURE__*/ _jsx(InputWithLabel, {
321
+ placeholder: "Placeholder",
322
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
323
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {})
324
+ }),
325
+ variant === "left-double-right" && /*#__PURE__*/ _jsx(InputWithLabel, {
326
+ placeholder: "Placeholder",
327
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
328
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
329
+ suffix: "milliseconds"
330
+ })
331
+ ]
332
+ }),
333
+ /*#__PURE__*/ _jsxs("div", {
334
+ className: "w-70 flex gap-3 justify-center",
335
+ children: [
336
+ variant === "none" && /*#__PURE__*/ _jsx(InputWithLabel, {
337
+ placeholder: "Placeholder",
338
+ invalid: true
339
+ }),
340
+ variant === "left" && /*#__PURE__*/ _jsx(InputWithLabel, {
341
+ placeholder: "Placeholder",
342
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
343
+ invalid: true
344
+ }),
345
+ variant === "right" && /*#__PURE__*/ _jsx(InputWithLabel, {
346
+ placeholder: "Placeholder",
347
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
348
+ invalid: true
349
+ }),
350
+ variant === "both" && /*#__PURE__*/ _jsx(InputWithLabel, {
351
+ placeholder: "Placeholder",
352
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
353
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
354
+ invalid: true
355
+ }),
356
+ variant === "left-double-right" && /*#__PURE__*/ _jsx(InputWithLabel, {
357
+ placeholder: "Placeholder",
358
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
359
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
360
+ suffix: "milliseconds",
361
+ invalid: true
362
+ })
363
+ ]
364
+ }),
365
+ /*#__PURE__*/ _jsxs("div", {
366
+ className: "w-70 flex gap-3 justify-center",
367
+ children: [
368
+ variant === "none" && /*#__PURE__*/ _jsx(InputWithLabel, {
369
+ placeholder: "Aidbox",
370
+ disabled: true
371
+ }),
372
+ variant === "left" && /*#__PURE__*/ _jsx(InputWithLabel, {
373
+ placeholder: "Aidbox",
374
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
375
+ disabled: true
376
+ }),
377
+ variant === "right" && /*#__PURE__*/ _jsx(InputWithLabel, {
378
+ placeholder: "Aidbox",
379
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
380
+ disabled: true
381
+ }),
382
+ variant === "both" && /*#__PURE__*/ _jsx(InputWithLabel, {
383
+ placeholder: "Aidbox",
384
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
385
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
386
+ disabled: true
387
+ }),
388
+ variant === "left-double-right" && /*#__PURE__*/ _jsx(InputWithLabel, {
389
+ placeholder: "Aidbox",
390
+ leftSlot: /*#__PURE__*/ _jsx(Mail, {}),
391
+ rightSlot: /*#__PURE__*/ _jsx(CircleX, {}),
392
+ suffix: "milliseconds",
393
+ disabled: true
394
+ })
395
+ ]
396
+ })
397
+ ]
398
+ })
399
+ }, `label-${variant}`))
400
+ ]
401
+ })
402
+ ]
403
+ })
404
+ })
38
405
  };
406
+
39
407
  //# sourceMappingURL=input.stories.js.map