@wistia/ui 0.4.12 → 0.4.13-beta.e9d42e46.8e8935e

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.4.12
3
+ * @license @wistia/ui v0.4.13-beta.e9d42e46.8e8935e
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -52,6 +52,9 @@ __export(index_exports, {
52
52
  CheckboxGroup: () => CheckboxGroup,
53
53
  CheckboxMenuItem: () => CheckboxMenuItem,
54
54
  ColorSchemeWrapper: () => ColorSchemeWrapper,
55
+ DataCard: () => DataCard,
56
+ DataCardTrend: () => DataCardTrend,
57
+ DataCards: () => DataCards,
55
58
  Divider: () => Divider,
56
59
  Ellipsis: () => Ellipsis,
57
60
  Form: () => Form,
@@ -242,6 +245,10 @@ var globalStyleAdjustmentsCss = import_styled_components2.css`
242
245
  -moz-osx-font-smoothing: grayscale; /* 1 */
243
246
  -webkit-font-smoothing: antialiased; /* 2 */
244
247
  }
248
+
249
+ * {
250
+ margin: 0;
251
+ }
245
252
  `;
246
253
 
247
254
  // src/css/designTokens/index.tsx
@@ -9163,6 +9170,176 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
9163
9170
  children
9164
9171
  ] });
9165
9172
  };
