@uipath/apollo-wind 2.95.1 → 2.95.3
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/forms/aria-ids.cjs +24 -2
- package/dist/components/forms/aria-ids.d.ts +15 -0
- package/dist/components/forms/aria-ids.js +14 -1
- package/dist/components/forms/field-control.cjs +18 -16
- package/dist/components/forms/field-control.d.ts +6 -5
- package/dist/components/forms/field-control.js +19 -17
- package/dist/components/forms/field-renderer.cjs +14 -10
- package/dist/components/forms/field-renderer.js +15 -11
- package/dist/components/forms/form-schema.d.ts +6 -1
- package/dist/components/forms/metadata-form.cjs +8 -3
- package/dist/components/forms/metadata-form.js +9 -4
- package/dist/components/forms/mode-aware-field.cjs +11 -9
- package/dist/components/forms/mode-aware-field.js +12 -10
- package/dist/components/forms/string-list-field.cjs +10 -6
- package/dist/components/forms/string-list-field.d.ts +1 -1
- package/dist/components/forms/string-list-field.js +10 -6
- package/dist/components/ui/chat-hero.cjs +2 -2
- package/dist/components/ui/chat-hero.d.ts +5 -1
- package/dist/components/ui/chat-hero.js +2 -2
- package/dist/components/ui/index.cjs +26 -26
- package/dist/styles.css +14 -0
- package/package.json +1 -1
|
@@ -47,6 +47,7 @@ const button_cjs_namespaceObject = require("../ui/button.cjs");
|
|
|
47
47
|
const panel_tabs_cjs_namespaceObject = require("../ui/panel-tabs.cjs");
|
|
48
48
|
const tooltip_cjs_namespaceObject = require("../ui/tooltip.cjs");
|
|
49
49
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
50
|
+
const external_aria_ids_cjs_namespaceObject = require("./aria-ids.cjs");
|
|
50
51
|
const external_data_fetcher_cjs_namespaceObject = require("./data-fetcher.cjs");
|
|
51
52
|
const external_field_actions_cjs_namespaceObject = require("./field-actions.cjs");
|
|
52
53
|
const external_field_renderer_cjs_namespaceObject = require("./field-renderer.cjs");
|
|
@@ -57,6 +58,7 @@ const external_validation_converter_cjs_namespaceObject = require("./validation-
|
|
|
57
58
|
const external_value_modes_cjs_namespaceObject = require("./value-modes.cjs");
|
|
58
59
|
const DEFAULT_PLUGINS = [];
|
|
59
60
|
function MetadataForm({ schema, plugins = DEFAULT_PLUGINS, onSubmit, className, disabled = false, autoComplete, stepVariant = 'wizard', sectionVariant = 'card', activeStepId, onActiveStepChange, container = 'form', changedFields, changedFieldLabel }) {
|
|
61
|
+
const fieldIdScope = `${(0, external_react_namespaceObject.useId)()}-`;
|
|
60
62
|
const [currentStep, setCurrentStep] = (0, external_react_namespaceObject.useState)(0);
|
|
61
63
|
const [customComponents, setCustomComponents] = (0, external_react_namespaceObject.useState)({});
|
|
62
64
|
const [isInitialized, setIsInitialized] = (0, external_react_namespaceObject.useState)(false);
|
|
@@ -302,9 +304,12 @@ function MetadataForm({ schema, plugins = DEFAULT_PLUGINS, onSubmit, className,
|
|
|
302
304
|
...form,
|
|
303
305
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_literal_value_context_cjs_namespaceObject.LiteralValueContext.Provider, {
|
|
304
306
|
value: readLiteralValue,
|
|
305
|
-
children:
|
|
306
|
-
|
|
307
|
-
|
|
307
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_aria_ids_cjs_namespaceObject.FieldIdScopeContext.Provider, {
|
|
308
|
+
value: fieldIdScope,
|
|
309
|
+
children: hasFieldTooltip ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(tooltip_cjs_namespaceObject.TooltipProvider, {
|
|
310
|
+
children: body
|
|
311
|
+
}) : body
|
|
312
|
+
})
|
|
308
313
|
})
|
|
309
314
|
});
|
|
310
315
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { standardSchemaResolver } from "@hookform/resolvers/standard-schema";
|
|
3
|
-
import react, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import react, { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { FormProvider, useForm, useFormState, useWatch } from "react-hook-form";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../ui/accordion.js";
|
|
@@ -8,6 +8,7 @@ import { Button } from "../ui/button.js";
|
|
|
8
8
|
import { PanelTabs, PanelTabsContent, PanelTabsList, PanelTabsTrigger } from "../ui/panel-tabs.js";
|
|
9
9
|
import { TooltipProvider } from "../ui/tooltip.js";
|
|
10
10
|
import { deepEqual, get } from "../../lib/index.js";
|
|
11
|
+
import { FieldIdScopeContext } from "./aria-ids.js";
|
|
11
12
|
import { DataFetcher } from "./data-fetcher.js";
|
|
12
13
|
import { buildFieldActionRegistry } from "./field-actions.js";
|
|
13
14
|
import { FormFieldRenderer } from "./field-renderer.js";
|
|
@@ -18,6 +19,7 @@ import { modeAwareSchema, validationConfigToZod } from "./validation-converter.j
|
|
|
18
19
|
import { buildValueModeRegistry, codecContext, isEmptyModeValue, literalValueOf, literalValues, resolveCodec } from "./value-modes.js";
|
|
19
20
|
const DEFAULT_PLUGINS = [];
|
|
20
21
|
function MetadataForm({ schema, plugins = DEFAULT_PLUGINS, onSubmit, className, disabled = false, autoComplete, stepVariant = 'wizard', sectionVariant = 'card', activeStepId, onActiveStepChange, container = 'form', changedFields, changedFieldLabel }) {
|
|
22
|
+
const fieldIdScope = `${useId()}-`;
|
|
21
23
|
const [currentStep, setCurrentStep] = useState(0);
|
|
22
24
|
const [customComponents, setCustomComponents] = useState({});
|
|
23
25
|
const [isInitialized, setIsInitialized] = useState(false);
|
|
@@ -263,9 +265,12 @@ function MetadataForm({ schema, plugins = DEFAULT_PLUGINS, onSubmit, className,
|
|
|
263
265
|
...form,
|
|
264
266
|
children: /*#__PURE__*/ jsx(LiteralValueContext.Provider, {
|
|
265
267
|
value: readLiteralValue,
|
|
266
|
-
children:
|
|
267
|
-
|
|
268
|
-
|
|
268
|
+
children: /*#__PURE__*/ jsx(FieldIdScopeContext.Provider, {
|
|
269
|
+
value: fieldIdScope,
|
|
270
|
+
children: hasFieldTooltip ? /*#__PURE__*/ jsx(TooltipProvider, {
|
|
271
|
+
children: body
|
|
272
|
+
}) : body
|
|
273
|
+
})
|
|
269
274
|
})
|
|
270
275
|
});
|
|
271
276
|
}
|
|
@@ -103,8 +103,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
103
103
|
const strings = context.strings ?? external_form_strings_cjs_namespaceObject.DEFAULT_METADATA_FORM_STRINGS;
|
|
104
104
|
const config = field.valueModes;
|
|
105
105
|
const { name } = field;
|
|
106
|
-
const errorId =
|
|
107
|
-
const labelId = `${name}-label`;
|
|
106
|
+
const { controlId, labelId, errorId } = (0, external_aria_ids_cjs_namespaceObject.useFieldIds)(name);
|
|
108
107
|
const controlDescribedBy = (0, external_aria_ids_cjs_namespaceObject.joinIds)(error && errorId, describedBy);
|
|
109
108
|
const formVariables = context.variables;
|
|
110
109
|
const variables = (0, external_react_namespaceObject.useCallback)(()=>(0, external_field_actions_cjs_namespaceObject.resolveVariables)(formVariables, field), [
|
|
@@ -199,9 +198,9 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
199
198
|
const writeInnerRef = (0, external_react_namespaceObject.useRef)(writeInner);
|
|
200
199
|
writeInnerRef.current = writeInner;
|
|
201
200
|
const domHandle = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
202
|
-
focus: ()=>controlElement(groupRef.current,
|
|
201
|
+
focus: ()=>controlElement(groupRef.current, controlId)?.focus(),
|
|
203
202
|
insertText: (text)=>{
|
|
204
|
-
const element = controlElement(groupRef.current,
|
|
203
|
+
const element = controlElement(groupRef.current, controlId);
|
|
205
204
|
if (!(element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement)) {
|
|
206
205
|
const current = latest.current.inner;
|
|
207
206
|
writeInnerRef.current(`${'string' == typeof current ? current : ''}${text}`, 'set');
|
|
@@ -218,7 +217,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
218
217
|
});
|
|
219
218
|
}
|
|
220
219
|
}), [
|
|
221
|
-
|
|
220
|
+
controlId
|
|
222
221
|
]);
|
|
223
222
|
const ctx = useActionContext({
|
|
224
223
|
field,
|
|
@@ -259,6 +258,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
259
258
|
customComponents,
|
|
260
259
|
binding,
|
|
261
260
|
controlRef,
|
|
261
|
+
controlId,
|
|
262
262
|
labelId,
|
|
263
263
|
options,
|
|
264
264
|
disabled,
|
|
@@ -280,7 +280,8 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
280
280
|
requestModeSwitch: handleSelect,
|
|
281
281
|
controlRef,
|
|
282
282
|
inputRef: formField.ref,
|
|
283
|
-
id:
|
|
283
|
+
id: controlId,
|
|
284
|
+
controlId,
|
|
284
285
|
labelId,
|
|
285
286
|
invalid: !!error,
|
|
286
287
|
placeholder: field.placeholder,
|
|
@@ -319,7 +320,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
319
320
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(form_field_cjs_namespaceObject.FormFieldHeader, {
|
|
320
321
|
label: field.label,
|
|
321
322
|
labelId: labelId,
|
|
322
|
-
htmlFor: 'control' === resolved.geometry.labelTarget ?
|
|
323
|
+
htmlFor: 'control' === resolved.geometry.labelTarget ? controlId : void 0,
|
|
323
324
|
required: required,
|
|
324
325
|
tooltip: field.tooltip,
|
|
325
326
|
tooltipAriaLabel: field.tooltipAriaLabel,
|
|
@@ -523,10 +524,10 @@ function resolveControl(input) {
|
|
|
523
524
|
source: 'fallback'
|
|
524
525
|
};
|
|
525
526
|
}
|
|
526
|
-
function FallbackControl({ field, binding, disabled, error, errorId, describedBy }) {
|
|
527
|
+
function FallbackControl({ field, binding, disabled, error, errorId, describedBy, controlId }) {
|
|
527
528
|
const { value } = binding;
|
|
528
529
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_cjs_namespaceObject.Input, {
|
|
529
|
-
id:
|
|
530
|
+
id: controlId,
|
|
530
531
|
name: binding.name,
|
|
531
532
|
ref: binding.ref,
|
|
532
533
|
value: 'string' == typeof value ? value : null == value ? '' : String(value),
|
|
@@ -564,6 +565,7 @@ function builtInLiteral(input) {
|
|
|
564
565
|
required: required,
|
|
565
566
|
error: error,
|
|
566
567
|
controlRef: input.controlRef,
|
|
568
|
+
controlId: input.controlId,
|
|
567
569
|
labelId: input.labelId,
|
|
568
570
|
"aria-describedby": (0, external_aria_ids_cjs_namespaceObject.joinIds)(field.componentProps?.['aria-describedby'], input.describedBy)
|
|
569
571
|
}),
|
|
@@ -10,7 +10,7 @@ import { Input } from "../ui/input.js";
|
|
|
10
10
|
import { InputGroup, InputGroupAddon } from "../ui/input-group.js";
|
|
11
11
|
import { PromptValueControl } from "../ui/prompt-value-control.js";
|
|
12
12
|
import { VariableValueControl } from "../ui/variable-value-control.js";
|
|
13
|
-
import { joinIds } from "./aria-ids.js";
|
|
13
|
+
import { joinIds, useFieldIds } from "./aria-ids.js";
|
|
14
14
|
import { DEFAULT_FIELD_ACTION_REGISTRY, resolveFieldActions, resolveVariables } from "./field-actions.js";
|
|
15
15
|
import { FIELD_CONTROL_GEOMETRY, FieldControl } from "./field-control.js";
|
|
16
16
|
import { DEFAULT_METADATA_FORM_STRINGS } from "./form-strings.js";
|
|
@@ -75,8 +75,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
75
75
|
const strings = context.strings ?? DEFAULT_METADATA_FORM_STRINGS;
|
|
76
76
|
const config = field.valueModes;
|
|
77
77
|
const { name } = field;
|
|
78
|
-
const errorId =
|
|
79
|
-
const labelId = `${name}-label`;
|
|
78
|
+
const { controlId, labelId, errorId } = useFieldIds(name);
|
|
80
79
|
const controlDescribedBy = joinIds(error && errorId, describedBy);
|
|
81
80
|
const formVariables = context.variables;
|
|
82
81
|
const variables = useCallback(()=>resolveVariables(formVariables, field), [
|
|
@@ -171,9 +170,9 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
171
170
|
const writeInnerRef = useRef(writeInner);
|
|
172
171
|
writeInnerRef.current = writeInner;
|
|
173
172
|
const domHandle = useMemo(()=>({
|
|
174
|
-
focus: ()=>controlElement(groupRef.current,
|
|
173
|
+
focus: ()=>controlElement(groupRef.current, controlId)?.focus(),
|
|
175
174
|
insertText: (text)=>{
|
|
176
|
-
const element = controlElement(groupRef.current,
|
|
175
|
+
const element = controlElement(groupRef.current, controlId);
|
|
177
176
|
if (!(element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement)) {
|
|
178
177
|
const current = latest.current.inner;
|
|
179
178
|
writeInnerRef.current(`${'string' == typeof current ? current : ''}${text}`, 'set');
|
|
@@ -190,7 +189,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
190
189
|
});
|
|
191
190
|
}
|
|
192
191
|
}), [
|
|
193
|
-
|
|
192
|
+
controlId
|
|
194
193
|
]);
|
|
195
194
|
const ctx = useActionContext({
|
|
196
195
|
field,
|
|
@@ -231,6 +230,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
231
230
|
customComponents,
|
|
232
231
|
binding,
|
|
233
232
|
controlRef,
|
|
233
|
+
controlId,
|
|
234
234
|
labelId,
|
|
235
235
|
options,
|
|
236
236
|
disabled,
|
|
@@ -252,7 +252,8 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
252
252
|
requestModeSwitch: handleSelect,
|
|
253
253
|
controlRef,
|
|
254
254
|
inputRef: formField.ref,
|
|
255
|
-
id:
|
|
255
|
+
id: controlId,
|
|
256
|
+
controlId,
|
|
256
257
|
labelId,
|
|
257
258
|
invalid: !!error,
|
|
258
259
|
placeholder: field.placeholder,
|
|
@@ -291,7 +292,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
291
292
|
/*#__PURE__*/ jsx(FormFieldHeader, {
|
|
292
293
|
label: field.label,
|
|
293
294
|
labelId: labelId,
|
|
294
|
-
htmlFor: 'control' === resolved.geometry.labelTarget ?
|
|
295
|
+
htmlFor: 'control' === resolved.geometry.labelTarget ? controlId : void 0,
|
|
295
296
|
required: required,
|
|
296
297
|
tooltip: field.tooltip,
|
|
297
298
|
tooltipAriaLabel: field.tooltipAriaLabel,
|
|
@@ -495,10 +496,10 @@ function resolveControl(input) {
|
|
|
495
496
|
source: 'fallback'
|
|
496
497
|
};
|
|
497
498
|
}
|
|
498
|
-
function FallbackControl({ field, binding, disabled, error, errorId, describedBy }) {
|
|
499
|
+
function FallbackControl({ field, binding, disabled, error, errorId, describedBy, controlId }) {
|
|
499
500
|
const { value } = binding;
|
|
500
501
|
return /*#__PURE__*/ jsx(Input, {
|
|
501
|
-
id:
|
|
502
|
+
id: controlId,
|
|
502
503
|
name: binding.name,
|
|
503
504
|
ref: binding.ref,
|
|
504
505
|
value: 'string' == typeof value ? value : null == value ? '' : String(value),
|
|
@@ -536,6 +537,7 @@ function builtInLiteral(input) {
|
|
|
536
537
|
required: required,
|
|
537
538
|
error: error,
|
|
538
539
|
controlRef: input.controlRef,
|
|
540
|
+
controlId: input.controlId,
|
|
539
541
|
labelId: input.labelId,
|
|
540
542
|
"aria-describedby": joinIds(field.componentProps?.['aria-describedby'], input.describedBy)
|
|
541
543
|
}),
|
|
@@ -34,10 +34,12 @@ const external_react_namespaceObject = require("react");
|
|
|
34
34
|
const button_cjs_namespaceObject = require("../ui/button.cjs");
|
|
35
35
|
const form_field_cjs_namespaceObject = require("../ui/form-field.cjs");
|
|
36
36
|
const textarea_cjs_namespaceObject = require("../ui/textarea.cjs");
|
|
37
|
+
const external_aria_ids_cjs_namespaceObject = require("./aria-ids.cjs");
|
|
37
38
|
function formatTemplate(template, values) {
|
|
38
39
|
return template.replace(/\{\{(\w+)\}\}/g, (match, token)=>token in values ? String(values[token]) : match);
|
|
39
40
|
}
|
|
40
|
-
function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef, ariaDescribedBy
|
|
41
|
+
function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef, ariaDescribedBy }) {
|
|
42
|
+
const { errorId } = (0, external_aria_ids_cjs_namespaceObject.useFieldIds)(field.name);
|
|
41
43
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(form_field_cjs_namespaceObject.FormField, {
|
|
42
44
|
"data-slot": "string-list-field",
|
|
43
45
|
children: [
|
|
@@ -55,19 +57,21 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
|
|
|
55
57
|
invalid: !!error,
|
|
56
58
|
disabled: disabled,
|
|
57
59
|
inputRef: inputRef,
|
|
58
|
-
ariaDescribedBy: ariaDescribedBy
|
|
60
|
+
ariaDescribedBy: ariaDescribedBy ?? (error ? errorId : void 0)
|
|
59
61
|
}),
|
|
60
62
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(form_field_cjs_namespaceObject.FormFieldDescription, {
|
|
61
63
|
children: field.description
|
|
62
64
|
}),
|
|
63
65
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(form_field_cjs_namespaceObject.FormFieldError, {
|
|
64
|
-
id:
|
|
66
|
+
id: errorId,
|
|
65
67
|
children: error
|
|
66
68
|
})
|
|
67
69
|
]
|
|
68
70
|
});
|
|
69
71
|
}
|
|
70
|
-
function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef, ariaDescribedBy
|
|
72
|
+
function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef, ariaDescribedBy }) {
|
|
73
|
+
const { errorId } = (0, external_aria_ids_cjs_namespaceObject.useFieldIds)(field.name);
|
|
74
|
+
const describedBy = ariaDescribedBy ?? (invalid ? errorId : void 0);
|
|
71
75
|
const items = value ?? [];
|
|
72
76
|
const maxItems = field.maxItems ?? 1 / 0;
|
|
73
77
|
const canAdd = !disabled && items.length < maxItems;
|
|
@@ -127,8 +131,8 @@ function StringListControl({ field, value, onChange, onBlur, invalid = false, di
|
|
|
127
131
|
disabled: disabled,
|
|
128
132
|
"aria-label": `${field.label} ${index + 1}`,
|
|
129
133
|
"aria-invalid": invalid || void 0,
|
|
130
|
-
"aria-describedby":
|
|
131
|
-
"aria-errormessage": invalid ?
|
|
134
|
+
"aria-describedby": describedBy,
|
|
135
|
+
"aria-errormessage": invalid ? errorId : void 0,
|
|
132
136
|
className: "flex-1"
|
|
133
137
|
}),
|
|
134
138
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
|
|
@@ -30,7 +30,7 @@ export interface StringListFieldProps {
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function StringListField({ field, value, onChange, onBlur, error, disabled, required, inputRef, ariaDescribedBy, }: StringListFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export interface StringListControlProps extends Omit<StringListFieldProps, 'error' | 'required'> {
|
|
33
|
-
/** Marks every row invalid and points it at the
|
|
33
|
+
/** Marks every row invalid and points it at the field's error message. */
|
|
34
34
|
invalid?: boolean;
|
|
35
35
|
}
|
|
36
36
|
/** The rows and Add button of a string list, without its label, description or error. */
|
|
@@ -4,10 +4,12 @@ import { useCallback, useState } from "react";
|
|
|
4
4
|
import { Button } from "../ui/button.js";
|
|
5
5
|
import { FormField, FormFieldDescription, FormFieldError, FormFieldLabel } from "../ui/form-field.js";
|
|
6
6
|
import { Textarea } from "../ui/textarea.js";
|
|
7
|
+
import { useFieldIds } from "./aria-ids.js";
|
|
7
8
|
function formatTemplate(template, values) {
|
|
8
9
|
return template.replace(/\{\{(\w+)\}\}/g, (match, token)=>token in values ? String(values[token]) : match);
|
|
9
10
|
}
|
|
10
|
-
function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef, ariaDescribedBy
|
|
11
|
+
function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef, ariaDescribedBy }) {
|
|
12
|
+
const { errorId } = useFieldIds(field.name);
|
|
11
13
|
return /*#__PURE__*/ jsxs(FormField, {
|
|
12
14
|
"data-slot": "string-list-field",
|
|
13
15
|
children: [
|
|
@@ -25,19 +27,21 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
|
|
|
25
27
|
invalid: !!error,
|
|
26
28
|
disabled: disabled,
|
|
27
29
|
inputRef: inputRef,
|
|
28
|
-
ariaDescribedBy: ariaDescribedBy
|
|
30
|
+
ariaDescribedBy: ariaDescribedBy ?? (error ? errorId : void 0)
|
|
29
31
|
}),
|
|
30
32
|
/*#__PURE__*/ jsx(FormFieldDescription, {
|
|
31
33
|
children: field.description
|
|
32
34
|
}),
|
|
33
35
|
/*#__PURE__*/ jsx(FormFieldError, {
|
|
34
|
-
id:
|
|
36
|
+
id: errorId,
|
|
35
37
|
children: error
|
|
36
38
|
})
|
|
37
39
|
]
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
|
-
function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef, ariaDescribedBy
|
|
42
|
+
function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef, ariaDescribedBy }) {
|
|
43
|
+
const { errorId } = useFieldIds(field.name);
|
|
44
|
+
const describedBy = ariaDescribedBy ?? (invalid ? errorId : void 0);
|
|
41
45
|
const items = value ?? [];
|
|
42
46
|
const maxItems = field.maxItems ?? 1 / 0;
|
|
43
47
|
const canAdd = !disabled && items.length < maxItems;
|
|
@@ -97,8 +101,8 @@ function StringListControl({ field, value, onChange, onBlur, invalid = false, di
|
|
|
97
101
|
disabled: disabled,
|
|
98
102
|
"aria-label": `${field.label} ${index + 1}`,
|
|
99
103
|
"aria-invalid": invalid || void 0,
|
|
100
|
-
"aria-describedby":
|
|
101
|
-
"aria-errormessage": invalid ?
|
|
104
|
+
"aria-describedby": describedBy,
|
|
105
|
+
"aria-errormessage": invalid ? errorId : void 0,
|
|
102
106
|
className: "flex-1"
|
|
103
107
|
}),
|
|
104
108
|
/*#__PURE__*/ jsx(Button, {
|
|
@@ -46,8 +46,8 @@ const ChatHeroContext = /*#__PURE__*/ external_react_namespaceObject.createConte
|
|
|
46
46
|
const chatHeroVariants = (0, external_class_variance_authority_namespaceObject.cva)('flex w-full min-w-0 flex-1 flex-col', {
|
|
47
47
|
variants: {
|
|
48
48
|
layout: {
|
|
49
|
-
centered: 'mx-auto max-w-[800px] items-center justify-center',
|
|
50
|
-
docked: 'justify-end gap-6 text-start'
|
|
49
|
+
centered: 'mx-auto max-w-[800px] items-center justify-center supports-[justify-content:safe_center]:justify-center-safe',
|
|
50
|
+
docked: 'justify-end gap-6 text-start supports-[justify-content:safe_flex-end]:justify-end-safe'
|
|
51
51
|
},
|
|
52
52
|
density: {
|
|
53
53
|
comfortable: '',
|
|
@@ -25,7 +25,11 @@ export interface ChatHeroProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
layout?: ChatHeroLayout;
|
|
26
26
|
density?: ChatHeroDensity;
|
|
27
27
|
}
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Fills its flex parent, so the parent decides the height that `centered` centers within. To
|
|
30
|
+
* scroll content that does not fit, put it in a scroll container or make it one itself
|
|
31
|
+
* (`min-h-0 overflow-y-auto`).
|
|
32
|
+
*/
|
|
29
33
|
declare const ChatHero: React.ForwardRefExoticComponent<ChatHeroProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
34
|
/** Holds the logo, title and description. Hidden when all of them render nothing. */
|
|
31
35
|
declare const ChatHeroHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -11,8 +11,8 @@ const ChatHeroContext = /*#__PURE__*/ createContext({
|
|
|
11
11
|
const chatHeroVariants = cva('flex w-full min-w-0 flex-1 flex-col', {
|
|
12
12
|
variants: {
|
|
13
13
|
layout: {
|
|
14
|
-
centered: 'mx-auto max-w-[800px] items-center justify-center',
|
|
15
|
-
docked: 'justify-end gap-6 text-start'
|
|
14
|
+
centered: 'mx-auto max-w-[800px] items-center justify-center supports-[justify-content:safe_center]:justify-center-safe',
|
|
15
|
+
docked: 'justify-end gap-6 text-start supports-[justify-content:safe_flex-end]:justify-end-safe'
|
|
16
16
|
},
|
|
17
17
|
density: {
|
|
18
18
|
comfortable: '',
|
|
@@ -33,16 +33,16 @@ var __webpack_modules__ = {
|
|
|
33
33
|
"./button-group" (module) {
|
|
34
34
|
module.exports = require("./button-group.cjs");
|
|
35
35
|
},
|
|
36
|
-
"
|
|
36
|
+
"./button" (module) {
|
|
37
37
|
module.exports = require("./button.cjs");
|
|
38
38
|
},
|
|
39
39
|
"./byo-model-dialog" (module) {
|
|
40
40
|
module.exports = require("./byo-model-dialog/index.cjs");
|
|
41
41
|
},
|
|
42
|
-
"
|
|
42
|
+
"./calendar" (module) {
|
|
43
43
|
module.exports = require("./calendar.cjs");
|
|
44
44
|
},
|
|
45
|
-
"
|
|
45
|
+
"@/components/ui/card" (module) {
|
|
46
46
|
module.exports = require("./card.cjs");
|
|
47
47
|
},
|
|
48
48
|
"./chart" (module) {
|
|
@@ -60,7 +60,7 @@ var __webpack_modules__ = {
|
|
|
60
60
|
"./citation" (module) {
|
|
61
61
|
module.exports = require("./citation.cjs");
|
|
62
62
|
},
|
|
63
|
-
"
|
|
63
|
+
"@/components/ui/code-block" (module) {
|
|
64
64
|
module.exports = require("./code-block.cjs");
|
|
65
65
|
},
|
|
66
66
|
"./collapsible" (module) {
|
|
@@ -90,7 +90,7 @@ var __webpack_modules__ = {
|
|
|
90
90
|
"./datetime-picker" (module) {
|
|
91
91
|
module.exports = require("./datetime-picker.cjs");
|
|
92
92
|
},
|
|
93
|
-
"
|
|
93
|
+
"@/components/ui/dialog" (module) {
|
|
94
94
|
module.exports = require("./dialog.cjs");
|
|
95
95
|
},
|
|
96
96
|
"./disclosure-tree" (module) {
|
|
@@ -99,13 +99,13 @@ var __webpack_modules__ = {
|
|
|
99
99
|
"./drawer" (module) {
|
|
100
100
|
module.exports = require("./drawer.cjs");
|
|
101
101
|
},
|
|
102
|
-
"
|
|
102
|
+
"@/components/ui/dropdown-menu" (module) {
|
|
103
103
|
module.exports = require("./dropdown-menu.cjs");
|
|
104
104
|
},
|
|
105
105
|
"./dropzone-overlay" (module) {
|
|
106
106
|
module.exports = require("./dropzone-overlay.cjs");
|
|
107
107
|
},
|
|
108
|
-
"
|
|
108
|
+
"@/components/ui/editable-cell" (module) {
|
|
109
109
|
module.exports = require("./editable-cell.cjs");
|
|
110
110
|
},
|
|
111
111
|
"./editable-text" (module) {
|
|
@@ -192,10 +192,10 @@ var __webpack_modules__ = {
|
|
|
192
192
|
"./password-input" (module) {
|
|
193
193
|
module.exports = require("./password-input.cjs");
|
|
194
194
|
},
|
|
195
|
-
"
|
|
195
|
+
"./popover" (module) {
|
|
196
196
|
module.exports = require("./popover.cjs");
|
|
197
197
|
},
|
|
198
|
-
"
|
|
198
|
+
"@/components/ui/portal-container" (module) {
|
|
199
199
|
module.exports = require("./portal-container.cjs");
|
|
200
200
|
},
|
|
201
201
|
"./progress" (module) {
|
|
@@ -252,7 +252,7 @@ var __webpack_modules__ = {
|
|
|
252
252
|
"./sidebar" (module) {
|
|
253
253
|
module.exports = require("./sidebar/index.cjs");
|
|
254
254
|
},
|
|
255
|
-
"
|
|
255
|
+
"@/components/ui/skeleton" (module) {
|
|
256
256
|
module.exports = require("./skeleton.cjs");
|
|
257
257
|
},
|
|
258
258
|
"./slider" (module) {
|
|
@@ -276,13 +276,13 @@ var __webpack_modules__ = {
|
|
|
276
276
|
"./switch" (module) {
|
|
277
277
|
module.exports = require("./switch.cjs");
|
|
278
278
|
},
|
|
279
|
-
"
|
|
279
|
+
"@/components/ui/table" (module) {
|
|
280
280
|
module.exports = require("./table.cjs");
|
|
281
281
|
},
|
|
282
282
|
"./tabs" (module) {
|
|
283
283
|
module.exports = require("./tabs.cjs");
|
|
284
284
|
},
|
|
285
|
-
"
|
|
285
|
+
"@/components/ui/textarea" (module) {
|
|
286
286
|
module.exports = require("./textarea.cjs");
|
|
287
287
|
},
|
|
288
288
|
"./thinking-indicator" (module) {
|
|
@@ -297,7 +297,7 @@ var __webpack_modules__ = {
|
|
|
297
297
|
"./tool-call" (module) {
|
|
298
298
|
module.exports = require("./tool-call.cjs");
|
|
299
299
|
},
|
|
300
|
-
"
|
|
300
|
+
"./tooltip" (module) {
|
|
301
301
|
module.exports = require("./tooltip.cjs");
|
|
302
302
|
},
|
|
303
303
|
"./tree-view" (module) {
|
|
@@ -459,7 +459,7 @@ var __webpack_exports__ = {};
|
|
|
459
459
|
"ReferenceChip"
|
|
460
460
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_bubble__rspack_import_9[__rspack_import_key];
|
|
461
461
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
462
|
-
var _button__rspack_import_10 = __webpack_require__("
|
|
462
|
+
var _button__rspack_import_10 = __webpack_require__("./button");
|
|
463
463
|
var __rspack_reexport = {};
|
|
464
464
|
for(const __rspack_import_key in _button__rspack_import_10)if ([
|
|
465
465
|
"getReferenceChipColors",
|
|
@@ -489,7 +489,7 @@ var __webpack_exports__ = {};
|
|
|
489
489
|
"ReferenceChip"
|
|
490
490
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_byo_model_dialog__rspack_import_12[__rspack_import_key];
|
|
491
491
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
492
|
-
var _calendar__rspack_import_13 = __webpack_require__("
|
|
492
|
+
var _calendar__rspack_import_13 = __webpack_require__("./calendar");
|
|
493
493
|
var __rspack_reexport = {};
|
|
494
494
|
for(const __rspack_import_key in _calendar__rspack_import_13)if ([
|
|
495
495
|
"getReferenceChipColors",
|
|
@@ -499,7 +499,7 @@ var __webpack_exports__ = {};
|
|
|
499
499
|
"ReferenceChip"
|
|
500
500
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_calendar__rspack_import_13[__rspack_import_key];
|
|
501
501
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
502
|
-
var _card__rspack_import_14 = __webpack_require__("
|
|
502
|
+
var _card__rspack_import_14 = __webpack_require__("@/components/ui/card");
|
|
503
503
|
var __rspack_reexport = {};
|
|
504
504
|
for(const __rspack_import_key in _card__rspack_import_14)if ([
|
|
505
505
|
"getReferenceChipColors",
|
|
@@ -559,7 +559,7 @@ var __webpack_exports__ = {};
|
|
|
559
559
|
"ReferenceChip"
|
|
560
560
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_citation__rspack_import_19[__rspack_import_key];
|
|
561
561
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
562
|
-
var _code_block__rspack_import_20 = __webpack_require__("
|
|
562
|
+
var _code_block__rspack_import_20 = __webpack_require__("@/components/ui/code-block");
|
|
563
563
|
var __rspack_reexport = {};
|
|
564
564
|
for(const __rspack_import_key in _code_block__rspack_import_20)if ([
|
|
565
565
|
"getReferenceChipColors",
|
|
@@ -659,7 +659,7 @@ var __webpack_exports__ = {};
|
|
|
659
659
|
"ReferenceChip"
|
|
660
660
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_datetime_picker__rspack_import_29[__rspack_import_key];
|
|
661
661
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
662
|
-
var _dialog__rspack_import_30 = __webpack_require__("
|
|
662
|
+
var _dialog__rspack_import_30 = __webpack_require__("@/components/ui/dialog");
|
|
663
663
|
var __rspack_reexport = {};
|
|
664
664
|
for(const __rspack_import_key in _dialog__rspack_import_30)if ([
|
|
665
665
|
"getReferenceChipColors",
|
|
@@ -689,7 +689,7 @@ var __webpack_exports__ = {};
|
|
|
689
689
|
"ReferenceChip"
|
|
690
690
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_drawer__rspack_import_32[__rspack_import_key];
|
|
691
691
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
692
|
-
var _dropdown_menu__rspack_import_33 = __webpack_require__("
|
|
692
|
+
var _dropdown_menu__rspack_import_33 = __webpack_require__("@/components/ui/dropdown-menu");
|
|
693
693
|
var __rspack_reexport = {};
|
|
694
694
|
for(const __rspack_import_key in _dropdown_menu__rspack_import_33)if ([
|
|
695
695
|
"getReferenceChipColors",
|
|
@@ -709,7 +709,7 @@ var __webpack_exports__ = {};
|
|
|
709
709
|
"ReferenceChip"
|
|
710
710
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_dropzone_overlay__rspack_import_34[__rspack_import_key];
|
|
711
711
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
712
|
-
var _editable_cell__rspack_import_35 = __webpack_require__("
|
|
712
|
+
var _editable_cell__rspack_import_35 = __webpack_require__("@/components/ui/editable-cell");
|
|
713
713
|
var __rspack_reexport = {};
|
|
714
714
|
for(const __rspack_import_key in _editable_cell__rspack_import_35)if ([
|
|
715
715
|
"getReferenceChipColors",
|
|
@@ -999,7 +999,7 @@ var __webpack_exports__ = {};
|
|
|
999
999
|
"ReferenceChip"
|
|
1000
1000
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_password_input__rspack_import_63[__rspack_import_key];
|
|
1001
1001
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1002
|
-
var _popover__rspack_import_64 = __webpack_require__("
|
|
1002
|
+
var _popover__rspack_import_64 = __webpack_require__("./popover");
|
|
1003
1003
|
var __rspack_reexport = {};
|
|
1004
1004
|
for(const __rspack_import_key in _popover__rspack_import_64)if ([
|
|
1005
1005
|
"getReferenceChipColors",
|
|
@@ -1009,7 +1009,7 @@ var __webpack_exports__ = {};
|
|
|
1009
1009
|
"ReferenceChip"
|
|
1010
1010
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_popover__rspack_import_64[__rspack_import_key];
|
|
1011
1011
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1012
|
-
var _portal_container__rspack_import_65 = __webpack_require__("
|
|
1012
|
+
var _portal_container__rspack_import_65 = __webpack_require__("@/components/ui/portal-container");
|
|
1013
1013
|
var __rspack_reexport = {};
|
|
1014
1014
|
for(const __rspack_import_key in _portal_container__rspack_import_65)if ([
|
|
1015
1015
|
"getReferenceChipColors",
|
|
@@ -1181,7 +1181,7 @@ var __webpack_exports__ = {};
|
|
|
1181
1181
|
"ReferenceChip"
|
|
1182
1182
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_sidebar__rspack_import_83[__rspack_import_key];
|
|
1183
1183
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1184
|
-
var _skeleton__rspack_import_84 = __webpack_require__("
|
|
1184
|
+
var _skeleton__rspack_import_84 = __webpack_require__("@/components/ui/skeleton");
|
|
1185
1185
|
var __rspack_reexport = {};
|
|
1186
1186
|
for(const __rspack_import_key in _skeleton__rspack_import_84)if ([
|
|
1187
1187
|
"getReferenceChipColors",
|
|
@@ -1261,7 +1261,7 @@ var __webpack_exports__ = {};
|
|
|
1261
1261
|
"ReferenceChip"
|
|
1262
1262
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_91[__rspack_import_key];
|
|
1263
1263
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1264
|
-
var _table__rspack_import_92 = __webpack_require__("
|
|
1264
|
+
var _table__rspack_import_92 = __webpack_require__("@/components/ui/table");
|
|
1265
1265
|
var __rspack_reexport = {};
|
|
1266
1266
|
for(const __rspack_import_key in _table__rspack_import_92)if ([
|
|
1267
1267
|
"getReferenceChipColors",
|
|
@@ -1281,7 +1281,7 @@ var __webpack_exports__ = {};
|
|
|
1281
1281
|
"ReferenceChip"
|
|
1282
1282
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tabs__rspack_import_93[__rspack_import_key];
|
|
1283
1283
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1284
|
-
var _textarea__rspack_import_94 = __webpack_require__("
|
|
1284
|
+
var _textarea__rspack_import_94 = __webpack_require__("@/components/ui/textarea");
|
|
1285
1285
|
var __rspack_reexport = {};
|
|
1286
1286
|
for(const __rspack_import_key in _textarea__rspack_import_94)if ([
|
|
1287
1287
|
"getReferenceChipColors",
|
|
@@ -1331,7 +1331,7 @@ var __webpack_exports__ = {};
|
|
|
1331
1331
|
"ReferenceChip"
|
|
1332
1332
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tool_call__rspack_import_98[__rspack_import_key];
|
|
1333
1333
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1334
|
-
var _tooltip__rspack_import_99 = __webpack_require__("
|
|
1334
|
+
var _tooltip__rspack_import_99 = __webpack_require__("./tooltip");
|
|
1335
1335
|
var __rspack_reexport = {};
|
|
1336
1336
|
for(const __rspack_import_key in _tooltip__rspack_import_99)if ([
|
|
1337
1337
|
"getReferenceChipColors",
|
package/dist/styles.css
CHANGED
|
@@ -1189,6 +1189,10 @@
|
|
|
1189
1189
|
width: calc(var(--spacing) * 16);
|
|
1190
1190
|
height: calc(var(--spacing) * 16);
|
|
1191
1191
|
}
|
|
1192
|
+
.size-24 {
|
|
1193
|
+
width: calc(var(--spacing) * 24);
|
|
1194
|
+
height: calc(var(--spacing) * 24);
|
|
1195
|
+
}
|
|
1192
1196
|
.size-\[18px\] {
|
|
1193
1197
|
width: 18px;
|
|
1194
1198
|
height: 18px;
|
|
@@ -8767,6 +8771,16 @@
|
|
|
8767
8771
|
}
|
|
8768
8772
|
}
|
|
8769
8773
|
}
|
|
8774
|
+
.supports-\[justify-content\:safe_center\]\:justify-center-safe {
|
|
8775
|
+
@supports (justify-content:safe center) {
|
|
8776
|
+
justify-content: safe center;
|
|
8777
|
+
}
|
|
8778
|
+
}
|
|
8779
|
+
.supports-\[justify-content\:safe_flex-end\]\:justify-end-safe {
|
|
8780
|
+
@supports (justify-content:safe flex-end) {
|
|
8781
|
+
justify-content: safe flex-end;
|
|
8782
|
+
}
|
|
8783
|
+
}
|
|
8770
8784
|
.motion-reduce\:animate-none {
|
|
8771
8785
|
@media (prefers-reduced-motion: reduce) {
|
|
8772
8786
|
animation: none;
|