@wistia/ui 0.6.22 → 0.6.23-beta.8d23fa5f.423e6c7
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 +112 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +112 -88
- 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-beta.8d23fa5f.423e6c7
|
|
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,58 +7671,70 @@ 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;
|
|
7679
7677
|
min-width: 14px;
|
|
7680
7678
|
min-height: 14px;
|
|
7679
|
+
|
|
7680
|
+
svg {
|
|
7681
|
+
width: 7px;
|
|
7682
|
+
height: 7px;
|
|
7683
|
+
}
|
|
7681
7684
|
`;
|
|
7682
7685
|
var inputSizeMedium = import_styled_components34.css`
|
|
7683
7686
|
width: 16px;
|
|
7684
7687
|
height: 16px;
|
|
7685
7688
|
min-width: 16px;
|
|
7686
7689
|
min-height: 16px;
|
|
7690
|
+
|
|
7691
|
+
svg {
|
|
7692
|
+
width: 9px;
|
|
7693
|
+
height: 9px;
|
|
7694
|
+
}
|
|
7687
7695
|
`;
|
|
7688
7696
|
var inputSizeLarge = import_styled_components34.css`
|
|
7689
7697
|
width: 20px;
|
|
7690
7698
|
height: 20px;
|
|
7691
7699
|
min-width: 20px;
|
|
7692
7700
|
min-height: 20px;
|
|
7701
|
+
|
|
7702
|
+
svg {
|
|
7703
|
+
width: 11px;
|
|
7704
|
+
height: 11px;
|
|
7705
|
+
}
|
|
7693
7706
|
`;
|
|
7707
|
+
var getSizeCss = (size) => {
|
|
7708
|
+
if (size === "sm") return inputSizeSmall;
|
|
7709
|
+
if (size === "lg") return inputSizeLarge;
|
|
7710
|
+
return inputSizeMedium;
|
|
7711
|
+
};
|
|
7694
7712
|
var StyledCheckboxWrapper = import_styled_components34.default.div`
|
|
7695
7713
|
display: flex;
|
|
7696
7714
|
margin: 0;
|
|
7697
7715
|
|
|
7698
7716
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
7699
7717
|
user-select: none;
|
|
7700
|
-
|
|
7701
|
-
${({ disabled }) => disabled && disabledStyle3};
|
|
7702
7718
|
`;
|
|
7703
|
-
var getSizeCss = (size) => {
|
|
7704
|
-
if (size === "sm") return inputSizeSmall;
|
|
7705
|
-
if (size === "lg") return inputSizeLarge;
|
|
7706
|
-
return inputSizeMedium;
|
|
7707
|
-
};
|
|
7708
7719
|
var StyledCheckboxInput = import_styled_components34.default.div`
|
|
7709
7720
|
${({ $size }) => getSizeCss($size)}
|
|
7710
7721
|
line-height: 0;
|
|
7711
7722
|
margin: 0;
|
|
7712
|
-
border: 1px solid var(--wui-color-border);
|
|
7713
7723
|
border-radius: var(--wui-border-radius-01);
|
|
7714
|
-
background-color: var(--wui-color-bg-fill-white);
|
|
7715
7724
|
display: grid;
|
|
7716
7725
|
place-content: center;
|
|
7717
7726
|
align-self: flex-start;
|
|
7727
|
+
border-width: 1px;
|
|
7728
|
+
border-style: solid;
|
|
7729
|
+
border-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-border-disabled)" : "var(--wui-color-border)"};
|
|
7730
|
+
background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface)"};
|
|
7718
7731
|
|
|
7732
|
+
/* checkmark icon */
|
|
7719
7733
|
svg {
|
|
7720
7734
|
display: none;
|
|
7721
7735
|
|
|
7722
7736
|
path {
|
|
7723
|
-
fill: var(--wui-color-bg-fill-white);
|
|
7737
|
+
fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill-white)"};
|
|
7724
7738
|
}
|
|
7725
7739
|
}
|
|
7726
7740
|
`;
|
|
@@ -7729,7 +7743,8 @@ var StyledHiddenCheckboxInput = import_styled_components34.default.input`
|
|
|
7729
7743
|
|
|
7730
7744
|
/* toggles display of faux-input background-color */
|
|
7731
7745
|
&:checked + label [data-wui-faux-input='true'] {
|
|
7732
|
-
|
|
7746
|
+
border-color: ${({ disabled }) => disabled ? void 0 : "var(--wui-color-bg-fill)"};
|
|
7747
|
+
background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"};
|
|
7733
7748
|
}
|
|
7734
7749
|
|
|
7735
7750
|
/* toggles display of CheckIcon */
|
|
@@ -7754,47 +7769,42 @@ var Checkbox = (0, import_react18.forwardRef)(
|
|
|
7754
7769
|
}, ref) => {
|
|
7755
7770
|
const generatedId = (0, import_react18.useId)();
|
|
7756
7771
|
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
|
-
|
|
7772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
7773
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7774
|
+
StyledHiddenCheckboxInput,
|
|
7775
|
+
{
|
|
7776
|
+
...props,
|
|
7777
|
+
ref,
|
|
7778
|
+
checked,
|
|
7779
|
+
disabled,
|
|
7780
|
+
id: computedId,
|
|
7781
|
+
name,
|
|
7782
|
+
onChange,
|
|
7783
|
+
required,
|
|
7784
|
+
type: "checkbox",
|
|
7785
|
+
value
|
|
7786
|
+
}
|
|
7787
|
+
),
|
|
7788
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7789
|
+
FormControlLabel,
|
|
7790
|
+
{
|
|
7791
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7792
|
+
StyledCheckboxInput,
|
|
7765
7793
|
{
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
id: computedId,
|
|
7771
|
-
name,
|
|
7772
|
-
onChange,
|
|
7773
|
-
required,
|
|
7774
|
-
type: "checkbox",
|
|
7775
|
-
value
|
|
7794
|
+
$disabled: disabled,
|
|
7795
|
+
$size: size,
|
|
7796
|
+
"data-wui-faux-input": "true",
|
|
7797
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(CheckIcon, {})
|
|
7776
7798
|
}
|
|
7777
7799
|
),
|
|
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
|
-
);
|
|
7800
|
+
description,
|
|
7801
|
+
disabled,
|
|
7802
|
+
hideLabel,
|
|
7803
|
+
htmlFor: computedId,
|
|
7804
|
+
label
|
|
7805
|
+
}
|
|
7806
|
+
)
|
|
7807
|
+
] });
|
|
7798
7808
|
}
|
|
7799
7809
|
);
|
|
7800
7810
|
Checkbox.displayName = "Checkbox";
|
|
@@ -9061,7 +9071,7 @@ var requiredStyle = import_styled_components48.css`
|
|
|
9061
9071
|
content: '*';
|
|
9062
9072
|
}
|
|
9063
9073
|
`;
|
|
9064
|
-
var
|
|
9074
|
+
var disabledStyle3 = import_styled_components48.css`
|
|
9065
9075
|
color: var(--wui-color-text-disabled);
|
|
9066
9076
|
`;
|
|
9067
9077
|
var StyledLabel3 = import_styled_components48.default.label`
|
|
@@ -9085,7 +9095,7 @@ var StyledLabel3 = import_styled_components48.default.label`
|
|
|
9085
9095
|
}
|
|
9086
9096
|
|
|
9087
9097
|
${({ $screenReaderOnly }) => $screenReaderOnly && visuallyHiddenStyle}
|
|
9088
|
-
${({ $disabled }) => $disabled &&
|
|
9098
|
+
${({ $disabled }) => $disabled && disabledStyle3}
|
|
9089
9099
|
${({ $required }) => $required && requiredStyle}
|
|
9090
9100
|
`;
|
|
9091
9101
|
var Label = ({
|
|
@@ -10366,88 +10376,100 @@ var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
|
10366
10376
|
"svg",
|
|
10367
10377
|
{
|
|
10368
10378
|
fill: "inherit",
|
|
10369
|
-
height: "
|
|
10370
|
-
viewBox: "0 0
|
|
10371
|
-
width: "
|
|
10379
|
+
height: "1",
|
|
10380
|
+
viewBox: "0 0 1 1",
|
|
10381
|
+
width: "1",
|
|
10372
10382
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10373
10383
|
children: /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
10374
10384
|
"circle",
|
|
10375
10385
|
{
|
|
10376
|
-
cx: "
|
|
10377
|
-
cy: "
|
|
10386
|
+
cx: "0.5",
|
|
10387
|
+
cy: "0.5",
|
|
10378
10388
|
fill: "currentColor",
|
|
10379
|
-
r: "
|
|
10389
|
+
r: "0.5"
|
|
10380
10390
|
}
|
|
10381
10391
|
)
|
|
10382
10392
|
}
|
|
10383
10393
|
);
|
|
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
10394
|
var inputSizeSmall2 = import_styled_components65.css`
|
|
10398
10395
|
width: 14px;
|
|
10399
10396
|
height: 14px;
|
|
10400
10397
|
min-width: 14px;
|
|
10401
10398
|
min-height: 14px;
|
|
10399
|
+
|
|
10400
|
+
svg {
|
|
10401
|
+
width: 7px;
|
|
10402
|
+
height: 7px;
|
|
10403
|
+
}
|
|
10402
10404
|
`;
|
|
10403
10405
|
var inputSizeMedium2 = import_styled_components65.css`
|
|
10404
10406
|
width: 16px;
|
|
10405
10407
|
height: 16px;
|
|
10406
10408
|
min-width: 16px;
|
|
10407
10409
|
min-height: 16px;
|
|
10410
|
+
|
|
10411
|
+
svg {
|
|
10412
|
+
width: 8px;
|
|
10413
|
+
height: 8px;
|
|
10414
|
+
}
|
|
10408
10415
|
`;
|
|
10409
10416
|
var inputSizeLarge2 = import_styled_components65.css`
|
|
10410
10417
|
width: 20px;
|
|
10411
10418
|
height: 20px;
|
|
10412
10419
|
min-width: 20px;
|
|
10413
10420
|
min-height: 20px;
|
|
10421
|
+
|
|
10422
|
+
svg {
|
|
10423
|
+
width: 10px;
|
|
10424
|
+
height: 10px;
|
|
10425
|
+
}
|
|
10414
10426
|
`;
|
|
10415
10427
|
var getSizeCss2 = (size) => {
|
|
10416
10428
|
if (size === "sm") return inputSizeSmall2;
|
|
10417
10429
|
if (size === "lg") return inputSizeLarge2;
|
|
10418
10430
|
return inputSizeMedium2;
|
|
10419
10431
|
};
|
|
10432
|
+
var StyledRadioWrapper = import_styled_components65.default.div`
|
|
10433
|
+
display: flex;
|
|
10434
|
+
margin: 0;
|
|
10435
|
+
|
|
10436
|
+
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
10437
|
+
user-select: none;
|
|
10438
|
+
`;
|
|
10420
10439
|
var StyledRadioInput = import_styled_components65.default.div`
|
|
10421
10440
|
${({ $size }) => getSizeCss2($size)}
|
|
10422
10441
|
line-height: 0;
|
|
10423
10442
|
margin: 0;
|
|
10424
|
-
border: 1px solid var(--wui-color-border);
|
|
10425
10443
|
border-radius: 50%; /* TODO --wui-border-radius-rounded */
|
|
10426
|
-
background-color: var(--wui-color-bg-fill-white);
|
|
10427
10444
|
display: grid;
|
|
10428
10445
|
place-content: center;
|
|
10429
10446
|
align-self: flex-start;
|
|
10447
|
+
border-width: 1px;
|
|
10448
|
+
border-style: solid;
|
|
10449
|
+
border-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-border-disabled)" : "var(--wui-color-border)"};
|
|
10450
|
+
background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface)"};
|
|
10430
10451
|
|
|
10452
|
+
/* radio button circle icon */
|
|
10431
10453
|
svg {
|
|
10432
10454
|
display: none;
|
|
10433
10455
|
|
|
10434
10456
|
circle {
|
|
10435
|
-
fill: var(--wui-color-bg-fill);
|
|
10457
|
+
fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill)"};
|
|
10436
10458
|
}
|
|
10437
10459
|
}
|
|
10438
10460
|
`;
|
|
10439
|
-
var
|
|
10440
|
-
|
|
10441
|
-
opacity: 0.5;
|
|
10442
|
-
`;
|
|
10443
|
-
var StyledRadioWrapper = import_styled_components65.default.div`
|
|
10444
|
-
display: flex;
|
|
10445
|
-
margin: 0;
|
|
10461
|
+
var StyledHiddenRadioInput = import_styled_components65.default.input`
|
|
10462
|
+
${visuallyHiddenStyle}
|
|
10446
10463
|
|
|
10447
|
-
/*
|
|
10448
|
-
|
|
10464
|
+
/* toggles display of faux-input border-color */
|
|
10465
|
+
&:checked + label [data-wui-faux-input='true'] {
|
|
10466
|
+
border-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-border-disabled)" : "var(--wui-color-bg-fill)"};
|
|
10467
|
+
}
|
|
10449
10468
|
|
|
10450
|
-
|
|
10469
|
+
/* toggles display of RadioIcon */
|
|
10470
|
+
&:checked + label svg {
|
|
10471
|
+
display: block;
|
|
10472
|
+
}
|
|
10451
10473
|
`;
|
|
10452
10474
|
var Radio = (0, import_react43.forwardRef)(
|
|
10453
10475
|
({
|
|
@@ -10493,12 +10515,14 @@ var Radio = (0, import_react43.forwardRef)(
|
|
|
10493
10515
|
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
10494
10516
|
StyledRadioInput,
|
|
10495
10517
|
{
|
|
10518
|
+
$disabled: disabled,
|
|
10496
10519
|
$size: size,
|
|
10497
10520
|
"data-wui-faux-input": "true",
|
|
10498
10521
|
children: /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(RadioIcon, {})
|
|
10499
10522
|
}
|
|
10500
10523
|
),
|
|
10501
10524
|
description,
|
|
10525
|
+
disabled,
|
|
10502
10526
|
hideLabel,
|
|
10503
10527
|
htmlFor: computedId,
|
|
10504
10528
|
label
|