@codefast/ui 0.0.7 → 0.0.9

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 (385) hide show
  1. package/dist/accordion.d.mts +5 -1
  2. package/dist/accordion.d.ts +5 -1
  3. package/dist/accordion.js.map +1 -1
  4. package/dist/accordion.mjs.map +1 -1
  5. package/dist/alert-dialog.d.mts +12 -3
  6. package/dist/alert-dialog.d.ts +12 -3
  7. package/dist/alert-dialog.js +3 -3
  8. package/dist/alert-dialog.js.map +1 -1
  9. package/dist/alert-dialog.mjs +1 -1
  10. package/dist/alert-dialog.mjs.map +1 -1
  11. package/dist/alert.d.mts +10 -5
  12. package/dist/alert.d.ts +10 -5
  13. package/dist/alert.js +22 -18
  14. package/dist/alert.js.map +1 -1
  15. package/dist/alert.mjs +22 -18
  16. package/dist/alert.mjs.map +1 -1
  17. package/dist/aspect-ratio.d.mts +2 -1
  18. package/dist/aspect-ratio.d.ts +2 -1
  19. package/dist/aspect-ratio.js.map +1 -1
  20. package/dist/aspect-ratio.mjs.map +1 -1
  21. package/dist/avatar.d.mts +4 -1
  22. package/dist/avatar.d.ts +4 -1
  23. package/dist/avatar.js.map +1 -1
  24. package/dist/avatar.mjs.map +1 -1
  25. package/dist/badge.d.mts +5 -2
  26. package/dist/badge.d.ts +5 -2
  27. package/dist/badge.js +4 -4
  28. package/dist/badge.js.map +1 -1
  29. package/dist/badge.mjs +4 -4
  30. package/dist/badge.mjs.map +1 -1
  31. package/dist/blockquote.d.mts +8 -0
  32. package/dist/blockquote.d.ts +8 -0
  33. package/dist/blockquote.js +15 -0
  34. package/dist/blockquote.js.map +1 -0
  35. package/dist/blockquote.mjs +15 -0
  36. package/dist/blockquote.mjs.map +1 -0
  37. package/dist/box.d.mts +14 -0
  38. package/dist/box.d.ts +14 -0
  39. package/dist/box.js +15 -0
  40. package/dist/box.js.map +1 -0
  41. package/dist/box.mjs +15 -0
  42. package/dist/box.mjs.map +1 -0
  43. package/dist/breadcrumb.d.mts +18 -11
  44. package/dist/breadcrumb.d.ts +18 -11
  45. package/dist/breadcrumb.js +49 -39
  46. package/dist/breadcrumb.js.map +1 -1
  47. package/dist/breadcrumb.mjs +49 -39
  48. package/dist/breadcrumb.mjs.map +1 -1
  49. package/dist/button.d.mts +4 -3
  50. package/dist/button.d.ts +4 -3
  51. package/dist/button.js +2 -2
  52. package/dist/button.mjs +1 -1
  53. package/dist/calendar.d.mts +3 -2
  54. package/dist/calendar.d.ts +3 -2
  55. package/dist/calendar.js +3 -3
  56. package/dist/calendar.js.map +1 -1
  57. package/dist/calendar.mjs +1 -1
  58. package/dist/calendar.mjs.map +1 -1
  59. package/dist/card.d.mts +13 -7
  60. package/dist/card.d.ts +13 -7
  61. package/dist/card.js +47 -37
  62. package/dist/card.js.map +1 -1
  63. package/dist/card.mjs +47 -37
  64. package/dist/card.mjs.map +1 -1
  65. package/dist/carousel.d.mts +13 -8
  66. package/dist/carousel.d.ts +13 -8
  67. package/dist/carousel.js +63 -57
  68. package/dist/carousel.js.map +1 -1
  69. package/dist/carousel.mjs +62 -56
  70. package/dist/carousel.mjs.map +1 -1
  71. package/dist/checkbox.d.mts +2 -1
  72. package/dist/checkbox.d.ts +2 -1
  73. package/dist/checkbox.js.map +1 -1
  74. package/dist/checkbox.mjs.map +1 -1
  75. package/dist/{chunk-OCLLX7EY.js → chunk-3BDLWZ3W.js} +1 -1
  76. package/dist/chunk-3BDLWZ3W.js.map +1 -0
  77. package/dist/{chunk-2D7SRYKN.js → chunk-43YGVOCO.js} +1 -1
  78. package/dist/chunk-43YGVOCO.js.map +1 -0
  79. package/dist/{chunk-EIHWTXQ4.mjs → chunk-AJLEALVP.mjs} +1 -1
  80. package/dist/chunk-AJLEALVP.mjs.map +1 -0
  81. package/dist/{chunk-LDYBRDAY.js → chunk-D6NQEMTJ.js} +1 -1
  82. package/dist/chunk-D6NQEMTJ.js.map +1 -0
  83. package/dist/{chunk-KW5FJ62U.mjs → chunk-FATZHRHR.mjs} +1 -1
  84. package/dist/chunk-FATZHRHR.mjs.map +1 -0
  85. package/dist/{chunk-RTKEO347.js → chunk-GRKABVK4.js} +1 -1
  86. package/dist/chunk-GRKABVK4.js.map +1 -0
  87. package/dist/{chunk-U2WDUCW3.js → chunk-JOJW7BBY.js} +1 -1
  88. package/dist/{chunk-U2WDUCW3.js.map → chunk-JOJW7BBY.js.map} +1 -1
  89. package/dist/{chunk-ESWGFN3R.mjs → chunk-KV4VL2ZF.mjs} +1 -1
  90. package/dist/chunk-KV4VL2ZF.mjs.map +1 -0
  91. package/dist/{chunk-T52N6ZBP.mjs → chunk-MJDKD2K4.mjs} +1 -1
  92. package/dist/{chunk-T52N6ZBP.mjs.map → chunk-MJDKD2K4.mjs.map} +1 -1
  93. package/dist/{chunk-EDVCMWDT.mjs → chunk-NCEN3XBK.mjs} +1 -1
  94. package/dist/chunk-NCEN3XBK.mjs.map +1 -0
  95. package/dist/{chunk-PTD4AMHI.mjs → chunk-PIU627A3.mjs} +1 -1
  96. package/dist/chunk-PIU627A3.mjs.map +1 -0
  97. package/dist/{chunk-5GHZ6EXI.js → chunk-PKB2G726.js} +1 -1
  98. package/dist/{chunk-5GHZ6EXI.js.map → chunk-PKB2G726.js.map} +1 -1
  99. package/dist/code.d.mts +8 -0
  100. package/dist/code.d.ts +8 -0
  101. package/dist/code.js +15 -0
  102. package/dist/code.js.map +1 -0
  103. package/dist/code.mjs +15 -0
  104. package/dist/code.mjs.map +1 -0
  105. package/dist/collapsible.d.mts +4 -1
  106. package/dist/collapsible.d.ts +4 -1
  107. package/dist/collapsible.js.map +1 -1
  108. package/dist/collapsible.mjs.map +1 -1
  109. package/dist/command.d.mts +29 -18
  110. package/dist/command.d.ts +29 -18
  111. package/dist/command.js +6 -3
  112. package/dist/command.js.map +1 -1
  113. package/dist/command.mjs +5 -2
  114. package/dist/command.mjs.map +1 -1
  115. package/dist/container.d.mts +8 -0
  116. package/dist/container.d.ts +8 -0
  117. package/dist/container.js +19 -0
  118. package/dist/container.js.map +1 -0
  119. package/dist/container.mjs +19 -0
  120. package/dist/container.mjs.map +1 -0
  121. package/dist/context-menu.d.mts +26 -11
  122. package/dist/context-menu.d.ts +26 -11
  123. package/dist/context-menu.js.map +1 -1
  124. package/dist/context-menu.mjs.map +1 -1
  125. package/dist/data-table.d.mts +10 -7
  126. package/dist/data-table.d.ts +10 -7
  127. package/dist/data-table.js +25 -25
  128. package/dist/data-table.js.map +1 -1
  129. package/dist/data-table.mjs +3 -3
  130. package/dist/data-table.mjs.map +1 -1
  131. package/dist/dialog.d.mts +11 -3
  132. package/dist/dialog.d.ts +11 -3
  133. package/dist/dialog.js +2 -2
  134. package/dist/dialog.mjs +1 -1
  135. package/dist/drawer.d.mts +12 -4
  136. package/dist/drawer.d.ts +12 -4
  137. package/dist/drawer.js.map +1 -1
  138. package/dist/drawer.mjs.map +1 -1
  139. package/dist/dropdown-menu.d.mts +25 -11
  140. package/dist/dropdown-menu.d.ts +25 -11
  141. package/dist/dropdown-menu.js +2 -2
  142. package/dist/dropdown-menu.mjs +1 -1
  143. package/dist/em.d.mts +8 -0
  144. package/dist/em.d.ts +8 -0
  145. package/dist/em.js +15 -0
  146. package/dist/em.js.map +1 -0
  147. package/dist/em.mjs +15 -0
  148. package/dist/em.mjs.map +1 -0
  149. package/dist/form.d.mts +14 -6
  150. package/dist/form.d.ts +14 -6
  151. package/dist/form.js +26 -22
  152. package/dist/form.js.map +1 -1
  153. package/dist/form.mjs +25 -21
  154. package/dist/form.mjs.map +1 -1
  155. package/dist/heading.d.mts +9 -0
  156. package/dist/heading.d.ts +9 -0
  157. package/dist/heading.js +15 -0
  158. package/dist/heading.js.map +1 -0
  159. package/dist/heading.mjs +15 -0
  160. package/dist/heading.mjs.map +1 -0
  161. package/dist/hover-card.d.mts +4 -1
  162. package/dist/hover-card.d.ts +4 -1
  163. package/dist/hover-card.js.map +1 -1
  164. package/dist/hover-card.mjs.map +1 -1
  165. package/dist/input-otp.d.mts +12 -32
  166. package/dist/input-otp.d.ts +12 -32
  167. package/dist/input-otp.js +30 -22
  168. package/dist/input-otp.js.map +1 -1
  169. package/dist/input-otp.mjs +29 -21
  170. package/dist/input-otp.mjs.map +1 -1
  171. package/dist/input.d.mts +6 -3
  172. package/dist/input.d.ts +6 -3
  173. package/dist/input.js +13 -11
  174. package/dist/input.js.map +1 -1
  175. package/dist/input.mjs +13 -11
  176. package/dist/input.mjs.map +1 -1
  177. package/dist/kbd.d.mts +8 -0
  178. package/dist/kbd.d.ts +8 -0
  179. package/dist/kbd.js +29 -0
  180. package/dist/kbd.js.map +1 -0
  181. package/dist/kbd.mjs +29 -0
  182. package/dist/kbd.mjs.map +1 -0
  183. package/dist/label.d.mts +2 -1
  184. package/dist/label.d.ts +2 -1
  185. package/dist/label.js +2 -2
  186. package/dist/label.mjs +1 -1
  187. package/dist/menubar.d.mts +27 -12
  188. package/dist/menubar.d.ts +27 -12
  189. package/dist/menubar.js.map +1 -1
  190. package/dist/menubar.mjs.map +1 -1
  191. package/dist/navigation-menu.d.mts +9 -1
  192. package/dist/navigation-menu.d.ts +9 -1
  193. package/dist/navigation-menu.js.map +1 -1
  194. package/dist/navigation-menu.mjs.map +1 -1
  195. package/dist/pagination.d.mts +13 -7
  196. package/dist/pagination.d.ts +13 -7
  197. package/dist/pagination.js +5 -3
  198. package/dist/pagination.js.map +1 -1
  199. package/dist/pagination.mjs +4 -2
  200. package/dist/pagination.mjs.map +1 -1
  201. package/dist/popover.d.mts +6 -1
  202. package/dist/popover.d.ts +6 -1
  203. package/dist/popover.js.map +1 -1
  204. package/dist/popover.mjs.map +1 -1
  205. package/dist/pre.d.mts +8 -0
  206. package/dist/pre.d.ts +8 -0
  207. package/dist/pre.js +15 -0
  208. package/dist/pre.js.map +1 -0
  209. package/dist/pre.mjs +15 -0
  210. package/dist/pre.mjs.map +1 -0
  211. package/dist/progress.d.mts +2 -1
  212. package/dist/progress.d.ts +2 -1
  213. package/dist/progress.js +1 -1
  214. package/dist/progress.js.map +1 -1
  215. package/dist/progress.mjs +1 -1
  216. package/dist/progress.mjs.map +1 -1
  217. package/dist/quote.d.mts +8 -0
  218. package/dist/quote.d.ts +8 -0
  219. package/dist/quote.js +15 -0
  220. package/dist/quote.js.map +1 -0
  221. package/dist/quote.mjs +15 -0
  222. package/dist/quote.mjs.map +1 -0
  223. package/dist/radio-group.d.mts +3 -1
  224. package/dist/radio-group.d.ts +3 -1
  225. package/dist/radio-group.js.map +1 -1
  226. package/dist/radio-group.mjs.map +1 -1
  227. package/dist/resizable.d.mts +4 -4
  228. package/dist/resizable.d.ts +4 -4
  229. package/dist/resizable.js +1 -1
  230. package/dist/resizable.js.map +1 -1
  231. package/dist/resizable.mjs +1 -1
  232. package/dist/resizable.mjs.map +1 -1
  233. package/dist/scroll-area.d.mts +4 -2
  234. package/dist/scroll-area.d.ts +4 -2
  235. package/dist/scroll-area.js +6 -6
  236. package/dist/scroll-area.js.map +1 -1
  237. package/dist/scroll-area.mjs +6 -6
  238. package/dist/scroll-area.mjs.map +1 -1
  239. package/dist/section.d.mts +8 -0
  240. package/dist/section.d.ts +8 -0
  241. package/dist/section.js +15 -0
  242. package/dist/section.js.map +1 -0
  243. package/dist/section.mjs +15 -0
  244. package/dist/section.mjs.map +1 -0
  245. package/dist/select.d.mts +11 -1
  246. package/dist/select.d.ts +11 -1
  247. package/dist/select.js +2 -2
  248. package/dist/select.mjs +1 -1
  249. package/dist/separator.d.mts +2 -1
  250. package/dist/separator.d.ts +2 -1
  251. package/dist/separator.js.map +1 -1
  252. package/dist/separator.mjs.map +1 -1
  253. package/dist/sheet.d.mts +18 -8
  254. package/dist/sheet.d.ts +18 -8
  255. package/dist/sheet.js.map +1 -1
  256. package/dist/sheet.mjs.map +1 -1
  257. package/dist/skeleton.d.mts +3 -2
  258. package/dist/skeleton.d.ts +3 -2
  259. package/dist/skeleton.js +1 -4
  260. package/dist/skeleton.js.map +1 -1
  261. package/dist/skeleton.mjs +1 -4
  262. package/dist/skeleton.mjs.map +1 -1
  263. package/dist/slider.d.mts +2 -1
  264. package/dist/slider.d.ts +2 -1
  265. package/dist/slider.js.map +1 -1
  266. package/dist/slider.mjs.map +1 -1
  267. package/dist/sonner.d.mts +1 -1
  268. package/dist/sonner.d.ts +1 -1
  269. package/dist/sonner.js.map +1 -1
  270. package/dist/sonner.mjs.map +1 -1
  271. package/dist/strong.d.mts +8 -0
  272. package/dist/strong.d.ts +8 -0
  273. package/dist/strong.js +15 -0
  274. package/dist/strong.js.map +1 -0
  275. package/dist/strong.mjs +15 -0
  276. package/dist/strong.mjs.map +1 -0
  277. package/dist/styles.css +1 -1
  278. package/dist/styles.css.map +1 -1
  279. package/dist/switch.d.mts +2 -1
  280. package/dist/switch.d.ts +2 -1
  281. package/dist/switch.js.map +1 -1
  282. package/dist/switch.mjs.map +1 -1
  283. package/dist/table.d.mts +17 -9
  284. package/dist/table.d.ts +17 -9
  285. package/dist/table.js +75 -58
  286. package/dist/table.js.map +1 -1
  287. package/dist/table.mjs +75 -58
  288. package/dist/table.mjs.map +1 -1
  289. package/dist/tabs.d.mts +5 -1
  290. package/dist/tabs.d.ts +5 -1
  291. package/dist/tabs.js.map +1 -1
  292. package/dist/tabs.mjs.map +1 -1
  293. package/dist/text.d.mts +14 -0
  294. package/dist/text.d.ts +14 -0
  295. package/dist/text.js +15 -0
  296. package/dist/text.js.map +1 -0
  297. package/dist/text.mjs +15 -0
  298. package/dist/text.mjs.map +1 -0
  299. package/dist/textarea.d.mts +3 -2
  300. package/dist/textarea.d.ts +3 -2
  301. package/dist/textarea.js +15 -13
  302. package/dist/textarea.js.map +1 -1
  303. package/dist/textarea.mjs +15 -13
  304. package/dist/textarea.mjs.map +1 -1
  305. package/dist/toggle-group.d.mts +4 -2
  306. package/dist/toggle-group.d.ts +4 -2
  307. package/dist/toggle-group.js +2 -2
  308. package/dist/toggle-group.js.map +1 -1
  309. package/dist/toggle-group.mjs +1 -1
  310. package/dist/toggle-group.mjs.map +1 -1
  311. package/dist/toggle.d.mts +2 -1
  312. package/dist/toggle.d.ts +2 -1
  313. package/dist/toggle.js +2 -2
  314. package/dist/toggle.mjs +1 -1
  315. package/dist/tooltip.d.mts +6 -1
  316. package/dist/tooltip.d.ts +6 -1
  317. package/dist/tooltip.js.map +1 -1
  318. package/dist/tooltip.mjs.map +1 -1
  319. package/package.json +67 -7
  320. package/src/accordion.tsx +17 -4
  321. package/src/alert-dialog.tsx +26 -7
  322. package/src/alert.tsx +35 -25
  323. package/src/aspect-ratio.tsx +2 -1
  324. package/src/avatar.tsx +13 -3
  325. package/src/badge.tsx +10 -9
  326. package/src/blockquote.tsx +25 -0
  327. package/src/box.tsx +33 -0
  328. package/src/breadcrumb.tsx +70 -60
  329. package/src/button.tsx +4 -2
  330. package/src/calendar.tsx +3 -2
  331. package/src/card.tsx +59 -52
  332. package/src/carousel.tsx +76 -72
  333. package/src/checkbox.tsx +3 -2
  334. package/src/code.tsx +24 -0
  335. package/src/collapsible.tsx +11 -1
  336. package/src/command.tsx +47 -10
  337. package/src/container.tsx +25 -0
  338. package/src/context-menu.tsx +52 -16
  339. package/src/data-table.tsx +23 -11
  340. package/src/dialog.tsx +21 -5
  341. package/src/drawer.tsx +28 -6
  342. package/src/dropdown-menu.tsx +51 -15
  343. package/src/em.tsx +24 -0
  344. package/src/form.tsx +55 -38
  345. package/src/heading.tsx +25 -0
  346. package/src/hover-card.tsx +12 -2
  347. package/src/input-otp.tsx +45 -33
  348. package/src/input.tsx +17 -15
  349. package/src/kbd.tsx +34 -0
  350. package/src/label.tsx +3 -2
  351. package/src/menubar.tsx +48 -17
  352. package/src/navigation-menu.tsx +25 -5
  353. package/src/pagination.tsx +21 -9
  354. package/src/popover.tsx +18 -2
  355. package/src/pre.tsx +24 -0
  356. package/src/progress.tsx +4 -3
  357. package/src/quote.tsx +24 -0
  358. package/src/radio-group.tsx +10 -3
  359. package/src/resizable.tsx +2 -1
  360. package/src/scroll-area.tsx +18 -11
  361. package/src/section.tsx +24 -0
  362. package/src/select.tsx +27 -7
  363. package/src/separator.tsx +3 -2
  364. package/src/sheet.tsx +23 -5
  365. package/src/skeleton.tsx +3 -5
  366. package/src/slider.tsx +3 -2
  367. package/src/sonner.tsx +1 -1
  368. package/src/strong.tsx +24 -0
  369. package/src/switch.tsx +3 -2
  370. package/src/table.tsx +90 -78
  371. package/src/tabs.tsx +17 -4
  372. package/src/text.tsx +34 -0
  373. package/src/textarea.tsx +16 -16
  374. package/src/toggle-group.tsx +14 -4
  375. package/src/toggle.tsx +3 -2
  376. package/src/tooltip.tsx +12 -2
  377. package/dist/chunk-2D7SRYKN.js.map +0 -1
  378. package/dist/chunk-EDVCMWDT.mjs.map +0 -1
  379. package/dist/chunk-EIHWTXQ4.mjs.map +0 -1
  380. package/dist/chunk-ESWGFN3R.mjs.map +0 -1
  381. package/dist/chunk-KW5FJ62U.mjs.map +0 -1
  382. package/dist/chunk-LDYBRDAY.js.map +0 -1
  383. package/dist/chunk-OCLLX7EY.js.map +0 -1
  384. package/dist/chunk-PTD4AMHI.mjs.map +0 -1
  385. package/dist/chunk-RTKEO347.js.map +0 -1
