@wistia/ui 0.14.17 → 0.14.18

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 CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.14.17
3
+ * @license @wistia/ui v0.14.18
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -9021,7 +9021,6 @@ var StyledFormControlLabelDescription = import_styled_components37.default.div`
9021
9021
  font-size: var(--wui-typography-body-4-size);
9022
9022
  font-weight: var(--wui-typography-body-4-weight);
9023
9023
  line-height: var(--wui-typography-body-4-line-height);
9024
- margin-top: var(--wui-space-01);
9025
9024
 
9026
9025
  ${({ $disabled }) => $disabled && disabledStyle}
9027
9026
  `;
@@ -9080,12 +9079,12 @@ var StyledFormControlLabel = import_styled_components39.default.label`
9080
9079
  cursor: pointer;
9081
9080
  display: flex;
9082
9081
  align-items: center;
9083
- gap: var(--wui-space-01);
9082
+ gap: var(--wui-space-02);
9084
9083
  width: 100%;
9085
9084
  color: var(--wui-color-tex);
9086
9085
  font-size: var(--wui-typography-label-3-size);
9087
9086
  font-weight: var(--wui-typography-label-3-weight);
9088
- line-height: var(--wui-typography-label-3-line-height);
9087
+ line-height: var(--wui-typography-body-3-line-height);
9089
9088
  justify-content: ${({ $align }) => $align === "left" ? "flex-start" : "space-between"};
9090
9089
 
9091
9090
  ${({ $disabled }) => $disabled && disabledStyle2}
@@ -9168,11 +9167,9 @@ var Stack = makePolymorphic(StackComponent);
9168
9167
  // src/components/FormGroup/FormGroup.tsx
9169
9168
  var import_jsx_runtime218 = require("react/jsx-runtime");
9170
9169
  var StyledFieldset = import_styled_components41.default.fieldset`
9170
+ padding: 0;
9171
+ margin: 0;
9171
9172
  border: 0;
9172
-
9173
- /* * {
9174
- outline: 1px solid red;
9175
- } */
9176
9173
  `;
9177
9174
  var StyledLegend = import_styled_components41.default.legend`
9178
9175
  padding-inline: 0;
@@ -9180,10 +9177,6 @@ var StyledLegend = import_styled_components41.default.legend`
9180
9177
  flex-direction: column;
9181
9178
  gap: var(--wui-space-01);
9182
9179
  margin-bottom: var(--wui-space-02);
9183
-
9184
- &:has([data-wui-form-group-description]) {
9185
- margin-bottom: var(--wui-space-01);
9186
- }
9187
9180
  `;
9188
9181
  var FormGroup = ({
9189
9182
  children,
@@ -9389,43 +9382,22 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
9389
9382
  "path",
9390
9383
  {
9391
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",
9392
- fill: "currentColor"
9385
+ fill: "var(--wui-checkbox-icon-color)"
9393
9386
  }
9394
9387
  )
9395
9388
  }
9396
9389
  );
9397
9390
  var sizeSmall = import_styled_components43.css`
9398
- width: 14px;
9399
- height: 14px;
9400
- min-width: 14px;
9401
- min-height: 14px;
9402
-
9403
- svg {
9404
- width: 7px;
9405
- height: 7px;
9406
- }
9391
+ --wui-checkbox-size: 14px;
9392
+ --wui-checkbox-icon-size: 7px;
9407
9393
  `;
9408
9394
  var sizeMedium = import_styled_components43.css`
9409
- width: 16px;
9410
- height: 16px;
9411
- min-width: 16px;
9412
- min-height: 16px;
9413
-
9414
- svg {
9415
- width: 9px;
9416
- height: 9px;
9417
- }
9395
+ --wui-checkbox-size: 16px;
9396
+ --wui-checkbox-icon-size: 9px;
9418
9397
  `;
