@wistia/ui 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.0.20
3
+ * @license @wistia/ui v0.0.22
4
4
  *
5
5
  * Copyright (c) 2024-2024, Wistia, Inc. and its affiliates.
6
6
  *
@@ -1112,7 +1112,7 @@ var colorAliasTokens = css4`
1112
1112
 
1113
1113
  /* --- Misc --- */
1114
1114
  --wui-color-bg-fill-white: #ffffff;
1115
- --wui-color-bg-nav: var(--wui-blue-600);
1115
+ --wui-color-bg-nav: #1f3399;
1116
1116
  --wui-color-focus-color: var(--wui-blue-9);
1117
1117
  --wui-color-notification-pill-color: var(--wui-pink-9);
1118
1118
  --wui-color-overlay: var(--wui-gray-alpha-9);
@@ -3284,11 +3284,8 @@ var FavoriteOutlineIcon = (props) => /* @__PURE__ */ jsx66(
3284
3284
  children: /* @__PURE__ */ jsx66(
3285
3285
  "path",
3286
3286
  {
3287
- d: "M12 2.33321L14.9866 8.38519L21.6666 9.35586L16.8333 14.0678L17.9746 20.7198L12 17.5798L6.02532 20.7198L7.16665 14.0678L2.33333 9.35586L9.01331 8.38519L12 2.33321Z",
3288
- stroke: "#64646A",
3289
- strokeLinecap: "round",
3290
- strokeLinejoin: "round",
3291
- strokeWidth: "1.99999"
3287
+ d: "M12 1.33321C12.3806 1.33321 12.7283 1.54931 12.8967 1.89066L15.6507 7.47119L21.8104 8.36625C22.1871 8.42098 22.5 8.68481 22.6177 9.0468C22.7353 9.4088 22.6372 9.80619 22.3647 10.0719L17.9078 14.4169L18.9602 20.5507C19.0246 20.9259 18.8704 21.305 18.5625 21.5288C18.2546 21.7525 17.8463 21.7821 17.5094 21.605L12 18.7095L6.49053 21.605C6.1536 21.7821 5.74536 21.7525 5.43745 21.5288C5.12954 21.305 4.97535 20.9259 5.03972 20.5507L6.09215 14.4169L1.63526 10.0719C1.36272 9.80619 1.26465 9.4088 1.38228 9.0468C1.49991 8.68481 1.81285 8.42098 2.18953 8.36625L8.34923 7.47119L11.1032 1.89066C11.2717 1.54931 11.6193 1.33321 12 1.33321ZM12 4.59286L9.91005 8.82773C9.76439 9.12289 9.48282 9.32746 9.15711 9.37479L4.4821 10.0541L7.86471 13.3518C8.10037 13.5816 8.2079 13.9126 8.15224 14.2369L7.35352 18.8921L11.5348 16.6946C11.826 16.5416 12.1739 16.5416 12.4652 16.6946L16.6464 18.8921L15.8477 14.2369C15.792 13.9126 15.8996 13.5816 16.1352 13.3518L19.5178 10.0541L14.8428 9.37479C14.5171 9.32746 14.2355 9.12289 14.0899 8.82773L12 4.59286Z",
3288
+ fill: "currentColor"
3292
3289
  }
3293
3290
  )
3294
3291
  }
@@ -5674,15 +5671,196 @@ var ButtonGroup = ({
5674
5671
  ButtonGroup.displayName = "ButtonGroup";
5675
5672
 
5676
5673
  // src/components/Checkbox/Checkbox.tsx
5677
- import { forwardRef as forwardRef4, useId } from "react";
5674
+ import { forwardRef as forwardRef5, useId } from "react";
5678
5675
  import { Root as CheckboxRoot, Indicator as CheckboxIndicator } from "@radix-ui/react-checkbox";
5679
- import styled11 from "styled-components";
5676
+ import styled13 from "styled-components";
5680
5677
  import { isNonEmptyString as isNonEmptyString2 } from "@wistia/type-guards";
5681
5678
 
5682
5679
  // src/components/Label/Label.tsx
5680
+ import styled11, { css as css14 } from "styled-components";
5681
+
5682
+ // src/components/Heading/Heading.tsx
5683
+ import { forwardRef as forwardRef4 } from "react";
5684
+ import styled10, { css as css13 } from "styled-components";
5685
+
5686
+ // src/components/Ellipsis/Ellipsis.tsx
5687
+ import { isNotNil as isNotNil5 } from "@wistia/type-guards";
5683
5688
  import styled9, { css as css12 } from "styled-components";
5684
5689
  import { jsx as jsx164 } from "react/jsx-runtime";
5685
- var requiredStyle = css12`
5690
+ var ellipsisStyle = css12`
5691
+ overflow: hidden;
5692
+ text-overflow: ellipsis;
5693
+ white-space: nowrap;
5694
+
5695
+ /*
5696
+ Using feature detection (i.e., -webkit-named-image) we only target Safari browsers
5697
+ with this additional styling to prevent a bug that's exclusive to Safari.
5698
+
5699
+ Note that Safari does not properly hide the truncated text for non-inline/inline-block
5700
+ elements so we need to apply display: inline to all the paragraphs in the description.
5701
+ see https://stackoverflow.com/a/70683084
5702
+ */
5703
+ @supports (background: - webkit-named-image(i)) {
5704
+ & > div > div:has(p) {
5705
+ margin-top: 16px;
5706
+ }
5707
+
5708
+ & > div > div > p {
5709
+ display: inline;
5710
+ }
5711
+ }
5712
+ `;
5713
+ var ellipsisFlexParentStyle = css12`
5714
+ min-width: 0;
5715
+ `;
5716
+ var EllipsisComponent = styled9.div`
5717
+ ${ellipsisStyle};
5718
+ ${({ $lines }) => {
5719
+ if (isNotNil5($lines)) {
5720
+ return css12`
5721
+ -webkit-box-orient: vertical;
5722
+ -webkit-line-clamp: ${$lines};
5723
+ display: -webkit-box;
5724
+ white-space: initial;
5725
+ `;
5726
+ }
5727
+ return void 0;
5728
+ }}
5729
+ `;
5730
+ var Ellipsis = ({ children, lines, ...otherProps }) => /* @__PURE__ */ jsx164(
5731
+ EllipsisComponent,
5732
+ {
5733
+ $lines: lines,
5734
+ ...otherProps,
5735
+ children
5736
+ }
5737
+ );
5738
+ Ellipsis.displayName = "Ellipsis";
5739
+
5740
+ // src/private/helpers/makePolymorphic/makePolymorphic.tsx
5741
+ var makePolymorphic = (component) => {
5742
+ return component;
5743
+ };
5744
+
5745
+ // src/components/Heading/Heading.tsx
5746
+ import { jsx as jsx165 } from "react/jsx-runtime";
5747
+ var heroStyle = css13`
5748
+ --font-family: var(--wui-typography-heading-hero-family);
5749
+ --font-size: var(--wui-typography-heading-hero-size);
5750
+ --font-weight: var(--wui-typography-heading-hero-weight);
5751
+ --line-height: var(--wui-typography-heading-hero-line-height);
5752
+ `;
5753
+ var heading1TextStyle = css13`
5754
+ --font-family: var(--wui-typography-heading-1-family);
5755
+ --font-size: var(--wui-typography-heading-1-size);
5756
+ --font-weight: var(--wui-typography-heading-1-weight);
5757
+ --line-height: var(--wui-typography-heading-1-line-height);
5758
+ `;
5759
+ var heading2TextStyle = css13`
5760
+ --font-family: var(--wui-typography-heading-2-family);
5761
+ --font-size: var(--wui-typography-heading-2-size);
5762
+ --font-weight: var(--wui-typography-heading-2-weight);
5763
+ --line-height: var(--wui-typography-heading-2-line-height);
5764
+ `;
5765
+ var heading3TextStyle = css13`
5766
+ --font-family: var(--wui-typography-heading-3-family);
5767
+ --font-size: var(--wui-typography-heading-3-size);
5768
+ --font-weight: var(--wui-typography-heading-3-weight);
5769
+ --line-height: var(--wui-typography-heading-3-line-height);
5770
+ `;
5771
+ var heading4TextStyle = css13`
5772
+ --font-family: var(--wui-typography-heading-4-family);
5773
+ --font-size: var(--wui-typography-heading-4-size);
5774
+ --font-weight: var(--wui-typography-heading-4-weight);
5775
+ --line-height: var(--wui-typography-heading-4-line-height);
5776
+ `;
5777
+ var heading5TextStyle = css13`
5778
+ --font-family: var(--wui-typography-heading-5-family);
5779
+ --font-size: var(--wui-typography-heading-5-size);
5780
+ --font-weight: var(--wui-typography-heading-5-weight);
5781
+ --line-height: var(--wui-typography-heading-5-line-height);
5782
+ `;
5783
+ var heading6TextStyle = css13`
5784
+ --font-family: var(--wui-typography-heading-6-family);
5785
+ --font-size: var(--wui-typography-heading-6-size);
5786
+ --font-weight: var(--wui-typography-heading-6-weight);
5787
+ --line-height: var(--wui-typography-heading-6-line-height);
5788
+ `;
5789
+ var variantStyleMap = {
5790
+ hero: heroStyle,
5791
+ heading1: heading1TextStyle,
5792
+ heading2: heading2TextStyle,
5793
+ heading3: heading3TextStyle,
5794
+ heading4: heading4TextStyle,
5795
+ heading5: heading5TextStyle,
5796
+ heading6: heading6TextStyle
5797
+ };
5798
+ var DEFAULT_ELEMENT = "h1";
5799
+ var StyledHeading = styled10.div`
5800
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
5801
+ font-family: var(--font-family);
5802
+ font-size: var(--font-size);
5803
+ font-weight: var(--font-weight);
5804
+ line-height: var(--line-height);
5805
+ color: var(--wui-color-text);
5806
+ ${({ $variant }) => variantStyleMap[$variant]}
5807
+ ${({ $ellipsis }) => $ellipsis && ellipsisStyle};
5808
+ ${({ $inline }) => $inline && css13`
5809
+ display: inline-block;
5810
+ `}
5811
+ ${({ $disabled }) => $disabled && css13`
5812
+ color: var(--wui-color-text-disabled);
5813
+ `}
5814
+ ${({ $preventUserSelect }) => $preventUserSelect && css13`
5815
+ user-select: none;
5816
+ `}
5817
+ ${({ $align }) => css13`
5818
+ text-align: ${$align};
5819
+ `}
5820
+ margin: 0;
5821
+ `;
5822
+ var variantElementMap = {
5823
+ hero: DEFAULT_ELEMENT,
5824
+ heading1: DEFAULT_ELEMENT,
5825
+ heading2: "h2",
5826
+ heading3: "h3",
5827
+ heading4: "h4",
5828
+ heading5: "h5",
5829
+ heading6: "h6"
5830
+ };
5831
+ var HeadingComponent = forwardRef4(
5832
+ ({
5833
+ align = "left",
5834
+ colorScheme = "inherit",
5835
+ disabled = false,
5836
+ ellipsis = false,
5837
+ inline = false,
5838
+ preventUserSelect = false,
5839
+ variant = "heading1",
5840
+ renderAs,
5841
+ ...otherProps
5842
+ }, ref) => /* @__PURE__ */ jsx165(
5843
+ StyledHeading,
5844
+ {
5845
+ ref,
5846
+ $align: align,
5847
+ $colorScheme: colorScheme,
5848
+ $disabled: disabled,
5849
+ $ellipsis: ellipsis,
5850
+ $inline: inline,
5851
+ $preventUserSelect: preventUserSelect,
5852
+ $variant: variant,
5853
+ as: renderAs ?? variantElementMap[variant],
5854
+ ...otherProps
5855
+ }
5856
+ )
5857
+ );
5858
+ HeadingComponent.displayName = "Heading";
5859
+ var Heading = makePolymorphic(HeadingComponent);
5860
+
5861
+ // src/components/Label/Label.tsx
5862
+ import { jsx as jsx166 } from "react/jsx-runtime";
5863
+ var requiredStyle = css14`
5686
5864
  &::after {
5687
5865
  color: var(--wui-color-text-error);
5688
5866
  display: inline;
@@ -5690,16 +5868,14 @@ var requiredStyle = css12`
5690
5868
  content: '*';
5691
5869
  }
5692
5870
  `;
5693
- var disabledStyle = css12`
5871
+ var disabledStyle = css14`
5694
5872
  color: var(--wui-color-text-disabled);
5695
5873
  `;
5696
- var SPACE_BETWEEN_LABEL_AND_INPUT = "var(--wui-space-02)";
5697
- var StyledLabel = styled9.label`
5698
- display: inline-block;
5699
- font-size: var(--wui-typography-label-1-size);
5700
- font-weight: var(--wui-typography-label-1-weight);
5701
- line-height: var(--wui-typography-label-1-line-height);
5702
- cursor: inherit;
5874
+ var StyledLabel = styled11(Heading).attrs({
5875
+ variant: "heading6",
5876
+ renderAs: "label"
5877
+ })`
5878
+ display: block;
5703
5879
  width: 100%;
5704
5880
 
5705
5881
  /* if label is wrapping an input this ensures it appears beneath the label with a nice margin */
@@ -5707,7 +5883,6 @@ var StyledLabel = styled9.label`
5707
5883
  > textarea,
5708
5884
  > select {
5709
5885
  display: block;
5710
- margin-top: ${SPACE_BETWEEN_LABEL_AND_INPUT};
5711
5886
  }
5712
5887
 
5713
5888
  > label {
@@ -5715,8 +5890,8 @@ var StyledLabel = styled9.label`
5715
5890
  }
5716
5891
 
5717
5892
  ${({ $screenReaderOnly }) => $screenReaderOnly && visuallyHiddenStyle}
