@wistia/ui 0.8.21-beta.ff13f5f1.7e81e7b → 0.8.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 +502 -451
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +58 -25
- package/dist/index.d.ts +58 -25
- package/dist/index.mjs +370 -319
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.
|
|
3
|
+
* @license @wistia/ui v0.8.22
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -57,7 +57,6 @@ __export(index_exports, {
|
|
|
57
57
|
CollapsibleContent: () => CollapsibleContent,
|
|
58
58
|
CollapsibleTrigger: () => CollapsibleTrigger,
|
|
59
59
|
ColorSchemeWrapper: () => ColorSchemeWrapper,
|
|
60
|
-
ConditionalButton: () => ConditionalButton,
|
|
61
60
|
DataCard: () => DataCard,
|
|
62
61
|
DataCardTrend: () => DataCardTrend,
|
|
63
62
|
DataCards: () => DataCards,
|
|
@@ -78,6 +77,7 @@ __export(index_exports, {
|
|
|
78
77
|
ImageDimensionsValidator: () => import_validators.ImageDimensionsValidator,
|
|
79
78
|
Input: () => Input,
|
|
80
79
|
InputClickToCopy: () => InputClickToCopy,
|
|
80
|
+
KeyboardShortcut: () => KeyboardShortcut,
|
|
81
81
|
Label: () => Label,
|
|
82
82
|
Link: () => Link,
|
|
83
83
|
Menu: () => Menu,
|
|
@@ -7118,6 +7118,8 @@ var Link = (0, import_react21.forwardRef)(
|
|
|
7118
7118
|
underline = false,
|
|
7119
7119
|
leftIcon,
|
|
7120
7120
|
rightIcon,
|
|
7121
|
+
"aria-disabled": ariaDisabled,
|
|
7122
|
+
role,
|
|
7121
7123
|
...props
|
|
7122
7124
|
}, ref) => {
|
|
7123
7125
|
const inRouterContext = (0, import_react_router_dom.useInRouterContext)();
|
|
@@ -7151,7 +7153,8 @@ var Link = (0, import_react21.forwardRef)(
|
|
|
7151
7153
|
$colorScheme: colorScheme,
|
|
7152
7154
|
$disabled: disabled,
|
|
7153
7155
|
$underline: underline,
|
|
7154
|
-
onClick: handleClick
|
|
7156
|
+
onClick: handleClick,
|
|
7157
|
+
"aria-disabled": ariaDisabled ?? (disabled ? "true" : void 0)
|
|
7155
7158
|
};
|
|
7156
7159
|
if (isButton(props)) {
|
|
7157
7160
|
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
@@ -7184,11 +7187,18 @@ var Link = (0, import_react21.forwardRef)(
|
|
|
7184
7187
|
...externalLinkProps,
|
|
7185
7188
|
...routerSpecificProps
|
|
7186
7189
|
};
|
|
7187
|
-
return /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)(
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)(
|
|
7191
|
+
StyledLink,
|
|
7192
|
+
{
|
|
7193
|
+
...combinedProps,
|
|
7194
|
+
role: role ?? (disabled ? "link" : void 0),
|
|
7195
|
+
children: [
|
|
7196
|
+
leftIcon ?? null,
|
|
7197
|
+
children,
|
|
7198
|
+
rightIcon ?? null
|
|
7199
|
+
]
|
|
7200
|
+
}
|
|
7201
|
+
);
|
|
7192
7202
|
}
|
|
7193
7203
|
return null;
|
|
7194
7204
|
}
|
|
@@ -8581,112 +8591,52 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
8581
8591
|
] }) });
|
|
8582
8592
|
};
|
|
8583
8593
|
|
|
8584
|
-
// src/components/ConditionalButton/ConditionalButton.tsx
|
|
8585
|
-
var import_react32 = __toESM(require("react"));
|
|
8586
|
-
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8587
|
-
var import_react33 = require("react");
|
|
8588
|
-
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
8589
|
-
var StyledButton2 = (0, import_styled_components39.default)(Button)`
|
|
8590
|
-
all: unset;
|
|
8591
|
-
&:focus {
|
|
8592
|
-
outline: none;
|
|
8593
|
-
}
|
|
8594
|
-
&:focus-visible {
|
|
8595
|
-
outline: 2px solid var(--wui-color-focus-ring);
|
|
8596
|
-
outline-offset: 2px;
|
|
8597
|
-
}
|
|
8598
|
-
`;
|
|
8599
|
-
var ConditionalButton = ({
|
|
8600
|
-
children,
|
|
8601
|
-
onClick,
|
|
8602
|
-
href,
|
|
8603
|
-
defaultElement = "span",
|
|
8604
|
-
...props
|
|
8605
|
-
}) => {
|
|
8606
|
-
const isButton2 = onClick !== void 0;
|
|
8607
|
-
const isLink3 = href !== void 0;
|
|
8608
|
-
const isInteractive = isButton2 || isLink3;
|
|
8609
|
-
const DefaultElement = defaultElement;
|
|
8610
|
-
if (!isInteractive) {
|
|
8611
|
-
if ((0, import_react33.isValidElement)(children)) {
|
|
8612
|
-
return import_react32.default.cloneElement(children, props);
|
|
8613
|
-
}
|
|
8614
|
-
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(DefaultElement, { ...props, children });
|
|
8615
|
-
}
|
|
8616
|
-
const commonProps = {
|
|
8617
|
-
children,
|
|
8618
|
-
unstyled: true,
|
|
8619
|
-
"data-wui-conditional-button": props.isLoading ? "loading" : "true",
|
|
8620
|
-
...props
|
|
8621
|
-
};
|
|
8622
|
-
const buttonProps = isLink3 ? { href, ...commonProps } : {
|
|
8623
|
-
onClick,
|
|
8624
|
-
type: "button",
|
|
8625
|
-
...commonProps
|
|
8626
|
-
};
|
|
8627
|
-
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledButton2, { ...buttonProps });
|
|
8628
|
-
};
|
|
8629
|
-
var getConditionalButtonProps = (props) => {
|
|
8630
|
-
const { children, onClick, href, disabled, defaultElement, isLoading, beforeAction, ...rest } = props;
|
|
8631
|
-
return {
|
|
8632
|
-
children,
|
|
8633
|
-
onClick,
|
|
8634
|
-
href,
|
|
8635
|
-
disabled,
|
|
8636
|
-
defaultElement,
|
|
8637
|
-
isLoading,
|
|
8638
|
-
beforeAction,
|
|
8639
|
-
...rest
|
|
8640
|
-
};
|
|
8641
|
-
};
|
|
8642
|
-
ConditionalButton.displayName = "ConditionalButton";
|
|
8643
|
-
|
|
8644
8594
|
// src/components/DataCards/DataCard.tsx
|
|
8645
|
-
var
|
|
8595
|
+
var import_styled_components40 = __toESM(require("styled-components"));
|
|
8646
8596
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8647
8597
|
|
|
8648
8598
|
// src/components/Heading/Heading.tsx
|
|
8649
|
-
var
|
|
8650
|
-
var
|
|
8599
|
+
var import_react32 = require("react");
|
|
8600
|
+
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8651
8601
|
var import_type_guards28 = require("@wistia/type-guards");
|
|
8652
|
-
var
|
|
8653
|
-
var heroStyle =
|
|
8602
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
8603
|
+
var heroStyle = import_styled_components39.css`
|
|
8654
8604
|
--font-family: var(--wui-typography-heading-hero-family);
|
|
8655
8605
|
--font-size: var(--wui-typography-heading-hero-size);
|
|
8656
8606
|
--font-weight: var(--wui-typography-heading-hero-weight);
|
|
8657
8607
|
--line-height: var(--wui-typography-heading-hero-line-height);
|
|
8658
8608
|
`;
|
|
8659
|
-
var heading1TextStyle =
|
|
8609
|
+
var heading1TextStyle = import_styled_components39.css`
|
|
8660
8610
|
--font-family: var(--wui-typography-heading-1-family);
|
|
8661
8611
|
--font-size: var(--wui-typography-heading-1-size);
|
|
8662
8612
|
--font-weight: var(--wui-typography-heading-1-weight);
|
|
8663
8613
|
--line-height: var(--wui-typography-heading-1-line-height);
|
|
8664
8614
|
`;
|
|
8665
|
-
var heading2TextStyle =
|
|
8615
|
+
var heading2TextStyle = import_styled_components39.css`
|
|
8666
8616
|
--font-family: var(--wui-typography-heading-2-family);
|
|
8667
8617
|
--font-size: var(--wui-typography-heading-2-size);
|
|
8668
8618
|
--font-weight: var(--wui-typography-heading-2-weight);
|
|
8669
8619
|
--line-height: var(--wui-typography-heading-2-line-height);
|
|
8670
8620
|
`;
|
|
8671
|
-
var heading3TextStyle =
|
|
8621
|
+
var heading3TextStyle = import_styled_components39.css`
|
|
8672
8622
|
--font-family: var(--wui-typography-heading-3-family);
|
|
8673
8623
|
--font-size: var(--wui-typography-heading-3-size);
|
|
8674
8624
|
--font-weight: var(--wui-typography-heading-3-weight);
|
|
8675
8625
|
--line-height: var(--wui-typography-heading-3-line-height);
|
|
8676
8626
|
`;
|
|
8677
|
-
var heading4TextStyle =
|
|
8627
|
+
var heading4TextStyle = import_styled_components39.css`
|
|
8678
8628
|
--font-family: var(--wui-typography-heading-4-family);
|
|
8679
8629
|
--font-size: var(--wui-typography-heading-4-size);
|
|
8680
8630
|
--font-weight: var(--wui-typography-heading-4-weight);
|
|
8681
8631
|
--line-height: var(--wui-typography-heading-4-line-height);
|
|
8682
8632
|
`;
|
|
8683
|
-
var heading5TextStyle =
|
|
8633
|
+
var heading5TextStyle = import_styled_components39.css`
|
|
8684
8634
|
--font-family: var(--wui-typography-heading-5-family);
|
|
8685
8635
|
--font-size: var(--wui-typography-heading-5-size);
|
|
8686
8636
|
--font-weight: var(--wui-typography-heading-5-weight);
|
|
8687
8637
|
--line-height: var(--wui-typography-heading-5-line-height);
|
|
8688
8638
|
`;
|
|
8689
|
-
var heading6TextStyle =
|
|
8639
|
+
var heading6TextStyle = import_styled_components39.css`
|
|
8690
8640
|
--font-family: var(--wui-typography-heading-6-family);
|
|
8691
8641
|
--font-size: var(--wui-typography-heading-6-size);
|
|
8692
8642
|
--font-weight: var(--wui-typography-heading-6-weight);
|
|
@@ -8702,7 +8652,7 @@ var variantStyleMap = {
|
|
|
8702
8652
|
heading6: heading6TextStyle
|
|
8703
8653
|
};
|
|
8704
8654
|
var DEFAULT_ELEMENT2 = "h1";
|
|
8705
|
-
var StyledHeading =
|
|
8655
|
+
var StyledHeading = import_styled_components39.default.div`
|
|
8706
8656
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8707
8657
|
font-family: var(--font-family);
|
|
8708
8658
|
font-size: var(--font-size);
|
|
@@ -8712,23 +8662,23 @@ var StyledHeading = import_styled_components40.default.div`
|
|
|
8712
8662
|
${({ $variant }) => variantStyleMap[$variant]}
|
|
8713
8663
|
${({ $truncate }) => {
|
|
8714
8664
|
if ((0, import_type_guards28.isNotNil)($truncate)) {
|
|
8715
|
-
return
|
|
8665
|
+
return import_styled_components39.css`
|
|
8716
8666
|
${ellipsisStyle};
|
|
8717
8667
|
${lineClampCss($truncate)};
|
|
8718
8668
|
`;
|
|
8719
8669
|
}
|
|
8720
8670
|
return void 0;
|
|
8721
8671
|
}}
|
|
8722
|
-
${({ $inline }) => $inline &&
|
|
8672
|
+
${({ $inline }) => $inline && import_styled_components39.css`
|
|
8723
8673
|
display: inline-block;
|
|
8724
8674
|
`}
|
|
8725
|
-
${({ $disabled }) => $disabled &&
|
|
8675
|
+
${({ $disabled }) => $disabled && import_styled_components39.css`
|
|
8726
8676
|
color: var(--wui-color-text-disabled);
|
|
8727
8677
|
`}
|
|
8728
|
-
${({ $preventUserSelect }) => $preventUserSelect &&
|
|
8678
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components39.css`
|
|
8729
8679
|
user-select: none;
|
|
8730
8680
|
`}
|
|
8731
|
-
${({ $align }) =>
|
|
8681
|
+
${({ $align }) => import_styled_components39.css`
|
|
8732
8682
|
text-align: ${$align};
|
|
8733
8683
|
`}
|
|
8734
8684
|
margin: 0;
|
|
@@ -8742,7 +8692,7 @@ var variantElementMap = {
|
|
|
8742
8692
|
heading5: "h5",
|
|
8743
8693
|
heading6: "h6"
|
|
8744
8694
|
};
|
|
8745
|
-
var HeadingComponent = (0,
|
|
8695
|
+
var HeadingComponent = (0, import_react32.forwardRef)(
|
|
8746
8696
|
({
|
|
8747
8697
|
align = "left",
|
|
8748
8698
|
colorScheme = "inherit",
|
|
@@ -8753,7 +8703,7 @@ var HeadingComponent = (0, import_react34.forwardRef)(
|
|
|
8753
8703
|
variant = "heading1",
|
|
8754
8704
|
renderAs,
|
|
8755
8705
|
...props
|
|
8756
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
8706
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8757
8707
|
StyledHeading,
|
|
8758
8708
|
{
|
|
8759
8709
|
ref,
|
|
@@ -8773,25 +8723,21 @@ HeadingComponent.displayName = "Heading";
|
|
|
8773
8723
|
var Heading = makePolymorphic(HeadingComponent);
|
|
8774
8724
|
|
|
8775
8725
|
// src/components/DataCards/DataCard.tsx
|
|
8776
|
-
var
|
|
8777
|
-
var StyledDataCard =
|
|
8726
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
8727
|
+
var StyledDataCard = import_styled_components40.default.div`
|
|
8778
8728
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8779
8729
|
display: grid;
|
|
8780
8730
|
grid-template-areas: 'label slot' 'value value';
|
|
8731
|
+
grid-template-rows: auto auto;
|
|
8732
|
+
grid-template-columns: auto auto;
|
|
8781
8733
|
gap: var(--wui-space-01);
|
|
8782
8734
|
padding: var(--wui-space-03);
|
|
8783
8735
|
background: var(--wui-color-bg-surface-secondary);
|
|
8784
8736
|
flex: 1;
|
|
8785
8737
|
border-radius: var(--wui-border-radius-02);
|
|
8786
8738
|
position: relative;
|
|
8787
|
-
|
|
8788
|
-
:is([data-wui-conditional-button]) {
|
|
8789
|
-
&:hover {
|
|
8790
|
-
background: var(--wui-color-bg-surface-secondary-hover);
|
|
8791
|
-
}
|
|
8792
|
-
}
|
|
8793
8739
|
`;
|
|
8794
|
-
var shimmer =
|
|
8740
|
+
var shimmer = import_styled_components40.keyframes`
|
|
8795
8741
|
0% {
|
|
8796
8742
|
background-position: 200% 0;
|
|
8797
8743
|
}
|
|
@@ -8799,7 +8745,7 @@ var shimmer = import_styled_components41.keyframes`
|
|
|
8799
8745
|
background-position: -200% 0;
|
|
8800
8746
|
}
|
|
8801
8747
|
`;
|
|
8802
|
-
var LoadingBackground =
|
|
8748
|
+
var LoadingBackground = import_styled_components40.default.div`
|
|
8803
8749
|
background: linear-gradient(
|
|
8804
8750
|
90deg,
|
|
8805
8751
|
var(--wui-color-bg-surface-tertiary) 25%,
|
|
@@ -8810,27 +8756,27 @@ var LoadingBackground = import_styled_components41.default.div`
|
|
|
8810
8756
|
animation: ${shimmer} 1.5s infinite;
|
|
8811
8757
|
border-radius: var(--wui-border-radius-01);
|
|
8812
8758
|
`;
|
|
8813
|
-
var StyledLoadingLabel = (0,
|
|
8759
|
+
var StyledLoadingLabel = (0, import_styled_components40.default)(LoadingBackground)`
|
|
8814
8760
|
width: 80px;
|
|
8815
8761
|
height: var(--wui-typography-heading-6-line-height);
|
|
8816
8762
|
`;
|
|
8817
|
-
var StyledLoadingValue = (0,
|
|
8763
|
+
var StyledLoadingValue = (0, import_styled_components40.default)(LoadingBackground)`
|
|
8818
8764
|
width: 90%;
|
|
8819
8765
|
height: var(--wui-typography-heading-3-line-height);
|
|
8820
8766
|
`;
|
|
8821
|
-
var StyledLabel2 = (0,
|
|
8767
|
+
var StyledLabel2 = (0, import_styled_components40.default)(Heading)`
|
|
8822
8768
|
grid-area: label;
|
|
8823
8769
|
`;
|
|
8824
|
-
var StyledValue = (0,
|
|
8770
|
+
var StyledValue = (0, import_styled_components40.default)(Heading)`
|
|
8825
8771
|
grid-area: value;
|
|
8826
8772
|
`;
|
|
8827
|
-
var StyledSlot =
|
|
8773
|
+
var StyledSlot = import_styled_components40.default.div`
|
|
8828
8774
|
display: flex;
|
|
8829
8775
|
justify-content: flex-end;
|
|
8830
8776
|
grid-area: slot;
|
|
8831
8777
|
align-self: center;
|
|
8832
8778
|
`;
|
|
8833
|
-
var StyledDataCardTrendContainer =
|
|
8779
|
+
var StyledDataCardTrendContainer = import_styled_components40.default.div`
|
|
8834
8780
|
position: absolute;
|
|
8835
8781
|
bottom: var(--wui-space-01);
|
|
8836
8782
|
right: var(--wui-space-01);
|
|
@@ -8843,43 +8789,39 @@ var DataCard = ({
|
|
|
8843
8789
|
isLoading = false,
|
|
8844
8790
|
trend,
|
|
8845
8791
|
...props
|
|
8846
|
-
}) =>
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
{
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
|
|
8865
|
-
{
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
]
|
|
8874
|
-
}
|
|
8875
|
-
);
|
|
8876
|
-
};
|
|
8792
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(
|
|
8793
|
+
StyledDataCard,
|
|
8794
|
+
{
|
|
8795
|
+
$colorScheme: colorScheme,
|
|
8796
|
+
...props,
|
|
8797
|
+
children: [
|
|
8798
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
8799
|
+
StyledLabel2,
|
|
8800
|
+
{
|
|
8801
|
+
renderAs: "dt",
|
|
8802
|
+
variant: "heading6",
|
|
8803
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(StyledLoadingLabel, {}) : label
|
|
8804
|
+
}
|
|
8805
|
+
),
|
|
8806
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
8807
|
+
StyledValue,
|
|
8808
|
+
{
|
|
8809
|
+
renderAs: "dd",
|
|
8810
|
+
variant: "heading3",
|
|
8811
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(StyledLoadingValue, {}) : value
|
|
8812
|
+
}
|
|
8813
|
+
),
|
|
8814
|
+
(0, import_type_guards29.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
8815
|
+
(0, import_type_guards29.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
8816
|
+
]
|
|
8817
|
+
}
|
|
8818
|
+
);
|
|
8877
8819
|
DataCard.displayName = "DataCard";
|
|
8878
8820
|
|
|
8879
8821
|
// src/components/DataCards/DataCards.tsx
|
|
8880
|
-
var
|
|
8881
|
-
var
|
|
8882
|
-
var StyledDataCards = (0,
|
|
8822
|
+
var import_styled_components41 = __toESM(require("styled-components"));
|
|
8823
|
+
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
8824
|
+
var StyledDataCards = (0, import_styled_components41.default)(Box)`
|
|
8883
8825
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8884
8826
|
margin-top: 0; /* Remove default <dl> style */
|
|
8885
8827
|
> * {
|
|
@@ -8893,7 +8835,7 @@ var DataCards = ({
|
|
|
8893
8835
|
colorScheme = "inherit",
|
|
8894
8836
|
...props
|
|
8895
8837
|
}) => {
|
|
8896
|
-
return /* @__PURE__ */ (0,
|
|
8838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
8897
8839
|
StyledDataCards,
|
|
8898
8840
|
{
|
|
8899
8841
|
...props,
|
|
@@ -8911,26 +8853,26 @@ var DataCards = ({
|
|
|
8911
8853
|
DataCards.displayName = "DataCards";
|
|
8912
8854
|
|
|
8913
8855
|
// src/components/DataCards/DataCardTrend.tsx
|
|
8914
|
-
var
|
|
8856
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8915
8857
|
|
|
8916
8858
|
// src/components/Text/Text.tsx
|
|
8917
|
-
var
|
|
8918
|
-
var
|
|
8859
|
+
var import_react33 = require("react");
|
|
8860
|
+
var import_styled_components42 = __toESM(require("styled-components"));
|
|
8919
8861
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8920
|
-
var
|
|
8921
|
-
var bodyBoldStyles =
|
|
8862
|
+
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
8863
|
+
var bodyBoldStyles = import_styled_components42.css`
|
|
8922
8864
|
> strong,
|
|
8923
8865
|
b {
|
|
8924
8866
|
font-weight: var(--wui-typography-weight-body-bold);
|
|
8925
8867
|
}
|
|
8926
8868
|
`;
|
|
8927
|
-
var labelBoldStyles =
|
|
8869
|
+
var labelBoldStyles = import_styled_components42.css`
|
|
8928
8870
|
> strong,
|
|
8929
8871
|
b {
|
|
8930
8872
|
font-weight: var(--wui-typography-weight-label-bold);
|
|
8931
8873
|
}
|
|
8932
8874
|
`;
|
|
8933
|
-
var body1TextStyle =
|
|
8875
|
+
var body1TextStyle = import_styled_components42.css`
|
|
8934
8876
|
--font-family: var(--wui-typography-body-1-family);
|
|
8935
8877
|
--font-size: var(--wui-typography-body-1-size);
|
|
8936
8878
|
--font-weight: var(--wui-typography-body-1-weight);
|
|
@@ -8938,7 +8880,7 @@ var body1TextStyle = import_styled_components43.css`
|
|
|
8938
8880
|
--paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
|
|
8939
8881
|
${bodyBoldStyles}
|
|
8940
8882
|
`;
|
|
8941
|
-
var body2TextStyle =
|
|
8883
|
+
var body2TextStyle = import_styled_components42.css`
|
|
8942
8884
|
--font-family: var(--wui-typography-body-2-family);
|
|
8943
8885
|
--font-size: var(--wui-typography-body-2-size);
|
|
8944
8886
|
--font-weight: var(--wui-typography-body-2-weight);
|
|
@@ -8946,7 +8888,7 @@ var body2TextStyle = import_styled_components43.css`
|
|
|
8946
8888
|
--paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
|
|
8947
8889
|
${bodyBoldStyles}
|
|
8948
8890
|
`;
|
|
8949
|
-
var body3TextStyle =
|
|
8891
|
+
var body3TextStyle = import_styled_components42.css`
|
|
8950
8892
|
--font-family: var(--wui-typography-body-3-family);
|
|
8951
8893
|
--font-size: var(--wui-typography-body-3-size);
|
|
8952
8894
|
--font-weight: var(--wui-typography-body-3-weight);
|
|
@@ -8954,7 +8896,7 @@ var body3TextStyle = import_styled_components43.css`
|
|
|
8954
8896
|
--paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
|
|
8955
8897
|
${bodyBoldStyles}
|
|
8956
8898
|
`;
|
|
8957
|
-
var body4TextStyle =
|
|
8899
|
+
var body4TextStyle = import_styled_components42.css`
|
|
8958
8900
|
--font-family: var(--wui-typography-body-4-family);
|
|
8959
8901
|
--font-size: var(--wui-typography-body-4-size);
|
|
8960
8902
|
--font-weight: var(--wui-typography-body-4-weight);
|
|
@@ -8962,47 +8904,47 @@ var body4TextStyle = import_styled_components43.css`
|
|
|
8962
8904
|
--paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
|
|
8963
8905
|
${bodyBoldStyles}
|
|
8964
8906
|
`;
|
|
8965
|
-
var label1TextStyle =
|
|
8907
|
+
var label1TextStyle = import_styled_components42.css`
|
|
8966
8908
|
--font-family: var(--wui-typography-label-1-family);
|
|
8967
8909
|
--font-size: var(--wui-typography-label-1-size);
|
|
8968
8910
|
--font-weight: var(--wui-typography-label-1-weight);
|
|
8969
8911
|
--line-height: var(--wui-typography-label-1-line-height);
|
|
8970
8912
|
${labelBoldStyles}
|
|
8971
8913
|
`;
|
|
8972
|
-
var label2TextStyle =
|
|
8914
|
+
var label2TextStyle = import_styled_components42.css`
|
|
8973
8915
|
--font-family: var(--wui-typography-label-2-family);
|
|
8974
8916
|
--font-size: var(--wui-typography-label-2-size);
|
|
8975
8917
|
--font-weight: var(--wui-typography-label-2-weight);
|
|
8976
8918
|
--line-height: var(--wui-typography-label-2-line-height);
|
|
8977
8919
|
${labelBoldStyles}
|
|
8978
8920
|
`;
|
|
8979
|
-
var label3TextStyle =
|
|
8921
|
+
var label3TextStyle = import_styled_components42.css`
|
|
8980
8922
|
--font-family: var(--wui-typography-label-3-family);
|
|
8981
8923
|
--font-size: var(--wui-typography-label-3-size);
|
|
8982
8924
|
--font-weight: var(--wui-typography-label-3-weight);
|
|
8983
8925
|
--line-height: var(--wui-typography-label-3-line-height);
|
|
8984
8926
|
${labelBoldStyles}
|
|
8985
8927
|
`;
|
|
8986
|
-
var label4TextStyle =
|
|
8928
|
+
var label4TextStyle = import_styled_components42.css`
|
|
8987
8929
|
--font-family: var(--wui-typography-label-4-family);
|
|
8988
8930
|
--font-size: var(--wui-typography-label-4-size);
|
|
8989
8931
|
--font-weight: var(--wui-typography-label-4-weight);
|
|
8990
8932
|
--line-height: var(--wui-typography-label-4-line-height);
|
|
8991
8933
|
${labelBoldStyles}
|
|
8992
8934
|
`;
|
|
8993
|
-
var body1MonoTextStyle =
|
|
8935
|
+
var body1MonoTextStyle = import_styled_components42.css`
|
|
8994
8936
|
${body1TextStyle};
|
|
8995
8937
|
--font-family: var(--wui-typography-family-mono);
|
|
8996
8938
|
`;
|
|
8997
|
-
var body2MonoTextStyle =
|
|
8939
|
+
var body2MonoTextStyle = import_styled_components42.css`
|
|
8998
8940
|
${body2TextStyle};
|
|
8999
8941
|
--font-family: var(--wui-typography-family-mono);
|
|
9000
8942
|
`;
|
|
9001
|
-
var body3MonoTextStyle =
|
|
8943
|
+
var body3MonoTextStyle = import_styled_components42.css`
|
|
9002
8944
|
${body3TextStyle};
|
|
9003
8945
|
--font-family: var(--wui-typography-family-mono);
|
|
9004
8946
|
`;
|
|
9005
|
-
var body4MonoTextStyle =
|
|
8947
|
+
var body4MonoTextStyle = import_styled_components42.css`
|
|
9006
8948
|
${body4TextStyle};
|
|
9007
8949
|
--font-family: var(--wui-typography-family-mono);
|
|
9008
8950
|
`;
|
|
@@ -9037,7 +8979,7 @@ var variantElementMap2 = {
|
|
|
9037
8979
|
label3: labelElement,
|
|
9038
8980
|
label4: labelElement
|
|
9039
8981
|
};
|
|
9040
|
-
var StyledText =
|
|
8982
|
+
var StyledText = import_styled_components42.default.div`
|
|
9041
8983
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9042
8984
|
--text-color: ${({ $prominence, $disabled }) => {
|
|
9043
8985
|
if ($disabled) {
|
|
@@ -9062,26 +9004,26 @@ var StyledText = import_styled_components43.default.div`
|
|
|
9062
9004
|
${({ $variant }) => variantStyleMap2[$variant]}
|
|
9063
9005
|
${({ $truncate }) => {
|
|
9064
9006
|
if ((0, import_type_guards30.isNotNil)($truncate)) {
|
|
9065
|
-
return
|
|
9007
|
+
return import_styled_components42.css`
|
|
9066
9008
|
${ellipsisStyle};
|
|
9067
9009
|
${lineClampCss($truncate)};
|
|
9068
9010
|
`;
|
|
9069
9011
|
}
|
|
9070
9012
|
return void 0;
|
|
9071
9013
|
}}
|
|
9072
|
-
${({ $inline }) => $inline &&
|
|
9014
|
+
${({ $inline }) => $inline && import_styled_components42.css`
|
|
9073
9015
|
display: inline-block;
|
|
9074
9016
|
`}
|
|
9075
|
-
${({ $disabled }) => $disabled &&
|
|
9017
|
+
${({ $disabled }) => $disabled && import_styled_components42.css`
|
|
9076
9018
|
--text-color: var(--wui-color-text-disabled);
|
|
9077
9019
|
`}
|
|
9078
|
-
${({ $preventUserSelect }) => $preventUserSelect &&
|
|
9020
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components42.css`
|
|
9079
9021
|
user-select: none;
|
|
9080
9022
|
`}
|
|
9081
|
-
${({ $align }) =>
|
|
9023
|
+
${({ $align }) => import_styled_components42.css`
|
|
9082
9024
|
text-align: ${$align};
|
|
9083
9025
|
`}
|
|
9084
|
-
${({ as }) => as === "p" &&
|
|
9026
|
+
${({ as }) => as === "p" && import_styled_components42.css`
|
|
9085
9027
|
display: block;
|
|
9086
9028
|
|
|
9087
9029
|
+ p {
|
|
@@ -9089,7 +9031,7 @@ var StyledText = import_styled_components43.default.div`
|
|
|
9089
9031
|
}
|
|
9090
9032
|
`}
|
|
9091
9033
|
`;
|
|
9092
|
-
var TextComponent = (0,
|
|
9034
|
+
var TextComponent = (0, import_react33.forwardRef)(
|
|
9093
9035
|
({
|
|
9094
9036
|
align = "left",
|
|
9095
9037
|
colorScheme = "inherit",
|
|
@@ -9102,7 +9044,7 @@ var TextComponent = (0, import_react35.forwardRef)(
|
|
|
9102
9044
|
renderAs,
|
|
9103
9045
|
...props
|
|
9104
9046
|
}, ref) => {
|
|
9105
|
-
return /* @__PURE__ */ (0,
|
|
9047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
9106
9048
|
StyledText,
|
|
9107
9049
|
{
|
|
9108
9050
|
ref,
|
|
@@ -9124,8 +9066,8 @@ TextComponent.displayName = "Text";
|
|
|
9124
9066
|
var Text = makePolymorphic(TextComponent);
|
|
9125
9067
|
|
|
9126
9068
|
// src/components/DataCards/DataCardTrend.tsx
|
|
9127
|
-
var
|
|
9128
|
-
var StyledDataCardTrend =
|
|
9069
|
+
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
9070
|
+
var StyledDataCardTrend = import_styled_components43.default.div`
|
|
9129
9071
|
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
9130
9072
|
background: var(--wui-color-bg-app);
|
|
9131
9073
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -9140,8 +9082,8 @@ var DataCardTrend = ({
|
|
|
9140
9082
|
children,
|
|
9141
9083
|
...props
|
|
9142
9084
|
}) => {
|
|
9143
|
-
return /* @__PURE__ */ (0,
|
|
9144
|
-
/* @__PURE__ */ (0,
|
|
9085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
9086
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9145
9087
|
Icon,
|
|
9146
9088
|
{
|
|
9147
9089
|
size: "md",
|
|
@@ -9149,7 +9091,7 @@ var DataCardTrend = ({
|
|
|
9149
9091
|
...props
|
|
9150
9092
|
}
|
|
9151
9093
|
),
|
|
9152
|
-
/* @__PURE__ */ (0,
|
|
9094
|
+
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
9153
9095
|
Text,
|
|
9154
9096
|
{
|
|
9155
9097
|
prominence: "secondary",
|
|
@@ -9161,22 +9103,22 @@ var DataCardTrend = ({
|
|
|
9161
9103
|
};
|
|
9162
9104
|
|
|
9163
9105
|
// src/components/Divider/Divider.tsx
|
|
9164
|
-
var
|
|
9165
|
-
var
|
|
9166
|
-
var horizontalBorderCss =
|
|
9106
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
9107
|
+
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
9108
|
+
var horizontalBorderCss = import_styled_components44.css`
|
|
9167
9109
|
border-top-color: var(--wui-color-border);
|
|
9168
9110
|
border-top-style: solid;
|
|
9169
9111
|
border-top-width: 1px;
|
|
9170
9112
|
clear: both; /* for horizontal dividers, ensure it clears any floats */
|
|
9171
9113
|
height: 0;
|
|
9172
9114
|
`;
|
|
9173
|
-
var verticalBorderCss =
|
|
9115
|
+
var verticalBorderCss = import_styled_components44.css`
|
|
9174
9116
|
background-color: var(--wui-color-border);
|
|
9175
9117
|
max-width: 1px;
|
|
9176
9118
|
min-height: 100%;
|
|
9177
9119
|
width: 1px;
|
|
9178
9120
|
`;
|
|
9179
|
-
var DividerComponent =
|
|
9121
|
+
var DividerComponent = import_styled_components44.default.div`
|
|
9180
9122
|
${({ $orientation }) => {
|
|
9181
9123
|
switch ($orientation) {
|
|
9182
9124
|
case "vertical":
|
|
@@ -9188,7 +9130,7 @@ var DividerComponent = import_styled_components45.default.div`
|
|
|
9188
9130
|
}}
|
|
9189
9131
|
`;
|
|
9190
9132
|
var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
9191
|
-
return /* @__PURE__ */ (0,
|
|
9133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
9192
9134
|
DividerComponent,
|
|
9193
9135
|
{
|
|
9194
9136
|
$orientation: orientation,
|
|
@@ -9201,14 +9143,14 @@ var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
|
9201
9143
|
Divider.displayName = "Divider";
|
|
9202
9144
|
|
|
9203
9145
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9204
|
-
var
|
|
9205
|
-
var
|
|
9146
|
+
var import_styled_components48 = __toESM(require("styled-components"));
|
|
9147
|
+
var import_react35 = require("react");
|
|
9206
9148
|
|
|
9207
9149
|
// src/components/Tooltip/Tooltip.tsx
|
|
9208
9150
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
9209
|
-
var
|
|
9210
|
-
var
|
|
9211
|
-
var hide =
|
|
9151
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
9152
|
+
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
9153
|
+
var hide = import_styled_components45.keyframes`
|
|
9212
9154
|
from {
|
|
9213
9155
|
opacity: 1;
|
|
9214
9156
|
}
|
|
@@ -9216,7 +9158,7 @@ var hide = import_styled_components46.keyframes`
|
|
|
9216
9158
|
opacity: 0;
|
|
9217
9159
|
}
|
|
9218
9160
|
`;
|
|
9219
|
-
var slideDownAndFade =
|
|
9161
|
+
var slideDownAndFade = import_styled_components45.keyframes`
|
|
9220
9162
|
from {
|
|
9221
9163
|
opacity: 0;
|
|
9222
9164
|
transform: translateY(-6px);
|
|
@@ -9226,7 +9168,7 @@ var slideDownAndFade = import_styled_components46.keyframes`
|
|
|
9226
9168
|
transform: translateY(0);
|
|
9227
9169
|
}
|
|
9228
9170
|
`;
|
|
9229
|
-
var slideLeftAndFade =
|
|
9171
|
+
var slideLeftAndFade = import_styled_components45.keyframes`
|
|
9230
9172
|
from {
|
|
9231
9173
|
opacity: 0;
|
|
9232
9174
|
transform: translateX(6px);
|
|
@@ -9236,7 +9178,7 @@ var slideLeftAndFade = import_styled_components46.keyframes`
|
|
|
9236
9178
|
transform: translateX(0);
|
|
9237
9179
|
}
|
|
9238
9180
|
`;
|
|
9239
|
-
var slideUpAndFade =
|
|
9181
|
+
var slideUpAndFade = import_styled_components45.keyframes`
|
|
9240
9182
|
from {
|
|
9241
9183
|
opacity: 0;
|
|
9242
9184
|
transform: translateY(6px);
|
|
@@ -9246,7 +9188,7 @@ var slideUpAndFade = import_styled_components46.keyframes`
|
|
|
9246
9188
|
transform: translateY(0);
|
|
9247
9189
|
}
|
|
9248
9190
|
`;
|
|
9249
|
-
var slideRightAndFade =
|
|
9191
|
+
var slideRightAndFade = import_styled_components45.keyframes`
|
|
9250
9192
|
from {
|
|
9251
9193
|
opacity: 0;
|
|
9252
9194
|
transform: translateX(-6px);
|
|
@@ -9256,7 +9198,7 @@ var slideRightAndFade = import_styled_components46.keyframes`
|
|
|
9256
9198
|
transform: translateX(0);
|
|
9257
9199
|
}
|
|
9258
9200
|
`;
|
|
9259
|
-
var StyledContent = (0,
|
|
9201
|
+
var StyledContent = (0, import_styled_components45.default)(import_react_tooltip2.Content)`
|
|
9260
9202
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
9261
9203
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
9262
9204
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -9318,21 +9260,21 @@ var Tooltip = ({
|
|
|
9318
9260
|
if (forceOpen === true) {
|
|
9319
9261
|
rootProps.open = true;
|
|
9320
9262
|
}
|
|
9321
|
-
return /* @__PURE__ */ (0,
|
|
9263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
9322
9264
|
import_react_tooltip2.Root,
|
|
9323
9265
|
{
|
|
9324
9266
|
delayDuration: delay,
|
|
9325
9267
|
...rootProps,
|
|
9326
9268
|
children: [
|
|
9327
|
-
/* @__PURE__ */ (0,
|
|
9328
|
-
/* @__PURE__ */ (0,
|
|
9269
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
|
|
9270
|
+
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
9329
9271
|
StyledContent,
|
|
9330
9272
|
{
|
|
9331
9273
|
side: direction,
|
|
9332
9274
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
9333
9275
|
children: [
|
|
9334
9276
|
content,
|
|
9335
|
-
!hideArrow ? /* @__PURE__ */ (0,
|
|
9277
|
+
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
9336
9278
|
"svg",
|
|
9337
9279
|
{
|
|
9338
9280
|
fill: "var(--tooltip-bg)",
|
|
@@ -9341,7 +9283,7 @@ var Tooltip = ({
|
|
|
9341
9283
|
viewBox: "0 0 12 8",
|
|
9342
9284
|
width: "12",
|
|
9343
9285
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9344
|
-
children: /* @__PURE__ */ (0,
|
|
9286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
|
|
9345
9287
|
}
|
|
9346
9288
|
) }) : null
|
|
9347
9289
|
]
|
|
@@ -9354,13 +9296,13 @@ var Tooltip = ({
|
|
|
9354
9296
|
Tooltip.displayName = "Tooltip";
|
|
9355
9297
|
|
|
9356
9298
|
// src/components/Input/Input.tsx
|
|
9357
|
-
var
|
|
9358
|
-
var
|
|
9299
|
+
var import_react34 = require("react");
|
|
9300
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9359
9301
|
var import_type_guards31 = require("@wistia/type-guards");
|
|
9360
9302
|
|
|
9361
9303
|
// src/css/sharedStyles/inputCssVariables.ts
|
|
9362
|
-
var
|
|
9363
|
-
var inputCssVariables =
|
|
9304
|
+
var import_styled_components46 = require("styled-components");
|
|
9305
|
+
var inputCssVariables = import_styled_components46.css`
|
|
9364
9306
|
/* Colors */
|
|
9365
9307
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
9366
9308
|
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
@@ -9386,8 +9328,8 @@ var inputCssVariables = import_styled_components47.css`
|
|
|
9386
9328
|
`;
|
|
9387
9329
|
|
|
9388
9330
|
// src/components/Input/Input.tsx
|
|
9389
|
-
var
|
|
9390
|
-
var inputStyles =
|
|
9331
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
9332
|
+
var inputStyles = import_styled_components47.css`
|
|
9391
9333
|
${inputCssVariables}
|
|
9392
9334
|
input,
|
|
9393
9335
|
textarea {
|
|
@@ -9422,7 +9364,7 @@ var inputStyles = import_styled_components48.css`
|
|
|
9422
9364
|
}
|
|
9423
9365
|
}
|
|
9424
9366
|
`;
|
|
9425
|
-
var StyledInputContainer =
|
|
9367
|
+
var StyledInputContainer = import_styled_components47.default.div`
|
|
9426
9368
|
display: inline-flex;
|
|
9427
9369
|
position: relative;
|
|
9428
9370
|
${inputStyles};
|
|
@@ -9489,7 +9431,7 @@ var StyledInputContainer = import_styled_components48.default.div`
|
|
|
9489
9431
|
padding-right: 32px;
|
|
9490
9432
|
}
|
|
9491
9433
|
`;
|
|
9492
|
-
var Input = (0,
|
|
9434
|
+
var Input = (0, import_react34.forwardRef)(
|
|
9493
9435
|
({
|
|
9494
9436
|
fullWidth = true,
|
|
9495
9437
|
monospace = false,
|
|
@@ -9499,24 +9441,24 @@ var Input = (0, import_react36.forwardRef)(
|
|
|
9499
9441
|
rightIcon,
|
|
9500
9442
|
...props
|
|
9501
9443
|
}, externalRef) => {
|
|
9502
|
-
const internalRef = (0,
|
|
9444
|
+
const internalRef = (0, import_react34.useRef)();
|
|
9503
9445
|
const ref = (
|
|
9504
9446
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9505
9447
|
(0, import_type_guards31.isNotNil)(externalRef) && (0, import_type_guards31.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
9506
9448
|
);
|
|
9507
9449
|
let leftIconToDisplay = leftIcon;
|
|
9508
9450
|
if ((0, import_type_guards31.isNil)(leftIcon) && type === "search") {
|
|
9509
|
-
leftIconToDisplay = /* @__PURE__ */ (0,
|
|
9451
|
+
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Icon, { type: "search" });
|
|
9510
9452
|
}
|
|
9511
9453
|
if ((0, import_type_guards31.isNotNil)(leftIconToDisplay)) {
|
|
9512
|
-
leftIconToDisplay = (0,
|
|
9454
|
+
leftIconToDisplay = (0, import_react34.cloneElement)(leftIconToDisplay, {
|
|
9513
9455
|
size: "md",
|
|
9514
9456
|
className: "wui-input-left-icon"
|
|
9515
9457
|
});
|
|
9516
9458
|
}
|
|
9517
9459
|
let rightIconToDisplay = rightIcon;
|
|
9518
9460
|
if ((0, import_type_guards31.isNotNil)(rightIconToDisplay)) {
|
|
9519
|
-
rightIconToDisplay = (0,
|
|
9461
|
+
rightIconToDisplay = (0, import_react34.cloneElement)(rightIconToDisplay, {
|
|
9520
9462
|
size: "md",
|
|
9521
9463
|
className: "wui-input-right-icon"
|
|
9522
9464
|
});
|
|
@@ -9531,21 +9473,21 @@ var Input = (0, import_react36.forwardRef)(
|
|
|
9531
9473
|
});
|
|
9532
9474
|
}
|
|
9533
9475
|
};
|
|
9534
|
-
return /* @__PURE__ */ (0,
|
|
9476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(
|
|
9535
9477
|
StyledInputContainer,
|
|
9536
9478
|
{
|
|
9537
9479
|
$fullWidth: fullWidth,
|
|
9538
9480
|
$monospace: monospace,
|
|
9539
9481
|
children: [
|
|
9540
9482
|
leftIconToDisplay ?? null,
|
|
9541
|
-
type === "multiline" ? /* @__PURE__ */ (0,
|
|
9483
|
+
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9542
9484
|
"textarea",
|
|
9543
9485
|
{
|
|
9544
9486
|
...props,
|
|
9545
9487
|
ref,
|
|
9546
9488
|
onFocus: handleFocus2
|
|
9547
9489
|
}
|
|
9548
|
-
) : /* @__PURE__ */ (0,
|
|
9490
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9549
9491
|
"input",
|
|
9550
9492
|
{
|
|
9551
9493
|
...props,
|
|
@@ -9563,8 +9505,8 @@ var Input = (0, import_react36.forwardRef)(
|
|
|
9563
9505
|
Input.displayName = "Input";
|
|
9564
9506
|
|
|
9565
9507
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9566
|
-
var
|
|
9567
|
-
var StyledInput = (0,
|
|
9508
|
+
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
9509
|
+
var StyledInput = (0, import_styled_components48.default)(Input)`
|
|
9568
9510
|
:not([rows]) {
|
|
9569
9511
|
min-height: unset;
|
|
9570
9512
|
}
|
|
@@ -9581,7 +9523,7 @@ var StyledInput = (0, import_styled_components49.default)(Input)`
|
|
|
9581
9523
|
height: ${({ $height }) => `${$height}px`};
|
|
9582
9524
|
}
|
|
9583
9525
|
`;
|
|
9584
|
-
var editableStyles =
|
|
9526
|
+
var editableStyles = import_styled_components48.css`
|
|
9585
9527
|
&:has(+ :focus-within) {
|
|
9586
9528
|
background: var(--wui-color-bg-surface-hover);
|
|
9587
9529
|
}
|
|
@@ -9591,7 +9533,7 @@ var editableStyles = import_styled_components49.css`
|
|
|
9591
9533
|
cursor: pointer;
|
|
9592
9534
|
}
|
|
9593
9535
|
`;
|
|
9594
|
-
var StyledHeading2 = (0,
|
|
9536
|
+
var StyledHeading2 = (0, import_styled_components48.default)(Heading)`
|
|
9595
9537
|
width: 100%;
|
|
9596
9538
|
border-radius: var(--wui-border-radius-02);
|
|
9597
9539
|
padding: var(--wui-space-02);
|
|
@@ -9608,11 +9550,11 @@ var EditableHeading = ({
|
|
|
9608
9550
|
__forceEditing = false,
|
|
9609
9551
|
editingDisabled = false
|
|
9610
9552
|
}) => {
|
|
9611
|
-
const [isEditing, setIsEditing] = (0,
|
|
9612
|
-
const [value, setValue] = (0,
|
|
9613
|
-
const [previousValue, setPreviousValue] = (0,
|
|
9614
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
9615
|
-
const headingRef = (0,
|
|
9553
|
+
const [isEditing, setIsEditing] = (0, import_react35.useState)(false);
|
|
9554
|
+
const [value, setValue] = (0, import_react35.useState)(children);
|
|
9555
|
+
const [previousValue, setPreviousValue] = (0, import_react35.useState)(children);
|
|
9556
|
+
const [headingHeight, setHeadingHeight] = (0, import_react35.useState)("60");
|
|
9557
|
+
const headingRef = (0, import_react35.useRef)(null);
|
|
9616
9558
|
const handleSetEditing = (editing) => {
|
|
9617
9559
|
if (editingDisabled) return;
|
|
9618
9560
|
if (editing && headingRef.current) {
|
|
@@ -9645,7 +9587,7 @@ var EditableHeading = ({
|
|
|
9645
9587
|
handleSetEditing(false);
|
|
9646
9588
|
}
|
|
9647
9589
|
};
|
|
9648
|
-
const HeadingComponent2 = /* @__PURE__ */ (0,
|
|
9590
|
+
const HeadingComponent2 = /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
9649
9591
|
StyledHeading2,
|
|
9650
9592
|
{
|
|
9651
9593
|
ref: headingRef,
|
|
@@ -9659,7 +9601,7 @@ var EditableHeading = ({
|
|
|
9659
9601
|
return HeadingComponent2;
|
|
9660
9602
|
}
|
|
9661
9603
|
if (isEditing || __forceEditing) {
|
|
9662
|
-
return /* @__PURE__ */ (0,
|
|
9604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
9663
9605
|
StyledInput,
|
|
9664
9606
|
{
|
|
9665
9607
|
$height: headingHeight,
|
|
@@ -9677,9 +9619,9 @@ var EditableHeading = ({
|
|
|
9677
9619
|
}
|
|
9678
9620
|
);
|
|
9679
9621
|
}
|
|
9680
|
-
return /* @__PURE__ */ (0,
|
|
9681
|
-
/* @__PURE__ */ (0,
|
|
9682
|
-
/* @__PURE__ */ (0,
|
|
9622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(import_jsx_runtime220.Fragment, { children: [
|
|
9623
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(Tooltip, { content: tooltipText, children: HeadingComponent2 }),
|
|
9624
|
+
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
9683
9625
|
"button",
|
|
9684
9626
|
{
|
|
9685
9627
|
"aria-label": ariaLabel,
|
|
@@ -9691,27 +9633,27 @@ var EditableHeading = ({
|
|
|
9691
9633
|
};
|
|
9692
9634
|
|
|
9693
9635
|
// src/components/Form/Form.tsx
|
|
9694
|
-
var
|
|
9695
|
-
var
|
|
9636
|
+
var import_react37 = require("react");
|
|
9637
|
+
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9696
9638
|
var import_type_guards32 = require("@wistia/type-guards");
|
|
9697
9639
|
|
|
9698
9640
|
// src/components/Stack/Stack.tsx
|
|
9699
|
-
var
|
|
9700
|
-
var
|
|
9701
|
-
var
|
|
9641
|
+
var import_react36 = require("react");
|
|
9642
|
+
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9643
|
+
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9702
9644
|
var DEFAULT_ELEMENT4 = "div";
|
|
9703
|
-
var StyledStack =
|
|
9645
|
+
var StyledStack = import_styled_components49.default.div`
|
|
9704
9646
|
display: flex;
|
|
9705
9647
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
9706
9648
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9707
9649
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
9708
9650
|
`;
|
|
9709
|
-
var StackComponent = (0,
|
|
9651
|
+
var StackComponent = (0, import_react36.forwardRef)(
|
|
9710
9652
|
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9711
9653
|
const responsiveGap = useResponsiveProp(gap);
|
|
9712
9654
|
const responsiveDirection = useResponsiveProp(direction);
|
|
9713
9655
|
const responsiveAlignItems = useResponsiveProp(alignItems);
|
|
9714
|
-
return /* @__PURE__ */ (0,
|
|
9656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9715
9657
|
StyledStack,
|
|
9716
9658
|
{
|
|
9717
9659
|
ref,
|
|
@@ -9728,14 +9670,14 @@ StackComponent.displayName = "Stack";
|
|
|
9728
9670
|
var Stack = makePolymorphic(StackComponent);
|
|
9729
9671
|
|
|
9730
9672
|
// src/components/Form/Form.tsx
|
|
9731
|
-
var
|
|
9732
|
-
var StyledForm =
|
|
9673
|
+
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
9674
|
+
var StyledForm = import_styled_components50.default.form`
|
|
9733
9675
|
--form-default-width: 690px;
|
|
9734
9676
|
|
|
9735
9677
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9736
9678
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9737
9679
|
`;
|
|
9738
|
-
var FormContext = (0,
|
|
9680
|
+
var FormContext = (0, import_react37.createContext)({
|
|
9739
9681
|
values: {},
|
|
9740
9682
|
errors: {},
|
|
9741
9683
|
hasSubmitted: false,
|
|
@@ -9751,11 +9693,11 @@ var FormComponent = ({
|
|
|
9751
9693
|
fullWidth = false,
|
|
9752
9694
|
...props
|
|
9753
9695
|
}, forwardedRef) => {
|
|
9754
|
-
const [errors, setErrors] = (0,
|
|
9755
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9756
|
-
const innerRef = (0,
|
|
9696
|
+
const [errors, setErrors] = (0, import_react37.useState)({});
|
|
9697
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react37.useState)(false);
|
|
9698
|
+
const innerRef = (0, import_react37.useRef)();
|
|
9757
9699
|
const ref = forwardedRef ?? innerRef;
|
|
9758
|
-
const autoId = (0,
|
|
9700
|
+
const autoId = (0, import_react37.useId)();
|
|
9759
9701
|
const id = props.id ?? autoId;
|
|
9760
9702
|
const handleValidate = (nextFormData) => {
|
|
9761
9703
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
@@ -9797,7 +9739,7 @@ var FormComponent = ({
|
|
|
9797
9739
|
void action(null);
|
|
9798
9740
|
}
|
|
9799
9741
|
};
|
|
9800
|
-
const context = (0,
|
|
9742
|
+
const context = (0, import_react37.useMemo)(() => {
|
|
9801
9743
|
return {
|
|
9802
9744
|
values,
|
|
9803
9745
|
errors,
|
|
@@ -9808,7 +9750,7 @@ var FormComponent = ({
|
|
|
9808
9750
|
}, [labelPosition, values, errors, id, hasSubmitted]);
|
|
9809
9751
|
return (
|
|
9810
9752
|
// @ts-expect-error - generic context providers are a giant pain
|
|
9811
|
-
/* @__PURE__ */ (0,
|
|
9753
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
9812
9754
|
Stack,
|
|
9813
9755
|
{
|
|
9814
9756
|
...props,
|
|
@@ -9826,15 +9768,15 @@ var FormComponent = ({
|
|
|
9826
9768
|
);
|
|
9827
9769
|
};
|
|
9828
9770
|
FormComponent.displayName = "Form";
|
|
9829
|
-
var Form = (0,
|
|
9771
|
+
var Form = (0, import_react37.forwardRef)(FormComponent);
|
|
9830
9772
|
|
|
9831
9773
|
// src/components/Form/useFormState.tsx
|
|
9832
|
-
var
|
|
9774
|
+
var import_react38 = require("react");
|
|
9833
9775
|
var useFormState = (action, initialData = {}) => {
|
|
9834
|
-
const [data, setData] = (0,
|
|
9835
|
-
const [isPending, setIsPending] = (0,
|
|
9836
|
-
const [error, setError] = (0,
|
|
9837
|
-
const formAction = (0,
|
|
9776
|
+
const [data, setData] = (0, import_react38.useState)(initialData);
|
|
9777
|
+
const [isPending, setIsPending] = (0, import_react38.useState)(false);
|
|
9778
|
+
const [error, setError] = (0, import_react38.useState)(null);
|
|
9779
|
+
const formAction = (0, import_react38.useCallback)(
|
|
9838
9780
|
async (nextFormData) => {
|
|
9839
9781
|
if (nextFormData === null) {
|
|
9840
9782
|
setData(initialData);
|
|
@@ -9865,23 +9807,23 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9865
9807
|
};
|
|
9866
9808
|
|
|
9867
9809
|
// src/components/Form/FormErrorSummary.tsx
|
|
9868
|
-
var
|
|
9810
|
+
var import_react39 = require("react");
|
|
9869
9811
|
var import_type_guards33 = require("@wistia/type-guards");
|
|
9870
|
-
var
|
|
9812
|
+
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9871
9813
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9872
|
-
return /* @__PURE__ */ (0,
|
|
9814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9873
9815
|
};
|
|
9874
9816
|
var FormErrorSummary = ({ description }) => {
|
|
9875
|
-
const ref = (0,
|
|
9876
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9817
|
+
const ref = (0, import_react39.useRef)(null);
|
|
9818
|
+
const { formId, errors, hasSubmitted } = (0, import_react39.useContext)(FormContext);
|
|
9877
9819
|
const isValid = Object.keys(errors).length === 0;
|
|
9878
9820
|
if (isValid || !hasSubmitted) {
|
|
9879
9821
|
return null;
|
|
9880
9822
|
}
|
|
9881
|
-
return /* @__PURE__ */ (0,
|
|
9882
|
-
/* @__PURE__ */ (0,
|
|
9883
|
-
/* @__PURE__ */ (0,
|
|
9884
|
-
([name, error]) => (0, import_type_guards33.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0,
|
|
9823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)("div", { ref, children: [
|
|
9824
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)("p", { children: description }),
|
|
9825
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards33.isNotUndefined)(error)).map(
|
|
9826
|
+
([name, error]) => (0, import_type_guards33.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
9885
9827
|
ErrorItem,
|
|
9886
9828
|
{
|
|
9887
9829
|
error: err,
|
|
@@ -9889,7 +9831,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9889
9831
|
name
|
|
9890
9832
|
},
|
|
9891
9833
|
err
|
|
9892
|
-
)) : /* @__PURE__ */ (0,
|
|
9834
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
9893
9835
|
ErrorItem,
|
|
9894
9836
|
{
|
|
9895
9837
|
error: error ?? "",
|
|
@@ -9903,14 +9845,14 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9903
9845
|
};
|
|
9904
9846
|
|
|
9905
9847
|
// src/components/FormField/FormField.tsx
|
|
9906
|
-
var
|
|
9907
|
-
var
|
|
9848
|
+
var import_react42 = require("react");
|
|
9849
|
+
var import_styled_components53 = __toESM(require("styled-components"));
|
|
9908
9850
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
9909
9851
|
|
|
9910
9852
|
// src/components/Label/Label.tsx
|
|
9911
|
-
var
|
|
9912
|
-
var
|
|
9913
|
-
var requiredStyle =
|
|
9853
|
+
var import_styled_components51 = __toESM(require("styled-components"));
|
|
9854
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9855
|
+
var requiredStyle = import_styled_components51.css`
|
|
9914
9856
|
&::after {
|
|
9915
9857
|
color: var(--wui-color-text-error);
|
|
9916
9858
|
display: inline;
|
|
@@ -9918,10 +9860,10 @@ var requiredStyle = import_styled_components52.css`
|
|
|
9918
9860
|
content: '*';
|
|
9919
9861
|
}
|
|
9920
9862
|
`;
|
|
9921
|
-
var disabledStyle3 =
|
|
9863
|
+
var disabledStyle3 = import_styled_components51.css`
|
|
9922
9864
|
color: var(--wui-color-text-disabled);
|
|
9923
9865
|
`;
|
|
9924
|
-
var StyledLabel3 =
|
|
9866
|
+
var StyledLabel3 = import_styled_components51.default.label`
|
|
9925
9867
|
display: block;
|
|
9926
9868
|
width: 100%;
|
|
9927
9869
|
color: var(--wui-color-text);
|
|
@@ -9953,7 +9895,7 @@ var Label = ({
|
|
|
9953
9895
|
screenReaderOnly = false,
|
|
9954
9896
|
...props
|
|
9955
9897
|
}) => {
|
|
9956
|
-
return /* @__PURE__ */ (0,
|
|
9898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
9957
9899
|
StyledLabel3,
|
|
9958
9900
|
{
|
|
9959
9901
|
...props,
|
|
@@ -9968,28 +9910,28 @@ var Label = ({
|
|
|
9968
9910
|
Label.displayName = "Label";
|
|
9969
9911
|
|
|
9970
9912
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9971
|
-
var
|
|
9913
|
+
var import_react41 = require("react");
|
|
9972
9914
|
|
|
9973
9915
|
// src/components/FormGroup/FormGroup.tsx
|
|
9974
|
-
var
|
|
9975
|
-
var
|
|
9976
|
-
var
|
|
9977
|
-
var StyledFieldset =
|
|
9916
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9917
|
+
var import_react40 = require("react");
|
|
9918
|
+
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9919
|
+
var StyledFieldset = import_styled_components52.default.fieldset`
|
|
9978
9920
|
border: 0;
|
|
9979
9921
|
`;
|
|
9980
|
-
var StyledLegend =
|
|
9922
|
+
var StyledLegend = import_styled_components52.default.legend`
|
|
9981
9923
|
margin-bottom: var(--space-01);
|
|
9982
9924
|
`;
|
|
9983
9925
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9984
|
-
const ref = (0,
|
|
9985
|
-
return /* @__PURE__ */ (0,
|
|
9926
|
+
const ref = (0, import_react40.useRef)();
|
|
9927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
9986
9928
|
Stack,
|
|
9987
9929
|
{
|
|
9988
9930
|
...props,
|
|
9989
9931
|
ref,
|
|
9990
9932
|
renderAs: StyledFieldset,
|
|
9991
9933
|
children: [
|
|
9992
|
-
/* @__PURE__ */ (0,
|
|
9934
|
+
/* @__PURE__ */ (0, import_jsx_runtime225.jsx)(
|
|
9993
9935
|
Heading,
|
|
9994
9936
|
{
|
|
9995
9937
|
renderAs: StyledLegend,
|
|
@@ -10005,8 +9947,8 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
10005
9947
|
FormGroup.displayName = "FormGroup";
|
|
10006
9948
|
|
|
10007
9949
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
10008
|
-
var
|
|
10009
|
-
var CheckboxGroupContext = (0,
|
|
9950
|
+
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9951
|
+
var CheckboxGroupContext = (0, import_react41.createContext)(null);
|
|
10010
9952
|
var CheckboxGroup = ({
|
|
10011
9953
|
children,
|
|
10012
9954
|
name,
|
|
@@ -10014,19 +9956,19 @@ var CheckboxGroup = ({
|
|
|
10014
9956
|
value,
|
|
10015
9957
|
...props
|
|
10016
9958
|
}) => {
|
|
10017
|
-
const context = (0,
|
|
9959
|
+
const context = (0, import_react41.useMemo)(() => {
|
|
10018
9960
|
return {
|
|
10019
9961
|
name,
|
|
10020
9962
|
onChange
|
|
10021
9963
|
};
|
|
10022
9964
|
}, [name, onChange]);
|
|
10023
|
-
return /* @__PURE__ */ (0,
|
|
9965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(FormGroup, { ...props, children }) });
|
|
10024
9966
|
};
|
|
10025
9967
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
10026
9968
|
|
|
10027
9969
|
// src/components/FormField/FormField.tsx
|
|
10028
|
-
var
|
|
10029
|
-
var StyledFormField =
|
|
9970
|
+
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
9971
|
+
var StyledFormField = import_styled_components53.default.div`
|
|
10030
9972
|
--form-field-spacing: var(--wui-space-01);
|
|
10031
9973
|
--form-field-spacing-inline: var(--wui-space-02);
|
|
10032
9974
|
--form-field-error-color: var(--wui-color-text-secondary-error);
|
|
@@ -10056,7 +9998,7 @@ var StyledFormField = import_styled_components54.default.div`
|
|
|
10056
9998
|
grid-template-rows: 1fr;
|
|
10057
9999
|
}
|
|
10058
10000
|
`;
|
|
10059
|
-
var StyledErrorList =
|
|
10001
|
+
var StyledErrorList = import_styled_components53.default.ul`
|
|
10060
10002
|
margin: 0;
|
|
10061
10003
|
padding: 0;
|
|
10062
10004
|
padding-left: var(--wui-space-04);
|
|
@@ -10066,7 +10008,7 @@ var StyledErrorList = import_styled_components54.default.ul`
|
|
|
10066
10008
|
`;
|
|
10067
10009
|
var ErrorMessages = ({ errors, id }) => {
|
|
10068
10010
|
const isMultipleErrors = (0, import_type_guards34.isArray)(errors);
|
|
10069
|
-
return isMultipleErrors ? /* @__PURE__ */ (0,
|
|
10011
|
+
return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
10070
10012
|
Text,
|
|
10071
10013
|
{
|
|
10072
10014
|
colorScheme: "error",
|
|
@@ -10076,7 +10018,7 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
10076
10018
|
children: error
|
|
10077
10019
|
},
|
|
10078
10020
|
`${id}-${index}`
|
|
10079
|
-
)) }) : /* @__PURE__ */ (0,
|
|
10021
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
10080
10022
|
Text,
|
|
10081
10023
|
{
|
|
10082
10024
|
colorScheme: "error",
|
|
@@ -10099,8 +10041,8 @@ var FormField = ({
|
|
|
10099
10041
|
value,
|
|
10100
10042
|
...props
|
|
10101
10043
|
}) => {
|
|
10102
|
-
const formState = (0,
|
|
10103
|
-
const checkboxGroup = (0,
|
|
10044
|
+
const formState = (0, import_react42.useContext)(FormContext);
|
|
10045
|
+
const checkboxGroup = (0, import_react42.useContext)(CheckboxGroupContext);
|
|
10104
10046
|
const defaultValue = formState.values[name];
|
|
10105
10047
|
const isIntegratedLabel = children.type === Checkbox;
|
|
10106
10048
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -10138,19 +10080,19 @@ var FormField = ({
|
|
|
10138
10080
|
"aria-invalid": (0, import_type_guards34.isNotNil)(error)
|
|
10139
10081
|
};
|
|
10140
10082
|
}
|
|
10141
|
-
|
|
10142
|
-
return /* @__PURE__ */ (0,
|
|
10083
|
+
import_react42.Children.only(children);
|
|
10084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(
|
|
10143
10085
|
StyledFormField,
|
|
10144
10086
|
{
|
|
10145
10087
|
...props,
|
|
10146
10088
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
10147
10089
|
children: [
|
|
10148
|
-
!isIntegratedLabel && /* @__PURE__ */ (0,
|
|
10149
|
-
(0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0,
|
|
10150
|
-
(0,
|
|
10151
|
-
(0, import_type_guards34.isNotNil)(computedError) ? /* @__PURE__ */ (0,
|
|
10152
|
-
/* @__PURE__ */ (0,
|
|
10153
|
-
/* @__PURE__ */ (0,
|
|
10090
|
+
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
10091
|
+
(0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
10092
|
+
(0, import_react42.cloneElement)(children, childProps),
|
|
10093
|
+
(0, import_type_guards34.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [
|
|
10094
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", {}),
|
|
10095
|
+
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
10154
10096
|
ErrorMessages,
|
|
10155
10097
|
{
|
|
10156
10098
|
errors: computedError,
|
|
@@ -10165,9 +10107,9 @@ var FormField = ({
|
|
|
10165
10107
|
FormField.displayName = "FormField";
|
|
10166
10108
|
|
|
10167
10109
|
// src/components/FormGroup/RadioGroup.tsx
|
|
10168
|
-
var
|
|
10169
|
-
var
|
|
10170
|
-
var RadioGroupContext = (0,
|
|
10110
|
+
var import_react43 = require("react");
|
|
10111
|
+
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
10112
|
+
var RadioGroupContext = (0, import_react43.createContext)(null);
|
|
10171
10113
|
var RadioGroup = ({
|
|
10172
10114
|
children,
|
|
10173
10115
|
name,
|
|
@@ -10175,21 +10117,21 @@ var RadioGroup = ({
|
|
|
10175
10117
|
value,
|
|
10176
10118
|
...props
|
|
10177
10119
|
}) => {
|
|
10178
|
-
const context = (0,
|
|
10120
|
+
const context = (0, import_react43.useMemo)(() => {
|
|
10179
10121
|
return {
|
|
10180
10122
|
name,
|
|
10181
10123
|
onChange
|
|
10182
10124
|
};
|
|
10183
10125
|
}, [name, onChange]);
|
|
10184
|
-
return /* @__PURE__ */ (0,
|
|
10126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(FormGroup, { ...props, children }) });
|
|
10185
10127
|
};
|
|
10186
10128
|
RadioGroup.displayName = "RadioGroup";
|
|
10187
10129
|
|
|
10188
10130
|
// src/components/IconButton/IconButton.tsx
|
|
10189
|
-
var
|
|
10190
|
-
var
|
|
10191
|
-
var
|
|
10192
|
-
var
|
|
10131
|
+
var import_react44 = require("react");
|
|
10132
|
+
var import_styled_components54 = __toESM(require("styled-components"));
|
|
10133
|
+
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
10134
|
+
var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
10193
10135
|
--icon-button-size-sm: 24px;
|
|
10194
10136
|
--icon-button-size-md: 32px;
|
|
10195
10137
|
--icon-button-size-lg: 40px;
|
|
@@ -10203,18 +10145,18 @@ var StyledButton3 = (0, import_styled_components55.default)(Button)`
|
|
|
10203
10145
|
align-items: center;
|
|
10204
10146
|
line-height: 1;
|
|
10205
10147
|
`;
|
|
10206
|
-
var IconButton = (0,
|
|
10148
|
+
var IconButton = (0, import_react44.forwardRef)(
|
|
10207
10149
|
({ children, label, size = "md", ...props }, ref) => {
|
|
10208
10150
|
const responsiveSize = useResponsiveProp(size);
|
|
10209
|
-
return /* @__PURE__ */ (0,
|
|
10210
|
-
|
|
10151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
10152
|
+
StyledButton2,
|
|
10211
10153
|
{
|
|
10212
10154
|
...props,
|
|
10213
10155
|
ref,
|
|
10214
10156
|
"aria-label": label,
|
|
10215
10157
|
"data-wistia-ui-icon-button": true,
|
|
10216
10158
|
size: responsiveSize,
|
|
10217
|
-
children: (0,
|
|
10159
|
+
children: (0, import_react44.cloneElement)(import_react44.Children.only(children), {
|
|
10218
10160
|
size: responsiveSize
|
|
10219
10161
|
})
|
|
10220
10162
|
}
|
|
@@ -10224,11 +10166,11 @@ var IconButton = (0, import_react46.forwardRef)(
|
|
|
10224
10166
|
IconButton.displayName = "IconButton";
|
|
10225
10167
|
|
|
10226
10168
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
10227
|
-
var
|
|
10228
|
-
var
|
|
10169
|
+
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10170
|
+
var import_react45 = require("react");
|
|
10229
10171
|
var import_type_guards35 = require("@wistia/type-guards");
|
|
10230
|
-
var
|
|
10231
|
-
var StyledInput2 = (0,
|
|
10172
|
+
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
10173
|
+
var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
10232
10174
|
&:not([aria-disabled='true']) {
|
|
10233
10175
|
cursor: pointer;
|
|
10234
10176
|
}
|
|
@@ -10238,10 +10180,10 @@ var StyledInput2 = (0, import_styled_components56.default)(Input)`
|
|
|
10238
10180
|
}
|
|
10239
10181
|
`;
|
|
10240
10182
|
var COPY_SUCCESS_DURATION = 2e3;
|
|
10241
|
-
var InputClickToCopy = (0,
|
|
10183
|
+
var InputClickToCopy = (0, import_react45.forwardRef)(
|
|
10242
10184
|
({ value, onCopy, ...props }, ref) => {
|
|
10243
|
-
const [isCopied, setIsCopied] = (0,
|
|
10244
|
-
(0,
|
|
10185
|
+
const [isCopied, setIsCopied] = (0, import_react45.useState)(false);
|
|
10186
|
+
(0, import_react45.useEffect)(() => {
|
|
10245
10187
|
if (isCopied) {
|
|
10246
10188
|
const timeout = setTimeout(() => {
|
|
10247
10189
|
setIsCopied(false);
|
|
@@ -10265,7 +10207,7 @@ var InputClickToCopy = (0, import_react47.forwardRef)(
|
|
|
10265
10207
|
return value;
|
|
10266
10208
|
});
|
|
10267
10209
|
};
|
|
10268
|
-
return /* @__PURE__ */ (0,
|
|
10210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
10269
10211
|
StyledInput2,
|
|
10270
10212
|
{
|
|
10271
10213
|
"aria-label": "Click to Copy",
|
|
@@ -10273,13 +10215,13 @@ var InputClickToCopy = (0, import_react47.forwardRef)(
|
|
|
10273
10215
|
ref,
|
|
10274
10216
|
onClick: handleClick,
|
|
10275
10217
|
readOnly: true,
|
|
10276
|
-
rightIcon: isCopied ? /* @__PURE__ */ (0,
|
|
10218
|
+
rightIcon: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
10277
10219
|
Icon,
|
|
10278
10220
|
{
|
|
10279
10221
|
colorScheme: "success",
|
|
10280
10222
|
type: "checkmark-circle"
|
|
10281
10223
|
}
|
|
10282
|
-
) : /* @__PURE__ */ (0,
|
|
10224
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(Icon, { type: "save-as-copy" }),
|
|
10283
10225
|
value
|
|
10284
10226
|
}
|
|
10285
10227
|
);
|
|
@@ -10287,16 +10229,125 @@ var InputClickToCopy = (0, import_react47.forwardRef)(
|
|
|
10287
10229
|
);
|
|
10288
10230
|
InputClickToCopy.displayName = "InputClickToCopy";
|
|
10289
10231
|
|
|
10232
|
+
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
10233
|
+
var import_styled_components56 = __toESM(require("styled-components"));
|
|
10234
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
10235
|
+
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
10236
|
+
var StyledKeyboardShortcut = import_styled_components56.default.div`
|
|
10237
|
+
align-items: center;
|
|
10238
|
+
display: flex;
|
|
10239
|
+
gap: var(--wui-space-02);
|
|
10240
|
+
${({ $fullWidth }) => $fullWidth && "width: 100%; justify-content: space-between;"}
|
|
10241
|
+
`;
|
|
10242
|
+
var StyledKey = import_styled_components56.default.kbd`
|
|
10243
|
+
align-items: center;
|
|
10244
|
+
background: var(--wui-color-bg-surface-secondary);
|
|
10245
|
+
border-bottom: 1px solid var(--wui-color-border-secondary);
|
|
10246
|
+
border-radius: 4px;
|
|
10247
|
+
color: var(--wui-color-text);
|
|
10248
|
+
display: flex;
|
|
10249
|
+
font-family: InterVariable, sans-serif;
|
|
10250
|
+
|
|
10251
|
+
/* Adds serif to uppercase "I" to distinguish it from "l": https://rsms.me/inter/glyphs/?g=I.1 */
|
|
10252
|
+
font-feature-settings: 'cv08' on;
|
|
10253
|
+
font-size: 10px;
|
|
10254
|
+
|
|
10255
|
+
/* Adds a slash to the zero to distinguish it from the letter "O": https://rsms.me/inter/glyphs/?g=zero.tf.slash */
|
|
10256
|
+
|
|
10257
|
+
/* Adds tabular numbers to ensure the width of the key is consistent */
|
|
10258
|
+
font-variant-numeric: slashed-zero tabular-nums;
|
|
10259
|
+
height: 20px;
|
|
10260
|
+
justify-content: center;
|
|
10261
|
+
line-height: 20px;
|
|
10262
|
+
min-width: 20px;
|
|
10263
|
+
padding: 0 var(--wui-space-01);
|
|
10264
|
+
`;
|
|
10265
|
+
var Label2 = import_styled_components56.default.span`
|
|
10266
|
+
color: var(--wui-color-text);
|
|
10267
|
+
font-size: 12px;
|
|
10268
|
+
`;
|
|
10269
|
+
var KeysContainer = import_styled_components56.default.div`
|
|
10270
|
+
display: flex;
|
|
10271
|
+
gap: var(--wui-space-01);
|
|
10272
|
+
`;
|
|
10273
|
+
var keyToString = (key) => {
|
|
10274
|
+
switch (key) {
|
|
10275
|
+
// Arrow Keys
|
|
10276
|
+
case "ArrowDown":
|
|
10277
|
+
return "\u2193";
|
|
10278
|
+
case "ArrowLeft":
|
|
10279
|
+
return "\u2190";
|
|
10280
|
+
case "ArrowRight":
|
|
10281
|
+
return "\u2192";
|
|
10282
|
+
case "ArrowUp":
|
|
10283
|
+
return "\u2191";
|
|
10284
|
+
// Modifier Keys
|
|
10285
|
+
case "Alt":
|
|
10286
|
+
return "Alt";
|
|
10287
|
+
case "Cmd":
|
|
10288
|
+
case "Meta":
|
|
10289
|
+
if (/Mac|iPhone|iPad/.test(window.navigator.userAgent)) {
|
|
10290
|
+
return "\u2318";
|
|
10291
|
+
}
|
|
10292
|
+
if (window.navigator.userAgent.includes("Win")) {
|
|
10293
|
+
return "\u229E";
|
|
10294
|
+
}
|
|
10295
|
+
return "^";
|
|
10296
|
+
case "Ctrl":
|
|
10297
|
+
return "Ctrl";
|
|
10298
|
+
case "Option":
|
|
10299
|
+
return "\u2325";
|
|
10300
|
+
case "Shift":
|
|
10301
|
+
return "\u21E7";
|
|
10302
|
+
// Whitespace Keys
|
|
10303
|
+
case "Enter":
|
|
10304
|
+
return "\u21B5";
|
|
10305
|
+
case "Space":
|
|
10306
|
+
return "Space";
|
|
10307
|
+
case "Tab":
|
|
10308
|
+
return "Tab";
|
|
10309
|
+
case "Backspace":
|
|
10310
|
+
return "Del";
|
|
10311
|
+
case "Esc":
|
|
10312
|
+
return "Esc";
|
|
10313
|
+
default:
|
|
10314
|
+
return key.toUpperCase();
|
|
10315
|
+
}
|
|
10316
|
+
};
|
|
10317
|
+
var KeyboardShortcut = ({
|
|
10318
|
+
label,
|
|
10319
|
+
keyboardKeys,
|
|
10320
|
+
fullWidth = false,
|
|
10321
|
+
...otherProps
|
|
10322
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(
|
|
10323
|
+
StyledKeyboardShortcut,
|
|
10324
|
+
{
|
|
10325
|
+
$fullWidth: fullWidth,
|
|
10326
|
+
...otherProps,
|
|
10327
|
+
children: [
|
|
10328
|
+
(0, import_type_guards36.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Label2, { children: label }),
|
|
10329
|
+
/* @__PURE__ */ (0, import_jsx_runtime231.jsx)(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
10330
|
+
StyledKey,
|
|
10331
|
+
{
|
|
10332
|
+
children: keyToString(keyboardKey)
|
|
10333
|
+
},
|
|
10334
|
+
index
|
|
10335
|
+
)) })
|
|
10336
|
+
]
|
|
10337
|
+
}
|
|
10338
|
+
);
|
|
10339
|
+
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
10340
|
+
|
|
10290
10341
|
// src/components/Menu/Menu.tsx
|
|
10291
10342
|
var import_styled_components57 = __toESM(require("styled-components"));
|
|
10292
10343
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
10293
|
-
var
|
|
10294
|
-
var
|
|
10344
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
10345
|
+
var import_react47 = require("react");
|
|
10295
10346
|
|
|
10296
10347
|
// src/components/Menu/MenuContext.tsx
|
|
10297
|
-
var
|
|
10298
|
-
var MenuContext = (0,
|
|
10299
|
-
var useMenuContext = () => (0,
|
|
10348
|
+
var import_react46 = require("react");
|
|
10349
|
+
var MenuContext = (0, import_react46.createContext)({ compact: false });
|
|
10350
|
+
var useMenuContext = () => (0, import_react46.useContext)(MenuContext);
|
|
10300
10351
|
|
|
10301
10352
|
// src/components/Menu/Menu.tsx
|
|
10302
10353
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
@@ -10400,9 +10451,9 @@ var Menu = ({
|
|
|
10400
10451
|
onInteractOutside,
|
|
10401
10452
|
...props
|
|
10402
10453
|
}) => {
|
|
10403
|
-
const contextValue = (0,
|
|
10454
|
+
const contextValue = (0, import_react47.useMemo)(() => ({ compact }), [compact]);
|
|
10404
10455
|
let controlProps = {
|
|
10405
|
-
...(0,
|
|
10456
|
+
...(0, import_type_guards37.isNotNil)(onOpenChange) && (0, import_type_guards37.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
10406
10457
|
};
|
|
10407
10458
|
if (disabled) {
|
|
10408
10459
|
controlProps = {
|
|
@@ -10416,7 +10467,7 @@ var Menu = ({
|
|
|
10416
10467
|
modal: false,
|
|
10417
10468
|
...controlProps,
|
|
10418
10469
|
children: [
|
|
10419
|
-
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0,
|
|
10470
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards37.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
10420
10471
|
Button,
|
|
10421
10472
|
{
|
|
10422
10473
|
"aria-expanded": isOpen,
|
|
@@ -10474,17 +10525,17 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
10474
10525
|
MenuLabel.displayName = "MenuLabel";
|
|
10475
10526
|
|
|
10476
10527
|
// src/components/Menu/SubMenu.tsx
|
|
10477
|
-
var
|
|
10528
|
+
var import_react49 = require("react");
|
|
10478
10529
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
10479
10530
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
10480
|
-
var
|
|
10531
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
10481
10532
|
|
|
10482
10533
|
// src/components/Menu/MenuItemButton.tsx
|
|
10483
|
-
var
|
|
10534
|
+
var import_react48 = require("react");
|
|
10484
10535
|
var import_styled_components59 = __toESM(require("styled-components"));
|
|
10485
|
-
var
|
|
10536
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10486
10537
|
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
10487
|
-
var
|
|
10538
|
+
var StyledButton3 = (0, import_styled_components59.default)(Button)`
|
|
10488
10539
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
10489
10540
|
|
|
10490
10541
|
display: flex;
|
|
@@ -10557,10 +10608,10 @@ var StyledBadgeContainer = import_styled_components59.default.div`
|
|
|
10557
10608
|
font-size: var(--wui-typography-label-4-size);
|
|
10558
10609
|
color: var(--wui-color-text-secondary);
|
|
10559
10610
|
`;
|
|
10560
|
-
var MenuItemButton = (0,
|
|
10611
|
+
var MenuItemButton = (0, import_react48.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
10561
10612
|
let { colorScheme, badge } = props;
|
|
10562
10613
|
if (appearance === "dangerous") {
|
|
10563
|
-
if ((0,
|
|
10614
|
+
if ((0, import_type_guards38.isNotUndefined)(colorScheme)) {
|
|
10564
10615
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
10565
10616
|
}
|
|
10566
10617
|
colorScheme = "error";
|
|
@@ -10579,7 +10630,7 @@ var MenuItemButton = (0, import_react50.forwardRef)(({ children, appearance, com
|
|
|
10579
10630
|
);
|
|
10580
10631
|
}
|
|
10581
10632
|
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(
|
|
10582
|
-
|
|
10633
|
+
StyledButton3,
|
|
10583
10634
|
{
|
|
10584
10635
|
...props,
|
|
10585
10636
|
ref,
|
|
@@ -10590,7 +10641,7 @@ var MenuItemButton = (0, import_react50.forwardRef)(({ children, appearance, com
|
|
|
10590
10641
|
children: [
|
|
10591
10642
|
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
10592
10643
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
10593
|
-
(0,
|
|
10644
|
+
(0, import_type_guards38.isNotNil)(badge) || (0, import_type_guards38.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
10594
10645
|
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
10595
10646
|
]
|
|
10596
10647
|
}
|
|
@@ -10657,12 +10708,12 @@ var SubMenu = ({
|
|
|
10657
10708
|
...props
|
|
10658
10709
|
}) => {
|
|
10659
10710
|
const { isSmAndUp } = useMq();
|
|
10660
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
10711
|
+
const [isExpanded, setIsExpanded] = (0, import_react49.useState)(false);
|
|
10661
10712
|
const { compact } = useMenuContext();
|
|
10662
10713
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10663
10714
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
10664
10715
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(MenuItemLabel, { children: label }),
|
|
10665
|
-
(0,
|
|
10716
|
+
(0, import_type_guards39.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(MenuItemDescription, { children: description }) : null
|
|
10666
10717
|
] }),
|
|
10667
10718
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
10668
10719
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -10686,10 +10737,10 @@ var SubMenu = ({
|
|
|
10686
10737
|
SubMenu.displayName = "SubMenu";
|
|
10687
10738
|
|
|
10688
10739
|
// src/components/Menu/MenuItem.tsx
|
|
10689
|
-
var
|
|
10740
|
+
var import_react50 = require("react");
|
|
10690
10741
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
10691
10742
|
var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
10692
|
-
var MenuItem = (0,
|
|
10743
|
+
var MenuItem = (0, import_react50.forwardRef)(
|
|
10693
10744
|
({ onSelect = () => null, ...props }, ref) => {
|
|
10694
10745
|
return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
|
|
10695
10746
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -10757,7 +10808,7 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
10757
10808
|
|
|
10758
10809
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
10759
10810
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
10760
|
-
var
|
|
10811
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
10761
10812
|
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
10762
10813
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
10763
10814
|
return checked ? /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(
|
|
@@ -10831,8 +10882,8 @@ var CheckboxMenuItem = ({
|
|
|
10831
10882
|
MenuItemButton,
|
|
10832
10883
|
{
|
|
10833
10884
|
...props,
|
|
10834
|
-
leftIcon: (0,
|
|
10835
|
-
rightIcon: (0,
|
|
10885
|
+
leftIcon: (0, import_type_guards40.isNotNil)(props.icon) ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(CheckboxIndicator, { checked }),
|
|
10886
|
+
rightIcon: (0, import_type_guards40.isNotNil)(props.icon) ? /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(import_react_dropdown_menu7.DropdownMenuItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(Icon, { type: "checkmark" }) }) : void 0
|
|
10836
10887
|
}
|
|
10837
10888
|
)
|
|
10838
10889
|
}
|
|
@@ -10841,10 +10892,10 @@ var CheckboxMenuItem = ({
|
|
|
10841
10892
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
10842
10893
|
|
|
10843
10894
|
// src/components/Modal/Modal.tsx
|
|
10844
|
-
var
|
|
10895
|
+
var import_react54 = require("react");
|
|
10845
10896
|
var import_styled_components66 = __toESM(require("styled-components"));
|
|
10846
10897
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10847
|
-
var
|
|
10898
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
10848
10899
|
|
|
10849
10900
|
// src/components/Modal/ModalHeader.tsx
|
|
10850
10901
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
@@ -10901,21 +10952,21 @@ var ModalHeader = ({
|
|
|
10901
10952
|
};
|
|
10902
10953
|
|
|
10903
10954
|
// src/components/Modal/ModalContent.tsx
|
|
10904
|
-
var
|
|
10955
|
+
var import_react52 = require("react");
|
|
10905
10956
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
10906
10957
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
10907
10958
|
|
|
10908
10959
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10909
|
-
var
|
|
10910
|
-
var
|
|
10960
|
+
var import_react51 = require("react");
|
|
10961
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
10911
10962
|
var useFocusRestore = () => {
|
|
10912
|
-
const previouslyFocusedRef = (0,
|
|
10913
|
-
(0,
|
|
10963
|
+
const previouslyFocusedRef = (0, import_react51.useRef)(null);
|
|
10964
|
+
(0, import_react51.useEffect)(() => {
|
|
10914
10965
|
previouslyFocusedRef.current = document.activeElement;
|
|
10915
10966
|
}, []);
|
|
10916
|
-
(0,
|
|
10967
|
+
(0, import_react51.useEffect)(() => {
|
|
10917
10968
|
return () => {
|
|
10918
|
-
if ((0,
|
|
10969
|
+
if ((0, import_type_guards41.isNotNil)(previouslyFocusedRef.current)) {
|
|
10919
10970
|
setTimeout(() => {
|
|
10920
10971
|
previouslyFocusedRef.current?.focus();
|
|
10921
10972
|
}, 0);
|
|
@@ -10967,7 +11018,7 @@ var StyledModalContent = (0, import_styled_components64.default)(import_react_di
|
|
|
10967
11018
|
}
|
|
10968
11019
|
}
|
|
10969
11020
|
`;
|
|
10970
|
-
var ModalContent = (0,
|
|
11021
|
+
var ModalContent = (0, import_react52.forwardRef)(
|
|
10971
11022
|
({ fullHeight, width, children, ...props }, ref) => {
|
|
10972
11023
|
useFocusRestore();
|
|
10973
11024
|
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
@@ -10985,7 +11036,7 @@ var ModalContent = (0, import_react54.forwardRef)(
|
|
|
10985
11036
|
);
|
|
10986
11037
|
|
|
10987
11038
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
10988
|
-
var
|
|
11039
|
+
var import_react53 = require("react");
|
|
10989
11040
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
10990
11041
|
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
10991
11042
|
var backdropAnimationDuration = 150;
|
|
@@ -11028,7 +11079,7 @@ var BackdropComponent = import_styled_components65.default.div`
|
|
|
11028
11079
|
}
|
|
11029
11080
|
}
|
|
11030
11081
|
`;
|
|
11031
|
-
var Backdrop = (0,
|
|
11082
|
+
var Backdrop = (0, import_react53.forwardRef)(
|
|
11032
11083
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11033
11084
|
BackdropComponent,
|
|
11034
11085
|
{
|
|
@@ -11050,7 +11101,7 @@ var ModalBody = import_styled_components66.default.div`
|
|
|
11050
11101
|
display: flex;
|
|
11051
11102
|
order: 2;
|
|
11052
11103
|
`;
|
|
11053
|
-
var Modal = (0,
|
|
11104
|
+
var Modal = (0, import_react54.forwardRef)(
|
|
11054
11105
|
({
|
|
11055
11106
|
children,
|
|
11056
11107
|
fullHeight = false,
|
|
@@ -11067,7 +11118,7 @@ var Modal = (0, import_react56.forwardRef)(
|
|
|
11067
11118
|
import_react_dialog4.Root,
|
|
11068
11119
|
{
|
|
11069
11120
|
onOpenChange: (open2) => {
|
|
11070
|
-
if (!open2 && (0,
|
|
11121
|
+
if (!open2 && (0, import_type_guards42.isNotNil)(onRequestClose)) {
|
|
11071
11122
|
onRequestClose();
|
|
11072
11123
|
}
|
|
11073
11124
|
},
|
|
@@ -11080,7 +11131,7 @@ var Modal = (0, import_react56.forwardRef)(
|
|
|
11080
11131
|
ref,
|
|
11081
11132
|
fullHeight,
|
|
11082
11133
|
onOpenAutoFocus: (event) => {
|
|
11083
|
-
if ((0,
|
|
11134
|
+
if ((0, import_type_guards42.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
11084
11135
|
event.preventDefault();
|
|
11085
11136
|
requestAnimationFrame(() => {
|
|
11086
11137
|
initialFocusRef.current?.focus();
|
|
@@ -11114,9 +11165,9 @@ var import_react_popover = require("@radix-ui/react-popover");
|
|
|
11114
11165
|
var import_styled_components67 = __toESM(require("styled-components"));
|
|
11115
11166
|
|
|
11116
11167
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
11117
|
-
var
|
|
11168
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
11118
11169
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
11119
|
-
return (0,
|
|
11170
|
+
return (0, import_type_guards43.isNotNil)(onOpenChange) && (0, import_type_guards43.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
11120
11171
|
};
|
|
11121
11172
|
|
|
11122
11173
|
// src/components/Popover/Popover.tsx
|
|
@@ -11187,7 +11238,7 @@ Popover.displayName = "Popover";
|
|
|
11187
11238
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
11188
11239
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11189
11240
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
11190
|
-
var
|
|
11241
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
11191
11242
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
11192
11243
|
var ProgressBarWrapper = import_styled_components68.default.div`
|
|
11193
11244
|
--progress-bar-height: 8px;
|
|
@@ -11242,7 +11293,7 @@ var ProgressBar = ({
|
|
|
11242
11293
|
...props
|
|
11243
11294
|
}) => {
|
|
11244
11295
|
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(ProgressBarWrapper, { children: [
|
|
11245
|
-
(0,
|
|
11296
|
+
(0, import_type_guards44.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
11246
11297
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(
|
|
11247
11298
|
StyledProgressBar,
|
|
11248
11299
|
{
|
|
@@ -11258,15 +11309,15 @@ var ProgressBar = ({
|
|
|
11258
11309
|
)
|
|
11259
11310
|
}
|
|
11260
11311
|
),
|
|
11261
|
-
(0,
|
|
11312
|
+
(0, import_type_guards44.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
11262
11313
|
] });
|
|
11263
11314
|
};
|
|
11264
11315
|
ProgressBar.displayName = "ProgressBar";
|
|
11265
11316
|
|
|
11266
11317
|
// src/components/Radio/Radio.tsx
|
|
11267
|
-
var
|
|
11318
|
+
var import_react55 = require("react");
|
|
11268
11319
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11269
|
-
var
|
|
11320
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
11270
11321
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
11271
11322
|
var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
|
|
11272
11323
|
"svg",
|
|
@@ -11367,7 +11418,7 @@ var StyledHiddenRadioInput = import_styled_components69.default.input`
|
|
|
11367
11418
|
display: block;
|
|
11368
11419
|
}
|
|
11369
11420
|
`;
|
|
11370
|
-
var Radio = (0,
|
|
11421
|
+
var Radio = (0, import_react55.forwardRef)(
|
|
11371
11422
|
({
|
|
11372
11423
|
checked,
|
|
11373
11424
|
disabled = false,
|
|
@@ -11382,8 +11433,8 @@ var Radio = (0, import_react57.forwardRef)(
|
|
|
11382
11433
|
hideLabel = false,
|
|
11383
11434
|
...props
|
|
11384
11435
|
}, ref) => {
|
|
11385
|
-
const generatedId = (0,
|
|
11386
|
-
const computedId = (0,
|
|
11436
|
+
const generatedId = (0, import_react55.useId)();
|
|
11437
|
+
const computedId = (0, import_type_guards45.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11387
11438
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(
|
|
11388
11439
|
StyledRadioWrapper,
|
|
11389
11440
|
{
|
|
@@ -11432,20 +11483,20 @@ var Radio = (0, import_react57.forwardRef)(
|
|
|
11432
11483
|
Radio.displayName = "Radio";
|
|
11433
11484
|
|
|
11434
11485
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
11435
|
-
var
|
|
11486
|
+
var import_react58 = require("react");
|
|
11436
11487
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11437
11488
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
11438
|
-
var
|
|
11489
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
11439
11490
|
|
|
11440
11491
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11441
|
-
var
|
|
11492
|
+
var import_react56 = require("react");
|
|
11442
11493
|
var import_jsx_runtime249 = require("react/jsx-runtime");
|
|
11443
|
-
var SelectedItemStyleContext = (0,
|
|
11494
|
+
var SelectedItemStyleContext = (0, import_react56.createContext)(null);
|
|
11444
11495
|
var SelectedItemStyleProvider = ({
|
|
11445
11496
|
children
|
|
11446
11497
|
}) => {
|
|
11447
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
11448
|
-
const selectedItemIndicatorStyle = (0,
|
|
11498
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react56.useState)(null);
|
|
11499
|
+
const selectedItemIndicatorStyle = (0, import_react56.useMemo)(
|
|
11449
11500
|
() => selectedItemMeasurements != null ? {
|
|
11450
11501
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11451
11502
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
@@ -11455,7 +11506,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11455
11506
|
},
|
|
11456
11507
|
[selectedItemMeasurements]
|
|
11457
11508
|
);
|
|
11458
|
-
const contextValue = (0,
|
|
11509
|
+
const contextValue = (0, import_react56.useMemo)(
|
|
11459
11510
|
() => ({
|
|
11460
11511
|
setSelectedItemMeasurements,
|
|
11461
11512
|
selectedItemIndicatorStyle
|
|
@@ -11465,7 +11516,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11465
11516
|
return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11466
11517
|
};
|
|
11467
11518
|
var useSelectedItemStyle = () => {
|
|
11468
|
-
const context = (0,
|
|
11519
|
+
const context = (0, import_react56.useContext)(SelectedItemStyleContext);
|
|
11469
11520
|
if (context === null) {
|
|
11470
11521
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11471
11522
|
}
|
|
@@ -11476,11 +11527,11 @@ var useSelectedItemStyle = () => {
|
|
|
11476
11527
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11477
11528
|
|
|
11478
11529
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11479
|
-
var
|
|
11480
|
-
var SegmentedControlValueContext = (0,
|
|
11530
|
+
var import_react57 = require("react");
|
|
11531
|
+
var SegmentedControlValueContext = (0, import_react57.createContext)(null);
|
|
11481
11532
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11482
11533
|
var useSegmentedControlValue = () => {
|
|
11483
|
-
const context = (0,
|
|
11534
|
+
const context = (0, import_react57.useContext)(SegmentedControlValueContext);
|
|
11484
11535
|
if (context === null) {
|
|
11485
11536
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11486
11537
|
}
|
|
@@ -11526,7 +11577,7 @@ var segmentedControlStyles = import_styled_components71.css`
|
|
|
11526
11577
|
var StyledSegmentedControl = (0, import_styled_components71.default)(import_react_toggle_group.Root)`
|
|
11527
11578
|
${segmentedControlStyles}
|
|
11528
11579
|
`;
|
|
11529
|
-
var SegmentedControl = (0,
|
|
11580
|
+
var SegmentedControl = (0, import_react58.forwardRef)(
|
|
11530
11581
|
({
|
|
11531
11582
|
children,
|
|
11532
11583
|
disabled = false,
|
|
@@ -11535,7 +11586,7 @@ var SegmentedControl = (0, import_react60.forwardRef)(
|
|
|
11535
11586
|
onSelectedValueChange,
|
|
11536
11587
|
...props
|
|
11537
11588
|
}, ref) => {
|
|
11538
|
-
if ((0,
|
|
11589
|
+
if ((0, import_type_guards46.isNil)(children)) {
|
|
11539
11590
|
return null;
|
|
11540
11591
|
}
|
|
11541
11592
|
return /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
@@ -11561,10 +11612,10 @@ var SegmentedControl = (0, import_react60.forwardRef)(
|
|
|
11561
11612
|
SegmentedControl.displayName = "SegmentedControl";
|
|
11562
11613
|
|
|
11563
11614
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
11564
|
-
var
|
|
11615
|
+
var import_react59 = require("react");
|
|
11565
11616
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11566
11617
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
11567
|
-
var
|
|
11618
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
11568
11619
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11569
11620
|
var segmentedControlItemStyles = import_styled_components72.css`
|
|
11570
11621
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -11629,11 +11680,11 @@ var segmentedControlItemStyles = import_styled_components72.css`
|
|
|
11629
11680
|
var StyledSegmentedControlItem = (0, import_styled_components72.default)(import_react_toggle_group2.Item)`
|
|
11630
11681
|
${segmentedControlItemStyles}
|
|
11631
11682
|
`;
|
|
11632
|
-
var SegmentedControlItem = (0,
|
|
11683
|
+
var SegmentedControlItem = (0, import_react59.forwardRef)(
|
|
11633
11684
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11634
11685
|
const selectedValue = useSegmentedControlValue();
|
|
11635
11686
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
11636
|
-
const buttonRef = (0,
|
|
11687
|
+
const buttonRef = (0, import_react59.useRef)(null);
|
|
11637
11688
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11638
11689
|
const handleClick = (event) => {
|
|
11639
11690
|
const target = event.target;
|
|
@@ -11642,7 +11693,7 @@ var SegmentedControlItem = (0, import_react61.forwardRef)(
|
|
|
11642
11693
|
event.preventDefault();
|
|
11643
11694
|
}
|
|
11644
11695
|
};
|
|
11645
|
-
(0,
|
|
11696
|
+
(0, import_react59.useEffect)(() => {
|
|
11646
11697
|
const buttonElem = buttonRef.current;
|
|
11647
11698
|
if (!buttonElem) {
|
|
11648
11699
|
return void 0;
|
|
@@ -11671,8 +11722,8 @@ var SegmentedControlItem = (0, import_react61.forwardRef)(
|
|
|
11671
11722
|
StyledSegmentedControlItem,
|
|
11672
11723
|
{
|
|
11673
11724
|
ref: combinedRef,
|
|
11674
|
-
$hasLabel: (0,
|
|
11675
|
-
"aria-label": (0,
|
|
11725
|
+
$hasLabel: (0, import_type_guards47.isNotNil)(label),
|
|
11726
|
+
"aria-label": (0, import_type_guards47.isNotNil)(label) ? void 0 : ariaLabel,
|
|
11676
11727
|
disabled,
|
|
11677
11728
|
onClick: handleClick,
|
|
11678
11729
|
value,
|
|
@@ -11688,7 +11739,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11688
11739
|
|
|
11689
11740
|
// src/components/Select/Select.tsx
|
|
11690
11741
|
var import_react_select = require("@radix-ui/react-select");
|
|
11691
|
-
var
|
|
11742
|
+
var import_react60 = require("react");
|
|
11692
11743
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11693
11744
|
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
11694
11745
|
var StyledTrigger = (0, import_styled_components73.default)(import_react_select.Trigger)`
|
|
@@ -11753,7 +11804,7 @@ var StyledContent3 = (0, import_styled_components73.default)(import_react_select
|
|
|
11753
11804
|
max-height: var(--radix-select-content-available-height);
|
|
11754
11805
|
z-index: var(--wui-zindex-select);
|
|
11755
11806
|
`;
|
|
11756
|
-
var Select = (0,
|
|
11807
|
+
var Select = (0, import_react60.forwardRef)(
|
|
11757
11808
|
({
|
|
11758
11809
|
colorScheme = "inherit",
|
|
11759
11810
|
children,
|
|
@@ -11802,9 +11853,9 @@ Select.displayName = "Select";
|
|
|
11802
11853
|
|
|
11803
11854
|
// src/components/Select/SelectOption.tsx
|
|
11804
11855
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11805
|
-
var
|
|
11856
|
+
var import_react61 = require("react");
|
|
11806
11857
|
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11807
|
-
var
|
|
11858
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
11808
11859
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
11809
11860
|
var StyledItem = (0, import_styled_components74.default)(import_react_select2.Item)`
|
|
11810
11861
|
${variantStyleMap2.body3};
|
|
@@ -11833,7 +11884,7 @@ var StyledItem = (0, import_styled_components74.default)(import_react_select2.It
|
|
|
11833
11884
|
var StyledIconContainer = import_styled_components74.default.span`
|
|
11834
11885
|
width: 12px;
|
|
11835
11886
|
`;
|
|
11836
|
-
var SelectOption = (0,
|
|
11887
|
+
var SelectOption = (0, import_react61.forwardRef)(
|
|
11837
11888
|
({ children, selectedDisplayValue, ...props }, forwardedRef) => {
|
|
11838
11889
|
return /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
|
|
11839
11890
|
StyledItem,
|
|
@@ -11848,7 +11899,7 @@ var SelectOption = (0, import_react63.forwardRef)(
|
|
|
11848
11899
|
type: "checkmark"
|
|
11849
11900
|
}
|
|
11850
11901
|
) }) }),
|
|
11851
|
-
(0,
|
|
11902
|
+
(0, import_type_guards48.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)("div", { children: [
|
|
11852
11903
|
children,
|
|
11853
11904
|
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
11854
11905
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(import_react_select2.ItemText, { children })
|
|
@@ -11881,9 +11932,9 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11881
11932
|
};
|
|
11882
11933
|
|
|
11883
11934
|
// src/components/Switch/Switch.tsx
|
|
11884
|
-
var
|
|
11935
|
+
var import_react62 = require("react");
|
|
11885
11936
|
var import_styled_components76 = __toESM(require("styled-components"));
|
|
11886
|
-
var
|
|
11937
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
11887
11938
|
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
11888
11939
|
var sizeSmall3 = import_styled_components76.css`
|
|
11889
11940
|
--wui-size-small-width: 24px;
|
|
@@ -11986,7 +12037,7 @@ var StyledHiddenSwitchInput = import_styled_components76.default.input`
|
|
|
11986
12037
|
}
|
|
11987
12038
|
}
|
|
11988
12039
|
`;
|
|
11989
|
-
var Switch = (0,
|
|
12040
|
+
var Switch = (0, import_react62.forwardRef)(
|
|
11990
12041
|
({
|
|
11991
12042
|
checked,
|
|
11992
12043
|
disabled = false,
|
|
@@ -12001,8 +12052,8 @@ var Switch = (0, import_react64.forwardRef)(
|
|
|
12001
12052
|
hideLabel = false,
|
|
12002
12053
|
...props
|
|
12003
12054
|
}, ref) => {
|
|
12004
|
-
const generatedId = (0,
|
|
12005
|
-
const computedId = (0,
|
|
12055
|
+
const generatedId = (0, import_react62.useId)();
|
|
12056
|
+
const computedId = (0, import_type_guards49.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
12006
12057
|
return /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
12007
12058
|
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
12008
12059
|
StyledHiddenSwitchInput,
|
|
@@ -12091,8 +12142,8 @@ var Table = ({
|
|
|
12091
12142
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12092
12143
|
|
|
12093
12144
|
// src/components/Table/TableSectionContext.ts
|
|
12094
|
-
var
|
|
12095
|
-
var TableSectionContext = (0,
|
|
12145
|
+
var import_react63 = require("react");
|
|
12146
|
+
var TableSectionContext = (0, import_react63.createContext)(null);
|
|
12096
12147
|
|
|
12097
12148
|
// src/components/Table/TableBody.tsx
|
|
12098
12149
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
@@ -12102,7 +12153,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
12102
12153
|
};
|
|
12103
12154
|
|
|
12104
12155
|
// src/components/Table/TableCell.tsx
|
|
12105
|
-
var
|
|
12156
|
+
var import_react64 = require("react");
|
|
12106
12157
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12107
12158
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
12108
12159
|
var sharedStyles = import_styled_components79.css`
|
|
@@ -12123,7 +12174,7 @@ var StyledTd = import_styled_components79.default.td`
|
|
|
12123
12174
|
line-height: var(--wui-typography-body-2-line-height);
|
|
12124
12175
|
`;
|
|
12125
12176
|
var TableCell = ({ children, ...props }) => {
|
|
12126
|
-
const section = (0,
|
|
12177
|
+
const section = (0, import_react64.useContext)(TableSectionContext);
|
|
12127
12178
|
if (section === "head") {
|
|
12128
12179
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(StyledTh, { ...props, children });
|
|
12129
12180
|
}
|
|
@@ -12155,9 +12206,9 @@ var TableRow = ({ children, ...props }) => {
|
|
|
12155
12206
|
};
|
|
12156
12207
|
|
|
12157
12208
|
// src/components/Tabs/Tabs.tsx
|
|
12158
|
-
var
|
|
12209
|
+
var import_react68 = require("react");
|
|
12159
12210
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
12160
|
-
var
|
|
12211
|
+
var import_type_guards51 = require("@wistia/type-guards");
|
|
12161
12212
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12162
12213
|
|
|
12163
12214
|
// src/components/Tabs/TabPanel.tsx
|
|
@@ -12210,17 +12261,17 @@ var TabList = ({
|
|
|
12210
12261
|
TabList.displayName = "TabList";
|
|
12211
12262
|
|
|
12212
12263
|
// src/components/Tabs/TabItem.tsx
|
|
12213
|
-
var
|
|
12264
|
+
var import_react66 = require("react");
|
|
12214
12265
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
12215
12266
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
12216
|
-
var
|
|
12267
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
12217
12268
|
|
|
12218
12269
|
// src/components/Tabs/useTabsValue.tsx
|
|
12219
|
-
var
|
|
12220
|
-
var TabsValueContext = (0,
|
|
12270
|
+
var import_react65 = require("react");
|
|
12271
|
+
var TabsValueContext = (0, import_react65.createContext)(null);
|
|
12221
12272
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
12222
12273
|
var useTabsValue = () => {
|
|
12223
|
-
const context = (0,
|
|
12274
|
+
const context = (0, import_react65.useContext)(TabsValueContext);
|
|
12224
12275
|
if (context === null) {
|
|
12225
12276
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
12226
12277
|
}
|
|
@@ -12236,13 +12287,13 @@ var StyledTabItem = (0, import_styled_components85.default)(import_react_tabs3.T
|
|
|
12236
12287
|
outline: none;
|
|
12237
12288
|
}
|
|
12238
12289
|
`;
|
|
12239
|
-
var TabItem = (0,
|
|
12290
|
+
var TabItem = (0, import_react66.forwardRef)(
|
|
12240
12291
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
12241
12292
|
const selectedValue = useTabsValue();
|
|
12242
12293
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
12243
|
-
const buttonRef = (0,
|
|
12294
|
+
const buttonRef = (0, import_react66.useRef)(null);
|
|
12244
12295
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
12245
|
-
(0,
|
|
12296
|
+
(0, import_react66.useEffect)(() => {
|
|
12246
12297
|
const buttonElem = buttonRef.current;
|
|
12247
12298
|
if (!buttonElem) {
|
|
12248
12299
|
return void 0;
|
|
@@ -12271,8 +12322,8 @@ var TabItem = (0, import_react68.forwardRef)(
|
|
|
12271
12322
|
StyledTabItem,
|
|
12272
12323
|
{
|
|
12273
12324
|
ref: combinedRef,
|
|
12274
|
-
$hasLabel: (0,
|
|
12275
|
-
"aria-label": (0,
|
|
12325
|
+
$hasLabel: (0, import_type_guards50.isNotNil)(label),
|
|
12326
|
+
"aria-label": (0, import_type_guards50.isNotNil)(label) ? void 0 : ariaLabel,
|
|
12276
12327
|
disabled,
|
|
12277
12328
|
value,
|
|
12278
12329
|
children: [
|
|
@@ -12286,16 +12337,16 @@ var TabItem = (0, import_react68.forwardRef)(
|
|
|
12286
12337
|
TabItem.displayName = "TabItem";
|
|
12287
12338
|
|
|
12288
12339
|
// src/components/Tabs/extractTabItems.ts
|
|
12289
|
-
var
|
|
12340
|
+
var import_react67 = require("react");
|
|
12290
12341
|
var extractTabItems = (children) => {
|
|
12291
12342
|
const tabItems = [];
|
|
12292
|
-
|
|
12293
|
-
if (!(0,
|
|
12343
|
+
import_react67.Children.forEach(children, (child) => {
|
|
12344
|
+
if (!(0, import_react67.isValidElement)(child)) {
|
|
12294
12345
|
return;
|
|
12295
12346
|
}
|
|
12296
12347
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
12297
12348
|
tabItems.push(child);
|
|
12298
|
-
} else if (child.type ===
|
|
12349
|
+
} else if (child.type === import_react67.Fragment) {
|
|
12299
12350
|
const fragmentElement = child;
|
|
12300
12351
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
12301
12352
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -12342,7 +12393,7 @@ var StyledTabsRoot = (0, import_styled_components87.default)(import_react_tabs4.
|
|
|
12342
12393
|
flex-direction: column;
|
|
12343
12394
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12344
12395
|
`;
|
|
12345
|
-
var Tabs = (0,
|
|
12396
|
+
var Tabs = (0, import_react68.forwardRef)(
|
|
12346
12397
|
({
|
|
12347
12398
|
children,
|
|
12348
12399
|
fullWidth = true,
|
|
@@ -12354,7 +12405,7 @@ var Tabs = (0, import_react70.forwardRef)(
|
|
|
12354
12405
|
...props
|
|
12355
12406
|
}, ref) => {
|
|
12356
12407
|
const tabItems = extractTabItems(children);
|
|
12357
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
12408
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react68.useState)(defaultSelectedValue);
|
|
12358
12409
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
12359
12410
|
defaultValue: defaultSelectedValue,
|
|
12360
12411
|
onValueChange: setInternalSelectedValue
|
|
@@ -12384,7 +12435,7 @@ var Tabs = (0, import_react70.forwardRef)(
|
|
|
12384
12435
|
label,
|
|
12385
12436
|
"aria-label": ariaLabelForTab
|
|
12386
12437
|
} = tab.props;
|
|
12387
|
-
if ((0,
|
|
12438
|
+
if ((0, import_type_guards51.isNil)(icon)) {
|
|
12388
12439
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
12389
12440
|
TabItem,
|
|
12390
12441
|
{
|
|
@@ -12395,7 +12446,7 @@ var Tabs = (0, import_react70.forwardRef)(
|
|
|
12395
12446
|
value
|
|
12396
12447
|
);
|
|
12397
12448
|
}
|
|
12398
|
-
if ((0,
|
|
12449
|
+
if ((0, import_type_guards51.isNotNil)(label)) {
|
|
12399
12450
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
12400
12451
|
TabItem,
|
|
12401
12452
|
{
|
|
@@ -12407,7 +12458,7 @@ var Tabs = (0, import_react70.forwardRef)(
|
|
|
12407
12458
|
value
|
|
12408
12459
|
);
|
|
12409
12460
|
}
|
|
12410
|
-
if ((0,
|
|
12461
|
+
if ((0, import_type_guards51.isNotNil)(ariaLabelForTab)) {
|
|
12411
12462
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
12412
12463
|
TabItem,
|
|
12413
12464
|
{
|
|
@@ -12440,19 +12491,19 @@ var Tabs = (0, import_react70.forwardRef)(
|
|
|
12440
12491
|
Tabs.displayName = "Tabs";
|
|
12441
12492
|
|
|
12442
12493
|
// src/components/Tabs/Tab.tsx
|
|
12443
|
-
var
|
|
12494
|
+
var import_react69 = require("react");
|
|
12444
12495
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
12445
|
-
var Tab = (0,
|
|
12496
|
+
var Tab = (0, import_react69.forwardRef)(({ children }, ref) => {
|
|
12446
12497
|
return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("div", { ref, children });
|
|
12447
12498
|
});
|
|
12448
12499
|
Tab.displayName = "Tab";
|
|
12449
12500
|
|
|
12450
12501
|
// src/components/Tag/Tag.tsx
|
|
12451
|
-
var
|
|
12502
|
+
var import_react70 = require("react");
|
|
12452
12503
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
12453
|
-
var
|
|
12504
|
+
var import_type_guards52 = require("@wistia/type-guards");
|
|
12454
12505
|
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
12455
|
-
var TagLabel =
|
|
12506
|
+
var TagLabel = import_styled_components88.default.a`
|
|
12456
12507
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
12457
12508
|
font-size: var(--wui-typography-label-4-size);
|
|
12458
12509
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -12474,11 +12525,11 @@ var TagLabel = (0, import_styled_components88.default)(ConditionalButton)`
|
|
|
12474
12525
|
padding-right: var(--wui-space-01);
|
|
12475
12526
|
}
|
|
12476
12527
|
|
|
12477
|
-
:is(
|
|
12528
|
+
:is(a):hover {
|
|
12478
12529
|
background: var(--wui-color-bg-surface-secondary-hover);
|
|
12479
12530
|
}
|
|
12480
12531
|
|
|
12481
|
-
:is(
|
|
12532
|
+
:is(a):active {
|
|
12482
12533
|
background: var(--wui-color-bg-surface-secondary-active);
|
|
12483
12534
|
}
|
|
12484
12535
|
|
|
@@ -12535,10 +12586,10 @@ var StyledTag = import_styled_components88.default.div`
|
|
|
12535
12586
|
}
|
|
12536
12587
|
`;
|
|
12537
12588
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
12538
|
-
if ((0,
|
|
12589
|
+
if ((0, import_type_guards52.isNil)(onClickRemove)) {
|
|
12539
12590
|
return null;
|
|
12540
12591
|
}
|
|
12541
|
-
if ((0,
|
|
12592
|
+
if ((0, import_type_guards52.isNil)(onClickRemoveLabel)) {
|
|
12542
12593
|
throw new Error(
|
|
12543
12594
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
12544
12595
|
);
|
|
@@ -12565,10 +12616,10 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12565
12616
|
)
|
|
12566
12617
|
] });
|
|
12567
12618
|
};
|
|
12568
|
-
var Tag = (0,
|
|
12569
|
-
({ onClickRemove, colorScheme = "inherit", icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12570
|
-
const hasIcon = (0,
|
|
12571
|
-
const
|
|
12619
|
+
var Tag = (0, import_react70.forwardRef)(
|
|
12620
|
+
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12621
|
+
const hasIcon = (0, import_type_guards52.isNotNil)(icon);
|
|
12622
|
+
const labelProps = (0, import_type_guards52.isNotNil)(href) && (0, import_type_guards52.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
12572
12623
|
return /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(
|
|
12573
12624
|
StyledTag,
|
|
12574
12625
|
{
|
|
@@ -12579,8 +12630,8 @@ var Tag = (0, import_react72.forwardRef)(
|
|
|
12579
12630
|
/* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(
|
|
12580
12631
|
TagLabel,
|
|
12581
12632
|
{
|
|
12633
|
+
...labelProps,
|
|
12582
12634
|
$colorScheme: colorScheme,
|
|
12583
|
-
...conditionalButtonProps,
|
|
12584
12635
|
children: [
|
|
12585
12636
|
hasIcon ? icon : null,
|
|
12586
12637
|
label
|
|
@@ -12604,7 +12655,7 @@ Tag.displayName = "Tag";
|
|
|
12604
12655
|
|
|
12605
12656
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
12606
12657
|
var import_styled_components89 = __toESM(require("styled-components"));
|
|
12607
|
-
var
|
|
12658
|
+
var import_type_guards53 = require("@wistia/type-guards");
|
|
12608
12659
|
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
12609
12660
|
var StyledThumbnailBadge = import_styled_components89.default.div`
|
|
12610
12661
|
align-items: center;
|
|
@@ -12632,19 +12683,19 @@ var StyledThumbnailBadge = import_styled_components89.default.div`
|
|
|
12632
12683
|
`;
|
|
12633
12684
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
12634
12685
|
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
12635
|
-
(0,
|
|
12686
|
+
(0, import_type_guards53.isNotNil)(icon) && icon,
|
|
12636
12687
|
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)("span", { children: label })
|
|
12637
12688
|
] });
|
|
12638
12689
|
};
|
|
12639
12690
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
12640
12691
|
|
|
12641
12692
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12642
|
-
var
|
|
12693
|
+
var import_react71 = require("react");
|
|
12643
12694
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
12644
|
-
var
|
|
12695
|
+
var import_type_guards55 = require("@wistia/type-guards");
|
|
12645
12696
|
|
|
12646
12697
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12647
|
-
var
|
|
12698
|
+
var import_type_guards54 = require("@wistia/type-guards");
|
|
12648
12699
|
var import_styled_components90 = require("styled-components");
|
|
12649
12700
|
var gradients = {
|
|
12650
12701
|
defaultDarkOne: import_styled_components90.css`
|
|
@@ -12772,7 +12823,7 @@ var gradients = {
|
|
|
12772
12823
|
};
|
|
12773
12824
|
var gradientMap = Object.keys(gradients);
|
|
12774
12825
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
12775
|
-
return (0,
|
|
12826
|
+
return (0, import_type_guards54.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
12776
12827
|
};
|
|
12777
12828
|
|
|
12778
12829
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
@@ -12808,10 +12859,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
12808
12859
|
);
|
|
12809
12860
|
};
|
|
12810
12861
|
var StyledThumbnail = import_styled_components91.default.div`
|
|
12811
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
12862
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards55.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
12812
12863
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
12813
12864
|
// if we don't have $backgroundUrl show a gradient
|
|
12814
|
-
(0,
|
|
12865
|
+
(0, import_type_guards55.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
12815
12866
|
)};
|
|
12816
12867
|
background-position: center center;
|
|
12817
12868
|
background-size: cover;
|
|
@@ -12826,7 +12877,7 @@ var StyledThumbnail = import_styled_components91.default.div`
|
|
|
12826
12877
|
border-radius: calc(8% * (9 / 16)) / 8%;
|
|
12827
12878
|
}
|
|
12828
12879
|
`;
|
|
12829
|
-
var Thumbnail = (0,
|
|
12880
|
+
var Thumbnail = (0, import_react71.forwardRef)(
|
|
12830
12881
|
({
|
|
12831
12882
|
gradientBackground = "defaultMidOne",
|
|
12832
12883
|
thumbnailImageType = "square",
|
|
@@ -12835,7 +12886,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
12835
12886
|
children,
|
|
12836
12887
|
...props
|
|
12837
12888
|
}, ref) => {
|
|
12838
|
-
const backgroundUrl = thumbnailImageType === "square" && (0,
|
|
12889
|
+
const backgroundUrl = thumbnailImageType === "square" && (0, import_type_guards55.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0;
|
|
12839
12890
|
return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(
|
|
12840
12891
|
StyledThumbnail,
|
|
12841
12892
|
{
|
|
@@ -12846,8 +12897,8 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
12846
12897
|
$width: width,
|
|
12847
12898
|
role: "presentation",
|
|
12848
12899
|
children: [
|
|
12849
|
-
(0,
|
|
12850
|
-
(0,
|
|
12900
|
+
(0, import_type_guards55.isNotNil)(children) ? children : null,
|
|
12901
|
+
(0, import_type_guards55.isNotNil)(thumbnailUrl) ? /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
|
|
12851
12902
|
ThumbnailImage,
|
|
12852
12903
|
{
|
|
12853
12904
|
thumbnailImageType,
|
|
@@ -12862,9 +12913,9 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
12862
12913
|
Thumbnail.displayName = "Thumbnail";
|
|
12863
12914
|
|
|
12864
12915
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
12865
|
-
var
|
|
12916
|
+
var import_react72 = __toESM(require("react"));
|
|
12866
12917
|
var import_styled_components92 = __toESM(require("styled-components"));
|
|
12867
|
-
var
|
|
12918
|
+
var import_type_guards56 = require("@wistia/type-guards");
|
|
12868
12919
|
var import_jsx_runtime272 = (
|
|
12869
12920
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
12870
12921
|
require("react/jsx-runtime")
|
|
@@ -12942,10 +12993,10 @@ var ThumbnailCollage = ({
|
|
|
12942
12993
|
gradientBackground = "defaultMidOne",
|
|
12943
12994
|
...props
|
|
12944
12995
|
}) => {
|
|
12945
|
-
const thumbnailArray =
|
|
12996
|
+
const thumbnailArray = import_react72.default.Children.toArray(children);
|
|
12946
12997
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
12947
|
-
const thumbnails = (0,
|
|
12948
|
-
return
|
|
12998
|
+
const thumbnails = (0, import_type_guards56.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
12999
|
+
return import_react72.default.cloneElement(child, {
|
|
12949
13000
|
...child.props,
|
|
12950
13001
|
children: void 0
|
|
12951
13002
|
});
|
|
@@ -12972,7 +13023,7 @@ var ThumbnailCollage = ({
|
|
|
12972
13023
|
|
|
12973
13024
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
12974
13025
|
var import_styled_components93 = __toESM(require("styled-components"));
|
|
12975
|
-
var
|
|
13026
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
12976
13027
|
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
12977
13028
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
12978
13029
|
if (iconOnly) {
|
|
@@ -13085,7 +13136,7 @@ var WistiaLogo = ({
|
|
|
13085
13136
|
...props,
|
|
13086
13137
|
children: [
|
|
13087
13138
|
/* @__PURE__ */ (0, import_jsx_runtime273.jsx)("title", { children: title }),
|
|
13088
|
-
(0,
|
|
13139
|
+
(0, import_type_guards57.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime273.jsx)("desc", { children: description }) : null,
|
|
13089
13140
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
13090
13141
|
renderLogotype(logotypeColor, iconOnly)
|
|
13091
13142
|
]
|
|
@@ -13114,7 +13165,6 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
13114
13165
|
CollapsibleContent,
|
|
13115
13166
|
CollapsibleTrigger,
|
|
13116
13167
|
ColorSchemeWrapper,
|
|
13117
|
-
ConditionalButton,
|
|
13118
13168
|
DataCard,
|
|
13119
13169
|
DataCardTrend,
|
|
13120
13170
|
DataCards,
|
|
@@ -13135,6 +13185,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
13135
13185
|
ImageDimensionsValidator,
|
|
13136
13186
|
Input,
|
|
13137
13187
|
InputClickToCopy,
|
|
13188
|
+
KeyboardShortcut,
|
|
13138
13189
|
Label,
|
|
13139
13190
|
Link,
|
|
13140
13191
|
Menu,
|