@sebgroup/green-core 3.22.1 → 3.23.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.
Files changed (30) hide show
  1. package/components/calendar/calendar.component.js +2 -3
  2. package/components/context-menu/context-menu.component.d.ts +8 -0
  3. package/components/context-menu/context-menu.component.js +5 -0
  4. package/components/dropdown/dropdown.component.js +25 -2
  5. package/components/dropdown/option.component.js +1 -0
  6. package/components/radio/radio-group/radio-group.component.js +2 -0
  7. package/components/table/table.component.d.ts +7 -0
  8. package/components/table/table.component.js +32 -18
  9. package/custom-elements.json +33635 -33606
  10. package/gds-element.js +1 -1
  11. package/generated/mcp/checkbox/guidelines.md +24 -16
  12. package/generated/mcp/components.json +1 -1
  13. package/generated/mcp/context-menu/api.md +1 -0
  14. package/generated/mcp/datepicker/guidelines.md +19 -16
  15. package/generated/mcp/dropdown/guidelines.md +20 -13
  16. package/generated/mcp/icons.json +1 -1
  17. package/generated/mcp/index.json +1 -1
  18. package/generated/mcp/input/guidelines.md +5 -0
  19. package/generated/mcp/radio/guidelines.md +23 -14
  20. package/generated/mcp/select/guidelines.md +6 -0
  21. package/generated/mcp/switch/guidelines.md +6 -0
  22. package/generated/mcp/textarea/guidelines.md +18 -9
  23. package/generated/mcp/tokens.json +1 -1
  24. package/generated/react/context-menu/index.d.ts +1 -0
  25. package/generated/react/index.d.ts +2 -2
  26. package/generated/react/index.js +2 -2
  27. package/package.json +1 -1
  28. package/utils/decorators/resize-observer.d.ts +20 -1
  29. package/utils/decorators/resize-observer.js +21 -3
  30. package/utils/helpers/custom-element-scoping.js +1 -1
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.22.1";
19
+ this.semanticVersion = "3.23.0";
20
20
  this.syncFirstRender = false;
21
21
  this._isUsingTransitionalStyles = false;
22
22
  this._dynamicStylesController = new DynamicStylesController(this);
@@ -7,9 +7,10 @@ A checkbox is a form control that allows users to select one or multiple options
7
7
 
8
8
  ### Variants
9
9
 
10
- * **Default**
11
-
12
- * **Contained**: Coming soon Used on its own or together with other form components.
10
+ - **Default**
11
+ - **Contained**: Coming soon Used on its own or together with other form components.
12
+
13
+
13
14
 
14
15
  ### Features
15
16
 
@@ -29,9 +30,10 @@ This can be used for both the header and individual checkboxes. Use this to expl
29
30
 
30
31
  If the label and support text are not enough to explain a field, we can use the info icon. Clicking the icon shows additional support text between the label support and the field.
31
32
 
32
- * Use a tooltip if space is limited.
33
-
34
- * Use a modal for large amounts of text.
33
+ - Use a tooltip if space is limited.
34
+ - Use a modal for large amounts of text.
35
+
36
+
35
37
 
36
38
  ### Error message
37
39
 
@@ -43,24 +45,30 @@ Used when a checkbox is partially selected, typically in parent-child relationsh
43
45
 
44
46
  ### Behaviour:
45
47
 
46
- * If some child checkboxes are selected, the parent shows the indeterminate state.
47
-
48
- * If all child checkboxes are selected, the parent appears selected.
49
-
50
- * Selecting a parent checkbox (whether unselected or in the indeterminate state) selects all child checkboxes.
51
-
52
- * Deselecting the parent checkbox deselects all child checkboxes.
48
+ - If some child checkboxes are selected, the parent shows the indeterminate state.
49
+ - If all child checkboxes are selected, the parent appears selected.
50
+ - Selecting a parent checkbox (whether unselected or in the indeterminate state) selects all child checkboxes.
51
+ - Deselecting the parent checkbox deselects all child checkboxes.
52
+
53
+
53
54
 
