@cognite/aura 0.1.6 → 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/components/index.d.ts +2 -0
- package/dist/components/index.js +49 -44
- package/dist/components/ui/core/alert/alert.d.ts +2 -1
- package/dist/components/ui/core/alert/alert.js +111 -87
- package/dist/components/ui/core/alert/alert.metadata.js +1 -1
- package/dist/components/ui/core/code-block/code-block.d.ts +4 -0
- package/dist/components/ui/core/code-block/code-block.js +200 -132
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +43 -40
- 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/tool/tool.js +31 -27
- package/dist/index.d.ts +1 -1
- package/dist/index.js +46 -41
- package/dist/styles.css +1 -1
- package/package.json +8 -3
|
@@ -1,199 +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
|
-
copyText:
|
|
17
|
-
language:
|
|
18
|
-
showLineNumbers:
|
|
19
|
-
collapsed:
|
|
20
|
-
className:
|
|
21
|
-
children:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
37
|
+
copyText: t,
|
|
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 C = `<pre><code>${A(b)}</code></pre>`;
|
|
37
|
-
n(C), o(C);
|
|
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
|
-
w = !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(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
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"
|
|
128
|
+
),
|
|
129
|
+
children: i
|
|
130
|
+
}
|
|
131
|
+
) : null;
|
|
132
|
+
return /* @__PURE__ */ r(I.Provider, { value: z, children: /* @__PURE__ */ L(
|
|
54
133
|
"div",
|
|
55
134
|
{
|
|
56
|
-
ref:
|
|
135
|
+
ref: b,
|
|
57
136
|
"data-slot": "code-block",
|
|
58
|
-
className:
|
|
59
|
-
"group/code-block relative w-full
|
|
60
|
-
|
|
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"
|
|
142
|
+
),
|
|
143
|
+
h
|
|
61
144
|
),
|
|
62
|
-
|
|
145
|
+
style: {
|
|
146
|
+
...l ? {} : {
|
|
147
|
+
maxHeight: ee,
|
|
148
|
+
minHeight: 0
|
|
149
|
+
},
|
|
150
|
+
...C
|
|
151
|
+
},
|
|
152
|
+
...k,
|
|
63
153
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */ t(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
className: i(
|
|
69
|
-
"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",
|
|
70
|
-
k && "max-h-26 overflow-y-hidden"
|
|
71
|
-
),
|
|
72
|
-
dangerouslySetInnerHTML: {
|
|
73
|
-
__html: h ? _ : f
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ t(
|
|
78
|
-
"div",
|
|
79
|
-
{
|
|
80
|
-
className: i(
|
|
81
|
-
"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",
|
|
82
|
-
k && "max-h-26 overflow-y-hidden"
|
|
83
|
-
),
|
|
84
|
-
dangerouslySetInnerHTML: {
|
|
85
|
-
__html: h ? _ : u
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
k && /* @__PURE__ */ t("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" })
|
|
90
|
-
] }),
|
|
91
|
-
c ? /* @__PURE__ */ t(
|
|
154
|
+
/* @__PURE__ */ r(
|
|
92
155
|
"div",
|
|
93
156
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
|
|
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]"
|
|
98
161
|
),
|
|
99
|
-
children:
|
|
162
|
+
children: U
|
|
100
163
|
}
|
|
101
|
-
)
|
|
164
|
+
),
|
|
165
|
+
X
|
|
102
166
|
]
|
|
103
167
|
}
|
|
104
168
|
) });
|
|
105
169
|
}
|
|
106
170
|
);
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
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 () => {
|
|
110
174
|
if (typeof window > "u" || !navigator?.clipboard?.writeText) {
|
|
111
|
-
|
|
175
|
+
t?.(new Error("Clipboard API not available"));
|
|
112
176
|
return;
|
|
113
177
|
}
|
|
114
178
|
try {
|
|
115
|
-
await navigator.clipboard.writeText(
|
|
116
|
-
} catch (
|
|
117
|
-
console.warn("Clipboard write failed:",
|
|
118
|
-
|
|
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")
|
|
119
183
|
);
|
|
120
184
|
}
|
|
121
|
-
},
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
|
|
185
|
+
}, p = C ? K : V;
|
|
186
|
+
return /* @__PURE__ */ r(
|
|
187
|
+
S,
|
|
124
188
|
{
|
|
125
|
-
ref:
|
|
189
|
+
ref: i,
|
|
126
190
|
"data-slot": "code-block-copy-button",
|
|
127
|
-
className:
|
|
128
|
-
onClick:
|
|
191
|
+
className: f("shrink-0", a),
|
|
192
|
+
onClick: d,
|
|
129
193
|
size: "icon-sm",
|
|
130
194
|
variant: "secondary",
|
|
131
|
-
...
|
|
132
|
-
children:
|
|
195
|
+
...h,
|
|
196
|
+
children: o ?? /* @__PURE__ */ r(p, { size: 14 })
|
|
133
197
|
}
|
|
134
198
|
);
|
|
135
199
|
});
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
const { isCollapsed:
|
|
139
|
-
return
|
|
140
|
-
|
|
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,
|
|
141
205
|
{
|
|
142
|
-
ref:
|
|
206
|
+
ref: o,
|
|
143
207
|
"data-slot": "code-block-collapse-button",
|
|
144
|
-
className:
|
|
145
|
-
onClick: () =>
|
|
208
|
+
className: f("shrink-0", t),
|
|
209
|
+
onClick: () => h(!a),
|
|
146
210
|
size: "icon-sm",
|
|
147
211
|
variant: "secondary",
|
|
148
|
-
...
|
|
149
|
-
children: e ?? /* @__PURE__ */
|
|
212
|
+
...n,
|
|
213
|
+
children: e ?? /* @__PURE__ */ r($, { size: 14 })
|
|
150
214
|
}
|
|
151
215
|
);
|
|
152
216
|
});
|
|
153
|
-
|
|
154
|
-
const
|
|
217
|
+
le.displayName = "CodeBlockCollapseButton";
|
|
218
|
+
const ae = w(
|
|
155
219
|
({
|
|
156
220
|
fileName: e = "code.txt",
|
|
157
|
-
mimeType:
|
|
158
|
-
onDownload:
|
|
159
|
-
onError:
|
|
160
|
-
children:
|
|
161
|
-
className:
|
|
162
|
-
...
|
|
163
|
-
},
|
|
164
|
-
const { code:
|
|
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 = () => {
|
|
165
229
|
if (typeof window > "u" || typeof document > "u") {
|
|
166
|
-
|
|
230
|
+
o?.(new Error("Download not available"));
|
|
167
231
|
return;
|
|
168
232
|
}
|
|
169
233
|
try {
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
} catch (
|
|
173
|
-
|
|
174
|
-
|
|
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")
|
|
175
239
|
);
|
|
176
240
|
}
|
|
177
241
|
};
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
-
|
|
242
|
+
return /* @__PURE__ */ r(
|
|
243
|
+
S,
|
|
180
244
|
{
|
|
181
|
-
ref:
|
|
245
|
+
ref: C,
|
|
182
246
|
"data-slot": "code-block-download-button",
|
|
183
|
-
className:
|
|
184
|
-
onClick:
|
|
247
|
+
className: f("shrink-0", h),
|
|
248
|
+
onClick: b,
|
|
185
249
|
size: "icon-sm",
|
|
186
250
|
variant: "secondary",
|
|
187
|
-
...
|
|
188
|
-
children:
|
|
251
|
+
...i,
|
|
252
|
+
children: a ?? /* @__PURE__ */ r(q, { size: 14 })
|
|
189
253
|
}
|
|
190
254
|
);
|
|
191
255
|
}
|
|
192
256
|
);
|
|
193
|
-
|
|
257
|
+
ae.displayName = "CodeBlockDownloadButton";
|
|
194
258
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
|
199
267
|
};
|
|
@@ -4,7 +4,7 @@ declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): import("r
|
|
|
4
4
|
declare namespace DropdownMenu {
|
|
5
5
|
var displayName: string;
|
|
6
6
|
}
|
|
7
|
-
declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuPortal({ container, ...props }: MenuPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare namespace DropdownMenuPortal {
|
|
9
9
|
var displayName: string;
|
|
10
10
|
}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as u } from "react";
|
|
3
3
|
import { Menu as r } from "@base-ui/react/menu";
|
|
4
|
-
import { IconCheck as
|
|
4
|
+
import { IconCheck as p, IconChevronRight as f } from "@tabler/icons-react";
|
|
5
5
|
import { usePortalContainer as b } from "../../../../lib/portal-container-context.js";
|
|
6
6
|
import { cn as d } from "../../../../lib/utils.js";
|
|
7
7
|
function v({ ...e }) {
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ n(r.Root, { "data-slot": "dropdown-menu", ...e });
|
|
9
9
|
}
|
|
10
10
|
v.displayName = "DropdownMenu";
|
|
11
|
-
function l({
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
function l({
|
|
12
|
+
container: e,
|
|
13
|
+
...o
|
|
14
|
+
}) {
|
|
15
|
+
const t = b();
|
|
16
|
+
return /* @__PURE__ */ n(
|
|
14
17
|
r.Portal,
|
|
15
18
|
{
|
|
16
19
|
"data-slot": "dropdown-menu-portal",
|
|
17
|
-
container:
|
|
18
|
-
...
|
|
20
|
+
container: e ?? t,
|
|
21
|
+
...o
|
|
19
22
|
}
|
|
20
23
|
);
|
|
21
24
|
}
|
|
@@ -24,27 +27,27 @@ function w({
|
|
|
24
27
|
children: e,
|
|
25
28
|
...o
|
|
26
29
|
}) {
|
|
27
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ n(r.Trigger, { "data-slot": "dropdown-menu-trigger", ...o, children: e });
|
|
28
31
|
}
|
|
29
32
|
w.displayName = "DropdownMenuTrigger";
|
|
30
33
|
function m({
|
|
31
34
|
align: e = "start",
|
|
32
35
|
alignOffset: o = 0,
|
|
33
|
-
side:
|
|
36
|
+
side: t = "bottom",
|
|
34
37
|
sideOffset: a = 4,
|
|
35
38
|
className: s,
|
|
36
39
|
container: i,
|
|
37
40
|
...g
|
|
38
41
|
}) {
|
|
39
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ n(l, { container: i, children: /* @__PURE__ */ n(
|
|
40
43
|
r.Positioner,
|
|
41
44
|
{
|
|
42
45
|
className: "isolate z-50 outline-none",
|
|
43
46
|
align: e,
|
|
44
47
|
alignOffset: o,
|
|
45
|
-
side:
|
|
48
|
+
side: t,
|
|
46
49
|
sideOffset: a,
|
|
47
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ n(
|
|
48
51
|
r.Popup,
|
|
49
52
|
{
|
|
50
53
|
"data-slot": "dropdown-menu-content",
|
|
@@ -60,16 +63,16 @@ function m({
|
|
|
60
63
|
}
|
|
61
64
|
m.displayName = "DropdownMenuContent";
|
|
62
65
|
function x({ ...e }) {
|
|
63
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ n(r.Group, { "data-slot": "dropdown-menu-group", ...e });
|
|
64
67
|
}
|
|
65
68
|
x.displayName = "DropdownMenuGroup";
|
|
66
|
-
const h = u(({ className: e, inset: o, variant:
|
|
69
|
+
const h = u(({ className: e, inset: o, variant: t = "default", children: a, ...s }, i) => /* @__PURE__ */ n(
|
|
67
70
|
r.Item,
|
|
68
71
|
{
|
|
69
72
|
ref: i,
|
|
70
73
|
"data-slot": "dropdown-menu-item",
|
|
71
74
|
"data-inset": o,
|
|
72
|
-
"data-variant":
|
|
75
|
+
"data-variant": t,
|
|
73
76
|
className: d(
|
|
74
77
|
"focus:bg-accent-background focus:text-foreground data-[variant=destructive]:text-destructive-foreground data-[variant=destructive]:focus:bg-destructive-background-hover dark:data-[variant=destructive]:focus:bg-destructive-background-hover data-[variant=destructive]:focus:text-destructive-foreground data-[variant=destructive]:*:[svg]:text-destructive-foreground data-[variant=destructive]:hover:bg-destructive-background-hover dark:data-[variant=destructive]:hover:bg-destructive-background-hover [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm p-2 text-base outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
75
78
|
e
|
|
@@ -79,7 +82,7 @@ const h = u(({ className: e, inset: o, variant: n = "default", children: a, ...s
|
|
|
79
82
|
}
|
|
80
83
|
));
|
|
81
84
|
h.displayName = "DropdownMenuItem";
|
|
82
|
-
const M = u(({ className: e, children: o, checked:
|
|
85
|
+
const M = u(({ className: e, children: o, checked: t, ...a }, s) => /* @__PURE__ */ c(
|
|
83
86
|
r.CheckboxItem,
|
|
84
87
|
{
|
|
85
88
|
ref: s,
|
|
@@ -88,17 +91,17 @@ const M = u(({ className: e, children: o, checked: n, ...a }, s) => /* @__PURE__
|
|
|
88
91
|
"focus:bg-accent-background focus:text-foreground h-9 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
89
92
|
e
|
|
90
93
|
),
|
|
91
|
-
checked:
|
|
94
|
+
checked: t,
|
|
92
95
|
...a,
|
|
93
96
|
children: [
|
|
94
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ n("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ n(r.CheckboxItemIndicator, { children: /* @__PURE__ */ n(p, { className: "size-4 text-foreground" }) }) }),
|
|
95
98
|
o
|
|
96
99
|
]
|
|
97
100
|
}
|
|
98
101
|
));
|
|
99
102
|
M.displayName = "DropdownMenuCheckboxItem";
|
|
100
103
|
function D({ ...e }) {
|
|
101
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ n(
|
|
102
105
|
r.RadioGroup,
|
|
103
106
|
{
|
|
104
107
|
"data-slot": "dropdown-menu-radio-group",
|
|
@@ -107,7 +110,7 @@ function D({ ...e }) {
|
|
|
107
110
|
);
|
|
108
111
|
}
|
|
109
112
|
D.displayName = "DropdownMenuRadioGroup";
|
|
110
|
-
const N = u(({ className: e, children: o, ...
|
|
113
|
+
const N = u(({ className: e, children: o, ...t }, a) => /* @__PURE__ */ c(
|
|
111
114
|
r.RadioItem,
|
|
112
115
|
{
|
|
113
116
|
ref: a,
|
|
@@ -116,15 +119,15 @@ const N = u(({ className: e, children: o, ...n }, a) => /* @__PURE__ */ p(
|
|
|
116
119
|
"focus:bg-accent-background focus:text-foreground h-9 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
117
120
|
e
|
|
118
121
|
),
|
|
119
|
-
...
|
|
122
|
+
...t,
|
|
120
123
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ n("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ n(r.RadioItemIndicator, { children: /* @__PURE__ */ n(p, { className: "size-4 text-foreground" }) }) }),
|
|
122
125
|
o
|
|
123
126
|
]
|
|
124
127
|
}
|
|
125
128
|
));
|
|
126
129
|
N.displayName = "DropdownMenuRadioItem";
|
|
127
|
-
const y = u(({ className: e, inset: o, ...
|
|
130
|
+
const y = u(({ className: e, inset: o, ...t }, a) => /* @__PURE__ */ n(
|
|
128
131
|
r.GroupLabel,
|
|
129
132
|
{
|
|
130
133
|
ref: a,
|
|
@@ -134,14 +137,14 @@ const y = u(({ className: e, inset: o, ...n }, a) => /* @__PURE__ */ t(
|
|
|
134
137
|
"-mx-1 -mt-1 mb-1 px-2 py-1.5 text-sm border-b border-border font-medium data-inset:pl-8 text-foreground dark:text-foreground",
|
|
135
138
|
e
|
|
136
139
|
),
|
|
137
|
-
...
|
|
140
|
+
...t
|
|
138
141
|
}
|
|
139
142
|
));
|
|
140
143
|
y.displayName = "DropdownMenuLabel";
|
|
141
|
-
const k = u(({ className: e, ...o },
|
|
144
|
+
const k = u(({ className: e, ...o }, t) => /* @__PURE__ */ n(
|
|
142
145
|
"div",
|
|
143
146
|
{
|
|
144
|
-
ref:
|
|
147
|
+
ref: t,
|
|
145
148
|
"data-slot": "dropdown-menu-header",
|
|
146
149
|
className: d(
|
|
147
150
|
"-mx-1 -mt-1 mb-1 flex flex-row items-center gap-2 border-b border-border px-2 py-2 pointer-events-none",
|
|
@@ -151,20 +154,20 @@ const k = u(({ className: e, ...o }, n) => /* @__PURE__ */ t(
|
|
|
151
154
|
}
|
|
152
155
|
));
|
|
153
156
|
k.displayName = "DropdownMenuHeader";
|
|
154
|
-
const z = u(({ className: e, ...o },
|
|
157
|
+
const z = u(({ className: e, ...o }, t) => /* @__PURE__ */ n(
|
|
155
158
|
r.Separator,
|
|
156
159
|
{
|
|
157
|
-
ref:
|
|
160
|
+
ref: t,
|
|
158
161
|
"data-slot": "dropdown-menu-separator",
|
|
159
162
|
className: d("bg-border -mx-1 my-1 h-px", e),
|
|
160
163
|
...o
|
|
161
164
|
}
|
|
162
165
|
));
|
|
163
166
|
z.displayName = "DropdownMenuSeparator";
|
|
164
|
-
const I = u(({ className: e, ...o },
|
|
167
|
+
const I = u(({ className: e, ...o }, t) => /* @__PURE__ */ n(
|
|
165
168
|
"span",
|
|
166
169
|
{
|
|
167
|
-
ref:
|
|
170
|
+
ref: t,
|
|
168
171
|
"data-slot": "dropdown-menu-shortcut",
|
|
169
172
|
className: d(
|
|
170
173
|
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
@@ -175,10 +178,10 @@ const I = u(({ className: e, ...o }, n) => /* @__PURE__ */ t(
|
|
|
175
178
|
));
|
|
176
179
|
I.displayName = "DropdownMenuShortcut";
|
|
177
180
|
function S({ ...e }) {
|
|
178
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ n(r.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...e });
|
|
179
182
|
}
|
|
180
183
|
S.displayName = "DropdownMenuSub";
|
|
181
|
-
const _ = u(({ className: e, inset: o, children:
|
|
184
|
+
const _ = u(({ className: e, inset: o, children: t, ...a }, s) => /* @__PURE__ */ c(
|
|
182
185
|
r.SubmenuTrigger,
|
|
183
186
|
{
|
|
184
187
|
ref: s,
|
|
@@ -190,8 +193,8 @@ const _ = u(({ className: e, inset: o, children: n, ...a }, s) => /* @__PURE__ *
|
|
|
190
193
|
),
|
|
191
194
|
...a,
|
|
192
195
|
children: [
|
|
193
|
-
|
|
194
|
-
/* @__PURE__ */
|
|
196
|
+
t,
|
|
197
|
+
/* @__PURE__ */ n(f, { className: "ml-auto size-4" })
|
|
195
198
|
]
|
|
196
199
|
}
|
|
197
200
|
));
|
|
@@ -199,29 +202,29 @@ _.displayName = "DropdownMenuSubTrigger";
|
|
|
199
202
|
function C({
|
|
200
203
|
align: e = "start",
|
|
201
204
|
alignOffset: o = -3,
|
|
202
|
-
side:
|
|
205
|
+
side: t = "right",
|
|
203
206
|
sideOffset: a = 0,
|
|
204
207
|
className: s,
|
|
205
208
|
...i
|
|
206
209
|
}) {
|
|
207
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ n(
|
|
208
211
|
m,
|
|
209
212
|
{
|
|
210
213
|
"data-slot": "dropdown-menu-sub-content",
|
|
211
214
|
className: d("min-w-32 w-auto", s),
|
|
212
215
|
align: e,
|
|
213
216
|
alignOffset: o,
|
|
214
|
-
side:
|
|
217
|
+
side: t,
|
|
215
218
|
sideOffset: a,
|
|
216
219
|
...i
|
|
217
220
|
}
|
|
218
221
|
);
|
|
219
222
|
}
|
|
220
223
|
C.displayName = "DropdownMenuSubContent";
|
|
221
|
-
const R = u(({ className: e, ...o },
|
|
224
|
+
const R = u(({ className: e, ...o }, t) => /* @__PURE__ */ n(
|
|
222
225
|
"div",
|
|
223
226
|
{
|
|
224
|
-
ref:
|
|
227
|
+
ref: t,
|
|
225
228
|
"data-slot": "dropdown-menu-section-label",
|
|
226
229
|
className: d(
|
|
227
230
|
"px-2 py-1 text-sm text-muted-foreground dark:text-muted-foreground",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const ScrollArea: import('react').ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').ScrollAreaRootProps, "ref"> & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
2
|
+
declare const ScrollBar: import('react').ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').ScrollAreaScrollbarProps, "ref"> & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export { ScrollArea, ScrollBar };
|