@wistia/ui 0.9.1-beta.2ff86a71.8ee8a93 → 0.9.1-beta.6bb01d7e.ea7fbf5
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 +208 -260
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +127 -179
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.9.1-beta.
|
|
3
|
+
* @license @wistia/ui v0.9.1-beta.6bb01d7e.ea7fbf5
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7375,8 +7375,6 @@ var StyledActionButton = (0, import_styled_components22.default)(Button)`
|
|
|
7375
7375
|
|
|
7376
7376
|
&:hover,
|
|
7377
7377
|
:focus-visible {
|
|
7378
|
-
--wui-color-text: var(--wui-color-text-button);
|
|
7379
|
-
|
|
7380
7378
|
${({ $hoverColorScheme }) => getColorScheme($hoverColorScheme)};
|
|
7381
7379
|
background: var(--wui-color-bg-surface-tertiary);
|
|
7382
7380
|
}
|
|
@@ -7419,7 +7417,7 @@ var StyledSecondaryIcon = import_styled_components22.default.div`
|
|
|
7419
7417
|
width: 100%;
|
|
7420
7418
|
display: flex;
|
|
7421
7419
|
justify-content: flex-end;
|
|
7422
|
-
transition: all var(--wui-motion-duration-02) var(--wui-motion-ease-
|
|
7420
|
+
transition: all var(--wui-motion-duration-02) var(--wui-motion-ease-in);
|
|
7423
7421
|
|
|
7424
7422
|
${({ $hideUntilHover }) => $hideUntilHover && import_styled_components22.css`
|
|
7425
7423
|
will-change: transform;
|
|
@@ -8589,7 +8587,6 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
8589
8587
|
};
|
|
8590
8588
|
|
|
8591
8589
|
// src/components/DataCards/DataCard.tsx
|
|
8592
|
-
var import_react33 = require("react");
|
|
8593
8590
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
8594
8591
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8595
8592
|
|
|
@@ -8723,6 +8720,7 @@ var Heading = makePolymorphic(HeadingComponent);
|
|
|
8723
8720
|
// src/components/DataCards/DataCard.tsx
|
|
8724
8721
|
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
8725
8722
|
var StyledDataCard = import_styled_components40.default.div`
|
|
8723
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8726
8724
|
display: grid;
|
|
8727
8725
|
grid-template-areas: 'label slot' 'value value';
|
|
8728
8726
|
grid-template-rows: auto auto;
|
|
@@ -8733,49 +8731,6 @@ var StyledDataCard = import_styled_components40.default.div`
|
|
|
8733
8731
|
flex: 1;
|
|
8734
8732
|
border-radius: var(--wui-border-radius-02);
|
|
8735
8733
|
position: relative;
|
|
8736
|
-
transition: background var(--wui-motion-duration-01) var(--wui-motion-ease);
|
|
8737
|
-
|
|
8738
|
-
&[data-click-region] {
|
|
8739
|
-
[data-wui-data-card-hover-icon] {
|
|
8740
|
-
opacity: 0;
|
|
8741
|
-
transform: translateX(-16px);
|
|
8742
|
-
transition: all var(--wui-motion-duration-02) var(--wui-motion-ease-out);
|
|
8743
|
-
}
|
|
8744
|
-
|
|
8745
|
-
&:not([disabled]) {
|
|
8746
|
-
cursor: pointer;
|
|
8747
|
-
|
|
8748
|
-
&:hover,
|
|
8749
|
-
&:has([data-click-region-target-button]:focus-visible),
|
|
8750
|
-
&:has([data-click-region-target-link]:focus-visible) {
|
|
8751
|
-
--wui-color-text: var(--wui-color-text-button);
|
|
8752
|
-
|
|
8753
|
-
background: var(--wui-color-bg-surface-secondary-hover);
|
|
8754
|
-
|
|
8755
|
-
[data-wui-data-card-hover-icon] {
|
|
8756
|
-
opacity: 1;
|
|
8757
|
-
transform: translateX(0);
|
|
8758
|
-
}
|
|
8759
|
-
}
|
|
8760
|
-
|
|
8761
|
-
&:has([data-click-region-target-button]:active),
|
|
8762
|
-
&:has([data-click-region-target-link]:active) {
|
|
8763
|
-
background: var(--wui-color-bg-surface-secondary-active);
|
|
8764
|
-
}
|
|
8765
|
-
|
|
8766
|
-
&:has([data-click-region-target-button]:focus-visible),
|
|
8767
|
-
&:has([data-click-region-target-link]:focus-visible) {
|
|
8768
|
-
outline: 2px solid var(--wui-color-focus-ring);
|
|
8769
|
-
outline-offset: 2px;
|
|
8770
|
-
}
|
|
8771
|
-
}
|
|
8772
|
-
|
|
8773
|
-
&[disabled] {
|
|
8774
|
-
pointer-events: none;
|
|
8775
|
-
}
|
|
8776
|
-
|
|
8777
|
-
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8778
|
-
}
|
|
8779
8734
|
`;
|
|
8780
8735
|
var shimmer = import_styled_components40.keyframes`
|
|
8781
8736
|
0% {
|
|
@@ -8821,7 +8776,7 @@ var StyledDataCardTrendContainer = import_styled_components40.default.div`
|
|
|
8821
8776
|
bottom: var(--wui-space-01);
|
|
8822
8777
|
right: var(--wui-space-01);
|
|
8823
8778
|
`;
|
|
8824
|
-
var
|
|
8779
|
+
var DataCard = ({
|
|
8825
8780
|
label,
|
|
8826
8781
|
value,
|
|
8827
8782
|
upperRightSlot,
|
|
@@ -8856,38 +8811,6 @@ var DataCardInner = ({
|
|
|
8856
8811
|
]
|
|
8857
8812
|
}
|
|
8858
8813
|
);
|
|
8859
|
-
var DataCardArrowIcon = /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
8860
|
-
Icon,
|
|
8861
|
-
{
|
|
8862
|
-
"data-wui-data-card-hover-icon": true,
|
|
8863
|
-
type: "arrow-right"
|
|
8864
|
-
}
|
|
8865
|
-
);
|
|
8866
|
-
var DataCard = (props) => {
|
|
8867
|
-
const ref = (0, import_react33.useRef)(null);
|
|
8868
|
-
if ((0, import_type_guards29.isNotNil)(props.href) || (0, import_type_guards29.isNotNil)(props.onClick)) {
|
|
8869
|
-
return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
8870
|
-
DataCardInner,
|
|
8871
|
-
{
|
|
8872
|
-
upperRightSlot: props.upperRightSlot ?? DataCardArrowIcon,
|
|
8873
|
-
...props,
|
|
8874
|
-
label: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
8875
|
-
Button,
|
|
8876
|
-
{
|
|
8877
|
-
ref,
|
|
8878
|
-
...(0, import_type_guards29.isNotNil)(props.beforeAction) ? { beforeAction: props.beforeAction } : {},
|
|
8879
|
-
disabled: props.disabled ?? false,
|
|
8880
|
-
href: props.href,
|
|
8881
|
-
onClick: props.onClick,
|
|
8882
|
-
unstyled: true,
|
|
8883
|
-
children: props.label
|
|
8884
|
-
}
|
|
8885
|
-
)
|
|
8886
|
-
}
|
|
8887
|
-
) });
|
|
8888
|
-
}
|
|
8889
|
-
return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(DataCardInner, { ...props });
|
|
8890
|
-
};
|
|
8891
8814
|
DataCard.displayName = "DataCard";
|
|
8892
8815
|
|
|
8893
8816
|
// src/components/DataCards/DataCards.tsx
|
|
@@ -8928,7 +8851,7 @@ DataCards.displayName = "DataCards";
|
|
|
8928
8851
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8929
8852
|
|
|
8930
8853
|
// src/components/Text/Text.tsx
|
|
8931
|
-
var
|
|
8854
|
+
var import_react33 = require("react");
|
|
8932
8855
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
8933
8856
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8934
8857
|
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
@@ -9103,7 +9026,7 @@ var StyledText = import_styled_components42.default.div`
|
|
|
9103
9026
|
}
|
|
9104
9027
|
`}
|
|
9105
9028
|
`;
|
|
9106
|
-
var TextComponent = (0,
|
|
9029
|
+
var TextComponent = (0, import_react33.forwardRef)(
|
|
9107
9030
|
({
|
|
9108
9031
|
align = "left",
|
|
9109
9032
|
colorScheme = "inherit",
|
|
@@ -9216,7 +9139,7 @@ Divider.displayName = "Divider";
|
|
|
9216
9139
|
|
|
9217
9140
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9218
9141
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
9219
|
-
var
|
|
9142
|
+
var import_react35 = require("react");
|
|
9220
9143
|
|
|
9221
9144
|
// src/components/Tooltip/Tooltip.tsx
|
|
9222
9145
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
@@ -9368,7 +9291,7 @@ var Tooltip = ({
|
|
|
9368
9291
|
Tooltip.displayName = "Tooltip";
|
|
9369
9292
|
|
|
9370
9293
|
// src/components/Input/Input.tsx
|
|
9371
|
-
var
|
|
9294
|
+
var import_react34 = require("react");
|
|
9372
9295
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9373
9296
|
var import_type_guards31 = require("@wistia/type-guards");
|
|
9374
9297
|
|
|
@@ -9503,7 +9426,7 @@ var StyledInputContainer = import_styled_components47.default.div`
|
|
|
9503
9426
|
padding-right: 32px;
|
|
9504
9427
|
}
|
|
9505
9428
|
`;
|
|
9506
|
-
var Input = (0,
|
|
9429
|
+
var Input = (0, import_react34.forwardRef)(
|
|
9507
9430
|
({
|
|
9508
9431
|
fullWidth = true,
|
|
9509
9432
|
monospace = false,
|
|
@@ -9513,7 +9436,7 @@ var Input = (0, import_react35.forwardRef)(
|
|
|
9513
9436
|
rightIcon,
|
|
9514
9437
|
...props
|
|
9515
9438
|
}, externalRef) => {
|
|
9516
|
-
const internalRef = (0,
|
|
9439
|
+
const internalRef = (0, import_react34.useRef)();
|
|
9517
9440
|
const ref = (
|
|
9518
9441
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9519
9442
|
(0, import_type_guards31.isNotNil)(externalRef) && (0, import_type_guards31.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
@@ -9523,14 +9446,14 @@ var Input = (0, import_react35.forwardRef)(
|
|
|
9523
9446
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Icon, { type: "search" });
|
|
9524
9447
|
}
|
|
9525
9448
|
if ((0, import_type_guards31.isNotNil)(leftIconToDisplay)) {
|
|
9526
|
-
leftIconToDisplay = (0,
|
|
9449
|
+
leftIconToDisplay = (0, import_react34.cloneElement)(leftIconToDisplay, {
|
|
9527
9450
|
size: "md",
|
|
9528
9451
|
className: "wui-input-left-icon"
|
|
9529
9452
|
});
|
|
9530
9453
|
}
|
|
9531
9454
|
let rightIconToDisplay = rightIcon;
|
|
9532
9455
|
if ((0, import_type_guards31.isNotNil)(rightIconToDisplay)) {
|
|
9533
|
-
rightIconToDisplay = (0,
|
|
9456
|
+
rightIconToDisplay = (0, import_react34.cloneElement)(rightIconToDisplay, {
|
|
9534
9457
|
size: "md",
|
|
9535
9458
|
className: "wui-input-right-icon"
|
|
9536
9459
|
});
|
|
@@ -9622,11 +9545,11 @@ var EditableHeading = ({
|
|
|
9622
9545
|
__forceEditing = false,
|
|
9623
9546
|
editingDisabled = false
|
|
9624
9547
|
}) => {
|
|
9625
|
-
const [isEditing, setIsEditing] = (0,
|
|
9626
|
-
const [value, setValue] = (0,
|
|
9627
|
-
const [previousValue, setPreviousValue] = (0,
|
|
9628
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
9629
|
-
const headingRef = (0,
|
|
9548
|
+
const [isEditing, setIsEditing] = (0, import_react35.useState)(false);
|
|
9549
|
+
const [value, setValue] = (0, import_react35.useState)(children);
|
|
9550
|
+
const [previousValue, setPreviousValue] = (0, import_react35.useState)(children);
|
|
9551
|
+
const [headingHeight, setHeadingHeight] = (0, import_react35.useState)("60");
|
|
9552
|
+
const headingRef = (0, import_react35.useRef)(null);
|
|
9630
9553
|
const handleSetEditing = (editing) => {
|
|
9631
9554
|
if (editingDisabled) return;
|
|
9632
9555
|
if (editing && headingRef.current) {
|
|
@@ -9705,12 +9628,12 @@ var EditableHeading = ({
|
|
|
9705
9628
|
};
|
|
9706
9629
|
|
|
9707
9630
|
// src/components/Form/Form.tsx
|
|
9708
|
-
var
|
|
9631
|
+
var import_react37 = require("react");
|
|
9709
9632
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9710
9633
|
var import_type_guards32 = require("@wistia/type-guards");
|
|
9711
9634
|
|
|
9712
9635
|
// src/components/Stack/Stack.tsx
|
|
9713
|
-
var
|
|
9636
|
+
var import_react36 = require("react");
|
|
9714
9637
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9715
9638
|
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9716
9639
|
var DEFAULT_ELEMENT4 = "div";
|
|
@@ -9720,7 +9643,7 @@ var StyledStack = import_styled_components49.default.div`
|
|
|
9720
9643
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9721
9644
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
9722
9645
|
`;
|
|
9723
|
-
var StackComponent = (0,
|
|
9646
|
+
var StackComponent = (0, import_react36.forwardRef)(
|
|
9724
9647
|
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9725
9648
|
const responsiveGap = useResponsiveProp(gap);
|
|
9726
9649
|
const responsiveDirection = useResponsiveProp(direction);
|
|
@@ -9749,7 +9672,7 @@ var StyledForm = import_styled_components50.default.form`
|
|
|
9749
9672
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9750
9673
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9751
9674
|
`;
|
|
9752
|
-
var FormContext = (0,
|
|
9675
|
+
var FormContext = (0, import_react37.createContext)({
|
|
9753
9676
|
values: {},
|
|
9754
9677
|
errors: {},
|
|
9755
9678
|
hasSubmitted: false,
|
|
@@ -9765,11 +9688,11 @@ var FormComponent = ({
|
|
|
9765
9688
|
fullWidth = false,
|
|
9766
9689
|
...props
|
|
9767
9690
|
}, forwardedRef) => {
|
|
9768
|
-
const [errors, setErrors] = (0,
|
|
9769
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9770
|
-
const innerRef = (0,
|
|
9691
|
+
const [errors, setErrors] = (0, import_react37.useState)({});
|
|
9692
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react37.useState)(false);
|
|
9693
|
+
const innerRef = (0, import_react37.useRef)();
|
|
9771
9694
|
const ref = forwardedRef ?? innerRef;
|
|
9772
|
-
const autoId = (0,
|
|
9695
|
+
const autoId = (0, import_react37.useId)();
|
|
9773
9696
|
const id = props.id ?? autoId;
|
|
9774
9697
|
const handleValidate = (nextFormData) => {
|
|
9775
9698
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
@@ -9811,7 +9734,7 @@ var FormComponent = ({
|
|
|
9811
9734
|
void action(null);
|
|
9812
9735
|
}
|
|
9813
9736
|
};
|
|
9814
|
-
const context = (0,
|
|
9737
|
+
const context = (0, import_react37.useMemo)(() => {
|
|
9815
9738
|
return {
|
|
9816
9739
|
values,
|
|
9817
9740
|
errors,
|
|
@@ -9840,15 +9763,15 @@ var FormComponent = ({
|
|
|
9840
9763
|
);
|
|
9841
9764
|
};
|
|
9842
9765
|
FormComponent.displayName = "Form";
|
|
9843
|
-
var Form = (0,
|
|
9766
|
+
var Form = (0, import_react37.forwardRef)(FormComponent);
|
|
9844
9767
|
|
|
9845
9768
|
// src/components/Form/useFormState.tsx
|
|
9846
|
-
var
|
|
9769
|
+
var import_react38 = require("react");
|
|
9847
9770
|
var useFormState = (action, initialData = {}) => {
|
|
9848
|
-
const [data, setData] = (0,
|
|
9849
|
-
const [isPending, setIsPending] = (0,
|
|
9850
|
-
const [error, setError] = (0,
|
|
9851
|
-
const formAction = (0,
|
|
9771
|
+
const [data, setData] = (0, import_react38.useState)(initialData);
|
|
9772
|
+
const [isPending, setIsPending] = (0, import_react38.useState)(false);
|
|
9773
|
+
const [error, setError] = (0, import_react38.useState)(null);
|
|
9774
|
+
const formAction = (0, import_react38.useCallback)(
|
|
9852
9775
|
async (nextFormData) => {
|
|
9853
9776
|
if (nextFormData === null) {
|
|
9854
9777
|
setData(initialData);
|
|
@@ -9879,15 +9802,15 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9879
9802
|
};
|
|
9880
9803
|
|
|
9881
9804
|
// src/components/Form/FormErrorSummary.tsx
|
|
9882
|
-
var
|
|
9805
|
+
var import_react39 = require("react");
|
|
9883
9806
|
var import_type_guards33 = require("@wistia/type-guards");
|
|
9884
9807
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9885
9808
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9886
9809
|
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9887
9810
|
};
|
|
9888
9811
|
var FormErrorSummary = ({ description }) => {
|
|
9889
|
-
const ref = (0,
|
|
9890
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9812
|
+
const ref = (0, import_react39.useRef)(null);
|
|
9813
|
+
const { formId, errors, hasSubmitted } = (0, import_react39.useContext)(FormContext);
|
|
9891
9814
|
const isValid = Object.keys(errors).length === 0;
|
|
9892
9815
|
if (isValid || !hasSubmitted) {
|
|
9893
9816
|
return null;
|
|
@@ -9917,7 +9840,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9917
9840
|
};
|
|
9918
9841
|
|
|
9919
9842
|
// src/components/FormField/FormField.tsx
|
|
9920
|
-
var
|
|
9843
|
+
var import_react42 = require("react");
|
|
9921
9844
|
var import_styled_components53 = __toESM(require("styled-components"));
|
|
9922
9845
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
9923
9846
|
|
|
@@ -9982,11 +9905,11 @@ var Label = ({
|
|
|
9982
9905
|
Label.displayName = "Label";
|
|
9983
9906
|
|
|
9984
9907
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9985
|
-
var
|
|
9908
|
+
var import_react41 = require("react");
|
|
9986
9909
|
|
|
9987
9910
|
// src/components/FormGroup/FormGroup.tsx
|
|
9988
9911
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9989
|
-
var
|
|
9912
|
+
var import_react40 = require("react");
|
|
9990
9913
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9991
9914
|
var StyledFieldset = import_styled_components52.default.fieldset`
|
|
9992
9915
|
border: 0;
|
|
@@ -9995,7 +9918,7 @@ var StyledLegend = import_styled_components52.default.legend`
|
|
|
9995
9918
|
margin-bottom: var(--space-01);
|
|
9996
9919
|
`;
|
|
9997
9920
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9998
|
-
const ref = (0,
|
|
9921
|
+
const ref = (0, import_react40.useRef)();
|
|
9999
9922
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
10000
9923
|
Stack,
|
|
10001
9924
|
{
|
|
@@ -10020,7 +9943,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
10020
9943
|
|
|
10021
9944
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
10022
9945
|
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
10023
|
-
var CheckboxGroupContext = (0,
|
|
9946
|
+
var CheckboxGroupContext = (0, import_react41.createContext)(null);
|
|
10024
9947
|
var CheckboxGroup = ({
|
|
10025
9948
|
children,
|
|
10026
9949
|
name,
|
|
@@ -10028,7 +9951,7 @@ var CheckboxGroup = ({
|
|
|
10028
9951
|
value,
|
|
10029
9952
|
...props
|
|
10030
9953
|
}) => {
|
|
10031
|
-
const context = (0,
|
|
9954
|
+
const context = (0, import_react41.useMemo)(() => {
|
|
10032
9955
|
return {
|
|
10033
9956
|
name,
|
|
10034
9957
|
onChange
|
|
@@ -10113,8 +10036,8 @@ var FormField = ({
|
|
|
10113
10036
|
value,
|
|
10114
10037
|
...props
|
|
10115
10038
|
}) => {
|
|
10116
|
-
const formState = (0,
|
|
10117
|
-
const checkboxGroup = (0,
|
|
10039
|
+
const formState = (0, import_react42.useContext)(FormContext);
|
|
10040
|
+
const checkboxGroup = (0, import_react42.useContext)(CheckboxGroupContext);
|
|
10118
10041
|
const defaultValue = formState.values[name];
|
|
10119
10042
|
const isIntegratedLabel = children.type === Checkbox;
|
|
10120
10043
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -10152,7 +10075,7 @@ var FormField = ({
|
|
|
10152
10075
|
"aria-invalid": (0, import_type_guards34.isNotNil)(error)
|
|
10153
10076
|
};
|
|
10154
10077
|
}
|
|
10155
|
-
|
|
10078
|
+
import_react42.Children.only(children);
|
|
10156
10079
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(
|
|
10157
10080
|
StyledFormField,
|
|
10158
10081
|
{
|
|
@@ -10161,7 +10084,7 @@ var FormField = ({
|
|
|
10161
10084
|
children: [
|
|
10162
10085
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
10163
10086
|
(0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
10164
|
-
(0,
|
|
10087
|
+
(0, import_react42.cloneElement)(children, childProps),
|
|
10165
10088
|
(0, import_type_guards34.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [
|
|
10166
10089
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", {}),
|
|
10167
10090
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
@@ -10179,9 +10102,9 @@ var FormField = ({
|
|
|
10179
10102
|
FormField.displayName = "FormField";
|
|
10180
10103
|
|
|
10181
10104
|
// src/components/FormGroup/RadioGroup.tsx
|
|
10182
|
-
var
|
|
10105
|
+
var import_react43 = require("react");
|
|
10183
10106
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
10184
|
-
var RadioGroupContext = (0,
|
|
10107
|
+
var RadioGroupContext = (0, import_react43.createContext)(null);
|
|
10185
10108
|
var RadioGroup = ({
|
|
10186
10109
|
children,
|
|
10187
10110
|
name,
|
|
@@ -10189,7 +10112,7 @@ var RadioGroup = ({
|
|
|
10189
10112
|
value,
|
|
10190
10113
|
...props
|
|
10191
10114
|
}) => {
|
|
10192
|
-
const context = (0,
|
|
10115
|
+
const context = (0, import_react43.useMemo)(() => {
|
|
10193
10116
|
return {
|
|
10194
10117
|
name,
|
|
10195
10118
|
onChange
|
|
@@ -10200,7 +10123,7 @@ var RadioGroup = ({
|
|
|
10200
10123
|
RadioGroup.displayName = "RadioGroup";
|
|
10201
10124
|
|
|
10202
10125
|
// src/components/IconButton/IconButton.tsx
|
|
10203
|
-
var
|
|
10126
|
+
var import_react44 = require("react");
|
|
10204
10127
|
var import_styled_components54 = __toESM(require("styled-components"));
|
|
10205
10128
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
10206
10129
|
var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
@@ -10217,7 +10140,7 @@ var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
|
10217
10140
|
align-items: center;
|
|
10218
10141
|
line-height: 1;
|
|
10219
10142
|
`;
|
|
10220
|
-
var IconButton = (0,
|
|
10143
|
+
var IconButton = (0, import_react44.forwardRef)(
|
|
10221
10144
|
({ children, label, size = "md", ...props }, ref) => {
|
|
10222
10145
|
const responsiveSize = useResponsiveProp(size);
|
|
10223
10146
|
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
@@ -10228,7 +10151,7 @@ var IconButton = (0, import_react45.forwardRef)(
|
|
|
10228
10151
|
"aria-label": label,
|
|
10229
10152
|
"data-wistia-ui-icon-button": true,
|
|
10230
10153
|
size: responsiveSize,
|
|
10231
|
-
children: (0,
|
|
10154
|
+
children: (0, import_react44.cloneElement)(import_react44.Children.only(children), {
|
|
10232
10155
|
size: responsiveSize
|
|
10233
10156
|
})
|
|
10234
10157
|
}
|
|
@@ -10239,7 +10162,7 @@ IconButton.displayName = "IconButton";
|
|
|
10239
10162
|
|
|
10240
10163
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
10241
10164
|
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10242
|
-
var
|
|
10165
|
+
var import_react45 = require("react");
|
|
10243
10166
|
var import_type_guards35 = require("@wistia/type-guards");
|
|
10244
10167
|
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
10245
10168
|
var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
@@ -10252,10 +10175,10 @@ var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
|
10252
10175
|
}
|
|
10253
10176
|
`;
|
|
10254
10177
|
var COPY_SUCCESS_DURATION = 2e3;
|
|
10255
|
-
var InputClickToCopy = (0,
|
|
10178
|
+
var InputClickToCopy = (0, import_react45.forwardRef)(
|
|
10256
10179
|
({ value, onCopy, ...props }, ref) => {
|
|
10257
|
-
const [isCopied, setIsCopied] = (0,
|
|
10258
|
-
(0,
|
|
10180
|
+
const [isCopied, setIsCopied] = (0, import_react45.useState)(false);
|
|
10181
|
+
(0, import_react45.useEffect)(() => {
|
|
10259
10182
|
if (isCopied) {
|
|
10260
10183
|
const timeout = setTimeout(() => {
|
|
10261
10184
|
setIsCopied(false);
|
|
@@ -10414,12 +10337,12 @@ KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
|
10414
10337
|
var import_styled_components57 = __toESM(require("styled-components"));
|
|
10415
10338
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
10416
10339
|
var import_type_guards37 = require("@wistia/type-guards");
|
|
10417
|
-
var
|
|
10340
|
+
var import_react47 = require("react");
|
|
10418
10341
|
|
|
10419
10342
|
// src/components/Menu/MenuContext.tsx
|
|
10420
|
-
var
|
|
10421
|
-
var MenuContext = (0,
|
|
10422
|
-
var useMenuContext = () => (0,
|
|
10343
|
+
var import_react46 = require("react");
|
|
10344
|
+
var MenuContext = (0, import_react46.createContext)({ compact: false });
|
|
10345
|
+
var useMenuContext = () => (0, import_react46.useContext)(MenuContext);
|
|
10423
10346
|
|
|
10424
10347
|
// src/components/Menu/Menu.tsx
|
|
10425
10348
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
@@ -10523,7 +10446,7 @@ var Menu = ({
|
|
|
10523
10446
|
onInteractOutside,
|
|
10524
10447
|
...props
|
|
10525
10448
|
}) => {
|
|
10526
|
-
const contextValue = (0,
|
|
10449
|
+
const contextValue = (0, import_react47.useMemo)(() => ({ compact }), [compact]);
|
|
10527
10450
|
let controlProps = {
|
|
10528
10451
|
...(0, import_type_guards37.isNotNil)(onOpenChange) && (0, import_type_guards37.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
10529
10452
|
};
|
|
@@ -10598,13 +10521,13 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
10598
10521
|
MenuLabel.displayName = "MenuLabel";
|
|
10599
10522
|
|
|
10600
10523
|
// src/components/Menu/SubMenu.tsx
|
|
10601
|
-
var
|
|
10524
|
+
var import_react49 = require("react");
|
|
10602
10525
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
10603
10526
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
10604
10527
|
var import_type_guards39 = require("@wistia/type-guards");
|
|
10605
10528
|
|
|
10606
10529
|
// src/components/Menu/MenuItemButton.tsx
|
|
10607
|
-
var
|
|
10530
|
+
var import_react48 = require("react");
|
|
10608
10531
|
var import_styled_components59 = __toESM(require("styled-components"));
|
|
10609
10532
|
var import_type_guards38 = require("@wistia/type-guards");
|
|
10610
10533
|
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
@@ -10681,7 +10604,7 @@ var StyledBadgeContainer = import_styled_components59.default.div`
|
|
|
10681
10604
|
font-size: var(--wui-typography-label-4-size);
|
|
10682
10605
|
color: var(--wui-color-text-secondary);
|
|
10683
10606
|
`;
|
|
10684
|
-
var MenuItemButton = (0,
|
|
10607
|
+
var MenuItemButton = (0, import_react48.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
10685
10608
|
let { colorScheme, badge } = props;
|
|
10686
10609
|
if (appearance === "dangerous") {
|
|
10687
10610
|
if ((0, import_type_guards38.isNotUndefined)(colorScheme)) {
|
|
@@ -10781,7 +10704,7 @@ var SubMenu = ({
|
|
|
10781
10704
|
...props
|
|
10782
10705
|
}) => {
|
|
10783
10706
|
const { isSmAndUp } = useMq();
|
|
10784
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
10707
|
+
const [isExpanded, setIsExpanded] = (0, import_react49.useState)(false);
|
|
10785
10708
|
const { compact } = useMenuContext();
|
|
10786
10709
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10787
10710
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
@@ -10810,10 +10733,10 @@ var SubMenu = ({
|
|
|
10810
10733
|
SubMenu.displayName = "SubMenu";
|
|
10811
10734
|
|
|
10812
10735
|
// src/components/Menu/MenuItem.tsx
|
|
10813
|
-
var
|
|
10736
|
+
var import_react50 = require("react");
|
|
10814
10737
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
10815
10738
|
var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
10816
|
-
var MenuItem = (0,
|
|
10739
|
+
var MenuItem = (0, import_react50.forwardRef)(
|
|
10817
10740
|
({ onSelect = () => null, ...props }, ref) => {
|
|
10818
10741
|
return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
|
|
10819
10742
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -10962,7 +10885,7 @@ var CheckboxMenuItem = ({
|
|
|
10962
10885
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
10963
10886
|
|
|
10964
10887
|
// src/components/Modal/Modal.tsx
|
|
10965
|
-
var
|
|
10888
|
+
var import_react54 = require("react");
|
|
10966
10889
|
var import_styled_components66 = __toESM(require("styled-components"));
|
|
10967
10890
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10968
10891
|
var import_type_guards42 = require("@wistia/type-guards");
|
|
@@ -11022,19 +10945,19 @@ var ModalHeader = ({
|
|
|
11022
10945
|
};
|
|
11023
10946
|
|
|
11024
10947
|
// src/components/Modal/ModalContent.tsx
|
|
11025
|
-
var
|
|
10948
|
+
var import_react52 = require("react");
|
|
11026
10949
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
11027
10950
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
11028
10951
|
|
|
11029
10952
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
11030
|
-
var
|
|
10953
|
+
var import_react51 = require("react");
|
|
11031
10954
|
var import_type_guards41 = require("@wistia/type-guards");
|
|
11032
10955
|
var useFocusRestore = () => {
|
|
11033
|
-
const previouslyFocusedRef = (0,
|
|
11034
|
-
(0,
|
|
10956
|
+
const previouslyFocusedRef = (0, import_react51.useRef)(null);
|
|
10957
|
+
(0, import_react51.useEffect)(() => {
|
|
11035
10958
|
previouslyFocusedRef.current = document.activeElement;
|
|
11036
10959
|
}, []);
|
|
11037
|
-
(0,
|
|
10960
|
+
(0, import_react51.useEffect)(() => {
|
|
11038
10961
|
return () => {
|
|
11039
10962
|
if ((0, import_type_guards41.isNotNil)(previouslyFocusedRef.current)) {
|
|
11040
10963
|
setTimeout(() => {
|
|
@@ -11125,7 +11048,7 @@ var StyledModalContent = (0, import_styled_components64.default)(import_react_di
|
|
|
11125
11048
|
}
|
|
11126
11049
|
}
|
|
11127
11050
|
`;
|
|
11128
|
-
var ModalContent = (0,
|
|
11051
|
+
var ModalContent = (0, import_react52.forwardRef)(
|
|
11129
11052
|
({ fullHeight, width, alignHorizontal, alignVertical, children, ...props }, ref) => {
|
|
11130
11053
|
useFocusRestore();
|
|
11131
11054
|
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
@@ -11145,7 +11068,7 @@ var ModalContent = (0, import_react53.forwardRef)(
|
|
|
11145
11068
|
);
|
|
11146
11069
|
|
|
11147
11070
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
11148
|
-
var
|
|
11071
|
+
var import_react53 = require("react");
|
|
11149
11072
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
11150
11073
|
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
11151
11074
|
var alignVerticalMap = {
|
|
@@ -11185,7 +11108,7 @@ var BackdropComponent = import_styled_components65.default.div`
|
|
|
11185
11108
|
}
|
|
11186
11109
|
}
|
|
11187
11110
|
`;
|
|
11188
|
-
var Backdrop = (0,
|
|
11111
|
+
var Backdrop = (0, import_react53.forwardRef)(
|
|
11189
11112
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11190
11113
|
BackdropComponent,
|
|
11191
11114
|
{
|
|
@@ -11208,7 +11131,7 @@ var ModalBody = import_styled_components66.default.div`
|
|
|
11208
11131
|
flex: 1 0 0;
|
|
11209
11132
|
order: 2;
|
|
11210
11133
|
`;
|
|
11211
|
-
var Modal = (0,
|
|
11134
|
+
var Modal = (0, import_react54.forwardRef)(
|
|
11212
11135
|
({
|
|
11213
11136
|
children,
|
|
11214
11137
|
fullHeight = false,
|
|
@@ -11510,7 +11433,7 @@ var ProgressBar = ({
|
|
|
11510
11433
|
ProgressBar.displayName = "ProgressBar";
|
|
11511
11434
|
|
|
11512
11435
|
// src/components/Radio/Radio.tsx
|
|
11513
|
-
var
|
|
11436
|
+
var import_react55 = require("react");
|
|
11514
11437
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11515
11438
|
var import_type_guards45 = require("@wistia/type-guards");
|
|
11516
11439
|
var import_jsx_runtime249 = require("react/jsx-runtime");
|
|
@@ -11613,7 +11536,7 @@ var StyledHiddenRadioInput = import_styled_components70.default.input`
|
|
|
11613
11536
|
display: block;
|
|
11614
11537
|
}
|
|
11615
11538
|
`;
|
|
11616
|
-
var Radio = (0,
|
|
11539
|
+
var Radio = (0, import_react55.forwardRef)(
|
|
11617
11540
|
({
|
|
11618
11541
|
checked,
|
|
11619
11542
|
disabled = false,
|
|
@@ -11628,7 +11551,7 @@ var Radio = (0, import_react56.forwardRef)(
|
|
|
11628
11551
|
hideLabel = false,
|
|
11629
11552
|
...props
|
|
11630
11553
|
}, ref) => {
|
|
11631
|
-
const generatedId = (0,
|
|
11554
|
+
const generatedId = (0, import_react55.useId)();
|
|
11632
11555
|
const computedId = (0, import_type_guards45.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11633
11556
|
return /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
11634
11557
|
StyledRadioWrapper,
|
|
@@ -11678,20 +11601,20 @@ var Radio = (0, import_react56.forwardRef)(
|
|
|
11678
11601
|
Radio.displayName = "Radio";
|
|
11679
11602
|
|
|
11680
11603
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
11681
|
-
var
|
|
11604
|
+
var import_react58 = require("react");
|
|
11682
11605
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11683
11606
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
11684
11607
|
var import_type_guards46 = require("@wistia/type-guards");
|
|
11685
11608
|
|
|
11686
11609
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11687
|
-
var
|
|
11610
|
+
var import_react56 = require("react");
|
|
11688
11611
|
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
11689
|
-
var SelectedItemStyleContext = (0,
|
|
11612
|
+
var SelectedItemStyleContext = (0, import_react56.createContext)(null);
|
|
11690
11613
|
var SelectedItemStyleProvider = ({
|
|
11691
11614
|
children
|
|
11692
11615
|
}) => {
|
|
11693
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
11694
|
-
const selectedItemIndicatorStyle = (0,
|
|
11616
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react56.useState)(null);
|
|
11617
|
+
const selectedItemIndicatorStyle = (0, import_react56.useMemo)(
|
|
11695
11618
|
() => selectedItemMeasurements != null ? {
|
|
11696
11619
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11697
11620
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
@@ -11701,7 +11624,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11701
11624
|
},
|
|
11702
11625
|
[selectedItemMeasurements]
|
|
11703
11626
|
);
|
|
11704
|
-
const contextValue = (0,
|
|
11627
|
+
const contextValue = (0, import_react56.useMemo)(
|
|
11705
11628
|
() => ({
|
|
11706
11629
|
setSelectedItemMeasurements,
|
|
11707
11630
|
selectedItemIndicatorStyle
|
|
@@ -11711,7 +11634,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11711
11634
|
return /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11712
11635
|
};
|
|
11713
11636
|
var useSelectedItemStyle = () => {
|
|
11714
|
-
const context = (0,
|
|
11637
|
+
const context = (0, import_react56.useContext)(SelectedItemStyleContext);
|
|
11715
11638
|
if (context === null) {
|
|
11716
11639
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11717
11640
|
}
|
|
@@ -11722,11 +11645,11 @@ var useSelectedItemStyle = () => {
|
|
|
11722
11645
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11723
11646
|
|
|
11724
11647
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11725
|
-
var
|
|
11726
|
-
var SegmentedControlValueContext = (0,
|
|
11648
|
+
var import_react57 = require("react");
|
|
11649
|
+
var SegmentedControlValueContext = (0, import_react57.createContext)(null);
|
|
11727
11650
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11728
11651
|
var useSegmentedControlValue = () => {
|
|
11729
|
-
const context = (0,
|
|
11652
|
+
const context = (0, import_react57.useContext)(SegmentedControlValueContext);
|
|
11730
11653
|
if (context === null) {
|
|
11731
11654
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11732
11655
|
}
|
|
@@ -11772,7 +11695,7 @@ var segmentedControlStyles = import_styled_components72.css`
|
|
|
11772
11695
|
var StyledSegmentedControl = (0, import_styled_components72.default)(import_react_toggle_group.Root)`
|
|
11773
11696
|
${segmentedControlStyles}
|
|
11774
11697
|
`;
|
|
11775
|
-
var SegmentedControl = (0,
|
|
11698
|
+
var SegmentedControl = (0, import_react58.forwardRef)(
|
|
11776
11699
|
({
|
|
11777
11700
|
children,
|
|
11778
11701
|
disabled = false,
|
|
@@ -11807,7 +11730,7 @@ var SegmentedControl = (0, import_react59.forwardRef)(
|
|
|
11807
11730
|
SegmentedControl.displayName = "SegmentedControl";
|
|
11808
11731
|
|
|
11809
11732
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
11810
|
-
var
|
|
11733
|
+
var import_react59 = require("react");
|
|
11811
11734
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11812
11735
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
11813
11736
|
var import_type_guards47 = require("@wistia/type-guards");
|
|
@@ -11875,11 +11798,11 @@ var segmentedControlItemStyles = import_styled_components73.css`
|
|
|
11875
11798
|
var StyledSegmentedControlItem = (0, import_styled_components73.default)(import_react_toggle_group2.Item)`
|
|
11876
11799
|
${segmentedControlItemStyles}
|
|
11877
11800
|
`;
|
|
11878
|
-
var SegmentedControlItem = (0,
|
|
11801
|
+
var SegmentedControlItem = (0, import_react59.forwardRef)(
|
|
11879
11802
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11880
11803
|
const selectedValue = useSegmentedControlValue();
|
|
11881
11804
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
11882
|
-
const buttonRef = (0,
|
|
11805
|
+
const buttonRef = (0, import_react59.useRef)(null);
|
|
11883
11806
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11884
11807
|
const handleClick = (event) => {
|
|
11885
11808
|
const target = event.target;
|
|
@@ -11888,7 +11811,7 @@ var SegmentedControlItem = (0, import_react60.forwardRef)(
|
|
|
11888
11811
|
event.preventDefault();
|
|
11889
11812
|
}
|
|
11890
11813
|
};
|
|
11891
|
-
(0,
|
|
11814
|
+
(0, import_react59.useEffect)(() => {
|
|
11892
11815
|
const buttonElem = buttonRef.current;
|
|
11893
11816
|
if (!buttonElem) {
|
|
11894
11817
|
return void 0;
|
|
@@ -11934,7 +11857,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11934
11857
|
|
|
11935
11858
|
// src/components/Select/Select.tsx
|
|
11936
11859
|
var import_react_select = require("@radix-ui/react-select");
|
|
11937
|
-
var
|
|
11860
|
+
var import_react60 = require("react");
|
|
11938
11861
|
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11939
11862
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
11940
11863
|
var StyledTrigger = (0, import_styled_components74.default)(import_react_select.Trigger)`
|
|
@@ -11999,7 +11922,7 @@ var StyledContent3 = (0, import_styled_components74.default)(import_react_select
|
|
|
11999
11922
|
max-height: var(--radix-select-content-available-height);
|
|
12000
11923
|
z-index: var(--wui-zindex-select);
|
|
12001
11924
|
`;
|
|
12002
|
-
var Select = (0,
|
|
11925
|
+
var Select = (0, import_react60.forwardRef)(
|
|
12003
11926
|
({
|
|
12004
11927
|
colorScheme = "inherit",
|
|
12005
11928
|
children,
|
|
@@ -12048,7 +11971,7 @@ Select.displayName = "Select";
|
|
|
12048
11971
|
|
|
12049
11972
|
// src/components/Select/SelectOption.tsx
|
|
12050
11973
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
12051
|
-
var
|
|
11974
|
+
var import_react61 = require("react");
|
|
12052
11975
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
12053
11976
|
var import_type_guards48 = require("@wistia/type-guards");
|
|
12054
11977
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
@@ -12079,7 +12002,7 @@ var StyledItem = (0, import_styled_components75.default)(import_react_select2.It
|
|
|
12079
12002
|
var StyledIconContainer = import_styled_components75.default.span`
|
|
12080
12003
|
width: 12px;
|
|
12081
12004
|
`;
|
|
12082
|
-
var SelectOption = (0,
|
|
12005
|
+
var SelectOption = (0, import_react61.forwardRef)(
|
|
12083
12006
|
({ children, selectedDisplayValue, ...props }, forwardedRef) => {
|
|
12084
12007
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(
|
|
12085
12008
|
StyledItem,
|
|
@@ -12127,7 +12050,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
12127
12050
|
};
|
|
12128
12051
|
|
|
12129
12052
|
// src/components/Switch/Switch.tsx
|
|
12130
|
-
var
|
|
12053
|
+
var import_react62 = require("react");
|
|
12131
12054
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
12132
12055
|
var import_type_guards49 = require("@wistia/type-guards");
|
|
12133
12056
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
@@ -12232,7 +12155,7 @@ var StyledHiddenSwitchInput = import_styled_components77.default.input`
|
|
|
12232
12155
|
}
|
|
12233
12156
|
}
|
|
12234
12157
|
`;
|
|
12235
|
-
var Switch = (0,
|
|
12158
|
+
var Switch = (0, import_react62.forwardRef)(
|
|
12236
12159
|
({
|
|
12237
12160
|
checked,
|
|
12238
12161
|
disabled = false,
|
|
@@ -12247,7 +12170,7 @@ var Switch = (0, import_react63.forwardRef)(
|
|
|
12247
12170
|
hideLabel = false,
|
|
12248
12171
|
...props
|
|
12249
12172
|
}, ref) => {
|
|
12250
|
-
const generatedId = (0,
|
|
12173
|
+
const generatedId = (0, import_react62.useId)();
|
|
12251
12174
|
const computedId = (0, import_type_guards49.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
12252
12175
|
return /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
12253
12176
|
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
@@ -12337,8 +12260,8 @@ var Table = ({
|
|
|
12337
12260
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12338
12261
|
|
|
12339
12262
|
// src/components/Table/TableSectionContext.ts
|
|
12340
|
-
var
|
|
12341
|
-
var TableSectionContext = (0,
|
|
12263
|
+
var import_react63 = require("react");
|
|
12264
|
+
var TableSectionContext = (0, import_react63.createContext)(null);
|
|
12342
12265
|
|
|
12343
12266
|
// src/components/Table/TableBody.tsx
|
|
12344
12267
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
@@ -12348,7 +12271,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
12348
12271
|
};
|
|
12349
12272
|
|
|
12350
12273
|
// src/components/Table/TableCell.tsx
|
|
12351
|
-
var
|
|
12274
|
+
var import_react64 = require("react");
|
|
12352
12275
|
var import_styled_components80 = __toESM(require("styled-components"));
|
|
12353
12276
|
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
12354
12277
|
var sharedStyles = import_styled_components80.css`
|
|
@@ -12369,7 +12292,7 @@ var StyledTd = import_styled_components80.default.td`
|
|
|
12369
12292
|
line-height: var(--wui-typography-body-2-line-height);
|
|
12370
12293
|
`;
|
|
12371
12294
|
var TableCell = ({ children, ...props }) => {
|
|
12372
|
-
const section = (0,
|
|
12295
|
+
const section = (0, import_react64.useContext)(TableSectionContext);
|
|
12373
12296
|
if (section === "head") {
|
|
12374
12297
|
return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(StyledTh, { ...props, children });
|
|
12375
12298
|
}
|
|
@@ -12401,7 +12324,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
12401
12324
|
};
|
|
12402
12325
|
|
|
12403
12326
|
// src/components/Tabs/Tabs.tsx
|
|
12404
|
-
var
|
|
12327
|
+
var import_react68 = require("react");
|
|
12405
12328
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
12406
12329
|
var import_type_guards51 = require("@wistia/type-guards");
|
|
12407
12330
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
@@ -12456,17 +12379,17 @@ var TabList = ({
|
|
|
12456
12379
|
TabList.displayName = "TabList";
|
|
12457
12380
|
|
|
12458
12381
|
// src/components/Tabs/TabItem.tsx
|
|
12459
|
-
var
|
|
12382
|
+
var import_react66 = require("react");
|
|
12460
12383
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
12461
12384
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
12462
12385
|
var import_type_guards50 = require("@wistia/type-guards");
|
|
12463
12386
|
|
|
12464
12387
|
// src/components/Tabs/useTabsValue.tsx
|
|
12465
|
-
var
|
|
12466
|
-
var TabsValueContext = (0,
|
|
12388
|
+
var import_react65 = require("react");
|
|
12389
|
+
var TabsValueContext = (0, import_react65.createContext)(null);
|
|
12467
12390
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
12468
12391
|
var useTabsValue = () => {
|
|
12469
|
-
const context = (0,
|
|
12392
|
+
const context = (0, import_react65.useContext)(TabsValueContext);
|
|
12470
12393
|
if (context === null) {
|
|
12471
12394
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
12472
12395
|
}
|
|
@@ -12482,13 +12405,13 @@ var StyledTabItem = (0, import_styled_components86.default)(import_react_tabs3.T
|
|
|
12482
12405
|
outline: none;
|
|
12483
12406
|
}
|
|
12484
12407
|
`;
|
|
12485
|
-
var TabItem = (0,
|
|
12408
|
+
var TabItem = (0, import_react66.forwardRef)(
|
|
12486
12409
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
12487
12410
|
const selectedValue = useTabsValue();
|
|
12488
12411
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
12489
|
-
const buttonRef = (0,
|
|
12412
|
+
const buttonRef = (0, import_react66.useRef)(null);
|
|
12490
12413
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
12491
|
-
(0,
|
|
12414
|
+
(0, import_react66.useEffect)(() => {
|
|
12492
12415
|
const buttonElem = buttonRef.current;
|
|
12493
12416
|
if (!buttonElem) {
|
|
12494
12417
|
return void 0;
|
|
@@ -12532,16 +12455,16 @@ var TabItem = (0, import_react67.forwardRef)(
|
|
|
12532
12455
|
TabItem.displayName = "TabItem";
|
|
12533
12456
|
|
|
12534
12457
|
// src/components/Tabs/extractTabItems.ts
|
|
12535
|
-
var
|
|
12458
|
+
var import_react67 = require("react");
|
|
12536
12459
|
var extractTabItems = (children) => {
|
|
12537
12460
|
const tabItems = [];
|
|
12538
|
-
|
|
12539
|
-
if (!(0,
|
|
12461
|
+
import_react67.Children.forEach(children, (child) => {
|
|
12462
|
+
if (!(0, import_react67.isValidElement)(child)) {
|
|
12540
12463
|
return;
|
|
12541
12464
|
}
|
|
12542
12465
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
12543
12466
|
tabItems.push(child);
|
|
12544
|
-
} else if (child.type ===
|
|
12467
|
+
} else if (child.type === import_react67.Fragment) {
|
|
12545
12468
|
const fragmentElement = child;
|
|
12546
12469
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
12547
12470
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -12588,7 +12511,7 @@ var StyledTabsRoot = (0, import_styled_components88.default)(import_react_tabs4.
|
|
|
12588
12511
|
flex-direction: column;
|
|
12589
12512
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12590
12513
|
`;
|
|
12591
|
-
var Tabs = (0,
|
|
12514
|
+
var Tabs = (0, import_react68.forwardRef)(
|
|
12592
12515
|
({
|
|
12593
12516
|
children,
|
|
12594
12517
|
fullWidth = true,
|
|
@@ -12600,7 +12523,7 @@ var Tabs = (0, import_react69.forwardRef)(
|
|
|
12600
12523
|
...props
|
|
12601
12524
|
}, ref) => {
|
|
12602
12525
|
const tabItems = extractTabItems(children);
|
|
12603
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
12526
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react68.useState)(defaultSelectedValue);
|
|
12604
12527
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
12605
12528
|
defaultValue: defaultSelectedValue,
|
|
12606
12529
|
onValueChange: setInternalSelectedValue
|
|
@@ -12686,15 +12609,15 @@ var Tabs = (0, import_react69.forwardRef)(
|
|
|
12686
12609
|
Tabs.displayName = "Tabs";
|
|
12687
12610
|
|
|
12688
12611
|
// src/components/Tabs/Tab.tsx
|
|
12689
|
-
var
|
|
12612
|
+
var import_react69 = require("react");
|
|
12690
12613
|
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
12691
|
-
var Tab = (0,
|
|
12614
|
+
var Tab = (0, import_react69.forwardRef)(({ children }, ref) => {
|
|
12692
12615
|
return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)("div", { ref, children });
|
|
12693
12616
|
});
|
|
12694
12617
|
Tab.displayName = "Tab";
|
|
12695
12618
|
|
|
12696
12619
|
// src/components/Tag/Tag.tsx
|
|
12697
|
-
var
|
|
12620
|
+
var import_react70 = require("react");
|
|
12698
12621
|
var import_styled_components89 = __toESM(require("styled-components"));
|
|
12699
12622
|
var import_type_guards52 = require("@wistia/type-guards");
|
|
12700
12623
|
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
@@ -12811,7 +12734,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12811
12734
|
)
|
|
12812
12735
|
] });
|
|
12813
12736
|
};
|
|
12814
|
-
var Tag = (0,
|
|
12737
|
+
var Tag = (0, import_react70.forwardRef)(
|
|
12815
12738
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12816
12739
|
const hasIcon = (0, import_type_guards52.isNotNil)(icon);
|
|
12817
12740
|
const labelProps = (0, import_type_guards52.isNotNil)(href) && (0, import_type_guards52.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
@@ -12885,9 +12808,9 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
12885
12808
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
12886
12809
|
|
|
12887
12810
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12888
|
-
var
|
|
12889
|
-
var
|
|
12890
|
-
var
|
|
12811
|
+
var import_react71 = require("react");
|
|
12812
|
+
var import_styled_components93 = __toESM(require("styled-components"));
|
|
12813
|
+
var import_type_guards56 = require("@wistia/type-guards");
|
|
12891
12814
|
|
|
12892
12815
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12893
12816
|
var import_type_guards54 = require("@wistia/type-guards");
|
|
@@ -13022,7 +12945,17 @@ var getBackgroundGradient = (gradientName = void 0) => {
|
|
|
13022
12945
|
};
|
|
13023
12946
|
|
|
13024
12947
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
12948
|
+
var import_styled_components92 = __toESM(require("styled-components"));
|
|
12949
|
+
var import_type_guards55 = require("@wistia/type-guards");
|
|
13025
12950
|
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
12951
|
+
var ScrubLine = import_styled_components92.default.div`
|
|
12952
|
+
position: absolute;
|
|
12953
|
+
top: 0;
|
|
12954
|
+
height: 100%;
|
|
12955
|
+
width: 2px;
|
|
12956
|
+
background-color: var(--wui-color-bg-surface-selected-active);
|
|
12957
|
+
z-index: 1;
|
|
12958
|
+
`;
|
|
13026
12959
|
var getScaledDimensions = (originalAspectRatio, targetAspectRatio, viewerWidth, viewerHeight) => {
|
|
13027
12960
|
let scaledHeight = viewerHeight;
|
|
13028
12961
|
let scaledWidth = viewerWidth;
|
|
@@ -13062,7 +12995,7 @@ var ThumbnailStoryboardViewer = ({
|
|
|
13062
12995
|
targetAspectRatio,
|
|
13063
12996
|
scaleFactor = 1,
|
|
13064
12997
|
framesPerRow = 10,
|
|
13065
|
-
|
|
12998
|
+
cursorPosition,
|
|
13066
12999
|
...props
|
|
13067
13000
|
}) => {
|
|
13068
13001
|
const originalAspectRatio = frameWidth / frameHeight;
|
|
@@ -13098,7 +13031,9 @@ var ThumbnailStoryboardViewer = ({
|
|
|
13098
13031
|
storyboardHeight * scaleFactorFromAspectRatioFit * scaleFactor
|
|
13099
13032
|
);
|
|
13100
13033
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
13101
|
-
const backgroundImage =
|
|
13034
|
+
const backgroundImage = `url(${storyboardUrl})`;
|
|
13035
|
+
const showScrubLine = (0, import_type_guards55.isNotNil)(cursorPosition);
|
|
13036
|
+
const scrubLinePosition = (0, import_type_guards55.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
13102
13037
|
const viewerStyles = {
|
|
13103
13038
|
position: "relative",
|
|
13104
13039
|
overflow: "hidden",
|
|
@@ -13115,24 +13050,34 @@ var ThumbnailStoryboardViewer = ({
|
|
|
13115
13050
|
backgroundPosition,
|
|
13116
13051
|
backgroundSize
|
|
13117
13052
|
};
|
|
13118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime272.
|
|
13053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(
|
|
13119
13054
|
"div",
|
|
13120
13055
|
{
|
|
13121
13056
|
...props,
|
|
13122
13057
|
style: viewerStyles,
|
|
13123
|
-
children:
|
|
13058
|
+
children: [
|
|
13059
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)("div", { style: storyboardStyles }),
|
|
13060
|
+
showScrubLine ? /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
13061
|
+
ScrubLine,
|
|
13062
|
+
{
|
|
13063
|
+
style: {
|
|
13064
|
+
left: scrubLinePosition
|
|
13065
|
+
}
|
|
13066
|
+
}
|
|
13067
|
+
) : null
|
|
13068
|
+
]
|
|
13124
13069
|
}
|
|
13125
13070
|
);
|
|
13126
13071
|
};
|
|
13127
13072
|
|
|
13128
13073
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
13129
13074
|
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
13130
|
-
var WideThumbnailImage =
|
|
13075
|
+
var WideThumbnailImage = import_styled_components93.default.img`
|
|
13131
13076
|
height: 100%;
|
|
13132
13077
|
object-fit: cover;
|
|
13133
13078
|
width: 100%;
|
|
13134
13079
|
`;
|
|
13135
|
-
var SquareThumbnailImage =
|
|
13080
|
+
var SquareThumbnailImage = import_styled_components93.default.img`
|
|
13136
13081
|
backdrop-filter: blur(8px);
|
|
13137
13082
|
object-fit: contain;
|
|
13138
13083
|
width: 100%;
|
|
@@ -13143,7 +13088,6 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
13143
13088
|
WideThumbnailImage,
|
|
13144
13089
|
{
|
|
13145
13090
|
alt: "",
|
|
13146
|
-
role: "img",
|
|
13147
13091
|
src: thumbnailUrl
|
|
13148
13092
|
}
|
|
13149
13093
|
);
|
|
@@ -13152,16 +13096,15 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
13152
13096
|
SquareThumbnailImage,
|
|
13153
13097
|
{
|
|
13154
13098
|
alt: "",
|
|
13155
|
-
role: "img",
|
|
13156
13099
|
src: thumbnailUrl
|
|
13157
13100
|
}
|
|
13158
13101
|
);
|
|
13159
13102
|
};
|
|
13160
|
-
var StyledThumbnail =
|
|
13161
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
13103
|
+
var StyledThumbnail = import_styled_components93.default.div`
|
|
13104
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards56.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
13162
13105
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
13163
13106
|
// if we don't have $backgroundUrl show a gradient
|
|
13164
|
-
(0,
|
|
13107
|
+
(0, import_type_guards56.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
13165
13108
|
)};
|
|
13166
13109
|
background-position: center center;
|
|
13167
13110
|
background-size: cover;
|
|
@@ -13170,7 +13113,7 @@ var StyledThumbnail = import_styled_components92.default.div`
|
|
|
13170
13113
|
overflow: hidden;
|
|
13171
13114
|
position: relative;
|
|
13172
13115
|
width: ${({ $width }) => $width};
|
|
13173
|
-
${({ $isScrubbable }) => $isScrubbable && "cursor:
|
|
13116
|
+
${({ $isScrubbable }) => $isScrubbable && "cursor: pointer;"}
|
|
13174
13117
|
|
|
13175
13118
|
&,
|
|
13176
13119
|
img {
|
|
@@ -13186,7 +13129,7 @@ var getRelativeMousePosition = (elem, mouseEvent) => {
|
|
|
13186
13129
|
left: relativeLeft
|
|
13187
13130
|
};
|
|
13188
13131
|
};
|
|
13189
|
-
var Thumbnail = (0,
|
|
13132
|
+
var Thumbnail = (0, import_react71.forwardRef)(
|
|
13190
13133
|
({
|
|
13191
13134
|
gradientBackground = "defaultMidOne",
|
|
13192
13135
|
thumbnailImageType = "square",
|
|
@@ -13197,16 +13140,17 @@ var Thumbnail = (0, import_react72.forwardRef)(
|
|
|
13197
13140
|
height,
|
|
13198
13141
|
...props
|
|
13199
13142
|
}, ref) => {
|
|
13200
|
-
const [percent, setPercent] = (0,
|
|
13201
|
-
const [isMouseOver, setIsMouseOver] = (0,
|
|
13202
|
-
const [isStoryboardReady, setIsStoryboardReady] = (0,
|
|
13203
|
-
const storyboardElementRef = (0,
|
|
13204
|
-
const
|
|
13205
|
-
|
|
13143
|
+
const [percent, setPercent] = (0, import_react71.useState)(0);
|
|
13144
|
+
const [isMouseOver, setIsMouseOver] = (0, import_react71.useState)(false);
|
|
13145
|
+
const [isStoryboardReady, setIsStoryboardReady] = (0, import_react71.useState)(false);
|
|
13146
|
+
const storyboardElementRef = (0, import_react71.useRef)(null);
|
|
13147
|
+
const [cursorPosition, setCursorPosition] = (0, import_react71.useState)(null);
|
|
13148
|
+
const backgroundUrl = (0, import_react71.useMemo)(
|
|
13149
|
+
() => thumbnailImageType === "square" && (0, import_type_guards56.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
13206
13150
|
[thumbnailImageType, thumbnailUrl]
|
|
13207
13151
|
);
|
|
13208
|
-
const isScrubbable = (0,
|
|
13209
|
-
const trackStoryboardLoadStatus = (0,
|
|
13152
|
+
const isScrubbable = (0, import_type_guards56.isNotNil)(storyboard);
|
|
13153
|
+
const trackStoryboardLoadStatus = (0, import_react71.useCallback)(() => {
|
|
13210
13154
|
if (storyboardElementRef.current || !storyboard) {
|
|
13211
13155
|
return storyboardElementRef.current;
|
|
13212
13156
|
}
|
|
@@ -13216,7 +13160,7 @@ var Thumbnail = (0, import_react72.forwardRef)(
|
|
|
13216
13160
|
storyboardElementRef.current = asset;
|
|
13217
13161
|
return storyboardElementRef.current;
|
|
13218
13162
|
}, [storyboard]);
|
|
13219
|
-
const handleMouseMove = (0,
|
|
13163
|
+
const handleMouseMove = (0, import_react71.useCallback)(
|
|
13220
13164
|
(mouseEvent) => {
|
|
13221
13165
|
if (!isScrubbable) return;
|
|
13222
13166
|
const elem = mouseEvent.currentTarget;
|
|
@@ -13224,19 +13168,21 @@ var Thumbnail = (0, import_react72.forwardRef)(
|
|
|
13224
13168
|
const newPercent = relMousePos.left / elem.clientWidth;
|
|
13225
13169
|
trackStoryboardLoadStatus();
|
|
13226
13170
|
setPercent(newPercent);
|
|
13171
|
+
setCursorPosition(relMousePos.left);
|
|
13227
13172
|
setIsMouseOver(true);
|
|
13228
13173
|
},
|
|
13229
13174
|
[isScrubbable, trackStoryboardLoadStatus]
|
|
13230
13175
|
);
|
|
13231
|
-
const handleMouseOut = (0,
|
|
13176
|
+
const handleMouseOut = (0, import_react71.useCallback)(() => {
|
|
13232
13177
|
if (!isScrubbable) return;
|
|
13233
13178
|
setIsMouseOver(false);
|
|
13179
|
+
setCursorPosition(null);
|
|
13234
13180
|
}, [isScrubbable]);
|
|
13235
|
-
const shouldRenderStoryboard = (0,
|
|
13181
|
+
const shouldRenderStoryboard = (0, import_react71.useMemo)(() => {
|
|
13236
13182
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
13237
13183
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
13238
|
-
const renderStoryboard = (0,
|
|
13239
|
-
if (!storyboard || (0,
|
|
13184
|
+
const renderStoryboard = (0, import_react71.useCallback)(() => {
|
|
13185
|
+
if (!storyboard || (0, import_type_guards56.isUndefined)(height) || (0, import_type_guards56.isEmptyString)(height)) return null;
|
|
13240
13186
|
const {
|
|
13241
13187
|
url,
|
|
13242
13188
|
width: sbWidth,
|
|
@@ -13246,10 +13192,12 @@ var Thumbnail = (0, import_react72.forwardRef)(
|
|
|
13246
13192
|
frameCount,
|
|
13247
13193
|
aspectRatio
|
|
13248
13194
|
} = storyboard;
|
|
13249
|
-
const targetWidth = (0,
|
|
13195
|
+
const targetWidth = (0, import_type_guards56.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
13196
|
+
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
13250
13197
|
return /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
13251
13198
|
ThumbnailStoryboardViewer,
|
|
13252
13199
|
{
|
|
13200
|
+
cursorPosition: effectiveCursorPosition,
|
|
13253
13201
|
frameCount,
|
|
13254
13202
|
frameHeight,
|
|
13255
13203
|
frameWidth,
|
|
@@ -13261,11 +13209,11 @@ var Thumbnail = (0, import_react72.forwardRef)(
|
|
|
13261
13209
|
targetWidth
|
|
13262
13210
|
}
|
|
13263
13211
|
);
|
|
13264
|
-
}, [storyboard, percent, width, height]);
|
|
13212
|
+
}, [storyboard, percent, width, height, cursorPosition, isStoryboardReady]);
|
|
13265
13213
|
let thumbnailContent = null;
|
|
13266
13214
|
if (shouldRenderStoryboard) {
|
|
13267
13215
|
thumbnailContent = renderStoryboard();
|
|
13268
|
-
} else if ((0,
|
|
13216
|
+
} else if ((0, import_type_guards56.isNotNil)(thumbnailUrl)) {
|
|
13269
13217
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
13270
13218
|
ThumbnailImage,
|
|
13271
13219
|
{
|
|
@@ -13290,7 +13238,7 @@ var Thumbnail = (0, import_react72.forwardRef)(
|
|
|
13290
13238
|
onMouseOut: handleMouseOut,
|
|
13291
13239
|
role: "presentation",
|
|
13292
13240
|
children: [
|
|
13293
|
-
(0,
|
|
13241
|
+
(0, import_type_guards56.isNotNil)(children) ? children : null,
|
|
13294
13242
|
thumbnailContent
|
|
13295
13243
|
]
|
|
13296
13244
|
}
|
|
@@ -13300,14 +13248,14 @@ var Thumbnail = (0, import_react72.forwardRef)(
|
|
|
13300
13248
|
Thumbnail.displayName = "Thumbnail";
|
|
13301
13249
|
|
|
13302
13250
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
13303
|
-
var
|
|
13304
|
-
var
|
|
13305
|
-
var
|
|
13251
|
+
var import_react72 = __toESM(require("react"));
|
|
13252
|
+
var import_styled_components94 = __toESM(require("styled-components"));
|
|
13253
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
13306
13254
|
var import_jsx_runtime274 = (
|
|
13307
13255
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
13308
13256
|
require("react/jsx-runtime")
|
|
13309
13257
|
);
|
|
13310
|
-
var StyledThumbnailCollage =
|
|
13258
|
+
var StyledThumbnailCollage = import_styled_components94.default.div`
|
|
13311
13259
|
display: grid;
|
|
13312
13260
|
gap: var(--wui-space-01);
|
|
13313
13261
|
width: 100%;
|
|
@@ -13380,10 +13328,10 @@ var ThumbnailCollage = ({
|
|
|
13380
13328
|
gradientBackground = "defaultMidOne",
|
|
13381
13329
|
...props
|
|
13382
13330
|
}) => {
|
|
13383
|
-
const thumbnailArray =
|
|
13331
|
+
const thumbnailArray = import_react72.default.Children.toArray(children);
|
|
13384
13332
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
13385
|
-
const thumbnails = (0,
|
|
13386
|
-
return
|
|
13333
|
+
const thumbnails = (0, import_type_guards57.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
13334
|
+
return import_react72.default.cloneElement(child, {
|
|
13387
13335
|
...child.props,
|
|
13388
13336
|
children: void 0
|
|
13389
13337
|
});
|
|
@@ -13409,8 +13357,8 @@ var ThumbnailCollage = ({
|
|
|
13409
13357
|
};
|
|
13410
13358
|
|
|
13411
13359
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
13412
|
-
var
|
|
13413
|
-
var
|
|
13360
|
+
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13361
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
13414
13362
|
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
13415
13363
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
13416
13364
|
if (iconOnly) {
|
|
@@ -13451,7 +13399,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
13451
13399
|
}
|
|
13452
13400
|
return "0 0 144 31.47";
|
|
13453
13401
|
};
|
|
13454
|
-
var WistiaLogoComponent =
|
|
13402
|
+
var WistiaLogoComponent = import_styled_components95.default.svg`
|
|
13455
13403
|
height: ${({ height }) => `${height}px`};
|
|
13456
13404
|
|
|
13457
13405
|
/* ensure it will always fit on mobile */
|
|
@@ -13467,12 +13415,12 @@ var WistiaLogoComponent = import_styled_components94.default.svg`
|
|
|
13467
13415
|
${({ $opticallyCentered, $iconOnly }) => {
|
|
13468
13416
|
if ($opticallyCentered) {
|
|
13469
13417
|
if ($iconOnly) {
|
|
13470
|
-
return
|
|
13418
|
+
return import_styled_components95.css`
|
|
13471
13419
|
aspect-ratio: 1;
|
|
13472
13420
|
padding: 11.85% 3.12% 13.91%;
|
|
13473
13421
|
`;
|
|
13474
13422
|
}
|
|
13475
|
-
return
|
|
13423
|
+
return import_styled_components95.css`
|
|
13476
13424
|
aspect-ratio: 127 / 32;
|
|
13477
13425
|
`;
|
|
13478
13426
|
}
|
|
@@ -13523,7 +13471,7 @@ var WistiaLogo = ({
|
|
|
13523
13471
|
...props,
|
|
13524
13472
|
children: [
|
|
13525
13473
|
/* @__PURE__ */ (0, import_jsx_runtime275.jsx)("title", { children: title }),
|
|
13526
|
-
(0,
|
|
13474
|
+
(0, import_type_guards58.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime275.jsx)("desc", { children: description }) : null,
|
|
13527
13475
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
13528
13476
|
renderLogotype(logotypeColor, iconOnly)
|
|
13529
13477
|
]
|
|
@@ -13534,18 +13482,18 @@ var WistiaLogo = ({
|
|
|
13534
13482
|
WistiaLogo.displayName = "WistiaLogo";
|
|
13535
13483
|
|
|
13536
13484
|
// src/components/List/List.tsx
|
|
13537
|
-
var
|
|
13538
|
-
var
|
|
13485
|
+
var import_type_guards60 = require("@wistia/type-guards");
|
|
13486
|
+
var import_styled_components97 = __toESM(require("styled-components"));
|
|
13539
13487
|
|
|
13540
13488
|
// src/components/List/ListItem.tsx
|
|
13541
|
-
var
|
|
13542
|
-
var
|
|
13489
|
+
var import_styled_components96 = __toESM(require("styled-components"));
|
|
13490
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
13543
13491
|
var import_jsx_runtime276 = require("react/jsx-runtime");
|
|
13544
|
-
var ListItemComponent =
|
|
13492
|
+
var ListItemComponent = import_styled_components96.default.li`
|
|
13545
13493
|
margin-bottom: var(--wui-space-02);
|
|
13546
13494
|
`;
|
|
13547
13495
|
var ListItem = ({ children }) => {
|
|
13548
|
-
if ((0,
|
|
13496
|
+
if ((0, import_type_guards59.isNil)(children)) {
|
|
13549
13497
|
return null;
|
|
13550
13498
|
}
|
|
13551
13499
|
return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(ListItemComponent, { children });
|
|
@@ -13554,7 +13502,7 @@ ListItem.displayName = "ListItem";
|
|
|
13554
13502
|
|
|
13555
13503
|
// src/components/List/List.tsx
|
|
13556
13504
|
var import_jsx_runtime277 = require("react/jsx-runtime");
|
|
13557
|
-
var spacesStyle =
|
|
13505
|
+
var spacesStyle = import_styled_components97.css`
|
|
13558
13506
|
overflow: hidden;
|
|
13559
13507
|
padding-left: 0;
|
|
13560
13508
|
vertical-align: bottom;
|
|
@@ -13576,7 +13524,7 @@ var spacesStyle = import_styled_components96.css`
|
|
|
13576
13524
|
}
|
|
13577
13525
|
}
|
|
13578
13526
|
`;
|
|
13579
|
-
var commasStyle =
|
|
13527
|
+
var commasStyle = import_styled_components97.css`
|
|
13580
13528
|
${spacesStyle};
|
|
13581
13529
|
|
|
13582
13530
|
li {
|
|
@@ -13586,7 +13534,7 @@ var commasStyle = import_styled_components96.css`
|
|
|
13586
13534
|
}
|
|
13587
13535
|
}
|
|
13588
13536
|
`;
|
|
13589
|
-
var slashesStyle =
|
|
13537
|
+
var slashesStyle = import_styled_components97.css`
|
|
13590
13538
|
${spacesStyle};
|
|
13591
13539
|
|
|
13592
13540
|
li {
|
|
@@ -13597,7 +13545,7 @@ var slashesStyle = import_styled_components96.css`
|
|
|
13597
13545
|
}
|
|
13598
13546
|
}
|
|
13599
13547
|
`;
|
|
13600
|
-
var breadcrumbsStyle =
|
|
13548
|
+
var breadcrumbsStyle = import_styled_components97.css`
|
|
13601
13549
|
${spacesStyle};
|
|
13602
13550
|
|
|
13603
13551
|
li {
|
|
@@ -13608,11 +13556,11 @@ var breadcrumbsStyle = import_styled_components96.css`
|
|
|
13608
13556
|
}
|
|
13609
13557
|
}
|
|
13610
13558
|
`;
|
|
13611
|
-
var unbulletedStyle =
|
|
13559
|
+
var unbulletedStyle = import_styled_components97.css`
|
|
13612
13560
|
list-style: none;
|
|
13613
13561
|
padding-left: 0;
|
|
13614
13562
|
`;
|
|
13615
|
-
var ListComponent =
|
|
13563
|
+
var ListComponent = import_styled_components97.default.ul`
|
|
13616
13564
|
list-style-position: outside;
|
|
13617
13565
|
margin: 0 0 var(--wui-space-01);
|
|
13618
13566
|
padding: 0 0 0 var(--wui-space-04);
|
|
@@ -13675,13 +13623,13 @@ var List = ({
|
|
|
13675
13623
|
...otherProps
|
|
13676
13624
|
}) => {
|
|
13677
13625
|
const listVariant = variant ?? "bullets";
|
|
13678
|
-
if ((0,
|
|
13626
|
+
if ((0, import_type_guards60.isNotNil)(children)) {
|
|
13679
13627
|
if (Array.isArray(children) && !children.length) {
|
|
13680
13628
|
return null;
|
|
13681
13629
|
}
|
|
13682
13630
|
return renderListComponent(children, listVariant, otherProps);
|
|
13683
13631
|
}
|
|
13684
|
-
if ((0,
|
|
13632
|
+
if ((0, import_type_guards60.isNotNil)(items)) {
|
|
13685
13633
|
if (!items.length) {
|
|
13686
13634
|
return null;
|
|
13687
13635
|
}
|