@jfrader/ui 0.5.0 → 0.6.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 (314) hide show
  1. package/README.md +18 -1
  2. package/dist/accordion-D6myONB9.js +206 -0
  3. package/dist/accordion.js +1 -1
  4. package/dist/activity-rings-Uszvwqdl.js +528 -0
  5. package/dist/activity-rings.js +2 -0
  6. package/dist/{alert-DS_einpy.js → alert-Bhj-qSMs.js} +15 -14
  7. package/dist/alert.js +1 -1
  8. package/dist/{announcement-bar-B58xempt.js → announcement-bar-B5J33QUh.js} +132 -131
  9. package/dist/announcement-bar.js +1 -1
  10. package/dist/avatar-B6idYC59.js +146 -0
  11. package/dist/{avatar-group-DOQQuV51.js → avatar-group-DvP8mAE-.js} +10 -9
  12. package/dist/avatar-group.js +1 -1
  13. package/dist/avatar.js +1 -1
  14. package/dist/badge-CfhTcA-Z.js +120 -0
  15. package/dist/badge.js +1 -1
  16. package/dist/billing-toggle-CgC7yxxo.js +349 -0
  17. package/dist/billing-toggle.js +2 -0
  18. package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-BFQKO0Wo.js} +287 -268
  19. package/dist/bottom-sheet.js +1 -1
  20. package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-CG3akw-b.js} +28 -20
  21. package/dist/breadcrumbs.js +1 -1
  22. package/dist/{button-C92uYFJW.js → button-C6OV0C7J.js} +21 -20
  23. package/dist/button-group-B9wP2ddS.js +611 -0
  24. package/dist/button-group.js +2 -0
  25. package/dist/button.js +1 -1
  26. package/dist/calendar-Bg6D2sul.js +377 -0
  27. package/dist/calendar.js +1 -1
  28. package/dist/calendar.utils-azmB4Ej7.js +79 -0
  29. package/dist/card-C008OQCp.js +164 -0
  30. package/dist/card.js +1 -1
  31. package/dist/carousel-lTH4Foke.js +475 -0
  32. package/dist/carousel.js +1 -1
  33. package/dist/chat-thread-DVa17BRC.js +864 -0
  34. package/dist/chat-thread.js +2 -0
  35. package/dist/{checkbox-cFquiSdy.js → checkbox-CClE61GV.js} +23 -21
  36. package/dist/checkbox.js +1 -1
  37. package/dist/{chip-group-DTQd_M-G.js → chip-group-BZUX9KPF.js} +19 -17
  38. package/dist/chip-group.js +1 -1
  39. package/dist/{choice-control-5kJkLXgv.js → choice-control-BsWOZPc9.js} +1 -1
  40. package/dist/{code-block-ahnRi-g8.js → code-block-CYP89_6h.js} +99 -97
  41. package/dist/code-block.js +1 -1
  42. package/dist/{combobox-Bhzvu9ma.js → combobox-D2Oc-co7.js} +131 -125
  43. package/dist/combobox.js +1 -1
  44. package/dist/command-palette-BrT1n9bb.js +394 -0
  45. package/dist/command-palette.js +1 -1
  46. package/dist/comment-thread-BnUHxviq.js +772 -0
  47. package/dist/comment-thread.js +2 -0
  48. package/dist/{container-BOaSptJa.js → container-BxtwJSSD.js} +3 -2
  49. package/dist/container.js +1 -1
  50. package/dist/context-menu-I4i0LRpm.js +371 -0
  51. package/dist/context-menu.js +2 -0
  52. package/dist/{copy-button-ByiA6D3R.js → copy-button-C0p_qrgf.js} +4 -4
  53. package/dist/copy-button.js +1 -1
  54. package/dist/{countdown-Dp_TD1VP.js → countdown-EcpV6rXy.js} +18 -17
  55. package/dist/countdown.js +1 -1
  56. package/dist/css-BYJhdGh-.js +2 -0
  57. package/dist/{date-picker-5zKSSuFF.js → date-picker-D-bn-iHs.js} +15 -14
  58. package/dist/date-picker.js +1 -1
  59. package/dist/date-range-picker-rXcZsI1Y.js +589 -0
  60. package/dist/date-range-picker.js +1 -1
  61. package/dist/dialog-CR1xdkrC.js +222 -0
  62. package/dist/dialog.js +1 -1
  63. package/dist/{divider-DYoJf0I_.js → divider-zOJzkcHh.js} +23 -21
  64. package/dist/divider.js +1 -1
  65. package/dist/drawer-CceaEhCr.js +590 -0
  66. package/dist/drawer.js +1 -1
  67. package/dist/{empty-state-CDgrjPPf.js → empty-state-DO0ApylK.js} +2 -1
  68. package/dist/empty-state.js +1 -1
  69. package/dist/{expandable-card-C-qJcZ14.js → expandable-card-W97vjix9.js} +59 -51
  70. package/dist/expandable-card.js +1 -1
  71. package/dist/expanding-search-Bb2_YfNx.js +239 -0
  72. package/dist/expanding-search.js +2 -0
  73. package/dist/{field-anatomy-COVdNpf5.js → field-anatomy-BDIP42MI.js} +2 -1
  74. package/dist/file-dropzone-Bi5ikRIz.js +458 -0
  75. package/dist/file-dropzone.js +1 -1
  76. package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-QRnC4S_H.js} +36 -33
  77. package/dist/filter-toolbar.js +1 -1
  78. package/dist/{flex-Dh-_J5-U.js → flex-CS7eMRcK.js} +2 -2
  79. package/dist/flex.js +1 -1
  80. package/dist/{hold-to-confirm-DjB2EVjM.js → hold-to-confirm-CVBA0wNT.js} +18 -17
  81. package/dist/hold-to-confirm.js +1 -1
  82. package/dist/{hover-card-B-nrCIy2.js → hover-card-DN1EAlQA.js} +26 -25
  83. package/dist/hover-card.js +1 -1
  84. package/dist/{icon-wrapper-stN8sD7R.js → icon-wrapper-C-zMD0uL.js} +1 -1
  85. package/dist/{image-compare-ciuhPtQZ.js → image-compare-Ln2UUqTU.js} +20 -19
  86. package/dist/image-compare.js +1 -1
  87. package/dist/index.js +98 -78
  88. package/dist/{inline-edit-C0eeml65.js → inline-edit-D-pR2RPC.js} +22 -21
  89. package/dist/inline-edit.js +1 -1
  90. package/dist/{input-control-DmMuAuPS.js → input-control-B6HVBgwl.js} +1 -1
  91. package/dist/{json-viewer-BcySQfjZ.js → json-viewer-Dro3WrjS.js} +34 -29
  92. package/dist/json-viewer.js +1 -1
  93. package/dist/{kbd-C3ACoMoE.js → kbd-BI_9qzYr.js} +2 -1
  94. package/dist/kbd.js +1 -1
  95. package/dist/keycap-keyboard-Cdx-OAS1.js +311 -0
  96. package/dist/keycap-keyboard.js +2 -0
  97. package/dist/{layout-style-Cbd1Vilw.js → layout-style-BE0gSqrH.js} +1 -1
  98. package/dist/lightbox-gallery-D0YaSTut.js +777 -0
  99. package/dist/lightbox-gallery.js +2 -0
  100. package/dist/link-unfurl-CReyIjyy.js +695 -0
  101. package/dist/link-unfurl.js +2 -0
  102. package/dist/{listbox-style-WX-RASp1.js → listbox-style-DNOxAulu.js} +1 -1
  103. package/dist/{loading-ring-B8-30Dl1.js → loading-ring-D0lGrK8z.js} +1 -1
  104. package/dist/locale-switcher-CZF7XNYG.js +295 -0
  105. package/dist/locale-switcher.js +2 -0
  106. package/dist/mention-input-BjjAbJCf.js +600 -0
  107. package/dist/mention-input.js +1 -1
  108. package/dist/menu-CVzpsyXn.js +312 -0
  109. package/dist/menu.js +1 -1
  110. package/dist/{metric-card-Bh9K4fZs.js → metric-card-BnFssTXj.js} +12 -11
  111. package/dist/metric-card.js +1 -1
  112. package/dist/{multi-select-Pce_IYnz.js → multi-select-B3puEVo0.js} +78 -69
  113. package/dist/multi-select.js +1 -1
  114. package/dist/{navigation-sP5fiuQS.js → navigation-C_JD43gA.js} +56 -49
  115. package/dist/navigation.js +1 -1
  116. package/dist/next.js +65 -0
  117. package/dist/now-playing-DjVm1Phm.js +439 -0
  118. package/dist/now-playing.js +2 -0
  119. package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
  120. package/dist/overlay-motion-Cr77ihn2.js +90 -0
  121. package/dist/{overlay-portal-C4JZFq2M.js → overlay-portal-C9igMHnC.js} +1 -1
  122. package/dist/{pagination-DmXZ8E85.js → pagination-Dkh4bJQh.js} +31 -29
  123. package/dist/pagination.js +1 -1
  124. package/dist/{password-field-03pWRkuY.js → password-field-Da58GP1g.js} +4 -4
  125. package/dist/password-field.js +1 -1
  126. package/dist/photo-grid-Dtl17D74.js +830 -0
  127. package/dist/photo-grid.js +2 -0
  128. package/dist/pill-Dd7pog19.js +59 -0
  129. package/dist/pill.js +1 -1
  130. package/dist/popover-CUMOcMtj.js +126 -0
  131. package/dist/popover.js +1 -1
  132. package/dist/presence-spring-4zwtUDQN.js +12 -0
  133. package/dist/{progress-CbOWBUdA.js → progress-Bcuz3Ob4.js} +12 -11
  134. package/dist/progress.js +1 -1
  135. package/dist/{radio-cards-D2QZENI_.js → radio-cards-FkAhESb5.js} +65 -63
  136. package/dist/radio-cards.js +1 -1
  137. package/dist/{radio-group-E6mMRgo7.js → radio-group-DItMf2YM.js} +32 -28
  138. package/dist/radio-group.js +1 -1
  139. package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-61h9hA3B.js} +16 -14
  140. package/dist/resizable-panels.js +1 -1
  141. package/dist/{scroll-area-CcZyiSOQ.js → scroll-area-B8KkCPOM.js} +16 -15
  142. package/dist/scroll-area.js +1 -1
  143. package/dist/{search-field-IxF0IJXm.js → search-field-CbsajaZb.js} +94 -93
  144. package/dist/search-field.js +1 -1
  145. package/dist/{segmented-control-yO1K1nbi.js → segmented-control-DCh-4ca-.js} +28 -26
  146. package/dist/segmented-control.js +1 -1
  147. package/dist/{select-n_H52W1Z.js → select-SrcQqZjo.js} +29 -27
  148. package/dist/select.js +1 -1
  149. package/dist/sheet-stack-DYX1SGSB.js +820 -0
  150. package/dist/sheet-stack.js +2 -0
  151. package/dist/shortcut-recorder-VgTQdjjn.js +688 -0
  152. package/dist/shortcut-recorder.js +2 -0
  153. package/dist/signature-pad-khL2yhQI.js +646 -0
  154. package/dist/signature-pad.js +1 -1
  155. package/dist/{skeleton-XQQDkCHd.js → skeleton-LJsQsveI.js} +9 -8
  156. package/dist/skeleton.js +1 -1
  157. package/dist/slider-DjAnGmlC.js +535 -0
  158. package/dist/slider.js +1 -1
  159. package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-Bpitup_d.js} +29 -28
  160. package/dist/sortable-data-table.js +1 -1
  161. package/dist/{spinner-DtxvDPdM.js → spinner-CvzajSg9.js} +11 -10
  162. package/dist/spinner.js +1 -1
  163. package/dist/{split-button-Cb3EHs64.js → split-button-Bu41f2AY.js} +88 -93
  164. package/dist/split-button.js +1 -1
  165. package/dist/{stack-DC3IbtWk.js → stack-Bac4sJeI.js} +2 -2
  166. package/dist/stack.js +1 -1
  167. package/dist/{stepper-CruHbXxX.js → stepper-C8Ncavbr.js} +22 -21
  168. package/dist/stepper.js +1 -1
  169. package/dist/stretch-refresh-OrnTEj7P.js +349 -0
  170. package/dist/stretch-refresh.js +2 -0
  171. package/dist/{surface-DZ4d-2aL.js → surface-C69kwSuk.js} +13 -3
  172. package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-1H5UOZKE.js} +29 -26
  173. package/dist/swipe-actions.js +1 -1
  174. package/dist/switch-79-hkQqg.js +146 -0
  175. package/dist/switch.js +1 -1
  176. package/dist/sx-BJXJ2xJK.js +23 -0
  177. package/dist/tabs-Bb5-noYE.js +211 -0
  178. package/dist/tabs.js +1 -1
  179. package/dist/{tag-input-DSRCyrX2.js → tag-input-BQaueKEb.js} +5 -5
  180. package/dist/tag-input.js +1 -1
  181. package/dist/{text-field-C8TWG-tY.js → text-field-D0VP7b4P.js} +18 -16
  182. package/dist/text-field.js +1 -1
  183. package/dist/{textarea-BrW0XcG_.js → textarea-D1YwEPmn.js} +21 -19
  184. package/dist/textarea.js +1 -1
  185. package/dist/theme-provider-BvcY-iJu.js +20 -0
  186. package/dist/theme-root-BrYVcTzt.js +163 -0
  187. package/dist/theme-root.js +1 -1
  188. package/dist/theme-scope-DGWy4H0C.js +62 -0
  189. package/dist/theme-switch-CP42mVDb.js +167 -0
  190. package/dist/theme-switch.js +2 -0
  191. package/dist/thread-parts-DfZNz70v.js +683 -0
  192. package/dist/{time-picker-Db8D49cP.js → time-picker-Tnd-JBLC.js} +39 -32
  193. package/dist/time-picker.js +1 -1
  194. package/dist/{timeline-k3nURuCP.js → timeline-DaldDMX7.js} +28 -21
  195. package/dist/timeline.js +1 -1
  196. package/dist/{toast-BHxI32ZA.js → toast-CSAbl5yK.js} +107 -87
  197. package/dist/{toast-stack-DqrAzdg5.js → toast-stack-BCR4Cu7V.js} +25 -10
  198. package/dist/toast-stack.js +1 -1
  199. package/dist/toast.js +1 -1
  200. package/dist/{toggle-group-fcjzpifI.js → toggle-group-C7ye1v4s.js} +24 -23
  201. package/dist/toggle-group.js +1 -1
  202. package/dist/tooltip-IajLwdUb.js +129 -0
  203. package/dist/tooltip.js +1 -1
  204. package/dist/{tree-view-C2liIxqy.js → tree-view-CoW4oJIZ.js} +18 -13
  205. package/dist/tree-view.js +1 -1
  206. package/dist/{trigger-style-B1KVC8O1.js → trigger-style-CtOrdPk4.js} +1 -1
  207. package/dist/types/components/activity-rings/activity-rings.d.ts +115 -0
  208. package/dist/types/components/activity-rings/index.d.ts +2 -0
  209. package/dist/types/components/billing-toggle/billing-toggle.d.ts +57 -0
  210. package/dist/types/components/billing-toggle/index.d.ts +2 -0
  211. package/dist/types/components/button-group/button-group.d.ts +72 -0
  212. package/dist/types/components/button-group/index.d.ts +2 -0
  213. package/dist/types/components/card/card.d.ts +4 -1
  214. package/dist/types/components/chat-thread/chat-thread.d.ts +130 -0
  215. package/dist/types/components/chat-thread/index.d.ts +2 -0
  216. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  217. package/dist/types/components/command-palette/command-palette.d.ts +1 -1
  218. package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
  219. package/dist/types/components/comment-thread/index.d.ts +1 -0
  220. package/dist/types/components/context-menu/context-menu.d.ts +55 -0
  221. package/dist/types/components/context-menu/index.d.ts +2 -0
  222. package/dist/types/components/date-range-picker/date-range-picker.d.ts +1 -1
  223. package/dist/types/components/drawer/drawer.d.ts +7 -1
  224. package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
  225. package/dist/types/components/expanding-search/index.d.ts +1 -0
  226. package/dist/types/components/keycap-keyboard/index.d.ts +2 -0
  227. package/dist/types/components/keycap-keyboard/keycap-keyboard.d.ts +32 -0
  228. package/dist/types/components/lightbox-gallery/index.d.ts +2 -0
  229. package/dist/types/components/lightbox-gallery/lightbox-gallery.d.ts +74 -0
  230. package/dist/types/components/link-unfurl/index.d.ts +2 -0
  231. package/dist/types/components/link-unfurl/link-unfurl.d.ts +94 -0
  232. package/dist/types/components/locale-switcher/index.d.ts +2 -0
  233. package/dist/types/components/locale-switcher/locale-switcher.d.ts +58 -0
  234. package/dist/types/components/menu/menu.d.ts +74 -7
  235. package/dist/types/components/next/emotion-registry.d.ts +16 -0
  236. package/dist/types/components/next/index.d.ts +2 -0
  237. package/dist/types/components/next/registry.d.ts +21 -0
  238. package/dist/types/components/now-playing/index.d.ts +1 -0
  239. package/dist/types/components/now-playing/now-playing.d.ts +88 -0
  240. package/dist/types/components/pagination/pagination.d.ts +1 -1
  241. package/dist/types/components/photo-grid/index.d.ts +2 -0
  242. package/dist/types/components/photo-grid/photo-grid.d.ts +82 -0
  243. package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
  244. package/dist/types/components/radio-group/radio-group.d.ts +1 -1
  245. package/dist/types/components/sheet-stack/index.d.ts +2 -0
  246. package/dist/types/components/sheet-stack/sheet-stack.d.ts +78 -0
  247. package/dist/types/components/shortcut-recorder/index.d.ts +2 -0
  248. package/dist/types/components/shortcut-recorder/shortcut-recorder.d.ts +117 -0
  249. package/dist/types/components/slider/slider-style.d.ts +14 -0
  250. package/dist/types/components/slider/slider.d.ts +2 -10
  251. package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
  252. package/dist/types/components/split-button/split-button.d.ts +2 -2
  253. package/dist/types/components/stretch-refresh/index.d.ts +1 -0
  254. package/dist/types/components/stretch-refresh/stretch-refresh.d.ts +49 -0
  255. package/dist/types/components/tabs/tabs.d.ts +1 -1
  256. package/dist/types/components/text-field/text-field.d.ts +1 -1
  257. package/dist/types/components/textarea/textarea.d.ts +1 -1
  258. package/dist/types/components/theme-root/index.d.ts +1 -0
  259. package/dist/types/components/theme-root/theme-root.d.ts +9 -1
  260. package/dist/types/components/theme-switch/index.d.ts +1 -0
  261. package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
  262. package/dist/types/components/thread/thread-core.d.ts +96 -0
  263. package/dist/types/components/thread/thread-parts.d.ts +119 -0
  264. package/dist/types/components/tooltip/tooltip.d.ts +9 -2
  265. package/dist/types/components/usage-meter/usage-meter.d.ts +2 -12
  266. package/dist/types/components/usage-meter/usage-model.d.ts +30 -0
  267. package/dist/types/components/user-menu/index.d.ts +2 -0
  268. package/dist/types/components/user-menu/user-menu.d.ts +119 -0
  269. package/dist/types/index.d.ts +18 -0
  270. package/dist/types/overlay/exit-motion.d.ts +24 -0
  271. package/dist/types/overlay/overlay-layer.d.ts +20 -0
  272. package/dist/types/overlay/presence-spring.d.ts +12 -0
  273. package/dist/types/overlay/use-native-dialog.d.ts +10 -1
  274. package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
  275. package/dist/types/styling/create-theme.d.ts +24 -0
  276. package/dist/types/styling/css.d.ts +1 -1
  277. package/dist/types/styling/overlay-motion.d.ts +95 -0
  278. package/dist/types/styling/surface.d.ts +7 -0
  279. package/dist/types/styling/theme-scope.d.ts +29 -3
  280. package/dist/types/styling/theme.d.ts +5 -0
  281. package/dist/{usage-meter-qyQ3rYVv.js → usage-meter-CYvlB6l3.js} +165 -175
  282. package/dist/usage-meter.js +1 -1
  283. package/dist/usage-model-C0fS47w4.js +32 -0
  284. package/dist/use-native-dialog-FB0p7lkg.js +93 -0
  285. package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
  286. package/dist/use-scroll-lock-40gXwwAy.js +23 -0
  287. package/dist/user-menu-DzELTg1x.js +757 -0
  288. package/dist/user-menu.js +2 -0
  289. package/dist/{visually-hidden-BJdvqqvn.js → visually-hidden-DgVO3NaB.js} +1 -1
  290. package/package.json +88 -2
  291. package/dist/accordion-xCI_u0BV.js +0 -198
  292. package/dist/avatar-BahDVO9t.js +0 -132
  293. package/dist/badge-B_sLygxU.js +0 -108
  294. package/dist/calendar-B3Svu0X2.js +0 -447
  295. package/dist/card-D-aI2QHx.js +0 -158
  296. package/dist/carousel-IvPqN-oM.js +0 -472
  297. package/dist/command-palette-BQ5LleGb.js +0 -384
  298. package/dist/date-range-picker-B5uFWsm-.js +0 -562
  299. package/dist/dialog-ciiv9H2b.js +0 -218
  300. package/dist/drawer-DsASTiP-.js +0 -553
  301. package/dist/file-dropzone-pR4v7owg.js +0 -457
  302. package/dist/mention-input-BcQKX2EJ.js +0 -599
  303. package/dist/menu-xwOOUtWP.js +0 -275
  304. package/dist/pill-DO2gHzMb.js +0 -56
  305. package/dist/popover-QHcEvf9c.js +0 -119
  306. package/dist/signature-pad-q2SAsrdD.js +0 -640
  307. package/dist/slider-t0B5cecO.js +0 -477
  308. package/dist/switch-qwv8jQnR.js +0 -142
  309. package/dist/sx-Dx9JUKp5.js +0 -23
  310. package/dist/tabs-CAVJndX1.js +0 -203
  311. package/dist/theme-root-BbTBuLMQ.js +0 -46
  312. package/dist/theme-scope-t7nAKc2c.js +0 -27
  313. package/dist/tooltip-CkeiW9C1.js +0 -113
  314. package/dist/use-native-dialog-DWpIUVO1.js +0 -84
