@wistia/ui 0.19.4-beta.3c56092c.db889dd → 0.19.4-beta.9622bd7f.70f808c
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 +19 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +19 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.19.4-beta.
|
|
3
|
+
* @license @wistia/ui v0.19.4-beta.9622bd7f.70f808c
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2526,9 +2526,7 @@ var differenceInCalendarDays = (dateLeft, dateRight) => {
|
|
|
2526
2526
|
|
|
2527
2527
|
// src/helpers/dateTime/timeAgoString.ts
|
|
2528
2528
|
var timeAgoString = (date, { nowAnchor = /* @__PURE__ */ new Date(), includeTime = true } = {}) => {
|
|
2529
|
-
if (isInvalidDate(date))
|
|
2530
|
-
return "";
|
|
2531
|
-
}
|
|
2529
|
+
if (isInvalidDate(date)) return "";
|
|
2532
2530
|
const minutesAgo = (nowAnchor.valueOf() - date.valueOf()) / (secondsInMinute * milisecondsInSecond);
|
|
2533
2531
|
const minutesAgoRounded = Math.round(minutesAgo);
|
|
2534
2532
|
const differenceInDays = differenceInCalendarDays(nowAnchor, date);
|
|
@@ -8784,9 +8782,7 @@ var getFillViewportStyle = (fillViewport) => {
|
|
|
8784
8782
|
return void 0;
|
|
8785
8783
|
};
|
|
8786
8784
|
var getFlexStyle = (flexMode) => {
|
|
8787
|
-
if (!flexMode)
|
|
8788
|
-
return null;
|
|
8789
|
-
}
|
|
8785
|
+
if (!flexMode) return null;
|
|
8790
8786
|
switch (flexMode) {
|
|
8791
8787
|
// grows to fill space, won't shrink, starts at 0
|
|
8792
8788
|
case "grow":
|
|
@@ -9513,19 +9509,13 @@ var Banner = ({
|
|
|
9513
9509
|
const hasImage = (0, import_type_guards25.isNotNil)(image);
|
|
9514
9510
|
const shouldShowImage = hasImage && (isVerticalLayout || width >= MIN_IMAGE_WIDTH);
|
|
9515
9511
|
const iconPosition = (0, import_react31.useMemo)(() => {
|
|
9516
|
-
if ((0, import_type_guards25.isNil)(icon))
|
|
9517
|
-
|
|
9518
|
-
}
|
|
9519
|
-
if (isSmallContainer) {
|
|
9520
|
-
return shouldShowImage ? "inline" : "above";
|
|
9521
|
-
}
|
|
9512
|
+
if ((0, import_type_guards25.isNil)(icon)) return "none";
|
|
9513
|
+
if (isSmallContainer) return shouldShowImage ? "inline" : "above";
|
|
9522
9514
|
return prominence === "secondary" ? "inline" : "above";
|
|
9523
9515
|
}, [icon, isSmallContainer, shouldShowImage, prominence]);
|
|
9524
9516
|
const hasActions = (0, import_type_guards25.isNotNil)(primaryAction) || (0, import_type_guards25.isNotNil)(secondaryAction);
|
|
9525
9517
|
const contentDirection = (0, import_react31.useMemo)(() => {
|
|
9526
|
-
if (orientation === "horizontal" && !hasActions)
|
|
9527
|
-
return "row";
|
|
9528
|
-
}
|
|
9518
|
+
if (orientation === "horizontal" && !hasActions) return "row";
|
|
9529
9519
|
return !shouldShowImage && prominence === "primary" && !isSmallContainer && !isVerticalLayout ? "row" : "column";
|
|
9530
9520
|
}, [orientation, shouldShowImage, prominence, isSmallContainer, isVerticalLayout, hasActions]);
|
|
9531
9521
|
const headingVariant = isSmallContainer || prominence === "primary" ? "heading5" : "heading3";
|
|
@@ -10269,12 +10259,8 @@ var sizeLarge = import_styled_components46.css`
|
|
|
10269
10259
|
--wui-checkbox-icon-size: 11px;
|
|
10270
10260
|
`;
|
|
10271
10261
|
var getSizeCss = (size) => {
|
|
10272
|
-
if (size === "sm")
|
|
10273
|
-
|
|
10274
|
-
}
|
|
10275
|
-
if (size === "lg") {
|
|
10276
|
-
return sizeLarge;
|
|
10277
|
-
}
|
|
10262
|
+
if (size === "sm") return sizeSmall;
|
|
10263
|
+
if (size === "lg") return sizeLarge;
|
|
10278
10264
|
return sizeMedium;
|
|
10279
10265
|
};
|
|
10280
10266
|
var StyledCheckboxWrapper = import_styled_components46.styled.div`
|
|
@@ -10419,9 +10405,7 @@ Checkbox.displayName = "Checkbox_UI";
|
|
|
10419
10405
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
10420
10406
|
var import_react39 = require("react");
|
|
10421
10407
|
var isClickableElement = (element) => {
|
|
10422
|
-
if (!element)
|
|
10423
|
-
return false;
|
|
10424
|
-
}
|
|
10408
|
+
if (!element) return false;
|
|
10425
10409
|
const el = element;
|
|
10426
10410
|
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;
|
|
10427
10411
|
};
|
|
@@ -14651,9 +14635,7 @@ var EditableHeading = ({
|
|
|
14651
14635
|
const [headingHeight, setHeadingHeight] = (0, import_react63.useState)("60");
|
|
14652
14636
|
const headingRef = (0, import_react63.useRef)(null);
|
|
14653
14637
|
const handleSetEditing = (editing) => {
|
|
14654
|
-
if (editingDisabled)
|
|
14655
|
-
return;
|
|
14656
|
-
}
|
|
14638
|
+
if (editingDisabled) return;
|
|
14657
14639
|
if (editing && headingRef.current) {
|
|
14658
14640
|
setHeadingHeight(`${headingRef.current.offsetHeight}`);
|
|
14659
14641
|
}
|
|
@@ -14935,7 +14917,7 @@ var EditableTextDisplayComponent = (0, import_react65.forwardRef)(
|
|
|
14935
14917
|
};
|
|
14936
14918
|
const elementType = renderAs ?? getDefaultTypographicElement(typographicVariant);
|
|
14937
14919
|
const displayText = value.length > 0 ? value : placeholder;
|
|
14938
|
-
const isPlaceholderVisible = value.length === 0 &&
|
|
14920
|
+
const isPlaceholderVisible = value.length === 0 && !!placeholder;
|
|
14939
14921
|
if (isEditing) {
|
|
14940
14922
|
return null;
|
|
14941
14923
|
}
|
|
@@ -15080,9 +15062,7 @@ var EditableTextInput = (props) => {
|
|
|
15080
15062
|
}, 0);
|
|
15081
15063
|
}
|
|
15082
15064
|
};
|
|
15083
|
-
if (!isEditing)
|
|
15084
|
-
return null;
|
|
15085
|
-
}
|
|
15065
|
+
if (!isEditing) return null;
|
|
15086
15066
|
return /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(
|
|
15087
15067
|
StyledInput2,
|
|
15088
15068
|
{
|
|
@@ -15163,9 +15143,7 @@ var EditableTextSubmitButton = ({
|
|
|
15163
15143
|
onClick: handleClick,
|
|
15164
15144
|
"data-wui-editable-text-submit": true
|
|
15165
15145
|
};
|
|
15166
|
-
if (!isEditing)
|
|
15167
|
-
return null;
|
|
15168
|
-
}
|
|
15146
|
+
if (!isEditing) return null;
|
|
15169
15147
|
return (0, import_react68.cloneElement)(onlyChild, triggerProps);
|
|
15170
15148
|
};
|
|
15171
15149
|
|
|
@@ -15195,9 +15173,7 @@ var EditableTextCancelButton = ({
|
|
|
15195
15173
|
onClick: handleClick,
|
|
15196
15174
|
"data-wui-editable-text-cancel": true
|
|
15197
15175
|
};
|
|
15198
|
-
if (!isEditing)
|
|
15199
|
-
return null;
|
|
15200
|
-
}
|
|
15176
|
+
if (!isEditing) return null;
|
|
15201
15177
|
return (0, import_react69.cloneElement)(onlyChild, triggerProps);
|
|
15202
15178
|
};
|
|
15203
15179
|
|
|
@@ -15221,9 +15197,7 @@ var EditableTextTrigger = ({
|
|
|
15221
15197
|
"data-wui-editable-text-trigger": true,
|
|
15222
15198
|
...props
|
|
15223
15199
|
};
|
|
15224
|
-
if (isEditing)
|
|
15225
|
-
return null;
|
|
15226
|
-
}
|
|
15200
|
+
if (isEditing) return null;
|
|
15227
15201
|
return (0, import_react70.cloneElement)(onlyChild, triggerProps);
|
|
15228
15202
|
};
|
|
15229
15203
|
|
|
@@ -16648,12 +16622,8 @@ var sizeLarge2 = import_styled_components103.css`
|
|
|
16648
16622
|
--wui-radio-icon-size: 10px;
|
|
16649
16623
|
`;
|
|
16650
16624
|
var getSizeCss3 = (size) => {
|
|
16651
|
-
if (size === "sm")
|
|
16652
|
-
|
|
16653
|
-
}
|
|
16654
|
-
if (size === "lg") {
|
|
16655
|
-
return sizeLarge2;
|
|
16656
|
-
}
|
|
16625
|
+
if (size === "sm") return sizeSmall2;
|
|
16626
|
+
if (size === "lg") return sizeLarge2;
|
|
16657
16627
|
return sizeMedium2;
|
|
16658
16628
|
};
|
|
16659
16629
|
var StyledRadioWrapper = import_styled_components103.styled.div`
|
|
@@ -18595,9 +18565,7 @@ var Thumbnail = (0, import_react97.forwardRef)(
|
|
|
18595
18565
|
}, [storyboard]);
|
|
18596
18566
|
const handleMouseMove = (0, import_react97.useCallback)(
|
|
18597
18567
|
(mouseEvent) => {
|
|
18598
|
-
if (!isScrubbable)
|
|
18599
|
-
return;
|
|
18600
|
-
}
|
|
18568
|
+
if (!isScrubbable) return;
|
|
18601
18569
|
const elem = mouseEvent.currentTarget;
|
|
18602
18570
|
const relMousePos = getRelativeMousePosition(elem, mouseEvent);
|
|
18603
18571
|
const newPercent = relMousePos.left / elem.clientWidth;
|
|
@@ -18609,9 +18577,7 @@ var Thumbnail = (0, import_react97.forwardRef)(
|
|
|
18609
18577
|
[isScrubbable, trackStoryboardLoadStatus]
|
|
18610
18578
|
);
|
|
18611
18579
|
const handleMouseOut = (0, import_react97.useCallback)(() => {
|
|
18612
|
-
if (!isScrubbable)
|
|
18613
|
-
return;
|
|
18614
|
-
}
|
|
18580
|
+
if (!isScrubbable) return;
|
|
18615
18581
|
setIsMouseOver(false);
|
|
18616
18582
|
setCursorPosition(null);
|
|
18617
18583
|
}, [isScrubbable]);
|