@uipath/apollo-wind 2.87.0 → 2.89.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/connection-picker/components/connection-actions-menu.cjs +129 -0
- package/dist/components/ui/connection-picker/components/connection-actions-menu.d.ts +21 -0
- package/dist/components/ui/connection-picker/components/connection-actions-menu.js +95 -0
- package/dist/components/ui/connection-picker/components/connection-status.cjs +81 -0
- package/dist/components/ui/connection-picker/components/connection-status.d.ts +22 -0
- package/dist/components/ui/connection-picker/components/connection-status.js +41 -0
- package/dist/components/ui/connection-picker/connection-picker.cjs +411 -0
- package/dist/components/ui/connection-picker/connection-picker.d.ts +12 -0
- package/dist/components/ui/connection-picker/connection-picker.js +374 -0
- package/dist/components/ui/connection-picker/index.cjs +39 -0
- package/dist/components/ui/connection-picker/index.d.ts +2 -0
- package/dist/components/ui/connection-picker/index.js +2 -0
- package/dist/components/ui/connection-picker/types.cjs +18 -0
- package/dist/components/ui/connection-picker/types.d.ts +124 -0
- package/dist/components/ui/connection-picker/types.js +0 -0
- package/dist/components/ui/field-actions/ai-assist-action.cjs +32 -8
- package/dist/components/ui/field-actions/ai-assist-action.d.ts +25 -2
- package/dist/components/ui/field-actions/ai-assist-action.js +33 -9
- package/dist/components/ui/field-actions/collapse.cjs +7 -3
- package/dist/components/ui/field-actions/collapse.d.ts +2 -0
- package/dist/components/ui/field-actions/collapse.js +3 -2
- package/dist/components/ui/field-actions/insert-variable-action.d.ts +4 -1
- package/dist/components/ui/folder-picker/folder-picker.cjs +4 -3
- package/dist/components/ui/folder-picker/folder-picker.js +4 -3
- package/dist/components/ui/index.cjs +254 -228
- package/dist/components/ui/index.d.ts +3 -1
- package/dist/components/ui/index.js +2 -0
- package/dist/components/ui/input-group.cjs +57 -5
- package/dist/components/ui/input-group.d.ts +2 -0
- package/dist/components/ui/input-group.js +58 -6
- package/dist/components/ui/{folder-picker/components/folder-picker-empty-state.cjs → picker-empty-state.cjs} +11 -11
- package/dist/components/ui/picker-empty-state.d.ts +33 -0
- package/dist/components/ui/{folder-picker/components/folder-picker-empty-state.js → picker-empty-state.js} +9 -9
- package/dist/components/ui/prompt-editor/components/TokenPill.cjs +1 -1
- package/dist/components/ui/prompt-editor/components/TokenPill.js +1 -1
- package/dist/components/ui/prompt-editor/types.d.ts +6 -0
- package/dist/components/ui/reference-chip-colors.cjs +6 -0
- package/dist/components/ui/reference-chip-colors.d.ts +14 -0
- package/dist/components/ui/reference-chip-colors.js +6 -0
- package/dist/components/ui/reference-chip.cjs +6 -7
- package/dist/components/ui/reference-chip.d.ts +3 -0
- package/dist/components/ui/reference-chip.js +6 -7
- package/dist/components/ui/resource-picker/command-value.cjs +48 -0
- package/dist/components/ui/resource-picker/command-value.d.ts +11 -0
- package/dist/components/ui/resource-picker/command-value.js +11 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.cjs +102 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.d.ts +44 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.js +65 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.cjs +55 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.d.ts +14 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.js +21 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.cjs +136 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.d.ts +30 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.js +102 -0
- package/dist/components/ui/resource-picker/components/resource-row.cjs +115 -0
- package/dist/components/ui/resource-picker/components/resource-row.d.ts +16 -0
- package/dist/components/ui/resource-picker/components/resource-row.js +81 -0
- package/dist/components/ui/resource-picker/focus.cjs +66 -0
- package/dist/components/ui/resource-picker/focus.d.ts +1 -0
- package/dist/components/ui/resource-picker/focus.js +32 -0
- package/dist/components/ui/resource-picker/index.cjs +42 -0
- package/dist/components/ui/resource-picker/index.d.ts +2 -0
- package/dist/components/ui/resource-picker/index.js +2 -0
- package/dist/components/ui/resource-picker/resource-picker.cjs +606 -0
- package/dist/components/ui/resource-picker/resource-picker.d.ts +40 -0
- package/dist/components/ui/resource-picker/resource-picker.js +566 -0
- package/dist/components/ui/resource-picker/types.cjs +50 -0
- package/dist/components/ui/resource-picker/types.d.ts +209 -0
- package/dist/components/ui/resource-picker/types.js +16 -0
- package/dist/components/ui/variable-picker/variable-picker.cjs +1 -1
- package/dist/components/ui/variable-picker/variable-picker.d.ts +2 -1
- package/dist/components/ui/variable-picker/variable-picker.js +1 -1
- package/dist/components/ui/variable-value-control.d.ts +5 -2
- package/dist/index.cjs +24 -7
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -1
- package/dist/styles.css +179 -39
- package/package.json +1 -1
- package/dist/components/ui/folder-picker/components/folder-picker-empty-state.d.ts +0 -26
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
DEFAULT_CONNECTION_PICKER_STRINGS: ()=>DEFAULT_CONNECTION_PICKER_STRINGS,
|
|
29
|
+
ConnectionPicker: ()=>ConnectionPicker
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
33
|
+
const external_react_namespaceObject = require("react");
|
|
34
|
+
const external_button_cjs_namespaceObject = require("../button.cjs");
|
|
35
|
+
const external_form_field_cjs_namespaceObject = require("../form-field.cjs");
|
|
36
|
+
const external_input_group_cjs_namespaceObject = require("../input-group.cjs");
|
|
37
|
+
const external_input_group_context_cjs_namespaceObject = require("../input-group-context.cjs");
|
|
38
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
39
|
+
const resource_picker_cjs_namespaceObject = require("../resource-picker/resource-picker.cjs");
|
|
40
|
+
const connection_actions_menu_cjs_namespaceObject = require("./components/connection-actions-menu.cjs");
|
|
41
|
+
const connection_status_cjs_namespaceObject = require("./components/connection-status.cjs");
|
|
42
|
+
const DEFAULT_CONNECTION_PICKER_STRINGS = {
|
|
43
|
+
statusLabels: connection_status_cjs_namespaceObject.STATUS_LABELS,
|
|
44
|
+
defaultReasons: {
|
|
45
|
+
broken: 'Connection broken. Reconnect to restore access.',
|
|
46
|
+
warning: 'Connection needs attention.'
|
|
47
|
+
},
|
|
48
|
+
fix: 'Fix',
|
|
49
|
+
fixLabel: (name)=>`Fix ${name}`,
|
|
50
|
+
edit: 'Edit',
|
|
51
|
+
editLabel: (name)=>`Edit ${name}`,
|
|
52
|
+
addNewConnection: 'Add new connection',
|
|
53
|
+
listLabel: 'Connections',
|
|
54
|
+
optionsLabel: 'Connection options',
|
|
55
|
+
editConnection: 'Edit connection',
|
|
56
|
+
refreshSchema: 'Refresh schema',
|
|
57
|
+
refreshingSchema: 'Refreshing schema...',
|
|
58
|
+
schemaRefreshed: 'Schema refreshed',
|
|
59
|
+
noMatchText: (query)=>`No results match “${query}”.`,
|
|
60
|
+
collapsedGroupLabel: (label)=>`${label}, collapsed`,
|
|
61
|
+
expandedGroupLabel: (label)=>`${label}, expanded`,
|
|
62
|
+
actionsMenuLabel: (label)=>`Actions for ${label}`
|
|
63
|
+
};
|
|
64
|
+
const statusOf = (connection)=>connection.status ?? 'connected';
|
|
65
|
+
const headlineOf = (reason)=>reason.split(/(?<=\.)\s+/)[0]?.replace(/\.$/, '') ?? '';
|
|
66
|
+
const statusLabelOf = (connection, labels)=>{
|
|
67
|
+
const status = statusOf(connection);
|
|
68
|
+
return 'warning' === status && connection.statusReason ? headlineOf(connection.statusReason) : labels[status];
|
|
69
|
+
};
|
|
70
|
+
const displayName = (connection)=>connection.account || connection.name;
|
|
71
|
+
const distinguishingName = (connection, collisions)=>connection.account && connection.account !== connection.name && collisions.has(displayName(connection)) ? connection.name : void 0;
|
|
72
|
+
const byHealth = (a, b)=>('broken' === statusOf(a) ? 1 : 0) - ('broken' === statusOf(b) ? 1 : 0);
|
|
73
|
+
function ConnectionPickerField({ connections, value = '', onSelect, onClear, onFix, onEdit, onAddConnection, onRefreshSchema, error, errorId, defaultFolder = 'My Workspace', addConnectionLabel = 'Add connection', placeholder = 'Select connection...', searchPlaceholder = 'Search connections...', emptyText = 'No connections yet.', strings, disabled: disabledProp = false, open: controlledOpen, onOpenChange, className, id, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-errormessage': ariaErrorMessage, ...pickerProps }, forwardedRef) {
|
|
74
|
+
const enclosing = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
|
|
75
|
+
const disabled = disabledProp || Boolean(enclosing.disabled);
|
|
76
|
+
const groupContext = disabled ? external_input_group_context_cjs_namespaceObject.NO_GROUP_DISABLED : external_input_group_context_cjs_namespaceObject.NO_GROUP;
|
|
77
|
+
const messageId = (0, external_react_namespaceObject.useId)();
|
|
78
|
+
const healthId = (0, external_react_namespaceObject.useId)();
|
|
79
|
+
const addTextId = (0, external_react_namespaceObject.useId)();
|
|
80
|
+
const loadErrorId = (0, external_react_namespaceObject.useId)();
|
|
81
|
+
const text = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
82
|
+
...DEFAULT_CONNECTION_PICKER_STRINGS,
|
|
83
|
+
...strings
|
|
84
|
+
}), [
|
|
85
|
+
strings
|
|
86
|
+
]);
|
|
87
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
88
|
+
const open = controlledOpen ?? uncontrolledOpen;
|
|
89
|
+
const setOpen = (nextOpen)=>{
|
|
90
|
+
if (void 0 === controlledOpen) setUncontrolledOpen(nextOpen);
|
|
91
|
+
onOpenChange?.(nextOpen);
|
|
92
|
+
};
|
|
93
|
+
const addOnly = 0 === connections.length && Boolean(onAddConnection) && !value && !pickerProps.loading && !pickerProps.loadError;
|
|
94
|
+
const closedByAddOnly = addOnly && open;
|
|
95
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
96
|
+
if (closedByAddOnly) setOpen(false);
|
|
97
|
+
}, [
|
|
98
|
+
closedByAddOnly
|
|
99
|
+
]);
|
|
100
|
+
const focusWithin = (0, external_react_namespaceObject.useRef)(false);
|
|
101
|
+
const trackFocus = {
|
|
102
|
+
onFocus: ()=>{
|
|
103
|
+
focusWithin.current = true;
|
|
104
|
+
},
|
|
105
|
+
onBlur: ()=>{
|
|
106
|
+
focusWithin.current = false;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const fieldRef = (0, external_react_namespaceObject.useRef)(null);
|
|
110
|
+
const fieldControl = ()=>fieldRef.current?.querySelector('[data-slot="input-group-control"]');
|
|
111
|
+
(0, external_react_namespaceObject.useLayoutEffect)(()=>{
|
|
112
|
+
if (!focusWithin.current) return;
|
|
113
|
+
const focusControl = ()=>{
|
|
114
|
+
const control = fieldControl();
|
|
115
|
+
if (!control) return;
|
|
116
|
+
const active = control.getRootNode().activeElement;
|
|
117
|
+
if (!active || active === control.ownerDocument.body) control.focus();
|
|
118
|
+
};
|
|
119
|
+
focusControl();
|
|
120
|
+
const settle = window.setTimeout(focusControl, 0);
|
|
121
|
+
return ()=>window.clearTimeout(settle);
|
|
122
|
+
}, [
|
|
123
|
+
addOnly
|
|
124
|
+
]);
|
|
125
|
+
const byId = (0, external_react_namespaceObject.useMemo)(()=>new Map(connections.map((connection)=>[
|
|
126
|
+
connection.id,
|
|
127
|
+
connection
|
|
128
|
+
])), [
|
|
129
|
+
connections
|
|
130
|
+
]);
|
|
131
|
+
const collisions = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
132
|
+
const seen = new Set();
|
|
133
|
+
const shared = new Set();
|
|
134
|
+
for (const connection of connections){
|
|
135
|
+
const name = displayName(connection);
|
|
136
|
+
if (seen.has(name)) shared.add(name);
|
|
137
|
+
else seen.add(name);
|
|
138
|
+
}
|
|
139
|
+
return shared;
|
|
140
|
+
}, [
|
|
141
|
+
connections
|
|
142
|
+
]);
|
|
143
|
+
const fullName = (0, external_react_namespaceObject.useCallback)((connection)=>{
|
|
144
|
+
const secondary = distinguishingName(connection, collisions);
|
|
145
|
+
return secondary ? `${displayName(connection)} (${secondary})` : displayName(connection);
|
|
146
|
+
}, [
|
|
147
|
+
collisions
|
|
148
|
+
]);
|
|
149
|
+
const groups = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
150
|
+
const folders = new Map();
|
|
151
|
+
for (const connection of connections){
|
|
152
|
+
const folder = connection.folder || defaultFolder;
|
|
153
|
+
const members = folders.get(folder);
|
|
154
|
+
if (members) members.push(connection);
|
|
155
|
+
else folders.set(folder, [
|
|
156
|
+
connection
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
return [
|
|
160
|
+
...folders
|
|
161
|
+
].map(([folder, members])=>({
|
|
162
|
+
id: folder,
|
|
163
|
+
label: folder,
|
|
164
|
+
items: [
|
|
165
|
+
...members
|
|
166
|
+
].sort(byHealth).map((connection)=>({
|
|
167
|
+
id: connection.id,
|
|
168
|
+
label: displayName(connection),
|
|
169
|
+
description: distinguishingName(connection, collisions),
|
|
170
|
+
fieldLabel: fullName(connection),
|
|
171
|
+
icon: connection.logo ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
172
|
+
src: connection.logo,
|
|
173
|
+
alt: "",
|
|
174
|
+
className: "size-4 object-contain"
|
|
175
|
+
}) : connection.icon,
|
|
176
|
+
subtitle: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(connection_status_cjs_namespaceObject.ConnectionStatusLine, {
|
|
177
|
+
status: statusOf(connection),
|
|
178
|
+
label: statusLabelOf(connection, text.statusLabels)
|
|
179
|
+
}),
|
|
180
|
+
subtitleText: statusLabelOf(connection, text.statusLabels),
|
|
181
|
+
keywords: [
|
|
182
|
+
connection.name,
|
|
183
|
+
...connection.keywords ?? []
|
|
184
|
+
],
|
|
185
|
+
disabled: connection.disabled
|
|
186
|
+
}))
|
|
187
|
+
}));
|
|
188
|
+
}, [
|
|
189
|
+
connections,
|
|
190
|
+
defaultFolder,
|
|
191
|
+
text.statusLabels,
|
|
192
|
+
collisions,
|
|
193
|
+
fullName
|
|
194
|
+
]);
|
|
195
|
+
const selected = value ? byId.get(value) : void 0;
|
|
196
|
+
const selectedStatus = selected ? statusOf(selected) : void 0;
|
|
197
|
+
const unhealthy = 'broken' === selectedStatus || 'warning' === selectedStatus;
|
|
198
|
+
const handOff = (action, connection)=>{
|
|
199
|
+
setOpen(false);
|
|
200
|
+
action(connection);
|
|
201
|
+
};
|
|
202
|
+
const itemActions = onFix || onEdit ? (item)=>{
|
|
203
|
+
const connection = byId.get(item.id);
|
|
204
|
+
if (!connection) return [];
|
|
205
|
+
const name = fullName(connection);
|
|
206
|
+
const actions = [];
|
|
207
|
+
if (onFix && 'broken' === statusOf(connection)) actions.push({
|
|
208
|
+
id: 'fix',
|
|
209
|
+
label: text.fixLabel(name),
|
|
210
|
+
text: text.fix,
|
|
211
|
+
tone: 'danger',
|
|
212
|
+
onSelect: ()=>handOff(onFix, connection)
|
|
213
|
+
});
|
|
214
|
+
if (onEdit) actions.push({
|
|
215
|
+
id: 'edit',
|
|
216
|
+
label: text.editLabel(name),
|
|
217
|
+
text: text.edit,
|
|
218
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Pencil, {
|
|
219
|
+
className: "size-3.5"
|
|
220
|
+
}),
|
|
221
|
+
onSelect: ()=>handOff(onEdit, connection)
|
|
222
|
+
});
|
|
223
|
+
return actions;
|
|
224
|
+
} : void 0;
|
|
225
|
+
const reason = selected && unhealthy ? selected.statusReason || text.defaultReasons[selectedStatus] : '';
|
|
226
|
+
const summary = headlineOf(reason);
|
|
227
|
+
const { loadError, onRetry, retryLabel = 'Retry' } = pickerProps;
|
|
228
|
+
const showLoadError = !error && Boolean(loadError);
|
|
229
|
+
const showHealth = !error && !showLoadError && Boolean(summary);
|
|
230
|
+
const broken = 'broken' === selectedStatus;
|
|
231
|
+
const describedBy = [
|
|
232
|
+
ariaDescribedBy,
|
|
233
|
+
selectedStatus ? healthId : void 0,
|
|
234
|
+
showHealth ? messageId : void 0,
|
|
235
|
+
showLoadError ? loadErrorId : void 0
|
|
236
|
+
].filter(Boolean).join(' ') || void 0;
|
|
237
|
+
const fieldProps = {
|
|
238
|
+
id,
|
|
239
|
+
'aria-labelledby': ariaLabelledBy,
|
|
240
|
+
'aria-describedby': describedBy
|
|
241
|
+
};
|
|
242
|
+
if (addOnly) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
|
|
243
|
+
value: groupContext,
|
|
244
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
245
|
+
ref: fieldRef,
|
|
246
|
+
className: (0, index_cjs_namespaceObject.cn)('min-w-0', className),
|
|
247
|
+
...trackFocus,
|
|
248
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
249
|
+
error: error,
|
|
250
|
+
errorId: errorId ?? messageId,
|
|
251
|
+
children: [
|
|
252
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
253
|
+
align: "inline-start",
|
|
254
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Plus, {
|
|
255
|
+
"aria-hidden": true,
|
|
256
|
+
className: "text-foreground-muted"
|
|
257
|
+
})
|
|
258
|
+
}),
|
|
259
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupTrigger, {
|
|
260
|
+
ref: forwardedRef,
|
|
261
|
+
...fieldProps,
|
|
262
|
+
"aria-labelledby": ariaLabelledBy ? `${ariaLabelledBy} ${addTextId}` : id ? `${id} ${addTextId}` : void 0,
|
|
263
|
+
"aria-invalid": ariaInvalid,
|
|
264
|
+
"aria-errormessage": ariaErrorMessage,
|
|
265
|
+
disabled: disabled,
|
|
266
|
+
onClick: onAddConnection,
|
|
267
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
268
|
+
id: addTextId,
|
|
269
|
+
className: "min-w-0 flex-1 truncate text-foreground-subtle",
|
|
270
|
+
children: addConnectionLabel
|
|
271
|
+
})
|
|
272
|
+
})
|
|
273
|
+
]
|
|
274
|
+
})
|
|
275
|
+
})
|
|
276
|
+
});
|
|
277
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
|
|
278
|
+
value: groupContext,
|
|
279
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
280
|
+
ref: fieldRef,
|
|
281
|
+
className: (0, index_cjs_namespaceObject.cn)('min-w-0', className),
|
|
282
|
+
...trackFocus,
|
|
283
|
+
children: [
|
|
284
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(resource_picker_cjs_namespaceObject.ResourcePicker, {
|
|
285
|
+
ref: forwardedRef,
|
|
286
|
+
...pickerProps,
|
|
287
|
+
...fieldProps,
|
|
288
|
+
"aria-invalid": broken && !error ? true : ariaInvalid,
|
|
289
|
+
"aria-errormessage": broken && showHealth ? messageId : ariaErrorMessage,
|
|
290
|
+
error: error,
|
|
291
|
+
errorId: errorId,
|
|
292
|
+
warning: 'warning' === selectedStatus,
|
|
293
|
+
groups: groups,
|
|
294
|
+
value: value,
|
|
295
|
+
onSelect: (item)=>{
|
|
296
|
+
const connection = byId.get(item.id);
|
|
297
|
+
if (connection) onSelect(connection);
|
|
298
|
+
},
|
|
299
|
+
onClear: onClear,
|
|
300
|
+
placeholder: value && !selected ? value : placeholder,
|
|
301
|
+
searchPlaceholder: searchPlaceholder,
|
|
302
|
+
emptyText: emptyText,
|
|
303
|
+
listLabel: text.listLabel,
|
|
304
|
+
noMatchText: text.noMatchText,
|
|
305
|
+
collapsedGroupLabel: text.collapsedGroupLabel,
|
|
306
|
+
expandedGroupLabel: text.expandedGroupLabel,
|
|
307
|
+
actionsMenuLabel: text.actionsMenuLabel,
|
|
308
|
+
disabled: disabled,
|
|
309
|
+
open: open,
|
|
310
|
+
onOpenChange: setOpen,
|
|
311
|
+
icon: selectedStatus ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(connection_status_cjs_namespaceObject.ConnectionStatusDot, {
|
|
312
|
+
status: selectedStatus,
|
|
313
|
+
label: text.statusLabels[selectedStatus]
|
|
314
|
+
}) : void 0,
|
|
315
|
+
itemActions: itemActions,
|
|
316
|
+
trailingAdornment: selected && (onRefreshSchema || onEdit) && !disabled ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(connection_actions_menu_cjs_namespaceObject.ConnectionActionsMenu, {
|
|
317
|
+
onRefreshSchema: onRefreshSchema ? ()=>onRefreshSchema(selected) : void 0,
|
|
318
|
+
onEdit: onEdit ? ()=>onEdit(selected) : void 0,
|
|
319
|
+
strings: text
|
|
320
|
+
}, selected.id) : void 0,
|
|
321
|
+
footerLeading: onAddConnection ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
|
|
322
|
+
variant: "ghost",
|
|
323
|
+
size: "2xs",
|
|
324
|
+
className: "-ml-2 gap-1 font-semibold text-brand hover:text-brand future:text-brand future:hover:text-brand",
|
|
325
|
+
onClick: ()=>{
|
|
326
|
+
if (disabled || !open) return;
|
|
327
|
+
setOpen(false);
|
|
328
|
+
onAddConnection();
|
|
329
|
+
},
|
|
330
|
+
children: [
|
|
331
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Plus, {
|
|
332
|
+
className: "size-3.5"
|
|
333
|
+
}),
|
|
334
|
+
text.addNewConnection
|
|
335
|
+
]
|
|
336
|
+
}) : void 0
|
|
337
|
+
}),
|
|
338
|
+
selectedStatus && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
339
|
+
id: healthId,
|
|
340
|
+
hidden: true,
|
|
341
|
+
children: text.statusLabels[selectedStatus]
|
|
342
|
+
}),
|
|
343
|
+
showLoadError && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
344
|
+
className: "mt-1.5 flex min-w-0 items-baseline gap-1.5",
|
|
345
|
+
children: [
|
|
346
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
347
|
+
id: loadErrorId,
|
|
348
|
+
title: loadError ?? void 0,
|
|
349
|
+
className: "mt-0 min-w-0 truncate",
|
|
350
|
+
children: loadError
|
|
351
|
+
}),
|
|
352
|
+
!disabled && onRetry && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
353
|
+
variant: "text",
|
|
354
|
+
size: "4xs",
|
|
355
|
+
className: "shrink-0 px-0 text-xs",
|
|
356
|
+
onClick: ()=>{
|
|
357
|
+
fieldControl()?.focus();
|
|
358
|
+
onRetry();
|
|
359
|
+
},
|
|
360
|
+
children: retryLabel
|
|
361
|
+
})
|
|
362
|
+
]
|
|
363
|
+
}),
|
|
364
|
+
showHealth && selectedStatus && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
365
|
+
className: "mt-1.5 flex min-w-0 items-baseline gap-1.5",
|
|
366
|
+
children: [
|
|
367
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
368
|
+
id: messageId,
|
|
369
|
+
severity: broken ? 'error' : 'warning',
|
|
370
|
+
title: reason,
|
|
371
|
+
className: "mt-0 min-w-0 truncate",
|
|
372
|
+
children: summary === reason ? summary : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
373
|
+
children: [
|
|
374
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
375
|
+
"aria-hidden": true,
|
|
376
|
+
children: summary
|
|
377
|
+
}),
|
|
378
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
379
|
+
className: "sr-only",
|
|
380
|
+
children: reason
|
|
381
|
+
})
|
|
382
|
+
]
|
|
383
|
+
})
|
|
384
|
+
}),
|
|
385
|
+
!disabled && selected && onFix && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
386
|
+
variant: "text",
|
|
387
|
+
size: "4xs",
|
|
388
|
+
className: "shrink-0 px-0 text-xs",
|
|
389
|
+
onClick: ()=>{
|
|
390
|
+
fieldControl()?.focus();
|
|
391
|
+
onFix(selected);
|
|
392
|
+
},
|
|
393
|
+
children: text.fix
|
|
394
|
+
})
|
|
395
|
+
]
|
|
396
|
+
})
|
|
397
|
+
]
|
|
398
|
+
})
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
const ConnectionPicker = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(ConnectionPickerField);
|
|
402
|
+
ConnectionPicker.displayName = 'ConnectionPicker';
|
|
403
|
+
exports.ConnectionPicker = __webpack_exports__.ConnectionPicker;
|
|
404
|
+
exports.DEFAULT_CONNECTION_PICKER_STRINGS = __webpack_exports__.DEFAULT_CONNECTION_PICKER_STRINGS;
|
|
405
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
406
|
+
"ConnectionPicker",
|
|
407
|
+
"DEFAULT_CONNECTION_PICKER_STRINGS"
|
|
408
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
409
|
+
Object.defineProperty(exports, '__esModule', {
|
|
410
|
+
value: true
|
|
411
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ConnectionPickerProps, ConnectionPickerStrings } from './types';
|
|
2
|
+
export declare const DEFAULT_CONNECTION_PICKER_STRINGS: ConnectionPickerStrings;
|
|
3
|
+
/**
|
|
4
|
+
* Field-and-popover picker over connections.
|
|
5
|
+
*
|
|
6
|
+
* Built on `ResourcePicker`, which owns the search, grouping, keyboard model
|
|
7
|
+
* and footer. What is added here is the part only a connection has: a health
|
|
8
|
+
* that shows on the field and on each row, repair and edit actions, and a
|
|
9
|
+
* message under the field once a chosen connection needs attention.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ConnectionPicker: import("react").ForwardRefExoticComponent<ConnectionPickerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export type { Connection, ConnectionPickerProps, ConnectionPickerStrings, ConnectionStatus, } from './types';
|