@wistia/ui 0.0.21 → 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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.0.21
3
+ * @license @wistia/ui v0.0.22
4
4
  *
5
5
  * Copyright (c) 2024-2024, Wistia, Inc. and its affiliates.
6
6
  *
@@ -45,10 +45,15 @@ __export(src_exports, {
45
45
  Button: () => Button,
46
46
  ButtonGroup: () => ButtonGroup,
47
47
  Checkbox: () => Checkbox,
48
+ CheckboxGroup: () => CheckboxGroup,
48
49
  CheckboxMenuItem: () => CheckboxMenuItem,
49
50
  ColorSchemeWrapper: () => ColorSchemeWrapper,
50
51
  Divider: () => Divider,
51
52
  Ellipsis: () => Ellipsis,
53
+ Form: () => Form,
54
+ FormErrorSummary: () => FormErrorSummary,
55
+ FormField: () => FormField,
56
+ FormGroup: () => FormGroup,
52
57
  Heading: () => Heading,
53
58
  Icon: () => Icon,
54
59
  IconButton: () => IconButton,
@@ -61,6 +66,7 @@ __export(src_exports, {
61
66
  MenuLabel: () => MenuLabel,
62
67
  MenuRadioGroup: () => MenuRadioGroup,
63
68
  Radio: () => Radio,
69
+ RadioGroup: () => RadioGroup,
64
70
  RadioMenuItem: () => RadioMenuItem,
65
71
  ScreenReaderOnly: () => ScreenReaderOnly,
66
72
  Stack: () => Stack,
@@ -78,6 +84,7 @@ __export(src_exports, {
78
84
  mq: () => mq,
79
85
  useActiveMq: () => useActiveMq,
80
86
  useAriaLive: () => useAriaLive,
87
+ useFormState: () => useFormState,
81
88
  useMq: () => useMq,
82
89
  useWindowSize: () => useWindowSize
83
90
  });
@@ -1187,7 +1194,7 @@ var colorAliasTokens = import_styled_components4.css`
1187
1194
 
1188
1195
  /* --- Misc --- */
1189
1196
  --wui-color-bg-fill-white: #ffffff;
1190
- --wui-color-bg-nav: var(--wui-blue-600);
1197
+ --wui-color-bg-nav: #1f3399;
1191
1198
  --wui-color-focus-color: var(--wui-blue-9);
1192
1199
  --wui-color-notification-pill-color: var(--wui-pink-9);
1193
1200
  --wui-color-overlay: var(--wui-gray-alpha-9);
@@ -5746,15 +5753,196 @@ var ButtonGroup = ({
5746
5753
  ButtonGroup.displayName = "ButtonGroup";
5747
5754
 
5748
5755
  // src/components/Checkbox/Checkbox.tsx
5749
- var import_react11 = require("react");
5756
+ var import_react12 = require("react");
5750
5757
  var import_react_checkbox = require("@radix-ui/react-checkbox");
5751
- var import_styled_components23 = __toESM(require("styled-components"));
5752
- var import_type_guards15 = require("@wistia/type-guards");
5758
+ var import_styled_components25 = __toESM(require("styled-components"));
5759
+ var import_type_guards16 = require("@wistia/type-guards");
5753
5760
 
5754
5761
  // src/components/Label/Label.tsx
5762
+ var import_styled_components23 = __toESM(require("styled-components"));
5763
+
5764
+ // src/components/Heading/Heading.tsx
5765
+ var import_react11 = require("react");
5766
+ var import_styled_components22 = __toESM(require("styled-components"));
5767
+
5768
+ // src/components/Ellipsis/Ellipsis.tsx
5769
+ var import_type_guards14 = require("@wistia/type-guards");
5755
5770
  var import_styled_components21 = __toESM(require("styled-components"));
5756
5771
  var import_jsx_runtime164 = require("react/jsx-runtime");
5757
- var requiredStyle = import_styled_components21.css`
5772
+ var ellipsisStyle = import_styled_components21.css`
5773
+ overflow: hidden;
5774
+ text-overflow: ellipsis;
5775
+ white-space: nowrap;
5776
+
5777
+ /*
5778
+ Using feature detection (i.e., -webkit-named-image) we only target Safari browsers
5779
+ with this additional styling to prevent a bug that's exclusive to Safari.
5780
+
5781
+ Note that Safari does not properly hide the truncated text for non-inline/inline-block
5782
+ elements so we need to apply display: inline to all the paragraphs in the description.
5783
+ see https://stackoverflow.com/a/70683084
5784
+ */
5785
+ @supports (background: - webkit-named-image(i)) {
5786
+ & > div > div:has(p) {
5787
+ margin-top: 16px;
5788
+ }
5789
+
5790
+ & > div > div > p {
5791
+ display: inline;
5792
+ }
5793
+ }
5794
+ `;
5795
+ var ellipsisFlexParentStyle = import_styled_components21.css`
5796
+ min-width: 0;
5797
+ `;
5798
+ var EllipsisComponent = import_styled_components21.default.div`
5799
+ ${ellipsisStyle};
5800
+ ${({ $lines }) => {
5801
+ if ((0, import_type_guards14.isNotNil)($lines)) {
5802
+ return import_styled_components21.css`
5803
+ -webkit-box-orient: vertical;
5804
+ -webkit-line-clamp: ${$lines};
5805
+ display: -webkit-box;
5806
+ white-space: initial;
5807
+ `;
5808
+ }
5809
+ return void 0;
5810
+ }}
5811
+ `;
5812
+ var Ellipsis = ({ children, lines, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
5813
+ EllipsisComponent,
5814
+ {
5815
+ $lines: lines,
5816
+ ...otherProps,
5817
+ children
5818
+ }
5819
+ );
5820
+ Ellipsis.displayName = "Ellipsis";
5821
+
5822
+ // src/private/helpers/makePolymorphic/makePolymorphic.tsx
5823
+ var makePolymorphic = (component) => {
5824
+ return component;
5825
+ };
5826
+
5827
+ // src/components/Heading/Heading.tsx
5828
+ var import_jsx_runtime165 = require("react/jsx-runtime");
5829
+ var heroStyle = import_styled_components22.css`
5830
+ --font-family: var(--wui-typography-heading-hero-family);
5831
+ --font-size: var(--wui-typography-heading-hero-size);
5832
+ --font-weight: var(--wui-typography-heading-hero-weight);
5833
+ --line-height: var(--wui-typography-heading-hero-line-height);
5834
+ `;
5835
+ var heading1TextStyle = import_styled_components22.css`
5836
+ --font-family: var(--wui-typography-heading-1-family);
5837
+ --font-size: var(--wui-typography-heading-1-size);
5838
+ --font-weight: var(--wui-typography-heading-1-weight);
5839
+ --line-height: var(--wui-typography-heading-1-line-height);
5840
+ `;
5841
+ var heading2TextStyle = import_styled_components22.css`
5842
+ --font-family: var(--wui-typography-heading-2-family);
5843
+ --font-size: var(--wui-typography-heading-2-size);
5844
+ --font-weight: var(--wui-typography-heading-2-weight);
5845
+ --line-height: var(--wui-typography-heading-2-line-height);
5846
+ `;
5847
+ var heading3TextStyle = import_styled_components22.css`
5848
+ --font-family: var(--wui-typography-heading-3-family);
5849
+ --font-size: var(--wui-typography-heading-3-size);
5850
+ --font-weight: var(--wui-typography-heading-3-weight);
5851
+ --line-height: var(--wui-typography-heading-3-line-height);
5852
+ `;
5853
+ var heading4TextStyle = import_styled_components22.css`
5854
+ --font-family: var(--wui-typography-heading-4-family);
5855
+ --font-size: var(--wui-typography-heading-4-size);
5856
+ --font-weight: var(--wui-typography-heading-4-weight);
5857
+ --line-height: var(--wui-typography-heading-4-line-height);
5858
+ `;
5859
+ var heading5TextStyle = import_styled_components22.css`
5860
+ --font-family: var(--wui-typography-heading-5-family);
5861
+ --font-size: var(--wui-typography-heading-5-size);
5862
+ --font-weight: var(--wui-typography-heading-5-weight);
5863
+ --line-height: var(--wui-typography-heading-5-line-height);
5864
+ `;
5865
+ var heading6TextStyle = import_styled_components22.css`
5866
+ --font-family: var(--wui-typography-heading-6-family);
5867
+ --font-size: var(--wui-typography-heading-6-size);
5868
+ --font-weight: var(--wui-typography-heading-6-weight);
5869
+ --line-height: var(--wui-typography-heading-6-line-height);
5870
+ `;
5871
+ var variantStyleMap = {
5872
+ hero: heroStyle,
5873
+ heading1: heading1TextStyle,
5874
+ heading2: heading2TextStyle,
5875
+ heading3: heading3TextStyle,
5876
+ heading4: heading4TextStyle,
5877
+ heading5: heading5TextStyle,
5878
+ heading6: heading6TextStyle
5879
+ };
5880
+ var DEFAULT_ELEMENT = "h1";
5881
+ var StyledHeading = import_styled_components22.default.div`
5882
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
5883
+ font-family: var(--font-family);
5884
+ font-size: var(--font-size);
5885
+ font-weight: var(--font-weight);
5886
+ line-height: var(--line-height);
5887
+ color: var(--wui-color-text);
5888
+ ${({ $variant }) => variantStyleMap[$variant]}
5889
+ ${({ $ellipsis }) => $ellipsis && ellipsisStyle};
5890
+ ${({ $inline }) => $inline && import_styled_components22.css`
5891
+ display: inline-block;
5892
+ `}
5893
+ ${({ $disabled }) => $disabled && import_styled_components22.css`
5894
+ color: var(--wui-color-text-disabled);
5895
+ `}
5896
+ ${({ $preventUserSelect }) => $preventUserSelect && import_styled_components22.css`
5897
+ user-select: none;
5898
+ `}
5899
+ ${({ $align }) => import_styled_components22.css`
5900
+ text-align: ${$align};
5901
+ `}
5902
+ margin: 0;
5903
+ `;
5904
+ var variantElementMap = {
5905
+ hero: DEFAULT_ELEMENT,
5906
+ heading1: DEFAULT_ELEMENT,
5907
+ heading2: "h2",
5908
+ heading3: "h3",
5909
+ heading4: "h4",
5910
+ heading5: "h5",
5911
+ heading6: "h6"
5912
+ };
5913
+ var HeadingComponent = (0, import_react11.forwardRef)(
5914
+ ({
5915
+ align = "left",
5916
+ colorScheme = "inherit",
5917
+ disabled = false,
5918
+ ellipsis = false,
5919
+ inline = false,
5920
+ preventUserSelect = false,
5921
+ variant = "heading1",
5922
+ renderAs,
5923
+ ...otherProps
5924
+ }, ref) => /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(
5925
+ StyledHeading,
5926
+ {
5927
+ ref,
5928
+ $align: align,
5929
+ $colorScheme: colorScheme,
5930
+ $disabled: disabled,
5931
+ $ellipsis: ellipsis,
5932
+ $inline: inline,
5933
+ $preventUserSelect: preventUserSelect,
5934
+ $variant: variant,
5935
+ as: renderAs ?? variantElementMap[variant],
5936
+ ...otherProps
5937
+ }
5938
+ )
5939
+ );
5940
+ HeadingComponent.displayName = "Heading";
5941
+ var Heading = makePolymorphic(HeadingComponent);
5942
+
5943
+ // src/components/Label/Label.tsx
5944
+ var import_jsx_runtime166 = require("react/jsx-runtime");
5945
+ var requiredStyle = import_styled_components23.css`
5758
5946
  &::after {
5759
5947
  color: var(--wui-color-text-error);
5760
5948
  display: inline;
@@ -5762,16 +5950,14 @@ var requiredStyle = import_styled_components21.css`
5762
5950
  content: '*';
5763
5951
  }
5764
5952
  `;
5765
- var disabledStyle = import_styled_components21.css`
5953
+ var disabledStyle = import_styled_components23.css`
5766
5954
  color: var(--wui-color-text-disabled);
5767
5955
  `;
5768
- var SPACE_BETWEEN_LABEL_AND_INPUT = "var(--wui-space-02)";
5769
- var StyledLabel = import_styled_components21.default.label`
5770
- display: inline-block;
5771
- font-size: var(--wui-typography-label-1-size);
5772
- font-weight: var(--wui-typography-label-1-weight);
5773
- line-height: var(--wui-typography-label-1-line-height);
5774
- cursor: inherit;
5956
+ var StyledLabel = (0, import_styled_components23.default)(Heading).attrs({
5957
+ variant: "heading6",
5958
+ renderAs: "label"
5959
+ })`
5960
+ display: block;
5775
5961
  width: 100%;
5776
5962
 
5777
5963
  /* if label is wrapping an input this ensures it appears beneath the label with a nice margin */
@@ -5779,7 +5965,6 @@ var StyledLabel = import_styled_components21.default.label`
5779
5965
  > textarea,
5780
5966
  > select {
5781
5967
  display: block;
5782
- margin-top: ${SPACE_BETWEEN_LABEL_AND_INPUT};
5783
5968
  }
5784
5969
 
5785
5970
  > label {
@@ -5787,8 +5972,8 @@ var StyledLabel = import_styled_components21.default.label`
5787
5972
  }
5788
5973
 
5789
5974
  ${({ $screenReaderOnly }) => $screenReaderOnly && visuallyHiddenStyle}
5790
- ${({ disabled }) => disabled && disabledStyle}
5791
- ${({ required }) => required && requiredStyle}
5975
+ ${({ $disabled }) => $disabled && disabledStyle}
5976
+ ${({ $required }) => $required && requiredStyle}
5792
5977
  `;
5793
5978
  var Label = ({
5794
5979
  children,
@@ -5797,24 +5982,24 @@ var Label = ({
5797
5982
  required = false,
5798
5983
  screenReaderOnly = false,
5799
5984
  ...otherProps
5800
- }) => /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
5985
+ }) => /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
5801
5986
  StyledLabel,
5802
5987
  {
5988
+ ...otherProps,
5989
+ $disabled: disabled,
5990
+ $required: required,
5803
5991
  $screenReaderOnly: screenReaderOnly,
5804
- disabled,
5805
5992
  htmlFor,
5806
- required,
5807
- ...otherProps,
5808
5993
  children
5809
5994
  }
5810
5995
  );
5811
5996
  Label.displayName = "Label";
5812
5997
 
5813
5998
  // src/components/Label/LabelDescription.tsx
5814
- var import_styled_components22 = __toESM(require("styled-components"));
5815
- var import_type_guards14 = require("@wistia/type-guards");
5816
- var import_jsx_runtime165 = require("react/jsx-runtime");
5817
- var StyledLabelDescription = import_styled_components22.default.div`
5999
+ var import_styled_components24 = __toESM(require("styled-components"));
6000
+ var import_type_guards15 = require("@wistia/type-guards");
6001
+ var import_jsx_runtime167 = require("react/jsx-runtime");
6002
+ var StyledLabelDescription = import_styled_components24.default.div`
5818
6003
  color: var(--wui-color-text-secondary);
5819
6004
  font-size: var(--wui-typography-body-4-size);
5820
6005
  font-weight: var(--wui-typography-body-4-weight);
@@ -5824,16 +6009,16 @@ var LabelDescription = ({
5824
6009
  children,
5825
6010
  ...props
5826
6011
  }) => {
5827
- if ((0, import_type_guards14.isNil)(children)) {
6012
+ if ((0, import_type_guards15.isNil)(children)) {
5828
6013
  return null;
5829
6014
  }
5830
- return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(StyledLabelDescription, { ...props, children });
6015
+ return /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(StyledLabelDescription, { ...props, children });
5831
6016
  };
5832
6017
  LabelDescription.displayName = "LabelDescription";
5833
6018
 
5834
6019
  // src/components/Checkbox/Checkbox.tsx
5835
- var import_jsx_runtime166 = require("react/jsx-runtime");
5836
- var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
6020
+ var import_jsx_runtime168 = require("react/jsx-runtime");
6021
+ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
5837
6022
  "svg",
5838
6023
  {
5839
6024
  fill: "inherit",
@@ -5841,7 +6026,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
5841
6026
  viewBox: "0 0 10 8",
5842
6027
  width: "10",
5843
6028
  xmlns: "http://www.w3.org/2000/svg",
5844
- children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
6029
+ children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
5845
6030
  "path",
5846
6031
  {
5847
6032
  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",
@@ -5850,11 +6035,10 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
5850
6035
  )
5851
6036
  }
5852
6037
  );
5853
- var StyledCheckboxWrapper = import_styled_components23.default.div`
6038
+ var StyledCheckboxWrapper = import_styled_components25.default.div`
5854
6039
  display: flex;
5855
6040
  align-items: center;
5856
6041
  cursor: pointer;
5857
- padding: var(--wui-space-02);
5858
6042
 
5859
6043
  &:hover {
5860
6044
  /* TODO Lamp to design hover state */
@@ -5865,7 +6049,7 @@ var StyledCheckboxWrapper = import_styled_components23.default.div`
5865
6049
  background-color: #efefef;
5866
6050
  }
5867
6051
  `;
5868
- var StyledCheckboxRoot = (0, import_styled_components23.default)(import_react_checkbox.Root)`
6052
+ var StyledCheckboxRoot = (0, import_styled_components25.default)(import_react_checkbox.Root)`
5869
6053
  all: unset; /* CheckboxRoot renders as a button element, so we need to reset all styles */
5870
6054
  background-color: var(--wui-color-bg-fill-white);
5871
6055
  min-width: 16px;
@@ -5878,7 +6062,6 @@ var StyledCheckboxRoot = (0, import_styled_components23.default)(import_react_ch
5878
6062
  align-items: center;
5879
6063
  justify-content: center;
5880
6064
  align-self: start; /* align to the top to handle label descriptions */
5881
- margin-top: 3px; /* bump down slightly to mimic "align-self: center" */
5882
6065
 
5883
6066
  &[data-state='checked'] {
5884
6067
  background-color: var(--wui-color-bg-fill);
@@ -5900,21 +6083,21 @@ var StyledCheckboxRoot = (0, import_styled_components23.default)(import_react_ch
5900
6083
  /* TODO Lamp to design focus state */
5901
6084
  }
5902
6085
  `;
5903
- var StyledCheckboxIndicator = (0, import_styled_components23.default)(import_react_checkbox.Indicator)`
6086
+ var StyledCheckboxIndicator = (0, import_styled_components25.default)(import_react_checkbox.Indicator)`
5904
6087
  display: flex;
5905
6088
  `;
5906
- var StyledLabelWrapper = import_styled_components23.default.div`
6089
+ var StyledLabelWrapper = import_styled_components25.default.div`
5907
6090
  display: flex;
5908
6091
  flex-direction: column;
5909
- padding-left: var(--wui-space-02);
6092
+ margin-left: var(--wui-space-02);
5910
6093
  `;
5911
- var Checkbox = (0, import_react11.forwardRef)(
6094
+ var Checkbox = (0, import_react12.forwardRef)(
5912
6095
  ({
5913
6096
  checked,
5914
6097
  disabled = false,
5915
6098
  forceState,
5916
6099
  id,
5917
- label = "default",
6100
+ label,
5918
6101
  description,
5919
6102
  name,
5920
6103
  onChange,
@@ -5922,13 +6105,14 @@ var Checkbox = (0, import_react11.forwardRef)(
5922
6105
  value = "false",
5923
6106
  ...otherProps
5924
6107
  }, ref) => {
5925
- const generatedId = (0, import_react11.useId)();
5926
- const computedId = (0, import_type_guards15.isNonEmptyString)(id) ? id : `ui-checkbox-${generatedId}`;
5927
- return /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(StyledCheckboxWrapper, { children: [
5928
- /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
6108
+ const generatedId = (0, import_react12.useId)();
6109
+ const computedId = (0, import_type_guards16.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-group-${generatedId}`;
6110
+ return /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)(StyledCheckboxWrapper, { children: [
6111
+ /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
5929
6112
  StyledCheckboxRoot,
5930
6113
  {
5931
6114
  ref,
6115
+ "aria-label": label,
5932
6116
  checked: checked ?? void 0,
5933
6117
  defaultChecked: checked === void 0 ? false : void 0,
5934
6118
  disabled,
@@ -5938,6 +6122,7 @@ var Checkbox = (0, import_react11.forwardRef)(
5938
6122
  if (onChange) {
5939
6123
  const syntheticEvent = {
5940
6124
  target: {
6125
+ name,
5941
6126
  id: computedId,
5942
6127
  checked: state === true
5943
6128
  }
@@ -5948,11 +6133,11 @@ var Checkbox = (0, import_react11.forwardRef)(
5948
6133
  required,
5949
6134
  value,
5950
6135
  ...otherProps,
5951
- children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(StyledCheckboxIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(CheckIcon, {}) })
6136
+ children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(StyledCheckboxIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(CheckIcon, {}) })
5952
6137
  }
5953
6138
  ),
5954
- /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(StyledLabelWrapper, { children: [
5955
- /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
6139
+ /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)(StyledLabelWrapper, { children: [
6140
+ /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
5956
6141
  Label,
5957
6142
  {
5958
6143
  disabled,
@@ -5961,7 +6146,7 @@ var Checkbox = (0, import_react11.forwardRef)(
5961
6146
  children: label
5962
6147
  }
5963
6148
  ),
5964
- /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(LabelDescription, { children: description })
6149
+ /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(LabelDescription, { children: description })
5965
6150
  ] })
5966
6151
  ] });
5967
6152
  }
@@ -5969,13 +6154,13 @@ var Checkbox = (0, import_react11.forwardRef)(
5969
6154
  Checkbox.displayName = "Checkbox";
5970
6155
 
5971
6156
  // src/components/Divider/Divider.tsx
5972
- var import_styled_components24 = __toESM(require("styled-components"));
5973
- var import_jsx_runtime167 = require("react/jsx-runtime");
6157
+ var import_styled_components26 = __toESM(require("styled-components"));
6158
+ var import_jsx_runtime169 = require("react/jsx-runtime");
5974
6159
  var sizeToPixelMap = {
5975
6160
  lg: 4,
5976
6161
  sm: 1
5977
6162
  };
5978
- var DividerComponent = import_styled_components24.default.hr`
6163
+ var DividerComponent = import_styled_components26.default.hr`
5979
6164
  background: none;
5980
6165
  border-bottom: none;
5981
6166
  border-left: none;
@@ -5990,7 +6175,7 @@ var DividerComponent = import_styled_components24.default.hr`
5990
6175
  `;
5991
6176
  var Divider = ({ size = "sm", ...otherProps }) => {
5992
6177
  const responsiveSize = useResponsiveProp(size);
5993
- return /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(
6178
+ return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
5994
6179
  DividerComponent,
5995
6180
  {
5996
6181
  $borderHeight: sizeToPixelMap[responsiveSize],
@@ -6000,535 +6185,299 @@ var Divider = ({ size = "sm", ...otherProps }) => {
6000
6185
  };
6001
6186
  Divider.displayName = "Divider";
6002
6187
 
6003
- // src/components/Ellipsis/Ellipsis.tsx
6004
- var import_type_guards16 = require("@wistia/type-guards");
6005
- var import_styled_components25 = __toESM(require("styled-components"));
6006
- var import_jsx_runtime168 = require("react/jsx-runtime");
6007
- var ellipsisStyle = import_styled_components25.css`
6008
- overflow: hidden;
6009
- text-overflow: ellipsis;
6010
- white-space: nowrap;
6011
-
6012
- /*
6013
- Using feature detection (i.e., -webkit-named-image) we only target Safari browsers
6014
- with this additional styling to prevent a bug that's exclusive to Safari.
6188
+ // src/components/Form/Form.tsx
6189
+ var import_react14 = require("react");
6190
+ var import_styled_components28 = __toESM(require("styled-components"));
6191
+ var import_type_guards17 = require("@wistia/type-guards");
6015
6192
 
6016
- Note that Safari does not properly hide the truncated text for non-inline/inline-block
6017
- elements so we need to apply display: inline to all the paragraphs in the description.
6018
- see https://stackoverflow.com/a/70683084
6019
- */
6020
- @supports (background: - webkit-named-image(i)) {
6021
- & > div > div:has(p) {
6022
- margin-top: 16px;
6023
- }
6193
+ // src/components/Stack/Stack.tsx
6194
+ var import_react13 = require("react");
6195
+ var import_styled_components27 = __toESM(require("styled-components"));
6196
+ var import_jsx_runtime170 = require("react/jsx-runtime");
6197
+ var DEFAULT_ELEMENT2 = "div";
6198
+ var StyledStack = import_styled_components27.default.div`
6199
+ display: flex;
6200
+ flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
6201
+ gap: ${({ $gap }) => `var(--wui-${$gap})`};
6024
6202
 
6025
- & > div > div > p {
6026
- display: inline;
6027
- }
6028
- }
6029
- `;
6030
- var ellipsisFlexParentStyle = import_styled_components25.css`
6031
- min-width: 0;
6032
- `;
6033
- var EllipsisComponent = import_styled_components25.default.div`
6034
- ${ellipsisStyle};
6035
- ${({ $lines }) => {
6036
- if ((0, import_type_guards16.isNotNil)($lines)) {
6037
- return import_styled_components25.css`
6038
- -webkit-box-orient: vertical;
6039
- -webkit-line-clamp: ${$lines};
6040
- display: -webkit-box;
6041
- white-space: initial;
6042
- `;
6203
+ > * {
6204
+ flex: 1;
6043
6205
  }
6044
- return void 0;
6045
- }}
6046
6206
  `;
6047
- var Ellipsis = ({ children, lines, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
6048
- EllipsisComponent,
6049
- {
6050
- $lines: lines,
6051
- ...otherProps,
6052
- children
6207
+ var StackComponent = (0, import_react13.forwardRef)(
6208
+ ({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
6209
+ const responsiveGap = useResponsiveProp(gap);
6210
+ const responsiveDirection = useResponsiveProp(direction);
6211
+ return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
6212
+ StyledStack,
6213
+ {
6214
+ ref,
6215
+ $direction: responsiveDirection,
6216
+ $gap: responsiveGap,
6217
+ as: renderAs ?? DEFAULT_ELEMENT2,
6218
+ ...props
6219
+ }
6220
+ );
6053
6221
  }
6054
6222
  );
6055
- Ellipsis.displayName = "Ellipsis";
6223
+ StackComponent.displayName = "Stack";
6224
+ var Stack = makePolymorphic(StackComponent);
6056
6225
 
6057
- // src/components/Heading/Heading.tsx
6058
- var import_react12 = require("react");
6059
- var import_styled_components26 = __toESM(require("styled-components"));
6060
-
6061
- // src/private/helpers/makePolymorphic/makePolymorphic.tsx
6062
- var makePolymorphic = (component) => {
6063
- return component;
6064
- };
6065
-
6066
- // src/components/Heading/Heading.tsx
6067
- var import_jsx_runtime169 = require("react/jsx-runtime");
6068
- var heroStyle = import_styled_components26.css`
6069
- --font-family: var(--wui-typography-heading-hero-family);
6070
- --font-size: var(--wui-typography-heading-hero-size);
6071
- --font-weight: var(--wui-typography-heading-hero-weight);
6072
- --line-height: var(--wui-typography-heading-hero-line-height);
6073
- `;
6074
- var heading1TextStyle = import_styled_components26.css`
6075
- --font-family: var(--wui-typography-heading-1-family);
6076
- --font-size: var(--wui-typography-heading-1-size);
6077
- --font-weight: var(--wui-typography-heading-1-weight);
6078
- --line-height: var(--wui-typography-heading-1-line-height);
6079
- `;
6080
- var heading2TextStyle = import_styled_components26.css`
6081
- --font-family: var(--wui-typography-heading-2-family);
6082
- --font-size: var(--wui-typography-heading-2-size);
6083
- --font-weight: var(--wui-typography-heading-2-weight);
6084
- --line-height: var(--wui-typography-heading-2-line-height);
6085
- `;
6086
- var heading3TextStyle = import_styled_components26.css`
6087
- --font-family: var(--wui-typography-heading-3-family);
6088
- --font-size: var(--wui-typography-heading-3-size);
6089
- --font-weight: var(--wui-typography-heading-3-weight);
6090
- --line-height: var(--wui-typography-heading-3-line-height);
6091
- `;
6092
- var heading4TextStyle = import_styled_components26.css`
6093
- --font-family: var(--wui-typography-heading-4-family);
6094
- --font-size: var(--wui-typography-heading-4-size);
6095
- --font-weight: var(--wui-typography-heading-4-weight);
6096
- --line-height: var(--wui-typography-heading-4-line-height);
6097
- `;
6098
- var heading5TextStyle = import_styled_components26.css`
6099
- --font-family: var(--wui-typography-heading-5-family);
6100
- --font-size: var(--wui-typography-heading-5-size);
6101
- --font-weight: var(--wui-typography-heading-5-weight);
6102
- --line-height: var(--wui-typography-heading-5-line-height);
6103
- `;
6104
- var heading6TextStyle = import_styled_components26.css`
6105
- --font-family: var(--wui-typography-heading-6-family);
6106
- --font-size: var(--wui-typography-heading-6-size);
6107
- --font-weight: var(--wui-typography-heading-6-weight);
6108
- --line-height: var(--wui-typography-heading-6-line-height);
6109
- `;
6110
- var variantStyleMap = {
6111
- hero: heroStyle,
6112
- heading1: heading1TextStyle,
6113
- heading2: heading2TextStyle,
6114
- heading3: heading3TextStyle,
6115
- heading4: heading4TextStyle,
6116
- heading5: heading5TextStyle,
6117
- heading6: heading6TextStyle
6118
- };
6119
- var DEFAULT_ELEMENT = "h1";
6120
- var StyledHeading = import_styled_components26.default.div`
6121
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
6122
- font-family: var(--font-family);
6123
- font-size: var(--font-size);
6124
- font-weight: var(--font-weight);
6125
- line-height: var(--line-height);
6126
- color: var(--wui-color-text);
6127
- ${({ $variant }) => variantStyleMap[$variant]}
6128
- ${({ $ellipsis }) => $ellipsis && ellipsisStyle};
6129
- ${({ $inline }) => $inline && import_styled_components26.css`
6130
- display: inline-block;
6131
- `}
6132
- ${({ $disabled }) => $disabled && import_styled_components26.css`
6133
- color: var(--wui-color-text-disabled);
6134
- `}
6135
- ${({ $preventUserSelect }) => $preventUserSelect && import_styled_components26.css`
6136
- user-select: none;
6137
- `}
6138
- ${({ $align }) => import_styled_components26.css`
6139
- text-align: ${$align};
6140
- `}
6141
- margin: 0;
6142
- `;
6143
- var variantElementMap = {
6144
- hero: DEFAULT_ELEMENT,
6145
- heading1: DEFAULT_ELEMENT,
6146
- heading2: "h2",
6147
- heading3: "h3",
6148
- heading4: "h4",
6149
- heading5: "h5",
6150
- heading6: "h6"
6151
- };
6152
- var HeadingComponent = (0, import_react12.forwardRef)(
6153
- ({
6154
- align = "left",
6155
- colorScheme = "inherit",
6156
- disabled = false,
6157
- ellipsis = false,
6158
- inline = false,
6159
- preventUserSelect = false,
6160
- variant = "heading1",
6161
- renderAs,
6162
- ...otherProps
6163
- }, ref) => /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
6164
- StyledHeading,
6165
- {
6166
- ref,
6167
- $align: align,
6168
- $colorScheme: colorScheme,
6169
- $disabled: disabled,
6170
- $ellipsis: ellipsis,
6171
- $inline: inline,
6172
- $preventUserSelect: preventUserSelect,
6173
- $variant: variant,
6174
- as: renderAs ?? variantElementMap[variant],
6175
- ...otherProps
6176
- }
6177
- )
6178
- );
6179
- HeadingComponent.displayName = "Heading";
6180
- var Heading = makePolymorphic(HeadingComponent);
6181
-
6182
- // src/components/IconButton/IconButton.tsx
6183
- var import_react13 = require("react");
6184
- var import_styled_components28 = __toESM(require("styled-components"));
6185
-
6186
- // src/components/Tooltip/Tooltip.tsx
6187
- var import_react_tooltip2 = require("@radix-ui/react-tooltip");
6188
- var import_styled_components27 = __toESM(require("styled-components"));
6189
- var import_jsx_runtime170 = require("react/jsx-runtime");
6190
- var CompactTooltipStyles = import_styled_components27.css`
6191
- --tooltip-font-size: var(--wui-typography-label-4-size);
6192
- --tooltip-line-height: var(--wui-typography-label-4-line-height);
6193
- --tooltip-font-weight: var(--wui-typography-label-4-weight);
6194
- --tooltip-horizontal-padding: var(--wui-space-02);
6195
- --tooltip-vertical-padding: var(--wui-space-03);
6196
- `;
6197
- var StyledContent = (0, import_styled_components27.default)(import_react_tooltip2.Content)`
6198
- --tooltip-font-family: var(--wui-typography-family-default);
6199
- --tooltip-border-radius: var(--wui-border-radius-05);
6200
- --tooltip-bg: var(--wui-color-bg-tooltip);
6201
- --tooltip-color: var(--wui-color-text-on-fill);
6202
- --tooltip-font-size: var(--wui-typography-label-3-size);
6203
- --tooltip-line-height: var(--wui-typography-label-3-line-height);
6204
- --tooltip-font-weight: var(--wui-typography-label-3-weight);
6205
- --tooltip-horizontal-padding: var(--wui-space-03);
6206
- --tooltip-vertical-padding: var(--wui-space-03);
6207
-
6208
- ${({ $compact }) => Boolean($compact) && CompactTooltipStyles};
6209
-
6210
- font-family: var(--tooltip-font-family);
6211
- font-size: var(--tooltip-font-size);
6212
- border-radius: var(--tooltip-border-radius);
6213
- padding: var(--tooltip-horizontal-padding) var(--tooltip-vertical-padding);
6214
- background-color: var(--tooltip-bg);
6215
- color: var(--tooltip-color);
6216
- user-select: none;
6217
- animation-duration: 400ms;
6218
- animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
6219
- will-change: transform, opacity;
6220
- max-width: 30em;
6221
-
6222
- &[data-state='delayed-open'][data-side='top'] {
6223
- animation-name: slideDownAndFade;
6224
- }
6225
-
6226
- &[data-state='delayed-open'][data-side='right'] {
6227
- animation-name: slideLeftAndFade;
6228
- }
6229
-
6230
- &[data-state='delayed-open'][data-side='bottom'] {
6231
- animation-name: slideUpAndFade;
6232
- }
6233
-
6234
- &[data-state='delayed-open'][data-side='left'] {
6235
- animation-name: slideRightAndFade;
6236
- }
6237
- `;
6238
- var VISUAL_OFFSET = 6;
6239
- var Tooltip = ({
6240
- delay = 700,
6241
- direction = "top",
6242
- content,
6243
- children,
6244
- forceOpen,
6245
- compact = false,
6246
- hideArrow = false
6247
- }) => {
6248
- const rootProps = {};
6249
- if (content === "" || content === null) {
6250
- rootProps.open = false;
6251
- }
6252
- if (forceOpen === true) {
6253
- rootProps.open = true;
6254
- }
6255
- return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)(
6256
- import_react_tooltip2.Root,
6257
- {
6258
- delayDuration: delay,
6259
- ...rootProps,
6260
- children: [
6261
- /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
6262
- /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)(
6263
- StyledContent,
6264
- {
6265
- $compact: compact,
6266
- side: direction,
6267
- sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
6268
- children: [
6269
- content,
6270
- !hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
6271
- "svg",
6272
- {
6273
- fill: "var(--tooltip-bg)",
6274
- height: "8",
6275
- style: { transform: "translateY(-2px)" },
6276
- viewBox: "0 0 12 8",
6277
- width: "12",
6278
- xmlns: "http://www.w3.org/2000/svg",
6279
- children: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
6280
- }
6281
- ) }) : null
6282
- ]
6283
- }
6284
- ) })
6285
- ]
6286
- }
6287
- );
6288
- };
6289
- Tooltip.displayName = "Tooltip";
6290
-
6291
- // src/components/IconButton/IconButton.tsx
6292
- var import_jsx_runtime171 = require("react/jsx-runtime");
6293
- var StyledButton2 = (0, import_styled_components28.default)(Button)`
6294
- --icon-button-size-sm: 24px;
6295
- --icon-button-size-md: 32px;
6296
- --icon-button-size-lg: 40px;
6297
- --icon-button-size-xl: 48px;
6298
-
6299
- border-radius: 50%;
6300
- height: ${({ size }) => `var(--icon-button-size-${size})`};
6301
- width: ${({ size }) => `var(--icon-button-size-${size})`};
6302
- display: flex;
6303
- justify-content: center;
6304
- align-items: center;
6305
- line-height: 1;
6306
- `;
6307
- var IconButton = (0, import_react13.forwardRef)(
6308
- ({ children, label, disableTooltip = false, size = "md", ...props }, ref) => {
6309
- const responsiveSize = useResponsiveProp(size);
6310
- const button = /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
6311
- StyledButton2,
6312
- {
6313
- ...props,
6314
- ref,
6315
- "aria-label": label,
6316
- "data-wistia-ui-icon-button": true,
6317
- size: responsiveSize,
6318
- children: (0, import_react13.cloneElement)(import_react13.Children.only(children), {
6319
- size: responsiveSize
6320
- })
6321
- }
6322
- );
6323
- if (disableTooltip) {
6324
- return button;
6325
- }
6326
- return /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(Tooltip, { content: label, children: button });
6327
- }
6328
- );
6329
- IconButton.displayName = "IconButton";
6330
-
6331
- // src/components/Menu/Menu.tsx
6332
- var import_styled_components29 = __toESM(require("styled-components"));
6333
- var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
6334
- var import_type_guards17 = require("@wistia/type-guards");
6335
- var import_jsx_runtime172 = require("react/jsx-runtime");
6336
- var open = import_styled_components29.keyframes`
6337
- from {
6338
- opacity: 0;
6339
- transform: scale(.97) translateY(-8px);
6340
- }
6341
- to {
6342
- opacity: 1;
6343
- transform: scale(1);
6344
- }
6345
- `;
6346
- var close = import_styled_components29.keyframes`
6347
- from {
6348
- opacity: 1;
6349
- transform: scale(1);
6350
- }
6351
- to {
6352
- opacity: 0;
6353
- transform: scale(.97) translateY(-8px);
6354
- }
6355
- `;
6356
- var menuContentCss = import_styled_components29.css`
6357
- --menu-font-family: var(--wui-typography-family-default);
6358
- --menu-bg: var(--wui-color-bg-fill-white); /* TODO - Not sure what token to use for this */
6359
- --menu-shadow: 0 0 64px 0 rgba(0 0 0 / 8%); /* TODO - Need a box-shadow token */
6360
- --menu-border-radius: var(--wui-border-radius-01);
6361
- --menu-padding: var(--wui-space-03);
6362
- --menu-min-width: 120px;
6363
- --menu-max-width: 284px;
6364
- --menu-zindex: 500; /* TODO - need z-index token */
6365
-
6366
- animation: ${open}; /* TODO - need easing tokens */
6367
- font-family: var(--menu-font-family);
6368
- background: var(--menu-bg);
6369
- border-radius: var(--menu-border-radius);
6370
- box-shadow: var(--menu-shadow); /* TODO - Need a box-shadow token */
6371
- max-height: var(--radix-dropdown-menu-content-available-height);
6372
- min-width: var(--menu-min-width);
6373
- max-width: var(--menu-max-width);
6374
- overflow: auto;
6375
- padding: var(--menu-padding);
6376
- transform-origin: var(--radix-dropdown-menu-content-transform-origin);
6377
- z-index: var(--menu-zindex);
6378
-
6379
- &[data-state='closed'] {
6380
- animation: ${close}; /* TODO - need easing tokens */
6381
- }
6382
-
6383
- ${mq.smAndUp} {
6384
- bottom: 0;
6385
- padding: var(--menu-padding);
6386
- right: 0;
6387
- top: 0;
6388
- transform: initial;
6389
- }
6390
-
6391
- hr {
6392
- margin: var(--wui-space-02) 0;
6393
- }
6394
- `;
6395
- var MenuContent = (0, import_styled_components29.default)(import_react_dropdown_menu.DropdownMenuContent)`
6396
- ${menuContentCss}
6397
- `;
6398
- var Menu = ({
6399
- align = "start",
6400
- children,
6401
- trigger,
6402
- label,
6403
- isOpen,
6404
- triggerProps = {},
6405
- onOpenChange,
6406
- onInteractOutside,
6407
- ...props
6408
- }) => {
6409
- return /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)(
6410
- import_react_dropdown_menu.DropdownMenu,
6411
- {
6412
- modal: false,
6413
- ...(0, import_type_guards17.isNotNil)(onOpenChange) && (0, import_type_guards17.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {},
6414
- children: [
6415
- /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards17.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
6416
- Button,
6417
- {
6418
- "aria-expanded": isOpen,
6419
- forceState: isOpen ? "active" : void 0,
6420
- rightIcon: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(Icon, { type: "caret-down" }),
6421
- ...triggerProps,
6422
- children: label
6423
- }
6424
- ) }),
6425
- /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_react_dropdown_menu.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
6426
- MenuContent,
6427
- {
6428
- ...props,
6429
- align,
6430
- onFocusOutside: (event) => {
6431
- event.preventDefault();
6432
- },
6433
- sideOffset: 6,
6434
- children
6435
- }
6436
- ) })
6437
- ]
6226
+ // src/components/Form/Form.tsx
6227
+ var import_jsx_runtime171 = require("react/jsx-runtime");
6228
+ var StyledForm = import_styled_components28.default.form`
6229
+ --form-default-width: 690px;
6230
+
6231
+ max-width: ${({ fullWidth }) => fullWidth ? "auto" : "var(--form-default-width)"};
6232
+ align-items: ${({ fullWidth }) => fullWidth ? "stretch" : "flex-start"};
6233
+ `;
6234
+ var FormContext = (0, import_react14.createContext)({
6235
+ values: {},
6236
+ errors: {},
6237
+ hasSubmitted: false,
6238
+ formId: ""
6239
+ });
6240
+ var FormComponent = ({ children, action, values = {}, validate, fullWidth = false, ...props }, forwardedRef) => {
6241
+ const [errors, setErrors] = (0, import_react14.useState)({});
6242
+ const [hasSubmitted, setHasSubmitted] = (0, import_react14.useState)(false);
6243
+ const innerRef = (0, import_react14.useRef)();
6244
+ const ref = forwardedRef ?? innerRef;
6245
+ const autoId = (0, import_react14.useId)();
6246
+ const id = props.id ?? autoId;
6247
+ const handleValidate = (nextFormData) => {
6248
+ const nextData = Object.fromEntries(nextFormData.entries());
6249
+ if ((0, import_type_guards17.isUndefined)(validate)) {
6250
+ return {};
6251
+ }
6252
+ return validate(nextData);
6253
+ };
6254
+ const handleBlur = (event) => {
6255
+ if (props.onBlur) {
6256
+ props.onBlur(event);
6257
+ }
6258
+ const formData = new FormData(event.currentTarget);
6259
+ if ((0, import_type_guards17.isNotUndefined)(validate)) {
6260
+ handleValidate(formData);
6261
+ }
6262
+ };
6263
+ const handleSubmit = (event) => {
6264
+ event.preventDefault();
6265
+ const formData = new FormData(event.currentTarget);
6266
+ const nextErrors = handleValidate(formData);
6267
+ const isValid = Object.keys(nextErrors).length === 0;
6268
+ setErrors(nextErrors);
6269
+ setHasSubmitted(true);
6270
+ if (isValid && props.onSubmit) {
6271
+ props.onSubmit(event);
6272
+ }
6273
+ if (isValid && action) {
6274
+ void action(formData);
6275
+ }
6276
+ };
6277
+ const handleReset = (event) => {
6278
+ setErrors({});
6279
+ setHasSubmitted(false);
6280
+ if (props.onReset) {
6281
+ props.onReset(event);
6438
6282
  }
6283
+ if (action) {
6284
+ void action(null);
6285
+ }
6286
+ };
6287
+ const context = (0, import_react14.useMemo)(() => {
6288
+ return {
6289
+ values,
6290
+ errors,
6291
+ hasSubmitted,
6292
+ formId: id
6293
+ };
6294
+ }, [values, errors, id, hasSubmitted]);
6295
+ return (
6296
+ // @ts-expect-error - generic context providers are a giant pain
6297
+ /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
6298
+ Stack,
6299
+ {
6300
+ gap: "space-05",
6301
+ ...props,
6302
+ ref,
6303
+ as: StyledForm,
6304
+ fullWidth,
6305
+ id,
6306
+ onBlur: handleBlur,
6307
+ onReset: handleReset,
6308
+ onSubmit: handleSubmit,
6309
+ children
6310
+ }
6311
+ ) })
6439
6312
  );