5718
- ${({ disabled }) => disabled && disabledStyle}
5719
- ${({ required }) => required && requiredStyle}
5893
+ ${({ $disabled }) => $disabled && disabledStyle}
5894
+ ${({ $required }) => $required && requiredStyle}
5720
5895
  `;
5721
5896
  var Label = ({
5722
5897
  children,
@@ -5725,24 +5900,24 @@ var Label = ({
5725
5900
  required = false,
5726
5901
  screenReaderOnly = false,
5727
5902
  ...otherProps
5728
- }) => /* @__PURE__ */ jsx164(
5903
+ }) => /* @__PURE__ */ jsx166(
5729
5904
  StyledLabel,
5730
5905
  {
5906
+ ...otherProps,
5907
+ $disabled: disabled,
5908
+ $required: required,
5731
5909
  $screenReaderOnly: screenReaderOnly,
5732
- disabled,
5733
5910
  htmlFor,
5734
- required,
5735
- ...otherProps,
5736
5911
  children
5737
5912
  }
5738
5913
  );
5739
5914
  Label.displayName = "Label";
5740
5915
 
5741
5916
  // src/components/Label/LabelDescription.tsx
5742
- import styled10 from "styled-components";
5917
+ import styled12 from "styled-components";
5743
5918
  import { isNil as isNil9 } from "@wistia/type-guards";
5744
- import { jsx as jsx165 } from "react/jsx-runtime";
5745
- var StyledLabelDescription = styled10.div`
5919
+ import { jsx as jsx167 } from "react/jsx-runtime";
5920
+ var StyledLabelDescription = styled12.div`
5746
5921
  color: var(--wui-color-text-secondary);
5747
5922
  font-size: var(--wui-typography-body-4-size);
5748
5923
  font-weight: var(--wui-typography-body-4-weight);
@@ -5755,13 +5930,13 @@ var LabelDescription = ({
5755
5930
  if (isNil9(children)) {
5756
5931
  return null;
5757
5932
  }
5758
- return /* @__PURE__ */ jsx165(StyledLabelDescription, { ...props, children });
5933
+ return /* @__PURE__ */ jsx167(StyledLabelDescription, { ...props, children });
5759
5934
  };
5760
5935
  LabelDescription.displayName = "LabelDescription";
5761
5936
 
5762
5937
  // src/components/Checkbox/Checkbox.tsx
5763
- import { jsx as jsx166, jsxs as jsxs6 } from "react/jsx-runtime";
5764
- var CheckIcon = () => /* @__PURE__ */ jsx166(
5938
+ import { jsx as jsx168, jsxs as jsxs6 } from "react/jsx-runtime";
5939
+ var CheckIcon = () => /* @__PURE__ */ jsx168(
5765
5940
  "svg",
5766
5941
  {
5767
5942
  fill: "inherit",
@@ -5769,7 +5944,7 @@ var CheckIcon = () => /* @__PURE__ */ jsx166(
5769
5944
  viewBox: "0 0 10 8",
5770
5945
  width: "10",
5771
5946
  xmlns: "http://www.w3.org/2000/svg",
5772
- children: /* @__PURE__ */ jsx166(
5947
+ children: /* @__PURE__ */ jsx168(
5773
5948
  "path",
5774
5949
  {
5775
5950
  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",
@@ -5778,11 +5953,10 @@ var CheckIcon = () => /* @__PURE__ */ jsx166(
5778
5953
  )
5779
5954
  }
5780
5955
  );
5781
- var StyledCheckboxWrapper = styled11.div`
5956
+ var StyledCheckboxWrapper = styled13.div`
5782
5957
  display: flex;
5783
5958
  align-items: center;
5784
5959
  cursor: pointer;
5785
- padding: var(--wui-space-02);
5786
5960
 
5787
5961
  &:hover {
5788
5962
  /* TODO Lamp to design hover state */
@@ -5793,7 +5967,7 @@ var StyledCheckboxWrapper = styled11.div`
5793
5967
  background-color: #efefef;
5794
5968
  }
5795
5969
  `;
5796
- var StyledCheckboxRoot = styled11(CheckboxRoot)`
5970
+ var StyledCheckboxRoot = styled13(CheckboxRoot)`
5797
5971
  all: unset; /* CheckboxRoot renders as a button element, so we need to reset all styles */
5798
5972
  background-color: var(--wui-color-bg-fill-white);
5799
5973
  min-width: 16px;
@@ -5806,7 +5980,6 @@ var StyledCheckboxRoot = styled11(CheckboxRoot)`
5806
5980
  align-items: center;
5807
5981
  justify-content: center;
5808
5982
  align-self: start; /* align to the top to handle label descriptions */
5809
- margin-top: 3px; /* bump down slightly to mimic "align-self: center" */
5810
5983
 
