@wistia/ui 0.18.9 → 0.18.10-beta.0fccbdc0.ffbf319

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.18.9
3
+ * @license @wistia/ui v0.18.10-beta.0fccbdc0.ffbf319
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -17686,7 +17686,6 @@ var Table = ({
17686
17686
  };
17687
17687
 
17688
17688
  // src/components/Table/TableBody.tsx
17689
- var import_react93 = require("react");
17690
17689
  var import_styled_components116 = require("styled-components");
17691
17690
 
17692
17691
  // src/components/Table/TableSectionContext.ts
@@ -17701,7 +17700,7 @@ var TableBody = ({ children, ...props }) => {
17701
17700
  };
17702
17701
 
17703
17702
  // src/components/Table/TableCell.tsx
17704
- var import_react94 = require("react");
17703
+ var import_react93 = require("react");
17705
17704
  var import_styled_components117 = require("styled-components");
17706
17705
  var import_jsx_runtime321 = require("react/jsx-runtime");
17707
17706
  var sharedStyles = import_styled_components117.css`
@@ -17722,7 +17721,7 @@ var StyledTd = import_styled_components117.styled.td`
17722
17721
  line-height: var(--wui-typography-body-2-line-height);
17723
17722
  `;
17724
17723
  var TableCell = ({ children, ...props }) => {
17725
- const section = (0, import_react94.useContext)(TableSectionContext);
17724
+ const section = (0, import_react93.useContext)(TableSectionContext);
17726
17725
  if (section === "head") {
17727
17726
  return /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(StyledTh, { ...props, children });
17728
17727
  }
@@ -17730,7 +17729,6 @@ var TableCell = ({ children, ...props }) => {
17730
17729
  };
17731
17730
 
17732
17731
  // src/components/Table/TableFoot.tsx
17733
- var import_react95 = require("react");
17734
17732
  var import_styled_components118 = require("styled-components");
17735
17733
  var import_jsx_runtime322 = require("react/jsx-runtime");
17736
17734
  var StyledTableFoot = import_styled_components118.styled.tfoot``;
@@ -17739,7 +17737,6 @@ var TableFoot = ({ children, ...props }) => {
17739
17737
  };
17740
17738
 
17741
17739
  // src/components/Table/TableHead.tsx
17742
- var import_react96 = require("react");
17743
17740
  var import_styled_components119 = require("styled-components");
17744
17741
  var import_jsx_runtime323 = require("react/jsx-runtime");
17745
17742
  var StyledThead = import_styled_components119.styled.thead``;
@@ -17757,15 +17754,15 @@ var TableRow = ({ children, ...props }) => {
17757
17754
 
17758
17755
  // src/components/Tabs/Tabs.tsx
17759
17756
  var import_react_tabs = require("@radix-ui/react-tabs");
17760
- var import_react98 = require("react");
17757
+ var import_react95 = require("react");
17761
17758
  var import_type_guards68 = require("@wistia/type-guards");
17762
17759
 
17763
17760
  // src/components/Tabs/useTabsValue.tsx
17764
- var import_react97 = require("react");
17765
- var TabsValueContext = (0, import_react97.createContext)(null);
17761
+ var import_react94 = require("react");
17762
+ var TabsValueContext = (0, import_react94.createContext)(null);
17766
17763
  var TabsValueProvider = TabsValueContext.Provider;
17767
17764
  var useTabsValue = () => {
17768
- const context = (0, import_react97.useContext)(TabsValueContext);
17765
+ const context = (0, import_react94.useContext)(TabsValueContext);
17769
17766
  if (context === null) {
17770
17767
  throw new Error("useTabsValue must be used within a TabsValueProvider");
17771
17768
  }
@@ -17781,8 +17778,8 @@ var Tabs = ({
17781
17778
  defaultValue,
17782
17779
  ...props
17783
17780
  }) => {
17784
- const [value, setValue] = (0, import_react98.useState)(valueProp ?? defaultValue);
17785
- const onValueChange = (0, import_react98.useCallback)(
17781
+ const [value, setValue] = (0, import_react95.useState)(valueProp ?? defaultValue);
17782
+ const onValueChange = (0, import_react95.useCallback)(
17786
17783
  (newValue) => {
17787
17784
  setValue(newValue);
17788
17785
  if (onValueChangeProp) {
@@ -17866,7 +17863,7 @@ var TabsList = ({ children, fullWidth = true, ...props }) => {
17866
17863
  TabsList.displayName = "TabsList_UI";
17867
17864
 
17868
17865
  // src/components/Tabs/TabsTrigger.tsx
17869
- var import_react99 = require("react");
17866
+ var import_react96 = require("react");
17870
17867
  var import_type_guards70 = require("@wistia/type-guards");
17871
17868
 
17872
17869
  // src/components/Tabs/StyledRadixTabsTrigger.tsx
@@ -17882,13 +17879,13 @@ var StyledRadixTabsTrigger = (0, import_styled_components123.styled)(import_reac
17882
17879
 
17883
17880
  // src/components/Tabs/TabsTrigger.tsx
17884
17881
  var import_jsx_runtime329 = require("react/jsx-runtime");
17885
- var TabsTrigger = (0, import_react99.forwardRef)(
17882
+ var TabsTrigger = (0, import_react96.forwardRef)(
17886
17883
  ({ disabled = false, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
17887
17884
  const selectedValue = useTabsValue();
17888
17885
  const { setSelectedItemMeasurements } = useSelectedItemStyle();
17889
- const buttonRef = (0, import_react99.useRef)(null);
17886
+ const buttonRef = (0, import_react96.useRef)(null);
17890
17887
  const combinedRef = mergeRefs([buttonRef, forwardedRef]);
17891
- (0, import_react99.useEffect)(() => {
17888
+ (0, import_react96.useEffect)(() => {
17892
17889
  const buttonElem = buttonRef.current;
17893
17890
  if (!buttonElem) {
17894
17891
  return void 0;
@@ -17940,7 +17937,7 @@ var StyledThumbnailBadge = import_styled_components124.styled.div`
17940
17937
  align-items: center;
17941
17938
  background-color: rgb(0 0 0 / 50%);
17942
17939
  border-radius: var(--wui-border-radius-01);
17943
- bottom: var(--wui-thumbnail-badge-offset);
17940
+ bottom: var(--wui-thumbnail-badge-offset, var(--wui-space-01));
17944
17941
  color: var(--wui-color-text-on-fill);
17945
17942
  display: flex;
17946
17943
  font-size: var(--wui-typography-body-4-size);
@@ -17948,7 +17945,7 @@ var StyledThumbnailBadge = import_styled_components124.styled.div`
17948
17945
  gap: var(--wui-space-01);
17949
17946
  padding: 0 var(--wui-space-01);
17950
17947
  position: absolute;
17951
- right: var(--wui-thumbnail-badge-offset);
17948
+ right: var(--wui-thumbnail-badge-offset, var(--wui-space-01));
17952
17949
  z-index: 1;
17953
17950
 
17954
17951
  svg {
@@ -17970,7 +17967,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
17970
17967
  ThumbnailBadge.displayName = "ThumbnailBadge_UI";
17971
17968
 
17972
17969
  // src/components/Thumbnail/Thumbnail.tsx
17973
- var import_react100 = require("react");
17970
+ var import_react97 = require("react");
17974
17971
  var import_styled_components127 = require("styled-components");
17975
17972
  var import_type_guards74 = require("@wistia/type-guards");
17976
17973
 
@@ -18303,7 +18300,11 @@ var StyledThumbnail = import_styled_components127.styled.div`
18303
18300
  width: 100%;
18304
18301
  overflow: hidden;
18305
18302
  position: relative;
18306
- border-radius: clamp(var(--wui-border-radius-01), 8cqh, var(--wui-border-radius-05));
18303
+
18304
+ &,
18305
+ img {
18306
+ border-radius: clamp(var(--wui-border-radius-01), 8cqh, var(--wui-border-radius-05));
18307
+ }
18307
18308
 
18308
18309
  @container (min-width: 200px) {
18309
18310
  --wui-thumbnail-badge-offset: var(--wui-space-02);
@@ -18348,7 +18349,7 @@ var getRelativeMousePosition = (elem, mouseEvent) => {
18348
18349
  var hasValidThumbnailUrl = (thumbnailUrl) => {
18349
18350
  return (0, import_type_guards74.isNotNil)(thumbnailUrl) && (0, import_type_guards74.isNonEmptyString)(thumbnailUrl);
18350
18351
  };
18351
- var Thumbnail = (0, import_react100.forwardRef)(
18352
+ var Thumbnail = (0, import_react97.forwardRef)(
18352
18353
  ({
18353
18354
  gradientBackground = "defaultMidOne",
18354
18355
  thumbnailImageType = "wide",
@@ -18360,17 +18361,17 @@ var Thumbnail = (0, import_react100.forwardRef)(
18360
18361
  aspectRatio = "wide",
18361
18362
  ...props
18362
18363
  }, ref) => {
18363
- const [percent, setPercent] = (0, import_react100.useState)(0);
18364
- const [isMouseOver, setIsMouseOver] = (0, import_react100.useState)(false);
18365
- const [isStoryboardReady, setIsStoryboardReady] = (0, import_react100.useState)(false);
18366
- const storyboardElementRef = (0, import_react100.useRef)(null);
18367
- const [cursorPosition, setCursorPosition] = (0, import_react100.useState)(null);
18368
- const backgroundUrl = (0, import_react100.useMemo)(
18364
+ const [percent, setPercent] = (0, import_react97.useState)(0);
18365
+ const [isMouseOver, setIsMouseOver] = (0, import_react97.useState)(false);
18366
+ const [isStoryboardReady, setIsStoryboardReady] = (0, import_react97.useState)(false);
18367
+ const storyboardElementRef = (0, import_react97.useRef)(null);
18368
+ const [cursorPosition, setCursorPosition] = (0, import_react97.useState)(null);
18369
+ const backgroundUrl = (0, import_react97.useMemo)(
18369
18370
  () => thumbnailImageType === "square" && hasValidThumbnailUrl(thumbnailUrl) ? thumbnailUrl : void 0,
18370
18371
  [thumbnailImageType, thumbnailUrl]
18371
18372
  );
18372
18373
  const isScrubbable = (0, import_type_guards74.isNotNil)(storyboard);
18373
- const trackStoryboardLoadStatus = (0, import_react100.useCallback)(() => {
18374
+ const trackStoryboardLoadStatus = (0, import_react97.useCallback)(() => {
18374
18375
  if (storyboardElementRef.current || !storyboard) {
18375
18376
  return storyboardElementRef.current;
18376
18377
  }
@@ -18380,7 +18381,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18380
18381
  storyboardElementRef.current = asset;
18381
18382
  return storyboardElementRef.current;
18382
18383
  }, [storyboard]);
18383
- const handleMouseMove = (0, import_react100.useCallback)(
18384
+ const handleMouseMove = (0, import_react97.useCallback)(
18384
18385
  (mouseEvent) => {
18385
18386
  if (!isScrubbable) return;
18386
18387
  const elem = mouseEvent.currentTarget;
@@ -18393,12 +18394,12 @@ var Thumbnail = (0, import_react100.forwardRef)(
18393
18394
  },
18394
18395
  [isScrubbable, trackStoryboardLoadStatus]
18395
18396
  );
18396
- const handleMouseOut = (0, import_react100.useCallback)(() => {
18397
+ const handleMouseOut = (0, import_react97.useCallback)(() => {
18397
18398
  if (!isScrubbable) return;
18398
18399
  setIsMouseOver(false);
18399
18400
  setCursorPosition(null);
18400
18401
  }, [isScrubbable]);
18401
- const shouldRenderStoryboard = (0, import_react100.useMemo)(() => {
18402
+ const shouldRenderStoryboard = (0, import_react97.useMemo)(() => {
18402
18403
  if ((0, import_type_guards74.isNil)(storyboard) || (0, import_type_guards74.isUndefined)(height) || (0, import_type_guards74.isEmptyString)(height)) {
18403
18404
  return false;
18404
18405
  }
@@ -18460,7 +18461,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18460
18461
  Thumbnail.displayName = "Thumbnail_UI";
18461
18462
 
18462
18463
  // src/components/ThumbnailCollage/ThumbnailCollage.tsx
18463
- var import_react101 = __toESM(require("react"));
18464
+ var import_react98 = require("react");
18464
18465
  var import_styled_components128 = require("styled-components");
18465
18466
  var import_type_guards75 = require("@wistia/type-guards");
18466
18467
  var import_jsx_runtime333 = (
@@ -18522,10 +18523,10 @@ var ThumbnailCollage = ({
18522
18523
  gradientBackground = "defaultMidOne",
18523
18524
  ...props
18524
18525
  }) => {
18525
- const thumbnailArray = import_react101.default.Children.toArray(children);
18526
+ const thumbnailArray = import_react98.Children.toArray(children);
18526
18527
  const truncatedThumbnails = thumbnailArray.slice(0, 3);
18527
18528
  const thumbnails = (0, import_type_guards75.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
18528
- return import_react101.default.cloneElement(child, {
18529
+ return (0, import_react98.cloneElement)(child, {
18529
18530
  ...child.props,
18530
18531
  children: void 0
18531
18532
  });
@@ -18678,7 +18679,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
18678
18679
  // src/components/SplitButton/SplitButton.tsx
18679
18680
  var import_styled_components130 = require("styled-components");
18680
18681
  var import_type_guards77 = require("@wistia/type-guards");
18681
- var import_react102 = require("react");
18682
+ var import_react99 = require("react");
18682
18683
  var import_jsx_runtime335 = require("react/jsx-runtime");
18683
18684
  var StyledSplitButton = import_styled_components130.styled.span`
18684
18685
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
@@ -18743,7 +18744,7 @@ var SplitButton = ({
18743
18744
  children: menuItems
18744
18745
  }
18745
18746
  ),
18746
- (0, import_type_guards77.isNotNil)(secondaryAction) && (0, import_react102.cloneElement)(secondaryAction, { disabled, size, unstyled, variant, colorScheme })
18747
+ (0, import_type_guards77.isNotNil)(secondaryAction) && (0, import_react99.cloneElement)(secondaryAction, { disabled, size, unstyled, variant, colorScheme })
18747
18748
  ] });
18748
18749
  };
18749
18750
  SplitButton.displayName = "SplitButton_UI";