@42-central/ui-react 0.20.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/{chunk-PAFS7TED.js → chunk-2HIX6DKN.js} +3 -3
  2. package/dist/{chunk-PAFS7TED.js.map → chunk-2HIX6DKN.js.map} +1 -1
  3. package/dist/{chunk-Z5WYYDG2.js → chunk-2MXWEIMD.js} +7 -4
  4. package/dist/chunk-2MXWEIMD.js.map +1 -0
  5. package/dist/{chunk-JYK6JVR3.js → chunk-3BXKTWWD.js} +8 -8
  6. package/dist/{chunk-JYK6JVR3.js.map → chunk-3BXKTWWD.js.map} +1 -1
  7. package/dist/{chunk-7R4CDHBK.js → chunk-45QRQKRC.js} +4 -4
  8. package/dist/{chunk-7R4CDHBK.js.map → chunk-45QRQKRC.js.map} +1 -1
  9. package/dist/{chunk-MKJKCBRE.js → chunk-47LEAR6G.js} +6 -6
  10. package/dist/{chunk-MKJKCBRE.js.map → chunk-47LEAR6G.js.map} +1 -1
  11. package/dist/chunk-4ASNIDV7.js +17 -0
  12. package/dist/chunk-4ASNIDV7.js.map +1 -0
  13. package/dist/{chunk-ZN3WYGIQ.js → chunk-5HUEBSIS.js} +3 -3
  14. package/dist/{chunk-ZN3WYGIQ.js.map → chunk-5HUEBSIS.js.map} +1 -1
  15. package/dist/{chunk-2TM7UVM2.js → chunk-6M6YZ3PQ.js} +4 -4
  16. package/dist/{chunk-2TM7UVM2.js.map → chunk-6M6YZ3PQ.js.map} +1 -1
  17. package/dist/{chunk-4BGU2UQB.js → chunk-6VYGK3Q3.js} +6 -6
  18. package/dist/{chunk-4BGU2UQB.js.map → chunk-6VYGK3Q3.js.map} +1 -1
  19. package/dist/{chunk-ZFUTGBJC.js → chunk-6YNLRQ25.js} +3 -3
  20. package/dist/{chunk-ZFUTGBJC.js.map → chunk-6YNLRQ25.js.map} +1 -1
  21. package/dist/{chunk-6OV6EJQ2.js → chunk-7AQ4MN4M.js} +6 -6
  22. package/dist/{chunk-6OV6EJQ2.js.map → chunk-7AQ4MN4M.js.map} +1 -1
  23. package/dist/{chunk-5337N3FE.js → chunk-7BOSX65U.js} +3 -3
  24. package/dist/{chunk-5337N3FE.js.map → chunk-7BOSX65U.js.map} +1 -1
  25. package/dist/{chunk-THLMW5IU.js → chunk-7CNDZZZ6.js} +4 -4
  26. package/dist/{chunk-THLMW5IU.js.map → chunk-7CNDZZZ6.js.map} +1 -1
  27. package/dist/{chunk-LJ3GHC4V.js → chunk-BE2LWUHY.js} +5 -5
  28. package/dist/{chunk-LJ3GHC4V.js.map → chunk-BE2LWUHY.js.map} +1 -1
  29. package/dist/{chunk-LSIX2PVU.js → chunk-BNWQ7IAZ.js} +7 -7
  30. package/dist/{chunk-LSIX2PVU.js.map → chunk-BNWQ7IAZ.js.map} +1 -1
  31. package/dist/{chunk-2KN3MI7I.js → chunk-C4NFRSOR.js} +4 -4
  32. package/dist/{chunk-2KN3MI7I.js.map → chunk-C4NFRSOR.js.map} +1 -1
  33. package/dist/{chunk-3REFDGOM.js → chunk-C6NVU4F7.js} +3 -3
  34. package/dist/{chunk-3REFDGOM.js.map → chunk-C6NVU4F7.js.map} +1 -1
  35. package/dist/{chunk-HVOEVB4E.js → chunk-D2QIPQ74.js} +3 -3
  36. package/dist/{chunk-HVOEVB4E.js.map → chunk-D2QIPQ74.js.map} +1 -1
  37. package/dist/{chunk-4EU6FGGB.js → chunk-DA4QII2N.js} +4 -4
  38. package/dist/{chunk-4EU6FGGB.js.map → chunk-DA4QII2N.js.map} +1 -1
  39. package/dist/{chunk-LZWA7V62.js → chunk-DJLNGWMM.js} +5 -5
  40. package/dist/{chunk-LZWA7V62.js.map → chunk-DJLNGWMM.js.map} +1 -1
  41. package/dist/{chunk-HEQ2H6VO.js → chunk-DT6LKNZF.js} +4 -4
  42. package/dist/{chunk-HEQ2H6VO.js.map → chunk-DT6LKNZF.js.map} +1 -1
  43. package/dist/{chunk-BUFALAEK.js → chunk-E5H3YWZV.js} +4 -4
  44. package/dist/{chunk-BUFALAEK.js.map → chunk-E5H3YWZV.js.map} +1 -1
  45. package/dist/{chunk-WR444JRU.js → chunk-E63VD25L.js} +7 -7
  46. package/dist/{chunk-WR444JRU.js.map → chunk-E63VD25L.js.map} +1 -1
  47. package/dist/{chunk-H7INUXZD.js → chunk-F342ZT7O.js} +4 -4
  48. package/dist/{chunk-H7INUXZD.js.map → chunk-F342ZT7O.js.map} +1 -1
  49. package/dist/{chunk-VALQ2XVA.js → chunk-H3PYSAWN.js} +3 -3
  50. package/dist/{chunk-VALQ2XVA.js.map → chunk-H3PYSAWN.js.map} +1 -1
  51. package/dist/{chunk-Q5ZO2O25.js → chunk-HRNWWL3Y.js} +6 -6
  52. package/dist/{chunk-Q5ZO2O25.js.map → chunk-HRNWWL3Y.js.map} +1 -1
  53. package/dist/{chunk-DHTSVJ4G.js → chunk-IOYZC7SA.js} +9 -9
  54. package/dist/{chunk-DHTSVJ4G.js.map → chunk-IOYZC7SA.js.map} +1 -1
  55. package/dist/{chunk-HBFN5W7Q.js → chunk-JVG5ISPT.js} +4 -4
  56. package/dist/{chunk-HBFN5W7Q.js.map → chunk-JVG5ISPT.js.map} +1 -1
  57. package/dist/{chunk-6KER77RS.js → chunk-KMZENCEP.js} +7 -7
  58. package/dist/{chunk-6KER77RS.js.map → chunk-KMZENCEP.js.map} +1 -1
  59. package/dist/{chunk-VVM7JMZS.js → chunk-LBAE6FP6.js} +8 -8
  60. package/dist/{chunk-VVM7JMZS.js.map → chunk-LBAE6FP6.js.map} +1 -1
  61. package/dist/{chunk-U2PNMMDB.js → chunk-LKFHUDEW.js} +7 -7
  62. package/dist/{chunk-U2PNMMDB.js.map → chunk-LKFHUDEW.js.map} +1 -1
  63. package/dist/{chunk-P276SCCV.js → chunk-MKKQE3TM.js} +6 -6
  64. package/dist/{chunk-P276SCCV.js.map → chunk-MKKQE3TM.js.map} +1 -1
  65. package/dist/{chunk-2SVX3MQQ.js → chunk-MW42XVPD.js} +3 -3
  66. package/dist/{chunk-2SVX3MQQ.js.map → chunk-MW42XVPD.js.map} +1 -1
  67. package/dist/{chunk-S4TRYMCU.js → chunk-MXAACRWE.js} +6 -6
  68. package/dist/{chunk-S4TRYMCU.js.map → chunk-MXAACRWE.js.map} +1 -1
  69. package/dist/{chunk-WFHY6NRQ.js → chunk-NJPHZBLI.js} +11 -11
  70. package/dist/{chunk-WFHY6NRQ.js.map → chunk-NJPHZBLI.js.map} +1 -1
  71. package/dist/{chunk-DUPE2CRU.js → chunk-NKOTA5TM.js} +3 -3
  72. package/dist/{chunk-DUPE2CRU.js.map → chunk-NKOTA5TM.js.map} +1 -1
  73. package/dist/{chunk-RGLNH7A5.js → chunk-NLOBBJAA.js} +3 -3
  74. package/dist/{chunk-RGLNH7A5.js.map → chunk-NLOBBJAA.js.map} +1 -1
  75. package/dist/{chunk-FXDLS23K.js → chunk-NS6RGPWR.js} +3 -3
  76. package/dist/{chunk-FXDLS23K.js.map → chunk-NS6RGPWR.js.map} +1 -1
  77. package/dist/{chunk-ZWOZL4XX.js → chunk-O5W3QWJ6.js} +5 -5
  78. package/dist/{chunk-ZWOZL4XX.js.map → chunk-O5W3QWJ6.js.map} +1 -1
  79. package/dist/{chunk-PD4FX34E.js → chunk-O7LS6OZR.js} +4 -4
  80. package/dist/{chunk-PD4FX34E.js.map → chunk-O7LS6OZR.js.map} +1 -1
  81. package/dist/{chunk-JL4QMM46.js → chunk-POKLPMSB.js} +5 -5
  82. package/dist/{chunk-JL4QMM46.js.map → chunk-POKLPMSB.js.map} +1 -1
  83. package/dist/{chunk-K6BHDFX3.js → chunk-QKSLDQM2.js} +3 -3
  84. package/dist/{chunk-K6BHDFX3.js.map → chunk-QKSLDQM2.js.map} +1 -1
  85. package/dist/{chunk-CDHIF2NV.js → chunk-QNKD2SQM.js} +8 -8
  86. package/dist/{chunk-CDHIF2NV.js.map → chunk-QNKD2SQM.js.map} +1 -1
  87. package/dist/{chunk-KOT4PWGE.js → chunk-RCF7HTG5.js} +5 -5
  88. package/dist/{chunk-KOT4PWGE.js.map → chunk-RCF7HTG5.js.map} +1 -1
  89. package/dist/{chunk-SE3CGQRO.js → chunk-RLOWPCGG.js} +3 -3
  90. package/dist/{chunk-SE3CGQRO.js.map → chunk-RLOWPCGG.js.map} +1 -1
  91. package/dist/{chunk-R57QP43T.js → chunk-SVKN5ZHX.js} +4 -4
  92. package/dist/{chunk-R57QP43T.js.map → chunk-SVKN5ZHX.js.map} +1 -1
  93. package/dist/{chunk-NJ4RO3CT.js → chunk-SWVUXEBT.js} +5 -5
  94. package/dist/{chunk-NJ4RO3CT.js.map → chunk-SWVUXEBT.js.map} +1 -1
  95. package/dist/{chunk-FZNPJAGJ.js → chunk-SXNAUSEB.js} +5 -5
  96. package/dist/{chunk-FZNPJAGJ.js.map → chunk-SXNAUSEB.js.map} +1 -1
  97. package/dist/{chunk-7AWOMWCQ.js → chunk-TWLJQE75.js} +7 -7
  98. package/dist/{chunk-7AWOMWCQ.js.map → chunk-TWLJQE75.js.map} +1 -1
  99. package/dist/{chunk-GGT4GJD6.js → chunk-TWNIAF7K.js} +3 -3
  100. package/dist/{chunk-GGT4GJD6.js.map → chunk-TWNIAF7K.js.map} +1 -1
  101. package/dist/{chunk-4TCTMRR5.js → chunk-UAYENYS2.js} +5 -5
  102. package/dist/{chunk-4TCTMRR5.js.map → chunk-UAYENYS2.js.map} +1 -1
  103. package/dist/{chunk-HDRC6ITF.js → chunk-UT3TOV2Q.js} +3 -3
  104. package/dist/{chunk-HDRC6ITF.js.map → chunk-UT3TOV2Q.js.map} +1 -1
  105. package/dist/{chunk-R52P43LZ.js → chunk-UXPINIDN.js} +3 -3
  106. package/dist/{chunk-R52P43LZ.js.map → chunk-UXPINIDN.js.map} +1 -1
  107. package/dist/{chunk-45DFYIK5.js → chunk-VD6PB3VA.js} +3 -3
  108. package/dist/{chunk-45DFYIK5.js.map → chunk-VD6PB3VA.js.map} +1 -1
  109. package/dist/{chunk-2OQP7UY4.js → chunk-VTDBWU6H.js} +4 -4
  110. package/dist/{chunk-2OQP7UY4.js.map → chunk-VTDBWU6H.js.map} +1 -1
  111. package/dist/{chunk-IMP5VHEN.js → chunk-XKDL4QS6.js} +3 -3
  112. package/dist/{chunk-IMP5VHEN.js.map → chunk-XKDL4QS6.js.map} +1 -1
  113. package/dist/{chunk-H26K66EU.js → chunk-Y57NW6G7.js} +3 -3
  114. package/dist/{chunk-H26K66EU.js.map → chunk-Y57NW6G7.js.map} +1 -1
  115. package/dist/components/accordion/index.js +5 -5
  116. package/dist/components/action-icon/index.js +4 -4
  117. package/dist/components/alert/index.js +6 -6
  118. package/dist/components/ambient-background/index.js +1 -1
  119. package/dist/components/app-shell/index.js +6 -6
  120. package/dist/components/aspect-ratio/index.js +1 -1
  121. package/dist/components/autocomplete/index.js +6 -6
  122. package/dist/components/avatar/index.js +1 -1
  123. package/dist/components/badge/index.js +3 -3
  124. package/dist/components/breadcrumb/index.js +1 -1
  125. package/dist/components/button/index.js +4 -4
  126. package/dist/components/button-group/index.js +2 -2
  127. package/dist/components/button-multi-select/index.js +7 -7
  128. package/dist/components/button-select/index.js +7 -7
  129. package/dist/components/calendar/index.js +6 -6
  130. package/dist/components/camera/index.js +14 -14
  131. package/dist/components/card/card.d.ts.map +1 -1
  132. package/dist/components/card/index.js +2 -2
  133. package/dist/components/carousel/index.js +3 -3
  134. package/dist/components/chart/index.js +1 -1
  135. package/dist/components/checkbox/index.js +6 -6
  136. package/dist/components/choice-card-group/index.js +5 -5
  137. package/dist/components/circular-progress/index.js +1 -1
  138. package/dist/components/clipboard/index.js +6 -6
  139. package/dist/components/code/index.js +2 -2
  140. package/dist/components/code-block/chrome.js +6 -6
  141. package/dist/components/code-block/index.js +7 -7
  142. package/dist/components/code-block/static.js +4 -1
  143. package/dist/components/code-block/static.js.map +1 -1
  144. package/dist/components/collapse/index.js +2 -2
  145. package/dist/components/combobox/index.js +6 -6
  146. package/dist/components/combobox-list/index.js +8 -8
  147. package/dist/components/compare/index.js +2 -2
  148. package/dist/components/container/index.js +1 -1
  149. package/dist/components/data-table/index.js +32 -32
  150. package/dist/components/date-picker/index.js +15 -15
  151. package/dist/components/divider/index.js +2 -2
  152. package/dist/components/download-button/index.js +5 -5
  153. package/dist/components/drawer/index.js +6 -6
  154. package/dist/components/field/index.js +2 -2
  155. package/dist/components/figure/index.js +2 -2
  156. package/dist/components/file-item/index.js +8 -8
  157. package/dist/components/file-preview/index.js +6 -6
  158. package/dist/components/file-queue-summary/index.js +2 -2
  159. package/dist/components/file-trigger/index.js +5 -5
  160. package/dist/components/file-upload/index.js +10 -10
  161. package/dist/components/flex/index.js +2 -2
  162. package/dist/components/gallery/index.js +4 -4
  163. package/dist/components/grid/index.js +1 -1
  164. package/dist/components/hover-card/index.js +2 -2
  165. package/dist/components/image/index.js +2 -2
  166. package/dist/components/image-cropper/index.js +7 -7
  167. package/dist/components/indicator/index.js +1 -1
  168. package/dist/components/input/index.js +3 -3
  169. package/dist/components/kbd/index.js +3 -3
  170. package/dist/components/lightbox/index.js +9 -9
  171. package/dist/components/mark/index.js +2 -2
  172. package/dist/components/menu/index.js +4 -4
  173. package/dist/components/modal/index.js +6 -6
  174. package/dist/components/multi-combobox-list/index.js +10 -10
  175. package/dist/components/multi-select/index.js +9 -9
  176. package/dist/components/nav-link/index.js +5 -5
  177. package/dist/components/nav-link/tanstack.js +5 -5
  178. package/dist/components/notification/index.js +7 -7
  179. package/dist/components/number-input/index.js +6 -6
  180. package/dist/components/overlays/index.js +8 -8
  181. package/dist/components/password-input/index.js +4 -4
  182. package/dist/components/photo-capture/index.js +17 -17
  183. package/dist/components/pill/index.js +3 -3
  184. package/dist/components/pills-input/index.js +6 -6
  185. package/dist/components/pin-input/index.js +3 -3
  186. package/dist/components/popover/index.js +2 -2
  187. package/dist/components/progress/index.js +2 -2
  188. package/dist/components/radio-group/index.js +4 -4
  189. package/dist/components/rating/index.js +3 -3
  190. package/dist/components/schedule/index.js +9 -9
  191. package/dist/components/segment-group/index.js +3 -3
  192. package/dist/components/select/index.js +7 -7
  193. package/dist/components/skeleton/index.js +2 -2
  194. package/dist/components/slider/index.js +4 -4
  195. package/dist/components/spinner/index.js +2 -2
  196. package/dist/components/spotlight/index.js +15 -15
  197. package/dist/components/switch/index.js +3 -3
  198. package/dist/components/table/index.js +3 -3
  199. package/dist/components/tabs/index.js +3 -3
  200. package/dist/components/tags-input/index.js +8 -8
  201. package/dist/components/text/index.js +2 -2
  202. package/dist/components/text-input/index.js +3 -3
  203. package/dist/components/textarea/index.js +3 -3
  204. package/dist/components/theme-icon/index.js +3 -3
  205. package/dist/components/time-input/index.js +8 -8
  206. package/dist/components/timeline/index.js +1 -1
  207. package/dist/components/title/index.js +2 -2
  208. package/dist/components/tooltip/index.js +3 -3
  209. package/dist/components/tree-multi-select/index.js +10 -10
  210. package/dist/components/tree-select/index.js +7 -7
  211. package/dist/index.js +2 -2
  212. package/dist/lib/cn.d.ts.map +1 -1
  213. package/dist/lib/cn.js +1 -1
  214. package/package.json +1 -1
  215. package/src/components/card/card.test.tsx +10 -0
  216. package/src/components/card/card.tsx +4 -1
  217. package/src/lib/cn.test.ts +9 -0
  218. package/src/lib/cn.ts +9 -1
  219. package/dist/chunk-QP4I37PA.js +0 -14
  220. package/dist/chunk-QP4I37PA.js.map +0 -1
  221. package/dist/chunk-Z5WYYDG2.js.map +0 -1
