@ngrok/mantle 0.73.3 → 0.73.4

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 (261) hide show
  1. package/dist/accordion.d.ts +7 -9
  2. package/dist/accordion.js +1 -1
  3. package/dist/accordion.js.map +1 -1
  4. package/dist/agent.json +1 -1
  5. package/dist/alert-dialog.d.ts +33 -38
  6. package/dist/alert-dialog.js +1 -1
  7. package/dist/alert-dialog.js.map +1 -1
  8. package/dist/alert.d.ts +9 -11
  9. package/dist/alert.js +1 -1
  10. package/dist/alert.js.map +1 -1
  11. package/dist/{anchor-2stEauOz.js → anchor-CcTY5SIz.js} +2 -2
  12. package/dist/{anchor-2stEauOz.js.map → anchor-CcTY5SIz.js.map} +1 -1
  13. package/dist/anchor.d.ts +2 -3
  14. package/dist/anchor.js +1 -1
  15. package/dist/{as-child-CpZKMqTE.d.ts → as-child-uN_018tj.d.ts} +1 -1
  16. package/dist/badge.d.ts +3 -4
  17. package/dist/badge.js +1 -1
  18. package/dist/badge.js.map +1 -1
  19. package/dist/{booleanish-CBGdPL3Q.js → booleanish-BfvnW6vy.js} +1 -1
  20. package/dist/{booleanish-CBGdPL3Q.js.map → booleanish-BfvnW6vy.js.map} +1 -1
  21. package/dist/{browser-only-QPyyfLaB.js → browser-only-BSl_hruR.js} +1 -1
  22. package/dist/{browser-only-QPyyfLaB.js.map → browser-only-BSl_hruR.js.map} +1 -1
  23. package/dist/browser-only.js +1 -1
  24. package/dist/{button-POMJ-20y.js → button-BAxneEMu.js} +2 -2
  25. package/dist/{button-POMJ-20y.js.map → button-BAxneEMu.js.map} +1 -1
  26. package/dist/{button-DbHFERMB.d.ts → button-BYZOBUgj.d.ts} +16 -19
  27. package/dist/{button-GokecthL.js → button-uMIZVKit.js} +2 -2
  28. package/dist/{button-GokecthL.js.map → button-uMIZVKit.js.map} +1 -1
  29. package/dist/button.d.ts +4 -4
  30. package/dist/button.js +1 -1
  31. package/dist/calendar.d.ts +1 -2
  32. package/dist/calendar.js +1 -1
  33. package/dist/calendar.js.map +1 -1
  34. package/dist/card.d.ts +6 -7
  35. package/dist/card.js +1 -1
  36. package/dist/card.js.map +1 -1
  37. package/dist/checkbox.d.ts +3 -4
  38. package/dist/checkbox.js +1 -1
  39. package/dist/checkbox.js.map +1 -1
  40. package/dist/code-block.d.ts +17 -19
  41. package/dist/code-block.js +1 -1
  42. package/dist/code-block.js.map +1 -1
  43. package/dist/code-block_highlight-utils.d.ts +1 -1
  44. package/dist/code-block_highlight-utils.js +1 -1
  45. package/dist/code.d.ts +2 -3
  46. package/dist/code.js +1 -1
  47. package/dist/code.js.map +1 -1
  48. package/dist/color.d.ts +2 -2
  49. package/dist/color.js.map +1 -1
  50. package/dist/combobox.d.ts +11 -13
  51. package/dist/combobox.js +1 -1
  52. package/dist/combobox.js.map +1 -1
  53. package/dist/command.d.ts +133 -220
  54. package/dist/command.js +1 -1
  55. package/dist/command.js.map +1 -1
  56. package/dist/{compose-refs-DZ3cPi47.js → compose-refs-Cjf2gfB8.js} +1 -1
  57. package/dist/{compose-refs-DZ3cPi47.js.map → compose-refs-Cjf2gfB8.js.map} +1 -1
  58. package/dist/{copy-to-clipboard-CNMRyck4.js → copy-to-clipboard-Baw30q9O.js} +2 -2
  59. package/dist/{copy-to-clipboard-CNMRyck4.js.map → copy-to-clipboard-Baw30q9O.js.map} +1 -1
  60. package/dist/{cx-D1HYnpvA.js → cx-CBSnSC36.js} +1 -1
  61. package/dist/{cx-D1HYnpvA.js.map → cx-CBSnSC36.js.map} +1 -1
  62. package/dist/cx.js +1 -1
  63. package/dist/data-table.d.ts +13 -15
  64. package/dist/data-table.js +1 -1
  65. package/dist/data-table.js.map +1 -1
  66. package/dist/{deep-non-nullable-Xu7ckQM6.d.ts → deep-non-nullable-BxRoySYR.d.ts} +1 -1
  67. package/dist/description-list.d.ts +5 -6
  68. package/dist/description-list.js +1 -1
  69. package/dist/description-list.js.map +1 -1
  70. package/dist/{dialog-B1KCB7JT.js → dialog-Dn-brQBw.js} +2 -2
  71. package/dist/{dialog-B1KCB7JT.js.map → dialog-Dn-brQBw.js.map} +1 -1
  72. package/dist/dialog.d.ts +14 -17
  73. package/dist/dialog.js +1 -1
  74. package/dist/{direction-D9IZ1wW6.d.ts → direction-CcTY0FmA.d.ts} +2 -2
  75. package/dist/{direction-HqPHXGIs.js → direction-Wa9W2F61.js} +1 -1
  76. package/dist/{direction-HqPHXGIs.js.map → direction-Wa9W2F61.js.map} +1 -1
  77. package/dist/{dropdown-menu-CvOiQUSZ.d.ts → dropdown-menu-BgYk4L8o.d.ts} +22 -24
  78. package/dist/{dropdown-menu-DY4w933w.js → dropdown-menu-C3YZJBkV.js} +2 -2
  79. package/dist/{dropdown-menu-DY4w933w.js.map → dropdown-menu-C3YZJBkV.js.map} +1 -1
  80. package/dist/dropdown-menu.d.ts +1 -1
  81. package/dist/dropdown-menu.js +1 -1
  82. package/dist/empty.d.ts +7 -8
  83. package/dist/empty.js +1 -1
  84. package/dist/empty.js.map +1 -1
  85. package/dist/{field-context-B7Z1cmZW.js → field-context-4k1kI7Bo.js} +2 -2
  86. package/dist/{field-context-B7Z1cmZW.js.map → field-context-4k1kI7Bo.js.map} +1 -1
  87. package/dist/field.d.ts +23 -25
  88. package/dist/field.js +1 -1
  89. package/dist/field.js.map +1 -1
  90. package/dist/flag.d.ts +1 -2
  91. package/dist/flag.js +1 -1
  92. package/dist/flag.js.map +1 -1
  93. package/dist/hooks.d.ts +3 -3
  94. package/dist/hooks.js +1 -1
  95. package/dist/hooks.js.map +1 -1
  96. package/dist/hover-card.d.ts +4 -6
  97. package/dist/hover-card.js +1 -1
  98. package/dist/hover-card.js.map +1 -1
  99. package/dist/{icon-bWc5yC3-.js → icon-C8bYBIHW.js} +2 -2
  100. package/dist/{icon-bWc5yC3-.js.map → icon-C8bYBIHW.js.map} +1 -1
  101. package/dist/{icon-button-ZKN0sRIJ.js → icon-button-C_Ht_g1C.js} +2 -2
  102. package/dist/{icon-button-ZKN0sRIJ.js.map → icon-button-C_Ht_g1C.js.map} +1 -1
  103. package/dist/{icon-button-BDTb-lxs.d.ts → icon-button-ntupABbM.d.ts} +6 -8
  104. package/dist/{icon-BJ7q2RXZ.d.ts → icon-n49kOh4_.d.ts} +3 -4
  105. package/dist/icon.d.ts +3 -3
  106. package/dist/icon.js +1 -1
  107. package/dist/icons.d.ts +9 -10
  108. package/dist/icons.js +1 -1
  109. package/dist/icons.js.map +1 -1
  110. package/dist/{in-view-BUgyu-Tk.d.ts → in-view-BC3wmz-a.d.ts} +1 -1
  111. package/dist/{in-view-CeVqeGbv.js → in-view-C2DpZ6s0.js} +1 -1
  112. package/dist/{in-view-CeVqeGbv.js.map → in-view-C2DpZ6s0.js.map} +1 -1
  113. package/dist/{index-BhlxYL_y.d.ts → index-BL5WVva_.d.ts} +3 -6
  114. package/dist/{index-CWXKBva-.d.ts → index-DBZ3eRsl.d.ts} +5 -7
  115. package/dist/{index-DS_4n2eb.d.ts → index-DorCusfG.d.ts} +1 -1
  116. package/dist/{index-BbZBDzPh.d.ts → index-L3NmbHi5.d.ts} +1 -1
  117. package/dist/input.d.ts +7 -8
  118. package/dist/input.js +1 -1
  119. package/dist/input.js.map +1 -1
  120. package/dist/{is-input-CtUHJGgL.js → is-input-CXmS0OFN.js} +1 -1
  121. package/dist/{is-input-CtUHJGgL.js.map → is-input-CXmS0OFN.js.map} +1 -1
  122. package/dist/{kbd-CbMxDL9E.js → kbd-Bv6tefdB.js} +2 -2
  123. package/dist/{kbd-CbMxDL9E.js.map → kbd-Bv6tefdB.js.map} +1 -1
  124. package/dist/kbd.d.ts +1 -2
  125. package/dist/kbd.js +1 -1
  126. package/dist/{label-x6FcOpxc.js → label-DhIUmTN2.js} +2 -2
  127. package/dist/{label-x6FcOpxc.js.map → label-DhIUmTN2.js.map} +1 -1
  128. package/dist/label.d.ts +2 -4
  129. package/dist/label.js +1 -1
  130. package/dist/llms.txt +1 -1
  131. package/dist/main.d.ts +1 -2
  132. package/dist/main.js +1 -1
  133. package/dist/main.js.map +1 -1
  134. package/dist/media-object.d.ts +4 -5
  135. package/dist/media-object.js +1 -1
  136. package/dist/media-object.js.map +1 -1
  137. package/dist/multi-select.d.ts +16 -18
  138. package/dist/multi-select.js +1 -1
  139. package/dist/multi-select.js.map +1 -1
  140. package/dist/otp-input.d.ts +6 -7
  141. package/dist/otp-input.js +1 -1
  142. package/dist/otp-input.js.map +1 -1
  143. package/dist/pagination.d.ts +7 -9
  144. package/dist/pagination.js +1 -1
  145. package/dist/pagination.js.map +1 -1
  146. package/dist/{popover-CoZxokw_.js → popover-DponNBot.js} +2 -2
  147. package/dist/{popover-CoZxokw_.js.map → popover-DponNBot.js.map} +1 -1
  148. package/dist/popover.d.ts +6 -7
  149. package/dist/popover.js +1 -1
  150. package/dist/primitive-Cn3h4DJg.js +2 -0
  151. package/dist/primitive-Cn3h4DJg.js.map +1 -0
  152. package/dist/{primitive-qkxTYBUY.d.ts → primitive-D_-h74Kt.d.ts} +2 -3
  153. package/dist/progress.d.ts +4 -5
  154. package/dist/progress.js +1 -1
  155. package/dist/progress.js.map +1 -1
  156. package/dist/radio-group.d.ts +18 -20
  157. package/dist/radio-group.js +1 -1
  158. package/dist/radio-group.js.map +1 -1
  159. package/dist/{resolve-pre-rendered-props-BfWe69-w.js → resolve-pre-rendered-props-C-vrNxH1.js} +8 -8
  160. package/dist/resolve-pre-rendered-props-C-vrNxH1.js.map +1 -0
  161. package/dist/{resolve-pre-rendered-props-BONSCwYA.d.ts → resolve-pre-rendered-props-DxJ9-DAl.d.ts} +1 -1
  162. package/dist/sandboxed-on-click.d.ts +3 -4
  163. package/dist/sandboxed-on-click.js +1 -1
  164. package/dist/sandboxed-on-click.js.map +1 -1
  165. package/dist/{select-SZFFzYs0.d.ts → select-C15-XvRT.d.ts} +15 -16
  166. package/dist/select-Cxc9VmP8.js +2 -0
  167. package/dist/select-Cxc9VmP8.js.map +1 -0
  168. package/dist/select.d.ts +1 -1
  169. package/dist/select.js +1 -1
  170. package/dist/separator-Bqjy77rG.js +2 -0
  171. package/dist/separator-Bqjy77rG.js.map +1 -0
  172. package/dist/separator.d.ts +3 -5
  173. package/dist/separator.js +1 -1
  174. package/dist/sheet.d.ts +15 -19
  175. package/dist/sheet.js +1 -1
  176. package/dist/sheet.js.map +1 -1
  177. package/dist/skeleton.d.ts +4 -6
  178. package/dist/skeleton.js +1 -1
  179. package/dist/skeleton.js.map +1 -1
  180. package/dist/skip-to-main-link.d.ts +1 -2
  181. package/dist/skip-to-main-link.js +1 -1
  182. package/dist/skip-to-main-link.js.map +1 -1
  183. package/dist/slider.d.ts +1 -2
  184. package/dist/slider.js +1 -1
  185. package/dist/slider.js.map +1 -1
  186. package/dist/{slot-D_ZUrdEW.js → slot-CV5fmqFr.js} +2 -2
  187. package/dist/{slot-D_ZUrdEW.js.map → slot-CV5fmqFr.js.map} +1 -1
  188. package/dist/slot.d.ts +1 -1
  189. package/dist/slot.js +1 -1
  190. package/dist/{sort-mXo37xN2.js → sort-BPX2Fk9t.js} +2 -2
  191. package/dist/{sort-mXo37xN2.js.map → sort-BPX2Fk9t.js.map} +1 -1
  192. package/dist/split-button.d.ts +10 -12
  193. package/dist/split-button.js +1 -1
  194. package/dist/split-button.js.map +1 -1
  195. package/dist/{svg-only-7gYlsX8f.js → svg-only-Cz1cby8y.js} +2 -2
  196. package/dist/{svg-only-7gYlsX8f.js.map → svg-only-Cz1cby8y.js.map} +1 -1
  197. package/dist/{svg-only-D4uqM1OC.d.ts → svg-only-f6ToFLH0.d.ts} +3 -4
  198. package/dist/switch.d.ts +3 -5
  199. package/dist/switch.js +1 -1
  200. package/dist/switch.js.map +1 -1
  201. package/dist/{table-CjSQkfZe.d.ts → table-BWD9IlIN.d.ts} +10 -12
  202. package/dist/{table-CHd39aT-.js → table-eyoUW2Uv.js} +2 -2
  203. package/dist/{table-CHd39aT-.js.map → table-eyoUW2Uv.js.map} +1 -1
  204. package/dist/table.d.ts +1 -1
  205. package/dist/table.js +1 -1
  206. package/dist/tabs.d.ts +6 -9
  207. package/dist/tabs.js +1 -1
  208. package/dist/tabs.js.map +1 -1
  209. package/dist/text-area.d.ts +2 -3
  210. package/dist/text-area.js +1 -1
  211. package/dist/text-area.js.map +1 -1
  212. package/dist/theme-provider-MMwxHEfw.js +2 -0
  213. package/dist/theme-provider-MMwxHEfw.js.map +1 -0
  214. package/dist/theme.d.ts +9 -10
  215. package/dist/theme.js +1 -1
  216. package/dist/theme.js.map +1 -1
  217. package/dist/{themes-FPux5kIu.d.ts → themes-CYNpplwN.d.ts} +1 -1
  218. package/dist/toast-CR3MVChj.js +2 -0
  219. package/dist/toast-CR3MVChj.js.map +1 -0
  220. package/dist/toast.d.ts +8 -10
  221. package/dist/toast.js +1 -1
  222. package/dist/tooltip.d.ts +4 -6
  223. package/dist/tooltip.js +1 -1
  224. package/dist/tooltip.js.map +1 -1
  225. package/dist/{traffic-policy-file-BwHHdhWJ.js → traffic-policy-file-0g5RXFqu.js} +1 -1
  226. package/dist/{traffic-policy-file-BwHHdhWJ.js.map → traffic-policy-file-0g5RXFqu.js.map} +1 -1
  227. package/dist/{types-QKZ5fvaQ.d.ts → types-BvUzforF.d.ts} +1 -1
  228. package/dist/types-D85fCNV3.js +2 -0
  229. package/dist/{types-884RJJqm.js.map → types-D85fCNV3.js.map} +1 -1
  230. package/dist/types.d.ts +6 -6
  231. package/dist/types.js +1 -1
  232. package/dist/use-copy-to-clipboard-BLpquU9d.js +2 -0
  233. package/dist/{use-copy-to-clipboard-CTgtLjUg.js.map → use-copy-to-clipboard-BLpquU9d.js.map} +1 -1
  234. package/dist/{use-isomorphic-layout-effect-CNSD0lhi.js → use-isomorphic-layout-effect-DdTRtMY-.js} +1 -1
  235. package/dist/{use-isomorphic-layout-effect-CNSD0lhi.js.map → use-isomorphic-layout-effect-DdTRtMY-.js.map} +1 -1
  236. package/dist/{use-matches-media-query-CojcYxlA.js → use-matches-media-query-CMSxHR9n.js} +1 -1
  237. package/dist/{use-matches-media-query-CojcYxlA.js.map → use-matches-media-query-CMSxHR9n.js.map} +1 -1
  238. package/dist/{use-prefers-reduced-motion-Bpx8G3UT.js → use-prefers-reduced-motion-CWIoFA6W.js} +2 -2
  239. package/dist/{use-prefers-reduced-motion-Bpx8G3UT.js.map → use-prefers-reduced-motion-CWIoFA6W.js.map} +1 -1
  240. package/dist/utils.d.ts +2 -2
  241. package/dist/utils.js +1 -1
  242. package/dist/utils.js.map +1 -1
  243. package/dist/{validation-BYME8rWN.js → validation-DCyx-ceH.js} +1 -1
  244. package/dist/{validation-BYME8rWN.js.map → validation-DCyx-ceH.js.map} +1 -1
  245. package/dist/{validation-CBSOmooP.d.ts → validation-xyX_6kph.d.ts} +1 -1
  246. package/dist/{variant-props-BZbM__kQ.d.ts → variant-props-CVymuSfa.d.ts} +2 -2
  247. package/dist/{with-style-props-xzZLnIrF.d.ts → with-style-props-CyImx7vd.d.ts} +1 -1
  248. package/package.json +6 -6
  249. package/dist/primitive-tXm_8n_t.js +0 -2
  250. package/dist/primitive-tXm_8n_t.js.map +0 -1
  251. package/dist/resolve-pre-rendered-props-BfWe69-w.js.map +0 -1
  252. package/dist/select-B7orOUPj.js +0 -2
  253. package/dist/select-B7orOUPj.js.map +0 -1
  254. package/dist/separator-awchG4LI.js +0 -2
  255. package/dist/separator-awchG4LI.js.map +0 -1
  256. package/dist/theme-provider-BFcnjeME.js +0 -2
  257. package/dist/theme-provider-BFcnjeME.js.map +0 -1
  258. package/dist/toast-CGnquSKO.js +0 -2
  259. package/dist/toast-CGnquSKO.js.map +0 -1
  260. package/dist/types-884RJJqm.js +0 -2
  261. package/dist/use-copy-to-clipboard-CTgtLjUg.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-pre-rendered-props-C-vrNxH1.js","names":[],"sources":["../src/components/code-block/mantle-code.ts","../src/components/code-block/line-numbers.ts","../src/components/code-block/decorate-highlighted-html.ts","../src/components/code-block/fold-range-utils.ts","../src/components/code-block/compute-json-fold-ranges.ts","../src/components/code-block/compute-fold-ranges.ts","../src/components/code-block/indentation.ts","../src/components/code-block/normalize-indentation.ts","../src/components/code-block/supported-languages.ts","../src/components/code-block/parse-line-options.ts","../src/components/code-block/resolve-pre-rendered-props.ts"],"sourcesContent":["import type { SupportedLanguage } from \"../code-block/supported-languages.js\";\nimport type { LineRange } from \"../code-block/line-numbers.js\";\nimport type { Indentation } from \"../code-block/indentation.js\";\n\n/** Languages that represent shell/terminal commands. */\nconst shellLanguages = new Set<SupportedLanguage>([\"bash\", \"sh\", \"shell\"]);\n\n/** Returns the default `showLineNumbers` value for a given language and code string. Single-line shell snippets default to `false`; everything else defaults to `true`. */\nfunction defaultShowLineNumbers(language: SupportedLanguage, code: string): boolean {\n\tif (shellLanguages.has(language) && !code.trim().includes(\"\\n\")) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nconst mantleCodeBlockValueBrand: unique symbol = Symbol(\"MantleCodeBlockValue\");\n\n/**\n * The value produced by `mantleCode()`. Contains pre-rendered Shiki HTML (injected\n * by the Vite plugin at build time) and the original code string for the copy button.\n *\n * `~preHtml` is required at render time. Runtime syntax highlighting is intentionally\n * unsupported; only placeholder substitution for interpolated values is performed.\n */\ntype MantleCodeBlockValue = {\n\t/**\n\t * Nominal type brand to prevent accidental use of plain objects.\n\t */\n\t[mantleCodeBlockValueBrand]: true;\n\t/**\n\t * The language used for syntax highlighting.\n\t */\n\tlanguage: SupportedLanguage;\n\t/**\n\t * The original code string (used by the copy button).\n\t */\n\tcode: string;\n\t/**\n\t * Fully pre-rendered Shiki HTML injected by the Vite plugin or server highlighter.\n\t * This must be present for rendering.\n\t *\n\t * **Security:** This HTML is injected via `dangerouslySetInnerHTML`. It must\n\t * come from a trusted source (Shiki output from the Vite plugin or\n\t * `createMantleServerSyntaxHighlighter`). Never pass unsanitized user input.\n\t */\n\t\"~preHtml\"?: string | undefined;\n\t/**\n\t * Runtime values used to replace `SHIKI_VAL_N` placeholders in `~preHtml`.\n\t * This enables interpolated template expressions while preserving build-time highlighting.\n\t */\n\t\"~preVals\"?: unknown[] | undefined;\n\t/**\n\t * Placeholder token prefix used by the Vite transform for interpolated values.\n\t * When omitted, CodeBlock falls back to the legacy `SHIKI_VAL_<n>` format.\n\t */\n\t\"~preValToken\"?: string | undefined;\n\t/**\n\t * Optional default for line-number rendering when this value is displayed.\n\t */\n\t\"~showLineNumbers\"?: boolean | undefined;\n\t/**\n\t * Optional default highlighted line numbers/ranges when this value is displayed.\n\t */\n\t\"~highlightLines\"?: (LineRange | number)[] | undefined;\n\t/**\n\t * Optional default start line number when line numbers are displayed.\n\t * @default 1\n\t */\n\t\"~lineNumberStart\"?: number | undefined;\n};\n\n/** Maps each key starting with `OldPrefix` to `NewPrefix`, leaving other keys unchanged. */\ntype ReplacePrefix<T, OldPrefix extends string, NewPrefix extends string> = {\n\t[K in keyof T as K extends `${OldPrefix}${infer Rest}` ? `${NewPrefix}${Rest}` : K]: T[K];\n};\n\n/** Public input shape for `createMantleCodeBlockValue`, with `~`-prefixed keys renamed to unprefixed. */\ntype MantleCodeBlockValueInput = ReplacePrefix<\n\tOmit<MantleCodeBlockValue, typeof mantleCodeBlockValueBrand>,\n\t\"~\",\n\t\"\"\n>;\n\n/** Options for configuring line numbers, highlights, and indentation in `mantleCode()`. */\ntype MantleCodeOptions = {\n\t/** Line numbers or ranges to visually highlight in the code block. */\n\thighlightLines?: (LineRange | number)[] | undefined;\n\t/** The indentation style to use when normalizing the code string. */\n\tindentation?: Indentation | undefined;\n\t/**\n\t * The starting line number when line numbers are displayed.\n\t * @default 1\n\t */\n\tlineNumberStart?: number | undefined;\n\t/**\n\t * Whether to show line numbers in the code block. Defaults to `true` for most\n\t * languages, but `false` for single-line shell snippets (`bash`, `sh`, `shell`).\n\t */\n\tshowLineNumbers?: boolean | undefined;\n};\n\n/**\n * Creates a `MantleCodeBlockValue` for use with `CodeBlock.Code`.\n *\n * **Security:** The `preHtml` field is rendered via `dangerouslySetInnerHTML`.\n * Only pass HTML produced by Shiki (via the Vite plugin or\n * `createMantleServerSyntaxHighlighter`). Never pass unsanitized user input as `preHtml`.\n */\nfunction createMantleCodeBlockValue({\n\tpreHtml,\n\tpreValToken,\n\tpreVals,\n\thighlightLines,\n\tlineNumberStart,\n\tshowLineNumbers,\n\tcode,\n\tlanguage,\n}: MantleCodeBlockValueInput): MantleCodeBlockValue {\n\treturn {\n\t\t[mantleCodeBlockValueBrand]: true,\n\t\tlanguage,\n\t\tcode,\n\t\t\"~preHtml\": preHtml,\n\t\t\"~preValToken\": preValToken,\n\t\t\"~preVals\": preVals,\n\t\t\"~highlightLines\": highlightLines,\n\t\t\"~lineNumberStart\": lineNumberStart,\n\t\t\"~showLineNumbers\": showLineNumbers,\n\t};\n}\n\n/** Joins a `TemplateStringsArray` and its interpolated values into a single code string. */\nfunction buildCodeFromTemplate(strings: TemplateStringsArray, values: unknown[]): string {\n\tlet code = \"\";\n\tfor (let index = 0; index < strings.length; index += 1) {\n\t\tcode += strings[index] ?? \"\";\n\t\tif (index < values.length) {\n\t\t\tcode += String(values[index]);\n\t\t}\n\t}\n\treturn code;\n}\n\n/**\n * Tagged template literal for Shiki syntax highlighting.\n *\n * Returns a `MantleCodeBlockValue` that `CodeBlock.Code` renders.\n * The Vite transform plugin rewrites calls to this function at build time,\n * inlining pre-rendered Shiki HTML so that no highlighting work happens in the browser.\n * Configure it via `mantleCodeBlockPlugins()` in `vite.config.ts`.\n *\n * Interpolated template expressions are supported via placeholder substitution.\n *\n * Line numbers are shown by default (`showLineNumbers` defaults to `true`),\n * except for single-line shell snippets (`bash`, `sh`, `shell`) where they default to `false`.\n *\n * @example\n * ```tsx\n * // Static string (line numbers shown by default)\n * mantleCode(\"typescript\")`const x: string = \"hello\";`\n * // Interpolated string\n * mantleCode(\"typescript\")`const greeting = \"Hello, ${name}!\";`\n * // Disable line numbers\n * mantleCode(\"typescript\", { showLineNumbers: false })`const x = 1;`\n * // Single-line shell — line numbers hidden by default\n * mantleCode(\"bash\")`npm install @ngrok/mantle`\n * ```\n */\nfunction mantleCode(\n\tlanguage: SupportedLanguage,\n\toptions: MantleCodeOptions = {},\n): (strings: TemplateStringsArray, ...values: unknown[]) => MantleCodeBlockValue {\n\tconst { showLineNumbers, highlightLines, lineNumberStart } = options;\n\n\treturn (strings, ...values) => {\n\t\tconst code = buildCodeFromTemplate(strings, values);\n\n\t\treturn createMantleCodeBlockValue({\n\t\t\tlanguage,\n\t\t\tcode,\n\t\t\tpreHtml: undefined,\n\t\t\tpreVals: values.length > 0 ? values : undefined,\n\t\t\thighlightLines,\n\t\t\tlineNumberStart,\n\t\t\tshowLineNumbers: showLineNumbers ?? defaultShowLineNumbers(language, code),\n\t\t});\n\t};\n}\n\nexport { defaultShowLineNumbers, mantleCode };\nexport { createMantleCodeBlockValue };\nexport type { MantleCodeBlockValue, MantleCodeOptions };\n","/**\n * A line range is a string in the format of `start-end` where `start` and `end` are line numbers.\n */\nexport type LineRange = `${number}-${number}`;\n\nconst MAX_EXPANDED_LINE_RANGE_LENGTH = 1_000;\n\n/**\n * Given a list of line ranges and numbers, resolves them into a unique list of line numbers as a set.\n *\n * @example\n * ```tsx\n * const highlightedLines = resolveLineNumbers(1, \"3-5\", 7, \"10-12\");\n * // Returns: Set {1, 3, 4, 5, 7, 10, 11, 12}\n *\n * const singleLine = resolveLineNumbers(42);\n * // Returns: Set {42}\n * ```\n */\nexport function resolveLineNumbers(...items: (LineRange | number)[]): Set<number> {\n\tconst lineNumberSet = new Set<number>();\n\n\tfor (const item of items) {\n\t\tif (typeof item === \"number\") {\n\t\t\tif (!isPositiveLineNumber(item)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// only support integer line numbers\n\t\t\tconst int = Math.floor(item);\n\t\t\tlineNumberSet.add(int);\n\t\t} else {\n\t\t\tconst separatorIndex = item.indexOf(\"-\");\n\t\t\tconst startPart = item.slice(0, separatorIndex);\n\t\t\tconst endPart = item.slice(separatorIndex + 1);\n\t\t\tlet start = Number.parseInt(startPart, 10);\n\t\t\tlet end = Number.parseInt(endPart, 10);\n\n\t\t\t// ignore invalid ranges that don't contain valid line numbers\n\t\t\tif (!isPositiveLineNumber(start) || !isPositiveLineNumber(end)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// swap start and end if they are backwards\n\t\t\tif (start > end) {\n\t\t\t\t[start, end] = [end, start];\n\t\t\t}\n\n\t\t\tif (end - start + 1 > MAX_EXPANDED_LINE_RANGE_LENGTH) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// add all line numbers in the range, inclusive\n\t\t\tfor (let i = start; i <= end; i++) {\n\t\t\t\tlineNumberSet.add(i);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn lineNumberSet;\n}\n\n/**\n * Type Predicate: checks if a value is a positive, finite integer.\n */\nconst isPositiveLineNumber = (value: number | undefined): value is number =>\n\tvalue != null && !Number.isNaN(value) && value > 0 && Number.isFinite(value);\n","import type { LineRange } from \"./line-numbers.js\";\nimport { resolveLineNumbers } from \"./line-numbers.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { FoldableRange } from \"./compute-json-fold-ranges.js\";\n\n/** Removes trailing `\\n` and `\\r` characters from the end of a string. */\nfunction trimTrailingNewlines(input: string): string {\n\tlet end = input.length;\n\twhile (end > 0 && (input.charCodeAt(end - 1) === 10 || input.charCodeAt(end - 1) === 13)) {\n\t\tend -= 1;\n\t}\n\treturn end === input.length ? input : input.slice(0, end);\n}\n\n/** Splits Shiki-highlighted HTML into per-line content, unwrapping `<span class=\"line\">` wrappers. */\nfunction splitHighlightedHtmlIntoLines(html: string): string[] {\n\tconst normalizedHtml = trimTrailingNewlines(html).replaceAll(\"\\r\\n\", \"\\n\").replaceAll(\"\\r\", \"\\n\");\n\tconst shikiLines = normalizedHtml.split(\"\\n\");\n\tconst linePrefix = '<span class=\"line\">';\n\tconst lineSuffix = \"</span>\";\n\n\tfor (let i = 0; i < shikiLines.length; i++) {\n\t\tconst line = shikiLines[i] ?? \"\";\n\t\tif (line.startsWith(linePrefix) && line.endsWith(lineSuffix)) {\n\t\t\tshikiLines[i] = line.slice(linePrefix.length, line.length - lineSuffix.length);\n\t\t}\n\t}\n\n\treturn shikiLines;\n}\n\n/** Inline caret SVG used by the fold toggle button. Mirrors `CaretDown` from Phosphor at a small size. */\nconst FOLD_CARET_SVG =\n\t'<svg class=\"mantle-code-fold-caret\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M3.22 5.97a.75.75 0 0 1 1.06 0L8 9.69l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L3.22 7.03a.75.75 0 0 1 0-1.06Z\"/></svg>';\n\n/**\n * Encodes public fold IDs for safe HTML attribute storage and for the\n * runtime's space-separated region sets. Built-in strategies use numeric\n * strings, but custom strategies may use descriptive IDs with spaces or\n * quotes.\n */\nfunction encodeFoldRegionId(id: string): string {\n\treturn encodeURIComponent(id);\n}\n\n/** Input for {@link decorateHighlightedHtml}. */\ntype DecorateHighlightedHtmlInput = {\n\t/**\n\t * Optional list of foldable ranges, typically produced by\n\t * {@link import(\"./compute-json-fold-ranges.js\").computeJsonFoldRanges}.\n\t *\n\t * When non-empty, every line gets a fold gutter slot; opener lines render a\n\t * semantic `<button>` toggle, descendant content lines carry\n\t * `data-fold-regions` so the runtime can hide them in O(region size) on\n\t * collapse.\n\t */\n\tfoldableRanges?: FoldableRange[] | undefined;\n\thighlightLines?: (LineRange | number)[] | undefined;\n\thtml: string;\n\tlineNumberStart?: number | undefined;\n\tshowLineNumbers?: boolean | undefined;\n};\n\n/**\n * Wraps each line of Shiki-highlighted HTML in Mantle's line-number, fold,\n * and line-highlight markup, producing the final HTML rendered by `CodeBlock.Code`.\n */\nfunction decorateHighlightedHtml({\n\tfoldableRanges,\n\thighlightLines,\n\thtml,\n\tlineNumberStart = 1,\n\tshowLineNumbers = false,\n}: DecorateHighlightedHtmlInput): string {\n\tconst highlightedLineNumbers = resolveLineNumbers(...(highlightLines ?? []));\n\tconst lines = splitHighlightedHtmlIntoLines(html);\n\n\t// Build per-line fold metadata so each line can announce its parent fold\n\t// regions and opener lines can render a toggle. Indexing up front keeps\n\t// the per-line loop O(1) for fold lookups, even on 1000+ line inputs.\n\t// Fold ranges are *buffer-relative* (1-indexed positions in the original\n\t// code), independent of `lineNumberStart` which only affects display.\n\tconst openerIdByBufferLine = new Map<number, string>();\n\tconst regionsByBufferLine = new Map<number, string[]>();\n\tconst hasFolds = foldableRanges != null && foldableRanges.length > 0;\n\n\tif (hasFolds && foldableRanges != null) {\n\t\tfor (const range of foldableRanges) {\n\t\t\tconst encodedId = encodeFoldRegionId(range.id);\n\t\t\topenerIdByBufferLine.set(range.startLine, encodedId);\n\t\t\tfor (let bufferLine = range.startLine + 1; bufferLine < range.endLine; bufferLine += 1) {\n\t\t\t\tlet regions = regionsByBufferLine.get(bufferLine);\n\t\t\t\tif (regions == null) {\n\t\t\t\t\tregions = [];\n\t\t\t\t\tregionsByBufferLine.set(bufferLine, regions);\n\t\t\t\t}\n\t\t\t\tregions.push(encodedId);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet output = \"\";\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tconst line = lines[i] ?? \"\";\n\t\tconst bufferLineNumber = i + 1;\n\t\tconst displayedLineNumber = lineNumberStart + i;\n\t\tconst lineClassName = cx(\n\t\t\t\"mantle-code-line\",\n\t\t\thighlightedLineNumbers.has(displayedLineNumber) && \"mantle-code-line-highlighted\",\n\t\t);\n\n\t\tconst lineNumberHtml = showLineNumbers\n\t\t\t? `<span class=\"mantle-code-line-number\" data-slot=\"line-number\">${displayedLineNumber}</span>`\n\t\t\t: \"\";\n\n\t\tlet foldGutterHtml = \"\";\n\t\tlet foldRegionsAttribute = \"\";\n\t\tlet trailingEllipsisHtml = \"\";\n\t\tif (hasFolds) {\n\t\t\t// Opener lines render a real semantic <button> in the gutter.\n\t\t\t// Non-opener lines reserve gutter space via CSS — see the\n\t\t\t// `:has(.mantle-code-fold-toggle)` rule in mantle.css. Skipping\n\t\t\t// per-line spacer markup is what keeps HTML overhead near zero\n\t\t\t// for large JSON blocks.\n\t\t\tconst openerId = openerIdByBufferLine.get(bufferLineNumber);\n\t\t\tif (openerId != null) {\n\t\t\t\tfoldGutterHtml = `<button type=\"button\" class=\"mantle-code-fold-toggle\" data-slot=\"fold-toggle\" data-fold-line=\"${openerId}\" aria-expanded=\"true\" aria-label=\"Toggle code folding\">${FOLD_CARET_SVG}</button>`;\n\t\t\t\ttrailingEllipsisHtml =\n\t\t\t\t\t'<span class=\"mantle-code-fold-ellipsis\" data-slot=\"fold-ellipsis\" aria-hidden=\"true\">⋯</span>';\n\t\t\t}\n\n\t\t\tconst regions = regionsByBufferLine.get(bufferLineNumber);\n\t\t\tif (regions != null && regions.length > 0) {\n\t\t\t\tfoldRegionsAttribute = ` data-fold-regions=\"${regions.join(\" \")}\"`;\n\t\t\t}\n\t\t}\n\n\t\tconst renderedContent = line === \"\" ? \" \" : line;\n\t\tconst contentHtml = `<span class=\"mantle-code-line-content\" data-slot=\"line-content\">${renderedContent}${trailingEllipsisHtml}</span>`;\n\n\t\toutput += `<span class=\"${lineClassName}\" data-line-number=\"${displayedLineNumber}\"${foldRegionsAttribute}>${lineNumberHtml}${foldGutterHtml}${contentHtml}</span>`;\n\t}\n\treturn output;\n}\n\nexport { decorateHighlightedHtml };\nexport type { DecorateHighlightedHtmlInput };\n","/**\n * Shared types and helpers used by every fold-range computer\n * (`computeFoldRanges`, `computeJsonFoldRanges`). Kept in its own module so\n * the legacy raw-source parser and the token-driven parser can share a\n * single dedup/finalize pass without taking a dependency on each other.\n */\n\n/**\n * A foldable region in a code block. Lines `startLine + 1` through\n * `endLine - 1` are hidden when the region is collapsed; the opener and\n * closer lines remain visible.\n */\ntype FoldableRange = {\n\t/**\n\t * Stable identifier for the fold region within a code block. Equal to the\n\t * stringified `startLine` (unique by construction after dedup), encoded\n\t * into `data-fold-line` on the toggle button and `data-fold-regions` on\n\t * each descendant line so the runtime delegated handler can resolve\n\t * toggles by attribute lookup. Custom strategies should provide non-empty\n\t * IDs that are unique within the code block; the decorator URI-encodes\n\t * them before rendering so spaces and quotes remain safe.\n\t */\n\tid: string;\n\t/** 1-based line number of the line that contains the opening token. */\n\tstartLine: number;\n\t/** 1-based line number of the line that contains the matching closing token. */\n\tendLine: number;\n};\n\n/**\n * Sorts ranges by `startLine` ascending (with `endLine` descending as a\n * tiebreak so the largest span wins on a shared opener line) and keeps at\n * most one range per opener line. Mutates and returns the input.\n */\nfunction finalizeFoldRanges(ranges: FoldableRange[]): FoldableRange[] {\n\tif (ranges.length <= 1) {\n\t\treturn ranges;\n\t}\n\tranges.sort((a, b) => {\n\t\tif (a.startLine !== b.startLine) {\n\t\t\treturn a.startLine - b.startLine;\n\t\t}\n\t\treturn b.endLine - a.endLine;\n\t});\n\n\tconst filtered: FoldableRange[] = [];\n\tlet lastStartLine = -1;\n\tfor (const range of ranges) {\n\t\tif (range.startLine === lastStartLine) {\n\t\t\tcontinue;\n\t\t}\n\t\tfiltered.push(range);\n\t\tlastStartLine = range.startLine;\n\t}\n\treturn filtered;\n}\n\nexport { finalizeFoldRanges };\nexport type { FoldableRange };\n","import { finalizeFoldRanges, type FoldableRange } from \"./fold-range-utils.js\";\n\ntype JsonBracketStackEntry = {\n\topener: 123 | 91;\n\tline: number;\n};\n\n/**\n * Computes foldable ranges for a JSON source string. Each multi-line `{...}`\n * or `[...]` produces one range whose opener and closer lines remain visible\n * when collapsed (matching VS Code's folding behavior).\n *\n * The parser is intentionally permissive: it skips over unmatched/invalid\n * bracket sequences instead of throwing, so a partially valid JSON snippet\n * still gets the folds it can. Strings, escape sequences, and unicode\n * escapes are handled correctly so brackets inside string literals don't\n * open spurious folds.\n *\n * Runs in a single pass over the source (O(n) chars). At most one fold range\n * per opener line is emitted — when several brackets open on the same line,\n * only the outermost (largest range) survives, so a single click collapses\n * the whole sub-tree without rendering stacked toggles.\n *\n * @example\n * ```ts\n * computeJsonFoldRanges(`{\\n \"a\": [\\n 1\\n ]\\n}`);\n * // => [\n * // { id: \"1\", startLine: 1, endLine: 5 },\n * // { id: \"2\", startLine: 2, endLine: 4 },\n * // ]\n * ```\n */\nfunction computeJsonFoldRanges(code: string): FoldableRange[] {\n\tconst length = code.length;\n\tif (length === 0) {\n\t\treturn [];\n\t}\n\n\tconst stack: JsonBracketStackEntry[] = [];\n\tconst ranges: FoldableRange[] = [];\n\n\tlet line = 1;\n\tlet index = 0;\n\n\twhile (index < length) {\n\t\tconst character = code.charCodeAt(index);\n\n\t\tif (character === 10) {\n\t\t\t// '\\n'\n\t\t\tline += 1;\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (character === 13) {\n\t\t\t// '\\r' — treat \\r\\n and bare \\r as a line break\n\t\t\tline += 1;\n\t\t\tindex += 1;\n\t\t\tif (index < length && code.charCodeAt(index) === 10) {\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === 34) {\n\t\t\t// '\"' — skip over string contents (including escaped quotes)\n\t\t\tindex += 1;\n\t\t\twhile (index < length) {\n\t\t\t\tconst stringChar = code.charCodeAt(index);\n\t\t\t\tif (stringChar === 92) {\n\t\t\t\t\t// '\\\\' — skip the next char unconditionally; do not advance line on escaped \\n\n\t\t\t\t\tindex += 2;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (stringChar === 34) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (stringChar === 10 || stringChar === 13) {\n\t\t\t\t\t// Unterminated string spanning a line — bail without advancing further into it.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === 123 || character === 91) {\n\t\t\t// '{' or '['\n\t\t\tstack.push({ opener: character, line });\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === 125 || character === 93) {\n\t\t\t// '}' or ']'\n\t\t\tconst matchingOpener = character === 125 ? 123 : 91;\n\t\t\tconst top = stack[stack.length - 1];\n\t\t\tif (top?.opener === matchingOpener) {\n\t\t\t\tstack.pop();\n\t\t\t\tif (top.line !== line) {\n\t\t\t\t\tranges.push({ id: String(top.line), startLine: top.line, endLine: line });\n\t\t\t\t}\n\t\t\t} else if (top != null) {\n\t\t\t\t// Mismatched closer: the active bracket sequence is structurally\n\t\t\t\t// invalid, so prevent any containing opener from pairing later.\n\t\t\t\tstack.length = 0;\n\t\t\t}\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tindex += 1;\n\t}\n\n\treturn finalizeFoldRanges(ranges);\n}\n\nexport { computeJsonFoldRanges };\nexport type { FoldableRange };\n","import { finalizeFoldRanges, type FoldableRange } from \"./fold-range-utils.js\";\nimport type { SupportedLanguage } from \"./supported-languages.js\";\n\n/**\n * A single TextMate scope name attached to part of a {@link FoldToken}.\n *\n * Mirrors the shape produced by Shiki's `includeExplanation: 'scopeName'`\n * option without taking a runtime dependency on Shiki, so this module can be\n * unit-tested with hand-written fixtures.\n */\ntype FoldScope = {\n\tscopeName: string;\n};\n\n/**\n * One sub-explanation within a {@link FoldToken}. A single Shiki token may\n * cover content with several scope sets — for example an interpolation\n * boundary inside a template literal — so its `explanation` is an array.\n */\ntype FoldExplanation = {\n\tcontent: string;\n\tscopes: FoldScope[];\n};\n\n/**\n * Minimal token shape consumed by {@link computeFoldRanges}. Compatible with\n * `ThemedToken` from `@shikijs/types` when `includeExplanation: 'scopeName'`\n * is enabled.\n */\ntype FoldToken = {\n\tcontent: string;\n\texplanation?: FoldExplanation[];\n};\n\n/**\n * One line of {@link FoldToken}s, as returned by Shiki's\n * `codeToTokens`/`tokens` transformer hook.\n */\ntype FoldLine = FoldToken[];\n\n/**\n * Folding strategy applied to a language. Picked by {@link foldStrategyFor}\n * based on how the language naturally delimits blocks:\n *\n * - `bracket` — `{}`/`[]` pairs (C-family, JSON, CSS, Rust, Go, …).\n * - `indentation` — significant whitespace (Python, YAML).\n * - `tag` — element open/close tags (HTML, XML).\n * - `none` — plain text and other languages without a useful folding model.\n */\ntype FoldStrategy = \"bracket\" | \"indentation\" | \"tag\" | \"none\";\n\n/** Returns the {@link FoldStrategy} used for the given supported language. */\nfunction foldStrategyFor(language: SupportedLanguage): FoldStrategy {\n\tswitch (language) {\n\t\tcase \"python\":\n\t\tcase \"py\":\n\t\tcase \"yaml\":\n\t\tcase \"yml\":\n\t\t\treturn \"indentation\";\n\t\tcase \"html\":\n\t\tcase \"xml\":\n\t\t\treturn \"tag\";\n\t\tcase \"bash\":\n\t\tcase \"sh\":\n\t\tcase \"shell\":\n\t\tcase \"plain\":\n\t\tcase \"plaintext\":\n\t\tcase \"text\":\n\t\tcase \"txt\":\n\t\t\t// Shell languages use keyword pairs (`if … fi`, `do … done`, etc.)\n\t\t\t// rather than brackets; folding `{}` would catch only brace\n\t\t\t// expansions, which aren't useful blocks. Until we model the\n\t\t\t// keyword pairs, opt out so we don't pay the per-token scope cost.\n\t\t\treturn \"none\";\n\t\tdefault:\n\t\t\treturn \"bracket\";\n\t}\n}\n\n/** Input for {@link computeFoldRanges}. */\ntype ComputeFoldRangesInput = {\n\t/** Resolved supported language; controls which strategy runs. */\n\tlanguage: SupportedLanguage;\n\t/**\n\t * Tokens produced by Shiki for the same code that will be rendered.\n\t * Must include scope explanations (i.e. tokenized with\n\t * `includeExplanation: 'scopeName'` or `true`) so string and comment\n\t * regions can be ignored.\n\t */\n\ttokens: FoldLine[];\n};\n\n/**\n * Computes foldable ranges for a tokenized code block. Dispatches to the\n * right strategy for the given language, so callers don't need to know how\n * a particular grammar models block boundaries.\n *\n * The bracket strategy uses TextMate scopes to distinguish real punctuation\n * from `{`/`[` characters that appear inside strings, comments, or regular\n * expressions — this is what lets one parser cover JS, TS, Go, Rust, JSON,\n * CSS, and friends without per-language string/comment logic.\n *\n * Returns ranges sorted by `startLine` ascending; at most one range per\n * opener line survives so the gutter renders a single toggle even when\n * multiple constructs open on the same line (`{\"a\":[`).\n */\nfunction computeFoldRanges({ language, tokens }: ComputeFoldRangesInput): FoldableRange[] {\n\tconst strategy = foldStrategyFor(language);\n\tswitch (strategy) {\n\t\tcase \"bracket\":\n\t\t\treturn computeBracketFoldRanges(tokens);\n\t\tcase \"indentation\":\n\t\t\treturn computeIndentationFoldRanges(tokens);\n\t\tcase \"tag\":\n\t\t\treturn computeTagFoldRanges(tokens);\n\t\tcase \"none\":\n\t\t\treturn [];\n\t}\n}\n\n/**\n * Returns true when a token's innermost scope means it represents inert\n * content — string body, comment body, regex body, or character escape —\n * and therefore any `{`/`[`/`<` characters inside it should be ignored.\n *\n * Checking the innermost scope (last entry) keeps template-literal\n * interpolations foldable: `${ ... }` punctuation lives under\n * `punctuation.definition.template-expression.*`, not `string.*`, so the\n * embedded expression isn't filtered out even though `string.template`\n * appears earlier in the scope chain.\n */\nfunction isInertScope(scopes: FoldScope[]): boolean {\n\tif (scopes.length === 0) {\n\t\treturn false;\n\t}\n\tconst innermost = scopes[scopes.length - 1]?.scopeName ?? \"\";\n\treturn (\n\t\tinnermost === \"string\" ||\n\t\tinnermost === \"comment\" ||\n\t\tinnermost.startsWith(\"string.\") ||\n\t\tinnermost.startsWith(\"comment.\") ||\n\t\tinnermost.startsWith(\"constant.character.escape\")\n\t);\n}\n\n/**\n * Yields explanation pieces of a token, or one fallback piece with no\n * scopes when the token wasn't tokenized with `includeExplanation`.\n */\nfunction explanationsOf(token: FoldToken): readonly FoldExplanation[] {\n\tif (token.explanation != null && token.explanation.length > 0) {\n\t\treturn token.explanation;\n\t}\n\treturn [{ content: token.content, scopes: [] }];\n}\n\n/**\n * Reconstructs non-inert line text without losing Shiki-owned whitespace.\n * Explanation pieces can omit leading spaces, so use the full token content\n * whenever every explanation piece is visible.\n */\nfunction visibleTextForLine(line: FoldLine): string {\n\tlet visible = \"\";\n\tfor (const token of line) {\n\t\tconst explanations = explanationsOf(token);\n\t\tlet hasInert = false;\n\t\tfor (const explanation of explanations) {\n\t\t\tif (isInertScope(explanation.scopes)) {\n\t\t\t\thasInert = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!hasInert) {\n\t\t\tvisible += token.content;\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const explanation of explanations) {\n\t\t\tif (isInertScope(explanation.scopes)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvisible += explanation.content;\n\t\t}\n\t}\n\treturn visible;\n}\n\n/**\n * Returns the count of leading whitespace characters on a line, or `-1`\n * for blank lines. Reads only the first token's content — Shiki emits\n * leading whitespace as its own token, so a full-line concat is wasted\n * work for the indentation strategy.\n */\nfunction leadingIndentOfLine(line: FoldLine | undefined): number {\n\tif (line == null || line.length === 0) {\n\t\treturn -1;\n\t}\n\tlet column = 0;\n\tfor (const token of line) {\n\t\tconst content = token.content;\n\t\tfor (let charIndex = 0; charIndex < content.length; charIndex += 1) {\n\t\t\tconst character = content.charCodeAt(charIndex);\n\t\t\tif (character === 32 || character === 9) {\n\t\t\t\tcolumn += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn column;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * Bracket-pair folding strategy. Walks every token, skips inert (string,\n * comment, escape) regions, and pairs `{`/`[` openers with `}`/`]` closers\n * via a single stack pass.\n *\n * Parens (`(`/`)`) are intentionally not folded — function call argument\n * lists are usually short and folding them creates more noise than value.\n */\nfunction computeBracketFoldRanges(tokens: FoldLine[]): FoldableRange[] {\n\tconst stack: number[] = [];\n\tconst ranges: FoldableRange[] = [];\n\n\tfor (let lineIndex = 0; lineIndex < tokens.length; lineIndex += 1) {\n\t\tconst line = tokens[lineIndex];\n\t\tif (line == null) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst lineNumber = lineIndex + 1;\n\n\t\tfor (const token of line) {\n\t\t\tif (!hasBracketChar(token.content)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const explanation of explanationsOf(token)) {\n\t\t\t\tif (isInertScope(explanation.scopes)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst content = explanation.content;\n\t\t\t\tfor (let charIndex = 0; charIndex < content.length; charIndex += 1) {\n\t\t\t\t\tconst character = content.charCodeAt(charIndex);\n\t\t\t\t\tif (character === 123 || character === 91) {\n\t\t\t\t\t\tstack.push(lineNumber);\n\t\t\t\t\t} else if (character === 125 || character === 93) {\n\t\t\t\t\t\tconst startLine = stack.pop();\n\t\t\t\t\t\tif (startLine != null && startLine !== lineNumber) {\n\t\t\t\t\t\t\tranges.push({ id: String(startLine), startLine, endLine: lineNumber });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn finalizeFoldRanges(ranges);\n}\n\n/**\n * Pre-filter: returns true if `content` contains any of `{`, `}`, `[`, `]`.\n * Most tokens in non-JSON code are identifiers/whitespace/operators that\n * never participate in bracket folding, so this collapses ~95% of the per-\n * character scan to a single `String.prototype.indexOf` per token.\n */\nfunction hasBracketChar(content: string): boolean {\n\tfor (let i = 0; i < content.length; i += 1) {\n\t\tconst character = content.charCodeAt(i);\n\t\tif (character === 123 || character === 125 || character === 91 || character === 93) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Indentation-based folding strategy for languages where blocks are defined\n * by leading whitespace (Python, YAML).\n *\n * For each non-blank line, finds the maximal run of following lines that are\n * either blank or more deeply indented than the opener. The opener stays\n * visible; descendant lines collapse. The \"closer\" line (`endLine`) is the\n * first line at or below the opener's indent — purely a sentinel so the\n * decorator's `startLine + 1 .. endLine - 1` hide loop covers the body.\n *\n * A tab is treated as one column. Mixed tabs/spaces compare consistently\n * because we compare the count of leading whitespace characters; if a file\n * mixes the two within a single block, indent comparisons may misfire, but\n * neither Python nor YAML idiomatically mixes them.\n */\nfunction computeIndentationFoldRanges(tokens: FoldLine[]): FoldableRange[] {\n\tconst indents: number[] = Array.from({ length: tokens.length });\n\tfor (let i = 0; i < tokens.length; i += 1) {\n\t\tindents[i] = leadingIndentOfLine(tokens[i]);\n\t}\n\n\tconst ranges: FoldableRange[] = [];\n\tfor (let openerIndex = 0; openerIndex < indents.length; openerIndex += 1) {\n\t\tconst indent = indents[openerIndex] ?? -1;\n\t\tif (indent < 0) {\n\t\t\tcontinue;\n\t\t}\n\t\tlet lastChild = -1;\n\t\tlet scan = openerIndex + 1;\n\t\twhile (scan < indents.length) {\n\t\t\tconst next = indents[scan] ?? -1;\n\t\t\tif (next < 0) {\n\t\t\t\tscan += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (next > indent) {\n\t\t\t\tlastChild = scan;\n\t\t\t\tscan += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tif (lastChild > openerIndex) {\n\t\t\t// endLine plays the role of the \"closer\": the first line that is\n\t\t\t// not folded. `lastChild + 2` converts the 0-indexed last child\n\t\t\t// to a 1-indexed sentinel one past it.\n\t\t\tranges.push({\n\t\t\t\tid: String(openerIndex + 1),\n\t\t\t\tstartLine: openerIndex + 1,\n\t\t\t\tendLine: lastChild + 2,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn finalizeFoldRanges(ranges);\n}\n\n/**\n * Tag-pair folding strategy for HTML and XML.\n *\n * Reconstructs each line's visible text from non-inert tokens, then scans\n * tag patterns with a small linear scanner. Self-closing tags (`<br/>`, `<img />`)\n * and known void HTML elements (`<br>`, `<img>`, `<input>`, …) don't push\n * onto the stack. Stack-based matching emits one range per line with an\n * unmatched opener and a matching closer on a later line.\n *\n * Multi-line tags (an opener whose `>` is on a different line than the\n * `<`) are deliberately not folded in v1 — they're rare and would require\n * cross-line state.\n */\nfunction computeTagFoldRanges(tokens: FoldLine[]): FoldableRange[] {\n\tconst stack: { name: string; line: number }[] = [];\n\tconst ranges: FoldableRange[] = [];\n\n\tfor (let lineIndex = 0; lineIndex < tokens.length; lineIndex += 1) {\n\t\tconst line = tokens[lineIndex];\n\t\tif (line == null) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst lineNumber = lineIndex + 1;\n\t\tconst visible = visibleTextForLine(line);\n\n\t\tconst matches = extractTagMatches(visible);\n\t\tfor (const match of matches) {\n\t\t\tif (match.kind === \"open\") {\n\t\t\t\tstack.push({ name: match.name, line: lineNumber });\n\t\t\t} else {\n\t\t\t\tconst top = stack.length > 0 ? stack[stack.length - 1] : undefined;\n\t\t\t\tif (top != null && top.name.toLowerCase() === match.name.toLowerCase()) {\n\t\t\t\t\tstack.pop();\n\t\t\t\t\tif (top.line !== lineNumber) {\n\t\t\t\t\t\tranges.push({\n\t\t\t\t\t\t\tid: String(top.line),\n\t\t\t\t\t\t\tstartLine: top.line,\n\t\t\t\t\t\t\tendLine: lineNumber,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn finalizeFoldRanges(ranges);\n}\n\n/** HTML elements whose tags don't have a closing counterpart. */\nconst VOID_HTML_ELEMENTS = new Set<string>([\n\t\"area\",\n\t\"base\",\n\t\"br\",\n\t\"col\",\n\t\"embed\",\n\t\"hr\",\n\t\"img\",\n\t\"input\",\n\t\"link\",\n\t\"meta\",\n\t\"param\",\n\t\"source\",\n\t\"track\",\n\t\"wbr\",\n]);\n\n/**\n * Extracts open/close tag matches from a single line's visible text.\n *\n * Only tags that both open and close on this line are considered; we skip\n * partial tags (an unmatched `<` with no `>`) so multi-line tags don't\n * register as openers.\n */\nfunction extractTagMatches(line: string): { name: string; kind: \"open\" | \"close\" }[] {\n\tconst matches: { name: string; kind: \"open\" | \"close\" }[] = [];\n\tlet index = 0;\n\n\twhile (index < line.length) {\n\t\tconst tagStart = line.indexOf(\"<\", index);\n\t\tif (tagStart === -1) {\n\t\t\tbreak;\n\t\t}\n\n\t\tlet cursor = skipHtmlWhitespace(line, tagStart + 1);\n\t\tconst isClose = line.charCodeAt(cursor) === 47;\n\t\tif (isClose) {\n\t\t\tcursor = skipHtmlWhitespace(line, cursor + 1);\n\t\t}\n\n\t\tif (!isTagNameStart(line.charCodeAt(cursor))) {\n\t\t\tindex = tagStart + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst nameStart = cursor;\n\t\tcursor += 1;\n\t\twhile (cursor < line.length && isTagNameContinue(line.charCodeAt(cursor))) {\n\t\t\tcursor += 1;\n\t\t}\n\t\tconst name = line.slice(nameStart, cursor);\n\t\tconst tagEnd = findTagEnd(line, cursor);\n\t\tif (tagEnd === -1) {\n\t\t\tindex = tagStart + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isClose) {\n\t\t\tmatches.push({ name, kind: \"close\" });\n\t\t\tindex = tagEnd + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst selfClosing = tagEndsSelfClosing(line, tagEnd);\n\t\tif (selfClosing || VOID_HTML_ELEMENTS.has(name.toLowerCase())) {\n\t\t\tindex = tagEnd + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tmatches.push({ name, kind: \"open\" });\n\t\tindex = tagEnd + 1;\n\t}\n\treturn matches;\n}\n\n/** Returns true for whitespace accepted inside a tag opener. */\nfunction isHtmlWhitespace(character: number): boolean {\n\treturn (\n\t\tcharacter === 9 ||\n\t\tcharacter === 10 ||\n\t\tcharacter === 11 ||\n\t\tcharacter === 12 ||\n\t\tcharacter === 13 ||\n\t\tcharacter === 32\n\t);\n}\n\n/** Skips HTML whitespace starting at `index`. */\nfunction skipHtmlWhitespace(line: string, index: number): number {\n\tlet cursor = index;\n\twhile (cursor < line.length && isHtmlWhitespace(line.charCodeAt(cursor))) {\n\t\tcursor += 1;\n\t}\n\treturn cursor;\n}\n\n/** Returns true when `character` can start an HTML/XML tag name. */\nfunction isTagNameStart(character: number): boolean {\n\treturn (character >= 65 && character <= 90) || (character >= 97 && character <= 122);\n}\n\n/** Returns true when `character` can continue an HTML/XML tag name. */\nfunction isTagNameContinue(character: number): boolean {\n\treturn (\n\t\tisTagNameStart(character) ||\n\t\t(character >= 48 && character <= 57) ||\n\t\tcharacter === 45 ||\n\t\tcharacter === 58 ||\n\t\tcharacter === 95\n\t);\n}\n\n/** Finds the closing `>` for a tag, ignoring `>` inside quoted attributes. */\nfunction findTagEnd(line: string, index: number): number {\n\tlet quote: number | undefined;\n\tfor (let cursor = index; cursor < line.length; cursor += 1) {\n\t\tconst character = line.charCodeAt(cursor);\n\t\tif (quote != null) {\n\t\t\tif (character === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (character === 34 || character === 39) {\n\t\t\tquote = character;\n\t\t\tcontinue;\n\t\t}\n\t\tif (character === 62) {\n\t\t\treturn cursor;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/** Returns true when the tag ending at `tagEnd` has a trailing `/`. */\nfunction tagEndsSelfClosing(line: string, tagEnd: number): boolean {\n\tlet cursor = tagEnd - 1;\n\twhile (cursor >= 0 && isHtmlWhitespace(line.charCodeAt(cursor))) {\n\t\tcursor -= 1;\n\t}\n\treturn cursor >= 0 && line.charCodeAt(cursor) === 47;\n}\n\nexport {\n\t//,\n\tcomputeFoldRanges,\n\tfoldStrategyFor,\n};\n\nexport type {\n\t//,\n\tComputeFoldRangesInput,\n\tFoldExplanation,\n\tFoldLine,\n\tFoldScope,\n\tFoldStrategy,\n\tFoldToken,\n};\n","import type { SupportedLanguage } from \"./supported-languages.js\";\n\nconst indentations = [\"tabs\", \"spaces\"] as const;\ntype Indentation = (typeof indentations)[number];\n\n/**\n * Type Predicate: checks if the given value is a valid indentation type.\n */\nfunction isIndentation(input: unknown): input is Indentation {\n\treturn indentations.includes(input as Indentation);\n}\n\n/**\n * Infers the indentation type based on the language and preferred indentation.\n *\n * @param language - The language to check.\n * @param preferredIndentation - The preferred indentation type (overrides what is detected).\n */\nfunction inferIndentation(\n\tlanguage: SupportedLanguage,\n\tpreferredIndentation: Indentation | undefined,\n) {\n\t// if the user has a preferred indentation, use that regardless of the language\n\tif (preferredIndentation) {\n\t\treturn preferredIndentation;\n\t}\n\n\tif (isTabIndentedLanguage(language)) {\n\t\treturn \"tabs\";\n\t}\n\n\tif (isSpaceIndentedLanguage(language)) {\n\t\treturn \"spaces\";\n\t}\n\n\treturn \"spaces\";\n}\n\nexport {\n\t//,\n\tindentations,\n\tinferIndentation,\n\tisIndentation,\n};\n\nexport type {\n\t//,\n\tIndentation,\n};\n\n/**\n * Languages that require or strongly prefer tabs\n */\nconst tabIndentedLanguages = [\n\t\"csharp\",\n\t\"css\",\n\t\"go\",\n\t\"html\",\n\t\"java\",\n\t\"javascript\",\n\t\"js\",\n\t\"jsx\",\n\t\"ts\",\n\t\"tsx\",\n\t\"typescript\",\n\t\"xml\",\n] as const satisfies SupportedLanguage[];\n\nconst tabIndentedLanguageSet = new Set<string>(tabIndentedLanguages);\n\n/**\n * Languages that require or strongly prefer spaces\n */\nconst spaceIndentedLanguages = [\n\t\"python\",\n\t\"py\",\n\t\"yaml\",\n\t\"yml\",\n\t\"ruby\",\n\t\"rb\",\n] as const satisfies SupportedLanguage[];\n\nconst spaceIndentedLanguageSet = new Set<string>(spaceIndentedLanguages);\n\ntype TabIndentedLanguage = (typeof tabIndentedLanguages)[number];\ntype SpaceIndentedLanguage = (typeof spaceIndentedLanguages)[number];\n\n/**\n * Type Predicate: checks if the given value is a required/preferred tab-indented language.\n */\nfunction isTabIndentedLanguage(value: SupportedLanguage): value is TabIndentedLanguage {\n\treturn tabIndentedLanguageSet.has(value);\n}\n\n/**\n * Type Predicate: checks if the given value is a required/preferred space-indented language.\n */\nfunction isSpaceIndentedLanguage(value: SupportedLanguage): value is SpaceIndentedLanguage {\n\treturn spaceIndentedLanguageSet.has(value);\n}\n","import type { Indentation } from \"./indentation.js\";\n\ntype Options = {\n\t/**\n\t * The indentation type to use. Can be either \"tabs\" or \"spaces\".\n\t * @default \"spaces\"\n\t */\n\tindentation?: Indentation;\n};\n\n/**\n * Trim any leading and trailing whitespace/empty lines, convert leading\n * indentation to the given options.indentation\n */\nfunction normalizeIndentation(value: string, options?: Options): string {\n\tconst indentation = options?.indentation ?? \"spaces\";\n\tconst normalizedLineEndings = value.replace(/\\r\\n?/g, \"\\n\");\n\tconst trimmed = normalizedLineEndings.trim();\n\n\tif (trimmed === \"\") {\n\t\treturn \"\";\n\t}\n\n\tconst minIndent = findMinIndent(normalizedLineEndings);\n\tconst lines = trimmed.split(\"\\n\");\n\tconst normalizedLines = Array.from<string>({ length: lines.length });\n\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tconst line = lines[i];\n\t\tif (line == null) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst dedentedLine = startsWithNonWhitespace(line) ? line : line.slice(minIndent);\n\t\tnormalizedLines[i] = normalizeLeadingIndentation(dedentedLine, indentation);\n\t}\n\n\treturn normalizedLines.join(\"\\n\");\n}\n\nexport {\n\t//,\n\tnormalizeIndentation,\n};\n\n/**\n * Rewrites only the leading indentation of a non-empty line into the requested\n * indentation style, leaving the rest of the line untouched.\n */\nfunction normalizeLeadingIndentation(line: string, indentation: Indentation): string {\n\tlet indentEnd = 0;\n\twhile (indentEnd < line.length) {\n\t\tconst character = line[indentEnd];\n\t\tif (character !== \" \" && character !== \"\\t\") {\n\t\t\tbreak;\n\t\t}\n\t\tindentEnd += 1;\n\t}\n\n\tif (indentEnd === 0 || indentEnd === line.length) {\n\t\treturn line;\n\t}\n\n\tconst leadingWhitespace = line.slice(0, indentEnd);\n\tconst normalizedLeadingWhitespace =\n\t\tindentation === \"spaces\"\n\t\t\t? leadingWhitespace.replace(/\\t/g, \" \")\n\t\t\t: leadingWhitespace.replace(/ {2}/g, \"\\t\");\n\n\treturn normalizedLeadingWhitespace + line.slice(indentEnd);\n}\n\n/**\n * Returns true when a line begins with visible content instead of indentation.\n */\nfunction startsWithNonWhitespace(line: string): boolean {\n\tconst firstCharacter = line[0];\n\treturn firstCharacter != null && firstCharacter !== \" \" && firstCharacter !== \"\\t\";\n}\n\n/**\n * Find the shortest indentation of a multiline string.\n */\nfunction findMinIndent(value: string): number {\n\tlet minIndent = Number.POSITIVE_INFINITY;\n\tlet indent = 0;\n\tlet atLineStart = true;\n\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value[i];\n\n\t\tif (atLineStart) {\n\t\t\tif (char === \" \" || char === \"\\t\") {\n\t\t\t\tindent += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (char === \"\\n\" || char === \"\\r\") {\n\t\t\t\tindent = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (indent < minIndent) {\n\t\t\t\tminIndent = indent;\n\t\t\t\tif (minIndent === 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tatLineStart = false;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"\\n\" || char === \"\\r\") {\n\t\t\tatLineStart = true;\n\t\t\tindent = 0;\n\t\t}\n\t}\n\n\treturn minIndent === Number.POSITIVE_INFINITY ? 0 : minIndent;\n}\n","/**\n * List of supported languages for syntax highlighting.\n * @private\n */\nexport const supportedLanguages = [\n\t\"bash\",\n\t\"cs\",\n\t\"csharp\",\n\t\"css\",\n\t\"go\",\n\t\"html\",\n\t\"java\",\n\t\"javascript\",\n\t\"js\",\n\t\"json\",\n\t\"jsx\",\n\t\"plain\",\n\t\"plaintext\",\n\t\"py\",\n\t\"python\",\n\t\"rb\",\n\t\"ruby\",\n\t\"rust\",\n\t\"sh\",\n\t\"shell\",\n\t\"text\",\n\t\"ts\",\n\t\"tsx\",\n\t\"txt\",\n\t\"typescript\",\n\t\"xml\",\n\t\"yaml\",\n\t\"yml\",\n] as const;\n\n/**\n * Supported languages for syntax highlighting.\n */\ntype SupportedLanguage = (typeof supportedLanguages)[number];\nconst supportedLanguageSet = new Set<SupportedLanguage>(supportedLanguages);\nconst defaultLanguage = \"text\" satisfies SupportedLanguage;\n\n/**\n * Parses a markdown code block (```) language class into a SupportedLanguage.\n * Defaults to \"text\" if no supported language is found.\n */\nfunction parseLanguage(\n\tvalue: `language-${string}` | `lang-${string}` | (string & {}) | undefined,\n): SupportedLanguage {\n\tconst trimmed = value?.trim() ?? \"\";\n\tif (!trimmed) {\n\t\treturn defaultLanguage;\n\t}\n\n\t// remove leading \"language-\" and \"lang-\" prefixes\n\t// find first '-' and slice from there\n\tconst prefixSeparatorIndex = trimmed.indexOf(\"-\");\n\tconst maybeLanguage =\n\t\tprefixSeparatorIndex === -1 ? trimmed : trimmed.slice(prefixSeparatorIndex + 1);\n\n\treturn isSupportedLanguage(maybeLanguage) ? maybeLanguage : defaultLanguage;\n}\n\n/**\n * Type Predicate: checks if an arbitrary value is a supported syntax highlighting language.\n */\nconst isSupportedLanguage = (value: unknown): value is SupportedLanguage => {\n\treturn typeof value === \"string\" && supportedLanguageSet.has(value as SupportedLanguage);\n};\n\nexport {\n\t//,\n\tisSupportedLanguage,\n\tparseLanguage,\n};\n\nexport type { SupportedLanguage };\n","import type { LineRange } from \"./line-numbers.js\";\n\n/** Parses a boolean or `\"true\"`/`\"false\"` string into a boolean. Returns `undefined` for unrecognized values. */\nfunction parseCodeBlockShowLineNumbers(value: unknown): boolean | undefined {\n\tif (typeof value === \"boolean\") {\n\t\treturn value;\n\t}\n\tif (typeof value === \"string\") {\n\t\tif (value === \"true\") {\n\t\t\treturn true;\n\t\t}\n\t\tif (value === \"false\") {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/** Parses a positive integer (or its string representation) for the starting line number. Returns `undefined` for invalid values. */\nfunction parseCodeBlockLineNumberStart(value: unknown): number | undefined {\n\tif (typeof value === \"number\" && Number.isFinite(value) && value > 0) {\n\t\treturn Math.floor(value);\n\t}\n\tif (typeof value === \"string\" && /^\\d+$/.test(value)) {\n\t\tconst parsed = Number.parseInt(value, 10);\n\t\treturn parsed > 0 ? parsed : undefined;\n\t}\n\treturn undefined;\n}\n\n/**\n * Parses a single highlight-line entry into either a positive integer line\n * number or a `\"start-end\"` {@link LineRange} string. Accepts a number, a\n * decimal-digit string (e.g. `\"3\"`), or a range string (e.g. `\"5-9\"`); any\n * other shape — including non-positive bounds — yields `undefined` so callers\n * can drop the entry. Whitespace around string inputs is tolerated.\n *\n * @example\n * parseSingle(3); // 3\n * parseSingle(\"5-9\"); // \"5-9\"\n * parseSingle(\"0\"); // undefined\n * parseSingle(\"foo\"); // undefined\n */\nfunction parseSingle(item: unknown): LineRange | number | undefined {\n\tif (typeof item === \"number\") {\n\t\treturn Number.isFinite(item) && item > 0 ? Math.floor(item) : undefined;\n\t}\n\tif (typeof item === \"string\") {\n\t\tconst trimmed = item.trim();\n\t\tif (/^\\d+$/.test(trimmed)) {\n\t\t\tconst parsed = Number.parseInt(trimmed, 10);\n\t\t\treturn parsed > 0 ? parsed : undefined;\n\t\t}\n\t\tif (/^\\d+-\\d+$/.test(trimmed)) {\n\t\t\tconst [startStr, endStr] = trimmed.split(\"-\");\n\t\t\tconst start = Number.parseInt(startStr ?? \"\", 10);\n\t\t\tconst end = Number.parseInt(endStr ?? \"\", 10);\n\t\t\tif (start > 0 && end > 0) {\n\t\t\t\treturn trimmed as LineRange;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/** Parses highlight line specifications from an array or comma-separated string (e.g. `[1, \"3-5\"]` or `\"1,3-5\"`). Returns `undefined` when no valid entries are found. */\nfunction parseCodeBlockHighlightLines(value: unknown): (LineRange | number)[] | undefined {\n\tif (typeof value === \"string\") {\n\t\tconst parsed: (LineRange | number)[] = [];\n\t\tconst segments = value.split(\",\");\n\t\tfor (const segment of segments) {\n\t\t\tconst maybe = parseSingle(segment);\n\t\t\tif (maybe != null) {\n\t\t\t\tparsed.push(maybe);\n\t\t\t}\n\t\t}\n\t\treturn parsed.length > 0 ? parsed : undefined;\n\t}\n\n\tif (!Array.isArray(value)) {\n\t\treturn undefined;\n\t}\n\tconst parsed: (LineRange | number)[] = [];\n\tfor (const item of value) {\n\t\tconst maybe = parseSingle(item);\n\t\tif (maybe != null) {\n\t\t\tparsed.push(maybe);\n\t\t}\n\t}\n\treturn parsed.length > 0 ? parsed : undefined;\n}\n\nexport {\n\t//,\n\tparseCodeBlockHighlightLines,\n\tparseCodeBlockLineNumberStart,\n\tparseCodeBlockShowLineNumbers,\n};\n","import type { SupportedLanguage } from \"./supported-languages.js\";\nimport { isSupportedLanguage } from \"./supported-languages.js\";\nimport { parseBooleanish } from \"../../types/booleanish.js\";\nimport { type Indentation, isIndentation } from \"./indentation.js\";\nimport {\n\tparseCodeBlockHighlightLines,\n\tparseCodeBlockLineNumberStart,\n\tparseCodeBlockShowLineNumbers,\n} from \"./parse-line-options.js\";\n\nconst modes = [\n\t//,\n\t\"cli\",\n\t\"file\",\n\t\"traffic-policy\",\n] as const;\n/** The visual mode preset for a code block (determines header icon). */\ntype Mode = (typeof modes)[number];\n\n/** User-facing input shape for code block metadata (metastring key-value pairs). */\ntype MetaInput = {\n\tcollapsible?: boolean | undefined;\n\tdisableCopy?: boolean | undefined;\n\tindentation?: Indentation | undefined;\n\tmode?: Mode | undefined;\n\ttitle?: string | undefined;\n};\n\n/** Resolved code block metadata with defaults applied. */\ntype Meta = {\n\tcollapsible: boolean;\n\tdisableCopy: boolean;\n\tindentation?: Indentation | undefined;\n\tmode?: Mode | undefined;\n\ttitle?: string | undefined;\n};\n\nconst defaultMeta = {\n\tcollapsible: false,\n\tdisableCopy: false,\n\tindentation: undefined,\n\tmode: undefined,\n\ttitle: undefined,\n} as const satisfies Meta;\n\n/** The type of the default metadata constant. */\ntype DefaultMeta = typeof defaultMeta;\n\n/** Parses a code fence metastring (e.g. `title=\"example\" collapsible`) into a structured `Meta` object. */\nfunction parseMetastring(input: string | undefined): Meta {\n\tconst metastring = input?.trim() ?? \"\";\n\tif (!metastring) {\n\t\treturn defaultMeta;\n\t}\n\n\tconst metaJson: Record<string, unknown> = {};\n\tconst tokens = tokenizeMetastring(metastring);\n\tfor (const token of tokens) {\n\t\tconst separatorIndex = token.indexOf(\"=\");\n\t\tconst key = separatorIndex === -1 ? token : token.slice(0, separatorIndex);\n\t\tconst value = separatorIndex === -1 ? undefined : token.slice(separatorIndex + 1);\n\n\t\tif (!key) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst normalized = normalizeValue(value);\n\t\tmetaJson[key] = normalized ?? true;\n\t}\n\n\treturn parseMetaJson(metaJson);\n}\n\n/** Strips surrounding double-quotes and trims whitespace from a metastring value. */\nfunction normalizeValue(value: string | undefined) {\n\tif (value == null) {\n\t\treturn undefined;\n\t}\n\tconst trimmed = value.trim();\n\tconst lastIndex = trimmed.length - 1;\n\tif (lastIndex >= 1 && trimmed.charCodeAt(0) === 34 && trimmed.charCodeAt(lastIndex) === 34) {\n\t\treturn trimmed.slice(1, lastIndex);\n\t}\n\treturn trimmed;\n}\n\n/** Splits a metastring into whitespace-delimited tokens, respecting double-quoted segments. */\nfunction tokenizeMetastring(value: string | undefined): string[] {\n\tconst input = value?.trim() ?? \"\";\n\tconst result: string[] = [];\n\n\tlet current = \"\";\n\tlet inQuotes = false;\n\n\tfor (let i = 0; i < input.length; i++) {\n\t\tconst char = input[i] ?? \"\";\n\t\tif (!inQuotes && isMetastringWhitespace(char)) {\n\t\t\tif (current) {\n\t\t\t\tresult.push(current);\n\t\t\t\tcurrent = \"\";\n\t\t\t}\n\t\t} else if (char === '\"') {\n\t\t\tinQuotes = !inQuotes;\n\t\t\tcurrent += char;\n\t\t} else {\n\t\t\tcurrent += char;\n\t\t}\n\t}\n\n\tif (current) {\n\t\tresult.push(current);\n\t}\n\n\treturn result;\n}\n\n/** Returns `true` for the ASCII whitespace characters a metastring may use to separate tokens. */\nfunction isMetastringWhitespace(char: string): boolean {\n\treturn char === \" \" || char === \"\\t\" || char === \"\\n\" || char === \"\\r\";\n}\n\n/** Type predicate: checks if a value is a valid code block `Mode`. */\nfunction isMode(input: unknown): input is Mode {\n\treturn input === \"cli\" || input === \"file\" || input === \"traffic-policy\";\n}\n\n/** Converts a raw key-value record (from tokenized metastring) into a validated `Meta` object. */\nfunction parseMetaJson(input: Record<string, unknown>): Meta {\n\tconst {\n\t\tcollapsible = defaultMeta.collapsible,\n\t\tdisableCopy = defaultMeta.disableCopy,\n\t\tindentation = defaultMeta.indentation,\n\t\tmode = defaultMeta.mode,\n\t\ttitle = defaultMeta.title,\n\t} = input;\n\n\treturn {\n\t\tcollapsible:\n\t\t\ttypeof collapsible === \"string\" || typeof collapsible === \"boolean\"\n\t\t\t\t? parseBooleanish(collapsible)\n\t\t\t\t: defaultMeta.collapsible,\n\t\tdisableCopy:\n\t\t\ttypeof disableCopy === \"string\" || typeof disableCopy === \"boolean\"\n\t\t\t\t? parseBooleanish(disableCopy)\n\t\t\t\t: defaultMeta.disableCopy,\n\t\tindentation: isIndentation(indentation) ? indentation : defaultMeta.indentation,\n\t\tmode: isMode(mode) ? mode : defaultMeta.mode,\n\t\ttitle: typeof title === \"string\" ? title.trim() : defaultMeta.title,\n\t};\n}\n\n/** Props that the rehype plugin attaches to `<pre>` elements for pre-rendered code blocks. */\ntype ResolvePreRenderedCodeBlockPropsInput = {\n\tcollapsible?: unknown;\n\tdisableCopy?: unknown;\n\tmantleCode?: unknown;\n\tmantleCollapsible?: unknown;\n\tmantleDisableCopy?: unknown;\n\tmantleHighlightLines?: unknown;\n\tmantleLanguage?: unknown;\n\tmantleLineNumberStart?: unknown;\n\tmantleMode?: unknown;\n\tmantlePreHtml?: unknown;\n\tmantleShowLineNumbers?: unknown;\n\tmantleTitle?: unknown;\n\tmode?: unknown;\n\ttitle?: unknown;\n};\n\n/** Combined input type for a `<pre>` element that may carry both metastring and pre-rendered props. */\ntype CodeBlockPreElementInput = MetaInput & ResolvePreRenderedCodeBlockPropsInput;\n\ntype PreRenderedCodeBlockPropKey = keyof ResolvePreRenderedCodeBlockPropsInput;\n\n/** Normalized code block props extracted from pre-rendered `<pre>` element attributes. */\ntype ResolvedPreRenderedCodeBlockProps = {\n\tcode: string | undefined;\n\tcollapsible: boolean | undefined;\n\tdisableCopy: boolean | undefined;\n\thighlightLines: (number | `${number}-${number}`)[] | undefined;\n\tlanguage: SupportedLanguage | undefined;\n\tlineNumberStart: number | undefined;\n\tmode: Mode | undefined;\n\tpreHtml: string | undefined;\n\trawLanguage: unknown;\n\tshowLineNumbers: boolean | undefined;\n\ttitle: string | undefined;\n};\n\n/** Result of {@link resolvePreRenderedCodeBlockProps}: extracted Mantle props and remaining pass-through props. */\ntype ResolvePreRenderedCodeBlockPropsResult<T extends Record<string, unknown>> = {\n\tmantleCode: ResolvedPreRenderedCodeBlockProps | undefined;\n\tprops: Omit<T, PreRenderedCodeBlockPropKey>;\n};\n\n/**\n * Extracts and normalizes `mantle*` props from a `<pre>` element's attributes,\n * separating them from pass-through props. Returns `undefined` for the Mantle\n * payload when no pre-rendered attributes are present.\n */\nfunction resolvePreRenderedCodeBlockProps<\n\tT extends ResolvePreRenderedCodeBlockPropsInput & Record<string, unknown>,\n>(input: T): ResolvePreRenderedCodeBlockPropsResult<T> {\n\tconst {\n\t\tcollapsible,\n\t\tdisableCopy,\n\t\tmantleCode,\n\t\tmantleCollapsible,\n\t\tmantleDisableCopy,\n\t\tmantleHighlightLines,\n\t\tmantleLanguage,\n\t\tmantleLineNumberStart,\n\t\tmantleMode,\n\t\tmantlePreHtml,\n\t\tmantleShowLineNumbers,\n\t\tmantleTitle,\n\t\tmode,\n\t\ttitle,\n\t\t...props\n\t} = input;\n\n\tconst hasPayload =\n\t\tmantleLanguage != null ||\n\t\tmantleCode != null ||\n\t\tmantlePreHtml != null ||\n\t\tmantleShowLineNumbers != null ||\n\t\tmantleHighlightLines != null ||\n\t\tmantleLineNumberStart != null ||\n\t\tmantleCollapsible != null ||\n\t\tmantleDisableCopy != null ||\n\t\tmantleMode != null ||\n\t\tmantleTitle != null;\n\n\tif (!hasPayload) {\n\t\treturn {\n\t\t\tmantleCode: undefined,\n\t\t\tprops: props as Omit<T, PreRenderedCodeBlockPropKey>,\n\t\t};\n\t}\n\n\treturn {\n\t\tmantleCode: {\n\t\t\tcode: typeof mantleCode === \"string\" ? mantleCode : undefined,\n\t\t\tcollapsible:\n\t\t\t\t(typeof mantleCollapsible === \"string\" || typeof mantleCollapsible === \"boolean\"\n\t\t\t\t\t? parseBooleanish(mantleCollapsible)\n\t\t\t\t\t: undefined) ??\n\t\t\t\t(typeof collapsible === \"string\" || typeof collapsible === \"boolean\"\n\t\t\t\t\t? parseBooleanish(collapsible)\n\t\t\t\t\t: undefined),\n\t\t\tdisableCopy:\n\t\t\t\ttypeof mantleDisableCopy === \"string\" || typeof mantleDisableCopy === \"boolean\"\n\t\t\t\t\t? parseBooleanish(mantleDisableCopy)\n\t\t\t\t\t: typeof disableCopy === \"string\" || typeof disableCopy === \"boolean\"\n\t\t\t\t\t\t? parseBooleanish(disableCopy)\n\t\t\t\t\t\t: undefined,\n\t\t\thighlightLines: parseCodeBlockHighlightLines(mantleHighlightLines),\n\t\t\tlanguage:\n\t\t\t\ttypeof mantleLanguage === \"string\" && isSupportedLanguage(mantleLanguage)\n\t\t\t\t\t? mantleLanguage\n\t\t\t\t\t: undefined,\n\t\t\tlineNumberStart: parseCodeBlockLineNumberStart(mantleLineNumberStart),\n\t\t\tmode: isMode(mantleMode) ? mantleMode : isMode(mode) ? mode : undefined,\n\t\t\tpreHtml: typeof mantlePreHtml === \"string\" ? mantlePreHtml : undefined,\n\t\t\trawLanguage: mantleLanguage,\n\t\t\tshowLineNumbers: parseCodeBlockShowLineNumbers(mantleShowLineNumbers),\n\t\t\ttitle:\n\t\t\t\ttypeof mantleTitle === \"string\"\n\t\t\t\t\t? mantleTitle.trim()\n\t\t\t\t\t: typeof title === \"string\"\n\t\t\t\t\t\t? title.trim()\n\t\t\t\t\t\t: undefined,\n\t\t},\n\t\tprops: props as Omit<T, PreRenderedCodeBlockPropKey>,\n\t};\n}\n\nexport { resolvePreRenderedCodeBlockProps };\nexport {\n\t//,\n\tdefaultMeta,\n\tnormalizeValue,\n\tparseMetastring,\n\ttokenizeMetastring,\n};\n\nexport type {\n\tCodeBlockPreElementInput,\n\tDefaultMeta,\n\tMeta,\n\tMetaInput,\n\tMode,\n\tResolvePreRenderedCodeBlockPropsInput,\n\tResolvePreRenderedCodeBlockPropsResult,\n\tResolvedPreRenderedCodeBlockProps,\n};\n"],"mappings":"6EAKA,MAAM,EAAiB,IAAI,IAAuB,CAAC,OAAQ,KAAM,OAAO,CAAC,EAGzE,SAAS,EAAuB,EAA6B,EAAuB,CAInF,MAHA,EAAI,EAAe,IAAI,CAAQ,GAAK,CAAC,EAAK,KAAK,EAAE,SAAS;CAAI,EAI/D,CAEA,MAAM,EAA2C,OAAO,sBAAsB,EA6F9E,SAAS,EAA2B,CACnC,UACA,cACA,UACA,iBACA,kBACA,kBACA,OACA,YACmD,CACnD,MAAO,EACL,GAA4B,GAC7B,WACA,OACA,WAAY,EACZ,eAAgB,EAChB,WAAY,EACZ,kBAAmB,EACnB,mBAAoB,EACpB,mBAAoB,CACrB,CACD,CAGA,SAAS,EAAsB,EAA+B,EAA2B,CACxF,IAAI,EAAO,GACX,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAQ,OAAQ,GAAS,EACpD,GAAQ,EAAQ,IAAU,GACtB,EAAQ,EAAO,SAClB,GAAQ,OAAO,EAAO,EAAM,GAG9B,OAAO,CACR,CA2BA,SAAS,EACR,EACA,EAA6B,CAAC,EACkD,CAChF,GAAM,CAAE,kBAAiB,iBAAgB,mBAAoB,EAE7D,OAAQ,EAAS,GAAG,IAAW,CAC9B,IAAM,EAAO,EAAsB,EAAS,CAAM,EAElD,OAAO,EAA2B,CACjC,WACA,OACA,QAAS,IAAA,GACT,QAAS,EAAO,OAAS,EAAI,EAAS,IAAA,GACtC,iBACA,kBACA,gBAAiB,GAAmB,EAAuB,EAAU,CAAI,CAC1E,CAAC,CACF,CACD,CCxKA,SAAgB,EAAmB,GAAG,EAA4C,CACjF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,IAAA,GAC7D,YAAa,EACb,gBAAiB,EAA8B,CAAqB,EACpE,MACC,OAAO,GAAgB,SACpB,EAAY,KAAK,EACjB,OAAO,GAAU,SAChB,EAAM,KAAK,EACX,IAAA,EACN,EACO,OACR,EAxCQ,CACN,WAAY,IAAA,GACL,OACR,CAsCF"}