6440
6313
  };
6441
- Menu.displayName = "Menu";
6314
+ FormComponent.displayName = "Form";
6315
+ var Form = (0, import_react14.forwardRef)(FormComponent);
6442
6316
 
6443
- // src/components/Menu/MenuLabel.tsx
6317
+ // src/components/Form/useFormState.tsx
6318
+ var import_react15 = require("react");
6319
+ var useFormState = (action, initialData = {}) => {
6320
+ const [data, setData] = (0, import_react15.useState)(initialData);
6321
+ const [isPending, setIsPending] = (0, import_react15.useState)(false);
6322
+ const [error, setError] = (0, import_react15.useState)(null);
6323
+ const formAction = (0, import_react15.useCallback)(
6324
+ async (nextFormData) => {
6325
+ if (nextFormData === null) {
6326
+ setData(initialData);
6327
+ setError(null);
6328
+ return;
6329
+ }
6330
+ const nextData = Object.fromEntries(nextFormData.entries());
6331
+ setIsPending(true);
6332
+ try {
6333
+ const result = await action(data, nextData);
6334
+ setData(result);
6335
+ } catch (err) {
6336
+ setError(err);
6337
+ } finally {
6338
+ setIsPending(false);
6339
+ }
6340
+ },
6341
+ [action, initialData, data]
6342
+ );
6343
+ return [
6344
+ {
6345
+ data,
6346
+ error
6347
+ },
6348
+ formAction,
6349
+ isPending
6350
+ ];
6351
+ };
6352
+
6353
+ // src/components/Form/FormErrorSummary.tsx
6354
+ var import_react16 = require("react");
6355
+ var import_type_guards18 = require("@wistia/type-guards");
6356
+ var import_jsx_runtime172 = require("react/jsx-runtime");
6357
+ var ErrorItem = ({ name, error, formId }) => {
6358
+ return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(Link, { href: `${formId}-${name}`, children: error }) }, name);
6359
+ };
6360
+ var FormErrorSummary = ({ description }) => {
6361
+ const ref = (0, import_react16.useRef)(null);
6362
+ const { formId, errors, hasSubmitted } = (0, import_react16.useContext)(FormContext);
6363
+ const isValid = Object.keys(errors).length === 0;
6364
+ if (isValid || !hasSubmitted) {
6365
+ return null;
6366
+ }
6367
+ return /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)("div", { ref, children: [
6368
+ /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("p", { children: description }),
6369
+ /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards18.isNotUndefined)(error)).map(
6370
+ ([name, error]) => (0, import_type_guards18.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
6371
+ ErrorItem,
6372
+ {
6373
+ error: err,
6374
+ formId,
6375
+ name
6376
+ },
6377
+ err
6378
+ )) : /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
6379
+ ErrorItem,
6380
+ {
6381
+ error: error ?? "",
6382
+ formId,
6383
+ name
6384
+ },
6385
+ error
6386
+ )
6387
+ ) })
6388
+ ] });
6389
+ };
6390
+
6391
+ // src/components/FormField/FormField.tsx
6392
+ var import_react20 = require("react");
6444
6393
  var import_styled_components31 = __toESM(require("styled-components"));
