@sebgroup/green-core 1.18.0 → 1.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.
Files changed (93) hide show
  1. package/chunks/{chunk.WD3QGIEJ.js → chunk.2V3RCC4W.js} +3 -3
  2. package/chunks/{chunk.CHEU4C5J.js → chunk.3WOE3WRP.js} +2 -2
  3. package/chunks/{chunk.VDWYFSGX.js → chunk.6DIOCJEK.js} +4 -8
  4. package/chunks/{chunk.IYCENQZG.js → chunk.7ET5U6M4.js} +1 -1
  5. package/chunks/{chunk.2LQSDOD4.js → chunk.ATDR2LQS.js} +5 -1
  6. package/chunks/{chunk.Q6AEDXQF.js → chunk.BXQSEF47.js} +18 -22
  7. package/chunks/{chunk.W7SFAX2D.js → chunk.E557RFML.js} +3 -3
  8. package/chunks/{chunk.DBTRYFAB.js → chunk.EVCXHZZV.js} +4 -7
  9. package/chunks/{chunk.XXIQLCV7.js → chunk.F2QPH4SQ.js} +41 -45
  10. package/chunks/{chunk.7ZCWP4FY.js → chunk.H3RHSZBE.js} +2 -2
  11. package/chunks/{chunk.H7YA5KO4.js → chunk.HQQWYXGV.js} +3 -7
  12. package/chunks/{chunk.ZEJDA4NS.js → chunk.JRQ6R42T.js} +4 -8
  13. package/chunks/{chunk.ZKE3WNWY.js → chunk.MSPF6KFQ.js} +1 -1
  14. package/chunks/{chunk.XMPBXAGB.js → chunk.NBEFLQNK.js} +0 -1
  15. package/chunks/{chunk.YIQIH4RW.js → chunk.OBMJAQII.js} +1 -1
  16. package/chunks/{chunk.2Y3BHFKO.js → chunk.PUECQM7D.js} +1 -1
  17. package/chunks/{chunk.URP77GWW.js → chunk.SPH3C7EL.js} +3 -8
  18. package/chunks/{chunk.WEE5C637.js → chunk.TQNYJ3ZV.js} +3 -7
  19. package/chunks/chunk.VOYMQ322.js +1 -1
  20. package/chunks/{chunk.DWSGVBRK.js → chunk.W25MKPJZ.js} +5 -9
  21. package/chunks/chunk.W7CV3QYI.js +105 -0
  22. package/chunks/{chunk.XQ3SZZAO.js → chunk.WD3OOHSN.js} +29 -60
  23. package/chunks/chunk.WDBWUEJJ.js +196 -0
  24. package/chunks/{chunk.MVCYVB3S.js → chunk.WJ5KHFD2.js} +4 -7
  25. package/chunks/{chunk.MMVYFXTU.js → chunk.X2SAPDS5.js} +4 -4
  26. package/chunks/{chunk.I2IU2N5F.js → chunk.XJBBISJT.js} +3 -7
  27. package/components/button/button.js +8 -7
  28. package/components/button/button.trans.styles.js +2 -1
  29. package/components/button/index.js +8 -7
  30. package/components/context-menu/context-menu.d.ts +0 -1
  31. package/components/context-menu/context-menu.js +8 -7
  32. package/components/context-menu/context-menu.trans.styles.js +2 -1
  33. package/components/context-menu/index.js +9 -8
  34. package/components/datepicker/date-part-spinner.js +1 -1
  35. package/components/datepicker/datepicker.d.ts +0 -1
  36. package/components/datepicker/datepicker.js +12 -11
  37. package/components/datepicker/datepicker.trans.styles.js +2 -1
  38. package/components/datepicker/index.js +12 -11
  39. package/components/dropdown/dropdown.d.ts +0 -1
  40. package/components/dropdown/dropdown.js +9 -8
  41. package/components/dropdown/dropdown.trans.styles.js +2 -1
  42. package/components/dropdown/index.js +10 -9
  43. package/components/form-control.js +4 -3
  44. package/components/grid/grid.d.ts +5 -12
  45. package/components/grid/grid.js +6 -3
  46. package/components/grid/grid.style.css.js +1 -1
  47. package/components/grid/index.js +6 -3
  48. package/components/grouped-list/grouped-list.d.ts +0 -1
  49. package/components/grouped-list/grouped-list.js +5 -4
  50. package/components/grouped-list/grouped-list.trans.styles.js +2 -1
  51. package/components/grouped-list/index.js +5 -4
  52. package/components/grouped-list/list-item.js +3 -2
  53. package/components/icon/icon.js +3 -2
  54. package/components/icon/index.js +3 -2
  55. package/components/index.js +26 -25
  56. package/components/input/input.js +5 -4
  57. package/components/segmented-control/index.js +7 -6
  58. package/components/segmented-control/segment/index.js +5 -4
  59. package/components/segmented-control/segment/segment.js +5 -4
  60. package/components/segmented-control/segment/segment.trans.styles.js +2 -1
  61. package/components/segmented-control/segmented-control.d.ts +0 -1
  62. package/components/segmented-control/segmented-control.js +7 -6
  63. package/components/segmented-control/segmented-control.trans.styles.js +2 -1
  64. package/components/theme/index.js +4 -3
  65. package/components/theme/theme.js +4 -3
  66. package/components/theme/theme.trans.styles.js +2 -1
  67. package/controllers/dynamic-styles-controller.d.ts +23 -0
  68. package/dynamic-styles.d.ts +1 -0
  69. package/gds-element.d.ts +3 -0
  70. package/index.js +26 -25
  71. package/package.json +2 -2
  72. package/primitives/calendar/calendar.d.ts +0 -1
  73. package/primitives/calendar/calendar.js +5 -4
  74. package/primitives/calendar/index.js +5 -4
  75. package/primitives/listbox/index.js +6 -5
  76. package/primitives/listbox/listbox.d.ts +0 -1
  77. package/primitives/listbox/listbox.js +6 -5
  78. package/primitives/listbox/option.d.ts +0 -1
  79. package/primitives/listbox/option.js +5 -4
  80. package/primitives/menu/index.js +5 -4
  81. package/primitives/menu/menu-heading.js +4 -3
  82. package/primitives/menu/menu-item.d.ts +0 -1
  83. package/primitives/menu/menu-item.js +4 -3
  84. package/primitives/menu/menu.d.ts +0 -1
  85. package/primitives/menu/menu.js +5 -4
  86. package/primitives/popover/index.js +5 -4
  87. package/primitives/popover/popover.d.ts +0 -1
  88. package/primitives/popover/popover.js +5 -4
  89. package/primitives/ripple/index.js +2 -2
  90. package/primitives/ripple/ripple.js +2 -2
  91. package/transitional-styles.js +2 -1
  92. package/utils/transitional-styles/transitional-styles.d.ts +4 -8
  93. package/chunks/chunk.WIWIGJID.js +0 -244
