@wistia/ui 0.8.4 → 0.8.5-beta.7902c369.c4c8fbc

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.8.4
3
+ * @license @wistia/ui v0.8.5-beta.7902c369.c4c8fbc
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -10367,8 +10367,10 @@ RadioMenuItem.displayName = "RadioMenuItem";
10367
10367
 
10368
10368
  // src/components/Menu/CheckboxMenuItem.tsx
10369
10369
  import {
10370
- DropdownMenuCheckboxItem
10370
+ DropdownMenuCheckboxItem,
10371
+ DropdownMenuItemIndicator as DropdownMenuItemIndicator2
10371
10372
  } from "@radix-ui/react-dropdown-menu";
10373
+ import { isNotNil as isNotNil21 } from "@wistia/type-guards";
10372
10374
  import { jsx as jsx238, jsxs as jsxs29 } from "react/jsx-runtime";
10373
10375
  var CheckboxIndicator = ({ checked, ...props }) => {
10374
10376
  return checked ? /* @__PURE__ */ jsxs29(
@@ -10442,7 +10444,8 @@ var CheckboxMenuItem = ({
10442
10444
  MenuItemButton,
10443
10445
  {
10444
10446
  ...props,
10445
- leftIcon: /* @__PURE__ */ jsx238(CheckboxIndicator, { checked })
10447
+ leftIcon: isNotNil21(props.icon) ? props.icon : /* @__PURE__ */ jsx238(CheckboxIndicator, { checked }),
10448
+ rightIcon: isNotNil21(props.icon) ? /* @__PURE__ */ jsx238(DropdownMenuItemIndicator2, { children: /* @__PURE__ */ jsx238(Icon, { type: "checkmark" }) }) : void 0
10446
10449
  }
10447
10450
  )
10448
10451
  }
@@ -10454,7 +10457,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
10454
10457
  import { forwardRef as forwardRef18 } from "react";
10455
10458
  import styled47 from "styled-components";
10456
10459
  import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
10457
- import { isNotNil as isNotNil22 } from "@wistia/type-guards";
10460
+ import { isNotNil as isNotNil23 } from "@wistia/type-guards";
10458
10461
 
10459
10462
  // src/components/Modal/ModalHeader.tsx
10460
10463
  import styled44 from "styled-components";
@@ -10517,7 +10520,7 @@ import { Content as DialogContent } from "@radix-ui/react-dialog";
10517
10520
 
10518
10521
  // src/private/hooks/useFocusRestore/useFocusRestore.ts
10519
10522
  import { useRef as useRef9, useEffect as useEffect7 } from "react";
10520
- import { isNotNil as isNotNil21 } from "@wistia/type-guards";
10523
+ import { isNotNil as isNotNil22 } from "@wistia/type-guards";
10521
10524
  var useFocusRestore = () => {
10522
10525
  const previouslyFocusedRef = useRef9(null);
10523
10526
  useEffect7(() => {
@@ -10525,7 +10528,7 @@ var useFocusRestore = () => {
10525
10528
  }, []);
10526
10529
  useEffect7(() => {
10527
10530
  return () => {
10528
- if (isNotNil21(previouslyFocusedRef.current)) {
10531
+ if (isNotNil22(previouslyFocusedRef.current)) {
10529
10532
  setTimeout(() => {
10530
10533
  previouslyFocusedRef.current?.focus();
10531
10534
  }, 0);
@@ -10672,7 +10675,7 @@ var Modal = forwardRef18(
10672
10675
  DialogRoot,
10673
10676
  {
10674
10677
  onOpenChange: (open2) => {
10675
- if (!open2 && isNotNil22(onRequestClose)) {
10678
+ if (!open2 && isNotNil23(onRequestClose)) {
10676
10679
  onRequestClose();
10677
10680
  }
10678
10681
  },
@@ -10685,7 +10688,7 @@ var Modal = forwardRef18(
10685
10688
  ref,
10686
10689
  fullHeight,
10687
10690
  onOpenAutoFocus: (event) => {
10688
- if (isNotNil22(initialFocusRef) && initialFocusRef.current) {
10691
+ if (isNotNil23(initialFocusRef) && initialFocusRef.current) {
10689
10692
  event.preventDefault();
10690
10693
  requestAnimationFrame(() => {
10691
10694
  initialFocusRef.current?.focus();
@@ -10719,9 +10722,9 @@ import { Root as Root2, Trigger as Trigger2, Portal, Content as Content2, Close
10719
10722
  import styled48, { css as css29 } from "styled-components";
10720
10723
 
10721
10724
  // src/private/helpers/getControls/getControlProps.tsx
10722
- import { isNotNil as isNotNil23 } from "@wistia/type-guards";
10725
+ import { isNotNil as isNotNil24 } from "@wistia/type-guards";
10723
10726
  var getControlProps = (isOpen, onOpenChange) => {
10724
- return isNotNil23(onOpenChange) && isNotNil23(isOpen) ? { open: isOpen, onOpenChange } : {};
10727
+ return isNotNil24(onOpenChange) && isNotNil24(isOpen) ? { open: isOpen, onOpenChange } : {};
10725
10728
  };
10726
10729
 
10727
10730
  // src/components/Popover/Popover.tsx
@@ -10792,7 +10795,7 @@ Popover.displayName = "Popover";
10792
10795
  // src/components/ProgressBar/ProgressBar.tsx
10793
10796
  import styled49 from "styled-components";
10794
10797
  import { Root as ProgressRoot, Indicator as ProgressIndicator } from "@radix-ui/react-progress";
10795
- import { isNotNil as isNotNil24 } from "@wistia/type-guards";
10798
+ import { isNotNil as isNotNil25 } from "@wistia/type-guards";
10796
10799
  import { jsx as jsx245, jsxs as jsxs33 } from "react/jsx-runtime";
10797
10800
  var ProgressBarWrapper = styled49.div`
10798
10801
  --progress-bar-height: 8px;
@@ -10847,7 +10850,7 @@ var ProgressBar = ({
10847
10850
  ...props
10848
10851
  }) => {
10849
10852
  return /* @__PURE__ */ jsxs33(ProgressBarWrapper, { children: [
10850
- isNotNil24(labelLeft) ? /* @__PURE__ */ jsx245(ProgressBarLabel, { children: labelLeft }) : null,
10853
+ isNotNil25(labelLeft) ? /* @__PURE__ */ jsx245(ProgressBarLabel, { children: labelLeft }) : null,
10851
10854
  /* @__PURE__ */ jsx245(
10852
10855
  StyledProgressBar,
10853
10856
  {
@@ -10863,7 +10866,7 @@ var ProgressBar = ({
10863
10866
  )
10864
10867
  }
10865
10868
  ),
10866
- isNotNil24(labelRight) ? /* @__PURE__ */ jsx245(ProgressBarLabel, { children: labelRight }) : null
10869
+ isNotNil25(labelRight) ? /* @__PURE__ */ jsx245(ProgressBarLabel, { children: labelRight }) : null
10867
10870
  ] });
10868
10871
  };
10869
10872
  ProgressBar.displayName = "ProgressBar";
@@ -11180,7 +11183,7 @@ SegmentedControl.displayName = "SegmentedControl";
11180
11183
  import { forwardRef as forwardRef21, useEffect as useEffect8, useRef as useRef10 } from "react";
11181
11184
  import styled53, { css as css32 } from "styled-components";
11182
11185
  import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
11183
- import { isNotNil as isNotNil25 } from "@wistia/type-guards";
11186
+ import { isNotNil as isNotNil26 } from "@wistia/type-guards";
11184
11187
  import { jsxs as jsxs36 } from "react/jsx-runtime";
11185
11188
  var segmentedControlItemStyles = css32`
11186
11189
  all: unset; /* ToggleGroupItem is a button element */
@@ -11287,8 +11290,8 @@ var SegmentedControlItem = forwardRef21(
11287
11290
  StyledSegmentedControlItem,
11288
11291
  {
11289
11292
  ref: combinedRef,
11290
- $hasLabel: isNotNil25(label),
11291
- "aria-label": isNotNil25(label) ? void 0 : ariaLabel,
11293
+ $hasLabel: isNotNil26(label),
11294
+ "aria-label": isNotNil26(label) ? void 0 : ariaLabel,
11292
11295
  disabled,
11293
11296
  onClick: handleClick,
11294
11297
  value,
@@ -11429,7 +11432,7 @@ Select.displayName = "Select";
11429
11432
  import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
11430
11433
  import { forwardRef as forwardRef23 } from "react";
11431
11434
  import styled55 from "styled-components";
11432
- import { isNotNil as isNotNil26 } from "@wistia/type-guards";
11435
+ import { isNotNil as isNotNil27 } from "@wistia/type-guards";
11433
11436
  import { jsx as jsx251, jsxs as jsxs38 } from "react/jsx-runtime";
11434
11437
  var StyledItem = styled55(Item)`
11435
11438
  ${variantStyleMap2.body3};
@@ -11473,7 +11476,7 @@ var SelectOption = forwardRef23(
11473
11476
  type: "checkmark"
11474
11477
  }
11475
11478
  ) }) }),
11476
- isNotNil26(selectedDisplayValue) ? /* @__PURE__ */ jsxs38("div", { children: [
11479
+ isNotNil27(selectedDisplayValue) ? /* @__PURE__ */ jsxs38("div", { children: [
11477
11480
  children,
11478
11481
  /* @__PURE__ */ jsx251("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx251(ItemText, { children: selectedDisplayValue }) })
11479
11482
  ] }) : /* @__PURE__ */ jsx251(ItemText, { children })
@@ -11774,7 +11777,7 @@ var TableRow = ({ children, ...props }) => {
11774
11777
  // src/components/Tabs/Tabs.tsx
11775
11778
  import { forwardRef as forwardRef26, useState as useState11 } from "react";
11776
11779
  import { Root as TabsRoot } from "@radix-ui/react-tabs";
11777
- import { isNotNil as isNotNil28, isNil as isNil15 } from "@wistia/type-guards";
11780
+ import { isNotNil as isNotNil29, isNil as isNil15 } from "@wistia/type-guards";
11778
11781
  import styled68 from "styled-components";
11779
11782
 
11780
11783
  // src/components/Tabs/TabPanel.tsx
@@ -11830,7 +11833,7 @@ TabList.displayName = "TabList";
11830
11833
  import { forwardRef as forwardRef25, useEffect as useEffect9, useRef as useRef11 } from "react";
11831
11834
  import styled66 from "styled-components";
11832
11835
  import { Trigger as RadixTab } from "@radix-ui/react-tabs";
11833
- import { isNotNil as isNotNil27 } from "@wistia/type-guards";
11836
+ import { isNotNil as isNotNil28 } from "@wistia/type-guards";
11834
11837
 
11835
11838
  // src/components/Tabs/useTabsValue.tsx
11836
11839
  import { createContext as createContext9, useContext as useContext8 } from "react";
@@ -11888,8 +11891,8 @@ var TabItem = forwardRef25(
11888
11891
  StyledTabItem,
11889
11892
  {
11890
11893
  ref: combinedRef,
11891
- $hasLabel: isNotNil27(label),
11892
- "aria-label": isNotNil27(label) ? void 0 : ariaLabel,
11894
+ $hasLabel: isNotNil28(label),
11895
+ "aria-label": isNotNil28(label) ? void 0 : ariaLabel,
11893
11896
  disabled,
11894
11897
  value,
11895
11898
  children: [
@@ -12030,7 +12033,7 @@ var Tabs = forwardRef26(
12030
12033
  value
12031
12034
  );
12032
12035
  }
12033
- if (isNotNil28(label)) {
12036
+ if (isNotNil29(label)) {
12034
12037
  return /* @__PURE__ */ jsx263(
12035
12038
  TabItem,
12036
12039
  {
@@ -12042,7 +12045,7 @@ var Tabs = forwardRef26(
12042
12045
  value
12043
12046
  );
12044
12047
  }
12045
- if (isNotNil28(ariaLabelForTab)) {
12048
+ if (isNotNil29(ariaLabelForTab)) {
12046
12049
  return /* @__PURE__ */ jsx263(
12047
12050
  TabItem,
12048
12051
  {
@@ -12085,7 +12088,7 @@ Tab.displayName = "Tab";
12085
12088
  // src/components/Tag/Tag.tsx
12086
12089
  import { forwardRef as forwardRef28 } from "react";
12087
12090
  import styled69 from "styled-components";
12088
- import { isNil as isNil16, isNotNil as isNotNil29, isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
12091
+ import { isNil as isNil16, isNotNil as isNotNil30, isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
12089
12092
  import { Fragment as Fragment8, jsx as jsx265, jsxs as jsxs43 } from "react/jsx-runtime";
12090
12093
  var TagLabel = styled69.a`
12091
12094
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
@@ -12202,8 +12205,8 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
12202
12205
  };
12203
12206
  var Tag = forwardRef28(
12204
12207
  ({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
12205
- const hasIcon = isNotNil29(icon);
12206
- const labelProps = isNotNil29(href) && isNonEmptyString5(href) ? { href, as: "a" } : { as: "span" };
12208
+ const hasIcon = isNotNil30(icon);
12209
+ const labelProps = isNotNil30(href) && isNonEmptyString5(href) ? { href, as: "a" } : { as: "span" };
12207
12210
  return /* @__PURE__ */ jsxs43(
12208
12211
  StyledTag,
12209
12212
  {
@@ -12239,7 +12242,7 @@ Tag.displayName = "Tag";
12239
12242
 
12240
12243
  // src/components/WistiaLogo/WistiaLogo.tsx
12241
12244
  import styled70, { css as css36 } from "styled-components";
12242
- import { isNotNil as isNotNil30 } from "@wistia/type-guards";
12245
+ import { isNotNil as isNotNil31 } from "@wistia/type-guards";
12243
12246
  import { jsx as jsx266, jsxs as jsxs44 } from "react/jsx-runtime";
12244
12247
  var renderBrandmark = (brandmarkColor, iconOnly) => {
12245
12248
  if (iconOnly) {
@@ -12352,7 +12355,7 @@ var WistiaLogo = ({
12352
12355
  ...props,
12353
12356
  children: [
12354
12357
  /* @__PURE__ */ jsx266("title", { children: title }),
12355
- isNotNil30(description) ? /* @__PURE__ */ jsx266("desc", { children: description }) : null,
12358
+ isNotNil31(description) ? /* @__PURE__ */ jsx266("desc", { children: description }) : null,
12356
12359
  renderBrandmark(brandmarkColor, iconOnly),
12357
12360
  renderLogotype(logotypeColor, iconOnly)
12358
12361
  ]
@@ -12364,7 +12367,7 @@ WistiaLogo.displayName = "WistiaLogo";
12364
12367
 
12365
12368
  // src/components/Thumbnail/ThumbnailBadge.tsx
12366
12369
  import styled71 from "styled-components";
12367
- import { isNotNil as isNotNil31 } from "@wistia/type-guards";
12370
+ import { isNotNil as isNotNil32 } from "@wistia/type-guards";
12368
12371
  import { jsx as jsx267, jsxs as jsxs45 } from "react/jsx-runtime";
12369
12372
  var StyledThumbnailBadge = styled71.div`
12370
12373
  align-items: center;
@@ -12392,7 +12395,7 @@ var StyledThumbnailBadge = styled71.div`
12392
12395
  `;
12393
12396
  var ThumbnailBadge = ({ icon, label, ...props }) => {
12394
12397
  return /* @__PURE__ */ jsxs45(StyledThumbnailBadge, { ...props, children: [
12395
- isNotNil31(icon) && icon,
12398
+ isNotNil32(icon) && icon,
12396
12399
  /* @__PURE__ */ jsx267("span", { children: label })
12397
12400
  ] });
12398
12401
  };
@@ -12401,10 +12404,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
12401
12404
  // src/components/Thumbnail/Thumbnail.tsx
12402
12405
  import { forwardRef as forwardRef29 } from "react";
12403
12406
  import styled72 from "styled-components";
12404
- import { isNil as isNil17, isNotNil as isNotNil33 } from "@wistia/type-guards";
12407
+ import { isNil as isNil17, isNotNil as isNotNil34 } from "@wistia/type-guards";
12405
12408
 
12406
12409
  // src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
12407
- import { isNotNil as isNotNil32 } from "@wistia/type-guards";
12410
+ import { isNotNil as isNotNil33 } from "@wistia/type-guards";
12408
12411
  import { css as css37 } from "styled-components";
12409
12412
  var gradients = {
12410
12413
  defaultDarkOne: css37`
@@ -12532,7 +12535,7 @@ var gradients = {
12532
12535
  };
12533
12536
  var gradientMap = Object.keys(gradients);
12534
12537
  var getBackgroundGradient = (gradientName = void 0) => {
12535
- return isNotNil32(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
12538
+ return isNotNil33(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
12536
12539
  };
12537
12540
 
12538
12541
  // src/components/Thumbnail/Thumbnail.tsx
@@ -12566,7 +12569,7 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
12566
12569
  );
12567
12570
  };
12568
12571
  var StyledThumbnail = styled72.div`
12569
- background-image: ${({ $backgroundUrl }) => isNotNil33($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
12572
+ background-image: ${({ $backgroundUrl }) => isNotNil34($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
12570
12573
  ${({ $backgroundUrl, $gradientBackground }) => (
12571
12574
  // if we don't have $backgroundUrl show a gradient
12572
12575
  isNil17($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
@@ -12574,11 +12577,15 @@ var StyledThumbnail = styled72.div`
12574
12577
  background-position: center center;
12575
12578
  background-size: cover;
12576
12579
  aspect-ratio: 16 / 9;
12577
- border-radius: var(--wui-border-radius-01);
12578
12580
  display: flex;
12579
12581
  overflow: hidden;
12580
12582
  position: relative;
12581
12583
  width: ${({ $width }) => $width};
12584
+
12585
+ &,
12586
+ img {
12587
+ border-radius: calc(8% * (9 / 16)) / 8%;
12588
+ }
12582
12589
  `;
12583
12590
  var Thumbnail = forwardRef29(
12584
12591
  ({
@@ -12589,7 +12596,7 @@ var Thumbnail = forwardRef29(
12589
12596
  children,
12590
12597
  ...props
12591
12598
  }, ref) => {
12592
- const backgroundUrl = thumbnailImageType === "square" && isNotNil33(thumbnailUrl) ? thumbnailUrl : void 0;
12599
+ const backgroundUrl = thumbnailImageType === "square" && isNotNil34(thumbnailUrl) ? thumbnailUrl : void 0;
12593
12600
  return /* @__PURE__ */ jsxs46(
12594
12601
  StyledThumbnail,
12595
12602
  {
@@ -12599,8 +12606,8 @@ var Thumbnail = forwardRef29(
12599
12606
  $width: width,
12600
12607
  ...props,
12601
12608
  children: [
12602
- isNotNil33(children) ? children : null,
12603
- isNotNil33(thumbnailUrl) ? /* @__PURE__ */ jsx268(
12609
+ isNotNil34(children) ? children : null,
12610
+ isNotNil34(thumbnailUrl) ? /* @__PURE__ */ jsx268(
12604
12611
  ThumbnailImage,
12605
12612
  {
12606
12613
  thumbnailImageType,