erp-pro-ui 0.1.8 → 0.2.0

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 (309) hide show
  1. package/README.md +94 -0
  2. package/dist/ascii-text.cjs +1 -1
  3. package/dist/ascii-text.mjs +1 -1
  4. package/dist/background-gradient-animation.cjs +1 -1
  5. package/dist/background-gradient-animation.mjs +1 -1
  6. package/dist/button-hover-border-gradient.cjs +1 -1
  7. package/dist/button-hover-border-gradient.mjs +1 -1
  8. package/dist/button.cjs +1 -1
  9. package/dist/button.mjs +1 -1
  10. package/dist/calendar.cjs +1 -1
  11. package/dist/calendar.mjs +1 -1
  12. package/dist/carousel.cjs +1 -1
  13. package/dist/carousel.mjs +1 -1
  14. package/dist/charts.cjs +1 -1
  15. package/dist/charts.mjs +1 -1
  16. package/dist/chip.cjs +1 -1
  17. package/dist/chip.mjs +1 -1
  18. package/dist/chroma-grid.cjs +1 -1
  19. package/dist/chroma-grid.mjs +1 -1
  20. package/dist/chunks/{DropdownMenu-DOvo5pV_.cjs → DropdownMenu-BDrNYO-D.cjs} +6 -5
  21. package/dist/chunks/DropdownMenu-BDrNYO-D.cjs.map +1 -0
  22. package/dist/chunks/{DropdownMenu-C17Zqu_E.mjs → DropdownMenu-BtTOri-A.mjs} +6 -5
  23. package/dist/chunks/DropdownMenu-BtTOri-A.mjs.map +1 -0
  24. package/dist/chunks/{HoverBorderGradient-C5D6lGg0.cjs → HoverBorderGradient-9pfvBoHR.cjs} +2 -2
  25. package/dist/chunks/{HoverBorderGradient-C5D6lGg0.cjs.map → HoverBorderGradient-9pfvBoHR.cjs.map} +1 -1
  26. package/dist/chunks/{HoverBorderGradient-CduqqQgX.mjs → HoverBorderGradient-NbdXeLgC.mjs} +2 -2
  27. package/dist/chunks/{HoverBorderGradient-CduqqQgX.mjs.map → HoverBorderGradient-NbdXeLgC.mjs.map} +1 -1
  28. package/dist/chunks/SunToMoonButton-BkEfkElJ.mjs.map +1 -1
  29. package/dist/chunks/SunToMoonButton-jS4BJD9q.cjs.map +1 -1
  30. package/dist/chunks/{tooltip-PJaQa8_l.cjs → Tooltip-DD30yj3A.cjs} +1 -1
  31. package/dist/chunks/{tooltip-PJaQa8_l.cjs.map → Tooltip-DD30yj3A.cjs.map} +1 -1
  32. package/dist/chunks/{tooltip-CmB8xKOF.mjs → Tooltip-DK3B879v.mjs} +1 -1
  33. package/dist/chunks/{tooltip-CmB8xKOF.mjs.map → Tooltip-DK3B879v.mjs.map} +1 -1
  34. package/dist/chunks/animated-content-CLsFnjgr.cjs.map +1 -1
  35. package/dist/chunks/animated-content-bK6xp-vc.mjs.map +1 -1
  36. package/dist/chunks/{ascii-text-OnPOTd2I.cjs → ascii-text-BFnpVur6.cjs} +5 -3
  37. package/dist/chunks/{ascii-text-OnPOTd2I.cjs.map → ascii-text-BFnpVur6.cjs.map} +1 -1
  38. package/dist/chunks/{ascii-text-OBwVLFDC.mjs → ascii-text-Bdy4C5rU.mjs} +5 -3
  39. package/dist/chunks/{ascii-text-OBwVLFDC.mjs.map → ascii-text-Bdy4C5rU.mjs.map} +1 -1
  40. package/dist/chunks/{background-gradient-animation-DpKJ3ecq.mjs → background-gradient-animation-BR9wx6Z8.mjs} +2 -2
  41. package/dist/chunks/{background-gradient-animation-DpKJ3ecq.mjs.map → background-gradient-animation-BR9wx6Z8.mjs.map} +1 -1
  42. package/dist/chunks/{background-gradient-animation-II9hdrgB.cjs → background-gradient-animation-CiNdmA61.cjs} +2 -2
  43. package/dist/chunks/{background-gradient-animation-II9hdrgB.cjs.map → background-gradient-animation-CiNdmA61.cjs.map} +1 -1
  44. package/dist/chunks/{button-DddUhuR-.mjs → button-A6UTvrOu.mjs} +2 -2
  45. package/dist/chunks/{button-DddUhuR-.mjs.map → button-A6UTvrOu.mjs.map} +1 -1
  46. package/dist/chunks/{button-xqernofO.cjs → button-C4MXPxsC.cjs} +2 -2
  47. package/dist/chunks/{button-xqernofO.cjs.map → button-C4MXPxsC.cjs.map} +1 -1
  48. package/dist/chunks/{button-hover-border-gradient-DFppVRI4.mjs → button-hover-border-gradient-DnFvjNNw.mjs} +2 -2
  49. package/dist/chunks/{button-hover-border-gradient-DFppVRI4.mjs.map → button-hover-border-gradient-DnFvjNNw.mjs.map} +1 -1
  50. package/dist/chunks/{button-hover-border-gradient-DX2lBG5C.cjs → button-hover-border-gradient-ssmwU5-U.cjs} +2 -2
  51. package/dist/chunks/{button-hover-border-gradient-DX2lBG5C.cjs.map → button-hover-border-gradient-ssmwU5-U.cjs.map} +1 -1
  52. package/dist/chunks/{calendar-BOBm3dFA.mjs → calendar-5XzPqKbE.mjs} +4 -4
  53. package/dist/chunks/calendar-5XzPqKbE.mjs.map +1 -0
  54. package/dist/chunks/{calendar-DJkfDhQA.cjs → calendar-CQJgQ5H_.cjs} +4 -4
  55. package/dist/chunks/calendar-CQJgQ5H_.cjs.map +1 -0
  56. package/dist/chunks/{carousel-F4drTOr6.cjs → carousel-Cv0m1Pp5.cjs} +2 -2
  57. package/dist/chunks/{carousel-DUqOaYvs.mjs.map → carousel-Cv0m1Pp5.cjs.map} +1 -1
  58. package/dist/chunks/{carousel-DUqOaYvs.mjs → carousel-Dd4rp-jr.mjs} +2 -2
  59. package/dist/chunks/{carousel-F4drTOr6.cjs.map → carousel-Dd4rp-jr.mjs.map} +1 -1
  60. package/dist/chunks/{charts-CZEYcr6X.cjs → charts-BmIV-mJy.cjs} +41 -10
  61. package/dist/chunks/charts-BmIV-mJy.cjs.map +1 -0
  62. package/dist/chunks/{charts-C-Qee_JY.mjs → charts-DkVu0rFc.mjs} +41 -10
  63. package/dist/chunks/charts-DkVu0rFc.mjs.map +1 -0
  64. package/dist/chunks/{chip-CMs73sc5.cjs → chip-B0YzBwkz.cjs} +10 -7
  65. package/dist/chunks/chip-B0YzBwkz.cjs.map +1 -0
  66. package/dist/chunks/{chip-BFg3DJx6.mjs → chip-CqcdcSs2.mjs} +10 -7
  67. package/dist/chunks/chip-CqcdcSs2.mjs.map +1 -0
  68. package/dist/chunks/{chroma-grid-tJX7CzCS.cjs → chroma-grid-DcZ9f4Ui.cjs} +2 -2
  69. package/dist/chunks/{chroma-grid-tJX7CzCS.cjs.map → chroma-grid-DcZ9f4Ui.cjs.map} +1 -1
  70. package/dist/chunks/{chroma-grid-DlY9hIRI.mjs → chroma-grid-opB2DBtS.mjs} +2 -2
  71. package/dist/chunks/{chroma-grid-DlY9hIRI.mjs.map → chroma-grid-opB2DBtS.mjs.map} +1 -1
  72. package/dist/chunks/color-palette-C3lesasJ.mjs +329 -0
  73. package/dist/chunks/color-palette-C3lesasJ.mjs.map +1 -0
  74. package/dist/chunks/color-palette-pLh6En3n.cjs +384 -0
  75. package/dist/chunks/color-palette-pLh6En3n.cjs.map +1 -0
  76. package/dist/chunks/{combobox-Bcwi33Qx.mjs → combobox-B6yk5U82.mjs} +6 -6
  77. package/dist/chunks/combobox-B6yk5U82.mjs.map +1 -0
  78. package/dist/chunks/{combobox-DRiHHhXL.cjs → combobox-CtNrGmuR.cjs} +6 -6
  79. package/dist/chunks/combobox-CtNrGmuR.cjs.map +1 -0
  80. package/dist/chunks/{data-table-Biom5rvs.mjs → data-table-Dtf6lKpp.mjs} +19 -19
  81. package/dist/chunks/data-table-Dtf6lKpp.mjs.map +1 -0
  82. package/dist/chunks/{data-table-D0BD2sFz.cjs → data-table-fAEuevPn.cjs} +20 -20
  83. package/dist/chunks/data-table-fAEuevPn.cjs.map +1 -0
  84. package/dist/chunks/{date-picker-CXGwnrLr.mjs → date-picker-BmQ0rgwH.mjs} +2 -2
  85. package/dist/chunks/{date-picker-CXGwnrLr.mjs.map → date-picker-BmQ0rgwH.mjs.map} +1 -1
  86. package/dist/chunks/{date-picker-Cw_tZGuk.cjs → date-picker-qpUZMtZC.cjs} +2 -2
  87. package/dist/chunks/{date-picker-Cw_tZGuk.cjs.map → date-picker-qpUZMtZC.cjs.map} +1 -1
  88. package/dist/chunks/dialog-CanVyiAD.mjs.map +1 -1
  89. package/dist/chunks/dialog-fffx1-4D.cjs.map +1 -1
  90. package/dist/chunks/{drawer-DTRnKChF.cjs → drawer-D07dGN6R.cjs} +6 -6
  91. package/dist/chunks/drawer-D07dGN6R.cjs.map +1 -0
  92. package/dist/chunks/{drawer-BJsBK6cP.mjs → drawer-DaoAXL-w.mjs} +6 -6
  93. package/dist/chunks/drawer-DaoAXL-w.mjs.map +1 -0
  94. package/dist/chunks/{form-CvNNjA1i.mjs → form-CtZ6U-_B.mjs} +2 -2
  95. package/dist/chunks/{form-CvNNjA1i.mjs.map → form-CtZ6U-_B.mjs.map} +1 -1
  96. package/dist/chunks/{form-C_JxqsSZ.cjs → form-X6Vyaavl.cjs} +2 -2
  97. package/dist/chunks/{form-C_JxqsSZ.cjs.map → form-X6Vyaavl.cjs.map} +1 -1
  98. package/dist/chunks/{gradual-blur-BB-8oKX6.cjs → gradual-blur-C6NOnjTw.cjs} +2 -2
  99. package/dist/chunks/{gradual-blur-BB-8oKX6.cjs.map → gradual-blur-C6NOnjTw.cjs.map} +1 -1
  100. package/dist/chunks/{gradual-blur-BR06yO3Y.mjs → gradual-blur-DXfxpCdB.mjs} +2 -2
  101. package/dist/chunks/{gradual-blur-BR06yO3Y.mjs.map → gradual-blur-DXfxpCdB.mjs.map} +1 -1
  102. package/dist/chunks/{input-Dox16Ozo.mjs → input-Bqo9Q5zF.mjs} +34 -13
  103. package/dist/chunks/input-Bqo9Q5zF.mjs.map +1 -0
  104. package/dist/chunks/{input-T4OlFhBc.cjs → input-DkCPyWXi.cjs} +34 -13
  105. package/dist/chunks/input-DkCPyWXi.cjs.map +1 -0
  106. package/dist/chunks/{label-CxmbGh0l.cjs → label-BKzqfAAq.cjs} +2 -2
  107. package/dist/chunks/{label-CxmbGh0l.cjs.map → label-BKzqfAAq.cjs.map} +1 -1
  108. package/dist/chunks/{label-C1Ekt3j2.mjs → label-Drxg0cG2.mjs} +2 -2
  109. package/dist/chunks/{label-C1Ekt3j2.mjs.map → label-Drxg0cG2.mjs.map} +1 -1
  110. package/dist/chunks/loading-BiM4mKh6.cjs.map +1 -1
  111. package/dist/chunks/loading-Dtosnb4A.mjs.map +1 -1
  112. package/dist/chunks/{multi-select-combobox-BzqYLVpV.cjs → multi-select-combobox-C0DoDzxQ.cjs} +6 -6
  113. package/dist/chunks/multi-select-combobox-C0DoDzxQ.cjs.map +1 -0
  114. package/dist/chunks/{multi-select-combobox-BrFtvCrS.mjs → multi-select-combobox-Do23ZfOQ.mjs} +6 -6
  115. package/dist/chunks/multi-select-combobox-Do23ZfOQ.mjs.map +1 -0
  116. package/dist/chunks/otp-input-CkhV-sGl.cjs.map +1 -1
  117. package/dist/chunks/otp-input-JOysxKfD.mjs.map +1 -1
  118. package/dist/chunks/{password-strength-meter-BEx94cfy.mjs → password-strength-meter-BsvqQBAg.mjs} +3 -3
  119. package/dist/chunks/{password-strength-meter-BEx94cfy.mjs.map → password-strength-meter-BsvqQBAg.mjs.map} +1 -1
  120. package/dist/chunks/{password-strength-meter-BNnmSgLh.cjs → password-strength-meter-DCi_BP7e.cjs} +3 -3
  121. package/dist/chunks/{password-strength-meter-BNnmSgLh.cjs.map → password-strength-meter-DCi_BP7e.cjs.map} +1 -1
  122. package/dist/chunks/{progress-bar-DS8KZ7eO.cjs → progress-bar-CYaBO_lS.cjs} +2 -2
  123. package/dist/chunks/{progress-bar-DS8KZ7eO.cjs.map → progress-bar-CYaBO_lS.cjs.map} +1 -1
  124. package/dist/chunks/{progress-bar-C9O0tuZf.mjs → progress-bar-DQ5ZKk2Y.mjs} +2 -2
  125. package/dist/chunks/{progress-bar-C9O0tuZf.mjs.map → progress-bar-DQ5ZKk2Y.mjs.map} +1 -1
  126. package/dist/chunks/radio-CuiM_gDv.mjs +50 -0
  127. package/dist/chunks/radio-CuiM_gDv.mjs.map +1 -0
  128. package/dist/chunks/radio-zx9xEW_C.cjs +56 -0
  129. package/dist/chunks/radio-zx9xEW_C.cjs.map +1 -0
  130. package/dist/chunks/{select-D0GOBB-b.mjs → select-CUaSNR09.mjs} +6 -6
  131. package/dist/chunks/select-CUaSNR09.mjs.map +1 -0
  132. package/dist/chunks/{select-CORFYTvs.cjs → select-bZ9WqLOc.cjs} +6 -6
  133. package/dist/chunks/select-bZ9WqLOc.cjs.map +1 -0
  134. package/dist/chunks/{sidebar-BrOLz89T.mjs → sidebar-DYEDFV2u.mjs} +242 -231
  135. package/dist/chunks/sidebar-DYEDFV2u.mjs.map +1 -0
  136. package/dist/chunks/{sidebar-D9D651F6.cjs → sidebar-Kkr45nuN.cjs} +241 -230
  137. package/dist/chunks/sidebar-Kkr45nuN.cjs.map +1 -0
  138. package/dist/chunks/{skeleton-wQOE-pRg.cjs → skeleton-DCBGLNAZ.cjs} +2 -2
  139. package/dist/chunks/{skeleton-wQOE-pRg.cjs.map → skeleton-DCBGLNAZ.cjs.map} +1 -1
  140. package/dist/chunks/{skeleton-BdijDxP6.mjs → skeleton-nH1eAN96.mjs} +2 -2
  141. package/dist/chunks/{skeleton-BdijDxP6.mjs.map → skeleton-nH1eAN96.mjs.map} +1 -1
  142. package/dist/chunks/{splash-cursor-CCi5n3O-.cjs → splash-cursor-BqG7ClsJ.cjs} +2 -2
  143. package/dist/chunks/{splash-cursor-CCi5n3O-.cjs.map → splash-cursor-BqG7ClsJ.cjs.map} +1 -1
  144. package/dist/chunks/{splash-cursor-CDHTm5vA.mjs → splash-cursor-N4FdnkOa.mjs} +2 -2
  145. package/dist/chunks/{splash-cursor-CDHTm5vA.mjs.map → splash-cursor-N4FdnkOa.mjs.map} +1 -1
  146. package/dist/chunks/{spotlight-card-Bh7KG0vZ.cjs → spotlight-card-BmsqC7wm.cjs} +2 -2
  147. package/dist/chunks/{spotlight-card-Bh7KG0vZ.cjs.map → spotlight-card-BmsqC7wm.cjs.map} +1 -1
  148. package/dist/chunks/{spotlight-card-D0uTxfPZ.mjs → spotlight-card-D9Z3nTmb.mjs} +2 -2
  149. package/dist/chunks/{spotlight-card-D0uTxfPZ.mjs.map → spotlight-card-D9Z3nTmb.mjs.map} +1 -1
  150. package/dist/chunks/{stepper-Z_7ugZJN.cjs → stepper-DepvEGfr.cjs} +4 -4
  151. package/dist/chunks/{stepper-Z_7ugZJN.cjs.map → stepper-DepvEGfr.cjs.map} +1 -1
  152. package/dist/chunks/{stepper-BMKxjCdm.mjs → stepper-Jv5OS1nY.mjs} +4 -4
  153. package/dist/chunks/{stepper-BMKxjCdm.mjs.map → stepper-Jv5OS1nY.mjs.map} +1 -1
  154. package/dist/chunks/{sun-to-moon-button-DcRX0obV.mjs → sun-to-moon-button-BJtBEaa3.mjs} +70 -51
  155. package/dist/chunks/sun-to-moon-button-BJtBEaa3.mjs.map +1 -0
  156. package/dist/chunks/{sun-to-moon-button-De0_Sf01.cjs → sun-to-moon-button-PwgTPsTW.cjs} +70 -51
  157. package/dist/chunks/sun-to-moon-button-PwgTPsTW.cjs.map +1 -0
  158. package/dist/chunks/{switch-DPyzVrNh.cjs → switch-X3l8xnle.cjs} +10 -29
  159. package/dist/chunks/switch-X3l8xnle.cjs.map +1 -0
  160. package/dist/chunks/{switch-C1gKE0m0.mjs → switch-iPsN1NS2.mjs} +10 -29
  161. package/dist/chunks/switch-iPsN1NS2.mjs.map +1 -0
  162. package/dist/chunks/{textarea-BY5-J9No.mjs → textarea-Bdo-Trvi.mjs} +2 -2
  163. package/dist/chunks/{textarea-BY5-J9No.mjs.map → textarea-Bdo-Trvi.mjs.map} +1 -1
  164. package/dist/chunks/{textarea-D-oBQ3IZ.cjs → textarea-CGRl2hrM.cjs} +2 -2
  165. package/dist/chunks/{textarea-D-oBQ3IZ.cjs.map → textarea-CGRl2hrM.cjs.map} +1 -1
  166. package/dist/chunks/toast-BcBidy5n.mjs.map +1 -1
  167. package/dist/chunks/toast-DiFgv3IL.cjs.map +1 -1
  168. package/dist/chunks/{truncated-text-istgJRUq.cjs → truncated-text-BIXqNfOL.cjs} +2 -2
  169. package/dist/chunks/{truncated-text-istgJRUq.cjs.map → truncated-text-BIXqNfOL.cjs.map} +1 -1
  170. package/dist/chunks/{truncated-text-DTgks5yS.mjs → truncated-text-C9t9o9IA.mjs} +2 -2
  171. package/dist/chunks/{truncated-text-DTgks5yS.mjs.map → truncated-text-C9t9o9IA.mjs.map} +1 -1
  172. package/dist/chunks/{typography-C_IanU4b.mjs → typography-Ct-jDJP3.mjs} +2 -2
  173. package/dist/chunks/{typography-C_IanU4b.mjs.map → typography-Ct-jDJP3.mjs.map} +1 -1
  174. package/dist/chunks/{typography-DUD6Dzd5.cjs → typography-LwwY_MOy.cjs} +2 -2
  175. package/dist/chunks/{typography-DUD6Dzd5.cjs.map → typography-LwwY_MOy.cjs.map} +1 -1
  176. package/dist/chunks/{utils-ati1KkDb.mjs → utils-7S0u48mU.mjs} +1339 -1
  177. package/dist/chunks/{utils-B4SmmY4J.cjs.map → utils-7S0u48mU.mjs.map} +1 -1
  178. package/dist/chunks/{utils-B4SmmY4J.cjs → utils-LRbEQHYs.cjs} +1339 -1
  179. package/dist/chunks/{utils-ati1KkDb.mjs.map → utils-LRbEQHYs.cjs.map} +1 -1
  180. package/dist/color-palette.cjs +9 -1
  181. package/dist/color-palette.mjs +2 -2
  182. package/dist/combobox.cjs +1 -1
  183. package/dist/combobox.mjs +1 -1
  184. package/dist/components/data-display/charts/BarChart.d.ts +5 -0
  185. package/dist/components/data-display/charts/BarChart.d.ts.map +1 -1
  186. package/dist/components/data-display/chip/Chip.d.ts +1 -1
  187. package/dist/components/data-display/chip/Chip.d.ts.map +1 -1
  188. package/dist/components/data-display/color-palette/ColorPalette.d.ts +24 -16
  189. package/dist/components/data-display/color-palette/ColorPalette.d.ts.map +1 -1
  190. package/dist/components/data-display/color-palette/index.d.ts +2 -1
  191. package/dist/components/data-display/color-palette/index.d.ts.map +1 -1
  192. package/dist/components/data-display/dashboard-cards/ChartCard.d.ts +15 -0
  193. package/dist/components/data-display/dashboard-cards/ChartCard.d.ts.map +1 -0
  194. package/dist/components/data-display/dashboard-cards/StatCard.d.ts +42 -0
  195. package/dist/components/data-display/dashboard-cards/StatCard.d.ts.map +1 -0
  196. package/dist/components/data-display/dashboard-cards/TopProductsCard.d.ts +17 -0
  197. package/dist/components/data-display/dashboard-cards/TopProductsCard.d.ts.map +1 -0
  198. package/dist/components/data-display/dashboard-cards/index.d.ts +7 -0
  199. package/dist/components/data-display/dashboard-cards/index.d.ts.map +1 -0
  200. package/dist/components/effects/sun-to-moon-button/ThemeSwitcherButtons.d.ts +16 -1
  201. package/dist/components/effects/sun-to-moon-button/ThemeSwitcherButtons.d.ts.map +1 -1
  202. package/dist/components/effects/sun-to-moon-button/index.d.ts +1 -1
  203. package/dist/components/effects/sun-to-moon-button/index.d.ts.map +1 -1
  204. package/dist/components/forms/input/Input.d.ts.map +1 -1
  205. package/dist/components/forms/input/types.d.ts +2 -0
  206. package/dist/components/forms/input/types.d.ts.map +1 -1
  207. package/dist/components/forms/radio/Radio.d.ts.map +1 -1
  208. package/dist/components/forms/switch/Switch.d.ts.map +1 -1
  209. package/dist/components/navigation/sidebar/DashboardSidebarShell.d.ts +26 -6
  210. package/dist/components/navigation/sidebar/DashboardSidebarShell.d.ts.map +1 -1
  211. package/dist/components/navigation/sidebar/index.d.ts +1 -0
  212. package/dist/components/navigation/sidebar/index.d.ts.map +1 -1
  213. package/dist/components/overlays/dropdown-menu/DropdownMenu.d.ts +1 -1
  214. package/dist/components/overlays/dropdown-menu/DropdownMenu.d.ts.map +1 -1
  215. package/dist/components/overlays/dropdown-menu/types.d.ts +1 -0
  216. package/dist/components/overlays/dropdown-menu/types.d.ts.map +1 -1
  217. package/dist/data-table.cjs +1 -1
  218. package/dist/data-table.mjs +1 -1
  219. package/dist/date-picker.cjs +1 -1
  220. package/dist/date-picker.mjs +1 -1
  221. package/dist/docs.cjs.map +1 -1
  222. package/dist/docs.mjs.map +1 -1
  223. package/dist/drawer.cjs +1 -1
  224. package/dist/drawer.mjs +1 -1
  225. package/dist/form.cjs +1 -1
  226. package/dist/form.mjs +1 -1
  227. package/dist/gradual-blur.cjs +1 -1
  228. package/dist/gradual-blur.mjs +1 -1
  229. package/dist/hover-border-gradient.cjs +1 -1
  230. package/dist/hover-border-gradient.mjs +1 -1
  231. package/dist/index.cjs +325 -38
  232. package/dist/index.cjs.map +1 -1
  233. package/dist/index.d.ts +5 -3
  234. package/dist/index.d.ts.map +1 -1
  235. package/dist/index.mjs +315 -39
  236. package/dist/index.mjs.map +1 -1
  237. package/dist/input.cjs +1 -1
  238. package/dist/input.mjs +1 -1
  239. package/dist/label.cjs +1 -1
  240. package/dist/label.mjs +1 -1
  241. package/dist/multi-select-combobox.cjs +1 -1
  242. package/dist/multi-select-combobox.mjs +1 -1
  243. package/dist/password-strength-meter.cjs +1 -1
  244. package/dist/password-strength-meter.mjs +1 -1
  245. package/dist/progress-bar.cjs +1 -1
  246. package/dist/progress-bar.mjs +1 -1
  247. package/dist/radio.cjs +1 -1
  248. package/dist/radio.mjs +1 -1
  249. package/dist/select.cjs +1 -1
  250. package/dist/select.mjs +1 -1
  251. package/dist/sidebar.cjs +1 -1
  252. package/dist/sidebar.mjs +1 -1
  253. package/dist/skeleton.cjs +1 -1
  254. package/dist/skeleton.mjs +1 -1
  255. package/dist/splash-cursor.cjs +1 -1
  256. package/dist/splash-cursor.mjs +1 -1
  257. package/dist/spotlight-card.cjs +1 -1
  258. package/dist/spotlight-card.mjs +1 -1
  259. package/dist/stepper.cjs +1 -1
  260. package/dist/stepper.mjs +1 -1
  261. package/dist/sun-to-moon-button.cjs +1 -1
  262. package/dist/sun-to-moon-button.mjs +1 -1
  263. package/dist/switch.cjs +1 -1
  264. package/dist/switch.mjs +1 -1
  265. package/dist/textarea.cjs +1 -1
  266. package/dist/textarea.mjs +1 -1
  267. package/dist/tooltip.cjs +2 -2
  268. package/dist/tooltip.mjs +1 -1
  269. package/dist/truncated-text.cjs +1 -1
  270. package/dist/truncated-text.mjs +1 -1
  271. package/dist/typography.cjs +1 -1
  272. package/dist/typography.mjs +1 -1
  273. package/dist/utils.cjs +1 -1
  274. package/dist/utils.mjs +1 -1
  275. package/package.json +8 -8
  276. package/dist/chunks/DropdownMenu-C17Zqu_E.mjs.map +0 -1
  277. package/dist/chunks/DropdownMenu-DOvo5pV_.cjs.map +0 -1
  278. package/dist/chunks/calendar-BOBm3dFA.mjs.map +0 -1
  279. package/dist/chunks/calendar-DJkfDhQA.cjs.map +0 -1
  280. package/dist/chunks/charts-C-Qee_JY.mjs.map +0 -1
  281. package/dist/chunks/charts-CZEYcr6X.cjs.map +0 -1
  282. package/dist/chunks/chip-BFg3DJx6.mjs.map +0 -1
  283. package/dist/chunks/chip-CMs73sc5.cjs.map +0 -1
  284. package/dist/chunks/color-palette-BmQC14gE.cjs +0 -789
  285. package/dist/chunks/color-palette-BmQC14gE.cjs.map +0 -1
  286. package/dist/chunks/color-palette-DnX1sODj.mjs +0 -782
  287. package/dist/chunks/color-palette-DnX1sODj.mjs.map +0 -1
  288. package/dist/chunks/combobox-Bcwi33Qx.mjs.map +0 -1
  289. package/dist/chunks/combobox-DRiHHhXL.cjs.map +0 -1
  290. package/dist/chunks/data-table-Biom5rvs.mjs.map +0 -1
  291. package/dist/chunks/data-table-D0BD2sFz.cjs.map +0 -1
  292. package/dist/chunks/drawer-BJsBK6cP.mjs.map +0 -1
  293. package/dist/chunks/drawer-DTRnKChF.cjs.map +0 -1
  294. package/dist/chunks/input-Dox16Ozo.mjs.map +0 -1
  295. package/dist/chunks/input-T4OlFhBc.cjs.map +0 -1
  296. package/dist/chunks/multi-select-combobox-BrFtvCrS.mjs.map +0 -1
  297. package/dist/chunks/multi-select-combobox-BzqYLVpV.cjs.map +0 -1
  298. package/dist/chunks/radio-BiD1ofmq.cjs +0 -50
  299. package/dist/chunks/radio-BiD1ofmq.cjs.map +0 -1
  300. package/dist/chunks/radio-C7Eg3FEp.mjs +0 -44
  301. package/dist/chunks/radio-C7Eg3FEp.mjs.map +0 -1
  302. package/dist/chunks/select-CORFYTvs.cjs.map +0 -1
  303. package/dist/chunks/select-D0GOBB-b.mjs.map +0 -1
  304. package/dist/chunks/sidebar-BrOLz89T.mjs.map +0 -1
  305. package/dist/chunks/sidebar-D9D651F6.cjs.map +0 -1
  306. package/dist/chunks/sun-to-moon-button-DcRX0obV.mjs.map +0 -1
  307. package/dist/chunks/sun-to-moon-button-De0_Sf01.cjs.map +0 -1
  308. package/dist/chunks/switch-C1gKE0m0.mjs.map +0 -1
  309. package/dist/chunks/switch-DPyzVrNh.cjs.map +0 -1
