@uipath/apollo-wind 2.43.0 → 2.44.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 +2 -2
- package/dist/components/ui/date-picker.cjs +2 -2
- package/dist/components/ui/date-picker.d.ts +1 -1
- package/dist/components/ui/date-picker.js +2 -2
- package/dist/components/ui/datetime-picker.cjs +3 -3
- package/dist/components/ui/datetime-picker.js +3 -3
- package/dist/components/ui/file-upload.cjs +6 -6
- package/dist/components/ui/file-upload.js +6 -6
- package/dist/components/ui/index.cjs +20 -20
- package/dist/components/ui/input.cjs +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/label.cjs +2 -2
- package/dist/components/ui/label.d.ts +4 -4
- package/dist/components/ui/label.js +2 -2
- package/dist/components/ui/lockable-value-field/components/field-header.cjs +2 -2
- package/dist/components/ui/lockable-value-field/components/field-header.d.ts +2 -1
- package/dist/components/ui/lockable-value-field/components/field-header.js +2 -2
- package/dist/components/ui/lockable-value-field/index.d.ts +1 -1
- package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +102 -52
- package/dist/components/ui/lockable-value-field/lockable-value-field.d.ts +1 -1
- package/dist/components/ui/lockable-value-field/lockable-value-field.js +105 -55
- package/dist/components/ui/lockable-value-field/types.d.ts +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +39 -0
- package/package.json +1 -1
|
@@ -54,7 +54,7 @@ const combobox_Combobox = /*#__PURE__*/ external_react_namespaceObject.forwardRe
|
|
|
54
54
|
disabled: disabled,
|
|
55
55
|
children: [
|
|
56
56
|
selectedItem ? selectedItem.label : placeholder,
|
|
57
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.
|
|
57
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
|
|
58
58
|
className: "opacity-50"
|
|
59
59
|
})
|
|
60
60
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Check,
|
|
3
|
+
import { Check, ChevronDown } from "lucide-react";
|
|
4
4
|
import { forwardRef, useState } from "react";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./command.js";
|
|
@@ -26,7 +26,7 @@ const combobox_Combobox = /*#__PURE__*/ forwardRef(function({ items, value, onVa
|
|
|
26
26
|
disabled: disabled,
|
|
27
27
|
children: [
|
|
28
28
|
selectedItem ? selectedItem.label : placeholder,
|
|
29
|
-
/*#__PURE__*/ jsx(
|
|
29
|
+
/*#__PURE__*/ jsx(ChevronDown, {
|
|
30
30
|
className: "opacity-50"
|
|
31
31
|
})
|
|
32
32
|
]
|
|
@@ -46,7 +46,7 @@ const date_picker_DatePicker = /*#__PURE__*/ external_react_namespaceObject.forw
|
|
|
46
46
|
ref: ref,
|
|
47
47
|
variant: "outline",
|
|
48
48
|
"aria-label": value ? `Selected date: ${(0, external_date_fns_namespaceObject.format)(value, 'PPP')}` : placeholder,
|
|
49
|
-
className: (0, index_cjs_namespaceObject.cn)('w-full justify-start text-left font-normal', !value && 'text-muted-foreground', className),
|
|
49
|
+
className: (0, index_cjs_namespaceObject.cn)('w-full justify-start text-left font-normal', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-muted-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', !value && 'text-muted-foreground', className),
|
|
50
50
|
disabled: disabled,
|
|
51
51
|
children: [
|
|
52
52
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CalendarIcon, {}),
|
|
@@ -79,7 +79,7 @@ const date_picker_DateRangePicker = /*#__PURE__*/ external_react_namespaceObject
|
|
|
79
79
|
ref: ref,
|
|
80
80
|
variant: "outline",
|
|
81
81
|
"aria-label": value?.from ? value.to ? `Selected range: ${(0, external_date_fns_namespaceObject.format)(value.from, 'LLL dd, y')} to ${(0, external_date_fns_namespaceObject.format)(value.to, 'LLL dd, y')}` : `Selected date: ${(0, external_date_fns_namespaceObject.format)(value.from, 'LLL dd, y')}` : placeholder,
|
|
82
|
-
className: (0, index_cjs_namespaceObject.cn)('w-[300px] justify-start text-left font-normal', !value && 'text-muted-foreground', className),
|
|
82
|
+
className: (0, index_cjs_namespaceObject.cn)('w-[300px] justify-start text-left font-normal', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-muted-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', !value && 'text-muted-foreground', className),
|
|
83
83
|
disabled: disabled,
|
|
84
84
|
children: [
|
|
85
85
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CalendarIcon, {}),
|
|
@@ -17,7 +17,7 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function({ value, onValu
|
|
|
17
17
|
ref: ref,
|
|
18
18
|
variant: "outline",
|
|
19
19
|
"aria-label": value ? `Selected date: ${format(value, 'PPP')}` : placeholder,
|
|
20
|
-
className: cn('w-full justify-start text-left font-normal', !value && 'text-muted-foreground', className),
|
|
20
|
+
className: cn('w-full justify-start text-left font-normal', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-muted-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', !value && 'text-muted-foreground', className),
|
|
21
21
|
disabled: disabled,
|
|
22
22
|
children: [
|
|
23
23
|
/*#__PURE__*/ jsx(CalendarIcon, {}),
|
|
@@ -50,7 +50,7 @@ const date_picker_DateRangePicker = /*#__PURE__*/ forwardRef(function({ value, o
|
|
|
50
50
|
ref: ref,
|
|
51
51
|
variant: "outline",
|
|
52
52
|
"aria-label": value?.from ? value.to ? `Selected range: ${format(value.from, 'LLL dd, y')} to ${format(value.to, 'LLL dd, y')}` : `Selected date: ${format(value.from, 'LLL dd, y')}` : placeholder,
|
|
53
|
-
className: cn('w-[300px] justify-start text-left font-normal', !value && 'text-muted-foreground', className),
|
|
53
|
+
className: cn('w-[300px] justify-start text-left font-normal', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-muted-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', !value && 'text-muted-foreground', className),
|
|
54
54
|
disabled: disabled,
|
|
55
55
|
children: [
|
|
56
56
|
/*#__PURE__*/ jsx(CalendarIcon, {}),
|
|
@@ -27,14 +27,14 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
DateTimePicker: ()=>datetime_picker_DateTimePicker
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const external_react_namespaceObject = require("react");
|
|
31
30
|
const external_date_fns_namespaceObject = require("date-fns");
|
|
32
31
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
33
|
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
34
34
|
const external_calendar_cjs_namespaceObject = require("./calendar.cjs");
|
|
35
|
-
const external_popover_cjs_namespaceObject = require("./popover.cjs");
|
|
36
35
|
const external_input_cjs_namespaceObject = require("./input.cjs");
|
|
37
36
|
const external_label_cjs_namespaceObject = require("./label.cjs");
|
|
37
|
+
const external_popover_cjs_namespaceObject = require("./popover.cjs");
|
|
38
38
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
39
39
|
const datetime_picker_DateTimePicker = /*#__PURE__*/ external_react_namespaceObject.forwardRef(function({ value, onValueChange, disabled, placeholder = 'Pick a date and time', className, use12Hour = false }, ref) {
|
|
40
40
|
const [open, setOpen] = external_react_namespaceObject.useState(false);
|
|
@@ -77,7 +77,7 @@ const datetime_picker_DateTimePicker = /*#__PURE__*/ external_react_namespaceObj
|
|
|
77
77
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
|
|
78
78
|
ref: ref,
|
|
79
79
|
variant: "outline",
|
|
80
|
-
className: (0, index_cjs_namespaceObject.cn)('w-full justify-start text-left font-normal', !selectedDate && 'text-muted-foreground', className),
|
|
80
|
+
className: (0, index_cjs_namespaceObject.cn)('w-full justify-start text-left font-normal', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-muted-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', !selectedDate && 'text-muted-foreground', className),
|
|
81
81
|
disabled: disabled,
|
|
82
82
|
children: [
|
|
83
83
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CalendarIcon, {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useState } from "react";
|
|
3
2
|
import { format } from "date-fns";
|
|
4
3
|
import { CalendarIcon, Clock } from "lucide-react";
|
|
4
|
+
import { forwardRef, useState } from "react";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { Calendar } from "./calendar.js";
|
|
7
|
-
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
8
7
|
import { Input } from "./input.js";
|
|
9
8
|
import { Label } from "./label.js";
|
|
9
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
10
10
|
import { cn } from "../../lib/index.js";
|
|
11
11
|
const datetime_picker_DateTimePicker = /*#__PURE__*/ forwardRef(function({ value, onValueChange, disabled, placeholder = 'Pick a date and time', className, use12Hour = false }, ref) {
|
|
12
12
|
const [open, setOpen] = useState(false);
|
|
@@ -49,7 +49,7 @@ const datetime_picker_DateTimePicker = /*#__PURE__*/ forwardRef(function({ value
|
|
|
49
49
|
children: /*#__PURE__*/ jsxs(Button, {
|
|
50
50
|
ref: ref,
|
|
51
51
|
variant: "outline",
|
|
52
|
-
className: cn('w-full justify-start text-left font-normal', !selectedDate && 'text-muted-foreground', className),
|
|
52
|
+
className: cn('w-full justify-start text-left font-normal', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-muted-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', !selectedDate && 'text-muted-foreground', className),
|
|
53
53
|
disabled: disabled,
|
|
54
54
|
children: [
|
|
55
55
|
/*#__PURE__*/ jsx(CalendarIcon, {
|
|
@@ -158,7 +158,7 @@ const file_upload_FileUpload = /*#__PURE__*/ external_react_namespaceObject.forw
|
|
|
158
158
|
'GB'
|
|
159
159
|
];
|
|
160
160
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
161
|
-
return Math.round(bytes / k ** i * 100) / 100
|
|
161
|
+
return `${Math.round(bytes / k ** i * 100) / 100} ${sizes[i]}`;
|
|
162
162
|
};
|
|
163
163
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("fieldset", {
|
|
164
164
|
ref: ref,
|
|
@@ -190,7 +190,7 @@ const file_upload_FileUpload = /*#__PURE__*/ external_react_namespaceObject.forw
|
|
|
190
190
|
"aria-describedby": ariaDescribedBy,
|
|
191
191
|
"aria-errormessage": ariaErrorMessage,
|
|
192
192
|
tabIndex: disabled ? -1 : 0,
|
|
193
|
-
className: (0, index_cjs_namespaceObject.cn)('relative flex flex-col items-center justify-center
|
|
193
|
+
className: (0, index_cjs_namespaceObject.cn)('relative flex w-full flex-col items-center justify-center h-32 border-2 border-dashed rounded-lg px-4 py-6 cursor-pointer transition-colors', 'text-foreground-muted 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 future:border-border-subtle future:bg-surface-overlay future:hover:bg-surface-hover future:focus-visible:ring-offset-background', isDragging ? 'border-primary bg-primary/5' : 'border-input bg-background hover:bg-accent/50', disabled && 'opacity-50 cursor-not-allowed hover:bg-background future:hover:bg-surface-overlay'),
|
|
194
194
|
onDragEnter: handleDragEnter,
|
|
195
195
|
onDragOver: handleDragOver,
|
|
196
196
|
onDragLeave: handleDragLeave,
|
|
@@ -204,10 +204,10 @@ const file_upload_FileUpload = /*#__PURE__*/ external_react_namespaceObject.forw
|
|
|
204
204
|
},
|
|
205
205
|
children: [
|
|
206
206
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Upload, {
|
|
207
|
-
className: "
|
|
207
|
+
className: "mb-2 h-8 w-8 text-muted-foreground future:text-foreground-muted"
|
|
208
208
|
}),
|
|
209
209
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("p", {
|
|
210
|
-
className: "text-sm text-muted-foreground text-
|
|
210
|
+
className: "text-center text-sm text-muted-foreground future:text-foreground-muted",
|
|
211
211
|
children: [
|
|
212
212
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
213
213
|
className: "font-semibold",
|
|
@@ -217,11 +217,11 @@ const file_upload_FileUpload = /*#__PURE__*/ external_react_namespaceObject.forw
|
|
|
217
217
|
]
|
|
218
218
|
}),
|
|
219
219
|
accept && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
220
|
-
className: "text-xs text-muted-foreground
|
|
220
|
+
className: "mt-1 text-xs text-muted-foreground future:text-foreground-muted",
|
|
221
221
|
children: accept.split(',').join(', ')
|
|
222
222
|
}),
|
|
223
223
|
maxSize && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("p", {
|
|
224
|
-
className: "text-xs text-muted-foreground",
|
|
224
|
+
className: "text-xs text-muted-foreground future:text-foreground-muted",
|
|
225
225
|
children: [
|
|
226
226
|
"Max size: ",
|
|
227
227
|
formatFileSize(maxSize)
|
|
@@ -130,7 +130,7 @@ const file_upload_FileUpload = /*#__PURE__*/ forwardRef(function({ id, ariaLabel
|
|
|
130
130
|
'GB'
|
|
131
131
|
];
|
|
132
132
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
133
|
-
return Math.round(bytes / k ** i * 100) / 100
|
|
133
|
+
return `${Math.round(bytes / k ** i * 100) / 100} ${sizes[i]}`;
|
|
134
134
|
};
|
|
135
135
|
return /*#__PURE__*/ jsxs("fieldset", {
|
|
136
136
|
ref: ref,
|
|
@@ -162,7 +162,7 @@ const file_upload_FileUpload = /*#__PURE__*/ forwardRef(function({ id, ariaLabel
|
|
|
162
162
|
"aria-describedby": ariaDescribedBy,
|
|
163
163
|
"aria-errormessage": ariaErrorMessage,
|
|
164
164
|
tabIndex: disabled ? -1 : 0,
|
|
165
|
-
className: cn('relative flex flex-col items-center justify-center
|
|
165
|
+
className: cn('relative flex w-full flex-col items-center justify-center h-32 border-2 border-dashed rounded-lg px-4 py-6 cursor-pointer transition-colors', 'text-foreground-muted 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 future:border-border-subtle future:bg-surface-overlay future:hover:bg-surface-hover future:focus-visible:ring-offset-background', isDragging ? 'border-primary bg-primary/5' : 'border-input bg-background hover:bg-accent/50', disabled && 'opacity-50 cursor-not-allowed hover:bg-background future:hover:bg-surface-overlay'),
|
|
166
166
|
onDragEnter: handleDragEnter,
|
|
167
167
|
onDragOver: handleDragOver,
|
|
168
168
|
onDragLeave: handleDragLeave,
|
|
@@ -176,10 +176,10 @@ const file_upload_FileUpload = /*#__PURE__*/ forwardRef(function({ id, ariaLabel
|
|
|
176
176
|
},
|
|
177
177
|
children: [
|
|
178
178
|
/*#__PURE__*/ jsx(Upload, {
|
|
179
|
-
className: "
|
|
179
|
+
className: "mb-2 h-8 w-8 text-muted-foreground future:text-foreground-muted"
|
|
180
180
|
}),
|
|
181
181
|
/*#__PURE__*/ jsxs("p", {
|
|
182
|
-
className: "text-sm text-muted-foreground text-
|
|
182
|
+
className: "text-center text-sm text-muted-foreground future:text-foreground-muted",
|
|
183
183
|
children: [
|
|
184
184
|
/*#__PURE__*/ jsx("span", {
|
|
185
185
|
className: "font-semibold",
|
|
@@ -189,11 +189,11 @@ const file_upload_FileUpload = /*#__PURE__*/ forwardRef(function({ id, ariaLabel
|
|
|
189
189
|
]
|
|
190
190
|
}),
|
|
191
191
|
accept && /*#__PURE__*/ jsx("p", {
|
|
192
|
-
className: "text-xs text-muted-foreground
|
|
192
|
+
className: "mt-1 text-xs text-muted-foreground future:text-foreground-muted",
|
|
193
193
|
children: accept.split(',').join(', ')
|
|
194
194
|
}),
|
|
195
195
|
maxSize && /*#__PURE__*/ jsxs("p", {
|
|
196
|
-
className: "text-xs text-muted-foreground",
|
|
196
|
+
className: "text-xs text-muted-foreground future:text-foreground-muted",
|
|
197
197
|
children: [
|
|
198
198
|
"Max size: ",
|
|
199
199
|
formatFileSize(maxSize)
|
|
@@ -15,7 +15,7 @@ var __webpack_modules__ = {
|
|
|
15
15
|
"./avatar" (module) {
|
|
16
16
|
module.exports = require("./avatar.cjs");
|
|
17
17
|
},
|
|
18
|
-
"
|
|
18
|
+
"./badge" (module) {
|
|
19
19
|
module.exports = require("./badge.cjs");
|
|
20
20
|
},
|
|
21
21
|
"./breadcrumb" (module) {
|
|
@@ -24,10 +24,10 @@ var __webpack_modules__ = {
|
|
|
24
24
|
"./button-group" (module) {
|
|
25
25
|
module.exports = require("./button-group.cjs");
|
|
26
26
|
},
|
|
27
|
-
"
|
|
27
|
+
"./button" (module) {
|
|
28
28
|
module.exports = require("./button.cjs");
|
|
29
29
|
},
|
|
30
|
-
"
|
|
30
|
+
"./calendar" (module) {
|
|
31
31
|
module.exports = require("./calendar.cjs");
|
|
32
32
|
},
|
|
33
33
|
"./card" (module) {
|
|
@@ -36,7 +36,7 @@ var __webpack_modules__ = {
|
|
|
36
36
|
"./chart" (module) {
|
|
37
37
|
module.exports = require("./chart.cjs");
|
|
38
38
|
},
|
|
39
|
-
"
|
|
39
|
+
"./checkbox" (module) {
|
|
40
40
|
module.exports = require("./checkbox.cjs");
|
|
41
41
|
},
|
|
42
42
|
"./collapsible" (module) {
|
|
@@ -45,7 +45,7 @@ var __webpack_modules__ = {
|
|
|
45
45
|
"./combobox" (module) {
|
|
46
46
|
module.exports = require("./combobox.cjs");
|
|
47
47
|
},
|
|
48
|
-
"
|
|
48
|
+
"./command" (module) {
|
|
49
49
|
module.exports = require("./command.cjs");
|
|
50
50
|
},
|
|
51
51
|
"./context-menu" (module) {
|
|
@@ -60,7 +60,7 @@ var __webpack_modules__ = {
|
|
|
60
60
|
"./datetime-picker" (module) {
|
|
61
61
|
module.exports = require("./datetime-picker.cjs");
|
|
62
62
|
},
|
|
63
|
-
"
|
|
63
|
+
"./dialog" (module) {
|
|
64
64
|
module.exports = require("./dialog.cjs");
|
|
65
65
|
},
|
|
66
66
|
"./drawer" (module) {
|
|
@@ -87,10 +87,10 @@ var __webpack_modules__ = {
|
|
|
87
87
|
"./input-group" (module) {
|
|
88
88
|
module.exports = require("./input-group.cjs");
|
|
89
89
|
},
|
|
90
|
-
"
|
|
90
|
+
"./input" (module) {
|
|
91
91
|
module.exports = require("./input.cjs");
|
|
92
92
|
},
|
|
93
|
-
"
|
|
93
|
+
"./label" (module) {
|
|
94
94
|
module.exports = require("./label.cjs");
|
|
95
95
|
},
|
|
96
96
|
"./layout" (module) {
|
|
@@ -108,7 +108,7 @@ var __webpack_modules__ = {
|
|
|
108
108
|
"@/components/ui/popover" (module) {
|
|
109
109
|
module.exports = require("./popover.cjs");
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"./portal-container" (module) {
|
|
112
112
|
module.exports = require("./portal-container.cjs");
|
|
113
113
|
},
|
|
114
114
|
"./progress" (module) {
|
|
@@ -159,7 +159,7 @@ var __webpack_modules__ = {
|
|
|
159
159
|
"./switch" (module) {
|
|
160
160
|
module.exports = require("./switch.cjs");
|
|
161
161
|
},
|
|
162
|
-
"
|
|
162
|
+
"@/components/ui/table" (module) {
|
|
163
163
|
module.exports = require("./table.cjs");
|
|
164
164
|
},
|
|
165
165
|
"./tabs" (module) {
|
|
@@ -265,7 +265,7 @@ var __webpack_exports__ = {};
|
|
|
265
265
|
"default"
|
|
266
266
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_avatar__rspack_import_4[__rspack_import_key];
|
|
267
267
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
268
|
-
var _badge__rspack_import_5 = __webpack_require__("
|
|
268
|
+
var _badge__rspack_import_5 = __webpack_require__("./badge");
|
|
269
269
|
var __rspack_reexport = {};
|
|
270
270
|
for(const __rspack_import_key in _badge__rspack_import_5)if ([
|
|
271
271
|
"TreeView",
|
|
@@ -279,7 +279,7 @@ var __webpack_exports__ = {};
|
|
|
279
279
|
"default"
|
|
280
280
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_breadcrumb__rspack_import_6[__rspack_import_key];
|
|
281
281
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
282
|
-
var _button__rspack_import_7 = __webpack_require__("
|
|
282
|
+
var _button__rspack_import_7 = __webpack_require__("./button");
|
|
283
283
|
var __rspack_reexport = {};
|
|
284
284
|
for(const __rspack_import_key in _button__rspack_import_7)if ([
|
|
285
285
|
"TreeView",
|
|
@@ -293,7 +293,7 @@ var __webpack_exports__ = {};
|
|
|
293
293
|
"default"
|
|
294
294
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_button_group__rspack_import_8[__rspack_import_key];
|
|
295
295
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
296
|
-
var _calendar__rspack_import_9 = __webpack_require__("
|
|
296
|
+
var _calendar__rspack_import_9 = __webpack_require__("./calendar");
|
|
297
297
|
var __rspack_reexport = {};
|
|
298
298
|
for(const __rspack_import_key in _calendar__rspack_import_9)if ([
|
|
299
299
|
"TreeView",
|
|
@@ -314,7 +314,7 @@ var __webpack_exports__ = {};
|
|
|
314
314
|
"default"
|
|
315
315
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_chart__rspack_import_11[__rspack_import_key];
|
|
316
316
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
317
|
-
var _checkbox__rspack_import_12 = __webpack_require__("
|
|
317
|
+
var _checkbox__rspack_import_12 = __webpack_require__("./checkbox");
|
|
318
318
|
var __rspack_reexport = {};
|
|
319
319
|
for(const __rspack_import_key in _checkbox__rspack_import_12)if ([
|
|
320
320
|
"TreeView",
|
|
@@ -335,7 +335,7 @@ var __webpack_exports__ = {};
|
|
|
335
335
|
"default"
|
|
336
336
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_combobox__rspack_import_14[__rspack_import_key];
|
|
337
337
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
338
|
-
var _command__rspack_import_15 = __webpack_require__("
|
|
338
|
+
var _command__rspack_import_15 = __webpack_require__("./command");
|
|
339
339
|
var __rspack_reexport = {};
|
|
340
340
|
for(const __rspack_import_key in _command__rspack_import_15)if ([
|
|
341
341
|
"TreeView",
|
|
@@ -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__("./dialog");
|
|
374
374
|
var __rspack_reexport = {};
|
|
375
375
|
for(const __rspack_import_key in _dialog__rspack_import_20)if ([
|
|
376
376
|
"TreeView",
|
|
@@ -426,7 +426,7 @@ var __webpack_exports__ = {};
|
|
|
426
426
|
"default"
|
|
427
427
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_hover_card__rspack_import_27[__rspack_import_key];
|
|
428
428
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
429
|
-
var _input__rspack_import_28 = __webpack_require__("
|
|
429
|
+
var _input__rspack_import_28 = __webpack_require__("./input");
|
|
430
430
|
var __rspack_reexport = {};
|
|
431
431
|
for(const __rspack_import_key in _input__rspack_import_28)if ([
|
|
432
432
|
"TreeView",
|
|
@@ -440,7 +440,7 @@ var __webpack_exports__ = {};
|
|
|
440
440
|
"default"
|
|
441
441
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_input_group__rspack_import_29[__rspack_import_key];
|
|
442
442
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
443
|
-
var _label__rspack_import_30 = __webpack_require__("
|
|
443
|
+
var _label__rspack_import_30 = __webpack_require__("./label");
|
|
444
444
|
var __rspack_reexport = {};
|
|
445
445
|
for(const __rspack_import_key in _label__rspack_import_30)if ([
|
|
446
446
|
"TreeView",
|
|
@@ -482,7 +482,7 @@ var __webpack_exports__ = {};
|
|
|
482
482
|
"default"
|
|
483
483
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_popover__rspack_import_35[__rspack_import_key];
|
|
484
484
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
485
|
-
var _portal_container__rspack_import_36 = __webpack_require__("
|
|
485
|
+
var _portal_container__rspack_import_36 = __webpack_require__("./portal-container");
|
|
486
486
|
var __rspack_reexport = {};
|
|
487
487
|
for(const __rspack_import_key in _portal_container__rspack_import_36)if ([
|
|
488
488
|
"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__("@/components/ui/table");
|
|
605
605
|
var __rspack_reexport = {};
|
|
606
606
|
for(const __rspack_import_key in _table__rspack_import_53)if ([
|
|
607
607
|
"TreeView",
|
|
@@ -47,7 +47,7 @@ const Input = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ 'aria-d
|
|
|
47
47
|
"aria-describedby": describedBy || void 0,
|
|
48
48
|
"aria-errormessage": error ? validationId : ariaErrorMessage,
|
|
49
49
|
"aria-invalid": error ? true : ariaInvalid,
|
|
50
|
-
className: (0, utils_cjs_namespaceObject.cn)('flex w-full transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'default' === size && 'h-9 rounded-md px-3 py-1 text-base placeholder:text-muted-foreground md:text-sm', 'xs' === size && 'h-6 rounded px-2 text-xs placeholder:text-muted-foreground', 'default' === variant && 'border border-input bg-transparent', 'ghost' === variant && 'border-0 bg-surface-overlay', 'default' === variant && 'default' === size && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:py-2 future:text-sm future:placeholder:text-foreground-muted future:placeholder:font-normal future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
|
|
50
|
+
className: (0, utils_cjs_namespaceObject.cn)('flex w-full transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring read-only:cursor-default disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'default' === size && 'h-9 rounded-md px-3 py-1 text-base placeholder:text-muted-foreground md:text-sm', 'xs' === size && 'h-6 rounded px-2 text-xs placeholder:text-muted-foreground', 'default' === variant && 'border border-input bg-transparent', 'ghost' === variant && 'border-0 bg-surface-overlay', 'default' === variant && 'default' === size && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:py-2 future:text-sm future:placeholder:text-foreground-muted future:placeholder:font-normal future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
|
|
51
51
|
ref: ref
|
|
52
52
|
}),
|
|
53
53
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
@@ -19,7 +19,7 @@ const Input = /*#__PURE__*/ forwardRef(({ 'aria-describedby': ariaDescribedBy, '
|
|
|
19
19
|
"aria-describedby": describedBy || void 0,
|
|
20
20
|
"aria-errormessage": error ? validationId : ariaErrorMessage,
|
|
21
21
|
"aria-invalid": error ? true : ariaInvalid,
|
|
22
|
-
className: cn('flex w-full transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'default' === size && 'h-9 rounded-md px-3 py-1 text-base placeholder:text-muted-foreground md:text-sm', 'xs' === size && 'h-6 rounded px-2 text-xs placeholder:text-muted-foreground', 'default' === variant && 'border border-input bg-transparent', 'ghost' === variant && 'border-0 bg-surface-overlay', 'default' === variant && 'default' === size && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:py-2 future:text-sm future:placeholder:text-foreground-muted future:placeholder:font-normal future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
|
|
22
|
+
className: cn('flex w-full transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring read-only:cursor-default disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'default' === size && 'h-9 rounded-md px-3 py-1 text-base placeholder:text-muted-foreground md:text-sm', 'xs' === size && 'h-6 rounded px-2 text-xs placeholder:text-muted-foreground', 'default' === variant && 'border border-input bg-transparent', 'ghost' === variant && 'border-0 bg-surface-overlay', 'default' === variant && 'default' === size && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:py-2 future:text-sm future:placeholder:text-foreground-muted future:placeholder:font-normal future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
|
|
23
23
|
ref: ref
|
|
24
24
|
}),
|
|
25
25
|
/*#__PURE__*/ jsx(FormFieldError, {
|
|
@@ -53,7 +53,7 @@ const Label = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ classNa
|
|
|
53
53
|
...props
|
|
54
54
|
}));
|
|
55
55
|
Label.displayName = react_label_namespaceObject.Root.displayName;
|
|
56
|
-
const RequiredIndicator = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, srLabel
|
|
56
|
+
const RequiredIndicator = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, srLabel, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
57
57
|
ref: ref,
|
|
58
58
|
...props,
|
|
59
59
|
className: (0, index_cjs_namespaceObject.cn)('ml-0.5', className, 'text-foreground'),
|
|
@@ -62,7 +62,7 @@ const RequiredIndicator = /*#__PURE__*/ external_react_namespaceObject.forwardRe
|
|
|
62
62
|
"aria-hidden": "true",
|
|
63
63
|
children: "*"
|
|
64
64
|
}),
|
|
65
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
65
|
+
srLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
66
66
|
className: "sr-only",
|
|
67
67
|
children: srLabel
|
|
68
68
|
})
|
|
@@ -34,10 +34,10 @@ export interface RequiredIndicatorProps extends Omit<React.HTMLAttributes<HTMLSp
|
|
|
34
34
|
* required field isn't in an error state, so coloring the asterisk red reads
|
|
35
35
|
* as a validation failure before the person has done anything. The asterisk
|
|
36
36
|
* glyph is `aria-hidden` since it's a visual affordance, not the thing that
|
|
37
|
-
* makes the field required to assistive tech;
|
|
38
|
-
*
|
|
39
|
-
* the field's own control
|
|
40
|
-
*
|
|
37
|
+
* makes the field required to assistive tech;
|
|
38
|
+
* Use `required` or `aria-required` on the field's control for that.
|
|
39
|
+
* Or pass `srLabel` to provide assistive announcements if the field's own control
|
|
40
|
+
* is missing `required`/`aria-required`.
|
|
41
41
|
*/
|
|
42
42
|
declare const RequiredIndicator: React.ForwardRefExoticComponent<RequiredIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
43
43
|
export { Label, RequiredIndicator };
|
|
@@ -24,7 +24,7 @@ const Label = /*#__PURE__*/ forwardRef(({ className, variant = 'default', ...pro
|
|
|
24
24
|
...props
|
|
25
25
|
}));
|
|
26
26
|
Label.displayName = Root.displayName;
|
|
27
|
-
const RequiredIndicator = /*#__PURE__*/ forwardRef(({ className, srLabel
|
|
27
|
+
const RequiredIndicator = /*#__PURE__*/ forwardRef(({ className, srLabel, ...props }, ref)=>/*#__PURE__*/ jsxs("span", {
|
|
28
28
|
ref: ref,
|
|
29
29
|
...props,
|
|
30
30
|
className: cn('ml-0.5', className, 'text-foreground'),
|
|
@@ -33,7 +33,7 @@ const RequiredIndicator = /*#__PURE__*/ forwardRef(({ className, srLabel = ' (re
|
|
|
33
33
|
"aria-hidden": "true",
|
|
34
34
|
children: "*"
|
|
35
35
|
}),
|
|
36
|
-
/*#__PURE__*/ jsx("span", {
|
|
36
|
+
srLabel && /*#__PURE__*/ jsx("span", {
|
|
37
37
|
className: "sr-only",
|
|
38
38
|
children: srLabel
|
|
39
39
|
})
|
|
@@ -39,7 +39,7 @@ const external_tooltip_cjs_namespaceObject = require("../../tooltip.cjs");
|
|
|
39
39
|
const index_cjs_namespaceObject = require("../../variable-picker/index.cjs");
|
|
40
40
|
const external_lib_index_cjs_namespaceObject = require("../../../../lib/index.cjs");
|
|
41
41
|
const external_types_cjs_namespaceObject = require("../types.cjs");
|
|
42
|
-
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
|
|
42
|
+
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, showAiAssist, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
|
|
43
43
|
const promptId = (0, external_react_namespaceObject.useId)();
|
|
44
44
|
const [aiPrompt, setAiPrompt] = (0, external_react_namespaceObject.useState)('');
|
|
45
45
|
const typeMeta = external_types_cjs_namespaceObject.FIELD_TYPE_META[fieldType];
|
|
@@ -197,7 +197,7 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldT
|
|
|
197
197
|
}),
|
|
198
198
|
showFieldActions && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
199
199
|
children: [
|
|
200
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
|
|
200
|
+
showAiAssist && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
|
|
201
201
|
children: [
|
|
202
202
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
203
203
|
children: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { LockableFieldType, LockableValueFieldOption } from '../types';
|
|
3
|
-
export declare function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions, }: {
|
|
3
|
+
export declare function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, showAiAssist, value, onValueChange, variables, onGenerateWithAi, headerActions, }: {
|
|
4
4
|
label?: ReactNode;
|
|
5
5
|
fieldId: string;
|
|
6
6
|
fieldLabel: string;
|
|
@@ -10,6 +10,7 @@ export declare function FieldHeader({ label, fieldId, fieldLabel, required, fiel
|
|
|
10
10
|
onRequiredChange?: (required: boolean) => void;
|
|
11
11
|
compact?: boolean;
|
|
12
12
|
showFieldActions: boolean;
|
|
13
|
+
showAiAssist: boolean;
|
|
13
14
|
value: string;
|
|
14
15
|
onValueChange?: (value: string) => void;
|
|
15
16
|
variables: LockableValueFieldOption[];
|
|
@@ -11,7 +11,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../
|
|
|
11
11
|
import { VariablePicker } from "../../variable-picker/index.js";
|
|
12
12
|
import { cn } from "../../../../lib/index.js";
|
|
13
13
|
import { FIELD_TYPE_META, FIELD_TYPE_ORDER } from "../types.js";
|
|
14
|
-
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
|
|
14
|
+
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, showAiAssist, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
|
|
15
15
|
const promptId = useId();
|
|
16
16
|
const [aiPrompt, setAiPrompt] = useState('');
|
|
17
17
|
const typeMeta = FIELD_TYPE_META[fieldType];
|
|
@@ -169,7 +169,7 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldT
|
|
|
169
169
|
}),
|
|
170
170
|
showFieldActions && /*#__PURE__*/ jsxs(Fragment, {
|
|
171
171
|
children: [
|
|
172
|
-
/*#__PURE__*/ jsxs(Popover, {
|
|
172
|
+
showAiAssist && /*#__PURE__*/ jsxs(Popover, {
|
|
173
173
|
children: [
|
|
174
174
|
/*#__PURE__*/ jsxs(Tooltip, {
|
|
175
175
|
children: [
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { LockableValueField } from './lockable-value-field';
|
|
2
|
-
export type { LockableFieldType, LockableValueFieldMode, LockableValueFieldOption, LockableValueFieldProps, } from './types';
|
|
2
|
+
export type { LockableFieldType, LockableValueFieldMode, LockableValueFieldMoreActions, LockableValueFieldOption, LockableValueFieldProps, } from './types';
|
|
3
3
|
export { FIELD_TYPE_META, FIELD_TYPE_ORDER } from './types';
|
|
@@ -32,8 +32,6 @@ const external_react_namespaceObject = require("react");
|
|
|
32
32
|
const external_calendar_cjs_namespaceObject = require("../calendar.cjs");
|
|
33
33
|
const external_dropdown_menu_cjs_namespaceObject = require("../dropdown-menu.cjs");
|
|
34
34
|
const external_file_upload_cjs_namespaceObject = require("../file-upload.cjs");
|
|
35
|
-
const external_form_field_cjs_namespaceObject = require("../form-field.cjs");
|
|
36
|
-
const external_input_cjs_namespaceObject = require("../input.cjs");
|
|
37
35
|
const external_input_group_cjs_namespaceObject = require("../input-group.cjs");
|
|
38
36
|
const external_multi_select_cjs_namespaceObject = require("../multi-select.cjs");
|
|
39
37
|
const external_popover_cjs_namespaceObject = require("../popover.cjs");
|
|
@@ -45,7 +43,46 @@ const lock_toggle_button_cjs_namespaceObject = require("./components/lock-toggle
|
|
|
45
43
|
const mode_menu_item_cjs_namespaceObject = require("./components/mode-menu-item.cjs");
|
|
46
44
|
const external_types_cjs_namespaceObject = require("./types.cjs");
|
|
47
45
|
const external_utils_cjs_namespaceObject = require("./utils.cjs");
|
|
48
|
-
function
|
|
46
|
+
function MoreActionsMenu({ more, locked }) {
|
|
47
|
+
const onClear = locked ? void 0 : more.onClear;
|
|
48
|
+
const onRefresh = more.onRefresh;
|
|
49
|
+
if (!onClear && !onRefresh) return null;
|
|
50
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuTrigger, {
|
|
53
|
+
asChild: true,
|
|
54
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
|
|
55
|
+
icon: true,
|
|
56
|
+
size: "3xs",
|
|
57
|
+
"aria-label": "More value actions",
|
|
58
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.MoreHorizontal, {})
|
|
59
|
+
})
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuContent, {
|
|
62
|
+
align: "end",
|
|
63
|
+
className: "w-40",
|
|
64
|
+
children: [
|
|
65
|
+
onClear && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuItem, {
|
|
66
|
+
className: "text-error focus:text-error",
|
|
67
|
+
onClick: onClear,
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Trash2, {}),
|
|
70
|
+
"Clear value"
|
|
71
|
+
]
|
|
72
|
+
}),
|
|
73
|
+
onRefresh && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuItem, {
|
|
74
|
+
onClick: onRefresh,
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.RefreshCw, {}),
|
|
77
|
+
"Force refresh"
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function LockableValueField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, leadingAddon, trailingAddon, more, mode = 'fixed', onModeChange, renderExpressionEditor, fieldType = 'string', onFieldTypeChange, required, onRequiredChange, label, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, showAiAssist = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, variables = [], id, className }) {
|
|
49
86
|
const generatedId = (0, external_react_namespaceObject.useId)().replace(/:/g, '');
|
|
50
87
|
const [datePopoverOpen, setDatePopoverOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
51
88
|
const [selectOpen, setSelectOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
@@ -57,6 +94,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
57
94
|
const fieldTypeLabel = typeMeta.label.toLowerCase();
|
|
58
95
|
const expressionArticle = /^[aeiou]/.test(fieldTypeLabel) ? 'an' : 'a';
|
|
59
96
|
const fieldLabel = 'expression' === effectiveMode ? `Write ${expressionArticle} ${fieldTypeLabel} expression` : `${typeMeta.label} value`;
|
|
97
|
+
const hasMoreActions = Boolean(more?.onRefresh || !locked && more?.onClear);
|
|
60
98
|
const lockedDisplayValue = (0, external_utils_cjs_namespaceObject.getLockedDisplayValue)(fieldType, value, options);
|
|
61
99
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
62
100
|
className: (0, index_cjs_namespaceObject.cn)('@container group flex flex-col gap-1.5', className),
|
|
@@ -71,6 +109,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
71
109
|
onRequiredChange: onRequiredChange,
|
|
72
110
|
compact: compact,
|
|
73
111
|
showFieldActions: showFieldActions,
|
|
112
|
+
showAiAssist: showAiAssist,
|
|
74
113
|
value: value,
|
|
75
114
|
onValueChange: editableOnValueChange,
|
|
76
115
|
variables: variables,
|
|
@@ -80,11 +119,11 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
80
119
|
typeMeta.supportsExpression ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
81
120
|
error: error,
|
|
82
121
|
errorId: validationId,
|
|
83
|
-
className: (0, index_cjs_namespaceObject.cn)('
|
|
122
|
+
className: (0, index_cjs_namespaceObject.cn)('file' === fieldType && !locked && 'fixed' === effectiveMode && 'h-auto items-stretch'),
|
|
84
123
|
children: [
|
|
85
|
-
null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
124
|
+
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
86
125
|
align: "inline-start",
|
|
87
|
-
children: void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
126
|
+
children: void 0 !== leadingAddon ? leadingAddon : showLock && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
88
127
|
locked: locked,
|
|
89
128
|
onLockedChange: onLockedChange
|
|
90
129
|
})
|
|
@@ -183,59 +222,68 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
183
222
|
}),
|
|
184
223
|
null !== trailingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
185
224
|
align: "inline-end",
|
|
186
|
-
className:
|
|
187
|
-
children: void 0 !== trailingAddon ? trailingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
225
|
+
className: "cursor-default",
|
|
226
|
+
children: void 0 !== trailingAddon ? trailingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
188
227
|
children: [
|
|
189
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
190
|
-
asChild: true,
|
|
191
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
|
|
192
|
-
icon: true,
|
|
193
|
-
size: "3xs",
|
|
194
|
-
disabled: !onModeChange,
|
|
195
|
-
"aria-label": "Choose value type",
|
|
196
|
-
children: 'expression' === effectiveMode ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Code2, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Type, {})
|
|
197
|
-
})
|
|
198
|
-
}),
|
|
199
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuContent, {
|
|
200
|
-
align: "end",
|
|
201
|
-
className: "w-56",
|
|
228
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
|
|
202
229
|
children: [
|
|
203
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
230
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuTrigger, {
|
|
231
|
+
asChild: true,
|
|
232
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
|
|
233
|
+
icon: true,
|
|
234
|
+
size: "3xs",
|
|
235
|
+
disabled: !onModeChange,
|
|
236
|
+
"aria-label": "Choose value type",
|
|
237
|
+
children: 'expression' === effectiveMode ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Code2, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Type, {})
|
|
238
|
+
})
|
|
209
239
|
}),
|
|
210
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
240
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuContent, {
|
|
241
|
+
align: "end",
|
|
242
|
+
className: "w-56",
|
|
243
|
+
children: [
|
|
244
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(mode_menu_item_cjs_namespaceObject.ModeMenuItem, {
|
|
245
|
+
icon: external_lucide_react_namespaceObject.Type,
|
|
246
|
+
label: typeMeta.fixedLabel,
|
|
247
|
+
description: typeMeta.fixedDescription,
|
|
248
|
+
active: 'fixed' === effectiveMode,
|
|
249
|
+
onClick: ()=>onModeChange?.('fixed')
|
|
250
|
+
}),
|
|
251
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(mode_menu_item_cjs_namespaceObject.ModeMenuItem, {
|
|
252
|
+
icon: external_lucide_react_namespaceObject.Code2,
|
|
253
|
+
label: "Expression",
|
|
254
|
+
description: "Use a JS expression",
|
|
255
|
+
active: 'expression' === effectiveMode,
|
|
256
|
+
onClick: ()=>onModeChange?.('expression')
|
|
257
|
+
})
|
|
258
|
+
]
|
|
216
259
|
})
|
|
217
260
|
]
|
|
261
|
+
}),
|
|
262
|
+
hasMoreActions && more && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(MoreActionsMenu, {
|
|
263
|
+
more: more,
|
|
264
|
+
locked: locked
|
|
218
265
|
})
|
|
219
266
|
]
|
|
220
267
|
})
|
|
221
268
|
})
|
|
222
269
|
]
|
|
223
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
224
|
-
|
|
270
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
271
|
+
error: error,
|
|
272
|
+
errorId: validationId,
|
|
225
273
|
children: [
|
|
226
|
-
void 0 !== leadingAddon
|
|
227
|
-
|
|
228
|
-
|
|
274
|
+
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
275
|
+
align: "inline-start",
|
|
276
|
+
children: void 0 !== leadingAddon ? leadingAddon : showLock && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
277
|
+
locked: locked,
|
|
278
|
+
onLockedChange: onLockedChange
|
|
279
|
+
})
|
|
229
280
|
}),
|
|
230
|
-
locked ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
281
|
+
locked ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
231
282
|
id: fieldId,
|
|
232
|
-
"aria-invalid": error ? true : void 0,
|
|
233
|
-
"aria-describedby": error ? validationId : void 0,
|
|
234
|
-
"aria-errormessage": error ? validationId : void 0,
|
|
235
283
|
readOnly: true,
|
|
236
284
|
value: lockedDisplayValue,
|
|
237
285
|
placeholder: fieldLabel,
|
|
238
|
-
className: "
|
|
286
|
+
className: "min-w-0",
|
|
239
287
|
onBlur: onValueBlur
|
|
240
288
|
}) : 'single-select' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_select_cjs_namespaceObject.Select, {
|
|
241
289
|
open: selectOpen,
|
|
@@ -249,7 +297,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
249
297
|
children: [
|
|
250
298
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectTrigger, {
|
|
251
299
|
id: fieldId,
|
|
252
|
-
className: "flex-1",
|
|
300
|
+
className: "min-w-0 flex-1 rounded-none border-0 bg-transparent px-0 shadow-none future:rounded-none future:border-0 future:bg-transparent future:px-0",
|
|
253
301
|
"aria-invalid": error ? true : void 0,
|
|
254
302
|
"aria-describedby": error ? validationId : void 0,
|
|
255
303
|
"aria-errormessage": error ? validationId : void 0,
|
|
@@ -266,7 +314,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
266
314
|
]
|
|
267
315
|
}) : 'multi-select' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_multi_select_cjs_namespaceObject.MultiSelect, {
|
|
268
316
|
id: fieldId,
|
|
269
|
-
className: "flex-1",
|
|
317
|
+
className: "min-w-0 flex-1",
|
|
270
318
|
options: options,
|
|
271
319
|
selected: (0, external_utils_cjs_namespaceObject.parseListValue)(value),
|
|
272
320
|
onChange: (selected)=>onValueChange?.(JSON.stringify(selected)),
|
|
@@ -276,15 +324,17 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
276
324
|
"aria-invalid": error ? true : void 0,
|
|
277
325
|
"aria-describedby": error ? validationId : void 0,
|
|
278
326
|
"aria-errormessage": error ? validationId : void 0
|
|
279
|
-
}) : null
|
|
327
|
+
}) : null,
|
|
328
|
+
hasMoreActions && more && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
329
|
+
align: "inline-end",
|
|
330
|
+
className: "cursor-default",
|
|
331
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(MoreActionsMenu, {
|
|
332
|
+
more: more,
|
|
333
|
+
locked: locked
|
|
334
|
+
})
|
|
335
|
+
})
|
|
280
336
|
]
|
|
281
337
|
}),
|
|
282
|
-
!typeMeta.supportsExpression && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
283
|
-
id: validationId,
|
|
284
|
-
"data-slot": "lockable-value-field-error",
|
|
285
|
-
className: "mt-1",
|
|
286
|
-
children: error
|
|
287
|
-
}),
|
|
288
338
|
belowValue
|
|
289
339
|
]
|
|
290
340
|
});
|
|
@@ -11,4 +11,4 @@ import type { LockableValueFieldProps } from './types';
|
|
|
11
11
|
* Insert-variable menu is empty (and disabled) unless `variables` is
|
|
12
12
|
* provided; file uploads aren't persisted anywhere.
|
|
13
13
|
*/
|
|
14
|
-
export declare function LockableValueField({ value, onValueChange, onValueBlur, locked, onLockedChange, leadingAddon, trailingAddon, mode, onModeChange, renderExpressionEditor, fieldType, onFieldTypeChange, required, onRequiredChange, label, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions, options, onGenerateWithAi, variables, id, className, }: LockableValueFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function LockableValueField({ value, onValueChange, onValueBlur, locked, onLockedChange, showLock, leadingAddon, trailingAddon, more, mode, onModeChange, renderExpressionEditor, fieldType, onFieldTypeChange, required, onRequiredChange, label, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions, showAiAssist, options, onGenerateWithAi, variables, id, className, }: LockableValueFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Code2, Type } from "lucide-react";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Code2, MoreHorizontal, RefreshCw, Trash2, Type } from "lucide-react";
|
|
3
3
|
import { useId, useState } from "react";
|
|
4
4
|
import { Calendar } from "../calendar.js";
|
|
5
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "../dropdown-menu.js";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../dropdown-menu.js";
|
|
6
6
|
import { FileUpload } from "../file-upload.js";
|
|
7
|
-
import { FormFieldError } from "../form-field.js";
|
|
8
|
-
import { Input } from "../input.js";
|
|
9
7
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../input-group.js";
|
|
10
8
|
import { MultiSelect } from "../multi-select.js";
|
|
11
9
|
import { Popover, PopoverContent, PopoverTrigger } from "../popover.js";
|
|
@@ -17,7 +15,46 @@ import { LockToggleButton } from "./components/lock-toggle-button.js";
|
|
|
17
15
|
import { ModeMenuItem } from "./components/mode-menu-item.js";
|
|
18
16
|
import { FIELD_TYPE_META } from "./types.js";
|
|
19
17
|
import { DEFAULT_SELECT_OPTIONS, formatDateValue, getLockedDisplayValue, parseDateValue, parseListValue, toDateOnlyString } from "./utils.js";
|
|
20
|
-
function
|
|
18
|
+
function MoreActionsMenu({ more, locked }) {
|
|
19
|
+
const onClear = locked ? void 0 : more.onClear;
|
|
20
|
+
const onRefresh = more.onRefresh;
|
|
21
|
+
if (!onClear && !onRefresh) return null;
|
|
22
|
+
return /*#__PURE__*/ jsxs(DropdownMenu, {
|
|
23
|
+
children: [
|
|
24
|
+
/*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
25
|
+
asChild: true,
|
|
26
|
+
children: /*#__PURE__*/ jsx(InputGroupButton, {
|
|
27
|
+
icon: true,
|
|
28
|
+
size: "3xs",
|
|
29
|
+
"aria-label": "More value actions",
|
|
30
|
+
children: /*#__PURE__*/ jsx(MoreHorizontal, {})
|
|
31
|
+
})
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ jsxs(DropdownMenuContent, {
|
|
34
|
+
align: "end",
|
|
35
|
+
className: "w-40",
|
|
36
|
+
children: [
|
|
37
|
+
onClear && /*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
38
|
+
className: "text-error focus:text-error",
|
|
39
|
+
onClick: onClear,
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ jsx(Trash2, {}),
|
|
42
|
+
"Clear value"
|
|
43
|
+
]
|
|
44
|
+
}),
|
|
45
|
+
onRefresh && /*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
46
|
+
onClick: onRefresh,
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ jsx(RefreshCw, {}),
|
|
49
|
+
"Force refresh"
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function LockableValueField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, leadingAddon, trailingAddon, more, mode = 'fixed', onModeChange, renderExpressionEditor, fieldType = 'string', onFieldTypeChange, required, onRequiredChange, label, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, showAiAssist = true, options = DEFAULT_SELECT_OPTIONS, onGenerateWithAi, variables = [], id, className }) {
|
|
21
58
|
const generatedId = useId().replace(/:/g, '');
|
|
22
59
|
const [datePopoverOpen, setDatePopoverOpen] = useState(false);
|
|
23
60
|
const [selectOpen, setSelectOpen] = useState(false);
|
|
@@ -29,6 +66,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
29
66
|
const fieldTypeLabel = typeMeta.label.toLowerCase();
|
|
30
67
|
const expressionArticle = /^[aeiou]/.test(fieldTypeLabel) ? 'an' : 'a';
|
|
31
68
|
const fieldLabel = 'expression' === effectiveMode ? `Write ${expressionArticle} ${fieldTypeLabel} expression` : `${typeMeta.label} value`;
|
|
69
|
+
const hasMoreActions = Boolean(more?.onRefresh || !locked && more?.onClear);
|
|
32
70
|
const lockedDisplayValue = getLockedDisplayValue(fieldType, value, options);
|
|
33
71
|
return /*#__PURE__*/ jsxs("div", {
|
|
34
72
|
className: cn('@container group flex flex-col gap-1.5', className),
|
|
@@ -43,6 +81,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
43
81
|
onRequiredChange: onRequiredChange,
|
|
44
82
|
compact: compact,
|
|
45
83
|
showFieldActions: showFieldActions,
|
|
84
|
+
showAiAssist: showAiAssist,
|
|
46
85
|
value: value,
|
|
47
86
|
onValueChange: editableOnValueChange,
|
|
48
87
|
variables: variables,
|
|
@@ -52,11 +91,11 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
52
91
|
typeMeta.supportsExpression ? /*#__PURE__*/ jsxs(InputGroup, {
|
|
53
92
|
error: error,
|
|
54
93
|
errorId: validationId,
|
|
55
|
-
className: cn('
|
|
94
|
+
className: cn('file' === fieldType && !locked && 'fixed' === effectiveMode && 'h-auto items-stretch'),
|
|
56
95
|
children: [
|
|
57
|
-
null !== leadingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
96
|
+
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
58
97
|
align: "inline-start",
|
|
59
|
-
children: void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ jsx(LockToggleButton, {
|
|
98
|
+
children: void 0 !== leadingAddon ? leadingAddon : showLock && /*#__PURE__*/ jsx(LockToggleButton, {
|
|
60
99
|
locked: locked,
|
|
61
100
|
onLockedChange: onLockedChange
|
|
62
101
|
})
|
|
@@ -155,59 +194,68 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
155
194
|
}),
|
|
156
195
|
null !== trailingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
157
196
|
align: "inline-end",
|
|
158
|
-
className:
|
|
159
|
-
children: void 0 !== trailingAddon ? trailingAddon : /*#__PURE__*/ jsxs(
|
|
197
|
+
className: "cursor-default",
|
|
198
|
+
children: void 0 !== trailingAddon ? trailingAddon : /*#__PURE__*/ jsxs(Fragment, {
|
|
160
199
|
children: [
|
|
161
|
-
/*#__PURE__*/
|
|
162
|
-
asChild: true,
|
|
163
|
-
children: /*#__PURE__*/ jsx(InputGroupButton, {
|
|
164
|
-
icon: true,
|
|
165
|
-
size: "3xs",
|
|
166
|
-
disabled: !onModeChange,
|
|
167
|
-
"aria-label": "Choose value type",
|
|
168
|
-
children: 'expression' === effectiveMode ? /*#__PURE__*/ jsx(Code2, {}) : /*#__PURE__*/ jsx(Type, {})
|
|
169
|
-
})
|
|
170
|
-
}),
|
|
171
|
-
/*#__PURE__*/ jsxs(DropdownMenuContent, {
|
|
172
|
-
align: "end",
|
|
173
|
-
className: "w-56",
|
|
200
|
+
/*#__PURE__*/ jsxs(DropdownMenu, {
|
|
174
201
|
children: [
|
|
175
|
-
/*#__PURE__*/ jsx(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
202
|
+
/*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
203
|
+
asChild: true,
|
|
204
|
+
children: /*#__PURE__*/ jsx(InputGroupButton, {
|
|
205
|
+
icon: true,
|
|
206
|
+
size: "3xs",
|
|
207
|
+
disabled: !onModeChange,
|
|
208
|
+
"aria-label": "Choose value type",
|
|
209
|
+
children: 'expression' === effectiveMode ? /*#__PURE__*/ jsx(Code2, {}) : /*#__PURE__*/ jsx(Type, {})
|
|
210
|
+
})
|
|
181
211
|
}),
|
|
182
|
-
/*#__PURE__*/
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
212
|
+
/*#__PURE__*/ jsxs(DropdownMenuContent, {
|
|
213
|
+
align: "end",
|
|
214
|
+
className: "w-56",
|
|
215
|
+
children: [
|
|
216
|
+
/*#__PURE__*/ jsx(ModeMenuItem, {
|
|
217
|
+
icon: Type,
|
|
218
|
+
label: typeMeta.fixedLabel,
|
|
219
|
+
description: typeMeta.fixedDescription,
|
|
220
|
+
active: 'fixed' === effectiveMode,
|
|
221
|
+
onClick: ()=>onModeChange?.('fixed')
|
|
222
|
+
}),
|
|
223
|
+
/*#__PURE__*/ jsx(ModeMenuItem, {
|
|
224
|
+
icon: Code2,
|
|
225
|
+
label: "Expression",
|
|
226
|
+
description: "Use a JS expression",
|
|
227
|
+
active: 'expression' === effectiveMode,
|
|
228
|
+
onClick: ()=>onModeChange?.('expression')
|
|
229
|
+
})
|
|
230
|
+
]
|
|
188
231
|
})
|
|
189
232
|
]
|
|
233
|
+
}),
|
|
234
|
+
hasMoreActions && more && /*#__PURE__*/ jsx(MoreActionsMenu, {
|
|
235
|
+
more: more,
|
|
236
|
+
locked: locked
|
|
190
237
|
})
|
|
191
238
|
]
|
|
192
239
|
})
|
|
193
240
|
})
|
|
194
241
|
]
|
|
195
|
-
}) : /*#__PURE__*/ jsxs(
|
|
196
|
-
|
|
242
|
+
}) : /*#__PURE__*/ jsxs(InputGroup, {
|
|
243
|
+
error: error,
|
|
244
|
+
errorId: validationId,
|
|
197
245
|
children: [
|
|
198
|
-
void 0 !== leadingAddon
|
|
199
|
-
|
|
200
|
-
|
|
246
|
+
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
247
|
+
align: "inline-start",
|
|
248
|
+
children: void 0 !== leadingAddon ? leadingAddon : showLock && /*#__PURE__*/ jsx(LockToggleButton, {
|
|
249
|
+
locked: locked,
|
|
250
|
+
onLockedChange: onLockedChange
|
|
251
|
+
})
|
|
201
252
|
}),
|
|
202
|
-
locked ? /*#__PURE__*/ jsx(
|
|
253
|
+
locked ? /*#__PURE__*/ jsx(InputGroupInput, {
|
|
203
254
|
id: fieldId,
|
|
204
|
-
"aria-invalid": error ? true : void 0,
|
|
205
|
-
"aria-describedby": error ? validationId : void 0,
|
|
206
|
-
"aria-errormessage": error ? validationId : void 0,
|
|
207
255
|
readOnly: true,
|
|
208
256
|
value: lockedDisplayValue,
|
|
209
257
|
placeholder: fieldLabel,
|
|
210
|
-
className: "
|
|
258
|
+
className: "min-w-0",
|
|
211
259
|
onBlur: onValueBlur
|
|
212
260
|
}) : 'single-select' === fieldType ? /*#__PURE__*/ jsxs(Select, {
|
|
213
261
|
open: selectOpen,
|
|
@@ -221,7 +269,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
221
269
|
children: [
|
|
222
270
|
/*#__PURE__*/ jsx(SelectTrigger, {
|
|
223
271
|
id: fieldId,
|
|
224
|
-
className: "flex-1",
|
|
272
|
+
className: "min-w-0 flex-1 rounded-none border-0 bg-transparent px-0 shadow-none future:rounded-none future:border-0 future:bg-transparent future:px-0",
|
|
225
273
|
"aria-invalid": error ? true : void 0,
|
|
226
274
|
"aria-describedby": error ? validationId : void 0,
|
|
227
275
|
"aria-errormessage": error ? validationId : void 0,
|
|
@@ -238,7 +286,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
238
286
|
]
|
|
239
287
|
}) : 'multi-select' === fieldType ? /*#__PURE__*/ jsx(MultiSelect, {
|
|
240
288
|
id: fieldId,
|
|
241
|
-
className: "flex-1",
|
|
289
|
+
className: "min-w-0 flex-1",
|
|
242
290
|
options: options,
|
|
243
291
|
selected: parseListValue(value),
|
|
244
292
|
onChange: (selected)=>onValueChange?.(JSON.stringify(selected)),
|
|
@@ -248,15 +296,17 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
248
296
|
"aria-invalid": error ? true : void 0,
|
|
249
297
|
"aria-describedby": error ? validationId : void 0,
|
|
250
298
|
"aria-errormessage": error ? validationId : void 0
|
|
251
|
-
}) : null
|
|
299
|
+
}) : null,
|
|
300
|
+
hasMoreActions && more && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
301
|
+
align: "inline-end",
|
|
302
|
+
className: "cursor-default",
|
|
303
|
+
children: /*#__PURE__*/ jsx(MoreActionsMenu, {
|
|
304
|
+
more: more,
|
|
305
|
+
locked: locked
|
|
306
|
+
})
|
|
307
|
+
})
|
|
252
308
|
]
|
|
253
309
|
}),
|
|
254
|
-
!typeMeta.supportsExpression && /*#__PURE__*/ jsx(FormFieldError, {
|
|
255
|
-
id: validationId,
|
|
256
|
-
"data-slot": "lockable-value-field-error",
|
|
257
|
-
className: "mt-1",
|
|
258
|
-
children: error
|
|
259
|
-
}),
|
|
260
310
|
belowValue
|
|
261
311
|
]
|
|
262
312
|
});
|
|
@@ -15,6 +15,10 @@ export interface LockableValueFieldOption {
|
|
|
15
15
|
label: string;
|
|
16
16
|
value: string;
|
|
17
17
|
}
|
|
18
|
+
export interface LockableValueFieldMoreActions {
|
|
19
|
+
onClear?: () => void;
|
|
20
|
+
onRefresh?: () => void;
|
|
21
|
+
}
|
|
18
22
|
export interface LockableValueFieldProps {
|
|
19
23
|
/** Current field value. Encoding depends on fieldType (e.g. multi-select is a JSON array string). */
|
|
20
24
|
value?: string;
|
|
@@ -26,6 +30,8 @@ export interface LockableValueFieldProps {
|
|
|
26
30
|
locked?: boolean;
|
|
27
31
|
/** Called when the user toggles the lock. */
|
|
28
32
|
onLockedChange?: (locked: boolean) => void;
|
|
33
|
+
/** Whether the built-in lock control renders. Defaults to true. */
|
|
34
|
+
showLock?: boolean;
|
|
29
35
|
/**
|
|
30
36
|
* Replaces the leading lock toggle with a semantic prefix such as `=`.
|
|
31
37
|
* Pass `null` to suppress the built-in toggle; omitting the prop preserves it.
|
|
@@ -37,6 +43,8 @@ export interface LockableValueFieldProps {
|
|
|
37
43
|
* menu; omitting the prop preserves it.
|
|
38
44
|
*/
|
|
39
45
|
trailingAddon?: ReactNode;
|
|
46
|
+
/** Adds a field-level overflow menu beside the value control. */
|
|
47
|
+
more?: LockableValueFieldMoreActions;
|
|
40
48
|
/** Fixed value vs. JS expression. Defaults to 'fixed'. Ignored for types that don't support expressions. */
|
|
41
49
|
mode?: LockableValueFieldMode;
|
|
42
50
|
/** Called when the user switches modes. */
|
|
@@ -84,6 +92,8 @@ export interface LockableValueFieldProps {
|
|
|
84
92
|
controlsVisibility?: 'visible' | 'hover';
|
|
85
93
|
/** Whether the AI-assist and Insert-variable actions render at all. Set to false for read-only reviewer contexts where field configuration isn't editable. Defaults to true. */
|
|
86
94
|
showFieldActions?: boolean;
|
|
95
|
+
/** Whether the Generate with AI action renders. Defaults to true. */
|
|
96
|
+
showAiAssist?: boolean;
|
|
87
97
|
/** Options for 'single-select' / 'multi-select' field types. Defaults to a small set of demo options. */
|
|
88
98
|
options?: LockableValueFieldOption[];
|
|
89
99
|
/** Called with the entered prompt when the user clicks Generate in the AI-assist popover. */
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type { InputProps } from './components/ui/input';
|
|
|
15
15
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, } from './components/ui/input-group';
|
|
16
16
|
export type { InputGroupProps, InputGroupAddonProps, InputGroupButtonProps, InputGroupTextProps, InputGroupInputProps, InputGroupTextareaProps, } from './components/ui/input-group';
|
|
17
17
|
export { FIELD_TYPE_META, FIELD_TYPE_ORDER, LockableValueField, } from './components/ui/lockable-value-field';
|
|
18
|
-
export type { LockableValueFieldProps, LockableValueFieldMode, LockableFieldType, LockableValueFieldOption, } from './components/ui/lockable-value-field';
|
|
18
|
+
export type { LockableValueFieldProps, LockableValueFieldMode, LockableFieldType, LockableValueFieldOption, LockableValueFieldMoreActions, } from './components/ui/lockable-value-field';
|
|
19
19
|
export { Textarea } from './components/ui/textarea';
|
|
20
20
|
export type { TextareaProps } from './components/ui/textarea';
|
|
21
21
|
export { Label, RequiredIndicator } from './components/ui/label';
|
package/dist/styles.css
CHANGED
|
@@ -1205,6 +1205,9 @@
|
|
|
1205
1205
|
.min-h-12 {
|
|
1206
1206
|
min-height: calc(var(--spacing) * 12);
|
|
1207
1207
|
}
|
|
1208
|
+
.min-h-24 {
|
|
1209
|
+
min-height: calc(var(--spacing) * 24);
|
|
1210
|
+
}
|
|
1208
1211
|
.min-h-28 {
|
|
1209
1212
|
min-height: calc(var(--spacing) * 28);
|
|
1210
1213
|
}
|
|
@@ -4742,6 +4745,11 @@
|
|
|
4742
4745
|
border-left-width: 1px;
|
|
4743
4746
|
}
|
|
4744
4747
|
}
|
|
4748
|
+
.read-only\:cursor-default {
|
|
4749
|
+
&:read-only {
|
|
4750
|
+
cursor: default;
|
|
4751
|
+
}
|
|
4752
|
+
}
|
|
4745
4753
|
.focus-within\:border-border-hover {
|
|
4746
4754
|
&:focus-within {
|
|
4747
4755
|
border-color: var(--border-hover);
|
|
@@ -5149,6 +5157,13 @@
|
|
|
5149
5157
|
}
|
|
5150
5158
|
}
|
|
5151
5159
|
}
|
|
5160
|
+
.hover\:text-brand-hover {
|
|
5161
|
+
&:hover {
|
|
5162
|
+
@media (hover: hover) {
|
|
5163
|
+
color: var(--brand-hover);
|
|
5164
|
+
}
|
|
5165
|
+
}
|
|
5166
|
+
}
|
|
5152
5167
|
.hover\:text-destructive {
|
|
5153
5168
|
&:hover {
|
|
5154
5169
|
@media (hover: hover) {
|
|
@@ -5291,6 +5306,11 @@
|
|
|
5291
5306
|
color: var(--destructive);
|
|
5292
5307
|
}
|
|
5293
5308
|
}
|
|
5309
|
+
.focus\:text-error {
|
|
5310
|
+
&:focus {
|
|
5311
|
+
color: var(--error);
|
|
5312
|
+
}
|
|
5313
|
+
}
|
|
5294
5314
|
.focus\:text-foreground {
|
|
5295
5315
|
&:focus {
|
|
5296
5316
|
color: var(--foreground);
|
|
@@ -6287,6 +6307,11 @@
|
|
|
6287
6307
|
padding: calc(var(--spacing) * 0);
|
|
6288
6308
|
}
|
|
6289
6309
|
}
|
|
6310
|
+
.future\:px-0 {
|
|
6311
|
+
:is(.future-dark, .future-light) & {
|
|
6312
|
+
padding-inline: calc(var(--spacing) * 0);
|
|
6313
|
+
}
|
|
6314
|
+
}
|
|
6290
6315
|
.future\:px-4 {
|
|
6291
6316
|
:is(.future-dark, .future-light) & {
|
|
6292
6317
|
padding-inline: calc(var(--spacing) * 4);
|
|
@@ -6314,6 +6339,11 @@
|
|
|
6314
6339
|
font-weight: var(--font-weight-normal);
|
|
6315
6340
|
}
|
|
6316
6341
|
}
|
|
6342
|
+
.future\:text-brand {
|
|
6343
|
+
:is(.future-dark, .future-light) & {
|
|
6344
|
+
color: var(--brand);
|
|
6345
|
+
}
|
|
6346
|
+
}
|
|
6317
6347
|
.future\:text-foreground {
|
|
6318
6348
|
:is(.future-dark, .future-light) & {
|
|
6319
6349
|
color: var(--foreground);
|
|
@@ -6410,6 +6440,15 @@
|
|
|
6410
6440
|
}
|
|
6411
6441
|
}
|
|
6412
6442
|
}
|
|
6443
|
+
.future\:hover\:text-brand-hover {
|
|
6444
|
+
:is(.future-dark, .future-light) & {
|
|
6445
|
+
&:hover {
|
|
6446
|
+
@media (hover: hover) {
|
|
6447
|
+
color: var(--brand-hover);
|
|
6448
|
+
}
|
|
6449
|
+
}
|
|
6450
|
+
}
|
|
6451
|
+
}
|
|
6413
6452
|
.future\:hover\:text-foreground {
|
|
6414
6453
|
:is(.future-dark, .future-light) & {
|
|
6415
6454
|
&:hover {
|