@jfrader/ui 0.4.0 → 0.5.1

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 (307) hide show
  1. package/README.md +2 -0
  2. package/dist/accordion-DLul6vIl.js +205 -0
  3. package/dist/accordion.js +1 -1
  4. package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/announcement-bar-Dlbq5-9D.js +382 -0
  7. package/dist/announcement-bar.js +2 -0
  8. package/dist/avatar-CaGJHy1N.js +145 -0
  9. package/dist/avatar-group-M1opAQEG.js +138 -0
  10. package/dist/avatar-group.js +2 -0
  11. package/dist/avatar.js +1 -1
  12. package/dist/badge-CjM5Agqk.js +119 -0
  13. package/dist/badge.js +1 -1
  14. package/dist/bottom-sheet-DjZOPq4k.js +674 -0
  15. package/dist/bottom-sheet.js +2 -0
  16. package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
  17. package/dist/breadcrumbs.js +1 -1
  18. package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
  19. package/dist/button.js +1 -1
  20. package/dist/calendar-BzJdv_SZ.js +449 -0
  21. package/dist/calendar.js +1 -1
  22. package/dist/card-Ca4KQKYQ.js +154 -0
  23. package/dist/card.js +1 -1
  24. package/dist/carousel-B7OrvD6J.js +474 -0
  25. package/dist/carousel.js +2 -0
  26. package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
  27. package/dist/checkbox.js +1 -1
  28. package/dist/chip-group-DjQ0_6Y9.js +290 -0
  29. package/dist/chip-group.js +2 -0
  30. package/dist/code-block/shiki.js +147 -0
  31. package/dist/code-block-B5we2lZa.js +293 -0
  32. package/dist/code-block.js +2 -0
  33. package/dist/collection-registry-k6JcD3Jr.js +44 -0
  34. package/dist/combobox-DFFqOBCi.js +339 -0
  35. package/dist/combobox.js +1 -1
  36. package/dist/command-palette-BmQu2w4H.js +391 -0
  37. package/dist/command-palette.js +1 -1
  38. package/dist/comment-thread-ASaXDcGo.js +1410 -0
  39. package/dist/comment-thread.js +2 -0
  40. package/dist/context-menu-__1c2Dk9.js +370 -0
  41. package/dist/context-menu.js +2 -0
  42. package/dist/copy-button-DCSLcYS-.js +252 -0
  43. package/dist/copy-button.js +2 -0
  44. package/dist/countdown-Dp_TD1VP.js +293 -0
  45. package/dist/countdown.js +2 -0
  46. package/dist/date-picker-BiPN7yeK.js +255 -0
  47. package/dist/date-picker.js +1 -1
  48. package/dist/date-range-picker-DQpUeKqV.js +570 -0
  49. package/dist/date-range-picker.js +2 -0
  50. package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
  51. package/dist/dialog.js +1 -1
  52. package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
  53. package/dist/divider.js +1 -1
  54. package/dist/drawer-DsASTiP-.js +553 -0
  55. package/dist/drawer.js +2 -0
  56. package/dist/elastic-slider-BG6K019r.js +395 -0
  57. package/dist/elastic-slider.js +2 -0
  58. package/dist/empty-state-CDgrjPPf.js +142 -0
  59. package/dist/empty-state.js +2 -0
  60. package/dist/expandable-card-rUATve0o.js +347 -0
  61. package/dist/expandable-card.js +2 -0
  62. package/dist/expanding-search-BxOwtdwt.js +238 -0
  63. package/dist/expanding-search.js +2 -0
  64. package/dist/field-anatomy-COVdNpf5.js +84 -0
  65. package/dist/file-dropzone-BuXm3Tea.js +457 -0
  66. package/dist/file-dropzone.js +2 -0
  67. package/dist/filter-toolbar-Cy5Hqur-.js +314 -0
  68. package/dist/filter-toolbar.js +2 -0
  69. package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
  70. package/dist/hold-to-confirm.js +2 -0
  71. package/dist/hover-card-CoMJKg1g.js +347 -0
  72. package/dist/hover-card.js +2 -0
  73. package/dist/image-compare-BxY8Ykzt.js +415 -0
  74. package/dist/image-compare.js +2 -0
  75. package/dist/index.js +84 -38
  76. package/dist/inline-edit-C0eeml65.js +535 -0
  77. package/dist/inline-edit.js +2 -0
  78. package/dist/input-control-DmMuAuPS.js +34 -0
  79. package/dist/json-viewer-DgWqyU75.js +802 -0
  80. package/dist/json-viewer.js +2 -0
  81. package/dist/listbox-style-WX-RASp1.js +59 -0
  82. package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
  83. package/dist/mention-input-sq61si9L.js +600 -0
  84. package/dist/mention-input.js +2 -0
  85. package/dist/menu-DDKgmK2F.js +295 -0
  86. package/dist/menu.js +1 -1
  87. package/dist/metric-card--lVTz5Wn.js +118 -0
  88. package/dist/metric-card.js +2 -0
  89. package/dist/multi-select-DG1BCFX7.js +598 -0
  90. package/dist/multi-select.js +2 -0
  91. package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
  92. package/dist/navigation.js +1 -1
  93. package/dist/overlay-layer-qEbpEtb8.js +78 -0
  94. package/dist/overlay-portal-C4JZFq2M.js +15 -0
  95. package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
  96. package/dist/pagination.js +1 -1
  97. package/dist/password-field-03pWRkuY.js +250 -0
  98. package/dist/password-field.js +2 -0
  99. package/dist/pill-BaS-uIbn.js +58 -0
  100. package/dist/pill.js +1 -1
  101. package/dist/popover-CErIw2q3.js +125 -0
  102. package/dist/popover.js +1 -1
  103. package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
  104. package/dist/progress.js +1 -1
  105. package/dist/radio-cards-Cu9cBssN.js +456 -0
  106. package/dist/radio-cards.js +2 -0
  107. package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
  108. package/dist/radio-group.js +1 -1
  109. package/dist/resizable-panels-DUpQEpwG.js +520 -0
  110. package/dist/resizable-panels.js +2 -0
  111. package/dist/scroll-area-CcZyiSOQ.js +371 -0
  112. package/dist/scroll-area.js +2 -0
  113. package/dist/search-field-DMvho0KQ.js +274 -0
  114. package/dist/search-field.js +2 -0
  115. package/dist/segmented-control-8ZUGnsZm.js +327 -0
  116. package/dist/segmented-control.js +2 -0
  117. package/dist/select-D5rhJ8gi.js +293 -0
  118. package/dist/select.js +1 -1
  119. package/dist/signature-pad-_bTeguN9.js +645 -0
  120. package/dist/signature-pad.js +2 -0
  121. package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
  122. package/dist/skeleton.js +1 -1
  123. package/dist/slider-DVG6-Awh.js +308 -0
  124. package/dist/slider.js +2 -0
  125. package/dist/sortable-data-table-CYKT_Ng7.js +365 -0
  126. package/dist/sortable-data-table.js +2 -0
  127. package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
  128. package/dist/spinner.js +1 -1
  129. package/dist/split-button-BCw4zZom.js +262 -0
  130. package/dist/split-button.js +2 -0
  131. package/dist/stepper-CruHbXxX.js +480 -0
  132. package/dist/stepper.js +2 -0
  133. package/dist/swipe-actions-CBuJREU1.js +420 -0
  134. package/dist/swipe-actions.js +2 -0
  135. package/dist/switch-C1WrKrf-.js +145 -0
  136. package/dist/switch.js +1 -1
  137. package/dist/tabs-XluwRjgg.js +210 -0
  138. package/dist/tabs.js +1 -1
  139. package/dist/tag-input-DSRCyrX2.js +418 -0
  140. package/dist/tag-input.js +2 -0
  141. package/dist/{text-field-D60ok14S.js → text-field-hU72iSVS.js} +20 -17
  142. package/dist/text-field.js +1 -1
  143. package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
  144. package/dist/textarea.js +1 -1
  145. package/dist/theme-root.js +1 -1
  146. package/dist/theme-switch-C505TtU8.js +166 -0
  147. package/dist/theme-switch.js +2 -0
  148. package/dist/time-picker-CPlhW0tr.js +311 -0
  149. package/dist/time-picker.js +2 -0
  150. package/dist/timeline-B0uAAVfT.js +624 -0
  151. package/dist/timeline.js +2 -0
  152. package/dist/toast-B7wo3sX1.js +371 -0
  153. package/dist/toast-stack-B40VpS4M.js +197 -0
  154. package/dist/toast-stack.js +2 -0
  155. package/dist/toast.js +1 -1
  156. package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
  157. package/dist/toggle-group.js +1 -1
  158. package/dist/tooltip-BvgVTCTN.js +120 -0
  159. package/dist/tooltip.js +1 -1
  160. package/dist/tree-view-j8qLqkb_.js +364 -0
  161. package/dist/tree-view.js +2 -0
  162. package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
  163. package/dist/types/components/announcement-bar/index.d.ts +2 -0
  164. package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
  165. package/dist/types/components/avatar-group/index.d.ts +2 -0
  166. package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
  167. package/dist/types/components/bottom-sheet/index.d.ts +2 -0
  168. package/dist/types/components/calendar/calendar.d.ts +25 -1
  169. package/dist/types/components/calendar/index.d.ts +1 -1
  170. package/dist/types/components/carousel/carousel.d.ts +73 -0
  171. package/dist/types/components/carousel/index.d.ts +2 -0
  172. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  173. package/dist/types/components/chip-group/chip-group.d.ts +54 -0
  174. package/dist/types/components/chip-group/index.d.ts +1 -0
  175. package/dist/types/components/code-block/code-block.d.ts +58 -0
  176. package/dist/types/components/code-block/index.d.ts +1 -0
  177. package/dist/types/components/code-block/shiki.d.ts +3 -0
  178. package/dist/types/components/combobox/combobox.d.ts +1 -1
  179. package/dist/types/components/command-palette/command-palette.d.ts +2 -2
  180. package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
  181. package/dist/types/components/comment-thread/index.d.ts +1 -0
  182. package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
  183. package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
  184. package/dist/types/components/context-menu/context-menu.d.ts +55 -0
  185. package/dist/types/components/context-menu/index.d.ts +2 -0
  186. package/dist/types/components/copy-button/copy-button.d.ts +49 -0
  187. package/dist/types/components/copy-button/index.d.ts +2 -0
  188. package/dist/types/components/countdown/countdown.d.ts +37 -0
  189. package/dist/types/components/countdown/index.d.ts +1 -0
  190. package/dist/types/components/date-picker/date-picker.d.ts +1 -1
  191. package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
  192. package/dist/types/components/date-range-picker/index.d.ts +2 -0
  193. package/dist/types/components/drawer/drawer.d.ts +59 -0
  194. package/dist/types/components/drawer/index.d.ts +2 -0
  195. package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
  196. package/dist/types/components/elastic-slider/index.d.ts +1 -0
  197. package/dist/types/components/empty-state/empty-state.d.ts +36 -0
  198. package/dist/types/components/empty-state/index.d.ts +2 -0
  199. package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
  200. package/dist/types/components/expandable-card/index.d.ts +2 -0
  201. package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
  202. package/dist/types/components/expanding-search/index.d.ts +1 -0
  203. package/dist/types/components/field/field-anatomy.d.ts +4 -2
  204. package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
  205. package/dist/types/components/file-dropzone/index.d.ts +2 -0
  206. package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
  207. package/dist/types/components/filter-toolbar/index.d.ts +1 -0
  208. package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
  209. package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
  210. package/dist/types/components/hover-card/hover-card.d.ts +97 -0
  211. package/dist/types/components/hover-card/index.d.ts +2 -0
  212. package/dist/types/components/image-compare/image-compare.d.ts +54 -0
  213. package/dist/types/components/image-compare/index.d.ts +1 -0
  214. package/dist/types/components/inline-edit/index.d.ts +2 -0
  215. package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
  216. package/dist/types/components/json-viewer/index.d.ts +2 -0
  217. package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
  218. package/dist/types/components/mention-input/index.d.ts +2 -0
  219. package/dist/types/components/mention-input/mention-input.d.ts +87 -0
  220. package/dist/types/components/menu/menu.d.ts +68 -7
  221. package/dist/types/components/metric-card/index.d.ts +1 -0
  222. package/dist/types/components/metric-card/metric-card.d.ts +37 -0
  223. package/dist/types/components/multi-select/index.d.ts +2 -0
  224. package/dist/types/components/multi-select/multi-select.d.ts +73 -0
  225. package/dist/types/components/pagination/pagination.d.ts +1 -1
  226. package/dist/types/components/password-field/index.d.ts +2 -0
  227. package/dist/types/components/password-field/password-field.d.ts +34 -0
  228. package/dist/types/components/popover/popover.d.ts +1 -1
  229. package/dist/types/components/radio-cards/index.d.ts +1 -0
  230. package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
  231. package/dist/types/components/radio-group/radio-group.d.ts +1 -1
  232. package/dist/types/components/resizable-panels/index.d.ts +2 -0
  233. package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
  234. package/dist/types/components/scroll-area/index.d.ts +2 -0
  235. package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
  236. package/dist/types/components/search-field/index.d.ts +1 -0
  237. package/dist/types/components/search-field/search-field.d.ts +31 -0
  238. package/dist/types/components/segmented-control/index.d.ts +2 -0
  239. package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
  240. package/dist/types/components/select/select.d.ts +1 -1
  241. package/dist/types/components/signature-pad/index.d.ts +2 -0
  242. package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
  243. package/dist/types/components/slider/index.d.ts +1 -0
  244. package/dist/types/components/slider/slider-style.d.ts +14 -0
  245. package/dist/types/components/slider/slider.d.ts +62 -0
  246. package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
  247. package/dist/types/components/sortable-data-table/index.d.ts +1 -0
  248. package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
  249. package/dist/types/components/split-button/index.d.ts +2 -0
  250. package/dist/types/components/split-button/split-button.d.ts +55 -0
  251. package/dist/types/components/stepper/index.d.ts +2 -0
  252. package/dist/types/components/stepper/stepper.d.ts +85 -0
  253. package/dist/types/components/swipe-actions/index.d.ts +2 -0
  254. package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
  255. package/dist/types/components/tabs/tabs.d.ts +1 -1
  256. package/dist/types/components/tag-input/index.d.ts +2 -0
  257. package/dist/types/components/tag-input/tag-input.d.ts +66 -0
  258. package/dist/types/components/text-field/text-field.d.ts +1 -1
  259. package/dist/types/components/textarea/textarea.d.ts +1 -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/time-picker/index.d.ts +2 -0
  263. package/dist/types/components/time-picker/time-picker.d.ts +48 -0
  264. package/dist/types/components/timeline/index.d.ts +2 -0
  265. package/dist/types/components/timeline/timeline.d.ts +66 -0
  266. package/dist/types/components/toast/toast.d.ts +37 -2
  267. package/dist/types/components/toast-stack/index.d.ts +2 -0
  268. package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
  269. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  270. package/dist/types/components/tree-view/index.d.ts +1 -0
  271. package/dist/types/components/tree-view/tree-view.d.ts +47 -0
  272. package/dist/types/components/usage-meter/index.d.ts +2 -0
  273. package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
  274. package/dist/types/index.d.ts +45 -0
  275. package/dist/types/overlay/overlay-layer.d.ts +53 -0
  276. package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
  277. package/dist/types/styling/media.d.ts +1 -0
  278. package/dist/types/styling/theme.d.ts +12 -0
  279. package/dist/types/utils/use-controlled-state.d.ts +2 -1
  280. package/dist/usage-meter-qyQ3rYVv.js +463 -0
  281. package/dist/usage-meter.js +2 -0
  282. package/dist/use-controlled-state-DpeVQZNR.js +20 -0
  283. package/dist/use-latest-callback-cj1OOQL6.js +11 -0
  284. package/dist/use-overlay-floating-Bx2jBKAA.js +33 -0
  285. package/dist/use-slider-interaction-ChL-208h.js +234 -0
  286. package/package.json +195 -3
  287. package/dist/accordion-Bd-j04hW.js +0 -198
  288. package/dist/avatar-BahDVO9t.js +0 -132
  289. package/dist/badge-B_sLygxU.js +0 -108
  290. package/dist/calendar-C9Yad_-w.js +0 -394
  291. package/dist/card-D-aI2QHx.js +0 -158
  292. package/dist/collection-registry-BTYi6zGh.js +0 -98
  293. package/dist/combobox-DiMC2g_u.js +0 -327
  294. package/dist/command-palette-V_2pEay7.js +0 -379
  295. package/dist/date-picker-C29Uo4Tx.js +0 -250
  296. package/dist/field-anatomy-D2ToMeRa.js +0 -109
  297. package/dist/menu-CGPTNRnF.js +0 -216
  298. package/dist/pill-DO2gHzMb.js +0 -56
  299. package/dist/popover-CdRXjQqI.js +0 -113
  300. package/dist/select-BgG7WgSh.js +0 -286
  301. package/dist/switch-Dr-qjmT4.js +0 -142
  302. package/dist/tabs-CK_g1RKa.js +0 -203
  303. package/dist/toast-CjmELMZZ.js +0 -283
  304. package/dist/tooltip-CaL3rKbV.js +0 -108
  305. package/dist/use-controlled-state-CVXDa-qM.js +0 -21
  306. package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
  307. package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
