@wistia/ui 0.14.34 → 0.14.35
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 +34 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +51 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1578,6 +1578,10 @@ type ComboboxProps = {
|
|
|
1578
1578
|
* The options to display in the combobox
|
|
1579
1579
|
*/
|
|
1580
1580
|
children: ReactNode;
|
|
1581
|
+
/**
|
|
1582
|
+
* Function to render the selected values. Receives the selected values and a function to remove a value.
|
|
1583
|
+
*/
|
|
1584
|
+
displayValues?: (values: string[], onRemove: (value: string) => void) => ReactNode;
|
|
1581
1585
|
/**
|
|
1582
1586
|
* The placeholder text for the combobox input
|
|
1583
1587
|
*/
|
|
@@ -1599,7 +1603,7 @@ type ComboboxProps = {
|
|
|
1599
1603
|
*/
|
|
1600
1604
|
value: string[];
|
|
1601
1605
|
};
|
|
1602
|
-
declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchValueChange, children, fullWidth, }: ComboboxProps) => react_jsx_runtime.JSX.Element;
|
|
1606
|
+
declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchValueChange, displayValues, children, fullWidth, }: ComboboxProps) => react_jsx_runtime.JSX.Element;
|
|
1603
1607
|
|
|
1604
1608
|
type ContextMenuProps = {
|
|
1605
1609
|
children: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -1578,6 +1578,10 @@ type ComboboxProps = {
|
|
|
1578
1578
|
* The options to display in the combobox
|
|
1579
1579
|
*/
|
|
1580
1580
|
children: ReactNode;
|
|
1581
|
+
/**
|
|
1582
|
+
* Function to render the selected values. Receives the selected values and a function to remove a value.
|
|
1583
|
+
*/
|
|
1584
|
+
displayValues?: (values: string[], onRemove: (value: string) => void) => ReactNode;
|
|
1581
1585
|
/**
|
|
1582
1586
|
* The placeholder text for the combobox input
|
|
1583
1587
|
*/
|
|
@@ -1599,7 +1603,7 @@ type ComboboxProps = {
|
|
|
1599
1603
|
*/
|
|
1600
1604
|
value: string[];
|
|
1601
1605
|
};
|
|
1602
|
-
declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchValueChange, children, fullWidth, }: ComboboxProps) => react_jsx_runtime.JSX.Element;
|
|
1606
|
+
declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchValueChange, displayValues, children, fullWidth, }: ComboboxProps) => react_jsx_runtime.JSX.Element;
|
|
1603
1607
|
|
|
1604
1608
|
type ContextMenuProps = {
|
|
1605
1609
|
children: ReactNode;
|
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.35
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -1474,12 +1474,12 @@ var toastConfig = {
|
|
|
1474
1474
|
var ToastProvider = () => /* @__PURE__ */ jsx2(Toaster, { ...toastConfig });
|
|
1475
1475
|
|
|
1476
1476
|
// src/providers/UIProvider/UIProvider.tsx
|
|
1477
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1477
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1478
1478
|
var UIProviderNestingContext = createContext2(false);
|
|
1479
1479
|
var UIProvider = ({ children }) => {
|
|
1480
1480
|
const isNested = useContext(UIProviderNestingContext);
|
|
1481
1481
|
if (isNested) {
|
|
1482
|
-
|
|
1482
|
+
return /* @__PURE__ */ jsx3(Fragment, { children });
|
|
1483
1483
|
}
|
|
1484
1484
|
return /* @__PURE__ */ jsx3(UIProviderNestingContext.Provider, { value: true, children: /* @__PURE__ */ jsx3(AriaLiveProvider, { children: /* @__PURE__ */ jsxs(TooltipProvider, { children: [
|
|
1485
1485
|
/* @__PURE__ */ jsx3(GlobalStyle, {}),
|
|
@@ -2793,6 +2793,7 @@ var StyledToast = styled2.div`
|
|
|
2793
2793
|
svg {
|
|
2794
2794
|
height: 16px;
|
|
2795
2795
|
width: 16px;
|
|
2796
|
+
flex: 0 0 16px;
|
|
2796
2797
|
}
|
|
2797
2798
|
`;
|
|
2798
2799
|
var Action = ({ actionButton }) => {
|
|
@@ -3014,6 +3015,7 @@ var buttonBaseStyles = css16`
|
|
|
3014
3015
|
color: var(--button-color-icon);
|
|
3015
3016
|
width: var(--button-icon-size);
|
|
3016
3017
|
height: var(--button-icon-size);
|
|
3018
|
+
flex: 0 0 var(--button-icon-size);
|
|
3017
3019
|
}
|
|
3018
3020
|
}
|
|
3019
3021
|
|
|
@@ -7062,6 +7064,7 @@ var StyledIcon = styled3.svg`
|
|
|
7062
7064
|
--wui-icon-size: var(--wui-icon-inline-size, ${({ $height }) => $height}px);
|
|
7063
7065
|
--wui-icon-vertical-align: middle;
|
|
7064
7066
|
|
|
7067
|
+
flex: 0 0 var(--wui-icon-size);
|
|
7065
7068
|
height: var(--wui-icon-size);
|
|
7066
7069
|
width: var(--wui-icon-size);
|
|
7067
7070
|
`;
|
|
@@ -7152,6 +7155,7 @@ var StyledLink = styled4.a`
|
|
|
7152
7155
|
svg {
|
|
7153
7156
|
width: 14px;
|
|
7154
7157
|
height: 14px;
|
|
7158
|
+
flex: 0 0 14px;
|
|
7155
7159
|
}
|
|
7156
7160
|
}
|
|
7157
7161
|
`;
|
|
@@ -7253,7 +7257,7 @@ var Link = forwardRef(
|
|
|
7253
7257
|
Link.displayName = "Link_UI";
|
|
7254
7258
|
|
|
7255
7259
|
// src/components/Button/Button.tsx
|
|
7256
|
-
import { Fragment, jsx as jsx198, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
7260
|
+
import { Fragment as Fragment2, jsx as jsx198, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
7257
7261
|
var isLink2 = (props) => isNotUndefined4(props.href);
|
|
7258
7262
|
var StyledButton = styled5.button`
|
|
7259
7263
|
${buttonResetCss}
|
|
@@ -7290,7 +7294,7 @@ var ButtonContent = ({
|
|
|
7290
7294
|
children,
|
|
7291
7295
|
fullWidth = false
|
|
7292
7296
|
}) => {
|
|
7293
|
-
return /* @__PURE__ */ jsxs9(
|
|
7297
|
+
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
7294
7298
|
isLoading ? /* @__PURE__ */ jsx198(StyledButtonLoading, { children: /* @__PURE__ */ jsx198(Icon, { type: "spinner" }) }) : null,
|
|
7295
7299
|
/* @__PURE__ */ jsxs9(
|
|
7296
7300
|
StyledButtonContent,
|
|
@@ -7452,6 +7456,7 @@ var StyledMainIcon = styled6.div`
|
|
|
7452
7456
|
svg {
|
|
7453
7457
|
width: 24px;
|
|
7454
7458
|
height: 24px;
|
|
7459
|
+
flex: 0 0 24px;
|
|
7455
7460
|
}
|
|
7456
7461
|
}
|
|
7457
7462
|
`;
|
|
@@ -7478,6 +7483,7 @@ var StyledSecondaryIcon = styled6.div`
|
|
|
7478
7483
|
svg {
|
|
7479
7484
|
width: 24px;
|
|
7480
7485
|
height: 24px;
|
|
7486
|
+
flex: 0 0 24px;
|
|
7481
7487
|
}
|
|
7482
7488
|
}
|
|
7483
7489
|
`;
|
|
@@ -7813,6 +7819,7 @@ var StyledBadge = styled10.div`
|
|
|
7813
7819
|
color: var(--wui-color-icon);
|
|
7814
7820
|
height: 12px;
|
|
7815
7821
|
width: 12px;
|
|
7822
|
+
flex: 0 0 12px;
|
|
7816
7823
|
}
|
|
7817
7824
|
}
|
|
7818
7825
|
`;
|
|
@@ -8517,7 +8524,7 @@ var IconButton = forwardRef8(
|
|
|
8517
8524
|
IconButton.displayName = "IconButton_UI";
|
|
8518
8525
|
|
|
8519
8526
|
// src/components/Banner/Banner.tsx
|
|
8520
|
-
import { Fragment as
|
|
8527
|
+
import { Fragment as Fragment3, jsx as jsx209, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
8521
8528
|
var BREAKPOINT_WIDTH = 600;
|
|
8522
8529
|
var VERTICAL_BREAKPOINT_WIDTH = 284;
|
|
8523
8530
|
var MIN_IMAGE_WIDTH = 400;
|
|
@@ -8633,7 +8640,7 @@ var Banner = ({
|
|
|
8633
8640
|
justifyContent: "center",
|
|
8634
8641
|
children: [
|
|
8635
8642
|
isNotNil13(headingText) ? /* @__PURE__ */ jsxs13(Heading, { variant: headingVariant, children: [
|
|
8636
|
-
iconPosition === "inline" && /* @__PURE__ */ jsxs13(
|
|
8643
|
+
iconPosition === "inline" && /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
8637
8644
|
icon,
|
|
8638
8645
|
" "
|
|
8639
8646
|
] }),
|
|
@@ -8682,7 +8689,7 @@ Banner.displayName = "Banner_UI";
|
|
|
8682
8689
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
8683
8690
|
import { Children as Children2 } from "react";
|
|
8684
8691
|
import styled17 from "styled-components";
|
|
8685
|
-
import { Fragment as
|
|
8692
|
+
import { Fragment as Fragment4, jsx as jsx210, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
8686
8693
|
var StyledBreadcrumbs = styled17.nav`
|
|
8687
8694
|
display: flex;
|
|
8688
8695
|
align-items: center;
|
|
@@ -8701,7 +8708,7 @@ var Breadcrumbs = ({ children, ...props }) => {
|
|
|
8701
8708
|
crumbs = crumbs.slice(-1);
|
|
8702
8709
|
}
|
|
8703
8710
|
const crumbMaxWidth = Math.floor(100 / crumbs.length) - BUFFER_WIDTH;
|
|
8704
|
-
return /* @__PURE__ */ jsxs14(
|
|
8711
|
+
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
8705
8712
|
/* @__PURE__ */ jsx210("style", { type: "text/css", children: `
|
|
8706
8713
|
[data-wui-breadcrumbs] {
|
|
8707
8714
|
container-type: inline-size;
|
|
@@ -8729,7 +8736,7 @@ Breadcrumbs.displayName = "Breadcrumbs_UI";
|
|
|
8729
8736
|
|
|
8730
8737
|
// src/components/Breadcrumbs/Breadcrumb.tsx
|
|
8731
8738
|
import styled18 from "styled-components";
|
|
8732
|
-
import { Fragment as
|
|
8739
|
+
import { Fragment as Fragment5, jsx as jsx211, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
8733
8740
|
var BreadcrumbContent = styled18.span`
|
|
8734
8741
|
overflow: hidden;
|
|
8735
8742
|
white-space: nowrap;
|
|
@@ -8739,7 +8746,7 @@ var BreadcrumbContent = styled18.span`
|
|
|
8739
8746
|
flex: 0;
|
|
8740
8747
|
`;
|
|
8741
8748
|
var Breadcrumb = ({ icon, href, children, ...props }) => {
|
|
8742
|
-
return /* @__PURE__ */ jsxs15(
|
|
8749
|
+
return /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
8743
8750
|
/* @__PURE__ */ jsx211(
|
|
8744
8751
|
Button,
|
|
8745
8752
|
{
|
|
@@ -9520,7 +9527,7 @@ CollapsibleTriggerIcon.displayName = "CollapsibleTriggerIcon_UI";
|
|
|
9520
9527
|
import styled30 from "styled-components";
|
|
9521
9528
|
import { Content } from "@radix-ui/react-collapsible";
|
|
9522
9529
|
import { isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
|
|
9523
|
-
import { Fragment as
|
|
9530
|
+
import { Fragment as Fragment6, jsx as jsx225, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
9524
9531
|
var ClampedContent = styled30.div`
|
|
9525
9532
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
9526
9533
|
`;
|
|
@@ -9535,7 +9542,7 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
9535
9542
|
}
|
|
9536
9543
|
);
|
|
9537
9544
|
}
|
|
9538
|
-
return /* @__PURE__ */ jsx225(Content, { children: /* @__PURE__ */ jsxs19(
|
|
9545
|
+
return /* @__PURE__ */ jsx225(Content, { children: /* @__PURE__ */ jsxs19(Fragment6, { children: [
|
|
9539
9546
|
children,
|
|
9540
9547
|
" "
|
|
9541
9548
|
] }) });
|
|
@@ -11915,7 +11922,7 @@ import styled50 from "styled-components";
|
|
|
11915
11922
|
import { forwardRef as forwardRef16 } from "react";
|
|
11916
11923
|
import styled49 from "styled-components";
|
|
11917
11924
|
import { isNil as isNil14, isNotNil as isNotNil19, isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
|
|
11918
|
-
import { Fragment as
|
|
11925
|
+
import { Fragment as Fragment7, jsx as jsx253, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11919
11926
|
var TagLabel = styled49.a`
|
|
11920
11927
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11921
11928
|
font-size: var(--wui-typography-label-4-size);
|
|
@@ -11932,6 +11939,7 @@ var TagLabel = styled49.a`
|
|
|
11932
11939
|
svg {
|
|
11933
11940
|
height: 12px;
|
|
11934
11941
|
width: 12px;
|
|
11942
|
+
flex: 0 0 12px;
|
|
11935
11943
|
}
|
|
11936
11944
|
|
|
11937
11945
|
&:focus-visible {
|
|
@@ -12007,7 +12015,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12007
12015
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
12008
12016
|
);
|
|
12009
12017
|
}
|
|
12010
|
-
return /* @__PURE__ */ jsxs33(
|
|
12018
|
+
return /* @__PURE__ */ jsxs33(Fragment7, { children: [
|
|
12011
12019
|
/* @__PURE__ */ jsx253(TagDivider, { $colorScheme: colorScheme }),
|
|
12012
12020
|
/* @__PURE__ */ jsxs33(
|
|
12013
12021
|
StyledRemoveButton,
|
|
@@ -12227,12 +12235,25 @@ var extractOptions = (children) => {
|
|
|
12227
12235
|
});
|
|
12228
12236
|
return options;
|
|
12229
12237
|
};
|
|
12238
|
+
var defaultDisplayValues = (values, onRemove) => {
|
|
12239
|
+
return values.map((selectedValue) => /* @__PURE__ */ jsx254(
|
|
12240
|
+
Tag,
|
|
12241
|
+
{
|
|
12242
|
+
href: "https://example.com",
|
|
12243
|
+
label: selectedValue,
|
|
12244
|
+
onClickRemove: () => onRemove(selectedValue),
|
|
12245
|
+
onClickRemoveLabel: `Remove ${selectedValue}`
|
|
12246
|
+
},
|
|
12247
|
+
selectedValue
|
|
12248
|
+
));
|
|
12249
|
+
};
|
|
12230
12250
|
var Combobox2 = ({
|
|
12231
12251
|
placeholder,
|
|
12232
12252
|
value = [],
|
|
12233
12253
|
onChange,
|
|
12234
12254
|
searchValue,
|
|
12235
12255
|
onSearchValueChange,
|
|
12256
|
+
displayValues = defaultDisplayValues,
|
|
12236
12257
|
children,
|
|
12237
12258
|
fullWidth = true
|
|
12238
12259
|
}) => {
|
|
@@ -12278,17 +12299,14 @@ var Combobox2 = ({
|
|
|
12278
12299
|
ref: comboboxWrapperRef,
|
|
12279
12300
|
$fullWidth: fullWidth,
|
|
12280
12301
|
children: [
|
|
12281
|
-
value
|
|
12282
|
-
|
|
12302
|
+
displayValues(value, handleRemoveValue),
|
|
12303
|
+
/* @__PURE__ */ jsx254(
|
|
12304
|
+
ComboboxInput,
|
|
12283
12305
|
{
|
|
12284
|
-
|
|
12285
|
-
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
},
|
|
12289
|
-
selectedValue
|
|
12290
|
-
)),
|
|
12291
|
-
/* @__PURE__ */ jsx254(ComboboxInput, { placeholder })
|
|
12306
|
+
autoSelect: true,
|
|
12307
|
+
placeholder
|
|
12308
|
+
}
|
|
12309
|
+
)
|
|
12292
12310
|
]
|
|
12293
12311
|
}
|
|
12294
12312
|
),
|
|
@@ -12599,6 +12617,7 @@ var StyledLeftIconContainer = styled53.div`
|
|
|
12599
12617
|
svg {
|
|
12600
12618
|
height: var(--menu-item-left-icon-size);
|
|
12601
12619
|
width: var(--menu-item-left-icon-size);
|
|
12620
|
+
flex: 0 0 var(--menu-item-left-icon-size);
|
|
12602
12621
|
}
|
|
12603
12622
|
}
|
|
12604
12623
|
`;
|
|
@@ -12610,6 +12629,7 @@ var StyledRightIconContainer = styled53.div`
|
|
|
12610
12629
|
svg {
|
|
12611
12630
|
height: var(--menu-item-right-icon-size);
|
|
12612
12631
|
width: var(--menu-item-right-icon-size);
|
|
12632
|
+
flex: 0 0 var(--menu-item-right-icon-size);
|
|
12613
12633
|
}
|
|
12614
12634
|
}
|
|
12615
12635
|
`;
|
|
@@ -13481,7 +13501,7 @@ Divider.displayName = "Divider_UI";
|
|
|
13481
13501
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
13482
13502
|
import styled62, { css as css33 } from "styled-components";
|
|
13483
13503
|
import { useState as useState18, useRef as useRef16 } from "react";
|
|
13484
|
-
import { Fragment as
|
|
13504
|
+
import { Fragment as Fragment8, jsx as jsx274, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
13485
13505
|
var StyledInput = styled62(Input)`
|
|
13486
13506
|
&:not([rows]) {
|
|
13487
13507
|
min-height: unset;
|
|
@@ -13601,7 +13621,7 @@ var EditableHeading = ({
|
|
|
13601
13621
|
}
|
|
13602
13622
|
);
|
|
13603
13623
|
}
|
|
13604
|
-
return /* @__PURE__ */ jsxs42(
|
|
13624
|
+
return /* @__PURE__ */ jsxs42(Fragment8, { children: [
|
|
13605
13625
|
/* @__PURE__ */ jsx274(Tooltip, { content: tooltipText, children: HeadingComponent2 }),
|
|
13606
13626
|
/* @__PURE__ */ jsx274(ScreenReaderOnly, { children: /* @__PURE__ */ jsx274(
|
|
13607
13627
|
"button",
|
|
@@ -14140,7 +14160,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
14140
14160
|
import { Children as Children10, cloneElement as cloneElement8, useContext as useContext13 } from "react";
|
|
14141
14161
|
import styled66 from "styled-components";
|
|
14142
14162
|
import { isArray as isArray3, isNotNil as isNotNil28, isNotUndefined as isNotUndefined12, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
14143
|
-
import { Fragment as
|
|
14163
|
+
import { Fragment as Fragment9, jsx as jsx281, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
14144
14164
|
var StyledFormField = styled66.div`
|
|
14145
14165
|
--form-field-spacing: var(--wui-space-01);
|
|
14146
14166
|
--form-field-spacing-inline: var(--wui-space-02);
|
|
@@ -14281,7 +14301,7 @@ var FormField = ({
|
|
|
14281
14301
|
!isIntegratedLabel && /* @__PURE__ */ jsx281(Label, { htmlFor: computedId, children: label }),
|
|
14282
14302
|
isNotNil28(description) ? /* @__PURE__ */ jsx281(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
14283
14303
|
cloneElement8(children, childProps),
|
|
14284
|
-
isNotNil28(computedError) ? /* @__PURE__ */ jsxs46(
|
|
14304
|
+
isNotNil28(computedError) ? /* @__PURE__ */ jsxs46(Fragment9, { children: [
|
|
14285
14305
|
/* @__PURE__ */ jsx281("div", {}),
|
|
14286
14306
|
/* @__PURE__ */ jsx281(
|
|
14287
14307
|
ErrorMessages,
|
|
@@ -16132,6 +16152,7 @@ var segmentedControlItemStyles = css44`
|
|
|
16132
16152
|
svg {
|
|
16133
16153
|
height: 16px;
|
|
16134
16154
|
width: 16px;
|
|
16155
|
+
flex: 0 0 16px;
|
|
16135
16156
|
|
|
16136
16157
|
/* add right margin if there's a label and an icon */
|
|
16137
16158
|
${({ $hasLabel }) => $hasLabel ? "margin-right: var(--wui-space-01)" : ""}
|
|
@@ -16886,6 +16907,7 @@ var StyledThumbnailBadge = styled104.div`
|
|
|
16886
16907
|
svg {
|
|
16887
16908
|
height: 12px;
|
|
16888
16909
|
width: 12px;
|
|
16910
|
+
flex: 0 0 12px;
|
|
16889
16911
|
|
|
16890
16912
|
path {
|
|
16891
16913
|
color: var(--wui-color-icon-on-fill);
|