@sebgroup/green-core 2.19.0 → 2.20.0-rc.20251215154321804

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 (64) hide show
  1. package/components/badge/badge.component.d.ts +0 -23
  2. package/components/badge/badge.component.js +18 -105
  3. package/components/badge/badge.styles.js +96 -2
  4. package/components/checkbox/checkbox.component.js +24 -22
  5. package/components/checkbox/checkbox.styles.js +0 -8
  6. package/components/dropdown/dropdown.component.js +4 -1
  7. package/components/index.d.ts +2 -0
  8. package/components/index.js +2 -0
  9. package/components/input/input.styles.js +10 -1
  10. package/components/pagination/index.d.ts +1 -0
  11. package/components/pagination/index.js +1 -0
  12. package/components/pagination/pagination.component.d.ts +82 -0
  13. package/components/pagination/pagination.component.js +441 -0
  14. package/components/pagination/pagination.d.ts +2 -0
  15. package/components/pagination/pagination.js +6 -0
  16. package/components/pagination/pagination.styles.d.ts +1 -0
  17. package/components/pagination/pagination.styles.js +19 -0
  18. package/components/table/index.d.ts +2 -0
  19. package/components/table/index.js +6 -0
  20. package/components/table/table.component.d.ts +140 -0
  21. package/components/table/table.component.js +1090 -0
  22. package/components/table/table.d.ts +2 -0
  23. package/components/table/table.imports.d.ts +6 -0
  24. package/components/table/table.imports.js +63 -0
  25. package/components/table/table.js +6 -0
  26. package/components/table/table.stories.data.d.ts +53 -0
  27. package/components/table/table.stories.data.js +401 -0
  28. package/components/table/table.styles.d.ts +1 -0
  29. package/components/table/table.styles.js +788 -0
  30. package/components/table/table.types.d.ts +155 -0
  31. package/components/table/table.types.js +24 -0
  32. package/custom-elements.json +12280 -10492
  33. package/gds-element.js +1 -1
  34. package/generated/locales/da.d.ts +32 -0
  35. package/generated/locales/da.js +32 -0
  36. package/generated/locales/de.d.ts +32 -0
  37. package/generated/locales/de.js +32 -0
  38. package/generated/locales/fi.d.ts +32 -0
  39. package/generated/locales/fi.js +32 -0
  40. package/generated/locales/fr.d.ts +32 -0
  41. package/generated/locales/fr.js +32 -0
  42. package/generated/locales/it.d.ts +32 -0
  43. package/generated/locales/it.js +32 -0
  44. package/generated/locales/nl.d.ts +32 -0
  45. package/generated/locales/nl.js +32 -0
  46. package/generated/locales/no.d.ts +32 -0
  47. package/generated/locales/no.js +33 -1
  48. package/generated/locales/sv.d.ts +32 -0
  49. package/generated/locales/sv.js +32 -0
  50. package/generated/react/index.d.ts +8 -6
  51. package/generated/react/index.js +8 -6
  52. package/generated/react/input/index.d.ts +1 -1
  53. package/generated/react/pagination/index.d.ts +395 -0
  54. package/generated/react/pagination/index.js +13 -0
  55. package/generated/react/table/index.d.ts +395 -0
  56. package/generated/react/table/index.js +13 -0
  57. package/package.json +8 -1
  58. package/primitives/field-base/field-base.component.d.ts +1 -0
  59. package/primitives/field-base/field-base.component.js +8 -0
  60. package/primitives/field-base/field-base.styles.js +9 -1
  61. package/pure.d.ts +2 -0
  62. package/pure.js +2 -0
  63. package/shared-styles/rbcb-toggle.style.js +41 -12
  64. package/utils/helpers/custom-element-scoping.js +1 -1