@@ -0,0 +1,645 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { n } from "./focus-ring-BK5W5_NY.js";
4
+ import { n as r, r as i } from "./media-8yrN85VT.js";
5
+ import { t as a } from "./use-controlled-state-DpeVQZNR.js";
6
+ import { t as o } from "./visually-hidden-BJdvqqvn.js";
7
+ import { t as s } from "./renderable-DzcIj1Lo.js";
8
+ import { t as c } from "./button-NLY0h6EJ.js";
9
+ import { t as l } from "./radio-group-TIK0-iPX.js";
10
+ import { useEffect as u, useId as ee, useImperativeHandle as te, useLayoutEffect as d, useRef as f, useState as ne } from "react";
11
+ import { vars as p } from "@jfrader/tokens/vars";
12
+ import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
13
+ import { useMergeRefs as re } from "@floating-ui/react";
14
+ import { base as g } from "@jfrader/tokens";
15
+ //#region src/components/signature-pad/signature-pad.tsx
16
+ 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 = {
17
+ fine: 2,
18
+ medium: 4,
19
+ bold: 7
20
+ }, S = {
21
+ black: g.color.signatureInkBlack,
22
+ blue: g.color.signatureInkBlue,
23
+ violet: g.color.signatureInkViolet
24
+ }, fe = {
25
+ black: "--ui-color-text",
26
+ blue: "--ui-color-info",
27
+ violet: "--ui-color-accent"
28
+ }, C = class extends Error {
29
+ code;
30
+ constructor(e, t) {
31
+ super(t), this.code = e, this.name = "SignatureExportError";
32
+ }
33
+ }, w = 0;
34
+ function pe() {
35
+ let e = /* @__PURE__ */ new Uint32Array(2);
36
+ return globalThis.crypto?.getRandomValues?.(e), [++w, ...e].map((e) => e.toString(36)).join("-");
37
+ }
38
+ function me(e) {
39
+ let t = 0;
40
+ if (!Array.isArray(e) || e.length > ae) return !1;
41
+ for (let n of e) {
42
+ 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;
43
+ let e = 0;
44
+ for (let r of n.points) {
45
+ 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;
46
+ e = r.time;
47
+ }
48
+ }
49
+ return !0;
50
+ }
51
+ function T(e) {
52
+ if (!me(e)) throw new C("invalid", "Invalid signature strokes.");
53
+ }
54
+ var E = (e, t, n) => Math.min(n, Math.max(t, e));
55
+ function D(e) {
56
+ if (me(e)) return e;
57
+ let t = [], n = 0;
58
+ for (let r of Array.isArray(e) ? e.slice(0, ae) : []) {
59
+ if (n >= y) break;
60
+ if (!r || !Object.hasOwn(x, r.width) || !Object.hasOwn(S, r.color) || !Array.isArray(r.points)) continue;
61
+ let e = 0, i = [];
62
+ for (let t of r.points) {
63
+ if (n >= y) break;
64
+ n++, t && Number.isFinite(t.x) && Number.isFinite(t.y) && (Number.isFinite(t.time) && (e = Math.max(e, t.time)), i.push({
65
+ x: E(t.x, 0, _),
66
+ y: E(t.y, 0, v),
67
+ pressure: Number.isFinite(t.pressure) ? E(t.pressure, 0, 1) : null,
68
+ time: e
69
+ }));
70
+ }
71
+ i.length && t.push({
72
+ ...r,
73
+ startTime: Number.isFinite(r.startTime) ? Math.max(0, r.startTime) : 0,
74
+ points: i
75
+ });
76
+ }
77
+ return t;
78
+ }
79
+ var he = (e) => e.reduce((e, t) => e + t.points.length, 0), O = (e, t) => ({
80
+ x: (e.x + t.x) / 2,
81
+ y: (e.y + t.y) / 2,
82
+ time: (e.time + t.time) / 2,
83
+ pressure: e.pressure === null || t.pressure === null ? null : (e.pressure + t.pressure) / 2
84
+ }), k = (e, t) => x[t] * (e.pressure === null ? 1 : .25 + e.pressure * .75);
85
+ function A(e) {
86
+ let t = [];
87
+ for (let n = 1; n < e.points.length; n++) {
88
+ 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);
89
+ t.push({
90
+ from: a,
91
+ control: r,
92
+ to: o,
93
+ width: (k(r, e.width) + k(i, e.width)) / 2
94
+ });
95
+ }
96
+ return t;
97
+ }
98
+ function ge(e, t, n) {
99
+ for (let r of t) {
100
+ if (e.strokeStyle = e.fillStyle = n[r.color], e.lineCap = e.lineJoin = "round", r.points.length === 1) {
101
+ let t = r.points[0];
102
+ e.beginPath(), e.arc(t.x, t.y, k(t, r.width) / 2, 0, Math.PI * 2), e.fill();
103
+ }
104
+ 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();
105
+ }
106
+ }
107
+ function j(e, t) {
108
+ if (T(e), !e.length) throw new C("empty", "Cannot export an empty signature.");
109
+ let n = 0, r = 0, i = _, a = v;
110
+ if (t.crop !== !1) {
111
+ n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
112
+ for (let t of e) for (let e of t.points) {
113
+ let o = x[t.width] / 2 + oe;
114
+ 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);
115
+ }
116
+ }
117
+ let o = t.scale ?? se, s = i - n, c = a - r;
118
+ 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.");
119
+ return {
120
+ left: n,
121
+ top: r,
122
+ width: s,
123
+ height: c,
124
+ scale: o
125
+ };
126
+ }
127
+ function _e(e, t = {}) {
128
+ let n = j(e, t);
129
+ if (typeof document > "u") throw new C("encoder", "Canvas rendering is unavailable.");
130
+ let r = document.createElement("canvas");
131
+ r.width = Math.ceil(n.width * n.scale), r.height = Math.ceil(n.height * n.scale);
132
+ let i = r.getContext("2d");
133
+ if (!i) throw new C("encoder", "Canvas rendering is unavailable.");
134
+ return i.scale(n.scale, n.scale), i.translate(-n.left, -n.top), ge(i, e, S), r;
135
+ }
136
+ function ve(e, t = {}) {
137
+ return new Promise((n, r) => {
138
+ try {
139
+ _e(e, t).toBlob((e) => e ? n(e) : r(new C("encoder", "PNG encoding failed.")), "image/png");
140
+ } catch (e) {
141
+ r(e);
142
+ }
143
+ });
144
+ }
145
+ function ye(e, t = {}) {
146
+ let n = j(e, t), r = e.map((e) => {
147
+ let t = S[e.color];
148
+ if (e.points.length === 1) {
149
+ let n = e.points[0];
150
+ return `<circle cx="${n.x}" cy="${n.y}" r="${k(n, e.width) / 2}" fill="${t}"/>`;
151
+ }
152
+ 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("");
153
+ }).join("");
154
+ 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>`;
155
+ }
156
+ var be = e({
157
+ display: "grid",
158
+ gap: p.space[3],
159
+ minInlineSize: 0,
160
+ color: p.color.text,
161
+ fontFamily: p.font.sans,
162
+ fontSize: p.textSize.sm
163
+ }), xe = e({
164
+ position: "relative",
165
+ minInlineSize: 0
166
+ }), Se = e({
167
+ display: "block",
168
+ boxSizing: "border-box",
169
+ inlineSize: "100%",
170
+ aspectRatio: `${_} / ${v}`,
171
+ backgroundColor: p.color.surface,
172
+ color: p.color.text,
173
+ border: `1px solid ${p.color.borderControl}`,
174
+ borderRadius: p.radius.lg,
175
+ touchAction: "none",
176
+ "&:focus-visible": n,
177
+ "&[aria-disabled=\"true\"], &[data-readonly]": { touchAction: "auto" },
178
+ [r]: {
179
+ borderColor: "CanvasText",
180
+ color: "CanvasText"
181
+ }
182
+ }), Ce = e({
183
+ position: "absolute",
184
+ insetInline: p.space[4],
185
+ insetBlockEnd: p.space[8],
186
+ borderBlockEnd: `1px solid ${p.color.borderStrong}`,
187
+ pointerEvents: "none",
188
+ color: p.color.textMuted,
189
+ display: "flex",
190
+ justifyContent: "space-between",
191
+ gap: p.space[2],
192
+ fontSize: p.textSize.xs,
193
+ transitionProperty: "opacity",
194
+ transitionDuration: p.motion.duration.base,
195
+ [i]: { transitionDuration: "0s" }
196
+ }), we = e({
197
+ display: "flex",
198
+ flexWrap: "wrap",
199
+ alignItems: "center",
200
+ gap: p.space[3]
201
+ }), 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);
202
+ function N({ ref: e, apiRef: n, value: r, defaultValue: i = 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 }) {
203
+ let R = ee(), z = f(null), Ge = re([z, e]), Ke = f(i), [B = de, qe] = a(r, Ke.current, s), [Je = "black", Ye] = a(p, g, ie), [Xe = "medium", Ze] = a(oe, se, C), V = f({
204
+ present: B,
205
+ past: [],
206
+ future: []
207
+ }), H = f(null), U = f(null), W = f(null), Qe = f(null), [$e, et] = ne({
208
+ text: "",
209
+ revision: 0
210
+ });
211
+ function G(e) {
212
+ et((t) => ({
213
+ text: e,
214
+ revision: t.revision + 1
215
+ }));
216
+ }
217
+ let [tt, nt] = ne(!1), [, rt] = ne(0), K = A || j, it = Number.isFinite(je) && je > 0 ? Math.floor(je) : ce;
218
+ function q(e = U.current ? [...V.current.present, U.current.stroke] : V.current.present) {
219
+ let t = z.current;
220
+ if (!t) return;
221
+ let n = t.getBoundingClientRect();
222
+ if (n.width <= 0 || n.height <= 0 || t.clientWidth <= 0 || t.clientHeight <= 0) return;
223
+ 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));
224
+ (t.width !== a || t.height !== o) && (t.width = a, t.height = o);
225
+ let s = t.getContext("2d");
226
+ if (!s) return;
227
+ 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);
228
+ 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()]));
229
+ ge(s, D(e), u);
230
+ }
231
+ function J() {
232
+ W.current !== null && z.current?.ownerDocument.defaultView?.cancelAnimationFrame(W.current), W.current = null, nt(!1), q();
233
+ }
234
+ function Y() {
235
+ J(), G(P.replayComplete);
236
+ }
237
+ function X() {
238
+ let e = U.current?.pointerId;
239
+ U.current = null;
240
+ let t = z.current;
241
+ e !== void 0 && t?.hasPointerCapture(e) && t.releasePointerCapture(e), q();
242
+ }
243
+ function at(e, t, n) {
244
+ M(e, V.current.present) || (J(), X(), H.current = {
245
+ value: e,
246
+ history: t,
247
+ status: n
248
+ }, qe(e));
249
+ }
250
+ function ot() {
251
+ let e = V.current;
252
+ if (K || !e.past.length) return;
253
+ let t = e.past[e.past.length - 1];
254
+ at(t, {
255
+ present: t,
256
+ past: e.past.slice(0, -1),
257
+ future: [e.present, ...e.future].slice(0, it)
258
+ }, P.undone);
259
+ }
260
+ function st() {
261
+ let e = V.current;
262
+ if (K || !e.future.length) return;
263
+ let t = e.future[0];
264
+ at(t, {
265
+ present: t,
266
+ past: [...e.past, e.present].slice(-it),
267
+ future: e.future.slice(1)
268
+ }, P.redone);
269
+ }
270
+ function Z(e, t) {
271
+ let n = V.current;
272
+ at(e, {
273
+ present: e,
274
+ past: [...n.past, n.present].slice(-it),
275
+ future: []
276
+ }, t);
277
+ }
278
+ function ct() {
279
+ K || Z(de, P.cleared);
280
+ }
281
+ function lt() {
282
+ J(), X();
283
+ let e = D(V.current.present), t = z.current?.ownerDocument.defaultView;
284
+ if (A || !e.length || !t) return;
285
+ if (t.matchMedia("(prefers-reduced-motion: reduce)").matches) {
286
+ Y();
287
+ return;
288
+ }
289
+ let n = [], r = 0;
290
+ e.forEach((t, i) => {
291
+ 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;
292
+ n.push({
293
+ stroke: t,
294
+ offset: r + o
295
+ }), r += o + s;
296
+ });
297
+ let i = r > le ? le / r : 1, a = t.performance.now();
298
+ nt(!0);
299
+ let o = (e) => {
300
+ let s = (e - a) / i;
301
+ q(n.flatMap(({ stroke: e, offset: t }) => {
302
+ if (s < t) return [];
303
+ let n = e.points.filter((e) => e.time <= s - t);
304
+ return n.length ? [{
305
+ ...e,
306
+ points: n
307
+ }] : [];
308
+ })), s >= r ? Y() : W.current = t.requestAnimationFrame(o);
309
+ };
310
+ W.current = t.requestAnimationFrame(o);
311
+ }
312
+ let Q = f(null);
313
+ u(() => {
314
+ 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.")));
315
+ }, [B]), d(() => {
316
+ 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 = {
317
+ present: B,
318
+ past: [],
319
+ future: []
320
+ }, H.current = null, rt((e) => e + 1)), W.current === null && q(U.current ? [...V.current.present, U.current.stroke] : V.current.present);
321
+ }), d(() => {
322
+ K && (X(), J());
323
+ }, [K]);
324
+ let $ = f({
325
+ draw: q,
326
+ completeReplay: Y,
327
+ reset: () => {
328
+ K || Z(Ke.current, P.reset);
329
+ }
330
+ });
331
+ d(() => {
332
+ $.current = {
333
+ draw: q,
334
+ completeReplay: Y,
335
+ reset: () => {
336
+ K || Z(Ke.current, P.reset);
337
+ }
338
+ };
339
+ }), d(() => {
340
+ let e = z.current, t = e.ownerDocument.defaultView, n = () => {
341
+ W.current === null && $.current.draw();
342
+ }, r = new ResizeObserver(n);
343
+ r.observe(e);
344
+ let i = new MutationObserver(n);
345
+ for (let t = e.parentElement; t; t = t.parentElement) i.observe(t, {
346
+ attributes: !0,
347
+ attributeFilter: [
348
+ "data-theme",
349
+ "class",
350
+ "style"
351
+ ]
352
+ });
353
+ let a = t.matchMedia("(forced-colors: active)");
354
+ a.addEventListener("change", n);
355
+ let o = t.matchMedia("(prefers-reduced-motion: reduce)"), s = () => {
356
+ o.matches && W.current !== null && $.current.completeReplay();
357
+ };
358
+ o.addEventListener("change", s);
359
+ let c = t.matchMedia(`(resolution: ${t.devicePixelRatio}dppx)`), l = () => {
360
+ n(), c.removeEventListener("change", l), c = t.matchMedia(`(resolution: ${t.devicePixelRatio}dppx)`), c.addEventListener("change", l);
361
+ };
362
+ c.addEventListener("change", l), t.addEventListener("resize", n);
363
+ let u = e.closest("form"), ee = (t) => {
364
+ queueMicrotask(() => {
365
+ !t.defaultPrevented && e.isConnected && $.current.reset();
366
+ });
367
+ };
368
+ return u?.addEventListener("reset", ee), () => {
369
+ 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;
370
+ };
371
+ }, []);
372
+ function ut(e) {
373
+ return z.current && G(P.exported), e;
374
+ }
375
+ function dt(e) {
376
+ if (K || e.key !== "Home" && e.key !== "End") return;
377
+ let t = e.currentTarget.querySelectorAll("input[type=\"radio\"]:not(:disabled)"), n = e.key === "Home" ? t[0] : t[t.length - 1];
378
+ n && (e.preventDefault(), n.focus(), n.click());
379
+ }
380
+ te(n, () => ({
381
+ focus: () => z.current?.focus(),
382
+ clear: ct,
383
+ undo: ot,
384
+ redo: st,
385
+ replay: lt,
386
+ stopReplay: J,
387
+ toDataURL: (e) => ut(_e(V.current.present, e ?? F).toDataURL("image/png")),
388
+ toBlob: (e) => ve(V.current.present, e ?? F).then(ut),
389
+ toSvg: (e) => ut(ye(V.current.present, e ?? F))
390
+ }));
391
+ function ft(e, t) {
392
+ let n = z.current, r = n.getBoundingClientRect(), i = n.clientWidth, a = n.clientHeight;
393
+ if (i <= 0 || a <= 0 || !Number.isFinite(e.clientX) || !Number.isFinite(e.clientY)) return;
394
+ let o = t.stroke.points, s = Math.max(o.at(-1)?.time ?? 0, Number.isFinite(e.timeStamp) ? e.timeStamp - t.started : 0), c = {
395
+ x: Math.max(0, Math.min(_, (e.clientX - r.left - n.clientLeft) / i * _)),
396
+ y: Math.max(0, Math.min(v, (e.clientY - r.top - n.clientTop) / a * v)),
397
+ pressure: e.pointerType === "pen" && Number.isFinite(e.pressure) ? Math.max(0, Math.min(1, e.pressure)) : null,
398
+ time: s
399
+ }, l = o.at(-1), u = y - he(D(V.current.present));
400
+ (!l || l.x !== c.x || l.y !== c.y) && o.length < u && o.push(c);
401
+ }
402
+ function pt(e) {
403
+ let t = U.current;
404
+ if (!t || e.pointerId !== t.pointerId) return;
405
+ let n = e.nativeEvent.getCoalescedEvents?.() ?? [];
406
+ for (let e of n) ft(e, t);
407
+ ft(e.nativeEvent, t), q([...V.current.present, t.stroke]);
408
+ }
409
+ async function mt(e) {
410
+ try {
411
+ 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;
412
+ if (!n) return;
413
+ let r = URL.createObjectURL(t);
414
+ try {
415
+ let t = n.createElement("a");
416
+ t.href = r, t.download = `${Ae.replace(/[\\/\u0000-\u001f:*?"<>|]/g, "_") || "signature"}.${e}`, t.click(), G(P.exported);
417
+ } finally {
418
+ URL.revokeObjectURL(r);
419
+ }
420
+ } catch {
421
+ z.current && G(P.exportFailed);
422
+ }
423
+ }
424
+ let ht = V.current, gt = [
425
+ {
426
+ action: "undo",
427
+ disabled: K || !ht.past.length,
428
+ run: ot
429
+ },
430
+ {
431
+ action: "redo",
432
+ disabled: K || !ht.future.length,
433
+ run: st
434
+ },
435
+ ...Oe ? [{
436
+ action: tt ? "stop" : "replay",
437
+ disabled: A || !B.length,
438
+ run: tt ? J : lt
439
+ }] : [],
440
+ {
441
+ action: "clear",
442
+ disabled: K || !B.length,
443
+ run: ct
444
+ },
445
+ ...ke ? [{
446
+ action: "png",
447
+ disabled: A || !B.length,
448
+ run: () => {
449
+ mt("png");
450
+ }
451
+ }, {
452
+ action: "svg",
453
+ disabled: A || !B.length,
454
+ run: () => {
455
+ mt("svg");
456
+ }
457
+ }] : []
458
+ ];
459
+ return /* @__PURE__ */ m(t, {
460
+ className: [Ne, I?.root?.className].filter(Boolean).join(" "),
461
+ styles: [be, I?.root?.css],
462
+ sx: Pe,
463
+ children: (e) => /* @__PURE__ */ h("div", {
464
+ "data-ui": "signature-pad",
465
+ "data-state": B.length ? "signed" : "empty",
466
+ className: e,
467
+ dir: Fe,
468
+ style: Ie,
469
+ children: [
470
+ b(w) && /* @__PURE__ */ m("span", {
471
+ id: `${R}-label`,
472
+ className: I?.label?.className,
473
+ css: [Te, I?.label?.css],
474
+ children: w
475
+ }),
476
+ /* @__PURE__ */ m("span", {
477
+ id: `${R}-state`,
478
+ css: o,
479
+ children: B.length ? P.signed : P.empty
480
+ }),
481
+ /* @__PURE__ */ m("span", {
482
+ id: `${R}-shortcuts`,
483
+ css: o,
484
+ children: P.shortcuts
485
+ }),
486
+ /* @__PURE__ */ h("div", {
487
+ css: xe,
488
+ children: [/* @__PURE__ */ m("canvas", {
489
+ ...L,
490
+ ref: Ge,
491
+ role: "img",
492
+ tabIndex: A ? -1 : L.tabIndex ?? 0,
493
+ "aria-roledescription": P.roleDescription,
494
+ "aria-disabled": A || void 0,
495
+ "data-readonly": j || void 0,
496
+ "aria-invalid": b(E) ? !0 : L["aria-invalid"],
497
+ "aria-labelledby": [
498
+ Ue,
499
+ b(w) && `${R}-label`,
500
+ !L["aria-label"] && `${R}-state`
501
+ ].filter(Boolean).join(" ") || void 0,
502
+ "aria-describedby": [
503
+ We,
504
+ `${R}-state`,
505
+ `${R}-shortcuts`,
506
+ N && `${R}-required`,
507
+ b(T) && `${R}-description`,
508
+ b(E) && `${R}-error`
509
+ ].filter(Boolean).join(" "),
510
+ className: I?.canvas?.className,
511
+ css: [Se, I?.canvas?.css],
512
+ onPointerDown: (e) => {
513
+ 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;
514
+ J(), H.current = null;
515
+ let t = Number.isFinite(e.timeStamp) ? e.timeStamp : 0;
516
+ Qe.current ??= t;
517
+ let n = {
518
+ pointerId: e.pointerId,
519
+ started: t,
520
+ stroke: {
521
+ id: pe(),
522
+ points: [],
523
+ color: Je,
524
+ width: Xe,
525
+ startTime: Math.max(0, t - Qe.current)
526
+ }
527
+ };
528
+ U.current = n;
529
+ try {
530
+ e.currentTarget.setPointerCapture(e.pointerId);
531
+ } catch {
532
+ U.current = null;
533
+ return;
534
+ }
535
+ ft(e.nativeEvent, n), q([...ht.present, n.stroke]), e.preventDefault();
536
+ },
537
+ onPointerMove: (e) => {
538
+ Re?.(e), e.defaultPrevented || pt(e);
539
+ },
540
+ onPointerUp: (e) => {
541
+ if (ze?.(e), U.current?.pointerId !== e.pointerId) return;
542
+ if (e.defaultPrevented) {
543
+ X();
544
+ return;
545
+ }
546
+ pt(e);
547
+ let t = U.current.stroke;
548
+ X(), t.points.length && Z([...V.current.present, t], P.added);
549
+ },
550
+ onPointerCancel: (e) => {
551
+ Be?.(e), U.current?.pointerId === e.pointerId && X();
552
+ },
553
+ onLostPointerCapture: (e) => {
554
+ Ve?.(e), U.current?.pointerId === e.pointerId && X();
555
+ },
556
+ onKeyDown: (e) => {
557
+ if (He?.(e), e.defaultPrevented || e.target !== e.currentTarget) return;
558
+ let t = e.key.toLowerCase();
559
+ 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());
560
+ },
561
+ children: P.fallback
562
+ }), (b(k) || b(O)) && /* @__PURE__ */ h("div", {
563
+ "aria-hidden": "true",
564
+ "data-ui": "signature-pad-guide",
565
+ className: I?.guide?.className,
566
+ css: [Ce, I?.guide?.css],
567
+ children: [!B.length && b(k) && /* @__PURE__ */ m("span", { children: k }), b(O) && /* @__PURE__ */ m("span", { children: O })]
568
+ })]
569
+ }),
570
+ /* @__PURE__ */ h("div", {
571
+ "data-ui": "signature-pad-toolbar",
572
+ className: I?.toolbar?.className,
573
+ css: [we, I?.toolbar?.css],
574
+ children: [
575
+ /* @__PURE__ */ m(l, {
576
+ "aria-label": P.ink,
577
+ orientation: "horizontal",
578
+ value: Je,
579
+ onValueChange: (e) => Ye(e),
580
+ disabled: K,
581
+ onKeyDown: dt,
582
+ children: Object.keys(S).map((e) => /* @__PURE__ */ m(l.Radio, {
583
+ value: e,
584
+ label: P.colors[e]
585
+ }, e))
586
+ }),
587
+ /* @__PURE__ */ m(l, {
588
+ "aria-label": P.nib,
589
+ orientation: "horizontal",
590
+ value: Xe,
591
+ onValueChange: (e) => Ze(e),
592
+ disabled: K,
593
+ onKeyDown: dt,
594
+ children: Object.keys(x).map((e) => /* @__PURE__ */ m(l.Radio, {
595
+ value: e,
596
+ label: P.widths[e]
597
+ }, e))
598
+ }),
599
+ gt.map(({ action: e, disabled: t, run: n }) => /* @__PURE__ */ h(c, {
600
+ size: "sm",
601
+ variant: "outline",
602
+ disabled: t,
603
+ onClick: n,
604
+ className: I?.action?.className,
605
+ css: I?.action?.css,
606
+ children: [b(Me?.[e]) && /* @__PURE__ */ m("span", {
607
+ "aria-hidden": "true",
608
+ children: Me?.[e]
609
+ }), P.actions[e]]
610
+ }, e))
611
+ ]
612
+ }),
613
+ N && /* @__PURE__ */ m("span", {
614
+ id: `${R}-required`,
615
+ css: o,
616
+ children: P.required
617
+ }),
618
+ b(T) && /* @__PURE__ */ m("div", {
619
+ id: `${R}-description`,
620
+ className: I?.description?.className,
621
+ css: [Ee, I?.description?.css],
622
+ children: T
623
+ }),
624
+ b(E) && /* @__PURE__ */ m("div", {
625
+ id: `${R}-error`,
626
+ role: "alert",
627
+ className: I?.error?.className,
628
+ css: [De, I?.error?.css],
629
+ children: E
630
+ }),
631
+ /* @__PURE__ */ m("div", {
632
+ role: "status",
633
+ "aria-live": "polite",
634
+ "aria-atomic": "true",
635
+ className: I?.status?.className,
636
+ css: [o, I?.status?.css],
637
+ children: $e.text && /* @__PURE__ */ m("span", { children: $e.text }, $e.revision)
638
+ })
639
+ ]
640
+ })
641
+ });
642
+ }
643
+ N.displayName = "SignaturePad";
644
+ //#endregion
645
+ export { ye as i, N as n, ve as r, C as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as SignatureExportError, n as SignaturePad, r as signatureToPng, i as signatureToSvg } from "./signature-pad-_bTeguN9.js";
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
3
- import { n as r } from "./media-D_eA_I-e.js";
3
+ import { r } from "./media-8yrN85VT.js";
4
4
  import { vars as i } from "@jfrader/tokens/vars";
5
5
  import { jsx as a } from "@emotion/react/jsx-runtime";
6
6
  //#region src/components/skeleton/skeleton.tsx
package/dist/skeleton.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Skeleton } from "./skeleton-OoFlOEXO.js";
2
+ export { t as Skeleton } from "./skeleton-XQQDkCHd.js";