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