@wistia/ui 0.6.16 → 0.6.17-beta.6202168.f73ca65

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.6.16
3
+ * @license @wistia/ui v0.6.17-beta.6202168.f73ca65
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -7224,6 +7224,8 @@ var StyledBoxComponent = import_styled_components26.default.div`
7224
7224
  flex-direction: ${({ $flexDirection }) => $flexDirection};
7225
7225
  ${({ $fillBox: fill }) => getFillStyle(fill)};
7226
7226
  ${({ $fillViewport }) => getFillViewportStyle($fillViewport)};
7227
+ height: ${({ $height }) => $height ?? null};
7228
+ width: ${({ $width }) => $width ?? null};
7227
7229
 
7228
7230
  /* Box children styles */
7229
7231
  flex-grow: ${({ $grow }) => (0, import_type_guards17.isNotNil)($grow) ? $grow : null};
@@ -7264,14 +7266,36 @@ var BoxComponent = (0, import_react16.forwardRef)(
7264
7266
  grow,
7265
7267
  hasBoxParent = false,
7266
7268
  // eslint-disable-line @typescript-eslint/no-unused-vars
7269
+ height,
7267
7270
  inline = false,
7268
7271
  justifyContent = "flex-start",
7269
7272
  order,
7270
7273
  renderAs,
7271
7274
  shrink,
7275
+ width,
7272
7276
  wrapItems = false,
7273
7277
  ...otherProps
7274
7278
  }, ref) => {
7279
+ if ((0, import_type_guards17.isNotUndefined)(height)) {
7280
+ if ((0, import_type_guards17.isTruthy)(fill) || fill === "vertical") {
7281
+ throw new Error('Cannot use height prop with fill="vertical" or fill={true}');
7282
+ }
7283
+ if ((0, import_type_guards17.isTruthy)(fillViewport) || fillViewport === "vertical") {
7284
+ throw new Error(
7285
+ 'Cannot use height prop with fillViewport="vertical" or fillViewport={true}'
7286
+ );
7287
+ }
7288
+ }
7289
+ if ((0, import_type_guards17.isNotUndefined)(width)) {
7290
+ if ((0, import_type_guards17.isTruthy)(fill) || fill === "horizontal") {
7291
+ throw new Error('Cannot use width prop with fill="horizontal" or fill={true}');
7292
+ }
7293
+ if ((0, import_type_guards17.isTruthy)(fillViewport) || fillViewport === "horizontal") {
7294
+ throw new Error(
7295
+ 'Cannot use width prop with fillViewport="horizontal" or fillViewport={true}'
7296
+ );
7297
+ }
7298
+ }
7275
7299
  return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
7276
7300
  StyledBoxComponent,
7277
7301
  {
@@ -7285,10 +7309,12 @@ var BoxComponent = (0, import_react16.forwardRef)(
7285
7309
  $flexDirection: direction,
7286
7310
  $gap: gap,
7287
7311
  $grow: grow,
7312
+ $height: height,
7288
7313
  $inline: inline,
7289
7314
  $justifyContent: justifyContent,
7290
7315
  $order: order,
7291
7316
  $shrink: shrink,
7317
+ $width: width,
7292
7318
  $wrapItems: wrapItems,
7293
7319
  as: renderAs ?? DEFAULT_ELEMENT,
7294
7320
  ...otherProps,
@@ -7458,6 +7484,8 @@ var StyledCard = (0, import_styled_components30.default)(Box)`
7458
7484
  outline-offset: -2px;
7459
7485
  border-radius: var(--wui-border-radius-02);
7460
7486
  display: flex;
7487
+ height: ${({ $height }) => $height};
7488
+ width: ${({ $width }) => $width};
7461
7489
  `;
7462
7490
  var prominenceMap = {
7463
7491
  default: {
@@ -7481,6 +7509,8 @@ var Card = ({
7481
7509
  colorScheme = "inherit",
7482
7510
  prominence = "secondary",
7483
7511
  border = false,
7512
+ height,
7513
+ width,
7484
7514
  ...props
7485
7515
  }) => /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
7486
7516
  StyledCard,
@@ -7488,7 +7518,9 @@ var Card = ({
7488
7518
  $backgroundColor: prominenceMap[prominence].backgroundColor,
7489
7519
  $borderColor: border ? prominenceMap[prominence].borderColor : "transparent",
7490
7520
  $colorScheme: colorScheme,
7521
+ $height: height,
7491
7522
  $paddingSize: paddingSize,
7523
+ $width: width,
7492
7524
  direction,
7493
7525
  gap,
7494
7526
  ...props,
@@ -9863,12 +9895,11 @@ var Header = import_styled_components58.default.header`
9863
9895
  display: flex;
