@sebgroup/green-core 1.19.0 → 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 (108) hide show
  1. package/chunks/{chunk.W25MKPJZ.js → chunk.2RF5VP6K.js} +9 -19
  2. package/chunks/{chunk.H3RHSZBE.js → chunk.3KJV6CHY.js} +2 -2
  3. package/chunks/{chunk.TN6ZYAH3.js → chunk.3RYYLMGT.js} +1 -1
  4. package/chunks/{chunk.JRQ6R42T.js → chunk.5PHLJFEX.js} +2 -2
  5. package/chunks/{chunk.7ET5U6M4.js → chunk.6LA2CKUM.js} +1 -1
  6. package/chunks/{chunk.MSPF6KFQ.js → chunk.A62LO4CP.js} +1 -1
  7. package/chunks/{chunk.3WOE3WRP.js → chunk.BJCCPLEO.js} +2 -2
  8. package/chunks/{chunk.PUECQM7D.js → chunk.BKSMVF4C.js} +9 -1
  9. package/chunks/chunk.C3ECHGX7.js +31 -0
  10. package/chunks/{chunk.TQNYJ3ZV.js → chunk.CGZNEIGV.js} +5 -5
  11. package/chunks/{chunk.F2QPH4SQ.js → chunk.CH2GIVY6.js} +2 -2
  12. package/chunks/{chunk.BXQSEF47.js → chunk.CUR4WRCG.js} +4 -4
  13. package/chunks/{chunk.SPH3C7EL.js → chunk.EC77QYRA.js} +2 -2
  14. package/chunks/{chunk.ATDR2LQS.js → chunk.EM7MZKG5.js} +7 -4
  15. package/chunks/{chunk.2V3RCC4W.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.WJ5KHFD2.js → chunk.NRYXPR4Z.js} +2 -2
  19. package/chunks/{chunk.EVCXHZZV.js → chunk.NYOCHFZE.js} +3 -3
  20. package/chunks/{chunk.XJBBISJT.js → chunk.PE6MD3MB.js} +2 -2
  21. package/chunks/{chunk.6DIOCJEK.js → chunk.RSCI4LL2.js} +3 -3
  22. package/chunks/chunk.TJA7LL3V.js +0 -0
  23. package/chunks/chunk.V7ZQ5N3U.js +0 -0
  24. package/chunks/{chunk.E557RFML.js → chunk.VHKGMBUL.js} +3 -3
  25. package/chunks/chunk.VHN4JEZC.js +28 -0
  26. package/chunks/chunk.VOYMQ322.js +1 -1
  27. package/chunks/{chunk.X2SAPDS5.js → chunk.W2XAWNZY.js} +4 -4
  28. package/chunks/{chunk.OBMJAQII.js → chunk.XOARVFGN.js} +1 -1
  29. package/chunks/chunk.Y42J4CV3.js +86 -0
  30. package/chunks/chunk.YBOK7MI7.js +31 -0
  31. package/chunks/{chunk.WDBWUEJJ.js → chunk.YDYO7HP5.js} +2 -2
  32. package/chunks/chunk.YEV6STTM.js +201 -0
  33. package/chunks/{chunk.HQQWYXGV.js → chunk.Z5NACNXH.js} +6 -18
  34. package/chunks/{chunk.WD3OOHSN.js → chunk.ZLWSCK7R.js} +145 -59
  35. package/components/badge/badge.js +1 -1
  36. package/components/button/button.js +8 -8
  37. package/components/button/button.trans.styles.js +1 -1
  38. package/components/button/index.js +9 -8
  39. package/components/checkbox/checkbox.js +1 -1
  40. package/components/context-menu/context-menu.js +7 -8
  41. package/components/context-menu/context-menu.trans.styles.js +1 -1
  42. package/components/context-menu/index.js +8 -9
  43. package/components/datepicker/datepicker.js +12 -12
  44. package/components/datepicker/datepicker.trans.styles.js +1 -1
  45. package/components/datepicker/index.js +12 -12
  46. package/components/dropdown/dropdown.js +8 -9
  47. package/components/dropdown/dropdown.trans.styles.js +1 -1
  48. package/components/dropdown/index.js +9 -10
  49. package/components/filter-chips/filter-chip/filter-chip.d.ts +22 -0
  50. package/components/filter-chips/filter-chip/filter-chip.js +24 -0
  51. package/components/filter-chips/filter-chip/filter-chip.styles.d.ts +1 -0
  52. package/components/filter-chips/filter-chip/filter-chip.trans.styles.d.ts +2 -0
  53. package/components/filter-chips/filter-chip/filter-chip.trans.styles.js +11 -0
  54. package/components/filter-chips/filter-chip/index.d.ts +1 -0
  55. package/components/filter-chips/filter-chip/index.js +25 -0
  56. package/components/filter-chips/filter-chips.d.ts +36 -0
  57. package/components/filter-chips/filter-chips.js +28 -0
  58. package/components/filter-chips/filter-chips.styles.d.ts +1 -0
  59. package/components/filter-chips/filter-chips.trans.styles.d.ts +2 -0
  60. package/components/filter-chips/filter-chips.trans.styles.js +11 -0
  61. package/components/filter-chips/index.d.ts +2 -0
  62. package/components/filter-chips/index.js +32 -0
  63. package/components/form-control.js +2 -2
  64. package/components/grid/grid.js +3 -3
  65. package/components/grid/index.js +3 -3
  66. package/components/grouped-list/grouped-list.js +5 -6
  67. package/components/grouped-list/grouped-list.trans.styles.js +1 -1
  68. package/components/grouped-list/index.js +5 -6
  69. package/components/grouped-list/list-item.js +2 -2
  70. package/components/icon/icon.js +2 -2
  71. package/components/icon/index.js +3 -2
  72. package/components/index.d.ts +1 -0
  73. package/components/index.js +45 -31
  74. package/components/input/input.js +13 -38
  75. package/components/radio/radio-group.js +2 -2
  76. package/components/radio/radio.js +2 -2
  77. package/components/segmented-control/index.js +6 -6
  78. package/components/segmented-control/segment/index.js +4 -5
  79. package/components/segmented-control/segment/segment.js +4 -5
  80. package/components/segmented-control/segment/segment.trans.styles.js +1 -1
  81. package/components/segmented-control/segmented-control.d.ts +0 -1
  82. package/components/segmented-control/segmented-control.js +6 -6
  83. package/components/segmented-control/segmented-control.trans.styles.js +1 -1
  84. package/components/switch/switch.js +1 -1
  85. package/components/theme/index.js +3 -4
  86. package/components/theme/theme.js +3 -4
  87. package/components/theme/theme.trans.styles.js +2 -2
  88. package/index.js +45 -31
  89. package/package.json +1 -1
  90. package/primitives/calendar/calendar.js +3 -4
  91. package/primitives/calendar/index.js +3 -4
  92. package/primitives/listbox/index.js +4 -5
  93. package/primitives/listbox/listbox.js +4 -5
  94. package/primitives/listbox/option.js +3 -4
  95. package/primitives/menu/index.js +4 -5
  96. package/primitives/menu/menu-heading.js +3 -4
  97. package/primitives/menu/menu-item.js +3 -4
  98. package/primitives/menu/menu.js +4 -5
  99. package/primitives/popover/index.js +3 -4
  100. package/primitives/popover/popover.js +3 -4
  101. package/primitives/ripple/index.js +2 -2
  102. package/primitives/ripple/ripple.js +2 -2
  103. package/transitional-styles.js +1 -2
  104. package/utils/decorators/resize-observer.d.ts +15 -0
  105. package/utils/directives/forward-attributes.d.ts +17 -0
  106. package/utils/helpers/attribute-converters.d.ts +14 -0
  107. /package/chunks/{chunk.HS7ICQNA.js → chunk.4ZADZSWE.js} +0 -0
  108. /package/chunks/{chunk.RSZ4ZUN3.js → chunk.JGTSJ4J6.js} +0 -0
