@wistia/ui 0.18.17 → 0.18.18-beta.55024ef8.b34e411
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 +48 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +48 -34
- 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.18.
|
|
3
|
+
* @license @wistia/ui v0.18.18-beta.55024ef8.b34e411
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -14110,12 +14110,22 @@ var import_react62 = require("react");
|
|
|
14110
14110
|
var import_styled_components77 = require("styled-components");
|
|
14111
14111
|
var import_type_guards44 = require("@wistia/type-guards");
|
|
14112
14112
|
var import_jsx_runtime278 = require("react/jsx-runtime");
|
|
14113
|
+
var pulse = import_styled_components77.keyframes`
|
|
14114
|
+
0%,
|
|
14115
|
+
100% {
|
|
14116
|
+
opacity: 1;
|
|
14117
|
+
}
|
|
14118
|
+
50% {
|
|
14119
|
+
opacity: 0.5;
|
|
14120
|
+
}
|
|
14121
|
+
`;
|
|
14113
14122
|
var StyledDataCard = import_styled_components77.styled.div`
|
|
14114
14123
|
--wui-data-card-text: var(--wui-color-text-button);
|
|
14115
14124
|
--wui-color-text: var(--wui-data-card-text);
|
|
14116
14125
|
--wui-data-card-background: var(--wui-color-bg-surface-secondary);
|
|
14117
14126
|
--wui-data-card-background-hover: var(--wui-color-bg-surface-secondary-hover);
|
|
14118
14127
|
--wui-data-card-background-active: var(--wui-color-bg-surface-secondary-active);
|
|
14128
|
+
--wui-data-card-skeleton-color: var(--wui-color-bg-surface-tertiary);
|
|
14119
14129
|
|
|
14120
14130
|
display: grid;
|
|
14121
14131
|
grid-template-areas: 'label slot' 'value value';
|
|
@@ -14143,6 +14153,16 @@ var StyledDataCard = import_styled_components77.styled.div`
|
|
|
14143
14153
|
grid-template-rows: auto auto auto;
|
|
14144
14154
|
}
|
|
14145
14155
|
|
|
14156
|
+
[data-wui-data-card-skeleton='true'] {
|
|
14157
|
+
pointer-events: none;
|
|
14158
|
+
background-color: var(--wui-data-card-skeleton-color);
|
|
14159
|
+
animation: ${pulse} 1.5s var(--wui-motion-ease-in-out) 0.5s infinite;
|
|
14160
|
+
color: transparent;
|
|
14161
|
+
user-select: none;
|
|
14162
|
+
border-radius: var(--wui-border-radius-01);
|
|
14163
|
+
width: fit-content;
|
|
14164
|
+
}
|
|
14165
|
+
|
|
14146
14166
|
&[data-click-region] {
|
|
14147
14167
|
&:not([disabled]) {
|
|
14148
14168
|
cursor: pointer;
|
|
@@ -14174,6 +14194,7 @@ var StyledDataCard = import_styled_components77.styled.div`
|
|
|
14174
14194
|
--wui-data-card-background-hover: var(--wui-color-bg-surface-selected-hover);
|
|
14175
14195
|
--wui-data-card-background-active: var(--wui-color-bg-surface-selected-active);
|
|
14176
14196
|
--wui-data-card-focus-ring: var(--wui-color-border-selected);
|
|
14197
|
+
--wui-data-card-skeleton-color: var(--wui-color-bg-surface-selected-active);
|
|
14177
14198
|
}
|
|
14178
14199
|
}
|
|
14179
14200
|
|
|
@@ -14184,38 +14205,19 @@ var StyledDataCard = import_styled_components77.styled.div`
|
|
|
14184
14205
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
14185
14206
|
}
|
|
14186
14207
|
`;
|
|
14187
|
-
var shimmer = import_styled_components77.keyframes`
|
|
14188
|
-
0% {
|
|
14189
|
-
background-position: 200% 0;
|
|
14190
|
-
}
|
|
14191
|
-
100% {
|
|
14192
|
-
background-position: -200% 0;
|
|
14193
|
-
}
|
|
14194
|
-
`;
|
|
14195
|
-
var LoadingBackground = import_styled_components77.styled.div`
|
|
14196
|
-
background: linear-gradient(
|
|
14197
|
-
90deg,
|
|
14198
|
-
var(--wui-color-bg-surface-tertiary) 25%,
|
|
14199
|
-
var(--wui-color-bg-surface-secondary) 37%,
|
|
14200
|
-
var(--wui-color-bg-surface-tertiary) 63%
|
|
14201
|
-
);
|
|
14202
|
-
background-size: 200% 100%;
|
|
14203
|
-
animation: ${shimmer} 1.5s infinite;
|
|
14204
|
-
border-radius: var(--wui-border-radius-01);
|
|
14205
|
-
`;
|
|
14206
|
-
var StyledLoadingLabel = (0, import_styled_components77.styled)(LoadingBackground)`
|
|
14207
|
-
width: 80px;
|
|
14208
|
-
height: var(--wui-typography-heading-6-line-height);
|
|
14209
|
-
`;
|
|
14210
|
-
var StyledLoadingValue = (0, import_styled_components77.styled)(LoadingBackground)`
|
|
14211
|
-
width: 90%;
|
|
14212
|
-
height: var(--wui-typography-heading-3-line-height);
|
|
14213
|
-
`;
|
|
14214
14208
|
var StyledLabel3 = (0, import_styled_components77.styled)(Heading)`
|
|
14215
14209
|
grid-area: label;
|
|
14210
|
+
|
|
14211
|
+
&[data-wui-data-card-skeleton='true'] {
|
|
14212
|
+
width: 80px;
|
|
14213
|
+
}
|
|
14216
14214
|
`;
|
|
14217
14215
|
var StyledValue = (0, import_styled_components77.styled)(Heading)`
|
|
14218
14216
|
grid-area: value;
|
|
14217
|
+
|
|
14218
|
+
&[data-wui-data-card-skeleton='true'] {
|
|
14219
|
+
width: min(90%, 156px);
|
|
14220
|
+
}
|
|
14219
14221
|
`;
|
|
14220
14222
|
var StyledSlot = import_styled_components77.styled.div`
|
|
14221
14223
|
display: flex;
|
|
@@ -14249,17 +14251,19 @@ var DataCardInner = ({
|
|
|
14249
14251
|
/* @__PURE__ */ (0, import_jsx_runtime278.jsx)(
|
|
14250
14252
|
StyledLabel3,
|
|
14251
14253
|
{
|
|
14252
|
-
|
|
14254
|
+
"data-wui-data-card-skeleton": isLoading,
|
|
14255
|
+
renderAs: "span",
|
|
14253
14256
|
variant: "heading6",
|
|
14254
|
-
children:
|
|
14257
|
+
children: label
|
|
14255
14258
|
}
|
|
14256
14259
|
),
|
|
14257
14260
|
/* @__PURE__ */ (0, import_jsx_runtime278.jsx)(
|
|
14258
14261
|
StyledValue,
|
|
14259
14262
|
{
|
|
14260
|
-
|
|
14263
|
+
"data-wui-data-card-skeleton": isLoading,
|
|
14264
|
+
renderAs: "span",
|
|
14261
14265
|
variant: "heading3",
|
|
14262
|
-
children:
|
|
14266
|
+
children: value
|
|
14263
14267
|
}
|
|
14264
14268
|
),
|
|
14265
14269
|
(0, import_type_guards44.isNotNil)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
@@ -14310,9 +14314,16 @@ var import_styled_components78 = require("styled-components");
|
|
|
14310
14314
|
var import_jsx_runtime279 = require("react/jsx-runtime");
|
|
14311
14315
|
var StyledDataCards = (0, import_styled_components78.styled)(Box)`
|
|
14312
14316
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
14317
|
+
--wui-data-cards-column-count: ${({ $columns }) => $columns === "auto" ? void 0 : $columns};
|
|
14318
|
+
--wui-data-cards-total-column-gap-width: calc(var(--wui-data-cards-column-count) - 1) *
|
|
14319
|
+
var(--wui-space-02);
|
|
14320
|
+
--wui-data-cards-column-width: calc(
|
|
14321
|
+
(100% - var(--wui-data-cards-total-column-gap-width)) / var(--wui-data-cards-column-count)
|
|
14322
|
+
);
|
|
14313
14323
|
|
|
14314
14324
|
> * {
|
|
14315
14325
|
min-width: 120px;
|
|
14326
|
+
flex-basis: var(--wui-data-cards-column-width, 0);
|
|
14316
14327
|
max-width: ${({ $cardMaxWidth }) => $cardMaxWidth};
|
|
14317
14328
|
}
|
|
14318
14329
|
`;
|
|
@@ -14320,19 +14331,22 @@ var DataCards = ({
|
|
|
14320
14331
|
children,
|
|
14321
14332
|
cardMaxWidth = "none",
|
|
14322
14333
|
colorScheme = "inherit",
|
|
14334
|
+
columns = "auto",
|
|
14323
14335
|
...props
|
|
14324
14336
|
}) => {
|
|
14337
|
+
const responsiveCardMaxWidth = useResponsiveProp(cardMaxWidth);
|
|
14338
|
+
const responsiveColumns = useResponsiveProp(columns);
|
|
14325
14339
|
return /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
|
|
14326
14340
|
StyledDataCards,
|
|
14327
14341
|
{
|
|
14328
14342
|
...props,
|
|
14329
|
-
$cardMaxWidth:
|
|
14343
|
+
$cardMaxWidth: responsiveCardMaxWidth,
|
|
14330
14344
|
$colorScheme: colorScheme,
|
|
14345
|
+
$columns: responsiveColumns,
|
|
14331
14346
|
alignItems: "stretch",
|
|
14332
14347
|
direction: "row",
|
|
14333
14348
|
fill: "horizontal",
|
|
14334
14349
|
gap: "space-02",
|
|
14335
|
-
renderAs: "dl",
|
|
14336
14350
|
wrapItems: true,
|
|
14337
14351
|
children
|
|
14338
14352
|
}
|