@alfadocs/ui-kit 1.115.0 → 1.116.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 (268) hide show
  1. package/dist/_chunks/accessible-target-Bs9ELM3l.js +6 -0
  2. package/dist/_chunks/{actions-cell-renderer-bI27uXXC.js → actions-cell-renderer-DzHxDyI7.js} +3 -3
  3. package/dist/_chunks/{address-fields-D5Ije0S2.js → address-fields-BFVCtfP2.js} +3 -3
  4. package/dist/_chunks/{anamnesis-summary-rows-BZ36ULQk.js → anamnesis-summary-rows-gEXqU5i5.js} +6 -6
  5. package/dist/_chunks/{appointment-card-D_-aBrx5.js → appointment-card-BMZoXaGx.js} +3 -3
  6. package/dist/_chunks/{appointment-peek-DWfcpoGy.js → appointment-peek-B1CCv-7J.js} +2 -2
  7. package/dist/_chunks/{appointment-timeline-DxLu3afn.js → appointment-timeline-0k4LxODn.js} +3 -3
  8. package/dist/_chunks/{appointment-tray-BhXOJpIJ.js → appointment-tray-DIxpgIXM.js} +2 -2
  9. package/dist/_chunks/arrow-down-left-DECv-dJt.js +15 -0
  10. package/dist/_chunks/{balance-badge-cell-CXHihM22.js → balance-badge-cell-L7bD0Nsh.js} +6 -6
  11. package/dist/_chunks/bill-line-table-WEIRDcv6.js +1563 -0
  12. package/dist/_chunks/{bmi-calculator-Ba4yoR31.js → bmi-calculator-BjUfXqcY.js} +2 -2
  13. package/dist/_chunks/{button-group-CUnNnt8a.js → button-group-BvU9vRnX.js} +2 -2
  14. package/dist/_chunks/{calculator-dialog-D4TyJwqy.js → calculator-dialog-BGX5XQCM.js} +2 -2
  15. package/dist/_chunks/{calendar-appointment-editor-dialog-BVzFi4hH.js → calendar-appointment-editor-dialog-DqZMb4yd.js} +16 -16
  16. package/dist/_chunks/{care-plan-card-BA3MfdfZ.js → care-plan-card-CfV8jiF0.js} +3 -3
  17. package/dist/_chunks/{care-plan-entry-card-CUtFZ813.js → care-plan-entry-card-Bt01kyTl.js} +3 -3
  18. package/dist/_chunks/{chart-DebrFZ6L.js → chart-BSx8cfMm.js} +2 -2
  19. package/dist/_chunks/circle-off-DuT9pVy2.js +16 -0
  20. package/dist/_chunks/combobox-BBCVQS-S.js +935 -0
  21. package/dist/_chunks/{compact-editor-fields-cP6yh7xv.js → compact-editor-fields-6sTWRLtf.js} +3 -3
  22. package/dist/_chunks/{contact-profile-card-DMXWBBkU.js → contact-profile-card-BRCHbQ3-.js} +2 -2
  23. package/dist/_chunks/{country-select-CUuGOAoZ.js → country-select-C2GdvRtS.js} +2 -2
  24. package/dist/_chunks/{cycle-calculator-C68V9rdH.js → cycle-calculator-Brd0PP4U.js} +2 -2
  25. package/dist/_chunks/{dashboard-grid-DrOkTtya.js → dashboard-grid-3aidD-IQ.js} +2 -2
  26. package/dist/_chunks/{toolbar-Bc3pjfG5.js → data-grid-ByhrYGVw.js} +3013 -3106
  27. package/dist/_chunks/{data-grid-tabs-CsLbIv0h.js → data-grid-tabs-D9Y4DeeH.js} +2 -2
  28. package/dist/_chunks/{data-table-DXaE2Ret.js → data-table-B47iw2CO.js} +101 -100
  29. package/dist/_chunks/{date-range-panel-CBFfkgmz.js → date-range-panel-B-DUtfw3.js} +7 -7
  30. package/dist/_chunks/default-tabs-BQcSqcNG.js +2250 -0
  31. package/dist/_chunks/dialog-CIUn5oLb.js +348 -0
  32. package/dist/_chunks/{document-preview-WvJKHJOP.js → document-preview-B_JGHsEW.js} +2 -2
  33. package/dist/_chunks/{dropdown-menu-CqxBthww.js → dropdown-menu-Dmbak7q6.js} +320 -248
  34. package/dist/_chunks/{due-date-calculator-C1UA5jpS.js → due-date-calculator-DzIQXEX5.js} +2 -2
  35. package/dist/_chunks/{editable-currency-cell-renderer-CtlMhLai.js → editable-currency-cell-renderer-p-Q1UkZS.js} +2 -2
  36. package/dist/_chunks/export-files-BByoK9Cg.js +248 -0
  37. package/dist/_chunks/{face-scheme-DkoxiDCh.js → face-scheme-CEjJUnNe.js} +19 -18
  38. package/dist/_chunks/{fetal-weight-DmZzMRzB.js → fetal-weight-CJTlfh_k.js} +2 -2
  39. package/dist/_chunks/{file-manager-DFFExyym.js → file-manager-DEe51ZDe.js} +5 -5
  40. package/dist/_chunks/format-price-CIX0YJZn.js +179 -0
  41. package/dist/_chunks/{grid-context-AwsLJRhH.js → grid-context-jn9y8tNE.js} +4 -4
  42. package/dist/_chunks/{hcg-doubling-CC-dbKE8.js → hcg-doubling-BUZQkSYC.js} +2 -2
  43. package/dist/_chunks/{header-settings-Df9q1uHt.js → header-settings-DNgvO8fS.js} +2 -2
  44. package/dist/_chunks/{heatmap-eXdtmEoU.js → heatmap-tn1WxoMT.js} +3 -3
  45. package/dist/_chunks/{help-me-write-templates-CWxgjDZl.js → help-me-write-templates-C28E_rOt.js} +2 -2
  46. package/dist/_chunks/highlighter-DSkckT2Q.js +15 -0
  47. package/dist/_chunks/{icon-button-group-C9mPK-bX.js → icon-button-group-Ca2VkXy5.js} +2 -2
  48. package/dist/_chunks/{kit-extensions-CzG0RmhQ.js → kit-extensions-BFfLg7c-.js} +6 -6
  49. package/dist/_chunks/{link-cell-renderer-Ditt5mvT.js → link-cell-renderer-D-Io828l.js} +4 -4
  50. package/dist/_chunks/{marketplace-app-shell-CcEHJgDd.js → marketplace-app-shell-CBHNg8x-.js} +4 -4
  51. package/dist/_chunks/money-OE6_oDPH.js +138 -0
  52. package/dist/_chunks/{muscle-scheme-BkmDUTmk.js → muscle-scheme-7UsRsCHP.js} +2 -2
  53. package/dist/_chunks/{notes-panel-BVYG_MJE.js → notes-panel-DexbfrFo.js} +3 -3
  54. package/dist/_chunks/number-input-DUSvP7Dq.js +625 -0
  55. package/dist/_chunks/{optical-prescription-CvbN8yD2.js → optical-prescription-Da_r8pMr.js} +2 -2
  56. package/dist/_chunks/parts-CtcTW1PN.js +869 -0
  57. package/dist/_chunks/{patient-details-DlT-vpSe.js → patient-details-PJ0Y__7t.js} +2 -2
  58. package/dist/_chunks/{patient-field-row-B54uzvu-.js → patient-field-row-0QP8KCVp.js} +5 -5
  59. package/dist/_chunks/{patient-search-DDRDCjZi.js → patient-search-Bdx_Ob3y.js} +2 -2
  60. package/dist/_chunks/{patient-summary-card-Dy9-CzON.js → patient-summary-card-BOfXDP8a.js} +3 -3
  61. package/dist/_chunks/{payment-request-card-BmV2pLoM.js → payment-request-card-_04afZEx.js} +14 -13
  62. package/dist/_chunks/{practice-results-BlxfBx-D.js → practice-results-CrBjScXX.js} +3 -3
  63. package/dist/_chunks/{pregnancy-dating-qZpw3zj8.js → pregnancy-dating-Bg_VUPwl.js} +2 -2
  64. package/dist/_chunks/{pregnancy-weight-gain-DQoOM8QV.js → pregnancy-weight-gain-B-eXFdmq.js} +2 -2
  65. package/dist/_chunks/{province-select-cVOlwEc5.js → province-select-CTM8A9SM.js} +2 -2
  66. package/dist/_chunks/{radiograph-panel.agent-C1LGeX-G.js → radiograph-panel.agent-9jwXlOXB.js} +2 -2
  67. package/dist/_chunks/{reserved.agent-6p3Hm4oH.js → reserved.agent-C1zRHaya.js} +4 -4
  68. package/dist/_chunks/{rich-text-editor-efaMWbYz.js → rich-text-editor-r80Zw8ll.js} +12 -11
  69. package/dist/_chunks/row-actions-Df7TJbNR.js +213 -0
  70. package/dist/_chunks/{signature-request-BnTihryS.js → signature-request-CgvjLic3.js} +3 -3
  71. package/dist/_chunks/{tab-bar-C_pggqVr.js → tab-bar-DTn8pHqH.js} +2 -2
  72. package/dist/_chunks/{tabs-CXYjr_8O.js → tabs-CsmgkiG6.js} +2 -2
  73. package/dist/_chunks/{task-editor-CSa6vQ9r.js → task-editor-DgUjtqpX.js} +168 -178
  74. package/dist/_chunks/{tasks-panel-CVjY1d7Q.js → tasks-panel-B5Nsf10r.js} +2 -2
  75. package/dist/_chunks/{theme-toggle-CObX2Ffa.js → theme-toggle-DfvdEg_V.js} +3 -3
  76. package/dist/_chunks/{token-insert-menu-Dl3x2ekR.js → token-insert-menu-BdcmK5Um.js} +2 -2
  77. package/dist/_chunks/toolbar-DbUQBrq4.js +159 -0
  78. package/dist/_chunks/{tooth-scheme-C-ALCHaV.js → tooth-scheme-LTkT4EXd.js} +2 -2
  79. package/dist/_chunks/{transaction-chip-CohY6sTA.js → transaction-chip-CkYd-3ky.js} +47 -57
  80. package/dist/_chunks/{treatment-receipt-BydbojdD.js → treatment-receipt-1VnuinhY.js} +2 -2
  81. package/dist/_chunks/undo-2-EBxWjj1W.js +15 -0
  82. package/dist/_chunks/{unit-converter-D77vmlzN.js → unit-converter-YKlHyUC2.js} +2 -2
  83. package/dist/_chunks/{use-appointment-details-read-BMAiQYo6.js → use-appointment-details-read-_r7cjTtm.js} +7 -7
  84. package/dist/_chunks/{verify-identity-types-C85EXNzy.js → verify-identity-types-D_LdByCp.js} +2 -2
  85. package/dist/_chunks/{widget-picker-U4JsEhQE.js → widget-picker-DrxJjEkv.js} +2 -2
  86. package/dist/_chunks/{workflow-map-B4XkcET0.js → workflow-map-D-u8_YSr.js} +2 -2
  87. package/dist/_chunks/{workflow-status-9wb7iWUd.js → workflow-status-fykpTxfb.js} +2 -2
  88. package/dist/_chunks/{workflow-webhook-action-DNSe65yd.js → workflow-webhook-action-DM3W8XZE.js} +2 -2
  89. package/dist/agent-catalog.json +1080 -1
  90. package/dist/agent-i18n/en.json +50 -0
  91. package/dist/components/_shared/accessible-target.d.ts +12 -0
  92. package/dist/components/_shared/decimal.d.ts +171 -0
  93. package/dist/components/_shared/format-price.d.ts +54 -2
  94. package/dist/components/address-fields/index.js +1 -1
  95. package/dist/components/appointment-card/index.js +2 -2
  96. package/dist/components/appointment-details-panel/index.js +1 -1
  97. package/dist/components/appointment-peek/index.js +1 -1
  98. package/dist/components/appointment-timeline/index.js +1 -1
  99. package/dist/components/bill-line-table/bill-line-table.agent.d.ts +4 -0
  100. package/dist/components/bill-line-table/bill-line-table.columns.d.ts +47 -0
  101. package/dist/components/bill-line-table/bill-line-table.d.ts +4 -0
  102. package/dist/components/bill-line-table/bill-line-table.model.d.ts +173 -0
  103. package/dist/components/bill-line-table/bill-line-table.types.d.ts +443 -0
  104. package/dist/components/bill-line-table/bill-line-table.variants.d.ts +34 -0
  105. package/dist/components/bill-line-table/index.d.ts +6 -0
  106. package/dist/components/bill-line-table/index.js +23 -0
  107. package/dist/components/bill-table/bill-table.agent.d.ts +4 -0
  108. package/dist/components/bill-table/bill-table.d.ts +13 -0
  109. package/dist/components/bill-table/bill-table.variants.d.ts +55 -0
  110. package/dist/components/bill-table/cells.d.ts +89 -0
  111. package/dist/components/bill-table/columns.d.ts +21 -0
  112. package/dist/components/bill-table/default-tabs.d.ts +21 -0
  113. package/dist/components/bill-table/handle.d.ts +19 -0
  114. package/dist/components/bill-table/index.d.ts +7 -0
  115. package/dist/components/bill-table/index.js +19 -0
  116. package/dist/components/bill-table/model.d.ts +103 -0
  117. package/dist/components/bill-table/row-actions.d.ts +27 -0
  118. package/dist/components/bill-table/status-maps.d.ts +225 -0
  119. package/dist/components/bill-table/types.d.ts +542 -0
  120. package/dist/components/bmi-calculator/index.js +1 -1
  121. package/dist/components/booking/index.js +1 -1
  122. package/dist/components/button-group/index.js +1 -1
  123. package/dist/components/calculator-dialog/index.js +1 -1
  124. package/dist/components/care-plan-card/index.js +1 -1
  125. package/dist/components/care-plan-entry-card/index.js +1 -1
  126. package/dist/components/chart/index.js +1 -1
  127. package/dist/components/combobox/combobox.d.ts +59 -1
  128. package/dist/components/combobox/index.d.ts +1 -1
  129. package/dist/components/combobox/index.js +1 -1
  130. package/dist/components/contact-profile-card/index.js +1 -1
  131. package/dist/components/country-select/index.js +1 -1
  132. package/dist/components/cycle-calculator/index.js +1 -1
  133. package/dist/components/dashboard-grid/index.js +1 -1
  134. package/dist/components/data-grid/body.d.ts +6 -0
  135. package/dist/components/data-grid/data-grid.variants.d.ts +1 -9
  136. package/dist/components/data-grid/editors.d.ts +7 -1
  137. package/dist/components/data-grid/index.js +9 -8
  138. package/dist/components/data-grid/selection.d.ts +10 -0
  139. package/dist/components/data-grid/types.d.ts +61 -11
  140. package/dist/components/data-grid-tabs/index.js +1 -1
  141. package/dist/components/data-table/index.js +4 -4
  142. package/dist/components/dialog/focus-return.d.ts +12 -0
  143. package/dist/components/dialog/index.js +1 -1
  144. package/dist/components/document-preview/index.js +1 -1
  145. package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -0
  146. package/dist/components/dropdown-menu/index.js +1 -1
  147. package/dist/components/due-date-calculator/index.js +1 -1
  148. package/dist/components/face-scheme/index.js +1 -1
  149. package/dist/components/fetal-weight/index.js +1 -1
  150. package/dist/components/file-manager/index.js +1 -1
  151. package/dist/components/hcg-doubling/index.js +1 -1
  152. package/dist/components/header-settings/index.js +1 -1
  153. package/dist/components/heatmap/index.js +1 -1
  154. package/dist/components/icon-button-group/index.js +1 -1
  155. package/dist/components/index.d.ts +6 -0
  156. package/dist/components/money/index.js +1 -1
  157. package/dist/components/money/money.d.ts +39 -6
  158. package/dist/components/muscle-scheme/index.js +1 -1
  159. package/dist/components/notes-panel/index.js +1 -1
  160. package/dist/components/number-input/index.d.ts +2 -2
  161. package/dist/components/number-input/index.js +1 -1
  162. package/dist/components/number-input/number-input.d.ts +43 -2
  163. package/dist/components/number-input/use-locale-number.d.ts +67 -3
  164. package/dist/components/optical-prescription/index.js +1 -1
  165. package/dist/components/patient-details/index.js +1 -1
  166. package/dist/components/patient-search/index.js +1 -1
  167. package/dist/components/patient-summary-card/index.js +1 -1
  168. package/dist/components/patient-table/index.js +1 -1
  169. package/dist/components/payment-card/index.js +1 -1
  170. package/dist/components/practice-results/index.js +1 -1
  171. package/dist/components/pregnancy-dating/index.js +1 -1
  172. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  173. package/dist/components/province-select/index.js +1 -1
  174. package/dist/components/radiograph-panel/index.js +1 -1
  175. package/dist/components/rich-text-editor/index.js +2 -2
  176. package/dist/components/row-actions/index.d.ts +3 -0
  177. package/dist/components/row-actions/index.js +5 -0
  178. package/dist/components/row-actions/row-actions.d.ts +63 -0
  179. package/dist/components/skeleton-scheme/index.js +1 -1
  180. package/dist/components/smart-date/smart-date.d.ts +1 -1
  181. package/dist/components/tab-bar/index.js +1 -1
  182. package/dist/components/tabs/index.js +1 -1
  183. package/dist/components/task-editor/index.js +1 -1
  184. package/dist/components/tasks-panel/index.js +1 -1
  185. package/dist/components/theme-toggle/index.js +1 -1
  186. package/dist/components/token-insert-menu/index.js +1 -1
  187. package/dist/components/tooth-scheme/index.js +1 -1
  188. package/dist/components/transaction-chip/index.js +1 -1
  189. package/dist/components/transaction-chip/transaction-chip.d.ts +1 -1
  190. package/dist/components/treatment-receipt/index.js +1 -1
  191. package/dist/components/unit-converter/index.js +1 -1
  192. package/dist/components/widget-picker/index.js +1 -1
  193. package/dist/components/workflow/index.js +1 -1
  194. package/dist/components/workflow-status/index.js +1 -1
  195. package/dist/core.css +1 -1
  196. package/dist/decimal/index.js +149 -0
  197. package/dist/host-compat.css +4 -1
  198. package/dist/i18n/locales/ar.d.ts +248 -0
  199. package/dist/i18n/locales/ar.js +249 -1
  200. package/dist/i18n/locales/de.d.ts +248 -0
  201. package/dist/i18n/locales/de.js +249 -1
  202. package/dist/i18n/locales/el.d.ts +248 -0
  203. package/dist/i18n/locales/el.js +249 -1
  204. package/dist/i18n/locales/en.d.ts +248 -0
  205. package/dist/i18n/locales/en.js +249 -1
  206. package/dist/i18n/locales/es.d.ts +248 -0
  207. package/dist/i18n/locales/es.js +249 -1
  208. package/dist/i18n/locales/fr.d.ts +248 -0
  209. package/dist/i18n/locales/fr.js +249 -1
  210. package/dist/i18n/locales/hi.d.ts +248 -0
  211. package/dist/i18n/locales/hi.js +249 -1
  212. package/dist/i18n/locales/it.d.ts +248 -0
  213. package/dist/i18n/locales/it.js +249 -1
  214. package/dist/i18n/locales/ja.d.ts +248 -0
  215. package/dist/i18n/locales/ja.js +249 -1
  216. package/dist/i18n/locales/nl.d.ts +248 -0
  217. package/dist/i18n/locales/nl.js +249 -1
  218. package/dist/i18n/locales/pl.d.ts +248 -0
  219. package/dist/i18n/locales/pl.js +249 -1
  220. package/dist/i18n/locales/pt.d.ts +248 -0
  221. package/dist/i18n/locales/pt.js +249 -1
  222. package/dist/i18n/locales/ro.d.ts +248 -0
  223. package/dist/i18n/locales/ro.js +249 -1
  224. package/dist/i18n/locales/ru.d.ts +248 -0
  225. package/dist/i18n/locales/ru.js +249 -1
  226. package/dist/i18n/locales/sq.d.ts +248 -0
  227. package/dist/i18n/locales/sq.js +249 -1
  228. package/dist/i18n/locales/sv.d.ts +248 -0
  229. package/dist/i18n/locales/sv.js +249 -1
  230. package/dist/i18n/locales/tr.d.ts +248 -0
  231. package/dist/i18n/locales/tr.js +249 -1
  232. package/dist/i18n/locales/zh.d.ts +248 -0
  233. package/dist/i18n/locales/zh.js +249 -1
  234. package/dist/index.js +1298 -1246
  235. package/dist/locales/ar.json +249 -1
  236. package/dist/locales/de.json +249 -1
  237. package/dist/locales/el.json +249 -1
  238. package/dist/locales/en.json +249 -1
  239. package/dist/locales/es.json +249 -1
  240. package/dist/locales/fr.json +249 -1
  241. package/dist/locales/hi.json +249 -1
  242. package/dist/locales/it.json +249 -1
  243. package/dist/locales/ja.json +249 -1
  244. package/dist/locales/nl.json +249 -1
  245. package/dist/locales/pl.json +249 -1
  246. package/dist/locales/pt.json +249 -1
  247. package/dist/locales/ro.json +249 -1
  248. package/dist/locales/ru.json +249 -1
  249. package/dist/locales/sq.json +249 -1
  250. package/dist/locales/sv.json +249 -1
  251. package/dist/locales/tr.json +249 -1
  252. package/dist/locales/zh.json +249 -1
  253. package/dist/patterns/anamnesis/index.js +1 -1
  254. package/dist/patterns/calendar/index.js +1 -1
  255. package/dist/patterns/help-me-write-templates/index.js +1 -1
  256. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  257. package/dist/patterns/signature-request/index.js +1 -1
  258. package/dist/patterns/verify-identity/index.js +1 -1
  259. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  260. package/dist/tokens.css +1 -1
  261. package/package.json +17 -1
  262. package/dist/_chunks/combobox-duuDRI1t.js +0 -688
  263. package/dist/_chunks/dialog-BTjSQjdY.js +0 -274
  264. package/dist/_chunks/format-price-BcFBa-WP.js +0 -52
  265. package/dist/_chunks/money-Tsczpjfz.js +0 -102
  266. package/dist/_chunks/number-input-CVwI1ltI.js +0 -423
  267. package/dist/_chunks/parts-Wz2LeGnH.js +0 -1113
  268. package/dist/_chunks/undo-2-CYNAzclj.js +0 -26
