@sebgroup/green-core 3.19.0 → 3.20.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.19.0";
19
+ this.semanticVersion = "3.20.0";
20
20
  this.syncFirstRender = false;
21
21
  this._isUsingTransitionalStyles = false;
22
22
  this._dynamicStylesController = new DynamicStylesController(this);
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-08-24T12:12:38.947Z",
2
+ "generatedAt": "2026-08-24T12:24:18.401Z",
3
3
  "components": [
4
4
  {
5
5
  "name": "gds-alert",
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-08-24T12:12:38.947Z",
2
+ "generatedAt": "2026-08-24T12:24:18.401Z",
3
3
  "icons": [
4
4
  {
5
5
  "name": "gds-icon-ai",
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-08-24T12:12:38.947Z",
2
+ "generatedAt": "2026-08-24T12:24:18.401Z",
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-24T12:12:38.866Z",
2
+ "generatedAt": "2026-08-24T12:24:18.326Z",
3
3
  "categories": {
4
4
  "space": {
5
5
  "description": "Spacing tokens for padding, margin, gap, and other spacing",
@@ -59,8 +59,8 @@ export * from './radio-group/index.js';
59
59
  export * from './segment/index.js';
60
60
  export * from './sensitive-account/index.js';
61
61
  export * from './sensitive-date/index.js';
62
- export * from './sensitive-number/index.js';
63
62
  export * from './tab/index.js';
63
+ export * from './sensitive-number/index.js';
64
64
  export * from './tab-panel/index.js';
65
65
  export * from './icons/icon-ai/index.js';
66
66
  export * from './icons/icon-airplane-up/index.js';
@@ -59,8 +59,8 @@ export * from "./radio-group/index.js";
59
59
  export * from "./segment/index.js";
60
60
  export * from "./sensitive-account/index.js";
61
61
  export * from "./sensitive-date/index.js";
62
- export * from "./sensitive-number/index.js";
63
62
  export * from "./tab/index.js";
63
+ export * from "./sensitive-number/index.js";
64
64
  export * from "./tab-panel/index.js";
65
65
  export * from "./icons/icon-ai/index.js";
66
66
  export * from "./icons/icon-airplane-up/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.19.0",
4
+ "version": "3.20.0",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
7
7
  "type": "module",
@@ -1,4 +1,7 @@
1
1
  import "../../chunks/chunk.CAV4X6PU.js";
2
+ import {
3
+ ARIA_STRING_KEYS
4
+ } from "./aria-forwarding.types.js";
2
5
  import { observeAttributes } from "./observe-attributes.js";
3
6
  function getAriaRefMeta(key) {
4
7
  const isSingle = key === "activeDescendant";
@@ -32,10 +35,15 @@ function setElementProperty(el, prop, value, type = "list") {
32
35
  }
33
36
  function ariaForwarding(config) {
34
37
  const configuredEntries = [];
38
+ const configuredStringEntries = [];
35
39
  for (const [key, selector] of Object.entries(config)) {
36
40
  if (!selector)
37
41
  continue;
38
- configuredEntries.push({ key, selector });
42
+ if (ARIA_STRING_KEYS.includes(key)) {
43
+ configuredStringEntries.push({ key, selector });
44
+ } else {
45
+ configuredEntries.push({ key, selector });
46
+ }
39
47
  }
40
48
  return function(constructor) {
41
49
  const origConnected = constructor.prototype.connectedCallback;
@@ -54,6 +62,15 @@ function ariaForwarding(config) {
54
62
  attrHandlers[meta.ariaAttr] = handler;
55
63
  attrHandlers[meta.gdsAriaAttr] = handler;
56
64
  }
65
+ for (const { key } of configuredStringEntries) {
66
+ const ariaAttr = `aria-${key}`;
67
+ const gdsAriaAttr = `gds-aria-${key}`;
68
+ const handler = (host, _oldValue, newValue) => {
69
+ forwardAriaStringAttribute(host, key, newValue);
70
+ };
71
+ attrHandlers[ariaAttr] = handler;
72
+ attrHandlers[gdsAriaAttr] = handler;
73
+ }
57
74
  observeAttributes(AriaForwardingElement, attrHandlers);
58
75
  function initAriaForwarding(host) {
59
76
  if (host[ARIA_INIT])
@@ -92,6 +109,14 @@ function ariaForwarding(config) {
92
109
  forwardAriaRefFromAttribute(host, key, value);
93
110
  }
94
111
  }
112
+ for (const { key } of configuredStringEntries) {
113
+ const gdsValue = host.getAttribute(`gds-aria-${key}`);
114
+ const ariaValue = host.getAttribute(`aria-${key}`);
115
+ const value = gdsValue ?? ariaValue;
116
+ if (value) {
117
+ forwardAriaStringAttribute(host, key, value);
118
+ }
119
+ }
95
120
  });
96
121
  }
97
122
  function forwardAriaRefFromAttribute(host, refKey, value) {
@@ -125,6 +150,24 @@ function ariaForwarding(config) {
125
150
  targets.forEach((t) => setElementProperty(t, meta.property, value, meta.type));
126
151
  });
127
152
  }
153
+ function forwardAriaStringAttribute(host, key, value) {
154
+ const selector = config[key];
155
+ if (!selector)
156
+ return;
157
+ const ariaAttr = `aria-${key}`;
158
+ host.updateComplete.then(() => {
159
+ const targets = host.shadowRoot?.querySelectorAll(selector);
160
+ if (!targets || targets.length === 0)
161
+ return;
162
+ targets.forEach((t) => {
163
+ if (value) {
164
+ t.setAttribute(ariaAttr, value);
165
+ } else {
166
+ t.removeAttribute(ariaAttr);
167
+ }
168
+ });
169
+ });
170
+ }
128
171
  return AriaForwardingElement;
129
172
  };
130
173
  }
@@ -39,6 +39,15 @@ export interface AriaRefMeta {
39
39
  */
40
40
  export declare const ARIA_REF_KEYS: readonly ["activeDescendant", "controls", "describedBy", "details", "errorMessage", "flowTo", "labelledBy", "owns"];
41
41
  export type AriaRefKey = (typeof ARIA_REF_KEYS)[number];
42
+ /**
43
+ * ARIA string attribute keys.
44
+ * These forward a plain string value (not an element reference) to the target.
45
+ * The config key (e.g., `label`) maps by convention to:
46
+ * - Attribute: `aria-label` / `gds-aria-label`
47
+ * - Type: `string`
48
+ */
49
+ export declare const ARIA_STRING_KEYS: readonly ["label"];
50
+ export type AriaStringKey = (typeof ARIA_STRING_KEYS)[number];
42
51
  /**
43
52
  * Configuration for the `@ariaForwarding` decorator.
44
53
  *
@@ -55,5 +64,5 @@ export type AriaRefKey = (typeof ARIA_REF_KEYS)[number];
55
64
  * ```
56
65
  */
57
66
  export type AriaForwardingConfig = {
58
- [K in AriaRefKey]?: string;
67
+ [K in AriaRefKey | AriaStringKey]?: string;
59
68
  };
@@ -9,6 +9,8 @@ const ARIA_REF_KEYS = [
9
9
  "labelledBy",
10
10
  "owns"
11
11
  ];
12
+ const ARIA_STRING_KEYS = ["label"];
12
13
  export {
13
- ARIA_REF_KEYS
14
+ ARIA_REF_KEYS,
15
+ ARIA_STRING_KEYS
14
16
  };
@@ -1,6 +1,6 @@
1
1
  import "../../chunks/chunk.CAV4X6PU.js";
2
2
  import { html as litHtml } from "lit";
3
- const VER_SUFFIX = "-b891de";
3
+ const VER_SUFFIX = "-c4bc8e";
4
4
  class ScopedElementRegistry {
5
5
  static get instance() {
6
6
  if (!globalThis.__gdsElementLookupTable?.[VER_SUFFIX])