@@ -1,36 +1,16 @@
1
- import * as input_otp from 'input-otp';
2
- export { REGEXP_ONLY_DIGITS_AND_CHARS } from 'input-otp';
3
1
  import * as React from 'react';
2
+ import { OTPInput } from 'input-otp';
3
+ export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from 'input-otp';
4
4
 
5
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
6
- value?: string | undefined;
7
- onChange?: ((newValue: string) => unknown) | undefined;
8
- maxLength: number;
9
- textAlign?: "center" | "right" | "left" | undefined;
10
- onComplete?: ((...args: any[]) => unknown) | undefined;
11
- pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
12
- containerClassName?: string | undefined;
13
- noScriptCSSFallback?: string | null | undefined;
14
- } & {
15
- render: (props: input_otp.RenderProps) => React.ReactNode;
16
- children?: undefined;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
18
- value?: string | undefined;
19
- onChange?: ((newValue: string) => unknown) | undefined;
20
- maxLength: number;
21
- textAlign?: "center" | "right" | "left" | undefined;
22
- onComplete?: ((...args: any[]) => unknown) | undefined;
23
- pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
24
- containerClassName?: string | undefined;
25
- noScriptCSSFallback?: string | null | undefined;
26
- } & {
27
- render?: undefined;
28
- children: React.ReactNode;
29
- } & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
30
- declare const InputOTPGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
31
- declare const InputOTPSlot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
5
+ type InputOTPProps = React.ComponentPropsWithoutRef<typeof OTPInput>;
6
+ declare const InputOTP: React.ForwardRefExoticComponent<InputOTPProps & React.RefAttributes<HTMLInputElement>>;
7
+ type InputOTPGroupProps = React.HTMLAttributes<HTMLDivElement>;
8
+ declare const InputOTPGroup: React.ForwardRefExoticComponent<InputOTPGroupProps & React.RefAttributes<HTMLDivElement>>;
9
+ interface InputOTPSlotProps extends React.HTMLAttributes<HTMLDivElement> {
32
10
  index: number;
33
- } & React.RefAttributes<HTMLDivElement>>;
34
- declare const InputOTPSeparator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
11
+ }
12
+ declare const InputOTPSlot: React.ForwardRefExoticComponent<InputOTPSlotProps & React.RefAttributes<HTMLDivElement>>;
13
+ type InputOTPSeparatorProps = React.HTMLAttributes<HTMLDivElement>;
14
+ declare const InputOTPSeparator: React.ForwardRefExoticComponent<InputOTPSeparatorProps & React.RefAttributes<HTMLDivElement>>;
35
15
 
