@wistia/ui 0.10.4 → 0.10.5-beta.0e9afde3.22d8df5

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.10.4
3
+ * @license @wistia/ui v0.10.5-beta.0e9afde3.22d8df5
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -7828,6 +7828,7 @@ var StyledBadge = import_styled_components26.default.div`
7828
7828
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7829
7829
  align-items: center;
7830
7830
  background-color: var(--wui-color-bg-surface-secondary);
7831
+ box-shadow: ${({ $variant }) => $variant === "outline" ? "inset 0 0 0 1px var(--wui-color-border)" : "none"};
7831
7832
  border-radius: var(--wui-border-radius-rounded);
7832
7833
  color: var(--wui-color-text);
7833
7834
  display: inline-flex;
@@ -7835,17 +7836,21 @@ var StyledBadge = import_styled_components26.default.div`
7835
7836
  font-weight: var(--wui-typography-label-4-weight);
7836
7837
  gap: var(--wui-space-01);
7837
7838
  justify-content: center;
7839
+ line-height: var(--wui-typography-label-3-line-height);
7838
7840
  padding: var(--wui-space-01) var(--wui-space-02);
7839
7841
  width: fit-content;
7840
7842
 
7841
- /* Icon component size */
7842
- svg {
7843
- height: 12px;
7844
- width: 12px;
7843
+ /* Icon component size and color */
7844
+ && {
7845
+ svg {
7846
+ color: var(--wui-color-icon);
7847
+ height: 12px;
7848
+ width: 12px;
7849
+ }
7845
7850
  }
7846
7851
  `;
7847
7852
  var Badge = (0, import_react26.forwardRef)(
7848
- ({ colorScheme = "inherit", label, icon, ...props }, ref) => {
7853
+ ({ colorScheme = "inherit", label, icon, variant = "default", ...props }, ref) => {
7849
7854
  const hasIcon = (0, import_type_guards19.isNotNil)(icon);
7850
7855
  return /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(
7851
7856
  StyledBadge,
@@ -7854,6 +7859,7 @@ var Badge = (0, import_react26.forwardRef)(
7854
7859
  ...props,
7855
7860
  $colorScheme: colorScheme,
7856
7861
  $hasIcon: hasIcon,
7862
+ $variant: variant,
7857
7863
  children: [
7858
7864
  hasIcon ? icon : null,
7859
7865
  /* @__PURE__ */ (0, import_jsx_runtime200.jsx)("span", { children: label })
@@ -8303,9 +8309,9 @@ var Center = (0, import_react29.forwardRef)(
8303
8309
  Center.displayName = "Center";
8304
8310
 
8305
8311
  // src/components/Checkbox/Checkbox.tsx
8306
- var import_react34 = require("react");
8307
- var import_styled_components39 = __toESM(require("styled-components"));
8308
- var import_type_guards26 = require("@wistia/type-guards");
8312
+ var import_react35 = require("react");
8313
+ var import_styled_components40 = __toESM(require("styled-components"));
8314
+ var import_type_guards28 = require("@wistia/type-guards");
8309
8315
 
8310
8316
  // src/private/components/FormControlLabel/FormControlLabel.tsx
8311
8317
  var import_styled_components35 = __toESM(require("styled-components"));
@@ -8424,7 +8430,8 @@ var FormControlLabel = ({
8424
8430
  FormControlLabel.displayName = "FormControlLabel";
8425
8431
 
8426
8432
  // src/components/FormGroup/CheckboxGroup.tsx
8427
- var import_react33 = require("react");
8433
+ var import_react34 = require("react");
8434
+ var import_type_guards27 = require("@wistia/type-guards");
8428
8435
 
8429
8436
  // src/components/FormGroup/FormGroup.tsx
8430
8437
  var import_styled_components38 = __toESM(require("styled-components"));
@@ -8621,11 +8628,132 @@ var FormGroup = ({ children, label, ...props }) => {
8621
8628
  };
8622
8629
  FormGroup.displayName = "FormGroup";
8623
8630
 
8624
- // src/components/FormGroup/CheckboxGroup.tsx
8631
+ // src/components/Form/Form.tsx
8632
+ var import_react33 = require("react");
8633
+ var import_styled_components39 = __toESM(require("styled-components"));
8634
+ var import_type_guards26 = require("@wistia/type-guards");
8635
+
8636
+ // src/components/Form/serializeFormData.tsx
8637
+ var ARRAY_SUFFIX = "[]";
8638
+ var serializeFormData = (formData) => {
8639
+ const data = {};
8640
+ formData.forEach((value, key) => {
8641
+ if (key.endsWith(ARRAY_SUFFIX)) {
8642
+ const newKey = key.slice(0, -ARRAY_SUFFIX.length);
8643
+ data[newKey] = formData.getAll(key);
8644
+ } else {
8645
+ data[key] = value;
8646
+ }
8647
+ });
8648
+ return data;
8649
+ };
8650
+
8651
+ // src/components/Form/Form.tsx
8625
8652
  var import_jsx_runtime213 = require("react/jsx-runtime");
8626
- var CheckboxGroupContext = (0, import_react33.createContext)(null);
8653
+ var StyledForm = import_styled_components39.default.form`
8654
+ --form-default-width: 690px;
8655
+
8656
+ max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
8657
+ align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
8658
+ `;
8659
+ var FormContext = (0, import_react33.createContext)({
8660
+ values: {},
8661
+ errors: {},
8662
+ hasSubmitted: false,
8663
+ formId: "NO_FORM",
8664
+ labelPosition: "block"
8665
+ });
8666
+ var FormComponent = ({
8667
+ children,
8668
+ action,
8669
+ values = {},
8670
+ labelPosition = "block",
8671
+ validate,
8672
+ fullWidth = false,
8673
+ ...props
8674
+ }, forwardedRef) => {
8675
+ const [errors, setErrors] = (0, import_react33.useState)({});
8676
+ const [hasSubmitted, setHasSubmitted] = (0, import_react33.useState)(false);
8677
+ const innerRef = (0, import_react33.useRef)();
8678
+ const ref = forwardedRef ?? innerRef;
8679
+ const autoId = (0, import_react33.useId)();
8680
+ const id = props.id ?? autoId;
8681
+ const handleValidate = (nextFormData) => {
8682
+ const nextData = serializeFormData(nextFormData);
8683
+ if ((0, import_type_guards26.isUndefined)(validate)) {
8684
+ return {};
8685
+ }
8686
+ return validate(nextData);
8687
+ };
8688
+ const handleBlur2 = (event) => {
8689
+ if (props.onBlur) {
8690
+ props.onBlur(event);
8691
+ }
8692
+ const formData = new FormData(event.currentTarget);
8693
+ if ((0, import_type_guards26.isNotUndefined)(validate)) {
8694
+ handleValidate(formData);
8695
+ }
8696
+ };
8697
+ const handleSubmit = (event) => {
8698
+ event.preventDefault();
8699
+ const formData = new FormData(event.currentTarget);
8700
+ const nextErrors = handleValidate(formData);
8701
+ const isValid = Object.keys(nextErrors).length === 0;
8702
+ setErrors(nextErrors);
8703
+ setHasSubmitted(true);
8704
+ if (isValid && props.onSubmit) {
8705
+ props.onSubmit(event);
8706
+ }
8707
+ if (isValid && action) {
8708
+ void action(formData);
8709
+ }
8710
+ };
8711
+ const handleReset = (event) => {
8712
+ setErrors({});
8713
+ setHasSubmitted(false);
8714
+ if (props.onReset) {
8715
+ props.onReset(event);
8716
+ }
8717
+ if (action) {
8718
+ void action(null);
8719
+ }
8720
+ };
8721
+ const context = (0, import_react33.useMemo)(() => {
8722
+ return {
8723
+ values,
8724
+ errors,
8725
+ hasSubmitted,
8726
+ formId: id,
8727
+ labelPosition
8728
+ };
8729
+ }, [labelPosition, values, errors, id, hasSubmitted]);
8730
+ return (
8731
+ // @ts-expect-error - generic context providers are a giant pain
8732
+ /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
8733
+ Stack,
8734
+ {
8735
+ ...props,
8736
+ ref,
8737
+ $fullWidth: fullWidth,
8738
+ as: StyledForm,
8739
+ gap: "space-05",
8740
+ id,
8741
+ onBlur: handleBlur2,
8742
+ onReset: handleReset,
8743
+ onSubmit: handleSubmit,
8744
+ children
8745
+ }
8746
+ ) })
8747
+ );
8748
+ };
8749
+ FormComponent.displayName = "Form";
8750
+ var Form = (0, import_react33.forwardRef)(FormComponent);
8751
+
8752
+ // src/components/FormGroup/CheckboxGroup.tsx
8753
+ var import_jsx_runtime214 = require("react/jsx-runtime");
8754
+ var CheckboxGroupContext = (0, import_react34.createContext)(null);
8627
8755
  var useCheckboxGroup = () => {
8628
- return (0, import_react33.useContext)(CheckboxGroupContext);
8756
+ return (0, import_react34.useContext)(CheckboxGroupContext);
8629
8757
  };
8630
8758
  var CheckboxGroup = ({
8631
8759
  children,
@@ -8634,19 +8762,22 @@ var CheckboxGroup = ({
8634
8762
  value,
8635
8763
  ...props
8636
8764
  }) => {
8637
- const context = (0, import_react33.useMemo)(() => {
8765
+ const formState = (0, import_react34.useContext)(FormContext);
8766
+ const derivedValue = (0, import_type_guards27.isArray)(formState.values[name]) ? formState.values[name] : value;
8767
+ const context = (0, import_react34.useMemo)(() => {
8638
8768
  return {
8639
- name,
8640
- onChange
8769
+ name: `${name}[]`,
8770
+ onChange,
8771
+ value: derivedValue
8641
8772
  };
8642
- }, [name, onChange]);
8643
- return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(FormGroup, { ...props, children }) });
8773
+ }, [name, derivedValue, onChange]);
8774
+ return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(FormGroup, { ...props, children }) });
8644
8775
  };
8645
8776
  CheckboxGroup.displayName = "CheckboxGroup";
8646
8777
 
8647
8778
  // src/components/Checkbox/Checkbox.tsx
8648
- var import_jsx_runtime214 = require("react/jsx-runtime");
8649
- var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
8779
+ var import_jsx_runtime215 = require("react/jsx-runtime");
8780
+ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
8650
8781
  "svg",
8651
8782
  {
8652
8783
  fill: "inherit",
@@ -8654,7 +8785,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
8654
8785
  viewBox: "0 0 10 8",
8655
8786
  width: "10",
8656
8787
  xmlns: "http://www.w3.org/2000/svg",
8657
- children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
8788
+ children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
8658
8789
  "path",
8659
8790
  {
8660
8791
  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",
@@ -8663,7 +8794,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
8663
8794
  )
8664
8795
  }
8665
8796
  );
8666
- var sizeSmall = import_styled_components39.css`
8797
+ var sizeSmall = import_styled_components40.css`
8667
8798
  width: 14px;
8668
8799
  height: 14px;
8669
8800
  min-width: 14px;
@@ -8674,7 +8805,7 @@ var sizeSmall = import_styled_components39.css`
8674
8805
  height: 7px;
8675
8806
  }
8676
8807
  `;
8677
- var sizeMedium = import_styled_components39.css`
8808
+ var sizeMedium = import_styled_components40.css`
8678
8809
  width: 16px;
8679
8810
  height: 16px;
8680
8811
  min-width: 16px;
@@ -8685,7 +8816,7 @@ var sizeMedium = import_styled_components39.css`
8685
8816
  height: 9px;
8686
8817
  }
8687
8818
  `;
8688
- var sizeLarge = import_styled_components39.css`
8819
+ var sizeLarge = import_styled_components40.css`
8689
8820
  width: 20px;
8690
8821
  height: 20px;
8691
8822
  min-width: 20px;
@@ -8701,14 +8832,14 @@ var getSizeCss = (size) => {
8701
8832
  if (size === "lg") return sizeLarge;
8702
8833
  return sizeMedium;
8703
8834
  };
8704
- var StyledCheckboxWrapper = import_styled_components39.default.div`
8835
+ var StyledCheckboxWrapper = import_styled_components40.default.div`
8705
8836
  display: flex;
8706
8837
  margin: 0;
8707
8838
 
8708
8839
  /* TODO this solves a problem but potentially causes and a11y issue */
8709
8840
  user-select: none;
8710
8841
  `;
8711
- var StyledCheckboxInput = import_styled_components39.default.div`
8842
+ var StyledCheckboxInput = import_styled_components40.default.div`
8712
8843
  ${({ $size }) => getSizeCss($size)}
8713
8844
  line-height: 0;
