@uipath/apollo-wind 2.90.0 → 2.92.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/index.cjs +22 -22
- package/dist/components/ui/message-actions.cjs +7 -4
- package/dist/components/ui/message-actions.d.ts +5 -0
- package/dist/components/ui/message-actions.js +7 -4
- package/dist/components/ui/quick-form-field/index.d.ts +1 -1
- package/dist/components/ui/quick-form-field/quick-form-field.cjs +3 -2
- package/dist/components/ui/quick-form-field/quick-form-field.d.ts +2 -1
- package/dist/components/ui/quick-form-field/quick-form-field.js +3 -2
- package/dist/components/ui/quick-form-field/types.d.ts +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +41 -0
- package/package.json +1 -1
|
@@ -66,7 +66,7 @@ var __webpack_modules__ = {
|
|
|
66
66
|
"./combobox" (module) {
|
|
67
67
|
module.exports = require("./combobox.cjs");
|
|
68
68
|
},
|
|
69
|
-
"
|
|
69
|
+
"./command" (module) {
|
|
70
70
|
module.exports = require("./command.cjs");
|
|
71
71
|
},
|
|
72
72
|
"./connection-picker" (module) {
|
|
@@ -84,7 +84,7 @@ var __webpack_modules__ = {
|
|
|
84
84
|
"./datetime-picker" (module) {
|
|
85
85
|
module.exports = require("./datetime-picker.cjs");
|
|
86
86
|
},
|
|
87
|
-
"
|
|
87
|
+
"./dialog" (module) {
|
|
88
88
|
module.exports = require("./dialog.cjs");
|
|
89
89
|
},
|
|
90
90
|
"./disclosure-tree" (module) {
|
|
@@ -93,13 +93,13 @@ var __webpack_modules__ = {
|
|
|
93
93
|
"./drawer" (module) {
|
|
94
94
|
module.exports = require("./drawer.cjs");
|
|
95
95
|
},
|
|
96
|
-
"
|
|
96
|
+
"./dropdown-menu" (module) {
|
|
97
97
|
module.exports = require("./dropdown-menu.cjs");
|
|
98
98
|
},
|
|
99
99
|
"./dropzone-overlay" (module) {
|
|
100
100
|
module.exports = require("./dropzone-overlay.cjs");
|
|
101
101
|
},
|
|
102
|
-
"
|
|
102
|
+
"./editable-cell" (module) {
|
|
103
103
|
module.exports = require("./editable-cell.cjs");
|
|
104
104
|
},
|
|
105
105
|
"./editable-text" (module) {
|
|
@@ -132,13 +132,13 @@ var __webpack_modules__ = {
|
|
|
132
132
|
"@/components/ui/input-group" (module) {
|
|
133
133
|
module.exports = require("./input-group.cjs");
|
|
134
134
|
},
|
|
135
|
-
"
|
|
135
|
+
"./input" (module) {
|
|
136
136
|
module.exports = require("./input.cjs");
|
|
137
137
|
},
|
|
138
138
|
"./json-tree-view" (module) {
|
|
139
139
|
module.exports = require("./json-tree-view/index.cjs");
|
|
140
140
|
},
|
|
141
|
-
"
|
|
141
|
+
"@/components/ui/label" (module) {
|
|
142
142
|
module.exports = require("./label.cjs");
|
|
143
143
|
},
|
|
144
144
|
"@/components/ui/layout" (module) {
|
|
@@ -186,7 +186,7 @@ var __webpack_modules__ = {
|
|
|
186
186
|
"./password-input" (module) {
|
|
187
187
|
module.exports = require("./password-input.cjs");
|
|
188
188
|
},
|
|
189
|
-
"
|
|
189
|
+
"@/components/ui/popover" (module) {
|
|
190
190
|
module.exports = require("./popover.cjs");
|
|
191
191
|
},
|
|
192
192
|
"@/components/ui/portal-container" (module) {
|
|
@@ -213,7 +213,7 @@ var __webpack_modules__ = {
|
|
|
213
213
|
"./reference-chip-colors" (module) {
|
|
214
214
|
module.exports = require("./reference-chip-colors.cjs");
|
|
215
215
|
},
|
|
216
|
-
"
|
|
216
|
+
"./reference-chip" (module) {
|
|
217
217
|
module.exports = require("./reference-chip.cjs");
|
|
218
218
|
},
|
|
219
219
|
"./resizable" (module) {
|
|
@@ -252,7 +252,7 @@ var __webpack_modules__ = {
|
|
|
252
252
|
"./sources" (module) {
|
|
253
253
|
module.exports = require("./sources.cjs");
|
|
254
254
|
},
|
|
255
|
-
"
|
|
255
|
+
"./spinner" (module) {
|
|
256
256
|
module.exports = require("./spinner.cjs");
|
|
257
257
|
},
|
|
258
258
|
"./stats-card" (module) {
|
|
@@ -264,7 +264,7 @@ var __webpack_modules__ = {
|
|
|
264
264
|
"./switch" (module) {
|
|
265
265
|
module.exports = require("./switch.cjs");
|
|
266
266
|
},
|
|
267
|
-
"
|
|
267
|
+
"./table" (module) {
|
|
268
268
|
module.exports = require("./table.cjs");
|
|
269
269
|
},
|
|
270
270
|
"./tabs" (module) {
|
|
@@ -291,7 +291,7 @@ var __webpack_modules__ = {
|
|
|
291
291
|
"./tree-view" (module) {
|
|
292
292
|
module.exports = require("./tree-view.cjs");
|
|
293
293
|
},
|
|
294
|
-
"
|
|
294
|
+
"./variable-picker" (module) {
|
|
295
295
|
module.exports = require("./variable-picker/index.cjs");
|
|
296
296
|
},
|
|
297
297
|
"./variable-value-control" (module) {
|
|
@@ -567,7 +567,7 @@ var __webpack_exports__ = {};
|
|
|
567
567
|
"ReferenceChip"
|
|
568
568
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_combobox__rspack_import_21[__rspack_import_key];
|
|
569
569
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
570
|
-
var _command__rspack_import_22 = __webpack_require__("
|
|
570
|
+
var _command__rspack_import_22 = __webpack_require__("./command");
|
|
571
571
|
var __rspack_reexport = {};
|
|
572
572
|
for(const __rspack_import_key in _command__rspack_import_22)if ([
|
|
573
573
|
"getReferenceChipColors",
|
|
@@ -627,7 +627,7 @@ var __webpack_exports__ = {};
|
|
|
627
627
|
"ReferenceChip"
|
|
628
628
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_datetime_picker__rspack_import_27[__rspack_import_key];
|
|
629
629
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
630
|
-
var _dialog__rspack_import_28 = __webpack_require__("
|
|
630
|
+
var _dialog__rspack_import_28 = __webpack_require__("./dialog");
|
|
631
631
|
var __rspack_reexport = {};
|
|
632
632
|
for(const __rspack_import_key in _dialog__rspack_import_28)if ([
|
|
633
633
|
"getReferenceChipColors",
|
|
@@ -657,7 +657,7 @@ var __webpack_exports__ = {};
|
|
|
657
657
|
"ReferenceChip"
|
|
658
658
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_drawer__rspack_import_30[__rspack_import_key];
|
|
659
659
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
660
|
-
var _dropdown_menu__rspack_import_31 = __webpack_require__("
|
|
660
|
+
var _dropdown_menu__rspack_import_31 = __webpack_require__("./dropdown-menu");
|
|
661
661
|
var __rspack_reexport = {};
|
|
662
662
|
for(const __rspack_import_key in _dropdown_menu__rspack_import_31)if ([
|
|
663
663
|
"getReferenceChipColors",
|
|
@@ -677,7 +677,7 @@ var __webpack_exports__ = {};
|
|
|
677
677
|
"ReferenceChip"
|
|
678
678
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_dropzone_overlay__rspack_import_32[__rspack_import_key];
|
|
679
679
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
680
|
-
var _editable_cell__rspack_import_33 = __webpack_require__("
|
|
680
|
+
var _editable_cell__rspack_import_33 = __webpack_require__("./editable-cell");
|
|
681
681
|
var __rspack_reexport = {};
|
|
682
682
|
for(const __rspack_import_key in _editable_cell__rspack_import_33)if ([
|
|
683
683
|
"getReferenceChipColors",
|
|
@@ -777,7 +777,7 @@ var __webpack_exports__ = {};
|
|
|
777
777
|
"ReferenceChip"
|
|
778
778
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_info_tooltip__rspack_import_42[__rspack_import_key];
|
|
779
779
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
780
|
-
var _input__rspack_import_43 = __webpack_require__("
|
|
780
|
+
var _input__rspack_import_43 = __webpack_require__("./input");
|
|
781
781
|
var __rspack_reexport = {};
|
|
782
782
|
for(const __rspack_import_key in _input__rspack_import_43)if ([
|
|
783
783
|
"getReferenceChipColors",
|
|
@@ -807,7 +807,7 @@ var __webpack_exports__ = {};
|
|
|
807
807
|
"ReferenceChip"
|
|
808
808
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_json_tree_view__rspack_import_45[__rspack_import_key];
|
|
809
809
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
810
|
-
var _label__rspack_import_46 = __webpack_require__("
|
|
810
|
+
var _label__rspack_import_46 = __webpack_require__("@/components/ui/label");
|
|
811
811
|
var __rspack_reexport = {};
|
|
812
812
|
for(const __rspack_import_key in _label__rspack_import_46)if ([
|
|
813
813
|
"getReferenceChipColors",
|
|
@@ -967,7 +967,7 @@ var __webpack_exports__ = {};
|
|
|
967
967
|
"ReferenceChip"
|
|
968
968
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_password_input__rspack_import_61[__rspack_import_key];
|
|
969
969
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
970
|
-
var _popover__rspack_import_62 = __webpack_require__("
|
|
970
|
+
var _popover__rspack_import_62 = __webpack_require__("@/components/ui/popover");
|
|
971
971
|
var __rspack_reexport = {};
|
|
972
972
|
for(const __rspack_import_key in _popover__rspack_import_62)if ([
|
|
973
973
|
"getReferenceChipColors",
|
|
@@ -1047,7 +1047,7 @@ var __webpack_exports__ = {};
|
|
|
1047
1047
|
"ReferenceChip"
|
|
1048
1048
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_radio_group__rspack_import_69[__rspack_import_key];
|
|
1049
1049
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1050
|
-
var _reference_chip__rspack_import_70 = __webpack_require__("
|
|
1050
|
+
var _reference_chip__rspack_import_70 = __webpack_require__("./reference-chip");
|
|
1051
1051
|
var _reference_chip_colors__rspack_import_71 = __webpack_require__("./reference-chip-colors");
|
|
1052
1052
|
var _resizable__rspack_import_72 = __webpack_require__("./resizable");
|
|
1053
1053
|
var __rspack_reexport = {};
|
|
@@ -1169,7 +1169,7 @@ var __webpack_exports__ = {};
|
|
|
1169
1169
|
"ReferenceChip"
|
|
1170
1170
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_sources__rspack_import_83[__rspack_import_key];
|
|
1171
1171
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1172
|
-
var _spinner__rspack_import_84 = __webpack_require__("
|
|
1172
|
+
var _spinner__rspack_import_84 = __webpack_require__("./spinner");
|
|
1173
1173
|
var __rspack_reexport = {};
|
|
1174
1174
|
for(const __rspack_import_key in _spinner__rspack_import_84)if ([
|
|
1175
1175
|
"getReferenceChipColors",
|
|
@@ -1209,7 +1209,7 @@ var __webpack_exports__ = {};
|
|
|
1209
1209
|
"ReferenceChip"
|
|
1210
1210
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_87[__rspack_import_key];
|
|
1211
1211
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1212
|
-
var _table__rspack_import_88 = __webpack_require__("
|
|
1212
|
+
var _table__rspack_import_88 = __webpack_require__("./table");
|
|
1213
1213
|
var __rspack_reexport = {};
|
|
1214
1214
|
for(const __rspack_import_key in _table__rspack_import_88)if ([
|
|
1215
1215
|
"getReferenceChipColors",
|
|
@@ -1291,7 +1291,7 @@ var __webpack_exports__ = {};
|
|
|
1291
1291
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1292
1292
|
var _tree_view__rspack_import_96 = __webpack_require__("./tree-view");
|
|
1293
1293
|
var _tree_view__rspack_import_96_default = /*#__PURE__*/ __webpack_require__.n(_tree_view__rspack_import_96);
|
|
1294
|
-
var _variable_picker__rspack_import_97 = __webpack_require__("
|
|
1294
|
+
var _variable_picker__rspack_import_97 = __webpack_require__("./variable-picker");
|
|
1295
1295
|
var __rspack_reexport = {};
|
|
1296
1296
|
for(const __rspack_import_key in _variable_picker__rspack_import_97)if ([
|
|
1297
1297
|
"getReferenceChipColors",
|
|
@@ -171,16 +171,17 @@ const DEFAULT_MESSAGE_ACTION_FEEDBACK_STRINGS = {
|
|
|
171
171
|
helpful: 'Helpful',
|
|
172
172
|
notHelpful: 'Not helpful'
|
|
173
173
|
};
|
|
174
|
-
const feedbackToggleClass = 'size-6 min-w-6 px-0 aria-pressed:bg-accent aria-pressed:text-accent-foreground future:aria-pressed:text-foreground';
|
|
175
|
-
const MessageActionFeedback = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ value: valueProp, defaultValue = null, onChange, disabled, strings, className, 'aria-label': ariaLabel, ...props }, ref)=>{
|
|
174
|
+
const feedbackToggleClass = 'size-6 min-w-6 px-0 aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent aria-pressed:hover:text-accent-foreground aria-pressed:[&_svg]:stroke-primary future:aria-pressed:text-foreground future:aria-pressed:hover:text-foreground aria-disabled:cursor-default';
|
|
175
|
+
const MessageActionFeedback = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ value: valueProp, defaultValue = null, onChange, disabled, locked = false, strings, className, 'aria-label': ariaLabel, ...props }, ref)=>{
|
|
176
176
|
const text = {
|
|
177
177
|
...DEFAULT_MESSAGE_ACTION_FEEDBACK_STRINGS,
|
|
178
178
|
...strings
|
|
179
179
|
};
|
|
180
180
|
const [uncontrolled, setUncontrolled] = external_react_namespaceObject.useState(defaultValue);
|
|
181
181
|
const value = void 0 === valueProp ? uncontrolled : valueProp;
|
|
182
|
+
const final = locked && null !== value;
|
|
182
183
|
const set = (next)=>{
|
|
183
|
-
if (next === value) return;
|
|
184
|
+
if (final || next === value) return;
|
|
184
185
|
if (void 0 === valueProp) setUncontrolled(next);
|
|
185
186
|
onChange?.(next);
|
|
186
187
|
};
|
|
@@ -195,13 +196,14 @@ const MessageActionFeedback = /*#__PURE__*/ external_react_namespaceObject.forwa
|
|
|
195
196
|
label: text.notHelpful,
|
|
196
197
|
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ThumbsDown, {})
|
|
197
198
|
}
|
|
198
|
-
];
|
|
199
|
+
].filter(({ rating })=>!final || rating === value);
|
|
199
200
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
200
201
|
ref: ref,
|
|
201
202
|
role: "group",
|
|
202
203
|
"aria-label": ariaLabel ?? text.label,
|
|
203
204
|
"data-slot": "message-action-feedback",
|
|
204
205
|
"data-value": value ?? void 0,
|
|
206
|
+
"data-locked": final || void 0,
|
|
205
207
|
className: (0, index_cjs_namespaceObject.cn)('flex items-center gap-0.5', className),
|
|
206
208
|
...props,
|
|
207
209
|
children: thumbs.map(({ rating, label, icon })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
@@ -216,6 +218,7 @@ const MessageActionFeedback = /*#__PURE__*/ external_react_namespaceObject.forwa
|
|
|
216
218
|
pressed: value === rating,
|
|
217
219
|
onPressedChange: ()=>set(rating),
|
|
218
220
|
disabled: disabled,
|
|
221
|
+
"aria-disabled": final || void 0,
|
|
219
222
|
children: icon
|
|
220
223
|
})
|
|
221
224
|
}),
|
|
@@ -88,6 +88,11 @@ export interface MessageActionFeedbackProps extends Omit<React.HTMLAttributes<HT
|
|
|
88
88
|
/** Called with the new rating. Never `null`, since a rating cannot be cleared. */
|
|
89
89
|
onChange?: (value: Exclude<MessageFeedbackValue, null>) => void;
|
|
90
90
|
disabled?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Once rated, the rating is final: only the chosen thumb remains, pressed and inert. For services
|
|
93
|
+
* that record every rating, where a change would add a second one rather than replace the first.
|
|
94
|
+
*/
|
|
95
|
+
locked?: boolean;
|
|
91
96
|
strings?: Partial<MessageActionFeedbackStrings>;
|
|
92
97
|
}
|
|
93
98
|
/**
|
|
@@ -134,16 +134,17 @@ const DEFAULT_MESSAGE_ACTION_FEEDBACK_STRINGS = {
|
|
|
134
134
|
helpful: 'Helpful',
|
|
135
135
|
notHelpful: 'Not helpful'
|
|
136
136
|
};
|
|
137
|
-
const feedbackToggleClass = 'size-6 min-w-6 px-0 aria-pressed:bg-accent aria-pressed:text-accent-foreground future:aria-pressed:text-foreground';
|
|
138
|
-
const MessageActionFeedback = /*#__PURE__*/ forwardRef(({ value: valueProp, defaultValue = null, onChange, disabled, strings, className, 'aria-label': ariaLabel, ...props }, ref)=>{
|
|
137
|
+
const feedbackToggleClass = 'size-6 min-w-6 px-0 aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent aria-pressed:hover:text-accent-foreground aria-pressed:[&_svg]:stroke-primary future:aria-pressed:text-foreground future:aria-pressed:hover:text-foreground aria-disabled:cursor-default';
|
|
138
|
+
const MessageActionFeedback = /*#__PURE__*/ forwardRef(({ value: valueProp, defaultValue = null, onChange, disabled, locked = false, strings, className, 'aria-label': ariaLabel, ...props }, ref)=>{
|
|
139
139
|
const text = {
|
|
140
140
|
...DEFAULT_MESSAGE_ACTION_FEEDBACK_STRINGS,
|
|
141
141
|
...strings
|
|
142
142
|
};
|
|
143
143
|
const [uncontrolled, setUncontrolled] = useState(defaultValue);
|
|
144
144
|
const value = void 0 === valueProp ? uncontrolled : valueProp;
|
|
145
|
+
const final = locked && null !== value;
|
|
145
146
|
const set = (next)=>{
|
|
146
|
-
if (next === value) return;
|
|
147
|
+
if (final || next === value) return;
|
|
147
148
|
if (void 0 === valueProp) setUncontrolled(next);
|
|
148
149
|
onChange?.(next);
|
|
149
150
|
};
|
|
@@ -158,13 +159,14 @@ const MessageActionFeedback = /*#__PURE__*/ forwardRef(({ value: valueProp, defa
|
|
|
158
159
|
label: text.notHelpful,
|
|
159
160
|
icon: /*#__PURE__*/ jsx(ThumbsDown, {})
|
|
160
161
|
}
|
|
161
|
-
];
|
|
162
|
+
].filter(({ rating })=>!final || rating === value);
|
|
162
163
|
return /*#__PURE__*/ jsx("div", {
|
|
163
164
|
ref: ref,
|
|
164
165
|
role: "group",
|
|
165
166
|
"aria-label": ariaLabel ?? text.label,
|
|
166
167
|
"data-slot": "message-action-feedback",
|
|
167
168
|
"data-value": value ?? void 0,
|
|
169
|
+
"data-locked": final || void 0,
|
|
168
170
|
className: cn('flex items-center gap-0.5', className),
|
|
169
171
|
...props,
|
|
170
172
|
children: thumbs.map(({ rating, label, icon })=>/*#__PURE__*/ jsxs(Tooltip, {
|
|
@@ -179,6 +181,7 @@ const MessageActionFeedback = /*#__PURE__*/ forwardRef(({ value: valueProp, defa
|
|
|
179
181
|
pressed: value === rating,
|
|
180
182
|
onPressedChange: ()=>set(rating),
|
|
181
183
|
disabled: disabled,
|
|
184
|
+
"aria-disabled": final || void 0,
|
|
182
185
|
children: icon
|
|
183
186
|
})
|
|
184
187
|
}),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { QuickFormField } from './quick-form-field';
|
|
2
|
-
export type { QuickFieldType, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldModeSwitchConfirm, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './types';
|
|
2
|
+
export type { QuickFieldType, QuickFormFieldControlLayout, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldModeSwitchConfirm, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './types';
|
|
3
3
|
export { DEFAULT_QUICK_FORM_FIELD_STRINGS, FIELD_TYPE_META, FIELD_TYPE_ORDER } from './types';
|
|
@@ -54,7 +54,7 @@ const DEFAULT_VALUE_MODES = [
|
|
|
54
54
|
'literal',
|
|
55
55
|
'expression'
|
|
56
56
|
];
|
|
57
|
-
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, valueModes = DEFAULT_VALUE_MODES, confirmModeChange, renderExpressionEditor, renderModeControl, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
57
|
+
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, valueModes = DEFAULT_VALUE_MODES, confirmModeChange, renderExpressionEditor, renderModeControl, renderedControlLayout, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
58
58
|
const strings = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
59
59
|
...external_types_cjs_namespaceObject.DEFAULT_QUICK_FORM_FIELD_STRINGS,
|
|
60
60
|
...stringOverrides
|
|
@@ -159,6 +159,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
159
159
|
const modeControl = renderModeControl?.(mode, controlProps) ?? null;
|
|
160
160
|
const builtInVariable = null === modeControl && 'variable' === mode;
|
|
161
161
|
const builtInPrompt = null === modeControl && 'prompt' === mode;
|
|
162
|
+
const rendersOwnControl = null !== modeControl || 'expression' === mode && !!renderExpressionEditor;
|
|
162
163
|
const modeOnMount = (0, external_react_namespaceObject.useRef)(mode);
|
|
163
164
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
164
165
|
if (modeOnMount.current === mode) return;
|
|
@@ -425,7 +426,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
425
426
|
errorId: validationId,
|
|
426
427
|
disabled: disabled,
|
|
427
428
|
variant: builtInPrompt ? 'agent' : void 0,
|
|
428
|
-
layout: builtInPrompt || 'literal' === mode && ('file' === fieldType || 'textarea' === fieldType) ? 'grow' : 'row',
|
|
429
|
+
layout: builtInPrompt || 'literal' === mode && ('file' === fieldType || 'textarea' === fieldType) || rendersOwnControl && renderedControlLayout?.[mode] === 'grow' ? 'grow' : 'row',
|
|
429
430
|
children: [
|
|
430
431
|
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
431
432
|
align: "inline-start",
|
|
@@ -13,6 +13,7 @@ import type { QuickFormFieldProps } from './types';
|
|
|
13
13
|
* - Every mode has a built-in control: `variable` is a picker over
|
|
14
14
|
* `variables`, `prompt` an agent textarea. `valueModes` chooses which the
|
|
15
15
|
* menu offers, and `renderModeControl` replaces the control for any mode.
|
|
16
|
+
* `renderedControlLayout` lets a rendered control taller than a row grow the box.
|
|
16
17
|
* - `confirmModeChange` asks before a switch the consumer knows is lossy.
|
|
17
18
|
* - `locked` is configuration the author sets, so the value stays editable;
|
|
18
19
|
* `disabled` is what stops the author editing the field.
|
|
@@ -29,4 +30,4 @@ import type { QuickFormFieldProps } from './types';
|
|
|
29
30
|
* AI-assist button renders only with `onGenerateWithAi`, and file uploads
|
|
30
31
|
* aren't persisted anywhere.
|
|
31
32
|
*/
|
|
32
|
-
export declare function QuickFormField({ value, onValueChange, onValueBlur, locked, onLockedChange, showLock, disabled, leadingAddon, trailingAddon, more, mode, onModeChange, valueModes, confirmModeChange, renderExpressionEditor, renderModeControl, fieldType, fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions, options, onGenerateWithAi, onInsertVariable, variables, id, className, }: QuickFormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function QuickFormField({ value, onValueChange, onValueBlur, locked, onLockedChange, showLock, disabled, leadingAddon, trailingAddon, more, mode, onModeChange, valueModes, confirmModeChange, renderExpressionEditor, renderModeControl, renderedControlLayout, fieldType, fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions, options, onGenerateWithAi, onInsertVariable, variables, id, className, }: QuickFormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,7 +26,7 @@ const DEFAULT_VALUE_MODES = [
|
|
|
26
26
|
'literal',
|
|
27
27
|
'expression'
|
|
28
28
|
];
|
|
29
|
-
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, valueModes = DEFAULT_VALUE_MODES, confirmModeChange, renderExpressionEditor, renderModeControl, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
29
|
+
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, valueModes = DEFAULT_VALUE_MODES, confirmModeChange, renderExpressionEditor, renderModeControl, renderedControlLayout, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
30
30
|
const strings = useMemo(()=>({
|
|
31
31
|
...DEFAULT_QUICK_FORM_FIELD_STRINGS,
|
|
32
32
|
...stringOverrides
|
|
@@ -131,6 +131,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
131
131
|
const modeControl = renderModeControl?.(mode, controlProps) ?? null;
|
|
132
132
|
const builtInVariable = null === modeControl && 'variable' === mode;
|
|
133
133
|
const builtInPrompt = null === modeControl && 'prompt' === mode;
|
|
134
|
+
const rendersOwnControl = null !== modeControl || 'expression' === mode && !!renderExpressionEditor;
|
|
134
135
|
const modeOnMount = useRef(mode);
|
|
135
136
|
useEffect(()=>{
|
|
136
137
|
if (modeOnMount.current === mode) return;
|
|
@@ -397,7 +398,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
397
398
|
errorId: validationId,
|
|
398
399
|
disabled: disabled,
|
|
399
400
|
variant: builtInPrompt ? 'agent' : void 0,
|
|
400
|
-
layout: builtInPrompt || 'literal' === mode && ('file' === fieldType || 'textarea' === fieldType) ? 'grow' : 'row',
|
|
401
|
+
layout: builtInPrompt || 'literal' === mode && ('file' === fieldType || 'textarea' === fieldType) || rendersOwnControl && renderedControlLayout?.[mode] === 'grow' ? 'grow' : 'row',
|
|
401
402
|
children: [
|
|
402
403
|
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
403
404
|
align: "inline-start",
|
|
@@ -128,6 +128,8 @@ export interface VariableInsertContext {
|
|
|
128
128
|
end: number;
|
|
129
129
|
} | null;
|
|
130
130
|
}
|
|
131
|
+
/** How the value box sizes around a consumer-rendered control. See `renderedControlLayout`. */
|
|
132
|
+
export type QuickFormFieldControlLayout = 'row' | 'grow';
|
|
131
133
|
/** What a consumer-rendered value control receives from `renderModeControl` or `renderExpressionEditor`. */
|
|
132
134
|
export interface QuickFormFieldControlProps {
|
|
133
135
|
id: string;
|
|
@@ -204,6 +206,15 @@ export interface QuickFormFieldProps {
|
|
|
204
206
|
* returns something for `expression`.
|
|
205
207
|
*/
|
|
206
208
|
renderExpressionEditor?: (props: QuickFormFieldControlProps) => ReactNode;
|
|
209
|
+
/**
|
|
210
|
+
* How the value box sizes around a control you render, per mode: one from
|
|
211
|
+
* `renderModeControl`, or from `renderExpressionEditor` in `expression`.
|
|
212
|
+
* `grow` lets a control taller than one row, such as a multi-line editor,
|
|
213
|
+
* grow the box, with the addons staying on its first line. Only the consumer
|
|
214
|
+
* knows whether its control grows. Unlisted modes and the built-in controls
|
|
215
|
+
* keep their own sizing.
|
|
216
|
+
*/
|
|
217
|
+
renderedControlLayout?: Partial<Record<QuickFormFieldMode, QuickFormFieldControlLayout>>;
|
|
207
218
|
/**
|
|
208
219
|
* Renders the value control for a given mode, replacing the built-in one,
|
|
209
220
|
* such as a surface that authors its own choices in `literal` mode.
|
package/dist/index.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ export type { PromptSuggestionItem, PromptSuggestionsDensity, PromptSuggestionsO
|
|
|
149
149
|
export { DEFAULT_PROMPT_SUGGESTIONS_STRINGS, PromptSuggestions, promptSuggestionsListVariants, promptSuggestionVariants, } from './components/ui/prompt-suggestions';
|
|
150
150
|
export type { PromptValueControlProps } from './components/ui/prompt-value-control';
|
|
151
151
|
export { PromptValueControl } from './components/ui/prompt-value-control';
|
|
152
|
-
export type { QuickFieldType, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldModeSwitchConfirm, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './components/ui/quick-form-field';
|
|
152
|
+
export type { QuickFieldType, QuickFormFieldControlLayout, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldModeSwitchConfirm, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './components/ui/quick-form-field';
|
|
153
153
|
export { DEFAULT_QUICK_FORM_FIELD_STRINGS, FIELD_TYPE_META, FIELD_TYPE_ORDER, QuickFormField, } from './components/ui/quick-form-field';
|
|
154
154
|
export { RadioGroup, RadioGroupItem } from './components/ui/radio-group';
|
|
155
155
|
export { ReferenceChip, type ReferenceChipProps } from './components/ui/reference-chip';
|
package/dist/styles.css
CHANGED
|
@@ -7902,6 +7902,11 @@
|
|
|
7902
7902
|
pointer-events: none;
|
|
7903
7903
|
}
|
|
7904
7904
|
}
|
|
7905
|
+
.aria-disabled\:cursor-default {
|
|
7906
|
+
&[aria-disabled="true"] {
|
|
7907
|
+
cursor: default;
|
|
7908
|
+
}
|
|
7909
|
+
}
|
|
7905
7910
|
.aria-disabled\:cursor-not-allowed {
|
|
7906
7911
|
&[aria-disabled="true"] {
|
|
7907
7912
|
cursor: not-allowed;
|
|
@@ -7943,6 +7948,24 @@
|
|
|
7943
7948
|
color: var(--accent-foreground);
|
|
7944
7949
|
}
|
|
7945
7950
|
}
|
|
7951
|
+
.aria-pressed\:hover\:bg-accent {
|
|
7952
|
+
&[aria-pressed="true"] {
|
|
7953
|
+
&:hover {
|
|
7954
|
+
@media (hover: hover) {
|
|
7955
|
+
background-color: var(--accent);
|
|
7956
|
+
}
|
|
7957
|
+
}
|
|
7958
|
+
}
|
|
7959
|
+
}
|
|
7960
|
+
.aria-pressed\:hover\:text-accent-foreground {
|
|
7961
|
+
&[aria-pressed="true"] {
|
|
7962
|
+
&:hover {
|
|
7963
|
+
@media (hover: hover) {
|
|
7964
|
+
color: var(--accent-foreground);
|
|
7965
|
+
}
|
|
7966
|
+
}
|
|
7967
|
+
}
|
|
7968
|
+
}
|
|
7946
7969
|
.aria-selected\:border-b-2 {
|
|
7947
7970
|
&[aria-selected="true"] {
|
|
7948
7971
|
border-bottom-style: var(--tw-border-style);
|
|
@@ -9655,6 +9678,17 @@
|
|
|
9655
9678
|
}
|
|
9656
9679
|
}
|
|
9657
9680
|
}
|
|
9681
|
+
.future\:aria-pressed\:hover\:text-foreground {
|
|
9682
|
+
:is(.future-dark, .future-light) & {
|
|
9683
|
+
&[aria-pressed="true"] {
|
|
9684
|
+
&:hover {
|
|
9685
|
+
@media (hover: hover) {
|
|
9686
|
+
color: var(--foreground);
|
|
9687
|
+
}
|
|
9688
|
+
}
|
|
9689
|
+
}
|
|
9690
|
+
}
|
|
9691
|
+
}
|
|
9658
9692
|
.future\:data-\[state\=checked\]\:border-foreground-accent {
|
|
9659
9693
|
:is(.future-dark, .future-light) & {
|
|
9660
9694
|
&[data-state="checked"] {
|
|
@@ -10056,6 +10090,13 @@
|
|
|
10056
10090
|
flex-shrink: 0;
|
|
10057
10091
|
}
|
|
10058
10092
|
}
|
|
10093
|
+
.aria-pressed\:\[\&_svg\]\:stroke-primary {
|
|
10094
|
+
&[aria-pressed="true"] {
|
|
10095
|
+
& svg {
|
|
10096
|
+
stroke: var(--primary);
|
|
10097
|
+
}
|
|
10098
|
+
}
|
|
10099
|
+
}
|
|
10059
10100
|
.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 {
|
|
10060
10101
|
& svg:not([class*='size-']) {
|
|
10061
10102
|
width: calc(var(--spacing) * 4);
|