@@ -1,15 +1,18 @@
1
1
  import {
2
2
  GdsSegment
3
- } from "./chunk.E557RFML.js";
3
+ } from "./chunk.VHKGMBUL.js";
4
+ import {
5
+ resizeObserver
6
+ } from "./chunk.VHN4JEZC.js";
4
7
  import {
5
8
  tokens
6
- } from "./chunk.X2SAPDS5.js";
9
+ } from "./chunk.W2XAWNZY.js";
7
10
  import {
8
11
  TransitionalStyles
9
- } from "./chunk.WD3OOHSN.js";
12
+ } from "./chunk.ZLWSCK7R.js";
10
13
  import {
11
14
  GdsElement
12
- } from "./chunk.ATDR2LQS.js";
15
+ } from "./chunk.EM7MZKG5.js";
13
16
  import {
14
17
  watch
15
18
  } from "./chunk.2WO4NHJ2.js";
@@ -128,7 +131,7 @@ var BTN_SIZE = {
128
131
  medium: 44
129
132
  };
130
133
  var getSegmentGap = (transitionalStyles) => transitionalStyles ? 0 : 4;
131
- var _value, _tid, _resizeObserver, _firstVisibleIndex, _calculatedSegmentWidth, _segmentWidth, _segmentsContainerLeft, _focusedIndex, _dragStartX, _dragStartLeft, _isDragging, _startDrag, _drag, _endDrag, _calcVisibleAfterDrag, _calcLayout, _applySegmentsTransform, _handleSlotChange, handleSlotChange_fn, _scrollLeft, _scrollRight, _updateScrollBtnState, _updateIndicator, _handleSegmentClick, _updateSelectedFromValue;
134
+ var _value, _firstVisibleIndex, _calculatedSegmentWidth, _segmentWidth, _segmentsContainerLeft, _focusedIndex, _dragStartX, _dragStartLeft, _isDragging, _startDrag, _drag, _endDrag, _calcVisibleAfterDrag, _calcLayout, _applySegmentsTransform, _handleSlotChange, handleSlotChange_fn, _scrollLeft, _scrollRight, _updateScrollBtnState, _updateIndicator, _handleSegmentClick, _updateSelectedFromValue;
132
135
  var GdsSegmentedControl = class extends GdsElement {
133
136
  constructor() {
134
137
  super(...arguments);
@@ -138,13 +141,6 @@ var GdsSegmentedControl = class extends GdsElement {
138
141
  __privateAdd(this, _value, void 0);
139
142
  this._showPrevButton = false;
140
143
  this._showNextButton = false;
141
- __privateAdd(this, _tid, void 0);
142
- __privateAdd(this, _resizeObserver, new ResizeObserver(() => {
143
- __privateGet(this, _tid) && clearTimeout(__privateGet(this, _tid));
144
- __privateSet(this, _tid, setTimeout(() => {
145
- __privateGet(this, _calcLayout).call(this);
146
- }, 20));
147
- }));
148
144
  __privateAdd(this, _firstVisibleIndex, 0);
149
145
  __privateAdd(this, _calculatedSegmentWidth, 0);
150
146
  __privateAdd(this, _segmentWidth, 0);
@@ -322,7 +318,6 @@ var GdsSegmentedControl = class extends GdsElement {
322
318
  connectedCallback() {
323
319
  super.connectedCallback();
324
320
  TransitionalStyles.instance.apply(this, "gds-segmented-control");
325
- __privateGet(this, _resizeObserver).observe(this);
326
321
  this.addEventListener("focusin", (e) => {
327
322
  if (e.target instanceof GdsSegment) {
328
323
  __privateSet(this, _focusedIndex, this.segments.indexOf(e.target));
@@ -330,10 +325,6 @@ var GdsSegmentedControl = class extends GdsElement {
330
325
  }
331
326
  });
332
327
  }
333
- disconnectedCallback() {
334
- super.disconnectedCallback();
335
- __privateGet(this, _resizeObserver).unobserve(this);
336
- }
337
328
  render() {
338
329
  return html`${when(
339
330
  this._showPrevButton,
@@ -385,8 +376,6 @@ var GdsSegmentedControl = class extends GdsElement {
385
376
  }
386
377
  };
387
378
  _value = new WeakMap();
388
- _tid = new WeakMap();
389
- _resizeObserver = new WeakMap();
390
379
  _firstVisibleIndex = new WeakMap();
391
380
  _calculatedSegmentWidth = new WeakMap();
392
381
  _segmentWidth = new WeakMap();
@@ -445,6 +434,7 @@ __decorateClass([
445
434
  state()
446
435
  ], GdsSegmentedControl.prototype, "_showNextButton", 2);
447
436
  __decorateClass([
437
+ resizeObserver(),
448
438
  watch("segMinWidth")
449
439
  ], GdsSegmentedControl.prototype, "_recalculateMinWidth", 1);
450
440
  GdsSegmentedControl = __decorateClass([
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  TransitionalStyles
3
- } from "./chunk.WD3OOHSN.js";
3
+ } from "./chunk.ZLWSCK7R.js";
4
4
  import {
5
5
  GdsElement
6
- } from "./chunk.ATDR2LQS.js";
6
+ } from "./chunk.EM7MZKG5.js";
7
7
  import {
8
8
  gdsCustomElement
9
9
  } from "./chunk.VOYMQ322.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  constrainSlots
3
- } from "./chunk.6NM7ENKA.js";
3
+ } from "./chunk.KBYQYDL3.js";
4
4
  import {
5
5
  __decorateClass,
6
6
  __privateAdd,
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk.2ND5EWHE.js";
5
5
  import {
6
6
  TransitionalStyles
7
- } from "./chunk.WD3OOHSN.js";
7
+ } from "./chunk.ZLWSCK7R.js";
8
8
  import {
9
9
  GdsElement
10
- } from "./chunk.ATDR2LQS.js";
10
+ } from "./chunk.EM7MZKG5.js";
11
11
  import {
12
12
  watch
13
13
  } from "./chunk.2WO4NHJ2.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GdsElement
3
- } from "./chunk.ATDR2LQS.js";
3
+ } from "./chunk.EM7MZKG5.js";
4
4
  import {
5
5
  gdsCustomElement,
6
6
  html
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tokens
3
- } from "./chunk.X2SAPDS5.js";
3
+ } from "./chunk.W2XAWNZY.js";
4
4
  import {
5
5
  gdsCustomElement
6
6
  } from "./chunk.VOYMQ322.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  TransitionalStyles
3
- } from "./chunk.WD3OOHSN.js";
3
+ } from "./chunk.ZLWSCK7R.js";
4
4
  import {
5
5
  GdsElement
6
- } from "./chunk.ATDR2LQS.js";
6
+ } from "./chunk.EM7MZKG5.js";
7
7
  import {
8
8
  gdsCustomElement,
9
9
  html
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GdsElement
3
- } from "./chunk.ATDR2LQS.js";
3
+ } from "./chunk.EM7MZKG5.js";
4
4
  import {
5
5
  gdsCustomElement,
6
6
  html
@@ -134,6 +134,14 @@ var GdsIcon = class extends GdsElement {
134
134
  <line x1="12" y1="9" x2="12" y2="13" />
135
135
  <path x1="12" y1="17" x2="12.01" y2="17" />
136
136
  </symbol>
137
+ <symbol id="checkmark">
138
+ <path
139
+ d="M2.75 15.0938L9 20.25L21.25 3.75"
140
+ stroke-width="2"
141
+ stroke-linecap="round"
142
+ stroke-linejoin="round"
143
+ />
144
+ </symbol>
137
145
  </svg>
138
146
  <svg viewBox="0 0 24 24">
139
147
  <use href="#${name}"></use>
@@ -0,0 +1,31 @@
1
+ // libs/core/src/utils/helpers/attribute-converters.ts
2
+ var dateConverter = {
3
+ fromAttribute(value) {
4
+ return new Date(value);
5
+ },
6
+ toAttribute(value) {
7
+ return value.toISOString();
8
+ }
9
+ };
10
+ var dateArrayConverter = {
11
+ fromAttribute(value) {
12
+ return value.split(",").map((d) => new Date(d.trim()));
13
+ },
14
+ toAttribute(value) {
15
+ return JSON.stringify(value.map((d) => d.toISOString()));
16
+ }
17
+ };
18
+ var stringArrayConverter = {
19
+ fromAttribute(value) {
20
+ return value.split(",");
21
+ },
22
+ toAttribute(value) {
23
+ return Array.isArray(value) ? value.join(",") : value;
24
+ }
25
+ };
26
+
27
+ export {
28
+ dateConverter,
29
+ dateArrayConverter,
30
+ stringArrayConverter
31
+ };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  GdsFormControlElement
3
- } from "./chunk.OBMJAQII.js";
4
- import {
5
- TransitionalStyles
6
- } from "./chunk.WD3OOHSN.js";
3
+ } from "./chunk.XOARVFGN.js";
7
4
  import {
8
5
  observeLightDOM
9
6
  } from "./chunk.WM7HBMMV.js";
7
+ import {
8
+ TransitionalStyles
9
+ } from "./chunk.ZLWSCK7R.js";
10
10
  import {
11
11
  constrainSlots
12
- } from "./chunk.6NM7ENKA.js";
12
+ } from "./chunk.KBYQYDL3.js";
13
13
  import {
14
14
  watch
15
15
  } from "./chunk.2WO4NHJ2.js";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk.375BWME4.js";
4
4
  import {
5
5
  TransitionalStyles
6
- } from "./chunk.WD3OOHSN.js";
6
+ } from "./chunk.ZLWSCK7R.js";
7
7
  import {
8
8
  GdsElement
9
- } from "./chunk.ATDR2LQS.js";
9
+ } from "./chunk.EM7MZKG5.js";
10
10
  import {
11
11
  watch
12
12
  } from "./chunk.2WO4NHJ2.js";
@@ -1,12 +1,12 @@
1
- import {
2
- TransitionalStyles
3
- } from "./chunk.WD3OOHSN.js";
4
1
  import {
5
2
  watchMediaQuery
6
3
  } from "./chunk.WM7HBMMV.js";
4
+ import {
5
+ TransitionalStyles
6
+ } from "./chunk.ZLWSCK7R.js";
7
7
  import {
8
8
  GdsElement
9
- } from "./chunk.ATDR2LQS.js";
9
+ } from "./chunk.EM7MZKG5.js";
10
10
  import {
11
11
  watch
12
12
  } from "./chunk.2WO4NHJ2.js";
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk.2ND5EWHE.js";
5
5
  import {
6
6
  TransitionalStyles
7
- } from "./chunk.WD3OOHSN.js";
7
+ } from "./chunk.ZLWSCK7R.js";
8
8
  import {
9
9
  GdsElement
10
- } from "./chunk.ATDR2LQS.js";
10
+ } from "./chunk.EM7MZKG5.js";
11
11
  import {
12
12
  gdsCustomElement,
13
13
  html
@@ -4,8 +4,12 @@ import {
4
4
  import {
5
5
  getUnscopedTagName
6
6
  } from "./chunk.VOYMQ322.js";
7
+ import {
8
+ __decorateClass
9
+ } from "./chunk.5VURDMKE.js";
7
10
 
8
11
  // libs/core/src/gds-element.ts
12
+ import { state } from "lit/decorators.js";
9
13
  import { LitElement } from "lit";
10
14
  var GdsElement = class extends LitElement {
11
15
  constructor() {
@@ -14,10 +18,6 @@ var GdsElement = class extends LitElement {
14
18
  * The unscoped name of this element.
15
19
  */
16
20
  this.gdsElementName = "";
17
- /**
18
- * Whether the element is using transitional styles.
19
- * @internal
20
- */
21
21
  this._isUsingTransitionalStyles = false;
22
22
  this._dynamicStylesController = new DynamicStylesController(this);
23
23
  }
@@ -27,6 +27,9 @@ var GdsElement = class extends LitElement {
27
27
  this.setAttribute("gds-element", this.gdsElementName);
28
28
  }
29
29
  };
30
+ __decorateClass([
31
+ state()
32
+ ], GdsElement.prototype, "_isUsingTransitionalStyles", 2);
30
33
 
31
34
  export {
32
35
  GdsElement
@@ -1,15 +1,18 @@
1
1
  import {
2
- GdsFormControlElement
3
- } from "./chunk.OBMJAQII.js";
2
+ forwardAttributes
3
+ } from "./chunk.YBOK7MI7.js";
4
4
  import {
5
5
  tokens
6
- } from "./chunk.X2SAPDS5.js";
6
+ } from "./chunk.W2XAWNZY.js";
7
+ import {
8
+ GdsFormControlElement
9
+ } from "./chunk.XOARVFGN.js";
7
10
  import {
8
11
  TransitionalStyles
9
- } from "./chunk.WD3OOHSN.js";
12
+ } from "./chunk.ZLWSCK7R.js";
10
13
  import {
11
14
  constrainSlots
12
- } from "./chunk.6NM7ENKA.js";
15
+ } from "./chunk.KBYQYDL3.js";
13
16
  import {
14
17
  gdsCustomElement,
15
18
  html
@@ -22,7 +25,7 @@ import {
22
25
  } from "./chunk.5VURDMKE.js";
23
26
 
24
27
  // libs/core/src/components/button/button.ts
25
- import { unsafeCSS } from "lit";
28
+ import { nothing, unsafeCSS } from "lit";
26
29
  import { property, query } from "lit/decorators.js";
27
30
  import { when } from "lit/directives/when.js";
28
31
  import { classMap } from "lit/directives/class-map.js";
@@ -393,6 +396,7 @@ var GdsButton = class extends GdsFormControlElement {
393
396
  }
394
397
  connectedCallback() {
395
398
  super.connectedCallback();
399
+ this.setAttribute("role", "none");
396
400
  TransitionalStyles.instance.apply(this, "gds-button");
397
401
  }
398
402
  render() {
@@ -413,13 +417,14 @@ var GdsButton = class extends GdsFormControlElement {
413
417
  ?type="${this.type}"
414
418
  ?disabled="${this.disabled}"
415
419
  @click="${__privateGet(this, _handleClick)}"
416
- aria-label="${this.label}"
420
+ aria-label=${this.label || nothing}
421
+ part="_button"
422
+ ${forwardAttributes(
423
+ (attr) => attr.name.startsWith("gds-aria") || attr.name === "gds-role"
424
+ )}
417
425
  >
418
426
  <slot name="lead" gds-allow="gds-icon"></slot>
419
- <slot
420
- @slotchange=${__privateGet(this, _mainSlotChange)}
421
- gds-allow="#text gds-icon"
422
- ></slot>
427
+ <slot @slotchange=${__privateGet(this, _mainSlotChange)}></slot>
423
428
  <slot name="trail" gds-allow="gds-icon"></slot>
424
429
  ${when(
425
430
  !this._isUsingTransitionalStyles,
@@ -12,7 +12,10 @@ function constrainSlots(self) {
12
12
  }
13
13
  const constrain = (slot) => {
14
14
  var _a2, _b2;
15
- const allowed = ((_a2 = slot.getAttribute("gds-allow")) == null ? void 0 : _a2.split(" ")) || [];
15
+ const allowed = [
16
+ ...((_a2 = slot.getAttribute("gds-allow")) == null ? void 0 : _a2.split(" ")) || [],
17
+ "slot"
18
+ ];
16
19
  for (const node of Array.from(slot.assignedNodes())) {
17
20
  if (!allowed.includes(node.nodeName.toLowerCase())) {
18
21
  (_b2 = node.parentNode) == null ? void 0 : _b2.removeChild(node);
File without changes
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk.DFYMYEGD.js";
5
5
  import {
6
6
  TransitionalStyles
7
- } from "./chunk.WD3OOHSN.js";
7
+ } from "./chunk.ZLWSCK7R.js";
8
8
  import {
9
9
  GdsElement
10
- } from "./chunk.ATDR2LQS.js";
10
+ } from "./chunk.EM7MZKG5.js";
11
11
  import {
12
12
  watch
13
13
  } from "./chunk.2WO4NHJ2.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  TransitionalStyles
3
- } from "./chunk.WD3OOHSN.js";
3
+ } from "./chunk.ZLWSCK7R.js";
4
4
  import {
5
5
  GdsElement
6
- } from "./chunk.ATDR2LQS.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
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk.DFYMYEGD.js";
5
5
  import {
6
6
  TransitionalStyles
7
- } from "./chunk.WD3OOHSN.js";
7
+ } from "./chunk.ZLWSCK7R.js";
8
8
  import {
9
9
  GdsElement
10
- } from "./chunk.ATDR2LQS.js";
10
+ } from "./chunk.EM7MZKG5.js";
11
11
  import {
12
12
  gdsCustomElement,
13
13
  html
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  TransitionalStyles
3
- } from "./chunk.WD3OOHSN.js";
3
+ } from "./chunk.ZLWSCK7R.js";
4
4
  import {
5
5
  GdsElement
6
- } from "./chunk.ATDR2LQS.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
File without changes
File without changes
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  tokens
3
- } from "./chunk.X2SAPDS5.js";
3
+ } from "./chunk.W2XAWNZY.js";
4
4
  import {
5
5
  TransitionalStyles
6
- } from "./chunk.WD3OOHSN.js";
6
+ } from "./chunk.ZLWSCK7R.js";
7
7
  import {
8
8
  GdsElement
9
- } from "./chunk.ATDR2LQS.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 = "-914809";
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 Tue, 14 May 2024 14:39:43 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 Tue, 14 May 2024 14:39:43 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 Tue, 14 May 2024 14:39:43 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 Tue, 14 May 2024 14:39:43 GMT
535
+ * Generated on Fri, 17 May 2024 12:50:34 GMT
536
536
  */
537
537
 
538
538
  :host {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GdsElement
3
- } from "./chunk.ATDR2LQS.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
+ };