@@ -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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W,UAAA,EAAY,IAAI,CAAA,EACxE,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-CDHIF2NV.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,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AA,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,14 +1,14 @@
1
1
  import { resolveLogicalPlacement } from './chunk-G52U24GR.js';
2
- import { popoverChrome, popoverGroupLabel, popoverIndicator, popoverChevron } from './chunk-ZN3WYGIQ.js';
2
+ import { popoverChrome, popoverGroupLabel, popoverIndicator, popoverChevron } from './chunk-5HUEBSIS.js';
3
3
  import { useOverlayContainer } from './chunk-7P32XCEU.js';
4
4
  import { useNestedLayer } from './chunk-H7WOMZXO.js';
5
5
  import { warnRenamedProp } from './chunk-6N6J2DOE.js';
6
- import { ChevronRightIcon, CheckIcon } from './chunk-ZFUTGBJC.js';
6
+ import { ChevronRightIcon, CheckIcon } from './chunk-6YNLRQ25.js';
7
7
  import { mergeIcons } from './chunk-XXOR34T4.js';
8
8
  import { composeChildren } from './chunk-R5LYFTHA.js';
9
9
  import { props } from './chunk-WYCMIIRR.js';
10
10
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
11
- import { cn } from './chunk-QP4I37PA.js';
11
+ import { cn } from './chunk-4ASNIDV7.js';
12
12
  import { ark } from '@ark-ui/react/factory';
13
13
  import { useLocaleContext } from '@ark-ui/react/locale';
14
14
  import { Menu, useMenuContext } from '@ark-ui/react/menu';
@@ -314,5 +314,5 @@ var Separator = Divider;
314
314
  var SubContent = Content;
315
315
 
316
316
  export { CheckboxItem, Content, Context, ContextTrigger, Divider, Item, ItemGroup, ItemGroupLabel, Label, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger };
