@sebgroup/green-core 1.87.0 → 1.88.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/components/spinner/spinner.component.d.ts +1 -0
- package/components/spinner/spinner.component.js +8 -4
- package/components/spinner/spinner.styles.js +23 -0
- package/generated/react/index.d.ts +2 -2
- package/generated/react/index.js +2 -2
- package/generated/react/spinner/index.d.ts +1 -0
- package/package.json +1 -1
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -48,6 +48,7 @@ export declare class GdsSpinner extends GdsSpinner_base {
|
|
|
48
48
|
* The text to display as a label for the spinner
|
|
49
49
|
*/
|
|
50
50
|
label: string;
|
|
51
|
+
labelPosition: 'top' | 'bottom' | 'left' | 'right';
|
|
51
52
|
/**
|
|
52
53
|
* Whether to display the label text visually
|
|
53
54
|
* If false, the label is still available for screen readers
|
|
@@ -31,6 +31,7 @@ let GdsSpinner = class extends withMarginProps(
|
|
|
31
31
|
*/
|
|
32
32
|
__privateAdd(this, _getWrapperClasses);
|
|
33
33
|
this.label = msg("Loading...");
|
|
34
|
+
this.labelPosition = "bottom";
|
|
34
35
|
this.showLabel = false;
|
|
35
36
|
this.cover = false;
|
|
36
37
|
this.fullscreen = false;
|
|
@@ -78,9 +79,8 @@ let GdsSpinner = class extends withMarginProps(
|
|
|
78
79
|
<div part="wrapper" class=${classMap(__privateMethod(this, _getWrapperClasses, getWrapperClasses_fn).call(this))}>
|
|
79
80
|
<span part="spinner" class="spinner"></span>
|
|
80
81
|
${when(
|
|
81
|
-
this.
|
|
82
|
-
() => html`<span part="label" class="spinner-label">${this.label}</span
|
|
83
|
-
() => null
|
|
82
|
+
this.showLabel,
|
|
83
|
+
() => html`<span part="label" class="spinner-label">${this.label}</span>`
|
|
84
84
|
)}
|
|
85
85
|
</div>
|
|
86
86
|
`;
|
|
@@ -107,7 +107,8 @@ getWrapperClasses_fn = function() {
|
|
|
107
107
|
"spinner-fullscreen": this.fullscreen,
|
|
108
108
|
"spinner-cover": this.cover,
|
|
109
109
|
"spinner-backdrop": this.cover || this.fullscreen,
|
|
110
|
-
"spinner-animating": this._isAnimating
|
|
110
|
+
"spinner-animating": this._isAnimating,
|
|
111
|
+
[`spinner-label-${this.labelPosition}`]: this.labelPosition
|
|
111
112
|
};
|
|
112
113
|
};
|
|
113
114
|
_originalStyles = new WeakMap();
|
|
@@ -116,6 +117,9 @@ GdsSpinner.styles = [tokens, styles];
|
|
|
116
117
|
__decorateClass([
|
|
117
118
|
property({ type: String })
|
|
118
119
|
], GdsSpinner.prototype, "label", 2);
|
|
120
|
+
__decorateClass([
|
|
121
|
+
property({ type: String, reflect: true, attribute: "label-position" })
|
|
122
|
+
], GdsSpinner.prototype, "labelPosition", 2);
|
|
119
123
|
__decorateClass([
|
|
120
124
|
property({ type: Boolean, reflect: true })
|
|
121
125
|
], GdsSpinner.prototype, "showLabel", 2);
|
|
@@ -73,6 +73,7 @@ const styles = css`
|
|
|
73
73
|
height: var(--size, 3.75rem);
|
|
74
74
|
width: var(--size, 3.75rem);
|
|
75
75
|
animation: gdsSpinnerRotation 1s linear infinite;
|
|
76
|
+
aspect-ratio: 1 / 1;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
/* Motion preference adjustments */
|
|
@@ -116,6 +117,28 @@ const styles = css`
|
|
|
116
117
|
backdrop-filter: blur(var(--spinner-backdrop-blur));
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
.spinner-wrapper.spinner-label-top {
|
|
121
|
+
flex-direction: column-reverse;
|
|
122
|
+
|
|
123
|
+
& .spinner-label {
|
|
124
|
+
margin: 0 0 1rem;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.spinner-wrapper.spinner-label-left {
|
|
129
|
+
flex-direction: row-reverse;
|
|
130
|
+
& .spinner-label {
|
|
131
|
+
margin: 0 1rem 0 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.spinner-wrapper.spinner-label-right {
|
|
136
|
+
flex-direction: row;
|
|
137
|
+
& .spinner-label {
|
|
138
|
+
margin: 0 0 0 1rem;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
119
142
|
/* Label styling */
|
|
120
143
|
.spinner-label {
|
|
121
144
|
margin-top: 1rem;
|
|
@@ -10,10 +10,10 @@ export * from './coachmark/index.js';
|
|
|
10
10
|
export * from './container/index.js';
|
|
11
11
|
export * from './context-menu/index.js';
|
|
12
12
|
export * from './datepicker/index.js';
|
|
13
|
+
export * from './details/index.js';
|
|
13
14
|
export * from './dialog/index.js';
|
|
14
15
|
export * from './div/index.js';
|
|
15
16
|
export * from './divider/index.js';
|
|
16
|
-
export * from './details/index.js';
|
|
17
17
|
export * from './dropdown/index.js';
|
|
18
18
|
export * from './fab/index.js';
|
|
19
19
|
export * from './filter-chips/index.js';
|
|
@@ -55,6 +55,7 @@ export * from './radio-group/index.js';
|
|
|
55
55
|
export * from './segment/index.js';
|
|
56
56
|
export * from './sensitive-account/index.js';
|
|
57
57
|
export * from './sensitive-date/index.js';
|
|
58
|
+
export * from './sensitive-number/index.js';
|
|
58
59
|
export * from './icons/icon-ai/index.js';
|
|
59
60
|
export * from './icons/icon-airplane-up/index.js';
|
|
60
61
|
export * from './icons/icon-archive/index.js';
|
|
@@ -345,4 +346,3 @@ export * from './icons/icon-youtube/index.js';
|
|
|
345
346
|
export * from './icons/icon-zap/index.js';
|
|
346
347
|
export * from './icons/icon-zoom-in/index.js';
|
|
347
348
|
export * from './icons/icon-zoom-out/index.js';
|
|
348
|
-
export * from './sensitive-number/index.js';
|
package/generated/react/index.js
CHANGED
|
@@ -10,10 +10,10 @@ export * from "./coachmark/index.js";
|
|
|
10
10
|
export * from "./container/index.js";
|
|
11
11
|
export * from "./context-menu/index.js";
|
|
12
12
|
export * from "./datepicker/index.js";
|
|
13
|
+
export * from "./details/index.js";
|
|
13
14
|
export * from "./dialog/index.js";
|
|
14
15
|
export * from "./div/index.js";
|
|
15
16
|
export * from "./divider/index.js";
|
|
16
|
-
export * from "./details/index.js";
|
|
17
17
|
export * from "./dropdown/index.js";
|
|
18
18
|
export * from "./fab/index.js";
|
|
19
19
|
export * from "./filter-chips/index.js";
|
|
@@ -55,6 +55,7 @@ export * from "./radio-group/index.js";
|
|
|
55
55
|
export * from "./segment/index.js";
|
|
56
56
|
export * from "./sensitive-account/index.js";
|
|
57
57
|
export * from "./sensitive-date/index.js";
|
|
58
|
+
export * from "./sensitive-number/index.js";
|
|
58
59
|
export * from "./icons/icon-ai/index.js";
|
|
59
60
|
export * from "./icons/icon-airplane-up/index.js";
|
|
60
61
|
export * from "./icons/icon-archive/index.js";
|
|
@@ -345,4 +346,3 @@ export * from "./icons/icon-youtube/index.js";
|
|
|
345
346
|
export * from "./icons/icon-zap/index.js";
|
|
346
347
|
export * from "./icons/icon-zoom-in/index.js";
|
|
347
348
|
export * from "./icons/icon-zoom-out/index.js";
|
|
348
|
-
export * from "./sensitive-number/index.js";
|
|
@@ -2,6 +2,7 @@ import { getReactComponent } from "../../../utils/react";
|
|
|
2
2
|
import { GdsSpinner as GdsSpinnerClass } from "../../../components/spinner/spinner.component";
|
|
3
3
|
export declare const GdsSpinner: (props: React.ComponentProps<ReturnType<typeof getReactComponent<GdsSpinnerClass>>>) => import("react").ReactElement<Omit<{
|
|
4
4
|
label?: string | undefined;
|
|
5
|
+
labelPosition?: "top" | "right" | "bottom" | "left" | undefined;
|
|
5
6
|
showLabel?: boolean | undefined;
|
|
6
7
|
cover?: boolean | undefined;
|
|
7
8
|
fullscreen?: boolean | undefined;
|
package/package.json
CHANGED