@@ -1,244 +0,0 @@
1
- import {
2
- grid_style_css_default
3
- } from "./chunk.XMPBXAGB.js";
4
- import {
5
- tokens
6
- } from "./chunk.MMVYFXTU.js";
7
- import {
8
- watch
9
- } from "./chunk.2WO4NHJ2.js";
10
- import {
11
- gdsCustomElement,
12
- html
13
- } from "./chunk.VOYMQ322.js";
14
- import {
15
- __decorateClass,
16
- __spreadProps,
17
- __spreadValues
18
- } from "./chunk.5VURDMKE.js";
19
-
20
- // libs/core/src/components/grid/grid.ts
21
- import { css, LitElement, unsafeCSS } from "lit";
22
- import { property, state } from "lit/decorators.js";
23
- var BreakpointPattern = new RegExp("(?<l>l:([a-z0-9]+))?\\s*(?<m>m:([a-z0-9]+))?\\s*(?<s>s:([a-z0-9]+))?");
24
- var GdsGrid = class extends LitElement {
25
- constructor() {
26
- super(...arguments);
27
- this._gridVariables = {
28
- varsColumn: css``,
29
- varsGap: css``,
30
- varsRowGap: css``,
31
- varsPadding: css``,
32
- varsAutoColumns: css``
33
- };
34
- }
35
- /**
36
- * Lifecycle method called when the element is connected to the DOM.
37
- * It updates the column, gap, and padding variables.
38
- */
39
- connectedCallback() {
40
- super.connectedCallback();
41
- this._updateColumnVariables();
42
- this._updateGapVariables();
43
- this._updateRowGapVariables();
44
- this._updatePaddingVariables();
45
- this._updateAutoColumnsVariables();
46
- }
47
- _updateColumnVariables() {
48
- var _a;
49
- const match = (_a = this.columns) == null ? void 0 : _a.match(BreakpointPattern);
50
- let columnsDesktop, columnsTablet, columnsMobile;
51
- if (this.columns && !isNaN(Number(this.columns))) {
52
- columnsDesktop = columnsTablet = columnsMobile = Number(this.columns);
53
- } else {
54
- const { l, m, s } = (match == null ? void 0 : match.groups) || {};
55
- columnsDesktop = l ? Number(l.split(":")[1]) : void 0;
56
- columnsTablet = m ? Number(m.split(":")[1]) : void 0;
57
- columnsMobile = s ? Number(s.split(":")[1]) : void 0;
58
- }
59
- const columnProperties = [
60
- { name: "_columns-desktop", value: columnsDesktop },
61
- { name: "_columns-tablet", value: columnsTablet },
62
- { name: "_columns-mobile", value: columnsMobile }
63
- ];
64
- const cssVariables = columnProperties.filter(({ value }) => value !== void 0).map(({ name, value }) => `--${name}: ${value};`).join(" ");
65
- this._gridVariables = __spreadProps(__spreadValues({}, this._gridVariables), {
66
- varsColumn: css`
67
- ${unsafeCSS(cssVariables)}
68
- `
69
- });
70
- this.requestUpdate("_gridVariables");
71
- }
72
- _updateGapVariables() {
73
- var _a;
74
- const match = (_a = this.gap) == null ? void 0 : _a.match(BreakpointPattern);
75
- let gapDesktop, gapTablet, gapMobile;
76
- if (this.gap && !this.gap.includes(" ")) {
77
- gapDesktop = gapTablet = gapMobile = `var(--gds-sys-grid-gap-${this.gap})`;
78
- } else {
79
- const { l, m, s } = (match == null ? void 0 : match.groups) || {};
80
- gapDesktop = l ? `var(--gds-sys-grid-gap-${l.split(":")[1]})` : void 0;
81
- gapTablet = m ? `var(--gds-sys-grid-gap-${m.split(":")[1]})` : void 0;
82
- gapMobile = s ? `var(--gds-sys-grid-gap-${s.split(":")[1]})` : void 0;
83
- }
84
- const gapProperties = [
85
- { name: "_gap-desktop", value: gapDesktop },
86
- { name: "_gap-tablet", value: gapTablet },
87
- { name: "_gap-mobile", value: gapMobile }
88
- ];
89
- const cssVariables = gapProperties.filter(({ value }) => value !== void 0).map(({ name, value }) => `--${name}: ${value};`).join(" ");
90
- this._gridVariables = __spreadProps(__spreadValues({}, this._gridVariables), {
91
- varsGap: css`
92
- ${unsafeCSS(cssVariables)}
93
- `
94
- });
95
- this.requestUpdate("_gridVariables");
96
- }
97
- _updateRowGapVariables() {
98
- var _a;
99
- const match = (_a = this.rowGap) == null ? void 0 : _a.match(BreakpointPattern);
100
- let rowGapDesktop, rowGapTablet, rowGapMobile;
101
- if (this.rowGap && !this.rowGap.includes(" ")) {
102
- rowGapDesktop = rowGapTablet = rowGapMobile = `var(--gds-sys-grid-gap-${this.rowGap})`;
103
- } else {
104
- const { l, m, s } = (match == null ? void 0 : match.groups) || {};
105
- rowGapDesktop = l ? `var(--gds-sys-grid-gap-${l.split(":")[1]})` : void 0;
106
- rowGapTablet = m ? `var(--gds-sys-grid-gap-${m.split(":")[1]})` : void 0;
107
- rowGapMobile = s ? `var(--gds-sys-grid-gap-${s.split(":")[1]})` : void 0;
108
- }
109
- const gapProperties = [
110
- { name: "_row-gap-desktop", value: rowGapDesktop },
111
- { name: "_row-gap-tablet", value: rowGapTablet },
112
- { name: "_row-gap-mobile", value: rowGapMobile }
113
- ];
114
- const cssVariables = gapProperties.filter(({ value }) => value !== void 0).map(({ name, value }) => `--${name}: ${value};`).join(" ");
115
- this._gridVariables = __spreadProps(__spreadValues({}, this._gridVariables), {
116
- varsRowGap: css`
117
- ${unsafeCSS(cssVariables)}
118
- `
119
- });
120
- this.requestUpdate("_gridVariables");
121
- }
122
- _updatePaddingVariables() {
123
- var _a;
124
- const match = (_a = this.padding) == null ? void 0 : _a.match(BreakpointPattern);
125
- let paddingDesktop, paddingTablet, paddingMobile;
126
- if (this.padding && !this.padding.includes(" ")) {
127
- paddingDesktop = paddingTablet = paddingMobile = `var(--gds-sys-grid-gap-${this.gap})`;
128
- } else {
129
- const { l, m, s } = (match == null ? void 0 : match.groups) || {};
130
- paddingDesktop = l ? `var(--gds-sys-grid-gap-${l.split(":")[1]})` : void 0;
131
- paddingTablet = m ? `var(--gds-sys-grid-gap-${m.split(":")[1]})` : void 0;
132
- paddingMobile = s ? `var(--gds-sys-grid-gap-${s.split(":")[1]})` : void 0;
133
- }
134
- const paddingProperties = [
135
- { name: "_padding-desktop", value: paddingDesktop },
136
- { name: "_padding-tablet", value: paddingTablet },
137
- { name: "_padding-mobile", value: paddingMobile }
138
- ];
139
- const cssVariables = paddingProperties.filter(({ value }) => value !== void 0).map(({ name, value }) => `--${name}: ${value};`).join(" ");
140
- this._gridVariables = __spreadProps(__spreadValues({}, this._gridVariables), {
141
- varsPadding: css`
142
- ${unsafeCSS(cssVariables)}
143
- `
144
- });
145
- this.requestUpdate("_gridVariables");
146
- }
147
- _updateAutoColumnsVariables() {
148
- var _a;
149
- const match = (_a = this.autoColumns) == null ? void 0 : _a.match(BreakpointPattern);
150
- let widthDesktop, widthTablet, widthMobile;
151
- if (this.autoColumns && !this.autoColumns.includes(" ")) {
152
- widthDesktop = widthTablet = widthMobile = `${this.autoColumns}px`;
153
- } else {
154
- const { l, m, s } = (match == null ? void 0 : match.groups) || {};
155
- widthDesktop = l ? `${l.split(":")[1]}px` : void 0;
156
- widthTablet = m ? `${m.split(":")[1]}px` : void 0;
157
- widthMobile = s ? `${s.split(":")[1]}px` : void 0;
158
- }
159
- const widthProperties = [
160
- { name: "_col-width-mobile", value: widthMobile },
161
- { name: "_col-width-tablet", value: widthTablet },
162
- { name: "_col-width-desktop", value: widthDesktop }
163
- ];
164
- const cssVariables = widthProperties.filter(({ value }) => value !== void 0).map(({ name, value }) => `--${name}: ${value};`).join(" ");
165
- this._gridVariables = __spreadProps(__spreadValues({}, this._gridVariables), {
166
- varsAutoColumns: css`
167
- ${unsafeCSS(cssVariables)}
168
- `
169
- });
170
- this.requestUpdate("_gridVariables");
171
- }
172
- _updateGridCss() {
173
- const sheet = new CSSStyleSheet();
174
- sheet.replaceSync(`:host {${Object.values(this._gridVariables).join("")}} `);
175
- if (this.shadowRoot) {
176
- const styles = Array.isArray(GdsGrid.styles) ? GdsGrid.styles : [GdsGrid.styles];
177
- const styleSheets = styles.flatMap((style) => {
178
- if (Array.isArray(style)) {
179
- return style.map((s) => {
180
- const newSheet = new CSSStyleSheet();
181
- newSheet.replaceSync(s.cssText);
182
- return newSheet;
183
- });
184
- } else {
185
- const newSheet = new CSSStyleSheet();
186
- newSheet.replaceSync(style.cssText);
187
- return [newSheet];
188
- }
189
- });
190
- this.shadowRoot.adoptedStyleSheets = [sheet, ...styleSheets];
191
- }
192
- }
193
- render() {
194
- return html` <slot></slot> `;
195
- }
196
- };
197
- GdsGrid.styles = [tokens, grid_style_css_default];
198
- GdsGrid.shadowRootOptions = {
199
- mode: "open",
200
- delegatesFocus: true
201
- };
202
- __decorateClass([
203
- property({ attribute: "columns", type: String })
204
- ], GdsGrid.prototype, "columns", 2);
205
- __decorateClass([
206
- property({ attribute: "gap", type: String })
207
- ], GdsGrid.prototype, "gap", 2);
208
- __decorateClass([
209
- property({ attribute: "row-gap", type: String })
210
- ], GdsGrid.prototype, "rowGap", 2);
211
- __decorateClass([
212
- property({ attribute: "padding", type: String })
213
- ], GdsGrid.prototype, "padding", 2);
214
- __decorateClass([
215
- property({ attribute: "auto-columns", type: String })
216
- ], GdsGrid.prototype, "autoColumns", 2);
217
- __decorateClass([
218
- state()
219
- ], GdsGrid.prototype, "_gridVariables", 2);
220
- __decorateClass([
221
- watch("columns")
222
- ], GdsGrid.prototype, "_updateColumnVariables", 1);
223
- __decorateClass([
224
- watch("gap")
225
- ], GdsGrid.prototype, "_updateGapVariables", 1);
226
- __decorateClass([
227
- watch("row-gap")
228
- ], GdsGrid.prototype, "_updateRowGapVariables", 1);
229
- __decorateClass([
230
- watch("padding")
231
- ], GdsGrid.prototype, "_updatePaddingVariables", 1);
232
- __decorateClass([
233
- watch("autoColumns")
234
- ], GdsGrid.prototype, "_updateAutoColumnsVariables", 1);
235
- __decorateClass([
236
- watch("_gridVariables")
237
- ], GdsGrid.prototype, "_updateGridCss", 1);
238
- GdsGrid = __decorateClass([
239
- gdsCustomElement("gds-grid")
240
- ], GdsGrid);
241
-
242
- export {
243
- GdsGrid
244
- };