@uipath/apollo-wind 2.72.2 → 2.73.1
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/ui/alert-dialog.cjs +1 -1
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/attachment.cjs +40 -8
- package/dist/components/ui/attachment.d.ts +11 -1
- package/dist/components/ui/attachment.js +43 -11
- package/dist/components/ui/bubble.cjs +1 -1
- package/dist/components/ui/bubble.d.ts +6 -0
- package/dist/components/ui/bubble.js +1 -1
- package/dist/components/ui/chat-composer.cjs +8 -2
- package/dist/components/ui/chat-composer.d.ts +6 -0
- package/dist/components/ui/chat-composer.js +9 -3
- package/dist/components/ui/citation.cjs +5 -3
- package/dist/components/ui/citation.d.ts +6 -0
- package/dist/components/ui/citation.js +5 -3
- package/dist/components/ui/code-block.cjs +6 -6
- package/dist/components/ui/code-block.d.ts +6 -0
- package/dist/components/ui/code-block.js +6 -6
- package/dist/components/ui/context-menu.cjs +2 -2
- package/dist/components/ui/context-menu.js +2 -2
- package/dist/components/ui/dialog.cjs +18 -5
- package/dist/components/ui/dialog.d.ts +15 -0
- package/dist/components/ui/dialog.js +16 -6
- package/dist/components/ui/disclosure-tree.cjs +269 -0
- package/dist/components/ui/disclosure-tree.d.ts +45 -0
- package/dist/components/ui/disclosure-tree.js +235 -0
- package/dist/components/ui/dropdown-menu.cjs +2 -2
- package/dist/components/ui/dropdown-menu.js +2 -2
- package/dist/components/ui/dropzone-overlay.cjs +21 -5
- package/dist/components/ui/dropzone-overlay.d.ts +12 -1
- package/dist/components/ui/dropzone-overlay.js +21 -5
- package/dist/components/ui/empty-state.cjs +28 -10
- package/dist/components/ui/empty-state.d.ts +9 -0
- package/dist/components/ui/empty-state.js +30 -12
- package/dist/components/ui/hover-card.cjs +1 -1
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/index.cjs +221 -208
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/markdown.cjs +129 -22
- package/dist/components/ui/markdown.d.ts +23 -4
- package/dist/components/ui/markdown.js +129 -22
- package/dist/components/ui/message-actions.cjs +1 -1
- package/dist/components/ui/message-actions.d.ts +3 -0
- package/dist/components/ui/message-actions.js +1 -1
- package/dist/components/ui/message.cjs +4 -4
- package/dist/components/ui/message.d.ts +7 -0
- package/dist/components/ui/message.js +4 -4
- package/dist/components/ui/popover.cjs +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/search.cjs +16 -5
- package/dist/components/ui/search.d.ts +9 -0
- package/dist/components/ui/search.js +13 -5
- package/dist/components/ui/select.cjs +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/sheet.cjs +12 -2
- package/dist/components/ui/sheet.d.ts +7 -0
- package/dist/components/ui/sheet.js +10 -3
- package/dist/components/ui/sources.cjs +1 -1
- package/dist/components/ui/sources.d.ts +6 -0
- package/dist/components/ui/sources.js +1 -1
- package/dist/components/ui/thinking-indicator.cjs +5 -3
- package/dist/components/ui/thinking-indicator.d.ts +6 -0
- package/dist/components/ui/thinking-indicator.js +5 -3
- package/dist/components/ui/tool-call.cjs +10 -7
- package/dist/components/ui/tool-call.d.ts +6 -0
- package/dist/components/ui/tool-call.js +10 -7
- package/dist/components/ui/tooltip.cjs +1 -1
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/index.cjs +14 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.js +5 -4
- package/dist/lib/disclosure-row.cjs +36 -0
- package/dist/lib/disclosure-row.d.ts +1 -0
- package/dist/lib/disclosure-row.js +2 -0
- package/dist/lib/use-ancestor-density.cjs +65 -0
- package/dist/lib/use-ancestor-density.d.ts +8 -0
- package/dist/lib/use-ancestor-density.js +31 -0
- package/dist/styles.css +679 -52
- package/dist/tailwind.utilities.css +173 -0
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
|
37
37
|
const MessageGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
38
38
|
ref: ref,
|
|
39
39
|
"data-slot": "message-group",
|
|
40
|
-
className: (0, index_cjs_namespaceObject.cn)('flex min-w-0 flex-col gap-
|
|
40
|
+
className: (0, index_cjs_namespaceObject.cn)('flex min-w-0 flex-col gap-(--message-group-gap,0.5rem) in-data-[density=compact]:[--message-group-gap:0.25rem]', className),
|
|
41
41
|
...props
|
|
42
42
|
}));
|
|
43
43
|
MessageGroup.displayName = 'MessageGroup';
|
|
@@ -45,21 +45,21 @@ const Message = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ class
|
|
|
45
45
|
ref: ref,
|
|
46
46
|
"data-slot": "message",
|
|
47
47
|
"data-align": align,
|
|
48
|
-
className: (0, index_cjs_namespaceObject.cn)('group/message relative flex w-full min-w-0 gap-2 text-
|
|
48
|
+
className: (0, index_cjs_namespaceObject.cn)('group/message relative flex w-full min-w-0 gap-2 text-(length:--message-font-size,0.875rem) leading-(--message-leading,1.25rem) data-[align=end]:flex-row-reverse in-data-[density=compact]:[--message-font-size:0.75rem] in-data-[density=compact]:[--message-leading:1rem]', className),
|
|
49
49
|
...props
|
|
50
50
|
}));
|
|
51
51
|
Message.displayName = 'Message';
|
|
52
52
|
const MessageAvatar = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
53
53
|
ref: ref,
|
|
54
54
|
"data-slot": "message-avatar",
|
|
55
|
-
className: (0, index_cjs_namespaceObject.cn)('flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-[[data-slot=message-footer]]/message:-translate-y-8 group-has-[[data-slot=message-actions]]/message:-translate-y-10 group-has-[[data-slot=message-footer]]/message:group-has-[[data-slot=message-actions]]/message:-translate-y-16', className),
|
|
55
|
+
className: (0, index_cjs_namespaceObject.cn)('flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-[[data-slot=message-footer]]/message:-translate-y-8 group-has-[[data-slot=message-actions]]/message:-translate-y-10 group-has-[[data-slot=message-footer]]/message:group-has-[[data-slot=message-actions]]/message:-translate-y-16 in-data-[density=compact]:group-has-[[data-slot=message-footer]]/message:-translate-y-6.75 in-data-[density=compact]:group-has-[[data-slot=message-actions]]/message:-translate-y-8.75 in-data-[density=compact]:group-has-[[data-slot=message-footer]]/message:group-has-[[data-slot=message-actions]]/message:-translate-y-13.5', className),
|
|
56
56
|
...props
|
|
57
57
|
}));
|
|
58
58
|
MessageAvatar.displayName = 'MessageAvatar';
|
|
59
59
|
const MessageContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
60
60
|
ref: ref,
|
|
61
61
|
"data-slot": "message-content",
|
|
62
|
-
className: (0, index_cjs_namespaceObject.cn)('flex w-full min-w-0 flex-col gap-
|
|
62
|
+
className: (0, index_cjs_namespaceObject.cn)('flex w-full min-w-0 flex-col gap-(--message-content-gap,0.625rem) break-words group-data-[align=end]/message:*:self-end in-data-[density=compact]:[--message-content-gap:0.3125rem]', className),
|
|
63
63
|
...props
|
|
64
64
|
}));
|
|
65
65
|
MessageContent.displayName = 'MessageContent';
|
|
@@ -5,6 +5,13 @@ import * as React from 'react';
|
|
|
5
5
|
* (usually a `Bubble`) and a `MessageFooter`. `align="end"` mirrors the row for the current user.
|
|
6
6
|
* A `MessageActions` bar goes inside `MessageContent` after the body, so it takes the same
|
|
7
7
|
* alignment as the bubble.
|
|
8
|
+
*
|
|
9
|
+
* Compact density: inside an ancestor with `data-density="compact"` the text drops to 12px and
|
|
10
|
+
* the gaps between a group's messages and between a message's parts halve, as Material's
|
|
11
|
+
* `compactMode` does.
|
|
12
|
+
* There is no prop: the host opts in by setting the attribute (the Wind chat sets it on its root).
|
|
13
|
+
* Compact sets CSS variables the base classes read, so a host className on the root wins in
|
|
14
|
+
* both densities.
|
|
8
15
|
*/
|
|
9
16
|
declare const MessageGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
10
17
|
export interface MessageProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -4,7 +4,7 @@ import { cn } from "../../lib/index.js";
|
|
|
4
4
|
const MessageGroup = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
5
5
|
ref: ref,
|
|
6
6
|
"data-slot": "message-group",
|
|
7
|
-
className: cn('flex min-w-0 flex-col gap-
|
|
7
|
+
className: cn('flex min-w-0 flex-col gap-(--message-group-gap,0.5rem) in-data-[density=compact]:[--message-group-gap:0.25rem]', className),
|
|
8
8
|
...props
|
|
9
9
|
}));
|
|
10
10
|
MessageGroup.displayName = 'MessageGroup';
|
|
@@ -12,21 +12,21 @@ const Message = /*#__PURE__*/ forwardRef(({ className, align = 'start', ...props
|
|
|
12
12
|
ref: ref,
|
|
13
13
|
"data-slot": "message",
|
|
14
14
|
"data-align": align,
|
|
15
|
-
className: cn('group/message relative flex w-full min-w-0 gap-2 text-
|
|
15
|
+
className: cn('group/message relative flex w-full min-w-0 gap-2 text-(length:--message-font-size,0.875rem) leading-(--message-leading,1.25rem) data-[align=end]:flex-row-reverse in-data-[density=compact]:[--message-font-size:0.75rem] in-data-[density=compact]:[--message-leading:1rem]', className),
|
|
16
16
|
...props
|
|
17
17
|
}));
|
|
18
18
|
Message.displayName = 'Message';
|
|
19
19
|
const MessageAvatar = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
20
20
|
ref: ref,
|
|
21
21
|
"data-slot": "message-avatar",
|
|
22
|
-
className: cn('flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-[[data-slot=message-footer]]/message:-translate-y-8 group-has-[[data-slot=message-actions]]/message:-translate-y-10 group-has-[[data-slot=message-footer]]/message:group-has-[[data-slot=message-actions]]/message:-translate-y-16', className),
|
|
22
|
+
className: cn('flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-[[data-slot=message-footer]]/message:-translate-y-8 group-has-[[data-slot=message-actions]]/message:-translate-y-10 group-has-[[data-slot=message-footer]]/message:group-has-[[data-slot=message-actions]]/message:-translate-y-16 in-data-[density=compact]:group-has-[[data-slot=message-footer]]/message:-translate-y-6.75 in-data-[density=compact]:group-has-[[data-slot=message-actions]]/message:-translate-y-8.75 in-data-[density=compact]:group-has-[[data-slot=message-footer]]/message:group-has-[[data-slot=message-actions]]/message:-translate-y-13.5', className),
|
|
23
23
|
...props
|
|
24
24
|
}));
|
|
25
25
|
MessageAvatar.displayName = 'MessageAvatar';
|
|
26
26
|
const MessageContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
27
27
|
ref: ref,
|
|
28
28
|
"data-slot": "message-content",
|
|
29
|
-
className: cn('flex w-full min-w-0 flex-col gap-
|
|
29
|
+
className: cn('flex w-full min-w-0 flex-col gap-(--message-content-gap,0.625rem) break-words group-data-[align=end]/message:*:self-end in-data-[density=compact]:[--message-content-gap:0.3125rem]', className),
|
|
30
30
|
...props
|
|
31
31
|
}));
|
|
32
32
|
MessageContent.displayName = 'MessageContent';
|
|
@@ -83,7 +83,7 @@ const PopoverContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef((
|
|
|
83
83
|
"data-slot": "popover-content",
|
|
84
84
|
align: align,
|
|
85
85
|
sideOffset: sideOffset,
|
|
86
|
-
className: (0, index_cjs_namespaceObject.cn)('z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-
|
|
86
|
+
className: (0, index_cjs_namespaceObject.cn)('z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)', className),
|
|
87
87
|
...props,
|
|
88
88
|
onInteractOutside: handleInteractOutside
|
|
89
89
|
})
|
|
@@ -52,7 +52,7 @@ const PopoverContent = /*#__PURE__*/ forwardRef(({ className, align = 'center',
|
|
|
52
52
|
"data-slot": "popover-content",
|
|
53
53
|
align: align,
|
|
54
54
|
sideOffset: sideOffset,
|
|
55
|
-
className: cn('z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-
|
|
55
|
+
className: cn('z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)', className),
|
|
56
56
|
...props,
|
|
57
57
|
onInteractOutside: handleInteractOutside
|
|
58
58
|
})
|
|
@@ -24,8 +24,9 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
Search: ()=>Search,
|
|
27
28
|
SearchWithSuggestions: ()=>SearchWithSuggestions,
|
|
28
|
-
|
|
29
|
+
DEFAULT_SEARCH_STRINGS: ()=>DEFAULT_SEARCH_STRINGS
|
|
29
30
|
});
|
|
30
31
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
32
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
@@ -34,7 +35,14 @@ const external_command_cjs_namespaceObject = require("./command.cjs");
|
|
|
34
35
|
const external_input_group_cjs_namespaceObject = require("./input-group.cjs");
|
|
35
36
|
const external_popover_cjs_namespaceObject = require("./popover.cjs");
|
|
36
37
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
37
|
-
const
|
|
38
|
+
const DEFAULT_SEARCH_STRINGS = {
|
|
39
|
+
clear: 'Clear'
|
|
40
|
+
};
|
|
41
|
+
const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, error, errorId, strings, ...props }, ref)=>{
|
|
42
|
+
const text = {
|
|
43
|
+
...DEFAULT_SEARCH_STRINGS,
|
|
44
|
+
...strings
|
|
45
|
+
};
|
|
38
46
|
const handleClear = ()=>{
|
|
39
47
|
onChange?.('');
|
|
40
48
|
onClear?.();
|
|
@@ -65,7 +73,7 @@ const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ classN
|
|
|
65
73
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
|
|
66
74
|
icon: true,
|
|
67
75
|
size: "3xs",
|
|
68
|
-
"aria-label":
|
|
76
|
+
"aria-label": text.clear,
|
|
69
77
|
onClick: handleClear,
|
|
70
78
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {})
|
|
71
79
|
})
|
|
@@ -74,7 +82,7 @@ const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ classN
|
|
|
74
82
|
});
|
|
75
83
|
});
|
|
76
84
|
Search.displayName = 'Search';
|
|
77
|
-
const SearchWithSuggestions = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ value, onChange, placeholder = 'Search...', suggestions = [], onSelect, emptyMessage = 'No results found.', className }, ref)=>{
|
|
85
|
+
const SearchWithSuggestions = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ value, onChange, placeholder = 'Search...', suggestions = [], onSelect, emptyMessage = 'No results found.', className, strings }, ref)=>{
|
|
78
86
|
const [open, setOpen] = external_react_namespaceObject.useState(false);
|
|
79
87
|
const [searchValue, setSearchValue] = external_react_namespaceObject.useState(value || '');
|
|
80
88
|
external_react_namespaceObject.useEffect(()=>{
|
|
@@ -113,7 +121,8 @@ const SearchWithSuggestions = /*#__PURE__*/ external_react_namespaceObject.forwa
|
|
|
113
121
|
onChange?.('');
|
|
114
122
|
setOpen(false);
|
|
115
123
|
},
|
|
116
|
-
placeholder: placeholder
|
|
124
|
+
placeholder: placeholder,
|
|
125
|
+
strings: strings
|
|
117
126
|
})
|
|
118
127
|
})
|
|
119
128
|
}),
|
|
@@ -143,9 +152,11 @@ const SearchWithSuggestions = /*#__PURE__*/ external_react_namespaceObject.forwa
|
|
|
143
152
|
});
|
|
144
153
|
});
|
|
145
154
|
SearchWithSuggestions.displayName = 'SearchWithSuggestions';
|
|
155
|
+
exports.DEFAULT_SEARCH_STRINGS = __webpack_exports__.DEFAULT_SEARCH_STRINGS;
|
|
146
156
|
exports.Search = __webpack_exports__.Search;
|
|
147
157
|
exports.SearchWithSuggestions = __webpack_exports__.SearchWithSuggestions;
|
|
148
158
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
159
|
+
"DEFAULT_SEARCH_STRINGS",
|
|
149
160
|
"Search",
|
|
150
161
|
"SearchWithSuggestions"
|
|
151
162
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type InputGroupInputProps, type InputGroupProps } from './input-group';
|
|
3
|
+
export interface SearchStrings {
|
|
4
|
+
/** Label of the button that clears the query. */
|
|
5
|
+
clear: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_SEARCH_STRINGS: SearchStrings;
|
|
3
8
|
export interface SearchProps extends Omit<InputGroupInputProps, 'onChange'> {
|
|
4
9
|
value?: string;
|
|
5
10
|
onChange?: (value: string) => void;
|
|
@@ -11,6 +16,8 @@ export interface SearchProps extends Omit<InputGroupInputProps, 'onChange'> {
|
|
|
11
16
|
error?: React.ReactNode;
|
|
12
17
|
/** Optional id for the inline validation message. */
|
|
13
18
|
errorId?: string;
|
|
19
|
+
/** Overrides for any subset of the built-in labels. */
|
|
20
|
+
strings?: Partial<SearchStrings>;
|
|
14
21
|
}
|
|
15
22
|
declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<HTMLInputElement>>;
|
|
16
23
|
export interface SearchWithSuggestionsProps {
|
|
@@ -21,6 +28,8 @@ export interface SearchWithSuggestionsProps {
|
|
|
21
28
|
onSelect?: (value: string) => void;
|
|
22
29
|
emptyMessage?: string;
|
|
23
30
|
className?: string;
|
|
31
|
+
/** Overrides for the search field's built-in labels. */
|
|
32
|
+
strings?: Partial<SearchStrings>;
|
|
24
33
|
}
|
|
25
34
|
declare const SearchWithSuggestions: React.ForwardRefExoticComponent<SearchWithSuggestionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
35
|
export { Search, SearchWithSuggestions };
|
|
@@ -5,7 +5,14 @@ import { Command, CommandEmpty, CommandGroup, CommandItem, CommandList } from ".
|
|
|
5
5
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
6
6
|
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
7
7
|
import { cn } from "../../lib/index.js";
|
|
8
|
-
const
|
|
8
|
+
const DEFAULT_SEARCH_STRINGS = {
|
|
9
|
+
clear: 'Clear'
|
|
10
|
+
};
|
|
11
|
+
const search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, error, errorId, strings, ...props }, ref)=>{
|
|
12
|
+
const text = {
|
|
13
|
+
...DEFAULT_SEARCH_STRINGS,
|
|
14
|
+
...strings
|
|
15
|
+
};
|
|
9
16
|
const handleClear = ()=>{
|
|
10
17
|
onChange?.('');
|
|
11
18
|
onClear?.();
|
|
@@ -36,7 +43,7 @@ const search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, on
|
|
|
36
43
|
children: /*#__PURE__*/ jsx(InputGroupButton, {
|
|
37
44
|
icon: true,
|
|
38
45
|
size: "3xs",
|
|
39
|
-
"aria-label":
|
|
46
|
+
"aria-label": text.clear,
|
|
40
47
|
onClick: handleClear,
|
|
41
48
|
children: /*#__PURE__*/ jsx(X, {})
|
|
42
49
|
})
|
|
@@ -45,7 +52,7 @@ const search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, on
|
|
|
45
52
|
});
|
|
46
53
|
});
|
|
47
54
|
search_Search.displayName = 'Search';
|
|
48
|
-
const SearchWithSuggestions = /*#__PURE__*/ forwardRef(({ value, onChange, placeholder = 'Search...', suggestions = [], onSelect, emptyMessage = 'No results found.', className }, ref)=>{
|
|
55
|
+
const SearchWithSuggestions = /*#__PURE__*/ forwardRef(({ value, onChange, placeholder = 'Search...', suggestions = [], onSelect, emptyMessage = 'No results found.', className, strings }, ref)=>{
|
|
49
56
|
const [open, setOpen] = useState(false);
|
|
50
57
|
const [searchValue, setSearchValue] = useState(value || '');
|
|
51
58
|
useEffect(()=>{
|
|
@@ -84,7 +91,8 @@ const SearchWithSuggestions = /*#__PURE__*/ forwardRef(({ value, onChange, place
|
|
|
84
91
|
onChange?.('');
|
|
85
92
|
setOpen(false);
|
|
86
93
|
},
|
|
87
|
-
placeholder: placeholder
|
|
94
|
+
placeholder: placeholder,
|
|
95
|
+
strings: strings
|
|
88
96
|
})
|
|
89
97
|
})
|
|
90
98
|
}),
|
|
@@ -114,4 +122,4 @@ const SearchWithSuggestions = /*#__PURE__*/ forwardRef(({ value, onChange, place
|
|
|
114
122
|
});
|
|
115
123
|
});
|
|
116
124
|
SearchWithSuggestions.displayName = 'SearchWithSuggestions';
|
|
117
|
-
export { search_Search as Search, SearchWithSuggestions };
|
|
125
|
+
export { DEFAULT_SEARCH_STRINGS, search_Search as Search, SearchWithSuggestions };
|
|
@@ -177,7 +177,7 @@ const SelectContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({
|
|
|
177
177
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_select_namespaceObject.Content, {
|
|
178
178
|
ref: setContent,
|
|
179
179
|
"data-slot": "select-content",
|
|
180
|
-
className: (0, index_cjs_namespaceObject.cn)('relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-
|
|
180
|
+
className: (0, index_cjs_namespaceObject.cn)('relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)', 'popper' === position && 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className),
|
|
181
181
|
position: position,
|
|
182
182
|
...props,
|
|
183
183
|
sideOffset: (props.sideOffset ?? 0) + (fit.offsets?.sideOffset ?? 0),
|
|
@@ -140,7 +140,7 @@ const SelectContent = /*#__PURE__*/ forwardRef(({ className, children, position
|
|
|
140
140
|
children: /*#__PURE__*/ jsxs(Content, {
|
|
141
141
|
ref: setContent,
|
|
142
142
|
"data-slot": "select-content",
|
|
143
|
-
className: cn('relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-
|
|
143
|
+
className: cn('relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)', 'popper' === position && 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className),
|
|
144
144
|
position: position,
|
|
145
145
|
...props,
|
|
146
146
|
sideOffset: (props.sideOffset ?? 0) + (fit.offsets?.sideOffset ?? 0),
|
|
@@ -31,6 +31,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
31
31
|
SheetFooter: ()=>SheetFooter,
|
|
32
32
|
SheetDescription: ()=>SheetDescription,
|
|
33
33
|
SheetHeader: ()=>SheetHeader,
|
|
34
|
+
DEFAULT_SHEET_STRINGS: ()=>DEFAULT_SHEET_STRINGS,
|
|
34
35
|
SheetPortal: ()=>SheetPortal,
|
|
35
36
|
SheetTitle: ()=>SheetTitle,
|
|
36
37
|
SheetTrigger: ()=>SheetTrigger,
|
|
@@ -43,6 +44,9 @@ const external_lucide_react_namespaceObject = require("lucide-react");
|
|
|
43
44
|
const external_react_namespaceObject = require("react");
|
|
44
45
|
const external_portal_container_cjs_namespaceObject = require("./portal-container.cjs");
|
|
45
46
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
47
|
+
const DEFAULT_SHEET_STRINGS = {
|
|
48
|
+
close: 'Close'
|
|
49
|
+
};
|
|
46
50
|
const Sheet = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Root, {
|
|
47
51
|
"data-slot": "sheet",
|
|
48
52
|
...props
|
|
@@ -85,8 +89,12 @@ const sheetVariants = (0, external_class_variance_authority_namespaceObject.cva)
|
|
|
85
89
|
side: 'right'
|
|
86
90
|
}
|
|
87
91
|
});
|
|
88
|
-
const SheetContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ side = 'right', className, children, container, ...props }, ref)=>{
|
|
92
|
+
const SheetContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ side = 'right', className, children, container, strings, ...props }, ref)=>{
|
|
89
93
|
const resolvedContainer = (0, external_portal_container_cjs_namespaceObject.useResolvedPortalContainer)(container);
|
|
94
|
+
const text = {
|
|
95
|
+
...DEFAULT_SHEET_STRINGS,
|
|
96
|
+
...strings
|
|
97
|
+
};
|
|
90
98
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(SheetPortal, {
|
|
91
99
|
container: resolvedContainer,
|
|
92
100
|
children: [
|
|
@@ -108,7 +116,7 @@ const SheetContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({
|
|
|
108
116
|
}),
|
|
109
117
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
110
118
|
className: "sr-only",
|
|
111
|
-
children:
|
|
119
|
+
children: text.close
|
|
112
120
|
})
|
|
113
121
|
]
|
|
114
122
|
})
|
|
@@ -144,6 +152,7 @@ const SheetDescription = /*#__PURE__*/ external_react_namespaceObject.forwardRef
|
|
|
144
152
|
...props
|
|
145
153
|
}));
|
|
146
154
|
SheetDescription.displayName = react_dialog_namespaceObject.Description.displayName;
|
|
155
|
+
exports.DEFAULT_SHEET_STRINGS = __webpack_exports__.DEFAULT_SHEET_STRINGS;
|
|
147
156
|
exports.Sheet = __webpack_exports__.Sheet;
|
|
148
157
|
exports.SheetClose = __webpack_exports__.SheetClose;
|
|
149
158
|
exports.SheetContent = __webpack_exports__.SheetContent;
|
|
@@ -155,6 +164,7 @@ exports.SheetPortal = __webpack_exports__.SheetPortal;
|
|
|
155
164
|
exports.SheetTitle = __webpack_exports__.SheetTitle;
|
|
156
165
|
exports.SheetTrigger = __webpack_exports__.SheetTrigger;
|
|
157
166
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
167
|
+
"DEFAULT_SHEET_STRINGS",
|
|
158
168
|
"Sheet",
|
|
159
169
|
"SheetClose",
|
|
160
170
|
"SheetContent",
|
|
@@ -2,6 +2,11 @@ import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { type PortalContainerOverride } from './portal-container';
|
|
5
|
+
export interface SheetStrings {
|
|
6
|
+
/** Screen reader label of the close button. */
|
|
7
|
+
close: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEFAULT_SHEET_STRINGS: SheetStrings;
|
|
5
10
|
declare const Sheet: {
|
|
6
11
|
(props: React.ComponentPropsWithoutRef<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
7
12
|
displayName: string;
|
|
@@ -18,6 +23,8 @@ declare const sheetVariants: (props?: ({
|
|
|
18
23
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
24
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
20
25
|
container?: PortalContainerOverride;
|
|
26
|
+
/** Overrides for any subset of the built-in labels. */
|
|
27
|
+
strings?: Partial<SheetStrings>;
|
|
21
28
|
}
|
|
22
29
|
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
30
|
declare const SheetHeader: {
|
|
@@ -6,6 +6,9 @@ import { X } from "lucide-react";
|
|
|
6
6
|
import { forwardRef } from "react";
|
|
7
7
|
import { useResolvedPortalContainer } from "./portal-container.js";
|
|
8
8
|
import { cn } from "../../lib/index.js";
|
|
9
|
+
const DEFAULT_SHEET_STRINGS = {
|
|
10
|
+
close: 'Close'
|
|
11
|
+
};
|
|
9
12
|
const Sheet = (props)=>/*#__PURE__*/ jsx(Root, {
|
|
10
13
|
"data-slot": "sheet",
|
|
11
14
|
...props
|
|
@@ -48,8 +51,12 @@ const sheetVariants = cva('fixed z-50 gap-4 bg-background p-6 text-foreground sh
|
|
|
48
51
|
side: 'right'
|
|
49
52
|
}
|
|
50
53
|
});
|
|
51
|
-
const SheetContent = /*#__PURE__*/ forwardRef(({ side = 'right', className, children, container, ...props }, ref)=>{
|
|
54
|
+
const SheetContent = /*#__PURE__*/ forwardRef(({ side = 'right', className, children, container, strings, ...props }, ref)=>{
|
|
52
55
|
const resolvedContainer = useResolvedPortalContainer(container);
|
|
56
|
+
const text = {
|
|
57
|
+
...DEFAULT_SHEET_STRINGS,
|
|
58
|
+
...strings
|
|
59
|
+
};
|
|
53
60
|
return /*#__PURE__*/ jsxs(SheetPortal, {
|
|
54
61
|
container: resolvedContainer,
|
|
55
62
|
children: [
|
|
@@ -71,7 +78,7 @@ const SheetContent = /*#__PURE__*/ forwardRef(({ side = 'right', className, chil
|
|
|
71
78
|
}),
|
|
72
79
|
/*#__PURE__*/ jsx("span", {
|
|
73
80
|
className: "sr-only",
|
|
74
|
-
children:
|
|
81
|
+
children: text.close
|
|
75
82
|
})
|
|
76
83
|
]
|
|
77
84
|
})
|
|
@@ -107,4 +114,4 @@ const SheetDescription = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)
|
|
|
107
114
|
...props
|
|
108
115
|
}));
|
|
109
116
|
SheetDescription.displayName = Description.displayName;
|
|
110
|
-
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger };
|
|
117
|
+
export { DEFAULT_SHEET_STRINGS, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger };
|
|
@@ -97,7 +97,7 @@ const SourceItem = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ cl
|
|
|
97
97
|
href: linkHref
|
|
98
98
|
}, event);
|
|
99
99
|
};
|
|
100
|
-
const itemClassName = (0, index_cjs_namespaceObject.cn)('flex w-full min-w-0 cursor-pointer items-start gap-2.5 rounded-lg px-2 py-1.5 text-left text-
|
|
100
|
+
const itemClassName = (0, index_cjs_namespaceObject.cn)('flex w-full min-w-0 cursor-pointer items-start gap-2.5 rounded-lg px-2 py-1.5 text-left text-(length:--source-item-font-size,0.875rem) leading-(--source-item-leading,1.25rem) transition-colors hover:bg-surface-overlay focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring in-data-[density=compact]:[--source-item-font-size:0.75rem] in-data-[density=compact]:[--source-item-leading:1rem]', className);
|
|
101
101
|
const newTab = '_blank' === target;
|
|
102
102
|
const body = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
103
103
|
children: [
|
|
@@ -6,6 +6,12 @@ import { Collapsible } from './collapsible';
|
|
|
6
6
|
* given `href`; `onSelect` receives the item and the event, so a host can run its `citation-click`
|
|
7
7
|
* pre-hook and call `event.preventDefault()` to stop a link. The payload drops an `href` that is
|
|
8
8
|
* not http(s), mailto, tel or relative, so it is safe to open.
|
|
9
|
+
*
|
|
10
|
+
* Compact density: inside an ancestor with `data-density="compact"` source items drop to 12px.
|
|
11
|
+
* The trigger is already small, and the 16px icons are below Material's compact size, so they stay.
|
|
12
|
+
* There is no prop: the host opts in by setting the attribute (the Wind chat sets it on its root).
|
|
13
|
+
* Compact sets CSS variables the base classes read, so a host className on the root wins in
|
|
14
|
+
* both densities.
|
|
9
15
|
*/
|
|
10
16
|
export interface SourcesStrings {
|
|
11
17
|
/** Trigger text. A function so a host can apply its own plural rules. */
|
|
@@ -66,7 +66,7 @@ const SourceItem = /*#__PURE__*/ forwardRef(({ className, index, title, source,
|
|
|
66
66
|
href: linkHref
|
|
67
67
|
}, event);
|
|
68
68
|
};
|
|
69
|
-
const itemClassName = cn('flex w-full min-w-0 cursor-pointer items-start gap-2.5 rounded-lg px-2 py-1.5 text-left text-
|
|
69
|
+
const itemClassName = cn('flex w-full min-w-0 cursor-pointer items-start gap-2.5 rounded-lg px-2 py-1.5 text-left text-(length:--source-item-font-size,0.875rem) leading-(--source-item-leading,1.25rem) transition-colors hover:bg-surface-overlay focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring in-data-[density=compact]:[--source-item-font-size:0.75rem] in-data-[density=compact]:[--source-item-leading:1rem]', className);
|
|
70
70
|
const newTab = '_blank' === target;
|
|
71
71
|
const body = /*#__PURE__*/ jsxs(Fragment, {
|
|
72
72
|
children: [
|
|
@@ -54,7 +54,7 @@ const thinkingIndicatorVariants = (0, external_class_variance_authority_namespac
|
|
|
54
54
|
variants: {
|
|
55
55
|
size: {
|
|
56
56
|
sm: 'gap-1.5 text-xs [&_[data-slot=thinking-indicator-icon]]:size-3.5',
|
|
57
|
-
md: 'gap-
|
|
57
|
+
md: 'gap-(--thinking-indicator-gap,0.5rem) text-(length:--thinking-indicator-font-size,0.875rem) leading-(--thinking-indicator-leading,1.25rem) [&_[data-slot=thinking-indicator-icon]]:size-4'
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
defaultVariants: {
|
|
@@ -64,7 +64,9 @@ const thinkingIndicatorVariants = (0, external_class_variance_authority_namespac
|
|
|
64
64
|
const DEFAULT_THINKING_INDICATOR_STRINGS = {
|
|
65
65
|
label: 'Thinking'
|
|
66
66
|
};
|
|
67
|
-
const
|
|
67
|
+
const COMPACT_THINKING_CLASSES = 'in-data-[density=compact]:[--thinking-indicator-gap:0.375rem] in-data-[density=compact]:[--thinking-indicator-font-size:0.75rem] in-data-[density=compact]:[--thinking-indicator-leading:1rem] in-data-[density=compact]:[&_[data-slot=thinking-indicator-icon]]:size-3.5';
|
|
68
|
+
const ThinkingIndicator = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, size: sizeProp, label, messages, interval = 2500, strings, icon, 'aria-label': ariaLabel, ...props }, ref)=>{
|
|
69
|
+
const size = sizeProp ?? 'md';
|
|
68
70
|
const text = {
|
|
69
71
|
...DEFAULT_THINKING_INDICATOR_STRINGS,
|
|
70
72
|
...strings
|
|
@@ -104,7 +106,7 @@ const ThinkingIndicator = /*#__PURE__*/ external_react_namespaceObject.forwardRe
|
|
|
104
106
|
"aria-label": name,
|
|
105
107
|
className: (0, index_cjs_namespaceObject.cn)(thinkingIndicatorVariants({
|
|
106
108
|
size
|
|
107
|
-
}), className),
|
|
109
|
+
}), null == sizeProp && COMPACT_THINKING_CLASSES, className),
|
|
108
110
|
...props,
|
|
109
111
|
children: [
|
|
110
112
|
null !== icon && false !== icon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
@@ -33,6 +33,12 @@ export interface ThinkingIndicatorProps extends Omit<React.HTMLAttributes<HTMLDi
|
|
|
33
33
|
* would only add noise. Announce real progress with `LiveRegion` instead.
|
|
34
34
|
*
|
|
35
35
|
* Under `prefers-reduced-motion` the icon and shimmer are static and the labels do not rotate.
|
|
36
|
+
*
|
|
37
|
+
* Compact density: without a `size`, inside an ancestor with `data-density="compact"` it takes
|
|
38
|
+
* the `sm` look. An explicit `size` always wins.
|
|
39
|
+
* There is no prop: the host opts in by setting the attribute (the Wind chat sets it on its root).
|
|
40
|
+
* Compact sets CSS variables the base classes read, so a host className on the root wins in
|
|
41
|
+
* both densities.
|
|
36
42
|
*/
|
|
37
43
|
declare const ThinkingIndicator: React.ForwardRefExoticComponent<ThinkingIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
44
|
export { ThinkingIndicator, thinkingIndicatorVariants };
|
|
@@ -24,7 +24,7 @@ const thinkingIndicatorVariants = cva('inline-flex max-w-full min-w-0 items-cent
|
|
|
24
24
|
variants: {
|
|
25
25
|
size: {
|
|
26
26
|
sm: 'gap-1.5 text-xs [&_[data-slot=thinking-indicator-icon]]:size-3.5',
|
|
27
|
-
md: 'gap-
|
|
27
|
+
md: 'gap-(--thinking-indicator-gap,0.5rem) text-(length:--thinking-indicator-font-size,0.875rem) leading-(--thinking-indicator-leading,1.25rem) [&_[data-slot=thinking-indicator-icon]]:size-4'
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
defaultVariants: {
|
|
@@ -34,7 +34,9 @@ const thinkingIndicatorVariants = cva('inline-flex max-w-full min-w-0 items-cent
|
|
|
34
34
|
const DEFAULT_THINKING_INDICATOR_STRINGS = {
|
|
35
35
|
label: 'Thinking'
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const COMPACT_THINKING_CLASSES = 'in-data-[density=compact]:[--thinking-indicator-gap:0.375rem] in-data-[density=compact]:[--thinking-indicator-font-size:0.75rem] in-data-[density=compact]:[--thinking-indicator-leading:1rem] in-data-[density=compact]:[&_[data-slot=thinking-indicator-icon]]:size-3.5';
|
|
38
|
+
const ThinkingIndicator = /*#__PURE__*/ forwardRef(({ className, size: sizeProp, label, messages, interval = 2500, strings, icon, 'aria-label': ariaLabel, ...props }, ref)=>{
|
|
39
|
+
const size = sizeProp ?? 'md';
|
|
38
40
|
const text = {
|
|
39
41
|
...DEFAULT_THINKING_INDICATOR_STRINGS,
|
|
40
42
|
...strings
|
|
@@ -74,7 +76,7 @@ const ThinkingIndicator = /*#__PURE__*/ forwardRef(({ className, size = 'md', la
|
|
|
74
76
|
"aria-label": name,
|
|
75
77
|
className: cn(thinkingIndicatorVariants({
|
|
76
78
|
size
|
|
77
|
-
}), className),
|
|
79
|
+
}), null == sizeProp && COMPACT_THINKING_CLASSES, className),
|
|
78
80
|
...props,
|
|
79
81
|
children: [
|
|
80
82
|
null !== icon && false !== icon && /*#__PURE__*/ jsx("span", {
|
|
@@ -39,6 +39,7 @@ const external_class_variance_authority_namespaceObject = require("class-varianc
|
|
|
39
39
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
40
40
|
const external_react_namespaceObject = require("react");
|
|
41
41
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
42
|
+
const disclosure_row_cjs_namespaceObject = require("../../lib/disclosure-row.cjs");
|
|
42
43
|
const external_collapsible_cjs_namespaceObject = require("./collapsible.cjs");
|
|
43
44
|
const external_json_tree_view_index_cjs_namespaceObject = require("./json-tree-view/index.cjs");
|
|
44
45
|
const DEFAULT_TOOL_CALL_STRINGS = {
|
|
@@ -70,19 +71,21 @@ function mergeStrings(overrides) {
|
|
|
70
71
|
return merged;
|
|
71
72
|
}
|
|
72
73
|
const useIsomorphicLayoutEffect = "u" < typeof window ? external_react_namespaceObject.useEffect : external_react_namespaceObject.useLayoutEffect;
|
|
73
|
-
const TOGGLE_CLASSES =
|
|
74
|
+
const TOGGLE_CLASSES = `${disclosure_row_cjs_namespaceObject.disclosureRowClassName} hover:text-foreground`;
|
|
74
75
|
const toolCallVariants = (0, external_class_variance_authority_namespaceObject.cva)('group/tool-call flex w-full min-w-0 flex-col text-muted-foreground', {
|
|
75
76
|
variants: {
|
|
76
77
|
size: {
|
|
77
78
|
sm: 'p-2 text-xs',
|
|
78
|
-
md: 'p-
|
|
79
|
+
md: 'p-(--tool-call-padding,0.75rem) text-(length:--tool-call-font-size,0.875rem) leading-(--tool-call-leading,1.25rem)'
|
|
79
80
|
}
|
|
80
81
|
},
|
|
81
82
|
defaultVariants: {
|
|
82
83
|
size: 'md'
|
|
83
84
|
}
|
|
84
85
|
});
|
|
85
|
-
const
|
|
86
|
+
const COMPACT_TOOL_CALL_CLASSES = 'in-data-[density=compact]:[--tool-call-padding:0.5rem] in-data-[density=compact]:[--tool-call-font-size:0.75rem] in-data-[density=compact]:[--tool-call-leading:1rem] in-data-[density=compact]:[--tool-call-icon-size:1rem] in-data-[density=compact]:[--tool-call-indent:0.5rem] in-data-[density=compact]:[--tool-call-body-gap:0.25rem]';
|
|
87
|
+
const ToolCall = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, status, size: sizeProp, open, defaultOpen, onOpenChange, strings, jsonTreeStrings, ...props }, ref)=>{
|
|
88
|
+
const size = sizeProp ?? 'md';
|
|
86
89
|
const [contentCount, setContentCount] = external_react_namespaceObject.useState(0);
|
|
87
90
|
const registerContent = external_react_namespaceObject.useCallback(()=>{
|
|
88
91
|
setContentCount((count)=>count + 1);
|
|
@@ -115,7 +118,7 @@ const ToolCall = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ clas
|
|
|
115
118
|
"data-size": size,
|
|
116
119
|
className: (0, index_cjs_namespaceObject.cn)(toolCallVariants({
|
|
117
120
|
size
|
|
118
|
-
}), className),
|
|
121
|
+
}), null == sizeProp && COMPACT_TOOL_CALL_CLASSES, className),
|
|
119
122
|
...props
|
|
120
123
|
})
|
|
121
124
|
})
|
|
@@ -128,7 +131,7 @@ const STATUS_ICONS = {
|
|
|
128
131
|
completed: external_lucide_react_namespaceObject.CircleCheck,
|
|
129
132
|
failed: external_lucide_react_namespaceObject.CircleX
|
|
130
133
|
};
|
|
131
|
-
const toolCallStatusIconVariants = (0, external_class_variance_authority_namespaceObject.cva)('size-
|
|
134
|
+
const toolCallStatusIconVariants = (0, external_class_variance_authority_namespaceObject.cva)('size-(--tool-call-icon-size,1.25rem) shrink-0 group-data-[size=sm]/tool-call:size-4', {
|
|
132
135
|
variants: {
|
|
133
136
|
status: {
|
|
134
137
|
pending: 'text-muted-foreground',
|
|
@@ -180,7 +183,7 @@ const ToolCallHeader = /*#__PURE__*/ external_react_namespaceObject.forwardRef((
|
|
|
180
183
|
})
|
|
181
184
|
]
|
|
182
185
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
183
|
-
className: "flex min-w-0 items-center gap-2 p-1",
|
|
186
|
+
className: "flex min-w-0 items-center gap-2 p-1 in-data-[density=compact]:py-0.5",
|
|
184
187
|
children: line
|
|
185
188
|
})
|
|
186
189
|
});
|
|
@@ -194,7 +197,7 @@ const ToolCallContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(
|
|
|
194
197
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_collapsible_cjs_namespaceObject.CollapsibleContent, {
|
|
195
198
|
ref: ref,
|
|
196
199
|
"data-slot": "tool-call-content",
|
|
197
|
-
className: (0, index_cjs_namespaceObject.cn)('mt-
|
|
200
|
+
className: (0, index_cjs_namespaceObject.cn)('mt-(--tool-call-body-gap,0.5rem) ml-(--tool-call-indent,0.75rem) flex min-w-0 flex-col border-l pl-(--tool-call-indent,0.75rem) group-data-[size=sm]/tool-call:ml-2 group-data-[size=sm]/tool-call:pl-2', className),
|
|
198
201
|
...props
|
|
199
202
|
});
|
|
200
203
|
});
|
|
@@ -37,6 +37,12 @@ export interface ToolCallProps extends React.HTMLAttributes<HTMLDivElement>, Var
|
|
|
37
37
|
* seconds") that toggles an indented body of collapsible sections (input, errors, output, or any
|
|
38
38
|
* `ToolCallSection`). The body is not rendered while closed. Omit `ToolCallContent` for a
|
|
39
39
|
* name-only line (the toggle hides itself).
|
|
40
|
+
*
|
|
41
|
+
* Compact density (Wind's own; Material's tool call does not change): without a `size`, inside an
|
|
42
|
+
* ancestor with `data-density="compact"` it takes the `sm` look (8px padding, 12px text, 16px
|
|
43
|
+
* status icon, 8px body indent) with a 4px body gap, and its toggle rows drop to 2px vertical
|
|
44
|
+
* padding. Code blocks in its body follow the ancestor like any `CodeBlock`. An explicit `size`
|
|
45
|
+
* always wins, and a host className on the root wins in both densities.
|
|
40
46
|
*/
|
|
41
47
|
declare const ToolCall: React.ForwardRefExoticComponent<ToolCallProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
48
|
export interface ToolCallHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|