@wistia/ui 0.18.10-beta.85f50c74.84b332c → 0.18.10-beta.8a03a833.0d3d223

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.10-beta.85f50c74.84b332c
3
+ * @license @wistia/ui v0.18.10-beta.8a03a833.0d3d223
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -2988,26 +2988,11 @@ var useForceUpdate = () => {
2988
2988
  var import_react11 = require("react");
2989
2989
  var useIsHovered = () => {
2990
2990
  const [isHovered, setIsHovered] = (0, import_react11.useState)(false);
2991
- const onFocus = (event) => {
2992
- if (event.target !== event.currentTarget) return;
2993
- setIsHovered(true);
2994
- };
2995
- const onMouseEnter = (event) => {
2996
- if (event.target !== event.currentTarget) return;
2997
- setIsHovered(true);
2998
- };
2999
- const onMouseMove = (event) => {
3000
- if (event.target !== event.currentTarget) return;
3001
- setIsHovered(true);
3002
- };
3003
- const onBlur = (event) => {
3004
- if (event.target !== event.currentTarget) return;
3005
- setIsHovered(false);
3006
- };
3007
- const onMouseLeave = (event) => {
3008
- if (event.target !== event.currentTarget) return;
3009
- setIsHovered(false);
3010
- };
2991
+ const onFocus = () => setIsHovered(true);
2992
+ const onMouseEnter = () => setIsHovered(true);
2993
+ const onMouseMove = () => setIsHovered(true);
2994
+ const onBlur = () => setIsHovered(false);
2995
+ const onMouseLeave = () => setIsHovered(false);
3011
2996
  const hoverProps = {
3012
2997
  onFocus,
3013
2998
  onMouseEnter,
@@ -15146,20 +15131,8 @@ var import_react73 = require("react");
15146
15131
  var import_styled_components86 = require("styled-components");
15147
15132
  var import_type_guards49 = require("@wistia/type-guards");
15148
15133
  var import_jsx_runtime288 = require("react/jsx-runtime");
15149
- var inlineErrorStyles = import_styled_components86.css`
15150
- grid-template-rows: 1fr auto;
15151
- grid-template-areas: 'label-description input' '. error';
15152
- `;
15153
- var inlineBaseGridAreaStyles = import_styled_components86.css`
15154
- grid-template-rows: 1fr;
15155
- grid-template-areas: 'label-description input';
15156
- `;
15157
- var blockGridErrorStyles = import_styled_components86.css`
15158
- grid-template-rows: auto 1fr auto;
15159
- grid-template-areas: 'label-description' 'input' 'error';
15160
- `;
15161
15134
  var StyledFormField = import_styled_components86.styled.div`
15162
- --form-field-spacing: var(--wui-space-02);
15135
+ --form-field-spacing: var(--wui-space-01);
15163
15136
  --form-field-spacing-inline: var(--wui-space-02);
15164
15137
  --form-field-error-color: var(--wui-color-text-secondary-error);
15165
15138
 
@@ -15173,28 +15146,21 @@ var StyledFormField = import_styled_components86.styled.div`
15173
15146
  &[data-label-position='inline-compact'] {
15174
15147
  gap: var(--form-field-spacing-inline);
15175
15148
  grid-template-columns: auto 1fr;
15176
- ${inlineBaseGridAreaStyles}
15177
- ${({ $hasError }) => $hasError && inlineErrorStyles}
15149
+ grid-template-rows: 1fr auto;
15178
15150
  }
15179
15151
 
15180
15152
  &[data-label-position='inline'] {
15181
15153
  gap: var(--form-field-spacing-inline);
15182
15154
  grid-template-columns: minmax(auto, 1fr) 1fr;
15183
- ${inlineBaseGridAreaStyles}
15184
- ${({ $hasError }) => $hasError && inlineErrorStyles}
15155
+ grid-template-rows: 1fr auto;
15185
15156
  }
15186
15157
 
15187
15158
  &[data-label-position='block'] {
15188
15159
  gap: var(--form-field-spacing);
15189
15160
  grid-template-columns: 1fr;
15190
- grid-template-rows: auto 1fr;
15191
- grid-template-areas: 'label-description' 'input';
15192
- ${({ $hasError }) => $hasError && blockGridErrorStyles}
15161
+ grid-template-rows: 1fr;
15193
15162
  }
15194
15163
  `;
15195
- var ErrorText = (0, import_styled_components86.styled)(Text)`
15196
- grid-area: error;
15197
- `;
15198
15164
  var StyledErrorList = import_styled_components86.styled.ul`
15199
15165
  margin: 0;
15200
15166
  padding: 0;
@@ -15202,19 +15168,17 @@ var StyledErrorList = import_styled_components86.styled.ul`
15202
15168
  display: flex;
15203
15169
  flex-direction: column;
15204
15170
  gap: var(--wui-space-01);
15205
- grid-area: error;
15206
15171
  `;
15207
15172
  var ErrorMessages = ({ errors, id }) => {
15208
15173
  const isErrorArray = (0, import_type_guards49.isArray)(errors);
15209
15174
  const isMultipleErrors = isErrorArray && errors.length > 1;
15210
15175
  if (!isErrorArray) {
15211
15176
  return /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(
15212
- ErrorText,
15177
+ Text,
15213
15178
  {
15214
15179
  colorScheme: "error",
15215
15180
  id,
15216
15181
  prominence: "secondary",
15217
- style: { gridArea: "error" },
15218
15182
  variant: "label4",
15219
15183
  children: errors
15220
15184
  },
@@ -15223,12 +15187,11 @@ var ErrorMessages = ({ errors, id }) => {
15223
15187
  }
15224
15188
  if (!isMultipleErrors) {
15225
15189
  return /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(
15226
- ErrorText,
15190
+ Text,
15227
15191
  {
15228
15192
  colorScheme: "error",
15229
15193
  id,
15230
15194
  prominence: "secondary",
15231
- style: { gridArea: "error" },
15232
15195
  variant: "label4",
15233
15196
  children: errors[0]
15234
15197
  },
@@ -15269,16 +15232,12 @@ var FormField = ({
15269
15232
  const descriptionId = `${computedId}-description`;
15270
15233
  const errorId = `${computedId}-error`;
15271
15234
  const ariaDescribedby = [descriptionId, errorId].filter(Boolean).join(" ") || void 0;
15272
- const hasDescription = (0, import_type_guards49.isNotNil)(description);
15273
- const hasError = (0, import_type_guards49.isNotNil)(computedError);
15274
- const shouldRenderLabelDescriptionWrapper = !isIntegratedLabel || hasDescription;
15275
15235
  let childProps = {
15276
15236
  name,
15277
15237
  id: computedId,
15278
15238
  label: isIntegratedLabel ? label : void 0,
15279
15239
  "aria-describedby": ariaDescribedby,
15280
- "aria-invalid": hasError,
15281
- style: { gridArea: "input" },
15240
+ "aria-invalid": (0, import_type_guards49.isNotNil)(computedError),
15282
15241
  ...props
15283
15242
  };
15284
15243
  if ((0, import_type_guards49.isUndefined)(value) && (0, import_type_guards49.isNotUndefined)(defaultValue)) {
@@ -15308,38 +15267,28 @@ var FormField = ({
15308
15267
  StyledFormField,
15309
15268
  {
15310
15269
  ...props,
15311
- $hasError: hasError,
15312
15270
  "data-label-position": labelPosition ?? formState.labelPosition,
15313
15271
  children: [
15314
- shouldRenderLabelDescriptionWrapper ? /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)(
15315
- Stack,
15272
+ !isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(
15273
+ Label,
15316
15274
  {
15317
- direction: "vertical",
15318
- gap: "space-01",
15319
- style: {
15320
- gridArea: "label-description"
15321
- },
15322
- children: [
15323
- !isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(
15324
- Label,
15325
- {
15326
- htmlFor: computedId,
15327
- required,
15328
- children: label
15329
- }
15330
- ),
15331
- hasDescription ? /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null
15332
- ]
15275
+ htmlFor: computedId,
15276
+ required,
15277
+ children: label
15333
15278
  }
15334
- ) : null,
15279
+ ),
15280
+ (0, import_type_guards49.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
15335
15281
  (0, import_react73.cloneElement)(children, childProps),
15336
- hasError ? /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(
15337
- ErrorMessages,
15338
- {
15339
- errors: computedError,
15340
- id: errorId
15341
- }
15342
- ) : null
15282
+ (0, import_type_guards49.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)(import_jsx_runtime288.Fragment, { children: [
15283
+ /* @__PURE__ */ (0, import_jsx_runtime288.jsx)("div", {}),
15284
+ /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(
15285
+ ErrorMessages,
15286
+ {
15287
+ errors: computedError,
15288
+ id: errorId
15289
+ }
15290
+ )
15291
+ ] }) : null
15343
15292
  ]
15344
15293
  }
15345
15294
  );
@@ -17722,7 +17671,6 @@ var Table = ({
17722
17671
  };
17723
17672
 
17724
17673
  // src/components/Table/TableBody.tsx
17725
- var import_react93 = require("react");
17726
17674
  var import_styled_components116 = require("styled-components");
17727
17675
 
17728
17676
  // src/components/Table/TableSectionContext.ts
@@ -17737,7 +17685,7 @@ var TableBody = ({ children, ...props }) => {
17737
17685
  };
17738
17686
 
17739
17687
  // src/components/Table/TableCell.tsx
17740
- var import_react94 = require("react");
17688
+ var import_react93 = require("react");
17741
17689
  var import_styled_components117 = require("styled-components");
17742
17690
  var import_jsx_runtime321 = require("react/jsx-runtime");
17743
17691
  var sharedStyles = import_styled_components117.css`
@@ -17758,7 +17706,7 @@ var StyledTd = import_styled_components117.styled.td`
17758
17706
  line-height: var(--wui-typography-body-2-line-height);
17759
17707
  `;
17760
17708
  var TableCell = ({ children, ...props }) => {
17761
- const section = (0, import_react94.useContext)(TableSectionContext);
17709
+ const section = (0, import_react93.useContext)(TableSectionContext);
17762
17710
  if (section === "head") {
17763
17711
  return /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(StyledTh, { ...props, children });
17764
17712
  }
@@ -17766,7 +17714,6 @@ var TableCell = ({ children, ...props }) => {
17766
17714
  };
17767
17715
 
17768
17716
  // src/components/Table/TableFoot.tsx
17769
- var import_react95 = require("react");
17770
17717
  var import_styled_components118 = require("styled-components");
17771
17718
  var import_jsx_runtime322 = require("react/jsx-runtime");
17772
17719
  var StyledTableFoot = import_styled_components118.styled.tfoot``;
@@ -17775,7 +17722,6 @@ var TableFoot = ({ children, ...props }) => {
17775
17722
  };
17776
17723
 
17777
17724
  // src/components/Table/TableHead.tsx
17778
- var import_react96 = require("react");
17779
17725
  var import_styled_components119 = require("styled-components");
17780
17726
  var import_jsx_runtime323 = require("react/jsx-runtime");
17781
17727
  var StyledThead = import_styled_components119.styled.thead``;
@@ -17793,15 +17739,15 @@ var TableRow = ({ children, ...props }) => {
17793
17739
 
17794
17740
  // src/components/Tabs/Tabs.tsx
17795
17741
  var import_react_tabs = require("@radix-ui/react-tabs");
17796
- var import_react98 = require("react");
17742
+ var import_react95 = require("react");
17797
17743
  var import_type_guards68 = require("@wistia/type-guards");
17798
17744
 
17799
17745
  // src/components/Tabs/useTabsValue.tsx
17800
- var import_react97 = require("react");
17801
- var TabsValueContext = (0, import_react97.createContext)(null);
17746
+ var import_react94 = require("react");
17747
+ var TabsValueContext = (0, import_react94.createContext)(null);
17802
17748
  var TabsValueProvider = TabsValueContext.Provider;
17803
17749
  var useTabsValue = () => {
17804
- const context = (0, import_react97.useContext)(TabsValueContext);
17750
+ const context = (0, import_react94.useContext)(TabsValueContext);
17805
17751
  if (context === null) {
17806
17752
  throw new Error("useTabsValue must be used within a TabsValueProvider");
17807
17753
  }
@@ -17817,8 +17763,8 @@ var Tabs = ({
17817
17763
  defaultValue,
17818
17764
  ...props
17819
17765
  }) => {
17820
- const [value, setValue] = (0, import_react98.useState)(valueProp ?? defaultValue);
17821
- const onValueChange = (0, import_react98.useCallback)(
17766
+ const [value, setValue] = (0, import_react95.useState)(valueProp ?? defaultValue);
17767
+ const onValueChange = (0, import_react95.useCallback)(
17822
17768
  (newValue) => {
17823
17769
  setValue(newValue);
17824
17770
  if (onValueChangeProp) {
@@ -17902,7 +17848,7 @@ var TabsList = ({ children, fullWidth = true, ...props }) => {
17902
17848
  TabsList.displayName = "TabsList_UI";
17903
17849
 
17904
17850
  // src/components/Tabs/TabsTrigger.tsx
17905
- var import_react99 = require("react");
17851
+ var import_react96 = require("react");
17906
17852
  var import_type_guards70 = require("@wistia/type-guards");
17907
17853
 
17908
17854
  // src/components/Tabs/StyledRadixTabsTrigger.tsx
@@ -17918,13 +17864,13 @@ var StyledRadixTabsTrigger = (0, import_styled_components123.styled)(import_reac
17918
17864
 
17919
17865
  // src/components/Tabs/TabsTrigger.tsx
17920
17866
  var import_jsx_runtime329 = require("react/jsx-runtime");
17921
- var TabsTrigger = (0, import_react99.forwardRef)(
17867
+ var TabsTrigger = (0, import_react96.forwardRef)(
17922
17868
  ({ disabled = false, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
17923
17869
  const selectedValue = useTabsValue();
17924
17870
  const { setSelectedItemMeasurements } = useSelectedItemStyle();
17925
- const buttonRef = (0, import_react99.useRef)(null);
17871
+ const buttonRef = (0, import_react96.useRef)(null);
17926
17872
  const combinedRef = mergeRefs([buttonRef, forwardedRef]);
17927
- (0, import_react99.useEffect)(() => {
17873
+ (0, import_react96.useEffect)(() => {
17928
17874
  const buttonElem = buttonRef.current;
17929
17875
  if (!buttonElem) {
17930
17876
  return void 0;
@@ -18006,7 +17952,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
18006
17952
  ThumbnailBadge.displayName = "ThumbnailBadge_UI";
18007
17953
 
18008
17954
  // src/components/Thumbnail/Thumbnail.tsx
18009
- var import_react100 = require("react");
17955
+ var import_react97 = require("react");
18010
17956
  var import_styled_components127 = require("styled-components");
18011
17957
  var import_type_guards74 = require("@wistia/type-guards");
18012
17958
 
@@ -18388,7 +18334,7 @@ var getRelativeMousePosition = (elem, mouseEvent) => {
18388
18334
  var hasValidThumbnailUrl = (thumbnailUrl) => {
18389
18335
  return (0, import_type_guards74.isNotNil)(thumbnailUrl) && (0, import_type_guards74.isNonEmptyString)(thumbnailUrl);
18390
18336
  };
18391
- var Thumbnail = (0, import_react100.forwardRef)(
18337
+ var Thumbnail = (0, import_react97.forwardRef)(
18392
18338
  ({
18393
18339
  gradientBackground = "defaultMidOne",
18394
18340
  thumbnailImageType = "wide",
@@ -18400,17 +18346,17 @@ var Thumbnail = (0, import_react100.forwardRef)(
18400
18346
  aspectRatio = "wide",
18401
18347
  ...props
18402
18348
  }, ref) => {
18403
- const [percent, setPercent] = (0, import_react100.useState)(0);
18404
- const [isMouseOver, setIsMouseOver] = (0, import_react100.useState)(false);
18405
- const [isStoryboardReady, setIsStoryboardReady] = (0, import_react100.useState)(false);
18406
- const storyboardElementRef = (0, import_react100.useRef)(null);
18407
- const [cursorPosition, setCursorPosition] = (0, import_react100.useState)(null);
18408
- const backgroundUrl = (0, import_react100.useMemo)(
18349
+ const [percent, setPercent] = (0, import_react97.useState)(0);
18350
+ const [isMouseOver, setIsMouseOver] = (0, import_react97.useState)(false);
18351
+ const [isStoryboardReady, setIsStoryboardReady] = (0, import_react97.useState)(false);
18352
+ const storyboardElementRef = (0, import_react97.useRef)(null);
18353
+ const [cursorPosition, setCursorPosition] = (0, import_react97.useState)(null);
18354
+ const backgroundUrl = (0, import_react97.useMemo)(
18409
18355
  () => thumbnailImageType === "square" && hasValidThumbnailUrl(thumbnailUrl) ? thumbnailUrl : void 0,
18410
18356
  [thumbnailImageType, thumbnailUrl]
18411
18357
  );
18412
18358
  const isScrubbable = (0, import_type_guards74.isNotNil)(storyboard);
18413
- const trackStoryboardLoadStatus = (0, import_react100.useCallback)(() => {
18359
+ const trackStoryboardLoadStatus = (0, import_react97.useCallback)(() => {
18414
18360
  if (storyboardElementRef.current || !storyboard) {
18415
18361
  return storyboardElementRef.current;
18416
18362
  }
@@ -18420,7 +18366,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18420
18366
  storyboardElementRef.current = asset;
18421
18367
  return storyboardElementRef.current;
18422
18368
  }, [storyboard]);
18423
- const handleMouseMove = (0, import_react100.useCallback)(
18369
+ const handleMouseMove = (0, import_react97.useCallback)(
18424
18370
  (mouseEvent) => {
18425
18371
  if (!isScrubbable) return;
18426
18372
  const elem = mouseEvent.currentTarget;
@@ -18433,12 +18379,12 @@ var Thumbnail = (0, import_react100.forwardRef)(
18433
18379
  },
18434
18380
  [isScrubbable, trackStoryboardLoadStatus]
18435
18381
  );
18436
- const handleMouseOut = (0, import_react100.useCallback)(() => {
18382
+ const handleMouseOut = (0, import_react97.useCallback)(() => {
18437
18383
  if (!isScrubbable) return;
18438
18384
  setIsMouseOver(false);
18439
18385
  setCursorPosition(null);
18440
18386
  }, [isScrubbable]);
18441
- const shouldRenderStoryboard = (0, import_react100.useMemo)(() => {
18387
+ const shouldRenderStoryboard = (0, import_react97.useMemo)(() => {
18442
18388
  if ((0, import_type_guards74.isNil)(storyboard) || (0, import_type_guards74.isUndefined)(height) || (0, import_type_guards74.isEmptyString)(height)) {
18443
18389
  return false;
18444
18390
  }
@@ -18500,7 +18446,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18500
18446
  Thumbnail.displayName = "Thumbnail_UI";
18501
18447
 
18502
18448
  // src/components/ThumbnailCollage/ThumbnailCollage.tsx
18503
- var import_react101 = __toESM(require("react"));
18449
+ var import_react98 = require("react");
18504
18450
  var import_styled_components128 = require("styled-components");
18505
18451
  var import_type_guards75 = require("@wistia/type-guards");
18506
18452
  var import_jsx_runtime333 = (
@@ -18562,10 +18508,10 @@ var ThumbnailCollage = ({
18562
18508
  gradientBackground = "defaultMidOne",
18563
18509
  ...props
18564
18510
  }) => {
18565
- const thumbnailArray = import_react101.default.Children.toArray(children);
18511
+ const thumbnailArray = import_react98.Children.toArray(children);
18566
18512
  const truncatedThumbnails = thumbnailArray.slice(0, 3);
18567
18513
  const thumbnails = (0, import_type_guards75.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
18568
- return import_react101.default.cloneElement(child, {
18514
+ return (0, import_react98.cloneElement)(child, {
18569
18515
  ...child.props,
18570
18516
  children: void 0
18571
18517
  });
@@ -18718,7 +18664,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
18718
18664
  // src/components/SplitButton/SplitButton.tsx
18719
18665
  var import_styled_components130 = require("styled-components");
18720
18666
  var import_type_guards77 = require("@wistia/type-guards");
18721
- var import_react102 = require("react");
18667
+ var import_react99 = require("react");
18722
18668
  var import_jsx_runtime335 = require("react/jsx-runtime");
18723
18669
  var StyledSplitButton = import_styled_components130.styled.span`
18724
18670
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
@@ -18783,7 +18729,7 @@ var SplitButton = ({
18783
18729
  children: menuItems
18784
18730
  }
18785
18731
  ),
18786
- (0, import_type_guards77.isNotNil)(secondaryAction) && (0, import_react102.cloneElement)(secondaryAction, { disabled, size, unstyled, variant, colorScheme })
18732
+ (0, import_type_guards77.isNotNil)(secondaryAction) && (0, import_react99.cloneElement)(secondaryAction, { disabled, size, unstyled, variant, colorScheme })
18787
18733
  ] });
18788
18734
  };
18789
18735
  SplitButton.displayName = "SplitButton_UI";