@burojs/ui-shadcn 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +26 -7
  2. package/dist/bulk-summary-CwSd6Yjb.cjs +108 -0
  3. package/dist/bulk-summary-CwSd6Yjb.cjs.map +1 -0
  4. package/dist/bulk-summary-GxMDP4bw.js +108 -0
  5. package/dist/bulk-summary-GxMDP4bw.js.map +1 -0
  6. package/dist/button-BxnnE28H.cjs +55 -0
  7. package/dist/button-BxnnE28H.cjs.map +1 -0
  8. package/dist/button-MWVeZaqj.js +44 -0
  9. package/dist/button-MWVeZaqj.js.map +1 -0
  10. package/dist/candidates-gate-CX2PBu6l.js +63 -0
  11. package/dist/candidates-gate-CX2PBu6l.js.map +1 -0
  12. package/dist/candidates-gate-DiFI52r7.cjs +70 -0
  13. package/dist/candidates-gate-DiFI52r7.cjs.map +1 -0
  14. package/dist/candidates-relation-picker-CBsVcnPR.js +82 -0
  15. package/dist/candidates-relation-picker-CBsVcnPR.js.map +1 -0
  16. package/dist/candidates-relation-picker-Dd_GVLlu.cjs +84 -0
  17. package/dist/candidates-relation-picker-Dd_GVLlu.cjs.map +1 -0
  18. package/dist/check-confirm-dialog-BRByTFpg.cjs +1534 -0
  19. package/dist/check-confirm-dialog-BRByTFpg.cjs.map +1 -0
  20. package/dist/check-confirm-dialog-CkaVTPT9.js +1232 -0
  21. package/dist/check-confirm-dialog-CkaVTPT9.js.map +1 -0
  22. package/dist/dialog-B_rt9S1c.js +63 -0
  23. package/dist/dialog-B_rt9S1c.js.map +1 -0
  24. package/dist/dialog-DRNUq9EA.cjs +112 -0
  25. package/dist/dialog-DRNUq9EA.cjs.map +1 -0
  26. package/dist/filter-builder-B3mZFL-K.cjs +1761 -0
  27. package/dist/filter-builder-B3mZFL-K.cjs.map +1 -0
  28. package/dist/filter-builder-DOnaXNfP.js +1605 -0
  29. package/dist/filter-builder-DOnaXNfP.js.map +1 -0
  30. package/dist/flow-runtime-B6zOHYqI.cjs +255 -0
  31. package/dist/flow-runtime-B6zOHYqI.cjs.map +1 -0
  32. package/dist/flow-runtime-D8h99FSg.js +252 -0
  33. package/dist/flow-runtime-D8h99FSg.js.map +1 -0
  34. package/dist/flow-screen-CX05b3G9.cjs +705 -0
  35. package/dist/flow-screen-CX05b3G9.cjs.map +1 -0
  36. package/dist/flow-screen-CmbARSqg.js +701 -0
  37. package/dist/flow-screen-CmbARSqg.js.map +1 -0
  38. package/dist/index.cjs +6453 -17494
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +3754 -3621
  41. package/dist/index.d.ts +3754 -3621
  42. package/dist/index.js +6217 -17219
  43. package/dist/index.js.map +1 -1
  44. package/dist/inline-flow-host-B7U1OJUe.cjs +112 -0
  45. package/dist/inline-flow-host-B7U1OJUe.cjs.map +1 -0
  46. package/dist/inline-flow-host-C3H2UpSA.js +112 -0
  47. package/dist/inline-flow-host-C3H2UpSA.js.map +1 -0
  48. package/dist/input-BI0czGyI.cjs +23 -0
  49. package/dist/input-BI0czGyI.cjs.map +1 -0
  50. package/dist/input-CUPStzZO.js +17 -0
  51. package/dist/input-CUPStzZO.js.map +1 -0
  52. package/dist/label-66W1qbke.js +29 -0
  53. package/dist/label-66W1qbke.js.map +1 -0
  54. package/dist/label-w6JYf2cF.cjs +36 -0
  55. package/dist/label-w6JYf2cF.cjs.map +1 -0
  56. package/dist/layout/theme-storage-key.cjs +5 -10
  57. package/dist/layout/theme-storage-key.cjs.map +1 -1
  58. package/dist/layout/theme-storage-key.d.cts +2 -23
  59. package/dist/layout/theme-storage-key.d.ts +2 -23
  60. package/dist/layout/theme-storage-key.js +5 -2
  61. package/dist/layout/theme-storage-key.js.map +1 -1
  62. package/dist/lazy-relation-picker-dialog-2oxnA6IR.js +14 -0
  63. package/dist/lazy-relation-picker-dialog-2oxnA6IR.js.map +1 -0
  64. package/dist/lazy-relation-picker-dialog-BfAGKzUG.cjs +19 -0
  65. package/dist/lazy-relation-picker-dialog-BfAGKzUG.cjs.map +1 -0
  66. package/dist/markdown/index.cjs +424 -511
  67. package/dist/markdown/index.cjs.map +1 -1
  68. package/dist/markdown/index.d.cts +1072 -34
  69. package/dist/markdown/index.d.ts +1072 -34
  70. package/dist/markdown/index.js +411 -459
  71. package/dist/markdown/index.js.map +1 -1
  72. package/dist/page-flow-route-CQ7HsbBm.cjs +277 -0
  73. package/dist/page-flow-route-CQ7HsbBm.cjs.map +1 -0
  74. package/dist/page-flow-route-CyXSvXSE.js +277 -0
  75. package/dist/page-flow-route-CyXSvXSE.js.map +1 -0
  76. package/dist/peek-filter-CnqHwTMU.cjs +51 -0
  77. package/dist/peek-filter-CnqHwTMU.cjs.map +1 -0
  78. package/dist/peek-filter-ErLfO153.js +28 -0
  79. package/dist/peek-filter-ErLfO153.js.map +1 -0
  80. package/dist/place-node--GdsP688.js +7315 -0
  81. package/dist/place-node--GdsP688.js.map +1 -0
  82. package/dist/place-node-SIp4XYQH.cjs +7833 -0
  83. package/dist/place-node-SIp4XYQH.cjs.map +1 -0
  84. package/dist/related-list-cards-B6x9HQQp.js +42 -0
  85. package/dist/related-list-cards-B6x9HQQp.js.map +1 -0
  86. package/dist/related-list-cards-nxuODlIA.cjs +42 -0
  87. package/dist/related-list-cards-nxuODlIA.cjs.map +1 -0
  88. package/dist/related-list-timeline-BYJKEbmA.cjs +142 -0
  89. package/dist/related-list-timeline-BYJKEbmA.cjs.map +1 -0
  90. package/dist/related-list-timeline-DEdfd-rr.js +142 -0
  91. package/dist/related-list-timeline-DEdfd-rr.js.map +1 -0
  92. package/dist/related-rows-B4levHcR.js +186 -0
  93. package/dist/related-rows-B4levHcR.js.map +1 -0
  94. package/dist/related-rows-zh5f_4QR.cjs +209 -0
  95. package/dist/related-rows-zh5f_4QR.cjs.map +1 -0
  96. package/dist/relation-create-BOaUe12G.cjs +362 -0
  97. package/dist/relation-create-BOaUe12G.cjs.map +1 -0
  98. package/dist/relation-create-Bg-eEJLs.js +337 -0
  99. package/dist/relation-create-Bg-eEJLs.js.map +1 -0
  100. package/dist/relation-many-picker-B-NCEUgX.cjs +465 -0
  101. package/dist/relation-many-picker-B-NCEUgX.cjs.map +1 -0
  102. package/dist/relation-many-picker-gdAOD-qK.js +464 -0
  103. package/dist/relation-many-picker-gdAOD-qK.js.map +1 -0
  104. package/dist/relation-picker-BAY77ivO.js +462 -0
  105. package/dist/relation-picker-BAY77ivO.js.map +1 -0
  106. package/dist/relation-picker-Da_uhFvA.cjs +479 -0
  107. package/dist/relation-picker-Da_uhFvA.cjs.map +1 -0
  108. package/dist/relation-picker-dialog-M0pQaWlp.cjs +300 -0
  109. package/dist/relation-picker-dialog-M0pQaWlp.cjs.map +1 -0
  110. package/dist/relation-picker-dialog-hA9rYrZB.js +299 -0
  111. package/dist/relation-picker-dialog-hA9rYrZB.js.map +1 -0
  112. package/dist/resource-page-router-OSQyRA5b.cjs +1779 -0
  113. package/dist/resource-page-router-OSQyRA5b.cjs.map +1 -0
  114. package/dist/resource-page-router-T4vS5gbJ.js +1582 -0
  115. package/dist/resource-page-router-T4vS5gbJ.js.map +1 -0
  116. package/dist/rich-text-DFerywgz.js +457 -0
  117. package/dist/rich-text-DFerywgz.js.map +1 -0
  118. package/dist/rich-text-vTyVjDoa.cjs +460 -0
  119. package/dist/rich-text-vTyVjDoa.cjs.map +1 -0
  120. package/dist/search-access-B7G5oR8n.cjs +812 -0
  121. package/dist/search-access-B7G5oR8n.cjs.map +1 -0
  122. package/dist/search-access-CURsWn-U.js +669 -0
  123. package/dist/search-access-CURsWn-U.js.map +1 -0
  124. package/dist/shell-BPlk8hEa.js +205 -0
  125. package/dist/shell-BPlk8hEa.js.map +1 -0
  126. package/dist/shell-DxhlsPwm.cjs +271 -0
  127. package/dist/shell-DxhlsPwm.cjs.map +1 -0
  128. package/dist/skeleton-U2noefj5.js +13 -0
  129. package/dist/skeleton-U2noefj5.js.map +1 -0
  130. package/dist/skeleton-_1gP7wan.cjs +18 -0
  131. package/dist/skeleton-_1gP7wan.cjs.map +1 -0
  132. package/dist/styles.css +255 -17
  133. package/dist/theme/theme-css.cjs +95 -96
  134. package/dist/theme/theme-css.cjs.map +1 -1
  135. package/dist/theme/theme-css.d.cts +10 -8
  136. package/dist/theme/theme-css.d.ts +10 -8
  137. package/dist/theme/theme-css.js +94 -94
  138. package/dist/theme/theme-css.js.map +1 -1
  139. package/dist/theme/theme-storage.cjs +34 -39
  140. package/dist/theme/theme-storage.cjs.map +1 -1
  141. package/dist/theme/theme-storage.d.cts +3 -1
  142. package/dist/theme/theme-storage.d.ts +3 -1
  143. package/dist/theme/theme-storage.js +33 -37
  144. package/dist/theme/theme-storage.js.map +1 -1
  145. package/dist/theme-storage-key-pYlp4aDS.d.cts +31 -0
  146. package/dist/theme-storage-key-pYlp4aDS.d.ts +31 -0
  147. package/dist/toaster-C7CiYA4Z.cjs +248 -0
  148. package/dist/toaster-C7CiYA4Z.cjs.map +1 -0
  149. package/dist/toaster-CfCRLgR-.js +164 -0
  150. package/dist/toaster-CfCRLgR-.js.map +1 -0
  151. package/dist/use-dialog-filter-state-BBCC0OEK.cjs +92 -0
  152. package/dist/use-dialog-filter-state-BBCC0OEK.cjs.map +1 -0
  153. package/dist/use-dialog-filter-state-BDcgS5Oz.js +87 -0
  154. package/dist/use-dialog-filter-state-BDcgS5Oz.js.map +1 -0
  155. package/dist/use-theme-DFlpXils.cjs +257 -0
  156. package/dist/use-theme-DFlpXils.cjs.map +1 -0
  157. package/dist/use-theme-dnE3Od3I.js +175 -0
  158. package/dist/use-theme-dnE3Od3I.js.map +1 -0
  159. package/package.json +18 -17
  160. package/dist/chunk-ABUQPOOE.js +0 -11
  161. package/dist/chunk-ABUQPOOE.js.map +0 -1
  162. package/dist/chunk-DBGGWBFG.cjs +0 -199
  163. package/dist/chunk-DBGGWBFG.cjs.map +0 -1
  164. package/dist/chunk-FMX4GLCQ.js +0 -6
  165. package/dist/chunk-FMX4GLCQ.js.map +0 -1
  166. package/dist/chunk-UC57Z243.js +0 -143
  167. package/dist/chunk-UC57Z243.js.map +0 -1
  168. package/dist/chunk-UPGPO75B.js +0 -164
  169. package/dist/chunk-UPGPO75B.js.map +0 -1
  170. package/dist/chunk-VXJAXJ3U.cjs +0 -8
  171. package/dist/chunk-VXJAXJ3U.cjs.map +0 -1
  172. package/dist/chunk-W7AEYE7A.cjs +0 -13
  173. package/dist/chunk-W7AEYE7A.cjs.map +0 -1
  174. package/dist/chunk-YF5IW525.cjs +0 -155
  175. package/dist/chunk-YF5IW525.cjs.map +0 -1
  176. package/dist/rich-text-6V7WZ3WV.cjs +0 -518
  177. package/dist/rich-text-6V7WZ3WV.cjs.map +0 -1
  178. package/dist/rich-text-N2FZEJJV.js +0 -491
  179. package/dist/rich-text-N2FZEJJV.js.map +0 -1