6445
- var import_react_dropdown_menu2 = require("@radix-ui/react-dropdown-menu");
6394
+ var import_type_guards19 = require("@wistia/type-guards");
6446
6395
 
6447
6396
  // src/components/Text/Text.tsx
6448
- var import_react14 = require("react");
6449
- var import_styled_components30 = __toESM(require("styled-components"));
6397
+ var import_react17 = require("react");
6398
+ var import_styled_components29 = __toESM(require("styled-components"));
6450
6399
  var import_jsx_runtime173 = require("react/jsx-runtime");
6451
- var bodyBoldStyles = import_styled_components30.css`
6400
+ var bodyBoldStyles = import_styled_components29.css`
6452
6401
  > strong,
6453
6402
  b {
6454
6403
  font-weight: var(--wui-typography-weight-body-bold);
6455
6404
  }
6456
6405
  `;
6457
- var labelBoldStyles = import_styled_components30.css`
6406
+ var labelBoldStyles = import_styled_components29.css`
6458
6407
  > strong,
6459
6408
  b {
6460
6409
  font-weight: var(--wui-typography-weight-label-bold);
6461
6410
  }
6462
6411
  `;
6463
- var body1TextStyle = import_styled_components30.css`
6412
+ var body1TextStyle = import_styled_components29.css`
6464
6413
  --font-family: var(--wui-typography-body-1-family);
