@wistia/ui 0.14.16 → 0.14.18-beta.3ca4a40e.b5c608b
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 +261 -299
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +261 -299
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -17
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.14.
|
|
3
|
+
* @license @wistia/ui v0.14.18-beta.3ca4a40e.b5c608b
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -302,6 +302,10 @@ var globalStyleAdjustmentsCss = import_styled_components.css`
|
|
|
302
302
|
scroll-margin-block: 5ex;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
+
dl {
|
|
306
|
+
margin: 0;
|
|
307
|
+
}
|
|
308
|
+
|
|
305
309
|
/* Remove all animations and transitions for people that prefer not to see them */
|
|
306
310
|
@media (prefers-reduced-motion: reduce) {
|
|
307
311
|
html:focus-within {
|
|
@@ -9017,7 +9021,6 @@ var StyledFormControlLabelDescription = import_styled_components37.default.div`
|
|
|
9017
9021
|
font-size: var(--wui-typography-body-4-size);
|
|
9018
9022
|
font-weight: var(--wui-typography-body-4-weight);
|
|
9019
9023
|
line-height: var(--wui-typography-body-4-line-height);
|
|
9020
|
-
margin-top: var(--wui-space-01);
|
|
9021
9024
|
|
|
9022
9025
|
${({ $disabled }) => $disabled && disabledStyle}
|
|
9023
9026
|
`;
|
|
@@ -9076,12 +9079,12 @@ var StyledFormControlLabel = import_styled_components39.default.label`
|
|
|
9076
9079
|
cursor: pointer;
|
|
9077
9080
|
display: flex;
|
|
9078
9081
|
align-items: center;
|
|
9079
|
-
gap: var(--wui-space-
|
|
9082
|
+
gap: var(--wui-space-02);
|
|
9080
9083
|
width: 100%;
|
|
9081
9084
|
color: var(--wui-color-tex);
|
|
9082
9085
|
font-size: var(--wui-typography-label-3-size);
|
|
9083
9086
|
font-weight: var(--wui-typography-label-3-weight);
|
|
9084
|
-
line-height: var(--wui-typography-
|
|
9087
|
+
line-height: var(--wui-typography-body-3-line-height);
|
|
9085
9088
|
justify-content: ${({ $align }) => $align === "left" ? "flex-start" : "space-between"};
|
|
9086
9089
|
|
|
9087
9090
|
${({ $disabled }) => $disabled && disabledStyle2}
|
|
@@ -9164,11 +9167,9 @@ var Stack = makePolymorphic(StackComponent);
|
|
|
9164
9167
|
// src/components/FormGroup/FormGroup.tsx
|
|
9165
9168
|
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
9166
9169
|
var StyledFieldset = import_styled_components41.default.fieldset`
|
|
9170
|
+
padding: 0;
|
|
9171
|
+
margin: 0;
|
|
9167
9172
|
border: 0;
|
|
9168
|
-
|
|
9169
|
-
/* * {
|
|
9170
|
-
outline: 1px solid red;
|
|
9171
|
-
} */
|
|
9172
9173
|
`;
|
|
9173
9174
|
var StyledLegend = import_styled_components41.default.legend`
|
|
9174
9175
|
padding-inline: 0;
|
|
@@ -9176,10 +9177,6 @@ var StyledLegend = import_styled_components41.default.legend`
|
|
|
9176
9177
|
flex-direction: column;
|
|
9177
9178
|
gap: var(--wui-space-01);
|
|
9178
9179
|
margin-bottom: var(--wui-space-02);
|
|
9179
|
-
|
|
9180
|
-
&:has([data-wui-form-group-description]) {
|
|
9181
|
-
margin-bottom: var(--wui-space-01);
|
|
9182
|
-
}
|
|
9183
9180
|
`;
|
|
9184
9181
|
var FormGroup = ({
|
|
9185
9182
|
children,
|
|
@@ -9385,43 +9382,22 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
|
9385
9382
|
"path",
|
|
9386
9383
|
{
|
|
9387
9384
|
d: "M3.47281 7.19303L0.377565 4.07999C0.191609 3.89297 0.191609 3.58973 0.377565 3.40268L1.05098 2.72537C1.23694 2.53833 1.53847 2.53833 1.72442 2.72537L3.80953 4.82245L8.27558 0.330729C8.46154 0.143704 8.76306 0.143704 8.94902 0.330729L9.62244 1.00804C9.8084 1.19506 9.8084 1.49831 9.62244 1.68535L4.14624 7.19305C3.96027 7.38008 3.65876 7.38008 3.47281 7.19303Z",
|
|
9388
|
-
fill: "
|
|
9385
|
+
fill: "var(--wui-checkbox-icon-color)"
|
|
9389
9386
|
}
|
|
9390
9387
|
)
|
|
9391
9388
|
}
|
|
9392
9389
|
);
|
|
9393
9390
|
var sizeSmall = import_styled_components43.css`
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
min-width: 14px;
|
|
9397
|
-
min-height: 14px;
|
|
9398
|
-
|
|
9399
|
-
svg {
|
|
9400
|
-
width: 7px;
|
|
9401
|
-
height: 7px;
|
|
9402
|
-
}
|
|
9391
|
+
--wui-checkbox-size: 14px;
|
|
9392
|
+
--wui-checkbox-icon-size: 7px;
|
|
9403
9393
|
`;
|
|
9404
9394
|
var sizeMedium = import_styled_components43.css`
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
min-width: 16px;
|
|
9408
|
-
min-height: 16px;
|
|
9409
|
-
|
|
9410
|
-
svg {
|
|
9411
|
-
width: 9px;
|
|
9412
|
-
height: 9px;
|
|
9413
|
-
}
|
|
9395
|
+
--wui-checkbox-size: 16px;
|
|
9396
|
+
--wui-checkbox-icon-size: 9px;
|
|
9414
9397
|
`;
|
|
9415
9398
|
var sizeLarge = import_styled_components43.css`
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
min-width: 20px;
|
|
9419
|
-
min-height: 20px;
|
|
9420
|
-
|
|
9421
|
-
svg {
|
|
9422
|
-
width: 11px;
|
|
9423
|
-
height: 11px;
|
|
9424
|
-
}
|
|
9399
|
+
--wui-checkbox-size: 20px;
|
|
9400
|
+
--wui-checkbox-icon-size: 11px;
|
|
9425
9401
|
`;
|
|
9426
9402
|
var getSizeCss = (size) => {
|
|
9427
9403
|
if (size === "sm") return sizeSmall;
|
|
@@ -9429,6 +9405,36 @@ var getSizeCss = (size) => {
|
|
|
9429
9405
|
return sizeMedium;
|
|
9430
9406
|
};
|
|
9431
9407
|
var StyledCheckboxWrapper = import_styled_components43.default.div`
|
|
9408
|
+
--wui-checkbox-background-color: var(--wui-color-bg-surface);
|
|
9409
|
+
--wui-checkbox-border-color: var(--wui-color-border-secondary);
|
|
9410
|
+
--wui-checkbox-icon-color: transparent;
|
|
9411
|
+
--wui-checkbox-outline-color: transparent;
|
|
9412
|
+
|
|
9413
|
+
&:hover {
|
|
9414
|
+
--wui-checkbox-border-color: var(--wui-color-border-secondary-hover);
|
|
9415
|
+
}
|
|
9416
|
+
|
|
9417
|
+
&:has(input:checked) {
|
|
9418
|
+
--wui-checkbox-background-color: var(--wui-color-bg-fill);
|
|
9419
|
+
--wui-checkbox-border-color: transparent;
|
|
9420
|
+
--wui-checkbox-icon-color: var(--wui-color-bg-fill-white);
|
|
9421
|
+
}
|
|
9422
|
+
|
|
9423
|
+
&:has(input:disabled) {
|
|
9424
|
+
--wui-checkbox-background-color: var(--wui-color-bg-surface-disabled);
|
|
9425
|
+
--wui-checkbox-border-color: var(--wui-color-border-secondary);
|
|
9426
|
+
|
|
9427
|
+
&:has(input:checked) {
|
|
9428
|
+
--wui-checkbox-icon-color: var(--wui-color-icon-disabled);
|
|
9429
|
+
}
|
|
9430
|
+
}
|
|
9431
|
+
|
|
9432
|
+
&:has(input:focus-visible) {
|
|
9433
|
+
[data-wui-faux-input='true'] {
|
|
9434
|
+
--wui-checkbox-outline-color: var(--wui-color-focus-ring);
|
|
9435
|
+
}
|
|
9436
|
+
}
|
|
9437
|
+
|
|
9432
9438
|
display: flex;
|
|
9433
9439
|
margin: 0;
|
|
9434
9440
|
|
|
@@ -9437,7 +9443,6 @@ var StyledCheckboxWrapper = import_styled_components43.default.div`
|
|
|
9437
9443
|
`;
|
|
9438
9444
|
var StyledCheckboxInput = import_styled_components43.default.div`
|
|
9439
9445
|
${({ $size }) => getSizeCss($size)}
|
|
9440
|
-
line-height: 0;
|
|
9441
9446
|
margin: 0;
|
|
9442
9447
|
border-radius: var(--wui-border-radius-01);
|
|
9443
9448
|
display: grid;
|
|
@@ -9445,31 +9450,27 @@ var StyledCheckboxInput = import_styled_components43.default.div`
|
|
|
9445
9450
|
align-self: flex-start;
|
|
9446
9451
|
border-width: 1px;
|
|
9447
9452
|
border-style: solid;
|
|
9448
|
-
border-color:
|
|
9449
|
-
background-color:
|
|
9453
|
+
border-color: var(--wui-checkbox-border-color);
|
|
9454
|
+
background-color: var(--wui-checkbox-background-color);
|
|
9455
|
+
outline-color: var(--wui-checkbox-outline-color);
|
|
9456
|
+
outline-width: 2px;
|
|
9457
|
+
outline-style: solid;
|
|
9458
|
+
outline-offset: 1px;
|
|
9459
|
+
transition: all var(--wui-motion-duration-01) var(--wui-motion-ease);
|
|
9460
|
+
margin-top: calc(calc(1lh - var(--wui-checkbox-size)) / 2);
|
|
9461
|
+
width: var(--wui-checkbox-size);
|
|
9462
|
+
height: var(--wui-checkbox-size);
|
|
9463
|
+
min-width: var(--wui-checkbox-size);
|
|
9464
|
+
min-height: var(--wui-checkbox-size);
|
|
9450
9465
|
|
|
9451
|
-
/*
|
|
9466
|
+
/* checkbox icon */
|
|
9452
9467
|
svg {
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
path {
|
|
9456
|
-
fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill-white)"};
|
|
9457
|
-
}
|
|
9468
|
+
width: var(--wui-checkbox-icon-size);
|
|
9469
|
+
height: var(--wui-checkbox-icon-size);
|
|
9458
9470
|
}
|
|
9459
9471
|
`;
|
|
9460
9472
|
var StyledHiddenCheckboxInput = import_styled_components43.default.input`
|
|
9461
9473
|
${visuallyHiddenStyle}
|
|
9462
|
-
|
|
9463
|
-
/* toggles display of faux-input background-color */
|
|
9464
|
-
&:checked + label [data-wui-faux-input='true'] {
|
|
9465
|
-
border-color: ${({ disabled }) => disabled ? void 0 : "var(--wui-color-bg-fill)"};
|
|
9466
|
-
background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"};
|
|
9467
|
-
}
|
|
9468
|
-
|
|
9469
|
-
/* toggles display of CheckIcon */
|
|
9470
|
-
&:checked + label svg {
|
|
9471
|
-
display: block;
|
|
9472
|
-
}
|
|
9473
9474
|
`;
|
|
9474
9475
|
var Checkbox = (0, import_react38.forwardRef)(
|
|
9475
9476
|
({
|
|
@@ -9495,42 +9496,49 @@ var Checkbox = (0, import_react38.forwardRef)(
|
|
|
9495
9496
|
const checkboxName = name ?? contextName;
|
|
9496
9497
|
const handleOnChange = onChange ?? contextOnChange;
|
|
9497
9498
|
const isChecked = (0, import_type_guards31.isNotUndefined)(value) && contextValue ? contextValue.includes(value) : checked;
|
|
9498
|
-
return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
id: computedId,
|
|
9507
|
-
name: checkboxName,
|
|
9508
|
-
onChange: handleOnChange,
|
|
9509
|
-
required,
|
|
9510
|
-
type: "checkbox",
|
|
9511
|
-
value
|
|
9512
|
-
}
|
|
9513
|
-
),
|
|
9514
|
-
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9515
|
-
FormControlLabel,
|
|
9516
|
-
{
|
|
9517
|
-
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9518
|
-
StyledCheckboxInput,
|
|
9499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(
|
|
9500
|
+
StyledCheckboxWrapper,
|
|
9501
|
+
{
|
|
9502
|
+
$hideLabel: hideLabel,
|
|
9503
|
+
disabled,
|
|
9504
|
+
children: [
|
|
9505
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9506
|
+
StyledHiddenCheckboxInput,
|
|
9519
9507
|
{
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9508
|
+
...props,
|
|
9509
|
+
ref,
|
|
9510
|
+
checked: isChecked,
|
|
9511
|
+
disabled,
|
|
9512
|
+
id: computedId,
|
|
9513
|
+
name: checkboxName,
|
|
9514
|
+
onChange: handleOnChange,
|
|
9515
|
+
required,
|
|
9516
|
+
type: "checkbox",
|
|
9517
|
+
value
|
|
9524
9518
|
}
|
|
9525
9519
|
),
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9520
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9521
|
+
FormControlLabel,
|
|
9522
|
+
{
|
|
9523
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9524
|
+
StyledCheckboxInput,
|
|
9525
|
+
{
|
|
9526
|
+
$disabled: disabled,
|
|
9527
|
+
$size: size,
|
|
9528
|
+
"data-wui-faux-input": "true",
|
|
9529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(CheckIcon, {})
|
|
9530
|
+
}
|
|
9531
|
+
),
|
|
9532
|
+
description,
|
|
9533
|
+
disabled,
|
|
9534
|
+
hideLabel,
|
|
9535
|
+
htmlFor: computedId,
|
|
9536
|
+
label
|
|
9537
|
+
}
|
|
9538
|
+
)
|
|
9539
|
+
]
|
|
9540
|
+
}
|
|
9541
|
+
);
|
|
9534
9542
|
}
|
|
9535
9543
|
);
|
|
9536
9544
|
Checkbox.displayName = "Checkbox_UI";
|
|
@@ -10935,106 +10943,78 @@ var import_react45 = require("react");
|
|
|
10935
10943
|
var import_styled_components59 = __toESM(require("styled-components"));
|
|
10936
10944
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
10937
10945
|
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
10938
|
-
var
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
min-height: var(--wui-size-small-height);
|
|
10946
|
-
border-radius: calc(var(--wui-size-small-height) / 2);
|
|
10947
|
-
|
|
10948
|
-
&::after {
|
|
10949
|
-
width: calc(var(--wui-size-small-width) / 2);
|
|
10950
|
-
height: calc(var(--wui-size-small-width) / 2);
|
|
10951
|
-
}
|
|
10946
|
+
var switchHeightMap = {
|
|
10947
|
+
sm: 16,
|
|
10948
|
+
md: 20,
|
|
10949
|
+
lg: 24
|
|
10950
|
+
};
|
|
10951
|
+
var getSizeCss2 = (size) => import_styled_components59.css`
|
|
10952
|
+
--wui-switch-height: ${switchHeightMap[size]}px;
|
|
10952
10953
|
`;
|
|
10953
|
-
var
|
|
10954
|
-
|
|
10955
|
-
--wui-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10954
|
+
var StyledSwitchWrapper = import_styled_components59.default.div`
|
|
10955
|
+
${({ $size }) => getSizeCss2($size)}
|
|
10956
|
+
--wui-switch-border-offset: 2px;
|
|
10957
|
+
--wui-switch-background-color: var(--wui-color-bg-surface-tertiary);
|
|
10958
|
+
--wui-switch-border-color: transparent;
|
|
10959
|
+
--wui-switch-thumb-color: var(--wui-color-icon-on-fill);
|
|
10960
|
+
--wui-switch-thumb-margin-left: 0px;
|
|
10961
|
+
--wui-switch-thumb-size: calc(var(--wui-switch-height) - var(--wui-switch-border-offset) * 2);
|
|
10962
|
+
--wui-switch-width: calc(var(--wui-switch-thumb-size) * 2 + var(--wui-switch-border-offset) * 2);
|
|
10963
|
+
--wui-switch-thumb-position: var(--wui-switch-border-offset);
|
|
10964
|
+
--wui-switch-outline-color: transparent;
|
|
10962
10965
|
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
+
&:has(input:checked) {
|
|
10967
|
+
--wui-switch-background-color: var(--wui-color-bg-fill);
|
|
10968
|
+
--wui-switch-thumb-position: calc(
|
|
10969
|
+
var(--wui-switch-width) - var(--wui-switch-thumb-size) - var(--wui-switch-border-offset)
|
|
10970
|
+
);
|
|
10966
10971
|
}
|
|
10967
|
-
`;
|
|
10968
|
-
var sizeLarge2 = import_styled_components59.css`
|
|
10969
|
-
--wui-size-large-width: 40px;
|
|
10970
|
-
--wui-size-large-height: 22px;
|
|
10971
10972
|
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
border-radius: calc(var(--wui-size-large-height) / 2);
|
|
10973
|
+
&:has(input:disabled) {
|
|
10974
|
+
--wui-switch-background-color: var(--wui-color-bg-surface-tertiary);
|
|
10975
|
+
--wui-switch-thumb-color: var(--wui-color-bg-surface-disabled);
|
|
10976
|
+
}
|
|
10977
10977
|
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
height: calc(var(--wui-size-large-width) / 2);
|
|
10978
|
+
&:has(input:focus-visible) {
|
|
10979
|
+
--wui-switch-outline-color: var(--wui-color-focus-ring);
|
|
10981
10980
|
}
|
|
10982
|
-
|
|
10983
|
-
var getSizeCss2 = (size) => {
|
|
10984
|
-
if (size === "sm") return sizeSmall2;
|
|
10985
|
-
if (size === "lg") return sizeLarge2;
|
|
10986
|
-
return sizeMedium2;
|
|
10987
|
-
};
|
|
10988
|
-
var StyledSwitchWrapper = import_styled_components59.default.div`
|
|
10981
|
+
|
|
10989
10982
|
display: flex;
|
|
10990
10983
|
margin: 0;
|
|
10991
10984
|
|
|
10992
10985
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
10993
10986
|
user-select: none;
|
|
10994
10987
|
`;
|
|
10995
|
-
var
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
background-color
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
10988
|
+
var StyledSwitchTrack = import_styled_components59.default.div`
|
|
10989
|
+
width: var(--wui-switch-width);
|
|
10990
|
+
height: var(--wui-switch-height);
|
|
10991
|
+
min-width: var(--wui-switch-width);
|
|
10992
|
+
min-height: var(--wui-switch-height);
|
|
10993
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
10994
|
+
display: flex;
|
|
10995
|
+
align-items: center;
|
|
10996
|
+
outline-width: 2px;
|
|
10997
|
+
outline-offset: 2px;
|
|
10998
|
+
outline-style: solid;
|
|
10999
|
+
outline-color: var(--wui-switch-outline-color);
|
|
11000
|
+
transition:
|
|
11001
|
+
background-color var(--wui-motion-duration-03) var(--wui-motion-ease-out),
|
|
11002
|
+
outline-color var(--wui-motion-duration-03) var(--wui-motion-ease-out);
|
|
11003
|
+
background-color: var(--wui-switch-background-color);
|
|
11004
|
+
margin-top: calc(calc(1lh - var(--wui-switch-height)) / 2);
|
|
11005
|
+
`;
|
|
11006
|
+
var StyledSwitchThumb = import_styled_components59.default.div`
|
|
11007
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
11008
|
+
background-color: var(--wui-switch-thumb-color);
|
|
11009
|
+
transition:
|
|
11010
|
+
margin var(--wui-motion-duration-03) var(--wui-motion-ease-out),
|
|
11011
|
+
background-color var(--wui-motion-duration-03) var(--wui-motion-ease-out);
|
|
11012
|
+
width: var(--wui-switch-thumb-size);
|
|
11013
|
+
height: var(--wui-switch-thumb-size);
|
|
11014
|
+
margin-left: var(--wui-switch-thumb-position);
|
|
11022
11015
|
`;
|
|
11023
11016
|
var StyledHiddenSwitchInput = import_styled_components59.default.input`
|
|
11024
11017
|
${visuallyHiddenStyle}
|
|
11025
|
-
|
|
11026
|
-
/* toggles display of faux-input background-color and toggle position */
|
|
11027
|
-
&:checked + label [data-wui-faux-input='true'] {
|
|
11028
|
-
border-color: ${({ disabled }) => disabled ? void 0 : "var(--wui-color-bg-fill)"}; /* "on state" border */
|
|
11029
|
-
|
|
11030
|
-
background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"}; /* "on state" background */
|
|
11031
|
-
|
|
11032
|
-
&::after {
|
|
11033
|
-
transform: translate(calc(100% - 2px), -50%); /* 2px is the border width */
|
|
11034
|
-
box-shadow: -1px 0 1px rgb(0 0 0 / 10%); /* "on state" shadow - cast horizontally left */
|
|
11035
|
-
background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill-white)"}; /* "on state" dot color */
|
|
11036
|
-
}
|
|
11037
|
-
}
|
|
11038
11018
|
`;
|
|
11039
11019
|
var Switch = (0, import_react45.forwardRef)(
|
|
11040
11020
|
({
|
|
@@ -11054,43 +11034,50 @@ var Switch = (0, import_react45.forwardRef)(
|
|
|
11054
11034
|
}, ref) => {
|
|
11055
11035
|
const generatedId = (0, import_react45.useId)();
|
|
11056
11036
|
const computedId = (0, import_type_guards34.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11057
|
-
return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
name,
|
|
11067
|
-
onChange,
|
|
11068
|
-
required,
|
|
11069
|
-
type: "checkbox",
|
|
11070
|
-
value
|
|
11071
|
-
}
|
|
11072
|
-
),
|
|
11073
|
-
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
11074
|
-
FormControlLabel,
|
|
11075
|
-
{
|
|
11076
|
-
align,
|
|
11077
|
-
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
11078
|
-
StyledSwitchInput,
|
|
11037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
|
|
11038
|
+
StyledSwitchWrapper,
|
|
11039
|
+
{
|
|
11040
|
+
$disabled: disabled,
|
|
11041
|
+
$hideLabel: hideLabel,
|
|
11042
|
+
$size: size,
|
|
11043
|
+
children: [
|
|
11044
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
11045
|
+
StyledHiddenSwitchInput,
|
|
11079
11046
|
{
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11047
|
+
...props,
|
|
11048
|
+
ref,
|
|
11049
|
+
checked,
|
|
11050
|
+
disabled,
|
|
11051
|
+
id: computedId,
|
|
11052
|
+
name,
|
|
11053
|
+
onChange,
|
|
11054
|
+
required,
|
|
11055
|
+
type: "checkbox",
|
|
11056
|
+
value
|
|
11084
11057
|
}
|
|
11085
11058
|
),
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11059
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
11060
|
+
FormControlLabel,
|
|
11061
|
+
{
|
|
11062
|
+
align,
|
|
11063
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
11064
|
+
StyledSwitchTrack,
|
|
11065
|
+
{
|
|
11066
|
+
"data-testid": "wui-faux-input",
|
|
11067
|
+
"data-wui-faux-input": "true",
|
|
11068
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(StyledSwitchThumb, {})
|
|
11069
|
+
}
|
|
11070
|
+
),
|
|
11071
|
+
description,
|
|
11072
|
+
disabled,
|
|
11073
|
+
hideLabel,
|
|
11074
|
+
htmlFor: computedId,
|
|
11075
|
+
label
|
|
11076
|
+
}
|
|
11077
|
+
)
|
|
11078
|
+
]
|
|
11079
|
+
}
|
|
11080
|
+
);
|
|
11094
11081
|
}
|
|
11095
11082
|
);
|
|
11096
11083
|
Switch.displayName = "Switch_UI";
|
|
@@ -12658,7 +12645,7 @@ var import_styled_components69 = __toESM(require("styled-components"));
|
|
|
12658
12645
|
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
12659
12646
|
var StyledDataCards = (0, import_styled_components69.default)(Box)`
|
|
12660
12647
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
12661
|
-
|
|
12648
|
+
|
|
12662
12649
|
> * {
|
|
12663
12650
|
min-width: 120px;
|
|
12664
12651
|
max-width: ${({ $cardMaxWidth }) => $cardMaxWidth};
|
|
@@ -14841,64 +14828,51 @@ var import_react72 = require("react");
|
|
|
14841
14828
|
var import_styled_components93 = __toESM(require("styled-components"));
|
|
14842
14829
|
var import_type_guards53 = require("@wistia/type-guards");
|
|
14843
14830
|
var import_jsx_runtime286 = require("react/jsx-runtime");
|
|
14844
|
-
var
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
|
|
14854
|
-
|
|
14855
|
-
|
|
14856
|
-
|
|
14857
|
-
|
|
14858
|
-
|
|
14859
|
-
|
|
14860
|
-
|
|
14831
|
+
var sizeSmall2 = import_styled_components93.css`
|
|
14832
|
+
--wui-radio-size: 14px;
|
|
14833
|
+
--wui-radio-icon-size: 7px;
|
|
14834
|
+
`;
|
|
14835
|
+
var sizeMedium2 = import_styled_components93.css`
|
|
14836
|
+
--wui-radio-size: 16px;
|
|
14837
|
+
--wui-radio-icon-size: 8px;
|
|
14838
|
+
`;
|
|
14839
|
+
var sizeLarge2 = import_styled_components93.css`
|
|
14840
|
+
--wui-radio-size: 20px;
|
|
14841
|
+
--wui-radio-icon-size: 10px;
|
|
14842
|
+
`;
|
|
14843
|
+
var getSizeCss3 = (size) => {
|
|
14844
|
+
if (size === "sm") return sizeSmall2;
|
|
14845
|
+
if (size === "lg") return sizeLarge2;
|
|
14846
|
+
return sizeMedium2;
|
|
14847
|
+
};
|
|
14848
|
+
var StyledRadioWrapper = import_styled_components93.default.div`
|
|
14849
|
+
--wui-radio-background-color: var(--wui-color-bg-surface);
|
|
14850
|
+
--wui-radio-border-color: var(--wui-color-border-secondary);
|
|
14851
|
+
--wui-radio-icon-color: transparent;
|
|
14852
|
+
--wui-radio-outline-color: transparent;
|
|
14853
|
+
|
|
14854
|
+
&:hover {
|
|
14855
|
+
--wui-radio-border-color: var(--wui-color-border-secondary-hover);
|
|
14861
14856
|
}
|
|
14862
|
-
);
|
|
14863
|
-
var sizeSmall3 = import_styled_components93.css`
|
|
14864
|
-
width: 14px;
|
|
14865
|
-
height: 14px;
|
|
14866
|
-
min-width: 14px;
|
|
14867
|
-
min-height: 14px;
|
|
14868
14857
|
|
|
14869
|
-
|
|
14870
|
-
|
|
14871
|
-
|
|
14858
|
+
&:has(input:checked) {
|
|
14859
|
+
--wui-radio-border-color: var(--wui-color-focus-ring);
|
|
14860
|
+
--wui-radio-icon-color: var(--wui-color-focus-ring);
|
|
14872
14861
|
}
|
|
14873
|
-
`;
|
|
14874
|
-
var sizeMedium3 = import_styled_components93.css`
|
|
14875
|
-
width: 16px;
|
|
14876
|
-
height: 16px;
|
|
14877
|
-
min-width: 16px;
|
|
14878
|
-
min-height: 16px;
|
|
14879
14862
|
|
|
14880
|
-
|
|
14881
|
-
|
|
14882
|
-
height: 8px;
|
|
14863
|
+
&:has(input:focus-visible) {
|
|
14864
|
+
--wui-radio-outline-color: var(--wui-color-focus-ring);
|
|
14883
14865
|
}
|
|
14884
|
-
`;
|
|
14885
|
-
var sizeLarge3 = import_styled_components93.css`
|
|
14886
|
-
width: 20px;
|
|
14887
|
-
height: 20px;
|
|
14888
|
-
min-width: 20px;
|
|
14889
|
-
min-height: 20px;
|
|
14890
14866
|
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14867
|
+
&:has(input:disabled) {
|
|
14868
|
+
--wui-radio-background-color: var(--wui-color-bg-surface-disabled);
|
|
14869
|
+
--wui-radio-border-color: var(--wui-color-border-secondary);
|
|
14870
|
+
|
|
14871
|
+
&:has(input:checked) {
|
|
14872
|
+
--wui-radio-icon-color: var(--wui-color-icon-disabled);
|
|
14873
|
+
}
|
|
14894
14874
|
}
|
|
14895
|
-
|
|
14896
|
-
var getSizeCss3 = (size) => {
|
|
14897
|
-
if (size === "sm") return sizeSmall3;
|
|
14898
|
-
if (size === "lg") return sizeLarge3;
|
|
14899
|
-
return sizeMedium3;
|
|
14900
|
-
};
|
|
14901
|
-
var StyledRadioWrapper = import_styled_components93.default.div`
|
|
14875
|
+
|
|
14902
14876
|
display: flex;
|
|
14903
14877
|
margin: 0;
|
|
14904
14878
|
|
|
@@ -14907,38 +14881,33 @@ var StyledRadioWrapper = import_styled_components93.default.div`
|
|
|
14907
14881
|
`;
|
|
14908
14882
|
var StyledRadioInput = import_styled_components93.default.div`
|
|
14909
14883
|
${({ $size }) => getSizeCss3($size)}
|
|
14910
|
-
line-height: 0;
|
|
14911
|
-
margin: 0;
|
|
14912
|
-
border-radius: 50%; /* TODO --wui-border-radius-rounded */
|
|
14913
|
-
display: grid;
|
|
14914
|
-
place-content: center;
|
|
14915
14884
|
align-self: flex-start;
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
|
|
14885
|
+
width: var(--wui-radio-size);
|
|
14886
|
+
height: var(--wui-radio-size);
|
|
14887
|
+
min-width: var(--wui-radio-size);
|
|
14888
|
+
min-height: var(--wui-radio-size);
|
|
14889
|
+
background-color: var(--wui-radio-background-color);
|
|
14890
|
+
box-shadow: inset 0 0 0 1px var(--wui-radio-border-color);
|
|
14891
|
+
border-radius: 100%;
|
|
14892
|
+
position: relative;
|
|
14893
|
+
cursor: pointer;
|
|
14894
|
+
transition: box-shadow var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
14895
|
+
margin-top: calc(calc(1lh - var(--wui-radio-size)) / 2);
|
|
14924
14896
|
|
|
14925
|
-
|
|
14926
|
-
|
|
14927
|
-
|
|
14897
|
+
&::after {
|
|
14898
|
+
content: '';
|
|
14899
|
+
position: absolute;
|
|
14900
|
+
top: 50%;
|
|
14901
|
+
left: 50%;
|
|
14902
|
+
width: 50%;
|
|
14903
|
+
height: 50%;
|
|
14904
|
+
background-color: var(--wui-radio-icon-color);
|
|
14905
|
+
border-radius: 100%;
|
|
14906
|
+
transform: translate(-50%, -50%);
|
|
14928
14907
|
}
|
|
14929
14908
|
`;
|
|
14930
14909
|
var StyledHiddenRadioInput = import_styled_components93.default.input`
|
|
14931
14910
|
${visuallyHiddenStyle}
|
|
14932
|
-
|
|
14933
|
-
/* toggles display of faux-input border-color */
|
|
14934
|
-
&:checked + label [data-wui-faux-input='true'] {
|
|
14935
|
-
border-color: ${({ disabled }) => disabled ? "var(--wui-color-border-disabled)" : "var(--wui-color-bg-fill)"};
|
|
14936
|
-
}
|
|
14937
|
-
|
|
14938
|
-
/* toggles display of RadioIcon */
|
|
14939
|
-
&:checked + label svg {
|
|
14940
|
-
display: block;
|
|
14941
|
-
}
|
|
14942
14911
|
`;
|
|
14943
14912
|
var Radio = (0, import_react72.forwardRef)(
|
|
14944
14913
|
({
|
|
@@ -14968,6 +14937,7 @@ var Radio = (0, import_react72.forwardRef)(
|
|
|
14968
14937
|
StyledRadioWrapper,
|
|
14969
14938
|
{
|
|
14970
14939
|
$disabled: disabled,
|
|
14940
|
+
$hideLabel: hideLabel,
|
|
14971
14941
|
"aria-invalid": props["aria-invalid"],
|
|
14972
14942
|
children: [
|
|
14973
14943
|
/* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
|
|
@@ -14988,15 +14958,7 @@ var Radio = (0, import_react72.forwardRef)(
|
|
|
14988
14958
|
/* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
|
|
14989
14959
|
FormControlLabel,
|
|
14990
14960
|
{
|
|
14991
|
-
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
|
|
14992
|
-
StyledRadioInput,
|
|
14993
|
-
{
|
|
14994
|
-
$disabled: disabled,
|
|
14995
|
-
$size: size,
|
|
14996
|
-
"data-wui-faux-input": "true",
|
|
14997
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(RadioIcon, {})
|
|
14998
|
-
}
|
|
14999
|
-
),
|
|
14961
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(StyledRadioInput, { $size: size }),
|
|
15000
14962
|
description,
|
|
15001
14963
|
disabled,
|
|
15002
14964
|
hideLabel,
|