@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,66 +1,80 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Textarea as
|
|
8
|
-
const
|
|
9
|
-
({ className:
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as s } from "react";
|
|
3
|
+
import { cva as l } from "class-variance-authority";
|
|
4
|
+
import { cn as n } from "../../../../lib/utils.js";
|
|
5
|
+
import { Button as g } from "../button/button.js";
|
|
6
|
+
import { Input as c } from "../input/input.js";
|
|
7
|
+
import { Textarea as b } from "../textarea/textarea.js";
|
|
8
|
+
const h = s(
|
|
9
|
+
({ className: t, ...o }, r) => /* @__PURE__ */ e(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
|
-
ref:
|
|
12
|
+
ref: r,
|
|
13
13
|
"data-slot": "input-group",
|
|
14
14
|
role: "group",
|
|
15
|
-
className:
|
|
16
|
-
"group/input-group bg-background border
|
|
15
|
+
className: n(
|
|
16
|
+
"group/input-group bg-muted-background border border-transparent relative flex w-full items-stretch rounded-lg shadow-none transition-[color,box-shadow,border-color,background-color] outline-none",
|
|
17
|
+
"hover:border-border-emphasized",
|
|
17
18
|
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
18
19
|
"has-[>[data-align=inline-start]]:[&>input]:pl-2 has-[>[data-align=inline-start]]:[&>input]:rounded-l-none has-[>[data-align=inline-start]]:[&>textarea]:rounded-l-none",
|
|
19
|
-
"has-[>[data-align=inline-end]]:[&>input]:
|
|
20
|
+
"has-[>[data-align=inline-end]]:[&>input]:rounded-r-none has-[>[data-align=inline-end]]:[&>textarea]:rounded-r-none",
|
|
21
|
+
"[&>input]:pr-2 [&>textarea]:pr-2",
|
|
20
22
|
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
21
23
|
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
22
|
-
"has-[[data-slot=input-group-control]:focus-visible]:shadow-focus-ring has-[[data-slot=input-group-control]:focus-visible]:border-transparent",
|
|
23
|
-
"has-[[data-slot=input-group-control][aria-invalid=true]]:shadow-focus-ring-destructive has-[[data-slot=input-group-control][aria-invalid=true]]:border-transparent",
|
|
24
|
+
"has-[[data-slot=input-group-control]:focus-visible:not(:read-only)]:bg-background has-[[data-slot=input-group-control]:focus-visible:not(:read-only)]:shadow-focus-ring has-[[data-slot=input-group-control]:focus-visible:not(:read-only)]:border-transparent",
|
|
25
|
+
"has-[[data-slot=input-group-control][aria-invalid=true]:not(:focus-visible)]:shadow-focus-ring-destructive has-[[data-slot=input-group-control][aria-invalid=true]:not(:focus-visible)]:border-transparent",
|
|
24
26
|
"has-[[data-slot=input-group-control]:read-only]:border-transparent has-[[data-slot=input-group-control]:read-only]:shadow-none",
|
|
25
|
-
"hover:has-[[data-slot=input-group-control]:read-only]:border-transparent hover:has-[[data-slot=input-group-control]:read-only]:bg-accent hover:has-[[data-slot=input-group-control]:read-only]:text-
|
|
26
|
-
|
|
27
|
+
"hover:has-[[data-slot=input-group-control]:read-only]:border-transparent hover:has-[[data-slot=input-group-control]:read-only]:bg-accent-background hover:has-[[data-slot=input-group-control]:read-only]:text-muted-foreground",
|
|
28
|
+
t
|
|
27
29
|
),
|
|
28
|
-
...
|
|
30
|
+
...o
|
|
29
31
|
}
|
|
30
32
|
)
|
|
31
33
|
);
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-
|
|
34
|
+
h.displayName = "InputGroup";
|
|
35
|
+
const u = "[&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-muted-foreground [&>svg]:transition-colors group-hover/input-group:group-has-[[data-slot=input-group-control]:enabled:not(:read-only)]/input-group:[&>svg]:text-foreground group-has-[[data-slot=input-group-control]:enabled:focus-visible:not(:read-only)]/input-group:[&>svg]:text-foreground group-has-[[data-slot=input-group-control]:enabled:not(:placeholder-shown):not(:read-only)]/input-group:[&>svg]:text-foreground group-has-[[data-slot=input-group-control][aria-invalid=true]:enabled:not(:read-only)]/input-group:[&>svg]:text-foreground group-has-[[data-slot=input-group-control]:read-only:enabled]/input-group:[&>svg]:text-muted-foreground group-has-[[data-slot=input-group-control]:disabled]/input-group:[&>svg]:text-disabled-foreground", d = "[&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-muted-foreground [&>svg]:transition-colors", v = l(
|
|
36
|
+
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-2 text-xs font-normal select-none [&>kbd]:rounded-sm",
|
|
35
37
|
{
|
|
36
38
|
variants: {
|
|
37
39
|
align: {
|
|
38
|
-
"inline-start":
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
"inline-start": n(
|
|
41
|
+
"order-first min-h-0 rounded-l-lg pl-2",
|
|
42
|
+
u
|
|
43
|
+
),
|
|
44
|
+
"inline-end": n(
|
|
45
|
+
"order-last min-h-0 rounded-r-lg pr-2 has-[>button]:pr-1 has-[kbd]:pr-1 has-[[class*=stepper]]:pr-1",
|
|
46
|
+
d
|
|
47
|
+
),
|
|
48
|
+
"block-start": n(
|
|
49
|
+
"order-first w-full justify-start px-2 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
50
|
+
u
|
|
51
|
+
),
|
|
52
|
+
"block-end": n(
|
|
53
|
+
"order-last w-full justify-start px-2 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5",
|
|
54
|
+
d
|
|
55
|
+
)
|
|
42
56
|
}
|
|
43
57
|
},
|
|
44
58
|
defaultVariants: {
|
|
45
59
|
align: "inline-start"
|
|
46
60
|
}
|
|
47
61
|
}
|
|
48
|
-
),
|
|
62
|
+
), f = s(({ className: t, align: o = "inline-start", ...r }, i) => /* @__PURE__ */ e(
|
|
49
63
|
"div",
|
|
50
64
|
{
|
|
51
65
|
ref: i,
|
|
52
66
|
role: "group",
|
|
53
67
|
"data-slot": "input-group-addon",
|
|
54
|
-
"data-align":
|
|
55
|
-
className:
|
|
56
|
-
onClick: (
|
|
57
|
-
|
|
68
|
+
"data-align": o,
|
|
69
|
+
className: n(v({ align: o }), t),
|
|
70
|
+
onClick: (a) => {
|
|
71
|
+
a.target instanceof HTMLElement && a.target.closest("button") || a.target instanceof Node && !a.currentTarget.contains(a.target) || a.currentTarget.parentElement?.querySelector('[data-slot="input-group-control"]')?.focus();
|
|
58
72
|
},
|
|
59
|
-
...
|
|
73
|
+
...r
|
|
60
74
|
}
|
|
61
75
|
));
|
|
62
|
-
|
|
63
|
-
const m =
|
|
76
|
+
f.displayName = "InputGroupAddon";
|
|
77
|
+
const m = l(
|
|
64
78
|
"text-sm shadow-none flex gap-2 items-center",
|
|
65
79
|
{
|
|
66
80
|
variants: {
|
|
@@ -75,70 +89,86 @@ const m = u(
|
|
|
75
89
|
size: "xs"
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
|
-
),
|
|
79
|
-
({ className:
|
|
80
|
-
|
|
92
|
+
), x = s(
|
|
93
|
+
({ className: t, type: o = "button", variant: r = "ghost", size: i = "xs", ...a }, p) => /* @__PURE__ */ e(
|
|
94
|
+
g,
|
|
81
95
|
{
|
|
82
96
|
ref: p,
|
|
83
|
-
type:
|
|
97
|
+
type: o,
|
|
84
98
|
"data-size": i,
|
|
85
|
-
variant:
|
|
86
|
-
className:
|
|
87
|
-
...
|
|
99
|
+
variant: r,
|
|
100
|
+
className: n(m({ size: i }), t),
|
|
101
|
+
...a
|
|
88
102
|
}
|
|
89
103
|
)
|
|
90
104
|
);
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
({ className:
|
|
105
|
+
x.displayName = "InputGroupButton";
|
|
106
|
+
const y = s(
|
|
107
|
+
({ className: t, ...o }, r) => /* @__PURE__ */ e(
|
|
94
108
|
"span",
|
|
95
109
|
{
|
|
96
|
-
ref:
|
|
110
|
+
ref: r,
|
|
97
111
|
"data-slot": "input-group-text",
|
|
98
|
-
className:
|
|
99
|
-
"text-muted-foreground flex items-center gap-2 text-
|
|
100
|
-
|
|
112
|
+
className: n(
|
|
113
|
+
"text-muted-foreground flex items-center gap-2 text-xs leading-[14px] tracking-[-0.00833em] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:text-muted-foreground",
|
|
114
|
+
t
|
|
101
115
|
),
|
|
102
|
-
...
|
|
116
|
+
...o
|
|
103
117
|
}
|
|
104
118
|
)
|
|
105
119
|
);
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
({ className:
|
|
109
|
-
|
|
120
|
+
y.displayName = "InputGroupText";
|
|
121
|
+
const k = s(
|
|
122
|
+
({ className: t, ...o }, r) => /* @__PURE__ */ e(
|
|
123
|
+
c,
|
|
110
124
|
{
|
|
111
|
-
ref:
|
|
125
|
+
ref: r,
|
|
112
126
|
"data-slot": "input-group-control",
|
|
113
|
-
className:
|
|
114
|
-
"flex-1 rounded-
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
|
|
127
|
+
className: n(
|
|
128
|
+
"min-h-0 h-full min-w-0 flex-1 rounded-lg border-0 shadow-none hover:text-muted-foreground",
|
|
129
|
+
"tracking-[-0.04em]",
|
|
130
|
+
"focus-visible:not(:read-only):bg-background focus-visible:shadow-none focus-visible:border-transparent",
|
|
131
|
+
"read-only:focus-visible:bg-muted-background",
|
|
132
|
+
"aria-invalid:shadow-none aria-invalid:border-transparent",
|
|
133
|
+
"aria-invalid:[&:not(:placeholder-shown)]:border-transparent",
|
|
134
|
+
"aria-invalid:focus-visible:not(:read-only):bg-background aria-invalid:focus-visible:shadow-none aria-invalid:focus-visible:border-transparent",
|
|
135
|
+
"read-only:aria-invalid:focus-visible:bg-muted-background",
|
|
136
|
+
"hover:border-0",
|
|
137
|
+
t
|
|
118
138
|
),
|
|
119
|
-
...
|
|
139
|
+
...o
|
|
120
140
|
}
|
|
121
141
|
)
|
|
122
142
|
);
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
143
|
+
k.displayName = "InputGroupInput";
|
|
144
|
+
const w = s(({ className: t, ...o }, r) => /* @__PURE__ */ e(
|
|
145
|
+
b,
|
|
126
146
|
{
|
|
127
|
-
ref:
|
|
147
|
+
ref: r,
|
|
128
148
|
"data-slot": "input-group-control",
|
|
129
|
-
className:
|
|
130
|
-
"flex-1 resize-none rounded-
|
|
131
|
-
|
|
149
|
+
className: n(
|
|
150
|
+
"min-h-0 flex-1 resize-none rounded-lg border-0 bg-transparent py-3 shadow-none",
|
|
151
|
+
"tracking-[-0.04em]",
|
|
152
|
+
"hover:border-0 hover:bg-transparent hover:text-muted-foreground",
|
|
153
|
+
"filled:border-transparent",
|
|
154
|
+
"focus-visible:shadow-none focus-visible:border-transparent",
|
|
155
|
+
"read-only:focus-visible:bg-muted-background",
|
|
156
|
+
"aria-invalid:shadow-none aria-invalid:border-transparent",
|
|
157
|
+
"aria-invalid:[&:not(:placeholder-shown)]:border-transparent",
|
|
158
|
+
"aria-invalid:focus-visible:not(:read-only):bg-background aria-invalid:focus-visible:shadow-none aria-invalid:focus-visible:border-transparent",
|
|
159
|
+
"read-only:aria-invalid:focus-visible:bg-muted-background",
|
|
160
|
+
"read-only:text-muted-foreground [&:read-only:not(:placeholder-shown)]:text-muted-foreground",
|
|
161
|
+
t
|
|
132
162
|
),
|
|
133
|
-
...
|
|
163
|
+
...o
|
|
134
164
|
}
|
|
135
165
|
));
|
|
136
|
-
|
|
166
|
+
w.displayName = "InputGroupTextarea";
|
|
137
167
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
168
|
+
h as InputGroup,
|
|
169
|
+
f as InputGroupAddon,
|
|
170
|
+
x as InputGroupButton,
|
|
171
|
+
k as InputGroupInput,
|
|
172
|
+
y as InputGroupText,
|
|
173
|
+
w as InputGroupTextarea
|
|
144
174
|
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const Label: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> &
|
|
1
|
+
declare const Label: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
2
|
+
required?: boolean;
|
|
3
|
+
} & import('react').RefAttributes<HTMLLabelElement>>;
|
|
2
4
|
export { Label };
|
|
@@ -1,19 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
const n =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
import { cn as s } from "../../../../lib/utils.js";
|
|
4
|
+
const n = i(
|
|
5
|
+
({ className: t, children: r, required: a = !1, ...d }, l) => /* @__PURE__ */ o(
|
|
6
|
+
"label",
|
|
7
|
+
{
|
|
8
|
+
ref: l,
|
|
9
|
+
"data-slot": "label",
|
|
10
|
+
className: s(
|
|
11
|
+
"flex items-center text-muted-foreground dark:text-muted-foreground text-sm font-medium leading-4.5 pb-2 select-none group-data-[disabled=true]:disabled-foreground group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:cursor-not-allowed group-data-[disabled=true]:opacity-50",
|
|
12
|
+
t
|
|
13
|
+
),
|
|
14
|
+
...d,
|
|
15
|
+
children: [
|
|
16
|
+
r,
|
|
17
|
+
a ? /* @__PURE__ */ e(
|
|
18
|
+
"span",
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "label-required-indicator",
|
|
21
|
+
className: "inline-block shrink-0 self-start pt-0.5",
|
|
22
|
+
children: /* @__PURE__ */ e(
|
|
23
|
+
"svg",
|
|
24
|
+
{
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
width: "5",
|
|
27
|
+
height: "8",
|
|
28
|
+
viewBox: "0 0 5 8",
|
|
29
|
+
fill: "currentColor",
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
+
children: /* @__PURE__ */ e("path", { d: "M2.01082 7.19387L2.09648 5.29125L0.491434 6.32372L0 5.46709L1.70424 4.59693L0 3.72678L0.491434 2.87015L2.09648 3.90261L2.01082 2H2.98918L2.90352 3.90261L4.50857 2.87015L5 3.72678L3.29576 4.59693L5 5.46709L4.50857 6.32372L2.90352 5.29125L2.98918 7.19387H2.01082Z" })
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
) : null
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
);
|
|
17
40
|
n.displayName = "Label";
|
|
18
41
|
export {
|
|
19
42
|
n as Label
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const e = {
|
|
2
2
|
name: "Label",
|
|
3
3
|
status: "in-progress-code-review",
|
|
4
|
-
description: "An accessible text label for form controls, built on top of Base UI Label. Supports association via `htmlFor
|
|
5
|
-
llmUsage: 'Use `<Label htmlFor="field-id">Text</Label>` together with
|
|
4
|
+
description: "An accessible text label for form controls, built on top of Base UI Label. Supports association via `htmlFor`, integrates with disabled states, and can render Aura's visual required indicator.",
|
|
5
|
+
llmUsage: 'Use `<Label htmlFor="field-id">Text</Label>` together with a form control that has `id="field-id"` so clicking the label focuses the field. Use `Label.required` for the visual asterisk only, and set `required` on the form control itself when the field must be required for validation and assistive technology.'
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
e as LabelMetadata
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ControlsConfig } from 'streamdown';
|
|
2
|
+
/**
|
|
3
|
+
* Default Streamdown `controls` for assistant markdown (`MessageResponse`).
|
|
4
|
+
*
|
|
5
|
+
* - **Mermaid:** Enables copy, download, and pan/zoom (AX-117, AX-118). Fullscreen is
|
|
6
|
+
* disabled: it uses a portal to `document.body`, which breaks scoped / prefixed CSS in
|
|
7
|
+
* micro-frontend hosts until upstream supports a configurable portal root.
|
|
8
|
+
* - **Code / table:** Off so chat keeps a simpler surface; callers may override via the
|
|
9
|
+
* `controls` prop on `MessageResponse`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS: Exclude<ControlsConfig, boolean>;
|
|
@@ -41,7 +41,7 @@ declare const MessageBranchNext: ({ children, ...props }: MessageBranchNextProps
|
|
|
41
41
|
type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;
|
|
42
42
|
declare const MessageBranchPage: ({ className, ...props }: MessageBranchPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
43
|
type MessageResponseProps = ComponentProps<typeof Streamdown>;
|
|
44
|
-
declare const MessageResponse: import('react').MemoExoticComponent<({ className, components, plugins, ...props }: MessageResponseProps) => import("react/jsx-runtime").JSX.Element>;
|
|
44
|
+
declare const MessageResponse: import('react').MemoExoticComponent<({ className, components, plugins, controls, ...props }: MessageResponseProps) => import("react/jsx-runtime").JSX.Element>;
|
|
45
45
|
type MessageAttachmentProps = HTMLAttributes<HTMLDivElement> & {
|
|
46
46
|
data: FileUIPart;
|
|
47
47
|
className?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as i, memo as b } from "react";
|
|
3
3
|
import { mermaid as _ } from "@streamdown/mermaid";
|
|
4
4
|
import "@tabler/icons-react";
|
|
@@ -7,8 +7,9 @@ import { cn as d } from "../../../../lib/utils.js";
|
|
|
7
7
|
import "../avatar/avatar.js";
|
|
8
8
|
import { Button as u } from "../button/button.js";
|
|
9
9
|
import "../button-group/button-group.js";
|
|
10
|
-
import { Tooltip as w, TooltipTrigger as g, TooltipContent as
|
|
11
|
-
|
|
10
|
+
import { Tooltip as w, TooltipTrigger as g, TooltipContent as k } from "../tooltip/tooltip.js";
|
|
11
|
+
import { MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS as v } from "./message-response-default-streamdown-controls.js";
|
|
12
|
+
const q = ({ className: t, isResponse: o = !1, ...a }) => /* @__PURE__ */ e(
|
|
12
13
|
"div",
|
|
13
14
|
{
|
|
14
15
|
"data-slot": "message",
|
|
@@ -19,7 +20,7 @@ const z = ({ className: t, isResponse: o = !1, ...a }) => /* @__PURE__ */ e(
|
|
|
19
20
|
),
|
|
20
21
|
...a
|
|
21
22
|
}
|
|
22
|
-
),
|
|
23
|
+
), O = ({
|
|
23
24
|
children: t,
|
|
24
25
|
className: o,
|
|
25
26
|
...a
|
|
@@ -30,14 +31,14 @@ const z = ({ className: t, isResponse: o = !1, ...a }) => /* @__PURE__ */ e(
|
|
|
30
31
|
className: d(
|
|
31
32
|
"is-user:dark flex flex-col gap-4 rounded-md text-base leading-tight tracking-tightest",
|
|
32
33
|
"max-w-4/5",
|
|
33
|
-
"group-[.is-user]:overflow-hidden group-[.is-user]:bg-accent group-[.is-user]:p-2 group-[.is-user]:text-
|
|
34
|
+
"group-[.is-user]:overflow-hidden group-[.is-user]:bg-accent-background group-[.is-user]:p-2 group-[.is-user]:text-foreground",
|
|
34
35
|
"group-[.is-assistant]:text-foreground group-[.is-assistant]:pt-1",
|
|
35
36
|
o
|
|
36
37
|
),
|
|
37
38
|
...a,
|
|
38
39
|
children: t
|
|
39
40
|
}
|
|
40
|
-
),
|
|
41
|
+
), z = ({
|
|
41
42
|
className: t,
|
|
42
43
|
children: o,
|
|
43
44
|
...a
|
|
@@ -49,16 +50,16 @@ const z = ({ className: t, isResponse: o = !1, ...a }) => /* @__PURE__ */ e(
|
|
|
49
50
|
...a,
|
|
50
51
|
children: o
|
|
51
52
|
}
|
|
52
|
-
),
|
|
53
|
+
), D = ({
|
|
53
54
|
tooltip: t,
|
|
54
55
|
children: o,
|
|
55
56
|
label: a,
|
|
56
57
|
className: r,
|
|
57
|
-
variant:
|
|
58
|
+
variant: s = "ghost",
|
|
58
59
|
size: c = "sm",
|
|
59
60
|
...l
|
|
60
61
|
}) => {
|
|
61
|
-
const
|
|
62
|
+
const n = /* @__PURE__ */ m(
|
|
62
63
|
u,
|
|
63
64
|
{
|
|
64
65
|
"data-slot": "message-action",
|
|
@@ -68,7 +69,7 @@ const z = ({ className: t, isResponse: o = !1, ...a }) => /* @__PURE__ */ e(
|
|
|
68
69
|
),
|
|
69
70
|
size: c,
|
|
70
71
|
type: "button",
|
|
71
|
-
variant:
|
|
72
|
+
variant: s,
|
|
72
73
|
...l,
|
|
73
74
|
children: [
|
|
74
75
|
o,
|
|
@@ -76,15 +77,15 @@ const z = ({ className: t, isResponse: o = !1, ...a }) => /* @__PURE__ */ e(
|
|
|
76
77
|
]
|
|
77
78
|
}
|
|
78
79
|
);
|
|
79
|
-
return t ? /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */ e(g, { render:
|
|
81
|
-
/* @__PURE__ */ e(
|
|
82
|
-
] }) :
|
|
80
|
+
return t ? /* @__PURE__ */ m(w, { children: [
|
|
81
|
+
/* @__PURE__ */ e(g, { render: n }),
|
|
82
|
+
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ e("p", { children: t }) })
|
|
83
|
+
] }) : n;
|
|
83
84
|
};
|
|
84
85
|
i(
|
|
85
86
|
null
|
|
86
87
|
);
|
|
87
|
-
const
|
|
88
|
+
const f = {
|
|
88
89
|
h1: ({ children: t }) => /* @__PURE__ */ e("h1", { className: "mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest", children: t }),
|
|
89
90
|
h2: ({ children: t }) => /* @__PURE__ */ e("h2", { className: "mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest", children: t }),
|
|
90
91
|
h3: ({ children: t }) => /* @__PURE__ */ e("h3", { className: "mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter", children: t }),
|
|
@@ -104,20 +105,35 @@ const k = {
|
|
|
104
105
|
a: ({ children: t, href: o, ...a }) => /* @__PURE__ */ e(
|
|
105
106
|
"a",
|
|
106
107
|
{
|
|
107
|
-
className: "text-foreground
|
|
108
|
+
className: "text-link-foreground no-underline hover:underline underline-offset-4",
|
|
108
109
|
href: o,
|
|
109
110
|
...a,
|
|
110
111
|
children: t
|
|
111
112
|
}
|
|
112
113
|
),
|
|
113
|
-
table: ({ children: t }) => /* @__PURE__ */ e(
|
|
114
|
+
table: ({ children: t }) => /* @__PURE__ */ e(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
className: "my-6 overflow-x-auto",
|
|
118
|
+
tabIndex: 0,
|
|
119
|
+
role: "group",
|
|
120
|
+
"aria-label": "Atlas AI Chat Table",
|
|
121
|
+
children: /* @__PURE__ */ e("table", { className: "w-full", children: t })
|
|
122
|
+
}
|
|
123
|
+
),
|
|
114
124
|
thead: ({ children: t }) => /* @__PURE__ */ e("thead", { children: t }),
|
|
115
125
|
tbody: ({ children: t }) => /* @__PURE__ */ e("tbody", { children: t }),
|
|
116
|
-
tr: ({ children: t }) => /* @__PURE__ */ e("tr", { className: "m-0 border-t p-0 even:bg-muted", children: t }),
|
|
126
|
+
tr: ({ children: t }) => /* @__PURE__ */ e("tr", { className: "m-0 border-t p-0 even:bg-muted-background", children: t }),
|
|
117
127
|
th: ({ children: t }) => /* @__PURE__ */ e("th", { className: "border px-4 py-2 text-left font-bold", children: t }),
|
|
118
128
|
td: ({ children: t }) => /* @__PURE__ */ e("td", { className: "border px-4 py-2 text-left", children: t })
|
|
119
|
-
},
|
|
120
|
-
({
|
|
129
|
+
}, h = b(
|
|
130
|
+
({
|
|
131
|
+
className: t,
|
|
132
|
+
components: o,
|
|
133
|
+
plugins: a,
|
|
134
|
+
controls: r,
|
|
135
|
+
...s
|
|
136
|
+
}) => /* @__PURE__ */ e(
|
|
121
137
|
p,
|
|
122
138
|
{
|
|
123
139
|
"data-slot": "message-response",
|
|
@@ -129,7 +145,7 @@ const k = {
|
|
|
129
145
|
// Inline code
|
|
130
146
|
"[&_code]:relative",
|
|
131
147
|
"[&_code]:rounded",
|
|
132
|
-
"[&_code]:bg-muted",
|
|
148
|
+
"[&_code]:bg-muted-background",
|
|
133
149
|
"[&_code]:px-[0.3rem]",
|
|
134
150
|
"[&_code]:py-[0.2rem]",
|
|
135
151
|
"[&_code]:font-mono",
|
|
@@ -146,7 +162,7 @@ const k = {
|
|
|
146
162
|
'[&_div[data-streamdown="code-block-header"]]:flex',
|
|
147
163
|
'[&_div[data-streamdown="code-block-header"]]:items-center',
|
|
148
164
|
'[&_div[data-streamdown="code-block-header"]]:justify-between',
|
|
149
|
-
'[&_div[data-streamdown="code-block-header"]]:bg-muted/80',
|
|
165
|
+
'[&_div[data-streamdown="code-block-header"]]:bg-muted-background/80',
|
|
150
166
|
'[&_div[data-streamdown="code-block-header"]]:px-4',
|
|
151
167
|
'[&_div[data-streamdown="code-block-header"]]:py-3',
|
|
152
168
|
'[&_div[data-streamdown="code-block-header"]]:text-xs',
|
|
@@ -185,7 +201,7 @@ const k = {
|
|
|
185
201
|
"[&_pre:not([data-streamdown])]:overflow-x-auto",
|
|
186
202
|
"[&_pre:not([data-streamdown])]:rounded-md",
|
|
187
203
|
"[&_pre:not([data-streamdown])]:border",
|
|
188
|
-
"[&_pre:not([data-streamdown])]:bg-card",
|
|
204
|
+
"[&_pre:not([data-streamdown])]:bg-card-background",
|
|
189
205
|
"[&_pre:not([data-streamdown])]:p-4",
|
|
190
206
|
"[&_pre:not([data-streamdown])]:text-foreground",
|
|
191
207
|
"[&_pre:not([data-streamdown])]:text-sm",
|
|
@@ -198,41 +214,43 @@ const k = {
|
|
|
198
214
|
"[&_pre:not([data-streamdown])_code]:text-sm",
|
|
199
215
|
"[&_pre:not([data-streamdown])_code]:font-normal",
|
|
200
216
|
// Mermaid diagram blocks
|
|
201
|
-
'[&_div[data-streamdown="mermaid-block"]]:bg-card',
|
|
202
|
-
'[&_div[data-streamdown="mermaid-block"]]:text-
|
|
217
|
+
'[&_div[data-streamdown="mermaid-block"]]:bg-card-background',
|
|
218
|
+
'[&_div[data-streamdown="mermaid-block"]]:text-foreground',
|
|
203
219
|
'[&_div[data-streamdown="mermaid-block"]]:flex',
|
|
204
220
|
'[&_div[data-streamdown="mermaid-block"]]:flex-col',
|
|
205
221
|
'[&_div[data-streamdown="mermaid-block"]]:rounded-lg',
|
|
206
|
-
'[&_div[data-streamdown="mermaid-block"]]:hover:bg-accent',
|
|
222
|
+
'[&_div[data-streamdown="mermaid-block"]]:hover:bg-accent-background',
|
|
207
223
|
'[&_div[data-streamdown="mermaid-block"]]:border-0',
|
|
208
|
-
//
|
|
224
|
+
// Positioning context for the action strip (see below)
|
|
225
|
+
'[&_div[data-streamdown="mermaid-block"]]:relative',
|
|
226
|
+
// Nested scroll + sticky + pointer-events breaks hit-testing on Mermaid Copy/Download
|
|
227
|
+
// (same class of issue as github.com/vercel/streamdown/issues/494). Force absolute strip.
|
|
228
|
+
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!absolute',
|
|
229
|
+
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!top-2',
|
|
230
|
+
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!right-2',
|
|
231
|
+
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!z-10',
|
|
232
|
+
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!mt-0',
|
|
233
|
+
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!pointer-events-auto',
|
|
234
|
+
// Ensure mermaid container is tall enough for the toolbar (pan/zoom + actions)
|
|
209
235
|
'[&_div[data-streamdown="mermaid-block"]_.relative.w-full]:!min-h-28',
|
|
210
|
-
// Mermaid fullscreen overlay: boost z-index above eos footer (z-150)
|
|
211
|
-
'[&_div[data-streamdown="mermaid-block"]_>div>.fixed]:!z-[200]',
|
|
212
|
-
// Mermaid fullscreen toolbar: pin to viewport top-left (only in fullscreen via .inset-0)
|
|
213
|
-
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!fixed',
|
|
214
|
-
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!top-4',
|
|
215
|
-
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!bottom-auto',
|
|
216
|
-
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!right-auto',
|
|
217
|
-
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!left-4',
|
|
218
236
|
// First and last child margin resets
|
|
219
237
|
"[&>*:first-child]:mt-0",
|
|
220
238
|
"[&>*:last-child]:mb-0",
|
|
221
239
|
t
|
|
222
240
|
),
|
|
223
|
-
components: { ...
|
|
224
|
-
controls:
|
|
241
|
+
components: { ...f, ...o },
|
|
242
|
+
controls: r ?? v,
|
|
225
243
|
plugins: { ...a, mermaid: _ },
|
|
226
|
-
...
|
|
244
|
+
...s
|
|
227
245
|
}
|
|
228
246
|
),
|
|
229
247
|
(t, o) => t.children === o.children
|
|
230
248
|
);
|
|
231
|
-
|
|
249
|
+
h.displayName = "MessageResponse";
|
|
232
250
|
export {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
251
|
+
q as Message,
|
|
252
|
+
D as MessageAction,
|
|
253
|
+
z as MessageActions,
|
|
254
|
+
O as MessageContent,
|
|
255
|
+
h as MessageResponse
|
|
238
256
|
};
|
|
@@ -4,5 +4,14 @@ declare namespace Popover {
|
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
6
6
|
declare function PopoverTrigger({ children, ...props }: PopoverPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const PopoverHeader: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const PopoverHeaderContent: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const PopoverTitle: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
10
|
+
declare const PopoverDescription: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
11
|
+
declare const PopoverSlot: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const PopoverClose: import('react').ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').ButtonProps & import('class-variance-authority').VariantProps<(props?: ({
|
|
13
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
14
|
+
size?: "icon" | "default" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
|
|
15
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
7
16
|
declare const PopoverContent: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').PopoverPopupProps & Pick<import('@base-ui/react').PopoverPositionerProps, "align" | "alignOffset" | "side" | "sideOffset">, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
-
export { Popover,
|
|
17
|
+
export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverHeaderContent, PopoverSlot, PopoverTitle, PopoverTrigger, };
|