@sebgroup/green-core 1.20.0 → 1.20.2
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.
- package/chunks/{chunk.DFYMYEGD.js → chunk.2X23R32H.js} +0 -1
- package/chunks/{chunk.ZLWSCK7R.js → chunk.4QOFEG6G.js} +17 -8
- package/chunks/{chunk.CGZNEIGV.js → chunk.4ZTSWZUY.js} +6 -7
- package/chunks/{chunk.3KJV6CHY.js → chunk.5EPIZQO6.js} +2 -2
- package/chunks/{chunk.6LA2CKUM.js → chunk.73TOOYEY.js} +1 -1
- package/chunks/{chunk.YDYO7HP5.js → chunk.ATEP56AI.js} +2 -2
- package/chunks/{chunk.NYOCHFZE.js → chunk.BJOJYTQV.js} +5 -5
- package/chunks/{chunk.Z5NACNXH.js → chunk.BLKXWE5L.js} +2 -2
- package/chunks/{chunk.BKSMVF4C.js → chunk.DFTJBJPB.js} +1 -1
- package/chunks/{chunk.Y42J4CV3.js → chunk.FQUH54AY.js} +2 -2
- package/chunks/{chunk.PE6MD3MB.js → chunk.GJ4HS4M4.js} +3 -3
- package/chunks/{chunk.NRYXPR4Z.js → chunk.HHH2BCUH.js} +3 -4
- package/chunks/{chunk.RSCI4LL2.js → chunk.IKRRGS7G.js} +7 -6
- package/chunks/{chunk.YEV6STTM.js → chunk.JG4R6KQ7.js} +1 -1
- package/chunks/{chunk.GOOHCUU6.js → chunk.KMGYMMFU.js} +39 -11
- package/chunks/{chunk.VHKGMBUL.js → chunk.KPNRNWRS.js} +3 -3
- package/chunks/{chunk.BJCCPLEO.js → chunk.LZXR7Q7Q.js} +2 -2
- package/chunks/{chunk.5PHLJFEX.js → chunk.METO6ZWZ.js} +2 -3
- package/chunks/{chunk.XOARVFGN.js → chunk.MZSK66DN.js} +4 -1
- package/chunks/{chunk.EC77QYRA.js → chunk.NI33W56L.js} +2 -2
- package/chunks/{chunk.2RF5VP6K.js → chunk.PKBOP746.js} +4 -4
- package/chunks/{chunk.A62LO4CP.js → chunk.UDH3TBG6.js} +1 -1
- package/chunks/chunk.VOYMQ322.js +1 -1
- package/chunks/{chunk.CH2GIVY6.js → chunk.VXAUXCMI.js} +31 -5
- package/chunks/{chunk.CUR4WRCG.js → chunk.Z43CP7DK.js} +4 -4
- package/chunks/{chunk.W2XAWNZY.js → chunk.ZE4NFOBK.js} +4 -4
- package/chunks/{chunk.EM7MZKG5.js → chunk.ZQ4D5K7J.js} +5 -1
- package/components/button/button.d.ts +5 -2
- package/components/button/button.js +7 -8
- package/components/button/button.trans.styles.js +1 -1
- package/components/button/index.js +7 -8
- package/components/context-menu/context-menu.d.ts +1 -1
- package/components/context-menu/context-menu.js +9 -9
- package/components/context-menu/context-menu.trans.styles.js +1 -1
- package/components/context-menu/index.js +12 -12
- package/components/datepicker/datepicker.js +12 -12
- package/components/datepicker/datepicker.trans.styles.js +1 -1
- package/components/datepicker/index.js +12 -12
- package/components/dropdown/dropdown.d.ts +0 -1
- package/components/dropdown/dropdown.js +9 -9
- package/components/dropdown/dropdown.trans.styles.js +1 -1
- package/components/dropdown/index.js +10 -10
- package/components/filter-chips/filter-chip/filter-chip.d.ts +3 -5
- package/components/filter-chips/filter-chip/filter-chip.js +9 -10
- package/components/filter-chips/filter-chip/filter-chip.trans.styles.js +1 -1
- package/components/filter-chips/filter-chip/index.js +9 -10
- package/components/filter-chips/filter-chips.d.ts +8 -0
- package/components/filter-chips/filter-chips.js +11 -12
- package/components/filter-chips/filter-chips.trans.styles.js +1 -1
- package/components/filter-chips/index.js +11 -12
- package/components/form-control.d.ts +3 -0
- package/components/form-control.js +2 -2
- package/components/grid/grid.d.ts +6 -6
- package/components/grid/grid.js +3 -3
- package/components/grid/index.js +3 -3
- package/components/grouped-list/grouped-list.js +5 -5
- package/components/grouped-list/grouped-list.trans.styles.js +1 -1
- package/components/grouped-list/index.js +5 -5
- package/components/grouped-list/list-item.js +2 -2
- package/components/icon/icon.js +2 -2
- package/components/icon/index.js +2 -2
- package/components/index.js +44 -45
- package/components/radio/radio-group.js +70 -5
- package/components/segmented-control/index.js +7 -5
- package/components/segmented-control/segment/index.js +4 -4
- package/components/segmented-control/segment/segment.js +4 -4
- package/components/segmented-control/segment/segment.trans.styles.js +1 -1
- package/components/segmented-control/segmented-control.d.ts +1 -0
- package/components/segmented-control/segmented-control.js +7 -5
- package/components/segmented-control/segmented-control.trans.styles.js +1 -1
- package/components/theme/index.js +3 -3
- package/components/theme/theme.js +3 -3
- package/components/theme/theme.trans.styles.js +1 -1
- package/gds-element.d.ts +8 -1
- package/index.js +44 -45
- package/mixins/focusable.d.ts +1 -1
- package/package.json +4 -4
- package/primitives/calendar/calendar.d.ts +26 -0
- package/primitives/calendar/calendar.js +3 -3
- package/primitives/calendar/functions.d.ts +1 -1
- package/primitives/calendar/index.js +3 -3
- package/primitives/listbox/index.js +5 -5
- package/primitives/listbox/listbox.d.ts +0 -1
- package/primitives/listbox/listbox.js +5 -5
- package/primitives/listbox/option.d.ts +0 -1
- package/primitives/listbox/option.js +3 -3
- package/primitives/menu/index.js +5 -5
- package/primitives/menu/menu-heading.js +3 -3
- package/primitives/menu/menu-item.js +3 -3
- package/primitives/menu/menu.js +5 -5
- package/primitives/popover/index.js +3 -3
- package/primitives/popover/popover.js +3 -3
- package/primitives/ripple/index.js +2 -2
- package/primitives/ripple/ripple.js +2 -2
- package/transitional-styles.js +1 -1
- package/utils/decorators/observe-light-dom.d.ts +1 -1
- package/utils/decorators/resize-observer.d.ts +1 -1
- package/utils/decorators/watch-media-query.d.ts +1 -1
- package/utils/decorators/watch.d.ts +1 -1
- package/utils/helpers/custom-element-scoping.d.ts +1 -3
- package/utils/localization/localization.d.ts +1 -1
- package/chunks/chunk.3RYYLMGT.js +0 -74
- package/chunks/chunk.YBOK7MI7.js +0 -31
- package/components/badge/badge.d.ts +0 -43
- package/components/badge/badge.js +0 -245
- package/components/checkbox/checkbox.d.ts +0 -12
- package/components/checkbox/checkbox.js +0 -219
- package/components/input/input.d.ts +0 -69
- package/components/input/input.js +0 -658
- package/components/radio/radio.d.ts +0 -14
- package/components/radio/radio.js +0 -240
- package/components/switch/switch.d.ts +0 -12
- package/components/switch/switch.js +0 -164
- package/components/tooltip/tooltip.d.ts +0 -14
- package/components/tooltip/tooltip.js +0 -252
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import "../../chunks/chunk.7TCXY7BP.js";
|
|
2
|
-
import {
|
|
3
|
-
constrainSlots
|
|
4
|
-
} from "../../chunks/chunk.KBYQYDL3.js";
|
|
5
|
-
import {
|
|
6
|
-
__decorateClass,
|
|
7
|
-
__privateAdd,
|
|
8
|
-
__privateSet
|
|
9
|
-
} from "../../chunks/chunk.5VURDMKE.js";
|
|
10
|
-
|
|
11
|
-
// libs/core/src/components/badge/badge.ts
|
|
12
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
13
|
-
import { customElement, property } from "lit/decorators.js";
|
|
14
|
-
import { when } from "lit/directives/when.js";
|
|
15
|
-
|
|
16
|
-
// libs/core/src/components/badge/style/badge.styles.css
|
|
17
|
-
var badge_styles_default = `@layer gds-badge, shell, tokens, a11y, variants, types;
|
|
18
|
-
|
|
19
|
-
@layer gds-badge {
|
|
20
|
-
@layer tokens {
|
|
21
|
-
:host {
|
|
22
|
-
--gds-badge-cl: rgba(53, 53, 49, 1);
|
|
23
|
-
--gds-badge-bg: rgba(243, 243, 242, 1);
|
|
24
|
-
|
|
25
|
-
--gds-badge-cl-information: rgba(53, 53, 49, 1);
|
|
26
|
-
--gds-badge-bg-information: rgba(243, 243, 242, 1);
|
|
27
|
-
|
|
28
|
-
--gds-badge-cl-success: rgba(0, 109, 49, 1);
|
|
29
|
-
--gds-badge-bg-success: rgba(234, 255, 232, 1);
|
|
30
|
-
|
|
31
|
-
--gds-badge-cl-warning: rgba(125, 87, 0, 1);
|
|
32
|
-
--gds-badge-bg-warning: rgba(255, 238, 217, 1);
|
|
33
|
-
|
|
34
|
-
--gds-badge-cl-error: rgba(186, 29, 0, 1);
|
|
35
|
-
--gds-badge-bg-error: rgba(255, 237, 233, 1);
|
|
36
|
-
|
|
37
|
-
--gds-badge-cl-disabled: rgba(157, 157, 149, 1);
|
|
38
|
-
--gds-badge-bg-disabled: rgba(249, 249, 249, 1);
|
|
39
|
-
|
|
40
|
-
--gds-badge-cl-surface: rgba(106, 106, 98, 1);
|
|
41
|
-
--gds-badge-bg-surface: rgba(255, 255, 255, 1);
|
|
42
|
-
|
|
43
|
-
/* Dark Mode */
|
|
44
|
-
--gds-badge-cl-dark: rgba(53, 53, 49, 1);
|
|
45
|
-
--gds-badge-bg-dark: rgba(243, 243, 242, 1);
|
|
46
|
-
|
|
47
|
-
--gds-badge-cl-information-dark: rgba(53, 53, 49, 1);
|
|
48
|
-
--gds-badge-bg-information-dark: rgba(243, 243, 242, 1);
|
|
49
|
-
|
|
50
|
-
--gds-badge-cl-success-dark: rgba(0, 109, 49, 1);
|
|
51
|
-
--gds-badge-bg-success-dark: rgba(234, 255, 232, 1);
|
|
52
|
-
|
|
53
|
-
--gds-badge-cl-warning-dark: rgba(125, 87, 0, 1);
|
|
54
|
-
--gds-badge-bg-warning-dark: rgba(255, 238, 217, 1);
|
|
55
|
-
|
|
56
|
-
--gds-badge-cl-error-dark: rgba(186, 29, 0, 1);
|
|
57
|
-
--gds-badge-bg-error-dark: rgba(255, 237, 233, 1);
|
|
58
|
-
|
|
59
|
-
--gds-badge-cl-disabled-dark: rgba(157, 157, 149, 1);
|
|
60
|
-
--gds-badge-bg-disabled-dark: rgba(249, 249, 249, 1);
|
|
61
|
-
|
|
62
|
-
--gds-badge-cl-surface-dark: rgba(106, 106, 98, 1);
|
|
63
|
-
--gds-badge-bg-surface-dark: rgba(255, 255, 255, 1);
|
|
64
|
-
|
|
65
|
-
--gds-badge-radii: 4px;
|
|
66
|
-
|
|
67
|
-
--gds-badge-fs: 12px;
|
|
68
|
-
--gds-badge-lh: 1;
|
|
69
|
-
--gds-badge-fw: 500;
|
|
70
|
-
--gds-badge-inline-padding: 10px;
|
|
71
|
-
--gds-badge-block-padding: 6px;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
@layer a11y {
|
|
75
|
-
@media (prefers-color-scheme: dark) {
|
|
76
|
-
:host {
|
|
77
|
-
--gds-badge-cl: var(--gds-badge-cl-dark);
|
|
78
|
-
--gds-badge-bg: var(--gds-badge-bg-dark);
|
|
79
|
-
|
|
80
|
-
--gds-badge-cl-information: var(--gds-badge-cl-information-dark);
|
|
81
|
-
--gds-badge-bg-information: var(--gds-badge-bg-information-dark);
|
|
82
|
-
|
|
83
|
-
--gds-badge-cl-success: var(--gds-badge-cl-success-dark);
|
|
84
|
-
--gds-badge-bg-success: var(--gds-badge-bg-success-dark);
|
|
85
|
-
|
|
86
|
-
--gds-badge-cl-warning: var(--gds-badge-cl-warning-dark);
|
|
87
|
-
--gds-badge-bg-warning: var(--gds-badge-bg-warning-dark);
|
|
88
|
-
|
|
89
|
-
--gds-badge-cl-error: var(--gds-badge-cl-error-dark);
|
|
90
|
-
--gds-badge-bg-error: var(--gds-badge-bg-error-dark);
|
|
91
|
-
|
|
92
|
-
--gds-badge-cl-disabled: var(--gds-badge-cl-disabled-dark);
|
|
93
|
-
--gds-badge-bg-disabled: var(--gds-badge-bg-disabled-dark);
|
|
94
|
-
|
|
95
|
-
--gds-badge-cl-surface: var(--gds-badge-cl-surface-dark);
|
|
96
|
-
--gds-badge-bg-surface: var(--gds-badge-bg-surface-dark);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
@media (prefers-reduced-motion: reduce) {
|
|
101
|
-
:host {
|
|
102
|
-
--gds-badge-motion: 0;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@media (prefers-reduced-transparency: reduce) {
|
|
107
|
-
:host {
|
|
108
|
-
--gds-badge-transparency: 1;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
@media (prefers-contrast: more) {
|
|
113
|
-
:root {
|
|
114
|
-
--gds-badge-contrast: 1;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@layer shell {
|
|
120
|
-
.gds-badge {
|
|
121
|
-
align-items: center;
|
|
122
|
-
background-color: var(--gds-badge-bg);
|
|
123
|
-
border-radius: var(--gds-badge-radii);
|
|
124
|
-
color: var(--gds-badge-cl);
|
|
125
|
-
display: flex;
|
|
126
|
-
font-size: var(--gds-badge-fs);
|
|
127
|
-
font-weight: var(--gds-badge-fw);
|
|
128
|
-
gap: 1ch;
|
|
129
|
-
height: 1lh;
|
|
130
|
-
justify-content: center;
|
|
131
|
-
letter-spacing: normal;
|
|
132
|
-
line-height: var(--gds-badge-lh);
|
|
133
|
-
max-width: -moz-max-content;
|
|
134
|
-
max-width: max-content;
|
|
135
|
-
padding-block: var(--gds-badge-block-padding);
|
|
136
|
-
padding-inline: var(--gds-badge-inline-padding);
|
|
137
|
-
text-overflow: ellipsis;
|
|
138
|
-
text-transform: uppercase;
|
|
139
|
-
white-space: nowrap;
|
|
140
|
-
|
|
141
|
-
@layer variants {
|
|
142
|
-
:host([variant='information']) & {
|
|
143
|
-
--gds-badge-cl: var(--gds-badge-cl-information);
|
|
144
|
-
--gds-badge-bg: var(--gds-badge-bg-information);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
:host([variant='success']) & {
|
|
148
|
-
--gds-badge-cl: var(--gds-badge-cl-success);
|
|
149
|
-
--gds-badge-bg: var(--gds-badge-bg-success);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
:host([variant='warning']) & {
|
|
153
|
-
--gds-badge-cl: var(--gds-badge-cl-warning);
|
|
154
|
-
--gds-badge-bg: var(--gds-badge-bg-warning);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
:host([variant='error']) & {
|
|
158
|
-
--gds-badge-cl: var(--gds-badge-cl-error);
|
|
159
|
-
--gds-badge-bg: var(--gds-badge-bg-error);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
:host([variant='disabled']) & {
|
|
163
|
-
--gds-badge-cl: var(--gds-badge-cl-disabled);
|
|
164
|
-
--gds-badge-bg: var(--gds-badge-bg-disabled);
|
|
165
|
-
pointer-events: none;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
:host([variant='surface']) & {
|
|
169
|
-
--gds-badge-cl: var(--gds-badge-cl-surface);
|
|
170
|
-
--gds-badge-bg: var(--gds-badge-bg-surface);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
@layer types {
|
|
175
|
-
:host([type='counter']) & {
|
|
176
|
-
max-width: var(--gds-badge-counter-max-width);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
`;
|
|
183
|
-
|
|
184
|
-
// libs/core/src/components/badge/badge.ts
|
|
185
|
-
var _internals;
|
|
186
|
-
var GdsBadge = class extends LitElement {
|
|
187
|
-
constructor() {
|
|
188
|
-
super();
|
|
189
|
-
// Private members
|
|
190
|
-
__privateAdd(this, _internals, void 0);
|
|
191
|
-
this.variant = "";
|
|
192
|
-
this.type = "";
|
|
193
|
-
this.icon = "";
|
|
194
|
-
__privateSet(this, _internals, this.attachInternals());
|
|
195
|
-
constrainSlots(this);
|
|
196
|
-
}
|
|
197
|
-
slotIcon() {
|
|
198
|
-
return html` <slot name="icon" gds-allow="gds-icon"></slot> `;
|
|
199
|
-
}
|
|
200
|
-
slotLabel() {
|
|
201
|
-
var _a;
|
|
202
|
-
const content = ((_a = this.textContent) == null ? void 0 : _a.trim()) || "";
|
|
203
|
-
const hasLabel = content !== "";
|
|
204
|
-
let label = content;
|
|
205
|
-
if (this.type.toLowerCase() === "counter" && label.length > 4) {
|
|
206
|
-
label = label.substring(0, 4);
|
|
207
|
-
return hasLabel ? html`${label}` : "";
|
|
208
|
-
}
|
|
209
|
-
return hasLabel ? html`<slot part="label" gds-allow="#text"></slot>` : "";
|
|
210
|
-
}
|
|
211
|
-
// slotLabel() {
|
|
212
|
-
// return this.textContent
|
|
213
|
-
// ? html`<slot part="label" gds-allow="#text"></slot>`
|
|
214
|
-
// : ''
|
|
215
|
-
// }
|
|
216
|
-
render() {
|
|
217
|
-
const hasIconSlot = this.querySelector('[slot="icon"]') !== null;
|
|
218
|
-
const content = html`${when(
|
|
219
|
-
hasIconSlot,
|
|
220
|
-
() => html`<slot name="icon" gds-allow="gds-icon"></slot>`
|
|
221
|
-
)}${this.slotLabel()}`;
|
|
222
|
-
return html`<div class="gds-badge">${content}</div>`;
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
_internals = new WeakMap();
|
|
226
|
-
GdsBadge.styles = unsafeCSS(badge_styles_default);
|
|
227
|
-
GdsBadge.shadowRootOptions = {
|
|
228
|
-
mode: "open",
|
|
229
|
-
delegatesFocus: true
|
|
230
|
-
};
|
|
231
|
-
__decorateClass([
|
|
232
|
-
property({ type: String, reflect: true, attribute: "variant" })
|
|
233
|
-
], GdsBadge.prototype, "variant", 2);
|
|
234
|
-
__decorateClass([
|
|
235
|
-
property({ type: String, reflect: true, attribute: "type" })
|
|
236
|
-
], GdsBadge.prototype, "type", 2);
|
|
237
|
-
__decorateClass([
|
|
238
|
-
property({ type: String, reflect: true, attribute: "icon" })
|
|
239
|
-
], GdsBadge.prototype, "icon", 2);
|
|
240
|
-
GdsBadge = __decorateClass([
|
|
241
|
-
customElement("gds-badge")
|
|
242
|
-
], GdsBadge);
|
|
243
|
-
export {
|
|
244
|
-
GdsBadge
|
|
245
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class GdsCheckbox extends LitElement {
|
|
3
|
-
#private;
|
|
4
|
-
static styles: import("lit").CSSResult;
|
|
5
|
-
static shadowRootOptions: ShadowRootInit;
|
|
6
|
-
constructor();
|
|
7
|
-
private inputElement;
|
|
8
|
-
private exludeAttr;
|
|
9
|
-
private reflectAttributesToInput;
|
|
10
|
-
update(changedProperties: Map<PropertyKey, unknown>): void;
|
|
11
|
-
render(): import("lit").TemplateResult<1>;
|
|
12
|
-
}
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import "../../chunks/chunk.7TCXY7BP.js";
|
|
2
|
-
import {
|
|
3
|
-
constrainSlots
|
|
4
|
-
} from "../../chunks/chunk.KBYQYDL3.js";
|
|
5
|
-
import {
|
|
6
|
-
__decorateClass,
|
|
7
|
-
__privateAdd,
|
|
8
|
-
__privateSet
|
|
9
|
-
} from "../../chunks/chunk.5VURDMKE.js";
|
|
10
|
-
|
|
11
|
-
// libs/core/src/components/checkbox/checkbox.ts
|
|
12
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
13
|
-
import { customElement } from "lit/decorators.js";
|
|
14
|
-
|
|
15
|
-
// libs/core/src/components/checkbox/checkbox.css
|
|
16
|
-
var checkbox_default = `:host {
|
|
17
|
-
--gds-checkbox-bg-color: hsl(0, 0%, 100%);
|
|
18
|
-
--gds-checkbox-border-color: hsla(60, 4%, 50%, 1);
|
|
19
|
-
--gds-checkbox-border-width: 2px;
|
|
20
|
-
--gds-checkbox-border-radius: 4px;
|
|
21
|
-
--gds-checkbox-color-hover: hsla(60, 6%, 90%, 1);
|
|
22
|
-
--gds-checkbox-color-active: hsla(60, 4%, 85%, 1);
|
|
23
|
-
--gds-checkbox-checked-color: hsla(60, 4%, 20%, 1);
|
|
24
|
-
--gds-checkbox-color-tick: hsl(0, 0%, 100%);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.gds-checkbox {
|
|
28
|
-
align-items: center;
|
|
29
|
-
border-radius: calc(var(--gds-checkbox-border-radius) * 2);
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
display: flex;
|
|
32
|
-
height: 32px;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
position: relative;
|
|
35
|
-
transition: all 248ms ease-in-out;
|
|
36
|
-
width: 32px;
|
|
37
|
-
|
|
38
|
-
input {
|
|
39
|
-
-webkit-appearance: none;
|
|
40
|
-
-moz-appearance: none;
|
|
41
|
-
appearance: none;
|
|
42
|
-
aspect-ratio: 1/1;
|
|
43
|
-
background-color: var(--gds-checkbox-bg-color);
|
|
44
|
-
border: var(--gds-checkbox-border-width) solid
|
|
45
|
-
var(--gds-checkbox-border-color);
|
|
46
|
-
border-radius: var(--gds-checkbox-border-radius);
|
|
47
|
-
box-sizing: border-box;
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
height: 16px;
|
|
50
|
-
margin: unset;
|
|
51
|
-
padding: unset;
|
|
52
|
-
position: relative;
|
|
53
|
-
transition: all 248ms cubic-bezier(0.2, 0.85, 0.32, 1.2);
|
|
54
|
-
width: 16px;
|
|
55
|
-
|
|
56
|
-
&::after {
|
|
57
|
-
border: var(--gds-checkbox-border-width) solid
|
|
58
|
-
var(--gds-checkbox-color-tick);
|
|
59
|
-
border-left: 0;
|
|
60
|
-
border-top: 0;
|
|
61
|
-
box-sizing: border-box;
|
|
62
|
-
content: '';
|
|
63
|
-
height: 8px;
|
|
64
|
-
inset: 1px 0 0 3.5px;
|
|
65
|
-
opacity: 0;
|
|
66
|
-
pointer-events: none;
|
|
67
|
-
position: absolute;
|
|
68
|
-
rotate: 43deg;
|
|
69
|
-
scale: 0.8;
|
|
70
|
-
transition: all 248ms cubic-bezier(0.2, 0.85, 0.32, 1.2);
|
|
71
|
-
width: 5px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&:checked {
|
|
75
|
-
background-color: var(--gds-checkbox-checked-color);
|
|
76
|
-
border-color: var(--gds-checkbox-checked-color);
|
|
77
|
-
color: var(--gds-checkbox-checked-color-tick);
|
|
78
|
-
|
|
79
|
-
&::after {
|
|
80
|
-
opacity: 1;
|
|
81
|
-
scale: 1;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&[indeterminate],
|
|
86
|
-
&:indeterminate {
|
|
87
|
-
&::after {
|
|
88
|
-
border-left: 0;
|
|
89
|
-
border-radius: 0;
|
|
90
|
-
border-top: 0;
|
|
91
|
-
height: var(--gds-checkbox-border-width);
|
|
92
|
-
inset: 5px 0 0 2px;
|
|
93
|
-
opacity: 1;
|
|
94
|
-
rotate: 0deg;
|
|
95
|
-
scale: 1;
|
|
96
|
-
width: 8px;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
&:disabled {
|
|
101
|
-
cursor: not-allowed;
|
|
102
|
-
opacity: 0.5;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&:hover:has(input:not([disabled])) {
|
|
107
|
-
background-color: var(--gds-checkbox-color-hover);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&:active:has(input:not([disabled])) {
|
|
111
|
-
background-color: var(--gds-checkbox-color-active);
|
|
112
|
-
|
|
113
|
-
.gds-checkbox-core {
|
|
114
|
-
border-color: var(--gds-checkbox-checked-color);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
&:has(input:checked) {
|
|
119
|
-
background-color: var(--gds-checkbox-color-hover);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
&:has(input:disabled) {
|
|
123
|
-
cursor: not-allowed;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* Invalid state */
|
|
127
|
-
|
|
128
|
-
&:has(input:invalid) {
|
|
129
|
-
--gds-checkbox-bg-color: hsla(13, 75%, 95%, 1);
|
|
130
|
-
--gds-checkbox-border-color: hsla(9, 75%, 38%, 1);
|
|
131
|
-
--gds-checkbox-checked-color: hsla(9, 75%, 38%, 1);
|
|
132
|
-
--gds-checkbox-color-active: hsla(12, 78%, 86%, 1);
|
|
133
|
-
--gds-checkbox-color-hover: hsla(12, 75%, 91%, 1);
|
|
134
|
-
--gds-checkbox-color-tick: hsla(0, 0%, 100%, 1);
|
|
135
|
-
|
|
136
|
-
input {
|
|
137
|
-
&::after {
|
|
138
|
-
border-color: var(--gds-checkbox-color-tick);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&:checked {
|
|
142
|
-
background-color: var(--gds-checkbox-checked-color);
|
|
143
|
-
border-color: var(--gds-checkbox-checked-color);
|
|
144
|
-
color: var(--gds-checkbox-checked-color-tick);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
&:hover:has(input:not([disabled])) {
|
|
149
|
-
background-color: var(--gds-checkbox-color-hover);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&:active:has(input:not([disabled])) {
|
|
153
|
-
background-color: var(--gds-checkbox-color-active);
|
|
154
|
-
|
|
155
|
-
.gds-checkbox-core {
|
|
156
|
-
border-color: var(--gds-checkbox-checked-color);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
&:has(input:checked) {
|
|
161
|
-
background-color: var(--gds-checkbox-color-hover);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
`;
|
|
166
|
-
|
|
167
|
-
// libs/core/src/components/checkbox/checkbox.ts
|
|
168
|
-
var _internals;
|
|
169
|
-
var GdsCheckbox = class extends LitElement {
|
|
170
|
-
constructor() {
|
|
171
|
-
super();
|
|
172
|
-
// Private members
|
|
173
|
-
__privateAdd(this, _internals, void 0);
|
|
174
|
-
this.inputElement = null;
|
|
175
|
-
this.exludeAttr = ["id", "label"];
|
|
176
|
-
__privateSet(this, _internals, this.attachInternals());
|
|
177
|
-
constrainSlots(this);
|
|
178
|
-
}
|
|
179
|
-
reflectAttributesToInput() {
|
|
180
|
-
if (this.inputElement) {
|
|
181
|
-
const attributes = this.attributes;
|
|
182
|
-
for (let i = 0; i < attributes.length; i++) {
|
|
183
|
-
const attribute = attributes[i];
|
|
184
|
-
if (!this.exludeAttr.includes(attribute.name)) {
|
|
185
|
-
this.inputElement.setAttribute(attribute.name, attribute.value);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
update(changedProperties) {
|
|
191
|
-
var _a;
|
|
192
|
-
super.update(changedProperties);
|
|
193
|
-
if (!this.inputElement) {
|
|
194
|
-
this.inputElement = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById(
|
|
195
|
-
"checkbox"
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
this.reflectAttributesToInput();
|
|
199
|
-
}
|
|
200
|
-
render() {
|
|
201
|
-
return html`
|
|
202
|
-
<label class="gds-checkbox">
|
|
203
|
-
<input id="checkbox" type="checkbox" />
|
|
204
|
-
</label>
|
|
205
|
-
`;
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
_internals = new WeakMap();
|
|
209
|
-
GdsCheckbox.styles = unsafeCSS(checkbox_default);
|
|
210
|
-
GdsCheckbox.shadowRootOptions = {
|
|
211
|
-
mode: "open",
|
|
212
|
-
delegatesFocus: true
|
|
213
|
-
};
|
|
214
|
-
GdsCheckbox = __decorateClass([
|
|
215
|
-
customElement("gds-checkbox")
|
|
216
|
-
], GdsCheckbox);
|
|
217
|
-
export {
|
|
218
|
-
GdsCheckbox
|
|
219
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { GdsFormControlElement } from '../form-control';
|
|
2
|
-
/**
|
|
3
|
-
* @summary A custom input element that can be used in forms.
|
|
4
|
-
* @status beta
|
|
5
|
-
*
|
|
6
|
-
* @element gds-input
|
|
7
|
-
*.
|
|
8
|
-
* @slot lead - Accepts `gds-icon`. Use this to place an icon in the start of the field.
|
|
9
|
-
* @slot trail - Accepts `gds-badge`. Use this to place a badge in the field, for displaying currency for example.
|
|
10
|
-
* @slot extended-supporting-text - A longer supporting text can be placed here. It will be
|
|
11
|
-
* displayed in a panel when the user clicks the info button.
|
|
12
|
-
*/
|
|
13
|
-
export declare class GdsInput extends GdsFormControlElement<string> {
|
|
14
|
-
#private;
|
|
15
|
-
static shadowRootOptions: {
|
|
16
|
-
delegatesFocus: boolean;
|
|
17
|
-
mode: ShadowRootMode;
|
|
18
|
-
slotAssignment?: SlotAssignmentMode | undefined;
|
|
19
|
-
};
|
|
20
|
-
static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
|
|
21
|
-
value: string;
|
|
22
|
-
/**
|
|
23
|
-
* The label displayed above the field
|
|
24
|
-
*/
|
|
25
|
-
label: string;
|
|
26
|
-
/**
|
|
27
|
-
* The supporting text displayed between the label and the field itself
|
|
28
|
-
*/
|
|
29
|
-
supportingText: string;
|
|
30
|
-
/**
|
|
31
|
-
* Whether the supporting text should be displayed or not.
|
|
32
|
-
*/
|
|
33
|
-
showExtendedSupportingText: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Whether the field should be clearable or not. Clearable fields will display a clear button when
|
|
36
|
-
* the field has a value.
|
|
37
|
-
*/
|
|
38
|
-
clearable: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* The maximum number of characters allowed in the field.
|
|
41
|
-
*/
|
|
42
|
-
maxlength: number;
|
|
43
|
-
/**
|
|
44
|
-
* The variant of the input field. The default variant displays a label, supporting text, and
|
|
45
|
-
* extended supporting text. The simplified variant only displays the field itself and the
|
|
46
|
-
* supporting text below.
|
|
47
|
-
*
|
|
48
|
-
* The simplified variant should only be used in specific cases, for example when the input field
|
|
49
|
-
* is placed inside a table cell or in a space-constrained layout.
|
|
50
|
-
*
|
|
51
|
-
* A typical form should use the default variant.
|
|
52
|
-
*/
|
|
53
|
-
variant: 'default' | 'simplified';
|
|
54
|
-
/**
|
|
55
|
-
* Whether the input field should be multiline or not. Multiline fields will render a textarea
|
|
56
|
-
* internally instead of an input.
|
|
57
|
-
*/
|
|
58
|
-
multiline: boolean;
|
|
59
|
-
private elInput;
|
|
60
|
-
private elExtendedSupportingTextSlot;
|
|
61
|
-
constructor();
|
|
62
|
-
connectedCallback(): void;
|
|
63
|
-
render(): any;
|
|
64
|
-
private _setAutoHeight;
|
|
65
|
-
/**
|
|
66
|
-
* Event handler for the form reset event.
|
|
67
|
-
*/
|
|
68
|
-
_handleFormReset: () => void;
|
|
69
|
-
}
|