@@ -430,4 +430,4 @@ type ResolvePreRenderedCodeBlockPropsResult<T extends Record<string, unknown>> =
430
430
  declare function resolvePreRenderedCodeBlockProps<T extends ResolvePreRenderedCodeBlockPropsInput & Record<string, unknown>>(input: T): ResolvePreRenderedCodeBlockPropsResult<T>;
431
431
  //#endregion
432
432
  export { FoldStrategy as A, computeJsonFoldRanges as B, Indentation as C, FoldExplanation as D, ComputeFoldRangesInput as E, isSupportedLanguage as F, finalizeFoldRanges as H, parseLanguage as I, supportedLanguages as L, computeFoldRanges as M, foldStrategyFor as N, FoldLine as O, SupportedLanguage as P, DecorateHighlightedHtmlInput as R, normalizeIndentation as S, isIndentation as T, LineRange as U, FoldableRange as V, MantleCodeBlockValue as _, Mode as a, defaultShowLineNumbers as b, ResolvedPreRenderedCodeBlockProps as c, parseMetastring as d, resolvePreRenderedCodeBlockProps as f, parseCodeBlockShowLineNumbers as g, parseCodeBlockLineNumberStart as h, MetaInput as i, FoldToken as j, FoldScope as k, defaultMeta as l, parseCodeBlockHighlightLines as m, DefaultMeta as n, ResolvePreRenderedCodeBlockPropsInput as o, tokenizeMetastring as p, Meta as r, ResolvePreRenderedCodeBlockPropsResult as s, CodeBlockPreElementInput as t, normalizeValue as u, MantleCodeOptions as v, inferIndentation as w, mantleCode as x, createMantleCodeBlockValue as y, decorateHighlightedHtml as z };
