@codesweep-ai/ui 0.2.1-dev.20260830023458.856ea8f
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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +124 -0
- package/dist/BUILD.json +1 -0
- package/dist/chart.d.ts +3 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +3 -0
- package/dist/code.d.ts +2 -0
- package/dist/code.d.ts.map +1 -0
- package/dist/code.js +2 -0
- package/dist/components/AgentStatus.d.ts +15 -0
- package/dist/components/AgentStatus.d.ts.map +1 -0
- package/dist/components/AgentStatus.js +38 -0
- package/dist/components/AgentTrace.d.ts +42 -0
- package/dist/components/AgentTrace.d.ts.map +1 -0
- package/dist/components/AgentTrace.js +140 -0
- package/dist/components/AppShell.d.ts +29 -0
- package/dist/components/AppShell.d.ts.map +1 -0
- package/dist/components/AppShell.js +71 -0
- package/dist/components/Button.d.ts +10 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +41 -0
- package/dist/components/Card.d.ts +19 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +96 -0
- package/dist/components/CardGroup.d.ts +16 -0
- package/dist/components/CardGroup.d.ts.map +1 -0
- package/dist/components/CardGroup.js +33 -0
- package/dist/components/CardGroupContext.d.ts +14 -0
- package/dist/components/CardGroupContext.d.ts.map +1 -0
- package/dist/components/CardGroupContext.js +8 -0
- package/dist/components/ChartFrame.d.ts +30 -0
- package/dist/components/ChartFrame.d.ts.map +1 -0
- package/dist/components/ChartFrame.js +96 -0
- package/dist/components/ChartTooltip.d.ts +22 -0
- package/dist/components/ChartTooltip.d.ts.map +1 -0
- package/dist/components/ChartTooltip.js +26 -0
- package/dist/components/CheckboxGroup.d.ts +37 -0
- package/dist/components/CheckboxGroup.d.ts.map +1 -0
- package/dist/components/CheckboxGroup.js +198 -0
- package/dist/components/Chip.d.ts +9 -0
- package/dist/components/Chip.d.ts.map +1 -0
- package/dist/components/Chip.js +31 -0
- package/dist/components/CodeBlock.d.ts +30 -0
- package/dist/components/CodeBlock.d.ts.map +1 -0
- package/dist/components/CodeBlock.js +112 -0
- package/dist/components/Dropdown.d.ts +28 -0
- package/dist/components/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown.js +50 -0
- package/dist/components/EventLanes.d.ts +93 -0
- package/dist/components/EventLanes.d.ts.map +1 -0
- package/dist/components/EventLanes.js +445 -0
- package/dist/components/FormGroup.d.ts +29 -0
- package/dist/components/FormGroup.d.ts.map +1 -0
- package/dist/components/FormGroup.js +48 -0
- package/dist/components/HighlightText.d.ts +15 -0
- package/dist/components/HighlightText.d.ts.map +1 -0
- package/dist/components/HighlightText.js +28 -0
- package/dist/components/Input.d.ts +35 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +61 -0
- package/dist/components/Legend.d.ts +21 -0
- package/dist/components/Legend.d.ts.map +1 -0
- package/dist/components/Legend.js +61 -0
- package/dist/components/LightweightMarkdown.d.ts +3 -0
- package/dist/components/LightweightMarkdown.d.ts.map +1 -0
- package/dist/components/LightweightMarkdown.js +249 -0
- package/dist/components/MarkdownMinimap.d.ts +7 -0
- package/dist/components/MarkdownMinimap.d.ts.map +1 -0
- package/dist/components/MarkdownMinimap.js +84 -0
- package/dist/components/MarkdownViewer.d.ts +51 -0
- package/dist/components/MarkdownViewer.d.ts.map +1 -0
- package/dist/components/MarkdownViewer.js +455 -0
- package/dist/components/MermaidDiagram.d.ts +11 -0
- package/dist/components/MermaidDiagram.d.ts.map +1 -0
- package/dist/components/MermaidDiagram.js +119 -0
- package/dist/components/Modal.d.ts +13 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/Modal.js +91 -0
- package/dist/components/Panel.d.ts +13 -0
- package/dist/components/Panel.d.ts.map +1 -0
- package/dist/components/Panel.js +44 -0
- package/dist/components/PulseBadge.d.ts +15 -0
- package/dist/components/PulseBadge.d.ts.map +1 -0
- package/dist/components/PulseBadge.js +22 -0
- package/dist/components/RadioGroup.d.ts +20 -0
- package/dist/components/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup.js +63 -0
- package/dist/components/RichMarkdownRenderer.d.ts +10 -0
- package/dist/components/RichMarkdownRenderer.d.ts.map +1 -0
- package/dist/components/RichMarkdownRenderer.js +18 -0
- package/dist/components/SearchInput.d.ts +25 -0
- package/dist/components/SearchInput.d.ts.map +1 -0
- package/dist/components/SearchInput.js +92 -0
- package/dist/components/SectionedTree.d.ts +36 -0
- package/dist/components/SectionedTree.d.ts.map +1 -0
- package/dist/components/SectionedTree.js +173 -0
- package/dist/components/SegmentedControl.d.ts +16 -0
- package/dist/components/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl.js +48 -0
- package/dist/components/Skeleton.d.ts +8 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton.js +25 -0
- package/dist/components/SplitPane.d.ts +16 -0
- package/dist/components/SplitPane.d.ts.map +1 -0
- package/dist/components/SplitPane.js +118 -0
- package/dist/components/StatusBadge.d.ts +15 -0
- package/dist/components/StatusBadge.d.ts.map +1 -0
- package/dist/components/StatusBadge.js +40 -0
- package/dist/components/StreamingText.d.ts +20 -0
- package/dist/components/StreamingText.d.ts.map +1 -0
- package/dist/components/StreamingText.js +50 -0
- package/dist/components/Table.d.ts +62 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Table.js +256 -0
- package/dist/components/ThemeToggle.d.ts +11 -0
- package/dist/components/ThemeToggle.d.ts.map +1 -0
- package/dist/components/ThemeToggle.js +55 -0
- package/dist/components/Toast.d.ts +8 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +51 -0
- package/dist/components/ToastContainer.d.ts +5 -0
- package/dist/components/ToastContainer.d.ts.map +1 -0
- package/dist/components/ToastContainer.js +29 -0
- package/dist/components/Tree.d.ts +50 -0
- package/dist/components/Tree.d.ts.map +1 -0
- package/dist/components/Tree.js +528 -0
- package/dist/components/TreeDnd.d.ts +18 -0
- package/dist/components/TreeDnd.d.ts.map +1 -0
- package/dist/components/TreeDnd.js +39 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/lib/accentToken.d.ts +3 -0
- package/dist/lib/accentToken.d.ts.map +1 -0
- package/dist/lib/accentToken.js +12 -0
- package/dist/lib/chartTheme.d.ts +45 -0
- package/dist/lib/chartTheme.d.ts.map +1 -0
- package/dist/lib/chartTheme.js +64 -0
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +11 -0
- package/dist/lib/forwardRefToRoot.d.ts +8 -0
- package/dist/lib/forwardRefToRoot.d.ts.map +1 -0
- package/dist/lib/forwardRefToRoot.js +18 -0
- package/dist/lib/markdownUrl.d.ts +5 -0
- package/dist/lib/markdownUrl.d.ts.map +1 -0
- package/dist/lib/markdownUrl.js +24 -0
- package/dist/lib/toast.d.ts +30 -0
- package/dist/lib/toast.d.ts.map +1 -0
- package/dist/lib/toast.js +34 -0
- package/dist/lib/useTheme.d.ts +22 -0
- package/dist/lib/useTheme.d.ts.map +1 -0
- package/dist/lib/useTheme.js +62 -0
- package/dist/markdown/rich.d.ts +10 -0
- package/dist/markdown/rich.d.ts.map +1 -0
- package/dist/markdown/rich.js +8 -0
- package/dist/markdown.d.ts +3 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +2 -0
- package/dist/mermaid.d.ts +2 -0
- package/dist/mermaid.d.ts.map +1 -0
- package/dist/mermaid.js +2 -0
- package/dist/minimap.d.ts +2 -0
- package/dist/minimap.d.ts.map +1 -0
- package/dist/minimap.js +2 -0
- package/dist/styles/base.css +98 -0
- package/dist/styles/components/agent-status.css +52 -0
- package/dist/styles/components/agent-trace.css +206 -0
- package/dist/styles/components/app-shell.css +195 -0
- package/dist/styles/components/button.css +172 -0
- package/dist/styles/components/card-group.css +20 -0
- package/dist/styles/components/card.css +200 -0
- package/dist/styles/components/chart-frame.css +144 -0
- package/dist/styles/components/chart-tooltip.css +54 -0
- package/dist/styles/components/checkbox-group.css +281 -0
- package/dist/styles/components/chip.css +61 -0
- package/dist/styles/components/code-block.css +215 -0
- package/dist/styles/components/dropdown.css +131 -0
- package/dist/styles/components/event-lanes.css +159 -0
- package/dist/styles/components/form-group.css +34 -0
- package/dist/styles/components/highlight-text.css +17 -0
- package/dist/styles/components/input.css +168 -0
- package/dist/styles/components/legend.css +80 -0
- package/dist/styles/components/markdown-minimap.css +13 -0
- package/dist/styles/components/markdown-viewer.css +354 -0
- package/dist/styles/components/mermaid-diagram.css +8 -0
- package/dist/styles/components/modal.css +167 -0
- package/dist/styles/components/panel.css +126 -0
- package/dist/styles/components/pulse-badge.css +56 -0
- package/dist/styles/components/radio-group.css +89 -0
- package/dist/styles/components/search-input.css +153 -0
- package/dist/styles/components/sectioned-tree.css +183 -0
- package/dist/styles/components/segmented-control.css +54 -0
- package/dist/styles/components/skeleton.css +21 -0
- package/dist/styles/components/split-pane.css +78 -0
- package/dist/styles/components/status-badge.css +94 -0
- package/dist/styles/components/streaming-text.css +38 -0
- package/dist/styles/components/table.css +235 -0
- package/dist/styles/components/theme-toggle.css +123 -0
- package/dist/styles/components/toast-container.css +34 -0
- package/dist/styles/components/toast.css +169 -0
- package/dist/styles/components/tree.css +375 -0
- package/dist/styles/components.css +37 -0
- package/dist/styles/core.css +3 -0
- package/dist/styles/markdown-content.css +368 -0
- package/dist/styles/print.css +55 -0
- package/dist/styles/reset.css +202 -0
- package/dist/styles/syntax.css +62 -0
- package/dist/styles/tokens.css +344 -0
- package/dist/styles/utilities.css +7 -0
- package/dist/testing/index.d.ts +39 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +119 -0
- package/package.json +138 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { forwardRefToRoot as e } from "../lib/forwardRefToRoot.js";
|
|
4
|
+
import { cn as t } from "../lib/cn.js";
|
|
5
|
+
import { FormGroup as n } from "./FormGroup.js";
|
|
6
|
+
import { useMemo as r, useState as i } from "react";
|
|
7
|
+
import { ChevronDown as a, ChevronRight as o, X as s } from "lucide-react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/CheckboxGroup.tsx
|
|
10
|
+
function u({ opt: e, checked: n, disabled: r, onToggle: i }) {
|
|
11
|
+
return /* @__PURE__ */ l("label", {
|
|
12
|
+
className: t("cs-component-checkbox-group-5 ", "cs-component-checkbox-group-6 ", (r || e.disabled) && "cs-component-checkbox-group-7 "),
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ c("input", {
|
|
15
|
+
type: "checkbox",
|
|
16
|
+
checked: n,
|
|
17
|
+
onChange: i,
|
|
18
|
+
disabled: r || e.disabled,
|
|
19
|
+
className: "cs-component-checkbox-group-9 "
|
|
20
|
+
}),
|
|
21
|
+
e.color && /* @__PURE__ */ c("span", {
|
|
22
|
+
className: "cs-component-checkbox-group-10 ",
|
|
23
|
+
style: { backgroundColor: e.color }
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ c("span", {
|
|
26
|
+
className: "cs-component-checkbox-group-11",
|
|
27
|
+
children: e.label
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function d({ allDisabled: e, noneDisabled: n, groupDisabled: r, onAll: i, onNone: a }) {
|
|
33
|
+
let o = t("cs-component-checkbox-group-12 ", "cs-component-checkbox-group-13 ", "cs-component-checkbox-group-14 ", "cs-component-checkbox-group-15 ");
|
|
34
|
+
return /* @__PURE__ */ l("div", {
|
|
35
|
+
className: "cs-component-checkbox-group-16 ",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ c("button", {
|
|
38
|
+
type: "button",
|
|
39
|
+
onClick: i,
|
|
40
|
+
disabled: r || e,
|
|
41
|
+
className: o,
|
|
42
|
+
children: "All"
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ c("span", {
|
|
45
|
+
className: "cs-component-checkbox-group-18",
|
|
46
|
+
children: "|"
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ c("button", {
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: a,
|
|
51
|
+
disabled: r || n,
|
|
52
|
+
className: o,
|
|
53
|
+
children: "None"
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function f({ sections: e, selected: n, disabled: r, onToggle: s }) {
|
|
59
|
+
let [d, f] = i(/* @__PURE__ */ new Set()), p = e.length > 0 && e.every((e) => d.has(e.name));
|
|
60
|
+
e.every((e) => !d.has(e.name));
|
|
61
|
+
let m = (e) => {
|
|
62
|
+
f((t) => {
|
|
63
|
+
let n = new Set(t);
|
|
64
|
+
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ l("div", {
|
|
68
|
+
className: "cs-component-checkbox-group-20 ",
|
|
69
|
+
children: [/* @__PURE__ */ c("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
onClick: () => {
|
|
72
|
+
f(p ? /* @__PURE__ */ new Set() : new Set(e.map((e) => e.name)));
|
|
73
|
+
},
|
|
74
|
+
className: t("cs-component-checkbox-group-12 ", "cs-component-checkbox-group-22 ", "cs-component-checkbox-group-14 "),
|
|
75
|
+
children: p ? "Expand all" : "Collapse all"
|
|
76
|
+
}), e.map((e) => {
|
|
77
|
+
let i = d.has(e.name), f = e.options.filter((e) => n.has(e.value)).length;
|
|
78
|
+
return /* @__PURE__ */ l("div", {
|
|
79
|
+
className: "cs-component-checkbox-group-26 ",
|
|
80
|
+
children: [/* @__PURE__ */ l("button", {
|
|
81
|
+
type: "button",
|
|
82
|
+
onClick: () => m(e.name),
|
|
83
|
+
className: t("cs-component-checkbox-group-28 ", "cs-component-checkbox-group-29 ", "text-label-upper", "cs-component-checkbox-group-31 ", "cs-component-checkbox-group-14 ", "cs-component-checkbox-group-32 "),
|
|
84
|
+
children: [
|
|
85
|
+
c(i ? o : a, { className: "cs-component-checkbox-group-33 " }),
|
|
86
|
+
/* @__PURE__ */ c("span", {
|
|
87
|
+
className: "cs-component-checkbox-group-34",
|
|
88
|
+
children: e.name
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ l("span", {
|
|
91
|
+
className: "cs-component-checkbox-group-35 ",
|
|
92
|
+
children: [
|
|
93
|
+
f,
|
|
94
|
+
"/",
|
|
95
|
+
e.options.length
|
|
96
|
+
]
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
}), !i && /* @__PURE__ */ c("div", {
|
|
100
|
+
className: "cs-component-checkbox-group-36 ",
|
|
101
|
+
children: e.options.map((e) => /* @__PURE__ */ c(u, {
|
|
102
|
+
opt: e,
|
|
103
|
+
checked: n.has(e.value),
|
|
104
|
+
disabled: r,
|
|
105
|
+
onToggle: () => s(e.value)
|
|
106
|
+
}, e.value))
|
|
107
|
+
})]
|
|
108
|
+
}, e.name);
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function p({ options: e, selected: a, onChange: o, label: p, helper: m, error: h, filterable: g = !1, filterPlaceholder: _ = "Filter...", disabled: v = !1, className: y }) {
|
|
113
|
+
let [b, x] = i(""), S = e.some((e) => e.group), C = r(() => {
|
|
114
|
+
if (!b) return e;
|
|
115
|
+
let t = b.toLowerCase();
|
|
116
|
+
return e.filter((e) => e.label.toLowerCase().includes(t));
|
|
117
|
+
}, [e, b]), w = C.length > 0 && C.every((e) => a.has(e.value)), T = C.every((e) => !a.has(e.value)), E = () => {
|
|
118
|
+
let e = new Set(a);
|
|
119
|
+
for (let t of C) e.add(t.value);
|
|
120
|
+
o(e);
|
|
121
|
+
}, D = () => {
|
|
122
|
+
let e = new Set(a);
|
|
123
|
+
for (let t of C) e.delete(t.value);
|
|
124
|
+
o(e);
|
|
125
|
+
}, O = (e) => {
|
|
126
|
+
let t = new Set(a);
|
|
127
|
+
t.has(e) ? t.delete(e) : t.add(e), o(t);
|
|
128
|
+
}, k = r(() => {
|
|
129
|
+
if (!S) return [];
|
|
130
|
+
let e = /* @__PURE__ */ new Map();
|
|
131
|
+
for (let t of C) {
|
|
132
|
+
let n = t.group ?? "Other";
|
|
133
|
+
e.has(n) || e.set(n, []), e.get(n).push(t);
|
|
134
|
+
}
|
|
135
|
+
return Array.from(e.entries()).map(([e, t]) => ({
|
|
136
|
+
name: e,
|
|
137
|
+
options: t
|
|
138
|
+
}));
|
|
139
|
+
}, [C, S]);
|
|
140
|
+
return /* @__PURE__ */ c("div", {
|
|
141
|
+
"data-component": "CheckboxGroup",
|
|
142
|
+
className: t("cs-component-checkbox-group-26 ", v && "cs-component-checkbox-group-41", y),
|
|
143
|
+
children: /* @__PURE__ */ c(n, {
|
|
144
|
+
label: p,
|
|
145
|
+
helper: m,
|
|
146
|
+
error: h,
|
|
147
|
+
children: /* @__PURE__ */ l("div", {
|
|
148
|
+
className: "cs-component-checkbox-group-42 ",
|
|
149
|
+
children: [
|
|
150
|
+
g && /* @__PURE__ */ l("div", {
|
|
151
|
+
className: "cs-component-checkbox-group-43",
|
|
152
|
+
children: [/* @__PURE__ */ c("input", {
|
|
153
|
+
type: "text",
|
|
154
|
+
value: b,
|
|
155
|
+
onChange: (e) => x(e.target.value),
|
|
156
|
+
placeholder: _,
|
|
157
|
+
disabled: v,
|
|
158
|
+
className: t("cs-component-checkbox-group-45 ", "cs-component-checkbox-group-46 ", "cs-component-checkbox-group-47 ", "cs-component-checkbox-group-48", "cs-component-checkbox-group-49", "cs-component-checkbox-group-50 ", "cs-component-checkbox-group-51")
|
|
159
|
+
}), b && /* @__PURE__ */ c("button", {
|
|
160
|
+
type: "button",
|
|
161
|
+
onClick: () => x(""),
|
|
162
|
+
className: "cs-component-checkbox-group-54 ",
|
|
163
|
+
"aria-label": "Clear filter",
|
|
164
|
+
children: /* @__PURE__ */ c(s, { className: "cs-component-checkbox-group-33 " })
|
|
165
|
+
})]
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ c(d, {
|
|
168
|
+
allDisabled: w,
|
|
169
|
+
noneDisabled: T,
|
|
170
|
+
groupDisabled: v,
|
|
171
|
+
onAll: E,
|
|
172
|
+
onNone: D
|
|
173
|
+
}),
|
|
174
|
+
C.length === 0 ? /* @__PURE__ */ c("span", {
|
|
175
|
+
className: "cs-component-checkbox-group-56 ",
|
|
176
|
+
children: "No matches"
|
|
177
|
+
}) : S ? /* @__PURE__ */ c(f, {
|
|
178
|
+
sections: k,
|
|
179
|
+
selected: a,
|
|
180
|
+
disabled: v,
|
|
181
|
+
onToggle: O
|
|
182
|
+
}) : /* @__PURE__ */ c("div", {
|
|
183
|
+
className: "cs-component-checkbox-group-57 ",
|
|
184
|
+
children: C.map((e) => /* @__PURE__ */ c(u, {
|
|
185
|
+
opt: e,
|
|
186
|
+
checked: a.has(e.value),
|
|
187
|
+
disabled: v,
|
|
188
|
+
onToggle: () => O(e.value)
|
|
189
|
+
}, e.value))
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
var m = e(p);
|
|
197
|
+
//#endregion
|
|
198
|
+
export { m as CheckboxGroup };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
pressed?: boolean;
|
|
3
|
+
count?: number;
|
|
4
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const Chip: import("react").ForwardRefExoticComponent<ChipProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=Chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../src/components/Chip.tsx"],"names":[],"mappings":"AAGA,UAAU,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAsCD,eAAO,MAAM,IAAI,yGAA2D,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { forwardRefToRoot as e } from "../lib/forwardRefToRoot.js";
|
|
2
|
+
import { cn as t } from "../lib/cn.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Chip.tsx
|
|
5
|
+
function i({ pressed: e = !1, count: i, onPressedChange: a, onClick: o, disabled: s, className: c, children: l, type: u = "button", ...d }) {
|
|
6
|
+
return /* @__PURE__ */ r("button", {
|
|
7
|
+
...d,
|
|
8
|
+
"data-component": "Chip",
|
|
9
|
+
type: u,
|
|
10
|
+
"aria-pressed": e,
|
|
11
|
+
disabled: s,
|
|
12
|
+
onClick: (t) => {
|
|
13
|
+
o?.(t), t.defaultPrevented || a?.(!e);
|
|
14
|
+
},
|
|
15
|
+
className: t("cs-component-chip-1", e ? "cs-component-chip-2" : "cs-component-chip-3", s && "cs-component-chip-4", c),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ n("span", {
|
|
18
|
+
"data-chip-label": "",
|
|
19
|
+
children: l
|
|
20
|
+
}),
|
|
21
|
+
i != null && " ",
|
|
22
|
+
i != null && /* @__PURE__ */ n("span", {
|
|
23
|
+
className: "cs-component-chip-5",
|
|
24
|
+
children: i
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
var a = e(i);
|
|
30
|
+
//#endregion
|
|
31
|
+
export { a as Chip };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { LanguageFn } from "highlight.js";
|
|
2
|
+
/** Register an additional grammar without adding it to CodeBlock's eager bundle. */
|
|
3
|
+
export declare function registerCodeLanguage(name: string, definition: LanguageFn): boolean;
|
|
4
|
+
interface CodeBlockProps {
|
|
5
|
+
code: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
source?: string;
|
|
8
|
+
highlightedLines?: number[];
|
|
9
|
+
/** Substring to highlight within the code text */
|
|
10
|
+
highlightQuery?: string;
|
|
11
|
+
maxHeight?: string;
|
|
12
|
+
/** When true, expand to fill the parent's height instead of using maxHeight. */
|
|
13
|
+
fillHeight?: boolean;
|
|
14
|
+
/** When true, render as an inline embed — no max-height, no internal vertical
|
|
15
|
+
* scroll, flows with the parent's natural layout. Horizontal scroll is still
|
|
16
|
+
* available for long lines. Use for embedding code in scrollable pages where
|
|
17
|
+
* the outer page is the only scroll surface. Mutually exclusive with
|
|
18
|
+
* fillHeight; if both are set, fillHeight wins. */
|
|
19
|
+
inline?: boolean;
|
|
20
|
+
/** Grammars to register for this block. There is no built-in set and nothing
|
|
21
|
+
* is registered by default: an unregistered `language` renders escaped and
|
|
22
|
+
* uncoloured, which reads as a styling bug rather than a missing grammar.
|
|
23
|
+
* Pass the grammars you use — `languages={{ json }}` — so the bundle carries
|
|
24
|
+
* only those. See also `registerCodeLanguage()`. */
|
|
25
|
+
languages?: Record<string, LanguageFn>;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const CodeBlock: import("react").ForwardRefExoticComponent<CodeBlockProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=CodeBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/components/CodeBlock.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAe/C,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,WAMxE;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,kDAAkD;IAClD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;wDAIoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;yDAIqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8MD,eAAO,MAAM,SAAS,2GAAkE,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { forwardRefToRoot as e } from "../lib/forwardRefToRoot.js";
|
|
4
|
+
import { cn as t } from "../lib/cn.js";
|
|
5
|
+
import { useEffect as n, useMemo as r, useState as i, useSyncExternalStore as a } from "react";
|
|
6
|
+
import { Check as o, Copy as s } from "lucide-react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import u from "highlight.js/lib/core";
|
|
9
|
+
//#region src/components/CodeBlock.tsx
|
|
10
|
+
var d = 0, f = /* @__PURE__ */ new Set(), p = (e) => (f.add(e), () => f.delete(e)), m = () => d;
|
|
11
|
+
function h(e, t) {
|
|
12
|
+
if (u.getLanguage(e)) return !1;
|
|
13
|
+
u.registerLanguage(e, t), d += 1;
|
|
14
|
+
for (let e of f) e();
|
|
15
|
+
return !0;
|
|
16
|
+
}
|
|
17
|
+
var g = ["overflow", "auto"].join("-");
|
|
18
|
+
function _(e) {
|
|
19
|
+
let t = e.split("\n"), n = [], r = [];
|
|
20
|
+
for (let e of t) {
|
|
21
|
+
let t = r.join(""), i = [...r], a = /<(\/?)span([^>]*)>/g, o;
|
|
22
|
+
for (; (o = a.exec(e)) !== null;) o[1] === "/" ? i.pop() : i.push(`<span${o[2]}>`);
|
|
23
|
+
let s = "</span>".repeat(i.length);
|
|
24
|
+
n.push(t + e + s), r = i;
|
|
25
|
+
}
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
function v(e) {
|
|
29
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
30
|
+
}
|
|
31
|
+
function y(e, t) {
|
|
32
|
+
if (!t) return e;
|
|
33
|
+
let n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = new RegExp(n, "gi");
|
|
34
|
+
return e.split(/(<[^>]*>)/).map((e) => e.startsWith("<") ? e : e.replace(r, "<mark class=\"code-query-match\">$&</mark>")).join("");
|
|
35
|
+
}
|
|
36
|
+
function b({ code: e, language: d, source: f, highlightedLines: b, highlightQuery: x, maxHeight: S = "20rem", fillHeight: C = !1, inline: w = !1, languages: T, className: E }) {
|
|
37
|
+
let [D, O] = i(!1), k = a(p, m, m);
|
|
38
|
+
n(() => {
|
|
39
|
+
if (!d || u.getLanguage(d)) return;
|
|
40
|
+
let e = T?.[d];
|
|
41
|
+
e && h(d, e);
|
|
42
|
+
}, [d, T]);
|
|
43
|
+
let A = r(() => {
|
|
44
|
+
let t;
|
|
45
|
+
if (d && u.getLanguage(d)) try {
|
|
46
|
+
t = u.highlight(e, { language: d }).value;
|
|
47
|
+
} catch {
|
|
48
|
+
t = v(e);
|
|
49
|
+
}
|
|
50
|
+
else t = v(e);
|
|
51
|
+
let n = _(t);
|
|
52
|
+
return x ? n.map((e) => y(e, x)) : n;
|
|
53
|
+
}, [
|
|
54
|
+
e,
|
|
55
|
+
d,
|
|
56
|
+
x,
|
|
57
|
+
k
|
|
58
|
+
]);
|
|
59
|
+
return /* @__PURE__ */ l("div", {
|
|
60
|
+
"data-component": "CodeBlock",
|
|
61
|
+
className: t("cs-component-code-block-49 ", C && "cs-component-code-block-50 ", E),
|
|
62
|
+
children: [/* @__PURE__ */ l("div", {
|
|
63
|
+
className: t("cs-component-code-block-53 ", C && "cs-component-code-block-54"),
|
|
64
|
+
children: [f ? /* @__PURE__ */ c("span", {
|
|
65
|
+
className: "cs-component-code-block-55 ",
|
|
66
|
+
children: f
|
|
67
|
+
}) : d ? /* @__PURE__ */ c("span", {
|
|
68
|
+
className: "text-label-upper",
|
|
69
|
+
children: d
|
|
70
|
+
}) : /* @__PURE__ */ c("span", {}), /* @__PURE__ */ c("button", {
|
|
71
|
+
onClick: async () => {
|
|
72
|
+
try {
|
|
73
|
+
await navigator.clipboard.writeText(e), O(!0), setTimeout(() => O(!1), 2e3);
|
|
74
|
+
} catch {}
|
|
75
|
+
},
|
|
76
|
+
className: t("cs-component-code-block-57 ", D && "cs-component-code-block-58"),
|
|
77
|
+
"aria-label": D ? "Copied!" : "Copy code to clipboard",
|
|
78
|
+
children: c(D ? o : s, { className: "cs-component-code-block-61 " })
|
|
79
|
+
})]
|
|
80
|
+
}), /* @__PURE__ */ c("div", {
|
|
81
|
+
role: "group",
|
|
82
|
+
tabIndex: 0,
|
|
83
|
+
"aria-label": "Scrollable code",
|
|
84
|
+
className: t(C ? t("cs-component-code-block-62", g) : w ? "cs-component-code-block-63" : t("cs-component-code-block-64", g)),
|
|
85
|
+
style: C || w ? void 0 : { maxHeight: S },
|
|
86
|
+
children: /* @__PURE__ */ c("pre", {
|
|
87
|
+
className: "cs-component-code-block-65",
|
|
88
|
+
children: /* @__PURE__ */ c("code", {
|
|
89
|
+
"data-language": d,
|
|
90
|
+
className: t("cs-component-code-block-66 hljs", d && `language-${d}`),
|
|
91
|
+
children: A.map((e, n) => {
|
|
92
|
+
let r = n + 1, i = b?.includes(r);
|
|
93
|
+
return /* @__PURE__ */ l("div", {
|
|
94
|
+
className: t("cs-component-code-block-67", i && "cs-component-code-block-68"),
|
|
95
|
+
children: [/* @__PURE__ */ c("span", {
|
|
96
|
+
className: "cs-component-code-block-69 ",
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
children: r
|
|
99
|
+
}), /* @__PURE__ */ c("span", {
|
|
100
|
+
className: "cs-component-code-block-71 ",
|
|
101
|
+
dangerouslySetInnerHTML: { __html: e }
|
|
102
|
+
})]
|
|
103
|
+
}, n);
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
var x = e(b);
|
|
111
|
+
//#endregion
|
|
112
|
+
export { x as CodeBlock, h as registerCodeLanguage };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface DropdownOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface DropdownProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "value" | "onChange" | "options" | "placeholder" | "disabled" | "className" | "id" | "required" | "children"> {
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
options: DropdownOption[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Text shown as the sole disabled option when `options` is empty. Default: "No options available." */
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
/** Optional label rendered above the select. Added v1.3.0. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** id on the underlying <select>. Used as the label's htmlFor. Auto-generated when omitted. Added v1.3.0. */
|
|
18
|
+
id?: string;
|
|
19
|
+
/** Required marker on the label. Added v1.3.0. */
|
|
20
|
+
required?: boolean;
|
|
21
|
+
/** Grey helper text below the select. Added v1.3.0. */
|
|
22
|
+
helper?: string;
|
|
23
|
+
/** Red error message below the select; paints the red border. Added v1.3.0. */
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const Dropdown: import("react").ForwardRefExoticComponent<DropdownProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../src/components/Dropdown.tsx"],"names":[],"mappings":"AAMA,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC;IAC/L,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uGAAuG;IACvG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6GAA6G;IAC7G,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA6FD,eAAO,MAAM,QAAQ,0GAAgE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { forwardRefToRoot as e } from "../lib/forwardRefToRoot.js";
|
|
2
|
+
import { cn as t } from "../lib/cn.js";
|
|
3
|
+
import { FormGroup as n } from "./FormGroup.js";
|
|
4
|
+
import { useId as r } from "react";
|
|
5
|
+
import { ChevronDown as i } from "lucide-react";
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Dropdown.tsx
|
|
8
|
+
function c({ value: e, onChange: c, options: l, placeholder: u, disabled: d, className: f, emptyMessage: p = "No options available.", label: m, id: h, required: g, helper: _, error: v, "aria-label": y, ...b }) {
|
|
9
|
+
let x = r(), S = h ?? x, C = l.length === 0, w = !!v, T = /* @__PURE__ */ s("div", {
|
|
10
|
+
id: `${S}-wrapper`,
|
|
11
|
+
"data-component": "Dropdown",
|
|
12
|
+
className: t("cs-component-dropdown-6 ", f),
|
|
13
|
+
children: [/* @__PURE__ */ o("select", {
|
|
14
|
+
...b,
|
|
15
|
+
id: S,
|
|
16
|
+
value: e,
|
|
17
|
+
onChange: (e) => c(e.target.value),
|
|
18
|
+
disabled: d || C,
|
|
19
|
+
required: g,
|
|
20
|
+
"aria-invalid": w || void 0,
|
|
21
|
+
"aria-label": y ?? (m ? void 0 : u ?? "Select option"),
|
|
22
|
+
"data-testid": C ? "dropdown-empty" : void 0,
|
|
23
|
+
className: t("cs-component-dropdown-8 ", "cs-component-dropdown-9 ", "cs-component-dropdown-10 ", "cs-component-dropdown-11 ", "cs-component-dropdown-12 ", "cs-component-dropdown-13 ", "cs-component-dropdown-14", w ? "cs-component-dropdown-15 " : "cs-component-dropdown-16 ", d && "cs-component-dropdown-17 "),
|
|
24
|
+
children: C ? /* @__PURE__ */ o("option", {
|
|
25
|
+
value: "",
|
|
26
|
+
disabled: !0,
|
|
27
|
+
children: p
|
|
28
|
+
}) : /* @__PURE__ */ s(a, { children: [u && /* @__PURE__ */ o("option", {
|
|
29
|
+
value: "",
|
|
30
|
+
disabled: !0,
|
|
31
|
+
children: u
|
|
32
|
+
}), l.map((e) => /* @__PURE__ */ o("option", {
|
|
33
|
+
value: e.value,
|
|
34
|
+
disabled: e.disabled,
|
|
35
|
+
children: e.label
|
|
36
|
+
}, e.value))] })
|
|
37
|
+
}), /* @__PURE__ */ o(i, { className: "cs-component-dropdown-20 " })]
|
|
38
|
+
});
|
|
39
|
+
return !m && !_ && !v ? T : /* @__PURE__ */ o(n, {
|
|
40
|
+
label: m,
|
|
41
|
+
htmlFor: S,
|
|
42
|
+
required: g,
|
|
43
|
+
helper: _,
|
|
44
|
+
error: v,
|
|
45
|
+
children: T
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
var l = e(c);
|
|
49
|
+
//#endregion
|
|
50
|
+
export { l as Dropdown };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type EventShape = "square" | "circle" | "hollow" | "hollow-circle";
|
|
3
|
+
export type EventToken = `--${string}`;
|
|
4
|
+
export interface EventLane {
|
|
5
|
+
/** Stable lane key referenced by events and spans. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Visible label and accessible lane name. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Optional native tooltip for the visible lane label. */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** Optional context included in event option announcements. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Optional presentation hook for this lane's visible label. */
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface EventLaneEvent<K extends string = string> {
|
|
17
|
+
/** Unique, non-negative integer on the shared global axis. */
|
|
18
|
+
i: number;
|
|
19
|
+
lane: string;
|
|
20
|
+
kind: K;
|
|
21
|
+
shape: EventShape;
|
|
22
|
+
label: string;
|
|
23
|
+
at: string;
|
|
24
|
+
error?: boolean;
|
|
25
|
+
tick?: boolean;
|
|
26
|
+
marker?: string;
|
|
27
|
+
/** Permanent token-coloured ring, painted below linked and selected halos. */
|
|
28
|
+
halo?: EventToken;
|
|
29
|
+
}
|
|
30
|
+
export interface EventLaneSpan {
|
|
31
|
+
lane: string;
|
|
32
|
+
from: number;
|
|
33
|
+
to: number;
|
|
34
|
+
}
|
|
35
|
+
export interface EventLanesRulerContext {
|
|
36
|
+
start: 0;
|
|
37
|
+
end: number;
|
|
38
|
+
cellWidth: number;
|
|
39
|
+
width: number;
|
|
40
|
+
xForIndex: (i: number) => number;
|
|
41
|
+
}
|
|
42
|
+
export interface EventLanesProps<K extends string = string> {
|
|
43
|
+
lanes: readonly EventLane[];
|
|
44
|
+
events: readonly EventLaneEvent<K>[];
|
|
45
|
+
spans?: readonly EventLaneSpan[];
|
|
46
|
+
palette: Record<K, EventToken>;
|
|
47
|
+
selected?: number | null;
|
|
48
|
+
linked?: ReadonlySet<number>;
|
|
49
|
+
hiddenKinds?: ReadonlySet<K>;
|
|
50
|
+
emphasis?: ReadonlySet<number>;
|
|
51
|
+
cellWidth?: number;
|
|
52
|
+
overview?: "auto" | boolean;
|
|
53
|
+
ruler?: ReactNode | ((context: EventLanesRulerContext) => ReactNode);
|
|
54
|
+
/** Sticky label for the ruler row. Default: "Index". */
|
|
55
|
+
rulerLabel?: string;
|
|
56
|
+
renderTooltip?: (event: EventLaneEvent<K>) => ReactNode;
|
|
57
|
+
onSelect?: (event: EventLaneEvent<K>) => void;
|
|
58
|
+
onHover?: (event: EventLaneEvent<K> | null) => void;
|
|
59
|
+
"aria-label"?: string;
|
|
60
|
+
id?: string;
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
/** The mark's drawn size for a given cell, exported for its budget test (not
|
|
64
|
+
* public API — not re-exported from the package index).
|
|
65
|
+
*
|
|
66
|
+
* This is the chart's PRIMARY VISUAL ENCODING: shrink it and the timeline stops
|
|
67
|
+
* reading as one, with every other gate still green. It was
|
|
68
|
+
* `min(14, cellWidth - 4)` — a fixed inset, which costs a narrow cell far more
|
|
69
|
+
* than a wide one: at cellWidth 10 it took 40% of the cell (9px marks became
|
|
70
|
+
* 6px, a dense barcode became a dotted line) while at 22 it took 18% and went
|
|
71
|
+
* unnoticed. A 1px gutter is what neighbouring marks actually need. */
|
|
72
|
+
export declare function markSizeFor(cellWidth: number): number;
|
|
73
|
+
/** The selected halo's outer edge must fit before the first cell and after the
|
|
74
|
+
* final cell. Reserving its overhang plus one antialiasing pixel keeps every
|
|
75
|
+
* ordinary cell pitch unchanged while making both boundary rings fully paintable. */
|
|
76
|
+
export declare function axisPaddingFor(cellWidth: number): number;
|
|
77
|
+
/** Overview geometry, exported for its regression test (not part of the public
|
|
78
|
+
* API — it is not re-exported from the package index).
|
|
79
|
+
*
|
|
80
|
+
* The invariant: every lane band must lie strictly inside
|
|
81
|
+
* [OVERVIEW_CHROME, OVERVIEW_HEIGHT - OVERVIEW_CHROME], the region the
|
|
82
|
+
* viewport-window outline never paints. Violating it is invisible in a unit
|
|
83
|
+
* test and shows up as whole lanes missing from the overview. */
|
|
84
|
+
export declare function overviewLaneGeometry(laneCount: number): {
|
|
85
|
+
chromeTop: number;
|
|
86
|
+
chromeBottom: number;
|
|
87
|
+
band: number;
|
|
88
|
+
markHeight: number;
|
|
89
|
+
markTop: (row: number) => number;
|
|
90
|
+
};
|
|
91
|
+
export declare function drawMark(context: CanvasRenderingContext2D, shape: EventShape, x: number, y: number, size: number, fill: string, background: string): void;
|
|
92
|
+
export declare const EventLanes: import("react").ForwardRefExoticComponent<EventLanesProps<string> & import("react").RefAttributes<HTMLDivElement>>;
|
|
93
|
+
//# sourceMappingURL=EventLanes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventLanes.d.ts","sourceRoot":"","sources":["../../src/components/EventLanes.tsx"],"names":[],"mappings":"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"}
|