@wistia/ui 0.19.4 → 0.20.0
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.mjs → index.js} +58 -21
- package/dist/index.js.map +1 -0
- package/package.json +28 -33
- package/dist/index.cjs +0 -19114
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.mts +0 -4390
- package/dist/index.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.
|
|
3
|
+
* @license @wistia/ui v0.20.0
|
|
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
|
|
|
@@ -15914,6 +15941,9 @@ import { forwardRef as forwardRef25 } from "react";
|
|
|
15914
15941
|
import { styled as styled78, css as css39, keyframes as keyframes5 } from "styled-components";
|
|
15915
15942
|
import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
15916
15943
|
|
|
15944
|
+
// src/components/Modal/constants.ts
|
|
15945
|
+
var DEFAULT_MODAL_WIDTH = "532px";
|
|
15946
|
+
|
|
15917
15947
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
15918
15948
|
import { useRef as useRef20, useEffect as useEffect19 } from "react";
|
|
15919
15949
|
import { isNotNil as isNotNil31 } from "@wistia/type-guards";
|
|
@@ -16111,7 +16141,6 @@ var ModalOverlay = styled79(DialogOverlay)`
|
|
|
16111
16141
|
|
|
16112
16142
|
// src/components/Modal/Modal.tsx
|
|
16113
16143
|
import { jsx as jsx305, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
16114
|
-
var DEFAULT_MODAL_WIDTH = "532px";
|
|
16115
16144
|
var ModalBody = styled80.div`
|
|
16116
16145
|
flex-direction: column;
|
|
16117
16146
|
display: flex;
|
|
@@ -16470,8 +16499,12 @@ var sizeLarge2 = css42`
|
|
|
16470
16499
|
--wui-radio-icon-size: 10px;
|
|
16471
16500
|
`;
|
|
16472
16501
|
var getSizeCss3 = (size) => {
|
|
16473
|
-
if (size === "sm")
|
|
16474
|
-
|
|
16502
|
+
if (size === "sm") {
|
|
16503
|
+
return sizeSmall2;
|
|
16504
|
+
}
|
|
16505
|
+
if (size === "lg") {
|
|
16506
|
+
return sizeLarge2;
|
|
16507
|
+
}
|
|
16475
16508
|
return sizeMedium2;
|
|
16476
16509
|
};
|
|
16477
16510
|
var StyledRadioWrapper = styled84.div`
|
|
@@ -18434,7 +18467,9 @@ var Thumbnail = forwardRef37(
|
|
|
18434
18467
|
}, [storyboard]);
|
|
18435
18468
|
const handleMouseMove = useCallback20(
|
|
18436
18469
|
(mouseEvent) => {
|
|
18437
|
-
if (!isScrubbable)
|
|
18470
|
+
if (!isScrubbable) {
|
|
18471
|
+
return;
|
|
18472
|
+
}
|
|
18438
18473
|
const elem = mouseEvent.currentTarget;
|
|
18439
18474
|
const relMousePos = getRelativeMousePosition(elem, mouseEvent);
|
|
18440
18475
|
const newPercent = relMousePos.left / elem.clientWidth;
|
|
@@ -18446,7 +18481,9 @@ var Thumbnail = forwardRef37(
|
|
|
18446
18481
|
[isScrubbable, trackStoryboardLoadStatus]
|
|
18447
18482
|
);
|
|
18448
18483
|
const handleMouseOut = useCallback20(() => {
|
|
18449
|
-
if (!isScrubbable)
|
|
18484
|
+
if (!isScrubbable) {
|
|
18485
|
+
return;
|
|
18486
|
+
}
|
|
18450
18487
|
setIsMouseOver(false);
|
|
18451
18488
|
setCursorPosition(null);
|
|
18452
18489
|
}, [isScrubbable]);
|
|
@@ -18977,4 +19014,4 @@ export {
|
|
|
18977
19014
|
useToast,
|
|
18978
19015
|
useWindowSize
|
|
18979
19016
|
};
|
|
18980
|
-
//# sourceMappingURL=index.
|
|
19017
|
+
//# sourceMappingURL=index.js.map
|