@uipath/apollo-react 6.45.3 → 6.46.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/canvas/components/Guardrails/builder-types.cjs +47 -0
- package/dist/canvas/components/Guardrails/builder-types.d.ts +129 -0
- package/dist/canvas/components/Guardrails/builder-types.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/builder-types.js +10 -0
- package/dist/canvas/components/Guardrails/builder-utils.cjs +144 -0
- package/dist/canvas/components/Guardrails/builder-utils.d.ts +18 -0
- package/dist/canvas/components/Guardrails/builder-utils.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/builder-utils.js +98 -0
- package/dist/canvas/components/Guardrails/components/enum-list-chips-field.cjs +85 -0
- package/dist/canvas/components/Guardrails/components/enum-list-chips-field.d.ts +3 -0
- package/dist/canvas/components/Guardrails/components/enum-list-chips-field.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/enum-list-chips-field.js +51 -0
- package/dist/canvas/components/Guardrails/components/escalate-action-fields.cjs +268 -0
- package/dist/canvas/components/Guardrails/components/escalate-action-fields.d.ts +23 -0
- package/dist/canvas/components/Guardrails/components/escalate-action-fields.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/escalate-action-fields.js +234 -0
- package/dist/canvas/components/Guardrails/components/field-shell.cjs +46 -0
- package/dist/canvas/components/Guardrails/components/field-shell.d.ts +7 -0
- package/dist/canvas/components/Guardrails/components/field-shell.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/field-shell.js +12 -0
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.cjs +173 -0
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts +22 -0
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.js +139 -0
- package/dist/canvas/components/Guardrails/components/guardrail-chip.cjs +63 -0
- package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts +11 -0
- package/dist/canvas/components/Guardrails/components/guardrail-chip.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-chip.js +26 -0
- package/dist/canvas/components/Guardrails/components/guardrail-scope-selector.cjs +217 -0
- package/dist/canvas/components/Guardrails/components/guardrail-scope-selector.d.ts +15 -0
- package/dist/canvas/components/Guardrails/components/guardrail-scope-selector.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-scope-selector.js +183 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.cjs +61 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.d.ts +6 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/guardrail-status-banner.js +27 -0
- package/dist/canvas/components/Guardrails/components/map-enum-field.cjs +116 -0
- package/dist/canvas/components/Guardrails/components/map-enum-field.d.ts +3 -0
- package/dist/canvas/components/Guardrails/components/map-enum-field.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/map-enum-field.js +82 -0
- package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.cjs +69 -0
- package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.d.ts +10 -0
- package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/mixed-scopes-banner.js +35 -0
- package/dist/canvas/components/Guardrails/components/parameter-label.cjs +60 -0
- package/dist/canvas/components/Guardrails/components/parameter-label.d.ts +11 -0
- package/dist/canvas/components/Guardrails/components/parameter-label.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/components/parameter-label.js +26 -0
- package/dist/canvas/components/Guardrails/form-schema-builder.cjs +246 -0
- package/dist/canvas/components/Guardrails/form-schema-builder.d.ts +15 -0
- package/dist/canvas/components/Guardrails/form-schema-builder.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/form-schema-builder.js +197 -0
- package/dist/canvas/components/Guardrails/guardrail-builder.cjs +369 -0
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts +41 -0
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/guardrail-builder.js +335 -0
- package/dist/canvas/components/Guardrails/guardrail-form-layout.cjs +138 -0
- package/dist/canvas/components/Guardrails/guardrail-form-layout.d.ts +24 -0
- package/dist/canvas/components/Guardrails/guardrail-form-layout.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/guardrail-form-layout.js +104 -0
- package/dist/canvas/components/Guardrails/guardrail-validator-form.cjs +199 -0
- package/dist/canvas/components/Guardrails/guardrail-validator-form.d.ts +3 -0
- package/dist/canvas/components/Guardrails/guardrail-validator-form.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/guardrail-validator-form.js +165 -0
- package/dist/canvas/components/Guardrails/i18n.cjs +436 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts +76 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/i18n.js +384 -0
- package/dist/canvas/components/Guardrails/index.cjs +112 -0
- package/dist/canvas/components/Guardrails/index.d.ts +16 -0
- package/dist/canvas/components/Guardrails/index.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/index.js +9 -0
- package/dist/canvas/components/Guardrails/render-parameter-bridge.cjs +60 -0
- package/dist/canvas/components/Guardrails/render-parameter-bridge.d.ts +13 -0
- package/dist/canvas/components/Guardrails/render-parameter-bridge.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/render-parameter-bridge.js +23 -0
- package/dist/canvas/components/Guardrails/types.cjs +18 -0
- package/dist/canvas/components/Guardrails/types.d.ts +69 -0
- package/dist/canvas/components/Guardrails/types.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/types.js +0 -0
- package/dist/canvas/components/Guardrails/use-metadata-form-bridge.cjs +144 -0
- package/dist/canvas/components/Guardrails/use-metadata-form-bridge.d.ts +13 -0
- package/dist/canvas/components/Guardrails/use-metadata-form-bridge.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/use-metadata-form-bridge.js +110 -0
- package/dist/canvas/components/Guardrails/utils.cjs +174 -0
- package/dist/canvas/components/Guardrails/utils.d.ts +9 -0
- package/dist/canvas/components/Guardrails/utils.d.ts.map +1 -0
- package/dist/canvas/components/Guardrails/utils.js +122 -0
- package/dist/canvas/components/index.cjs +41 -34
- package/dist/canvas/components/index.d.ts +1 -0
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +1 -0
- package/dist/canvas/locales/de.cjs +1 -1
- package/dist/canvas/locales/de.d.ts.map +1 -1
- package/dist/canvas/locales/de.js +1 -1
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/dist/canvas/locales/es-MX.cjs +1 -1
- package/dist/canvas/locales/es-MX.d.ts.map +1 -1
- package/dist/canvas/locales/es-MX.js +1 -1
- package/dist/canvas/locales/es.cjs +1 -1
- package/dist/canvas/locales/es.d.ts.map +1 -1
- package/dist/canvas/locales/es.js +1 -1
- package/dist/canvas/locales/fr.cjs +1 -1
- package/dist/canvas/locales/fr.d.ts.map +1 -1
- package/dist/canvas/locales/fr.js +1 -1
- package/dist/canvas/locales/ja.cjs +1 -1
- package/dist/canvas/locales/ja.d.ts.map +1 -1
- package/dist/canvas/locales/ja.js +1 -1
- package/dist/canvas/locales/ko.cjs +1 -1
- package/dist/canvas/locales/ko.d.ts.map +1 -1
- package/dist/canvas/locales/ko.js +1 -1
- package/dist/canvas/locales/pt-BR.cjs +1 -1
- package/dist/canvas/locales/pt-BR.d.ts.map +1 -1
- package/dist/canvas/locales/pt-BR.js +1 -1
- package/dist/canvas/locales/pt.cjs +1 -1
- package/dist/canvas/locales/pt.d.ts.map +1 -1
- package/dist/canvas/locales/pt.js +1 -1
- package/dist/canvas/locales/ro.cjs +1 -1
- package/dist/canvas/locales/ro.d.ts.map +1 -1
- package/dist/canvas/locales/ro.js +1 -1
- package/dist/canvas/locales/ru.cjs +1 -1
- package/dist/canvas/locales/ru.d.ts.map +1 -1
- package/dist/canvas/locales/ru.js +1 -1
- package/dist/canvas/locales/tr.cjs +1 -1
- package/dist/canvas/locales/tr.d.ts.map +1 -1
- package/dist/canvas/locales/tr.js +1 -1
- package/dist/canvas/locales/zh-CN.cjs +1 -1
- package/dist/canvas/locales/zh-CN.d.ts.map +1 -1
- package/dist/canvas/locales/zh-CN.js +1 -1
- package/dist/canvas/locales/zh-TW.cjs +1 -1
- package/dist/canvas/locales/zh-TW.d.ts.map +1 -1
- package/dist/canvas/locales/zh-TW.js +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/i18n/index.cjs +5 -1
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -1
- package/dist/test/setup.d.ts.map +1 -1
- package/package.json +11 -3
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
EscalateActionFields: ()=>EscalateActionFields
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_builder_types_cjs_namespaceObject = require("../builder-types.cjs");
|
|
34
|
+
function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labels, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp }) {
|
|
35
|
+
const uid = (0, external_react_namespaceObject.useId)();
|
|
36
|
+
const recipientTypeLabels = {
|
|
37
|
+
[external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User]: labels.recipientUserLabel,
|
|
38
|
+
[external_builder_types_cjs_namespaceObject.GuardrailRecipientType.Group]: labels.recipientGroupLabel,
|
|
39
|
+
[external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail]: labels.recipientEmailLabel,
|
|
40
|
+
[external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticGroupName]: labels.recipientGroupNameLabel
|
|
41
|
+
};
|
|
42
|
+
const recipientType = action.recipient.type;
|
|
43
|
+
const displayedRecipientType = recipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.AssetEmail ? external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail : recipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.AssetGroupName ? external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticGroupName : recipientType;
|
|
44
|
+
const handleRecipientTypeChange = (0, external_react_namespaceObject.useCallback)((value)=>{
|
|
45
|
+
const newType = Number(value);
|
|
46
|
+
let recipient;
|
|
47
|
+
switch(newType){
|
|
48
|
+
case external_builder_types_cjs_namespaceObject.GuardrailRecipientType.Group:
|
|
49
|
+
recipient = {
|
|
50
|
+
type: external_builder_types_cjs_namespaceObject.GuardrailRecipientType.Group,
|
|
51
|
+
value: '',
|
|
52
|
+
displayName: ''
|
|
53
|
+
};
|
|
54
|
+
break;
|
|
55
|
+
case external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail:
|
|
56
|
+
recipient = {
|
|
57
|
+
type: external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail,
|
|
58
|
+
value: ''
|
|
59
|
+
};
|
|
60
|
+
break;
|
|
61
|
+
case external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticGroupName:
|
|
62
|
+
recipient = {
|
|
63
|
+
type: external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticGroupName,
|
|
64
|
+
value: ''
|
|
65
|
+
};
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
recipient = {
|
|
69
|
+
type: external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User,
|
|
70
|
+
value: '',
|
|
71
|
+
displayName: ''
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
onChange({
|
|
75
|
+
...action,
|
|
76
|
+
recipient
|
|
77
|
+
});
|
|
78
|
+
}, [
|
|
79
|
+
action,
|
|
80
|
+
onChange
|
|
81
|
+
]);
|
|
82
|
+
const handleRecipientSelect = (0, external_react_namespaceObject.useCallback)((selection)=>{
|
|
83
|
+
const r = action.recipient;
|
|
84
|
+
if (r.type === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User || r.type === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.Group) onChange({
|
|
85
|
+
...action,
|
|
86
|
+
recipient: {
|
|
87
|
+
...r,
|
|
88
|
+
value: selection.value,
|
|
89
|
+
displayName: selection.displayName
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}, [
|
|
93
|
+
action,
|
|
94
|
+
onChange
|
|
95
|
+
]);
|
|
96
|
+
const handleRecipientClear = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
97
|
+
const r = action.recipient;
|
|
98
|
+
if (r.type === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User || r.type === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.Group) onChange({
|
|
99
|
+
...action,
|
|
100
|
+
recipient: {
|
|
101
|
+
...r,
|
|
102
|
+
value: '',
|
|
103
|
+
displayName: ''
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}, [
|
|
107
|
+
action,
|
|
108
|
+
onChange
|
|
109
|
+
]);
|
|
110
|
+
const handleTextValueChange = (0, external_react_namespaceObject.useCallback)((value)=>{
|
|
111
|
+
const r = action.recipient;
|
|
112
|
+
if (r.type === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail || r.type === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticGroupName) onChange({
|
|
113
|
+
...action,
|
|
114
|
+
recipient: {
|
|
115
|
+
...r,
|
|
116
|
+
value
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
else if (r.type === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.AssetEmail || r.type === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.AssetGroupName) onChange({
|
|
120
|
+
...action,
|
|
121
|
+
recipient: {
|
|
122
|
+
...r,
|
|
123
|
+
assetName: value
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}, [
|
|
127
|
+
action,
|
|
128
|
+
onChange
|
|
129
|
+
]);
|
|
130
|
+
const recipientValue = 'value' in action.recipient ? action.recipient.value : action.recipient.assetName;
|
|
131
|
+
const recipientDisplayValue = ('displayName' in action.recipient ? action.recipient.displayName : '') || recipientValue;
|
|
132
|
+
const isSearchable = recipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User || recipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.Group;
|
|
133
|
+
const searchKind = recipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.User ? 'user' : 'group';
|
|
134
|
+
const searchPlaceholder = 'user' === searchKind ? labels.userSearchPlaceholder : labels.groupSearchPlaceholder;
|
|
135
|
+
const appPickerCtx = {
|
|
136
|
+
app: action.app.name ? action.app : null,
|
|
137
|
+
onChange: (app)=>onChange({
|
|
138
|
+
...action,
|
|
139
|
+
app: app ?? {
|
|
140
|
+
id: '',
|
|
141
|
+
version: '',
|
|
142
|
+
name: ''
|
|
143
|
+
}
|
|
144
|
+
}),
|
|
145
|
+
label: labels.actionAppLabel,
|
|
146
|
+
error: errors?.actionApp
|
|
147
|
+
};
|
|
148
|
+
const fields = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
149
|
+
children: [
|
|
150
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
151
|
+
children: [
|
|
152
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
|
|
153
|
+
htmlFor: `${uid}-escalate-recipient-type`,
|
|
154
|
+
children: labels.assignToLabel
|
|
155
|
+
}),
|
|
156
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Select, {
|
|
157
|
+
value: String(displayedRecipientType),
|
|
158
|
+
onValueChange: handleRecipientTypeChange,
|
|
159
|
+
children: [
|
|
160
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.SelectTrigger, {
|
|
161
|
+
id: `${uid}-escalate-recipient-type`,
|
|
162
|
+
"aria-label": `${labels.assignToLabel}: ${recipientTypeLabels[displayedRecipientType] ?? labels.recipientFallbackLabel}`,
|
|
163
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.SelectValue, {})
|
|
164
|
+
}),
|
|
165
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.SelectContent, {
|
|
166
|
+
children: Object.entries(recipientTypeLabels).map(([typeValue, label])=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.SelectItem, {
|
|
167
|
+
value: typeValue,
|
|
168
|
+
children: label
|
|
169
|
+
}, typeValue))
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
}),
|
|
175
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
176
|
+
children: [
|
|
177
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Label, {
|
|
178
|
+
children: [
|
|
179
|
+
recipientTypeLabels[displayedRecipientType] ?? labels.recipientFallbackLabel,
|
|
180
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.RequiredIndicator, {})
|
|
181
|
+
]
|
|
182
|
+
}),
|
|
183
|
+
isSearchable ? renderRecipientSearch ? renderRecipientSearch({
|
|
184
|
+
kind: searchKind,
|
|
185
|
+
displayValue: recipientDisplayValue,
|
|
186
|
+
placeholder: searchPlaceholder,
|
|
187
|
+
invalid: Boolean(errors?.recipient),
|
|
188
|
+
error: errors?.recipient,
|
|
189
|
+
onSelect: handleRecipientSelect,
|
|
190
|
+
onClear: handleRecipientClear
|
|
191
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
192
|
+
value: recipientDisplayValue,
|
|
193
|
+
onChange: (e)=>handleRecipientSelect({
|
|
194
|
+
value: e.target.value,
|
|
195
|
+
displayName: e.target.value
|
|
196
|
+
}),
|
|
197
|
+
placeholder: searchPlaceholder,
|
|
198
|
+
error: errors?.recipient
|
|
199
|
+
}) : (()=>{
|
|
200
|
+
const staticNode = renderStaticRecipient?.({
|
|
201
|
+
kind: displayedRecipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail ? 'email' : 'groupName',
|
|
202
|
+
recipient: action.recipient,
|
|
203
|
+
label: recipientTypeLabels[displayedRecipientType] ?? labels.recipientFallbackLabel,
|
|
204
|
+
invalid: Boolean(errors?.recipient),
|
|
205
|
+
error: errors?.recipient,
|
|
206
|
+
onChange: (recipient)=>onChange({
|
|
207
|
+
...action,
|
|
208
|
+
recipient
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
if (void 0 !== staticNode) return staticNode;
|
|
212
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
213
|
+
value: recipientValue,
|
|
214
|
+
onChange: (e)=>handleTextValueChange(e.target.value),
|
|
215
|
+
placeholder: displayedRecipientType === external_builder_types_cjs_namespaceObject.GuardrailRecipientType.StaticEmail ? labels.emailPlaceholder : labels.groupNamePlaceholder,
|
|
216
|
+
error: errors?.recipient
|
|
217
|
+
});
|
|
218
|
+
})()
|
|
219
|
+
]
|
|
220
|
+
}),
|
|
221
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormField, {
|
|
222
|
+
children: renderAppPicker ? renderAppPicker(appPickerCtx) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
223
|
+
children: [
|
|
224
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Label, {
|
|
225
|
+
children: [
|
|
226
|
+
labels.actionAppLabel,
|
|
227
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.RequiredIndicator, {})
|
|
228
|
+
]
|
|
229
|
+
}),
|
|
230
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Alert, {
|
|
231
|
+
variant: "info",
|
|
232
|
+
children: [
|
|
233
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Info, {}),
|
|
234
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.AlertDescription, {
|
|
235
|
+
children: labels.appPickerUnavailable
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
}),
|
|
239
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldError, {
|
|
240
|
+
children: errors?.actionApp
|
|
241
|
+
})
|
|
242
|
+
]
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
});
|
|
247
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
248
|
+
"data-slot": "guardrail-escalate-fields",
|
|
249
|
+
className: "@container space-y-3",
|
|
250
|
+
children: [
|
|
251
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
252
|
+
className: "grid grid-cols-1 @sm:grid-cols-2 gap-3 items-start",
|
|
253
|
+
children: [
|
|
254
|
+
actionTypeSelect,
|
|
255
|
+
fields
|
|
256
|
+
]
|
|
257
|
+
}),
|
|
258
|
+
escalateHelp
|
|
259
|
+
]
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
exports.EscalateActionFields = __webpack_exports__.EscalateActionFields;
|
|
263
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
264
|
+
"EscalateActionFields"
|
|
265
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
266
|
+
Object.defineProperty(exports, '__esModule', {
|
|
267
|
+
value: true
|
|
268
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type GuardrailAction, type GuardrailAppPickerContext, type GuardrailRecipientSearchContext, type GuardrailStaticRecipientContext } from '../builder-types';
|
|
3
|
+
import type { GuardrailBuilderLabels } from '../i18n';
|
|
4
|
+
type EscalateAction = Extract<GuardrailAction, {
|
|
5
|
+
$actionType: 'escalate';
|
|
6
|
+
}>;
|
|
7
|
+
export interface EscalateActionFieldsProps {
|
|
8
|
+
action: EscalateAction;
|
|
9
|
+
onChange: (action: EscalateAction) => void;
|
|
10
|
+
actionTypeSelect: ReactNode;
|
|
11
|
+
errors?: {
|
|
12
|
+
recipient?: string;
|
|
13
|
+
actionApp?: string;
|
|
14
|
+
};
|
|
15
|
+
labels: GuardrailBuilderLabels;
|
|
16
|
+
renderRecipientSearch?: (ctx: GuardrailRecipientSearchContext) => ReactNode;
|
|
17
|
+
renderStaticRecipient?: (ctx: GuardrailStaticRecipientContext) => ReactNode | undefined;
|
|
18
|
+
renderAppPicker?: (ctx: GuardrailAppPickerContext) => ReactNode;
|
|
19
|
+
escalateHelp?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labels, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp, }: EscalateActionFieldsProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=escalate-action-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escalate-action-fields.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/escalate-action-fields.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAC3D,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAE9B,KAAK,+BAA+B,EAEpC,KAAK,+BAA+B,EACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,KAAK,cAAc,GAAG,OAAO,CAAC,eAAe,EAAE;IAAE,WAAW,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AAE5E,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAE3C,gBAAgB,EAAE,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,MAAM,EAAE,sBAAsB,CAAC;IAC/B,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,SAAS,CAAC;IAC5E,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,SAAS,GAAG,SAAS,CAAC;IACxF,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,yBAAyB,KAAK,SAAS,CAAC;IAEhE,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAOD,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,YAAY,GACb,EAAE,yBAAyB,2CA4N3B"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Alert, AlertDescription, FormField, FormFieldError, Input, Label, RequiredIndicator, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@uipath/apollo-wind";
|
|
3
|
+
import { Info } from "lucide-react";
|
|
4
|
+
import { useCallback, useId } from "react";
|
|
5
|
+
import { GuardrailRecipientType } from "../builder-types.js";
|
|
6
|
+
function EscalateActionFields({ action, onChange, actionTypeSelect, errors, labels, renderRecipientSearch, renderStaticRecipient, renderAppPicker, escalateHelp }) {
|
|
7
|
+
const uid = useId();
|
|
8
|
+
const recipientTypeLabels = {
|
|
9
|
+
[GuardrailRecipientType.User]: labels.recipientUserLabel,
|
|
10
|
+
[GuardrailRecipientType.Group]: labels.recipientGroupLabel,
|
|
11
|
+
[GuardrailRecipientType.StaticEmail]: labels.recipientEmailLabel,
|
|
12
|
+
[GuardrailRecipientType.StaticGroupName]: labels.recipientGroupNameLabel
|
|
13
|
+
};
|
|
14
|
+
const recipientType = action.recipient.type;
|
|
15
|
+
const displayedRecipientType = recipientType === GuardrailRecipientType.AssetEmail ? GuardrailRecipientType.StaticEmail : recipientType === GuardrailRecipientType.AssetGroupName ? GuardrailRecipientType.StaticGroupName : recipientType;
|
|
16
|
+
const handleRecipientTypeChange = useCallback((value)=>{
|
|
17
|
+
const newType = Number(value);
|
|
18
|
+
let recipient;
|
|
19
|
+
switch(newType){
|
|
20
|
+
case GuardrailRecipientType.Group:
|
|
21
|
+
recipient = {
|
|
22
|
+
type: GuardrailRecipientType.Group,
|
|
23
|
+
value: '',
|
|
24
|
+
displayName: ''
|
|
25
|
+
};
|
|
26
|
+
break;
|
|
27
|
+
case GuardrailRecipientType.StaticEmail:
|
|
28
|
+
recipient = {
|
|
29
|
+
type: GuardrailRecipientType.StaticEmail,
|
|
30
|
+
value: ''
|
|
31
|
+
};
|
|
32
|
+
break;
|
|
33
|
+
case GuardrailRecipientType.StaticGroupName:
|
|
34
|
+
recipient = {
|
|
35
|
+
type: GuardrailRecipientType.StaticGroupName,
|
|
36
|
+
value: ''
|
|
37
|
+
};
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
recipient = {
|
|
41
|
+
type: GuardrailRecipientType.User,
|
|
42
|
+
value: '',
|
|
43
|
+
displayName: ''
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
onChange({
|
|
47
|
+
...action,
|
|
48
|
+
recipient
|
|
49
|
+
});
|
|
50
|
+
}, [
|
|
51
|
+
action,
|
|
52
|
+
onChange
|
|
53
|
+
]);
|
|
54
|
+
const handleRecipientSelect = useCallback((selection)=>{
|
|
55
|
+
const r = action.recipient;
|
|
56
|
+
if (r.type === GuardrailRecipientType.User || r.type === GuardrailRecipientType.Group) onChange({
|
|
57
|
+
...action,
|
|
58
|
+
recipient: {
|
|
59
|
+
...r,
|
|
60
|
+
value: selection.value,
|
|
61
|
+
displayName: selection.displayName
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}, [
|
|
65
|
+
action,
|
|
66
|
+
onChange
|
|
67
|
+
]);
|
|
68
|
+
const handleRecipientClear = useCallback(()=>{
|
|
69
|
+
const r = action.recipient;
|
|
70
|
+
if (r.type === GuardrailRecipientType.User || r.type === GuardrailRecipientType.Group) onChange({
|
|
71
|
+
...action,
|
|
72
|
+
recipient: {
|
|
73
|
+
...r,
|
|
74
|
+
value: '',
|
|
75
|
+
displayName: ''
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}, [
|
|
79
|
+
action,
|
|
80
|
+
onChange
|
|
81
|
+
]);
|
|
82
|
+
const handleTextValueChange = useCallback((value)=>{
|
|
83
|
+
const r = action.recipient;
|
|
84
|
+
if (r.type === GuardrailRecipientType.StaticEmail || r.type === GuardrailRecipientType.StaticGroupName) onChange({
|
|
85
|
+
...action,
|
|
86
|
+
recipient: {
|
|
87
|
+
...r,
|
|
88
|
+
value
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
else if (r.type === GuardrailRecipientType.AssetEmail || r.type === GuardrailRecipientType.AssetGroupName) onChange({
|
|
92
|
+
...action,
|
|
93
|
+
recipient: {
|
|
94
|
+
...r,
|
|
95
|
+
assetName: value
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}, [
|
|
99
|
+
action,
|
|
100
|
+
onChange
|
|
101
|
+
]);
|
|
102
|
+
const recipientValue = 'value' in action.recipient ? action.recipient.value : action.recipient.assetName;
|
|
103
|
+
const recipientDisplayValue = ('displayName' in action.recipient ? action.recipient.displayName : '') || recipientValue;
|
|
104
|
+
const isSearchable = recipientType === GuardrailRecipientType.User || recipientType === GuardrailRecipientType.Group;
|
|
105
|
+
const searchKind = recipientType === GuardrailRecipientType.User ? 'user' : 'group';
|
|
106
|
+
const searchPlaceholder = 'user' === searchKind ? labels.userSearchPlaceholder : labels.groupSearchPlaceholder;
|
|
107
|
+
const appPickerCtx = {
|
|
108
|
+
app: action.app.name ? action.app : null,
|
|
109
|
+
onChange: (app)=>onChange({
|
|
110
|
+
...action,
|
|
111
|
+
app: app ?? {
|
|
112
|
+
id: '',
|
|
113
|
+
version: '',
|
|
114
|
+
name: ''
|
|
115
|
+
}
|
|
116
|
+
}),
|
|
117
|
+
label: labels.actionAppLabel,
|
|
118
|
+
error: errors?.actionApp
|
|
119
|
+
};
|
|
120
|
+
const fields = /*#__PURE__*/ jsxs(Fragment, {
|
|
121
|
+
children: [
|
|
122
|
+
/*#__PURE__*/ jsxs(FormField, {
|
|
123
|
+
children: [
|
|
124
|
+
/*#__PURE__*/ jsx(Label, {
|
|
125
|
+
htmlFor: `${uid}-escalate-recipient-type`,
|
|
126
|
+
children: labels.assignToLabel
|
|
127
|
+
}),
|
|
128
|
+
/*#__PURE__*/ jsxs(Select, {
|
|
129
|
+
value: String(displayedRecipientType),
|
|
130
|
+
onValueChange: handleRecipientTypeChange,
|
|
131
|
+
children: [
|
|
132
|
+
/*#__PURE__*/ jsx(SelectTrigger, {
|
|
133
|
+
id: `${uid}-escalate-recipient-type`,
|
|
134
|
+
"aria-label": `${labels.assignToLabel}: ${recipientTypeLabels[displayedRecipientType] ?? labels.recipientFallbackLabel}`,
|
|
135
|
+
children: /*#__PURE__*/ jsx(SelectValue, {})
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ jsx(SelectContent, {
|
|
138
|
+
children: Object.entries(recipientTypeLabels).map(([typeValue, label])=>/*#__PURE__*/ jsx(SelectItem, {
|
|
139
|
+
value: typeValue,
|
|
140
|
+
children: label
|
|
141
|
+
}, typeValue))
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
}),
|
|
147
|
+
/*#__PURE__*/ jsxs(FormField, {
|
|
148
|
+
children: [
|
|
149
|
+
/*#__PURE__*/ jsxs(Label, {
|
|
150
|
+
children: [
|
|
151
|
+
recipientTypeLabels[displayedRecipientType] ?? labels.recipientFallbackLabel,
|
|
152
|
+
/*#__PURE__*/ jsx(RequiredIndicator, {})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
isSearchable ? renderRecipientSearch ? renderRecipientSearch({
|
|
156
|
+
kind: searchKind,
|
|
157
|
+
displayValue: recipientDisplayValue,
|
|
158
|
+
placeholder: searchPlaceholder,
|
|
159
|
+
invalid: Boolean(errors?.recipient),
|
|
160
|
+
error: errors?.recipient,
|
|
161
|
+
onSelect: handleRecipientSelect,
|
|
162
|
+
onClear: handleRecipientClear
|
|
163
|
+
}) : /*#__PURE__*/ jsx(Input, {
|
|
164
|
+
value: recipientDisplayValue,
|
|
165
|
+
onChange: (e)=>handleRecipientSelect({
|
|
166
|
+
value: e.target.value,
|
|
167
|
+
displayName: e.target.value
|
|
168
|
+
}),
|
|
169
|
+
placeholder: searchPlaceholder,
|
|
170
|
+
error: errors?.recipient
|
|
171
|
+
}) : (()=>{
|
|
172
|
+
const staticNode = renderStaticRecipient?.({
|
|
173
|
+
kind: displayedRecipientType === GuardrailRecipientType.StaticEmail ? 'email' : 'groupName',
|
|
174
|
+
recipient: action.recipient,
|
|
175
|
+
label: recipientTypeLabels[displayedRecipientType] ?? labels.recipientFallbackLabel,
|
|
176
|
+
invalid: Boolean(errors?.recipient),
|
|
177
|
+
error: errors?.recipient,
|
|
178
|
+
onChange: (recipient)=>onChange({
|
|
179
|
+
...action,
|
|
180
|
+
recipient
|
|
181
|
+
})
|
|
182
|
+
});
|
|
183
|
+
if (void 0 !== staticNode) return staticNode;
|
|
184
|
+
return /*#__PURE__*/ jsx(Input, {
|
|
185
|
+
value: recipientValue,
|
|
186
|
+
onChange: (e)=>handleTextValueChange(e.target.value),
|
|
187
|
+
placeholder: displayedRecipientType === GuardrailRecipientType.StaticEmail ? labels.emailPlaceholder : labels.groupNamePlaceholder,
|
|
188
|
+
error: errors?.recipient
|
|
189
|
+
});
|
|
190
|
+
})()
|
|
191
|
+
]
|
|
192
|
+
}),
|
|
193
|
+
/*#__PURE__*/ jsx(FormField, {
|
|
194
|
+
children: renderAppPicker ? renderAppPicker(appPickerCtx) : /*#__PURE__*/ jsxs(Fragment, {
|
|
195
|
+
children: [
|
|
196
|
+
/*#__PURE__*/ jsxs(Label, {
|
|
197
|
+
children: [
|
|
198
|
+
labels.actionAppLabel,
|
|
199
|
+
/*#__PURE__*/ jsx(RequiredIndicator, {})
|
|
200
|
+
]
|
|
201
|
+
}),
|
|
202
|
+
/*#__PURE__*/ jsxs(Alert, {
|
|
203
|
+
variant: "info",
|
|
204
|
+
children: [
|
|
205
|
+
/*#__PURE__*/ jsx(Info, {}),
|
|
206
|
+
/*#__PURE__*/ jsx(AlertDescription, {
|
|
207
|
+
children: labels.appPickerUnavailable
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
}),
|
|
211
|
+
/*#__PURE__*/ jsx(FormFieldError, {
|
|
212
|
+
children: errors?.actionApp
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
})
|
|
216
|
+
})
|
|
217
|
+
]
|
|
218
|
+
});
|
|
219
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
220
|
+
"data-slot": "guardrail-escalate-fields",
|
|
221
|
+
className: "@container space-y-3",
|
|
222
|
+
children: [
|
|
223
|
+
/*#__PURE__*/ jsxs("div", {
|
|
224
|
+
className: "grid grid-cols-1 @sm:grid-cols-2 gap-3 items-start",
|
|
225
|
+
children: [
|
|
226
|
+
actionTypeSelect,
|
|
227
|
+
fields
|
|
228
|
+
]
|
|
229
|
+
}),
|
|
230
|
+
escalateHelp
|
|
231
|
+
]
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
export { EscalateActionFields };
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
FieldShell: ()=>FieldShell
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const FieldShell = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ invalid = false, className, children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
33
|
+
ref: ref,
|
|
34
|
+
"data-slot": "guardrail-field-shell",
|
|
35
|
+
className: (0, apollo_wind_namespaceObject.cn)('rounded-md px-3 py-2 future:rounded-xl', 'border border-input bg-transparent future:border-0 future:bg-surface-overlay', invalid && 'border-error ring-error/20 future:ring-1 future:ring-error/40', className),
|
|
36
|
+
...props,
|
|
37
|
+
children: children
|
|
38
|
+
}));
|
|
39
|
+
FieldShell.displayName = 'FieldShell';
|
|
40
|
+
exports.FieldShell = __webpack_exports__.FieldShell;
|
|
41
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
42
|
+
"FieldShell"
|
|
43
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
44
|
+
Object.defineProperty(exports, '__esModule', {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface FieldShellProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
invalid?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const FieldShell: React.ForwardRefExoticComponent<FieldShellProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { FieldShell };
|
|
7
|
+
//# sourceMappingURL=field-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-shell.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Guardrails/components/field-shell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAE5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAWD,QAAA,MAAM,UAAU,wFAgBf,CAAC;AAGF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
const FieldShell = /*#__PURE__*/ forwardRef(({ invalid = false, className, children, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
5
|
+
ref: ref,
|
|
6
|
+
"data-slot": "guardrail-field-shell",
|
|
7
|
+
className: cn('rounded-md px-3 py-2 future:rounded-xl', 'border border-input bg-transparent future:border-0 future:bg-surface-overlay', invalid && 'border-error ring-error/20 future:ring-1 future:ring-error/40', className),
|
|
8
|
+
...props,
|
|
9
|
+
children: children
|
|
10
|
+
}));
|
|
11
|
+
FieldShell.displayName = 'FieldShell';
|
|
12
|
+
export { FieldShell };
|