9419
9398
  var sizeLarge = import_styled_components43.css`
9420
- width: 20px;
9421
- height: 20px;
9422
- min-width: 20px;
9423
- min-height: 20px;
9424
-
9425
- svg {
9426
- width: 11px;
9427
- height: 11px;
9428
- }
9399
+ --wui-checkbox-size: 20px;
9400
+ --wui-checkbox-icon-size: 11px;
9429
9401
  `;
9430
9402
  var getSizeCss = (size) => {
9431
9403
  if (size === "sm") return sizeSmall;
@@ -9433,6 +9405,36 @@ var getSizeCss = (size) => {
9433
9405
  return sizeMedium;
9434
9406
  };
9435
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
+
9436
9438
  display: flex;
9437
9439
  margin: 0;
9438
9440
 
@@ -9441,7 +9443,6 @@ var StyledCheckboxWrapper = import_styled_components43.default.div`
9441
9443
  `;
9442
9444
  var StyledCheckboxInput = import_styled_components43.default.div`
9443
9445
  ${({ $size }) => getSizeCss($size)}
9444
- line-height: 0;
9445
9446
  margin: 0;
9446
9447
  border-radius: var(--wui-border-radius-01);
9447
9448
  display: grid;
@@ -9449,31 +9450,27 @@ var StyledCheckboxInput = import_styled_components43.default.div`
9449
9450
  align-self: flex-start;
9450
9451
  border-width: 1px;
9451
9452
  border-style: solid;
9452
- border-color: ${({ $disabled }) => $disabled ? "var(--wui-color-border-disabled)" : "var(--wui-color-border)"};
9453
- background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface)"};
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);
9454
9465
 
9455
- /* checkmark icon */
9466
+ /* checkbox icon */
9456
9467
  svg {
9457
- display: none;
9458
-
9459
- path {
9460
- fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill-white)"};
9461
- }
9468
+ width: var(--wui-checkbox-icon-size);
9469
+ height: var(--wui-checkbox-icon-size);
9462
9470
  }
9463
9471
  `;
9464
9472
  var StyledHiddenCheckboxInput = import_styled_components43.default.input`
9465
9473
  ${visuallyHiddenStyle}
9466
-
9467
- /* toggles display of faux-input background-color */
9468
- &:checked + label [data-wui-faux-input='true'] {
9469
- border-color: ${({ disabled }) => disabled ? void 0 : "var(--wui-color-bg-fill)"};
9470
- background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"};
9471
- }
9472
-
9473
- /* toggles display of CheckIcon */
9474
- &:checked + label svg {
9475
- display: block;
9476
- }
9477
9474
  `;
9478
9475
  var Checkbox = (0, import_react38.forwardRef)(
9479
9476
  ({
@@ -9499,42 +9496,49 @@ var Checkbox = (0, import_react38.forwardRef)(
9499
9496
  const checkboxName = name ?? contextName;
9500
9497
  const handleOnChange = onChange ?? contextOnChange;
9501
9498
  const isChecked = (0, import_type_guards31.isNotUndefined)(value) && contextValue ? contextValue.includes(value) : checked;
9502
- return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(StyledCheckboxWrapper, { disabled, children: [
9503
- /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
9504
- StyledHiddenCheckboxInput,
9505
- {
9506
- ...props,
9507
- ref,
9508
- checked: isChecked,
9509
- disabled,
9510
- id: computedId,
9511
- name: checkboxName,
9512
- onChange: handleOnChange,
9513
- required,
9514
- type: "checkbox",
9515
- value
9516
- }
9517
- ),
9518
- /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
9519
- FormControlLabel,
9520
- {
9521
- controlSlot: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
9522
- 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,
9523
9507
  {
9524
- $disabled: disabled,
9525
- $size: size,
9526
- "data-wui-faux-input": "true",
9527
- children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(CheckIcon, {})
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
9528
9518
  }
9529
9519
  ),
9530
- description,
9531
- disabled,
9532
- hideLabel,
9533
- htmlFor: computedId,
9534
- label
9535
- }
9536
- )
9537
- ] });
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
+ );
9538
9542
  }
9539
9543
  );
9540
9544
  Checkbox.displayName = "Checkbox_UI";
@@ -10939,106 +10943,78 @@ var import_react45 = require("react");
10939
10943
  var import_styled_components59 = __toESM(require("styled-components"));
10940
10944
  var import_type_guards34 = require("@wistia/type-guards");
10941
10945
  var import_jsx_runtime243 = require("react/jsx-runtime");
10942
- var sizeSmall2 = import_styled_components59.css`
10943
- --wui-size-small-width: 24px;
10944
- --wui-size-small-height: 14px;
10945
-
10946
- width: var(--wui-size-small-width);
10947
- height: var(--wui-size-small-height);
10948
- min-width: var(--wui-size-small-width);
10949
- min-height: var(--wui-size-small-height);
10950
- border-radius: calc(var(--wui-size-small-height) / 2);
10951
-
10952
- &::after {
10953
- width: calc(var(--wui-size-small-width) / 2);
10954
- height: calc(var(--wui-size-small-width) / 2);
10955
- }
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;
10956
10953
  `;
10957
- var sizeMedium2 = import_styled_components59.css`
10958
- --wui-size-medium-width: 32px;
10959
- --wui-size-medium-height: 18px;
10960
-
10961
- width: var(--wui-size-medium-width);
10962
- height: var(--wui-size-medium-height);
10963
- min-width: var(--wui-size-medium-width);
10964
- min-height: var(--wui-size-medium-height);
10965
- border-radius: calc(var(--wui-size-medium-height) / 2);
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;
10966
10965
 
