@uipath/apollo-wind 2.31.0 → 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 +18 -18
- 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/components/ui/search.cjs +1 -1
- package/dist/components/ui/search.js +1 -1
- package/dist/index.cjs +28 -18
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/styles.css +71 -0
- package/package.json +2 -2
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Asterisk, Braces, ChevronDown, Sparkles } from "lucide-react";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { Button } from "../../button.js";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../dropdown-menu.js";
|
|
6
|
+
import { Label } from "../../label.js";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover.js";
|
|
8
|
+
import { Switch } from "../../switch.js";
|
|
9
|
+
import { Textarea } from "../../textarea.js";
|
|
10
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../tooltip.js";
|
|
11
|
+
import { cn } from "../../../../lib/index.js";
|
|
12
|
+
import { FIELD_TYPE_META, FIELD_TYPE_ORDER } from "../types.js";
|
|
13
|
+
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, controlsVisibility, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
|
|
14
|
+
const promptId = useId();
|
|
15
|
+
const [aiPrompt, setAiPrompt] = useState('');
|
|
16
|
+
const typeMeta = FIELD_TYPE_META[fieldType];
|
|
17
|
+
const collapsedTextClass = cn('@max-[259px]:hidden', compact && '!hidden');
|
|
18
|
+
const collapsedPaddingClass = cn('@max-[259px]:px-1.5', compact && '!px-1.5');
|
|
19
|
+
const compactOnlyClass = cn('hidden @max-[259px]:block', compact && '!block');
|
|
20
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
21
|
+
className: "flex items-center gap-1",
|
|
22
|
+
children: [
|
|
23
|
+
label ?? /*#__PURE__*/ jsxs(Label, {
|
|
24
|
+
htmlFor: fieldId,
|
|
25
|
+
className: "text-xs font-medium text-foreground-muted",
|
|
26
|
+
children: [
|
|
27
|
+
fieldLabel,
|
|
28
|
+
required && /*#__PURE__*/ jsx("span", {
|
|
29
|
+
className: "ml-0.5 text-destructive",
|
|
30
|
+
children: "*"
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ jsx(TooltipProvider, {
|
|
35
|
+
delayDuration: 300,
|
|
36
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
37
|
+
className: "ml-auto flex items-center gap-0.5",
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ jsxs("div", {
|
|
40
|
+
className: 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'),
|
|
41
|
+
children: [
|
|
42
|
+
onFieldTypeChange && /*#__PURE__*/ jsxs(DropdownMenu, {
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ jsxs(Tooltip, {
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
47
|
+
asChild: true,
|
|
48
|
+
children: /*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
49
|
+
asChild: true,
|
|
50
|
+
children: /*#__PURE__*/ jsxs("button", {
|
|
51
|
+
type: "button",
|
|
52
|
+
"aria-label": "Field type",
|
|
53
|
+
className: 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),
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ jsx(typeMeta.icon, {
|
|
56
|
+
size: 12
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ jsx("span", {
|
|
59
|
+
className: collapsedTextClass,
|
|
60
|
+
children: typeMeta.label
|
|
61
|
+
}),
|
|
62
|
+
/*#__PURE__*/ jsx(ChevronDown, {
|
|
63
|
+
size: 9,
|
|
64
|
+
className: collapsedTextClass
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
71
|
+
children: "Type"
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
}),
|
|
75
|
+
/*#__PURE__*/ jsx(DropdownMenuContent, {
|
|
76
|
+
align: "end",
|
|
77
|
+
className: "w-44",
|
|
78
|
+
children: FIELD_TYPE_ORDER.map((type)=>{
|
|
79
|
+
const meta = FIELD_TYPE_META[type];
|
|
80
|
+
const isActive = type === fieldType;
|
|
81
|
+
return /*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
82
|
+
onClick: ()=>onFieldTypeChange(type),
|
|
83
|
+
children: [
|
|
84
|
+
/*#__PURE__*/ jsx(meta.icon, {
|
|
85
|
+
className: isActive ? 'text-brand' : 'text-foreground-muted'
|
|
86
|
+
}),
|
|
87
|
+
/*#__PURE__*/ jsx("span", {
|
|
88
|
+
className: cn(isActive && 'font-medium text-brand'),
|
|
89
|
+
children: meta.label
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
}, type);
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
onRequiredChange && /*#__PURE__*/ jsxs(Fragment, {
|
|
98
|
+
children: [
|
|
99
|
+
/*#__PURE__*/ jsx("div", {
|
|
100
|
+
className: collapsedTextClass,
|
|
101
|
+
children: /*#__PURE__*/ jsxs(Tooltip, {
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
104
|
+
asChild: true,
|
|
105
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
106
|
+
className: "inline-flex",
|
|
107
|
+
children: /*#__PURE__*/ jsx(Switch, {
|
|
108
|
+
size: "sm",
|
|
109
|
+
checked: !!required,
|
|
110
|
+
onCheckedChange: onRequiredChange,
|
|
111
|
+
className: "data-[state=checked]:bg-brand data-[state=unchecked]:bg-foreground-subtle",
|
|
112
|
+
"aria-label": required ? 'Required field' : 'Optional field'
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
117
|
+
children: "Required"
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/*#__PURE__*/ jsx("div", {
|
|
123
|
+
className: compactOnlyClass,
|
|
124
|
+
children: /*#__PURE__*/ jsxs(Popover, {
|
|
125
|
+
children: [
|
|
126
|
+
/*#__PURE__*/ jsxs(Tooltip, {
|
|
127
|
+
children: [
|
|
128
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
129
|
+
asChild: true,
|
|
130
|
+
children: /*#__PURE__*/ jsx(PopoverTrigger, {
|
|
131
|
+
asChild: true,
|
|
132
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
133
|
+
type: "button",
|
|
134
|
+
"aria-label": required ? 'Required field' : 'Optional field',
|
|
135
|
+
className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
|
|
136
|
+
children: /*#__PURE__*/ jsx(Asterisk, {
|
|
137
|
+
size: 12
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
143
|
+
children: "Required"
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
}),
|
|
147
|
+
/*#__PURE__*/ jsx(PopoverContent, {
|
|
148
|
+
align: "end",
|
|
149
|
+
className: "w-48",
|
|
150
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
151
|
+
className: "flex items-center justify-between gap-3",
|
|
152
|
+
children: [
|
|
153
|
+
/*#__PURE__*/ jsx("span", {
|
|
154
|
+
className: "text-xs font-medium text-foreground",
|
|
155
|
+
children: "Required"
|
|
156
|
+
}),
|
|
157
|
+
/*#__PURE__*/ jsx(Switch, {
|
|
158
|
+
size: "sm",
|
|
159
|
+
checked: !!required,
|
|
160
|
+
onCheckedChange: onRequiredChange,
|
|
161
|
+
className: "data-[state=checked]:bg-brand data-[state=unchecked]:bg-foreground-subtle",
|
|
162
|
+
"aria-label": required ? 'Required field' : 'Optional field'
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
}),
|
|
172
|
+
showFieldActions && /*#__PURE__*/ jsxs(Fragment, {
|
|
173
|
+
children: [
|
|
174
|
+
/*#__PURE__*/ jsxs(Popover, {
|
|
175
|
+
children: [
|
|
176
|
+
/*#__PURE__*/ jsxs(Tooltip, {
|
|
177
|
+
children: [
|
|
178
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
179
|
+
asChild: true,
|
|
180
|
+
children: /*#__PURE__*/ jsx(PopoverTrigger, {
|
|
181
|
+
asChild: true,
|
|
182
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
183
|
+
type: "button",
|
|
184
|
+
"aria-label": "AI assist",
|
|
185
|
+
className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
|
|
186
|
+
children: /*#__PURE__*/ jsx(Sparkles, {
|
|
187
|
+
size: 12
|
|
188
|
+
})
|
|
189
|
+
})
|
|
190
|
+
})
|
|
191
|
+
}),
|
|
192
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
193
|
+
children: "Generate with AI"
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ jsxs(PopoverContent, {
|
|
198
|
+
align: "end",
|
|
199
|
+
className: "space-y-3",
|
|
200
|
+
children: [
|
|
201
|
+
/*#__PURE__*/ jsxs("div", {
|
|
202
|
+
className: "space-y-1.5",
|
|
203
|
+
children: [
|
|
204
|
+
/*#__PURE__*/ jsx(Label, {
|
|
205
|
+
htmlFor: promptId,
|
|
206
|
+
className: "text-xs font-medium text-foreground-muted",
|
|
207
|
+
children: "Describe what you want"
|
|
208
|
+
}),
|
|
209
|
+
/*#__PURE__*/ jsx(Textarea, {
|
|
210
|
+
id: promptId,
|
|
211
|
+
rows: 3,
|
|
212
|
+
value: aiPrompt,
|
|
213
|
+
onChange: (e)=>setAiPrompt(e.target.value),
|
|
214
|
+
placeholder: "Display a value from the previous step",
|
|
215
|
+
className: "resize-none text-sm"
|
|
216
|
+
})
|
|
217
|
+
]
|
|
218
|
+
}),
|
|
219
|
+
/*#__PURE__*/ jsxs("span", {
|
|
220
|
+
className: "block text-[11px] text-foreground-subtle",
|
|
221
|
+
children: [
|
|
222
|
+
"Output: ",
|
|
223
|
+
typeMeta.label,
|
|
224
|
+
typeMeta.supportsExpression ? ' expression' : ' value'
|
|
225
|
+
]
|
|
226
|
+
}),
|
|
227
|
+
/*#__PURE__*/ jsx(Button, {
|
|
228
|
+
size: "sm",
|
|
229
|
+
className: "w-full",
|
|
230
|
+
disabled: !onGenerateWithAi,
|
|
231
|
+
onClick: ()=>onGenerateWithAi?.(aiPrompt),
|
|
232
|
+
children: "Generate"
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
}),
|
|
238
|
+
/*#__PURE__*/ jsxs(DropdownMenu, {
|
|
239
|
+
children: [
|
|
240
|
+
/*#__PURE__*/ jsxs(Tooltip, {
|
|
241
|
+
children: [
|
|
242
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
243
|
+
asChild: true,
|
|
244
|
+
children: /*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
245
|
+
asChild: true,
|
|
246
|
+
children: /*#__PURE__*/ jsxs("button", {
|
|
247
|
+
type: "button",
|
|
248
|
+
"aria-label": "Insert variable",
|
|
249
|
+
disabled: 0 === variables.length || !onValueChange,
|
|
250
|
+
className: 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),
|
|
251
|
+
children: [
|
|
252
|
+
/*#__PURE__*/ jsx(Braces, {
|
|
253
|
+
size: 12
|
|
254
|
+
}),
|
|
255
|
+
/*#__PURE__*/ jsx("span", {
|
|
256
|
+
className: collapsedTextClass,
|
|
257
|
+
children: "Insert"
|
|
258
|
+
}),
|
|
259
|
+
/*#__PURE__*/ jsx(ChevronDown, {
|
|
260
|
+
size: 9,
|
|
261
|
+
className: collapsedTextClass
|
|
262
|
+
})
|
|
263
|
+
]
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
}),
|
|
267
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
268
|
+
children: "Insert variable"
|
|
269
|
+
})
|
|
270
|
+
]
|
|
271
|
+
}),
|
|
272
|
+
/*#__PURE__*/ jsx(DropdownMenuContent, {
|
|
273
|
+
align: "end",
|
|
274
|
+
className: "w-48",
|
|
275
|
+
children: variables.map((variable)=>/*#__PURE__*/ jsx(DropdownMenuItem, {
|
|
276
|
+
onClick: ()=>onValueChange?.(value ? `${value} ${variable.value}` : variable.value),
|
|
277
|
+
children: variable.label
|
|
278
|
+
}, variable.value))
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
})
|
|
282
|
+
]
|
|
283
|
+
})
|
|
284
|
+
]
|
|
285
|
+
}),
|
|
286
|
+
headerActions
|
|
287
|
+
]
|
|
288
|
+
})
|
|
289
|
+
})
|
|
290
|
+
]
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
export { FieldHeader };
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
LockToggleButton: ()=>LockToggleButton
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
+
const external_input_group_cjs_namespaceObject = require("../../input-group.cjs");
|
|
32
|
+
const external_tooltip_cjs_namespaceObject = require("../../tooltip.cjs");
|
|
33
|
+
function LockToggleButton({ locked, onLockedChange }) {
|
|
34
|
+
const interactive = !!onLockedChange;
|
|
35
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipProvider, {
|
|
36
|
+
delayDuration: 300,
|
|
37
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
|
|
40
|
+
asChild: true,
|
|
41
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
|
|
42
|
+
icon: true,
|
|
43
|
+
size: "3xs",
|
|
44
|
+
disabled: !interactive,
|
|
45
|
+
onClick: ()=>onLockedChange?.(!locked),
|
|
46
|
+
"aria-label": interactive ? locked ? 'Read-only. Click to make editable.' : 'Editable. Click to make read-only.' : locked ? 'Read-only' : 'Editable',
|
|
47
|
+
children: locked ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.LockKeyhole, {
|
|
48
|
+
size: 16
|
|
49
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.LockKeyholeOpen, {
|
|
50
|
+
size: 16
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
}),
|
|
54
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
|
|
55
|
+
children: locked ? 'Read-only' : 'Editable'
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.LockToggleButton = __webpack_exports__.LockToggleButton;
|
|
62
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
63
|
+
"LockToggleButton"
|
|
64
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
65
|
+
Object.defineProperty(exports, '__esModule', {
|
|
66
|
+
value: true
|
|
67
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The lock/unlock toggle shared by both the InputGroup and plain-Input
|
|
3
|
+
* layouts. Disabled (and its label adjusted) when onLockedChange isn't
|
|
4
|
+
* provided, since clicking it wouldn't do anything otherwise.
|
|
5
|
+
*/
|
|
6
|
+
export declare function LockToggleButton({ locked, onLockedChange, }: {
|
|
7
|
+
locked: boolean;
|
|
8
|
+
onLockedChange?: (locked: boolean) => void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LockKeyhole, LockKeyholeOpen } from "lucide-react";
|
|
3
|
+
import { InputGroupButton } from "../../input-group.js";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../tooltip.js";
|
|
5
|
+
function LockToggleButton({ locked, onLockedChange }) {
|
|
6
|
+
const interactive = !!onLockedChange;
|
|
7
|
+
return /*#__PURE__*/ jsx(TooltipProvider, {
|
|
8
|
+
delayDuration: 300,
|
|
9
|
+
children: /*#__PURE__*/ jsxs(Tooltip, {
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
12
|
+
asChild: true,
|
|
13
|
+
children: /*#__PURE__*/ jsx(InputGroupButton, {
|
|
14
|
+
icon: true,
|
|
15
|
+
size: "3xs",
|
|
16
|
+
disabled: !interactive,
|
|
17
|
+
onClick: ()=>onLockedChange?.(!locked),
|
|
18
|
+
"aria-label": interactive ? locked ? 'Read-only. Click to make editable.' : 'Editable. Click to make read-only.' : locked ? 'Read-only' : 'Editable',
|
|
19
|
+
children: locked ? /*#__PURE__*/ jsx(LockKeyhole, {
|
|
20
|
+
size: 16
|
|
21
|
+
}) : /*#__PURE__*/ jsx(LockKeyholeOpen, {
|
|
22
|
+
size: 16
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
27
|
+
children: locked ? 'Read-only' : 'Editable'
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { LockToggleButton };
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
ModeMenuItem: ()=>ModeMenuItem
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_dropdown_menu_cjs_namespaceObject = require("../../dropdown-menu.cjs");
|
|
31
|
+
const index_cjs_namespaceObject = require("../../../../lib/index.cjs");
|
|
32
|
+
function ModeMenuItem({ icon: Icon, label, description, active, onClick }) {
|
|
33
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuItem, {
|
|
34
|
+
className: "flex-col items-start gap-0.5 py-2",
|
|
35
|
+
onClick: onClick,
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
38
|
+
className: "flex items-center gap-2",
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
|
|
41
|
+
size: 13,
|
|
42
|
+
className: active ? 'text-brand' : 'text-foreground-muted'
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
45
|
+
className: (0, index_cjs_namespaceObject.cn)('text-xs font-medium', active ? 'text-brand' : 'text-foreground'),
|
|
46
|
+
children: label
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
51
|
+
className: "pl-6 text-[11px] leading-4 text-foreground-subtle",
|
|
52
|
+
children: description
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
exports.ModeMenuItem = __webpack_exports__.ModeMenuItem;
|
|
58
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
59
|
+
"ModeMenuItem"
|
|
60
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
61
|
+
Object.defineProperty(exports, '__esModule', {
|
|
62
|
+
value: true
|
|
63
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react';
|
|
2
|
+
/** One entry in the Fixed/Expression value-type dropdown. */
|
|
3
|
+
export declare function ModeMenuItem({ icon: Icon, label, description, active, onClick, }: {
|
|
4
|
+
icon: LucideIcon;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
active: boolean;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DropdownMenuItem } from "../../dropdown-menu.js";
|
|
3
|
+
import { cn } from "../../../../lib/index.js";
|
|
4
|
+
function ModeMenuItem({ icon: Icon, label, description, active, onClick }) {
|
|
5
|
+
return /*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
6
|
+
className: "flex-col items-start gap-0.5 py-2",
|
|
7
|
+
onClick: onClick,
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsxs("div", {
|
|
10
|
+
className: "flex items-center gap-2",
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx(Icon, {
|
|
13
|
+
size: 13,
|
|
14
|
+
className: active ? 'text-brand' : 'text-foreground-muted'
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx("span", {
|
|
17
|
+
className: cn('text-xs font-medium', active ? 'text-brand' : 'text-foreground'),
|
|
18
|
+
children: label
|
|
19
|
+
})
|
|
20
|
+
]
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ jsx("span", {
|
|
23
|
+
className: "pl-6 text-[11px] leading-4 text-foreground-subtle",
|
|
24
|
+
children: description
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { ModeMenuItem };
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
LockableValueField: ()=>external_lockable_value_field_cjs_namespaceObject.LockableValueField,
|
|
28
|
+
FIELD_TYPE_ORDER: ()=>external_types_cjs_namespaceObject.FIELD_TYPE_ORDER,
|
|
29
|
+
FIELD_TYPE_META: ()=>external_types_cjs_namespaceObject.FIELD_TYPE_META
|
|
30
|
+
});
|
|
31
|
+
const external_lockable_value_field_cjs_namespaceObject = require("./lockable-value-field.cjs");
|
|
32
|
+
const external_types_cjs_namespaceObject = require("./types.cjs");
|
|
33
|
+
exports.FIELD_TYPE_META = __webpack_exports__.FIELD_TYPE_META;
|
|
34
|
+
exports.FIELD_TYPE_ORDER = __webpack_exports__.FIELD_TYPE_ORDER;
|
|
35
|
+
exports.LockableValueField = __webpack_exports__.LockableValueField;
|
|
36
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
37
|
+
"FIELD_TYPE_META",
|
|
38
|
+
"FIELD_TYPE_ORDER",
|
|
39
|
+
"LockableValueField"
|
|
40
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
41
|
+
Object.defineProperty(exports, '__esModule', {
|
|
42
|
+
value: true
|
|
43
|
+
});
|