@sebgroup/green-core 2.26.1 → 2.26.2-rc.20260123102949574
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 +0 -33
- package/components/spinner/spinner.component.js +18 -23
- package/custom-elements.json +3573 -3559
- package/gds-element.js +1 -1
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/input/guidelines.md +8 -0
- package/generated/react/index.d.ts +4 -4
- package/generated/react/index.js +4 -4
- package/package.json +1 -1
- package/utils/global-styles.d.ts +6 -0
- package/utils/global-styles.js +27 -2
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -8,36 +8,6 @@ declare const GdsSpinner_base: (new (...args: any[]) => import("../../utils/mixi
|
|
|
8
8
|
*
|
|
9
9
|
* A loading indicator with accessibility support and various display modes.
|
|
10
10
|
*
|
|
11
|
-
* @example Basic usage
|
|
12
|
-
* ```html
|
|
13
|
-
* <gds-spinner></gds-spinner>
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @example With label
|
|
17
|
-
* ```html
|
|
18
|
-
* <gds-spinner label="Loading..." showLabel></gds-spinner>
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @example Different sizes
|
|
22
|
-
* ```html
|
|
23
|
-
* <gds-spinner size="sm"></gds-spinner>
|
|
24
|
-
* <gds-spinner size="md"></gds-spinner>
|
|
25
|
-
* <gds-spinner size="lg"></gds-spinner>
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @example Cover container
|
|
29
|
-
* ```html
|
|
30
|
-
* <div style="position: relative;">
|
|
31
|
-
* <!-- Container content -->
|
|
32
|
-
* <gds-spinner cover></gds-spinner>
|
|
33
|
-
* </div>
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @example Fullscreen
|
|
37
|
-
* ```html
|
|
38
|
-
* <gds-spinner fullscreen label="Loading application..." showLabel></gds-spinner>
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
11
|
* @fires gds-spinner-connected - When the spinner is connected and visible
|
|
42
12
|
*/
|
|
43
13
|
export declare class GdsSpinner extends GdsSpinner_base {
|
|
@@ -69,7 +39,6 @@ export declare class GdsSpinner extends GdsSpinner_base {
|
|
|
69
39
|
size: 'sm' | 'md' | 'lg';
|
|
70
40
|
/**
|
|
71
41
|
* Whether the spinner is currently animating
|
|
72
|
-
* @private
|
|
73
42
|
*/
|
|
74
43
|
private _isAnimating;
|
|
75
44
|
/**
|
|
@@ -82,7 +51,6 @@ export declare class GdsSpinner extends GdsSpinner_base {
|
|
|
82
51
|
disconnectedCallback(): void;
|
|
83
52
|
/**
|
|
84
53
|
* Updates the aria-label attribute based on the label property
|
|
85
|
-
* @private
|
|
86
54
|
*/
|
|
87
55
|
private _updateAriaLabel;
|
|
88
56
|
/**
|
|
@@ -92,7 +60,6 @@ export declare class GdsSpinner extends GdsSpinner_base {
|
|
|
92
60
|
/**
|
|
93
61
|
* Toggles document root styles when in fullscreen mode
|
|
94
62
|
* Prevents scrolling of the document when fullscreen overlay is active
|
|
95
|
-
* @private
|
|
96
63
|
*/
|
|
97
64
|
private _toggleRootStyles;
|
|
98
65
|
}
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
__decorateClass,
|
|
3
3
|
__privateAdd,
|
|
4
4
|
__privateGet,
|
|
5
|
-
__privateMethod
|
|
6
|
-
__privateSet
|
|
5
|
+
__privateMethod
|
|
7
6
|
} from "../../chunks/chunk.QU3DSPNU.js";
|
|
8
|
-
var _GdsSpinner_instances, getWrapperClasses_fn
|
|
7
|
+
var _fullscreenStyles, _GdsSpinner_instances, getWrapperClasses_fn;
|
|
9
8
|
import { localized, msg } from "@lit/localize";
|
|
9
|
+
import { css } from "lit";
|
|
10
10
|
import { property, state } from "lit/decorators.js";
|
|
11
11
|
import { classMap } from "lit/directives/class-map.js";
|
|
12
12
|
import { when } from "lit/directives/when.js";
|
|
@@ -14,6 +14,7 @@ import { GdsElement } from "../../gds-element.js";
|
|
|
14
14
|
import { gdsCustomElement, html } from "../../scoping.js";
|
|
15
15
|
import { tokens } from "../../tokens.style.js";
|
|
16
16
|
import { watch } from "../../utils/decorators/watch.js";
|
|
17
|
+
import { GlobalStylesRegistry } from "../../utils/global-styles.js";
|
|
17
18
|
import {
|
|
18
19
|
withLayoutChildProps,
|
|
19
20
|
withMarginProps,
|
|
@@ -26,6 +27,15 @@ let GdsSpinner = class extends withMarginProps(
|
|
|
26
27
|
constructor() {
|
|
27
28
|
super(...arguments);
|
|
28
29
|
__privateAdd(this, _GdsSpinner_instances);
|
|
30
|
+
/**
|
|
31
|
+
* Global styles for fullscreen mode
|
|
32
|
+
*/
|
|
33
|
+
__privateAdd(this, _fullscreenStyles, css`
|
|
34
|
+
html {
|
|
35
|
+
overflow: hidden !important;
|
|
36
|
+
overscroll-behavior: none !important;
|
|
37
|
+
}
|
|
38
|
+
`);
|
|
29
39
|
this.label = msg("Loading...");
|
|
30
40
|
this.labelPosition = "bottom";
|
|
31
41
|
this.showLabel = false;
|
|
@@ -33,14 +43,6 @@ let GdsSpinner = class extends withMarginProps(
|
|
|
33
43
|
this.fullscreen = false;
|
|
34
44
|
this.size = "md";
|
|
35
45
|
this._isAnimating = false;
|
|
36
|
-
/**
|
|
37
|
-
* Stores original document styles before applying fullscreen mode
|
|
38
|
-
* @private
|
|
39
|
-
*/
|
|
40
|
-
__privateAdd(this, _originalStyles, {
|
|
41
|
-
overflow: "visible",
|
|
42
|
-
overscrollBehavior: "auto"
|
|
43
|
-
});
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Sets up accessibility attributes and initializes the spinner
|
|
@@ -62,7 +64,6 @@ let GdsSpinner = class extends withMarginProps(
|
|
|
62
64
|
this._toggleRootStyles();
|
|
63
65
|
}
|
|
64
66
|
this._isAnimating = false;
|
|
65
|
-
super.disconnectedCallback();
|
|
66
67
|
}
|
|
67
68
|
_updateAriaLabel() {
|
|
68
69
|
this.setAttribute("aria-label", this.label);
|
|
@@ -82,24 +83,19 @@ let GdsSpinner = class extends withMarginProps(
|
|
|
82
83
|
`;
|
|
83
84
|
}
|
|
84
85
|
_toggleRootStyles() {
|
|
85
|
-
const
|
|
86
|
+
const registry = GlobalStylesRegistry.instance;
|
|
87
|
+
const key = `gds-spinner-fullscreen-${this.id || "default"}`;
|
|
86
88
|
if (this.fullscreen) {
|
|
87
|
-
|
|
88
|
-
overflow: style.overflow,
|
|
89
|
-
overscrollBehavior: style.overscrollBehavior
|
|
90
|
-
});
|
|
91
|
-
style.overflow = "hidden";
|
|
92
|
-
style.overscrollBehavior = "none";
|
|
89
|
+
registry.injectGlobalStyles(key, __privateGet(this, _fullscreenStyles));
|
|
93
90
|
} else {
|
|
94
|
-
|
|
95
|
-
style.overscrollBehavior = __privateGet(this, _originalStyles).overscrollBehavior;
|
|
91
|
+
registry.clearGlobalStyles(key);
|
|
96
92
|
}
|
|
97
93
|
}
|
|
98
94
|
};
|
|
95
|
+
_fullscreenStyles = new WeakMap();
|
|
99
96
|
_GdsSpinner_instances = new WeakSet();
|
|
100
97
|
/**
|
|
101
98
|
* Generates CSS classes for the wrapper element based on component state
|
|
102
|
-
* @private
|
|
103
99
|
*/
|
|
104
100
|
getWrapperClasses_fn = function() {
|
|
105
101
|
return {
|
|
@@ -111,7 +107,6 @@ getWrapperClasses_fn = function() {
|
|
|
111
107
|
[`spinner-label-${this.labelPosition}`]: this.labelPosition
|
|
112
108
|
};
|
|
113
109
|
};
|
|
114
|
-
_originalStyles = new WeakMap();
|
|
115
110
|
/** All styles are defined in the external styles file */
|
|
116
111
|
GdsSpinner.styles = [tokens, styles];
|
|
117
112
|
__decorateClass([
|