6465
6414
  --font-size: var(--wui-typography-body-1-size);
6466
6415
  --font-weight: var(--wui-typography-body-1-weight);
6467
6416
  --line-height: var(--wui-typography-body-1-line-height);
6468
6417
  ${bodyBoldStyles}
6469
6418
  `;
6470
- var body2TextStyle = import_styled_components30.css`
6419
+ var body2TextStyle = import_styled_components29.css`
6471
6420
  --font-family: var(--wui-typography-body-2-family);
6472
6421
  --font-size: var(--wui-typography-body-2-size);
6473
6422
  --font-weight: var(--wui-typography-body-2-weight);
6474
6423
  --line-height: var(--wui-typography-body-2-line-height);
6475
6424
  ${bodyBoldStyles}
6476
6425
  `;
6477
- var body3TextStyle = import_styled_components30.css`
6426
+ var body3TextStyle = import_styled_components29.css`
6478
6427
  --font-family: var(--wui-typography-body-3-family);
6479
6428
  --font-size: var(--wui-typography-body-3-size);
6480
6429
  --font-weight: var(--wui-typography-body-3-weight);
6481
6430
  --line-height: var(--wui-typography-body-3-line-height);
6482
6431
  ${bodyBoldStyles}
6483
6432
  `;
6484
- var body4TextStyle = import_styled_components30.css`
6433
+ var body4TextStyle = import_styled_components29.css`
6485
6434
  --font-family: var(--wui-typography-body-4-family);
6486
6435
  --font-size: var(--wui-typography-body-4-size);
6487
6436
  --font-weight: var(--wui-typography-body-4-weight);
6488
6437
  --line-height: var(--wui-typography-body-4-line-height);
6489
6438
  ${bodyBoldStyles}
6490
6439
  `;
6491
- var label1TextStyle = import_styled_components30.css`
6440
+ var label1TextStyle = import_styled_components29.css`
6492
6441
  --font-family: var(--wui-typography-label-1-family);
6493
6442
  --font-size: var(--wui-typography-label-1-size);
6494
6443
  --font-weight: var(--wui-typography-label-1-weight);
6495
6444
  --line-height: var(--wui-typography-label-1-line-height);
6496
6445
  ${labelBoldStyles}
6497
6446
  `;
6498
- var label2TextStyle = import_styled_components30.css`
6447
+ var label2TextStyle = import_styled_components29.css`
6499
6448
  --font-family: var(--wui-typography-label-2-family);
6500
6449
  --font-size: var(--wui-typography-label-2-size);
6501
6450
  --font-weight: var(--wui-typography-label-2-weight);
6502
6451
  --line-height: var(--wui-typography-label-2-line-height);
6503
6452
  ${labelBoldStyles}
6504
6453
  `;
6505
- var label3TextStyle = import_styled_components30.css`
6454
+ var label3TextStyle = import_styled_components29.css`
6506
6455
  --font-family: var(--wui-typography-label-3-family);
6507
6456
  --font-size: var(--wui-typography-label-3-size);
6508
6457
  --font-weight: var(--wui-typography-label-3-weight);
6509
6458
  --line-height: var(--wui-typography-label-3-line-height);
6510
6459
  ${labelBoldStyles}
6511
6460
  `;
6512
- var label4TextStyle = import_styled_components30.css`
6461
+ var label4TextStyle = import_styled_components29.css`
6513
6462
  --font-family: var(--wui-typography-label-4-family);
6514
6463
  --font-size: var(--wui-typography-label-4-size);
6515
6464
  --font-weight: var(--wui-typography-label-4-weight);
6516
6465
  --line-height: var(--wui-typography-label-4-line-height);
6517
6466
  ${labelBoldStyles}
6518
6467
  `;
6519
- var body1MonoTextStyle = import_styled_components30.css`
6468
+ var body1MonoTextStyle = import_styled_components29.css`
6520
6469
  ${body1TextStyle};
6521
6470
  --font-family: var(--wui-typography-family-mono);
6522
6471
  `;
6523
- var body2MonoTextStyle = import_styled_components30.css`
6472
+ var body2MonoTextStyle = import_styled_components29.css`
6524
6473
  ${body2TextStyle};
6525
6474
  --font-family: var(--wui-typography-family-mono);
6526
6475
  `;
6527
- var body3MonoTextStyle = import_styled_components30.css`
6476
+ var body3MonoTextStyle = import_styled_components29.css`
6528
6477
  ${body3TextStyle};
6529
6478
  --font-family: var(--wui-typography-family-mono);
6530
6479
  `;
6531
- var body4MonoTextStyle = import_styled_components30.css`
6480
+ var body4MonoTextStyle = import_styled_components29.css`
6532
6481
  ${body4TextStyle};
6533
6482
  --font-family: var(--wui-typography-family-mono);
6534
6483
  `;
@@ -6546,13 +6495,13 @@ var variantStyleMap2 = {
6546
6495
  label3: label3TextStyle,
6547
6496
  label4: label4TextStyle
6548
6497
  };
6549
- var highContrastProminenceStyle = import_styled_components30.css`
6498
+ var highContrastProminenceStyle = import_styled_components29.css`
6550
6499
  --text-color: var(--wui-color-text-high-contrast);
6551
6500
  `;
6552
- var vibrantProminenceStyle = import_styled_components30.css`
6501
+ var vibrantProminenceStyle = import_styled_components29.css`
6553
6502
  --text-color: var(--wui-color-text);
6554
6503
  `;
6555
- var secondaryProminenceStyle = import_styled_components30.css`
6504
+ var secondaryProminenceStyle = import_styled_components29.css`
6556
6505
  --text-color: var(--wui-color-text-secondary);
6557
6506
  `;
6558
6507
  var prominenceMap = {
@@ -6560,7 +6509,7 @@ var prominenceMap = {
6560
6509
  vibrant: vibrantProminenceStyle,
6561
6510
  secondary: secondaryProminenceStyle
6562
6511
  };
6563
- var StyledText = import_styled_components30.default.div`
6512
+ var StyledText = import_styled_components29.default.div`
6564
6513
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
6565
6514
  font-family: var(--font-family);
6566
6515
  font-size: var(--font-size);
@@ -6572,24 +6521,24 @@ var StyledText = import_styled_components30.default.div`
6572
6521
  ${({ $variant }) => variantStyleMap2[$variant]}
