@wistia/ui 0.14.23 → 0.14.24-beta.9c5d52fa.6eeab65
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 +119 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.mjs +55 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +31 -31
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.24-beta.9c5d52fa.6eeab65
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -116,6 +116,7 @@ __export(index_exports, {
|
|
|
116
116
|
Label: () => Label,
|
|
117
117
|
Link: () => Link,
|
|
118
118
|
List: () => List,
|
|
119
|
+
Mark: () => Mark,
|
|
119
120
|
Menu: () => Menu,
|
|
120
121
|
MenuItem: () => MenuItem,
|
|
121
122
|
MenuItemDescription: () => MenuItemDescription,
|
|
@@ -124,7 +125,7 @@ __export(index_exports, {
|
|
|
124
125
|
MenuRadioGroup: () => MenuRadioGroup,
|
|
125
126
|
Modal: () => Modal,
|
|
126
127
|
PersistentFileAmountLimitValidator: () => import_validators.PersistentFileAmountLimitValidator,
|
|
127
|
-
Popover: () =>
|
|
128
|
+
Popover: () => Popover,
|
|
128
129
|
ProgressBar: () => ProgressBar,
|
|
129
130
|
Radio: () => Radio,
|
|
130
131
|
RadioCard: () => RadioCard,
|
|
@@ -8350,17 +8351,25 @@ var import_react29 = require("react");
|
|
|
8350
8351
|
var import_styled_components29 = __toESM(require("styled-components"));
|
|
8351
8352
|
var import_type_guards22 = require("@wistia/type-guards");
|
|
8352
8353
|
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
8353
|
-
var
|
|
8354
|
+
var sharedBodyStyle = import_styled_components29.css`
|
|
8354
8355
|
> strong,
|
|
8355
8356
|
b {
|
|
8356
8357
|
font-weight: var(--wui-typography-weight-body-bold);
|
|
8357
8358
|
}
|
|
8359
|
+
|
|
8360
|
+
> mark {
|
|
8361
|
+
font-weight: var(--wui-typography-weight-body-mark);
|
|
8362
|
+
}
|
|
8358
8363
|
`;
|
|
8359
8364
|
var labelBoldStyles = import_styled_components29.css`
|
|
8360
8365
|
> strong,
|
|
8361
8366
|
b {
|
|
8362
8367
|
font-weight: var(--wui-typography-weight-label-bold);
|
|
8363
8368
|
}
|
|
8369
|
+
|
|
8370
|
+
> mark {
|
|
8371
|
+
font-weight: var(--wui-typography-weight-label-mark);
|
|
8372
|
+
}
|
|
8364
8373
|
`;
|
|
8365
8374
|
var body1TextStyle = import_styled_components29.css`
|
|
8366
8375
|
--font-family: var(--wui-typography-body-1-family);
|
|
@@ -8368,7 +8377,7 @@ var body1TextStyle = import_styled_components29.css`
|
|
|
8368
8377
|
--font-weight: var(--wui-typography-body-1-weight);
|
|
8369
8378
|
--line-height: var(--wui-typography-body-1-line-height);
|
|
8370
8379
|
--paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
|
|
8371
|
-
${
|
|
8380
|
+
${sharedBodyStyle}
|
|
8372
8381
|
`;
|
|
8373
8382
|
var body2TextStyle = import_styled_components29.css`
|
|
8374
8383
|
--font-family: var(--wui-typography-body-2-family);
|
|
@@ -8376,7 +8385,7 @@ var body2TextStyle = import_styled_components29.css`
|
|
|
8376
8385
|
--font-weight: var(--wui-typography-body-2-weight);
|
|
8377
8386
|
--line-height: var(--wui-typography-body-2-line-height);
|
|
8378
8387
|
--paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
|
|
8379
|
-
${
|
|
8388
|
+
${sharedBodyStyle}
|
|
8380
8389
|
`;
|
|
8381
8390
|
var body3TextStyle = import_styled_components29.css`
|
|
8382
8391
|
--font-family: var(--wui-typography-body-3-family);
|
|
@@ -8384,7 +8393,7 @@ var body3TextStyle = import_styled_components29.css`
|
|
|
8384
8393
|
--font-weight: var(--wui-typography-body-3-weight);
|
|
8385
8394
|
--line-height: var(--wui-typography-body-3-line-height);
|
|
8386
8395
|
--paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
|
|
8387
|
-
${
|
|
8396
|
+
${sharedBodyStyle}
|
|
8388
8397
|
`;
|
|
8389
8398
|
var body4TextStyle = import_styled_components29.css`
|
|
8390
8399
|
--font-family: var(--wui-typography-body-4-family);
|
|
@@ -8392,7 +8401,7 @@ var body4TextStyle = import_styled_components29.css`
|
|
|
8392
8401
|
--font-weight: var(--wui-typography-body-4-weight);
|
|
8393
8402
|
--line-height: var(--wui-typography-body-4-line-height);
|
|
8394
8403
|
--paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
|
|
8395
|
-
${
|
|
8404
|
+
${sharedBodyStyle}
|
|
8396
8405
|
`;
|
|
8397
8406
|
var label1TextStyle = import_styled_components29.css`
|
|
8398
8407
|
--font-family: var(--wui-typography-label-1-family);
|
|
@@ -12207,7 +12216,7 @@ Tag.displayName = "Tag_UI";
|
|
|
12207
12216
|
|
|
12208
12217
|
// src/components/Combobox/Combobox.tsx
|
|
12209
12218
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
12210
|
-
var
|
|
12219
|
+
var ComboboxWrapper = import_styled_components67.default.div`
|
|
12211
12220
|
${inputCss};
|
|
12212
12221
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
12213
12222
|
padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
|
|
@@ -12271,7 +12280,7 @@ var ComboboxInput = (0, import_styled_components67.default)(Ariakit.Combobox)`
|
|
|
12271
12280
|
outline-width: 2px;
|
|
12272
12281
|
}
|
|
12273
12282
|
`;
|
|
12274
|
-
var
|
|
12283
|
+
var ComboboxPopover2 = (0, import_styled_components67.default)(Ariakit.ComboboxPopover)`
|
|
12275
12284
|
--wui-combobox-content-border: var(--wui-color-border);
|
|
12276
12285
|
--wui-combobox-content-bg: var(--wui-color-bg-surface);
|
|
12277
12286
|
--wui-combobox-content-border-radius: var(--wui-border-radius-02);
|
|
@@ -12308,7 +12317,9 @@ var ComboboxItem2 = (0, import_styled_components67.default)(Ariakit.ComboboxItem
|
|
|
12308
12317
|
cursor: pointer;
|
|
12309
12318
|
|
|
12310
12319
|
&:hover,
|
|
12311
|
-
&:focus-visible
|
|
12320
|
+
&:focus-visible,
|
|
12321
|
+
&[data-focus-visible='true'],
|
|
12322
|
+
&[data-active-item='true'] {
|
|
12312
12323
|
background-color: var(--wui-combobox-option-bg-hover);
|
|
12313
12324
|
outline: none;
|
|
12314
12325
|
}
|
|
@@ -12391,7 +12402,7 @@ var Combobox2 = ({
|
|
|
12391
12402
|
},
|
|
12392
12403
|
children: [
|
|
12393
12404
|
/* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
|
|
12394
|
-
|
|
12405
|
+
ComboboxWrapper,
|
|
12395
12406
|
{
|
|
12396
12407
|
ref: comboboxWrapperRef,
|
|
12397
12408
|
$fullWidth: fullWidth,
|
|
@@ -12411,7 +12422,7 @@ var Combobox2 = ({
|
|
|
12411
12422
|
}
|
|
12412
12423
|
),
|
|
12413
12424
|
/* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
|
|
12414
|
-
|
|
12425
|
+
ComboboxPopover2,
|
|
12415
12426
|
{
|
|
12416
12427
|
"aria-busy": isPending,
|
|
12417
12428
|
gutter: 8,
|
|
@@ -12424,7 +12435,6 @@ var Combobox2 = ({
|
|
|
12424
12435
|
ComboboxItem2,
|
|
12425
12436
|
{
|
|
12426
12437
|
className: "combobox-item",
|
|
12427
|
-
focusOnHover: true,
|
|
12428
12438
|
value: match,
|
|
12429
12439
|
children: [
|
|
12430
12440
|
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
@@ -12770,11 +12780,12 @@ var DividerComponent = import_styled_components72.default.div`
|
|
|
12770
12780
|
}}
|
|
12771
12781
|
`;
|
|
12772
12782
|
var Divider = ({ orientation = "horizontal", ...props }) => {
|
|
12783
|
+
const responsiveOrientation = useResponsiveProp(orientation);
|
|
12773
12784
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
12774
12785
|
DividerComponent,
|
|
12775
12786
|
{
|
|
12776
|
-
$orientation:
|
|
12777
|
-
"aria-orientation":
|
|
12787
|
+
$orientation: responsiveOrientation,
|
|
12788
|
+
"aria-orientation": responsiveOrientation,
|
|
12778
12789
|
role: "separator",
|
|
12779
12790
|
...props
|
|
12780
12791
|
}
|
|
@@ -14704,7 +14715,7 @@ var StyledContent2 = (0, import_styled_components91.default)(import_react_popove
|
|
|
14704
14715
|
right: var(--wui-space-02);
|
|
14705
14716
|
}
|
|
14706
14717
|
`;
|
|
14707
|
-
var
|
|
14718
|
+
var Popover = ({
|
|
14708
14719
|
children,
|
|
14709
14720
|
trigger,
|
|
14710
14721
|
isOpen = false,
|
|
@@ -14750,7 +14761,7 @@ var Popover2 = ({
|
|
|
14750
14761
|
) })
|
|
14751
14762
|
] });
|
|
14752
14763
|
};
|
|
14753
|
-
|
|
14764
|
+
Popover.displayName = "Popover_UI";
|
|
14754
14765
|
|
|
14755
14766
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
14756
14767
|
var import_styled_components92 = __toESM(require("styled-components"));
|
|
@@ -15947,6 +15958,7 @@ var Table = ({
|
|
|
15947
15958
|
};
|
|
15948
15959
|
|
|
15949
15960
|
// src/components/Table/TableBody.tsx
|
|
15961
|
+
var import_react83 = require("react");
|
|
15950
15962
|
var import_styled_components106 = __toESM(require("styled-components"));
|
|
15951
15963
|
|
|
15952
15964
|
// src/components/Table/TableSectionContext.ts
|
|
@@ -15961,7 +15973,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
15961
15973
|
};
|
|
15962
15974
|
|
|
15963
15975
|
// src/components/Table/TableCell.tsx
|
|
15964
|
-
var
|
|
15976
|
+
var import_react84 = require("react");
|
|
15965
15977
|
var import_styled_components107 = __toESM(require("styled-components"));
|
|
15966
15978
|
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
15967
15979
|
var sharedStyles = import_styled_components107.css`
|
|
@@ -15982,7 +15994,7 @@ var StyledTd = import_styled_components107.default.td`
|
|
|
15982
15994
|
line-height: var(--wui-typography-body-2-line-height);
|
|
15983
15995
|
`;
|
|
15984
15996
|
var TableCell = ({ children, ...props }) => {
|
|
15985
|
-
const section = (0,
|
|
15997
|
+
const section = (0, import_react84.useContext)(TableSectionContext);
|
|
15986
15998
|
if (section === "head") {
|
|
15987
15999
|
return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(StyledTh, { ...props, children });
|
|
15988
16000
|
}
|
|
@@ -15990,6 +16002,7 @@ var TableCell = ({ children, ...props }) => {
|
|
|
15990
16002
|
};
|
|
15991
16003
|
|
|
15992
16004
|
// src/components/Table/TableFoot.tsx
|
|
16005
|
+
var import_react85 = require("react");
|
|
15993
16006
|
var import_styled_components108 = __toESM(require("styled-components"));
|
|
15994
16007
|
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
15995
16008
|
var StyledTableFoot = import_styled_components108.default.tfoot``;
|
|
@@ -15998,6 +16011,7 @@ var TableFoot = ({ children, ...props }) => {
|
|
|
15998
16011
|
};
|
|
15999
16012
|
|
|
16000
16013
|
// src/components/Table/TableHead.tsx
|
|
16014
|
+
var import_react86 = require("react");
|
|
16001
16015
|
var import_styled_components109 = __toESM(require("styled-components"));
|
|
16002
16016
|
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
16003
16017
|
var StyledThead = import_styled_components109.default.thead``;
|
|
@@ -16015,15 +16029,15 @@ var TableRow = ({ children, ...props }) => {
|
|
|
16015
16029
|
|
|
16016
16030
|
// src/components/Tabs/Tabs.tsx
|
|
16017
16031
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
16018
|
-
var
|
|
16032
|
+
var import_react88 = require("react");
|
|
16019
16033
|
var import_type_guards61 = require("@wistia/type-guards");
|
|
16020
16034
|
|
|
16021
16035
|
// src/components/Tabs/useTabsValue.tsx
|
|
16022
|
-
var
|
|
16023
|
-
var TabsValueContext = (0,
|
|
16036
|
+
var import_react87 = require("react");
|
|
16037
|
+
var TabsValueContext = (0, import_react87.createContext)(null);
|
|
16024
16038
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
16025
16039
|
var useTabsValue = () => {
|
|
16026
|
-
const context = (0,
|
|
16040
|
+
const context = (0, import_react87.useContext)(TabsValueContext);
|
|
16027
16041
|
if (context === null) {
|
|
16028
16042
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
16029
16043
|
}
|
|
@@ -16039,8 +16053,8 @@ var Tabs = ({
|
|
|
16039
16053
|
defaultValue,
|
|
16040
16054
|
...props
|
|
16041
16055
|
}) => {
|
|
16042
|
-
const [value, setValue] = (0,
|
|
16043
|
-
const onValueChange = (0,
|
|
16056
|
+
const [value, setValue] = (0, import_react88.useState)(valueProp ?? defaultValue);
|
|
16057
|
+
const onValueChange = (0, import_react88.useCallback)(
|
|
16044
16058
|
(newValue) => {
|
|
16045
16059
|
setValue(newValue);
|
|
16046
16060
|
if (onValueChangeProp) {
|
|
@@ -16124,7 +16138,7 @@ var TabsList = ({ children, fullWidth = true, ...props }) => {
|
|
|
16124
16138
|
TabsList.displayName = "TabsList_UI";
|
|
16125
16139
|
|
|
16126
16140
|
// src/components/Tabs/TabsTrigger.tsx
|
|
16127
|
-
var
|
|
16141
|
+
var import_react89 = require("react");
|
|
16128
16142
|
var import_type_guards63 = require("@wistia/type-guards");
|
|
16129
16143
|
|
|
16130
16144
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
@@ -16140,13 +16154,13 @@ var StyledRadixTabsTrigger = (0, import_styled_components113.default)(import_rea
|
|
|
16140
16154
|
|
|
16141
16155
|
// src/components/Tabs/TabsTrigger.tsx
|
|
16142
16156
|
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
16143
|
-
var TabsTrigger = (0,
|
|
16157
|
+
var TabsTrigger = (0, import_react89.forwardRef)(
|
|
16144
16158
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
|
|
16145
16159
|
const selectedValue = useTabsValue();
|
|
16146
16160
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
16147
|
-
const buttonRef = (0,
|
|
16161
|
+
const buttonRef = (0, import_react89.useRef)(null);
|
|
16148
16162
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
16149
|
-
(0,
|
|
16163
|
+
(0, import_react89.useEffect)(() => {
|
|
16150
16164
|
const buttonElem = buttonRef.current;
|
|
16151
16165
|
if (!buttonElem) {
|
|
16152
16166
|
return void 0;
|
|
@@ -16227,7 +16241,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
16227
16241
|
ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
16228
16242
|
|
|
16229
16243
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
16230
|
-
var
|
|
16244
|
+
var import_react90 = require("react");
|
|
16231
16245
|
var import_styled_components117 = __toESM(require("styled-components"));
|
|
16232
16246
|
var import_type_guards67 = require("@wistia/type-guards");
|
|
16233
16247
|
|
|
@@ -16559,7 +16573,7 @@ var getRelativeMousePosition = (elem, mouseEvent) => {
|
|
|
16559
16573
|
left: relativeLeft
|
|
16560
16574
|
};
|
|
16561
16575
|
};
|
|
16562
|
-
var Thumbnail = (0,
|
|
16576
|
+
var Thumbnail = (0, import_react90.forwardRef)(
|
|
16563
16577
|
({
|
|
16564
16578
|
gradientBackground = "defaultMidOne",
|
|
16565
16579
|
thumbnailImageType = "wide",
|
|
@@ -16570,17 +16584,17 @@ var Thumbnail = (0, import_react87.forwardRef)(
|
|
|
16570
16584
|
height,
|
|
16571
16585
|
...props
|
|
16572
16586
|
}, ref) => {
|
|
16573
|
-
const [percent, setPercent] = (0,
|
|
16574
|
-
const [isMouseOver, setIsMouseOver] = (0,
|
|
16575
|
-
const [isStoryboardReady, setIsStoryboardReady] = (0,
|
|
16576
|
-
const storyboardElementRef = (0,
|
|
16577
|
-
const [cursorPosition, setCursorPosition] = (0,
|
|
16578
|
-
const backgroundUrl = (0,
|
|
16587
|
+
const [percent, setPercent] = (0, import_react90.useState)(0);
|
|
16588
|
+
const [isMouseOver, setIsMouseOver] = (0, import_react90.useState)(false);
|
|
16589
|
+
const [isStoryboardReady, setIsStoryboardReady] = (0, import_react90.useState)(false);
|
|
16590
|
+
const storyboardElementRef = (0, import_react90.useRef)(null);
|
|
16591
|
+
const [cursorPosition, setCursorPosition] = (0, import_react90.useState)(null);
|
|
16592
|
+
const backgroundUrl = (0, import_react90.useMemo)(
|
|
16579
16593
|
() => thumbnailImageType === "square" && (0, import_type_guards67.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
16580
16594
|
[thumbnailImageType, thumbnailUrl]
|
|
16581
16595
|
);
|
|
16582
16596
|
const isScrubbable = (0, import_type_guards67.isNotNil)(storyboard);
|
|
16583
|
-
const trackStoryboardLoadStatus = (0,
|
|
16597
|
+
const trackStoryboardLoadStatus = (0, import_react90.useCallback)(() => {
|
|
16584
16598
|
if (storyboardElementRef.current || !storyboard) {
|
|
16585
16599
|
return storyboardElementRef.current;
|
|
16586
16600
|
}
|
|
@@ -16590,7 +16604,7 @@ var Thumbnail = (0, import_react87.forwardRef)(
|
|
|
16590
16604
|
storyboardElementRef.current = asset;
|
|
16591
16605
|
return storyboardElementRef.current;
|
|
16592
16606
|
}, [storyboard]);
|
|
16593
|
-
const handleMouseMove = (0,
|
|
16607
|
+
const handleMouseMove = (0, import_react90.useCallback)(
|
|
16594
16608
|
(mouseEvent) => {
|
|
16595
16609
|
if (!isScrubbable) return;
|
|
16596
16610
|
const elem = mouseEvent.currentTarget;
|
|
@@ -16603,15 +16617,15 @@ var Thumbnail = (0, import_react87.forwardRef)(
|
|
|
16603
16617
|
},
|
|
16604
16618
|
[isScrubbable, trackStoryboardLoadStatus]
|
|
16605
16619
|
);
|
|
16606
|
-
const handleMouseOut = (0,
|
|
16620
|
+
const handleMouseOut = (0, import_react90.useCallback)(() => {
|
|
16607
16621
|
if (!isScrubbable) return;
|
|
16608
16622
|
setIsMouseOver(false);
|
|
16609
16623
|
setCursorPosition(null);
|
|
16610
16624
|
}, [isScrubbable]);
|
|
16611
|
-
const shouldRenderStoryboard = (0,
|
|
16625
|
+
const shouldRenderStoryboard = (0, import_react90.useMemo)(() => {
|
|
16612
16626
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
16613
16627
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
16614
|
-
const renderStoryboard = (0,
|
|
16628
|
+
const renderStoryboard = (0, import_react90.useCallback)(() => {
|
|
16615
16629
|
if (!storyboard || (0, import_type_guards67.isUndefined)(height) || (0, import_type_guards67.isEmptyString)(height)) return null;
|
|
16616
16630
|
const {
|
|
16617
16631
|
url,
|
|
@@ -16678,7 +16692,7 @@ var Thumbnail = (0, import_react87.forwardRef)(
|
|
|
16678
16692
|
Thumbnail.displayName = "Thumbnail_UI";
|
|
16679
16693
|
|
|
16680
16694
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
16681
|
-
var
|
|
16695
|
+
var import_react91 = __toESM(require("react"));
|
|
16682
16696
|
var import_styled_components118 = __toESM(require("styled-components"));
|
|
16683
16697
|
var import_type_guards68 = require("@wistia/type-guards");
|
|
16684
16698
|
var import_jsx_runtime313 = (
|
|
@@ -16758,10 +16772,10 @@ var ThumbnailCollage = ({
|
|
|
16758
16772
|
gradientBackground = "defaultMidOne",
|
|
16759
16773
|
...props
|
|
16760
16774
|
}) => {
|
|
16761
|
-
const thumbnailArray =
|
|
16775
|
+
const thumbnailArray = import_react91.default.Children.toArray(children);
|
|
16762
16776
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
16763
16777
|
const thumbnails = (0, import_type_guards68.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
16764
|
-
return
|
|
16778
|
+
return import_react91.default.cloneElement(child, {
|
|
16765
16779
|
...child.props,
|
|
16766
16780
|
children: void 0
|
|
16767
16781
|
});
|
|
@@ -16913,7 +16927,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
|
|
|
16913
16927
|
|
|
16914
16928
|
// src/components/InputPassword/InputPassword.tsx
|
|
16915
16929
|
var import_styled_components120 = __toESM(require("styled-components"));
|
|
16916
|
-
var
|
|
16930
|
+
var import_react92 = require("react");
|
|
16917
16931
|
var import_type_guards70 = require("@wistia/type-guards");
|
|
16918
16932
|
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
16919
16933
|
var StyledIconButton2 = (0, import_styled_components120.default)(IconButton)`
|
|
@@ -16924,9 +16938,9 @@ var StyledIconButton2 = (0, import_styled_components120.default)(IconButton)`
|
|
|
16924
16938
|
/* override input padding variable since it is used for Input Icon positioning */
|
|
16925
16939
|
--wui-input-horizontal-padding: 4px;
|
|
16926
16940
|
`;
|
|
16927
|
-
var InputPassword = (0,
|
|
16941
|
+
var InputPassword = (0, import_react92.forwardRef)(
|
|
16928
16942
|
({ onVisibilityToggle, disabled = false, ...props }, ref) => {
|
|
16929
|
-
const [isVisible, setIsVisible] = (0,
|
|
16943
|
+
const [isVisible, setIsVisible] = (0, import_react92.useState)(false);
|
|
16930
16944
|
const handleClick = () => {
|
|
16931
16945
|
const newVisibility = !isVisible;
|
|
16932
16946
|
setIsVisible(newVisibility);
|
|
@@ -16959,7 +16973,7 @@ var InputPassword = (0, import_react89.forwardRef)(
|
|
|
16959
16973
|
InputPassword.displayName = "InputPassword_UI";
|
|
16960
16974
|
|
|
16961
16975
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
16962
|
-
var
|
|
16976
|
+
var import_react93 = require("react");
|
|
16963
16977
|
var import_type_guards71 = require("@wistia/type-guards");
|
|
16964
16978
|
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
16965
16979
|
var ContextMenu = ({
|
|
@@ -16968,9 +16982,9 @@ var ContextMenu = ({
|
|
|
16968
16982
|
children,
|
|
16969
16983
|
onRequestClose = () => null
|
|
16970
16984
|
}) => {
|
|
16971
|
-
const [isRightClicked, setIsRightClicked] = (0,
|
|
16972
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
16973
|
-
(0,
|
|
16985
|
+
const [isRightClicked, setIsRightClicked] = (0, import_react93.useState)(false);
|
|
16986
|
+
const [menuPosition, setMenuPosition] = (0, import_react93.useState)(position ?? { x: 0, y: 0 });
|
|
16987
|
+
(0, import_react93.useEffect)(() => {
|
|
16974
16988
|
if ((0, import_type_guards71.isNil)(position)) {
|
|
16975
16989
|
const onContextMenu = (event) => {
|
|
16976
16990
|
event.preventDefault();
|
|
@@ -17018,12 +17032,12 @@ var ContextMenu = ({
|
|
|
17018
17032
|
};
|
|
17019
17033
|
|
|
17020
17034
|
// src/components/EditableText/EditableTextDisplay.tsx
|
|
17021
|
-
var
|
|
17035
|
+
var import_react95 = require("react");
|
|
17022
17036
|
var import_styled_components123 = __toESM(require("styled-components"));
|
|
17023
17037
|
var import_type_guards73 = require("@wistia/type-guards");
|
|
17024
17038
|
|
|
17025
17039
|
// src/components/EditableText/EditableTextRoot.tsx
|
|
17026
|
-
var
|
|
17040
|
+
var import_react94 = require("react");
|
|
17027
17041
|
var import_type_guards72 = require("@wistia/type-guards");
|
|
17028
17042
|
var import_styled_components121 = __toESM(require("styled-components"));
|
|
17029
17043
|
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
@@ -17033,7 +17047,7 @@ var StyledEditableTextRoot = import_styled_components121.default.div`
|
|
|
17033
17047
|
--wui-editable-text-padding: var(--wui-space-01);
|
|
17034
17048
|
--wui-editable-text-border-radius: var(--wui-border-radius-01);
|
|
17035
17049
|
`;
|
|
17036
|
-
var EditableTextContext = (0,
|
|
17050
|
+
var EditableTextContext = (0, import_react94.createContext)(null);
|
|
17037
17051
|
var EditableTextRoot = ({
|
|
17038
17052
|
children,
|
|
17039
17053
|
defaultValue = "",
|
|
@@ -17054,13 +17068,13 @@ var EditableTextRoot = ({
|
|
|
17054
17068
|
...props
|
|
17055
17069
|
}) => {
|
|
17056
17070
|
const isControlled = controlledValue !== void 0;
|
|
17057
|
-
const [internalValue, setInternalValue] = (0,
|
|
17058
|
-
const [originalValue, setOriginalValue] = (0,
|
|
17059
|
-
const [isEditing, setIsEditing] = (0,
|
|
17071
|
+
const [internalValue, setInternalValue] = (0, import_react94.useState)(defaultValue);
|
|
17072
|
+
const [originalValue, setOriginalValue] = (0, import_react94.useState)(defaultValue);
|
|
17073
|
+
const [isEditing, setIsEditing] = (0, import_react94.useState)(false);
|
|
17060
17074
|
const value = isControlled ? controlledValue : internalValue;
|
|
17061
|
-
const generatedId = (0,
|
|
17075
|
+
const generatedId = (0, import_react94.useId)();
|
|
17062
17076
|
const computedId = (0, import_type_guards72.isNonEmptyString)(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
17063
|
-
const handleSetIsEditing = (0,
|
|
17077
|
+
const handleSetIsEditing = (0, import_react94.useCallback)(
|
|
17064
17078
|
(editing) => {
|
|
17065
17079
|
if (editing && !isEditing) {
|
|
17066
17080
|
setOriginalValue(value);
|
|
@@ -17070,7 +17084,7 @@ var EditableTextRoot = ({
|
|
|
17070
17084
|
},
|
|
17071
17085
|
[isEditing, value, onEditingChange]
|
|
17072
17086
|
);
|
|
17073
|
-
const setValue = (0,
|
|
17087
|
+
const setValue = (0, import_react94.useCallback)(
|
|
17074
17088
|
(newValue) => {
|
|
17075
17089
|
if (!isControlled) {
|
|
17076
17090
|
setInternalValue(newValue);
|
|
@@ -17079,7 +17093,7 @@ var EditableTextRoot = ({
|
|
|
17079
17093
|
},
|
|
17080
17094
|
[isControlled, onValueChange]
|
|
17081
17095
|
);
|
|
17082
|
-
const context = (0,
|
|
17096
|
+
const context = (0, import_react94.useMemo)(() => {
|
|
17083
17097
|
return {
|
|
17084
17098
|
isEditing,
|
|
17085
17099
|
setIsEditing: handleSetIsEditing,
|
|
@@ -17190,14 +17204,14 @@ var StyledEditableTextDisplay = import_styled_components123.default.div`
|
|
|
17190
17204
|
}
|
|
17191
17205
|
}
|
|
17192
17206
|
`;
|
|
17193
|
-
var EditableTextDisplayComponent = (0,
|
|
17207
|
+
var EditableTextDisplayComponent = (0, import_react95.forwardRef)(
|
|
17194
17208
|
({ asTrigger, renderAs, ...props }, ref) => {
|
|
17195
|
-
const context = (0,
|
|
17209
|
+
const context = (0, import_react95.useContext)(EditableTextContext);
|
|
17196
17210
|
if (!context) {
|
|
17197
17211
|
throw new Error("EditableTextDisplay must be used within an EditableTextRoot context");
|
|
17198
17212
|
}
|
|
17199
17213
|
const { value, typographicVariant, setIsEditing, placeholder, maxLines, isEditing, minLines } = context;
|
|
17200
|
-
const triggerButtonRef = (0,
|
|
17214
|
+
const triggerButtonRef = (0, import_react95.useRef)(null);
|
|
17201
17215
|
const handleTriggerClick = () => {
|
|
17202
17216
|
setIsEditing(true);
|
|
17203
17217
|
};
|
|
@@ -17256,7 +17270,7 @@ var EditableTextDisplay = makePolymorphic(
|
|
|
17256
17270
|
);
|
|
17257
17271
|
|
|
17258
17272
|
// src/components/EditableText/EditableTextInput.tsx
|
|
17259
|
-
var
|
|
17273
|
+
var import_react96 = require("react");
|
|
17260
17274
|
var import_styled_components124 = __toESM(require("styled-components"));
|
|
17261
17275
|
var import_type_guards74 = require("@wistia/type-guards");
|
|
17262
17276
|
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
@@ -17271,7 +17285,7 @@ var StyledInput2 = (0, import_styled_components124.default)(Input)`
|
|
|
17271
17285
|
}
|
|
17272
17286
|
`;
|
|
17273
17287
|
var EditableTextInput = (props) => {
|
|
17274
|
-
const context = (0,
|
|
17288
|
+
const context = (0, import_react96.useContext)(EditableTextContext);
|
|
17275
17289
|
if (!context) {
|
|
17276
17290
|
throw new Error("EditableTextInput must be used within an EditableTextRoot context");
|
|
17277
17291
|
}
|
|
@@ -17291,8 +17305,8 @@ var EditableTextInput = (props) => {
|
|
|
17291
17305
|
maxLines,
|
|
17292
17306
|
finalFocusEl
|
|
17293
17307
|
} = context;
|
|
17294
|
-
const inputRef = (0,
|
|
17295
|
-
(0,
|
|
17308
|
+
const inputRef = (0, import_react96.useRef)(null);
|
|
17309
|
+
(0, import_react96.useEffect)(() => {
|
|
17296
17310
|
if (inputRef.current) {
|
|
17297
17311
|
if (isEditing) {
|
|
17298
17312
|
const element = inputRef.current;
|
|
@@ -17368,10 +17382,10 @@ var EditableTextInput = (props) => {
|
|
|
17368
17382
|
};
|
|
17369
17383
|
|
|
17370
17384
|
// src/components/EditableText/EditableTextLabel.tsx
|
|
17371
|
-
var
|
|
17385
|
+
var import_react97 = require("react");
|
|
17372
17386
|
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
17373
17387
|
var EditableTextLabel = ({ ...props }) => {
|
|
17374
|
-
const context = (0,
|
|
17388
|
+
const context = (0, import_react97.useContext)(EditableTextContext);
|
|
17375
17389
|
if (!context) {
|
|
17376
17390
|
throw new Error("EditableTextLabel must be used within an EditableTextRoot context");
|
|
17377
17391
|
}
|
|
@@ -17396,14 +17410,14 @@ var EditableText = ({ hideLabel = true, ...props }) => /* @__PURE__ */ (0, impor
|
|
|
17396
17410
|
EditableText.displayName = "EditableText_UI";
|
|
17397
17411
|
|
|
17398
17412
|
// src/components/EditableText/EditableTextSubmitButton.tsx
|
|
17399
|
-
var
|
|
17413
|
+
var import_react98 = require("react");
|
|
17400
17414
|
var EditableTextSubmitButton = ({
|
|
17401
17415
|
/**
|
|
17402
17416
|
* A submit button, typically a [Button]() that will commit the value when clicked.
|
|
17403
17417
|
*/
|
|
17404
17418
|
children
|
|
17405
17419
|
}) => {
|
|
17406
|
-
const context = (0,
|
|
17420
|
+
const context = (0, import_react98.useContext)(EditableTextContext);
|
|
17407
17421
|
if (!context) {
|
|
17408
17422
|
throw new Error("EditableTextSubmitButton must be used within an EditableTextRoot context");
|
|
17409
17423
|
}
|
|
@@ -17418,21 +17432,21 @@ var EditableTextSubmitButton = ({
|
|
|
17418
17432
|
}
|
|
17419
17433
|
}, 0);
|
|
17420
17434
|
};
|
|
17421
|
-
const onlyChild =
|
|
17435
|
+
const onlyChild = import_react98.Children.only(children);
|
|
17422
17436
|
const triggerProps = {
|
|
17423
17437
|
onClick: handleClick,
|
|
17424
17438
|
"data-wui-editable-text-submit": true
|
|
17425
17439
|
};
|
|
17426
17440
|
if (!isEditing) return null;
|
|
17427
|
-
return (0,
|
|
17441
|
+
return (0, import_react98.cloneElement)(onlyChild, triggerProps);
|
|
17428
17442
|
};
|
|
17429
17443
|
|
|
17430
17444
|
// src/components/EditableText/EditableTextCancelButton.tsx
|
|
17431
|
-
var
|
|
17445
|
+
var import_react99 = require("react");
|
|
17432
17446
|
var EditableTextCancelButton = ({
|
|
17433
17447
|
children
|
|
17434
17448
|
}) => {
|
|
17435
|
-
const context = (0,
|
|
17449
|
+
const context = (0, import_react99.useContext)(EditableTextContext);
|
|
17436
17450
|
if (!context) {
|
|
17437
17451
|
throw new Error("EditableTextCancelButton must be used within an EditableTextRoot context");
|
|
17438
17452
|
}
|
|
@@ -17448,22 +17462,22 @@ var EditableTextCancelButton = ({
|
|
|
17448
17462
|
}
|
|
17449
17463
|
}, 0);
|
|
17450
17464
|
};
|
|
17451
|
-
const onlyChild =
|
|
17465
|
+
const onlyChild = import_react99.Children.only(children);
|
|
17452
17466
|
const triggerProps = {
|
|
17453
17467
|
onClick: handleClick,
|
|
17454
17468
|
"data-wui-editable-text-cancel": true
|
|
17455
17469
|
};
|
|
17456
17470
|
if (!isEditing) return null;
|
|
17457
|
-
return (0,
|
|
17471
|
+
return (0, import_react99.cloneElement)(onlyChild, triggerProps);
|
|
17458
17472
|
};
|
|
17459
17473
|
|
|
17460
17474
|
// src/components/EditableText/EditableTextTrigger.tsx
|
|
17461
|
-
var
|
|
17475
|
+
var import_react100 = require("react");
|
|
17462
17476
|
var EditableTextTrigger = ({
|
|
17463
17477
|
children,
|
|
17464
17478
|
...props
|
|
17465
17479
|
}) => {
|
|
17466
|
-
const context = (0,
|
|
17480
|
+
const context = (0, import_react100.useContext)(EditableTextContext);
|
|
17467
17481
|
if (!context) {
|
|
17468
17482
|
throw new Error("EditableTextTrigger must be used within an EditableTextRoot context");
|
|
17469
17483
|
}
|
|
@@ -17471,14 +17485,14 @@ var EditableTextTrigger = ({
|
|
|
17471
17485
|
const handleClick = () => {
|
|
17472
17486
|
setIsEditing(true);
|
|
17473
17487
|
};
|
|
17474
|
-
const onlyChild =
|
|
17488
|
+
const onlyChild = import_react100.Children.only(children);
|
|
17475
17489
|
const triggerProps = {
|
|
17476
17490
|
onClick: handleClick,
|
|
17477
17491
|
"data-wui-editable-text-trigger": true,
|
|
17478
17492
|
...props
|
|
17479
17493
|
};
|
|
17480
17494
|
if (isEditing) return null;
|
|
17481
|
-
return (0,
|
|
17495
|
+
return (0, import_react100.cloneElement)(onlyChild, triggerProps);
|
|
17482
17496
|
};
|
|
17483
17497
|
|
|
17484
17498
|
// src/components/DataList/DataList.tsx
|
|
@@ -17561,6 +17575,27 @@ var DataListItemValue = (props) => {
|
|
|
17561
17575
|
);
|
|
17562
17576
|
};
|
|
17563
17577
|
DataListItemValue.displayName = "DataListItemValue_UI";
|
|
17578
|
+
|
|
17579
|
+
// src/components/Mark/Mark.tsx
|
|
17580
|
+
var import_styled_components126 = __toESM(require("styled-components"));
|
|
17581
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
17582
|
+
var StyledMark = import_styled_components126.default.mark`
|
|
17583
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
17584
|
+
background-color: var(--wui-color-bg-surface-tertiary);
|
|
17585
|
+
color: var(--wui-color-text);
|
|
17586
|
+
border-radius: var(--wui-border-radius-01);
|
|
17587
|
+
padding-inline: 0.1em;
|
|
17588
|
+
margin-inline: -0.1em;
|
|
17589
|
+
`;
|
|
17590
|
+
var Mark = ({ children, colorScheme = "inherit", ...props }) => /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
17591
|
+
StyledMark,
|
|
17592
|
+
{
|
|
17593
|
+
$colorScheme: colorScheme,
|
|
17594
|
+
...props,
|
|
17595
|
+
children
|
|
17596
|
+
}
|
|
17597
|
+
);
|
|
17598
|
+
Mark.displayName = "Mark_UI";
|
|
17564
17599
|
// Annotate the CommonJS export names for ESM import in node:
|
|
17565
17600
|
0 && (module.exports = {
|
|
17566
17601
|
ActionButton,
|
|
@@ -17640,6 +17675,7 @@ DataListItemValue.displayName = "DataListItemValue_UI";
|
|
|
17640
17675
|
Label,
|
|
17641
17676
|
Link,
|
|
17642
17677
|
List,
|
|
17678
|
+
Mark,
|
|
17643
17679
|
Menu,
|
|
17644
17680
|
MenuItem,
|
|
17645
17681
|
MenuItemDescription,
|