@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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.6.22
3
+ * @license @wistia/ui v0.6.23
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -1125,6 +1125,7 @@ var colorAliasTokens = css4`
1125
1125
 
1126
1126
  /* Disabled */
1127
1127
  --wui-color-bg-surface-disabled: var(--wui-gray-3);
1128
+ --wui-color-bg-border-disabled: var(--wui-gray-4);
1128
1129
  --wui-color-icon-disabled: var(--wui-gray-8);
1129
1130
  --wui-color-text-disabled: var(--wui-gray-10);
1130
1131
  --wui-color-focus-ring-disabled: var(--wui-gray-6);
@@ -7483,6 +7484,7 @@ ScreenReaderOnly.displayName = "ScreenReaderOnly";
7483
7484
  // src/private/components/FormControlLabel/FormControlLabel.tsx
7484
7485
  import { jsx as jsx201, jsxs as jsxs12 } from "react/jsx-runtime";
7485
7486
  var disabledStyle2 = css19`
7487
+ cursor: not-allowed;
7486
7488
  color: var(--wui-color-text-disabled);
7487
7489
  `;
7488
7490
  var StyledLabelWrapper = styled17.div`
@@ -7552,10 +7554,6 @@ var CheckIcon = () => /* @__PURE__ */ jsx202(
7552
7554
  )
7553
7555
  }
7554
7556
  );
7555
- var disabledStyle3 = css20`
7556
- cursor: not-allowed;
7557
- opacity: 0.5;
7558
- `;
7559
7557
  var inputSizeSmall = css20`
7560
7558
  width: 14px;
7561
7559
  height: 14px;
@@ -7574,36 +7572,36 @@ var inputSizeLarge = css20`
7574
7572
  min-width: 20px;
7575
7573
  min-height: 20px;
7576
7574
  `;
7575
+ var getSizeCss = (size) => {
7576
+ if (size === "sm") return inputSizeSmall;
7577
+ if (size === "lg") return inputSizeLarge;
7578
+ return inputSizeMedium;
7579
+ };
7577
7580
  var StyledCheckboxWrapper = styled18.div`
7578
7581
  display: flex;
7579
7582
  margin: 0;
7580
7583
 
7581
7584
  /* TODO this solves a problem but potentially causes and a11y issue */
7582
7585
  user-select: none;
7583
-
7584
- ${({ disabled }) => disabled && disabledStyle3};
7585
7586
  `;
7586
- var getSizeCss = (size) => {
7587
- if (size === "sm") return inputSizeSmall;
7588
- if (size === "lg") return inputSizeLarge;
7589
- return inputSizeMedium;
7590
- };
7591
7587
  var StyledCheckboxInput = styled18.div`
7592
7588
  ${({ $size }) => getSizeCss($size)}
7593
7589
  line-height: 0;
7594
7590
  margin: 0;
7595
- border: 1px solid var(--wui-color-border);
7596
7591
  border-radius: var(--wui-border-radius-01);
7597
- background-color: var(--wui-color-bg-fill-white);
7598
7592
  display: grid;
7599
7593
  place-content: center;
7600
7594
  align-self: flex-start;
7595
+ background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface)"};
7596
+ border: 1px solid
7597
+ ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-border)"};
7601
7598
 
7599
+ /* checkmark icon */
7602
7600
  svg {
7603
7601
  display: none;
7604
7602
 
7605
7603
  path {
7606
- fill: var(--wui-color-bg-fill-white);
7604
+ fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill-white)"};
7607
7605
  }
7608
7606
  }
7609
7607
  `;
@@ -7612,7 +7610,7 @@ var StyledHiddenCheckboxInput = styled18.input`
7612
7610
 
7613
7611
  /* toggles display of faux-input background-color */
7614
7612
  &:checked + label [data-wui-faux-input='true'] {
7615
- background-color: var(--wui-color-bg-fill);
7613
+ background-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"};
7616
7614
  }