6573
6522
  ${({ $prominence }) => prominenceMap[$prominence]}
6574
6523
  ${({ $ellipsis }) => $ellipsis && ellipsisStyle};
6575
- ${({ $inline }) => $inline && import_styled_components30.css`
6524
+ ${({ $inline }) => $inline && import_styled_components29.css`
6576
6525
  display: inline-block;
6577
6526
  `}
6578
- ${({ $disabled }) => $disabled && import_styled_components30.css`
6527
+ ${({ $disabled }) => $disabled && import_styled_components29.css`
6579
6528
  --text-color: var(--wui-color-text-disabled);
6580
6529
  `}
6581
- ${({ $preventUserSelect }) => $preventUserSelect && import_styled_components30.css`
6530
+ ${({ $preventUserSelect }) => $preventUserSelect && import_styled_components29.css`
6582
6531
  user-select: none;
6583
6532
  `}
6584
- ${({ $align }) => import_styled_components30.css`
6533
+ ${({ $align }) => import_styled_components29.css`
6585
6534
  text-align: ${$align};
6586
6535
  `}
6587
- ${({ as }) => as === "p" && import_styled_components30.css`
6536
+ ${({ as }) => as === "p" && import_styled_components29.css`
6588
6537
  display: block;
6589
6538
  `}
6590
6539
  `;
6591
- var DEFAULT_ELEMENT2 = "div";
6592
- var TextComponent = (0, import_react14.forwardRef)(
6540
+ var DEFAULT_ELEMENT3 = "div";
6541
+ var TextComponent = (0, import_react17.forwardRef)(
6593
6542
  ({
6594
6543
  align = "left",
6595
6544
  colorScheme = "inherit",
@@ -6614,27 +6563,447 @@ var TextComponent = (0, import_react14.forwardRef)(
6614
6563
  $preventUserSelect: preventUserSelect,
6615
6564
  $prominence: prominence,
6616
6565
  $variant: variant,
6617
- as: renderAs ?? DEFAULT_ELEMENT2,
6566
+ as: renderAs ?? DEFAULT_ELEMENT3,
6618
6567
  ...otherProps
6619
6568
  }
6620
6569
  );
6621
6570
  }
6622
6571
  );
6623
- TextComponent.displayName = "Text";
6624
- var Text = makePolymorphic(TextComponent);
6572
+ TextComponent.displayName = "Text";
6573
+ var Text = makePolymorphic(TextComponent);
6574
+
6575
+ // src/components/FormGroup/CheckboxGroup.tsx
6576
+ var import_react19 = require("react");
6577
+
6578
+ // src/components/FormGroup/FormGroup.tsx
6579
+ var import_styled_components30 = __toESM(require("styled-components"));
6580
+ var import_react18 = require("react");
6581
+ var import_jsx_runtime174 = require("react/jsx-runtime");
6582
+ var StyledFieldset = import_styled_components30.default.fieldset`
6583
+ border: 0;
6584
+ `;
6585
+ var StyledLegend = import_styled_components30.default.legend`
6586
+ margin-bottom: var(--space-01);
6587
+ `;
6588
+ var FormGroup = ({ children, label, ...props }) => {
6589
+ const ref = (0, import_react18.useRef)();
6590
+ return /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(
6591
+ Stack,
6592
+ {
6593
+ ...props,
6594
+ ref,
6595
+ renderAs: StyledFieldset,
6596
+ children: [
6597
+ /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
6598
+ Heading,
6599
+ {
6600
+ renderAs: StyledLegend,
6601
+ variant: "heading5",
6602
+ children: label
6603
+ }
6604
+ ),
6605
+ children
6606
+ ]
6607
+ }
6608
+ );
6609
+ };
6610
+ FormGroup.displayName = "FormGroup";
6611
+
6612
+ // src/components/FormGroup/CheckboxGroup.tsx
6613
+ var import_jsx_runtime175 = require("react/jsx-runtime");
6614
+ var CheckboxGroupContext = (0, import_react19.createContext)(null);
6615
+ var CheckboxGroup = ({
6616
+ children,
6617
+ name,
6618
+ onChange,
6619
+ value,
6620
+ ...props
6621
+ }) => {
6622
+ const context = (0, import_react19.useMemo)(() => {
6623
+ return {
6624
+ name,
6625
+ onChange
6626
+ };
6627
+ }, [name, onChange]);
6628
+ return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(FormGroup, { ...props, children }) });
6629
+ };
6630
+ CheckboxGroup.displayName = "CheckboxGroup";
6631
+
6632
+ // src/components/FormField/FormField.tsx
6633
+ var import_jsx_runtime176 = require("react/jsx-runtime");
6634
+ var StyledFormField = import_styled_components31.default.div`
6635
+ --form-field-spacing: var(--wui-space-01);
6636
+ --form-field-error-color: var(--wui-color-text-error);
6637
+
6638
+ display: flex;
6639
+ flex-direction: column;
6640
+ gap: var(--form-field-spacing);
6641
+ `;
6642
+ var StyledErrorList = import_styled_components31.default.ul`
6643
+ margin: 0;
6644
+ padding: 0;
6645
+ padding-left: var(--wui-space-04);
6646
+ display: flex;
6647
+ flex-direction: column;
6648
+ gap: var(--wui-space-01);
6649
+ `;
6650
+ var ErrorMessages = ({ errors, id }) => {
6651
+ const isMultipleErrors = (0, import_type_guards19.isArray)(errors);
6652
+ return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
6653
+ Text,
6654
+ {
6655
+ colorScheme: "error",
6656
+ id: `${id}-${index}`,
6657
+ renderAs: "li",
6658
+ variant: "label4",
6659
+ children: error
6660
+ },
6661
+ `${id}-${index}`
6662
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
6663
+ Text,
6664
+ {
6665
+ colorScheme: "error",
6666
+ id,
6667
+ variant: "label4",
6668
+ children: errors
6669
+ },
6670
+ id
6671
+ );
6672
+ };
6673
+ var FormField = ({
6674
+ children,
6675
+ label,
6676
+ name,
6677
+ error,
6678
+ value,
6679
+ ...props
6680
+ }) => {
6681
+ const formState = (0, import_react20.useContext)(FormContext);
6682
+ const checkboxGroup = (0, import_react20.useContext)(CheckboxGroupContext);
6683
+ const id = props.id ?? `${formState.formId}-${name}`;
6684
+ const isInlineLabel = children.type === Checkbox;
6685
+ const computedError = error ?? formState.errors[name];
6686
+ const defaultValue = formState.values[name];
6687
+ let childProps = {
6688
+ name,
6689
+ id,
6690
+ label: isInlineLabel ? label : void 0,
6691
+ ...props
6692
+ };
6693
+ if ((0, import_type_guards19.isUndefined)(value) && (0, import_type_guards19.isNotUndefined)(defaultValue)) {
6694
+ childProps = {
6695
+ ...childProps,
6696
+ defaultValue
6697
+ };
6698
+ }
6699
+ if ((0, import_type_guards19.isNotNil)(checkboxGroup)) {
6700
+ const computedName = (0, import_type_guards19.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
6701
+ const handleChange = (event) => {
6702
+ if ((0, import_type_guards19.isNotUndefined)(props.onChange)) {
6703
+ props.onChange(event);
6704
+ }
6705
+ if ((0, import_type_guards19.isNotUndefined)(checkboxGroup.onChange)) {
6706
+ checkboxGroup.onChange(event);
6707
+ }
6708
+ };
6709
+ childProps = {
6710
+ ...childProps,
6711
+ name: computedName,
6712
+ onChange: handleChange,
6713
+ "aria-invalid": (0, import_type_guards19.isNotNil)(error),
6714
+ "aria-describedby": (0, import_type_guards19.isNotNil)(error) ? `${id}-error` : void 0
6715
+ };
6716
+ }
6717
+ import_react20.Children.only(children);
6718
+ return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(StyledFormField, { ...props, children: [
6719
+ !isInlineLabel && /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(Label, { htmlFor: id, children: label }),
6720
+ (0, import_react20.cloneElement)(children, childProps),
6721
+ (0, import_type_guards19.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
6722
+ ErrorMessages,
6723
+ {
6724
+ errors: computedError,
6725
+ id: `${id}-error`
6726
+ }
6727
+ ) : null
6728
+ ] });
6729
+ };
6730
+ FormField.displayName = "FormField";
6731
+
6732
+ // src/components/IconButton/IconButton.tsx
6733
+ var import_react21 = require("react");
6734
+ var import_styled_components33 = __toESM(require("styled-components"));
6735
+
6736
+ // src/components/Tooltip/Tooltip.tsx
6737
+ var import_react_tooltip2 = require("@radix-ui/react-tooltip");
6738
+ var import_styled_components32 = __toESM(require("styled-components"));
6739
+ var import_jsx_runtime177 = require("react/jsx-runtime");
6740
+ var CompactTooltipStyles = import_styled_components32.css`
6741
+ --tooltip-font-size: var(--wui-typography-label-4-size);
6742
+ --tooltip-line-height: var(--wui-typography-label-4-line-height);
6743
+ --tooltip-font-weight: var(--wui-typography-label-4-weight);
6744
+ --tooltip-horizontal-padding: var(--wui-space-02);
6745
+ --tooltip-vertical-padding: var(--wui-space-03);
6746
+ `;
6747
+ var StyledContent = (0, import_styled_components32.default)(import_react_tooltip2.Content)`
6748
+ --tooltip-font-family: var(--wui-typography-family-default);
6749
+ --tooltip-border-radius: var(--wui-border-radius-05);
6750
+ --tooltip-bg: var(--wui-color-bg-tooltip);
6751
+ --tooltip-color: var(--wui-color-text-on-fill);
6752
+ --tooltip-font-size: var(--wui-typography-label-3-size);
6753
+ --tooltip-line-height: var(--wui-typography-label-3-line-height);
6754
+ --tooltip-font-weight: var(--wui-typography-label-3-weight);
6755
+ --tooltip-horizontal-padding: var(--wui-space-03);
6756
+ --tooltip-vertical-padding: var(--wui-space-03);
6757
+
6758
+ ${({ $compact }) => Boolean($compact) && CompactTooltipStyles};
6759
+
6760
+ font-family: var(--tooltip-font-family);
6761
+ font-size: var(--tooltip-font-size);
6762
+ border-radius: var(--tooltip-border-radius);
6763
+ padding: var(--tooltip-horizontal-padding) var(--tooltip-vertical-padding);
6764
+ background-color: var(--tooltip-bg);
6765
+ color: var(--tooltip-color);
6766
+ user-select: none;
6767
+ animation-duration: 400ms;
6768
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
6769
+ will-change: transform, opacity;
6770
+ max-width: 30em;
6771
+
6772
+ &[data-state='delayed-open'][data-side='top'] {
6773
+ animation-name: slideDownAndFade;
6774
+ }
6775
+
6776
+ &[data-state='delayed-open'][data-side='right'] {
6777
+ animation-name: slideLeftAndFade;
6778
+ }
6779
+
6780
+ &[data-state='delayed-open'][data-side='bottom'] {
6781
+ animation-name: slideUpAndFade;
6782
+ }
6783
+
6784
+ &[data-state='delayed-open'][data-side='left'] {
6785
+ animation-name: slideRightAndFade;
6786
+ }
6787
+ `;
6788
+ var VISUAL_OFFSET = 6;
6789
+ var Tooltip = ({
6790
+ delay = 700,
6791
+ direction = "top",
6792
+ content,
6793
+ children,
6794
+ forceOpen,
6795
+ compact = false,
6796
+ hideArrow = false
6797
+ }) => {
6798
+ const rootProps = {};
6799
+ if (content === "" || content === null) {
6800
+ rootProps.open = false;
6801
+ }
6802
+ if (forceOpen === true) {
6803
+ rootProps.open = true;
6804
+ }
6805
+ return /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(
6806
+ import_react_tooltip2.Root,
6807
+ {
6808
+ delayDuration: delay,
6809
+ ...rootProps,
6810
+ children: [
6811
+ /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
6812
+ /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(
6813
+ StyledContent,
6814
+ {
6815
+ $compact: compact,
6816
+ side: direction,
6817
+ sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
6818
+ children: [
6819
+ content,
6820
+ !hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
6821
+ "svg",
6822
+ {
6823
+ fill: "var(--tooltip-bg)",
6824
+ height: "8",
6825
+ style: { transform: "translateY(-2px)" },
6826
+ viewBox: "0 0 12 8",
6827
+ width: "12",
6828
+ xmlns: "http://www.w3.org/2000/svg",
6829
+ children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
6830
+ }
6831
+ ) }) : null
6832
+ ]
6833
+ }
6834
+ ) })
6835
+ ]
6836
+ }
6837
+ );
6838
+ };
6839
+ Tooltip.displayName = "Tooltip";
6840
+
6841
+ // src/components/IconButton/IconButton.tsx
6842
+ var import_jsx_runtime178 = require("react/jsx-runtime");
6843
+ var StyledButton2 = (0, import_styled_components33.default)(Button)`
6844
+ --icon-button-size-sm: 24px;
6845
+ --icon-button-size-md: 32px;
6846
+ --icon-button-size-lg: 40px;
6847
+ --icon-button-size-xl: 48px;
6848
+
6849
+ border-radius: 50%;
6850
+ height: ${({ size }) => `var(--icon-button-size-${size})`};
6851
+ width: ${({ size }) => `var(--icon-button-size-${size})`};
6852
+ display: flex;
6853
+ justify-content: center;
6854
+ align-items: center;
6855
+ line-height: 1;
6856
+ `;
6857
+ var IconButton = (0, import_react21.forwardRef)(
6858
+ ({ children, label, disableTooltip = false, size = "md", ...props }, ref) => {
6859
+ const responsiveSize = useResponsiveProp(size);
6860
+ const button = /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
6861
+ StyledButton2,
6862
+ {
6863
+ ...props,
6864
+ ref,
6865
+ "aria-label": label,
6866
+ "data-wistia-ui-icon-button": true,
6867
+ size: responsiveSize,
6868
+ children: (0, import_react21.cloneElement)(import_react21.Children.only(children), {
6869
+ size: responsiveSize
6870
+ })
6871
+ }
6872
+ );
6873
+ if (disableTooltip) {
6874
+ return button;
6875
+ }
6876
+ return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(Tooltip, { content: label, children: button });
6877
+ }
6878
+ );
6879
+ IconButton.displayName = "IconButton";
6880
+
6881
+ // src/components/Menu/Menu.tsx
6882
+ var import_styled_components34 = __toESM(require("styled-components"));
6883
+ var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
6884
+ var import_type_guards20 = require("@wistia/type-guards");
6885
+ var import_jsx_runtime179 = require("react/jsx-runtime");
6886
+ var open = import_styled_components34.keyframes`
6887
+ from {
6888
+ opacity: 0;
6889
+ transform: scale(.97) translateY(-8px);
6890
+ }
6891
+ to {
6892
+ opacity: 1;
6893
+ transform: scale(1);
6894
+ }
6895
+ `;
6896
+ var close = import_styled_components34.keyframes`
6897
+ from {
6898
+ opacity: 1;
6899
+ transform: scale(1);
6900
+ }
6901
+ to {
6902
+ opacity: 0;
6903
+ transform: scale(.97) translateY(-8px);
6904
+ }
6905
+ `;
6906
+ var menuContentCss = import_styled_components34.css`
6907
+ --menu-font-family: var(--wui-typography-family-default);
6908
+ --menu-bg: var(--wui-color-bg-fill-white); /* TODO - Not sure what token to use for this */
6909
+ --menu-shadow: 0 0 64px 0 rgba(0 0 0 / 8%); /* TODO - Need a box-shadow token */
6910
+ --menu-border-radius: var(--wui-border-radius-01);
6911
+ --menu-padding: var(--wui-space-03);
6912
+ --menu-min-width: 120px;
6913
+ --menu-max-width: 284px;
6914
+ --menu-zindex: 500; /* TODO - need z-index token */
6915
+
6916
+ animation: ${open}; /* TODO - need easing tokens */
6917
+ font-family: var(--menu-font-family);
6918
+ background: var(--menu-bg);
6919
+ border-radius: var(--menu-border-radius);
6920
+ box-shadow: var(--menu-shadow); /* TODO - Need a box-shadow token */
6921
+ max-height: var(--radix-dropdown-menu-content-available-height);
6922
+ min-width: var(--menu-min-width);
6923
+ max-width: var(--menu-max-width);
6924
+ overflow: auto;
6925
+ padding: var(--menu-padding);
6926
+ transform-origin: var(--radix-dropdown-menu-content-transform-origin);
6927
+ z-index: var(--menu-zindex);
6928
+
6929
+ &[data-state='closed'] {
6930
+ animation: ${close}; /* TODO - need easing tokens */
6931
+ }
6932
+
6933
+ ${mq.smAndUp} {
6934
+ bottom: 0;
6935
+ padding: var(--menu-padding);
6936
+ right: 0;
6937
+ top: 0;
6938
+ transform: initial;
6939
+ }
6940
+
6941
+ hr {
6942
+ margin: var(--wui-space-02) 0;
6943
+ }
6944
+ `;
6945
+ var MenuContent = (0, import_styled_components34.default)(import_react_dropdown_menu.DropdownMenuContent)`
6946
+ ${menuContentCss}
6947
+ `;
6948
+ var Menu = ({
6949
+ align = "start",
6950
+ children,
6951
+ trigger,
6952
+ label,
6953
+ isOpen,
6954
+ triggerProps = {},
6955
+ onOpenChange,
6956
+ onInteractOutside,
6957
+ ...props
6958
+ }) => {
6959
+ return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)(
6960
+ import_react_dropdown_menu.DropdownMenu,
6961
+ {
6962
+ modal: false,
6963
+ ...(0, import_type_guards20.isNotNil)(onOpenChange) && (0, import_type_guards20.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {},
6964
+ children: [
6965
+ /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards20.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
6966
+ Button,
6967
+ {
6968
+ "aria-expanded": isOpen,
6969
+ forceState: isOpen ? "active" : void 0,
6970
+ rightIcon: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(Icon, { type: "caret-down" }),
6971
+ ...triggerProps,
6972
+ children: label
6973
+ }
6974
+ ) }),
6975
+ /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(import_react_dropdown_menu.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
6976
+ MenuContent,
6977
+ {
6978
+ ...props,
6979
+ align,
6980
+ onFocusOutside: (event) => {
6981
+ event.preventDefault();
6982
+ },
6983
+ sideOffset: 6,
6984
+ children
6985
+ }
6986
+ ) })
6987
+ ]
6988
+ }
6989
+ );
6990
+ };
6991
+ Menu.displayName = "Menu";
6625
6992
 