433
- //# sourceMappingURL=resolve-pre-rendered-props-BONSCwYA.d.ts.map
433
+ //# sourceMappingURL=resolve-pre-rendered-props-DxJ9-DAl.d.ts.map
@@ -1,5 +1,4 @@
1
- import { t as WithAsChild } from "./as-child-CpZKMqTE.js";
2
- import * as _$react from "react";
1
+ import { t as WithAsChild } from "./as-child-uN_018tj.js";
3
2
  import { ComponentProps, MouseEventHandler } from "react";
4
3
 
5
4
  //#region src/components/sandboxed-on-click/sandboxed-on-click.d.ts
@@ -42,7 +41,7 @@ declare const sandboxedOnClickProps: ({
42
41
  * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role
43
42
  */
44
43
  readonly role: "presentation";
45
- readonly onClick: (event: _$react.MouseEvent<HTMLElement, MouseEvent>) => void;
44
+ readonly onClick: (event: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
46
45
  };
47
46
  type Props = ComponentProps<"div"> & WithAsChild & BaseProps;
48
47
  /**
@@ -62,7 +61,7 @@ type Props = ComponentProps<"div"> & WithAsChild & BaseProps;
62
61
  * </TableRowCell>
63
62
  * </TableRow>
64
63
  */
65
- declare const SandboxedOnClick: _$react.ForwardRefExoticComponent<Omit<Props, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
64
+ declare const SandboxedOnClick: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
66
65
  //#endregion
67
66
  export { SandboxedOnClick, sandboxedOnClickProps };
68
67
  //# sourceMappingURL=sandboxed-on-click.d.ts.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"./slot-D_ZUrdEW.js";import{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";const r=({allowClickEventDefault:e=!1,onClick:t}={})=>({role:`presentation`,onClick:n=>{n.stopPropagation(),e||n.preventDefault(),t?.(n)}}),i=t(({allowClickEventDefault:t=!1,asChild:i=!1,children:a,onClick:o,...s},c)=>n(i?e:`div`,{ref:c,...s,...r({allowClickEventDefault:t,onClick:o}),children:a}));i.displayName=`SandboxedOnClick`;export{i as SandboxedOnClick,r as sandboxedOnClickProps};
1
+ import{t as e}from"./slot-CV5fmqFr.js";import{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";const r=({allowClickEventDefault:e=!1,onClick:t}={})=>({role:`presentation`,onClick:n=>{n.stopPropagation(),e||n.preventDefault(),t?.(n)}}),i=t(({allowClickEventDefault:t=!1,asChild:i=!1,children:a,onClick:o,...s},c)=>n(i?e:`div`,{ref:c,...s,...r({allowClickEventDefault:t,onClick:o}),children:a}));i.displayName=`SandboxedOnClick`;export{i as SandboxedOnClick,r as sandboxedOnClickProps};
2
2
  //# sourceMappingURL=sandboxed-on-click.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sandboxed-on-click.js","names":[],"sources":["../src/components/sandboxed-on-click/sandboxed-on-click.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps, ComponentRef, HTMLAttributes, MouseEventHandler } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { Slot } from \"../slot/index.js\";\n\ntype BaseProps = {\n\t/**\n\t * Only call `event.preventDefault()` in the `onClick` handler if the user\n\t * has not set `allowClickEventDefault` to `true`. This allows the user to\n\t * control whether or not the default behavior of the click event should be\n\t * allowed.\n\t *\n\t * This is useful for links or buttons that should navigate or perform some\n\t * action on click.\n\t *\n\t * @default false\n\t */\n\tallowClickEventDefault?: boolean;\n};\n\ntype EventProps = BaseProps & {\n\t/**\n\t * The click event handler.\n\t */\n\tonClick?: MouseEventHandler<HTMLElement>;\n};\n\n/**\n * Props for the sandboxed onClick container. Spread this on the element you want\n * to prevent the click event from bubbling out of.\n *\n * @see https://mantle.ngrok.com/components/sandboxed-on-click#sandboxedonclick\n */\nconst sandboxedOnClickProps = ({ allowClickEventDefault = false, onClick }: EventProps = {}) =>\n\t({\n\t\t/**\n\t\t * Marking an element with the role presentation indicates to assistive\n\t\t * technology that this element should be ignored; it exists to support the\n\t\t * web application and is not meant for humans to interact with directly.\n\t\t *\n\t\t * @see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/65be35b0f6c6cf8b79e9a748cb657a64b78c6535/docs/rules/no-noninteractive-element-interactions.md#case-this-element-is-catching-bubbled-events-from-elements-that-it-contains\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role\n\t\t */\n\t\trole: \"presentation\",\n\t\tonClick: (event) => {\n\t\t\t/**\n\t\t\t * we _always_ want to stop propagation to prevent the event from bubbling\n\t\t\t * out of the sandboxed container\n\t\t\t */\n\t\t\tevent.stopPropagation();\n\n\t\t\t/**\n\t\t\t * Only call `event.preventDefault()` if the user has not set\n\t\t\t * `allowClickEventDefault` to true. This allows the user to control\n\t\t\t * whether or not the default behavior of the click event should be\n\t\t\t * allowed.\n\t\t\t *\n\t\t\t * This is useful for links or buttons that should navigate or perform\n\t\t\t * some action on click.\n\t\t\t */\n\t\t\tif (!allowClickEventDefault) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\tonClick?.(event);\n\t\t},\n\t}) as const satisfies HTMLAttributes<HTMLElement>;\n\ntype Props = ComponentProps<\"div\"> & WithAsChild & BaseProps;\n\n/**\n * A container that prevents the click event from bubbling out of it.\n *\n * @see https://mantle.ngrok.com/components/sandboxed-on-click#sandboxedonclick\n *\n * @example\n * ```tsx\n * <TableRow onClick={() => navigate(\"/somewhere\")}>\n * <TableRowCell>\n * <SandboxedOnClick allowClickEventDefault>\n * <Anchor href=\"https://ngrok.com/docs\">\n * See ngrok docs\n * </Anchor>\n * </SandboxedOnClick>\n * </TableRowCell>\n * </TableRow>\n */\nconst SandboxedOnClick = forwardRef<ComponentRef<\"div\">, Props>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tallowClickEventDefault = false,\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tonClick,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t\t{...sandboxedOnClickProps({ allowClickEventDefault, onClick })}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nSandboxedOnClick.displayName = \"SandboxedOnClick\";\n\nexport {\n\t//,\n\tSandboxedOnClick,\n\tsandboxedOnClickProps,\n};\n"],"mappings":"kHAmCA,MAAM,GAAyB,CAAE,yBAAyB,GAAO,WAAwB,EAAE,IACzF,CASA,KAAM,eACN,QAAU,GAAU,CAKnB,EAAM,iBAAiB,CAWlB,GACJ,EAAM,gBAAgB,CAEvB,IAAU,EAAM,EAEjB,EAqBI,EAAmB,GAEvB,CAEC,yBAAyB,GACzB,UAAU,GACV,WACA,UACA,GAAG,GAEJ,IAKC,EAHiB,EAAU,EAAO,MAGlC,CACM,MACL,GAAI,EACJ,GAAI,EAAsB,CAAE,yBAAwB,UAAS,CAAC,CAE7D,WACU,CAAA,CAGd,CACD,EAAiB,YAAc"}
1
+ {"version":3,"file":"sandboxed-on-click.js","names":[],"sources":["../src/components/sandboxed-on-click/sandboxed-on-click.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps, ComponentRef, HTMLAttributes, MouseEventHandler } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { Slot } from \"../slot/index.js\";\n\ntype BaseProps = {\n\t/**\n\t * Only call `event.preventDefault()` in the `onClick` handler if the user\n\t * has not set `allowClickEventDefault` to `true`. This allows the user to\n\t * control whether or not the default behavior of the click event should be\n\t * allowed.\n\t *\n\t * This is useful for links or buttons that should navigate or perform some\n\t * action on click.\n\t *\n\t * @default false\n\t */\n\tallowClickEventDefault?: boolean;\n};\n\ntype EventProps = BaseProps & {\n\t/**\n\t * The click event handler.\n\t */\n\tonClick?: MouseEventHandler<HTMLElement>;\n};\n\n/**\n * Props for the sandboxed onClick container. Spread this on the element you want\n * to prevent the click event from bubbling out of.\n *\n * @see https://mantle.ngrok.com/components/sandboxed-on-click#sandboxedonclick\n */\nconst sandboxedOnClickProps = ({ allowClickEventDefault = false, onClick }: EventProps = {}) =>\n\t({\n\t\t/**\n\t\t * Marking an element with the role presentation indicates to assistive\n\t\t * technology that this element should be ignored; it exists to support the\n\t\t * web application and is not meant for humans to interact with directly.\n\t\t *\n\t\t * @see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/65be35b0f6c6cf8b79e9a748cb657a64b78c6535/docs/rules/no-noninteractive-element-interactions.md#case-this-element-is-catching-bubbled-events-from-elements-that-it-contains\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role\n\t\t */\n\t\trole: \"presentation\",\n\t\tonClick: (event) => {\n\t\t\t/**\n\t\t\t * we _always_ want to stop propagation to prevent the event from bubbling\n\t\t\t * out of the sandboxed container\n\t\t\t */\n\t\t\tevent.stopPropagation();\n\n\t\t\t/**\n\t\t\t * Only call `event.preventDefault()` if the user has not set\n\t\t\t * `allowClickEventDefault` to true. This allows the user to control\n\t\t\t * whether or not the default behavior of the click event should be\n\t\t\t * allowed.\n\t\t\t *\n\t\t\t * This is useful for links or buttons that should navigate or perform\n\t\t\t * some action on click.\n\t\t\t */\n\t\t\tif (!allowClickEventDefault) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\tonClick?.(event);\n\t\t},\n\t}) as const satisfies HTMLAttributes<HTMLElement>;\n\ntype Props = ComponentProps<\"div\"> & WithAsChild & BaseProps;\n\n/**\n * A container that prevents the click event from bubbling out of it.\n *\n * @see https://mantle.ngrok.com/components/sandboxed-on-click#sandboxedonclick\n *\n * @example\n * ```tsx\n * <TableRow onClick={() => navigate(\"/somewhere\")}>\n * <TableRowCell>\n * <SandboxedOnClick allowClickEventDefault>\n * <Anchor href=\"https://ngrok.com/docs\">\n * See ngrok docs\n * </Anchor>\n * </SandboxedOnClick>\n * </TableRowCell>\n * </TableRow>\n */\nconst SandboxedOnClick = forwardRef<ComponentRef<\"div\">, Props>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tallowClickEventDefault = false,\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tonClick,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t\t{...sandboxedOnClickProps({ allowClickEventDefault, onClick })}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nSandboxedOnClick.displayName = \"SandboxedOnClick\";\n\nexport {\n\t//,\n\tSandboxedOnClick,\n\tsandboxedOnClickProps,\n};\n"],"mappings":"kHAmCA,MAAM,GAAyB,CAAE,yBAAyB,GAAO,WAAwB,CAAC,KACxF,CASA,KAAM,eACN,QAAU,GAAU,CAKnB,EAAM,gBAAgB,EAWjB,GACJ,EAAM,eAAe,EAEtB,IAAU,CAAK,CAChB,CACD,GAqBK,EAAmB,GAEvB,CAEC,yBAAyB,GACzB,UAAU,GACV,WACA,UACA,GAAG,GAEJ,IAKC,EAHiB,EAAU,EAAO,MAGlC,CACM,MACL,GAAI,EACJ,GAAI,EAAsB,CAAE,yBAAwB,SAAQ,CAAC,EAE5D,UACS,CAAA,CAGd,EACA,EAAiB,YAAc"}
@@ -1,6 +1,5 @@
1
- import { t as WithAsChild } from "./as-child-CpZKMqTE.js";
2
- import { o as WithValidation } from "./validation-CBSOmooP.js";
3
- import * as _$react from "react";
1
+ import { t as WithAsChild } from "./as-child-uN_018tj.js";
2
+ import { o as WithValidation } from "./validation-xyX_6kph.js";
4
3
  import { FocusEvent, ReactNode, SelectHTMLAttributes } from "react";
5
4
  import * as SelectPrimitive from "@radix-ui/react-select";
6
5
 
@@ -84,7 +83,7 @@ declare const Select: {
84
83
  * </Select.Root>
85
84
  * ```
86
85
  */
87
- readonly Root: _$react.ForwardRefExoticComponent<{
86
+ readonly Root: import("react").ForwardRefExoticComponent<{
88
87
  children?: ReactNode | undefined;
89
88
  } & {
90
89
  autoComplete?: string;
@@ -110,7 +109,7 @@ declare const Select: {
110
109
  open?: boolean;
111
110
  required?: boolean;
112
111
  value?: string;
113
- } & WithValidation & WithAriaInvalid & _$react.RefAttributes<HTMLButtonElement>>;
112
+ } & WithValidation & WithAriaInvalid & import("react").RefAttributes<HTMLButtonElement>>;
114
113
  /**
115
114
  * The component that pops out when the select is open as a portal adjacent to the trigger button.
116
115
  * It contains a scrolling viewport of the select items.
@@ -140,14 +139,14 @@ declare const Select: {
140
139
  * </Select.Root>
141
140
  * ```
142
141
  */
143
- readonly Content: _$react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & _$react.RefAttributes<HTMLDivElement>, "ref"> & {
142
+ readonly Content: import("react").ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
144
143
  /**
145
144
  * The width of the content. Defaults to the width of the trigger.
146
145
  * If set to "content", the content will use the intrinsic content width; it will be the width of the longest/widest item.
147
146
  * @default "trigger"
148
147
  */
149
148
  width?: "trigger" | "content";
150
- } & _$react.RefAttributes<HTMLDivElement>>;
149
+ } & import("react").RefAttributes<HTMLDivElement>>;
151
150
  /**
152
151
  * A group of related options within a select menu. Similar to an html `<optgroup>` element.
153
152
  * Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.
@@ -177,7 +176,7 @@ declare const Select: {
177
176
  * </Select.Root>
178
177
  * ```
179
178
  */
180
- readonly Group: _$react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectGroupProps & _$react.RefAttributes<HTMLDivElement>, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
179
+ readonly Group: import("react").ForwardRefExoticComponent<Omit<SelectPrimitive.SelectGroupProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
181
180
  /**
182
181
  * An option within a select menu. Similar to an html `<option>` element.
183
182
  * Has a required `value` prop that will be passed to the `onChange` handler of the `Select` component when this item is selected.
@@ -208,9 +207,9 @@ declare const Select: {
208
207
  * </Select.Root>
209
208
  * ```
210
209
  */
211
- readonly Item: _$react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & _$react.RefAttributes<HTMLDivElement>, "ref"> & {
210
+ readonly Item: import("react").ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
212
211
  icon?: ReactNode;
213
- } & _$react.RefAttributes<HTMLDivElement>>;
212
+ } & import("react").RefAttributes<HTMLDivElement>>;
214
213
  /**
215
214
  * Used to render the label of a group. It won't be focusable using arrow keys.
216
215
  *
@@ -239,7 +238,7 @@ declare const Select: {
239
238
  * </Select.Root>
240
239
  * ```
241
240
  */
242
- readonly Label: _$react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & _$react.RefAttributes<HTMLDivElement>, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
241
+ readonly Label: import("react").ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
243
242
  /**
244
243
  * Used to visually separate items or groups of items in the select content.
245
244
  *
@@ -268,10 +267,10 @@ declare const Select: {
268
267
  * </Select.Root>
269
268
  * ```
270
269
  */
271
- readonly Separator: _$react.ForwardRefExoticComponent<Omit<Omit<_$react.ClassAttributes<HTMLDivElement> & _$react.HTMLAttributes<HTMLDivElement> & WithAsChild & {
270
+ readonly Separator: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & WithAsChild & {
272
271
  orientation?: "horizontal" | "vertical";
273
272
  semantic?: boolean;
274
- }, "ref"> & _$react.RefAttributes<HTMLDivElement>, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
273
+ }, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
275
274
  /**
276
275
  * The button that toggles the select. The Select.Content will position itself adjacent to the trigger.
277
276
  *
@@ -300,7 +299,7 @@ declare const Select: {
300
299
  * </Select.Root>
301
300
  * ```
302
301
  */
303
- readonly Trigger: _$react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & _$react.RefAttributes<HTMLButtonElement>, "ref"> & WithAriaInvalid & WithValidation & _$react.RefAttributes<HTMLButtonElement>>;
302
+ readonly Trigger: import("react").ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & WithAriaInvalid & WithValidation & import("react").RefAttributes<HTMLButtonElement>>;
304
303
  /**
305
304
  * The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.
306
305
  *
@@ -329,8 +328,8 @@ declare const Select: {
329
328
  * </Select.Root>
330
329
  * ```
331
330
  */
332
- readonly Value: _$react.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & _$react.RefAttributes<HTMLSpanElement>>;
331
+ readonly Value: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
333
332
  };
334
333
  //#endregion
335
334
  export { Select as t };
336
- //# sourceMappingURL=select-SZFFzYs0.d.ts.map
335
+ //# sourceMappingURL=select-C15-XvRT.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./cx-CBSnSC36.js";import{t}from"./icon-C8bYBIHW.js";import{t as n}from"./compose-refs-Cjf2gfB8.js";import{a as r,r as i}from"./validation-DCyx-ceH.js";import{n as a}from"./separator-Bqjy77rG.js";import{t as o}from"./field-context-4k1kI7Bo.js";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,forwardRef as l,useContext as u,useMemo as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{CheckIcon as m}from"@phosphor-icons/react/Check";import{CaretUpIcon as h}from"@phosphor-icons/react/CaretUp";import*as g from"@radix-ui/react-select";const _=c({}),v=l(({"aria-invalid":e,children:t,id:n,validation:r,onBlur:i,onValueChange:a,onChange:o,...s},c)=>{let l=d(()=>({"aria-invalid":e,id:n,validation:r,onBlur:i,ref:c}),[e,n,r,i,c]);return f(g.Root,{...s,onValueChange:e=>{o?.(e),a?.(e)},children:f(_.Provider,{value:l,children:t})})});v.displayName=`Select`;const y=l(({className:t,...n},r)=>f(g.Group,{ref:r,"data-slot":`select-group`,className:e(`space-y-px`,t),...n}));y.displayName=`SelectGroup`;const b=g.Value;b.displayName=`SelectValue`;const x=l(({"aria-invalid":a,className:c,children:l,id:d,validation:m,...h},v)=>{let y=u(_),b=u(o),x=r(),{ariaInvalid:S,validation:C}=i({"aria-invalid":b?b[`aria-invalid`]:y[`aria-invalid`]??a,validation:y.validation??m??x}),w=b?b.id:y.id??d;return p(g.Trigger,{"data-slot":`select-trigger`,className:e(`h-9 text-sm`,`border-form bg-form text-strong font-sans placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,c),"data-validation":C||void 0,id:w,ref:n(v,y.ref),...h,...b?{"aria-describedby":b[`aria-describedby`],"aria-errormessage":b[`aria-errormessage`]}:void 0,"aria-invalid":S,children:[l,f(g.Icon,{asChild:!0,children:f(t,{svg:f(s,{weight:`bold`}),className:`size-4`})})]})});x.displayName=`SelectTrigger`;const S=l(({className:n,...r},i)=>f(g.ScrollUpButton,{ref:i,className:e(`flex cursor-default items-center justify-center py-1`,n),...r,children:f(t,{svg:f(h,{weight:`bold`}),className:`size-4`})}));S.displayName=`SelectScrollUpButton`;const C=l(({className:n,...r},i)=>f(g.ScrollDownButton,{ref:i,className:e(`flex cursor-default items-center justify-center py-1`,n),...r,children:f(t,{svg:f(s,{weight:`bold`}),className:`size-4`})}));C.displayName=`SelectScrollDownButton`;const w=l(({className:t,children:n,position:r=`popper`,width:i=`trigger`,...a},o)=>f(g.Portal,{children:p(g.Content,{ref:o,"data-slot":`select-content`,className:e(`border-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md`,`bg-popover font-sans`,r===`popper`&&`data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-(--radix-select-content-available-height)`,i===`trigger`&&`w-(--radix-select-trigger-width)`,t),position:r,...a,children:[f(S,{}),f(g.Viewport,{className:e(`p-1 space-y-px`,r===`popper`&&`h-(--radix-select-trigger-height) w-full`),children:n}),f(C,{})]})}));w.displayName=`SelectContent`;const T=l(({className:t,...n},r)=>f(g.Label,{ref:r,"data-slot":`select-label`,className:e(`px-2 py-1.5 text-sm font-medium`,t),...n}));T.displayName=`SelectLabel`;const E=l(({className:n,children:r,icon:i,...a},o)=>p(g.Item,{ref:o,"data-slot":`select-item`,className:e(`relative flex gap-2 w-full cursor-pointer select-none items-center rounded-md py-1.5 pl-2 pr-8 text-strong text-sm outline-hidden`,`focus:bg-active-menu-item`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`data-state-checked:bg-selected-menu-item`,`focus:data-state-checked:bg-active-selected-menu-item`,n),...a,children:[i&&f(t,{svg:i}),f(g.ItemText,{children:r}),f(g.ItemIndicator,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:f(t,{svg:f(m,{weight:`bold`}),className:`size-4 text-accent-600`})})]}));E.displayName=`SelectItem`;const D=l(({className:t,...n},r)=>f(a,{ref:r,"data-slot":`select-separator`,className:e(`-mx-1 my-1 h-px w-auto`,t),...n}));D.displayName=`SelectSeparator`;const O={Root:v,Content:w,Group:y,Item:E,Label:T,Separator:D,Trigger:x,Value:b};export{O as t};
2
+ //# sourceMappingURL=select-Cxc9VmP8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-Cxc9VmP8.js","names":[],"sources":["../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { CaretDownIcon } from \"@phosphor-icons/react/CaretDown\";\nimport { CaretUpIcon } from \"@phosphor-icons/react/CaretUp\";\nimport { CheckIcon } from \"@phosphor-icons/react/Check\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport type {\n\tComponentProps,\n\tComponentPropsWithoutRef,\n\tComponentRef,\n\tFocusEvent,\n\tPropsWithChildren,\n\tReactNode,\n\tRef,\n\tSelectHTMLAttributes,\n} from \"react\";\nimport { createContext, forwardRef, useContext, useMemo } from \"react\";\nimport { composeRefs } from \"../../utils/compose-refs/compose-refs.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { FieldControlContext } from \"../field/field-context.js\";\nimport { parseValidation, useFieldValidation } from \"../field/validation.js\";\nimport type { WithValidation } from \"../field/validation.js\";\nimport { Icon } from \"../icon/icon.js\";\nimport { Separator } from \"../separator/separator.js\";\n\ntype WithAriaInvalid = Pick<SelectHTMLAttributes<HTMLSelectElement>, \"aria-invalid\">;\ntype SelectContextType = WithValidation &\n\tWithAriaInvalid & {\n\t\t/**\n\t\t * Ref for the trigger button.\n\t\t */\n\t\tref?: Ref<HTMLButtonElement>;\n\t\t/**\n\t\t * Event handler called when Select blurs.\n\t\t * @note this is a no-op for now until we can guarantee that it works identically to a native select onBlur\n\t\t */\n\t\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t} & Pick<ComponentProps<\"button\">, \"id\">;\n\nconst SelectContext = createContext<SelectContextType>({});\n\ntype SelectProps = PropsWithChildren & {\n\tautoComplete?: string;\n\tdefaultOpen?: boolean;\n\tdefaultValue?: string;\n\tdir?: \"ltr\" | \"rtl\";\n\tdisabled?: boolean;\n\tform?: string;\n\tid?: string;\n\tname?: string;\n\t/**\n\t * Event handler called when Select blurs.\n\t * @note this is a no-op for now until we can guarantee that it works identically to a native select onBlur\n\t */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/**\n\t * Event handler called when the value changes.\n\t * @deprecated Use `onValueChange` instead.\n\t */\n\tonChange?: (value: string) => void;\n\tonOpenChange?(open: boolean): void;\n\tonValueChange?(value: string): void;\n\topen?: boolean;\n\trequired?: boolean;\n\tvalue?: string;\n} & WithValidation &\n\tWithAriaInvalid;\n\n/**\n * Displays a list of options for the user to pick from—triggered by a button.\n *\n * Use Select for a small, finite list of options (~2-15) where the user picks exactly one\n * and search/filtering is unnecessary. For larger lists or async/searchable data, use\n * Combobox. For picking multiple options, use MultiSelect.\n *\n * Pass `validation` here when the entire select has an explicit state. That\n * root state is forwarded to `Select.Trigger` and takes precedence over the\n * ambient `validation` from `Field.Item`. Note: rendered `Field.Errors` /\n * `Field.ErrorList` set `aria-invalid=\"true\"` on the trigger via\n * `Field.Control`'s wiring, which still forces the trigger into the error\n * state — suppress the inferred error by passing `validation` on `Field.Item`\n * if a non-error `Select.Root` state needs to win in that case.\n *\n * @see https://mantle.ngrok.com/components/select#selectroot\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Root = forwardRef<HTMLButtonElement, SelectProps>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tchildren,\n\t\t\tid,\n\t\t\tvalidation,\n\t\t\tonBlur,\n\t\t\tonValueChange,\n\t\t\tonChange,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst contextValue = useMemo(\n\t\t\t() => ({\n\t\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\t\tid,\n\t\t\t\tvalidation,\n\t\t\t\tonBlur,\n\t\t\t\tref,\n\t\t\t}),\n\t\t\t[_ariaInvalid, id, validation, onBlur, ref],\n\t\t);\n\t\treturn (\n\t\t\t<SelectPrimitive.Root\n\t\t\t\t{...props}\n\t\t\t\tonValueChange={(value) => {\n\t\t\t\t\tonChange?.(value);\n\t\t\t\t\tonValueChange?.(value);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<SelectContext.Provider value={contextValue}>{children}</SelectContext.Provider>\n\t\t\t</SelectPrimitive.Root>\n\t\t);\n\t},\n);\nRoot.displayName = \"Select\";\n\n/**\n * A group of related options within a select menu. Similar to an html `<optgroup>` element.\n * Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.\n *\n * @see https://mantle.ngrok.com/components/select#selectgroup\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Group = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Group>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Group>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Group\n\t\tref={ref}\n\t\tdata-slot=\"select-group\"\n\t\tclassName={cx(\"space-y-px\", className)}\n\t\t{...props}\n\t/>\n));\nGroup.displayName = \"SelectGroup\";\n\n/**\n * The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.\n *\n * @see https://mantle.ngrok.com/components/select#selectvalue\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Value = SelectPrimitive.Value;\nValue.displayName = \"SelectValue\";\n\ntype SelectTriggerProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &\n\tWithAriaInvalid &\n\tWithValidation;\n\n/**\n * The button that toggles the select. The Select.Content will position itself adjacent to the trigger.\n * When composing with `Field.Item`, wrap `Select.Root` in `Field.Control` —\n * the generated `id`, `name`, and `aria-invalid` flow onto `Select.Root` (so\n * the hidden form input gets the field name), and the trigger reads\n * `aria-describedby` / `aria-errormessage` from `FieldControlContext`.\n *\n * @see https://mantle.ngrok.com/components/select#selecttrigger\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Trigger = forwardRef<ComponentRef<typeof SelectPrimitive.Trigger>, SelectTriggerProps>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": ariaInValidProp,\n\t\t\tclassName,\n\t\t\tchildren,\n\t\t\tid: propId,\n\t\t\tvalidation: propValidation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useContext(SelectContext);\n\t\tconst fieldControl = useContext(FieldControlContext);\n\t\tconst fieldValidation = useFieldValidation();\n\t\tconst rawAriaInvalid = fieldControl\n\t\t\t? fieldControl[\"aria-invalid\"]\n\t\t\t: (ctx[\"aria-invalid\"] ?? ariaInValidProp);\n\t\t// Explicit Select props win over ambient Field validation. This lets\n\t\t// Field.Control override Field.Item while preserving Select.Root as the\n\t\t// highest-precedence select-level state.\n\t\tconst rawValidation = ctx.validation ?? propValidation ?? fieldValidation;\n\t\tconst { ariaInvalid, validation } = parseValidation({\n\t\t\t\"aria-invalid\": rawAriaInvalid,\n\t\t\tvalidation: rawValidation,\n\t\t});\n\t\tconst id = fieldControl ? fieldControl.id : (ctx.id ?? propId);\n\n\t\treturn (\n\t\t\t<SelectPrimitive.Trigger\n\t\t\t\tdata-slot=\"select-trigger\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"h-9 text-sm\",\n\t\t\t\t\t\"border-form bg-form text-strong font-sans placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left\",\n\t\t\t\t\t\"hover:border-neutral-400\",\n\t\t\t\t\t\"focus:outline-hidden focus:ring-4 aria-expanded:ring-4\",\n\t\t\t\t\t\"focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tid={id}\n\t\t\t\tref={composeRefs(ref, ctx.ref)}\n\t\t\t\t{...props}\n\t\t\t\t{...(fieldControl\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t\"aria-describedby\": fieldControl[\"aria-describedby\"],\n\t\t\t\t\t\t\t\"aria-errormessage\": fieldControl[\"aria-errormessage\"],\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined)}\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t<SelectPrimitive.Icon asChild>\n\t\t\t\t\t<Icon svg={<CaretDownIcon weight=\"bold\" />} className=\"size-4\" />\n\t\t\t\t</SelectPrimitive.Icon>\n\t\t\t</SelectPrimitive.Trigger>\n\t\t);\n\t},\n);\nTrigger.displayName = \"SelectTrigger\";\n\n/**\n * The button that scrolls the select content up.\n * @private\n */\nconst SelectScrollUpButton = forwardRef<\n\tComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.ScrollUpButton\n\t\tref={ref}\n\t\tclassName={cx(\"flex cursor-default items-center justify-center py-1\", className)}\n\t\t{...props}\n\t>\n\t\t<Icon svg={<CaretUpIcon weight=\"bold\" />} className=\"size-4\" />\n\t</SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = \"SelectScrollUpButton\";\n\n/**\n * The button that scrolls the select content down.\n * @private\n */\nconst SelectScrollDownButton = forwardRef<\n\tComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.ScrollDownButton\n\t\tref={ref}\n\t\tclassName={cx(\"flex cursor-default items-center justify-center py-1\", className)}\n\t\t{...props}\n\t>\n\t\t<Icon svg={<CaretDownIcon weight=\"bold\" />} className=\"size-4\" />\n\t</SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = \"SelectScrollDownButton\";\n\ntype SelectContentProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {\n\t/**\n\t * The width of the content. Defaults to the width of the trigger.\n\t * If set to \"content\", the content will use the intrinsic content width; it will be the width of the longest/widest item.\n\t * @default \"trigger\"\n\t */\n\twidth?: \"trigger\" | \"content\";\n};\n\n/**\n * The component that pops out when the select is open as a portal adjacent to the trigger button.\n * It contains a scrolling viewport of the select items.\n *\n * @see https://mantle.ngrok.com/components/select#selectcontent\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Content = forwardRef<ComponentRef<typeof SelectPrimitive.Content>, SelectContentProps>(\n\t({ className, children, position = \"popper\", width = \"trigger\", ...props }, ref) => (\n\t\t<SelectPrimitive.Portal>\n\t\t\t<SelectPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"select-content\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"border-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md\",\n\t\t\t\t\t\"bg-popover font-sans\",\n\t\t\t\t\tposition === \"popper\" &&\n\t\t\t\t\t\t\"data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-(--radix-select-content-available-height)\",\n\t\t\t\t\twidth === \"trigger\" && \"w-(--radix-select-trigger-width)\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tposition={position}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<SelectScrollUpButton />\n\t\t\t\t<SelectPrimitive.Viewport\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"p-1 space-y-px\",\n\t\t\t\t\t\tposition === \"popper\" && \"h-(--radix-select-trigger-height) w-full\",\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SelectPrimitive.Viewport>\n\t\t\t\t<SelectScrollDownButton />\n\t\t\t</SelectPrimitive.Content>\n\t\t</SelectPrimitive.Portal>\n\t),\n);\nContent.displayName = \"SelectContent\";\n\n/**\n * Used to render the label of a group. It won't be focusable using arrow keys.\n *\n * @see https://mantle.ngrok.com/components/select#selectlabel\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Label = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Label>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Label\n\t\tref={ref}\n\t\tdata-slot=\"select-label\"\n\t\tclassName={cx(\"px-2 py-1.5 text-sm font-medium\", className)}\n\t\t{...props}\n\t/>\n));\nLabel.displayName = \"SelectLabel\";\n\ntype SelectItemProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n\ticon?: ReactNode;\n};\n\n/**\n * An option within a select menu. Similar to an html `<option>` element.\n * Has a required `value` prop that will be passed to the `onChange` handler of the `Select` component when this item is selected.\n * Displays the children as the option's text.\n *\n * @see https://mantle.ngrok.com/components/select#selectitem\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Item = forwardRef<ComponentRef<typeof SelectPrimitive.Item>, SelectItemProps>(\n\t({ className, children, icon, ...props }, ref) => (\n\t\t<SelectPrimitive.Item\n\t\t\tref={ref}\n\t\t\tdata-slot=\"select-item\"\n\t\t\tclassName={cx(\n\t\t\t\t\"relative flex gap-2 w-full cursor-pointer select-none items-center rounded-md py-1.5 pl-2 pr-8 text-strong text-sm outline-hidden\",\n\t\t\t\t\"focus:bg-active-menu-item\",\n\t\t\t\t\"data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\t\"data-state-checked:bg-selected-menu-item\",\n\t\t\t\t\"focus:data-state-checked:bg-active-selected-menu-item\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{icon && <Icon svg={icon} />}\n\t\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t\t<SelectPrimitive.ItemIndicator className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<Icon svg={<CheckIcon weight=\"bold\" />} className=\"size-4 text-accent-600\" />\n\t\t\t</SelectPrimitive.ItemIndicator>\n\t\t</SelectPrimitive.Item>\n\t),\n);\nItem.displayName = \"SelectItem\";\n\n/**\n * Used to visually separate items or groups of items in the select content.\n *\n * @see https://mantle.ngrok.com/components/select#selectseparator\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst SelectSeparatorComponent = forwardRef<\n\tComponentRef<typeof Separator>,\n\tComponentPropsWithoutRef<typeof Separator>\n>(({ className, ...props }, ref) => (\n\t<Separator\n\t\tref={ref}\n\t\tdata-slot=\"select-separator\"\n\t\tclassName={cx(\"-mx-1 my-1 h-px w-auto\", className)}\n\t\t{...props}\n\t/>\n));\nSelectSeparatorComponent.displayName = \"SelectSeparator\";\n\n/**\n * Displays a list of options for the user to pick from—triggered by a button.\n *\n * Use Select for a small, finite list of options (~2-15) where the user picks exactly one\n * and search/filtering is unnecessary. For larger lists or async/searchable data, use\n * Combobox. For picking multiple options, use MultiSelect.\n *\n * @see https://mantle.ngrok.com/components/select\n *\n * @example\n * Composition:\n * ```\n * Select.Root\n * ├── Select.Trigger\n * │ └── Select.Value\n * └── Select.Content\n * ├── Select.Group\n * │ ├── Select.Label\n * │ └── Select.Item\n * └── Select.Separator\n * ```\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Select = {\n\t/**\n\t * Displays a list of options for the user to pick from—triggered by a button.\n\t *\n\t * Use Select for a small, finite list of options (~2-15) where the user picks exactly one\n\t * and search/filtering is unnecessary. For larger lists or async/searchable data, use\n\t * Combobox. For picking multiple options, use MultiSelect.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectroot\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The component that pops out when the select is open as a portal adjacent to the trigger button.\n\t * It contains a scrolling viewport of the select items.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectcontent\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tContent,\n\t/**\n\t * A group of related options within a select menu. Similar to an html `<optgroup>` element.\n\t * Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectgroup\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tGroup,\n\t/**\n\t * An option within a select menu. Similar to an html `<option>` element.\n\t * Has a required `value` prop that will be passed to the `onChange` handler of the `Select` component when this item is selected.\n\t * Displays the children as the option's text.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectitem\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tItem,\n\t/**\n\t * Used to render the label of a group. It won't be focusable using arrow keys.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectlabel\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tLabel,\n\t/**\n\t * Used to visually separate items or groups of items in the select content.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectseparator\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tSeparator: SelectSeparatorComponent,\n\t/**\n\t * The button that toggles the select. The Select.Content will position itself adjacent to the trigger.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selecttrigger\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tTrigger,\n\t/**\n\t * The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectvalue\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tValue,\n} as const;\n\nexport {\n\t//,\n\tSelect,\n};\n"],"mappings":"wmBAuCA,MAAM,EAAgB,EAAiC,CAAC,CAAC,EAqEnD,EAAO,GAEX,CACC,eAAgB,EAChB,WACA,KACA,aACA,SACA,gBACA,WACA,GAAG,GAEJ,IACI,CACJ,IAAM,EAAe,OACb,CACN,eAAgB,EAChB,KACA,aACA,SACA,KACD,GACA,CAAC,EAAc,EAAI,EAAY,EAAQ,CAAG,CAC3C,EACA,OACC,EAAC,EAAgB,KAAjB,CACC,GAAI,EACJ,cAAgB,GAAU,CACzB,IAAW,CAAK,EAChB,IAAgB,CAAK,CACtB,WAEA,EAAC,EAAc,SAAf,CAAwB,MAAO,EAAe,UAAiC,CAAA,CAC1D,CAAA,CAExB,CACD,EACA,EAAK,YAAc,SA+BnB,MAAM,EAAQ,GAGX,CAAE,YAAW,GAAG,GAAS,IAC3B,EAAC,EAAgB,MAAjB,CACM,MACL,YAAU,eACV,UAAW,EAAG,aAAc,CAAS,EACrC,GAAI,CACJ,CAAA,CACD,EACD,EAAM,YAAc,cA8BpB,MAAM,EAAQ,EAAgB,MAC9B,EAAM,YAAc,cAsCpB,MAAM,EAAU,GAEd,CACC,eAAgB,EAChB,YACA,WACA,GAAI,EACJ,WAAY,EACZ,GAAG,GAEJ,IACI,CACJ,IAAM,EAAM,EAAW,CAAa,EAC9B,EAAe,EAAW,CAAmB,EAC7C,EAAkB,EAAmB,EAQrC,CAAE,cAAa,cAAe,EAAgB,CACnD,eARsB,EACpB,EAAa,gBACZ,EAAI,iBAAmB,EAO1B,WAHqB,EAAI,YAAc,GAAkB,CAI1D,CAAC,EAC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KACD,IAAU,WAAa,mCACvB,CACD,EACU,WACV,GAAI,WAZL,CAcC,EAAC,EAAD,CAAuB,CAAA,EACvB,EAAC,EAAgB,SAAjB,CACC,UAAW,EACV,iBACA,IAAa,UAAY,0CAC1B,EAEC,UACwB,CAAA,EAC1B,EAAC,EAAD,CAAyB,CAAA,CACD,GACF,CAAA,CAE1B,EACA,EAAQ,YAAc,gBA8BtB,MAAM,EAAQ,GAGX,CAAE,YAAW,GAAG,GAAS,IAC3B,EAAC,EAAgB,MAAjB,CACM,MACL,YAAU,eACV,UAAW,EAAG,kCAAmC,CAAS,EAC1D,GAAI,CACJ,CAAA,CACD,EACD,EAAM,YAAc,cAoCpB,MAAM,EAAO,GACX,CAAE,YAAW,WAAU,OAAM,GAAG,GAAS,IACzC,EAAC,EAAgB,KAAjB,CACM,MACL,YAAU,cACV,UAAW,EACV,oIACA,4BACA,6DACA,2CACA,wDACA,CACD,EACA,GAAI,WAXL,CAaE,GAAQ,EAAC,EAAD,CAAM,IAAK,CAAO,CAAA,EAC3B,EAAC,EAAgB,SAAjB,CAA2B,UAAmC,CAAA,EAC9D,EAAC,EAAgB,cAAjB,CAA+B,UAAU,yEACxC,EAAC,EAAD,CAAM,IAAK,EAAC,EAAD,CAAW,OAAO,MAAQ,CAAA,EAAG,UAAU,wBAA0B,CAAA,CAC9C,CAAA,CACV,GAExB,EACA,EAAK,YAAc,aA8BnB,MAAM,EAA2B,GAG9B,CAAE,YAAW,GAAG,GAAS,IAC3B,EAAC,EAAD,CACM,MACL,YAAU,mBACV,UAAW,EAAG,yBAA0B,CAAS,EACjD,GAAI,CACJ,CAAA,CACD,EACD,EAAyB,YAAc,kBA+CvC,MAAM,EAAS,CAiCd,OA8BA,UA8BA,QA+BA,OA6BA,QA6BA,UAAW,EA6BX,UA6BA,OACD"}
package/dist/select.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Select } from "./select-SZFFzYs0.js";
1
+ import { t as Select } from "./select-C15-XvRT.js";
2
2
  export { Select };
