@42-central/ui-react 0.24.0 → 0.26.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 (294) hide show
  1. package/dist/{chunk-YWTOW7PZ.js → chunk-276RL7FX.js} +10 -10
  2. package/dist/{chunk-YWTOW7PZ.js.map → chunk-276RL7FX.js.map} +1 -1
  3. package/dist/{chunk-FUNTJZX7.js → chunk-2CL3FKEY.js} +3 -3
  4. package/dist/{chunk-FUNTJZX7.js.map → chunk-2CL3FKEY.js.map} +1 -1
  5. package/dist/{chunk-YPFSRZ3T.js → chunk-2NTCQIRP.js} +5 -5
  6. package/dist/{chunk-YPFSRZ3T.js.map → chunk-2NTCQIRP.js.map} +1 -1
  7. package/dist/{chunk-D3JYDAUZ.js → chunk-2TZU4LSX.js} +4 -4
  8. package/dist/{chunk-D3JYDAUZ.js.map → chunk-2TZU4LSX.js.map} +1 -1
  9. package/dist/{chunk-DJLNGWMM.js → chunk-6IRMKF5T.js} +3 -3
  10. package/dist/{chunk-DJLNGWMM.js.map → chunk-6IRMKF5T.js.map} +1 -1
  11. package/dist/{chunk-DT6LKNZF.js → chunk-7247WBTV.js} +5 -4
  12. package/dist/chunk-7247WBTV.js.map +1 -0
  13. package/dist/{chunk-F2FSHVO5.js → chunk-7B44J3CF.js} +7 -7
  14. package/dist/{chunk-F2FSHVO5.js.map → chunk-7B44J3CF.js.map} +1 -1
  15. package/dist/{chunk-6VYGK3Q3.js → chunk-7E7JNWOC.js} +16 -21
  16. package/dist/chunk-7E7JNWOC.js.map +1 -0
  17. package/dist/{chunk-7AQ4MN4M.js → chunk-7OGZT7U2.js} +14 -6
  18. package/dist/chunk-7OGZT7U2.js.map +1 -0
  19. package/dist/{chunk-UAYENYS2.js → chunk-AKXALCUN.js} +3 -3
  20. package/dist/{chunk-UAYENYS2.js.map → chunk-AKXALCUN.js.map} +1 -1
  21. package/dist/{chunk-BE2LWUHY.js → chunk-BMEJBY6H.js} +5 -3
  22. package/dist/chunk-BMEJBY6H.js.map +1 -0
  23. package/dist/{chunk-DHJB4UJD.js → chunk-DMI4KS32.js} +5 -5
  24. package/dist/{chunk-DHJB4UJD.js.map → chunk-DMI4KS32.js.map} +1 -1
  25. package/dist/{chunk-FB2G4LNH.js → chunk-DSZF2TW6.js} +7 -7
  26. package/dist/{chunk-FB2G4LNH.js.map → chunk-DSZF2TW6.js.map} +1 -1
  27. package/dist/{chunk-N66NC6QK.js → chunk-E3XLWMEB.js} +3 -3
  28. package/dist/{chunk-N66NC6QK.js.map → chunk-E3XLWMEB.js.map} +1 -1
  29. package/dist/{chunk-MXAACRWE.js → chunk-E52Z2FKU.js} +5 -5
  30. package/dist/{chunk-MXAACRWE.js.map → chunk-E52Z2FKU.js.map} +1 -1
  31. package/dist/chunk-F374BNL4.js +129 -0
  32. package/dist/chunk-F374BNL4.js.map +1 -0
  33. package/dist/{chunk-3L5GLI67.js → chunk-I4B3N3UX.js} +3 -3
  34. package/dist/{chunk-3L5GLI67.js.map → chunk-I4B3N3UX.js.map} +1 -1
  35. package/dist/{chunk-IPYHTCFL.js → chunk-IUK7OJXZ.js} +3 -3
  36. package/dist/{chunk-IPYHTCFL.js.map → chunk-IUK7OJXZ.js.map} +1 -1
  37. package/dist/{chunk-HRNWWL3Y.js → chunk-J2NW7JID.js} +61 -29
  38. package/dist/chunk-J2NW7JID.js.map +1 -0
  39. package/dist/{chunk-MRAJ45IM.js → chunk-JDPVD2YE.js} +5 -5
  40. package/dist/{chunk-MRAJ45IM.js.map → chunk-JDPVD2YE.js.map} +1 -1
  41. package/dist/{chunk-SZEOTXRZ.js → chunk-JFB6O7IY.js} +5 -5
  42. package/dist/{chunk-SZEOTXRZ.js.map → chunk-JFB6O7IY.js.map} +1 -1
  43. package/dist/{chunk-2MXWEIMD.js → chunk-KKLCHLCZ.js} +12 -11
  44. package/dist/chunk-KKLCHLCZ.js.map +1 -0
  45. package/dist/{chunk-6N6J2DOE.js → chunk-LIZWCWED.js} +3 -3
  46. package/dist/{chunk-6N6J2DOE.js.map → chunk-LIZWCWED.js.map} +1 -1
  47. package/dist/chunk-LJVIZNPE.js +9 -0
  48. package/dist/chunk-LJVIZNPE.js.map +1 -0
  49. package/dist/{chunk-HQPU73WV.js → chunk-LYGOFMXJ.js} +3 -3
  50. package/dist/{chunk-HQPU73WV.js.map → chunk-LYGOFMXJ.js.map} +1 -1
  51. package/dist/{chunk-JVG5ISPT.js → chunk-N42EFOML.js} +4 -4
  52. package/dist/{chunk-JVG5ISPT.js.map → chunk-N42EFOML.js.map} +1 -1
  53. package/dist/{chunk-C4NFRSOR.js → chunk-NF2PBGD3.js} +38 -25
  54. package/dist/chunk-NF2PBGD3.js.map +1 -0
  55. package/dist/{chunk-DA4QII2N.js → chunk-NLSJ6T7V.js} +4 -4
  56. package/dist/{chunk-DA4QII2N.js.map → chunk-NLSJ6T7V.js.map} +1 -1
  57. package/dist/{chunk-UT3TOV2Q.js → chunk-OVT2KZHY.js} +3 -3
  58. package/dist/{chunk-UT3TOV2Q.js.map → chunk-OVT2KZHY.js.map} +1 -1
  59. package/dist/{chunk-MW42XVPD.js → chunk-PBSVX5DB.js} +15 -5
  60. package/dist/chunk-PBSVX5DB.js.map +1 -0
  61. package/dist/{chunk-SVKN5ZHX.js → chunk-PEHFWGTT.js} +16 -13
  62. package/dist/chunk-PEHFWGTT.js.map +1 -0
  63. package/dist/{chunk-J44FJ7PH.js → chunk-PFZMB3US.js} +4 -4
  64. package/dist/{chunk-J44FJ7PH.js.map → chunk-PFZMB3US.js.map} +1 -1
  65. package/dist/{chunk-IRNF274I.js → chunk-PT22KEVD.js} +5 -5
  66. package/dist/{chunk-IRNF274I.js.map → chunk-PT22KEVD.js.map} +1 -1
  67. package/dist/{chunk-OZMSXYBX.js → chunk-QEAF57ZQ.js} +4 -4
  68. package/dist/{chunk-OZMSXYBX.js.map → chunk-QEAF57ZQ.js.map} +1 -1
  69. package/dist/{chunk-SWVUXEBT.js → chunk-SCXXJDKQ.js} +3 -3
  70. package/dist/{chunk-SWVUXEBT.js.map → chunk-SCXXJDKQ.js.map} +1 -1
  71. package/dist/{chunk-E5H3YWZV.js → chunk-SOUDKESO.js} +15 -8
  72. package/dist/chunk-SOUDKESO.js.map +1 -0
  73. package/dist/{chunk-4FEOMQYR.js → chunk-THGJLR5S.js} +6 -6
  74. package/dist/{chunk-4FEOMQYR.js.map → chunk-THGJLR5S.js.map} +1 -1
  75. package/dist/{chunk-TCFB23JT.js → chunk-WERJ44ZN.js} +3 -3
  76. package/dist/{chunk-TCFB23JT.js.map → chunk-WERJ44ZN.js.map} +1 -1
  77. package/dist/{chunk-QNKD2SQM.js → chunk-X3YIHN2U.js} +5 -5
  78. package/dist/{chunk-QNKD2SQM.js.map → chunk-X3YIHN2U.js.map} +1 -1
  79. package/dist/{chunk-VD6PB3VA.js → chunk-X6DESK37.js} +12 -3
  80. package/dist/chunk-X6DESK37.js.map +1 -0
  81. package/dist/{chunk-47LEAR6G.js → chunk-Y2G47ARQ.js} +6 -6
  82. package/dist/{chunk-47LEAR6G.js.map → chunk-Y2G47ARQ.js.map} +1 -1
  83. package/dist/{chunk-O7LS6OZR.js → chunk-YMVUQ2L7.js} +4 -4
  84. package/dist/{chunk-O7LS6OZR.js.map → chunk-YMVUQ2L7.js.map} +1 -1
  85. package/dist/{chunk-F342ZT7O.js → chunk-ZVECQBGG.js} +13 -7
  86. package/dist/chunk-ZVECQBGG.js.map +1 -0
  87. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  88. package/dist/components/action-icon/index.js +1 -1
  89. package/dist/components/alert/index.js +1 -1
  90. package/dist/components/ambient-background/index.js +14 -26
  91. package/dist/components/ambient-background/index.js.map +1 -1
  92. package/dist/components/ambient-background/starfield.d.ts.map +1 -1
  93. package/dist/components/app-shell/app-shell.d.ts +55 -10
  94. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  95. package/dist/components/app-shell/index.d.ts +1 -1
  96. package/dist/components/app-shell/index.d.ts.map +1 -1
  97. package/dist/components/app-shell/index.js +300 -39
  98. package/dist/components/app-shell/index.js.map +1 -1
  99. package/dist/components/autocomplete/index.js +5 -5
  100. package/dist/components/avatar/avatar.d.ts +1 -1
  101. package/dist/components/avatar/avatar.d.ts.map +1 -1
  102. package/dist/components/avatar/index.js +12 -3
  103. package/dist/components/avatar/index.js.map +1 -1
  104. package/dist/components/badge/badge.d.ts.map +1 -1
  105. package/dist/components/badge/index.js +1 -1
  106. package/dist/components/button/index.js +1 -1
  107. package/dist/components/button-group/button-group.d.ts +10 -2
  108. package/dist/components/button-group/button-group.d.ts.map +1 -1
  109. package/dist/components/button-group/index.js +1 -1
  110. package/dist/components/button-multi-select/index.js +4 -4
  111. package/dist/components/button-select/button-select-control.d.ts +4 -1
  112. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  113. package/dist/components/button-select/button-select.d.ts +4 -1
  114. package/dist/components/button-select/button-select.d.ts.map +1 -1
  115. package/dist/components/button-select/index.js +4 -4
  116. package/dist/components/calendar/index.js +4 -4
  117. package/dist/components/calendar-heatmap/index.js +2 -2
  118. package/dist/components/camera/index.js +12 -12
  119. package/dist/components/card/card.d.ts.map +1 -1
  120. package/dist/components/card/index.js +1 -1
  121. package/dist/components/carousel/index.js +2 -2
  122. package/dist/components/checkbox/checkbox.d.ts +3 -2
  123. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  124. package/dist/components/checkbox/index.js +2 -2
  125. package/dist/components/choice-card-group/index.js +2 -2
  126. package/dist/components/choice-card-group/index.js.map +1 -1
  127. package/dist/components/clipboard/index.js +3 -3
  128. package/dist/components/code-block/chrome.js +3 -3
  129. package/dist/components/code-block/code-block.d.ts +6 -3
  130. package/dist/components/code-block/code-block.d.ts.map +1 -1
  131. package/dist/components/code-block/highlighter.d.ts +16 -15
  132. package/dist/components/code-block/highlighter.d.ts.map +1 -1
  133. package/dist/components/code-block/index.d.ts +2 -1
  134. package/dist/components/code-block/index.d.ts.map +1 -1
  135. package/dist/components/code-block/index.js +85 -14
  136. package/dist/components/code-block/index.js.map +1 -1
  137. package/dist/components/code-block/languages.d.ts +61 -0
  138. package/dist/components/code-block/languages.d.ts.map +1 -0
  139. package/dist/components/code-block/static.d.ts +2 -1
  140. package/dist/components/code-block/static.d.ts.map +1 -1
  141. package/dist/components/code-block/static.js +99 -10
  142. package/dist/components/code-block/static.js.map +1 -1
  143. package/dist/components/combobox/index.js +5 -5
  144. package/dist/components/combobox-list/index.js +7 -7
  145. package/dist/components/compare/index.js +2 -2
  146. package/dist/components/data-table/index.js +32 -32
  147. package/dist/components/data-table/index.js.map +1 -1
  148. package/dist/components/date-picker/index.js +14 -14
  149. package/dist/components/download-button/index.js +2 -2
  150. package/dist/components/drawer/index.js +5 -5
  151. package/dist/components/field/field.d.ts +3 -0
  152. package/dist/components/field/field.d.ts.map +1 -1
  153. package/dist/components/field/index.js +1 -1
  154. package/dist/components/file-item/index.js +5 -5
  155. package/dist/components/file-preview/index.js +5 -5
  156. package/dist/components/file-trigger/index.js +2 -2
  157. package/dist/components/file-upload/index.js +6 -6
  158. package/dist/components/gallery/index.js +2 -2
  159. package/dist/components/geodesic/badge-frame.d.ts +13 -1
  160. package/dist/components/geodesic/badge-frame.d.ts.map +1 -1
  161. package/dist/components/geodesic/exam-badge.d.ts +4 -1
  162. package/dist/components/geodesic/exam-badge.d.ts.map +1 -1
  163. package/dist/components/geodesic/geometry.d.ts +14 -9
  164. package/dist/components/geodesic/geometry.d.ts.map +1 -1
  165. package/dist/components/geodesic/index.js +62 -23
  166. package/dist/components/geodesic/index.js.map +1 -1
  167. package/dist/components/geodesic/status.d.ts +8 -6
  168. package/dist/components/geodesic/status.d.ts.map +1 -1
  169. package/dist/components/geodesic/styles.css +15 -2
  170. package/dist/components/hover-card/index.js +2 -2
  171. package/dist/components/image-cropper/index.js +7 -7
  172. package/dist/components/indicator/index.js +24 -9
  173. package/dist/components/indicator/index.js.map +1 -1
  174. package/dist/components/indicator/indicator.d.ts +15 -6
  175. package/dist/components/indicator/indicator.d.ts.map +1 -1
  176. package/dist/components/input/index.js +2 -2
  177. package/dist/components/kbd/index.js +3 -3
  178. package/dist/components/kbd/kbd.d.ts.map +1 -1
  179. package/dist/components/lightbox/index.js +8 -8
  180. package/dist/components/menu/index.js +4 -4
  181. package/dist/components/modal/index.js +5 -5
  182. package/dist/components/multi-combobox-list/index.js +7 -7
  183. package/dist/components/multi-select/index.js +8 -8
  184. package/dist/components/nav-link/index.js +5 -1
  185. package/dist/components/nav-link/nav-link.d.ts.map +1 -1
  186. package/dist/components/nav-link/tanstack.js +5 -1
  187. package/dist/components/nav-link/tanstack.js.map +1 -1
  188. package/dist/components/number-input/index.js +5 -5
  189. package/dist/components/overlays/index.js +7 -7
  190. package/dist/components/password-input/index.js +3 -3
  191. package/dist/components/photo-capture/index.js +16 -16
  192. package/dist/components/pills-input/index.js +5 -5
  193. package/dist/components/pin-input/index.js +2 -2
  194. package/dist/components/popover/index.js +2 -2
  195. package/dist/components/radio-group/index.js +1 -1
  196. package/dist/components/rating/index.js +1 -1
  197. package/dist/components/schedule/index.js +7 -7
  198. package/dist/components/segment-group/index.js +4 -4
  199. package/dist/components/segment-group/segment-group.d.ts +6 -1
  200. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  201. package/dist/components/select/index.js +6 -6
  202. package/dist/components/slider/index.js +2 -2
  203. package/dist/components/spotlight/index.js +11 -11
  204. package/dist/components/switch/index.js +14 -19
  205. package/dist/components/switch/index.js.map +1 -1
  206. package/dist/components/switch/switch.d.ts +1 -0
  207. package/dist/components/switch/switch.d.ts.map +1 -1
  208. package/dist/components/table/index.js +1 -1
  209. package/dist/components/table/table.d.ts.map +1 -1
  210. package/dist/components/tabs/index.js +3 -3
  211. package/dist/components/tabs/tabs-data.d.ts +4 -1
  212. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  213. package/dist/components/tabs/tabs.d.ts +4 -1
  214. package/dist/components/tabs/tabs.d.ts.map +1 -1
  215. package/dist/components/tags-input/index.js +7 -7
  216. package/dist/components/text-input/index.js +2 -2
  217. package/dist/components/textarea/index.js +2 -2
  218. package/dist/components/theme-icon/index.js +1 -1
  219. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  220. package/dist/components/time-input/index.js +9 -9
  221. package/dist/components/tree-multi-select/index.js +8 -8
  222. package/dist/components/tree-select/index.js +5 -5
  223. package/dist/index.js +4 -4
  224. package/dist/lib/sidebar-rail.d.ts +21 -0
  225. package/dist/lib/sidebar-rail.d.ts.map +1 -0
  226. package/dist/theme.css +35 -35
  227. package/package.json +1 -1
  228. package/src/as-child.contract.test.tsx +6 -0
  229. package/src/components/action-icon/action-icon.tsx +3 -1
  230. package/src/components/ambient-background/starfield.tsx +18 -43
  231. package/src/components/app-shell/app-shell.test.tsx +430 -5
  232. package/src/components/app-shell/app-shell.tsx +484 -24
  233. package/src/components/app-shell/index.ts +2 -0
  234. package/src/components/avatar/avatar.test.tsx +12 -0
  235. package/src/components/avatar/avatar.tsx +9 -0
  236. package/src/components/badge/badge.tsx +11 -6
  237. package/src/components/button/button.tsx +1 -1
  238. package/src/components/button-group/button-group.test.tsx +24 -0
  239. package/src/components/button-group/button-group.tsx +21 -4
  240. package/src/components/button-multi-select/button-multi-select.test.tsx +15 -0
  241. package/src/components/button-select/button-select-control.tsx +5 -0
  242. package/src/components/button-select/button-select.test.tsx +25 -0
  243. package/src/components/button-select/button-select.tsx +13 -2
  244. package/src/components/card/card.tsx +10 -9
  245. package/src/components/checkbox/checkbox.test.tsx +17 -9
  246. package/src/components/checkbox/checkbox.tsx +26 -27
  247. package/src/components/choice-card-group/choice-card-group.tsx +3 -3
  248. package/src/components/code-block/code-block.tsx +7 -4
  249. package/src/components/code-block/highlighter.test.ts +79 -1
  250. package/src/components/code-block/highlighter.ts +76 -30
  251. package/src/components/code-block/index.ts +2 -0
  252. package/src/components/code-block/languages.ts +63 -0
  253. package/src/components/code-block/static.tsx +2 -1
  254. package/src/components/data-table/data-table-pagination.tsx +5 -5
  255. package/src/components/data-table/data-table-stack.tsx +2 -2
  256. package/src/components/field/field.tsx +14 -0
  257. package/src/components/geodesic/badge-frame.tsx +67 -13
  258. package/src/components/geodesic/exam-badge.tsx +8 -4
  259. package/src/components/geodesic/geometry.ts +8 -6
  260. package/src/components/geodesic/status.test.ts +11 -2
  261. package/src/components/geodesic/status.ts +11 -7
  262. package/src/components/geodesic/styles.css +15 -2
  263. package/src/components/indicator/indicator.test.tsx +45 -0
  264. package/src/components/indicator/indicator.tsx +40 -13
  265. package/src/components/kbd/kbd.tsx +2 -1
  266. package/src/components/nav-link/nav-link.test.tsx +121 -1
  267. package/src/components/nav-link/nav-link.tsx +78 -29
  268. package/src/components/segment-group/segment-group.test.tsx +22 -0
  269. package/src/components/segment-group/segment-group.tsx +35 -19
  270. package/src/components/switch/switch.test.tsx +15 -0
  271. package/src/components/switch/switch.tsx +27 -27
  272. package/src/components/table/table.test.tsx +1 -1
  273. package/src/components/table/table.tsx +14 -11
  274. package/src/components/tabs/tabs-data.tsx +5 -1
  275. package/src/components/tabs/tabs.test.tsx +28 -0
  276. package/src/components/tabs/tabs.tsx +14 -4
  277. package/src/components/theme-icon/theme-icon.tsx +46 -12
  278. package/src/lib/sidebar-rail.ts +24 -0
  279. package/src/theme.css +35 -35
  280. package/src/theme.test.ts +0 -1
  281. package/dist/chunk-2MXWEIMD.js.map +0 -1
  282. package/dist/chunk-6VYGK3Q3.js.map +0 -1
  283. package/dist/chunk-7AQ4MN4M.js.map +0 -1
  284. package/dist/chunk-7CNDZZZ6.js +0 -95
  285. package/dist/chunk-7CNDZZZ6.js.map +0 -1
  286. package/dist/chunk-BE2LWUHY.js.map +0 -1
  287. package/dist/chunk-C4NFRSOR.js.map +0 -1
  288. package/dist/chunk-DT6LKNZF.js.map +0 -1
  289. package/dist/chunk-E5H3YWZV.js.map +0 -1
  290. package/dist/chunk-F342ZT7O.js.map +0 -1
  291. package/dist/chunk-HRNWWL3Y.js.map +0 -1
  292. package/dist/chunk-MW42XVPD.js.map +0 -1
  293. package/dist/chunk-SVKN5ZHX.js.map +0 -1
  294. package/dist/chunk-VD6PB3VA.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { Progress } from './chunk-QKSLDQM2.js';
