@uipath/apollo-wind 2.58.0 → 2.60.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.
Files changed (46) hide show
  1. package/dist/components/ui/datetime-picker.cjs +19 -3
  2. package/dist/components/ui/datetime-picker.d.ts +2 -0
  3. package/dist/components/ui/datetime-picker.js +19 -3
  4. package/dist/components/ui/field-actions/insert-variable-action.cjs +1 -1
  5. package/dist/components/ui/field-actions/insert-variable-action.d.ts +5 -2
  6. package/dist/components/ui/field-actions/insert-variable-action.js +1 -1
  7. package/dist/components/ui/field-addons/field-menu.cjs +2 -2
  8. package/dist/components/ui/field-addons/field-menu.d.ts +4 -2
  9. package/dist/components/ui/field-addons/field-menu.js +2 -2
  10. package/dist/components/ui/index.cjs +295 -217
  11. package/dist/components/ui/index.d.ts +3 -2
  12. package/dist/components/ui/index.js +3 -2
  13. package/dist/components/ui/lockable-value-field/index.cjs +5 -5
  14. package/dist/components/ui/lockable-value-field/index.d.ts +18 -3
  15. package/dist/components/ui/lockable-value-field/index.js +2 -2
  16. package/dist/components/ui/quick-form-field/components/field-header.cjs +265 -0
  17. package/dist/components/ui/quick-form-field/components/field-header.d.ts +23 -0
  18. package/dist/components/ui/quick-form-field/components/field-header.js +231 -0
  19. package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.cjs +3 -3
  20. package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.d.ts +4 -1
  21. package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.js +3 -3
  22. package/dist/components/ui/quick-form-field/index.cjs +46 -0
  23. package/dist/components/ui/quick-form-field/index.d.ts +3 -0
  24. package/dist/components/ui/quick-form-field/index.js +3 -0
  25. package/dist/components/ui/{lockable-value-field/lockable-value-field.cjs → quick-form-field/quick-form-field.cjs} +190 -119
  26. package/dist/components/ui/quick-form-field/quick-form-field.d.ts +26 -0
  27. package/dist/components/ui/{lockable-value-field/lockable-value-field.js → quick-form-field/quick-form-field.js} +194 -123
  28. package/dist/components/ui/{lockable-value-field → quick-form-field}/types.cjs +70 -0
  29. package/dist/components/ui/quick-form-field/types.d.ts +245 -0
  30. package/dist/components/ui/quick-form-field/types.js +137 -0
  31. package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.cjs +21 -3
  32. package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.d.ts +8 -3
  33. package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.js +19 -4
  34. package/dist/components/ui/tree-view.cjs +6 -2
  35. package/dist/components/ui/tree-view.d.ts +35 -21
  36. package/dist/components/ui/tree-view.js +4 -3
  37. package/dist/index.cjs +14 -4
  38. package/dist/index.d.ts +6 -4
  39. package/dist/index.js +4 -3
  40. package/package.json +1 -1
  41. package/dist/components/ui/lockable-value-field/components/field-header.cjs +0 -242
  42. package/dist/components/ui/lockable-value-field/components/field-header.d.ts +0 -19
  43. package/dist/components/ui/lockable-value-field/components/field-header.js +0 -208
  44. package/dist/components/ui/lockable-value-field/lockable-value-field.d.ts +0 -14
  45. package/dist/components/ui/lockable-value-field/types.d.ts +0 -109
  46. package/dist/components/ui/lockable-value-field/types.js +0 -70