54
55
  ### Alignment
55
56
 
56
57
  Checkboxes can be aligned horizontal or vertical.
57
58
 
58
- * **Vertical**: This is the default alignment. It's easier to read and scan the available options.
59
-
60
- * **Horizontal**: Only used for a small set of options if the page shouldn't be to long, but try to avoid.
59
+ - **Vertical**: This is the default alignment. It's easier to read and scan the available options.
60
+ - **Horizontal**: Only used for a small set of options if the page shouldn't be to long, but try to avoid.
61
+
62
+
61
63
 
62
64
  ### Do's and don'ts
63
65
 
66
+ ### Read only
67
+
68
+ The read only shows the selected state without allowing it to be changed. When several checkboxes represent a group of choices, the read only retain enough context for users to understand both selected and unselected options when that information is relevant.
69
+
70
+ [Read more about the read only pattern](https://seb.io/patterns/read-only)
71
+
64
72
 
65
73
  ## UX Guidelines
66
74
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-09-11T08:28:20.720Z",
2
+ "generatedAt": "2026-09-14T14:33:39.196Z",
3
3
  "components": [
4
4
  {
5
5
  "name": "gds-alert",
@@ -17,6 +17,7 @@
17
17
  | `label` | `string` | `-` | The label for the popover and menu. Should describe the context of the menu. |
18
18
  | `maxHeight` | `number` | `-` | Maximum height of the menu list. |
19
19
  | `placement` | `Placement` | `-` | The placement of the popover relative to the trigger. |
20
+ | `nonmodal` | `boolean` | `-` | Whether the context menu popover is nonmodal. When true, the popover will not trap focus, and other elements on the page (including other context menu triggers) will still be interactable while the menu is open. Enable this when rendering multiple `gds-context-menu` instances in the same view, so that clicking one trigger while another menu is open closes the first and opens the second in a single click. |
20
21
  | `margin` | `string \| undefined` | `-` | Style Expression Property that controls the `margin` property. Only accepts space tokens. |
21
22
  | `'margin-inline'` | `string \| undefined` | `-` | Style Expression Property that controls the `margin-inline` property. Only accepts space tokens. |
22
23
  | `'margin-block'` | `string \| undefined` | `-` | Style Expression Property that controls the `margin-block` property. Only accepts space tokens. |
@@ -7,19 +7,15 @@
7
7
 
8
8
  ### Features
9
9
 
10
- * Configurable date format display
11
-
12
- * `plain` mode to hide labels and error messages
13
-
14
- * Clearable for quick state reset
15
-
16
- * Min and max dates
17
-
18
- * Can be configured with visible or hidden week numbers
19
-
20
- * Individual dates can be marked as disabled in the calendar
21
-
22
- * Buttons in the calendar footer are configurable
10
+ - Configurable date format display
11
+ - `plain` mode to hide labels and error messages
12
+ - Clearable for quick state reset
13
+ - Min and max dates
14
+ - Can be configured with visible or hidden week numbers
15
+ - Individual dates can be marked as disabled in the calendar
16
+ - Buttons in the calendar footer are configurable
17
+
18
+
23
19
 
24
20
  ### Usage
25
21
 
@@ -29,9 +25,16 @@ Use datepicker when a complete date should be entered.
29
25
 
30
26
  The datepicker comes in two sizes.
31
27
 
32
- * **Large** (default)
33
-
34
- * **Small**: used in tables and in some special cases where the space is very limited.
28
+ - **Large** (default)
29
+ - **Small**: used in tables and in some special cases where the space is very limited.
30
+
31
+
32
+
33
+ ### Read only
34
+
35
+ Displays the entered value together with its label. Have no visual cues associated with text entry, such as an active input cursor or editable states.
36
+
37
+ [Read more about the read only pattern](http://seb.io/patterns/read-only)
35
38
 
36
39
  ### Do's and don'ts
37
40
 
@@ -7,9 +7,10 @@ A dropdown enables the user to choose one or multiple options from a list.
7
7
 
8
8
  ### Sizes
9
9
 
10
- * **Large**
11
-
12
- * **Small**: Used in tables and in certain cases where space is very limited. (Custom layouts are not supported.)
10
+ - **Large**
11
+ - **Small**: Used in tables and in certain cases where space is very limited. (Custom layouts are not supported.)
12
+
13
+
13
14
 
14
15
  ### Features
15
16
 
@@ -29,9 +30,10 @@ Use this to explain how to fill in the field, for example how to count or what t
29
30
 
30
31
  If the label and support text aren’t enough to explain a field, we can use the info icon. Clicking the icon shows additional support text between the label support and the field.
31
32
 
32
- * Use a tooltip if space is limited.
33
-
34
- * Use a modal for large amounts of text.
33
+ - Use a tooltip if space is limited.
34
+ - Use a modal for large amounts of text.
35
+
36
+
35
37
 
36
38
  #### Leading icon
37
39
 
@@ -49,13 +51,12 @@ Use this version when users should be able to select one or multiple options fro
49
51
 
50
52
  A search field can be used to filter the options.
51
53
 
52
- * If the list is long (e.g., 10+ items), searching helps users find what they need faster.
53
-
54
- * When items are similar or not in a predictable order, searching improves efficiency.
55
-
56
- * If users have a specific item in mind, typing is often faster than scrolling.
57
-
58
- * Search helps users who navigate with keyboards or screen readers find options more quickly.
54
+ - If the list is long (e.g., 10+ items), searching helps users find what they need faster.
55
+ - When items are similar or not in a predictable order, searching improves efficiency.
56
+ - If users have a specific item in mind, typing is often faster than scrolling.
57
+ - Search helps users who navigate with keyboards or screen readers find options more quickly.
58
+
59
+
59
60
 
60
61
  ### Option groups
61
62
 
@@ -77,6 +78,12 @@ To make it easy for users to clear a field, an x-icon button can be placed at th
77
78
 
78
79
  Used to indicate that a selection must be made from the dropdown or that there is an error with the selected option.
79
80
 
81
+ ### Read only
82
+
83
+ The read only displays the selected value, but removes affordances that suggest the list can be opened or changed.
84
+
85
+ [Read more about the read only pattern](https://seb.io/patterns/read-only)
86
+
80
87
 
81
88
  ## UX Guidelines
82
89
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-09-11T08:28:20.720Z",
2
+ "generatedAt": "2026-09-14T14:33:39.196Z",
3
3
  "icons": [
4
4
  {
5
5
  "name": "gds-icon-ai",
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-09-11T08:28:20.720Z",
2
+ "generatedAt": "2026-09-14T14:33:39.196Z",
3
3
  "instructions": "./INSTRUCTIONS.md",
4
4
  "components": "./components.json",
5
5
  "icons": "./icons.json",
@@ -84,6 +84,11 @@ If the user ignores this and attempts to submit, an error message will appear in
84
84
 
85
85
  Avoid using placeholder text (also known as watermark), as it can confuse users into thinking the field is already filled with data. Instructions should not be placed in the field, as they disappear once the user starts typing. Instead, use support text to guide users on what should be entered.
86
86
 
87
+ ### Read only
88
+
89
+ The read only state displays the entered value together with its label. Have no visual cues associated with text entry, such as an active input cursor or editable states. Long content should remain readable and should not be unnecessarily truncated.
90
+ [More about the read only pattern](https://seb.io/patterns/read-only)
91
+
87
92
  ### Do’s and dont’s
88
93
 
89
94
 
@@ -7,11 +7,11 @@ A radio button is a form control that allows users to select one of the predefin
7
7
 
8
8
  ### Variants
9
9
 
10
- * **Default**
11
-
12
- * **Contained**: used only in combination with other contained form components.
13
-
14
- * **Contained extended(coming soon)**: The contained version but including Label support text.
10
+ - **Default**
11
+ - **Contained**: used only in combination with other contained form components.
12
+ - **Contained extended(coming soon)**: The contained version but including Label support text.
13
+
14
+
15
15
 
16
16
  ### Features
17
17
 
@@ -27,9 +27,10 @@ This can be used for both the header and individual radio buttons. Use this to e
27
27
 
28
28
  If the label and support text are not enough to explain a field, we can use the info icon. Clicking the icon shows additional support text between the label support and the field.
29
29
 
30
- * Use a tooltip if space is limited.
31
-
32
- * Use a modal for large amounts of text.
30
+ - Use a tooltip if space is limited.
31
+ - Use a modal for large amounts of text.
32
+
33
+
33
34
 
34
35
  ### Error message
35
36
 
@@ -37,20 +38,28 @@ If an error occurs we mark the entire group of options with error. The error is
37
38
 
38
39
  ### Behaviour
39
40
 
40
- * **Mutual exclusivity**: Only one radio button within a group can be selected at a time.
41
-
42
- * **Defaults**: Aim for having one option pre-selected.
41
+ - **Mutual exclusivity**: Only one radio button within a group can be selected at a time.
42
+ - **Defaults**: Aim for having one option pre-selected.
43
+
44
+
43
45
 
44
46
  ### Alignment
45
47
 
46
48
  We can align the radio buttons both horizontal and vertical.
47
49
 
48
- * **Vertical**: This is the default alignment. It's easier to read and scan the available options.
49
-
50
- * **Horizontal**: Only used for a small set of options if the page shouldn't be to long, but try to avoid.
50
+ - **Vertical**: This is the default alignment. It's easier to read and scan the available options.
51
+ - **Horizontal**: Only used for a small set of options if the page shouldn't be to long, but try to avoid.
52
+
53
+
51
54
 
52
55
  ### Do's and don'ts
53
56
 
57
+ ### Read only
58
+
59
+ Shows the selected option without allowing the selection to be changed. Keep all options visible when the alternatives provide important context for understanding the selected value. If only the selected value is relevant, consider presenting it as text instead.
60
+
61
+ [Read more about the read only pattern](http://seb.io/patterns/read-only)
62
+
54
63
 
55
64
  ## UX Guidelines
56
65
 
@@ -15,6 +15,12 @@ Don't use this component when you need to customize the dropdown behavior or app
15
15
 
16
16
  The appearance and behavior of the option list will be handled according to each browser.
17
17
 
18
+ ### Read only
19
+
20
+ The read only displays the selected value, but removes affordances that suggest the list can be opened or changed.
21
+
22
+ [Read more about the read only pattern](https://seb.io/patterns/read-only)
23
+
18
24
  ### Do's and don'ts
19
25
 
20
26
 
@@ -25,6 +25,12 @@ A toggle must have a visible and persistent label and communicate its state prog
25
25
 
26
26
  ### Do's and Don'ts
27
27
 
28
+ ### Read only
29
+
30
+ Shows the current state without allowing it to be changed. Keep the label and make the current state clear. Since a switch normally represents an immediate on or off setting, users should be able to understand the state without relying on the position or visual appearance of the switch alone.
31
+
32
+ [Read more about the read only pattern](https://seb.io/patterns/read-only)
33
+
28
34
 
29
35
  ## UX Guidelines
30
36
 
@@ -9,9 +9,10 @@ Textarea allow users to input text and digits on multiple lines.
9
9
 
10
10
  We provide two versions of textarea.
11
11
 
12
- * **Default**
13
-
14
- * **Floating label** (coming soon): Can only be used in specific contexts. Limited features due to accessibility.
12
+ - **Default**
13
+ - **Floating label** (coming soon): Can only be used in specific contexts. Limited features due to accessibility.
14
+
15
+
15
16
 
16
17
  ### Features
17
18
 
@@ -31,9 +32,10 @@ Use this to explain how to fill in the field, for example how to count or what t
31
32
 
32
33
  If the label and support text aren’t enough to explain a field, we can use the info icon. Clicking the icon shows additional support text between the label support and the field.
33
34
 
34
- * Use a tooltip if space is limited.
35
-
36
- * Use a modal for large amounts of text.
35
+ - Use a tooltip if space is limited.
36
+ - Use a modal for large amounts of text.
37
+
38
+
37
39
 
38
40
  #### Leading icon
39
41
 
@@ -59,6 +61,13 @@ If the user ignores this and attempts to submit, an error message will appear in
59
61
 
60
62
  The default Textarea has a fixed height based on the expected input. This helps users understand how much text the field is intended for. If the field should be resizable, there are two options:
61
63
 
62
- * **Automatic**: Adjusts dynamically as the user types.
63
-
64
- * **Manual**: Users can resize it by dragging the corner.
64
+ - **Automatic**: Adjusts dynamically as the user types.
65
+ - **Manual**: Users can resize it by dragging the corner.
66
+
67
+
68
+
69
+ ### Read only
70
+
71
+ The read only state displays the entered value together with its label. Have no visual cues associated with text entry, such as an active input cursor or editable states. Long content should remain readable and should not be unnecessarily truncated.
72
+
73
+ [Read more about the read only pattern](https://seb.io/patterns/read-only)
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-09-11T08:28:13.167Z",
2
+ "generatedAt": "2026-09-14T14:33:39.118Z",
3
3
  "categories": {
4
4
  "space": {
5
5
  "description": "Spacing tokens for padding, margin, gap, and other spacing",
@@ -16,6 +16,7 @@ export declare const GdsContextMenu: {
16
16
  label?: string;
17
17
  maxHeight?: number;
18
18
  placement?: import("@floating-ui/utils").Placement | undefined;
19
+ nonmodal?: boolean;
19
20
  connectedCallback?: (() => void) | undefined;
20
21
  render?: (() => any) | undefined;
21
22
  margin?: string | undefined;
@@ -26,8 +26,8 @@ export * from './grouped-list/index.js';
26
26
  export * from './img/index.js';
27
27
  export * from './input/index.js';
28
28
  export * from './link/index.js';
29
- export * from './list/index.js';
30
29
  export * from './mask/index.js';
30
+ export * from './list/index.js';
31
31
  export * from './menu-button/index.js';
32
32
  export * from './pagination/index.js';
33
33
  export * from './backdrop/index.js';
@@ -37,8 +37,8 @@ export * from './rich-text/index.js';
37
37
  export * from './segmented-control/index.js';
38
38
  export * from './select/index.js';
39
39
  export * from './signal/index.js';
40
- export * from './switch/index.js';
41
40
  export * from './spinner/index.js';
41
+ export * from './switch/index.js';
42
42
  export * from './table/index.js';
43
43
  export * from './tabs/index.js';
44
44
  export * from './text/index.js';
@@ -26,8 +26,8 @@ export * from "./grouped-list/index.js";
26
26
  export * from "./img/index.js";
27
27
  export * from "./input/index.js";
28
28
  export * from "./link/index.js";
29
- export * from "./list/index.js";
30
29
  export * from "./mask/index.js";
30
+ export * from "./list/index.js";
31
31
  export * from "./menu-button/index.js";
32
32
  export * from "./pagination/index.js";
33
33
  export * from "./backdrop/index.js";
@@ -37,8 +37,8 @@ export * from "./rich-text/index.js";
37
37
  export * from "./segmented-control/index.js";
38
38
  export * from "./select/index.js";
39
39
  export * from "./signal/index.js";
40
- export * from "./switch/index.js";
41
40
  export * from "./spinner/index.js";
41
+ export * from "./switch/index.js";
42
42
  export * from "./table/index.js";
43
43
  export * from "./tabs/index.js";
44
44
  export * from "./text/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.22.1",
4
+ "version": "3.23.0",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
7
7
  "type": "module",
@@ -1,5 +1,15 @@
1
1
  import type { LitElement } from 'lit';
2
2
  type Handler = () => void;
3
+ interface ResizeObserverConfig {
4
+ /**
5
+ * A selector for the elements to observe, resolved against the shadow root of the
6
+ * component. The matching elements are re-resolved after each render, so elements
7
+ * that are rendered by later updates are picked up automatically.
8
+ *
9
+ * When omitted, the host element is observed.
10
+ */
11
+ selector?: string;
12
+ }
3
13
  /**
4
14
  * Runs when the size of the component changes.
5
15
  *
@@ -10,6 +20,15 @@ type Handler = () => void;
10
20
  * // Do some layout calculation or something
11
21
  * }
12
22
  * ```
23
+ *
24
+ * Pass a `selector` to observe elements inside the shadow root instead of the host,
25
+ * for cases where the host size does not reflect the size of the observed content:
26
+ * ```javascript
27
+ * \@resizeObserver({ selector: 'thead th' })
28
+ * handleHeaderResize() {
29
+ * // Do some layout calculation or something
30
+ * }
31
+ * ```
13
32
  */
14
- export declare function resizeObserver(): <ElemClass extends LitElement>(proto: ElemClass, propertyKey: string, descriptor: TypedPropertyDescriptor<Handler>) => void;
33
+ export declare function resizeObserver({ selector }?: ResizeObserverConfig): <ElemClass extends LitElement>(proto: ElemClass, propertyKey: string, descriptor: TypedPropertyDescriptor<Handler>) => void;
15
34
  export {};
@@ -1,8 +1,20 @@
1
1
  import "../../chunks/chunk.CAV4X6PU.js";
2
- function resizeObserver() {
2
+ function resizeObserver({ selector } = {}) {
3
3
  return (proto, propertyKey, descriptor) => {
4
4
  const connectedCallback = proto.connectedCallback;
5
5
  const disconnectedCallback = proto.disconnectedCallback;
6
+ const { updated } = proto;
7
+ function observeTargets() {
8
+ const observer = this.__resizeObservers?.[propertyKey];
9
+ if (!observer)
10
+ return;
11
+ if (!selector) {
12
+ observer.observe(this);
13
+ return;
14
+ }
15
+ observer.disconnect();
16
+ this.shadowRoot?.querySelectorAll(selector).forEach((element) => observer.observe(element));
17
+ }
6
18
  proto.connectedCallback = function() {
7
19
  connectedCallback?.call(this);
8
20
  this.__resizeObservers = this.__resizeObservers || {};
@@ -13,11 +25,17 @@ function resizeObserver() {
13
25
  descriptor.value?.call(this);
14
26
  }, 20);
15
27
  });
16
- this.__resizeObservers[propertyKey].observe(this);
28
+ observeTargets.call(this);
17
29
  };
30
+ if (selector) {
31
+ proto.updated = function(changedProperties) {
32
+ updated?.call(this, changedProperties);
33
+ observeTargets.call(this);
34
+ };
35
+ }
18
36
  proto.disconnectedCallback = function() {
19
37
  disconnectedCallback?.call(this);
20
- this.__resizeObservers[propertyKey].disconnect();
38
+ this.__resizeObservers?.[propertyKey]?.disconnect();
21
39
  };
22
40
  };
23
41
  }
@@ -1,6 +1,6 @@
1
1
  import "../../chunks/chunk.CAV4X6PU.js";
2
2
  import { html as litHtml } from "lit";
3
- const VER_SUFFIX = "-a567c2";
3
+ const VER_SUFFIX = "-3deb38";
4
4
  class ScopedElementRegistry {
5
5
  static get instance() {
6
6
  if (!globalThis.__gdsElementLookupTable?.[VER_SUFFIX])