@momentum-design/components 0.135.2 → 0.136.1
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 +231 -202
- 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/components/toast/toast.component.d.ts +1 -1
- package/dist/components/toast/toast.component.js +7 -5
- 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
|
}
|
|
@@ -111,7 +111,7 @@ declare class Toast extends Toast_base {
|
|
|
111
111
|
private updateDetailedSlotPresence;
|
|
112
112
|
private updateFooterButtonsPresence;
|
|
113
113
|
protected firstUpdated(changedProperties: PropertyValues): Promise<void>;
|
|
114
|
-
protected updated(changedProperties: PropertyValues): void
|
|
114
|
+
protected updated(changedProperties: PropertyValues): Promise<void>;
|
|
115
115
|
protected renderIcon(iconName: string): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
116
116
|
private canRenderToggleButton;
|
|
117
117
|
private shouldRenderToggleButton;
|
|
@@ -122,15 +122,17 @@ class Toast extends FooterMixin(Component) {
|
|
|
122
122
|
super.firstUpdated(changedProperties);
|
|
123
123
|
this.updateDetailedSlotPresence();
|
|
124
124
|
this.updateDataExpanded();
|
|
125
|
-
await this.updateComplete;
|
|
126
|
-
if (hasOverflowMixin(this.headerTextElement)) {
|
|
127
|
-
this.hasOverflowingHeaderText = this.headerTextElement.isHeightOverflowing();
|
|
128
|
-
}
|
|
129
125
|
}
|
|
130
|
-
updated(changedProperties) {
|
|
126
|
+
async updated(changedProperties) {
|
|
131
127
|
if (changedProperties.has('showMoreText') || changedProperties.has('showLessText')) {
|
|
132
128
|
this.updateDataExpanded();
|
|
133
129
|
}
|
|
130
|
+
if (changedProperties.has('headerText')) {
|
|
131
|
+
await this.updateComplete;
|
|
132
|
+
if (hasOverflowMixin(this.headerTextElement)) {
|
|
133
|
+
this.hasOverflowingHeaderText = this.headerTextElement.isHeightOverflowing();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
134
136
|
}
|
|
135
137
|
renderIcon(iconName) {
|
|
136
138
|
if (!iconName)
|
|
@@ -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": {
|