9864
9896
  order: 1;
9865
9897
  gap: var(--wui-space-01);
9866
- margin-bottom: var(--wui-space-03);
9867
- justify-content: space-between;
9898
+ justify-content: ${({ $hideTitle }) => $hideTitle ? "flex-end" : "space-between"}; /* ensure ModalCloseButton is right-aligned */
9868
9899
 
9869
9900
  /* DialogTitle creates an h2 element which inherits some margin */
9870
9901
  h2 {
9871
- margin-top: 0;
9902
+ margin: 0 0 var(--wui-space-03);
9872
9903
  }
9873
9904
  `;
9874
9905
  var Title = (0, import_styled_components58.default)(import_react_dialog2.Title)`
@@ -9883,7 +9914,7 @@ var ModalHeader = ({
9883
9914
  hideCloseButton
9884
9915
  }) => {
9885
9916
  const TitleComponent = hideTitle ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Title, { children: title }) }) : /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Title, { children: title });
9886
- return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(Header, { children: [
9917
+ return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(Header, { $hideTitle: hideTitle, children: [
9887
9918
  TitleComponent,
9888
9919
  hideCloseButton ? null : /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(ModalCloseButton, {})
9889
9920
  ] });
@@ -10840,14 +10871,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
10840
10871
  };
10841
10872
 
10842
10873
  // src/components/Table/Table.tsx
10843
- var import_react52 = require("react");
10844
10874
  var import_styled_components71 = __toESM(require("styled-components"));
10845
-
10846
- // src/components/Table/TableContext.tsx
10847
- var import_react51 = __toESM(require("react"));
10848
- var TableContext = import_react51.default.createContext({ divided: false });
10849
-
10850
- // src/components/Table/Table.tsx
10851
10875
  var import_jsx_runtime248 = require("react/jsx-runtime");
10852
10876
  var StyledTable = import_styled_components71.default.table`
10853
10877
  width: 100%;
@@ -10858,6 +10882,12 @@ var StyledTable = import_styled_components71.default.table`
10858
10882
  background-color: var(--wui-color-bg-surface-secondary);
10859
10883
  }
10860
10884
  `}
10885
+
10886
+ ${({ $divided }) => $divided && import_styled_components71.css`
10887
+ tr {
10888
+ border-bottom: 1px solid var(--wui-color-border);
10889
+ }
10890
+ `}
10861
10891
  `;
10862
10892
  var Table = ({
10863
10893
  children,
@@ -10865,23 +10895,23 @@ var Table = ({
10865
10895
  divided = false,
10866
10896
  ...props
10867
10897
  }) => {
10868
- const contextValue = (0, import_react52.useMemo)(() => ({ divided }), [divided]);
10869
- return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(TableContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
10898
+ return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
10870
10899
  StyledTable,
10871
10900
  {
10901
+ $divided: divided,
10872
10902
  $striped: striped,
10873
10903
  ...props,
10874
10904
  children
10875
10905
  }
10876
- ) });
10906
+ );
10877
10907
  };
10878
10908
 
10879
10909
  // src/components/Table/TableBody.tsx
10880
10910
  var import_styled_components72 = __toESM(require("styled-components"));
10881
10911
 
10882
10912
  // src/components/Table/TableSectionContext.ts
10883
- var import_react53 = require("react");
10884
- var TableSectionContext = (0, import_react53.createContext)(null);
10913
+ var import_react51 = require("react");
10914
+ var TableSectionContext = (0, import_react51.createContext)(null);
10885
10915
 
10886
10916
  // src/components/Table/TableBody.tsx
10887
10917
  var import_jsx_runtime249 = require("react/jsx-runtime");
@@ -10891,7 +10921,7 @@ var TableBody = ({ children, ...props }) => {
10891
10921
  };
10892
10922
 
10893
10923
  // src/components/Table/TableCell.tsx
10894
- var import_react54 = require("react");
10924
+ var import_react52 = require("react");
10895
10925
  var import_styled_components73 = __toESM(require("styled-components"));
10896
10926
  var import_jsx_runtime250 = require("react/jsx-runtime");
10897
10927
  var sharedStyles = import_styled_components73.css`
@@ -10912,7 +10942,7 @@ var StyledTd = import_styled_components73.default.td`
10912
10942
  line-height: var(--wui-typography-body-2-line-height);