36
- export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
16
+ export { InputOTP, InputOTPGroup, type InputOTPGroupProps, type InputOTPProps, InputOTPSeparator, type InputOTPSeparatorProps, InputOTPSlot, type InputOTPSlotProps };
@@ -1,36 +1,16 @@
1
- import * as input_otp from 'input-otp';
2
- export { REGEXP_ONLY_DIGITS_AND_CHARS } from 'input-otp';
3
1
  import * as React from 'react';
2
+ import { OTPInput } from 'input-otp';
3
+ export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from 'input-otp';
4
4
 
5
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
6
- value?: string | undefined;
7
- onChange?: ((newValue: string) => unknown) | undefined;
8
- maxLength: number;
9
- textAlign?: "center" | "right" | "left" | undefined;
10
- onComplete?: ((...args: any[]) => unknown) | undefined;
11
- pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
12
- containerClassName?: string | undefined;
13
- noScriptCSSFallback?: string | null | undefined;
14
- } & {
15
- render: (props: input_otp.RenderProps) => React.ReactNode;
16
- children?: undefined;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
18
- value?: string | undefined;
19
- onChange?: ((newValue: string) => unknown) | undefined;
20
- maxLength: number;
21
- textAlign?: "center" | "right" | "left" | undefined;
22
- onComplete?: ((...args: any[]) => unknown) | undefined;
23
- pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
24
- containerClassName?: string | undefined;
25
- noScriptCSSFallback?: string | null | undefined;
26
- } & {
27
- render?: undefined;
28
- children: React.ReactNode;
29
- } & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
30
- declare const InputOTPGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
31
- declare const InputOTPSlot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
5
+ type InputOTPProps = React.ComponentPropsWithoutRef<typeof OTPInput>;
6
+ declare const InputOTP: React.ForwardRefExoticComponent<InputOTPProps & React.RefAttributes<HTMLInputElement>>;
7
+ type InputOTPGroupProps = React.HTMLAttributes<HTMLDivElement>;
8
+ declare const InputOTPGroup: React.ForwardRefExoticComponent<InputOTPGroupProps & React.RefAttributes<HTMLDivElement>>;
9
+ interface InputOTPSlotProps extends React.HTMLAttributes<HTMLDivElement> {
32
10
  index: number;
33
- } & React.RefAttributes<HTMLDivElement>>;
34
- declare const InputOTPSeparator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
11
+ }
12
+ declare const InputOTPSlot: React.ForwardRefExoticComponent<InputOTPSlotProps & React.RefAttributes<HTMLDivElement>>;
13
+ type InputOTPSeparatorProps = React.HTMLAttributes<HTMLDivElement>;
14
+ declare const InputOTPSeparator: React.ForwardRefExoticComponent<InputOTPSeparatorProps & React.RefAttributes<HTMLDivElement>>;
35
15
 