@@ -1,5 +1,7 @@
1
1
  require("./chunk-B_GkZjkl.cjs");
2
- const require_utils = require("./utils-B4SmmY4J.cjs");
2
+ const require_utils = require("./utils-LRbEQHYs.cjs");
3
+ const require_icons = require("./icons-CRanVZB1.cjs");
4
+ const require_Tooltip = require("./Tooltip-DD30yj3A.cjs");
3
5
  let react = require("react");
4
6
  let react_jsx_runtime = require("react/jsx-runtime");
5
7
  let framer_motion = require("framer-motion");
@@ -13,7 +15,7 @@ var InputState = /* @__PURE__ */ function(InputState) {
13
15
  }({});
14
16
  //#endregion
15
17
  //#region src/components/forms/input/Input.tsx
16
- var Input = (0, react.forwardRef)(({ className = "", label, labelHint, error, helperText, id, extra, placeholder, state = InputState.DEFAULT, disabled, message, leftIcon, leftIconClassName, rightIcon, rightIconClassName, icon, iconClassName, bgClassName = "bg-ds-surface-1", ...props }, ref) => {
18
+ var Input = (0, react.forwardRef)(({ className = "", label, labelTooltip, labelHint, error, helperText, id, extra, placeholder, state = InputState.DEFAULT, disabled, required, message, leftIcon, leftIconClassName, rightIcon, rightIconClassName, icon, iconClassName, bgClassName = "bg-ds-surface-1", ...props }, ref) => {
17
19
  const radius = 100;
18
20
  const [visible, setVisible] = (0, react.useState)(false);
19
21
  const mouseX = (0, framer_motion.useMotionValue)(0);
@@ -29,25 +31,43 @@ var Input = (0, react.forwardRef)(({ className = "", label, labelHint, error, he
29
31
  };
30
32
  const wrapperStateStyles = {
31
33
  [InputState.DISABLED]: "border border-ds-border-field bg-ds-surface-1",
32
- [InputState.ERROR]: "border-destructive ",
33
- [InputState.SUCCESS]: "border-success-border ",
34
- [InputState.DEFAULT]: "border-ds-border-2 "
34
+ [InputState.ERROR]: "border-ds-state-danger",
35
+ [InputState.SUCCESS]: "border-ds-state-success",
36
+ [InputState.DEFAULT]: "border-ds-border-2"
35
37
  };
36
38
  const inputStateStyles = {
37
39
  [InputState.DISABLED]: "border-transparent bg-transparent text-ds-2 placeholder:!text-ds-3 placeholder:opacity-60",
38
- [InputState.ERROR]: "text-destructive placeholder:text-destructive",
39
- [InputState.SUCCESS]: "text-success placeholder:text-success",
40
- [InputState.DEFAULT]: "text-ds-1"
40
+ [InputState.ERROR]: "border-ds-state-danger! text-ds-1",
41
+ [InputState.SUCCESS]: "border-ds-state-success! text-ds-1",
42
+ [InputState.DEFAULT]: "border-ds-border-field text-ds-1"
41
43
  };
42
44
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
43
45
  className: "w-full",
44
46
  children: [
45
47
  label || labelHint ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
46
48
  className: require_utils.mergeClassNames("mb-2 flex items-center gap-3", label ? "justify-between" : "justify-end"),
47
- children: [label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
49
+ children: [label ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
48
50
  htmlFor: id,
49
- className: "block text-sm leading-none font-medium text-ds-1 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
50
- children: label
51
+ className: "inline-flex items-center gap-1.5 text-sm leading-none font-medium text-ds-1 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
52
+ children: [
53
+ label,
54
+ required && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("sup", {
55
+ className: "ms-0.5 text-ds-state-danger",
56
+ children: "*"
57
+ }),
58
+ labelTooltip && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tooltip.Tooltip, {
59
+ content: labelTooltip,
60
+ position: "top",
61
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
62
+ className: "cursor-help text-ds-3 hover:text-ds-2 transition-colors",
63
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons.InfoCircleIcon, {
64
+ width: 14,
65
+ height: 14,
66
+ color: "currentColor"
67
+ })
68
+ })
69
+ })
70
+ ]
51
71
  }) : null, labelHint ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
52
72
  className: "shrink-0 text-xs text-ds-2",
53
73
  children: labelHint
@@ -89,6 +109,7 @@ var Input = (0, react.forwardRef)(({ className = "", label, labelHint, error, he
89
109
  id,
90
110
  placeholder,
91
111
  disabled: isDisabled,
112
+ required,
92
113
  className: require_utils.mergeClassNames("flex h-10 w-full rounded-md border border-ds-border-field py-2 text-sm text-ds-1 transition duration-400 ease-in-out file:border-0 file:text-sm file:font-medium placeholder:text-ds-3 placeholder:opacity-70 focus-visible:ring-1 focus-visible:ring-ds-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", bgClassName, inputStateStyles[resolvedState], className),
93
114
  style: {
94
115
  paddingInlineStart: leftIcon ? "2.5rem" : "0.75rem",
@@ -101,7 +122,7 @@ var Input = (0, react.forwardRef)(({ className = "", label, labelHint, error, he
101
122
  })
102
123
  }),
103
124
  (error || message) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
104
- className: require_utils.mergeClassNames("text-sm font-medium mt-1", error ? "text-destructive" : "text-ds-2"),
125
+ className: require_utils.mergeClassNames("text-sm font-medium mt-1", error ? "text-ds-state-danger" : "text-ds-2"),
105
126
  children: error || message
106
127
  }),
107
128
  helperText && !error && !message && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
@@ -126,4 +147,4 @@ Object.defineProperty(exports, "InputState", {
126
147
  }
127
148
  });
128
149
 
129
- //# sourceMappingURL=input-T4OlFhBc.cjs.map
150
+ //# sourceMappingURL=input-DkCPyWXi.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-DkCPyWXi.cjs","names":[],"sources":["../../src/components/forms/input/types.ts","../../src/components/forms/input/Input.tsx"],"sourcesContent":["import type { InputHTMLAttributes, ReactNode } from \"react\";\n\nexport enum InputState {\n DEFAULT = \"default\",\n DISABLED = \"disabled\",\n ERROR = \"error\",\n SUCCESS = \"success\",\n}\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n label?: string;\n /** Text shown in a tooltip on the info icon next to the label. */\n labelTooltip?: string;\n labelHint?: ReactNode;\n error?: string;\n helperText?: string;\n id?: string;\n extra?: string;\n state?: InputState;\n message?: string;\n leftIcon?: ReactNode;\n leftIconClassName?: string;\n rightIcon?: ReactNode;\n rightIconClassName?: string;\n icon?: ReactNode;\n iconClassName?: string;\n /** Custom background classes (e.g. \"ui:bg-ds-surface-1\"). */\n bgClassName?: string;\n}\n","import { forwardRef, useState } from \"react\";\nimport { type InputProps, InputState } from \"./types\";\nimport { motion, useMotionTemplate, useMotionValue } from \"framer-motion\";\nimport { mergeClassNames } from \"../../../utils\";\nimport { Tooltip } from \"../../overlays/tooltip/Tooltip\";\nimport { InfoCircleIcon } from \"../../icons\";\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className = \"\",\n label,\n labelTooltip,\n labelHint,\n error,\n helperText,\n id,\n extra,\n placeholder,\n state = InputState.DEFAULT,\n disabled,\n required,\n message,\n leftIcon,\n leftIconClassName,\n rightIcon,\n rightIconClassName,\n icon,\n iconClassName,\n bgClassName = \"bg-ds-surface-1\",\n ...props\n },\n ref,\n ) => {\n const radius = 100;\n const [visible, setVisible] = useState(false);\n const mouseX = useMotionValue(0);\n const mouseY = useMotionValue(0);\n const resolvedState = disabled\n ? InputState.DISABLED\n : error\n ? InputState.ERROR\n : state;\n const isDisabled = resolvedState === InputState.DISABLED;\n const trailingIcon = rightIcon ?? icon;\n const trailingIconClassName = rightIcon\n ? rightIconClassName\n : (rightIconClassName ?? iconClassName);\n\n const handleMouseMove = (event: React.MouseEvent<HTMLDivElement>) => {\n const { left, top } = event.currentTarget.getBoundingClientRect();\n mouseX.set(event.clientX - left);\n mouseY.set(event.clientY - top);\n };\n\n const wrapperStateStyles: Record<InputState, string> = {\n [InputState.DISABLED]: \"border border-ds-border-field bg-ds-surface-1\",\n [InputState.ERROR]: \"border-ds-state-danger\",\n [InputState.SUCCESS]: \"border-ds-state-success\",\n [InputState.DEFAULT]: \"border-ds-border-2\",\n };\n\n const inputStateStyles: Record<InputState, string> = {\n [InputState.DISABLED]:\n \"border-transparent bg-transparent text-ds-2 placeholder:!text-ds-3 placeholder:opacity-60\",\n [InputState.ERROR]: \"border-ds-state-danger! text-ds-1\",\n [InputState.SUCCESS]: \"border-ds-state-success! text-ds-1\",\n [InputState.DEFAULT]: \"border-ds-border-field text-ds-1\",\n };\n\n return (\n <div className=\"w-full\">\n {label || labelHint ? (\n <div\n className={mergeClassNames(\n \"mb-2 flex items-center gap-3\",\n label ? \"justify-between\" : \"justify-end\",\n )}\n >\n {label ? (\n <label\n htmlFor={id}\n className=\"inline-flex items-center gap-1.5 text-sm leading-none font-medium text-ds-1 peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && (\n <sup className=\"ms-0.5 text-ds-state-danger\">*</sup>\n )}\n {labelTooltip && (\n <Tooltip content={labelTooltip} position=\"top\">\n <span className=\"cursor-help text-ds-3 hover:text-ds-2 transition-colors\">\n <InfoCircleIcon width={14} height={14} color=\"currentColor\" />\n </span>\n </Tooltip>\n )}\n </label>\n ) : null}\n {labelHint ? (\n <div className=\"shrink-0 text-xs text-ds-2\">{labelHint}</div>\n ) : null}\n </div>\n ) : null}\n\n <motion.div\n style={{\n backgroundImage: isDisabled\n ? \"none\"\n : useMotionTemplate`\n radial-gradient(\n ${\n visible ? `${radius}px` : \"0px\"\n } circle at ${mouseX}px ${mouseY}px,\n var(--ds-color-accent),\n transparent 90%\n )\n `,\n }}\n onMouseMove={!isDisabled ? handleMouseMove : undefined}\n onMouseEnter={!isDisabled ? () => setVisible(true) : undefined}\n onMouseLeave={!isDisabled ? () => setVisible(false) : undefined}\n className={mergeClassNames(\n \"group/input rounded-lg transition duration-300\",\n isDisabled ? \"p-px\" : \"p-[2px] hover:border-ds-border-accent\",\n wrapperStateStyles[resolvedState],\n extra,\n )}\n >\n <div className=\"relative flex items-center\">\n {leftIcon ? (\n <div\n className={mergeClassNames(\n \"pointer-events-none absolute inset-y-0 flex items-center text-ds-2\",\n leftIconClassName,\n )}\n style={{ insetInlineStart: 0, paddingInlineStart: \"0.75rem\" }}\n >\n {leftIcon}\n </div>\n ) : null}\n {trailingIcon ? (\n <div\n className={mergeClassNames(\n \"pointer-events-none absolute inset-y-0 flex items-center text-ds-2\",\n trailingIconClassName,\n )}\n style={{ insetInlineEnd: 0, paddingInlineEnd: \"0.75rem\" }}\n >\n {trailingIcon}\n </div>\n ) : null}\n <input\n ref={ref}\n id={id}\n placeholder={placeholder}\n disabled={isDisabled}\n required={required}\n className={mergeClassNames(\n \"flex h-10 w-full rounded-md border border-ds-border-field py-2 text-sm text-ds-1 transition duration-400 ease-in-out file:border-0 file:text-sm file:font-medium placeholder:text-ds-3 placeholder:opacity-70 focus-visible:ring-1 focus-visible:ring-ds-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n bgClassName,\n inputStateStyles[resolvedState],\n className,\n )}\n style={{\n paddingInlineStart: leftIcon ? \"2.5rem\" : \"0.75rem\",\n paddingInlineEnd: trailingIcon ? \"2.5rem\" : \"0.75rem\",\n }}\n {...props}\n autoComplete=\"off\"\n />\n </div>\n </motion.div>\n\n {(error || message) && (\n <p\n className={mergeClassNames(\n \"text-sm font-medium mt-1\",\n error ? \"text-ds-state-danger\" : \"text-ds-2\",\n )}\n >\n {error || message}\n </p>\n )}\n {helperText && !error && !message && (\n <p className=\"text-sm text-ds-2 mt-1\">{helperText}</p>\n )}\n </div>\n );\n },\n);\n\nInput.displayName = \"Input\";\n"],"mappings":";;;;;;;;AAEA,IAAY,aAAL,yBAAA,YAAA;AACL,YAAA,aAAU;AACV,YAA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AC1C,kBAAkB,eAAe,WAAW;QAC7C;OACD,GAAI;OACJ,cAAa;OACb,CAAA;MACE;;IACK,CAAA;IAEX,SAAS,YACT,iBAAA,GAAA,kBAAA,KAAC,KAAD;IACE,WAAW,cAAA,gBACT,4BACA,QAAQ,yBAAyB,YAClC;cAEA,SAAS;IACR,CAAA;GAEL,cAAc,CAAC,SAAS,CAAC,WACxB,iBAAA,GAAA,kBAAA,KAAC,KAAD;IAAG,WAAU;cAA0B;IAAe,CAAA;GAEpD;;EAGX;AAED,MAAM,cAAc"}
@@ -15,7 +15,7 @@ var Label = (0, react.forwardRef)(({ className = "", children, required, ...prop
15
15
  `.trim().replace(/\s+/g, " "),
16
16
  ...props,
17
17
  children: [children, required && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
18
- className: "text-destructive ml-1",
18
+ className: "text-destructive ms-1",
19
19
  children: "*"
20
20
  })]
21
21
  });
@@ -29,4 +29,4 @@ Object.defineProperty(exports, "Label", {
29
29
  }
30
30
  });
31
31
 
32
- //# sourceMappingURL=label-CxmbGh0l.cjs.map
32
+ //# sourceMappingURL=label-BKzqfAAq.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"label-CxmbGh0l.cjs","names":[],"sources":["../../src/components/forms/label/Label.tsx"],"sourcesContent":["import type { LabelProps } from \"./types\";\nimport { forwardRef } from \"react\";\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className = \"\", children, required, ...props }, ref) => {\n return (\n <label\n ref={ref}\n className={`\n text-sm\n font-medium\n leading-none\n peer-disabled:cursor-not-allowed\n peer-disabled:opacity-70\n ${className}\n `\n .trim()\n .replace(/\\s+/g, \" \")}\n {...props}\n >\n {children}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </label>\n );\n },\n);\n\nLabel.displayName = \"Label\";\n"],"mappings":";;;;AAGA,IAAa,SAAA,GAAA,MAAA,aACV,EAAE,YAAY,IAAI,UAAU,UAAU,GAAG,SAAS,QAAQ;AACzD,QACE,iBAAA,GAAA,kBAAA,MAAC,SAAD;EACO;EACL,WAAW;;;;;;YAMP,UAAU;UAEX,MAAM,CACN,QAAQ,QAAQ,IAAI;EACvB,GAAI;YAZN,CAcG,UACA,YAAY,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAAwB;GAAQ,CAAA,CACvD;;EAGb;AAED,MAAM,cAAc"}
1
+ {"version":3,"file":"label-BKzqfAAq.cjs","names":[],"sources":["../../src/components/forms/label/Label.tsx"],"sourcesContent":["import type { LabelProps } from \"./types\";\nimport { forwardRef } from \"react\";\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className = \"\", children, required, ...props }, ref) => {\n return (\n <label\n ref={ref}\n className={`\n text-sm\n font-medium\n leading-none\n peer-disabled:cursor-not-allowed\n peer-disabled:opacity-70\n ${className}\n `\n .trim()\n .replace(/\\s+/g, \" \")}\n {...props}\n >\n {children}\n {required && <span className=\"text-destructive ms-1\">*</span>}\n </label>\n );\n },\n);\n\nLabel.displayName = \"Label\";\n"],"mappings":";;;;AAGA,IAAa,SAAA,GAAA,MAAA,aACV,EAAE,YAAY,IAAI,UAAU,UAAU,GAAG,SAAS,QAAQ;AACzD,QACE,iBAAA,GAAA,kBAAA,MAAC,SAAD;EACO;EACL,WAAW;;;;;;YAMP,UAAU;UAEX,MAAM,CACN,QAAQ,QAAQ,IAAI;EACvB,GAAI;YAZN,CAcG,UACA,YAAY,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAAwB;GAAQ,CAAA,CACvD;;EAGb;AAED,MAAM,cAAc"}
@@ -14,7 +14,7 @@ var Label = forwardRef(({ className = "", children, required, ...props }, ref) =
14
14
  `.trim().replace(/\s+/g, " "),
15
15
  ...props,
16
16
  children: [children, required && /* @__PURE__ */ jsx("span", {
17
- className: "text-destructive ml-1",
17
+ className: "text-destructive ms-1",
18
18
  children: "*"
19
19
  })]
20
20
  });
@@ -23,4 +23,4 @@ Label.displayName = "Label";
23
23
  //#endregion
24
24
  export { Label as t };
25
25
 
26
- //# sourceMappingURL=label-C1Ekt3j2.mjs.map
26
+ //# sourceMappingURL=label-Drxg0cG2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"label-C1Ekt3j2.mjs","names":[],"sources":["../../src/components/forms/label/Label.tsx"],"sourcesContent":["import type { LabelProps } from \"./types\";\nimport { forwardRef } from \"react\";\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className = \"\", children, required, ...props }, ref) => {\n return (\n <label\n ref={ref}\n className={`\n text-sm\n font-medium\n leading-none\n peer-disabled:cursor-not-allowed\n peer-disabled:opacity-70\n ${className}\n `\n .trim()\n .replace(/\\s+/g, \" \")}\n {...props}\n >\n {children}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </label>\n );\n },\n);\n\nLabel.displayName = \"Label\";\n"],"mappings":";;;AAGA,IAAa,QAAQ,YAClB,EAAE,YAAY,IAAI,UAAU,UAAU,GAAG,SAAS,QAAQ;AACzD,QACE,qBAAC,SAAD;EACO;EACL,WAAW;;;;;;YAMP,UAAU;UAEX,MAAM,CACN,QAAQ,QAAQ,IAAI;EACvB,GAAI;YAZN,CAcG,UACA,YAAY,oBAAC,QAAD;GAAM,WAAU;aAAwB;GAAQ,CAAA,CACvD;;EAGb;AAED,MAAM,cAAc"}
1
+ {"version":3,"file":"label-Drxg0cG2.mjs","names":[],"sources":["../../src/components/forms/label/Label.tsx"],"sourcesContent":["import type { LabelProps } from \"./types\";\nimport { forwardRef } from \"react\";\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className = \"\", children, required, ...props }, ref) => {\n return (\n <label\n ref={ref}\n className={`\n text-sm\n font-medium\n leading-none\n peer-disabled:cursor-not-allowed\n peer-disabled:opacity-70\n ${className}\n `\n .trim()\n .replace(/\\s+/g, \" \")}\n {...props}\n >\n {children}\n {required && <span className=\"text-destructive ms-1\">*</span>}\n </label>\n );\n },\n);\n\nLabel.displayName = \"Label\";\n"],"mappings":";;;AAGA,IAAa,QAAQ,YAClB,EAAE,YAAY,IAAI,UAAU,UAAU,GAAG,SAAS,QAAQ;AACzD,QACE,qBAAC,SAAD;EACO;EACL,WAAW;;;;;;YAMP,UAAU;UAEX,MAAM,CACN,QAAQ,QAAQ,IAAI;EACvB,GAAI;YAZN,CAcG,UACA,YAAY,oBAAC,QAAD;GAAM,WAAU;aAAwB;GAAQ,CAAA,CACvD;;EAGb;AAED,MAAM,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"loading-BiM4mKh6.cjs","names":[],"sources":["../../src/components/data-display/loading/Loading.tsx"],"sourcesContent":["import { LoaderIcon, RingLoaderIcon } from \"../../icons\";\n\nexport type LoadingVariant =\n | \"spinner\"\n | \"dots\"\n | \"pulse\"\n | \"bars\"\n | \"ring\"\n | \"bounce\"\n | \"wave\"\n | \"skeleton\";\n\nexport type LoadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface LoadingProps {\n /** The variant/style of the loading indicator */\n variant?: LoadingVariant;\n /** Size of the loading indicator */\n size?: LoadingSize;\n /** Custom color for the loading indicator */\n color?: string;\n /** Text to display alongside the loading indicator */\n text?: string;\n /** Position of the text relative to the indicator */\n textPosition?: \"right\" | \"bottom\";\n /** Whether to show as a full-screen overlay */\n fullScreen?: boolean;\n /** Whether to show as an overlay within parent container */\n overlay?: boolean;\n /** Custom className */\n className?: string;\n /** Skeleton specific: width */\n skeletonWidth?: string;\n /** Skeleton specific: height */\n skeletonHeight?: string;\n /** Skeleton specific: rounded style */\n skeletonRounded?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n}\n\nconst sizeMap: Record<LoadingSize, { container: string; text: string }> = {\n xs: { container: \"w-4 h-4\", text: \"text-xs\" },\n sm: { container: \"w-6 h-6\", text: \"text-sm\" },\n md: { container: \"w-8 h-8\", text: \"text-sm\" },\n lg: { container: \"w-12 h-12\", text: \"text-base\" },\n xl: { container: \"w-16 h-16\", text: \"text-lg\" },\n};\n\n// Spinner - Classic rotating circle\nfunction Spinner({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n return (\n <LoaderIcon\n className={`animate-spin ${sizeMap[size].container}`}\n color={color}\n aria-hidden=\"true\"\n />\n );\n}\n\n// Dots - Three bouncing dots\nfunction Dots({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const dotSize = {\n xs: \"w-1.5 h-1.5\",\n sm: \"w-2 h-2\",\n md: \"w-2.5 h-2.5\",\n lg: \"w-3 h-3\",\n xl: \"w-4 h-4\",\n };\n\n return (\n <div className=\"flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n className={`${dotSize[size]} rounded-full animate-bounce`}\n style={{\n backgroundColor: color,\n animationDelay: `${i * 0.15}s`,\n animationDuration: \"0.6s\",\n }}\n />\n ))}\n </div>\n );\n}\n\n// Pulse - Pulsing circle\nfunction Pulse({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n return (\n <div className={`relative ${sizeMap[size].container}`}>\n <div\n className=\"absolute inset-0 rounded-full animate-ping opacity-75\"\n style={{ backgroundColor: color }}\n />\n <div\n className=\"absolute inset-2 rounded-full\"\n style={{ backgroundColor: color }}\n />\n </div>\n );\n}\n\n// Bars - Audio-style animated bars\nfunction Bars({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const barWidth = {\n xs: \"w-0.5\",\n sm: \"w-1\",\n md: \"w-1.5\",\n lg: \"w-2\",\n xl: \"w-2.5\",\n };\n\n return (\n <div className={`flex items-end gap-0.5 ${sizeMap[size].container}`}>\n {[0, 1, 2, 3, 4].map((i) => (\n <div\n key={i}\n className={`${barWidth[size]} rounded-sm`}\n style={{\n backgroundColor: color,\n animation: \"loading-bars 1s ease-in-out infinite\",\n animationDelay: `${i * 0.1}s`,\n height: \"40%\",\n }}\n />\n ))}\n <style>{`\n @keyframes loading-bars {\n 0%, 100% { height: 40%; }\n 50% { height: 100%; }\n }\n `}</style>\n </div>\n );\n}\n\n// Ring - Rotating ring with gradient\nfunction Ring({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const strokeWidth = {\n xs: 3,\n sm: 3,\n md: 4,\n lg: 4,\n xl: 5,\n };\n\n return (\n <RingLoaderIcon\n className={`animate-spin ${sizeMap[size].container}`}\n color={color}\n strokeWidth={strokeWidth[size]}\n aria-hidden=\"true\"\n />\n );\n}\n\n// Bounce - Three bouncing circles\nfunction Bounce({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const dotSize = {\n xs: \"w-2 h-2\",\n sm: \"w-3 h-3\",\n md: \"w-4 h-4\",\n lg: \"w-5 h-5\",\n xl: \"w-6 h-6\",\n };\n\n return (\n <div className=\"flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n className={`${dotSize[size]} rounded-full`}\n style={{\n backgroundColor: color,\n animation: \"loading-bounce 1.4s ease-in-out infinite both\",\n animationDelay: `${i * 0.16}s`,\n }}\n />\n ))}\n <style>{`\n @keyframes loading-bounce {\n 0%, 80%, 100% { transform: scale(0); }\n 40% { transform: scale(1); }\n }\n `}</style>\n </div>\n );\n}\n\n// Wave - Wave animation\nfunction Wave({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const barHeight = {\n xs: \"h-3\",\n sm: \"h-4\",\n md: \"h-6\",\n lg: \"h-8\",\n xl: \"h-10\",\n };\n const barWidth = {\n xs: \"w-0.5\",\n sm: \"w-1\",\n md: \"w-1\",\n lg: \"w-1.5\",\n xl: \"w-2\",\n };\n\n return (\n <div className=\"flex items-center gap-0.5\">\n {[0, 1, 2, 3, 4].map((i) => (\n <div\n key={i}\n className={`${barWidth[size]} ${barHeight[size]} rounded-full`}\n style={{\n backgroundColor: color,\n animation: \"loading-wave 1.2s ease-in-out infinite\",\n animationDelay: `${i * 0.1}s`,\n }}\n />\n ))}\n <style>{`\n @keyframes loading-wave {\n 0%, 40%, 100% { transform: scaleY(0.4); }\n 20% { transform: scaleY(1); }\n }\n `}</style>\n </div>\n );\n}\n\n// Skeleton - Loading placeholder\nfunction Skeleton({\n width = \"100%\",\n height = \"1rem\",\n rounded = \"md\",\n}: {\n width?: string;\n height?: string;\n rounded?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n}) {\n const roundedMap = {\n none: \"\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\",\n };\n\n return (\n <div\n className={`animate-pulse bg-ds-surface-3 ${roundedMap[rounded]}`}\n style={{ width, height }}\n />\n );\n}\n\nexport default function Loading({\n variant = \"spinner\",\n size = \"md\",\n color = \"var(--ds-color-accent)\",\n text,\n textPosition = \"right\",\n fullScreen = false,\n overlay = false,\n className = \"\",\n skeletonWidth,\n skeletonHeight,\n skeletonRounded = \"md\",\n}: LoadingProps) {\n const renderLoader = () => {\n switch (variant) {\n case \"spinner\":\n return <Spinner size={size} color={color} />;\n case \"dots\":\n return <Dots size={size} color={color} />;\n case \"pulse\":\n return <Pulse size={size} color={color} />;\n case \"bars\":\n return <Bars size={size} color={color} />;\n case \"ring\":\n return <Ring size={size} color={color} />;\n case \"bounce\":\n return <Bounce size={size} color={color} />;\n case \"wave\":\n return <Wave size={size} color={color} />;\n case \"skeleton\":\n return (\n <Skeleton\n width={skeletonWidth}\n height={skeletonHeight}\n rounded={skeletonRounded}\n />\n );\n default:\n return <Spinner size={size} color={color} />;\n }\n };\n\n const content = (\n <div\n className={`inline-flex items-center ${\n textPosition === \"bottom\" ? \"flex-col gap-2\" : \"flex-row gap-3\"\n } ${className}`}\n >\n {renderLoader()}\n {text && (\n <span className={`${sizeMap[size].text} text-ds-2 font-medium`}>\n {text}\n </span>\n )}\n </div>\n );\n\n if (fullScreen) {\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-ds-canvas/80 backdrop-blur-sm\">\n {content}\n </div>\n );\n }\n\n if (overlay) {\n return (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-ds-canvas/70 backdrop-blur-sm rounded-inherit\">\n {content}\n </div>\n );\n }\n\n return content;\n}\n\n// Export individual components for direct use\nexport { Spinner, Dots, Pulse, Bars, Ring, Bounce, Wave, Skeleton };\n"],"mappings":";;;;AAuCA,IAAM,UAAoE;CACxE,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAa,MAAM;EAAa;CACjD,IAAI;EAAE,WAAW;EAAa,MAAM;EAAW;CAChD;AAGD,SAAS,QAAQ,EACf,OAAO,MACP,QAAQ,kBAIP;AACD,QACE,iBAAA,GAAA,kBAAA,KAAC,cAAA,YAAD;EACE,WAAW,gBAAgB,QAAQ,MAAM;EAClC;EACP,eAAY;EACZ,CAAA;;AAKN,SAAS,KAAK,EACZ,OAAO,MACP,QAAQ,kBAIP;CACD,MAAM,UAAU;EACd,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;AAED,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;YACZ;GAAC;GAAG;GAAG;GAAE,CAAC,KAAK,MACd,iBAAA,GAAA,kBAAA,KAAC,OAAD;GAEE,WAAW,GAAG,QAAQ,MAAM;GAC5B,OAAO;IACL,iBAAiB;IACjB,gBAAgB,GAAG,IAAI,IAAK;IAC5B,mBAAmB;IACpB;GACD,EAPK,EAOL,CACF;EACE,CAAA;;AAKV,SAAS,MAAM,EACb,OAAO,MACP,QAAQ,kBAIP;AACD,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,WAAW,YAAY,QAAQ,MAAM;YAA1C,CACE,iB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D;IAAe;IAAa;IAAS,CAAA;GAC9C,KAAK,OACH,QAAO,iBAAA,GAAA,kBAAA,KAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,QACH,QAAO,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAa;IAAa;IAAS,CAAA;GAC5C,KAAK,OACH,QAAO,iBAAA,GAAA,kBAAA,KAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,OACH,QAAO,iBAAA,GAAA,kBAAA,KAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,SACH,QAAO,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAc;IAAa;IAAS,CAAA;GAC7C,KAAK,OACH,QAAO,iBAAA,GAAA,kBAAA,KAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,WACH,QACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;IACE,OAAO;IACP,QAAQ;IACR,SAAS;IACT,CAAA;GAEN,QACE,QAAO,iBAAA,GAAA,kBAAA,KAAC,SAAD;IAAe;IAAa;IAAS,CAAA;;;CAIlD,MAAM,UACJ,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,WAAW,4BACT,iBAAiB,WAAW,mBAAmB,iBAChD,GAAG;YAHN,CAKG,cAAc,EACd,QACC,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAW,GAAG,QAAQ,MAAM,KAAK;aACpC;GACI,CAAA,CAEL;;AAGR,KAAI,WACF,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;YACZ;EACG,CAAA;AAIV,KAAI,QACF,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;YACZ;EACG,CAAA;AAIV,QAAO"}
1
+ {"version":3,"file":"loading-BiM4mKh6.cjs","names":[],"sources":["../../src/components/data-display/loading/Loading.tsx"],"sourcesContent":["import { LoaderIcon, RingLoaderIcon } from \"../../icons\";\n\nexport type LoadingVariant =\n | \"spinner\"\n | \"dots\"\n | \"pulse\"\n | \"bars\"\n | \"ring\"\n | \"bounce\"\n | \"wave\"\n | \"skeleton\";\n\nexport type LoadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface LoadingProps {\n /** The variant/style of the loading indicator */\n variant?: LoadingVariant;\n /** Size of the loading indicator */\n size?: LoadingSize;\n /** Custom color for the loading indicator */\n color?: string;\n /** Text to display alongside the loading indicator */\n text?: string;\n /** Position of the text relative to the indicator */\n textPosition?: \"right\" | \"bottom\";\n /** Whether to show as a full-screen overlay */\n fullScreen?: boolean;\n /** Whether to show as an overlay within parent container */\n overlay?: boolean;\n /** Custom className */\n className?: string;\n /** Skeleton specific: width */\n skeletonWidth?: string;\n /** Skeleton specific: height */\n skeletonHeight?: string;\n /** Skeleton specific: rounded style */\n skeletonRounded?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n}\n\nconst sizeMap: Record<LoadingSize, { container: string; text: string }> = {\n xs: { container: \"w-4 h-4\", text: \"text-xs\" },\n sm: { container: \"w-6 h-6\", text: \"text-sm\" },\n md: { container: \"w-8 h-8\", text: \"text-sm\" },\n lg: { container: \"w-12 h-12\", text: \"text-base\" },\n xl: { container: \"w-16 h-16\", text: \"text-lg\" },\n};\n\n// Spinner - Classic rotating circle\nfunction Spinner({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n return (\n <LoaderIcon\n className={`animate-spin ${sizeMap[size].container}`}\n color={color}\n aria-hidden=\"true\"\n />\n );\n}\n\n// Dots - Three bouncing dots\nfunction Dots({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const dotSize = {\n xs: \"w-1.5 h-1.5\",\n sm: \"w-2 h-2\",\n md: \"w-2.5 h-2.5\",\n lg: \"w-3 h-3\",\n xl: \"w-4 h-4\",\n };\n\n return (\n <div className=\"flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n className={`${dotSize[size]} rounded-full animate-bounce`}\n style={{\n backgroundColor: color,\n animationDelay: `${i * 0.15}s`,\n animationDuration: \"0.6s\",\n }}\n />\n ))}\n </div>\n );\n}\n\n// Pulse - Pulsing circle\nfunction Pulse({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n return (\n <div className={`relative ${sizeMap[size].container}`}>\n <div\n className=\"absolute inset-0 rounded-full animate-ping opacity-75\"\n style={{ backgroundColor: color }}\n />\n <div\n className=\"absolute inset-2 rounded-full\"\n style={{ backgroundColor: color }}\n />\n </div>\n );\n}\n\n// Bars - Audio-style animated bars\nfunction Bars({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const barWidth = {\n xs: \"w-0.5\",\n sm: \"w-1\",\n md: \"w-1.5\",\n lg: \"w-2\",\n xl: \"w-2.5\",\n };\n\n return (\n <div className={`flex items-end gap-0.5 ${sizeMap[size].container}`}>\n {[0, 1, 2, 3, 4].map((i) => (\n <div\n key={i}\n className={`${barWidth[size]} rounded-sm`}\n style={{\n backgroundColor: color,\n animation: \"loading-bars 1s ease-in-out infinite\",\n animationDelay: `${i * 0.1}s`,\n height: \"40%\",\n }}\n />\n ))}\n <style>{`\n @keyframes loading-bars {\n 0%, 100% { height: 40%; }\n 50% { height: 100%; }\n }\n `}</style>\n </div>\n );\n}\n\n// Ring - Rotating ring with gradient\nfunction Ring({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const strokeWidth = {\n xs: 3,\n sm: 3,\n md: 4,\n lg: 4,\n xl: 5,\n };\n\n return (\n <RingLoaderIcon\n className={`animate-spin ${sizeMap[size].container}`}\n color={color}\n strokeWidth={strokeWidth[size]}\n aria-hidden=\"true\"\n />\n );\n}\n\n// Bounce - Three bouncing circles\nfunction Bounce({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const dotSize = {\n xs: \"w-2 h-2\",\n sm: \"w-3 h-3\",\n md: \"w-4 h-4\",\n lg: \"w-5 h-5\",\n xl: \"w-6 h-6\",\n };\n\n return (\n <div className=\"flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n className={`${dotSize[size]} rounded-full`}\n style={{\n backgroundColor: color,\n animation: \"loading-bounce 1.4s ease-in-out infinite both\",\n animationDelay: `${i * 0.16}s`,\n }}\n />\n ))}\n <style>{`\n @keyframes loading-bounce {\n 0%, 80%, 100% { transform: scale(0); }\n 40% { transform: scale(1); }\n }\n `}</style>\n </div>\n );\n}\n\n// Wave - Wave animation\nfunction Wave({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const barHeight = {\n xs: \"h-3\",\n sm: \"h-4\",\n md: \"h-6\",\n lg: \"h-8\",\n xl: \"h-10\",\n };\n const barWidth = {\n xs: \"w-0.5\",\n sm: \"w-1\",\n md: \"w-1\",\n lg: \"w-1.5\",\n xl: \"w-2\",\n };\n\n return (\n <div className=\"flex items-center gap-0.5\">\n {[0, 1, 2, 3, 4].map((i) => (\n <div\n key={i}\n className={`${barWidth[size]} ${barHeight[size]} rounded-full`}\n style={{\n backgroundColor: color,\n animation: \"loading-wave 1.2s ease-in-out infinite\",\n animationDelay: `${i * 0.1}s`,\n }}\n />\n ))}\n <style>{`\n @keyframes loading-wave {\n 0%, 40%, 100% { transform: scaleY(0.4); }\n 20% { transform: scaleY(1); }\n }\n `}</style>\n </div>\n );\n}\n\n// Skeleton - Loading placeholder\nfunction Skeleton({\n width = \"100%\",\n height = \"1rem\",\n rounded = \"md\",\n}: {\n width?: string;\n height?: string;\n rounded?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n}) {\n const roundedMap = {\n none: \"\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\",\n };\n\n return (\n <div\n className={`animate-pulse bg-ds-surface-3 ${roundedMap[rounded]}`}\n style={{ width, height }}\n />\n );\n}\n\nexport default function Loading({\n variant = \"spinner\",\n size = \"md\",\n color = \"var(--ds-color-accent)\",\n text,\n textPosition = \"right\",\n fullScreen = false,\n overlay = false,\n className = \"\",\n skeletonWidth,\n skeletonHeight,\n skeletonRounded = \"md\",\n}: LoadingProps) {\n const renderLoader = () => {\n switch (variant) {\n case \"spinner\":\n return <Spinner size={size} color={color} />;\n case \"dots\":\n return <Dots size={size} color={color} />;\n case \"pulse\":\n return <Pulse size={size} color={color} />;\n case \"bars\":\n return <Bars size={size} color={color} />;\n case \"ring\":\n return <Ring size={size} color={color} />;\n case \"bounce\":\n return <Bounce size={size} color={color} />;\n case \"wave\":\n return <Wave size={size} color={color} />;\n case \"skeleton\":\n return (\n <Skeleton\n width={skeletonWidth}\n height={skeletonHeight}\n rounded={skeletonRounded}\n />\n );\n default:\n return <Spinner size={size} color={color} />;\n }\n };\n\n const content = (\n <div\n className={`inline-flex items-center ${\n textPosition === \"bottom\" ? \"flex-col gap-2\" : \"flex-row gap-3\"\n } ${className}`}\n >\n {renderLoader()}\n {text && (\n <span className={`${sizeMap[size].text} text-ds-2 font-medium`}>\n {text}\n </span>\n )}\n </div>\n );\n\n if (fullScreen) {\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-ds-canvas/80 backdrop-blur-sm\">\n {content}\n </div>\n );\n }\n\n if (overlay) {\n return (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-ds-canvas/70 backdrop-blur-sm rounded-inherit\">\n {content}\n </div>\n );\n }\n\n return content;\n}\n\n// Export individual components for direct use\nexport { Spinner, Dots, Pulse, Bars, Ring, Bounce, Wave, Skeleton };\n"],"mappings":";;;;AAuCA,IAAM,UAAoE;CACxE,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,I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,OACH,QAAO,iBAAA,GAAA,kBAAA,KAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,WACH,QACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;IACE,OAAO;IACP,QAAQ;IACR,SAAS;IACT,CAAA;GAEN,QACE,QAAO,iBAAA,GAAA,kBAAA,KAAC,SAAD;IAAe;IAAa;IAAS,CAAA;;;CAIlD,MAAM,UACJ,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,WAAW,4BACT,iBAAiB,WAAW,mBAAmB,iBAChD,GAAG;YAHN,CAKG,cAAc,EACd,QACC,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAW,GAAG,QAAQ,MAAM,KAAK;aACpC;GACI,CAAA,CAEL;;AAGR,KAAI,WACF,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;YACZ;EACG,CAAA;AAIV,KAAI,QACF,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;YACZ;EACG,CAAA;AAIV,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"loading-Dtosnb4A.mjs","names":[],"sources":["../../src/components/data-display/loading/Loading.tsx"],"sourcesContent":["import { LoaderIcon, RingLoaderIcon } from \"../../icons\";\n\nexport type LoadingVariant =\n | \"spinner\"\n | \"dots\"\n | \"pulse\"\n | \"bars\"\n | \"ring\"\n | \"bounce\"\n | \"wave\"\n | \"skeleton\";\n\nexport type LoadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface LoadingProps {\n /** The variant/style of the loading indicator */\n variant?: LoadingVariant;\n /** Size of the loading indicator */\n size?: LoadingSize;\n /** Custom color for the loading indicator */\n color?: string;\n /** Text to display alongside the loading indicator */\n text?: string;\n /** Position of the text relative to the indicator */\n textPosition?: \"right\" | \"bottom\";\n /** Whether to show as a full-screen overlay */\n fullScreen?: boolean;\n /** Whether to show as an overlay within parent container */\n overlay?: boolean;\n /** Custom className */\n className?: string;\n /** Skeleton specific: width */\n skeletonWidth?: string;\n /** Skeleton specific: height */\n skeletonHeight?: string;\n /** Skeleton specific: rounded style */\n skeletonRounded?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n}\n\nconst sizeMap: Record<LoadingSize, { container: string; text: string }> = {\n xs: { container: \"w-4 h-4\", text: \"text-xs\" },\n sm: { container: \"w-6 h-6\", text: \"text-sm\" },\n md: { container: \"w-8 h-8\", text: \"text-sm\" },\n lg: { container: \"w-12 h-12\", text: \"text-base\" },\n xl: { container: \"w-16 h-16\", text: \"text-lg\" },\n};\n\n// Spinner - Classic rotating circle\nfunction Spinner({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n return (\n <LoaderIcon\n className={`animate-spin ${sizeMap[size].container}`}\n color={color}\n aria-hidden=\"true\"\n />\n );\n}\n\n// Dots - Three bouncing dots\nfunction Dots({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const dotSize = {\n xs: \"w-1.5 h-1.5\",\n sm: \"w-2 h-2\",\n md: \"w-2.5 h-2.5\",\n lg: \"w-3 h-3\",\n xl: \"w-4 h-4\",\n };\n\n return (\n <div className=\"flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n className={`${dotSize[size]} rounded-full animate-bounce`}\n style={{\n backgroundColor: color,\n animationDelay: `${i * 0.15}s`,\n animationDuration: \"0.6s\",\n }}\n />\n ))}\n </div>\n );\n}\n\n// Pulse - Pulsing circle\nfunction Pulse({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n return (\n <div className={`relative ${sizeMap[size].container}`}>\n <div\n className=\"absolute inset-0 rounded-full animate-ping opacity-75\"\n style={{ backgroundColor: color }}\n />\n <div\n className=\"absolute inset-2 rounded-full\"\n style={{ backgroundColor: color }}\n />\n </div>\n );\n}\n\n// Bars - Audio-style animated bars\nfunction Bars({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const barWidth = {\n xs: \"w-0.5\",\n sm: \"w-1\",\n md: \"w-1.5\",\n lg: \"w-2\",\n xl: \"w-2.5\",\n };\n\n return (\n <div className={`flex items-end gap-0.5 ${sizeMap[size].container}`}>\n {[0, 1, 2, 3, 4].map((i) => (\n <div\n key={i}\n className={`${barWidth[size]} rounded-sm`}\n style={{\n backgroundColor: color,\n animation: \"loading-bars 1s ease-in-out infinite\",\n animationDelay: `${i * 0.1}s`,\n height: \"40%\",\n }}\n />\n ))}\n <style>{`\n @keyframes loading-bars {\n 0%, 100% { height: 40%; }\n 50% { height: 100%; }\n }\n `}</style>\n </div>\n );\n}\n\n// Ring - Rotating ring with gradient\nfunction Ring({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const strokeWidth = {\n xs: 3,\n sm: 3,\n md: 4,\n lg: 4,\n xl: 5,\n };\n\n return (\n <RingLoaderIcon\n className={`animate-spin ${sizeMap[size].container}`}\n color={color}\n strokeWidth={strokeWidth[size]}\n aria-hidden=\"true\"\n />\n );\n}\n\n// Bounce - Three bouncing circles\nfunction Bounce({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const dotSize = {\n xs: \"w-2 h-2\",\n sm: \"w-3 h-3\",\n md: \"w-4 h-4\",\n lg: \"w-5 h-5\",\n xl: \"w-6 h-6\",\n };\n\n return (\n <div className=\"flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n className={`${dotSize[size]} rounded-full`}\n style={{\n backgroundColor: color,\n animation: \"loading-bounce 1.4s ease-in-out infinite both\",\n animationDelay: `${i * 0.16}s`,\n }}\n />\n ))}\n <style>{`\n @keyframes loading-bounce {\n 0%, 80%, 100% { transform: scale(0); }\n 40% { transform: scale(1); }\n }\n `}</style>\n </div>\n );\n}\n\n// Wave - Wave animation\nfunction Wave({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const barHeight = {\n xs: \"h-3\",\n sm: \"h-4\",\n md: \"h-6\",\n lg: \"h-8\",\n xl: \"h-10\",\n };\n const barWidth = {\n xs: \"w-0.5\",\n sm: \"w-1\",\n md: \"w-1\",\n lg: \"w-1.5\",\n xl: \"w-2\",\n };\n\n return (\n <div className=\"flex items-center gap-0.5\">\n {[0, 1, 2, 3, 4].map((i) => (\n <div\n key={i}\n className={`${barWidth[size]} ${barHeight[size]} rounded-full`}\n style={{\n backgroundColor: color,\n animation: \"loading-wave 1.2s ease-in-out infinite\",\n animationDelay: `${i * 0.1}s`,\n }}\n />\n ))}\n <style>{`\n @keyframes loading-wave {\n 0%, 40%, 100% { transform: scaleY(0.4); }\n 20% { transform: scaleY(1); }\n }\n `}</style>\n </div>\n );\n}\n\n// Skeleton - Loading placeholder\nfunction Skeleton({\n width = \"100%\",\n height = \"1rem\",\n rounded = \"md\",\n}: {\n width?: string;\n height?: string;\n rounded?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n}) {\n const roundedMap = {\n none: \"\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\",\n };\n\n return (\n <div\n className={`animate-pulse bg-ds-surface-3 ${roundedMap[rounded]}`}\n style={{ width, height }}\n />\n );\n}\n\nexport default function Loading({\n variant = \"spinner\",\n size = \"md\",\n color = \"var(--ds-color-accent)\",\n text,\n textPosition = \"right\",\n fullScreen = false,\n overlay = false,\n className = \"\",\n skeletonWidth,\n skeletonHeight,\n skeletonRounded = \"md\",\n}: LoadingProps) {\n const renderLoader = () => {\n switch (variant) {\n case \"spinner\":\n return <Spinner size={size} color={color} />;\n case \"dots\":\n return <Dots size={size} color={color} />;\n case \"pulse\":\n return <Pulse size={size} color={color} />;\n case \"bars\":\n return <Bars size={size} color={color} />;\n case \"ring\":\n return <Ring size={size} color={color} />;\n case \"bounce\":\n return <Bounce size={size} color={color} />;\n case \"wave\":\n return <Wave size={size} color={color} />;\n case \"skeleton\":\n return (\n <Skeleton\n width={skeletonWidth}\n height={skeletonHeight}\n rounded={skeletonRounded}\n />\n );\n default:\n return <Spinner size={size} color={color} />;\n }\n };\n\n const content = (\n <div\n className={`inline-flex items-center ${\n textPosition === \"bottom\" ? \"flex-col gap-2\" : \"flex-row gap-3\"\n } ${className}`}\n >\n {renderLoader()}\n {text && (\n <span className={`${sizeMap[size].text} text-ds-2 font-medium`}>\n {text}\n </span>\n )}\n </div>\n );\n\n if (fullScreen) {\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-ds-canvas/80 backdrop-blur-sm\">\n {content}\n </div>\n );\n }\n\n if (overlay) {\n return (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-ds-canvas/70 backdrop-blur-sm rounded-inherit\">\n {content}\n </div>\n );\n }\n\n return content;\n}\n\n// Export individual components for direct use\nexport { Spinner, Dots, Pulse, Bars, Ring, Bounce, Wave, Skeleton };\n"],"mappings":";;;AAuCA,IAAM,UAAoE;CACxE,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAa,MAAM;EAAa;CACjD,IAAI;EAAE,WAAW;EAAa,MAAM;EAAW;CAChD;AAGD,SAAS,QAAQ,EACf,OAAO,MACP,QAAQ,kBAIP;AACD,QACE,oBAAC,YAAD;EACE,WAAW,gBAAgB,QAAQ,MAAM;EAClC;EACP,eAAY;EACZ,CAAA;;AAKN,SAAS,KAAK,EACZ,OAAO,MACP,QAAQ,kBAIP;CACD,MAAM,UAAU;EACd,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL;AAED,QACE,oBAAC,OAAD;EAAK,WAAU;YACZ;GAAC;GAAG;GAAG;GAAE,CAAC,KAAK,MACd,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D;IAAe;IAAa;IAAS,CAAA;GAC9C,KAAK,OACH,QAAO,oBAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,QACH,QAAO,oBAAC,OAAD;IAAa;IAAa;IAAS,CAAA;GAC5C,KAAK,OACH,QAAO,oBAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,OACH,QAAO,oBAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,SACH,QAAO,oBAAC,QAAD;IAAc;IAAa;IAAS,CAAA;GAC7C,KAAK,OACH,QAAO,oBAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,WACH,QACE,oBAAC,UAAD;IACE,OAAO;IACP,QAAQ;IACR,SAAS;IACT,CAAA;GAEN,QACE,QAAO,oBAAC,SAAD;IAAe;IAAa;IAAS,CAAA;;;CAIlD,MAAM,UACJ,qBAAC,OAAD;EACE,WAAW,4BACT,iBAAiB,WAAW,mBAAmB,iBAChD,GAAG;YAHN,CAKG,cAAc,EACd,QACC,oBAAC,QAAD;GAAM,WAAW,GAAG,QAAQ,MAAM,KAAK;aACpC;GACI,CAAA,CAEL;;AAGR,KAAI,WACF,QACE,oBAAC,OAAD;EAAK,WAAU;YACZ;EACG,CAAA;AAIV,KAAI,QACF,QACE,oBAAC,OAAD;EAAK,WAAU;YACZ;EACG,CAAA;AAIV,QAAO"}
1
+ {"version":3,"file":"loading-Dtosnb4A.mjs","names":[],"sources":["../../src/components/data-display/loading/Loading.tsx"],"sourcesContent":["import { LoaderIcon, RingLoaderIcon } from \"../../icons\";\n\nexport type LoadingVariant =\n | \"spinner\"\n | \"dots\"\n | \"pulse\"\n | \"bars\"\n | \"ring\"\n | \"bounce\"\n | \"wave\"\n | \"skeleton\";\n\nexport type LoadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface LoadingProps {\n /** The variant/style of the loading indicator */\n variant?: LoadingVariant;\n /** Size of the loading indicator */\n size?: LoadingSize;\n /** Custom color for the loading indicator */\n color?: string;\n /** Text to display alongside the loading indicator */\n text?: string;\n /** Position of the text relative to the indicator */\n textPosition?: \"right\" | \"bottom\";\n /** Whether to show as a full-screen overlay */\n fullScreen?: boolean;\n /** Whether to show as an overlay within parent container */\n overlay?: boolean;\n /** Custom className */\n className?: string;\n /** Skeleton specific: width */\n skeletonWidth?: string;\n /** Skeleton specific: height */\n skeletonHeight?: string;\n /** Skeleton specific: rounded style */\n skeletonRounded?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n}\n\nconst sizeMap: Record<LoadingSize, { container: string; text: string }> = {\n xs: { container: \"w-4 h-4\", text: \"text-xs\" },\n sm: { container: \"w-6 h-6\", text: \"text-sm\" },\n md: { container: \"w-8 h-8\", text: \"text-sm\" },\n lg: { container: \"w-12 h-12\", text: \"text-base\" },\n xl: { container: \"w-16 h-16\", text: \"text-lg\" },\n};\n\n// Spinner - Classic rotating circle\nfunction Spinner({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n return (\n <LoaderIcon\n className={`animate-spin ${sizeMap[size].container}`}\n color={color}\n aria-hidden=\"true\"\n />\n );\n}\n\n// Dots - Three bouncing dots\nfunction Dots({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const dotSize = {\n xs: \"w-1.5 h-1.5\",\n sm: \"w-2 h-2\",\n md: \"w-2.5 h-2.5\",\n lg: \"w-3 h-3\",\n xl: \"w-4 h-4\",\n };\n\n return (\n <div className=\"flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n className={`${dotSize[size]} rounded-full animate-bounce`}\n style={{\n backgroundColor: color,\n animationDelay: `${i * 0.15}s`,\n animationDuration: \"0.6s\",\n }}\n />\n ))}\n </div>\n );\n}\n\n// Pulse - Pulsing circle\nfunction Pulse({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n return (\n <div className={`relative ${sizeMap[size].container}`}>\n <div\n className=\"absolute inset-0 rounded-full animate-ping opacity-75\"\n style={{ backgroundColor: color }}\n />\n <div\n className=\"absolute inset-2 rounded-full\"\n style={{ backgroundColor: color }}\n />\n </div>\n );\n}\n\n// Bars - Audio-style animated bars\nfunction Bars({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const barWidth = {\n xs: \"w-0.5\",\n sm: \"w-1\",\n md: \"w-1.5\",\n lg: \"w-2\",\n xl: \"w-2.5\",\n };\n\n return (\n <div className={`flex items-end gap-0.5 ${sizeMap[size].container}`}>\n {[0, 1, 2, 3, 4].map((i) => (\n <div\n key={i}\n className={`${barWidth[size]} rounded-sm`}\n style={{\n backgroundColor: color,\n animation: \"loading-bars 1s ease-in-out infinite\",\n animationDelay: `${i * 0.1}s`,\n height: \"40%\",\n }}\n />\n ))}\n <style>{`\n @keyframes loading-bars {\n 0%, 100% { height: 40%; }\n 50% { height: 100%; }\n }\n `}</style>\n </div>\n );\n}\n\n// Ring - Rotating ring with gradient\nfunction Ring({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const strokeWidth = {\n xs: 3,\n sm: 3,\n md: 4,\n lg: 4,\n xl: 5,\n };\n\n return (\n <RingLoaderIcon\n className={`animate-spin ${sizeMap[size].container}`}\n color={color}\n strokeWidth={strokeWidth[size]}\n aria-hidden=\"true\"\n />\n );\n}\n\n// Bounce - Three bouncing circles\nfunction Bounce({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const dotSize = {\n xs: \"w-2 h-2\",\n sm: \"w-3 h-3\",\n md: \"w-4 h-4\",\n lg: \"w-5 h-5\",\n xl: \"w-6 h-6\",\n };\n\n return (\n <div className=\"flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n className={`${dotSize[size]} rounded-full`}\n style={{\n backgroundColor: color,\n animation: \"loading-bounce 1.4s ease-in-out infinite both\",\n animationDelay: `${i * 0.16}s`,\n }}\n />\n ))}\n <style>{`\n @keyframes loading-bounce {\n 0%, 80%, 100% { transform: scale(0); }\n 40% { transform: scale(1); }\n }\n `}</style>\n </div>\n );\n}\n\n// Wave - Wave animation\nfunction Wave({\n size = \"md\",\n color = \"currentColor\",\n}: {\n size?: LoadingSize;\n color?: string;\n}) {\n const barHeight = {\n xs: \"h-3\",\n sm: \"h-4\",\n md: \"h-6\",\n lg: \"h-8\",\n xl: \"h-10\",\n };\n const barWidth = {\n xs: \"w-0.5\",\n sm: \"w-1\",\n md: \"w-1\",\n lg: \"w-1.5\",\n xl: \"w-2\",\n };\n\n return (\n <div className=\"flex items-center gap-0.5\">\n {[0, 1, 2, 3, 4].map((i) => (\n <div\n key={i}\n className={`${barWidth[size]} ${barHeight[size]} rounded-full`}\n style={{\n backgroundColor: color,\n animation: \"loading-wave 1.2s ease-in-out infinite\",\n animationDelay: `${i * 0.1}s`,\n }}\n />\n ))}\n <style>{`\n @keyframes loading-wave {\n 0%, 40%, 100% { transform: scaleY(0.4); }\n 20% { transform: scaleY(1); }\n }\n `}</style>\n </div>\n );\n}\n\n// Skeleton - Loading placeholder\nfunction Skeleton({\n width = \"100%\",\n height = \"1rem\",\n rounded = \"md\",\n}: {\n width?: string;\n height?: string;\n rounded?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n}) {\n const roundedMap = {\n none: \"\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\",\n };\n\n return (\n <div\n className={`animate-pulse bg-ds-surface-3 ${roundedMap[rounded]}`}\n style={{ width, height }}\n />\n );\n}\n\nexport default function Loading({\n variant = \"spinner\",\n size = \"md\",\n color = \"var(--ds-color-accent)\",\n text,\n textPosition = \"right\",\n fullScreen = false,\n overlay = false,\n className = \"\",\n skeletonWidth,\n skeletonHeight,\n skeletonRounded = \"md\",\n}: LoadingProps) {\n const renderLoader = () => {\n switch (variant) {\n case \"spinner\":\n return <Spinner size={size} color={color} />;\n case \"dots\":\n return <Dots size={size} color={color} />;\n case \"pulse\":\n return <Pulse size={size} color={color} />;\n case \"bars\":\n return <Bars size={size} color={color} />;\n case \"ring\":\n return <Ring size={size} color={color} />;\n case \"bounce\":\n return <Bounce size={size} color={color} />;\n case \"wave\":\n return <Wave size={size} color={color} />;\n case \"skeleton\":\n return (\n <Skeleton\n width={skeletonWidth}\n height={skeletonHeight}\n rounded={skeletonRounded}\n />\n );\n default:\n return <Spinner size={size} color={color} />;\n }\n };\n\n const content = (\n <div\n className={`inline-flex items-center ${\n textPosition === \"bottom\" ? \"flex-col gap-2\" : \"flex-row gap-3\"\n } ${className}`}\n >\n {renderLoader()}\n {text && (\n <span className={`${sizeMap[size].text} text-ds-2 font-medium`}>\n {text}\n </span>\n )}\n </div>\n );\n\n if (fullScreen) {\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-ds-canvas/80 backdrop-blur-sm\">\n {content}\n </div>\n );\n }\n\n if (overlay) {\n return (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-ds-canvas/70 backdrop-blur-sm rounded-inherit\">\n {content}\n </div>\n );\n }\n\n return content;\n}\n\n// Export individual components for direct use\nexport { Spinner, Dots, Pulse, Bars, Ring, Bounce, Wave, Skeleton };\n"],"mappings":";;;AAuCA,IAAM,UAAoE;CACxE,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAW,MAAM;EAAW;CAC7C,IAAI;EAAE,WAAW;EAAa,MAAM;EAAa;CACjD,IAAI;EAAE,WAAW;EAAa,MAAM;EAAW;CAChD;AAGD,SAAS,QAAQ,EACf,OAAO,MACP,QAAQ,kBAIP;AACD,QACE,oBAAC,YAAD;EACE,WAAW,gBAAgB,QAAQ,MAAM;EAClC;EACP,eAAY;EACZ,CAAA;;AAKN,SAAS,KA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AAwB,QAAQ,EAC9B,UAAU,WACV,OAAO,MACP,QAAQ,0BACR,MACA,eAAe,SACf,aAAa,OACb,UAAU,OACV,YAAY,IACZ,eACA,gBACA,kBAAkB,QACH;CACf,MAAM,qBAAqB;AACzB,UAAQ,SAAR;GACE,KAAK,UACH,QAAO,oBAAC,SAAD;IAAe;IAAa;IAAS,CAAA;GAC9C,KAAK,OACH,QAAO,oBAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,QACH,QAAO,oBAAC,OAAD;IAAa;IAAa;IAAS,CAAA;GAC5C,KAAK,OACH,QAAO,oBAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,OACH,QAAO,oBAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,SACH,QAAO,oBAAC,QAAD;IAAc;IAAa;IAAS,CAAA;GAC7C,KAAK,OACH,QAAO,oBAAC,MAAD;IAAY;IAAa;IAAS,CAAA;GAC3C,KAAK,WACH,QACE,oBAAC,UAAD;IACE,OAAO;IACP,QAAQ;IACR,SAAS;IACT,CAAA;GAEN,QACE,QAAO,oBAAC,SAAD;IAAe;IAAa;IAAS,CAAA;;;CAIlD,MAAM,UACJ,qBAAC,OAAD;EACE,WAAW,4BACT,iBAAiB,WAAW,mBAAmB,iBAChD,GAAG;YAHN,CAKG,cAAc,EACd,QACC,oBAAC,QAAD;GAAM,WAAW,GAAG,QAAQ,MAAM,KAAK;aACpC;GACI,CAAA,CAEL;;AAGR,KAAI,WACF,QACE,oBAAC,OAAD;EAAK,WAAU;YACZ;EACG,CAAA;AAIV,KAAI,QACF,QACE,oBAAC,OAAD;EAAK,WAAU;YACZ;EACG,CAAA;AAIV,QAAO"}
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-B_GkZjkl.cjs");
2
- const require_utils = require("./utils-B4SmmY4J.cjs");
2
+ const require_utils = require("./utils-LRbEQHYs.cjs");
3
3
  const require_icons = require("./icons-CRanVZB1.cjs");
4
- const require_DropdownMenu = require("./DropdownMenu-DOvo5pV_.cjs");
4
+ const require_DropdownMenu = require("./DropdownMenu-BDrNYO-D.cjs");
5
5
  let react = require("react");
6
6
  react = require_chunk.__toESM(react, 1);
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -37,7 +37,7 @@ var MultiSelectCombobox = ({ options, value = [], onChange, placeholder = "Selec
37
37
  if (!nextOpen) setSearch("");
38
38
  },
39
39
  animationClassName: "origin-top-left",
40
- panelClassName: "top-[40px] left-0 z-20 mt-1 flex max-h-60 flex-col rounded-lg border border-ds-border-2 bg-ds-surface-1 shadow-3 backdrop-blur-xl transition",
40
+ panelClassName: "top-[40px] start-0 z-20 mt-1 flex w-full max-h-60 flex-col rounded-lg border border-ds-border-2 bg-ds-surface-1 shadow-3 backdrop-blur-xl transition",
41
41
  trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
42
42
  style: { backgroundImage: framer_motion.useMotionTemplate`
43
43
  radial-gradient(
@@ -60,7 +60,7 @@ var MultiSelectCombobox = ({ options, value = [], onChange, placeholder = "Selec
60
60
  type: "button",
61
61
  onMouseDown: (e) => e.stopPropagation(),
62
62
  onClick: (e) => handleRemoveTag(value[index], e),
63
- className: "ml-0.5 rounded-full p-0.5 text-ds-2 transition-colors hover:bg-ds-surface-1 hover:text-ds-1",
63
+ className: "ms-0.5 rounded-full p-0.5 text-ds-2 transition-colors hover:bg-ds-surface-1 hover:text-ds-1",
64
64
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons.CloseIcon, {
65
65
  className: "h-3 w-3",
66
66
  "aria-hidden": "true"
@@ -71,7 +71,7 @@ var MultiSelectCombobox = ({ options, value = [], onChange, placeholder = "Selec
71
71
  children: placeholder
72
72
  })
73
73
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
74
- className: require_utils.mergeClassNames("ml-2 shrink-0 text-ds-2 transition-transform duration-300", open ? "rotate-180" : "rotate-0"),
74
+ className: require_utils.mergeClassNames("ms-2 shrink-0 text-ds-2 transition-transform duration-300", open ? "rotate-180" : "rotate-0"),
75
75
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons.ChevronDownIcon, {
76
76
  width: 24,
77
77
  height: 24,
@@ -124,4 +124,4 @@ Object.defineProperty(exports, "MultiSelectCombobox", {
124
124
  }
125
125
  });
126
126
 
127
- //# sourceMappingURL=multi-select-combobox-BzqYLVpV.cjs.map
127
+ //# sourceMappingURL=multi-select-combobox-C0DoDzxQ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-select-combobox-C0DoDzxQ.cjs","names":[],"sources":["../../src/components/forms/multi-select-combobox/MultiSelectCombobox.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { motion, useMotionTemplate, useMotionValue } from \"framer-motion\";\n\nimport { CheckIcon, ChevronDownIcon, CloseIcon } from \"../../icons\";\nimport { DropdownMenu } from \"../../overlays/dropdown-menu\";\nimport { mergeClassNames } from \"../../../utils\";\n\nexport interface MultiSelectOption {\n label: string;\n value: string;\n}\n\nexport interface MultiSelectComboboxProps {\n options: MultiSelectOption[];\n value: string[];\n onChange: (values: string[]) => void;\n placeholder?: string;\n searchPlaceholder?: string;\n noOptionsText?: string;\n className?: string;\n bgClassName?: string;\n}\n\nconst MultiSelectCombobox: React.FC<MultiSelectComboboxProps> = ({\n options,\n value = [],\n onChange,\n placeholder = \"Select...\",\n searchPlaceholder = \"Type to search...\",\n noOptionsText = \"No options found\",\n className,\n bgClassName = \"bg-ds-surface-1\",\n}) => {\n const [open, setOpen] = useState(false);\n const [search, setSearch] = useState(\"\");\n const [visible, setVisible] = useState(false);\n const mouseX = useMotionValue(0);\n const mouseY = useMotionValue(0);\n const radius = 100;\n\n // Filter options by search\n const filteredOptions = options.filter((opt) =>\n opt.label.toLowerCase().includes(search.toLowerCase()),\n );\n\n const handleMouseMove = (event: React.MouseEvent<HTMLDivElement>) => {\n const { left, top } = event.currentTarget.getBoundingClientRect();\n mouseX.set(event.clientX - left);\n mouseY.set(event.clientY - top);\n };\n\n const handleOptionClick = (optionValue: string) => {\n if (value.includes(optionValue)) {\n onChange(value.filter((v) => v !== optionValue));\n } else {\n onChange([...value, optionValue]);\n }\n };\n\n const handleRemoveTag = (optionValue: string, e: React.MouseEvent) => {\n e.stopPropagation();\n onChange(value.filter((v) => v !== optionValue));\n };\n\n const selectedLabels = value\n .map((v) => options.find((opt) => opt.value === v)?.label)\n .filter(Boolean);\n\n return (\n <DropdownMenu\n className={mergeClassNames(\"w-full\", className)}\n open={open}\n onOpenChange={(nextOpen) => {\n setOpen(nextOpen);\n if (!nextOpen) {\n setSearch(\"\");\n }\n }}\n animationClassName=\"origin-top-left\"\n panelClassName=\"top-[40px] start-0 z-20 mt-1 flex w-full max-h-60 flex-col rounded-lg border border-ds-border-2 bg-ds-surface-1 shadow-3 backdrop-blur-xl transition\"\n trigger={\n <motion.div\n style={{\n backgroundImage: useMotionTemplate`\n radial-gradient(\n ${visible ? `${radius}px` : \"0px\"} circle at ${mouseX}px ${mouseY}px,\n var(--ds-color-accent),\n transparent 90%\n )\n `,\n }}\n onMouseMove={handleMouseMove}\n onMouseEnter={() => setVisible(true)}\n onMouseLeave={() => setVisible(false)}\n className=\"group/multi-combobox w-full rounded-lg border-ds-border-2 p-[2px] transition duration-300 hover:border-ds-border-accent\"\n >\n <div\n className={mergeClassNames(\n \"flex min-h-10 w-full cursor-pointer items-center justify-between rounded-md border border-ds-border-field px-3 py-2 text-sm text-ds-1 transition duration-400 ease-in-out group-hover/multi-combobox:shadow-none\",\n bgClassName,\n )}\n >\n <div className=\"flex flex-1 flex-wrap gap-1\">\n {selectedLabels.length > 0 ? (\n selectedLabels.map((label, index) => (\n <span\n key={value[index]}\n className=\"inline-flex items-center gap-1 rounded-md border border-ds-border-field bg-ds-surface-2 px-2 py-0.5 text-xs font-medium text-ds-1\"\n >\n {label}\n <button\n type=\"button\"\n onMouseDown={(e) => e.stopPropagation()}\n onClick={(e) => handleRemoveTag(value[index], e)}\n className=\"ms-0.5 rounded-full p-0.5 text-ds-2 transition-colors hover:bg-ds-surface-1 hover:text-ds-1\"\n >\n <CloseIcon className=\"h-3 w-3\" aria-hidden=\"true\" />\n </button>\n </span>\n ))\n ) : (\n <span className=\"text-ds-2\">{placeholder}</span>\n )}\n </div>\n <span\n className={mergeClassNames(\n \"ms-2 shrink-0 text-ds-2 transition-transform duration-300\",\n open ? \"rotate-180\" : \"rotate-0\",\n )}\n >\n <ChevronDownIcon\n width={24}\n height={24}\n color=\"currentColor\"\n className=\"h-5 w-5\"\n />\n </span>\n </div>\n </motion.div>\n }\n >\n {/* Sticky search input */}\n <div className=\"sticky top-0 z-10 rounded-t-lg border-b border-ds-border-2/30 bg-ds-surface-1/95 backdrop-blur-sm\">\n <input\n autoFocus\n className=\"w-full rounded-t-lg bg-transparent px-3 py-2 text-sm text-ds-1 outline-none placeholder:text-ds-2 focus-visible:ring-2 focus-visible:ring-ds-focus/30\"\n placeholder={searchPlaceholder}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n onClick={(e) => e.stopPropagation()}\n />\n </div>\n {/* Scrollable options */}\n <div className=\"max-h-80 flex-1 overflow-auto\">\n {filteredOptions.length === 0 && (\n <div className=\"p-3 text-center text-sm text-ds-2\">\n {noOptionsText}\n </div>\n )}\n {filteredOptions.map((option) => {\n const isSelected = value.includes(option.value);\n return (\n <div\n key={option.value}\n className={mergeClassNames(\n \"flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition\",\n isSelected\n ? \"bg-ds-surface-2 text-ds-1\"\n : \"text-ds-1 hover:bg-ds-surface-2 hover:text-ds-1\",\n )}\n onClick={() => handleOptionClick(option.value)}\n >\n <span\n className={mergeClassNames(\n \"flex h-4 w-4 items-center justify-center rounded border transition\",\n isSelected\n ? \"border-ds-border-accent bg-ds-accent text-ds-on-accent\"\n : \"border-ds-border-2\",\n )}\n >\n {isSelected && <CheckIcon width={12} height={12} />}\n </span>\n <span className=\"flex-1\">{option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OAAO;IACP,WAAW,MAAM,UAAU,EAAE,OAAO,MAAM;IAC1C,UAAU,MAAM,EAAE,iBAAiB;IACnC,CAAA;GACE,CAAA,EAEN,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;aAAf,CACG,gBAAgB,WAAW,KAC1B,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,WAAU;cACZ;IACG,CAAA,EAEP,gBAAgB,KAAK,WAAW;IAC/B,MAAM,aAAa,MAAM,SAAS,OAAO,MAAM;AAC/C,WACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;KAEE,WAAW,cAAA,gBACT,uEACA,aACI,8BACA,kDACL;KACD,eAAe,kBAAkB,OAAO,MAAM;eARhD,CAUE,iBAAA,GAAA,kBAAA,KAAC,QAAD;MACE,WAAW,cAAA,gBACT,sEACA,aACI,2DACA,qBACL;gBAEA,cAAc,iBAAA,GAAA,kBAAA,KAAC,cAAA,WAAD;OAAW,OAAO;OAAI,QAAQ;OAAM,CAAA;MAC9C,CAAA,EACP,iBAAA,GAAA,kBAAA,KAAC,QAAD;MAAM,WAAU;gBAAU,OAAO;MAAa,CAAA,CAC1C;OApBC,OAAO,MAoBR;KAER,CACE;KACO"}
@@ -1,6 +1,6 @@
1
- import { n as mergeClassNames } from "./utils-ati1KkDb.mjs";
1
+ import { n as mergeClassNames } from "./utils-7S0u48mU.mjs";
2
2
  import { J as CheckIcon, N as ChevronDownIcon, q as CloseIcon } from "./icons-bx3nrxNv.mjs";
3
- import { t as DropdownMenu } from "./DropdownMenu-C17Zqu_E.mjs";
3
+ import { t as DropdownMenu } from "./DropdownMenu-BtTOri-A.mjs";
4
4
  import { useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { motion, useMotionTemplate, useMotionValue } from "framer-motion";
@@ -35,7 +35,7 @@ var MultiSelectCombobox = ({ options, value = [], onChange, placeholder = "Selec
35
35
  if (!nextOpen) setSearch("");
36
36
  },
37
37
  animationClassName: "origin-top-left",
38
- panelClassName: "top-[40px] left-0 z-20 mt-1 flex max-h-60 flex-col rounded-lg border border-ds-border-2 bg-ds-surface-1 shadow-3 backdrop-blur-xl transition",
38
+ panelClassName: "top-[40px] start-0 z-20 mt-1 flex w-full max-h-60 flex-col rounded-lg border border-ds-border-2 bg-ds-surface-1 shadow-3 backdrop-blur-xl transition",
39
39
  trigger: /* @__PURE__ */ jsx(motion.div, {
40
40
  style: { backgroundImage: useMotionTemplate`
41
41
  radial-gradient(
@@ -58,7 +58,7 @@ var MultiSelectCombobox = ({ options, value = [], onChange, placeholder = "Selec
58
58
  type: "button",
59
59
  onMouseDown: (e) => e.stopPropagation(),
60
60
  onClick: (e) => handleRemoveTag(value[index], e),
61
- className: "ml-0.5 rounded-full p-0.5 text-ds-2 transition-colors hover:bg-ds-surface-1 hover:text-ds-1",
61
+ className: "ms-0.5 rounded-full p-0.5 text-ds-2 transition-colors hover:bg-ds-surface-1 hover:text-ds-1",
62
62
  children: /* @__PURE__ */ jsx(CloseIcon, {
63
63
  className: "h-3 w-3",
64
64
  "aria-hidden": "true"
@@ -69,7 +69,7 @@ var MultiSelectCombobox = ({ options, value = [], onChange, placeholder = "Selec
69
69
  children: placeholder
70
70
  })
71
71
  }), /* @__PURE__ */ jsx("span", {
72
- className: mergeClassNames("ml-2 shrink-0 text-ds-2 transition-transform duration-300", open ? "rotate-180" : "rotate-0"),
72
+ className: mergeClassNames("ms-2 shrink-0 text-ds-2 transition-transform duration-300", open ? "rotate-180" : "rotate-0"),
73
73
  children: /* @__PURE__ */ jsx(ChevronDownIcon, {
74
74
  width: 24,
75
75
  height: 24,
@@ -117,4 +117,4 @@ var MultiSelectCombobox = ({ options, value = [], onChange, placeholder = "Selec
117
117
  //#endregion
118
118
  export { MultiSelectCombobox as t };
119
119
 
120
- //# sourceMappingURL=multi-select-combobox-BrFtvCrS.mjs.map
120
+ //# sourceMappingURL=multi-select-combobox-Do23ZfOQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-select-combobox-Do23ZfOQ.mjs","names":[],"sources":["../../src/components/forms/multi-select-combobox/MultiSelectCombobox.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { motion, useMotionTemplate, useMotionValue } from \"framer-motion\";\n\nimport { CheckIcon, ChevronDownIcon, CloseIcon } from \"../../icons\";\nimport { DropdownMenu } from \"../../overlays/dropdown-menu\";\nimport { mergeClassNames } from \"../../../utils\";\n\nexport interface MultiSelectOption {\n label: string;\n value: string;\n}\n\nexport interface MultiSelectComboboxProps {\n options: MultiSelectOption[];\n value: string[];\n onChange: (values: string[]) => void;\n placeholder?: string;\n searchPlaceholder?: string;\n noOptionsText?: string;\n className?: string;\n bgClassName?: string;\n}\n\nconst MultiSelectCombobox: React.FC<MultiSelectComboboxProps> = ({\n options,\n value = [],\n onChange,\n placeholder = \"Select...\",\n searchPlaceholder = \"Type to search...\",\n noOptionsText = \"No options found\",\n className,\n bgClassName = \"bg-ds-surface-1\",\n}) => {\n const [open, setOpen] = useState(false);\n const [search, setSearch] = useState(\"\");\n const [visible, setVisible] = useState(false);\n const mouseX = useMotionValue(0);\n const mouseY = useMotionValue(0);\n const radius = 100;\n\n // Filter options by search\n const filteredOptions = options.filter((opt) =>\n opt.label.toLowerCase().includes(search.toLowerCase()),\n );\n\n const handleMouseMove = (event: React.MouseEvent<HTMLDivElement>) => {\n const { left, top } = event.currentTarget.getBoundingClientRect();\n mouseX.set(event.clientX - left);\n mouseY.set(event.clientY - top);\n };\n\n const handleOptionClick = (optionValue: string) => {\n if (value.includes(optionValue)) {\n onChange(value.filter((v) => v !== optionValue));\n } else {\n onChange([...value, optionValue]);\n }\n };\n\n const handleRemoveTag = (optionValue: string, e: React.MouseEvent) => {\n e.stopPropagation();\n onChange(value.filter((v) => v !== optionValue));\n };\n\n const selectedLabels = value\n .map((v) => options.find((opt) => opt.value === v)?.label)\n .filter(Boolean);\n\n return (\n <DropdownMenu\n className={mergeClassNames(\"w-full\", className)}\n open={open}\n onOpenChange={(nextOpen) => {\n setOpen(nextOpen);\n if (!nextOpen) {\n setSearch(\"\");\n }\n }}\n animationClassName=\"origin-top-left\"\n panelClassName=\"top-[40px] start-0 z-20 mt-1 flex w-full max-h-60 flex-col rounded-lg border border-ds-border-2 bg-ds-surface-1 shadow-3 backdrop-blur-xl transition\"\n trigger={\n <motion.div\n style={{\n backgroundImage: useMotionTemplate`\n radial-gradient(\n ${visible ? `${radius}px` : \"0px\"} circle at ${mouseX}px ${mouseY}px,\n var(--ds-color-accent),\n transparent 90%\n )\n `,\n }}\n onMouseMove={handleMouseMove}\n onMouseEnter={() => setVisible(true)}\n onMouseLeave={() => setVisible(false)}\n className=\"group/multi-combobox w-full rounded-lg border-ds-border-2 p-[2px] transition duration-300 hover:border-ds-border-accent\"\n >\n <div\n className={mergeClassNames(\n \"flex min-h-10 w-full cursor-pointer items-center justify-between rounded-md border border-ds-border-field px-3 py-2 text-sm text-ds-1 transition duration-400 ease-in-out group-hover/multi-combobox:shadow-none\",\n bgClassName,\n )}\n >\n <div className=\"flex flex-1 flex-wrap gap-1\">\n {selectedLabels.length > 0 ? (\n selectedLabels.map((label, index) => (\n <span\n key={value[index]}\n className=\"inline-flex items-center gap-1 rounded-md border border-ds-border-field bg-ds-surface-2 px-2 py-0.5 text-xs font-medium text-ds-1\"\n >\n {label}\n <button\n type=\"button\"\n onMouseDown={(e) => e.stopPropagation()}\n onClick={(e) => handleRemoveTag(value[index], e)}\n className=\"ms-0.5 rounded-full p-0.5 text-ds-2 transition-colors hover:bg-ds-surface-1 hover:text-ds-1\"\n >\n <CloseIcon className=\"h-3 w-3\" aria-hidden=\"true\" />\n </button>\n </span>\n ))\n ) : (\n <span className=\"text-ds-2\">{placeholder}</span>\n )}\n </div>\n <span\n className={mergeClassNames(\n \"ms-2 shrink-0 text-ds-2 transition-transform duration-300\",\n open ? \"rotate-180\" : \"rotate-0\",\n )}\n >\n <ChevronDownIcon\n width={24}\n height={24}\n color=\"currentColor\"\n className=\"h-5 w-5\"\n />\n </span>\n </div>\n </motion.div>\n }\n >\n {/* Sticky search input */}\n <div className=\"sticky top-0 z-10 rounded-t-lg border-b border-ds-border-2/30 bg-ds-surface-1/95 backdrop-blur-sm\">\n <input\n autoFocus\n className=\"w-full rounded-t-lg bg-transparent px-3 py-2 text-sm text-ds-1 outline-none placeholder:text-ds-2 focus-visible:ring-2 focus-visible:ring-ds-focus/30\"\n placeholder={searchPlaceholder}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n onClick={(e) => e.stopPropagation()}\n />\n </div>\n {/* Scrollable options */}\n <div className=\"max-h-80 flex-1 overflow-auto\">\n {filteredOptions.length === 0 && (\n <div className=\"p-3 text-center text-sm text-ds-2\">\n {noOptionsText}\n </div>\n )}\n {filteredOptions.map((option) => {\n const isSelected = value.includes(option.value);\n return (\n <div\n key={option.value}\n className={mergeClassNames(\n \"flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition\",\n isSelected\n ? \"bg-ds-surface-2 text-ds-1\"\n : \"text-ds-1 hover:bg-ds-surface-2 hover:text-ds-1\",\n )}\n onClick={() => handleOptionClick(option.value)}\n >\n <span\n className={mergeClassNames(\n \"flex h-4 w-4 items-center justify-center rounded border transition\",\n isSelected\n ? \"border-ds-border-accent bg-ds-accent text-ds-on-accent\"\n : \"border-ds-border-2\",\n )}\n >\n {isSelected && <CheckIcon width={12} height={12} />}\n </span>\n <span className=\"flex-1\">{option.label}</span>\n </div>\n );\n })}\n </div>\n </DropdownMenu>\n );\n};\n\nexport default MultiSelectCombobox;\n"],"mappings":";;;;;;;AAuBA,IAAM,uBAA2D,EAC/D,SACA,QAAQ,EAAE,EACV,UACA,cAAc,aACd,oBAAoB,qBACpB,gBAAgB,oBAChB,WACA,cAAc,wBACV;CACJ,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CACvC,MAAM,CAAC,QAAQ,aAAa,SAAS,GAAG;CACxC,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAC7C,MAAM,SAAS,eAAe,EAAE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ACE,MAAK;OACL,cAAc,MAAM,EAAE,iBAAiB;OACvC,UAAU,MAAM,gBAAgB,MAAM,QAAQ,EAAE;OAChD,WAAU;iBAEV,oBAAC,WAAD;QAAW,WAAU;QAAU,eAAY;QAAS,CAAA;OAC7C,CAAA,CACJ;QAZA,MAAM,OAYN,CACP,GAEF,oBAAC,QAAD;MAAM,WAAU;gBAAa;MAAmB,CAAA;KAE9C,CAAA,EACN,oBAAC,QAAD;KACE,WAAW,gBACT,6DACA,OAAO,eAAe,WACvB;eAED,oBAAC,iBAAD;MACE,OAAO;MACP,QAAQ;MACR,OAAM;MACN,WAAU;MACV,CAAA;KACG,CAAA,CACH;;GACK,CAAA;YArEjB,CAyEE,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,SAAD;IACE,WAAA;IACA,WAAU;IACV,aAAa;IACb,OAAO;IACP,WAAW,MAAM,UAAU,EAAE,OAAO,MAAM;IAC1C,UAAU,MAAM,EAAE,iBAAiB;IACnC,CAAA;GACE,CAAA,EAEN,qBAAC,OAAD;GAAK,WAAU;aAAf,CACG,gBAAgB,WAAW,KAC1B,oBAAC,OAAD;IAAK,WAAU;cACZ;IACG,CAAA,EAEP,gBAAgB,KAAK,WAAW;IAC/B,MAAM,aAAa,MAAM,SAAS,OAAO,MAAM;AAC/C,WACE,qBAAC,OAAD;KAEE,WAAW,gBACT,uEACA,aACI,8BACA,kDACL;KACD,eAAe,kBAAkB,OAAO,MAAM;eARhD,CAUE,oBAAC,QAAD;MACE,WAAW,gBACT,sEACA,aACI,2DACA,qBACL;gBAEA,cAAc,oBAAC,WAAD;OAAW,OAAO;OAAI,QAAQ;OAAM,CAAA;MAC9C,CAAA,EACP,oBAAC,QAAD;MAAM,WAAU;gBAAU,OAAO;MAAa,CAAA,CAC1C;OApBC,OAAO,MAoBR;KAER,CACE;KACO"}
@@ -1 +1 @@
1
- {"version":3,"file":"otp-input-CkhV-sGl.cjs","names":[],"sources":["../../src/components/forms/otp-input/OTPInput.tsx"],"sourcesContent":["import {\n forwardRef,\n useState,\n useRef,\n useCallback,\n useEffect,\n type KeyboardEvent,\n type ClipboardEvent,\n type ChangeEvent,\n} from \"react\";\n\nexport type OTPInputSize = \"sm\" | \"md\" | \"lg\";\nexport type OTPInputVariant = \"outlined\" | \"filled\" | \"underlined\";\n\nexport interface OTPInputProps {\n /** Number of OTP digits */\n length?: number;\n /** Callback when OTP value changes */\n onChange?: (value: string) => void;\n /** Callback when all digits are filled */\n onComplete?: (value: string) => void;\n /** The current value (controlled) */\n value?: string;\n /** Default value (uncontrolled) */\n defaultValue?: string;\n /** Size of the input boxes */\n size?: OTPInputSize;\n /** Visual variant */\n variant?: OTPInputVariant;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Whether there's an error */\n error?: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Placeholder character */\n placeholder?: string;\n /** Whether to mask the input (like password) */\n mask?: boolean;\n /** Whether to auto-focus the first input */\n autoFocus?: boolean;\n /** Input type - number only or alphanumeric */\n type?: \"number\" | \"text\";\n /** Custom className for the container */\n className?: string;\n /** Custom className for each input box */\n inputClassName?: string;\n /** Separator to show between groups of digits */\n separator?: React.ReactNode;\n /** Position(s) to show separator (e.g., [3] means after 3rd digit) */\n separatorPositions?: number[];\n /** Accessible label */\n \"aria-label\"?: string;\n}\n\nconst sizeStyles: Record<OTPInputSize, string> = {\n sm: \"w-9 h-10 text-base\",\n md: \"w-12 h-14 text-xl\",\n lg: \"w-14 h-16 text-2xl\",\n};\n\nconst variantStyles: Record<\n OTPInputVariant,\n { base: string; focus: string; error: string }\n> = {\n outlined: {\n base: \"border border-ds-border-field bg-ds-surface-1 rounded-lg text-ds-1\",\n focus: \"focus:border-ds-border-accent focus:ring-2 focus:ring-ds-accent\",\n error: \"border-destructive\",\n },\n filled: {\n base: \"border border-transparent bg-ds-accent-subtle rounded-lg text-ds-1\",\n focus:\n \"focus:border-ds-border-accent focus:bg-ds-surface-1 focus:ring-2 focus:ring-ds-accent\",\n error: \"bg-danger-subtle border-danger-border\",\n },\n underlined: {\n base: \"border-b-2 border-ds-border-1 bg-transparent rounded-none text-ds-1\",\n focus: \"focus:border-ds-border-accent\",\n error: \"border-destructive\",\n },\n};\n\nconst OTPInput = forwardRef<HTMLDivElement, OTPInputProps>(\n (\n {\n length = 6,\n onChange,\n onComplete,\n value: controlledValue,\n defaultValue = \"\",\n size = \"md\",\n variant = \"outlined\",\n disabled = false,\n error = false,\n errorMessage,\n placeholder = \"\",\n mask = false,\n autoFocus = false,\n type = \"number\",\n className = \"\",\n inputClassName = \"\",\n separator = <span className=\"text-ds-3 text-2xl mx-2\">—</span>,\n separatorPositions = [],\n \"aria-label\": ariaLabel = \"One-time password\",\n },\n ref,\n ) => {\n const [values, setValues] = useState<string[]>(() => {\n const initial = controlledValue ?? defaultValue;\n return initial\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n });\n\n const inputRefs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync with controlled value\n useEffect(() => {\n if (controlledValue !== undefined) {\n const newValues = controlledValue\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n setValues(newValues);\n }\n }, [controlledValue, length]);\n\n // Auto-focus first input\n useEffect(() => {\n if (autoFocus && inputRefs.current[0]) {\n inputRefs.current[0].focus();\n }\n }, [autoFocus]);\n\n const focusInput = useCallback(\n (index: number) => {\n if (index >= 0 && index < length && inputRefs.current[index]) {\n inputRefs.current[index]?.focus();\n inputRefs.current[index]?.select();\n }\n },\n [length],\n );\n\n const handleChange = useCallback(\n (index: number, e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const char = inputValue.slice(-1);\n\n // Validate input based on type\n if (type === \"number\" && char && !/^\\d$/.test(char)) {\n return;\n }\n\n const newValues = [...values];\n newValues[index] = char;\n setValues(newValues);\n\n const otpValue = newValues.join(\"\");\n onChange?.(otpValue);\n\n // Move to next input if value entered\n if (char && index < length - 1) {\n focusInput(index + 1);\n }\n\n // Check if complete\n if (newValues.every((v) => v !== \"\") && newValues.length === length) {\n onComplete?.(otpValue);\n }\n },\n [values, onChange, onComplete, length, type, focusInput],\n );\n\n const handleKeyDown = useCallback(\n (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Backspace\":\n e.preventDefault();\n const newValues = [...values];\n if (values[index]) {\n // Clear current value\n newValues[index] = \"\";\n setValues(newValues);\n onChange?.(newValues.join(\"\"));\n } else if (index > 0) {\n // Move to previous and clear\n newValues[index - 1] = \"\";\n setValues(newValues);\n onChange?.(newValues.join(\"\"));\n focusInput(index - 1);\n }\n break;\n case \"ArrowLeft\":\n e.preventDefault();\n focusInput(index - 1);\n break;\n case \"ArrowRight\":\n e.preventDefault();\n focusInput(index + 1);\n break;\n case \"Delete\":\n e.preventDefault();\n const deleteValues = [...values];\n deleteValues[index] = \"\";\n setValues(deleteValues);\n onChange?.(deleteValues.join(\"\"));\n break;\n }\n },\n [values, onChange, focusInput],\n );\n\n const handlePaste = useCallback(\n (e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n const pastedData = e.clipboardData.getData(\"text\").slice(0, length);\n\n // Validate pasted content\n if (type === \"number\" && !/^\\d*$/.test(pastedData)) {\n return;\n }\n\n const newValues = pastedData\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n\n setValues(newValues);\n const otpValue = newValues.join(\"\");\n onChange?.(otpValue);\n\n // Focus last filled input or last input\n const lastFilledIndex = newValues.findLastIndex((v) => v !== \"\");\n focusInput(Math.min(lastFilledIndex + 1, length - 1));\n\n // Check if complete\n if (newValues.every((v) => v !== \"\") && pastedData.length >= length) {\n onComplete?.(otpValue);\n }\n },\n [length, type, onChange, onComplete, focusInput],\n );\n\n const handleFocus = useCallback((e: React.FocusEvent<HTMLInputElement>) => {\n e.target.select();\n }, []);\n\n const renderInputs = () => {\n const inputs: React.ReactNode[] = [];\n\n for (let i = 0; i < length; i++) {\n // Add separator if needed\n if (separatorPositions.includes(i) && i > 0) {\n inputs.push(\n <div key={`separator-${i}`} className=\"flex items-center\">\n {separator}\n </div>,\n );\n }\n\n inputs.push(\n <input\n key={i}\n ref={(el) => {\n inputRefs.current[i] = el;\n // React 19: Return cleanup function\n return () => {\n inputRefs.current[i] = null;\n };\n }}\n type={mask ? \"password\" : \"text\"}\n inputMode={type === \"number\" ? \"numeric\" : \"text\"}\n pattern={type === \"number\" ? \"\\\\d*\" : undefined}\n maxLength={1}\n value={values[i] || \"\"}\n placeholder={placeholder}\n disabled={disabled}\n onChange={(e) => handleChange(i, e)}\n onKeyDown={(e) => handleKeyDown(i, e)}\n onPaste={handlePaste}\n onFocus={handleFocus}\n aria-label={`${ariaLabel} digit ${i + 1}`}\n className={`\n text-center font-semibold outline-none transition-all\n placeholder:text-ds-2\n ${sizeStyles[size]}\n ${variantStyles[variant].base}\n ${!error ? variantStyles[variant].focus : \"\"}\n ${error ? variantStyles[variant].error : \"\"}\n ${disabled ? \"opacity-50 cursor-not-allowed bg-ds-surface-1\" : \"\"}\n ${inputClassName}\n `}\n />,\n );\n }\n\n return inputs;\n };\n\n return (\n <div ref={ref} className={`flex flex-col gap-2 ${className}`}>\n <div\n className=\"flex items-center gap-2\"\n role=\"group\"\n aria-label={ariaLabel}\n >\n {renderInputs()}\n </div>\n {error && errorMessage && (\n <span className=\"text-sm text-destructive\">{errorMessage}</span>\n )}\n </div>\n );\n },\n);\n\nOTPInput.displayName = \"OTPInput\";\n\nexport default OTPInput;\nexport { OTPInput };\n"],"mappings":";;;;AAuDA,IAAM,aAA2C;CAC/C,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,IAAM,gBAGF;CACF,UAAU;EACR,MAAM;EACN,OAAO;EACP,OAAO;EACR;CACD,QAAQ;EACN,MAAM;EACN,OACE;EACF,OAAO;EACR;CACD,YAAY;EACV,MAAM;EACN,OAAO;EACP,OAAO;EACR;CACF;AAED,IAAM,YAAA,GAAA,MAAA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AS,QAAQ,GAAG;gBAC3C,QAAQ,cAAc,SAAS,QAAQ,GAAG;gBAC1C,WAAW,kDAAkD,GAAG;gBAChE,eAAe;;IAEnB,EA9BK,EA8BL,CACH;;AAGH,SAAO;;AAGT,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAU;EAAK,WAAW,uBAAuB;YAAjD,CACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,WAAU;GACV,MAAK;GACL,cAAY;aAEX,cAAc;GACX,CAAA,EACL,SAAS,gBACR,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAA4B;GAAoB,CAAA,CAE9D;;EAGX;AAED,SAAS,cAAc"}
1
+ {"version":3,"file":"otp-input-CkhV-sGl.cjs","names":[],"sources":["../../src/components/forms/otp-input/OTPInput.tsx"],"sourcesContent":["import {\n forwardRef,\n useState,\n useRef,\n useCallback,\n useEffect,\n type KeyboardEvent,\n type ClipboardEvent,\n type ChangeEvent,\n} from \"react\";\n\nexport type OTPInputSize = \"sm\" | \"md\" | \"lg\";\nexport type OTPInputVariant = \"outlined\" | \"filled\" | \"underlined\";\n\nexport interface OTPInputProps {\n /** Number of OTP digits */\n length?: number;\n /** Callback when OTP value changes */\n onChange?: (value: string) => void;\n /** Callback when all digits are filled */\n onComplete?: (value: string) => void;\n /** The current value (controlled) */\n value?: string;\n /** Default value (uncontrolled) */\n defaultValue?: string;\n /** Size of the input boxes */\n size?: OTPInputSize;\n /** Visual variant */\n variant?: OTPInputVariant;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Whether there's an error */\n error?: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Placeholder character */\n placeholder?: string;\n /** Whether to mask the input (like password) */\n mask?: boolean;\n /** Whether to auto-focus the first input */\n autoFocus?: boolean;\n /** Input type - number only or alphanumeric */\n type?: \"number\" | \"text\";\n /** Custom className for the container */\n className?: string;\n /** Custom className for each input box */\n inputClassName?: string;\n /** Separator to show between groups of digits */\n separator?: React.ReactNode;\n /** Position(s) to show separator (e.g., [3] means after 3rd digit) */\n separatorPositions?: number[];\n /** Accessible label */\n \"aria-label\"?: string;\n}\n\nconst sizeStyles: Record<OTPInputSize, string> = {\n sm: \"w-9 h-10 text-base\",\n md: \"w-12 h-14 text-xl\",\n lg: \"w-14 h-16 text-2xl\",\n};\n\nconst variantStyles: Record<\n OTPInputVariant,\n { base: string; focus: string; error: string }\n> = {\n outlined: {\n base: \"border border-ds-border-field bg-ds-surface-1 rounded-lg text-ds-1\",\n focus: \"focus:border-ds-border-accent focus:ring-2 focus:ring-ds-accent\",\n error: \"border-destructive\",\n },\n filled: {\n base: \"border border-transparent bg-ds-accent-subtle rounded-lg text-ds-1\",\n focus:\n \"focus:border-ds-border-accent focus:bg-ds-surface-1 focus:ring-2 focus:ring-ds-accent\",\n error: \"bg-danger-subtle border-danger-border\",\n },\n underlined: {\n base: \"border-b-2 border-ds-border-1 bg-transparent rounded-none text-ds-1\",\n focus: \"focus:border-ds-border-accent\",\n error: \"border-destructive\",\n },\n};\n\nconst OTPInput = forwardRef<HTMLDivElement, OTPInputProps>(\n (\n {\n length = 6,\n onChange,\n onComplete,\n value: controlledValue,\n defaultValue = \"\",\n size = \"md\",\n variant = \"outlined\",\n disabled = false,\n error = false,\n errorMessage,\n placeholder = \"\",\n mask = false,\n autoFocus = false,\n type = \"number\",\n className = \"\",\n inputClassName = \"\",\n separator = <span className=\"text-ds-3 text-2xl mx-2\">—</span>,\n separatorPositions = [],\n \"aria-label\": ariaLabel = \"One-time password\",\n },\n ref,\n ) => {\n const [values, setValues] = useState<string[]>(() => {\n const initial = controlledValue ?? defaultValue;\n return initial\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n });\n\n const inputRefs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync with controlled value\n useEffect(() => {\n if (controlledValue !== undefined) {\n const newValues = controlledValue\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n setValues(newValues);\n }\n }, [controlledValue, length]);\n\n // Auto-focus first input\n useEffect(() => {\n if (autoFocus && inputRefs.current[0]) {\n inputRefs.current[0].focus();\n }\n }, [autoFocus]);\n\n const focusInput = useCallback(\n (index: number) => {\n if (index >= 0 && index < length && inputRefs.current[index]) {\n inputRefs.current[index]?.focus();\n inputRefs.current[index]?.select();\n }\n },\n [length],\n );\n\n const handleChange = useCallback(\n (index: number, e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const char = inputValue.slice(-1);\n\n // Validate input based on type\n if (type === \"number\" && char && !/^\\d$/.test(char)) {\n return;\n }\n\n const newValues = [...values];\n newValues[index] = char;\n setValues(newValues);\n\n const otpValue = newValues.join(\"\");\n onChange?.(otpValue);\n\n // Move to next input if value entered\n if (char && index < length - 1) {\n focusInput(index + 1);\n }\n\n // Check if complete\n if (newValues.every((v) => v !== \"\") && newValues.length === length) {\n onComplete?.(otpValue);\n }\n },\n [values, onChange, onComplete, length, type, focusInput],\n );\n\n const handleKeyDown = useCallback(\n (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Backspace\":\n e.preventDefault();\n const newValues = [...values];\n if (values[index]) {\n // Clear current value\n newValues[index] = \"\";\n setValues(newValues);\n onChange?.(newValues.join(\"\"));\n } else if (index > 0) {\n // Move to previous and clear\n newValues[index - 1] = \"\";\n setValues(newValues);\n onChange?.(newValues.join(\"\"));\n focusInput(index - 1);\n }\n break;\n case \"ArrowLeft\":\n e.preventDefault();\n focusInput(index - 1);\n break;\n case \"ArrowRight\":\n e.preventDefault();\n focusInput(index + 1);\n break;\n case \"Delete\":\n e.preventDefault();\n const deleteValues = [...values];\n deleteValues[index] = \"\";\n setValues(deleteValues);\n onChange?.(deleteValues.join(\"\"));\n break;\n }\n },\n [values, onChange, focusInput],\n );\n\n const handlePaste = useCallback(\n (e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n const pastedData = e.clipboardData.getData(\"text\").slice(0, length);\n\n // Validate pasted content\n if (type === \"number\" && !/^\\d*$/.test(pastedData)) {\n return;\n }\n\n const newValues = pastedData\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n\n setValues(newValues);\n const otpValue = newValues.join(\"\");\n onChange?.(otpValue);\n\n // Focus last filled input or last input\n const lastFilledIndex = newValues.findLastIndex((v) => v !== \"\");\n focusInput(Math.min(lastFilledIndex + 1, length - 1));\n\n // Check if complete\n if (newValues.every((v) => v !== \"\") && pastedData.length >= length) {\n onComplete?.(otpValue);\n }\n },\n [length, type, onChange, onComplete, focusInput],\n );\n\n const handleFocus = useCallback((e: React.FocusEvent<HTMLInputElement>) => {\n e.target.select();\n }, []);\n\n const renderInputs = () => {\n const inputs: React.ReactNode[] = [];\n\n for (let i = 0; i < length; i++) {\n // Add separator if needed\n if (separatorPositions.includes(i) && i > 0) {\n inputs.push(\n <div key={`separator-${i}`} className=\"flex items-center\">\n {separator}\n </div>,\n );\n }\n\n inputs.push(\n <input\n key={i}\n ref={(el) => {\n inputRefs.current[i] = el;\n // React 19: Return cleanup function\n return () => {\n inputRefs.current[i] = null;\n };\n }}\n type={mask ? \"password\" : \"text\"}\n inputMode={type === \"number\" ? \"numeric\" : \"text\"}\n pattern={type === \"number\" ? \"\\\\d*\" : undefined}\n maxLength={1}\n value={values[i] || \"\"}\n placeholder={placeholder}\n disabled={disabled}\n onChange={(e) => handleChange(i, e)}\n onKeyDown={(e) => handleKeyDown(i, e)}\n onPaste={handlePaste}\n onFocus={handleFocus}\n aria-label={`${ariaLabel} digit ${i + 1}`}\n className={`\n text-center font-semibold outline-none transition-all\n placeholder:text-ds-2\n ${sizeStyles[size]}\n ${variantStyles[variant].base}\n ${!error ? variantStyles[variant].focus : \"\"}\n ${error ? variantStyles[variant].error : \"\"}\n ${disabled ? \"opacity-50 cursor-not-allowed bg-ds-surface-1\" : \"\"}\n ${inputClassName}\n `}\n />,\n );\n }\n\n return inputs;\n };\n\n return (\n <div ref={ref} className={`flex flex-col gap-2 ${className}`}>\n <div\n className=\"flex items-center gap-2\"\n role=\"group\"\n aria-label={ariaLabel}\n >\n {renderInputs()}\n </div>\n {error && errorMessage && (\n <span className=\"text-sm text-destructive\">{errorMessage}</span>\n )}\n </div>\n );\n },\n);\n\nOTPInput.displayName = \"OTPInput\";\n\nexport default OTPInput;\nexport { OTPInput };\n"],"mappings":";;;;AAuDA,IAAM,aAA2C;CAC/C,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,IAAM,gBAGF;CACF,UAAU;EACR,MAAM;EACN,OAAO;EACP,OAAO;EACR;CACD,QAAQ;EACN,MAAM;EACN,OACE;EACF,OAAO;EACR;CACD,YAAY;EACV,MAAM;EACN,OAAO;EACP,OAAO;EACR;CACF;AAED,IAAM,YAAA,GAAA,MAAA,aAEF,EACE,SAAS,GACT,UACA,YACA,OAAO,iBACP,eAAe,IACf,OAAO,MACP,UAAU,YACV,WAAW,OACX,QAAQ,OACR,cACA,cAAc,IACd,OAAO,OACP,YAAY,OACZ,OAAO,UACP,YAAY,IACZ,iBAAiB,IACjB,YAAY,iBAAA,GAAA,kBAAA,KAAC,QAAD;CAAM,WAAU;WAA0B;CAAQ,CAAA,EAC9D,qBAAqB,EAAE,EACvB,cAAc,YAAY,uBAE5B,QACG;CACH,MAAM,CAAC,QAAQ,cAAA,GAAA,MAAA,gBAAsC;AAEnD,UADgB,mBAAmB,cAEhC,MAAM,GAAG,CACT,MAAM,GAAG,OAAO,CAChB,OAAO,MAAM,OAAO,CAAC,KAAK,GAAG,CAAC,CAC9B,MAAM,GAAG,OAAO;GACnB;CAEF,MAAM,aAAA,GAAA,MAAA,QAAgD,EAAE,CAAC;AAGzD,EAAA,GAAA,MAAA,iBAAgB;AACd,MAAI,oBAAoB,KAAA,EAMtB,WALkB,gBACf,MAAM,GAAG,CACT,MAAM,GAAG,OAAO,CAChB,OAAO,MAAM,OAAO,CAAC,KAAK,GAAG,CAAC,CAC9B,MAAM,GAAG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I,aAAa,IAEjB,CACP;AAGH,UAAO,KACL,iBAAA,GAAA,kBAAA,KAAC,SAAD;IAEE,MAAM,OAAO;AACX,eAAU,QAAQ,KAAK;AAEvB,kBAAa;AACX,gBAAU,QAAQ,KAAK;;;IAG3B,MAAM,OAAO,aAAa;IAC1B,WAAW,SAAS,WAAW,YAAY;IAC3C,SAAS,SAAS,WAAW,SAAS,KAAA;IACtC,WAAW;IACX,OAAO,OAAO,MAAM;IACP;IACH;IACV,WAAW,MAAM,aAAa,GAAG,EAAE;IACnC,YAAY,MAAM,cAAc,GAAG,EAAE;IACrC,SAAS;IACT,SAAS;IACT,cAAY,GAAG,UAAU,SAAS,IAAI;IACtC,WAAW;;;gBAGP,WAAW,MAAM;gBACjB,cAAc,SAAS,KAAK;gBAC5B,CAAC,QAAQ,cAAc,SAAS,QAAQ,GAAG;gBAC3C,QAAQ,cAAc,SAAS,QAAQ,GAAG;gBAC1C,WAAW,kDAAkD,GAAG;gBAChE,eAAe;;IAEnB,EA9BK,EA8BL,CACH;;AAGH,SAAO;;AAGT,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAU;EAAK,WAAW,uBAAuB;YAAjD,CACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,WAAU;GACV,MAAK;GACL,cAAY;aAEX,cAAc;GACX,CAAA,EACL,SAAS,gBACR,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAA4B;GAAoB,CAAA,CAE9D;;EAGX;AAED,SAAS,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"otp-input-JOysxKfD.mjs","names":[],"sources":["../../src/components/forms/otp-input/OTPInput.tsx"],"sourcesContent":["import {\n forwardRef,\n useState,\n useRef,\n useCallback,\n useEffect,\n type KeyboardEvent,\n type ClipboardEvent,\n type ChangeEvent,\n} from \"react\";\n\nexport type OTPInputSize = \"sm\" | \"md\" | \"lg\";\nexport type OTPInputVariant = \"outlined\" | \"filled\" | \"underlined\";\n\nexport interface OTPInputProps {\n /** Number of OTP digits */\n length?: number;\n /** Callback when OTP value changes */\n onChange?: (value: string) => void;\n /** Callback when all digits are filled */\n onComplete?: (value: string) => void;\n /** The current value (controlled) */\n value?: string;\n /** Default value (uncontrolled) */\n defaultValue?: string;\n /** Size of the input boxes */\n size?: OTPInputSize;\n /** Visual variant */\n variant?: OTPInputVariant;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Whether there's an error */\n error?: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Placeholder character */\n placeholder?: string;\n /** Whether to mask the input (like password) */\n mask?: boolean;\n /** Whether to auto-focus the first input */\n autoFocus?: boolean;\n /** Input type - number only or alphanumeric */\n type?: \"number\" | \"text\";\n /** Custom className for the container */\n className?: string;\n /** Custom className for each input box */\n inputClassName?: string;\n /** Separator to show between groups of digits */\n separator?: React.ReactNode;\n /** Position(s) to show separator (e.g., [3] means after 3rd digit) */\n separatorPositions?: number[];\n /** Accessible label */\n \"aria-label\"?: string;\n}\n\nconst sizeStyles: Record<OTPInputSize, string> = {\n sm: \"w-9 h-10 text-base\",\n md: \"w-12 h-14 text-xl\",\n lg: \"w-14 h-16 text-2xl\",\n};\n\nconst variantStyles: Record<\n OTPInputVariant,\n { base: string; focus: string; error: string }\n> = {\n outlined: {\n base: \"border border-ds-border-field bg-ds-surface-1 rounded-lg text-ds-1\",\n focus: \"focus:border-ds-border-accent focus:ring-2 focus:ring-ds-accent\",\n error: \"border-destructive\",\n },\n filled: {\n base: \"border border-transparent bg-ds-accent-subtle rounded-lg text-ds-1\",\n focus:\n \"focus:border-ds-border-accent focus:bg-ds-surface-1 focus:ring-2 focus:ring-ds-accent\",\n error: \"bg-danger-subtle border-danger-border\",\n },\n underlined: {\n base: \"border-b-2 border-ds-border-1 bg-transparent rounded-none text-ds-1\",\n focus: \"focus:border-ds-border-accent\",\n error: \"border-destructive\",\n },\n};\n\nconst OTPInput = forwardRef<HTMLDivElement, OTPInputProps>(\n (\n {\n length = 6,\n onChange,\n onComplete,\n value: controlledValue,\n defaultValue = \"\",\n size = \"md\",\n variant = \"outlined\",\n disabled = false,\n error = false,\n errorMessage,\n placeholder = \"\",\n mask = false,\n autoFocus = false,\n type = \"number\",\n className = \"\",\n inputClassName = \"\",\n separator = <span className=\"text-ds-3 text-2xl mx-2\">—</span>,\n separatorPositions = [],\n \"aria-label\": ariaLabel = \"One-time password\",\n },\n ref,\n ) => {\n const [values, setValues] = useState<string[]>(() => {\n const initial = controlledValue ?? defaultValue;\n return initial\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n });\n\n const inputRefs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync with controlled value\n useEffect(() => {\n if (controlledValue !== undefined) {\n const newValues = controlledValue\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n setValues(newValues);\n }\n }, [controlledValue, length]);\n\n // Auto-focus first input\n useEffect(() => {\n if (autoFocus && inputRefs.current[0]) {\n inputRefs.current[0].focus();\n }\n }, [autoFocus]);\n\n const focusInput = useCallback(\n (index: number) => {\n if (index >= 0 && index < length && inputRefs.current[index]) {\n inputRefs.current[index]?.focus();\n inputRefs.current[index]?.select();\n }\n },\n [length],\n );\n\n const handleChange = useCallback(\n (index: number, e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const char = inputValue.slice(-1);\n\n // Validate input based on type\n if (type === \"number\" && char && !/^\\d$/.test(char)) {\n return;\n }\n\n const newValues = [...values];\n newValues[index] = char;\n setValues(newValues);\n\n const otpValue = newValues.join(\"\");\n onChange?.(otpValue);\n\n // Move to next input if value entered\n if (char && index < length - 1) {\n focusInput(index + 1);\n }\n\n // Check if complete\n if (newValues.every((v) => v !== \"\") && newValues.length === length) {\n onComplete?.(otpValue);\n }\n },\n [values, onChange, onComplete, length, type, focusInput],\n );\n\n const handleKeyDown = useCallback(\n (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Backspace\":\n e.preventDefault();\n const newValues = [...values];\n if (values[index]) {\n // Clear current value\n newValues[index] = \"\";\n setValues(newValues);\n onChange?.(newValues.join(\"\"));\n } else if (index > 0) {\n // Move to previous and clear\n newValues[index - 1] = \"\";\n setValues(newValues);\n onChange?.(newValues.join(\"\"));\n focusInput(index - 1);\n }\n break;\n case \"ArrowLeft\":\n e.preventDefault();\n focusInput(index - 1);\n break;\n case \"ArrowRight\":\n e.preventDefault();\n focusInput(index + 1);\n break;\n case \"Delete\":\n e.preventDefault();\n const deleteValues = [...values];\n deleteValues[index] = \"\";\n setValues(deleteValues);\n onChange?.(deleteValues.join(\"\"));\n break;\n }\n },\n [values, onChange, focusInput],\n );\n\n const handlePaste = useCallback(\n (e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n const pastedData = e.clipboardData.getData(\"text\").slice(0, length);\n\n // Validate pasted content\n if (type === \"number\" && !/^\\d*$/.test(pastedData)) {\n return;\n }\n\n const newValues = pastedData\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n\n setValues(newValues);\n const otpValue = newValues.join(\"\");\n onChange?.(otpValue);\n\n // Focus last filled input or last input\n const lastFilledIndex = newValues.findLastIndex((v) => v !== \"\");\n focusInput(Math.min(lastFilledIndex + 1, length - 1));\n\n // Check if complete\n if (newValues.every((v) => v !== \"\") && pastedData.length >= length) {\n onComplete?.(otpValue);\n }\n },\n [length, type, onChange, onComplete, focusInput],\n );\n\n const handleFocus = useCallback((e: React.FocusEvent<HTMLInputElement>) => {\n e.target.select();\n }, []);\n\n const renderInputs = () => {\n const inputs: React.ReactNode[] = [];\n\n for (let i = 0; i < length; i++) {\n // Add separator if needed\n if (separatorPositions.includes(i) && i > 0) {\n inputs.push(\n <div key={`separator-${i}`} className=\"flex items-center\">\n {separator}\n </div>,\n );\n }\n\n inputs.push(\n <input\n key={i}\n ref={(el) => {\n inputRefs.current[i] = el;\n // React 19: Return cleanup function\n return () => {\n inputRefs.current[i] = null;\n };\n }}\n type={mask ? \"password\" : \"text\"}\n inputMode={type === \"number\" ? \"numeric\" : \"text\"}\n pattern={type === \"number\" ? \"\\\\d*\" : undefined}\n maxLength={1}\n value={values[i] || \"\"}\n placeholder={placeholder}\n disabled={disabled}\n onChange={(e) => handleChange(i, e)}\n onKeyDown={(e) => handleKeyDown(i, e)}\n onPaste={handlePaste}\n onFocus={handleFocus}\n aria-label={`${ariaLabel} digit ${i + 1}`}\n className={`\n text-center font-semibold outline-none transition-all\n placeholder:text-ds-2\n ${sizeStyles[size]}\n ${variantStyles[variant].base}\n ${!error ? variantStyles[variant].focus : \"\"}\n ${error ? variantStyles[variant].error : \"\"}\n ${disabled ? \"opacity-50 cursor-not-allowed bg-ds-surface-1\" : \"\"}\n ${inputClassName}\n `}\n />,\n );\n }\n\n return inputs;\n };\n\n return (\n <div ref={ref} className={`flex flex-col gap-2 ${className}`}>\n <div\n className=\"flex items-center gap-2\"\n role=\"group\"\n aria-label={ariaLabel}\n >\n {renderInputs()}\n </div>\n {error && errorMessage && (\n <span className=\"text-sm text-destructive\">{errorMessage}</span>\n )}\n </div>\n );\n },\n);\n\nOTPInput.displayName = \"OTPInput\";\n\nexport default OTPInput;\nexport { OTPInput };\n"],"mappings":";;;AAuDA,IAAM,aAA2C;CAC/C,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,IAAM,gBAGF;CACF,UAAU;EACR,MAAM;EACN,OAAO;EACP,OAAO;EACR;CACD,QAAQ;EACN,MAAM;EACN,OACE;EACF,OAAO;EACR;CACD,YAAY;EACV,MAAM;EACN,OAAO;EACP,OAAO;EACR;CACF;AAED,IAAM,WAAW,YAEb,EACE,SAAS,GACT,UACA,YACA,OAAO,iBACP,eAAe,IACf,OAAO,MACP,UAAU,YACV,WAAW,OACX,QAAQ,OACR,cACA,cAAc,IACd,OAAO,OACP,YAAY,OACZ,OAAO,UACP,YAAY,IACZ,iBAAiB,IACjB,YAAY,oBAAC,QAAD;CAAM,WAAU;WAA0B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-input-JOysxKfD.mjs","names":[],"sources":["../../src/components/forms/otp-input/OTPInput.tsx"],"sourcesContent":["import {\n forwardRef,\n useState,\n useRef,\n useCallback,\n useEffect,\n type KeyboardEvent,\n type ClipboardEvent,\n type ChangeEvent,\n} from \"react\";\n\nexport type OTPInputSize = \"sm\" | \"md\" | \"lg\";\nexport type OTPInputVariant = \"outlined\" | \"filled\" | \"underlined\";\n\nexport interface OTPInputProps {\n /** Number of OTP digits */\n length?: number;\n /** Callback when OTP value changes */\n onChange?: (value: string) => void;\n /** Callback when all digits are filled */\n onComplete?: (value: string) => void;\n /** The current value (controlled) */\n value?: string;\n /** Default value (uncontrolled) */\n defaultValue?: string;\n /** Size of the input boxes */\n size?: OTPInputSize;\n /** Visual variant */\n variant?: OTPInputVariant;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Whether there's an error */\n error?: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Placeholder character */\n placeholder?: string;\n /** Whether to mask the input (like password) */\n mask?: boolean;\n /** Whether to auto-focus the first input */\n autoFocus?: boolean;\n /** Input type - number only or alphanumeric */\n type?: \"number\" | \"text\";\n /** Custom className for the container */\n className?: string;\n /** Custom className for each input box */\n inputClassName?: string;\n /** Separator to show between groups of digits */\n separator?: React.ReactNode;\n /** Position(s) to show separator (e.g., [3] means after 3rd digit) */\n separatorPositions?: number[];\n /** Accessible label */\n \"aria-label\"?: string;\n}\n\nconst sizeStyles: Record<OTPInputSize, string> = {\n sm: \"w-9 h-10 text-base\",\n md: \"w-12 h-14 text-xl\",\n lg: \"w-14 h-16 text-2xl\",\n};\n\nconst variantStyles: Record<\n OTPInputVariant,\n { base: string; focus: string; error: string }\n> = {\n outlined: {\n base: \"border border-ds-border-field bg-ds-surface-1 rounded-lg text-ds-1\",\n focus: \"focus:border-ds-border-accent focus:ring-2 focus:ring-ds-accent\",\n error: \"border-destructive\",\n },\n filled: {\n base: \"border border-transparent bg-ds-accent-subtle rounded-lg text-ds-1\",\n focus:\n \"focus:border-ds-border-accent focus:bg-ds-surface-1 focus:ring-2 focus:ring-ds-accent\",\n error: \"bg-danger-subtle border-danger-border\",\n },\n underlined: {\n base: \"border-b-2 border-ds-border-1 bg-transparent rounded-none text-ds-1\",\n focus: \"focus:border-ds-border-accent\",\n error: \"border-destructive\",\n },\n};\n\nconst OTPInput = forwardRef<HTMLDivElement, OTPInputProps>(\n (\n {\n length = 6,\n onChange,\n onComplete,\n value: controlledValue,\n defaultValue = \"\",\n size = \"md\",\n variant = \"outlined\",\n disabled = false,\n error = false,\n errorMessage,\n placeholder = \"\",\n mask = false,\n autoFocus = false,\n type = \"number\",\n className = \"\",\n inputClassName = \"\",\n separator = <span className=\"text-ds-3 text-2xl mx-2\">—</span>,\n separatorPositions = [],\n \"aria-label\": ariaLabel = \"One-time password\",\n },\n ref,\n ) => {\n const [values, setValues] = useState<string[]>(() => {\n const initial = controlledValue ?? defaultValue;\n return initial\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n });\n\n const inputRefs = useRef<(HTMLInputElement | null)[]>([]);\n\n // Sync with controlled value\n useEffect(() => {\n if (controlledValue !== undefined) {\n const newValues = controlledValue\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n setValues(newValues);\n }\n }, [controlledValue, length]);\n\n // Auto-focus first input\n useEffect(() => {\n if (autoFocus && inputRefs.current[0]) {\n inputRefs.current[0].focus();\n }\n }, [autoFocus]);\n\n const focusInput = useCallback(\n (index: number) => {\n if (index >= 0 && index < length && inputRefs.current[index]) {\n inputRefs.current[index]?.focus();\n inputRefs.current[index]?.select();\n }\n },\n [length],\n );\n\n const handleChange = useCallback(\n (index: number, e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const char = inputValue.slice(-1);\n\n // Validate input based on type\n if (type === \"number\" && char && !/^\\d$/.test(char)) {\n return;\n }\n\n const newValues = [...values];\n newValues[index] = char;\n setValues(newValues);\n\n const otpValue = newValues.join(\"\");\n onChange?.(otpValue);\n\n // Move to next input if value entered\n if (char && index < length - 1) {\n focusInput(index + 1);\n }\n\n // Check if complete\n if (newValues.every((v) => v !== \"\") && newValues.length === length) {\n onComplete?.(otpValue);\n }\n },\n [values, onChange, onComplete, length, type, focusInput],\n );\n\n const handleKeyDown = useCallback(\n (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Backspace\":\n e.preventDefault();\n const newValues = [...values];\n if (values[index]) {\n // Clear current value\n newValues[index] = \"\";\n setValues(newValues);\n onChange?.(newValues.join(\"\"));\n } else if (index > 0) {\n // Move to previous and clear\n newValues[index - 1] = \"\";\n setValues(newValues);\n onChange?.(newValues.join(\"\"));\n focusInput(index - 1);\n }\n break;\n case \"ArrowLeft\":\n e.preventDefault();\n focusInput(index - 1);\n break;\n case \"ArrowRight\":\n e.preventDefault();\n focusInput(index + 1);\n break;\n case \"Delete\":\n e.preventDefault();\n const deleteValues = [...values];\n deleteValues[index] = \"\";\n setValues(deleteValues);\n onChange?.(deleteValues.join(\"\"));\n break;\n }\n },\n [values, onChange, focusInput],\n );\n\n const handlePaste = useCallback(\n (e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n const pastedData = e.clipboardData.getData(\"text\").slice(0, length);\n\n // Validate pasted content\n if (type === \"number\" && !/^\\d*$/.test(pastedData)) {\n return;\n }\n\n const newValues = pastedData\n .split(\"\")\n .slice(0, length)\n .concat(Array(length).fill(\"\"))\n .slice(0, length);\n\n setValues(newValues);\n const otpValue = newValues.join(\"\");\n onChange?.(otpValue);\n\n // Focus last filled input or last input\n const lastFilledIndex = newValues.findLastIndex((v) => v !== \"\");\n focusInput(Math.min(lastFilledIndex + 1, length - 1));\n\n // Check if complete\n if (newValues.every((v) => v !== \"\") && pastedData.length >= length) {\n onComplete?.(otpValue);\n }\n },\n [length, type, onChange, onComplete, focusInput],\n );\n\n const handleFocus = useCallback((e: React.FocusEvent<HTMLInputElement>) => {\n e.target.select();\n }, []);\n\n const renderInputs = () => {\n const inputs: React.ReactNode[] = [];\n\n for (let i = 0; i < length; i++) {\n // Add separator if needed\n if (separatorPositions.includes(i) && i > 0) {\n inputs.push(\n <div key={`separator-${i}`} className=\"flex items-center\">\n {separator}\n </div>,\n );\n }\n\n inputs.push(\n <input\n key={i}\n ref={(el) => {\n inputRefs.current[i] = el;\n // React 19: Return cleanup function\n return () => {\n inputRefs.current[i] = null;\n };\n }}\n type={mask ? \"password\" : \"text\"}\n inputMode={type === \"number\" ? \"numeric\" : \"text\"}\n pattern={type === \"number\" ? \"\\\\d*\" : undefined}\n maxLength={1}\n value={values[i] || \"\"}\n placeholder={placeholder}\n disabled={disabled}\n onChange={(e) => handleChange(i, e)}\n onKeyDown={(e) => handleKeyDown(i, e)}\n onPaste={handlePaste}\n onFocus={handleFocus}\n aria-label={`${ariaLabel} digit ${i + 1}`}\n className={`\n text-center font-semibold outline-none transition-all\n placeholder:text-ds-2\n ${sizeStyles[size]}\n ${variantStyles[variant].base}\n ${!error ? variantStyles[variant].focus : \"\"}\n ${error ? variantStyles[variant].error : \"\"}\n ${disabled ? \"opacity-50 cursor-not-allowed bg-ds-surface-1\" : \"\"}\n ${inputClassName}\n `}\n />,\n );\n }\n\n return inputs;\n };\n\n return (\n <div ref={ref} className={`flex flex-col gap-2 ${className}`}>\n <div\n className=\"flex items-center gap-2\"\n role=\"group\"\n aria-label={ariaLabel}\n >\n {renderInputs()}\n </div>\n {error && errorMessage && (\n <span className=\"text-sm text-destructive\">{errorMessage}</span>\n )}\n </div>\n );\n },\n);\n\nOTPInput.displayName = \"OTPInput\";\n\nexport default OTPInput;\nexport { OTPInput };\n"],"mappings":";;;AAuDA,IAAM,aAA2C;CAC/C,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,IAAM,gBAGF;CACF,UAAU;EACR,MAAM;EACN,OAAO;EACP,OAAO;EACR;CACD,QAAQ;EACN,MAAM;EACN,OACE;EACF,OAAO;EACR;CACD,YAAY;EACV,MAA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