8714
8845
  margin: 0;
@@ -8730,7 +8861,7 @@ var StyledCheckboxInput = import_styled_components39.default.div`
8730
8861
  }
8731
8862
  }
8732
8863
  `;
8733
- var StyledHiddenCheckboxInput = import_styled_components39.default.input`
8864
+ var StyledHiddenCheckboxInput = import_styled_components40.default.input`
8734
8865
  ${visuallyHiddenStyle}
8735
8866
 
8736
8867
  /* toggles display of faux-input background-color */
@@ -8744,7 +8875,7 @@ var StyledHiddenCheckboxInput = import_styled_components39.default.input`
8744
8875
  display: block;
8745
8876
  }
8746
8877
  `;
8747
- var Checkbox = (0, import_react34.forwardRef)(
8878
+ var Checkbox = (0, import_react35.forwardRef)(
8748
8879
  ({
8749
8880
  checked,
8750
8881
  disabled = false,
@@ -8759,20 +8890,23 @@ var Checkbox = (0, import_react34.forwardRef)(
8759
8890
  hideLabel = false,
8760
8891
  ...props
8761
8892
  }, ref) => {
8762
- const generatedId = (0, import_react34.useId)();
8763
- const computedId = (0, import_type_guards26.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
8893
+ const generatedId = (0, import_react35.useId)();
8894
+ const computedId = (0, import_type_guards28.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
8764
8895
  const checkboxGroupContext = useCheckboxGroup();
8765
8896
  const contextName = checkboxGroupContext?.name;
8766
8897
  const contextOnChange = checkboxGroupContext?.onChange;
8898
+ const contextValue = checkboxGroupContext?.value;
8767
8899
  const checkboxName = name ?? contextName;
8768
8900
  const handleOnChange = onChange ?? contextOnChange;
8769
- return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(StyledCheckboxWrapper, { disabled, children: [
8770
- /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
8901
+ const defaultChecked = (0, import_type_guards28.isNotUndefined)(value) && contextValue ? contextValue.includes(value) : void 0;
8902
+ return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(StyledCheckboxWrapper, { disabled, children: [
8903
+ /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
8771
8904
  StyledHiddenCheckboxInput,
8772
8905
  {
8773
8906
  ...props,
8774
8907
  ref,
8775
8908
  checked,
8909
+ ...(0, import_type_guards28.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked },
8776
8910
  disabled,
8777
8911
  id: computedId,
8778
8912
  name: checkboxName,
@@ -8782,16 +8916,16 @@ var Checkbox = (0, import_react34.forwardRef)(
8782
8916
  value
8783
8917
  }
8784
8918
  ),
8785
- /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
8919
+ /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
8786
8920
  FormControlLabel,
8787
8921
  {
8788
- controlSlot: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
8922
+ controlSlot: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
8789
8923
  StyledCheckboxInput,
8790
8924
  {
8791
8925
  $disabled: disabled,
8792
8926
  $size: size,
8793
8927
  "data-wui-faux-input": "true",
8794
- children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(CheckIcon, {})
8928
+ children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(CheckIcon, {})
8795
8929
  }
8796
8930
  ),
8797
8931
  description,
@@ -8807,14 +8941,14 @@ var Checkbox = (0, import_react34.forwardRef)(
8807
8941
  Checkbox.displayName = "Checkbox";
8808
8942
 
8809
8943
  // src/components/ClickRegion/ClickRegion.tsx
8810
- var import_react35 = require("react");
8944
+ var import_react36 = require("react");
8811
8945
  var isClickableElement = (element) => {
8812
8946
  if (!element) return false;
8813
8947
  const el = element;
8814
8948
  return el.closest("button") !== null || el.closest("a") !== null || el.closest("input") !== null || el.closest("select") !== null || el.closest("textarea") !== null || el.closest("label") !== null || el.closest("[data-wui-faux-input]") !== null;
8815
8949
  };
8816
8950
  var ClickRegion = ({ children, targetRef }) => {
8817
- (0, import_react35.useEffect)(() => {
8951
+ (0, import_react36.useEffect)(() => {
8818
8952
  if (targetRef.current && targetRef.current.tagName === "A") {
8819
8953
  targetRef.current.setAttribute("data-click-region-target-link", "");
8820
8954
  } else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
@@ -8822,7 +8956,7 @@ var ClickRegion = ({ children, targetRef }) => {
8822
8956
  } else {
8823
8957
  }
8824
8958
  }, [targetRef]);
8825
- const handleClick = (0, import_react35.useCallback)(
8959
+ const handleClick = (0, import_react36.useCallback)(
8826
8960
  (event) => {
8827
8961
  const node = targetRef.current;
8828
8962
  if (event.target === node) {
@@ -8842,7 +8976,7 @@ var ClickRegion = ({ children, targetRef }) => {
8842
8976
  },
8843
8977
  [targetRef]
8844
8978
  );
8845
- return (0, import_react35.cloneElement)(import_react35.Children.only(children), {
8979
+ return (0, import_react36.cloneElement)(import_react36.Children.only(children), {
8846
8980
  "data-click-region": true,
8847
8981
  onClick: handleClick
8848
8982
  });
@@ -8851,10 +8985,10 @@ ClickRegion.displayName = "ClickRegion";
8851
8985
 
8852
8986
  // src/components/Collapsible/Collapsible.tsx
8853
8987
  var import_react_collapsible = require("@radix-ui/react-collapsible");
8854
- var import_type_guards27 = require("@wistia/type-guards");
8855
- var import_styled_components40 = __toESM(require("styled-components"));
8856
- var import_jsx_runtime215 = require("react/jsx-runtime");
8857
- var StyledRoot = (0, import_styled_components40.default)(import_react_collapsible.Root)`
8988
+ var import_type_guards29 = require("@wistia/type-guards");
8989
+ var import_styled_components41 = __toESM(require("styled-components"));
8990
+ var import_jsx_runtime216 = require("react/jsx-runtime");
8991
+ var StyledRoot = (0, import_styled_components41.default)(import_react_collapsible.Root)`
8858
8992
  &[data-state='closed'] [data-wui-collapsible-content] {
8859
8993
  display: -webkit-box;
8860
8994
  -webkit-box-orient: vertical;
@@ -8868,32 +9002,32 @@ var Collapsible = ({
8868
9002
  onOpenChange
8869
9003
  }) => {
8870
9004
  const controlProps = {
8871
- ...(0, import_type_guards27.isNotNil)(onOpenChange) && (0, import_type_guards27.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
9005
+ ...(0, import_type_guards29.isNotNil)(onOpenChange) && (0, import_type_guards29.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
8872
9006
  };
8873
- return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(StyledRoot, { ...controlProps, children });
9007
+ return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(StyledRoot, { ...controlProps, children });
8874
9008
  };
8875
9009
  Collapsible.displayName = "Collapsible";
8876
9010
 
8877
9011
  // src/components/Collapsible/CollapsibleTrigger.tsx
8878
- var import_react36 = require("react");
9012
+ var import_react37 = require("react");
8879
9013
  var import_react_collapsible2 = require("@radix-ui/react-collapsible");
8880
- var import_jsx_runtime216 = require("react/jsx-runtime");
9014
+ var import_jsx_runtime217 = require("react/jsx-runtime");
8881
9015
  var CollapsibleTrigger = ({ children }) => {
8882
- import_react36.Children.only(children);
8883
- return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
9016
+ import_react37.Children.only(children);
9017
+ return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
8884
9018
  };
8885
9019
 
8886
9020
  // src/components/Collapsible/CollapsibleContent.tsx
8887
- var import_styled_components41 = __toESM(require("styled-components"));
9021
+ var import_styled_components42 = __toESM(require("styled-components"));
8888
9022
  var import_react_collapsible3 = require("@radix-ui/react-collapsible");
8889
- var import_type_guards28 = require("@wistia/type-guards");
8890
- var import_jsx_runtime217 = require("react/jsx-runtime");
8891
- var ClampedContent = import_styled_components41.default.div`
9023
+ var import_type_guards30 = require("@wistia/type-guards");
9024
+ var import_jsx_runtime218 = require("react/jsx-runtime");
9025
+ var ClampedContent = import_styled_components42.default.div`
8892
9026
  --wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
8893
9027
  `;
8894
9028
  var CollapsibleContent = ({ clamp, children }) => {
8895
- if ((0, import_type_guards28.isNotUndefined)(clamp)) {
8896
- return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
9029
+ if ((0, import_type_guards30.isNotUndefined)(clamp)) {
9030
+ return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
8897
9031
  ClampedContent,
8898
9032
  {
8899
9033
  $clamp: clamp,
@@ -8902,18 +9036,18 @@ var CollapsibleContent = ({ clamp, children }) => {
8902
9036
  }
8903
9037
  );
8904
9038
  }
8905
- return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_react_collapsible3.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(import_jsx_runtime217.Fragment, { children: [
9039
+ return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(import_react_collapsible3.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(import_jsx_runtime218.Fragment, { children: [
8906
9040
  children,
8907
9041
  " "
8908
9042
  ] }) });
8909
9043
  };
8910
9044
 
8911
9045
  // src/components/DataCards/DataCard.tsx
8912
- var import_react37 = require("react");
8913
- var import_styled_components42 = __toESM(require("styled-components"));
8914
- var import_type_guards29 = require("@wistia/type-guards");
8915
- var import_jsx_runtime218 = require("react/jsx-runtime");
8916
- var StyledDataCard = import_styled_components42.default.div`
9046
+ var import_react38 = require("react");
9047
+ var import_styled_components43 = __toESM(require("styled-components"));
9048
+ var import_type_guards31 = require("@wistia/type-guards");
9049
+ var import_jsx_runtime219 = require("react/jsx-runtime");
9050
+ var StyledDataCard = import_styled_components43.default.div`
8917
9051
  display: grid;
8918
9052
  grid-template-areas: 'label slot' 'value value';
8919
9053
  grid-template-rows: auto auto;
@@ -8968,7 +9102,7 @@ var StyledDataCard = import_styled_components42.default.div`
8968
9102
  ${({ $colorScheme }) => getColorScheme($colorScheme)}
8969
9103
  }
8970
9104
  `;
8971
- var shimmer = import_styled_components42.keyframes`
9105
+ var shimmer = import_styled_components43.keyframes`
8972
9106
  0% {
8973
9107
  background-position: 200% 0;
8974
9108
  }
@@ -8976,7 +9110,7 @@ var shimmer = import_styled_components42.keyframes`
8976
9110
  background-position: -200% 0;
8977
9111
  }
8978
9112
  `;
8979
- var LoadingBackground = import_styled_components42.default.div`
9113
+ var LoadingBackground = import_styled_components43.default.div`
8980
9114
  background: linear-gradient(
8981
9115
  90deg,
8982
9116
  var(--wui-color-bg-surface-tertiary) 25%,
@@ -8987,27 +9121,27 @@ var LoadingBackground = import_styled_components42.default.div`
8987
9121
  animation: ${shimmer} 1.5s infinite;
8988
9122
  border-radius: var(--wui-border-radius-01);
8989
9123
  `;
8990
- var StyledLoadingLabel = (0, import_styled_components42.default)(LoadingBackground)`
9124
+ var StyledLoadingLabel = (0, import_styled_components43.default)(LoadingBackground)`
8991
9125
  width: 80px;
8992
9126
  height: var(--wui-typography-heading-6-line-height);
8993
9127
  `;
8994
- var StyledLoadingValue = (0, import_styled_components42.default)(LoadingBackground)`
9128
+ var StyledLoadingValue = (0, import_styled_components43.default)(LoadingBackground)`
8995
9129
  width: 90%;
8996
9130
  height: var(--wui-typography-heading-3-line-height);
8997
9131
  `;
8998
- var StyledLabel2 = (0, import_styled_components42.default)(Heading)`
9132
+ var StyledLabel2 = (0, import_styled_components43.default)(Heading)`
8999
9133
  grid-area: label;
9000
9134
  `;
9001
- var StyledValue = (0, import_styled_components42.default)(Heading)`
9135
+ var StyledValue = (0, import_styled_components43.default)(Heading)`
9002
9136
  grid-area: value;
9003
9137
  `;
9004
- var StyledSlot = import_styled_components42.default.div`
9138
+ var StyledSlot = import_styled_components43.default.div`
9005
9139
  display: flex;
9006
9140
  justify-content: flex-end;
9007
9141
  grid-area: slot;
9008
9142
  align-self: center;
9009
9143
  `;
9010
- var StyledDataCardTrendContainer = import_styled_components42.default.div`
9144
+ var StyledDataCardTrendContainer = import_styled_components43.default.div`
9011
9145
  position: absolute;
9012
9146
  bottom: var(--wui-space-01);
9013
9147
  right: var(--wui-space-01);
@@ -9020,34 +9154,34 @@ var DataCardInner = ({
9020
9154
  isLoading = false,
9021
9155
  trend,
9022
9156
  ...props
9023
- }) => /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
9157
+ }) => /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(
9024
9158
  StyledDataCard,
9025
9159
  {
9026
9160
  $colorScheme: colorScheme,
9027
9161
  ...props,
9028
9162
  children: [
9029
- /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
9163
+ /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
9030
9164
  StyledLabel2,
9031
9165
  {
9032
9166
  renderAs: "dt",
9033
9167
  variant: "heading6",
9034
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(StyledLoadingLabel, {}) : label
9168
+ children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(StyledLoadingLabel, {}) : label
9035
9169
  }
9036
9170
  ),
9037
- /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
9171
+ /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
9038
9172
  StyledValue,
9039
9173
  {
9040
9174
  renderAs: "dd",
9041
9175
  variant: "heading3",
9042
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(StyledLoadingValue, {}) : value
9176
+ children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(StyledLoadingValue, {}) : value
9043
9177
  }
9044
9178
  ),
9045
- (0, import_type_guards29.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(StyledSlot, { children: upperRightSlot }),
9046
- (0, import_type_guards29.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(StyledDataCardTrendContainer, { children: trend })
9179
+ (0, import_type_guards31.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(StyledSlot, { children: upperRightSlot }),
9180
+ (0, import_type_guards31.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(StyledDataCardTrendContainer, { children: trend })
9047
9181
  ]
9048
9182
  }
9049
9183
  );
9050
- var DataCardArrowIcon = /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
9184
+ var DataCardArrowIcon = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
9051
9185
  Icon,
9052
9186
  {
9053
9187
  "data-wui-data-card-hover-icon": true,
@@ -9055,18 +9189,18 @@ var DataCardArrowIcon = /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
9055
9189
  }
9056
9190
  );
9057
9191
  var DataCard = (props) => {
9058
- const ref = (0, import_react37.useRef)(null);
9059
- if ((0, import_type_guards29.isNotNil)(props.href) || (0, import_type_guards29.isNotNil)(props.onClick)) {
9060
- return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
9192
+ const ref = (0, import_react38.useRef)(null);
9193
+ if ((0, import_type_guards31.isNotNil)(props.href) || (0, import_type_guards31.isNotNil)(props.onClick)) {
9194
+ return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
9061
9195
  DataCardInner,
9062
9196
  {
9063
9197
  upperRightSlot: props.upperRightSlot ?? DataCardArrowIcon,
9064
9198
  ...props,
9065
- label: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
9199
+ label: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
9066
9200
  Button,
9067
9201
  {
9068
9202
  ref,
9069
- ...(0, import_type_guards29.isNotNil)(props.beforeAction) ? { beforeAction: props.beforeAction } : {},
9203
+ ...(0, import_type_guards31.isNotNil)(props.beforeAction) ? { beforeAction: props.beforeAction } : {},
9070
9204
  disabled: props.disabled ?? false,
9071
9205
  href: props.href,
9072
9206
  onClick: props.onClick,
@@ -9077,14 +9211,14 @@ var DataCard = (props) => {
9077
9211
  }
9078
9212
  ) });
9079
9213
  }
9080
- return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(DataCardInner, { ...props });
9214
+ return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(DataCardInner, { ...props });
9081
9215
  };
9082
9216
  DataCard.displayName = "DataCard";
9083
9217
 
9084
9218
  // src/components/DataCards/DataCards.tsx
9085
- var import_styled_components43 = __toESM(require("styled-components"));
9086
- var import_jsx_runtime219 = require("react/jsx-runtime");
9087
- var StyledDataCards = (0, import_styled_components43.default)(Box)`
9219
+ var import_styled_components44 = __toESM(require("styled-components"));
9220
+ var import_jsx_runtime220 = require("react/jsx-runtime");
9221
+ var StyledDataCards = (0, import_styled_components44.default)(Box)`
9088
9222
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
9089
9223
  margin-top: 0; /* Remove default <dl> style */
9090
9224
  > * {
@@ -9098,7 +9232,7 @@ var DataCards = ({
9098
9232
  colorScheme = "inherit",
9099
9233
  ...props
9100
9234
  }) => {
9101
- return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
9235
+ return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
9102
9236
  StyledDataCards,
9103
9237
  {
9104
9238
  ...props,
@@ -9116,26 +9250,26 @@ var DataCards = ({
9116
9250
  DataCards.displayName = "DataCards";
9117
9251
 
9118
9252
  // src/components/DataCards/DataCardTrend.tsx
9119
- var import_styled_components45 = __toESM(require("styled-components"));
9253
+ var import_styled_components46 = __toESM(require("styled-components"));
9120
9254
 
9121
9255
  // src/components/Text/Text.tsx
9122
- var import_react38 = require("react");
9123
- var import_styled_components44 = __toESM(require("styled-components"));
9124
- var import_type_guards30 = require("@wistia/type-guards");
9125
- var import_jsx_runtime220 = require("react/jsx-runtime");
9126
- var bodyBoldStyles = import_styled_components44.css`
9256
+ var import_react39 = require("react");
9257
+ var import_styled_components45 = __toESM(require("styled-components"));
9258
+ var import_type_guards32 = require("@wistia/type-guards");
9259
+ var import_jsx_runtime221 = require("react/jsx-runtime");
9260
+ var bodyBoldStyles = import_styled_components45.css`
9127
9261
  > strong,
9128
9262
  b {
9129
9263
  font-weight: var(--wui-typography-weight-body-bold);
9130
9264
  }
9131
9265
  `;
9132
- var labelBoldStyles = import_styled_components44.css`
9266
+ var labelBoldStyles = import_styled_components45.css`
9133
9267
  > strong,
9134
9268
  b {
9135
9269
  font-weight: var(--wui-typography-weight-label-bold);
9136
9270
  }
9137
9271
  `;
9138
- var body1TextStyle = import_styled_components44.css`
9272
+ var body1TextStyle = import_styled_components45.css`
9139
9273
  --font-family: var(--wui-typography-body-1-family);
9140
9274
  --font-size: var(--wui-typography-body-1-size);
9141
9275
  --font-weight: var(--wui-typography-body-1-weight);
@@ -9143,7 +9277,7 @@ var body1TextStyle = import_styled_components44.css`
9143
9277
  --paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
9144
9278
  ${bodyBoldStyles}
9145
9279
  `;
9146
- var body2TextStyle = import_styled_components44.css`
9280
+ var body2TextStyle = import_styled_components45.css`
9147
9281
  --font-family: var(--wui-typography-body-2-family);
9148
9282
  --font-size: var(--wui-typography-body-2-size);
9149
9283
  --font-weight: var(--wui-typography-body-2-weight);
@@ -9151,7 +9285,7 @@ var body2TextStyle = import_styled_components44.css`
9151
9285
  --paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
9152
9286
  ${bodyBoldStyles}
9153
9287
  `;
9154
- var body3TextStyle = import_styled_components44.css`
9288
+ var body3TextStyle = import_styled_components45.css`
9155
9289
  --font-family: var(--wui-typography-body-3-family);
9156
9290
  --font-size: var(--wui-typography-body-3-size);
9157
9291
  --font-weight: var(--wui-typography-body-3-weight);
@@ -9159,7 +9293,7 @@ var body3TextStyle = import_styled_components44.css`
9159
9293
  --paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
9160
9294
  ${bodyBoldStyles}
9161
9295
  `;
9162
- var body4TextStyle = import_styled_components44.css`
9296
+ var body4TextStyle = import_styled_components45.css`
9163
9297
  --font-family: var(--wui-typography-body-4-family);
9164
9298
  --font-size: var(--wui-typography-body-4-size);
9165
9299
  --font-weight: var(--wui-typography-body-4-weight);
@@ -9167,47 +9301,47 @@ var body4TextStyle = import_styled_components44.css`
9167
9301
  --paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
9168
9302
  ${bodyBoldStyles}
9169
9303
  `;
9170
- var label1TextStyle = import_styled_components44.css`
9304
+ var label1TextStyle = import_styled_components45.css`
9171
9305
  --font-family: var(--wui-typography-label-1-family);
9172
9306
  --font-size: var(--wui-typography-label-1-size);
9173
9307
  --font-weight: var(--wui-typography-label-1-weight);
9174
9308
  --line-height: var(--wui-typography-label-1-line-height);
9175
9309
  ${labelBoldStyles}
9176
9310
  `;
9177
- var label2TextStyle = import_styled_components44.css`
9311
+ var label2TextStyle = import_styled_components45.css`
9178
9312
  --font-family: var(--wui-typography-label-2-family);
9179
9313
  --font-size: var(--wui-typography-label-2-size);
9180
9314
  --font-weight: var(--wui-typography-label-2-weight);
9181
9315
  --line-height: var(--wui-typography-label-2-line-height);
9182
9316
  ${labelBoldStyles}
9183
9317
  `;
9184
- var label3TextStyle = import_styled_components44.css`
9318
+ var label3TextStyle = import_styled_components45.css`
9185
9319
  --font-family: var(--wui-typography-label-3-family);
9186
9320
  --font-size: var(--wui-typography-label-3-size);
9187
9321
  --font-weight: var(--wui-typography-label-3-weight);
9188
9322
  --line-height: var(--wui-typography-label-3-line-height);
9189
9323
  ${labelBoldStyles}
9190
9324
  `;
9191
- var label4TextStyle = import_styled_components44.css`
9325
+ var label4TextStyle = import_styled_components45.css`
9192
9326
  --font-family: var(--wui-typography-label-4-family);
9193
9327
  --font-size: var(--wui-typography-label-4-size);
9194
9328
  --font-weight: var(--wui-typography-label-4-weight);
9195
9329
  --line-height: var(--wui-typography-label-4-line-height);
9196
9330
  ${labelBoldStyles}
9197
9331
  `;
9198
- var body1MonoTextStyle = import_styled_components44.css`
9332
+ var body1MonoTextStyle = import_styled_components45.css`
9199
9333
  ${body1TextStyle};
9200
9334
  --font-family: var(--wui-typography-family-mono);
9201
9335
  `;
9202
- var body2MonoTextStyle = import_styled_components44.css`
9336
+ var body2MonoTextStyle = import_styled_components45.css`
9203
9337
  ${body2TextStyle};
9204
9338
  --font-family: var(--wui-typography-family-mono);
9205
9339
  `;
9206
- var body3MonoTextStyle = import_styled_components44.css`
9340
+ var body3MonoTextStyle = import_styled_components45.css`
9207
9341
  ${body3TextStyle};
9208
9342
  --font-family: var(--wui-typography-family-mono);
9209
9343
  `;
9210
- var body4MonoTextStyle = import_styled_components44.css`
9344
+ var body4MonoTextStyle = import_styled_components45.css`
9211
9345
  ${body4TextStyle};
9212
9346
  --font-family: var(--wui-typography-family-mono);
9213
9347
  `;
@@ -9242,7 +9376,7 @@ var variantElementMap2 = {
9242
9376
  label3: labelElement,
9243
9377
  label4: labelElement
9244
9378
  };
9245
- var StyledText = import_styled_components44.default.div`
9379
+ var StyledText = import_styled_components45.default.div`
9246
9380
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
9247
9381
  --text-color: ${({ $prominence, $disabled }) => {
9248
9382
  if ($disabled) {
@@ -9266,27 +9400,27 @@ var StyledText = import_styled_components44.default.div`
9266
9400
  margin: 0;
9267
9401
  ${({ $variant }) => variantStyleMap2[$variant]}
9268
9402
  ${({ $truncate }) => {
9269
- if ((0, import_type_guards30.isNotNil)($truncate)) {
9270
- return import_styled_components44.css`
9403
+ if ((0, import_type_guards32.isNotNil)($truncate)) {
9404
+ return import_styled_components45.css`
9271
9405
  ${ellipsisStyle};
9272
9406
  ${lineClampCss($truncate)};
9273
9407
  `;
9274
9408
  }
9275
9409
  return void 0;
9276
9410
  }}
9277
- ${({ $inline }) => $inline && import_styled_components44.css`
9411
+ ${({ $inline }) => $inline && import_styled_components45.css`
9278
9412
  display: inline-block;
9279
9413
  `}
9280
- ${({ $disabled }) => $disabled && import_styled_components44.css`
9414
+ ${({ $disabled }) => $disabled && import_styled_components45.css`
9281
9415
  --text-color: var(--wui-color-text-disabled);
9282
9416
  `}
9283
- ${({ $preventUserSelect }) => $preventUserSelect && import_styled_components44.css`
9417
+ ${({ $preventUserSelect }) => $preventUserSelect && import_styled_components45.css`
9284
9418
  user-select: none;
9285
9419
  `}
9286
- ${({ $align }) => import_styled_components44.css`
9420
+ ${({ $align }) => import_styled_components45.css`
9287
9421
  text-align: ${$align};
9288
9422
  `}
9289
- ${({ as }) => as === "p" && import_styled_components44.css`
9423
+ ${({ as }) => as === "p" && import_styled_components45.css`
9290
9424
  display: block;
9291
9425
 
9292
9426
  + p {
@@ -9294,7 +9428,7 @@ var StyledText = import_styled_components44.default.div`
9294
9428
  }
9295
9429
  `}
9296
9430
  `;
9297
- var TextComponent = (0, import_react38.forwardRef)(
9431
+ var TextComponent = (0, import_react39.forwardRef)(
9298
9432
  ({
9299
9433
  align = "left",
9300
9434
  colorScheme = "inherit",
@@ -9307,7 +9441,7 @@ var TextComponent = (0, import_react38.forwardRef)(
9307
9441
  renderAs,
9308
9442
  ...props
9309
9443
  }, ref) => {
9310
- return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
9444
+ return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
9311
9445
  StyledText,
9312
9446
  {
9313
9447
  ref,
@@ -9329,8 +9463,8 @@ TextComponent.displayName = "Text";
9329
9463
  var Text = makePolymorphic(TextComponent);
9330
9464
 
9331
9465
  // src/components/DataCards/DataCardTrend.tsx
9332
- var import_jsx_runtime221 = require("react/jsx-runtime");
9333
- var StyledDataCardTrend = import_styled_components45.default.div`
9466
+ var import_jsx_runtime222 = require("react/jsx-runtime");
9467
+ var StyledDataCardTrend = import_styled_components46.default.div`
9334
9468
  ${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
9335
9469
  background: var(--wui-color-bg-app);
9336
9470
  border-radius: var(--wui-border-radius-rounded);
@@ -9345,8 +9479,8 @@ var DataCardTrend = ({
9345
9479
  children,
9346
9480
  ...props
9347
9481
  }) => {
9348
- return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
9349
- /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
9482
+ return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
9483
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
9350
9484
  Icon,
9351
9485
  {
9352
9486
  size: "md",
@@ -9354,7 +9488,7 @@ var DataCardTrend = ({
9354
9488
  ...props
9355
9489
  }
9356
9490
  ),
9357
- /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
9491
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
9358
9492
  Text,
9359
9493
  {
9360
9494
  prominence: "secondary",
@@ -9366,22 +9500,22 @@ var DataCardTrend = ({
9366
9500
  };
9367
9501
 
9368
9502
  // src/components/Divider/Divider.tsx
9369
- var import_styled_components46 = __toESM(require("styled-components"));
9370
- var import_jsx_runtime222 = require("react/jsx-runtime");
9371
- var horizontalBorderCss = import_styled_components46.css`
9503
+ var import_styled_components47 = __toESM(require("styled-components"));
9504
+ var import_jsx_runtime223 = require("react/jsx-runtime");
9505
+ var horizontalBorderCss = import_styled_components47.css`
9372
9506
  border-top-color: var(--wui-color-border);
9373
9507
  border-top-style: solid;
9374
9508
  border-top-width: 1px;
9375
9509
  clear: both; /* for horizontal dividers, ensure it clears any floats */
9376
9510
  height: 0;
9377
9511
  `;
9378
- var verticalBorderCss = import_styled_components46.css`
9512
+ var verticalBorderCss = import_styled_components47.css`
9379
9513
  background-color: var(--wui-color-border);
9380
9514
  max-width: 1px;
9381
9515
  min-height: 100%;
9382
9516
  width: 1px;
9383
9517
  `;
9384
- var DividerComponent = import_styled_components46.default.div`
9518
+ var DividerComponent = import_styled_components47.default.div`
9385
9519
  ${({ $orientation }) => {
9386
9520
  switch ($orientation) {
9387
9521
  case "vertical":
@@ -9393,7 +9527,7 @@ var DividerComponent = import_styled_components46.default.div`
9393
9527
  }}
9394
9528
  `;
9395
9529
  var Divider = ({ orientation = "horizontal", ...props }) => {
9396
- return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
9530
+ return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
9397
9531
  DividerComponent,
9398
9532
  {
9399
9533
  $orientation: orientation,
@@ -9406,14 +9540,14 @@ var Divider = ({ orientation = "horizontal", ...props }) => {
9406
9540
  Divider.displayName = "Divider";
9407
9541
 
9408
9542
  // src/components/EditableHeading/EditableHeading.tsx
9409
- var import_styled_components50 = __toESM(require("styled-components"));
9410
- var import_react40 = require("react");
9543
+ var import_styled_components51 = __toESM(require("styled-components"));
9544
+ var import_react41 = require("react");
9411
9545
 
9412
9546
  // src/components/Tooltip/Tooltip.tsx
9413
9547
  var import_react_tooltip2 = require("@radix-ui/react-tooltip");
9414
- var import_styled_components47 = __toESM(require("styled-components"));
9415
- var import_jsx_runtime223 = require("react/jsx-runtime");
9416
- var hide = import_styled_components47.keyframes`
9548
+ var import_styled_components48 = __toESM(require("styled-components"));
9549
+ var import_jsx_runtime224 = require("react/jsx-runtime");
9550
+ var hide = import_styled_components48.keyframes`
9417
9551
  from {
9418
9552
  opacity: 1;
9419
9553
  }
@@ -9421,7 +9555,7 @@ var hide = import_styled_components47.keyframes`
9421
9555
  opacity: 0;
9422
9556
  }
9423
9557
  `;
9424
- var slideDownAndFade = import_styled_components47.keyframes`
9558
+ var slideDownAndFade = import_styled_components48.keyframes`
9425
9559
  from {
9426
9560
  opacity: 0;
9427
9561
  transform: translateY(-6px);
@@ -9431,7 +9565,7 @@ var slideDownAndFade = import_styled_components47.keyframes`
9431
9565
  transform: translateY(0);
9432
9566
  }
9433
9567
  `;
9434
- var slideLeftAndFade = import_styled_components47.keyframes`
9568
+ var slideLeftAndFade = import_styled_components48.keyframes`
9435
9569
  from {
9436
9570
  opacity: 0;
9437
9571
  transform: translateX(6px);
@@ -9441,7 +9575,7 @@ var slideLeftAndFade = import_styled_components47.keyframes`
9441
9575
  transform: translateX(0);
9442
9576
  }
9443
9577
  `;
9444
- var slideUpAndFade = import_styled_components47.keyframes`
9578
+ var slideUpAndFade = import_styled_components48.keyframes`
9445
9579
  from {
9446
9580
  opacity: 0;
9447
9581
  transform: translateY(6px);
@@ -9451,7 +9585,7 @@ var slideUpAndFade = import_styled_components47.keyframes`
9451
9585
  transform: translateY(0);
9452
9586
  }
9453
9587
  `;
9454
- var slideRightAndFade = import_styled_components47.keyframes`
9588
+ var slideRightAndFade = import_styled_components48.keyframes`
9455
9589
  from {
9456
9590
  opacity: 0;
9457
9591
  transform: translateX(-6px);
@@ -9461,7 +9595,7 @@ var slideRightAndFade = import_styled_components47.keyframes`
9461
9595
  transform: translateX(0);
9462
9596
  }
9463
9597
  `;
9464
- var StyledContent = (0, import_styled_components47.default)(import_react_tooltip2.Content)`
9598
+ var StyledContent = (0, import_styled_components48.default)(import_react_tooltip2.Content)`
9465
9599
  --tooltip-font-family: var(--wui-typography-family-default);
9466
9600
  --tooltip-border-radius: var(--wui-border-radius-05);
9467
9601
  --tooltip-bg: var(--wui-color-bg-tooltip);
@@ -9523,21 +9657,21 @@ var Tooltip = ({
9523
9657
  if (forceOpen === true) {
9524
9658
  rootProps.open = true;
9525
9659
  }
9526
- return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(
9660
+ return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(
9527
9661
  import_react_tooltip2.Root,
9528
9662
  {
9529
9663
  delayDuration: delay,
9530
9664
  ...rootProps,
9531
9665
  children: [
9532
- /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
9533
- /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(
9666
+ /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
9667
+ /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(
9534
9668
  StyledContent,
9535
9669
  {
9536
9670
  side: direction,
9537
9671
  sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
9538
9672
  children: [
9539
9673
  content,
9540
- !hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
9674
+ !hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
9541
9675
  "svg",
9542
9676
  {
9543
9677
  fill: "var(--tooltip-bg)",
@@ -9546,7 +9680,7 @@ var Tooltip = ({
9546
9680
  viewBox: "0 0 12 8",
9547
9681
  width: "12",
9548
9682
  xmlns: "http://www.w3.org/2000/svg",
9549
- children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
9683
+ children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
9550
9684
  }
9551
9685
  ) }) : null
9552
9686
  ]
@@ -9559,13 +9693,13 @@ var Tooltip = ({
9559
9693
  Tooltip.displayName = "Tooltip";
9560
9694
 
9561
9695
  // src/components/Input/Input.tsx
9562
- var import_react39 = require("react");
9563
- var import_styled_components49 = __toESM(require("styled-components"));
9564
- var import_type_guards31 = require("@wistia/type-guards");
9696
+ var import_react40 = require("react");
9697
+ var import_styled_components50 = __toESM(require("styled-components"));
9698
+ var import_type_guards33 = require("@wistia/type-guards");
9565
9699
 
9566
9700
  // src/css/inputCss.ts
9567
- var import_styled_components48 = require("styled-components");
9568
- var inputCss = import_styled_components48.css`
9701
+ var import_styled_components49 = require("styled-components");
9702
+ var inputCss = import_styled_components49.css`
9569
9703
  /* Colors */
9570
9704
  --wui-input-color-bg: var(--wui-color-bg-surface);
9571
9705
  --wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
@@ -9591,8 +9725,8 @@ var inputCss = import_styled_components48.css`
9591
9725
  `;
9592
9726
 
9593
9727
  // src/components/Input/Input.tsx
9594
- var import_jsx_runtime224 = require("react/jsx-runtime");
9595
- var inputStyles = import_styled_components49.css`
9728
+ var import_jsx_runtime225 = require("react/jsx-runtime");
9729
+ var inputStyles = import_styled_components50.css`
9596
9730
  ${inputCss}
9597
9731
  input,
9598
9732
  textarea {
@@ -9627,7 +9761,7 @@ var inputStyles = import_styled_components49.css`
9627
9761
  }
9628
9762
  }
9629
9763
  `;
9630
- var StyledInputContainer = import_styled_components49.default.div`
9764
+ var StyledInputContainer = import_styled_components50.default.div`
9631
9765
  display: inline-flex;
9632
9766
  position: relative;
9633
9767
  ${inputStyles};
@@ -9694,7 +9828,7 @@ var StyledInputContainer = import_styled_components49.default.div`
9694
9828
  padding-right: 32px;
9695
9829
  }
9696
9830
  `;
9697
- var Input = (0, import_react39.forwardRef)(
9831
+ var Input = (0, import_react40.forwardRef)(
9698
9832
  ({
9699
9833
  fullWidth = true,
9700
9834
  monospace = false,
@@ -9704,30 +9838,30 @@ var Input = (0, import_react39.forwardRef)(
9704
9838
  rightIcon,
9705
9839
  ...props
9706
9840
  }, externalRef) => {
9707
- const internalRef = (0, import_react39.useRef)();
9841
+ const internalRef = (0, import_react40.useRef)();
9708
9842
  const ref = (
9709
9843
  // eslint-disable-next-line react-compiler/react-compiler
9710
- (0, import_type_guards31.isNotNil)(externalRef) && (0, import_type_guards31.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
9844
+ (0, import_type_guards33.isNotNil)(externalRef) && (0, import_type_guards33.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
9711
9845
  );
9712
9846
  let leftIconToDisplay = leftIcon;
9713
- if ((0, import_type_guards31.isNil)(leftIcon) && type === "search") {
9714
- leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(Icon, { type: "search" });
9847
+ if ((0, import_type_guards33.isNil)(leftIcon) && type === "search") {
9848
+ leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(Icon, { type: "search" });
9715
9849
  }
9716
- if ((0, import_type_guards31.isNotNil)(leftIconToDisplay)) {
9717
- leftIconToDisplay = (0, import_react39.cloneElement)(leftIconToDisplay, {
9850
+ if ((0, import_type_guards33.isNotNil)(leftIconToDisplay)) {
9851
+ leftIconToDisplay = (0, import_react40.cloneElement)(leftIconToDisplay, {
9718
9852
  size: "md",
9719
9853
  className: "wui-input-left-icon"
9720
9854
  });
9721
9855
  }
9722
9856
  let rightIconToDisplay = rightIcon;
9723
- if ((0, import_type_guards31.isNotNil)(rightIconToDisplay)) {
9724
- rightIconToDisplay = (0, import_react39.cloneElement)(rightIconToDisplay, {
9857
+ if ((0, import_type_guards33.isNotNil)(rightIconToDisplay)) {
9858
+ rightIconToDisplay = (0, import_react40.cloneElement)(rightIconToDisplay, {
9725
9859
  size: "md",
9726
9860
  className: "wui-input-right-icon"
9727
9861
  });
9728
9862
  }
9729
9863
  const handleFocus2 = (event) => {
9730
- if ((0, import_type_guards31.isNotNil)(props.onFocus)) {
9864
+ if ((0, import_type_guards33.isNotNil)(props.onFocus)) {
9731
9865
  props.onFocus(event);
9732
9866
  }
9733
9867
  if (autoSelect && isValidRef(ref) && "current" in ref) {
@@ -9736,21 +9870,21 @@ var Input = (0, import_react39.forwardRef)(
9736
9870
  });
9737
9871
  }
9738
9872
  };
9739
- return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(
9873
+ return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
9740
9874
  StyledInputContainer,
9741
9875
  {
9742
9876
  $fullWidth: fullWidth,
9743
9877
  $monospace: monospace,
9744
9878
  children: [
9745
9879
  leftIconToDisplay ?? null,
9746
- type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
9880
+ type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
9747
9881
  "textarea",
9748
9882
  {
9749
9883
  ...props,
9750
9884
  ref,
9751
9885
  onFocus: handleFocus2
9752
9886
  }
9753
- ) : /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
9887
+ ) : /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
9754
9888
  "input",
9755
9889
  {
9756
9890
  ...props,
@@ -9768,8 +9902,8 @@ var Input = (0, import_react39.forwardRef)(
9768
9902
  Input.displayName = "Input";
9769
9903
 
9770
9904
  // src/components/EditableHeading/EditableHeading.tsx
9771
- var import_jsx_runtime225 = require("react/jsx-runtime");
9772
- var StyledInput = (0, import_styled_components50.default)(Input)`
9905
+ var import_jsx_runtime226 = require("react/jsx-runtime");
9906
+ var StyledInput = (0, import_styled_components51.default)(Input)`
9773
9907
  :not([rows]) {
9774
9908
  min-height: unset;
9775
9909
  }
@@ -9786,7 +9920,7 @@ var StyledInput = (0, import_styled_components50.default)(Input)`
9786
9920
  height: ${({ $height }) => `${$height}px`};
9787
9921
  }
9788
9922
  `;
9789
- var editableStyles = import_styled_components50.css`
9923
+ var editableStyles = import_styled_components51.css`
9790
9924
  &:has(+ :focus-within) {
9791
9925
  background: var(--wui-color-bg-surface-hover);
9792
9926
  }
@@ -9796,7 +9930,7 @@ var editableStyles = import_styled_components50.css`
9796
9930
  cursor: pointer;
9797
9931
  }
9798
9932
  `;
9799
- var StyledHeading2 = (0, import_styled_components50.default)(Heading)`
9933
+ var StyledHeading2 = (0, import_styled_components51.default)(Heading)`
9800
9934
  width: 100%;
9801
9935
  border-radius: var(--wui-border-radius-02);
9802
9936
  padding: var(--wui-space-02);
@@ -9813,11 +9947,11 @@ var EditableHeading = ({
9813
9947
  __forceEditing = false,
9814
9948
  editingDisabled = false
9815
9949
  }) => {
9816
- const [isEditing, setIsEditing] = (0, import_react40.useState)(false);
9817
- const [value, setValue] = (0, import_react40.useState)(children);
9818
- const [previousValue, setPreviousValue] = (0, import_react40.useState)(children);
9819
- const [headingHeight, setHeadingHeight] = (0, import_react40.useState)("60");
9820
- const headingRef = (0, import_react40.useRef)(null);
9950
+ const [isEditing, setIsEditing] = (0, import_react41.useState)(false);
9951
+ const [value, setValue] = (0, import_react41.useState)(children);
9952
+ const [previousValue, setPreviousValue] = (0, import_react41.useState)(children);
9953
+ const [headingHeight, setHeadingHeight] = (0, import_react41.useState)("60");
9954
+ const headingRef = (0, import_react41.useRef)(null);
9821
9955
  const handleSetEditing = (editing) => {
9822
9956
  if (editingDisabled) return;
9823
9957
  if (editing && headingRef.current) {
@@ -9850,7 +9984,7 @@ var EditableHeading = ({
9850
9984
  handleSetEditing(false);
9851
9985
  }
9852
9986
  };
9853
- const HeadingComponent2 = /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
9987
+ const HeadingComponent2 = /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
9854
9988
  StyledHeading2,
9855
9989
  {
9856
9990
  ref: headingRef,
@@ -9864,7 +9998,7 @@ var EditableHeading = ({
9864
9998
  return HeadingComponent2;
9865
9999
  }
9866
10000
  if (isEditing || __forceEditing) {
9867
- return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
10001
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
9868
10002
  StyledInput,
9869
10003
  {
9870
10004
  $height: headingHeight,
@@ -9882,9 +10016,9 @@ var EditableHeading = ({
9882
10016
  }
9883
10017
  );
9884
10018
  }
9885
- return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(import_jsx_runtime225.Fragment, { children: [
9886
- /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(Tooltip, { content: tooltipText, children: HeadingComponent2 }),
9887
- /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
10019
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(import_jsx_runtime226.Fragment, { children: [
10020
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Tooltip, { content: tooltipText, children: HeadingComponent2 }),
10021
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
9888
10022
  "button",
9889
10023
  {
9890
10024
  "aria-label": ariaLabel,
@@ -9895,110 +10029,6 @@ var EditableHeading = ({
9895
10029
  ] });
9896
10030
  };
9897
10031
 
9898
- // src/components/Form/Form.tsx
9899
- var import_react41 = require("react");
9900
- var import_styled_components51 = __toESM(require("styled-components"));
9901
- var import_type_guards32 = require("@wistia/type-guards");
9902
- var import_jsx_runtime226 = require("react/jsx-runtime");
9903
- var StyledForm = import_styled_components51.default.form`
9904
- --form-default-width: 690px;
9905
-
9906
- max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
9907
- align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
9908
- `;
9909
- var FormContext = (0, import_react41.createContext)({
9910
- values: {},
9911
- errors: {},
9912
- hasSubmitted: false,
9913
- formId: "NO_FORM",
9914
- labelPosition: "block"
9915
- });
9916
- var FormComponent = ({
9917
- children,
9918
- action,
9919
- values = {},
9920
- labelPosition = "block",
9921
- validate,
9922
- fullWidth = false,
9923
- ...props
9924
- }, forwardedRef) => {
9925
- const [errors, setErrors] = (0, import_react41.useState)({});
9926
- const [hasSubmitted, setHasSubmitted] = (0, import_react41.useState)(false);
9927
- const innerRef = (0, import_react41.useRef)();
9928
- const ref = forwardedRef ?? innerRef;
9929
- const autoId = (0, import_react41.useId)();
9930
- const id = props.id ?? autoId;
9931
- const handleValidate = (nextFormData) => {
9932
- const nextData = Object.fromEntries(nextFormData.entries());
9933
- if ((0, import_type_guards32.isUndefined)(validate)) {
9934
- return {};
9935
- }
9936
- return validate(nextData);
9937
- };
9938
- const handleBlur2 = (event) => {
9939
- if (props.onBlur) {
9940
- props.onBlur(event);
9941
- }
9942
- const formData = new FormData(event.currentTarget);
9943
- if ((0, import_type_guards32.isNotUndefined)(validate)) {
9944
- handleValidate(formData);
9945
- }
9946
- };
9947
- const handleSubmit = (event) => {
9948
- event.preventDefault();
9949
- const formData = new FormData(event.currentTarget);
9950
- const nextErrors = handleValidate(formData);
9951
- const isValid = Object.keys(nextErrors).length === 0;
9952
- setErrors(nextErrors);
9953
- setHasSubmitted(true);
9954
- if (isValid && props.onSubmit) {
9955
- props.onSubmit(event);
9956
- }
9957
- if (isValid && action) {
9958
- void action(formData);
9959
- }
9960
- };
9961
- const handleReset = (event) => {
9962
- setErrors({});
9963
- setHasSubmitted(false);
9964
- if (props.onReset) {
9965
- props.onReset(event);
9966
- }
9967
- if (action) {
9968
- void action(null);
9969
- }
9970
- };
9971
- const context = (0, import_react41.useMemo)(() => {
9972
- return {
9973
- values,
9974
- errors,
9975
- hasSubmitted,
9976
- formId: id,
9977
- labelPosition
9978
- };
9979
- }, [labelPosition, values, errors, id, hasSubmitted]);
9980
- return (
9981
- // @ts-expect-error - generic context providers are a giant pain
9982
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
9983
- Stack,
9984
- {
9985
- ...props,
9986
- ref,
9987
- $fullWidth: fullWidth,
9988
- as: StyledForm,
9989
- gap: "space-05",
9990
- id,
9991
- onBlur: handleBlur2,
9992
- onReset: handleReset,
9993
- onSubmit: handleSubmit,
9994
- children
9995
- }
9996
- ) })
9997
- );
9998
- };
9999
- FormComponent.displayName = "Form";
10000
- var Form = (0, import_react41.forwardRef)(FormComponent);
10001
-
10002
10032
  // src/components/Form/useFormState.tsx
10003
10033
  var import_react42 = require("react");
10004
10034
  var useFormState = (action, initialData = {}) => {
@@ -10012,7 +10042,7 @@ var useFormState = (action, initialData = {}) => {
10012
10042
  setError(null);
10013
10043
  return;
10014
10044
  }
10015
- const nextData = Object.fromEntries(nextFormData.entries());
10045
+ const nextData = serializeFormData(nextFormData);
10016
10046
  setIsPending(true);
10017
10047
  try {
10018
10048
  const result = await action(data, nextData);
@@ -10037,7 +10067,7 @@ var useFormState = (action, initialData = {}) => {
10037
10067
 
10038
10068
  // src/components/Form/FormErrorSummary.tsx
10039
10069
  var import_react43 = require("react");
10040
- var import_type_guards33 = require("@wistia/type-guards");
10070
+ var import_type_guards34 = require("@wistia/type-guards");
10041
10071
  var import_jsx_runtime227 = require("react/jsx-runtime");
10042
10072
  var ErrorItem = ({ name, error, formId }) => {
10043
10073
  return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
@@ -10051,8 +10081,8 @@ var FormErrorSummary = ({ description }) => {
10051
10081
  }
10052
10082
  return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { ref, children: [
10053
10083
  /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("p", { children: description }),
10054
- /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards33.isNotUndefined)(error)).map(
10055
- ([name, error]) => (0, import_type_guards33.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
10084
+ /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards34.isNotUndefined)(error)).map(
10085
+ ([name, error]) => (0, import_type_guards34.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
10056
10086
  ErrorItem,
10057
10087
  {
10058
10088
  error: err,
@@ -10076,7 +10106,7 @@ var FormErrorSummary = ({ description }) => {
10076
10106
  // src/components/FormField/FormField.tsx
10077
10107
  var import_react44 = require("react");
10078
10108
  var import_styled_components53 = __toESM(require("styled-components"));
10079
- var import_type_guards34 = require("@wistia/type-guards");
10109
+ var import_type_guards35 = require("@wistia/type-guards");
10080
10110
 
10081
10111
  // src/components/Label/Label.tsx
10082
10112
  var import_styled_components52 = __toESM(require("styled-components"));
@@ -10179,7 +10209,7 @@ var StyledErrorList = import_styled_components53.default.ul`
10179
10209
  gap: var(--wui-space-01);
10180
10210
  `;
10181
10211
  var ErrorMessages = ({ errors, id }) => {
10182
- const isMultipleErrors = (0, import_type_guards34.isArray)(errors);
10212
+ const isMultipleErrors = (0, import_type_guards35.isArray)(errors);
10183
10213
  return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
10184
10214
  Text,
10185
10215
  {
@@ -10229,19 +10259,19 @@ var FormField = ({
10229
10259
  "aria-describedby": ariaDescribedby,
10230
10260
  ...props
10231
10261
  };
10232
- if ((0, import_type_guards34.isUndefined)(value) && (0, import_type_guards34.isNotUndefined)(defaultValue)) {
10262
+ if ((0, import_type_guards35.isUndefined)(value) && (0, import_type_guards35.isNotUndefined)(defaultValue)) {
10233
10263
  childProps = {
10234
10264
  ...childProps,
10235
10265
  defaultValue
10236
10266
  };
10237
10267
  }
10238
- if ((0, import_type_guards34.isNotNil)(checkboxGroup)) {
10239
- const computedName = (0, import_type_guards34.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
10268
+ if ((0, import_type_guards35.isNotNil)(checkboxGroup)) {
10269
+ const computedName = (0, import_type_guards35.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
10240
10270
  const handleChange = (event) => {
10241
- if ((0, import_type_guards34.isNotUndefined)(props.onChange)) {
10271
+ if ((0, import_type_guards35.isNotUndefined)(props.onChange)) {
10242
10272
  props.onChange(event);
10243
10273
  }
10244
- if ((0, import_type_guards34.isNotUndefined)(checkboxGroup.onChange)) {
10274
+ if ((0, import_type_guards35.isNotUndefined)(checkboxGroup.onChange)) {
10245
10275
  checkboxGroup.onChange(event);
10246
10276
  }
10247
10277
  };
@@ -10249,7 +10279,7 @@ var FormField = ({
10249
10279
  ...childProps,
10250
10280
  name: computedName,
10251
10281
  onChange: handleChange,
10252
- "aria-invalid": (0, import_type_guards34.isNotNil)(error)
10282
+ "aria-invalid": (0, import_type_guards35.isNotNil)(error)
10253
10283
  };
10254
10284
  }
10255
10285
  import_react44.Children.only(children);
@@ -10260,9 +10290,9 @@ var FormField = ({
10260
10290
  "data-label-position": labelPosition ?? formState.labelPosition,
10261
10291
  children: [
10262
10292
  !isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(Label, { htmlFor: computedId, children: label }),
10263
- (0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
10293
+ (0, import_type_guards35.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
10264
10294
  (0, import_react44.cloneElement)(children, childProps),
10265
- (0, import_type_guards34.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)(import_jsx_runtime229.Fragment, { children: [
10295
+ (0, import_type_guards35.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)(import_jsx_runtime229.Fragment, { children: [
10266
10296
  /* @__PURE__ */ (0, import_jsx_runtime229.jsx)("div", {}),
10267
10297
  /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
10268
10298
  ErrorMessages,
@@ -10292,12 +10322,15 @@ var RadioGroup = ({
10292
10322
  value,
10293
10323
  ...props
10294
10324
  }) => {
10325
+ const formState = (0, import_react45.useContext)(FormContext);
10326
+ const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
10295
10327
  const context = (0, import_react45.useMemo)(() => {
10296
10328
  return {
10297
10329
  name,
10298
- onChange
10330
+ onChange,
10331
+ value: derivedValue
10299
10332
  };
10300
- }, [name, onChange]);
10333
+ }, [name, derivedValue, onChange]);
10301
10334
  return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(FormGroup, { ...props, children }) });
10302
10335
  };
10303
10336
  RadioGroup.displayName = "RadioGroup";
@@ -10343,7 +10376,7 @@ IconButton.displayName = "IconButton";
10343
10376
  // src/components/InputClickToCopy/InputClickToCopy.tsx
10344
10377
  var import_styled_components55 = __toESM(require("styled-components"));
10345
10378
  var import_react47 = require("react");
10346
- var import_type_guards35 = require("@wistia/type-guards");
10379
+ var import_type_guards36 = require("@wistia/type-guards");
10347
10380
  var import_jsx_runtime232 = require("react/jsx-runtime");
10348
10381
  var StyledInput2 = (0, import_styled_components55.default)(Input)`
10349
10382
  &:not([aria-disabled='true']) {
@@ -10371,12 +10404,12 @@ var InputClickToCopy = (0, import_react47.forwardRef)(
10371
10404
  }, [isCopied]);
10372
10405
  const handleClick = (event) => {
10373
10406
  event.preventDefault();
10374
- if ((0, import_type_guards35.isFunction)(props.onClick)) {
10407
+ if ((0, import_type_guards36.isFunction)(props.onClick)) {
10375
10408
  props.onClick(event);
10376
10409
  }
10377
10410
  void copyToClipboard(value).then(() => {
10378
10411
  setIsCopied(true);
10379
- if ((0, import_type_guards35.isFunction)(onCopy)) {
10412
+ if ((0, import_type_guards36.isFunction)(onCopy)) {
10380
10413
  onCopy(value);
10381
10414
  }
10382
10415
  return value;
@@ -10406,7 +10439,7 @@ InputClickToCopy.displayName = "InputClickToCopy";
10406
10439
 
10407
10440
  // src/components/KeyboardShortcut/KeyboardShortcut.tsx
10408
10441
  var import_styled_components56 = __toESM(require("styled-components"));
10409
- var import_type_guards36 = require("@wistia/type-guards");
10442
+ var import_type_guards37 = require("@wistia/type-guards");
10410
10443
  var import_jsx_runtime233 = require("react/jsx-runtime");
10411
10444
  var StyledKeyboardShortcut = import_styled_components56.default.div`
10412
10445
  align-items: center;
@@ -10500,7 +10533,7 @@ var KeyboardShortcut = ({
10500
10533
  $fullWidth: fullWidth,
10501
10534
  ...otherProps,
10502
10535
  children: [
10503
- (0, import_type_guards36.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Label2, { children: label }),
10536
+ (0, import_type_guards37.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Label2, { children: label }),
10504
10537
  /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
10505
10538
  StyledKey,
10506
10539
  {
@@ -10516,7 +10549,7 @@ KeyboardShortcut.displayName = "KeyboardShortcut";
10516
10549
  // src/components/Menu/Menu.tsx
10517
10550
  var import_styled_components57 = __toESM(require("styled-components"));
10518
10551
  var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
10519
- var import_type_guards37 = require("@wistia/type-guards");
10552
+ var import_type_guards38 = require("@wistia/type-guards");
10520
10553
  var import_react49 = require("react");
10521
10554
 
10522
10555
  // src/components/Menu/MenuContext.tsx
@@ -10628,7 +10661,7 @@ var Menu = ({
10628
10661
  }) => {
10629
10662
  const contextValue = (0, import_react49.useMemo)(() => ({ compact }), [compact]);
10630
10663
  let controlProps = {
10631
- ...(0, import_type_guards37.isNotNil)(onOpenChange) && (0, import_type_guards37.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
10664
+ ...(0, import_type_guards38.isNotNil)(onOpenChange) && (0, import_type_guards38.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
10632
10665
  };
10633
10666
  if (disabled) {
10634
10667
  controlProps = {
@@ -10642,7 +10675,7 @@ var Menu = ({
10642
10675
  modal: false,
10643
10676
  ...controlProps,
10644
10677
  children: [
10645
- /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards37.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
10678
+ /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards38.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
10646
10679
  Button,
10647
10680
  {
10648
10681
  "aria-expanded": isOpen,
@@ -10704,12 +10737,12 @@ MenuLabel.displayName = "MenuLabel";
10704
10737
  var import_react51 = require("react");
10705
10738
  var import_styled_components61 = __toESM(require("styled-components"));
10706
10739
  var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
10707
- var import_type_guards39 = require("@wistia/type-guards");
10740
+ var import_type_guards40 = require("@wistia/type-guards");
10708
10741
 
10709
10742
  // src/components/Menu/MenuItemButton.tsx
10710
10743
  var import_react50 = require("react");
10711
10744
  var import_styled_components59 = __toESM(require("styled-components"));
10712
- var import_type_guards38 = require("@wistia/type-guards");
10745
+ var import_type_guards39 = require("@wistia/type-guards");
10713
10746
  var import_jsx_runtime236 = require("react/jsx-runtime");
10714
10747
  var StyledButton3 = (0, import_styled_components59.default)(Button)`
10715
10748
  ${({ colorScheme }) => getColorScheme(colorScheme)};
@@ -10787,7 +10820,7 @@ var StyledBadgeContainer = import_styled_components59.default.div`
10787
10820
  var MenuItemButton = (0, import_react50.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
10788
10821
  let { colorScheme, badge } = props;
10789
10822
  if (appearance === "dangerous") {
10790
- if ((0, import_type_guards38.isNotUndefined)(colorScheme)) {
10823
+ if ((0, import_type_guards39.isNotUndefined)(colorScheme)) {
10791
10824
  console.warn("colorScheme prop is ignored when appearance is dangerous");
10792
10825
  }
10793
10826
  colorScheme = "error";
@@ -10817,7 +10850,7 @@ var MenuItemButton = (0, import_react50.forwardRef)(({ children, appearance, com
10817
10850
  children: [
10818
10851
  props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
10819
10852
  /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(StyledLabelAndDescriptionContainer, { children }),
10820
- (0, import_type_guards38.isNotNil)(badge) || (0, import_type_guards38.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
10853
+ (0, import_type_guards39.isNotNil)(badge) || (0, import_type_guards39.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
10821
10854
  props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
10822
10855
  ]
10823
10856
  }
@@ -10889,7 +10922,7 @@ var SubMenu = ({
10889
10922
  return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
10890
10923
  /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(SubMenuTrigger, { ...props, children: [
10891
10924
  /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(MenuItemLabel, { children: label }),
10892
- (0, import_type_guards39.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(MenuItemDescription, { children: description }) : null
10925
+ (0, import_type_guards40.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(MenuItemDescription, { children: description }) : null
10893
10926
  ] }),
10894
10927
  /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(SubMenuContent, { $compact: compact, children }) })
10895
10928
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
@@ -10981,7 +11014,7 @@ RadioMenuItem.displayName = "RadioMenuItem";
10981
11014
 
10982
11015
  // src/components/Menu/CheckboxMenuItem.tsx
10983
11016
  var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
10984
- var import_type_guards40 = require("@wistia/type-guards");
11017
+ var import_type_guards41 = require("@wistia/type-guards");
10985
11018
  var import_jsx_runtime242 = require("react/jsx-runtime");
10986
11019
  var CheckboxIndicator = ({ checked, ...props }) => {
10987
11020
  return checked ? /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)(
@@ -11055,8 +11088,8 @@ var CheckboxMenuItem = ({
11055
11088
  MenuItemButton,
11056
11089
  {
11057
11090
  ...props,
11058
- leftIcon: (0, import_type_guards40.isNotNil)(props.icon) ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(CheckboxIndicator, { checked }),
11059
- rightIcon: (0, import_type_guards40.isNotNil)(props.icon) ? /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(import_react_dropdown_menu7.DropdownMenuItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(Icon, { type: "checkmark" }) }) : void 0
11091
+ leftIcon: (0, import_type_guards41.isNotNil)(props.icon) ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(CheckboxIndicator, { checked }),
11092
+ rightIcon: (0, import_type_guards41.isNotNil)(props.icon) ? /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(import_react_dropdown_menu7.DropdownMenuItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(Icon, { type: "checkmark" }) }) : void 0
11060
11093
  }
11061
11094
  )
11062
11095
  }
@@ -11068,7 +11101,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
11068
11101
  var import_react56 = require("react");
11069
11102
  var import_styled_components66 = __toESM(require("styled-components"));
11070
11103
  var import_react_dialog4 = require("@radix-ui/react-dialog");
11071
- var import_type_guards42 = require("@wistia/type-guards");
11104
+ var import_type_guards43 = require("@wistia/type-guards");
11072
11105
 
11073
11106
  // src/components/Modal/ModalHeader.tsx
11074
11107
  var import_styled_components63 = __toESM(require("styled-components"));
@@ -11131,7 +11164,7 @@ var import_react_dialog3 = require("@radix-ui/react-dialog");
11131
11164
 
11132
11165
  // src/private/hooks/useFocusRestore/useFocusRestore.ts
11133
11166
  var import_react53 = require("react");
11134
- var import_type_guards41 = require("@wistia/type-guards");
11167
+ var import_type_guards42 = require("@wistia/type-guards");
11135
11168
  var useFocusRestore = () => {
11136
11169
  const previouslyFocusedRef = (0, import_react53.useRef)(null);
11137
11170
  (0, import_react53.useEffect)(() => {
@@ -11139,7 +11172,7 @@ var useFocusRestore = () => {
11139
11172
  }, []);
11140
11173
  (0, import_react53.useEffect)(() => {
11141
11174
  return () => {
11142
- if ((0, import_type_guards41.isNotNil)(previouslyFocusedRef.current)) {
11175
+ if ((0, import_type_guards42.isNotNil)(previouslyFocusedRef.current)) {
11143
11176
  setTimeout(() => {
11144
11177
  previouslyFocusedRef.current?.focus();
11145
11178
  }, 0);
@@ -11330,7 +11363,7 @@ var Modal = (0, import_react56.forwardRef)(
11330
11363
  import_react_dialog4.Root,
11331
11364
  {
11332
11365
  onOpenChange: (open2) => {
11333
- if (!open2 && (0, import_type_guards42.isNotNil)(onRequestClose)) {
11366
+ if (!open2 && (0, import_type_guards43.isNotNil)(onRequestClose)) {
11334
11367
  onRequestClose();
11335
11368
  }
11336
11369
  },
@@ -11345,7 +11378,7 @@ var Modal = (0, import_react56.forwardRef)(
11345
11378
  alignVertical,
11346
11379
  fullHeight,
11347
11380
  onOpenAutoFocus: (event) => {
11348
- if ((0, import_type_guards42.isNotNil)(initialFocusRef) && initialFocusRef.current) {
11381
+ if ((0, import_type_guards43.isNotNil)(initialFocusRef) && initialFocusRef.current) {
11349
11382
  event.preventDefault();
11350
11383
  requestAnimationFrame(() => {
11351
11384
  initialFocusRef.current?.focus();
@@ -11379,9 +11412,9 @@ var import_react_popover2 = require("@radix-ui/react-popover");
11379
11412
  var import_styled_components68 = __toESM(require("styled-components"));
11380
11413
 
11381
11414
  // src/private/helpers/getControls/getControlProps.tsx
11382
- var import_type_guards43 = require("@wistia/type-guards");
11415
+ var import_type_guards44 = require("@wistia/type-guards");
11383
11416
  var getControlProps = (isOpen, onOpenChange) => {
11384
- return (0, import_type_guards43.isNotNil)(onOpenChange) && (0, import_type_guards43.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
11417
+ return (0, import_type_guards44.isNotNil)(onOpenChange) && (0, import_type_guards44.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
11385
11418
  };
11386
11419
 
11387
11420
  // src/components/Popover/PopoverArrow.tsx
@@ -11536,7 +11569,7 @@ Popover.displayName = "Popover";
11536
11569
  // src/components/ProgressBar/ProgressBar.tsx
11537
11570
  var import_styled_components69 = __toESM(require("styled-components"));
11538
11571
  var import_react_progress = require("@radix-ui/react-progress");
11539
- var import_type_guards44 = require("@wistia/type-guards");
11572
+ var import_type_guards45 = require("@wistia/type-guards");
11540
11573
  var import_jsx_runtime250 = require("react/jsx-runtime");
11541
11574
  var ProgressBarWrapper = import_styled_components69.default.div`
11542
11575
  --progress-bar-height: 8px;
@@ -11591,7 +11624,7 @@ var ProgressBar = ({
11591
11624
  ...props
11592
11625
  }) => {
11593
11626
  return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(ProgressBarWrapper, { children: [
11594
- (0, import_type_guards44.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
11627
+ (0, import_type_guards45.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
11595
11628
  /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(
11596
11629
  StyledProgressBar,
11597
11630
  {
@@ -11607,7 +11640,7 @@ var ProgressBar = ({
11607
11640
  )
11608
11641
  }
11609
11642
  ),
11610
- (0, import_type_guards44.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(ProgressBarLabel, { children: labelRight }) : null
11643
+ (0, import_type_guards45.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(ProgressBarLabel, { children: labelRight }) : null
11611
11644
  ] });
11612
11645
  };
11613
11646
  ProgressBar.displayName = "ProgressBar";
@@ -11615,7 +11648,7 @@ ProgressBar.displayName = "ProgressBar";
11615
11648
  // src/components/Radio/Radio.tsx
11616
11649
  var import_react57 = require("react");
11617
11650
  var import_styled_components70 = __toESM(require("styled-components"));
11618
- var import_type_guards45 = require("@wistia/type-guards");
11651
+ var import_type_guards46 = require("@wistia/type-guards");
11619
11652
  var import_jsx_runtime251 = require("react/jsx-runtime");
11620
11653
  var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
11621
11654
  "svg",
@@ -11732,12 +11765,14 @@ var Radio = (0, import_react57.forwardRef)(
11732
11765
  ...props
11733
11766
  }, ref) => {
11734
11767
  const generatedId = (0, import_react57.useId)();
11735
- const computedId = (0, import_type_guards45.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
11768
+ const computedId = (0, import_type_guards46.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
11736
11769
  const radioGroupContext = useRadioGroup();
11737
11770
  const contextName = radioGroupContext?.name;
11738
11771
  const contextOnChange = radioGroupContext?.onChange;
11772
+ const contextValue = radioGroupContext?.value;
11739
11773
  const radioName = name ?? contextName;
11740
11774
  const handleOnChange = onChange ?? contextOnChange;
11775
+ const defaultChecked = contextValue === value;
11741
11776
  return /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
11742
11777
  StyledRadioWrapper,
11743
11778
  {
@@ -11756,7 +11791,8 @@ var Radio = (0, import_react57.forwardRef)(
11756
11791
  onChange: handleOnChange,
11757
11792
  required,
11758
11793
  type: "radio",
11759
- value
11794
+ value,
11795
+ ...(0, import_type_guards46.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked }
11760
11796
  }
11761
11797
  ),
11762
11798
  /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
@@ -11789,7 +11825,7 @@ Radio.displayName = "Radio";
11789
11825
  var import_react60 = require("react");
11790
11826
  var import_styled_components72 = __toESM(require("styled-components"));
11791
11827
  var import_react_toggle_group = require("@radix-ui/react-toggle-group");
11792
- var import_type_guards46 = require("@wistia/type-guards");
11828
+ var import_type_guards47 = require("@wistia/type-guards");
11793
11829
 
11794
11830
  // src/components/SegmentedControl/useSelectedItemStyle.tsx
11795
11831
  var import_react58 = require("react");
@@ -11889,7 +11925,7 @@ var SegmentedControl = (0, import_react60.forwardRef)(
11889
11925
  onSelectedValueChange,
11890
11926
  ...props
11891
11927
  }, ref) => {
11892
- if ((0, import_type_guards46.isNil)(children)) {
11928
+ if ((0, import_type_guards47.isNil)(children)) {
11893
11929
  return null;
11894
11930
  }
11895
11931
  return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
@@ -11918,7 +11954,7 @@ SegmentedControl.displayName = "SegmentedControl";
11918
11954
  var import_react61 = require("react");
11919
11955
  var import_styled_components73 = __toESM(require("styled-components"));
11920
11956
  var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
11921
- var import_type_guards47 = require("@wistia/type-guards");
11957
+ var import_type_guards48 = require("@wistia/type-guards");
11922
11958
  var import_jsx_runtime255 = require("react/jsx-runtime");
11923
11959
  var segmentedControlItemStyles = import_styled_components73.css`
11924
11960
  all: unset; /* ToggleGroupItem is a button element */
@@ -12026,8 +12062,8 @@ var SegmentedControlItem = (0, import_react61.forwardRef)(
12026
12062
  {
12027
12063
  ref: combinedRef,
12028
12064
  ...otherProps,
12029
- $hasLabel: (0, import_type_guards47.isNotNil)(label),
12030
- "aria-label": (0, import_type_guards47.isNotNil)(label) ? void 0 : ariaLabel,
12065
+ $hasLabel: (0, import_type_guards48.isNotNil)(label),
12066
+ "aria-label": (0, import_type_guards48.isNotNil)(label) ? void 0 : ariaLabel,
12031
12067
  disabled,
12032
12068
  onClick: handleClick,
12033
12069
  value,
@@ -12159,7 +12195,7 @@ Select.displayName = "Select";
12159
12195
  var import_react_select2 = require("@radix-ui/react-select");
12160
12196
  var import_react63 = require("react");
12161
12197
  var import_styled_components75 = __toESM(require("styled-components"));
12162
- var import_type_guards48 = require("@wistia/type-guards");
12198
+ var import_type_guards49 = require("@wistia/type-guards");
12163
12199
  var import_jsx_runtime257 = require("react/jsx-runtime");
12164
12200
  var StyledItem = (0, import_styled_components75.default)(import_react_select2.Item)`
12165
12201
  ${variantStyleMap2.body3};
@@ -12203,7 +12239,7 @@ var SelectOption = (0, import_react63.forwardRef)(
12203
12239
  type: "checkmark"
12204
12240
  }
12205
12241
  ) }) }),
12206
- (0, import_type_guards48.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)("div", { children: [
12242
+ (0, import_type_guards49.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)("div", { children: [
12207
12243
  children,
12208
12244
  /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
12209
12245
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_react_select2.ItemText, { children })
@@ -12238,7 +12274,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
12238
12274
  // src/components/Switch/Switch.tsx
12239
12275
  var import_react64 = require("react");
12240
12276
  var import_styled_components77 = __toESM(require("styled-components"));
12241
- var import_type_guards49 = require("@wistia/type-guards");
12277
+ var import_type_guards50 = require("@wistia/type-guards");
12242
12278
  var import_jsx_runtime259 = require("react/jsx-runtime");
12243
12279
  var sizeSmall3 = import_styled_components77.css`
12244
12280
  --wui-size-small-width: 24px;
@@ -12357,7 +12393,7 @@ var Switch = (0, import_react64.forwardRef)(
12357
12393
  ...props
12358
12394
  }, ref) => {
12359
12395
  const generatedId = (0, import_react64.useId)();
12360
- const computedId = (0, import_type_guards49.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
12396
+ const computedId = (0, import_type_guards50.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
12361
12397
  return /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
12362
12398
  /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
12363
12399
  StyledHiddenSwitchInput,
@@ -12512,7 +12548,7 @@ var TableRow = ({ children, ...props }) => {
12512
12548
  // src/components/Tabs/Tabs.tsx
12513
12549
  var import_react_tabs = require("@radix-ui/react-tabs");
12514
12550
  var import_react68 = require("react");
12515
- var import_type_guards50 = require("@wistia/type-guards");
12551
+ var import_type_guards51 = require("@wistia/type-guards");
12516
12552
 
12517
12553
  // src/components/Tabs/useTabsValue.tsx
12518
12554
  var import_react67 = require("react");
@@ -12549,10 +12585,10 @@ var Tabs = ({
12549
12585
  ...props,
12550
12586
  onValueChange
12551
12587
  };
12552
- if ((0, import_type_guards50.isNotNil)(value)) {
12588
+ if ((0, import_type_guards51.isNotNil)(value)) {
12553
12589
  rootProps.value = value;
12554
12590
  }
12555
- if ((0, import_type_guards50.isNotNil)(defaultValue)) {
12591
+ if ((0, import_type_guards51.isNotNil)(defaultValue)) {
12556
12592
  rootProps.defaultValue = defaultValue;
12557
12593
  }
12558
12594
  return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(import_react_tabs.Root, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(SelectedItemStyleProvider, { children }) }) });
@@ -12612,7 +12648,7 @@ TabsList.displayName = "TabsList";
12612
12648
 
12613
12649
  // src/components/Tabs/TabsTrigger.tsx
12614
12650
  var import_react69 = require("react");
12615
- var import_type_guards51 = require("@wistia/type-guards");
12651
+ var import_type_guards52 = require("@wistia/type-guards");
12616
12652
 
12617
12653
  // src/components/Tabs/StyledRadixTabsTrigger.tsx
12618
12654
  var import_styled_components86 = __toESM(require("styled-components"));
@@ -12663,8 +12699,8 @@ var TabsTrigger = (0, import_react69.forwardRef)(
12663
12699
  {
12664
12700
  ...otherProps,
12665
12701
  ref: combinedRef,
12666
- $hasLabel: (0, import_type_guards51.isNotNil)(label),
12667
- "aria-label": (0, import_type_guards51.isNotNil)(label) ? void 0 : ariaLabel,
12702
+ $hasLabel: (0, import_type_guards52.isNotNil)(label),
12703
+ "aria-label": (0, import_type_guards52.isNotNil)(label) ? void 0 : ariaLabel,
12668
12704
  disabled,
12669
12705
  value,
12670
12706
  children: [
@@ -12680,7 +12716,7 @@ TabsTrigger.displayName = "TabsTrigger";
12680
12716
  // src/components/Tag/Tag.tsx
12681
12717
  var import_react70 = require("react");
12682
12718
  var import_styled_components87 = __toESM(require("styled-components"));
12683
- var import_type_guards52 = require("@wistia/type-guards");
12719
+ var import_type_guards53 = require("@wistia/type-guards");
12684
12720
  var import_jsx_runtime271 = require("react/jsx-runtime");
12685
12721
  var TagLabel = import_styled_components87.default.a`
12686
12722
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
@@ -12765,10 +12801,10 @@ var StyledTag = import_styled_components87.default.div`
12765
12801
  }
12766
12802
  `;
12767
12803
  var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
12768
- if ((0, import_type_guards52.isNil)(onClickRemove)) {
12804
+ if ((0, import_type_guards53.isNil)(onClickRemove)) {
12769
12805
  return null;
12770
12806
  }
12771
- if ((0, import_type_guards52.isNil)(onClickRemoveLabel)) {
12807
+ if ((0, import_type_guards53.isNil)(onClickRemoveLabel)) {
12772
12808
  throw new Error(
12773
12809
  "for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
12774
12810
  );
@@ -12797,8 +12833,8 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
12797
12833
  };
12798
12834
  var Tag = (0, import_react70.forwardRef)(
12799
12835
  ({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
12800
- const hasIcon = (0, import_type_guards52.isNotNil)(icon);
12801
- const labelProps = (0, import_type_guards52.isNotNil)(href) && (0, import_type_guards52.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
12836
+ const hasIcon = (0, import_type_guards53.isNotNil)(icon);
12837
+ const labelProps = (0, import_type_guards53.isNotNil)(href) && (0, import_type_guards53.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
12802
12838
  return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(
12803
12839
  StyledTag,
12804
12840
  {
@@ -12834,7 +12870,7 @@ Tag.displayName = "Tag";
12834
12870
 
12835
12871
  // src/components/Thumbnail/ThumbnailBadge.tsx
12836
12872
  var import_styled_components88 = __toESM(require("styled-components"));
12837
- var import_type_guards53 = require("@wistia/type-guards");
12873
+ var import_type_guards54 = require("@wistia/type-guards");
12838
12874
  var import_jsx_runtime272 = require("react/jsx-runtime");
12839
12875
  var StyledThumbnailBadge = import_styled_components88.default.div`
12840
12876
  align-items: center;
@@ -12862,7 +12898,7 @@ var StyledThumbnailBadge = import_styled_components88.default.div`
12862
12898
  `;
12863
12899
  var ThumbnailBadge = ({ icon, label, ...props }) => {
12864
12900
  return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(StyledThumbnailBadge, { ...props, children: [
12865
- (0, import_type_guards53.isNotNil)(icon) && icon,
12901
+ (0, import_type_guards54.isNotNil)(icon) && icon,
12866
12902
  /* @__PURE__ */ (0, import_jsx_runtime272.jsx)("span", { children: label })
12867
12903
  ] });
12868
12904
  };
@@ -12871,10 +12907,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
12871
12907
  // src/components/Thumbnail/Thumbnail.tsx
12872
12908
  var import_react71 = require("react");
12873
12909
  var import_styled_components91 = __toESM(require("styled-components"));
12874
- var import_type_guards56 = require("@wistia/type-guards");
12910
+ var import_type_guards57 = require("@wistia/type-guards");
12875
12911
 
12876
12912
  // src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
12877
- var import_type_guards54 = require("@wistia/type-guards");
12913
+ var import_type_guards55 = require("@wistia/type-guards");
12878
12914
  var import_styled_components89 = require("styled-components");
12879
12915
  var gradients = {
12880
12916
  defaultDarkOne: import_styled_components89.css`
@@ -13002,12 +13038,12 @@ var gradients = {
13002
13038
  };
13003
13039
  var gradientMap = Object.keys(gradients);
13004
13040
  var getBackgroundGradient = (gradientName = void 0) => {
13005
- return (0, import_type_guards54.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
13041
+ return (0, import_type_guards55.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
13006
13042
  };
13007
13043
 
13008
13044
  // src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
13009
13045
  var import_styled_components90 = __toESM(require("styled-components"));
13010
- var import_type_guards55 = require("@wistia/type-guards");
13046
+ var import_type_guards56 = require("@wistia/type-guards");
13011
13047
  var import_jsx_runtime273 = require("react/jsx-runtime");
13012
13048
  var ScrubLine = import_styled_components90.default.div`
13013
13049
  position: absolute;
@@ -13093,8 +13129,8 @@ var ThumbnailStoryboardViewer = ({
13093
13129
  );
13094
13130
  const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
13095
13131
  const backgroundImage = `url(${storyboardUrl})`;
13096
- const showScrubLine = (0, import_type_guards55.isNotNil)(cursorPosition);
13097
- const scrubLinePosition = (0, import_type_guards55.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
13132
+ const showScrubLine = (0, import_type_guards56.isNotNil)(cursorPosition);
13133
+ const scrubLinePosition = (0, import_type_guards56.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
13098
13134
  const viewerStyles = {
13099
13135
  position: "relative",
13100
13136
  overflow: "hidden",
@@ -13164,10 +13200,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
13164
13200
  );
13165
13201
  };
13166
13202
  var StyledThumbnail = import_styled_components91.default.div`
13167
- background-image: ${({ $backgroundUrl }) => (0, import_type_guards56.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
13203
+ background-image: ${({ $backgroundUrl }) => (0, import_type_guards57.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
13168
13204
  ${({ $backgroundUrl, $gradientBackground }) => (
13169
13205
  // if we don't have $backgroundUrl show a gradient
13170
- (0, import_type_guards56.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
13206
+ (0, import_type_guards57.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
13171
13207
  )};
13172
13208
  background-position: center center;
13173
13209
  background-size: cover;
@@ -13209,10 +13245,10 @@ var Thumbnail = (0, import_react71.forwardRef)(
13209
13245
  const storyboardElementRef = (0, import_react71.useRef)(null);
13210
13246
  const [cursorPosition, setCursorPosition] = (0, import_react71.useState)(null);
13211
13247
  const backgroundUrl = (0, import_react71.useMemo)(
13212
- () => thumbnailImageType === "square" && (0, import_type_guards56.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
13248
+ () => thumbnailImageType === "square" && (0, import_type_guards57.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
13213
13249
  [thumbnailImageType, thumbnailUrl]
13214
13250
  );
13215
- const isScrubbable = (0, import_type_guards56.isNotNil)(storyboard);
13251
+ const isScrubbable = (0, import_type_guards57.isNotNil)(storyboard);
13216
13252
  const trackStoryboardLoadStatus = (0, import_react71.useCallback)(() => {
13217
13253
  if (storyboardElementRef.current || !storyboard) {
13218
13254
  return storyboardElementRef.current;
@@ -13245,7 +13281,7 @@ var Thumbnail = (0, import_react71.forwardRef)(
13245
13281
  return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
13246
13282
  }, [isScrubbable, isMouseOver, isStoryboardReady]);
13247
13283
  const renderStoryboard = (0, import_react71.useCallback)(() => {
13248
- if (!storyboard || (0, import_type_guards56.isUndefined)(height) || (0, import_type_guards56.isEmptyString)(height)) return null;
13284
+ if (!storyboard || (0, import_type_guards57.isUndefined)(height) || (0, import_type_guards57.isEmptyString)(height)) return null;
13249
13285
  const {
13250
13286
  url,
13251
13287
  width: sbWidth,
@@ -13255,7 +13291,7 @@ var Thumbnail = (0, import_react71.forwardRef)(
13255
13291
  frameCount,
13256
13292
  aspectRatio
13257
13293
  } = storyboard;
13258
- const targetWidth = (0, import_type_guards56.isString)(width) ? parseInt(width, 10) : Number(width);
13294
+ const targetWidth = (0, import_type_guards57.isString)(width) ? parseInt(width, 10) : Number(width);
13259
13295
  const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
13260
13296
  return /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(
13261
13297
  ThumbnailStoryboardViewer,
@@ -13276,7 +13312,7 @@ var Thumbnail = (0, import_react71.forwardRef)(
13276
13312
  let thumbnailContent = null;
13277
13313
  if (shouldRenderStoryboard) {
13278
13314
  thumbnailContent = renderStoryboard();
13279
- } else if ((0, import_type_guards56.isNotNil)(thumbnailUrl)) {
13315
+ } else if ((0, import_type_guards57.isNotNil)(thumbnailUrl)) {
13280
13316
  thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(
13281
13317
  ThumbnailImage,
13282
13318
  {
@@ -13301,7 +13337,7 @@ var Thumbnail = (0, import_react71.forwardRef)(
13301
13337
  onMouseOut: handleMouseOut,
13302
13338
  role: "presentation",
13303
13339
  children: [
13304
- (0, import_type_guards56.isNotNil)(children) ? children : null,
13340
+ (0, import_type_guards57.isNotNil)(children) ? children : null,
13305
13341
  thumbnailContent
13306
13342
  ]
13307
13343
  }
@@ -13313,7 +13349,7 @@ Thumbnail.displayName = "Thumbnail";
13313
13349
  // src/components/ThumbnailCollage/ThumbnailCollage.tsx
13314
13350
  var import_react72 = __toESM(require("react"));
13315
13351
  var import_styled_components92 = __toESM(require("styled-components"));
13316
- var import_type_guards57 = require("@wistia/type-guards");
13352
+ var import_type_guards58 = require("@wistia/type-guards");
13317
13353
  var import_jsx_runtime275 = (
13318
13354
  // ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
13319
13355
  require("react/jsx-runtime")
@@ -13393,7 +13429,7 @@ var ThumbnailCollage = ({
13393
13429
  }) => {
13394
13430
  const thumbnailArray = import_react72.default.Children.toArray(children);
13395
13431
  const truncatedThumbnails = thumbnailArray.slice(0, 3);
13396
- const thumbnails = (0, import_type_guards57.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
13432
+ const thumbnails = (0, import_type_guards58.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
13397
13433
  return import_react72.default.cloneElement(child, {
13398
13434
  ...child.props,
13399
13435
  children: void 0
@@ -13421,7 +13457,7 @@ var ThumbnailCollage = ({
13421
13457
 
13422
13458
  // src/components/WistiaLogo/WistiaLogo.tsx
13423
13459
  var import_styled_components93 = __toESM(require("styled-components"));
13424
- var import_type_guards58 = require("@wistia/type-guards");
13460
+ var import_type_guards59 = require("@wistia/type-guards");
13425
13461
  var import_jsx_runtime276 = require("react/jsx-runtime");
13426
13462
  var renderBrandmark = (brandmarkColor, iconOnly) => {
13427
13463
  if (iconOnly) {
@@ -13534,7 +13570,7 @@ var WistiaLogo = ({
13534
13570
  ...props,
13535
13571
  children: [
13536
13572
  /* @__PURE__ */ (0, import_jsx_runtime276.jsx)("title", { children: title }),
13537
- (0, import_type_guards58.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime276.jsx)("desc", { children: description }) : null,
13573
+ (0, import_type_guards59.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime276.jsx)("desc", { children: description }) : null,
13538
13574
  renderBrandmark(brandmarkColor, iconOnly),
13539
13575
  renderLogotype(logotypeColor, iconOnly)
13540
13576
  ]
@@ -13545,18 +13581,18 @@ var WistiaLogo = ({
13545
13581
  WistiaLogo.displayName = "WistiaLogo";
13546
13582
 
13547
13583
  // src/components/List/List.tsx
13548
- var import_type_guards60 = require("@wistia/type-guards");
13584
+ var import_type_guards61 = require("@wistia/type-guards");
13549
13585
  var import_styled_components95 = __toESM(require("styled-components"));
13550
13586
 
13551
13587
  // src/components/List/ListItem.tsx
13552
13588
  var import_styled_components94 = __toESM(require("styled-components"));
13553
- var import_type_guards59 = require("@wistia/type-guards");
13589
+ var import_type_guards60 = require("@wistia/type-guards");
13554
13590
  var import_jsx_runtime277 = require("react/jsx-runtime");
13555
13591
  var ListItemComponent = import_styled_components94.default.li`
13556
13592
  margin-bottom: var(--wui-space-02);
13557
13593
  `;
13558
13594
  var ListItem = ({ children }) => {
13559
- if ((0, import_type_guards59.isNil)(children)) {
13595
+ if ((0, import_type_guards60.isNil)(children)) {
13560
13596
  return null;
13561
13597
  }
13562
13598
  return /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(ListItemComponent, { children });
@@ -13686,13 +13722,13 @@ var List = ({
13686
13722
  ...otherProps
13687
13723
  }) => {
13688
13724
  const listVariant = variant ?? "bullets";
13689
- if ((0, import_type_guards60.isNotNil)(children)) {
13725
+ if ((0, import_type_guards61.isNotNil)(children)) {
13690
13726
  if (Array.isArray(children) && !children.length) {
13691
13727
  return null;
13692
13728
  }
13693
13729
  return renderListComponent(children, listVariant, otherProps);
13694
13730
  }
13695
- if ((0, import_type_guards60.isNotNil)(items)) {
13731
+ if ((0, import_type_guards61.isNotNil)(items)) {
13696
13732
  if (!items.length) {
13697
13733
  return null;
13698
13734
  }