@sebgroup/green-core 3.18.1 → 3.19.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/gds-element.js CHANGED
@@ -16,7 +16,7 @@ class GdsElement extends LitElement {
16
16
  /**
17
17
  * The semantic version of this element. Can be used for troubleshooting to verify the version being used.
18
18
  */
19
- this.semanticVersion = "3.18.1";
19
+ this.semanticVersion = "3.19.0";
20
20
  this.syncFirstRender = false;
21
21
  this._isUsingTransitionalStyles = false;
22
22
  this._dynamicStylesController = new DynamicStylesController(this);
@@ -24,3 +24,4 @@ Events are emitted using Angular output syntax. Event names are converted from k
24
24
  |---------------------|----------------|-----------------|
25
25
  | `gds-close` | `gdsClose` | `(gdsClose)="handler($event)"` |
26
26
  | `gds-action` | `gdsAction` | `(gdsAction)="handler($event)"` |
27
+ | `gds-ui-state` | `gdsUiState` | `(gdsUiState)="handler($event)"` |
@@ -7,14 +7,21 @@
7
7
 
8
8
  ## Properties
9
9
 
10
+ > Some properties accept design token names. Use `get_tokens` with the appropriate category to discover valid token names and their resolved values.
11
+
10
12
  | Name | Type | Default | Description |
11
13
  |------|------|---------|-------------|
12
14
  | `variant` | `'information' \| 'notice' \| 'positive' \| 'warning' \| 'negative'` | `-` | The variant of the alert, which determines its appearance and icon. |
13
15
  | `label` | `string` | `-` | The label for the alert, used for accessibility purposes. This needs be set to something relevant to the content of the alert. |
14
- | `role` | `'alert' \| 'status'` | `-` | The role of the alert, which can be 'alert' or 'status'. 'alert' is used for critical messages that require immediate attention, while 'status' is for informational messages. These corresponds to the ARIA roles, which you can read more about on MDN: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/alert_role https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/status_role |
16
+ | `alertRole` | `AlertRole \| undefined` | `-` | The role of the alert live region, which can be 'alert' or 'status'. 'alert' is used for critical messages that require immediate attention, while 'status' is for informational messages. These correspond to the ARIA roles, which you can read more about on MDN: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/alert_role https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/status_role |
17
+ | `role` | `AlertRole` | `-` | The role of the alert live region. |
18
+ | `closed` | `boolean` | `-` | Whether the alert is closed. For dynamic announcements, mount the alert before the message should be announced, keep it closed, and then set `closed` to `false`. |
15
19
  | `dismissible` | `boolean` | `-` | The dismissibility of the alert, which determines whether it can be closed by the user. |
16
20
  | `timeout` | `number` | `-` | The time in milliseconds after which the alert will automatically dismiss itself. Set to 0 to disable auto-dismiss. |
17
21
  | `buttonLabel` | `string` | `-` | The text for the action button, if provided. If not set, no action button will be rendered. |
22
+ | `margin` | `string \| undefined` | `-` | Style Expression Property that controls the `margin` property. Only accepts space tokens. |
23
+ | `'margin-inline'` | `string \| undefined` | `-` | Style Expression Property that controls the `margin-inline` property. Only accepts space tokens. |
24
+ | `'margin-block'` | `string \| undefined` | `-` | Style Expression Property that controls the `margin-block` property. Only accepts space tokens. |
18
25
  | `syncFirstRender` | `boolean` | `-` | Force the element to perform a synchronous first render and apply style expression properties in `connectedCallback`. This guarantees that the child DOM always remains projected in DOM, since the element will attach the shadowRoot and run the first render pass in the same event loop cycle, and that declarative layout will be applied once slotted DOM is projected. Note: This will cause the first render pass to be blocking. Use sparingly and only when necessary, such as when the element needs to be measured synchronously after being added to the DOM. |
19
26
 
20
27
 
@@ -24,6 +31,7 @@
24
31
  |------|------|-------------|
25
32
  | `gds-close` | `CustomEvent<any>` | Fired when alert is dismissed |
26
33
  | `gds-action` | `CustomEvent<any>` | Fired when action button is clicked |
34
+ | `gds-ui-state` | `CustomEvent<any>` | Fired when the alert is closed internally |
27
35
 
28
36
 
29
37
  ## Slots
@@ -24,3 +24,4 @@ Events are handled using React event handler props. Event names are converted fr
24
24
  |---------------------|--------------------|-----------------|
25
25
  | `gds-close` | `onGdsClose` | `onGdsClose={handler}` |
26
26
  | `gds-action` | `onGdsAction` | `onGdsAction={handler}` |
27
+ | `gds-ui-state` | `onGdsUiState` | `onGdsUiState={handler}` |
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-08-18T13:19:55.654Z",
2
+ "generatedAt": "2026-08-24T12:12:38.947Z",
3
3
  "components": [
4
4
  {
5
5
  "name": "gds-alert",
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-08-18T13:19:55.654Z",
2
+ "generatedAt": "2026-08-24T12:12:38.947Z",
3
3
  "icons": [
4
4
  {
5
5
  "name": "gds-icon-ai",
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-08-18T13:19:55.654Z",
2
+ "generatedAt": "2026-08-24T12:12:38.947Z",
3
3
  "instructions": "./INSTRUCTIONS.md",
4
4
  "components": "./components.json",
5
5
  "icons": "./icons.json",
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-08-18T13:19:55.588Z",
2
+ "generatedAt": "2026-08-24T12:12:38.866Z",
3
3
  "categories": {
4
4
  "space": {
5
5
  "description": "Spacing tokens for padding, margin, gap, and other spacing",
@@ -5,6 +5,8 @@ type GdsAlertProps = React.ComponentProps<ReturnType<typeof getReactComponent<Gd
5
5
  onGdsClose?: (event: CustomEvent<any>) => void;
6
6
  /** Fired when action button is clicked */
7
7
  onGdsAction?: (event: CustomEvent<any>) => void;
8
+ /** Fired when the alert is closed internally */
9
+ onGdsUiState?: (event: CustomEvent<any>) => void;
8
10
  };
9
11
  export declare const GdsAlert: {
10
12
  (props: GdsAlertProps & {
@@ -12,17 +14,22 @@ export declare const GdsAlert: {
12
14
  }): import("react").ReactElement<Omit<Omit<{
13
15
  variant?: "positive" | "negative" | "notice" | "warning" | "information" | undefined;
14
16
  label?: string;
15
- role?: "alert" | "status" | undefined;
17
+ alertRole?: ("alert" | "status") | undefined;
18
+ role?: ("alert" | "status") | undefined;
19
+ closed?: boolean;
16
20
  dismissible?: boolean;
17
21
  timeout?: number;
18
22
  buttonLabel?: string;
23
+ connectedCallback?: (() => void) | undefined;
19
24
  render?: (() => any) | undefined;
25
+ margin?: string | undefined;
26
+ 'margin-inline'?: string | undefined;
27
+ 'margin-block'?: string | undefined;
20
28
  readonly semanticVersion?: "__GDS_SEM_VER__";
21
29
  syncFirstRender?: boolean;
22
30
  gdsElementName?: string | undefined;
23
31
  _isUsingTransitionalStyles?: boolean;
24
32
  _dynamicStylesController?: import("../../../utils/controllers/dynamic-styles-controller").DynamicStylesController | undefined;
25
- connectedCallback?: (() => void) | undefined;
26
33
  disconnectedCallback?: (() => void) | undefined;
27
34
  dispatchStandardEvent?: ((name: string, options?: EventInit) => boolean) | undefined;
28
35
  dispatchCustomEvent?: (<T>(name: string, options?: CustomEventInit<T>) => boolean) | undefined;
@@ -1,9 +1,9 @@
1
1
  export * from './alert/index.js';
2
- export * from './badge/index.js';
3
2
  export * from './avatar/index.js';
3
+ export * from './badge/index.js';
4
+ export * from './blur/index.js';
4
5
  export * from './breadcrumbs/index.js';
5
6
  export * from './button/index.js';
6
- export * from './blur/index.js';
7
7
  export * from './calendar/index.js';
8
8
  export * from './card/index.js';
9
9
  export * from './card-linked/index.js';
@@ -26,8 +26,8 @@ export * from './img/index.js';
26
26
  export * from './input/index.js';
27
27
  export * from './link/index.js';
28
28
  export * from './list/index.js';
29
- export * from './menu-button/index.js';
30
29
  export * from './mask/index.js';
30
+ export * from './menu-button/index.js';
31
31
  export * from './pagination/index.js';
32
32
  export * from './backdrop/index.js';
33
33
  export * from './popover/index.js';
@@ -56,8 +56,8 @@ export * from './formatted-date/index.js';
56
56
  export * from './formatted-number/index.js';
57
57
  export * from './list-item/index.js';
58
58
  export * from './radio-group/index.js';
59
- export * from './sensitive-account/index.js';
60
59
  export * from './segment/index.js';
60
+ export * from './sensitive-account/index.js';
61
61
  export * from './sensitive-date/index.js';
62
62
  export * from './sensitive-number/index.js';
63
63
  export * from './tab/index.js';
@@ -1,9 +1,9 @@
1
1
  export * from "./alert/index.js";
2
- export * from "./badge/index.js";
3
2
  export * from "./avatar/index.js";
3
+ export * from "./badge/index.js";
4
+ export * from "./blur/index.js";
4
5
  export * from "./breadcrumbs/index.js";
5
6
  export * from "./button/index.js";
6
- export * from "./blur/index.js";
7
7
  export * from "./calendar/index.js";
8
8
  export * from "./card/index.js";
9
9
  export * from "./card-linked/index.js";
@@ -26,8 +26,8 @@ export * from "./img/index.js";
26
26
  export * from "./input/index.js";
27
27
  export * from "./link/index.js";
28
28
  export * from "./list/index.js";
29
- export * from "./menu-button/index.js";
30
29
  export * from "./mask/index.js";
30
+ export * from "./menu-button/index.js";
31
31
  export * from "./pagination/index.js";
32
32
  export * from "./backdrop/index.js";
33
33
  export * from "./popover/index.js";
@@ -56,8 +56,8 @@ export * from "./formatted-date/index.js";
56
56
  export * from "./formatted-number/index.js";
57
57
  export * from "./list-item/index.js";
58
58
  export * from "./radio-group/index.js";
59
- export * from "./sensitive-account/index.js";
60
59
  export * from "./segment/index.js";
60
+ export * from "./sensitive-account/index.js";
61
61
  export * from "./sensitive-date/index.js";
62
62
  export * from "./sensitive-number/index.js";
63
63
  export * from "./tab/index.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sebgroup/green-core",
3
3
  "description": "A carefully crafted set of Web Components, laying the foundation of the Green Design System.",
4
- "version": "3.18.1",
4
+ "version": "3.19.0",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
7
7
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  import "../../chunks/chunk.CAV4X6PU.js";
2
2
  import { html as litHtml } from "lit";
3
- const VER_SUFFIX = "-f3c23e";
3
+ const VER_SUFFIX = "-b891de";
4
4
  class ScopedElementRegistry {
5
5
  static get instance() {
6
6
  if (!globalThis.__gdsElementLookupTable?.[VER_SUFFIX])
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Based on https://github.com/shoelace-style/shoelace/blob/next/src/internal/scroll.ts
3
+ */
4
+ export declare function registerGlobalScrollLockStyles(): void;
5
+ /**
6
+ * Prevents body scrolling. Keeps track of which elements requested a lock so multiple levels of locking are possible
7
+ * without premature unlocking.
8
+ */
9
+ export declare function lockBodyScrolling(lockingEl: HTMLElement): void;
10
+ /**
11
+ * Unlocks body scrolling. Scrolling will only be unlocked once all elements that requested a lock call this method.
12
+ */
13
+ export declare function unlockBodyScrolling(lockingEl: HTMLElement): void;
@@ -0,0 +1,64 @@
1
+ import "../chunks/chunk.CAV4X6PU.js";
2
+ import { css } from "lit";
3
+ import { GlobalStylesRegistry } from "./global-styles.js";
4
+ const locks = /* @__PURE__ */ new Set();
5
+ function registerGlobalScrollLockStyles() {
6
+ GlobalStylesRegistry.instance.injectGlobalStyles(
7
+ "dialog-scroll-lock",
8
+ css`
9
+ .gds-scroll-lock body {
10
+ padding-right: var(--gds-scroll-lock-size) !important;
11
+ overflow: hidden !important;
12
+ }
13
+ `
14
+ );
15
+ }
16
+ function lockBodyScrolling(lockingEl) {
17
+ locks.add(lockingEl);
18
+ if (!document.documentElement.classList.contains("gds-scroll-lock")) {
19
+ const scrollbarWidth = getScrollbarWidth() + getExistingBodyPadding();
20
+ let scrollbarGutterProperty = getComputedStyle(
21
+ document.documentElement
22
+ ).scrollbarGutter;
23
+ if (!scrollbarGutterProperty || scrollbarGutterProperty === "auto") {
24
+ scrollbarGutterProperty = "stable";
25
+ }
26
+ if (scrollbarWidth < 2) {
27
+ scrollbarGutterProperty = "";
28
+ }
29
+ document.documentElement.style.setProperty(
30
+ "--gds-scroll-lock-gutter",
31
+ scrollbarGutterProperty
32
+ );
33
+ document.documentElement.classList.add("gds-scroll-lock");
34
+ document.documentElement.style.setProperty(
35
+ "--gds-scroll-lock-size",
36
+ `${scrollbarWidth}px`
37
+ );
38
+ }
39
+ }
40
+ function unlockBodyScrolling(lockingEl) {
41
+ locks.delete(lockingEl);
42
+ if (locks.size === 0) {
43
+ document.documentElement.classList.remove("gds-scroll-lock");
44
+ document.documentElement.style.removeProperty("--gds-scroll-lock-size");
45
+ }
46
+ }
47
+ function getScrollbarWidth() {
48
+ const documentWidth = document.documentElement.clientWidth;
49
+ return Math.abs(window.innerWidth - documentWidth);
50
+ }
51
+ function getExistingBodyPadding() {
52
+ const padding = Number(
53
+ getComputedStyle(document.body).paddingRight.replace(/px/, "")
54
+ );
55
+ if (isNaN(padding) || !padding) {
56
+ return 0;
57
+ }
58
+ return padding;
59
+ }
60
+ export {
61
+ lockBodyScrolling,
62
+ registerGlobalScrollLockStyles,
63
+ unlockBodyScrolling
64
+ };