@cognite/aura 0.3.2 → 0.3.4
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 +134 -5
- package/README.md +24 -3
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +59 -327
- package/dist/components/ui/core/accordion/accordion.js +79 -114
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +108 -176
- package/dist/components/ui/core/alert/alert.js +158 -206
- package/dist/components/ui/core/avatar/avatar.js +64 -90
- package/dist/components/ui/core/badge/badge.js +73 -108
- package/dist/components/ui/core/banner/banner.js +146 -215
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +105 -200
- package/dist/components/ui/core/button/button.js +47 -52
- package/dist/components/ui/core/button-group/button-group.js +40 -79
- package/dist/components/ui/core/calendar/calendar-header.js +63 -0
- package/dist/components/ui/core/calendar/calendar-utils.js +39 -0
- package/dist/components/ui/core/calendar/calendar.js +68 -0
- package/dist/components/ui/core/calendar/constants.d.ts +1 -0
- package/dist/components/ui/core/card/card.js +102 -185
- package/dist/components/ui/core/chart/chart.js +116 -206
- package/dist/components/ui/core/chart/index.js +2 -8
- package/dist/components/ui/core/checkbox/checkbox.js +67 -132
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
- package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
- package/dist/components/ui/core/code-block/code-block.js +179 -267
- package/dist/components/ui/core/collapsible/collapsible.js +29 -49
- package/dist/components/ui/core/combobox/combobox.js +41 -0
- package/dist/components/ui/core/command/command.js +85 -150
- package/dist/components/ui/core/count/count.js +21 -32
- package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +10 -0
- package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +13 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +18 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +43 -0
- package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +12 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +9 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +36 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +7 -6
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
- package/dist/components/ui/core/date-time-pickers/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/index.js +6 -10
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +3 -8
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +5 -4
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +40 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
- package/dist/components/ui/core/dialog/dialog.js +82 -155
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
- package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
- package/dist/components/ui/core/empty-state/empty-state.js +86 -138
- package/dist/components/ui/core/helper-text/helper-text.js +37 -65
- package/dist/components/ui/core/hover-card/hover-card.js +54 -80
- package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
- package/dist/components/ui/core/input/input.js +12 -27
- package/dist/components/ui/core/input-group/input-group.js +76 -173
- package/dist/components/ui/core/kbd/kbd.js +20 -36
- package/dist/components/ui/core/label/label.js +26 -43
- package/dist/components/ui/core/loader/loader.js +80 -117
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
- package/dist/components/ui/core/message/message.d.ts +2 -2
- package/dist/components/ui/core/message/message.js +316 -542
- package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +52 -0
- package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
- package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination.js +231 -334
- package/dist/components/ui/core/popover/popover.js +90 -157
- package/dist/components/ui/core/progress/progress.js +36 -61
- package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
- package/dist/components/ui/core/radio-group/radio-group.js +58 -113
- package/dist/components/ui/core/reasoning/reasoning.js +55 -86
- package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
- package/dist/components/ui/core/search/search.js +77 -99
- package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
- package/dist/components/ui/core/select/select.js +168 -293
- package/dist/components/ui/core/separator/separator.js +13 -23
- package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
- package/dist/components/ui/core/shimmer/shimmer.js +40 -107
- package/dist/components/ui/core/skeleton/skeleton.js +13 -18
- package/dist/components/ui/core/slider/slider.d.ts +9 -0
- package/dist/components/ui/core/slider/slider.js +40 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
- package/dist/components/ui/core/sources/sources.d.ts +5 -1
- package/dist/components/ui/core/sources/sources.js +58 -79
- package/dist/components/ui/core/switch/switch.js +62 -0
- package/dist/components/ui/core/tabs/tabs.js +149 -223
- package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
- package/dist/components/ui/core/textarea/textarea.js +13 -27
- package/dist/components/ui/core/toggle/toggle.js +55 -74
- package/dist/components/ui/core/tool/tool.js +127 -163
- package/dist/components/ui/core/tooltip/tooltip.js +47 -86
- package/dist/components/ui/core/topbar/topbar.js +106 -190
- package/dist/eslint/index.js +5 -10
- package/dist/eslint/no-overriding-styles.js +178 -237
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/highlight-code.d.ts +9 -0
- package/dist/lib/highlight-code.js +42 -0
- package/dist/lib/portal-container-context.js +8 -9
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/use-controllable-state.js +21 -30
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +32 -112
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +26 -0
- package/package.json +42 -8
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +0 -119
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +0 -93
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +0 -52
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar-header → calendar}/calendar-header.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/utils → calendar}/calendar-utils.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.d.ts +0 -0
|
@@ -1,544 +1,318 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}) =>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}) => {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
},
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
components: a,
|
|
303
|
-
plugins: o,
|
|
304
|
-
controls: r,
|
|
305
|
-
...s
|
|
306
|
-
}) => /* @__PURE__ */ t(
|
|
307
|
-
R,
|
|
308
|
-
{
|
|
309
|
-
"data-slot": "message-response",
|
|
310
|
-
className: c(
|
|
311
|
-
"size-full",
|
|
312
|
-
// Blockquote paragraph overrides
|
|
313
|
-
"[&_blockquote_p]:text-sm",
|
|
314
|
-
"[&_blockquote_p]:tracking-tight",
|
|
315
|
-
// Inline code
|
|
316
|
-
"[&_code]:relative",
|
|
317
|
-
"[&_code]:rounded",
|
|
318
|
-
"[&_code]:bg-muted-background",
|
|
319
|
-
"[&_code]:px-[0.3rem]",
|
|
320
|
-
"[&_code]:py-[0.2rem]",
|
|
321
|
-
"[&_code]:font-mono",
|
|
322
|
-
"[&_code]:text-sm",
|
|
323
|
-
"[&_code]:font-semibold",
|
|
324
|
-
// Code blocks (Streamdown container)
|
|
325
|
-
'[&_div[data-streamdown="code-block"]]:my-4',
|
|
326
|
-
'[&_div[data-streamdown="code-block"]]:w-full',
|
|
327
|
-
'[&_div[data-streamdown="code-block"]]:overflow-hidden',
|
|
328
|
-
'[&_div[data-streamdown="code-block"]]:rounded-xl',
|
|
329
|
-
'[&_div[data-streamdown="code-block"]]:border',
|
|
330
|
-
'[&_div[data-streamdown="code-block"]]:border-border',
|
|
331
|
-
// Code block header
|
|
332
|
-
'[&_div[data-streamdown="code-block-header"]]:flex',
|
|
333
|
-
'[&_div[data-streamdown="code-block-header"]]:items-center',
|
|
334
|
-
'[&_div[data-streamdown="code-block-header"]]:justify-between',
|
|
335
|
-
'[&_div[data-streamdown="code-block-header"]]:bg-muted-background/80',
|
|
336
|
-
'[&_div[data-streamdown="code-block-header"]]:px-4',
|
|
337
|
-
'[&_div[data-streamdown="code-block-header"]]:py-3',
|
|
338
|
-
'[&_div[data-streamdown="code-block-header"]]:text-xs',
|
|
339
|
-
'[&_div[data-streamdown="code-block-header"]]:text-muted-foreground',
|
|
340
|
-
// Pre element inside code block
|
|
341
|
-
'[&_div[data-streamdown="code-block"]_pre]:m-0',
|
|
342
|
-
'[&_div[data-streamdown="code-block"]_pre]:overflow-x-auto',
|
|
343
|
-
'[&_div[data-streamdown="code-block"]_pre]:border-t',
|
|
344
|
-
'[&_div[data-streamdown="code-block"]_pre]:border-border',
|
|
345
|
-
'[&_div[data-streamdown="code-block"]_pre]:bg-background!',
|
|
346
|
-
'[&_div[data-streamdown="code-block"]_pre]:p-4',
|
|
347
|
-
'[&_div[data-streamdown="code-block"]_pre]:text-sm',
|
|
348
|
-
'[&_div[data-streamdown="code-block"]_pre]:text-foreground!',
|
|
349
|
-
// Code element inside pre
|
|
350
|
-
'[&_div[data-streamdown="code-block"]_pre_code]:static',
|
|
351
|
-
'[&_div[data-streamdown="code-block"]_pre_code]:rounded-none',
|
|
352
|
-
'[&_div[data-streamdown="code-block"]_pre_code]:bg-transparent',
|
|
353
|
-
'[&_div[data-streamdown="code-block"]_pre_code]:p-0',
|
|
354
|
-
'[&_div[data-streamdown="code-block"]_pre_code]:font-mono',
|
|
355
|
-
'[&_div[data-streamdown="code-block"]_pre_code]:text-sm',
|
|
356
|
-
'[&_div[data-streamdown="code-block"]_pre_code]:font-normal',
|
|
357
|
-
// Code block buttons
|
|
358
|
-
'[&_button[data-streamdown="code-block-copy-button"]]:cursor-pointer',
|
|
359
|
-
'[&_button[data-streamdown="code-block-copy-button"]]:p-1',
|
|
360
|
-
'[&_button[data-streamdown="code-block-copy-button"]]:text-muted-foreground',
|
|
361
|
-
'[&_button[data-streamdown="code-block-copy-button"]]:transition-all',
|
|
362
|
-
'[&_button[data-streamdown="code-block-copy-button"]]:hover:text-foreground',
|
|
363
|
-
'[&_button[data-streamdown="code-block-download-button"]]:cursor-pointer',
|
|
364
|
-
'[&_button[data-streamdown="code-block-download-button"]]:p-1',
|
|
365
|
-
'[&_button[data-streamdown="code-block-download-button"]]:text-muted-foreground',
|
|
366
|
-
'[&_button[data-streamdown="code-block-download-button"]]:transition-all',
|
|
367
|
-
'[&_button[data-streamdown="code-block-download-button"]]:hover:text-foreground',
|
|
368
|
-
// Regular pre blocks (not in Streamdown code blocks)
|
|
369
|
-
"[&_pre:not([data-streamdown])]:my-3",
|
|
370
|
-
"[&_pre:not([data-streamdown])]:mx-0",
|
|
371
|
-
"[&_pre:not([data-streamdown])]:overflow-x-auto",
|
|
372
|
-
"[&_pre:not([data-streamdown])]:rounded-md",
|
|
373
|
-
"[&_pre:not([data-streamdown])]:border",
|
|
374
|
-
"[&_pre:not([data-streamdown])]:bg-card-background",
|
|
375
|
-
"[&_pre:not([data-streamdown])]:p-4",
|
|
376
|
-
"[&_pre:not([data-streamdown])]:text-foreground",
|
|
377
|
-
"[&_pre:not([data-streamdown])]:text-sm",
|
|
378
|
-
"[&_pre:not([data-streamdown])_code]:static",
|
|
379
|
-
"[&_pre:not([data-streamdown])_code]:rounded-none",
|
|
380
|
-
"[&_pre:not([data-streamdown])_code]:bg-transparent",
|
|
381
|
-
"[&_pre:not([data-streamdown])_code]:px-0",
|
|
382
|
-
"[&_pre:not([data-streamdown])_code]:py-0",
|
|
383
|
-
"[&_pre:not([data-streamdown])_code]:font-mono",
|
|
384
|
-
"[&_pre:not([data-streamdown])_code]:text-sm",
|
|
385
|
-
"[&_pre:not([data-streamdown])_code]:font-normal",
|
|
386
|
-
// Mermaid diagram blocks
|
|
387
|
-
'[&_div[data-streamdown="mermaid-block"]]:bg-card-background',
|
|
388
|
-
'[&_div[data-streamdown="mermaid-block"]]:text-foreground',
|
|
389
|
-
'[&_div[data-streamdown="mermaid-block"]]:flex',
|
|
390
|
-
'[&_div[data-streamdown="mermaid-block"]]:flex-col',
|
|
391
|
-
'[&_div[data-streamdown="mermaid-block"]]:rounded-lg',
|
|
392
|
-
'[&_div[data-streamdown="mermaid-block"]]:hover:bg-accent-background',
|
|
393
|
-
'[&_div[data-streamdown="mermaid-block"]]:border-0',
|
|
394
|
-
// Positioning context for the action strip (see below)
|
|
395
|
-
'[&_div[data-streamdown="mermaid-block"]]:relative',
|
|
396
|
-
// Nested scroll + sticky + pointer-events breaks hit-testing on Mermaid Copy/Download
|
|
397
|
-
// (same class of issue as github.com/vercel/streamdown/issues/494). Force absolute strip.
|
|
398
|
-
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!absolute',
|
|
399
|
-
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!top-2',
|
|
400
|
-
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!right-2',
|
|
401
|
-
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!z-10',
|
|
402
|
-
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!mt-0',
|
|
403
|
-
'[&_div[data-streamdown="mermaid-block"]>div:has([data-streamdown="mermaid-block-actions"])]:!pointer-events-auto',
|
|
404
|
-
// Ensure mermaid container is tall enough for the toolbar (pan/zoom + actions)
|
|
405
|
-
'[&_div[data-streamdown="mermaid-block"]_.relative.w-full]:!min-h-28',
|
|
406
|
-
// First and last child margin resets
|
|
407
|
-
"[&>*:first-child]:mt-0",
|
|
408
|
-
"[&>*:last-child]:mb-0",
|
|
409
|
-
e
|
|
410
|
-
),
|
|
411
|
-
components: { ...V, ...a },
|
|
412
|
-
controls: r ?? W,
|
|
413
|
-
plugins: { ...o, mermaid: I },
|
|
414
|
-
...s
|
|
415
|
-
}
|
|
416
|
-
),
|
|
417
|
-
(e, a) => e.children === a.children
|
|
418
|
-
);
|
|
419
|
-
X.displayName = "MessageResponse";
|
|
420
|
-
function pe({
|
|
421
|
-
data: e,
|
|
422
|
-
className: a,
|
|
423
|
-
onRemove: o,
|
|
424
|
-
...r
|
|
425
|
-
}) {
|
|
426
|
-
const s = e.filename || "", d = (e.mediaType?.startsWith("image/") && e.url ? "image" : "file") === "image", m = s || (d ? "Image" : "Attachment");
|
|
427
|
-
return /* @__PURE__ */ t(
|
|
428
|
-
"div",
|
|
429
|
-
{
|
|
430
|
-
"data-slot": "message-attachment",
|
|
431
|
-
className: c(
|
|
432
|
-
"group relative size-24 overflow-hidden rounded-lg",
|
|
433
|
-
a
|
|
434
|
-
),
|
|
435
|
-
...r,
|
|
436
|
-
children: d ? /* @__PURE__ */ l(h, { children: [
|
|
437
|
-
/* @__PURE__ */ t(
|
|
438
|
-
"img",
|
|
439
|
-
{
|
|
440
|
-
alt: s || "attachment",
|
|
441
|
-
className: "size-full object-cover",
|
|
442
|
-
height: 100,
|
|
443
|
-
src: e.url,
|
|
444
|
-
width: 100
|
|
445
|
-
}
|
|
446
|
-
),
|
|
447
|
-
o && /* @__PURE__ */ l(
|
|
448
|
-
g,
|
|
449
|
-
{
|
|
450
|
-
"aria-label": "Remove attachment",
|
|
451
|
-
className: "absolute top-2 right-2 size-6 rounded-full bg-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-background group-hover:opacity-100 [&>svg]:size-3",
|
|
452
|
-
onClick: (i) => {
|
|
453
|
-
i.stopPropagation(), o();
|
|
454
|
-
},
|
|
455
|
-
type: "button",
|
|
456
|
-
variant: "ghost",
|
|
457
|
-
children: [
|
|
458
|
-
/* @__PURE__ */ t(f, {}),
|
|
459
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children: "Remove" })
|
|
460
|
-
]
|
|
461
|
-
}
|
|
462
|
-
)
|
|
463
|
-
] }) : /* @__PURE__ */ l(h, { children: [
|
|
464
|
-
/* @__PURE__ */ l(x, { children: [
|
|
465
|
-
/* @__PURE__ */ t(
|
|
466
|
-
N,
|
|
467
|
-
{
|
|
468
|
-
render: /* @__PURE__ */ t("div", { className: "flex size-full shrink-0 items-center justify-center rounded-lg bg-muted-background text-muted-foreground", children: /* @__PURE__ */ t(P, { className: "size-4" }) })
|
|
469
|
-
}
|
|
470
|
-
),
|
|
471
|
-
/* @__PURE__ */ t(y, { children: /* @__PURE__ */ t("p", { children: m }) })
|
|
472
|
-
] }),
|
|
473
|
-
o && /* @__PURE__ */ l(
|
|
474
|
-
g,
|
|
475
|
-
{
|
|
476
|
-
"aria-label": "Remove attachment",
|
|
477
|
-
className: "size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-accent-background group-hover:opacity-100 [&>svg]:size-3",
|
|
478
|
-
onClick: (i) => {
|
|
479
|
-
i.stopPropagation(), o();
|
|
480
|
-
},
|
|
481
|
-
type: "button",
|
|
482
|
-
variant: "ghost",
|
|
483
|
-
children: [
|
|
484
|
-
/* @__PURE__ */ t(f, {}),
|
|
485
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children: "Remove" })
|
|
486
|
-
]
|
|
487
|
-
}
|
|
488
|
-
)
|
|
489
|
-
] })
|
|
490
|
-
}
|
|
491
|
-
);
|
|
1
|
+
import { cn as e, getInitials as t } from "../../../../lib/utils.js";
|
|
2
|
+
import { Button as n } from "../button/button.js";
|
|
3
|
+
import { Tooltip as r, TooltipContent as i, TooltipTrigger as a } from "../tooltip/tooltip.js";
|
|
4
|
+
import { ButtonGroup as o, ButtonGroupText as s } from "../button-group/button-group.js";
|
|
5
|
+
import { Avatar as c, AvatarFallback as l, AvatarIcon as u, AvatarImage as d } from "../avatar/avatar.js";
|
|
6
|
+
import { MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS as f } from "./message-response-default-streamdown-controls.js";
|
|
7
|
+
import { createContext as p, useCallback as m, useContext as h, useEffect as g, useMemo as _, useState as v } from "react";
|
|
8
|
+
import { IconChevronLeft as y, IconChevronRight as b, IconPaperclip as x, IconX as S } from "@tabler/icons-react";
|
|
9
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
10
|
+
import { mermaid as E } from "@streamdown/mermaid";
|
|
11
|
+
import { Streamdown as D } from "streamdown";
|
|
12
|
+
//#region libs/aura/src/components/ui/core/message/message.tsx
|
|
13
|
+
var O = ({ className: t, isResponse: n = !1, ...r }) => /* @__PURE__ */ w("div", {
|
|
14
|
+
"data-slot": "message",
|
|
15
|
+
className: e("group flex w-full items-start justify-start gap-3 mb-0 py-3", n ? "is-assistant items-start" : "is-user flex-row-reverse", t),
|
|
16
|
+
...r
|
|
17
|
+
}), k = ({ children: t, className: n, ...r }) => /* @__PURE__ */ w("div", {
|
|
18
|
+
"data-slot": "message-content",
|
|
19
|
+
className: e("is-user:dark flex flex-col gap-4 rounded-md text-base leading-tight tracking-tightest", "max-w-4/5", "group-[.is-user]:overflow-hidden group-[.is-user]:bg-accent-background group-[.is-user]:p-2 group-[.is-user]:text-foreground", "group-[.is-assistant]:text-foreground group-[.is-assistant]:pt-1", n),
|
|
20
|
+
...r,
|
|
21
|
+
children: t
|
|
22
|
+
}), A = ({ avatarUrl: n, name: r, className: i, children: a, variant: o, sizes: s, ...u }) => {
|
|
23
|
+
let f = r ? t(r) : "ME";
|
|
24
|
+
return /* @__PURE__ */ w(c, {
|
|
25
|
+
"data-slot": "message-avatar",
|
|
26
|
+
className: e("size-7 group-[.is-user]:mt-1", i),
|
|
27
|
+
variant: o,
|
|
28
|
+
sizes: s,
|
|
29
|
+
...u,
|
|
30
|
+
children: a || /* @__PURE__ */ T(C, { children: [n && /* @__PURE__ */ w(d, {
|
|
31
|
+
alt: r || "",
|
|
32
|
+
className: "mt-0 mb-0",
|
|
33
|
+
src: n
|
|
34
|
+
}), /* @__PURE__ */ w(l, { children: f })] })
|
|
35
|
+
});
|
|
36
|
+
}, j = (e) => /* @__PURE__ */ w(u, {
|
|
37
|
+
"data-slot": "message-avatar-icon",
|
|
38
|
+
...e
|
|
39
|
+
}), M = ({ className: t, children: n, ...r }) => /* @__PURE__ */ w("div", {
|
|
40
|
+
"data-slot": "message-actions",
|
|
41
|
+
className: e("flex items-center gap-2 pt-2", t),
|
|
42
|
+
...r,
|
|
43
|
+
children: n
|
|
44
|
+
}), N = ({ tooltip: t, children: o, label: s, className: c, variant: l = "ghost", size: u = "sm", ...d }) => {
|
|
45
|
+
let f = /* @__PURE__ */ T(n, {
|
|
46
|
+
"data-slot": "message-action",
|
|
47
|
+
className: e("relative icon-sm text-muted-foreground hover:text-foreground", c),
|
|
48
|
+
size: u,
|
|
49
|
+
type: "button",
|
|
50
|
+
variant: l,
|
|
51
|
+
...d,
|
|
52
|
+
children: [o, /* @__PURE__ */ w("span", {
|
|
53
|
+
className: "sr-only",
|
|
54
|
+
children: s || t
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
return t ? /* @__PURE__ */ T(r, { children: [/* @__PURE__ */ w(a, { render: f }), /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w("p", { children: t }) })] }) : f;
|
|
58
|
+
}, P = p(null), F = () => {
|
|
59
|
+
let e = h(P);
|
|
60
|
+
if (!e) throw Error("MessageBranch components must be used within MessageBranch");
|
|
61
|
+
return e;
|
|
62
|
+
}, I = ({ defaultBranch: t = 0, onBranchChange: n, className: r, ...i }) => {
|
|
63
|
+
let [a, o] = v(t), [s, c] = v([]), l = m(() => {
|
|
64
|
+
o((e) => {
|
|
65
|
+
let t = e > 0 ? e - 1 : s.length - 1;
|
|
66
|
+
return n?.(t), t;
|
|
67
|
+
});
|
|
68
|
+
}, [s.length, n]), u = m(() => {
|
|
69
|
+
o((e) => {
|
|
70
|
+
let t = e < s.length - 1 ? e + 1 : 0;
|
|
71
|
+
return n?.(t), t;
|
|
72
|
+
});
|
|
73
|
+
}, [s.length, n]), d = _(() => ({
|
|
74
|
+
currentBranch: a,
|
|
75
|
+
totalBranches: s.length,
|
|
76
|
+
goToPrevious: l,
|
|
77
|
+
goToNext: u,
|
|
78
|
+
branches: s,
|
|
79
|
+
setBranches: c
|
|
80
|
+
}), [
|
|
81
|
+
a,
|
|
82
|
+
s,
|
|
83
|
+
l,
|
|
84
|
+
u,
|
|
85
|
+
c
|
|
86
|
+
]);
|
|
87
|
+
return /* @__PURE__ */ w(P.Provider, {
|
|
88
|
+
value: d,
|
|
89
|
+
children: /* @__PURE__ */ w("div", {
|
|
90
|
+
"data-slot": "message-branch",
|
|
91
|
+
className: e("grid w-full gap-2 [&>div]:pb-0", r),
|
|
92
|
+
...i
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}, L = ({ children: t, ...n }) => {
|
|
96
|
+
let { currentBranch: r, setBranches: i, branches: a } = F(), o = _(() => Array.isArray(t) ? t : [t], [t]);
|
|
97
|
+
return g(() => {
|
|
98
|
+
a.length !== o.length && i(o);
|
|
99
|
+
}, [
|
|
100
|
+
o,
|
|
101
|
+
a,
|
|
102
|
+
i
|
|
103
|
+
]), o.map((t, i) => /* @__PURE__ */ w("div", {
|
|
104
|
+
"data-slot": "message-branch-content",
|
|
105
|
+
className: e("grid gap-2 overflow-hidden [&>div]:pb-0", i === r ? "block" : "hidden"),
|
|
106
|
+
...n,
|
|
107
|
+
children: t
|
|
108
|
+
}, t.key));
|
|
109
|
+
}, R = ({ ...e }) => {
|
|
110
|
+
let { totalBranches: t } = F();
|
|
111
|
+
return t <= 1 ? null : /* @__PURE__ */ w(o, {
|
|
112
|
+
"data-slot": "message-branch-selector",
|
|
113
|
+
className: "[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md",
|
|
114
|
+
orientation: "horizontal",
|
|
115
|
+
...e
|
|
116
|
+
});
|
|
117
|
+
}, z = ({ children: e, ...t }) => {
|
|
118
|
+
let { goToPrevious: r, totalBranches: i } = F();
|
|
119
|
+
return /* @__PURE__ */ w(n, {
|
|
120
|
+
"data-slot": "message-branch-previous",
|
|
121
|
+
"aria-label": "Previous branch",
|
|
122
|
+
disabled: i <= 1,
|
|
123
|
+
onClick: r,
|
|
124
|
+
size: "icon-sm",
|
|
125
|
+
type: "button",
|
|
126
|
+
variant: "ghost",
|
|
127
|
+
...t,
|
|
128
|
+
children: e ?? /* @__PURE__ */ w(y, { size: 14 })
|
|
129
|
+
});
|
|
130
|
+
}, B = ({ children: e, ...t }) => {
|
|
131
|
+
let { goToNext: r, totalBranches: i } = F();
|
|
132
|
+
return /* @__PURE__ */ w(n, {
|
|
133
|
+
"data-slot": "message-branch-next",
|
|
134
|
+
"aria-label": "Next branch",
|
|
135
|
+
disabled: i <= 1,
|
|
136
|
+
onClick: r,
|
|
137
|
+
size: "icon-sm",
|
|
138
|
+
type: "button",
|
|
139
|
+
variant: "ghost",
|
|
140
|
+
...t,
|
|
141
|
+
children: e ?? /* @__PURE__ */ w(b, { size: 14 })
|
|
142
|
+
});
|
|
143
|
+
}, V = ({ className: t, ...n }) => {
|
|
144
|
+
let { currentBranch: r, totalBranches: i } = F();
|
|
145
|
+
return /* @__PURE__ */ T(s, {
|
|
146
|
+
"data-slot": "message-branch-page",
|
|
147
|
+
className: e("border-none bg-transparent text-muted-foreground shadow-none px-2", t),
|
|
148
|
+
...n,
|
|
149
|
+
children: [
|
|
150
|
+
r + 1,
|
|
151
|
+
"/",
|
|
152
|
+
i
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
}, H = {
|
|
156
|
+
h1: ({ children: e }) => /* @__PURE__ */ w("h1", {
|
|
157
|
+
className: "mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest",
|
|
158
|
+
children: e
|
|
159
|
+
}),
|
|
160
|
+
h2: ({ children: e }) => /* @__PURE__ */ w("h2", {
|
|
161
|
+
className: "mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest",
|
|
162
|
+
children: e
|
|
163
|
+
}),
|
|
164
|
+
h3: ({ children: e }) => /* @__PURE__ */ w("h3", {
|
|
165
|
+
className: "mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter",
|
|
166
|
+
children: e
|
|
167
|
+
}),
|
|
168
|
+
h4: ({ children: e }) => /* @__PURE__ */ w("h4", {
|
|
169
|
+
className: "mt-2 mb-0 scroll-m-20 text-sm font-medium tracking-normal",
|
|
170
|
+
children: e
|
|
171
|
+
}),
|
|
172
|
+
h5: ({ children: e }) => /* @__PURE__ */ w("h5", {
|
|
173
|
+
className: "mt-0 mb-0 scroll-m-20 text-xs font-medium tracking-tighter",
|
|
174
|
+
children: e
|
|
175
|
+
}),
|
|
176
|
+
h6: ({ children: e }) => /* @__PURE__ */ w("h6", {
|
|
177
|
+
className: "mt-0 mb-0 scroll-m-20 text-2xs font-medium tracking-tighter",
|
|
178
|
+
children: e
|
|
179
|
+
}),
|
|
180
|
+
p: ({ children: e }) => /* @__PURE__ */ w("p", {
|
|
181
|
+
className: "mt-2 mb-3 text-base font-normal leading-5 tracking-tightest",
|
|
182
|
+
children: e
|
|
183
|
+
}),
|
|
184
|
+
strong: ({ children: e }) => /* @__PURE__ */ w("strong", {
|
|
185
|
+
className: "font-medium",
|
|
186
|
+
children: e
|
|
187
|
+
}),
|
|
188
|
+
em: ({ children: e }) => /* @__PURE__ */ w("em", {
|
|
189
|
+
className: "italic",
|
|
190
|
+
children: e
|
|
191
|
+
}),
|
|
192
|
+
b: ({ children: e }) => /* @__PURE__ */ w("b", {
|
|
193
|
+
className: "font-medium",
|
|
194
|
+
children: e
|
|
195
|
+
}),
|
|
196
|
+
i: ({ children: e }) => /* @__PURE__ */ w("i", {
|
|
197
|
+
className: "italic",
|
|
198
|
+
children: e
|
|
199
|
+
}),
|
|
200
|
+
ul: ({ children: e }) => /* @__PURE__ */ w("ul", {
|
|
201
|
+
className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-disc text-base font-normal tracking-tightest",
|
|
202
|
+
children: e
|
|
203
|
+
}),
|
|
204
|
+
ol: ({ children: e }) => /* @__PURE__ */ w("ol", {
|
|
205
|
+
className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-decimal text-base font-normal tracking-tightest",
|
|
206
|
+
children: e
|
|
207
|
+
}),
|
|
208
|
+
li: ({ children: e }) => /* @__PURE__ */ w("li", {
|
|
209
|
+
className: "py-0",
|
|
210
|
+
children: e
|
|
211
|
+
}),
|
|
212
|
+
blockquote: ({ children: e }) => /* @__PURE__ */ w("blockquote", {
|
|
213
|
+
className: "my-3 pr-2 pl-2 border-l border-l-border text-sm text-muted-foreground font-normal tracking-tight not-italic",
|
|
214
|
+
children: e
|
|
215
|
+
}),
|
|
216
|
+
hr: () => /* @__PURE__ */ w("hr", { className: "my-4 border-border" }),
|
|
217
|
+
a: ({ children: e, href: t, ...n }) => /* @__PURE__ */ w("a", {
|
|
218
|
+
className: "text-link-foreground no-underline hover:underline underline-offset-4",
|
|
219
|
+
href: t,
|
|
220
|
+
...n,
|
|
221
|
+
children: e
|
|
222
|
+
}),
|
|
223
|
+
table: ({ children: e }) => /* @__PURE__ */ w("div", {
|
|
224
|
+
className: "my-6 overflow-x-auto",
|
|
225
|
+
tabIndex: 0,
|
|
226
|
+
role: "group",
|
|
227
|
+
"aria-label": "Atlas AI Chat Table",
|
|
228
|
+
children: /* @__PURE__ */ w("table", {
|
|
229
|
+
className: "w-full",
|
|
230
|
+
children: e
|
|
231
|
+
})
|
|
232
|
+
}),
|
|
233
|
+
thead: ({ children: e }) => /* @__PURE__ */ w("thead", { children: e }),
|
|
234
|
+
tbody: ({ children: e }) => /* @__PURE__ */ w("tbody", { children: e }),
|
|
235
|
+
tr: ({ children: e }) => /* @__PURE__ */ w("tr", {
|
|
236
|
+
className: "m-0 border-t p-0 even:bg-muted-background",
|
|
237
|
+
children: e
|
|
238
|
+
}),
|
|
239
|
+
th: ({ children: e }) => /* @__PURE__ */ w("th", {
|
|
240
|
+
className: "border px-4 py-2 text-left font-bold",
|
|
241
|
+
children: e
|
|
242
|
+
}),
|
|
243
|
+
td: ({ children: e }) => /* @__PURE__ */ w("td", {
|
|
244
|
+
className: "border px-4 py-2 text-left",
|
|
245
|
+
children: e
|
|
246
|
+
})
|
|
247
|
+
}, U = ({ className: t, components: n, plugins: r, controls: i, ...a }) => /* @__PURE__ */ w(D, {
|
|
248
|
+
"data-slot": "message-response",
|
|
249
|
+
className: e("size-full", "[&_blockquote_p]:text-sm", "[&_blockquote_p]:tracking-tight", "[&_code]:relative", "[&_code]:rounded", "[&_code]:bg-muted-background", "[&_code]:px-[0.3rem]", "[&_code]:py-[0.2rem]", "[&_code]:font-mono", "[&_code]:text-sm", "[&_code]:font-semibold", "[&_div[data-streamdown=\"code-block\"]]:my-4", "[&_div[data-streamdown=\"code-block\"]]:w-full", "[&_div[data-streamdown=\"code-block\"]]:overflow-hidden", "[&_div[data-streamdown=\"code-block\"]]:rounded-xl", "[&_div[data-streamdown=\"code-block\"]]:border", "[&_div[data-streamdown=\"code-block\"]]:border-border", "[&_div[data-streamdown=\"code-block-header\"]]:flex", "[&_div[data-streamdown=\"code-block-header\"]]:items-center", "[&_div[data-streamdown=\"code-block-header\"]]:justify-between", "[&_div[data-streamdown=\"code-block-header\"]]:bg-muted-background/80", "[&_div[data-streamdown=\"code-block-header\"]]:px-4", "[&_div[data-streamdown=\"code-block-header\"]]:py-3", "[&_div[data-streamdown=\"code-block-header\"]]:text-xs", "[&_div[data-streamdown=\"code-block-header\"]]:text-muted-foreground", "[&_div[data-streamdown=\"code-block\"]_pre]:m-0", "[&_div[data-streamdown=\"code-block\"]_pre]:overflow-x-auto", "[&_div[data-streamdown=\"code-block\"]_pre]:border-t", "[&_div[data-streamdown=\"code-block\"]_pre]:border-border", "[&_div[data-streamdown=\"code-block\"]_pre]:bg-background!", "[&_div[data-streamdown=\"code-block\"]_pre]:p-4", "[&_div[data-streamdown=\"code-block\"]_pre]:text-sm", "[&_div[data-streamdown=\"code-block\"]_pre]:text-foreground!", "[&_div[data-streamdown=\"code-block\"]_pre_code]:static", "[&_div[data-streamdown=\"code-block\"]_pre_code]:rounded-none", "[&_div[data-streamdown=\"code-block\"]_pre_code]:bg-transparent", "[&_div[data-streamdown=\"code-block\"]_pre_code]:p-0", "[&_div[data-streamdown=\"code-block\"]_pre_code]:font-mono", "[&_div[data-streamdown=\"code-block\"]_pre_code]:text-sm", "[&_div[data-streamdown=\"code-block\"]_pre_code]:font-normal", "[&_button[data-streamdown=\"code-block-copy-button\"]]:cursor-pointer", "[&_button[data-streamdown=\"code-block-copy-button\"]]:p-1", "[&_button[data-streamdown=\"code-block-copy-button\"]]:text-muted-foreground", "[&_button[data-streamdown=\"code-block-copy-button\"]]:transition-all", "[&_button[data-streamdown=\"code-block-copy-button\"]]:hover:text-foreground", "[&_button[data-streamdown=\"code-block-download-button\"]]:cursor-pointer", "[&_button[data-streamdown=\"code-block-download-button\"]]:p-1", "[&_button[data-streamdown=\"code-block-download-button\"]]:text-muted-foreground", "[&_button[data-streamdown=\"code-block-download-button\"]]:transition-all", "[&_button[data-streamdown=\"code-block-download-button\"]]:hover:text-foreground", "[&_pre:not([data-streamdown])]:my-3", "[&_pre:not([data-streamdown])]:mx-0", "[&_pre:not([data-streamdown])]:overflow-x-auto", "[&_pre:not([data-streamdown])]:rounded-md", "[&_pre:not([data-streamdown])]:border", "[&_pre:not([data-streamdown])]:bg-card-background", "[&_pre:not([data-streamdown])]:p-4", "[&_pre:not([data-streamdown])]:text-foreground", "[&_pre:not([data-streamdown])]:text-sm", "[&_pre:not([data-streamdown])_code]:static", "[&_pre:not([data-streamdown])_code]:rounded-none", "[&_pre:not([data-streamdown])_code]:bg-transparent", "[&_pre:not([data-streamdown])_code]:px-0", "[&_pre:not([data-streamdown])_code]:py-0", "[&_pre:not([data-streamdown])_code]:font-mono", "[&_pre:not([data-streamdown])_code]:text-sm", "[&_pre:not([data-streamdown])_code]:font-normal", "[&_div[data-streamdown=\"mermaid-block\"]]:bg-card-background", "[&_div[data-streamdown=\"mermaid-block\"]]:text-foreground", "[&_div[data-streamdown=\"mermaid-block\"]]:flex", "[&_div[data-streamdown=\"mermaid-block\"]]:flex-col", "[&_div[data-streamdown=\"mermaid-block\"]]:rounded-lg", "[&_div[data-streamdown=\"mermaid-block\"]]:hover:bg-accent-background", "[&_div[data-streamdown=\"mermaid-block\"]]:border-0", "[&_div[data-streamdown=\"mermaid-block\"]]:relative", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!absolute", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!top-2", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!right-2", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!z-10", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!mt-0", "[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!pointer-events-auto", "[&_div[data-streamdown=\"mermaid-block\"]_.relative.w-full]:!min-h-28", "[&>*:first-child]:mt-0", "[&>*:last-child]:mb-0", t),
|
|
250
|
+
components: {
|
|
251
|
+
...H,
|
|
252
|
+
...n
|
|
253
|
+
},
|
|
254
|
+
controls: i ?? f,
|
|
255
|
+
plugins: {
|
|
256
|
+
...r,
|
|
257
|
+
mermaid: E
|
|
258
|
+
},
|
|
259
|
+
...a
|
|
260
|
+
});
|
|
261
|
+
function W({ data: t, className: o, onRemove: s, ...c }) {
|
|
262
|
+
let l = t.filename || "", u = (t.mediaType?.startsWith("image/") && t.url ? "image" : "file") == "image", d = l || (u ? "Image" : "Attachment");
|
|
263
|
+
return /* @__PURE__ */ w("div", {
|
|
264
|
+
"data-slot": "message-attachment",
|
|
265
|
+
className: e("group relative size-24 overflow-hidden rounded-lg", o),
|
|
266
|
+
...c,
|
|
267
|
+
children: u ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("img", {
|
|
268
|
+
alt: l || "attachment",
|
|
269
|
+
className: "size-full object-cover",
|
|
270
|
+
height: 100,
|
|
271
|
+
src: t.url,
|
|
272
|
+
width: 100
|
|
273
|
+
}), s && /* @__PURE__ */ T(n, {
|
|
274
|
+
"aria-label": "Remove attachment",
|
|
275
|
+
className: "absolute top-2 right-2 size-6 rounded-full bg-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-background group-hover:opacity-100 [&>svg]:size-3",
|
|
276
|
+
onClick: (e) => {
|
|
277
|
+
e.stopPropagation(), s();
|
|
278
|
+
},
|
|
279
|
+
type: "button",
|
|
280
|
+
variant: "ghost",
|
|
281
|
+
children: [/* @__PURE__ */ w(S, {}), /* @__PURE__ */ w("span", {
|
|
282
|
+
className: "sr-only",
|
|
283
|
+
children: "Remove"
|
|
284
|
+
})]
|
|
285
|
+
})] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T(r, { children: [/* @__PURE__ */ w(a, { render: /* @__PURE__ */ w("div", {
|
|
286
|
+
className: "flex size-full shrink-0 items-center justify-center rounded-lg bg-muted-background text-muted-foreground",
|
|
287
|
+
children: /* @__PURE__ */ w(x, { className: "size-4" })
|
|
288
|
+
}) }), /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w("p", { children: d }) })] }), s && /* @__PURE__ */ T(n, {
|
|
289
|
+
"aria-label": "Remove attachment",
|
|
290
|
+
className: "size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-accent-background group-hover:opacity-100 [&>svg]:size-3",
|
|
291
|
+
onClick: (e) => {
|
|
292
|
+
e.stopPropagation(), s();
|
|
293
|
+
},
|
|
294
|
+
type: "button",
|
|
295
|
+
variant: "ghost",
|
|
296
|
+
children: [/* @__PURE__ */ w(S, {}), /* @__PURE__ */ w("span", {
|
|
297
|
+
className: "sr-only",
|
|
298
|
+
children: "Remove"
|
|
299
|
+
})]
|
|
300
|
+
})] })
|
|
301
|
+
});
|
|
492
302
|
}
|
|
493
|
-
function
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
{
|
|
501
|
-
"data-slot": "message-attachments",
|
|
502
|
-
className: c(
|
|
503
|
-
"ml-auto flex w-fit flex-wrap items-start gap-2",
|
|
504
|
-
a
|
|
505
|
-
),
|
|
506
|
-
...o,
|
|
507
|
-
children: e
|
|
508
|
-
}
|
|
509
|
-
) : null;
|
|
303
|
+
function G({ children: t, className: n, ...r }) {
|
|
304
|
+
return t ? /* @__PURE__ */ w("div", {
|
|
305
|
+
"data-slot": "message-attachments",
|
|
306
|
+
className: e("ml-auto flex w-fit flex-wrap items-start gap-2", n),
|
|
307
|
+
...r,
|
|
308
|
+
children: t
|
|
309
|
+
}) : null;
|
|
510
310
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
className: c(
|
|
520
|
-
"mt-4 flex w-full items-center justify-between gap-4",
|
|
521
|
-
e
|
|
522
|
-
),
|
|
523
|
-
...o,
|
|
524
|
-
children: a
|
|
525
|
-
}
|
|
526
|
-
);
|
|
527
|
-
export {
|
|
528
|
-
oe as Message,
|
|
529
|
-
ce as MessageAction,
|
|
530
|
-
ne as MessageActions,
|
|
531
|
-
pe as MessageAttachment,
|
|
532
|
-
he as MessageAttachments,
|
|
533
|
-
de as MessageAvatar,
|
|
534
|
-
se as MessageAvatarIcon,
|
|
535
|
-
me as MessageBranch,
|
|
536
|
-
le as MessageBranchContent,
|
|
537
|
-
ue as MessageBranchNext,
|
|
538
|
-
ge as MessageBranchPage,
|
|
539
|
-
be as MessageBranchPrevious,
|
|
540
|
-
ie as MessageBranchSelector,
|
|
541
|
-
re as MessageContent,
|
|
542
|
-
X as MessageResponse,
|
|
543
|
-
_e as MessageToolbar
|
|
544
|
-
};
|
|
311
|
+
var K = ({ className: t, children: n, ...r }) => /* @__PURE__ */ w("div", {
|
|
312
|
+
"data-slot": "message-toolbar",
|
|
313
|
+
className: e("mt-4 flex w-full items-center justify-between gap-4", t),
|
|
314
|
+
...r,
|
|
315
|
+
children: n
|
|
316
|
+
});
|
|
317
|
+
//#endregion
|
|
318
|
+
export { O as Message, N as MessageAction, M as MessageActions, W as MessageAttachment, G as MessageAttachments, A as MessageAvatar, j as MessageAvatarIcon, I as MessageBranch, L as MessageBranchContent, B as MessageBranchNext, V as MessageBranchPage, z as MessageBranchPrevious, R as MessageBranchSelector, k as MessageContent, U as MessageResponse, K as MessageToolbar };
|