36
- export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
16
+ export { InputOTP, InputOTPGroup, type InputOTPGroupProps, type InputOTPProps, InputOTPSeparator, type InputOTPSeparatorProps, InputOTPSlot, type InputOTPSlotProps };
package/dist/input-otp.js CHANGED
@@ -10,6 +10,8 @@ var _reacticons = require('@radix-ui/react-icons');
10
10
 
11
11
 
12
12
 
13
+
14
+
13
15
  var _inputotp = require('input-otp');
14
16
  var _jsxruntime = require('react/jsx-runtime');
15
17
  var InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -25,28 +27,32 @@ var InputOTP = React.forwardRef(({ className, containerClassName, ...props }, re
25
27
  }
26
28
  ));
27
29
  InputOTP.displayName = "InputOTP";
28
- var InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, "flex items-center", className), ...props }));
30
+ var InputOTPGroup = React.forwardRef(
31
+ ({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, "flex items-center", className), ...props })
32
+ );
29
33
  InputOTPGroup.displayName = "InputOTPGroup";
30
- var InputOTPSlot = React.forwardRef(({ index, className, ...props }, ref) => {
31
- const inputOTPContext = React.useContext(_inputotp.OTPInputContext);
32
- const slot = inputOTPContext.slots[index];
33
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
34
- "div",
35
- {
36
- ref,
37
- className: _chunkG3NP7M2Njs.cn.call(void 0,
38
- "border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
39
- _optionalChain([slot, 'optionalAccess', _ => _.isActive]) && "ring-ring z-10 ring-2",
40
- className
41
- ),
42
- ...props,
43
- children: [
44
- _optionalChain([slot, 'optionalAccess', _2 => _2.char]),
45
- _optionalChain([slot, 'optionalAccess', _3 => _3.hasFakeCaret]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) }) : null
46
- ]
47
- }
48
- );
49
- });
34
+ var InputOTPSlot = React.forwardRef(
35
+ ({ index, className, ...props }, ref) => {
36
+ const inputOTPContext = React.useContext(_inputotp.OTPInputContext);
37
+ const slot = inputOTPContext.slots[index];
38
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
39
+ "div",
40
+ {
41
+ ref,
42
+ className: _chunkG3NP7M2Njs.cn.call(void 0,
43
+ "border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
44
+ _optionalChain([slot, 'optionalAccess', _ => _.isActive]) && "ring-ring z-10 ring-2",
45
+ className
46
+ ),
47
+ ...props,
48
+ children: [
49
+ _optionalChain([slot, 'optionalAccess', _2 => _2.char]),
50
+ _optionalChain([slot, 'optionalAccess', _3 => _3.hasFakeCaret]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) }) : null
51
+ ]
52
+ }
53
+ );
54
+ }
55
+ );
50
56
  InputOTPSlot.displayName = "InputOTPSlot";