@@ -4,36 +4,13 @@ declare const GdsBadge_base: (new (...args: any[]) => import("../../utils/mixins
4
4
  * `gds-badge`
5
5
  *
6
6
  * @element gds-badge
7
- *
8
7
  */
9
8
  export declare class GdsBadge extends GdsBadge_base {
10
9
  #private;
11
10
  static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
12
- /**
13
- * Controls the variant of the badge.
14
- * Supports all valid variants like information, notice, positive, warning, negative.
15
- * @property variant
16
- */
17
11
  variant: 'information' | 'notice' | 'positive' | 'warning' | 'negative' | 'disabled';
18
- /**
19
- * Defines the size of the badge.
20
- * The default value is `default`.
21
- *
22
- * @property {string} size - The size of the badge, which can be either 'default' or 'small'.
23
- */
24
12
  size: 'default' | 'small';
25
- /**
26
- * Indicates whether the badge is in notification mode.
27
- * When set to `true`, the badge will act as a notification badge with only two variants: `positive` or `negative`.
28
- *
29
- * @property {boolean} notification - Controls the notification mode of the badge.
30
- */
31
13
  notification: boolean;
32
- /**
33
- * Indicates whether the badge is rounded.
34
- *
35
- * @property {boolean} rounded - Controls the border radius of the badge.
36
- */
37
14
  rounded: boolean;
38
15
  mainSlotOccupied: boolean;
39
16
  leadSlotOccupied: boolean;
@@ -5,6 +5,7 @@ import {
5
5
  } from "../../chunks/chunk.QU3DSPNU.js";
6
6
  var _GdsBadge_instances, handleSlotChange_fn, renderLeadSlot_fn, renderMainSlot_fn, renderTrailSlot_fn;
7
7
  import { property, state } from "lit/decorators.js";
8
+ import { classMap } from "lit/directives/class-map.js";
8
9
  import { GdsElement } from "../../gds-element.js";
9
10
  import { html } from "../../scoping.js";
10
11
  import { tokens } from "../../tokens.style.js";
@@ -30,111 +31,23 @@ let GdsBadge = class extends withSizeXProps(
30
31
  this.leadSlotOccupied = false;
31
32
  }
32
33
  render() {
33
- let background;
34
- let color;
35
- if (this.notification) {
36
- background = "negative-01";
37
- color = "inversed";
38
- } else {
39
- switch (this.variant) {
40
- case "information":
41
- background = "information-03";
42
- color = "information-01";
43
- break;
44
- case "notice":
45
- background = "notice-03";
46
- color = "notice-01";
47
- break;
48
- case "positive":
49
- background = "positive-03";
50
- color = "positive-03";
51
- break;
52
- case "warning":
53
- background = "warning-03";
54
- color = "warning-01";
55
- break;
56
- case "negative":
57
- background = "negative-03";
58
- color = "negative-01";
59
- break;
60
- case "disabled":
61
- background = "disabled-03";
62
- color = "disabled-01";
63
- break;
64
- default:
65
- background = "information-03";
66
- color = "information-01";
67
- break;
68
- }
69
- }
70
- const padding = (() => {
71
- const paddings = {
72
- notification: {
73
- occupied: "4xs 2xs",
74
- default: "3xs"
75
- },
76
- small: {
77
- occupied: "4xs 3xs",
78
- default: "4xs 3xs"
79
- },
80
- default: {
81
- occupied: "3xs xs 3xs 2xs",
82
- default: "4xs xs"
83
- }
84
- };
85
- if (this.notification) {
86
- return paddings.notification[this.mainSlotOccupied ? "occupied" : "default"];
87
- }
88
- const isSmall = this.size === "small";
89
- return paddings[isSmall ? "small" : "default"][this.leadSlotOccupied ? "occupied" : "default"];
90
- })();
91
- const blockSize = (() => {
92
- const sizes = {
93
- occupied: {
94
- small: "m",
95
- default: "l"
96
- },
97
- default: "xs"
98
- };
99
- return this.mainSlotOccupied ? sizes.occupied[this.size === "small" || this.notification ? "small" : "default"] : sizes.default;
100
- })();
101
- const inlineSize = (() => {
102
- const sizes = {
103
- notification: {
104
- occupied: "l",
105
- default: "0"
106
- },
107
- default: "l"
108
- };
109
- return this.notification ? sizes.notification[this.mainSlotOccupied ? "occupied" : "default"] : sizes.default;
110
- })();
111
- const borderRadius = (() => {
112
- const radiuses = {
113
- small: "3xs",
114
- notification: "max",
115
- default: "2xs"
116
- };
117
- if (this.rounded) return "max";
118
- if (this.notification) return radiuses.notification;
119
- return this.size === "small" ? radiuses.small : radiuses.default;
120
- })();
121
- return html`<gds-flex
122
- level="3"
123
- background=${background}
124
- color=${color}
125
- gap="${this.notification ? "" : "3xs"}"
126
- align-items="center"
127
- justify-content="${this.notification ? "center" : "flex-start"}"
128
- padding="${padding}"
129
- min-height="${blockSize}"
130
- border-radius="${borderRadius}"
131
- width="100%"
132
- min-width="${inlineSize}"
133
- font="${this.size === "small" || this.notification ? "detail-book-xs" : "detail-book-s"}"
134
- >
135
- ${__privateMethod(this, _GdsBadge_instances, renderLeadSlot_fn).call(this)} ${__privateMethod(this, _GdsBadge_instances, renderMainSlot_fn).call(this)}
136
- ${__privateMethod(this, _GdsBadge_instances, renderTrailSlot_fn).call(this)}
137
- </gds-flex>`;
34
+ const classes = classMap({
35
+ badge: true,
36
+ [this.variant]: true,
37
+ [this.size]: this.size === "small",
38
+ notification: this.notification,
39
+ "with-content": this.notification && this.mainSlotOccupied,
40
+ rounded: this.rounded
41
+ });
42
+ return html`
43
+ <div class="${classes}">
44
+ ${[
45
+ __privateMethod(this, _GdsBadge_instances, renderLeadSlot_fn).call(this),
46
+ __privateMethod(this, _GdsBadge_instances, renderMainSlot_fn).call(this),
47
+ __privateMethod(this, _GdsBadge_instances, renderTrailSlot_fn).call(this)
48
+ ]}
49
+ </div>
50
+ `;
138
51
  }
139
52
  };
140
53
  _GdsBadge_instances = new WeakSet();
@@ -1,8 +1,102 @@
1
1
  import "../../chunks/chunk.QU3DSPNU.js";
2
2
  import { css } from "lit";
3
3
  const style = css`
4
- :host {
5
- display: inline-block;
4
+ @layer tokens, core, variants, sizes, states, notification;
5
+
6
+ @layer core {
7
+ :host {
8
+ display: inline-block;
9
+ }
10
+
11
+ .badge {
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: flex-start;
15
+ gap: var(--gds-sys-space-3xs);
16
+ padding: var(--_padding);
17
+ min-height: var(--_block-size);
18
+ border-radius: var(--_border-radius);
19
+ width: 100%;
20
+ min-width: var(--_inline-size);
21
+ font: var(--_font);
22
+ background-color: var(--_bg);
23
+ color: var(--_color);
24
+ box-sizing: border-box;
25
+
26
+ --_padding: var(--gds-sys-space-4xs) var(--gds-sys-space-xs);
27
+ --_block-size: var(--gds-sys-space-xs);
28
+ --_border-radius: var(--gds-sys-space-2xs);
29
+ --_inline-size: var(--gds-sys-space-l);
30
+ --_font: var(--gds-sys-text-detail-book-s);
31
+ }
32
+ }
33
+
34
+ @layer variants {
35
+ .badge.information {
36
+ --_bg: var(--gds-sys-color-l3-information-03);
37
+ --_color: var(--gds-sys-color-content-information-01);
38
+ }
39
+
40
+ .badge.notice {
41
+ --_bg: var(--gds-sys-color-l3-notice-03);
42
+ --_color: var(--gds-sys-color-content-notice-01);
43
+ }
44
+
45
+ .badge.positive {
46
+ --_bg: var(--gds-sys-color-l3-positive-03);
47
+ --_color: var(--gds-sys-color-content-positive-03);
48
+ }
49
+
50
+ .badge.warning {
51
+ --_bg: var(--gds-sys-color-l3-warning-03);
52
+ --_color: var(--gds-sys-color-content-warning-01);
53
+ }
54
+
55
+ .badge.negative {
56
+ --_bg: var(--gds-sys-color-l3-negative-03);
57
+ --_color: var(--gds-sys-color-content-negative-01);
58
+ }
59
+
60
+ .badge.disabled {
61
+ --_bg: var(--gds-sys-color-l3-disabled-03);
62
+ --_color: var(--gds-sys-color-content-disabled-01);
63
+ }
64
+ }
65
+
66
+ @layer sizes {
67
+ .badge.small {
68
+ --_padding: var(--gds-sys-space-4xs) var(--gds-sys-space-2xs);
69
+ --_block-size: var(--gds-sys-space-m);
70
+ --_border-radius: var(--gds-sys-space-3xs);
71
+ --_font: var(--gds-sys-text-detail-book-xs);
72
+ }
73
+ }
74
+
75
+ @layer notification {
76
+ .badge.notification {
77
+ --_padding: var(--gds-sys-space-3xs);
78
+ --_block-size: var(--gds-sys-space-xs);
79
+ --_border-radius: var(--gds-sys-space-max);
80
+ --_inline-size: 0;
81
+ justify-content: center;
82
+ gap: 0;
83
+ --_bg: var(--gds-sys-color-l3-negative-01);
84
+ --_color: var(--gds-sys-color-content-inversed);
85
+ --_font: var(--gds-sys-text-detail-book-xs);
86
+ }
87
+
88
+ .badge.notification.with-content {
89
+ --_padding: var(--gds-sys-space-4xs) var(--gds-sys-space-2xs);
90
+ --_block-size: var(--gds-sys-space-m);
91
+ --_inline-size: var(--gds-sys-space-l);
92
+ }
93
+ }
94
+
95
+ @layer states {
96
+ .badge.rounded {
97
+ --_border-radius: var(--gds-sys-space-max);
98
+ justify-content: center;
99
+ }
6
100
  }
7
101
 
8
102
  slot[name='lead']::slotted(*) {
@@ -42,39 +42,41 @@ let GdsCheckbox = class extends GdsFormControlElement {
42
42
  }
43
43
  render() {
44
44
  return html`
45
- <input
46
- type="checkbox"
47
- ?checked=${this.checked}
48
- ?disabled=${this.disabled}
49
- ?indeterminate=${this.indeterminate}
50
- aria-invalid=${this.invalid}
51
- aria-describedby="message supporting-text"
52
- id="checkbox-input"
53
- @change=${() => {
45
+ <input
46
+ type="checkbox"
47
+ class="visually-hidden-checkbox"
48
+ ?checked=${this.checked}
49
+ ?disabled=${this.disabled}
50
+ ?indeterminate=${this.indeterminate}
51
+ aria-invalid=${this.invalid}
52
+ aria-describedby="message supporting-text"
53
+ id="checkbox-input"
54
+ @change=${() => {
54
55
  this.checked = this._elCheckbox.checked;
55
56
  __privateMethod(this, _GdsCheckbox_instances, dispatchChangeEvents_fn).call(this);
56
57
  }}
57
- />
58
- ${when(
58
+ />
59
+ ${when(
59
60
  this.errorMessage,
60
61
  () => html`<span id="message">${this.errorMessage}</span>`
61
62
  )}
62
- <gds-toggle-control-base type="checkbox" @click=${__privateMethod(this, _GdsCheckbox_instances, toggleChecked_fn)}>
63
- <label for="checkbox-input" slot="label"> ${this.label} </label>
64
- <span
65
- slot="supporting-text"
66
- class="supporting-text"
67
- id="supporting-text"
68
- >
69
- ${this.supportingText}
70
- </span>
71
- ${checkboxToggle({
63
+ <gds-toggle-control-base type="checkbox" @click=${__privateMethod(this, _GdsCheckbox_instances, toggleChecked_fn)}>
64
+ <label for="checkbox-input" slot="label"> ${this.label} </label>
65
+ <span
66
+ slot="supporting-text"
67
+ class="supporting-text"
68
+ id="supporting-text"
69
+ >
70
+ ${this.supportingText}
71
+ </span>
72
+ ${checkboxToggle({
72
73
  checked: this.checked,
73
74
  indeterminate: this.indeterminate,
74
75
  disabled: this.disabled,
75
76
  invalid: this.invalid
76
77
  })}
77
- </gds-toggle-control-base>
78
+ </gds-toggle-control-base>
79
+ </div>
78
80
  `;
79
81
  }
80
82
  _getValidityAnchor() {
@@ -18,14 +18,6 @@ const style = css`
18
18
  outline: none;
19
19
  }
20
20
 
21
- input[type='checkbox'] {
22
- position: absolute;
23
- opacity: 0;
24
- width: 0;
25
- height: 0;
26
- pointer-events: none;
27
- }
28
-
29
21
  #message {
30
22
  display: none;
31
23
  }
@@ -381,7 +381,10 @@ let Dropdown = class extends GdsFormControlElement {
381
381
  !this.combobox || this.multiple,
382
382
  () => __privateGet(this, _renderTriggerButton).call(this)
383
383
  )}
384
- <gds-icon-chevron-bottom slot="action"></gds-icon-chevron-bottom>
384
+ <gds-icon-chevron-bottom
385
+ size=${this.size === "small" ? "m" : "l"}
386
+ slot="action"
387
+ ></gds-icon-chevron-bottom>
385
388
  </gds-field-base>
386
389
 
387
390
  ${when(
@@ -29,6 +29,7 @@ export * from './input';
29
29
  export * from './link';
30
30
  export * from './mask';
31
31
  export * from './menu-button';
32
+ export * from './pagination';
32
33
  export * from './popover';
33
34
  export * from './radio';
34
35
  export * from './rich-text';
@@ -37,6 +38,7 @@ export * from './select';
37
38
  export * from './signal';
38
39
  export * from './spinner';
39
40
  export * from './text';
41
+ export * from './table';
40
42
  export * from './textarea';
41
43
  export * from './theme';
42
44
  export * from './video';
@@ -29,6 +29,7 @@ export * from "./input/index.js";
29
29
  export * from "./link/index.js";
30
30
  export * from "./mask/index.js";
31
31
  export * from "./menu-button/index.js";
32
+ export * from "./pagination/index.js";
32
33
  export * from "./popover/index.js";
33
34
  export * from "./radio/index.js";
34
35
  export * from "./rich-text/index.js";
@@ -37,6 +38,7 @@ export * from "./select/index.js";
37
38
  export * from "./signal/index.js";
38
39
  export * from "./spinner/index.js";
39
40
  export * from "./text/index.js";
41
+ export * from "./table/index.js";
40
42
  export * from "./textarea/index.js";
41
43
  export * from "./theme/index.js";
42
44
  export * from "./video/index.js";
@@ -1,6 +1,15 @@
1
1
  import "../../chunks/chunk.QU3DSPNU.js";
2
2
  import { css } from "lit";
3
- const style = css``;
3
+ const style = css`
4
+ input::-webkit-outer-spin-button,
5
+ input::-webkit-inner-spin-button {
6
+ -webkit-appearance: var(--_appearance-spin-button, auto);
7
+ }
8
+
9
+ input[type='number'] {
10
+ -moz-appearance: var(--_appearance-spin-button, textfield);
11
+ }
12
+ `;
4
13
  var input_styles_default = style;
5
14
  export {
6
15
  input_styles_default as default
@@ -0,0 +1 @@
1
+ export * from './pagination';
@@ -0,0 +1 @@
1
+ export * from "./pagination.js";
@@ -0,0 +1,82 @@
1
+ import { GdsElement } from '../../gds-element';
2
+ /**
3
+ * Centralized density configuration
4
+ */
5
+ declare const DENSITY_CONFIG: {
6
+ readonly compact: {
7
+ readonly button: "small";
8
+ readonly font: "detail-book-s";
9
+ readonly gap: "xl";
10
+ readonly navGap: "xs";
11
+ readonly input: "small";
12
+ readonly inputWidth: "140px";
13
+ readonly inputPadding: "m";
14
+ };
15
+ readonly comfortable: {
16
+ readonly button: "small";
17
+ readonly font: "detail-book-s";
18
+ readonly gap: "2xl";
19
+ readonly navGap: "s";
20
+ readonly input: "small";
21
+ readonly inputWidth: "140px";
22
+ readonly inputPadding: "m";
23
+ };
24
+ readonly spacious: {
25
+ readonly button: "medium";
26
+ readonly font: "detail-book-m";
27
+ readonly gap: "2xl";
28
+ readonly navGap: "s";
29
+ readonly input: "large";
30
+ readonly inputWidth: "200px";
31
+ readonly inputPadding: "xl";
32
+ };
33
+ };
34
+ type DensityMode = keyof typeof DENSITY_CONFIG;
35
+ declare const GdsPagination_base: (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").MarginProps) & (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").SizeXProps) & (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").LayoutChildProps) & typeof GdsElement;
36
+ /**
37
+ * @element gds-pagination
38
+ * @status beta
39
+ *
40
+ * @summary A pagination component with page navigation, configurable rows per page, and responsive layout.
41
+ *
42
+ * @event gds-page-change - Fired when the active page changes.
43
+ * @event gds-rows-change - Fired when the rows per page value changes.
44
+ */
45
+ export declare class GdsPagination extends GdsPagination_base {
46
+ #private;
47
+ static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
48
+ /**
49
+ * Sets the active page, initially the first page.
50
+ */
51
+ page: number;
52
+ /**
53
+ * Sets the numbers of rows to show, defaults to 10
54
+ */
55
+ rows: number;
56
+ total: number;
57
+ /**
58
+ * Options array to set the nunber of items per page.
59
+ * Defaults to `[5, 10, 25, 50]`
60
+ */
61
+ options: number[];
62
+ /**
63
+ * Enables first and last button
64
+ */
65
+ jump: boolean;
66
+ /**
67
+ * Controls density mode on pagination
68
+ * Accepts: `comfortable`, `compact`, `spacious`
69
+ */
70
+ density: DensityMode;
71
+ /**
72
+ * The text summary to display on the left side (e.g. "1-10 of 100").
73
+ * If a slot named "label" is provided, this property is ignored.
74
+ */
75
+ label: string;
76
+ private _elInput?;
77
+ private _isMobile;
78
+ private _jumpPopoverOpen;
79
+ private _handleMobile;
80
+ render(): any;
81
+ }
82
+ export {};