10913
10943
  `;
10914
10944
  var TableCell = ({ children, ...props }) => {
10915
- const section = (0, import_react54.useContext)(TableSectionContext);
10945
+ const section = (0, import_react52.useContext)(TableSectionContext);
10916
10946
  if (section === "head") {
10917
10947
  return /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(StyledTh, { ...props, children });
10918
10948
  }
@@ -10936,26 +10966,15 @@ var TableHead = ({ children, ...props }) => {
10936
10966
  };
10937
10967
 
10938
10968
  // src/components/Table/TableRow.tsx
10939
- var import_react55 = require("react");
10940
10969
  var import_styled_components76 = __toESM(require("styled-components"));
10941
10970
  var import_jsx_runtime253 = require("react/jsx-runtime");
10942
- var StyledTr = import_styled_components76.default.tr`
10943
- ${({ $divided }) => $divided && `border-bottom: 1px solid var(--wui-color-border);`}
10944
- `;
10971
+ var StyledTr = import_styled_components76.default.tr``;
10945
10972
  var TableRow = ({ children, ...props }) => {
10946
- const { divided = false } = (0, import_react55.useContext)(TableContext);
10947
- return /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
10948
- StyledTr,
10949
- {
10950
- $divided: divided,
10951
- ...props,
10952
- children
10953
- }
10954
- );
10973
+ return /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(StyledTr, { ...props, children });
10955
10974
  };
10956
10975
 
10957
10976
  // src/components/Tabs/Tabs.tsx
10958
- var import_react60 = require("react");
10977
+ var import_react57 = require("react");
10959
10978
  var import_react_tabs4 = require("@radix-ui/react-tabs");
10960
10979
  var import_type_guards42 = require("@wistia/type-guards");
10961
10980
  var import_styled_components81 = __toESM(require("styled-components"));
@@ -11010,17 +11029,17 @@ var TabList = ({
11010
11029
  TabList.displayName = "TabList";
11011
11030
 
11012
11031
  // src/components/Tabs/TabItem.tsx
11013
- var import_react57 = require("react");
11032
+ var import_react54 = require("react");
11014
11033
  var import_styled_components79 = __toESM(require("styled-components"));
11015
11034
  var import_react_tabs3 = require("@radix-ui/react-tabs");
11016
11035
  var import_type_guards41 = require("@wistia/type-guards");
11017
11036
 
11018
11037
  // src/components/Tabs/useTabsValue.tsx
11019
- var import_react56 = require("react");
11020
- var TabsValueContext = (0, import_react56.createContext)(null);
11038
+ var import_react53 = require("react");
11039
+ var TabsValueContext = (0, import_react53.createContext)(null);
11021
11040
  var TabsValueProvider = TabsValueContext.Provider;
11022
11041
  var useTabsValue = () => {
11023
- const context = (0, import_react56.useContext)(TabsValueContext);
11042
+ const context = (0, import_react53.useContext)(TabsValueContext);
11024
11043
  if (context === null) {
11025
11044
  throw new Error("useTabsValue must be used within a TabsValueProvider");
11026
11045
  }
@@ -11036,13 +11055,13 @@ var StyledTabItem = (0, import_styled_components79.default)(import_react_tabs3.T
11036
11055
  outline: none;
11037
11056
  }
11038
11057
  `;
