@wistia/ui 0.6.41-beta.e321d0ef.a3ef679 → 0.6.41
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 +29 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +24 -28
- 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.6.41
|
|
3
|
+
* @license @wistia/ui v0.6.41
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -11447,7 +11447,6 @@ Select.displayName = "Select";
|
|
|
11447
11447
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11448
11448
|
var import_react55 = require("react");
|
|
11449
11449
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11450
|
-
var import_type_guards43 = require("@wistia/type-guards");
|
|
11451
11450
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11452
11451
|
var StyledItem = (0, import_styled_components70.default)(import_react_select2.Item)`
|
|
11453
11452
|
${variantStyleMap2.body3};
|
|
@@ -11476,24 +11475,21 @@ var StyledIconContainer = import_styled_components70.default.span`
|
|
|
11476
11475
|
width: 12px;
|
|
11477
11476
|
`;
|
|
11478
11477
|
var SelectOption = (0, import_react55.forwardRef)(
|
|
11479
|
-
({ children,
|
|
11478
|
+
({ children, ...props }, forwardedRef) => {
|
|
11480
11479
|
return /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
|
|
11481
11480
|
StyledItem,
|
|
11482
11481
|
{
|
|
11483
11482
|
...props,
|
|
11484
11483
|
ref: forwardedRef,
|
|
11485
11484
|
children: [
|
|
11486
|
-
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(StyledIconContainer, {
|
|
11485
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(StyledIconContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_react_select2.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
11487
11486
|
Icon,
|
|
11488
11487
|
{
|
|
11489
11488
|
size: "sm",
|
|
11490
11489
|
type: "checkmark"
|
|
11491
11490
|
}
|
|
11492
11491
|
) }) }),
|
|
11493
|
-
|
|
11494
|
-
children,
|
|
11495
|
-
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
11496
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_react_select2.ItemText, { children })
|
|
11492
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_react_select2.ItemText, { children })
|
|
11497
11493
|
]
|
|
11498
11494
|
}
|
|
11499
11495
|
);
|
|
@@ -11525,7 +11521,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11525
11521
|
// src/components/Switch/Switch.tsx
|
|
11526
11522
|
var import_react56 = require("react");
|
|
11527
11523
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11528
|
-
var
|
|
11524
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
11529
11525
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
11530
11526
|
var sizeSmall3 = import_styled_components72.css`
|
|
11531
11527
|
--wui-size-small-width: 24px;
|
|
@@ -11644,7 +11640,7 @@ var Switch = (0, import_react56.forwardRef)(
|
|
|
11644
11640
|
...props
|
|
11645
11641
|
}, ref) => {
|
|
11646
11642
|
const generatedId = (0, import_react56.useId)();
|
|
11647
|
-
const computedId = (0,
|
|
11643
|
+
const computedId = (0, import_type_guards43.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11648
11644
|
return /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11649
11645
|
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
11650
11646
|
StyledHiddenSwitchInput,
|
|
@@ -11791,7 +11787,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
11791
11787
|
// src/components/Tabs/Tabs.tsx
|
|
11792
11788
|
var import_react63 = require("react");
|
|
11793
11789
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
11794
|
-
var
|
|
11790
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
11795
11791
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
11796
11792
|
|
|
11797
11793
|
// src/components/Tabs/TabPanel.tsx
|
|
@@ -11847,7 +11843,7 @@ TabList.displayName = "TabList";
|
|
|
11847
11843
|
var import_react60 = require("react");
|
|
11848
11844
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
11849
11845
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
11850
|
-
var
|
|
11846
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
11851
11847
|
|
|
11852
11848
|
// src/components/Tabs/useTabsValue.tsx
|
|
11853
11849
|
var import_react59 = require("react");
|
|
@@ -11905,8 +11901,8 @@ var TabItem = (0, import_react60.forwardRef)(
|
|
|
11905
11901
|
StyledTabItem,
|
|
11906
11902
|
{
|
|
11907
11903
|
ref: combinedRef,
|
|
11908
|
-
$hasLabel: (0,
|
|
11909
|
-
"aria-label": (0,
|
|
11904
|
+
$hasLabel: (0, import_type_guards44.isNotNil)(label),
|
|
11905
|
+
"aria-label": (0, import_type_guards44.isNotNil)(label) ? void 0 : ariaLabel,
|
|
11910
11906
|
disabled,
|
|
11911
11907
|
value,
|
|
11912
11908
|
children: [
|
|
@@ -12036,7 +12032,7 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12036
12032
|
label,
|
|
12037
12033
|
"aria-label": ariaLabelForTab
|
|
12038
12034
|
} = tab.props;
|
|
12039
|
-
if ((0,
|
|
12035
|
+
if ((0, import_type_guards45.isNil)(icon)) {
|
|
12040
12036
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
12041
12037
|
TabItem,
|
|
12042
12038
|
{
|
|
@@ -12047,7 +12043,7 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12047
12043
|
value
|
|
12048
12044
|
);
|
|
12049
12045
|
}
|
|
12050
|
-
if ((0,
|
|
12046
|
+
if ((0, import_type_guards45.isNotNil)(label)) {
|
|
12051
12047
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
12052
12048
|
TabItem,
|
|
12053
12049
|
{
|
|
@@ -12059,7 +12055,7 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12059
12055
|
value
|
|
12060
12056
|
);
|
|
12061
12057
|
}
|
|
12062
|
-
if ((0,
|
|
12058
|
+
if ((0, import_type_guards45.isNotNil)(ariaLabelForTab)) {
|
|
12063
12059
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
12064
12060
|
TabItem,
|
|
12065
12061
|
{
|
|
@@ -12102,7 +12098,7 @@ Tab.displayName = "Tab";
|
|
|
12102
12098
|
// src/components/Tag/Tag.tsx
|
|
12103
12099
|
var import_react65 = require("react");
|
|
12104
12100
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
12105
|
-
var
|
|
12101
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
12106
12102
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
12107
12103
|
var TagLabel = import_styled_components84.default.a`
|
|
12108
12104
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -12187,10 +12183,10 @@ var StyledTag = import_styled_components84.default.div`
|
|
|
12187
12183
|
}
|
|
12188
12184
|
`;
|
|
12189
12185
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
12190
|
-
if ((0,
|
|
12186
|
+
if ((0, import_type_guards46.isNil)(onClickRemove)) {
|
|
12191
12187
|
return null;
|
|
12192
12188
|
}
|
|
12193
|
-
if ((0,
|
|
12189
|
+
if ((0, import_type_guards46.isNil)(onClickRemoveLabel)) {
|
|
12194
12190
|
throw new Error(
|
|
12195
12191
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
12196
12192
|
);
|
|
@@ -12227,8 +12223,8 @@ var Tag = (0, import_react65.forwardRef)(
|
|
|
12227
12223
|
onClickRemoveLabel,
|
|
12228
12224
|
...otherProps
|
|
12229
12225
|
}, ref) => {
|
|
12230
|
-
const hasIcon = (0,
|
|
12231
|
-
const labelProps = (0,
|
|
12226
|
+
const hasIcon = (0, import_type_guards46.isNotNil)(icon);
|
|
12227
|
+
const labelProps = (0, import_type_guards46.isNotNil)(href) && (0, import_type_guards46.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
12232
12228
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(
|
|
12233
12229
|
StyledTag,
|
|
12234
12230
|
{
|
|
@@ -12264,7 +12260,7 @@ Tag.displayName = "Tag";
|
|
|
12264
12260
|
|
|
12265
12261
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
12266
12262
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
12267
|
-
var
|
|
12263
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
12268
12264
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
12269
12265
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
12270
12266
|
if (iconOnly) {
|
|
@@ -12377,7 +12373,7 @@ var WistiaLogo = ({
|
|
|
12377
12373
|
...otherProps,
|
|
12378
12374
|
children: [
|
|
12379
12375
|
/* @__PURE__ */ (0, import_jsx_runtime268.jsx)("title", { children: title }),
|
|
12380
|
-
(0,
|
|
12376
|
+
(0, import_type_guards47.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("desc", { children: description }) : null,
|
|
12381
12377
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
12382
12378
|
renderLogotype(logotypeColor, iconOnly)
|
|
12383
12379
|
]
|
|
@@ -12389,7 +12385,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12389
12385
|
|
|
12390
12386
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
12391
12387
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
12392
|
-
var
|
|
12388
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
12393
12389
|
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
12394
12390
|
var StyledThumbnailBadge = import_styled_components86.default.div`
|
|
12395
12391
|
align-items: center;
|
|
@@ -12421,7 +12417,7 @@ var ThumbnailBadge = ({
|
|
|
12421
12417
|
...otherProps
|
|
12422
12418
|
}) => {
|
|
12423
12419
|
return /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(StyledThumbnailBadge, { ...otherProps, children: [
|
|
12424
|
-
(0,
|
|
12420
|
+
(0, import_type_guards48.isNotNil)(icon) && icon,
|
|
12425
12421
|
/* @__PURE__ */ (0, import_jsx_runtime269.jsx)("span", { children: label })
|
|
12426
12422
|
] });
|
|
12427
12423
|
};
|
|
@@ -12430,10 +12426,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
12430
12426
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12431
12427
|
var import_react66 = require("react");
|
|
12432
12428
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
12433
|
-
var
|
|
12429
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
12434
12430
|
|
|
12435
12431
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12436
|
-
var
|
|
12432
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
12437
12433
|
var import_styled_components87 = require("styled-components");
|
|
12438
12434
|
var gradients = {
|
|
12439
12435
|
defaultDarkOne: import_styled_components87.css`
|
|
@@ -12561,7 +12557,7 @@ var gradients = {
|
|
|
12561
12557
|
};
|
|
12562
12558
|
var gradientMap = Object.keys(gradients);
|
|
12563
12559
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
12564
|
-
return (0,
|
|
12560
|
+
return (0, import_type_guards49.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
12565
12561
|
};
|
|
12566
12562
|
|
|
12567
12563
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
@@ -12597,7 +12593,7 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
12597
12593
|
var StyledThumbnail = import_styled_components88.default.div`
|
|
12598
12594
|
${({ $gradientBackground }) => getBackgroundGradient($gradientBackground)};
|
|
12599
12595
|
aspect-ratio: 16 / 9;
|
|
12600
|
-
background: ${({ $backgroundUrl }) => (0,
|
|
12596
|
+
background: ${({ $backgroundUrl }) => (0, import_type_guards50.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}') center / cover` : void 0};
|
|
12601
12597
|
border-radius: 4px;
|
|
12602
12598
|
display: flex;
|
|
12603
12599
|
overflow: hidden;
|
|
@@ -12613,7 +12609,7 @@ var Thumbnail = (0, import_react66.forwardRef)(
|
|
|
12613
12609
|
children,
|
|
12614
12610
|
...otherProps
|
|
12615
12611
|
}, ref) => {
|
|
12616
|
-
const backgroundUrl = thumbnailImageType === "square" && (0,
|
|
12612
|
+
const backgroundUrl = thumbnailImageType === "square" && (0, import_type_guards50.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0;
|
|
12617
12613
|
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(
|
|
12618
12614
|
StyledThumbnail,
|
|
12619
12615
|
{
|
|
@@ -12623,8 +12619,8 @@ var Thumbnail = (0, import_react66.forwardRef)(
|
|
|
12623
12619
|
$width: width,
|
|
12624
12620
|
...otherProps,
|
|
12625
12621
|
children: [
|
|
12626
|
-
(0,
|
|
12627
|
-
(0,
|
|
12622
|
+
(0, import_type_guards50.isNotNil)(children) && children,
|
|
12623
|
+
(0, import_type_guards50.isNotNil)(thumbnailUrl) && /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
12628
12624
|
ThumbnailImage,
|
|
12629
12625
|
{
|
|
12630
12626
|
thumbnailImageType,
|