@uipath/apollo-wind 2.31.1 → 2.32.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/custom/panel-flow.cjs +3 -3
- package/dist/components/custom/panel-flow.d.ts +2 -0
- package/dist/components/custom/panel-flow.js +3 -3
- package/dist/components/ui/file-upload.cjs +22 -16
- package/dist/components/ui/file-upload.d.ts +19 -1
- package/dist/components/ui/file-upload.js +22 -16
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/lockable-value-field/components/field-header.cjs +327 -0
- package/dist/components/ui/lockable-value-field/components/field-header.d.ts +19 -0
- package/dist/components/ui/lockable-value-field/components/field-header.js +293 -0
- package/dist/components/ui/lockable-value-field/components/lock-toggle-button.cjs +67 -0
- package/dist/components/ui/lockable-value-field/components/lock-toggle-button.d.ts +9 -0
- package/dist/components/ui/lockable-value-field/components/lock-toggle-button.js +33 -0
- package/dist/components/ui/lockable-value-field/components/mode-menu-item.cjs +63 -0
- package/dist/components/ui/lockable-value-field/components/mode-menu-item.d.ts +9 -0
- package/dist/components/ui/lockable-value-field/components/mode-menu-item.js +29 -0
- package/dist/components/ui/lockable-value-field/index.cjs +43 -0
- package/dist/components/ui/lockable-value-field/index.d.ts +3 -0
- package/dist/components/ui/lockable-value-field/index.js +3 -0
- package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +264 -0
- package/dist/components/ui/lockable-value-field/lockable-value-field.d.ts +14 -0
- package/dist/components/ui/lockable-value-field/lockable-value-field.js +230 -0
- package/dist/components/ui/lockable-value-field/types.cjs +99 -0
- package/dist/components/ui/lockable-value-field/types.d.ts +78 -0
- package/dist/components/ui/lockable-value-field/types.js +62 -0
- package/dist/components/ui/lockable-value-field/utils.cjs +117 -0
- package/dist/components/ui/lockable-value-field/utils.d.ts +24 -0
- package/dist/components/ui/lockable-value-field/utils.js +68 -0
- package/dist/components/ui/multi-select.cjs +7 -3
- package/dist/components/ui/multi-select.d.ts +4 -0
- package/dist/components/ui/multi-select.js +7 -3
- package/dist/index.cjs +28 -18
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/styles.css +61 -0
- package/package.json +2 -2
|
@@ -30,11 +30,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
31
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_chat_composer_cjs_namespaceObject = require("./chat-composer.cjs");
|
|
33
34
|
const avatar_cjs_namespaceObject = require("../ui/avatar.cjs");
|
|
34
35
|
const collapsible_cjs_namespaceObject = require("../ui/collapsible.cjs");
|
|
35
36
|
const tooltip_cjs_namespaceObject = require("../ui/tooltip.cjs");
|
|
36
37
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
37
|
-
const external_chat_composer_cjs_namespaceObject = require("./chat-composer.cjs");
|
|
38
38
|
function UiPathLogo() {
|
|
39
39
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
40
40
|
className: "flex h-9 w-9 items-center justify-center overflow-clip rounded-lg bg-[#0092b8] shadow-sm",
|
|
@@ -173,7 +173,7 @@ function ToolCard({ card }) {
|
|
|
173
173
|
}),
|
|
174
174
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
175
175
|
className: "flex flex-col gap-3",
|
|
176
|
-
children: card.items.map((item,
|
|
176
|
+
children: card.items.map((item, index)=>{
|
|
177
177
|
const Icon = toolIconMap[item.icon];
|
|
178
178
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
179
179
|
className: "flex items-start gap-2.5 pl-4 pr-9",
|
|
@@ -198,7 +198,7 @@ function ToolCard({ card }) {
|
|
|
198
198
|
]
|
|
199
199
|
})
|
|
200
200
|
]
|
|
201
|
-
},
|
|
201
|
+
}, item.id ?? `${item.icon}-${item.title}-${item.description}-${index}`);
|
|
202
202
|
})
|
|
203
203
|
})
|
|
204
204
|
]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Bot, Brain, ChevronUp, Copy, House, MessageCircle, PanelRightOpen, RefreshCcw, Search, ThumbsDown, ThumbsUp, Workflow } from "lucide-react";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
+
import { ChatComposer } from "./chat-composer.js";
|
|
4
5
|
import { Avatar, AvatarFallback } from "../ui/avatar.js";
|
|
5
6
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible.js";
|
|
6
7
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip.js";
|
|
7
8
|
import { cn } from "../../lib/index.js";
|
|
8
|
-
import { ChatComposer } from "./chat-composer.js";
|
|
9
9
|
function UiPathLogo() {
|
|
10
10
|
return /*#__PURE__*/ jsx("div", {
|
|
11
11
|
className: "flex h-9 w-9 items-center justify-center overflow-clip rounded-lg bg-[#0092b8] shadow-sm",
|
|
@@ -144,7 +144,7 @@ function ToolCard({ card }) {
|
|
|
144
144
|
}),
|
|
145
145
|
/*#__PURE__*/ jsx("div", {
|
|
146
146
|
className: "flex flex-col gap-3",
|
|
147
|
-
children: card.items.map((item,
|
|
147
|
+
children: card.items.map((item, index)=>{
|
|
148
148
|
const Icon = toolIconMap[item.icon];
|
|
149
149
|
return /*#__PURE__*/ jsxs("div", {
|
|
150
150
|
className: "flex items-start gap-2.5 pl-4 pr-9",
|
|
@@ -169,7 +169,7 @@ function ToolCard({ card }) {
|
|
|
169
169
|
]
|
|
170
170
|
})
|
|
171
171
|
]
|
|
172
|
-
},
|
|
172
|
+
}, item.id ?? `${item.icon}-${item.title}-${item.description}-${index}`);
|
|
173
173
|
})
|
|
174
174
|
})
|
|
175
175
|
]
|
|
@@ -32,7 +32,7 @@ const external_lucide_react_namespaceObject = require("lucide-react");
|
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
33
|
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
34
34
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
35
|
-
function FileUpload({ onFilesChange, accept, multiple = false, disabled = false, maxSize, className, showPreview = false, errors }) {
|
|
35
|
+
function FileUpload({ id, ariaLabel, onFilesChange, accept, multiple = false, disabled = false, maxSize, className, showPreview = false, errors, onBlur }) {
|
|
36
36
|
const [files, setFiles] = external_react_namespaceObject.useState([]);
|
|
37
37
|
const [isDragging, setIsDragging] = external_react_namespaceObject.useState(false);
|
|
38
38
|
const [fileErrors, setFileErrors] = external_react_namespaceObject.useState(new Map());
|
|
@@ -160,13 +160,29 @@ function FileUpload({ onFilesChange, accept, multiple = false, disabled = false,
|
|
|
160
160
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
161
161
|
return Math.round(bytes / k ** i * 100) / 100 + ' ' + sizes[i];
|
|
162
162
|
};
|
|
163
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("
|
|
164
|
-
className: (0, index_cjs_namespaceObject.cn)('w-full', className),
|
|
163
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("fieldset", {
|
|
164
|
+
className: (0, index_cjs_namespaceObject.cn)('m-0 min-w-0 w-full border-0 p-0', className),
|
|
165
|
+
onBlur: (event)=>{
|
|
166
|
+
if (!event.currentTarget.contains(event.relatedTarget)) onBlur?.(event);
|
|
167
|
+
},
|
|
165
168
|
children: [
|
|
169
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
|
|
170
|
+
ref: inputRef,
|
|
171
|
+
id: id,
|
|
172
|
+
type: "file",
|
|
173
|
+
className: "hidden",
|
|
174
|
+
accept: accept,
|
|
175
|
+
multiple: multiple,
|
|
176
|
+
disabled: disabled,
|
|
177
|
+
onChange: handleInputChange,
|
|
178
|
+
"aria-label": id ? void 0 : ariaLabel ?? 'File upload'
|
|
179
|
+
}),
|
|
166
180
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
167
|
-
role: "
|
|
168
|
-
"aria-label":
|
|
169
|
-
|
|
181
|
+
role: "button",
|
|
182
|
+
"aria-label": ariaLabel ?? 'File upload area',
|
|
183
|
+
"aria-disabled": disabled,
|
|
184
|
+
tabIndex: disabled ? -1 : 0,
|
|
185
|
+
className: (0, index_cjs_namespaceObject.cn)('relative flex flex-col items-center justify-center w-full h-32 px-4 py-6 border-2 border-dashed rounded-lg cursor-pointer transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background', 'future:rounded-xl', isDragging ? 'border-primary bg-primary/5' : 'border-input bg-background hover:bg-accent/50 future:border-border future:bg-surface-raised future:hover:bg-surface-overlay', disabled && 'opacity-50 cursor-not-allowed hover:bg-background future:hover:bg-surface-raised'),
|
|
170
186
|
onDragEnter: handleDragEnter,
|
|
171
187
|
onDragOver: handleDragOver,
|
|
172
188
|
onDragLeave: handleDragLeave,
|
|
@@ -179,16 +195,6 @@ function FileUpload({ onFilesChange, accept, multiple = false, disabled = false,
|
|
|
179
195
|
}
|
|
180
196
|
},
|
|
181
197
|
children: [
|
|
182
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
|
|
183
|
-
ref: inputRef,
|
|
184
|
-
type: "file",
|
|
185
|
-
className: "hidden",
|
|
186
|
-
accept: accept,
|
|
187
|
-
multiple: multiple,
|
|
188
|
-
disabled: disabled,
|
|
189
|
-
onChange: handleInputChange,
|
|
190
|
-
"aria-label": "File upload"
|
|
191
|
-
}),
|
|
192
198
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Upload, {
|
|
193
199
|
className: "w-8 h-8 mb-2 text-muted-foreground"
|
|
194
200
|
}),
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
export interface FileUploadProps {
|
|
3
|
+
/**
|
|
4
|
+
* Applied to the underlying `<input type="file">`, so an external
|
|
5
|
+
* `<label htmlFor>` can activate it (click-to-open) like any other labelable
|
|
6
|
+
* control. The dropzone itself is a `div[role=button]`, which isn't labelable,
|
|
7
|
+
* hence `ariaLabel` below for naming that part.
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Names the dropzone (`div[role=button]`, not a labelable element, so a
|
|
12
|
+
* surrounding `<label htmlFor>` can't associate with it -- pass the field's
|
|
13
|
+
* visible label text here instead). Also names the `<input type="file">`
|
|
14
|
+
* itself when `id` is omitted; when `id` is provided, an external
|
|
15
|
+
* `<label htmlFor>` names the input instead (aria-label would otherwise
|
|
16
|
+
* override it in the accessible-name computation).
|
|
17
|
+
*/
|
|
18
|
+
ariaLabel?: string;
|
|
2
19
|
onFilesChange?: (files: File[]) => void;
|
|
3
20
|
accept?: string;
|
|
4
21
|
multiple?: boolean;
|
|
@@ -8,5 +25,6 @@ export interface FileUploadProps {
|
|
|
8
25
|
showPreview?: boolean;
|
|
9
26
|
/** External errors keyed by filename. Use this to set errors from outside (e.g., upload failures). */
|
|
10
27
|
errors?: Record<string, string>;
|
|
28
|
+
onBlur?: React.FocusEventHandler<HTMLFieldSetElement>;
|
|
11
29
|
}
|
|
12
|
-
export declare function FileUpload({ onFilesChange, accept, multiple, disabled, maxSize, className, showPreview, errors, }: FileUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function FileUpload({ id, ariaLabel, onFilesChange, accept, multiple, disabled, maxSize, className, showPreview, errors, onBlur, }: FileUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { Upload, X } from "lucide-react";
|
|
|
4
4
|
import { useRef, useState } from "react";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { cn } from "../../lib/index.js";
|
|
7
|
-
function FileUpload({ onFilesChange, accept, multiple = false, disabled = false, maxSize, className, showPreview = false, errors }) {
|
|
7
|
+
function FileUpload({ id, ariaLabel, onFilesChange, accept, multiple = false, disabled = false, maxSize, className, showPreview = false, errors, onBlur }) {
|
|
8
8
|
const [files, setFiles] = useState([]);
|
|
9
9
|
const [isDragging, setIsDragging] = useState(false);
|
|
10
10
|
const [fileErrors, setFileErrors] = useState(new Map());
|
|
@@ -132,13 +132,29 @@ function FileUpload({ onFilesChange, accept, multiple = false, disabled = false,
|
|
|
132
132
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
133
133
|
return Math.round(bytes / k ** i * 100) / 100 + ' ' + sizes[i];
|
|
134
134
|
};
|
|
135
|
-
return /*#__PURE__*/ jsxs("
|
|
136
|
-
className: cn('w-full', className),
|
|
135
|
+
return /*#__PURE__*/ jsxs("fieldset", {
|
|
136
|
+
className: cn('m-0 min-w-0 w-full border-0 p-0', className),
|
|
137
|
+
onBlur: (event)=>{
|
|
138
|
+
if (!event.currentTarget.contains(event.relatedTarget)) onBlur?.(event);
|
|
139
|
+
},
|
|
137
140
|
children: [
|
|
141
|
+
/*#__PURE__*/ jsx("input", {
|
|
142
|
+
ref: inputRef,
|
|
143
|
+
id: id,
|
|
144
|
+
type: "file",
|
|
145
|
+
className: "hidden",
|
|
146
|
+
accept: accept,
|
|
147
|
+
multiple: multiple,
|
|
148
|
+
disabled: disabled,
|
|
149
|
+
onChange: handleInputChange,
|
|
150
|
+
"aria-label": id ? void 0 : ariaLabel ?? 'File upload'
|
|
151
|
+
}),
|
|
138
152
|
/*#__PURE__*/ jsxs("div", {
|
|
139
|
-
role: "
|
|
140
|
-
"aria-label":
|
|
141
|
-
|
|
153
|
+
role: "button",
|
|
154
|
+
"aria-label": ariaLabel ?? 'File upload area',
|
|
155
|
+
"aria-disabled": disabled,
|
|
156
|
+
tabIndex: disabled ? -1 : 0,
|
|
157
|
+
className: cn('relative flex flex-col items-center justify-center w-full h-32 px-4 py-6 border-2 border-dashed rounded-lg cursor-pointer transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background', 'future:rounded-xl', isDragging ? 'border-primary bg-primary/5' : 'border-input bg-background hover:bg-accent/50 future:border-border future:bg-surface-raised future:hover:bg-surface-overlay', disabled && 'opacity-50 cursor-not-allowed hover:bg-background future:hover:bg-surface-raised'),
|
|
142
158
|
onDragEnter: handleDragEnter,
|
|
143
159
|
onDragOver: handleDragOver,
|
|
144
160
|
onDragLeave: handleDragLeave,
|
|
@@ -151,16 +167,6 @@ function FileUpload({ onFilesChange, accept, multiple = false, disabled = false,
|
|
|
151
167
|
}
|
|
152
168
|
},
|
|
153
169
|
children: [
|
|
154
|
-
/*#__PURE__*/ jsx("input", {
|
|
155
|
-
ref: inputRef,
|
|
156
|
-
type: "file",
|
|
157
|
-
className: "hidden",
|
|
158
|
-
accept: accept,
|
|
159
|
-
multiple: multiple,
|
|
160
|
-
disabled: disabled,
|
|
161
|
-
onChange: handleInputChange,
|
|
162
|
-
"aria-label": "File upload"
|
|
163
|
-
}),
|
|
164
170
|
/*#__PURE__*/ jsx(Upload, {
|
|
165
171
|
className: "w-8 h-8 mb-2 text-muted-foreground"
|
|
166
172
|
}),
|
|
@@ -57,7 +57,7 @@ var __webpack_modules__ = {
|
|
|
57
57
|
"./datetime-picker" (module) {
|
|
58
58
|
module.exports = require("./datetime-picker.cjs");
|
|
59
59
|
},
|
|
60
|
-
"
|
|
60
|
+
"./dialog" (module) {
|
|
61
61
|
module.exports = require("./dialog.cjs");
|
|
62
62
|
},
|
|
63
63
|
"./dropdown-menu" (module) {
|
|
@@ -345,7 +345,7 @@ var __webpack_exports__ = {};
|
|
|
345
345
|
"default"
|
|
346
346
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_datetime_picker__rspack_import_18[__rspack_import_key];
|
|
347
347
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
348
|
-
var _dialog__rspack_import_19 = __webpack_require__("
|
|
348
|
+
var _dialog__rspack_import_19 = __webpack_require__("./dialog");
|
|
349
349
|
var __rspack_reexport = {};
|
|
350
350
|
for(const __rspack_import_key in _dialog__rspack_import_19)if ([
|
|
351
351
|
"TreeView",
|
|
@@ -0,0 +1,327 @@
|
|
|
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
|
+
FieldHeader: ()=>FieldHeader
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const external_button_cjs_namespaceObject = require("../../button.cjs");
|
|
33
|
+
const external_dropdown_menu_cjs_namespaceObject = require("../../dropdown-menu.cjs");
|
|
34
|
+
const external_label_cjs_namespaceObject = require("../../label.cjs");
|
|
35
|
+
const external_popover_cjs_namespaceObject = require("../../popover.cjs");
|
|
36
|
+
const external_switch_cjs_namespaceObject = require("../../switch.cjs");
|
|
37
|
+
const external_textarea_cjs_namespaceObject = require("../../textarea.cjs");
|
|
38
|
+
const external_tooltip_cjs_namespaceObject = require("../../tooltip.cjs");
|
|
39
|
+
const index_cjs_namespaceObject = require("../../../../lib/index.cjs");
|
|
40
|
+
const external_types_cjs_namespaceObject = require("../types.cjs");
|
|
41
|
+
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, controlsVisibility, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
|
|
42
|
+
const promptId = (0, external_react_namespaceObject.useId)();
|
|
43
|
+
const [aiPrompt, setAiPrompt] = (0, external_react_namespaceObject.useState)('');
|
|
44
|
+
const typeMeta = external_types_cjs_namespaceObject.FIELD_TYPE_META[fieldType];
|
|
45
|
+
const collapsedTextClass = (0, index_cjs_namespaceObject.cn)('@max-[259px]:hidden', compact && '!hidden');
|
|
46
|
+
const collapsedPaddingClass = (0, index_cjs_namespaceObject.cn)('@max-[259px]:px-1.5', compact && '!px-1.5');
|
|
47
|
+
const compactOnlyClass = (0, index_cjs_namespaceObject.cn)('hidden @max-[259px]:block', compact && '!block');
|
|
48
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
49
|
+
className: "flex items-center gap-1",
|
|
50
|
+
children: [
|
|
51
|
+
label ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_label_cjs_namespaceObject.Label, {
|
|
52
|
+
htmlFor: fieldId,
|
|
53
|
+
className: "text-xs font-medium text-foreground-muted",
|
|
54
|
+
children: [
|
|
55
|
+
fieldLabel,
|
|
56
|
+
required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
57
|
+
className: "ml-0.5 text-destructive",
|
|
58
|
+
children: "*"
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
}),
|
|
62
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipProvider, {
|
|
63
|
+
delayDuration: 300,
|
|
64
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
65
|
+
className: "ml-auto flex items-center gap-0.5",
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
68
|
+
className: (0, index_cjs_namespaceObject.cn)('flex items-center gap-0.5', 'hover' === controlsVisibility && 'opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 has-[[aria-expanded=true]]:opacity-100'),
|
|
69
|
+
children: [
|
|
70
|
+
onFieldTypeChange && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
|
|
71
|
+
children: [
|
|
72
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
73
|
+
children: [
|
|
74
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
|
|
75
|
+
asChild: true,
|
|
76
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuTrigger, {
|
|
77
|
+
asChild: true,
|
|
78
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
|
|
79
|
+
type: "button",
|
|
80
|
+
"aria-label": "Field type",
|
|
81
|
+
className: (0, index_cjs_namespaceObject.cn)('flex h-7 items-center gap-1 rounded-lg px-2 text-[11px] text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground', collapsedPaddingClass),
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typeMeta.icon, {
|
|
84
|
+
size: 12
|
|
85
|
+
}),
|
|
86
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
87
|
+
className: collapsedTextClass,
|
|
88
|
+
children: typeMeta.label
|
|
89
|
+
}),
|
|
90
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
|
|
91
|
+
size: 9,
|
|
92
|
+
className: collapsedTextClass
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
|
|
99
|
+
children: "Type"
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuContent, {
|
|
104
|
+
align: "end",
|
|
105
|
+
className: "w-44",
|
|
106
|
+
children: external_types_cjs_namespaceObject.FIELD_TYPE_ORDER.map((type)=>{
|
|
107
|
+
const meta = external_types_cjs_namespaceObject.FIELD_TYPE_META[type];
|
|
108
|
+
const isActive = type === fieldType;
|
|
109
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuItem, {
|
|
110
|
+
onClick: ()=>onFieldTypeChange(type),
|
|
111
|
+
children: [
|
|
112
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(meta.icon, {
|
|
113
|
+
className: isActive ? 'text-brand' : 'text-foreground-muted'
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
116
|
+
className: (0, index_cjs_namespaceObject.cn)(isActive && 'font-medium text-brand'),
|
|
117
|
+
children: meta.label
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
}, type);
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
}),
|
|
125
|
+
onRequiredChange && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
126
|
+
children: [
|
|
127
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
128
|
+
className: collapsedTextClass,
|
|
129
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
130
|
+
children: [
|
|
131
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
|
|
132
|
+
asChild: true,
|
|
133
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
134
|
+
className: "inline-flex",
|
|
135
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_switch_cjs_namespaceObject.Switch, {
|
|
136
|
+
size: "sm",
|
|
137
|
+
checked: !!required,
|
|
138
|
+
onCheckedChange: onRequiredChange,
|
|
139
|
+
className: "data-[state=checked]:bg-brand data-[state=unchecked]:bg-foreground-subtle",
|
|
140
|
+
"aria-label": required ? 'Required field' : 'Optional field'
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
}),
|
|
144
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
|
|
145
|
+
children: "Required"
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
})
|
|
149
|
+
}),
|
|
150
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
151
|
+
className: compactOnlyClass,
|
|
152
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
|
|
153
|
+
children: [
|
|
154
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
155
|
+
children: [
|
|
156
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
|
|
157
|
+
asChild: true,
|
|
158
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
|
|
159
|
+
asChild: true,
|
|
160
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
161
|
+
type: "button",
|
|
162
|
+
"aria-label": required ? 'Required field' : 'Optional field',
|
|
163
|
+
className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
|
|
164
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Asterisk, {
|
|
165
|
+
size: 12
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
}),
|
|
170
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
|
|
171
|
+
children: "Required"
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
}),
|
|
175
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverContent, {
|
|
176
|
+
align: "end",
|
|
177
|
+
className: "w-48",
|
|
178
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
179
|
+
className: "flex items-center justify-between gap-3",
|
|
180
|
+
children: [
|
|
181
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
182
|
+
className: "text-xs font-medium text-foreground",
|
|
183
|
+
children: "Required"
|
|
184
|
+
}),
|
|
185
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_switch_cjs_namespaceObject.Switch, {
|
|
186
|
+
size: "sm",
|
|
187
|
+
checked: !!required,
|
|
188
|
+
onCheckedChange: onRequiredChange,
|
|
189
|
+
className: "data-[state=checked]:bg-brand data-[state=unchecked]:bg-foreground-subtle",
|
|
190
|
+
"aria-label": required ? 'Required field' : 'Optional field'
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
}),
|
|
200
|
+
showFieldActions && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
201
|
+
children: [
|
|
202
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
|
|
203
|
+
children: [
|
|
204
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
205
|
+
children: [
|
|
206
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
|
|
207
|
+
asChild: true,
|
|
208
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
|
|
209
|
+
asChild: true,
|
|
210
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
"aria-label": "AI assist",
|
|
213
|
+
className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
|
|
214
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Sparkles, {
|
|
215
|
+
size: 12
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
|
+
}),
|
|
220
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
|
|
221
|
+
children: "Generate with AI"
|
|
222
|
+
})
|
|
223
|
+
]
|
|
224
|
+
}),
|
|
225
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.PopoverContent, {
|
|
226
|
+
align: "end",
|
|
227
|
+
className: "space-y-3",
|
|
228
|
+
children: [
|
|
229
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
230
|
+
className: "space-y-1.5",
|
|
231
|
+
children: [
|
|
232
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_label_cjs_namespaceObject.Label, {
|
|
233
|
+
htmlFor: promptId,
|
|
234
|
+
className: "text-xs font-medium text-foreground-muted",
|
|
235
|
+
children: "Describe what you want"
|
|
236
|
+
}),
|
|
237
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_textarea_cjs_namespaceObject.Textarea, {
|
|
238
|
+
id: promptId,
|
|
239
|
+
rows: 3,
|
|
240
|
+
value: aiPrompt,
|
|
241
|
+
onChange: (e)=>setAiPrompt(e.target.value),
|
|
242
|
+
placeholder: "Display a value from the previous step",
|
|
243
|
+
className: "resize-none text-sm"
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
}),
|
|
247
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
248
|
+
className: "block text-[11px] text-foreground-subtle",
|
|
249
|
+
children: [
|
|
250
|
+
"Output: ",
|
|
251
|
+
typeMeta.label,
|
|
252
|
+
typeMeta.supportsExpression ? ' expression' : ' value'
|
|
253
|
+
]
|
|
254
|
+
}),
|
|
255
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
256
|
+
size: "sm",
|
|
257
|
+
className: "w-full",
|
|
258
|
+
disabled: !onGenerateWithAi,
|
|
259
|
+
onClick: ()=>onGenerateWithAi?.(aiPrompt),
|
|
260
|
+
children: "Generate"
|
|
261
|
+
})
|
|
262
|
+
]
|
|
263
|
+
})
|
|
264
|
+
]
|
|
265
|
+
}),
|
|
266
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
|
|
267
|
+
children: [
|
|
268
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
269
|
+
children: [
|
|
270
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
|
|
271
|
+
asChild: true,
|
|
272
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuTrigger, {
|
|
273
|
+
asChild: true,
|
|
274
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
|
|
275
|
+
type: "button",
|
|
276
|
+
"aria-label": "Insert variable",
|
|
277
|
+
disabled: 0 === variables.length || !onValueChange,
|
|
278
|
+
className: (0, index_cjs_namespaceObject.cn)('flex h-7 items-center gap-1 rounded-lg px-2 text-[11px] text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground disabled:pointer-events-none disabled:opacity-50', collapsedPaddingClass),
|
|
279
|
+
children: [
|
|
280
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Braces, {
|
|
281
|
+
size: 12
|
|
282
|
+
}),
|
|
283
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
284
|
+
className: collapsedTextClass,
|
|
285
|
+
children: "Insert"
|
|
286
|
+
}),
|
|
287
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
|
|
288
|
+
size: 9,
|
|
289
|
+
className: collapsedTextClass
|
|
290
|
+
})
|
|
291
|
+
]
|
|
292
|
+
})
|
|
293
|
+
})
|
|
294
|
+
}),
|
|
295
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
|
|
296
|
+
children: "Insert variable"
|
|
297
|
+
})
|
|
298
|
+
]
|
|
299
|
+
}),
|
|
300
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuContent, {
|
|
301
|
+
align: "end",
|
|
302
|
+
className: "w-48",
|
|
303
|
+
children: variables.map((variable)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuItem, {
|
|
304
|
+
onClick: ()=>onValueChange?.(value ? `${value} ${variable.value}` : variable.value),
|
|
305
|
+
children: variable.label
|
|
306
|
+
}, variable.value))
|
|
307
|
+
})
|
|
308
|
+
]
|
|
309
|
+
})
|
|
310
|
+
]
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
}),
|
|
314
|
+
headerActions
|
|
315
|
+
]
|
|
316
|
+
})
|
|
317
|
+
})
|
|
318
|
+
]
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
exports.FieldHeader = __webpack_exports__.FieldHeader;
|
|
322
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
323
|
+
"FieldHeader"
|
|
324
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
325
|
+
Object.defineProperty(exports, '__esModule', {
|
|
326
|
+
value: true
|
|
327
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { LockableFieldType, LockableValueFieldOption } from '../types';
|
|
3
|
+
export declare function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, controlsVisibility, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions, }: {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
fieldId: string;
|
|
6
|
+
fieldLabel: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
fieldType: LockableFieldType;
|
|
9
|
+
onFieldTypeChange?: (fieldType: LockableFieldType) => void;
|
|
10
|
+
onRequiredChange?: (required: boolean) => void;
|
|
11
|
+
controlsVisibility: 'visible' | 'hover';
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
showFieldActions: boolean;
|
|
14
|
+
value: string;
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
variables: LockableValueFieldOption[];
|
|
17
|
+
onGenerateWithAi?: (prompt: string) => void;
|
|
18
|
+
headerActions?: ReactNode;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|