51
57
  var InputOTPSeparator = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, role: "separator", ...props, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.DotFilledIcon, {}) }));
52
58
  InputOTPSeparator.displayName = "InputOTPSeparator";
@@ -56,5 +62,7 @@ InputOTPSeparator.displayName = "InputOTPSeparator";
56
62
 
57
63
 
58
64
 
59
- exports.InputOTP = InputOTP; exports.InputOTPGroup = InputOTPGroup; exports.InputOTPSeparator = InputOTPSeparator; exports.InputOTPSlot = InputOTPSlot; exports.REGEXP_ONLY_DIGITS_AND_CHARS = _inputotp.REGEXP_ONLY_DIGITS_AND_CHARS;
65
+
66
+
67
+ exports.InputOTP = InputOTP; exports.InputOTPGroup = InputOTPGroup; exports.InputOTPSeparator = InputOTPSeparator; exports.InputOTPSlot = InputOTPSlot; exports.REGEXP_ONLY_CHARS = _inputotp.REGEXP_ONLY_CHARS; exports.REGEXP_ONLY_DIGITS = _inputotp.REGEXP_ONLY_DIGITS; exports.REGEXP_ONLY_DIGITS_AND_CHARS = _inputotp.REGEXP_ONLY_DIGITS_AND_CHARS;
60
68
  //# sourceMappingURL=input-otp.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/input-otp.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAWL,cAoCE,YApCF;AAJF,IAAM,WAAiB,iBAGrB,CAAC,EAAE,WAAW,oBAAoB,GAAG,MAAM,GAAG,QAC9C;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;AAMvB,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAC,SAAI,KAAU,WAAW,GAAG,qBAAqB,SAAS,GAAI,GAAG,OAAO,CAC1E;AACD,cAAc,cAAc;AAM5B,IAAM,eAAqB,iBAGzB,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AACzC,QAAM,kBAAwB,iBAAW,eAAe;AACxD,QAAM,OAAO,gBAAgB,MAAM,KAAK;AAExC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,MAAM,YAAY;AAAA,QAClB;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,cAAM;AAAA,QACN,MAAM,eACL,oBAAC,SAAI,WAAU,yEACb,8BAAC,SAAI,WAAU,4DAA2D,GAC5E,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,aAAa,cAAc;AAM3B,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,GAAG,MAAM,GAAG,QACf,oBAAC,SAAI,KAAU,MAAK,aAAa,GAAG,OAClC,8BAAC,iBAAc,GACjB,CACD;AACD,kBAAkB,cAAc","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { DotFilledIcon } from \"@radix-ui/react-icons\";\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n} from \"input-otp\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOtp\n * -------------------------------------------------------------------------- */\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n));\nInputOTP.displayName = \"InputOTP\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPGroup\n * -------------------------------------------------------------------------- */\n\nconst InputOTPGroup = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n));\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSlot\n * -------------------------------------------------------------------------- */\n\nconst InputOTPSlot = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const slot = inputOTPContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md\",\n slot?.isActive && \"ring-ring z-10 ring-2\",\n className,\n )}\n {...props}\n >\n {slot?.char}\n {slot?.hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n ) : null}\n </div>\n );\n});\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSeparator\n * -------------------------------------------------------------------------- */\n\nconst InputOTPSeparator = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <DotFilledIcon />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n};\n"]}
1
+ {"version":3,"sources":["../src/input-otp.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYL,cAqCI,YArCJ;AAJF,IAAM,WAAiB,iBAGrB,CAAC,EAAE,WAAW,oBAAoB,GAAG,MAAM,GAAG,QAC9C;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;AAOvB,IAAM,gBAAsB;AAAA,EAC1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,SAAI,KAAU,WAAW,GAAG,qBAAqB,SAAS,GAAI,GAAG,OAAO;AAE7E;AACA,cAAc,cAAc;AAS5B,IAAM,eAAqB;AAAA,EACzB,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AACvC,UAAM,kBAAwB,iBAAW,eAAe;AACxD,UAAM,OAAO,gBAAgB,MAAM,KAAK;AAExC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,MAAM,YAAY;AAAA,UAClB;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,gBAAM;AAAA,UACN,MAAM,eACL,oBAAC,SAAI,WAAU,yEACb,8BAAC,SAAI,WAAU,4DAA2D,GAC5E,IACE;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAO3B,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,GAAG,MAAM,GAAG,QACf,oBAAC,SAAI,KAAU,MAAK,aAAa,GAAG,OAClC,8BAAC,iBAAc,GACjB,CACD;AACD,kBAAkB,cAAc","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { DotFilledIcon } from \"@radix-ui/react-icons\";\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n} from \"input-otp\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOtp\n * -------------------------------------------------------------------------- */\n\ntype InputOTPProps = React.ComponentPropsWithoutRef<typeof OTPInput>;\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n InputOTPProps\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n));\nInputOTP.displayName = \"InputOTP\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPGroup\n * -------------------------------------------------------------------------- */\n\ntype InputOTPGroupProps = React.HTMLAttributes<HTMLDivElement>;\nconst InputOTPGroup = React.forwardRef<HTMLDivElement, InputOTPGroupProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n ),\n);\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSlot\n * -------------------------------------------------------------------------- */\n\ninterface InputOTPSlotProps extends React.HTMLAttributes<HTMLDivElement> {\n index: number;\n}\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>(\n ({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const slot = inputOTPContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md\",\n slot?.isActive && \"ring-ring z-10 ring-2\",\n className,\n )}\n {...props}\n >\n {slot?.char}\n {slot?.hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n ) : null}\n </div>\n );\n },\n);\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSeparator\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSeparatorProps = React.HTMLAttributes<HTMLDivElement>;\nconst InputOTPSeparator = React.forwardRef<\n HTMLDivElement,\n InputOTPSeparatorProps\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <DotFilledIcon />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n type InputOTPProps,\n type InputOTPGroupProps,\n type InputOTPSlotProps,\n type InputOTPSeparatorProps,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n};\n"]}
@@ -9,6 +9,8 @@ import { DotFilledIcon } from "@radix-ui/react-icons";
9
9
  import {
10
10
  OTPInput,
11
11
  OTPInputContext,
12
+ REGEXP_ONLY_CHARS,
13
+ REGEXP_ONLY_DIGITS,
12
14
  REGEXP_ONLY_DIGITS_AND_CHARS
13
15
  } from "input-otp";
14
16
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -25,28 +27,32 @@ var InputOTP = React.forwardRef(({ className, containerClassName, ...props }, re
25
27
  }
26
28
  ));
27
29
  InputOTP.displayName = "InputOTP";
