@sebgroup/green-core 2.26.1 → 2.26.2

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,8 +8,8 @@ import { GdsElement } from '../../gds-element';
8
8
  * auto-dismiss timer, and action button support.
9
9
  *
10
10
  * @slot - Alert message content
11
- * @fires gds-close - Fired when alert is dismissed
12
- * @fires gds-action - Fired when action button is clicked
11
+ * @event gds-close - Fired when alert is dismissed
12
+ * @event gds-action - Fired when action button is clicked
13
13
  */
14
14
  export declare class GdsAlert extends GdsElement {
15
15
  #private;
@@ -1,7 +1,6 @@
1
1
  import { Placement } from '@floating-ui/dom';
2
2
  import { GdsElement } from '../../gds-element';
3
- import { GdsMenuItem } from '../../primitives/menu/menu-item.component';
4
- export { GdsMenuItem };
3
+ export { GdsMenuItem } from '../../primitives/menu/menu-item.component';
5
4
  export { GdsMenuHeading } from '../../primitives/menu/menu-heading.component';
6
5
  declare const GdsContextMenu_base: (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").MarginProps) & (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").LayoutChildProps) & typeof GdsElement;
7
6
  /**
@@ -29,6 +29,7 @@ import {
29
29
  applyTriggerAriaAttributes,
30
30
  GdsPopover
31
31
  } from "../popover/popover.component.js";
32
+ import { GdsMenuItem as GdsMenuItem2 } from "../../primitives/menu/menu-item.component.js";
32
33
  import { GdsMenuHeading } from "../../primitives/menu/menu-heading.component.js";
33
34
  let GdsContextMenu = class extends withMarginProps(
34
35
  withLayoutChildProps(GdsElement)
@@ -179,5 +180,5 @@ GdsContextMenu = __decorateClass([
179
180
  export {
180
181
  GdsContextMenu,
181
182
  GdsMenuHeading,
182
- GdsMenuItem
183
+ GdsMenuItem2 as GdsMenuItem
183
184
  };
@@ -6,7 +6,7 @@ export { GdsFilterChip };
6
6
  *
7
7
  * @slot - The filter chips to display
8
8
  *
9
- * @fires change - When a chip is clicked
9
+ * @event change - When a chip is clicked
10
10
  */
11
11
  export declare class GdsFilterChips<ValueT = any> extends GdsFormControlElement<ValueT | ValueT[]> {
12
12
  #private;
@@ -16,7 +16,7 @@ export declare function applyTriggerAriaAttributes(trigger: HTMLElement, open: b
16
16
  * register a keydown listener on the trigger and listen to `ArrowDown` key presses. When the trigger is focused and
17
17
  * `ArrowDown` is pressed, the popover will open and focus the first slotted child.
18
18
  *
19
- * @fires gds-ui-state - Fired when the popover is opened or closed. Can be cancelled to prevent the popover from opening or closing. The `detail` object contains the `open` boolean to indicate the result of the state change, and the `reason` string which can be one of `show`, `close`, or `cancel`.
19
+ * @event gds-ui-state - Fired when the popover is opened or closed. Can be cancelled to prevent the popover from opening or closing. The `detail` object contains the `open` boolean to indicate the result of the state change, and the `reason` string which can be one of `show`, `close`, or `cancel`.
20
20
  *
21
21
  * @slot - Content of the popover
22
22
  * @slot trigger - Trigger element for the popover. If this slot is occupied, the popover will listen to keydown and click events on the trigger and automtaiclly open when clicked or when the trigger is focused and `ArrowDown` is pressed.
@@ -75,8 +75,8 @@ declare const GdsSelect_base: (new (...args: any[]) => import("../../utils/mixin
75
75
  * element, and not on the enclosed select element. Also, state should also be handled only through the host.
76
76
  * Setting value or selected props on the select element will not work as expected.
77
77
  *
78
- * @fires {CustomEvent} change - Fired when the selection changes with detail: { value: string }
79
- * @fires {CustomEvent} input - Fired on input with detail: { value: string }
78
+ * @event {CustomEvent} change - Fired when the selection changes with detail: { value: string }
79
+ * @event {CustomEvent} input - Fired on input with detail: { value: string }
80
80
  *
81
81
  * @slot - Default slot for the native select element
82
82
  * @slot lead - Slot for leading content (e.g., icons)
@@ -8,37 +8,7 @@ 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
- * @fires gds-spinner-connected - When the spinner is connected and visible
11
+ * @event gds-spinner-connected - When the spinner is connected and visible
42
12
  */
43
13
  export declare class GdsSpinner extends GdsSpinner_base {
44
14
  #private;
@@ -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([