package/dist/select.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./select-B7orOUPj.js";export{e as Select};
1
+ import{t as e}from"./select-Cxc9VmP8.js";export{e as Select};
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./cx-CBSnSC36.js";import{t}from"./slot-CV5fmqFr.js";import{createContext as n,forwardRef as r,useContext as i}from"react";import{jsx as a}from"react/jsx-runtime";const o=[`horizontal`,`vertical`],s=n({}),c={orientation:`horizontal`},l=({className:n,children:r,asChild:i,...o})=>{let l=i?t:`div`;return a(s.Provider,{value:c,children:a(l,{"data-slot":`horizontal-separator-group`,"data-horizontal-separator-group":!0,className:e(`group flex items-center gap-2 [&_*:not([data-separator])]:shrink-0`,n),...o,children:r})})};l.displayName=`HorizontalSeparatorGroup`;const u=r(({asChild:n=!1,children:r,className:o,orientation:c,semantic:l=!1,...u},f)=>{let p=n?t:`div`,m=i(s).orientation??(d(c)?c:`horizontal`),h=l?{"aria-orientation":m===`vertical`?m:void 0,role:`separator`}:{role:`none`};return a(p,{"data-slot":`separator`,className:e(`separator`,`dark-high-contrast:bg-black high-contrast:bg-black bg-gray-500/20 dark:bg-gray-600/20`,m===`horizontal`?`h-px w-full group-data-horizontal-separator-group:flex-1`:`h-full w-px`,o),"data-orientation":m,"data-separator":!0,...h,ref:f,...n?{children:r}:{},...u})});u.displayName=`Separator`;function d(e){return typeof e==`string`&&o.includes(e)}export{u as n,l as t};
2
+ //# sourceMappingURL=separator-Bqjy77rG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separator-Bqjy77rG.js","names":[],"sources":["../src/components/separator/separator.tsx"],"sourcesContent":["import type { ComponentProps, ComponentRef, HTMLAttributes } from \"react\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Slot } from \"../slot/index.js\";\n\nconst orientations = [\"horizontal\", \"vertical\"] as const;\ntype Orientation = (typeof orientations)[number];\n\ntype SeparatorGroupContextShape = {\n\torientation?: Orientation;\n};\n\nconst SeparatorGroupContext = createContext<SeparatorGroupContextShape>({});\n\n// Module-level constant so the Provider value identity is stable across renders.\nconst horizontalSeparatorGroupContextValue: SeparatorGroupContextShape = {\n\torientation: \"horizontal\",\n};\n\n/**\n * A container to layout a group of horizontal separators and other children.\n * Overrides all children `Separator`s to be `orientation=\"horizontal\"`.\n *\n * @see https://mantle.ngrok.com/components/separator\n *\n * @example\n * ```tsx\n * <HorizontalSeparatorGroup>\n * <Separator />\n * <h3>ngrok mantle</h3>\n * <Separator />\n * </HorizontalSeparatorGroup>\n *\n * <HorizontalSeparatorGroup>\n * <h3>ngrok mantle</h3>\n * <Separator />\n * </HorizontalSeparatorGroup>\n *\n * <HorizontalSeparatorGroup>\n * <Separator />\n * <h3>ngrok mantle</h3>\n * </HorizontalSeparatorGroup>\n * ```\n */\nconst HorizontalSeparatorGroup = ({\n\tclassName,\n\tchildren,\n\tasChild,\n\t...props\n}: HTMLAttributes<HTMLDivElement> & WithAsChild) => {\n\tconst Comp = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<SeparatorGroupContext.Provider value={horizontalSeparatorGroupContextValue}>\n\t\t\t<Comp\n\t\t\t\tdata-slot=\"horizontal-separator-group\"\n\t\t\t\tdata-horizontal-separator-group\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"group flex items-center gap-2 [&_*:not([data-separator])]:shrink-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Comp>\n\t\t</SeparatorGroupContext.Provider>\n\t);\n};\nHorizontalSeparatorGroup.displayName = \"HorizontalSeparatorGroup\";\n\ntype SeparatorProps = ComponentProps<\"div\"> &\n\tWithAsChild & {\n\t\t/**\n\t\t * Either `horizontal` or `vertical`.\n\t\t *\n\t\t * @default \"horizontal\"\n\t\t */\n\t\torientation?: Orientation;\n\t\t/**\n\t\t * If `true`, the separator will be rendered with all accessibility-related attributes and role=\"separator\".\n\t\t * If `false`, the separator is purely decorative and all accessibility-related attributes\n\t\t * are updated so that that the rendered element is removed from the accessibility tree.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tsemantic?: boolean;\n\t};\n\n/**\n * Visually or semantically separates content.\n *\n * @see https://mantle.ngrok.com/components/separator\n *\n * @example\n * ```tsx\n * <Separator className=\"my-4\" />\n *\n * <Separator className=\"my-4\" semantic />\n *\n * <div className=\"flex h-5 items-center gap-4 text-sm\">\n * Blog\n * <Separator orientation=\"vertical\" />\n * Docs\n * <Separator orientation=\"vertical\" />\n * Source\n * </div>\n * ```\n */\nconst Separator = forwardRef<ComponentRef<\"div\">, SeparatorProps>(\n\t(\n\t\t{\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\torientation: propOrientation,\n\t\t\tsemantic = false,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\t\tconst ctx = useContext(SeparatorGroupContext);\n\t\t// Prefer the orientation from the context if it's set, else fallback to the prop and then to \"horizontal\".\n\t\tconst orientation =\n\t\t\tctx.orientation ?? (isOrientation(propOrientation) ? propOrientation : \"horizontal\");\n\t\t// `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical\n\t\tconst ariaOrientation = orientation === \"vertical\" ? orientation : undefined;\n\t\tconst semanticProps = semantic\n\t\t\t? { \"aria-orientation\": ariaOrientation, role: \"separator\" }\n\t\t\t: { role: \"none\" };\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tdata-slot=\"separator\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"separator\",\n\t\t\t\t\t\"dark-high-contrast:bg-black high-contrast:bg-black bg-gray-500/20 dark:bg-gray-600/20\",\n\t\t\t\t\torientation === \"horizontal\"\n\t\t\t\t\t\t? \"h-px w-full group-data-horizontal-separator-group:flex-1\"\n\t\t\t\t\t\t: \"h-full w-px\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\tdata-separator\n\t\t\t\t{...semanticProps}\n\t\t\t\tref={ref}\n\t\t\t\t{...(asChild ? { children } : {})} // only pass children if asChild is true\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nSeparator.displayName = \"Separator\";\n\nexport {\n\t//,\n\tHorizontalSeparatorGroup,\n\tSeparator,\n};\n\nfunction isOrientation(value: unknown): value is Orientation {\n\treturn typeof value === \"string\" && orientations.includes(value as Orientation);\n}\n"],"mappings":"qLAMA,MAAM,EAAe,CAAC,aAAc,UAAU,EAOxC,EAAwB,EAA0C,CAAC,CAAC,EAGpE,EAAmE,CACxE,YAAa,YACd,EA2BM,GAA4B,CACjC,YACA,WACA,UACA,GAAG,KACgD,CACnD,IAAM,EAAO,EAAU,EAAO,MAE9B,OACC,EAAC,EAAsB,SAAvB,CAAgC,MAAO,WACtC,EAAC,EAAD,CACC,YAAU,6BACV,kCAAA,GACA,UAAW,EACV,qEACA,CACD,EACA,GAAI,EAEH,UACI,CAAA,CACyB,CAAA,CAElC,EACA,EAAyB,YAAc,2BAwCvC,MAAM,EAAY,GAEhB,CACC,UAAU,GACV,WACA,YACA,YAAa,EACb,WAAW,GACX,GAAG,GAEJ,IACI,CACJ,IAAM,EAAY,EAAU,EAAO,MAG7B,EAFM,EAAW,CAGpB,EAAE,cAAgB,EAAc,CAAe,EAAI,EAAkB,cAGlE,EAAgB,EACnB,CAAE,mBAFmB,IAAgB,WAAa,EAAc,IAAA,GAEzB,KAAM,WAAY,EACzD,CAAE,KAAM,MAAO,EAElB,OACC,EAAC,EAAD,CACC,YAAU,YACV,UAAW,EACV,YACA,wFACA,IAAgB,aACb,2DACA,cACH,CACD,EACA,mBAAkB,EAClB,iBAAA,GACA,GAAI,EACC,MACL,GAAK,EAAU,CAAE,UAAS,EAAI,CAAC,EAC/B,GAAI,CACJ,CAAA,CAEH,CACD,EACA,EAAU,YAAc,YAQxB,SAAS,EAAc,EAAsC,CAC5D,OAAO,OAAO,GAAU,UAAY,EAAa,SAAS,CAAoB,CAC/E"}
@@ -1,7 +1,5 @@
1
- import { t as WithAsChild } from "./as-child-CpZKMqTE.js";
2
- import * as _$react from "react";
1
+ import { t as WithAsChild } from "./as-child-uN_018tj.js";
3
2
  import { ComponentProps, HTMLAttributes } from "react";