317
- //# sourceMappingURL=chunk-KOT4PWGE.js.map
318
- //# sourceMappingURL=chunk-KOT4PWGE.js.map
317
+ //# sourceMappingURL=chunk-RCF7HTG5.js.map
318
+ //# sourceMappingURL=chunk-RCF7HTG5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/menu/menu.tsx"],"names":["ArkMenu"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgEA,IAAM,WAAA,GAAc,EAAA;AAAA,EAClB,aAAA;AAAA,EACA,kCAAA;AAAA,EACA;AACF,CAAA;AAQA,IAAM,QAAA,GAAW,GAAA;AAAA,EACf;AAAA,IACE,kFAAA;AAAA,IACA,0BAAA;AAAA,IACA,kCAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA,QAIP,KAAA,EAAO;AAAA,UACL,kBAAA,CAAmB,OAAA;AAAA,UACnB;AAAA,SACF;AAAA;AAAA,QAEA,IAAA,EAAM,CAAC,iBAAA,EAAmB,gCAAgC;AAAA;AAC5D,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,OAAA,EAAS,KAAA;AAAM;AAEtC,CAAA;AAMA,IAAM,WAAA,GAAc,2DAAA;AAiBb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{ Menu as ArkMenu, useMenuContext } from \"@ark-ui/react/menu\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresenceContext } from \"@ark-ui/react/presence\"\nimport { mergeProps } from \"@ark-ui/react/utils\"\nimport { cva } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type DragEvent,\n type ReactNode,\n type Ref,\n useContext,\n useId,\n} from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport { type IconMap, mergeIcons } from \"../../lib/icons\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { useNestedLayer } from \"../../lib/overlay-layer\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { CheckIcon, ChevronRightIcon } from \"../popover/icons\"\nimport {\n popoverChevron,\n popoverChrome,\n popoverGroupLabel,\n popoverIndicator,\n} from \"../popover/popover\"\n\n/**\n * Menu — the kit's dropdown of actions, a styled layer over Ark UI's Menu.\n * It's the click-triggered sibling of `Popover` (a free-form panel): Ark's Menu\n * machine wires roving focus, type-ahead, `role=\"menu\"` / `menuitem`,\n * `aria-haspopup` / `aria-expanded`, submenus, and checkbox / radio selection.\n *\n * Two ways to use it — the compound parts (this file) give full control; the\n * data-driven `<Menu data={…}>` convenience (see `menu-data.tsx`) covers the\n * common action-menu case and is built on these very parts.\n *\n * <Menu.Root>\n * <Menu.Trigger asChild><Button>Open</Button></Menu.Trigger>\n * <Menu.Content>\n * <Menu.Item startSection={<User />} onClick={openProfile}>Profile</Menu.Item>\n * <Menu.Divider />\n * <Menu.Item color=\"red\" startSection={<Trash />} onClick={remove}>Delete</Menu.Item>\n * </Menu.Content>\n * </Menu.Root>\n *\n * Portaled by default (escapes `overflow:hidden` ancestors), sized to content,\n * and animated via the kit's shared `popover-in/out` tokens.\n */\n\n/** Menu surface — the shared floating chrome, sized to content and scrollable\n * when tall. Unlike the form pickers' `popoverContent` (an `overflow-hidden`\n * clip around a nested scroller) a Menu scrolls natively, so Ark needs no\n * `scrollToIndexFn` workaround. */\nconst menuContent = cn(\n popoverChrome,\n \"flex w-max min-w-40 flex-col p-1\",\n \"max-h-[min(24rem,var(--available-height,24rem))] overflow-y-auto overscroll-contain\",\n)\n\n/** A single menu row — shared by `Item`, `CheckboxItem`, `RadioItem`, and\n * `SubTrigger` so every row is visually identical. Mirrors `popoverOption`'s\n * neutral look, but the `colored` variant swaps the text + highlight tints to\n * the palette slot vars (`--c-text` / `--c-soft`) resolved from `data-color` —\n * e.g. a red \"Delete\". Highlight is `data-highlighted`, selection is\n * `data-[state=checked]`, disabled is `data-disabled`, all owned by Ark. */\nconst menuItem = cva(\n [\n \"relative flex cursor-pointer items-center gap-2 rounded-xs px-2.5 py-1.5 text-md\",\n \"select-none outline-none\",\n \"data-[state=checked]:font-medium\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n ],\n {\n variants: {\n colored: {\n // Neutral highlight is transparent — a low-opacity black/white wash,\n // not an opaque gray — matching the surface's own background-dependent\n // tint (no Figma reference for this state yet).\n false: [\n TEXT_COLOR_CLASSES.primary,\n \"data-highlighted:bg-black/5 dark:data-highlighted:bg-white/8\",\n ],\n // Slot vars already shift by theme (colors.css), so no `dark:` needed.\n true: [\"text-(--c-text)\", \"data-highlighted:bg-(--c-soft)\"],\n },\n },\n defaultVariants: { colored: false },\n },\n)\n\n/** Hairline between groups of items. Same shade as Popover's own\n * Header/Footer/Body slotEdge dividers (brand-900/20 / white/15) — both are\n * separator lines on the identical popoverChrome panel, so they shouldn't\n * drift to different weights. */\nconst menuDivider = \"-mx-1 my-1 h-px border-0 bg-brand-900/20 dark:bg-white/15\"\n\ntype MenuPlacement = NonNullable<NonNullable<ArkMenu.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type MenuPosition = LogicalPosition<MenuPlacement>\n\nexport type MenuIconSlot = \"check\" | \"radio\" | \"submenu\"\nexport type MenuIcons = IconMap<MenuIconSlot>\n\n/**\n * The default icons: the checkbox item's check, the radio item's dot, and the\n * submenu trigger's chevron. The chevron points to where the submenu opens, the\n * inline end, so it mirrors under RTL; a consumer's icon is drawn as given.\n * The dot is a filled glyph, so it takes no `iconStroke`.\n */\nexport const DEFAULT_ICONS: Record<MenuIconSlot, ReactNode> = {\n check: <CheckIcon />,\n radio: (\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"5\" />\n </svg>\n ),\n submenu: <ChevronRightIcon className=\"rtl:-scale-x-100\" />,\n}\n\ntype MenuContextValue = {\n withinPortal: boolean\n container?: HTMLElement | null\n icons: Record<MenuIconSlot, ReactNode>\n}\nconst MenuContext = createContext<MenuContextValue>({ withinPortal: true, icons: DEFAULT_ICONS })\n\nexport type MenuRootProps = Omit<ArkMenu.RootProps, \"positioning\" | \"onOpenChange\"> & {\n /** Dropdown placement relative to the trigger. Prefer the logical `start` / `end`\n * sides (RTL-aware), or use any Ark placement (`bottom-start`, `top`, …).\n * Defaults to `\"bottom\"`. */\n position?: MenuPosition\n /** Gap in px between the trigger and the dropdown. */\n offset?: number\n /** Render the dropdown in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Called when the menu opens or closes (flattened from Ark's detail object). */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, outside interaction, item selection, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** Replaces the default icons: `check`, `radio`, `submenu`. Reaches every item and submenu\n * inside, drawn as given (never restroked or mirrored). */\n icons?: MenuIcons\n}\n\n/**\n * Selects a link item (`<Menu.Item asChild><Link/></Menu.Item>`) from the\n * keyboard. zag's default `navigate` dispatches `new MouseEvent(\"click\")`,\n * which doesn't bubble, so React's delegated `onClick` never sees it and a\n * router `Link` falls back to a full page load. `node.click()` dispatches a\n * bubbling click instead, which reaches the router. Deferred like zag's own,\n * so the menu settles before the navigation starts. A `navigate` prop still\n * overrides it.\n */\nconst clickLink: NonNullable<ArkMenu.RootProps[\"navigate\"]> = ({ node }) => {\n queueMicrotask(() => node.click())\n}\n\nconst Root = ({\n position = \"bottom\",\n offset,\n withinPortal = true,\n container,\n onOpenChange,\n onClose,\n icons,\n children,\n ...rest\n}: MenuRootProps) => {\n const { dir } = useLocaleContext()\n return (\n <MenuContext.Provider\n value={{ withinPortal, container, icons: mergeIcons(DEFAULT_ICONS, icons) }}\n >\n <ArkMenu.Root\n positioning={{ placement: resolveLogicalPlacement(position, dir), gutter: offset }}\n navigate={clickLink}\n onOpenChange={({ open }) => {\n onOpenChange?.(open)\n if (!open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </ArkMenu.Root>\n </MenuContext.Provider>\n )\n}\n\nexport type MenuContentProps = ArkMenu.ContentProps & WithTestId\n\nconst Content = ({ className, children, testId, ...rest }: MenuContentProps) => {\n const { withinPortal, container } = useContext(MenuContext)\n const portalContainer = useOverlayContainer(container)\n // Holds an enclosing Modal/Drawer/Popover open while the menu is; see `lib/overlay-layer.tsx`.\n useNestedLayer(useMenuContext().open)\n const panel = (\n <ArkMenu.Positioner>\n <ArkMenu.Content\n className={cn(menuContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </ArkMenu.Content>\n </ArkMenu.Positioner>\n )\n if (!withinPortal) return panel\n return <Portal container={portalContainer}>{panel}</Portal>\n}\n\n/** Shared inline-start wrapper for a `startSlot`. Sizes a bare icon to 16px\n * (`size-4`, like Button `md` / Input / Accordion) so every row's label starts\n * on the same column whatever icon it carries. Scoped to this slot — not the\n * whole row — so SVGs in `children` / `endSlot` and the row's own indicator\n * or chevron keep their sizes. `:where()` drops the rule to zero class\n * specificity, so a size class on the icon itself (`className=\"size-5\"`) still\n * wins; Lucide's `size` prop is only an HTML attribute and does not. */\nconst StartSlot = ({ children }: { children: ReactNode }) => (\n <span className=\"inline-flex shrink-0 items-center [:where(&)_svg]:size-4\">{children}</span>\n)\n\n/** Shared inline-end wrapper for an `endSlot` (pushes it to the far edge). */\nconst EndSlot = ({ children }: { children: ReactNode }) => (\n <span className={cn(\"ms-auto inline-flex shrink-0 items-center gap-2\", TEXT_COLOR_CLASSES.muted)}>\n {children}\n </span>\n)\n\n/** A row's leading slot, plus its former `startSection` spelling. */\nexport type MenuStartSlotProps = {\n /** Content before the label (usually an icon — a bare SVG is sized to 16px;\n * a size class on the icon overrides it). */\n startSlot?: ReactNode\n /** @deprecated Renamed `startSlot`, like the rest of the kit's leading slots.\n * Removed in the next minor. `startSlot` wins when both are set. */\n startSection?: ReactNode\n}\n\n/** A row's trailing slot, plus its former `endSection` spelling. */\nexport type MenuEndSlotProps = {\n /** Content after the label, pushed to the inline-end. */\n endSlot?: ReactNode\n /** @deprecated Renamed `endSlot`, like the rest of the kit's trailing slots.\n * Removed in the next minor. `endSlot` wins when both are set. */\n endSection?: ReactNode\n}\n\n/** Warns once when a part is still given a deprecated `*Section` slot. */\nconst warnSections = (part: string, start: ReactNode, end?: ReactNode) => {\n if (start !== undefined) warnRenamedProp(`Menu.${part}`, \"startSection\", \"startSlot\")\n if (end !== undefined) warnRenamedProp(`Menu.${part}`, \"endSection\", \"endSlot\")\n}\n\nexport type MenuItemProps = Omit<ArkMenu.ItemProps, \"value\" | \"onClick\" | \"onSelect\"> &\n WithTestId &\n MenuStartSlotProps &\n MenuEndSlotProps & {\n /** Unique value — used for type-ahead + the selection detail. Auto-generated\n * when omitted (Mantine-style items need no explicit value). */\n value?: string\n /** Palette for the row — colors the label + highlight tint (e.g. `\"red\"` for a\n * destructive action). Resolved from `data-color` via the slot vars. */\n color?: Color\n /** Fires when the item is selected — on click *and* keyboard activation\n * (Enter / Space), not just a pointer click. Wraps Ark's `onSelect`. */\n onClick?: () => void\n }\n\nconst Item = ({\n value,\n startSection,\n endSection,\n startSlot = startSection,\n endSlot = endSection,\n color,\n onClick,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuItemProps) => {\n const autoId = useId()\n warnSections(\"Item\", startSection, endSection)\n return (\n <ArkMenu.Item\n asChild={asChild}\n value={value ?? autoId}\n onSelect={onClick}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSlot != null && <StartSlot>{startSlot}</StartSlot>}\n {own}\n {endSlot != null && <EndSlot>{endSlot}</EndSlot>}\n </>\n ))}\n </ArkMenu.Item>\n )\n}\n\n/** Optional decorative leader for a section heading — the code-themed `// ` from\n * `Text`'s `prefix`. Hidden from screen readers and the clipboard\n * (`aria-hidden` + `select-none`); renders nothing when unset (off by default). */\nconst HeadingPrefix = ({ prefix }: { prefix: ReactNode }) =>\n prefix === undefined ? null : (\n <span aria-hidden=\"true\" className=\"select-none\">\n {prefix}\n </span>\n )\n\nexport type MenuLabelProps = Omit<ComponentPropsWithoutRef<\"div\">, \"prefix\"> &\n WithTestId & {\n /** Decorative leader before the label (e.g. `\"// \"`). Off by default; hidden\n * from screen readers and the clipboard. */\n prefix?: ReactNode\n }\n\n/** Standalone section heading (Mantine parity). For grouped items with proper\n * ARIA wiring, prefer `Menu.ItemGroup` + `Menu.ItemGroupLabel`. */\nconst Label = ({ className, prefix, children, testId, ...rest }: MenuLabelProps) => (\n <div className={cn(popoverGroupLabel, className)} {...props({ \"data-testid\": testId })} {...rest}>\n <HeadingPrefix prefix={prefix} />\n {children}\n </div>\n)\n\nexport type MenuItemGroupLabelProps = Omit<ArkMenu.ItemGroupLabelProps, \"prefix\"> &\n WithTestId & {\n /** Decorative leader before the label (e.g. `\"// \"`). Off by default; hidden\n * from screen readers and the clipboard. */\n prefix?: ReactNode\n }\n\nconst ItemGroupLabel = ({\n className,\n prefix,\n children,\n testId,\n asChild,\n ...rest\n}: MenuItemGroupLabelProps) => (\n <ArkMenu.ItemGroupLabel\n asChild={asChild}\n className={cn(popoverGroupLabel, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n <HeadingPrefix prefix={prefix} />\n {own}\n </>\n ))}\n </ArkMenu.ItemGroupLabel>\n)\n\nconst Divider = ({ className, testId, ...rest }: ArkMenu.SeparatorProps & WithTestId) => (\n <ArkMenu.Separator\n className={cn(menuDivider, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type MenuCheckboxItemProps = ArkMenu.CheckboxItemProps &\n WithTestId &\n MenuStartSlotProps & {\n color?: Color\n }\n\nconst CheckboxItem = ({\n startSection,\n startSlot = startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuCheckboxItemProps) => {\n const { icons } = useContext(MenuContext)\n warnSections(\"CheckboxItem\", startSection)\n return (\n <ArkMenu.CheckboxItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSlot != null && <StartSlot>{startSlot}</StartSlot>}\n {own}\n <ArkMenu.ItemIndicator className={popoverIndicator}>{icons.check}</ArkMenu.ItemIndicator>\n </>\n ))}\n </ArkMenu.CheckboxItem>\n )\n}\n\nexport type MenuRadioGroupProps = Omit<\n ArkMenu.RadioItemGroupProps,\n \"onValueChange\" | \"onChange\"\n> & {\n /** Called with the newly selected value (flattened from Ark's detail object). */\n onChange?: (value: string) => void\n}\n\nconst RadioGroup = ({ onChange, ...rest }: MenuRadioGroupProps) => (\n <ArkMenu.RadioItemGroup\n onValueChange={onChange ? ({ value }) => onChange(value) : undefined}\n {...rest}\n />\n)\n\nexport type MenuRadioItemProps = ArkMenu.RadioItemProps &\n WithTestId &\n MenuStartSlotProps & {\n color?: Color\n }\n\nconst RadioItem = ({\n startSection,\n startSlot = startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuRadioItemProps) => {\n const { icons } = useContext(MenuContext)\n warnSections(\"RadioItem\", startSection)\n return (\n <ArkMenu.RadioItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSlot != null && <StartSlot>{startSlot}</StartSlot>}\n {own}\n <ArkMenu.ItemIndicator className={popoverIndicator}>{icons.radio}</ArkMenu.ItemIndicator>\n </>\n ))}\n </ArkMenu.RadioItem>\n )\n}\n\nexport type MenuSubProps = Omit<ArkMenu.RootProps, \"positioning\"> & {\n /** Gap in px between the trigger row and the submenu. Ark manages submenu\n * *placement* itself (RTL-aware `right-start` / `left-start`, flush to the\n * parent), so only this main-axis gap is adjustable. Defaults to `10`. */\n offset?: number\n}\n\n/** A submenu opens flush to its trigger row, so its first item lands one surface\n * inset *below* the trigger — the `menuContent` top border (1px) + top padding\n * (`p-1` = 4px). Nudging the submenu up by that inset lines the first sub-item\n * up with the trigger row. Cross-axis is the vertical axis for the (Ark-forced)\n * `right-start` / `left-start` placements, and Floating UI maps a negative value\n * to \"up\" in both directions — so one constant covers LTR and RTL. */\nconst SUBMENU_ALIGN_OFFSET = -5\n\n/** Submenu root — a nested Ark Menu whose triggering row is `Menu.SubTrigger`.\n * Inherits the parent's portal settings via context (see `Menu.SubContent`).\n *\n * Ark's menu machine hard-overrides a submenu's placement and `gutter` (to `0`),\n * so a `gutter`-based offset is silently dropped. It leaves `offset` untouched,\n * and Floating UI resolves the axes as `offset.mainAxis ?? gutter` (the gap) and\n * `offset.crossAxis` (the top alignment) — so the whole `offset` object is the\n * one path that survives the override. */\nconst Sub = ({ offset = 10, children, ...rest }: MenuSubProps) => (\n <ArkMenu.Root\n positioning={{ offset: { mainAxis: offset, crossAxis: SUBMENU_ALIGN_OFFSET } }}\n navigate={clickLink}\n {...rest}\n >\n {children}\n </ArkMenu.Root>\n)\n\nexport type MenuSubTriggerProps = ArkMenu.TriggerItemProps &\n WithTestId &\n MenuStartSlotProps & {\n color?: Color\n }\n\nconst SubTrigger = ({\n startSection,\n startSlot = startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuSubTriggerProps) => {\n const { icons } = useContext(MenuContext)\n warnSections(\"SubTrigger\", startSection)\n return (\n <ArkMenu.TriggerItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSlot != null && <StartSlot>{startSlot}</StartSlot>}\n {own}\n <span className={cn(popoverChevron, \"ms-auto -me-1 [&_svg]:size-4\")}>\n {icons.submenu}\n </span>\n </>\n ))}\n </ArkMenu.TriggerItem>\n )\n}\n\nexport {\n CheckboxItem,\n Content,\n Divider,\n Item,\n ItemGroupLabel,\n Label,\n RadioGroup,\n RadioItem,\n Root,\n Sub,\n SubTrigger,\n}\n\nexport type MenuTriggerProps = ArkMenu.TriggerProps & WithTestId & { ref?: Ref<HTMLButtonElement> }\n\n/** Ark's `Menu.Trigger` minus one handler. Zag's trigger calls `preventDefault()`\n * on `pointerdown`, which cancels the browser's own mouse-down focus of the\n * button. With no pointer-initiated focus on record, Chromium treats every\n * later *programmatic* focus as keyboard-like: Zag's `focus()` on the content\n * when the menu opens, and its `focus()` back on the trigger when it closes,\n * both match `:focus-visible`, so a mouse user gets the keyboard ring on the\n * trigger after every menu interaction (#227).\n *\n * Leaving `pointerdown` alone restores the platform behaviour — the click\n * focuses the button without a ring, and the programmatic focuses that follow\n * inherit that. Keyboard users keep the ring, since a Tab/Enter/Escape still\n * marks the focus as keyboard-driven. It's also how Zag's own Popover trigger\n * behaves (it never cancels `pointerdown`). */\nexport const Trigger = ({ ref, value, className, testId, ...rest }: MenuTriggerProps) => {\n const menu = useMenuContext()\n const presence = usePresenceContext()\n const { onPointerDown: _cancelsNativeFocus, ...trigger } = menu.getTriggerProps({ value })\n return (\n <ark.button\n {...mergeProps(\n {\n ...trigger,\n \"aria-controls\": presence.unmounted ? undefined : trigger[\"aria-controls\"],\n // The canceled `pointerdown` also blocked a native drag as a side\n // effect: an `asChild` `<a href>`, or the `<img>` of an avatar\n // trigger, would otherwise lift a drag ghost off the trigger.\n // Canceling `dragstart` instead leaves the press, and its focus, alone.\n onDragStart: (event: DragEvent) => event.preventDefault(),\n },\n // Same side effect for text: a double-click or drag on a non-button\n // trigger (`asChild` + `<span role=\"button\">`) would select its label.\n // CSS restores that. It lands on the `asChild` child too, and the\n // consumer's `className` comes last so it can override it.\n { ...props({ \"data-testid\": testId }), ...rest, className: cn(\"select-none\", className) },\n )}\n ref={ref}\n />\n )\n}\n\n/** Ark parts re-exported unchanged (no styling needed). */\nexport const ContextTrigger = ArkMenu.ContextTrigger\nexport const ItemGroup = ArkMenu.ItemGroup\nexport const Context = ArkMenu.Context\n/** Alias for `Divider` (Ark's name for the same part). */\nexport const Separator = Divider\n/** Submenu dropdown — identical surface + portalling to `Menu.Content`. */\nexport const SubContent = Content\n"]}
1
+ {"version":3,"sources":["../src/components/menu/menu.tsx"],"names":["ArkMenu"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgEA,IAAM,WAAA,GAAc,EAAA;AAAA,EAClB,aAAA;AAAA,EACA,kCAAA;AAAA,EACA;AACF,CAAA;AAQA,IAAM,QAAA,GAAW,GAAA;AAAA,EACf;AAAA,IACE,kFAAA;AAAA,IACA,0BAAA;AAAA,IACA,kCAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA,QAIP,KAAA,EAAO;AAAA,UACL,kBAAA,CAAmB,OAAA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,IAAA,CAAQ;AAC1B,IAAM,UAAUA,IAAA,CAAQ;AAExB,IAAM,SAAA,GAAY;AAElB,IAAM,UAAA,GAAa","file":"chunk-RCF7HTG5.js","sourcesContent":["\"use client\"\n\nimport { ark } from \"@ark-ui/react/factory\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Menu as ArkMenu, useMenuContext } from \"@ark-ui/react/menu\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresenceContext } from \"@ark-ui/react/presence\"\nimport { mergeProps } from \"@ark-ui/react/utils\"\nimport { cva } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type DragEvent,\n type ReactNode,\n type Ref,\n useContext,\n useId,\n} from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport { type IconMap, mergeIcons } from \"../../lib/icons\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { useNestedLayer } from \"../../lib/overlay-layer\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { CheckIcon, ChevronRightIcon } from \"../popover/icons\"\nimport {\n popoverChevron,\n popoverChrome,\n popoverGroupLabel,\n popoverIndicator,\n} from \"../popover/popover\"\n\n/**\n * Menu — the kit's dropdown of actions, a styled layer over Ark UI's Menu.\n * It's the click-triggered sibling of `Popover` (a free-form panel): Ark's Menu\n * machine wires roving focus, type-ahead, `role=\"menu\"` / `menuitem`,\n * `aria-haspopup` / `aria-expanded`, submenus, and checkbox / radio selection.\n *\n * Two ways to use it — the compound parts (this file) give full control; the\n * data-driven `<Menu data={…}>` convenience (see `menu-data.tsx`) covers the\n * common action-menu case and is built on these very parts.\n *\n * <Menu.Root>\n * <Menu.Trigger asChild><Button>Open</Button></Menu.Trigger>\n * <Menu.Content>\n * <Menu.Item startSection={<User />} onClick={openProfile}>Profile</Menu.Item>\n * <Menu.Divider />\n * <Menu.Item color=\"red\" startSection={<Trash />} onClick={remove}>Delete</Menu.Item>\n * </Menu.Content>\n * </Menu.Root>\n *\n * Portaled by default (escapes `overflow:hidden` ancestors), sized to content,\n * and animated via the kit's shared `popover-in/out` tokens.\n */\n\n/** Menu surface — the shared floating chrome, sized to content and scrollable\n * when tall. Unlike the form pickers' `popoverContent` (an `overflow-hidden`\n * clip around a nested scroller) a Menu scrolls natively, so Ark needs no\n * `scrollToIndexFn` workaround. */\nconst menuContent = cn(\n popoverChrome,\n \"flex w-max min-w-40 flex-col p-1\",\n \"max-h-[min(24rem,var(--available-height,24rem))] overflow-y-auto overscroll-contain\",\n)\n\n/** A single menu row — shared by `Item`, `CheckboxItem`, `RadioItem`, and\n * `SubTrigger` so every row is visually identical. Mirrors `popoverOption`'s\n * neutral look, but the `colored` variant swaps the text + highlight tints to\n * the palette slot vars (`--c-text` / `--c-soft`) resolved from `data-color` —\n * e.g. a red \"Delete\". Highlight is `data-highlighted`, selection is\n * `data-[state=checked]`, disabled is `data-disabled`, all owned by Ark. */\nconst menuItem = cva(\n [\n \"relative flex cursor-pointer items-center gap-2 rounded-xs px-2.5 py-1.5 text-md\",\n \"select-none outline-none\",\n \"data-[state=checked]:font-medium\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n ],\n {\n variants: {\n colored: {\n // Neutral highlight is transparent — a low-opacity black/white wash,\n // not an opaque gray — matching the surface's own background-dependent\n // tint (no Figma reference for this state yet).\n false: [\n TEXT_COLOR_CLASSES.primary,\n \"data-highlighted:bg-black/5 dark:data-highlighted:bg-white/8\",\n ],\n // Slot vars already shift by theme (colors.css), so no `dark:` needed.\n true: [\"text-(--c-text)\", \"data-highlighted:bg-(--c-soft)\"],\n },\n },\n defaultVariants: { colored: false },\n },\n)\n\n/** Hairline between groups of items. Same shade as Popover's own\n * Header/Footer/Body slotEdge dividers (brand-900/20 / white/15) — both are\n * separator lines on the identical popoverChrome panel, so they shouldn't\n * drift to different weights. */\nconst menuDivider = \"-mx-1 my-1 h-px border-0 bg-brand-900/20 dark:bg-white/15\"\n\ntype MenuPlacement = NonNullable<NonNullable<ArkMenu.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type MenuPosition = LogicalPosition<MenuPlacement>\n\nexport type MenuIconSlot = \"check\" | \"radio\" | \"submenu\"\nexport type MenuIcons = IconMap<MenuIconSlot>\n\n/**\n * The default icons: the checkbox item's check, the radio item's dot, and the\n * submenu trigger's chevron. The chevron points to where the submenu opens, the\n * inline end, so it mirrors under RTL; a consumer's icon is drawn as given.\n * The dot is a filled glyph, so it takes no `iconStroke`.\n */\nexport const DEFAULT_ICONS: Record<MenuIconSlot, ReactNode> = {\n check: <CheckIcon />,\n radio: (\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"5\" />\n </svg>\n ),\n submenu: <ChevronRightIcon className=\"rtl:-scale-x-100\" />,\n}\n\ntype MenuContextValue = {\n withinPortal: boolean\n container?: HTMLElement | null\n icons: Record<MenuIconSlot, ReactNode>\n}\nconst MenuContext = createContext<MenuContextValue>({ withinPortal: true, icons: DEFAULT_ICONS })\n\nexport type MenuRootProps = Omit<ArkMenu.RootProps, \"positioning\" | \"onOpenChange\"> & {\n /** Dropdown placement relative to the trigger. Prefer the logical `start` / `end`\n * sides (RTL-aware), or use any Ark placement (`bottom-start`, `top`, …).\n * Defaults to `\"bottom\"`. */\n position?: MenuPosition\n /** Gap in px between the trigger and the dropdown. */\n offset?: number\n /** Render the dropdown in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Called when the menu opens or closes (flattened from Ark's detail object). */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, outside interaction, item selection, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** Replaces the default icons: `check`, `radio`, `submenu`. Reaches every item and submenu\n * inside, drawn as given (never restroked or mirrored). */\n icons?: MenuIcons\n}\n\n/**\n * Selects a link item (`<Menu.Item asChild><Link/></Menu.Item>`) from the\n * keyboard. zag's default `navigate` dispatches `new MouseEvent(\"click\")`,\n * which doesn't bubble, so React's delegated `onClick` never sees it and a\n * router `Link` falls back to a full page load. `node.click()` dispatches a\n * bubbling click instead, which reaches the router. Deferred like zag's own,\n * so the menu settles before the navigation starts. A `navigate` prop still\n * overrides it.\n */\nconst clickLink: NonNullable<ArkMenu.RootProps[\"navigate\"]> = ({ node }) => {\n queueMicrotask(() => node.click())\n}\n\nconst Root = ({\n position = \"bottom\",\n offset,\n withinPortal = true,\n container,\n onOpenChange,\n onClose,\n icons,\n children,\n ...rest\n}: MenuRootProps) => {\n const { dir } = useLocaleContext()\n return (\n <MenuContext.Provider\n value={{ withinPortal, container, icons: mergeIcons(DEFAULT_ICONS, icons) }}\n >\n <ArkMenu.Root\n positioning={{ placement: resolveLogicalPlacement(position, dir), gutter: offset }}\n navigate={clickLink}\n onOpenChange={({ open }) => {\n onOpenChange?.(open)\n if (!open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </ArkMenu.Root>\n </MenuContext.Provider>\n )\n}\n\nexport type MenuContentProps = ArkMenu.ContentProps & WithTestId\n\nconst Content = ({ className, children, testId, ...rest }: MenuContentProps) => {\n const { withinPortal, container } = useContext(MenuContext)\n const portalContainer = useOverlayContainer(container)\n // Holds an enclosing Modal/Drawer/Popover open while the menu is; see `lib/overlay-layer.tsx`.\n useNestedLayer(useMenuContext().open)\n const panel = (\n <ArkMenu.Positioner>\n <ArkMenu.Content\n className={cn(menuContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </ArkMenu.Content>\n </ArkMenu.Positioner>\n )\n if (!withinPortal) return panel\n return <Portal container={portalContainer}>{panel}</Portal>\n}\n\n/** Shared inline-start wrapper for a `startSlot`. Sizes a bare icon to 16px\n * (`size-4`, like Button `md` / Input / Accordion) so every row's label starts\n * on the same column whatever icon it carries. Scoped to this slot — not the\n * whole row — so SVGs in `children` / `endSlot` and the row's own indicator\n * or chevron keep their sizes. `:where()` drops the rule to zero class\n * specificity, so a size class on the icon itself (`className=\"size-5\"`) still\n * wins; Lucide's `size` prop is only an HTML attribute and does not. */\nconst StartSlot = ({ children }: { children: ReactNode }) => (\n <span className=\"inline-flex shrink-0 items-center [:where(&)_svg]:size-4\">{children}</span>\n)\n\n/** Shared inline-end wrapper for an `endSlot` (pushes it to the far edge). */\nconst EndSlot = ({ children }: { children: ReactNode }) => (\n <span className={cn(\"ms-auto inline-flex shrink-0 items-center gap-2\", TEXT_COLOR_CLASSES.muted)}>\n {children}\n </span>\n)\n\n/** A row's leading slot, plus its former `startSection` spelling. */\nexport type MenuStartSlotProps = {\n /** Content before the label (usually an icon — a bare SVG is sized to 16px;\n * a size class on the icon overrides it). */\n startSlot?: ReactNode\n /** @deprecated Renamed `startSlot`, like the rest of the kit's leading slots.\n * Removed in the next minor. `startSlot` wins when both are set. */\n startSection?: ReactNode\n}\n\n/** A row's trailing slot, plus its former `endSection` spelling. */\nexport type MenuEndSlotProps = {\n /** Content after the label, pushed to the inline-end. */\n endSlot?: ReactNode\n /** @deprecated Renamed `endSlot`, like the rest of the kit's trailing slots.\n * Removed in the next minor. `endSlot` wins when both are set. */\n endSection?: ReactNode\n}\n\n/** Warns once when a part is still given a deprecated `*Section` slot. */\nconst warnSections = (part: string, start: ReactNode, end?: ReactNode) => {\n if (start !== undefined) warnRenamedProp(`Menu.${part}`, \"startSection\", \"startSlot\")\n if (end !== undefined) warnRenamedProp(`Menu.${part}`, \"endSection\", \"endSlot\")\n}\n\nexport type MenuItemProps = Omit<ArkMenu.ItemProps, \"value\" | \"onClick\" | \"onSelect\"> &\n WithTestId &\n MenuStartSlotProps &\n MenuEndSlotProps & {\n /** Unique value — used for type-ahead + the selection detail. Auto-generated\n * when omitted (Mantine-style items need no explicit value). */\n value?: string\n /** Palette for the row — colors the label + highlight tint (e.g. `\"red\"` for a\n * destructive action). Resolved from `data-color` via the slot vars. */\n color?: Color\n /** Fires when the item is selected — on click *and* keyboard activation\n * (Enter / Space), not just a pointer click. Wraps Ark's `onSelect`. */\n onClick?: () => void\n }\n\nconst Item = ({\n value,\n startSection,\n endSection,\n startSlot = startSection,\n endSlot = endSection,\n color,\n onClick,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuItemProps) => {\n const autoId = useId()\n warnSections(\"Item\", startSection, endSection)\n return (\n <ArkMenu.Item\n asChild={asChild}\n value={value ?? autoId}\n onSelect={onClick}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSlot != null && <StartSlot>{startSlot}</StartSlot>}\n {own}\n {endSlot != null && <EndSlot>{endSlot}</EndSlot>}\n </>\n ))}\n </ArkMenu.Item>\n )\n}\n\n/** Optional decorative leader for a section heading — the code-themed `// ` from\n * `Text`'s `prefix`. Hidden from screen readers and the clipboard\n * (`aria-hidden` + `select-none`); renders nothing when unset (off by default). */\nconst HeadingPrefix = ({ prefix }: { prefix: ReactNode }) =>\n prefix === undefined ? null : (\n <span aria-hidden=\"true\" className=\"select-none\">\n {prefix}\n </span>\n )\n\nexport type MenuLabelProps = Omit<ComponentPropsWithoutRef<\"div\">, \"prefix\"> &\n WithTestId & {\n /** Decorative leader before the label (e.g. `\"// \"`). Off by default; hidden\n * from screen readers and the clipboard. */\n prefix?: ReactNode\n }\n\n/** Standalone section heading (Mantine parity). For grouped items with proper\n * ARIA wiring, prefer `Menu.ItemGroup` + `Menu.ItemGroupLabel`. */\nconst Label = ({ className, prefix, children, testId, ...rest }: MenuLabelProps) => (\n <div className={cn(popoverGroupLabel, className)} {...props({ \"data-testid\": testId })} {...rest}>\n <HeadingPrefix prefix={prefix} />\n {children}\n </div>\n)\n\nexport type MenuItemGroupLabelProps = Omit<ArkMenu.ItemGroupLabelProps, \"prefix\"> &\n WithTestId & {\n /** Decorative leader before the label (e.g. `\"// \"`). Off by default; hidden\n * from screen readers and the clipboard. */\n prefix?: ReactNode\n }\n\nconst ItemGroupLabel = ({\n className,\n prefix,\n children,\n testId,\n asChild,\n ...rest\n}: MenuItemGroupLabelProps) => (\n <ArkMenu.ItemGroupLabel\n asChild={asChild}\n className={cn(popoverGroupLabel, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n <HeadingPrefix prefix={prefix} />\n {own}\n </>\n ))}\n </ArkMenu.ItemGroupLabel>\n)\n\nconst Divider = ({ className, testId, ...rest }: ArkMenu.SeparatorProps & WithTestId) => (\n <ArkMenu.Separator\n className={cn(menuDivider, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type MenuCheckboxItemProps = ArkMenu.CheckboxItemProps &\n WithTestId &\n MenuStartSlotProps & {\n color?: Color\n }\n\nconst CheckboxItem = ({\n startSection,\n startSlot = startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuCheckboxItemProps) => {\n const { icons } = useContext(MenuContext)\n warnSections(\"CheckboxItem\", startSection)\n return (\n <ArkMenu.CheckboxItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSlot != null && <StartSlot>{startSlot}</StartSlot>}\n {own}\n <ArkMenu.ItemIndicator className={popoverIndicator}>{icons.check}</ArkMenu.ItemIndicator>\n </>\n ))}\n </ArkMenu.CheckboxItem>\n )\n}\n\nexport type MenuRadioGroupProps = Omit<\n ArkMenu.RadioItemGroupProps,\n \"onValueChange\" | \"onChange\"\n> & {\n /** Called with the newly selected value (flattened from Ark's detail object). */\n onChange?: (value: string) => void\n}\n\nconst RadioGroup = ({ onChange, ...rest }: MenuRadioGroupProps) => (\n <ArkMenu.RadioItemGroup\n onValueChange={onChange ? ({ value }) => onChange(value) : undefined}\n {...rest}\n />\n)\n\nexport type MenuRadioItemProps = ArkMenu.RadioItemProps &\n WithTestId &\n MenuStartSlotProps & {\n color?: Color\n }\n\nconst RadioItem = ({\n startSection,\n startSlot = startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuRadioItemProps) => {\n const { icons } = useContext(MenuContext)\n warnSections(\"RadioItem\", startSection)\n return (\n <ArkMenu.RadioItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSlot != null && <StartSlot>{startSlot}</StartSlot>}\n {own}\n <ArkMenu.ItemIndicator className={popoverIndicator}>{icons.radio}</ArkMenu.ItemIndicator>\n </>\n ))}\n </ArkMenu.RadioItem>\n )\n}\n\nexport type MenuSubProps = Omit<ArkMenu.RootProps, \"positioning\"> & {\n /** Gap in px between the trigger row and the submenu. Ark manages submenu\n * *placement* itself (RTL-aware `right-start` / `left-start`, flush to the\n * parent), so only this main-axis gap is adjustable. Defaults to `10`. */\n offset?: number\n}\n\n/** A submenu opens flush to its trigger row, so its first item lands one surface\n * inset *below* the trigger — the `menuContent` top border (1px) + top padding\n * (`p-1` = 4px). Nudging the submenu up by that inset lines the first sub-item\n * up with the trigger row. Cross-axis is the vertical axis for the (Ark-forced)\n * `right-start` / `left-start` placements, and Floating UI maps a negative value\n * to \"up\" in both directions — so one constant covers LTR and RTL. */\nconst SUBMENU_ALIGN_OFFSET = -5\n\n/** Submenu root — a nested Ark Menu whose triggering row is `Menu.SubTrigger`.\n * Inherits the parent's portal settings via context (see `Menu.SubContent`).\n *\n * Ark's menu machine hard-overrides a submenu's placement and `gutter` (to `0`),\n * so a `gutter`-based offset is silently dropped. It leaves `offset` untouched,\n * and Floating UI resolves the axes as `offset.mainAxis ?? gutter` (the gap) and\n * `offset.crossAxis` (the top alignment) — so the whole `offset` object is the\n * one path that survives the override. */\nconst Sub = ({ offset = 10, children, ...rest }: MenuSubProps) => (\n <ArkMenu.Root\n positioning={{ offset: { mainAxis: offset, crossAxis: SUBMENU_ALIGN_OFFSET } }}\n navigate={clickLink}\n {...rest}\n >\n {children}\n </ArkMenu.Root>\n)\n\nexport type MenuSubTriggerProps = ArkMenu.TriggerItemProps &\n WithTestId &\n MenuStartSlotProps & {\n color?: Color\n }\n\nconst SubTrigger = ({\n startSection,\n startSlot = startSection,\n color,\n className,\n children,\n testId,\n asChild,\n ...rest\n}: MenuSubTriggerProps) => {\n const { icons } = useContext(MenuContext)\n warnSections(\"SubTrigger\", startSection)\n return (\n <ArkMenu.TriggerItem\n asChild={asChild}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {startSlot != null && <StartSlot>{startSlot}</StartSlot>}\n {own}\n <span className={cn(popoverChevron, \"ms-auto -me-1 [&_svg]:size-4\")}>\n {icons.submenu}\n </span>\n </>\n ))}\n </ArkMenu.TriggerItem>\n )\n}\n\nexport {\n CheckboxItem,\n Content,\n Divider,\n Item,\n ItemGroupLabel,\n Label,\n RadioGroup,\n RadioItem,\n Root,\n Sub,\n SubTrigger,\n}\n\nexport type MenuTriggerProps = ArkMenu.TriggerProps & WithTestId & { ref?: Ref<HTMLButtonElement> }\n\n/** Ark's `Menu.Trigger` minus one handler. Zag's trigger calls `preventDefault()`\n * on `pointerdown`, which cancels the browser's own mouse-down focus of the\n * button. With no pointer-initiated focus on record, Chromium treats every\n * later *programmatic* focus as keyboard-like: Zag's `focus()` on the content\n * when the menu opens, and its `focus()` back on the trigger when it closes,\n * both match `:focus-visible`, so a mouse user gets the keyboard ring on the\n * trigger after every menu interaction (#227).\n *\n * Leaving `pointerdown` alone restores the platform behaviour — the click\n * focuses the button without a ring, and the programmatic focuses that follow\n * inherit that. Keyboard users keep the ring, since a Tab/Enter/Escape still\n * marks the focus as keyboard-driven. It's also how Zag's own Popover trigger\n * behaves (it never cancels `pointerdown`). */\nexport const Trigger = ({ ref, value, className, testId, ...rest }: MenuTriggerProps) => {\n const menu = useMenuContext()\n const presence = usePresenceContext()\n const { onPointerDown: _cancelsNativeFocus, ...trigger } = menu.getTriggerProps({ value })\n return (\n <ark.button\n {...mergeProps(\n {\n ...trigger,\n \"aria-controls\": presence.unmounted ? undefined : trigger[\"aria-controls\"],\n // The canceled `pointerdown` also blocked a native drag as a side\n // effect: an `asChild` `<a href>`, or the `<img>` of an avatar\n // trigger, would otherwise lift a drag ghost off the trigger.\n // Canceling `dragstart` instead leaves the press, and its focus, alone.\n onDragStart: (event: DragEvent) => event.preventDefault(),\n },\n // Same side effect for text: a double-click or drag on a non-button\n // trigger (`asChild` + `<span role=\"button\">`) would select its label.\n // CSS restores that. It lands on the `asChild` child too, and the\n // consumer's `className` comes last so it can override it.\n { ...props({ \"data-testid\": testId }), ...rest, className: cn(\"select-none\", className) },\n )}\n ref={ref}\n />\n )\n}\n\n/** Ark parts re-exported unchanged (no styling needed). */\nexport const ContextTrigger = ArkMenu.ContextTrigger\nexport const ItemGroup = ArkMenu.ItemGroup\nexport const Context = ArkMenu.Context\n/** Alias for `Divider` (Ark's name for the same part). */\nexport const Separator = Divider\n/** Submenu dropdown — identical surface + portalling to `Menu.Content`. */\nexport const SubContent = Content\n"]}
@@ -1,6 +1,6 @@
1
1
  import { props } from './chunk-WYCMIIRR.js';
