@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
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronsUpDown, X } from "lucide-react";
|
|
3
|
-
import { forwardRef, useState } from "react";
|
|
3
|
+
import { forwardRef, useId, useState } from "react";
|
|
4
4
|
import { Badge } from "./badge.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { Checkbox } from "./checkbox.js";
|
|
7
7
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./command.js";
|
|
8
8
|
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
9
9
|
import { cn } from "../../lib/index.js";
|
|
10
|
-
|
|
10
|
+
import { FormFieldError } from "./form-field.js";
|
|
11
|
+
const MultiSelect = /*#__PURE__*/ 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)=>{
|
|
11
12
|
const [open, setOpen] = useState(false);
|
|
13
|
+
const generatedId = useId();
|
|
14
|
+
const validationId = errorId ?? `${id ?? `multi-select-${generatedId.replace(/:/g, '')}`}-error`;
|
|
15
|
+
const describedBy = [
|
|
16
|
+
ariaDescribedBy,
|
|
17
|
+
error ? validationId : void 0
|
|
18
|
+
].filter(Boolean).join(' ');
|
|
12
19
|
const handleUnselect = (value)=>{
|
|
13
20
|
onChange(selected.filter((s)=>s !== value));
|
|
14
21
|
};
|
|
@@ -25,129 +32,135 @@ const MultiSelect = /*#__PURE__*/ forwardRef(({ id, options, selected, onChange,
|
|
|
25
32
|
const handleClearAll = ()=>{
|
|
26
33
|
onChange([]);
|
|
27
34
|
};
|
|
28
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
29
36
|
ref: ref,
|
|
30
37
|
"data-slot": "multi-select",
|
|
31
38
|
className: cn('relative', className),
|
|
32
|
-
children:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ jsxs(Popover, {
|
|
41
|
+
open: open,
|
|
42
|
+
onOpenChange: (nextOpen)=>{
|
|
43
|
+
setOpen(nextOpen);
|
|
44
|
+
if (!nextOpen && open) onBlur?.();
|
|
45
|
+
},
|
|
46
|
+
children: [
|
|
47
|
+
/*#__PURE__*/ jsx(PopoverTrigger, {
|
|
48
|
+
asChild: true,
|
|
49
|
+
children: /*#__PURE__*/ jsxs(Button, {
|
|
50
|
+
id: id,
|
|
51
|
+
variant: "outline",
|
|
52
|
+
role: "combobox",
|
|
53
|
+
"aria-expanded": open,
|
|
54
|
+
"aria-invalid": error ? true : ariaInvalid,
|
|
55
|
+
"aria-describedby": describedBy || void 0,
|
|
56
|
+
"aria-errormessage": error ? validationId : ariaErrorMessage,
|
|
57
|
+
"aria-label": id ? void 0 : selected.length > 0 ? `${selected.length} ${1 === selected.length ? 'item' : 'items'} selected` : placeholder,
|
|
58
|
+
className: 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'),
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ jsx("div", {
|
|
62
|
+
className: "flex flex-wrap gap-1 flex-1",
|
|
63
|
+
children: 0 === selected.length ? /*#__PURE__*/ jsx("span", {
|
|
64
|
+
className: "text-foreground-muted",
|
|
65
|
+
children: placeholder
|
|
66
|
+
}) : selected.map((value)=>{
|
|
67
|
+
const option = options.find((opt)=>opt.value === value);
|
|
68
|
+
return /*#__PURE__*/ jsxs(Badge, {
|
|
69
|
+
variant: "secondary",
|
|
70
|
+
className: "mr-1 future:bg-surface-raised future:hover:bg-surface-raised",
|
|
71
|
+
onClick: (e)=>{
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
handleUnselect(value);
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
option?.label,
|
|
77
|
+
/*#__PURE__*/ jsx("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
"aria-label": `Remove ${option?.label}`,
|
|
80
|
+
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",
|
|
81
|
+
onMouseDown: (e)=>{
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
},
|
|
85
|
+
onClick: (e)=>{
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
handleUnselect(value);
|
|
89
|
+
},
|
|
90
|
+
children: /*#__PURE__*/ jsx(X, {
|
|
91
|
+
className: "h-3 w-3 text-muted-foreground hover:text-foreground"
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
}, value);
|
|
96
|
+
})
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ jsx(ChevronsUpDown, {
|
|
99
|
+
className: "h-4 w-4 shrink-0 opacity-50"
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
}),
|
|
104
|
+
/*#__PURE__*/ jsxs(PopoverContent, {
|
|
105
|
+
className: "w-[--radix-popover-trigger-width] p-0",
|
|
106
|
+
align: "start",
|
|
52
107
|
children: [
|
|
53
|
-
/*#__PURE__*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const option = options.find((opt)=>opt.value === value);
|
|
60
|
-
return /*#__PURE__*/ jsxs(Badge, {
|
|
61
|
-
variant: "secondary",
|
|
62
|
-
className: "mr-1 future:bg-surface-raised future:hover:bg-surface-raised",
|
|
63
|
-
onClick: (e)=>{
|
|
64
|
-
e.stopPropagation();
|
|
65
|
-
handleUnselect(value);
|
|
66
|
-
},
|
|
108
|
+
/*#__PURE__*/ jsxs(Command, {
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ jsx(CommandInput, {
|
|
111
|
+
placeholder: searchPlaceholder
|
|
112
|
+
}),
|
|
113
|
+
/*#__PURE__*/ jsxs(CommandList, {
|
|
67
114
|
children: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
115
|
+
/*#__PURE__*/ jsx(CommandEmpty, {
|
|
116
|
+
children: emptyMessage
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ jsx(CommandGroup, {
|
|
119
|
+
children: options.map((option)=>{
|
|
120
|
+
const isSelected = selected.includes(option.value);
|
|
121
|
+
const isDisabled = void 0 !== maxSelected && selected.length >= maxSelected && !isSelected;
|
|
122
|
+
return /*#__PURE__*/ jsxs(CommandItem, {
|
|
123
|
+
onSelect: ()=>{
|
|
124
|
+
if (!isDisabled) handleSelect(option.value);
|
|
125
|
+
},
|
|
126
|
+
disabled: isDisabled,
|
|
127
|
+
className: cn('group', isDisabled && 'opacity-50 cursor-not-allowed'),
|
|
128
|
+
children: [
|
|
129
|
+
/*#__PURE__*/ jsx(Checkbox, {
|
|
130
|
+
checked: isSelected,
|
|
131
|
+
className: "mr-2 pointer-events-none group-hover:border-muted-foreground",
|
|
132
|
+
tabIndex: -1
|
|
133
|
+
}),
|
|
134
|
+
/*#__PURE__*/ jsx("span", {
|
|
135
|
+
children: option.label
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
}, option.value);
|
|
84
139
|
})
|
|
85
140
|
})
|
|
86
141
|
]
|
|
87
|
-
}
|
|
88
|
-
|
|
142
|
+
})
|
|
143
|
+
]
|
|
89
144
|
}),
|
|
90
|
-
/*#__PURE__*/ jsx(
|
|
91
|
-
className: "
|
|
145
|
+
selected.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
146
|
+
className: "border-t p-2",
|
|
147
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
148
|
+
variant: "ghost",
|
|
149
|
+
size: "sm",
|
|
150
|
+
className: "w-full",
|
|
151
|
+
onClick: handleClearAll,
|
|
152
|
+
children: 'function' == typeof clearAllText ? clearAllText(selected.length) : clearAllText || `Clear all (${selected.length})`
|
|
153
|
+
})
|
|
92
154
|
})
|
|
93
155
|
]
|
|
94
156
|
})
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/*#__PURE__*/ jsx(CommandInput, {
|
|
103
|
-
placeholder: searchPlaceholder
|
|
104
|
-
}),
|
|
105
|
-
/*#__PURE__*/ jsxs(CommandList, {
|
|
106
|
-
children: [
|
|
107
|
-
/*#__PURE__*/ jsx(CommandEmpty, {
|
|
108
|
-
children: emptyMessage
|
|
109
|
-
}),
|
|
110
|
-
/*#__PURE__*/ jsx(CommandGroup, {
|
|
111
|
-
children: options.map((option)=>{
|
|
112
|
-
const isSelected = selected.includes(option.value);
|
|
113
|
-
const isDisabled = void 0 !== maxSelected && selected.length >= maxSelected && !isSelected;
|
|
114
|
-
return /*#__PURE__*/ jsxs(CommandItem, {
|
|
115
|
-
onSelect: ()=>{
|
|
116
|
-
if (!isDisabled) handleSelect(option.value);
|
|
117
|
-
},
|
|
118
|
-
disabled: isDisabled,
|
|
119
|
-
className: cn('group', isDisabled && 'opacity-50 cursor-not-allowed'),
|
|
120
|
-
children: [
|
|
121
|
-
/*#__PURE__*/ jsx(Checkbox, {
|
|
122
|
-
checked: isSelected,
|
|
123
|
-
className: "mr-2 pointer-events-none group-hover:border-muted-foreground",
|
|
124
|
-
tabIndex: -1
|
|
125
|
-
}),
|
|
126
|
-
/*#__PURE__*/ jsx("span", {
|
|
127
|
-
children: option.label
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
}, option.value);
|
|
131
|
-
})
|
|
132
|
-
})
|
|
133
|
-
]
|
|
134
|
-
})
|
|
135
|
-
]
|
|
136
|
-
}),
|
|
137
|
-
selected.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
138
|
-
className: "border-t p-2",
|
|
139
|
-
children: /*#__PURE__*/ jsx(Button, {
|
|
140
|
-
variant: "ghost",
|
|
141
|
-
size: "sm",
|
|
142
|
-
className: "w-full",
|
|
143
|
-
onClick: handleClearAll,
|
|
144
|
-
children: 'function' == typeof clearAllText ? clearAllText(selected.length) : clearAllText || `Clear all (${selected.length})`
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
]
|
|
148
|
-
})
|
|
149
|
-
]
|
|
150
|
-
})
|
|
157
|
+
]
|
|
158
|
+
}),
|
|
159
|
+
/*#__PURE__*/ jsx(FormFieldError, {
|
|
160
|
+
id: validationId,
|
|
161
|
+
children: error
|
|
162
|
+
})
|
|
163
|
+
]
|
|
151
164
|
});
|
|
152
165
|
});
|
|
153
166
|
MultiSelect.displayName = 'MultiSelect';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
ShortcutContainmentPlugin: ()=>ShortcutContainmentPlugin,
|
|
28
|
+
registerShortcutContainment: ()=>registerShortcutContainment
|
|
29
|
+
});
|
|
30
|
+
const LexicalComposerContext_namespaceObject = require("@lexical/react/LexicalComposerContext");
|
|
31
|
+
const external_lexical_namespaceObject = require("lexical");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const FORMATTING_KEYS = [
|
|
34
|
+
'b',
|
|
35
|
+
'i',
|
|
36
|
+
'u'
|
|
37
|
+
];
|
|
38
|
+
const IS_APPLE = "u" > typeof navigator && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
39
|
+
const CONTROL_OR_META = {
|
|
40
|
+
ctrlKey: !IS_APPLE,
|
|
41
|
+
metaKey: IS_APPLE
|
|
42
|
+
};
|
|
43
|
+
const registerShortcutContainment = (editor)=>editor.registerCommand(external_lexical_namespaceObject.KEY_DOWN_COMMAND, (event)=>{
|
|
44
|
+
if (FORMATTING_KEYS.some((key)=>(0, external_lexical_namespaceObject.isExactShortcutMatch)(event, key, CONTROL_OR_META))) event.stopPropagation();
|
|
45
|
+
return false;
|
|
46
|
+
}, external_lexical_namespaceObject.COMMAND_PRIORITY_NORMAL);
|
|
47
|
+
const ShortcutContainmentPlugin = ()=>{
|
|
48
|
+
const [editor] = (0, LexicalComposerContext_namespaceObject.useLexicalComposerContext)();
|
|
49
|
+
(0, external_react_namespaceObject.useEffect)(()=>registerShortcutContainment(editor), [
|
|
50
|
+
editor
|
|
51
|
+
]);
|
|
52
|
+
return null;
|
|
53
|
+
};
|
|
54
|
+
exports.ShortcutContainmentPlugin = __webpack_exports__.ShortcutContainmentPlugin;
|
|
55
|
+
exports.registerShortcutContainment = __webpack_exports__.registerShortcutContainment;
|
|
56
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
57
|
+
"ShortcutContainmentPlugin",
|
|
58
|
+
"registerShortcutContainment"
|
|
59
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
60
|
+
Object.defineProperty(exports, '__esModule', {
|
|
61
|
+
value: true
|
|
62
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type LexicalEditor } from 'lexical';
|
|
2
|
+
/**
|
|
3
|
+
* Keeps the formatting chords the editor consumes from reaching the host.
|
|
4
|
+
*
|
|
5
|
+
* Lexical's `$handleKeyDown` calls `preventDefault()` on Cmd/Ctrl+B / +I / +U and
|
|
6
|
+
* dispatches `FORMAT_TEXT_COMMAND`, but lets the event keep bubbling. A host that binds
|
|
7
|
+
* the same chord then acts on a keystroke the editor already ate: in a VS Code webview,
|
|
8
|
+
* bolding prompt-editor text also toggles the left sidebar, because VS Code forwards
|
|
9
|
+
* document-level keydown to its keybinding layer without consulting `defaultPrevented`.
|
|
10
|
+
*
|
|
11
|
+
* Only the chords we actually consume are swallowed. Cmd+A, Cmd+S, Cmd+V and friends
|
|
12
|
+
* still reach the host untouched.
|
|
13
|
+
*
|
|
14
|
+
* Registered at `COMMAND_PRIORITY_NORMAL`, above the `COMMAND_PRIORITY_EDITOR` slot
|
|
15
|
+
* Lexical's own handler occupies, and returns `false` so that handler still formats.
|
|
16
|
+
*/
|
|
17
|
+
export declare const registerShortcutContainment: (editor: LexicalEditor) => (() => void);
|
|
18
|
+
/** Rich-mode only: the plain editor applies none of these formats, so its chords belong to the host. */
|
|
19
|
+
export declare const ShortcutContainmentPlugin: () => null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
2
|
+
import { COMMAND_PRIORITY_NORMAL, KEY_DOWN_COMMAND, isExactShortcutMatch } from "lexical";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
const FORMATTING_KEYS = [
|
|
5
|
+
'b',
|
|
6
|
+
'i',
|
|
7
|
+
'u'
|
|
8
|
+
];
|
|
9
|
+
const IS_APPLE = "u" > typeof navigator && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
10
|
+
const CONTROL_OR_META = {
|
|
11
|
+
ctrlKey: !IS_APPLE,
|
|
12
|
+
metaKey: IS_APPLE
|
|
13
|
+
};
|
|
14
|
+
const registerShortcutContainment = (editor)=>editor.registerCommand(KEY_DOWN_COMMAND, (event)=>{
|
|
15
|
+
if (FORMATTING_KEYS.some((key)=>isExactShortcutMatch(event, key, CONTROL_OR_META))) event.stopPropagation();
|
|
16
|
+
return false;
|
|
17
|
+
}, COMMAND_PRIORITY_NORMAL);
|
|
18
|
+
const ShortcutContainmentPlugin = ()=>{
|
|
19
|
+
const [editor] = useLexicalComposerContext();
|
|
20
|
+
useEffect(()=>registerShortcutContainment(editor), [
|
|
21
|
+
editor
|
|
22
|
+
]);
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
25
|
+
export { ShortcutContainmentPlugin, registerShortcutContainment };
|
|
@@ -49,6 +49,7 @@ const EditorRefPlugin_cjs_namespaceObject = require("./plugins/EditorRefPlugin.c
|
|
|
49
49
|
const MultilinePlugin_cjs_namespaceObject = require("./plugins/MultilinePlugin.cjs");
|
|
50
50
|
const NodeSelectionFixPlugin_cjs_namespaceObject = require("./plugins/NodeSelectionFixPlugin.cjs");
|
|
51
51
|
const RenameTokensPlugin_cjs_namespaceObject = require("./plugins/RenameTokensPlugin.cjs");
|
|
52
|
+
const ShortcutContainmentPlugin_cjs_namespaceObject = require("./plugins/ShortcutContainmentPlugin.cjs");
|
|
52
53
|
const ToolbarActionsPlugin_cjs_namespaceObject = require("./plugins/ToolbarActionsPlugin.cjs");
|
|
53
54
|
const ValidateTokensPlugin_cjs_namespaceObject = require("./plugins/ValidateTokensPlugin.cjs");
|
|
54
55
|
const ValueSyncPlugin_cjs_namespaceObject = require("./plugins/ValueSyncPlugin.cjs");
|
|
@@ -317,6 +318,7 @@ const EditorInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)
|
|
|
317
318
|
richText && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
318
319
|
children: [
|
|
319
320
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(LexicalListPlugin_namespaceObject.ListPlugin, {}),
|
|
321
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ShortcutContainmentPlugin_cjs_namespaceObject.ShortcutContainmentPlugin, {}),
|
|
320
322
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(LexicalMarkdownShortcutPlugin_namespaceObject.MarkdownShortcutPlugin, {
|
|
321
323
|
transformers: rich_serialization_cjs_namespaceObject.PROMPT_EDITOR_RICH_TRANSFORMERS
|
|
322
324
|
})
|
|
@@ -527,8 +529,6 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
527
529
|
}),
|
|
528
530
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
529
531
|
id: errorId,
|
|
530
|
-
"data-slot": "prompt-editor-error",
|
|
531
|
-
className: "mt-1",
|
|
532
532
|
children: error
|
|
533
533
|
})
|
|
534
534
|
]
|
|
@@ -21,6 +21,7 @@ import { EditorRefPlugin } from "./plugins/EditorRefPlugin.js";
|
|
|
21
21
|
import { MultilinePlugin } from "./plugins/MultilinePlugin.js";
|
|
22
22
|
import { NodeSelectionFixPlugin } from "./plugins/NodeSelectionFixPlugin.js";
|
|
23
23
|
import { RenameTokensPlugin } from "./plugins/RenameTokensPlugin.js";
|
|
24
|
+
import { ShortcutContainmentPlugin } from "./plugins/ShortcutContainmentPlugin.js";
|
|
24
25
|
import { ToolbarActionsPlugin } from "./plugins/ToolbarActionsPlugin.js";
|
|
25
26
|
import { ValidateTokensPlugin } from "./plugins/ValidateTokensPlugin.js";
|
|
26
27
|
import { ValueSyncPlugin } from "./plugins/ValueSyncPlugin.js";
|
|
@@ -289,6 +290,7 @@ const EditorInner = /*#__PURE__*/ forwardRef(({ initialValue, value, onChange, a
|
|
|
289
290
|
richText && /*#__PURE__*/ jsxs(Fragment, {
|
|
290
291
|
children: [
|
|
291
292
|
/*#__PURE__*/ jsx(ListPlugin, {}),
|
|
293
|
+
/*#__PURE__*/ jsx(ShortcutContainmentPlugin, {}),
|
|
292
294
|
/*#__PURE__*/ jsx(MarkdownShortcutPlugin, {
|
|
293
295
|
transformers: PROMPT_EDITOR_RICH_TRANSFORMERS
|
|
294
296
|
})
|
|
@@ -499,8 +501,6 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
499
501
|
}),
|
|
500
502
|
/*#__PURE__*/ jsx(FormFieldError, {
|
|
501
503
|
id: errorId,
|
|
502
|
-
"data-slot": "prompt-editor-error",
|
|
503
|
-
className: "mt-1",
|
|
504
504
|
children: error
|
|
505
505
|
})
|
|
506
506
|
]
|
|
@@ -34,7 +34,7 @@ const external_react_namespaceObject = require("react");
|
|
|
34
34
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
35
35
|
const RadioGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Root, {
|
|
36
36
|
"data-slot": "radio-group",
|
|
37
|
-
className: (0, index_cjs_namespaceObject.cn)('grid gap-2', className),
|
|
37
|
+
className: (0, index_cjs_namespaceObject.cn)('group/radio-group grid gap-2', className),
|
|
38
38
|
...props,
|
|
39
39
|
ref: ref
|
|
40
40
|
}));
|
|
@@ -42,7 +42,7 @@ RadioGroup.displayName = react_radio_group_namespaceObject.Root.displayName;
|
|
|
42
42
|
const RadioGroupItem = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Item, {
|
|
43
43
|
ref: ref,
|
|
44
44
|
"data-slot": "radio-group-item",
|
|
45
|
-
className: (0, index_cjs_namespaceObject.cn)('aspect-square h-4 w-4 cursor-pointer rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', 'future:border-border future:text-foreground future:hover:border-border-hover future:data-[state=checked]:border-foreground-muted', className),
|
|
45
|
+
className: (0, index_cjs_namespaceObject.cn)('aspect-square h-4 w-4 cursor-pointer rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 group-aria-invalid/radio-group:border-error group-aria-invalid/radio-group:focus-visible:ring-error', 'future:border-border future:text-foreground future:hover:border-border-hover future:data-[state=checked]:border-foreground-muted future:group-aria-invalid/radio-group:border-error', 'future:group-aria-invalid/radio-group:hover:border-error future:group-aria-invalid/radio-group:data-[state=checked]:border-error', className),
|
|
46
46
|
...props,
|
|
47
47
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Indicator, {
|
|
48
48
|
className: "flex items-center justify-center",
|
|
@@ -5,7 +5,7 @@ import { forwardRef } from "react";
|
|
|
5
5
|
import { cn } from "../../lib/index.js";
|
|
6
6
|
const RadioGroup = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Root, {
|
|
7
7
|
"data-slot": "radio-group",
|
|
8
|
-
className: cn('grid gap-2', className),
|
|
8
|
+
className: cn('group/radio-group grid gap-2', className),
|
|
9
9
|
...props,
|
|
10
10
|
ref: ref
|
|
11
11
|
}));
|
|
@@ -13,7 +13,7 @@ RadioGroup.displayName = Root.displayName;
|
|
|
13
13
|
const RadioGroupItem = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Item, {
|
|
14
14
|
ref: ref,
|
|
15
15
|
"data-slot": "radio-group-item",
|
|
16
|
-
className: cn('aspect-square h-4 w-4 cursor-pointer rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', 'future:border-border future:text-foreground future:hover:border-border-hover future:data-[state=checked]:border-foreground-muted', className),
|
|
16
|
+
className: cn('aspect-square h-4 w-4 cursor-pointer rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 group-aria-invalid/radio-group:border-error group-aria-invalid/radio-group:focus-visible:ring-error', 'future:border-border future:text-foreground future:hover:border-border-hover future:data-[state=checked]:border-foreground-muted future:group-aria-invalid/radio-group:border-error', 'future:group-aria-invalid/radio-group:hover:border-error future:group-aria-invalid/radio-group:data-[state=checked]:border-error', className),
|
|
17
17
|
...props,
|
|
18
18
|
children: /*#__PURE__*/ jsx(Indicator, {
|
|
19
19
|
className: "flex items-center justify-center",
|
|
@@ -34,7 +34,7 @@ const external_command_cjs_namespaceObject = require("./command.cjs");
|
|
|
34
34
|
const external_input_group_cjs_namespaceObject = require("./input-group.cjs");
|
|
35
35
|
const external_popover_cjs_namespaceObject = require("./popover.cjs");
|
|
36
36
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
37
|
-
const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, ...props }, ref)=>{
|
|
37
|
+
const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, error, errorId, ...props }, ref)=>{
|
|
38
38
|
const handleClear = ()=>{
|
|
39
39
|
onChange?.('');
|
|
40
40
|
onClear?.();
|
|
@@ -43,6 +43,8 @@ const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ classN
|
|
|
43
43
|
"data-slot": "search",
|
|
44
44
|
variant: variant,
|
|
45
45
|
size: size,
|
|
46
|
+
error: error,
|
|
47
|
+
errorId: errorId,
|
|
46
48
|
children: [
|
|
47
49
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
48
50
|
align: "inline-start",
|
|
@@ -7,6 +7,10 @@ export interface SearchProps extends Omit<InputGroupInputProps, 'onChange'> {
|
|
|
7
7
|
showClearButton?: boolean;
|
|
8
8
|
variant?: InputGroupProps['variant'];
|
|
9
9
|
size?: InputGroupProps['size'];
|
|
10
|
+
/** Field-specific feedback rendered immediately below the search field. */
|
|
11
|
+
error?: React.ReactNode;
|
|
12
|
+
/** Optional id for the inline validation message. */
|
|
13
|
+
errorId?: string;
|
|
10
14
|
}
|
|
11
15
|
declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<HTMLInputElement>>;
|
|
12
16
|
export interface SearchWithSuggestionsProps {
|
|
@@ -5,7 +5,7 @@ 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 search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, ...props }, ref)=>{
|
|
8
|
+
const search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, error, errorId, ...props }, ref)=>{
|
|
9
9
|
const handleClear = ()=>{
|
|
10
10
|
onChange?.('');
|
|
11
11
|
onClear?.();
|
|
@@ -14,6 +14,8 @@ const search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, on
|
|
|
14
14
|
"data-slot": "search",
|
|
15
15
|
variant: variant,
|
|
16
16
|
size: size,
|
|
17
|
+
error: error,
|
|
18
|
+
errorId: errorId,
|
|
17
19
|
children: [
|
|
18
20
|
/*#__PURE__*/ jsx(InputGroupAddon, {
|
|
19
21
|
align: "inline-start",
|
|
@@ -42,6 +42,7 @@ const external_lucide_react_namespaceObject = require("lucide-react");
|
|
|
42
42
|
const external_react_namespaceObject = require("react");
|
|
43
43
|
const external_portal_container_cjs_namespaceObject = require("./portal-container.cjs");
|
|
44
44
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
45
|
+
const external_form_field_cjs_namespaceObject = require("./form-field.cjs");
|
|
45
46
|
const Select = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_select_namespaceObject.Root, {
|
|
46
47
|
"data-slot": "select",
|
|
47
48
|
...props
|
|
@@ -59,21 +60,41 @@ const SelectValue = /*#__PURE__*/ external_react_namespaceObject.forwardRef((pro
|
|
|
59
60
|
...props
|
|
60
61
|
}));
|
|
61
62
|
SelectValue.displayName = react_select_namespaceObject.Value.displayName;
|
|
62
|
-
const SelectTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, children, ...props }, ref)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const SelectTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, children, error, errorId, id, ...props }, ref)=>{
|
|
64
|
+
const generatedId = external_react_namespaceObject.useId();
|
|
65
|
+
const validationId = errorId ?? `${id ?? `select-${generatedId.replace(/:/g, '')}`}-error`;
|
|
66
|
+
const describedBy = [
|
|
67
|
+
ariaDescribedBy,
|
|
68
|
+
error ? validationId : void 0
|
|
69
|
+
].filter(Boolean).join(' ');
|
|
70
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
67
71
|
children: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_select_namespaceObject.Trigger, {
|
|
73
|
+
ref: ref,
|
|
74
|
+
id: id,
|
|
75
|
+
"data-slot": "select-trigger",
|
|
76
|
+
"aria-describedby": describedBy || void 0,
|
|
77
|
+
"aria-errormessage": error ? validationId : ariaErrorMessage,
|
|
78
|
+
"aria-invalid": error ? true : ariaInvalid,
|
|
79
|
+
className: (0, index_cjs_namespaceObject.cn)('flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-input bg-transparent px-3 py-1 text-base transition-colors data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [&>span]:line-clamp-1 future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:px-4 future:gap-4 future:font-normal aria-invalid:border-error aria-invalid:focus-visible:ring-error future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
|
|
80
|
+
...props,
|
|
81
|
+
children: [
|
|
82
|
+
children,
|
|
83
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_select_namespaceObject.Icon, {
|
|
84
|
+
asChild: true,
|
|
85
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
|
|
86
|
+
className: "h-4 w-4 opacity-50"
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
92
|
+
id: validationId,
|
|
93
|
+
children: error
|
|
74
94
|
})
|
|
75
95
|
]
|
|
76
|
-
})
|
|
96
|
+
});
|
|
97
|
+
});
|
|
77
98
|
SelectTrigger.displayName = react_select_namespaceObject.Trigger.displayName;
|
|
78
99
|
const SelectScrollUpButton = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_select_namespaceObject.ScrollUpButton, {
|
|
79
100
|
ref: ref,
|
|
@@ -7,7 +7,16 @@ declare const Select: {
|
|
|
7
7
|
};
|
|
8
8
|
declare const SelectGroup: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const SelectValue: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
10
|
-
|
|
10
|
+
export interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
|
|
11
|
+
/**
|
|
12
|
+
* Field-specific feedback rendered immediately below the trigger.
|
|
13
|
+
* Keep the message focused on what went wrong and how to resolve it.
|
|
14
|
+
*/
|
|
15
|
+
error?: React.ReactNode;
|
|
16
|
+
/** Optional id for the inline validation message. */
|
|
17
|
+
errorId?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
20
|
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
21
|
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
22
|
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|