@@ -1,423 +0,0 @@
1
- import { jsxs as Se, jsx as x } from "react/jsx-runtime";
2
- import { useMemo as te, forwardRef as ke, useId as ze, useRef as q, useCallback as T, useState as H, useEffect as Me } from "react";
3
- import { c as W } from "./index-D2ZczOXr.js";
4
- import { useTranslation as Ue } from "react-i18next";
5
- import { u as Te } from "./use-controllable-state-BiY4xTzM.js";
6
- import { u as Pe, a as Be } from "./form-field-context-DtiROUJV.js";
7
- import { c as Re } from "./compose-refs-C0k0tdqF.js";
8
- import { u as Ae } from "./registry-DvAUVLHh.js";
9
- import { C as je } from "./chevron-down-DWE7GSq9.js";
10
- import { C as Ee } from "./chevron-up-umRGgtJA.js";
11
- const Le = {
12
- id: "number-input",
13
- capabilities: ["set_value"],
14
- state: {
15
- value: {
16
- type: "number | null",
17
- descriptionKey: "ui.agent.numberInput.state.value",
18
- description: "Current numeric value, or null when empty.",
19
- read: (n) => n.getValue()
20
- },
21
- isEmpty: {
22
- type: "boolean",
23
- descriptionKey: "ui.agent.numberInput.state.isEmpty",
24
- description: "Whether the input has no value.",
25
- read: (n) => n.getValue() === null
26
- }
27
- },
28
- actions: {
29
- set_value: {
30
- safety: "write",
31
- argsType: "{ value: number | null }",
32
- argsSchema: {
33
- type: "object",
34
- properties: { value: { type: ["number", "null"] } },
35
- required: ["value"]
36
- },
37
- idempotent: !0,
38
- examples: [{ args: { value: 42 } }, { args: { value: null } }],
39
- descriptionKey: "ui.agent.numberInput.actions.setValue",
40
- description: "Replace the numeric value, or pass null to clear.",
41
- invoke: (n, s) => {
42
- n.setValue(s.value);
43
- }
44
- },
45
- clear: {
46
- safety: "destructive",
47
- idempotent: !0,
48
- descriptionKey: "ui.agent.numberInput.actions.clear",
49
- description: "Empty the input. Loses any typed value.",
50
- invoke: (n) => {
51
- n.clear();
52
- }
53
- },
54
- focus: {
55
- safety: "read",
56
- idempotent: !0,
57
- descriptionKey: "ui.agent.numberInput.actions.focus",
58
- description: "Move keyboard focus to the input.",
59
- invoke: (n) => {
60
- n.focus();
61
- }
62
- }
63
- },
64
- domHooks: {
65
- root: {
66
- attr: "data-component",
67
- value: "number-input",
68
- description: "Marks the NumberInput wrapper."
69
- },
70
- instanceId: {
71
- attr: "data-component-id",
72
- sourceProp: "id",
73
- description: "Sourced from the id prop."
74
- }
75
- }
76
- };
77
- function Ke(n) {
78
- let s = "";
79
- for (const l of n) {
80
- const r = l.codePointAt(0);
81
- r !== void 0 && (r >= 1632 && r <= 1641 ? s += String.fromCodePoint(48 + (r - 1632)) : r >= 1776 && r <= 1785 ? s += String.fromCodePoint(48 + (r - 1776)) : s += l);
82
- }
83
- return s;
84
- }
85
- function qe(n, s, l) {
86
- return te(() => {
87
- var k, m;
88
- const r = new Intl.NumberFormat(n).formatToParts(1234.5), u = ((k = r.find((o) => o.type === "decimal")) == null ? void 0 : k.value) ?? ".", S = ((m = r.find((o) => o.type === "group")) == null ? void 0 : m.value) ?? ",", p = s === "currency" ? new Intl.NumberFormat(n, {
89
- style: "currency",
90
- currency: l ?? "USD"
91
- }) : s === "percentage" ? new Intl.NumberFormat(n, {
92
- style: "percent",
93
- maximumFractionDigits: 4
94
- }) : s === "integer" ? new Intl.NumberFormat(n, { maximumFractionDigits: 0 }) : new Intl.NumberFormat(n, { maximumFractionDigits: 10 }), P = (o) => Number.isFinite(o) ? p.format(o) : "", B = (o) => {
95
- if (!o) return NaN;
96
- const y = Ke(o), z = y.trim(), D = z.startsWith("-") || z.startsWith("−");
97
- let g = "";
98
- for (const v of y)
99
- v >= "0" && v <= "9" ? g += v : v === u && (g += ".");
100
- if (!g || g === ".") return NaN;
101
- let d = Number(g);
102
- return Number.isFinite(d) ? (D && (d = -d), s === "percentage" && (d = d / 100), d) : NaN;
103
- };
104
- let N = "decimal";
105
- if (s === "integer")
106
- N = "numeric";
107
- else if (s === "currency")
108
- try {
109
- const { maximumFractionDigits: o } = new Intl.NumberFormat(n, {
110
- style: "currency",
111
- currency: l ?? "USD"
112
- }).resolvedOptions();
113
- N = o === 0 ? "numeric" : "decimal";
114
- } catch {
115
- N = "decimal";
116
- }
117
- return {
118
- format: P,
119
- parse: B,
120
- decimalSeparator: u,
121
- groupingSeparator: S,
122
- inputMode: N
123
- };
124
- }, [n, s, l]);
125
- }
126
- const He = W(
127
- [
128
- "ds:flex ds:items-center ds:rounded-[var(--radius-sm)]",
129
- "ds:border ds:bg-input ds:text-foreground",
130
- "ds:shadow-[var(--shadow-input)]",
131
- "ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
132
- "ds:focus-within:outline-[length:var(--focus-ring-width)] ds:focus-within:outline-solid",
133
- "ds:focus-within:outline-ring ds:focus-within:outline-offset-[length:var(--focus-ring-offset)]",
134
- "ds:has-[:disabled]:cursor-not-allowed ds:has-[:disabled]:opacity-50"
135
- ].join(" "),
136
- {
137
- variants: {
138
- size: {
139
- sm: "ds:h-8 ds:text-[length:var(--font-size-sm)]",
140
- md: "ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)]",
141
- lg: "ds:h-12 ds:text-[length:var(--font-size-lg)]"
142
- },
143
- tone: {
144
- default: "ds:border-[color:var(--control-border)]",
145
- error: "ds:border-destructive ds:focus-within:outline-destructive"
146
- },
147
- // Intrinsic sizes shrink-wrap the frame around field, unit and paddings;
148
- // the floor keeps a bare 'sm' field a valid tap target.
149
- inline: {
150
- full: "ds:w-full",
151
- sm: "ds:w-fit ds:min-w-[var(--min-target-size)]",
152
- md: "ds:w-fit ds:min-w-[var(--min-target-size)]",
153
- lg: "ds:w-fit ds:min-w-[var(--min-target-size)]"
154
- }
155
- },
156
- defaultVariants: { size: "md", tone: "default", inline: "full" }
157
- }
158
- ), We = W(
159
- "ds:min-w-0 ds:bg-transparent ds:outline-none ds:tabular-nums ds:disabled:cursor-not-allowed",
160
- {
161
- variants: {
162
- variant: { stepper: "ds:ps-2", plain: "ds:ps-3" },
163
- hasUnit: { true: "ds:pe-1", false: "" },
164
- // `ch` is the advance of "0", so with tabular numerals N digits fit
165
- // exactly; box-content keeps the paddings outside that count.
166
- inline: {
167
- full: "ds:flex-1 ds:w-full",
168
- sm: "ds:box-content ds:w-[8ch]",
169
- md: "ds:box-content ds:w-[12ch]",
170
- lg: "ds:box-content ds:w-[16ch]"
171
- }
172
- },
173
- compoundVariants: [
174
- { variant: "stepper", hasUnit: !1, class: "ds:pe-2" },
175
- { variant: "plain", hasUnit: !1, class: "ds:pe-3" },
176
- // Alignment: exactly one of these matches, because two text-align
177
- // utilities in one class list resolve by stylesheet order, not by the
178
- // order they were written.
179
- // A unit or an answer-sized box means the number is read AGAINST
180
- // something — stranding it at the far start left a gap wide enough to
181
- // read as two separate controls.
182
- { inline: "full", hasUnit: !1, class: "ds:text-start" },
183
- { inline: "full", hasUnit: !0, class: "ds:text-end" },
184
- { inline: ["sm", "md", "lg"], class: "ds:text-end" }
185
- ],
186
- defaultVariants: { variant: "stepper", hasUnit: !1, inline: "full" }
187
- }
188
- ), Oe = W(
189
- "ds:shrink-0 ds:select-none ds:whitespace-nowrap ds:text-muted-foreground",
190
- {
191
- variants: {
192
- variant: { stepper: "ds:pe-1", plain: "ds:pe-3" }
193
- },
194
- defaultVariants: { variant: "stepper" }
195
- }
196
- ), ee = [
197
- "ds:inline-flex ds:items-center ds:justify-center",
198
- "ds:h-full ds:shrink-0",
199
- "ds:text-muted-foreground ds:hover:text-foreground",
200
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
201
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
202
- ].join(" "), _e = () => typeof navigator < "u" && navigator.language ? navigator.language : "en-US", $e = (n) => typeof n == "string" && n.trim() !== "" ? n : void 0;
203
- function Ge(n) {
204
- if (!Number.isFinite(n)) return 0;
205
- const s = String(n), l = s.indexOf(".");
206
- return l === -1 ? 0 : s.length - l - 1;
207
- }
208
- function Je(n, s) {
209
- if (s <= 0 || !Number.isFinite(s)) return n;
210
- const r = 10 ** Ge(s);
211
- return Math.round(n * r) / r;
212
- }
213
- const Qe = ke(
214
- ({
215
- value: n,
216
- defaultValue: s,
217
- onChange: l,
218
- min: r,
219
- max: u,
220
- step: S = 1,
221
- mode: p = "integer",
222
- currency: P,
223
- locale: B,
224
- size: N = "md",
225
- tone: k,
226
- variant: m = "stepper",
227
- unit: o,
228
- inline: y = "full",
229
- className: z,
230
- id: D,
231
- disabled: g,
232
- onFocus: d,
233
- onBlur: v,
234
- onKeyDown: R,
235
- ...ne
236
- }, re) => {
237
- const { t: O, i18n: se } = Ue("ui"), F = Pe(), ie = Be(F, D), M = !!(F.disabled || g), _ = ze(), ae = [F.describedBy, o ? _ : void 0].filter(Boolean).join(" ") || void 0, oe = B ?? $e(se.language) ?? _e(), A = qe(oe, p, P), {
238
- decimalSeparator: U,
239
- groupingSeparator: $,
240
- format: j,
241
- parse: G
242
- } = A, J = q(null), ue = Re(re, J), [le, de] = Te({
243
- value: n,
244
- defaultValue: s ?? null,
245
- onChange: l
246
- }), a = le ?? null, Q = q(a);
247
- Q.current = a;
248
- const C = T(
249
- (e) => {
250
- const t = p === "percentage" ? e * 100 : e;
251
- return (Number.isInteger(t) ? String(t) : t.toString()).replace(".", U);
252
- },
253
- [p, U]
254
- ), b = T(
255
- (e) => e == null || Number.isNaN(e) ? "" : j(e),
256
- [j]
257
- ), [E, c] = H(
258
- () => b(a)
259
- ), w = q(!1), [ce, h] = H(!1), [L, V] = H(!1), K = T(
260
- (e) => {
261
- if (e >= "0" && e <= "9") return !0;
262
- const t = e.codePointAt(0) ?? 0;
263
- return t >= 1632 && t <= 1641 || t >= 1776 && t <= 1785 ? !0 : e === U || e === $ || e === "-" || e === "−";
264
- },
265
- [U, $]
266
- ), fe = T(
267
- (e) => {
268
- let t = "";
269
- for (const i of e)
270
- K(i) && (t += i);
271
- return t;
272
- },
273
- [K]
274
- );
275
- Me(() => {
276
- !w.current && !L && c(b(a));
277
- }, [a, b, L]);
278
- const pe = ce || L || a !== null && (r !== void 0 && a < r || u !== void 0 && a > u), X = F.invalid || pe, me = X ? "error" : k ?? "default", f = (e) => {
279
- de(e);
280
- }, I = (e) => {
281
- let i = (a ?? 0) + S * e;
282
- r !== void 0 && (i = Math.max(r, i)), u !== void 0 && (i = Math.min(u, i)), i = Je(i, S), f(i), h(!1), c(
283
- w.current ? C(i) : b(i)
284
- );
285
- }, Y = (e) => {
286
- f(e), h(!1), c(
287
- w.current ? C(e) : b(e)
288
- );
289
- }, ve = (e) => {
290
- if (R == null || R(e), e.defaultPrevented || M) return;
291
- const { key: t, shiftKey: i } = e;
292
- t === "ArrowUp" ? (e.preventDefault(), I(i ? 10 : 1)) : t === "ArrowDown" ? (e.preventDefault(), I(i ? -10 : -1)) : t === "PageUp" ? (e.preventDefault(), I(100)) : t === "PageDown" ? (e.preventDefault(), I(-100)) : t === "Home" && r !== void 0 ? (e.preventDefault(), Y(r)) : t === "End" && u !== void 0 && (e.preventDefault(), Y(u));
293
- }, be = (e) => {
294
- const t = fe(e.target.value);
295
- if (c(t), t.trim() === "") {
296
- f(null), h(!1), V(!1);
297
- return;
298
- }
299
- const i = G(t);
300
- Number.isNaN(i) || (f(i), V(!1));
301
- }, ge = (e) => {
302
- const { data: t } = e.nativeEvent;
303
- typeof t != "string" || t.length !== 1 || K(t) || e.preventDefault();
304
- }, he = (e) => {
305
- d == null || d(e), w.current = !0, a != null && c(C(a));
306
- }, Ne = (e) => {
307
- if (v == null || v(e), w.current = !1, E.trim() === "") {
308
- f(null), h(!1), V(!1), c("");
309
- return;
310
- }
311
- const t = G(E);
312
- if (Number.isNaN(t)) {
313
- V(!0), h(!1), f(null);
314
- return;
315
- }
316
- const i = r !== void 0 && t < r || u !== void 0 && t > u;
317
- h(i), V(!1), f(t), c(b(t));
318
- }, Z = (e) => {
319
- e.preventDefault();
320
- }, ye = () => I(1), we = () => I(-1), Ie = te(
321
- () => ({
322
- getValue: () => Q.current,
323
- setValue: (e) => {
324
- f(e), c(
325
- e === null ? "" : w.current ? C(e) : b(e)
326
- );
327
- },
328
- clear: () => {
329
- f(null), c(""), h(!1);
330
- },
331
- focus: () => {
332
- var e;
333
- return (e = J.current) == null ? void 0 : e.focus();
334
- }
335
- }),
336
- // The handle is reconstructed per render; consumers (the agent runtime)
337
- // re-register only when the identity changes, which is a cheap no-op.
338
- // eslint-disable-next-line react-hooks/exhaustive-deps
339
- [C, b]
340
- );
341
- Ae(Le, Ie, D);
342
- const xe = M || r !== void 0 && a !== null && a <= r, De = M || u !== void 0 && a !== null && a >= u, Fe = a ?? void 0, Ce = (p === "currency" || p === "percentage") && a !== null && a !== null ? j(a) : void 0, Ve = A.inputMode === "numeric" ? "[0-9]*" : void 0;
343
- return /* @__PURE__ */ Se(
344
- "div",
345
- {
346
- className: He({
347
- size: N,
348
- tone: me,
349
- inline: y,
350
- className: z
351
- }),
352
- "data-component": "number-input",
353
- "data-component-id": D,
354
- "data-mode": p,
355
- "data-variant": m,
356
- "data-inline": y,
357
- children: [
358
- m === "stepper" ? /* @__PURE__ */ x(
359
- "button",
360
- {
361
- type: "button",
362
- tabIndex: -1,
363
- "aria-label": O("inputs.number.decrement", "Decrement"),
364
- onClick: we,
365
- onMouseDown: Z,
366
- disabled: xe,
367
- className: `${ee} ds:ps-2 ds:pe-1`,
368
- children: /* @__PURE__ */ x(je, { "aria-hidden": "true", className: "ds:size-4" })
369
- }
370
- ) : null,
371
- /* @__PURE__ */ x(
372
- "input",
373
- {
374
- ref: ue,
375
- id: ie,
376
- type: "text",
377
- role: "spinbutton",
378
- inputMode: A.inputMode,
379
- pattern: Ve,
380
- autoComplete: "off",
381
- value: E,
382
- disabled: M,
383
- "aria-valuemin": r,
384
- "aria-valuemax": u,
385
- "aria-valuenow": Fe,
386
- "aria-valuetext": Ce,
387
- "aria-invalid": X || void 0,
388
- "aria-required": F.required || void 0,
389
- "aria-describedby": ae,
390
- onBeforeInput: ge,
391
- onChange: be,
392
- onFocus: he,
393
- onBlur: Ne,
394
- onKeyDown: ve,
395
- className: We({ variant: m, hasUnit: !!o, inline: y }),
396
- ...ne
397
- }
398
- ),
399
- o ? /* @__PURE__ */ x("span", { id: _, className: Oe({ variant: m }), children: o }) : null,
400
- m === "stepper" ? /* @__PURE__ */ x(
401
- "button",
402
- {
403
- type: "button",
404
- tabIndex: -1,
405
- "aria-label": O("inputs.number.increment", "Increment"),
406
- onClick: ye,
407
- onMouseDown: Z,
408
- disabled: De,
409
- className: `${ee} ds:ps-1 ds:pe-2`,
410
- children: /* @__PURE__ */ x(Ee, { "aria-hidden": "true", className: "ds:size-4" })
411
- }
412
- ) : null
413
- ]
414
- }
415
- );
416
- }
417
- );
418
- Qe.displayName = "NumberInput";
419
- export {
420
- Qe as N,
421
- qe as u
422
- };
423
- //# sourceMappingURL=number-input-CVwI1ltI.js.map