@@ -0,0 +1,646 @@
1
+ 'use client';
2
+ import { i as e } from "./css-BYJhdGh-.js";
3
+ import { n as t } from "./focus-ring-BK5W5_NY.js";
4
+ import { n, r } from "./media-8yrN85VT.js";
5
+ import { t as i } from "./sx-BJXJ2xJK.js";
6
+ import { t as a } from "./use-controlled-state-DpeVQZNR.js";
7
+ import { t as o } from "./visually-hidden-DgVO3NaB.js";
8
+ import { t as s } from "./renderable-DzcIj1Lo.js";
9
+ import { t as c } from "./button-C6OV0C7J.js";
10
+ import { t as l } from "./radio-group-DItMf2YM.js";
11
+ import { useEffect as u, useId as ee, useImperativeHandle as te, useLayoutEffect as d, useRef as f, useState as ne } from "react";
12
+ import { vars as p } from "@jfrader/tokens/vars";
13
+ import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
14
+ import { base as g } from "@jfrader/tokens";
15
+ import { useMergeRefs as re } from "@floating-ui/react";
16
+ //#region src/components/signature-pad/signature-pad.tsx
17
+ var _ = 600, v = 260, ie = 4096, y = 1e5, ae = 1e3, oe = 2, se = 3, ce = 60, le = 8e3, ue = 500, de = [], b = (e) => s(e) && e !== "", x = {
18
+ fine: 2,
19
+ medium: 4,
20
+ bold: 7
21
+ }, S = {
22
+ black: g.color.signatureInkBlack,
23
+ blue: g.color.signatureInkBlue,
24
+ violet: g.color.signatureInkViolet
25
+ }, fe = {
26
+ black: "--ui-color-text",
27
+ blue: "--ui-color-info",
28
+ violet: "--ui-color-accent"
29
+ }, C = class extends Error {
30
+ code;
31
+ constructor(e, t) {
32
+ super(t), this.code = e, this.name = "SignatureExportError";
33
+ }
34
+ }, w = 0;
35
+ function pe() {
36
+ let e = /* @__PURE__ */ new Uint32Array(2);
37
+ return globalThis.crypto?.getRandomValues?.(e), [++w, ...e].map((e) => e.toString(36)).join("-");
38
+ }
39
+ function me(e) {
40
+ let t = 0;
41
+ if (!Array.isArray(e) || e.length > ae) return !1;
42
+ for (let n of e) {
43
+ if (!n || typeof n.id != "string" || !Object.hasOwn(x, n.width) || !Object.hasOwn(S, n.color) || !Number.isFinite(n.startTime) || n.startTime < 0 || !Array.isArray(n.points) || !n.points.length) return !1;
44
+ let e = 0;
45
+ for (let r of n.points) {
46
+ if (++t > y || !r || !Number.isFinite(r.x) || !Number.isFinite(r.y) || r.x < 0 || r.x > _ || r.y < 0 || r.y > v || !Number.isFinite(r.time) || r.time < e || r.pressure !== null && (!Number.isFinite(r.pressure) || r.pressure < 0 || r.pressure > 1)) return !1;
47
+ e = r.time;
48
+ }
49
+ }
50
+ return !0;
51
+ }
52
+ function T(e) {
53
+ if (!me(e)) throw new C("invalid", "Invalid signature strokes.");
54
+ }
55
+ var E = (e, t, n) => Math.min(n, Math.max(t, e));
56
+ function D(e) {
57
+ if (me(e)) return e;
58
+ let t = [], n = 0;
59
+ for (let r of Array.isArray(e) ? e.slice(0, ae) : []) {
60
+ if (n >= y) break;
61
+ if (!r || !Object.hasOwn(x, r.width) || !Object.hasOwn(S, r.color) || !Array.isArray(r.points)) continue;
62
+ let e = 0, i = [];
63
+ for (let t of r.points) {
64
+ if (n >= y) break;
65
+ n++, t && Number.isFinite(t.x) && Number.isFinite(t.y) && (Number.isFinite(t.time) && (e = Math.max(e, t.time)), i.push({
66
+ x: E(t.x, 0, _),
67
+ y: E(t.y, 0, v),
68
+ pressure: Number.isFinite(t.pressure) ? E(t.pressure, 0, 1) : null,
69
+ time: e
70
+ }));
71
+ }
72
+ i.length && t.push({
73
+ ...r,
74
+ startTime: Number.isFinite(r.startTime) ? Math.max(0, r.startTime) : 0,
75
+ points: i
76
+ });
77
+ }
78
+ return t;
79
+ }
80
+ var he = (e) => e.reduce((e, t) => e + t.points.length, 0), O = (e, t) => ({
81
+ x: (e.x + t.x) / 2,
82
+ y: (e.y + t.y) / 2,
83
+ time: (e.time + t.time) / 2,
84
+ pressure: e.pressure === null || t.pressure === null ? null : (e.pressure + t.pressure) / 2
85
+ }), k = (e, t) => x[t] * (e.pressure === null ? 1 : .25 + e.pressure * .75);
86
+ function A(e) {
87
+ let t = [];
88
+ for (let n = 1; n < e.points.length; n++) {
89
+ let r = e.points[n - 1], i = e.points[n], a = n === 1 ? r : O(e.points[n - 2], r), o = n === e.points.length - 1 ? i : O(r, i);
90
+ t.push({
91
+ from: a,
92
+ control: r,
93
+ to: o,
94
+ width: (k(r, e.width) + k(i, e.width)) / 2
95
+ });
96
+ }
97
+ return t;
98
+ }
99
+ function ge(e, t, n) {
100
+ for (let r of t) {
101
+ if (e.strokeStyle = e.fillStyle = n[r.color], e.lineCap = e.lineJoin = "round", r.points.length === 1) {
102
+ let t = r.points[0];
103
+ e.beginPath(), e.arc(t.x, t.y, k(t, r.width) / 2, 0, Math.PI * 2), e.fill();
104
+ }
105
+ for (let t of A(r)) e.lineWidth = t.width, e.beginPath(), e.moveTo(t.from.x, t.from.y), e.quadraticCurveTo(t.control.x, t.control.y, t.to.x, t.to.y), e.stroke();
106
+ }
107
+ }
108
+ function j(e, t) {
109
+ if (T(e), !e.length) throw new C("empty", "Cannot export an empty signature.");
110
+ let n = 0, r = 0, i = _, a = v;
111
+ if (t.crop !== !1) {
112
+ n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
113
+ for (let t of e) for (let e of t.points) {
114
+ let o = x[t.width] / 2 + oe;
115
+ n = Math.min(n, e.x - o), r = Math.min(r, e.y - o), i = Math.max(i, e.x + o), a = Math.max(a, e.y + o);
116
+ }
117
+ }
118
+ let o = t.scale ?? se, s = i - n, c = a - r;
119
+ if (!Number.isFinite(o) || o <= 0 || Math.ceil(s * o) > ie || Math.ceil(c * o) > ie) throw new C("size", "Signature export exceeds the dimension budget.");
120
+ return {
121
+ left: n,
122
+ top: r,
123
+ width: s,
124
+ height: c,
125
+ scale: o
126
+ };
127
+ }
128
+ function _e(e, t = {}) {
129
+ let n = j(e, t);
130
+ if (typeof document > "u") throw new C("encoder", "Canvas rendering is unavailable.");
131
+ let r = document.createElement("canvas");
132
+ r.width = Math.ceil(n.width * n.scale), r.height = Math.ceil(n.height * n.scale);
133
+ let i = r.getContext("2d");
134
+ if (!i) throw new C("encoder", "Canvas rendering is unavailable.");
135
+ return i.scale(n.scale, n.scale), i.translate(-n.left, -n.top), ge(i, e, S), r;
136
+ }
137
+ function ve(e, t = {}) {
138
+ return new Promise((n, r) => {
139
+ try {
140
+ _e(e, t).toBlob((e) => e ? n(e) : r(new C("encoder", "PNG encoding failed.")), "image/png");
141
+ } catch (e) {
142
+ r(e);
143
+ }
144
+ });
145
+ }
146
+ function ye(e, t = {}) {
147
+ let n = j(e, t), r = e.map((e) => {
148
+ let t = S[e.color];
149
+ if (e.points.length === 1) {
150
+ let n = e.points[0];
151
+ return `<circle cx="${n.x}" cy="${n.y}" r="${k(n, e.width) / 2}" fill="${t}"/>`;
152
+ }
153
+ return A(e).map((e) => `<path d="M ${e.from.x} ${e.from.y} Q ${e.control.x} ${e.control.y} ${e.to.x} ${e.to.y}" fill="none" stroke="${t}" stroke-width="${e.width}" stroke-linecap="round" stroke-linejoin="round"/>`).join("");
154
+ }).join("");
155
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${n.left} ${n.top} ${n.width} ${n.height}" width="${Math.ceil(n.width * n.scale)}" height="${Math.ceil(n.height * n.scale)}">${r}</svg>`;
156
+ }
157
+ var be = e({
158
+ display: "grid",
159
+ gap: p.space[3],
160
+ minInlineSize: 0,
161
+ color: p.color.text,
162
+ fontFamily: p.font.sans,
163
+ fontSize: p.textSize.sm
164
+ }), xe = e({
165
+ position: "relative",
166
+ minInlineSize: 0
167
+ }), Se = e({
168
+ display: "block",
169
+ boxSizing: "border-box",
170
+ inlineSize: "100%",
171
+ aspectRatio: `${_} / ${v}`,
172
+ backgroundColor: p.color.surface,
173
+ color: p.color.text,
174
+ border: `1px solid ${p.color.borderControl}`,
175
+ borderRadius: p.radius.lg,
176
+ touchAction: "none",
177
+ "&:focus-visible": t,
178
+ "&[aria-disabled=\"true\"], &[data-readonly]": { touchAction: "auto" },
179
+ [n]: {
180
+ borderColor: "CanvasText",
181
+ color: "CanvasText"
182
+ }
183
+ }), Ce = e({
184
+ position: "absolute",
185
+ insetInline: p.space[4],
186
+ insetBlockEnd: p.space[8],
187
+ borderBlockEnd: `1px solid ${p.color.borderStrong}`,
188
+ pointerEvents: "none",
189
+ color: p.color.textMuted,
190
+ display: "flex",
191
+ justifyContent: "space-between",
192
+ gap: p.space[2],
193
+ fontSize: p.textSize.xs,
194
+ transitionProperty: "opacity",
195
+ transitionDuration: p.motion.duration.base,
196
+ [r]: { transitionDuration: "0s" }
197
+ }), we = e({
198
+ display: "flex",
199
+ flexWrap: "wrap",
200
+ alignItems: "center",
201
+ gap: p.space[3]
202
+ }), Te = e({ fontWeight: p.fontWeight.medium }), Ee = e({ color: p.color.textMuted }), De = e({ color: p.color.dangerText }), M = (e, t) => e === t || JSON.stringify(e) === JSON.stringify(t);
203
+ function N({ ref: e, apiRef: t, value: n, defaultValue: r = de, onValueChange: s, color: p, defaultColor: g = "black", onColorChange: ie, width: oe, defaultWidth: se = "medium", onWidthChange: C, label: w, description: T, error: E, signer: O, hint: k, disabled: A = !1, readOnly: j = !1, required: N = !1, replay: Oe = !0, download: ke = !1, fileName: Ae = "signature", historyLimit: je = ce, messages: P, icons: Me, exportOptions: F, slotProps: I, className: Ne, sx: Pe, dir: Fe, style: Ie, onPointerDown: Le, onPointerMove: Re, onPointerUp: ze, onPointerCancel: Be, onLostPointerCapture: Ve, onKeyDown: He, "aria-labelledby": Ue, "aria-describedby": We, ...L }) {
204
+ let R = ee(), z = f(null), Ge = re([z, e]), Ke = f(r), [B = de, qe] = a(n, Ke.current, s), [Je = "black", Ye] = a(p, g, ie), [Xe = "medium", Ze] = a(oe, se, C), V = f({
205
+ present: B,
206
+ past: [],
207
+ future: []
208
+ }), H = f(null), U = f(null), W = f(null), Qe = f(null), [$e, et] = ne({
209
+ text: "",
210
+ revision: 0
211
+ });
212
+ function G(e) {
213
+ et((t) => ({
214
+ text: e,
215
+ revision: t.revision + 1
216
+ }));
217
+ }
218
+ let [tt, nt] = ne(!1), [, rt] = ne(0), K = A || j, it = Number.isFinite(je) && je > 0 ? Math.floor(je) : ce;
219
+ function q(e = U.current ? [...V.current.present, U.current.stroke] : V.current.present) {
220
+ let t = z.current;
221
+ if (!t) return;
222
+ let n = t.getBoundingClientRect();
223
+ if (n.width <= 0 || n.height <= 0 || t.clientWidth <= 0 || t.clientHeight <= 0) return;
224
+ let r = t.ownerDocument.defaultView, i = r.devicePixelRatio || 1, a = Math.max(1, Math.round(t.clientWidth * i)), o = Math.max(1, Math.round(t.clientHeight * i));
225
+ (t.width !== a || t.height !== o) && (t.width = a, t.height = o);
226
+ let s = t.getContext("2d");
227
+ if (!s) return;
228
+ s.setTransform(1, 0, 0, 1, 0, 0), s.clearRect(0, 0, t.width, t.height), s.setTransform(t.width / _, 0, 0, t.height / v, 0, 0);
229
+ let c = r.getComputedStyle(t), l = r.matchMedia("(forced-colors: active)").matches, u = Object.fromEntries(Object.entries(fe).map(([e, t]) => [e, l ? c.color : c.getPropertyValue(t).trim()]));
230
+ ge(s, D(e), u);
231
+ }
232
+ function J() {
233
+ W.current !== null && z.current?.ownerDocument.defaultView?.cancelAnimationFrame(W.current), W.current = null, nt(!1), q();
234
+ }
235
+ function Y() {
236
+ J(), G(P.replayComplete);
237
+ }
238
+ function X() {
239
+ let e = U.current?.pointerId;
240
+ U.current = null;
241
+ let t = z.current;
242
+ e !== void 0 && t?.hasPointerCapture(e) && t.releasePointerCapture(e), q();
243
+ }
244
+ function at(e, t, n) {
245
+ M(e, V.current.present) || (J(), X(), H.current = {
246
+ value: e,
247
+ history: t,
248
+ status: n
249
+ }, qe(e));
250
+ }
251
+ function ot() {
252
+ let e = V.current;
253
+ if (K || !e.past.length) return;
254
+ let t = e.past[e.past.length - 1];
255
+ at(t, {
256
+ present: t,
257
+ past: e.past.slice(0, -1),
258
+ future: [e.present, ...e.future].slice(0, it)
259
+ }, P.undone);
260
+ }
261
+ function st() {
262
+ let e = V.current;
263
+ if (K || !e.future.length) return;
264
+ let t = e.future[0];
265
+ at(t, {
266
+ present: t,
267
+ past: [...e.past, e.present].slice(-it),
268
+ future: e.future.slice(1)
269
+ }, P.redone);
270
+ }
271
+ function Z(e, t) {
272
+ let n = V.current;
273
+ at(e, {
274
+ present: e,
275
+ past: [...n.past, n.present].slice(-it),
276
+ future: []
277
+ }, t);
278
+ }
279
+ function ct() {
280
+ K || Z(de, P.cleared);
281
+ }
282
+ function lt() {
283
+ J(), X();
284
+ let e = D(V.current.present), t = z.current?.ownerDocument.defaultView;
285
+ if (A || !e.length || !t) return;
286
+ if (t.matchMedia("(prefers-reduced-motion: reduce)").matches) {
287
+ Y();
288
+ return;
289
+ }
290
+ let n = [], r = 0;
291
+ e.forEach((t, i) => {
292
+ let a = e[i - 1], o = a ? Math.min(ue, Math.max(0, t.startTime - a.startTime - a.points.at(-1).time)) : 0, s = t.points.at(-1).time;
293
+ n.push({
294
+ stroke: t,
295
+ offset: r + o
296
+ }), r += o + s;
297
+ });
298
+ let i = r > le ? le / r : 1, a = t.performance.now();
299
+ nt(!0);
300
+ let o = (e) => {
301
+ let s = (e - a) / i;
302
+ q(n.flatMap(({ stroke: e, offset: t }) => {
303
+ if (s < t) return [];
304
+ let n = e.points.filter((e) => e.time <= s - t);
305
+ return n.length ? [{
306
+ ...e,
307
+ points: n
308
+ }] : [];
309
+ })), s >= r ? Y() : W.current = t.requestAnimationFrame(o);
310
+ };
311
+ W.current = t.requestAnimationFrame(o);
312
+ }
313
+ let Q = f(null);
314
+ u(() => {
315
+ process.env.NODE_ENV !== "production" && (me(B) ? Q.current = null : (Q.current === null || !M(Q.current, B)) && (Q.current = B, console.warn("SignaturePad: value contains malformed strokes; invalid samples are skipped when drawing and exports reject with an \"invalid\" SignatureExportError.")));
316
+ }, [B]), d(() => {
317
+ M(B, V.current.present) || (X(), J(), H.current && M(B, H.current.value) ? (V.current = H.current.history, G(H.current.status)) : V.current = {
318
+ present: B,
319
+ past: [],
320
+ future: []
321
+ }, H.current = null, rt((e) => e + 1)), W.current === null && q(U.current ? [...V.current.present, U.current.stroke] : V.current.present);
322
+ }), d(() => {
323
+ K && (X(), J());
324
+ }, [K]);
325
+ let $ = f({
326
+ draw: q,
327
+ completeReplay: Y,
328
+ reset: () => {
329
+ K || Z(Ke.current, P.reset);
330
+ }
331
+ });
332
+ d(() => {
333
+ $.current = {
334
+ draw: q,
335
+ completeReplay: Y,
336
+ reset: () => {
337
+ K || Z(Ke.current, P.reset);
338
+ }
339
+ };
340
+ }), d(() => {
341
+ let e = z.current, t = e.ownerDocument.defaultView, n = () => {
342
+ W.current === null && $.current.draw();
343
+ }, r = new ResizeObserver(n);
344
+ r.observe(e);
345
+ let i = new MutationObserver(n);
346
+ for (let t = e.parentElement; t; t = t.parentElement) i.observe(t, {
347
+ attributes: !0,
348
+ attributeFilter: [
349
+ "data-theme",
350
+ "class",
351
+ "style"
352
+ ]
353
+ });
354
+ let a = t.matchMedia("(forced-colors: active)");
355
+ a.addEventListener("change", n);
356
+ let o = t.matchMedia("(prefers-reduced-motion: reduce)"), s = () => {
357
+ o.matches && W.current !== null && $.current.completeReplay();
358
+ };
359
+ o.addEventListener("change", s);
360
+ let c = t.matchMedia(`(resolution: ${t.devicePixelRatio}dppx)`), l = () => {
361
+ n(), c.removeEventListener("change", l), c = t.matchMedia(`(resolution: ${t.devicePixelRatio}dppx)`), c.addEventListener("change", l);
362
+ };
363
+ c.addEventListener("change", l), t.addEventListener("resize", n);
364
+ let u = e.closest("form"), ee = (t) => {
365
+ queueMicrotask(() => {
366
+ !t.defaultPrevented && e.isConnected && $.current.reset();
367
+ });
368
+ };
369
+ return u?.addEventListener("reset", ee), () => {
370
+ r.disconnect(), i.disconnect(), a.removeEventListener("change", n), o.removeEventListener("change", s), c.removeEventListener("change", l), t.removeEventListener("resize", n), u?.removeEventListener("reset", ee), W.current !== null && t.cancelAnimationFrame(W.current), W.current = null, U.current = null;
371
+ };
372
+ }, []);
373
+ function ut(e) {
374
+ return z.current && G(P.exported), e;
375
+ }
376
+ function dt(e) {
377
+ if (K || e.key !== "Home" && e.key !== "End") return;
378
+ let t = e.currentTarget.querySelectorAll("input[type=\"radio\"]:not(:disabled)"), n = e.key === "Home" ? t[0] : t[t.length - 1];
379
+ n && (e.preventDefault(), n.focus(), n.click());
380
+ }
381
+ te(t, () => ({
382
+ focus: () => z.current?.focus(),
383
+ clear: ct,
384
+ undo: ot,
385
+ redo: st,
386
+ replay: lt,
387
+ stopReplay: J,
388
+ toDataURL: (e) => ut(_e(V.current.present, e ?? F).toDataURL("image/png")),
389
+ toBlob: (e) => ve(V.current.present, e ?? F).then(ut),
390
+ toSvg: (e) => ut(ye(V.current.present, e ?? F))
391
+ }));
392
+ function ft(e, t) {
393
+ let n = z.current, r = n.getBoundingClientRect(), i = n.clientWidth, a = n.clientHeight;
394
+ if (i <= 0 || a <= 0 || !Number.isFinite(e.clientX) || !Number.isFinite(e.clientY)) return;
395
+ let o = t.stroke.points, s = Math.max(o.at(-1)?.time ?? 0, Number.isFinite(e.timeStamp) ? e.timeStamp - t.started : 0), c = {
396
+ x: Math.max(0, Math.min(_, (e.clientX - r.left - n.clientLeft) / i * _)),
397
+ y: Math.max(0, Math.min(v, (e.clientY - r.top - n.clientTop) / a * v)),
398
+ pressure: e.pointerType === "pen" && Number.isFinite(e.pressure) ? Math.max(0, Math.min(1, e.pressure)) : null,
399
+ time: s
400
+ }, l = o.at(-1), u = y - he(D(V.current.present));
401
+ (!l || l.x !== c.x || l.y !== c.y) && o.length < u && o.push(c);
402
+ }
403
+ function pt(e) {
404
+ let t = U.current;
405
+ if (!t || e.pointerId !== t.pointerId) return;
406
+ let n = e.nativeEvent.getCoalescedEvents?.() ?? [];
407
+ for (let e of n) ft(e, t);
408
+ ft(e.nativeEvent, t), q([...V.current.present, t.stroke]);
409
+ }
410
+ async function mt(e) {
411
+ try {
412
+ let t = e === "png" ? await ve(V.current.present, F) : new Blob([ye(V.current.present, F)], { type: "image/svg+xml" }), n = z.current?.ownerDocument;
413
+ if (!n) return;
414
+ let r = URL.createObjectURL(t);
415
+ try {
416
+ let t = n.createElement("a");
417
+ t.href = r, t.download = `${Ae.replace(/[\\/\u0000-\u001f:*?"<>|]/g, "_") || "signature"}.${e}`, t.click(), G(P.exported);
418
+ } finally {
419
+ URL.revokeObjectURL(r);
420
+ }
421
+ } catch {
422
+ z.current && G(P.exportFailed);
423
+ }
424
+ }
425
+ let ht = V.current, gt = [
426
+ {
427
+ action: "undo",
428
+ disabled: K || !ht.past.length,
429
+ run: ot
430
+ },
431
+ {
432
+ action: "redo",
433
+ disabled: K || !ht.future.length,
434
+ run: st
435
+ },
436
+ ...Oe ? [{
437
+ action: tt ? "stop" : "replay",
438
+ disabled: A || !B.length,
439
+ run: tt ? J : lt
440
+ }] : [],
441
+ {
442
+ action: "clear",
443
+ disabled: K || !B.length,
444
+ run: ct
445
+ },
446
+ ...ke ? [{
447
+ action: "png",
448
+ disabled: A || !B.length,
449
+ run: () => {
450
+ mt("png");
451
+ }
452
+ }, {
453
+ action: "svg",
454
+ disabled: A || !B.length,
455
+ run: () => {
456
+ mt("svg");
457
+ }
458
+ }] : []
459
+ ];
460
+ return /* @__PURE__ */ m(i, {
461
+ className: [Ne, I?.root?.className].filter(Boolean).join(" "),
462
+ styles: [be, I?.root?.css],
463
+ sx: Pe,
464
+ children: (e) => /* @__PURE__ */ h("div", {
465
+ "data-ui": "signature-pad",
466
+ "data-state": B.length ? "signed" : "empty",
467
+ className: e,
468
+ dir: Fe,
469
+ style: Ie,
470
+ children: [
471
+ b(w) && /* @__PURE__ */ m("span", {
472
+ id: `${R}-label`,
473
+ className: I?.label?.className,
474
+ css: [Te, I?.label?.css],
475
+ children: w
476
+ }),
477
+ /* @__PURE__ */ m("span", {
478
+ id: `${R}-state`,
479
+ css: o,
480
+ children: B.length ? P.signed : P.empty
481
+ }),
482
+ /* @__PURE__ */ m("span", {
483
+ id: `${R}-shortcuts`,
484
+ css: o,
485
+ children: P.shortcuts
486
+ }),
487
+ /* @__PURE__ */ h("div", {
488
+ css: xe,
489
+ children: [/* @__PURE__ */ m("canvas", {
490
+ ...L,
491
+ ref: Ge,
492
+ role: "img",
493
+ tabIndex: A ? -1 : L.tabIndex ?? 0,
494
+ "aria-roledescription": P.roleDescription,
495
+ "aria-disabled": A || void 0,
496
+ "data-readonly": j || void 0,
497
+ "aria-invalid": b(E) ? !0 : L["aria-invalid"],
498
+ "aria-labelledby": [
499
+ Ue,
500
+ b(w) && `${R}-label`,
501
+ !L["aria-label"] && `${R}-state`
502
+ ].filter(Boolean).join(" ") || void 0,
503
+ "aria-describedby": [
504
+ We,
505
+ `${R}-state`,
506
+ `${R}-shortcuts`,
507
+ N && `${R}-required`,
508
+ b(T) && `${R}-description`,
509
+ b(E) && `${R}-error`
510
+ ].filter(Boolean).join(" "),
511
+ className: I?.canvas?.className,
512
+ css: [Se, I?.canvas?.css],
513
+ onPointerDown: (e) => {
514
+ if (Le?.(e), e.defaultPrevented || K || !e.isPrimary || e.button !== 0 || U.current || B.length >= ae || he(D(B)) >= y || e.currentTarget.clientWidth <= 0 || e.currentTarget.clientHeight <= 0) return;
515
+ J(), H.current = null;
516
+ let t = Number.isFinite(e.timeStamp) ? e.timeStamp : 0;
517
+ Qe.current ??= t;
518
+ let n = {
519
+ pointerId: e.pointerId,
520
+ started: t,
521
+ stroke: {
522
+ id: pe(),
523
+ points: [],
524
+ color: Je,
525
+ width: Xe,
526
+ startTime: Math.max(0, t - Qe.current)
527
+ }
528
+ };
529
+ U.current = n;
530
+ try {
531
+ e.currentTarget.setPointerCapture(e.pointerId);
532
+ } catch {
533
+ U.current = null;
534
+ return;
535
+ }
536
+ ft(e.nativeEvent, n), q([...ht.present, n.stroke]), e.preventDefault();
537
+ },
538
+ onPointerMove: (e) => {
539
+ Re?.(e), e.defaultPrevented || pt(e);
540
+ },
541
+ onPointerUp: (e) => {
542
+ if (ze?.(e), U.current?.pointerId !== e.pointerId) return;
543
+ if (e.defaultPrevented) {
544
+ X();
545
+ return;
546
+ }
547
+ pt(e);
548
+ let t = U.current.stroke;
549
+ X(), t.points.length && Z([...V.current.present, t], P.added);
550
+ },
551
+ onPointerCancel: (e) => {
552
+ Be?.(e), U.current?.pointerId === e.pointerId && X();
553
+ },
554
+ onLostPointerCapture: (e) => {
555
+ Ve?.(e), U.current?.pointerId === e.pointerId && X();
556
+ },
557
+ onKeyDown: (e) => {
558
+ if (He?.(e), e.defaultPrevented || e.target !== e.currentTarget) return;
559
+ let t = e.key.toLowerCase();
560
+ t === "escape" && (tt || U.current) ? (J(), X(), e.preventDefault(), e.stopPropagation()) : !K && (e.metaKey || e.ctrlKey) && (t === "z" || t === "y") ? (t === "y" || e.shiftKey ? st() : ot(), e.preventDefault()) : !K && (t === "delete" || t === "backspace") && (ct(), e.preventDefault());
561
+ },
562
+ children: P.fallback
563
+ }), (b(k) || b(O)) && /* @__PURE__ */ h("div", {
564
+ "aria-hidden": "true",
565
+ "data-ui": "signature-pad-guide",
566
+ className: I?.guide?.className,
567
+ css: [Ce, I?.guide?.css],
568
+ children: [!B.length && b(k) && /* @__PURE__ */ m("span", { children: k }), b(O) && /* @__PURE__ */ m("span", { children: O })]
569
+ })]
570
+ }),
571
+ /* @__PURE__ */ h("div", {
572
+ "data-ui": "signature-pad-toolbar",
573
+ className: I?.toolbar?.className,
574
+ css: [we, I?.toolbar?.css],
575
+ children: [
576
+ /* @__PURE__ */ m(l, {
577
+ "aria-label": P.ink,
578
+ orientation: "horizontal",
579
+ value: Je,
580
+ onValueChange: (e) => Ye(e),
581
+ disabled: K,
582
+ onKeyDown: dt,
583
+ children: Object.keys(S).map((e) => /* @__PURE__ */ m(l.Radio, {
584
+ value: e,
585
+ label: P.colors[e]
586
+ }, e))
587
+ }),
588
+ /* @__PURE__ */ m(l, {
589
+ "aria-label": P.nib,
590
+ orientation: "horizontal",
591
+ value: Xe,
592
+ onValueChange: (e) => Ze(e),
593
+ disabled: K,
594
+ onKeyDown: dt,
595
+ children: Object.keys(x).map((e) => /* @__PURE__ */ m(l.Radio, {
596
+ value: e,
597
+ label: P.widths[e]
598
+ }, e))
599
+ }),
600
+ gt.map(({ action: e, disabled: t, run: n }) => /* @__PURE__ */ h(c, {
601
+ size: "sm",
602
+ variant: "outline",
603
+ disabled: t,
604
+ onClick: n,
605
+ className: I?.action?.className,
606
+ css: I?.action?.css,
607
+ children: [b(Me?.[e]) && /* @__PURE__ */ m("span", {
608
+ "aria-hidden": "true",
609
+ children: Me?.[e]
610
+ }), P.actions[e]]
611
+ }, e))
612
+ ]
613
+ }),
614
+ N && /* @__PURE__ */ m("span", {
615
+ id: `${R}-required`,
616
+ css: o,
617
+ children: P.required
618
+ }),
619
+ b(T) && /* @__PURE__ */ m("div", {
620
+ id: `${R}-description`,
621
+ className: I?.description?.className,
622
+ css: [Ee, I?.description?.css],
623
+ children: T
624
+ }),
625
+ b(E) && /* @__PURE__ */ m("div", {
626
+ id: `${R}-error`,
627
+ role: "alert",
628
+ className: I?.error?.className,
629
+ css: [De, I?.error?.css],
630
+ children: E
631
+ }),
632
+ /* @__PURE__ */ m("div", {
633
+ role: "status",
634
+ "aria-live": "polite",
635
+ "aria-atomic": "true",
636
+ className: I?.status?.className,
637
+ css: [o, I?.status?.css],
638
+ children: $e.text && /* @__PURE__ */ m("span", { children: $e.text }, $e.revision)
639
+ })
640
+ ]
641
+ })
642
+ });
643
+ }
644
+ N.displayName = "SignaturePad";
645
+ //#endregion
646
+ export { ye as i, N as n, ve as r, C as t };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as SignatureExportError, n as SignaturePad, r as signatureToPng, i as signatureToSvg } from "./signature-pad-q2SAsrdD.js";
2
+ export { t as SignatureExportError, n as SignaturePad, r as signatureToPng, i as signatureToSvg } from "./signature-pad-khL2yhQI.js";
@@ -1,6 +1,7 @@
1
1
  'use client';
