@wistia/ui 0.6.29 → 0.6.30-beta.11d415b6.8f60979
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 +17 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +18 -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.
|
|
3
|
+
* @license @wistia/ui v0.6.30-beta.11d415b6.8f60979
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7418,20 +7418,20 @@ var BoxComponent = (0, import_react17.forwardRef)(
|
|
|
7418
7418
|
...otherProps
|
|
7419
7419
|
}, ref) => {
|
|
7420
7420
|
if ((0, import_type_guards17.isNotUndefined)(height)) {
|
|
7421
|
-
if (
|
|
7421
|
+
if (fill === true || fill === "vertical") {
|
|
7422
7422
|
throw new Error('Cannot use height prop with fill="vertical" or fill={true}');
|
|
7423
7423
|
}
|
|
7424
|
-
if (
|
|
7424
|
+
if (fillViewport === true || fillViewport === "vertical") {
|
|
7425
7425
|
throw new Error(
|
|
7426
7426
|
'Cannot use height prop with fillViewport="vertical" or fillViewport={true}'
|
|
7427
7427
|
);
|
|
7428
7428
|
}
|
|
7429
7429
|
}
|
|
7430
7430
|
if ((0, import_type_guards17.isNotUndefined)(width)) {
|
|
7431
|
-
if (
|
|
7431
|
+
if (fill === true || fill === "horizontal") {
|
|
7432
7432
|
throw new Error('Cannot use width prop with fill="horizontal" or fill={true}');
|
|
7433
7433
|
}
|
|
7434
|
-
if (
|
|
7434
|
+
if (fillViewport === true || fillViewport === "horizontal") {
|
|
7435
7435
|
throw new Error(
|
|
7436
7436
|
'Cannot use width prop with fillViewport="horizontal" or fillViewport={true}'
|
|
7437
7437
|
);
|
|
@@ -9382,24 +9382,29 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
9382
9382
|
};
|
|
9383
9383
|
var FormField = ({
|
|
9384
9384
|
children,
|
|
9385
|
+
description,
|
|
9386
|
+
error,
|
|
9387
|
+
id,
|
|
9385
9388
|
label,
|
|
9389
|
+
labelPosition,
|
|
9386
9390
|
name,
|
|
9387
|
-
error,
|
|
9388
9391
|
value,
|
|
9389
|
-
labelPosition,
|
|
9390
|
-
id,
|
|
9391
9392
|
...props
|
|
9392
9393
|
}) => {
|
|
9393
9394
|
const formState = (0, import_react32.useContext)(FormContext);
|
|
9394
9395
|
const checkboxGroup = (0, import_react32.useContext)(CheckboxGroupContext);
|
|
9396
|
+
const defaultValue = formState.values[name];
|
|
9395
9397
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9396
9398
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
9397
9399
|
const computedError = error ?? formState.errors[name];
|
|
9398
|
-
const
|
|
9400
|
+
const descriptionId = `${computedId}-description`;
|
|
9401
|
+
const errorId = `${computedId}-error`;
|
|
9402
|
+
const ariaDescribedby = [descriptionId, errorId].filter(Boolean).join(" ") || void 0;
|
|
9399
9403
|
let childProps = {
|
|
9400
9404
|
name,
|
|
9401
9405
|
id: computedId,
|
|
9402
9406
|
label: isIntegratedLabel ? label : void 0,
|
|
9407
|
+
"aria-describedby": ariaDescribedby,
|
|
9403
9408
|
...props
|
|
9404
9409
|
};
|
|
9405
9410
|
if ((0, import_type_guards29.isUndefined)(value) && (0, import_type_guards29.isNotUndefined)(defaultValue)) {
|
|
@@ -9422,8 +9427,7 @@ var FormField = ({
|
|
|
9422
9427
|
...childProps,
|
|
9423
9428
|
name: computedName,
|
|
9424
9429
|
onChange: handleChange,
|
|
9425
|
-
"aria-invalid": (0, import_type_guards29.isNotNil)(error)
|
|
9426
|
-
"aria-describedby": (0, import_type_guards29.isNotNil)(error) ? `${computedId}-error` : void 0
|
|
9430
|
+
"aria-invalid": (0, import_type_guards29.isNotNil)(error)
|
|
9427
9431
|
};
|
|
9428
9432
|
}
|
|
9429
9433
|
import_react32.Children.only(children);
|
|
@@ -9434,6 +9438,7 @@ var FormField = ({
|
|
|
9434
9438
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
9435
9439
|
children: [
|
|
9436
9440
|
!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,
|
|
9437
9442
|
(0, import_react32.cloneElement)(children, childProps),
|
|
9438
9443
|
(0, import_type_guards29.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(import_jsx_runtime225.Fragment, { children: [
|
|
9439
9444
|
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)("div", {}),
|
|
@@ -9441,7 +9446,7 @@ var FormField = ({
|
|
|
9441
9446
|
ErrorMessages,
|
|
9442
9447
|
{
|
|
9443
9448
|
errors: computedError,
|
|
9444
|
-
id:
|
|
9449
|
+
id: errorId
|
|
9445
9450
|
}
|
|
9446
9451
|
)
|
|
9447
9452
|
] }) : null
|