9173
+
9174
+ // src/components/DataCards/DataCard.tsx
9175
+ var import_styled_components60 = __toESM(require("styled-components"));
9176
+ var import_type_guards34 = require("@wistia/type-guards");
9177
+ var import_jsx_runtime211 = require("react/jsx-runtime");
9178
+ var StyledDataCard = import_styled_components60.default.div`
9179
+ ${({ $colorScheme }) => getColorScheme($colorScheme)}
9180
+ display: grid;
9181
+ grid-template-areas: 'label slot' 'value value';
9182
+ grid-template-rows: auto auto;
9183
+ grid-template-columns: auto auto;
9184
+ gap: var(--wui-space-01);
9185
+ padding: var(--wui-space-03);
9186
+ background: var(--wui-color-bg-surface-secondary);
9187
+ flex: 1;
9188
+ border-radius: var(--wui-border-radius-02);
9189
+ position: relative;
9190
+ `;
9191
+ var shimmer = import_styled_components60.keyframes`
9192
+ 0% {
9193
+ background-position: 200% 0;
9194
+ }
9195
+ 100% {
9196
+ background-position: -200% 0;
9197
+ }
9198
+ `;
9199
+ var LoadingBackground = import_styled_components60.default.div`
9200
+ background: linear-gradient(
9201
+ 90deg,
9202
+ var(--wui-color-bg-surface-tertiary) 25%,
9203
+ var(--wui-color-bg-surface-secondary) 37%,
9204
+ var(--wui-color-bg-surface-tertiary) 63%
9205
+ );
9206
+ background-size: 200% 100%;
9207
+ animation: ${shimmer} 1.5s infinite;
9208
+ border-radius: var(--wui-border-radius-01);
9209
+ `;
9210
+ var StyledLoadingLabel = (0, import_styled_components60.default)(LoadingBackground)`
9211
+ width: 80px;
9212
+ height: var(--wui-typography-heading-6-line-height);
9213
+ `;
9214
+ var StyledLoadingValue = (0, import_styled_components60.default)(LoadingBackground)`
9215
+ width: 90%;
9216
+ height: var(--wui-typography-heading-3-line-height);
9217
+ `;
9218
+ var StyledLabel4 = (0, import_styled_components60.default)(Heading)`
9219
+ grid-area: label;
9220
+ `;
9221
+ var StyledValue = (0, import_styled_components60.default)(Heading)`
9222
+ grid-area: value;
9223
+ `;
9224
+ var StyledSlot = import_styled_components60.default.div`
9225
+ display: flex;
9226
+ justify-content: flex-end;
9227
+ grid-area: slot;
9228
+ align-self: center;
9229
+ `;
9230
+ var StyledDataCardTrendContainer = import_styled_components60.default.div`
9231
+ position: absolute;
9232
+ bottom: var(--wui-space-01);
9233
+ right: var(--wui-space-01);
9234
+ `;
9235
+ var DataCard = ({
9236
+ label,
9237
+ value,
9238
+ upperRightSlot,
9239
+ colorScheme = "inherit",
9240
+ isLoading = false,
9241
+ trend,
9242
+ ...props
9243
+ }) => /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(
9244
+ StyledDataCard,
9245
+ {
9246
+ $colorScheme: colorScheme,
9247
+ ...props,
9248
+ children: [
9249
+ /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
9250
+ StyledLabel4,
9251
+ {
9252
+ renderAs: "dt",
9253
+ variant: "heading6",
9254
+ children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledLoadingLabel, {}) : label
9255
+ }
9256
+ ),
9257
+ /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
9258
+ StyledValue,
9259
+ {
9260
+ renderAs: "dd",
9261
+ variant: "heading3",
9262
+ children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledLoadingValue, {}) : value
9263
+ }
9264
+ ),
9265
+ (0, import_type_guards34.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledSlot, { children: upperRightSlot }),
9266
+ (0, import_type_guards34.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledDataCardTrendContainer, { children: trend })
9267
+ ]
9268
+ }
9269
+ );
9270
+ DataCard.displayName = "DataCard";
9271
+
9272
+ // src/components/DataCards/DataCards.tsx
9273
+ var import_styled_components61 = __toESM(require("styled-components"));
9274
+ var import_type_guards35 = require("@wistia/type-guards");
9275
+ var import_jsx_runtime212 = require("react/jsx-runtime");
9276
+ var StyledDataCards = (0, import_styled_components61.default)(Box)`
9277
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
9278
+ > * {
9279
+ min-width: 120px;
9280
+ max-width: ${({ $cardMaxWidth }) => (0, import_type_guards35.isNotUndefined)($cardMaxWidth) ? `${$cardMaxWidth}px` : "none"};
9281
+ }
9282
+ `;
9283
+ var DataCards = ({
9284
+ children,
9285
+ cardMaxWidth,
9286
+ colorScheme = "inherit",
9287
+ ...props
9288
+ }) => {
9289
+ return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
9290
+ StyledDataCards,
9291
+ {
9292
+ ...props,
9293
+ $cardMaxWidth: cardMaxWidth,
9294
+ $colorScheme: colorScheme,
9295
+ direction: "row",
9296
+ fill: "horizontal",
9297
+ gap: "space-02",
9298
+ renderAs: "dl",
9299
+ wrapItems: true,
9300
+ children
9301
+ }
9302
+ );
9303
+ };
9304
+ DataCards.displayName = "DataCards";
9305
+
9306
+ // src/components/DataCards/DataCardTrend.tsx
9307
+ var import_styled_components62 = __toESM(require("styled-components"));
9308
+ var import_jsx_runtime213 = require("react/jsx-runtime");
9309
+ var StyledDataCardTrend = import_styled_components62.default.div`
9310
+ ${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
9311
+ background: var(--wui-color-bg-app);
9312
+ border-radius: var(--wui-border-radius-rounded);
9313
+ padding: var(--wui-space-01);
9314
+ display: flex;
9315
+ align-items: center;
9316
+ gap: 2px;
9317
+ `;
9318
+ var DataCardTrend = ({
9319
+ direction = "up",
9320
+ outlook = "positive",
9321
+ children,
9322
+ ...props
9323
+ }) => {
9324
+ return /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
9325
+ /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
9326
+ Icon,
9327
+ {
9328
+ size: "md",
9329
+ type: direction === "up" ? "arrow-up" : "arrow-down",
9330
+ ...props
9331
+ }
9332
+ ),
9333
+ /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
9334
+ Text,
9335
+ {
9336
+ prominence: "secondary",
9337
+ variant: "label4",
9338
+ children
9339
+ }
9340
+ )
9341
+ ] });
9342
+ };
9166
9343
  // Annotate the CommonJS export names for ESM import in node:
9167
9344
  0 && (module.exports = {
9168
9345
  ActionButton,
@@ -9178,6 +9355,9 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
9178
9355
  CheckboxGroup,
9179
9356
  CheckboxMenuItem,
9180
9357
  ColorSchemeWrapper,
9358
+ DataCard,
9359
+ DataCardTrend,
9360
+ DataCards,
9181
9361
  Divider,
9182
9362
  Ellipsis,
9183
9363
  Form,