@wistia/ui 0.19.3-beta.098968f1.4c9ab93 → 0.19.4-beta.32a78d83.3ea9116

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 CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.19.3-beta.098968f1.4c9ab93
3
+ * @license @wistia/ui v0.19.4-beta.32a78d83.3ea9116
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)) return "";
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) return null;
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)) return "none";
9331
- if (isSmallContainer) return shouldShowImage ? "inline" : "above";
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) return "row";
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") return sizeSmall;
10081
- if (size === "lg") return sizeLarge;
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) return false;
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) return;
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 && !!placeholder;
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) return null;
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) return null;
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) return null;
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) return null;
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") return sizeSmall2;
16474
- if (size === "lg") return sizeLarge2;
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`
@@ -18434,7 +18464,9 @@ var Thumbnail = forwardRef37(
18434
18464
  }, [storyboard]);
18435
18465
  const handleMouseMove = useCallback20(
18436
18466
  (mouseEvent) => {
18437
- if (!isScrubbable) return;
18467
+ if (!isScrubbable) {
18468
+ return;
18469
+ }
18438
18470
  const elem = mouseEvent.currentTarget;
18439
18471
  const relMousePos = getRelativeMousePosition(elem, mouseEvent);
18440
18472
  const newPercent = relMousePos.left / elem.clientWidth;
@@ -18446,7 +18478,9 @@ var Thumbnail = forwardRef37(
18446
18478
  [isScrubbable, trackStoryboardLoadStatus]
18447
18479
  );
18448
18480
  const handleMouseOut = useCallback20(() => {
18449
- if (!isScrubbable) return;
18481
+ if (!isScrubbable) {
18482
+ return;
18483
+ }
18450
18484
  setIsMouseOver(false);
18451
18485
  setCursorPosition(null);
18452
18486
  }, [isScrubbable]);