@sebgroup/green-core 1.15.1 → 1.17.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 (124) hide show
  1. package/README.md +101 -7
  2. package/chunks/chunk.2LQSDOD4.js +29 -0
  3. package/chunks/chunk.2ND5EWHE.js +65 -0
  4. package/chunks/chunk.2OOTOCUG.js +420 -0
  5. package/chunks/chunk.2WO4NHJ2.js +34 -0
  6. package/chunks/chunk.2Y3BHFKO.js +154 -0
  7. package/chunks/chunk.375BWME4.js +29 -0
  8. package/chunks/chunk.5VURDMKE.js +75 -0
  9. package/chunks/chunk.63RKNI5K.js +244 -0
  10. package/chunks/chunk.6NM7ENKA.js +31 -0
  11. package/chunks/chunk.6UA66KQU.js +153 -0
  12. package/chunks/chunk.7TCXY7BP.js +0 -0
  13. package/chunks/chunk.AQGTMWG4.js +101 -0
  14. package/chunks/chunk.D7H7CUS4.js +55 -0
  15. package/chunks/chunk.DFYMYEGD.js +78 -0
  16. package/chunks/chunk.EUQ5DOQM.js +560 -0
  17. package/chunks/chunk.HS7ICQNA.js +0 -0
  18. package/chunks/chunk.IYCENQZG.js +28 -0
  19. package/chunks/chunk.KC32OWZE.js +274 -0
  20. package/chunks/chunk.LUHCF4BJ.js +64 -0
  21. package/chunks/chunk.MAD5DQMN.js +161 -0
  22. package/chunks/chunk.MI4A2C2A.js +0 -0
  23. package/chunks/chunk.Q2T57HE7.js +0 -0
  24. package/chunks/chunk.QONSFT2N.js +4653 -0
  25. package/chunks/chunk.TMBQL2RO.js +0 -0
  26. package/chunks/chunk.TN6ZYAH3.js +74 -0
  27. package/chunks/chunk.TSDZQZBY.js +0 -0
  28. package/chunks/chunk.TX64TTBN.js +0 -0
  29. package/chunks/chunk.U4DPJ4QU.js +96 -0
  30. package/chunks/chunk.UF6IEONX.js +0 -0
  31. package/chunks/chunk.VOYMQ322.js +61 -0
  32. package/chunks/chunk.VYK7D6QO.js +64 -0
  33. package/chunks/chunk.WDZ2JTCP.js +360 -0
  34. package/chunks/chunk.WJDR7FTS.js +193 -0
  35. package/chunks/chunk.WM7HBMMV.js +54 -0
  36. package/chunks/chunk.XD5R3ZU3.js +460 -0
  37. package/chunks/chunk.XHTJVQUJ.js +140 -0
  38. package/chunks/chunk.XI4H54TV.js +39 -0
  39. package/chunks/chunk.XMPBXAGB.js +80 -0
  40. package/chunks/chunk.XU4HZLJL.js +0 -0
  41. package/chunks/chunk.YIQIH4RW.js +139 -0
  42. package/chunks/chunk.YJHAKLGR.js +54 -0
  43. package/chunks/chunk.YO24ZYAD.js +0 -0
  44. package/chunks/chunk.ZTE73BY2.js +655 -0
  45. package/chunks/chunk.ZYQWZMVY.js +467 -0
  46. package/components/badge/badge.js +245 -0
  47. package/components/button/button.d.ts +5 -5
  48. package/components/button/button.js +18 -0
  49. package/components/button/button.trans.styles.d.ts +2 -0
  50. package/components/button/index.d.ts +1 -0
  51. package/components/button/index.js +18 -0
  52. package/components/checkbox/checkbox.js +219 -0
  53. package/components/context-menu/context-menu.d.ts +2 -1
  54. package/components/context-menu/context-menu.js +22 -0
  55. package/components/context-menu/index.d.ts +3 -0
  56. package/components/context-menu/index.js +29 -0
  57. package/components/datepicker/date-part-spinner.js +10 -0
  58. package/components/datepicker/datepicker.d.ts +3 -2
  59. package/components/datepicker/datepicker.js +29 -0
  60. package/components/datepicker/index.d.ts +1 -0
  61. package/components/datepicker/index.js +29 -0
  62. package/components/dropdown/dropdown.d.ts +2 -2
  63. package/components/dropdown/dropdown.js +22 -0
  64. package/components/dropdown/index.d.ts +3 -0
  65. package/components/dropdown/index.js +30 -0
  66. package/components/form-control.js +12 -0
  67. package/components/grid/grid.d.ts +2 -2
  68. package/components/grid/grid.js +11 -0
  69. package/components/grid/grid.style.css.js +7 -0
  70. package/components/grid/index.d.ts +1 -0
  71. package/components/grid/index.js +11 -0
  72. package/components/grouped-list/grouped-list.js +14 -0
  73. package/components/grouped-list/index.d.ts +2 -0
  74. package/components/grouped-list/index.js +17 -0
  75. package/components/grouped-list/list-item.js +10 -0
  76. package/components/icon/icon.d.ts +2 -2
  77. package/components/icon/icon.js +10 -0
  78. package/components/icon/index.d.ts +1 -0
  79. package/components/icon/index.js +10 -0
  80. package/components/index.d.ts +4 -3
  81. package/components/index.js +81 -0
  82. package/components/input/input.js +682 -0
  83. package/components/radio/radio-group.js +9 -0
  84. package/components/radio/radio.js +240 -0
  85. package/components/segmented-control/index.d.ts +1 -0
  86. package/components/segmented-control/index.js +15 -0
  87. package/components/segmented-control/segment/index.d.ts +1 -0
  88. package/components/segmented-control/segment/index.js +13 -0
  89. package/components/segmented-control/segment/segment.js +12 -0
  90. package/components/segmented-control/segmented-control.d.ts +1 -1
  91. package/components/segmented-control/segmented-control.js +15 -0
  92. package/components/switch/switch.js +164 -0
  93. package/components/theme/index.d.ts +1 -0
  94. package/components/theme/index.js +11 -0
  95. package/components/theme/theme.js +11 -0
  96. package/components/tooltip/tooltip.js +252 -0
  97. package/index.js +72 -4291
  98. package/localization.js +3 -5
  99. package/package.json +7 -16
  100. package/primitives/calendar/calendar.js +13 -0
  101. package/primitives/calendar/functions.js +7 -0
  102. package/primitives/calendar/index.d.ts +1 -0
  103. package/primitives/calendar/index.js +14 -0
  104. package/primitives/listbox/index.d.ts +0 -1
  105. package/primitives/listbox/index.js +17 -0
  106. package/primitives/listbox/listbox.d.ts +2 -1
  107. package/primitives/listbox/listbox.js +16 -0
  108. package/primitives/listbox/option.js +14 -0
  109. package/primitives/menu/index.d.ts +1 -0
  110. package/primitives/menu/index.js +15 -0
  111. package/primitives/menu/menu-heading.js +11 -0
  112. package/primitives/menu/menu-item.d.ts +1 -2
  113. package/primitives/menu/menu-item.js +12 -0
  114. package/primitives/menu/menu.d.ts +2 -1
  115. package/primitives/menu/menu.js +14 -0
  116. package/primitives/popover/index.js +14 -0
  117. package/primitives/popover/popover.js +13 -0
  118. package/primitives/ripple/index.d.ts +1 -0
  119. package/primitives/ripple/index.js +11 -0
  120. package/primitives/ripple/ripple.d.ts +1 -1
  121. package/primitives/ripple/ripple.js +10 -0
  122. package/scoping.d.ts +1 -0
  123. package/scoping.js +18 -0
  124. package/transitional-styles.js +6 -4275