10967
- &::after {
10968
- width: calc(var(--wui-size-medium-width) / 2);
10969
- height: calc(var(--wui-size-medium-width) / 2);
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
+ );
10970
10971
  }
10971
- `;
10972
- var sizeLarge2 = import_styled_components59.css`
10973
- --wui-size-large-width: 40px;
10974
- --wui-size-large-height: 22px;
10975
10972
 
10976
- width: var(--wui-size-large-width);
10977
- height: var(--wui-size-large-height);
10978
- min-width: var(--wui-size-large-width);
10979
- min-height: var(--wui-size-large-height);
10980
- 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
+ }
10981
10977
 
10982
- &::after {
10983
- width: calc(var(--wui-size-large-width) / 2);
10984
- height: calc(var(--wui-size-large-width) / 2);
10978
+ &:has(input:focus-visible) {
10979
+ --wui-switch-outline-color: var(--wui-color-focus-ring);
10985
10980
  }
10986
- `;
10987
- var getSizeCss2 = (size) => {
10988
- if (size === "sm") return sizeSmall2;
10989
- if (size === "lg") return sizeLarge2;
10990
- return sizeMedium2;
10991
- };
10992
- var StyledSwitchWrapper = import_styled_components59.default.div`
10981
+
10993
10982
  display: flex;
10994
10983
  margin: 0;
10995
10984
 
10996
10985
  /* TODO this solves a problem but potentially causes and a11y issue */
10997
10986
  user-select: none;
10998
10987
  `;
10999
- var StyledSwitchInput = import_styled_components59.default.div`
11000
- ${({ $size }) => getSizeCss2($size)}
11001
- line-height: 0;
11002
- margin: 0;
11003
- display: grid;
11004
- place-content: center;
11005
- align-self: flex-start;
11006
- position: relative;
11007
- transition: all 0.2s ease-in-out;
11008
- border-width: 1px;
11009
- border-style: solid;
11010
- border-color: ${({ $disabled }) => $disabled ? "var(--wui-color-border-disabled)" : "var(--wui-color-border)"}; /* "off state" border */
11011
-
11012
- background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface-secondary)"}; /* "off state" background */
11013
-
11014
- &::after {
11015
- content: '';
11016
- position: absolute;
11017
- left: 0;
11018
- top: 50%;
11019
- transform: translateY(-50%);
11020
- border-radius: 50%;
11021
- box-shadow: 1px 0 1px rgb(0 0 0 / 10%); /* "off state" shadow - cast horizontally right */
11022
- background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill-white)"}; /* "off state" dot color */
11023
-
11024
- transition: all 0.2s ease-in-out;
11025
- }
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);
11026
11015
  `;
11027
11016
  var StyledHiddenSwitchInput = import_styled_components59.default.input`