7617
7615
 
7618
7616
  /* toggles display of CheckIcon */
@@ -7637,47 +7635,42 @@ var Checkbox = forwardRef6(
7637
7635
  }, ref) => {
7638
7636
  const generatedId = useId();
7639
7637
  const computedId = isNonEmptyString2(id) ? id : `wistia-ui-checkbox-${generatedId}`;
7640
- return /* @__PURE__ */ jsxs13(
7641
- StyledCheckboxWrapper,
7642
- {
7643
- ref,
7644
- disabled,
7645
- children: [
7646
- /* @__PURE__ */ jsx202(
7647
- StyledHiddenCheckboxInput,
7638
+ return /* @__PURE__ */ jsxs13(StyledCheckboxWrapper, { disabled, children: [
7639
+ /* @__PURE__ */ jsx202(
7640
+ StyledHiddenCheckboxInput,
7641
+ {
7642
+ ...props,
7643
+ ref,
7644
+ checked,
7645
+ disabled,
7646
+ id: computedId,
7647
+ name,
7648
+ onChange,
7649
+ required,
7650
+ type: "checkbox",
7651
+ value
7652
+ }
7653
+ ),
7654
+ /* @__PURE__ */ jsx202(
7655
+ FormControlLabel,
7656
+ {
7657
+ controlSlot: /* @__PURE__ */ jsx202(
7658
+ StyledCheckboxInput,
7648
7659
  {
7649
- ...props,
7650
- ref,
7651
- checked,
7652
- disabled,
7653
- id: computedId,
7654
- name,
7655
- onChange,
7656
- required,
7657
- type: "checkbox",
7658
- value
7660
+ $disabled: disabled,
7661
+ $size: size,
7662
+ "data-wui-faux-input": "true",
7663
+ children: /* @__PURE__ */ jsx202(CheckIcon, {})
7659
7664
  }
7660
7665
  ),
7661
- /* @__PURE__ */ jsx202(
7662
- FormControlLabel,
7663
- {
7664
- controlSlot: /* @__PURE__ */ jsx202(
7665
- StyledCheckboxInput,
7666
- {
7667
- $size: size,
7668
- "data-wui-faux-input": "true",
7669
- children: /* @__PURE__ */ jsx202(CheckIcon, {})
7670
- }
7671
- ),
7672
- description,
7673
- hideLabel,
7674
- htmlFor: computedId,
7675
- label
7676
- }
7677
- )
7678
- ]
7679
- }
7680
- );
7666
+ description,
7667
+ disabled,
7668
+ hideLabel,
7669
+ htmlFor: computedId,
7670
+ label
7671
+ }
7672
+ )
7673
+ ] });
7681
7674
  }
7682
7675
  );
7683
7676
  Checkbox.displayName = "Checkbox";
@@ -8950,7 +8943,7 @@ var requiredStyle = css27`
8950
8943
  content: '*';
8951
8944
  }
8952
8945
  `;
8953
- var disabledStyle4 = css27`
8946
+ var disabledStyle3 = css27`
8954
8947
  color: var(--wui-color-text-disabled);
8955
8948
  `;
8956
8949
  var StyledLabel3 = styled32.label`
@@ -8974,7 +8967,7 @@ var StyledLabel3 = styled32.label`
8974
8967
  }
8975
8968
 
8976
8969
  ${({ $screenReaderOnly }) => $screenReaderOnly && visuallyHiddenStyle}
8977
- ${({ $disabled }) => $disabled && disabledStyle4}
8970
+ ${({ $disabled }) => $disabled && disabledStyle3}
8978
8971
  ${({ $required }) => $required && requiredStyle}
8979
8972
  `;
8980
8973
  var Label = ({
@@ -10289,19 +10282,6 @@ var RadioIcon = () => /* @__PURE__ */ jsx241(
10289
10282
  )
10290
10283
  }
10291
10284
  );
