@uipath/apollo-wind 2.41.0 → 2.43.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/ui/combobox.cjs +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/dropdown-menu.cjs +12 -2
- package/dist/components/ui/dropdown-menu.d.ts +8 -1
- package/dist/components/ui/dropdown-menu.js +12 -2
- package/dist/components/ui/index.cjs +10 -10
- package/dist/components/ui/multi-select.cjs +2 -2
- package/dist/components/ui/multi-select.js +2 -2
- package/dist/components/ui/prompt-editor/components/EditorToolbar.cjs +3 -3
- package/dist/components/ui/prompt-editor/components/EditorToolbar.d.ts +2 -1
- package/dist/components/ui/prompt-editor/components/EditorToolbar.js +3 -3
- package/dist/components/ui/prompt-editor/prompt-editor.cjs +30 -7
- package/dist/components/ui/prompt-editor/prompt-editor.d.ts +9 -1
- package/dist/components/ui/prompt-editor/prompt-editor.js +31 -8
- package/dist/styles.css +9 -163
- package/package.json +1 -1
|
@@ -50,7 +50,7 @@ const combobox_Combobox = /*#__PURE__*/ external_react_namespaceObject.forwardRe
|
|
|
50
50
|
role: "combobox",
|
|
51
51
|
"aria-expanded": open,
|
|
52
52
|
"aria-label": selectedItem ? selectedItem.label : placeholder,
|
|
53
|
-
className: (0, index_cjs_namespaceObject.cn)('w-[280px] justify-between future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:font-normal future:text-muted-foreground', className),
|
|
53
|
+
className: (0, index_cjs_namespaceObject.cn)('w-[280px] justify-between future:h-10 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-muted-foreground future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', className),
|
|
54
54
|
disabled: disabled,
|
|
55
55
|
children: [
|
|
56
56
|
selectedItem ? selectedItem.label : placeholder,
|
|
@@ -22,7 +22,7 @@ const combobox_Combobox = /*#__PURE__*/ forwardRef(function({ items, value, onVa
|
|
|
22
22
|
role: "combobox",
|
|
23
23
|
"aria-expanded": open,
|
|
24
24
|
"aria-label": selectedItem ? selectedItem.label : placeholder,
|
|
25
|
-
className: cn('w-[280px] justify-between future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:font-normal future:text-muted-foreground', className),
|
|
25
|
+
className: cn('w-[280px] justify-between future:h-10 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-muted-foreground future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', className),
|
|
26
26
|
disabled: disabled,
|
|
27
27
|
children: [
|
|
28
28
|
selectedItem ? selectedItem.label : placeholder,
|
|
@@ -52,11 +52,21 @@ const DropdownMenu = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)
|
|
|
52
52
|
...props
|
|
53
53
|
});
|
|
54
54
|
DropdownMenu.displayName = 'DropdownMenu';
|
|
55
|
-
const DropdownMenuTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef((
|
|
55
|
+
const DropdownMenuTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, field, error, errorId, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-errormessage': ariaErrorMessage, ...props }, ref)=>{
|
|
56
|
+
const describedBy = [
|
|
57
|
+
ariaDescribedBy,
|
|
58
|
+
error ? errorId : void 0
|
|
59
|
+
].filter(Boolean).join(' ');
|
|
60
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Trigger, {
|
|
56
61
|
ref: ref,
|
|
57
62
|
"data-slot": "dropdown-menu-trigger",
|
|
63
|
+
className: (0, index_cjs_namespaceObject.cn)(field && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:font-normal future:text-muted-foreground future:hover:bg-surface-hover', error && 'border-error ring-1 ring-error/20 future:ring-error/40', className),
|
|
64
|
+
"aria-describedby": describedBy || void 0,
|
|
65
|
+
"aria-errormessage": error ? errorId ?? ariaErrorMessage : ariaErrorMessage,
|
|
66
|
+
"aria-invalid": error ? true : ariaInvalid,
|
|
58
67
|
...props
|
|
59
|
-
})
|
|
68
|
+
});
|
|
69
|
+
});
|
|
60
70
|
DropdownMenuTrigger.displayName = react_dropdown_menu_namespaceObject.Trigger.displayName;
|
|
61
71
|
const DropdownMenuGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef((props, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Group, {
|
|
62
72
|
ref: ref,
|
|
@@ -5,7 +5,14 @@ declare const DropdownMenu: {
|
|
|
5
5
|
(props: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
8
|
-
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> &
|
|
8
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
9
|
+
/** Apply the Future theme field treatment when the trigger is used as a form control. */
|
|
10
|
+
field?: boolean;
|
|
11
|
+
/** Field-specific validation feedback rendered below the trigger by the consumer. */
|
|
12
|
+
error?: React.ReactNode;
|
|
13
|
+
/** Optional id for the validation message referenced by aria-describedby. */
|
|
14
|
+
errorId?: string;
|
|
15
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
9
16
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
17
|
declare const DropdownMenuPortal: {
|
|
11
18
|
(props: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,11 +10,21 @@ const DropdownMenu = (props)=>/*#__PURE__*/ jsx(Root, {
|
|
|
10
10
|
...props
|
|
11
11
|
});
|
|
12
12
|
DropdownMenu.displayName = 'DropdownMenu';
|
|
13
|
-
const DropdownMenuTrigger = /*#__PURE__*/ forwardRef((props, ref)
|
|
13
|
+
const DropdownMenuTrigger = /*#__PURE__*/ forwardRef(({ className, field, error, errorId, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-errormessage': ariaErrorMessage, ...props }, ref)=>{
|
|
14
|
+
const describedBy = [
|
|
15
|
+
ariaDescribedBy,
|
|
16
|
+
error ? errorId : void 0
|
|
17
|
+
].filter(Boolean).join(' ');
|
|
18
|
+
return /*#__PURE__*/ jsx(Trigger, {
|
|
14
19
|
ref: ref,
|
|
15
20
|
"data-slot": "dropdown-menu-trigger",
|
|
21
|
+
className: cn(field && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:font-normal future:text-muted-foreground future:hover:bg-surface-hover', error && 'border-error ring-1 ring-error/20 future:ring-error/40', className),
|
|
22
|
+
"aria-describedby": describedBy || void 0,
|
|
23
|
+
"aria-errormessage": error ? errorId ?? ariaErrorMessage : ariaErrorMessage,
|
|
24
|
+
"aria-invalid": error ? true : ariaInvalid,
|
|
16
25
|
...props
|
|
17
|
-
})
|
|
26
|
+
});
|
|
27
|
+
});
|
|
18
28
|
DropdownMenuTrigger.displayName = Trigger.displayName;
|
|
19
29
|
const DropdownMenuGroup = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Group, {
|
|
20
30
|
ref: ref,
|
|
@@ -60,16 +60,16 @@ var __webpack_modules__ = {
|
|
|
60
60
|
"./datetime-picker" (module) {
|
|
61
61
|
module.exports = require("./datetime-picker.cjs");
|
|
62
62
|
},
|
|
63
|
-
"
|
|
63
|
+
"@/components/ui/dialog" (module) {
|
|
64
64
|
module.exports = require("./dialog.cjs");
|
|
65
65
|
},
|
|
66
66
|
"./drawer" (module) {
|
|
67
67
|
module.exports = require("./drawer.cjs");
|
|
68
68
|
},
|
|
69
|
-
"
|
|
69
|
+
"./dropdown-menu" (module) {
|
|
70
70
|
module.exports = require("./dropdown-menu.cjs");
|
|
71
71
|
},
|
|
72
|
-
"
|
|
72
|
+
"./editable-cell" (module) {
|
|
73
73
|
module.exports = require("./editable-cell.cjs");
|
|
74
74
|
},
|
|
75
75
|
"./empty-state" (module) {
|
|
@@ -159,13 +159,13 @@ var __webpack_modules__ = {
|
|
|
159
159
|
"./switch" (module) {
|
|
160
160
|
module.exports = require("./switch.cjs");
|
|
161
161
|
},
|
|
162
|
-
"
|
|
162
|
+
"./table" (module) {
|
|
163
163
|
module.exports = require("./table.cjs");
|
|
164
164
|
},
|
|
165
165
|
"./tabs" (module) {
|
|
166
166
|
module.exports = require("./tabs.cjs");
|
|
167
167
|
},
|
|
168
|
-
"
|
|
168
|
+
"./textarea" (module) {
|
|
169
169
|
module.exports = require("./textarea.cjs");
|
|
170
170
|
},
|
|
171
171
|
"./toggle-group" (module) {
|
|
@@ -370,7 +370,7 @@ var __webpack_exports__ = {};
|
|
|
370
370
|
"default"
|
|
371
371
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_datetime_picker__rspack_import_19[__rspack_import_key];
|
|
372
372
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
373
|
-
var _dialog__rspack_import_20 = __webpack_require__("
|
|
373
|
+
var _dialog__rspack_import_20 = __webpack_require__("@/components/ui/dialog");
|
|
374
374
|
var __rspack_reexport = {};
|
|
375
375
|
for(const __rspack_import_key in _dialog__rspack_import_20)if ([
|
|
376
376
|
"TreeView",
|
|
@@ -384,14 +384,14 @@ var __webpack_exports__ = {};
|
|
|
384
384
|
"default"
|
|
385
385
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_drawer__rspack_import_21[__rspack_import_key];
|
|
386
386
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
387
|
-
var _dropdown_menu__rspack_import_22 = __webpack_require__("
|
|
387
|
+
var _dropdown_menu__rspack_import_22 = __webpack_require__("./dropdown-menu");
|
|
388
388
|
var __rspack_reexport = {};
|
|
389
389
|
for(const __rspack_import_key in _dropdown_menu__rspack_import_22)if ([
|
|
390
390
|
"TreeView",
|
|
391
391
|
"default"
|
|
392
392
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_dropdown_menu__rspack_import_22[__rspack_import_key];
|
|
393
393
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
394
|
-
var _editable_cell__rspack_import_23 = __webpack_require__("
|
|
394
|
+
var _editable_cell__rspack_import_23 = __webpack_require__("./editable-cell");
|
|
395
395
|
var __rspack_reexport = {};
|
|
396
396
|
for(const __rspack_import_key in _editable_cell__rspack_import_23)if ([
|
|
397
397
|
"TreeView",
|
|
@@ -601,7 +601,7 @@ var __webpack_exports__ = {};
|
|
|
601
601
|
"default"
|
|
602
602
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_52[__rspack_import_key];
|
|
603
603
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
604
|
-
var _table__rspack_import_53 = __webpack_require__("
|
|
604
|
+
var _table__rspack_import_53 = __webpack_require__("./table");
|
|
605
605
|
var __rspack_reexport = {};
|
|
606
606
|
for(const __rspack_import_key in _table__rspack_import_53)if ([
|
|
607
607
|
"TreeView",
|
|
@@ -615,7 +615,7 @@ var __webpack_exports__ = {};
|
|
|
615
615
|
"default"
|
|
616
616
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tabs__rspack_import_54[__rspack_import_key];
|
|
617
617
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
618
|
-
var _textarea__rspack_import_55 = __webpack_require__("
|
|
618
|
+
var _textarea__rspack_import_55 = __webpack_require__("./textarea");
|
|
619
619
|
var __rspack_reexport = {};
|
|
620
620
|
for(const __rspack_import_key in _textarea__rspack_import_55)if ([
|
|
621
621
|
"TreeView",
|
|
@@ -75,13 +75,13 @@ const MultiSelect = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ i
|
|
|
75
75
|
"aria-describedby": ariaDescribedBy,
|
|
76
76
|
"aria-errormessage": ariaErrorMessage,
|
|
77
77
|
"aria-label": id ? void 0 : selected.length > 0 ? `${selected.length} ${1 === selected.length ? 'item' : 'items'} selected` : placeholder,
|
|
78
|
-
className: (0, index_cjs_namespaceObject.cn)('w-full justify-between future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:font-normal future:text-muted-foreground', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
|
|
78
|
+
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-muted-foreground future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
|
|
79
79
|
disabled: disabled,
|
|
80
80
|
children: [
|
|
81
81
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
82
82
|
className: "flex flex-wrap gap-1 flex-1",
|
|
83
83
|
children: 0 === selected.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
84
|
-
className: "text-muted-foreground",
|
|
84
|
+
className: "text-muted-foreground future:text-foreground-muted",
|
|
85
85
|
children: placeholder
|
|
86
86
|
}) : selected.map((value)=>{
|
|
87
87
|
const option = options.find((opt)=>opt.value === value);
|
|
@@ -47,13 +47,13 @@ const MultiSelect = /*#__PURE__*/ forwardRef(({ id, options, selected, onChange,
|
|
|
47
47
|
"aria-describedby": ariaDescribedBy,
|
|
48
48
|
"aria-errormessage": ariaErrorMessage,
|
|
49
49
|
"aria-label": id ? void 0 : selected.length > 0 ? `${selected.length} ${1 === selected.length ? 'item' : 'items'} selected` : placeholder,
|
|
50
|
-
className: cn('w-full justify-between future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:font-normal future:text-muted-foreground', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
|
|
50
|
+
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-muted-foreground future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
|
|
51
51
|
disabled: disabled,
|
|
52
52
|
children: [
|
|
53
53
|
/*#__PURE__*/ jsx("div", {
|
|
54
54
|
className: "flex flex-wrap gap-1 flex-1",
|
|
55
55
|
children: 0 === selected.length ? /*#__PURE__*/ jsx("span", {
|
|
56
|
-
className: "text-muted-foreground",
|
|
56
|
+
className: "text-muted-foreground future:text-foreground-muted",
|
|
57
57
|
children: placeholder
|
|
58
58
|
}) : selected.map((value)=>{
|
|
59
59
|
const option = options.find((opt)=>opt.value === value);
|
|
@@ -28,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
-
const index_cjs_namespaceObject = require("../../../../lib/index.cjs");
|
|
32
31
|
const external_tooltip_cjs_namespaceObject = require("../../tooltip.cjs");
|
|
32
|
+
const index_cjs_namespaceObject = require("../../../../lib/index.cjs");
|
|
33
33
|
const ToolbarButton = ({ icon: Icon, label, disabled, onClick })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
34
34
|
children: [
|
|
35
35
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
|
|
@@ -58,7 +58,7 @@ const ToolbarSeparator = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
|
58
58
|
"aria-hidden": true,
|
|
59
59
|
className: "mx-1 h-4 w-px bg-border/60"
|
|
60
60
|
});
|
|
61
|
-
const EditorToolbar = ({ mode, onModeChange, disabled, actionsRef, onFullscreen })=>{
|
|
61
|
+
const EditorToolbar = ({ mode, onModeChange, disabled, error, actionsRef, onFullscreen })=>{
|
|
62
62
|
const isEditMode = 'edit' === mode;
|
|
63
63
|
const handleFormat = (actionName)=>()=>{
|
|
64
64
|
if (!disabled && isEditMode) {
|
|
@@ -67,7 +67,7 @@ const EditorToolbar = ({ mode, onModeChange, disabled, actionsRef, onFullscreen
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
70
|
-
className:
|
|
70
|
+
className: (0, index_cjs_namespaceObject.cn)('relative flex items-center justify-between gap-1 overflow-hidden rounded-t-md border border-b-0 bg-background px-2 py-1 future:rounded-t-xl future:border-0 future:bg-surface-overlay', error && 'border-error ring-1 ring-error/20 future:ring-error/40'),
|
|
71
71
|
"data-testid": "editor-toolbar",
|
|
72
72
|
children: [
|
|
73
73
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
@@ -3,7 +3,8 @@ export interface EditorToolbarProps {
|
|
|
3
3
|
mode: PromptEditorMode;
|
|
4
4
|
onModeChange: (mode: PromptEditorMode) => void;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
error?: boolean;
|
|
6
7
|
actionsRef?: React.RefObject<PromptEditorToolbarActionsRef | null>;
|
|
7
8
|
onFullscreen?: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const EditorToolbar: ({ mode, onModeChange, disabled, actionsRef, onFullscreen, }: EditorToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const EditorToolbar: ({ mode, onModeChange, disabled, error, actionsRef, onFullscreen, }: EditorToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Bold, Italic, List, ListOrdered, Maximize2, Strikethrough } from "lucide-react";
|
|
3
|
-
import { cn } from "../../../../lib/index.js";
|
|
4
3
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../tooltip.js";
|
|
4
|
+
import { cn } from "../../../../lib/index.js";
|
|
5
5
|
const ToolbarButton = ({ icon: Icon, label, disabled, onClick })=>/*#__PURE__*/ jsxs(Tooltip, {
|
|
6
6
|
children: [
|
|
7
7
|
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
@@ -30,7 +30,7 @@ const ToolbarSeparator = ()=>/*#__PURE__*/ jsx("span", {
|
|
|
30
30
|
"aria-hidden": true,
|
|
31
31
|
className: "mx-1 h-4 w-px bg-border/60"
|
|
32
32
|
});
|
|
33
|
-
const EditorToolbar = ({ mode, onModeChange, disabled, actionsRef, onFullscreen })=>{
|
|
33
|
+
const EditorToolbar = ({ mode, onModeChange, disabled, error, actionsRef, onFullscreen })=>{
|
|
34
34
|
const isEditMode = 'edit' === mode;
|
|
35
35
|
const handleFormat = (actionName)=>()=>{
|
|
36
36
|
if (!disabled && isEditMode) {
|
|
@@ -39,7 +39,7 @@ const EditorToolbar = ({ mode, onModeChange, disabled, actionsRef, onFullscreen
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
return /*#__PURE__*/ jsxs("div", {
|
|
42
|
-
className:
|
|
42
|
+
className: cn('relative flex items-center justify-between gap-1 overflow-hidden rounded-t-md border border-b-0 bg-background px-2 py-1 future:rounded-t-xl future:border-0 future:bg-surface-overlay', error && 'border-error ring-1 ring-error/20 future:ring-error/40'),
|
|
43
43
|
"data-testid": "editor-toolbar",
|
|
44
44
|
children: [
|
|
45
45
|
/*#__PURE__*/ jsx("span", {
|
|
@@ -35,6 +35,7 @@ const LexicalOnChangePlugin_namespaceObject = require("@lexical/react/LexicalOnC
|
|
|
35
35
|
const LexicalPlainTextPlugin_namespaceObject = require("@lexical/react/LexicalPlainTextPlugin");
|
|
36
36
|
const external_lexical_namespaceObject = require("lexical");
|
|
37
37
|
const external_react_namespaceObject = require("react");
|
|
38
|
+
const external_form_field_cjs_namespaceObject = require("../form-field.cjs");
|
|
38
39
|
const external_tooltip_cjs_namespaceObject = require("../tooltip.cjs");
|
|
39
40
|
const EditorToolbar_cjs_namespaceObject = require("./components/EditorToolbar.cjs");
|
|
40
41
|
const MarkdownPreview_cjs_namespaceObject = require("./components/MarkdownPreview.cjs");
|
|
@@ -56,7 +57,7 @@ const LINE_HEIGHT = 20;
|
|
|
56
57
|
const EMPTY_AUTOCOMPLETE_OPTIONS = [];
|
|
57
58
|
const EMPTY_TOKENS = [];
|
|
58
59
|
const toTokenArray = (v)=>void 0 === v ? void 0 : Array.isArray(v) ? v : EMPTY_TOKENS;
|
|
59
|
-
const EditorInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ initialValue, value, onChange, autoCompleteOptions = EMPTY_AUTOCOMPLETE_OPTIONS, multiline = true, minRows = DEFAULT_MIN_ROWS, maxRows = DEFAULT_MAX_ROWS, placeholder, disabled, ariaLabel, fillHeight, borderless, mapVarDropToToken, toolbarActionsRef, showToolbar }, ref)=>{
|
|
60
|
+
const EditorInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ initialValue, value, onChange, autoCompleteOptions = EMPTY_AUTOCOMPLETE_OPTIONS, multiline = true, minRows = DEFAULT_MIN_ROWS, maxRows = DEFAULT_MAX_ROWS, placeholder, disabled, ariaLabel, fillHeight, borderless, error, errorId, ariaDescribedBy, mapVarDropToToken, toolbarActionsRef, showToolbar }, ref)=>{
|
|
60
61
|
const editorRef = (0, external_react_namespaceObject.useRef)(null);
|
|
61
62
|
const [isEmpty, setIsEmpty] = (0, external_react_namespaceObject.useState)(()=>{
|
|
62
63
|
const seed = initialValue ?? value;
|
|
@@ -195,9 +196,10 @@ const EditorInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)
|
|
|
195
196
|
disabled
|
|
196
197
|
]);
|
|
197
198
|
const options = Array.isArray(autoCompleteOptions) ? autoCompleteOptions : EMPTY_AUTOCOMPLETE_OPTIONS;
|
|
198
|
-
const wrapperClassName = borderless ? 'flex flex-col w-full relative' : `prompt-editor-shell flex flex-col w-full relative border bg-background ${showToolbar ? 'border-t-0 rounded-b-md' : 'rounded-md'}`;
|
|
199
|
+
const wrapperClassName = borderless ? 'flex flex-col w-full relative' : `prompt-editor-shell flex flex-col w-full relative border bg-background future:border-0 future:bg-surface-overlay ${showToolbar ? 'border-t-0 rounded-b-md future:rounded-b-xl' : 'rounded-md future:rounded-xl'} ${error ? 'border-error ring-1 ring-error/20 future:ring-error/40' : ''}`;
|
|
199
200
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
200
201
|
className: wrapperClassName,
|
|
202
|
+
"data-invalid": error ? 'true' : void 0,
|
|
201
203
|
style: {
|
|
202
204
|
fontFamily: "'Noto Sans', sans-serif",
|
|
203
205
|
fontSize: '14px',
|
|
@@ -211,7 +213,7 @@ const EditorInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)
|
|
|
211
213
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("style", {
|
|
212
214
|
children: `
|
|
213
215
|
.prompt-editor-paragraph { padding: 0; margin: 0; }
|
|
214
|
-
${borderless ? '' : '.prompt-editor-shell:focus-within { border-color: var(--color-ring); box-shadow: 0 0 0 1px var(--color-ring); }'}
|
|
216
|
+
${borderless ? '' : '.prompt-editor-shell:not([data-invalid="true"]):focus-within { border-color: var(--color-ring); box-shadow: 0 0 0 1px var(--color-ring); } .future .prompt-editor-shell:not([data-invalid="true"]):focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-ring) 35%, transparent); }'}
|
|
215
217
|
.prompt-editor-root *::selection { background-color: color-mix(in srgb, var(--color-primary) 30%, transparent); }
|
|
216
218
|
`
|
|
217
219
|
}),
|
|
@@ -230,7 +232,10 @@ const EditorInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)
|
|
|
230
232
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(LexicalPlainTextPlugin_namespaceObject.PlainTextPlugin, {
|
|
231
233
|
contentEditable: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(LexicalContentEditable_namespaceObject.ContentEditable, {
|
|
232
234
|
style: contentEditableStyle,
|
|
233
|
-
ariaLabel: ariaLabel
|
|
235
|
+
ariaLabel: ariaLabel,
|
|
236
|
+
"aria-invalid": error ? true : void 0,
|
|
237
|
+
"aria-describedby": ariaDescribedBy,
|
|
238
|
+
"aria-errormessage": error ? errorId : void 0
|
|
234
239
|
}),
|
|
235
240
|
placeholder: null,
|
|
236
241
|
ErrorBoundary: LexicalErrorBoundary_namespaceObject.LexicalErrorBoundary
|
|
@@ -252,7 +257,7 @@ const EditorInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)
|
|
|
252
257
|
textOverflow: 'ellipsis'
|
|
253
258
|
}
|
|
254
259
|
},
|
|
255
|
-
className: "text-muted-foreground
|
|
260
|
+
className: "text-muted-foreground future:text-foreground-muted future:font-normal",
|
|
256
261
|
children: placeholder
|
|
257
262
|
})
|
|
258
263
|
]
|
|
@@ -297,7 +302,7 @@ const EditorInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)
|
|
|
297
302
|
});
|
|
298
303
|
});
|
|
299
304
|
EditorInner.displayName = 'PromptEditorInner';
|
|
300
|
-
const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange, multiline = true, minRows = DEFAULT_MIN_ROWS, maxRows = DEFAULT_MAX_ROWS, placeholder, disabled, ariaLabel, autoCompleteOptions, showToolbar = false, mode: controlledMode, onModeChange, onFullscreen, editorRef, fillHeight, borderless, mapVarDropToToken })=>{
|
|
305
|
+
const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange, multiline = true, minRows = DEFAULT_MIN_ROWS, maxRows = DEFAULT_MAX_ROWS, placeholder, disabled, ariaLabel, autoCompleteOptions, showToolbar = false, mode: controlledMode, onModeChange, onFullscreen, editorRef, fillHeight, borderless, error, errorId: providedErrorId, 'aria-describedby': nativeAriaDescribedBy, ariaDescribedBy: legacyAriaDescribedBy, mapVarDropToToken })=>{
|
|
301
306
|
const value = toTokenArray(rawValue);
|
|
302
307
|
const initialValue = toTokenArray(rawInitialValue);
|
|
303
308
|
const [internalMode, setInternalMode] = (0, external_react_namespaceObject.useState)('edit');
|
|
@@ -325,6 +330,13 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
325
330
|
}), []);
|
|
326
331
|
const isControlled = void 0 !== value;
|
|
327
332
|
const previewTokens = isControlled ? value : uncontrolledPreviewTokens;
|
|
333
|
+
const generatedErrorId = (0, external_react_namespaceObject.useId)();
|
|
334
|
+
const errorId = providedErrorId ?? `prompt-editor-${generatedErrorId.replace(/:/g, '')}-error`;
|
|
335
|
+
const additionalDescribedBy = nativeAriaDescribedBy ?? legacyAriaDescribedBy;
|
|
336
|
+
const describedBy = [
|
|
337
|
+
additionalDescribedBy,
|
|
338
|
+
error ? errorId : void 0
|
|
339
|
+
].filter(Boolean).join(' ');
|
|
328
340
|
const handleEditorChange = (0, external_react_namespaceObject.useCallback)((tokens)=>{
|
|
329
341
|
if (!isControlled) setUncontrolledPreviewTokens(tokens);
|
|
330
342
|
onChange?.(tokens);
|
|
@@ -347,12 +359,14 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
347
359
|
showToolbar && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EditorToolbar_cjs_namespaceObject.EditorToolbar, {
|
|
348
360
|
mode: mode,
|
|
349
361
|
disabled: disabled,
|
|
362
|
+
error: Boolean(error),
|
|
350
363
|
actionsRef: toolbarActionsRef,
|
|
351
364
|
onModeChange: handleModeChange,
|
|
352
365
|
onFullscreen: onFullscreen
|
|
353
366
|
}),
|
|
354
367
|
'preview' === mode && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
355
|
-
|
|
368
|
+
"data-invalid": error ? 'true' : void 0,
|
|
369
|
+
className: borderless ? void 0 : `border bg-background future:border-0 future:bg-surface-overlay ${showToolbar ? 'border-t-0 rounded-b-md future:rounded-b-xl' : 'rounded-md future:rounded-xl'} ${error ? 'border-error ring-1 ring-error/20 future:ring-error/40' : ''}`,
|
|
356
370
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(MarkdownPreview_cjs_namespaceObject.MarkdownPreview, {
|
|
357
371
|
tokens: previewTokens,
|
|
358
372
|
minRows: minRows
|
|
@@ -374,6 +388,9 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
374
388
|
autoCompleteOptions: autoCompleteOptions,
|
|
375
389
|
disabled: disabled,
|
|
376
390
|
ariaLabel: ariaLabel,
|
|
391
|
+
error: error,
|
|
392
|
+
errorId: error ? errorId : void 0,
|
|
393
|
+
ariaDescribedBy: describedBy || void 0,
|
|
377
394
|
initialValue: initialValue,
|
|
378
395
|
maxRows: maxRows,
|
|
379
396
|
minRows: minRows,
|
|
@@ -388,6 +405,12 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
388
405
|
onChange: handleEditorChange
|
|
389
406
|
})
|
|
390
407
|
})
|
|
408
|
+
}),
|
|
409
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
410
|
+
id: errorId,
|
|
411
|
+
"data-slot": "prompt-editor-error",
|
|
412
|
+
className: "mt-1",
|
|
413
|
+
children: error
|
|
391
414
|
})
|
|
392
415
|
]
|
|
393
416
|
})
|
|
@@ -25,6 +25,14 @@ export interface PromptEditorProps {
|
|
|
25
25
|
fillHeight?: boolean;
|
|
26
26
|
/** Drop the editor's own border/background/rounding so a parent can provide the field chrome. */
|
|
27
27
|
borderless?: boolean;
|
|
28
|
+
/** Field-specific validation feedback rendered below the editor. */
|
|
29
|
+
error?: React.ReactNode;
|
|
30
|
+
/** Optional id for the inline validation message. */
|
|
31
|
+
errorId?: string;
|
|
32
|
+
/** Additional description id(s) associated with the editor. */
|
|
33
|
+
'aria-describedby'?: string;
|
|
34
|
+
/** @deprecated Use the native `aria-describedby` prop instead. */
|
|
35
|
+
ariaDescribedBy?: string;
|
|
28
36
|
/**
|
|
29
37
|
* Enable variable drag-drop: map a path dropped onto the editor (see `VARIABLE_DRAG_MIME`) to the
|
|
30
38
|
* token to insert at the drop point. The drag *source* is the consumer's (it sets the path on
|
|
@@ -32,4 +40,4 @@ export interface PromptEditorProps {
|
|
|
32
40
|
*/
|
|
33
41
|
mapVarDropToToken?: (insertPath: string) => PromptEditorAutoCompleteOption;
|
|
34
42
|
}
|
|
35
|
-
export declare const PromptEditor: ({ value: rawValue, initialValue: rawInitialValue, onChange, multiline, minRows, maxRows, placeholder, disabled, ariaLabel, autoCompleteOptions, showToolbar, mode: controlledMode, onModeChange, onFullscreen, editorRef, fillHeight, borderless, mapVarDropToToken, }: PromptEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare const PromptEditor: ({ value: rawValue, initialValue: rawInitialValue, onChange, multiline, minRows, maxRows, placeholder, disabled, ariaLabel, autoCompleteOptions, showToolbar, mode: controlledMode, onModeChange, onFullscreen, editorRef, fillHeight, borderless, error, errorId: providedErrorId, "aria-describedby": nativeAriaDescribedBy, ariaDescribedBy: legacyAriaDescribedBy, mapVarDropToToken, }: PromptEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,8 @@ import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
|
6
6
|
import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
|
|
7
7
|
import { PlainTextPlugin } from "@lexical/react/LexicalPlainTextPlugin";
|
|
8
8
|
import { $getSelection, $isRangeSelection } from "lexical";
|
|
9
|
-
import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
9
|
+
import { forwardRef, useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { FormFieldError } from "../form-field.js";
|
|
10
11
|
import { TooltipProvider } from "../tooltip.js";
|
|
11
12
|
import { EditorToolbar } from "./components/EditorToolbar.js";
|
|
12
13
|
import { MarkdownPreview } from "./components/MarkdownPreview.js";
|
|
@@ -28,7 +29,7 @@ const LINE_HEIGHT = 20;
|
|
|
28
29
|
const EMPTY_AUTOCOMPLETE_OPTIONS = [];
|
|
29
30
|
const EMPTY_TOKENS = [];
|
|
30
31
|
const toTokenArray = (v)=>void 0 === v ? void 0 : Array.isArray(v) ? v : EMPTY_TOKENS;
|
|
31
|
-
const EditorInner = /*#__PURE__*/ forwardRef(({ initialValue, value, onChange, autoCompleteOptions = EMPTY_AUTOCOMPLETE_OPTIONS, multiline = true, minRows = DEFAULT_MIN_ROWS, maxRows = DEFAULT_MAX_ROWS, placeholder, disabled, ariaLabel, fillHeight, borderless, mapVarDropToToken, toolbarActionsRef, showToolbar }, ref)=>{
|
|
32
|
+
const EditorInner = /*#__PURE__*/ forwardRef(({ initialValue, value, onChange, autoCompleteOptions = EMPTY_AUTOCOMPLETE_OPTIONS, multiline = true, minRows = DEFAULT_MIN_ROWS, maxRows = DEFAULT_MAX_ROWS, placeholder, disabled, ariaLabel, fillHeight, borderless, error, errorId, ariaDescribedBy, mapVarDropToToken, toolbarActionsRef, showToolbar }, ref)=>{
|
|
32
33
|
const editorRef = useRef(null);
|
|
33
34
|
const [isEmpty, setIsEmpty] = useState(()=>{
|
|
34
35
|
const seed = initialValue ?? value;
|
|
@@ -167,9 +168,10 @@ const EditorInner = /*#__PURE__*/ forwardRef(({ initialValue, value, onChange, a
|
|
|
167
168
|
disabled
|
|
168
169
|
]);
|
|
169
170
|
const options = Array.isArray(autoCompleteOptions) ? autoCompleteOptions : EMPTY_AUTOCOMPLETE_OPTIONS;
|
|
170
|
-
const wrapperClassName = borderless ? 'flex flex-col w-full relative' : `prompt-editor-shell flex flex-col w-full relative border bg-background ${showToolbar ? 'border-t-0 rounded-b-md' : 'rounded-md'}`;
|
|
171
|
+
const wrapperClassName = borderless ? 'flex flex-col w-full relative' : `prompt-editor-shell flex flex-col w-full relative border bg-background future:border-0 future:bg-surface-overlay ${showToolbar ? 'border-t-0 rounded-b-md future:rounded-b-xl' : 'rounded-md future:rounded-xl'} ${error ? 'border-error ring-1 ring-error/20 future:ring-error/40' : ''}`;
|
|
171
172
|
return /*#__PURE__*/ jsxs("div", {
|
|
172
173
|
className: wrapperClassName,
|
|
174
|
+
"data-invalid": error ? 'true' : void 0,
|
|
173
175
|
style: {
|
|
174
176
|
fontFamily: "'Noto Sans', sans-serif",
|
|
175
177
|
fontSize: '14px',
|
|
@@ -183,7 +185,7 @@ const EditorInner = /*#__PURE__*/ forwardRef(({ initialValue, value, onChange, a
|
|
|
183
185
|
/*#__PURE__*/ jsx("style", {
|
|
184
186
|
children: `
|
|
185
187
|
.prompt-editor-paragraph { padding: 0; margin: 0; }
|
|
186
|
-
${borderless ? '' : '.prompt-editor-shell:focus-within { border-color: var(--color-ring); box-shadow: 0 0 0 1px var(--color-ring); }'}
|
|
188
|
+
${borderless ? '' : '.prompt-editor-shell:not([data-invalid="true"]):focus-within { border-color: var(--color-ring); box-shadow: 0 0 0 1px var(--color-ring); } .future .prompt-editor-shell:not([data-invalid="true"]):focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-ring) 35%, transparent); }'}
|
|
187
189
|
.prompt-editor-root *::selection { background-color: color-mix(in srgb, var(--color-primary) 30%, transparent); }
|
|
188
190
|
`
|
|
189
191
|
}),
|
|
@@ -202,7 +204,10 @@ const EditorInner = /*#__PURE__*/ forwardRef(({ initialValue, value, onChange, a
|
|
|
202
204
|
/*#__PURE__*/ jsx(PlainTextPlugin, {
|
|
203
205
|
contentEditable: /*#__PURE__*/ jsx(ContentEditable, {
|
|
204
206
|
style: contentEditableStyle,
|
|
205
|
-
ariaLabel: ariaLabel
|
|
207
|
+
ariaLabel: ariaLabel,
|
|
208
|
+
"aria-invalid": error ? true : void 0,
|
|
209
|
+
"aria-describedby": ariaDescribedBy,
|
|
210
|
+
"aria-errormessage": error ? errorId : void 0
|
|
206
211
|
}),
|
|
207
212
|
placeholder: null,
|
|
208
213
|
ErrorBoundary: LexicalErrorBoundary
|
|
@@ -224,7 +229,7 @@ const EditorInner = /*#__PURE__*/ forwardRef(({ initialValue, value, onChange, a
|
|
|
224
229
|
textOverflow: 'ellipsis'
|
|
225
230
|
}
|
|
226
231
|
},
|
|
227
|
-
className: "text-muted-foreground
|
|
232
|
+
className: "text-muted-foreground future:text-foreground-muted future:font-normal",
|
|
228
233
|
children: placeholder
|
|
229
234
|
})
|
|
230
235
|
]
|
|
@@ -269,7 +274,7 @@ const EditorInner = /*#__PURE__*/ forwardRef(({ initialValue, value, onChange, a
|
|
|
269
274
|
});
|
|
270
275
|
});
|
|
271
276
|
EditorInner.displayName = 'PromptEditorInner';
|
|
272
|
-
const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange, multiline = true, minRows = DEFAULT_MIN_ROWS, maxRows = DEFAULT_MAX_ROWS, placeholder, disabled, ariaLabel, autoCompleteOptions, showToolbar = false, mode: controlledMode, onModeChange, onFullscreen, editorRef, fillHeight, borderless, mapVarDropToToken })=>{
|
|
277
|
+
const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange, multiline = true, minRows = DEFAULT_MIN_ROWS, maxRows = DEFAULT_MAX_ROWS, placeholder, disabled, ariaLabel, autoCompleteOptions, showToolbar = false, mode: controlledMode, onModeChange, onFullscreen, editorRef, fillHeight, borderless, error, errorId: providedErrorId, 'aria-describedby': nativeAriaDescribedBy, ariaDescribedBy: legacyAriaDescribedBy, mapVarDropToToken })=>{
|
|
273
278
|
const value = toTokenArray(rawValue);
|
|
274
279
|
const initialValue = toTokenArray(rawInitialValue);
|
|
275
280
|
const [internalMode, setInternalMode] = useState('edit');
|
|
@@ -297,6 +302,13 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
297
302
|
}), []);
|
|
298
303
|
const isControlled = void 0 !== value;
|
|
299
304
|
const previewTokens = isControlled ? value : uncontrolledPreviewTokens;
|
|
305
|
+
const generatedErrorId = useId();
|
|
306
|
+
const errorId = providedErrorId ?? `prompt-editor-${generatedErrorId.replace(/:/g, '')}-error`;
|
|
307
|
+
const additionalDescribedBy = nativeAriaDescribedBy ?? legacyAriaDescribedBy;
|
|
308
|
+
const describedBy = [
|
|
309
|
+
additionalDescribedBy,
|
|
310
|
+
error ? errorId : void 0
|
|
311
|
+
].filter(Boolean).join(' ');
|
|
300
312
|
const handleEditorChange = useCallback((tokens)=>{
|
|
301
313
|
if (!isControlled) setUncontrolledPreviewTokens(tokens);
|
|
302
314
|
onChange?.(tokens);
|
|
@@ -319,12 +331,14 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
319
331
|
showToolbar && /*#__PURE__*/ jsx(EditorToolbar, {
|
|
320
332
|
mode: mode,
|
|
321
333
|
disabled: disabled,
|
|
334
|
+
error: Boolean(error),
|
|
322
335
|
actionsRef: toolbarActionsRef,
|
|
323
336
|
onModeChange: handleModeChange,
|
|
324
337
|
onFullscreen: onFullscreen
|
|
325
338
|
}),
|
|
326
339
|
'preview' === mode && /*#__PURE__*/ jsx("div", {
|
|
327
|
-
|
|
340
|
+
"data-invalid": error ? 'true' : void 0,
|
|
341
|
+
className: borderless ? void 0 : `border bg-background future:border-0 future:bg-surface-overlay ${showToolbar ? 'border-t-0 rounded-b-md future:rounded-b-xl' : 'rounded-md future:rounded-xl'} ${error ? 'border-error ring-1 ring-error/20 future:ring-error/40' : ''}`,
|
|
328
342
|
children: /*#__PURE__*/ jsx(MarkdownPreview, {
|
|
329
343
|
tokens: previewTokens,
|
|
330
344
|
minRows: minRows
|
|
@@ -346,6 +360,9 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
346
360
|
autoCompleteOptions: autoCompleteOptions,
|
|
347
361
|
disabled: disabled,
|
|
348
362
|
ariaLabel: ariaLabel,
|
|
363
|
+
error: error,
|
|
364
|
+
errorId: error ? errorId : void 0,
|
|
365
|
+
ariaDescribedBy: describedBy || void 0,
|
|
349
366
|
initialValue: initialValue,
|
|
350
367
|
maxRows: maxRows,
|
|
351
368
|
minRows: minRows,
|
|
@@ -360,6 +377,12 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
|
|
|
360
377
|
onChange: handleEditorChange
|
|
361
378
|
})
|
|
362
379
|
})
|
|
380
|
+
}),
|
|
381
|
+
/*#__PURE__*/ jsx(FormFieldError, {
|
|
382
|
+
id: errorId,
|
|
383
|
+
"data-slot": "prompt-editor-error",
|
|
384
|
+
className: "mt-1",
|
|
385
|
+
children: error
|
|
363
386
|
})
|
|
364
387
|
]
|
|
365
388
|
})
|
package/dist/styles.css
CHANGED
|
@@ -774,9 +774,6 @@
|
|
|
774
774
|
.mx-auto {
|
|
775
775
|
margin-inline: auto;
|
|
776
776
|
}
|
|
777
|
-
.-my-1 {
|
|
778
|
-
margin-block: calc(var(--spacing) * -1);
|
|
779
|
-
}
|
|
780
777
|
.my-0\.5 {
|
|
781
778
|
margin-block: calc(var(--spacing) * 0.5);
|
|
782
779
|
}
|
|
@@ -843,9 +840,6 @@
|
|
|
843
840
|
.mr-2 {
|
|
844
841
|
margin-right: calc(var(--spacing) * 2);
|
|
845
842
|
}
|
|
846
|
-
.mr-3 {
|
|
847
|
-
margin-right: calc(var(--spacing) * 3);
|
|
848
|
-
}
|
|
849
843
|
.mr-4 {
|
|
850
844
|
margin-right: calc(var(--spacing) * 4);
|
|
851
845
|
}
|
|
@@ -1070,9 +1064,6 @@
|
|
|
1070
1064
|
.h-24 {
|
|
1071
1065
|
height: calc(var(--spacing) * 24);
|
|
1072
1066
|
}
|
|
1073
|
-
.h-28 {
|
|
1074
|
-
height: calc(var(--spacing) * 28);
|
|
1075
|
-
}
|
|
1076
1067
|
.h-32 {
|
|
1077
1068
|
height: calc(var(--spacing) * 32);
|
|
1078
1069
|
}
|
|
@@ -1235,9 +1226,6 @@
|
|
|
1235
1226
|
.min-h-\[400px\] {
|
|
1236
1227
|
min-height: 400px;
|
|
1237
1228
|
}
|
|
1238
|
-
.min-h-\[680px\] {
|
|
1239
|
-
min-height: 680px;
|
|
1240
|
-
}
|
|
1241
1229
|
.min-h-screen {
|
|
1242
1230
|
min-height: 100vh;
|
|
1243
1231
|
}
|
|
@@ -1367,21 +1355,12 @@
|
|
|
1367
1355
|
.w-\[2px\] {
|
|
1368
1356
|
width: 2px;
|
|
1369
1357
|
}
|
|
1370
|
-
.w-\[18\%\] {
|
|
1371
|
-
width: 18%;
|
|
1372
|
-
}
|
|
1373
1358
|
.w-\[18px\] {
|
|
1374
1359
|
width: 18px;
|
|
1375
1360
|
}
|
|
1376
|
-
.w-\[20\%\] {
|
|
1377
|
-
width: 20%;
|
|
1378
|
-
}
|
|
1379
1361
|
.w-\[22px\] {
|
|
1380
1362
|
width: 22px;
|
|
1381
1363
|
}
|
|
1382
|
-
.w-\[31\%\] {
|
|
1383
|
-
width: 31%;
|
|
1384
|
-
}
|
|
1385
1364
|
.w-\[40px\] {
|
|
1386
1365
|
width: 40px;
|
|
1387
1366
|
}
|
|
@@ -1610,12 +1589,6 @@
|
|
|
1610
1589
|
.min-w-\[18px\] {
|
|
1611
1590
|
min-width: 18px;
|
|
1612
1591
|
}
|
|
1613
|
-
.min-w-\[340px\] {
|
|
1614
|
-
min-width: 340px;
|
|
1615
|
-
}
|
|
1616
|
-
.min-w-\[840px\] {
|
|
1617
|
-
min-width: 840px;
|
|
1618
|
-
}
|
|
1619
1592
|
.min-w-\[var\(--radix-select-trigger-width\)\] {
|
|
1620
1593
|
min-width: var(--radix-select-trigger-width);
|
|
1621
1594
|
}
|
|
@@ -1991,9 +1964,6 @@
|
|
|
1991
1964
|
.gap-x-8 {
|
|
1992
1965
|
column-gap: calc(var(--spacing) * 8);
|
|
1993
1966
|
}
|
|
1994
|
-
.gap-x-10 {
|
|
1995
|
-
column-gap: calc(var(--spacing) * 10);
|
|
1996
|
-
}
|
|
1997
1967
|
.-space-x-2 {
|
|
1998
1968
|
:where(& > :not(:last-child)) {
|
|
1999
1969
|
--tw-space-x-reverse: 0;
|
|
@@ -2152,10 +2122,6 @@
|
|
|
2152
2122
|
border-top-right-radius: var(--radius-md);
|
|
2153
2123
|
border-bottom-right-radius: var(--radius-md);
|
|
2154
2124
|
}
|
|
2155
|
-
.rounded-r-none {
|
|
2156
|
-
border-top-right-radius: 0;
|
|
2157
|
-
border-bottom-right-radius: 0;
|
|
2158
|
-
}
|
|
2159
2125
|
.rounded-tr-2xl {
|
|
2160
2126
|
border-top-right-radius: var(--radius-2xl);
|
|
2161
2127
|
}
|
|
@@ -2196,10 +2162,6 @@
|
|
|
2196
2162
|
border-style: var(--tw-border-style);
|
|
2197
2163
|
border-width: 1.5px;
|
|
2198
2164
|
}
|
|
2199
|
-
.border-y {
|
|
2200
|
-
border-block-style: var(--tw-border-style);
|
|
2201
|
-
border-block-width: 1px;
|
|
2202
|
-
}
|
|
2203
2165
|
.border-t {
|
|
2204
2166
|
border-top-style: var(--tw-border-style);
|
|
2205
2167
|
border-top-width: 1px;
|
|
@@ -2228,10 +2190,6 @@
|
|
|
2228
2190
|
border-left-style: var(--tw-border-style);
|
|
2229
2191
|
border-left-width: 1px;
|
|
2230
2192
|
}
|
|
2231
|
-
.border-l-0 {
|
|
2232
|
-
border-left-style: var(--tw-border-style);
|
|
2233
|
-
border-left-width: 0px;
|
|
2234
|
-
}
|
|
2235
2193
|
.border-l-2 {
|
|
2236
2194
|
border-left-style: var(--tw-border-style);
|
|
2237
2195
|
border-left-width: 2px;
|
|
@@ -2918,12 +2876,6 @@
|
|
|
2918
2876
|
background-color: color-mix(in oklab, var(--muted) 30%, transparent);
|
|
2919
2877
|
}
|
|
2920
2878
|
}
|
|
2921
|
-
.bg-muted\/35 {
|
|
2922
|
-
background-color: var(--muted);
|
|
2923
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2924
|
-
background-color: color-mix(in oklab, var(--muted) 35%, transparent);
|
|
2925
|
-
}
|
|
2926
|
-
}
|
|
2927
2879
|
.bg-muted\/40 {
|
|
2928
2880
|
background-color: var(--muted);
|
|
2929
2881
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -2936,18 +2888,6 @@
|
|
|
2936
2888
|
background-color: color-mix(in oklab, var(--muted) 50%, transparent);
|
|
2937
2889
|
}
|
|
2938
2890
|
}
|
|
2939
|
-
.bg-muted\/60 {
|
|
2940
|
-
background-color: var(--muted);
|
|
2941
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2942
|
-
background-color: color-mix(in oklab, var(--muted) 60%, transparent);
|
|
2943
|
-
}
|
|
2944
|
-
}
|
|
2945
|
-
.bg-muted\/70 {
|
|
2946
|
-
background-color: var(--muted);
|
|
2947
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2948
|
-
background-color: color-mix(in oklab, var(--muted) 70%, transparent);
|
|
2949
|
-
}
|
|
2950
|
-
}
|
|
2951
2891
|
.bg-muted\/80 {
|
|
2952
2892
|
background-color: var(--muted);
|
|
2953
2893
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -3047,12 +2987,6 @@
|
|
|
3047
2987
|
background-color: color-mix(in oklab, var(--primary) 10%, transparent);
|
|
3048
2988
|
}
|
|
3049
2989
|
}
|
|
3050
|
-
.bg-primary\/15 {
|
|
3051
|
-
background-color: var(--primary);
|
|
3052
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
3053
|
-
background-color: color-mix(in oklab, var(--primary) 15%, transparent);
|
|
3054
|
-
}
|
|
3055
|
-
}
|
|
3056
2990
|
.bg-primary\/20 {
|
|
3057
2991
|
background-color: var(--primary);
|
|
3058
2992
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -3398,12 +3332,6 @@
|
|
|
3398
3332
|
background-color: color-mix(in oklab, var(--warning) 5%, transparent);
|
|
3399
3333
|
}
|
|
3400
3334
|
}
|
|
3401
|
-
.bg-warning\/10 {
|
|
3402
|
-
background-color: var(--warning);
|
|
3403
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
3404
|
-
background-color: color-mix(in oklab, var(--warning) 10%, transparent);
|
|
3405
|
-
}
|
|
3406
|
-
}
|
|
3407
3335
|
.bg-white {
|
|
3408
3336
|
background-color: var(--color-white);
|
|
3409
3337
|
}
|
|
@@ -3682,9 +3610,6 @@
|
|
|
3682
3610
|
.py-3 {
|
|
3683
3611
|
padding-block: calc(var(--spacing) * 3);
|
|
3684
3612
|
}
|
|
3685
|
-
.py-3\.5 {
|
|
3686
|
-
padding-block: calc(var(--spacing) * 3.5);
|
|
3687
|
-
}
|
|
3688
3613
|
.py-4 {
|
|
3689
3614
|
padding-block: calc(var(--spacing) * 4);
|
|
3690
3615
|
}
|
|
@@ -3694,15 +3619,9 @@
|
|
|
3694
3619
|
.py-6 {
|
|
3695
3620
|
padding-block: calc(var(--spacing) * 6);
|
|
3696
3621
|
}
|
|
3697
|
-
.py-7 {
|
|
3698
|
-
padding-block: calc(var(--spacing) * 7);
|
|
3699
|
-
}
|
|
3700
3622
|
.py-8 {
|
|
3701
3623
|
padding-block: calc(var(--spacing) * 8);
|
|
3702
3624
|
}
|
|
3703
|
-
.py-9 {
|
|
3704
|
-
padding-block: calc(var(--spacing) * 9);
|
|
3705
|
-
}
|
|
3706
3625
|
.py-10 {
|
|
3707
3626
|
padding-block: calc(var(--spacing) * 10);
|
|
3708
3627
|
}
|
|
@@ -3778,9 +3697,6 @@
|
|
|
3778
3697
|
.pb-0 {
|
|
3779
3698
|
padding-bottom: calc(var(--spacing) * 0);
|
|
3780
3699
|
}
|
|
3781
|
-
.pb-1\.5 {
|
|
3782
|
-
padding-bottom: calc(var(--spacing) * 1.5);
|
|
3783
|
-
}
|
|
3784
3700
|
.pb-2 {
|
|
3785
3701
|
padding-bottom: calc(var(--spacing) * 2);
|
|
3786
3702
|
}
|
|
@@ -3844,9 +3760,6 @@
|
|
|
3844
3760
|
.align-middle {
|
|
3845
3761
|
vertical-align: middle;
|
|
3846
3762
|
}
|
|
3847
|
-
.align-top {
|
|
3848
|
-
vertical-align: top;
|
|
3849
|
-
}
|
|
3850
3763
|
.font-mono {
|
|
3851
3764
|
font-family: var(--font-mono);
|
|
3852
3765
|
}
|
|
@@ -4157,12 +4070,6 @@
|
|
|
4157
4070
|
.text-muted-foreground {
|
|
4158
4071
|
color: var(--muted-foreground);
|
|
4159
4072
|
}
|
|
4160
|
-
.text-muted-foreground\/60 {
|
|
4161
|
-
color: var(--muted-foreground);
|
|
4162
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
4163
|
-
color: color-mix(in oklab, var(--muted-foreground) 60%, transparent);
|
|
4164
|
-
}
|
|
4165
|
-
}
|
|
4166
4073
|
.text-muted-foreground\/70 {
|
|
4167
4074
|
color: var(--muted-foreground);
|
|
4168
4075
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -4811,11 +4718,6 @@
|
|
|
4811
4718
|
color: var(--foreground);
|
|
4812
4719
|
}
|
|
4813
4720
|
}
|
|
4814
|
-
.last\:mb-0 {
|
|
4815
|
-
&:last-child {
|
|
4816
|
-
margin-bottom: calc(var(--spacing) * 0);
|
|
4817
|
-
}
|
|
4818
|
-
}
|
|
4819
4721
|
.last\:border-0 {
|
|
4820
4722
|
&:last-child {
|
|
4821
4723
|
border-style: var(--tw-border-style);
|
|
@@ -5111,16 +5013,6 @@
|
|
|
5111
5013
|
}
|
|
5112
5014
|
}
|
|
5113
5015
|
}
|
|
5114
|
-
.hover\:bg-muted\/40 {
|
|
5115
|
-
&:hover {
|
|
5116
|
-
@media (hover: hover) {
|
|
5117
|
-
background-color: var(--muted);
|
|
5118
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
5119
|
-
background-color: color-mix(in oklab, var(--muted) 40%, transparent);
|
|
5120
|
-
}
|
|
5121
|
-
}
|
|
5122
|
-
}
|
|
5123
|
-
}
|
|
5124
5016
|
.hover\:bg-muted\/50 {
|
|
5125
5017
|
&:hover {
|
|
5126
5018
|
@media (hover: hover) {
|
|
@@ -6094,11 +5986,6 @@
|
|
|
6094
5986
|
margin-top: calc(var(--spacing) * 0);
|
|
6095
5987
|
}
|
|
6096
5988
|
}
|
|
6097
|
-
.sm\:table-cell {
|
|
6098
|
-
@media (width >= 40rem) {
|
|
6099
|
-
display: table-cell;
|
|
6100
|
-
}
|
|
6101
|
-
}
|
|
6102
5989
|
.sm\:max-w-2xl {
|
|
6103
5990
|
@media (width >= 40rem) {
|
|
6104
5991
|
max-width: var(--container-2xl);
|
|
@@ -6175,46 +6062,16 @@
|
|
|
6175
6062
|
border-left-width: 1px;
|
|
6176
6063
|
}
|
|
6177
6064
|
}
|
|
6178
|
-
.sm\:p-5 {
|
|
6179
|
-
@media (width >= 40rem) {
|
|
6180
|
-
padding: calc(var(--spacing) * 5);
|
|
6181
|
-
}
|
|
6182
|
-
}
|
|
6183
|
-
.sm\:p-10 {
|
|
6184
|
-
@media (width >= 40rem) {
|
|
6185
|
-
padding: calc(var(--spacing) * 10);
|
|
6186
|
-
}
|
|
6187
|
-
}
|
|
6188
|
-
.sm\:px-6 {
|
|
6189
|
-
@media (width >= 40rem) {
|
|
6190
|
-
padding-inline: calc(var(--spacing) * 6);
|
|
6191
|
-
}
|
|
6192
|
-
}
|
|
6193
6065
|
.sm\:px-8 {
|
|
6194
6066
|
@media (width >= 40rem) {
|
|
6195
6067
|
padding-inline: calc(var(--spacing) * 8);
|
|
6196
6068
|
}
|
|
6197
6069
|
}
|
|
6198
|
-
.sm\:px-10 {
|
|
6199
|
-
@media (width >= 40rem) {
|
|
6200
|
-
padding-inline: calc(var(--spacing) * 10);
|
|
6201
|
-
}
|
|
6202
|
-
}
|
|
6203
6070
|
.sm\:py-6 {
|
|
6204
6071
|
@media (width >= 40rem) {
|
|
6205
6072
|
padding-block: calc(var(--spacing) * 6);
|
|
6206
6073
|
}
|
|
6207
6074
|
}
|
|
6208
|
-
.sm\:py-9 {
|
|
6209
|
-
@media (width >= 40rem) {
|
|
6210
|
-
padding-block: calc(var(--spacing) * 9);
|
|
6211
|
-
}
|
|
6212
|
-
}
|
|
6213
|
-
.sm\:py-14 {
|
|
6214
|
-
@media (width >= 40rem) {
|
|
6215
|
-
padding-block: calc(var(--spacing) * 14);
|
|
6216
|
-
}
|
|
6217
|
-
}
|
|
6218
6075
|
.sm\:text-left {
|
|
6219
6076
|
@media (width >= 40rem) {
|
|
6220
6077
|
text-align: left;
|
|
@@ -6231,11 +6088,6 @@
|
|
|
6231
6088
|
grid-column: span 2 / span 2;
|
|
6232
6089
|
}
|
|
6233
6090
|
}
|
|
6234
|
-
.md\:table-cell {
|
|
6235
|
-
@media (width >= 48rem) {
|
|
6236
|
-
display: table-cell;
|
|
6237
|
-
}
|
|
6238
|
-
}
|
|
6239
6091
|
.md\:w-1\/2 {
|
|
6240
6092
|
@media (width >= 48rem) {
|
|
6241
6093
|
width: calc(1/2 * 100%);
|
|
@@ -6307,11 +6159,6 @@
|
|
|
6307
6159
|
grid-template-columns: 2fr 3fr 3fr;
|
|
6308
6160
|
}
|
|
6309
6161
|
}
|
|
6310
|
-
.lg\:grid-cols-\[auto_minmax\(180px\,1fr\)_minmax\(160px\,0\.55fr\)_minmax\(240px\,1fr\)_auto\] {
|
|
6311
|
-
@media (width >= 64rem) {
|
|
6312
|
-
grid-template-columns: auto minmax(180px,1fr) minmax(160px,0.55fr) minmax(240px,1fr) auto;
|
|
6313
|
-
}
|
|
6314
|
-
}
|
|
6315
6162
|
.\@max-\[259px\]\:block {
|
|
6316
6163
|
@container (width < 259px) {
|
|
6317
6164
|
display: block;
|
|
@@ -6382,22 +6229,16 @@
|
|
|
6382
6229
|
border-radius: var(--radius-xl);
|
|
6383
6230
|
}
|
|
6384
6231
|
}
|
|
6385
|
-
.future\:rounded-
|
|
6232
|
+
.future\:rounded-t-xl {
|
|
6386
6233
|
:is(.future-dark, .future-light) & {
|
|
6387
6234
|
border-top-left-radius: var(--radius-xl);
|
|
6388
|
-
border-
|
|
6389
|
-
}
|
|
6390
|
-
}
|
|
6391
|
-
.future\:rounded-r-none {
|
|
6392
|
-
:is(.future-dark, .future-light) & {
|
|
6393
|
-
border-top-right-radius: 0;
|
|
6394
|
-
border-bottom-right-radius: 0;
|
|
6235
|
+
border-top-right-radius: var(--radius-xl);
|
|
6395
6236
|
}
|
|
6396
6237
|
}
|
|
6397
|
-
.future\:rounded-
|
|
6238
|
+
.future\:rounded-b-xl {
|
|
6398
6239
|
:is(.future-dark, .future-light) & {
|
|
6399
|
-
border-top-right-radius: var(--radius-xl);
|
|
6400
6240
|
border-bottom-right-radius: var(--radius-xl);
|
|
6241
|
+
border-bottom-left-radius: var(--radius-xl);
|
|
6401
6242
|
}
|
|
6402
6243
|
}
|
|
6403
6244
|
.future\:border-0 {
|
|
@@ -6488,6 +6329,11 @@
|
|
|
6488
6329
|
color: var(--foreground-inverse);
|
|
6489
6330
|
}
|
|
6490
6331
|
}
|
|
6332
|
+
.future\:text-foreground-muted {
|
|
6333
|
+
:is(.future-dark, .future-light) & {
|
|
6334
|
+
color: var(--foreground-muted);
|
|
6335
|
+
}
|
|
6336
|
+
}
|
|
6491
6337
|
.future\:text-muted-foreground {
|
|
6492
6338
|
:is(.future-dark, .future-light) & {
|
|
6493
6339
|
color: var(--muted-foreground);
|