@wistia/ui 0.8.5-beta.7902c369.c4c8fbc → 0.8.5
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 +50 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +38 -41
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.5
|
|
3
|
+
* @license @wistia/ui v0.8.5
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -10367,10 +10367,8 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
10367
10367
|
|
|
10368
10368
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
10369
10369
|
import {
|
|
10370
|
-
DropdownMenuCheckboxItem
|
|
10371
|
-
DropdownMenuItemIndicator as DropdownMenuItemIndicator2
|
|
10370
|
+
DropdownMenuCheckboxItem
|
|
10372
10371
|
} from "@radix-ui/react-dropdown-menu";
|
|
10373
|
-
import { isNotNil as isNotNil21 } from "@wistia/type-guards";
|
|
10374
10372
|
import { jsx as jsx238, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10375
10373
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
10376
10374
|
return checked ? /* @__PURE__ */ jsxs29(
|
|
@@ -10444,8 +10442,7 @@ var CheckboxMenuItem = ({
|
|
|
10444
10442
|
MenuItemButton,
|
|
10445
10443
|
{
|
|
10446
10444
|
...props,
|
|
10447
|
-
leftIcon:
|
|
10448
|
-
rightIcon: isNotNil21(props.icon) ? /* @__PURE__ */ jsx238(DropdownMenuItemIndicator2, { children: /* @__PURE__ */ jsx238(Icon, { type: "checkmark" }) }) : void 0
|
|
10445
|
+
leftIcon: /* @__PURE__ */ jsx238(CheckboxIndicator, { checked })
|
|
10449
10446
|
}
|
|
10450
10447
|
)
|
|
10451
10448
|
}
|
|
@@ -10457,7 +10454,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
|
10457
10454
|
import { forwardRef as forwardRef18 } from "react";
|
|
10458
10455
|
import styled47 from "styled-components";
|
|
10459
10456
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
10460
|
-
import { isNotNil as
|
|
10457
|
+
import { isNotNil as isNotNil22 } from "@wistia/type-guards";
|
|
10461
10458
|
|
|
10462
10459
|
// src/components/Modal/ModalHeader.tsx
|
|
10463
10460
|
import styled44 from "styled-components";
|
|
@@ -10520,7 +10517,7 @@ import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
|
10520
10517
|
|
|
10521
10518
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10522
10519
|
import { useRef as useRef9, useEffect as useEffect7 } from "react";
|
|
10523
|
-
import { isNotNil as
|
|
10520
|
+
import { isNotNil as isNotNil21 } from "@wistia/type-guards";
|
|
10524
10521
|
var useFocusRestore = () => {
|
|
10525
10522
|
const previouslyFocusedRef = useRef9(null);
|
|
10526
10523
|
useEffect7(() => {
|
|
@@ -10528,7 +10525,7 @@ var useFocusRestore = () => {
|
|
|
10528
10525
|
}, []);
|
|
10529
10526
|
useEffect7(() => {
|
|
10530
10527
|
return () => {
|
|
10531
|
-
if (
|
|
10528
|
+
if (isNotNil21(previouslyFocusedRef.current)) {
|
|
10532
10529
|
setTimeout(() => {
|
|
10533
10530
|
previouslyFocusedRef.current?.focus();
|
|
10534
10531
|
}, 0);
|
|
@@ -10675,7 +10672,7 @@ var Modal = forwardRef18(
|
|
|
10675
10672
|
DialogRoot,
|
|
10676
10673
|
{
|
|
10677
10674
|
onOpenChange: (open2) => {
|
|
10678
|
-
if (!open2 &&
|
|
10675
|
+
if (!open2 && isNotNil22(onRequestClose)) {
|
|
10679
10676
|
onRequestClose();
|
|
10680
10677
|
}
|
|
10681
10678
|
},
|
|
@@ -10688,7 +10685,7 @@ var Modal = forwardRef18(
|
|
|
10688
10685
|
ref,
|
|
10689
10686
|
fullHeight,
|
|
10690
10687
|
onOpenAutoFocus: (event) => {
|
|
10691
|
-
if (
|
|
10688
|
+
if (isNotNil22(initialFocusRef) && initialFocusRef.current) {
|
|
10692
10689
|
event.preventDefault();
|
|
10693
10690
|
requestAnimationFrame(() => {
|
|
10694
10691
|
initialFocusRef.current?.focus();
|
|
@@ -10722,9 +10719,9 @@ import { Root as Root2, Trigger as Trigger2, Portal, Content as Content2, Close
|
|
|
10722
10719
|
import styled48, { css as css29 } from "styled-components";
|
|
10723
10720
|
|
|
10724
10721
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
10725
|
-
import { isNotNil as
|
|
10722
|
+
import { isNotNil as isNotNil23 } from "@wistia/type-guards";
|
|
10726
10723
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
10727
|
-
return
|
|
10724
|
+
return isNotNil23(onOpenChange) && isNotNil23(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
10728
10725
|
};
|
|
10729
10726
|
|
|
10730
10727
|
// src/components/Popover/Popover.tsx
|
|
@@ -10795,7 +10792,7 @@ Popover.displayName = "Popover";
|
|
|
10795
10792
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
10796
10793
|
import styled49 from "styled-components";
|
|
10797
10794
|
import { Root as ProgressRoot, Indicator as ProgressIndicator } from "@radix-ui/react-progress";
|
|
10798
|
-
import { isNotNil as
|
|
10795
|
+
import { isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
10799
10796
|
import { jsx as jsx245, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
10800
10797
|
var ProgressBarWrapper = styled49.div`
|
|
10801
10798
|
--progress-bar-height: 8px;
|
|
@@ -10850,7 +10847,7 @@ var ProgressBar = ({
|
|
|
10850
10847
|
...props
|
|
10851
10848
|
}) => {
|
|
10852
10849
|
return /* @__PURE__ */ jsxs33(ProgressBarWrapper, { children: [
|
|
10853
|
-
|
|
10850
|
+
isNotNil24(labelLeft) ? /* @__PURE__ */ jsx245(ProgressBarLabel, { children: labelLeft }) : null,
|
|
10854
10851
|
/* @__PURE__ */ jsx245(
|
|
10855
10852
|
StyledProgressBar,
|
|
10856
10853
|
{
|
|
@@ -10866,7 +10863,7 @@ var ProgressBar = ({
|
|
|
10866
10863
|
)
|
|
10867
10864
|
}
|
|
10868
10865
|
),
|
|
10869
|
-
|
|
10866
|
+
isNotNil24(labelRight) ? /* @__PURE__ */ jsx245(ProgressBarLabel, { children: labelRight }) : null
|
|
10870
10867
|
] });
|
|
10871
10868
|
};
|
|
10872
10869
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -11183,7 +11180,7 @@ SegmentedControl.displayName = "SegmentedControl";
|
|
|
11183
11180
|
import { forwardRef as forwardRef21, useEffect as useEffect8, useRef as useRef10 } from "react";
|
|
11184
11181
|
import styled53, { css as css32 } from "styled-components";
|
|
11185
11182
|
import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
|
|
11186
|
-
import { isNotNil as
|
|
11183
|
+
import { isNotNil as isNotNil25 } from "@wistia/type-guards";
|
|
11187
11184
|
import { jsxs as jsxs36 } from "react/jsx-runtime";
|
|
11188
11185
|
var segmentedControlItemStyles = css32`
|
|
11189
11186
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -11290,8 +11287,8 @@ var SegmentedControlItem = forwardRef21(
|
|
|
11290
11287
|
StyledSegmentedControlItem,
|
|
11291
11288
|
{
|
|
11292
11289
|
ref: combinedRef,
|
|
11293
|
-
$hasLabel:
|
|
11294
|
-
"aria-label":
|
|
11290
|
+
$hasLabel: isNotNil25(label),
|
|
11291
|
+
"aria-label": isNotNil25(label) ? void 0 : ariaLabel,
|
|
11295
11292
|
disabled,
|
|
11296
11293
|
onClick: handleClick,
|
|
11297
11294
|
value,
|
|
@@ -11432,7 +11429,7 @@ Select.displayName = "Select";
|
|
|
11432
11429
|
import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
|
|
11433
11430
|
import { forwardRef as forwardRef23 } from "react";
|
|
11434
11431
|
import styled55 from "styled-components";
|
|
11435
|
-
import { isNotNil as
|
|
11432
|
+
import { isNotNil as isNotNil26 } from "@wistia/type-guards";
|
|
11436
11433
|
import { jsx as jsx251, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
11437
11434
|
var StyledItem = styled55(Item)`
|
|
11438
11435
|
${variantStyleMap2.body3};
|
|
@@ -11476,7 +11473,7 @@ var SelectOption = forwardRef23(
|
|
|
11476
11473
|
type: "checkmark"
|
|
11477
11474
|
}
|
|
11478
11475
|
) }) }),
|
|
11479
|
-
|
|
11476
|
+
isNotNil26(selectedDisplayValue) ? /* @__PURE__ */ jsxs38("div", { children: [
|
|
11480
11477
|
children,
|
|
11481
11478
|
/* @__PURE__ */ jsx251("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx251(ItemText, { children: selectedDisplayValue }) })
|
|
11482
11479
|
] }) : /* @__PURE__ */ jsx251(ItemText, { children })
|
|
@@ -11777,7 +11774,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
11777
11774
|
// src/components/Tabs/Tabs.tsx
|
|
11778
11775
|
import { forwardRef as forwardRef26, useState as useState11 } from "react";
|
|
11779
11776
|
import { Root as TabsRoot } from "@radix-ui/react-tabs";
|
|
11780
|
-
import { isNotNil as
|
|
11777
|
+
import { isNotNil as isNotNil28, isNil as isNil15 } from "@wistia/type-guards";
|
|
11781
11778
|
import styled68 from "styled-components";
|
|
11782
11779
|
|
|
11783
11780
|
// src/components/Tabs/TabPanel.tsx
|
|
@@ -11833,7 +11830,7 @@ TabList.displayName = "TabList";
|
|
|
11833
11830
|
import { forwardRef as forwardRef25, useEffect as useEffect9, useRef as useRef11 } from "react";
|
|
11834
11831
|
import styled66 from "styled-components";
|
|
11835
11832
|
import { Trigger as RadixTab } from "@radix-ui/react-tabs";
|
|
11836
|
-
import { isNotNil as
|
|
11833
|
+
import { isNotNil as isNotNil27 } from "@wistia/type-guards";
|
|
11837
11834
|
|
|
11838
11835
|
// src/components/Tabs/useTabsValue.tsx
|
|
11839
11836
|
import { createContext as createContext9, useContext as useContext8 } from "react";
|
|
@@ -11891,8 +11888,8 @@ var TabItem = forwardRef25(
|
|
|
11891
11888
|
StyledTabItem,
|
|
11892
11889
|
{
|
|
11893
11890
|
ref: combinedRef,
|
|
11894
|
-
$hasLabel:
|
|
11895
|
-
"aria-label":
|
|
11891
|
+
$hasLabel: isNotNil27(label),
|
|
11892
|
+
"aria-label": isNotNil27(label) ? void 0 : ariaLabel,
|
|
11896
11893
|
disabled,
|
|
11897
11894
|
value,
|
|
11898
11895
|
children: [
|
|
@@ -12033,7 +12030,7 @@ var Tabs = forwardRef26(
|
|
|
12033
12030
|
value
|
|
12034
12031
|
);
|
|
12035
12032
|
}
|
|
12036
|
-
if (
|
|
12033
|
+
if (isNotNil28(label)) {
|
|
12037
12034
|
return /* @__PURE__ */ jsx263(
|
|
12038
12035
|
TabItem,
|
|
12039
12036
|
{
|
|
@@ -12045,7 +12042,7 @@ var Tabs = forwardRef26(
|
|
|
12045
12042
|
value
|
|
12046
12043
|
);
|
|
12047
12044
|
}
|
|
12048
|
-
if (
|
|
12045
|
+
if (isNotNil28(ariaLabelForTab)) {
|
|
12049
12046
|
return /* @__PURE__ */ jsx263(
|
|
12050
12047
|
TabItem,
|
|
12051
12048
|
{
|
|
@@ -12088,7 +12085,7 @@ Tab.displayName = "Tab";
|
|
|
12088
12085
|
// src/components/Tag/Tag.tsx
|
|
12089
12086
|
import { forwardRef as forwardRef28 } from "react";
|
|
12090
12087
|
import styled69 from "styled-components";
|
|
12091
|
-
import { isNil as isNil16, isNotNil as
|
|
12088
|
+
import { isNil as isNil16, isNotNil as isNotNil29, isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
|
|
12092
12089
|
import { Fragment as Fragment8, jsx as jsx265, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12093
12090
|
var TagLabel = styled69.a`
|
|
12094
12091
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -12205,8 +12202,8 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12205
12202
|
};
|
|
12206
12203
|
var Tag = forwardRef28(
|
|
12207
12204
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12208
|
-
const hasIcon =
|
|
12209
|
-
const labelProps =
|
|
12205
|
+
const hasIcon = isNotNil29(icon);
|
|
12206
|
+
const labelProps = isNotNil29(href) && isNonEmptyString5(href) ? { href, as: "a" } : { as: "span" };
|
|
12210
12207
|
return /* @__PURE__ */ jsxs43(
|
|
12211
12208
|
StyledTag,
|
|
12212
12209
|
{
|
|
@@ -12242,7 +12239,7 @@ Tag.displayName = "Tag";
|
|
|
12242
12239
|
|
|
12243
12240
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
12244
12241
|
import styled70, { css as css36 } from "styled-components";
|
|
12245
|
-
import { isNotNil as
|
|
12242
|
+
import { isNotNil as isNotNil30 } from "@wistia/type-guards";
|
|
12246
12243
|
import { jsx as jsx266, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
12247
12244
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
12248
12245
|
if (iconOnly) {
|
|
@@ -12355,7 +12352,7 @@ var WistiaLogo = ({
|
|
|
12355
12352
|
...props,
|
|
12356
12353
|
children: [
|
|
12357
12354
|
/* @__PURE__ */ jsx266("title", { children: title }),
|
|
12358
|
-
|
|
12355
|
+
isNotNil30(description) ? /* @__PURE__ */ jsx266("desc", { children: description }) : null,
|
|
12359
12356
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
12360
12357
|
renderLogotype(logotypeColor, iconOnly)
|
|
12361
12358
|
]
|
|
@@ -12367,7 +12364,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12367
12364
|
|
|
12368
12365
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
12369
12366
|
import styled71 from "styled-components";
|
|
12370
|
-
import { isNotNil as
|
|
12367
|
+
import { isNotNil as isNotNil31 } from "@wistia/type-guards";
|
|
12371
12368
|
import { jsx as jsx267, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
12372
12369
|
var StyledThumbnailBadge = styled71.div`
|
|
12373
12370
|
align-items: center;
|
|
@@ -12395,7 +12392,7 @@ var StyledThumbnailBadge = styled71.div`
|
|
|
12395
12392
|
`;
|
|
12396
12393
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
12397
12394
|
return /* @__PURE__ */ jsxs45(StyledThumbnailBadge, { ...props, children: [
|
|
12398
|
-
|
|
12395
|
+
isNotNil31(icon) && icon,
|
|
12399
12396
|
/* @__PURE__ */ jsx267("span", { children: label })
|
|
12400
12397
|
] });
|
|
12401
12398
|
};
|
|
@@ -12404,10 +12401,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
12404
12401
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12405
12402
|
import { forwardRef as forwardRef29 } from "react";
|
|
12406
12403
|
import styled72 from "styled-components";
|
|
12407
|
-
import { isNil as isNil17, isNotNil as
|
|
12404
|
+
import { isNil as isNil17, isNotNil as isNotNil33 } from "@wistia/type-guards";
|
|
12408
12405
|
|
|
12409
12406
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12410
|
-
import { isNotNil as
|
|
12407
|
+
import { isNotNil as isNotNil32 } from "@wistia/type-guards";
|
|
12411
12408
|
import { css as css37 } from "styled-components";
|
|
12412
12409
|
var gradients = {
|
|
12413
12410
|
defaultDarkOne: css37`
|
|
@@ -12535,7 +12532,7 @@ var gradients = {
|
|
|
12535
12532
|
};
|
|
12536
12533
|
var gradientMap = Object.keys(gradients);
|
|
12537
12534
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
12538
|
-
return
|
|
12535
|
+
return isNotNil32(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
12539
12536
|
};
|
|
12540
12537
|
|
|
12541
12538
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
@@ -12569,7 +12566,7 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
12569
12566
|
);
|
|
12570
12567
|
};
|
|
12571
12568
|
var StyledThumbnail = styled72.div`
|
|
12572
|
-
background-image: ${({ $backgroundUrl }) =>
|
|
12569
|
+
background-image: ${({ $backgroundUrl }) => isNotNil33($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
12573
12570
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
12574
12571
|
// if we don't have $backgroundUrl show a gradient
|
|
12575
12572
|
isNil17($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
@@ -12596,7 +12593,7 @@ var Thumbnail = forwardRef29(
|
|
|
12596
12593
|
children,
|
|
12597
12594
|
...props
|
|
12598
12595
|
}, ref) => {
|
|
12599
|
-
const backgroundUrl = thumbnailImageType === "square" &&
|
|
12596
|
+
const backgroundUrl = thumbnailImageType === "square" && isNotNil33(thumbnailUrl) ? thumbnailUrl : void 0;
|
|
12600
12597
|
return /* @__PURE__ */ jsxs46(
|
|
12601
12598
|
StyledThumbnail,
|
|
12602
12599
|
{
|
|
@@ -12606,8 +12603,8 @@ var Thumbnail = forwardRef29(
|
|
|
12606
12603
|
$width: width,
|
|
12607
12604
|
...props,
|
|
12608
12605
|
children: [
|
|
12609
|
-
|
|
12610
|
-
|
|
12606
|
+
isNotNil33(children) ? children : null,
|
|
12607
|
+
isNotNil33(thumbnailUrl) ? /* @__PURE__ */ jsx268(
|
|
12611
12608
|
ThumbnailImage,
|
|
12612
12609
|
{
|
|
12613
12610
|
thumbnailImageType,
|