@wistia/ui 0.19.3 → 0.19.4-beta.3c56092c.db889dd
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 +77 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +77 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.19.
|
|
3
|
+
* @license @wistia/ui v0.19.4-beta.3c56092c.db889dd
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2335,7 +2335,9 @@ var differenceInCalendarDays = (dateLeft, dateRight) => {
|
|
|
2335
2335
|
|
|
2336
2336
|
// src/helpers/dateTime/timeAgoString.ts
|
|
2337
2337
|
var timeAgoString = (date, { nowAnchor = /* @__PURE__ */ new Date(), includeTime = true } = {}) => {
|
|
2338
|
-
if (isInvalidDate(date))
|
|
2338
|
+
if (isInvalidDate(date)) {
|
|
2339
|
+
return "";
|
|
2340
|
+
}
|
|
2339
2341
|
const minutesAgo = (nowAnchor.valueOf() - date.valueOf()) / (secondsInMinute * milisecondsInSecond);
|
|
2340
2342
|
const minutesAgoRounded = Math.round(minutesAgo);
|
|
2341
2343
|
const differenceInDays = differenceInCalendarDays(nowAnchor, date);
|
|
@@ -8600,7 +8602,9 @@ var getFillViewportStyle = (fillViewport) => {
|
|
|
8600
8602
|
return void 0;
|
|
8601
8603
|
};
|
|
8602
8604
|
var getFlexStyle = (flexMode) => {
|
|
8603
|
-
if (!flexMode)
|
|
8605
|
+
if (!flexMode) {
|
|
8606
|
+
return null;
|
|
8607
|
+
}
|
|
8604
8608
|
switch (flexMode) {
|
|
8605
8609
|
// grows to fill space, won't shrink, starts at 0
|
|
8606
8610
|
case "grow":
|
|
@@ -9327,13 +9331,19 @@ var Banner = ({
|
|
|
9327
9331
|
const hasImage = isNotNil13(image);
|
|
9328
9332
|
const shouldShowImage = hasImage && (isVerticalLayout || width >= MIN_IMAGE_WIDTH);
|
|
9329
9333
|
const iconPosition = useMemo5(() => {
|
|
9330
|
-
if (isNil11(icon))
|
|
9331
|
-
|
|
9334
|
+
if (isNil11(icon)) {
|
|
9335
|
+
return "none";
|
|
9336
|
+
}
|
|
9337
|
+
if (isSmallContainer) {
|
|
9338
|
+
return shouldShowImage ? "inline" : "above";
|
|
9339
|
+
}
|
|
9332
9340
|
return prominence === "secondary" ? "inline" : "above";
|
|
9333
9341
|
}, [icon, isSmallContainer, shouldShowImage, prominence]);
|
|
9334
9342
|
const hasActions = isNotNil13(primaryAction) || isNotNil13(secondaryAction);
|
|
9335
9343
|
const contentDirection = useMemo5(() => {
|
|
9336
|
-
if (orientation === "horizontal" && !hasActions)
|
|
9344
|
+
if (orientation === "horizontal" && !hasActions) {
|
|
9345
|
+
return "row";
|
|
9346
|
+
}
|
|
9337
9347
|
return !shouldShowImage && prominence === "primary" && !isSmallContainer && !isVerticalLayout ? "row" : "column";
|
|
9338
9348
|
}, [orientation, shouldShowImage, prominence, isSmallContainer, isVerticalLayout, hasActions]);
|
|
9339
9349
|
const headingVariant = isSmallContainer || prominence === "primary" ? "heading5" : "heading3";
|
|
@@ -10077,8 +10087,12 @@ var sizeLarge = css26`
|
|
|
10077
10087
|
--wui-checkbox-icon-size: 11px;
|
|
10078
10088
|
`;
|
|
10079
10089
|
var getSizeCss = (size) => {
|
|
10080
|
-
if (size === "sm")
|
|
10081
|
-
|
|
10090
|
+
if (size === "sm") {
|
|
10091
|
+
return sizeSmall;
|
|
10092
|
+
}
|
|
10093
|
+
if (size === "lg") {
|
|
10094
|
+
return sizeLarge;
|
|
10095
|
+
}
|
|
10082
10096
|
return sizeMedium;
|
|
10083
10097
|
};
|
|
10084
10098
|
var StyledCheckboxWrapper = styled29.div`
|
|
@@ -10223,7 +10237,9 @@ Checkbox.displayName = "Checkbox_UI";
|
|
|
10223
10237
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
10224
10238
|
import { Children as Children3, cloneElement as cloneElement3, useCallback as useCallback8, useEffect as useEffect9 } from "react";
|
|
10225
10239
|
var isClickableElement = (element) => {
|
|
10226
|
-
if (!element)
|
|
10240
|
+
if (!element) {
|
|
10241
|
+
return false;
|
|
10242
|
+
}
|
|
10227
10243
|
const el = element;
|
|
10228
10244
|
return el.closest("button") !== null || el.closest("a") !== null || el.closest("input") !== null || el.closest("select") !== null || el.closest("textarea") !== null || el.closest("label") !== null || el.closest("[data-wui-faux-input]") !== null;
|
|
10229
10245
|
};
|
|
@@ -14483,7 +14499,9 @@ var EditableHeading = ({
|
|
|
14483
14499
|
const [headingHeight, setHeadingHeight] = useState18("60");
|
|
14484
14500
|
const headingRef = useRef16(null);
|
|
14485
14501
|
const handleSetEditing = (editing) => {
|
|
14486
|
-
if (editingDisabled)
|
|
14502
|
+
if (editingDisabled) {
|
|
14503
|
+
return;
|
|
14504
|
+
}
|
|
14487
14505
|
if (editing && headingRef.current) {
|
|
14488
14506
|
setHeadingHeight(`${headingRef.current.offsetHeight}`);
|
|
14489
14507
|
}
|
|
@@ -14765,7 +14783,7 @@ var EditableTextDisplayComponent = forwardRef21(
|
|
|
14765
14783
|
};
|
|
14766
14784
|
const elementType = renderAs ?? getDefaultTypographicElement(typographicVariant);
|
|
14767
14785
|
const displayText = value.length > 0 ? value : placeholder;
|
|
14768
|
-
const isPlaceholderVisible = value.length === 0 &&
|
|
14786
|
+
const isPlaceholderVisible = value.length === 0 && Boolean(placeholder);
|
|
14769
14787
|
if (isEditing) {
|
|
14770
14788
|
return null;
|
|
14771
14789
|
}
|
|
@@ -14910,7 +14928,9 @@ var EditableTextInput = (props) => {
|
|
|
14910
14928
|
}, 0);
|
|
14911
14929
|
}
|
|
14912
14930
|
};
|
|
14913
|
-
if (!isEditing)
|
|
14931
|
+
if (!isEditing) {
|
|
14932
|
+
return null;
|
|
14933
|
+
}
|
|
14914
14934
|
return /* @__PURE__ */ jsx289(
|
|
14915
14935
|
StyledInput2,
|
|
14916
14936
|
{
|
|
@@ -14991,7 +15011,9 @@ var EditableTextSubmitButton = ({
|
|
|
14991
15011
|
onClick: handleClick,
|
|
14992
15012
|
"data-wui-editable-text-submit": true
|
|
14993
15013
|
};
|
|
14994
|
-
if (!isEditing)
|
|
15014
|
+
if (!isEditing) {
|
|
15015
|
+
return null;
|
|
15016
|
+
}
|
|
14995
15017
|
return cloneElement5(onlyChild, triggerProps);
|
|
14996
15018
|
};
|
|
14997
15019
|
|
|
@@ -15021,7 +15043,9 @@ var EditableTextCancelButton = ({
|
|
|
15021
15043
|
onClick: handleClick,
|
|
15022
15044
|
"data-wui-editable-text-cancel": true
|
|
15023
15045
|
};
|
|
15024
|
-
if (!isEditing)
|
|
15046
|
+
if (!isEditing) {
|
|
15047
|
+
return null;
|
|
15048
|
+
}
|
|
15025
15049
|
return cloneElement6(onlyChild, triggerProps);
|
|
15026
15050
|
};
|
|
15027
15051
|
|
|
@@ -15045,7 +15069,9 @@ var EditableTextTrigger = ({
|
|
|
15045
15069
|
"data-wui-editable-text-trigger": true,
|
|
15046
15070
|
...props
|
|
15047
15071
|
};
|
|
15048
|
-
if (isEditing)
|
|
15072
|
+
if (isEditing) {
|
|
15073
|
+
return null;
|
|
15074
|
+
}
|
|
15049
15075
|
return cloneElement7(onlyChild, triggerProps);
|
|
15050
15076
|
};
|
|
15051
15077
|
|
|
@@ -16470,8 +16496,12 @@ var sizeLarge2 = css42`
|
|
|
16470
16496
|
--wui-radio-icon-size: 10px;
|
|
16471
16497
|
`;
|
|
16472
16498
|
var getSizeCss3 = (size) => {
|
|
16473
|
-
if (size === "sm")
|
|
16474
|
-
|
|
16499
|
+
if (size === "sm") {
|
|
16500
|
+
return sizeSmall2;
|
|
16501
|
+
}
|
|
16502
|
+
if (size === "lg") {
|
|
16503
|
+
return sizeLarge2;
|
|
16504
|
+
}
|
|
16475
16505
|
return sizeMedium2;
|
|
16476
16506
|
};
|
|
16477
16507
|
var StyledRadioWrapper = styled84.div`
|
|
@@ -17372,7 +17402,6 @@ var StyledContent3 = styled93(Content3)`
|
|
|
17372
17402
|
--wui-select-option-bg-hover: var(--wui-color-bg-surface-hover);
|
|
17373
17403
|
|
|
17374
17404
|
overflow: hidden;
|
|
17375
|
-
transform: translateY(8px);
|
|
17376
17405
|
background-color: var(--wui-select-content-bg);
|
|
17377
17406
|
border: 1px solid var(--wui-select-content-border);
|
|
17378
17407
|
border-radius: var(--wui-select-content-border-radius);
|
|
@@ -17437,23 +17466,30 @@ var Select = forwardRef34(
|
|
|
17437
17466
|
]
|
|
17438
17467
|
}
|
|
17439
17468
|
),
|
|
17440
|
-
/* @__PURE__ */ jsx319(Portal2, { children: /* @__PURE__ */ jsxs62(
|
|
17441
|
-
|
|
17442
|
-
|
|
17443
|
-
|
|
17444
|
-
|
|
17445
|
-
|
|
17446
|
-
|
|
17447
|
-
|
|
17448
|
-
|
|
17449
|
-
|
|
17450
|
-
|
|
17451
|
-
|
|
17452
|
-
|
|
17453
|
-
|
|
17454
|
-
|
|
17455
|
-
|
|
17456
|
-
|
|
17469
|
+
/* @__PURE__ */ jsx319(Portal2, { children: /* @__PURE__ */ jsxs62(
|
|
17470
|
+
StyledContent3,
|
|
17471
|
+
{
|
|
17472
|
+
position: "popper",
|
|
17473
|
+
sideOffset: 8,
|
|
17474
|
+
children: [
|
|
17475
|
+
/* @__PURE__ */ jsx319(StyledScrollUpButton, { children: /* @__PURE__ */ jsx319(
|
|
17476
|
+
Icon,
|
|
17477
|
+
{
|
|
17478
|
+
size: "sm",
|
|
17479
|
+
type: "caret-up"
|
|
17480
|
+
}
|
|
17481
|
+
) }),
|
|
17482
|
+
/* @__PURE__ */ jsx319(Viewport, { children }),
|
|
17483
|
+
/* @__PURE__ */ jsx319(StyledScrollDownButton, { children: /* @__PURE__ */ jsx319(
|
|
17484
|
+
Icon,
|
|
17485
|
+
{
|
|
17486
|
+
size: "sm",
|
|
17487
|
+
type: "caret-down"
|
|
17488
|
+
}
|
|
17489
|
+
) })
|
|
17490
|
+
]
|
|
17491
|
+
}
|
|
17492
|
+
) })
|
|
17457
17493
|
] });
|
|
17458
17494
|
}
|
|
17459
17495
|
);
|
|
@@ -18428,7 +18464,9 @@ var Thumbnail = forwardRef37(
|
|
|
18428
18464
|
}, [storyboard]);
|
|
18429
18465
|
const handleMouseMove = useCallback20(
|
|
18430
18466
|
(mouseEvent) => {
|
|
18431
|
-
if (!isScrubbable)
|
|
18467
|
+
if (!isScrubbable) {
|
|
18468
|
+
return;
|
|
18469
|
+
}
|
|
18432
18470
|
const elem = mouseEvent.currentTarget;
|
|
18433
18471
|
const relMousePos = getRelativeMousePosition(elem, mouseEvent);
|
|
18434
18472
|
const newPercent = relMousePos.left / elem.clientWidth;
|
|
@@ -18440,7 +18478,9 @@ var Thumbnail = forwardRef37(
|
|
|
18440
18478
|
[isScrubbable, trackStoryboardLoadStatus]
|
|
18441
18479
|
);
|
|
18442
18480
|
const handleMouseOut = useCallback20(() => {
|
|
18443
|
-
if (!isScrubbable)
|
|
18481
|
+
if (!isScrubbable) {
|
|
18482
|
+
return;
|
|
18483
|
+
}
|
|
18444
18484
|
setIsMouseOver(false);
|
|
18445
18485
|
setCursorPosition(null);
|
|
18446
18486
|
}, [isScrubbable]);
|