@42-central/ui-react 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/dist/{chunk-FUNTJZX7.js → chunk-2CL3FKEY.js} +3 -3
  2. package/dist/{chunk-FUNTJZX7.js.map → chunk-2CL3FKEY.js.map} +1 -1
  3. package/dist/{chunk-OZMSXYBX.js → chunk-36NWC4GV.js} +3 -3
  4. package/dist/{chunk-OZMSXYBX.js.map → chunk-36NWC4GV.js.map} +1 -1
  5. package/dist/{chunk-4FEOMQYR.js → chunk-54W6VAI3.js} +5 -5
  6. package/dist/{chunk-4FEOMQYR.js.map → chunk-54W6VAI3.js.map} +1 -1
  7. package/dist/{chunk-SZEOTXRZ.js → chunk-6II2DVYR.js} +5 -5
  8. package/dist/{chunk-SZEOTXRZ.js.map → chunk-6II2DVYR.js.map} +1 -1
  9. package/dist/{chunk-DJLNGWMM.js → chunk-6IRMKF5T.js} +3 -3
  10. package/dist/{chunk-DJLNGWMM.js.map → chunk-6IRMKF5T.js.map} +1 -1
  11. package/dist/{chunk-YPFSRZ3T.js → chunk-6UIQJJNJ.js} +3 -3
  12. package/dist/{chunk-YPFSRZ3T.js.map → chunk-6UIQJJNJ.js.map} +1 -1
  13. package/dist/{chunk-DT6LKNZF.js → chunk-7247WBTV.js} +5 -4
  14. package/dist/chunk-7247WBTV.js.map +1 -0
  15. package/dist/{chunk-6VYGK3Q3.js → chunk-7E7JNWOC.js} +16 -21
  16. package/dist/chunk-7E7JNWOC.js.map +1 -0
  17. package/dist/{chunk-C4NFRSOR.js → chunk-7HZBD4YZ.js} +4 -4
  18. package/dist/{chunk-C4NFRSOR.js.map → chunk-7HZBD4YZ.js.map} +1 -1
  19. package/dist/{chunk-JVG5ISPT.js → chunk-AHKMN3YQ.js} +3 -3
  20. package/dist/{chunk-JVG5ISPT.js.map → chunk-AHKMN3YQ.js.map} +1 -1
  21. package/dist/{chunk-UAYENYS2.js → chunk-AKXALCUN.js} +3 -3
  22. package/dist/{chunk-UAYENYS2.js.map → chunk-AKXALCUN.js.map} +1 -1
  23. package/dist/{chunk-BE2LWUHY.js → chunk-BMEJBY6H.js} +5 -3
  24. package/dist/chunk-BMEJBY6H.js.map +1 -0
  25. package/dist/{chunk-MXAACRWE.js → chunk-E52Z2FKU.js} +5 -5
  26. package/dist/{chunk-MXAACRWE.js.map → chunk-E52Z2FKU.js.map} +1 -1
  27. package/dist/chunk-F374BNL4.js +129 -0
  28. package/dist/chunk-F374BNL4.js.map +1 -0
  29. package/dist/{chunk-MRAJ45IM.js → chunk-FZSLSUSX.js} +4 -4
  30. package/dist/{chunk-MRAJ45IM.js.map → chunk-FZSLSUSX.js.map} +1 -1
  31. package/dist/{chunk-3L5GLI67.js → chunk-I4B3N3UX.js} +3 -3
  32. package/dist/{chunk-3L5GLI67.js.map → chunk-I4B3N3UX.js.map} +1 -1
  33. package/dist/{chunk-IPYHTCFL.js → chunk-IUK7OJXZ.js} +3 -3
  34. package/dist/{chunk-IPYHTCFL.js.map → chunk-IUK7OJXZ.js.map} +1 -1
  35. package/dist/{chunk-2MXWEIMD.js → chunk-KKLCHLCZ.js} +12 -11
  36. package/dist/chunk-KKLCHLCZ.js.map +1 -0
  37. package/dist/{chunk-YWTOW7PZ.js → chunk-LHUWOA2U.js} +8 -8
  38. package/dist/{chunk-YWTOW7PZ.js.map → chunk-LHUWOA2U.js.map} +1 -1
  39. package/dist/{chunk-6N6J2DOE.js → chunk-LIZWCWED.js} +3 -3
  40. package/dist/{chunk-6N6J2DOE.js.map → chunk-LIZWCWED.js.map} +1 -1
  41. package/dist/{chunk-O7LS6OZR.js → chunk-LMCUGYHT.js} +3 -3
  42. package/dist/{chunk-O7LS6OZR.js.map → chunk-LMCUGYHT.js.map} +1 -1
  43. package/dist/{chunk-DHJB4UJD.js → chunk-N5M4PDBK.js} +4 -4
  44. package/dist/{chunk-DHJB4UJD.js.map → chunk-N5M4PDBK.js.map} +1 -1
  45. package/dist/{chunk-DA4QII2N.js → chunk-NLSJ6T7V.js} +4 -4
  46. package/dist/{chunk-DA4QII2N.js.map → chunk-NLSJ6T7V.js.map} +1 -1
  47. package/dist/{chunk-UT3TOV2Q.js → chunk-OVT2KZHY.js} +3 -3
  48. package/dist/{chunk-UT3TOV2Q.js.map → chunk-OVT2KZHY.js.map} +1 -1
  49. package/dist/{chunk-SVKN5ZHX.js → chunk-PEHFWGTT.js} +16 -13
  50. package/dist/chunk-PEHFWGTT.js.map +1 -0
  51. package/dist/{chunk-J44FJ7PH.js → chunk-PFZMB3US.js} +4 -4
  52. package/dist/{chunk-J44FJ7PH.js.map → chunk-PFZMB3US.js.map} +1 -1
  53. package/dist/{chunk-IRNF274I.js → chunk-PI7X5YFJ.js} +3 -3
  54. package/dist/{chunk-IRNF274I.js.map → chunk-PI7X5YFJ.js.map} +1 -1
  55. package/dist/{chunk-F2FSHVO5.js → chunk-QZ4N5LYG.js} +7 -7
  56. package/dist/{chunk-F2FSHVO5.js.map → chunk-QZ4N5LYG.js.map} +1 -1
  57. package/dist/{chunk-E5H3YWZV.js → chunk-SAXWCGWR.js} +3 -3
  58. package/dist/{chunk-E5H3YWZV.js.map → chunk-SAXWCGWR.js.map} +1 -1
  59. package/dist/{chunk-SWVUXEBT.js → chunk-SCXXJDKQ.js} +3 -3
  60. package/dist/{chunk-SWVUXEBT.js.map → chunk-SCXXJDKQ.js.map} +1 -1
  61. package/dist/{chunk-D3JYDAUZ.js → chunk-T44RW5DW.js} +4 -4
  62. package/dist/{chunk-D3JYDAUZ.js.map → chunk-T44RW5DW.js.map} +1 -1
  63. package/dist/{chunk-FB2G4LNH.js → chunk-UDCCOUWR.js} +5 -5
  64. package/dist/{chunk-FB2G4LNH.js.map → chunk-UDCCOUWR.js.map} +1 -1
  65. package/dist/{chunk-TCFB23JT.js → chunk-WERJ44ZN.js} +3 -3
  66. package/dist/{chunk-TCFB23JT.js.map → chunk-WERJ44ZN.js.map} +1 -1
  67. package/dist/{chunk-QNKD2SQM.js → chunk-X3YIHN2U.js} +5 -5
  68. package/dist/{chunk-QNKD2SQM.js.map → chunk-X3YIHN2U.js.map} +1 -1
  69. package/dist/{chunk-VD6PB3VA.js → chunk-X6DESK37.js} +12 -3
  70. package/dist/chunk-X6DESK37.js.map +1 -0
  71. package/dist/{chunk-7AQ4MN4M.js → chunk-XUFCI262.js} +4 -4
  72. package/dist/{chunk-7AQ4MN4M.js.map → chunk-XUFCI262.js.map} +1 -1
  73. package/dist/{chunk-47LEAR6G.js → chunk-Y2G47ARQ.js} +6 -6
  74. package/dist/{chunk-47LEAR6G.js.map → chunk-Y2G47ARQ.js.map} +1 -1
  75. package/dist/{chunk-F342ZT7O.js → chunk-ZVECQBGG.js} +13 -7
  76. package/dist/chunk-ZVECQBGG.js.map +1 -0
  77. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  78. package/dist/components/action-icon/index.js +1 -1
  79. package/dist/components/alert/index.js +1 -1
  80. package/dist/components/ambient-background/ambient-background.d.ts +14 -3
  81. package/dist/components/ambient-background/ambient-background.d.ts.map +1 -1
  82. package/dist/components/ambient-background/index.js +225 -2
  83. package/dist/components/ambient-background/index.js.map +1 -1
  84. package/dist/components/ambient-background/starfield.d.ts +13 -0
  85. package/dist/components/ambient-background/starfield.d.ts.map +1 -0
  86. package/dist/components/app-shell/index.js +4 -4
  87. package/dist/components/autocomplete/index.js +3 -3
  88. package/dist/components/avatar/index.js +2 -2
  89. package/dist/components/badge/badge.d.ts.map +1 -1
  90. package/dist/components/badge/index.js +1 -1
  91. package/dist/components/button/index.js +1 -1
  92. package/dist/components/button-multi-select/index.js +3 -3
  93. package/dist/components/button-select/index.js +3 -3
  94. package/dist/components/calendar/index.js +4 -4
  95. package/dist/components/calendar-heatmap/index.js +2 -2
  96. package/dist/components/camera/index.js +10 -10
  97. package/dist/components/card/card.d.ts.map +1 -1
  98. package/dist/components/card/index.js +1 -1
  99. package/dist/components/carousel/index.js +2 -2
  100. package/dist/components/checkbox/checkbox.d.ts +3 -2
  101. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  102. package/dist/components/checkbox/index.js +2 -2
  103. package/dist/components/choice-card-group/index.js +2 -2
  104. package/dist/components/choice-card-group/index.js.map +1 -1
  105. package/dist/components/clipboard/index.js +3 -3
  106. package/dist/components/code-block/code-block.d.ts +6 -3
  107. package/dist/components/code-block/code-block.d.ts.map +1 -1
  108. package/dist/components/code-block/highlighter.d.ts +16 -15
  109. package/dist/components/code-block/highlighter.d.ts.map +1 -1
  110. package/dist/components/code-block/index.d.ts +2 -1
  111. package/dist/components/code-block/index.d.ts.map +1 -1
  112. package/dist/components/code-block/index.js +81 -10
  113. package/dist/components/code-block/index.js.map +1 -1
  114. package/dist/components/code-block/languages.d.ts +61 -0
  115. package/dist/components/code-block/languages.d.ts.map +1 -0
  116. package/dist/components/code-block/static.d.ts +2 -1
  117. package/dist/components/code-block/static.d.ts.map +1 -1
  118. package/dist/components/code-block/static.js +99 -10
  119. package/dist/components/code-block/static.js.map +1 -1
  120. package/dist/components/combobox/index.js +3 -3
  121. package/dist/components/combobox-list/index.js +5 -5
  122. package/dist/components/compare/index.js +2 -2
  123. package/dist/components/data-table/index.js +30 -30
  124. package/dist/components/data-table/index.js.map +1 -1
  125. package/dist/components/date-picker/index.js +12 -12
  126. package/dist/components/download-button/index.js +2 -2
  127. package/dist/components/drawer/index.js +4 -4
  128. package/dist/components/field/field.d.ts +3 -0
  129. package/dist/components/field/field.d.ts.map +1 -1
  130. package/dist/components/field/index.js +1 -1
  131. package/dist/components/file-item/index.js +5 -5
  132. package/dist/components/file-preview/index.js +5 -5
  133. package/dist/components/file-trigger/index.js +2 -2
  134. package/dist/components/file-upload/index.js +6 -6
  135. package/dist/components/gallery/index.js +2 -2
  136. package/dist/components/geodesic/a11y.d.ts +3 -3
  137. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  138. package/dist/components/image-cropper/index.js +7 -7
  139. package/dist/components/indicator/index.js +1 -1
  140. package/dist/components/input/index.js +2 -2
  141. package/dist/components/kbd/index.js +3 -3
  142. package/dist/components/kbd/kbd.d.ts.map +1 -1
  143. package/dist/components/lightbox/index.js +7 -7
  144. package/dist/components/menu/index.js +2 -2
  145. package/dist/components/modal/index.js +4 -4
  146. package/dist/components/multi-combobox-list/index.js +5 -5
  147. package/dist/components/multi-select/index.js +6 -6
  148. package/dist/components/number-input/index.js +3 -3
  149. package/dist/components/overlays/index.js +6 -6
  150. package/dist/components/password-input/index.js +3 -3
  151. package/dist/components/photo-capture/index.js +14 -14
  152. package/dist/components/pills-input/index.js +5 -5
  153. package/dist/components/pin-input/index.js +2 -2
  154. package/dist/components/radio-group/index.js +1 -1
  155. package/dist/components/rating/index.js +1 -1
  156. package/dist/components/schedule/index.js +5 -5
  157. package/dist/components/segment-group/index.js +4 -4
  158. package/dist/components/select/index.js +4 -4
  159. package/dist/components/slider/index.js +2 -2
  160. package/dist/components/spotlight/index.js +9 -9
  161. package/dist/components/switch/index.js +14 -19
  162. package/dist/components/switch/index.js.map +1 -1
  163. package/dist/components/switch/switch.d.ts +1 -0
  164. package/dist/components/switch/switch.d.ts.map +1 -1
  165. package/dist/components/table/index.js +1 -1
  166. package/dist/components/table/table.d.ts.map +1 -1
  167. package/dist/components/tabs/index.js +3 -3
  168. package/dist/components/tags-input/index.js +5 -5
  169. package/dist/components/text-input/index.js +2 -2
  170. package/dist/components/textarea/index.js +2 -2
  171. package/dist/components/theme-icon/index.js +1 -1
  172. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  173. package/dist/components/time-input/index.js +7 -7
  174. package/dist/components/tree-multi-select/index.js +6 -6
  175. package/dist/components/tree-select/index.js +3 -3
  176. package/dist/index.js +4 -4
  177. package/dist/theme.css +103 -23
  178. package/package.json +1 -1
  179. package/src/components/action-icon/action-icon.tsx +3 -1
  180. package/src/components/ambient-background/ambient-background.test.tsx +59 -0
  181. package/src/components/ambient-background/ambient-background.tsx +15 -2
  182. package/src/components/ambient-background/starfield.tsx +333 -0
  183. package/src/components/badge/badge.tsx +11 -6
  184. package/src/components/button/button.tsx +1 -1
  185. package/src/components/card/card.tsx +10 -9
  186. package/src/components/checkbox/checkbox.test.tsx +17 -9
  187. package/src/components/checkbox/checkbox.tsx +26 -27
  188. package/src/components/choice-card-group/choice-card-group.tsx +3 -3
  189. package/src/components/code-block/code-block.tsx +7 -4
  190. package/src/components/code-block/highlighter.test.ts +79 -1
  191. package/src/components/code-block/highlighter.ts +76 -30
  192. package/src/components/code-block/index.ts +2 -0
  193. package/src/components/code-block/languages.ts +63 -0
  194. package/src/components/code-block/static.tsx +2 -1
  195. package/src/components/data-table/data-table-pagination.tsx +5 -5
  196. package/src/components/data-table/data-table-stack.tsx +2 -2
  197. package/src/components/field/field.tsx +14 -0
  198. package/src/components/kbd/kbd.tsx +2 -1
  199. package/src/components/switch/switch.test.tsx +15 -0
  200. package/src/components/switch/switch.tsx +27 -27
  201. package/src/components/table/table.test.tsx +1 -1
  202. package/src/components/table/table.tsx +14 -11
  203. package/src/components/theme-icon/theme-icon.tsx +46 -12
  204. package/src/icon-stroke.test.tsx +2 -0
  205. package/src/theme.css +103 -23
  206. package/src/theme.test.ts +10 -2
  207. package/dist/chunk-2MXWEIMD.js.map +0 -1
  208. package/dist/chunk-6VYGK3Q3.js.map +0 -1
  209. package/dist/chunk-7CNDZZZ6.js +0 -95
  210. package/dist/chunk-7CNDZZZ6.js.map +0 -1
  211. package/dist/chunk-BE2LWUHY.js.map +0 -1
  212. package/dist/chunk-DT6LKNZF.js.map +0 -1
  213. package/dist/chunk-F342ZT7O.js.map +0 -1
  214. package/dist/chunk-SVKN5ZHX.js.map +0 -1
  215. package/dist/chunk-VD6PB3VA.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { useLayerCovered } from './chunk-H7WOMZXO.js';