28
- var InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center", className), ...props }));
30
+ var InputOTPGroup = React.forwardRef(
31
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center", className), ...props })
32
+ );
29
33
  InputOTPGroup.displayName = "InputOTPGroup";
30
- var InputOTPSlot = React.forwardRef(({ index, className, ...props }, ref) => {
31
- const inputOTPContext = React.useContext(OTPInputContext);
32
- const slot = inputOTPContext.slots[index];
33
- return /* @__PURE__ */ jsxs(
34
- "div",
35
- {
36
- ref,
37
- className: cn(
38
- "border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
39
- slot?.isActive && "ring-ring z-10 ring-2",
40
- className
41
- ),
42
- ...props,
43
- children: [
44
- slot?.char,
45
- slot?.hasFakeCaret ? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) }) : null
46
- ]
47
- }
48
- );
49
- });
34
+ var InputOTPSlot = React.forwardRef(
35
+ ({ index, className, ...props }, ref) => {
36
+ const inputOTPContext = React.useContext(OTPInputContext);
37
+ const slot = inputOTPContext.slots[index];
38
+ return /* @__PURE__ */ jsxs(
39
+ "div",
40
+ {
41
+ ref,
42
+ className: cn(
43
+ "border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
44
+ slot?.isActive && "ring-ring z-10 ring-2",
45
+ className
46
+ ),
47
+ ...props,
48
+ children: [
49
+ slot?.char,
50
+ slot?.hasFakeCaret ? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) }) : null
51
+ ]
52
+ }
53
+ );
54
+ }
55
+ );
50
56
  InputOTPSlot.displayName = "InputOTPSlot";
51
57
  var InputOTPSeparator = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx(DotFilledIcon, {}) }));
52
58
  InputOTPSeparator.displayName = "InputOTPSeparator";
@@ -55,6 +61,8 @@ export {
55
61
  InputOTPGroup,
56
62
  InputOTPSeparator,
57
63
  InputOTPSlot,
64
+ REGEXP_ONLY_CHARS,
65
+ REGEXP_ONLY_DIGITS,
58
66
  REGEXP_ONLY_DIGITS_AND_CHARS
59
67
  };
60
68
  //# sourceMappingURL=input-otp.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/input-otp.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { DotFilledIcon } from \"@radix-ui/react-icons\";\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n} from \"input-otp\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOtp\n * -------------------------------------------------------------------------- */\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n));\nInputOTP.displayName = \"InputOTP\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPGroup\n * -------------------------------------------------------------------------- */\n\nconst InputOTPGroup = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n));\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSlot\n * -------------------------------------------------------------------------- */\n\nconst InputOTPSlot = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const slot = inputOTPContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md\",\n slot?.isActive && \"ring-ring z-10 ring-2\",\n className,\n )}\n {...props}\n >\n {slot?.char}\n {slot?.hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n ) : null}\n </div>\n );\n});\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSeparator\n * -------------------------------------------------------------------------- */\n\nconst InputOTPSeparator = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <DotFilledIcon />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAWL,cAoCE,YApCF;AAJF,IAAM,WAAiB,iBAGrB,CAAC,EAAE,WAAW,oBAAoB,GAAG,MAAM,GAAG,QAC9C;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;AAMvB,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAC,SAAI,KAAU,WAAW,GAAG,qBAAqB,SAAS,GAAI,GAAG,OAAO,CAC1E;AACD,cAAc,cAAc;AAM5B,IAAM,eAAqB,iBAGzB,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AACzC,QAAM,kBAAwB,iBAAW,eAAe;AACxD,QAAM,OAAO,gBAAgB,MAAM,KAAK;AAExC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,MAAM,YAAY;AAAA,QAClB;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,cAAM;AAAA,QACN,MAAM,eACL,oBAAC,SAAI,WAAU,yEACb,8BAAC,SAAI,WAAU,4DAA2D,GAC5E,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,aAAa,cAAc;AAM3B,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,GAAG,MAAM,GAAG,QACf,oBAAC,SAAI,KAAU,MAAK,aAAa,GAAG,OAClC,8BAAC,iBAAc,GACjB,CACD;AACD,kBAAkB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/input-otp.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { DotFilledIcon } from \"@radix-ui/react-icons\";\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n} from \"input-otp\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOtp\n * -------------------------------------------------------------------------- */\n\ntype InputOTPProps = React.ComponentPropsWithoutRef<typeof OTPInput>;\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n InputOTPProps\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n));\nInputOTP.displayName = \"InputOTP\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPGroup\n * -------------------------------------------------------------------------- */\n\ntype InputOTPGroupProps = React.HTMLAttributes<HTMLDivElement>;\nconst InputOTPGroup = React.forwardRef<HTMLDivElement, InputOTPGroupProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n ),\n);\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSlot\n * -------------------------------------------------------------------------- */\n\ninterface InputOTPSlotProps extends React.HTMLAttributes<HTMLDivElement> {\n index: number;\n}\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>(\n ({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const slot = inputOTPContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md\",\n slot?.isActive && \"ring-ring z-10 ring-2\",\n className,\n )}\n {...props}\n >\n {slot?.char}\n {slot?.hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n ) : null}\n </div>\n );\n },\n);\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSeparator\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSeparatorProps = React.HTMLAttributes<HTMLDivElement>;\nconst InputOTPSeparator = React.forwardRef<\n HTMLDivElement,\n InputOTPSeparatorProps\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <DotFilledIcon />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n type InputOTPProps,\n type InputOTPGroupProps,\n type InputOTPSlotProps,\n type InputOTPSeparatorProps,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYL,cAqCI,YArCJ;AAJF,IAAM,WAAiB,iBAGrB,CAAC,EAAE,WAAW,oBAAoB,GAAG,MAAM,GAAG,QAC9C;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;AAOvB,IAAM,gBAAsB;AAAA,EAC1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,SAAI,KAAU,WAAW,GAAG,qBAAqB,SAAS,GAAI,GAAG,OAAO;AAE7E;AACA,cAAc,cAAc;AAS5B,IAAM,eAAqB;AAAA,EACzB,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AACvC,UAAM,kBAAwB,iBAAW,eAAe;AACxD,UAAM,OAAO,gBAAgB,MAAM,KAAK;AAExC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,MAAM,YAAY;AAAA,UAClB;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,gBAAM;AAAA,UACN,MAAM,eACL,oBAAC,SAAI,WAAU,yEACb,8BAAC,SAAI,WAAU,4DAA2D,GAC5E,IACE;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAO3B,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,GAAG,MAAM,GAAG,QACf,oBAAC,SAAI,KAAU,MAAK,aAAa,GAAG,OAClC,8BAAC,iBAAc,GACjB,CACD;AACD,kBAAkB,cAAc;","names":[]}
package/dist/input.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { VariantProps } from 'cva';
3
3
 
4
- declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & VariantProps<(props?: ({
4
+ declare const inputVariants: (props?: ({
5
5
  inputSize?: "default" | "xs" | "sm" | "lg" | undefined;
6
6
  } & ({
7
7
  class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
@@ -57,6 +57,9 @@ declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttribu
57
57
  } | null | undefined)[] | {
58
58
  [x: string]: any;
59
59
  } | null | undefined;
60
- })) | undefined) => string> & React.RefAttributes<HTMLInputElement>>;
60
+ })) | undefined) => string;
61
+ type InputVariantsProps = VariantProps<typeof inputVariants>;
62
+ type InputProps = React.InputHTMLAttributes<HTMLInputElement> & InputVariantsProps;
63
+ declare const Input: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & InputVariantsProps & React.RefAttributes<HTMLInputElement>>;
61
64
 
