@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,140 @@
1
+ import {
2
+ Focusable,
3
+ option_styles_default
4
+ } from "./chunk.2ND5EWHE.js";
5
+ import {
6
+ TransitionalStyles
7
+ } from "./chunk.QONSFT2N.js";
8
+ import {
9
+ GdsElement
10
+ } from "./chunk.2LQSDOD4.js";
11
+ import {
12
+ watch
13
+ } from "./chunk.2WO4NHJ2.js";
14
+ import {
15
+ gdsCustomElement
16
+ } from "./chunk.VOYMQ322.js";
17
+ import {
18
+ __decorateClass,
19
+ __privateAdd,
20
+ __privateGet,
21
+ __privateMethod,
22
+ __privateSet
23
+ } from "./chunk.5VURDMKE.js";
24
+
25
+ // libs/core/src/primitives/listbox/option.ts
26
+ import { html } from "lit";
27
+ import { property, state } from "lit/decorators.js";
28
+ import { when } from "lit/directives/when.js";
29
+ import { classMap } from "lit/directives/class-map.js";
30
+ import "reflect-metadata";
31
+ var _hidden, _emitSelect, emitSelect_fn;
32
+ var GdsOption = class extends Focusable(GdsElement) {
33
+ constructor() {
34
+ super();
35
+ __privateAdd(this, _emitSelect);
36
+ __privateAdd(this, _hidden, false);
37
+ this.selected = false;
38
+ this.isPlaceholder = false;
39
+ this.addEventListener("click", __privateMethod(this, _emitSelect, emitSelect_fn));
40
+ this.addEventListener("keydown", (e) => {
41
+ if (e.key !== "Enter" && e.key !== " ")
42
+ return;
43
+ e.preventDefault();
44
+ __privateMethod(this, _emitSelect, emitSelect_fn).call(this, e);
45
+ });
46
+ }
47
+ get hidden() {
48
+ return __privateGet(this, _hidden);
49
+ }
50
+ set hidden(value) {
51
+ if (this.isPlaceholder)
52
+ return;
53
+ __privateSet(this, _hidden, value === "true" || value === true);
54
+ this.setAttribute("aria-hidden", value.toString());
55
+ }
56
+ connectedCallback() {
57
+ super.connectedCallback();
58
+ this.setAttribute("role", "option");
59
+ if (this.isPlaceholder) {
60
+ __privateSet(this, _hidden, true);
61
+ this.setAttribute("aria-hidden", "true");
62
+ }
63
+ this.updateComplete.then(
64
+ () => TransitionalStyles.instance.apply(this, "gds-option")
65
+ );
66
+ }
67
+ get parentElement() {
68
+ return super.parentElement;
69
+ }
70
+ _handlePlaceholderStatusChange() {
71
+ if (this.isPlaceholder) {
72
+ __privateSet(this, _hidden, true);
73
+ this.setAttribute("aria-hidden", "true");
74
+ } else {
75
+ __privateSet(this, _hidden, false);
76
+ this.setAttribute("aria-hidden", "false");
77
+ }
78
+ }
79
+ render() {
80
+ var _a;
81
+ const isMultiple = (_a = this.parentElement) == null ? void 0 : _a.multiple;
82
+ const checkbox = html` <span
83
+ class="checkbox ${classMap({ checked: this.selected })}"
84
+ ></span>`;
85
+ if (!isMultiple) {
86
+ if (this.selected)
87
+ this.setAttribute("highlighted", "");
88
+ else
89
+ this.removeAttribute("highlighted");
90
+ }
91
+ return html`${this._tStyles}
92
+ <div>${when(isMultiple, () => checkbox)} <slot></slot></div>`;
93
+ }
94
+ };
95
+ _hidden = new WeakMap();
96
+ _emitSelect = new WeakSet();
97
+ emitSelect_fn = function(e) {
98
+ e.stopPropagation();
99
+ this.dispatchEvent(
100
+ new CustomEvent("gds-select", {
101
+ bubbles: true,
102
+ composed: true,
103
+ detail: {
104
+ value: this.value
105
+ }
106
+ })
107
+ );
108
+ };
109
+ GdsOption.styles = option_styles_default;
110
+ __decorateClass([
111
+ property()
112
+ ], GdsOption.prototype, "value", 2);
113
+ __decorateClass([
114
+ property({
115
+ attribute: "aria-hidden",
116
+ reflect: true
117
+ })
118
+ ], GdsOption.prototype, "hidden", 1);
119
+ __decorateClass([
120
+ property({
121
+ attribute: "aria-selected",
122
+ reflect: true
123
+ })
124
+ ], GdsOption.prototype, "selected", 2);
125
+ __decorateClass([
126
+ property({ type: Boolean, reflect: true })
127
+ ], GdsOption.prototype, "isPlaceholder", 2);
128
+ __decorateClass([
129
+ state()
130
+ ], GdsOption.prototype, "_tStyles", 2);
131
+ __decorateClass([
132
+ watch("isplaceholder")
133
+ ], GdsOption.prototype, "_handlePlaceholderStatusChange", 1);
134
+ GdsOption = __decorateClass([
135
+ gdsCustomElement("gds-option")
136
+ ], GdsOption);
137
+
138
+ export {
139
+ GdsOption
140
+ };
@@ -0,0 +1,39 @@
1
+ import {
2
+ TransitionalStyles
3
+ } from "./chunk.QONSFT2N.js";
4
+ import {
5
+ GdsElement
6
+ } from "./chunk.2LQSDOD4.js";
7
+ import {
8
+ gdsCustomElement,
9
+ html
10
+ } from "./chunk.VOYMQ322.js";
11
+ import {
12
+ __decorateClass
13
+ } from "./chunk.5VURDMKE.js";
14
+
15
+ // libs/core/src/components/theme/theme.ts
16
+ import { property } from "lit/decorators.js";
17
+ var GdsTheme = class extends GdsElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.colorScheme = "light";
21
+ }
22
+ connectedCallback() {
23
+ super.connectedCallback();
24
+ TransitionalStyles.instance.apply(this, "gds-theme");
25
+ }
26
+ render() {
27
+ return html` <slot></slot> `;
28
+ }
29
+ };
30
+ __decorateClass([
31
+ property({ reflect: true, attribute: "color-scheme" })
32
+ ], GdsTheme.prototype, "colorScheme", 2);
33
+ GdsTheme = __decorateClass([
34
+ gdsCustomElement("gds-theme")
35
+ ], GdsTheme);
36
+
37
+ export {
38
+ GdsTheme
39
+ };
@@ -0,0 +1,80 @@
1
+ // libs/core/src/components/grid/grid.style.css.ts
2
+ import { css } from "lit";
3
+ var style = css`
4
+ @layer grid, grid.desktop, grid.tablet, grid.mobile, grid.span, grid.space, grid.align, grid.debug;
5
+
6
+ @layer grid {
7
+ :host {
8
+ --_c: var(--gds-sys-grid-columns-12);
9
+ --_grid-col: repeat(var(--_c), 1fr);
10
+ --_grid-col-start: 1;
11
+ --_grid-col-end: -1;
12
+ --_gap-column: 0;
13
+ --_gap-row: 0;
14
+ display: grid;
15
+ width: 100%;
16
+ grid-template-columns: var(--_grid-col);
17
+ grid-column-gap: var(--_gap-column);
18
+ grid-row-gap: var(--_gap-row);
19
+ padding: var(--_grid-padding);
20
+ text-wrap: balance;
21
+ }
22
+
23
+ :host([auto-columns]) {
24
+ --_col-count: var(--_c, 0);
25
+ --_gap-count: calc(var(--_col-count) - 1);
26
+ --_total-gap-width: calc(var(--_gap-count) * var(--_gap-column, 0px));
27
+ --_col-width-max: calc(
28
+ (100% - var(--_total-gap-width)) / var(--_col-count)
29
+ );
30
+ grid-template-columns: repeat(
31
+ auto-fill,
32
+ minmax(max(var(--_col-width), var(--_col-width-max)), 1fr)
33
+ );
34
+ }
35
+ }
36
+
37
+ /* Responsive */
38
+
39
+ :host([columns]) {
40
+ --_c: var(--_columns-desktop);
41
+ }
42
+
43
+ :host {
44
+ --_gap-column: var(--_gap-desktop);
45
+ --_gap-row: var(--_row-gap-desktop);
46
+ --_grid-padding: var(--_padding-desktop);
47
+ --_col-width: var(--_col-width-desktop);
48
+ }
49
+
50
+ @media only screen and (max-width: 768px) {
51
+ :host([columns]) {
52
+ --_c: var(--_columns-tablet);
53
+ }
54
+
55
+ :host {
56
+ --_gap-column: var(--_gap-tablet);
57
+ --_gap-row: var(--_row-gap-tablet);
58
+ --_grid-padding: var(--_padding-tablet);
59
+ --_col-width: var(--_col-width-tablet);
60
+ }
61
+ }
62
+
63
+ @media only screen and (max-width: 425px) {
64
+ :host([columns]) {
65
+ --_c: var(--_columns-mobile);
66
+ }
67
+
68
+ :host {
69
+ --_gap-column: var(--_gap-mobile);
70
+ --_gap-row: var(--_row-gap-mobile);
71
+ --_grid-padding: var(--_padding-mobile);
72
+ --_col-width: var(--_col-width-mobile);
73
+ }
74
+ }
75
+ `;
76
+ var grid_style_css_default = style;
77
+
78
+ export {
79
+ grid_style_css_default
80
+ };
File without changes
@@ -0,0 +1,139 @@
1
+ import {
2
+ GdsElement
3
+ } from "./chunk.2LQSDOD4.js";
4
+ import {
5
+ watch
6
+ } from "./chunk.2WO4NHJ2.js";
7
+ import {
8
+ __decorateClass,
9
+ __privateAdd,
10
+ __privateGet,
11
+ __privateSet
12
+ } from "./chunk.5VURDMKE.js";
13
+
14
+ // libs/core/src/components/form-control.ts
15
+ import { property } from "lit/decorators.js";
16
+ var _internals;
17
+ var GdsFormControlElement = class extends GdsElement {
18
+ constructor() {
19
+ super();
20
+ __privateAdd(this, _internals, void 0);
21
+ this.invalid = false;
22
+ this.name = "";
23
+ /**
24
+ * Event handler for the form reset event.
25
+ * Can be overridden by subclasses to rcustomize the reset value.
26
+ */
27
+ this._handleFormReset = () => {
28
+ this.value = void 0;
29
+ };
30
+ try {
31
+ __privateSet(this, _internals, this.attachInternals());
32
+ } catch (e) {
33
+ __privateSet(this, _internals, {
34
+ form: this.closest("form"),
35
+ setFormValue: (value) => {
36
+ this.value = value;
37
+ },
38
+ setValidity: (validity, validationMessage) => {
39
+ this.invalid = validity.customError;
40
+ },
41
+ validationMessage: "",
42
+ validity: {
43
+ badInput: false,
44
+ customError: false,
45
+ patternMismatch: false,
46
+ rangeOverflow: false,
47
+ rangeUnderflow: false,
48
+ stepMismatch: false,
49
+ tooLong: false,
50
+ tooShort: false,
51
+ typeMismatch: false,
52
+ valueMissing: false,
53
+ valid: true
54
+ },
55
+ willValidate: true,
56
+ checkValidity: () => true,
57
+ reportValidity: () => true
58
+ });
59
+ }
60
+ }
61
+ get form() {
62
+ return __privateGet(this, _internals).form;
63
+ }
64
+ get validity() {
65
+ return __privateGet(this, _internals).validity;
66
+ }
67
+ get validationMessage() {
68
+ return __privateGet(this, _internals).validationMessage;
69
+ }
70
+ get willValidate() {
71
+ return __privateGet(this, _internals).willValidate;
72
+ }
73
+ checkValidity() {
74
+ return __privateGet(this, _internals).checkValidity();
75
+ }
76
+ reportValidity() {
77
+ return __privateGet(this, _internals).reportValidity();
78
+ }
79
+ connectedCallback() {
80
+ var _a;
81
+ super.connectedCallback();
82
+ (_a = __privateGet(this, _internals).form) == null ? void 0 : _a.addEventListener("reset", this._handleFormReset);
83
+ }
84
+ disconnectedCallback() {
85
+ var _a;
86
+ super.disconnectedCallback();
87
+ (_a = __privateGet(this, _internals).form) == null ? void 0 : _a.removeEventListener("reset", this._handleFormReset);
88
+ }
89
+ __handleValidityChange() {
90
+ __privateGet(this, _internals).setValidity(
91
+ {
92
+ badInput: false,
93
+ customError: this.invalid,
94
+ patternMismatch: false,
95
+ rangeOverflow: false,
96
+ rangeUnderflow: false,
97
+ stepMismatch: false,
98
+ tooLong: false,
99
+ tooShort: false,
100
+ typeMismatch: false,
101
+ valueMissing: false,
102
+ valid: !this.invalid
103
+ },
104
+ this.validationMessage || "Error message"
105
+ );
106
+ }
107
+ __handleValueChange() {
108
+ __privateGet(this, _internals).setFormValue(this.value);
109
+ }
110
+ };
111
+ _internals = new WeakMap();
112
+ GdsFormControlElement.formAssociated = true;
113
+ __decorateClass([
114
+ property({
115
+ type: Boolean,
116
+ reflect: true,
117
+ attribute: "aria-invalid",
118
+ converter: {
119
+ fromAttribute: Boolean,
120
+ toAttribute: (value) => value == null ? void 0 : value.toString()
121
+ }
122
+ })
123
+ ], GdsFormControlElement.prototype, "invalid", 2);
124
+ __decorateClass([
125
+ property()
126
+ ], GdsFormControlElement.prototype, "value", 2);
127
+ __decorateClass([
128
+ property({ reflect: true })
129
+ ], GdsFormControlElement.prototype, "name", 2);
130
+ __decorateClass([
131
+ watch("invalid")
132
+ ], GdsFormControlElement.prototype, "__handleValidityChange", 1);
133
+ __decorateClass([
134
+ watch("value")
135
+ ], GdsFormControlElement.prototype, "__handleValueChange", 1);
136
+
137
+ export {
138
+ GdsFormControlElement
139
+ };
@@ -0,0 +1,54 @@
1
+ import {
2
+ TransitionalStyles
3
+ } from "./chunk.QONSFT2N.js";
4
+ import {
5
+ GdsElement
6
+ } from "./chunk.2LQSDOD4.js";
7
+ import {
8
+ gdsCustomElement
9
+ } from "./chunk.VOYMQ322.js";
10
+ import {
11
+ __decorateClass
12
+ } from "./chunk.5VURDMKE.js";
13
+
14
+ // libs/core/src/primitives/menu/menu-heading.ts
15
+ import { html } from "lit";
16
+
17
+ // libs/core/src/primitives/menu/menu-heading.styles.ts
18
+ import { css } from "lit";
19
+ var style = css`
20
+ @layer base, reset, transitional-styles;
21
+ @layer base {
22
+ :host {
23
+ padding: 0.5 1rem;
24
+ cursor: pointer;
25
+ }
26
+
27
+ :host(:hover) {
28
+ background-color: grey;
29
+ }
30
+ }
31
+ `;
32
+ var menu_heading_styles_default = style;
33
+
34
+ // libs/core/src/primitives/menu/menu-heading.ts
35
+ var GdsMenuHeading = class extends GdsElement {
36
+ connectedCallback() {
37
+ super.connectedCallback();
38
+ this.setAttribute("inert", "true");
39
+ this.updateComplete.then(
40
+ () => TransitionalStyles.instance.apply(this, "gds-menu-heading")
41
+ );
42
+ }
43
+ render() {
44
+ return html`<slot></slot>`;
45
+ }
46
+ };
47
+ GdsMenuHeading.styles = menu_heading_styles_default;
48
+ GdsMenuHeading = __decorateClass([
49
+ gdsCustomElement("gds-menu-heading")
50
+ ], GdsMenuHeading);
51
+
52
+ export {
53
+ GdsMenuHeading
54
+ };
File without changes