@wistia/ui 0.6.29-beta.eb10acf5.af58557 → 0.6.29
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/index.cjs +8 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -6
- package/dist/index.d.ts +2 -6
- package/dist/index.mjs +8 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.6.29
|
|
3
|
+
* @license @wistia/ui v0.6.29
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -9382,29 +9382,24 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
9382
9382
|
};
|
|
9383
9383
|
var FormField = ({
|
|
9384
9384
|
children,
|
|
9385
|
-
description,
|
|
9386
|
-
error,
|
|
9387
|
-
id,
|
|
9388
9385
|
label,
|
|
9389
|
-
labelPosition,
|
|
9390
9386
|
name,
|
|
9387
|
+
error,
|
|
9391
9388
|
value,
|
|
9389
|
+
labelPosition,
|
|
9390
|
+
id,
|
|
9392
9391
|
...props
|
|
9393
9392
|
}) => {
|
|
9394
9393
|
const formState = (0, import_react32.useContext)(FormContext);
|
|
9395
9394
|
const checkboxGroup = (0, import_react32.useContext)(CheckboxGroupContext);
|
|
9396
|
-
const defaultValue = formState.values[name];
|
|
9397
9395
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9398
9396
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
9399
9397
|
const computedError = error ?? formState.errors[name];
|
|
9400
|
-
const
|
|
9401
|
-
const errorId = `${computedId}-error`;
|
|
9402
|
-
const ariaDescribedby = [descriptionId, errorId].filter(Boolean).join(" ") || void 0;
|
|
9398
|
+
const defaultValue = formState.values[name];
|
|
9403
9399
|
let childProps = {
|
|
9404
9400
|
name,
|
|
9405
9401
|
id: computedId,
|
|
9406
9402
|
label: isIntegratedLabel ? label : void 0,
|
|
9407
|
-
"aria-describedby": ariaDescribedby,
|
|
9408
9403
|
...props
|
|
9409
9404
|
};
|
|
9410
9405
|
if ((0, import_type_guards29.isUndefined)(value) && (0, import_type_guards29.isNotUndefined)(defaultValue)) {
|
|
@@ -9427,7 +9422,8 @@ var FormField = ({
|
|
|
9427
9422
|
...childProps,
|
|
9428
9423
|
name: computedName,
|
|
9429
9424
|
onChange: handleChange,
|
|
9430
|
-
"aria-invalid": (0, import_type_guards29.isNotNil)(error)
|
|
9425
|
+
"aria-invalid": (0, import_type_guards29.isNotNil)(error),
|
|
9426
|
+
"aria-describedby": (0, import_type_guards29.isNotNil)(error) ? `${computedId}-error` : void 0
|
|
9431
9427
|
};
|
|
9432
9428
|
}
|
|
9433
9429
|
import_react32.Children.only(children);
|
|
@@ -9438,7 +9434,6 @@ var FormField = ({
|
|
|
9438
9434
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
9439
9435
|
children: [
|
|
9440
9436
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
9441
|
-
(0, import_type_guards29.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9442
9437
|
(0, import_react32.cloneElement)(children, childProps),
|
|
9443
9438
|
(0, import_type_guards29.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(import_jsx_runtime225.Fragment, { children: [
|
|
9444
9439
|
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)("div", {}),
|
|
@@ -9446,7 +9441,7 @@ var FormField = ({
|
|
|
9446
9441
|
ErrorMessages,
|
|
9447
9442
|
{
|
|
9448
9443
|
errors: computedError,
|
|
9449
|
-
id:
|
|
9444
|
+
id: `${computedId}-error`
|
|
9450
9445
|
}
|
|
9451
9446
|
)
|
|
9452
9447
|
] }) : null
|