@@ -1,208 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { Asterisk, ChevronDown } from "lucide-react";
3
- import { useMemo } from "react";
4
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../dropdown-menu.js";
5
- import { Label, RequiredIndicator } from "../../label.js";
6
- import { Popover, PopoverContent, PopoverTrigger } from "../../popover.js";
7
- import { Switch } from "../../switch.js";
8
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../tooltip.js";
9
- import { cn } from "../../../../lib/index.js";
10
- import { AiAssistAction } from "../../field-actions/ai-assist-action.js";
11
- import { COLLAPSED_HIDDEN, COLLAPSED_ICON_PADDING, COLLAPSED_ONLY } from "../../field-actions/collapse.js";
12
- import { InsertVariableAction } from "../../field-actions/insert-variable-action.js";
13
- import { FIELD_TYPE_META, FIELD_TYPE_ORDER } from "../types.js";
14
- function toVariableTree(variables) {
15
- return [
16
- {
17
- id: 'vars',
18
- label: '$vars',
19
- type: 'object',
20
- children: variables.map((variable)=>({
21
- id: variable.value,
22
- label: variable.label,
23
- value: variable.value,
24
- type: 'string'
25
- }))
26
- }
27
- ];
28
- }
29
- function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, showAiAssist, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
30
- const typeMeta = FIELD_TYPE_META[fieldType];
31
- const variableTree = useMemo(()=>toVariableTree(variables), [
32
- variables
33
- ]);
34
- const collapsedTextClass = cn(COLLAPSED_HIDDEN, compact && '!hidden');
35
- const collapsedPaddingClass = cn(COLLAPSED_ICON_PADDING, compact && '!px-1.5');
36
- const compactOnlyClass = cn(COLLAPSED_ONLY, compact && '!block');
37
- return /*#__PURE__*/ jsxs("div", {
38
- className: "flex items-center gap-1",
39
- children: [
40
- label ?? /*#__PURE__*/ jsxs(Label, {
41
- htmlFor: fieldId,
42
- className: "text-xs font-medium text-foreground",
43
- children: [
44
- fieldLabel,
45
- required && /*#__PURE__*/ jsx(RequiredIndicator, {})
46
- ]
47
- }),
48
- /*#__PURE__*/ jsx(TooltipProvider, {
49
- delayDuration: 300,
50
- children: /*#__PURE__*/ jsxs("div", {
51
- className: "ml-auto flex items-center gap-0.5",
52
- children: [
53
- /*#__PURE__*/ jsxs("div", {
54
- className: "flex items-center gap-0.5",
55
- children: [
56
- onFieldTypeChange && /*#__PURE__*/ jsxs(DropdownMenu, {
57
- children: [
58
- /*#__PURE__*/ jsxs(Tooltip, {
59
- children: [
60
- /*#__PURE__*/ jsx(TooltipTrigger, {
61
- asChild: true,
62
- children: /*#__PURE__*/ jsx(DropdownMenuTrigger, {
63
- asChild: true,
64
- children: /*#__PURE__*/ jsxs("button", {
65
- type: "button",
66
- "aria-label": "Field type",
67
- 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),
68
- children: [
69
- /*#__PURE__*/ jsx(typeMeta.icon, {
70
- size: 12
71
- }),
72
- /*#__PURE__*/ jsx("span", {
73
- className: collapsedTextClass,
74
- children: typeMeta.label
75
- }),
76
- /*#__PURE__*/ jsx(ChevronDown, {
77
- size: 9,
78
- className: collapsedTextClass
79
- })
80
- ]
81
- })
82
- })
83
- }),
84
- /*#__PURE__*/ jsx(TooltipContent, {
85
- children: "Type"
86
- })
87
- ]
88
- }),
89
- /*#__PURE__*/ jsx(DropdownMenuContent, {
90
- align: "end",
91
- className: "w-44",
92
- children: FIELD_TYPE_ORDER.map((type)=>{
93
- const meta = FIELD_TYPE_META[type];
94
- const isActive = type === fieldType;
95
- return /*#__PURE__*/ jsxs(DropdownMenuItem, {
96
- onClick: ()=>onFieldTypeChange(type),
97
- children: [
98
- /*#__PURE__*/ jsx(meta.icon, {
99
- className: isActive ? 'text-brand' : 'text-foreground-muted'
100
- }),
101
- /*#__PURE__*/ jsx("span", {
102
- className: cn(isActive && 'font-medium text-brand'),
103
- children: meta.label
104
- })
105
- ]
106
- }, type);
107
- })
108
- })
109
- ]
110
- }),
111
- onRequiredChange && /*#__PURE__*/ jsxs(Fragment, {
112
- children: [
113
- /*#__PURE__*/ jsx("div", {
114
- className: collapsedTextClass,
115
- children: /*#__PURE__*/ jsxs(Tooltip, {
116
- children: [
117
- /*#__PURE__*/ jsx(TooltipTrigger, {
118
- asChild: true,
119
- children: /*#__PURE__*/ jsx("span", {
120
- className: "inline-flex",
121
- children: /*#__PURE__*/ jsx(Switch, {
122
- size: "sm",
123
- checked: !!required,
124
- onCheckedChange: onRequiredChange,
125
- className: "data-[state=checked]:bg-brand data-[state=unchecked]:bg-foreground-subtle",
126
- "aria-label": required ? 'Required field' : 'Optional field'
127
- })
128
- })
129
- }),
130
- /*#__PURE__*/ jsx(TooltipContent, {
131
- children: "Required"
132
- })
133
- ]
134
- })
135
- }),
136
- /*#__PURE__*/ jsx("div", {
137
- className: compactOnlyClass,
138
- children: /*#__PURE__*/ jsxs(Popover, {
139
- children: [
140
- /*#__PURE__*/ jsxs(Tooltip, {
141
- children: [
142
- /*#__PURE__*/ jsx(TooltipTrigger, {
143
- asChild: true,
144
- children: /*#__PURE__*/ jsx(PopoverTrigger, {
145
- asChild: true,
146
- children: /*#__PURE__*/ jsx("button", {
147
- type: "button",
148
- "aria-label": required ? 'Required field' : 'Optional field',
149
- className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
150
- children: /*#__PURE__*/ jsx(Asterisk, {
151
- size: 12
152
- })
153
- })
154
- })
155
- }),
156
- /*#__PURE__*/ jsx(TooltipContent, {
157
- children: "Required"
158
- })
159
- ]
160
- }),
161
- /*#__PURE__*/ jsx(PopoverContent, {
162
- align: "end",
163
- className: "w-48",
164
- children: /*#__PURE__*/ jsxs("div", {
165
- className: "flex items-center justify-between gap-3",
166
- children: [
167
- /*#__PURE__*/ jsx("span", {
168
- className: "text-xs font-medium text-foreground",
169
- children: "Required"
170
- }),
171
- /*#__PURE__*/ jsx(Switch, {
172
- size: "sm",
173
- checked: !!required,
174
- onCheckedChange: onRequiredChange,
175
- className: "data-[state=checked]:bg-brand data-[state=unchecked]:bg-foreground-subtle",
176
- "aria-label": required ? 'Required field' : 'Optional field'
177
- })
178
- ]
179
- })
180
- })
181
- ]
182
- })
183
- })
184
- ]
185
- }),
186
- showFieldActions && /*#__PURE__*/ jsxs(Fragment, {
187
- children: [
188
- showAiAssist && /*#__PURE__*/ jsx(AiAssistAction, {
189
- onGenerate: onGenerateWithAi,
190
- hint: `Output: ${typeMeta.label}${typeMeta.supportsExpression ? ' expression' : ' value'}`
191
- }),
192
- /*#__PURE__*/ jsx(InsertVariableAction, {
193
- variables: variableTree,
194
- compact: compact,
195
- onInsert: onValueChange && ((variable)=>onValueChange(value ? `${value} ${variable}` : variable))
196
- })
197
- ]
198
- })
199
- ]
200
- }),
201
- headerActions
202
- ]
203
- })
204
- })
205
- ]
206
- });
207
- }
208
- export { FieldHeader };
@@ -1,14 +0,0 @@
1
- import type { LockableValueFieldProps } from './types';
2
- /**
3
- * LockableValueField — a field that can be locked to read-only, typed as one
4
- * of several data types, and (for scalar types) switched between a literal
5
- * value and a JS expression.
6
- *
7
- * The expression mode is styled as code (monospace) but does not carry real
8
- * syntax highlighting or evaluation. Select/multiselect options default to a
9
- * small demo set unless `options` is provided. The built-in AI-assist
10
- * "Generate" button is a no-op unless `onGenerateWithAi` is provided; the
11
- * Insert-variable menu is empty (and disabled) unless `variables` is
12
- * provided; file uploads aren't persisted anywhere.
13
- */
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,109 +0,0 @@
1
- import { type LucideIcon } from 'lucide-react';
2
- import type { AriaAttributes, ReactNode } from 'react';
3
- export type LockableValueFieldMode = 'fixed' | 'expression';
4
- export type LockableFieldType = 'string' | 'integer' | 'date' | 'boolean' | 'single-select' | 'multi-select' | 'file' | 'object';
5
- interface FieldTypeMeta {
6
- label: string;
7
- icon: LucideIcon;
8
- supportsExpression: boolean;
9
- fixedLabel: string;
10
- fixedDescription: string;
11
- }
12
- export declare const FIELD_TYPE_META: Record<LockableFieldType, FieldTypeMeta>;
13
- export declare const FIELD_TYPE_ORDER: LockableFieldType[];
14
- export interface LockableValueFieldOption {
15
- label: string;
16
- value: string;
17
- }
18
- export interface LockableValueFieldMoreActions {
19
- onClear?: () => void;
20
- onRefresh?: () => void;
21
- }
22
- export interface LockableValueFieldProps {
23
- /** Current field value. Encoding depends on fieldType (e.g. multi-select is a JSON array string). */
24
- value?: string;
25
- /** Called when the user edits the value (only fires while unlocked). */
26
- onValueChange?: (value: string) => void;
27
- /** Called when the active value control loses focus. */
28
- onValueBlur?: () => void;
29
- /** Whether the field is read-only. Defaults to true. */
30
- locked?: boolean;
31
- /** Called when the user toggles the lock. */
32
- onLockedChange?: (locked: boolean) => void;
33
- /** Whether the built-in lock control renders. Defaults to true. */
34
- showLock?: boolean;
35
- /**
36
- * Replaces the leading lock toggle with a semantic prefix such as `=`.
37
- * Pass `null` to suppress the built-in toggle; omitting the prop preserves it.
38
- */
39
- leadingAddon?: ReactNode;
40
- /**
41
- * Replaces the trailing fixed/expression menu with a consumer-provided action
42
- * for expression-capable field types. Pass `null` to suppress the built-in
43
- * menu; omitting the prop preserves it.
44
- */
45
- trailingAddon?: ReactNode;
46
- /** Adds a field-level overflow menu beside the value control. */
47
- more?: LockableValueFieldMoreActions;
48
- /** Fixed value vs. JS expression. Defaults to 'fixed'. Ignored for types that don't support expressions. */
49
- mode?: LockableValueFieldMode;
50
- /** Called when the user switches modes. */
51
- onModeChange?: (mode: LockableValueFieldMode) => void;
52
- /**
53
- * Optional expression editor used in place of the built-in monospace input.
54
- * Consumers can use this to supply a syntax-aware editor such as Monaco.
55
- */
56
- renderExpressionEditor?: (props: {
57
- id: string;
58
- value: string;
59
- onValueChange?: (value: string) => void;
60
- onBlur?: () => void;
61
- readOnly: boolean;
62
- placeholder: string;
63
- fieldType: LockableFieldType;
64
- 'aria-invalid'?: AriaAttributes['aria-invalid'];
65
- 'aria-describedby'?: string;
66
- 'aria-errormessage'?: string;
67
- 'data-slot'?: string;
68
- }) => ReactNode;
69
- /** The field's data type. Defaults to 'string'. Determines which control renders the value. */
70
- fieldType?: LockableFieldType;
71
- /** Called when the user switches the field type. */
72
- onFieldTypeChange?: (fieldType: LockableFieldType) => void;
73
- /** Shows a required-field asterisk next to the default label. Ignored when `label` is provided. */
74
- required?: boolean;
75
- /** Called when the user toggles required/optional. Renders the Required switch when provided. */
76
- onRequiredChange?: (required: boolean) => void;
77
- /** Overrides the default mode-based label (e.g. a field name instead of "String value"). */
78
- label?: ReactNode;
79
- /** Field-specific validation feedback rendered immediately below the active control. */
80
- error?: ReactNode;
81
- /** Optional id for the inline validation message. */
82
- errorId?: string;
83
- /** Content rendered below the value control, such as a related checkbox or help text. */
84
- belowValue?: ReactNode;
85
- /** Accessible name for the file-upload dropzone. Defaults to a string `label`, then the computed field label. */
86
- fileUploadAriaLabel?: string;
87
- /** Extra content rendered after the built-in AI assist / Insert variable buttons (e.g. a delete button). */
88
- headerActions?: ReactNode;
89
- /** Forces the header row into its narrow-container icon-only layout, regardless of actual width. For demos/comparisons. */
90
- compact?: boolean;
91
- /** @deprecated Controls are always visible. Retained as a no-op for backwards compatibility. */
92
- controlsVisibility?: 'visible' | 'hover';
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. */
94
- showFieldActions?: boolean;
95
- /** Whether the Generate with AI action renders. Defaults to true. */
96
- showAiAssist?: boolean;
97
- /** Options for 'single-select' / 'multi-select' field types. Defaults to a small set of demo options. */
98
- options?: LockableValueFieldOption[];
99
- /** Called with the entered prompt when the user clicks Generate in the AI-assist popover. */
100
- onGenerateWithAi?: (prompt: string) => void;
101
- /**
102
- * Variables offered by the "Insert variable" popover; clicking one appends its value to the
103
- * current value. The button is disabled when this is empty (the default).
104
- */
105
- variables?: LockableValueFieldOption[];
106
- id?: string;
107
- className?: string;
108
- }
109
- export {};
@@ -1,70 +0,0 @@
1
- import { ALargeSmall, Braces, Calendar, File, Hash, List, ListChecks, ToggleLeft } from "lucide-react";
2
- const FIELD_TYPE_META = {
3
- string: {
4
- label: 'String',
5
- icon: ALargeSmall,
6
- supportsExpression: true,
7
- fixedLabel: 'Fixed value',
8
- fixedDescription: 'Use a literal string value'
9
- },
10
- integer: {
11
- label: 'Integer',
12
- icon: Hash,
13
- supportsExpression: true,
14
- fixedLabel: 'Fixed value',
15
- fixedDescription: 'Use a literal number value'
16
- },
17
- date: {
18
- label: 'Date',
19
- icon: Calendar,
20
- supportsExpression: true,
21
- fixedLabel: 'Fixed date',
22
- fixedDescription: 'Use a literal date value'
23
- },
24
- boolean: {
25
- label: 'Boolean',
26
- icon: ToggleLeft,
27
- supportsExpression: true,
28
- fixedLabel: 'Fixed value',
29
- fixedDescription: 'Use a literal true or false value'
30
- },
31
- 'single-select': {
32
- label: 'Single select',
33
- icon: List,
34
- supportsExpression: false,
35
- fixedLabel: 'Fixed value',
36
- fixedDescription: 'Choose one option'
37
- },
38
- 'multi-select': {
39
- label: 'Multi select',
40
- icon: ListChecks,
41
- supportsExpression: false,
42
- fixedLabel: 'Fixed value',
43
- fixedDescription: 'Choose one or more options'
44
- },
45
- file: {
46
- label: 'File',
47
- icon: File,
48
- supportsExpression: true,
49
- fixedLabel: 'Fixed value',
50
- fixedDescription: 'Upload a file'
51
- },
52
- object: {
53
- label: 'Object',
54
- icon: Braces,
55
- supportsExpression: true,
56
- fixedLabel: 'Fixed value',
57
- fixedDescription: 'Use a literal object value'
58
- }
59
- };
60
- const FIELD_TYPE_ORDER = [
61
- 'string',
62
- 'integer',
63
- 'date',
64
- 'boolean',
65
- 'single-select',
66
- 'multi-select',
67
- 'file',
68
- 'object'
69
- ];
70
- export { FIELD_TYPE_META, FIELD_TYPE_ORDER };