11039
- var TabItem = (0, import_react57.forwardRef)(
11058
+ var TabItem = (0, import_react54.forwardRef)(
11040
11059
  ({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
11041
11060
  const selectedValue = useTabsValue();
11042
11061
  const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
11043
- const buttonRef = (0, import_react57.useRef)(null);
11062
+ const buttonRef = (0, import_react54.useRef)(null);
11044
11063
  const combinedRef = mergeRefs([buttonRef, forwardedRef]);
11045
- (0, import_react57.useEffect)(() => {
11064
+ (0, import_react54.useEffect)(() => {
11046
11065
  const buttonElem = buttonRef.current;
11047
11066
  if (!buttonElem) {
11048
11067
  return void 0;
@@ -11086,16 +11105,16 @@ var TabItem = (0, import_react57.forwardRef)(
11086
11105
  TabItem.displayName = "TabItem";
11087
11106
 
11088
11107
  // src/components/Tabs/extractTabItems.ts
11089
- var import_react58 = require("react");
11108
+ var import_react55 = require("react");
11090
11109
  var extractTabItems = (children) => {
11091
11110
  const tabItems = [];
11092
- import_react58.Children.forEach(children, (child) => {
11093
- if (!(0, import_react58.isValidElement)(child)) {
11111
+ import_react55.Children.forEach(children, (child) => {
11112
+ if (!(0, import_react55.isValidElement)(child)) {
11094
11113
  return;
11095
11114
  }
11096
11115
  if (typeof child.type !== "string" && child.type.displayName === "Tab") {
11097
11116
  tabItems.push(child);
11098
- } else if (child.type === import_react58.Fragment) {
11117
+ } else if (child.type === import_react55.Fragment) {
11099
11118
  const fragmentElement = child;
11100
11119
  tabItems.push(...extractTabItems(fragmentElement.props.children));
11101
11120
  } else if ((child.props.children ?? null) != null) {
@@ -11108,7 +11127,7 @@ var extractTabItems = (children) => {
11108
11127
  };
11109
11128
 
11110
11129
  // src/components/Tabs/SelectedItemIndicator.tsx
11111
- var import_react59 = require("react");
11130
+ var import_react56 = require("react");
11112
11131
  var import_styled_components80 = __toESM(require("styled-components"));
11113
11132
  var import_jsx_runtime257 = require("react/jsx-runtime");
11114
11133
  var TabsSelectedItemIndicatorDiv = (0, import_styled_components80.default)(SelectedItemIndicatorDiv)`
@@ -11119,7 +11138,7 @@ var TabsSelectedItemIndicatorDiv = (0, import_styled_components80.default)(Selec
11119
11138
  var SelectedItemIndicator2 = () => {
11120
11139
  const { selectedItemMeasurements } = useSelectedItemMeasurements();
11121
11140
  const selectedValue = useTabsValue();
11122
- const selectedItemIndicatorStyle = (0, import_react59.useMemo)(
11141
+ const selectedItemIndicatorStyle = (0, import_react56.useMemo)(
11123
11142
  () => selectedItemMeasurements != null ? {
11124
11143
  height: `${selectedItemMeasurements.offsetHeight}px`,
11125
11144
  transform: `translateX(${selectedItemMeasurements.offsetLeft}px)`,
@@ -11160,7 +11179,7 @@ var StyledTabsRoot = (0, import_styled_components81.default)(import_react_tabs4.
11160
11179
  flex-direction: column;
11161
11180
  height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
11162
11181
  `;
11163
- var Tabs = (0, import_react60.forwardRef)(
11182
+ var Tabs = (0, import_react57.forwardRef)(
11164
11183
  ({
11165
11184
  children,
11166
11185
  fullWidth = true,
@@ -11172,7 +11191,7 @@ var Tabs = (0, import_react60.forwardRef)(
11172
11191
  ...otherProps
11173
11192
  }, ref) => {
11174
11193
  const tabItems = extractTabItems(children);
11175
- const [internalSelectedValue, setInternalSelectedValue] = (0, import_react60.useState)(defaultSelectedValue);
11194
+ const [internalSelectedValue, setInternalSelectedValue] = (0, import_react57.useState)(defaultSelectedValue);
11176
11195
  const modeProps = defaultSelectedValue !== void 0 ? {
11177
11196
  defaultValue: defaultSelectedValue,
11178
11197
  onValueChange: setInternalSelectedValue
@@ -11258,15 +11277,15 @@ var Tabs = (0, import_react60.forwardRef)(
11258
11277
  Tabs.displayName = "Tabs";
11259
11278
 
11260
11279
  // src/components/Tabs/Tab.tsx
11261
- var import_react61 = require("react");
11280
+ var import_react58 = require("react");
11262
11281
  var import_jsx_runtime259 = require("react/jsx-runtime");
11263
- var Tab = (0, import_react61.forwardRef)(({ children }, ref) => {
11282
+ var Tab = (0, import_react58.forwardRef)(({ children }, ref) => {
11264
11283
  return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)("div", { ref, children });
11265
11284
  });
11266
11285
  Tab.displayName = "Tab";
11267
11286
 
11268
11287
  // src/components/Tag/Tag.tsx
11269
- var import_react62 = require("react");
11288
+ var import_react59 = require("react");
11270
11289
  var import_styled_components82 = __toESM(require("styled-components"));
11271
11290
  var import_type_guards43 = require("@wistia/type-guards");
11272
11291
  var import_jsx_runtime260 = require("react/jsx-runtime");
@@ -11376,7 +11395,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
11376
11395
  )
11377
11396
  ] });
11378
11397
  };
11379
- var Tag = (0, import_react62.forwardRef)(
11398
+ var Tag = (0, import_react59.forwardRef)(
11380
11399
  ({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
11381
11400
  const labelProps = (0, import_type_guards43.isNotNil)(href) && (0, import_type_guards43.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
11382
11401
  return /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(