@mcurcio/patchbay 0.2.0 → 0.4.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/dist/composites.css +1 -0
- package/dist/composites.js +130 -0
- package/dist/composites.js.map +1 -0
- package/dist/primitives.css +1 -1
- package/dist/primitives.js +109 -50
- package/dist/primitives.js.map +1 -1
- package/dist/types/composites/banner/Banner.d.ts +17 -0
- package/dist/types/composites/banner/index.d.ts +2 -0
- package/dist/types/composites/diff-view/DiffView.d.ts +36 -0
- package/dist/types/composites/diff-view/index.d.ts +2 -0
- package/dist/types/composites/index.d.ts +3 -1
- package/dist/types/composites/status-words/StatusWords.d.ts +16 -0
- package/dist/types/composites/status-words/index.d.ts +2 -0
- package/dist/types/primitives/badge/Badge.d.ts +10 -3
- package/dist/types/primitives/badge/index.d.ts +1 -1
- package/dist/types/primitives/index.d.ts +1 -0
- package/dist/types/primitives/pill/Pill.d.ts +1 -1
- package/dist/types/primitives/radio-group/RadioGroup.d.ts +33 -0
- package/dist/types/primitives/radio-group/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pb-banner{box-sizing:border-box;align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-3) var(--pb-space-4);border:1px solid var(--pb-line);border-inline-start:3px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);background:var(--pb-raised);color:var(--pb-text);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);flex-wrap:wrap;display:flex}.pb-banner[data-tone=ok]{border-inline-start-color:var(--pb-ok)}.pb-banner[data-tone=warn]{border-inline-start-color:var(--pb-warn);background:var(--pb-warn-soft)}.pb-banner[data-tone=err]{border-inline-start-color:var(--pb-err);background:var(--pb-err-soft)}.pb-banner[data-tone=quiet]{border-inline-start-color:var(--pb-quiet)}.pb-banner[data-tone=off]{border-inline-start-color:var(--pb-off)}.pb-banner-text{flex:12em;min-width:0}.pb-banner-actions{gap:var(--pb-space-3);flex-wrap:wrap;display:flex}.pb-button.pb-banner-dismiss{color:var(--pb-text);flex:none;margin-inline-start:auto}@media (forced-colors:active){.pb-banner{border-inline-start-color:canvastext}}.pb-diff{gap:var(--pb-space-3);min-width:0;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);display:grid}.pb-diff-file{gap:var(--pb-space-2);min-width:0;display:grid}.pb-diff-file-title{font-size:var(--pb-text-md);margin:0;font-weight:600}.pb-diff-toggle{box-sizing:border-box;align-items:center;gap:var(--pb-space-2);max-width:100%;min-height:28px;padding:0 var(--pb-space-2);border-radius:var(--pb-radius-control);color:var(--pb-text);font:inherit;text-align:start;overflow-wrap:anywhere;cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;border:0;display:inline-flex}.pb-diff-toggle:hover{background:var(--pb-sunken)}.pb-diff-toggle:focus-visible{outline:2px solid var(--pb-accent);outline-offset:0}.pb-diff-chevron{color:var(--pb-muted);transition:transform var(--pb-motion-fast) ease-out;flex:none}.pb-diff-file[data-open] .pb-diff-chevron{transform:rotate(90deg)}.pb-diff-body{padding:var(--pb-space-3) 0;border:1px solid var(--pb-code-border);border-radius:var(--pb-radius-control);background:var(--pb-code-surface);color:var(--pb-code-text);font-family:var(--pb-font-code);font-size:var(--pb-code-size);margin:0;line-height:1.5;overflow-x:auto}.pb-diff-body[hidden]{display:none}.pb-diff-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-diff-code{min-width:100%;font:inherit;display:inline-block}.pb-diff-line{padding:0 var(--pb-space-4) 0 var(--pb-space-3);white-space:pre;border-inline-start:3px solid #0000;display:block}.pb-diff-line[data-kind=add]{color:var(--pb-added);border-inline-start-color:currentColor}.pb-diff-line[data-kind=del]{color:var(--pb-removed);border-inline-start-color:currentColor}.pb-diff-line[data-kind=hunk]{color:var(--pb-code-directive)}.pb-diff-line[data-kind=meta],.pb-diff-line[data-kind=note]{color:var(--pb-code-comment)}@media (hover:none) and (pointer:coarse){.pb-diff-toggle{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-diff-line[data-kind=add],.pb-diff-line[data-kind=del]{border-inline-start-color:canvastext}}.pb-status-words{font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);flex-wrap:wrap;align-items:baseline;margin:0;padding:0;list-style:none;display:inline-flex}.pb-status-word{color:var(--pb-muted);white-space:nowrap;font-weight:600}.pb-status-word+.pb-status-word:before{content:"·" / "";padding:0 var(--pb-space-2);color:var(--pb-muted);font-weight:400}.pb-status-word[data-tone=ok]{color:var(--pb-ok)}.pb-status-word[data-tone=warn]{color:var(--pb-warn)}.pb-status-word[data-tone=err]{color:var(--pb-err)}.pb-status-word[data-tone=quiet]{color:var(--pb-quiet)}.pb-status-word[data-tone=off]{color:var(--pb-off)}
|
package/dist/composites.js
CHANGED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import "./composites.css";import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { useId as n, useState as r } from "react";
|
|
3
|
+
import { IconButton as i } from "./primitives.js";
|
|
4
|
+
// src/composites/banner/Banner.tsx
|
|
5
|
+
function a({ tone: n, children: r, actions: a, onDismiss: o, dismissLabel: s = "Dismiss", className: c, ...l }) {
|
|
6
|
+
return /* @__PURE__ */ t("div", {
|
|
7
|
+
...l,
|
|
8
|
+
role: n === "err" ? "alert" : "status",
|
|
9
|
+
className: c === void 0 ? "pb-banner" : `pb-banner ${c}`,
|
|
10
|
+
"data-tone": n,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ e("div", {
|
|
13
|
+
className: "pb-banner-text",
|
|
14
|
+
children: r
|
|
15
|
+
}),
|
|
16
|
+
a !== void 0 && /* @__PURE__ */ e("div", {
|
|
17
|
+
className: "pb-banner-actions",
|
|
18
|
+
children: a
|
|
19
|
+
}),
|
|
20
|
+
o !== void 0 && /* @__PURE__ */ e(i, {
|
|
21
|
+
className: "pb-banner-dismiss",
|
|
22
|
+
size: "sm",
|
|
23
|
+
label: s,
|
|
24
|
+
onClick: o,
|
|
25
|
+
children: /* @__PURE__ */ e("svg", {
|
|
26
|
+
viewBox: "0 0 16 16",
|
|
27
|
+
width: "12",
|
|
28
|
+
height: "12",
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
children: /* @__PURE__ */ e("path", {
|
|
31
|
+
d: "M3 3l10 10M13 3L3 13",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: "1.75"
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// src/composites/diff-view/DiffView.tsx
|
|
42
|
+
function o(e) {
|
|
43
|
+
return e.startsWith("+++ ") || e.startsWith("--- ") ? "meta" : e.startsWith("@@") ? "hunk" : e.startsWith("+") ? "add" : e.startsWith("-") ? "del" : e.startsWith("\\") ? "note" : e === "" || e.startsWith(" ") ? "context" : "meta";
|
|
44
|
+
}
|
|
45
|
+
function s(e) {
|
|
46
|
+
return e.split("/").filter((e) => e !== "").at(-1) ?? e;
|
|
47
|
+
}
|
|
48
|
+
function c(e) {
|
|
49
|
+
let t = e.split(/\r?\n/);
|
|
50
|
+
return t.length > 0 && t.at(-1) === "" && t.pop(), t;
|
|
51
|
+
}
|
|
52
|
+
function l({ text: t, id: n, hidden: r }) {
|
|
53
|
+
return /* @__PURE__ */ e("pre", {
|
|
54
|
+
className: "pb-diff-body",
|
|
55
|
+
id: n,
|
|
56
|
+
hidden: r,
|
|
57
|
+
tabIndex: 0,
|
|
58
|
+
children: /* @__PURE__ */ e("code", {
|
|
59
|
+
className: "pb-diff-code",
|
|
60
|
+
children: c(t).map((t, n) => /* @__PURE__ */ e("span", {
|
|
61
|
+
className: "pb-diff-line",
|
|
62
|
+
"data-kind": o(t),
|
|
63
|
+
children: t === "" ? " " : t
|
|
64
|
+
}, n))
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function u({ diff: i, files: a, level: o = 3, collapsed: c, onToggle: u, className: d, ...f }) {
|
|
69
|
+
let p = n(), [m, h] = r([]), g = c ?? m, _ = `h${String(o)}`, v = (e, t) => {
|
|
70
|
+
c === void 0 && h((n) => t ? n.filter((t) => t !== e) : [...n, e]), u?.(e, t);
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ e("div", {
|
|
73
|
+
...f,
|
|
74
|
+
className: d === void 0 ? "pb-diff" : `pb-diff ${d}`,
|
|
75
|
+
children: a === void 0 ? /* @__PURE__ */ e(l, { text: i }) : a.map((n, r) => {
|
|
76
|
+
let i = !g.includes(n.path), a = `${p}-${String(r)}`;
|
|
77
|
+
return /* @__PURE__ */ t("div", {
|
|
78
|
+
className: "pb-diff-file",
|
|
79
|
+
"data-open": i || void 0,
|
|
80
|
+
children: [/* @__PURE__ */ e(_, {
|
|
81
|
+
className: "pb-diff-file-title",
|
|
82
|
+
children: /* @__PURE__ */ t("button", {
|
|
83
|
+
type: "button",
|
|
84
|
+
className: "pb-diff-toggle",
|
|
85
|
+
"aria-expanded": i,
|
|
86
|
+
"aria-controls": a,
|
|
87
|
+
title: n.path,
|
|
88
|
+
onClick: () => {
|
|
89
|
+
v(n.path, !i);
|
|
90
|
+
},
|
|
91
|
+
children: [/* @__PURE__ */ e("svg", {
|
|
92
|
+
className: "pb-diff-chevron",
|
|
93
|
+
viewBox: "0 0 16 16",
|
|
94
|
+
width: "10",
|
|
95
|
+
height: "10",
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
children: /* @__PURE__ */ e("path", {
|
|
98
|
+
d: "M5 3l5 5-5 5",
|
|
99
|
+
fill: "none",
|
|
100
|
+
stroke: "currentColor",
|
|
101
|
+
strokeWidth: "2"
|
|
102
|
+
})
|
|
103
|
+
}), s(n.path)]
|
|
104
|
+
})
|
|
105
|
+
}), /* @__PURE__ */ e(l, {
|
|
106
|
+
text: n.diff,
|
|
107
|
+
id: a,
|
|
108
|
+
hidden: !i
|
|
109
|
+
})]
|
|
110
|
+
}, n.path);
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// src/composites/status-words/StatusWords.tsx
|
|
115
|
+
function d({ items: t, className: n, ...r }) {
|
|
116
|
+
return /* @__PURE__ */ e("ul", {
|
|
117
|
+
"aria-live": "polite",
|
|
118
|
+
...r,
|
|
119
|
+
className: n === void 0 ? "pb-status-words" : `pb-status-words ${n}`,
|
|
120
|
+
children: t.map((t, n) => /* @__PURE__ */ e("li", {
|
|
121
|
+
className: "pb-status-word",
|
|
122
|
+
"data-tone": t.tone,
|
|
123
|
+
title: t.title,
|
|
124
|
+
children: t.label
|
|
125
|
+
}, `${String(n)}:${t.label}`))
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
export { a as Banner, u as DiffView, d as StatusWords };
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=composites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composites.js","names":["Banner","rest","tone","className","actions","onDismiss","IconButton","dismissLabel","diffLineKind","line","baseName","path","part","lines","all","text","DiffBody","index","DiffView","base","useId","ownCollapsed","setOwnCollapsed","useState","folded","collapsed","Heading","level","toggle","open","was","other","onToggle","files","diff","file","bodyId","StatusWords","items","item"],"sources":["../src/composites/banner/Banner.tsx","../src/composites/diff-view/DiffView.tsx","../src/composites/status-words/StatusWords.tsx"],"sourcesContent":["// A banner: a line of news across the top of a pane or page (a conflict, a lost connection, a refused edit), drawn in\n// its tone, with the app's actions at its end and, if the app lets it go, a close button. An error is an alert, so a\n// screen reader reads it at once; every other tone is a status, read when the reader is free. A tone it does not know\n// is drawn neutrally.\nimport type { ComponentPropsWithRef, ReactNode } from \"react\";\nimport { IconButton } from \"../../primitives\";\nimport \"./Banner.css\";\n\n/** The tones a banner draws; any other string is drawn neutrally. */\nexport type BannerTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type BannerProps = Omit<ComponentPropsWithRef<\"div\">, \"role\"> & {\n /** What the news is, by colour: the stripe's, and the surface's for warn and err. */\n tone: BannerTone;\n /** The news, in words. */\n children: ReactNode;\n /** A slot at the end: the buttons that act on the news. */\n actions?: ReactNode;\n /** Shows a close button, which asks the app to take the banner away. */\n onDismiss?: () => void;\n /** The close button's name, \"Dismiss\" by default. */\n dismissLabel?: string;\n};\n\nexport function Banner({\n tone,\n children,\n actions,\n onDismiss,\n dismissLabel = \"Dismiss\",\n className,\n ...rest\n}: BannerProps) {\n return (\n <div\n {...rest}\n role={tone === \"err\" ? \"alert\" : \"status\"}\n className={className === undefined ? \"pb-banner\" : `pb-banner ${className}`}\n data-tone={tone}\n >\n <div className=\"pb-banner-text\">{children}</div>\n {actions !== undefined && <div className=\"pb-banner-actions\">{actions}</div>}\n {onDismiss !== undefined && (\n <IconButton className=\"pb-banner-dismiss\" size=\"sm\" label={dismissLabel} onClick={onDismiss}>\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\">\n <path d=\"M3 3l10 10M13 3L3 13\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" />\n </svg>\n </IconButton>\n )}\n </div>\n );\n}\n","// A diff: unified diff text drawn line by line, added lines in the added tone and removed ones in the removed tone,\n// each keeping its \"+\" or \"-\" so the change never rests on colour alone. Given files, each is a section of its own\n// under a heading, labelled by its file name with its whole path on hover, that the person can fold away.\nimport { useId, useState, type ComponentPropsWithRef } from \"react\";\nimport \"./DiffView.css\";\n\nexport type DiffFile = {\n /** The file's path; the section is labelled by its last part. Unique among the files. */\n path: string;\n /** The file's unified diff text. */\n diff: string;\n};\n\n/** What a line of unified diff text is, by its start. */\nexport type DiffLineKind = \"add\" | \"del\" | \"hunk\" | \"meta\" | \"note\" | \"context\";\n\ntype DiffSource =\n | {\n /** One unified diff, drawn whole without a heading. */\n diff: string;\n files?: never;\n }\n | {\n /** One section per file, in this order. */\n files: readonly DiffFile[];\n diff?: never;\n };\n\nexport type DiffViewProps = Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"onToggle\"> &\n DiffSource & {\n /** The files' headings' level, h2 to h6 (h3 by default). */\n level?: 2 | 3 | 4 | 5 | 6;\n /**\n * The paths of the files folded away. Given, the app holds them and onToggle asks it to change them; left out,\n * the view keeps its own, every file open at first.\n */\n collapsed?: readonly string[];\n /** Called when the person opens (true) or folds (false) a file's section. */\n onToggle?: (path: string, open: boolean) => void;\n };\n\n/** The kind of one line of unified diff text. */\nexport function diffLineKind(line: string): DiffLineKind {\n if (line.startsWith(\"+++ \") || line.startsWith(\"--- \")) return \"meta\";\n if (line.startsWith(\"@@\")) return \"hunk\";\n if (line.startsWith(\"+\")) return \"add\";\n if (line.startsWith(\"-\")) return \"del\";\n if (line.startsWith(\"\\\\\")) return \"note\";\n if (line === \"\" || line.startsWith(\" \")) return \"context\";\n // A git header line: diff --git, index, new file mode, rename from, similarity index and the like.\n return \"meta\";\n}\n\n/** A path's last part: \"src/app/main.ts\" is \"main.ts\". */\nexport function baseName(path: string): string {\n const parts = path.split(\"/\").filter((part) => part !== \"\");\n return parts.at(-1) ?? path;\n}\n\nfunction lines(text: string): string[] {\n const all = text.split(/\\r?\\n/);\n // A diff ends with a newline, which starts no line of its own.\n if (all.length > 0 && all.at(-1) === \"\") all.pop();\n return all;\n}\n\nfunction DiffBody({ text, id, hidden }: { text: string; id?: string; hidden?: boolean }) {\n return (\n // Focusable, so a wide diff can be scrolled sideways from the keyboard.\n <pre className=\"pb-diff-body\" id={id} hidden={hidden} tabIndex={0}>\n <code className=\"pb-diff-code\">\n {lines(text).map((line, index) => (\n <span key={index} className=\"pb-diff-line\" data-kind={diffLineKind(line)}>\n {line === \"\" ? \" \" : line}\n </span>\n ))}\n </code>\n </pre>\n );\n}\n\nexport function DiffView({ diff, files, level = 3, collapsed, onToggle, className, ...rest }: DiffViewProps) {\n const base = useId();\n const [ownCollapsed, setOwnCollapsed] = useState<readonly string[]>([]);\n const folded = collapsed ?? ownCollapsed;\n const Heading = `h${String(level)}` as \"h3\";\n const toggle = (path: string, open: boolean) => {\n if (collapsed === undefined) {\n setOwnCollapsed((was) => (open ? was.filter((other) => other !== path) : [...was, path]));\n }\n onToggle?.(path, open);\n };\n return (\n <div {...rest} className={className === undefined ? \"pb-diff\" : `pb-diff ${className}`}>\n {files === undefined ? (\n <DiffBody text={diff} />\n ) : (\n files.map((file, index) => {\n const open = !folded.includes(file.path);\n const bodyId = `${base}-${String(index)}`;\n return (\n <div key={file.path} className=\"pb-diff-file\" data-open={open || undefined}>\n <Heading className=\"pb-diff-file-title\">\n <button\n type=\"button\"\n className=\"pb-diff-toggle\"\n aria-expanded={open}\n aria-controls={bodyId}\n title={file.path}\n onClick={() => {\n toggle(file.path, !open);\n }}\n >\n <svg className=\"pb-diff-chevron\" viewBox=\"0 0 16 16\" width=\"10\" height=\"10\" aria-hidden=\"true\">\n <path d=\"M5 3l5 5-5 5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" />\n </svg>\n {baseName(file.path)}\n </button>\n </Heading>\n <DiffBody text={file.diff} id={bodyId} hidden={!open} />\n </div>\n );\n })\n )}\n </div>\n );\n}\n","// Status words: a short row of states, each a word in its tone (a pane's \"3 errors · 1 warning · saved\"), in the order\n// the app gives, which is most urgent first. The row is one polite live region, so a screen reader reads a change\n// when it is free. A tone it does not know is drawn neutrally.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./StatusWords.css\";\n\n/** The tones a word draws; any other string is drawn neutrally. */\nexport type StatusWordTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type StatusWord = {\n tone: StatusWordTone;\n /** The state in words. */\n label: string;\n /** Shown on hover: what the state means or why it is so. */\n title?: string;\n};\n\nexport type StatusWordsProps = Omit<ComponentPropsWithRef<\"ul\">, \"children\"> & {\n /** The states, most urgent first; drawn in this order. */\n items: readonly StatusWord[];\n};\n\nexport function StatusWords({ items, className, ...rest }: StatusWordsProps) {\n return (\n <ul\n aria-live=\"polite\"\n {...rest}\n className={className === undefined ? \"pb-status-words\" : `pb-status-words ${className}`}\n >\n {items.map((item, index) => (\n <li key={`${String(index)}:${item.label}`} className=\"pb-status-word\" data-tone={item.tone} title={item.title}>\n {item.label}\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;AAwBA,SAAgBA,EAAO,EACrB,SACA,aACA,YACA,cACA,kBAAe,WACf,cACA,GAAGC,KACW;CACd,OACE,kBAAC,OAAD;EACE,GAAIA;EACJ,MAAMC,MAAS,QAAQ,UAAU;EACjC,WAAWC,MAAc,KAAA,IAAY,cAAc,aAAaA;EAChE,aAAWD;EAJb,UAAA;GAME,kBAAC,OAAD;IAAK,WAAU;IAAkB;GAAc,CAAA;GAC9CE,MAAY,KAAA,KAAa,kBAAC,OAAD;IAAK,WAAU;IAAqB,UAAAA;GAAa,CAAA;GAC1EC,MAAc,KAAA,KACb,kBAACC,GAAD;IAAY,WAAU;IAAoB,MAAK;IAAK,OAAOC;IAAc,SAASF;IAChF,UAAA,kBAAC,OAAD;KAAK,SAAQ;KAAY,OAAM;KAAK,QAAO;KAAK,eAAY;KAC1D,UAAA,kBAAC,QAAD;MAAM,GAAE;MAAuB,MAAK;MAAO,QAAO;MAAe,aAAY;KAAQ,CAAA;IAClF,CAAA;GACK,CAAA;EAEX;;AAET;;ACTA,SAAgBG,EAAa,GAA4B;CAQvD,OAPIC,EAAK,WAAW,MAAM,KAAKA,EAAK,WAAW,MAAM,IAAU,SAC3DA,EAAK,WAAW,IAAI,IAAU,SAC9BA,EAAK,WAAW,GAAG,IAAU,QAC7BA,EAAK,WAAW,GAAG,IAAU,QAC7BA,EAAK,WAAW,IAAI,IAAU,SAC9BA,MAAS,MAAMA,EAAK,WAAW,GAAG,IAAU,YAEzC;AACT;AAGA,SAAgBC,EAAS,GAAsB;CAE7C,OADcC,EAAK,MAAM,GAAG,CAAC,CAAC,QAAQ,MAASC,MAAS,EACjD,CAAA,CAAM,GAAG,EAAE,KAAKD;AACzB;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,KAAQ,KAAA;IAAjE,UAAA,CACE,kBAACH,GAAD;KAAS,WAAU;KACjB,UAAA,kBAAC,UAAD;MACE,MAAK;MACL,WAAU;MACV,iBAAeG;MACf,iBAAeO;MACf,OAAOD,EAAK;MACZ,eAAe;OACb,EAAOA,EAAK,MAAM,CAACN,CAAI;MACzB;MARF,UAAA,CAUE,kBAAC,OAAD;OAAK,WAAU;OAAkB,SAAQ;OAAY,OAAM;OAAK,QAAO;OAAK,eAAY;OACtF,UAAA,kBAAC,QAAD;QAAM,GAAE;QAAe,MAAK;QAAO,QAAO;QAAe,aAAY;OAAK,CAAA;MACvE,CAAA,GACJnB,EAASyB,EAAK,IAAI,CACb;;IACD,CAAA,GACT,kBAACnB,GAAD;KAAU,MAAMmB,EAAK;KAAM,IAAIC;KAAQ,QAAQ,CAACP;IAAO,CAAA,CACpD;GAnBK,GAAAM,EAAK,IAmBV;EAET,CAAC;CAEA,CAAA;AAET;;ACxGA,SAAgBE,EAAY,EAAE,UAAO,cAAW,GAAGpC,KAA0B;CAC3E,OACE,kBAAC,MAAD;EACE,aAAU;EACV,GAAIA;EACJ,WAAWE,MAAc,KAAA,IAAY,oBAAoB,mBAAmBA;EAE3E,UAAAmC,EAAM,KAAK,GAAM,MAChB,kBAAC,MAAD;GAA2C,WAAU;GAAiB,aAAWC,EAAK;GAAM,OAAOA,EAAK;GACrG,UAAAA,EAAK;EACJ,GAFK,GAAG,OAAOtB,CAAK,EAAE,GAAGsB,EAAK,OAE9B,CACL;CACC,CAAA;AAER"}
|
package/dist/primitives.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pb-badge{box-sizing:border-box;align-items:center;gap:var(--pb-space-2);border:1px solid var(--pb-line);border-radius:var(--pb-radius-pill);background:var(--pb-sunken);color:var(--pb-muted);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);white-space:nowrap;padding:0 6px;font-weight:600;line-height:18px;display:inline-flex}.pb-badge[data-tone=ok]{color:var(--pb-ok);border-color:currentColor}.pb-badge[data-tone=warn]{background:var(--pb-warn-soft);color:var(--pb-warn);border-color:currentColor}.pb-badge[data-tone=err]{background:var(--pb-err-soft);color:var(--pb-err);border-color:currentColor}.pb-badge[data-tone=quiet]{color:var(--pb-quiet);border-color:currentColor}.pb-badge[data-tone=off]{color:var(--pb-off)}.pb-spinner:not(.pb-spinner-labelled),.pb-spinner-ring{box-sizing:border-box;vertical-align:-.1em;border-radius:var(--pb-radius-pill);width:.8em;height:.8em;animation:pb-spin var(--pb-motion-spin) linear infinite;border:2px solid;border-right-color:#0000;display:inline-block}.pb-spinner-labelled{align-items:center;display:inline-flex}.pb-spinner-label{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@keyframes pb-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.pb-spinner:not(.pb-spinner-labelled),.pb-spinner-ring{animation:none}}.pb-button{justify-content:center;align-items:center;gap:var(--pb-space-2);box-sizing:border-box;min-height:28px;padding:0 var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast), border-color var(--pb-motion-fast), color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;margin:0;line-height:1.2;display:inline-flex;position:relative}.pb-button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-button:hover:not(:disabled,[aria-busy=true]){background:var(--pb-sunken)}.pb-button[aria-pressed=true]{color:var(--pb-accent);background:var(--pb-sunken)}.pb-button[data-tone=primary]{color:var(--pb-on-strong);background:var(--pb-accent);border-color:var(--pb-accent)}.pb-button[data-tone=primary]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-accent-hover)}.pb-button[data-tone=danger]{color:var(--pb-err)}.pb-button[data-tone=danger]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-err-soft);border-color:var(--pb-err)}.pb-button:disabled{color:var(--pb-muted);background:var(--pb-raised);border-color:var(--pb-line);cursor:default}.pb-button[aria-busy=true]{cursor:progress}.pb-button[data-size=sm]{min-height:var(--pb-row);padding:0 var(--pb-space-2);font-size:var(--pb-text-sm)}.pb-button-content{align-items:center;gap:var(--pb-space-2);display:inline-flex}.pb-button[aria-busy=true]>.pb-button-content{opacity:0}.pb-button>.pb-button-spinner{margin:auto;position:absolute;inset:0}@media (hover:none) and (pointer:coarse){.pb-button,.pb-button[data-size=sm]{min-height:36px}}@media (forced-colors:active){.pb-button{border-color:buttontext}.pb-button:disabled{color:graytext;border-color:graytext}}.pb-checkbox{width:16px;height:16px;accent-color:var(--pb-accent);cursor:pointer;flex:none;margin:0}.pb-checkbox:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-checkbox[aria-invalid=true]:not(:focus-visible){outline:1px solid var(--pb-err);outline-offset:1px}.pb-checkbox:disabled{cursor:default}.pb-checkbox-row{align-items:center;gap:var(--pb-space-3);min-height:28px;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);cursor:pointer;-webkit-tap-highlight-color:transparent;display:inline-flex}.pb-checkbox-row[data-disabled]{color:var(--pb-muted);cursor:default}@media (hover:none) and (pointer:coarse){.pb-checkbox{width:20px;height:20px}.pb-checkbox-row{min-height:36px;font-size:16px}}.pb-button.pb-icon-button{background:0 0;border-color:#0000;width:28px;min-width:28px;height:28px;padding:0}.pb-button.pb-icon-button[data-size=sm]{width:var(--pb-row);min-width:var(--pb-row);height:var(--pb-row)}.pb-button.pb-icon-button:hover:not(:disabled,[aria-busy=true]),.pb-button.pb-icon-button[aria-pressed=true]{background:var(--pb-sunken)}.pb-button.pb-icon-button[data-tone=primary]{background:var(--pb-accent);border-color:var(--pb-accent)}.pb-button.pb-icon-button[data-tone=primary]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-accent-hover)}.pb-button.pb-icon-button[data-tone=danger]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-err-soft);border-color:var(--pb-err)}.pb-button.pb-icon-button:disabled{background:0 0;border-color:#0000}.pb-icon-button-glyph{justify-content:center;align-items:center;font-size:1.15em;line-height:1;display:inline-flex}@media (hover:none) and (pointer:coarse){.pb-button.pb-icon-button,.pb-button.pb-icon-button[data-size=sm]{width:36px;min-width:36px;height:36px}}@media (forced-colors:active){.pb-button.pb-icon-button{border-color:#0000}.pb-button.pb-icon-button[aria-pressed=true]{border-color:highlight}}.pb-dialog-scrim{z-index:100;box-sizing:border-box;padding:max(10vh, env(safe-area-inset-top)) max(var(--pb-space-5), env(safe-area-inset-right)) max(var(--pb-space-5), env(safe-area-inset-bottom)) max(var(--pb-space-5), env(safe-area-inset-left));background:var(--pb-scrim);animation:pb-dialog-fade var(--pb-motion-fast) ease-out;justify-content:center;align-items:flex-start;display:flex;position:fixed;inset:0}.pb-dialog{box-sizing:border-box;width:min(520px,100%);max-height:100%;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line);border-radius:var(--pb-radius-box);box-shadow:var(--pb-shadow-lifted);animation:pb-dialog-rise var(--pb-motion-slow) ease-out;flex-direction:column;display:flex}.pb-dialog:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-dialog-head{align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-4) var(--pb-space-4) var(--pb-space-3) var(--pb-space-5);display:flex}.pb-dialog-title{min-width:0;font-size:var(--pb-text-md);flex:auto;margin:0;font-weight:600}.pb-button.pb-dialog-close{color:var(--pb-muted);flex:none}.pb-button.pb-dialog-close:hover{color:var(--pb-text)}.pb-dialog-body{min-height:0;padding:0 var(--pb-space-5) var(--pb-space-5);flex:auto;overflow:auto}.pb-dialog-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-dialog-actions{justify-content:flex-end;gap:var(--pb-space-3);padding:var(--pb-space-4) var(--pb-space-5);border-top:1px solid var(--pb-line);flex-wrap:wrap;display:flex}@keyframes pb-dialog-fade{0%{opacity:0}}@keyframes pb-dialog-rise{0%{opacity:0;transform:translateY(var(--pb-space-3))}}@media (max-width:599px){.pb-dialog-scrim{padding-top:max(var(--pb-space-5), env(safe-area-inset-top));padding-right:max(var(--pb-space-4), env(safe-area-inset-right));padding-left:max(var(--pb-space-4), env(safe-area-inset-left))}}@media (prefers-reduced-motion:reduce){.pb-dialog-scrim,.pb-dialog{animation:none}}.pb-field{gap:var(--pb-space-2);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);grid-template-columns:minmax(0,1fr);display:grid}.pb-field[data-layout=inline]{column-gap:var(--pb-space-4);grid-template-columns:130px minmax(0,1fr);align-items:baseline}.pb-field-label{color:var(--pb-text)}.pb-field-control{gap:var(--pb-space-2);min-width:0;display:grid}.pb-field-hint{font-size:var(--pb-text-sm);color:var(--pb-muted)}.pb-field-error{font-size:var(--pb-text-sm);color:var(--pb-err)}.pb-key-value{box-sizing:border-box;gap:var(--pb-space-1) var(--pb-space-4);color:var(--pb-text);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);grid-template-columns:max-content minmax(0,1fr);margin:0;display:grid}.pb-key-value-row{display:contents}.pb-key-value dt{color:var(--pb-muted)}.pb-key-value dd{font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0;margin:0}.pb-key-value-row[data-tone=ok] dd{color:var(--pb-ok)}.pb-key-value-row[data-tone=warn] dd{color:var(--pb-warn)}.pb-key-value-row[data-tone=err] dd{color:var(--pb-err)}.pb-key-value-row[data-tone=quiet] dd{color:var(--pb-quiet)}.pb-key-value-row[data-tone=off] dd{color:var(--pb-off)}.pb-panel{box-sizing:border-box;min-height:0;max-height:100%;color:var(--pb-text);background:var(--pb-raised);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);flex-direction:column;display:flex}.pb-panel-header{align-items:center;gap:var(--pb-space-3);box-sizing:border-box;min-height:var(--pb-bar);padding:var(--pb-space-3) var(--pb-space-4);border-bottom:1px solid var(--pb-line);flex:none;display:flex}.pb-panel-actions{align-items:center;gap:var(--pb-space-2);flex:none;margin-left:auto;display:flex}.pb-panel-title{min-width:0;font-size:var(--pb-text-md);overflow-wrap:anywhere;flex:auto;margin:0;font-weight:600;line-height:1.3}.pb-panel-body{box-sizing:border-box;min-height:0;padding:var(--pb-space-3) var(--pb-space-4);overscroll-behavior:contain;flex:auto;overflow-y:auto}.pb-panel-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-pill{box-sizing:border-box;align-items:center;gap:var(--pb-space-2);border-radius:var(--pb-radius-pill);background:var(--pb-sunken);color:var(--pb-muted);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);white-space:nowrap;padding:0 7px 0 5px;font-weight:600;line-height:18px;display:inline-flex}.pb-pill-dot{border-radius:var(--pb-radius-pill);background:currentColor;flex:none;width:7px;height:7px}.pb-pill[data-tone=ok]{color:var(--pb-ok)}.pb-pill[data-tone=warn]{color:var(--pb-warn)}.pb-pill[data-tone=err]{color:var(--pb-err)}.pb-pill[data-tone=quiet]{color:var(--pb-quiet)}.pb-pill[data-tone=off]{color:var(--pb-off)}.pb-pill-detail{font-family:var(--pb-font-code);font-weight:400}.pb-pill[data-pulse] .pb-pill-dot{animation:pb-pill-pulse var(--pb-motion-pulse) ease-in-out infinite}@keyframes pb-pill-pulse{50%{opacity:.4}}@media (prefers-reduced-motion:reduce){.pb-pill[data-pulse] .pb-pill-dot{animation:none}}.pb-section-title{box-sizing:border-box;align-items:center;gap:var(--pb-space-3);margin:var(--pb-space-3) 0;color:var(--pb-text);font-family:var(--pb-font-ui);display:flex}.pb-section-title-text{min-width:0;font-size:var(--pb-text-md);overflow-wrap:anywhere;flex:auto;margin:0;font-weight:600}.pb-section-title-actions{align-items:center;gap:var(--pb-space-2);flex:none;display:flex}.pb-select{box-sizing:border-box;width:100%;min-height:28px;padding:var(--pb-space-2) var(--pb-space-2);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:border-color var(--pb-motion-fast);margin:0;line-height:1.2}.pb-select[data-font=code]{font-family:var(--pb-font-code)}.pb-select:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-select[aria-invalid=true]{border-color:var(--pb-err)}.pb-select:disabled{color:var(--pb-muted);background:var(--pb-sunken);border-color:var(--pb-line);cursor:default}@media (hover:none) and (pointer:coarse){.pb-select{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-select{border-color:fieldtext}.pb-select:disabled{border-color:graytext}}.pb-sheet{z-index:10;box-sizing:border-box;width:min(clamp(280px, var(--pb-sheet-width,360px), 560px), calc(100% - 48px));font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border-left:1px solid var(--pb-line);box-shadow:var(--pb-shadow-lifted);animation:pb-sheet-from-right var(--pb-motion-slow) ease-out;flex-direction:column;display:flex;position:absolute;top:0;bottom:0;right:0}.pb-sheet[data-side=bottom]{width:auto;max-height:62%;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid var(--pb-line);border-radius:var(--pb-radius-box) var(--pb-radius-box) 0 0;border-left:none;animation-name:pb-sheet-from-bottom;top:auto;left:0}.pb-sheet-head{align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-3) var(--pb-space-3) var(--pb-space-2) var(--pb-space-4);flex:none;display:flex}.pb-sheet-title{min-width:0;font-size:var(--pb-text-md);flex:auto;margin:0;font-weight:600}.pb-button.pb-sheet-close{color:var(--pb-muted);flex:none}.pb-button.pb-sheet-close:hover{color:var(--pb-text)}.pb-sheet-body{min-height:0;padding:0 var(--pb-space-4) var(--pb-space-3);flex:auto;overflow-y:auto}.pb-sheet-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}@keyframes pb-sheet-from-right{0%{transform:translateX(var(--pb-space-5));opacity:0}}@keyframes pb-sheet-from-bottom{0%{transform:translateY(var(--pb-space-5));opacity:0}}@media (prefers-reduced-motion:reduce){.pb-sheet,.pb-sheet[data-side=bottom]{animation:none}}.pb-splitter{z-index:5;box-sizing:border-box;touch-action:none;transition:background-color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;background:0 0;position:absolute}.pb-splitter[data-orientation=vertical]{cursor:col-resize;width:6px;top:0;bottom:0}.pb-splitter[data-orientation=vertical][data-edge=start]{left:-3px}.pb-splitter[data-orientation=vertical][data-edge=end]{right:-3px}.pb-splitter[data-orientation=horizontal]{cursor:row-resize;height:6px;left:0;right:0}.pb-splitter[data-orientation=horizontal][data-edge=start]{top:-3px}.pb-splitter[data-orientation=horizontal][data-edge=end]{bottom:-3px}.pb-splitter:hover,.pb-splitter:focus-visible,.pb-splitter[data-dragging]{background:var(--pb-accent);outline:none}@media (hover:none) and (pointer:coarse){.pb-splitter:before{content:"";position:absolute}.pb-splitter[data-orientation=vertical]:before{inset:0 -15px}.pb-splitter[data-orientation=horizontal]:before{inset:-15px 0}}@media (forced-colors:active){.pb-splitter:hover,.pb-splitter:focus-visible,.pb-splitter[data-dragging]{background:highlight}}.pb-text-input{box-sizing:border-box;width:100%;min-height:28px;padding:var(--pb-space-2) var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);transition:border-color var(--pb-motion-fast);margin:0;line-height:1.2}.pb-text-input[data-font=code]{font-family:var(--pb-font-code)}.pb-text-input::placeholder{color:var(--pb-muted);opacity:1}.pb-text-input:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-text-input[aria-invalid=true]{border-color:var(--pb-err)}.pb-text-input:disabled,.pb-text-input:read-only{background:var(--pb-sunken)}.pb-text-input:disabled{color:var(--pb-muted);border-color:var(--pb-line);cursor:default}@media (hover:none) and (pointer:coarse){.pb-text-input{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-text-input{border-color:fieldtext}.pb-text-input:disabled{border-color:graytext}}.pb-theme-switch{align-items:center;gap:var(--pb-space-2);box-sizing:border-box;min-height:28px;padding:0 var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);white-space:nowrap;color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;margin:0;line-height:1.2;display:inline-flex}.pb-theme-switch:hover{background:var(--pb-sunken)}.pb-theme-switch:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-theme-switch-icon{flex:none}@media (max-width:599px){.pb-theme-switch{padding:0 var(--pb-space-2)}.pb-theme-switch-word{display:none}}@media (hover:none) and (pointer:coarse){.pb-theme-switch{justify-content:center;min-width:36px;min-height:36px}}.pb-toolbar{align-items:center;gap:var(--pb-space-2);box-sizing:border-box;flex-wrap:wrap;display:flex}.pb-toolbar[aria-orientation=vertical]{flex-flow:column;align-items:stretch}.pb-toolbar.pb-tool-group{gap:var(--pb-space-1);background:var(--pb-raised);border:1px solid var(--pb-line);border-radius:var(--pb-radius-box);box-shadow:var(--pb-shadow);flex-wrap:nowrap;padding:3px;display:inline-flex}.pb-tool-group button{box-sizing:border-box;width:28px;height:28px;font-family:var(--pb-font-ui);color:var(--pb-text);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast), color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;background:0 0;border:none;justify-content:center;align-items:center;margin:0;padding:0;font-size:15px;line-height:1;display:inline-flex}.pb-tool-group button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-tool-group button:hover:not(:disabled),.pb-tool-group button[aria-pressed=true]{background:var(--pb-sunken)}.pb-tool-group button[aria-pressed=true]{color:var(--pb-accent)}.pb-tool-group button:disabled{color:var(--pb-muted);cursor:default}@media (hover:none) and (pointer:coarse){.pb-tool-group button,.pb-tool-group .pb-button.pb-icon-button,.pb-tool-group .pb-button.pb-icon-button[data-size=sm]{width:40px;min-width:40px;height:40px}}@media (forced-colors:active){.pb-toolbar.pb-tool-group{border-color:canvastext}.pb-tool-group button[aria-pressed=true]{outline:1px solid highlight}}.pb-warn-mark{box-sizing:border-box;border-radius:var(--pb-radius-pill);background:var(--pb-warn);width:12px;height:12px;color:var(--pb-on-strong);font-family:var(--pb-font-ui);text-align:center;vertical-align:middle;flex:none;font-size:9px;font-weight:700;line-height:12px;display:inline-block}.pb-warn-mark-text{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}
|
|
1
|
+
.pb-badge{--_pb-badge-ink:var(--pb-muted);--_pb-badge-soft:var(--pb-sunken);box-sizing:border-box;align-items:center;gap:var(--pb-space-2);border-radius:var(--pb-radius-pill);background:var(--_pb-badge-soft);color:var(--_pb-badge-ink);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);white-space:nowrap;border:1px solid;padding:0 6px;font-weight:600;line-height:18px;display:inline-flex}.pb-badge:not([data-variant]){border-color:var(--pb-line)}.pb-badge[data-tone=ok],.pb-badge[data-tone=warn],.pb-badge[data-tone=err],.pb-badge[data-tone=quiet],.pb-badge[data-tone=accent],.pb-badge[data-tone=muted],.pb-badge[data-tone=added],.pb-badge[data-tone=removed],.pb-badge[data-tone=renamed],.pb-badge[data-tone=changed]{border-color:currentColor}.pb-badge[data-tone=ok]{--_pb-badge-ink:var(--pb-ok)}.pb-badge[data-tone=warn]{--_pb-badge-ink:var(--pb-warn);--_pb-badge-soft:var(--pb-warn-soft)}.pb-badge[data-tone=err]{--_pb-badge-ink:var(--pb-err);--_pb-badge-soft:var(--pb-err-soft)}.pb-badge[data-tone=quiet]{--_pb-badge-ink:var(--pb-quiet)}.pb-badge[data-tone=off]{--_pb-badge-ink:var(--pb-off)}.pb-badge[data-tone=accent]{--_pb-badge-ink:var(--pb-accent)}.pb-badge[data-tone=muted]{--_pb-badge-ink:var(--pb-muted)}.pb-badge[data-tone=added]{--_pb-badge-ink:var(--pb-added)}.pb-badge[data-tone=removed]{--_pb-badge-ink:var(--pb-removed)}.pb-badge[data-tone=renamed]{--_pb-badge-ink:var(--pb-renamed)}.pb-badge[data-tone=changed]{--_pb-badge-ink:var(--pb-warn);--_pb-badge-soft:var(--pb-warn-soft)}.pb-badge[data-variant=filled]{border-color:var(--_pb-badge-ink);background:var(--_pb-badge-ink);color:var(--pb-on-strong)}.pb-spinner:not(.pb-spinner-labelled),.pb-spinner-ring{box-sizing:border-box;vertical-align:-.1em;border-radius:var(--pb-radius-pill);width:.8em;height:.8em;animation:pb-spin var(--pb-motion-spin) linear infinite;border:2px solid;border-right-color:#0000;display:inline-block}.pb-spinner-labelled{align-items:center;display:inline-flex}.pb-spinner-label{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@keyframes pb-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.pb-spinner:not(.pb-spinner-labelled),.pb-spinner-ring{animation:none}}.pb-button{justify-content:center;align-items:center;gap:var(--pb-space-2);box-sizing:border-box;min-height:28px;padding:0 var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast), border-color var(--pb-motion-fast), color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;margin:0;line-height:1.2;display:inline-flex;position:relative}.pb-button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-button:hover:not(:disabled,[aria-busy=true]){background:var(--pb-sunken)}.pb-button[aria-pressed=true]{color:var(--pb-accent);background:var(--pb-sunken)}.pb-button[data-tone=primary]{color:var(--pb-on-strong);background:var(--pb-accent);border-color:var(--pb-accent)}.pb-button[data-tone=primary]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-accent-hover)}.pb-button[data-tone=danger]{color:var(--pb-err)}.pb-button[data-tone=danger]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-err-soft);border-color:var(--pb-err)}.pb-button:disabled{color:var(--pb-muted);background:var(--pb-raised);border-color:var(--pb-line);cursor:default}.pb-button[aria-busy=true]{cursor:progress}.pb-button[data-size=sm]{min-height:var(--pb-row);padding:0 var(--pb-space-2);font-size:var(--pb-text-sm)}.pb-button-content{align-items:center;gap:var(--pb-space-2);display:inline-flex}.pb-button[aria-busy=true]>.pb-button-content{opacity:0}.pb-button>.pb-button-spinner{margin:auto;position:absolute;inset:0}@media (hover:none) and (pointer:coarse){.pb-button,.pb-button[data-size=sm]{min-height:36px}}@media (forced-colors:active){.pb-button{border-color:buttontext}.pb-button:disabled{color:graytext;border-color:graytext}}.pb-checkbox{width:16px;height:16px;accent-color:var(--pb-accent);cursor:pointer;flex:none;margin:0}.pb-checkbox:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-checkbox[aria-invalid=true]:not(:focus-visible){outline:1px solid var(--pb-err);outline-offset:1px}.pb-checkbox:disabled{cursor:default}.pb-checkbox-row{align-items:center;gap:var(--pb-space-3);min-height:28px;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);cursor:pointer;-webkit-tap-highlight-color:transparent;display:inline-flex}.pb-checkbox-row[data-disabled]{color:var(--pb-muted);cursor:default}@media (hover:none) and (pointer:coarse){.pb-checkbox{width:20px;height:20px}.pb-checkbox-row{min-height:36px;font-size:16px}}.pb-button.pb-icon-button{background:0 0;border-color:#0000;width:28px;min-width:28px;height:28px;padding:0}.pb-button.pb-icon-button[data-size=sm]{width:var(--pb-row);min-width:var(--pb-row);height:var(--pb-row)}.pb-button.pb-icon-button:hover:not(:disabled,[aria-busy=true]),.pb-button.pb-icon-button[aria-pressed=true]{background:var(--pb-sunken)}.pb-button.pb-icon-button[data-tone=primary]{background:var(--pb-accent);border-color:var(--pb-accent)}.pb-button.pb-icon-button[data-tone=primary]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-accent-hover)}.pb-button.pb-icon-button[data-tone=danger]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-err-soft);border-color:var(--pb-err)}.pb-button.pb-icon-button:disabled{background:0 0;border-color:#0000}.pb-icon-button-glyph{justify-content:center;align-items:center;font-size:1.15em;line-height:1;display:inline-flex}@media (hover:none) and (pointer:coarse){.pb-button.pb-icon-button,.pb-button.pb-icon-button[data-size=sm]{width:36px;min-width:36px;height:36px}}@media (forced-colors:active){.pb-button.pb-icon-button{border-color:#0000}.pb-button.pb-icon-button[aria-pressed=true]{border-color:highlight}}.pb-dialog-scrim{z-index:100;box-sizing:border-box;padding:max(10vh, env(safe-area-inset-top)) max(var(--pb-space-5), env(safe-area-inset-right)) max(var(--pb-space-5), env(safe-area-inset-bottom)) max(var(--pb-space-5), env(safe-area-inset-left));background:var(--pb-scrim);animation:pb-dialog-fade var(--pb-motion-fast) ease-out;justify-content:center;align-items:flex-start;display:flex;position:fixed;inset:0}.pb-dialog{box-sizing:border-box;width:min(520px,100%);max-height:100%;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line);border-radius:var(--pb-radius-box);box-shadow:var(--pb-shadow-lifted);animation:pb-dialog-rise var(--pb-motion-slow) ease-out;flex-direction:column;display:flex}.pb-dialog:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-dialog-head{align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-4) var(--pb-space-4) var(--pb-space-3) var(--pb-space-5);display:flex}.pb-dialog-title{min-width:0;font-size:var(--pb-text-md);flex:auto;margin:0;font-weight:600}.pb-button.pb-dialog-close{color:var(--pb-muted);flex:none}.pb-button.pb-dialog-close:hover{color:var(--pb-text)}.pb-dialog-body{min-height:0;padding:0 var(--pb-space-5) var(--pb-space-5);flex:auto;overflow:auto}.pb-dialog-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-dialog-actions{justify-content:flex-end;gap:var(--pb-space-3);padding:var(--pb-space-4) var(--pb-space-5);border-top:1px solid var(--pb-line);flex-wrap:wrap;display:flex}@keyframes pb-dialog-fade{0%{opacity:0}}@keyframes pb-dialog-rise{0%{opacity:0;transform:translateY(var(--pb-space-3))}}@media (max-width:599px){.pb-dialog-scrim{padding-top:max(var(--pb-space-5), env(safe-area-inset-top));padding-right:max(var(--pb-space-4), env(safe-area-inset-right));padding-left:max(var(--pb-space-4), env(safe-area-inset-left))}}@media (prefers-reduced-motion:reduce){.pb-dialog-scrim,.pb-dialog{animation:none}}.pb-field{gap:var(--pb-space-2);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);grid-template-columns:minmax(0,1fr);display:grid}.pb-field[data-layout=inline]{column-gap:var(--pb-space-4);grid-template-columns:130px minmax(0,1fr);align-items:baseline}.pb-field-label{color:var(--pb-text)}.pb-field-control{gap:var(--pb-space-2);min-width:0;display:grid}.pb-field-hint{font-size:var(--pb-text-sm);color:var(--pb-muted)}.pb-field-error{font-size:var(--pb-text-sm);color:var(--pb-err)}.pb-key-value{box-sizing:border-box;gap:var(--pb-space-1) var(--pb-space-4);color:var(--pb-text);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);grid-template-columns:max-content minmax(0,1fr);margin:0;display:grid}.pb-key-value-row{display:contents}.pb-key-value dt{color:var(--pb-muted)}.pb-key-value dd{font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0;margin:0}.pb-key-value-row[data-tone=ok] dd{color:var(--pb-ok)}.pb-key-value-row[data-tone=warn] dd{color:var(--pb-warn)}.pb-key-value-row[data-tone=err] dd{color:var(--pb-err)}.pb-key-value-row[data-tone=quiet] dd{color:var(--pb-quiet)}.pb-key-value-row[data-tone=off] dd{color:var(--pb-off)}.pb-panel{box-sizing:border-box;min-height:0;max-height:100%;color:var(--pb-text);background:var(--pb-raised);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);flex-direction:column;display:flex}.pb-panel-header{align-items:center;gap:var(--pb-space-3);box-sizing:border-box;min-height:var(--pb-bar);padding:var(--pb-space-3) var(--pb-space-4);border-bottom:1px solid var(--pb-line);flex:none;display:flex}.pb-panel-actions{align-items:center;gap:var(--pb-space-2);flex:none;margin-left:auto;display:flex}.pb-panel-title{min-width:0;font-size:var(--pb-text-md);overflow-wrap:anywhere;flex:auto;margin:0;font-weight:600;line-height:1.3}.pb-panel-body{box-sizing:border-box;min-height:0;padding:var(--pb-space-3) var(--pb-space-4);overscroll-behavior:contain;flex:auto;overflow-y:auto}.pb-panel-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-pill{box-sizing:border-box;align-items:center;gap:var(--pb-space-2);border-radius:var(--pb-radius-pill);background:var(--pb-sunken);color:var(--pb-muted);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);white-space:nowrap;padding:0 7px 0 5px;font-weight:600;line-height:18px;display:inline-flex}.pb-pill-dot{border-radius:var(--pb-radius-pill);background:currentColor;flex:none;width:7px;height:7px}.pb-pill[data-tone=ok]{color:var(--pb-ok)}.pb-pill[data-tone=warn]{color:var(--pb-warn)}.pb-pill[data-tone=err]{color:var(--pb-err)}.pb-pill[data-tone=quiet]{color:var(--pb-quiet)}.pb-pill[data-tone=off]{color:var(--pb-off)}.pb-pill[data-tone=accent]{color:var(--pb-accent)}.pb-pill[data-tone=muted]{color:var(--pb-muted)}.pb-pill-detail{font-family:var(--pb-font-code);font-weight:400}.pb-pill[data-pulse] .pb-pill-dot{animation:pb-pill-pulse var(--pb-motion-pulse) ease-in-out infinite}@keyframes pb-pill-pulse{50%{opacity:.4}}@media (prefers-reduced-motion:reduce){.pb-pill[data-pulse] .pb-pill-dot{animation:none}}@media (forced-colors:active){.pb-pill-dot{forced-color-adjust:none;background:canvastext}}.pb-radio-group{gap:var(--pb-space-2);min-width:0;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);border:0;margin:0;padding:0;display:grid}.pb-radio-group-legend{float:left;width:100%;margin-bottom:var(--pb-space-2);color:var(--pb-text);padding:0}.pb-radio-group-legend[data-hidden]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;margin:0;position:absolute;overflow:hidden}.pb-radio-group-options{clear:both;flex-direction:column;align-items:flex-start;display:flex}.pb-radio-group[data-layout=inline] .pb-radio-group-options{column-gap:var(--pb-space-5);flex-flow:wrap}.pb-radio-row{align-items:center;gap:var(--pb-space-3);cursor:pointer;-webkit-tap-highlight-color:transparent;min-height:28px;display:inline-flex}.pb-radio-row[data-disabled]{color:var(--pb-muted);cursor:default}.pb-radio{width:16px;height:16px;accent-color:var(--pb-accent);cursor:pointer;flex:none;margin:0}.pb-radio:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-radio-group[aria-invalid=true] .pb-radio:not(:focus-visible){outline:1px solid var(--pb-err);outline-offset:1px}.pb-radio:disabled{cursor:default}.pb-radio-group-hint{font-size:var(--pb-text-sm);color:var(--pb-muted)}.pb-radio-group-error{font-size:var(--pb-text-sm);color:var(--pb-err)}@media (hover:none) and (pointer:coarse){.pb-radio{width:20px;height:20px}.pb-radio-row{min-height:36px;font-size:16px}}.pb-section-title{box-sizing:border-box;align-items:center;gap:var(--pb-space-3);margin:var(--pb-space-3) 0;color:var(--pb-text);font-family:var(--pb-font-ui);display:flex}.pb-section-title-text{min-width:0;font-size:var(--pb-text-md);overflow-wrap:anywhere;flex:auto;margin:0;font-weight:600}.pb-section-title-actions{align-items:center;gap:var(--pb-space-2);flex:none;display:flex}.pb-select{box-sizing:border-box;width:100%;min-height:28px;padding:var(--pb-space-2) var(--pb-space-2);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:border-color var(--pb-motion-fast);margin:0;line-height:1.2}.pb-select[data-font=code]{font-family:var(--pb-font-code)}.pb-select:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-select[aria-invalid=true]{border-color:var(--pb-err)}.pb-select:disabled{color:var(--pb-muted);background:var(--pb-sunken);border-color:var(--pb-line);cursor:default}@media (hover:none) and (pointer:coarse){.pb-select{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-select{border-color:fieldtext}.pb-select:disabled{border-color:graytext}}.pb-sheet{z-index:10;box-sizing:border-box;width:min(clamp(280px, var(--pb-sheet-width,360px), 560px), calc(100% - 48px));font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border-left:1px solid var(--pb-line);box-shadow:var(--pb-shadow-lifted);animation:pb-sheet-from-right var(--pb-motion-slow) ease-out;flex-direction:column;display:flex;position:absolute;top:0;bottom:0;right:0}.pb-sheet[data-side=bottom]{width:auto;max-height:62%;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid var(--pb-line);border-radius:var(--pb-radius-box) var(--pb-radius-box) 0 0;border-left:none;animation-name:pb-sheet-from-bottom;top:auto;left:0}.pb-sheet-head{align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-3) var(--pb-space-3) var(--pb-space-2) var(--pb-space-4);flex:none;display:flex}.pb-sheet-title{min-width:0;font-size:var(--pb-text-md);flex:auto;margin:0;font-weight:600}.pb-button.pb-sheet-close{color:var(--pb-muted);flex:none}.pb-button.pb-sheet-close:hover{color:var(--pb-text)}.pb-sheet-body{min-height:0;padding:0 var(--pb-space-4) var(--pb-space-3);flex:auto;overflow-y:auto}.pb-sheet-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}@keyframes pb-sheet-from-right{0%{transform:translateX(var(--pb-space-5));opacity:0}}@keyframes pb-sheet-from-bottom{0%{transform:translateY(var(--pb-space-5));opacity:0}}@media (prefers-reduced-motion:reduce){.pb-sheet,.pb-sheet[data-side=bottom]{animation:none}}.pb-splitter{z-index:5;box-sizing:border-box;touch-action:none;transition:background-color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;background:0 0;position:absolute}.pb-splitter[data-orientation=vertical]{cursor:col-resize;width:6px;top:0;bottom:0}.pb-splitter[data-orientation=vertical][data-edge=start]{left:-3px}.pb-splitter[data-orientation=vertical][data-edge=end]{right:-3px}.pb-splitter[data-orientation=horizontal]{cursor:row-resize;height:6px;left:0;right:0}.pb-splitter[data-orientation=horizontal][data-edge=start]{top:-3px}.pb-splitter[data-orientation=horizontal][data-edge=end]{bottom:-3px}.pb-splitter:hover,.pb-splitter:focus-visible,.pb-splitter[data-dragging]{background:var(--pb-accent);outline:none}@media (hover:none) and (pointer:coarse){.pb-splitter:before{content:"";position:absolute}.pb-splitter[data-orientation=vertical]:before{inset:0 -15px}.pb-splitter[data-orientation=horizontal]:before{inset:-15px 0}}@media (forced-colors:active){.pb-splitter:hover,.pb-splitter:focus-visible,.pb-splitter[data-dragging]{background:highlight}}.pb-text-input{box-sizing:border-box;width:100%;min-height:28px;padding:var(--pb-space-2) var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);transition:border-color var(--pb-motion-fast);margin:0;line-height:1.2}.pb-text-input[data-font=code]{font-family:var(--pb-font-code)}.pb-text-input::placeholder{color:var(--pb-muted);opacity:1}.pb-text-input:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-text-input[aria-invalid=true]{border-color:var(--pb-err)}.pb-text-input:disabled,.pb-text-input:read-only{background:var(--pb-sunken)}.pb-text-input:disabled{color:var(--pb-muted);border-color:var(--pb-line);cursor:default}@media (hover:none) and (pointer:coarse){.pb-text-input{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-text-input{border-color:fieldtext}.pb-text-input:disabled{border-color:graytext}}.pb-theme-switch{align-items:center;gap:var(--pb-space-2);box-sizing:border-box;min-height:28px;padding:0 var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);white-space:nowrap;color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;margin:0;line-height:1.2;display:inline-flex}.pb-theme-switch:hover{background:var(--pb-sunken)}.pb-theme-switch:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-theme-switch-icon{flex:none}@media (max-width:599px){.pb-theme-switch{padding:0 var(--pb-space-2)}.pb-theme-switch-word{display:none}}@media (hover:none) and (pointer:coarse){.pb-theme-switch{justify-content:center;min-width:36px;min-height:36px}}.pb-toolbar{align-items:center;gap:var(--pb-space-2);box-sizing:border-box;flex-wrap:wrap;display:flex}.pb-toolbar[aria-orientation=vertical]{flex-flow:column;align-items:stretch}.pb-toolbar.pb-tool-group{gap:var(--pb-space-1);background:var(--pb-raised);border:1px solid var(--pb-line);border-radius:var(--pb-radius-box);box-shadow:var(--pb-shadow);flex-wrap:nowrap;padding:3px;display:inline-flex}.pb-tool-group button{box-sizing:border-box;width:28px;height:28px;font-family:var(--pb-font-ui);color:var(--pb-text);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast), color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;background:0 0;border:none;justify-content:center;align-items:center;margin:0;padding:0;font-size:15px;line-height:1;display:inline-flex}.pb-tool-group button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-tool-group button:hover:not(:disabled),.pb-tool-group button[aria-pressed=true]{background:var(--pb-sunken)}.pb-tool-group button[aria-pressed=true]{color:var(--pb-accent)}.pb-tool-group button:disabled{color:var(--pb-muted);cursor:default}@media (hover:none) and (pointer:coarse){.pb-tool-group button,.pb-tool-group .pb-button.pb-icon-button,.pb-tool-group .pb-button.pb-icon-button[data-size=sm]{width:40px;min-width:40px;height:40px}}@media (forced-colors:active){.pb-toolbar.pb-tool-group{border-color:canvastext}.pb-tool-group button[aria-pressed=true]{outline:1px solid highlight}}.pb-warn-mark{box-sizing:border-box;border-radius:var(--pb-radius-pill);background:var(--pb-warn);width:12px;height:12px;color:var(--pb-on-strong);font-family:var(--pb-font-ui);text-align:center;vertical-align:middle;flex:none;font-size:9px;font-weight:700;line-height:12px;display:inline-block}@media (forced-colors:active){.pb-warn-mark{forced-color-adjust:none;color:canvas;background:canvastext}}.pb-warn-mark-text{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}
|
package/dist/primitives.js
CHANGED
|
@@ -2,12 +2,13 @@ import "./primitives.css";import { Fragment as e, jsx as t, jsxs as n } from "re
|
|
|
2
2
|
import { cloneElement as r, isValidElement as i, useCallback as a, useEffect as o, useId as s, useLayoutEffect as c, useRef as l } from "react";
|
|
3
3
|
import { createPortal as u } from "react-dom";
|
|
4
4
|
// src/primitives/badge/Badge.tsx
|
|
5
|
-
function d({ tone: e,
|
|
5
|
+
function d({ tone: e, variant: n = "outlined", children: r, title: i, className: a }) {
|
|
6
6
|
return /* @__PURE__ */ t("span", {
|
|
7
|
-
className:
|
|
7
|
+
className: a === void 0 ? "pb-badge" : `pb-badge ${a}`,
|
|
8
8
|
"data-tone": e,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
"data-variant": n === "filled" ? "filled" : void 0,
|
|
10
|
+
title: i,
|
|
11
|
+
children: r
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
14
|
// src/primitives/spinner/Spinner.tsx
|
|
@@ -325,8 +326,66 @@ function k({ tone: e, label: r, pulse: i = !1, title: a, detail: o, className: s
|
|
|
325
326
|
]
|
|
326
327
|
});
|
|
327
328
|
}
|
|
329
|
+
// src/primitives/radio-group/RadioGroup.tsx
|
|
330
|
+
function A(e) {
|
|
331
|
+
return e != null && e !== !1 && e !== "";
|
|
332
|
+
}
|
|
333
|
+
function j({ legend: e, legendHidden: r = !1, options: i, value: a, onChange: o, name: c, layout: l = "stacked", hint: u, error: d, className: f, "aria-describedby": p, "aria-invalid": m, ...h }) {
|
|
334
|
+
let g = s(), _ = c ?? `${g}-name`, v = A(u) ? `${g}-hint` : void 0, y = A(d) ? `${g}-error` : void 0, b = [
|
|
335
|
+
p,
|
|
336
|
+
v,
|
|
337
|
+
y
|
|
338
|
+
].filter((e) => e !== void 0 && e !== "");
|
|
339
|
+
return /* @__PURE__ */ n("fieldset", {
|
|
340
|
+
...h,
|
|
341
|
+
role: "radiogroup",
|
|
342
|
+
className: f === void 0 ? "pb-radio-group" : `pb-radio-group ${f}`,
|
|
343
|
+
"data-layout": l,
|
|
344
|
+
"aria-describedby": b.length > 0 ? b.join(" ") : void 0,
|
|
345
|
+
"aria-invalid": y !== void 0 || m,
|
|
346
|
+
children: [
|
|
347
|
+
/* @__PURE__ */ t("legend", {
|
|
348
|
+
className: "pb-radio-group-legend",
|
|
349
|
+
"data-hidden": r || void 0,
|
|
350
|
+
children: e
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ t("div", {
|
|
353
|
+
className: "pb-radio-group-options",
|
|
354
|
+
children: i.map((e) => /* @__PURE__ */ n("label", {
|
|
355
|
+
className: "pb-radio-row",
|
|
356
|
+
title: e.title,
|
|
357
|
+
"data-disabled": e.disabled === !0 || h.disabled === !0 || void 0,
|
|
358
|
+
children: [/* @__PURE__ */ t("input", {
|
|
359
|
+
className: "pb-radio",
|
|
360
|
+
type: "radio",
|
|
361
|
+
name: _,
|
|
362
|
+
value: e.value,
|
|
363
|
+
checked: e.value === a,
|
|
364
|
+
disabled: e.disabled,
|
|
365
|
+
onChange: () => {
|
|
366
|
+
o(e.value);
|
|
367
|
+
}
|
|
368
|
+
}), /* @__PURE__ */ t("span", {
|
|
369
|
+
className: "pb-radio-label",
|
|
370
|
+
children: e.label
|
|
371
|
+
})]
|
|
372
|
+
}, e.value))
|
|
373
|
+
}),
|
|
374
|
+
v !== void 0 && /* @__PURE__ */ t("div", {
|
|
375
|
+
className: "pb-radio-group-hint",
|
|
376
|
+
id: v,
|
|
377
|
+
children: u
|
|
378
|
+
}),
|
|
379
|
+
y !== void 0 && /* @__PURE__ */ t("div", {
|
|
380
|
+
className: "pb-radio-group-error",
|
|
381
|
+
id: y,
|
|
382
|
+
children: d
|
|
383
|
+
})
|
|
384
|
+
]
|
|
385
|
+
});
|
|
386
|
+
}
|
|
328
387
|
// src/primitives/section-title/SectionTitle.tsx
|
|
329
|
-
function
|
|
388
|
+
function M({ children: e, actions: r, level: i = 3, className: a }) {
|
|
330
389
|
let o = `h${i}`;
|
|
331
390
|
return /* @__PURE__ */ n("div", {
|
|
332
391
|
className: a === void 0 ? "pb-section-title" : `pb-section-title ${a}`,
|
|
@@ -340,7 +399,7 @@ function A({ children: e, actions: r, level: i = 3, className: a }) {
|
|
|
340
399
|
});
|
|
341
400
|
}
|
|
342
401
|
// src/primitives/select/Select.tsx
|
|
343
|
-
function
|
|
402
|
+
function N({ font: e = "ui", className: n, children: r, ...i }) {
|
|
344
403
|
return /* @__PURE__ */ t("select", {
|
|
345
404
|
...i,
|
|
346
405
|
className: n === void 0 ? "pb-select" : `pb-select ${n}`,
|
|
@@ -349,7 +408,7 @@ function j({ font: e = "ui", className: n, children: r, ...i }) {
|
|
|
349
408
|
});
|
|
350
409
|
}
|
|
351
410
|
// src/primitives/sheet/Sheet.tsx
|
|
352
|
-
function
|
|
411
|
+
function P({ onClose: e, side: r = "right", title: i, label: a, children: c, width: u, closeLabel: d = "Close", className: f }) {
|
|
353
412
|
let p = l(null), m = s(), h = l(null);
|
|
354
413
|
o(() => {
|
|
355
414
|
let e = p.current;
|
|
@@ -393,34 +452,34 @@ function M({ onClose: e, side: r = "right", title: i, label: a, children: c, wid
|
|
|
393
452
|
})]
|
|
394
453
|
});
|
|
395
454
|
}
|
|
396
|
-
function
|
|
397
|
-
return e ? /* @__PURE__ */ t(
|
|
455
|
+
function F({ open: e, ...n }) {
|
|
456
|
+
return e ? /* @__PURE__ */ t(P, { ...n }) : null;
|
|
398
457
|
}
|
|
399
458
|
// src/primitives/splitter/splitter-math.ts
|
|
400
|
-
function
|
|
459
|
+
function I(e, t) {
|
|
401
460
|
let n = Math.max(t.min, t.max);
|
|
402
461
|
return Math.round(Math.min(n, Math.max(t.min, e)));
|
|
403
462
|
}
|
|
404
|
-
function
|
|
405
|
-
return
|
|
463
|
+
function L(e, t, n, r) {
|
|
464
|
+
return I(e + n * t, r);
|
|
406
465
|
}
|
|
407
|
-
function
|
|
466
|
+
function R(e, t) {
|
|
408
467
|
return e === "vertical" ? t === "start" ? "ArrowLeft" : "ArrowRight" : t === "start" ? "ArrowUp" : "ArrowDown";
|
|
409
468
|
}
|
|
410
|
-
var
|
|
469
|
+
var z = {
|
|
411
470
|
ArrowLeft: "ArrowRight",
|
|
412
471
|
ArrowRight: "ArrowLeft",
|
|
413
472
|
ArrowUp: "ArrowDown",
|
|
414
473
|
ArrowDown: "ArrowUp"
|
|
415
474
|
};
|
|
416
|
-
function
|
|
417
|
-
if (t === n) return
|
|
418
|
-
if (t ===
|
|
419
|
-
if (t === "Home") return
|
|
420
|
-
if (t === "End") return
|
|
475
|
+
function B(e, t, n, r, i) {
|
|
476
|
+
if (t === n) return I(e + r, i);
|
|
477
|
+
if (t === z[n]) return I(e - r, i);
|
|
478
|
+
if (t === "Home") return I(i.min, i);
|
|
479
|
+
if (t === "End") return I(i.max, i);
|
|
421
480
|
}
|
|
422
481
|
// src/primitives/splitter/Splitter.tsx
|
|
423
|
-
function
|
|
482
|
+
function V({ orientation: e, value: n, min: r, max: i, onChange: a, label: o, edge: s = "start", step: c = 16, className: u, onPointerDown: d, onPointerMove: f, onPointerUp: p, onPointerCancel: m, onKeyDown: h, ...g }) {
|
|
424
483
|
let _ = l(null), v = {
|
|
425
484
|
min: r,
|
|
426
485
|
max: i
|
|
@@ -438,7 +497,7 @@ function z({ orientation: e, value: n, min: r, max: i, onChange: a, label: o, ed
|
|
|
438
497
|
f?.(e);
|
|
439
498
|
let t = _.current;
|
|
440
499
|
if (t === null) return;
|
|
441
|
-
let r =
|
|
500
|
+
let r = L(t.start, y(e) - t.at, s === "start" ? -1 : 1, v);
|
|
442
501
|
r !== n && a(r);
|
|
443
502
|
}
|
|
444
503
|
function S(e) {
|
|
@@ -449,7 +508,7 @@ function z({ orientation: e, value: n, min: r, max: i, onChange: a, label: o, ed
|
|
|
449
508
|
}
|
|
450
509
|
function C(t) {
|
|
451
510
|
if (h?.(t), t.defaultPrevented || t.altKey || t.ctrlKey || t.metaKey) return;
|
|
452
|
-
let r =
|
|
511
|
+
let r = B(n, t.key, R(e, s), c, v);
|
|
453
512
|
r !== void 0 && (t.preventDefault(), r !== n && a(r));
|
|
454
513
|
}
|
|
455
514
|
return /* @__PURE__ */ t("div", {
|
|
@@ -472,7 +531,7 @@ function z({ orientation: e, value: n, min: r, max: i, onChange: a, label: o, ed
|
|
|
472
531
|
});
|
|
473
532
|
}
|
|
474
533
|
// src/primitives/text-input/TextInput.tsx
|
|
475
|
-
function
|
|
534
|
+
function H({ font: e = "ui", type: n = "text", className: r, ...i }) {
|
|
476
535
|
return /* @__PURE__ */ t("input", {
|
|
477
536
|
...i,
|
|
478
537
|
type: n,
|
|
@@ -481,38 +540,38 @@ function B({ font: e = "ui", type: n = "text", className: r, ...i }) {
|
|
|
481
540
|
});
|
|
482
541
|
}
|
|
483
542
|
// src/primitives/theme-switch/ThemeSwitch.tsx
|
|
484
|
-
var
|
|
543
|
+
var U = {
|
|
485
544
|
theme: "Theme",
|
|
486
545
|
system: "system",
|
|
487
546
|
light: "light",
|
|
488
547
|
dark: "dark",
|
|
489
548
|
systemHint: "follows the system's setting",
|
|
490
549
|
clickFor: "click for"
|
|
491
|
-
},
|
|
550
|
+
}, W = [
|
|
492
551
|
"system",
|
|
493
552
|
"light",
|
|
494
553
|
"dark"
|
|
495
554
|
];
|
|
496
|
-
function
|
|
497
|
-
return
|
|
555
|
+
function G(e) {
|
|
556
|
+
return W[(W.indexOf(e) + 1) % W.length] ?? "system";
|
|
498
557
|
}
|
|
499
|
-
function
|
|
558
|
+
function K(e, t = U) {
|
|
500
559
|
let n = e === "system" ? ` (${t.systemHint})` : "";
|
|
501
|
-
return `${t.theme}: ${t[e]}${n}; ${t.clickFor} ${t[
|
|
560
|
+
return `${t.theme}: ${t[e]}${n}; ${t.clickFor} ${t[G(e)]}`;
|
|
502
561
|
}
|
|
503
|
-
function
|
|
562
|
+
function q({ choice: e, onChoose: r, labels: i, className: a, ...o }) {
|
|
504
563
|
let s = {
|
|
505
|
-
...
|
|
564
|
+
...U,
|
|
506
565
|
...i
|
|
507
566
|
};
|
|
508
567
|
return /* @__PURE__ */ n("button", {
|
|
509
568
|
...o,
|
|
510
569
|
type: "button",
|
|
511
570
|
className: a === void 0 ? "pb-theme-switch" : `pb-theme-switch ${a}`,
|
|
512
|
-
title:
|
|
571
|
+
title: K(e, s),
|
|
513
572
|
"aria-label": `${s.theme}: ${s[e]}`,
|
|
514
573
|
onClick: () => {
|
|
515
|
-
r(
|
|
574
|
+
r(G(e));
|
|
516
575
|
},
|
|
517
576
|
children: [/* @__PURE__ */ n("svg", {
|
|
518
577
|
className: "pb-theme-switch-icon",
|
|
@@ -538,16 +597,16 @@ function G({ choice: e, onChoose: r, labels: i, className: a, ...o }) {
|
|
|
538
597
|
});
|
|
539
598
|
}
|
|
540
599
|
// src/primitives/toolbar/roving.ts
|
|
541
|
-
var
|
|
542
|
-
function
|
|
543
|
-
return [...e.querySelectorAll(
|
|
600
|
+
var J = "button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [role=\"button\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"menuitem\"], [role=\"switch\"]";
|
|
601
|
+
function Y(e) {
|
|
602
|
+
return [...e.querySelectorAll(J)].filter((t) => t.closest("[role=\"toolbar\"]") === e);
|
|
544
603
|
}
|
|
545
|
-
function
|
|
604
|
+
function X(e, t) {
|
|
546
605
|
let n = t !== null && e.includes(t) ? t : e[0] ?? null;
|
|
547
606
|
for (let t of e) t.tabIndex = t === n ? 0 : -1;
|
|
548
607
|
return n;
|
|
549
608
|
}
|
|
550
|
-
function
|
|
609
|
+
function Z(e, t, n, r, i) {
|
|
551
610
|
if (t === 0) return;
|
|
552
611
|
if (n === "Home") return 0;
|
|
553
612
|
if (n === "End") return t - 1;
|
|
@@ -555,7 +614,7 @@ function Y(e, t, n, r, i) {
|
|
|
555
614
|
if (n === o) return (e + 1) % t;
|
|
556
615
|
if (n === a) return (e - 1 + t) % t;
|
|
557
616
|
}
|
|
558
|
-
function
|
|
617
|
+
function Q(e) {
|
|
559
618
|
return e instanceof HTMLTextAreaElement ? !0 : e instanceof HTMLInputElement ? ![
|
|
560
619
|
"button",
|
|
561
620
|
"checkbox",
|
|
@@ -569,13 +628,13 @@ function X(e) {
|
|
|
569
628
|
].includes(e.type) : e instanceof HTMLElement && e.isContentEditable;
|
|
570
629
|
}
|
|
571
630
|
// src/primitives/toolbar/Toolbar.tsx
|
|
572
|
-
function
|
|
631
|
+
function $({ label: e, orientation: n = "horizontal", className: r, ref: i, onKeyDown: a, onFocus: s, children: c, ...u }) {
|
|
573
632
|
let d = l(null), f = l(null);
|
|
574
633
|
o(() => {
|
|
575
634
|
let e = d.current;
|
|
576
635
|
if (e === null) return;
|
|
577
636
|
let t = () => {
|
|
578
|
-
f.current =
|
|
637
|
+
f.current = X(Y(e), f.current);
|
|
579
638
|
};
|
|
580
639
|
t();
|
|
581
640
|
let n = new MutationObserver(t);
|
|
@@ -592,16 +651,16 @@ function Z({ label: e, orientation: n = "horizontal", className: r, ref: i, onKe
|
|
|
592
651
|
s?.(e);
|
|
593
652
|
let t = d.current;
|
|
594
653
|
if (t === null) return;
|
|
595
|
-
let n =
|
|
596
|
-
e.target instanceof HTMLElement && n.includes(e.target) && (f.current =
|
|
654
|
+
let n = Y(t);
|
|
655
|
+
e.target instanceof HTMLElement && n.includes(e.target) && (f.current = X(n, e.target));
|
|
597
656
|
}
|
|
598
657
|
function m(e) {
|
|
599
658
|
a?.(e);
|
|
600
659
|
let t = d.current;
|
|
601
|
-
if (e.defaultPrevented || t === null || e.altKey || e.ctrlKey || e.metaKey ||
|
|
602
|
-
let r =
|
|
660
|
+
if (e.defaultPrevented || t === null || e.altKey || e.ctrlKey || e.metaKey || Q(e.target)) return;
|
|
661
|
+
let r = Y(t), i = r.indexOf(e.target);
|
|
603
662
|
if (i === -1) return;
|
|
604
|
-
let o = getComputedStyle(t).direction === "rtl", s =
|
|
663
|
+
let o = getComputedStyle(t).direction === "rtl", s = Z(i, r.length, e.key, n, o);
|
|
605
664
|
s !== void 0 && (e.preventDefault(), r[s]?.focus());
|
|
606
665
|
}
|
|
607
666
|
return /* @__PURE__ */ t("div", {
|
|
@@ -620,14 +679,14 @@ function Z({ label: e, orientation: n = "horizontal", className: r, ref: i, onKe
|
|
|
620
679
|
});
|
|
621
680
|
}
|
|
622
681
|
// src/primitives/tool-group/ToolGroup.tsx
|
|
623
|
-
function
|
|
624
|
-
return /* @__PURE__ */ t(
|
|
682
|
+
function ee({ className: e, ...n }) {
|
|
683
|
+
return /* @__PURE__ */ t($, {
|
|
625
684
|
...n,
|
|
626
685
|
className: e === void 0 ? "pb-tool-group" : `pb-tool-group ${e}`
|
|
627
686
|
});
|
|
628
687
|
}
|
|
629
688
|
// src/primitives/warn-mark/WarnMark.tsx
|
|
630
|
-
function
|
|
689
|
+
function te({ label: r, title: i, className: a }) {
|
|
631
690
|
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
632
691
|
className: a === void 0 ? "pb-warn-mark" : `pb-warn-mark ${a}`,
|
|
633
692
|
"aria-hidden": "true",
|
|
@@ -638,6 +697,6 @@ function $({ label: r, title: i, className: a }) {
|
|
|
638
697
|
children: r
|
|
639
698
|
})] });
|
|
640
699
|
}
|
|
641
|
-
export { d as Badge, p as Button, h as Checkbox, S as Dialog, w as Field, g as IconButton, T as KeyValue, O as Panel, k as Pill,
|
|
700
|
+
export { d as Badge, p as Button, h as Checkbox, S as Dialog, w as Field, g as IconButton, T as KeyValue, O as Panel, k as Pill, j as RadioGroup, M as SectionTitle, N as Select, F as Sheet, f as Spinner, V as Splitter, H as TextInput, q as ThemeSwitch, ee as ToolGroup, $ as Toolbar, te as WarnMark, U as defaultThemeSwitchLabels, K as themeSwitchTitle };
|
|
642
701
|
|
|
643
702
|
//# sourceMappingURL=primitives.js.map
|
package/dist/primitives.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.js","names":["_Fragment","Badge","className","tone","Spinner","rest","classes","label","Button","click","busy","event","onClick","size","assign","ref","value","Checkbox","own","useRef","setRef","useCallback","node","indeterminate","box","IconButton","title","CloseGlyph","focusable","tabbable","root","element","topmost","open","OpenDialog","boxRef","bodyRef","titleId","useId","onCloseRef","onClose","useEffect","before","body","keepFocus","controls","first","last","active","closeLabel","actions","Dialog","createPortal","present","Field","base","control","children","isValidElement","controlId","hintId","hint","errorId","error","describedBy","id","wired","cloneElement","layout","KeyValue","rows","row","index","overflows","useScrollFocus","settle","sizes","observeChildren","child","content","Panel","Heading","level","header","Pill","pulse","detail","SectionTitle","Select","font","OpenSheet","sheetRef","cameFrom","sheet","back","onFocus","from","onKeyDown","style","width","side","Sheet","clamp","max","bounds","dragged","start","sign","travel","growKey","orientation","edge","opposite","keyed","key","grow","step","Splitter","drag","along","down","onPointerDown","target","\"dragging\"","move","started","next","onChange","end","onPointerCancel","onPointerUp","min","TextInput","defaultThemeSwitchLabels","order","following","choice","themeSwitchTitle","labels","ThemeSwitch","words","itemSelector","items","toolbar","item","setTabStop","stop","current","all","moved","count","forth","rtl","editsText","Toolbar","watch","focus","ToolGroup","WarnMark","Fragment"],"sources":["../src/primitives/badge/Badge.tsx","../src/primitives/spinner/Spinner.tsx","../src/primitives/button/Button.tsx","../src/primitives/checkbox/Checkbox.tsx","../src/primitives/icon-button/IconButton.tsx","../src/primitives/dialog/CloseGlyph.tsx","../src/primitives/dialog/Dialog.tsx","../src/primitives/field/Field.tsx","../src/primitives/key-value/KeyValue.tsx","../src/primitives/panel/scroll-focus.ts","../src/primitives/panel/Panel.tsx","../src/primitives/pill/Pill.tsx","../src/primitives/section-title/SectionTitle.tsx","../src/primitives/select/Select.tsx","../src/primitives/sheet/Sheet.tsx","../src/primitives/splitter/splitter-math.ts","../src/primitives/splitter/Splitter.tsx","../src/primitives/text-input/TextInput.tsx","../src/primitives/theme-switch/ThemeSwitch.tsx","../src/primitives/toolbar/roving.ts","../src/primitives/toolbar/Toolbar.tsx","../src/primitives/tool-group/ToolGroup.tsx","../src/primitives/warn-mark/WarnMark.tsx"],"sourcesContent":["// A badge: a short word or count in a rounded chip, tinted by its tone (a count of retries, a \"not ready\"). A tone it\n// does not know is drawn neutrally.\nimport type { ReactNode } from \"react\";\nimport \"./Badge.css\";\n\n/** The tones a badge draws; any other string is drawn neutrally. */\nexport type BadgeTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type BadgeProps = {\n /** The badge's tone: its text and border colour, and for warn and err a soft surface. */\n tone: BadgeTone;\n /** What the badge says: a word, a count, a WarnMark beside them. */\n children: ReactNode;\n /** Shown on hover: what the badge means. */\n title?: string;\n /** A class added to the badge. */\n className?: string;\n};\n\n/** Draws a short word or count in a chip of its tone. */\nexport function Badge({ tone, children, title, className }: BadgeProps) {\n return (\n <span className={className === undefined ? \"pb-badge\" : `pb-badge ${className}`} data-tone={tone} title={title}>\n {children}\n </span>\n );\n}\n","// The busy mark: an open ring in the current text colour that turns once per --pb-motion-spin, and under reduced\n// motion stands still (the open ring is still the mark). Without a label it is decoration, hidden from screen\n// readers, as inside a busy Button, whose own words and aria-busy say what is happening. With a label it is a status\n// that screen readers announce.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./Spinner.css\";\n\nexport type SpinnerProps = Omit<ComponentPropsWithRef<\"span\">, \"children\"> & {\n /** What is being waited for, read by screen readers; without it the spinner is hidden from them. */\n label?: string;\n};\n\nexport function Spinner({ label, className, ...rest }: SpinnerProps) {\n const classes = className === undefined ? \"pb-spinner\" : `pb-spinner ${className}`;\n if (label === undefined || label === \"\") {\n return <span {...rest} className={classes} aria-hidden=\"true\" />;\n }\n return (\n <span {...rest} className={`${classes} pb-spinner-labelled`} role=\"status\">\n <span className=\"pb-spinner-ring\" aria-hidden=\"true\" />\n <span className=\"pb-spinner-label\">{label}</span>\n </span>\n );\n}\n","// A push button in the library's look. Its tone (neutral, primary, danger, or any other word, drawn neutral) and size\n// are data attributes its stylesheet keys on. While busy it shows a Spinner over its words, which keep their place so\n// the button keeps its width, says aria-busy, and ignores presses (it stays focusable, unlike a disabled button, so\n// focus is not lost while a request is on its way).\nimport type { ComponentPropsWithRef, MouseEvent } from \"react\";\nimport { Spinner } from \"../spinner\";\nimport \"./Button.css\";\n\n/** What the button does, by colour: neutral (the default), primary (the one main action), danger; others draw neutral. */\nexport type ButtonTone = \"neutral\" | \"primary\" | \"danger\" | (string & {});\n\n/** md (the default) or sm, the compact one for dense rows; others draw as md. On touch both are at least 36 px tall. */\nexport type ButtonSize = \"md\" | \"sm\" | (string & {});\n\nexport type ButtonProps = ComponentPropsWithRef<\"button\"> & {\n tone?: ButtonTone;\n size?: ButtonSize;\n /** A request is on its way: a spinner over the words, aria-busy, and presses ignored. */\n busy?: boolean;\n};\n\nexport function Button({\n tone = \"neutral\",\n size = \"md\",\n busy = false,\n type = \"button\",\n className,\n children,\n onClick,\n ...rest\n}: ButtonProps) {\n function click(event: MouseEvent<HTMLButtonElement>) {\n if (busy) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n }\n return (\n <button\n {...rest}\n // A submit or reset button is asked for by name; a bare button inside a form never submits it.\n type={type}\n className={className === undefined ? \"pb-button\" : `pb-button ${className}`}\n data-tone={tone}\n data-size={size}\n aria-busy={busy || undefined}\n aria-disabled={busy || rest[\"aria-disabled\"] || undefined}\n onClick={click}\n >\n <span className=\"pb-button-content\">{children}</span>\n {busy && <Spinner className=\"pb-button-spinner\" />}\n </button>\n );\n}\n","// A tick box: a native checkbox (every native prop passes through, ref included, and id and aria props reach the\n// input, so Field can wire it), ticked in the accent. With a label it is wrapped in its own label, so a press on the\n// words ticks it too, and the row is a target a finger can find. Indeterminate (some of a group ticked) is a prop,\n// since HTML has it only as a DOM property.\nimport { useCallback, useLayoutEffect, useRef, type ComponentPropsWithRef, type ReactNode, type Ref } from \"react\";\nimport \"./Checkbox.css\";\n\nexport type CheckboxProps = Omit<ComponentPropsWithRef<\"input\">, \"type\"> & {\n /** The words beside the box, which tick it too; without them, name the box by a Field or aria-label. */\n label?: ReactNode;\n /** Neither ticked nor not: drawn as a dash and read as \"mixed\". */\n indeterminate?: boolean;\n};\n\nfunction assign<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n\nexport function Checkbox({ label, indeterminate = false, className, ref, ...rest }: CheckboxProps) {\n const own = useRef<HTMLInputElement | null>(null);\n const setRef = useCallback(\n (node: HTMLInputElement | null) => {\n own.current = node;\n assign(ref, node);\n },\n [ref],\n );\n useLayoutEffect(() => {\n if (own.current !== null) own.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const box = (\n <input\n {...rest}\n ref={setRef}\n type=\"checkbox\"\n className={label === undefined && className !== undefined ? `pb-checkbox ${className}` : \"pb-checkbox\"}\n />\n );\n if (label === undefined) return box;\n return (\n <label\n className={className === undefined ? \"pb-checkbox-row\" : `pb-checkbox-row ${className}`}\n data-disabled={rest.disabled === true || undefined}\n >\n {box}\n <span className=\"pb-checkbox-label\">{label}</span>\n </label>\n );\n}\n","// A square button that shows a glyph and is named by its label: the label is its accessible name and, unless a title\n// is given, its tooltip, and the glyph is hidden from screen readers. Tone, size and busy are Button's.\nimport type { ReactNode } from \"react\";\nimport { Button, type ButtonProps } from \"../button\";\nimport \"./IconButton.css\";\n\nexport type IconButtonProps = Omit<ButtonProps, \"children\" | \"aria-label\"> & {\n /** The button's name for screen readers, and its tooltip unless title says otherwise. */\n label: string;\n /** The glyph: an icon or a character, hidden from screen readers. */\n children: ReactNode;\n};\n\nexport function IconButton({ label, title, className, children, ...rest }: IconButtonProps) {\n return (\n <Button\n {...rest}\n className={className === undefined ? \"pb-icon-button\" : `pb-icon-button ${className}`}\n aria-label={label}\n title={title ?? label}\n >\n <span className=\"pb-icon-button-glyph\" aria-hidden=\"true\">\n {children}\n </span>\n </Button>\n );\n}\n","// The cross on Dialog's and Sheet's close buttons, in the current text colour. Internal: not exported by the layer.\nexport function CloseGlyph() {\n return (\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\">\n <path d=\"M3 3l10 10M13 3L3 13\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" />\n </svg>\n );\n}\n","// A modal dialog: drawn over the page (in a portal on <body>) above a scrim, with a title, a close button, the app's\n// content and an optional row of actions. While it is open, Tab and Shift+Tab stay inside it and focus that wanders\n// out is brought back; Escape, the close button and a press on the scrim ask the app to close it (onClose), and the\n// app closes it by setting open to false. Opening focuses the content's first control (or one the content focused\n// itself, as with autoFocus), else the dialog; the body is a tab stop of its own, so a long one scrolls from the\n// keyboard; closing gives focus back to what had it before. Only the topmost of\n// several open dialogs keeps the focus.\nimport { type ReactNode, type KeyboardEvent, useEffect, useId, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IconButton } from \"../icon-button\";\nimport { CloseGlyph } from \"./CloseGlyph\";\nimport \"./Dialog.css\";\n\nexport type DialogProps = {\n /** Whether the dialog is shown; the app holds it. */\n open: boolean;\n /** Asked for on Escape, the close button and a press on the scrim. */\n onClose: () => void;\n /** The dialog's title, which also names it for screen readers. */\n title: ReactNode;\n children: ReactNode;\n /** A row at the foot of the dialog, for its buttons. */\n actions?: ReactNode;\n /** The close button's name: \"Close\". */\n closeLabel?: string;\n /** A class added to the dialog's box. */\n className?: string;\n};\n\nconst focusable = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled]):not([type='hidden'])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"[tabindex]:not([tabindex='-1'])\",\n \"[contenteditable='true']\",\n].join(\",\");\n\n/** The controls inside `root` that Tab reaches, in order. */\nfunction tabbable(root: HTMLElement): HTMLElement[] {\n return [...root.querySelectorAll<HTMLElement>(focusable)].filter(\n (element) => element.closest(\"[hidden], [inert]\") === null && element.tabIndex >= 0,\n );\n}\n\n/** Whether `box` is the topmost open dialog: each opens in a portal appended to <body>, so the last one is on top. */\nfunction topmost(box: HTMLElement): boolean {\n const open = box.ownerDocument.querySelectorAll(\".pb-dialog\");\n return open[open.length - 1] === box;\n}\n\nfunction OpenDialog({ onClose, title, children, actions, closeLabel = \"Close\", className }: Omit<DialogProps, \"open\">) {\n const boxRef = useRef<HTMLDivElement>(null);\n const bodyRef = useRef<HTMLDivElement>(null);\n const titleId = useId();\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n useEffect(() => {\n const box = boxRef.current;\n if (box === null) return undefined;\n const before = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n if (!box.contains(document.activeElement)) {\n const body = bodyRef.current;\n (body === null ? undefined : tabbable(body)[0])?.focus();\n if (!box.contains(document.activeElement)) box.focus();\n }\n const keepFocus = (event: FocusEvent) => {\n if (!topmost(box)) return;\n if (event.target instanceof Node && box.contains(event.target)) return;\n (tabbable(box)[0] ?? box).focus();\n };\n document.addEventListener(\"focusin\", keepFocus);\n return () => {\n document.removeEventListener(\"focusin\", keepFocus);\n if (before?.isConnected === true) before.focus();\n };\n }, []);\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n onCloseRef.current();\n return;\n }\n if (event.key !== \"Tab\" || boxRef.current === null) return;\n const controls = tabbable(boxRef.current);\n const first = controls[0];\n const last = controls[controls.length - 1];\n if (first === undefined || last === undefined) {\n event.preventDefault();\n return;\n }\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === boxRef.current)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n return (\n <div\n className=\"pb-dialog-scrim\"\n onMouseDown={(event) => {\n // Only a press that starts on the scrim itself: a drag out of a text field does not close.\n if (event.target === event.currentTarget) onCloseRef.current();\n }}\n >\n <div\n ref={boxRef}\n className={className === undefined ? \"pb-dialog\" : `pb-dialog ${className}`}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n tabIndex={-1}\n onKeyDown={onKeyDown}\n >\n <div className=\"pb-dialog-head\">\n <h2 className=\"pb-dialog-title\" id={titleId}>\n {title}\n </h2>\n <IconButton\n className=\"pb-dialog-close\"\n label={closeLabel}\n onClick={() => {\n onCloseRef.current();\n }}\n >\n <CloseGlyph />\n </IconButton>\n </div>\n {/* Focusable, so a body that scrolls can be scrolled from the keyboard. */}\n <div ref={bodyRef} className=\"pb-dialog-body\" tabIndex={0}>\n {children}\n </div>\n {actions === undefined ? null : <div className=\"pb-dialog-actions\">{actions}</div>}\n </div>\n </div>\n );\n}\n\nexport function Dialog({ open, ...rest }: DialogProps) {\n if (!open) return null;\n return createPortal(<OpenDialog {...rest} />, document.body);\n}\n","// A labelled form control: the label, the control (its one child), a hint under it and an error under that. It wires\n// the control to them itself: the control gets an id the label points at (its own id if it has one), aria-describedby\n// naming the hint and the error (after any ids it already has), and aria-invalid while there is an error. The control\n// is any element that passes those props on to its native element, as TextInput, Select and Checkbox do.\nimport {\n cloneElement,\n isValidElement,\n useId,\n type AriaAttributes,\n type ComponentPropsWithRef,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport \"./Field.css\";\n\n/** stacked (the default: the label above the control) or inline (the label in a column to its left); others stack. */\nexport type FieldLayout = \"stacked\" | \"inline\" | (string & {});\n\n/** The props Field sets on its control. */\nexport type FieldControlProps = {\n id?: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: AriaAttributes[\"aria-invalid\"];\n};\n\nexport type FieldProps = Omit<ComponentPropsWithRef<\"div\">, \"children\"> & {\n /** What the control is, as its accessible name. */\n label: ReactNode;\n /** Why the value is refused; while there is one the control is marked invalid. Empty means none. */\n error?: ReactNode;\n /** A line of help under the control. */\n hint?: ReactNode;\n layout?: FieldLayout;\n /** The control: one element that passes id and aria props on to its native element. */\n children: ReactElement<FieldControlProps>;\n};\n\nfunction present(node: ReactNode): boolean {\n return node !== undefined && node !== null && node !== false && node !== \"\";\n}\n\nexport function Field({ label, error, hint, layout = \"stacked\", className, children, ...rest }: FieldProps) {\n const base = useId();\n const control: unknown = children;\n const own = isValidElement<FieldControlProps>(control) ? control.props : undefined;\n const controlId = own?.id ?? `${base}-control`;\n const hintId = present(hint) ? `${base}-hint` : undefined;\n const errorId = present(error) ? `${base}-error` : undefined;\n const describedBy = [own?.[\"aria-describedby\"], hintId, errorId].filter((id) => id !== undefined && id !== \"\");\n const wired =\n own === undefined\n ? children\n : cloneElement(children, {\n id: controlId,\n \"aria-describedby\": describedBy.length > 0 ? describedBy.join(\" \") : undefined,\n \"aria-invalid\": errorId !== undefined ? true : own[\"aria-invalid\"],\n });\n return (\n <div\n {...rest}\n className={className === undefined ? \"pb-field\" : `pb-field ${className}`}\n data-layout={layout}\n data-invalid={errorId !== undefined || undefined}\n >\n <label className=\"pb-field-label\" htmlFor={controlId}>\n {label}\n </label>\n <div className=\"pb-field-control\">\n {wired}\n {hintId !== undefined && (\n <div className=\"pb-field-hint\" id={hintId}>\n {hint}\n </div>\n )}\n {errorId !== undefined && (\n <div className=\"pb-field-error\" id={errorId}>\n {error}\n </div>\n )}\n </div>\n </div>\n );\n}\n","// Facts as a two-column list of keys and values (a status summary, an inspector's details), drawn as a <dl> so each key\n// names its value for screen readers. A row's tone colours its value; a tone it does not know leaves it plain.\nimport type { ReactNode } from \"react\";\nimport \"./KeyValue.css\";\n\n/** The tones a value draws in; any other string leaves it plain. */\nexport type KeyValueTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type KeyValueRow = {\n /** The fact's name. */\n key: string;\n /** Its value. */\n value: ReactNode;\n /** Colours the value: a fact that is wrong or worth a look. */\n tone?: KeyValueTone;\n /** Shown on hover over the key: what the fact means. */\n title?: string;\n};\n\nexport type KeyValueProps = {\n /** The facts, in order. */\n rows: readonly KeyValueRow[];\n /** Names the list for screen readers when no heading does. */\n label?: string;\n /** A class added to the list. */\n className?: string;\n};\n\n/** Draws facts as keys and their values, side by side. */\nexport function KeyValue({ rows, label, className }: KeyValueProps) {\n return (\n <dl className={className === undefined ? \"pb-key-value\" : `pb-key-value ${className}`} aria-label={label}>\n {rows.map((row, index) => (\n // Rows have no identity beyond their place; two may share a key.\n <div key={index} className=\"pb-key-value-row\" data-tone={row.tone}>\n <dt title={row.title}>{row.key}</dt>\n <dd>{row.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n","// Keeps a scrolling box reachable by keyboard: while its content overflows it is a tab stop (so the arrow keys and Page\n// Up and Down scroll it), and while everything fits it is not, so a short panel adds no empty stop to the tab order.\nimport { useEffect, type RefObject } from \"react\";\n\n/** Whether `box`'s content is taller or wider than the box. */\nexport function overflows(box: HTMLElement): boolean {\n return box.scrollHeight > box.clientHeight || box.scrollWidth > box.clientWidth;\n}\n\n/** Makes `ref`'s box focusable exactly while it overflows, watching its size and its content. */\nexport function useScrollFocus(ref: RefObject<HTMLElement | null>): void {\n useEffect(() => {\n const box = ref.current;\n if (box === null) return;\n const settle = () => {\n if (overflows(box)) box.tabIndex = 0;\n else box.removeAttribute(\"tabindex\");\n };\n settle();\n // jsdom has no ResizeObserver; the content watch still runs there.\n const sizes = typeof ResizeObserver === \"function\" ? new ResizeObserver(settle) : null;\n const observeChildren = () => {\n if (sizes === null) return;\n sizes.disconnect();\n sizes.observe(box);\n for (const child of box.children) sizes.observe(child);\n };\n observeChildren();\n const content = new MutationObserver(() => {\n observeChildren();\n settle();\n });\n content.observe(box, { childList: true, subtree: true, characterData: true });\n return () => {\n sizes?.disconnect();\n content.disconnect();\n };\n }, [ref]);\n}\n","// A panel: a region of the page with an optional header (its title, and actions at the far end) over a body that\n// scrolls on its own, as an inspector or a side panel. It draws no outer border: the layout that places it (a docked\n// side, a sheet, a card) draws its edges. Its title names the region for screen readers. While its body overflows, the\n// body is a tab stop, so the keyboard can scroll it.\nimport { useId, useRef, type ComponentPropsWithRef, type ReactNode } from \"react\";\nimport { useScrollFocus } from \"./scroll-focus\";\nimport \"./Panel.css\";\n\nexport type PanelProps = Omit<ComponentPropsWithRef<\"section\">, \"title\"> & {\n /** The panel's heading; it also names the region. Without one, name it with aria-label. */\n title?: ReactNode;\n /** Slot at the header's far end: buttons, a count, a close button. */\n actions?: ReactNode;\n /** The title's heading level, h1 to h6; h2 by default. */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n children?: ReactNode;\n};\n\n/** Draws a titled region with its actions and a body that scrolls. */\nexport function Panel({ title, actions, level = 2, className, children, ...rest }: PanelProps) {\n const titleId = useId();\n const body = useRef<HTMLDivElement>(null);\n useScrollFocus(body);\n const Heading = `h${String(level)}` as \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n const header = title !== undefined || actions !== undefined;\n return (\n <section\n {...rest}\n aria-labelledby={\n rest[\"aria-labelledby\"] ?? (title !== undefined && rest[\"aria-label\"] === undefined ? titleId : undefined)\n }\n className={className === undefined ? \"pb-panel\" : `pb-panel ${className}`}\n >\n {header && (\n <header className=\"pb-panel-header\">\n {title !== undefined && (\n <Heading id={titleId} className=\"pb-panel-title\">\n {title}\n </Heading>\n )}\n {actions !== undefined && <div className=\"pb-panel-actions\">{actions}</div>}\n </header>\n )}\n <div ref={body} className=\"pb-panel-body\">\n {children}\n </div>\n </section>\n );\n}\n","// A state pill: a dot in the state's tone and the word beside it, so the state never rests on colour alone. A tone it\n// does not know is drawn neutrally, by its own word.\nimport type { ReactNode } from \"react\";\nimport \"./Pill.css\";\n\n/** The tones a pill draws; any other string is drawn neutrally. */\nexport type PillTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type PillProps = {\n /** The state's tone: the dot's and the word's colour. */\n tone: PillTone;\n /** The state in words, always shown beside the dot. */\n label: string;\n /** Pulses the dot (never the word) while the state is on its way, such as \"starting\"; stops under reduced motion. */\n pulse?: boolean;\n /** Shown on hover: what the state means or why it is so. */\n title?: string;\n /** After the word, in code type: a failure's code, say. */\n detail?: ReactNode;\n /** A class added to the pill. */\n className?: string;\n};\n\n/** Draws a state as a dot and its word, in the state's tone. */\nexport function Pill({ tone, label, pulse = false, title, detail, className }: PillProps) {\n return (\n <span\n className={className === undefined ? \"pb-pill\" : `pb-pill ${className}`}\n data-tone={tone}\n data-pulse={pulse ? \"\" : undefined}\n title={title}\n >\n <span className=\"pb-pill-dot\" aria-hidden=\"true\" />\n {label}\n {detail !== undefined && <code className=\"pb-pill-detail\">{detail}</code>}\n </span>\n );\n}\n","// A section's title in a panel or inspector, a heading with its actions (buttons, a count) at the far end. The\n// heading's level fits the page it sits in.\nimport type { ReactNode } from \"react\";\nimport \"./SectionTitle.css\";\n\nexport type SectionTitleProps = {\n /** The title. */\n children: ReactNode;\n /** Slot at the title's far end: buttons, a count, a badge. */\n actions?: ReactNode;\n /** The heading's level, h2 to h6. */\n level?: 2 | 3 | 4 | 5 | 6;\n /** A class added to the title's row. */\n className?: string;\n};\n\n/** Draws a section's heading, with its actions at the far end. */\nexport function SectionTitle({ children, actions, level = 3, className }: SectionTitleProps) {\n const Heading = `h${level}` as const;\n return (\n <div className={className === undefined ? \"pb-section-title\" : `pb-section-title ${className}`}>\n <Heading className=\"pb-section-title-text\">{children}</Heading>\n {actions !== undefined && <div className=\"pb-section-title-actions\">{actions}</div>}\n </div>\n );\n}\n","// A drop-down choice in the library's look: a native select (every native prop passes through, ref included; its\n// options are its children), so the platform's own list opens, the keyboard works as the platform's does, and a phone\n// shows its picker. It shows aria-invalid in the error tone, as Field sets it. On a touch screen its text is 16 px, as\n// iOS Safari zooms the page when a smaller field takes the focus.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./Select.css\";\n\n/** ui (the default) or code, the monospace face for values written as code; others draw as ui. */\nexport type SelectFont = \"ui\" | \"code\" | (string & {});\n\nexport type SelectProps = ComponentPropsWithRef<\"select\"> & {\n font?: SelectFont;\n};\n\nexport function Select({ font = \"ui\", className, children, ...rest }: SelectProps) {\n return (\n <select {...rest} className={className === undefined ? \"pb-select\" : `pb-select ${className}`} data-font={font}>\n {children}\n </select>\n );\n}\n","// A sheet: a panel drawn over its container's right edge or rising from its bottom, as an inspector is on a narrow\n// window or a phone. It is not modal: the page around it stays live, and opening it does not take the focus (a\n// selection on the canvas opens it while the person is still working there). Escape inside it and its close button\n// ask the app to close it; if the focus was inside when it closes, it goes back to where it came from. The sheet is\n// placed absolutely, so its container (the app's workspace) is positioned; the app holds open, and chooses the side\n// (the right edge below 760 px, the bottom below 600 px).\nimport {\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n type CSSProperties,\n useEffect,\n useId,\n useRef,\n} from \"react\";\nimport { CloseGlyph } from \"../dialog/CloseGlyph\";\nimport { IconButton } from \"../icon-button\";\nimport \"./Sheet.css\";\n\nexport type SheetSide = \"right\" | \"bottom\";\n\nexport type SheetProps = {\n /** Whether the sheet is shown; the app holds it. */\n open: boolean;\n /** Asked for on Escape inside the sheet and on its close button. */\n onClose: () => void;\n /** The edge it is drawn from: the right edge (the default) or the bottom. */\n side?: SheetSide;\n /** The sheet's title, which also names it for screen readers; without one, name it with `label`. */\n title?: ReactNode;\n /** The sheet's name for screen readers when it has no title. */\n label?: string;\n children: ReactNode;\n /** A right sheet's width in px, held to 280–560 px and to 48 px short of its container. */\n width?: number;\n /** The close button's name: \"Close\". */\n closeLabel?: string;\n /** A class added to the sheet. */\n className?: string;\n};\n\nfunction OpenSheet({\n onClose,\n side = \"right\",\n title,\n label,\n children,\n width,\n closeLabel = \"Close\",\n className,\n}: Omit<SheetProps, \"open\">) {\n const sheetRef = useRef<HTMLElement>(null);\n const titleId = useId();\n /** Where the focus came from when it entered the sheet: it goes back there if the sheet closes holding it. */\n const cameFrom = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n const sheet = sheetRef.current;\n return () => {\n const back = cameFrom.current;\n const active = document.activeElement;\n const held = active === null || active === document.body || (sheet?.contains(active) ?? false);\n if (held && back?.isConnected === true) back.focus();\n };\n }, []);\n\n const onFocus = (event: FocusEvent<HTMLElement>) => {\n const from = event.relatedTarget;\n if (from instanceof HTMLElement && !event.currentTarget.contains(from)) cameFrom.current = from;\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if (event.defaultPrevented || event.key !== \"Escape\") return;\n event.preventDefault();\n event.stopPropagation();\n onClose();\n };\n\n const style = width === undefined ? undefined : ({ \"--pb-sheet-width\": `${width}px` } as CSSProperties);\n\n return (\n <section\n ref={sheetRef}\n className={className === undefined ? \"pb-sheet\" : `pb-sheet ${className}`}\n data-side={side}\n role=\"dialog\"\n aria-labelledby={title === undefined ? undefined : titleId}\n aria-label={title === undefined ? label : undefined}\n style={style}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n >\n <div className=\"pb-sheet-head\">\n {title === undefined ? (\n <span className=\"pb-sheet-title\" />\n ) : (\n <h2 className=\"pb-sheet-title\" id={titleId}>\n {title}\n </h2>\n )}\n <IconButton className=\"pb-sheet-close\" label={closeLabel} onClick={onClose}>\n <CloseGlyph />\n </IconButton>\n </div>\n {/* Focusable, so a body that scrolls can be scrolled from the keyboard. */}\n <div className=\"pb-sheet-body\" tabIndex={0}>\n {children}\n </div>\n </section>\n );\n}\n\nexport function Sheet({ open, ...rest }: SheetProps) {\n if (!open) return null;\n return <OpenSheet {...rest} />;\n}\n","// A splitter's maths, pure: a size kept within its bounds, a drag, and a key. Splitter.tsx draws and listens; this\n// file decides the size.\n\n/** The smallest and largest size, in px. */\nexport interface Bounds {\n min: number;\n max: number;\n}\n\n/** `value` within `bounds`, in whole px. A max below the min is read as the min. */\nexport function clamp(value: number, bounds: Bounds): number {\n const max = Math.max(bounds.min, bounds.max);\n return Math.round(Math.min(max, Math.max(bounds.min, value)));\n}\n\n/**\n * A drag: the size at the drag's start plus the pointer's travel times `sign`, clamped. The sign is -1 for a splitter on\n * the start edge (left or top) of what it resizes, where moving left or up grows it, and 1 on the end edge.\n */\nexport function dragged(start: number, travel: number, sign: 1 | -1, bounds: Bounds): number {\n return clamp(start + sign * travel, bounds);\n}\n\n/** Which arrow grows what the splitter resizes, from its orientation and the edge it sits on. */\nexport function growKey(orientation: \"vertical\" | \"horizontal\", edge: \"start\" | \"end\"): string {\n if (orientation === \"vertical\") return edge === \"start\" ? \"ArrowLeft\" : \"ArrowRight\";\n return edge === \"start\" ? \"ArrowUp\" : \"ArrowDown\";\n}\n\nconst opposite: Record<string, string> = {\n ArrowLeft: \"ArrowRight\",\n ArrowRight: \"ArrowLeft\",\n ArrowUp: \"ArrowDown\",\n ArrowDown: \"ArrowUp\",\n};\n\n/**\n * A key on a focused splitter: `grow` adds `step` and its opposite arrow takes it away, clamped; Home goes to the min\n * and End to the max; any other key gives undefined (the key is not the splitter's).\n */\nexport function keyed(value: number, key: string, grow: string, step: number, bounds: Bounds): number | undefined {\n if (key === grow) return clamp(value + step, bounds);\n if (key === opposite[grow]) return clamp(value - step, bounds);\n if (key === \"Home\") return clamp(bounds.min, bounds);\n if (key === \"End\") return clamp(bounds.max, bounds);\n return undefined;\n}\n","// A resize handle, as a WAI-ARIA separator: the edge of a pane, dragged with the pointer or moved by the arrow keys,\n// Home and End while focused. It keeps only the drag in progress; the size is the app's (value and onChange). It sits\n// absolutely on one edge of its positioned parent, the pane it resizes. splitter-math.ts holds the maths.\nimport { useRef, type ComponentPropsWithRef, type KeyboardEvent, type PointerEvent } from \"react\";\nimport { dragged, growKey, keyed } from \"./splitter-math\";\nimport \"./Splitter.css\";\n\n/** vertical: a vertical bar that resizes a width; horizontal: a horizontal bar that resizes a height. */\nexport type SplitterOrientation = \"vertical\" | \"horizontal\";\n\n/** The edge of the resized pane the splitter sits on: start is its left or top, end its right or bottom. */\nexport type SplitterEdge = \"start\" | \"end\";\n\nexport type SplitterProps = Omit<\n ComponentPropsWithRef<\"div\">,\n \"onChange\" | \"children\" | \"role\" | \"aria-orientation\" | \"aria-valuenow\" | \"aria-valuemin\" | \"aria-valuemax\"\n> & {\n orientation: SplitterOrientation;\n /** The pane's size in px. */\n value: number;\n /** The smallest size in px. */\n min: number;\n /** The largest size in px. */\n max: number;\n /** A new size, in whole px within min and max. */\n onChange: (px: number) => void;\n /** The separator's accessible name, such as \"Resize the inspector\". */\n label: string;\n /** Which edge of the pane it sits on; start (left or top) by default, where moving left or up grows the pane. */\n edge?: SplitterEdge;\n /** How far one arrow key moves it, in px; 16 by default. */\n step?: number;\n};\n\n/** Draws a pane's resize handle, dragged by pointer or moved by keys. */\nexport function Splitter({\n orientation,\n value,\n min,\n max,\n onChange,\n label,\n edge = \"start\",\n step = 16,\n className,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n onKeyDown,\n ...rest\n}: SplitterProps) {\n const drag = useRef<{ start: number; at: number } | null>(null);\n const bounds = { min, max };\n const along = (event: PointerEvent) => (orientation === \"vertical\" ? event.clientX : event.clientY);\n\n function down(event: PointerEvent<HTMLDivElement>) {\n onPointerDown?.(event);\n if (event.defaultPrevented || event.button !== 0) return;\n event.preventDefault();\n const target = event.currentTarget;\n // Captured, the drag follows the pointer past the bar's few px; jsdom has no capture.\n if (typeof target.setPointerCapture === \"function\") target.setPointerCapture(event.pointerId);\n target.focus();\n target.dataset[\"dragging\"] = \"\";\n drag.current = { start: value, at: along(event) };\n }\n function move(event: PointerEvent<HTMLDivElement>) {\n onPointerMove?.(event);\n const started = drag.current;\n if (started === null) return;\n const next = dragged(started.start, along(event) - started.at, edge === \"start\" ? -1 : 1, bounds);\n if (next !== value) onChange(next);\n }\n function end(event: PointerEvent<HTMLDivElement>) {\n if (event.type === \"pointercancel\") onPointerCancel?.(event);\n else onPointerUp?.(event);\n if (drag.current === null) return;\n drag.current = null;\n const target = event.currentTarget;\n delete target.dataset[\"dragging\"];\n if (typeof target.hasPointerCapture === \"function\" && target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n }\n function key(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;\n const next = keyed(value, event.key, growKey(orientation, edge), step, bounds);\n if (next === undefined) return;\n event.preventDefault();\n if (next !== value) onChange(next);\n }\n\n return (\n <div\n {...rest}\n role=\"separator\"\n tabIndex={rest.tabIndex ?? 0}\n aria-orientation={orientation}\n aria-label={label}\n aria-valuenow={value}\n aria-valuemin={min}\n aria-valuemax={max}\n className={className === undefined ? \"pb-splitter\" : `pb-splitter ${className}`}\n data-orientation={orientation}\n data-edge={edge}\n onPointerDown={down}\n onPointerMove={move}\n onPointerUp={end}\n onPointerCancel={end}\n onKeyDown={key}\n />\n );\n}\n","// A one-line text field in the library's look: a native input (every native prop passes through, ref included), in\n// the UI face or the code face. It shows aria-invalid in the error tone, as Field sets it. On a touch screen its text is\n// 16 px, as iOS Safari zooms the page when a smaller field takes the focus.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./TextInput.css\";\n\n/** ui (the default) or code, the monospace face for values written as code; others draw as ui. */\nexport type TextInputFont = \"ui\" | \"code\" | (string & {});\n\nexport type TextInputProps = ComponentPropsWithRef<\"input\"> & {\n font?: TextInputFont;\n};\n\nexport function TextInput({ font = \"ui\", type = \"text\", className, ...rest }: TextInputProps) {\n return (\n <input\n {...rest}\n type={type}\n className={className === undefined ? \"pb-text-input\" : `pb-text-input ${className}`}\n data-font={font}\n />\n );\n}\n","// The theme switch: one button that cycles system, light and dark. Its word is shown beside the icon, and its\n// accessible name always says the choice, so it is never just a glyph; the icon is SVG, since a font may lack a ◐\n// character. The choice is the app's (useTheme keeps it); the switch only says it and asks for the next. At phone\n// width the word gives way to the icon alone, and the name still says the choice.\nimport type { ComponentPropsWithRef } from \"react\";\nimport type { ThemeChoice } from \"../../hooks/use-theme/useTheme\";\nimport \"./ThemeSwitch.css\";\n\nexport type { ThemeChoice };\n\n/** The switch's words, each replaceable. */\nexport interface ThemeSwitchLabels {\n /** What the switch is: \"Theme\". */\n theme: string;\n system: string;\n light: string;\n dark: string;\n /** Said of system in the tooltip: \"follows the system's setting\". */\n systemHint: string;\n /** Before the next choice in the tooltip: \"click for\". */\n clickFor: string;\n}\n\nexport const defaultThemeSwitchLabels: ThemeSwitchLabels = {\n theme: \"Theme\",\n system: \"system\",\n light: \"light\",\n dark: \"dark\",\n systemHint: \"follows the system's setting\",\n clickFor: \"click for\",\n};\n\nconst order: readonly ThemeChoice[] = [\"system\", \"light\", \"dark\"];\n\n/** The choice a press moves to: system, light, dark and back. */\nfunction following(choice: ThemeChoice): ThemeChoice {\n return order[(order.indexOf(choice) + 1) % order.length] ?? \"system\";\n}\n\nexport type ThemeSwitchProps = Omit<ComponentPropsWithRef<\"button\">, \"children\" | \"onClick\" | \"type\" | \"title\"> & {\n /** The theme now. */\n choice: ThemeChoice;\n /** Called with the next choice in the cycle when the switch is pressed. */\n onChoose: (next: ThemeChoice) => void;\n /** Words to replace; the rest keep their defaults. */\n labels?: Partial<ThemeSwitchLabels>;\n};\n\n/** The switch's tooltip: what the theme is and what a press does. */\nexport function themeSwitchTitle(choice: ThemeChoice, labels: ThemeSwitchLabels = defaultThemeSwitchLabels): string {\n const hint = choice === \"system\" ? ` (${labels.systemHint})` : \"\";\n return `${labels.theme}: ${labels[choice]}${hint}; ${labels.clickFor} ${labels[following(choice)]}`;\n}\n\nexport function ThemeSwitch({ choice, onChoose, labels, className, ...rest }: ThemeSwitchProps) {\n const words = { ...defaultThemeSwitchLabels, ...labels };\n return (\n <button\n {...rest}\n type=\"button\"\n className={className === undefined ? \"pb-theme-switch\" : `pb-theme-switch ${className}`}\n title={themeSwitchTitle(choice, words)}\n aria-label={`${words.theme}: ${words[choice]}`}\n onClick={() => {\n onChoose(following(choice));\n }}\n >\n <svg className=\"pb-theme-switch-icon\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\">\n <circle cx=\"8\" cy=\"8\" r=\"6.25\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M8 1.75a6.25 6.25 0 0 1 0 12.5z\" fill=\"currentColor\" />\n </svg>\n <span className=\"pb-theme-switch-word\">{words[choice]}</span>\n </button>\n );\n}\n","// Roving focus over a toolbar's items, pure DOM: which elements are items, which one holds the toolbar's one tab stop,\n// and where an arrow key, Home or End moves the focus. Toolbar.tsx wires it to React.\n\n/** What counts as an item: an enabled control, or anything that says it is a button, checkbox or radio. */\nexport const itemSelector = [\n \"button:not(:disabled)\",\n \"a[href]\",\n \"input:not(:disabled)\",\n \"select:not(:disabled)\",\n \"textarea:not(:disabled)\",\n '[role=\"button\"]',\n '[role=\"checkbox\"]',\n '[role=\"radio\"]',\n '[role=\"menuitem\"]',\n '[role=\"switch\"]',\n].join(\", \");\n\n/** The toolbar's items, in document order, leaving out those of a toolbar nested inside it. */\nexport function items(toolbar: HTMLElement): HTMLElement[] {\n return [...toolbar.querySelectorAll<HTMLElement>(itemSelector)].filter(\n (item) => item.closest('[role=\"toolbar\"]') === toolbar,\n );\n}\n\n/** Gives `current` the one tab stop (0) and every other item -1; with no current, the first item takes it. */\nexport function setTabStop(all: readonly HTMLElement[], current: HTMLElement | null): HTMLElement | null {\n const stop = current !== null && all.includes(current) ? current : (all[0] ?? null);\n for (const item of all) item.tabIndex = item === stop ? 0 : -1;\n return stop;\n}\n\n/**\n * The item a key moves the focus to from `index`, or undefined when the key is not the toolbar's. Horizontal toolbars\n * take the left and right arrows (swapped right to left), vertical ones up and down; both take Home and End. The ends\n * wrap around.\n */\nexport function moved(\n index: number,\n count: number,\n key: string,\n orientation: \"horizontal\" | \"vertical\",\n rtl: boolean,\n): number | undefined {\n if (count === 0) return undefined;\n if (key === \"Home\") return 0;\n if (key === \"End\") return count - 1;\n const [back, forth] =\n orientation === \"vertical\"\n ? [\"ArrowUp\", \"ArrowDown\"]\n : rtl\n ? [\"ArrowRight\", \"ArrowLeft\"]\n : [\"ArrowLeft\", \"ArrowRight\"];\n if (key === forth) return (index + 1) % count;\n if (key === back) return (index - 1 + count) % count;\n return undefined;\n}\n\n/** Whether a key pressed in `element` belongs to the text it edits (arrows, Home and End move its caret). */\nexport function editsText(element: Element): boolean {\n if (element instanceof HTMLTextAreaElement) return true;\n if (element instanceof HTMLInputElement) {\n return ![\"button\", \"checkbox\", \"radio\", \"reset\", \"submit\", \"image\", \"color\", \"file\", \"range\"].includes(\n element.type,\n );\n }\n return element instanceof HTMLElement && element.isContentEditable;\n}\n","// A WAI-ARIA toolbar: a row (or column) of controls that is one tab stop, the arrow keys, Home and End moving the focus\n// between its items (roving tabindex). The items are whatever controls its children render; the toolbar sets their\n// tabIndex itself, so an item's own tabIndex is overwritten. The item last focused keeps the tab stop, and a text field\n// inside keeps its own arrow keys. roving.ts holds the rules.\nimport { useEffect, useRef, type ComponentPropsWithRef, type FocusEvent, type KeyboardEvent } from \"react\";\nimport { editsText, items, moved, setTabStop } from \"./roving\";\nimport \"./Toolbar.css\";\n\nexport type ToolbarOrientation = \"horizontal\" | \"vertical\";\n\nexport type ToolbarProps = Omit<ComponentPropsWithRef<\"div\">, \"role\" | \"aria-orientation\"> & {\n /** The toolbar's accessible name, such as \"Canvas\". */\n label: string;\n /** horizontal (the default) moves with the left and right arrows; vertical with up and down. */\n orientation?: ToolbarOrientation;\n};\n\n/** Draws a group of controls as one tab stop, with the arrow keys moving between them. */\nexport function Toolbar({\n label,\n orientation = \"horizontal\",\n className,\n ref,\n onKeyDown,\n onFocus,\n children,\n ...rest\n}: ToolbarProps) {\n const own = useRef<HTMLDivElement | null>(null);\n const current = useRef<HTMLElement | null>(null);\n\n // After every render, and whenever an item comes, goes or is enabled or disabled, one item holds the tab stop.\n useEffect(() => {\n const toolbar = own.current;\n if (toolbar === null) return;\n const settle = () => {\n current.current = setTabStop(items(toolbar), current.current);\n };\n settle();\n const watch = new MutationObserver(settle);\n watch.observe(toolbar, { childList: true, subtree: true, attributes: true, attributeFilter: [\"disabled\", \"href\"] });\n return () => {\n watch.disconnect();\n };\n });\n\n function focus(event: FocusEvent<HTMLDivElement>) {\n onFocus?.(event);\n const toolbar = own.current;\n if (toolbar === null) return;\n const all = items(toolbar);\n if (event.target instanceof HTMLElement && all.includes(event.target)) {\n current.current = setTabStop(all, event.target);\n }\n }\n function key(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n const toolbar = own.current;\n if (event.defaultPrevented || toolbar === null || event.altKey || event.ctrlKey || event.metaKey) return;\n if (editsText(event.target as Element)) return;\n const all = items(toolbar);\n const index = all.indexOf(event.target as HTMLElement);\n if (index === -1) return;\n const rtl = getComputedStyle(toolbar).direction === \"rtl\";\n const next = moved(index, all.length, event.key, orientation, rtl);\n if (next === undefined) return;\n event.preventDefault();\n all[next]?.focus();\n }\n\n return (\n <div\n {...rest}\n ref={(element) => {\n own.current = element;\n if (typeof ref === \"function\") return ref(element);\n if (ref) ref.current = element;\n return undefined;\n }}\n role=\"toolbar\"\n aria-label={label}\n aria-orientation={orientation}\n className={className === undefined ? \"pb-toolbar\" : `pb-toolbar ${className}`}\n onKeyDown={key}\n onFocus={focus}\n >\n {children}\n </div>\n );\n}\n","// A floating group of tools, such as a canvas's zoom, fit and minimap: a Toolbar drawn as one raised, framed group of\n// square buttons. Its tools are IconButtons (or plain <button>s named by aria-label with their\n// glyph hidden); a pressed one (aria-pressed) is drawn in the accent. 28 px buttons, 40 px on touch.\nimport { Toolbar, type ToolbarProps } from \"../toolbar\";\nimport \"./ToolGroup.css\";\n\nexport type ToolGroupProps = ToolbarProps;\n\n/** Draws a framed group of square tool buttons, one tab stop with roving focus. */\nexport function ToolGroup({ className, ...rest }: ToolGroupProps) {\n return <Toolbar {...rest} className={className === undefined ? \"pb-tool-group\" : `pb-tool-group ${className}`} />;\n}\n","// The warning mark: an \"!\" in a circle beside words, for something that rose lately (a badge's or a counter's). The\n// glyph is hidden from screen readers, which read its label instead.\nimport \"./WarnMark.css\";\n\nexport type WarnMarkProps = {\n /** What the mark means, read by screen readers in its place. */\n label: string;\n /** Shown on hover over the mark. */\n title?: string;\n /** A class added to the mark. */\n className?: string;\n};\n\n/** Draws a warning \"!\" for the eye and its words for screen readers. */\nexport function WarnMark({ label, title, className }: WarnMarkProps) {\n return (\n <>\n <span\n className={className === undefined ? \"pb-warn-mark\" : `pb-warn-mark ${className}`}\n aria-hidden=\"true\"\n title={title}\n >\n !\n </span>\n <span className=\"pb-warn-mark-text\">{label}</span>\n </>\n );\n}\n"],"mappings":";;;;AAoBA,SAAgBC,EAAM,EAAE,SAAM,aAAU,UAAO,gBAAyB;CACtE,OACE,kBAAC,QAAD;EAAM,WAAWC,MAAc,KAAA,IAAY,aAAa,YAAYA;EAAa,aAAWC;EAAa;EACtG;CACG,CAAA;AAEV;;ACdA,SAAgBC,EAAQ,EAAE,UAAO,cAAW,GAAGC,KAAsB;CACnE,IAAMC,IAAUJ,MAAc,KAAA,IAAY,eAAe,cAAcA;CAIvE,OAHIK,MAAU,KAAA,KAAaA,MAAU,KAC5B,kBAAC,QAAD;EAAM,GAAIF;EAAM,WAAWC;EAAS,eAAY;CAAQ,CAAA,IAG/D,kBAAC,QAAD;EAAM,GAAID;EAAM,WAAW,GAAGC,EAAQ;EAAuB,MAAK;EAAlE,UAAA,CACE,kBAAC,QAAD;GAAM,WAAU;GAAkB,eAAY;EAAQ,CAAA,GACtD,kBAAC,QAAD;GAAM,WAAU;GAAoB,UAAAC;EAAY,CAAA,CAC5C;;AAEV;;ACFA,SAAgBC,EAAO,EACrB,UAAO,WACP,UAAO,MACP,UAAO,IACP,UAAO,UACP,cACA,aACA,YACA,GAAGH,KACW;CACd,SAASI,EAAM,GAAsC;EACnD,AAAIC,IACFC,EAAM,eAAe,IAGvBC,IAAUD,CAAK;CACjB;CACA,OACE,kBAAC,UAAD;EACE,GAAIN;EAEE;EACN,WAAWH,MAAc,KAAA,IAAY,cAAc,aAAaA;EAChE,aAAWC;EACX,aAAWU;EACX,aAAWH,KAAQ,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UgB;EAEzB;EACA,MAAK;EACL,cAAYxB;EACZ,oBAAkBuG;EAClB,WAAW5G,MAAc,KAAA,IAAY,eAAe,cAAcA;EAClE,WAAWgH;EACX,SAAS0C;EAER;CACE,CAAA;AAET;;AChFA,SAAgBC,EAAU,EAAE,cAAW,GAAGxJ,KAAwB;CAChE,OAAO,kBAACqJ,GAAD;EAAS,GAAIrJ;EAAM,WAAWH,MAAc,KAAA,IAAY,kBAAkB,iBAAiBA;CAAc,CAAA;AAClH;;ACGA,SAAgB4J,EAAS,EAAE,UAAO,UAAO,gBAA4B;CACnE,OACE,kBAAA9J,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;EACE,WAAWE,MAAc,KAAA,IAAY,iBAAiB,gBAAgBA;EACtE,eAAY;EACL;EACR,UAAA;CAEK,CAAA,GACN,kBAAC,QAAD;EAAM,WAAU;EAAqB,UAAAK;CAAY,CAAA,CACjD,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"primitives.js","names":["present","_Fragment","Badge","className","tone","variant","Spinner","rest","classes","label","Button","click","busy","event","onClick","size","assign","ref","value","Checkbox","own","useRef","setRef","useCallback","node","indeterminate","box","IconButton","title","CloseGlyph","focusable","tabbable","root","element","topmost","open","OpenDialog","boxRef","bodyRef","titleId","useId","onCloseRef","onClose","useEffect","before","body","keepFocus","controls","first","last","active","closeLabel","actions","Dialog","createPortal","present$1","Field","base","control","children","isValidElement","controlId","hintId","hint","errorId","error","describedBy","id","wired","cloneElement","layout","KeyValue","rows","row","index","overflows","useScrollFocus","settle","sizes","observeChildren","child","content","Panel","Heading","level","header","Pill","pulse","detail","present","RadioGroup","describedByOwn","invalidOwn","groupName","name","legendHidden","legend","options","option","SectionTitle","Select","font","OpenSheet","sheetRef","cameFrom","sheet","back","onFocus","from","onKeyDown","style","width","side","Sheet","clamp","max","bounds","dragged","start","sign","travel","growKey","orientation","edge","opposite","keyed","key","grow","step","Splitter","drag","along","down","onPointerDown","target","\"dragging\"","move","started","next","onChange","end","onPointerCancel","onPointerUp","min","TextInput","defaultThemeSwitchLabels","order","following","choice","themeSwitchTitle","labels","ThemeSwitch","words","itemSelector","items","toolbar","item","setTabStop","stop","current","all","moved","count","forth","rtl","editsText","Toolbar","watch","focus","ToolGroup","WarnMark","Fragment"],"sources":["../src/primitives/badge/Badge.tsx","../src/primitives/spinner/Spinner.tsx","../src/primitives/button/Button.tsx","../src/primitives/checkbox/Checkbox.tsx","../src/primitives/icon-button/IconButton.tsx","../src/primitives/dialog/CloseGlyph.tsx","../src/primitives/dialog/Dialog.tsx","../src/primitives/field/Field.tsx","../src/primitives/key-value/KeyValue.tsx","../src/primitives/panel/scroll-focus.ts","../src/primitives/panel/Panel.tsx","../src/primitives/pill/Pill.tsx","../src/primitives/radio-group/RadioGroup.tsx","../src/primitives/section-title/SectionTitle.tsx","../src/primitives/select/Select.tsx","../src/primitives/sheet/Sheet.tsx","../src/primitives/splitter/splitter-math.ts","../src/primitives/splitter/Splitter.tsx","../src/primitives/text-input/TextInput.tsx","../src/primitives/theme-switch/ThemeSwitch.tsx","../src/primitives/toolbar/roving.ts","../src/primitives/toolbar/Toolbar.tsx","../src/primitives/tool-group/ToolGroup.tsx","../src/primitives/warn-mark/WarnMark.tsx"],"sourcesContent":["// A badge: a short word or count in a rounded chip, tinted by its tone (a count of retries, a \"not ready\", a change\n// not yet applied), outlined or filled. A tone it does not know is drawn neutrally.\nimport type { ReactNode } from \"react\";\nimport \"./Badge.css\";\n\n/** The tones a badge draws; any other string is drawn neutrally. */\nexport type BadgeTone =\n | \"ok\"\n | \"warn\"\n | \"err\"\n | \"quiet\"\n | \"off\"\n | \"accent\"\n | \"muted\"\n | \"added\"\n | \"removed\"\n | \"renamed\"\n | \"changed\"\n | (string & {});\n\n/** How a badge is drawn: outlined in its tone (the default), or filled with it. */\nexport type BadgeVariant = \"outlined\" | \"filled\";\n\nexport type BadgeProps = {\n /** The badge's tone: its text and border colour (outlined) or its fill (filled). */\n tone: BadgeTone;\n /**\n * Outlined (the default): text and border in the tone. Filled: the tone's fill under on-strong text, for a fact that\n * must stand out.\n */\n variant?: BadgeVariant;\n /** What the badge says: a word, a count, a WarnMark beside them. */\n children: ReactNode;\n /** Shown on hover: what the badge means. */\n title?: string;\n /** A class added to the badge. */\n className?: string;\n};\n\n/** Draws a short word or count in a chip of its tone. */\nexport function Badge({ tone, variant = \"outlined\", children, title, className }: BadgeProps) {\n return (\n <span\n className={className === undefined ? \"pb-badge\" : `pb-badge ${className}`}\n data-tone={tone}\n data-variant={variant === \"filled\" ? \"filled\" : undefined}\n title={title}\n >\n {children}\n </span>\n );\n}\n","// The busy mark: an open ring in the current text colour that turns once per --pb-motion-spin, and under reduced\n// motion stands still (the open ring is still the mark). Without a label it is decoration, hidden from screen\n// readers, as inside a busy Button, whose own words and aria-busy say what is happening. With a label it is a status\n// that screen readers announce.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./Spinner.css\";\n\nexport type SpinnerProps = Omit<ComponentPropsWithRef<\"span\">, \"children\"> & {\n /** What is being waited for, read by screen readers; without it the spinner is hidden from them. */\n label?: string;\n};\n\nexport function Spinner({ label, className, ...rest }: SpinnerProps) {\n const classes = className === undefined ? \"pb-spinner\" : `pb-spinner ${className}`;\n if (label === undefined || label === \"\") {\n return <span {...rest} className={classes} aria-hidden=\"true\" />;\n }\n return (\n <span {...rest} className={`${classes} pb-spinner-labelled`} role=\"status\">\n <span className=\"pb-spinner-ring\" aria-hidden=\"true\" />\n <span className=\"pb-spinner-label\">{label}</span>\n </span>\n );\n}\n","// A push button in the library's look. Its tone (neutral, primary, danger, or any other word, drawn neutral) and size\n// are data attributes its stylesheet keys on. While busy it shows a Spinner over its words, which keep their place so\n// the button keeps its width, says aria-busy, and ignores presses (it stays focusable, unlike a disabled button, so\n// focus is not lost while a request is on its way).\nimport type { ComponentPropsWithRef, MouseEvent } from \"react\";\nimport { Spinner } from \"../spinner\";\nimport \"./Button.css\";\n\n/** What the button does, by colour: neutral (the default), primary (the one main action), danger; others draw neutral. */\nexport type ButtonTone = \"neutral\" | \"primary\" | \"danger\" | (string & {});\n\n/** md (the default) or sm, the compact one for dense rows; others draw as md. On touch both are at least 36 px tall. */\nexport type ButtonSize = \"md\" | \"sm\" | (string & {});\n\nexport type ButtonProps = ComponentPropsWithRef<\"button\"> & {\n tone?: ButtonTone;\n size?: ButtonSize;\n /** A request is on its way: a spinner over the words, aria-busy, and presses ignored. */\n busy?: boolean;\n};\n\nexport function Button({\n tone = \"neutral\",\n size = \"md\",\n busy = false,\n type = \"button\",\n className,\n children,\n onClick,\n ...rest\n}: ButtonProps) {\n function click(event: MouseEvent<HTMLButtonElement>) {\n if (busy) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n }\n return (\n <button\n {...rest}\n // A submit or reset button is asked for by name; a bare button inside a form never submits it.\n type={type}\n className={className === undefined ? \"pb-button\" : `pb-button ${className}`}\n data-tone={tone}\n data-size={size}\n aria-busy={busy || undefined}\n aria-disabled={busy || rest[\"aria-disabled\"] || undefined}\n onClick={click}\n >\n <span className=\"pb-button-content\">{children}</span>\n {busy && <Spinner className=\"pb-button-spinner\" />}\n </button>\n );\n}\n","// A tick box: a native checkbox (every native prop passes through, ref included, and id and aria props reach the\n// input, so Field can wire it), ticked in the accent. With a label it is wrapped in its own label, so a press on the\n// words ticks it too, and the row is a target a finger can find. Indeterminate (some of a group ticked) is a prop,\n// since HTML has it only as a DOM property.\nimport { useCallback, useLayoutEffect, useRef, type ComponentPropsWithRef, type ReactNode, type Ref } from \"react\";\nimport \"./Checkbox.css\";\n\nexport type CheckboxProps = Omit<ComponentPropsWithRef<\"input\">, \"type\"> & {\n /** The words beside the box, which tick it too; without them, name the box by a Field or aria-label. */\n label?: ReactNode;\n /** Neither ticked nor not: drawn as a dash and read as \"mixed\". */\n indeterminate?: boolean;\n};\n\nfunction assign<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n\nexport function Checkbox({ label, indeterminate = false, className, ref, ...rest }: CheckboxProps) {\n const own = useRef<HTMLInputElement | null>(null);\n const setRef = useCallback(\n (node: HTMLInputElement | null) => {\n own.current = node;\n assign(ref, node);\n },\n [ref],\n );\n useLayoutEffect(() => {\n if (own.current !== null) own.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const box = (\n <input\n {...rest}\n ref={setRef}\n type=\"checkbox\"\n className={label === undefined && className !== undefined ? `pb-checkbox ${className}` : \"pb-checkbox\"}\n />\n );\n if (label === undefined) return box;\n return (\n <label\n className={className === undefined ? \"pb-checkbox-row\" : `pb-checkbox-row ${className}`}\n data-disabled={rest.disabled === true || undefined}\n >\n {box}\n <span className=\"pb-checkbox-label\">{label}</span>\n </label>\n );\n}\n","// A square button that shows a glyph and is named by its label: the label is its accessible name and, unless a title\n// is given, its tooltip, and the glyph is hidden from screen readers. Tone, size and busy are Button's.\nimport type { ReactNode } from \"react\";\nimport { Button, type ButtonProps } from \"../button\";\nimport \"./IconButton.css\";\n\nexport type IconButtonProps = Omit<ButtonProps, \"children\" | \"aria-label\"> & {\n /** The button's name for screen readers, and its tooltip unless title says otherwise. */\n label: string;\n /** The glyph: an icon or a character, hidden from screen readers. */\n children: ReactNode;\n};\n\nexport function IconButton({ label, title, className, children, ...rest }: IconButtonProps) {\n return (\n <Button\n {...rest}\n className={className === undefined ? \"pb-icon-button\" : `pb-icon-button ${className}`}\n aria-label={label}\n title={title ?? label}\n >\n <span className=\"pb-icon-button-glyph\" aria-hidden=\"true\">\n {children}\n </span>\n </Button>\n );\n}\n","// The cross on Dialog's and Sheet's close buttons, in the current text colour. Internal: not exported by the layer.\nexport function CloseGlyph() {\n return (\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\">\n <path d=\"M3 3l10 10M13 3L3 13\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" />\n </svg>\n );\n}\n","// A modal dialog: drawn over the page (in a portal on <body>) above a scrim, with a title, a close button, the app's\n// content and an optional row of actions. While it is open, Tab and Shift+Tab stay inside it and focus that wanders\n// out is brought back; Escape, the close button and a press on the scrim ask the app to close it (onClose), and the\n// app closes it by setting open to false. Opening focuses the content's first control (or one the content focused\n// itself, as with autoFocus), else the dialog; the body is a tab stop of its own, so a long one scrolls from the\n// keyboard; closing gives focus back to what had it before. Only the topmost of\n// several open dialogs keeps the focus.\nimport { type ReactNode, type KeyboardEvent, useEffect, useId, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IconButton } from \"../icon-button\";\nimport { CloseGlyph } from \"./CloseGlyph\";\nimport \"./Dialog.css\";\n\nexport type DialogProps = {\n /** Whether the dialog is shown; the app holds it. */\n open: boolean;\n /** Asked for on Escape, the close button and a press on the scrim. */\n onClose: () => void;\n /** The dialog's title, which also names it for screen readers. */\n title: ReactNode;\n children: ReactNode;\n /** A row at the foot of the dialog, for its buttons. */\n actions?: ReactNode;\n /** The close button's name: \"Close\". */\n closeLabel?: string;\n /** A class added to the dialog's box. */\n className?: string;\n};\n\nconst focusable = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled]):not([type='hidden'])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"[tabindex]:not([tabindex='-1'])\",\n \"[contenteditable='true']\",\n].join(\",\");\n\n/** The controls inside `root` that Tab reaches, in order. */\nfunction tabbable(root: HTMLElement): HTMLElement[] {\n return [...root.querySelectorAll<HTMLElement>(focusable)].filter(\n (element) => element.closest(\"[hidden], [inert]\") === null && element.tabIndex >= 0,\n );\n}\n\n/** Whether `box` is the topmost open dialog: each opens in a portal appended to <body>, so the last one is on top. */\nfunction topmost(box: HTMLElement): boolean {\n const open = box.ownerDocument.querySelectorAll(\".pb-dialog\");\n return open[open.length - 1] === box;\n}\n\nfunction OpenDialog({ onClose, title, children, actions, closeLabel = \"Close\", className }: Omit<DialogProps, \"open\">) {\n const boxRef = useRef<HTMLDivElement>(null);\n const bodyRef = useRef<HTMLDivElement>(null);\n const titleId = useId();\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n useEffect(() => {\n const box = boxRef.current;\n if (box === null) return undefined;\n const before = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n if (!box.contains(document.activeElement)) {\n const body = bodyRef.current;\n (body === null ? undefined : tabbable(body)[0])?.focus();\n if (!box.contains(document.activeElement)) box.focus();\n }\n const keepFocus = (event: FocusEvent) => {\n if (!topmost(box)) return;\n if (event.target instanceof Node && box.contains(event.target)) return;\n (tabbable(box)[0] ?? box).focus();\n };\n document.addEventListener(\"focusin\", keepFocus);\n return () => {\n document.removeEventListener(\"focusin\", keepFocus);\n if (before?.isConnected === true) before.focus();\n };\n }, []);\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n onCloseRef.current();\n return;\n }\n if (event.key !== \"Tab\" || boxRef.current === null) return;\n const controls = tabbable(boxRef.current);\n const first = controls[0];\n const last = controls[controls.length - 1];\n if (first === undefined || last === undefined) {\n event.preventDefault();\n return;\n }\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === boxRef.current)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n return (\n <div\n className=\"pb-dialog-scrim\"\n onMouseDown={(event) => {\n // Only a press that starts on the scrim itself: a drag out of a text field does not close.\n if (event.target === event.currentTarget) onCloseRef.current();\n }}\n >\n <div\n ref={boxRef}\n className={className === undefined ? \"pb-dialog\" : `pb-dialog ${className}`}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n tabIndex={-1}\n onKeyDown={onKeyDown}\n >\n <div className=\"pb-dialog-head\">\n <h2 className=\"pb-dialog-title\" id={titleId}>\n {title}\n </h2>\n <IconButton\n className=\"pb-dialog-close\"\n label={closeLabel}\n onClick={() => {\n onCloseRef.current();\n }}\n >\n <CloseGlyph />\n </IconButton>\n </div>\n {/* Focusable, so a body that scrolls can be scrolled from the keyboard. */}\n <div ref={bodyRef} className=\"pb-dialog-body\" tabIndex={0}>\n {children}\n </div>\n {actions === undefined ? null : <div className=\"pb-dialog-actions\">{actions}</div>}\n </div>\n </div>\n );\n}\n\nexport function Dialog({ open, ...rest }: DialogProps) {\n if (!open) return null;\n return createPortal(<OpenDialog {...rest} />, document.body);\n}\n","// A labelled form control: the label, the control (its one child), a hint under it and an error under that. It wires\n// the control to them itself: the control gets an id the label points at (its own id if it has one), aria-describedby\n// naming the hint and the error (after any ids it already has), and aria-invalid while there is an error. The control\n// is any element that passes those props on to its native element, as TextInput, Select and Checkbox do.\nimport {\n cloneElement,\n isValidElement,\n useId,\n type AriaAttributes,\n type ComponentPropsWithRef,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport \"./Field.css\";\n\n/** stacked (the default: the label above the control) or inline (the label in a column to its left); others stack. */\nexport type FieldLayout = \"stacked\" | \"inline\" | (string & {});\n\n/** The props Field sets on its control. */\nexport type FieldControlProps = {\n id?: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: AriaAttributes[\"aria-invalid\"];\n};\n\nexport type FieldProps = Omit<ComponentPropsWithRef<\"div\">, \"children\"> & {\n /** What the control is, as its accessible name. */\n label: ReactNode;\n /** Why the value is refused; while there is one the control is marked invalid. Empty means none. */\n error?: ReactNode;\n /** A line of help under the control. */\n hint?: ReactNode;\n layout?: FieldLayout;\n /** The control: one element that passes id and aria props on to its native element. */\n children: ReactElement<FieldControlProps>;\n};\n\nfunction present(node: ReactNode): boolean {\n return node !== undefined && node !== null && node !== false && node !== \"\";\n}\n\nexport function Field({ label, error, hint, layout = \"stacked\", className, children, ...rest }: FieldProps) {\n const base = useId();\n const control: unknown = children;\n const own = isValidElement<FieldControlProps>(control) ? control.props : undefined;\n const controlId = own?.id ?? `${base}-control`;\n const hintId = present(hint) ? `${base}-hint` : undefined;\n const errorId = present(error) ? `${base}-error` : undefined;\n const describedBy = [own?.[\"aria-describedby\"], hintId, errorId].filter((id) => id !== undefined && id !== \"\");\n const wired =\n own === undefined\n ? children\n : cloneElement(children, {\n id: controlId,\n \"aria-describedby\": describedBy.length > 0 ? describedBy.join(\" \") : undefined,\n \"aria-invalid\": errorId !== undefined ? true : own[\"aria-invalid\"],\n });\n return (\n <div\n {...rest}\n className={className === undefined ? \"pb-field\" : `pb-field ${className}`}\n data-layout={layout}\n data-invalid={errorId !== undefined || undefined}\n >\n <label className=\"pb-field-label\" htmlFor={controlId}>\n {label}\n </label>\n <div className=\"pb-field-control\">\n {wired}\n {hintId !== undefined && (\n <div className=\"pb-field-hint\" id={hintId}>\n {hint}\n </div>\n )}\n {errorId !== undefined && (\n <div className=\"pb-field-error\" id={errorId}>\n {error}\n </div>\n )}\n </div>\n </div>\n );\n}\n","// Facts as a two-column list of keys and values (a status summary, an inspector's details), drawn as a <dl> so each key\n// names its value for screen readers. A row's tone colours its value; a tone it does not know leaves it plain.\nimport type { ReactNode } from \"react\";\nimport \"./KeyValue.css\";\n\n/** The tones a value draws in; any other string leaves it plain. */\nexport type KeyValueTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type KeyValueRow = {\n /** The fact's name. */\n key: string;\n /** Its value. */\n value: ReactNode;\n /** Colours the value: a fact that is wrong or worth a look. */\n tone?: KeyValueTone;\n /** Shown on hover over the key: what the fact means. */\n title?: string;\n};\n\nexport type KeyValueProps = {\n /** The facts, in order. */\n rows: readonly KeyValueRow[];\n /** Names the list for screen readers when no heading does. */\n label?: string;\n /** A class added to the list. */\n className?: string;\n};\n\n/** Draws facts as keys and their values, side by side. */\nexport function KeyValue({ rows, label, className }: KeyValueProps) {\n return (\n <dl className={className === undefined ? \"pb-key-value\" : `pb-key-value ${className}`} aria-label={label}>\n {rows.map((row, index) => (\n // Rows have no identity beyond their place; two may share a key.\n <div key={index} className=\"pb-key-value-row\" data-tone={row.tone}>\n <dt title={row.title}>{row.key}</dt>\n <dd>{row.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n","// Keeps a scrolling box reachable by keyboard: while its content overflows it is a tab stop (so the arrow keys and Page\n// Up and Down scroll it), and while everything fits it is not, so a short panel adds no empty stop to the tab order.\nimport { useEffect, type RefObject } from \"react\";\n\n/** Whether `box`'s content is taller or wider than the box. */\nexport function overflows(box: HTMLElement): boolean {\n return box.scrollHeight > box.clientHeight || box.scrollWidth > box.clientWidth;\n}\n\n/** Makes `ref`'s box focusable exactly while it overflows, watching its size and its content. */\nexport function useScrollFocus(ref: RefObject<HTMLElement | null>): void {\n useEffect(() => {\n const box = ref.current;\n if (box === null) return;\n const settle = () => {\n if (overflows(box)) box.tabIndex = 0;\n else box.removeAttribute(\"tabindex\");\n };\n settle();\n // jsdom has no ResizeObserver; the content watch still runs there.\n const sizes = typeof ResizeObserver === \"function\" ? new ResizeObserver(settle) : null;\n const observeChildren = () => {\n if (sizes === null) return;\n sizes.disconnect();\n sizes.observe(box);\n for (const child of box.children) sizes.observe(child);\n };\n observeChildren();\n const content = new MutationObserver(() => {\n observeChildren();\n settle();\n });\n content.observe(box, { childList: true, subtree: true, characterData: true });\n return () => {\n sizes?.disconnect();\n content.disconnect();\n };\n }, [ref]);\n}\n","// A panel: a region of the page with an optional header (its title, and actions at the far end) over a body that\n// scrolls on its own, as an inspector or a side panel. It draws no outer border: the layout that places it (a docked\n// side, a sheet, a card) draws its edges. Its title names the region for screen readers. While its body overflows, the\n// body is a tab stop, so the keyboard can scroll it.\nimport { useId, useRef, type ComponentPropsWithRef, type ReactNode } from \"react\";\nimport { useScrollFocus } from \"./scroll-focus\";\nimport \"./Panel.css\";\n\nexport type PanelProps = Omit<ComponentPropsWithRef<\"section\">, \"title\"> & {\n /** The panel's heading; it also names the region. Without one, name it with aria-label. */\n title?: ReactNode;\n /** Slot at the header's far end: buttons, a count, a close button. */\n actions?: ReactNode;\n /** The title's heading level, h1 to h6; h2 by default. */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n children?: ReactNode;\n};\n\n/** Draws a titled region with its actions and a body that scrolls. */\nexport function Panel({ title, actions, level = 2, className, children, ...rest }: PanelProps) {\n const titleId = useId();\n const body = useRef<HTMLDivElement>(null);\n useScrollFocus(body);\n const Heading = `h${String(level)}` as \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n const header = title !== undefined || actions !== undefined;\n return (\n <section\n {...rest}\n aria-labelledby={\n rest[\"aria-labelledby\"] ?? (title !== undefined && rest[\"aria-label\"] === undefined ? titleId : undefined)\n }\n className={className === undefined ? \"pb-panel\" : `pb-panel ${className}`}\n >\n {header && (\n <header className=\"pb-panel-header\">\n {title !== undefined && (\n <Heading id={titleId} className=\"pb-panel-title\">\n {title}\n </Heading>\n )}\n {actions !== undefined && <div className=\"pb-panel-actions\">{actions}</div>}\n </header>\n )}\n <div ref={body} className=\"pb-panel-body\">\n {children}\n </div>\n </section>\n );\n}\n","// A state pill: a dot in the state's tone and the word beside it, so the state never rests on colour alone. A tone it\n// does not know is drawn neutrally, by its own word.\nimport type { ReactNode } from \"react\";\nimport \"./Pill.css\";\n\n/** The tones a pill draws; any other string is drawn neutrally. */\nexport type PillTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | \"accent\" | \"muted\" | (string & {});\n\nexport type PillProps = {\n /** The state's tone: the dot's and the word's colour. */\n tone: PillTone;\n /** The state in words, always shown beside the dot. */\n label: string;\n /** Pulses the dot (never the word) while the state is on its way, such as \"starting\"; stops under reduced motion. */\n pulse?: boolean;\n /** Shown on hover: what the state means or why it is so. */\n title?: string;\n /** After the word, in code type: a failure's code, say. */\n detail?: ReactNode;\n /** A class added to the pill. */\n className?: string;\n};\n\n/** Draws a state as a dot and its word, in the state's tone. */\nexport function Pill({ tone, label, pulse = false, title, detail, className }: PillProps) {\n return (\n <span\n className={className === undefined ? \"pb-pill\" : `pb-pill ${className}`}\n data-tone={tone}\n data-pulse={pulse ? \"\" : undefined}\n title={title}\n >\n <span className=\"pb-pill-dot\" aria-hidden=\"true\" />\n {label}\n {detail !== undefined && <code className=\"pb-pill-detail\">{detail}</code>}\n </span>\n );\n}\n","// A choice of one: native radios under a legend, in one fieldset (role radiogroup), so the browser gives the arrow\n// keys and a single tab stop. Controlled: the app holds the value and every press asks it through onChange. Its hint\n// and error are wired as Field wires a control's: aria-describedby names them, and aria-invalid marks the group while\n// there is an error.\nimport { useId, type ComponentPropsWithRef, type ReactNode } from \"react\";\nimport \"./RadioGroup.css\";\n\n/** stacked (the default: one option a row) or inline (the options side by side, wrapping); others stack. */\nexport type RadioGroupLayout = \"stacked\" | \"inline\" | (string & {});\n\nexport type RadioOption = {\n /** The value onChange gives when this option is picked; unique in the group. */\n value: string;\n /** The option's words, which pick it too. */\n label: ReactNode;\n /** Shown on hover over the option. */\n title?: string;\n /** Not pickable. */\n disabled?: boolean;\n};\n\nexport type RadioGroupProps = Omit<ComponentPropsWithRef<\"fieldset\">, \"children\" | \"onChange\"> & {\n /** What the choice is: the group's legend and accessible name. */\n legend: ReactNode;\n /** Keeps the legend for screen readers only, when the layout around the group already says what it is. */\n legendHidden?: boolean;\n options: readonly RadioOption[];\n /** The picked option's value; one matching no option (or undefined) picks none. */\n value: string | undefined;\n /** Asks the app to pick this value. */\n onChange: (value: string) => void;\n /** The radios' shared name; one of its own by default. */\n name?: string;\n layout?: RadioGroupLayout;\n /** A line of help under the options. */\n hint?: ReactNode;\n /** Why the choice is refused; while there is one the group is marked invalid. Empty means none. */\n error?: ReactNode;\n};\n\nfunction present(node: ReactNode): boolean {\n return node !== undefined && node !== null && node !== false && node !== \"\";\n}\n\nexport function RadioGroup({\n legend,\n legendHidden = false,\n options,\n value,\n onChange,\n name,\n layout = \"stacked\",\n hint,\n error,\n className,\n \"aria-describedby\": describedByOwn,\n \"aria-invalid\": invalidOwn,\n ...rest\n}: RadioGroupProps) {\n const base = useId();\n const groupName = name ?? `${base}-name`;\n const hintId = present(hint) ? `${base}-hint` : undefined;\n const errorId = present(error) ? `${base}-error` : undefined;\n const describedBy = [describedByOwn, hintId, errorId].filter((id) => id !== undefined && id !== \"\");\n return (\n <fieldset\n {...rest}\n role=\"radiogroup\"\n className={className === undefined ? \"pb-radio-group\" : `pb-radio-group ${className}`}\n data-layout={layout}\n aria-describedby={describedBy.length > 0 ? describedBy.join(\" \") : undefined}\n aria-invalid={errorId !== undefined ? true : invalidOwn}\n >\n <legend className=\"pb-radio-group-legend\" data-hidden={legendHidden || undefined}>\n {legend}\n </legend>\n <div className=\"pb-radio-group-options\">\n {options.map((option) => (\n <label\n key={option.value}\n className=\"pb-radio-row\"\n title={option.title}\n data-disabled={option.disabled === true || rest.disabled === true || undefined}\n >\n <input\n className=\"pb-radio\"\n type=\"radio\"\n name={groupName}\n value={option.value}\n checked={option.value === value}\n disabled={option.disabled}\n onChange={() => {\n onChange(option.value);\n }}\n />\n <span className=\"pb-radio-label\">{option.label}</span>\n </label>\n ))}\n </div>\n {hintId !== undefined && (\n <div className=\"pb-radio-group-hint\" id={hintId}>\n {hint}\n </div>\n )}\n {errorId !== undefined && (\n <div className=\"pb-radio-group-error\" id={errorId}>\n {error}\n </div>\n )}\n </fieldset>\n );\n}\n","// A section's title in a panel or inspector, a heading with its actions (buttons, a count) at the far end. The\n// heading's level fits the page it sits in.\nimport type { ReactNode } from \"react\";\nimport \"./SectionTitle.css\";\n\nexport type SectionTitleProps = {\n /** The title. */\n children: ReactNode;\n /** Slot at the title's far end: buttons, a count, a badge. */\n actions?: ReactNode;\n /** The heading's level, h2 to h6. */\n level?: 2 | 3 | 4 | 5 | 6;\n /** A class added to the title's row. */\n className?: string;\n};\n\n/** Draws a section's heading, with its actions at the far end. */\nexport function SectionTitle({ children, actions, level = 3, className }: SectionTitleProps) {\n const Heading = `h${level}` as const;\n return (\n <div className={className === undefined ? \"pb-section-title\" : `pb-section-title ${className}`}>\n <Heading className=\"pb-section-title-text\">{children}</Heading>\n {actions !== undefined && <div className=\"pb-section-title-actions\">{actions}</div>}\n </div>\n );\n}\n","// A drop-down choice in the library's look: a native select (every native prop passes through, ref included; its\n// options are its children), so the platform's own list opens, the keyboard works as the platform's does, and a phone\n// shows its picker. It shows aria-invalid in the error tone, as Field sets it. On a touch screen its text is 16 px, as\n// iOS Safari zooms the page when a smaller field takes the focus.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./Select.css\";\n\n/** ui (the default) or code, the monospace face for values written as code; others draw as ui. */\nexport type SelectFont = \"ui\" | \"code\" | (string & {});\n\nexport type SelectProps = ComponentPropsWithRef<\"select\"> & {\n font?: SelectFont;\n};\n\nexport function Select({ font = \"ui\", className, children, ...rest }: SelectProps) {\n return (\n <select {...rest} className={className === undefined ? \"pb-select\" : `pb-select ${className}`} data-font={font}>\n {children}\n </select>\n );\n}\n","// A sheet: a panel drawn over its container's right edge or rising from its bottom, as an inspector is on a narrow\n// window or a phone. It is not modal: the page around it stays live, and opening it does not take the focus (a\n// selection on the canvas opens it while the person is still working there). Escape inside it and its close button\n// ask the app to close it; if the focus was inside when it closes, it goes back to where it came from. The sheet is\n// placed absolutely, so its container (the app's workspace) is positioned; the app holds open, and chooses the side\n// (the right edge below 760 px, the bottom below 600 px).\nimport {\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n type CSSProperties,\n useEffect,\n useId,\n useRef,\n} from \"react\";\nimport { CloseGlyph } from \"../dialog/CloseGlyph\";\nimport { IconButton } from \"../icon-button\";\nimport \"./Sheet.css\";\n\nexport type SheetSide = \"right\" | \"bottom\";\n\nexport type SheetProps = {\n /** Whether the sheet is shown; the app holds it. */\n open: boolean;\n /** Asked for on Escape inside the sheet and on its close button. */\n onClose: () => void;\n /** The edge it is drawn from: the right edge (the default) or the bottom. */\n side?: SheetSide;\n /** The sheet's title, which also names it for screen readers; without one, name it with `label`. */\n title?: ReactNode;\n /** The sheet's name for screen readers when it has no title. */\n label?: string;\n children: ReactNode;\n /** A right sheet's width in px, held to 280–560 px and to 48 px short of its container. */\n width?: number;\n /** The close button's name: \"Close\". */\n closeLabel?: string;\n /** A class added to the sheet. */\n className?: string;\n};\n\nfunction OpenSheet({\n onClose,\n side = \"right\",\n title,\n label,\n children,\n width,\n closeLabel = \"Close\",\n className,\n}: Omit<SheetProps, \"open\">) {\n const sheetRef = useRef<HTMLElement>(null);\n const titleId = useId();\n /** Where the focus came from when it entered the sheet: it goes back there if the sheet closes holding it. */\n const cameFrom = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n const sheet = sheetRef.current;\n return () => {\n const back = cameFrom.current;\n const active = document.activeElement;\n const held = active === null || active === document.body || (sheet?.contains(active) ?? false);\n if (held && back?.isConnected === true) back.focus();\n };\n }, []);\n\n const onFocus = (event: FocusEvent<HTMLElement>) => {\n const from = event.relatedTarget;\n if (from instanceof HTMLElement && !event.currentTarget.contains(from)) cameFrom.current = from;\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if (event.defaultPrevented || event.key !== \"Escape\") return;\n event.preventDefault();\n event.stopPropagation();\n onClose();\n };\n\n const style = width === undefined ? undefined : ({ \"--pb-sheet-width\": `${width}px` } as CSSProperties);\n\n return (\n <section\n ref={sheetRef}\n className={className === undefined ? \"pb-sheet\" : `pb-sheet ${className}`}\n data-side={side}\n role=\"dialog\"\n aria-labelledby={title === undefined ? undefined : titleId}\n aria-label={title === undefined ? label : undefined}\n style={style}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n >\n <div className=\"pb-sheet-head\">\n {title === undefined ? (\n <span className=\"pb-sheet-title\" />\n ) : (\n <h2 className=\"pb-sheet-title\" id={titleId}>\n {title}\n </h2>\n )}\n <IconButton className=\"pb-sheet-close\" label={closeLabel} onClick={onClose}>\n <CloseGlyph />\n </IconButton>\n </div>\n {/* Focusable, so a body that scrolls can be scrolled from the keyboard. */}\n <div className=\"pb-sheet-body\" tabIndex={0}>\n {children}\n </div>\n </section>\n );\n}\n\nexport function Sheet({ open, ...rest }: SheetProps) {\n if (!open) return null;\n return <OpenSheet {...rest} />;\n}\n","// A splitter's maths, pure: a size kept within its bounds, a drag, and a key. Splitter.tsx draws and listens; this\n// file decides the size.\n\n/** The smallest and largest size, in px. */\nexport interface Bounds {\n min: number;\n max: number;\n}\n\n/** `value` within `bounds`, in whole px. A max below the min is read as the min. */\nexport function clamp(value: number, bounds: Bounds): number {\n const max = Math.max(bounds.min, bounds.max);\n return Math.round(Math.min(max, Math.max(bounds.min, value)));\n}\n\n/**\n * A drag: the size at the drag's start plus the pointer's travel times `sign`, clamped. The sign is -1 for a splitter on\n * the start edge (left or top) of what it resizes, where moving left or up grows it, and 1 on the end edge.\n */\nexport function dragged(start: number, travel: number, sign: 1 | -1, bounds: Bounds): number {\n return clamp(start + sign * travel, bounds);\n}\n\n/** Which arrow grows what the splitter resizes, from its orientation and the edge it sits on. */\nexport function growKey(orientation: \"vertical\" | \"horizontal\", edge: \"start\" | \"end\"): string {\n if (orientation === \"vertical\") return edge === \"start\" ? \"ArrowLeft\" : \"ArrowRight\";\n return edge === \"start\" ? \"ArrowUp\" : \"ArrowDown\";\n}\n\nconst opposite: Record<string, string> = {\n ArrowLeft: \"ArrowRight\",\n ArrowRight: \"ArrowLeft\",\n ArrowUp: \"ArrowDown\",\n ArrowDown: \"ArrowUp\",\n};\n\n/**\n * A key on a focused splitter: `grow` adds `step` and its opposite arrow takes it away, clamped; Home goes to the min\n * and End to the max; any other key gives undefined (the key is not the splitter's).\n */\nexport function keyed(value: number, key: string, grow: string, step: number, bounds: Bounds): number | undefined {\n if (key === grow) return clamp(value + step, bounds);\n if (key === opposite[grow]) return clamp(value - step, bounds);\n if (key === \"Home\") return clamp(bounds.min, bounds);\n if (key === \"End\") return clamp(bounds.max, bounds);\n return undefined;\n}\n","// A resize handle, as a WAI-ARIA separator: the edge of a pane, dragged with the pointer or moved by the arrow keys,\n// Home and End while focused. It keeps only the drag in progress; the size is the app's (value and onChange). It sits\n// absolutely on one edge of its positioned parent, the pane it resizes. splitter-math.ts holds the maths.\nimport { useRef, type ComponentPropsWithRef, type KeyboardEvent, type PointerEvent } from \"react\";\nimport { dragged, growKey, keyed } from \"./splitter-math\";\nimport \"./Splitter.css\";\n\n/** vertical: a vertical bar that resizes a width; horizontal: a horizontal bar that resizes a height. */\nexport type SplitterOrientation = \"vertical\" | \"horizontal\";\n\n/** The edge of the resized pane the splitter sits on: start is its left or top, end its right or bottom. */\nexport type SplitterEdge = \"start\" | \"end\";\n\nexport type SplitterProps = Omit<\n ComponentPropsWithRef<\"div\">,\n \"onChange\" | \"children\" | \"role\" | \"aria-orientation\" | \"aria-valuenow\" | \"aria-valuemin\" | \"aria-valuemax\"\n> & {\n orientation: SplitterOrientation;\n /** The pane's size in px. */\n value: number;\n /** The smallest size in px. */\n min: number;\n /** The largest size in px. */\n max: number;\n /** A new size, in whole px within min and max. */\n onChange: (px: number) => void;\n /** The separator's accessible name, such as \"Resize the inspector\". */\n label: string;\n /** Which edge of the pane it sits on; start (left or top) by default, where moving left or up grows the pane. */\n edge?: SplitterEdge;\n /** How far one arrow key moves it, in px; 16 by default. */\n step?: number;\n};\n\n/** Draws a pane's resize handle, dragged by pointer or moved by keys. */\nexport function Splitter({\n orientation,\n value,\n min,\n max,\n onChange,\n label,\n edge = \"start\",\n step = 16,\n className,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n onKeyDown,\n ...rest\n}: SplitterProps) {\n const drag = useRef<{ start: number; at: number } | null>(null);\n const bounds = { min, max };\n const along = (event: PointerEvent) => (orientation === \"vertical\" ? event.clientX : event.clientY);\n\n function down(event: PointerEvent<HTMLDivElement>) {\n onPointerDown?.(event);\n if (event.defaultPrevented || event.button !== 0) return;\n event.preventDefault();\n const target = event.currentTarget;\n // Captured, the drag follows the pointer past the bar's few px; jsdom has no capture.\n if (typeof target.setPointerCapture === \"function\") target.setPointerCapture(event.pointerId);\n target.focus();\n target.dataset[\"dragging\"] = \"\";\n drag.current = { start: value, at: along(event) };\n }\n function move(event: PointerEvent<HTMLDivElement>) {\n onPointerMove?.(event);\n const started = drag.current;\n if (started === null) return;\n const next = dragged(started.start, along(event) - started.at, edge === \"start\" ? -1 : 1, bounds);\n if (next !== value) onChange(next);\n }\n function end(event: PointerEvent<HTMLDivElement>) {\n if (event.type === \"pointercancel\") onPointerCancel?.(event);\n else onPointerUp?.(event);\n if (drag.current === null) return;\n drag.current = null;\n const target = event.currentTarget;\n delete target.dataset[\"dragging\"];\n if (typeof target.hasPointerCapture === \"function\" && target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n }\n function key(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;\n const next = keyed(value, event.key, growKey(orientation, edge), step, bounds);\n if (next === undefined) return;\n event.preventDefault();\n if (next !== value) onChange(next);\n }\n\n return (\n <div\n {...rest}\n role=\"separator\"\n tabIndex={rest.tabIndex ?? 0}\n aria-orientation={orientation}\n aria-label={label}\n aria-valuenow={value}\n aria-valuemin={min}\n aria-valuemax={max}\n className={className === undefined ? \"pb-splitter\" : `pb-splitter ${className}`}\n data-orientation={orientation}\n data-edge={edge}\n onPointerDown={down}\n onPointerMove={move}\n onPointerUp={end}\n onPointerCancel={end}\n onKeyDown={key}\n />\n );\n}\n","// A one-line text field in the library's look: a native input (every native prop passes through, ref included), in\n// the UI face or the code face. It shows aria-invalid in the error tone, as Field sets it. On a touch screen its text is\n// 16 px, as iOS Safari zooms the page when a smaller field takes the focus.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./TextInput.css\";\n\n/** ui (the default) or code, the monospace face for values written as code; others draw as ui. */\nexport type TextInputFont = \"ui\" | \"code\" | (string & {});\n\nexport type TextInputProps = ComponentPropsWithRef<\"input\"> & {\n font?: TextInputFont;\n};\n\nexport function TextInput({ font = \"ui\", type = \"text\", className, ...rest }: TextInputProps) {\n return (\n <input\n {...rest}\n type={type}\n className={className === undefined ? \"pb-text-input\" : `pb-text-input ${className}`}\n data-font={font}\n />\n );\n}\n","// The theme switch: one button that cycles system, light and dark. Its word is shown beside the icon, and its\n// accessible name always says the choice, so it is never just a glyph; the icon is SVG, since a font may lack a ◐\n// character. The choice is the app's (useTheme keeps it); the switch only says it and asks for the next. At phone\n// width the word gives way to the icon alone, and the name still says the choice.\nimport type { ComponentPropsWithRef } from \"react\";\nimport type { ThemeChoice } from \"../../hooks/use-theme/useTheme\";\nimport \"./ThemeSwitch.css\";\n\nexport type { ThemeChoice };\n\n/** The switch's words, each replaceable. */\nexport interface ThemeSwitchLabels {\n /** What the switch is: \"Theme\". */\n theme: string;\n system: string;\n light: string;\n dark: string;\n /** Said of system in the tooltip: \"follows the system's setting\". */\n systemHint: string;\n /** Before the next choice in the tooltip: \"click for\". */\n clickFor: string;\n}\n\nexport const defaultThemeSwitchLabels: ThemeSwitchLabels = {\n theme: \"Theme\",\n system: \"system\",\n light: \"light\",\n dark: \"dark\",\n systemHint: \"follows the system's setting\",\n clickFor: \"click for\",\n};\n\nconst order: readonly ThemeChoice[] = [\"system\", \"light\", \"dark\"];\n\n/** The choice a press moves to: system, light, dark and back. */\nfunction following(choice: ThemeChoice): ThemeChoice {\n return order[(order.indexOf(choice) + 1) % order.length] ?? \"system\";\n}\n\nexport type ThemeSwitchProps = Omit<ComponentPropsWithRef<\"button\">, \"children\" | \"onClick\" | \"type\" | \"title\"> & {\n /** The theme now. */\n choice: ThemeChoice;\n /** Called with the next choice in the cycle when the switch is pressed. */\n onChoose: (next: ThemeChoice) => void;\n /** Words to replace; the rest keep their defaults. */\n labels?: Partial<ThemeSwitchLabels>;\n};\n\n/** The switch's tooltip: what the theme is and what a press does. */\nexport function themeSwitchTitle(choice: ThemeChoice, labels: ThemeSwitchLabels = defaultThemeSwitchLabels): string {\n const hint = choice === \"system\" ? ` (${labels.systemHint})` : \"\";\n return `${labels.theme}: ${labels[choice]}${hint}; ${labels.clickFor} ${labels[following(choice)]}`;\n}\n\nexport function ThemeSwitch({ choice, onChoose, labels, className, ...rest }: ThemeSwitchProps) {\n const words = { ...defaultThemeSwitchLabels, ...labels };\n return (\n <button\n {...rest}\n type=\"button\"\n className={className === undefined ? \"pb-theme-switch\" : `pb-theme-switch ${className}`}\n title={themeSwitchTitle(choice, words)}\n aria-label={`${words.theme}: ${words[choice]}`}\n onClick={() => {\n onChoose(following(choice));\n }}\n >\n <svg className=\"pb-theme-switch-icon\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\">\n <circle cx=\"8\" cy=\"8\" r=\"6.25\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M8 1.75a6.25 6.25 0 0 1 0 12.5z\" fill=\"currentColor\" />\n </svg>\n <span className=\"pb-theme-switch-word\">{words[choice]}</span>\n </button>\n );\n}\n","// Roving focus over a toolbar's items, pure DOM: which elements are items, which one holds the toolbar's one tab stop,\n// and where an arrow key, Home or End moves the focus. Toolbar.tsx wires it to React.\n\n/** What counts as an item: an enabled control, or anything that says it is a button, checkbox or radio. */\nexport const itemSelector = [\n \"button:not(:disabled)\",\n \"a[href]\",\n \"input:not(:disabled)\",\n \"select:not(:disabled)\",\n \"textarea:not(:disabled)\",\n '[role=\"button\"]',\n '[role=\"checkbox\"]',\n '[role=\"radio\"]',\n '[role=\"menuitem\"]',\n '[role=\"switch\"]',\n].join(\", \");\n\n/** The toolbar's items, in document order, leaving out those of a toolbar nested inside it. */\nexport function items(toolbar: HTMLElement): HTMLElement[] {\n return [...toolbar.querySelectorAll<HTMLElement>(itemSelector)].filter(\n (item) => item.closest('[role=\"toolbar\"]') === toolbar,\n );\n}\n\n/** Gives `current` the one tab stop (0) and every other item -1; with no current, the first item takes it. */\nexport function setTabStop(all: readonly HTMLElement[], current: HTMLElement | null): HTMLElement | null {\n const stop = current !== null && all.includes(current) ? current : (all[0] ?? null);\n for (const item of all) item.tabIndex = item === stop ? 0 : -1;\n return stop;\n}\n\n/**\n * The item a key moves the focus to from `index`, or undefined when the key is not the toolbar's. Horizontal toolbars\n * take the left and right arrows (swapped right to left), vertical ones up and down; both take Home and End. The ends\n * wrap around.\n */\nexport function moved(\n index: number,\n count: number,\n key: string,\n orientation: \"horizontal\" | \"vertical\",\n rtl: boolean,\n): number | undefined {\n if (count === 0) return undefined;\n if (key === \"Home\") return 0;\n if (key === \"End\") return count - 1;\n const [back, forth] =\n orientation === \"vertical\"\n ? [\"ArrowUp\", \"ArrowDown\"]\n : rtl\n ? [\"ArrowRight\", \"ArrowLeft\"]\n : [\"ArrowLeft\", \"ArrowRight\"];\n if (key === forth) return (index + 1) % count;\n if (key === back) return (index - 1 + count) % count;\n return undefined;\n}\n\n/** Whether a key pressed in `element` belongs to the text it edits (arrows, Home and End move its caret). */\nexport function editsText(element: Element): boolean {\n if (element instanceof HTMLTextAreaElement) return true;\n if (element instanceof HTMLInputElement) {\n return ![\"button\", \"checkbox\", \"radio\", \"reset\", \"submit\", \"image\", \"color\", \"file\", \"range\"].includes(\n element.type,\n );\n }\n return element instanceof HTMLElement && element.isContentEditable;\n}\n","// A WAI-ARIA toolbar: a row (or column) of controls that is one tab stop, the arrow keys, Home and End moving the focus\n// between its items (roving tabindex). The items are whatever controls its children render; the toolbar sets their\n// tabIndex itself, so an item's own tabIndex is overwritten. The item last focused keeps the tab stop, and a text field\n// inside keeps its own arrow keys. roving.ts holds the rules.\nimport { useEffect, useRef, type ComponentPropsWithRef, type FocusEvent, type KeyboardEvent } from \"react\";\nimport { editsText, items, moved, setTabStop } from \"./roving\";\nimport \"./Toolbar.css\";\n\nexport type ToolbarOrientation = \"horizontal\" | \"vertical\";\n\nexport type ToolbarProps = Omit<ComponentPropsWithRef<\"div\">, \"role\" | \"aria-orientation\"> & {\n /** The toolbar's accessible name, such as \"Canvas\". */\n label: string;\n /** horizontal (the default) moves with the left and right arrows; vertical with up and down. */\n orientation?: ToolbarOrientation;\n};\n\n/** Draws a group of controls as one tab stop, with the arrow keys moving between them. */\nexport function Toolbar({\n label,\n orientation = \"horizontal\",\n className,\n ref,\n onKeyDown,\n onFocus,\n children,\n ...rest\n}: ToolbarProps) {\n const own = useRef<HTMLDivElement | null>(null);\n const current = useRef<HTMLElement | null>(null);\n\n // After every render, and whenever an item comes, goes or is enabled or disabled, one item holds the tab stop.\n useEffect(() => {\n const toolbar = own.current;\n if (toolbar === null) return;\n const settle = () => {\n current.current = setTabStop(items(toolbar), current.current);\n };\n settle();\n const watch = new MutationObserver(settle);\n watch.observe(toolbar, { childList: true, subtree: true, attributes: true, attributeFilter: [\"disabled\", \"href\"] });\n return () => {\n watch.disconnect();\n };\n });\n\n function focus(event: FocusEvent<HTMLDivElement>) {\n onFocus?.(event);\n const toolbar = own.current;\n if (toolbar === null) return;\n const all = items(toolbar);\n if (event.target instanceof HTMLElement && all.includes(event.target)) {\n current.current = setTabStop(all, event.target);\n }\n }\n function key(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n const toolbar = own.current;\n if (event.defaultPrevented || toolbar === null || event.altKey || event.ctrlKey || event.metaKey) return;\n if (editsText(event.target as Element)) return;\n const all = items(toolbar);\n const index = all.indexOf(event.target as HTMLElement);\n if (index === -1) return;\n const rtl = getComputedStyle(toolbar).direction === \"rtl\";\n const next = moved(index, all.length, event.key, orientation, rtl);\n if (next === undefined) return;\n event.preventDefault();\n all[next]?.focus();\n }\n\n return (\n <div\n {...rest}\n ref={(element) => {\n own.current = element;\n if (typeof ref === \"function\") return ref(element);\n if (ref) ref.current = element;\n return undefined;\n }}\n role=\"toolbar\"\n aria-label={label}\n aria-orientation={orientation}\n className={className === undefined ? \"pb-toolbar\" : `pb-toolbar ${className}`}\n onKeyDown={key}\n onFocus={focus}\n >\n {children}\n </div>\n );\n}\n","// A floating group of tools, such as a canvas's zoom, fit and minimap: a Toolbar drawn as one raised, framed group of\n// square buttons. Its tools are IconButtons (or plain <button>s named by aria-label with their\n// glyph hidden); a pressed one (aria-pressed) is drawn in the accent. 28 px buttons, 40 px on touch.\nimport { Toolbar, type ToolbarProps } from \"../toolbar\";\nimport \"./ToolGroup.css\";\n\nexport type ToolGroupProps = ToolbarProps;\n\n/** Draws a framed group of square tool buttons, one tab stop with roving focus. */\nexport function ToolGroup({ className, ...rest }: ToolGroupProps) {\n return <Toolbar {...rest} className={className === undefined ? \"pb-tool-group\" : `pb-tool-group ${className}`} />;\n}\n","// The warning mark: an \"!\" in a circle beside words, for something that rose lately (a badge's or a counter's). The\n// glyph is hidden from screen readers, which read its label instead.\nimport \"./WarnMark.css\";\n\nexport type WarnMarkProps = {\n /** What the mark means, read by screen readers in its place. */\n label: string;\n /** Shown on hover over the mark. */\n title?: string;\n /** A class added to the mark. */\n className?: string;\n};\n\n/** Draws a warning \"!\" for the eye and its words for screen readers. */\nexport function WarnMark({ label, title, className }: WarnMarkProps) {\n return (\n <>\n <span\n className={className === undefined ? \"pb-warn-mark\" : `pb-warn-mark ${className}`}\n aria-hidden=\"true\"\n title={title}\n >\n !\n </span>\n <span className=\"pb-warn-mark-text\">{label}</span>\n </>\n );\n}\n"],"mappings":";;;;AAwCA,SAAgBE,EAAM,EAAE,SAAM,aAAU,YAAY,aAAU,UAAO,gBAAyB;CAC5F,OACE,kBAAC,QAAD;EACE,WAAWC,MAAc,KAAA,IAAY,aAAa,YAAYA;EAC9D,aAAWC;EACX,gBAAcC,MAAY,WAAW,WAAW,KAAA;EACzC;EAEN;CACG,CAAA;AAEV;;ACvCA,SAAgBC,EAAQ,EAAE,UAAO,cAAW,GAAGC,KAAsB;CACnE,IAAMC,IAAUL,MAAc,KAAA,IAAY,eAAe,cAAcA;CAIvE,OAHIM,MAAU,KAAA,KAAaA,MAAU,KAC5B,kBAAC,QAAD;EAAM,GAAIF;EAAM,WAAWC;EAAS,eAAY;CAAQ,CAAA,IAG/D,kBAAC,QAAD;EAAM,GAAID;EAAM,WAAW,GAAGC,EAAQ;EAAuB,MAAK;EAAlE,UAAA,CACE,kBAAC,QAAD;GAAM,WAAU;GAAkB,eAAY;EAAQ,CAAA,GACtD,kBAAC,QAAD;GAAM,WAA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
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import "./Banner.css";
|
|
3
|
+
/** The tones a banner draws; any other string is drawn neutrally. */
|
|
4
|
+
export type BannerTone = "ok" | "warn" | "err" | "quiet" | "off" | (string & {});
|
|
5
|
+
export type BannerProps = Omit<ComponentPropsWithRef<"div">, "role"> & {
|
|
6
|
+
/** What the news is, by colour: the stripe's, and the surface's for warn and err. */
|
|
7
|
+
tone: BannerTone;
|
|
8
|
+
/** The news, in words. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** A slot at the end: the buttons that act on the news. */
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
/** Shows a close button, which asks the app to take the banner away. */
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
/** The close button's name, "Dismiss" by default. */
|
|
15
|
+
dismissLabel?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function Banner({ tone, children, actions, onDismiss, dismissLabel, className, ...rest }: BannerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
import "./DiffView.css";
|
|
3
|
+
export type DiffFile = {
|
|
4
|
+
/** The file's path; the section is labelled by its last part. Unique among the files. */
|
|
5
|
+
path: string;
|
|
6
|
+
/** The file's unified diff text. */
|
|
7
|
+
diff: string;
|
|
8
|
+
};
|
|
9
|
+
/** What a line of unified diff text is, by its start. */
|
|
10
|
+
export type DiffLineKind = "add" | "del" | "hunk" | "meta" | "note" | "context";
|
|
11
|
+
type DiffSource = {
|
|
12
|
+
/** One unified diff, drawn whole without a heading. */
|
|
13
|
+
diff: string;
|
|
14
|
+
files?: never;
|
|
15
|
+
} | {
|
|
16
|
+
/** One section per file, in this order. */
|
|
17
|
+
files: readonly DiffFile[];
|
|
18
|
+
diff?: never;
|
|
19
|
+
};
|
|
20
|
+
export type DiffViewProps = Omit<ComponentPropsWithRef<"div">, "children" | "onToggle"> & DiffSource & {
|
|
21
|
+
/** The files' headings' level, h2 to h6 (h3 by default). */
|
|
22
|
+
level?: 2 | 3 | 4 | 5 | 6;
|
|
23
|
+
/**
|
|
24
|
+
* The paths of the files folded away. Given, the app holds them and onToggle asks it to change them; left out,
|
|
25
|
+
* the view keeps its own, every file open at first.
|
|
26
|
+
*/
|
|
27
|
+
collapsed?: readonly string[];
|
|
28
|
+
/** Called when the person opens (true) or folds (false) a file's section. */
|
|
29
|
+
onToggle?: (path: string, open: boolean) => void;
|
|
30
|
+
};
|
|
31
|
+
/** The kind of one line of unified diff text. */
|
|
32
|
+
export declare function diffLineKind(line: string): DiffLineKind;
|
|
33
|
+
/** A path's last part: "src/app/main.ts" is "main.ts". */
|
|
34
|
+
export declare function baseName(path: string): string;
|
|
35
|
+
export declare function DiffView({ diff, files, level, collapsed, onToggle, className, ...rest }: DiffViewProps): import("react").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import "./StatusWords.css";
|
|
3
|
+
/** The tones a word draws; any other string is drawn neutrally. */
|
|
4
|
+
export type StatusWordTone = "ok" | "warn" | "err" | "quiet" | "off" | (string & {});
|
|
5
|
+
export type StatusWord = {
|
|
6
|
+
tone: StatusWordTone;
|
|
7
|
+
/** The state in words. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Shown on hover: what the state means or why it is so. */
|
|
10
|
+
title?: string;
|
|
11
|
+
};
|
|
12
|
+
export type StatusWordsProps = Omit<ComponentPropsWithRef<"ul">, "children"> & {
|
|
13
|
+
/** The states, most urgent first; drawn in this order. */
|
|
14
|
+
items: readonly StatusWord[];
|
|
15
|
+
};
|
|
16
|
+
export declare function StatusWords({ items, className, ...rest }: StatusWordsProps): import("react").JSX.Element;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import "./Badge.css";
|
|
3
3
|
/** The tones a badge draws; any other string is drawn neutrally. */
|
|
4
|
-
export type BadgeTone = "ok" | "warn" | "err" | "quiet" | "off" | (string & {});
|
|
4
|
+
export type BadgeTone = "ok" | "warn" | "err" | "quiet" | "off" | "accent" | "muted" | "added" | "removed" | "renamed" | "changed" | (string & {});
|
|
5
|
+
/** How a badge is drawn: outlined in its tone (the default), or filled with it. */
|
|
6
|
+
export type BadgeVariant = "outlined" | "filled";
|
|
5
7
|
export type BadgeProps = {
|
|
6
|
-
/** The badge's tone: its text and border colour
|
|
8
|
+
/** The badge's tone: its text and border colour (outlined) or its fill (filled). */
|
|
7
9
|
tone: BadgeTone;
|
|
10
|
+
/**
|
|
11
|
+
* Outlined (the default): text and border in the tone. Filled: the tone's fill under on-strong text, for a fact that
|
|
12
|
+
* must stand out.
|
|
13
|
+
*/
|
|
14
|
+
variant?: BadgeVariant;
|
|
8
15
|
/** What the badge says: a word, a count, a WarnMark beside them. */
|
|
9
16
|
children: ReactNode;
|
|
10
17
|
/** Shown on hover: what the badge means. */
|
|
@@ -13,4 +20,4 @@ export type BadgeProps = {
|
|
|
13
20
|
className?: string;
|
|
14
21
|
};
|
|
15
22
|
/** Draws a short word or count in a chip of its tone. */
|
|
16
|
-
export declare function Badge({ tone, children, title, className }: BadgeProps): import("react").JSX.Element;
|
|
23
|
+
export declare function Badge({ tone, variant, children, title, className }: BadgeProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Badge } from "./Badge";
|
|
2
|
-
export type { BadgeProps, BadgeTone } from "./Badge";
|
|
2
|
+
export type { BadgeProps, BadgeTone, BadgeVariant } from "./Badge";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import "./Pill.css";
|
|
3
3
|
/** The tones a pill draws; any other string is drawn neutrally. */
|
|
4
|
-
export type PillTone = "ok" | "warn" | "err" | "quiet" | "off" | (string & {});
|
|
4
|
+
export type PillTone = "ok" | "warn" | "err" | "quiet" | "off" | "accent" | "muted" | (string & {});
|
|
5
5
|
export type PillProps = {
|
|
6
6
|
/** The state's tone: the dot's and the word's colour. */
|
|
7
7
|
tone: PillTone;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
|
+
import "./RadioGroup.css";
|
|
3
|
+
/** stacked (the default: one option a row) or inline (the options side by side, wrapping); others stack. */
|
|
4
|
+
export type RadioGroupLayout = "stacked" | "inline" | (string & {});
|
|
5
|
+
export type RadioOption = {
|
|
6
|
+
/** The value onChange gives when this option is picked; unique in the group. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** The option's words, which pick it too. */
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
/** Shown on hover over the option. */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** Not pickable. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type RadioGroupProps = Omit<ComponentPropsWithRef<"fieldset">, "children" | "onChange"> & {
|
|
16
|
+
/** What the choice is: the group's legend and accessible name. */
|
|
17
|
+
legend: ReactNode;
|
|
18
|
+
/** Keeps the legend for screen readers only, when the layout around the group already says what it is. */
|
|
19
|
+
legendHidden?: boolean;
|
|
20
|
+
options: readonly RadioOption[];
|
|
21
|
+
/** The picked option's value; one matching no option (or undefined) picks none. */
|
|
22
|
+
value: string | undefined;
|
|
23
|
+
/** Asks the app to pick this value. */
|
|
24
|
+
onChange: (value: string) => void;
|
|
25
|
+
/** The radios' shared name; one of its own by default. */
|
|
26
|
+
name?: string;
|
|
27
|
+
layout?: RadioGroupLayout;
|
|
28
|
+
/** A line of help under the options. */
|
|
29
|
+
hint?: ReactNode;
|
|
30
|
+
/** Why the choice is refused; while there is one the group is marked invalid. Empty means none. */
|
|
31
|
+
error?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
export declare function RadioGroup({ legend, legendHidden, options, value, onChange, name, layout, hint, error, className, "aria-describedby": describedByOwn, "aria-invalid": invalidOwn, ...rest }: RadioGroupProps): import("react").JSX.Element;
|
package/package.json
CHANGED