@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.
@@ -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, _originalStyles;
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 { style } = document.documentElement;
86
+ const registry = GlobalStylesRegistry.instance;
87
+ const key = `gds-spinner-fullscreen-${this.id || "default"}`;
86
88
  if (this.fullscreen) {
87
- __privateSet(this, _originalStyles, {
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
- style.overflow = __privateGet(this, _originalStyles).overflow;
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([