@wistia/ui 0.15.13 → 0.15.14-beta.50e89a95.396fb5b
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 +98 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.mjs +79 -52
- 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.15.
|
|
3
|
+
* @license @wistia/ui v0.15.14-beta.50e89a95.396fb5b
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -13039,6 +13039,7 @@ var Combobox2 = ({
|
|
|
13039
13039
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
13040
13040
|
var import_type_guards43 = require("@wistia/type-guards");
|
|
13041
13041
|
var import_react61 = require("react");
|
|
13042
|
+
var import_react_dom = require("react-dom");
|
|
13042
13043
|
|
|
13043
13044
|
// src/components/Menu/Menu.tsx
|
|
13044
13045
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
@@ -13708,7 +13709,8 @@ var ContextMenu = ({
|
|
|
13708
13709
|
triggerRef,
|
|
13709
13710
|
children,
|
|
13710
13711
|
side = "bottom",
|
|
13711
|
-
onRequestClose = () => null
|
|
13712
|
+
onRequestClose = () => null,
|
|
13713
|
+
compact = false
|
|
13712
13714
|
}) => {
|
|
13713
13715
|
const [isRightClicked, setIsRightClicked] = (0, import_react61.useState)(false);
|
|
13714
13716
|
const [menuPosition, setMenuPosition] = (0, import_react61.useState)(position ?? { x: 0, y: 0 });
|
|
@@ -13728,9 +13730,13 @@ var ContextMenu = ({
|
|
|
13728
13730
|
return () => null;
|
|
13729
13731
|
}, [position, triggerRef]);
|
|
13730
13732
|
const isOpen = (0, import_type_guards43.isNotNil)(position) || isRightClicked;
|
|
13731
|
-
|
|
13733
|
+
if (!isOpen) {
|
|
13734
|
+
return null;
|
|
13735
|
+
}
|
|
13736
|
+
const menu = /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
13732
13737
|
Menu,
|
|
13733
13738
|
{
|
|
13739
|
+
compact,
|
|
13734
13740
|
isOpen,
|
|
13735
13741
|
onOpenChange: (next) => {
|
|
13736
13742
|
setIsRightClicked(next);
|
|
@@ -13756,7 +13762,11 @@ var ContextMenu = ({
|
|
|
13756
13762
|
),
|
|
13757
13763
|
children
|
|
13758
13764
|
}
|
|
13759
|
-
)
|
|
13765
|
+
);
|
|
13766
|
+
if ((0, import_type_guards43.isNotNil)(triggerRef)) {
|
|
13767
|
+
return (0, import_react_dom.createPortal)(menu, document.body);
|
|
13768
|
+
}
|
|
13769
|
+
return menu;
|
|
13760
13770
|
};
|
|
13761
13771
|
|
|
13762
13772
|
// src/components/DataCards/DataCard.tsx
|
|
@@ -14927,6 +14937,7 @@ var FormField = ({
|
|
|
14927
14937
|
label,
|
|
14928
14938
|
labelPosition,
|
|
14929
14939
|
name,
|
|
14940
|
+
required = false,
|
|
14930
14941
|
value,
|
|
14931
14942
|
...props
|
|
14932
14943
|
}) => {
|
|
@@ -14976,7 +14987,14 @@ var FormField = ({
|
|
|
14976
14987
|
...props,
|
|
14977
14988
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
14978
14989
|
children: [
|
|
14979
|
-
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
14990
|
+
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
14991
|
+
Label,
|
|
14992
|
+
{
|
|
14993
|
+
htmlFor: computedId,
|
|
14994
|
+
required,
|
|
14995
|
+
children: label
|
|
14996
|
+
}
|
|
14997
|
+
),
|
|
14980
14998
|
(0, import_type_guards49.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
14981
14999
|
(0, import_react73.cloneElement)(children, childProps),
|
|
14982
15000
|
(0, import_type_guards49.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(import_jsx_runtime283.Fragment, { children: [
|
|
@@ -15506,7 +15524,7 @@ Mark.displayName = "Mark_UI";
|
|
|
15506
15524
|
var import_react80 = require("react");
|
|
15507
15525
|
var import_styled_components97 = __toESM(require("styled-components"));
|
|
15508
15526
|
var import_react_dialog5 = require("@radix-ui/react-dialog");
|
|
15509
|
-
var
|
|
15527
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
15510
15528
|
|
|
15511
15529
|
// src/components/Modal/ModalHeader.tsx
|
|
15512
15530
|
var import_styled_components94 = __toESM(require("styled-components"));
|
|
@@ -15582,6 +15600,7 @@ var ModalHeader = ({
|
|
|
15582
15600
|
var import_react79 = require("react");
|
|
15583
15601
|
var import_styled_components95 = __toESM(require("styled-components"));
|
|
15584
15602
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
15603
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
15585
15604
|
|
|
15586
15605
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
15587
15606
|
var import_react78 = require("react");
|
|
@@ -15719,9 +15738,14 @@ var StyledModalContent = (0, import_styled_components95.default)(import_react_di
|
|
|
15719
15738
|
position: fixed;
|
|
15720
15739
|
top: unset;
|
|
15721
15740
|
left: unset;
|
|
15722
|
-
width: ${({ $width }) =>
|
|
15741
|
+
width: ${({ $width, $maxWidth }) => {
|
|
15742
|
+
if ((0, import_type_guards57.isNotNil)($maxWidth)) {
|
|
15743
|
+
return "auto";
|
|
15744
|
+
}
|
|
15745
|
+
return $width ?? DEFAULT_MODAL_WIDTH;
|
|
15746
|
+
}};
|
|
15723
15747
|
min-width: ${({ $width }) => $width ?? DEFAULT_MODAL_WIDTH};
|
|
15724
|
-
max-width: var(--wui-modal-max-width);
|
|
15748
|
+
max-width: ${({ $maxWidth }) => $maxWidth ?? "var(--wui-modal-max-width)"};
|
|
15725
15749
|
border-radius: var(--wui-border-radius-03);
|
|
15726
15750
|
animation-duration: var(--wui-motion-duration-03);
|
|
15727
15751
|
animation-timing-function: var(--wui-motion-ease-out);
|
|
@@ -15730,12 +15754,13 @@ var StyledModalContent = (0, import_styled_components95.default)(import_react_di
|
|
|
15730
15754
|
}
|
|
15731
15755
|
`;
|
|
15732
15756
|
var ModalContent = (0, import_react79.forwardRef)(
|
|
15733
|
-
({ width, positionVariant = "fixed-top", children, ...props }, ref) => {
|
|
15757
|
+
({ width, positionVariant = "fixed-top", maxWidth, children, ...props }, ref) => {
|
|
15734
15758
|
useFocusRestore();
|
|
15735
15759
|
return /* @__PURE__ */ (0, import_jsx_runtime294.jsx)(
|
|
15736
15760
|
StyledModalContent,
|
|
15737
15761
|
{
|
|
15738
15762
|
ref,
|
|
15763
|
+
$maxWidth: maxWidth,
|
|
15739
15764
|
$positionVariant: positionVariant,
|
|
15740
15765
|
$width: width,
|
|
15741
15766
|
"aria-describedby": void 0,
|
|
@@ -15805,6 +15830,7 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15805
15830
|
hideTitle = false,
|
|
15806
15831
|
initialFocusRef,
|
|
15807
15832
|
isOpen,
|
|
15833
|
+
maxWidth,
|
|
15808
15834
|
onRequestClose,
|
|
15809
15835
|
positionVariant = "centered",
|
|
15810
15836
|
title,
|
|
@@ -15815,7 +15841,7 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15815
15841
|
import_react_dialog5.Root,
|
|
15816
15842
|
{
|
|
15817
15843
|
onOpenChange: (open2) => {
|
|
15818
|
-
if (!open2 && (0,
|
|
15844
|
+
if (!open2 && (0, import_type_guards58.isNotNil)(onRequestClose)) {
|
|
15819
15845
|
onRequestClose();
|
|
15820
15846
|
}
|
|
15821
15847
|
},
|
|
@@ -15826,8 +15852,9 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15826
15852
|
ModalContent,
|
|
15827
15853
|
{
|
|
15828
15854
|
ref,
|
|
15855
|
+
maxWidth,
|
|
15829
15856
|
onOpenAutoFocus: (event) => {
|
|
15830
|
-
if ((0,
|
|
15857
|
+
if ((0, import_type_guards58.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
15831
15858
|
event.preventDefault();
|
|
15832
15859
|
requestAnimationFrame(() => {
|
|
15833
15860
|
initialFocusRef.current?.focus();
|
|
@@ -15839,7 +15866,7 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15839
15866
|
...props,
|
|
15840
15867
|
children: [
|
|
15841
15868
|
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ModalScrollArea, { children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ModalBody, { children }) }),
|
|
15842
|
-
(0,
|
|
15869
|
+
(0, import_type_guards58.isNotNil)(footer) ? /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ModalFooter, { children: footer }) : null,
|
|
15843
15870
|
hideCloseButton && hideTitle ? null : /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
|
|
15844
15871
|
ModalHeader,
|
|
15845
15872
|
{
|
|
@@ -15885,9 +15912,9 @@ var import_react_popover5 = require("@radix-ui/react-popover");
|
|
|
15885
15912
|
var import_styled_components99 = __toESM(require("styled-components"));
|
|
15886
15913
|
|
|
15887
15914
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
15888
|
-
var
|
|
15915
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
15889
15916
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
15890
|
-
return (0,
|
|
15917
|
+
return (0, import_type_guards59.isNotNil)(onOpenChange) && (0, import_type_guards59.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
15891
15918
|
};
|
|
15892
15919
|
|
|
15893
15920
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -16043,7 +16070,7 @@ Popover.displayName = "Popover_UI";
|
|
|
16043
16070
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
16044
16071
|
var import_styled_components100 = __toESM(require("styled-components"));
|
|
16045
16072
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
16046
|
-
var
|
|
16073
|
+
var import_type_guards60 = require("@wistia/type-guards");
|
|
16047
16074
|
var import_jsx_runtime299 = require("react/jsx-runtime");
|
|
16048
16075
|
var ProgressBarWrapper = import_styled_components100.default.div`
|
|
16049
16076
|
--progress-bar-height: 8px;
|
|
@@ -16099,7 +16126,7 @@ var ProgressBar = ({
|
|
|
16099
16126
|
...props
|
|
16100
16127
|
}) => {
|
|
16101
16128
|
return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)(ProgressBarWrapper, { children: [
|
|
16102
|
-
(0,
|
|
16129
|
+
(0, import_type_guards60.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
16103
16130
|
/* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
|
|
16104
16131
|
StyledProgressBar,
|
|
16105
16132
|
{
|
|
@@ -16117,13 +16144,13 @@ var ProgressBar = ({
|
|
|
16117
16144
|
)
|
|
16118
16145
|
}
|
|
16119
16146
|
),
|
|
16120
|
-
(0,
|
|
16147
|
+
(0, import_type_guards60.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
16121
16148
|
] });
|
|
16122
16149
|
};
|
|
16123
16150
|
ProgressBar.displayName = "ProgressBar_UI";
|
|
16124
16151
|
|
|
16125
16152
|
// src/components/Radio/Radio.tsx
|
|
16126
|
-
var
|
|
16153
|
+
var import_type_guards61 = require("@wistia/type-guards");
|
|
16127
16154
|
var import_react81 = require("react");
|
|
16128
16155
|
var import_styled_components101 = __toESM(require("styled-components"));
|
|
16129
16156
|
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
@@ -16223,14 +16250,14 @@ var Radio = (0, import_react81.forwardRef)(
|
|
|
16223
16250
|
...props
|
|
16224
16251
|
}, ref) => {
|
|
16225
16252
|
const generatedId = (0, import_react81.useId)();
|
|
16226
|
-
const computedId = (0,
|
|
16253
|
+
const computedId = (0, import_type_guards61.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
16227
16254
|
const radioGroupContext = useRadioGroup();
|
|
16228
16255
|
const contextName = radioGroupContext?.name;
|
|
16229
16256
|
const contextOnChange = radioGroupContext?.onChange;
|
|
16230
16257
|
const contextValue = radioGroupContext?.value;
|
|
16231
16258
|
const radioName = name ?? contextName;
|
|
16232
16259
|
const handleOnChange = onChange ?? contextOnChange;
|
|
16233
|
-
const isChecked = (0,
|
|
16260
|
+
const isChecked = (0, import_type_guards61.isNotUndefined)(value) && (0, import_type_guards61.isNotUndefined)(contextValue) ? contextValue === value : checked;
|
|
16234
16261
|
return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)(
|
|
16235
16262
|
StyledRadioWrapper,
|
|
16236
16263
|
{
|
|
@@ -16277,7 +16304,7 @@ var import_react83 = require("react");
|
|
|
16277
16304
|
// src/components/RadioCard/RadioCardRoot.tsx
|
|
16278
16305
|
var import_react82 = require("react");
|
|
16279
16306
|
var import_styled_components102 = __toESM(require("styled-components"));
|
|
16280
|
-
var
|
|
16307
|
+
var import_type_guards62 = require("@wistia/type-guards");
|
|
16281
16308
|
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
16282
16309
|
var checkedStyles = import_styled_components102.css`
|
|
16283
16310
|
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
@@ -16399,14 +16426,14 @@ var RadioCardRoot = (0, import_react82.forwardRef)(
|
|
|
16399
16426
|
...props
|
|
16400
16427
|
}, ref) => {
|
|
16401
16428
|
const generatedId = (0, import_react82.useId)();
|
|
16402
|
-
const computedId = (0,
|
|
16429
|
+
const computedId = (0, import_type_guards62.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
16403
16430
|
const radioGroupContext = useRadioGroup();
|
|
16404
16431
|
const contextName = radioGroupContext?.name;
|
|
16405
16432
|
const contextOnChange = radioGroupContext?.onChange;
|
|
16406
16433
|
const contextValue = radioGroupContext?.value;
|
|
16407
16434
|
const radioName = name ?? contextName;
|
|
16408
16435
|
const handleOnChange = onChange ?? contextOnChange;
|
|
16409
|
-
const isChecked = (0,
|
|
16436
|
+
const isChecked = (0, import_type_guards62.isNotUndefined)(value) && (0, import_type_guards62.isNotUndefined)(contextValue) ? contextValue === value : checked;
|
|
16410
16437
|
return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)(
|
|
16411
16438
|
StyledCard2,
|
|
16412
16439
|
{
|
|
@@ -16438,7 +16465,7 @@ RadioCardRoot.displayName = "RadioCardRoot_UI";
|
|
|
16438
16465
|
|
|
16439
16466
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
16440
16467
|
var import_styled_components104 = __toESM(require("styled-components"));
|
|
16441
|
-
var
|
|
16468
|
+
var import_type_guards63 = require("@wistia/type-guards");
|
|
16442
16469
|
|
|
16443
16470
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
16444
16471
|
var import_styled_components103 = __toESM(require("styled-components"));
|
|
@@ -16512,17 +16539,17 @@ var RadioCardDefaultLayout = ({
|
|
|
16512
16539
|
showIndicator = true
|
|
16513
16540
|
}) => {
|
|
16514
16541
|
return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(StyledCardContent, { children: [
|
|
16515
|
-
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(StyledIndicatorContainer, { $hasIcon: (0,
|
|
16542
|
+
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(StyledIndicatorContainer, { $hasIcon: (0, import_type_guards63.isNotNil)(icon), children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" }) }) : null,
|
|
16516
16543
|
/* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(Stack, { gap: "space-02", children: [
|
|
16517
|
-
(0,
|
|
16544
|
+
(0, import_type_guards63.isNotNil)(icon) && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
16518
16545
|
/* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
|
|
16519
16546
|
Stack,
|
|
16520
16547
|
{
|
|
16521
16548
|
gap: "space-01",
|
|
16522
|
-
style: (0,
|
|
16549
|
+
style: (0, import_type_guards63.isNotNil)(icon) ? { paddingLeft: 2 } : void 0,
|
|
16523
16550
|
children: [
|
|
16524
|
-
(0,
|
|
16525
|
-
(0,
|
|
16551
|
+
(0, import_type_guards63.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(Text, { variant: "label3", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("strong", { children: label }) }),
|
|
16552
|
+
(0, import_type_guards63.isNotNil)(description) && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
16526
16553
|
Text,
|
|
16527
16554
|
{
|
|
16528
16555
|
prominence: "secondary",
|
|
@@ -16705,7 +16732,7 @@ ScrollArea.displayName = "ScrollArea_UI";
|
|
|
16705
16732
|
var import_react88 = require("react");
|
|
16706
16733
|
var import_styled_components108 = __toESM(require("styled-components"));
|
|
16707
16734
|
var import_react_toggle_group3 = require("@radix-ui/react-toggle-group");
|
|
16708
|
-
var
|
|
16735
|
+
var import_type_guards65 = require("@wistia/type-guards");
|
|
16709
16736
|
|
|
16710
16737
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
16711
16738
|
var import_react86 = require("react");
|
|
@@ -16742,7 +16769,7 @@ var useSelectedItemStyle = () => {
|
|
|
16742
16769
|
|
|
16743
16770
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
16744
16771
|
var import_styled_components107 = __toESM(require("styled-components"));
|
|
16745
|
-
var
|
|
16772
|
+
var import_type_guards64 = require("@wistia/type-guards");
|
|
16746
16773
|
|
|
16747
16774
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
16748
16775
|
var import_react87 = require("react");
|
|
@@ -16776,7 +16803,7 @@ var SelectedItemIndicatorDiv = import_styled_components107.default.div`
|
|
|
16776
16803
|
var SelectedItemIndicator = () => {
|
|
16777
16804
|
const selectedValue = useSegmentedControlValue();
|
|
16778
16805
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
16779
|
-
if (!selectedValue || (0,
|
|
16806
|
+
if (!selectedValue || (0, import_type_guards64.isUndefined)(selectedItemIndicatorStyle)) {
|
|
16780
16807
|
return null;
|
|
16781
16808
|
}
|
|
16782
16809
|
return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
@@ -16813,7 +16840,7 @@ var SegmentedControl = (0, import_react88.forwardRef)(
|
|
|
16813
16840
|
onSelectedValueChange,
|
|
16814
16841
|
...props
|
|
16815
16842
|
}, ref) => {
|
|
16816
|
-
if ((0,
|
|
16843
|
+
if ((0, import_type_guards65.isNil)(children)) {
|
|
16817
16844
|
return null;
|
|
16818
16845
|
}
|
|
16819
16846
|
return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
@@ -16842,7 +16869,7 @@ SegmentedControl.displayName = "SegmentedControl_UI";
|
|
|
16842
16869
|
var import_react89 = require("react");
|
|
16843
16870
|
var import_styled_components109 = __toESM(require("styled-components"));
|
|
16844
16871
|
var import_react_toggle_group4 = require("@radix-ui/react-toggle-group");
|
|
16845
|
-
var
|
|
16872
|
+
var import_type_guards66 = require("@wistia/type-guards");
|
|
16846
16873
|
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
16847
16874
|
var segmentedControlItemStyles = import_styled_components109.css`
|
|
16848
16875
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -16958,8 +16985,8 @@ var SegmentedControlItem = (0, import_react89.forwardRef)(
|
|
|
16958
16985
|
{
|
|
16959
16986
|
ref: combinedRef,
|
|
16960
16987
|
...otherProps,
|
|
16961
|
-
$hasLabel: (0,
|
|
16962
|
-
"aria-label": (0,
|
|
16988
|
+
$hasLabel: (0, import_type_guards66.isNotNil)(label),
|
|
16989
|
+
"aria-label": (0, import_type_guards66.isNotNil)(label) ? void 0 : ariaLabel,
|
|
16963
16990
|
disabled,
|
|
16964
16991
|
onClick: handleClick,
|
|
16965
16992
|
value,
|
|
@@ -17124,7 +17151,7 @@ Select.displayName = "Select_UI";
|
|
|
17124
17151
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
17125
17152
|
var import_react91 = require("react");
|
|
17126
17153
|
var import_styled_components111 = __toESM(require("styled-components"));
|
|
17127
|
-
var
|
|
17154
|
+
var import_type_guards67 = require("@wistia/type-guards");
|
|
17128
17155
|
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
17129
17156
|
var StyledItem = (0, import_styled_components111.default)(import_react_select2.Item)`
|
|
17130
17157
|
${getTypographicStyles("label3")}
|
|
@@ -17161,7 +17188,7 @@ var SelectOption = (0, import_react91.forwardRef)(
|
|
|
17161
17188
|
ref: forwardedRef,
|
|
17162
17189
|
$checkmarkVerticalAlign: checkmarkVerticalAlign,
|
|
17163
17190
|
children: [
|
|
17164
|
-
(0,
|
|
17191
|
+
(0, import_type_guards67.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)("div", { children: [
|
|
17165
17192
|
children,
|
|
17166
17193
|
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
17167
17194
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(import_react_select2.ItemText, { children }),
|
|
@@ -17203,7 +17230,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
17203
17230
|
// src/components/Slider/Slider.tsx
|
|
17204
17231
|
var import_react_slider2 = require("@radix-ui/react-slider");
|
|
17205
17232
|
var import_styled_components113 = __toESM(require("styled-components"));
|
|
17206
|
-
var
|
|
17233
|
+
var import_type_guards68 = require("@wistia/type-guards");
|
|
17207
17234
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
17208
17235
|
var SliderContainer = import_styled_components113.default.div`
|
|
17209
17236
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -17282,7 +17309,7 @@ var Slider = ({
|
|
|
17282
17309
|
"data-testid": dataTestId = "ui-slider",
|
|
17283
17310
|
...otherProps
|
|
17284
17311
|
}) => {
|
|
17285
|
-
if (!((0,
|
|
17312
|
+
if (!((0, import_type_guards68.isNonEmptyString)(ariaLabel) || (0, import_type_guards68.isNonEmptyString)(ariaLabelledby))) {
|
|
17286
17313
|
throw new Error(
|
|
17287
17314
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
17288
17315
|
);
|
|
@@ -17444,7 +17471,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
17444
17471
|
// src/components/Tabs/Tabs.tsx
|
|
17445
17472
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
17446
17473
|
var import_react98 = require("react");
|
|
17447
|
-
var
|
|
17474
|
+
var import_type_guards69 = require("@wistia/type-guards");
|
|
17448
17475
|
|
|
17449
17476
|
// src/components/Tabs/useTabsValue.tsx
|
|
17450
17477
|
var import_react97 = require("react");
|
|
@@ -17481,10 +17508,10 @@ var Tabs = ({
|
|
|
17481
17508
|
...props,
|
|
17482
17509
|
onValueChange
|
|
17483
17510
|
};
|
|
17484
|
-
if ((0,
|
|
17511
|
+
if ((0, import_type_guards69.isNotNil)(value)) {
|
|
17485
17512
|
rootProps.value = value;
|
|
17486
17513
|
}
|
|
17487
|
-
if ((0,
|
|
17514
|
+
if ((0, import_type_guards69.isNotNil)(defaultValue)) {
|
|
17488
17515
|
rootProps.defaultValue = defaultValue;
|
|
17489
17516
|
}
|
|
17490
17517
|
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(import_react_tabs.Root, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -17504,7 +17531,7 @@ var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
|
17504
17531
|
var import_styled_components121 = __toESM(require("styled-components"));
|
|
17505
17532
|
|
|
17506
17533
|
// src/components/Tabs/SelectedTabIndicator.tsx
|
|
17507
|
-
var
|
|
17534
|
+
var import_type_guards70 = require("@wistia/type-guards");
|
|
17508
17535
|
|
|
17509
17536
|
// src/components/Tabs/TabsSelectedItemIndicatorDiv.tsx
|
|
17510
17537
|
var import_styled_components120 = __toESM(require("styled-components"));
|
|
@@ -17519,7 +17546,7 @@ var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
|
17519
17546
|
var SelectedTabIndicator = () => {
|
|
17520
17547
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
17521
17548
|
const selectedValue = useTabsValue();
|
|
17522
|
-
if (selectedValue == null || (0,
|
|
17549
|
+
if (selectedValue == null || (0, import_type_guards70.isUndefined)(selectedItemIndicatorStyle)) {
|
|
17523
17550
|
return null;
|
|
17524
17551
|
}
|
|
17525
17552
|
return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
@@ -17553,7 +17580,7 @@ TabsList.displayName = "TabsList_UI";
|
|
|
17553
17580
|
|
|
17554
17581
|
// src/components/Tabs/TabsTrigger.tsx
|
|
17555
17582
|
var import_react99 = require("react");
|
|
17556
|
-
var
|
|
17583
|
+
var import_type_guards71 = require("@wistia/type-guards");
|
|
17557
17584
|
|
|
17558
17585
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
17559
17586
|
var import_styled_components122 = __toESM(require("styled-components"));
|
|
@@ -17604,8 +17631,8 @@ var TabsTrigger = (0, import_react99.forwardRef)(
|
|
|
17604
17631
|
{
|
|
17605
17632
|
...otherProps,
|
|
17606
17633
|
ref: combinedRef,
|
|
17607
|
-
$hasLabel: (0,
|
|
17608
|
-
"aria-label": (0,
|
|
17634
|
+
$hasLabel: (0, import_type_guards71.isNotNil)(label),
|
|
17635
|
+
"aria-label": (0, import_type_guards71.isNotNil)(label) ? void 0 : ariaLabel,
|
|
17609
17636
|
disabled,
|
|
17610
17637
|
value,
|
|
17611
17638
|
children: [
|
|
@@ -17620,7 +17647,7 @@ TabsTrigger.displayName = "TabsTrigger_UI";
|
|
|
17620
17647
|
|
|
17621
17648
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
17622
17649
|
var import_styled_components123 = __toESM(require("styled-components"));
|
|
17623
|
-
var
|
|
17650
|
+
var import_type_guards72 = require("@wistia/type-guards");
|
|
17624
17651
|
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
17625
17652
|
var StyledThumbnailBadge = import_styled_components123.default.div`
|
|
17626
17653
|
align-items: center;
|
|
@@ -17649,7 +17676,7 @@ var StyledThumbnailBadge = import_styled_components123.default.div`
|
|
|
17649
17676
|
`;
|
|
17650
17677
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
17651
17678
|
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
17652
|
-
(0,
|
|
17679
|
+
(0, import_type_guards72.isNotNil)(icon) && icon,
|
|
17653
17680
|
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("span", { children: label })
|
|
17654
17681
|
] });
|
|
17655
17682
|
};
|
|
@@ -17658,10 +17685,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
|
17658
17685
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17659
17686
|
var import_react100 = require("react");
|
|
17660
17687
|
var import_styled_components126 = __toESM(require("styled-components"));
|
|
17661
|
-
var
|
|
17688
|
+
var import_type_guards75 = require("@wistia/type-guards");
|
|
17662
17689
|
|
|
17663
17690
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
17664
|
-
var
|
|
17691
|
+
var import_type_guards73 = require("@wistia/type-guards");
|
|
17665
17692
|
var import_styled_components124 = require("styled-components");
|
|
17666
17693
|
var gradients = {
|
|
17667
17694
|
defaultDarkOne: import_styled_components124.css`
|
|
@@ -17789,12 +17816,12 @@ var gradients = {
|
|
|
17789
17816
|
};
|
|
17790
17817
|
var gradientMap = Object.keys(gradients);
|
|
17791
17818
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
17792
|
-
return (0,
|
|
17819
|
+
return (0, import_type_guards73.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
17793
17820
|
};
|
|
17794
17821
|
|
|
17795
17822
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
17796
17823
|
var import_styled_components125 = __toESM(require("styled-components"));
|
|
17797
|
-
var
|
|
17824
|
+
var import_type_guards74 = require("@wistia/type-guards");
|
|
17798
17825
|
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
17799
17826
|
var ScrubLine = import_styled_components125.default.div`
|
|
17800
17827
|
position: absolute;
|
|
@@ -17888,8 +17915,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17888
17915
|
);
|
|
17889
17916
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
17890
17917
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
17891
|
-
const showScrubLine = (0,
|
|
17892
|
-
const scrubLinePosition = (0,
|
|
17918
|
+
const showScrubLine = (0, import_type_guards74.isNotNil)(cursorPosition);
|
|
17919
|
+
const scrubLinePosition = (0, import_type_guards74.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
17893
17920
|
const viewerStyles = {
|
|
17894
17921
|
position: "relative",
|
|
17895
17922
|
overflow: "hidden",
|
|
@@ -17960,10 +17987,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
17960
17987
|
);
|
|
17961
17988
|
};
|
|
17962
17989
|
var StyledThumbnail = import_styled_components126.default.div`
|
|
17963
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
17990
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards75.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
17964
17991
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
17965
17992
|
// if we don't have $backgroundUrl show a gradient
|
|
17966
|
-
(0,
|
|
17993
|
+
(0, import_type_guards75.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
17967
17994
|
)};
|
|
17968
17995
|
background-position: center center;
|
|
17969
17996
|
background-size: cover;
|
|
@@ -17995,7 +18022,7 @@ var StoryboardRenderer = ({
|
|
|
17995
18022
|
frameCount,
|
|
17996
18023
|
aspectRatio
|
|
17997
18024
|
} = storyboard;
|
|
17998
|
-
const targetWidth = (0,
|
|
18025
|
+
const targetWidth = (0, import_type_guards75.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
17999
18026
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
18000
18027
|
return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
18001
18028
|
ThumbnailStoryboardViewer,
|
|
@@ -18039,10 +18066,10 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18039
18066
|
const storyboardElementRef = (0, import_react100.useRef)(null);
|
|
18040
18067
|
const [cursorPosition, setCursorPosition] = (0, import_react100.useState)(null);
|
|
18041
18068
|
const backgroundUrl = (0, import_react100.useMemo)(
|
|
18042
|
-
() => thumbnailImageType === "square" && (0,
|
|
18069
|
+
() => thumbnailImageType === "square" && (0, import_type_guards75.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
18043
18070
|
[thumbnailImageType, thumbnailUrl]
|
|
18044
18071
|
);
|
|
18045
|
-
const isScrubbable = (0,
|
|
18072
|
+
const isScrubbable = (0, import_type_guards75.isNotNil)(storyboard);
|
|
18046
18073
|
const trackStoryboardLoadStatus = (0, import_react100.useCallback)(() => {
|
|
18047
18074
|
if (storyboardElementRef.current || !storyboard) {
|
|
18048
18075
|
return storyboardElementRef.current;
|
|
@@ -18072,7 +18099,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18072
18099
|
setCursorPosition(null);
|
|
18073
18100
|
}, [isScrubbable]);
|
|
18074
18101
|
const shouldRenderStoryboard = (0, import_react100.useMemo)(() => {
|
|
18075
|
-
if ((0,
|
|
18102
|
+
if ((0, import_type_guards75.isNil)(storyboard) || (0, import_type_guards75.isUndefined)(height) || (0, import_type_guards75.isEmptyString)(height)) {
|
|
18076
18103
|
return false;
|
|
18077
18104
|
}
|
|
18078
18105
|
return isScrubbable && isMouseOver && isStoryboardReady;
|
|
@@ -18089,7 +18116,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18089
18116
|
width
|
|
18090
18117
|
}
|
|
18091
18118
|
);
|
|
18092
|
-
} else if ((0,
|
|
18119
|
+
} else if ((0, import_type_guards75.isNotNil)(thumbnailUrl)) {
|
|
18093
18120
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
18094
18121
|
ThumbnailImage,
|
|
18095
18122
|
{
|
|
@@ -18114,7 +18141,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18114
18141
|
onMouseOut: handleMouseOut,
|
|
18115
18142
|
role: "presentation",
|
|
18116
18143
|
children: [
|
|
18117
|
-
(0,
|
|
18144
|
+
(0, import_type_guards75.isNotNil)(children) ? children : null,
|
|
18118
18145
|
thumbnailContent
|
|
18119
18146
|
]
|
|
18120
18147
|
}
|
|
@@ -18126,7 +18153,7 @@ Thumbnail.displayName = "Thumbnail_UI";
|
|
|
18126
18153
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
18127
18154
|
var import_react101 = __toESM(require("react"));
|
|
18128
18155
|
var import_styled_components127 = __toESM(require("styled-components"));
|
|
18129
|
-
var
|
|
18156
|
+
var import_type_guards76 = require("@wistia/type-guards");
|
|
18130
18157
|
var import_jsx_runtime328 = (
|
|
18131
18158
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
18132
18159
|
require("react/jsx-runtime")
|
|
@@ -18206,7 +18233,7 @@ var ThumbnailCollage = ({
|
|
|
18206
18233
|
}) => {
|
|
18207
18234
|
const thumbnailArray = import_react101.default.Children.toArray(children);
|
|
18208
18235
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
18209
|
-
const thumbnails = (0,
|
|
18236
|
+
const thumbnails = (0, import_type_guards76.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
18210
18237
|
return import_react101.default.cloneElement(child, {
|
|
18211
18238
|
...child.props,
|
|
18212
18239
|
children: void 0
|
|
@@ -18234,7 +18261,7 @@ var ThumbnailCollage = ({
|
|
|
18234
18261
|
|
|
18235
18262
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
18236
18263
|
var import_styled_components128 = __toESM(require("styled-components"));
|
|
18237
|
-
var
|
|
18264
|
+
var import_type_guards77 = require("@wistia/type-guards");
|
|
18238
18265
|
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
18239
18266
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
18240
18267
|
if (iconOnly) {
|
|
@@ -18347,7 +18374,7 @@ var WistiaLogo = ({
|
|
|
18347
18374
|
...props,
|
|
18348
18375
|
children: [
|
|
18349
18376
|
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)("title", { children: title }),
|
|
18350
|
-
(0,
|
|
18377
|
+
(0, import_type_guards77.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("desc", { children: description }) : null,
|
|
18351
18378
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
18352
18379
|
renderLogotype(logotypeColor, iconOnly)
|
|
18353
18380
|
]
|
|
@@ -18359,7 +18386,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
|
|
|
18359
18386
|
|
|
18360
18387
|
// src/components/SplitButton/SplitButton.tsx
|
|
18361
18388
|
var import_styled_components129 = __toESM(require("styled-components"));
|
|
18362
|
-
var
|
|
18389
|
+
var import_type_guards78 = require("@wistia/type-guards");
|
|
18363
18390
|
var import_react102 = require("react");
|
|
18364
18391
|
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
18365
18392
|
var StyledSplitButton = import_styled_components129.default.span`
|
|
@@ -18406,7 +18433,7 @@ var SplitButton = ({
|
|
|
18406
18433
|
children
|
|
18407
18434
|
}
|
|
18408
18435
|
),
|
|
18409
|
-
(0,
|
|
18436
|
+
(0, import_type_guards78.isNotNil)(menuItems) && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
18410
18437
|
Menu,
|
|
18411
18438
|
{
|
|
18412
18439
|
...menuProps,
|
|
@@ -18425,7 +18452,7 @@ var SplitButton = ({
|
|
|
18425
18452
|
children: menuItems
|
|
18426
18453
|
}
|
|
18427
18454
|
),
|
|
18428
|
-
(0,
|
|
18455
|
+
(0, import_type_guards78.isNotNil)(secondaryAction) && (0, import_react102.cloneElement)(secondaryAction, { disabled, size, unstyled, variant, colorScheme })
|
|
18429
18456
|
] });
|
|
18430
18457
|
};
|
|
18431
18458
|
SplitButton.displayName = "SplitButton_UI";
|