6626
6993
  // src/components/Menu/MenuLabel.tsx
6627
- var import_jsx_runtime174 = require("react/jsx-runtime");
6628
- var StyledMenuLabel = (0, import_styled_components31.default)(import_react_dropdown_menu2.DropdownMenuLabel)`
6994
+ var import_styled_components35 = __toESM(require("styled-components"));
6995
+ var import_react_dropdown_menu2 = require("@radix-ui/react-dropdown-menu");
6996
+ var import_jsx_runtime180 = require("react/jsx-runtime");
6997
+ var StyledMenuLabel = (0, import_styled_components35.default)(import_react_dropdown_menu2.DropdownMenuLabel)`
6629
6998
  padding: var(--wui-space-02);
6630
6999
  `;
6631
7000
  var MenuLabel = ({ children, ...props }) => {
6632
- return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
7001
+ return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
6633
7002
  StyledMenuLabel,
6634
7003
  {
6635
7004
  asChild: true,
6636
7005
  ...props,
6637
- children: /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
7006
+ children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
6638
7007
  Text,
6639
7008
  {
6640
7009
  variant: "label3",
@@ -6648,16 +7017,16 @@ var MenuLabel = ({ children, ...props }) => {
6648
7017
  MenuLabel.displayName = "MenuLabel";
6649
7018
 
6650
7019
  // src/components/Menu/SubMenu.tsx
6651
- var import_react16 = require("react");
6652
- var import_styled_components34 = __toESM(require("styled-components"));
7020
+ var import_react23 = require("react");
7021
+ var import_styled_components38 = __toESM(require("styled-components"));
6653
7022
  var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
6654
7023
 
6655
7024
  // src/components/Menu/MenuItemButton.tsx
6656
- var import_react15 = require("react");
6657
- var import_styled_components32 = __toESM(require("styled-components"));
6658
- var import_type_guards18 = require("@wistia/type-guards");
6659
- var import_jsx_runtime175 = require("react/jsx-runtime");
6660
- var StyledButton3 = (0, import_styled_components32.default)(Button)`
7025
+ var import_react22 = require("react");
7026
+ var import_styled_components36 = __toESM(require("styled-components"));
7027
+ var import_type_guards21 = require("@wistia/type-guards");
7028
+ var import_jsx_runtime181 = require("react/jsx-runtime");
7029
+ var StyledButton3 = (0, import_styled_components36.default)(Button)`
6661
7030
  --menu-item-border-radius: var(--wui-border-radius-01);
6662
7031
  --menu-item-gap: var(--wui-space-01);
6663
7032
  --menu-item-inner-gap: var(--wui-space-04);
@@ -6672,9 +7041,9 @@ var StyledButton3 = (0, import_styled_components32.default)(Button)`
6672
7041
  background-color: var(--menu-item-disabled-bg);
6673
7042
  }
6674
7043
 
6675
- ${({ $isGated }) => (0, import_type_guards18.isNotUndefined)($isGated) && $isGated ? `color: var(--wui-color-text);` : ""}
7044
+ ${({ $isGated }) => (0, import_type_guards21.isNotUndefined)($isGated) && $isGated ? `color: var(--wui-color-text);` : ""}
6676
7045
  `;
6677
- var StyledMenuContent = import_styled_components32.default.div`
7046
+ var StyledMenuContent = import_styled_components36.default.div`
6678
7047
  display: grid;
6679
7048
  grid-template-areas:
6680
7049
  'label badge'
@@ -6683,28 +7052,28 @@ var StyledMenuContent = import_styled_components32.default.div`
6683
7052
  position: relative;
6684
7053
  align-content: center;
6685
7054
  `;
6686
- var StyledBadgeContainer = import_styled_components32.default.div`
7055
+ var StyledBadgeContainer = import_styled_components36.default.div`
6687
7056
  grid-area: badge;
6688
7057
  align-self: start;
6689
7058
  justify-self: end;
6690
7059
  margin-left: var(--menu-item-inner-gap);
6691
7060
  `;