62
- export { Input };
65
+ export { Input, type InputProps };
package/dist/input.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { VariantProps } from 'cva';
3
3
 
4
- declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & VariantProps<(props?: ({
4
+ declare const inputVariants: (props?: ({
5
5
  inputSize?: "default" | "xs" | "sm" | "lg" | undefined;
6
6
  } & ({
7
7
  class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
@@ -57,6 +57,9 @@ declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttribu
57
57
  } | null | undefined)[] | {
58
58
  [x: string]: any;
59
59
  } | null | undefined;
60
- })) | undefined) => string> & React.RefAttributes<HTMLInputElement>>;
60
+ })) | undefined) => string;
61
+ type InputVariantsProps = VariantProps<typeof inputVariants>;
62
+ type InputProps = React.InputHTMLAttributes<HTMLInputElement> & InputVariantsProps;
63
+ declare const Input: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & InputVariantsProps & React.RefAttributes<HTMLInputElement>>;
61
64
 
62
- export { Input };
65
+ export { Input, type InputProps };
package/dist/input.js CHANGED
@@ -19,17 +19,19 @@ var inputVariants = _chunkG3NP7M2Njs.cva.call(void 0, {
19
19
  inputSize: "default"
20
20
  }
21
21
  });
22
- var Input = React.forwardRef(({ className, inputSize, ...props }, ref) => {
23
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
24
- "input",
25
- {
26
- type: "text",
27
- className: inputVariants({ className, inputSize }),
28
- ref,
29
- ...props
30
- }
31
- );
32
- });
22
+ var Input = React.forwardRef(
23
+ ({ className, inputSize, ...props }, ref) => {
24
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
25
+ "input",
26
+ {
27
+ type: "text",
28
+ className: inputVariants({ className, inputSize }),
29
+ ref,
30
+ ...props
31
+ }
32
+ );
33
+ }
34
+ );
33
35
  Input.displayName = "Input";
34
36
 
35
37
 
package/dist/input.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/input.tsx"],"names":[],"mappings":";;;;;AAAA,YAAY,WAAW;AAiCnB;AAzBJ,IAAM,gBAAgB,IAAI;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,WAAW;AAAA,MACT,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,WAAW;AAAA,EACb;AACF,CAAC;AAMD,IAAM,QAAc,iBAIlB,CAAC,EAAE,WAAW,WAAW,GAAG,MAAM,GAAG,QAAQ;AAC7C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,cAAc,EAAE,WAAW,UAAU,CAAC;AAAA,MACjD;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,MAAM,cAAc","sourcesContent":["import * as React from \"react\";\nimport { type VariantProps } from \"cva\";\nimport { cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: Input\n * -------------------------------------------------------------------------- */\n\nconst inputVariants = cva({\n base: \"border-input focus-visible:ring-ring focus-visible:ring-offset-background placeholder:text-muted-foreground flex w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n variants: {\n inputSize: {\n default: \"h-10\",\n xs: \"h-8\",\n sm: \"h-9\",\n lg: \"h-11\",\n },\n },\n defaultVariants: {\n inputSize: \"default\",\n },\n});\n\n/* -----------------------------------------------------------------------------\n * Component: Input\n * -------------------------------------------------------------------------- */\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\"> &\n VariantProps<typeof inputVariants>\n>(({ className, inputSize, ...props }, ref) => {\n return (\n <input\n type=\"text\"\n className={inputVariants({ className, inputSize })}\n ref={ref}\n {...props}\n />\n );\n});\nInput.displayName = \"Input\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Input };\n"]}
1
+ {"version":3,"sources":["../src/input.tsx"],"names":[],"mappings":";;;;;AAAA,YAAY,WAAW;AAkCjB;AA1BN,IAAM,gBAAgB,IAAI;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,WAAW;AAAA,MACT,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,WAAW;AAAA,EACb;AACF,CAAC;AAUD,IAAM,QAAc;AAAA,EAClB,CAAC,EAAE,WAAW,WAAW,GAAG,MAAM,GAAG,QAAQ;AAC3C,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAW,cAAc,EAAE,WAAW,UAAU,CAAC;AAAA,QACjD;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,MAAM,cAAc","sourcesContent":["import * as React from \"react\";\nimport { type VariantProps } from \"cva\";\nimport { cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: Input\n * -------------------------------------------------------------------------- */\n\nconst inputVariants = cva({\n base: \"border-input focus-visible:ring-ring focus-visible:ring-offset-background placeholder:text-muted-foreground flex w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n variants: {\n inputSize: {\n default: \"h-10\",\n xs: \"h-8\",\n sm: \"h-9\",\n lg: \"h-11\",\n },\n },\n defaultVariants: {\n inputSize: \"default\",\n },\n});\n\ntype InputVariantsProps = VariantProps<typeof inputVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Input\n * -------------------------------------------------------------------------- */\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> &\n InputVariantsProps;\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, inputSize, ...props }, ref) => {\n return (\n <input\n type=\"text\"\n className={inputVariants({ className, inputSize })}\n ref={ref}\n {...props}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Input, type InputProps };\n"]}
package/dist/input.mjs CHANGED
@@ -19,17 +19,19 @@ var inputVariants = cva({
19
19
  inputSize: "default"
20
20
  }
21
21
  });
22
- var Input = React.forwardRef(({ className, inputSize, ...props }, ref) => {
23
- return /* @__PURE__ */ jsx(
24
- "input",
25
- {
26
- type: "text",
27
- className: inputVariants({ className, inputSize }),
28
- ref,
29
- ...props
30
- }
31
- );
32
- });
22
+ var Input = React.forwardRef(
23
+ ({ className, inputSize, ...props }, ref) => {
24
+ return /* @__PURE__ */ jsx(
25
+ "input",
26
+ {
27
+ type: "text",
28
+ className: inputVariants({ className, inputSize }),
29
+ ref,
30
+ ...props
31
+ }
32
+ );
33
+ }
34
+ );
33
35
  Input.displayName = "Input";
