@mintlify/msft-sdk 0.1.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.
- package/README.md +23 -0
- package/dist/components/content-components/all-components.js +27 -0
- package/dist/components/content-components/all-components.js.map +1 -0
- package/dist/components/content-components/callouts.js +50 -0
- package/dist/components/content-components/callouts.js.map +1 -0
- package/dist/components/content-components/callouts.module.css.js +26 -0
- package/dist/components/content-components/callouts.module.css.js.map +1 -0
- package/dist/components/content-components/code-block.js +86 -0
- package/dist/components/content-components/code-block.js.map +1 -0
- package/dist/components/content-components/code-block.module.css.js +28 -0
- package/dist/components/content-components/code-block.module.css.js.map +1 -0
- package/dist/components/content-components/default-components.js +36 -0
- package/dist/components/content-components/default-components.js.map +1 -0
- package/dist/components/content-components/default-components.module.css.js +12 -0
- package/dist/components/content-components/default-components.module.css.js.map +1 -0
- package/dist/components/content-components/details/details.js +42 -0
- package/dist/components/content-components/details/details.js.map +1 -0
- package/dist/components/content-components/details/details.module.css.js +20 -0
- package/dist/components/content-components/details/details.module.css.js.map +1 -0
- package/dist/components/content-components/heading.js +9 -0
- package/dist/components/content-components/heading.js.map +1 -0
- package/dist/components/content-components/link.js +23 -0
- package/dist/components/content-components/link.js.map +1 -0
- package/dist/components/content-components/link.module.css.js +10 -0
- package/dist/components/content-components/link.module.css.js.map +1 -0
- package/dist/components/content-components/param-name.js +9 -0
- package/dist/components/content-components/param-name.js.map +1 -0
- package/dist/components/content-components/param-name.module.css.js +8 -0
- package/dist/components/content-components/param-name.module.css.js.map +1 -0
- package/dist/components/content-components/table/index.js +122 -0
- package/dist/components/content-components/table/index.js.map +1 -0
- package/dist/components/content-components/table/table-modal.js +64 -0
- package/dist/components/content-components/table/table-modal.js.map +1 -0
- package/dist/components/content-components/table/table-modal.module.css.js +18 -0
- package/dist/components/content-components/table/table-modal.module.css.js.map +1 -0
- package/dist/components/content-components/table/table.module.css.js +30 -0
- package/dist/components/content-components/table/table.module.css.js.map +1 -0
- package/dist/components/content-components/tabs/tab.js +8 -0
- package/dist/components/content-components/tabs/tab.js.map +1 -0
- package/dist/components/content-components/tabs/tabs.js +87 -0
- package/dist/components/content-components/tabs/tabs.js.map +1 -0
- package/dist/components/content-components/tabs/tabs.module.css.js +24 -0
- package/dist/components/content-components/tabs/tabs.module.css.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-context.js +52 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-context.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.js +74 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.module.css.js +14 -0
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.module.css.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-pivot.js +25 -0
- package/dist/components/content-components/zone-pivots/zone-pivot.js.map +1 -0
- package/dist/components/content-components/zone-pivots/zone-target.js +8 -0
- package/dist/components/content-components/zone-pivots/zone-target.js.map +1 -0
- package/dist/components/mdx-renderer.js +13 -0
- package/dist/components/mdx-renderer.js.map +1 -0
- package/dist/components/mdx-renderer.module.css.js +8 -0
- package/dist/components/mdx-renderer.module.css.js.map +1 -0
- package/dist/components/nav-tree/dropdown-menu.js +68 -0
- package/dist/components/nav-tree/dropdown-menu.js.map +1 -0
- package/dist/components/nav-tree/dropdown-menu.module.css.js +52 -0
- package/dist/components/nav-tree/dropdown-menu.module.css.js.map +1 -0
- package/dist/components/nav-tree/index.js +126 -0
- package/dist/components/nav-tree/index.js.map +1 -0
- package/dist/components/nav-tree/mobile-nav.js +60 -0
- package/dist/components/nav-tree/mobile-nav.js.map +1 -0
- package/dist/components/nav-tree/mobile-nav.module.css.js +22 -0
- package/dist/components/nav-tree/mobile-nav.module.css.js.map +1 -0
- package/dist/components/nav-tree/nav-tree.module.css.js +34 -0
- package/dist/components/nav-tree/nav-tree.module.css.js.map +1 -0
- package/dist/components/page-context-menu.js +123 -0
- package/dist/components/page-context-menu.js.map +1 -0
- package/dist/components/page-context-menu.module.css.js +42 -0
- package/dist/components/page-context-menu.module.css.js.map +1 -0
- package/dist/components/page.js +85 -0
- package/dist/components/page.js.map +1 -0
- package/dist/components/page.module.css.js +48 -0
- package/dist/components/page.module.css.js.map +1 -0
- package/dist/components/prose.module.css.js +8 -0
- package/dist/components/prose.module.css.js.map +1 -0
- package/dist/components/toc/index.js +65 -0
- package/dist/components/toc/index.js.map +1 -0
- package/dist/components/toc/pivot-aware-toc.js +23 -0
- package/dist/components/toc/pivot-aware-toc.js.map +1 -0
- package/dist/components/toc/toc.module.css.js +18 -0
- package/dist/components/toc/toc.module.css.js.map +1 -0
- package/dist/hooks/useMarkdownCopy.js +50 -0
- package/dist/hooks/useMarkdownCopy.js.map +1 -0
- package/dist/index.d.ts +313 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/convert-html-to-mdx.js +28 -0
- package/dist/parser/convert-html-to-mdx.js.map +1 -0
- package/dist/parser/serialize-mdx.js +36 -0
- package/dist/parser/serialize-mdx.js.map +1 -0
- package/dist/plugins/rehype/rehype-code-blocks.js +44 -0
- package/dist/plugins/rehype/rehype-code-blocks.js.map +1 -0
- package/dist/plugins/remark/remark-heading-ids.js +23 -0
- package/dist/plugins/remark/remark-heading-ids.js.map +1 -0
- package/dist/plugins/sanitize/rehype-callouts.js +32 -0
- package/dist/plugins/sanitize/rehype-callouts.js.map +1 -0
- package/dist/plugins/sanitize/rehype-details.js +18 -0
- package/dist/plugins/sanitize/rehype-details.js.map +1 -0
- package/dist/plugins/sanitize/rehype-heading-ids.js +22 -0
- package/dist/plugins/sanitize/rehype-heading-ids.js.map +1 -0
- package/dist/plugins/sanitize/rehype-param-name.js +11 -0
- package/dist/plugins/sanitize/rehype-param-name.js.map +1 -0
- package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js +29 -0
- package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js.map +1 -0
- package/dist/plugins/sanitize/rehype-remark.js +50 -0
- package/dist/plugins/sanitize/rehype-remark.js.map +1 -0
- package/dist/plugins/sanitize/rehype-table-align.js +52 -0
- package/dist/plugins/sanitize/rehype-table-align.js.map +1 -0
- package/dist/plugins/sanitize/rehype-tabs.js +51 -0
- package/dist/plugins/sanitize/rehype-tabs.js.map +1 -0
- package/dist/plugins/sanitize/rehype-zone-pivots.js +106 -0
- package/dist/plugins/sanitize/rehype-zone-pivots.js.map +1 -0
- package/dist/plugins/sanitize/remove-html-comments.js +17 -0
- package/dist/plugins/sanitize/remove-html-comments.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/utils/get-node-text.js +5 -0
- package/dist/utils/get-node-text.js.map +1 -0
- package/dist/utils/rehype.js +17 -0
- package/dist/utils/rehype.js.map +1 -0
- package/dist/utils/string.js +5 -0
- package/dist/utils/string.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/content-components/table/index.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useState } from \"react\";\nimport { TableModal } from \"./table-modal\";\nimport { ArrowExpand20Regular } from \"@fluentui/react-icons\";\nimport styles from \"./table.module.css\";\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, children, ...props }, ref) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const handleExpandClick = () => {\n setIsModalOpen(true);\n };\n\n const handleCloseModal = () => {\n setIsModalOpen(false);\n };\n\n return (\n <>\n <div\n className={styles.container}\n role=\"region\"\n aria-label=\"Data table\"\n >\n <button\n onClick={handleExpandClick}\n className={styles.expandButton}\n aria-label=\"Expand table to full screen view\"\n title=\"Expand table\"\n >\n <ArrowExpand20Regular className={styles.expandIcon} />\n <span className={styles.expandText}>\n Expand table\n </span>\n </button>\n <div className={styles.scrollContainer}>\n <table\n ref={ref}\n className={`${styles.table} ${className || \"\"}`}\n {...props}\n >\n {children}\n </table>\n </div>\n </div>\n <TableModal isOpen={isModalOpen} onClose={handleCloseModal}>\n <table\n className={`${styles.table} ${className || \"\"}`}\n >\n {children}\n </table>\n </TableModal>\n </>\n );\n});\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead\n ref={ref}\n className={`${styles.tableHeader} ${className || \"\"}`}\n {...props}\n />\n));\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody ref={ref} className={className} {...props} />\n));\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={`${styles.tableFooter} ${className || \"\"}`}\n {...props}\n />\n));\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={`${styles.tableRow} ${className || \"\"}`}\n {...props}\n />\n));\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={`${styles.tableHead} ${className || \"\"}`}\n {...props}\n />\n));\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={`${styles.tableCell} ${className || \"\"}`}\n {...props}\n />\n));\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={`${styles.tableCaption} ${className || \"\"}`}\n {...props}\n />\n));\nTableCaption.displayName = \"TableCaption\";\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n"],"names":["Table","React","className","children","props","ref","isModalOpen","setIsModalOpen","useState","handleExpandClick","handleCloseModal","jsxs","Fragment","styles","jsx","ArrowExpand20Regular","TableModal","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption"],"mappings":";;;;;;AAMA,MAAMA,IAAQC,EAAM,WAGlB,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAAQ;AAC5C,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAAoB,MAAM;AAC9B,IAAAF,EAAe,EAAI;AAAA,EACrB,GAEMG,IAAmB,MAAM;AAC7B,IAAAH,EAAe,EAAK;AAAA,EACtB;AAEA,SACE,gBAAAI,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWE,EAAO;AAAA,QAClB,MAAK;AAAA,QACL,cAAW;AAAA,QAEX,UAAA;AAAA,UAAA,gBAAAF;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAASF;AAAA,cACT,WAAWI,EAAO;AAAA,cAClB,cAAW;AAAA,cACX,OAAM;AAAA,cAEN,UAAA;AAAA,gBAAA,gBAAAC,EAACC,GAAA,EAAqB,WAAWF,EAAO,WAAA,CAAY;AAAA,gBACpD,gBAAAC,EAAC,QAAA,EAAK,WAAWD,EAAO,YAAY,UAAA,eAAA,CAEpC;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAEF,gBAAAC,EAAC,OAAA,EAAI,WAAWD,EAAO,iBACrB,UAAA,gBAAAC;AAAA,YAAC;AAAA,YAAA;AAAA,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A,IACC,KAAAT;AAAA,IACA,WAAW,GAAGQ,EAAO,QAAQ,IAAIX,KAAa,EAAE;AAAA,IAC/C,GAAGE;AAAA,EAAA;AACN,CACD;AACDgB,EAAS,cAAc;AAEvB,MAAMC,IAAYpB,EAAM,WAGtB,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAS;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAT;AAAA,IACA,WAAW,GAAGQ,EAAO,SAAS,IAAIX,KAAa,EAAE;AAAA,IAChD,GAAGE;AAAA,EAAA;AACN,CACD;AACDiB,EAAU,cAAc;AAExB,MAAMC,IAAYrB,EAAM,WAGtB,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAS;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAT;AAAA,IACA,WAAW,GAAGQ,EAAO,SAAS,IAAIX,KAAa,EAAE;AAAA,IAChD,GAAGE;AAAA,EAAA;AACN,CACD;AACDkB,EAAU,cAAc;AAExB,MAAMC,IAAetB,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAS;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAT;AAAA,IACA,WAAW,GAAGQ,EAAO,YAAY,IAAIX,KAAa,EAAE;AAAA,IACnD,GAAGE;AAAA,EAAA;AACN,CACD;AACDmB,EAAa,cAAc;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as l, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as s, useEffect as u } from "react";
|
|
3
|
+
import { Dismiss20Regular as w } from "@fluentui/react-icons";
|
|
4
|
+
import o from "./table-modal.module.css.js";
|
|
5
|
+
function x({ isOpen: n, onClose: r, children: y }) {
|
|
6
|
+
const i = s(null), m = s(null), f = s(null);
|
|
7
|
+
return u(() => {
|
|
8
|
+
var e, t;
|
|
9
|
+
return n ? (f.current = document.activeElement, document.body.style.overflow = "hidden", (e = m.current) == null || e.focus()) : (document.body.style.overflow = "unset", (t = f.current) == null || t.focus()), () => {
|
|
10
|
+
document.body.style.overflow = "unset";
|
|
11
|
+
};
|
|
12
|
+
}, [n]), u(() => {
|
|
13
|
+
const e = (t) => {
|
|
14
|
+
t.key === "Escape" && r();
|
|
15
|
+
};
|
|
16
|
+
return n && window.addEventListener("keydown", e), () => {
|
|
17
|
+
window.removeEventListener("keydown", e);
|
|
18
|
+
};
|
|
19
|
+
}, [n, r]), u(() => {
|
|
20
|
+
if (!n || !i.current) return;
|
|
21
|
+
const e = i.current, t = e.querySelectorAll(
|
|
22
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
23
|
+
), a = t[0], c = t[t.length - 1], v = (d) => {
|
|
24
|
+
d.key === "Tab" && (d.shiftKey ? document.activeElement === a && (d.preventDefault(), c == null || c.focus()) : document.activeElement === c && (d.preventDefault(), a == null || a.focus()));
|
|
25
|
+
};
|
|
26
|
+
return e.addEventListener("keydown", v), () => {
|
|
27
|
+
e.removeEventListener("keydown", v);
|
|
28
|
+
};
|
|
29
|
+
}, [n]), n ? /* @__PURE__ */ l(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: o.overlay,
|
|
33
|
+
onClick: r,
|
|
34
|
+
role: "dialog",
|
|
35
|
+
"aria-modal": "true",
|
|
36
|
+
"aria-labelledby": "table-modal-title",
|
|
37
|
+
children: /* @__PURE__ */ b(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: i,
|
|
41
|
+
className: o.modal,
|
|
42
|
+
onClick: (e) => e.stopPropagation(),
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ l("div", { className: o.header, children: /* @__PURE__ */ l(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
ref: m,
|
|
48
|
+
onClick: r,
|
|
49
|
+
className: o.closeButton,
|
|
50
|
+
"aria-label": "Close table expanded view",
|
|
51
|
+
children: /* @__PURE__ */ l(w, { className: o.closeIcon })
|
|
52
|
+
}
|
|
53
|
+
) }),
|
|
54
|
+
/* @__PURE__ */ l("div", { className: o.content, id: "table-modal-title", children: y })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
) : null;
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
x as TableModal
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=table-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-modal.js","sources":["../../../../src/components/content-components/table/table-modal.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\nimport { Dismiss20Regular } from \"@fluentui/react-icons\";\nimport styles from \"./table-modal.module.css\";\n\ninterface TableModalProps {\n isOpen: boolean;\n onClose: () => void;\n children: React.ReactNode;\n}\n\nexport function TableModal({ isOpen, onClose, children }: TableModalProps) {\n const modalRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const previousActiveElement = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (isOpen) {\n previousActiveElement.current = document.activeElement as HTMLElement;\n document.body.style.overflow = \"hidden\";\n closeButtonRef.current?.focus();\n } else {\n document.body.style.overflow = \"unset\";\n previousActiveElement.current?.focus();\n }\n\n return () => {\n document.body.style.overflow = \"unset\";\n };\n }, [isOpen]);\n\n useEffect(() => {\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n onClose();\n }\n };\n\n if (isOpen) {\n window.addEventListener(\"keydown\", handleEscape);\n }\n\n return () => {\n window.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen, onClose]);\n\n useEffect(() => {\n if (!isOpen || !modalRef.current) return;\n\n const modal = modalRef.current;\n const focusableElements = modal.querySelectorAll<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n const firstFocusable = focusableElements[0];\n const lastFocusable = focusableElements[focusableElements.length - 1];\n\n const handleTabKey = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\") return;\n\n if (e.shiftKey) {\n if (document.activeElement === firstFocusable) {\n e.preventDefault();\n lastFocusable?.focus();\n }\n } else {\n if (document.activeElement === lastFocusable) {\n e.preventDefault();\n firstFocusable?.focus();\n }\n }\n };\n\n modal.addEventListener(\"keydown\", handleTabKey as EventListener);\n return () => {\n modal.removeEventListener(\"keydown\", handleTabKey as EventListener);\n };\n }, [isOpen]);\n\n if (!isOpen) return null;\n\n return (\n <div\n className={styles.overlay}\n onClick={onClose}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"table-modal-title\"\n >\n <div\n ref={modalRef}\n className={styles.modal}\n onClick={(e) => e.stopPropagation()}\n >\n <div className={styles.header}>\n <button\n ref={closeButtonRef}\n onClick={onClose}\n className={styles.closeButton}\n aria-label=\"Close table expanded view\"\n >\n <Dismiss20Regular className={styles.closeIcon} />\n </button>\n </div>\n <div className={styles.content} id=\"table-modal-title\">\n {children}\n </div>\n </div>\n </div>\n );\n}\n"],"names":["TableModal","isOpen","onClose","children","modalRef","useRef","closeButtonRef","previousActiveElement","useEffect","_a","_b","handleEscape","e","modal","focusableElements","firstFocusable","lastFocusable","handleTabKey","jsx","styles","jsxs","Dismiss20Regular"],"mappings":";;;;AAUO,SAASA,EAAW,EAAE,QAAAC,GAAQ,SAAAC,GAAS,UAAAC,KAA6B;AACzE,QAAMC,IAAWC,EAAuB,IAAI,GACtCC,IAAiBD,EAA0B,IAAI,GAC/CE,IAAwBF,EAA2B,IAAI;AAiE7D,SA/DAG,EAAU,MAAM;;AACd,WAAIP,KACFM,EAAsB,UAAU,SAAS,eACzC,SAAS,KAAK,MAAM,WAAW,WAC/BE,IAAAH,EAAe,YAAf,QAAAG,EAAwB,YAExB,SAAS,KAAK,MAAM,WAAW,UAC/BC,IAAAH,EAAsB,YAAtB,QAAAG,EAA+B,UAG1B,MAAM;AACX,eAAS,KA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B,UAAA,gBAAAD;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,KAAKZ;AAAA,gBACL,SAASJ;AAAA,gBACT,WAAWiB,EAAO;AAAA,gBAClB,cAAW;AAAA,gBAEX,UAAA,gBAAAD,EAACG,GAAA,EAAiB,WAAWF,EAAO,UAAA,CAAW;AAAA,cAAA;AAAA,YAAA,GAEnD;AAAA,8BACC,OAAA,EAAI,WAAWA,EAAO,SAAS,IAAG,qBAChC,UAAAhB,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,IA5BgB;AA+BtB;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const o = "_overlay_oaifl_1", t = "_modal_oaifl_12", e = "_header_oaifl_29", l = "_closeButton_oaifl_40", c = "_closeIcon_oaifl_56", n = "_content_oaifl_66", _ = {
|
|
2
|
+
overlay: o,
|
|
3
|
+
modal: t,
|
|
4
|
+
header: e,
|
|
5
|
+
closeButton: l,
|
|
6
|
+
closeIcon: c,
|
|
7
|
+
content: n
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
l as closeButton,
|
|
11
|
+
c as closeIcon,
|
|
12
|
+
n as content,
|
|
13
|
+
_ as default,
|
|
14
|
+
e as header,
|
|
15
|
+
t as modal,
|
|
16
|
+
o as overlay
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=table-modal.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-modal.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const t = "_container_1yfm4_1", e = "_expandButton_1yfm4_8", a = "_expandIcon_1yfm4_28", n = "_expandText_1yfm4_38", o = "_scrollContainer_1yfm4_47", _ = "_table_1yfm4_52", l = "_tableHeader_1yfm4_66", c = "_tableFooter_1yfm4_80", b = "_tableRow_1yfm4_95", s = "_tableHead_1yfm4_66", d = "_tableCell_1yfm4_128", r = "_tableCaption_1yfm4_169", f = {
|
|
2
|
+
container: t,
|
|
3
|
+
expandButton: e,
|
|
4
|
+
expandIcon: a,
|
|
5
|
+
expandText: n,
|
|
6
|
+
scrollContainer: o,
|
|
7
|
+
table: _,
|
|
8
|
+
tableHeader: l,
|
|
9
|
+
tableFooter: c,
|
|
10
|
+
tableRow: b,
|
|
11
|
+
tableHead: s,
|
|
12
|
+
tableCell: d,
|
|
13
|
+
tableCaption: r
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
t as container,
|
|
17
|
+
f as default,
|
|
18
|
+
e as expandButton,
|
|
19
|
+
a as expandIcon,
|
|
20
|
+
n as expandText,
|
|
21
|
+
o as scrollContainer,
|
|
22
|
+
_ as table,
|
|
23
|
+
r as tableCaption,
|
|
24
|
+
d as tableCell,
|
|
25
|
+
c as tableFooter,
|
|
26
|
+
s as tableHead,
|
|
27
|
+
l as tableHeader,
|
|
28
|
+
b as tableRow
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=table.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab.js","sources":["../../../../src/components/content-components/tabs/tab.tsx"],"sourcesContent":["import React from \"react\";\n\ninterface TabProps {\n title: string;\n icon?: string;\n children: React.ReactNode;\n}\n\nexport function Tab({ children }: TabProps) {\n return <>{children}</>;\n}\n"],"names":["Tab","children"],"mappings":";AAQO,SAASA,EAAI,EAAE,UAAAC,KAAsB;AAC1C,gCAAU,UAAAA,GAAS;AACrB;"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import i, { useState as v, useRef as $, useEffect as g } from "react";
|
|
3
|
+
import a from "./tabs.module.css.js";
|
|
4
|
+
import y from "../../prose.module.css.js";
|
|
5
|
+
const A = i.createContext({
|
|
6
|
+
activeTab: 0,
|
|
7
|
+
setActiveTab: () => {
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
function D({ children: h, defaultTab: f = 0 }) {
|
|
11
|
+
const [c, b] = v(f), o = $([]), r = i.Children.toArray(h);
|
|
12
|
+
g(() => {
|
|
13
|
+
o.current = o.current.slice(0, r.length);
|
|
14
|
+
}, [r.length]);
|
|
15
|
+
const m = (t, e) => {
|
|
16
|
+
var s;
|
|
17
|
+
let l = e;
|
|
18
|
+
switch (t.key) {
|
|
19
|
+
case "ArrowRight":
|
|
20
|
+
t.preventDefault(), l = (e + 1) % r.length;
|
|
21
|
+
break;
|
|
22
|
+
case "ArrowLeft":
|
|
23
|
+
t.preventDefault(), l = (e - 1 + r.length) % r.length;
|
|
24
|
+
break;
|
|
25
|
+
case "Home":
|
|
26
|
+
t.preventDefault(), l = 0;
|
|
27
|
+
break;
|
|
28
|
+
case "End":
|
|
29
|
+
t.preventDefault(), l = r.length - 1;
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
b(l), (s = o.current[l]) == null || s.focus();
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ n(A.Provider, { value: { activeTab: c, setActiveTab: b }, children: /* @__PURE__ */ d("div", { className: a.container, children: [
|
|
37
|
+
/* @__PURE__ */ n(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
role: "tablist",
|
|
41
|
+
"aria-label": "Content tabs",
|
|
42
|
+
className: a.tabList,
|
|
43
|
+
children: r.map((t, e) => {
|
|
44
|
+
if (!i.isValidElement(t)) return null;
|
|
45
|
+
const l = t.props.title || `Tab ${e + 1}`, s = t.props.icon, p = c === e;
|
|
46
|
+
return /* @__PURE__ */ n(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
ref: (u) => o.current[e] = u,
|
|
50
|
+
role: "tab",
|
|
51
|
+
"aria-selected": p,
|
|
52
|
+
"aria-controls": `tabpanel-${e}`,
|
|
53
|
+
id: `tab-${e}`,
|
|
54
|
+
tabIndex: p ? 0 : -1,
|
|
55
|
+
onClick: () => b(e),
|
|
56
|
+
onKeyDown: (u) => m(u, e),
|
|
57
|
+
className: `${a.tab} ${p ? a.tabActive : a.tabInactive}`,
|
|
58
|
+
children: /* @__PURE__ */ d("span", { className: a.tabContent, children: [
|
|
59
|
+
s && /* @__PURE__ */ n("span", { "aria-hidden": "true", children: s }),
|
|
60
|
+
l
|
|
61
|
+
] })
|
|
62
|
+
},
|
|
63
|
+
e
|
|
64
|
+
);
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ n("div", { className: `${a.panelContainer} ${y.prose}`, children: r.map((t, e) => /* @__PURE__ */ n(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
role: "tabpanel",
|
|
72
|
+
id: `tabpanel-${e}`,
|
|
73
|
+
"aria-labelledby": `tab-${e}`,
|
|
74
|
+
tabIndex: 0,
|
|
75
|
+
hidden: c !== e,
|
|
76
|
+
className: `${a.panel} ${c === e ? "" : a.panelHidden}`,
|
|
77
|
+
children: i.isValidElement(t) ? t.props.children : null
|
|
78
|
+
},
|
|
79
|
+
e
|
|
80
|
+
)) })
|
|
81
|
+
] }) });
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
D as Tabs,
|
|
85
|
+
A as TabsContext
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../../../src/components/content-components/tabs/tabs.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from \"react\";\nimport styles from \"./tabs.module.css\";\nimport proseStyles from \"../../prose.module.css\";\n\ninterface TabsProps {\n children: React.ReactNode;\n defaultTab?: number;\n}\n\ninterface TabsContextValue {\n activeTab: number;\n setActiveTab: (index: number) => void;\n}\n\nexport const TabsContext = React.createContext<TabsContextValue>({\n activeTab: 0,\n setActiveTab: () => {},\n});\n\nexport function Tabs({ children, defaultTab = 0 }: TabsProps) {\n const [activeTab, setActiveTab] = useState(defaultTab);\n const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);\n\n const tabs = React.Children.toArray(children);\n\n useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, tabs.length);\n }, [tabs.length]);\n\n const handleKeyDown = (event: React.KeyboardEvent, currentIndex: number) => {\n let newIndex = currentIndex;\n\n switch (event.key) {\n case \"ArrowRight\":\n event.preventDefault();\n newIndex = (currentIndex + 1) % tabs.length;\n break;\n case \"ArrowLeft\":\n event.preventDefault();\n newIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n case \"Home\":\n event.preventDefault();\n newIndex = 0;\n break;\n case \"End\":\n event.preventDefault();\n newIndex = tabs.length - 1;\n break;\n default:\n return;\n }\n\n setActiveTab(newIndex);\n tabRefs.current[newIndex]?.focus();\n };\n\n return (\n <TabsContext.Provider value={{ activeTab, setActiveTab }}>\n <div className={styles.container}>\n <div\n role=\"tablist\"\n aria-label=\"Content tabs\"\n className={styles.tabList}\n >\n {tabs.map((tab, index) => {\n if (!React.isValidElement(tab)) return null;\n const title = tab.props.title || `Tab ${index + 1}`;\n const icon = tab.props.icon;\n const isActive = activeTab === index;\n\n return (\n <button\n key={index}\n ref={(el) => (tabRefs.current[index] = el)}\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`tabpanel-${index}`}\n id={`tab-${index}`}\n tabIndex={isActive ? 0 : -1}\n onClick={() => setActiveTab(index)}\n onKeyDown={(e) => handleKeyDown(e, index)}\n className={`${styles.tab} ${\n isActive ? styles.tabActive : styles.tabInactive\n }`}\n >\n <span className={styles.tabContent}>\n {icon && <span aria-hidden=\"true\">{icon}</span>}\n {title}\n </span>\n </button>\n );\n })}\n </div>\n\n <div className={`${styles.panelContainer} ${proseStyles.prose}`}>\n {tabs.map((tab, index) => (\n <div\n key={index}\n role=\"tabpanel\"\n id={`tabpanel-${index}`}\n aria-labelledby={`tab-${index}`}\n tabIndex={0}\n hidden={activeTab !== index}\n className={`${styles.panel} ${\n activeTab === index ? \"\" : styles.panelHidden\n }`}\n >\n {React.isValidElement(tab) ? tab.props.children : null}\n </div>\n ))}\n </div>\n </div>\n </TabsContext.Provider>\n );\n}\n"],"names":["TabsContext","React","Tabs","children","defaultTab","activeTab","setActiveTab","useState","tabRefs","useRef","tabs","useEffect","handleKeyDown","event","currentIndex","newIndex","_a","jsx","jsxs","styles","tab","index","title","icon","isActive","el","e","proseStyles"],"mappings":";;;;AAcO,MAAMA,IAAcC,EAAM,cAAgC;AAAA,EAC/D,WAAW;AAAA,EACX,cAAc,MAAM;AAAA,EAAC;AACvB,CAAC;AAEM,SAASC,EAAK,EAAE,UAAAC,GAAU,YAAAC,IAAa,KAAgB;AAC5D,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAASH,CAAU,GAC/CI,IAAUC,EAAqC,EAAE,GAEjDC,IAAOT,EAAM,SAAS,QAAQE,CAAQ;AAE5C,EAAAQ,EAAU,MAAM;AACd,IAAAH,EAAQ,UAAUA,EAAQ,QAAQ,MAAM,GAAGE,EAAK,MAAM;AAAA,EACxD,GAAG,CAACA,EAAK,MAAM,CAAC;AAEhB,QAAME,IAAgB,CAACC,GAA4BC,MAAyB;;AAC1E,QAAIC,IAAWD;AAEf,YAAQD,EAAM,KAAA;AAAA,MACZ,KAAK;AACH,QAAAA,EAAM,eAAA,GACNE,KAAYD,IAAe,KAAKJ,EAAK;AACrC;AAAA,MACF,KAAK;AACH,QAAAG,EAAM,eAAA,GACNE,KAAYD,IAAe,IAAIJ,EAAK,UAAUA,EAAK;AACnD;AAAA,MACF,KAAK;AACH,QAAAG,EAAM,eAAA,GACNE,IAAW;AACX;AAAA,MACF,KAAK;AACH,QAAAF,EAAM,eAAA,GACNE,IAAWL,EAAK,SAAS;AACzB;AAAA,MACF;AACE;AAAA,I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,IAAA;AAAA,IAGH,gBAAAJ,EAAC,OAAA,EAAI,WAAW,GAAGE,EAAO,cAAc,IAAIQ,EAAY,KAAK,IAC1D,UAAAjB,EAAK,IAAI,CAACU,GAAKC,MACd,gBAAAJ;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAK;AAAA,QACL,IAAI,YAAYI,CAAK;AAAA,QACrB,mBAAiB,OAAOA,CAAK;AAAA,QAC7B,UAAU;AAAA,QACV,QAAQhB,MAAcgB;AAAA,QACtB,WAAW,GAAGF,EAAO,KAAK,IACxBd,MAAcgB,IAAQ,KAAKF,EAAO,WACpC;AAAA,QAEC,YAAM,eAAeC,CAAG,IAAIA,EAAI,MAAM,WAAW;AAAA,MAAA;AAAA,MAV7CC;AAAA,IAAA,CAYR,EAAA,CACH;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const t = "_container_1099y_1", n = "_tabList_1099y_6", a = "_tab_1099y_6", e = "_tabActive_1099y_39", _ = "_tabInactive_1099y_49", o = "_tabContent_1099y_68", c = "_panelContainer_1099y_74", i = "_panel_1099y_74", s = "_panelHidden_1099y_81", b = {
|
|
2
|
+
container: t,
|
|
3
|
+
tabList: n,
|
|
4
|
+
tab: a,
|
|
5
|
+
tabActive: e,
|
|
6
|
+
tabInactive: _,
|
|
7
|
+
tabContent: o,
|
|
8
|
+
panelContainer: c,
|
|
9
|
+
panel: i,
|
|
10
|
+
panelHidden: s
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
t as container,
|
|
14
|
+
b as default,
|
|
15
|
+
i as panel,
|
|
16
|
+
c as panelContainer,
|
|
17
|
+
s as panelHidden,
|
|
18
|
+
a as tab,
|
|
19
|
+
e as tabActive,
|
|
20
|
+
o as tabContent,
|
|
21
|
+
_ as tabInactive,
|
|
22
|
+
n as tabList
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=tabs.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useRef as C, useEffect as Z, useMemo as d, createContext as h, useContext as w } from "react";
|
|
3
|
+
const u = h(
|
|
4
|
+
void 0
|
|
5
|
+
);
|
|
6
|
+
function f(t, i) {
|
|
7
|
+
const n = {};
|
|
8
|
+
return t.forEach((e) => {
|
|
9
|
+
i[e.id] ? n[e.id] = i[e.id] : e.pivots.length > 0 && (n[e.id] = e.pivots[0].id);
|
|
10
|
+
}), n;
|
|
11
|
+
}
|
|
12
|
+
function E({
|
|
13
|
+
groups: t,
|
|
14
|
+
children: i,
|
|
15
|
+
defaultPivots: n = {}
|
|
16
|
+
}) {
|
|
17
|
+
const [e, r] = m(
|
|
18
|
+
() => f(t, n)
|
|
19
|
+
), s = C("");
|
|
20
|
+
Z(() => {
|
|
21
|
+
const o = t.map((c) => c.id).sort().join(",");
|
|
22
|
+
o !== s.current && (s.current = o, r(f(t, n)));
|
|
23
|
+
}, [t, n]);
|
|
24
|
+
const v = d(() => new Set(Object.values(e)), [e]), P = (o, c) => {
|
|
25
|
+
r((a) => ({
|
|
26
|
+
...a,
|
|
27
|
+
[o]: c
|
|
28
|
+
}));
|
|
29
|
+
}, x = d(
|
|
30
|
+
() => ({
|
|
31
|
+
groups: t,
|
|
32
|
+
activePivots: v,
|
|
33
|
+
selectedPivots: e,
|
|
34
|
+
setActivePivot: P
|
|
35
|
+
}),
|
|
36
|
+
[t, v, e]
|
|
37
|
+
);
|
|
38
|
+
return /* @__PURE__ */ l(u.Provider, { value: x, children: i });
|
|
39
|
+
}
|
|
40
|
+
function b() {
|
|
41
|
+
const t = w(u);
|
|
42
|
+
if (!t)
|
|
43
|
+
throw new Error(
|
|
44
|
+
"useZonePivotContext must be used within a ZonePivotProvider"
|
|
45
|
+
);
|
|
46
|
+
return t;
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
E as ZonePivotProvider,
|
|
50
|
+
b as useZonePivotContext
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=zone-pivot-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone-pivot-context.js","sources":["../../../../src/components/content-components/zone-pivots/zone-pivot-context.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n useState,\n useMemo,\n useEffect,\n useRef,\n} from \"react\";\nimport type { ZonePivotGroup } from \"../../../types/page\";\n\ninterface ZonePivotContextValue {\n groups: ZonePivotGroup[];\n activePivots: Set<string>;\n selectedPivots: Record<string, string>;\n setActivePivot: (groupId: string, pivotId: string) => void;\n}\n\nconst ZonePivotContext = createContext<ZonePivotContextValue | undefined>(\n undefined\n);\n\nexport interface ZonePivotProviderProps {\n groups: ZonePivotGroup[];\n children: React.ReactNode;\n defaultPivots?: Record<string, string>;\n}\n\nfunction initializeSelectedPivots(\n groups: ZonePivotGroup[],\n defaultPivots: Record<string, string>\n): Record<string, string> {\n const initial: Record<string, string> = {};\n groups.forEach((group) => {\n if (defaultPivots[group.id]) {\n initial[group.id] = defaultPivots[group.id];\n } else if (group.pivots.length > 0) {\n initial[group.id] = group.pivots[0].id;\n }\n });\n return initial;\n}\n\nexport function ZonePivotProvider({\n groups,\n children,\n defaultPivots = {},\n}: ZonePivotProviderProps) {\n const [selectedPivots, setSelectedPivots] = useState<Record<string, string>>(\n () => initializeSelectedPivots(groups, defaultPivots)\n );\n\n const prevGroupIdsRef = useRef<string>(\"\");\n\n useEffect(() => {\n const currentGroupIds = groups\n .map((g) => g.id)\n .sort()\n .join(\",\");\n\n if (currentGroupIds !== prevGroupIdsRef.current) {\n prevGroupIdsRef.current = currentGroupIds;\n setSelectedPivots(initializeSelectedPivots(groups, defaultPivots));\n }\n }, [groups, defaultPivots]);\n\n const activePivots = useMemo(() => {\n return new Set(Object.values(selectedPivots));\n }, [selectedPivots]);\n\n const setActivePivot = (groupId: string, pivotId: string) => {\n setSelectedPivots((prev) => ({\n ...prev,\n [groupId]: pivotId,\n }));\n };\n\n const contextValue = useMemo(\n () => ({\n groups,\n activePivots,\n selectedPivots,\n setActivePivot,\n }),\n [groups, activePivots, selectedPivots]\n );\n\n return (\n <ZonePivotContext.Provider value={contextValue}>\n {children}\n </ZonePivotContext.Provider>\n );\n}\n\nexport function useZonePivotContext() {\n const context = useContext(ZonePivotContext);\n if (!context) {\n throw new Error(\n \"useZonePivotContext must be used within a ZonePivotProvider\"\n );\n }\n return context;\n}\n"],"names":["ZonePivotContext","createContext","initializeSelectedPivots","groups","defaultPivots","initial","group","ZonePivotProvider","children","selectedPivots","setSelectedPivots","useState","prevGroupIdsRef","useRef","useEffect","currentGroupIds","g","activePivots","useMemo","setActivePivot","groupId","pivotId","prev","contextValue","useZonePivotContext","context","useContext"],"mappings":";;AAiBA,MAAMA,IAAmBC;AAAA,EACvB;AACF;AAQA,SAASC,EACPC,GACAC,GACwB;AACxB,QAAMC,IAAkC,CAAA;AACxC,SAAAF,EAAO,QAAQ,CAACG,MAAU;AACxB,IAAIF,EAAcE,EAAM,EAAE,IACxBD,EAAQC,EAAM,EAAE,IAAIF,EAAcE,EAAM,EAAE,IACjCA,EAAM,OAAO,SAAS,MAC/BD,EAAQC,EAAM,EAAE,IAAIA,EAAM,OAAO,CAAC,EAAE;AAAA,EAExC,CAAC,GACMD;AACT;AAEO,SAASE,EAAkB;AAAA,EAChC,QAAAJ;AAAA,EACA,UAAAK;AAAA,EACA,eAAAJ,IAAgB,CAAA;AAClB,GAA2B;AACzB,QAAM,CAACK,GAAgBC,CAAiB,IAAIC;AAAA,IAC1C,MAAMT,EAAyBC,GAAQC,CAAa;AAAA,EAAA,GAGhDQ,IAAkBC,EAAe,EAAE;AAEzC,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAkBZ,EACrB,IAAI,CAACa,MAAMA,EAAE,EAAE,EACf,OACA,KAAK,GAAG;AAEX,IAAID,MAAoBH,EAAgB,YACtCA,EAAgB,UAAUG,GAC1BL,EAAkBR,EAAyBC,GAAQC,CAAa,CAAC;AAAA,EAErE,GAAG,CAACD,GAAQC,CAAa,CAAC;AAE1B,QAAMa,IAAeC,EAAQ,MACpB,IAAI,IAAI,OAAO,OAAOT,CAAc,CAAC,GAC3C,CAACA,CAAc,CAAC,GAEbU,IAAiB,CAACC,GAAiBC,MAAoB;AAC3D,IAAAX,EAAkB,CAACY,OAAU;AAAA,MAC3B,GAAGA;AAAA,MACH,CAACF,CAAO,GAAGC;AAAA,IAAA,EACX;AAAA,EACJ,GAEME,IAAeL;AAAA,IACnB,OAAO;AAAA,MACL,QAAAf;AAAA,MACA,cAAAc;AAAA,MACA,gBAAAR;AAAA,MACA,gBAAAU;AAAA,IAAA;AAAA,IAEF,CAAChB,GAAQc,GAAcR,CAAc;AAAA,EAAA;AAGvC,2BACGT,EAAiB,UAAjB,EAA0B,OAAOuB,GAC/B,UAAAf,GACH;AAEJ;AAEO,SAASgB,IAAsB;AACpC,QAAMC,IAAUC,EAAW1B,CAAgB;AAC3C,MAAI,CAACyB;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGJ,SAAOA;AACT;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p } from "react";
|
|
3
|
+
import { useZonePivotContext as w } from "./zone-pivot-context.js";
|
|
4
|
+
import s from "./zone-pivot-selector.module.css.js";
|
|
5
|
+
function I({
|
|
6
|
+
group: t,
|
|
7
|
+
className: m
|
|
8
|
+
}) {
|
|
9
|
+
var b;
|
|
10
|
+
const { activePivots: h, setActivePivot: r } = w(), l = p(null), f = (b = t.pivots.find((e) => h.has(e.id))) == null ? void 0 : b.id, x = t.pivots.findIndex((e) => e.id === f), u = (e) => {
|
|
11
|
+
var v;
|
|
12
|
+
const { key: i } = e, n = x;
|
|
13
|
+
let o = n;
|
|
14
|
+
switch (i) {
|
|
15
|
+
case "ArrowLeft":
|
|
16
|
+
case "ArrowUp":
|
|
17
|
+
e.preventDefault(), o = n > 0 ? n - 1 : t.pivots.length - 1;
|
|
18
|
+
break;
|
|
19
|
+
case "ArrowRight":
|
|
20
|
+
case "ArrowDown":
|
|
21
|
+
e.preventDefault(), o = n < t.pivots.length - 1 ? n + 1 : 0;
|
|
22
|
+
break;
|
|
23
|
+
case "Home":
|
|
24
|
+
e.preventDefault(), o = 0;
|
|
25
|
+
break;
|
|
26
|
+
case "End":
|
|
27
|
+
e.preventDefault(), o = t.pivots.length - 1;
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const d = t.pivots[o];
|
|
33
|
+
if (d) {
|
|
34
|
+
r(t.id, d.id);
|
|
35
|
+
const a = (v = l.current) == null ? void 0 : v.querySelector(
|
|
36
|
+
`[data-pivot-id="${d.id}"]`
|
|
37
|
+
);
|
|
38
|
+
a == null || a.focus();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ c("div", { className: m, "data-zone-pivot-group": t.id, children: /* @__PURE__ */ c(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
ref: l,
|
|
45
|
+
role: "tablist",
|
|
46
|
+
"aria-label": t.prompt,
|
|
47
|
+
className: s.container,
|
|
48
|
+
children: t.pivots.map((e) => {
|
|
49
|
+
const i = e.id === f;
|
|
50
|
+
return /* @__PURE__ */ c(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
id: `tab-${t.id}-${e.id}`,
|
|
54
|
+
role: "tab",
|
|
55
|
+
type: "button",
|
|
56
|
+
"data-pivot-id": e.id,
|
|
57
|
+
"aria-selected": i,
|
|
58
|
+
"aria-controls": `panel-${t.id}-${e.id}`,
|
|
59
|
+
tabIndex: i ? 0 : -1,
|
|
60
|
+
onClick: () => r(t.id, e.id),
|
|
61
|
+
onKeyDown: u,
|
|
62
|
+
className: `${s.button} ${i ? s.buttonSelected : s.buttonUnselected}`,
|
|
63
|
+
children: e.title
|
|
64
|
+
},
|
|
65
|
+
e.id
|
|
66
|
+
);
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
) });
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
I as ZonePivotSelector
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=zone-pivot-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone-pivot-selector.js","sources":["../../../../src/components/content-components/zone-pivots/zone-pivot-selector.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport { useZonePivotContext } from \"./zone-pivot-context\";\nimport type { ZonePivotGroup } from \"../../../types/page\";\nimport styles from \"./zone-pivot-selector.module.css\";\n\nexport interface ZonePivotSelectorProps {\n group: ZonePivotGroup;\n className?: string;\n}\n\nexport function ZonePivotSelector({\n group,\n className,\n}: ZonePivotSelectorProps) {\n const { activePivots, setActivePivot } = useZonePivotContext();\n const tabListRef = useRef<HTMLDivElement>(null);\n\n const selectedPivotId = group.pivots.find((p) => activePivots.has(p.id))?.id;\n const selectedIndex = group.pivots.findIndex((p) => p.id === selectedPivotId);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const { key } = event;\n const currentIndex = selectedIndex;\n let nextIndex = currentIndex;\n\n switch (key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n event.preventDefault();\n nextIndex =\n currentIndex > 0 ? currentIndex - 1 : group.pivots.length - 1;\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n event.preventDefault();\n nextIndex =\n currentIndex < group.pivots.length - 1 ? currentIndex + 1 : 0;\n break;\n case \"Home\":\n event.preventDefault();\n nextIndex = 0;\n break;\n case \"End\":\n event.preventDefault();\n nextIndex = group.pivots.length - 1;\n break;\n default:\n return;\n }\n\n const nextPivot = group.pivots[nextIndex];\n if (nextPivot) {\n setActivePivot(group.id, nextPivot.id);\n const button = tabListRef.current?.querySelector(\n `[data-pivot-id=\"${nextPivot.id}\"]`\n ) as HTMLButtonElement;\n button?.focus();\n }\n };\n\n return (\n <div className={className} data-zone-pivot-group={group.id}>\n <div\n ref={tabListRef}\n role=\"tablist\"\n aria-label={group.prompt}\n className={styles.container}\n >\n {group.pivots.map((pivot) => {\n const isSelected = pivot.id === selectedPivotId;\n return (\n <button\n key={pivot.id}\n id={`tab-${group.id}-${pivot.id}`}\n role=\"tab\"\n type=\"button\"\n data-pivot-id={pivot.id}\n aria-selected={isSelected}\n aria-controls={`panel-${group.id}-${pivot.id}`}\n tabIndex={isSelected ? 0 : -1}\n onClick={() => setActivePivot(group.id, pivot.id)}\n onKeyDown={handleKeyDown}\n className={`${styles.button} ${isSelected ? styles.buttonSelected : styles.buttonUnselected}`}\n >\n {pivot.title}\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n"],"names":["ZonePivotSelector","group","className","activePivots","setActivePivot","useZonePivotContext","tabListRef","useRef","selectedPivotId","_a","p","selectedIndex","handleKeyDown","event","key","currentIndex","nextIndex","nextPivot","button","jsx","styles","pivot","isSelected"],"mappings":";;;;AAUO,SAASA,EAAkB;AAAA,EAChC,OAAAC;AAAA,EACA,WAAAC;AACF,GAA2B;;AACzB,QAAM,EAAE,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAA,GACnCC,IAAaC,EAAuB,IAAI,GAExCC,KAAkBC,IAAAR,EAAM,OAAO,KAAK,CAACS,MAAMP,EAAa,IAAIO,EAAE,EAAE,CAAC,MAA/C,gBAAAD,EAAkD,IACpEE,IAAgBV,EAAM,OAAO,UAAU,CAACS,MAAMA,EAAE,OAAOF,CAAe,GAEtEI,IAAgB,CAACC,MAAkD;;AACvE,UAAM,EAAE,KAAAC,MAAQD,GACVE,IAAeJ;AACrB,QAAIK,IAAYD;AAEhB,YAAQD,GAAA;AAAA,MACN,KAAK;AAAA,MACL,KAAK;AACH,QAAAD,EAAM,eAAA,GACNG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ChD,WAAWT;AAAA,YACX,WAAW,GAAGQ,EAAO,MAAM,IAAIE,IAAaF,EAAO,iBAAiBA,EAAO,gBAAgB;AAAA,YAE1F,UAAAC,EAAM;AAAA,UAAA;AAAA,UAZFA,EAAM;AAAA,QAAA;AAAA,MAejB,CAAC;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const t = "_container_gmrx7_1", e = "_button_gmrx7_14", n = "_buttonSelected_gmrx7_35", o = "_buttonUnselected_gmrx7_46", c = {
|
|
2
|
+
container: t,
|
|
3
|
+
button: e,
|
|
4
|
+
buttonSelected: n,
|
|
5
|
+
buttonUnselected: o
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
e as button,
|
|
9
|
+
n as buttonSelected,
|
|
10
|
+
o as buttonUnselected,
|
|
11
|
+
t as container,
|
|
12
|
+
c as default
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=zone-pivot-selector.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone-pivot-selector.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useZonePivotContext as v } from "./zone-pivot-context.js";
|
|
3
|
+
function b({ pivot: t, target: e, children: a }) {
|
|
4
|
+
var s;
|
|
5
|
+
const { activePivots: d, groups: r } = v(), n = t.split(" ").map((o) => o.trim());
|
|
6
|
+
if (!n.some((o) => d.has(o))) return null;
|
|
7
|
+
const i = (s = r.find(
|
|
8
|
+
(o) => o.pivots.some((c) => n.includes(c.id))
|
|
9
|
+
)) == null ? void 0 : s.id, l = i ? `panel-${i}-${t}` : void 0;
|
|
10
|
+
return /* @__PURE__ */ p(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
role: "tabpanel",
|
|
14
|
+
id: l,
|
|
15
|
+
"aria-labelledby": i ? `tab-${i}-${t}` : void 0,
|
|
16
|
+
"data-zone-pivot": t,
|
|
17
|
+
...e ? { "data-zone-target": e } : {},
|
|
18
|
+
children: a
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
b as ZonePivot
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=zone-pivot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone-pivot.js","sources":["../../../../src/components/content-components/zone-pivots/zone-pivot.tsx"],"sourcesContent":["import React from \"react\";\nimport { useZonePivotContext } from \"./zone-pivot-context\";\n\nexport interface ZonePivotProps {\n pivot: string;\n target?: string;\n children: React.ReactNode;\n}\n\nexport function ZonePivot({ pivot, target, children }: ZonePivotProps) {\n const { activePivots, groups } = useZonePivotContext();\n\n const pivotIds = pivot.split(\" \").map((p) => p.trim());\n\n const isActive = pivotIds.some((pivotId) => activePivots.has(pivotId));\n\n if (!isActive) return null;\n\n const groupId = groups.find((g) =>\n g.pivots.some((p) => pivotIds.includes(p.id))\n )?.id;\n\n const panelId = groupId ? `panel-${groupId}-${pivot}` : undefined;\n\n return (\n <div\n role=\"tabpanel\"\n id={panelId}\n aria-labelledby={groupId ? `tab-${groupId}-${pivot}` : undefined}\n data-zone-pivot={pivot}\n {...(target ? { \"data-zone-target\": target } : {})}\n >\n {children}\n </div>\n );\n}\n"],"names":["ZonePivot","pivot","target","children","activePivots","groups","useZonePivotContext","pivotIds","p","pivotId","groupId","_a","g","panelId","jsx"],"mappings":";;AASO,SAASA,EAAU,EAAE,OAAAC,GAAO,QAAAC,GAAQ,UAAAC,KAA4B;;AACrE,QAAM,EAAE,cAAAC,GAAc,QAAAC,EAAA,IAAWC,EAAA,GAE3BC,IAAWN,EAAM,MAAM,GAAG,EAAE,IAAI,CAACO,MAAMA,EAAE,MAAM;AAIrD,MAAI,CAFaD,EAAS,KAAK,CAACE,MAAYL,EAAa,IAAIK,CAAO,CAAC,EAEtD,QAAO;AAEtB,QAAMC,KAAUC,IAAAN,EAAO;AAAA,IAAK,CAACO,MAC3BA,EAAE,OAAO,KAAK,CAACJ,MAAMD,EAAS,SAASC,EAAE,EAAE,CAAC;AAAA,EAAA,MAD9B,gBAAAG,EAEb,IAEGE,IAAUH,IAAU,SAASA,CAAO,IAAIT,CAAK,KAAK;AAExD,SACE,gBAAAa;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,IAAID;AAAA,MACJ,mBAAiBH,IAAU,OAAOA,CAAO,IAAIT,CAAK,KAAK;AAAA,MACvD,mBAAiBA;AAAA,MAChB,GAAIC,IAAS,EAAE,oBAAoBA,EAAA,IAAW,CAAA;AAAA,MAE9C,UAAAC;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone-target.js","sources":["../../../../src/components/content-components/zone-pivots/zone-target.tsx"],"sourcesContent":["import React from \"react\";\n\nexport interface ZoneTargetProps {\n target: string;\n children: React.ReactNode;\n}\n\nexport function ZoneTarget({ target, children }: ZoneTargetProps) {\n return <div data-zone-target={target}>{children}</div>;\n}\n"],"names":["ZoneTarget","target","children","jsx"],"mappings":";AAOO,SAASA,EAAW,EAAE,QAAAC,GAAQ,UAAAC,KAA6B;AAChE,SAAO,gBAAAC,EAAC,OAAA,EAAI,oBAAkBF,GAAS,UAAAC,EAAA,CAAS;AAClD;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { MDXProvider as m } from "@mdx-js/react";
|
|
3
|
+
import n from "./mdx-renderer.module.css.js";
|
|
4
|
+
import s from "./prose.module.css.js";
|
|
5
|
+
import { defaultComponents as p } from "./content-components/default-components.js";
|
|
6
|
+
function a({ children: r, components: e = {} }) {
|
|
7
|
+
const t = { ...p, ...e };
|
|
8
|
+
return /* @__PURE__ */ o("div", { className: `${n.container} ${s.prose}`, children: /* @__PURE__ */ o(m, { components: t, children: r }) });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
a as MDXRenderer
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=mdx-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx-renderer.js","sources":["../../src/components/mdx-renderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { MDXProvider } from \"@mdx-js/react\";\nimport { defaultComponents } from \"./content-components\";\nimport type { MDXComponents } from \"../types\";\nimport styles from \"./mdx-renderer.module.css\";\nimport proseStyles from \"./prose.module.css\";\n\ninterface MDXRendererProps {\n children: React.ReactNode;\n components?: MDXComponents;\n}\n\nexport function MDXRenderer({ children, components = {} }: MDXRendererProps) {\n const mergedComponents = { ...defaultComponents, ...components };\n\n return (\n <div className={`${styles.container} ${proseStyles.prose}`}>\n <MDXProvider components={mergedComponents}>{children}</MDXProvider>\n </div>\n );\n}\n"],"names":["MDXRenderer","children","components","mergedComponents","defaultComponents","jsx","styles","proseStyles","MDXProvider"],"mappings":";;;;;AAYO,SAASA,EAAY,EAAE,UAAAC,GAAU,YAAAC,IAAa,CAAA,KAAwB;AAC3E,QAAMC,IAAmB,EAAE,GAAGC,GAAmB,GAAGF,EAAA;AAEpD,SACE,gBAAAG,EAAC,OAAA,EAAI,WAAW,GAAGC,EAAO,SAAS,IAAIC,EAAY,KAAK,IACtD,UAAA,gBAAAF,EAACG,GAAA,EAAY,YAAYL,GAAmB,UAAAF,GAAS,GACvD;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx-renderer.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h } from "react";
|
|
3
|
+
import { DocumentRegular as p, CheckmarkFilled as v } from "@fluentui/react-icons";
|
|
4
|
+
import e from "./dropdown-menu.module.css.js";
|
|
5
|
+
function x({
|
|
6
|
+
dropdown: a,
|
|
7
|
+
isActive: c = !1,
|
|
8
|
+
activeHref: o,
|
|
9
|
+
className: l = ""
|
|
10
|
+
}) {
|
|
11
|
+
const [i, t] = h(!1), d = a.icon || p;
|
|
12
|
+
return /* @__PURE__ */ s("div", { className: `${e.container} ${l}`, children: [
|
|
13
|
+
/* @__PURE__ */ n(
|
|
14
|
+
"button",
|
|
15
|
+
{
|
|
16
|
+
onClick: () => t(!i),
|
|
17
|
+
"aria-expanded": i,
|
|
18
|
+
"aria-label": `${i ? "Collapse" : "Expand"} ${a.title} dropdown`,
|
|
19
|
+
className: `${e.button} ${c ? e.buttonActive : ""}`,
|
|
20
|
+
children: /* @__PURE__ */ s("div", { className: e.buttonContent, children: [
|
|
21
|
+
/* @__PURE__ */ n("div", { className: e.iconContainer, children: /* @__PURE__ */ n("div", { className: e.iconWrapper, children: /* @__PURE__ */ n(d, { className: e.icon }) }) }),
|
|
22
|
+
/* @__PURE__ */ s("div", { className: e.textContainer, children: [
|
|
23
|
+
/* @__PURE__ */ n("div", { className: e.title, children: a.title }),
|
|
24
|
+
/* @__PURE__ */ n("div", { className: e.description, children: a.description })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ n("div", { className: e.chevronContainer, children: /* @__PURE__ */ n(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
className: `${e.chevron} ${i ? e.chevronExpanded : e.chevronCollapsed}`,
|
|
30
|
+
fill: "none",
|
|
31
|
+
stroke: "currentColor",
|
|
32
|
+
viewBox: "0 0 24 24",
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
children: /* @__PURE__ */ n(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
37
|
+
strokeLinecap: "round",
|
|
38
|
+
strokeLinejoin: "round",
|
|
39
|
+
strokeWidth: 2,
|
|
40
|
+
d: "M19 9l-7 7-7-7"
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
) })
|
|
45
|
+
] })
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
i && a.items && a.items.length > 0 && /* @__PURE__ */ n("div", { className: e.dropdownContainer, children: /* @__PURE__ */ n("div", { className: e.dropdown, children: /* @__PURE__ */ n("div", { className: e.dropdownList, children: a.items.map((r, m) => /* @__PURE__ */ s(
|
|
49
|
+
"a",
|
|
50
|
+
{
|
|
51
|
+
href: r.href,
|
|
52
|
+
className: e.dropdownItem,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ s("div", { className: e.dropdownItemContent, children: [
|
|
55
|
+
r.icon && /* @__PURE__ */ n("div", { className: e.dropdownItemIconWrapper, children: /* @__PURE__ */ n(r.icon, { className: e.dropdownItemIcon }) }),
|
|
56
|
+
/* @__PURE__ */ n("span", { className: e.dropdownItemTitle, children: r.title })
|
|
57
|
+
] }),
|
|
58
|
+
r.href && o === r.href && /* @__PURE__ */ n(v, { className: e.checkmark })
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
`${r.href}-${m}`
|
|
62
|
+
)) }) }) })
|
|
63
|
+
] });
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
x as DropdownMenu
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=dropdown-menu.js.map
|