@uipath/apollo-wind 2.55.0 → 2.57.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/combobox.cjs +33 -15
- package/dist/components/ui/combobox.js +33 -15
- package/dist/components/ui/date-picker.cjs +62 -26
- package/dist/components/ui/date-picker.js +62 -26
- package/dist/components/ui/datetime-picker.cjs +29 -12
- package/dist/components/ui/datetime-picker.js +29 -12
- package/dist/components/ui/dropdown-menu.cjs +12 -8
- package/dist/components/ui/dropdown-menu.js +12 -8
- package/dist/components/ui/field-actions/ai-assist-action.cjs +121 -0
- package/dist/components/ui/field-actions/ai-assist-action.d.ts +21 -0
- package/dist/components/ui/field-actions/ai-assist-action.js +84 -0
- package/dist/components/ui/field-actions/collapse.cjs +44 -0
- package/dist/components/ui/field-actions/collapse.d.ts +6 -0
- package/dist/components/ui/field-actions/collapse.js +4 -0
- package/dist/components/ui/field-actions/index.cjs +46 -0
- package/dist/components/ui/field-actions/index.d.ts +2 -0
- package/dist/components/ui/field-actions/index.js +3 -0
- package/dist/components/ui/field-actions/insert-variable-action.cjs +94 -0
- package/dist/components/ui/field-actions/insert-variable-action.d.ts +22 -0
- package/dist/components/ui/field-actions/insert-variable-action.js +57 -0
- package/dist/components/ui/field-addons/index.cjs +50 -0
- package/dist/components/ui/field-addons/index.d.ts +3 -0
- package/dist/components/ui/field-addons/index.js +4 -0
- package/dist/components/ui/field-addons/value-mode-indicator.cjs +57 -0
- package/dist/components/ui/field-addons/value-mode-indicator.d.ts +13 -0
- package/dist/components/ui/field-addons/value-mode-indicator.js +23 -0
- package/dist/components/ui/field-addons/value-mode-menu.cjs +149 -0
- package/dist/components/ui/field-addons/value-mode-menu.d.ts +69 -0
- package/dist/components/ui/field-addons/value-mode-menu.js +112 -0
- package/dist/components/ui/field-addons/value-mode-strings.cjs +69 -0
- package/dist/components/ui/field-addons/value-mode-strings.d.ts +32 -0
- package/dist/components/ui/field-addons/value-mode-strings.js +29 -0
- package/dist/components/ui/form-field.cjs +42 -5
- package/dist/components/ui/form-field.d.ts +21 -1
- package/dist/components/ui/form-field.js +36 -2
- package/dist/components/ui/index.cjs +156 -126
- package/dist/components/ui/index.d.ts +3 -0
- package/dist/components/ui/index.js +3 -0
- package/dist/components/ui/input-group-context.cjs +91 -0
- package/dist/components/ui/input-group-context.d.ts +69 -0
- package/dist/components/ui/input-group-context.js +42 -0
- package/dist/components/ui/input-group.cjs +303 -56
- package/dist/components/ui/input-group.d.ts +70 -3
- package/dist/components/ui/input-group.js +285 -56
- package/dist/components/ui/input.cjs +28 -17
- package/dist/components/ui/input.js +28 -17
- package/dist/components/ui/lockable-value-field/components/field-header.cjs +16 -114
- package/dist/components/ui/lockable-value-field/components/field-header.js +14 -112
- package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +4 -12
- package/dist/components/ui/lockable-value-field/lockable-value-field.js +4 -12
- package/dist/components/ui/model-picker/ModelPicker.cjs +495 -0
- package/dist/components/ui/model-picker/ModelPicker.d.ts +304 -0
- package/dist/components/ui/model-picker/ModelPicker.js +451 -0
- package/dist/components/ui/model-picker/ModelTagChip.cjs +101 -0
- package/dist/components/ui/model-picker/ModelTagChip.d.ts +29 -0
- package/dist/components/ui/model-picker/ModelTagChip.js +67 -0
- package/dist/components/ui/model-picker/badges.cjs +52 -0
- package/dist/components/ui/model-picker/badges.d.ts +41 -0
- package/dist/components/ui/model-picker/badges.js +18 -0
- package/dist/components/ui/model-picker/index.cjs +117 -0
- package/dist/components/ui/model-picker/index.d.ts +27 -0
- package/dist/components/ui/model-picker/index.js +14 -0
- package/dist/components/ui/model-picker/labels.cjs +107 -0
- package/dist/components/ui/model-picker/labels.d.ts +81 -0
- package/dist/components/ui/model-picker/labels.js +67 -0
- package/dist/components/ui/model-picker/primitives/FolderSwitcher.cjs +108 -0
- package/dist/components/ui/model-picker/primitives/FolderSwitcher.d.ts +38 -0
- package/dist/components/ui/model-picker/primitives/FolderSwitcher.js +74 -0
- package/dist/components/ui/model-picker/primitives/GroupHeader.cjs +84 -0
- package/dist/components/ui/model-picker/primitives/GroupHeader.d.ts +64 -0
- package/dist/components/ui/model-picker/primitives/GroupHeader.js +50 -0
- package/dist/components/ui/model-picker/primitives/ModelOptionRow.cjs +178 -0
- package/dist/components/ui/model-picker/primitives/ModelOptionRow.d.ts +95 -0
- package/dist/components/ui/model-picker/primitives/ModelOptionRow.js +135 -0
- package/dist/components/ui/model-picker/primitives/OptionList.cjs +295 -0
- package/dist/components/ui/model-picker/primitives/OptionList.d.ts +87 -0
- package/dist/components/ui/model-picker/primitives/OptionList.js +242 -0
- package/dist/components/ui/{lockable-value-field/components/mode-menu-item.cjs → model-picker/primitives/PickerPopup.cjs} +25 -24
- package/dist/components/ui/model-picker/primitives/PickerPopup.d.ts +39 -0
- package/dist/components/ui/model-picker/primitives/PickerPopup.js +30 -0
- package/dist/components/ui/model-picker/primitives/PickerSearchInput.cjs +77 -0
- package/dist/components/ui/model-picker/primitives/PickerSearchInput.d.ts +43 -0
- package/dist/components/ui/model-picker/primitives/PickerSearchInput.js +43 -0
- package/dist/components/ui/model-picker/primitives/PickerTrigger.cjs +112 -0
- package/dist/components/ui/model-picker/primitives/PickerTrigger.d.ts +73 -0
- package/dist/components/ui/model-picker/primitives/PickerTrigger.js +78 -0
- package/dist/components/ui/model-picker/types.cjs +18 -0
- package/dist/components/ui/model-picker/types.d.ts +154 -0
- package/dist/components/ui/model-picker/types.js +0 -0
- package/dist/components/ui/model-picker/useModelPickerState.cjs +250 -0
- package/dist/components/ui/model-picker/useModelPickerState.d.ts +135 -0
- package/dist/components/ui/model-picker/useModelPickerState.js +216 -0
- package/dist/components/ui/model-picker/utils.cjs +327 -0
- package/dist/components/ui/model-picker/utils.d.ts +121 -0
- package/dist/components/ui/model-picker/utils.js +272 -0
- package/dist/components/ui/multi-select.cjs +82 -58
- package/dist/components/ui/multi-select.js +84 -60
- package/dist/components/ui/popover.cjs +13 -9
- package/dist/components/ui/popover.js +13 -9
- package/dist/components/ui/select.cjs +89 -27
- package/dist/components/ui/select.d.ts +4 -0
- package/dist/components/ui/select.js +90 -28
- package/dist/components/ui/textarea.cjs +16 -11
- package/dist/components/ui/textarea.js +16 -11
- package/dist/index.cjs +144 -21
- package/dist/index.d.ts +10 -4
- package/dist/index.js +6 -3
- package/dist/styles.css +350 -5
- package/package.json +2 -1
- package/dist/components/ui/lockable-value-field/components/mode-menu-item.d.ts +0 -9
- package/dist/components/ui/lockable-value-field/components/mode-menu-item.js +0 -29
|
@@ -24,136 +24,383 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
|
|
27
|
+
inputGroupVariants: ()=>inputGroupVariants,
|
|
28
28
|
InputGroupText: ()=>InputGroupText,
|
|
29
29
|
InputGroupAddon: ()=>InputGroupAddon,
|
|
30
|
+
InputGroupPopoverTrigger: ()=>InputGroupPopoverTrigger,
|
|
31
|
+
InputGroupTextarea: ()=>InputGroupTextarea,
|
|
32
|
+
InputGroupBody: ()=>InputGroupBody,
|
|
33
|
+
InputGroupButton: ()=>InputGroupButton,
|
|
34
|
+
InputGroupRow: ()=>InputGroupRow,
|
|
30
35
|
InputGroup: ()=>InputGroup,
|
|
36
|
+
InputGroupTrigger: ()=>InputGroupTrigger,
|
|
31
37
|
InputGroupInput: ()=>InputGroupInput,
|
|
32
|
-
|
|
38
|
+
useInputGroup: ()=>external_input_group_context_cjs_namespaceObject.useInputGroup
|
|
33
39
|
});
|
|
34
40
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
35
41
|
const external_class_variance_authority_namespaceObject = require("class-variance-authority");
|
|
42
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
36
43
|
const external_react_namespaceObject = require("react");
|
|
37
44
|
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
38
45
|
const external_input_cjs_namespaceObject = require("./input.cjs");
|
|
46
|
+
const external_popover_cjs_namespaceObject = require("./popover.cjs");
|
|
39
47
|
const external_textarea_cjs_namespaceObject = require("./textarea.cjs");
|
|
40
48
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
41
49
|
const external_form_field_cjs_namespaceObject = require("./form-field.cjs");
|
|
42
|
-
const
|
|
43
|
-
const
|
|
50
|
+
const external_input_group_context_cjs_namespaceObject = require("./input-group-context.cjs");
|
|
51
|
+
const ROW_LAYOUTS = [
|
|
52
|
+
'row',
|
|
53
|
+
'grow',
|
|
54
|
+
'fill'
|
|
55
|
+
];
|
|
56
|
+
const FILLED = [
|
|
57
|
+
'default',
|
|
58
|
+
'ghost'
|
|
59
|
+
];
|
|
60
|
+
const BOXED = [
|
|
61
|
+
'default',
|
|
62
|
+
'ghost',
|
|
63
|
+
'outline'
|
|
64
|
+
];
|
|
65
|
+
const inputGroupVariants = (0, external_class_variance_authority_namespaceObject.cva)([
|
|
66
|
+
'group/input-group relative flex w-full items-center gap-2 transition-colors has-[>textarea]:h-auto has-[>textarea]:items-start',
|
|
67
|
+
'has-[[data-slot=input-group-control]:disabled]:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:opacity-50'
|
|
68
|
+
], {
|
|
69
|
+
variants: {
|
|
70
|
+
size: {
|
|
71
|
+
default: 'h-9 rounded-md px-3 py-1 future:h-10 future:rounded-xl future:py-2 has-[>[data-slot=input-group-addon][data-align=inline-end]]:pr-2 future:has-[>[data-slot=input-group-addon][data-align=inline-end]]:pr-2',
|
|
72
|
+
xs: 'h-6 gap-1 rounded px-2'
|
|
73
|
+
},
|
|
74
|
+
layout: {
|
|
75
|
+
row: '',
|
|
76
|
+
grow: 'h-auto min-h-9 future:h-auto future:min-h-10',
|
|
77
|
+
block: 'h-auto flex-col items-stretch gap-0 overflow-hidden p-0 future:h-auto future:p-0',
|
|
78
|
+
fill: 'h-auto min-h-9 items-stretch py-0 pl-0 pr-0 future:h-auto future:min-h-10 future:py-0 future:pl-0 future:pr-0'
|
|
79
|
+
},
|
|
80
|
+
variant: {
|
|
81
|
+
default: 'border border-input bg-transparent future:border-0 future:bg-surface-overlay',
|
|
82
|
+
ghost: 'border-0 bg-surface-overlay',
|
|
83
|
+
outline: 'border border-input bg-transparent shadow-none future:border future:border-input future:bg-transparent future:has-[[data-slot][aria-invalid=true]]:border-error',
|
|
84
|
+
none: 'border-0 bg-transparent shadow-none future:bg-transparent'
|
|
85
|
+
},
|
|
86
|
+
invalid: {
|
|
87
|
+
true: '',
|
|
88
|
+
false: ''
|
|
89
|
+
},
|
|
90
|
+
disabled: {
|
|
91
|
+
true: 'cursor-not-allowed opacity-50',
|
|
92
|
+
false: ''
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
compoundVariants: [
|
|
96
|
+
{
|
|
97
|
+
variant: 'none',
|
|
98
|
+
layout: ROW_LAYOUTS,
|
|
99
|
+
class: 'px-0 pr-3'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
layout: ROW_LAYOUTS,
|
|
103
|
+
class: 'has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]_:focus-visible]:ring-2 has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]:focus-visible]:ring-error has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]_:focus-visible]:ring-error future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-2 future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-background future:has-[[data-slot=input-group-control]_:focus-visible]:ring-offset-2 future:has-[[data-slot=input-group-control]_:focus-visible]:ring-offset-background'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
layout: ROW_LAYOUTS,
|
|
107
|
+
invalid: false,
|
|
108
|
+
class: 'has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]_:focus-visible]:ring-ring'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
layout: ROW_LAYOUTS,
|
|
112
|
+
invalid: true,
|
|
113
|
+
class: 'has-[[data-slot=input-group-control]:focus-visible]:ring-error has-[[data-slot=input-group-control]_:focus-visible]:ring-error'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
variant: BOXED,
|
|
117
|
+
class: 'has-[[data-slot][aria-invalid=true]]:border-error'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
variant: BOXED,
|
|
121
|
+
invalid: true,
|
|
122
|
+
class: 'border-error'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
variant: 'outline',
|
|
126
|
+
invalid: true,
|
|
127
|
+
class: 'future:border-error'
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
variant: FILLED,
|
|
131
|
+
class: 'has-[[data-slot][aria-invalid=true]]:ring-error/20 future:has-[[data-slot][aria-invalid=true]]:ring-1 future:has-[[data-slot][aria-invalid=true]]:ring-error/40'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
variant: FILLED,
|
|
135
|
+
invalid: true,
|
|
136
|
+
class: 'ring-error/20 future:ring-1 future:ring-error/40'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
variant: FILLED,
|
|
140
|
+
layout: ROW_LAYOUTS,
|
|
141
|
+
class: 'has-[button[data-slot=input-group-control]:not(:disabled):hover]:bg-accent future:has-[button[data-slot=input-group-control]:not(:disabled):hover]:bg-surface-hover'
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
defaultVariants: {
|
|
145
|
+
size: 'default',
|
|
146
|
+
layout: 'row',
|
|
147
|
+
variant: 'default',
|
|
148
|
+
invalid: false,
|
|
149
|
+
disabled: false
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
const InputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, error, errorId, variant = 'default', size = 'default', layout = 'row', invalid, disabled, ...props }, ref)=>{
|
|
44
153
|
const generatedId = external_react_namespaceObject.useId();
|
|
45
154
|
const validationId = errorId ?? `input-group-${generatedId.replace(/:/g, '')}-error`;
|
|
46
|
-
|
|
47
|
-
|
|
155
|
+
const flagged = Boolean(invalid || error);
|
|
156
|
+
const [controlError, setControlError] = external_react_namespaceObject.useState();
|
|
157
|
+
const boxRef = external_react_namespaceObject.useRef(null);
|
|
158
|
+
const setBox = external_react_namespaceObject.useCallback((node)=>{
|
|
159
|
+
boxRef.current = node;
|
|
160
|
+
if ('function' == typeof ref) ref(node);
|
|
161
|
+
else if (ref) ref.current = node;
|
|
162
|
+
}, [
|
|
163
|
+
ref
|
|
164
|
+
]);
|
|
165
|
+
const group = external_react_namespaceObject.useMemo(()=>({
|
|
166
|
+
inGroup: true,
|
|
167
|
+
layout,
|
|
48
168
|
error,
|
|
49
|
-
errorId: validationId
|
|
50
|
-
|
|
169
|
+
errorId: validationId,
|
|
170
|
+
invalid,
|
|
171
|
+
disabled,
|
|
172
|
+
anchor: boxRef,
|
|
173
|
+
reportError: setControlError
|
|
174
|
+
}), [
|
|
175
|
+
layout,
|
|
176
|
+
error,
|
|
177
|
+
validationId,
|
|
178
|
+
invalid,
|
|
179
|
+
disabled
|
|
180
|
+
]);
|
|
181
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
|
|
182
|
+
value: group,
|
|
51
183
|
children: [
|
|
52
184
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
53
|
-
ref:
|
|
185
|
+
ref: setBox,
|
|
54
186
|
role: "group",
|
|
55
|
-
|
|
187
|
+
"data-slot": "input-group",
|
|
188
|
+
"data-layout": layout,
|
|
189
|
+
"data-invalid": flagged ? '' : void 0,
|
|
190
|
+
"data-disabled": disabled ? '' : void 0,
|
|
191
|
+
"aria-disabled": disabled || void 0,
|
|
192
|
+
className: (0, index_cjs_namespaceObject.cn)(inputGroupVariants({
|
|
193
|
+
size,
|
|
194
|
+
layout,
|
|
195
|
+
variant,
|
|
196
|
+
invalid: flagged,
|
|
197
|
+
disabled
|
|
198
|
+
}), className),
|
|
56
199
|
...props
|
|
57
200
|
}),
|
|
58
201
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
59
202
|
id: validationId,
|
|
60
|
-
children: error
|
|
203
|
+
children: error || controlError
|
|
61
204
|
})
|
|
62
205
|
]
|
|
63
206
|
});
|
|
64
207
|
});
|
|
65
208
|
InputGroup.displayName = 'InputGroup';
|
|
66
|
-
const inputGroupAddonVariants = (0, external_class_variance_authority_namespaceObject.cva)('flex h-auto cursor-text items-center justify-center gap-1 text-sm text-muted-foreground select-none group-has-[[data-slot=input-group-control]:disabled]/input-group:opacity-50 [&>svg:not([class*="size-"])]:size-4', {
|
|
209
|
+
const inputGroupAddonVariants = (0, external_class_variance_authority_namespaceObject.cva)('flex h-auto cursor-text empty:hidden items-center justify-center gap-1 text-sm text-muted-foreground select-none group-has-[[data-slot=input-group-control]:disabled]/input-group:opacity-50 [&>svg:not([class*="size-"])]:size-4', {
|
|
67
210
|
variants: {
|
|
68
211
|
align: {
|
|
69
212
|
'inline-start': 'order-first',
|
|
70
|
-
'inline-end': 'order-last'
|
|
213
|
+
'inline-end': 'order-last ml-auto'
|
|
214
|
+
},
|
|
215
|
+
layout: {
|
|
216
|
+
row: '',
|
|
217
|
+
grow: 'shrink-0 self-stretch max-h-6.5 future:max-h-6',
|
|
218
|
+
block: 'shrink-0 self-stretch max-h-9 future:max-h-10',
|
|
219
|
+
fill: 'shrink-0 self-stretch max-h-9 future:max-h-10'
|
|
71
220
|
}
|
|
72
221
|
},
|
|
73
222
|
defaultVariants: {
|
|
74
|
-
align: 'inline-start'
|
|
223
|
+
align: 'inline-start',
|
|
224
|
+
layout: 'row'
|
|
75
225
|
}
|
|
76
226
|
});
|
|
77
|
-
const
|
|
227
|
+
const ADDON_INTERACTIVE = 'button, a[href], input, textarea, select, [contenteditable], [tabindex]';
|
|
228
|
+
const InputGroupAddon = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, align = 'inline-start', focusControlOnClick = true, onClick, ...props }, ref)=>{
|
|
229
|
+
const { layout, disabled } = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
|
|
230
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
|
|
231
|
+
value: disabled ? external_input_group_context_cjs_namespaceObject.NO_GROUP_DISABLED : external_input_group_context_cjs_namespaceObject.NO_GROUP,
|
|
232
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
233
|
+
ref: ref,
|
|
234
|
+
role: "group",
|
|
235
|
+
"data-slot": "input-group-addon",
|
|
236
|
+
"data-align": align,
|
|
237
|
+
className: (0, index_cjs_namespaceObject.cn)(inputGroupAddonVariants({
|
|
238
|
+
align,
|
|
239
|
+
layout
|
|
240
|
+
}), className),
|
|
241
|
+
onClick: (e)=>{
|
|
242
|
+
const hit = e.target.closest(ADDON_INTERACTIVE);
|
|
243
|
+
if (focusControlOnClick && !(hit && e.currentTarget.contains(hit))) e.currentTarget.parentElement?.querySelector('[data-slot=input-group-control]')?.focus();
|
|
244
|
+
onClick?.(e);
|
|
245
|
+
},
|
|
246
|
+
...props
|
|
247
|
+
})
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
InputGroupAddon.displayName = 'InputGroupAddon';
|
|
251
|
+
const InputGroupRow = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
78
252
|
ref: ref,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"data-align": align,
|
|
82
|
-
className: (0, index_cjs_namespaceObject.cn)(inputGroupAddonVariants({
|
|
83
|
-
align
|
|
84
|
-
}), className),
|
|
85
|
-
onClick: (e)=>{
|
|
86
|
-
if (!e.target.closest('button')) e.currentTarget.parentElement?.querySelector('input, textarea')?.focus();
|
|
87
|
-
onClick?.(e);
|
|
88
|
-
},
|
|
253
|
+
"data-slot": "input-group-row",
|
|
254
|
+
className: (0, index_cjs_namespaceObject.cn)('flex min-h-9 min-w-0 items-stretch gap-2 px-3 has-[>[data-slot=input-group-addon][data-align=inline-end]]:pr-2 future:min-h-10', 'rounded-[inherit] has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-inset has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]_:focus-visible]:ring-2 has-[[data-slot=input-group-control]_:focus-visible]:ring-inset has-[[data-slot=input-group-control]_:focus-visible]:ring-ring has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]:focus-visible]:ring-error has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]_:focus-visible]:ring-error', className),
|
|
89
255
|
...props
|
|
90
256
|
}));
|
|
91
|
-
|
|
92
|
-
const
|
|
257
|
+
InputGroupRow.displayName = 'InputGroupRow';
|
|
258
|
+
const InputGroupBody = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>{
|
|
259
|
+
const { disabled } = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
|
|
260
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
|
|
261
|
+
value: disabled ? external_input_group_context_cjs_namespaceObject.NO_GROUP_DISABLED : external_input_group_context_cjs_namespaceObject.NO_GROUP,
|
|
262
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
263
|
+
ref: ref,
|
|
264
|
+
"data-slot": "input-group-body",
|
|
265
|
+
className: (0, index_cjs_namespaceObject.cn)('border-t empty:border-t-0 has-[>[hidden]]:border-t-0', className),
|
|
266
|
+
...props
|
|
267
|
+
})
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
InputGroupBody.displayName = 'InputGroupBody';
|
|
271
|
+
const InputGroupButton = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, type = 'button', variant = 'ghost', size = 'xs', disabled, ...props }, ref)=>{
|
|
272
|
+
const group = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
|
|
273
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
93
274
|
ref: ref,
|
|
94
275
|
type: type,
|
|
95
276
|
variant: variant,
|
|
96
277
|
size: size,
|
|
278
|
+
disabled: disabled || group.disabled,
|
|
97
279
|
className: (0, index_cjs_namespaceObject.cn)('gap-1', className),
|
|
98
280
|
...props
|
|
99
|
-
})
|
|
281
|
+
});
|
|
282
|
+
});
|
|
100
283
|
InputGroupButton.displayName = 'InputGroupButton';
|
|
284
|
+
const inputGroupTriggerVariants = (0, external_class_variance_authority_namespaceObject.cva)('flex w-full min-w-0 flex-1 gap-2 rounded-none border-0 bg-transparent text-left font-normal shadow-none hover:bg-transparent focus-visible:ring-offset-0 future:text-foreground future:hover:text-foreground', {
|
|
285
|
+
variants: {
|
|
286
|
+
layout: {
|
|
287
|
+
row: 'h-full min-h-5 justify-between p-0 focus-visible:ring-0',
|
|
288
|
+
block: 'h-auto min-h-9 justify-start px-0 focus-visible:ring-0 future:min-h-10'
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
defaultVariants: {
|
|
292
|
+
layout: 'row'
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
const InputGroupTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, type = 'button', disabled, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, ...props }, ref)=>{
|
|
296
|
+
const group = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
|
|
297
|
+
const { layout } = group;
|
|
298
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
299
|
+
ref: ref,
|
|
300
|
+
type: type,
|
|
301
|
+
variant: "ghost",
|
|
302
|
+
disabled: disabled || group.disabled,
|
|
303
|
+
className: (0, index_cjs_namespaceObject.cn)(inputGroupTriggerVariants({
|
|
304
|
+
layout: 'block' === layout ? 'block' : 'row'
|
|
305
|
+
}), className),
|
|
306
|
+
...props,
|
|
307
|
+
...(0, external_input_group_context_cjs_namespaceObject.controlValidation)(group, {
|
|
308
|
+
'aria-invalid': ariaInvalid,
|
|
309
|
+
'aria-describedby': ariaDescribedBy,
|
|
310
|
+
'aria-errormessage': ariaErrorMessage
|
|
311
|
+
}),
|
|
312
|
+
"data-slot": "input-group-control"
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
InputGroupTrigger.displayName = 'InputGroupTrigger';
|
|
316
|
+
function isEmpty(children) {
|
|
317
|
+
return null == children || false === children || '' === children;
|
|
318
|
+
}
|
|
319
|
+
const InputGroupPopoverTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ children, placeholder, caret = true, ...props }, ref)=>{
|
|
320
|
+
const { anchor } = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
|
|
321
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
322
|
+
children: [
|
|
323
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
|
|
324
|
+
asChild: true,
|
|
325
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(InputGroupTrigger, {
|
|
326
|
+
ref: ref,
|
|
327
|
+
...props,
|
|
328
|
+
children: [
|
|
329
|
+
isEmpty(children) ? void 0 !== placeholder && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
330
|
+
"data-slot": "input-group-placeholder",
|
|
331
|
+
className: "truncate text-muted-foreground",
|
|
332
|
+
children: placeholder
|
|
333
|
+
}) : children,
|
|
334
|
+
caret && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
|
|
335
|
+
className: "ml-auto shrink-0 text-muted-foreground"
|
|
336
|
+
})
|
|
337
|
+
]
|
|
338
|
+
})
|
|
339
|
+
}),
|
|
340
|
+
anchor && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverAnchor, {
|
|
341
|
+
virtualRef: anchor
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
InputGroupPopoverTrigger.displayName = 'InputGroupPopoverTrigger';
|
|
101
347
|
const InputGroupText = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
102
348
|
ref: ref,
|
|
103
349
|
className: (0, index_cjs_namespaceObject.cn)('flex items-center gap-1 text-sm text-muted-foreground [&>svg:not([class*="size-"])]:size-4', className),
|
|
104
350
|
...props
|
|
105
351
|
}));
|
|
106
352
|
InputGroupText.displayName = 'InputGroupText';
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
114
|
-
|
|
353
|
+
const FORCED_GROUP = {
|
|
354
|
+
...external_input_group_context_cjs_namespaceObject.NO_GROUP,
|
|
355
|
+
inGroup: true
|
|
356
|
+
};
|
|
357
|
+
const InputGroupInput = /*#__PURE__*/ external_react_namespaceObject.forwardRef((props, ref)=>{
|
|
358
|
+
const group = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
|
|
359
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
|
|
360
|
+
value: group.inGroup ? group : FORCED_GROUP,
|
|
115
361
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_cjs_namespaceObject.Input, {
|
|
116
362
|
ref: ref,
|
|
117
|
-
"data-slot": "input-group-control",
|
|
118
|
-
"aria-describedby": describedBy || void 0,
|
|
119
|
-
"aria-errormessage": validation.error ? validation.errorId : ariaErrorMessage,
|
|
120
|
-
"aria-invalid": validation.error ? true : ariaInvalid,
|
|
121
|
-
className: (0, index_cjs_namespaceObject.cn)('h-full w-full rounded-none !border-0 !ring-0 bg-transparent p-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:h-full future:rounded-none future:border-0 future:bg-transparent future:p-0 future:focus-visible:ring-offset-0', className),
|
|
122
363
|
...props
|
|
123
364
|
})
|
|
124
365
|
});
|
|
125
366
|
});
|
|
126
367
|
InputGroupInput.displayName = 'InputGroupInput';
|
|
127
|
-
const InputGroupTextarea = /*#__PURE__*/ external_react_namespaceObject.forwardRef((
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"data-slot": "input-group-control",
|
|
136
|
-
"aria-describedby": describedBy || void 0,
|
|
137
|
-
"aria-errormessage": validation.error ? validation.errorId : ariaErrorMessage,
|
|
138
|
-
"aria-invalid": validation.error ? true : ariaInvalid,
|
|
139
|
-
className: (0, index_cjs_namespaceObject.cn)('min-h-0 flex-1 resize-none rounded-none !border-0 !ring-0 bg-transparent p-0 py-2 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:rounded-none future:border-0 future:bg-transparent future:focus-visible:ring-offset-0', className),
|
|
140
|
-
...props
|
|
368
|
+
const InputGroupTextarea = /*#__PURE__*/ external_react_namespaceObject.forwardRef((props, ref)=>{
|
|
369
|
+
const group = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
|
|
370
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
|
|
371
|
+
value: group.inGroup ? group : FORCED_GROUP,
|
|
372
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_textarea_cjs_namespaceObject.Textarea, {
|
|
373
|
+
ref: ref,
|
|
374
|
+
...props
|
|
375
|
+
})
|
|
141
376
|
});
|
|
142
377
|
});
|
|
143
378
|
InputGroupTextarea.displayName = 'InputGroupTextarea';
|
|
144
379
|
exports.InputGroup = __webpack_exports__.InputGroup;
|
|
145
380
|
exports.InputGroupAddon = __webpack_exports__.InputGroupAddon;
|
|
381
|
+
exports.InputGroupBody = __webpack_exports__.InputGroupBody;
|
|
146
382
|
exports.InputGroupButton = __webpack_exports__.InputGroupButton;
|
|
147
383
|
exports.InputGroupInput = __webpack_exports__.InputGroupInput;
|
|
384
|
+
exports.InputGroupPopoverTrigger = __webpack_exports__.InputGroupPopoverTrigger;
|
|
385
|
+
exports.InputGroupRow = __webpack_exports__.InputGroupRow;
|
|
148
386
|
exports.InputGroupText = __webpack_exports__.InputGroupText;
|
|
149
387
|
exports.InputGroupTextarea = __webpack_exports__.InputGroupTextarea;
|
|
388
|
+
exports.InputGroupTrigger = __webpack_exports__.InputGroupTrigger;
|
|
389
|
+
exports.inputGroupVariants = __webpack_exports__.inputGroupVariants;
|
|
390
|
+
exports.useInputGroup = __webpack_exports__.useInputGroup;
|
|
150
391
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
151
392
|
"InputGroup",
|
|
152
393
|
"InputGroupAddon",
|
|
394
|
+
"InputGroupBody",
|
|
153
395
|
"InputGroupButton",
|
|
154
396
|
"InputGroupInput",
|
|
397
|
+
"InputGroupPopoverTrigger",
|
|
398
|
+
"InputGroupRow",
|
|
155
399
|
"InputGroupText",
|
|
156
|
-
"InputGroupTextarea"
|
|
400
|
+
"InputGroupTextarea",
|
|
401
|
+
"InputGroupTrigger",
|
|
402
|
+
"inputGroupVariants",
|
|
403
|
+
"useInputGroup"
|
|
157
404
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
158
405
|
Object.defineProperty(exports, '__esModule', {
|
|
159
406
|
value: true
|
|
@@ -3,31 +3,98 @@ import * as React from 'react';
|
|
|
3
3
|
import { type ButtonProps } from './button';
|
|
4
4
|
import { type InputProps } from './input';
|
|
5
5
|
import { type TextareaProps } from './textarea';
|
|
6
|
+
import { type InputGroupLayout, useInputGroup } from './input-group-context';
|
|
7
|
+
export type { InputGroupLayout, InputGroupState } from './input-group-context';
|
|
6
8
|
export interface InputGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
|
|
9
|
+
/**
|
|
10
|
+
* `default` paints the field box, `ghost` a borderless fill, `outline` a border with no fill and
|
|
11
|
+
* no ring, and `none` nothing at all while keeping the row's height and right-hand padding, so an
|
|
12
|
+
* unboxed control still lines up with the boxed fields around it.
|
|
13
|
+
*/
|
|
14
|
+
variant?: 'default' | 'ghost' | 'outline' | 'none';
|
|
8
15
|
size?: 'default' | 'xs';
|
|
16
|
+
/**
|
|
17
|
+
* `row` is one control row. `grow` keeps that as a minimum and lets the content grow it. `block`
|
|
18
|
+
* stacks an `InputGroupRow` above an `InputGroupBody`, with no padding of its own. `fill` hands
|
|
19
|
+
* the height to a multi-line editor and drops the padding the editor draws itself.
|
|
20
|
+
*/
|
|
21
|
+
layout?: InputGroupLayout;
|
|
22
|
+
/** Draws the invalid state for a control that cannot carry `aria-invalid` itself (a code editor). */
|
|
23
|
+
invalid?: boolean;
|
|
24
|
+
/** Draws the disabled state for a control that cannot be `:disabled` itself. */
|
|
25
|
+
disabled?: boolean;
|
|
9
26
|
/** Field-specific validation feedback rendered below the grouped control. */
|
|
10
27
|
error?: React.ReactNode;
|
|
11
28
|
/** Optional id for the inline validation message. */
|
|
12
29
|
errorId?: string;
|
|
13
30
|
}
|
|
31
|
+
declare const inputGroupVariants: (props?: ({
|
|
32
|
+
size?: "default" | "xs" | null | undefined;
|
|
33
|
+
layout?: "fill" | "row" | "block" | "grow" | null | undefined;
|
|
34
|
+
variant?: "default" | "outline" | "ghost" | "none" | null | undefined;
|
|
35
|
+
invalid?: boolean | null | undefined;
|
|
36
|
+
disabled?: boolean | null | undefined;
|
|
37
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
38
|
declare const InputGroup: React.ForwardRefExoticComponent<InputGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
39
|
declare const inputGroupAddonVariants: (props?: ({
|
|
16
40
|
align?: "inline-end" | "inline-start" | null | undefined;
|
|
41
|
+
layout?: "fill" | "row" | "block" | "grow" | null | undefined;
|
|
17
42
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
-
export interface InputGroupAddonProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof inputGroupAddonVariants> {
|
|
43
|
+
export interface InputGroupAddonProps extends React.HTMLAttributes<HTMLDivElement>, Pick<VariantProps<typeof inputGroupAddonVariants>, 'align'> {
|
|
44
|
+
/**
|
|
45
|
+
* Focus the group's `[data-slot=input-group-control]` when the addon's own surface is clicked.
|
|
46
|
+
* Turn off for an addon whose clicks mean something else.
|
|
47
|
+
*/
|
|
48
|
+
focusControlOnClick?: boolean;
|
|
19
49
|
}
|
|
20
50
|
declare const InputGroupAddon: React.ForwardRefExoticComponent<InputGroupAddonProps & React.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export interface InputGroupRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The first row of a `layout="block"` group, holding the control and its addons. The box has no
|
|
55
|
+
* padding in that layout, so the row carries the box's usual padding and trailing trim. Padding the
|
|
56
|
+
* control instead would inset its caret out of line with other fields.
|
|
57
|
+
*/
|
|
58
|
+
declare const InputGroupRow: React.ForwardRefExoticComponent<InputGroupRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
export interface InputGroupBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Content below a `layout="block"` group's first row, behind a divider. Controls here are standard
|
|
63
|
+
* fields with their own box, message and popovers; one that needs addons takes its own InputGroup.
|
|
64
|
+
* The divider goes when there is nothing to divide: an empty body, or a closed Radix collapsible,
|
|
65
|
+
* which leaves its content in place and `hidden`.
|
|
66
|
+
*/
|
|
67
|
+
declare const InputGroupBody: React.ForwardRefExoticComponent<InputGroupBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
68
|
export interface InputGroupButtonProps extends ButtonProps {
|
|
22
69
|
}
|
|
23
70
|
declare const InputGroupButton: React.ForwardRefExoticComponent<InputGroupButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
export interface InputGroupTriggerProps extends Omit<ButtonProps, 'variant' | 'size' | 'icon'> {
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A Button rendered as the group's control, for pickers that open a list or a collapsible. In a
|
|
75
|
+
* `layout="block"` group it is the first row, whose height is its content's.
|
|
76
|
+
*/
|
|
77
|
+
declare const InputGroupTrigger: React.ForwardRefExoticComponent<InputGroupTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
78
|
+
export interface InputGroupPopoverTriggerProps extends InputGroupTriggerProps {
|
|
79
|
+
/** Shown, dimmed, when there are no children to show. */
|
|
80
|
+
placeholder?: React.ReactNode;
|
|
81
|
+
/** Draws the trailing caret. Pass `false` for a trigger that brings its own. */
|
|
82
|
+
caret?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A popover's trigger as the group's control. Must be rendered inside a `Popover`. The panel
|
|
86
|
+
* anchors to the group's box, so it opens below the border at the box's width.
|
|
87
|
+
*/
|
|
88
|
+
declare const InputGroupPopoverTrigger: React.ForwardRefExoticComponent<InputGroupPopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
24
89
|
export interface InputGroupTextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
25
90
|
}
|
|
26
91
|
declare const InputGroupText: React.ForwardRefExoticComponent<InputGroupTextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
27
92
|
export interface InputGroupInputProps extends Omit<InputProps, 'variant' | 'size' | 'error' | 'errorId'> {
|
|
28
93
|
}
|
|
94
|
+
/** `Input` as the group's control. Inside an InputGroup a plain `Input` is the same; kept for shadcn parity. */
|
|
29
95
|
declare const InputGroupInput: React.ForwardRefExoticComponent<InputGroupInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
30
96
|
export interface InputGroupTextareaProps extends Omit<TextareaProps, 'variant' | 'error' | 'errorId'> {
|
|
31
97
|
}
|
|
98
|
+
/** `Textarea` as the group's control. Inside an InputGroup a plain `Textarea` is the same; kept for shadcn parity. */
|
|
32
99
|
declare const InputGroupTextarea: React.ForwardRefExoticComponent<Omit<InputGroupTextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
33
|
-
export { InputGroup, InputGroupAddon,
|
|
100
|
+
export { InputGroup, InputGroupAddon, InputGroupBody, InputGroupButton, InputGroupInput, InputGroupPopoverTrigger, InputGroupRow, InputGroupText, InputGroupTextarea, InputGroupTrigger, inputGroupVariants, useInputGroup, };
|