34
36
  export {
35
37
  Input
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/input.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { type VariantProps } from \"cva\";\nimport { cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: Input\n * -------------------------------------------------------------------------- */\n\nconst inputVariants = cva({\n base: \"border-input focus-visible:ring-ring focus-visible:ring-offset-background placeholder:text-muted-foreground flex w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n variants: {\n inputSize: {\n default: \"h-10\",\n xs: \"h-8\",\n sm: \"h-9\",\n lg: \"h-11\",\n },\n },\n defaultVariants: {\n inputSize: \"default\",\n },\n});\n\n/* -----------------------------------------------------------------------------\n * Component: Input\n * -------------------------------------------------------------------------- */\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\"> &\n VariantProps<typeof inputVariants>\n>(({ className, inputSize, ...props }, ref) => {\n return (\n <input\n type=\"text\"\n className={inputVariants({ className, inputSize })}\n ref={ref}\n {...props}\n />\n );\n});\nInput.displayName = \"Input\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Input };\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AAiCnB;AAzBJ,IAAM,gBAAgB,IAAI;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,WAAW;AAAA,MACT,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,WAAW;AAAA,EACb;AACF,CAAC;AAMD,IAAM,QAAc,iBAIlB,CAAC,EAAE,WAAW,WAAW,GAAG,MAAM,GAAG,QAAQ;AAC7C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,cAAc,EAAE,WAAW,UAAU,CAAC;AAAA,MACjD;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,MAAM,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/input.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { type VariantProps } from \"cva\";\nimport { cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: Input\n * -------------------------------------------------------------------------- */\n\nconst inputVariants = cva({\n base: \"border-input focus-visible:ring-ring focus-visible:ring-offset-background placeholder:text-muted-foreground flex w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n variants: {\n inputSize: {\n default: \"h-10\",\n xs: \"h-8\",\n sm: \"h-9\",\n lg: \"h-11\",\n },\n },\n defaultVariants: {\n inputSize: \"default\",\n },\n});\n\ntype InputVariantsProps = VariantProps<typeof inputVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Input\n * -------------------------------------------------------------------------- */\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> &\n InputVariantsProps;\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, inputSize, ...props }, ref) => {\n return (\n <input\n type=\"text\"\n className={inputVariants({ className, inputSize })}\n ref={ref}\n {...props}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Input, type InputProps };\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AAkCjB;AA1BN,IAAM,gBAAgB,IAAI;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,WAAW;AAAA,MACT,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,WAAW;AAAA,EACb;AACF,CAAC;AAUD,IAAM,QAAc;AAAA,EAClB,CAAC,EAAE,WAAW,WAAW,GAAG,MAAM,GAAG,QAAQ;AAC3C,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAW,cAAc,EAAE,WAAW,UAAU,CAAC;AAAA,QACjD;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
package/dist/kbd.d.mts ADDED
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+
3
+ interface KbdProps extends React.HTMLAttributes<HTMLElement> {
4
+ asChild?: boolean;
5
+ }
6
+ declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
7
+
8
+ export { Kbd, type KbdProps };
package/dist/kbd.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+
3
+ interface KbdProps extends React.HTMLAttributes<HTMLElement> {
4
+ asChild?: boolean;
5
+ }
6
+ declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
7
+
8
+ export { Kbd, type KbdProps };
package/dist/kbd.js ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
2
+
3
+ var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
4
+
5
+ // src/kbd.tsx
6
+ var _react = require('react'); var React = _interopRequireWildcard(_react);
7
+ var _reactslot = require('@radix-ui/react-slot');
8
+ var _jsxruntime = require('react/jsx-runtime');
9
+ var Kbd = React.forwardRef(
10
+ ({ asChild, className, ...props }, ref) => {
11
+ const Comp = asChild ? _reactslot.Slot : "kbd";
12
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
13
+ Comp,
14
+ {
15
+ ref,
16
+ className: _chunkG3NP7M2Njs.cn.call(void 0,
17
+ "bg-muted text-muted-foreground inline-flex h-5 select-none items-center gap-1 rounded border px-1.5 font-mono text-xs font-medium",
18
+ className
19
+ ),
20
+ ...props
21
+ }
22
+ );
23
+ }
24
+ );
25
+ Kbd.displayName = "Kbd";
26
+
27
+
28
+ exports.Kbd = Kbd;
29
+ //# sourceMappingURL=kbd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/kbd.tsx"],"names":[],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAef;AALN,IAAM,MAAY;AAAA,EAChB,CAAC,EAAE,SAAS,WAAW,GAAG,MAAM,GAAG,QAAQ;AACzC,UAAM,OAAO,UAAU,OAAO;AAE9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,IAAI,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Kbd\n * -------------------------------------------------------------------------- */\n\ninterface KbdProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\nconst Kbd = React.forwardRef<HTMLElement, KbdProps>(\n ({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"kbd\";\n\n return (\n <Comp\n ref={ref}\n className={cn(\n \"bg-muted text-muted-foreground inline-flex h-5 select-none items-center gap-1 rounded border px-1.5 font-mono text-xs font-medium\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nKbd.displayName = \"Kbd\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Kbd, type KbdProps };\n"]}
package/dist/kbd.mjs ADDED
@@ -0,0 +1,29 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-UG3URV2Z.mjs";
4
+
5
+ // src/kbd.tsx
6
+ import * as React from "react";
7
+ import { Slot } from "@radix-ui/react-slot";
8
+ import { jsx } from "react/jsx-runtime";
9
+ var Kbd = React.forwardRef(
10
+ ({ asChild, className, ...props }, ref) => {
11
+ const Comp = asChild ? Slot : "kbd";
12
+ return /* @__PURE__ */ jsx(
13
+ Comp,
14
+ {
15
+ ref,
16
+ className: cn(
17
+ "bg-muted text-muted-foreground inline-flex h-5 select-none items-center gap-1 rounded border px-1.5 font-mono text-xs font-medium",
18
+ className
19
+ ),
20
+ ...props
21
+ }
22
+ );
23
+ }
24
+ );
25
+ Kbd.displayName = "Kbd";
26
+ export {
27
+ Kbd
28
+ };
29
+ //# sourceMappingURL=kbd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/kbd.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Kbd\n * -------------------------------------------------------------------------- */\n\ninterface KbdProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\nconst Kbd = React.forwardRef<HTMLElement, KbdProps>(\n ({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"kbd\";\n\n return (\n <Comp\n ref={ref}\n className={cn(\n \"bg-muted text-muted-foreground inline-flex h-5 select-none items-center gap-1 rounded border px-1.5 font-mono text-xs font-medium\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nKbd.displayName = \"Kbd\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Kbd, type KbdProps };\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAef;AALN,IAAM,MAAY;AAAA,EAChB,CAAC,EAAE,SAAS,WAAW,GAAG,MAAM,GAAG,QAAQ;AACzC,UAAM,OAAO,UAAU,OAAO;AAE9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,IAAI,cAAc;","names":[]}
package/dist/label.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import * as LabelPrimitive from '@radix-ui/react-label';
3
3
 
4
+ type LabelProps = LabelPrimitive.LabelProps;
4
5
  declare const Label: React.ForwardRefExoticComponent<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>>;
5
6
 
6
- export { Label };
7
+ export { Label, type LabelProps };
package/dist/label.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import * as LabelPrimitive from '@radix-ui/react-label';
3
3
 
4
+ type LabelProps = LabelPrimitive.LabelProps;
4
5
  declare const Label: React.ForwardRefExoticComponent<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>>;
5
6
 
6
- export { Label };
7
+ export { Label, type LabelProps };
package/dist/label.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _chunkRTKEO347js = require('./chunk-RTKEO347.js');
4
+ var _chunkGRKABVK4js = require('./chunk-GRKABVK4.js');
5
5
  require('./chunk-G3NP7M2N.js');
6
6
 
7
7
 
8
- exports.Label = _chunkRTKEO347js.Label;
8
+ exports.Label = _chunkGRKABVK4js.Label;
9
9
  //# sourceMappingURL=label.js.map
package/dist/label.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Label
4
- } from "./chunk-PTD4AMHI.mjs";
4
+ } from "./chunk-PIU627A3.mjs";
5
5
  import "./chunk-UG3URV2Z.mjs";
6
6
  export {
7
7
  Label