4
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
3
 
6
4
  //#region src/components/separator/separator.d.ts
7
5
  declare const orientations: readonly ["horizontal", "vertical"];
@@ -37,7 +35,7 @@ declare const HorizontalSeparatorGroup: {
37
35
  children,
38
36
  asChild,
39
37
  ...props
40
- }: HTMLAttributes<HTMLDivElement> & WithAsChild): _$react_jsx_runtime0.JSX.Element;
38
+ }: HTMLAttributes<HTMLDivElement> & WithAsChild): import("react/jsx-runtime").JSX.Element;
41
39
  displayName: string;
42
40
  };
43
41
  type SeparatorProps = ComponentProps<"div"> & WithAsChild & {
@@ -76,7 +74,7 @@ type SeparatorProps = ComponentProps<"div"> & WithAsChild & {
76
74
  * </div>
77
75
  * ```
78
76
  */
79
- declare const Separator: _$react.ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
77
+ declare const Separator: import("react").ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
80
78
  //#endregion
81
79
  export { HorizontalSeparatorGroup, Separator };
82
80
  //# sourceMappingURL=separator.d.ts.map
package/dist/separator.js CHANGED
@@ -1 +1 @@
1
- import{n as e,t}from"./separator-awchG4LI.js";export{t as HorizontalSeparatorGroup,e as Separator};
1
+ import{n as e,t}from"./separator-Bqjy77rG.js";export{t as HorizontalSeparatorGroup,e as Separator};