2
- import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
3
- import { r } from "./media-8yrN85VT.js";
2
+ import { a as e, i as t } from "./css-BYJhdGh-.js";
3
+ import { r as n } from "./media-8yrN85VT.js";
4
+ import { t as r } from "./sx-BJXJ2xJK.js";
4
5
  import { vars as i } from "@jfrader/tokens/vars";
5
6
  import { jsx as a } from "@emotion/react/jsx-runtime";
6
7
  //#region src/components/skeleton/skeleton.tsx
@@ -19,7 +20,7 @@ var o = e({
19
20
  backgroundRepeat: "no-repeat",
20
21
  animation: `${o} 1.6s ease-in-out infinite`,
21
22
  "&:dir(rtl)": { animationDirection: "reverse" },
22
- [r]: {
23
+ [n]: {
23
24
  animation: "none",
24
25
  backgroundImage: "none"
25
26
  }
@@ -29,23 +30,23 @@ var o = e({
29
30
  aspectRatio: "1",
30
31
  borderRadius: i.radius.full
31
32
  });
32
- function l({ ref: e, width: t, height: r, circle: i = !1, radius: o, style: l, className: u, sx: d, ...f }) {
33
- return /* @__PURE__ */ a(n, {
33
+ function l({ ref: e, width: t, height: n, circle: i = !1, radius: o, style: l, className: u, sx: d, ...f }) {
34
+ return /* @__PURE__ */ a(r, {
34
35
  className: u,
35
36
  styles: [s, i && c],
36
37
  sx: d,
37
- children: (n) => /* @__PURE__ */ a("div", {
38
+ children: (r) => /* @__PURE__ */ a("div", {
38
39
  ...f,
39
40
  ref: e,
40
41
  "aria-hidden": "true",
41
42
  "data-ui": "skeleton",
42
43
  style: {
43
44
  inlineSize: t,
44
- blockSize: r,
45
+ blockSize: n,
45
46
  borderRadius: i ? void 0 : o,
46
47
  ...l
47
48
  },
48
- className: n
49
+ className: r
49
50
  })
50
51
  });
51
52
  }
package/dist/skeleton.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Skeleton } from "./skeleton-XQQDkCHd.js";
2
+ export { t as Skeleton } from "./skeleton-LJsQsveI.js";