@momentum-design/components 0.135.2 → 0.136.0
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/browser/index.js +230 -201
- package/dist/browser/index.js.map +2 -2
- package/dist/components/skeleton/skeleton.component.d.ts +5 -0
- package/dist/components/skeleton/skeleton.component.js +9 -0
- package/dist/components/skeleton/skeleton.constants.d.ts +1 -0
- package/dist/components/skeleton/skeleton.constants.js +1 -0
- package/dist/components/skeleton/skeleton.styles.js +29 -0
- package/dist/custom-elements.json +20 -0
- package/package.json +1 -1
|
@@ -24,6 +24,11 @@ import type { SkeletonVariant } from './skeleton.types';
|
|
|
24
24
|
* @cssproperty --mdc-skeleton-width - width of the skeleton
|
|
25
25
|
*/
|
|
26
26
|
declare class Skeleton extends Component {
|
|
27
|
+
/**
|
|
28
|
+
* When true, displays the skeleton with motion applied.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
motion?: boolean;
|
|
27
32
|
/**
|
|
28
33
|
* The variant of skeleton to display
|
|
29
34
|
* - **rectangular**: Default rectangular shape with 0.25rem border radius
|
|
@@ -24,6 +24,11 @@ import styles from './skeleton.styles';
|
|
|
24
24
|
class Skeleton extends Component {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
|
+
/**
|
|
28
|
+
* When true, displays the skeleton with motion applied.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
this.motion = DEFAULTS.MOTION;
|
|
27
32
|
/**
|
|
28
33
|
* The variant of skeleton to display
|
|
29
34
|
* - **rectangular**: Default rectangular shape with 0.25rem border radius
|
|
@@ -63,6 +68,10 @@ class Skeleton extends Component {
|
|
|
63
68
|
* Styles associated with this component.
|
|
64
69
|
*/
|
|
65
70
|
Skeleton.styles = [...Component.styles, styles];
|
|
71
|
+
__decorate([
|
|
72
|
+
property({ type: Boolean, reflect: true }),
|
|
73
|
+
__metadata("design:type", Boolean)
|
|
74
|
+
], Skeleton.prototype, "motion", void 0);
|
|
66
75
|
__decorate([
|
|
67
76
|
property({ type: String, reflect: true }),
|
|
68
77
|
__metadata("design:type", String)
|
|
@@ -11,6 +11,35 @@ const styles = css `
|
|
|
11
11
|
width: var(--mdc-skeleton-width);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
:host([motion]) {
|
|
15
|
+
background-image: linear-gradient(
|
|
16
|
+
90deg,
|
|
17
|
+
var(--mds-color-theme-background-skeleton-shimmer-0) 0%,
|
|
18
|
+
var(--mds-color-theme-background-skeleton-shimmer-1) 50%,
|
|
19
|
+
var(--mds-color-theme-background-skeleton-shimmer-2) 100%
|
|
20
|
+
);
|
|
21
|
+
background-repeat: no-repeat;
|
|
22
|
+
background-size: 200% 100%;
|
|
23
|
+
animation: skeleton-shimmer 2s linear infinite;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (prefers-reduced-motion: reduce) {
|
|
27
|
+
:host([motion]) {
|
|
28
|
+
animation: none;
|
|
29
|
+
background-position: 50% 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes skeleton-shimmer {
|
|
34
|
+
0% {
|
|
35
|
+
background-position: 200% 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
100% {
|
|
39
|
+
background-position: -200% 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
14
43
|
:host([variant='rectangular']) {
|
|
15
44
|
border-radius: 0.25rem;
|
|
16
45
|
}
|
|
@@ -44195,6 +44195,17 @@
|
|
|
44195
44195
|
}
|
|
44196
44196
|
}
|
|
44197
44197
|
},
|
|
44198
|
+
{
|
|
44199
|
+
"kind": "field",
|
|
44200
|
+
"name": "motion",
|
|
44201
|
+
"type": {
|
|
44202
|
+
"text": "boolean | undefined"
|
|
44203
|
+
},
|
|
44204
|
+
"description": "When true, displays the skeleton with motion applied.",
|
|
44205
|
+
"default": "false",
|
|
44206
|
+
"attribute": "motion",
|
|
44207
|
+
"reflects": true
|
|
44208
|
+
},
|
|
44198
44209
|
{
|
|
44199
44210
|
"kind": "field",
|
|
44200
44211
|
"name": "variant",
|
|
@@ -44208,6 +44219,15 @@
|
|
|
44208
44219
|
}
|
|
44209
44220
|
],
|
|
44210
44221
|
"attributes": [
|
|
44222
|
+
{
|
|
44223
|
+
"name": "motion",
|
|
44224
|
+
"type": {
|
|
44225
|
+
"text": "boolean | undefined"
|
|
44226
|
+
},
|
|
44227
|
+
"description": "When true, displays the skeleton with motion applied.",
|
|
44228
|
+
"default": "false",
|
|
44229
|
+
"fieldName": "motion"
|
|
44230
|
+
},
|
|
44211
44231
|
{
|
|
44212
44232
|
"name": "variant",
|
|
44213
44233
|
"type": {
|