11028
11017
  ${visuallyHiddenStyle}
11029
-
11030
- /* toggles display of faux-input background-color and toggle position */
11031
- &:checked + label [data-wui-faux-input='true'] {
11032
- border-color: ${({ disabled }) => disabled ? void 0 : "var(--wui-color-bg-fill)"}; /* "on state" border */
11033
-
11034
- background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"}; /* "on state" background */
11035
-
11036
- &::after {
11037
- transform: translate(calc(100% - 2px), -50%); /* 2px is the border width */
11038
- box-shadow: -1px 0 1px rgb(0 0 0 / 10%); /* "on state" shadow - cast horizontally left */
11039
- background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill-white)"}; /* "on state" dot color */
11040
- }
11041
- }
11042
11018
  `;
11043
11019
  var Switch = (0, import_react45.forwardRef)(
11044
11020
  ({
@@ -11058,43 +11034,50 @@ var Switch = (0, import_react45.forwardRef)(
11058
11034
  }, ref) => {
11059
11035
  const generatedId = (0, import_react45.useId)();
11060
11036
  const computedId = (0, import_type_guards34.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
11061
- return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
11062
- /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
11063
- StyledHiddenSwitchInput,
11064
- {
11065
- ...props,
11066
- ref,
11067
- checked,
11068
- disabled,
11069
- id: computedId,
11070
- name,
11071
- onChange,
11072
- required,
11073
- type: "checkbox",
11074
- value
11075
- }
11076
- ),
11077
- /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
11078
- FormControlLabel,
11079
- {
11080
- align,
11081
- controlSlot: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
11082
- 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,
11083
11046
  {
11084
- $disabled: disabled,
11085
- $size: size,
11086
- "data-testid": "wui-faux-input",
11087
- "data-wui-faux-input": "true"
11047
+ ...props,
11048
+ ref,
11049
+ checked,
11050
+ disabled,
11051
+ id: computedId,
11052
+ name,
11053
+ onChange,
11054
+ required,
11055
+ type: "checkbox",
11056
+ value
11088
11057
  }
11089
11058
  ),
11090
- description,
11091
- disabled,
11092
- hideLabel,
11093
- htmlFor: computedId,
11094
- label
11095
- }
11096
- )
11097
- ] });
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
+ );
11098
11081
  }
11099
11082
  );
11100
11083
  Switch.displayName = "Switch_UI";
@@ -14845,64 +14828,51 @@ var import_react72 = require("react");
14845
14828
  var import_styled_components93 = __toESM(require("styled-components"));
14846
14829
  var import_type_guards53 = require("@wistia/type-guards");
14847
14830
  var import_jsx_runtime286 = require("react/jsx-runtime");
14848
- var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
14849
- "svg",
14850
- {
14851
- fill: "inherit",
14852
- height: "1",
14853
- viewBox: "0 0 1 1",
14854
- width: "1",
14855
- xmlns: "http://www.w3.org/2000/svg",
14856
- children: /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
14857
- "circle",
14858
- {
14859
- cx: "0.5",
14860
- cy: "0.5",
14861
- fill: "currentColor",
14862
- r: "0.5"
14863
- }
14864
- )
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);
14865
14856
  }
14866
- );
14867
- var sizeSmall3 = import_styled_components93.css`
14868
- width: 14px;
14869
- height: 14px;
14870
- min-width: 14px;
14871
- min-height: 14px;
14872
14857
 
