@wistia/ui 0.18.17 → 0.18.18

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.18.17
3
+ * @license @wistia/ui v0.18.18
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -13958,12 +13958,22 @@ import { useRef as useRef15 } from "react";
13958
13958
  import { styled as styled58, keyframes as keyframes4 } from "styled-components";
13959
13959
  import { isNotNil as isNotNil25 } from "@wistia/type-guards";
13960
13960
  import { jsx as jsx278, jsxs as jsxs41 } from "react/jsx-runtime";
13961
+ var pulse = keyframes4`
13962
+ 0%,
13963
+ 100% {
13964
+ opacity: 1;
13965
+ }
13966
+ 50% {
13967
+ opacity: 0.5;
13968
+ }
13969
+ `;
13961
13970
  var StyledDataCard = styled58.div`
13962
13971
  --wui-data-card-text: var(--wui-color-text-button);
13963
13972
  --wui-color-text: var(--wui-data-card-text);
13964
13973
  --wui-data-card-background: var(--wui-color-bg-surface-secondary);
13965
13974
  --wui-data-card-background-hover: var(--wui-color-bg-surface-secondary-hover);
13966
13975
  --wui-data-card-background-active: var(--wui-color-bg-surface-secondary-active);
13976
+ --wui-data-card-skeleton-color: var(--wui-color-bg-surface-tertiary);
13967
13977
 
13968
13978
  display: grid;
13969
13979
  grid-template-areas: 'label slot' 'value value';
@@ -13991,6 +14001,16 @@ var StyledDataCard = styled58.div`
13991
14001
  grid-template-rows: auto auto auto;
13992
14002
  }
13993
14003
 
14004
+ [data-wui-data-card-skeleton='true'] {
14005
+ pointer-events: none;
14006
+ background-color: var(--wui-data-card-skeleton-color);
14007
+ animation: ${pulse} 1.5s var(--wui-motion-ease-in-out) 0.5s infinite;
14008
+ color: transparent;
14009
+ user-select: none;
14010
+ border-radius: var(--wui-border-radius-01);
14011
+ width: fit-content;
14012
+ }
14013
+
13994
14014
  &[data-click-region] {
13995
14015
  &:not([disabled]) {
13996
14016
  cursor: pointer;
@@ -14022,6 +14042,7 @@ var StyledDataCard = styled58.div`
14022
14042
  --wui-data-card-background-hover: var(--wui-color-bg-surface-selected-hover);
14023
14043
  --wui-data-card-background-active: var(--wui-color-bg-surface-selected-active);
14024
14044
  --wui-data-card-focus-ring: var(--wui-color-border-selected);
14045
+ --wui-data-card-skeleton-color: var(--wui-color-bg-surface-selected-active);
14025
14046
  }
14026
14047
  }
14027
14048
 
@@ -14032,38 +14053,19 @@ var StyledDataCard = styled58.div`
14032
14053
  ${({ $colorScheme }) => getColorScheme($colorScheme)}
14033
14054
  }
14034
14055
  `;
14035
- var shimmer = keyframes4`
14036
- 0% {
14037
- background-position: 200% 0;
14038
- }
14039
- 100% {
14040
- background-position: -200% 0;
14041
- }
14042
- `;
14043
- var LoadingBackground = styled58.div`
14044
- background: linear-gradient(
14045
- 90deg,
14046
- var(--wui-color-bg-surface-tertiary) 25%,
14047
- var(--wui-color-bg-surface-secondary) 37%,
14048
- var(--wui-color-bg-surface-tertiary) 63%
14049
- );
14050
- background-size: 200% 100%;
14051
- animation: ${shimmer} 1.5s infinite;
14052
- border-radius: var(--wui-border-radius-01);
14053
- `;
14054
- var StyledLoadingLabel = styled58(LoadingBackground)`
14055
- width: 80px;
14056
- height: var(--wui-typography-heading-6-line-height);
14057
- `;
14058
- var StyledLoadingValue = styled58(LoadingBackground)`
14059
- width: 90%;
14060
- height: var(--wui-typography-heading-3-line-height);
14061
- `;
14062
14056
  var StyledLabel3 = styled58(Heading)`
14063
14057
  grid-area: label;
14058
+
14059
+ &[data-wui-data-card-skeleton='true'] {
14060
+ width: 80px;
14061
+ }
14064
14062
  `;
14065
14063
  var StyledValue = styled58(Heading)`
14066
14064
  grid-area: value;
14065
+
14066
+ &[data-wui-data-card-skeleton='true'] {
14067
+ width: min(90%, 156px);
14068
+ }
14067
14069
  `;
14068
14070
  var StyledSlot = styled58.div`
14069
14071
  display: flex;
@@ -14097,17 +14099,19 @@ var DataCardInner = ({
14097
14099
  /* @__PURE__ */ jsx278(
14098
14100
  StyledLabel3,
14099
14101
  {
14102
+ "data-wui-data-card-skeleton": isLoading,
14100
14103
  renderAs: "dt",
14101
14104
  variant: "heading6",
14102
- children: isLoading ? /* @__PURE__ */ jsx278(StyledLoadingLabel, {}) : label
14105
+ children: label
14103
14106
  }
14104
14107
  ),
14105
14108
  /* @__PURE__ */ jsx278(
14106
14109
  StyledValue,
14107
14110
  {
14111
+ "data-wui-data-card-skeleton": isLoading,
14108
14112
  renderAs: "dd",
14109
14113
  variant: "heading3",
14110
- children: isLoading ? /* @__PURE__ */ jsx278(StyledLoadingValue, {}) : value
14114
+ children: value
14111
14115
  }
14112
14116
  ),
14113
14117
  isNotNil25(upperRightSlot) && !isLoading && /* @__PURE__ */ jsx278(StyledSlot, { children: upperRightSlot }),