5811
5984
  &[data-state='checked'] {
5812
5985
  background-color: var(--wui-color-bg-fill);
@@ -5828,21 +6001,21 @@ var StyledCheckboxRoot = styled11(CheckboxRoot)`
5828
6001
  /* TODO Lamp to design focus state */
5829
6002
  }
5830
6003
  `;
5831
- var StyledCheckboxIndicator = styled11(CheckboxIndicator)`
6004
+ var StyledCheckboxIndicator = styled13(CheckboxIndicator)`
5832
6005
  display: flex;
5833
6006
  `;
5834
- var StyledLabelWrapper = styled11.div`
6007
+ var StyledLabelWrapper = styled13.div`
5835
6008
  display: flex;
5836
6009
  flex-direction: column;
5837
- padding-left: var(--wui-space-02);
6010
+ margin-left: var(--wui-space-02);
5838
6011
  `;
5839
- var Checkbox = forwardRef4(
6012
+ var Checkbox = forwardRef5(
5840
6013
  ({
5841
6014
  checked,
5842
6015
  disabled = false,
5843
6016
  forceState,
5844
6017
  id,
5845
- label = "default",
6018
+ label,
5846
6019
  description,
5847
6020
  name,
5848
6021
  onChange,
@@ -5851,12 +6024,13 @@ var Checkbox = forwardRef4(
5851
6024
  ...otherProps
5852
6025
  }, ref) => {
5853
6026
  const generatedId = useId();
5854
- const computedId = isNonEmptyString2(id) ? id : `vhs-checkbox-${generatedId}`;
6027
+ const computedId = isNonEmptyString2(id) ? id : `wistia-ui-checkbox-group-${generatedId}`;
5855
6028
  return /* @__PURE__ */ jsxs6(StyledCheckboxWrapper, { children: [
5856
- /* @__PURE__ */ jsx166(
6029
+ /* @__PURE__ */ jsx168(
5857
6030
  StyledCheckboxRoot,
5858
6031
  {
5859
6032
  ref,
6033
+ "aria-label": label,
5860
6034
  checked: checked ?? void 0,
5861
6035
  defaultChecked: checked === void 0 ? false : void 0,
5862
6036
  disabled,
@@ -5866,6 +6040,7 @@ var Checkbox = forwardRef4(
5866
6040
  if (onChange) {
5867
6041
  const syntheticEvent = {
5868
6042
  target: {
6043
+ name,
5869
6044
  id: computedId,
5870
6045
  checked: state === true
5871
6046
  }
@@ -5876,11 +6051,11 @@ var Checkbox = forwardRef4(
5876
6051
  required,
5877
6052
  value,
5878
6053
  ...otherProps,
5879
- children: /* @__PURE__ */ jsx166(StyledCheckboxIndicator, { children: /* @__PURE__ */ jsx166(CheckIcon, {}) })
6054
+ children: /* @__PURE__ */ jsx168(StyledCheckboxIndicator, { children: /* @__PURE__ */ jsx168(CheckIcon, {}) })
5880
6055
  }
5881
6056
  ),
5882
6057
  /* @__PURE__ */ jsxs6(StyledLabelWrapper, { children: [
5883
- /* @__PURE__ */ jsx166(
6058
+ /* @__PURE__ */ jsx168(
5884
6059
  Label,
5885
6060
  {
5886
6061
  disabled,
@@ -5889,7 +6064,7 @@ var Checkbox = forwardRef4(
5889
6064
  children: label
5890
6065
  }
5891
6066
  ),
5892
- /* @__PURE__ */ jsx166(LabelDescription, { children: description })
6067
+ /* @__PURE__ */ jsx168(LabelDescription, { children: description })
5893
6068
  ] })
5894
6069
  ] });
5895
6070
  }
@@ -5897,13 +6072,13 @@ var Checkbox = forwardRef4(
5897
6072
  Checkbox.displayName = "Checkbox";
5898
6073
 
5899
6074
  // src/components/Divider/Divider.tsx
5900
- import styled12 from "styled-components";
5901
- import { jsx as jsx167 } from "react/jsx-runtime";
6075
+ import styled14 from "styled-components";
6076
+ import { jsx as jsx169 } from "react/jsx-runtime";
5902
6077
  var sizeToPixelMap = {
5903
6078
  lg: 4,
5904
6079
  sm: 1
5905
6080
  };
5906
- var DividerComponent = styled12.hr`
6081
+ var DividerComponent = styled14.hr`
5907
6082
  background: none;
5908
6083
  border-bottom: none;
5909
6084
  border-left: none;
@@ -5918,7 +6093,7 @@ var DividerComponent = styled12.hr`
5918
6093
  `;
5919
6094
  var Divider = ({ size = "sm", ...otherProps }) => {
5920
6095
  const responsiveSize = useResponsiveProp(size);
5921
- return /* @__PURE__ */ jsx167(
6096
+ return /* @__PURE__ */ jsx169(
5922
6097
  DividerComponent,
5923
6098
  {
5924
6099
  $borderHeight: sizeToPixelMap[responsiveSize],
@@ -5928,546 +6103,299 @@ var Divider = ({ size = "sm", ...otherProps }) => {
5928
6103
  };
5929
6104
  Divider.displayName = "Divider";
5930
6105
 
5931
- // src/components/Ellipsis/Ellipsis.tsx
5932
- import { isNotNil as isNotNil5 } from "@wistia/type-guards";
5933
- import styled13, { css as css13 } from "styled-components";
5934
- import { jsx as jsx168 } from "react/jsx-runtime";
5935
- var ellipsisStyle = css13`
5936
- overflow: hidden;
5937
- text-overflow: ellipsis;
5938
- white-space: nowrap;
5939
-
5940
- /*
5941
- Using feature detection (i.e., -webkit-named-image) we only target Safari browsers
5942
- with this additional styling to prevent a bug that's exclusive to Safari.
6106
+ // src/components/Form/Form.tsx
6107
+ import { forwardRef as forwardRef7, useRef as useRef2, useMemo as useMemo4, createContext as createContext2, useState as useState4, useId as useId2 } from "react";
6108
+ import styled16 from "styled-components";
6109
+ import { isNotUndefined as isNotUndefined4, isUndefined as isUndefined3 } from "@wistia/type-guards";
5943
6110
 
5944
- Note that Safari does not properly hide the truncated text for non-inline/inline-block
5945
- elements so we need to apply display: inline to all the paragraphs in the description.
5946
- see https://stackoverflow.com/a/70683084
5947
- */
5948
- @supports (background: - webkit-named-image(i)) {
5949
- & > div > div:has(p) {
5950
- margin-top: 16px;
5951
- }
6111
+ // src/components/Stack/Stack.tsx
6112
+ import { forwardRef as forwardRef6 } from "react";
6113
+ import styled15 from "styled-components";
6114
+ import { jsx as jsx170 } from "react/jsx-runtime";
6115
+ var DEFAULT_ELEMENT2 = "div";
6116
+ var StyledStack = styled15.div`
6117
+ display: flex;
6118
+ flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
6119
+ gap: ${({ $gap }) => `var(--wui-${$gap})`};
5952
6120
 
5953
- & > div > div > p {
5954
- display: inline;
5955
- }
5956
- }
5957
- `;
5958
- var ellipsisFlexParentStyle = css13`
5959
- min-width: 0;
5960
- `;
5961
- var EllipsisComponent = styled13.div`
5962
- ${ellipsisStyle};
5963
- ${({ $lines }) => {
5964
- if (isNotNil5($lines)) {
5965
- return css13`
5966
- -webkit-box-orient: vertical;
5967
- -webkit-line-clamp: ${$lines};
5968
- display: -webkit-box;
5969
- white-space: initial;
5970
- `;
6121
+ > * {
6122
+ flex: 1;
5971
6123
  }
5972
- return void 0;
5973
- }}
5974
6124
  `;
5975
- var Ellipsis = ({ children, lines, ...otherProps }) => /* @__PURE__ */ jsx168(
5976
- EllipsisComponent,
5977
- {
5978
- $lines: lines,
5979
- ...otherProps,
5980
- children
6125
+ var StackComponent = forwardRef6(
6126
+ ({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
6127
+ const responsiveGap = useResponsiveProp(gap);
6128
+ const responsiveDirection = useResponsiveProp(direction);
6129
+ return /* @__PURE__ */ jsx170(
6130
+ StyledStack,
6131
+ {
6132
+ ref,
6133
+ $direction: responsiveDirection,
6134
+ $gap: responsiveGap,
6135
+ as: renderAs ?? DEFAULT_ELEMENT2,
6136
+ ...props
6137
+ }
6138
+ );
5981
6139
  }
5982
6140
  );
5983
- Ellipsis.displayName = "Ellipsis";
5984
-
5985
- // src/components/Heading/Heading.tsx
5986
- import { forwardRef as forwardRef5 } from "react";
5987
- import styled14, { css as css14 } from "styled-components";
6141
+ StackComponent.displayName = "Stack";
6142
+ var Stack = makePolymorphic(StackComponent);
5988
6143
 
5989
- // src/private/helpers/makePolymorphic/makePolymorphic.tsx
5990
- var makePolymorphic = (component) => {
5991
- return component;
5992
- };
6144
+ // src/components/Form/Form.tsx
6145
+ import { jsx as jsx171 } from "react/jsx-runtime";
6146
+ var StyledForm = styled16.form`
6147
+ --form-default-width: 690px;
5993
6148
 
5994
- // src/components/Heading/Heading.tsx
5995
- import { jsx as jsx169 } from "react/jsx-runtime";
5996
- var heroStyle = css14`
5997
- --font-family: var(--wui-typography-heading-hero-family);
5998
- --font-size: var(--wui-typography-heading-hero-size);
5999
- --font-weight: var(--wui-typography-heading-hero-weight);
6000
- --line-height: var(--wui-typography-heading-hero-line-height);
6001
- `;
6002
- var heading1TextStyle = css14`
6003
- --font-family: var(--wui-typography-heading-1-family);
6004
- --font-size: var(--wui-typography-heading-1-size);
6005
- --font-weight: var(--wui-typography-heading-1-weight);
6006
- --line-height: var(--wui-typography-heading-1-line-height);
6007
- `;
6008
- var heading2TextStyle = css14`
6009
- --font-family: var(--wui-typography-heading-2-family);
6010
- --font-size: var(--wui-typography-heading-2-size);
6011
- --font-weight: var(--wui-typography-heading-2-weight);
6012
- --line-height: var(--wui-typography-heading-2-line-height);
6149
+ max-width: ${({ fullWidth }) => fullWidth ? "auto" : "var(--form-default-width)"};
6150
+ align-items: ${({ fullWidth }) => fullWidth ? "stretch" : "flex-start"};
6013
6151
  `;
6014
- var heading3TextStyle = css14`
6015
- --font-family: var(--wui-typography-heading-3-family);
6016
- --font-size: var(--wui-typography-heading-3-size);
6017
- --font-weight: var(--wui-typography-heading-3-weight);
6018
- --line-height: var(--wui-typography-heading-3-line-height);
6019
- `;
6020
- var heading4TextStyle = css14`
6021
- --font-family: var(--wui-typography-heading-4-family);
6022
- --font-size: var(--wui-typography-heading-4-size);
6023
- --font-weight: var(--wui-typography-heading-4-weight);
6024
- --line-height: var(--wui-typography-heading-4-line-height);
6025
- `;
6026
- var heading5TextStyle = css14`
6027
- --font-family: var(--wui-typography-heading-5-family);
6028
- --font-size: var(--wui-typography-heading-5-size);
6029
- --font-weight: var(--wui-typography-heading-5-weight);
6030
- --line-height: var(--wui-typography-heading-5-line-height);
6031
- `;
6032
- var heading6TextStyle = css14`
6033
- --font-family: var(--wui-typography-heading-6-family);
6034
- --font-size: var(--wui-typography-heading-6-size);
6035
- --font-weight: var(--wui-typography-heading-6-weight);
6036
- --line-height: var(--wui-typography-heading-6-line-height);
6037
- `;
6038
- var variantStyleMap = {
6039
- hero: heroStyle,
6040
- heading1: heading1TextStyle,
6041
- heading2: heading2TextStyle,
6042
- heading3: heading3TextStyle,
6043
- heading4: heading4TextStyle,
6044
- heading5: heading5TextStyle,
6045
- heading6: heading6TextStyle
6046
- };
6047
- var DEFAULT_ELEMENT = "h1";
6048
- var StyledHeading = styled14.div`
6049
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
6050
- font-family: var(--font-family);
6051
- font-size: var(--font-size);
6052
- font-weight: var(--font-weight);
6053
- line-height: var(--line-height);
6054
- color: var(--wui-color-text);
6055
- ${({ $variant }) => variantStyleMap[$variant]}
6056
- ${({ $ellipsis }) => $ellipsis && ellipsisStyle};
6057
- ${({ $inline }) => $inline && css14`
6058
- display: inline-block;
6059
- `}
6060
- ${({ $disabled }) => $disabled && css14`
6061
- color: var(--wui-color-text-disabled);
6062
- `}
6063
- ${({ $preventUserSelect }) => $preventUserSelect && css14`
6064
- user-select: none;
6065
- `}
6066
- ${({ $align }) => css14`
6067
- text-align: ${$align};
6068
- `}
6069
- margin: 0;
6070
- `;
6071
- var variantElementMap = {
6072
- hero: DEFAULT_ELEMENT,
6073
- heading1: DEFAULT_ELEMENT,
6074
- heading2: "h2",
6075
- heading3: "h3",
6076
- heading4: "h4",
6077
- heading5: "h5",
6078
- heading6: "h6"
6079
- };
6080
- var HeadingComponent = forwardRef5(
6081
- ({
6082
- align = "left",
6083
- colorScheme = "inherit",
6084
- disabled = false,
6085
- ellipsis = false,
6086
- inline = false,
6087
- preventUserSelect = false,
6088
- variant = "heading1",
6089
- renderAs,
6090
- ...otherProps
6091
- }, ref) => /* @__PURE__ */ jsx169(
6092
- StyledHeading,
6093
- {
6094
- ref,
6095
- $align: align,
6096
- $colorScheme: colorScheme,
6097
- $disabled: disabled,
6098
- $ellipsis: ellipsis,
6099
- $inline: inline,
6100
- $preventUserSelect: preventUserSelect,
6101
- $variant: variant,
6102
- as: renderAs ?? variantElementMap[variant],
6103
- ...otherProps
6104
- }
6105
- )
6106
- );
6107
- HeadingComponent.displayName = "Heading";
6108
- var Heading = makePolymorphic(HeadingComponent);
6109
-
6110
- // src/components/IconButton/IconButton.tsx
6111
- import { Children as Children2, cloneElement as cloneElement2, forwardRef as forwardRef6 } from "react";
6112
- import styled16 from "styled-components";
6113
-
6114
- // src/components/Tooltip/Tooltip.tsx
6115
- import {
6116
- Root,
6117
- Content,
6118
- Trigger,
6119
- Portal,
6120
- Arrow
6121
- } from "@radix-ui/react-tooltip";
6122
- import styled15, { css as css15 } from "styled-components";
6123
- import { jsx as jsx170, jsxs as jsxs7 } from "react/jsx-runtime";
6124
- var CompactTooltipStyles = css15`
6125
- --tooltip-font-size: var(--wui-typography-label-4-size);
6126
- --tooltip-line-height: var(--wui-typography-label-4-line-height);
6127
- --tooltip-font-weight: var(--wui-typography-label-4-weight);
6128
- --tooltip-horizontal-padding: var(--wui-space-02);
6129
- --tooltip-vertical-padding: var(--wui-space-03);
6130
- `;
6131
- var StyledContent = styled15(Content)`
6132
- --tooltip-font-family: var(--wui-typography-family-default);
6133
- --tooltip-border-radius: var(--wui-border-radius-05);
6134
- --tooltip-bg: var(--wui-color-bg-tooltip);
6135
- --tooltip-color: var(--wui-color-text-on-fill);
6136
- --tooltip-font-size: var(--wui-typography-label-3-size);
6137
- --tooltip-line-height: var(--wui-typography-label-3-line-height);
6138
- --tooltip-font-weight: var(--wui-typography-label-3-weight);
6139
- --tooltip-horizontal-padding: var(--wui-space-03);
6140
- --tooltip-vertical-padding: var(--wui-space-03);
6141
-
6142
- ${({ $compact }) => Boolean($compact) && CompactTooltipStyles};
6143
-
6144
- font-family: var(--tooltip-font-family);
6145
- font-size: var(--tooltip-font-size);
6146
- border-radius: var(--tooltip-border-radius);
6147
- padding: var(--tooltip-horizontal-padding) var(--tooltip-vertical-padding);
6148
- background-color: var(--tooltip-bg);
6149
- color: var(--tooltip-color);
6150
- user-select: none;
6151
- animation-duration: 400ms;
6152
- animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
6153
- will-change: transform, opacity;
6154
- max-width: 30em;
6155
-
6156
- &[data-state='delayed-open'][data-side='top'] {
6157
- animation-name: slideDownAndFade;
6158
- }
6159
-
6160
- &[data-state='delayed-open'][data-side='right'] {
6161
- animation-name: slideLeftAndFade;
6162
- }
6163
-
6164
- &[data-state='delayed-open'][data-side='bottom'] {
6165
- animation-name: slideUpAndFade;
6166
- }
6167
-
6168
- &[data-state='delayed-open'][data-side='left'] {
6169
- animation-name: slideRightAndFade;
6170
- }
6171
- `;
6172
- var VISUAL_OFFSET = 6;
6173
- var Tooltip = ({
6174
- delay = 700,
6175
- direction = "top",
6176
- content,
6177
- children,
6178
- forceOpen,
6179
- compact = false,
6180
- hideArrow = false
6181
- }) => {
6182
- const rootProps = {};
6183
- if (content === "" || content === null) {
6184
- rootProps.open = false;
6185
- }
6186
- if (forceOpen === true) {
6187
- rootProps.open = true;
6188
- }
6189
- return /* @__PURE__ */ jsxs7(
6190
- Root,
6191
- {
6192
- delayDuration: delay,
6193
- ...rootProps,
6194
- children: [
6195
- /* @__PURE__ */ jsx170(Trigger, { asChild: true, children }),
6196
- /* @__PURE__ */ jsx170(Portal, { children: /* @__PURE__ */ jsxs7(
6197
- StyledContent,
6198
- {
6199
- $compact: compact,
6200
- side: direction,
6201
- sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
6202
- children: [
6203
- content,
6204
- !hideArrow ? /* @__PURE__ */ jsx170(Arrow, { asChild: true, children: /* @__PURE__ */ jsx170(
6205
- "svg",
6206
- {
6207
- fill: "var(--tooltip-bg)",
6208
- height: "8",
6209
- style: { transform: "translateY(-2px)" },
6210
- viewBox: "0 0 12 8",
6211
- width: "12",
6212
- xmlns: "http://www.w3.org/2000/svg",
6213
- children: /* @__PURE__ */ jsx170("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" })
6214
- }
6215
- ) }) : null
6216
- ]
6217
- }
6218
- ) })
6219
- ]
6220
- }
6221
- );
6222
- };
6223
- Tooltip.displayName = "Tooltip";
6224
-
6225
- // src/components/IconButton/IconButton.tsx
6226
- import { jsx as jsx171 } from "react/jsx-runtime";
6227
- var StyledButton2 = styled16(Button)`
6228
- --icon-button-size-sm: 24px;
6229
- --icon-button-size-md: 32px;
6230
- --icon-button-size-lg: 40px;
6231
- --icon-button-size-xl: 48px;
6232
-
6233
- border-radius: 50%;
6234
- height: ${({ size }) => `var(--icon-button-size-${size})`};
6235
- width: ${({ size }) => `var(--icon-button-size-${size})`};
6236
- display: flex;
6237
- justify-content: center;
6238
- align-items: center;
6239
- line-height: 1;
6240
- `;
6241
- var IconButton = forwardRef6(
6242
- ({ children, label, disableTooltip = false, size = "md", ...props }, ref) => {
6243
- const responsiveSize = useResponsiveProp(size);
6244
- const button = /* @__PURE__ */ jsx171(
6245
- StyledButton2,
6246
- {
6247
- ...props,
6248
- ref,
6249
- "aria-label": label,
6250
- "data-wistia-ui-icon-button": true,
6251
- size: responsiveSize,
6252
- children: cloneElement2(Children2.only(children), {
6253
- size: responsiveSize
6254
- })
6255
- }
6256
- );
6257
- if (disableTooltip) {
6258
- return button;
6259
- }
6260
- return /* @__PURE__ */ jsx171(Tooltip, { content: label, children: button });
6261
- }
6262
- );
6263
- IconButton.displayName = "IconButton";
6264
-
6265
- // src/components/Menu/Menu.tsx
6266
- import styled17, { css as css16, keyframes } from "styled-components";
6267
- import {
6268
- DropdownMenu,
6269
- DropdownMenuTrigger,
6270
- DropdownMenuPortal,
6271
- DropdownMenuContent
6272
- } from "@radix-ui/react-dropdown-menu";
6273
- import { isNotNil as isNotNil6, isNotUndefined as isNotUndefined4 } from "@wistia/type-guards";
6274
- import { jsx as jsx172, jsxs as jsxs8 } from "react/jsx-runtime";
6275
- var open = keyframes`
6276
- from {
6277
- opacity: 0;
6278
- transform: scale(.97) translateY(-8px);
6279
- }
6280
- to {
6281
- opacity: 1;
6282
- transform: scale(1);
6283
- }
6284
- `;
6285
- var close = keyframes`
6286
- from {
6287
- opacity: 1;
6288
- transform: scale(1);
6289
- }
6290
- to {
6291
- opacity: 0;
6292
- transform: scale(.97) translateY(-8px);
6293
- }
6294
- `;
6295
- var menuContentCss = css16`
6296
- --menu-font-family: var(--wui-typography-family-default);
6297
- --menu-bg: var(--wui-color-bg-fill-white); /* TODO - Not sure what token to use for this */
6298
- --menu-shadow: 0 0 64px 0 rgba(0 0 0 / 8%); /* TODO - Need a box-shadow token */
6299
- --menu-border-radius: var(--wui-border-radius-01);
6300
- --menu-padding: var(--wui-space-03);
6301
- --menu-min-width: 120px;
6302
- --menu-max-width: 284px;
6303
- --menu-zindex: 500; /* TODO - need z-index token */
6304
-
6305
- animation: ${open}; /* TODO - need easing tokens */
6306
- font-family: var(--menu-font-family);
6307
- background: var(--menu-bg);
6308
- border-radius: var(--menu-border-radius);
6309
- box-shadow: var(--menu-shadow); /* TODO - Need a box-shadow token */
6310
- max-height: var(--radix-dropdown-menu-content-available-height);
6311
- min-width: var(--menu-min-width);
6312
- max-width: var(--menu-max-width);
6313
- overflow: auto;
6314
- padding: var(--menu-padding);
6315
- transform-origin: var(--radix-dropdown-menu-content-transform-origin);
6316
- z-index: var(--menu-zindex);
6317
-
6318
- &[data-state='closed'] {
6319
- animation: ${close}; /* TODO - need easing tokens */
6320
- }
6321
-
6322
- ${mq.smAndUp} {
6323
- bottom: 0;
6324
- padding: var(--menu-padding);
6325
- right: 0;
6326
- top: 0;
6327
- transform: initial;
6328
- }
6329
-
6330
- hr {
6331
- margin: var(--wui-space-02) 0;
6332
- }
6333
- `;
6334
- var MenuContent = styled17(DropdownMenuContent)`
6335
- ${menuContentCss}
6336
- `;
6337
- var Menu = ({
6338
- align = "start",
6339
- children,
6340
- trigger,
6341
- label,
6342
- isOpen,
6343
- triggerProps = {},
6344
- onOpenChange,
6345
- onInteractOutside,
6346
- ...props
6347
- }) => {
6348
- return /* @__PURE__ */ jsxs8(
6349
- DropdownMenu,
6350
- {
6351
- modal: false,
6352
- ...isNotNil6(onOpenChange) && isNotNil6(isOpen) ? { open: isOpen, onOpenChange } : {},
6353
- children: [
6354
- /* @__PURE__ */ jsx172(DropdownMenuTrigger, { asChild: true, children: isNotUndefined4(trigger) ? trigger : /* @__PURE__ */ jsx172(
6355
- Button,
6356
- {
6357
- "aria-expanded": isOpen,
6358
- forceState: isOpen ? "active" : void 0,
6359
- rightIcon: /* @__PURE__ */ jsx172(Icon, { type: "caret-down" }),
6360
- ...triggerProps,
6361
- children: label
6362
- }
6363
- ) }),
6364
- /* @__PURE__ */ jsx172(DropdownMenuPortal, { children: /* @__PURE__ */ jsx172(
6365
- MenuContent,
6366
- {
6367
- ...props,
6368
- align,
6369
- onFocusOutside: (event) => {
6370
- event.preventDefault();
6371
- },
6372
- sideOffset: 6,
6373
- children
6374
- }
6375
- ) })
6376
- ]
6152
+ var FormContext = createContext2({
6153
+ values: {},
6154
+ errors: {},
6155
+ hasSubmitted: false,
6156
+ formId: ""
6157
+ });
6158
+ var FormComponent = ({ children, action, values = {}, validate, fullWidth = false, ...props }, forwardedRef) => {
6159
+ const [errors, setErrors] = useState4({});
6160
+ const [hasSubmitted, setHasSubmitted] = useState4(false);
6161
+ const innerRef = useRef2();
6162
+ const ref = forwardedRef ?? innerRef;
6163
+ const autoId = useId2();
6164
+ const id = props.id ?? autoId;
6165
+ const handleValidate = (nextFormData) => {
6166
+ const nextData = Object.fromEntries(nextFormData.entries());
6167
+ if (isUndefined3(validate)) {
6168
+ return {};
6169
+ }
6170
+ return validate(nextData);
6171
+ };
6172
+ const handleBlur = (event) => {
6173
+ if (props.onBlur) {
6174
+ props.onBlur(event);
6175
+ }
6176
+ const formData = new FormData(event.currentTarget);
6177
+ if (isNotUndefined4(validate)) {
6178
+ handleValidate(formData);
6179
+ }
6180
+ };
6181
+ const handleSubmit = (event) => {
6182
+ event.preventDefault();
6183
+ const formData = new FormData(event.currentTarget);
6184
+ const nextErrors = handleValidate(formData);
6185
+ const isValid = Object.keys(nextErrors).length === 0;
6186
+ setErrors(nextErrors);
6187
+ setHasSubmitted(true);
6188
+ if (isValid && props.onSubmit) {
6189
+ props.onSubmit(event);
6190
+ }
6191
+ if (isValid && action) {
6192
+ void action(formData);
6377
6193
  }
6194
+ };
6195
+ const handleReset = (event) => {
6196
+ setErrors({});
6197
+ setHasSubmitted(false);
6198
+ if (props.onReset) {
6199
+ props.onReset(event);
6200
+ }
6201
+ if (action) {
6202
+ void action(null);
6203
+ }
6204
+ };
6205
+ const context = useMemo4(() => {
6206
+ return {
6207
+ values,
6208
+ errors,
6209
+ hasSubmitted,
6210
+ formId: id
6211
+ };
6212
+ }, [values, errors, id, hasSubmitted]);
6213
+ return (
6214
+ // @ts-expect-error - generic context providers are a giant pain
6215
+ /* @__PURE__ */ jsx171(FormContext.Provider, { value: context, children: /* @__PURE__ */ jsx171(
6216
+ Stack,
6217
+ {
6218
+ gap: "space-05",
6219
+ ...props,
6220
+ ref,
6221
+ as: StyledForm,
6222
+ fullWidth,
6223
+ id,
6224
+ onBlur: handleBlur,
6225
+ onReset: handleReset,
6226
+ onSubmit: handleSubmit,
6227
+ children
6228
+ }
6229
+ ) })
6378
6230
  );
6379
6231
  };
6380
- Menu.displayName = "Menu";
6232
+ FormComponent.displayName = "Form";
6233
+ var Form = forwardRef7(FormComponent);
6234
+
6235
+ // src/components/Form/useFormState.tsx
6236
+ import { useCallback as useCallback2, useState as useState5 } from "react";
6237
+ var useFormState = (action, initialData = {}) => {
6238
+ const [data, setData] = useState5(initialData);
6239
+ const [isPending, setIsPending] = useState5(false);
6240
+ const [error, setError] = useState5(null);
6241
+ const formAction = useCallback2(
6242
+ async (nextFormData) => {
6243
+ if (nextFormData === null) {
6244
+ setData(initialData);
6245
+ setError(null);
6246
+ return;
6247
+ }
6248
+ const nextData = Object.fromEntries(nextFormData.entries());
6249
+ setIsPending(true);
6250
+ try {
6251
+ const result = await action(data, nextData);
6252
+ setData(result);
6253
+ } catch (err) {
6254
+ setError(err);
6255
+ } finally {
6256
+ setIsPending(false);
6257
+ }
6258
+ },
6259
+ [action, initialData, data]
6260
+ );
6261
+ return [
6262
+ {
6263
+ data,
6264
+ error
6265
+ },
6266
+ formAction,
6267
+ isPending
6268
+ ];
6269
+ };
6381
6270
 
6382
- // src/components/Menu/MenuLabel.tsx
6271
+ // src/components/Form/FormErrorSummary.tsx
6272
+ import { useContext as useContext2, useRef as useRef3 } from "react";
6273
+ import { isArray, isNotUndefined as isNotUndefined5 } from "@wistia/type-guards";
6274
+ import { jsx as jsx172, jsxs as jsxs7 } from "react/jsx-runtime";
6275
+ var ErrorItem = ({ name, error, formId }) => {
6276
+ return /* @__PURE__ */ jsx172("li", { children: /* @__PURE__ */ jsx172(Link, { href: `${formId}-${name}`, children: error }) }, name);
6277
+ };
6278
+ var FormErrorSummary = ({ description }) => {
6279
+ const ref = useRef3(null);
6280
+ const { formId, errors, hasSubmitted } = useContext2(FormContext);
6281
+ const isValid = Object.keys(errors).length === 0;
6282
+ if (isValid || !hasSubmitted) {
6283
+ return null;
6284
+ }
6285
+ return /* @__PURE__ */ jsxs7("div", { ref, children: [
6286
+ /* @__PURE__ */ jsx172("p", { children: description }),
6287
+ /* @__PURE__ */ jsx172("ul", { children: Object.entries(errors).filter(([, error]) => isNotUndefined5(error)).map(
6288
+ ([name, error]) => isArray(error) ? error.map((err) => /* @__PURE__ */ jsx172(
6289
+ ErrorItem,
6290
+ {
6291
+ error: err,
6292
+ formId,
6293
+ name
6294
+ },
6295
+ err
6296
+ )) : /* @__PURE__ */ jsx172(
6297
+ ErrorItem,
6298
+ {
6299
+ error: error ?? "",
6300
+ formId,
6301
+ name
6302
+ },
6303
+ error
6304
+ )
6305
+ ) })
6306
+ ] });
6307
+ };
6308
+
6309
+ // src/components/FormField/FormField.tsx
6310
+ import { Children as Children2, cloneElement as cloneElement2, useContext as useContext3 } from "react";
6383
6311
  import styled19 from "styled-components";
6384
- import { DropdownMenuLabel } from "@radix-ui/react-dropdown-menu";
6312
+ import { isArray as isArray2, isNotNil as isNotNil6, isNotUndefined as isNotUndefined6, isUndefined as isUndefined4 } from "@wistia/type-guards";
6385
6313
 
6386
6314
  // src/components/Text/Text.tsx
6387
- import { forwardRef as forwardRef7 } from "react";
6388
- import styled18, { css as css17 } from "styled-components";
6315
+ import { forwardRef as forwardRef8 } from "react";
6316
+ import styled17, { css as css15 } from "styled-components";
6389
6317
  import { jsx as jsx173 } from "react/jsx-runtime";
6390
- var bodyBoldStyles = css17`
6318
+ var bodyBoldStyles = css15`
6391
6319
  > strong,
6392
6320
  b {
6393
6321
  font-weight: var(--wui-typography-weight-body-bold);
6394
6322
  }
6395
6323
  `;
6396
- var labelBoldStyles = css17`
6324
+ var labelBoldStyles = css15`
6397
6325
  > strong,
6398
6326
  b {
6399
6327
  font-weight: var(--wui-typography-weight-label-bold);
6400
6328
  }
6401
6329
  `;
6402
- var body1TextStyle = css17`
6330
+ var body1TextStyle = css15`
6403
6331
  --font-family: var(--wui-typography-body-1-family);
6404
6332
  --font-size: var(--wui-typography-body-1-size);
6405
6333
  --font-weight: var(--wui-typography-body-1-weight);
6406
6334
  --line-height: var(--wui-typography-body-1-line-height);
6407
6335
  ${bodyBoldStyles}
6408
6336
  `;
6409
- var body2TextStyle = css17`
6337
+ var body2TextStyle = css15`
6410
6338
  --font-family: var(--wui-typography-body-2-family);
6411
6339
  --font-size: var(--wui-typography-body-2-size);
6412
6340
  --font-weight: var(--wui-typography-body-2-weight);
6413
6341
  --line-height: var(--wui-typography-body-2-line-height);
6414
6342
  ${bodyBoldStyles}
6415
6343
  `;
6416
- var body3TextStyle = css17`
6344
+ var body3TextStyle = css15`
6417
6345
  --font-family: var(--wui-typography-body-3-family);
6418
6346
  --font-size: var(--wui-typography-body-3-size);
6419
6347
  --font-weight: var(--wui-typography-body-3-weight);
6420
6348
  --line-height: var(--wui-typography-body-3-line-height);
6421
6349
  ${bodyBoldStyles}
6422
6350
  `;
6423
- var body4TextStyle = css17`
6351
+ var body4TextStyle = css15`
6424
6352
  --font-family: var(--wui-typography-body-4-family);
6425
6353
  --font-size: var(--wui-typography-body-4-size);
6426
6354
  --font-weight: var(--wui-typography-body-4-weight);
6427
6355
  --line-height: var(--wui-typography-body-4-line-height);
6428
6356
  ${bodyBoldStyles}
6429
6357
  `;
6430
- var label1TextStyle = css17`
6358
+ var label1TextStyle = css15`
6431
6359
  --font-family: var(--wui-typography-label-1-family);
6432
6360
  --font-size: var(--wui-typography-label-1-size);
6433
6361
  --font-weight: var(--wui-typography-label-1-weight);
6434
6362
  --line-height: var(--wui-typography-label-1-line-height);
6435
6363
  ${labelBoldStyles}
6436
6364
  `;
6437
- var label2TextStyle = css17`
6365
+ var label2TextStyle = css15`
6438
6366
  --font-family: var(--wui-typography-label-2-family);
6439
6367
  --font-size: var(--wui-typography-label-2-size);
6440
6368
  --font-weight: var(--wui-typography-label-2-weight);
6441
6369
  --line-height: var(--wui-typography-label-2-line-height);
6442
6370
  ${labelBoldStyles}
6443
6371
  `;
6444
- var label3TextStyle = css17`
6372
+ var label3TextStyle = css15`
6445
6373
  --font-family: var(--wui-typography-label-3-family);
6446
6374
  --font-size: var(--wui-typography-label-3-size);
6447
6375
  --font-weight: var(--wui-typography-label-3-weight);
6448
6376
  --line-height: var(--wui-typography-label-3-line-height);
6449
6377
  ${labelBoldStyles}
6450
6378
  `;
6451
- var label4TextStyle = css17`
6379
+ var label4TextStyle = css15`
6452
6380
  --font-family: var(--wui-typography-label-4-family);
6453
6381
  --font-size: var(--wui-typography-label-4-size);
6454
6382
  --font-weight: var(--wui-typography-label-4-weight);
6455
6383
  --line-height: var(--wui-typography-label-4-line-height);
6456
6384
  ${labelBoldStyles}
6457
6385
  `;
6458
- var body1MonoTextStyle = css17`
6386
+ var body1MonoTextStyle = css15`
6459
6387
  ${body1TextStyle};
6460
6388
  --font-family: var(--wui-typography-family-mono);
6461
6389
  `;
6462
- var body2MonoTextStyle = css17`
6390
+ var body2MonoTextStyle = css15`
6463
6391
  ${body2TextStyle};
6464
6392
  --font-family: var(--wui-typography-family-mono);
6465
6393
  `;
6466
- var body3MonoTextStyle = css17`
6394
+ var body3MonoTextStyle = css15`
6467
6395
  ${body3TextStyle};
6468
6396
  --font-family: var(--wui-typography-family-mono);
6469
6397
  `;
6470
- var body4MonoTextStyle = css17`
6398
+ var body4MonoTextStyle = css15`
6471
6399
  ${body4TextStyle};
6472
6400
  --font-family: var(--wui-typography-family-mono);
6473
6401
  `;
@@ -6485,13 +6413,13 @@ var variantStyleMap2 = {
6485
6413
  label3: label3TextStyle,
6486
6414
  label4: label4TextStyle
6487
6415
  };
6488
- var highContrastProminenceStyle = css17`
6416
+ var highContrastProminenceStyle = css15`
6489
6417
  --text-color: var(--wui-color-text-high-contrast);
6490
6418
  `;
6491
- var vibrantProminenceStyle = css17`
6419
+ var vibrantProminenceStyle = css15`
6492
6420
  --text-color: var(--wui-color-text);
6493
6421
  `;
6494
- var secondaryProminenceStyle = css17`
6422
+ var secondaryProminenceStyle = css15`
6495
6423
  --text-color: var(--wui-color-text-secondary);
6496
6424
  `;
6497
6425
  var prominenceMap = {
@@ -6499,7 +6427,7 @@ var prominenceMap = {
6499
6427
  vibrant: vibrantProminenceStyle,
6500
6428
  secondary: secondaryProminenceStyle
6501
6429
  };
6502
- var StyledText = styled18.div`
6430
+ var StyledText = styled17.div`
6503
6431
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
6504
6432
  font-family: var(--font-family);
6505
6433
  font-size: var(--font-size);
@@ -6511,24 +6439,24 @@ var StyledText = styled18.div`
6511
6439
  ${({ $variant }) => variantStyleMap2[$variant]}
6512
6440
  ${({ $prominence }) => prominenceMap[$prominence]}
6513
6441
  ${({ $ellipsis }) => $ellipsis && ellipsisStyle};
6514
- ${({ $inline }) => $inline && css17`
6442
+ ${({ $inline }) => $inline && css15`
6515
6443
  display: inline-block;
6516
6444
  `}
6517
- ${({ $disabled }) => $disabled && css17`
6445
+ ${({ $disabled }) => $disabled && css15`
6518
6446
  --text-color: var(--wui-color-text-disabled);
6519
6447
  `}
6520
- ${({ $preventUserSelect }) => $preventUserSelect && css17`
6448
+ ${({ $preventUserSelect }) => $preventUserSelect && css15`
6521
6449
  user-select: none;
6522
6450
  `}
6523
- ${({ $align }) => css17`
6451
+ ${({ $align }) => css15`
6524
6452
  text-align: ${$align};
6525
6453
  `}
6526
- ${({ as }) => as === "p" && css17`
6454
+ ${({ as }) => as === "p" && css15`
6527
6455
  display: block;
6528
6456
  `}
6529
6457
  `;
6530
- var DEFAULT_ELEMENT2 = "div";
6531
- var TextComponent = forwardRef7(
6458
+ var DEFAULT_ELEMENT3 = "div";
6459
+ var TextComponent = forwardRef8(
6532
6460
  ({
6533
6461
  align = "left",
6534
6462
  colorScheme = "inherit",
@@ -6545,35 +6473,466 @@ var TextComponent = forwardRef7(
6545
6473
  StyledText,
6546
6474
  {
6547
6475
  ref,
6548
- $align: align,
6549
- $colorScheme: colorScheme,
6550
- $disabled: disabled,
6551
- $ellipsis: ellipsis,
6552
- $inline: inline,
6553
- $preventUserSelect: preventUserSelect,
6554
- $prominence: prominence,
6555
- $variant: variant,
6556
- as: renderAs ?? DEFAULT_ELEMENT2,
6557
- ...otherProps
6476
+ $align: align,
6477
+ $colorScheme: colorScheme,
6478
+ $disabled: disabled,
6479
+ $ellipsis: ellipsis,
6480
+ $inline: inline,
6481
+ $preventUserSelect: preventUserSelect,
6482
+ $prominence: prominence,
6483
+ $variant: variant,
6484
+ as: renderAs ?? DEFAULT_ELEMENT3,
6485
+ ...otherProps
6486
+ }
6487
+ );
6488
+ }
6489
+ );
6490
+ TextComponent.displayName = "Text";
6491
+ var Text = makePolymorphic(TextComponent);
6492
+
6493
+ // src/components/FormGroup/CheckboxGroup.tsx
6494
+ import { createContext as createContext3, useMemo as useMemo5 } from "react";
6495
+
6496
+ // src/components/FormGroup/FormGroup.tsx
6497
+ import styled18 from "styled-components";
6498
+ import { useRef as useRef4 } from "react";
6499
+ import { jsx as jsx174, jsxs as jsxs8 } from "react/jsx-runtime";
6500
+ var StyledFieldset = styled18.fieldset`
6501
+ border: 0;
6502
+ `;
6503
+ var StyledLegend = styled18.legend`
6504
+ margin-bottom: var(--space-01);
6505
+ `;
6506
+ var FormGroup = ({ children, label, ...props }) => {
6507
+ const ref = useRef4();
6508
+ return /* @__PURE__ */ jsxs8(
6509
+ Stack,
6510
+ {
6511
+ ...props,
6512
+ ref,
6513
+ renderAs: StyledFieldset,
6514
+ children: [
6515
+ /* @__PURE__ */ jsx174(
6516
+ Heading,
6517
+ {
6518
+ renderAs: StyledLegend,
6519
+ variant: "heading5",
6520
+ children: label
6521
+ }
6522
+ ),
6523
+ children
6524
+ ]
6525
+ }
6526
+ );
6527
+ };
6528
+ FormGroup.displayName = "FormGroup";
6529
+
6530
+ // src/components/FormGroup/CheckboxGroup.tsx
6531
+ import { jsx as jsx175 } from "react/jsx-runtime";
6532
+ var CheckboxGroupContext = createContext3(null);
6533
+ var CheckboxGroup = ({
6534
+ children,
6535
+ name,
6536
+ onChange,
6537
+ value,
6538
+ ...props
6539
+ }) => {
6540
+ const context = useMemo5(() => {
6541
+ return {
6542
+ name,
6543
+ onChange
6544
+ };
6545
+ }, [name, onChange]);
6546
+ return /* @__PURE__ */ jsx175(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx175(FormGroup, { ...props, children }) });
6547
+ };
6548
+ CheckboxGroup.displayName = "CheckboxGroup";
6549
+
6550
+ // src/components/FormField/FormField.tsx
6551
+ import { jsx as jsx176, jsxs as jsxs9 } from "react/jsx-runtime";
6552
+ var StyledFormField = styled19.div`
6553
+ --form-field-spacing: var(--wui-space-01);
6554
+ --form-field-error-color: var(--wui-color-text-error);
6555
+
6556
+ display: flex;
6557
+ flex-direction: column;
6558
+ gap: var(--form-field-spacing);
6559
+ `;
6560
+ var StyledErrorList = styled19.ul`
6561
+ margin: 0;
6562
+ padding: 0;
6563
+ padding-left: var(--wui-space-04);
6564
+ display: flex;
6565
+ flex-direction: column;
6566
+ gap: var(--wui-space-01);
6567
+ `;
6568
+ var ErrorMessages = ({ errors, id }) => {
6569
+ const isMultipleErrors = isArray2(errors);
6570
+ return isMultipleErrors ? /* @__PURE__ */ jsx176(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ jsx176(
6571
+ Text,
6572
+ {
6573
+ colorScheme: "error",
6574
+ id: `${id}-${index}`,
6575
+ renderAs: "li",
6576
+ variant: "label4",
6577
+ children: error
6578
+ },
6579
+ `${id}-${index}`
6580
+ )) }) : /* @__PURE__ */ jsx176(
6581
+ Text,
6582
+ {
6583
+ colorScheme: "error",
6584
+ id,
6585
+ variant: "label4",
6586
+ children: errors
6587
+ },
6588
+ id
6589
+ );
6590
+ };
6591
+ var FormField = ({
6592
+ children,
6593
+ label,
6594
+ name,
6595
+ error,
6596
+ value,
6597
+ ...props
6598
+ }) => {
6599
+ const formState = useContext3(FormContext);
6600
+ const checkboxGroup = useContext3(CheckboxGroupContext);
6601
+ const id = props.id ?? `${formState.formId}-${name}`;
6602
+ const isInlineLabel = children.type === Checkbox;
6603
+ const computedError = error ?? formState.errors[name];
6604
+ const defaultValue = formState.values[name];
6605
+ let childProps = {
6606
+ name,
6607
+ id,
6608
+ label: isInlineLabel ? label : void 0,
6609
+ ...props
6610
+ };
6611
+ if (isUndefined4(value) && isNotUndefined6(defaultValue)) {
6612
+ childProps = {
6613
+ ...childProps,
6614
+ defaultValue
6615
+ };
6616
+ }
6617
+ if (isNotNil6(checkboxGroup)) {
6618
+ const computedName = isNotNil6(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
6619
+ const handleChange = (event) => {
6620
+ if (isNotUndefined6(props.onChange)) {
6621
+ props.onChange(event);
6622
+ }
6623
+ if (isNotUndefined6(checkboxGroup.onChange)) {
6624
+ checkboxGroup.onChange(event);
6625
+ }
6626
+ };
6627
+ childProps = {
6628
+ ...childProps,
6629
+ name: computedName,
6630
+ onChange: handleChange,
6631
+ "aria-invalid": isNotNil6(error),
6632
+ "aria-describedby": isNotNil6(error) ? `${id}-error` : void 0
6633
+ };
6634
+ }
6635
+ Children2.only(children);
6636
+ return /* @__PURE__ */ jsxs9(StyledFormField, { ...props, children: [
6637
+ !isInlineLabel && /* @__PURE__ */ jsx176(Label, { htmlFor: id, children: label }),
6638
+ cloneElement2(children, childProps),
6639
+ isNotNil6(computedError) ? /* @__PURE__ */ jsx176(
6640
+ ErrorMessages,
6641
+ {
6642
+ errors: computedError,
6643
+ id: `${id}-error`
6644
+ }
6645
+ ) : null
6646
+ ] });
6647
+ };
6648
+ FormField.displayName = "FormField";
6649
+
6650
+ // src/components/IconButton/IconButton.tsx
6651
+ import { Children as Children3, cloneElement as cloneElement3, forwardRef as forwardRef9 } from "react";
6652
+ import styled21 from "styled-components";
6653
+
6654
+ // src/components/Tooltip/Tooltip.tsx
6655
+ import {
6656
+ Root,
6657
+ Content,
6658
+ Trigger,
6659
+ Portal,
6660
+ Arrow
6661
+ } from "@radix-ui/react-tooltip";
6662
+ import styled20, { css as css16 } from "styled-components";
6663
+ import { jsx as jsx177, jsxs as jsxs10 } from "react/jsx-runtime";
6664
+ var CompactTooltipStyles = css16`
6665
+ --tooltip-font-size: var(--wui-typography-label-4-size);
6666
+ --tooltip-line-height: var(--wui-typography-label-4-line-height);
6667
+ --tooltip-font-weight: var(--wui-typography-label-4-weight);
6668
+ --tooltip-horizontal-padding: var(--wui-space-02);
6669
+ --tooltip-vertical-padding: var(--wui-space-03);
6670
+ `;
6671
+ var StyledContent = styled20(Content)`
6672
+ --tooltip-font-family: var(--wui-typography-family-default);
6673
+ --tooltip-border-radius: var(--wui-border-radius-05);
6674
+ --tooltip-bg: var(--wui-color-bg-tooltip);
6675
+ --tooltip-color: var(--wui-color-text-on-fill);
6676
+ --tooltip-font-size: var(--wui-typography-label-3-size);
6677
+ --tooltip-line-height: var(--wui-typography-label-3-line-height);
6678
+ --tooltip-font-weight: var(--wui-typography-label-3-weight);
6679
+ --tooltip-horizontal-padding: var(--wui-space-03);
6680
+ --tooltip-vertical-padding: var(--wui-space-03);
6681
+
6682
+ ${({ $compact }) => Boolean($compact) && CompactTooltipStyles};
6683
+
6684
+ font-family: var(--tooltip-font-family);
6685
+ font-size: var(--tooltip-font-size);
6686
+ border-radius: var(--tooltip-border-radius);
6687
+ padding: var(--tooltip-horizontal-padding) var(--tooltip-vertical-padding);
6688
+ background-color: var(--tooltip-bg);
6689
+ color: var(--tooltip-color);
6690
+ user-select: none;
6691
+ animation-duration: 400ms;
6692
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
6693
+ will-change: transform, opacity;
6694
+ max-width: 30em;
6695
+
6696
+ &[data-state='delayed-open'][data-side='top'] {
6697
+ animation-name: slideDownAndFade;
6698
+ }
6699
+
6700
+ &[data-state='delayed-open'][data-side='right'] {
6701
+ animation-name: slideLeftAndFade;
6702
+ }
6703
+
6704
+ &[data-state='delayed-open'][data-side='bottom'] {
6705
+ animation-name: slideUpAndFade;
6706
+ }
6707
+
6708
+ &[data-state='delayed-open'][data-side='left'] {
6709
+ animation-name: slideRightAndFade;
6710
+ }
6711
+ `;
6712
+ var VISUAL_OFFSET = 6;
6713
+ var Tooltip = ({
6714
+ delay = 700,
6715
+ direction = "top",
6716
+ content,
6717
+ children,
6718
+ forceOpen,
6719
+ compact = false,
6720
+ hideArrow = false
6721
+ }) => {
6722
+ const rootProps = {};
6723
+ if (content === "" || content === null) {
6724
+ rootProps.open = false;
6725
+ }
6726
+ if (forceOpen === true) {
6727
+ rootProps.open = true;
6728
+ }
6729
+ return /* @__PURE__ */ jsxs10(
6730
+ Root,
6731
+ {
6732
+ delayDuration: delay,
6733
+ ...rootProps,
6734
+ children: [
6735
+ /* @__PURE__ */ jsx177(Trigger, { asChild: true, children }),
6736
+ /* @__PURE__ */ jsx177(Portal, { children: /* @__PURE__ */ jsxs10(
6737
+ StyledContent,
6738
+ {
6739
+ $compact: compact,
6740
+ side: direction,
6741
+ sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
6742
+ children: [
6743
+ content,
6744
+ !hideArrow ? /* @__PURE__ */ jsx177(Arrow, { asChild: true, children: /* @__PURE__ */ jsx177(
6745
+ "svg",
6746
+ {
6747
+ fill: "var(--tooltip-bg)",
6748
+ height: "8",
6749
+ style: { transform: "translateY(-2px)" },
6750
+ viewBox: "0 0 12 8",
6751
+ width: "12",
6752
+ xmlns: "http://www.w3.org/2000/svg",
6753
+ children: /* @__PURE__ */ jsx177("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" })
6754
+ }
6755
+ ) }) : null
6756
+ ]
6757
+ }
6758
+ ) })
6759
+ ]
6760
+ }
6761
+ );
6762
+ };
6763
+ Tooltip.displayName = "Tooltip";
6764
+
6765
+ // src/components/IconButton/IconButton.tsx
6766
+ import { jsx as jsx178 } from "react/jsx-runtime";
6767
+ var StyledButton2 = styled21(Button)`
6768
+ --icon-button-size-sm: 24px;
6769
+ --icon-button-size-md: 32px;
6770
+ --icon-button-size-lg: 40px;
6771
+ --icon-button-size-xl: 48px;
6772
+
6773
+ border-radius: 50%;
6774
+ height: ${({ size }) => `var(--icon-button-size-${size})`};
6775
+ width: ${({ size }) => `var(--icon-button-size-${size})`};
6776
+ display: flex;
6777
+ justify-content: center;
6778
+ align-items: center;
6779
+ line-height: 1;
6780
+ `;
6781
+ var IconButton = forwardRef9(
6782
+ ({ children, label, disableTooltip = false, size = "md", ...props }, ref) => {
6783
+ const responsiveSize = useResponsiveProp(size);
6784
+ const button = /* @__PURE__ */ jsx178(
6785
+ StyledButton2,
6786
+ {
6787
+ ...props,
6788
+ ref,
6789
+ "aria-label": label,
6790
+ "data-wistia-ui-icon-button": true,
6791
+ size: responsiveSize,
6792
+ children: cloneElement3(Children3.only(children), {
6793
+ size: responsiveSize
6794
+ })
6558
6795
  }
6559
6796
  );
6797
+ if (disableTooltip) {
6798
+ return button;
6799
+ }
6800
+ return /* @__PURE__ */ jsx178(Tooltip, { content: label, children: button });
6560
6801
  }
6561
6802
  );
6562
- TextComponent.displayName = "Text";
6563
- var Text = makePolymorphic(TextComponent);
6803
+ IconButton.displayName = "IconButton";
6804
+
6805
+ // src/components/Menu/Menu.tsx
6806
+ import styled22, { css as css17, keyframes } from "styled-components";
6807
+ import {
6808
+ DropdownMenu,
6809
+ DropdownMenuTrigger,
6810
+ DropdownMenuPortal,
6811
+ DropdownMenuContent
6812
+ } from "@radix-ui/react-dropdown-menu";
6813
+ import { isNotNil as isNotNil7, isNotUndefined as isNotUndefined7 } from "@wistia/type-guards";
6814
+ import { jsx as jsx179, jsxs as jsxs11 } from "react/jsx-runtime";
6815
+ var open = keyframes`
6816
+ from {
6817
+ opacity: 0;
6818
+ transform: scale(.97) translateY(-8px);
6819
+ }
6820
+ to {
6821
+ opacity: 1;
6822
+ transform: scale(1);
6823
+ }
6824
+ `;
6825
+ var close = keyframes`
6826
+ from {
6827
+ opacity: 1;
6828
+ transform: scale(1);
6829
+ }
6830
+ to {
6831
+ opacity: 0;
6832
+ transform: scale(.97) translateY(-8px);
6833
+ }
6834
+ `;
6835
+ var menuContentCss = css17`
6836
+ --menu-font-family: var(--wui-typography-family-default);
6837
+ --menu-bg: var(--wui-color-bg-fill-white); /* TODO - Not sure what token to use for this */
6838
+ --menu-shadow: 0 0 64px 0 rgba(0 0 0 / 8%); /* TODO - Need a box-shadow token */
6839
+ --menu-border-radius: var(--wui-border-radius-01);
6840
+ --menu-padding: var(--wui-space-03);
6841
+ --menu-min-width: 120px;
6842
+ --menu-max-width: 284px;
6843
+ --menu-zindex: 500; /* TODO - need z-index token */
6844
+
6845
+ animation: ${open}; /* TODO - need easing tokens */
6846
+ font-family: var(--menu-font-family);
6847
+ background: var(--menu-bg);
6848
+ border-radius: var(--menu-border-radius);
6849
+ box-shadow: var(--menu-shadow); /* TODO - Need a box-shadow token */
6850
+ max-height: var(--radix-dropdown-menu-content-available-height);
6851
+ min-width: var(--menu-min-width);
6852
+ max-width: var(--menu-max-width);
6853
+ overflow: auto;
6854
+ padding: var(--menu-padding);
6855
+ transform-origin: var(--radix-dropdown-menu-content-transform-origin);
6856
+ z-index: var(--menu-zindex);
6857
+
6858
+ &[data-state='closed'] {
6859
+ animation: ${close}; /* TODO - need easing tokens */
6860
+ }
6861
+
6862
+ ${mq.smAndUp} {
6863
+ bottom: 0;
6864
+ padding: var(--menu-padding);
6865
+ right: 0;
6866
+ top: 0;
6867
+ transform: initial;
6868
+ }
6869
+
6870
+ hr {
6871
+ margin: var(--wui-space-02) 0;
6872
+ }
6873
+ `;
6874
+ var MenuContent = styled22(DropdownMenuContent)`
6875
+ ${menuContentCss}
6876
+ `;
6877
+ var Menu = ({
6878
+ align = "start",
6879
+ children,
6880
+ trigger,
6881
+ label,
6882
+ isOpen,
6883
+ triggerProps = {},
6884
+ onOpenChange,
6885
+ onInteractOutside,
6886
+ ...props
6887
+ }) => {
6888
+ return /* @__PURE__ */ jsxs11(
6889
+ DropdownMenu,
6890
+ {
6891
+ modal: false,
6892
+ ...isNotNil7(onOpenChange) && isNotNil7(isOpen) ? { open: isOpen, onOpenChange } : {},
6893
+ children: [
6894
+ /* @__PURE__ */ jsx179(DropdownMenuTrigger, { asChild: true, children: isNotUndefined7(trigger) ? trigger : /* @__PURE__ */ jsx179(
6895
+ Button,
6896
+ {
6897
+ "aria-expanded": isOpen,
6898
+ forceState: isOpen ? "active" : void 0,
6899
+ rightIcon: /* @__PURE__ */ jsx179(Icon, { type: "caret-down" }),
6900
+ ...triggerProps,
6901
+ children: label
6902
+ }
6903
+ ) }),
6904
+ /* @__PURE__ */ jsx179(DropdownMenuPortal, { children: /* @__PURE__ */ jsx179(
6905
+ MenuContent,
6906
+ {
6907
+ ...props,
6908
+ align,
6909
+ onFocusOutside: (event) => {
6910
+ event.preventDefault();
6911
+ },
6912
+ sideOffset: 6,
6913
+ children
6914
+ }
6915
+ ) })
6916
+ ]
6917
+ }
6918
+ );
6919
+ };
6920
+ Menu.displayName = "Menu";
6564
6921
 
6565
6922
  // src/components/Menu/MenuLabel.tsx
6566
- import { jsx as jsx174 } from "react/jsx-runtime";
6567
- var StyledMenuLabel = styled19(DropdownMenuLabel)`
6923
+ import styled23 from "styled-components";
6924
+ import { DropdownMenuLabel } from "@radix-ui/react-dropdown-menu";
6925
+ import { jsx as jsx180 } from "react/jsx-runtime";
6926
+ var StyledMenuLabel = styled23(DropdownMenuLabel)`
6568
6927
  padding: var(--wui-space-02);
6569
6928
  `;
6570
6929
  var MenuLabel = ({ children, ...props }) => {
6571
- return /* @__PURE__ */ jsx174(
6930
+ return /* @__PURE__ */ jsx180(
6572
6931
  StyledMenuLabel,
6573
6932
  {
6574
6933
  asChild: true,
6575
6934
  ...props,
6576
- children: /* @__PURE__ */ jsx174(
6935
+ children: /* @__PURE__ */ jsx180(
6577
6936
  Text,
6578
6937
  {
6579
6938
  variant: "label3",
@@ -6587,8 +6946,8 @@ var MenuLabel = ({ children, ...props }) => {
6587
6946
  MenuLabel.displayName = "MenuLabel";
6588
6947
 
6589
6948
  // src/components/Menu/SubMenu.tsx
6590
- import { useState as useState4 } from "react";
6591
- import styled22 from "styled-components";
6949
+ import { useState as useState6 } from "react";
6950
+ import styled26 from "styled-components";
6592
6951
  import {
6593
6952
  DropdownMenuPortal as DropdownMenuPortal2,
6594
6953
  DropdownMenuSub,
@@ -6599,11 +6958,11 @@ import {
6599
6958
  } from "@radix-ui/react-dropdown-menu";
6600
6959
 
6601
6960
  // src/components/Menu/MenuItemButton.tsx
6602
- import { forwardRef as forwardRef8 } from "react";
6603
- import styled20 from "styled-components";
6604
- import { isNotNil as isNotNil7, isNotUndefined as isNotUndefined5 } from "@wistia/type-guards";
6605
- import { jsx as jsx175, jsxs as jsxs9 } from "react/jsx-runtime";
6606
- var StyledButton3 = styled20(Button)`
6961
+ import { forwardRef as forwardRef10 } from "react";
6962
+ import styled24 from "styled-components";
6963
+ import { isNotNil as isNotNil8, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
6964
+ import { jsx as jsx181, jsxs as jsxs12 } from "react/jsx-runtime";
6965
+ var StyledButton3 = styled24(Button)`
6607
6966
  --menu-item-border-radius: var(--wui-border-radius-01);
6608
6967
  --menu-item-gap: var(--wui-space-01);
6609
6968
  --menu-item-inner-gap: var(--wui-space-04);
@@ -6618,9 +6977,9 @@ var StyledButton3 = styled20(Button)`
6618
6977
  background-color: var(--menu-item-disabled-bg);
6619
6978
  }
6620
6979
 
6621
- ${({ $isGated }) => isNotUndefined5($isGated) && $isGated ? `color: var(--wui-color-text);` : ""}
6980
+ ${({ $isGated }) => isNotUndefined8($isGated) && $isGated ? `color: var(--wui-color-text);` : ""}
6622
6981
  `;
6623
- var StyledMenuContent = styled20.div`
6982
+ var StyledMenuContent = styled24.div`
6624
6983
  display: grid;
6625
6984
  grid-template-areas:
6626
6985
  'label badge'
@@ -6629,28 +6988,28 @@ var StyledMenuContent = styled20.div`
6629
6988
  position: relative;
6630
6989
  align-content: center;
6631
6990
  `;
6632
- var StyledBadgeContainer = styled20.div`
6991
+ var StyledBadgeContainer = styled24.div`
6633
6992
  grid-area: badge;
6634
6993
  align-self: start;
6635
6994
  justify-self: end;
6636
6995
  margin-left: var(--menu-item-inner-gap);
6637
6996
  `;
6638
- var MenuItemButton = forwardRef8(({ children, appearance, command, ...props }, ref) => {
6997
+ var MenuItemButton = forwardRef10(({ children, appearance, command, ...props }, ref) => {
6639
6998
  let { colorScheme, badge } = props;
6640
6999
  if (appearance === "dangerous") {
6641
- if (isNotUndefined5(colorScheme)) {
7000
+ if (isNotUndefined8(colorScheme)) {
6642
7001
  console.warn("colorScheme prop is ignored when appearance is dangerous");
6643
7002
  }
6644
7003
  colorScheme = "error";
6645
7004
  }
6646
7005
  if (appearance === "gated") {
6647
- if (isNotUndefined5(colorScheme)) {
7006
+ if (isNotUndefined8(colorScheme)) {
6648
7007
  console.warn("colorScheme prop is ignored when appearance is gated");
6649
7008
  }
6650
7009
  colorScheme = "purple";
6651
- badge = /* @__PURE__ */ jsx175(Icon, { type: "sparkle" });
7010
+ badge = /* @__PURE__ */ jsx181(Icon, { type: "sparkle" });
6652
7011
  }
6653
- return /* @__PURE__ */ jsx175(
7012
+ return /* @__PURE__ */ jsx181(
6654
7013
  StyledButton3,
6655
7014
  {
6656
7015
  ...props,
@@ -6659,9 +7018,9 @@ var MenuItemButton = forwardRef8(({ children, appearance, command, ...props }, r
6659
7018
  colorScheme: colorScheme ?? "default",
6660
7019
  fullWidth: true,
6661
7020
  variant: "ghost",
6662
- children: /* @__PURE__ */ jsxs9(StyledMenuContent, { children: [
7021
+ children: /* @__PURE__ */ jsxs12(StyledMenuContent, { children: [
6663
7022
  children,
6664
- isNotNil7(badge) || isNotNil7(command) ? /* @__PURE__ */ jsx175(StyledBadgeContainer, { children: badge ?? command }) : null
7023
+ isNotNil8(badge) || isNotNil8(command) ? /* @__PURE__ */ jsx181(StyledBadgeContainer, { children: badge ?? command }) : null
6665
7024
  ] })
6666
7025
  }
6667
7026
  );
@@ -6669,12 +7028,12 @@ var MenuItemButton = forwardRef8(({ children, appearance, command, ...props }, r
6669
7028
  MenuItemButton.displayName = "MenuItemButton";
6670
7029
 
6671
7030
  // src/components/Menu/MenuItemLabelDescription.tsx
6672
- import styled21 from "styled-components";
6673
- import { jsx as jsx176 } from "react/jsx-runtime";
6674
- var StyledMenuItemLabel = styled21(Text).attrs({ variant: "label3" })`
7031
+ import styled25 from "styled-components";
7032
+ import { jsx as jsx182 } from "react/jsx-runtime";
7033
+ var StyledMenuItemLabel = styled25(Text).attrs({ variant: "label3" })`
6675
7034
  grid-area: label;
6676
7035
  `;
6677
- var StyledMenuItemDescription = styled21(Text).attrs({
7036
+ var StyledMenuItemDescription = styled25(Text).attrs({
6678
7037
  variant: "label4",
6679
7038
  prominence: "secondary"
6680
7039
  })`
@@ -6682,15 +7041,15 @@ var StyledMenuItemDescription = styled21(Text).attrs({
6682
7041
  grid-area: description;
6683
7042
  `;
6684
7043
  var MenuItemLabel = ({ children }) => {
6685
- return /* @__PURE__ */ jsx176(StyledMenuItemLabel, { children });
7044
+ return /* @__PURE__ */ jsx182(StyledMenuItemLabel, { children });
6686
7045
  };
6687
7046
  var MenuItemDescription = ({ children }) => {
6688
- return /* @__PURE__ */ jsx176(StyledMenuItemDescription, { children });
7047
+ return /* @__PURE__ */ jsx182(StyledMenuItemDescription, { children });
6689
7048
  };
6690
7049
 
6691
7050
  // src/components/Menu/SubMenu.tsx
6692
- import { jsx as jsx177, jsxs as jsxs10 } from "react/jsx-runtime";
6693
- var SubMenuContent = styled22(DropdownMenuSubContent)`
7051
+ import { jsx as jsx183, jsxs as jsxs13 } from "react/jsx-runtime";
7052
+ var SubMenuContent = styled26(DropdownMenuSubContent)`
6694
7053
  ${menuContentCss}
6695
7054
  width: 298px;
6696
7055
 
@@ -6698,10 +7057,10 @@ var SubMenuContent = styled22(DropdownMenuSubContent)`
6698
7057
  transform: translateX(-100%) !important;
6699
7058
  }
6700
7059
  `;
6701
- var StyledMobileSubMenuItems = styled22.div`
7060
+ var StyledMobileSubMenuItems = styled26.div`
6702
7061
  margin-left: var(--wui-space-04);
6703
7062
  `;
6704
- var StyledSubTrigger = styled22(DropdownMenuSubTrigger)`
7063
+ var StyledSubTrigger = styled26(DropdownMenuSubTrigger)`
6705
7064
  outline: none;
6706
7065
 
6707
7066
  &[data-state='open'],
@@ -6712,11 +7071,11 @@ var StyledSubTrigger = styled22(DropdownMenuSubTrigger)`
6712
7071
  var SubMenuTrigger = (props) => {
6713
7072
  const { isSmAndUp } = useMq();
6714
7073
  const Trigger2 = isSmAndUp ? StyledSubTrigger : DropdownMenuItem;
6715
- return /* @__PURE__ */ jsx177(Trigger2, { asChild: true, children: /* @__PURE__ */ jsx177(
7074
+ return /* @__PURE__ */ jsx183(Trigger2, { asChild: true, children: /* @__PURE__ */ jsx183(
6716
7075
  MenuItemButton,
6717
7076
  {
6718
7077
  ...props,
6719
- rightIcon: /* @__PURE__ */ jsx177(Icon, { type: "caret-right" })
7078
+ rightIcon: /* @__PURE__ */ jsx183(Icon, { type: "caret-right" })
6720
7079
  }
6721
7080
  ) });
6722
7081
  };
@@ -6728,15 +7087,15 @@ var SubMenu = ({
6728
7087
  ...props
6729
7088
  }) => {
6730
7089
  const { isSmAndUp } = useMq();
6731
- const [isExpanded, setIsExpanded] = useState4(false);
6732
- return isSmAndUp ? /* @__PURE__ */ jsxs10(DropdownMenuSub, { onOpenChange, children: [
6733
- /* @__PURE__ */ jsxs10(SubMenuTrigger, { ...props, children: [
6734
- /* @__PURE__ */ jsx177(MenuItemLabel, { children: label }),
6735
- /* @__PURE__ */ jsx177(MenuItemDescription, { children: description })
7090
+ const [isExpanded, setIsExpanded] = useState6(false);
7091
+ return isSmAndUp ? /* @__PURE__ */ jsxs13(DropdownMenuSub, { onOpenChange, children: [
7092
+ /* @__PURE__ */ jsxs13(SubMenuTrigger, { ...props, children: [
7093
+ /* @__PURE__ */ jsx183(MenuItemLabel, { children: label }),
7094
+ /* @__PURE__ */ jsx183(MenuItemDescription, { children: description })
6736
7095
  ] }),
6737
- /* @__PURE__ */ jsx177(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx177(SubMenuContent, { children }) })
6738
- ] }) : /* @__PURE__ */ jsxs10(DropdownMenuGroup, { children: [
6739
- /* @__PURE__ */ jsxs10(
7096
+ /* @__PURE__ */ jsx183(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx183(SubMenuContent, { children }) })
7097
+ ] }) : /* @__PURE__ */ jsxs13(DropdownMenuGroup, { children: [
7098
+ /* @__PURE__ */ jsxs13(
6740
7099
  SubMenuTrigger,
6741
7100
  {
6742
7101
  ...props,
@@ -6745,28 +7104,28 @@ var SubMenu = ({
6745
7104
  setIsExpanded((prev) => !prev);
6746
7105
  },
6747
7106
  children: [
6748
- /* @__PURE__ */ jsx177(MenuItemLabel, { children: label }),
6749
- /* @__PURE__ */ jsx177(MenuItemDescription, { children: description })
7107
+ /* @__PURE__ */ jsx183(MenuItemLabel, { children: label }),
7108
+ /* @__PURE__ */ jsx183(MenuItemDescription, { children: description })
6750
7109
  ]
6751
7110
  }
6752
7111
  ),
6753
- /* @__PURE__ */ jsx177(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
7112
+ /* @__PURE__ */ jsx183(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
6754
7113
  ] });
6755
7114
  };
6756
7115
  SubMenu.displayName = "SubMenu";
6757
7116
 
6758
7117
  // src/components/Menu/MenuItem.tsx
6759
- import { forwardRef as forwardRef9 } from "react";
7118
+ import { forwardRef as forwardRef11 } from "react";
6760
7119
  import { DropdownMenuItem as DropdownMenuItem2 } from "@radix-ui/react-dropdown-menu";
6761
- import { jsx as jsx178 } from "react/jsx-runtime";
6762
- var MenuItem = forwardRef9(
7120
+ import { jsx as jsx184 } from "react/jsx-runtime";
7121
+ var MenuItem = forwardRef11(
6763
7122
  ({ onSelect = () => null, ...props }, ref) => {
6764
- return /* @__PURE__ */ jsx178(
7123
+ return /* @__PURE__ */ jsx184(
6765
7124
  DropdownMenuItem2,
6766
7125
  {
6767
7126
  asChild: true,
6768
7127
  onSelect,
6769
- children: /* @__PURE__ */ jsx178(
7128
+ children: /* @__PURE__ */ jsx184(
6770
7129
  MenuItemButton,
6771
7130
  {
6772
7131
  ...props,
@@ -6784,10 +7143,10 @@ MenuItem.displayName = "MenuItem";
6784
7143
  import {
6785
7144
  DropdownMenuRadioGroup
6786
7145
  } from "@radix-ui/react-dropdown-menu";
6787
- import { jsx as jsx179, jsxs as jsxs11 } from "react/jsx-runtime";
7146
+ import { jsx as jsx185, jsxs as jsxs14 } from "react/jsx-runtime";
6788
7147
  var MenuRadioGroup = ({ children, label, ...props }) => {
6789
- return /* @__PURE__ */ jsxs11(DropdownMenuRadioGroup, { ...props, children: [
6790
- /* @__PURE__ */ jsx179(MenuLabel, { children: label }),
7148
+ return /* @__PURE__ */ jsxs14(DropdownMenuRadioGroup, { ...props, children: [
7149
+ /* @__PURE__ */ jsx185(MenuLabel, { children: label }),
6791
7150
  children
6792
7151
  ] });
6793
7152
  };
@@ -6798,11 +7157,11 @@ import {
6798
7157
  DropdownMenuItemIndicator,
6799
7158
  DropdownMenuRadioItem
6800
7159
  } from "@radix-ui/react-dropdown-menu";
6801
- import { jsx as jsx180 } from "react/jsx-runtime";
7160
+ import { jsx as jsx186 } from "react/jsx-runtime";
6802
7161
  var RadioMenuItem = ({
6803
7162
  onSelect,
6804
7163
  value,
6805
- indicator = /* @__PURE__ */ jsx180(
7164
+ indicator = /* @__PURE__ */ jsx186(
6806
7165
  Icon,
6807
7166
  {
6808
7167
  size: "sm",
@@ -6812,16 +7171,16 @@ var RadioMenuItem = ({
6812
7171
  ...props
6813
7172
  }) => {
6814
7173
  const extraProps = onSelect ? { onSelect } : {};
6815
- return /* @__PURE__ */ jsx180(
7174
+ return /* @__PURE__ */ jsx186(
6816
7175
  DropdownMenuRadioItem,
6817
7176
  {
6818
7177
  ...extraProps,
6819
7178
  value,
6820
- children: /* @__PURE__ */ jsx180(
7179
+ children: /* @__PURE__ */ jsx186(
6821
7180
  MenuItemButton,
6822
7181
  {
6823
7182
  ...props,
6824
- rightIcon: /* @__PURE__ */ jsx180(DropdownMenuItemIndicator, { children: indicator })
7183
+ rightIcon: /* @__PURE__ */ jsx186(DropdownMenuItemIndicator, { children: indicator })
6825
7184
  }
6826
7185
  )
6827
7186
  }
@@ -6831,41 +7190,88 @@ RadioMenuItem.displayName = "RadioMenuItem";
6831
7190
 
6832
7191
  // src/components/Menu/CheckboxMenuItem.tsx
6833
7192
  import {
6834
- DropdownMenuItemIndicator as DropdownMenuItemIndicator2,
6835
7193
  DropdownMenuCheckboxItem
6836
7194
  } from "@radix-ui/react-dropdown-menu";
6837
- import { jsx as jsx181 } from "react/jsx-runtime";
7195
+ import { jsx as jsx187, jsxs as jsxs15 } from "react/jsx-runtime";
7196
+ var CheckboxIndicator2 = ({ checked, ...props }) => {
7197
+ return checked ? /* @__PURE__ */ jsxs15(
7198
+ "svg",
7199
+ {
7200
+ ...props,
7201
+ fill: "none",
7202
+ height: "16",
7203
+ viewBox: "0 0 16 16",
7204
+ width: "16",
7205
+ xmlns: "http://www.w3.org/2000/svg",
7206
+ children: [
7207
+ /* @__PURE__ */ jsx187(
7208
+ "path",
7209
+ {
7210
+ d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z",
7211
+ fill: "#2949E5"
7212
+ }
7213
+ ),
7214
+ /* @__PURE__ */ jsx187(
7215
+ "path",
7216
+ {
7217
+ d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z",
7218
+ stroke: "#D9D9DE"
7219
+ }
7220
+ ),
7221
+ /* @__PURE__ */ jsx187(
7222
+ "path",
7223
+ {
7224
+ d: "M6.47275 11.1931L3.3775 8.08009C3.19155 7.89306 3.19155 7.58982 3.3775 7.40278L4.05092 6.72547C4.23688 6.53842 4.53841 6.53842 4.72436 6.72547L6.80947 8.82254L11.2755 4.33082C11.4615 4.1438 11.763 4.1438 11.949 4.33082L12.6224 5.00813C12.8083 5.19516 12.8083 5.4984 12.6224 5.68544L7.14618 11.1931C6.96021 11.3802 6.6587 11.3802 6.47275 11.1931Z",
7225
+ fill: "white"
7226
+ }
7227
+ )
7228
+ ]
7229
+ }
7230
+ ) : /* @__PURE__ */ jsxs15(
7231
+ "svg",
7232
+ {
7233
+ ...props,
7234
+ fill: "none",
7235
+ height: "16",
7236
+ viewBox: "0 0 16 16",
7237
+ width: "16",
7238
+ xmlns: "http://www.w3.org/2000/svg",
7239
+ children: [
7240
+ /* @__PURE__ */ jsx187(
7241
+ "path",
7242
+ {
7243
+ d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z",
7244
+ fill: "#FCFCFD"
7245
+ }
7246
+ ),
7247
+ /* @__PURE__ */ jsx187(
7248
+ "path",
7249
+ {
7250
+ d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z",
7251
+ stroke: "#D9D9DE"
7252
+ }
7253
+ )
7254
+ ]
7255
+ }
7256
+ );
7257
+ };
6838
7258
  var CheckboxMenuItem = ({
6839
- onSelect,
7259
+ onSelect = () => null,
6840
7260
  checked,
6841
7261
  onCheckedChange,
6842
- indicator = /* @__PURE__ */ jsx181(
6843
- Icon,
6844
- {
6845
- size: "sm",
6846
- type: "checkmark"
6847
- }
6848
- ),
6849
7262
  ...props
6850
7263
  }) => {
6851
- let extraProps = {};
6852
- if (onSelect) {
6853
- extraProps = {
6854
- ...extraProps,
6855
- onCheckedChange,
6856
- onSelect
6857
- };
6858
- }
6859
- return /* @__PURE__ */ jsx181(
7264
+ return /* @__PURE__ */ jsx187(
6860
7265
  DropdownMenuCheckboxItem,
6861
7266
  {
6862
- ...extraProps,
6863
7267
  checked,
6864
- children: /* @__PURE__ */ jsx181(
7268
+ onCheckedChange,
7269
+ onSelect,
7270
+ children: /* @__PURE__ */ jsx187(
6865
7271
  MenuItemButton,
6866
7272
  {
6867
7273
  ...props,
6868
- rightIcon: /* @__PURE__ */ jsx181(DropdownMenuItemIndicator2, { children: indicator })
7274
+ leftIcon: /* @__PURE__ */ jsx187(CheckboxIndicator2, { checked })
6869
7275
  }
6870
7276
  )
6871
7277
  }
@@ -6874,17 +7280,16 @@ var CheckboxMenuItem = ({
6874
7280
  CheckboxMenuItem.displayName = "CheckboxMenuItem";
6875
7281
 
6876
7282
  // src/components/Radio/Radio.tsx
6877
- import { forwardRef as forwardRef10, useId as useId2 } from "react";
6878
- import styled23, { css as css18 } from "styled-components";
7283
+ import { forwardRef as forwardRef12, useId as useId3 } from "react";
7284
+ import styled27, { css as css18 } from "styled-components";
6879
7285
  import { isNonEmptyString as isNonEmptyString3 } from "@wistia/type-guards";
6880
- import { jsx as jsx182, jsxs as jsxs12 } from "react/jsx-runtime";
6881
- var StyledLabelWrapper2 = styled23.div`
7286
+ import { jsx as jsx188, jsxs as jsxs16 } from "react/jsx-runtime";
7287
+ var StyledLabelWrapper2 = styled27.div`
6882
7288
  display: flex;
6883
7289
  flex-direction: column;
6884
7290
  padding-left: var(--wui-space-02);
6885
7291
  `;
6886
- var StyledRadio = styled23.input`
6887
- align-self: flex-start;
7292
+ var StyledRadio = styled27.input`
6888
7293
  box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
6889
7294
  appearance: none;
6890
7295
  margin: 0;
@@ -6894,7 +7299,6 @@ var StyledRadio = styled23.input`
6894
7299
  height: 14px;
6895
7300
  border: 1px solid var(--wui-color-border);
6896
7301
  border-radius: 50%;
6897
- transform: translateY(5px); /* visually center the radio button */
6898
7302
  display: grid;
6899
7303
  place-content: center;
6900
7304
 
@@ -6927,8 +7331,8 @@ var defaultHoverStyle = css18`
6927
7331
  /* TODO Lamp to design hover state */
6928
7332
  cursor: pointer;
6929
7333
  `;
6930
- var StyledRadioWrapper = styled23.div`
6931
- align-items: center;
7334
+ var StyledRadioWrapper = styled27.div`
7335
+ align-items: baseline;
6932
7336
  border: 1px solid transparent;
6933
7337
  border-radius: 4px;
6934
7338
  display: flex;
@@ -6944,14 +7348,16 @@ var StyledRadioWrapper = styled23.div`
6944
7348
  background-color: #efefef;
6945
7349
  }
6946
7350
 
6947
- ${({ hasError }) => hasError && errorStyle};
7351
+ &[aria-invalid='true'] {
7352
+ ${errorStyle};
7353
+ }
7354
+
6948
7355
  ${({ disabled }) => disabled && disabledStyle2};
6949
7356
  `;
6950
- var Radio = forwardRef10(
7357
+ var Radio = forwardRef12(
6951
7358
  ({
6952
7359
  checked,
6953
7360
  disabled = false,
6954
- hasError = false,
6955
7361
  id,
6956
7362
  label,
6957
7363
  description,
@@ -6961,22 +7367,22 @@ var Radio = forwardRef10(
6961
7367
  value = "false",
6962
7368
  ...otherProps
6963
7369
  }, ref) => {
6964
- const generatedId = useId2();
6965
- const computedId = isNonEmptyString3(id) ? id : `vhs-radio-${generatedId}`;
6966
- return /* @__PURE__ */ jsxs12(
7370
+ const generatedId = useId3();
7371
+ const computedId = isNonEmptyString3(id) ? id : `ui-radio-${generatedId}`;
7372
+ return /* @__PURE__ */ jsxs16(
6967
7373
  StyledRadioWrapper,
6968
7374
  {
7375
+ "aria-invalid": otherProps["aria-invalid"],
6969
7376
  disabled,
6970
- hasError,
6971
7377
  children: [
6972
- /* @__PURE__ */ jsx182(
7378
+ /* @__PURE__ */ jsx188(
6973
7379
  StyledRadio,
6974
7380
  {
6975
7381
  ref,
6976
7382
  "aria-checked": checked,
6977
7383
  checked,
6978
7384
  disabled,
6979
- id,
7385
+ id: computedId,
6980
7386
  name,
6981
7387
  onChange,
6982
7388
  type: "radio",
@@ -6984,8 +7390,8 @@ var Radio = forwardRef10(
6984
7390
  ...otherProps
6985
7391
  }
6986
7392
  ),
6987
- /* @__PURE__ */ jsxs12(StyledLabelWrapper2, { children: [
6988
- /* @__PURE__ */ jsx182(
7393
+ /* @__PURE__ */ jsxs16(StyledLabelWrapper2, { children: [
7394
+ /* @__PURE__ */ jsx188(
6989
7395
  Label,
6990
7396
  {
6991
7397
  disabled,
@@ -6994,7 +7400,7 @@ var Radio = forwardRef10(
6994
7400
  children: label
6995
7401
  }
6996
7402
  ),
6997
- /* @__PURE__ */ jsx182(LabelDescription, { children: description })
7403
+ /* @__PURE__ */ jsx188(LabelDescription, { children: description })
6998
7404
  ] })
6999
7405
  ]
7000
7406
  }
@@ -7004,11 +7410,11 @@ var Radio = forwardRef10(
7004
7410
  Radio.displayName = "Radio";
7005
7411
 
7006
7412
  // src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
7007
- import styled24 from "styled-components";
7008
- import { isNotNil as isNotNil8 } from "@wistia/type-guards";
7009
- import { jsx as jsx183 } from "react/jsx-runtime";
7010
- var VisuallyHidden = styled24.div({ ...visuallyHiddenStyle });
7011
- var VisuallyHiddenButFocusable = styled24.div({
7413
+ import styled28 from "styled-components";
7414
+ import { isNotNil as isNotNil9 } from "@wistia/type-guards";
7415
+ import { jsx as jsx189 } from "react/jsx-runtime";
7416
+ var VisuallyHidden = styled28.div({ ...visuallyHiddenStyle });
7417
+ var VisuallyHiddenButFocusable = styled28.div({
7012
7418
  "&:not(:focus-within)": visuallyHiddenStyle
7013
7419
  });
7014
7420
  var ScreenReaderOnly = ({
@@ -7017,53 +7423,20 @@ var ScreenReaderOnly = ({
7017
7423
  focusable = false,
7018
7424
  ...otherProps
7019
7425
  }) => {
7020
- const accessibleText = isNotNil8(text) ? text : children;
7426
+ const accessibleText = isNotNil9(text) ? text : children;
7021
7427
  if (focusable) {
7022
- return /* @__PURE__ */ jsx183(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
7428
+ return /* @__PURE__ */ jsx189(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
7023
7429
  }
7024
- return /* @__PURE__ */ jsx183(VisuallyHidden, { ...otherProps, children: accessibleText });
7430
+ return /* @__PURE__ */ jsx189(VisuallyHidden, { ...otherProps, children: accessibleText });
7025
7431
  };
7026
7432
  ScreenReaderOnly.displayName = "ScreenReaderOnly";
7027
7433
 
7028
- // src/components/Stack/Stack.tsx
7029
- import { forwardRef as forwardRef11 } from "react";
7030
- import styled25 from "styled-components";
7031
- import { jsx as jsx184 } from "react/jsx-runtime";
7032
- var DEFAULT_ELEMENT3 = "div";
7033
- var StyledStack = styled25.div`
7034
- display: flex;
7035
- flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
7036
- gap: ${({ $gap }) => `var(--wui-${$gap})`};
7037
-
7038
- > * {
7039
- flex: 1;
7040
- }
7041
- `;
7042
- var StackComponent = forwardRef11(
7043
- ({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
7044
- const responsiveGap = useResponsiveProp(gap);
7045
- const responsiveDirection = useResponsiveProp(direction);
7046
- return /* @__PURE__ */ jsx184(
7047
- StyledStack,
7048
- {
7049
- ref,
7050
- $direction: responsiveDirection,
7051
- $gap: responsiveGap,
7052
- as: renderAs ?? DEFAULT_ELEMENT3,
7053
- ...props
7054
- }
7055
- );
7056
- }
7057
- );
7058
- StackComponent.displayName = "Stack";
7059
- var Stack = makePolymorphic(StackComponent);
7060
-
7061
7434
  // src/components/Tag/Tag.tsx
7062
- import { forwardRef as forwardRef12 } from "react";
7063
- import styled26 from "styled-components";
7064
- import { isNil as isNil10, isNotNil as isNotNil9, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
7065
- import { Fragment as Fragment2, jsx as jsx185, jsxs as jsxs13 } from "react/jsx-runtime";
7066
- var TagLabel = styled26.a`
7435
+ import { forwardRef as forwardRef13 } from "react";
7436
+ import styled29 from "styled-components";
7437
+ import { isNil as isNil10, isNotNil as isNotNil10, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
7438
+ import { Fragment as Fragment2, jsx as jsx190, jsxs as jsxs17 } from "react/jsx-runtime";
7439
+ var TagLabel = styled29.a`
7067
7440
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7068
7441
  font-size: var(--wui-typography-label-4-size);
7069
7442
  font-weight: var(--wui-typography-label-4-weight);
@@ -7091,14 +7464,14 @@ var TagLabel = styled26.a`
7091
7464
  box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
7092
7465
  }
7093
7466
  `;
7094
- var TagDivider = styled26.div`
7467
+ var TagDivider = styled29.div`
7095
7468
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7096
7469
  border-left: 1px solid var(--wui-color-border);
7097
7470
  display: flex;
7098
7471
  height: 14px;
7099
7472
  width: 1px;
7100
7473
  `;
7101
- var StyledRemoveButton = styled26.button`
7474
+ var StyledRemoveButton = styled29.button`
7102
7475
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7103
7476
  all: unset;
7104
7477
  cursor: pointer;
@@ -7126,7 +7499,7 @@ var StyledRemoveButton = styled26.button`
7126
7499
  box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
7127
7500
  }
7128
7501
  `;
7129
- var StyledTag = styled26.div`
7502
+ var StyledTag = styled29.div`
7130
7503
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7131
7504
  align-items: center;
7132
7505
  background-color: var(--wui-color-bg-surface-secondary);
@@ -7143,39 +7516,39 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
7143
7516
  "for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
7144
7517
  );
7145
7518
  }
7146
- return /* @__PURE__ */ jsxs13(Fragment2, { children: [
7147
- /* @__PURE__ */ jsx185(TagDivider, { $colorScheme: colorScheme }),
7148
- /* @__PURE__ */ jsxs13(
7519
+ return /* @__PURE__ */ jsxs17(Fragment2, { children: [
7520
+ /* @__PURE__ */ jsx190(TagDivider, { $colorScheme: colorScheme }),
7521
+ /* @__PURE__ */ jsxs17(
7149
7522
  StyledRemoveButton,
7150
7523
  {
7151
7524
  $colorScheme: colorScheme,
7152
7525
  onClick: onClickRemove,
7153
7526
  type: "button",
7154
7527
  children: [
7155
- /* @__PURE__ */ jsx185(
7528
+ /* @__PURE__ */ jsx190(
7156
7529
  Icon,
7157
7530
  {
7158
7531
  size: "sm",
7159
7532
  type: "close"
7160
7533
  }
7161
7534
  ),
7162
- /* @__PURE__ */ jsx185(ScreenReaderOnly, { children: onClickRemoveLabel })
7535
+ /* @__PURE__ */ jsx190(ScreenReaderOnly, { children: onClickRemoveLabel })
7163
7536
  ]
7164
7537
  }
7165
7538
  )
7166
7539
  ] });
7167
7540
  };
7168
- var Tag = forwardRef12(
7541
+ var Tag = forwardRef13(
7169
7542
  ({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
7170
- const labelProps = isNotNil9(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
7171
- return /* @__PURE__ */ jsxs13(
7543
+ const labelProps = isNotNil10(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
7544
+ return /* @__PURE__ */ jsxs17(
7172
7545
  StyledTag,
7173
7546
  {
7174
7547
  ref,
7175
7548
  $colorScheme: colorScheme,
7176
7549
  ...otherProps,
7177
7550
  children: [
7178
- /* @__PURE__ */ jsx185(
7551
+ /* @__PURE__ */ jsx190(
7179
7552
  TagLabel,
7180
7553
  {
7181
7554
  ...labelProps,
@@ -7183,7 +7556,7 @@ var Tag = forwardRef12(
7183
7556
  children: label
7184
7557
  }
7185
7558
  ),
7186
- /* @__PURE__ */ jsx185(
7559
+ /* @__PURE__ */ jsx190(
7187
7560
  RemoveButton,
7188
7561
  {
7189
7562
  colorScheme,
@@ -7199,26 +7572,26 @@ var Tag = forwardRef12(
7199
7572
  Tag.displayName = "Tag";
7200
7573
 
7201
7574
  // src/components/WistiaLogo/WistiaLogo.tsx
7202
- import styled27 from "styled-components";
7203
- import { isNotNil as isNotNil10 } from "@wistia/type-guards";
7204
- import { jsx as jsx186, jsxs as jsxs14 } from "react/jsx-runtime";
7575
+ import styled30 from "styled-components";
7576
+ import { isNotNil as isNotNil11 } from "@wistia/type-guards";
7577
+ import { jsx as jsx191, jsxs as jsxs18 } from "react/jsx-runtime";
7205
7578
  var renderBrandmark = (brandmarkColor, iconOnly) => {
7206
7579
  if (iconOnly) {
7207
- return /* @__PURE__ */ jsx186(
7580
+ return /* @__PURE__ */ jsx191(
7208
7581
  "g",
7209
7582
  {
7210
7583
  "data-testid": "ui-wistia-logo-brandmark",
7211
7584
  fill: brandmarkColor,
7212
- children: /* @__PURE__ */ jsx186("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
7585
+ children: /* @__PURE__ */ jsx191("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
7213
7586
  }
7214
7587
  );
7215
7588
  }
7216
- return /* @__PURE__ */ jsx186(
7589
+ return /* @__PURE__ */ jsx191(
7217
7590
  "g",
7218
7591
  {
7219
7592
  "data-testid": "ui-wistia-logo-brandmark",
7220
7593
  fill: brandmarkColor,
7221
- children: /* @__PURE__ */ jsx186("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
7594
+ children: /* @__PURE__ */ jsx191("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
7222
7595
  }
7223
7596
  );
7224
7597
  };
@@ -7226,12 +7599,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
7226
7599
  if (iconOnly) {
7227
7600
  return null;
7228
7601
  }
7229
- return /* @__PURE__ */ jsx186(
7602
+ return /* @__PURE__ */ jsx191(
7230
7603
  "g",
7231
7604
  {
7232
7605
  "data-testid": "ui-wistia-logo-logotype",
7233
7606
  fill: logotypeColor,
7234
- children: /* @__PURE__ */ jsx186("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
7607
+ children: /* @__PURE__ */ jsx191("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
7235
7608
  }
7236
7609
  );
7237
7610
  };
@@ -7241,7 +7614,7 @@ var computedViewBox = (iconOnly) => {
7241
7614
  }
7242
7615
  return "0 0 144 31.47";
7243
7616
  };
7244
- var WistiaLogoComponent = styled27.svg`
7617
+ var WistiaLogoComponent = styled30.svg`
7245
7618
  height: ${({ height }) => `${height}px`};
7246
7619
 
7247
7620
  /* ensure it will always fit on mobile */
@@ -7283,7 +7656,7 @@ var WistiaLogo = ({
7283
7656
  };
7284
7657
  const brandmarkColor = VARIANT_COLORS[variant].brandmark;
7285
7658
  const logotypeColor = VARIANT_COLORS[variant].logotype;
7286
- const Logo = /* @__PURE__ */ jsxs14(
7659
+ const Logo = /* @__PURE__ */ jsxs18(
7287
7660
  WistiaLogoComponent,
7288
7661
  {
7289
7662
  $hoverColor: hoverColor,
@@ -7293,16 +7666,37 @@ var WistiaLogo = ({
7293
7666
  xmlns: "http://www.w3.org/2000/svg",
7294
7667
  ...otherProps,
7295
7668
  children: [
7296
- /* @__PURE__ */ jsx186("title", { children: title }),
7297
- isNotNil10(description) ? /* @__PURE__ */ jsx186("desc", { children: description }) : null,
7669
+ /* @__PURE__ */ jsx191("title", { children: title }),
7670
+ isNotNil11(description) ? /* @__PURE__ */ jsx191("desc", { children: description }) : null,
7298
7671
  renderBrandmark(brandmarkColor, iconOnly),
7299
7672
  renderLogotype(logotypeColor, iconOnly)
7300
7673
  ]
7301
7674
  }
7302
7675
  );
7303
- return href !== void 0 ? /* @__PURE__ */ jsx186("a", { href, children: Logo }) : Logo;
7676
+ return href !== void 0 ? /* @__PURE__ */ jsx191("a", { href, children: Logo }) : Logo;
7304
7677
  };
7305
7678
  WistiaLogo.displayName = "WistiaLogo";
7679
+
7680
+ // src/components/FormGroup/RadioGroup.tsx
7681
+ import { createContext as createContext4, useMemo as useMemo6 } from "react";
7682
+ import { jsx as jsx192 } from "react/jsx-runtime";
7683
+ var RadioGroupContext = createContext4(null);
7684
+ var RadioGroup = ({
7685
+ children,
7686
+ name,
7687
+ onChange,
7688
+ value,
7689
+ ...props
7690
+ }) => {
7691
+ const context = useMemo6(() => {
7692
+ return {
7693
+ name,
7694
+ onChange
7695
+ };
7696
+ }, [name, onChange]);
7697
+ return /* @__PURE__ */ jsx192(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ jsx192(FormGroup, { ...props, children }) });
7698
+ };
7699
+ RadioGroup.displayName = "RadioGroup";
7306
7700
  export {
7307
7701
  Avatar,
7308
7702
  Badge,
@@ -7310,10 +7704,15 @@ export {
7310
7704
  Button,
7311
7705
  ButtonGroup,
7312
7706
  Checkbox,
7707
+ CheckboxGroup,
7313
7708
  CheckboxMenuItem,
7314
7709
  ColorSchemeWrapper,
7315
7710
  Divider,
7316
7711
  Ellipsis,
7712
+ Form,
7713
+ FormErrorSummary,
7714
+ FormField,
7715
+ FormGroup,
7317
7716
  Heading,
7318
7717
  Icon,
7319
7718
  IconButton,
@@ -7326,6 +7725,7 @@ export {
7326
7725
  MenuLabel,
7327
7726
  MenuRadioGroup,
7328
7727
  Radio,
7728
+ RadioGroup,
7329
7729
  RadioMenuItem,
7330
7730
  ScreenReaderOnly,
7331
7731
  Stack,
@@ -7343,6 +7743,7 @@ export {
7343
7743
  mq,
7344
7744
  useActiveMq,
7345
7745
  useAriaLive,
7746
+ useFormState,
7346
7747
  useMq,
7347
7748
  useWindowSize
7348
7749
  };