@wistia/ui 0.19.0 → 0.19.1

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.d.mts CHANGED
@@ -1726,17 +1726,21 @@ type DataCardsProps = ComponentPropsWithoutRef<'div'> & {
1726
1726
  /**
1727
1727
  * String to pass to the `max-width` property of its children. [View the syntax on MDN →](https://developer.mozilla.org/en-US/docs/Web/CSS/max-width#syntax)
1728
1728
  */
1729
- cardMaxWidth?: string;
1729
+ cardMaxWidth?: ResponsiveObject<string> | string;
1730
1730
  /**
1731
1731
  * Sets the color scheme of the cards, can be overriden at the card level
1732
1732
  */
1733
1733
  colorScheme?: ColorSchemeTypes;
1734
+ /**
1735
+ * Desired number of columns to display.
1736
+ */
1737
+ columns?: ResponsiveObject<number | 'auto'> | number | 'auto';
1734
1738
  };
1735
1739
  /**
1736
1740
  * Displays a series of cards tailor made for displaying analytics data
1737
1741
  */
1738
1742
  declare const DataCards: {
1739
- ({ children, cardMaxWidth, colorScheme, ...props }: DataCardsProps): JSX.Element;
1743
+ ({ children, cardMaxWidth, colorScheme, columns, ...props }: DataCardsProps): JSX.Element;
1740
1744
  displayName: string;
1741
1745
  };
1742
1746
 
package/dist/index.d.ts CHANGED
@@ -1726,17 +1726,21 @@ type DataCardsProps = ComponentPropsWithoutRef<'div'> & {
1726
1726
  /**
1727
1727
  * String to pass to the `max-width` property of its children. [View the syntax on MDN →](https://developer.mozilla.org/en-US/docs/Web/CSS/max-width#syntax)
1728
1728
  */
1729
- cardMaxWidth?: string;
1729
+ cardMaxWidth?: ResponsiveObject<string> | string;
1730
1730
  /**
1731
1731
  * Sets the color scheme of the cards, can be overriden at the card level
1732
1732
  */
1733
1733
  colorScheme?: ColorSchemeTypes;
1734
+ /**
1735
+ * Desired number of columns to display.
1736
+ */
1737
+ columns?: ResponsiveObject<number | 'auto'> | number | 'auto';
1734
1738
  };
1735
1739
  /**
1736
1740
  * Displays a series of cards tailor made for displaying analytics data
1737
1741
  */
1738
1742
  declare const DataCards: {
1739
- ({ children, cardMaxWidth, colorScheme, ...props }: DataCardsProps): JSX.Element;
1743
+ ({ children, cardMaxWidth, colorScheme, columns, ...props }: DataCardsProps): JSX.Element;
1740
1744
  displayName: string;
1741
1745
  };
1742
1746
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.19.0
3
+ * @license @wistia/ui v0.19.1
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -14059,6 +14059,10 @@ var StyledLabel3 = styled58(Heading)`
14059
14059
  &[data-wui-data-card-skeleton='true'] {
14060
14060
  width: 80px;
14061
14061
  }
14062
+
14063
+ button {
14064
+ text-align: left;
14065
+ }
14062
14066
  `;
14063
14067
  var StyledValue = styled58(Heading)`
14064
14068
  grid-area: value;
@@ -14100,7 +14104,7 @@ var DataCardInner = ({
14100
14104
  StyledLabel3,
14101
14105
  {
14102
14106
  "data-wui-data-card-skeleton": isLoading,
14103
- renderAs: "dt",
14107
+ renderAs: "div",
14104
14108
  variant: "heading6",
14105
14109
  children: label
14106
14110
  }
@@ -14109,7 +14113,7 @@ var DataCardInner = ({
14109
14113
  StyledValue,
14110
14114
  {
14111
14115
  "data-wui-data-card-skeleton": isLoading,
14112
- renderAs: "dd",
14116
+ renderAs: "div",
14113
14117
  variant: "heading3",
14114
14118
  children: value
14115
14119
  }
@@ -14162,9 +14166,16 @@ import { styled as styled59 } from "styled-components";
14162
14166
  import { jsx as jsx279 } from "react/jsx-runtime";
14163
14167
  var StyledDataCards = styled59(Box)`
14164
14168
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
14169
+ --wui-data-cards-column-count: ${({ $columns }) => $columns === "auto" ? void 0 : $columns};
14170
+ --wui-data-cards-total-column-gap-width: calc(var(--wui-data-cards-column-count) - 1) *
14171
+ var(--wui-space-02);
14172
+ --wui-data-cards-column-width: calc(
14173
+ (100% - var(--wui-data-cards-total-column-gap-width)) / var(--wui-data-cards-column-count)
14174
+ );
14165
14175
 
14166
14176
  > * {
14167
14177
  min-width: 120px;
14178
+ flex-basis: var(--wui-data-cards-column-width, 0);
14168
14179
  max-width: ${({ $cardMaxWidth }) => $cardMaxWidth};
14169
14180
  }
14170
14181
  `;
@@ -14172,19 +14183,22 @@ var DataCards = ({
14172
14183
  children,
14173
14184
  cardMaxWidth = "none",
14174
14185
  colorScheme = "inherit",
14186
+ columns = "auto",
14175
14187
  ...props
14176
14188
  }) => {
14189
+ const responsiveCardMaxWidth = useResponsiveProp(cardMaxWidth);
14190
+ const responsiveColumns = useResponsiveProp(columns);
14177
14191
  return /* @__PURE__ */ jsx279(
14178
14192
  StyledDataCards,
14179
14193
  {
14180
14194
  ...props,
14181
- $cardMaxWidth: cardMaxWidth,
14195
+ $cardMaxWidth: responsiveCardMaxWidth,
14182
14196
  $colorScheme: colorScheme,
14197
+ $columns: responsiveColumns,
14183
14198
  alignItems: "stretch",
14184
14199
  direction: "row",
14185
14200
  fill: "horizontal",
14186
14201
  gap: "space-02",
14187
- renderAs: "dl",
14188
14202
  wrapItems: true,
14189
14203
  children
14190
14204
  }