14873
- svg {
14874
- width: 7px;
14875
- height: 7px;
14858
+ &:has(input:checked) {
14859
+ --wui-radio-border-color: var(--wui-color-focus-ring);
14860
+ --wui-radio-icon-color: var(--wui-color-focus-ring);
14876
14861
  }
14877
- `;
14878
- var sizeMedium3 = import_styled_components93.css`
14879
- width: 16px;
14880
- height: 16px;
14881
- min-width: 16px;
14882
- min-height: 16px;
14883
14862
 
14884
- svg {
14885
- width: 8px;
14886
- height: 8px;
14863
+ &:has(input:focus-visible) {
14864
+ --wui-radio-outline-color: var(--wui-color-focus-ring);
14887
14865
  }
14888
- `;
14889
- var sizeLarge3 = import_styled_components93.css`
14890
- width: 20px;
14891
- height: 20px;
14892
- min-width: 20px;
14893
- min-height: 20px;
14894
14866
 
14895
- svg {
14896
- width: 10px;
14897
- height: 10px;
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
+ }
14898
14874
  }
14899
- `;
14900
- var getSizeCss3 = (size) => {
14901
- if (size === "sm") return sizeSmall3;
14902
- if (size === "lg") return sizeLarge3;
14903
- return sizeMedium3;
14904
- };
14905
- var StyledRadioWrapper = import_styled_components93.default.div`
14875
+
14906
14876
  display: flex;
14907
14877
  margin: 0;
14908
14878
 
@@ -14911,38 +14881,33 @@ var StyledRadioWrapper = import_styled_components93.default.div`
14911
14881
  `;
14912
14882
  var StyledRadioInput = import_styled_components93.default.div`
14913
14883
  ${({ $size }) => getSizeCss3($size)}
14914
- line-height: 0;
14915
- margin: 0;
14916
- border-radius: 50%; /* TODO --wui-border-radius-rounded */
14917
- display: grid;
14918
- place-content: center;
14919
14884
  align-self: flex-start;
14920
- border-width: 1px;
14921
- border-style: solid;
14922
- border-color: ${({ $disabled }) => $disabled ? "var(--wui-color-border-disabled)" : "var(--wui-color-border)"};
14923
- background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface)"};
14924
-
14925
- /* radio button circle icon */
14926
- svg {
14927
- display: none;
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);
14928
14896
 
14929
- circle {
14930
- fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill)"};
14931
- }
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%);
14932
14907
  }
14933
14908
  `;
14934
14909
  var StyledHiddenRadioInput = import_styled_components93.default.input`
14935
14910
  ${visuallyHiddenStyle}
14936
-
14937
- /* toggles display of faux-input border-color */
14938
- &:checked + label [data-wui-faux-input='true'] {
14939
- border-color: ${({ disabled }) => disabled ? "var(--wui-color-border-disabled)" : "var(--wui-color-bg-fill)"};
14940
- }
14941
-
14942
- /* toggles display of RadioIcon */
14943
- &:checked + label svg {
14944
- display: block;
14945
- }
14946
14911
  `;
14947
14912
  var Radio = (0, import_react72.forwardRef)(
14948
14913
  ({
@@ -14972,6 +14937,7 @@ var Radio = (0, import_react72.forwardRef)(
14972
14937
  StyledRadioWrapper,
14973
14938
  {
14974
14939
  $disabled: disabled,
14940
+ $hideLabel: hideLabel,
14975
14941
  "aria-invalid": props["aria-invalid"],
14976
14942
  children: [
14977
14943
  /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
@@ -14992,15 +14958,7 @@ var Radio = (0, import_react72.forwardRef)(
14992
14958
  /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
14993
14959
  FormControlLabel,
14994
14960
  {
14995
- controlSlot: /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
14996
- StyledRadioInput,
14997
- {
14998
- $disabled: disabled,
14999
- $size: size,
15000
- "data-wui-faux-input": "true",
15001
- children: /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(RadioIcon, {})
15002
- }
15003
- ),
14961
+ controlSlot: /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(StyledRadioInput, { $size: size }),
15004
14962
  description,
15005
14963
  disabled,
15006
14964
  hideLabel,