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