2
2
  import { TYPOGRAPHY_SHADE_CLASSES } from './chunk-GIPQUKCN.js';
3
- import { cn } from './chunk-QP4I37PA.js';
3
+ import { cn } from './chunk-4ASNIDV7.js';
4
4
  import { ark } from '@ark-ui/react';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -95,5 +95,5 @@ var Divider = ({
95
95
  };
96
96
 
97
97
  export { Divider };
98
- //# sourceMappingURL=chunk-SE3CGQRO.js.map
99
- //# sourceMappingURL=chunk-SE3CGQRO.js.map
98
+ //# sourceMappingURL=chunk-RLOWPCGG.js.map
99
+ //# sourceMappingURL=chunk-RLOWPCGG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/divider/divider.tsx"],"names":[],"mappings":";;;;;;;AA8BA,IAAM,eAAA,GAAkB,GAAA,CAAI,CAAC,UAAU,CAAA,EAAG;AAAA,EACxC,QAAA,EAAU;AAAA;AAAA;AAAA,IAGR,WAAA,EAAa,EAAE,UAAA,EAAY,EAAA,EAAI,UAAU,EAAA,EAAG;AAAA,IAC5C,IAAA,EAAM,EAAE,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAG;AAAA;AAAA;AAAA;AAAA,IAI/C,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,cAAA;AAAA,MACP,MAAA,EAAQ,eAAA;AAAA,MACR,MAAA,EAAQ;AAAA;AACV,GACF;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,EAAE,WAAA,EAAa,YAAA,EAAc,IAAA,EAAM,IAAA,EAAM,OAAO,UAAA,EAAW;AAAA,IAC3D,EAAE,WAAA,EAAa,YAAA,EAAc,IAAA,EAAM,IAAA,EAAM,OAAO,YAAA,EAAa;AAAA,IAC7D,EAAE,WAAA,EAAa,YAAA,EAAc,IAAA,EAAM,IAAA,EAAM,OAAO,gBAAA,EAAiB;AAAA,IACjE,EAAE,WAAA,EAAa,YAAA,EAAc,IAAA,EAAM,IAAA,EAAM,OAAO,YAAA,EAAa;AAAA,IAC7D,EAAE,WAAA,EAAa,YAAA,EAAc,IAAA,EAAM,IAAA,EAA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A,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA,CAAI,GAAA;AAAA,IAAJ;AAAA,MACE,GAAI,QAAQ,IAAA,GAAO,SAAA;AAAA,MACpB,oBAAkB,WAAA,IAAe,YAAA;AAAA,MACjC,YAAA,EAAY,KAAA;AAAA,MACX,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,EAAA;AAAA,QACT,KAAA,GACI,CAAC,yBAAA,EAA2B,UAAA,GAAa,uBAAA,GAA0B,QAAQ,CAAA,GAC3E,CAAC,SAAA,EAAW,UAAA,GAAa,cAAA,GAAiB,QAAQ,CAAA;AAAA,QACtD;AAAA,OACF;AAAA,MAEC,mCACC,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,WAAA,EAAU,MAAA;AAAA,YACT,GAAG,SAAA;AAAA,YACJ,WAAW,EAAA,CAAG,SAAA,EAAW,QAAA,EAAU,aAAA,KAAkB,WAAW,QAAQ;AAAA;AAAA,SAC1E;AAAA,4BACC,MAAA,EAAA,EAAK,WAAA,EAAU,OAAA,EAAQ,SAAA,EAAW,YAChC,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,wBACA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,WAAA,EAAU,MAAA;AAAA,YACT,GAAG,SAAA;AAAA,YACJ,WAAW,EAAA,CAAG,SAAA,EAAW,QAAA,EAAU,aAAA,KAAkB,SAAS,QAAQ;AAAA;AAAA;AACxE,OAAA,EACF;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-SE3CGQRO.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactNode } from \"react\"\nimport type { Align } from \"../../lib/align\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * `size` here only ever controls border thickness (1–5px, Mantine's own\n * xs..xl mapping) — unlike Timeline's density `size`, there's no parent/\n * child override relationship to defeat via a CSS custom property, so\n * thickness is a plain `(orientation × size)` compound lookup, the simpler\n * of the two mechanisms this kit uses for a sized dimension.\n *\n * Horizontal orientation's thickness sits on the block axis (`border-t`) —\n * RTL never touches top/bottom, so a physical property is fine, same split\n * `ButtonGroup` uses between its own horizontal/vertical orientations.\n * Vertical orientation's thickness sits on the inline axis, so it uses the\n * logical `border-s` (border-inline-start) instead, matching Timeline's own\n * vertical connecting line.\n *\n * Tailwind's default border-width scale has no 3px/5px step, hence the\n * arbitrary `[Npx]` values below — static literals (not interpolated) so\n * Tailwind v4's scanner keeps them.\n */\nconst dividerVariants = cva([\"shrink-0\"], {\n variants: {\n // No own classes — matched by `compoundVariants` only, the same\n // internal-only pattern `timelineBulletVariants`'s `ringed` axis uses.\n orientation: { horizontal: \"\", vertical: \"\" },\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // A different vocabulary than the kit's shape axis (filled/light/\n // outline/subtle/default) — same precedent as Timeline's own local\n // `TimelineLineVariant`.\n variant: {\n solid: \"border-solid\",\n dashed: \"border-dashed\",\n dotted: \"border-dotted\",\n },\n },\n compoundVariants: [\n { orientation: \"horizontal\", size: \"xs\", class: \"border-t\" },\n { orientation: \"horizontal\", size: \"sm\", class: \"border-t-2\" },\n { orientation: \"horizontal\", size: \"md\", class: \"border-t-[3px]\" },\n { orientation: \"horizontal\", size: \"lg\", class: \"border-t-4\" },\n { orientation: \"horizontal\", size: \"xl\", class: \"border-t-[5px]\" },\n { orientation: \"vertical\", size: \"xs\", class: \"border-s\" },\n { orientation: \"vertical\", size: \"sm\", class: \"border-s-2\" },\n { orientation: \"vertical\", size: \"md\", class: \"border-s-[3px]\" },\n { orientation: \"vertical\", size: \"lg\", class: \"border-s-4\" },\n { orientation: \"vertical\", size: \"xl\", class: \"border-s-[5px]\" },\n ],\n defaultVariants: { orientation: \"horizontal\", size: \"xs\", variant: \"solid\" },\n})\n\nexport type DividerOrientation = NonNullable<VariantProps<typeof dividerVariants>[\"orientation\"]>\nexport type DividerVariant = NonNullable<VariantProps<typeof dividerVariants>[\"variant\"]>\n/** Divider's thickness scale is the kit's canonical `Size` (xs–xl). */\nexport type DividerSize = Size\nexport type DividerLabelPosition = Align\n\nexport type DividerProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"children\">> &\n VariantProps<typeof dividerVariants> &\n WithTestId & {\n /**\n * Accent palette for the line. Re-exported as `Color` from `@42/ui-react`.\n * Unset renders a neutral hairline — it deliberately does not fall\n * through to `--c-solid` (that cascades to a bold black/white default at\n * `:root`, wrong for a hairline).\n */\n color?: Color\n /**\n * Content centered on the line (a word, an icon). Renders as three real\n * flex children — a leading line, the label, a trailing line — rather\n * than `::before`/`::after` pseudo-elements, matching Timeline's own line\n * convention. The label text is small (`text-xs`) in the muted text tier\n * (or the palette's `--c-text` when `color` is set): quiet enough to read\n * as part of the separator, but still at text contrast — the line's own\n * hairline colour is far too faint for words. The label is real content,\n * so `role=\"separator\"` moves onto the two line segments and the label\n * stays in the accessibility tree between them. Omit for a plain,\n * unlabeled line.\n */\n label?: ReactNode\n /**\n * Where `label` sits along the line. `\"start\"`/`\"end\"` follow flexbox's\n * own logical main-axis edges (matching `Drawer`'s `placement` prop), so\n * they flip correctly under `dir=\"rtl\"` with no extra CSS. Ignored when\n * `label` is unset. Both segments render equally (a centered label) by\n * default.\n */\n labelPosition?: DividerLabelPosition\n }\n\n/**\n * Divider — a thin separator line, horizontal or vertical, with an optional\n * centered/leading/trailing label. Pure React Server Component.\n *\n * A separator's children are presentational, so an unlabeled divider is the\n * `role=\"separator\"` element itself, but a labeled one is a plain wrapper whose\n * line segments each carry the role: the label text stays readable instead of\n * being swallowed by the separator.\n *\n * `orientation=\"vertical\"` relies entirely on `align-self: stretch` — like\n * Mantine's own Divider, it has no self-sizing, so it needs a flex/grid\n * parent that already provides a definite height, or it renders with zero\n * height.\n *\n * ```tsx\n * <Divider />\n * <Divider label=\"OR\" />\n * <Divider orientation=\"vertical\" />\n * ```\n */\nexport const Divider = ({\n className,\n orientation,\n size,\n variant,\n color,\n label,\n labelPosition,\n testId,\n asChild: _asChild,\n ...rest\n}: DividerProps) => {\n const isVertical = orientation === \"vertical\"\n const lineClass = cn(\n dividerVariants({ orientation, size, variant }),\n color ? \"border-(--c-solid)\" : \"border-brand-900/20 dark:border-white/15\",\n )\n const labelClass = cn(\n \"shrink-0 text-xs\",\n color ? \"text-(--c-text)\" : TYPOGRAPHY_SHADE_CLASSES.muted,\n )\n // A separator's children are presentational: on a labeled divider the role\n // moves onto the line segments, or the label would vanish from the AX tree.\n const separator = {\n role: \"separator\",\n ...props({ \"aria-orientation\": isVertical && \"vertical\" }),\n } as const\n\n return (\n <ark.div\n {...(label ? null : separator)}\n data-orientation={orientation ?? \"horizontal\"}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n label\n ? [\"flex items-center gap-2\", isVertical ? \"flex-col self-stretch\" : \"w-full\"]\n : [lineClass, isVertical ? \"self-stretch\" : \"w-full\"],\n className,\n )}\n >\n {label && (\n <>\n <span\n data-part=\"line\"\n {...separator}\n className={cn(lineClass, \"flex-1\", labelPosition === \"start\" && \"hidden\")}\n />\n <span data-part=\"label\" className={labelClass}>\n {label}\n </span>\n <span\n data-part=\"line\"\n {...separator}\n className={cn(lineClass, \"flex-1\", labelPosition === \"end\" && \"hidden\")}\n />\n </>\n )}\n </ark.div>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/divider/divider.tsx"],"names":[],"mappings":";;;;;;;AA8BA,IAAM,eAAA,GAAkB,GAAA,CA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GAC3E,CAAC,SAAA,EAAW,UAAA,GAAa,cAAA,GAAiB,QAAQ,CAAA;AAAA,QACtD;AAAA,OACF;AAAA,MAEC,mCACC,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,WAAA,EAAU,MAAA;AAAA,YACT,GAAG,SAAA;AAAA,YACJ,WAAW,EAAA,CAAG,SAAA,EAAW,QAAA,EAAU,aAAA,KAAkB,WAAW,QAAQ;AAAA;AAAA,SAC1E;AAAA,4BACC,MAAA,EAAA,EAAK,WAAA,EAAU,OAAA,EAAQ,SAAA,EAAW,YAChC,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,wBACA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,WAAA,EAAU,MAAA;AAAA,YACT,GAAG,SAAA;AAAA,YACJ,WAAW,EAAA,CAAG,SAAA,EAAW,QAAA,EAAU,aAAA,KAAkB,SAAS,QAAQ;AAAA;AAAA;AACxE,OAAA,EACF;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-RLOWPCGG.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactNode } from \"react\"\nimport type { Align } from \"../../lib/align\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * `size` here only ever controls border thickness (1–5px, Mantine's own\n * xs..xl mapping) — unlike Timeline's density `size`, there's no parent/\n * child override relationship to defeat via a CSS custom property, so\n * thickness is a plain `(orientation × size)` compound lookup, the simpler\n * of the two mechanisms this kit uses for a sized dimension.\n *\n * Horizontal orientation's thickness sits on the block axis (`border-t`) —\n * RTL never touches top/bottom, so a physical property is fine, same split\n * `ButtonGroup` uses between its own horizontal/vertical orientations.\n * Vertical orientation's thickness sits on the inline axis, so it uses the\n * logical `border-s` (border-inline-start) instead, matching Timeline's own\n * vertical connecting line.\n *\n * Tailwind's default border-width scale has no 3px/5px step, hence the\n * arbitrary `[Npx]` values below — static literals (not interpolated) so\n * Tailwind v4's scanner keeps them.\n */\nconst dividerVariants = cva([\"shrink-0\"], {\n variants: {\n // No own classes — matched by `compoundVariants` only, the same\n // internal-only pattern `timelineBulletVariants`'s `ringed` axis uses.\n orientation: { horizontal: \"\", vertical: \"\" },\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // A different vocabulary than the kit's shape axis (filled/light/\n // outline/subtle/default) — same precedent as Timeline's own local\n // `TimelineLineVariant`.\n variant: {\n solid: \"border-solid\",\n dashed: \"border-dashed\",\n dotted: \"border-dotted\",\n },\n },\n compoundVariants: [\n { orientation: \"horizontal\", size: \"xs\", class: \"border-t\" },\n { orientation: \"horizontal\", size: \"sm\", class: \"border-t-2\" },\n { orientation: \"horizontal\", size: \"md\", class: \"border-t-[3px]\" },\n { orientation: \"horizontal\", size: \"lg\", class: \"border-t-4\" },\n { orientation: \"horizontal\", size: \"xl\", class: \"border-t-[5px]\" },\n { orientation: \"vertical\", size: \"xs\", class: \"border-s\" },\n { orientation: \"vertical\", size: \"sm\", class: \"border-s-2\" },\n { orientation: \"vertical\", size: \"md\", class: \"border-s-[3px]\" },\n { orientation: \"vertical\", size: \"lg\", class: \"border-s-4\" },\n { orientation: \"vertical\", size: \"xl\", class: \"border-s-[5px]\" },\n ],\n defaultVariants: { orientation: \"horizontal\", size: \"xs\", variant: \"solid\" },\n})\n\nexport type DividerOrientation = NonNullable<VariantProps<typeof dividerVariants>[\"orientation\"]>\nexport type DividerVariant = NonNullable<VariantProps<typeof dividerVariants>[\"variant\"]>\n/** Divider's thickness scale is the kit's canonical `Size` (xs–xl). */\nexport type DividerSize = Size\nexport type DividerLabelPosition = Align\n\nexport type DividerProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"children\">> &\n VariantProps<typeof dividerVariants> &\n WithTestId & {\n /**\n * Accent palette for the line. Re-exported as `Color` from `@42/ui-react`.\n * Unset renders a neutral hairline — it deliberately does not fall\n * through to `--c-solid` (that cascades to a bold black/white default at\n * `:root`, wrong for a hairline).\n */\n color?: Color\n /**\n * Content centered on the line (a word, an icon). Renders as three real\n * flex children — a leading line, the label, a trailing line — rather\n * than `::before`/`::after` pseudo-elements, matching Timeline's own line\n * convention. The label text is small (`text-xs`) in the muted text tier\n * (or the palette's `--c-text` when `color` is set): quiet enough to read\n * as part of the separator, but still at text contrast — the line's own\n * hairline colour is far too faint for words. The label is real content,\n * so `role=\"separator\"` moves onto the two line segments and the label\n * stays in the accessibility tree between them. Omit for a plain,\n * unlabeled line.\n */\n label?: ReactNode\n /**\n * Where `label` sits along the line. `\"start\"`/`\"end\"` follow flexbox's\n * own logical main-axis edges (matching `Drawer`'s `placement` prop), so\n * they flip correctly under `dir=\"rtl\"` with no extra CSS. Ignored when\n * `label` is unset. Both segments render equally (a centered label) by\n * default.\n */\n labelPosition?: DividerLabelPosition\n }\n\n/**\n * Divider — a thin separator line, horizontal or vertical, with an optional\n * centered/leading/trailing label. Pure React Server Component.\n *\n * A separator's children are presentational, so an unlabeled divider is the\n * `role=\"separator\"` element itself, but a labeled one is a plain wrapper whose\n * line segments each carry the role: the label text stays readable instead of\n * being swallowed by the separator.\n *\n * `orientation=\"vertical\"` relies entirely on `align-self: stretch` — like\n * Mantine's own Divider, it has no self-sizing, so it needs a flex/grid\n * parent that already provides a definite height, or it renders with zero\n * height.\n *\n * ```tsx\n * <Divider />\n * <Divider label=\"OR\" />\n * <Divider orientation=\"vertical\" />\n * ```\n */\nexport const Divider = ({\n className,\n orientation,\n size,\n variant,\n color,\n label,\n labelPosition,\n testId,\n asChild: _asChild,\n ...rest\n}: DividerProps) => {\n const isVertical = orientation === \"vertical\"\n const lineClass = cn(\n dividerVariants({ orientation, size, variant }),\n color ? \"border-(--c-solid)\" : \"border-brand-900/20 dark:border-white/15\",\n )\n const labelClass = cn(\n \"shrink-0 text-xs\",\n color ? \"text-(--c-text)\" : TYPOGRAPHY_SHADE_CLASSES.muted,\n )\n // A separator's children are presentational: on a labeled divider the role\n // moves onto the line segments, or the label would vanish from the AX tree.\n const separator = {\n role: \"separator\",\n ...props({ \"aria-orientation\": isVertical && \"vertical\" }),\n } as const\n\n return (\n <ark.div\n {...(label ? null : separator)}\n data-orientation={orientation ?? \"horizontal\"}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n label\n ? [\"flex items-center gap-2\", isVertical ? \"flex-col self-stretch\" : \"w-full\"]\n : [lineClass, isVertical ? \"self-stretch\" : \"w-full\"],\n className,\n )}\n >\n {label && (\n <>\n <span\n data-part=\"line\"\n {...separator}\n className={cn(lineClass, \"flex-1\", labelPosition === \"start\" && \"hidden\")}\n />\n <span data-part=\"label\" className={labelClass}>\n {label}\n </span>\n <span\n data-part=\"line\"\n {...separator}\n className={cn(lineClass, \"flex-1\", labelPosition === \"end\" && \"hidden\")}\n />\n </>\n )}\n </ark.div>\n )\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { props } from './chunk-WYCMIIRR.js';
2
- import { focusStyles } from './chunk-3REFDGOM.js';
2
+ import { focusStyles } from './chunk-C6NVU4F7.js';
3
3
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
4
- import { cn } from './chunk-QP4I37PA.js';
4
+ import { cn } from './chunk-4ASNIDV7.js';
5
5
  import { ark } from '@ark-ui/react';
6
6
  import { cva } from 'class-variance-authority';
7
7
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -204,5 +204,5 @@ var Table = Object.assign(TableRoot, {
204
204
  });
205
205
 
206
206
  export { Table };
207
- //# sourceMappingURL=chunk-R57QP43T.js.map
208
- //# sourceMappingURL=chunk-R57QP43T.js.map
207
+ //# sourceMappingURL=chunk-SVKN5ZHX.js.map
208
+ //# sourceMappingURL=chunk-SVKN5ZHX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/table/table.tsx"],"names":[],"mappings":";;;;;;;;AA+BA,IAAM,cAAA,GAAiB,EAAA;AAAA,EACrB,qDAAA;AAAA;AAAA;AAAA,EAGA;AACF,CAAA;AAcA,IAAM,aAAA,GAAgB,GAAA;AAAA,EACpB;AAAA;AAAA,IAEE,2CAAA;AAAA,IACA,oEAAA;AAAA;AAAA,IAEA,qBAAA;AAAA,IACA,uGAAA;AAAA;AAAA;AAAA;AAAA,IAIA,yDAAA;AAAA,IACA,0FAAA;AAAA;AAAA,IAEA,+EAAA;AAAA,IACA,6CAAA;AAAA,IACA,uIAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA;AAAA,MAER,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,yDAAA;AAAA,QACJ,EAAA,EAAI,iEAAA;AAAA,QACJ,EAAA,EAAI,6DAAA;AAAA,QACJ,EAAA,EAAI,2DAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA,MACA,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,sFAAA;AAAA,QACN,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,KAAA;AAAM;AAElD,CAAA;AAIA,IAAM,mBAAA,GACJ,4EAAA;AAGF,IAAM,mBAAA,GACJ,+EAAA;AAqDF,IAAM,YAAY,CAAC;AAAA,EACjB,SAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACE,GAAG,KAAA,CAAM,E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Ae,QAAQ,CAAA;AAAA,IAClC,GAAG,IAAA;AAAA,IACJ,SAAA,EAAW,SAAA,GAAY,EAAA,CAAG,SAAS,CAAA,GAAI;AAAA;AACzC,CAAA;AAGK,IAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,SAAA,EAAW;AAAA,EAC5C,OAAA,EAAS,YAAA;AAAA,EACT,KAAA,EAAO,UAAA;AAAA,EACP,OAAA,EAAS,YAAA;AAAA,EACT,IAAA,EAAM,SAAA;AAAA,EACN,IAAA,EAAM,SAAA;AAAA,EACN,IAAA,EAAM,SAAA;AAAA,EACN,GAAA,EAAK,QAAA;AAAA,EACL,UAAA,EAAY,eAAA;AAAA,EACZ,IAAA,EAAM;AACR,CAAC","file":"chunk-R57QP43T.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * The outermost element: a bordered, rounded surface that `overflow-hidden`\n * clips. Clipping is what keeps the rounded corners intact once the inner\n * scroll region shows a scrollbar (a scrollbar on the *rounded* element would\n * otherwise square off its corners). `flex flex-col` lets an optional\n * `Table.Toolbar` stack above the scroll region.\n *\n * `contain-layout` stops a bug that only shows up when this sits inside an\n * ancestor chain with no *definite* height (e.g. a CSS Grid track sized off\n * `min-height`, not `height` — common when a page fills the viewport via a\n * grid). Without it, a browser can size that indefinite ancestor off this\n * box's unclipped descendants' natural size — the *actual* content behind\n * an internal `overflow-auto`/`max-h-*` scroll region, not its rendered,\n * already-clipped size — inflating the whole page's scroll height in\n * proportion to row count despite this box's own height staying correct.\n * `contain: layout` declares this subtree's size as fully self-contained, so\n * an indefinite ancestor sizes off its real (bounded) box instead. Doesn't\n * affect `stickyHeader`/`stickyFooter` (governed by the nearest *scrolling*\n * ancestor, not containing-block/layout-containment rules) or the absolute-\n * positioned `.table-fade-*` overlays (already resolve against\n * `.table-scroll-frame`'s own `position: relative` in theme.css).\n */\nconst tableContainer = cn(\n \"flex w-full flex-col overflow-hidden contain-layout\",\n // Brand-derived border, matching InputBase/Popover/Modal/Drawer's shell\n // (border-brand-900/20 dark:border-white/15) rather than a neutral gray.\n \"rounded-sm border border-brand-900/20 dark:border-white/15\",\n)\n\n/**\n * All table styling rides on the container as descendant-selector classes, so\n * the part components stay dumb and `size` / `striped` / sticky can live on\n * `<Table>` (the root) without React context — keeping the whole thing a pure\n * Server Component. Every variant value is a static class string so Tailwind\n * v4's scanner keeps it.\n *\n * The `<table>` uses `border-collapse: separate` (see `TableContent`): collapsed\n * borders detach from sticky `<thead>` / `<tfoot>` while scrolling, so the\n * header/footer separators are cell borders (`thead th` bottom, `tfoot td/th`\n * top) that stay put when pinned.\n */\nconst tableVariants = cva(\n [\n // Row separators — on cells, since separate-mode ignores <tr> borders.\n \"[&_tbody_tr:not(:last-child)_td]:border-b\",\n \"[&_tbody_td]:border-brand-900/20 dark:[&_tbody_td]:border-white/15\",\n // Cells\n \"[&_td]:align-middle\",\n \"[&_th]:text-start [&_th]:align-middle [&_th]:font-medium [&_th]:text-brand-950 dark:[&_th]:text-white\",\n // Header — subtle fill + a bottom separator that survives sticky. Same\n // brand-tinted fill Popover/Modal/Drawer use for their own surface, at\n // the same /90 light /85 dark opacity recipe.\n \"[&_thead]:bg-brand-50/90 dark:[&_thead]:bg-brand-950/85\",\n \"[&_thead_th]:border-b [&_thead_th]:border-brand-900/20 dark:[&_thead_th]:border-white/15\",\n // Footer — subtle fill + a top separator that survives sticky.\n \"[&_tfoot]:bg-brand-50/90 dark:[&_tfoot]:bg-brand-950/85 [&_tfoot]:font-medium\",\n \"[&_tfoot_th]:border-t [&_tfoot_td]:border-t\",\n \"[&_tfoot_th]:border-brand-900/20 [&_tfoot_td]:border-brand-900/20 dark:[&_tfoot_th]:border-white/15 dark:[&_tfoot_td]:border-white/15\",\n // Excludes a `data-placeholder` row (an empty/error/loading state, e.g.\n // `DataTable`'s) — it has no row to hover, so it shouldn't tint like one.\n // Black/white wash, same convention as Popover/Menu/TreeSelect's own row\n // highlight — background-dependent instead of a fixed per-theme gray.\n \"[&_tbody_tr:not([data-placeholder]):hover]:bg-black/5! dark:[&_tbody_tr:not([data-placeholder]):hover]:bg-white/8! [&_tbody_tr]:transition-colors\",\n ],\n {\n variants: {\n // Cell padding + text scale, keyed to the kit's canonical `Size` scale.\n size: {\n xs: \"text-xs [&_th]:px-2 [&_td]:px-2 [&_th]:py-1 [&_td]:py-1\",\n sm: \"text-sm [&_th]:px-2.5 [&_td]:px-2.5 [&_th]:py-1.5 [&_td]:py-1.5\",\n md: \"text-sm [&_th]:px-3 [&_td]:px-3 [&_th]:py-2.5 [&_td]:py-2.5\",\n lg: \"text-base [&_th]:px-4 [&_td]:px-4 [&_th]:py-3 [&_td]:py-3\",\n xl: \"text-base [&_th]:px-4 [&_td]:px-4 [&_th]:py-4 [&_td]:py-4\",\n },\n striped: {\n true: \"[&_tbody_tr:nth-child(even)]:bg-black/3 dark:[&_tbody_tr:nth-child(even)]:bg-white/4\",\n false: \"\",\n },\n },\n defaultVariants: { size: \"md\", striped: false },\n },\n)\n\n/** Pin the whole `<thead>` to the top of the scroll region; `backdrop-blur`\n * keeps scrolled body rows legible behind the translucent header fill. */\nconst stickyHeaderClasses =\n \"[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10 [&_thead]:backdrop-blur-lg\"\n\n/** Pin the whole `<tfoot>` (e.g. a totals row) to the bottom of the scroll region. */\nconst stickyFooterClasses =\n \"[&_tfoot]:sticky [&_tfoot]:bottom-0 [&_tfoot]:z-10 [&_tfoot]:backdrop-blur-lg\"\n\n/** `Table`'s density scale — the kit's canonical `Size` (xs–xl). */\nexport type TableSize = Size\n\nexport type TableProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof tableVariants> &\n WithTestId & {\n /** Pins the header row during vertical scroll. Needs a bounded height —\n * set `max-h-*` on `Table` or `Table.Content`. */\n stickyHeader?: boolean\n /** Pins a `Table.Foot` row (e.g. totals) to the bottom during vertical\n * scroll. Same bounded-height requirement as `stickyHeader`. */\n stickyFooter?: boolean\n }\n\n/**\n * Table — a dumb, styled semantic `<table>` inside a bordered, rounded surface.\n * Pure React Server Component (no `\"use client\"`): static markup, no state, so\n * it's safe in an RSC tree and usable for static / MDX tables. Composed from\n * namespaced parts: an optional non-table header (`Table.Toolbar` +\n * `Table.Title` for a title and actions), a `Table.Content` scroll region that\n * holds the `<table>`, and the semantic parts `Table.Head` / `Table.Body` /\n * `Table.Foot` / `Table.Row` / `Table.HeaderCell` / `Table.Cell`.\n *\n * Density (`size`), `striped`, and `stickyHeader` / `stickyFooter` ride on\n * `<Table>` and style the table via descendant selectors. To pin a header or\n * footer, give the scroll region a bounded height (`max-h-*` on `Table` or\n * `Table.Content`). The rounded border is `overflow-hidden`, so the corners\n * stay intact even once a scrollbar appears. There is no `variant`×`color`\n * axis — a table retints from `:root` slot vars via CSS.\n *\n * <Table striped size=\"sm\" stickyHeader className=\"max-h-80\">\n * <Table.Toolbar>\n * <Table.Title>Users</Table.Title>\n * <Button size=\"sm\">Add</Button>\n * </Table.Toolbar>\n * <Table.Content>\n * <Table.Head>\n * <Table.Row>\n * <Table.HeaderCell>Name</Table.HeaderCell>\n * <Table.HeaderCell className=\"text-right\">Age</Table.HeaderCell>\n * </Table.Row>\n * </Table.Head>\n * <Table.Body>\n * <Table.Row>\n * <Table.Cell>Ada</Table.Cell>\n * <Table.Cell className=\"text-right\">36</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table.Content>\n * </Table>\n */\nconst TableRoot = ({\n className,\n size,\n striped,\n stickyHeader,\n stickyFooter,\n testId,\n ...rest\n}: TableProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n tableContainer,\n tableVariants({ size, striped }),\n stickyHeader && stickyHeaderClasses,\n stickyFooter && stickyFooterClasses,\n className,\n )}\n />\n)\n\nexport type TableToolbarProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** Non-`<table>` header bar: a title + actions row above the scroll region,\n * separated by a bottom border. `shrink-0` so it never collapses when the\n * content scrolls. */\nconst TableToolbar = ({ className, testId, ...rest }: TableToolbarProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"flex shrink-0 items-center justify-between gap-2 border-b border-brand-900/20 px-3 ps-5 py-3 dark:border-white/15\",\n className,\n )}\n />\n)\n\nexport type TableTitleProps = HTMLArkProps<\"h3\"> & WithTestId\n\nconst TableTitle = ({ className, testId, ...rest }: TableTitleProps) => (\n <ark.h3\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\"font-semibold tracking-normal\", className)}\n />\n)\n\nexport type TableContentProps = HTMLArkProps<\"table\"> &\n WithTestId & {\n /** Style the inner `<table>` element; `className` targets the scroll region. */\n classNames?: { table?: string }\n }\n\n/** The scroll region + the `<table>`, framed so horizontal scroll affordances\n * (soft edge shadows on each side with more to scroll) can overlay it. `className`\n * bounds the scroll surface (`max-h-*` here bounds a sticky header/footer);\n * `classNames.table` styles the `<table>`. `border-separate` keeps sticky\n * header/footer borders. The `table-scroll-*` / `table-fade-*` classes are the\n * scroll-driven-animation affordance defined in theme.css. */\nconst TableContent = ({ className, classNames, testId, ...rest }: TableContentProps) => (\n <div className={cn(\"table-scroll-frame flex min-h-0 flex-1 flex-col\", className)}>\n <section\n // A scroller must be reachable by keyboard, or arrow keys can't scroll it\n // (axe `scrollable-region-focusable`). Always, not only once it overflows:\n // knowing that would take a layout read, and this part is a Server Component.\n // biome-ignore lint/a11y/noNoninteractiveTabindex: a scroll region must be reachable by keyboard\n tabIndex={0}\n // A `<section>` is a region landmark only once it has a name, and it takes the\n // table's own: name the table (`aria-labelledby` a `Table.Title`'s id) and the\n // region says the same thing. Unnamed, it stays a plain focusable scroller.\n {...props({ \"aria-labelledby\": rest[\"aria-labelledby\"], \"aria-label\": rest[\"aria-label\"] })}\n className=\"peer table-scroll-x min-h-0 w-full flex-1 overflow-auto focus-visible:outline-none\"\n >\n <ark.table\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"w-full border-separate border-spacing-0 text-start\",\n TEXT_COLOR_CLASSES.primary,\n classNames?.table,\n )}\n />\n </section>\n {/* Horizontal scroll affordance — a soft shadow on each side that still has\n content to scroll to (pure CSS, hidden where unsupported). Pinned to the\n inline edges; a gradient has no logical direction, so `rtl:-scale-x-100`\n mirrors each shadow to fade inward from its own edge. The scroll-driven\n reveal needs no flip: its timeline's progress runs from the inline start\n in either direction. */}\n <div\n aria-hidden=\"true\"\n className=\"table-fade-start pointer-events-none absolute inset-y-0 start-0 w-6 rtl:-scale-x-100\"\n />\n <div\n aria-hidden=\"true\"\n className=\"table-fade-end pointer-events-none absolute inset-y-0 end-0 w-6 rtl:-scale-x-100\"\n />\n {/* The scroller's focus ring, on an overlay that doesn't scroll: a ring on the\n scroller itself is a box-shadow under its own content, hidden by the header\n and footer fills (and by the pinned rows, which are positioned). */}\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 z-20\",\n focusStyles({ source: \"peer-focus-visible\", inset: true, offset: false }),\n )}\n />\n </div>\n)\n\nexport type TableHeadProps = HTMLArkProps<\"thead\"> & WithTestId\n\n// Parts are dumb: all styling is driven by the root's descendant selectors, so\n// they just forward a caller className (through `cn` when present).\nconst TableHead = ({ className, testId, ...rest }: TableHeadProps) => (\n <ark.thead\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableBodyProps = HTMLArkProps<\"tbody\"> & WithTestId\n\nconst TableBody = ({ className, testId, ...rest }: TableBodyProps) => (\n <ark.tbody\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableFootProps = HTMLArkProps<\"tfoot\"> & WithTestId\n\nconst TableFoot = ({ className, testId, ...rest }: TableFootProps) => (\n <ark.tfoot\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableRowProps = HTMLArkProps<\"tr\"> & WithTestId\n\nconst TableRow = ({ className, testId, ...rest }: TableRowProps) => (\n <ark.tr\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableHeaderCellProps = HTMLArkProps<\"th\"> & WithTestId\n\nconst TableHeaderCell = ({ className, scope = \"col\", testId, ...rest }: TableHeaderCellProps) => (\n <ark.th\n scope={scope}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableCellProps = HTMLArkProps<\"td\"> & WithTestId\n\nconst TableCell = ({ className, testId, ...rest }: TableCellProps) => (\n <ark.td\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport const Table = Object.assign(TableRoot, {\n Toolbar: TableToolbar,\n Title: TableTitle,\n Content: TableContent,\n Head: TableHead,\n Body: TableBody,\n Foot: TableFoot,\n Row: TableRow,\n HeaderCell: TableHeaderCell,\n Cell: TableCell,\n})\n"]}
1
+ {"version":3,"sources":["../src/components/table/table.tsx"],"names":[],"mappings":";;;;;;;;AA+BA,IAAM,cAAA,GAAiB,EAAA;AAAA,EACrB,qDAAA;AAAA;AAAA;AAAA,EAGA;AACF,CAAA;AAcA,IAAM,aAAA,GAAgB,GAAA;AAAA,EACpB;AAAA;AAAA,IAEE,2CAAA;AAAA,IACA,oEAAA;AAAA;AAAA,IAEA,qBAAA;AAAA,IACA,uGAAA;AAAA;AAAA;AAAA;AAAA,IAIA,yDAAA;AAAA,IACA,0FAAA;AAAA;AAAA,IAEA,+EAAA;AAAA,IACA,6CAAA;AAAA,IACA,uIAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,GACF;AAAA,EAC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ps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * The outermost element: a bordered, rounded surface that `overflow-hidden`\n * clips. Clipping is what keeps the rounded corners intact once the inner\n * scroll region shows a scrollbar (a scrollbar on the *rounded* element would\n * otherwise square off its corners). `flex flex-col` lets an optional\n * `Table.Toolbar` stack above the scroll region.\n *\n * `contain-layout` stops a bug that only shows up when this sits inside an\n * ancestor chain with no *definite* height (e.g. a CSS Grid track sized off\n * `min-height`, not `height` — common when a page fills the viewport via a\n * grid). Without it, a browser can size that indefinite ancestor off this\n * box's unclipped descendants' natural size — the *actual* content behind\n * an internal `overflow-auto`/`max-h-*` scroll region, not its rendered,\n * already-clipped size — inflating the whole page's scroll height in\n * proportion to row count despite this box's own height staying correct.\n * `contain: layout` declares this subtree's size as fully self-contained, so\n * an indefinite ancestor sizes off its real (bounded) box instead. Doesn't\n * affect `stickyHeader`/`stickyFooter` (governed by the nearest *scrolling*\n * ancestor, not containing-block/layout-containment rules) or the absolute-\n * positioned `.table-fade-*` overlays (already resolve against\n * `.table-scroll-frame`'s own `position: relative` in theme.css).\n */\nconst tableContainer = cn(\n \"flex w-full flex-col overflow-hidden contain-layout\",\n // Brand-derived border, matching InputBase/Popover/Modal/Drawer's shell\n // (border-brand-900/20 dark:border-white/15) rather than a neutral gray.\n \"rounded-sm border border-brand-900/20 dark:border-white/15\",\n)\n\n/**\n * All table styling rides on the container as descendant-selector classes, so\n * the part components stay dumb and `size` / `striped` / sticky can live on\n * `<Table>` (the root) without React context — keeping the whole thing a pure\n * Server Component. Every variant value is a static class string so Tailwind\n * v4's scanner keeps it.\n *\n * The `<table>` uses `border-collapse: separate` (see `TableContent`): collapsed\n * borders detach from sticky `<thead>` / `<tfoot>` while scrolling, so the\n * header/footer separators are cell borders (`thead th` bottom, `tfoot td/th`\n * top) that stay put when pinned.\n */\nconst tableVariants = cva(\n [\n // Row separators — on cells, since separate-mode ignores <tr> borders.\n \"[&_tbody_tr:not(:last-child)_td]:border-b\",\n \"[&_tbody_td]:border-brand-900/20 dark:[&_tbody_td]:border-white/15\",\n // Cells\n \"[&_td]:align-middle\",\n \"[&_th]:text-start [&_th]:align-middle [&_th]:font-medium [&_th]:text-brand-950 dark:[&_th]:text-white\",\n // Header — subtle fill + a bottom separator that survives sticky. Same\n // brand-tinted fill Popover/Modal/Drawer use for their own surface, at\n // the same /90 light /85 dark opacity recipe.\n \"[&_thead]:bg-brand-50/90 dark:[&_thead]:bg-brand-950/85\",\n \"[&_thead_th]:border-b [&_thead_th]:border-brand-900/20 dark:[&_thead_th]:border-white/15\",\n // Footer — subtle fill + a top separator that survives sticky.\n \"[&_tfoot]:bg-brand-50/90 dark:[&_tfoot]:bg-brand-950/85 [&_tfoot]:font-medium\",\n \"[&_tfoot_th]:border-t [&_tfoot_td]:border-t\",\n \"[&_tfoot_th]:border-brand-900/20 [&_tfoot_td]:border-brand-900/20 dark:[&_tfoot_th]:border-white/15 dark:[&_tfoot_td]:border-white/15\",\n // Excludes a `data-placeholder` row (an empty/error/loading state, e.g.\n // `DataTable`'s) — it has no row to hover, so it shouldn't tint like one.\n // Black/white wash, same convention as Popover/Menu/TreeSelect's own row\n // highlight — background-dependent instead of a fixed per-theme gray.\n \"[&_tbody_tr:not([data-placeholder]):hover]:bg-black/5! dark:[&_tbody_tr:not([data-placeholder]):hover]:bg-white/8! [&_tbody_tr]:transition-colors\",\n ],\n {\n variants: {\n // Cell padding + text scale, keyed to the kit's canonical `Size` scale.\n size: {\n xs: \"text-xs [&_th]:px-2 [&_td]:px-2 [&_th]:py-1 [&_td]:py-1\",\n sm: \"text-sm [&_th]:px-2.5 [&_td]:px-2.5 [&_th]:py-1.5 [&_td]:py-1.5\",\n md: \"text-sm [&_th]:px-3 [&_td]:px-3 [&_th]:py-2.5 [&_td]:py-2.5\",\n lg: \"text-base [&_th]:px-4 [&_td]:px-4 [&_th]:py-3 [&_td]:py-3\",\n xl: \"text-base [&_th]:px-4 [&_td]:px-4 [&_th]:py-4 [&_td]:py-4\",\n },\n striped: {\n true: \"[&_tbody_tr:nth-child(even)]:bg-black/3 dark:[&_tbody_tr:nth-child(even)]:bg-white/4\",\n false: \"\",\n },\n },\n defaultVariants: { size: \"md\", striped: false },\n },\n)\n\n/** Pin the whole `<thead>` to the top of the scroll region; `backdrop-blur`\n * keeps scrolled body rows legible behind the translucent header fill. */\nconst stickyHeaderClasses =\n \"[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10 [&_thead]:backdrop-blur-lg\"\n\n/** Pin the whole `<tfoot>` (e.g. a totals row) to the bottom of the scroll region. */\nconst stickyFooterClasses =\n \"[&_tfoot]:sticky [&_tfoot]:bottom-0 [&_tfoot]:z-10 [&_tfoot]:backdrop-blur-lg\"\n\n/** `Table`'s density scale — the kit's canonical `Size` (xs–xl). */\nexport type TableSize = Size\n\nexport type TableProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof tableVariants> &\n WithTestId & {\n /** Pins the header row during vertical scroll. Needs a bounded height —\n * set `max-h-*` on `Table` or `Table.Content`. */\n stickyHeader?: boolean\n /** Pins a `Table.Foot` row (e.g. totals) to the bottom during vertical\n * scroll. Same bounded-height requirement as `stickyHeader`. */\n stickyFooter?: boolean\n }\n\n/**\n * Table — a dumb, styled semantic `<table>` inside a bordered, rounded surface.\n * Pure React Server Component (no `\"use client\"`): static markup, no state, so\n * it's safe in an RSC tree and usable for static / MDX tables. Composed from\n * namespaced parts: an optional non-table header (`Table.Toolbar` +\n * `Table.Title` for a title and actions), a `Table.Content` scroll region that\n * holds the `<table>`, and the semantic parts `Table.Head` / `Table.Body` /\n * `Table.Foot` / `Table.Row` / `Table.HeaderCell` / `Table.Cell`.\n *\n * Density (`size`), `striped`, and `stickyHeader` / `stickyFooter` ride on\n * `<Table>` and style the table via descendant selectors. To pin a header or\n * footer, give the scroll region a bounded height (`max-h-*` on `Table` or\n * `Table.Content`). The rounded border is `overflow-hidden`, so the corners\n * stay intact even once a scrollbar appears. There is no `variant`×`color`\n * axis — a table retints from `:root` slot vars via CSS.\n *\n * <Table striped size=\"sm\" stickyHeader className=\"max-h-80\">\n * <Table.Toolbar>\n * <Table.Title>Users</Table.Title>\n * <Button size=\"sm\">Add</Button>\n * </Table.Toolbar>\n * <Table.Content>\n * <Table.Head>\n * <Table.Row>\n * <Table.HeaderCell>Name</Table.HeaderCell>\n * <Table.HeaderCell className=\"text-right\">Age</Table.HeaderCell>\n * </Table.Row>\n * </Table.Head>\n * <Table.Body>\n * <Table.Row>\n * <Table.Cell>Ada</Table.Cell>\n * <Table.Cell className=\"text-right\">36</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table.Content>\n * </Table>\n */\nconst TableRoot = ({\n className,\n size,\n striped,\n stickyHeader,\n stickyFooter,\n testId,\n ...rest\n}: TableProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n tableContainer,\n tableVariants({ size, striped }),\n stickyHeader && stickyHeaderClasses,\n stickyFooter && stickyFooterClasses,\n className,\n )}\n />\n)\n\nexport type TableToolbarProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** Non-`<table>` header bar: a title + actions row above the scroll region,\n * separated by a bottom border. `shrink-0` so it never collapses when the\n * content scrolls. */\nconst TableToolbar = ({ className, testId, ...rest }: TableToolbarProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"flex shrink-0 items-center justify-between gap-2 border-b border-brand-900/20 px-3 ps-5 py-3 dark:border-white/15\",\n className,\n )}\n />\n)\n\nexport type TableTitleProps = HTMLArkProps<\"h3\"> & WithTestId\n\nconst TableTitle = ({ className, testId, ...rest }: TableTitleProps) => (\n <ark.h3\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\"font-semibold tracking-normal\", className)}\n />\n)\n\nexport type TableContentProps = HTMLArkProps<\"table\"> &\n WithTestId & {\n /** Style the inner `<table>` element; `className` targets the scroll region. */\n classNames?: { table?: string }\n }\n\n/** The scroll region + the `<table>`, framed so horizontal scroll affordances\n * (soft edge shadows on each side with more to scroll) can overlay it. `className`\n * bounds the scroll surface (`max-h-*` here bounds a sticky header/footer);\n * `classNames.table` styles the `<table>`. `border-separate` keeps sticky\n * header/footer borders. The `table-scroll-*` / `table-fade-*` classes are the\n * scroll-driven-animation affordance defined in theme.css. */\nconst TableContent = ({ className, classNames, testId, ...rest }: TableContentProps) => (\n <div className={cn(\"table-scroll-frame flex min-h-0 flex-1 flex-col\", className)}>\n <section\n // A scroller must be reachable by keyboard, or arrow keys can't scroll it\n // (axe `scrollable-region-focusable`). Always, not only once it overflows:\n // knowing that would take a layout read, and this part is a Server Component.\n // biome-ignore lint/a11y/noNoninteractiveTabindex: a scroll region must be reachable by keyboard\n tabIndex={0}\n // A `<section>` is a region landmark only once it has a name, and it takes the\n // table's own: name the table (`aria-labelledby` a `Table.Title`'s id) and the\n // region says the same thing. Unnamed, it stays a plain focusable scroller.\n {...props({ \"aria-labelledby\": rest[\"aria-labelledby\"], \"aria-label\": rest[\"aria-label\"] })}\n className=\"peer table-scroll-x min-h-0 w-full flex-1 overflow-auto focus-visible:outline-none\"\n >\n <ark.table\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"w-full border-separate border-spacing-0 text-start\",\n TEXT_COLOR_CLASSES.primary,\n classNames?.table,\n )}\n />\n </section>\n {/* Horizontal scroll affordance — a soft shadow on each side that still has\n content to scroll to (pure CSS, hidden where unsupported). Pinned to the\n inline edges; a gradient has no logical direction, so `rtl:-scale-x-100`\n mirrors each shadow to fade inward from its own edge. The scroll-driven\n reveal needs no flip: its timeline's progress runs from the inline start\n in either direction. */}\n <div\n aria-hidden=\"true\"\n className=\"table-fade-start pointer-events-none absolute inset-y-0 start-0 w-6 rtl:-scale-x-100\"\n />\n <div\n aria-hidden=\"true\"\n className=\"table-fade-end pointer-events-none absolute inset-y-0 end-0 w-6 rtl:-scale-x-100\"\n />\n {/* The scroller's focus ring, on an overlay that doesn't scroll: a ring on the\n scroller itself is a box-shadow under its own content, hidden by the header\n and footer fills (and by the pinned rows, which are positioned). */}\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 z-20\",\n focusStyles({ source: \"peer-focus-visible\", inset: true, offset: false }),\n )}\n />\n </div>\n)\n\nexport type TableHeadProps = HTMLArkProps<\"thead\"> & WithTestId\n\n// Parts are dumb: all styling is driven by the root's descendant selectors, so\n// they just forward a caller className (through `cn` when present).\nconst TableHead = ({ className, testId, ...rest }: TableHeadProps) => (\n <ark.thead\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableBodyProps = HTMLArkProps<\"tbody\"> & WithTestId\n\nconst TableBody = ({ className, testId, ...rest }: TableBodyProps) => (\n <ark.tbody\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableFootProps = HTMLArkProps<\"tfoot\"> & WithTestId\n\nconst TableFoot = ({ className, testId, ...rest }: TableFootProps) => (\n <ark.tfoot\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableRowProps = HTMLArkProps<\"tr\"> & WithTestId\n\nconst TableRow = ({ className, testId, ...rest }: TableRowProps) => (\n <ark.tr\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableHeaderCellProps = HTMLArkProps<\"th\"> & WithTestId\n\nconst TableHeaderCell = ({ className, scope = \"col\", testId, ...rest }: TableHeaderCellProps) => (\n <ark.th\n scope={scope}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport type TableCellProps = HTMLArkProps<\"td\"> & WithTestId\n\nconst TableCell = ({ className, testId, ...rest }: TableCellProps) => (\n <ark.td\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={className ? cn(className) : undefined}\n />\n)\n\nexport const Table = Object.assign(TableRoot, {\n Toolbar: TableToolbar,\n Title: TableTitle,\n Content: TableContent,\n Head: TableHead,\n Body: TableBody,\n Foot: TableFoot,\n Row: TableRow,\n HeaderCell: TableHeaderCell,\n Cell: TableCell,\n})\n"]}
@@ -1,8 +1,8 @@
1
- import { Spinner } from './chunk-HVOEVB4E.js';
1
+ import { Spinner } from './chunk-D2QIPQ74.js';
2
2
  import { withAsChildContent } from './chunk-R5LYFTHA.js';
3
3
  import { props } from './chunk-WYCMIIRR.js';
4
- import { focusStyles } from './chunk-3REFDGOM.js';
5
- import { cn } from './chunk-QP4I37PA.js';
4
+ import { focusStyles } from './chunk-C6NVU4F7.js';
5
+ import { cn } from './chunk-4ASNIDV7.js';
6
6
  import { ark } from '@ark-ui/react';
7
7
  import { cva } from 'class-variance-authority';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -172,5 +172,5 @@ var Button = ({
172
172
  };
173
173
 
174
174
  export { Button };
175
- //# sourceMappingURL=chunk-NJ4RO3CT.js.map
176
- //# sourceMappingURL=chunk-NJ4RO3CT.js.map
175
+ //# sourceMappingURL=chunk-SWVUXEBT.js.map
176
+ //# sourceMappingURL=chunk-SWVUXEBT.js.map