10292
- var StyledHiddenRadioInput = styled49.input`
10293
- ${visuallyHiddenStyle}
10294
-
10295
- /* toggles display of faux-input background-color */
10296
- &:checked + label [data-wui-faux-input='true'] {
10297
- border-color: var(--wui-color-bg-fill);
10298
- }
10299
-
10300
- /* toggles display of RadioIcon */
10301
- &:checked + label svg {
10302
- display: block;
10303
- }
10304
- `;
10305
10285
  var inputSizeSmall2 = css30`
10306
10286
  width: 14px;
10307
10287
  height: 14px;
@@ -10325,37 +10305,46 @@ var getSizeCss2 = (size) => {
10325
10305
  if (size === "lg") return inputSizeLarge2;
10326
10306
  return inputSizeMedium2;
10327
10307
  };
10308
+ var StyledRadioWrapper = styled49.div`
10309
+ display: flex;
10310
+ margin: 0;
10311
+
10312
+ /* TODO this solves a problem but potentially causes and a11y issue */
10313
+ user-select: none;
10314
+ `;
10328
10315
  var StyledRadioInput = styled49.div`
10329
10316
  ${({ $size }) => getSizeCss2($size)}
10330
10317
  line-height: 0;
10331
10318
  margin: 0;
10332
- border: 1px solid var(--wui-color-border);
10333
10319
  border-radius: 50%; /* TODO --wui-border-radius-rounded */
10334
- background-color: var(--wui-color-bg-fill-white);
10335
10320
  display: grid;
10336
10321
  place-content: center;
10337
10322
  align-self: flex-start;
10323
+ background-color: ${({ $disabled }) => $disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-surface)"};
10324
+ border: 1px solid
10325
+ ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-border)"};
10338
10326
 
10327
+ /* radio button circle icon */
10339
10328
  svg {
10340
10329
  display: none;
10341
10330
 
10342
10331
  circle {
10343
- fill: var(--wui-color-bg-fill);
10332
+ fill: ${({ $disabled }) => $disabled ? "var(--wui-color-icon-disabled)" : "var(--wui-color-bg-fill)"};
10344
10333
  }
10345
10334
  }
10346
10335
  `;
10347
- var disabledStyle5 = css30`
10348
- cursor: not-allowed;
10349
- opacity: 0.5;
10350
- `;
10351
- var StyledRadioWrapper = styled49.div`
10352
- display: flex;
10353
- margin: 0;
10336
+ var StyledHiddenRadioInput = styled49.input`
10337
+ ${visuallyHiddenStyle}
10354
10338
 
10355
- /* TODO this solves a problem but potentially causes and a11y issue */
10356
- user-select: none;
10339
+ /* toggles display of faux-input background-color */
10340
+ &:checked + label [data-wui-faux-input='true'] {
10341
+ border-color: ${({ disabled }) => disabled ? "var(--wui-color-bg-surface-disabled)" : "var(--wui-color-bg-fill)"};
10342
+ }
10357
10343
 
10358
- ${({ $disabled }) => $disabled && disabledStyle5};
10344
+ /* toggles display of RadioIcon */
10345
+ &:checked + label svg {
10346
+ display: block;
10347
+ }
10359
10348
  `;
10360
10349
  var Radio = forwardRef18(
10361
10350
  ({
@@ -10401,12 +10390,14 @@ var Radio = forwardRef18(
10401
10390
  controlSlot: /* @__PURE__ */ jsx241(
10402
10391
  StyledRadioInput,
10403
10392
  {
10393
+ $disabled: disabled,
10404
10394
  $size: size,
10405
10395
  "data-wui-faux-input": "true",
10406
10396
  children: /* @__PURE__ */ jsx241(RadioIcon, {})
10407
10397
  }
10408
10398
  ),
10409
10399
  description,
10400
+ disabled,
10410
10401
  hideLabel,
10411
10402
  htmlFor: computedId,
10412
10403
  label