@wistia/ui 0.4.12 → 0.4.13-beta.06998a7c.b5fc7fb
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 +179 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +73 -1
- package/dist/index.d.ts +73 -1
- package/dist/index.mjs +176 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.4.
|
|
3
|
+
* @license @wistia/ui v0.4.13-beta.06998a7c.b5fc7fb
|
|
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,
|
|
@@ -1789,7 +1792,7 @@ Ellipsis.displayName = "Ellipsis";
|
|
|
1789
1792
|
// src/private/helpers/getColorScheme/getColorScheme.ts
|
|
1790
1793
|
var import_styled_components12 = require("styled-components");
|
|
1791
1794
|
var colorSchemeSchema = [
|
|
1792
|
-
{ token: "bg-surface", step: "
|
|
1795
|
+
{ token: "bg-surface", step: "2" },
|
|
1793
1796
|
{ token: "bg-surface-hover", step: "3" },
|
|
1794
1797
|
{ token: "bg-surface-active", step: "4" },
|
|
1795
1798
|
{ token: "bg-surface-secondary", step: "3" },
|
|
@@ -1815,7 +1818,7 @@ var colorSchemeSchema = [
|
|
|
1815
1818
|
{ token: "focus-ring", step: "9" }
|
|
1816
1819
|
];
|
|
1817
1820
|
var defaultScheme = import_styled_components12.css`
|
|
1818
|
-
--wui-color-bg-surface: var(--wui-gray-
|
|
1821
|
+
--wui-color-bg-surface: var(--wui-gray-1);
|
|
1819
1822
|
--wui-color-bg-surface-hover: var(--wui-gray-3);
|
|
1820
1823
|
--wui-color-bg-surface-active: var(--wui-gray-4);
|
|
1821
1824
|
--wui-color-bg-surface-secondary: var(--wui-gray-3);
|
|
@@ -9163,6 +9166,176 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
9163
9166
|
children
|
|
9164
9167
|
] });
|
|
9165
9168
|
};
|
|
9169
|
+
|
|
9170
|
+
// src/components/DataCards/DataCard.tsx
|
|
9171
|
+
var import_styled_components60 = __toESM(require("styled-components"));
|
|
9172
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
9173
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
9174
|
+
var StyledDataCard = import_styled_components60.default.div`
|
|
9175
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
9176
|
+
display: grid;
|
|
9177
|
+
grid-template-areas: 'label slot' 'value value';
|
|
9178
|
+
grid-template-rows: auto auto;
|
|
9179
|
+
grid-template-columns: auto auto;
|
|
9180
|
+
gap: var(--wui-space-01);
|
|
9181
|
+
padding: var(--wui-space-03);
|
|
9182
|
+
background: var(--wui-color-bg-surface-secondary);
|
|
9183
|
+
flex: 1;
|
|
9184
|
+
border-radius: var(--wui-border-radius-02);
|
|
9185
|
+
position: relative;
|
|
9186
|
+
`;
|
|
9187
|
+
var shimmer = import_styled_components60.keyframes`
|
|
9188
|
+
0% {
|
|
9189
|
+
background-position: 200% 0;
|
|
9190
|
+
}
|
|
9191
|
+
100% {
|
|
9192
|
+
background-position: -200% 0;
|
|
9193
|
+
}
|
|
9194
|
+
`;
|
|
9195
|
+
var LoadingBackground = import_styled_components60.default.div`
|
|
9196
|
+
background: linear-gradient(
|
|
9197
|
+
90deg,
|
|
9198
|
+
var(--wui-color-bg-surface-tertiary) 25%,
|
|
9199
|
+
var(--wui-color-bg-surface-secondary) 37%,
|
|
9200
|
+
var(--wui-color-bg-surface-tertiary) 63%
|
|
9201
|
+
);
|
|
9202
|
+
background-size: 200% 100%;
|
|
9203
|
+
animation: ${shimmer} 1.5s infinite;
|
|
9204
|
+
border-radius: var(--wui-border-radius-01);
|
|
9205
|
+
`;
|
|
9206
|
+
var StyledLoadingLabel = (0, import_styled_components60.default)(LoadingBackground)`
|
|
9207
|
+
width: 80px;
|
|
9208
|
+
height: var(--wui-typography-heading-6-line-height);
|
|
9209
|
+
`;
|
|
9210
|
+
var StyledLoadingValue = (0, import_styled_components60.default)(LoadingBackground)`
|
|
9211
|
+
width: 90%;
|
|
9212
|
+
height: var(--wui-typography-heading-3-line-height);
|
|
9213
|
+
`;
|
|
9214
|
+
var StyledLabel4 = (0, import_styled_components60.default)(Heading)`
|
|
9215
|
+
grid-area: label;
|
|
9216
|
+
`;
|
|
9217
|
+
var StyledValue = (0, import_styled_components60.default)(Heading)`
|
|
9218
|
+
grid-area: value;
|
|
9219
|
+
`;
|
|
9220
|
+
var StyledSlot = import_styled_components60.default.div`
|
|
9221
|
+
display: flex;
|
|
9222
|
+
justify-content: flex-end;
|
|
9223
|
+
grid-area: slot;
|
|
9224
|
+
align-self: center;
|
|
9225
|
+
`;
|
|
9226
|
+
var StyledDataCardTrendContainer = import_styled_components60.default.div`
|
|
9227
|
+
position: absolute;
|
|
9228
|
+
bottom: var(--wui-space-01);
|
|
9229
|
+
right: var(--wui-space-01);
|
|
9230
|
+
`;
|
|
9231
|
+
var DataCard = ({
|
|
9232
|
+
label,
|
|
9233
|
+
value,
|
|
9234
|
+
upperRightSlot,
|
|
9235
|
+
colorScheme = "inherit",
|
|
9236
|
+
isLoading = false,
|
|
9237
|
+
trend,
|
|
9238
|
+
...props
|
|
9239
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(
|
|
9240
|
+
StyledDataCard,
|
|
9241
|
+
{
|
|
9242
|
+
$colorScheme: colorScheme,
|
|
9243
|
+
...props,
|
|
9244
|
+
children: [
|
|
9245
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
9246
|
+
StyledLabel4,
|
|
9247
|
+
{
|
|
9248
|
+
renderAs: "dt",
|
|
9249
|
+
variant: "heading6",
|
|
9250
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledLoadingLabel, {}) : label
|
|
9251
|
+
}
|
|
9252
|
+
),
|
|
9253
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
9254
|
+
StyledValue,
|
|
9255
|
+
{
|
|
9256
|
+
renderAs: "dd",
|
|
9257
|
+
variant: "heading3",
|
|
9258
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledLoadingValue, {}) : value
|
|
9259
|
+
}
|
|
9260
|
+
),
|
|
9261
|
+
(0, import_type_guards34.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
9262
|
+
(0, import_type_guards34.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
9263
|
+
]
|
|
9264
|
+
}
|
|
9265
|
+
);
|
|
9266
|
+
DataCard.displayName = "DataCard";
|
|
9267
|
+
|
|
9268
|
+
// src/components/DataCards/DataCards.tsx
|
|
9269
|
+
var import_styled_components61 = __toESM(require("styled-components"));
|
|
9270
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
9271
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
9272
|
+
var StyledDataCards = (0, import_styled_components61.default)(Box)`
|
|
9273
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9274
|
+
> * {
|
|
9275
|
+
min-width: 120px;
|
|
9276
|
+
max-width: ${({ $cardMaxWidth }) => (0, import_type_guards35.isNotUndefined)($cardMaxWidth) ? `${$cardMaxWidth}px` : "none"};
|
|
9277
|
+
}
|
|
9278
|
+
`;
|
|
9279
|
+
var DataCards = ({
|
|
9280
|
+
children,
|
|
9281
|
+
cardMaxWidth,
|
|
9282
|
+
colorScheme = "inherit",
|
|
9283
|
+
...props
|
|
9284
|
+
}) => {
|
|
9285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
9286
|
+
StyledDataCards,
|
|
9287
|
+
{
|
|
9288
|
+
...props,
|
|
9289
|
+
$cardMaxWidth: cardMaxWidth,
|
|
9290
|
+
$colorScheme: colorScheme,
|
|
9291
|
+
direction: "row",
|
|
9292
|
+
fill: "horizontal",
|
|
9293
|
+
gap: "space-02",
|
|
9294
|
+
renderAs: "dl",
|
|
9295
|
+
wrapItems: true,
|
|
9296
|
+
children
|
|
9297
|
+
}
|
|
9298
|
+
);
|
|
9299
|
+
};
|
|
9300
|
+
DataCards.displayName = "DataCards";
|
|
9301
|
+
|
|
9302
|
+
// src/components/DataCards/DataCardTrend.tsx
|
|
9303
|
+
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9304
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
9305
|
+
var StyledDataCardTrend = import_styled_components62.default.div`
|
|
9306
|
+
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
9307
|
+
background: var(--wui-color-bg-app);
|
|
9308
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
9309
|
+
padding: var(--wui-space-01);
|
|
9310
|
+
display: flex;
|
|
9311
|
+
align-items: center;
|
|
9312
|
+
gap: 2px;
|
|
9313
|
+
`;
|
|
9314
|
+
var DataCardTrend = ({
|
|
9315
|
+
direction = "up",
|
|
9316
|
+
outlook = "positive",
|
|
9317
|
+
children,
|
|
9318
|
+
...props
|
|
9319
|
+
}) => {
|
|
9320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
9321
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
9322
|
+
Icon,
|
|
9323
|
+
{
|
|
9324
|
+
size: "md",
|
|
9325
|
+
type: direction === "up" ? "arrow-up" : "arrow-down",
|
|
9326
|
+
...props
|
|
9327
|
+
}
|
|
9328
|
+
),
|
|
9329
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
9330
|
+
Text,
|
|
9331
|
+
{
|
|
9332
|
+
prominence: "secondary",
|
|
9333
|
+
variant: "label4",
|
|
9334
|
+
children
|
|
9335
|
+
}
|
|
9336
|
+
)
|
|
9337
|
+
] });
|
|
9338
|
+
};
|
|
9166
9339
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9167
9340
|
0 && (module.exports = {
|
|
9168
9341
|
ActionButton,
|
|
@@ -9178,6 +9351,9 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
9178
9351
|
CheckboxGroup,
|
|
9179
9352
|
CheckboxMenuItem,
|
|
9180
9353
|
ColorSchemeWrapper,
|
|
9354
|
+
DataCard,
|
|
9355
|
+
DataCardTrend,
|
|
9356
|
+
DataCards,
|
|
9181
9357
|
Divider,
|
|
9182
9358
|
Ellipsis,
|
|
9183
9359
|
Form,
|