@@ -1,550 +1,463 @@
1
- 'use strict';
2
-
3
- var chunkYF5IW525_cjs = require('../chunk-YF5IW525.cjs');
4
- require('../chunk-VXJAXJ3U.cjs');
5
- var chunkW7AEYE7A_cjs = require('../chunk-W7AEYE7A.cjs');
6
- var Markdown = require('react-markdown');
7
- var rehypeSanitize = require('rehype-sanitize');
8
- var rehypeSlug = require('rehype-slug');
9
- var remarkDirective = require('remark-directive');
10
- var remarkGfm = require('remark-gfm');
11
- var react = require('@burojs/react');
12
- var iconsReact = require('@tabler/icons-react');
13
- var react$1 = require('react');
14
- var jsxRuntime = require('react/jsx-runtime');
15
- var unistUtilVisit = require('unist-util-visit');
16
- var AccordionPrimitive = require('@radix-ui/react-accordion');
17
-
18
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
19
-
20
- function _interopNamespace(e) {
21
- if (e && e.__esModule) return e;
22
- var n = Object.create(null);
23
- if (e) {
24
- Object.keys(e).forEach(function (k) {
25
- if (k !== 'default') {
26
- var d = Object.getOwnPropertyDescriptor(e, k);
27
- Object.defineProperty(n, k, d.get ? d : {
28
- enumerable: true,
29
- get: function () { return e[k]; }
30
- });
31
- }
32
- });
33
- }
34
- n.default = e;
35
- return Object.freeze(n);
36
- }
37
-
38
- var Markdown__default = /*#__PURE__*/_interopDefault(Markdown);
39
- var rehypeSanitize__default = /*#__PURE__*/_interopDefault(rehypeSanitize);
40
- var rehypeSlug__default = /*#__PURE__*/_interopDefault(rehypeSlug);
41
- var remarkDirective__default = /*#__PURE__*/_interopDefault(remarkDirective);
42
- var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
43
- var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
44
-
45
- function DocAnchorLink({
46
- slug,
47
- stopPropagation,
48
- className
49
- }) {
50
- const t = react.useOptionalT();
51
- const [copied, setCopied] = react$1.useState(false);
52
- const timer = react$1.useRef(null);
53
- react$1.useEffect(
54
- () => () => {
55
- if (timer.current) clearTimeout(timer.current);
56
- },
57
- []
58
- );
59
- const onClick = react$1.useCallback(
60
- (event) => {
61
- if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
62
- if (stopPropagation) event.stopPropagation();
63
- void navigator.clipboard?.writeText(chunkYF5IW525_cjs.docShareUrl(slug)).then(() => {
64
- setCopied(true);
65
- if (timer.current) clearTimeout(timer.current);
66
- timer.current = setTimeout(() => setCopied(false), 1600);
67
- }).catch(() => {
68
- });
69
- },
70
- [slug, stopPropagation]
71
- );
72
- const label = copied ? t("docPanel.linkCopied", { defaultValue: "Link copied" }) : t("docPanel.copyLink", { defaultValue: "Copy link to this section" });
73
- return /* @__PURE__ */ jsxRuntime.jsxs(
74
- "a",
75
- {
76
- href: `#${slug}`,
77
- onClick,
78
- title: label,
79
- "aria-label": label,
80
- "data-testid": `doc-anchor:${slug}`,
81
- "data-copied": copied ? "true" : void 0,
82
- className: chunkW7AEYE7A_cjs.cn(
83
- "ml-2 inline-flex shrink-0 items-center rounded-sm p-0.5 align-middle no-underline",
84
- "text-muted-foreground transition-opacity hover:text-foreground",
85
- // Hidden until the reader is at this heading — a permanent « # » beside
86
- // every heading reads as scaffolding. `focus-visible` keeps it
87
- // reachable by keyboard, where there is no hover to reveal it.
88
- "opacity-0 group-hover/anchor:opacity-100 focus-visible:opacity-100",
89
- "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
90
- copied && "text-primary opacity-100",
91
- className
92
- ),
93
- children: [
94
- copied ? /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconCheck, { className: "size-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconLink, { className: "size-3.5", "aria-hidden": "true" }),
95
- /* @__PURE__ */ jsxRuntime.jsx("span", { role: "status", className: "sr-only", children: copied ? t("docPanel.linkCopied", { defaultValue: "Link copied" }) : "" })
96
- ]
97
- }
98
- );
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_use_theme = require("../use-theme-DFlpXils.cjs");
4
+ let _burojs_react = require("@burojs/react");
5
+ let _tabler_icons_react = require("@tabler/icons-react");
6
+ let react = require("react");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ let react_markdown = require("react-markdown");
9
+ react_markdown = require_use_theme.__toESM(react_markdown, 1);
10
+ let rehype_sanitize = require("rehype-sanitize");
11
+ rehype_sanitize = require_use_theme.__toESM(rehype_sanitize, 1);
12
+ let rehype_slug = require("rehype-slug");
13
+ rehype_slug = require_use_theme.__toESM(rehype_slug, 1);
14
+ let remark_directive = require("remark-directive");
15
+ remark_directive = require_use_theme.__toESM(remark_directive, 1);
16
+ let remark_gfm = require("remark-gfm");
17
+ remark_gfm = require_use_theme.__toESM(remark_gfm, 1);
18
+ let unist_util_visit = require("unist-util-visit");
19
+ let _radix_ui_react_accordion = require("@radix-ui/react-accordion");
20
+ _radix_ui_react_accordion = require_use_theme.__toESM(_radix_ui_react_accordion, 1);
21
+ //#region src/markdown/anchor-link.tsx
22
+ function DocAnchorLink({ slug, stopPropagation, className }) {
23
+ const t = (0, _burojs_react.useOptionalT)();
24
+ const [copied, setCopied] = (0, react.useState)(false);
25
+ const timer = (0, react.useRef)(null);
26
+ (0, react.useEffect)(() => () => {
27
+ if (timer.current) clearTimeout(timer.current);
28
+ }, []);
29
+ const onClick = (0, react.useCallback)((event) => {
30
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
31
+ if (stopPropagation) event.stopPropagation();
32
+ navigator.clipboard?.writeText(require_use_theme.docShareUrl(slug)).then(() => {
33
+ setCopied(true);
34
+ if (timer.current) clearTimeout(timer.current);
35
+ timer.current = setTimeout(() => setCopied(false), 1600);
36
+ }).catch(() => {});
37
+ }, [slug, stopPropagation]);
38
+ const label = copied ? t("docPanel.linkCopied", { defaultValue: "Link copied" }) : t("docPanel.copyLink", { defaultValue: "Copy link to this section" });
39
+ return (0, react_jsx_runtime.jsxs)("a", {
40
+ href: `#${slug}`,
41
+ onClick,
42
+ title: label,
43
+ "aria-label": label,
44
+ "data-testid": `doc-anchor:${slug}`,
45
+ "data-copied": copied ? "true" : void 0,
46
+ className: require_use_theme.cn("ml-2 inline-flex shrink-0 items-center rounded-sm p-0.5 align-middle no-underline", "text-muted-foreground transition-opacity hover:text-foreground", "opacity-0 group-hover/anchor:opacity-100 focus-visible:opacity-100", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring", copied && "text-primary opacity-100", className),
47
+ children: [copied ? (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconCheck, {
48
+ className: "size-3.5",
49
+ "aria-hidden": "true"
50
+ }) : (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconLink, {
51
+ className: "size-3.5",
52
+ "aria-hidden": "true"
53
+ }), (0, react_jsx_runtime.jsx)("span", {
54
+ role: "status",
55
+ className: "sr-only",
56
+ children: copied ? t("docPanel.linkCopied", { defaultValue: "Link copied" }) : ""
57
+ })]
58
+ });
99
59
  }
100
-
101
- // src/lib/css-color.ts
102
- var OKLCH = /^oklch\(\s*([^\s/]+)\s+([^\s/]+)\s+([^\s/]+)\s*(?:\/\s*([^\s/]+)\s*)?\)$/i;
103
- var KHROMA_SAFE = /^(#|rgba?\(|hsla?\(|[a-z]+$)/i;
60
+ //#endregion
61
+ //#region src/lib/css-color.ts
62
+ const OKLCH = /^oklch\(\s*([^\s/]+)\s+([^\s/]+)\s+([^\s/]+)\s*(?:\/\s*([^\s/]+)\s*)?\)$/i;
63
+ const KHROMA_SAFE = /^(#|rgba?\(|hsla?\(|[a-z]+$)/i;
104
64
  function component(raw, pct) {
105
- if (raw.toLowerCase() === "none") return 0;
106
- const percent = raw.endsWith("%");
107
- const n = Number.parseFloat(percent ? raw.slice(0, -1) : raw);
108
- if (!Number.isFinite(n)) return null;
109
- return percent ? n / 100 * pct : n;
65
+ if (raw.toLowerCase() === "none") return 0;
66
+ const percent = raw.endsWith("%");
67
+ const n = Number.parseFloat(percent ? raw.slice(0, -1) : raw);
68
+ if (!Number.isFinite(n)) return null;
69
+ return percent ? n / 100 * pct : n;
110
70
  }
111
71
  function hueDegrees(raw) {
112
- if (raw.toLowerCase() === "none") return 0;
113
- const match = /^(-?[\d.]+)(deg|rad|grad|turn)?$/i.exec(raw);
114
- if (match === null) return null;
115
- const n = Number.parseFloat(match[1]);
116
- if (!Number.isFinite(n)) return null;
117
- switch ((match[2] ?? "deg").toLowerCase()) {
118
- case "rad":
119
- return n * 180 / Math.PI;
120
- case "grad":
121
- return n * 0.9;
122
- case "turn":
123
- return n * 360;
124
- default:
125
- return n;
126
- }
72
+ if (raw.toLowerCase() === "none") return 0;
73
+ const match = /^(-?[\d.]+)(deg|rad|grad|turn)?$/i.exec(raw);
74
+ if (match === null) return null;
75
+ const n = Number.parseFloat(match[1]);
76
+ if (!Number.isFinite(n)) return null;
77
+ switch ((match[2] ?? "deg").toLowerCase()) {
78
+ case "rad": return n * 180 / Math.PI;
79
+ case "grad": return n * .9;
80
+ case "turn": return n * 360;
81
+ default: return n;
82
+ }
127
83
  }
128
84
  function encode(channel) {
129
- const v = channel <= 31308e-7 ? 12.92 * channel : 1.055 * channel ** (1 / 2.4) - 0.055;
130
- return Math.round(Math.min(1, Math.max(0, v)) * 255);
85
+ const v = channel <= .0031308 ? 12.92 * channel : 1.055 * channel ** (1 / 2.4) - .055;
86
+ return Math.round(Math.min(1, Math.max(0, v)) * 255);
131
87
  }
132
88
  function hex2(value) {
133
- return value.toString(16).padStart(2, "0");
89
+ return value.toString(16).padStart(2, "0");
134
90
  }
135
91
  function oklchToHex(value) {
136
- const match = OKLCH.exec(value.trim());
137
- if (match === null) return null;
138
- const L = component(match[1], 1);
139
- const C = component(match[2], 0.4);
140
- const H = hueDegrees(match[3]);
141
- const A = match[4] === void 0 ? 1 : component(match[4], 1);
142
- if (L === null || C === null || H === null || A === null) return null;
143
- const rad = H * Math.PI / 180;
144
- const a = C * Math.cos(rad);
145
- const b = C * Math.sin(rad);
146
- const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;
147
- const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;
148
- const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;
149
- const r = encode(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s);
150
- const g = encode(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s);
151
- const bl = encode(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s);
152
- const alpha = Math.min(1, Math.max(0, A));
153
- const suffix = alpha === 1 ? "" : hex2(Math.round(alpha * 255));
154
- return `#${hex2(r)}${hex2(g)}${hex2(bl)}${suffix}`;
92
+ const match = OKLCH.exec(value.trim());
93
+ if (match === null) return null;
94
+ const L = component(match[1], 1);
95
+ const C = component(match[2], .4);
96
+ const H = hueDegrees(match[3]);
97
+ const A = match[4] === void 0 ? 1 : component(match[4], 1);
98
+ if (L === null || C === null || H === null || A === null) return null;
99
+ const rad = H * Math.PI / 180;
100
+ const a = C * Math.cos(rad);
101
+ const b = C * Math.sin(rad);
102
+ const l = (L + .3963377774 * a + .2158037573 * b) ** 3;
103
+ const m = (L - .1055613458 * a - .0638541728 * b) ** 3;
104
+ const s = (L - .0894841775 * a - 1.291485548 * b) ** 3;
105
+ const r = encode(4.0767416621 * l - 3.3077115913 * m + .2309699292 * s);
106
+ const g = encode(-1.2684380046 * l + 2.6097574011 * m - .3413193965 * s);
107
+ const bl = encode(-.0041960863 * l - .7034186147 * m + 1.707614701 * s);
108
+ const alpha = Math.min(1, Math.max(0, A));
109
+ const suffix = alpha === 1 ? "" : hex2(Math.round(alpha * 255));
110
+ return `#${hex2(r)}${hex2(g)}${hex2(bl)}${suffix}`;
155
111
  }
156
112
  function toLegacyColor(value) {
157
- const trimmed = value.trim();
158
- if (trimmed === "") return null;
159
- if (KHROMA_SAFE.test(trimmed)) return trimmed;
160
- return oklchToHex(trimmed);
113
+ const trimmed = value.trim();
114
+ if (trimmed === "") return null;
115
+ if (KHROMA_SAFE.test(trimmed)) return trimmed;
116
+ return oklchToHex(trimmed);
161
117
  }
118
+ //#endregion
119
+ //#region src/markdown/mermaid.tsx
162
120
  function cssVar(styles, name, fallback) {
163
- return toLegacyColor(styles.getPropertyValue(name)) ?? fallback;
121
+ return toLegacyColor(styles.getPropertyValue(name)) ?? fallback;
164
122
  }
165
- var seq = 0;
123
+ let seq = 0;
166
124
  function MermaidDiagram({ code, className }) {
167
- const [svg, setSvg] = react$1.useState(null);
168
- const [failed, setFailed] = react$1.useState(null);
169
- const { resolved: theme } = chunkYF5IW525_cjs.useTheme();
170
- const idRef = react$1.useRef(null);
171
- idRef.current ??= `buro-mermaid-${seq += 1}`;
172
- react$1.useEffect(() => {
173
- let cancelled = false;
174
- void (async () => {
175
- try {
176
- const mermaid = (await import('mermaid')).default;
177
- const styles = getComputedStyle(document.documentElement);
178
- const dark = theme === "dark";
179
- mermaid.initialize({
180
- startOnLoad: false,
181
- securityLevel: "strict",
182
- fontFamily: "inherit",
183
- theme: "base",
184
- darkMode: dark,
185
- themeVariables: {
186
- background: cssVar(styles, "--background", dark ? "#0b0b0c" : "#ffffff"),
187
- primaryColor: cssVar(styles, "--muted", dark ? "#1c1c1f" : "#f4f4f5"),
188
- primaryTextColor: cssVar(styles, "--foreground", dark ? "#fafafa" : "#09090b"),
189
- primaryBorderColor: cssVar(styles, "--border", dark ? "#27272a" : "#e4e4e7"),
190
- lineColor: cssVar(styles, "--muted-foreground", dark ? "#a1a1aa" : "#71717a"),
191
- secondaryColor: cssVar(styles, "--secondary", dark ? "#18181b" : "#f4f4f5"),
192
- tertiaryColor: cssVar(styles, "--accent", dark ? "#18181b" : "#fafafa"),
193
- fontSize: "13px"
194
- }
195
- });
196
- await mermaid.parse(code);
197
- const { svg: out } = await mermaid.render(idRef.current, code);
198
- if (!cancelled) {
199
- setSvg(out);
200
- setFailed(null);
201
- }
202
- } catch (error) {
203
- if (!cancelled) {
204
- setSvg(null);
205
- setFailed(error instanceof Error ? error.message : String(error));
206
- }
207
- }
208
- })();
209
- return () => {
210
- cancelled = true;
211
- };
212
- }, [code, theme]);
213
- if (failed !== null) {
214
- return /* @__PURE__ */ jsxRuntime.jsx(
215
- "pre",
216
- {
217
- className: chunkW7AEYE7A_cjs.cn("overflow-x-auto rounded-md border border-dashed p-3 text-xs", className),
218
- title: failed,
219
- "data-testid": "mermaid:failed",
220
- children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: code })
221
- }
222
- );
223
- }
224
- if (svg === null) {
225
- return /* @__PURE__ */ jsxRuntime.jsx(
226
- "div",
227
- {
228
- className: chunkW7AEYE7A_cjs.cn("h-24 animate-pulse rounded-md border bg-muted/40", className),
229
- "data-testid": "mermaid:loading",
230
- "aria-hidden": "true"
231
- }
232
- );
233
- }
234
- return /* @__PURE__ */ jsxRuntime.jsx(
235
- "figure",
236
- {
237
- className: chunkW7AEYE7A_cjs.cn(
238
- "not-prose my-4 overflow-x-auto rounded-md border bg-card/40 text-card-foreground p-4",
239
- // Mermaid emits an intrinsic width; letting it scale down keeps a wide
240
- // graph inside the column instead of pushing the article sideways.
241
- "[&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full",
242
- className
243
- ),
244
- "data-testid": "mermaid:diagram",
245
- dangerouslySetInnerHTML: { __html: svg }
246
- }
247
- );
125
+ const [svg, setSvg] = (0, react.useState)(null);
126
+ const [failed, setFailed] = (0, react.useState)(null);
127
+ const { resolved: theme } = require_use_theme.useTheme();
128
+ const idRef = (0, react.useRef)(null);
129
+ idRef.current ??= `buro-mermaid-${seq += 1}`;
130
+ (0, react.useEffect)(() => {
131
+ let cancelled = false;
132
+ (async () => {
133
+ try {
134
+ const mermaid = (await import("mermaid")).default;
135
+ const styles = getComputedStyle(document.documentElement);
136
+ const dark = theme === "dark";
137
+ mermaid.initialize({
138
+ startOnLoad: false,
139
+ securityLevel: "strict",
140
+ fontFamily: "inherit",
141
+ theme: "base",
142
+ darkMode: dark,
143
+ themeVariables: {
144
+ background: cssVar(styles, "--background", dark ? "#0b0b0c" : "#ffffff"),
145
+ primaryColor: cssVar(styles, "--muted", dark ? "#1c1c1f" : "#f4f4f5"),
146
+ primaryTextColor: cssVar(styles, "--foreground", dark ? "#fafafa" : "#09090b"),
147
+ primaryBorderColor: cssVar(styles, "--border", dark ? "#27272a" : "#e4e4e7"),
148
+ lineColor: cssVar(styles, "--muted-foreground", dark ? "#a1a1aa" : "#71717a"),
149
+ secondaryColor: cssVar(styles, "--secondary", dark ? "#18181b" : "#f4f4f5"),
150
+ tertiaryColor: cssVar(styles, "--accent", dark ? "#18181b" : "#fafafa"),
151
+ fontSize: "13px"
152
+ }
153
+ });
154
+ await mermaid.parse(code);
155
+ const { svg: out } = await mermaid.render(idRef.current, code);
156
+ if (!cancelled) {
157
+ setSvg(out);
158
+ setFailed(null);
159
+ }
160
+ } catch (error) {
161
+ if (!cancelled) {
162
+ setSvg(null);
163
+ setFailed(error instanceof Error ? error.message : String(error));
164
+ }
165
+ }
166
+ })();
167
+ return () => {
168
+ cancelled = true;
169
+ };
170
+ }, [code, theme]);
171
+ if (failed !== null) return (0, react_jsx_runtime.jsx)("pre", {
172
+ className: require_use_theme.cn("overflow-x-auto rounded-md border border-dashed p-3 text-xs", className),
173
+ title: failed,
174
+ "data-testid": "mermaid:failed",
175
+ children: (0, react_jsx_runtime.jsx)("code", { children: code })
176
+ });
177
+ if (svg === null) return (0, react_jsx_runtime.jsx)("div", {
178
+ className: require_use_theme.cn("h-24 animate-pulse rounded-md border bg-muted/40", className),
179
+ "data-testid": "mermaid:loading",
180
+ "aria-hidden": "true"
181
+ });
182
+ return (0, react_jsx_runtime.jsx)("figure", {
183
+ className: require_use_theme.cn("not-prose my-4 overflow-x-auto rounded-md border bg-card/40 text-card-foreground p-4", "[&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full", className),
184
+ "data-testid": "mermaid:diagram",
185
+ dangerouslySetInnerHTML: { __html: svg }
186
+ });
248
187
  }
249
- var VIDEO_ATTRIBUTES = [
250
- "src",
251
- "poster",
252
- "controls",
253
- "loop",
254
- "muted",
255
- "autoPlay",
256
- "playsInline",
257
- "preload",
258
- "width",
259
- "height"
188
+ //#endregion
189
+ //#region src/markdown/sanitize-schema.ts
190
+ const VIDEO_ATTRIBUTES = [
191
+ "src",
192
+ "poster",
193
+ "controls",
194
+ "loop",
195
+ "muted",
196
+ "autoPlay",
197
+ "playsInline",
198
+ "preload",
199
+ "width",
200
+ "height"
260
201
  ];
261
- var docSanitizeSchema = {
262
- ...rehypeSanitize.defaultSchema,
263
- // `source` and `picture` are ALREADY in defaultSchema — appending them would
264
- // be a harmless duplicate, but it would also be a sign the list was never
265
- // actually read.
266
- tagNames: [...rehypeSanitize.defaultSchema.tagNames ?? [], "video"],
267
- attributes: {
268
- ...rehypeSanitize.defaultSchema.attributes,
269
- video: [...VIDEO_ATTRIBUTES],
270
- // defaultSchema.attributes.source is ['srcSet']. Replacing it outright
271
- // would silently break <picture>, which the default explicitly supports.
272
- source: [...rehypeSanitize.defaultSchema.attributes?.source ?? [], "src", "type"],
273
- // `loading` is in neither `img` nor the `*` bucket, so lazy images need it
274
- // allowed explicitly or the attribute is stripped and every image in a
275
- // long article loads at once.
276
- img: [...rehypeSanitize.defaultSchema.attributes?.img ?? [], "loading"]
277
- }
202
+ const docSanitizeSchema = {
203
+ ...rehype_sanitize.defaultSchema,
204
+ tagNames: [...rehype_sanitize.defaultSchema.tagNames ?? [], "video"],
205
+ attributes: {
206
+ ...rehype_sanitize.defaultSchema.attributes,
207
+ video: [...VIDEO_ATTRIBUTES],
208
+ source: [
209
+ ...rehype_sanitize.defaultSchema.attributes?.source ?? [],
210
+ "src",
211
+ "type"
212
+ ],
213
+ img: [...rehype_sanitize.defaultSchema.attributes?.img ?? [], "loading"]
214
+ }
278
215
  };
279
- var ALLOWED = ["src", "poster", "width", "height"];
216
+ //#endregion
217
+ //#region src/markdown/video-directive.ts
218
+ const ALLOWED = [
219
+ "src",
220
+ "poster",
221
+ "width",
222
+ "height"
223
+ ];
280
224
  function remarkVideoDirective() {
281
- return (tree) => {
282
- unistUtilVisit.visit(tree, (node) => {
283
- const directive = node;
284
- if (directive.type !== "leafDirective" && directive.type !== "containerDirective" && directive.type !== "textDirective") {
285
- return;
286
- }
287
- if (directive.name !== "video") return;
288
- const attrs = directive.attributes ?? {};
289
- const props = {
290
- // Always on: a video the reader cannot pause is hostile, and an
291
- // article that autoplays sound is worse.
292
- controls: true,
293
- preload: "metadata"
294
- };
295
- for (const key of ALLOWED) {
296
- const value = attrs[key];
297
- if (typeof value === "string" && value.length > 0) props[key] = value;
298
- }
299
- if (typeof props.src !== "string") return;
300
- directive.data = { ...directive.data, hName: "video", hProperties: props };
301
- });
302
- };
225
+ return (tree) => {
226
+ (0, unist_util_visit.visit)(tree, (node) => {
227
+ const directive = node;
228
+ if (directive.type !== "leafDirective" && directive.type !== "containerDirective" && directive.type !== "textDirective") return;
229
+ if (directive.name !== "video") return;
230
+ const attrs = directive.attributes ?? {};
231
+ const props = {
232
+ controls: true,
233
+ preload: "metadata"
234
+ };
235
+ for (const key of ALLOWED) {
236
+ const value = attrs[key];
237
+ if (typeof value === "string" && value.length > 0) props[key] = value;
238
+ }
239
+ if (typeof props.src !== "string") return;
240
+ directive.data = {
241
+ ...directive.data,
242
+ hName: "video",
243
+ hProperties: props
244
+ };
245
+ });
246
+ };
303
247
  }
304
- var Accordion = AccordionPrimitive__namespace.Root;
305
- function AccordionItem({
306
- className,
307
- ...props
308
- }) {
309
- return /* @__PURE__ */ jsxRuntime.jsx(
310
- AccordionPrimitive__namespace.Item,
311
- {
312
- className: chunkW7AEYE7A_cjs.cn("border-b border-border/60 last:border-b-0", className),
313
- ...props
314
- }
315
- );
248
+ //#endregion
249
+ //#region src/primitives/accordion.tsx
250
+ const Accordion = _radix_ui_react_accordion.Root;
251
+ function AccordionItem({ className, ...props }) {
252
+ return (0, react_jsx_runtime.jsx)(_radix_ui_react_accordion.Item, {
253
+ className: require_use_theme.cn("border-b border-border/60 last:border-b-0", className),
254
+ ...props
255
+ });
316
256
  }
317
- function AccordionTrigger({
318
- className,
319
- children,
320
- ...props
321
- }) {
322
- return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
323
- AccordionPrimitive__namespace.Trigger,
324
- {
325
- className: chunkW7AEYE7A_cjs.cn(
326
- "flex flex-1 items-start justify-between gap-3 py-3 text-left",
327
- "text-[0.9375rem] font-medium leading-snug transition-colors",
328
- "hover:text-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
329
- "rounded-sm [&[data-state=open]>svg]:rotate-180",
330
- className
331
- ),
332
- ...props,
333
- children: [
334
- children,
335
- /* @__PURE__ */ jsxRuntime.jsx(
336
- iconsReact.IconChevronDown,
337
- {
338
- className: "mt-0.5 size-4 shrink-0 text-muted-foreground transition-transform duration-200",
339
- "aria-hidden": "true"
340
- }
341
- )
342
- ]
343
- }
344
- ) });
257
+ function AccordionTrigger({ className, children, ...props }) {
258
+ return (0, react_jsx_runtime.jsx)(_radix_ui_react_accordion.Header, {
259
+ className: "flex",
260
+ children: (0, react_jsx_runtime.jsxs)(_radix_ui_react_accordion.Trigger, {
261
+ className: require_use_theme.cn("flex flex-1 items-start justify-between gap-3 py-3 text-left", "text-[0.9375rem] font-medium leading-snug transition-colors", "hover:text-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring", "rounded-sm [&[data-state=open]>svg]:rotate-180", className),
262
+ ...props,
263
+ children: [children, (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconChevronDown, {
264
+ className: "mt-0.5 size-4 shrink-0 text-muted-foreground transition-transform duration-200",
265
+ "aria-hidden": "true"
266
+ })]
267
+ })
268
+ });
345
269
  }
346
- function AccordionContent({
347
- className,
348
- children,
349
- ...props
350
- }) {
351
- return /* @__PURE__ */ jsxRuntime.jsx(
352
- AccordionPrimitive__namespace.Content,
353
- {
354
- className: chunkW7AEYE7A_cjs.cn(
355
- "overflow-hidden",
356
- "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
357
- ),
358
- ...props,
359
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkW7AEYE7A_cjs.cn("pb-3.5 pt-0", className), children })
360
- }
361
- );
270
+ function AccordionContent({ className, children, ...props }) {
271
+ return (0, react_jsx_runtime.jsx)(_radix_ui_react_accordion.Content, {
272
+ className: require_use_theme.cn("overflow-hidden", "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"),
273
+ ...props,
274
+ children: (0, react_jsx_runtime.jsx)("div", {
275
+ className: require_use_theme.cn("pb-3.5 pt-0", className),
276
+ children
277
+ })
278
+ });
362
279
  }
280
+ //#endregion
281
+ //#region src/markdown/faq.tsx
363
282
  function splitFaq(markdown) {
364
- const lines = markdown.split("\n");
365
- const preamble = [];
366
- const sections = [];
367
- let current;
368
- let fence;
369
- for (const line of lines) {
370
- const fenceMatch = /^\s{0,3}(`{3,}|~{3,})/.exec(line);
371
- if (fenceMatch?.[1] !== void 0) {
372
- const marker = fenceMatch[1][0];
373
- if (fence === void 0) fence = marker;
374
- else if (fence === marker) fence = void 0;
375
- }
376
- const heading = fence === void 0 ? /^##\s+(.+?)\s*$/.exec(line) : null;
377
- if (heading?.[1] !== void 0) {
378
- if (current) sections.push({ question: current.question, answer: current.answer.join("\n") });
379
- current = { question: heading[1], answer: [] };
380
- continue;
381
- }
382
- if (current) current.answer.push(line);
383
- else preamble.push(line);
384
- }
385
- if (current) sections.push({ question: current.question, answer: current.answer.join("\n") });
386
- return { preamble: preamble.join("\n").trim(), sections };
283
+ const lines = markdown.split("\n");
284
+ const preamble = [];
285
+ const sections = [];
286
+ let current;
287
+ let fence;
288
+ for (const line of lines) {
289
+ const fenceMatch = /^\s{0,3}(`{3,}|~{3,})/.exec(line);
290
+ if (fenceMatch?.[1] !== void 0) {
291
+ const marker = fenceMatch[1][0];
292
+ if (fence === void 0) fence = marker;
293
+ else if (fence === marker) fence = void 0;
294
+ }
295
+ const heading = fence === void 0 ? /^##\s+(.+?)\s*$/.exec(line) : null;
296
+ if (heading?.[1] !== void 0) {
297
+ if (current) sections.push({
298
+ question: current.question,
299
+ answer: current.answer.join("\n")
300
+ });
301
+ current = {
302
+ question: heading[1],
303
+ answer: []
304
+ };
305
+ continue;
306
+ }
307
+ if (current) current.answer.push(line);
308
+ else preamble.push(line);
309
+ }
310
+ if (current) sections.push({
311
+ question: current.question,
312
+ answer: current.answer.join("\n")
313
+ });
314
+ return {
315
+ preamble: preamble.join("\n").trim(),
316
+ sections
317
+ };
387
318
  }
388
319
  function DocFaq({ children, className }) {
389
- const { preamble, sections } = splitFaq(children);
390
- const slugs = react$1.useMemo(() => sections.map((s) => chunkYF5IW525_cjs.docSlug(s.question)), [sections]);
391
- const [open, setOpen] = react$1.useState([]);
392
- react$1.useEffect(() => {
393
- if (typeof window === "undefined") return;
394
- const sync = () => {
395
- const id = chunkYF5IW525_cjs.readDocHash();
396
- if (id === "") return;
397
- const i = slugs.indexOf(id);
398
- if (i === -1) return;
399
- setOpen((prev) => prev.includes(`q${i}`) ? prev : [...prev, `q${i}`]);
400
- chunkYF5IW525_cjs.scrollToDocAnchor(id, document.body);
401
- };
402
- sync();
403
- window.addEventListener("hashchange", sync);
404
- return () => window.removeEventListener("hashchange", sync);
405
- }, [slugs]);
406
- if (sections.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(DocMarkdown, { className, children });
407
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkW7AEYE7A_cjs.cn("flex flex-col", className), "data-testid": "doc-faq", children: [
408
- preamble !== "" && /* @__PURE__ */ jsxRuntime.jsx(DocMarkdown, { className: "mb-2", children: preamble }),
409
- /* @__PURE__ */ jsxRuntime.jsx(Accordion, { type: "multiple", value: open, onValueChange: setOpen, className: "w-full", children: sections.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs(
410
- AccordionItem,
411
- {
412
- value: `q${i}`,
413
- id: slugs[i],
414
- className: "group/anchor scroll-mt-4",
415
- "data-testid": `doc-faq:item:${i}`,
416
- children: [
417
- /* @__PURE__ */ jsxRuntime.jsxs(AccordionTrigger, { children: [
418
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0", children: s.question }),
419
- /* @__PURE__ */ jsxRuntime.jsx(DocAnchorLink, { slug: slugs[i], stopPropagation: true, className: "ml-auto mr-1" })
420
- ] }),
421
- /* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { children: /* @__PURE__ */ jsxRuntime.jsx(DocMarkdown, { className: "prose-p:my-2 first:prose-p:mt-0 last:prose-p:mb-0", children: s.answer }) })
422
- ]
423
- },
424
- `${i}-${s.question}`
425
- )) })
426
- ] });
320
+ const { preamble, sections } = splitFaq(children);
321
+ const slugs = (0, react.useMemo)(() => sections.map((s) => require_use_theme.docSlug(s.question)), [sections]);
322
+ const [open, setOpen] = (0, react.useState)([]);
323
+ (0, react.useEffect)(() => {
324
+ if (typeof window === "undefined") return;
325
+ const sync = () => {
326
+ const id = require_use_theme.readDocHash();
327
+ if (id === "") return;
328
+ const i = slugs.indexOf(id);
329
+ if (i === -1) return;
330
+ setOpen((prev) => prev.includes(`q${i}`) ? prev : [...prev, `q${i}`]);
331
+ require_use_theme.scrollToDocAnchor(id, document.body);
332
+ };
333
+ sync();
334
+ window.addEventListener("hashchange", sync);
335
+ return () => window.removeEventListener("hashchange", sync);
336
+ }, [slugs]);
337
+ if (sections.length === 0) return (0, react_jsx_runtime.jsx)(DocMarkdown, {
338
+ className,
339
+ children
340
+ });
341
+ return (0, react_jsx_runtime.jsxs)("div", {
342
+ className: require_use_theme.cn("flex flex-col", className),
343
+ "data-testid": "doc-faq",
344
+ children: [preamble !== "" && (0, react_jsx_runtime.jsx)(DocMarkdown, {
345
+ className: "mb-2",
346
+ children: preamble
347
+ }), (0, react_jsx_runtime.jsx)(Accordion, {
348
+ type: "multiple",
349
+ value: open,
350
+ onValueChange: setOpen,
351
+ className: "w-full",
352
+ children: sections.map((s, i) => (0, react_jsx_runtime.jsxs)(AccordionItem, {
353
+ value: `q${i}`,
354
+ id: slugs[i],
355
+ className: "group/anchor scroll-mt-4",
356
+ "data-testid": `doc-faq:item:${i}`,
357
+ children: [(0, react_jsx_runtime.jsxs)(AccordionTrigger, { children: [(0, react_jsx_runtime.jsx)("span", {
358
+ className: "min-w-0",
359
+ children: s.question
360
+ }), (0, react_jsx_runtime.jsx)(DocAnchorLink, {
361
+ slug: slugs[i],
362
+ stopPropagation: true,
363
+ className: "ml-auto mr-1"
364
+ })] }), (0, react_jsx_runtime.jsx)(AccordionContent, { children: (0, react_jsx_runtime.jsx)(DocMarkdown, {
365
+ className: "prose-p:my-2 first:prose-p:mt-0 last:prose-p:mb-0",
366
+ children: s.answer
367
+ }) })]
368
+ }, `${i}-${s.question}`))
369
+ })]
370
+ });
427
371
  }
