@wistia/ui 0.14.36 → 0.14.37-beta.82ee8b9b.f3a4bf4
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 +203 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +185 -141
- package/dist/index.d.ts +185 -141
- package/dist/index.mjs +90 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.14.
|
|
3
|
+
* @license @wistia/ui v0.14.37-beta.82ee8b9b.f3a4bf4
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -142,6 +142,7 @@ __export(index_exports, {
|
|
|
142
142
|
SelectOption: () => SelectOption,
|
|
143
143
|
SelectOptionGroup: () => SelectOptionGroup,
|
|
144
144
|
Slider: () => Slider,
|
|
145
|
+
SplitButton: () => SplitButton,
|
|
145
146
|
Stack: () => Stack,
|
|
146
147
|
SubMenu: () => SubMenu,
|
|
147
148
|
Switch: () => Switch,
|
|
@@ -7559,6 +7560,7 @@ var Button = (0, import_react23.forwardRef)(
|
|
|
7559
7560
|
type: "button",
|
|
7560
7561
|
...props,
|
|
7561
7562
|
...commonProps,
|
|
7563
|
+
"data-wui-button": true,
|
|
7562
7564
|
children: unstyled ? children : /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
7563
7565
|
ButtonContent,
|
|
7564
7566
|
{
|
|
@@ -11343,14 +11345,14 @@ var Input = (0, import_react47.forwardRef)(
|
|
|
11343
11345
|
if ((0, import_type_guards35.isNil)(leftIcon) && type === "search") {
|
|
11344
11346
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Icon, { type: "search" });
|
|
11345
11347
|
}
|
|
11346
|
-
if ((0, import_type_guards35.isNotNil)(leftIconToDisplay)) {
|
|
11348
|
+
if ((0, import_type_guards35.isNotNil)(leftIconToDisplay) && (0, import_react47.isValidElement)(leftIconToDisplay)) {
|
|
11347
11349
|
leftIconToDisplay = (0, import_react47.cloneElement)(leftIconToDisplay, {
|
|
11348
11350
|
size: "md",
|
|
11349
11351
|
className: "wui-input-left-icon"
|
|
11350
11352
|
});
|
|
11351
11353
|
}
|
|
11352
11354
|
let rightIconToDisplay = rightIcon;
|
|
11353
|
-
if ((0, import_type_guards35.isNotNil)(rightIconToDisplay)) {
|
|
11355
|
+
if ((0, import_type_guards35.isNotNil)(rightIconToDisplay) && (0, import_react47.isValidElement)(rightIconToDisplay)) {
|
|
11354
11356
|
rightIconToDisplay = (0, import_react47.cloneElement)(rightIconToDisplay, {
|
|
11355
11357
|
size: "md",
|
|
11356
11358
|
className: "wui-input-right-icon"
|
|
@@ -12076,6 +12078,7 @@ var Ariakit = __toESM(require("@ariakit/react"));
|
|
|
12076
12078
|
var import_react54 = require("react");
|
|
12077
12079
|
var import_match_sorter = require("match-sorter");
|
|
12078
12080
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
12081
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
12079
12082
|
|
|
12080
12083
|
// src/components/Tag/Tag.tsx
|
|
12081
12084
|
var import_react53 = require("react");
|
|
@@ -12395,7 +12398,8 @@ var extractOptions = (children) => {
|
|
|
12395
12398
|
return options;
|
|
12396
12399
|
};
|
|
12397
12400
|
var defaultDisplayValues = (values, onRemove) => {
|
|
12398
|
-
|
|
12401
|
+
const valueArray = Array.isArray(values) ? values : [values];
|
|
12402
|
+
return valueArray.map((selectedValue) => /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
12399
12403
|
Tag,
|
|
12400
12404
|
{
|
|
12401
12405
|
href: "https://example.com",
|
|
@@ -12436,7 +12440,11 @@ var Combobox2 = ({
|
|
|
12436
12440
|
return () => null;
|
|
12437
12441
|
}, []);
|
|
12438
12442
|
const handleRemoveValue = (valueToRemove) => {
|
|
12439
|
-
|
|
12443
|
+
if ((0, import_type_guards37.isString)(value)) {
|
|
12444
|
+
onChange("");
|
|
12445
|
+
return;
|
|
12446
|
+
}
|
|
12447
|
+
onChange(typeof value === "string" ? "" : value.filter((val) => val !== valueToRemove));
|
|
12440
12448
|
};
|
|
12441
12449
|
const matches = (0, import_react54.useMemo)(() => {
|
|
12442
12450
|
return (0, import_match_sorter.matchSorter)(Object.keys(options), searchValue);
|
|
@@ -12510,12 +12518,12 @@ var Combobox2 = ({
|
|
|
12510
12518
|
};
|
|
12511
12519
|
|
|
12512
12520
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
12513
|
-
var
|
|
12521
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
12514
12522
|
var import_react61 = require("react");
|
|
12515
12523
|
|
|
12516
12524
|
// src/components/Menu/Menu.tsx
|
|
12517
12525
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
12518
|
-
var
|
|
12526
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
12519
12527
|
var import_react56 = require("react");
|
|
12520
12528
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
12521
12529
|
|
|
@@ -12630,7 +12638,7 @@ var Menu = (0, import_react56.forwardRef)(
|
|
|
12630
12638
|
}, ref) => {
|
|
12631
12639
|
const contextValue = (0, import_react56.useMemo)(() => ({ compact }), [compact]);
|
|
12632
12640
|
let controlProps = {
|
|
12633
|
-
...(0,
|
|
12641
|
+
...(0, import_type_guards38.isNotNil)(onOpenChange) && (0, import_type_guards38.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
12634
12642
|
};
|
|
12635
12643
|
if (disabled) {
|
|
12636
12644
|
controlProps = {
|
|
@@ -12644,7 +12652,7 @@ var Menu = (0, import_react56.forwardRef)(
|
|
|
12644
12652
|
modal: false,
|
|
12645
12653
|
...controlProps,
|
|
12646
12654
|
children: [
|
|
12647
|
-
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0,
|
|
12655
|
+
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards38.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
12648
12656
|
Button,
|
|
12649
12657
|
{
|
|
12650
12658
|
ref,
|
|
@@ -12710,12 +12718,12 @@ MenuLabel.displayName = "MenuLabel_UI";
|
|
|
12710
12718
|
var import_react58 = require("react");
|
|
12711
12719
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
12712
12720
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
12713
|
-
var
|
|
12721
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
12714
12722
|
|
|
12715
12723
|
// src/components/Menu/MenuItemButton.tsx
|
|
12716
12724
|
var import_react57 = require("react");
|
|
12717
12725
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
12718
|
-
var
|
|
12726
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
12719
12727
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
12720
12728
|
var StyledButton3 = (0, import_styled_components71.default)(Button)`
|
|
12721
12729
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -12795,7 +12803,7 @@ var StyledBadgeContainer = import_styled_components71.default.div`
|
|
|
12795
12803
|
var MenuItemButton = (0, import_react57.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
12796
12804
|
let { colorScheme, badge } = props;
|
|
12797
12805
|
if (appearance === "dangerous") {
|
|
12798
|
-
if ((0,
|
|
12806
|
+
if ((0, import_type_guards39.isNotUndefined)(colorScheme)) {
|
|
12799
12807
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
12800
12808
|
}
|
|
12801
12809
|
colorScheme = "error";
|
|
@@ -12823,10 +12831,10 @@ var MenuItemButton = (0, import_react57.forwardRef)(({ children, appearance, com
|
|
|
12823
12831
|
fullWidth: true,
|
|
12824
12832
|
unstyled: true,
|
|
12825
12833
|
children: [
|
|
12826
|
-
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
12834
|
+
(0, import_type_guards39.isNotNil)(props.leftIcon) ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
12827
12835
|
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
12828
|
-
(0,
|
|
12829
|
-
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
12836
|
+
(0, import_type_guards39.isNotNil)(badge) || (0, import_type_guards39.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
12837
|
+
(0, import_type_guards39.isNotNil)(props.rightIcon) ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
12830
12838
|
]
|
|
12831
12839
|
}
|
|
12832
12840
|
);
|
|
@@ -12897,7 +12905,7 @@ var SubMenu = ({
|
|
|
12897
12905
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
12898
12906
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
12899
12907
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsx)(MenuItemLabel, { children: label }),
|
|
12900
|
-
(0,
|
|
12908
|
+
(0, import_type_guards40.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(MenuItemDescription, { children: description }) : null
|
|
12901
12909
|
] }),
|
|
12902
12910
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
12903
12911
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -12989,7 +12997,7 @@ RadioMenuItem.displayName = "RadioMenuItem_UI";
|
|
|
12989
12997
|
|
|
12990
12998
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
12991
12999
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
12992
|
-
var
|
|
13000
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
12993
13001
|
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
12994
13002
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
12995
13003
|
return checked ? /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)(
|
|
@@ -13063,8 +13071,8 @@ var CheckboxMenuItem = ({
|
|
|
13063
13071
|
MenuItemButton,
|
|
13064
13072
|
{
|
|
13065
13073
|
...props,
|
|
13066
|
-
leftIcon: (0,
|
|
13067
|
-
rightIcon: (0,
|
|
13074
|
+
leftIcon: (0, import_type_guards41.isNotNil)(props.icon) ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(CheckboxIndicator, { checked }),
|
|
13075
|
+
rightIcon: (0, import_type_guards41.isNotNil)(props.icon) ? /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_react_dropdown_menu7.DropdownMenuItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(Icon, { type: "checkmark" }) }) : void 0
|
|
13068
13076
|
}
|
|
13069
13077
|
)
|
|
13070
13078
|
}
|
|
@@ -13186,7 +13194,7 @@ var ContextMenu = ({
|
|
|
13186
13194
|
const [isRightClicked, setIsRightClicked] = (0, import_react61.useState)(false);
|
|
13187
13195
|
const [menuPosition, setMenuPosition] = (0, import_react61.useState)(position ?? { x: 0, y: 0 });
|
|
13188
13196
|
(0, import_react61.useEffect)(() => {
|
|
13189
|
-
if ((0,
|
|
13197
|
+
if ((0, import_type_guards42.isNil)(position)) {
|
|
13190
13198
|
const onContextMenu = (event) => {
|
|
13191
13199
|
event.preventDefault();
|
|
13192
13200
|
setMenuPosition({ x: event.clientX, y: event.clientY });
|
|
@@ -13200,7 +13208,7 @@ var ContextMenu = ({
|
|
|
13200
13208
|
}
|
|
13201
13209
|
return () => null;
|
|
13202
13210
|
}, [position, triggerRef]);
|
|
13203
|
-
const isOpen = (0,
|
|
13211
|
+
const isOpen = (0, import_type_guards42.isNotNil)(position) || isRightClicked;
|
|
13204
13212
|
return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
13205
13213
|
Menu,
|
|
13206
13214
|
{
|
|
@@ -13235,7 +13243,7 @@ var ContextMenu = ({
|
|
|
13235
13243
|
// src/components/DataCards/DataCard.tsx
|
|
13236
13244
|
var import_react62 = require("react");
|
|
13237
13245
|
var import_styled_components74 = __toESM(require("styled-components"));
|
|
13238
|
-
var
|
|
13246
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
13239
13247
|
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
13240
13248
|
var StyledDataCard = import_styled_components74.default.div`
|
|
13241
13249
|
--wui-data-card-text: var(--wui-color-text-button);
|
|
@@ -13389,8 +13397,8 @@ var DataCardInner = ({
|
|
|
13389
13397
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(StyledLoadingValue, {}) : value
|
|
13390
13398
|
}
|
|
13391
13399
|
),
|
|
13392
|
-
(0,
|
|
13393
|
-
(0,
|
|
13400
|
+
(0, import_type_guards43.isNotNil)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
13401
|
+
(0, import_type_guards43.isNotNil)(subtitle) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
13394
13402
|
StyledSubtitle,
|
|
13395
13403
|
{
|
|
13396
13404
|
"data-wui-data-card-subtitle": true,
|
|
@@ -13398,13 +13406,13 @@ var DataCardInner = ({
|
|
|
13398
13406
|
children: subtitle
|
|
13399
13407
|
}
|
|
13400
13408
|
),
|
|
13401
|
-
(0,
|
|
13409
|
+
(0, import_type_guards43.isNotNil)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
13402
13410
|
]
|
|
13403
13411
|
}
|
|
13404
13412
|
);
|
|
13405
13413
|
var DataCard = (props) => {
|
|
13406
13414
|
const ref = (0, import_react62.useRef)(null);
|
|
13407
|
-
if ((0,
|
|
13415
|
+
if ((0, import_type_guards43.isNotNil)(props.href) || (0, import_type_guards43.isNotNil)(props.onClick)) {
|
|
13408
13416
|
const { "aria-pressed": ariaPressed, ...dataCardProps } = props;
|
|
13409
13417
|
return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
13410
13418
|
DataCardInner,
|
|
@@ -13415,8 +13423,8 @@ var DataCard = (props) => {
|
|
|
13415
13423
|
Button,
|
|
13416
13424
|
{
|
|
13417
13425
|
ref,
|
|
13418
|
-
...(0,
|
|
13419
|
-
...(0,
|
|
13426
|
+
...(0, import_type_guards43.isNotNil)(props.beforeAction) ? { beforeAction: props.beforeAction } : {},
|
|
13427
|
+
...(0, import_type_guards43.isNotNil)(props.reloadDocument) ? { reloadDocument: props.reloadDocument } : {},
|
|
13420
13428
|
"aria-pressed": ariaPressed,
|
|
13421
13429
|
disabled: props.disabled ?? false,
|
|
13422
13430
|
href: props.href,
|
|
@@ -13784,11 +13792,11 @@ var EditableHeading = ({
|
|
|
13784
13792
|
// src/components/EditableText/EditableTextDisplay.tsx
|
|
13785
13793
|
var import_react65 = require("react");
|
|
13786
13794
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
13787
|
-
var
|
|
13795
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
13788
13796
|
|
|
13789
13797
|
// src/components/EditableText/EditableTextRoot.tsx
|
|
13790
13798
|
var import_react64 = require("react");
|
|
13791
|
-
var
|
|
13799
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
13792
13800
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
13793
13801
|
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
13794
13802
|
var StyledEditableTextRoot = import_styled_components81.default.div`
|
|
@@ -13823,7 +13831,7 @@ var EditableTextRoot = ({
|
|
|
13823
13831
|
const [isEditing, setIsEditing] = (0, import_react64.useState)(false);
|
|
13824
13832
|
const value = isControlled ? controlledValue : internalValue;
|
|
13825
13833
|
const generatedId = (0, import_react64.useId)();
|
|
13826
|
-
const computedId = (0,
|
|
13834
|
+
const computedId = (0, import_type_guards44.isNonEmptyString)(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
13827
13835
|
const handleSetIsEditing = (0, import_react64.useCallback)(
|
|
13828
13836
|
(editing) => {
|
|
13829
13837
|
if (editing && !isEditing) {
|
|
@@ -13910,7 +13918,7 @@ var StyledEditableTextDisplay = import_styled_components82.default.div`
|
|
|
13910
13918
|
margin: 0;
|
|
13911
13919
|
transition: all var(--wui-motion-duration-02) var(--wui-motion-ease);
|
|
13912
13920
|
${({ $maxLines }) => {
|
|
13913
|
-
if ((0,
|
|
13921
|
+
if ((0, import_type_guards45.isNotNil)($maxLines)) {
|
|
13914
13922
|
return import_styled_components82.css`
|
|
13915
13923
|
${ellipsisStyle};
|
|
13916
13924
|
${lineClampCss($maxLines)};
|
|
@@ -13918,7 +13926,7 @@ var StyledEditableTextDisplay = import_styled_components82.default.div`
|
|
|
13918
13926
|
}
|
|
13919
13927
|
return void 0;
|
|
13920
13928
|
}}
|
|
13921
|
-
${({ $minLines }) => (0,
|
|
13929
|
+
${({ $minLines }) => (0, import_type_guards45.isNotNil)($minLines) && import_styled_components82.css`
|
|
13922
13930
|
min-height: calc(${$minLines}lh + calc(var(--wui-editable-text-padding) * 2));
|
|
13923
13931
|
`}
|
|
13924
13932
|
word-break: break-word;
|
|
@@ -14005,12 +14013,12 @@ var EditableTextDisplay = makePolymorphic(
|
|
|
14005
14013
|
// src/components/EditableText/EditableTextInput.tsx
|
|
14006
14014
|
var import_react66 = require("react");
|
|
14007
14015
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
14008
|
-
var
|
|
14016
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
14009
14017
|
var import_jsx_runtime277 = require("react/jsx-runtime");
|
|
14010
14018
|
var StyledInput2 = (0, import_styled_components83.default)(Input)`
|
|
14011
14019
|
&& {
|
|
14012
|
-
${({ $minLines }) => (0,
|
|
14013
|
-
${({ $maxLines }) => (0,
|
|
14020
|
+
${({ $minLines }) => (0, import_type_guards46.isNotNil)($minLines) && `min-height: calc(${$minLines}lh + calc(var(--wui-editable-text-padding) * 2));`}
|
|
14021
|
+
${({ $maxLines }) => (0, import_type_guards46.isNotNil)($maxLines) && `max-height: calc(${$maxLines}lh + calc(var(--wui-editable-text-padding) * 2));`}
|
|
14014
14022
|
${({ $typographicVariant }) => getTypographicStyles($typographicVariant)}
|
|
14015
14023
|
background-color: var(--wui-color-bg-surface);
|
|
14016
14024
|
border-radius: var(--wui-editable-text-border-radius);
|
|
@@ -14267,7 +14275,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
14267
14275
|
|
|
14268
14276
|
// src/components/Form/FormErrorSummary.tsx
|
|
14269
14277
|
var import_react72 = require("react");
|
|
14270
|
-
var
|
|
14278
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
14271
14279
|
var import_jsx_runtime280 = require("react/jsx-runtime");
|
|
14272
14280
|
var ErrorItem = ({ name, error, formId }) => {
|
|
14273
14281
|
return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
@@ -14281,8 +14289,8 @@ var FormErrorSummary = ({ description }) => {
|
|
|
14281
14289
|
}
|
|
14282
14290
|
return /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)("div", { ref, children: [
|
|
14283
14291
|
/* @__PURE__ */ (0, import_jsx_runtime280.jsx)("p", { children: description }),
|
|
14284
|
-
/* @__PURE__ */ (0, import_jsx_runtime280.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0,
|
|
14285
|
-
([name, error]) => (0,
|
|
14292
|
+
/* @__PURE__ */ (0, import_jsx_runtime280.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards47.isNotUndefined)(error)).map(
|
|
14293
|
+
([name, error]) => (0, import_type_guards47.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(
|
|
14286
14294
|
ErrorItem,
|
|
14287
14295
|
{
|
|
14288
14296
|
error: err,
|
|
@@ -14306,7 +14314,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
14306
14314
|
// src/components/FormField/FormField.tsx
|
|
14307
14315
|
var import_react73 = require("react");
|
|
14308
14316
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
14309
|
-
var
|
|
14317
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
14310
14318
|
var import_jsx_runtime281 = require("react/jsx-runtime");
|
|
14311
14319
|
var StyledFormField = import_styled_components84.default.div`
|
|
14312
14320
|
--form-field-spacing: var(--wui-space-01);
|
|
@@ -14347,7 +14355,7 @@ var StyledErrorList = import_styled_components84.default.ul`
|
|
|
14347
14355
|
gap: var(--wui-space-01);
|
|
14348
14356
|
`;
|
|
14349
14357
|
var ErrorMessages = ({ errors, id }) => {
|
|
14350
|
-
const isErrorArray = (0,
|
|
14358
|
+
const isErrorArray = (0, import_type_guards48.isArray)(errors);
|
|
14351
14359
|
const isMultipleErrors = isErrorArray && errors.length > 1;
|
|
14352
14360
|
if (!isErrorArray) {
|
|
14353
14361
|
return /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(
|
|
@@ -14415,19 +14423,19 @@ var FormField = ({
|
|
|
14415
14423
|
"aria-describedby": ariaDescribedby,
|
|
14416
14424
|
...props
|
|
14417
14425
|
};
|
|
14418
|
-
if ((0,
|
|
14426
|
+
if ((0, import_type_guards48.isUndefined)(value) && (0, import_type_guards48.isNotUndefined)(defaultValue)) {
|
|
14419
14427
|
childProps = {
|
|
14420
14428
|
...childProps,
|
|
14421
14429
|
defaultValue
|
|
14422
14430
|
};
|
|
14423
14431
|
}
|
|
14424
|
-
if ((0,
|
|
14425
|
-
const computedName = (0,
|
|
14432
|
+
if ((0, import_type_guards48.isNotNil)(checkboxGroup)) {
|
|
14433
|
+
const computedName = (0, import_type_guards48.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
14426
14434
|
const handleChange = (event) => {
|
|
14427
|
-
if ((0,
|
|
14435
|
+
if ((0, import_type_guards48.isNotUndefined)(props.onChange)) {
|
|
14428
14436
|
props.onChange(event);
|
|
14429
14437
|
}
|
|
14430
|
-
if ((0,
|
|
14438
|
+
if ((0, import_type_guards48.isNotUndefined)(checkboxGroup.onChange)) {
|
|
14431
14439
|
checkboxGroup.onChange(event);
|
|
14432
14440
|
}
|
|
14433
14441
|
};
|
|
@@ -14435,7 +14443,7 @@ var FormField = ({
|
|
|
14435
14443
|
...childProps,
|
|
14436
14444
|
name: computedName,
|
|
14437
14445
|
onChange: handleChange,
|
|
14438
|
-
"aria-invalid": (0,
|
|
14446
|
+
"aria-invalid": (0, import_type_guards48.isNotNil)(error)
|
|
14439
14447
|
};
|
|
14440
14448
|
}
|
|
14441
14449
|
import_react73.Children.only(children);
|
|
@@ -14446,9 +14454,9 @@ var FormField = ({
|
|
|
14446
14454
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
14447
14455
|
children: [
|
|
14448
14456
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
14449
|
-
(0,
|
|
14457
|
+
(0, import_type_guards48.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
14450
14458
|
(0, import_react73.cloneElement)(children, childProps),
|
|
14451
|
-
(0,
|
|
14459
|
+
(0, import_type_guards48.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(import_jsx_runtime281.Fragment, { children: [
|
|
14452
14460
|
/* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", {}),
|
|
14453
14461
|
/* @__PURE__ */ (0, import_jsx_runtime281.jsx)(
|
|
14454
14462
|
ErrorMessages,
|
|
@@ -14494,7 +14502,7 @@ RadioGroup.displayName = "RadioGroup_UI";
|
|
|
14494
14502
|
// src/components/Grid/Grid.tsx
|
|
14495
14503
|
var import_react75 = require("react");
|
|
14496
14504
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
14497
|
-
var
|
|
14505
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
14498
14506
|
var import_jsx_runtime283 = require("react/jsx-runtime");
|
|
14499
14507
|
var DEFAULT_ELEMENT5 = "div";
|
|
14500
14508
|
var getGridTemplateColumns = (maxColumns, minChildWidth, expandItems) => {
|
|
@@ -14544,7 +14552,7 @@ var GridComponent = (0, import_react75.forwardRef)(
|
|
|
14544
14552
|
...props
|
|
14545
14553
|
}, ref) => {
|
|
14546
14554
|
const responsiveGap = useResponsiveProp(gap);
|
|
14547
|
-
const { column, row } = (0,
|
|
14555
|
+
const { column, row } = (0, import_type_guards49.isRecord)(responsiveGap) ? responsiveGap : { column: responsiveGap, row: responsiveGap };
|
|
14548
14556
|
const responsiveColumns = useResponsiveProp(columns);
|
|
14549
14557
|
const responsiveMinChildWidth = useResponsiveProp(minChildWidth);
|
|
14550
14558
|
return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
@@ -14569,7 +14577,7 @@ var Grid = makePolymorphic(GridComponent);
|
|
|
14569
14577
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
14570
14578
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
14571
14579
|
var import_react76 = require("react");
|
|
14572
|
-
var
|
|
14580
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
14573
14581
|
var import_jsx_runtime284 = require("react/jsx-runtime");
|
|
14574
14582
|
var StyledIconButton = (0, import_styled_components86.default)(IconButton)`
|
|
14575
14583
|
/* override size for icon button since prop gets changed by Input */
|
|
@@ -14599,12 +14607,12 @@ var InputClickToCopy = (0, import_react76.forwardRef)(
|
|
|
14599
14607
|
if (disabled) {
|
|
14600
14608
|
return;
|
|
14601
14609
|
}
|
|
14602
|
-
if ((0,
|
|
14610
|
+
if ((0, import_type_guards50.isFunction)(props.onClick)) {
|
|
14603
14611
|
props.onClick(event);
|
|
14604
14612
|
}
|
|
14605
14613
|
void copyToClipboard(value).then(() => {
|
|
14606
14614
|
setIsCopied(true);
|
|
14607
|
-
if ((0,
|
|
14615
|
+
if ((0, import_type_guards50.isFunction)(onCopy)) {
|
|
14608
14616
|
onCopy(value);
|
|
14609
14617
|
}
|
|
14610
14618
|
return value;
|
|
@@ -14639,7 +14647,7 @@ InputClickToCopy.displayName = "InputClickToCopy_UI";
|
|
|
14639
14647
|
// src/components/InputPassword/InputPassword.tsx
|
|
14640
14648
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
14641
14649
|
var import_react77 = require("react");
|
|
14642
|
-
var
|
|
14650
|
+
var import_type_guards51 = require("@wistia/type-guards");
|
|
14643
14651
|
var import_jsx_runtime285 = require("react/jsx-runtime");
|
|
14644
14652
|
var StyledIconButton2 = (0, import_styled_components87.default)(IconButton)`
|
|
14645
14653
|
/* override size for icon button since prop gets changed by Input */
|
|
@@ -14655,7 +14663,7 @@ var InputPassword = (0, import_react77.forwardRef)(
|
|
|
14655
14663
|
const handleClick = () => {
|
|
14656
14664
|
const newVisibility = !isVisible;
|
|
14657
14665
|
setIsVisible(newVisibility);
|
|
14658
|
-
if ((0,
|
|
14666
|
+
if ((0, import_type_guards51.isFunction)(onVisibilityToggle)) {
|
|
14659
14667
|
onVisibilityToggle(newVisibility);
|
|
14660
14668
|
}
|
|
14661
14669
|
};
|
|
@@ -14685,7 +14693,7 @@ InputPassword.displayName = "InputPassword_UI";
|
|
|
14685
14693
|
|
|
14686
14694
|
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
14687
14695
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
14688
|
-
var
|
|
14696
|
+
var import_type_guards52 = require("@wistia/type-guards");
|
|
14689
14697
|
var import_jsx_runtime286 = require("react/jsx-runtime");
|
|
14690
14698
|
var StyledKeyboardShortcut = import_styled_components88.default.div`
|
|
14691
14699
|
align-items: center;
|
|
@@ -14779,7 +14787,7 @@ var KeyboardShortcut = ({
|
|
|
14779
14787
|
$fullWidth: fullWidth,
|
|
14780
14788
|
...otherProps,
|
|
14781
14789
|
children: [
|
|
14782
|
-
(0,
|
|
14790
|
+
(0, import_type_guards52.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(Label2, { children: label }),
|
|
14783
14791
|
/* @__PURE__ */ (0, import_jsx_runtime286.jsx)(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
|
|
14784
14792
|
StyledKey,
|
|
14785
14793
|
{
|
|
@@ -14793,18 +14801,18 @@ var KeyboardShortcut = ({
|
|
|
14793
14801
|
KeyboardShortcut.displayName = "KeyboardShortcut_UI";
|
|
14794
14802
|
|
|
14795
14803
|
// src/components/List/List.tsx
|
|
14796
|
-
var
|
|
14804
|
+
var import_type_guards54 = require("@wistia/type-guards");
|
|
14797
14805
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
14798
14806
|
|
|
14799
14807
|
// src/components/List/ListItem.tsx
|
|
14800
14808
|
var import_styled_components89 = __toESM(require("styled-components"));
|
|
14801
|
-
var
|
|
14809
|
+
var import_type_guards53 = require("@wistia/type-guards");
|
|
14802
14810
|
var import_jsx_runtime287 = require("react/jsx-runtime");
|
|
14803
14811
|
var ListItemComponent = import_styled_components89.default.li`
|
|
14804
14812
|
margin-bottom: var(--wui-space-02);
|
|
14805
14813
|
`;
|
|
14806
14814
|
var ListItem = ({ children }) => {
|
|
14807
|
-
if ((0,
|
|
14815
|
+
if ((0, import_type_guards53.isNil)(children)) {
|
|
14808
14816
|
return null;
|
|
14809
14817
|
}
|
|
14810
14818
|
return /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(ListItemComponent, { children });
|
|
@@ -14934,13 +14942,13 @@ var List = ({
|
|
|
14934
14942
|
...otherProps
|
|
14935
14943
|
}) => {
|
|
14936
14944
|
const listVariant = variant ?? "bullets";
|
|
14937
|
-
if ((0,
|
|
14945
|
+
if ((0, import_type_guards54.isNotNil)(children)) {
|
|
14938
14946
|
if (Array.isArray(children) && !children.length) {
|
|
14939
14947
|
return null;
|
|
14940
14948
|
}
|
|
14941
14949
|
return renderListComponent(children, listVariant, otherProps);
|
|
14942
14950
|
}
|
|
14943
|
-
if ((0,
|
|
14951
|
+
if ((0, import_type_guards54.isNotNil)(items)) {
|
|
14944
14952
|
if (!items.length) {
|
|
14945
14953
|
return null;
|
|
14946
14954
|
}
|
|
@@ -14975,7 +14983,7 @@ Mark.displayName = "Mark_UI";
|
|
|
14975
14983
|
var import_react80 = require("react");
|
|
14976
14984
|
var import_styled_components96 = __toESM(require("styled-components"));
|
|
14977
14985
|
var import_react_dialog5 = require("@radix-ui/react-dialog");
|
|
14978
|
-
var
|
|
14986
|
+
var import_type_guards56 = require("@wistia/type-guards");
|
|
14979
14987
|
|
|
14980
14988
|
// src/components/Modal/ModalHeader.tsx
|
|
14981
14989
|
var import_styled_components93 = __toESM(require("styled-components"));
|
|
@@ -15052,7 +15060,7 @@ var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
|
15052
15060
|
|
|
15053
15061
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
15054
15062
|
var import_react78 = require("react");
|
|
15055
|
-
var
|
|
15063
|
+
var import_type_guards55 = require("@wistia/type-guards");
|
|
15056
15064
|
var useFocusRestore = () => {
|
|
15057
15065
|
const previouslyFocusedRef = (0, import_react78.useRef)(null);
|
|
15058
15066
|
(0, import_react78.useEffect)(() => {
|
|
@@ -15060,7 +15068,7 @@ var useFocusRestore = () => {
|
|
|
15060
15068
|
}, []);
|
|
15061
15069
|
(0, import_react78.useEffect)(() => {
|
|
15062
15070
|
return () => {
|
|
15063
|
-
if ((0,
|
|
15071
|
+
if ((0, import_type_guards55.isNotNil)(previouslyFocusedRef.current)) {
|
|
15064
15072
|
setTimeout(() => {
|
|
15065
15073
|
previouslyFocusedRef.current?.focus();
|
|
15066
15074
|
}, 0);
|
|
@@ -15272,7 +15280,7 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15272
15280
|
import_react_dialog5.Root,
|
|
15273
15281
|
{
|
|
15274
15282
|
onOpenChange: (open2) => {
|
|
15275
|
-
if (!open2 && (0,
|
|
15283
|
+
if (!open2 && (0, import_type_guards56.isNotNil)(onRequestClose)) {
|
|
15276
15284
|
onRequestClose();
|
|
15277
15285
|
}
|
|
15278
15286
|
},
|
|
@@ -15284,7 +15292,7 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15284
15292
|
{
|
|
15285
15293
|
ref,
|
|
15286
15294
|
onOpenAutoFocus: (event) => {
|
|
15287
|
-
if ((0,
|
|
15295
|
+
if ((0, import_type_guards56.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
15288
15296
|
event.preventDefault();
|
|
15289
15297
|
requestAnimationFrame(() => {
|
|
15290
15298
|
initialFocusRef.current?.focus();
|
|
@@ -15319,9 +15327,9 @@ var import_react_popover5 = require("@radix-ui/react-popover");
|
|
|
15319
15327
|
var import_styled_components98 = __toESM(require("styled-components"));
|
|
15320
15328
|
|
|
15321
15329
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
15322
|
-
var
|
|
15330
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
15323
15331
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
15324
|
-
return (0,
|
|
15332
|
+
return (0, import_type_guards57.isNotNil)(onOpenChange) && (0, import_type_guards57.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
15325
15333
|
};
|
|
15326
15334
|
|
|
15327
15335
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -15477,7 +15485,7 @@ Popover.displayName = "Popover_UI";
|
|
|
15477
15485
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
15478
15486
|
var import_styled_components99 = __toESM(require("styled-components"));
|
|
15479
15487
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
15480
|
-
var
|
|
15488
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
15481
15489
|
var import_jsx_runtime296 = require("react/jsx-runtime");
|
|
15482
15490
|
var ProgressBarWrapper = import_styled_components99.default.div`
|
|
15483
15491
|
--progress-bar-height: 8px;
|
|
@@ -15533,7 +15541,7 @@ var ProgressBar = ({
|
|
|
15533
15541
|
...props
|
|
15534
15542
|
}) => {
|
|
15535
15543
|
return /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(ProgressBarWrapper, { children: [
|
|
15536
|
-
(0,
|
|
15544
|
+
(0, import_type_guards58.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
15537
15545
|
/* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
|
|
15538
15546
|
StyledProgressBar,
|
|
15539
15547
|
{
|
|
@@ -15551,13 +15559,13 @@ var ProgressBar = ({
|
|
|
15551
15559
|
)
|
|
15552
15560
|
}
|
|
15553
15561
|
),
|
|
15554
|
-
(0,
|
|
15562
|
+
(0, import_type_guards58.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
15555
15563
|
] });
|
|
15556
15564
|
};
|
|
15557
15565
|
ProgressBar.displayName = "ProgressBar_UI";
|
|
15558
15566
|
|
|
15559
15567
|
// src/components/Radio/Radio.tsx
|
|
15560
|
-
var
|
|
15568
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
15561
15569
|
var import_react81 = require("react");
|
|
15562
15570
|
var import_styled_components100 = __toESM(require("styled-components"));
|
|
15563
15571
|
var import_jsx_runtime297 = require("react/jsx-runtime");
|
|
@@ -15657,14 +15665,14 @@ var Radio = (0, import_react81.forwardRef)(
|
|
|
15657
15665
|
...props
|
|
15658
15666
|
}, ref) => {
|
|
15659
15667
|
const generatedId = (0, import_react81.useId)();
|
|
15660
|
-
const computedId = (0,
|
|
15668
|
+
const computedId = (0, import_type_guards59.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
15661
15669
|
const radioGroupContext = useRadioGroup();
|
|
15662
15670
|
const contextName = radioGroupContext?.name;
|
|
15663
15671
|
const contextOnChange = radioGroupContext?.onChange;
|
|
15664
15672
|
const contextValue = radioGroupContext?.value;
|
|
15665
15673
|
const radioName = name ?? contextName;
|
|
15666
15674
|
const handleOnChange = onChange ?? contextOnChange;
|
|
15667
|
-
const isChecked = (0,
|
|
15675
|
+
const isChecked = (0, import_type_guards59.isNotUndefined)(value) && (0, import_type_guards59.isNotUndefined)(contextValue) ? contextValue === value : checked;
|
|
15668
15676
|
return /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)(
|
|
15669
15677
|
StyledRadioWrapper,
|
|
15670
15678
|
{
|
|
@@ -15711,7 +15719,7 @@ var import_react83 = require("react");
|
|
|
15711
15719
|
// src/components/RadioCard/RadioCardRoot.tsx
|
|
15712
15720
|
var import_react82 = require("react");
|
|
15713
15721
|
var import_styled_components101 = __toESM(require("styled-components"));
|
|
15714
|
-
var
|
|
15722
|
+
var import_type_guards60 = require("@wistia/type-guards");
|
|
15715
15723
|
var import_jsx_runtime298 = require("react/jsx-runtime");
|
|
15716
15724
|
var checkedStyles = import_styled_components101.css`
|
|
15717
15725
|
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
@@ -15833,14 +15841,14 @@ var RadioCardRoot = (0, import_react82.forwardRef)(
|
|
|
15833
15841
|
...props
|
|
15834
15842
|
}, ref) => {
|
|
15835
15843
|
const generatedId = (0, import_react82.useId)();
|
|
15836
|
-
const computedId = (0,
|
|
15844
|
+
const computedId = (0, import_type_guards60.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
15837
15845
|
const radioGroupContext = useRadioGroup();
|
|
15838
15846
|
const contextName = radioGroupContext?.name;
|
|
15839
15847
|
const contextOnChange = radioGroupContext?.onChange;
|
|
15840
15848
|
const contextValue = radioGroupContext?.value;
|
|
15841
15849
|
const radioName = name ?? contextName;
|
|
15842
15850
|
const handleOnChange = onChange ?? contextOnChange;
|
|
15843
|
-
const isChecked = (0,
|
|
15851
|
+
const isChecked = (0, import_type_guards60.isNotUndefined)(value) && (0, import_type_guards60.isNotUndefined)(contextValue) ? contextValue === value : checked;
|
|
15844
15852
|
return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)(
|
|
15845
15853
|
StyledCard2,
|
|
15846
15854
|
{
|
|
@@ -15872,7 +15880,7 @@ RadioCardRoot.displayName = "RadioCardRoot_UI";
|
|
|
15872
15880
|
|
|
15873
15881
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
15874
15882
|
var import_styled_components103 = __toESM(require("styled-components"));
|
|
15875
|
-
var
|
|
15883
|
+
var import_type_guards61 = require("@wistia/type-guards");
|
|
15876
15884
|
|
|
15877
15885
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
15878
15886
|
var import_styled_components102 = __toESM(require("styled-components"));
|
|
@@ -15946,17 +15954,17 @@ var RadioCardDefaultLayout = ({
|
|
|
15946
15954
|
showIndicator = true
|
|
15947
15955
|
}) => {
|
|
15948
15956
|
return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)(StyledCardContent, { children: [
|
|
15949
|
-
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(StyledIndicatorContainer, { $hasIcon: (0,
|
|
15957
|
+
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(StyledIndicatorContainer, { $hasIcon: (0, import_type_guards61.isNotNil)(icon), children: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" }) }) : null,
|
|
15950
15958
|
/* @__PURE__ */ (0, import_jsx_runtime299.jsxs)(Stack, { gap: "space-02", children: [
|
|
15951
|
-
(0,
|
|
15959
|
+
(0, import_type_guards61.isNotNil)(icon) && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
15952
15960
|
/* @__PURE__ */ (0, import_jsx_runtime299.jsxs)(
|
|
15953
15961
|
Stack,
|
|
15954
15962
|
{
|
|
15955
15963
|
gap: "space-01",
|
|
15956
|
-
style: (0,
|
|
15964
|
+
style: (0, import_type_guards61.isNotNil)(icon) ? { paddingLeft: 2 } : void 0,
|
|
15957
15965
|
children: [
|
|
15958
|
-
(0,
|
|
15959
|
-
(0,
|
|
15966
|
+
(0, import_type_guards61.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(Text, { variant: "label3", children: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("strong", { children: label }) }),
|
|
15967
|
+
(0, import_type_guards61.isNotNil)(description) && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
|
|
15960
15968
|
Text,
|
|
15961
15969
|
{
|
|
15962
15970
|
prominence: "secondary",
|
|
@@ -16138,7 +16146,7 @@ ScrollArea.displayName = "ScrollArea_UI";
|
|
|
16138
16146
|
var import_react88 = require("react");
|
|
16139
16147
|
var import_styled_components107 = __toESM(require("styled-components"));
|
|
16140
16148
|
var import_react_toggle_group3 = require("@radix-ui/react-toggle-group");
|
|
16141
|
-
var
|
|
16149
|
+
var import_type_guards63 = require("@wistia/type-guards");
|
|
16142
16150
|
|
|
16143
16151
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
16144
16152
|
var import_react86 = require("react");
|
|
@@ -16175,7 +16183,7 @@ var useSelectedItemStyle = () => {
|
|
|
16175
16183
|
|
|
16176
16184
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
16177
16185
|
var import_styled_components106 = __toESM(require("styled-components"));
|
|
16178
|
-
var
|
|
16186
|
+
var import_type_guards62 = require("@wistia/type-guards");
|
|
16179
16187
|
|
|
16180
16188
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
16181
16189
|
var import_react87 = require("react");
|
|
@@ -16209,7 +16217,7 @@ var SelectedItemIndicatorDiv = import_styled_components106.default.div`
|
|
|
16209
16217
|
var SelectedItemIndicator = () => {
|
|
16210
16218
|
const selectedValue = useSegmentedControlValue();
|
|
16211
16219
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
16212
|
-
if (!selectedValue || (0,
|
|
16220
|
+
if (!selectedValue || (0, import_type_guards62.isUndefined)(selectedItemIndicatorStyle)) {
|
|
16213
16221
|
return null;
|
|
16214
16222
|
}
|
|
16215
16223
|
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
|
|
@@ -16246,7 +16254,7 @@ var SegmentedControl = (0, import_react88.forwardRef)(
|
|
|
16246
16254
|
onSelectedValueChange,
|
|
16247
16255
|
...props
|
|
16248
16256
|
}, ref) => {
|
|
16249
|
-
if ((0,
|
|
16257
|
+
if ((0, import_type_guards63.isNil)(children)) {
|
|
16250
16258
|
return null;
|
|
16251
16259
|
}
|
|
16252
16260
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
@@ -16275,7 +16283,7 @@ SegmentedControl.displayName = "SegmentedControl_UI";
|
|
|
16275
16283
|
var import_react89 = require("react");
|
|
16276
16284
|
var import_styled_components108 = __toESM(require("styled-components"));
|
|
16277
16285
|
var import_react_toggle_group4 = require("@radix-ui/react-toggle-group");
|
|
16278
|
-
var
|
|
16286
|
+
var import_type_guards64 = require("@wistia/type-guards");
|
|
16279
16287
|
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
16280
16288
|
var segmentedControlItemStyles = import_styled_components108.css`
|
|
16281
16289
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -16391,8 +16399,8 @@ var SegmentedControlItem = (0, import_react89.forwardRef)(
|
|
|
16391
16399
|
{
|
|
16392
16400
|
ref: combinedRef,
|
|
16393
16401
|
...otherProps,
|
|
16394
|
-
$hasLabel: (0,
|
|
16395
|
-
"aria-label": (0,
|
|
16402
|
+
$hasLabel: (0, import_type_guards64.isNotNil)(label),
|
|
16403
|
+
"aria-label": (0, import_type_guards64.isNotNil)(label) ? void 0 : ariaLabel,
|
|
16396
16404
|
disabled,
|
|
16397
16405
|
onClick: handleClick,
|
|
16398
16406
|
value,
|
|
@@ -16531,7 +16539,7 @@ Select.displayName = "Select_UI";
|
|
|
16531
16539
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
16532
16540
|
var import_react91 = require("react");
|
|
16533
16541
|
var import_styled_components110 = __toESM(require("styled-components"));
|
|
16534
|
-
var
|
|
16542
|
+
var import_type_guards65 = require("@wistia/type-guards");
|
|
16535
16543
|
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
16536
16544
|
var StyledItem = (0, import_styled_components110.default)(import_react_select2.Item)`
|
|
16537
16545
|
${getTypographicStyles("label3")}
|
|
@@ -16565,7 +16573,7 @@ var SelectOption = (0, import_react91.forwardRef)(
|
|
|
16565
16573
|
...props,
|
|
16566
16574
|
ref: forwardedRef,
|
|
16567
16575
|
children: [
|
|
16568
|
-
(0,
|
|
16576
|
+
(0, import_type_guards65.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)("div", { children: [
|
|
16569
16577
|
children,
|
|
16570
16578
|
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
16571
16579
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(import_react_select2.ItemText, { children }),
|
|
@@ -16607,7 +16615,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
16607
16615
|
// src/components/Slider/Slider.tsx
|
|
16608
16616
|
var import_react_slider2 = require("@radix-ui/react-slider");
|
|
16609
16617
|
var import_styled_components112 = __toESM(require("styled-components"));
|
|
16610
|
-
var
|
|
16618
|
+
var import_type_guards66 = require("@wistia/type-guards");
|
|
16611
16619
|
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
16612
16620
|
var SliderContainer = import_styled_components112.default.div`
|
|
16613
16621
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -16686,7 +16694,7 @@ var Slider = ({
|
|
|
16686
16694
|
"data-testid": dataTestId = "ui-slider",
|
|
16687
16695
|
...otherProps
|
|
16688
16696
|
}) => {
|
|
16689
|
-
if (!((0,
|
|
16697
|
+
if (!((0, import_type_guards66.isNonEmptyString)(ariaLabel) || (0, import_type_guards66.isNonEmptyString)(ariaLabelledby))) {
|
|
16690
16698
|
throw new Error(
|
|
16691
16699
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
16692
16700
|
);
|
|
@@ -16848,7 +16856,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
16848
16856
|
// src/components/Tabs/Tabs.tsx
|
|
16849
16857
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
16850
16858
|
var import_react98 = require("react");
|
|
16851
|
-
var
|
|
16859
|
+
var import_type_guards67 = require("@wistia/type-guards");
|
|
16852
16860
|
|
|
16853
16861
|
// src/components/Tabs/useTabsValue.tsx
|
|
16854
16862
|
var import_react97 = require("react");
|
|
@@ -16885,10 +16893,10 @@ var Tabs = ({
|
|
|
16885
16893
|
...props,
|
|
16886
16894
|
onValueChange
|
|
16887
16895
|
};
|
|
16888
|
-
if ((0,
|
|
16896
|
+
if ((0, import_type_guards67.isNotNil)(value)) {
|
|
16889
16897
|
rootProps.value = value;
|
|
16890
16898
|
}
|
|
16891
|
-
if ((0,
|
|
16899
|
+
if ((0, import_type_guards67.isNotNil)(defaultValue)) {
|
|
16892
16900
|
rootProps.defaultValue = defaultValue;
|
|
16893
16901
|
}
|
|
16894
16902
|
return /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(import_react_tabs.Root, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -16908,7 +16916,7 @@ var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
|
16908
16916
|
var import_styled_components120 = __toESM(require("styled-components"));
|
|
16909
16917
|
|
|
16910
16918
|
// src/components/Tabs/SelectedTabIndicator.tsx
|
|
16911
|
-
var
|
|
16919
|
+
var import_type_guards68 = require("@wistia/type-guards");
|
|
16912
16920
|
|
|
16913
16921
|
// src/components/Tabs/TabsSelectedItemIndicatorDiv.tsx
|
|
16914
16922
|
var import_styled_components119 = __toESM(require("styled-components"));
|
|
@@ -16923,7 +16931,7 @@ var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
|
16923
16931
|
var SelectedTabIndicator = () => {
|
|
16924
16932
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
16925
16933
|
const selectedValue = useTabsValue();
|
|
16926
|
-
if (selectedValue == null || (0,
|
|
16934
|
+
if (selectedValue == null || (0, import_type_guards68.isUndefined)(selectedItemIndicatorStyle)) {
|
|
16927
16935
|
return null;
|
|
16928
16936
|
}
|
|
16929
16937
|
return /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
@@ -16957,7 +16965,7 @@ TabsList.displayName = "TabsList_UI";
|
|
|
16957
16965
|
|
|
16958
16966
|
// src/components/Tabs/TabsTrigger.tsx
|
|
16959
16967
|
var import_react99 = require("react");
|
|
16960
|
-
var
|
|
16968
|
+
var import_type_guards69 = require("@wistia/type-guards");
|
|
16961
16969
|
|
|
16962
16970
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
16963
16971
|
var import_styled_components121 = __toESM(require("styled-components"));
|
|
@@ -17008,8 +17016,8 @@ var TabsTrigger = (0, import_react99.forwardRef)(
|
|
|
17008
17016
|
{
|
|
17009
17017
|
...otherProps,
|
|
17010
17018
|
ref: combinedRef,
|
|
17011
|
-
$hasLabel: (0,
|
|
17012
|
-
"aria-label": (0,
|
|
17019
|
+
$hasLabel: (0, import_type_guards69.isNotNil)(label),
|
|
17020
|
+
"aria-label": (0, import_type_guards69.isNotNil)(label) ? void 0 : ariaLabel,
|
|
17013
17021
|
disabled,
|
|
17014
17022
|
value,
|
|
17015
17023
|
children: [
|
|
@@ -17024,7 +17032,7 @@ TabsTrigger.displayName = "TabsTrigger_UI";
|
|
|
17024
17032
|
|
|
17025
17033
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
17026
17034
|
var import_styled_components122 = __toESM(require("styled-components"));
|
|
17027
|
-
var
|
|
17035
|
+
var import_type_guards70 = require("@wistia/type-guards");
|
|
17028
17036
|
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
17029
17037
|
var StyledThumbnailBadge = import_styled_components122.default.div`
|
|
17030
17038
|
align-items: center;
|
|
@@ -17053,7 +17061,7 @@ var StyledThumbnailBadge = import_styled_components122.default.div`
|
|
|
17053
17061
|
`;
|
|
17054
17062
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
17055
17063
|
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
17056
|
-
(0,
|
|
17064
|
+
(0, import_type_guards70.isNotNil)(icon) && icon,
|
|
17057
17065
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("span", { children: label })
|
|
17058
17066
|
] });
|
|
17059
17067
|
};
|
|
@@ -17062,10 +17070,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
|
17062
17070
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17063
17071
|
var import_react100 = require("react");
|
|
17064
17072
|
var import_styled_components125 = __toESM(require("styled-components"));
|
|
17065
|
-
var
|
|
17073
|
+
var import_type_guards73 = require("@wistia/type-guards");
|
|
17066
17074
|
|
|
17067
17075
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
17068
|
-
var
|
|
17076
|
+
var import_type_guards71 = require("@wistia/type-guards");
|
|
17069
17077
|
var import_styled_components123 = require("styled-components");
|
|
17070
17078
|
var gradients = {
|
|
17071
17079
|
defaultDarkOne: import_styled_components123.css`
|
|
@@ -17193,12 +17201,12 @@ var gradients = {
|
|
|
17193
17201
|
};
|
|
17194
17202
|
var gradientMap = Object.keys(gradients);
|
|
17195
17203
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
17196
|
-
return (0,
|
|
17204
|
+
return (0, import_type_guards71.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
17197
17205
|
};
|
|
17198
17206
|
|
|
17199
17207
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
17200
17208
|
var import_styled_components124 = __toESM(require("styled-components"));
|
|
17201
|
-
var
|
|
17209
|
+
var import_type_guards72 = require("@wistia/type-guards");
|
|
17202
17210
|
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
17203
17211
|
var ScrubLine = import_styled_components124.default.div`
|
|
17204
17212
|
position: absolute;
|
|
@@ -17292,8 +17300,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17292
17300
|
);
|
|
17293
17301
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
17294
17302
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
17295
|
-
const showScrubLine = (0,
|
|
17296
|
-
const scrubLinePosition = (0,
|
|
17303
|
+
const showScrubLine = (0, import_type_guards72.isNotNil)(cursorPosition);
|
|
17304
|
+
const scrubLinePosition = (0, import_type_guards72.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
17297
17305
|
const viewerStyles = {
|
|
17298
17306
|
position: "relative",
|
|
17299
17307
|
overflow: "hidden",
|
|
@@ -17364,10 +17372,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
17364
17372
|
);
|
|
17365
17373
|
};
|
|
17366
17374
|
var StyledThumbnail = import_styled_components125.default.div`
|
|
17367
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
17375
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards73.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
17368
17376
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
17369
17377
|
// if we don't have $backgroundUrl show a gradient
|
|
17370
|
-
(0,
|
|
17378
|
+
(0, import_type_guards73.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
17371
17379
|
)};
|
|
17372
17380
|
background-position: center center;
|
|
17373
17381
|
background-size: cover;
|
|
@@ -17409,10 +17417,10 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
17409
17417
|
const storyboardElementRef = (0, import_react100.useRef)(null);
|
|
17410
17418
|
const [cursorPosition, setCursorPosition] = (0, import_react100.useState)(null);
|
|
17411
17419
|
const backgroundUrl = (0, import_react100.useMemo)(
|
|
17412
|
-
() => thumbnailImageType === "square" && (0,
|
|
17420
|
+
() => thumbnailImageType === "square" && (0, import_type_guards73.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
17413
17421
|
[thumbnailImageType, thumbnailUrl]
|
|
17414
17422
|
);
|
|
17415
|
-
const isScrubbable = (0,
|
|
17423
|
+
const isScrubbable = (0, import_type_guards73.isNotNil)(storyboard);
|
|
17416
17424
|
const trackStoryboardLoadStatus = (0, import_react100.useCallback)(() => {
|
|
17417
17425
|
if (storyboardElementRef.current || !storyboard) {
|
|
17418
17426
|
return storyboardElementRef.current;
|
|
@@ -17445,7 +17453,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
17445
17453
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
17446
17454
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
17447
17455
|
const renderStoryboard = (0, import_react100.useCallback)(() => {
|
|
17448
|
-
if (!storyboard || (0,
|
|
17456
|
+
if (!storyboard || (0, import_type_guards73.isUndefined)(height) || (0, import_type_guards73.isEmptyString)(height)) return null;
|
|
17449
17457
|
const {
|
|
17450
17458
|
url,
|
|
17451
17459
|
width: sbWidth,
|
|
@@ -17455,7 +17463,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
17455
17463
|
frameCount,
|
|
17456
17464
|
aspectRatio
|
|
17457
17465
|
} = storyboard;
|
|
17458
|
-
const targetWidth = (0,
|
|
17466
|
+
const targetWidth = (0, import_type_guards73.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
17459
17467
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17460
17468
|
return /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
17461
17469
|
ThumbnailStoryboardViewer,
|
|
@@ -17476,7 +17484,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
17476
17484
|
let thumbnailContent = null;
|
|
17477
17485
|
if (shouldRenderStoryboard) {
|
|
17478
17486
|
thumbnailContent = renderStoryboard();
|
|
17479
|
-
} else if ((0,
|
|
17487
|
+
} else if ((0, import_type_guards73.isNotNil)(thumbnailUrl)) {
|
|
17480
17488
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
17481
17489
|
ThumbnailImage,
|
|
17482
17490
|
{
|
|
@@ -17501,7 +17509,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
17501
17509
|
onMouseOut: handleMouseOut,
|
|
17502
17510
|
role: "presentation",
|
|
17503
17511
|
children: [
|
|
17504
|
-
(0,
|
|
17512
|
+
(0, import_type_guards73.isNotNil)(children) ? children : null,
|
|
17505
17513
|
thumbnailContent
|
|
17506
17514
|
]
|
|
17507
17515
|
}
|
|
@@ -17513,7 +17521,7 @@ Thumbnail.displayName = "Thumbnail_UI";
|
|
|
17513
17521
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
17514
17522
|
var import_react101 = __toESM(require("react"));
|
|
17515
17523
|
var import_styled_components126 = __toESM(require("styled-components"));
|
|
17516
|
-
var
|
|
17524
|
+
var import_type_guards74 = require("@wistia/type-guards");
|
|
17517
17525
|
var import_jsx_runtime325 = (
|
|
17518
17526
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
17519
17527
|
require("react/jsx-runtime")
|
|
@@ -17593,7 +17601,7 @@ var ThumbnailCollage = ({
|
|
|
17593
17601
|
}) => {
|
|
17594
17602
|
const thumbnailArray = import_react101.default.Children.toArray(children);
|
|
17595
17603
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
17596
|
-
const thumbnails = (0,
|
|
17604
|
+
const thumbnails = (0, import_type_guards74.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
17597
17605
|
return import_react101.default.cloneElement(child, {
|
|
17598
17606
|
...child.props,
|
|
17599
17607
|
children: void 0
|
|
@@ -17621,7 +17629,7 @@ var ThumbnailCollage = ({
|
|
|
17621
17629
|
|
|
17622
17630
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
17623
17631
|
var import_styled_components127 = __toESM(require("styled-components"));
|
|
17624
|
-
var
|
|
17632
|
+
var import_type_guards75 = require("@wistia/type-guards");
|
|
17625
17633
|
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
17626
17634
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
17627
17635
|
if (iconOnly) {
|
|
@@ -17734,7 +17742,7 @@ var WistiaLogo = ({
|
|
|
17734
17742
|
...props,
|
|
17735
17743
|
children: [
|
|
17736
17744
|
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("title", { children: title }),
|
|
17737
|
-
(0,
|
|
17745
|
+
(0, import_type_guards75.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("desc", { children: description }) : null,
|
|
17738
17746
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
17739
17747
|
renderLogotype(logotypeColor, iconOnly)
|
|
17740
17748
|
]
|
|
@@ -17743,6 +17751,76 @@ var WistiaLogo = ({
|
|
|
17743
17751
|
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("a", { href, children: Logo }) : Logo;
|
|
17744
17752
|
};
|
|
17745
17753
|
WistiaLogo.displayName = "WistiaLogo_UI";
|
|
17754
|
+
|
|
17755
|
+
// src/components/SplitButton/SplitButton.tsx
|
|
17756
|
+
var import_styled_components128 = __toESM(require("styled-components"));
|
|
17757
|
+
var import_type_guards76 = require("@wistia/type-guards");
|
|
17758
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
17759
|
+
var StyledSplitButton = import_styled_components128.default.span`
|
|
17760
|
+
white-space: nowrap;
|
|
17761
|
+
|
|
17762
|
+
> [data-wui-button='true']:first-child {
|
|
17763
|
+
border-top-right-radius: 0;
|
|
17764
|
+
border-bottom-right-radius: 0;
|
|
17765
|
+
}
|
|
17766
|
+
|
|
17767
|
+
> [data-wui-button='true']:last-child {
|
|
17768
|
+
border-top-left-radius: 0;
|
|
17769
|
+
border-bottom-left-radius: 0;
|
|
17770
|
+
display: inline-flex;
|
|
17771
|
+
}
|
|
17772
|
+
`;
|
|
17773
|
+
var SplitButton = ({
|
|
17774
|
+
children,
|
|
17775
|
+
menuLabel = "Select an option",
|
|
17776
|
+
menuIcon = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(Icon, { type: "caret-down" }),
|
|
17777
|
+
menuItems,
|
|
17778
|
+
disabled = false,
|
|
17779
|
+
colorScheme = "default",
|
|
17780
|
+
variant = "solid",
|
|
17781
|
+
secondaryAction,
|
|
17782
|
+
size = "md",
|
|
17783
|
+
unstyled = false,
|
|
17784
|
+
menuProps = {},
|
|
17785
|
+
...props
|
|
17786
|
+
}) => {
|
|
17787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(StyledSplitButton, { children: [
|
|
17788
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
17789
|
+
Button,
|
|
17790
|
+
{
|
|
17791
|
+
colorScheme,
|
|
17792
|
+
disabled,
|
|
17793
|
+
size,
|
|
17794
|
+
unstyled,
|
|
17795
|
+
variant,
|
|
17796
|
+
...props,
|
|
17797
|
+
children
|
|
17798
|
+
}
|
|
17799
|
+
),
|
|
17800
|
+
(0, import_type_guards76.isNotNil)(menuItems) && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
17801
|
+
Menu,
|
|
17802
|
+
{
|
|
17803
|
+
...menuProps,
|
|
17804
|
+
disabled,
|
|
17805
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
17806
|
+
IconButton,
|
|
17807
|
+
{
|
|
17808
|
+
colorScheme,
|
|
17809
|
+
disabled,
|
|
17810
|
+
label: menuLabel,
|
|
17811
|
+
size,
|
|
17812
|
+
unstyled,
|
|
17813
|
+
variant,
|
|
17814
|
+
children: menuIcon
|
|
17815
|
+
}
|
|
17816
|
+
),
|
|
17817
|
+
children: menuItems
|
|
17818
|
+
}
|
|
17819
|
+
),
|
|
17820
|
+
(0, import_type_guards76.isNotNil)(secondaryAction) && secondaryAction
|
|
17821
|
+
] });
|
|
17822
|
+
};
|
|
17823
|
+
SplitButton.displayName = "SplitButton_UI";
|
|
17746
17824
|
// Annotate the CommonJS export names for ESM import in node:
|
|
17747
17825
|
0 && (module.exports = {
|
|
17748
17826
|
ActionButton,
|
|
@@ -17848,6 +17926,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
|
|
|
17848
17926
|
SelectOption,
|
|
17849
17927
|
SelectOptionGroup,
|
|
17850
17928
|
Slider,
|
|
17929
|
+
SplitButton,
|
|
17851
17930
|
Stack,
|
|
17852
17931
|
SubMenu,
|
|
17853
17932
|
Switch,
|