6692
- var MenuItemButton = (0, import_react15.forwardRef)(({ children, appearance, command, ...props }, ref) => {
7061
+ var MenuItemButton = (0, import_react22.forwardRef)(({ children, appearance, command, ...props }, ref) => {
6693
7062
  let { colorScheme, badge } = props;
6694
7063
  if (appearance === "dangerous") {
6695
- if ((0, import_type_guards18.isNotUndefined)(colorScheme)) {
7064
+ if ((0, import_type_guards21.isNotUndefined)(colorScheme)) {
6696
7065
  console.warn("colorScheme prop is ignored when appearance is dangerous");
6697
7066
  }
6698
7067
  colorScheme = "error";
6699
7068
  }
6700
7069
  if (appearance === "gated") {
6701
- if ((0, import_type_guards18.isNotUndefined)(colorScheme)) {
7070
+ if ((0, import_type_guards21.isNotUndefined)(colorScheme)) {
6702
7071
  console.warn("colorScheme prop is ignored when appearance is gated");
6703
7072
  }
6704
7073
  colorScheme = "purple";
6705
- badge = /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(Icon, { type: "sparkle" });
7074
+ badge = /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(Icon, { type: "sparkle" });
6706
7075
  }
6707
- return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
7076
+ return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
6708
7077
  StyledButton3,
6709
7078
  {
6710
7079
  ...props,
@@ -6713,9 +7082,9 @@ var MenuItemButton = (0, import_react15.forwardRef)(({ children, appearance, com
6713
7082
  colorScheme: colorScheme ?? "default",
6714
7083
  fullWidth: true,
6715
7084
  variant: "ghost",
6716
- children: /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(StyledMenuContent, { children: [
7085
+ children: /* @__PURE__ */ (0, import_jsx_runtime181.jsxs)(StyledMenuContent, { children: [
6717
7086
  children,
6718
- (0, import_type_guards18.isNotNil)(badge) || (0, import_type_guards18.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null
7087
+ (0, import_type_guards21.isNotNil)(badge) || (0, import_type_guards21.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null
6719
7088
  ] })
6720
7089
  }
6721
7090
  );
@@ -6723,12 +7092,12 @@ var MenuItemButton = (0, import_react15.forwardRef)(({ children, appearance, com
6723
7092
  MenuItemButton.displayName = "MenuItemButton";
6724
7093
 
6725
7094
  // src/components/Menu/MenuItemLabelDescription.tsx
6726
- var import_styled_components33 = __toESM(require("styled-components"));
6727
- var import_jsx_runtime176 = require("react/jsx-runtime");
6728
- var StyledMenuItemLabel = (0, import_styled_components33.default)(Text).attrs({ variant: "label3" })`
7095
+ var import_styled_components37 = __toESM(require("styled-components"));
7096
+ var import_jsx_runtime182 = require("react/jsx-runtime");
7097
+ var StyledMenuItemLabel = (0, import_styled_components37.default)(Text).attrs({ variant: "label3" })`
6729
7098
  grid-area: label;
6730
7099
  `;
6731
- var StyledMenuItemDescription = (0, import_styled_components33.default)(Text).attrs({
7100
+ var StyledMenuItemDescription = (0, import_styled_components37.default)(Text).attrs({
6732
7101
  variant: "label4",
6733
7102
  prominence: "secondary"
6734
7103
  })`
@@ -6736,15 +7105,15 @@ var StyledMenuItemDescription = (0, import_styled_components33.default)(Text).at
6736
7105
  grid-area: description;
6737
7106
  `;
6738
7107
  var MenuItemLabel = ({ children }) => {
6739
- return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StyledMenuItemLabel, { children });
7108
+ return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(StyledMenuItemLabel, { children });
6740
7109
  };
6741
7110
  var MenuItemDescription = ({ children }) => {
6742
- return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StyledMenuItemDescription, { children });
7111
+ return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(StyledMenuItemDescription, { children });
6743
7112
  };
6744
7113
 
6745
7114
  // src/components/Menu/SubMenu.tsx
6746
- var import_jsx_runtime177 = require("react/jsx-runtime");
6747
- var SubMenuContent = (0, import_styled_components34.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
7115
+ var import_jsx_runtime183 = require("react/jsx-runtime");
7116
+ var SubMenuContent = (0, import_styled_components38.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
6748
7117
  ${menuContentCss}
6749
7118
  width: 298px;
6750
7119
 
@@ -6752,10 +7121,10 @@ var SubMenuContent = (0, import_styled_components34.default)(import_react_dropdo
6752
7121
  transform: translateX(-100%) !important;
6753
7122
  }
6754
7123
  `;
6755
- var StyledMobileSubMenuItems = import_styled_components34.default.div`
7124
+ var StyledMobileSubMenuItems = import_styled_components38.default.div`
6756
7125
  margin-left: var(--wui-space-04);
6757
7126
  `;
6758
- var StyledSubTrigger = (0, import_styled_components34.default)(import_react_dropdown_menu3.DropdownMenuSubTrigger)`
7127
+ var StyledSubTrigger = (0, import_styled_components38.default)(import_react_dropdown_menu3.DropdownMenuSubTrigger)`
6759
7128
  outline: none;
6760
7129
 
6761
7130
  &[data-state='open'],
@@ -6766,11 +7135,11 @@ var StyledSubTrigger = (0, import_styled_components34.default)(import_react_drop
6766
7135
  var SubMenuTrigger = (props) => {
6767
7136
  const { isSmAndUp } = useMq();
6768
7137
  const Trigger2 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
6769
- return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(Trigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
7138
+ return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(Trigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
6770
7139
  MenuItemButton,
6771
7140
  {
6772
7141
  ...props,
6773
- rightIcon: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(Icon, { type: "caret-right" })
7142
+ rightIcon: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(Icon, { type: "caret-right" })
6774
7143
  }
6775
7144
  ) });
6776
7145
  };
@@ -6782,15 +7151,15 @@ var SubMenu = ({
6782
7151
  ...props
6783
7152
  }) => {
6784
7153
  const { isSmAndUp } = useMq();
6785
- const [isExpanded, setIsExpanded] = (0, import_react16.useState)(false);
6786
- return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
6787
- /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(SubMenuTrigger, { ...props, children: [
6788
- /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(MenuItemLabel, { children: label }),
6789
- /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(MenuItemDescription, { children: description })
7154
+ const [isExpanded, setIsExpanded] = (0, import_react23.useState)(false);
7155
+ return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
7156
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(SubMenuTrigger, { ...props, children: [
7157
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(MenuItemLabel, { children: label }),
7158
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(MenuItemDescription, { children: description })
6790
7159
  ] }),
6791
- /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(SubMenuContent, { children }) })
6792
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
6793
- /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(
7160
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(SubMenuContent, { children }) })
7161
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
7162
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(
6794
7163
  SubMenuTrigger,
6795
7164
  {
6796
7165
  ...props,
@@ -6799,28 +7168,28 @@ var SubMenu = ({
6799
7168
  setIsExpanded((prev) => !prev);
6800
7169
  },
6801
7170
  children: [
6802
- /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(MenuItemLabel, { children: label }),
6803
- /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(MenuItemDescription, { children: description })
7171
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(MenuItemLabel, { children: label }),
7172
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(MenuItemDescription, { children: description })
6804
7173
  ]
6805
7174
  }
6806
7175
  ),
6807
- /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
7176
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
6808
7177
  ] });
6809
7178
  };
6810
7179
  SubMenu.displayName = "SubMenu";
6811
7180
 
6812
7181
  // src/components/Menu/MenuItem.tsx
6813
- var import_react17 = require("react");
7182
+ var import_react24 = require("react");
6814
7183
  var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
6815
- var import_jsx_runtime178 = require("react/jsx-runtime");
6816
- var MenuItem = (0, import_react17.forwardRef)(
7184
+ var import_jsx_runtime184 = require("react/jsx-runtime");
7185
+ var MenuItem = (0, import_react24.forwardRef)(
6817
7186
  ({ onSelect = () => null, ...props }, ref) => {
6818
- return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
7187
+ return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
6819
7188
  import_react_dropdown_menu4.DropdownMenuItem,
6820
7189
  {
6821
7190
  asChild: true,
6822
7191
  onSelect,
6823
- children: /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
7192
+ children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
6824
7193
  MenuItemButton,
6825
7194
  {
6826
7195
  ...props,
@@ -6836,10 +7205,10 @@ MenuItem.displayName = "MenuItem";
6836
7205
 
6837
7206
  // src/components/Menu/MenuRadioGroup.tsx
6838
7207
  var import_react_dropdown_menu5 = require("@radix-ui/react-dropdown-menu");
6839
- var import_jsx_runtime179 = require("react/jsx-runtime");
7208
+ var import_jsx_runtime185 = require("react/jsx-runtime");
6840
7209
  var MenuRadioGroup = ({ children, label, ...props }) => {
6841
- return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)(import_react_dropdown_menu5.DropdownMenuRadioGroup, { ...props, children: [
6842
- /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(MenuLabel, { children: label }),
7210
+ return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(import_react_dropdown_menu5.DropdownMenuRadioGroup, { ...props, children: [
7211
+ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(MenuLabel, { children: label }),
6843
7212
  children
6844
7213
  ] });
6845
7214
  };
@@ -6847,11 +7216,11 @@ MenuRadioGroup.displayName = "MenuRadioGroup";
6847
7216
 
6848
7217
  // src/components/Menu/RadioMenuItem.tsx
6849
7218
  var import_react_dropdown_menu6 = require("@radix-ui/react-dropdown-menu");
6850
- var import_jsx_runtime180 = require("react/jsx-runtime");
7219
+ var import_jsx_runtime186 = require("react/jsx-runtime");
6851
7220
  var RadioMenuItem = ({
6852
7221
  onSelect,
6853
7222
  value,
6854
- indicator = /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
7223
+ indicator = /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
6855
7224
  Icon,
6856
7225
  {
6857
7226
  size: "sm",
@@ -6861,16 +7230,16 @@ var RadioMenuItem = ({
6861
7230
  ...props
6862
7231
  }) => {
6863
7232
  const extraProps = onSelect ? { onSelect } : {};
6864
- return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
7233
+ return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
6865
7234
  import_react_dropdown_menu6.DropdownMenuRadioItem,
6866
7235
  {
6867
7236
  ...extraProps,
6868
7237
  value,
6869
- children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
7238
+ children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
6870
7239
  MenuItemButton,
6871
7240
  {
6872
7241
  ...props,
6873
- rightIcon: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_react_dropdown_menu6.DropdownMenuItemIndicator, { children: indicator })
7242
+ rightIcon: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_react_dropdown_menu6.DropdownMenuItemIndicator, { children: indicator })
6874
7243
  }
6875
7244
  )
6876
7245
  }
@@ -6880,38 +7249,86 @@ RadioMenuItem.displayName = "RadioMenuItem";
6880
7249
 
6881
7250
  // src/components/Menu/CheckboxMenuItem.tsx
6882
7251
  var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
6883
- var import_jsx_runtime181 = require("react/jsx-runtime");
7252
+ var import_jsx_runtime187 = require("react/jsx-runtime");
7253
+ var CheckboxIndicator2 = ({ checked, ...props }) => {
7254
+ return checked ? /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
7255
+ "svg",
7256
+ {
7257
+ ...props,
7258
+ fill: "none",
7259
+ height: "16",
7260
+ viewBox: "0 0 16 16",
7261
+ width: "16",
7262
+ xmlns: "http://www.w3.org/2000/svg",
7263
+ children: [
7264
+ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
7265
+ "path",
7266
+ {
7267
+ 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",
7268
+ fill: "#2949E5"
7269
+ }
7270
+ ),
7271
+ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
7272
+ "path",
7273
+ {
7274
+ 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",
7275
+ stroke: "#D9D9DE"
7276
+ }
7277
+ ),
7278
+ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
7279
+ "path",
7280
+ {
7281
+ 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",
7282
+ fill: "white"
7283
+ }
7284
+ )
7285
+ ]
7286
+ }
7287
+ ) : /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
7288
+ "svg",
7289
+ {
7290
+ ...props,
7291
+ fill: "none",
7292
+ height: "16",
7293
+ viewBox: "0 0 16 16",
7294
+ width: "16",
7295
+ xmlns: "http://www.w3.org/2000/svg",
7296
+ children: [
7297
+ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
7298
+ "path",
7299
+ {
7300
+ 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",
7301
+ fill: "#FCFCFD"
7302
+ }
7303
+ ),
7304
+ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
7305
+ "path",
7306
+ {
7307
+ 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",
7308
+ stroke: "#D9D9DE"
7309
+ }
7310
+ )
7311
+ ]
7312
+ }
7313
+ );
7314
+ };
6884
7315
  var CheckboxMenuItem = ({
6885
- onSelect,
7316
+ onSelect = () => null,
6886
7317
  checked,
6887
7318
  onCheckedChange,
6888
- indicator = /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
6889
- Icon,
6890
- {
6891
- size: "sm",
6892
- type: "checkmark"
6893
- }
6894
- ),
6895
7319
  ...props
6896
7320
  }) => {
6897
- let extraProps = {};
6898
- if (onSelect) {
6899
- extraProps = {
6900
- ...extraProps,
6901
- onCheckedChange,
6902
- onSelect
6903
- };
6904
- }
6905
- return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
7321
+ return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
6906
7322
  import_react_dropdown_menu7.DropdownMenuCheckboxItem,
6907
7323
  {
6908
- ...extraProps,
6909
7324
  checked,
6910
- children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
7325
+ onCheckedChange,
7326
+ onSelect,
7327
+ children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
6911
7328
  MenuItemButton,
6912
7329
  {
6913
7330
  ...props,
6914
- rightIcon: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(import_react_dropdown_menu7.DropdownMenuItemIndicator, { children: indicator })
7331
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(CheckboxIndicator2, { checked })
6915
7332
  }
6916
7333
  )
6917
7334
  }
@@ -6920,17 +7337,16 @@ var CheckboxMenuItem = ({
6920
7337
  CheckboxMenuItem.displayName = "CheckboxMenuItem";
6921
7338
 
6922
7339
  // src/components/Radio/Radio.tsx
6923
- var import_react18 = require("react");
6924
- var import_styled_components35 = __toESM(require("styled-components"));
6925
- var import_type_guards19 = require("@wistia/type-guards");
6926
- var import_jsx_runtime182 = require("react/jsx-runtime");
6927
- var StyledLabelWrapper2 = import_styled_components35.default.div`
7340
+ var import_react25 = require("react");
7341
+ var import_styled_components39 = __toESM(require("styled-components"));
7342
+ var import_type_guards22 = require("@wistia/type-guards");
7343
+ var import_jsx_runtime188 = require("react/jsx-runtime");
7344
+ var StyledLabelWrapper2 = import_styled_components39.default.div`
6928
7345
  display: flex;
6929
7346
  flex-direction: column;
6930
7347
  padding-left: var(--wui-space-02);
6931
7348
  `;
6932
- var StyledRadio = import_styled_components35.default.input`
6933
- align-self: flex-start;
7349
+ var StyledRadio = import_styled_components39.default.input`
6934
7350
  box-shadow: ${({ type }) => type === "checkbox" ? "inset 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.38)" : "none"};
6935
7351
  appearance: none;
6936
7352
  margin: 0;
@@ -6940,7 +7356,6 @@ var StyledRadio = import_styled_components35.default.input`
6940
7356
  height: 14px;
6941
7357
  border: 1px solid var(--wui-color-border);
6942
7358
  border-radius: 50%;
6943
- transform: translateY(5px); /* visually center the radio button */
6944
7359
  display: grid;
6945
7360
  place-content: center;
6946
7361
 
@@ -6957,11 +7372,11 @@ var StyledRadio = import_styled_components35.default.input`
6957
7372
  transform: scale(1);
6958
7373
  }
6959
7374
  `;
6960
- var disabledStyle2 = import_styled_components35.css`
7375
+ var disabledStyle2 = import_styled_components39.css`
6961
7376
  cursor: not-allowed;
6962
7377
  opacity: 0.5;
6963
7378
  `;
6964
- var errorStyle = import_styled_components35.css`
7379
+ var errorStyle = import_styled_components39.css`
6965
7380
  /* TODO Lamp to design error state */
6966
7381
  &:hover,
6967
7382
  &:focus,
@@ -6969,12 +7384,12 @@ var errorStyle = import_styled_components35.css`
6969
7384
  border-color: transparent !important;
6970
7385
  }
6971
7386
  `;
6972
- var defaultHoverStyle = import_styled_components35.css`
7387
+ var defaultHoverStyle = import_styled_components39.css`
6973
7388
  /* TODO Lamp to design hover state */
6974
7389
  cursor: pointer;
6975
7390
  `;
6976
- var StyledRadioWrapper = import_styled_components35.default.div`
6977
- align-items: center;
7391
+ var StyledRadioWrapper = import_styled_components39.default.div`
7392
+ align-items: baseline;
6978
7393
  border: 1px solid transparent;
6979
7394
  border-radius: 4px;
6980
7395
  display: flex;
@@ -6990,14 +7405,16 @@ var StyledRadioWrapper = import_styled_components35.default.div`
6990
7405
  background-color: #efefef;
6991
7406
  }
6992
7407
 
6993
- ${({ hasError }) => hasError && errorStyle};
7408
+ &[aria-invalid='true'] {
7409
+ ${errorStyle};
7410
+ }
7411
+
6994
7412
  ${({ disabled }) => disabled && disabledStyle2};
6995
7413
  `;
6996
- var Radio = (0, import_react18.forwardRef)(
7414
+ var Radio = (0, import_react25.forwardRef)(
6997
7415
  ({
6998
7416
  checked,
6999
7417
  disabled = false,
7000
- hasError = false,
7001
7418
  id,
7002
7419
  label,
7003
7420
  description,
@@ -7007,15 +7424,15 @@ var Radio = (0, import_react18.forwardRef)(
7007
7424
  value = "false",
7008
7425
  ...otherProps
7009
7426
  }, ref) => {
7010
- const generatedId = (0, import_react18.useId)();
7011
- const computedId = (0, import_type_guards19.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
7012
- return /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(
7427
+ const generatedId = (0, import_react25.useId)();
7428
+ const computedId = (0, import_type_guards22.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
7429
+ return /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(
7013
7430
  StyledRadioWrapper,
7014
7431
  {
7432
+ "aria-invalid": otherProps["aria-invalid"],
7015
7433
  disabled,
7016
- hasError,
7017
7434
  children: [
7018
- /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
7435
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
7019
7436
  StyledRadio,
7020
7437
  {
7021
7438
  ref,
@@ -7030,8 +7447,8 @@ var Radio = (0, import_react18.forwardRef)(
7030
7447
  ...otherProps
7031
7448
  }
7032
7449
  ),
7033
- /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(StyledLabelWrapper2, { children: [
7034
- /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
7450
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(StyledLabelWrapper2, { children: [
7451
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
7035
7452
  Label,
7036
7453
  {
7037
7454
  disabled,
@@ -7040,7 +7457,7 @@ var Radio = (0, import_react18.forwardRef)(
7040
7457
  children: label
7041
7458
  }
7042
7459
  ),
7043
- /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(LabelDescription, { children: description })
7460
+ /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(LabelDescription, { children: description })
7044
7461
  ] })
7045
7462
  ]
7046
7463
  }
@@ -7050,11 +7467,11 @@ var Radio = (0, import_react18.forwardRef)(
7050
7467
  Radio.displayName = "Radio";
7051
7468
 
7052
7469
  // src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
7053
- var import_styled_components36 = __toESM(require("styled-components"));
7054
- var import_type_guards20 = require("@wistia/type-guards");
7055
- var import_jsx_runtime183 = require("react/jsx-runtime");
7056
- var VisuallyHidden = import_styled_components36.default.div({ ...visuallyHiddenStyle });
7057
- var VisuallyHiddenButFocusable = import_styled_components36.default.div({
7470
+ var import_styled_components40 = __toESM(require("styled-components"));
7471
+ var import_type_guards23 = require("@wistia/type-guards");
7472
+ var import_jsx_runtime189 = require("react/jsx-runtime");
7473
+ var VisuallyHidden = import_styled_components40.default.div({ ...visuallyHiddenStyle });
7474
+ var VisuallyHiddenButFocusable = import_styled_components40.default.div({
7058
7475
  "&:not(:focus-within)": visuallyHiddenStyle
7059
7476
  });
7060
7477
  var ScreenReaderOnly = ({
@@ -7063,53 +7480,20 @@ var ScreenReaderOnly = ({
7063
7480
  focusable = false,
7064
7481
  ...otherProps
7065
7482
  }) => {
7066
- const accessibleText = (0, import_type_guards20.isNotNil)(text) ? text : children;
7483
+ const accessibleText = (0, import_type_guards23.isNotNil)(text) ? text : children;
7067
7484
  if (focusable) {
7068
- return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
7485
+ return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
7069
7486
  }
7070
- return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
7487
+ return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
7071
7488
  };
7072
7489
  ScreenReaderOnly.displayName = "ScreenReaderOnly";
7073
7490
 
7074
- // src/components/Stack/Stack.tsx
7075
- var import_react19 = require("react");
7076
- var import_styled_components37 = __toESM(require("styled-components"));
7077
- var import_jsx_runtime184 = require("react/jsx-runtime");
7078
- var DEFAULT_ELEMENT3 = "div";
7079
- var StyledStack = import_styled_components37.default.div`
7080
- display: flex;
7081
- flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
7082
- gap: ${({ $gap }) => `var(--wui-${$gap})`};
7083
-
7084
- > * {
7085
- flex: 1;
7086
- }
7087
- `;
7088
- var StackComponent = (0, import_react19.forwardRef)(
7089
- ({ renderAs, direction = "vertical", gap = "space-02", ...props }, ref) => {
7090
- const responsiveGap = useResponsiveProp(gap);
7091
- const responsiveDirection = useResponsiveProp(direction);
7092
- return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
7093
- StyledStack,
7094
- {
7095
- ref,
7096
- $direction: responsiveDirection,
7097
- $gap: responsiveGap,
7098
- as: renderAs ?? DEFAULT_ELEMENT3,
7099
- ...props
7100
- }
7101
- );
7102
- }
7103
- );
7104
- StackComponent.displayName = "Stack";
7105
- var Stack = makePolymorphic(StackComponent);
7106
-
7107
7491
  // src/components/Tag/Tag.tsx
7108
- var import_react20 = require("react");
7109
- var import_styled_components38 = __toESM(require("styled-components"));
7110
- var import_type_guards21 = require("@wistia/type-guards");
7111
- var import_jsx_runtime185 = require("react/jsx-runtime");
7112
- var TagLabel = import_styled_components38.default.a`
7492
+ var import_react26 = require("react");
7493
+ var import_styled_components41 = __toESM(require("styled-components"));
7494
+ var import_type_guards24 = require("@wistia/type-guards");
7495
+ var import_jsx_runtime190 = require("react/jsx-runtime");
7496
+ var TagLabel = import_styled_components41.default.a`
7113
7497
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7114
7498
  font-size: var(--wui-typography-label-4-size);
7115
7499
  font-weight: var(--wui-typography-label-4-weight);
@@ -7137,14 +7521,14 @@ var TagLabel = import_styled_components38.default.a`
7137
7521
  box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
7138
7522
  }
7139
7523
  `;
7140
- var TagDivider = import_styled_components38.default.div`
7524
+ var TagDivider = import_styled_components41.default.div`
7141
7525
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7142
7526
  border-left: 1px solid var(--wui-color-border);
7143
7527
  display: flex;
7144
7528
  height: 14px;
7145
7529
  width: 1px;
7146
7530
  `;
7147
- var StyledRemoveButton = import_styled_components38.default.button`
7531
+ var StyledRemoveButton = import_styled_components41.default.button`
7148
7532
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7149
7533
  all: unset;
7150
7534
  cursor: pointer;
@@ -7172,7 +7556,7 @@ var StyledRemoveButton = import_styled_components38.default.button`
7172
7556
  box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
7173
7557
  }
7174
7558
  `;
7175
- var StyledTag = import_styled_components38.default.div`
7559
+ var StyledTag = import_styled_components41.default.div`
7176
7560
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
7177
7561
  align-items: center;
7178
7562
  background-color: var(--wui-color-bg-surface-secondary);
@@ -7181,47 +7565,47 @@ var StyledTag = import_styled_components38.default.div`
7181
7565
  overflow: hidden;
7182
7566
  `;
7183
7567
  var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
7184
- if ((0, import_type_guards21.isNil)(onClickRemove)) {
7568
+ if ((0, import_type_guards24.isNil)(onClickRemove)) {
7185
7569
  return null;
7186
7570
  }
7187
- if ((0, import_type_guards21.isNil)(onClickRemoveLabel)) {
7571
+ if ((0, import_type_guards24.isNil)(onClickRemoveLabel)) {
7188
7572
  throw new Error(
7189
7573
  "for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
7190
7574
  );
7191
7575
  }
7192
- return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(import_jsx_runtime185.Fragment, { children: [
7193
- /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(TagDivider, { $colorScheme: colorScheme }),
7194
- /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
7576
+ return /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(import_jsx_runtime190.Fragment, { children: [
7577
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(TagDivider, { $colorScheme: colorScheme }),
7578
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(
7195
7579
  StyledRemoveButton,
7196
7580
  {
7197
7581
  $colorScheme: colorScheme,
7198
7582
  onClick: onClickRemove,
7199
7583
  type: "button",
7200
7584
  children: [
7201
- /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
7585
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
7202
7586
  Icon,
7203
7587
  {
7204
7588
  size: "sm",
7205
7589
  type: "close"
7206
7590
  }
7207
7591
  ),
7208
- /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
7592
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
7209
7593
  ]
7210
7594
  }
7211
7595
  )
7212
7596
  ] });
7213
7597
  };
7214
- var Tag = (0, import_react20.forwardRef)(
7598
+ var Tag = (0, import_react26.forwardRef)(
7215
7599
  ({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
7216
- const labelProps = (0, import_type_guards21.isNotNil)(href) && (0, import_type_guards21.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
7217
- return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
7600
+ const labelProps = (0, import_type_guards24.isNotNil)(href) && (0, import_type_guards24.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
7601
+ return /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(
7218
7602
  StyledTag,
7219
7603
  {
7220
7604
  ref,
7221
7605
  $colorScheme: colorScheme,
7222
7606
  ...otherProps,
7223
7607
  children: [
7224
- /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
7608
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
7225
7609
  TagLabel,
7226
7610
  {
7227
7611
  ...labelProps,
@@ -7229,7 +7613,7 @@ var Tag = (0, import_react20.forwardRef)(
7229
7613
  children: label
7230
7614
  }
7231
7615
  ),
7232
- /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(
7616
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
7233
7617
  RemoveButton,
7234
7618
  {
7235
7619
  colorScheme,
@@ -7245,26 +7629,26 @@ var Tag = (0, import_react20.forwardRef)(
7245
7629
  Tag.displayName = "Tag";
7246
7630
 
7247
7631
  // src/components/WistiaLogo/WistiaLogo.tsx
7248
- var import_styled_components39 = __toESM(require("styled-components"));
7249
- var import_type_guards22 = require("@wistia/type-guards");
7250
- var import_jsx_runtime186 = require("react/jsx-runtime");
7632
+ var import_styled_components42 = __toESM(require("styled-components"));
7633
+ var import_type_guards25 = require("@wistia/type-guards");
7634
+ var import_jsx_runtime191 = require("react/jsx-runtime");
7251
7635
  var renderBrandmark = (brandmarkColor, iconOnly) => {
7252
7636
  if (iconOnly) {
7253
- return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
7637
+ return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
7254
7638
  "g",
7255
7639
  {
7256
7640
  "data-testid": "ui-wistia-logo-brandmark",
7257
7641
  fill: brandmarkColor,
7258
- children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("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" })
7642
+ children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("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" })
7259
7643
  }
7260
7644
  );
7261
7645
  }
7262
- return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
7646
+ return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
7263
7647
  "g",
7264
7648
  {
7265
7649
  "data-testid": "ui-wistia-logo-brandmark",
7266
7650
  fill: brandmarkColor,
7267
- children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("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" })
7651
+ children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("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" })
7268
7652
  }
7269
7653
  );
7270
7654
  };
@@ -7272,12 +7656,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
7272
7656
  if (iconOnly) {
7273
7657
  return null;
7274
7658
  }
7275
- return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
7659
+ return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
7276
7660
  "g",
7277
7661
  {
7278
7662
  "data-testid": "ui-wistia-logo-logotype",
7279
7663
  fill: logotypeColor,
7280
- children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("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" })
7664
+ children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("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" })
7281
7665
  }
7282
7666
  );
7283
7667
  };
@@ -7287,7 +7671,7 @@ var computedViewBox = (iconOnly) => {
7287
7671
  }
7288
7672
  return "0 0 144 31.47";
7289
7673
  };
7290
- var WistiaLogoComponent = import_styled_components39.default.svg`
7674
+ var WistiaLogoComponent = import_styled_components42.default.svg`
7291
7675
  height: ${({ height }) => `${height}px`};
7292
7676
 
7293
7677
  /* ensure it will always fit on mobile */
@@ -7329,7 +7713,7 @@ var WistiaLogo = ({
7329
7713
  };
7330
7714
  const brandmarkColor = VARIANT_COLORS[variant].brandmark;
7331
7715
  const logotypeColor = VARIANT_COLORS[variant].logotype;
7332
- const Logo = /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(
7716
+ const Logo = /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
7333
7717
  WistiaLogoComponent,
7334
7718
  {
7335
7719
  $hoverColor: hoverColor,
@@ -7339,16 +7723,37 @@ var WistiaLogo = ({
7339
7723
  xmlns: "http://www.w3.org/2000/svg",
7340
7724
  ...otherProps,
7341
7725
  children: [
7342
- /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("title", { children: title }),
7343
- (0, import_type_guards22.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("desc", { children: description }) : null,
7726
+ /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("title", { children: title }),
7727
+ (0, import_type_guards25.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("desc", { children: description }) : null,
7344
7728
  renderBrandmark(brandmarkColor, iconOnly),
7345
7729
  renderLogotype(logotypeColor, iconOnly)
7346
7730
  ]
7347
7731
  }
7348
7732
  );
7349
- return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("a", { href, children: Logo }) : Logo;
7733
+ return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("a", { href, children: Logo }) : Logo;
7350
7734
  };
7351
7735
  WistiaLogo.displayName = "WistiaLogo";
7736
+
7737
+ // src/components/FormGroup/RadioGroup.tsx
7738
+ var import_react27 = require("react");
7739
+ var import_jsx_runtime192 = require("react/jsx-runtime");
7740
+ var RadioGroupContext = (0, import_react27.createContext)(null);
7741
+ var RadioGroup = ({
7742
+ children,
7743
+ name,
7744
+ onChange,
7745
+ value,
7746
+ ...props
7747
+ }) => {
7748
+ const context = (0, import_react27.useMemo)(() => {
7749
+ return {
7750
+ name,
7751
+ onChange
7752
+ };
7753
+ }, [name, onChange]);
7754
+ return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(FormGroup, { ...props, children }) });
7755
+ };
7756
+ RadioGroup.displayName = "RadioGroup";
7352
7757
  // Annotate the CommonJS export names for ESM import in node:
7353
7758
  0 && (module.exports = {
7354
7759
  Avatar,
@@ -7357,10 +7762,15 @@ WistiaLogo.displayName = "WistiaLogo";
7357
7762
  Button,
7358
7763
  ButtonGroup,
7359
7764
  Checkbox,
7765
+ CheckboxGroup,
7360
7766
  CheckboxMenuItem,
7361
7767
  ColorSchemeWrapper,
7362
7768
  Divider,
7363
7769
  Ellipsis,
7770
+ Form,
7771
+ FormErrorSummary,
7772
+ FormField,
7773
+ FormGroup,
7364
7774
  Heading,
7365
7775
  Icon,
7366
7776
  IconButton,
@@ -7373,6 +7783,7 @@ WistiaLogo.displayName = "WistiaLogo";
7373
7783
  MenuLabel,
7374
7784
  MenuRadioGroup,
7375
7785
  Radio,
7786
+ RadioGroup,
7376
7787
  RadioMenuItem,
7377
7788
  ScreenReaderOnly,
7378
7789
  Stack,
@@ -7390,6 +7801,7 @@ WistiaLogo.displayName = "WistiaLogo";
7390
7801
  mq,
7391
7802
  useActiveMq,
7392
7803
  useAriaLive,
7804
+ useFormState,
7393
7805
  useMq,
7394
7806
  useWindowSize
7395
7807
  });