@wistia/ui 0.14.36 → 0.14.37
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 +78 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +182 -138
- package/dist/index.d.ts +182 -138
- package/dist/index.mjs +80 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.14.
|
|
3
|
+
* @license @wistia/ui v0.14.37
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7382,6 +7382,7 @@ var Button = forwardRef2(
|
|
|
7382
7382
|
type: "button",
|
|
7383
7383
|
...props,
|
|
7384
7384
|
...commonProps,
|
|
7385
|
+
"data-wui-button": true,
|
|
7385
7386
|
children: unstyled ? children : /* @__PURE__ */ jsx198(
|
|
7386
7387
|
ButtonContent,
|
|
7387
7388
|
{
|
|
@@ -11016,7 +11017,7 @@ import { useCallback as useCallback13, useEffect as useEffect11, useRef as useRe
|
|
|
11016
11017
|
import { parseHex as parseHex2 } from "culori/fn";
|
|
11017
11018
|
|
|
11018
11019
|
// src/components/Input/Input.tsx
|
|
11019
|
-
import { forwardRef as forwardRef15, cloneElement as cloneElement4, useRef as useRef9 } from "react";
|
|
11020
|
+
import { isValidElement as isValidElement2, forwardRef as forwardRef15, cloneElement as cloneElement4, useRef as useRef9 } from "react";
|
|
11020
11021
|
import styled44, { css as css29 } from "styled-components";
|
|
11021
11022
|
import { isNil as isNil13, isNotNil as isNotNil18, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
11022
11023
|
|
|
@@ -11172,14 +11173,14 @@ var Input = forwardRef15(
|
|
|
11172
11173
|
if (isNil13(leftIcon) && type === "search") {
|
|
11173
11174
|
leftIconToDisplay = /* @__PURE__ */ jsx247(Icon, { type: "search" });
|
|
11174
11175
|
}
|
|
11175
|
-
if (isNotNil18(leftIconToDisplay)) {
|
|
11176
|
+
if (isNotNil18(leftIconToDisplay) && isValidElement2(leftIconToDisplay)) {
|
|
11176
11177
|
leftIconToDisplay = cloneElement4(leftIconToDisplay, {
|
|
11177
11178
|
size: "md",
|
|
11178
11179
|
className: "wui-input-left-icon"
|
|
11179
11180
|
});
|
|
11180
11181
|
}
|
|
11181
11182
|
let rightIconToDisplay = rightIcon;
|
|
11182
|
-
if (isNotNil18(rightIconToDisplay)) {
|
|
11183
|
+
if (isNotNil18(rightIconToDisplay) && isValidElement2(rightIconToDisplay)) {
|
|
11183
11184
|
rightIconToDisplay = cloneElement4(rightIconToDisplay, {
|
|
11184
11185
|
size: "md",
|
|
11185
11186
|
className: "wui-input-right-icon"
|
|
@@ -11913,7 +11914,7 @@ import {
|
|
|
11913
11914
|
useTransition,
|
|
11914
11915
|
useEffect as useEffect15,
|
|
11915
11916
|
Children as Children5,
|
|
11916
|
-
isValidElement as
|
|
11917
|
+
isValidElement as isValidElement3
|
|
11917
11918
|
} from "react";
|
|
11918
11919
|
import { matchSorter } from "match-sorter";
|
|
11919
11920
|
import styled50 from "styled-components";
|
|
@@ -12229,7 +12230,7 @@ var ComboboxOption = ({ value, children }) => {
|
|
|
12229
12230
|
var extractOptions = (children) => {
|
|
12230
12231
|
const options = {};
|
|
12231
12232
|
Children5.forEach(children, (child) => {
|
|
12232
|
-
if (
|
|
12233
|
+
if (isValidElement3(child) && "value" in child.props && "children" in child.props) {
|
|
12233
12234
|
options[child.props.value] = child.props.children ?? child.props.value;
|
|
12234
12235
|
}
|
|
12235
12236
|
});
|
|
@@ -12676,10 +12677,10 @@ var MenuItemButton = forwardRef18(({ children, appearance, command, icon, ...pro
|
|
|
12676
12677
|
fullWidth: true,
|
|
12677
12678
|
unstyled: true,
|
|
12678
12679
|
children: [
|
|
12679
|
-
props.leftIcon ? /* @__PURE__ */ jsx257(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
12680
|
+
isNotNil21(props.leftIcon) ? /* @__PURE__ */ jsx257(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
12680
12681
|
/* @__PURE__ */ jsx257(StyledLabelAndDescriptionContainer, { children }),
|
|
12681
12682
|
isNotNil21(badge) || isNotNil21(command) ? /* @__PURE__ */ jsx257(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
12682
|
-
props.rightIcon ? /* @__PURE__ */ jsx257(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
12683
|
+
isNotNil21(props.rightIcon) ? /* @__PURE__ */ jsx257(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
12683
12684
|
]
|
|
12684
12685
|
}
|
|
12685
12686
|
);
|
|
@@ -17608,6 +17609,76 @@ var WistiaLogo = ({
|
|
|
17608
17609
|
return href !== void 0 ? /* @__PURE__ */ jsx324("a", { href, children: Logo }) : Logo;
|
|
17609
17610
|
};
|
|
17610
17611
|
WistiaLogo.displayName = "WistiaLogo_UI";
|
|
17612
|
+
|
|
17613
|
+
// src/components/SplitButton/SplitButton.tsx
|
|
17614
|
+
import styled109 from "styled-components";
|
|
17615
|
+
import { isNotNil as isNotNil45 } from "@wistia/type-guards";
|
|
17616
|
+
import { jsx as jsx325, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
17617
|
+
var StyledSplitButton = styled109.span`
|
|
17618
|
+
white-space: nowrap;
|
|
17619
|
+
|
|
17620
|
+
> [data-wui-button='true']:first-child {
|
|
17621
|
+
border-top-right-radius: 0;
|
|
17622
|
+
border-bottom-right-radius: 0;
|
|
17623
|
+
}
|
|
17624
|
+
|
|
17625
|
+
> [data-wui-button='true']:last-child {
|
|
17626
|
+
border-top-left-radius: 0;
|
|
17627
|
+
border-bottom-left-radius: 0;
|
|
17628
|
+
display: inline-flex;
|
|
17629
|
+
}
|
|
17630
|
+
`;
|
|
17631
|
+
var SplitButton = ({
|
|
17632
|
+
children,
|
|
17633
|
+
menuLabel = "Select an option",
|
|
17634
|
+
menuIcon = /* @__PURE__ */ jsx325(Icon, { type: "caret-down" }),
|
|
17635
|
+
menuItems,
|
|
17636
|
+
disabled = false,
|
|
17637
|
+
colorScheme = "default",
|
|
17638
|
+
variant = "solid",
|
|
17639
|
+
secondaryAction,
|
|
17640
|
+
size = "md",
|
|
17641
|
+
unstyled = false,
|
|
17642
|
+
menuProps = {},
|
|
17643
|
+
...props
|
|
17644
|
+
}) => {
|
|
17645
|
+
return /* @__PURE__ */ jsxs70(StyledSplitButton, { children: [
|
|
17646
|
+
/* @__PURE__ */ jsx325(
|
|
17647
|
+
Button,
|
|
17648
|
+
{
|
|
17649
|
+
colorScheme,
|
|
17650
|
+
disabled,
|
|
17651
|
+
size,
|
|
17652
|
+
unstyled,
|
|
17653
|
+
variant,
|
|
17654
|
+
...props,
|
|
17655
|
+
children
|
|
17656
|
+
}
|
|
17657
|
+
),
|
|
17658
|
+
isNotNil45(menuItems) && /* @__PURE__ */ jsx325(
|
|
17659
|
+
Menu,
|
|
17660
|
+
{
|
|
17661
|
+
...menuProps,
|
|
17662
|
+
disabled,
|
|
17663
|
+
trigger: /* @__PURE__ */ jsx325(
|
|
17664
|
+
IconButton,
|
|
17665
|
+
{
|
|
17666
|
+
colorScheme,
|
|
17667
|
+
disabled,
|
|
17668
|
+
label: menuLabel,
|
|
17669
|
+
size,
|
|
17670
|
+
unstyled,
|
|
17671
|
+
variant,
|
|
17672
|
+
children: menuIcon
|
|
17673
|
+
}
|
|
17674
|
+
),
|
|
17675
|
+
children: menuItems
|
|
17676
|
+
}
|
|
17677
|
+
),
|
|
17678
|
+
isNotNil45(secondaryAction) && secondaryAction
|
|
17679
|
+
] });
|
|
17680
|
+
};
|
|
17681
|
+
SplitButton.displayName = "SplitButton_UI";
|
|
17611
17682
|
export {
|
|
17612
17683
|
ActionButton,
|
|
17613
17684
|
Avatar,
|
|
@@ -17712,6 +17783,7 @@ export {
|
|
|
17712
17783
|
SelectOption,
|
|
17713
17784
|
SelectOptionGroup,
|
|
17714
17785
|
Slider,
|
|
17786
|
+
SplitButton,
|
|
17715
17787
|
Stack,
|
|
17716
17788
|
SubMenu,
|
|
17717
17789
|
Switch,
|