2
2
  import { FILE_KIND_ICONS } from './chunk-SDVZFXQ2.js';
3
3
  import { Image } from './chunk-Y57NW6G7.js';
4
- import { Button } from './chunk-SWVUXEBT.js';
5
- import { formatFileSize, useObjectUrl, fileKind } from './chunk-TCFB23JT.js';
6
- import { useLocale, useTimeZone } from './chunk-IPYHTCFL.js';
4
+ import { Button } from './chunk-SCXXJDKQ.js';
5
+ import { formatFileSize, useObjectUrl, fileKind } from './chunk-WERJ44ZN.js';
6
+ import { useLocale, useTimeZone } from './chunk-IUK7OJXZ.js';
7
7
  import { CloseIcon } from './chunk-6YNLRQ25.js';
8
8
  import { mergeIcons, iconStroke } from './chunk-XXOR34T4.js';
9
9
  import { withAsChildContent, composeChildren } from './chunk-R5LYFTHA.js';
@@ -336,5 +336,5 @@ var FileItem = Object.assign(FileItemComponent, {
336
336
  });
337
337
 
338
338
  export { FileItem, isInFlight };
339
- //# sourceMappingURL=chunk-QNKD2SQM.js.map
340
- //# sourceMappingURL=chunk-QNKD2SQM.js.map
339
+ //# sourceMappingURL=chunk-X3YIHN2U.js.map
340
+ //# sourceMappingURL=chunk-X3YIHN2U.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/file-item/file-item.tsx"],"names":["Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;AAmGA,IAAM,oBAAA,GAAuD;AAAA,EAC3D,MAAA,EAAQ,CAAC,IAAA,KAAS,CAAA,OAAA,EAAU,IAAI,CAAA,CAAA;AAAA,EAChC,MAAA,EAAQ,CAAC,IAAA,KAAS,CAAA,iBAAA,EAAoB,IAAI,CAAA,CAAA;AAAA,EAC1C,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,UAAA,EAAY,kBAAA;AAAA,EACZ,IAAA,EAAM,UA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ACxE,oBACC,kBAAA,CAAmB,QAAA,EAAU,CAAC,GAAA,qBAC5B,IAAA,CAAAA,UAAA,EACG,QAAA,EAAA;AAAA,MAAA,GAAA;AAAA,MACA;AAAA,KAAA,EACH,CACD,CAAA,mBAED,IAAA,CAAAA,QAAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,GAAA;AAAA,MACA;AAAA,KAAA,EACH,CAAA,EAEJ;AAAA;AAEJ;AAOO,IAAM,QAAA,GAAW,MAAA,CAAO,MAAA,CAAO,iBAAA,EAAmB;AAAA,EACvD,IAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA,EAAU,WAAA;AAAA,EACV,OAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAC","file":"chunk-QNKD2SQM.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { CircleCheck, RotateCw } from \"lucide-react\"\nimport {\n createContext,\n Fragment,\n type ReactNode,\n type Ref,\n useContext,\n useId,\n useState,\n} from \"react\"\nimport { match } from \"ts-pattern\"\nimport { composeChildren, type NoAsChild, withAsChildContent } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { FILE_KIND_ICONS } from \"../../lib/file-kind-icons\"\nimport { type FileKind, fileKind, formatFileSize } from \"../../lib/files\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useLocale, useTimeZone } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES, TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\nimport { useObjectUrl } from \"../../lib/use-object-url\"\nimport { Button, type ButtonProps } from \"../button/button\"\nimport { Image } from \"../image/image\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { Progress, type ProgressProps } from \"../progress/progress\"\n\n/**\n * FileItem — one file as a row: its icon or thumbnail, its name, a meta line\n * (size, date, upload status) and its actions.\n *\n * <FileItem file={pickedFile} onRemove={() => remove(pickedFile)} />\n * <FileItem file={{ name: \"contract.pdf\", size: 248_213, date: doc.signedAt }} actions={…} />\n *\n * The same row serves a `File` the visitor just picked and a document stored\n * on a server, described by `{ name, size?, type?, date?, src? }` (`src` is a\n * thumbnail or preview URL). `FileUpload` renders its list with it.\n *\n * Upload state comes in through `status` (`queued → uploading → processing →\n * done | error`) and `progress` (0–1), so a queue only has to feed them:\n * uploading shows a determinate bar named after the file, processing an\n * indeterminate one, an error its message and a Retry button. Screen readers\n * hear the start, the end and a failure through a polite status region,\n * never each progress tick. A row a queue drives (`itemProps`) stays quiet\n * instead (`announce={false}`), and `FileQueueSummary` speaks for the run.\n *\n * Sizes and dates follow the `IntlProvider` locale and time zone; every\n * string goes through `translations`, every icon through `icons`.\n */\n\nexport type FileItemStatus = \"idle\" | \"queued\" | \"uploading\" | \"processing\" | \"done\" | \"error\"\n\n/** A file that lives on a server: a stored document rather than a picked `File`. */\nexport type FileDescriptor = {\n name: string\n /** In bytes. */\n size?: number\n /** MIME type. Picks the icon, with the name's extension as the fallback. */\n type?: string\n /** When it was uploaded, signed, last changed: whatever the app's meta line means. A date-only\n * ISO string (`\"2026-10-01\"`) is UTC midnight, so it can read as the day before west of UTC;\n * pass a full timestamp or a `Date`. */\n date?: Date | string | number\n /** A thumbnail or preview URL, shown in place of the kind icon. */\n src?: string\n}\n\nexport type FileItemFile = File | FileDescriptor\n\nexport type FileItemIconSlot = FileKind | \"remove\" | \"retry\" | \"done\"\nexport type FileItemIcons = IconMap<FileItemIconSlot>\n\n/** The statuses the status region speaks up for. The others are steps in between. */\nexport type FileItemAnnouncedStatus = \"uploading\" | \"done\" | \"error\"\n\nexport type FileItemTranslations = {\n /** The remove button's accessible name. @default (name) => `Remove ${name}` */\n remove?: (name: string) => string\n /** The same button's name while the file is queued or in flight.\n * @default (name) => `Cancel upload of ${name}` */\n cancel?: (name: string) => string\n /** The retry button's text (it is described by the file name). @default \"Retry\" */\n retry?: string\n /** @default \"Queued\" */\n queued?: string\n /** The meta line and the indeterminate bar's value text. @default \"Processing…\" */\n processing?: string\n /** @default \"Uploaded\" */\n done?: string\n /** Shown for an error without an `error` message. @default \"Upload failed\" */\n failed?: string\n /** What the status region says on each announced transition. The `error` message, when\n * there is one, follows it. */\n announcement?: (status: FileItemAnnouncedStatus, name: string) => string\n}\n\nconst DEFAULT_TRANSLATIONS: Required<FileItemTranslations> = {\n remove: (name) => `Remove ${name}`,\n cancel: (name) => `Cancel upload of ${name}`,\n retry: \"Retry\",\n queued: \"Queued\",\n processing: \"Processing…\",\n done: \"Uploaded\",\n failed: \"Upload failed\",\n announcement: (status, name) =>\n match(status)\n .with(\"uploading\", () => `Uploading ${name}`)\n .with(\"done\", () => `${name} uploaded`)\n .with(\"error\", () => `${name} failed to upload`)\n .exhaustive(),\n}\n\n/** The default icons, one per kind plus the row's own buttons. */\nconst DEFAULT_ICONS: Record<FileItemIconSlot, ReactNode> = {\n ...FILE_KIND_ICONS,\n remove: <CloseIcon />,\n retry: <RotateCw aria-hidden className={iconStroke} />,\n done: <CircleCheck aria-hidden className={iconStroke} />,\n}\n\nconst ANNOUNCED = new Set<FileItemStatus>([\"uploading\", \"done\", \"error\"])\nconst isAnnounced = (status: FileItemStatus | undefined): status is FileItemAnnouncedStatus =>\n status !== undefined && ANNOUNCED.has(status)\n\n/** Statuses where the remove button stops the upload rather than dropping a finished file. */\nconst IN_FLIGHT = new Set<FileItemStatus>([\"queued\", \"uploading\", \"processing\"])\n\n/** Whether the × stops an upload (and calls `onCancel`) rather than dropping the file. For a\n * layout composed from the parts, which wires `Remove` itself. */\nexport const isInFlight = (status: FileItemStatus | undefined): boolean =>\n status !== undefined && IN_FLIGHT.has(status)\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\ntype Shared = {\n name: string\n kind: FileKind\n size?: number\n date?: Date\n src?: string\n /** The picked file itself, for an object-URL thumbnail. */\n blob?: File\n status?: FileItemStatus\n progress?: number\n error?: ReactNode\n disabled: boolean\n thumbnails: boolean\n nameId: string\n locale: string\n timeZone: string\n t: Required<FileItemTranslations>\n icons: Record<FileItemIconSlot, ReactNode>\n}\n\nconst SharedContext = createContext<Shared | null>(null)\n\nconst useShared = () => {\n const shared = useContext(SharedContext)\n if (!shared) throw new Error(\"FileItem parts must be rendered within <FileItem.Root>.\")\n return shared\n}\n\n/** A `File` and a descriptor, read the same way. */\ntype FileFacts = Omit<FileDescriptor, \"date\"> & { date?: Date; blob?: File }\n\n/** An unparseable `date` is dropped rather than shown as \"Invalid Date\". */\nconst toDate = (value: FileDescriptor[\"date\"]): Date | undefined => {\n const date = value === undefined ? undefined : new Date(value)\n return date && !Number.isNaN(date.getTime()) ? date : undefined\n}\n\nconst readFile = (file: FileItemFile): FileFacts =>\n file instanceof File\n ? { name: file.name, size: file.size, type: file.type, blob: file }\n : { name: file.name, size: file.size, type: file.type, src: file.src, date: toDate(file.date) }\n\n// ---------------------------------------------------------------------------\n// Parts\n// ---------------------------------------------------------------------------\n\nexport type FileItemRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** A picked `File`, or a stored document's `{ name, size?, type?, date?, src? }`. */\n file: FileItemFile\n /** Upload state. Pass it from the first render (`\"idle\"` or `\"queued\"`): the status\n * region exists only with a status, and announces changes, not its first value. */\n status?: FileItemStatus\n /** Upload progress from 0 to 1, read while `status` is `\"uploading\"`. Without it the bar\n * is indeterminate. */\n progress?: number\n /** Why the upload failed, shown and announced while `status` is `\"error\"`. */\n error?: ReactNode\n /** Keep a status region that announces this row's upload. Off for a row a queue drives:\n * `useFileQueue`'s `itemProps` pass `false`, and one `FileQueueSummary` speaks for every\n * row, so 400 rows don't announce 800 times. @default true */\n announce?: boolean\n /** Disables the row's own buttons (remove, retry). */\n disabled?: boolean\n /** Show image files and `src` as thumbnails. Off, every file shows its kind icon, and no\n * object URL is created. @default true */\n thumbnails?: boolean\n /** Replaces the default icons: one per `FileKind`, plus `remove`, `retry` and `done`. */\n icons?: FileItemIcons\n /** Overrides the row's strings. A partial override keeps the other defaults. */\n translations?: FileItemTranslations\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({\n file,\n status,\n progress,\n error,\n announce = true,\n disabled = false,\n thumbnails = true,\n icons,\n translations,\n asChild,\n children,\n className,\n testId,\n ...rest\n}: FileItemRootProps) => {\n const locale = useLocale()\n const timeZone = useTimeZone()\n const nameId = useId()\n const t = { ...DEFAULT_TRANSLATIONS, ...translations }\n const { type, ...facts } = readFile(file)\n const kind = fileKind(type, facts.name)\n\n // Only a change of status is announced, never the first one (a stored document mounting as\n // \"done\" is not news) and never a progress tick. State adjusted during render, React's own\n // pattern for \"remember the previous prop\", so the region's text lands in the same commit.\n const [seen, setSeen] = useState(status)\n const [announced, setAnnounced] = useState<FileItemAnnouncedStatus | null>(null)\n if (seen !== status) {\n setSeen(status)\n setAnnounced(isAnnounced(status) ? status : null)\n }\n\n const shared: Shared = {\n ...facts,\n kind,\n status,\n progress,\n error,\n disabled,\n thumbnails,\n nameId,\n locale,\n timeZone,\n t,\n icons: mergeIcons(DEFAULT_ICONS, icons),\n }\n\n const region = announce && status !== undefined && (\n // A sibling of the busy Body rather than inside it: assistive tech may hold back a live\n // region's changes while it sits in an `aria-busy` subtree.\n <span role=\"status\" className=\"sr-only\">\n {announced && t.announcement(announced, facts.name)}\n {announced === \"error\" && error != null && <> {error}</>}\n </span>\n )\n\n return (\n <SharedContext.Provider value={shared}>\n <ark.div\n data-kind={kind}\n {...props({ \"data-status\": status, \"data-testid\": testId })}\n asChild={asChild}\n className={cn(\n // `relative` contains the status region's sr-only box.\n \"relative flex items-center gap-1 rounded-input border p-2\",\n // The kit's hairline, the same as FileUpload's dropzone above its list.\n \"border-brand-900/20 dark:border-white/15\",\n // Figma's file-upload item: `Border/border-error-secondary`, Error/500 at 30%.\n \"data-[status=error]:border-red-500/30\",\n className,\n )}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n {region}\n </>\n ))}\n </ark.div>\n </SharedContext.Provider>\n )\n}\n\nexport type FileItemPreviewProps = NoAsChild<HTMLArkProps<\"div\">> & WithTestId\n\n/** The kind icon, or the thumbnail: `src`, or an image `File` through an object URL. Lazy, and\n * decorative (the name sits next to it), so it is hidden from assistive tech. */\nconst Preview = ({ className, testId, asChild: _asChild, ...rest }: FileItemPreviewProps) => {\n const { kind, src, blob, thumbnails, icons } = useShared()\n const pictured = thumbnails && (src !== undefined || (blob !== undefined && kind === \"image\"))\n // `null` when no thumbnail is wanted, so a list with thumbnails off makes no object URLs.\n const objectUrl = useObjectUrl(pictured && src === undefined ? blob : null)\n return (\n <ark.div\n aria-hidden\n data-part=\"preview\"\n {...props({ \"data-testid\": testId })}\n className={cn(\"flex size-9 shrink-0 items-center justify-center [&>svg]:size-6\", className)}\n {...rest}\n >\n {pictured ? (\n <Image src={src ?? objectUrl} alt=\"\" fallback={icons[kind]} className=\"size-9\" />\n ) : (\n icons[kind]\n )}\n </ark.div>\n )\n}\n\nexport type FileItemBodyProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** The name, meta and progress column. Busy while the file uploads or is processed. */\nconst Body = ({ className, testId, ...rest }: FileItemBodyProps) => {\n const { status } = useShared()\n return (\n <ark.div\n {...props({\n \"aria-busy\": status === \"uploading\" || status === \"processing\",\n \"data-testid\": testId,\n })}\n // `relative` anchors the progress bar, which sits in the row's bottom padding.\n className={cn(\"relative min-w-0 flex-1\", className)}\n {...rest}\n />\n )\n}\n\nexport type FileItemNameProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** The file name, on one line. The full name stays in the text (truncation is CSS only) and in\n * a `title`. `asChild` turns it into your link: `<FileItem.Name asChild><a href={url}>{name}</a></…>`\n * (an empty link would fall back to the name, but linters rightly flag one). */\nconst Name = ({ asChild, children, className, testId, ...rest }: FileItemNameProps) => {\n const { name, nameId } = useShared()\n return (\n <ark.div\n title={name}\n {...props({ \"data-testid\": testId })}\n asChild={asChild}\n className={cn(\"block truncate text-sm\", className)}\n {...rest}\n // Last, so a composing part's own id (Ark's item name) can't detach the bar and buttons\n // that are named and described by it.\n id={nameId}\n >\n {composeChildren(asChild, children, (own) => own ?? name)}\n </ark.div>\n )\n}\n\nexport type FileItemMetaProps = NoAsChild<HTMLArkProps<\"div\">> & WithTestId\n\n/** The dot is hidden, the spaces aren't: screen readers get \"248 kB Queued\", not \"248 kBQueued\". */\nconst Separator = () => (\n <>\n {\" \"}\n <span aria-hidden>·</span>{\" \"}\n </>\n)\n\n/**\n * The size and date, then the status. `children` replace the size and date and keep the\n * status; an error replaces the whole line with its message.\n */\nconst Meta = ({ children, className, testId, asChild: _asChild, ...rest }: FileItemMetaProps) => {\n const { size, date, status, progress, error, locale, timeZone, t, icons } = useShared()\n const details =\n children === undefined\n ? [\n size === undefined ? null : formatFileSize(size, locale),\n date === undefined\n ? null\n : new Intl.DateTimeFormat(locale, { dateStyle: \"medium\", timeZone }).format(date),\n ]\n : [children]\n const state = match(status)\n .with(\"queued\", () => t.queued)\n .with(\"uploading\", () =>\n progress === undefined\n ? null\n : new Intl.NumberFormat(locale, { style: \"percent\", maximumFractionDigits: 0 }).format(\n Math.min(Math.max(progress, 0), 1),\n ),\n )\n .with(\"processing\", () => t.processing)\n .with(\"done\", () => (\n <span\n data-color=\"green\"\n className=\"inline-flex items-center gap-1 align-bottom text-(--c-text) [&_svg]:size-3.5\"\n >\n {icons.done}\n {t.done}\n </span>\n ))\n .otherwise(() => null)\n const segments = [...details, state].filter((segment) => segment != null && segment !== \"\")\n\n return (\n <ark.div\n data-part=\"meta\"\n {...props({ \"data-testid\": testId })}\n className={cn(\"truncate text-xs\", TYPOGRAPHY_SHADE_CLASSES.muted, className)}\n {...rest}\n >\n {status === \"error\" ? (\n <span className={TEXT_COLOR_CLASSES.error}>{error ?? t.failed}</span>\n ) : (\n segments.map((segment, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed sequence, rebuilt per render\n <Fragment key={index}>\n {index > 0 && <Separator />}\n <span>{segment}</span>\n </Fragment>\n ))\n )}\n </ark.div>\n )\n}\n\nexport type FileItemProgressProps = Omit<ProgressProps, \"value\" | \"defaultValue\" | \"onChange\">\n\n/** The upload bar: determinate while uploading with a `progress`, indeterminate otherwise and\n * while processing, absent in every other status. Named after the file. It sits under the\n * name and meta, out of flow, so the row doesn't change height. */\nconst ProgressBar = ({ className, ...rest }: FileItemProgressProps) => {\n const { status, progress, nameId, t } = useShared()\n if (status !== \"uploading\" && status !== \"processing\") return null\n const determinate = status === \"uploading\" && progress !== undefined\n return (\n <Progress\n size=\"xs\"\n value={determinate ? Math.min(Math.max(progress, 0), 1) * 100 : null}\n aria-labelledby={nameId}\n aria-valuetext={status === \"processing\" ? t.processing : undefined}\n // Out of flow, in the row's bottom padding under the text: a row keeps its height as its\n // upload starts and ends, so a list of uploads doesn't jump.\n className={cn(\"absolute inset-x-0 -bottom-1\", className)}\n {...rest}\n />\n )\n}\n\nexport type FileItemActionsProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** Your buttons for the file: download, view, open in a tab. */\nconst Actions = ({ className, testId, ...rest }: FileItemActionsProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n className={cn(\"ms-1 flex shrink-0 items-center gap-2\", className)}\n {...rest}\n />\n)\n\nexport type FileItemRemoveProps = HTMLArkProps<\"button\"> & WithTestId\n\n/** The × button, named \"Remove {name}\", or \"Cancel upload of {name}\" while the file is queued\n * or in flight. Wire `onClick`; a composing trigger's own name (Ark's) wins over the default. */\nconst Remove = ({\n asChild,\n children,\n className,\n testId,\n disabled,\n ...rest\n}: FileItemRemoveProps) => {\n const { name, status, disabled: rowDisabled, t, icons } = useShared()\n const label = isInFlight(status) ? t.cancel(name) : t.remove(name)\n return (\n <ark.button\n type=\"button\"\n aria-label={label}\n disabled={disabled ?? rowDisabled}\n {...props({ \"data-testid\": testId })}\n asChild={asChild}\n className={cn(\n \"inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm me-1\",\n // The neutral washes rows and options use for hover (`popoverOption`, Table):\n // translucent, so the button reads on whatever the row sits on.\n TYPOGRAPHY_SHADE_CLASSES.muted,\n \"transition-colors hover:bg-black/5 hover:text-black dark:hover:bg-white/8 dark:hover:text-white\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n focusStyles(),\n \"[&_svg]:size-3.5\",\n className,\n )}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => own ?? icons.remove)}\n </ark.button>\n )\n}\n\nexport type FileItemRetryProps = ButtonProps\n\n/** A small \"Retry\" button, described by the file name (\"Retry, cv.pdf\"). Wire `onClick`. */\nconst Retry = ({ children, disabled, ...rest }: FileItemRetryProps) => {\n const { nameId, disabled: rowDisabled, t, icons } = useShared()\n return (\n <Button\n type=\"button\"\n size=\"xs\"\n variant=\"subtle\"\n color=\"neutral\"\n startSlot={icons.retry}\n aria-describedby={nameId}\n disabled={disabled ?? rowDisabled}\n {...rest}\n >\n {children ?? t.retry}\n </Button>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Convenience\n// ---------------------------------------------------------------------------\n\ntype FileItemClassNames = {\n root?: string\n preview?: string\n body?: string\n name?: string\n meta?: string\n progress?: string\n actions?: string\n retry?: string\n remove?: string\n}\n\nexport type FileItemProps = FileItemRootProps & {\n /** Replaces the size and date on the meta line; the status still follows. */\n meta?: ReactNode\n /** Your buttons (download, view…), before the retry and remove buttons. */\n actions?: ReactNode\n /** Renders the × button. While the file is queued or in flight it is named as a cancel, and\n * calls `onCancel` when there is one. */\n onRemove?: () => void\n /** What the × does while the file is queued or in flight: stop the upload. Falls back to\n * `onRemove`; on its own, the × shows only while there is an upload to stop. */\n onCancel?: () => void\n /** Renders a Retry button while `status` is `\"error\"`. */\n onRetry?: () => void\n classNames?: FileItemClassNames\n}\n\nfunction FileItemComponent({\n meta,\n actions,\n onRemove,\n onCancel,\n onRetry,\n classNames,\n className,\n asChild,\n children,\n ...root\n}: FileItemProps) {\n const dismiss = isInFlight(root.status) ? (onCancel ?? onRemove) : onRemove\n const row = (\n <>\n <Preview className={classNames?.preview} />\n <Body className={classNames?.body}>\n <Name className={classNames?.name} />\n <Meta className={classNames?.meta}>{meta}</Meta>\n <ProgressBar className={classNames?.progress} />\n </Body>\n {actions != null && <Actions className={classNames?.actions}>{actions}</Actions>}\n {onRetry && root.status === \"error\" && (\n <Retry onClick={onRetry} className={classNames?.retry} />\n )}\n {dismiss && <Remove onClick={dismiss} className={classNames?.remove} />}\n </>\n )\n return (\n // Under `asChild` the row becomes your element (an `<li>` in your list), with the row\n // folded in ahead of that element's own content.\n <Root {...root} asChild={asChild} className={cn(className, classNames?.root)}>\n {asChild ? (\n withAsChildContent(children, (own) => (\n <>\n {row}\n {own}\n </>\n ))\n ) : (\n <>\n {row}\n {children}\n </>\n )}\n </Root>\n )\n}\n\n/**\n * `FileItem` — the ready-made row, with the parts attached for your own layout:\n * `Root` (the file, status and context), `Preview`, `Body`, `Name`, `Meta`, `Progress`,\n * `Actions`, `Retry` and `Remove`.\n */\nexport const FileItem = Object.assign(FileItemComponent, {\n Root,\n Preview,\n Body,\n Name,\n Meta,\n Progress: ProgressBar,\n Actions,\n Retry,\n Remove,\n})\n"]}
1
+ {"version":3,"sources":["../src/components/file-item/file-item.tsx"],"names":["Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;AAmGA,IAAM,oBAAA,GAAuD;AAAA,EAC3D,MAAA,EAAQ,CAAC,IAAA,KAAS,CAAA,OAAA,EAAU,IAAI,CAAA,CAAA;AAAA,EAChC,MAAA,EAAQ,CAAC,IAAA,KAAS,CAAA,iBAAA,EAAoB,IAAI,CAAA,CAAA;AAAA,EAC1C,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,UAAA,EAAY,kBAAA;AAAA,EACZ,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ,eAAA;AAAA,EACR,YAAA,EAAc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B,IAAA,CAAAA,UAAA,EACG,QAAA,EAAA;AAAA,MAAA,GAAA;AAAA,MACA;AAAA,KAAA,EACH,CACD,CAAA,mBAED,IAAA,CAAAA,QAAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,GAAA;AAAA,MACA;AAAA,KAAA,EACH,CAAA,EAEJ;AAAA;AAEJ;AAOO,IAAM,QAAA,GAAW,MAAA,CAAO,MAAA,CAAO,iBAAA,EAAmB;AAAA,EACvD,IAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA,EAAU,WAAA;AAAA,EACV,OAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAC","file":"chunk-X3YIHN2U.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { CircleCheck, RotateCw } from \"lucide-react\"\nimport {\n createContext,\n Fragment,\n type ReactNode,\n type Ref,\n useContext,\n useId,\n useState,\n} from \"react\"\nimport { match } from \"ts-pattern\"\nimport { composeChildren, type NoAsChild, withAsChildContent } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { FILE_KIND_ICONS } from \"../../lib/file-kind-icons\"\nimport { type FileKind, fileKind, formatFileSize } from \"../../lib/files\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useLocale, useTimeZone } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES, TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\nimport { useObjectUrl } from \"../../lib/use-object-url\"\nimport { Button, type ButtonProps } from \"../button/button\"\nimport { Image } from \"../image/image\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { Progress, type ProgressProps } from \"../progress/progress\"\n\n/**\n * FileItem — one file as a row: its icon or thumbnail, its name, a meta line\n * (size, date, upload status) and its actions.\n *\n * <FileItem file={pickedFile} onRemove={() => remove(pickedFile)} />\n * <FileItem file={{ name: \"contract.pdf\", size: 248_213, date: doc.signedAt }} actions={…} />\n *\n * The same row serves a `File` the visitor just picked and a document stored\n * on a server, described by `{ name, size?, type?, date?, src? }` (`src` is a\n * thumbnail or preview URL). `FileUpload` renders its list with it.\n *\n * Upload state comes in through `status` (`queued → uploading → processing →\n * done | error`) and `progress` (0–1), so a queue only has to feed them:\n * uploading shows a determinate bar named after the file, processing an\n * indeterminate one, an error its message and a Retry button. Screen readers\n * hear the start, the end and a failure through a polite status region,\n * never each progress tick. A row a queue drives (`itemProps`) stays quiet\n * instead (`announce={false}`), and `FileQueueSummary` speaks for the run.\n *\n * Sizes and dates follow the `IntlProvider` locale and time zone; every\n * string goes through `translations`, every icon through `icons`.\n */\n\nexport type FileItemStatus = \"idle\" | \"queued\" | \"uploading\" | \"processing\" | \"done\" | \"error\"\n\n/** A file that lives on a server: a stored document rather than a picked `File`. */\nexport type FileDescriptor = {\n name: string\n /** In bytes. */\n size?: number\n /** MIME type. Picks the icon, with the name's extension as the fallback. */\n type?: string\n /** When it was uploaded, signed, last changed: whatever the app's meta line means. A date-only\n * ISO string (`\"2026-10-01\"`) is UTC midnight, so it can read as the day before west of UTC;\n * pass a full timestamp or a `Date`. */\n date?: Date | string | number\n /** A thumbnail or preview URL, shown in place of the kind icon. */\n src?: string\n}\n\nexport type FileItemFile = File | FileDescriptor\n\nexport type FileItemIconSlot = FileKind | \"remove\" | \"retry\" | \"done\"\nexport type FileItemIcons = IconMap<FileItemIconSlot>\n\n/** The statuses the status region speaks up for. The others are steps in between. */\nexport type FileItemAnnouncedStatus = \"uploading\" | \"done\" | \"error\"\n\nexport type FileItemTranslations = {\n /** The remove button's accessible name. @default (name) => `Remove ${name}` */\n remove?: (name: string) => string\n /** The same button's name while the file is queued or in flight.\n * @default (name) => `Cancel upload of ${name}` */\n cancel?: (name: string) => string\n /** The retry button's text (it is described by the file name). @default \"Retry\" */\n retry?: string\n /** @default \"Queued\" */\n queued?: string\n /** The meta line and the indeterminate bar's value text. @default \"Processing…\" */\n processing?: string\n /** @default \"Uploaded\" */\n done?: string\n /** Shown for an error without an `error` message. @default \"Upload failed\" */\n failed?: string\n /** What the status region says on each announced transition. The `error` message, when\n * there is one, follows it. */\n announcement?: (status: FileItemAnnouncedStatus, name: string) => string\n}\n\nconst DEFAULT_TRANSLATIONS: Required<FileItemTranslations> = {\n remove: (name) => `Remove ${name}`,\n cancel: (name) => `Cancel upload of ${name}`,\n retry: \"Retry\",\n queued: \"Queued\",\n processing: \"Processing…\",\n done: \"Uploaded\",\n failed: \"Upload failed\",\n announcement: (status, name) =>\n match(status)\n .with(\"uploading\", () => `Uploading ${name}`)\n .with(\"done\", () => `${name} uploaded`)\n .with(\"error\", () => `${name} failed to upload`)\n .exhaustive(),\n}\n\n/** The default icons, one per kind plus the row's own buttons. */\nconst DEFAULT_ICONS: Record<FileItemIconSlot, ReactNode> = {\n ...FILE_KIND_ICONS,\n remove: <CloseIcon />,\n retry: <RotateCw aria-hidden className={iconStroke} />,\n done: <CircleCheck aria-hidden className={iconStroke} />,\n}\n\nconst ANNOUNCED = new Set<FileItemStatus>([\"uploading\", \"done\", \"error\"])\nconst isAnnounced = (status: FileItemStatus | undefined): status is FileItemAnnouncedStatus =>\n status !== undefined && ANNOUNCED.has(status)\n\n/** Statuses where the remove button stops the upload rather than dropping a finished file. */\nconst IN_FLIGHT = new Set<FileItemStatus>([\"queued\", \"uploading\", \"processing\"])\n\n/** Whether the × stops an upload (and calls `onCancel`) rather than dropping the file. For a\n * layout composed from the parts, which wires `Remove` itself. */\nexport const isInFlight = (status: FileItemStatus | undefined): boolean =>\n status !== undefined && IN_FLIGHT.has(status)\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\ntype Shared = {\n name: string\n kind: FileKind\n size?: number\n date?: Date\n src?: string\n /** The picked file itself, for an object-URL thumbnail. */\n blob?: File\n status?: FileItemStatus\n progress?: number\n error?: ReactNode\n disabled: boolean\n thumbnails: boolean\n nameId: string\n locale: string\n timeZone: string\n t: Required<FileItemTranslations>\n icons: Record<FileItemIconSlot, ReactNode>\n}\n\nconst SharedContext = createContext<Shared | null>(null)\n\nconst useShared = () => {\n const shared = useContext(SharedContext)\n if (!shared) throw new Error(\"FileItem parts must be rendered within <FileItem.Root>.\")\n return shared\n}\n\n/** A `File` and a descriptor, read the same way. */\ntype FileFacts = Omit<FileDescriptor, \"date\"> & { date?: Date; blob?: File }\n\n/** An unparseable `date` is dropped rather than shown as \"Invalid Date\". */\nconst toDate = (value: FileDescriptor[\"date\"]): Date | undefined => {\n const date = value === undefined ? undefined : new Date(value)\n return date && !Number.isNaN(date.getTime()) ? date : undefined\n}\n\nconst readFile = (file: FileItemFile): FileFacts =>\n file instanceof File\n ? { name: file.name, size: file.size, type: file.type, blob: file }\n : { name: file.name, size: file.size, type: file.type, src: file.src, date: toDate(file.date) }\n\n// ---------------------------------------------------------------------------\n// Parts\n// ---------------------------------------------------------------------------\n\nexport type FileItemRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** A picked `File`, or a stored document's `{ name, size?, type?, date?, src? }`. */\n file: FileItemFile\n /** Upload state. Pass it from the first render (`\"idle\"` or `\"queued\"`): the status\n * region exists only with a status, and announces changes, not its first value. */\n status?: FileItemStatus\n /** Upload progress from 0 to 1, read while `status` is `\"uploading\"`. Without it the bar\n * is indeterminate. */\n progress?: number\n /** Why the upload failed, shown and announced while `status` is `\"error\"`. */\n error?: ReactNode\n /** Keep a status region that announces this row's upload. Off for a row a queue drives:\n * `useFileQueue`'s `itemProps` pass `false`, and one `FileQueueSummary` speaks for every\n * row, so 400 rows don't announce 800 times. @default true */\n announce?: boolean\n /** Disables the row's own buttons (remove, retry). */\n disabled?: boolean\n /** Show image files and `src` as thumbnails. Off, every file shows its kind icon, and no\n * object URL is created. @default true */\n thumbnails?: boolean\n /** Replaces the default icons: one per `FileKind`, plus `remove`, `retry` and `done`. */\n icons?: FileItemIcons\n /** Overrides the row's strings. A partial override keeps the other defaults. */\n translations?: FileItemTranslations\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({\n file,\n status,\n progress,\n error,\n announce = true,\n disabled = false,\n thumbnails = true,\n icons,\n translations,\n asChild,\n children,\n className,\n testId,\n ...rest\n}: FileItemRootProps) => {\n const locale = useLocale()\n const timeZone = useTimeZone()\n const nameId = useId()\n const t = { ...DEFAULT_TRANSLATIONS, ...translations }\n const { type, ...facts } = readFile(file)\n const kind = fileKind(type, facts.name)\n\n // Only a change of status is announced, never the first one (a stored document mounting as\n // \"done\" is not news) and never a progress tick. State adjusted during render, React's own\n // pattern for \"remember the previous prop\", so the region's text lands in the same commit.\n const [seen, setSeen] = useState(status)\n const [announced, setAnnounced] = useState<FileItemAnnouncedStatus | null>(null)\n if (seen !== status) {\n setSeen(status)\n setAnnounced(isAnnounced(status) ? status : null)\n }\n\n const shared: Shared = {\n ...facts,\n kind,\n status,\n progress,\n error,\n disabled,\n thumbnails,\n nameId,\n locale,\n timeZone,\n t,\n icons: mergeIcons(DEFAULT_ICONS, icons),\n }\n\n const region = announce && status !== undefined && (\n // A sibling of the busy Body rather than inside it: assistive tech may hold back a live\n // region's changes while it sits in an `aria-busy` subtree.\n <span role=\"status\" className=\"sr-only\">\n {announced && t.announcement(announced, facts.name)}\n {announced === \"error\" && error != null && <> {error}</>}\n </span>\n )\n\n return (\n <SharedContext.Provider value={shared}>\n <ark.div\n data-kind={kind}\n {...props({ \"data-status\": status, \"data-testid\": testId })}\n asChild={asChild}\n className={cn(\n // `relative` contains the status region's sr-only box.\n \"relative flex items-center gap-1 rounded-input border p-2\",\n // The kit's hairline, the same as FileUpload's dropzone above its list.\n \"border-brand-900/20 dark:border-white/15\",\n // Figma's file-upload item: `Border/border-error-secondary`, Error/500 at 30%.\n \"data-[status=error]:border-red-500/30\",\n className,\n )}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n {region}\n </>\n ))}\n </ark.div>\n </SharedContext.Provider>\n )\n}\n\nexport type FileItemPreviewProps = NoAsChild<HTMLArkProps<\"div\">> & WithTestId\n\n/** The kind icon, or the thumbnail: `src`, or an image `File` through an object URL. Lazy, and\n * decorative (the name sits next to it), so it is hidden from assistive tech. */\nconst Preview = ({ className, testId, asChild: _asChild, ...rest }: FileItemPreviewProps) => {\n const { kind, src, blob, thumbnails, icons } = useShared()\n const pictured = thumbnails && (src !== undefined || (blob !== undefined && kind === \"image\"))\n // `null` when no thumbnail is wanted, so a list with thumbnails off makes no object URLs.\n const objectUrl = useObjectUrl(pictured && src === undefined ? blob : null)\n return (\n <ark.div\n aria-hidden\n data-part=\"preview\"\n {...props({ \"data-testid\": testId })}\n className={cn(\"flex size-9 shrink-0 items-center justify-center [&>svg]:size-6\", className)}\n {...rest}\n >\n {pictured ? (\n <Image src={src ?? objectUrl} alt=\"\" fallback={icons[kind]} className=\"size-9\" />\n ) : (\n icons[kind]\n )}\n </ark.div>\n )\n}\n\nexport type FileItemBodyProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** The name, meta and progress column. Busy while the file uploads or is processed. */\nconst Body = ({ className, testId, ...rest }: FileItemBodyProps) => {\n const { status } = useShared()\n return (\n <ark.div\n {...props({\n \"aria-busy\": status === \"uploading\" || status === \"processing\",\n \"data-testid\": testId,\n })}\n // `relative` anchors the progress bar, which sits in the row's bottom padding.\n className={cn(\"relative min-w-0 flex-1\", className)}\n {...rest}\n />\n )\n}\n\nexport type FileItemNameProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** The file name, on one line. The full name stays in the text (truncation is CSS only) and in\n * a `title`. `asChild` turns it into your link: `<FileItem.Name asChild><a href={url}>{name}</a></…>`\n * (an empty link would fall back to the name, but linters rightly flag one). */\nconst Name = ({ asChild, children, className, testId, ...rest }: FileItemNameProps) => {\n const { name, nameId } = useShared()\n return (\n <ark.div\n title={name}\n {...props({ \"data-testid\": testId })}\n asChild={asChild}\n className={cn(\"block truncate text-sm\", className)}\n {...rest}\n // Last, so a composing part's own id (Ark's item name) can't detach the bar and buttons\n // that are named and described by it.\n id={nameId}\n >\n {composeChildren(asChild, children, (own) => own ?? name)}\n </ark.div>\n )\n}\n\nexport type FileItemMetaProps = NoAsChild<HTMLArkProps<\"div\">> & WithTestId\n\n/** The dot is hidden, the spaces aren't: screen readers get \"248 kB Queued\", not \"248 kBQueued\". */\nconst Separator = () => (\n <>\n {\" \"}\n <span aria-hidden>·</span>{\" \"}\n </>\n)\n\n/**\n * The size and date, then the status. `children` replace the size and date and keep the\n * status; an error replaces the whole line with its message.\n */\nconst Meta = ({ children, className, testId, asChild: _asChild, ...rest }: FileItemMetaProps) => {\n const { size, date, status, progress, error, locale, timeZone, t, icons } = useShared()\n const details =\n children === undefined\n ? [\n size === undefined ? null : formatFileSize(size, locale),\n date === undefined\n ? null\n : new Intl.DateTimeFormat(locale, { dateStyle: \"medium\", timeZone }).format(date),\n ]\n : [children]\n const state = match(status)\n .with(\"queued\", () => t.queued)\n .with(\"uploading\", () =>\n progress === undefined\n ? null\n : new Intl.NumberFormat(locale, { style: \"percent\", maximumFractionDigits: 0 }).format(\n Math.min(Math.max(progress, 0), 1),\n ),\n )\n .with(\"processing\", () => t.processing)\n .with(\"done\", () => (\n <span\n data-color=\"green\"\n className=\"inline-flex items-center gap-1 align-bottom text-(--c-text) [&_svg]:size-3.5\"\n >\n {icons.done}\n {t.done}\n </span>\n ))\n .otherwise(() => null)\n const segments = [...details, state].filter((segment) => segment != null && segment !== \"\")\n\n return (\n <ark.div\n data-part=\"meta\"\n {...props({ \"data-testid\": testId })}\n className={cn(\"truncate text-xs\", TYPOGRAPHY_SHADE_CLASSES.muted, className)}\n {...rest}\n >\n {status === \"error\" ? (\n <span className={TEXT_COLOR_CLASSES.error}>{error ?? t.failed}</span>\n ) : (\n segments.map((segment, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed sequence, rebuilt per render\n <Fragment key={index}>\n {index > 0 && <Separator />}\n <span>{segment}</span>\n </Fragment>\n ))\n )}\n </ark.div>\n )\n}\n\nexport type FileItemProgressProps = Omit<ProgressProps, \"value\" | \"defaultValue\" | \"onChange\">\n\n/** The upload bar: determinate while uploading with a `progress`, indeterminate otherwise and\n * while processing, absent in every other status. Named after the file. It sits under the\n * name and meta, out of flow, so the row doesn't change height. */\nconst ProgressBar = ({ className, ...rest }: FileItemProgressProps) => {\n const { status, progress, nameId, t } = useShared()\n if (status !== \"uploading\" && status !== \"processing\") return null\n const determinate = status === \"uploading\" && progress !== undefined\n return (\n <Progress\n size=\"xs\"\n value={determinate ? Math.min(Math.max(progress, 0), 1) * 100 : null}\n aria-labelledby={nameId}\n aria-valuetext={status === \"processing\" ? t.processing : undefined}\n // Out of flow, in the row's bottom padding under the text: a row keeps its height as its\n // upload starts and ends, so a list of uploads doesn't jump.\n className={cn(\"absolute inset-x-0 -bottom-1\", className)}\n {...rest}\n />\n )\n}\n\nexport type FileItemActionsProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** Your buttons for the file: download, view, open in a tab. */\nconst Actions = ({ className, testId, ...rest }: FileItemActionsProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n className={cn(\"ms-1 flex shrink-0 items-center gap-2\", className)}\n {...rest}\n />\n)\n\nexport type FileItemRemoveProps = HTMLArkProps<\"button\"> & WithTestId\n\n/** The × button, named \"Remove {name}\", or \"Cancel upload of {name}\" while the file is queued\n * or in flight. Wire `onClick`; a composing trigger's own name (Ark's) wins over the default. */\nconst Remove = ({\n asChild,\n children,\n className,\n testId,\n disabled,\n ...rest\n}: FileItemRemoveProps) => {\n const { name, status, disabled: rowDisabled, t, icons } = useShared()\n const label = isInFlight(status) ? t.cancel(name) : t.remove(name)\n return (\n <ark.button\n type=\"button\"\n aria-label={label}\n disabled={disabled ?? rowDisabled}\n {...props({ \"data-testid\": testId })}\n asChild={asChild}\n className={cn(\n \"inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm me-1\",\n // The neutral washes rows and options use for hover (`popoverOption`, Table):\n // translucent, so the button reads on whatever the row sits on.\n TYPOGRAPHY_SHADE_CLASSES.muted,\n \"transition-colors hover:bg-black/5 hover:text-black dark:hover:bg-white/8 dark:hover:text-white\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n focusStyles(),\n \"[&_svg]:size-3.5\",\n className,\n )}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => own ?? icons.remove)}\n </ark.button>\n )\n}\n\nexport type FileItemRetryProps = ButtonProps\n\n/** A small \"Retry\" button, described by the file name (\"Retry, cv.pdf\"). Wire `onClick`. */\nconst Retry = ({ children, disabled, ...rest }: FileItemRetryProps) => {\n const { nameId, disabled: rowDisabled, t, icons } = useShared()\n return (\n <Button\n type=\"button\"\n size=\"xs\"\n variant=\"subtle\"\n color=\"neutral\"\n startSlot={icons.retry}\n aria-describedby={nameId}\n disabled={disabled ?? rowDisabled}\n {...rest}\n >\n {children ?? t.retry}\n </Button>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Convenience\n// ---------------------------------------------------------------------------\n\ntype FileItemClassNames = {\n root?: string\n preview?: string\n body?: string\n name?: string\n meta?: string\n progress?: string\n actions?: string\n retry?: string\n remove?: string\n}\n\nexport type FileItemProps = FileItemRootProps & {\n /** Replaces the size and date on the meta line; the status still follows. */\n meta?: ReactNode\n /** Your buttons (download, view…), before the retry and remove buttons. */\n actions?: ReactNode\n /** Renders the × button. While the file is queued or in flight it is named as a cancel, and\n * calls `onCancel` when there is one. */\n onRemove?: () => void\n /** What the × does while the file is queued or in flight: stop the upload. Falls back to\n * `onRemove`; on its own, the × shows only while there is an upload to stop. */\n onCancel?: () => void\n /** Renders a Retry button while `status` is `\"error\"`. */\n onRetry?: () => void\n classNames?: FileItemClassNames\n}\n\nfunction FileItemComponent({\n meta,\n actions,\n onRemove,\n onCancel,\n onRetry,\n classNames,\n className,\n asChild,\n children,\n ...root\n}: FileItemProps) {\n const dismiss = isInFlight(root.status) ? (onCancel ?? onRemove) : onRemove\n const row = (\n <>\n <Preview className={classNames?.preview} />\n <Body className={classNames?.body}>\n <Name className={classNames?.name} />\n <Meta className={classNames?.meta}>{meta}</Meta>\n <ProgressBar className={classNames?.progress} />\n </Body>\n {actions != null && <Actions className={classNames?.actions}>{actions}</Actions>}\n {onRetry && root.status === \"error\" && (\n <Retry onClick={onRetry} className={classNames?.retry} />\n )}\n {dismiss && <Remove onClick={dismiss} className={classNames?.remove} />}\n </>\n )\n return (\n // Under `asChild` the row becomes your element (an `<li>` in your list), with the row\n // folded in ahead of that element's own content.\n <Root {...root} asChild={asChild} className={cn(className, classNames?.root)}>\n {asChild ? (\n withAsChildContent(children, (own) => (\n <>\n {row}\n {own}\n </>\n ))\n ) : (\n <>\n {row}\n {children}\n </>\n )}\n </Root>\n )\n}\n\n/**\n * `FileItem` — the ready-made row, with the parts attached for your own layout:\n * `Root` (the file, status and context), `Preview`, `Body`, `Name`, `Meta`, `Progress`,\n * `Actions`, `Retry` and `Remove`.\n */\nexport const FileItem = Object.assign(FileItemComponent, {\n Root,\n Preview,\n Body,\n Name,\n Meta,\n Progress: ProgressBar,\n Actions,\n Retry,\n Remove,\n})\n"]}
@@ -12,6 +12,15 @@ var fieldRoot = cva("relative flex w-full flex-col", {
12
12
  },
13
13
  defaultVariants: { size: "md" }
14
14
  });
