@wistia/ui 0.14.34 → 0.14.35-beta.1f69ebd4.a65016c
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 +138 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +50 -2
- package/dist/index.d.ts +50 -2
- package/dist/index.mjs +154 -62
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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.35-beta.1f69ebd4.a65016c
|
|
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,
|
|
@@ -1665,7 +1666,7 @@ var UIProviderNestingContext = (0, import_react3.createContext)(false);
|
|
|
1665
1666
|
var UIProvider = ({ children }) => {
|
|
1666
1667
|
const isNested = (0, import_react3.useContext)(UIProviderNestingContext);
|
|
1667
1668
|
if (isNested) {
|
|
1668
|
-
|
|
1669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children });
|
|
1669
1670
|
}
|
|
1670
1671
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(UIProviderNestingContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AriaLiveProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_tooltip.Provider, { children: [
|
|
1671
1672
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GlobalStyle, {}),
|
|
@@ -2970,6 +2971,7 @@ var StyledToast = import_styled_components16.default.div`
|
|
|
2970
2971
|
svg {
|
|
2971
2972
|
height: 16px;
|
|
2972
2973
|
width: 16px;
|
|
2974
|
+
flex: 0 0 16px;
|
|
2973
2975
|
}
|
|
2974
2976
|
`;
|
|
2975
2977
|
var Action = ({ actionButton }) => {
|
|
@@ -3191,6 +3193,7 @@ var buttonBaseStyles = import_styled_components18.css`
|
|
|
3191
3193
|
color: var(--button-color-icon);
|
|
3192
3194
|
width: var(--button-icon-size);
|
|
3193
3195
|
height: var(--button-icon-size);
|
|
3196
|
+
flex: 0 0 var(--button-icon-size);
|
|
3194
3197
|
}
|
|
3195
3198
|
}
|
|
3196
3199
|
|
|
@@ -7239,6 +7242,7 @@ var StyledIcon = import_styled_components19.default.svg`
|
|
|
7239
7242
|
--wui-icon-size: var(--wui-icon-inline-size, ${({ $height }) => $height}px);
|
|
7240
7243
|
--wui-icon-vertical-align: middle;
|
|
7241
7244
|
|
|
7245
|
+
flex: 0 0 var(--wui-icon-size);
|
|
7242
7246
|
height: var(--wui-icon-size);
|
|
7243
7247
|
width: var(--wui-icon-size);
|
|
7244
7248
|
`;
|
|
@@ -7329,6 +7333,7 @@ var StyledLink = import_styled_components20.default.a`
|
|
|
7329
7333
|
svg {
|
|
7330
7334
|
width: 14px;
|
|
7331
7335
|
height: 14px;
|
|
7336
|
+
flex: 0 0 14px;
|
|
7332
7337
|
}
|
|
7333
7338
|
}
|
|
7334
7339
|
`;
|
|
@@ -7555,6 +7560,7 @@ var Button = (0, import_react23.forwardRef)(
|
|
|
7555
7560
|
type: "button",
|
|
7556
7561
|
...props,
|
|
7557
7562
|
...commonProps,
|
|
7563
|
+
"data-wui-button": true,
|
|
7558
7564
|
children: unstyled ? children : /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
7559
7565
|
ButtonContent,
|
|
7560
7566
|
{
|
|
@@ -7629,6 +7635,7 @@ var StyledMainIcon = import_styled_components22.default.div`
|
|
|
7629
7635
|
svg {
|
|
7630
7636
|
width: 24px;
|
|
7631
7637
|
height: 24px;
|
|
7638
|
+
flex: 0 0 24px;
|
|
7632
7639
|
}
|
|
7633
7640
|
}
|
|
7634
7641
|
`;
|
|
@@ -7655,6 +7662,7 @@ var StyledSecondaryIcon = import_styled_components22.default.div`
|
|
|
7655
7662
|
svg {
|
|
7656
7663
|
width: 24px;
|
|
7657
7664
|
height: 24px;
|
|
7665
|
+
flex: 0 0 24px;
|
|
7658
7666
|
}
|
|
7659
7667
|
}
|
|
7660
7668
|
`;
|
|
@@ -7990,6 +7998,7 @@ var StyledBadge = import_styled_components26.default.div`
|
|
|
7990
7998
|
color: var(--wui-color-icon);
|
|
7991
7999
|
height: 12px;
|
|
7992
8000
|
width: 12px;
|
|
8001
|
+
flex: 0 0 12px;
|
|
7993
8002
|
}
|
|
7994
8003
|
}
|
|
7995
8004
|
`;
|
|
@@ -12091,6 +12100,7 @@ var TagLabel = import_styled_components66.default.a`
|
|
|
12091
12100
|
svg {
|
|
12092
12101
|
height: 12px;
|
|
12093
12102
|
width: 12px;
|
|
12103
|
+
flex: 0 0 12px;
|
|
12094
12104
|
}
|
|
12095
12105
|
|
|
12096
12106
|
&:focus-visible {
|
|
@@ -12386,12 +12396,25 @@ var extractOptions = (children) => {
|
|
|
12386
12396
|
});
|
|
12387
12397
|
return options;
|
|
12388
12398
|
};
|
|
12399
|
+
var defaultDisplayValues = (values, onRemove) => {
|
|
12400
|
+
return values.map((selectedValue) => /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
12401
|
+
Tag,
|
|
12402
|
+
{
|
|
12403
|
+
href: "https://example.com",
|
|
12404
|
+
label: selectedValue,
|
|
12405
|
+
onClickRemove: () => onRemove(selectedValue),
|
|
12406
|
+
onClickRemoveLabel: `Remove ${selectedValue}`
|
|
12407
|
+
},
|
|
12408
|
+
selectedValue
|
|
12409
|
+
));
|
|
12410
|
+
};
|
|
12389
12411
|
var Combobox2 = ({
|
|
12390
12412
|
placeholder,
|
|
12391
12413
|
value = [],
|
|
12392
12414
|
onChange,
|
|
12393
12415
|
searchValue,
|
|
12394
12416
|
onSearchValueChange,
|
|
12417
|
+
displayValues = defaultDisplayValues,
|
|
12395
12418
|
children,
|
|
12396
12419
|
fullWidth = true
|
|
12397
12420
|
}) => {
|
|
@@ -12437,17 +12460,14 @@ var Combobox2 = ({
|
|
|
12437
12460
|
ref: comboboxWrapperRef,
|
|
12438
12461
|
$fullWidth: fullWidth,
|
|
12439
12462
|
children: [
|
|
12440
|
-
value
|
|
12441
|
-
|
|
12463
|
+
displayValues(value, handleRemoveValue),
|
|
12464
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
12465
|
+
ComboboxInput,
|
|
12442
12466
|
{
|
|
12443
|
-
|
|
12444
|
-
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
},
|
|
12448
|
-
selectedValue
|
|
12449
|
-
)),
|
|
12450
|
-
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(ComboboxInput, { placeholder })
|
|
12467
|
+
autoSelect: true,
|
|
12468
|
+
placeholder
|
|
12469
|
+
}
|
|
12470
|
+
)
|
|
12451
12471
|
]
|
|
12452
12472
|
}
|
|
12453
12473
|
),
|
|
@@ -12746,6 +12766,7 @@ var StyledLeftIconContainer = import_styled_components71.default.div`
|
|
|
12746
12766
|
svg {
|
|
12747
12767
|
height: var(--menu-item-left-icon-size);
|
|
12748
12768
|
width: var(--menu-item-left-icon-size);
|
|
12769
|
+
flex: 0 0 var(--menu-item-left-icon-size);
|
|
12749
12770
|
}
|
|
12750
12771
|
}
|
|
12751
12772
|
`;
|
|
@@ -12757,6 +12778,7 @@ var StyledRightIconContainer = import_styled_components71.default.div`
|
|
|
12757
12778
|
svg {
|
|
12758
12779
|
height: var(--menu-item-right-icon-size);
|
|
12759
12780
|
width: var(--menu-item-right-icon-size);
|
|
12781
|
+
flex: 0 0 var(--menu-item-right-icon-size);
|
|
12760
12782
|
}
|
|
12761
12783
|
}
|
|
12762
12784
|
`;
|
|
@@ -16279,6 +16301,7 @@ var segmentedControlItemStyles = import_styled_components108.css`
|
|
|
16279
16301
|
svg {
|
|
16280
16302
|
height: 16px;
|
|
16281
16303
|
width: 16px;
|
|
16304
|
+
flex: 0 0 16px;
|
|
16282
16305
|
|
|
16283
16306
|
/* add right margin if there's a label and an icon */
|
|
16284
16307
|
${({ $hasLabel }) => $hasLabel ? "margin-right: var(--wui-space-01)" : ""}
|
|
@@ -16428,6 +16451,7 @@ var StyledTrigger2 = (0, import_styled_components109.default)(import_react_selec
|
|
|
16428
16451
|
&:disabled {
|
|
16429
16452
|
outline-color: var(--wui-color-border-disabled);
|
|
16430
16453
|
background-color: var(--wui-color-bg-surface-disabled);
|
|
16454
|
+
cursor: not-allowed;
|
|
16431
16455
|
}
|
|
16432
16456
|
|
|
16433
16457
|
&[data-placeholder] {
|
|
@@ -16459,42 +16483,43 @@ var Select = (0, import_react90.forwardRef)(
|
|
|
16459
16483
|
onChange = () => null,
|
|
16460
16484
|
placeholder = "Select...",
|
|
16461
16485
|
fullWidth = false,
|
|
16486
|
+
forceOpen = false,
|
|
16462
16487
|
...props
|
|
16463
16488
|
}, forwardedRef) => {
|
|
16464
16489
|
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
16465
|
-
|
|
16466
|
-
|
|
16467
|
-
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
|
|
16481
|
-
|
|
16482
|
-
|
|
16483
|
-
|
|
16484
|
-
|
|
16485
|
-
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
}
|
|
16497
|
-
);
|
|
16490
|
+
const rootProps = {
|
|
16491
|
+
...props,
|
|
16492
|
+
onValueChange: onChange
|
|
16493
|
+
};
|
|
16494
|
+
if (forceOpen) {
|
|
16495
|
+
rootProps["open"] = true;
|
|
16496
|
+
}
|
|
16497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(import_react_select.Root, { ...rootProps, children: [
|
|
16498
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(
|
|
16499
|
+
StyledTrigger2,
|
|
16500
|
+
{
|
|
16501
|
+
ref: forwardedRef,
|
|
16502
|
+
$colorScheme: colorScheme,
|
|
16503
|
+
$fullWidth: responsiveFullWidth,
|
|
16504
|
+
...props,
|
|
16505
|
+
children: [
|
|
16506
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_react_select.Value, { placeholder }),
|
|
16507
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
16508
|
+
Icon,
|
|
16509
|
+
{
|
|
16510
|
+
size: "md",
|
|
16511
|
+
type: "caret-down"
|
|
16512
|
+
}
|
|
16513
|
+
)
|
|
16514
|
+
]
|
|
16515
|
+
}
|
|
16516
|
+
),
|
|
16517
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(StyledContent3, { position: "popper", children: [
|
|
16518
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_react_select.ScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(Icon, { type: "caret-up" }) }),
|
|
16519
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_react_select.Viewport, { children }),
|
|
16520
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_react_select.ScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(Icon, { type: "caret-down" }) })
|
|
16521
|
+
] }) })
|
|
16522
|
+
] });
|
|
16498
16523
|
}
|
|
16499
16524
|
);
|
|
16500
16525
|
Select.displayName = "Select_UI";
|
|
@@ -17019,6 +17044,7 @@ var StyledThumbnailBadge = import_styled_components122.default.div`
|
|
|
17019
17044
|
svg {
|
|
17020
17045
|
height: 12px;
|
|
17021
17046
|
width: 12px;
|
|
17047
|
+
flex: 0 0 12px;
|
|
17022
17048
|
|
|
17023
17049
|
path {
|
|
17024
17050
|
color: var(--wui-color-icon-on-fill);
|
|
@@ -17717,6 +17743,72 @@ var WistiaLogo = ({
|
|
|
17717
17743
|
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("a", { href, children: Logo }) : Logo;
|
|
17718
17744
|
};
|
|
17719
17745
|
WistiaLogo.displayName = "WistiaLogo_UI";
|
|
17746
|
+
|
|
17747
|
+
// src/components/SplitButton/SplitButton.tsx
|
|
17748
|
+
var import_styled_components128 = __toESM(require("styled-components"));
|
|
17749
|
+
var import_type_guards75 = require("@wistia/type-guards");
|
|
17750
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
17751
|
+
var StyledSplitButton = import_styled_components128.default.span`
|
|
17752
|
+
> [data-wui-button='true']:first-child {
|
|
17753
|
+
border-top-right-radius: 0;
|
|
17754
|
+
border-bottom-right-radius: 0;
|
|
17755
|
+
}
|
|
17756
|
+
|
|
17757
|
+
> [data-wui-button='true']:last-child {
|
|
17758
|
+
border-top-left-radius: 0;
|
|
17759
|
+
border-bottom-left-radius: 0;
|
|
17760
|
+
display: inline-flex;
|
|
17761
|
+
}
|
|
17762
|
+
`;
|
|
17763
|
+
var SplitButton = ({
|
|
17764
|
+
children,
|
|
17765
|
+
menuLabel,
|
|
17766
|
+
menuIcon = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(Icon, { type: "caret-down" }),
|
|
17767
|
+
menuItems,
|
|
17768
|
+
disabled = false,
|
|
17769
|
+
colorScheme = "default",
|
|
17770
|
+
variant = "solid",
|
|
17771
|
+
secondaryAction,
|
|
17772
|
+
size = "md",
|
|
17773
|
+
unstyled = false,
|
|
17774
|
+
...props
|
|
17775
|
+
}) => {
|
|
17776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(StyledSplitButton, { children: [
|
|
17777
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
17778
|
+
Button,
|
|
17779
|
+
{
|
|
17780
|
+
colorScheme,
|
|
17781
|
+
disabled,
|
|
17782
|
+
size,
|
|
17783
|
+
unstyled,
|
|
17784
|
+
variant,
|
|
17785
|
+
...props,
|
|
17786
|
+
children
|
|
17787
|
+
}
|
|
17788
|
+
),
|
|
17789
|
+
(0, import_type_guards75.isNotNil)(menuItems) && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
17790
|
+
Menu,
|
|
17791
|
+
{
|
|
17792
|
+
disabled,
|
|
17793
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
17794
|
+
IconButton,
|
|
17795
|
+
{
|
|
17796
|
+
colorScheme,
|
|
17797
|
+
disabled,
|
|
17798
|
+
label: menuLabel,
|
|
17799
|
+
size,
|
|
17800
|
+
unstyled,
|
|
17801
|
+
variant,
|
|
17802
|
+
children: menuIcon
|
|
17803
|
+
}
|
|
17804
|
+
),
|
|
17805
|
+
children: menuItems
|
|
17806
|
+
}
|
|
17807
|
+
),
|
|
17808
|
+
(0, import_type_guards75.isNotNil)(secondaryAction) && secondaryAction
|
|
17809
|
+
] });
|
|
17810
|
+
};
|
|
17811
|
+
SplitButton.displayName = "SplitButton_UI";
|
|
17720
17812
|
// Annotate the CommonJS export names for ESM import in node:
|
|
17721
17813
|
0 && (module.exports = {
|
|
17722
17814
|
ActionButton,
|
|
@@ -17822,6 +17914,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
|
|
|
17822
17914
|
SelectOption,
|
|
17823
17915
|
SelectOptionGroup,
|
|
17824
17916
|
Slider,
|
|
17917
|
+
SplitButton,
|
|
17825
17918
|
Stack,
|
|
17826
17919
|
SubMenu,
|
|
17827
17920
|
Switch,
|