@wistia/ui 0.6.22 → 0.6.23
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 +73 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +73 -82
- 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.23
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -1248,6 +1248,7 @@ var colorAliasTokens = import_styled_components4.css`
|
|
|
1248
1248
|
|
|
1249
1249
|
/* Disabled */
|
|
1250
1250
|
--wui-color-bg-surface-disabled: var(--wui-gray-3);
|
|
1251
|
+
--wui-color-bg-border-disabled: var(--wui-gray-4);
|
|
1251
1252
|
--wui-color-icon-disabled: var(--wui-gray-8);
|
|
1252
1253
|
--wui-color-text-disabled: var(--wui-gray-10);
|
|
1253
1254
|
--wui-color-focus-ring-disabled: var(--wui-gray-6);
|
|
@@ -7600,6 +7601,7 @@ ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
|
7600
7601
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
7601
7602
|
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
7602
7603
|
var disabledStyle2 = import_styled_components33.css`
|
|
7604
|
+
cursor: not-allowed;
|
|
7603
7605
|
color: var(--wui-color-text-disabled);
|
|
7604
7606
|
`;
|
|
7605
7607
|
var StyledLabelWrapper = import_styled_components33.default.div`
|
|
@@ -7669,10 +7671,6 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
|
7669
7671
|
)
|
|
7670
7672
|
}
|
|
7671
7673
|
);
|
|
7672
|
-
var disabledStyle3 = import_styled_components34.css`
|
|
7673
|
-
cursor: not-allowed;
|
|
7674
|
-
opacity: 0.5;
|
|
7675
|
-
`;
|
|
7676
7674
|
var inputSizeSmall = import_styled_components34.css`
|
|
7677
7675
|
width: 14px;
|
|
7678
7676
|
height: 14px;
|
|
@@ -7691,36 +7689,36 @@ var inputSizeLarge = import_styled_components34.css`
|
|
|
7691
7689
|
min-width: 20px;
|
|
7692
7690
|
min-height: 20px;
|
|
7693
7691
|
`;
|
|
7692
|
+
var getSizeCss = (size) => {
|
|
7693
|
+
if (size === "sm") return inputSizeSmall;
|
|
7694
|
+
if (size === "lg") return inputSizeLarge;
|
|
7695
|
+
return inputSizeMedium;
|
|
7696
|
+
};
|
|
7694
7697
|
var StyledCheckboxWrapper = import_styled_components34.default.div`
|
|
7695
7698
|
display: flex;
|
|
7696
7699
|
margin: 0;
|
|
7697
7700
|
|
|
7698
7701
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
7699
7702
|
user-select: none;
|
|
7700
|
-
|
|
7701
|
-
${({ disabled }) => disabled && disabledStyle3};
|
|
7702
7703
|
`;
|
|
7703
|
-
var getSizeCss = (size) => {
|
|
7704
|
-
if (size === "sm") return inputSizeSmall;
|
|
7705
|
-
if (size === "lg") return inputSizeLarge;
|
|
7706
|
-
return inputSizeMedium;
|
|
7707
|
-
};
|
|
7708
7704
|
var StyledCheckboxInput = import_styled_components34.default.div`
|
|
7709
7705
|
${({ $size }) => getSizeCss($size)}
|
|
7710
7706
|
line-height: 0;
|
|
7711
7707
|
margin: 0;
|
|
7712
|
-
border: 1px solid var(--wui-color-border);
|
|
7713
7708
|
border-radius: var(--wui-border-radius-01);
|
|
7714
|
-
background-color: var(--wui-color-bg-fill-white);
|
|
7715
7709
|
display: grid;
|
|
7716
7710
|
place-content: center;
|
|
7717
7711
|
align-self: flex-start;
|
|
7712
|
+
background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface)"};
|
|
7713
|
+
border: 1px solid
|
|
7714
|
+
${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-border)"};
|
|
7718
7715
|
|
|
7716
|
+
/* checkmark icon */
|
|
7719
7717
|
svg {
|
|
7720
7718
|
display: none;
|
|
7721
7719
|
|
|
7722
7720
|
path {
|
|
7723
|
-
fill: var(--wui-color-bg-fill-white);
|
|
7721
|
+
fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill-white)"};
|
|
7724
7722
|
}
|
|
7725
7723
|
}
|
|
7726
7724
|
`;
|
|
@@ -7729,7 +7727,7 @@ var StyledHiddenCheckboxInput = import_styled_components34.default.input`
|
|
|
7729
7727
|
|
|
7730
7728
|
/* toggles display of faux-input background-color */
|
|
7731
7729
|
&:checked + label [data-wui-faux-input='true'] {
|
|
7732
|
-
background-color: var(--wui-color-bg-fill);
|
|
7730
|
+
background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"};
|
|
7733
7731
|
}
|
|
7734
7732
|
|
|
7735
7733
|
/* toggles display of CheckIcon */
|
|
@@ -7754,47 +7752,42 @@ var Checkbox = (0, import_react18.forwardRef)(
|
|
|
7754
7752
|
}, ref) => {
|
|
7755
7753
|
const generatedId = (0, import_react18.useId)();
|
|
7756
7754
|
const computedId = (0, import_type_guards22.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
7757
|
-
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
7756
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7757
|
+
StyledHiddenCheckboxInput,
|
|
7758
|
+
{
|
|
7759
|
+
...props,
|
|
7760
|
+
ref,
|
|
7761
|
+
checked,
|
|
7762
|
+
disabled,
|
|
7763
|
+
id: computedId,
|
|
7764
|
+
name,
|
|
7765
|
+
onChange,
|
|
7766
|
+
required,
|
|
7767
|
+
type: "checkbox",
|
|
7768
|
+
value
|
|
7769
|
+
}
|
|
7770
|
+
),
|
|
7771
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7772
|
+
FormControlLabel,
|
|
7773
|
+
{
|
|
7774
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7775
|
+
StyledCheckboxInput,
|
|
7765
7776
|
{
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
id: computedId,
|
|
7771
|
-
name,
|
|
7772
|
-
onChange,
|
|
7773
|
-
required,
|
|
7774
|
-
type: "checkbox",
|
|
7775
|
-
value
|
|
7777
|
+
$disabled: disabled,
|
|
7778
|
+
$size: size,
|
|
7779
|
+
"data-wui-faux-input": "true",
|
|
7780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(CheckIcon, {})
|
|
7776
7781
|
}
|
|
7777
7782
|
),
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(CheckIcon, {})
|
|
7787
|
-
}
|
|
7788
|
-
),
|
|
7789
|
-
description,
|
|
7790
|
-
hideLabel,
|
|
7791
|
-
htmlFor: computedId,
|
|
7792
|
-
label
|
|
7793
|
-
}
|
|
7794
|
-
)
|
|
7795
|
-
]
|
|
7796
|
-
}
|
|
7797
|
-
);
|
|
7783
|
+
description,
|
|
7784
|
+
disabled,
|
|
7785
|
+
hideLabel,
|
|
7786
|
+
htmlFor: computedId,
|
|
7787
|
+
label
|
|
7788
|
+
}
|
|
7789
|
+
)
|
|
7790
|
+
] });
|
|
7798
7791
|
}
|
|
7799
7792
|
);
|
|
7800
7793
|
Checkbox.displayName = "Checkbox";
|
|
@@ -9061,7 +9054,7 @@ var requiredStyle = import_styled_components48.css`
|
|
|
9061
9054
|
content: '*';
|
|
9062
9055
|
}
|
|
9063
9056
|
`;
|
|
9064
|
-
var
|
|
9057
|
+
var disabledStyle3 = import_styled_components48.css`
|
|
9065
9058
|
color: var(--wui-color-text-disabled);
|
|
9066
9059
|
`;
|
|
9067
9060
|
var StyledLabel3 = import_styled_components48.default.label`
|
|
@@ -9085,7 +9078,7 @@ var StyledLabel3 = import_styled_components48.default.label`
|
|
|
9085
9078
|
}
|
|
9086
9079
|
|
|
9087
9080
|
${({ $screenReaderOnly }) => $screenReaderOnly && visuallyHiddenStyle}
|
|
9088
|
-
${({ $disabled }) => $disabled &&
|
|
9081
|
+
${({ $disabled }) => $disabled && disabledStyle3}
|
|
9089
9082
|
${({ $required }) => $required && requiredStyle}
|
|
9090
9083
|
`;
|
|
9091
9084
|
var Label = ({
|
|
@@ -10381,19 +10374,6 @@ var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
|
10381
10374
|
)
|
|
10382
10375
|
}
|
|
10383
10376
|
);
|
|
10384
|
-
var StyledHiddenRadioInput = import_styled_components65.default.input`
|
|
10385
|
-
${visuallyHiddenStyle}
|
|
10386
|
-
|
|
10387
|
-
/* toggles display of faux-input background-color */
|
|
10388
|
-
&:checked + label [data-wui-faux-input='true'] {
|
|
10389
|
-
border-color: var(--wui-color-bg-fill);
|
|
10390
|
-
}
|
|
10391
|
-
|
|
10392
|
-
/* toggles display of RadioIcon */
|
|
10393
|
-
&:checked + label svg {
|
|
10394
|
-
display: block;
|
|
10395
|
-
}
|
|
10396
|
-
`;
|
|
10397
10377
|
var inputSizeSmall2 = import_styled_components65.css`
|
|
10398
10378
|
width: 14px;
|
|
10399
10379
|
height: 14px;
|
|
@@ -10417,37 +10397,46 @@ var getSizeCss2 = (size) => {
|
|
|
10417
10397
|
if (size === "lg") return inputSizeLarge2;
|
|
10418
10398
|
return inputSizeMedium2;
|
|
10419
10399
|
};
|
|
10400
|
+
var StyledRadioWrapper = import_styled_components65.default.div`
|
|
10401
|
+
display: flex;
|
|
10402
|
+
margin: 0;
|
|
10403
|
+
|
|
10404
|
+
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
10405
|
+
user-select: none;
|
|
10406
|
+
`;
|
|
10420
10407
|
var StyledRadioInput = import_styled_components65.default.div`
|
|
10421
10408
|
${({ $size }) => getSizeCss2($size)}
|
|
10422
10409
|
line-height: 0;
|
|
10423
10410
|
margin: 0;
|
|
10424
|
-
border: 1px solid var(--wui-color-border);
|
|
10425
10411
|
border-radius: 50%; /* TODO --wui-border-radius-rounded */
|
|
10426
|
-
background-color: var(--wui-color-bg-fill-white);
|
|
10427
10412
|
display: grid;
|
|
10428
10413
|
place-content: center;
|
|
10429
10414
|
align-self: flex-start;
|
|
10415
|
+
background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface)"};
|
|
10416
|
+
border: 1px solid
|
|
10417
|
+
${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-border)"};
|
|
10430
10418
|
|
|
10419
|
+
/* radio button circle icon */
|
|
10431
10420
|
svg {
|
|
10432
10421
|
display: none;
|
|
10433
10422
|
|
|
10434
10423
|
circle {
|
|
10435
|
-
fill: var(--wui-color-bg-fill);
|
|
10424
|
+
fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill)"};
|
|
10436
10425
|
}
|
|
10437
10426
|
}
|
|
10438
10427
|
`;
|
|
10439
|
-
var
|
|
10440
|
-
|
|
10441
|
-
opacity: 0.5;
|
|
10442
|
-
`;
|
|
10443
|
-
var StyledRadioWrapper = import_styled_components65.default.div`
|
|
10444
|
-
display: flex;
|
|
10445
|
-
margin: 0;
|
|
10428
|
+
var StyledHiddenRadioInput = import_styled_components65.default.input`
|
|
10429
|
+
${visuallyHiddenStyle}
|
|
10446
10430
|
|
|
10447
|
-
/*
|
|
10448
|
-
|
|
10431
|
+
/* toggles display of faux-input background-color */
|
|
10432
|
+
&:checked + label [data-wui-faux-input='true'] {
|
|
10433
|
+
border-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"};
|
|
10434
|
+
}
|
|
10449
10435
|
|
|
10450
|
-
|
|
10436
|
+
/* toggles display of RadioIcon */
|
|
10437
|
+
&:checked + label svg {
|
|
10438
|
+
display: block;
|
|
10439
|
+
}
|
|
10451
10440
|
`;
|
|
10452
10441
|
var Radio = (0, import_react43.forwardRef)(
|
|
10453
10442
|
({
|
|
@@ -10493,12 +10482,14 @@ var Radio = (0, import_react43.forwardRef)(
|
|
|
10493
10482
|
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
10494
10483
|
StyledRadioInput,
|
|
10495
10484
|
{
|
|
10485
|
+
$disabled: disabled,
|
|
10496
10486
|
$size: size,
|
|
10497
10487
|
"data-wui-faux-input": "true",
|
|
10498
10488
|
children: /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(RadioIcon, {})
|
|
10499
10489
|
}
|
|
10500
10490
|
),
|
|
10501
10491
|
description,
|
|
10492
|
+
disabled,
|
|
10502
10493
|
hideLabel,
|
|
10503
10494
|
htmlFor: computedId,
|
|
10504
10495
|
label
|