@cognite/aura 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +53 -0
- package/dist/components/ui/core/alert/alert.d.ts +19 -0
- package/dist/components/ui/core/alert/alert.js +180 -0
- package/dist/components/ui/core/alert/alert.metadata.d.ts +2 -0
- package/dist/components/ui/core/alert/alert.metadata.js +9 -0
- package/dist/components/ui/core/avatar/avatar.d.ts +10 -0
- package/dist/components/ui/core/avatar/avatar.js +94 -0
- package/dist/components/ui/core/avatar/avatar.metadata.d.ts +8 -0
- package/dist/components/ui/core/avatar/avatar.metadata.js +9 -0
- package/dist/components/ui/core/badge/badge.d.ts +14 -0
- package/dist/components/ui/core/badge/badge.js +116 -0
- package/dist/components/ui/core/badge/badge.metadata.d.ts +2 -0
- package/dist/components/ui/core/badge/badge.metadata.js +8 -0
- package/dist/components/ui/core/button/button.d.ts +9 -0
- package/dist/components/ui/core/button/button.js +50 -0
- package/dist/components/ui/core/button/button.metadata.d.ts +2 -0
- package/dist/components/ui/core/button/button.metadata.js +9 -0
- package/dist/components/ui/core/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/core/button-group/button-group.js +83 -0
- package/dist/components/ui/core/button-group/button-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/button-group/button-group.metadata.js +8 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +21 -0
- package/dist/components/ui/core/code-block/code-block.js +146 -0
- package/dist/components/ui/core/code-block/code-block.metadata.d.ts +2 -0
- package/dist/components/ui/core/code-block/code-block.metadata.js +8 -0
- package/dist/components/ui/core/collapsible/collapsible.d.ts +4 -0
- package/dist/components/ui/core/collapsible/collapsible.js +44 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.d.ts +2 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.js +9 -0
- package/dist/components/ui/core/command/command.d.ts +86 -0
- package/dist/components/ui/core/command/command.js +150 -0
- package/dist/components/ui/core/command/command.metadata.d.ts +2 -0
- package/dist/components/ui/core/command/command.metadata.js +9 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +18 -0
- package/dist/components/ui/core/dialog/dialog.js +155 -0
- package/dist/components/ui/core/dialog/dialog.metadata.d.ts +2 -0
- package/dist/components/ui/core/dialog/dialog.metadata.js +9 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +53 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +250 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.d.ts +2 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.js +9 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +12 -0
- package/dist/components/ui/core/helper-text/helper-text.js +65 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.d.ts +2 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.js +9 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +12 -0
- package/dist/components/ui/core/hover-card/hover-card.js +76 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.d.ts +2 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.js +8 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +33 -0
- package/dist/components/ui/core/inline-citation/inline-citation.js +170 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.d.ts +2 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.js +8 -0
- package/dist/components/ui/core/input/input.d.ts +6 -0
- package/dist/components/ui/core/input/input.js +34 -0
- package/dist/components/ui/core/input/input.metadata.d.ts +2 -0
- package/dist/components/ui/core/input/input.metadata.js +9 -0
- package/dist/components/ui/core/input-group/input-group.d.ts +15 -0
- package/dist/components/ui/core/input-group/input-group.js +144 -0
- package/dist/components/ui/core/input-group/input-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/input-group/input-group.metadata.js +9 -0
- package/dist/components/ui/core/label/label.d.ts +2 -0
- package/dist/components/ui/core/label/label.js +20 -0
- package/dist/components/ui/core/label/label.metadata.d.ts +2 -0
- package/dist/components/ui/core/label/label.metadata.js +9 -0
- package/dist/components/ui/core/loader/loader.d.ts +7 -0
- package/dist/components/ui/core/loader/loader.js +119 -0
- package/dist/components/ui/core/loader/loader.metadata.d.ts +2 -0
- package/dist/components/ui/core/loader/loader.metadata.js +9 -0
- package/dist/components/ui/core/message/message.d.ts +55 -0
- package/dist/components/ui/core/message/message.js +169 -0
- package/dist/components/ui/core/message/message.metadata.d.ts +2 -0
- package/dist/components/ui/core/popover/popover.d.ts +8 -0
- package/dist/components/ui/core/popover/popover.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +161 -0
- package/dist/components/ui/core/prompt-input/prompt-input.js +402 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.js +9 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +9 -0
- package/dist/components/ui/core/reasoning/reasoning.js +85 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.d.ts +2 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.js +8 -0
- package/dist/components/ui/core/select/select.d.ts +44 -0
- package/dist/components/ui/core/select/select.js +279 -0
- package/dist/components/ui/core/select/select.metadata.d.ts +2 -0
- package/dist/components/ui/core/select/select.metadata.js +9 -0
- package/dist/components/ui/core/separator/separator.d.ts +6 -0
- package/dist/components/ui/core/separator/separator.js +25 -0
- package/dist/components/ui/core/separator/separator.metadata.d.ts +2 -0
- package/dist/components/ui/core/separator/separator.metadata.js +8 -0
- package/dist/components/ui/core/shimmer/shimmer.d.ts +14 -0
- package/dist/components/ui/core/shimmer/shimmer.js +69 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.d.ts +2 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.js +9 -0
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.js +18 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.js +9 -0
- package/dist/components/ui/core/sources/sources.d.ts +16 -0
- package/dist/components/ui/core/sources/sources.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.d.ts +9 -0
- package/dist/components/ui/core/textarea/textarea.js +49 -0
- package/dist/components/ui/core/textarea/textarea.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.metadata.js +9 -0
- package/dist/components/ui/core/tool/tool.d.ts +21 -0
- package/dist/components/ui/core/tool/tool.js +151 -0
- package/dist/components/ui/core/tool/tool.metadata.d.ts +2 -0
- package/dist/components/ui/core/tool/tool.metadata.js +8 -0
- package/dist/components/ui/core/tooltip/tooltip.d.ts +10 -0
- package/dist/components/ui/core/tooltip/tooltip.js +82 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.d.ts +8 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.js +9 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.d.ts +134 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.metadata.d.ts +2 -0
- package/dist/components/ui/lab/topbar/topbar.d.ts +10 -0
- package/dist/components/ui/lab/topbar/topbar.metadata.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +229 -0
- package/dist/lib/ai/types.d.ts +53 -0
- package/dist/lib/component-status-config.d.ts +12 -0
- package/dist/lib/style-scope.d.ts +5 -0
- package/dist/lib/style-scope.js +7 -0
- package/dist/lib/types.d.ts +50 -0
- package/dist/lib/use-controllable-state.d.ts +11 -0
- package/dist/lib/use-controllable-state.js +32 -0
- package/dist/lib/utils.d.ts +45 -0
- package/dist/lib/utils.js +92 -0
- package/package.json +51 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { mergeProps as i } from "@base-ui/react/merge-props";
|
|
3
|
+
import { useRender as s } from "@base-ui/react/use-render";
|
|
4
|
+
import { cva as l } from "class-variance-authority";
|
|
5
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
6
|
+
import { Separator as d } from "../separator/separator.js";
|
|
7
|
+
const u = l(
|
|
8
|
+
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
orientation: {
|
|
12
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
13
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
orientation: "horizontal"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
function v({
|
|
22
|
+
className: o,
|
|
23
|
+
orientation: t,
|
|
24
|
+
...r
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ a(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
role: "group",
|
|
30
|
+
"data-slot": "button-group",
|
|
31
|
+
"data-orientation": t,
|
|
32
|
+
className: e(u({ orientation: t }), o),
|
|
33
|
+
...r
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function b({
|
|
38
|
+
className: o,
|
|
39
|
+
render: t,
|
|
40
|
+
children: r,
|
|
41
|
+
...n
|
|
42
|
+
}) {
|
|
43
|
+
return s({
|
|
44
|
+
defaultTagName: "div",
|
|
45
|
+
props: i(
|
|
46
|
+
{
|
|
47
|
+
className: e(
|
|
48
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
49
|
+
o
|
|
50
|
+
)
|
|
51
|
+
},
|
|
52
|
+
{ ...n, children: r }
|
|
53
|
+
),
|
|
54
|
+
render: t,
|
|
55
|
+
state: {
|
|
56
|
+
slot: "button-group-text"
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function x({
|
|
61
|
+
className: o,
|
|
62
|
+
orientation: t = "vertical",
|
|
63
|
+
...r
|
|
64
|
+
}) {
|
|
65
|
+
return /* @__PURE__ */ a(
|
|
66
|
+
d,
|
|
67
|
+
{
|
|
68
|
+
"data-slot": "button-group-separator",
|
|
69
|
+
orientation: t,
|
|
70
|
+
className: e(
|
|
71
|
+
"bg-input relative m-0 self-stretch data-[orientation=vertical]:h-auto",
|
|
72
|
+
o
|
|
73
|
+
),
|
|
74
|
+
...r
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
v as ButtonGroup,
|
|
80
|
+
x as ButtonGroupSeparator,
|
|
81
|
+
b as ButtonGroupText,
|
|
82
|
+
u as buttonGroupVariants
|
|
83
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentProps, HTMLAttributes } from 'react';
|
|
2
|
+
import { BundledLanguage } from 'shiki';
|
|
3
|
+
import { Button } from '../button/button';
|
|
4
|
+
declare const CodeBlock: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
code: string;
|
|
6
|
+
copyText?: string;
|
|
7
|
+
collapsed?: boolean;
|
|
8
|
+
language: BundledLanguage;
|
|
9
|
+
showLineNumbers?: boolean;
|
|
10
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
|
+
type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {
|
|
12
|
+
onCopy?: () => void;
|
|
13
|
+
onError?: (error: Error) => void;
|
|
14
|
+
timeout?: number;
|
|
15
|
+
};
|
|
16
|
+
declare const CodeBlockCopyButton: import('react').ForwardRefExoticComponent<Omit<CodeBlockCopyButtonProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
17
|
+
declare const CodeBlockCollapseButton: import('react').ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').ButtonProps & import('class-variance-authority').VariantProps<(props?: ({
|
|
18
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
19
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
20
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
21
|
+
export { CodeBlock, CodeBlockCollapseButton, CodeBlockCopyButton };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { jsx as o, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as E, forwardRef as y, useState as C, useMemo as T, useEffect as M, useContext as N } from "react";
|
|
3
|
+
import { IconCheck as j, IconCopy as P, IconSelector as $ } from "@tabler/icons-react";
|
|
4
|
+
import { isStorybookTestEnv as f, highlightCode as A, cn as d } from "../../../../lib/utils.js";
|
|
5
|
+
import { Button as _ } from "../button/button.js";
|
|
6
|
+
const g = E({
|
|
7
|
+
code: "",
|
|
8
|
+
copyText: "",
|
|
9
|
+
isCollapsed: !1,
|
|
10
|
+
setIsCollapsed: () => {
|
|
11
|
+
},
|
|
12
|
+
lineCount: 0
|
|
13
|
+
}), D = y(
|
|
14
|
+
({
|
|
15
|
+
code: e,
|
|
16
|
+
copyText: t,
|
|
17
|
+
language: r,
|
|
18
|
+
showLineNumbers: l = !1,
|
|
19
|
+
collapsed: s = !1,
|
|
20
|
+
className: c,
|
|
21
|
+
children: n,
|
|
22
|
+
...h
|
|
23
|
+
}, p) => {
|
|
24
|
+
const [k, m] = C(""), [b, a] = C(""), [i, H] = C(s), w = e.split(`
|
|
25
|
+
`).length, B = t ?? e, I = T(
|
|
26
|
+
() => f ? `<pre><code>${e}</code></pre>` : "",
|
|
27
|
+
[e]
|
|
28
|
+
);
|
|
29
|
+
M(() => {
|
|
30
|
+
if (f) return;
|
|
31
|
+
let v = !1;
|
|
32
|
+
return A(e, r, l).then(([x, u]) => {
|
|
33
|
+
v || (m(x), a(u));
|
|
34
|
+
}).catch((x) => {
|
|
35
|
+
if (console.error("Failed to highlight code:", x), !v) {
|
|
36
|
+
const u = `<pre><code>${e}</code></pre>`;
|
|
37
|
+
m(u), a(u);
|
|
38
|
+
}
|
|
39
|
+
}), () => {
|
|
40
|
+
v = !0;
|
|
41
|
+
};
|
|
42
|
+
}, [e, r, l]);
|
|
43
|
+
const S = T(
|
|
44
|
+
() => ({
|
|
45
|
+
code: e,
|
|
46
|
+
copyText: B,
|
|
47
|
+
isCollapsed: i,
|
|
48
|
+
setIsCollapsed: H,
|
|
49
|
+
lineCount: w
|
|
50
|
+
}),
|
|
51
|
+
[e, B, i, w]
|
|
52
|
+
);
|
|
53
|
+
return /* @__PURE__ */ o(g.Provider, { value: S, children: /* @__PURE__ */ o(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
ref: p,
|
|
57
|
+
"data-slot": "code-block",
|
|
58
|
+
className: d(
|
|
59
|
+
"group/code-block relative w-full overflow-hidden rounded-md bg-background text-foreground",
|
|
60
|
+
c
|
|
61
|
+
),
|
|
62
|
+
...h,
|
|
63
|
+
children: /* @__PURE__ */ z("div", { className: "relative", children: [
|
|
64
|
+
/* @__PURE__ */ o(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: d(
|
|
68
|
+
"dark:hidden [&>pre]:m-0 [&>pre]:bg-card [&>pre]:p-4 [&>pre]:text-foreground [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm [&>pre]:overflow-x-auto",
|
|
69
|
+
i && "max-h-26 overflow-y-hidden"
|
|
70
|
+
),
|
|
71
|
+
dangerouslySetInnerHTML: {
|
|
72
|
+
__html: f ? I : k
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ o(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: d(
|
|
80
|
+
"hidden dark:block [&>pre]:m-0 [&>pre]:bg-card [&>pre]:p-4 [&>pre]:text-foreground [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm [&>pre]:overflow-x-auto",
|
|
81
|
+
i && "max-h-26 overflow-y-hidden"
|
|
82
|
+
),
|
|
83
|
+
dangerouslySetInnerHTML: {
|
|
84
|
+
__html: f ? I : b
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
i && /* @__PURE__ */ o("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 h-3/4 bg-linear-to-b from-transparent via-card/70 to-card" }),
|
|
89
|
+
n && /* @__PURE__ */ o("div", { className: "absolute top-2 right-2 hidden items-center gap-2 group-hover/code-block:flex", children: n })
|
|
90
|
+
] })
|
|
91
|
+
}
|
|
92
|
+
) });
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
D.displayName = "CodeBlock";
|
|
96
|
+
const F = y(({ onCopy: e, onError: t, timeout: r = 2e3, children: l, className: s, ...c }, n) => {
|
|
97
|
+
const [h, p] = C(!1), { copyText: k } = N(g), m = async () => {
|
|
98
|
+
if (typeof window > "u" || !navigator?.clipboard?.writeText) {
|
|
99
|
+
t?.(new Error("Clipboard API not available"));
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
await navigator.clipboard.writeText(k), p(!0), e?.(), setTimeout(() => p(!1), r);
|
|
104
|
+
} catch (a) {
|
|
105
|
+
console.warn("Clipboard write failed:", a), t?.(
|
|
106
|
+
a instanceof Error ? a : new Error("Clipboard write failed")
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}, b = h ? j : P;
|
|
110
|
+
return /* @__PURE__ */ o(
|
|
111
|
+
_,
|
|
112
|
+
{
|
|
113
|
+
ref: n,
|
|
114
|
+
"data-slot": "code-block-copy-button",
|
|
115
|
+
className: d("shrink-0", s),
|
|
116
|
+
onClick: m,
|
|
117
|
+
size: "icon",
|
|
118
|
+
variant: "secondary",
|
|
119
|
+
...c,
|
|
120
|
+
children: l ?? /* @__PURE__ */ o(b, { size: 14 })
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
F.displayName = "CodeBlockCopyButton";
|
|
125
|
+
const L = y(({ children: e, className: t, ...r }, l) => {
|
|
126
|
+
const { isCollapsed: s, setIsCollapsed: c, lineCount: n } = N(g);
|
|
127
|
+
return n <= 1 ? null : /* @__PURE__ */ o(
|
|
128
|
+
_,
|
|
129
|
+
{
|
|
130
|
+
ref: l,
|
|
131
|
+
"data-slot": "code-block-collapse-button",
|
|
132
|
+
className: d("shrink-0", t),
|
|
133
|
+
onClick: () => c(!s),
|
|
134
|
+
size: "icon",
|
|
135
|
+
variant: "secondary",
|
|
136
|
+
...r,
|
|
137
|
+
children: e ?? /* @__PURE__ */ o($, { size: 14 })
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
L.displayName = "CodeBlockCollapseButton";
|
|
142
|
+
export {
|
|
143
|
+
D as CodeBlock,
|
|
144
|
+
L as CodeBlockCollapseButton,
|
|
145
|
+
F as CodeBlockCopyButton
|
|
146
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const Collapsible: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').CollapsibleRootProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
2
|
+
declare const CollapsibleTrigger: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').CollapsibleTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
3
|
+
declare const CollapsibleContent: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').CollapsiblePanelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { Collapsible as i } from "@base-ui/react/collapsible";
|
|
4
|
+
import { cn as s } from "../../../../lib/utils.js";
|
|
5
|
+
const n = t(({ className: l, ...e }, o) => /* @__PURE__ */ a(
|
|
6
|
+
i.Root,
|
|
7
|
+
{
|
|
8
|
+
ref: o,
|
|
9
|
+
"data-slot": "collapsible",
|
|
10
|
+
className: s("w-full min-w-0 box-border *:max-w-full", l),
|
|
11
|
+
...e
|
|
12
|
+
}
|
|
13
|
+
));
|
|
14
|
+
n.displayName = "Collapsible";
|
|
15
|
+
const p = t(({ className: l, children: e, ...o }, r) => /* @__PURE__ */ a(
|
|
16
|
+
i.Trigger,
|
|
17
|
+
{
|
|
18
|
+
ref: r,
|
|
19
|
+
"data-slot": "collapsible-trigger",
|
|
20
|
+
className: s("group/collapsible-trigger text-base", l),
|
|
21
|
+
...o,
|
|
22
|
+
children: e
|
|
23
|
+
}
|
|
24
|
+
));
|
|
25
|
+
p.displayName = "CollapsibleTrigger";
|
|
26
|
+
const b = t(({ className: l, keepMounted: e = !0, ...o }, r) => /* @__PURE__ */ a(
|
|
27
|
+
i.Panel,
|
|
28
|
+
{
|
|
29
|
+
ref: r,
|
|
30
|
+
"data-slot": "collapsible-content",
|
|
31
|
+
className: s(
|
|
32
|
+
"hidden data-open:block border-none outline-none text-muted-foreground text-sm leading-4.5 tracking-tight w-full min-w-0 overflow-x-hidden box-border *:max-w-full *:box-border",
|
|
33
|
+
l
|
|
34
|
+
),
|
|
35
|
+
keepMounted: e,
|
|
36
|
+
...o
|
|
37
|
+
}
|
|
38
|
+
));
|
|
39
|
+
b.displayName = "CollapsibleContent";
|
|
40
|
+
export {
|
|
41
|
+
n as Collapsible,
|
|
42
|
+
b as CollapsibleContent,
|
|
43
|
+
p as CollapsibleTrigger
|
|
44
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
name: "Collapsible",
|
|
3
|
+
status: "in-progress-code-review",
|
|
4
|
+
description: "An interactive component that expands/collapses content, built on Base UI Collapsible primitives.",
|
|
5
|
+
llmUsage: "Use `<Collapsible>` with `<CollapsibleTrigger>` and `<CollapsibleContent>` for expandable sections."
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
e as CollapsibleMetadata
|
|
9
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { Dialog } from '../dialog/dialog';
|
|
3
|
+
declare const Command: import('react').ForwardRefExoticComponent<Omit<{
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
7
|
+
} & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
10
|
+
label?: string;
|
|
11
|
+
shouldFilter?: boolean;
|
|
12
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
loop?: boolean;
|
|
17
|
+
disablePointerSelection?: boolean;
|
|
18
|
+
vimBindings?: boolean;
|
|
19
|
+
} & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: Omit<ComponentProps<typeof Dialog>, 'children'> & {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
showCloseButton?: boolean;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare namespace CommandDialog {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
declare const CommandInput: import('react').ForwardRefExoticComponent<Omit<Omit<Pick<Pick<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import('react').InputHTMLAttributes<HTMLInputElement>> & {
|
|
31
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
32
|
+
} & {
|
|
33
|
+
asChild?: boolean;
|
|
34
|
+
}, "key" | keyof import('react').InputHTMLAttributes<HTMLInputElement> | "asChild">, "type" | "value" | "onChange"> & {
|
|
35
|
+
value?: string;
|
|
36
|
+
onValueChange?: (search: string) => void;
|
|
37
|
+
} & import('react').RefAttributes<HTMLInputElement>, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
38
|
+
declare const CommandList: import('react').ForwardRefExoticComponent<Omit<{
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
} & Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
|
|
41
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
42
|
+
} & {
|
|
43
|
+
asChild?: boolean;
|
|
44
|
+
}, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
45
|
+
label?: string;
|
|
46
|
+
} & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
47
|
+
declare const CommandEmpty: import('react').ForwardRefExoticComponent<Omit<{
|
|
48
|
+
children?: React.ReactNode;
|
|
49
|
+
} & Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
|
|
50
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
51
|
+
} & {
|
|
52
|
+
asChild?: boolean;
|
|
53
|
+
}, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild"> & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
54
|
+
declare const CommandGroup: import('react').ForwardRefExoticComponent<Omit<{
|
|
55
|
+
children?: React.ReactNode;
|
|
56
|
+
} & Omit<Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
|
|
57
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
58
|
+
} & {
|
|
59
|
+
asChild?: boolean;
|
|
60
|
+
}, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
|
|
61
|
+
heading?: React.ReactNode;
|
|
62
|
+
value?: string;
|
|
63
|
+
forceMount?: boolean;
|
|
64
|
+
} & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
65
|
+
declare const CommandSeparator: import('react').ForwardRefExoticComponent<Omit<Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
|
|
66
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
67
|
+
} & {
|
|
68
|
+
asChild?: boolean;
|
|
69
|
+
}, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
70
|
+
alwaysRender?: boolean;
|
|
71
|
+
} & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
72
|
+
declare const CommandItem: import('react').ForwardRefExoticComponent<Omit<{
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
} & Omit<Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
|
|
75
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
76
|
+
} & {
|
|
77
|
+
asChild?: boolean;
|
|
78
|
+
}, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild">, "disabled" | "value" | "onSelect"> & {
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
onSelect?: (value: string) => void;
|
|
81
|
+
value?: string;
|
|
82
|
+
keywords?: string[];
|
|
83
|
+
forceMount?: boolean;
|
|
84
|
+
} & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
85
|
+
declare const CommandShortcut: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
86
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { IconSearch as p } from "@tabler/icons-react";
|
|
4
|
+
import { Command as r } from "cmdk";
|
|
5
|
+
import { cn as m } from "../../../../lib/utils.js";
|
|
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, ...t }, a) => /* @__PURE__ */ o(
|
|
8
|
+
r,
|
|
9
|
+
{
|
|
10
|
+
ref: a,
|
|
11
|
+
"data-slot": "command",
|
|
12
|
+
className: m(
|
|
13
|
+
"rounded-lg bg-background text-muted-foreground flex h-full w-full flex-col overflow-hidden",
|
|
14
|
+
e
|
|
15
|
+
),
|
|
16
|
+
...t
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
s.displayName = "Command";
|
|
20
|
+
function y({
|
|
21
|
+
title: e = "Command Palette",
|
|
22
|
+
description: t = "Search for a command to run...",
|
|
23
|
+
children: a,
|
|
24
|
+
className: l,
|
|
25
|
+
showCloseButton: c = !0,
|
|
26
|
+
...i
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ n(u, { ...i, children: [
|
|
29
|
+
/* @__PURE__ */ n(g, { className: "sr-only rounded-lg", children: [
|
|
30
|
+
/* @__PURE__ */ o(h, { children: e }),
|
|
31
|
+
/* @__PURE__ */ o(f, { children: t })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ o(
|
|
34
|
+
x,
|
|
35
|
+
{
|
|
36
|
+
"data-slot": "command-dialog",
|
|
37
|
+
className: m("overflow-hidden p-0", l),
|
|
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: a })
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
y.displayName = "CommandDialog";
|
|
45
|
+
const k = d(({ className: e, ...t }, a) => /* @__PURE__ */ n(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
"data-slot": "command-input-wrapper",
|
|
49
|
+
className: "flex h-10 items-center gap-2 border-b px-2",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ o(p, { className: "size-4 shrink-0 opacity-50" }),
|
|
52
|
+
/* @__PURE__ */ o(
|
|
53
|
+
r.Input,
|
|
54
|
+
{
|
|
55
|
+
ref: a,
|
|
56
|
+
"data-slot": "command-input",
|
|
57
|
+
className: m(
|
|
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
|
+
e
|
|
60
|
+
),
|
|
61
|
+
...t
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
));
|
|
67
|
+
k.displayName = "CommandInput";
|
|
68
|
+
const C = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
69
|
+
r.List,
|
|
70
|
+
{
|
|
71
|
+
ref: a,
|
|
72
|
+
"data-slot": "command-list",
|
|
73
|
+
className: m(
|
|
74
|
+
"max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
75
|
+
e
|
|
76
|
+
),
|
|
77
|
+
...t
|
|
78
|
+
}
|
|
79
|
+
));
|
|
80
|
+
C.displayName = "CommandList";
|
|
81
|
+
const N = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
82
|
+
r.Empty,
|
|
83
|
+
{
|
|
84
|
+
ref: a,
|
|
85
|
+
"data-slot": "command-empty",
|
|
86
|
+
className: m("py-6 text-center text-sm", e),
|
|
87
|
+
...t
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
N.displayName = "CommandEmpty";
|
|
91
|
+
const v = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
92
|
+
r.Group,
|
|
93
|
+
{
|
|
94
|
+
ref: a,
|
|
95
|
+
"data-slot": "command-group",
|
|
96
|
+
className: m(
|
|
97
|
+
"text-popover-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
|
+
e
|
|
99
|
+
),
|
|
100
|
+
...t
|
|
101
|
+
}
|
|
102
|
+
));
|
|
103
|
+
v.displayName = "CommandGroup";
|
|
104
|
+
const w = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
105
|
+
r.Separator,
|
|
106
|
+
{
|
|
107
|
+
ref: a,
|
|
108
|
+
"data-slot": "command-separator",
|
|
109
|
+
className: m("bg-border -mx-1 h-px", e),
|
|
110
|
+
...t
|
|
111
|
+
}
|
|
112
|
+
));
|
|
113
|
+
w.displayName = "CommandSeparator";
|
|
114
|
+
const _ = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
115
|
+
r.Item,
|
|
116
|
+
{
|
|
117
|
+
ref: a,
|
|
118
|
+
"data-slot": "command-item",
|
|
119
|
+
className: m(
|
|
120
|
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-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
|
+
e
|
|
122
|
+
),
|
|
123
|
+
...t
|
|
124
|
+
}
|
|
125
|
+
));
|
|
126
|
+
_.displayName = "CommandItem";
|
|
127
|
+
const b = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
128
|
+
"span",
|
|
129
|
+
{
|
|
130
|
+
ref: a,
|
|
131
|
+
"data-slot": "command-shortcut",
|
|
132
|
+
className: m(
|
|
133
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
134
|
+
e
|
|
135
|
+
),
|
|
136
|
+
...t
|
|
137
|
+
}
|
|
138
|
+
));
|
|
139
|
+
b.displayName = "CommandShortcut";
|
|
140
|
+
export {
|
|
141
|
+
s as Command,
|
|
142
|
+
y as CommandDialog,
|
|
143
|
+
N as CommandEmpty,
|
|
144
|
+
v as CommandGroup,
|
|
145
|
+
k as CommandInput,
|
|
146
|
+
_ as CommandItem,
|
|
147
|
+
C as CommandList,
|
|
148
|
+
w as CommandSeparator,
|
|
149
|
+
b as CommandShortcut
|
|
150
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const m = {
|
|
2
|
+
name: "Command",
|
|
3
|
+
status: "in-progress-code-review",
|
|
4
|
+
description: "A command menu component for searchable command palettes, built with cmdk.",
|
|
5
|
+
llmUsage: "Use `<Command>` with `<CommandInput>`, `<CommandList>`, and `<CommandItem>` for command palettes."
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
m as CommandMetadata
|
|
9
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
3
|
+
declare function Dialog({ ...props }: DialogPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ children, ...props }: DialogPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ children, ...props }: DialogPrimitive.Close.Props & {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function DialogContent({ className, children, showCloseButton, closeButtonLabel, ...props }: DialogPrimitive.Popup.Props & {
|
|
11
|
+
showCloseButton?: boolean;
|
|
12
|
+
closeButtonLabel?: string;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DialogFooter({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|