@wistia/ui 0.19.3 → 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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.19.3
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
  *
@@ -2526,7 +2526,9 @@ 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)) return "";
2529
+ if (isInvalidDate(date)) {
2530
+ return "";
2531
+ }
2530
2532
  const minutesAgo = (nowAnchor.valueOf() - date.valueOf()) / (secondsInMinute * milisecondsInSecond);
2531
2533
  const minutesAgoRounded = Math.round(minutesAgo);
2532
2534
  const differenceInDays = differenceInCalendarDays(nowAnchor, date);
@@ -8782,7 +8784,9 @@ var getFillViewportStyle = (fillViewport) => {
8782
8784
  return void 0;
8783
8785
  };
8784
8786
  var getFlexStyle = (flexMode) => {
8785
- if (!flexMode) return null;
8787
+ if (!flexMode) {
8788
+ return null;
8789
+ }
8786
8790
  switch (flexMode) {
8787
8791
  // grows to fill space, won't shrink, starts at 0
8788
8792
  case "grow":
@@ -9509,13 +9513,19 @@ var Banner = ({
9509
9513
  const hasImage = (0, import_type_guards25.isNotNil)(image);
9510
9514
  const shouldShowImage = hasImage && (isVerticalLayout || width >= MIN_IMAGE_WIDTH);
9511
9515
  const iconPosition = (0, import_react31.useMemo)(() => {
9512
- if ((0, import_type_guards25.isNil)(icon)) return "none";
9513
- if (isSmallContainer) return shouldShowImage ? "inline" : "above";
9516
+ if ((0, import_type_guards25.isNil)(icon)) {
9517
+ return "none";
9518
+ }
9519
+ if (isSmallContainer) {
9520
+ return shouldShowImage ? "inline" : "above";
9521
+ }
9514
9522
  return prominence === "secondary" ? "inline" : "above";
9515
9523
  }, [icon, isSmallContainer, shouldShowImage, prominence]);
9516
9524
  const hasActions = (0, import_type_guards25.isNotNil)(primaryAction) || (0, import_type_guards25.isNotNil)(secondaryAction);
9517
9525
  const contentDirection = (0, import_react31.useMemo)(() => {
9518
- if (orientation === "horizontal" && !hasActions) return "row";
9526
+ if (orientation === "horizontal" && !hasActions) {
9527
+ return "row";
9528
+ }
9519
9529
  return !shouldShowImage && prominence === "primary" && !isSmallContainer && !isVerticalLayout ? "row" : "column";
9520
9530
  }, [orientation, shouldShowImage, prominence, isSmallContainer, isVerticalLayout, hasActions]);
9521
9531
  const headingVariant = isSmallContainer || prominence === "primary" ? "heading5" : "heading3";
@@ -10259,8 +10269,12 @@ var sizeLarge = import_styled_components46.css`
10259
10269
  --wui-checkbox-icon-size: 11px;
10260
10270
  `;
10261
10271
  var getSizeCss = (size) => {
10262
- if (size === "sm") return sizeSmall;
10263
- if (size === "lg") return sizeLarge;
10272
+ if (size === "sm") {
10273
+ return sizeSmall;
10274
+ }
10275
+ if (size === "lg") {
10276
+ return sizeLarge;
10277
+ }
10264
10278
  return sizeMedium;
10265
10279
  };
10266
10280
  var StyledCheckboxWrapper = import_styled_components46.styled.div`
@@ -10405,7 +10419,9 @@ Checkbox.displayName = "Checkbox_UI";
10405
10419
  // src/components/ClickRegion/ClickRegion.tsx
10406
10420
  var import_react39 = require("react");
10407
10421
  var isClickableElement = (element) => {
10408
- if (!element) return false;
10422
+ if (!element) {
10423
+ return false;
10424
+ }
10409
10425
  const el = element;
10410
10426
  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;
10411
10427
  };
@@ -14635,7 +14651,9 @@ var EditableHeading = ({
14635
14651
  const [headingHeight, setHeadingHeight] = (0, import_react63.useState)("60");
14636
14652
  const headingRef = (0, import_react63.useRef)(null);
14637
14653
  const handleSetEditing = (editing) => {
14638
- if (editingDisabled) return;
14654
+ if (editingDisabled) {
14655
+ return;
14656
+ }
14639
14657
  if (editing && headingRef.current) {
14640
14658
  setHeadingHeight(`${headingRef.current.offsetHeight}`);
14641
14659
  }
@@ -14917,7 +14935,7 @@ var EditableTextDisplayComponent = (0, import_react65.forwardRef)(
14917
14935
  };
14918
14936
  const elementType = renderAs ?? getDefaultTypographicElement(typographicVariant);
14919
14937
  const displayText = value.length > 0 ? value : placeholder;
14920
- const isPlaceholderVisible = value.length === 0 && !!placeholder;
14938
+ const isPlaceholderVisible = value.length === 0 && Boolean(placeholder);
14921
14939
  if (isEditing) {
14922
14940
  return null;
14923
14941
  }
@@ -15062,7 +15080,9 @@ var EditableTextInput = (props) => {
15062
15080
  }, 0);
15063
15081
  }
15064
15082
  };
15065
- if (!isEditing) return null;
15083
+ if (!isEditing) {
15084
+ return null;
15085
+ }
15066
15086
  return /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(
15067
15087
  StyledInput2,
15068
15088
  {
@@ -15143,7 +15163,9 @@ var EditableTextSubmitButton = ({
15143
15163
  onClick: handleClick,
15144
15164
  "data-wui-editable-text-submit": true
15145
15165
  };
15146
- if (!isEditing) return null;
15166
+ if (!isEditing) {
15167
+ return null;
15168
+ }
15147
15169
  return (0, import_react68.cloneElement)(onlyChild, triggerProps);
15148
15170
  };
15149
15171
 
@@ -15173,7 +15195,9 @@ var EditableTextCancelButton = ({
15173
15195
  onClick: handleClick,
15174
15196
  "data-wui-editable-text-cancel": true
15175
15197
  };
15176
- if (!isEditing) return null;
15198
+ if (!isEditing) {
15199
+ return null;
15200
+ }
15177
15201
  return (0, import_react69.cloneElement)(onlyChild, triggerProps);
15178
15202
  };
15179
15203
 
@@ -15197,7 +15221,9 @@ var EditableTextTrigger = ({
15197
15221
  "data-wui-editable-text-trigger": true,
15198
15222
  ...props
15199
15223
  };
15200
- if (isEditing) return null;
15224
+ if (isEditing) {
15225
+ return null;
15226
+ }
15201
15227
  return (0, import_react70.cloneElement)(onlyChild, triggerProps);
15202
15228
  };
15203
15229
 
@@ -16622,8 +16648,12 @@ var sizeLarge2 = import_styled_components103.css`
16622
16648
  --wui-radio-icon-size: 10px;
16623
16649
  `;
16624
16650
  var getSizeCss3 = (size) => {
16625
- if (size === "sm") return sizeSmall2;
16626
- if (size === "lg") return sizeLarge2;
16651
+ if (size === "sm") {
16652
+ return sizeSmall2;
16653
+ }
16654
+ if (size === "lg") {
16655
+ return sizeLarge2;
16656
+ }
16627
16657
  return sizeMedium2;
16628
16658
  };
16629
16659
  var StyledRadioWrapper = import_styled_components103.styled.div`
@@ -17515,7 +17545,6 @@ var StyledContent3 = (0, import_styled_components112.styled)(import_react_select
17515
17545
  --wui-select-option-bg-hover: var(--wui-color-bg-surface-hover);
17516
17546
 
17517
17547
  overflow: hidden;
17518
- transform: translateY(8px);
17519
17548
  background-color: var(--wui-select-content-bg);
17520
17549
  border: 1px solid var(--wui-select-content-border);
17521
17550
  border-radius: var(--wui-select-content-border-radius);
@@ -17580,23 +17609,30 @@ var Select = (0, import_react90.forwardRef)(
17580
17609
  ]
17581
17610
  }
17582
17611
  ),
17583
- /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(StyledContent3, { position: "popper", children: [
17584
- /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(StyledScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
17585
- Icon,
17586
- {
17587
- size: "sm",
17588
- type: "caret-up"
17589
- }
17590
- ) }),
17591
- /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(import_react_select.Viewport, { children }),
17592
- /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(StyledScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
17593
- Icon,
17594
- {
17595
- size: "sm",
17596
- type: "caret-down"
17597
- }
17598
- ) })
17599
- ] }) })
17612
+ /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(
17613
+ StyledContent3,
17614
+ {
17615
+ position: "popper",
17616
+ sideOffset: 8,
17617
+ children: [
17618
+ /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(StyledScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
17619
+ Icon,
17620
+ {
17621
+ size: "sm",
17622
+ type: "caret-up"
17623
+ }
17624
+ ) }),
17625
+ /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(import_react_select.Viewport, { children }),
17626
+ /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(StyledScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
17627
+ Icon,
17628
+ {
17629
+ size: "sm",
17630
+ type: "caret-down"
17631
+ }
17632
+ ) })
17633
+ ]
17634
+ }
17635
+ ) })
17600
17636
  ] });
17601
17637
  }
17602
17638
  );
@@ -18559,7 +18595,9 @@ var Thumbnail = (0, import_react97.forwardRef)(
18559
18595
  }, [storyboard]);
18560
18596
  const handleMouseMove = (0, import_react97.useCallback)(
18561
18597
  (mouseEvent) => {
18562
- if (!isScrubbable) return;
18598
+ if (!isScrubbable) {
18599
+ return;
18600
+ }
18563
18601
  const elem = mouseEvent.currentTarget;
18564
18602
  const relMousePos = getRelativeMousePosition(elem, mouseEvent);
18565
18603
  const newPercent = relMousePos.left / elem.clientWidth;
@@ -18571,7 +18609,9 @@ var Thumbnail = (0, import_react97.forwardRef)(
18571
18609
  [isScrubbable, trackStoryboardLoadStatus]
18572
18610
  );
18573
18611
  const handleMouseOut = (0, import_react97.useCallback)(() => {
18574
- if (!isScrubbable) return;
18612
+ if (!isScrubbable) {
18613
+ return;
18614
+ }
18575
18615
  setIsMouseOver(false);
18576
18616
  setCursorPosition(null);
18577
18617
  }, [isScrubbable]);