@sebgroup/green-core 1.18.1 → 1.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.
Files changed (128) hide show
  1. package/chunks/{chunk.IQE6F4ZC.js → chunk.2RF5VP6K.js} +10 -24
  2. package/chunks/{chunk.7ZCWP4FY.js → chunk.3KJV6CHY.js} +2 -2
  3. package/chunks/{chunk.TN6ZYAH3.js → chunk.3RYYLMGT.js} +1 -1
  4. package/chunks/{chunk.ZEJDA4NS.js → chunk.5PHLJFEX.js} +4 -8
  5. package/chunks/{chunk.IYCENQZG.js → chunk.6LA2CKUM.js} +1 -1
  6. package/chunks/{chunk.WDJWH2TN.js → chunk.A62LO4CP.js} +1 -1
  7. package/chunks/{chunk.CHEU4C5J.js → chunk.BJCCPLEO.js} +2 -2
  8. package/chunks/{chunk.2Y3BHFKO.js → chunk.BKSMVF4C.js} +9 -1
  9. package/chunks/chunk.C3ECHGX7.js +31 -0
  10. package/chunks/{chunk.WEE5C637.js → chunk.CGZNEIGV.js} +6 -10
  11. package/chunks/{chunk.XXIQLCV7.js → chunk.CH2GIVY6.js} +41 -45
  12. package/chunks/{chunk.Q6AEDXQF.js → chunk.CUR4WRCG.js} +20 -24
  13. package/chunks/{chunk.URP77GWW.js → chunk.EC77QYRA.js} +3 -8
  14. package/chunks/{chunk.2LQSDOD4.js → chunk.EM7MZKG5.js} +12 -5
  15. package/chunks/{chunk.6L4FAOI6.js → chunk.GOOHCUU6.js} +16 -11
  16. package/chunks/{chunk.6NM7ENKA.js → chunk.KBYQYDL3.js} +4 -1
  17. package/chunks/chunk.MURVRI5G.js +0 -0
  18. package/chunks/{chunk.XMPBXAGB.js → chunk.NBEFLQNK.js} +0 -1
  19. package/chunks/{chunk.MVCYVB3S.js → chunk.NRYXPR4Z.js} +4 -7
  20. package/chunks/{chunk.DBTRYFAB.js → chunk.NYOCHFZE.js} +5 -8
  21. package/chunks/{chunk.I2IU2N5F.js → chunk.PE6MD3MB.js} +3 -7
  22. package/chunks/{chunk.VDWYFSGX.js → chunk.RSCI4LL2.js} +5 -9
  23. package/chunks/chunk.TJA7LL3V.js +0 -0
  24. package/chunks/chunk.V7ZQ5N3U.js +0 -0
  25. package/chunks/{chunk.ETETI45J.js → chunk.VHKGMBUL.js} +3 -3
  26. package/chunks/chunk.VHN4JEZC.js +28 -0
  27. package/chunks/chunk.VOYMQ322.js +1 -1
  28. package/chunks/{chunk.3CAFC46K.js → chunk.W2XAWNZY.js} +4 -4
  29. package/chunks/chunk.W7CV3QYI.js +105 -0
  30. package/chunks/{chunk.YIQIH4RW.js → chunk.XOARVFGN.js} +1 -1
  31. package/chunks/chunk.Y42J4CV3.js +86 -0
  32. package/chunks/chunk.YBOK7MI7.js +31 -0
  33. package/chunks/chunk.YDYO7HP5.js +196 -0
  34. package/chunks/chunk.YEV6STTM.js +201 -0
  35. package/chunks/{chunk.H7YA5KO4.js → chunk.Z5NACNXH.js} +7 -23
  36. package/chunks/{chunk.XQ3SZZAO.js → chunk.ZLWSCK7R.js} +174 -119
  37. package/components/badge/badge.js +1 -1
  38. package/components/button/button.js +10 -9
  39. package/components/button/button.trans.styles.js +2 -1
  40. package/components/button/index.js +11 -9
  41. package/components/checkbox/checkbox.js +1 -1
  42. package/components/context-menu/context-menu.d.ts +0 -1
  43. package/components/context-menu/context-menu.js +9 -9
  44. package/components/context-menu/context-menu.trans.styles.js +2 -1
  45. package/components/context-menu/index.js +10 -10
  46. package/components/datepicker/date-part-spinner.js +1 -1
  47. package/components/datepicker/datepicker.d.ts +0 -1
  48. package/components/datepicker/datepicker.js +14 -13
  49. package/components/datepicker/datepicker.trans.styles.js +2 -1
  50. package/components/datepicker/index.js +14 -13
  51. package/components/dropdown/dropdown.d.ts +0 -1
  52. package/components/dropdown/dropdown.js +10 -10
  53. package/components/dropdown/dropdown.trans.styles.js +2 -1
  54. package/components/dropdown/index.js +11 -11
  55. package/components/filter-chips/filter-chip/filter-chip.d.ts +22 -0
  56. package/components/filter-chips/filter-chip/filter-chip.js +24 -0
  57. package/components/filter-chips/filter-chip/filter-chip.styles.d.ts +1 -0
  58. package/components/filter-chips/filter-chip/filter-chip.trans.styles.d.ts +2 -0
  59. package/components/filter-chips/filter-chip/filter-chip.trans.styles.js +11 -0
  60. package/components/filter-chips/filter-chip/index.d.ts +1 -0
  61. package/components/filter-chips/filter-chip/index.js +25 -0
  62. package/components/filter-chips/filter-chips.d.ts +36 -0
  63. package/components/filter-chips/filter-chips.js +28 -0
  64. package/components/filter-chips/filter-chips.styles.d.ts +1 -0
  65. package/components/filter-chips/filter-chips.trans.styles.d.ts +2 -0
  66. package/components/filter-chips/filter-chips.trans.styles.js +11 -0
  67. package/components/filter-chips/index.d.ts +2 -0
  68. package/components/filter-chips/index.js +32 -0
  69. package/components/form-control.js +4 -3
  70. package/components/grid/grid.d.ts +5 -12
  71. package/components/grid/grid.js +6 -3
  72. package/components/grid/grid.style.css.js +1 -1
  73. package/components/grid/index.js +6 -3
  74. package/components/grouped-list/grouped-list.d.ts +0 -1
  75. package/components/grouped-list/grouped-list.js +6 -6
  76. package/components/grouped-list/grouped-list.trans.styles.js +2 -1
  77. package/components/grouped-list/index.js +6 -6
  78. package/components/grouped-list/list-item.js +3 -2
  79. package/components/icon/icon.js +3 -2
  80. package/components/icon/index.js +4 -2
  81. package/components/index.d.ts +1 -0
  82. package/components/index.js +47 -32
  83. package/components/input/input.js +15 -39
  84. package/components/radio/radio-group.js +2 -2
  85. package/components/radio/radio.js +2 -2
  86. package/components/segmented-control/index.js +8 -7
  87. package/components/segmented-control/segment/index.js +5 -5
  88. package/components/segmented-control/segment/segment.js +5 -5
  89. package/components/segmented-control/segment/segment.trans.styles.js +2 -1
  90. package/components/segmented-control/segmented-control.d.ts +0 -2
  91. package/components/segmented-control/segmented-control.js +8 -7
  92. package/components/segmented-control/segmented-control.trans.styles.js +2 -1
  93. package/components/switch/switch.js +1 -1
  94. package/components/theme/index.js +4 -4
  95. package/components/theme/theme.js +4 -4
  96. package/components/theme/theme.trans.styles.js +3 -2
  97. package/controllers/dynamic-styles-controller.d.ts +23 -0
  98. package/dynamic-styles.d.ts +1 -0
  99. package/gds-element.d.ts +3 -0
  100. package/index.js +47 -32
  101. package/package.json +1 -1
  102. package/primitives/calendar/calendar.d.ts +0 -1
  103. package/primitives/calendar/calendar.js +5 -5
  104. package/primitives/calendar/index.js +5 -5
  105. package/primitives/listbox/index.js +6 -6
  106. package/primitives/listbox/listbox.d.ts +0 -1
  107. package/primitives/listbox/listbox.js +6 -6
  108. package/primitives/listbox/option.d.ts +0 -1
  109. package/primitives/listbox/option.js +5 -5
  110. package/primitives/menu/index.js +5 -5
  111. package/primitives/menu/menu-heading.js +4 -4
  112. package/primitives/menu/menu-item.d.ts +0 -1
  113. package/primitives/menu/menu-item.js +4 -4
  114. package/primitives/menu/menu.d.ts +0 -1
  115. package/primitives/menu/menu.js +5 -5
  116. package/primitives/popover/index.js +5 -5
  117. package/primitives/popover/popover.d.ts +0 -1
  118. package/primitives/popover/popover.js +5 -5
  119. package/primitives/ripple/index.js +2 -2
  120. package/primitives/ripple/ripple.js +2 -2
  121. package/transitional-styles.js +2 -2
  122. package/utils/decorators/resize-observer.d.ts +15 -0
  123. package/utils/directives/forward-attributes.d.ts +17 -0
  124. package/utils/helpers/attribute-converters.d.ts +14 -0
  125. package/utils/transitional-styles/transitional-styles.d.ts +4 -8
  126. package/chunks/chunk.X7MGCODG.js +0 -244
  127. /package/chunks/{chunk.HS7ICQNA.js → chunk.4ZADZSWE.js} +0 -0
  128. /package/chunks/{chunk.RSZ4ZUN3.js → chunk.JGTSJ4J6.js} +0 -0
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk.DFYMYEGD.js";
5
5
  import {
6
6
  TransitionalStyles
7
- } from "./chunk.XQ3SZZAO.js";
7
+ } from "./chunk.ZLWSCK7R.js";
8
8
  import {
9
9
  GdsElement
10
- } from "./chunk.2LQSDOD4.js";
10
+ } from "./chunk.EM7MZKG5.js";
11
11
  import {
12
12
  watch
13
13
  } from "./chunk.2WO4NHJ2.js";
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk.5VURDMKE.js";
23
23
 