372
+ //#endregion
373
+ //#region src/markdown/index.tsx
428
374
  function DocMarkdown({ children, className }) {
429
- return /* @__PURE__ */ jsxRuntime.jsx(
430
- "div",
431
- {
432
- className: chunkW7AEYE7A_cjs.cn(
433
- "prose prose-sm max-w-none dark:prose-invert",
434
- // The default prose measure is wider than any panel we render into,
435
- // and its heading rhythm is tuned for a page rather than a column.
436
- "prose-headings:scroll-mt-4 prose-headings:font-semibold",
437
- "prose-h1:text-base prose-h2:text-[0.9375rem] prose-h3:text-sm",
438
- "prose-p:leading-[1.65]",
439
- "prose-a:font-medium prose-a:underline-offset-2",
440
- "prose-img:rounded-md prose-img:border",
441
- "prose-video:rounded-md prose-video:border prose-video:w-full",
442
- "prose-table:text-[0.8125rem]",
443
- className
444
- ),
445
- children: /* @__PURE__ */ jsxRuntime.jsx(
446
- Markdown__default.default,
447
- {
448
- remarkPlugins: [remarkGfm__default.default, remarkDirective__default.default, remarkVideoDirective],
449
- rehypePlugins: [rehypeSlug__default.default, [rehypeSanitize__default.default, docSanitizeSchema]],
450
- components: {
451
- // Every link in a body leaves the app; routing is not involved, so
452
- // this stays a plain anchor and the package stays router-agnostic.
453
- a: ({ href, children: kids, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("a", { href, target: "_blank", rel: "noopener noreferrer", ...rest, children: kids }),
454
- // Long articles should not fetch every illustration up front. The
455
- // attribute has to be allow-listed in the schema too — it is in
456
- // neither `img` nor the `*` bucket by default.
457
- img: ({ ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("img", { loading: "lazy", ...rest, alt: rest.alt ?? "" }),
458
- // A wide GFM table must scroll inside its own box rather than push
459
- // the panel — or the page — sideways.
460
- table: ({ children: kids, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsx("table", { ...rest, children: kids }) }),
461
- /*
462
- ```mermaid blocks become diagrams; every other fence stays a code
463
- block. `language-*` on `code` is already allow-listed by
464
- rehype-sanitize's default schema, so no schema change is owed —
465
- and the diagram source reaches MermaidDiagram as TEXT, never as
466
- markup, which is what keeps the sanitized pipeline sanitized.
467
- */
468
- code: ({ className: cls, children: kids, ...rest }) => {
469
- if (/\blanguage-mermaid\b/.test(cls ?? "")) {
470
- return /* @__PURE__ */ jsxRuntime.jsx(MermaidDiagram, { code: String(kids).replace(/\n$/, "") });
471
- }
472
- return /* @__PURE__ */ jsxRuntime.jsx("code", { className: cls, ...rest, children: kids });
473
- },
474
- /*
475
- A heading is a linkable place, and an anchor nobody can see is an
476
- anchor nobody uses — so each one carries a « # » that appears on
477
- hover or focus and puts the fragment in the address bar.
478
-
479
- The id on the element is `user-content-<slug>` (the sanitizer's
480
- clobber prefix); the href is the BARE slug, because that is what a
481
- person pastes and what `findDocAnchor` resolves. Keeping the visible
482
- link clean is the whole reason those two are allowed to differ.
483
- */
484
- h2: ({ children: kids, id, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(HeadingWithAnchor, { level: 2, id, ...rest, children: kids }),
485
- h3: ({ children: kids, id, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(HeadingWithAnchor, { level: 3, id, ...rest, children: kids }),
486
- /*
487
- A mermaid diagram replaces the whole block, so the <pre> that
488
- react-markdown wraps it in would contribute a stray bordered box
489
- around the figure.
490
- */
491
- pre: ({ children: kids, ...rest }) => {
492
- const only = Array.isArray(kids) ? kids[0] : kids;
493
- const cls = typeof only === "object" && only !== null && "props" in only ? only.props?.className ?? "" : "";
494
- if (/\blanguage-mermaid\b/.test(cls)) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: kids });
495
- return /* @__PURE__ */ jsxRuntime.jsx("pre", { ...rest, children: kids });
496
- }
497
- },
498
- children
499
- }
500
- )
501
- }
502
- );
375
+ return (0, react_jsx_runtime.jsx)("div", {
376
+ className: require_use_theme.cn("prose prose-sm max-w-none dark:prose-invert", "prose-headings:scroll-mt-4 prose-headings:font-semibold", "prose-h1:text-base prose-h2:text-[0.9375rem] prose-h3:text-sm", "prose-p:leading-[1.65]", "prose-a:font-medium prose-a:underline-offset-2", "prose-img:rounded-md prose-img:border", "prose-video:rounded-md prose-video:border prose-video:w-full", "prose-table:text-[0.8125rem]", className),
377
+ children: (0, react_jsx_runtime.jsx)(react_markdown.default, {
378
+ remarkPlugins: [
379
+ remark_gfm.default,
380
+ remark_directive.default,
381
+ remarkVideoDirective
382
+ ],
383
+ rehypePlugins: [rehype_slug.default, [rehype_sanitize.default, docSanitizeSchema]],
384
+ components: {
385
+ a: ({ href, children: kids, ...rest }) => (0, react_jsx_runtime.jsx)("a", {
386
+ href,
387
+ target: "_blank",
388
+ rel: "noopener noreferrer",
389
+ ...rest,
390
+ children: kids
391
+ }),
392
+ img: ({ ...rest }) => (0, react_jsx_runtime.jsx)("img", {
393
+ loading: "lazy",
394
+ ...rest,
395
+ alt: rest.alt ?? ""
396
+ }),
397
+ table: ({ children: kids, ...rest }) => (0, react_jsx_runtime.jsx)("div", {
398
+ className: "overflow-x-auto",
399
+ children: (0, react_jsx_runtime.jsx)("table", {
400
+ ...rest,
401
+ children: kids
402
+ })
403
+ }),
404
+ code: ({ className: cls, children: kids, ...rest }) => {
405
+ if (/\blanguage-mermaid\b/.test(cls ?? "")) return (0, react_jsx_runtime.jsx)(MermaidDiagram, { code: String(kids).replace(/\n$/, "") });
406
+ return (0, react_jsx_runtime.jsx)("code", {
407
+ className: cls,
408
+ ...rest,
409
+ children: kids
410
+ });
411
+ },
412
+ h2: ({ children: kids, id, ...rest }) => (0, react_jsx_runtime.jsx)(HeadingWithAnchor, {
413
+ level: 2,
414
+ id,
415
+ ...rest,
416
+ children: kids
417
+ }),
418
+ h3: ({ children: kids, id, ...rest }) => (0, react_jsx_runtime.jsx)(HeadingWithAnchor, {
419
+ level: 3,
420
+ id,
421
+ ...rest,
422
+ children: kids
423
+ }),
424
+ pre: ({ children: kids, ...rest }) => {
425
+ const only = Array.isArray(kids) ? kids[0] : kids;
426
+ const cls = typeof only === "object" && only !== null && "props" in only ? only.props?.className ?? "" : "";
427
+ if (/\blanguage-mermaid\b/.test(cls)) return (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: kids });
428
+ return (0, react_jsx_runtime.jsx)("pre", {
429
+ ...rest,
430
+ children: kids
431
+ });
432
+ }
433
+ },
434
+ children
435
+ })
436
+ });
503
437
  }
504
- function HeadingWithAnchor({
505
- level,
506
- id,
507
- children,
508
- ...rest
509
- }) {
510
- const Tag = level === 2 ? "h2" : "h3";
511
- const slug = id?.startsWith(chunkYF5IW525_cjs.DOC_ID_PREFIX) ? id.slice(chunkYF5IW525_cjs.DOC_ID_PREFIX.length) : id;
512
- return /* @__PURE__ */ jsxRuntime.jsxs(Tag, { id, className: "group/anchor scroll-mt-4", ...rest, children: [
513
- children,
514
- slug !== void 0 && slug !== "" && /* @__PURE__ */ jsxRuntime.jsx(DocAnchorLink, { slug })
515
- ] });
438
+ function HeadingWithAnchor({ level, id, children, ...rest }) {
439
+ const Tag = level === 2 ? "h2" : "h3";
440
+ const slug = id?.startsWith("user-content-") ? id.slice(require_use_theme.DOC_ID_PREFIX.length) : id;
441
+ return (0, react_jsx_runtime.jsxs)(Tag, {
442
+ id,
443
+ className: "group/anchor scroll-mt-4",
444
+ ...rest,
445
+ children: [children, slug !== void 0 && slug !== "" && (0, react_jsx_runtime.jsx)(DocAnchorLink, { slug })]
446
+ });
516
447
  }
517
-
518
- Object.defineProperty(exports, "DOC_ID_PREFIX", {
519
- enumerable: true,
520
- get: function () { return chunkYF5IW525_cjs.DOC_ID_PREFIX; }
521
- });
522
- Object.defineProperty(exports, "docShareUrl", {
523
- enumerable: true,
524
- get: function () { return chunkYF5IW525_cjs.docShareUrl; }
525
- });
526
- Object.defineProperty(exports, "docSlug", {
527
- enumerable: true,
528
- get: function () { return chunkYF5IW525_cjs.docSlug; }
529
- });
530
- Object.defineProperty(exports, "findDocAnchor", {
531
- enumerable: true,
532
- get: function () { return chunkYF5IW525_cjs.findDocAnchor; }
533
- });
534
- Object.defineProperty(exports, "readDocHash", {
535
- enumerable: true,
536
- get: function () { return chunkYF5IW525_cjs.readDocHash; }
537
- });
538
- Object.defineProperty(exports, "scrollToDocAnchor", {
539
- enumerable: true,
540
- get: function () { return chunkYF5IW525_cjs.scrollToDocAnchor; }
541
- });
448
+ //#endregion
449
+ exports.DOC_ID_PREFIX = require_use_theme.DOC_ID_PREFIX;
542
450
  exports.DocAnchorLink = DocAnchorLink;
543
451
  exports.DocFaq = DocFaq;
544
452
  exports.DocMarkdown = DocMarkdown;
545
453
  exports.MermaidDiagram = MermaidDiagram;
546
454
  exports.docSanitizeSchema = docSanitizeSchema;
455
+ exports.docShareUrl = require_use_theme.docShareUrl;
456
+ exports.docSlug = require_use_theme.docSlug;
457
+ exports.findDocAnchor = require_use_theme.findDocAnchor;
458
+ exports.readDocHash = require_use_theme.readDocHash;
547
459
  exports.remarkVideoDirective = remarkVideoDirective;
460
+ exports.scrollToDocAnchor = require_use_theme.scrollToDocAnchor;
548
461
  exports.splitFaq = splitFaq;
549
- //# sourceMappingURL=index.cjs.map
462
+
550
463
  //# sourceMappingURL=index.cjs.map