@@ -0,0 +1,101 @@
1
+ import {
2
+ tokens
3
+ } from "./chunk.EUQ5DOQM.js";
4
+ import {
5
+ gdsCustomElement
6
+ } from "./chunk.VOYMQ322.js";
7
+ import {
8
+ __decorateClass
9
+ } from "./chunk.5VURDMKE.js";
10
+
11
+ // libs/core/src/primitives/ripple/ripple.ts
12
+ import { LitElement, html, unsafeCSS } from "lit";
13
+ import { query } from "lit/decorators.js";
14
+
15
+ // libs/core/src/primitives/ripple/ripple.styles.scss
16
+ var ripple_styles_default = `:host {
17
+ --gds-ripple-motion-name: ripple;
18
+ --gds-ripple-motion: var(--gds-ripple-motion-name)
19
+ var(--gds-sys-motion-duration) var(--gds-sys-motion-timing-function)
20
+ var(--gds-sys-motion-delay) var(--gds-sys-motion-iteration-count)
21
+ var(--gds-sys-motion-direction) var(--gds-sys-motion-fill-mode)
22
+ var(--gds-sys-motion-play-state);
23
+ border-radius: var(--gds-sys-radii-full);
24
+ contain: strict;
25
+ display: flex;
26
+ height: 100%;
27
+ inset: 0;
28
+ overflow: hidden;
29
+ position: absolute;
30
+ width: 100%;
31
+ }
32
+
33
+ div {
34
+ background-color: currentColor;
35
+ border-radius: var(--gds-sys-radii-full);
36
+ display: flex;
37
+ height: 20px;
38
+ left: var(--gds-ripple-left, 50%);
39
+ margin-left: -10px;
40
+ margin-top: -10px;
41
+ opacity: 0;
42
+ pointer-events: none;
43
+ position: absolute;
44
+ top: var(--gds-ripple-top, 50%);
45
+ width: 20px;
46
+ will-change: transform;
47
+ }
48
+
49
+ div.gds-ripple-effect {
50
+ animation: var(--gds-ripple-motion);
51
+ }
52
+
53
+ @keyframes ripple {
54
+ from {
55
+ opacity: 0.5;
56
+ transform: scale(0);
57
+ }
58
+ to {
59
+ opacity: 0;
60
+ transform: scale(calc(3 * var(--mt-ripple-spread, 4)));
61
+ }
62
+ }
63
+ @media (prefers-reduced-motion: reduce) {
64
+ :host {
65
+ --gds-ripple-motion-name: none !important;
66
+ }
67
+ }`;
68
+
69
+ // libs/core/src/primitives/ripple/ripple.ts
70
+ var Ripple = class extends LitElement {
71
+ constructor() {
72
+ super(...arguments);
73
+ this.onmousedown = (e) => {
74
+ const target = e.target;
75
+ const rect = target.getBoundingClientRect();
76
+ const rippleEl = this._rippleEl;
77
+ if (rippleEl) {
78
+ rippleEl.classList.remove("gds-ripple-effect");
79
+ this.style.setProperty("--gds-ripple-top", `${e.clientY - rect.top}px`);
80
+ this.style.setProperty("--gds-ripple-left", `${e.clientX - rect.left}px`);
81
+ setTimeout(() => {
82
+ rippleEl.classList.add("gds-ripple-effect");
83
+ }, 20);
84
+ }
85
+ };
86
+ }
87
+ render() {
88
+ return html`<div></div>`;
89
+ }
90
+ };
91
+ Ripple.styles = [tokens, unsafeCSS(ripple_styles_default)];
92
+ __decorateClass([
93
+ query("div")
94
+ ], Ripple.prototype, "_rippleEl", 2);
95
+ Ripple = __decorateClass([
96
+ gdsCustomElement("gds-ripple")
97
+ ], Ripple);
98
+
99
+ export {
100
+ Ripple
101
+ };
@@ -0,0 +1,55 @@
1
+ import {
2
+ TransitionalStyles
3
+ } from "./chunk.QONSFT2N.js";
4
+ import {
5
+ GdsElement
6
+ } from "./chunk.2LQSDOD4.js";
7
+ import {
8
+ constrainSlots
9
+ } from "./chunk.6NM7ENKA.js";
10
+ import {
11
+ gdsCustomElement,
12
+ html
13
+ } from "./chunk.VOYMQ322.js";
14
+ import {
15
+ __decorateClass
16
+ } from "./chunk.5VURDMKE.js";
17
+
18
+ // libs/core/src/components/grouped-list/grouped-list.ts
19
+ import { state, property } from "lit/decorators.js";
20
+ import { when } from "lit/directives/when.js";
21
+ var GdsGroupedList = class extends GdsElement {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.label = "";
25
+ }
26
+ connectedCallback() {
27
+ super.connectedCallback();
28
+ constrainSlots(this);
29
+ TransitionalStyles.instance.apply(this, "gds-grouped-list");
30
+ }
31
+ render() {
32
+ return html`${this._tStyles}${when(
33
+ this.label,
34
+ () => html`<div class="gds-list-heading" aria-hidden="true" id="label">
35
+ ${this.label}
36
+ </div>`
37
+ )}
38
+ <div role="list" aria-labelledby="label">
39
+ <slot gds-allow="gds-list-item"></slot>
40
+ </div>`;
41
+ }
42
+ };
43
+ __decorateClass([
44
+ state()
45
+ ], GdsGroupedList.prototype, "_tStyles", 2);
46
+ __decorateClass([
47
+ property()
48
+ ], GdsGroupedList.prototype, "label", 2);
49
+ GdsGroupedList = __decorateClass([
50
+ gdsCustomElement("gds-grouped-list")
51
+ ], GdsGroupedList);
52
+
53
+ export {
54
+ GdsGroupedList
55
+ };
@@ -0,0 +1,78 @@
1
+ import {
2
+ __privateAdd,
3
+ __privateGet
4
+ } from "./chunk.5VURDMKE.js";
5
+
6
+ // libs/core/src/controllers/listbox-kb-nav-controller.ts
7
+ var _keyboardNavigationHandler;
8
+ var ListboxKbNavController = class {
9
+ constructor(host) {
10
+ __privateAdd(this, _keyboardNavigationHandler, (e) => {
11
+ var _a, _b;
12
+ const targetItem = e.target;
13
+ if (!this.host.navigableItems.includes(targetItem))
14
+ return;
15
+ let handled = false;
16
+ if (e.key === "ArrowDown") {
17
+ const nextItemIndex = this.host.navigableItems.indexOf(targetItem) + 1;
18
+ const nextItem = this.host.navigableItems[nextItemIndex];
19
+ nextItem == null ? void 0 : nextItem.focus();
20
+ handled = true;
21
+ } else if (e.key === "ArrowUp") {
22
+ const prevOptionIndex = this.host.navigableItems.indexOf(targetItem) - 1;
23
+ const prevItem = this.host.navigableItems[prevOptionIndex];
24
+ prevItem == null ? void 0 : prevItem.focus();
25
+ handled = true;
26
+ } else if (e.key === "Home") {
27
+ (_a = this.host.navigableItems[0]) == null ? void 0 : _a.focus();
28
+ handled = true;
29
+ } else if (e.key === "End") {
30
+ (_b = this.host.navigableItems[this.host.navigableItems.length - 1]) == null ? void 0 : _b.focus();
31
+ handled = true;
32
+ } else {
33
+ const key = e.key.toLowerCase();
34
+ if (key.length !== 1) {
35
+ return;
36
+ }
37
+ const isLetter = key >= "a" && key <= "z";
38
+ const isNumber = key >= "0" && key <= "9";
39
+ if (isLetter || isNumber) {
40
+ const firstMatch = this.host.navigableItems.find((el) => {
41
+ var _a2;
42
+ const text = (_a2 = el.textContent) == null ? void 0 : _a2.trim().toLowerCase();
43
+ return text == null ? void 0 : text.startsWith(key);
44
+ });
45
+ firstMatch == null ? void 0 : firstMatch.focus();
46
+ handled = true;
47
+ }
48
+ }
49
+ if (handled) {
50
+ e.preventDefault();
51
+ e.stopPropagation();
52
+ }
53
+ });
54
+ ;
55
+ (this.host = host).addController(this);
56
+ }
57
+ hostConnected() {
58
+ this.host.addEventListener("keydown", __privateGet(this, _keyboardNavigationHandler));
59
+ }
60
+ hostDisconnected() {
61
+ this.host.removeEventListener("keydown", __privateGet(this, _keyboardNavigationHandler));
62
+ }
63
+ };
64
+ _keyboardNavigationHandler = new WeakMap();
65
+
66
+ // libs/core/src/utils/helpers/unwrap-slots.ts
67
+ function unwrap(slotRef) {
68
+ let slot = slotRef;
69
+ while (slot.assignedElements().length > 0 && slot.assignedElements()[0].nodeName === "SLOT") {
70
+ slot = slot.assignedElements()[0];
71
+ }
72
+ return slot;
73
+ }
74
+
75
+ export {
76
+ ListboxKbNavController,
77
+ unwrap
78
+ };