24
24
  // libs/core/src/primitives/listbox/listbox.ts
25
- import { property, state } from "lit/decorators.js";
25
+ import { property } from "lit/decorators.js";
26
26
  import { createRef, ref } from "lit/directives/ref.js";
27
27
  import "reflect-metadata";
28
28
 
@@ -121,7 +121,7 @@ var GdsListbox = class extends GdsElement {
121
121
  (_a = this.visibleSelectedOptionElements[0] || this.visibleOptionElements[0]) == null ? void 0 : _a.focus();
122
122
  }
123
123
  render() {
124
- return html`${this._tStyles}<slot ${ref(__privateGet(this, _slotRef))}></slot>`;
124
+ return html`<slot ${ref(__privateGet(this, _slotRef))}></slot>`;
125
125
  }
126
126
  _rerenderOptions() {
127
127
  this.options.forEach((el) => {
@@ -146,9 +146,6 @@ __decorateClass([
146
146
  __decorateClass([
147
147
  property()
148
148
  ], GdsListbox.prototype, "compareWith", 2);
149
- __decorateClass([
150
- state()
151
- ], GdsListbox.prototype, "_tStyles", 2);
152
149
  __decorateClass([
153
150
  watch("multiple")
154
151
  ], GdsListbox.prototype, "_rerenderOptions", 1);
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  TransitionalStyles
3
- } from "./chunk.XQ3SZZAO.js";
3
+ } from "./chunk.ZLWSCK7R.js";
4
4
  import {
5
5
  GdsElement
6
- } from "./chunk.2LQSDOD4.js";
6
+ } from "./chunk.EM7MZKG5.js";
7
7
  import {
8
8
  constrainSlots
9
- } from "./chunk.6NM7ENKA.js";
9
+ } from "./chunk.KBYQYDL3.js";
10
10
  import {
11
11
  gdsCustomElement,
12
12
  html
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk.5VURDMKE.js";
17
17
 
18
18
  // libs/core/src/components/grouped-list/grouped-list.ts
19
- import { state, property } from "lit/decorators.js";
19
+ import { property } from "lit/decorators.js";
20
20
  import { when } from "lit/directives/when.js";
21
21
  var GdsGroupedList = class extends GdsElement {
22
22
  constructor() {
@@ -29,7 +29,7 @@ var GdsGroupedList = class extends GdsElement {
29
29
  TransitionalStyles.instance.apply(this, "gds-grouped-list");
30
30
  }
31
31
  render() {
32
- return html`${this._tStyles}${when(
32
+ return html`${when(
33
33
  this.label,
34
34
  () => html`<div class="gds-list-heading" aria-hidden="true" id="label">
35
35
  ${this.label}
@@ -40,9 +40,6 @@ var GdsGroupedList = class extends GdsElement {
40
40
  </div>`;
41
41
  }
42
42
  };
43
- __decorateClass([
44
- state()
45
- ], GdsGroupedList.prototype, "_tStyles", 2);
46
43
  __decorateClass([
47
44
  property()
48
45
  ], GdsGroupedList.prototype, "label", 2);
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk.DFYMYEGD.js";
5
5
  import {
6
6
  TransitionalStyles
7
- } from "./chunk.XQ3SZZAO.js";
7
+ } from "./chunk.ZLWSCK7R.js";
8
8
  import {
9
9
  GdsElement
10
- } from "./chunk.2LQSDOD4.js";
10
+ } from "./chunk.EM7MZKG5.js";
11
11
  import {
12
12
  gdsCustomElement,
13
13
  html
@@ -20,7 +20,6 @@ import {
20
20
 
21
21
  // libs/core/src/primitives/menu/menu.ts
22
22
  import { createRef, ref } from "lit/directives/ref.js";
23
- import { state } from "lit/decorators.js";
24
23
  var _slotRef;
25
24
  var GdsMenu = class extends GdsElement {
26
25
  constructor() {
@@ -48,13 +47,10 @@ var GdsMenu = class extends GdsElement {
48
47
  (_a = this.navigableItems[0]) == null ? void 0 : _a.focus();
49
48
  }
50
49
  render() {
51
- return html`${this._tStyles}<slot ${ref(__privateGet(this, _slotRef))}></slot>`;
50
+ return html`<slot ${ref(__privateGet(this, _slotRef))}></slot>`;
52
51
  }
53
52
  };
54
53
  _slotRef = new WeakMap();
55
- __decorateClass([
56
- state()
57
- ], GdsMenu.prototype, "_tStyles", 2);
58
54
  GdsMenu = __decorateClass([
59
55
  gdsCustomElement("gds-menu")
60
56
  ], GdsMenu);
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  TransitionalStyles
3
- } from "./chunk.XQ3SZZAO.js";
3
+ } from "./chunk.ZLWSCK7R.js";
4
4
  import {
5
5
  GdsElement
6
- } from "./chunk.2LQSDOD4.js";
6
+ } from "./chunk.EM7MZKG5.js";
7
7
  import {
8
8
  constrainSlots
9
- } from "./chunk.6NM7ENKA.js";
9
+ } from "./chunk.KBYQYDL3.js";
10
10
  import {
11
11
  gdsCustomElement,
12
12
  html
@@ -21,7 +21,7 @@ import {
21
21
  import { nothing } from "lit";
22
22
  import { msg } from "@lit/localize";
23
23
  import { classMap } from "lit-html/directives/class-map.js";
24
- import { property, queryAsync, state } from "lit/decorators.js";
24
+ import { property, queryAsync } from "lit/decorators.js";
25
25
 
26
26
  // libs/core/src/components/context-menu/context-menu.styles.ts
27
27
  import { css } from "lit";
@@ -73,8 +73,7 @@ var GdsContextMenu = class extends GdsElement {
73
73
  }
74
74
  render() {
75
75
  var _a, _b, _c;
76
- return html`${this._tStyles}
77
- <button
76
+ return html`<button
78
77
  id="trigger"
79
78
  class="icon border-0 small ${classMap({ highlighted: this.open })}"
80
79
  aria-label=${(_a = this.buttonLabel) != null ? _a : this.label}
@@ -138,9 +137,6 @@ __decorateClass([
138
137
  __decorateClass([
139
138
  property()
140
139
  ], GdsContextMenu.prototype, "placement", 2);
141
- __decorateClass([
142
- state()
143
- ], GdsContextMenu.prototype, "_tStyles", 2);
144
140
  __decorateClass([
145
141
  queryAsync("#trigger")
146
142
  ], GdsContextMenu.prototype, "elTriggerBtn", 2);
File without changes
File without changes
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  tokens
3
- } from "./chunk.3CAFC46K.js";
3
+ } from "./chunk.W2XAWNZY.js";
4
4
  import {
5
5
  TransitionalStyles
6
- } from "./chunk.XQ3SZZAO.js";
6
+ } from "./chunk.ZLWSCK7R.js";
7
7
  import {
8
8
  GdsElement
9
- } from "./chunk.2LQSDOD4.js";
9
+ } from "./chunk.EM7MZKG5.js";
10
10
  import {
11
11
  gdsCustomElement,
12
12
  html
@@ -0,0 +1,28 @@
1
+ // libs/core/src/utils/decorators/resize-observer.ts
2
+ function resizeObserver() {
3
+ return (proto, propertyKey, descriptor) => {
4
+ const connectedCallback = proto.connectedCallback;
5
+ const disconnectedCallback = proto.disconnectedCallback;
6
+ proto.connectedCallback = function() {
7
+ connectedCallback == null ? void 0 : connectedCallback.call(this);
8
+ this.__resizeObservers = this.__resizeObservers || {};
9
+ this.__resizeObserver_tids = this.__resizeObserver_tids || {};
10
+ this.__resizeObservers[propertyKey] = new ResizeObserver(() => {
11
+ this.__resizeObserver_tids[propertyKey] && clearTimeout(this.__resizeObserver_tids[propertyKey]);
12
+ this.__resizeObserver_tids[propertyKey] = setTimeout(() => {
13
+ var _a;
14
+ (_a = descriptor.value) == null ? void 0 : _a.call(this);
15
+ }, 20);
16
+ });
17
+ this.__resizeObservers[propertyKey].observe(this);
18
+ };
19
+ proto.disconnectedCallback = function() {
20
+ disconnectedCallback == null ? void 0 : disconnectedCallback.call(this);
21
+ this.__resizeObservers[propertyKey].disconnect();
22
+ };
23
+ };
24
+ }
25
+
26
+ export {
27
+ resizeObserver
28
+ };
@@ -1,7 +1,7 @@
1
1
  // libs/core/src/utils/helpers/custom-element-scoping.ts
2
2
  import { html as litHtml } from "lit";
3
3
  import { customElement } from "lit/decorators.js";
4
- var VER_SUFFIX = "-7b50f8";
4
+ var VER_SUFFIX = "-9f7153";
5
5
  var elementLookupTable = /* @__PURE__ */ new Map();
6
6
  var gdsCustomElement = (tagName) => {
7
7
  if (globalThis.GDS_DISABLE_VERSIONED_ELEMENTS) {
@@ -4,7 +4,7 @@ import { unsafeCSS } from "lit";
4
4
  // dist/libs/tokens/internal/pallet.css
5
5
  var pallet_default = `/**
6
6
  * Do not edit directly
7
- * Generated on Thu, 02 May 2024 15:01:33 GMT
7
+ * Generated on Fri, 17 May 2024 12:50:34 GMT
8
8
  */
9
9
 
10
10
  :host {
@@ -165,7 +165,7 @@ var pallet_default = `/**
165
165
  // dist/libs/tokens/internal/theme/light.css
166
166
  var light_default = `/**
167
167
  * Do not edit directly
168
- * Generated on Thu, 02 May 2024 15:01:33 GMT
168
+ * Generated on Fri, 17 May 2024 12:50:34 GMT
169
169
  */
170
170
 
171
171
  :host {
@@ -286,7 +286,7 @@ var light_default = `/**
286
286
  // dist/libs/tokens/internal/size.css
287
287
  var size_default = `/**
288
288
  * Do not edit directly
289
- * Generated on Thu, 02 May 2024 15:01:33 GMT
289
+ * Generated on Fri, 17 May 2024 12:50:34 GMT
290
290
  */
291
291
 
292
292
  :host {
@@ -532,7 +532,7 @@ var size_default = `/**
532
532
  // dist/libs/tokens/internal/motion.css
533
533
  var motion_default = `/**
534
534
  * Do not edit directly
535
- * Generated on Thu, 02 May 2024 15:01:33 GMT
535
+ * Generated on Fri, 17 May 2024 12:50:34 GMT
536
536
  */
537
537
 
538
538
  :host {
@@ -0,0 +1,105 @@
1
+ import {
2
+ __privateAdd,
3
+ __privateGet,
4
+ __privateMethod,
5
+ __privateSet
6
+ } from "./chunk.5VURDMKE.js";
7
+
8
+ // libs/core/src/controllers/dynamic-styles-controller.ts
9
+ var _useLegacyStylesheets, _initialStyleSheets, _styleSheets, _legacyStyleSheets, _applyStylesLegacy, applyStylesLegacy_fn, _applyStyles, applyStyles_fn;
10
+ var DynamicStylesController = class {
11
+ constructor(host) {
12
+ __privateAdd(this, _applyStylesLegacy);
13
+ __privateAdd(this, _applyStyles);
14
+ __privateAdd(this, _useLegacyStylesheets, !supportsConstructedStylesheets());
15
+ __privateAdd(this, _initialStyleSheets, []);
16
+ __privateAdd(this, _styleSheets, /* @__PURE__ */ new Map());
17
+ __privateAdd(this, _legacyStyleSheets, /* @__PURE__ */ new Map());
18
+ this.host = host;
19
+ this.host.addController(this);
20
+ }
21
+ hostConnected() {
22
+ if (this.host.shadowRoot && __privateGet(this, _initialStyleSheets).length === 0) {
23
+ __privateSet(this, _initialStyleSheets, [
24
+ ...this.host.shadowRoot.adoptedStyleSheets || []
25
+ ]);
26
+ }
27
+ }
28
+ /**
29
+ * Injects CSS into the host element's shadow root. The key is used to
30
+ * identify the styles and can be used to update the styles later. If
31
+ * you need to clear style for a particular key, you can call `inject`
32
+ * with an empty string as the `styles` parameter.
33
+ *
34
+ * @param key - A unique key to identify the styles.
35
+ * @param styles - The CSSResult to inject.
36
+ */
37
+ inject(key, styles) {
38
+ const cssText = Array.isArray(styles) ? styles.map((style) => style.toString()).join("") : styles.toString();
39
+ if (__privateGet(this, _useLegacyStylesheets)) {
40
+ __privateMethod(this, _applyStylesLegacy, applyStylesLegacy_fn).call(this, key, cssText);
41
+ } else {
42
+ __privateMethod(this, _applyStyles, applyStyles_fn).call(this, key, cssText);
43
+ }
44
+ }
45
+ /**
46
+ * Clears all styles of the component, including any initial styles.
47
+ */
48
+ clearAll() {
49
+ var _a;
50
+ if (__privateGet(this, _useLegacyStylesheets)) {
51
+ __privateGet(this, _legacyStyleSheets).forEach((styleEl) => styleEl.remove());
52
+ (_a = this.host.shadowRoot) == null ? void 0 : _a.querySelectorAll("style").forEach((style) => style.innerHTML = "");
53
+ __privateGet(this, _legacyStyleSheets).clear();
54
+ } else {
55
+ if (this.host.shadowRoot) {
56
+ this.host.shadowRoot.adoptedStyleSheets = [];
57
+ __privateGet(this, _styleSheets).clear();
58
+ __privateSet(this, _initialStyleSheets, []);
59
+ }
60
+ }
61
+ }
62
+ };
63
+ _useLegacyStylesheets = new WeakMap();
64
+ _initialStyleSheets = new WeakMap();
65
+ _styleSheets = new WeakMap();
66
+ _legacyStyleSheets = new WeakMap();
67
+ _applyStylesLegacy = new WeakSet();
68
+ applyStylesLegacy_fn = function(key, cssText) {
69
+ var _a;
70
+ let styleEl = __privateGet(this, _legacyStyleSheets).get(key);
71
+ if (!styleEl) {
72
+ styleEl = document.createElement("style");
73
+ __privateGet(this, _legacyStyleSheets).set(key, styleEl);
74
+ }
75
+ styleEl.textContent = cssText;
76
+ (_a = this.host.shadowRoot) == null ? void 0 : _a.appendChild(styleEl);
77
+ };
78
+ _applyStyles = new WeakSet();
79
+ applyStyles_fn = function(key, cssText) {
80
+ if (!this.host.shadowRoot)
81
+ return;
82
+ let styleSheet = __privateGet(this, _styleSheets).get(key);
83
+ if (!styleSheet) {
84
+ styleSheet = new CSSStyleSheet();
85
+ __privateGet(this, _styleSheets).set(key, styleSheet);
86
+ }
87
+ styleSheet.replaceSync(cssText);
88
+ this.host.shadowRoot.adoptedStyleSheets = [
89
+ ...__privateGet(this, _initialStyleSheets),
90
+ ...Array.from(__privateGet(this, _styleSheets).values())
91
+ ];
92
+ };
93
+ function supportsConstructedStylesheets() {
94
+ try {
95
+ new CSSStyleSheet();
96
+ return true;
97
+ } catch (e) {
98
+ return false;
99
+ }
100
+ }
101
+
102
+ export {
103
+ DynamicStylesController,
104
+ supportsConstructedStylesheets
105
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GdsElement
3
- } from "./chunk.2LQSDOD4.js";
3
+ } from "./chunk.EM7MZKG5.js";
4
4
  import {
5
5
  watch
6
6
  } from "./chunk.2WO4NHJ2.js";
@@ -0,0 +1,86 @@
1
+ import {
2
+ TransitionalStyles
3
+ } from "./chunk.ZLWSCK7R.js";
4
+ import {
5
+ GdsElement
6
+ } from "./chunk.EM7MZKG5.js";
7
+ import {
8
+ gdsCustomElement,
9
+ getScopedTagName,
10
+ html
11
+ } from "./chunk.VOYMQ322.js";
12
+ import {
13
+ __decorateClass
14
+ } from "./chunk.5VURDMKE.js";
15
+
16
+ // libs/core/src/components/filter-chips/filter-chip/filter-chip.ts
17
+ import { property, queryAsync } from "lit/decorators.js";
18
+ import { classMap } from "lit/directives/class-map.js";
19
+
20
+ // libs/core/src/components/filter-chips/filter-chip/filter-chip.styles.ts
21
+ import { css } from "lit";
22
+ var styles = css`
23
+ @layer base, reset, transitional-styles;
24
+ @layer base {
25
+ .btn-p {
26
+ padding: 0 0.75rem;
27
+ }
28
+ .icon {
29
+ width: 1rem;
30
+ }
31
+ }
32
+ `;
33
+
34
+ // libs/core/src/components/filter-chips/filter-chip/filter-chip.ts
35
+ var GdsFilterChip = class extends GdsElement {
36
+ constructor() {
37
+ super(...arguments);
38
+ this.selected = false;
39
+ }
40
+ connectedCallback() {
41
+ super.connectedCallback();
42
+ this.setAttribute("role", "none");
43
+ TransitionalStyles.instance.apply(this, "gds-filter-chip");
44
+ this._button.then((btn) => {
45
+ TransitionalStyles.instance.apply(btn, "gds-button");
46
+ });
47
+ }
48
+ render() {
49
+ const btnClasses = {
50
+ "btn-p": !this.selected
51
+ };
52
+ return html`<gds-button
53
+ class="btn"
54
+ size="small"
55
+ .rank=${this.selected ? "primary" : "secondary"}
56
+ variant=${this._isUsingTransitionalStyles ? "ghost" : "default"}
57
+ gds-role="option"
58
+ gds-aria-selected=${this.selected}
59
+ >
60
+ <span class=${classMap(btnClasses)}><slot></slot></span>
61
+ <gds-icon
62
+ name="checkmark"
63
+ slot="trail"
64
+ style="display: ${this.selected ? "block" : "none"}"
65
+ class="icon"
66
+ ></gds-icon>
67
+ </gds-button>`;
68
+ }
69
+ };
70
+ GdsFilterChip.styles = [styles];
71
+ __decorateClass([
72
+ property({ reflect: true, type: Boolean })
73
+ ], GdsFilterChip.prototype, "selected", 2);
74
+ __decorateClass([
75
+ property()
76
+ ], GdsFilterChip.prototype, "value", 2);
77
+ __decorateClass([
78
+ queryAsync(getScopedTagName("gds-button"))
79
+ ], GdsFilterChip.prototype, "_button", 2);
80
+ GdsFilterChip = __decorateClass([
81
+ gdsCustomElement("gds-filter-chip")
82
+ ], GdsFilterChip);
83
+
84
+ export {
85
+ GdsFilterChip
86
+ };
@@ -0,0 +1,31 @@
1
+ // libs/core/src/utils/directives/forward-attributes.ts
2
+ import { Directive, PartType, directive } from "lit/directive.js";
3
+ import { nothing } from "lit/html.js";
4
+ var ForwardAttributesDirective = class extends Directive {
5
+ constructor(partInfo) {
6
+ super(partInfo);
7
+ if (partInfo.type !== PartType.ELEMENT) {
8
+ throw new Error(
9
+ "The `forwardAttributes` directive must be used in element bindings"
10
+ );
11
+ }
12
+ }
13
+ render(_filter) {
14
+ return nothing;
15
+ }
16
+ update(part, [filter]) {
17
+ var _a;
18
+ const element = part.element;
19
+ const host = (_a = part.options) == null ? void 0 : _a.host;
20
+ Array.from(host.attributes).forEach((attr) => {
21
+ if (filter(attr)) {
22
+ element.setAttribute(attr.name.replace("gds-", ""), attr.value);
23
+ }
24
+ });
25
+ }
26
+ };
27
+ var forwardAttributes = directive(ForwardAttributesDirective);
28
+
29
+ export {
30
+ forwardAttributes
31
+ };
@@ -0,0 +1,196 @@
1
+ import {
2
+ grid_style_css_default
3
+ } from "./chunk.NBEFLQNK.js";
4
+ import {
5
+ tokens
6
+ } from "./chunk.W2XAWNZY.js";
7
+ import {
8
+ GdsElement
9
+ } from "./chunk.EM7MZKG5.js";
10
+ import {
11
+ watch
12
+ } from "./chunk.2WO4NHJ2.js";
13
+ import {
14
+ gdsCustomElement,
15
+ html
16
+ } from "./chunk.VOYMQ322.js";
17
+ import {
18
+ __decorateClass,
19
+ __privateAdd,
20
+ __privateGet,
21
+ __privateSet,
22
+ __spreadProps,
23
+ __spreadValues
24
+ } from "./chunk.5VURDMKE.js";
25
+
26
+ // libs/core/src/components/grid/grid.ts
27
+ import { css, unsafeCSS } from "lit";
28
+ import { property } from "lit/decorators.js";
29
+ var BreakpointPattern = new RegExp("(?<l>l:([a-z0-9]+))?\\s*(?<m>m:([a-z0-9]+))?\\s*(?<s>s:([a-z0-9]+))?");
30
+ var _gridVariables;
31
+ var GdsGrid = class extends GdsElement {
32
+ constructor() {
33
+ super(...arguments);
34
+ /**
35
+ * State variable that holds the CSS variables for column, gap, and padding.
36
+ */
37
+ __privateAdd(this, _gridVariables, {
38
+ varsColumn: css``,
39
+ varsGap: css``,
40
+ varsRowGap: css``,
41
+ varsPadding: css``,
42
+ varsAutoColumns: css``
43
+ });
44
+ }
45
+ /**
46
+ * Lifecycle method called when the element is connected to the DOM.
47
+ * It updates the column, gap, and padding variables.
48
+ */
49
+ connectedCallback() {
50
+ super.connectedCallback();
51
+ this._updateColumnVariables();
52
+ this._updateGapVariables();
53
+ this._updateRowGapVariables();
54
+ this._updatePaddingVariables();
55
+ this._updateAutoColumnsVariables();
56
+ }
57
+ _updateCSSVariables(propertyName, propertyPrefix) {
58
+ let propertyValue;
59
+ if (propertyName in this) {
60
+ propertyValue = this[propertyName];
61
+ }
62
+ const match = (propertyValue == null ? void 0 : propertyValue.match(BreakpointPattern)) || null;
63
+ let desktop;
64
+ let tablet;
65
+ let mobile;
66
+ const { l, m, s } = (match == null ? void 0 : match.groups) || {};
67
+ const processBreakpoints = (l2, m2, s2) => {
68
+ const desktop2 = l2 ? `var(--gds-sys-grid-gap-${l2.split(":")[1]})` : void 0;
69
+ const tablet2 = m2 ? `var(--gds-sys-grid-gap-${m2.split(":")[1]})` : void 0;
70
+ const mobile2 = s2 ? `var(--gds-sys-grid-gap-${s2.split(":")[1]})` : void 0;
71
+ return { desktop: desktop2, tablet: tablet2, mobile: mobile2 };
72
+ };
73
+ if (propertyName === "columns") {
74
+ if (this.columns && !isNaN(Number(this.columns))) {
75
+ desktop = tablet = mobile = Number(this.columns);
76
+ } else {
77
+ desktop = l ? l.split(":")[1] : void 0;
78
+ tablet = m ? m.split(":")[1] : void 0;
79
+ mobile = s ? s.split(":")[1] : void 0;
80
+ }
81
+ }
82
+ if (propertyName === "gap") {
83
+ if (this.gap && !this.gap.includes(" ")) {
84
+ desktop = tablet = mobile = `var(--gds-sys-grid-gap-${this.gap})`;
85
+ } else {
86
+ ;
87
+ ({ desktop, tablet, mobile } = processBreakpoints(l, m, s));
88
+ }
89
+ }
90
+ if (propertyName === "rowGap") {
91
+ if (this.rowGap && !this.rowGap.includes(" ")) {
92
+ desktop = tablet = mobile = `var(--gds-sys-grid-gap-${this.rowGap})`;
93
+ } else {
94
+ ;
95
+ ({ desktop, tablet, mobile } = processBreakpoints(l, m, s));
96
+ }
97
+ }
98
+ if (propertyName === "padding") {
99
+ if (this.padding && !this.padding.includes(" ")) {
100
+ desktop = tablet = mobile = `var(--gds-sys-grid-gap-${this.padding})`;
101
+ } else {
102
+ ;
103
+ ({ desktop, tablet, mobile } = processBreakpoints(l, m, s));
104
+ }
105
+ }
106
+ if (propertyName === "auto-columns") {
107
+ if (this.autoColumns && !this.autoColumns.includes(" ")) {
108
+ desktop = tablet = mobile = `${this.autoColumns}px`;
109
+ } else {
110
+ desktop = l ? `${l.split(":")[1]}px` : void 0;
111
+ tablet = m ? `${m.split(":")[1]}px` : void 0;
112
+ mobile = s ? `${s.split(":")[1]}px` : void 0;
113
+ }
114
+ }
115
+ const properties = [
116
+ { name: `${propertyPrefix}-desktop`, value: desktop },
117
+ { name: `${propertyPrefix}-tablet`, value: tablet },
118
+ { name: `${propertyPrefix}-mobile`, value: mobile }
119
+ ];
120
+ const cssVariables = properties.filter(({ value }) => value !== void 0).map(({ name, value }) => `--_${name}: ${value};`).join(" ");
121
+ __privateSet(this, _gridVariables, __spreadProps(__spreadValues({}, __privateGet(this, _gridVariables)), {
122
+ [propertyPrefix]: css`
123
+ ${unsafeCSS(cssVariables)}
124
+ `
125
+ }));
126
+ this._dynamicStylesController.inject(
127
+ "grid-vars",
128
+ css`
129
+ :host {
130
+ ${unsafeCSS(Object.values(__privateGet(this, _gridVariables)).join(""))}
131
+ }
132
+ `
133
+ );
134
+ }
135
+ _updateColumnVariables() {
136
+ this._updateCSSVariables("columns", "columns");
137
+ }
138
+ _updateGapVariables() {
139
+ this._updateCSSVariables("gap", "gap");
140
+ }
141
+ _updateRowGapVariables() {
142
+ this._updateCSSVariables("rowGap", "row-gap");
143
+ }
144
+ _updatePaddingVariables() {
145
+ this._updateCSSVariables("padding", "padding");
146
+ }
147
+ _updateAutoColumnsVariables() {
148
+ this._updateCSSVariables("auto-columns", "col-width");
149
+ }
150
+ render() {
151
+ return html`<slot></slot>`;
152
+ }
153
+ };
154
+ _gridVariables = new WeakMap();
155
+ GdsGrid.styles = [tokens, grid_style_css_default];
156
+ GdsGrid.shadowRootOptions = {
157
+ mode: "open",
158
+ delegatesFocus: true
159
+ };
160
+ __decorateClass([
161
+ property({ attribute: "columns", type: String })
162
+ ], GdsGrid.prototype, "columns", 2);
163
+ __decorateClass([
164
+ property({ attribute: "gap", type: String })
165
+ ], GdsGrid.prototype, "gap", 2);
166
+ __decorateClass([
167
+ property({ attribute: "row-gap", type: String })
168
+ ], GdsGrid.prototype, "rowGap", 2);
169
+ __decorateClass([
170
+ property({ attribute: "padding", type: String })
171
+ ], GdsGrid.prototype, "padding", 2);
172
+ __decorateClass([
173
+ property({ attribute: "auto-columns", type: String })
174
+ ], GdsGrid.prototype, "autoColumns", 2);
175
+ __decorateClass([
176
+ watch("columns")
177
+ ], GdsGrid.prototype, "_updateColumnVariables", 1);
178
+ __decorateClass([
179
+ watch("gap")
180
+ ], GdsGrid.prototype, "_updateGapVariables", 1);
181
+ __decorateClass([
182
+ watch("row-gap")
183
+ ], GdsGrid.prototype, "_updateRowGapVariables", 1);
184
+ __decorateClass([
185
+ watch("padding")
186
+ ], GdsGrid.prototype, "_updatePaddingVariables", 1);
187
+ __decorateClass([
188
+ watch("autoColumns")
189
+ ], GdsGrid.prototype, "_updateAutoColumnsVariables", 1);
190
+ GdsGrid = __decorateClass([
191
+ gdsCustomElement("gds-grid")
192
+ ], GdsGrid);
193
+
194
+ export {
195
+ GdsGrid
196
+ };