@wistia/ui 0.6.23 → 0.6.24-beta.bc4631ae.8dd9eb3
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 +113 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +113 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -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.24-beta.bc4631ae.8dd9eb3
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7612,9 +7612,9 @@ var StyledFormControlLabel = import_styled_components33.default.label`
|
|
|
7612
7612
|
cursor: pointer;
|
|
7613
7613
|
display: flex;
|
|
7614
7614
|
align-items: center;
|
|
7615
|
-
gap: var(--wui-space-
|
|
7615
|
+
gap: var(--wui-space-02);
|
|
7616
7616
|
width: 100%;
|
|
7617
|
-
color: var(--wui-color-
|
|
7617
|
+
color: var(--wui-color-text);
|
|
7618
7618
|
font-size: var(--wui-typography-label-3-size);
|
|
7619
7619
|
font-weight: var(--wui-typography-label-3-weight);
|
|
7620
7620
|
line-height: var(--wui-typography-label-3-line-height);
|
|
@@ -7676,30 +7676,66 @@ var inputSizeSmall = import_styled_components34.css`
|
|
|
7676
7676
|
height: 14px;
|
|
7677
7677
|
min-width: 14px;
|
|
7678
7678
|
min-height: 14px;
|
|
7679
|
+
|
|
7680
|
+
svg {
|
|
7681
|
+
width: 7px;
|
|
7682
|
+
height: 7px;
|
|
7683
|
+
}
|
|
7679
7684
|
`;
|
|
7680
7685
|
var inputSizeMedium = import_styled_components34.css`
|
|
7681
7686
|
width: 16px;
|
|
7682
7687
|
height: 16px;
|
|
7683
7688
|
min-width: 16px;
|
|
7684
7689
|
min-height: 16px;
|
|
7690
|
+
|
|
7691
|
+
svg {
|
|
7692
|
+
width: 9px;
|
|
7693
|
+
height: 9px;
|
|
7694
|
+
}
|
|
7685
7695
|
`;
|
|
7686
7696
|
var inputSizeLarge = import_styled_components34.css`
|
|
7687
7697
|
width: 20px;
|
|
7688
7698
|
height: 20px;
|
|
7689
7699
|
min-width: 20px;
|
|
7690
7700
|
min-height: 20px;
|
|
7701
|
+
|
|
7702
|
+
svg {
|
|
7703
|
+
width: 11px;
|
|
7704
|
+
height: 11px;
|
|
7705
|
+
}
|
|
7691
7706
|
`;
|
|
7692
7707
|
var getSizeCss = (size) => {
|
|
7693
7708
|
if (size === "sm") return inputSizeSmall;
|
|
7694
7709
|
if (size === "lg") return inputSizeLarge;
|
|
7695
7710
|
return inputSizeMedium;
|
|
7696
7711
|
};
|
|
7697
|
-
var
|
|
7712
|
+
var visibleLabelStyle = import_styled_components34.css`
|
|
7713
|
+
padding: var(--wui-space-02);
|
|
7714
|
+
border-radius: var(--wui-border-radius-01);
|
|
7715
|
+
gap: var(--wui-space-02);
|
|
7716
|
+
transition: background-color var(--wui-motion-duration-01) var(--wui-motion-ease);
|
|
7717
|
+
cursor: pointer;
|
|
7718
|
+
|
|
7719
|
+
&:hover {
|
|
7720
|
+
background-color: var(--wui-color-bg-surface-hover);
|
|
7721
|
+
}
|
|
7722
|
+
|
|
7723
|
+
&:active {
|
|
7724
|
+
background-color: var(--wui-color-bg-surface-active);
|
|
7725
|
+
}
|
|
7726
|
+
`;
|
|
7727
|
+
var StyledCheckboxRadioWrapper = import_styled_components34.default.div`
|
|
7698
7728
|
display: flex;
|
|
7699
7729
|
margin: 0;
|
|
7730
|
+
${({ $labelHidden }) => !$labelHidden && visibleLabelStyle}
|
|
7700
7731
|
|
|
7701
7732
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
7702
7733
|
user-select: none;
|
|
7734
|
+
|
|
7735
|
+
--wui-checkbox-radio-border-color: var(--wui-color-border-secondary);
|
|
7736
|
+
&:hover {
|
|
7737
|
+
--wui-checkbox-radio-border-color: var(--wui-color-border-secondary-hover);
|
|
7738
|
+
}
|
|
7703
7739
|
`;
|
|
7704
7740
|
var StyledCheckboxInput = import_styled_components34.default.div`
|
|
7705
7741
|
${({ $size }) => getSizeCss($size)}
|
|
@@ -7709,16 +7745,17 @@ var StyledCheckboxInput = import_styled_components34.default.div`
|
|
|
7709
7745
|
display: grid;
|
|
7710
7746
|
place-content: center;
|
|
7711
7747
|
align-self: flex-start;
|
|
7748
|
+
border-width: 1px;
|
|
7749
|
+
border-style: solid;
|
|
7750
|
+
border-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-border-disabled)" : "var(--wui-checkbox-radio-border-color)"};
|
|
7712
7751
|
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)"};
|
|
7715
7752
|
|
|
7716
7753
|
/* checkmark icon */
|
|
7717
7754
|
svg {
|
|
7718
7755
|
display: none;
|
|
7719
7756
|
|
|
7720
7757
|
path {
|
|
7721
|
-
fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-
|
|
7758
|
+
fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-icon-on-fill)"};
|
|
7722
7759
|
}
|
|
7723
7760
|
}
|
|
7724
7761
|
`;
|
|
@@ -7727,6 +7764,7 @@ var StyledHiddenCheckboxInput = import_styled_components34.default.input`
|
|
|
7727
7764
|
|
|
7728
7765
|
/* toggles display of faux-input background-color */
|
|
7729
7766
|
&:checked + label [data-wui-faux-input='true'] {
|
|
7767
|
+
border-color: ${({ disabled }) => disabled ? void 0 : "var(--wui-color-bg-fill)"};
|
|
7730
7768
|
background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"};
|
|
7731
7769
|
}
|
|
7732
7770
|
|
|
@@ -7752,42 +7790,49 @@ var Checkbox = (0, import_react18.forwardRef)(
|
|
|
7752
7790
|
}, ref) => {
|
|
7753
7791
|
const generatedId = (0, import_react18.useId)();
|
|
7754
7792
|
const computedId = (0, import_type_guards22.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
7755
|
-
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
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,
|
|
7793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(
|
|
7794
|
+
StyledCheckboxRadioWrapper,
|
|
7795
|
+
{
|
|
7796
|
+
$disabled: disabled,
|
|
7797
|
+
$labelHidden: hideLabel,
|
|
7798
|
+
children: [
|
|
7799
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7800
|
+
StyledHiddenCheckboxInput,
|
|
7776
7801
|
{
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7802
|
+
...props,
|
|
7803
|
+
ref,
|
|
7804
|
+
checked,
|
|
7805
|
+
disabled,
|
|
7806
|
+
id: computedId,
|
|
7807
|
+
name,
|
|
7808
|
+
onChange,
|
|
7809
|
+
required,
|
|
7810
|
+
type: "checkbox",
|
|
7811
|
+
value
|
|
7781
7812
|
}
|
|
7782
7813
|
),
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7814
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7815
|
+
FormControlLabel,
|
|
7816
|
+
{
|
|
7817
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
7818
|
+
StyledCheckboxInput,
|
|
7819
|
+
{
|
|
7820
|
+
$disabled: disabled,
|
|
7821
|
+
$size: size,
|
|
7822
|
+
"data-wui-faux-input": "true",
|
|
7823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(CheckIcon, {})
|
|
7824
|
+
}
|
|
7825
|
+
),
|
|
7826
|
+
description,
|
|
7827
|
+
disabled,
|
|
7828
|
+
hideLabel,
|
|
7829
|
+
htmlFor: computedId,
|
|
7830
|
+
label
|
|
7831
|
+
}
|
|
7832
|
+
)
|
|
7833
|
+
]
|
|
7834
|
+
}
|
|
7835
|
+
);
|
|
7791
7836
|
}
|
|
7792
7837
|
);
|
|
7793
7838
|
Checkbox.displayName = "Checkbox";
|
|
@@ -10359,17 +10404,17 @@ var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
|
10359
10404
|
"svg",
|
|
10360
10405
|
{
|
|
10361
10406
|
fill: "inherit",
|
|
10362
|
-
height: "
|
|
10363
|
-
viewBox: "0 0
|
|
10364
|
-
width: "
|
|
10407
|
+
height: "1",
|
|
10408
|
+
viewBox: "0 0 1 1",
|
|
10409
|
+
width: "1",
|
|
10365
10410
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10366
10411
|
children: /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
10367
10412
|
"circle",
|
|
10368
10413
|
{
|
|
10369
|
-
cx: "
|
|
10370
|
-
cy: "
|
|
10414
|
+
cx: "0.5",
|
|
10415
|
+
cy: "0.5",
|
|
10371
10416
|
fill: "currentColor",
|
|
10372
|
-
r: "
|
|
10417
|
+
r: "0.5"
|
|
10373
10418
|
}
|
|
10374
10419
|
)
|
|
10375
10420
|
}
|
|
@@ -10379,31 +10424,39 @@ var inputSizeSmall2 = import_styled_components65.css`
|
|
|
10379
10424
|
height: 14px;
|
|
10380
10425
|
min-width: 14px;
|
|
10381
10426
|
min-height: 14px;
|
|
10427
|
+
|
|
10428
|
+
svg {
|
|
10429
|
+
width: 7px;
|
|
10430
|
+
height: 7px;
|
|
10431
|
+
}
|
|
10382
10432
|
`;
|
|
10383
10433
|
var inputSizeMedium2 = import_styled_components65.css`
|
|
10384
10434
|
width: 16px;
|
|
10385
10435
|
height: 16px;
|
|
10386
10436
|
min-width: 16px;
|
|
10387
10437
|
min-height: 16px;
|
|
10438
|
+
|
|
10439
|
+
svg {
|
|
10440
|
+
width: 8px;
|
|
10441
|
+
height: 8px;
|
|
10442
|
+
}
|
|
10388
10443
|
`;
|
|
10389
10444
|
var inputSizeLarge2 = import_styled_components65.css`
|
|
10390
10445
|
width: 20px;
|
|
10391
10446
|
height: 20px;
|
|
10392
10447
|
min-width: 20px;
|
|
10393
10448
|
min-height: 20px;
|
|
10449
|
+
|
|
10450
|
+
svg {
|
|
10451
|
+
width: 10px;
|
|
10452
|
+
height: 10px;
|
|
10453
|
+
}
|
|
10394
10454
|
`;
|
|
10395
10455
|
var getSizeCss2 = (size) => {
|
|
10396
10456
|
if (size === "sm") return inputSizeSmall2;
|
|
10397
10457
|
if (size === "lg") return inputSizeLarge2;
|
|
10398
10458
|
return inputSizeMedium2;
|
|
10399
10459
|
};
|
|
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
|
-
`;
|
|
10407
10460
|
var StyledRadioInput = import_styled_components65.default.div`
|
|
10408
10461
|
${({ $size }) => getSizeCss2($size)}
|
|
10409
10462
|
line-height: 0;
|
|
@@ -10412,9 +10465,10 @@ var StyledRadioInput = import_styled_components65.default.div`
|
|
|
10412
10465
|
display: grid;
|
|
10413
10466
|
place-content: center;
|
|
10414
10467
|
align-self: flex-start;
|
|
10468
|
+
border-width: 1px;
|
|
10469
|
+
border-style: solid;
|
|
10470
|
+
border-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-border-disabled)" : "var(--wui-color-border)"};
|
|
10415
10471
|
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)"};
|
|
10418
10472
|
|
|
10419
10473
|
/* radio button circle icon */
|
|
10420
10474
|
svg {
|
|
@@ -10428,9 +10482,9 @@ var StyledRadioInput = import_styled_components65.default.div`
|
|
|
10428
10482
|
var StyledHiddenRadioInput = import_styled_components65.default.input`
|
|
10429
10483
|
${visuallyHiddenStyle}
|
|
10430
10484
|
|
|
10431
|
-
/* toggles display of faux-input
|
|
10485
|
+
/* toggles display of faux-input border-color */
|
|
10432
10486
|
&:checked + label [data-wui-faux-input='true'] {
|
|
10433
|
-
border-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-
|
|
10487
|
+
border-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-border-disabled)" : "var(--wui-color-bg-fill)"};
|
|
10434
10488
|
}
|
|
10435
10489
|
|
|
10436
10490
|
/* toggles display of RadioIcon */
|
|
@@ -10456,9 +10510,10 @@ var Radio = (0, import_react43.forwardRef)(
|
|
|
10456
10510
|
const generatedId = (0, import_react43.useId)();
|
|
10457
10511
|
const computedId = (0, import_type_guards38.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
10458
10512
|
return /* @__PURE__ */ (0, import_jsx_runtime241.jsxs)(
|
|
10459
|
-
|
|
10513
|
+
StyledCheckboxRadioWrapper,
|
|
10460
10514
|
{
|
|
10461
10515
|
$disabled: disabled,
|
|
10516
|
+
$labelHidden: hideLabel,
|
|
10462
10517
|
"aria-invalid": props["aria-invalid"],
|
|
10463
10518
|
children: [
|
|
10464
10519
|
/* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|