15
+ var fieldInlineStack = cva(
16
+ "relative inline-grid grid-cols-[auto_1fr] items-center gap-x-2 select-none",
17
+ {
18
+ variants: {
19
+ size: { xs: "gap-y-1", sm: "gap-y-1", md: "gap-y-1.5", lg: "gap-y-1.5", xl: "gap-y-2" }
20
+ },
21
+ defaultVariants: { size: "md" }
22
+ }
23
+ );
15
24
  var fieldLabel = cva(
16
25
  [
17
26
  "inline-flex items-center font-medium select-none text-trim",
@@ -155,6 +164,6 @@ var Field = ({
155
164
  );
156
165
  };
157
166
 
158
- export { Field, FieldShell, fieldA11yProps, fieldLabel, fieldRoot, requiredMark };
159
- //# sourceMappingURL=chunk-VD6PB3VA.js.map
160
- //# sourceMappingURL=chunk-VD6PB3VA.js.map
167
+ export { Field, FieldShell, fieldA11yProps, fieldInlineStack, fieldLabel, requiredMark };
168
+ //# sourceMappingURL=chunk-X6DESK37.js.map
169
+ //# sourceMappingURL=chunk-X6DESK37.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/field/field.tsx"],"names":["Ark"],"mappings":";;;;;;;;AAsCO,IAAM,SAAA,GAAY,IAAI,+BAAA,EAAiC;AAAA,EAC5D,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,EAAA,EAAI,OAAA,EAAS,EAAA,EAAI,OAAA,EAAS,EAAA,EAAI,SAAA,EAAW,EAAA,EAAI,SAAA,EAAW,EAAA,EAAI,OAAA;AAAQ,GAC9E;AAAA,EACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAC3B,CAAC,CAAA;AAMM,IAAM,gBAAA,GAAmB,GAAA;AAAA,EAC9B,4EAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,EAAE,EAAA,EAAI,SAAA,EAAW,EAAA,EAAI,SAAA,EAAW,EAAA,EAAI,WAAA,EAAa,EAAA,EAAI,WAAA,EAAa,EAAA,EAAI,SAAA;AAAU,KACxF;AAAA,IACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAAK;AAElC;AAEO,IAAM,UAAA,GAAa,GAAA;AAAA,EACxB;AAAA,IACE,4DAAA;AAAA,IACA,kBAAA,CAAmB,SAAA;AAAA,IACnB;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,SAAA;AAAA,QACJ,EAAA,EAAI,SAAA;AAAA,QACJ,EAAA,EAAI,SAAA;AAAA,QACJ,EAAA,EAAI,SAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACN,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AA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js","sourcesContent":["\"use client\"\n\nimport { ark } from \"@ark-ui/react/factory\"\nimport { Field as Ark, type UseFieldContext, useFieldContext } from \"@ark-ui/react/field\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES, TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * Field — label / description / error scaffold for any form control, on top of\n * Ark UI's `Field`. It is the *one* place the family wires accessible names and\n * descriptions: drop a field-aware control inside (the kit's `Input`, `Select`,\n * `Combobox`, … all qualify) and Ark hands it the right `id`,\n * `aria-describedby`, `aria-invalid`, `disabled`, and `required` through\n * context — no manual plumbing per control.\n *\n * - `label` renders a `<label>` bound to the control (click-to-focus).\n * - `description` (helper text) sits between the label and the control.\n * `error` sits below the control and renders independently of it — both\n * can be visible at once. Passing `error` flips the field to `invalid`,\n * which both styles field-aware controls red and associates the message.\n * - `required` adds the semantic flag and a red asterisk in the label.\n * - `size` scales only the field's own typography; set the control's `size`\n * separately (the family components forward both).\n *\n * Every other prop (incl. `disabled`, `readOnly`, `id`) forwards to Ark's\n * `Field.Root`. `asChild` is a compile error: the field renders its label,\n * helper and error rows around the control, which can't live inside one\n * element.\n */\n\n// `relative` contains a `sr-only` label (and any hidden input rendered inside\n// the field): absolutely positioned with no offsets, it would otherwise be laid\n// out against the page and escape any scroller the field sits in.\nexport const fieldRoot = cva(\"relative flex w-full flex-col\", {\n variants: {\n size: { xs: \"gap-1\", sm: \"gap-1\", md: \"gap-1.5\", lg: \"gap-1.5\", xl: \"gap-2\" },\n },\n defaultVariants: { size: \"md\" },\n})\n\n// Root of an inline control (Switch, Checkbox) whose label carries a\n// description or error: a two-column grid, so the control centers on the\n// label's row alone instead of on the whole text stack, and the field (placed\n// with `col-start-2`) hangs under the label. The row gap follows `fieldRoot`'s.\nexport const fieldInlineStack = cva(\n \"relative inline-grid grid-cols-[auto_1fr] items-center gap-x-2 select-none\",\n {\n variants: {\n size: { xs: \"gap-y-1\", sm: \"gap-y-1\", md: \"gap-y-1.5\", lg: \"gap-y-1.5\", xl: \"gap-y-2\" },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nexport const fieldLabel = cva(\n [\n \"inline-flex items-center font-medium select-none text-trim\",\n TEXT_COLOR_CLASSES.secondary,\n \"data-disabled:opacity-60\",\n ],\n {\n variants: {\n size: {\n xs: \"text-xs\",\n sm: \"text-sm\",\n md: \"text-sm\",\n lg: \"text-md\",\n xl: \"text-lg\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst fieldHelp = cva(TYPOGRAPHY_SHADE_CLASSES.muted, {\n variants: {\n size: {\n xs: \"text-xs\",\n sm: \"text-xs\",\n md: \"text-xs\",\n lg: \"text-sm\",\n xl: \"text-sm\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\n/** Error text: Figma's `Text/text-error-primary`, a fixed pair whatever palette the field uses. */\nconst fieldError = cva(TEXT_COLOR_CLASSES.error, {\n variants: {\n size: {\n xs: \"text-xs\",\n sm: \"text-xs\",\n md: \"text-xs\",\n lg: \"text-sm\",\n xl: \"text-sm\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\nexport type FieldSize = NonNullable<VariantProps<typeof fieldRoot>[\"size\"]>\n\n/**\n * `aria-describedby` / `aria-errormessage` / `aria-labelledby` for a control nested\n * in a `Field`. Points `aria-describedby` at the error text id directly once\n * `invalid`, rather than trusting `field.ariaDescribedby`'s own DOM-presence-tracked\n * inclusion of it (a `MutationObserver` check that doesn't reliably catch up for\n * every control) — and adds `aria-errormessage`, which Ark's field getters never\n * emit for any control. `aria-labelledby` points at the id already rendered on\n * `Field`'s own `<label>`: needed because `NumberInput`, `PasswordInput`,\n * `TagsInput`, `Select`, and `SegmentGroup`'s real interactive element isn't\n * `Field`'s own `Ark.Input`, so it never otherwise carries an id matching the\n * label's `htmlFor`.\n */\n/**\n * The required \"*\" after a label, spread onto the mark's element. Figma binds it to\n * `Text/text-error-primary`, like the error text, so it is the same fixed pair. Shared by\n * `Field`, `Checkbox` and `Switch`, so the family draws one mark.\n */\nexport const requiredMark = { className: cn(\"ms-0.5\", TEXT_COLOR_CLASSES.error) } as const\n\nexport const fieldA11yProps = (field: UseFieldContext) => ({\n \"aria-describedby\": field?.invalid ? field.ids.errorText : field?.ariaDescribedby,\n \"aria-errormessage\": field?.invalid ? field.ids.errorText : undefined,\n \"aria-labelledby\": field?.ids.label,\n})\n\ntype FieldClassNames = {\n root?: string\n label?: string\n description?: string\n error?: string\n requiredIndicator?: string\n}\n\nexport type FieldProps = NoAsChild<Omit<ComponentPropsWithoutRef<typeof Ark.Root>, \"className\">> &\n VariantProps<typeof fieldRoot> &\n WithTestId & {\n /** Accessible name, rendered as a `<label>` bound to the control. */\n label?: ReactNode\n /** Helper text between the label and the control. */\n description?: ReactNode\n /** Error message below the control; its presence sets `invalid`. */\n error?: ReactNode\n /**\n * The control is a composite — a radio group, a row of inputs — with no single labelable\n * element for the `<label>` to point at. The label then renders as plain text with no `for`\n * (which would otherwise reference an id nothing carries) and names the control only through\n * the `aria-labelledby` that `fieldA11yProps` puts on it.\n */\n composite?: boolean\n /** Styles the field root (matching the kit's other components). */\n className?: string\n classNames?: FieldClassNames\n }\n\n/**\n * Wrap a control in a `Field` only when there's something to wire (label /\n * description / error / required) — otherwise render it bare. The data-driven\n * pickers all end with this, so it lives here instead of five copies. Bare is\n * important: an empty `Field` would still make Ark controls reference a label\n * that isn't rendered.\n */\nexport const FieldShell = ({\n label,\n description,\n error,\n required,\n disabled,\n size,\n className,\n classNames,\n testId,\n composite,\n children,\n}: Pick<\n FieldProps,\n | \"label\"\n | \"description\"\n | \"error\"\n | \"required\"\n | \"disabled\"\n | \"size\"\n | \"className\"\n | \"classNames\"\n | \"testId\"\n | \"composite\"\n> & { children: ReactNode }) => {\n const hasField = label != null || description != null || error != null || Boolean(required)\n if (!hasField) return children\n return (\n <Field\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={className}\n classNames={classNames}\n testId={testId}\n composite={composite}\n >\n {children}\n </Field>\n )\n}\n\n/**\n * `Ark.Label`'s props on a `<span>`, minus its `for`: Ark always binds the label to\n * `field.ids.control`, an id only `Ark.Input` (or a machine reading it, like `NumberInput`'s) ever\n * renders. A composite control has no such element, so the binding would dangle — and a `<label>`\n * with nothing to label is no better. Its name comes from `aria-labelledby` pointing at this\n * span's id instead. Ark's `mergeProps` ignores an `undefined` override, so `htmlFor` has to be\n * left out rather than unset on `Ark.Label`.\n */\nconst CompositeLabel = (labelProps: ComponentPropsWithoutRef<\"span\">) => {\n const { htmlFor: _htmlFor, ...fieldLabelProps } = useFieldContext().getLabelProps()\n return <ark.span {...fieldLabelProps} {...labelProps} />\n}\n\nexport const Field = ({\n label,\n description,\n error,\n required,\n invalid,\n size,\n children,\n className,\n classNames,\n testId,\n composite,\n asChild: _asChild,\n ...rest\n}: FieldProps) => {\n const isInvalid = invalid ?? error != null\n const Label = composite ? CompositeLabel : Ark.Label\n\n return (\n <Ark.Root\n required={required}\n invalid={isInvalid}\n className={cn(fieldRoot({ size }), className, classNames?.root)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {label != null && (\n <Label className={cn(fieldLabel({ size }), classNames?.label)}>\n {label}\n {required && (\n <Ark.RequiredIndicator\n className={cn(requiredMark.className, classNames?.requiredIndicator)}\n >\n *\n </Ark.RequiredIndicator>\n )}\n </Label>\n )}\n\n {description != null && (\n <Ark.HelperText\n className={cn(fieldHelp({ size }), classNames?.description)}\n {...props({ \"data-testid\": testId && `${testId}-description` })}\n >\n {description}\n </Ark.HelperText>\n )}\n\n {children}\n\n {error != null && (\n <Ark.ErrorText\n className={cn(fieldError({ size }), classNames?.error)}\n {...props({ \"data-testid\": testId && `${testId}-error` })}\n >\n {error}\n </Ark.ErrorText>\n )}\n </Ark.Root>\n )\n}\n"]}
@@ -1,11 +1,11 @@
1
- import { Slider } from './chunk-UAYENYS2.js';
1
+ import { Slider } from './chunk-AKXALCUN.js';
2
2
  import { cutoutMask } from './chunk-K6YASO4L.js';
3
3
  import { MEDIA_RADIUS } from './chunk-J43LSYQO.js';
4
- import { useObjectUrl } from './chunk-TCFB23JT.js';
4
+ import { useObjectUrl } from './chunk-WERJ44ZN.js';
5
5
  import { useMergedRefs } from './chunk-HBWV5EPU.js';
6
6
  import { ratioToNumber } from './chunk-AHM6SGEU.js';
7
- import { useLocale, useDirectionCheck } from './chunk-IPYHTCFL.js';
8
- import { ActionIcon } from './chunk-BE2LWUHY.js';
7
+ import { useLocale, useDirectionCheck } from './chunk-IUK7OJXZ.js';
8
+ import { ActionIcon } from './chunk-BMEJBY6H.js';
9
9
  import { iconStroke, mergeIcons } from './chunk-XXOR34T4.js';
10
10
  import { props } from './chunk-WYCMIIRR.js';
11
11
  import { focusStyles } from './chunk-C6NVU4F7.js';
@@ -433,5 +433,5 @@ var ImageCropper = Object.assign(ImageCropperComponent, {
433
433
  });
434
434
 
435
435
  export { ImageCropper, useImageCropperContext };
436
- //# sourceMappingURL=chunk-47LEAR6G.js.map
437
- //# sourceMappingURL=chunk-47LEAR6G.js.map
436
+ //# sourceMappingURL=chunk-Y2G47ARQ.js.map
437
+ //# sourceMappingURL=chunk-Y2G47ARQ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/image-cropper/image-cropper.tsx"],"names":["shape","Ark","useArkImageCropperContext"],"mappings":";;;;;;;;;;;;;;;;;;;AA+GO,IAAM,oBAAA,GAA2D;AAAA,EACtE,KAAA,EAAO,eAAA;AAAA,EACP,eAAA,EAAiB,eAAA;AAAA,EACjB,OAAA,EAAS,mBAAA;AAAA,EACT,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,UAAU,CAAA,EAAG,CAAA,EAAG,OAAO,MAAA,EAAO,KAC9C,QAAQ,I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,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,oBAAA;AAAA,EACV,KAAA,EAAO,iBAAA;AAAA,EACP,SAAA,EAAW,qBAAA;AAAA,EACX,MAAA,EAAQ,kBAAA;AAAA,EACR,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,oBAAA;AAAA,EACV,OAAA,EAAS;AACX,CAAC","file":"chunk-47LEAR6G.js","sourcesContent":["\"use client\"\n\nimport {\n ImageCropper as Ark,\n type ImageCropperRootProps as ArkRootProps,\n type ImageCropperCropChangeDetails,\n type ImageCropperFlipState,\n type ImageCropperHandlePosition,\n type UseImageCropperContext,\n useImageCropperContext as useArkImageCropperContext,\n} from \"@ark-ui/react/image-cropper\"\nimport {\n FlipHorizontal2,\n FlipVertical2,\n RefreshCcw,\n RotateCcw,\n RotateCw,\n ZoomIn,\n ZoomOut,\n} from \"lucide-react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n type Ref,\n useContext,\n useMemo,\n} from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { cutoutMask } from \"../../lib/cutout\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useDirectionCheck, useLocale } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport { MEDIA_RADIUS, type MediaRadius } from \"../../lib/radius\"\nimport { type Ratio, ratioToNumber } from \"../../lib/ratio\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\nimport { useObjectUrl } from \"../../lib/use-object-url\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\nimport { Slider } from \"../slider/slider\"\n\n/**\n * ImageCropper — pick the part of an image to keep: drag the selection, pull\n * its handles, pinch or wheel to zoom, rotate and flip, then export the crop.\n *\n * <ImageCropper src={file} ratio={1} shape=\"circle\" withControls>\n * <ImageCropper.Context>\n * {(api) => <Button onClick={() => api.getCroppedImage().then(upload)}>Save</Button>}\n * </ImageCropper.Context>\n * </ImageCropper>\n *\n * Built on Ark's image cropper (a \"preview\" component in Ark 5.39, see the\n * docs page), which owns the geometry, the gestures, the keyboard and the\n * canvas export. The kit adds the look (an outside dim, handles that survive\n * forced colors), the controls, `src` as a `Blob`, `ratio` in the media\n * components' shape, flattened callbacks and translations with\n * locale-formatted numbers.\n *\n * The result is read from `ImageCropper.Context`, not an imperative ref:\n * `getCroppedImage()` draws the crop to a canvas and resolves a `Blob` (or a\n * data URL), `getCropData()` returns the crop in the image's own pixels for a\n * server to cut.\n */\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type ImageCropperShape = \"rectangle\" | \"circle\"\nexport type ImageCropperFlip = ImageCropperFlipState\n/** A crop rectangle, in px of the viewport. */\nexport type ImageCropperRect = ImageCropperCropChangeDetails[\"crop\"]\nexport type { ImageCropperHandlePosition }\n\n/** A crop rectangle with every number already formatted for the locale. */\nexport type ImageCropperFormattedRect = { x: string; y: string; width: string; height: string }\n\nexport type ImageCropperTranslations = {\n /** The cropper's accessible name. */\n label?: string\n /** What kind of thing the cropper is, announced with its name. */\n roleDescription?: string\n /** The cropper's description while the image loads. */\n loading?: string\n /** The cropper's description once the image is ready. `zoom` is a percent, `rotation` in degrees. */\n preview?: (details: ImageCropperFormattedRect & { zoom: string; rotation: string }) => string\n /** The selection's accessible name. */\n selectionLabel?: (shape: ImageCropperShape) => string\n /** What kind of thing the selection is. Ark's default is the APG \"2d slider\". */\n selectionRoleDescription?: string\n /** How to move it from the keyboard, read as the selection's description. */\n selectionInstructions?: string\n /** The selection's `aria-valuetext`: where it is and how big. */\n selectionValue?: (details: ImageCropperFormattedRect & { shape: ImageCropperShape }) => string\n /** Names the group of controls. */\n controlsLabel?: string\n zoomLabel?: string\n /** The zoom slider's `aria-valuetext`. `percent` is formatted (`\"150%\"`). */\n zoomValue?: (percent: string) => string\n rotateLeftLabel?: string\n rotateRightLabel?: string\n flipHorizontalLabel?: string\n flipVerticalLabel?: string\n resetLabel?: string\n}\n\nexport const DEFAULT_TRANSLATIONS: Required<ImageCropperTranslations> = {\n label: \"Image cropper\",\n roleDescription: \"image cropper\",\n loading: \"Loading the image\",\n preview: ({ zoom, rotation, x, y, width, height }) =>\n `Zoom ${zoom}, rotated ${rotation}. Crop at ${x}px from the left and ${y}px from the top, ${width}px by ${height}px.`,\n selectionLabel: (shape) => `Crop selection (${shape})`,\n selectionRoleDescription: \"2d slider\",\n selectionInstructions:\n \"Use the arrow keys to move the crop. Hold Alt with the arrow keys to resize it. Press plus or minus to zoom.\",\n selectionValue: ({ shape, x, y, width, height }) =>\n match(shape)\n .with(\"circle\", () => `Position X ${x}px, Y ${y}px. Diameter ${width}px.`)\n .with(\"rectangle\", () => `Position X ${x}px, Y ${y}px. Size ${width}px by ${height}px.`)\n .exhaustive(),\n controlsLabel: \"Crop controls\",\n zoomLabel: \"Zoom\",\n zoomValue: (percent) => percent,\n rotateLeftLabel: \"Rotate left\",\n rotateRightLabel: \"Rotate right\",\n flipHorizontalLabel: \"Flip horizontally\",\n flipVerticalLabel: \"Flip vertically\",\n resetLabel: \"Reset\",\n}\n\ntype ArkTranslations = NonNullable<ArkRootProps[\"translations\"]>\n\n/** What the Root shares with the parts Ark's context doesn't cover. */\nexport type ImageCropperIconSlot =\n | \"rotateLeft\"\n | \"rotateRight\"\n | \"flipHorizontal\"\n | \"flipVertical\"\n | \"zoomOut\"\n | \"zoomIn\"\n | \"reset\"\nexport type ImageCropperIcons = IconMap<ImageCropperIconSlot>\n\n/**\n * The default icons of `ImageCropper.Controls`, named like the\n * `translations` labels of the buttons they sit in. None of them points along\n * the inline axis (a rotation turns the same way in either direction, and the\n * zoom glyphs sit at the slider's start and end), so none mirrors under RTL.\n */\nexport const DEFAULT_ICONS: Record<ImageCropperIconSlot, ReactNode> = {\n rotateLeft: <RotateCcw className={iconStroke} />,\n rotateRight: <RotateCw className={iconStroke} />,\n flipHorizontal: <FlipHorizontal2 className={iconStroke} />,\n flipVertical: <FlipVertical2 className={iconStroke} />,\n zoomOut: <ZoomOut className={iconStroke} />,\n zoomIn: <ZoomIn className={iconStroke} />,\n reset: <RefreshCcw className={iconStroke} />,\n}\n\ntype Shared = {\n t: Required<ImageCropperTranslations>\n icons: Record<ImageCropperIconSlot, ReactNode>\n percent: (value: number) => string\n minZoom: number\n maxZoom: number\n shape: ImageCropperShape\n /** The locked width / height (1 for a circle), which the export holds to the pixel. */\n aspect: number | undefined\n}\n\nconst SharedContext = createContext<Shared>({\n t: DEFAULT_TRANSLATIONS,\n icons: DEFAULT_ICONS,\n percent: String,\n minZoom: 1,\n maxZoom: 5,\n shape: \"rectangle\",\n aspect: undefined,\n})\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\n/**\n * Each handle's hit box and visible mark, by position. Ark already places the\n * handle on the selection's edge (`top`/`left`/`right`/`bottom`, centered\n * with `translate`, edges at 96% of the side); this sizes the hit box and\n * shapes the mark, an `::after` centered in it, so the handle stays a bare\n * element any `asChild` child can become.\n *\n * The mark is the Slider thumb: a palette border on the page-tinted fill.\n * Corners are round thumbs, edges are pills along their side. The hit box is\n * 24px under a mouse and 44px (WCAG 2.5.8) under a finger, around the same\n * small mark.\n *\n * Physical sides, not logical ones: the crop is a rectangle in the image's own\n * space, where `e` is the image's right edge whatever the text direction, and\n * Ark positions the handles that way too.\n *\n * Corners sit above the edge bars (`z-1`), which overlap them at 96% of the\n * side, so a press near a corner resizes both ways. On a circle only the four\n * edge pills show: they're the points that touch it.\n */\nconst HANDLE: Record<ImageCropperHandlePosition, string> = {\n nw: \"z-1 size-6 pointer-coarse:size-11 after:size-3.5 in-data-[shape=circle]:after:hidden\",\n ne: \"z-1 size-6 pointer-coarse:size-11 after:size-3.5 in-data-[shape=circle]:after:hidden\",\n se: \"z-1 size-6 pointer-coarse:size-11 after:size-3.5 in-data-[shape=circle]:after:hidden\",\n sw: \"z-1 size-6 pointer-coarse:size-11 after:size-3.5 in-data-[shape=circle]:after:hidden\",\n n: \"h-6 pointer-coarse:h-11 after:h-2 after:w-6\",\n s: \"h-6 pointer-coarse:h-11 after:h-2 after:w-6\",\n e: \"w-6 pointer-coarse:w-11 after:h-6 after:w-2\",\n w: \"w-6 pointer-coarse:w-11 after:h-6 after:w-2\",\n}\n\n/** A ≥ 44px control (WCAG 2.5.8). */\nconst control = \"h-11 [&_svg]:size-5\"\n/** The zoom slider's end glyphs: decorative, the slider carries the name. */\nconst zoomIcon = \"flex shrink-0 [&_svg]:size-4\"\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport type ImageCropperRootProps = Omit<\n ArkRootProps,\n | \"aspectRatio\"\n | \"cropShape\"\n | \"translations\"\n | \"onZoomChange\"\n | \"onRotationChange\"\n | \"onFlipChange\"\n | \"onCropChange\"\n> &\n WithTestId & {\n /** Locks the selection to this width / height. Free when unset; a circle is always 1. */\n ratio?: Ratio\n /** A circle crop still exports a square: mask it where you show it. */\n shape?: ImageCropperShape\n /** Fires as the zoom changes, from 1 (fit) up. */\n onZoomChange?: (zoom: number) => void\n /** Fires as the rotation changes, in degrees. */\n onRotationChange?: (rotation: number) => void\n onFlipChange?: (flip: ImageCropperFlip) => void\n /** Fires as the selection moves or resizes, in px of the viewport. */\n onCropChange?: (crop: ImageCropperRect) => void\n translations?: ImageCropperTranslations\n /** Replaces the control icons: `rotateLeft`, `rotateRight`, `flipHorizontal`,\n * `flipVertical`, `zoomOut`, `zoomIn`, `reset`. Drawn as given, never restroked. */\n icons?: ImageCropperIcons\n /**\n * The palette of the selection's edge, handles, focus ring and zoom slider.\n * `brand` by default: on a photo, the kit's black-and-white default palette\n * would read as plain chrome rather than as a control.\n */\n color?: Color\n ref?: Ref<HTMLDivElement>\n }\n\n/** `\"16/9\"` → `1.777…`, and nothing for a ratio that can't lock a selection. */\nconst aspectRatioOf = (ratio: Ratio | undefined) => {\n const value = ratio === undefined ? Number.NaN : ratioToNumber(ratio)\n return Number.isFinite(value) && value > 0 ? value : undefined\n}\n\nconst ImageCropperRoot = ({\n ratio,\n shape,\n onZoomChange,\n onRotationChange,\n onFlipChange,\n onCropChange,\n translations,\n icons,\n minZoom = 1,\n maxZoom = 5,\n color = \"brand\",\n className,\n testId,\n ref,\n ...rest\n}: ImageCropperRootProps) => {\n const locale = useLocale()\n const direction = useDirectionCheck()\n\n const [shared, arkTranslations] = useMemo(() => {\n const t = { ...DEFAULT_TRANSLATIONS, ...translations }\n const pixels = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 })\n const percent = new Intl.NumberFormat(locale, { style: \"percent\", maximumFractionDigits: 0 })\n const degrees = new Intl.NumberFormat(locale, {\n style: \"unit\",\n unit: \"degree\",\n maximumFractionDigits: 0,\n })\n const rect = ({ x, y, width, height }: ImageCropperRect): ImageCropperFormattedRect => ({\n x: pixels.format(x),\n y: pixels.format(y),\n width: pixels.format(width),\n height: pixels.format(height),\n })\n const ark: ArkTranslations = {\n rootLabel: t.label,\n rootRoleDescription: t.roleDescription,\n previewLoading: t.loading,\n previewDescription: ({ crop, zoom, rotation }) =>\n t.preview({\n ...rect(crop),\n zoom: percent.format(zoom ?? 1),\n rotation: degrees.format(rotation ?? 0),\n }),\n selectionLabel: ({ shape }) => t.selectionLabel(shape),\n selectionRoleDescription: t.selectionRoleDescription,\n selectionInstructions: t.selectionInstructions,\n selectionValueText: ({ shape, ...crop }) => t.selectionValue({ shape, ...rect(crop) }),\n }\n const value: Shared = {\n t,\n icons: mergeIcons(DEFAULT_ICONS, icons),\n percent: (n) => percent.format(n),\n minZoom,\n maxZoom,\n shape: shape ?? \"rectangle\",\n aspect: shape === \"circle\" ? 1 : aspectRatioOf(ratio),\n }\n return [value, ark] as const\n }, [translations, icons, locale, minZoom, maxZoom, shape, ratio])\n\n const rootRef = useMergedRefs(ref, direction)\n return (\n <SharedContext value={shared}>\n <Ark.Root\n ref={rootRef}\n aspectRatio={aspectRatioOf(ratio)}\n cropShape={shape}\n minZoom={minZoom}\n maxZoom={maxZoom}\n translations={arkTranslations}\n onZoomChange={onZoomChange && (({ zoom }) => onZoomChange(zoom))}\n onRotationChange={onRotationChange && (({ rotation }) => onRotationChange(rotation))}\n onFlipChange={onFlipChange && (({ flip }) => onFlipChange(flip))}\n onCropChange={onCropChange && (({ crop }) => onCropChange(crop))}\n data-color={color}\n className={cn(\"flex w-full flex-col gap-3\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n </SharedContext>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Parts\n// ---------------------------------------------------------------------------\n\nexport type ImageCropperViewportProps = Ark.ViewportProps &\n WithTestId & {\n /** Corner radius, from the media scale. */\n radius?: MediaRadius\n }\n\n/** The frame the image is cropped in. Takes the pan, wheel and pinch gestures. */\nconst ImageCropperViewport = ({\n radius = \"xs\",\n className,\n testId,\n ...rest\n}: ImageCropperViewportProps) => (\n <Ark.Viewport\n className={cn(\n \"relative touch-none select-none overflow-clip bg-black/80\",\n MEDIA_RADIUS[radius],\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ImageCropperImageProps = NoAsChild<\n Omit<Ark.ImageProps, \"src\"> &\n WithTestId & {\n /** A URL, or a `Blob` / `File`, shown through an object URL that's revoked when it changes. */\n src: string | Blob\n }\n>\n\n/**\n * The image being cropped. Decorative to assistive technology: the cropper's\n * own description says what's selected. Fades in once Ark has measured it.\n *\n * A cross-origin URL needs `crossOrigin=\"anonymous\"` (and CORS headers on the\n * server) for `getCroppedImage()`; without them the canvas is tainted and the\n * export resolves `null`.\n */\nconst ImageCropperImage = ({\n src,\n className,\n testId,\n asChild: _asChild,\n ...rest\n}: ImageCropperImageProps) => {\n const url = useObjectUrl(src)\n return (\n <Ark.Image\n src={url}\n className={cn(\n \"block h-auto w-full max-w-none opacity-0 data-ready:opacity-100\",\n \"transition-opacity duration-(--duration-normal) ease-standard motion-reduce:transition-none\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type ImageCropperSelectionProps = NoAsChild<\n Ark.SelectionProps &\n WithTestId & {\n /** Rule-of-thirds lines inside the selection, shown while it's dragged or resized. */\n withGrid?: boolean\n }\n>\n\n/** The selection's hole in the dim: Ark sets the crop rectangle as custom properties on the root. */\nconst CROP_RECT = {\n x: \"var(--crop-x)\",\n y: \"var(--crop-y)\",\n width: \"var(--crop-width)\",\n height: \"var(--crop-height)\",\n}\n\n/**\n * The crop area: a `role=\"slider\"` that moves with the arrow keys, resizes\n * with Alt + arrows and zooms with `+`/`-`.\n *\n * Everything outside it is dimmed like a Modal backdrop by an overlay drawn\n * just before it, with the selection cut out of it (`lib/cutout.ts`): a real\n * rectangle or circle, following the crop through Ark's `--crop-*` custom\n * properties without a render. The overlay steps aside in forced colors,\n * where it would paint `Canvas` over the image; the edge and the handles,\n * borders both, are repainted instead.\n */\nconst ImageCropperSelection = ({\n withGrid = true,\n className,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: ImageCropperSelectionProps) => {\n const { shape } = useContext(SharedContext)\n return (\n <>\n <div\n aria-hidden\n data-part=\"overlay\"\n data-shape={shape}\n // The Modal backdrop's dim, with a light blur: the frame stays legible\n // around the crop without competing with it.\n className=\"pointer-events-none absolute inset-0 bg-black/50 backdrop-blur-xs forced-colors:hidden\"\n style={cutoutMask(shape, CROP_RECT)}\n />\n <Ark.Selection\n className={cn(\n \"cursor-move border border-(--c-solid) data-[shape=circle]:rounded-full\",\n // A pale halo around the 1px palette edge: two tones, so it holds on a dark photo and a bright one.\n \"shadow-[0_0_0_1px_rgb(255_255_255/0.45)]\",\n \"data-disabled:cursor-default\",\n // Inset and gap-less: the selection can sit flush with the clipping viewport.\n focusStyles({ ring: \"palette\", offset: false, inset: true }),\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {withGrid && (\n <>\n <ImageCropperGrid axis=\"horizontal\" />\n <ImageCropperGrid axis=\"vertical\" />\n </>\n )}\n {Ark.handles.map((position) => (\n <ImageCropperHandle key={position} position={position} />\n ))}\n {children}\n </Ark.Selection>\n </>\n )\n}\n\nexport type ImageCropperHandleProps = Ark.HandleProps & WithTestId\n\n/** One resize handle. `Selection` renders all eight; use it when you compose your own. */\nconst ImageCropperHandle = ({ position, className, testId, ...rest }: ImageCropperHandleProps) => (\n <Ark.Handle\n position={position}\n className={cn(\n \"after:absolute after:top-1/2 after:left-1/2 after:-translate-1/2 after:rounded-full\",\n \"after:border-2 after:border-(--c-solid) after:bg-brand-50 after:shadow-sm dark:after:bg-brand-950\",\n // Grows a touch while held, like the Slider thumb.\n \"after:transition-[scale] after:duration-(--duration-fast) after:ease-standard motion-reduce:after:transition-none\",\n \"in-data-dragging:after:scale-110\",\n \"data-disabled:hidden\",\n HANDLE[position],\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ImageCropperGridProps = Ark.GridProps & WithTestId\n\n/** A pair of rule-of-thirds lines, along `axis`. Fades in while the crop is dragged, resized or panned. */\nconst ImageCropperGrid = ({ className, testId, ...rest }: ImageCropperGridProps) => (\n <Ark.Grid\n className={cn(\n \"border-white/50 data-[axis=horizontal]:border-y data-[axis=vertical]:border-x\",\n \"opacity-0 data-dragging:opacity-100 data-panning:opacity-100\",\n \"transition-opacity duration-(--duration-fast) ease-standard motion-reduce:transition-none\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ImageCropperControlsProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/**\n * Zoom slider, rotate ±90°, flip and reset, wired to the nearest cropper. Each\n * is a 44px button named from `translations`; the flips are toggle buttons.\n */\nconst ImageCropperControls = ({ className, testId, ...rest }: ImageCropperControlsProps) => {\n const api = useImageCropperContext()\n const { t, icons, percent, minZoom, maxZoom } = useContext(SharedContext)\n return (\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={t.controlsLabel}\n className={cn(\"flex flex-wrap items-center gap-1\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.rotateLeftLabel}\n onClick={() => api.rotateBy(-90)}\n >\n {icons.rotateLeft}\n </ActionIcon>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.rotateRightLabel}\n onClick={() => api.rotateBy(90)}\n >\n {icons.rotateRight}\n </ActionIcon>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.flipHorizontalLabel}\n aria-pressed={api.flip.horizontal}\n onClick={() => api.flipHorizontally()}\n >\n {icons.flipHorizontal}\n </ActionIcon>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.flipVerticalLabel}\n aria-pressed={api.flip.vertical}\n onClick={() => api.flipVertically()}\n >\n {icons.flipVertical}\n </ActionIcon>\n <div\n className={cn(\n \"flex min-w-40 flex-1 items-center gap-2 px-2\",\n TYPOGRAPHY_SHADE_CLASSES.muted,\n )}\n >\n <span aria-hidden className={zoomIcon}>\n {icons.zoomOut}\n </span>\n <Slider\n min={minZoom}\n max={maxZoom}\n step={0.01}\n value={api.zoom}\n onChange={(zoom) => api.setZoom(zoom)}\n aria-label={[t.zoomLabel]}\n getAriaValueText={({ value }) => t.zoomValue(percent(value))}\n classNames={{ field: \"flex-1\" }}\n />\n <span aria-hidden className={zoomIcon}>\n {icons.zoomIn}\n </span>\n </div>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.resetLabel}\n onClick={() => api.reset()}\n >\n {icons.reset}\n </ActionIcon>\n </div>\n )\n}\n\ntype CropExport = UseImageCropperContext[\"getCroppedImage\"]\n\n/** The size a `width × height` export should have at `aspect`: its short side stretched to match the long one. */\nconst exactSize = (width: number, height: number, aspect: number) =>\n width / height > aspect\n ? { width, height: Math.round(width / aspect) }\n : { width: Math.round(height * aspect), height }\n\n/**\n * Ark's export, held to a locked ratio. Ark sizes the canvas from the image's\n * rounded layout box, scaling each side on its own, so a 1:1 crop can come\n * out 511 × 512. When it does, the crop is exported again losslessly and\n * redrawn at the exact size, then encoded once as asked.\n */\nexport const exactExport =\n (getCroppedImage: CropExport, aspect: number | undefined): CropExport =>\n async (options) => {\n const blob = await getCroppedImage(options)\n if (aspect === undefined || !(blob instanceof Blob) || typeof createImageBitmap !== \"function\")\n return blob\n const shot = await createImageBitmap(blob)\n // Read the size before `close()`: a closed bitmap reports 0 × 0.\n const { width, height } = shot\n shot.close()\n const size = exactSize(width, height, aspect)\n if (size.width === width && size.height === height) return blob\n const lossless = await getCroppedImage({ ...options, type: \"image/png\" })\n if (!(lossless instanceof Blob)) return blob\n const source = await createImageBitmap(lossless)\n const canvas = document.createElement(\"canvas\")\n canvas.width = size.width\n canvas.height = size.height\n const context = canvas.getContext(\"2d\")\n if (!context) return blob\n context.drawImage(source, 0, 0, size.width, size.height)\n source.close()\n return new Promise<Blob | null>((resolve) =>\n canvas.toBlob(resolve, options?.type ?? \"image/png\", options?.quality ?? 1),\n )\n }\n\n/**\n * The nearest cropper's API: Ark's, with `getCroppedImage()` held to the\n * locked ratio (or the circle) to the pixel.\n */\nconst useImageCropperContext = (): UseImageCropperContext => {\n const api = useArkImageCropperContext()\n const { aspect } = useContext(SharedContext)\n return { ...api, getCroppedImage: exactExport(api.getCroppedImage, aspect) }\n}\n\nexport type ImageCropperContextProps = Ark.ContextProps\n\n/** Renders its child function with the cropper's API, for an export button. */\nconst ImageCropperContext = ({ children }: ImageCropperContextProps) =>\n children(useImageCropperContext())\n\n// ---------------------------------------------------------------------------\n// Convenience\n// ---------------------------------------------------------------------------\n\nexport type ImageCropperClassNames = {\n viewport?: string\n image?: string\n selection?: string\n controls?: string\n}\n\nexport type ImageCropperProps = NoAsChild<\n Omit<ImageCropperRootProps, \"children\"> & {\n /** The image to crop: a URL, or a `Blob` / `File` (a pick or a drop). */\n src: string | Blob\n /** Needed on a cross-origin URL for the export to read its pixels. */\n crossOrigin?: ImageCropperImageProps[\"crossOrigin\"]\n /** The viewport's corner radius, from the media scale. */\n radius?: MediaRadius\n /** Rule-of-thirds lines inside the selection, shown while it's dragged or resized. */\n withGrid?: boolean\n /** The zoom slider and the rotate, flip and reset buttons, under the image. */\n withControls?: boolean\n classNames?: ImageCropperClassNames\n /** Rendered last, inside the root: an `ImageCropper.Context` for the export. */\n children?: ReactNode\n }\n>\n\nconst ImageCropperComponent = ({\n src,\n crossOrigin,\n radius,\n withGrid,\n withControls = false,\n classNames,\n children,\n asChild: _asChild,\n ...rest\n}: ImageCropperProps) => (\n <ImageCropperRoot {...rest}>\n <ImageCropperViewport radius={radius} className={classNames?.viewport}>\n <ImageCropperImage src={src} crossOrigin={crossOrigin} className={classNames?.image} />\n <ImageCropperSelection withGrid={withGrid} className={classNames?.selection} />\n </ImageCropperViewport>\n {withControls && <ImageCropperControls className={classNames?.controls} />}\n {children}\n </ImageCropperRoot>\n)\n\nexport const ImageCropper = Object.assign(ImageCropperComponent, {\n Root: ImageCropperRoot,\n Viewport: ImageCropperViewport,\n Image: ImageCropperImage,\n Selection: ImageCropperSelection,\n Handle: ImageCropperHandle,\n Grid: ImageCropperGrid,\n Controls: ImageCropperControls,\n Context: ImageCropperContext,\n})\n\nexport { useImageCropperContext }\n"]}
1
+ {"version":3,"sources":["../src/components/image-cropper/image-cropper.tsx"],"names":["shape","Ark","useArkImageCropperContext"],"mappings":";;;;;;;;;;;;;;;;;;;AA+GO,IAAM,oBAAA,GAA2D;AAAA,EACtE,KAAA,EAAO,eAAA;AAAA,EACP,eAAA,EAAiB,eAAA;AAAA,EACjB,OAAA,EAAS,mBAAA;AAAA,EACT,OAAA,EAAS,CA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EACH,CAAA;AAGK,IAAM,YAAA,GAAe,MAAA,CAAO,MAAA,CAAO,qBAAA,EAAuB;AAAA,EAC/D,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,oBAAA;AAAA,EACV,KAAA,EAAO,iBAAA;AAAA,EACP,SAAA,EAAW,qBAAA;AAAA,EACX,MAAA,EAAQ,kBAAA;AAAA,EACR,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,oBAAA;AAAA,EACV,OAAA,EAAS;AACX,CAAC","file":"chunk-Y2G47ARQ.js","sourcesContent":["\"use client\"\n\nimport {\n ImageCropper as Ark,\n type ImageCropperRootProps as ArkRootProps,\n type ImageCropperCropChangeDetails,\n type ImageCropperFlipState,\n type ImageCropperHandlePosition,\n type UseImageCropperContext,\n useImageCropperContext as useArkImageCropperContext,\n} from \"@ark-ui/react/image-cropper\"\nimport {\n FlipHorizontal2,\n FlipVertical2,\n RefreshCcw,\n RotateCcw,\n RotateCw,\n ZoomIn,\n ZoomOut,\n} from \"lucide-react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n type Ref,\n useContext,\n useMemo,\n} from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { cutoutMask } from \"../../lib/cutout\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useDirectionCheck, useLocale } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport { MEDIA_RADIUS, type MediaRadius } from \"../../lib/radius\"\nimport { type Ratio, ratioToNumber } from \"../../lib/ratio\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\nimport { useObjectUrl } from \"../../lib/use-object-url\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\nimport { Slider } from \"../slider/slider\"\n\n/**\n * ImageCropper — pick the part of an image to keep: drag the selection, pull\n * its handles, pinch or wheel to zoom, rotate and flip, then export the crop.\n *\n * <ImageCropper src={file} ratio={1} shape=\"circle\" withControls>\n * <ImageCropper.Context>\n * {(api) => <Button onClick={() => api.getCroppedImage().then(upload)}>Save</Button>}\n * </ImageCropper.Context>\n * </ImageCropper>\n *\n * Built on Ark's image cropper (a \"preview\" component in Ark 5.39, see the\n * docs page), which owns the geometry, the gestures, the keyboard and the\n * canvas export. The kit adds the look (an outside dim, handles that survive\n * forced colors), the controls, `src` as a `Blob`, `ratio` in the media\n * components' shape, flattened callbacks and translations with\n * locale-formatted numbers.\n *\n * The result is read from `ImageCropper.Context`, not an imperative ref:\n * `getCroppedImage()` draws the crop to a canvas and resolves a `Blob` (or a\n * data URL), `getCropData()` returns the crop in the image's own pixels for a\n * server to cut.\n */\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type ImageCropperShape = \"rectangle\" | \"circle\"\nexport type ImageCropperFlip = ImageCropperFlipState\n/** A crop rectangle, in px of the viewport. */\nexport type ImageCropperRect = ImageCropperCropChangeDetails[\"crop\"]\nexport type { ImageCropperHandlePosition }\n\n/** A crop rectangle with every number already formatted for the locale. */\nexport type ImageCropperFormattedRect = { x: string; y: string; width: string; height: string }\n\nexport type ImageCropperTranslations = {\n /** The cropper's accessible name. */\n label?: string\n /** What kind of thing the cropper is, announced with its name. */\n roleDescription?: string\n /** The cropper's description while the image loads. */\n loading?: string\n /** The cropper's description once the image is ready. `zoom` is a percent, `rotation` in degrees. */\n preview?: (details: ImageCropperFormattedRect & { zoom: string; rotation: string }) => string\n /** The selection's accessible name. */\n selectionLabel?: (shape: ImageCropperShape) => string\n /** What kind of thing the selection is. Ark's default is the APG \"2d slider\". */\n selectionRoleDescription?: string\n /** How to move it from the keyboard, read as the selection's description. */\n selectionInstructions?: string\n /** The selection's `aria-valuetext`: where it is and how big. */\n selectionValue?: (details: ImageCropperFormattedRect & { shape: ImageCropperShape }) => string\n /** Names the group of controls. */\n controlsLabel?: string\n zoomLabel?: string\n /** The zoom slider's `aria-valuetext`. `percent` is formatted (`\"150%\"`). */\n zoomValue?: (percent: string) => string\n rotateLeftLabel?: string\n rotateRightLabel?: string\n flipHorizontalLabel?: string\n flipVerticalLabel?: string\n resetLabel?: string\n}\n\nexport const DEFAULT_TRANSLATIONS: Required<ImageCropperTranslations> = {\n label: \"Image cropper\",\n roleDescription: \"image cropper\",\n loading: \"Loading the image\",\n preview: ({ zoom, rotation, x, y, width, height }) =>\n `Zoom ${zoom}, rotated ${rotation}. Crop at ${x}px from the left and ${y}px from the top, ${width}px by ${height}px.`,\n selectionLabel: (shape) => `Crop selection (${shape})`,\n selectionRoleDescription: \"2d slider\",\n selectionInstructions:\n \"Use the arrow keys to move the crop. Hold Alt with the arrow keys to resize it. Press plus or minus to zoom.\",\n selectionValue: ({ shape, x, y, width, height }) =>\n match(shape)\n .with(\"circle\", () => `Position X ${x}px, Y ${y}px. Diameter ${width}px.`)\n .with(\"rectangle\", () => `Position X ${x}px, Y ${y}px. Size ${width}px by ${height}px.`)\n .exhaustive(),\n controlsLabel: \"Crop controls\",\n zoomLabel: \"Zoom\",\n zoomValue: (percent) => percent,\n rotateLeftLabel: \"Rotate left\",\n rotateRightLabel: \"Rotate right\",\n flipHorizontalLabel: \"Flip horizontally\",\n flipVerticalLabel: \"Flip vertically\",\n resetLabel: \"Reset\",\n}\n\ntype ArkTranslations = NonNullable<ArkRootProps[\"translations\"]>\n\n/** What the Root shares with the parts Ark's context doesn't cover. */\nexport type ImageCropperIconSlot =\n | \"rotateLeft\"\n | \"rotateRight\"\n | \"flipHorizontal\"\n | \"flipVertical\"\n | \"zoomOut\"\n | \"zoomIn\"\n | \"reset\"\nexport type ImageCropperIcons = IconMap<ImageCropperIconSlot>\n\n/**\n * The default icons of `ImageCropper.Controls`, named like the\n * `translations` labels of the buttons they sit in. None of them points along\n * the inline axis (a rotation turns the same way in either direction, and the\n * zoom glyphs sit at the slider's start and end), so none mirrors under RTL.\n */\nexport const DEFAULT_ICONS: Record<ImageCropperIconSlot, ReactNode> = {\n rotateLeft: <RotateCcw className={iconStroke} />,\n rotateRight: <RotateCw className={iconStroke} />,\n flipHorizontal: <FlipHorizontal2 className={iconStroke} />,\n flipVertical: <FlipVertical2 className={iconStroke} />,\n zoomOut: <ZoomOut className={iconStroke} />,\n zoomIn: <ZoomIn className={iconStroke} />,\n reset: <RefreshCcw className={iconStroke} />,\n}\n\ntype Shared = {\n t: Required<ImageCropperTranslations>\n icons: Record<ImageCropperIconSlot, ReactNode>\n percent: (value: number) => string\n minZoom: number\n maxZoom: number\n shape: ImageCropperShape\n /** The locked width / height (1 for a circle), which the export holds to the pixel. */\n aspect: number | undefined\n}\n\nconst SharedContext = createContext<Shared>({\n t: DEFAULT_TRANSLATIONS,\n icons: DEFAULT_ICONS,\n percent: String,\n minZoom: 1,\n maxZoom: 5,\n shape: \"rectangle\",\n aspect: undefined,\n})\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\n/**\n * Each handle's hit box and visible mark, by position. Ark already places the\n * handle on the selection's edge (`top`/`left`/`right`/`bottom`, centered\n * with `translate`, edges at 96% of the side); this sizes the hit box and\n * shapes the mark, an `::after` centered in it, so the handle stays a bare\n * element any `asChild` child can become.\n *\n * The mark is the Slider thumb: a palette border on the page-tinted fill.\n * Corners are round thumbs, edges are pills along their side. The hit box is\n * 24px under a mouse and 44px (WCAG 2.5.8) under a finger, around the same\n * small mark.\n *\n * Physical sides, not logical ones: the crop is a rectangle in the image's own\n * space, where `e` is the image's right edge whatever the text direction, and\n * Ark positions the handles that way too.\n *\n * Corners sit above the edge bars (`z-1`), which overlap them at 96% of the\n * side, so a press near a corner resizes both ways. On a circle only the four\n * edge pills show: they're the points that touch it.\n */\nconst HANDLE: Record<ImageCropperHandlePosition, string> = {\n nw: \"z-1 size-6 pointer-coarse:size-11 after:size-3.5 in-data-[shape=circle]:after:hidden\",\n ne: \"z-1 size-6 pointer-coarse:size-11 after:size-3.5 in-data-[shape=circle]:after:hidden\",\n se: \"z-1 size-6 pointer-coarse:size-11 after:size-3.5 in-data-[shape=circle]:after:hidden\",\n sw: \"z-1 size-6 pointer-coarse:size-11 after:size-3.5 in-data-[shape=circle]:after:hidden\",\n n: \"h-6 pointer-coarse:h-11 after:h-2 after:w-6\",\n s: \"h-6 pointer-coarse:h-11 after:h-2 after:w-6\",\n e: \"w-6 pointer-coarse:w-11 after:h-6 after:w-2\",\n w: \"w-6 pointer-coarse:w-11 after:h-6 after:w-2\",\n}\n\n/** A ≥ 44px control (WCAG 2.5.8). */\nconst control = \"h-11 [&_svg]:size-5\"\n/** The zoom slider's end glyphs: decorative, the slider carries the name. */\nconst zoomIcon = \"flex shrink-0 [&_svg]:size-4\"\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport type ImageCropperRootProps = Omit<\n ArkRootProps,\n | \"aspectRatio\"\n | \"cropShape\"\n | \"translations\"\n | \"onZoomChange\"\n | \"onRotationChange\"\n | \"onFlipChange\"\n | \"onCropChange\"\n> &\n WithTestId & {\n /** Locks the selection to this width / height. Free when unset; a circle is always 1. */\n ratio?: Ratio\n /** A circle crop still exports a square: mask it where you show it. */\n shape?: ImageCropperShape\n /** Fires as the zoom changes, from 1 (fit) up. */\n onZoomChange?: (zoom: number) => void\n /** Fires as the rotation changes, in degrees. */\n onRotationChange?: (rotation: number) => void\n onFlipChange?: (flip: ImageCropperFlip) => void\n /** Fires as the selection moves or resizes, in px of the viewport. */\n onCropChange?: (crop: ImageCropperRect) => void\n translations?: ImageCropperTranslations\n /** Replaces the control icons: `rotateLeft`, `rotateRight`, `flipHorizontal`,\n * `flipVertical`, `zoomOut`, `zoomIn`, `reset`. Drawn as given, never restroked. */\n icons?: ImageCropperIcons\n /**\n * The palette of the selection's edge, handles, focus ring and zoom slider.\n * `brand` by default: on a photo, the kit's black-and-white default palette\n * would read as plain chrome rather than as a control.\n */\n color?: Color\n ref?: Ref<HTMLDivElement>\n }\n\n/** `\"16/9\"` → `1.777…`, and nothing for a ratio that can't lock a selection. */\nconst aspectRatioOf = (ratio: Ratio | undefined) => {\n const value = ratio === undefined ? Number.NaN : ratioToNumber(ratio)\n return Number.isFinite(value) && value > 0 ? value : undefined\n}\n\nconst ImageCropperRoot = ({\n ratio,\n shape,\n onZoomChange,\n onRotationChange,\n onFlipChange,\n onCropChange,\n translations,\n icons,\n minZoom = 1,\n maxZoom = 5,\n color = \"brand\",\n className,\n testId,\n ref,\n ...rest\n}: ImageCropperRootProps) => {\n const locale = useLocale()\n const direction = useDirectionCheck()\n\n const [shared, arkTranslations] = useMemo(() => {\n const t = { ...DEFAULT_TRANSLATIONS, ...translations }\n const pixels = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 })\n const percent = new Intl.NumberFormat(locale, { style: \"percent\", maximumFractionDigits: 0 })\n const degrees = new Intl.NumberFormat(locale, {\n style: \"unit\",\n unit: \"degree\",\n maximumFractionDigits: 0,\n })\n const rect = ({ x, y, width, height }: ImageCropperRect): ImageCropperFormattedRect => ({\n x: pixels.format(x),\n y: pixels.format(y),\n width: pixels.format(width),\n height: pixels.format(height),\n })\n const ark: ArkTranslations = {\n rootLabel: t.label,\n rootRoleDescription: t.roleDescription,\n previewLoading: t.loading,\n previewDescription: ({ crop, zoom, rotation }) =>\n t.preview({\n ...rect(crop),\n zoom: percent.format(zoom ?? 1),\n rotation: degrees.format(rotation ?? 0),\n }),\n selectionLabel: ({ shape }) => t.selectionLabel(shape),\n selectionRoleDescription: t.selectionRoleDescription,\n selectionInstructions: t.selectionInstructions,\n selectionValueText: ({ shape, ...crop }) => t.selectionValue({ shape, ...rect(crop) }),\n }\n const value: Shared = {\n t,\n icons: mergeIcons(DEFAULT_ICONS, icons),\n percent: (n) => percent.format(n),\n minZoom,\n maxZoom,\n shape: shape ?? \"rectangle\",\n aspect: shape === \"circle\" ? 1 : aspectRatioOf(ratio),\n }\n return [value, ark] as const\n }, [translations, icons, locale, minZoom, maxZoom, shape, ratio])\n\n const rootRef = useMergedRefs(ref, direction)\n return (\n <SharedContext value={shared}>\n <Ark.Root\n ref={rootRef}\n aspectRatio={aspectRatioOf(ratio)}\n cropShape={shape}\n minZoom={minZoom}\n maxZoom={maxZoom}\n translations={arkTranslations}\n onZoomChange={onZoomChange && (({ zoom }) => onZoomChange(zoom))}\n onRotationChange={onRotationChange && (({ rotation }) => onRotationChange(rotation))}\n onFlipChange={onFlipChange && (({ flip }) => onFlipChange(flip))}\n onCropChange={onCropChange && (({ crop }) => onCropChange(crop))}\n data-color={color}\n className={cn(\"flex w-full flex-col gap-3\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n </SharedContext>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Parts\n// ---------------------------------------------------------------------------\n\nexport type ImageCropperViewportProps = Ark.ViewportProps &\n WithTestId & {\n /** Corner radius, from the media scale. */\n radius?: MediaRadius\n }\n\n/** The frame the image is cropped in. Takes the pan, wheel and pinch gestures. */\nconst ImageCropperViewport = ({\n radius = \"xs\",\n className,\n testId,\n ...rest\n}: ImageCropperViewportProps) => (\n <Ark.Viewport\n className={cn(\n \"relative touch-none select-none overflow-clip bg-black/80\",\n MEDIA_RADIUS[radius],\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ImageCropperImageProps = NoAsChild<\n Omit<Ark.ImageProps, \"src\"> &\n WithTestId & {\n /** A URL, or a `Blob` / `File`, shown through an object URL that's revoked when it changes. */\n src: string | Blob\n }\n>\n\n/**\n * The image being cropped. Decorative to assistive technology: the cropper's\n * own description says what's selected. Fades in once Ark has measured it.\n *\n * A cross-origin URL needs `crossOrigin=\"anonymous\"` (and CORS headers on the\n * server) for `getCroppedImage()`; without them the canvas is tainted and the\n * export resolves `null`.\n */\nconst ImageCropperImage = ({\n src,\n className,\n testId,\n asChild: _asChild,\n ...rest\n}: ImageCropperImageProps) => {\n const url = useObjectUrl(src)\n return (\n <Ark.Image\n src={url}\n className={cn(\n \"block h-auto w-full max-w-none opacity-0 data-ready:opacity-100\",\n \"transition-opacity duration-(--duration-normal) ease-standard motion-reduce:transition-none\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type ImageCropperSelectionProps = NoAsChild<\n Ark.SelectionProps &\n WithTestId & {\n /** Rule-of-thirds lines inside the selection, shown while it's dragged or resized. */\n withGrid?: boolean\n }\n>\n\n/** The selection's hole in the dim: Ark sets the crop rectangle as custom properties on the root. */\nconst CROP_RECT = {\n x: \"var(--crop-x)\",\n y: \"var(--crop-y)\",\n width: \"var(--crop-width)\",\n height: \"var(--crop-height)\",\n}\n\n/**\n * The crop area: a `role=\"slider\"` that moves with the arrow keys, resizes\n * with Alt + arrows and zooms with `+`/`-`.\n *\n * Everything outside it is dimmed like a Modal backdrop by an overlay drawn\n * just before it, with the selection cut out of it (`lib/cutout.ts`): a real\n * rectangle or circle, following the crop through Ark's `--crop-*` custom\n * properties without a render. The overlay steps aside in forced colors,\n * where it would paint `Canvas` over the image; the edge and the handles,\n * borders both, are repainted instead.\n */\nconst ImageCropperSelection = ({\n withGrid = true,\n className,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: ImageCropperSelectionProps) => {\n const { shape } = useContext(SharedContext)\n return (\n <>\n <div\n aria-hidden\n data-part=\"overlay\"\n data-shape={shape}\n // The Modal backdrop's dim, with a light blur: the frame stays legible\n // around the crop without competing with it.\n className=\"pointer-events-none absolute inset-0 bg-black/50 backdrop-blur-xs forced-colors:hidden\"\n style={cutoutMask(shape, CROP_RECT)}\n />\n <Ark.Selection\n className={cn(\n \"cursor-move border border-(--c-solid) data-[shape=circle]:rounded-full\",\n // A pale halo around the 1px palette edge: two tones, so it holds on a dark photo and a bright one.\n \"shadow-[0_0_0_1px_rgb(255_255_255/0.45)]\",\n \"data-disabled:cursor-default\",\n // Inset and gap-less: the selection can sit flush with the clipping viewport.\n focusStyles({ ring: \"palette\", offset: false, inset: true }),\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {withGrid && (\n <>\n <ImageCropperGrid axis=\"horizontal\" />\n <ImageCropperGrid axis=\"vertical\" />\n </>\n )}\n {Ark.handles.map((position) => (\n <ImageCropperHandle key={position} position={position} />\n ))}\n {children}\n </Ark.Selection>\n </>\n )\n}\n\nexport type ImageCropperHandleProps = Ark.HandleProps & WithTestId\n\n/** One resize handle. `Selection` renders all eight; use it when you compose your own. */\nconst ImageCropperHandle = ({ position, className, testId, ...rest }: ImageCropperHandleProps) => (\n <Ark.Handle\n position={position}\n className={cn(\n \"after:absolute after:top-1/2 after:left-1/2 after:-translate-1/2 after:rounded-full\",\n \"after:border-2 after:border-(--c-solid) after:bg-brand-50 after:shadow-sm dark:after:bg-brand-950\",\n // Grows a touch while held, like the Slider thumb.\n \"after:transition-[scale] after:duration-(--duration-fast) after:ease-standard motion-reduce:after:transition-none\",\n \"in-data-dragging:after:scale-110\",\n \"data-disabled:hidden\",\n HANDLE[position],\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ImageCropperGridProps = Ark.GridProps & WithTestId\n\n/** A pair of rule-of-thirds lines, along `axis`. Fades in while the crop is dragged, resized or panned. */\nconst ImageCropperGrid = ({ className, testId, ...rest }: ImageCropperGridProps) => (\n <Ark.Grid\n className={cn(\n \"border-white/50 data-[axis=horizontal]:border-y data-[axis=vertical]:border-x\",\n \"opacity-0 data-dragging:opacity-100 data-panning:opacity-100\",\n \"transition-opacity duration-(--duration-fast) ease-standard motion-reduce:transition-none\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ImageCropperControlsProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/**\n * Zoom slider, rotate ±90°, flip and reset, wired to the nearest cropper. Each\n * is a 44px button named from `translations`; the flips are toggle buttons.\n */\nconst ImageCropperControls = ({ className, testId, ...rest }: ImageCropperControlsProps) => {\n const api = useImageCropperContext()\n const { t, icons, percent, minZoom, maxZoom } = useContext(SharedContext)\n return (\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={t.controlsLabel}\n className={cn(\"flex flex-wrap items-center gap-1\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.rotateLeftLabel}\n onClick={() => api.rotateBy(-90)}\n >\n {icons.rotateLeft}\n </ActionIcon>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.rotateRightLabel}\n onClick={() => api.rotateBy(90)}\n >\n {icons.rotateRight}\n </ActionIcon>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.flipHorizontalLabel}\n aria-pressed={api.flip.horizontal}\n onClick={() => api.flipHorizontally()}\n >\n {icons.flipHorizontal}\n </ActionIcon>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.flipVerticalLabel}\n aria-pressed={api.flip.vertical}\n onClick={() => api.flipVertically()}\n >\n {icons.flipVertical}\n </ActionIcon>\n <div\n className={cn(\n \"flex min-w-40 flex-1 items-center gap-2 px-2\",\n TYPOGRAPHY_SHADE_CLASSES.muted,\n )}\n >\n <span aria-hidden className={zoomIcon}>\n {icons.zoomOut}\n </span>\n <Slider\n min={minZoom}\n max={maxZoom}\n step={0.01}\n value={api.zoom}\n onChange={(zoom) => api.setZoom(zoom)}\n aria-label={[t.zoomLabel]}\n getAriaValueText={({ value }) => t.zoomValue(percent(value))}\n classNames={{ field: \"flex-1\" }}\n />\n <span aria-hidden className={zoomIcon}>\n {icons.zoomIn}\n </span>\n </div>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n className={control}\n aria-label={t.resetLabel}\n onClick={() => api.reset()}\n >\n {icons.reset}\n </ActionIcon>\n </div>\n )\n}\n\ntype CropExport = UseImageCropperContext[\"getCroppedImage\"]\n\n/** The size a `width × height` export should have at `aspect`: its short side stretched to match the long one. */\nconst exactSize = (width: number, height: number, aspect: number) =>\n width / height > aspect\n ? { width, height: Math.round(width / aspect) }\n : { width: Math.round(height * aspect), height }\n\n/**\n * Ark's export, held to a locked ratio. Ark sizes the canvas from the image's\n * rounded layout box, scaling each side on its own, so a 1:1 crop can come\n * out 511 × 512. When it does, the crop is exported again losslessly and\n * redrawn at the exact size, then encoded once as asked.\n */\nexport const exactExport =\n (getCroppedImage: CropExport, aspect: number | undefined): CropExport =>\n async (options) => {\n const blob = await getCroppedImage(options)\n if (aspect === undefined || !(blob instanceof Blob) || typeof createImageBitmap !== \"function\")\n return blob\n const shot = await createImageBitmap(blob)\n // Read the size before `close()`: a closed bitmap reports 0 × 0.\n const { width, height } = shot\n shot.close()\n const size = exactSize(width, height, aspect)\n if (size.width === width && size.height === height) return blob\n const lossless = await getCroppedImage({ ...options, type: \"image/png\" })\n if (!(lossless instanceof Blob)) return blob\n const source = await createImageBitmap(lossless)\n const canvas = document.createElement(\"canvas\")\n canvas.width = size.width\n canvas.height = size.height\n const context = canvas.getContext(\"2d\")\n if (!context) return blob\n context.drawImage(source, 0, 0, size.width, size.height)\n source.close()\n return new Promise<Blob | null>((resolve) =>\n canvas.toBlob(resolve, options?.type ?? \"image/png\", options?.quality ?? 1),\n )\n }\n\n/**\n * The nearest cropper's API: Ark's, with `getCroppedImage()` held to the\n * locked ratio (or the circle) to the pixel.\n */\nconst useImageCropperContext = (): UseImageCropperContext => {\n const api = useArkImageCropperContext()\n const { aspect } = useContext(SharedContext)\n return { ...api, getCroppedImage: exactExport(api.getCroppedImage, aspect) }\n}\n\nexport type ImageCropperContextProps = Ark.ContextProps\n\n/** Renders its child function with the cropper's API, for an export button. */\nconst ImageCropperContext = ({ children }: ImageCropperContextProps) =>\n children(useImageCropperContext())\n\n// ---------------------------------------------------------------------------\n// Convenience\n// ---------------------------------------------------------------------------\n\nexport type ImageCropperClassNames = {\n viewport?: string\n image?: string\n selection?: string\n controls?: string\n}\n\nexport type ImageCropperProps = NoAsChild<\n Omit<ImageCropperRootProps, \"children\"> & {\n /** The image to crop: a URL, or a `Blob` / `File` (a pick or a drop). */\n src: string | Blob\n /** Needed on a cross-origin URL for the export to read its pixels. */\n crossOrigin?: ImageCropperImageProps[\"crossOrigin\"]\n /** The viewport's corner radius, from the media scale. */\n radius?: MediaRadius\n /** Rule-of-thirds lines inside the selection, shown while it's dragged or resized. */\n withGrid?: boolean\n /** The zoom slider and the rotate, flip and reset buttons, under the image. */\n withControls?: boolean\n classNames?: ImageCropperClassNames\n /** Rendered last, inside the root: an `ImageCropper.Context` for the export. */\n children?: ReactNode\n }\n>\n\nconst ImageCropperComponent = ({\n src,\n crossOrigin,\n radius,\n withGrid,\n withControls = false,\n classNames,\n children,\n asChild: _asChild,\n ...rest\n}: ImageCropperProps) => (\n <ImageCropperRoot {...rest}>\n <ImageCropperViewport radius={radius} className={classNames?.viewport}>\n <ImageCropperImage src={src} crossOrigin={crossOrigin} className={classNames?.image} />\n <ImageCropperSelection withGrid={withGrid} className={classNames?.selection} />\n </ImageCropperViewport>\n {withControls && <ImageCropperControls className={classNames?.controls} />}\n {children}\n </ImageCropperRoot>\n)\n\nexport const ImageCropper = Object.assign(ImageCropperComponent, {\n Root: ImageCropperRoot,\n Viewport: ImageCropperViewport,\n Image: ImageCropperImage,\n Selection: ImageCropperSelection,\n Handle: ImageCropperHandle,\n Grid: ImageCropperGrid,\n Controls: ImageCropperControls,\n Context: ImageCropperContext,\n})\n\nexport { useImageCropperContext }\n"]}
@@ -1,6 +1,6 @@
1
- import { createDialogParts, DIALOG_PADDING, useDialogNameCheck, DialogRootProviders } from './chunk-DA4QII2N.js';
2
- import { OverlayContainerProvider } from './chunk-7P32XCEU.js';
1
+ import { createDialogParts, DIALOG_PADDING, useDialogNameCheck, DialogRootProviders } from './chunk-NLSJ6T7V.js';
3
2
  import { useLayerGuard, NestedLayer } from './chunk-H7WOMZXO.js';
3
+ import { OverlayContainerProvider } from './chunk-7P32XCEU.js';
4
4
  import { props } from './chunk-WYCMIIRR.js';
5
5
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
6
6
  import { cn } from './chunk-4ASNIDV7.js';
@@ -305,5 +305,5 @@ var Drawer = Object.assign(DrawerComponent, {
305
305
  });
306
306
 
307
307
  export { Drawer };
308
- //# sourceMappingURL=chunk-O7LS6OZR.js.map
309
- //# sourceMappingURL=chunk-O7LS6OZR.js.map
308
+ //# sourceMappingURL=chunk-YMVUQ2L7.js.map
309
+ //# sourceMappingURL=chunk-YMVUQ2L7.js.map