@uipath/apollo-wind 2.52.3 → 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 +26 -26
- 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/prompt-editor.cjs +0 -2
- package/dist/components/ui/prompt-editor/prompt-editor.js +0 -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,10 +24,10 @@ 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) {
|
|
31
31
|
module.exports = require("./calendar.cjs");
|
|
32
32
|
},
|
|
33
33
|
"@/components/ui/card" (module) {
|
|
@@ -36,10 +36,10 @@ var __webpack_modules__ = {
|
|
|
36
36
|
"./chart" (module) {
|
|
37
37
|
module.exports = require("./chart.cjs");
|
|
38
38
|
},
|
|
39
|
-
"
|
|
39
|
+
"./checkbox" (module) {
|
|
40
40
|
module.exports = require("./checkbox.cjs");
|
|
41
41
|
},
|
|
42
|
-
"
|
|
42
|
+
"./collapsible" (module) {
|
|
43
43
|
module.exports = require("./collapsible.cjs");
|
|
44
44
|
},
|
|
45
45
|
"./combobox" (module) {
|
|
@@ -48,7 +48,7 @@ var __webpack_modules__ = {
|
|
|
48
48
|
"@/components/ui/command" (module) {
|
|
49
49
|
module.exports = require("./command.cjs");
|
|
50
50
|
},
|
|
51
|
-
"
|
|
51
|
+
"./context-menu" (module) {
|
|
52
52
|
module.exports = require("./context-menu.cjs");
|
|
53
53
|
},
|
|
54
54
|
"./data-table" (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) {
|
|
@@ -69,7 +69,7 @@ var __webpack_modules__ = {
|
|
|
69
69
|
"@/components/ui/dropdown-menu" (module) {
|
|
70
70
|
module.exports = require("./dropdown-menu.cjs");
|
|
71
71
|
},
|
|
72
|
-
"
|
|
72
|
+
"@/components/ui/editable-cell" (module) {
|
|
73
73
|
module.exports = require("./editable-cell.cjs");
|
|
74
74
|
},
|
|
75
75
|
"./empty-state" (module) {
|
|
@@ -81,16 +81,16 @@ var __webpack_modules__ = {
|
|
|
81
81
|
"./form-field" (module) {
|
|
82
82
|
module.exports = require("./form-field.cjs");
|
|
83
83
|
},
|
|
84
|
-
"
|
|
84
|
+
"./hover-card" (module) {
|
|
85
85
|
module.exports = require("./hover-card.cjs");
|
|
86
86
|
},
|
|
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) {
|
|
94
94
|
module.exports = require("./input.cjs");
|
|
95
95
|
},
|
|
96
96
|
"@/components/ui/label" (module) {
|
|
@@ -162,13 +162,13 @@ var __webpack_modules__ = {
|
|
|
162
162
|
"./switch" (module) {
|
|
163
163
|
module.exports = require("./switch.cjs");
|
|
164
164
|
},
|
|
165
|
-
"
|
|
165
|
+
"@/components/ui/table" (module) {
|
|
166
166
|
module.exports = require("./table.cjs");
|
|
167
167
|
},
|
|
168
168
|
"./tabs" (module) {
|
|
169
169
|
module.exports = require("./tabs.cjs");
|
|
170
170
|
},
|
|
171
|
-
"
|
|
171
|
+
"./textarea" (module) {
|
|
172
172
|
module.exports = require("./textarea.cjs");
|
|
173
173
|
},
|
|
174
174
|
"./toggle-group" (module) {
|
|
@@ -177,7 +177,7 @@ var __webpack_modules__ = {
|
|
|
177
177
|
"@/components/ui/toggle" (module) {
|
|
178
178
|
module.exports = require("./toggle.cjs");
|
|
179
179
|
},
|
|
180
|
-
"
|
|
180
|
+
"@/components/ui/tooltip" (module) {
|
|
181
181
|
module.exports = require("./tooltip.cjs");
|
|
182
182
|
},
|
|
183
183
|
"./tree-view" (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",
|
|
@@ -296,7 +296,7 @@ var __webpack_exports__ = {};
|
|
|
296
296
|
"default"
|
|
297
297
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_button_group__rspack_import_8[__rspack_import_key];
|
|
298
298
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
299
|
-
var _calendar__rspack_import_9 = __webpack_require__("
|
|
299
|
+
var _calendar__rspack_import_9 = __webpack_require__("./calendar");
|
|
300
300
|
var __rspack_reexport = {};
|
|
301
301
|
for(const __rspack_import_key in _calendar__rspack_import_9)if ([
|
|
302
302
|
"TreeView",
|
|
@@ -317,14 +317,14 @@ var __webpack_exports__ = {};
|
|
|
317
317
|
"default"
|
|
318
318
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_chart__rspack_import_11[__rspack_import_key];
|
|
319
319
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
320
|
-
var _checkbox__rspack_import_12 = __webpack_require__("
|
|
320
|
+
var _checkbox__rspack_import_12 = __webpack_require__("./checkbox");
|
|
321
321
|
var __rspack_reexport = {};
|
|
322
322
|
for(const __rspack_import_key in _checkbox__rspack_import_12)if ([
|
|
323
323
|
"TreeView",
|
|
324
324
|
"default"
|
|
325
325
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_checkbox__rspack_import_12[__rspack_import_key];
|
|
326
326
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
327
|
-
var _collapsible__rspack_import_13 = __webpack_require__("
|
|
327
|
+
var _collapsible__rspack_import_13 = __webpack_require__("./collapsible");
|
|
328
328
|
var __rspack_reexport = {};
|
|
329
329
|
for(const __rspack_import_key in _collapsible__rspack_import_13)if ([
|
|
330
330
|
"TreeView",
|
|
@@ -345,7 +345,7 @@ var __webpack_exports__ = {};
|
|
|
345
345
|
"default"
|
|
346
346
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_command__rspack_import_15[__rspack_import_key];
|
|
347
347
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
348
|
-
var _context_menu__rspack_import_16 = __webpack_require__("
|
|
348
|
+
var _context_menu__rspack_import_16 = __webpack_require__("./context-menu");
|
|
349
349
|
var __rspack_reexport = {};
|
|
350
350
|
for(const __rspack_import_key in _context_menu__rspack_import_16)if ([
|
|
351
351
|
"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",
|
|
@@ -394,7 +394,7 @@ var __webpack_exports__ = {};
|
|
|
394
394
|
"default"
|
|
395
395
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_dropdown_menu__rspack_import_22[__rspack_import_key];
|
|
396
396
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
397
|
-
var _editable_cell__rspack_import_23 = __webpack_require__("
|
|
397
|
+
var _editable_cell__rspack_import_23 = __webpack_require__("@/components/ui/editable-cell");
|
|
398
398
|
var __rspack_reexport = {};
|
|
399
399
|
for(const __rspack_import_key in _editable_cell__rspack_import_23)if ([
|
|
400
400
|
"TreeView",
|
|
@@ -422,7 +422,7 @@ var __webpack_exports__ = {};
|
|
|
422
422
|
"default"
|
|
423
423
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_form_field__rspack_import_26[__rspack_import_key];
|
|
424
424
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
425
|
-
var _hover_card__rspack_import_27 = __webpack_require__("
|
|
425
|
+
var _hover_card__rspack_import_27 = __webpack_require__("./hover-card");
|
|
426
426
|
var __rspack_reexport = {};
|
|
427
427
|
for(const __rspack_import_key in _hover_card__rspack_import_27)if ([
|
|
428
428
|
"TreeView",
|
|
@@ -436,14 +436,14 @@ var __webpack_exports__ = {};
|
|
|
436
436
|
"default"
|
|
437
437
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_info_tooltip__rspack_import_28[__rspack_import_key];
|
|
438
438
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
439
|
-
var _input__rspack_import_29 = __webpack_require__("
|
|
439
|
+
var _input__rspack_import_29 = __webpack_require__("./input");
|
|
440
440
|
var __rspack_reexport = {};
|
|
441
441
|
for(const __rspack_import_key in _input__rspack_import_29)if ([
|
|
442
442
|
"TreeView",
|
|
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",
|
|
@@ -611,7 +611,7 @@ var __webpack_exports__ = {};
|
|
|
611
611
|
"default"
|
|
612
612
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_53[__rspack_import_key];
|
|
613
613
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
614
|
-
var _table__rspack_import_54 = __webpack_require__("
|
|
614
|
+
var _table__rspack_import_54 = __webpack_require__("@/components/ui/table");
|
|
615
615
|
var __rspack_reexport = {};
|
|
616
616
|
for(const __rspack_import_key in _table__rspack_import_54)if ([
|
|
617
617
|
"TreeView",
|
|
@@ -625,7 +625,7 @@ var __webpack_exports__ = {};
|
|
|
625
625
|
"default"
|
|
626
626
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tabs__rspack_import_55[__rspack_import_key];
|
|
627
627
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
628
|
-
var _textarea__rspack_import_56 = __webpack_require__("
|
|
628
|
+
var _textarea__rspack_import_56 = __webpack_require__("./textarea");
|
|
629
629
|
var __rspack_reexport = {};
|
|
630
630
|
for(const __rspack_import_key in _textarea__rspack_import_56)if ([
|
|
631
631
|
"TreeView",
|
|
@@ -646,7 +646,7 @@ var __webpack_exports__ = {};
|
|
|
646
646
|
"default"
|
|
647
647
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_toggle_group__rspack_import_58[__rspack_import_key];
|
|
648
648
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
649
|
-
var _tooltip__rspack_import_59 = __webpack_require__("
|
|
649
|
+
var _tooltip__rspack_import_59 = __webpack_require__("@/components/ui/tooltip");
|
|
650
650
|
var __rspack_reexport = {};
|
|
651
651
|
for(const __rspack_import_key in _tooltip__rspack_import_59)if ([
|
|
652
652
|
"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;
|