@uipath/apollo-wind 2.52.2 → 2.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/forms/field-renderer.cjs +42 -3
- package/dist/components/forms/field-renderer.js +42 -3
- package/dist/components/forms/string-list-field.cjs +3 -0
- package/dist/components/forms/string-list-field.js +3 -0
- package/dist/components/ui/button.cjs +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/checkbox.cjs +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/combobox.cjs +70 -51
- package/dist/components/ui/combobox.d.ts +12 -0
- package/dist/components/ui/combobox.js +72 -53
- package/dist/components/ui/date-picker.cjs +102 -62
- package/dist/components/ui/date-picker.d.ts +28 -0
- package/dist/components/ui/date-picker.js +103 -63
- package/dist/components/ui/datetime-picker.cjs +90 -72
- package/dist/components/ui/datetime-picker.d.ts +12 -2
- package/dist/components/ui/datetime-picker.js +92 -74
- package/dist/components/ui/file-upload.cjs +21 -8
- package/dist/components/ui/file-upload.d.ts +7 -0
- package/dist/components/ui/file-upload.js +22 -9
- package/dist/components/ui/form-field.cjs +3 -3
- package/dist/components/ui/form-field.d.ts +11 -0
- package/dist/components/ui/form-field.js +3 -3
- package/dist/components/ui/index.cjs +8 -8
- package/dist/components/ui/input-group.cjs +0 -2
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.js +0 -2
- package/dist/components/ui/input.cjs +0 -2
- package/dist/components/ui/input.js +0 -2
- package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +1 -1
- package/dist/components/ui/lockable-value-field/lockable-value-field.js +1 -1
- package/dist/components/ui/multi-select.cjs +125 -112
- package/dist/components/ui/multi-select.d.ts +7 -0
- package/dist/components/ui/multi-select.js +126 -113
- package/dist/components/ui/prompt-editor/plugins/ShortcutContainmentPlugin.cjs +62 -0
- package/dist/components/ui/prompt-editor/plugins/ShortcutContainmentPlugin.d.ts +19 -0
- package/dist/components/ui/prompt-editor/plugins/ShortcutContainmentPlugin.js +25 -0
- package/dist/components/ui/prompt-editor/prompt-editor.cjs +2 -2
- package/dist/components/ui/prompt-editor/prompt-editor.js +2 -2
- package/dist/components/ui/radio-group.cjs +2 -2
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/search.cjs +3 -1
- package/dist/components/ui/search.d.ts +4 -0
- package/dist/components/ui/search.js +3 -1
- package/dist/components/ui/select.cjs +33 -12
- package/dist/components/ui/select.d.ts +10 -1
- package/dist/components/ui/select.js +35 -14
- package/dist/components/ui/slider.cjs +7 -2
- package/dist/components/ui/slider.js +7 -2
- package/dist/components/ui/switch.cjs +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/textarea.cjs +30 -11
- package/dist/components/ui/textarea.d.ts +7 -0
- package/dist/components/ui/textarea.js +32 -13
- package/dist/index.cjs +4 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +2 -2
- package/dist/styles.css +74 -0
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ var __webpack_modules__ = {
|
|
|
24
24
|
"./button-group" (module) {
|
|
25
25
|
module.exports = require("./button-group.cjs");
|
|
26
26
|
},
|
|
27
|
-
"
|
|
27
|
+
"./button" (module) {
|
|
28
28
|
module.exports = require("./button.cjs");
|
|
29
29
|
},
|
|
30
30
|
"./calendar" (module) {
|
|
@@ -60,7 +60,7 @@ var __webpack_modules__ = {
|
|
|
60
60
|
"./datetime-picker" (module) {
|
|
61
61
|
module.exports = require("./datetime-picker.cjs");
|
|
62
62
|
},
|
|
63
|
-
"
|
|
63
|
+
"./dialog" (module) {
|
|
64
64
|
module.exports = require("./dialog.cjs");
|
|
65
65
|
},
|
|
66
66
|
"./drawer" (module) {
|
|
@@ -87,7 +87,7 @@ var __webpack_modules__ = {
|
|
|
87
87
|
"@/components/ui/info-tooltip" (module) {
|
|
88
88
|
module.exports = require("./info-tooltip.cjs");
|
|
89
89
|
},
|
|
90
|
-
"
|
|
90
|
+
"./input-group" (module) {
|
|
91
91
|
module.exports = require("./input-group.cjs");
|
|
92
92
|
},
|
|
93
93
|
"./input" (module) {
|
|
@@ -108,7 +108,7 @@ var __webpack_modules__ = {
|
|
|
108
108
|
"./pagination" (module) {
|
|
109
109
|
module.exports = require("./pagination.cjs");
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"@/components/ui/popover" (module) {
|
|
112
112
|
module.exports = require("./popover.cjs");
|
|
113
113
|
},
|
|
114
114
|
"@/components/ui/portal-container" (module) {
|
|
@@ -282,7 +282,7 @@ var __webpack_exports__ = {};
|
|
|
282
282
|
"default"
|
|
283
283
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_breadcrumb__rspack_import_6[__rspack_import_key];
|
|
284
284
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
285
|
-
var _button__rspack_import_7 = __webpack_require__("
|
|
285
|
+
var _button__rspack_import_7 = __webpack_require__("./button");
|
|
286
286
|
var __rspack_reexport = {};
|
|
287
287
|
for(const __rspack_import_key in _button__rspack_import_7)if ([
|
|
288
288
|
"TreeView",
|
|
@@ -373,7 +373,7 @@ var __webpack_exports__ = {};
|
|
|
373
373
|
"default"
|
|
374
374
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_datetime_picker__rspack_import_19[__rspack_import_key];
|
|
375
375
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
376
|
-
var _dialog__rspack_import_20 = __webpack_require__("
|
|
376
|
+
var _dialog__rspack_import_20 = __webpack_require__("./dialog");
|
|
377
377
|
var __rspack_reexport = {};
|
|
378
378
|
for(const __rspack_import_key in _dialog__rspack_import_20)if ([
|
|
379
379
|
"TreeView",
|
|
@@ -443,7 +443,7 @@ var __webpack_exports__ = {};
|
|
|
443
443
|
"default"
|
|
444
444
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_input__rspack_import_29[__rspack_import_key];
|
|
445
445
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
446
|
-
var _input_group__rspack_import_30 = __webpack_require__("
|
|
446
|
+
var _input_group__rspack_import_30 = __webpack_require__("./input-group");
|
|
447
447
|
var __rspack_reexport = {};
|
|
448
448
|
for(const __rspack_import_key in _input_group__rspack_import_30)if ([
|
|
449
449
|
"TreeView",
|
|
@@ -485,7 +485,7 @@ var __webpack_exports__ = {};
|
|
|
485
485
|
"default"
|
|
486
486
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_pagination__rspack_import_35[__rspack_import_key];
|
|
487
487
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
488
|
-
var _popover__rspack_import_36 = __webpack_require__("
|
|
488
|
+
var _popover__rspack_import_36 = __webpack_require__("@/components/ui/popover");
|
|
489
489
|
var __rspack_reexport = {};
|
|
490
490
|
for(const __rspack_import_key in _popover__rspack_import_36)if ([
|
|
491
491
|
"TreeView",
|
|
@@ -57,8 +57,6 @@ const InputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ cl
|
|
|
57
57
|
}),
|
|
58
58
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
59
59
|
id: validationId,
|
|
60
|
-
"data-slot": "input-group-error",
|
|
61
|
-
className: "mt-1",
|
|
62
60
|
children: error
|
|
63
61
|
})
|
|
64
62
|
]
|
|
@@ -27,7 +27,7 @@ declare const InputGroupText: React.ForwardRefExoticComponent<InputGroupTextProp
|
|
|
27
27
|
export interface InputGroupInputProps extends Omit<InputProps, 'variant' | 'size' | 'error' | 'errorId'> {
|
|
28
28
|
}
|
|
29
29
|
declare const InputGroupInput: React.ForwardRefExoticComponent<InputGroupInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
30
|
-
export interface InputGroupTextareaProps extends Omit<TextareaProps, 'variant'> {
|
|
30
|
+
export interface InputGroupTextareaProps extends Omit<TextareaProps, 'variant' | 'error' | 'errorId'> {
|
|
31
31
|
}
|
|
32
32
|
declare const InputGroupTextarea: React.ForwardRefExoticComponent<Omit<InputGroupTextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
33
33
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -52,8 +52,6 @@ const Input = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ 'aria-d
|
|
|
52
52
|
}),
|
|
53
53
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
54
54
|
id: validationId,
|
|
55
|
-
"data-slot": "input-error",
|
|
56
|
-
className: "mt-1",
|
|
57
55
|
children: error
|
|
58
56
|
})
|
|
59
57
|
]
|
|
@@ -97,7 +97,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
97
97
|
const hasMoreActions = Boolean(more?.onRefresh || !locked && more?.onClear);
|
|
98
98
|
const lockedDisplayValue = (0, external_utils_cjs_namespaceObject.getLockedDisplayValue)(fieldType, value, options);
|
|
99
99
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
100
|
-
className: (0, index_cjs_namespaceObject.cn)('@container group flex flex-col gap-1.5', className),
|
|
100
|
+
className: (0, index_cjs_namespaceObject.cn)('@container group flex flex-col gap-1.5 [&>[data-slot=form-field-error]]:mt-0', className),
|
|
101
101
|
children: [
|
|
102
102
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(field_header_cjs_namespaceObject.FieldHeader, {
|
|
103
103
|
label: label,
|
|
@@ -69,7 +69,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
69
69
|
const hasMoreActions = Boolean(more?.onRefresh || !locked && more?.onClear);
|
|
70
70
|
const lockedDisplayValue = getLockedDisplayValue(fieldType, value, options);
|
|
71
71
|
return /*#__PURE__*/ jsxs("div", {
|
|
72
|
-
className: cn('@container group flex flex-col gap-1.5', className),
|
|
72
|
+
className: cn('@container group flex flex-col gap-1.5 [&>[data-slot=form-field-error]]:mt-0', className),
|
|
73
73
|
children: [
|
|
74
74
|
/*#__PURE__*/ jsx(FieldHeader, {
|
|
75
75
|
label: label,
|
|
@@ -35,8 +35,15 @@ const external_checkbox_cjs_namespaceObject = require("./checkbox.cjs");
|
|
|
35
35
|
const external_command_cjs_namespaceObject = require("./command.cjs");
|
|
36
36
|
const external_popover_cjs_namespaceObject = require("./popover.cjs");
|
|
37
37
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
38
|
-
const
|
|
38
|
+
const external_form_field_cjs_namespaceObject = require("./form-field.cjs");
|
|
39
|
+
const MultiSelect = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ id, options, selected, onChange, placeholder = 'Select items...', emptyMessage = 'No items found.', className, maxSelected, disabled = false, searchPlaceholder = 'Search...', clearAllText, onBlur, error, errorId, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref)=>{
|
|
39
40
|
const [open, setOpen] = external_react_namespaceObject.useState(false);
|
|
41
|
+
const generatedId = external_react_namespaceObject.useId();
|
|
42
|
+
const validationId = errorId ?? `${id ?? `multi-select-${generatedId.replace(/:/g, '')}`}-error`;
|
|
43
|
+
const describedBy = [
|
|
44
|
+
ariaDescribedBy,
|
|
45
|
+
error ? validationId : void 0
|
|
46
|
+
].filter(Boolean).join(' ');
|
|
40
47
|
const handleUnselect = (value)=>{
|
|
41
48
|
onChange(selected.filter((s)=>s !== value));
|
|
42
49
|
};
|
|
@@ -53,129 +60,135 @@ const MultiSelect = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ i
|
|
|
53
60
|
const handleClearAll = ()=>{
|
|
54
61
|
onChange([]);
|
|
55
62
|
};
|
|
56
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
63
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
57
64
|
ref: ref,
|
|
58
65
|
"data-slot": "multi-select",
|
|
59
66
|
className: (0, index_cjs_namespaceObject.cn)('relative', className),
|
|
60
|
-
children:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
children: [
|
|
68
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
|
|
69
|
+
open: open,
|
|
70
|
+
onOpenChange: (nextOpen)=>{
|
|
71
|
+
setOpen(nextOpen);
|
|
72
|
+
if (!nextOpen && open) onBlur?.();
|
|
73
|
+
},
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
|
|
76
|
+
asChild: true,
|
|
77
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
|
|
78
|
+
id: id,
|
|
79
|
+
variant: "outline",
|
|
80
|
+
role: "combobox",
|
|
81
|
+
"aria-expanded": open,
|
|
82
|
+
"aria-invalid": error ? true : ariaInvalid,
|
|
83
|
+
"aria-describedby": describedBy || void 0,
|
|
84
|
+
"aria-errormessage": error ? validationId : ariaErrorMessage,
|
|
85
|
+
"aria-label": id ? void 0 : selected.length > 0 ? `${selected.length} ${1 === selected.length ? 'item' : 'items'} selected` : placeholder,
|
|
86
|
+
className: (0, index_cjs_namespaceObject.cn)('w-full justify-between future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:hover:bg-surface-hover future:font-normal future:text-foreground future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
|
|
87
|
+
disabled: disabled,
|
|
88
|
+
children: [
|
|
89
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
90
|
+
className: "flex flex-wrap gap-1 flex-1",
|
|
91
|
+
children: 0 === selected.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
92
|
+
className: "text-foreground-muted",
|
|
93
|
+
children: placeholder
|
|
94
|
+
}) : selected.map((value)=>{
|
|
95
|
+
const option = options.find((opt)=>opt.value === value);
|
|
96
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_badge_cjs_namespaceObject.Badge, {
|
|
97
|
+
variant: "secondary",
|
|
98
|
+
className: "mr-1 future:bg-surface-raised future:hover:bg-surface-raised",
|
|
99
|
+
onClick: (e)=>{
|
|
100
|
+
e.stopPropagation();
|
|
101
|
+
handleUnselect(value);
|
|
102
|
+
},
|
|
103
|
+
children: [
|
|
104
|
+
option?.label,
|
|
105
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
106
|
+
type: "button",
|
|
107
|
+
"aria-label": `Remove ${option?.label}`,
|
|
108
|
+
className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer bg-transparent border-0 p-0 inline-flex items-center",
|
|
109
|
+
onMouseDown: (e)=>{
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
},
|
|
113
|
+
onClick: (e)=>{
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
e.stopPropagation();
|
|
116
|
+
handleUnselect(value);
|
|
117
|
+
},
|
|
118
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {
|
|
119
|
+
className: "h-3 w-3 text-muted-foreground hover:text-foreground"
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}, value);
|
|
124
|
+
})
|
|
125
|
+
}),
|
|
126
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronsUpDown, {
|
|
127
|
+
className: "h-4 w-4 shrink-0 opacity-50"
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
})
|
|
131
|
+
}),
|
|
132
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.PopoverContent, {
|
|
133
|
+
className: "w-[--radix-popover-trigger-width] p-0",
|
|
134
|
+
align: "start",
|
|
80
135
|
children: [
|
|
81
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const option = options.find((opt)=>opt.value === value);
|
|
88
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_badge_cjs_namespaceObject.Badge, {
|
|
89
|
-
variant: "secondary",
|
|
90
|
-
className: "mr-1 future:bg-surface-raised future:hover:bg-surface-raised",
|
|
91
|
-
onClick: (e)=>{
|
|
92
|
-
e.stopPropagation();
|
|
93
|
-
handleUnselect(value);
|
|
94
|
-
},
|
|
136
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.Command, {
|
|
137
|
+
children: [
|
|
138
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandInput, {
|
|
139
|
+
placeholder: searchPlaceholder
|
|
140
|
+
}),
|
|
141
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandList, {
|
|
95
142
|
children: [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
143
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandEmpty, {
|
|
144
|
+
children: emptyMessage
|
|
145
|
+
}),
|
|
146
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandGroup, {
|
|
147
|
+
children: options.map((option)=>{
|
|
148
|
+
const isSelected = selected.includes(option.value);
|
|
149
|
+
const isDisabled = void 0 !== maxSelected && selected.length >= maxSelected && !isSelected;
|
|
150
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandItem, {
|
|
151
|
+
onSelect: ()=>{
|
|
152
|
+
if (!isDisabled) handleSelect(option.value);
|
|
153
|
+
},
|
|
154
|
+
disabled: isDisabled,
|
|
155
|
+
className: (0, index_cjs_namespaceObject.cn)('group', isDisabled && 'opacity-50 cursor-not-allowed'),
|
|
156
|
+
children: [
|
|
157
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_checkbox_cjs_namespaceObject.Checkbox, {
|
|
158
|
+
checked: isSelected,
|
|
159
|
+
className: "mr-2 pointer-events-none group-hover:border-muted-foreground",
|
|
160
|
+
tabIndex: -1
|
|
161
|
+
}),
|
|
162
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
163
|
+
children: option.label
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
}, option.value);
|
|
112
167
|
})
|
|
113
168
|
})
|
|
114
169
|
]
|
|
115
|
-
}
|
|
116
|
-
|
|
170
|
+
})
|
|
171
|
+
]
|
|
117
172
|
}),
|
|
118
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
119
|
-
className: "
|
|
173
|
+
selected.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
174
|
+
className: "border-t p-2",
|
|
175
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
176
|
+
variant: "ghost",
|
|
177
|
+
size: "sm",
|
|
178
|
+
className: "w-full",
|
|
179
|
+
onClick: handleClearAll,
|
|
180
|
+
children: 'function' == typeof clearAllText ? clearAllText(selected.length) : clearAllText || `Clear all (${selected.length})`
|
|
181
|
+
})
|
|
120
182
|
})
|
|
121
183
|
]
|
|
122
184
|
})
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandInput, {
|
|
131
|
-
placeholder: searchPlaceholder
|
|
132
|
-
}),
|
|
133
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandList, {
|
|
134
|
-
children: [
|
|
135
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandEmpty, {
|
|
136
|
-
children: emptyMessage
|
|
137
|
-
}),
|
|
138
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandGroup, {
|
|
139
|
-
children: options.map((option)=>{
|
|
140
|
-
const isSelected = selected.includes(option.value);
|
|
141
|
-
const isDisabled = void 0 !== maxSelected && selected.length >= maxSelected && !isSelected;
|
|
142
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandItem, {
|
|
143
|
-
onSelect: ()=>{
|
|
144
|
-
if (!isDisabled) handleSelect(option.value);
|
|
145
|
-
},
|
|
146
|
-
disabled: isDisabled,
|
|
147
|
-
className: (0, index_cjs_namespaceObject.cn)('group', isDisabled && 'opacity-50 cursor-not-allowed'),
|
|
148
|
-
children: [
|
|
149
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_checkbox_cjs_namespaceObject.Checkbox, {
|
|
150
|
-
checked: isSelected,
|
|
151
|
-
className: "mr-2 pointer-events-none group-hover:border-muted-foreground",
|
|
152
|
-
tabIndex: -1
|
|
153
|
-
}),
|
|
154
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
155
|
-
children: option.label
|
|
156
|
-
})
|
|
157
|
-
]
|
|
158
|
-
}, option.value);
|
|
159
|
-
})
|
|
160
|
-
})
|
|
161
|
-
]
|
|
162
|
-
})
|
|
163
|
-
]
|
|
164
|
-
}),
|
|
165
|
-
selected.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
166
|
-
className: "border-t p-2",
|
|
167
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
168
|
-
variant: "ghost",
|
|
169
|
-
size: "sm",
|
|
170
|
-
className: "w-full",
|
|
171
|
-
onClick: handleClearAll,
|
|
172
|
-
children: 'function' == typeof clearAllText ? clearAllText(selected.length) : clearAllText || `Clear all (${selected.length})`
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
]
|
|
176
|
-
})
|
|
177
|
-
]
|
|
178
|
-
})
|
|
185
|
+
]
|
|
186
|
+
}),
|
|
187
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
188
|
+
id: validationId,
|
|
189
|
+
children: error
|
|
190
|
+
})
|
|
191
|
+
]
|
|
179
192
|
});
|
|
180
193
|
});
|
|
181
194
|
MultiSelect.displayName = 'MultiSelect';
|
|
@@ -17,6 +17,13 @@ export interface MultiSelectProps {
|
|
|
17
17
|
clearAllText?: string | ((count: number) => string);
|
|
18
18
|
/** Called when the multi-select popover closes after being opened. */
|
|
19
19
|
onBlur?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Field-specific feedback rendered immediately below the trigger.
|
|
22
|
+
* Keep the message focused on what went wrong and how to resolve it.
|
|
23
|
+
*/
|
|
24
|
+
error?: React.ReactNode;
|
|
25
|
+
/** Optional id for the inline validation message. */
|
|
26
|
+
errorId?: string;
|
|
20
27
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
21
28
|
'aria-describedby'?: string;
|
|
22
29
|
'aria-errormessage'?: string;
|