2
- import { devWarn } from './chunk-6N6J2DOE.js';
2
+ import { devWarn } from './chunk-LIZWCWED.js';
3
3
  import { ArrowRight, ArrowLeft, ArrowDown, ArrowUp, ArrowRightToLine, Delete, CornerDownLeft, ArrowBigUp, Option, ChevronUp, Command } from 'lucide-react';
4
4
  import { useEffectEvent, useEffect, useSyncExternalStore } from 'react';
5
5
 
@@ -213,5 +213,5 @@ var noSubscription = () => () => {
213
213
  var useApplePlatform = () => useSyncExternalStore(noSubscription, isApplePlatform, () => false);
214
214
 
215
215
  export { KBD_DEFAULT_TRANSLATIONS, formatHotkey, hotkeyCaps, hotkeyKeys, isApplePlatform, matchHotkey, useApplePlatform, useHotkey };
216
- //# sourceMappingURL=chunk-FUNTJZX7.js.map
217
- //# sourceMappingURL=chunk-FUNTJZX7.js.map
216
+ //# sourceMappingURL=chunk-2CL3FKEY.js.map
217
+ //# sourceMappingURL=chunk-2CL3FKEY.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/use-hotkey.ts"],"names":[],"mappings":";;;;;AAsCA,IAAM,QAAA,GAAoD;AAAA,EACxD,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,MAAA;AAAA,EACL,OAAA,EAAS,MAAA;AAAA,EACT,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,MAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA,EACL,MAAA,EAAQ,KAAA;AAAA,EACR,KAAA,EAAO;AACT,CAAA;AAGA,IAAM,YAAA,GAAgD;AAAA,EACpD,IAAA,EAAM,MAAA;AAAA,EACN,IAAA,EAAM,SAAA;AAAA,EACN,GAAA,EAAK,KAAA;AAAA,EACL,KAAA,EAAO;AACT,CAAA;AAGO,IAAM,kBAAkB,MAAe;AAC5C,EAAA,IAAI,OAAO,SAAA,KAAc,WAAA,EAAa,OAAO,KAAA;AAC7C,EAAA,MAAM,GAAA,GAA6D,SAAA;AACnE,EAAA,OAAO,wBAAwB,IAAA,CAAK,GAAA,CAAI,eAAe,QAAA,IAAY,GAAA,CAAI,YAAY,EAAE,CAAA;AACvF;AAaA,IAAM,eAAA,GAAkB,CA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;AAC7B,MAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,IACf,CAAA;AACA,IAAA,MAAA,CAAO,gBAAA,CAAiB,MAAM,KAAK,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO;AACT,MAAA,QAAA,CAAS,gBAAA,CAAiB,eAAe,aAAa,CAAA;AACtD,MAAA,QAAA,CAAS,gBAAA,CAAiB,cAAc,YAAY,CAAA;AAAA,IACtD;AACA,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,CAAO,mBAAA,CAAoB,MAAM,KAAK,CAAA;AACtC,MAAA,QAAA,CAAS,mBAAA,CAAoB,eAAe,aAAa,CAAA;AACzD,MAAA,QAAA,CAAS,mBAAA,CAAoB,cAAc,YAAY,CAAA;AAAA,IACzD,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,SAAA,EAAW,MAAA,EAAQ,KAAA,EAAO,OAAO,KAAA,EAAO,MAAA,EAAQ,IAAA,EAAM,OAAO,CAAC,CAAA;AACpE;AAEA,IAAM,cAAA,GAAiB,MAAM,MAAM;AAAC,CAAA;AAM7B,IAAM,mBAAmB,MAC9B,oBAAA,CAAqB,cAAA,EAAgB,eAAA,EAAiB,MAAM,KAAK","file":"chunk-FUNTJZX7.js","sourcesContent":["\"use client\"\n\nimport {\n ArrowBigUp,\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowRightToLine,\n ArrowUp,\n ChevronUp,\n Command,\n CornerDownLeft,\n Delete,\n type LucideIcon,\n Option,\n} from \"lucide-react\"\nimport { type RefObject, useEffect, useEffectEvent, useSyncExternalStore } from \"react\"\nimport { devWarn } from \"./dev-warn\"\nimport { useLayerCovered } from \"./overlay-layer\"\n\n/**\n * A small, platform-aware keyboard shortcut matcher: `\"mod+k\"`, `\"shift+mod+p\"`,\n * `\"alt+/\"`.\n *\n * - `mod` is ⌘ on Apple platforms and Ctrl elsewhere, the usual convention for\n * app shortcuts. `meta` / `cmd` and `ctrl` name one key explicitly.\n * - The last part is the key, compared case-insensitively with `event.key`, so\n * it follows the user's keyboard layout. The space bar is `space`. Modifiers must match exactly:\n * `mod+k` doesn't fire on ⌘⇧K.\n * - The key can be a modifier itself (`\"alt\"`, for hold-to-peek): its own flag\n * is then ignored, since pressing ⌥ sets `altKey` and releasing it clears it.\n * - An event fired while an IME is composing is ignored.\n * - A part that names no modifier (`\"ctl+k\"`) makes the hotkey match nothing,\n * rather than silently dropping it and firing on a bare `k`.\n */\n\ntype Modifiers = { meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }\n\nconst MODIFIER: Record<string, keyof Modifiers | \"mod\"> = {\n mod: \"mod\",\n meta: \"meta\",\n cmd: \"meta\",\n command: \"meta\",\n ctrl: \"ctrl\",\n control: \"ctrl\",\n alt: \"alt\",\n option: \"alt\",\n shift: \"shift\",\n}\n\n/** A modifier as the key itself, spelled the way `event.key` spells it. */\nconst MODIFIER_KEY: Record<keyof Modifiers, string> = {\n meta: \"meta\",\n ctrl: \"control\",\n alt: \"alt\",\n shift: \"shift\",\n}\n\n/** Whether the user agent is an Apple platform (macOS, iOS, iPadOS): `mod` is ⌘ there. */\nexport const isApplePlatform = (): boolean => {\n if (typeof navigator === \"undefined\") return false\n const nav: Navigator & { userAgentData?: { platform?: string } } = navigator\n return /mac|iphone|ipad|ipod/i.test(nav.userAgentData?.platform ?? nav.platform ?? \"\")\n}\n\nexport type ParsedHotkey = Modifiers & {\n key: string\n /** Modifier parts that name no known modifier — a typo like `ctl`. */\n unknown: string[]\n}\n\ntype HotkeyEvent = Pick<\n KeyboardEvent,\n \"key\" | \"metaKey\" | \"ctrlKey\" | \"altKey\" | \"shiftKey\" | \"isComposing\"\n>\n\nconst resolveModifier = (part: string, apple: boolean): keyof Modifiers | undefined => {\n const modifier = MODIFIER[part]\n return modifier === \"mod\" ? (apple ? \"meta\" : \"ctrl\") : modifier\n}\n\n/** Parse a hotkey once: its key and the exact modifiers it needs. */\nexport const parseHotkey = (hotkey: string, apple = isApplePlatform()): ParsedHotkey => {\n const parts = hotkey\n .toLowerCase()\n .split(\"+\")\n .map((part) => part.trim())\n // A trailing \"+\" names the plus key itself: \"mod++\".\n const last = hotkey.endsWith(\"+\") ? \"+\" : (parts.at(-1) ?? \"\")\n const named = parts.slice(0, hotkey.endsWith(\"+\") ? -2 : -1)\n // A modifier as the key (`\"alt\"`, `\"mod\"`) is spelled as `event.key` has it.\n const self = resolveModifier(last, apple)\n const modifiers = named.map((part) => resolveModifier(part, apple))\n return {\n key: self ? MODIFIER_KEY[self] : last,\n meta: modifiers.includes(\"meta\"),\n ctrl: modifiers.includes(\"ctrl\"),\n alt: modifiers.includes(\"alt\"),\n shift: modifiers.includes(\"shift\"),\n unknown: named.filter((part) => MODIFIER[part] === undefined),\n }\n}\n\n/** Whether `event` is the already-parsed hotkey. */\nconst matchParsed = (parsed: ParsedHotkey, event: HotkeyEvent): boolean => {\n // `event.key` is a literal \" \" for the space bar, which a hotkey spells `space`.\n const key = event.key === \" \" ? \"space\" : event.key.toLowerCase()\n // Pressing a modifier sets its own flag (and releasing it clears it), so a\n // modifier that is the key itself is checked by `key` alone.\n const flag = (modifier: keyof Modifiers, pressed: boolean) =>\n key === MODIFIER_KEY[modifier] || pressed === parsed[modifier]\n return (\n !event.isComposing &&\n parsed.unknown.length === 0 &&\n key === parsed.key &&\n flag(\"meta\", event.metaKey) &&\n flag(\"ctrl\", event.ctrlKey) &&\n flag(\"alt\", event.altKey) &&\n flag(\"shift\", event.shiftKey)\n )\n}\n\n/** Whether `event` is `hotkey`. See the module doc for the rules. */\nexport const matchHotkey = (\n hotkey: string,\n event: HotkeyEvent,\n apple = isApplePlatform(),\n): boolean => matchParsed(parseHotkey(hotkey, apple), event)\n\n/**\n * The words a key cap reads as, keyed by the English string each replaces:\n * the word a cap shows (`ctrl`, `escape`) or the name it is spoken by (`command`,\n * `up`). Apple and the other platforms name some keys differently, so each\n * spelling has its own key: `return` / `enter`, `option` / `alt`, `delete`\n * (⌫ on a Mac) / `backspace`. `KEY_LABEL` says which key uses which; these\n * only replace the strings. `Intl` has no display names for keys, so these are\n * plain translations, English by default (`KBD_DEFAULT_TRANSLATIONS`).\n */\nexport type KbdTranslations = {\n /** ⌘, spoken on Apple. */\n command: string\n /** The Meta (Windows) key's word, off Apple. */\n meta: string\n /** ⌃, spoken on Apple. */\n control: string\n /** Ctrl's word, off Apple. \"Strg\" on a German keyboard. */\n ctrl: string\n /** ⌥, spoken on Apple. */\n option: string\n /** Alt's word, off Apple. */\n alt: string\n /** ⇧, spoken on every platform. */\n shift: string\n /** ↵, spoken on Apple. */\n return: string\n /** ↵, spoken off Apple. \"Entrée\" in French. */\n enter: string\n /** ⌫, spoken on Apple. */\n delete: string\n /** ⌫'s word, off Apple. \"Rücktaste\" in German, \"Retour arrière\" in French. */\n backspace: string\n /** ⌦, spoken on Apple. */\n forwardDelete: string\n /** ⌦'s word, off Apple. \"Suppr\" on a French keyboard, \"Entf\" on a German one. */\n del: string\n /** ⇥, spoken on every platform. */\n tab: string\n /** The arrows, spoken on every platform. */\n up: string\n down: string\n left: string\n right: string\n /** Esc's word, on every platform. \"Échap\" on a French keyboard. */\n escape: string\n /** The space bar's word, on every platform. */\n space: string\n /** Page Up and Page Down's words, on every platform. */\n pageUp: string\n pageDown: string\n}\n\n/** The English key words: what `<Kbd hotkey>`, `hotkeyKeys` and `formatHotkey`\n * read as without `translations`, and the base a partial override is merged onto. */\nexport const KBD_DEFAULT_TRANSLATIONS = {\n command: \"Command\",\n meta: \"Meta\",\n control: \"Control\",\n ctrl: \"Ctrl\",\n option: \"Option\",\n alt: \"Alt\",\n shift: \"Shift\",\n return: \"Return\",\n enter: \"Enter\",\n delete: \"Delete\",\n backspace: \"Backspace\",\n forwardDelete: \"Forward Delete\",\n del: \"Del\",\n tab: \"Tab\",\n up: \"Up Arrow\",\n down: \"Down Arrow\",\n left: \"Left Arrow\",\n right: \"Right Arrow\",\n escape: \"Esc\",\n space: \"Space\",\n pageUp: \"PgUp\",\n pageDown: \"PgDn\",\n} as const satisfies KbdTranslations\n\ntype KeyWord = keyof KbdTranslations\n\n/**\n * How a key reads on a key cap. One entry per key that doesn't read as typed:\n *\n * - `glyph`: the symbol Apple writes (⌘, ⇧, ↵), spoken there as `name` (a\n * bare `⌘` has no reliable spoken form).\n * - `text`: the word Windows and Linux write (`Ctrl`, `Shift`, `Enter`),\n * spoken there as itself.\n * - `icon`: what a `<Kbd>` cap draws for the key on every platform, so\n * Shift is the same arrow on a Mac and on a PC.\n * - `appleIcon`: an icon drawn on Apple only: the symbols only Apple uses\n * (⌘ ⌥ ⌃), and ⌫. Elsewhere those keys stay words: there is no honest icon\n * for Ctrl, Alt or the Windows key, and ⌫ reads as the Left Arrow there,\n * where the keyboard prints \"Backspace\".\n *\n * `text` and `name` are `KbdTranslations` keys, so a translation replaces the\n * word and never the key data. Apple platforms take the glyph and fall back to\n * the text; elsewhere it is the reverse, so a key with only a glyph (the\n * arrows) is a symbol everywhere and one with only a text (`Esc`) is a word\n * everywhere. Anything not listed is shown as typed, its first letter\n * upper-cased.\n */\ntype KeyLabel = {\n glyph?: string\n text?: KeyWord\n icon?: LucideIcon\n appleIcon?: LucideIcon\n name?: KeyWord\n}\n\nconst KEY_LABEL: Record<string, KeyLabel> = {\n meta: { glyph: \"⌘\", appleIcon: Command, name: \"command\", text: \"meta\" },\n control: { glyph: \"⌃\", appleIcon: ChevronUp, name: \"control\", text: \"ctrl\" },\n alt: { glyph: \"⌥\", appleIcon: Option, name: \"option\", text: \"alt\" },\n shift: { glyph: \"⇧\", icon: ArrowBigUp, name: \"shift\", text: \"shift\" },\n enter: { glyph: \"↵\", icon: CornerDownLeft, name: \"return\", text: \"enter\" },\n // An icon on Apple only: elsewhere ⌫ reads as ← (the Left Arrow), and the key\n // is printed \"Backspace\" on those keyboards.\n backspace: { glyph: \"⌫\", appleIcon: Delete, name: \"delete\", text: \"backspace\" },\n delete: { glyph: \"⌦\", name: \"forwardDelete\", text: \"del\" },\n tab: { glyph: \"⇥\", icon: ArrowRightToLine, name: \"tab\", text: \"tab\" },\n arrowup: { glyph: \"↑\", icon: ArrowUp, name: \"up\" },\n arrowdown: { glyph: \"↓\", icon: ArrowDown, name: \"down\" },\n arrowleft: { glyph: \"←\", icon: ArrowLeft, name: \"left\" },\n arrowright: { glyph: \"→\", icon: ArrowRight, name: \"right\" },\n // macOS menus spell these out too.\n escape: { text: \"escape\" },\n esc: { text: \"escape\" },\n space: { text: \"space\" },\n pageup: { text: \"pageUp\" },\n pagedown: { text: \"pageDown\" },\n}\n\n/** Apple's order for modifier glyphs (⌃⌥⇧⌘), used on every platform. */\nconst MODIFIER_ORDER: (keyof Modifiers)[] = [\"ctrl\", \"alt\", \"shift\", \"meta\"]\n\n/**\n * One key cap of a hotkey: the text it reads as (`label`), and, when the\n * key is drawn rather than written, the `icon` to draw (none for a glyph\n * with no icon, like ⌦) and the `name` to speak.\n * `id` tells caps apart (`\"ctrl\"`, `\"shift\"`, …, `\"key\"` for the last).\n */\nexport type HotkeyCap = { id: string; label: string; icon?: LucideIcon; name?: string }\n\nconst keyCap = (\n id: string,\n key: string,\n apple: boolean,\n translations: Partial<KbdTranslations> | undefined,\n): HotkeyCap => {\n const entry = KEY_LABEL[key]\n // Merged per key; a key set to `undefined` keeps its English word.\n const word = (of?: KeyWord) => of && (translations?.[of] ?? KBD_DEFAULT_TRANSLATIONS[of])\n const text = word(entry?.text)\n const spoken = word(entry?.name)\n const label =\n (apple ? (entry?.glyph ?? text) : (text ?? entry?.glyph)) ??\n key.charAt(0).toUpperCase() + key.slice(1)\n const icon = apple ? (entry?.appleIcon ?? entry?.icon) : entry?.icon\n // Spoken the platform's way: Apple's key names there (\"Return\"), the\n // word elsewhere (\"Enter\"), the arrows' names on both.\n const name = apple ? spoken : (text ?? spoken)\n // An icon, or Apple's glyph where it has none (⌦), is drawn and spoken by\n // name; a word reads as itself.\n const drawn = icon !== undefined || (label === entry?.glyph && apple)\n return drawn && name ? { id, label, name, ...(icon && { icon }) } : { id, label }\n}\n\n/**\n * The caps of a hotkey, modifiers first in Apple's order. What `<Kbd hotkey>`\n * renders; `hotkeyKeys` is its text. `translations` replaces the English key\n * words per key (see `KbdTranslations`).\n */\nexport const hotkeyCaps = (\n hotkey: string,\n apple = isApplePlatform(),\n translations?: Partial<KbdTranslations>,\n): HotkeyCap[] => {\n const parsed = parseHotkey(hotkey, apple)\n return [\n ...MODIFIER_ORDER.filter((modifier) => parsed[modifier]).map((modifier) =>\n keyCap(modifier, MODIFIER_KEY[modifier], apple, translations),\n ),\n keyCap(\"key\", parsed.key, apple, translations),\n ]\n}\n\n/**\n * The keys of a hotkey, one label per key cap, the way the platform writes\n * them: `\"mod+k\"` is `[\"⌘\", \"K\"]` on Apple platforms and `[\"Ctrl\", \"K\"]`\n * elsewhere, `\"shift+mod+p\"` is `[\"⇧\", \"⌘\", \"P\"]` / `[\"Ctrl\", \"Shift\", \"P\"]`.\n * Modifiers come in Apple's order (⌃⌥⇧⌘) whatever order the string names\n * them in. Render one `<kbd>` per label, or let `<Kbd hotkey>` do it.\n *\n * `apple` defaults to the current platform, which a server can't know: while\n * rendering, pass `useApplePlatform()` so the server markup and the first\n * client render agree. `translations` is `<Kbd>`'s, so the text and the caps\n * read the same: `{ ctrl: \"Strg\" }` gives `[\"Strg\", \"K\"]`.\n */\nexport const hotkeyKeys = (\n hotkey: string,\n apple = isApplePlatform(),\n translations?: Partial<KbdTranslations>,\n): string[] => hotkeyCaps(hotkey, apple, translations).map((cap) => cap.label)\n\n/**\n * The label for a hotkey as one string, for plain-text places (a `title`, a\n * tooltip, a menu's text): `hotkeyKeys` joined, the Apple way with no space\n * (`⌘K`, `⇧⌘P`) and with a space elsewhere (`Ctrl K`, `Ctrl Shift P`).\n * On screen, prefer `<Kbd hotkey>`, which draws one cap per key.\n *\n * `apple` defaults to the current platform, which a server can't know: while\n * rendering, pass `useApplePlatform()` so the server markup and the first\n * client render agree. `translations` is `<Kbd>`'s (`{ ctrl: \"Strg\" }` gives\n * `Strg K`).\n */\nexport const formatHotkey = (\n hotkey: string,\n apple = isApplePlatform(),\n translations?: Partial<KbdTranslations>,\n): string => hotkeyKeys(hotkey, apple, translations).join(apple ? \"\" : \" \")\n\n/** Input types where keys are commands, not text. */\nconst NON_TEXT_INPUTS = [\n \"checkbox\",\n \"radio\",\n \"range\",\n \"button\",\n \"submit\",\n \"reset\",\n \"color\",\n \"file\",\n \"image\",\n \"hidden\",\n]\n\n/** Where a keystroke types text rather than issuing a command: a text-like\n * `input`, a `textarea`, or a `contenteditable`. Not a checkbox, radio,\n * slider or file input, nor a `select` or a button: keys there are commands. */\nconst TEXT_FIELD = [\n \"textarea\",\n '[contenteditable]:not([contenteditable=\"false\"])',\n `input${NON_TEXT_INPUTS.map((type) => `:not([type=\"${type}\"])`).join(\"\")}`,\n].join(\", \")\n\nconst inTextField = (target: EventTarget | null): boolean =>\n target instanceof Element && target.closest(TEXT_FIELD) !== null\n\ntype Inputs = \"allow\" | \"ignore\" | \"only\"\n\n/** Whether `inputs` lets an event through, given whether it came from a text field. */\nconst INPUTS: Record<Inputs, (typing: boolean) => boolean> = {\n allow: () => true,\n ignore: (typing) => !typing,\n only: (typing) => typing,\n}\n\n/** The boolean form, kept from before the three modes. */\nconst LEGACY_INPUTS: Record<\"true\" | \"false\", Inputs> = { true: \"allow\", false: \"ignore\" }\n\n/** Can't type a character: it holds ⌘/Ctrl/Alt, or is a modifier itself. */\nconst chorded = (hotkey: ParsedHotkey): boolean =>\n hotkey.meta || hotkey.ctrl || hotkey.alt || Object.values(MODIFIER_KEY).includes(hotkey.key)\n\n/** The mode `inputs` resolves to for one hotkey. */\nconst inputMode = (inputs: HotkeyOptions[\"inputs\"], hotkey: ParsedHotkey): Inputs =>\n typeof inputs === \"boolean\"\n ? LEGACY_INPUTS[`${inputs}`]\n : (inputs ?? (chorded(hotkey) ? \"allow\" : \"ignore\"))\n\n/** A scope that can't take part right now: inert (a closed Collapse) or\n * hidden (an inactive Tabs panel), itself or through an ancestor. */\nconst unavailable = (scope: Element): boolean => scope.closest(\"[inert], [hidden]\") !== null\n\n/** The default `when`: skip what a component already handled. */\nconst unhandled = (event: KeyboardEvent): boolean => !event.defaultPrevented\n\nexport type HotkeyOptions = {\n /**\n * Whether the hotkey fires while typing in a text field (a text `input`,\n * `textarea` or `contenteditable`; buttons, sliders, checkboxes and selects\n * are not text fields):\n *\n * - `\"allow\"` (or `true`): anywhere, e.g. ⌘K.\n * - `\"ignore\"` (or `false`): not while typing, e.g. `/` or `?`, which would\n * otherwise swallow the character being typed (WCAG 2.1.4).\n * - `\"only\"`: only while typing, e.g. ⌘↵ to submit, Esc to clear.\n *\n * Defaults to `\"allow\"` for a hotkey holding ⌘/Ctrl/Alt (or a bare\n * modifier), which typing can't produce, and `\"ignore\"` for a bare key or a\n * `shift+` one, which would type a character. With an array, each hotkey\n * gets its own default.\n */\n inputs?: Inputs | boolean\n /** Fire only while focus is inside this element. A scope that is `inert`\n * or `hidden` (or inside one) counts as outside. */\n scope?: RefObject<Element | null>\n /** With `scope`: the pointer resting on the scope counts as being inside\n * it, no focus needed (hover a row, press `e` to archive it).\n * @default false */\n hover?: boolean\n /**\n * Yield while an overlay (Modal, Drawer, Popover, a picker's list) is open\n * above the component that bound the hotkey. A page's `j`/`k` go quiet\n * under a Modal; a Modal's own hotkey fires while it is on top and goes\n * quiet when something opens from it. Pass `false` for a hotkey that must\n * also reach the overlay it opened, like a toggle (Spotlight's ⌘K).\n * @default true\n */\n layer?: boolean\n /**\n * Also fire on the keydowns a held key auto-repeats. Off by default: a held\n * key firing an action thirty times a second (toggling fullscreen, opening\n * and closing a panel, deleting rows) is the costly surprise, while the\n * hotkeys that want it (`j`/`k` to move through a list) are few and opt in\n * with one word. A skipped repeat still has its default prevented, so a\n * held ⌘S doesn't fall through to the browser's Save dialog.\n * @default false\n */\n repeat?: boolean\n /** Fire on `keydown`, or on `keyup` for hold-and-release: a `keydown` and a\n * `keyup` hotkey on `\"alt\"` show hints while ⌥ is held.\n * @default \"keydown\" */\n event?: \"keydown\" | \"keyup\"\n /**\n * The last word on whether a matched event fires, after every option above.\n * Covers what they don't, such as yielding to a focused button or slider.\n *\n * It replaces the default, which skips an event a component already\n * handled (`event.defaultPrevented`: Select's ↵, zag's Esc). Keep that\n * check in yours unless the hotkey should run even then:\n *\n * when: (event) => !event.defaultPrevented && !isSlider(event.target)\n * when: () => true // also fire on handled events\n */\n when?: (event: KeyboardEvent) => boolean\n}\n\n/**\n * Call `handler` when one of `keys` is pressed. `false` (or `undefined`) binds\n * nothing. The matched event's default is prevented, so the browser's own\n * shortcut on the same keys doesn't also run.\n *\n * By default it fires anywhere in the document, except: in a text field for a\n * bare-key hotkey (`/`, `?`; a ⌘/Ctrl/Alt one fires there too), while an\n * overlay is open above the component that bound it, on a held key's\n * repeats, or on an event a component already handled. The options narrow or\n * widen that; see `HotkeyOptions`. A hotkey with an unknown modifier binds\n * nothing and warns in development.\n *\n * useHotkey(\"mod+k\", () => spotlight.toggle(), { layer: false })\n * useHotkey(\"/\", () => search.focus(), { inputs: \"ignore\" })\n * useHotkey([\"j\", \"arrowdown\"], next, { scope: list, repeat: true })\n */\nexport function useHotkey(\n keys: string | string[] | false | undefined,\n handler: (event: KeyboardEvent) => void,\n {\n inputs,\n scope,\n hover = false,\n layer = true,\n repeat = false,\n event: type = \"keydown\",\n when = unhandled,\n }: HotkeyOptions = {},\n): void {\n const onMatch = useEffectEvent(handler)\n const allowed = useEffectEvent(when)\n const covered = useLayerCovered()\n // One string for the deps, so an inline array doesn't rebind every render.\n // A newline can't be part of a hotkey.\n const signature = keys ? [keys].flat().join(\"\\n\") : \"\"\n useEffect(() => {\n if (!signature) return\n const hotkeys = signature.split(\"\\n\")\n const parsed = hotkeys.map((hotkey) => parseHotkey(hotkey))\n const unknown = parsed.flatMap((hotkey) => hotkey.unknown)\n if (unknown.length > 0) {\n devWarn(\n `useHotkey(\"${hotkeys.join('\", \"')}\"): unknown modifier ${unknown.map((part) => `\"${part}\"`).join(\", \")}, so nothing is bound. Use mod, meta (cmd, command), ctrl (control), alt (option) or shift, joined with \"+\", the key last: \"mod+shift+k\".`,\n )\n return\n }\n // The element under the pointer, for `hover`.\n let pointed: EventTarget | null = null\n const onPointerOver = (event: PointerEvent) => {\n pointed = event.target\n }\n const onPointerOut = (event: PointerEvent) => {\n // Out of the window: nothing is hovered any more.\n if (event.relatedTarget === null) pointed = null\n }\n const inScope = (event: KeyboardEvent): boolean => {\n if (!scope) return true\n const element = scope.current\n if (!element || unavailable(element)) return false\n const inside = (target: EventTarget | null) =>\n target instanceof Node && element.contains(target)\n return inside(event.target) || (hover && inside(pointed))\n }\n const onKey = (event: KeyboardEvent) => {\n const matched = parsed.find((hotkey) => matchParsed(hotkey, event))\n if (!matched) return\n if (layer && covered()) return\n if (!INPUTS[inputMode(inputs, matched)](inTextField(event.target))) return\n if (!inScope(event)) return\n if (!allowed(event)) return\n event.preventDefault()\n if (event.repeat && !repeat) return\n onMatch(event)\n }\n window.addEventListener(type, onKey)\n if (hover) {\n document.addEventListener(\"pointerover\", onPointerOver)\n document.addEventListener(\"pointerout\", onPointerOut)\n }\n return () => {\n window.removeEventListener(type, onKey)\n document.removeEventListener(\"pointerover\", onPointerOver)\n document.removeEventListener(\"pointerout\", onPointerOut)\n }\n }, [signature, inputs, scope, hover, layer, repeat, type, covered])\n}\n\nconst noSubscription = () => () => {}\n\n/**\n * Whether `mod` is ⌘ for this user, to label a shortcut hint (`⌘` vs `Ctrl`).\n * `false` during SSR and hydration, so the markup can't mismatch.\n */\nexport const useApplePlatform = (): boolean =>\n useSyncExternalStore(noSubscription, isApplePlatform, () => false)\n"]}
1
+ {"version":3,"sources":["../src/lib/use-hotkey.ts"],"names":[],"mappings":";;;;;AAsCA,IAAM,QAAA,GAAoD;AAAA,EACxD,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,MAAA;AAAA,EACL,OAAA,EAAS,MAAA;AAAA,EACT,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,MAAA;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KAAK","file":"chunk-2CL3FKEY.js","sourcesContent":["\"use client\"\n\nimport {\n ArrowBigUp,\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowRightToLine,\n ArrowUp,\n ChevronUp,\n Command,\n CornerDownLeft,\n Delete,\n type LucideIcon,\n Option,\n} from \"lucide-react\"\nimport { type RefObject, useEffect, useEffectEvent, useSyncExternalStore } from \"react\"\nimport { devWarn } from \"./dev-warn\"\nimport { useLayerCovered } from \"./overlay-layer\"\n\n/**\n * A small, platform-aware keyboard shortcut matcher: `\"mod+k\"`, `\"shift+mod+p\"`,\n * `\"alt+/\"`.\n *\n * - `mod` is ⌘ on Apple platforms and Ctrl elsewhere, the usual convention for\n * app shortcuts. `meta` / `cmd` and `ctrl` name one key explicitly.\n * - The last part is the key, compared case-insensitively with `event.key`, so\n * it follows the user's keyboard layout. The space bar is `space`. Modifiers must match exactly:\n * `mod+k` doesn't fire on ⌘⇧K.\n * - The key can be a modifier itself (`\"alt\"`, for hold-to-peek): its own flag\n * is then ignored, since pressing ⌥ sets `altKey` and releasing it clears it.\n * - An event fired while an IME is composing is ignored.\n * - A part that names no modifier (`\"ctl+k\"`) makes the hotkey match nothing,\n * rather than silently dropping it and firing on a bare `k`.\n */\n\ntype Modifiers = { meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }\n\nconst MODIFIER: Record<string, keyof Modifiers | \"mod\"> = {\n mod: \"mod\",\n meta: \"meta\",\n cmd: \"meta\",\n command: \"meta\",\n ctrl: \"ctrl\",\n control: \"ctrl\",\n alt: \"alt\",\n option: \"alt\",\n shift: \"shift\",\n}\n\n/** A modifier as the key itself, spelled the way `event.key` spells it. */\nconst MODIFIER_KEY: Record<keyof Modifiers, string> = {\n meta: \"meta\",\n ctrl: \"control\",\n alt: \"alt\",\n shift: \"shift\",\n}\n\n/** Whether the user agent is an Apple platform (macOS, iOS, iPadOS): `mod` is ⌘ there. */\nexport const isApplePlatform = (): boolean => {\n if (typeof navigator === \"undefined\") return false\n const nav: Navigator & { userAgentData?: { platform?: string } } = navigator\n return /mac|iphone|ipad|ipod/i.test(nav.userAgentData?.platform ?? nav.platform ?? \"\")\n}\n\nexport type ParsedHotkey = Modifiers & {\n key: string\n /** Modifier parts that name no known modifier — a typo like `ctl`. */\n unknown: string[]\n}\n\ntype HotkeyEvent = Pick<\n KeyboardEvent,\n \"key\" | \"metaKey\" | \"ctrlKey\" | \"altKey\" | \"shiftKey\" | \"isComposing\"\n>\n\nconst resolveModifier = (part: string, apple: boolean): keyof Modifiers | undefined => {\n const modifier = MODIFIER[part]\n return modifier === \"mod\" ? (apple ? \"meta\" : \"ctrl\") : modifier\n}\n\n/** Parse a hotkey once: its key and the exact modifiers it needs. */\nexport const parseHotkey = (hotkey: string, apple = isApplePlatform()): ParsedHotkey => {\n const parts = hotkey\n .toLowerCase()\n .split(\"+\")\n .map((part) => part.trim())\n // A trailing \"+\" names the plus key itself: \"mod++\".\n const last = hotkey.endsWith(\"+\") ? \"+\" : (parts.at(-1) ?? \"\")\n const named = parts.slice(0, hotkey.endsWith(\"+\") ? -2 : -1)\n // A modifier as the key (`\"alt\"`, `\"mod\"`) is spelled as `event.key` has it.\n const self = resolveModifier(last, apple)\n const modifiers = named.map((part) => resolveModifier(part, apple))\n return {\n key: self ? MODIFIER_KEY[self] : last,\n meta: modifiers.includes(\"meta\"),\n ctrl: modifiers.includes(\"ctrl\"),\n alt: modifiers.includes(\"alt\"),\n shift: modifiers.includes(\"shift\"),\n unknown: named.filter((part) => MODIFIER[part] === undefined),\n }\n}\n\n/** Whether `event` is the already-parsed hotkey. */\nconst matchParsed = (parsed: ParsedHotkey, event: HotkeyEvent): boolean => {\n // `event.key` is a literal \" \" for the space bar, which a hotkey spells `space`.\n const key = event.key === \" \" ? \"space\" : event.key.toLowerCase()\n // Pressing a modifier sets its own flag (and releasing it clears it), so a\n // modifier that is the key itself is checked by `key` alone.\n const flag = (modifier: keyof Modifiers, pressed: boolean) =>\n key === MODIFIER_KEY[modifier] || pressed === parsed[modifier]\n return (\n !event.isComposing &&\n parsed.unknown.length === 0 &&\n key === parsed.key &&\n flag(\"meta\", event.metaKey) &&\n flag(\"ctrl\", event.ctrlKey) &&\n flag(\"alt\", event.altKey) &&\n flag(\"shift\", event.shiftKey)\n )\n}\n\n/** Whether `event` is `hotkey`. See the module doc for the rules. */\nexport const matchHotkey = (\n hotkey: string,\n event: HotkeyEvent,\n apple = isApplePlatform(),\n): boolean => matchParsed(parseHotkey(hotkey, apple), event)\n\n/**\n * The words a key cap reads as, keyed by the English string each replaces:\n * the word a cap shows (`ctrl`, `escape`) or the name it is spoken by (`command`,\n * `up`). Apple and the other platforms name some keys differently, so each\n * spelling has its own key: `return` / `enter`, `option` / `alt`, `delete`\n * (⌫ on a Mac) / `backspace`. `KEY_LABEL` says which key uses which; these\n * only replace the strings. `Intl` has no display names for keys, so these are\n * plain translations, English by default (`KBD_DEFAULT_TRANSLATIONS`).\n */\nexport type KbdTranslations = {\n /** ⌘, spoken on Apple. */\n command: string\n /** The Meta (Windows) key's word, off Apple. */\n meta: string\n /** ⌃, spoken on Apple. */\n control: string\n /** Ctrl's word, off Apple. \"Strg\" on a German keyboard. */\n ctrl: string\n /** ⌥, spoken on Apple. */\n option: string\n /** Alt's word, off Apple. */\n alt: string\n /** ⇧, spoken on every platform. */\n shift: string\n /** ↵, spoken on Apple. */\n return: string\n /** ↵, spoken off Apple. \"Entrée\" in French. */\n enter: string\n /** ⌫, spoken on Apple. */\n delete: string\n /** ⌫'s word, off Apple. \"Rücktaste\" in German, \"Retour arrière\" in French. */\n backspace: string\n /** ⌦, spoken on Apple. */\n forwardDelete: string\n /** ⌦'s word, off Apple. \"Suppr\" on a French keyboard, \"Entf\" on a German one. */\n del: string\n /** ⇥, spoken on every platform. */\n tab: string\n /** The arrows, spoken on every platform. */\n up: string\n down: string\n left: string\n right: string\n /** Esc's word, on every platform. \"Échap\" on a French keyboard. */\n escape: string\n /** The space bar's word, on every platform. */\n space: string\n /** Page Up and Page Down's words, on every platform. */\n pageUp: string\n pageDown: string\n}\n\n/** The English key words: what `<Kbd hotkey>`, `hotkeyKeys` and `formatHotkey`\n * read as without `translations`, and the base a partial override is merged onto. */\nexport const KBD_DEFAULT_TRANSLATIONS = {\n command: \"Command\",\n meta: \"Meta\",\n control: \"Control\",\n ctrl: \"Ctrl\",\n option: \"Option\",\n alt: \"Alt\",\n shift: \"Shift\",\n return: \"Return\",\n enter: \"Enter\",\n delete: \"Delete\",\n backspace: \"Backspace\",\n forwardDelete: \"Forward Delete\",\n del: \"Del\",\n tab: \"Tab\",\n up: \"Up Arrow\",\n down: \"Down Arrow\",\n left: \"Left Arrow\",\n right: \"Right Arrow\",\n escape: \"Esc\",\n space: \"Space\",\n pageUp: \"PgUp\",\n pageDown: \"PgDn\",\n} as const satisfies KbdTranslations\n\ntype KeyWord = keyof KbdTranslations\n\n/**\n * How a key reads on a key cap. One entry per key that doesn't read as typed:\n *\n * - `glyph`: the symbol Apple writes (⌘, ⇧, ↵), spoken there as `name` (a\n * bare `⌘` has no reliable spoken form).\n * - `text`: the word Windows and Linux write (`Ctrl`, `Shift`, `Enter`),\n * spoken there as itself.\n * - `icon`: what a `<Kbd>` cap draws for the key on every platform, so\n * Shift is the same arrow on a Mac and on a PC.\n * - `appleIcon`: an icon drawn on Apple only: the symbols only Apple uses\n * (⌘ ⌥ ⌃), and ⌫. Elsewhere those keys stay words: there is no honest icon\n * for Ctrl, Alt or the Windows key, and ⌫ reads as the Left Arrow there,\n * where the keyboard prints \"Backspace\".\n *\n * `text` and `name` are `KbdTranslations` keys, so a translation replaces the\n * word and never the key data. Apple platforms take the glyph and fall back to\n * the text; elsewhere it is the reverse, so a key with only a glyph (the\n * arrows) is a symbol everywhere and one with only a text (`Esc`) is a word\n * everywhere. Anything not listed is shown as typed, its first letter\n * upper-cased.\n */\ntype KeyLabel = {\n glyph?: string\n text?: KeyWord\n icon?: LucideIcon\n appleIcon?: LucideIcon\n name?: KeyWord\n}\n\nconst KEY_LABEL: Record<string, KeyLabel> = {\n meta: { glyph: \"⌘\", appleIcon: Command, name: \"command\", text: \"meta\" },\n control: { glyph: \"⌃\", appleIcon: ChevronUp, name: \"control\", text: \"ctrl\" },\n alt: { glyph: \"⌥\", appleIcon: Option, name: \"option\", text: \"alt\" },\n shift: { glyph: \"⇧\", icon: ArrowBigUp, name: \"shift\", text: \"shift\" },\n enter: { glyph: \"↵\", icon: CornerDownLeft, name: \"return\", text: \"enter\" },\n // An icon on Apple only: elsewhere ⌫ reads as ← (the Left Arrow), and the key\n // is printed \"Backspace\" on those keyboards.\n backspace: { glyph: \"⌫\", appleIcon: Delete, name: \"delete\", text: \"backspace\" },\n delete: { glyph: \"⌦\", name: \"forwardDelete\", text: \"del\" },\n tab: { glyph: \"⇥\", icon: ArrowRightToLine, name: \"tab\", text: \"tab\" },\n arrowup: { glyph: \"↑\", icon: ArrowUp, name: \"up\" },\n arrowdown: { glyph: \"↓\", icon: ArrowDown, name: \"down\" },\n arrowleft: { glyph: \"←\", icon: ArrowLeft, name: \"left\" },\n arrowright: { glyph: \"→\", icon: ArrowRight, name: \"right\" },\n // macOS menus spell these out too.\n escape: { text: \"escape\" },\n esc: { text: \"escape\" },\n space: { text: \"space\" },\n pageup: { text: \"pageUp\" },\n pagedown: { text: \"pageDown\" },\n}\n\n/** Apple's order for modifier glyphs (⌃⌥⇧⌘), used on every platform. */\nconst MODIFIER_ORDER: (keyof Modifiers)[] = [\"ctrl\", \"alt\", \"shift\", \"meta\"]\n\n/**\n * One key cap of a hotkey: the text it reads as (`label`), and, when the\n * key is drawn rather than written, the `icon` to draw (none for a glyph\n * with no icon, like ⌦) and the `name` to speak.\n * `id` tells caps apart (`\"ctrl\"`, `\"shift\"`, …, `\"key\"` for the last).\n */\nexport type HotkeyCap = { id: string; label: string; icon?: LucideIcon; name?: string }\n\nconst keyCap = (\n id: string,\n key: string,\n apple: boolean,\n translations: Partial<KbdTranslations> | undefined,\n): HotkeyCap => {\n const entry = KEY_LABEL[key]\n // Merged per key; a key set to `undefined` keeps its English word.\n const word = (of?: KeyWord) => of && (translations?.[of] ?? KBD_DEFAULT_TRANSLATIONS[of])\n const text = word(entry?.text)\n const spoken = word(entry?.name)\n const label =\n (apple ? (entry?.glyph ?? text) : (text ?? entry?.glyph)) ??\n key.charAt(0).toUpperCase() + key.slice(1)\n const icon = apple ? (entry?.appleIcon ?? entry?.icon) : entry?.icon\n // Spoken the platform's way: Apple's key names there (\"Return\"), the\n // word elsewhere (\"Enter\"), the arrows' names on both.\n const name = apple ? spoken : (text ?? spoken)\n // An icon, or Apple's glyph where it has none (⌦), is drawn and spoken by\n // name; a word reads as itself.\n const drawn = icon !== undefined || (label === entry?.glyph && apple)\n return drawn && name ? { id, label, name, ...(icon && { icon }) } : { id, label }\n}\n\n/**\n * The caps of a hotkey, modifiers first in Apple's order. What `<Kbd hotkey>`\n * renders; `hotkeyKeys` is its text. `translations` replaces the English key\n * words per key (see `KbdTranslations`).\n */\nexport const hotkeyCaps = (\n hotkey: string,\n apple = isApplePlatform(),\n translations?: Partial<KbdTranslations>,\n): HotkeyCap[] => {\n const parsed = parseHotkey(hotkey, apple)\n return [\n ...MODIFIER_ORDER.filter((modifier) => parsed[modifier]).map((modifier) =>\n keyCap(modifier, MODIFIER_KEY[modifier], apple, translations),\n ),\n keyCap(\"key\", parsed.key, apple, translations),\n ]\n}\n\n/**\n * The keys of a hotkey, one label per key cap, the way the platform writes\n * them: `\"mod+k\"` is `[\"⌘\", \"K\"]` on Apple platforms and `[\"Ctrl\", \"K\"]`\n * elsewhere, `\"shift+mod+p\"` is `[\"⇧\", \"⌘\", \"P\"]` / `[\"Ctrl\", \"Shift\", \"P\"]`.\n * Modifiers come in Apple's order (⌃⌥⇧⌘) whatever order the string names\n * them in. Render one `<kbd>` per label, or let `<Kbd hotkey>` do it.\n *\n * `apple` defaults to the current platform, which a server can't know: while\n * rendering, pass `useApplePlatform()` so the server markup and the first\n * client render agree. `translations` is `<Kbd>`'s, so the text and the caps\n * read the same: `{ ctrl: \"Strg\" }` gives `[\"Strg\", \"K\"]`.\n */\nexport const hotkeyKeys = (\n hotkey: string,\n apple = isApplePlatform(),\n translations?: Partial<KbdTranslations>,\n): string[] => hotkeyCaps(hotkey, apple, translations).map((cap) => cap.label)\n\n/**\n * The label for a hotkey as one string, for plain-text places (a `title`, a\n * tooltip, a menu's text): `hotkeyKeys` joined, the Apple way with no space\n * (`⌘K`, `⇧⌘P`) and with a space elsewhere (`Ctrl K`, `Ctrl Shift P`).\n * On screen, prefer `<Kbd hotkey>`, which draws one cap per key.\n *\n * `apple` defaults to the current platform, which a server can't know: while\n * rendering, pass `useApplePlatform()` so the server markup and the first\n * client render agree. `translations` is `<Kbd>`'s (`{ ctrl: \"Strg\" }` gives\n * `Strg K`).\n */\nexport const formatHotkey = (\n hotkey: string,\n apple = isApplePlatform(),\n translations?: Partial<KbdTranslations>,\n): string => hotkeyKeys(hotkey, apple, translations).join(apple ? \"\" : \" \")\n\n/** Input types where keys are commands, not text. */\nconst NON_TEXT_INPUTS = [\n \"checkbox\",\n \"radio\",\n \"range\",\n \"button\",\n \"submit\",\n \"reset\",\n \"color\",\n \"file\",\n \"image\",\n \"hidden\",\n]\n\n/** Where a keystroke types text rather than issuing a command: a text-like\n * `input`, a `textarea`, or a `contenteditable`. Not a checkbox, radio,\n * slider or file input, nor a `select` or a button: keys there are commands. */\nconst TEXT_FIELD = [\n \"textarea\",\n '[contenteditable]:not([contenteditable=\"false\"])',\n `input${NON_TEXT_INPUTS.map((type) => `:not([type=\"${type}\"])`).join(\"\")}`,\n].join(\", \")\n\nconst inTextField = (target: EventTarget | null): boolean =>\n target instanceof Element && target.closest(TEXT_FIELD) !== null\n\ntype Inputs = \"allow\" | \"ignore\" | \"only\"\n\n/** Whether `inputs` lets an event through, given whether it came from a text field. */\nconst INPUTS: Record<Inputs, (typing: boolean) => boolean> = {\n allow: () => true,\n ignore: (typing) => !typing,\n only: (typing) => typing,\n}\n\n/** The boolean form, kept from before the three modes. */\nconst LEGACY_INPUTS: Record<\"true\" | \"false\", Inputs> = { true: \"allow\", false: \"ignore\" }\n\n/** Can't type a character: it holds ⌘/Ctrl/Alt, or is a modifier itself. */\nconst chorded = (hotkey: ParsedHotkey): boolean =>\n hotkey.meta || hotkey.ctrl || hotkey.alt || Object.values(MODIFIER_KEY).includes(hotkey.key)\n\n/** The mode `inputs` resolves to for one hotkey. */\nconst inputMode = (inputs: HotkeyOptions[\"inputs\"], hotkey: ParsedHotkey): Inputs =>\n typeof inputs === \"boolean\"\n ? LEGACY_INPUTS[`${inputs}`]\n : (inputs ?? (chorded(hotkey) ? \"allow\" : \"ignore\"))\n\n/** A scope that can't take part right now: inert (a closed Collapse) or\n * hidden (an inactive Tabs panel), itself or through an ancestor. */\nconst unavailable = (scope: Element): boolean => scope.closest(\"[inert], [hidden]\") !== null\n\n/** The default `when`: skip what a component already handled. */\nconst unhandled = (event: KeyboardEvent): boolean => !event.defaultPrevented\n\nexport type HotkeyOptions = {\n /**\n * Whether the hotkey fires while typing in a text field (a text `input`,\n * `textarea` or `contenteditable`; buttons, sliders, checkboxes and selects\n * are not text fields):\n *\n * - `\"allow\"` (or `true`): anywhere, e.g. ⌘K.\n * - `\"ignore\"` (or `false`): not while typing, e.g. `/` or `?`, which would\n * otherwise swallow the character being typed (WCAG 2.1.4).\n * - `\"only\"`: only while typing, e.g. ⌘↵ to submit, Esc to clear.\n *\n * Defaults to `\"allow\"` for a hotkey holding ⌘/Ctrl/Alt (or a bare\n * modifier), which typing can't produce, and `\"ignore\"` for a bare key or a\n * `shift+` one, which would type a character. With an array, each hotkey\n * gets its own default.\n */\n inputs?: Inputs | boolean\n /** Fire only while focus is inside this element. A scope that is `inert`\n * or `hidden` (or inside one) counts as outside. */\n scope?: RefObject<Element | null>\n /** With `scope`: the pointer resting on the scope counts as being inside\n * it, no focus needed (hover a row, press `e` to archive it).\n * @default false */\n hover?: boolean\n /**\n * Yield while an overlay (Modal, Drawer, Popover, a picker's list) is open\n * above the component that bound the hotkey. A page's `j`/`k` go quiet\n * under a Modal; a Modal's own hotkey fires while it is on top and goes\n * quiet when something opens from it. Pass `false` for a hotkey that must\n * also reach the overlay it opened, like a toggle (Spotlight's ⌘K).\n * @default true\n */\n layer?: boolean\n /**\n * Also fire on the keydowns a held key auto-repeats. Off by default: a held\n * key firing an action thirty times a second (toggling fullscreen, opening\n * and closing a panel, deleting rows) is the costly surprise, while the\n * hotkeys that want it (`j`/`k` to move through a list) are few and opt in\n * with one word. A skipped repeat still has its default prevented, so a\n * held ⌘S doesn't fall through to the browser's Save dialog.\n * @default false\n */\n repeat?: boolean\n /** Fire on `keydown`, or on `keyup` for hold-and-release: a `keydown` and a\n * `keyup` hotkey on `\"alt\"` show hints while ⌥ is held.\n * @default \"keydown\" */\n event?: \"keydown\" | \"keyup\"\n /**\n * The last word on whether a matched event fires, after every option above.\n * Covers what they don't, such as yielding to a focused button or slider.\n *\n * It replaces the default, which skips an event a component already\n * handled (`event.defaultPrevented`: Select's ↵, zag's Esc). Keep that\n * check in yours unless the hotkey should run even then:\n *\n * when: (event) => !event.defaultPrevented && !isSlider(event.target)\n * when: () => true // also fire on handled events\n */\n when?: (event: KeyboardEvent) => boolean\n}\n\n/**\n * Call `handler` when one of `keys` is pressed. `false` (or `undefined`) binds\n * nothing. The matched event's default is prevented, so the browser's own\n * shortcut on the same keys doesn't also run.\n *\n * By default it fires anywhere in the document, except: in a text field for a\n * bare-key hotkey (`/`, `?`; a ⌘/Ctrl/Alt one fires there too), while an\n * overlay is open above the component that bound it, on a held key's\n * repeats, or on an event a component already handled. The options narrow or\n * widen that; see `HotkeyOptions`. A hotkey with an unknown modifier binds\n * nothing and warns in development.\n *\n * useHotkey(\"mod+k\", () => spotlight.toggle(), { layer: false })\n * useHotkey(\"/\", () => search.focus(), { inputs: \"ignore\" })\n * useHotkey([\"j\", \"arrowdown\"], next, { scope: list, repeat: true })\n */\nexport function useHotkey(\n keys: string | string[] | false | undefined,\n handler: (event: KeyboardEvent) => void,\n {\n inputs,\n scope,\n hover = false,\n layer = true,\n repeat = false,\n event: type = \"keydown\",\n when = unhandled,\n }: HotkeyOptions = {},\n): void {\n const onMatch = useEffectEvent(handler)\n const allowed = useEffectEvent(when)\n const covered = useLayerCovered()\n // One string for the deps, so an inline array doesn't rebind every render.\n // A newline can't be part of a hotkey.\n const signature = keys ? [keys].flat().join(\"\\n\") : \"\"\n useEffect(() => {\n if (!signature) return\n const hotkeys = signature.split(\"\\n\")\n const parsed = hotkeys.map((hotkey) => parseHotkey(hotkey))\n const unknown = parsed.flatMap((hotkey) => hotkey.unknown)\n if (unknown.length > 0) {\n devWarn(\n `useHotkey(\"${hotkeys.join('\", \"')}\"): unknown modifier ${unknown.map((part) => `\"${part}\"`).join(\", \")}, so nothing is bound. Use mod, meta (cmd, command), ctrl (control), alt (option) or shift, joined with \"+\", the key last: \"mod+shift+k\".`,\n )\n return\n }\n // The element under the pointer, for `hover`.\n let pointed: EventTarget | null = null\n const onPointerOver = (event: PointerEvent) => {\n pointed = event.target\n }\n const onPointerOut = (event: PointerEvent) => {\n // Out of the window: nothing is hovered any more.\n if (event.relatedTarget === null) pointed = null\n }\n const inScope = (event: KeyboardEvent): boolean => {\n if (!scope) return true\n const element = scope.current\n if (!element || unavailable(element)) return false\n const inside = (target: EventTarget | null) =>\n target instanceof Node && element.contains(target)\n return inside(event.target) || (hover && inside(pointed))\n }\n const onKey = (event: KeyboardEvent) => {\n const matched = parsed.find((hotkey) => matchParsed(hotkey, event))\n if (!matched) return\n if (layer && covered()) return\n if (!INPUTS[inputMode(inputs, matched)](inTextField(event.target))) return\n if (!inScope(event)) return\n if (!allowed(event)) return\n event.preventDefault()\n if (event.repeat && !repeat) return\n onMatch(event)\n }\n window.addEventListener(type, onKey)\n if (hover) {\n document.addEventListener(\"pointerover\", onPointerOver)\n document.addEventListener(\"pointerout\", onPointerOut)\n }\n return () => {\n window.removeEventListener(type, onKey)\n document.removeEventListener(\"pointerover\", onPointerOver)\n document.removeEventListener(\"pointerout\", onPointerOut)\n }\n }, [signature, inputs, scope, hover, layer, repeat, type, covered])\n}\n\nconst noSubscription = () => () => {}\n\n/**\n * Whether `mod` is ⌘ for this user, to label a shortcut hint (`⌘` vs `Ctrl`).\n * `false` during SSR and hydration, so the markup can't mismatch.\n */\nexport const useApplePlatform = (): boolean =>\n useSyncExternalStore(noSubscription, isApplePlatform, () => false)\n"]}
@@ -1,4 +1,4 @@
1
- import { inputSlot, inputControlClasses, inputShell } from './chunk-3L5GLI67.js';
1
+ import { inputSlot, inputControlClasses, inputShell } from './chunk-I4B3N3UX.js';
2
2
  import { popoverClearTrigger } from './chunk-N66NC6QK.js';
3
3
  import { props } from './chunk-WYCMIIRR.js';
4
4
  import { cn } from './chunk-4ASNIDV7.js';
@@ -58,5 +58,5 @@ var ComboboxSearchRow = ({
58
58
  );
59
59
 
60
60
  export { ComboboxSearchRow };
61
- //# sourceMappingURL=chunk-OZMSXYBX.js.map
62
- //# sourceMappingURL=chunk-OZMSXYBX.js.map
61
+ //# sourceMappingURL=chunk-36NWC4GV.js.map
62
+ //# sourceMappingURL=chunk-36NWC4GV.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/combobox-list/combobox-search-row.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;AAqCO,IAAM,oBAAoB,CAAC;AAAA,EAChC,IAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,qBACE,IAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACE,GAAG,KAAA,CAAM,EAAE,gBAAgB,OAAA,EAAS,oBAAA,EAAsB,UAAU,CAAA;AAAA,IACrE,SAAA,EAAW,EAAA;AAAA,MACT,UAAA,CAAW,EAAE,IAAA,EAAM,OAAA,EAAS,CAAA;AAAA,MAC5B,iGAAA;AAAA,MACA,UAAA,EAAY;AAAA,KACd;AAAA,IAEC,QAAA,EAAA;AAAA,MAAA,KAAA,CAAM,MAAA,IAAU,wBACf,GAAA,CAAC,MAAA,EAAA,EAAK,WAAW,SAAA,EAAW,aAAA,EAAW,IAAA,EACpC,QAAA,EAAA,KAAA,CAAM,MAAA,EACT,CAAA;AAAA,sBAOF,GAAA;AAAA,QAACA,QAAA,CAAY,KAAA;AAAA,QAAZ;AAAA,UACC,WAAA;AAAA,UACA,MAAA;AAAA,UACA,GAAA;AAAA,UACC,GAAG,KAAA,CAAM,EAAE,gBAAgB,OAAA,EAAS,aAAA,EAAe,QAAQ,CAAA;AAAA,UAC5D,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,UAAA,EAAY,KAAK;AAAA;AAAA,OACtD;AAAA,MACC,QAAA,oBACC,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,QAAA;AAAA,UACL,YAAA,EAAY,UAAA;AAAA,UACZ,eAAa,CAAC,SAAA;AAAA,UACd,QAAA,EAAU,YAAY,CAAA,GAAI,EAAA;AAAA,UAC1B,aAAA,EAAe,CAAC,KAAA,KAAU,KAAA,CAAM,cAAA,EAAe;AAAA,UAC/C,OAAA,EAAS,OAAA;AAAA,UACT,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,CAAC,aAAa,WAAW,CAAA;AAAA,UAE3D,QAAA,EAAA,KAAA,CAAM;AAAA;AAAA;AACT;AAAA;AAEJ","file":"chunk-OZMSXYBX.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\nexport type ComboboxSearchRowProps = {\n size: InputSize\n variant: InputVariant\n invalid: boolean\n placeholder?: string\n /** Reserves the clear button's box, so its showing never shifts the input's width. */\n canClear: boolean\n /** Shows the reserved clear button and makes it reachable. */\n showClear: boolean\n clearLabel: string\n onClear: () => void\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n ref?: Ref<HTMLInputElement>\n testId?: string\n icons: { search: ReactNode; clear: ReactNode }\n classNames?: { search?: string; input?: string }\n}\n\n/**\n * The always-open lists' search row — `ComboboxList` and `MultiComboboxList` — inside their\n * `Combobox.Root`: the magnifier, the search `<input>`, and the clear button.\n */\nexport const ComboboxSearchRow = ({\n size,\n variant,\n invalid,\n placeholder,\n canClear,\n showClear,\n clearLabel,\n onClear,\n onBlur,\n ref,\n testId,\n icons,\n classNames,\n}: ComboboxSearchRowProps) => (\n <div\n {...props({ \"data-invalid\": invalid, \"data-with-end-slot\": canClear })}\n className={cn(\n inputShell({ size, variant }),\n \"rounded-none border-t-0 border-e-0 border-s-0 border-b border-brand-900/20 dark:border-white/15\",\n classNames?.search,\n )}\n >\n {icons.search != null && (\n <span className={inputSlot} aria-hidden>\n {icons.search}\n </span>\n )}\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on the\n real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`, replicated\n here. `name` is intentionally NOT here — it would submit the typed\n search text, not the selection (the lists render hidden inputs). */}\n <ArkCombobox.Input\n placeholder={placeholder}\n onBlur={onBlur}\n ref={ref}\n {...props({ \"aria-invalid\": invalid, \"data-testid\": testId })}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {canClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n aria-hidden={!showClear}\n tabIndex={showClear ? 0 : -1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={onClear}\n className={cn(popoverClearTrigger, !showClear && \"invisible\")}\n >\n {icons.clear}\n </button>\n )}\n </div>\n)\n"]}
1
+ {"version":3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I,EAAA;AAAA,UAC1B,aAAA,EAAe,CAAC,KAAA,KAAU,KAAA,CAAM,cAAA,EAAe;AAAA,UAC/C,OAAA,EAAS,OAAA;AAAA,UACT,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,CAAC,aAAa,WAAW,CAAA;AAAA,UAE3D,QAAA,EAAA,KAAA,CAAM;AAAA;AAAA;AACT;AAAA;AAEJ","file":"chunk-36NWC4GV.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\nexport type ComboboxSearchRowProps = {\n size: InputSize\n variant: InputVariant\n invalid: boolean\n placeholder?: string\n /** Reserves the clear button's box, so its showing never shifts the input's width. */\n canClear: boolean\n /** Shows the reserved clear button and makes it reachable. */\n showClear: boolean\n clearLabel: string\n onClear: () => void\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n ref?: Ref<HTMLInputElement>\n testId?: string\n icons: { search: ReactNode; clear: ReactNode }\n classNames?: { search?: string; input?: string }\n}\n\n/**\n * The always-open lists' search row — `ComboboxList` and `MultiComboboxList` — inside their\n * `Combobox.Root`: the magnifier, the search `<input>`, and the clear button.\n */\nexport const ComboboxSearchRow = ({\n size,\n variant,\n invalid,\n placeholder,\n canClear,\n showClear,\n clearLabel,\n onClear,\n onBlur,\n ref,\n testId,\n icons,\n classNames,\n}: ComboboxSearchRowProps) => (\n <div\n {...props({ \"data-invalid\": invalid, \"data-with-end-slot\": canClear })}\n className={cn(\n inputShell({ size, variant }),\n \"rounded-none border-t-0 border-e-0 border-s-0 border-b border-brand-900/20 dark:border-white/15\",\n classNames?.search,\n )}\n >\n {icons.search != null && (\n <span className={inputSlot} aria-hidden>\n {icons.search}\n </span>\n )}\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on the\n real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`, replicated\n here. `name` is intentionally NOT here — it would submit the typed\n search text, not the selection (the lists render hidden inputs). */}\n <ArkCombobox.Input\n placeholder={placeholder}\n onBlur={onBlur}\n ref={ref}\n {...props({ \"aria-invalid\": invalid, \"data-testid\": testId })}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {canClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n aria-hidden={!showClear}\n tabIndex={showClear ? 0 : -1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={onClear}\n className={cn(popoverClearTrigger, !showClear && \"invisible\")}\n >\n {icons.clear}\n </button>\n )}\n </div>\n)\n"]}
@@ -1,7 +1,7 @@
1
- import { ComboboxSearchRow } from './chunk-OZMSXYBX.js';
1
+ import { ComboboxSearchRow } from './chunk-36NWC4GV.js';
2
2
  import { normalizeSelectData, useLabelSearch, filterSelectData } from './chunk-7TDHT3QD.js';
3
- import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from './chunk-YPFSRZ3T.js';
4
- import { FieldShell } from './chunk-VD6PB3VA.js';
3
+ import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from './chunk-6UIQJJNJ.js';
4
+ import { FieldShell } from './chunk-X6DESK37.js';
5
5
  import { popoverIndicator } from './chunk-N66NC6QK.js';
6
6
  import { useUncontrolled } from './chunk-PMUCGFY5.js';
7
7
  import { CheckIcon, CloseIcon } from './chunk-6YNLRQ25.js';
@@ -143,5 +143,5 @@ var ComboboxList = ({
143
143
  };
144
144
 
145
145
  export { ComboboxList };
146
- //# sourceMappingURL=chunk-4FEOMQYR.js.map
147
- //# sourceMappingURL=chunk-4FEOMQYR.js.map
146
+ //# sourceMappingURL=chunk-54W6VAI3.js.map
147
+ //# sourceMappingURL=chunk-54W6VAI3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources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AS,KAAA,EAAT,EAAiC,KAAA,EAAO,KAAA,CAAM,KAAA,EAC5C,gBAAM,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA,EAAA,EADV,KAAA,CAAM,KAE3B,CACD,CAAA,GACD,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA;AAAA,UACzB,SAAS,IAAA,oBAAQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C,CAAA;AAAA,QAKC,IAAA,IAAQ,wBAAQ,GAAA,CAAC,OAAA,EAAA,EAAM,MAAK,QAAA,EAAS,IAAA,EAAY,KAAA,EAAO,KAAA,IAAS,EAAA,EAAI;AAAA;AAAA;AAAA,GACxE;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-4FEOMQYR.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\nimport { popoverIndicator } from \"../popover/popover\"\nimport { ComboboxSearchRow } from \"./combobox-search-row\"\n\n/**\n * ComboboxList — a searchable, single-value option list with no trigger of its\n * own. It renders permanently open: embed it inline inside a container you\n * already control the visibility of (a `Popover`, a `Drawer`, a custom panel)\n * rather than owning a floating dropdown. For a self-contained trigger +\n * floating panel, use [`Select`](/docs/select) instead — same `data` contract\n * and value shape, just with its own closed/open trigger button.\n *\n * - `data` / `value` / `onChange` match `Select` exactly\n * (`SelectValue<Data> | null`) — the picked value must come from `data`;\n * for free text see [`Autocomplete`](/docs/autocomplete).\n * - Type to filter; `clearable` adds a clear button next to the search icon\n * once there's a value.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype ComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type ComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type ComboboxListIcons = IconMap<ComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's check. */\nexport const DEFAULT_ICONS: Record<ComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type ComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled value. */\n value?: SelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SelectValue<Data> | null\n /** Fires with the selected value (or `null` when cleared). */\n onChange?: (value: SelectValue<Data> | null) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a clear button once there's a value. */\n clearable?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission. */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: ComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: ComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: ComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type ComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\n/** Wrap a scalar value into Ark's array contract (or clear with `[]`) — same\n * bridge `Select` uses (`toArkValue`, `select.tsx`). */\nconst toArkValue = (v: string | null): string[] => (v === null ? [] : [v])\n\nexport const ComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: ComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setValue] = useUncontrolled<Item | null>({\n value: valueProp,\n defaultValue: defaultValue ?? null,\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n // Normalize once per `data`; only the filter re-runs as the query changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(\n () => filterSelectData(normalized, (item) => labelSearch.matches(item.label, search)),\n [normalized, search, labelSearch],\n )\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && (value != null || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item, state)\n : // `Combobox.Item`'s own label + check row, with the check from `icons`.\n () => (\n <>\n <ArkCombobox.ItemText>{item.label}</ArkCombobox.ItemText>\n <ArkCombobox.ItemIndicator className={popoverIndicator}>\n {icons.check}\n </ArkCombobox.ItemIndicator>\n </>\n )}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n collection={collection}\n value={toArkValue(value)}\n // Ark types the value as `string[]`; it always originates from `data`,\n // so narrow it back to the caller's value union.\n onValueChange={(details) => setValue((details.value[0] ?? null) as Item)}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValue(null)\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Carries the real selection so a native `<form>` submits it — the\n search input is unnamed (it would submit the typed query, not the\n value). */}\n {name != null && <input type=\"hidden\" name={name} value={value ?? \"\"} />}\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/combobox-list/combobox-list.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;AA8DO,IAAM,aAAA,GAAyD;AAAA,EACpE,MAAA,kBAAQ,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC3C,KAAA,sBAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,EAClB,KAAA,sBAAQ,SAAA,EAAA,EAAU;AACpB,CAAA;AA4DA,IAAM,UAAA,GAAa,CAAC,CAAA,KAAgC,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Q,wBAAQ,GAAA,CAAC,OAAA,EAAA,EAAM,MAAK,QAAA,EAAS,IAAA,EAAY,KAAA,EAAO,KAAA,IAAS,EAAA,EAAI;AAAA;AAAA;AAAA,GACxE;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-54W6VAI3.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\nimport { popoverIndicator } from \"../popover/popover\"\nimport { ComboboxSearchRow } from \"./combobox-search-row\"\n\n/**\n * ComboboxList — a searchable, single-value option list with no trigger of its\n * own. It renders permanently open: embed it inline inside a container you\n * already control the visibility of (a `Popover`, a `Drawer`, a custom panel)\n * rather than owning a floating dropdown. For a self-contained trigger +\n * floating panel, use [`Select`](/docs/select) instead — same `data` contract\n * and value shape, just with its own closed/open trigger button.\n *\n * - `data` / `value` / `onChange` match `Select` exactly\n * (`SelectValue<Data> | null`) — the picked value must come from `data`;\n * for free text see [`Autocomplete`](/docs/autocomplete).\n * - Type to filter; `clearable` adds a clear button next to the search icon\n * once there's a value.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype ComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type ComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type ComboboxListIcons = IconMap<ComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's check. */\nexport const DEFAULT_ICONS: Record<ComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type ComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled value. */\n value?: SelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SelectValue<Data> | null\n /** Fires with the selected value (or `null` when cleared). */\n onChange?: (value: SelectValue<Data> | null) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a clear button once there's a value. */\n clearable?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission. */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: ComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: ComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: ComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type ComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\n/** Wrap a scalar value into Ark's array contract (or clear with `[]`) — same\n * bridge `Select` uses (`toArkValue`, `select.tsx`). */\nconst toArkValue = (v: string | null): string[] => (v === null ? [] : [v])\n\nexport const ComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: ComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setValue] = useUncontrolled<Item | null>({\n value: valueProp,\n defaultValue: defaultValue ?? null,\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n // Normalize once per `data`; only the filter re-runs as the query changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(\n () => filterSelectData(normalized, (item) => labelSearch.matches(item.label, search)),\n [normalized, search, labelSearch],\n )\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && (value != null || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item, state)\n : // `Combobox.Item`'s own label + check row, with the check from `icons`.\n () => (\n <>\n <ArkCombobox.ItemText>{item.label}</ArkCombobox.ItemText>\n <ArkCombobox.ItemIndicator className={popoverIndicator}>\n {icons.check}\n </ArkCombobox.ItemIndicator>\n </>\n )}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n collection={collection}\n value={toArkValue(value)}\n // Ark types the value as `string[]`; it always originates from `data`,\n // so narrow it back to the caller's value union.\n onValueChange={(details) => setValue((details.value[0] ?? null) as Item)}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValue(null)\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Carries the real selection so a native `<form>` submits it — the\n search input is unnamed (it would submit the typed query, not the\n value). */}\n {name != null && <input type=\"hidden\" name={name} value={value ?? \"\"} />}\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
@@ -1,8 +1,8 @@
1
- import { ComboboxSearchRow } from './chunk-OZMSXYBX.js';
1
+ import { ComboboxSearchRow } from './chunk-36NWC4GV.js';
2
2
  import { controlIndicator } from './chunk-NLOBBJAA.js';
3
3
  import { normalizeSelectData, useLabelSearch, filterSelectData } from './chunk-7TDHT3QD.js';
4
- import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from './chunk-YPFSRZ3T.js';
5
- import { FieldShell } from './chunk-VD6PB3VA.js';
4
+ import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from './chunk-6UIQJJNJ.js';
5
+ import { FieldShell } from './chunk-X6DESK37.js';
6
6
  import { useUncontrolled } from './chunk-PMUCGFY5.js';
7
7
  import { CheckIcon, CloseIcon } from './chunk-6YNLRQ25.js';
8
8
  import { mergeIcons, iconStroke } from './chunk-XXOR34T4.js';
@@ -160,5 +160,5 @@ var MultiComboboxList = ({
160
160
  };
161
161
 
162
162
  export { MultiComboboxList };
163
- //# sourceMappingURL=chunk-SZEOTXRZ.js.map
164
- //# sourceMappingURL=chunk-SZEOTXRZ.js.map
163
+ //# sourceMappingURL=chunk-6II2DVYR.js.map
164
+ //# sourceMappingURL=chunk-6II2DVYR.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/multi-combobox-list/multi-combobox-list.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;AAiEO,IAAM,aAAA,GAA8D;AAAA,EACzE,MAAA,kBAAQ,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC3C,KAAA,sBAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,EAClB,KAAA,sBAAQ,SAAA,EAAA,EAAU;AACpB,CAAA;AA8DO,IAAM,oBAAoB,CAA6C;AAAA,EAC5E,IAAA;AAAA,EACA,KAAA,EAAO,SAAA;AAAA,EACP,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA,GAAc,cAAA;AAAA,EACd,KAAA,GAAQ,eAAA;AAAA,EACR,SAAA;AAAA,EACA,SAAA;AAAA,EACA,iBAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,OAAA,GAAU,UAAA;AAAA,EACV,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,KAAA,EAAO;AACT,CAAA,KAAoC;AAClC,EAAA,MAAM,KAAA,GAAQ,UAAA,CAAW,aAAA,EAAe,SAAS,CAAA;AACjD,EAAA,MAAM,UAAA,GACJ,YAAA,EAAc,iBAAA,IAAqB,6BAAA,CAA8B,iBAAA;AAKnE,EAAA,MAAM,SAAA,GAAY,WAAW,KAAA,IAAS,IAAA;AAEtC,EAAA,MAAM,CAAC,KAAA,EAAO,WAAW,CAAA,GAAI,eAAA,C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AA,EAAO,CAAA,EAAA,EAApC,CAAuC,CAAE;AAAA;AAAA;AAAA,GACzF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-SZEOTXRZ.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { controlIndicator } from \"../checkbox/control\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { ComboboxSearchRow } from \"../combobox-list/combobox-search-row\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\n\n/**\n * MultiComboboxList — a searchable, multi-value option list with no trigger of\n * its own. Same idea as [`ComboboxList`](/docs/combobox-list) but for several\n * values at once: every option shows a checkbox instead of a single check\n * mark, and picking one doesn't close the list. It renders permanently open —\n * embed it inline inside a container you already control the visibility of\n * (a `Popover`, a `Drawer`, a custom panel).\n *\n * - `data` / `value` / `onChange` match [`MultiSelect`](/docs/multi-select)\n * exactly (`SelectValue<Data>[]`) — but options render as a checkbox list\n * rather than pills in the input, which is lighter in a compact popover.\n * - Type to filter; `clearable` clears every value at once; `maxValues` caps\n * the selection; `hidePickedOptions` drops chosen options from the list.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype MultiComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The checkbox indicator inside an option row. */\n checkbox?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type MultiComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type MultiComboboxListIcons = IconMap<MultiComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's checkbox mark. */\nexport const DEFAULT_ICONS: Record<MultiComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type MultiComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled selected values. */\n value?: SelectValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: SelectValue<Data>[]\n /** Fires with the full selection on every add / remove. */\n onChange?: (value: SelectValue<Data>[]) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including the\n * checkbox affordance. Omit it to render the checkbox + label.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a button that clears every value at once. */\n clearable?: boolean\n /** Cap the number of selected values. */\n maxValues?: number\n /** Hide options that are already selected. */\n hidePickedOptions?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission (one hidden input per value). */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: MultiComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: MultiComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: MultiComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type MultiComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\nexport const MultiComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n maxValues,\n hidePickedOptions,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: MultiComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setSelected] = useUncontrolled<Item[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n const setValues = (next: Item[]) => {\n // Adding past the cap is rejected; removals always pass.\n if (maxValues != null && next.length > value.length && next.length > maxValues) {\n return\n }\n setSelected(next)\n }\n\n // Normalize once per `data`; only the filter re-runs as the query/selection changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(() => {\n const picked = new Set<string>(value)\n return filterSelectData(\n normalized,\n (item) =>\n (!hidePickedOptions || !picked.has(item.value)) && labelSearch.matches(item.label, search),\n )\n }, [normalized, search, hidePickedOptions, value, labelSearch])\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && ((value != null && value.length > 0) || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={cn(\"group/item\", classNames?.option)}\n >\n {(state) =>\n renderItem ? (\n renderItem(item, state)\n ) : (\n <>\n {/* Presentational: the option row owns the selection semantics.\n It borrows Checkbox's own box, driven by `data-state` the way\n Ark drives the real one, so the two never drift apart. */}\n <span\n aria-hidden\n data-state={state.selected ? \"checked\" : \"unchecked\"}\n className={cn(controlIndicator({ size, variant: \"filled\" }), classNames?.checkbox)}\n >\n <ArkCombobox.ItemIndicator>{icons.check}</ArkCombobox.ItemIndicator>\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{item.label}</span>\n </>\n )\n }\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n multiple\n collection={collection}\n value={value}\n // Ark types the values as `string[]`; they always originate from `data`,\n // so narrow them back to the caller's value union.\n onValueChange={(details) => setValues(details.value as Item[])}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n selectionBehavior=\"clear\"\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValues([])\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Hidden inputs carry the real selection so a native `<form>` submits\n the value array (the search input is unnamed). When controlled by a\n form library the value flows through `onChange` instead, and these\n are just submitted alongside it. */}\n {name != null && value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/multi-combobox-list/multi-combobox-list.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;AAiEO,IAAM,aAAA,GAA8D;AAAA,EACzE,MAAA,kBAAQ,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC3C,KAAA,sBAAQ,SAAA,EAAA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ourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { controlIndicator } from \"../checkbox/control\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { ComboboxSearchRow } from \"../combobox-list/combobox-search-row\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\n\n/**\n * MultiComboboxList — a searchable, multi-value option list with no trigger of\n * its own. Same idea as [`ComboboxList`](/docs/combobox-list) but for several\n * values at once: every option shows a checkbox instead of a single check\n * mark, and picking one doesn't close the list. It renders permanently open —\n * embed it inline inside a container you already control the visibility of\n * (a `Popover`, a `Drawer`, a custom panel).\n *\n * - `data` / `value` / `onChange` match [`MultiSelect`](/docs/multi-select)\n * exactly (`SelectValue<Data>[]`) — but options render as a checkbox list\n * rather than pills in the input, which is lighter in a compact popover.\n * - Type to filter; `clearable` clears every value at once; `maxValues` caps\n * the selection; `hidePickedOptions` drops chosen options from the list.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype MultiComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The checkbox indicator inside an option row. */\n checkbox?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type MultiComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type MultiComboboxListIcons = IconMap<MultiComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's checkbox mark. */\nexport const DEFAULT_ICONS: Record<MultiComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type MultiComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled selected values. */\n value?: SelectValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: SelectValue<Data>[]\n /** Fires with the full selection on every add / remove. */\n onChange?: (value: SelectValue<Data>[]) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including the\n * checkbox affordance. Omit it to render the checkbox + label.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a button that clears every value at once. */\n clearable?: boolean\n /** Cap the number of selected values. */\n maxValues?: number\n /** Hide options that are already selected. */\n hidePickedOptions?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission (one hidden input per value). */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: MultiComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: MultiComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: MultiComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type MultiComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\nexport const MultiComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n maxValues,\n hidePickedOptions,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: MultiComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setSelected] = useUncontrolled<Item[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n const setValues = (next: Item[]) => {\n // Adding past the cap is rejected; removals always pass.\n if (maxValues != null && next.length > value.length && next.length > maxValues) {\n return\n }\n setSelected(next)\n }\n\n // Normalize once per `data`; only the filter re-runs as the query/selection changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(() => {\n const picked = new Set<string>(value)\n return filterSelectData(\n normalized,\n (item) =>\n (!hidePickedOptions || !picked.has(item.value)) && labelSearch.matches(item.label, search),\n )\n }, [normalized, search, hidePickedOptions, value, labelSearch])\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && ((value != null && value.length > 0) || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={cn(\"group/item\", classNames?.option)}\n >\n {(state) =>\n renderItem ? (\n renderItem(item, state)\n ) : (\n <>\n {/* Presentational: the option row owns the selection semantics.\n It borrows Checkbox's own box, driven by `data-state` the way\n Ark drives the real one, so the two never drift apart. */}\n <span\n aria-hidden\n data-state={state.selected ? \"checked\" : \"unchecked\"}\n className={cn(controlIndicator({ size, variant: \"filled\" }), classNames?.checkbox)}\n >\n <ArkCombobox.ItemIndicator>{icons.check}</ArkCombobox.ItemIndicator>\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{item.label}</span>\n </>\n )\n }\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n multiple\n collection={collection}\n value={value}\n // Ark types the values as `string[]`; they always originate from `data`,\n // so narrow them back to the caller's value union.\n onValueChange={(details) => setValues(details.value as Item[])}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n selectionBehavior=\"clear\"\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValues([])\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Hidden inputs carry the real selection so a native `<form>` submits\n the value array (the search input is unnamed). When controlled by a\n form library the value flows through `onChange` instead, and these\n are just submitted alongside it. */}\n {name != null && value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Button } from './chunk-SWVUXEBT.js';
1
+ import { Button } from './chunk-SCXXJDKQ.js';
2
2
  import { saveFile } from './chunk-EIBDLRAR.js';
3
3
  import { mergeIcons, iconStroke } from './chunk-XXOR34T4.js';
4
4
  import { Spinner } from './chunk-D2QIPQ74.js';
@@ -136,5 +136,5 @@ var DownloadButton = ({
136
136
  };
137
137
 
138
138
  export { DOWNLOAD_BUTTON_DEFAULT_TRANSLATIONS, DownloadButton };
139
- //# sourceMappingURL=chunk-DJLNGWMM.js.map
140
- //# sourceMappingURL=chunk-DJLNGWMM.js.map
139
+ //# sourceMappingURL=chunk-6IRMKF5T.js.map
140
+ //# sourceMappingURL=chunk-6IRMKF5T.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/download-button/download-button.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAkEO,IAAM,oCAAA,GAA6E;AAAA,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,CAAC,WAAQ,KAAA,EAAO,IAAA,EAAM,IAAK,IAAA,CAAK,QAAA;AAAA,QAClD,OAAA;AAAA,QACA,QAAA;AAAA,QAEA,SAAA,EAAW,EAAA,CAAG,UAAA,EAAY,SAAS,CAAA;AAAA,QAClC,GAAG,OAAA;AAAA,QAEH,QAAA,EAAA;AAAA,UAAA,QAAA,IAAY,CAAA,CAAE,KAAA;AAAA,UACd,wBAAQ,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,SAAA,EAAW,YAAE,OAAA,EAAQ;AAAA;AAAA;AAAA,KAChD;AAAA,oBAEF,GAAA,CAAC,MAAA,EAAA,EAAK,IAAA,EAAK,QAAA,EAAS,SAAA,EAAW,cAAc,YAAA,EAAW,iBAAA,EAAkB,WAAA,EAAU,QAAA,EACjF,QAAA,EAAA,OAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-DJLNGWMM.js","sourcesContent":["\"use client\"\n\nimport { ark } from \"@ark-ui/react\"\nimport { Download } from \"lucide-react\"\nimport { type MouseEvent, type ReactNode, useEffect, useRef, useState } from \"react\"\nimport { withAsChildContent } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport { saveFile } from \"../../lib/save-file\"\nimport { Button, type ButtonProps } from \"../button/button\"\nimport { Spinner } from \"../spinner/spinner\"\n\n/**\n * DownloadButton — a button that saves a file: a Blob you already have, a\n * URL, or whatever a function of yours resolves to (an authenticated fetch,\n * a presign call, a generated CSV). The kit makes no request itself.\n *\n * - **While a function's promise is pending** the button is busy: a\n * spinner, `aria-busy`, and re-clicks are ignored, so a double click\n * saves one file. It stays enabled and focused, unlike Button's\n * `loading`, which sets `disabled` and drops keyboard focus.\n * - **On failure**, a polite status region says so (`translations.error`)\n * and `onError` gets the error. Nothing is announced on success: the\n * browser's own download UI is the feedback.\n * - **Unmounting mid-fetch** aborts: the function's `signal` fires and\n * nothing is saved afterwards.\n * - Renders a kit `Button` by default. With `asChild`, only the behaviour\n * goes onto your element (an `ActionIcon` in a row's actions), and its\n * content is swapped for the spinner while busy.\n *\n * Built on `saveFile` (`lib/save-file.ts`) rather than Ark's\n * `DownloadTrigger`: Ark's trigger has no pending state, drops a rejected\n * promise, can't be aborted, and reads a string as the file's *contents*\n * rather than a URL.\n *\n * ```tsx\n * <DownloadButton\n * name=\"transcript.pdf\"\n * data={({ signal }) => api.get(`/transcripts/${id}`, { signal }).then((r) => r.blob())}\n * onError={() => notify.error(\"Couldn't download the transcript\")}\n * />\n * ```\n */\n\n/** What can be saved: a Blob (or File), or a URL. */\nexport type DownloadData = Blob | string\n\n/** Resolves the file on click. `signal` aborts when the button unmounts first. */\nexport type DownloadLoader = (context: {\n signal: AbortSignal\n}) => DownloadData | Promise<DownloadData>\n\n/** What `data` takes: the value itself, or a function that resolves it on click. */\nexport type DownloadSource = DownloadData | DownloadLoader\n\nexport type DownloadButtonTranslations = {\n /** The default label, when there are no `children`. @default \"Download\" */\n label?: string\n /** Added to the button's name while `data` is resolving. @default \"Preparing download…\" */\n loading?: string\n /** What the status region says when the download fails.\n * @default (name) => name ? `${name} couldn't be downloaded` : \"The download failed\" */\n error?: (name: string | undefined) => string\n}\n\nexport const DOWNLOAD_BUTTON_DEFAULT_TRANSLATIONS: Required<DownloadButtonTranslations> = {\n label: \"Download\",\n loading: \"Preparing download…\",\n error: (name) => (name ? `${name} couldn't be downloaded` : \"The download failed\"),\n}\n\nexport type DownloadButtonIconSlot = \"download\"\n\nconst DEFAULT_ICONS: Record<DownloadButtonIconSlot, ReactNode> = {\n download: <Download className={iconStroke} />,\n}\n\nexport type DownloadButtonProps = Omit<\n ButtonProps,\n \"type\" | \"name\" | \"loading\" | \"startSlot\" | \"onError\"\n> & {\n /** The file: a Blob, a URL, or a function resolving one on click (passed an abort `signal`). */\n data: DownloadSource\n /** The file name. Ignored by browsers for a cross-origin URL; see `saveFile`. */\n name?: string\n /** The MIME type, for a Blob without one. */\n type?: string\n /** Fires when `data` rejects or the save throws. */\n onError?: (error: unknown) => void\n /** Fires once the file has been handed to the browser. */\n onDone?: () => void\n translations?: DownloadButtonTranslations\n /** `download`, the leading icon. `null` renders none. Not shown under `asChild`. */\n icons?: IconMap<DownloadButtonIconSlot>\n}\n\n/** Tailwind's `sr-only`, fixed rather than absolute: it is rendered beside the\n * button, outside any box of ours, and a fixed box can't stretch a scroller. */\nconst statusRegion =\n \"fixed size-px -m-px p-0 overflow-hidden whitespace-nowrap border-0 [clip-path:inset(50%)]\"\n\n/** Calls the loader now, inside the click, and treats a synchronous throw as a rejection. */\nconst started = (load: DownloadLoader, signal: AbortSignal): Promise<DownloadData> => {\n try {\n return Promise.resolve(load({ signal }))\n } catch (error) {\n return Promise.reject(error)\n }\n}\n\nexport const DownloadButton = ({\n data,\n name,\n type,\n onError,\n onDone,\n translations,\n icons,\n asChild,\n children,\n testId,\n onClick,\n variant,\n size,\n color,\n endSlot,\n disabled,\n className,\n ...rest\n}: DownloadButtonProps) => {\n const t = { ...DOWNLOAD_BUTTON_DEFAULT_TRANSLATIONS, ...translations }\n const icon = mergeIcons(DEFAULT_ICONS, icons)\n const [busy, setBusy] = useState(false)\n const [failure, setFailure] = useState(\"\")\n // The run in flight, if any: the re-click guard and the unmount abort. A\n // ref, so two clicks in one frame can't both read a stale `busy`.\n const running = useRef<AbortController | null>(null)\n\n useEffect(() => () => running.current?.abort(), [])\n\n const fail = (error: unknown) => {\n setFailure(t.error(name))\n onError?.(error)\n }\n\n // `onDone` sits outside the try, so a throw in the caller's own callback\n // isn't announced as a failed download.\n const save = (value: DownloadData) => {\n try {\n saveFile(value, name, { type })\n } catch (error) {\n return fail(error)\n }\n onDone?.()\n }\n\n const resolve = async (load: DownloadLoader) => {\n const controller = new AbortController()\n running.current = controller\n setBusy(true)\n const outcome = await started(load, controller.signal).then(\n (value) => ({ value }),\n (error: unknown) => ({ error }),\n )\n running.current = null\n // Unmounted meanwhile: nothing to save, and no state left to update.\n if (controller.signal.aborted) return\n setBusy(false)\n if (\"error\" in outcome) fail(outcome.error)\n else save(outcome.value)\n }\n\n // `onClick` runs first, so a caller can `preventDefault()` to stop the save\n // (a confirm step). A value is saved inside the click itself; a function's\n // promise is awaited, and the save follows when it settles.\n const download = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (event.defaultPrevented || disabled || running.current) return\n // An `asChild` link would also follow its own href.\n event.preventDefault()\n setFailure(\"\")\n if (typeof data === \"function\") void resolve(data)\n else save(data)\n }\n\n const trigger = {\n \"data-scope\": \"download-button\",\n \"data-part\": \"trigger\",\n onClick: download,\n ...props({\n \"aria-busy\": busy,\n \"data-loading\": busy,\n \"data-testid\": testId,\n \"data-disabled\": disabled,\n }),\n ...rest,\n }\n\n return (\n <>\n {asChild ? (\n // Only behaviour is merged onto the child: Button's styling would\n // fight an ActionIcon's own. While busy the spinner stands in for the\n // child's content (its icon); its name stays the child's own label.\n <ark.button\n asChild\n disabled={disabled}\n {...props({ \"aria-disabled\": disabled })}\n className={className}\n {...trigger}\n >\n {withAsChildContent(children, (own) => (busy ? <Spinner label={t.loading} /> : own))}\n </ark.button>\n ) : (\n <Button\n variant={variant}\n size={size}\n color={color}\n startSlot={busy ? <Spinner label={null} /> : icon.download}\n endSlot={endSlot}\n disabled={disabled}\n // `relative` holds the sr-only loading text inside the button.\n className={cn(\"relative\", className)}\n {...trigger}\n >\n {children ?? t.label}\n {busy && <span className=\"sr-only\">{t.loading}</span>}\n </Button>\n )}\n <span role=\"status\" className={statusRegion} data-scope=\"download-button\" data-part=\"status\">\n {failure}\n </span>\n </>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/download-button/download-button.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAkEO,IAAM,oCAAA,GAA6E;AAAA,EACxF,KAAA,EAAO,UAAA;AAAA,EACP,OAAA,EAAS,0BAAA;AAAA,EACT,OAAO,CAAC,IAAA,KAAU,IAAA,GAAO,C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,QAEA,SAAA,EAAW,EAAA,CAAG,UAAA,EAAY,SAAS,CAAA;AAAA,QAClC,GAAG,OAAA;AAAA,QAEH,QAAA,EAAA;AAAA,UAAA,QAAA,IAAY,CAAA,CAAE,KAAA;AAAA,UACd,wBAAQ,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,SAAA,EAAW,YAAE,OAAA,EAAQ;AAAA;AAAA;AAAA,KAChD;AAAA,oBAEF,GAAA,CAAC,MAAA,EAAA,EAAK,IAAA,EAAK,QAAA,EAAS,SAAA,EAAW,cAAc,YAAA,EAAW,iBAAA,EAAkB,WAAA,EAAU,QAAA,EACjF,QAAA,EAAA,OAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-6IRMKF5T.js","sourcesContent":["\"use client\"\n\nimport { ark } from \"@ark-ui/react\"\nimport { Download } from \"lucide-react\"\nimport { type MouseEvent, type ReactNode, useEffect, useRef, useState } from \"react\"\nimport { withAsChildContent } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport { saveFile } from \"../../lib/save-file\"\nimport { Button, type ButtonProps } from \"../button/button\"\nimport { Spinner } from \"../spinner/spinner\"\n\n/**\n * DownloadButton — a button that saves a file: a Blob you already have, a\n * URL, or whatever a function of yours resolves to (an authenticated fetch,\n * a presign call, a generated CSV). The kit makes no request itself.\n *\n * - **While a function's promise is pending** the button is busy: a\n * spinner, `aria-busy`, and re-clicks are ignored, so a double click\n * saves one file. It stays enabled and focused, unlike Button's\n * `loading`, which sets `disabled` and drops keyboard focus.\n * - **On failure**, a polite status region says so (`translations.error`)\n * and `onError` gets the error. Nothing is announced on success: the\n * browser's own download UI is the feedback.\n * - **Unmounting mid-fetch** aborts: the function's `signal` fires and\n * nothing is saved afterwards.\n * - Renders a kit `Button` by default. With `asChild`, only the behaviour\n * goes onto your element (an `ActionIcon` in a row's actions), and its\n * content is swapped for the spinner while busy.\n *\n * Built on `saveFile` (`lib/save-file.ts`) rather than Ark's\n * `DownloadTrigger`: Ark's trigger has no pending state, drops a rejected\n * promise, can't be aborted, and reads a string as the file's *contents*\n * rather than a URL.\n *\n * ```tsx\n * <DownloadButton\n * name=\"transcript.pdf\"\n * data={({ signal }) => api.get(`/transcripts/${id}`, { signal }).then((r) => r.blob())}\n * onError={() => notify.error(\"Couldn't download the transcript\")}\n * />\n * ```\n */\n\n/** What can be saved: a Blob (or File), or a URL. */\nexport type DownloadData = Blob | string\n\n/** Resolves the file on click. `signal` aborts when the button unmounts first. */\nexport type DownloadLoader = (context: {\n signal: AbortSignal\n}) => DownloadData | Promise<DownloadData>\n\n/** What `data` takes: the value itself, or a function that resolves it on click. */\nexport type DownloadSource = DownloadData | DownloadLoader\n\nexport type DownloadButtonTranslations = {\n /** The default label, when there are no `children`. @default \"Download\" */\n label?: string\n /** Added to the button's name while `data` is resolving. @default \"Preparing download…\" */\n loading?: string\n /** What the status region says when the download fails.\n * @default (name) => name ? `${name} couldn't be downloaded` : \"The download failed\" */\n error?: (name: string | undefined) => string\n}\n\nexport const DOWNLOAD_BUTTON_DEFAULT_TRANSLATIONS: Required<DownloadButtonTranslations> = {\n label: \"Download\",\n loading: \"Preparing download…\",\n error: (name) => (name ? `${name} couldn't be downloaded` : \"The download failed\"),\n}\n\nexport type DownloadButtonIconSlot = \"download\"\n\nconst DEFAULT_ICONS: Record<DownloadButtonIconSlot, ReactNode> = {\n download: <Download className={iconStroke} />,\n}\n\nexport type DownloadButtonProps = Omit<\n ButtonProps,\n \"type\" | \"name\" | \"loading\" | \"startSlot\" | \"onError\"\n> & {\n /** The file: a Blob, a URL, or a function resolving one on click (passed an abort `signal`). */\n data: DownloadSource\n /** The file name. Ignored by browsers for a cross-origin URL; see `saveFile`. */\n name?: string\n /** The MIME type, for a Blob without one. */\n type?: string\n /** Fires when `data` rejects or the save throws. */\n onError?: (error: unknown) => void\n /** Fires once the file has been handed to the browser. */\n onDone?: () => void\n translations?: DownloadButtonTranslations\n /** `download`, the leading icon. `null` renders none. Not shown under `asChild`. */\n icons?: IconMap<DownloadButtonIconSlot>\n}\n\n/** Tailwind's `sr-only`, fixed rather than absolute: it is rendered beside the\n * button, outside any box of ours, and a fixed box can't stretch a scroller. */\nconst statusRegion =\n \"fixed size-px -m-px p-0 overflow-hidden whitespace-nowrap border-0 [clip-path:inset(50%)]\"\n\n/** Calls the loader now, inside the click, and treats a synchronous throw as a rejection. */\nconst started = (load: DownloadLoader, signal: AbortSignal): Promise<DownloadData> => {\n try {\n return Promise.resolve(load({ signal }))\n } catch (error) {\n return Promise.reject(error)\n }\n}\n\nexport const DownloadButton = ({\n data,\n name,\n type,\n onError,\n onDone,\n translations,\n icons,\n asChild,\n children,\n testId,\n onClick,\n variant,\n size,\n color,\n endSlot,\n disabled,\n className,\n ...rest\n}: DownloadButtonProps) => {\n const t = { ...DOWNLOAD_BUTTON_DEFAULT_TRANSLATIONS, ...translations }\n const icon = mergeIcons(DEFAULT_ICONS, icons)\n const [busy, setBusy] = useState(false)\n const [failure, setFailure] = useState(\"\")\n // The run in flight, if any: the re-click guard and the unmount abort. A\n // ref, so two clicks in one frame can't both read a stale `busy`.\n const running = useRef<AbortController | null>(null)\n\n useEffect(() => () => running.current?.abort(), [])\n\n const fail = (error: unknown) => {\n setFailure(t.error(name))\n onError?.(error)\n }\n\n // `onDone` sits outside the try, so a throw in the caller's own callback\n // isn't announced as a failed download.\n const save = (value: DownloadData) => {\n try {\n saveFile(value, name, { type })\n } catch (error) {\n return fail(error)\n }\n onDone?.()\n }\n\n const resolve = async (load: DownloadLoader) => {\n const controller = new AbortController()\n running.current = controller\n setBusy(true)\n const outcome = await started(load, controller.signal).then(\n (value) => ({ value }),\n (error: unknown) => ({ error }),\n )\n running.current = null\n // Unmounted meanwhile: nothing to save, and no state left to update.\n if (controller.signal.aborted) return\n setBusy(false)\n if (\"error\" in outcome) fail(outcome.error)\n else save(outcome.value)\n }\n\n // `onClick` runs first, so a caller can `preventDefault()` to stop the save\n // (a confirm step). A value is saved inside the click itself; a function's\n // promise is awaited, and the save follows when it settles.\n const download = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (event.defaultPrevented || disabled || running.current) return\n // An `asChild` link would also follow its own href.\n event.preventDefault()\n setFailure(\"\")\n if (typeof data === \"function\") void resolve(data)\n else save(data)\n }\n\n const trigger = {\n \"data-scope\": \"download-button\",\n \"data-part\": \"trigger\",\n onClick: download,\n ...props({\n \"aria-busy\": busy,\n \"data-loading\": busy,\n \"data-testid\": testId,\n \"data-disabled\": disabled,\n }),\n ...rest,\n }\n\n return (\n <>\n {asChild ? (\n // Only behaviour is merged onto the child: Button's styling would\n // fight an ActionIcon's own. While busy the spinner stands in for the\n // child's content (its icon); its name stays the child's own label.\n <ark.button\n asChild\n disabled={disabled}\n {...props({ \"aria-disabled\": disabled })}\n className={className}\n {...trigger}\n >\n {withAsChildContent(children, (own) => (busy ? <Spinner label={t.loading} /> : own))}\n </ark.button>\n ) : (\n <Button\n variant={variant}\n size={size}\n color={color}\n startSlot={busy ? <Spinner label={null} /> : icon.download}\n endSlot={endSlot}\n disabled={disabled}\n // `relative` holds the sr-only loading text inside the button.\n className={cn(\"relative\", className)}\n {...trigger}\n >\n {children ?? t.label}\n {busy && <span className=\"sr-only\">{t.loading}</span>}\n </Button>\n )}\n <span role=\"status\" className={statusRegion} data-scope=\"download-button\" data-part=\"status\">\n {failure}\n </span>\n </>\n )\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { inputSlot, inputShell, inputControlClasses } from './chunk-3L5GLI67.js';
1
+ import { inputSlot, inputShell, inputControlClasses } from './chunk-I4B3N3UX.js';
2
2
  import { scrollHighlightedIntoView, popoverChevron, popoverClearTrigger, popoverList, popoverContent, popoverIndicator, popoverOption, popoverGroupLabel, popoverEmpty } from './chunk-N66NC6QK.js';
3
3
  import { useOverlayContainer } from './chunk-7P32XCEU.js';
4
4
  import { useNestedLayer } from './chunk-H7WOMZXO.js';
@@ -181,5 +181,5 @@ var Combobox = {
181
181
  };
182
182
 
183
183
  export { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox, resolveComboboxTranslations };
184
- //# sourceMappingURL=chunk-YPFSRZ3T.js.map
185
- //# sourceMappingURL=chunk-YPFSRZ3T.js.map
184
+ //# sourceMappingURL=chunk-6UIQJJNJ.js.map
185
+ //# sourceMappingURL=chunk-6UIQJJNJ.js.map