@cognite/aura 0.1.5 → 0.1.7
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/DESIGN.md +1269 -0
- package/README.md +24 -0
- package/dist/colors.css +824 -0
- package/dist/components/index.d.ts +11 -2
- package/dist/components/index.js +284 -249
- package/dist/components/ui/core/accordion/accordion.d.ts +24 -0
- package/dist/components/ui/core/accordion/accordion.js +113 -0
- package/dist/components/ui/core/accordion/accordion.metadata.d.ts +2 -0
- package/dist/components/ui/core/accordion/accordion.metadata.js +9 -0
- package/dist/components/ui/core/alert/alert.d.ts +2 -1
- package/dist/components/ui/core/alert/alert.js +120 -96
- package/dist/components/ui/core/alert/alert.metadata.js +1 -1
- package/dist/components/ui/core/avatar/avatar.js +29 -32
- package/dist/components/ui/core/badge/badge.d.ts +1 -1
- package/dist/components/ui/core/badge/badge.js +44 -52
- package/dist/components/ui/core/banner/banner.d.ts +40 -0
- package/dist/components/ui/core/banner/banner.js +218 -0
- package/dist/components/ui/core/banner/banner.metadata.d.ts +2 -0
- package/dist/components/ui/core/banner/banner.metadata.js +9 -0
- package/dist/components/ui/core/button/button.d.ts +2 -2
- package/dist/components/ui/core/button/button.js +19 -20
- package/dist/components/ui/core/button-group/button-group.js +10 -10
- package/dist/components/ui/core/card/card.js +1 -1
- package/dist/components/ui/core/code-block/code-block.d.ts +14 -3
- package/dist/components/ui/core/code-block/code-block.js +218 -97
- package/dist/components/ui/core/code-block/code-block.metadata.js +1 -1
- package/dist/components/ui/core/collapsible/collapsible.js +30 -24
- package/dist/components/ui/core/command/command.d.ts +2 -2
- package/dist/components/ui/core/command/command.js +30 -30
- package/dist/components/ui/core/dialog/dialog.js +8 -8
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +65 -62
- package/dist/components/ui/core/helper-text/helper-text.js +8 -8
- package/dist/components/ui/core/hover-card/hover-card.js +5 -5
- package/dist/components/ui/core/inline-citation/inline-citation.js +19 -16
- package/dist/components/ui/core/input/input.d.ts +1 -5
- package/dist/components/ui/core/input/input.js +24 -30
- package/dist/components/ui/core/input-group/input-group.d.ts +2 -2
- package/dist/components/ui/core/input-group/input-group.js +104 -74
- package/dist/components/ui/core/label/label.d.ts +3 -1
- package/dist/components/ui/core/label/label.js +39 -16
- package/dist/components/ui/core/label/label.metadata.js +2 -2
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +11 -0
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +13 -0
- package/dist/components/ui/core/message/message.d.ts +1 -1
- package/dist/components/ui/core/message/message.js +62 -44
- package/dist/components/ui/core/popover/popover.d.ts +10 -1
- package/dist/components/ui/core/popover/popover.js +137 -34
- package/dist/components/ui/core/popover/popover.metadata.js +9 -0
- package/dist/components/ui/core/progress/progress.d.ts +10 -0
- package/dist/components/ui/core/progress/progress.js +61 -0
- package/dist/components/ui/core/progress/progress.metadata.d.ts +2 -0
- package/dist/components/ui/core/progress/progress.metadata.js +9 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +2 -2
- package/dist/components/ui/core/prompt-input/prompt-input.js +100 -100
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +3 -0
- package/dist/components/ui/core/scroll-area/scroll-area.js +71 -0
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.d.ts +2 -0
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.js +9 -0
- package/dist/components/ui/core/select/select.d.ts +3 -3
- package/dist/components/ui/core/select/select.js +69 -73
- package/dist/components/ui/core/skeleton/skeleton.js +6 -6
- package/dist/components/ui/core/sources/sources.js +8 -1
- package/dist/components/ui/core/textarea/textarea.d.ts +1 -8
- package/dist/components/ui/core/textarea/textarea.js +21 -45
- package/dist/components/ui/core/tool/tool.js +58 -50
- package/dist/components/ui/core/tooltip/tooltip.js +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +281 -249
- package/dist/lib/utils.d.ts +6 -6
- package/dist/lib/utils.js +26 -26
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +3 -812
- package/package.json +28 -9
|
@@ -1,146 +1,267 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { IconCheck as
|
|
4
|
-
import { isStorybookTestEnv as
|
|
5
|
-
import { Button as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as L, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as F, forwardRef as w, useState as x, useMemo as D, useEffect as O, useContext as H } from "react";
|
|
3
|
+
import { IconCheck as K, IconCopy as V, IconSelector as $, IconDownload as q } from "@tabler/icons-react";
|
|
4
|
+
import { isStorybookTestEnv as v, highlightCode as M, cn as f } from "../../../../lib/utils.js";
|
|
5
|
+
import { Button as S } from "../button/button.js";
|
|
6
|
+
const I = F({
|
|
7
7
|
code: "",
|
|
8
8
|
copyText: "",
|
|
9
9
|
isCollapsed: !1,
|
|
10
10
|
setIsCollapsed: () => {
|
|
11
11
|
},
|
|
12
12
|
lineCount: 0
|
|
13
|
-
}),
|
|
13
|
+
}), P = (e) => e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'"), E = 14, N = 8e3, W = 400, G = 16384;
|
|
14
|
+
function J(e) {
|
|
15
|
+
const t = e.split(`
|
|
16
|
+
`);
|
|
17
|
+
let n = !1, o = t.slice(0, E).join(`
|
|
18
|
+
`);
|
|
19
|
+
t.length > E && (n = !0), o.length > N && (o = o.slice(0, N), n = !0);
|
|
20
|
+
const a = o.length === 0 ? " " : o;
|
|
21
|
+
return n ? `${a}
|
|
22
|
+
…` : a;
|
|
23
|
+
}
|
|
24
|
+
function Q(e) {
|
|
25
|
+
return e.split(`
|
|
26
|
+
`).length > E || e.length > N;
|
|
27
|
+
}
|
|
28
|
+
function Y(e, t) {
|
|
29
|
+
return t > W || e.length > G;
|
|
30
|
+
}
|
|
31
|
+
function Z(e) {
|
|
32
|
+
return `<pre><code>${P(e)}</code></pre>`;
|
|
33
|
+
}
|
|
34
|
+
const ee = "min(60vh, 32rem)", oe = "dark:hidden [&>pre]:m-0 [&>pre]:min-h-10 [&>pre]:bg-card-background [&>pre]:p-2 [&>pre]:text-secondary-foreground [&>pre]:leading-[18px] [&>pre]:tracking-[-0.08px] [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm [&>pre]:overflow-x-auto", te = "hidden dark:block [&>pre]:m-0 [&>pre]:min-h-10 [&>pre]:bg-card-background [&>pre]:p-2 [&>pre]:text-secondary-foreground [&>pre]:leading-[18px] [&>pre]:tracking-[-0.08px] [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm [&>pre]:overflow-x-auto", ne = w(
|
|
14
35
|
({
|
|
15
36
|
code: e,
|
|
16
37
|
copyText: t,
|
|
17
|
-
language:
|
|
18
|
-
showLineNumbers:
|
|
19
|
-
collapsed:
|
|
20
|
-
className:
|
|
21
|
-
children:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
language: n,
|
|
39
|
+
showLineNumbers: o = !1,
|
|
40
|
+
collapsed: a = !1,
|
|
41
|
+
className: h,
|
|
42
|
+
children: i,
|
|
43
|
+
style: C,
|
|
44
|
+
...k
|
|
45
|
+
}, b) => {
|
|
46
|
+
const [d, p] = x(""), [c, _] = x(""), [l, R] = x(a), s = e.length === 0 ? " " : e, y = e.split(`
|
|
47
|
+
`).length, A = t ?? e, T = D(
|
|
48
|
+
() => v ? `<pre><code>${P(s)}</code></pre>` : "",
|
|
49
|
+
[s]
|
|
28
50
|
);
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const u = `<pre><code>${e}</code></pre>`;
|
|
37
|
-
m(u), a(u);
|
|
51
|
+
O(() => {
|
|
52
|
+
if (v) return;
|
|
53
|
+
let g = !1;
|
|
54
|
+
const B = (u) => {
|
|
55
|
+
if (!g) {
|
|
56
|
+
const m = Z(u);
|
|
57
|
+
p(m), _(m);
|
|
38
58
|
}
|
|
39
|
-
}), () => {
|
|
40
|
-
v = !0;
|
|
41
59
|
};
|
|
42
|
-
|
|
43
|
-
|
|
60
|
+
if (l && Q(s)) {
|
|
61
|
+
const u = J(s);
|
|
62
|
+
return M(u, n, o).then(([m, j]) => {
|
|
63
|
+
g || (p(m), _(j));
|
|
64
|
+
}).catch((m) => {
|
|
65
|
+
console.error("Failed to highlight code:", m), B(u);
|
|
66
|
+
}), () => {
|
|
67
|
+
g = !0;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return !l && Y(s, y) ? (queueMicrotask(() => {
|
|
71
|
+
B(s);
|
|
72
|
+
}), () => {
|
|
73
|
+
g = !0;
|
|
74
|
+
}) : (M(s, n, o).then(([u, m]) => {
|
|
75
|
+
g || (p(u), _(m));
|
|
76
|
+
}).catch((u) => {
|
|
77
|
+
console.error("Failed to highlight code:", u), B(s);
|
|
78
|
+
}), () => {
|
|
79
|
+
g = !0;
|
|
80
|
+
});
|
|
81
|
+
}, [s, n, o, l, y]);
|
|
82
|
+
const z = D(
|
|
44
83
|
() => ({
|
|
45
84
|
code: e,
|
|
46
|
-
copyText:
|
|
47
|
-
isCollapsed:
|
|
48
|
-
setIsCollapsed:
|
|
49
|
-
lineCount:
|
|
85
|
+
copyText: A,
|
|
86
|
+
isCollapsed: l,
|
|
87
|
+
setIsCollapsed: R,
|
|
88
|
+
lineCount: y
|
|
50
89
|
}),
|
|
51
|
-
[e,
|
|
52
|
-
)
|
|
53
|
-
|
|
90
|
+
[e, A, l, y]
|
|
91
|
+
), U = /* @__PURE__ */ L("div", { className: "relative", children: [
|
|
92
|
+
/* @__PURE__ */ r(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: f(
|
|
96
|
+
oe,
|
|
97
|
+
l && "max-h-26 overflow-y-hidden"
|
|
98
|
+
),
|
|
99
|
+
dangerouslySetInnerHTML: {
|
|
100
|
+
__html: v ? T : d
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ r(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
className: f(
|
|
108
|
+
te,
|
|
109
|
+
l && "max-h-26 overflow-y-hidden"
|
|
110
|
+
),
|
|
111
|
+
dangerouslySetInnerHTML: {
|
|
112
|
+
__html: v ? T : c
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
l && /* @__PURE__ */ r("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 h-3/4 bg-linear-to-b from-transparent via-card-background/70 to-card-background" })
|
|
117
|
+
] }), X = i != null ? /* @__PURE__ */ r(
|
|
54
118
|
"div",
|
|
55
119
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
120
|
+
"data-slot": "code-block-actions",
|
|
121
|
+
className: f(
|
|
122
|
+
/* Sibling of scroll inner: pinned while code scrolls; even inset from top/right (scrollbar gutter on inner) */
|
|
123
|
+
"pointer-events-none absolute top-5 right-5 z-20 flex items-center gap-1 bg-transparent p-0 shadow-none ring-0 outline-none",
|
|
124
|
+
"opacity-0 transition-opacity",
|
|
125
|
+
"group-hover/code-block:pointer-events-auto group-hover/code-block:opacity-100",
|
|
126
|
+
"group-focus-within/code-block:pointer-events-auto group-focus-within/code-block:opacity-100",
|
|
127
|
+
v && "pointer-events-auto opacity-100"
|
|
61
128
|
),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
129
|
+
children: i
|
|
130
|
+
}
|
|
131
|
+
) : null;
|
|
132
|
+
return /* @__PURE__ */ r(I.Provider, { value: z, children: /* @__PURE__ */ L(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
ref: b,
|
|
136
|
+
"data-slot": "code-block",
|
|
137
|
+
className: f(
|
|
138
|
+
"group/code-block relative w-full rounded-xl bg-background text-foreground",
|
|
139
|
+
l ? "overflow-hidden" : (
|
|
140
|
+
/* Expanded: flex + clip so actions overlay without a reserved top row */
|
|
141
|
+
"flex min-h-0 max-h-[min(60vh,_32rem)] flex-col overflow-hidden"
|
|
75
142
|
),
|
|
76
|
-
|
|
143
|
+
h
|
|
144
|
+
),
|
|
145
|
+
style: {
|
|
146
|
+
...l ? {} : {
|
|
147
|
+
maxHeight: ee,
|
|
148
|
+
minHeight: 0
|
|
149
|
+
},
|
|
150
|
+
...C
|
|
151
|
+
},
|
|
152
|
+
...k,
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ r(
|
|
77
155
|
"div",
|
|
78
156
|
{
|
|
79
|
-
className:
|
|
80
|
-
|
|
81
|
-
|
|
157
|
+
className: f(
|
|
158
|
+
/* Match <pre> card tone so transparent actions are not over root bg-background */
|
|
159
|
+
"relative min-h-0 bg-card-background",
|
|
160
|
+
!l && "min-h-0 flex-1 overflow-x-auto overflow-y-auto [scrollbar-gutter:stable]"
|
|
82
161
|
),
|
|
83
|
-
|
|
84
|
-
__html: f ? I : b
|
|
85
|
-
}
|
|
162
|
+
children: U
|
|
86
163
|
}
|
|
87
164
|
),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
] })
|
|
165
|
+
X
|
|
166
|
+
]
|
|
91
167
|
}
|
|
92
168
|
) });
|
|
93
169
|
}
|
|
94
170
|
);
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
const [
|
|
171
|
+
ne.displayName = "CodeBlock";
|
|
172
|
+
const re = w(({ onCopy: e, onError: t, timeout: n = 2e3, children: o, className: a, ...h }, i) => {
|
|
173
|
+
const [C, k] = x(!1), { copyText: b } = H(I), d = async () => {
|
|
98
174
|
if (typeof window > "u" || !navigator?.clipboard?.writeText) {
|
|
99
175
|
t?.(new Error("Clipboard API not available"));
|
|
100
176
|
return;
|
|
101
177
|
}
|
|
102
178
|
try {
|
|
103
|
-
await navigator.clipboard.writeText(
|
|
104
|
-
} catch (
|
|
105
|
-
console.warn("Clipboard write failed:",
|
|
106
|
-
|
|
179
|
+
await navigator.clipboard.writeText(b), k(!0), e?.(), setTimeout(() => k(!1), n);
|
|
180
|
+
} catch (c) {
|
|
181
|
+
console.warn("Clipboard write failed:", c), t?.(
|
|
182
|
+
c instanceof Error ? c : new Error("Clipboard write failed")
|
|
107
183
|
);
|
|
108
184
|
}
|
|
109
|
-
},
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
-
|
|
185
|
+
}, p = C ? K : V;
|
|
186
|
+
return /* @__PURE__ */ r(
|
|
187
|
+
S,
|
|
112
188
|
{
|
|
113
|
-
ref:
|
|
189
|
+
ref: i,
|
|
114
190
|
"data-slot": "code-block-copy-button",
|
|
115
|
-
className:
|
|
116
|
-
onClick:
|
|
117
|
-
size: "icon",
|
|
191
|
+
className: f("shrink-0", a),
|
|
192
|
+
onClick: d,
|
|
193
|
+
size: "icon-sm",
|
|
118
194
|
variant: "secondary",
|
|
119
|
-
...
|
|
120
|
-
children:
|
|
195
|
+
...h,
|
|
196
|
+
children: o ?? /* @__PURE__ */ r(p, { size: 14 })
|
|
121
197
|
}
|
|
122
198
|
);
|
|
123
199
|
});
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
const { isCollapsed:
|
|
127
|
-
return
|
|
128
|
-
|
|
200
|
+
re.displayName = "CodeBlockCopyButton";
|
|
201
|
+
const le = w(({ children: e, className: t, ...n }, o) => {
|
|
202
|
+
const { isCollapsed: a, setIsCollapsed: h, lineCount: i } = H(I);
|
|
203
|
+
return i <= 1 ? null : /* @__PURE__ */ r(
|
|
204
|
+
S,
|
|
129
205
|
{
|
|
130
|
-
ref:
|
|
206
|
+
ref: o,
|
|
131
207
|
"data-slot": "code-block-collapse-button",
|
|
132
|
-
className:
|
|
133
|
-
onClick: () =>
|
|
134
|
-
size: "icon",
|
|
208
|
+
className: f("shrink-0", t),
|
|
209
|
+
onClick: () => h(!a),
|
|
210
|
+
size: "icon-sm",
|
|
135
211
|
variant: "secondary",
|
|
136
|
-
...
|
|
137
|
-
children: e ?? /* @__PURE__ */
|
|
212
|
+
...n,
|
|
213
|
+
children: e ?? /* @__PURE__ */ r($, { size: 14 })
|
|
138
214
|
}
|
|
139
215
|
);
|
|
140
216
|
});
|
|
141
|
-
|
|
217
|
+
le.displayName = "CodeBlockCollapseButton";
|
|
218
|
+
const ae = w(
|
|
219
|
+
({
|
|
220
|
+
fileName: e = "code.txt",
|
|
221
|
+
mimeType: t = "text/plain;charset=utf-8",
|
|
222
|
+
onDownload: n,
|
|
223
|
+
onError: o,
|
|
224
|
+
children: a,
|
|
225
|
+
className: h,
|
|
226
|
+
...i
|
|
227
|
+
}, C) => {
|
|
228
|
+
const { code: k } = H(I), b = () => {
|
|
229
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
230
|
+
o?.(new Error("Download not available"));
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
const d = new Blob([k], { type: t }), p = URL.createObjectURL(d), c = document.createElement("a");
|
|
235
|
+
c.href = p, c.download = e, c.rel = "noopener", c.click(), URL.revokeObjectURL(p), n?.();
|
|
236
|
+
} catch (d) {
|
|
237
|
+
o?.(
|
|
238
|
+
d instanceof Error ? d : new Error("Download failed")
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
return /* @__PURE__ */ r(
|
|
243
|
+
S,
|
|
244
|
+
{
|
|
245
|
+
ref: C,
|
|
246
|
+
"data-slot": "code-block-download-button",
|
|
247
|
+
className: f("shrink-0", h),
|
|
248
|
+
onClick: b,
|
|
249
|
+
size: "icon-sm",
|
|
250
|
+
variant: "secondary",
|
|
251
|
+
...i,
|
|
252
|
+
children: a ?? /* @__PURE__ */ r(q, { size: 14 })
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
ae.displayName = "CodeBlockDownloadButton";
|
|
142
258
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
259
|
+
ne as CodeBlock,
|
|
260
|
+
le as CodeBlockCollapseButton,
|
|
261
|
+
re as CodeBlockCopyButton,
|
|
262
|
+
ae as CodeBlockDownloadButton,
|
|
263
|
+
J as getCollapsedPreviewDisplay,
|
|
264
|
+
Q as isContentLargerThanPreview,
|
|
265
|
+
Z as plainPreMarkup,
|
|
266
|
+
Y as shouldUsePlainTextInsteadOfShiki
|
|
146
267
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const o = {
|
|
2
2
|
name: "CodeBlock",
|
|
3
3
|
status: "in-progress-code-review",
|
|
4
|
-
description: "A syntax-highlighted code block with copy and collapse functionality."
|
|
4
|
+
description: "A syntax-highlighted code block with copy, download and collapse functionality."
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
7
|
o as CodeBlockMetadata
|
|
@@ -1,44 +1,50 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as t } from "react";
|
|
3
|
-
import { Collapsible as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
|
|
3
|
+
import { Collapsible as n } from "@base-ui/react/collapsible";
|
|
4
|
+
import { cn as i } from "../../../../lib/utils.js";
|
|
5
|
+
const s = t(({ className: l, ...o }, e) => /* @__PURE__ */ a(
|
|
6
|
+
n.Root,
|
|
7
7
|
{
|
|
8
|
-
ref:
|
|
8
|
+
ref: e,
|
|
9
9
|
"data-slot": "collapsible",
|
|
10
|
-
className:
|
|
11
|
-
|
|
10
|
+
className: i(
|
|
11
|
+
"w-full min-w-0 rounded-md box-border *:max-w-full",
|
|
12
|
+
l
|
|
13
|
+
),
|
|
14
|
+
...o
|
|
12
15
|
}
|
|
13
16
|
));
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
+
s.displayName = "Collapsible";
|
|
18
|
+
const d = t(({ className: l, children: o, ...e }, r) => /* @__PURE__ */ a(
|
|
19
|
+
n.Trigger,
|
|
17
20
|
{
|
|
18
21
|
ref: r,
|
|
19
22
|
"data-slot": "collapsible-trigger",
|
|
20
|
-
className:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
className: i(
|
|
24
|
+
"group/collapsible-trigger rounded-lg text-sm font-medium leading-5 text-foreground overflow-hidden",
|
|
25
|
+
l
|
|
26
|
+
),
|
|
27
|
+
...e,
|
|
28
|
+
children: o
|
|
23
29
|
}
|
|
24
30
|
));
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
31
|
+
d.displayName = "CollapsibleTrigger";
|
|
32
|
+
const m = t(({ className: l, keepMounted: o = !0, ...e }, r) => /* @__PURE__ */ a(
|
|
33
|
+
n.Panel,
|
|
28
34
|
{
|
|
29
35
|
ref: r,
|
|
30
36
|
"data-slot": "collapsible-content",
|
|
31
|
-
className:
|
|
32
|
-
"hidden data-open:block border-none outline-none text-
|
|
37
|
+
className: i(
|
|
38
|
+
"hidden data-open:block border-none outline-none text-secondary-foreground text-sm font-normal leading-5 tracking-tight w-full min-w-0 overflow-x-hidden box-border *:max-w-full *:box-border",
|
|
33
39
|
l
|
|
34
40
|
),
|
|
35
|
-
keepMounted:
|
|
36
|
-
...
|
|
41
|
+
keepMounted: o,
|
|
42
|
+
...e
|
|
37
43
|
}
|
|
38
44
|
));
|
|
39
|
-
|
|
45
|
+
m.displayName = "CollapsibleContent";
|
|
40
46
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
s as Collapsible,
|
|
48
|
+
m as CollapsibleContent,
|
|
49
|
+
d as CollapsibleTrigger
|
|
44
50
|
};
|
|
@@ -31,7 +31,7 @@ declare const CommandInput: import('react').ForwardRefExoticComponent<Omit<Omit<
|
|
|
31
31
|
ref?: React.Ref<HTMLInputElement>;
|
|
32
32
|
} & {
|
|
33
33
|
asChild?: boolean;
|
|
34
|
-
}, "key" | keyof import('react').InputHTMLAttributes<HTMLInputElement> | "asChild">, "onChange" | "
|
|
34
|
+
}, "key" | keyof import('react').InputHTMLAttributes<HTMLInputElement> | "asChild">, "onChange" | "value" | "type"> & {
|
|
35
35
|
value?: string;
|
|
36
36
|
onValueChange?: (search: string) => void;
|
|
37
37
|
} & import('react').RefAttributes<HTMLInputElement>, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -75,7 +75,7 @@ declare const CommandItem: import('react').ForwardRefExoticComponent<Omit<{
|
|
|
75
75
|
ref?: React.Ref<HTMLDivElement>;
|
|
76
76
|
} & {
|
|
77
77
|
asChild?: boolean;
|
|
78
|
-
}, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "
|
|
78
|
+
}, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "value" | "disabled"> & {
|
|
79
79
|
disabled?: boolean;
|
|
80
80
|
onSelect?: (value: string) => void;
|
|
81
81
|
value?: string;
|
|
@@ -4,23 +4,23 @@ import { IconSearch as p } from "@tabler/icons-react";
|
|
|
4
4
|
import { Command as r } from "cmdk";
|
|
5
5
|
import { cn as m } from "../../../../lib/utils.js";
|
|
6
6
|
import { Dialog as u, DialogHeader as g, DialogTitle as h, DialogDescription as f, DialogContent as x } from "../dialog/dialog.js";
|
|
7
|
-
const s = d(({ className: e, ...
|
|
7
|
+
const s = d(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
8
8
|
r,
|
|
9
9
|
{
|
|
10
|
-
ref:
|
|
10
|
+
ref: t,
|
|
11
11
|
"data-slot": "command",
|
|
12
12
|
className: m(
|
|
13
13
|
"rounded-lg bg-background text-muted-foreground flex h-full w-full flex-col overflow-hidden",
|
|
14
14
|
e
|
|
15
15
|
),
|
|
16
|
-
...
|
|
16
|
+
...a
|
|
17
17
|
}
|
|
18
18
|
));
|
|
19
19
|
s.displayName = "Command";
|
|
20
20
|
function y({
|
|
21
21
|
title: e = "Command Palette",
|
|
22
|
-
description:
|
|
23
|
-
children:
|
|
22
|
+
description: a = "Search for a command to run...",
|
|
23
|
+
children: t,
|
|
24
24
|
className: l,
|
|
25
25
|
showCloseButton: c = !0,
|
|
26
26
|
...i
|
|
@@ -28,7 +28,7 @@ function y({
|
|
|
28
28
|
return /* @__PURE__ */ n(u, { ...i, children: [
|
|
29
29
|
/* @__PURE__ */ n(g, { className: "sr-only rounded-lg", children: [
|
|
30
30
|
/* @__PURE__ */ o(h, { children: e }),
|
|
31
|
-
/* @__PURE__ */ o(f, { children:
|
|
31
|
+
/* @__PURE__ */ o(f, { children: a })
|
|
32
32
|
] }),
|
|
33
33
|
/* @__PURE__ */ o(
|
|
34
34
|
x,
|
|
@@ -36,13 +36,13 @@ function y({
|
|
|
36
36
|
"data-slot": "command-dialog",
|
|
37
37
|
className: m("overflow-hidden p-0", l),
|
|
38
38
|
showCloseButton: c,
|
|
39
|
-
children: /* @__PURE__ */ o(s, { className: "**:[[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children:
|
|
39
|
+
children: /* @__PURE__ */ o(s, { className: "**:[[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: t })
|
|
40
40
|
}
|
|
41
41
|
)
|
|
42
42
|
] });
|
|
43
43
|
}
|
|
44
44
|
y.displayName = "CommandDialog";
|
|
45
|
-
const k = d(({ className: e, ...
|
|
45
|
+
const k = d(({ className: e, ...a }, t) => /* @__PURE__ */ n(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
"data-slot": "command-input-wrapper",
|
|
@@ -52,88 +52,88 @@ const k = d(({ className: e, ...t }, a) => /* @__PURE__ */ n(
|
|
|
52
52
|
/* @__PURE__ */ o(
|
|
53
53
|
r.Input,
|
|
54
54
|
{
|
|
55
|
-
ref:
|
|
55
|
+
ref: t,
|
|
56
56
|
"data-slot": "command-input",
|
|
57
57
|
className: m(
|
|
58
58
|
"placeholder:text-muted-foreground flex h-10 w-full rounded-lg bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
59
59
|
e
|
|
60
60
|
),
|
|
61
|
-
...
|
|
61
|
+
...a
|
|
62
62
|
}
|
|
63
63
|
)
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
66
|
));
|
|
67
67
|
k.displayName = "CommandInput";
|
|
68
|
-
const C = d(({ className: e, ...
|
|
68
|
+
const C = d(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
69
69
|
r.List,
|
|
70
70
|
{
|
|
71
|
-
ref:
|
|
71
|
+
ref: t,
|
|
72
72
|
"data-slot": "command-list",
|
|
73
73
|
className: m(
|
|
74
74
|
"max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
75
75
|
e
|
|
76
76
|
),
|
|
77
|
-
...
|
|
77
|
+
...a
|
|
78
78
|
}
|
|
79
79
|
));
|
|
80
80
|
C.displayName = "CommandList";
|
|
81
|
-
const N = d(({ className: e, ...
|
|
81
|
+
const N = d(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
82
82
|
r.Empty,
|
|
83
83
|
{
|
|
84
|
-
ref:
|
|
84
|
+
ref: t,
|
|
85
85
|
"data-slot": "command-empty",
|
|
86
86
|
className: m("py-6 text-center text-sm", e),
|
|
87
|
-
...
|
|
87
|
+
...a
|
|
88
88
|
}
|
|
89
89
|
));
|
|
90
90
|
N.displayName = "CommandEmpty";
|
|
91
|
-
const v = d(({ className: e, ...
|
|
91
|
+
const v = d(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
92
92
|
r.Group,
|
|
93
93
|
{
|
|
94
|
-
ref:
|
|
94
|
+
ref: t,
|
|
95
95
|
"data-slot": "command-group",
|
|
96
96
|
className: m(
|
|
97
|
-
"text-
|
|
97
|
+
"text-foreground font-normal **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-sm **:[[cmdk-group-heading]]:font-medium",
|
|
98
98
|
e
|
|
99
99
|
),
|
|
100
|
-
...
|
|
100
|
+
...a
|
|
101
101
|
}
|
|
102
102
|
));
|
|
103
103
|
v.displayName = "CommandGroup";
|
|
104
|
-
const w = d(({ className: e, ...
|
|
104
|
+
const w = d(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
105
105
|
r.Separator,
|
|
106
106
|
{
|
|
107
|
-
ref:
|
|
107
|
+
ref: t,
|
|
108
108
|
"data-slot": "command-separator",
|
|
109
109
|
className: m("bg-border -mx-1 h-px", e),
|
|
110
|
-
...
|
|
110
|
+
...a
|
|
111
111
|
}
|
|
112
112
|
));
|
|
113
113
|
w.displayName = "CommandSeparator";
|
|
114
|
-
const _ = d(({ className: e, ...
|
|
114
|
+
const _ = d(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
115
115
|
r.Item,
|
|
116
116
|
{
|
|
117
|
-
ref:
|
|
117
|
+
ref: t,
|
|
118
118
|
"data-slot": "command-item",
|
|
119
119
|
className: m(
|
|
120
|
-
"data-[selected=true]:bg-accent data-[selected=true]:text-
|
|
120
|
+
"data-[selected=true]:bg-accent-background data-[selected=true]:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
121
121
|
e
|
|
122
122
|
),
|
|
123
|
-
...
|
|
123
|
+
...a
|
|
124
124
|
}
|
|
125
125
|
));
|
|
126
126
|
_.displayName = "CommandItem";
|
|
127
|
-
const b = d(({ className: e, ...
|
|
127
|
+
const b = d(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
128
128
|
"span",
|
|
129
129
|
{
|
|
130
|
-
ref:
|
|
130
|
+
ref: t,
|
|
131
131
|
"data-slot": "command-shortcut",
|
|
132
132
|
className: m(
|
|
133
133
|
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
134
134
|
e
|
|
135
135
|
),
|
|
136
|
-
...
|
|
136
|
+
...a
|
|
137
137
|
}
|
|
138
138
|
));
|
|
139
139
|
b.displayName = "CommandShortcut";
|