@sebgroup/green-core 1.15.0 → 1.16.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.
- package/README.md +101 -7
- package/chunks/chunk.274BU2AI.js +244 -0
- package/chunks/chunk.2LQSDOD4.js +29 -0
- package/chunks/chunk.2ND5EWHE.js +65 -0
- package/chunks/chunk.2OOTOCUG.js +420 -0
- package/chunks/chunk.2WO4NHJ2.js +34 -0
- package/chunks/chunk.2Y3BHFKO.js +154 -0
- package/chunks/chunk.375BWME4.js +29 -0
- package/chunks/chunk.3SEVAGLE.js +96 -0
- package/chunks/chunk.522C22QY.js +460 -0
- package/chunks/chunk.5VURDMKE.js +75 -0
- package/chunks/chunk.6NM7ENKA.js +31 -0
- package/chunks/chunk.6UA66KQU.js +153 -0
- package/chunks/chunk.7P5N6NZL.js +560 -0
- package/chunks/chunk.7TCXY7BP.js +0 -0
- package/chunks/chunk.D7H7CUS4.js +55 -0
- package/chunks/chunk.DFYMYEGD.js +78 -0
- package/chunks/chunk.HS7ICQNA.js +0 -0
- package/chunks/chunk.IYCENQZG.js +28 -0
- package/chunks/chunk.J2A6J77W.js +81 -0
- package/chunks/chunk.KC32OWZE.js +274 -0
- package/chunks/chunk.KV4SDMFS.js +101 -0
- package/chunks/chunk.LUHCF4BJ.js +64 -0
- package/chunks/chunk.MAD5DQMN.js +161 -0
- package/chunks/chunk.MI4A2C2A.js +0 -0
- package/chunks/chunk.NOYHINYP.js +467 -0
- package/chunks/chunk.Q2T57HE7.js +0 -0
- package/chunks/chunk.QONSFT2N.js +4653 -0
- package/chunks/chunk.TMBQL2RO.js +0 -0
- package/chunks/chunk.TN6ZYAH3.js +74 -0
- package/chunks/chunk.TSDZQZBY.js +0 -0
- package/chunks/chunk.TX64TTBN.js +0 -0
- package/chunks/chunk.UF6IEONX.js +0 -0
- package/chunks/chunk.VOYMQ322.js +61 -0
- package/chunks/chunk.VYK7D6QO.js +64 -0
- package/chunks/chunk.WDZ2JTCP.js +360 -0
- package/chunks/chunk.WJDR7FTS.js +193 -0
- package/chunks/chunk.WM7HBMMV.js +54 -0
- package/chunks/chunk.XHTJVQUJ.js +140 -0
- package/chunks/chunk.XI4H54TV.js +39 -0
- package/chunks/chunk.XU4HZLJL.js +0 -0
- package/chunks/chunk.YIQIH4RW.js +139 -0
- package/chunks/chunk.YJHAKLGR.js +54 -0
- package/chunks/chunk.YO24ZYAD.js +0 -0
- package/chunks/chunk.ZTE73BY2.js +655 -0
- package/components/badge/badge.js +245 -0
- package/components/button/button.d.ts +5 -5
- package/components/button/button.js +18 -0
- package/components/button/button.trans.styles.d.ts +2 -0
- package/components/button/index.d.ts +1 -0
- package/components/button/index.js +18 -0
- package/components/checkbox/checkbox.js +219 -0
- package/components/context-menu/context-menu.d.ts +2 -1
- package/components/context-menu/context-menu.js +22 -0
- package/components/context-menu/index.d.ts +3 -0
- package/components/context-menu/index.js +29 -0
- package/components/datepicker/date-part-spinner.js +10 -0
- package/components/datepicker/datepicker.d.ts +3 -2
- package/components/datepicker/datepicker.js +29 -0
- package/components/datepicker/index.d.ts +1 -0
- package/components/datepicker/index.js +29 -0
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +22 -0
- package/components/dropdown/index.d.ts +3 -0
- package/components/dropdown/index.js +30 -0
- package/components/form-control.js +12 -0
- package/components/grid/grid.d.ts +2 -2
- package/components/grid/grid.js +11 -0
- package/components/grid/grid.style.css.js +7 -0
- package/components/grid/index.d.ts +1 -0
- package/components/grid/index.js +11 -0
- package/components/grouped-list/grouped-list.js +14 -0
- package/components/grouped-list/index.d.ts +2 -0
- package/components/grouped-list/index.js +17 -0
- package/components/grouped-list/list-item.js +10 -0
- package/components/icon/icon.d.ts +2 -2
- package/components/icon/icon.js +10 -0
- package/components/icon/index.d.ts +1 -0
- package/components/icon/index.js +10 -0
- package/components/index.d.ts +4 -3
- package/components/index.js +81 -0
- package/components/input/input.js +682 -0
- package/components/radio/radio-group.js +9 -0
- package/components/radio/radio.js +240 -0
- package/components/segmented-control/index.d.ts +1 -0
- package/components/segmented-control/index.js +15 -0
- package/components/segmented-control/segment/index.d.ts +1 -0
- package/components/segmented-control/segment/index.js +13 -0
- package/components/segmented-control/segment/segment.js +12 -0
- package/components/segmented-control/segmented-control.d.ts +1 -1
- package/components/segmented-control/segmented-control.js +15 -0
- package/components/switch/switch.js +164 -0
- package/components/theme/index.d.ts +1 -0
- package/components/theme/index.js +11 -0
- package/components/theme/theme.js +11 -0
- package/components/tooltip/tooltip.js +252 -0
- package/index.js +72 -4278
- package/localization.js +40 -44
- package/package.json +7 -16
- package/primitives/calendar/calendar.js +13 -0
- package/primitives/calendar/functions.js +7 -0
- package/primitives/calendar/index.d.ts +1 -0
- package/primitives/calendar/index.js +14 -0
- package/primitives/listbox/index.d.ts +0 -1
- package/primitives/listbox/index.js +17 -0
- package/primitives/listbox/listbox.d.ts +2 -1
- package/primitives/listbox/listbox.js +16 -0
- package/primitives/listbox/option.js +14 -0
- package/primitives/menu/index.d.ts +1 -0
- package/primitives/menu/index.js +15 -0
- package/primitives/menu/menu-heading.js +11 -0
- package/primitives/menu/menu-item.d.ts +1 -2
- package/primitives/menu/menu-item.js +12 -0
- package/primitives/menu/menu.d.ts +2 -1
- package/primitives/menu/menu.js +14 -0
- package/primitives/popover/index.js +14 -0
- package/primitives/popover/popover.js +13 -0
- package/primitives/ripple/index.d.ts +1 -0
- package/primitives/ripple/index.js +11 -0
- package/primitives/ripple/ripple.d.ts +1 -1
- package/primitives/ripple/ripple.js +10 -0
- package/scoping.d.ts +1 -0
- package/scoping.js +18 -0
- package/transitional-styles.js +6 -4275
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__decorateClass
|
|
3
|
+
} from "../../chunks/chunk.5VURDMKE.js";
|
|
4
|
+
|
|
5
|
+
// libs/core/src/components/tooltip/tooltip.ts
|
|
6
|
+
import { LitElement, html, unsafeCSS } from "lit";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
|
|
9
|
+
// libs/core/src/components/tooltip/style/tooltip.styles.css
|
|
10
|
+
var tooltip_styles_default = `@layer gds-tooltip, tokens, a11y, parts, position, trigger, keyframes;
|
|
11
|
+
|
|
12
|
+
@layer gds-tooltip {
|
|
13
|
+
@layer tokens {
|
|
14
|
+
:host {
|
|
15
|
+
--gds-tooltip-bg-color: #000;
|
|
16
|
+
--gds-tooltip-bg-alpha: 90%;
|
|
17
|
+
--gds-tooltip-fs: 14px;
|
|
18
|
+
--gds-tooltip-bg: color-mix(
|
|
19
|
+
in srgb,
|
|
20
|
+
var(--gds-tooltip-bg-color) var(--gds-tooltip-bg-alpha),
|
|
21
|
+
transparent
|
|
22
|
+
);
|
|
23
|
+
--gds-tooltip-color: #fff;
|
|
24
|
+
--gds-tooltip-offset: 8px;
|
|
25
|
+
--gds-tooltip-arrow: 6px;
|
|
26
|
+
--gds-tooltip-radii: 8px;
|
|
27
|
+
--gds-tooltip-transition-easing: var(--gds-sys-transition-easing);
|
|
28
|
+
display: contents;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (prefers-color-scheme: dark) {
|
|
33
|
+
:host {
|
|
34
|
+
--gds-tooltip-color-bg: var(
|
|
35
|
+
--gds-tooltip-color-bg-dark,
|
|
36
|
+
var(--gds-color-grey-20)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.gds-tooltip {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
position: relative;
|
|
45
|
+
|
|
46
|
+
@layer a11y {
|
|
47
|
+
--gds-tooltip-contrast: var(--gds-sys-transition);
|
|
48
|
+
--gds-tooltip-transition: var(--gds-sys-transition);
|
|
49
|
+
cursor: help;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@layer parts {
|
|
53
|
+
&::before,
|
|
54
|
+
&::after {
|
|
55
|
+
align-items: center;
|
|
56
|
+
display: none;
|
|
57
|
+
font-size: var(--gds-tooltip-fs);
|
|
58
|
+
justify-content: center;
|
|
59
|
+
line-height: 1;
|
|
60
|
+
opacity: 0;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
position: absolute;
|
|
63
|
+
-webkit-user-select: none;
|
|
64
|
+
-moz-user-select: none;
|
|
65
|
+
user-select: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&::before {
|
|
69
|
+
border: var(--gds-tooltip-arrow, 6px) solid transparent;
|
|
70
|
+
content: '';
|
|
71
|
+
z-index: 1001;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&::after {
|
|
75
|
+
background-color: var(--gds-tooltip-bg);
|
|
76
|
+
border-radius: var(--gds-tooltip-radii);
|
|
77
|
+
color: var(--gds-tooltip-color);
|
|
78
|
+
content: attr(content);
|
|
79
|
+
max-inline-size: 50ch;
|
|
80
|
+
min-inline-size: -moz-max-content;
|
|
81
|
+
min-inline-size: max-content;
|
|
82
|
+
offset-anchor: center top;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
padding-block: 1.5ex;
|
|
85
|
+
padding-inline: 2ch;
|
|
86
|
+
text-overflow: ellipsis;
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
z-index: 1000;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&:hover::before,
|
|
92
|
+
&:hover::after {
|
|
93
|
+
display: flex;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@layer position {
|
|
98
|
+
&:not([position])::before,
|
|
99
|
+
&[position^='up']::before {
|
|
100
|
+
border-bottom-width: 0;
|
|
101
|
+
border-top-color: var(--gds-tooltip-bg);
|
|
102
|
+
bottom: calc(100% + 2px);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:not([position])::after,
|
|
106
|
+
&[position^='up']::after {
|
|
107
|
+
bottom: calc(100% + var(--gds-tooltip-offset, 8px));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:not([position])::before,
|
|
111
|
+
&:not([position])::after,
|
|
112
|
+
&[position^='up']::before,
|
|
113
|
+
&[position^='up']::after {
|
|
114
|
+
left: 50%;
|
|
115
|
+
transform: translate(-50%, calc(var(--gds-tooltip-offset, 8px) * -1));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&[position^='down']::before {
|
|
119
|
+
border-bottom-color: var(--gds-tooltip-bg);
|
|
120
|
+
border-top-width: 0;
|
|
121
|
+
top: calc(100% + 2px);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&[position^='down']::after {
|
|
125
|
+
top: calc(100% + var(--gds-tooltip-offset, 8px));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&[position^='down']::before,
|
|
129
|
+
&[position^='down']::after {
|
|
130
|
+
left: 50%;
|
|
131
|
+
transform: translate(-50%, var(--gds-tooltip-offset, 8px));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&[position^='left']::before {
|
|
135
|
+
border-left-color: var(--gds-tooltip-bg);
|
|
136
|
+
border-right-width: 0;
|
|
137
|
+
left: calc(-1px - var(--gds-tooltip-offset, 8px));
|
|
138
|
+
top: 50%;
|
|
139
|
+
transform: translate(calc(var(--gds-tooltip-offset, 8px) * -2), -50%);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&[position^='left']::after {
|
|
143
|
+
right: calc(100% + var(--gds-tooltip-offset, 8px));
|
|
144
|
+
top: 50%;
|
|
145
|
+
transform: translate(calc(var(--gds-tooltip-offset, 8px) * -1), -50%);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&[position^='right']::before {
|
|
149
|
+
border-left-width: 0;
|
|
150
|
+
border-right-color: var(--gds-tooltip-bg);
|
|
151
|
+
right: calc(-1px - var(--gds-tooltip-offset, 8px));
|
|
152
|
+
top: 50%;
|
|
153
|
+
transform: translate(var(--gds-tooltip-offset, 8px), -50%);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&[position^='right']::after {
|
|
157
|
+
left: calc(100% + var(--gds-tooltip-offset, 8px));
|
|
158
|
+
top: 50%;
|
|
159
|
+
transform: translate(var(--gds-tooltip-offset, 8px), -50%);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@layer trigger {
|
|
164
|
+
&:hover:is(
|
|
165
|
+
:not([position]),
|
|
166
|
+
[position^='up'],
|
|
167
|
+
[position^='down']
|
|
168
|
+
)::before,
|
|
169
|
+
&:hover:is(
|
|
170
|
+
:not([position]),
|
|
171
|
+
[position^='up'],
|
|
172
|
+
[position^='down']
|
|
173
|
+
)::after {
|
|
174
|
+
animation: gds-tooltip-animation-y 300ms
|
|
175
|
+
var(--gds-tooltip-transition-easing) forwards;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&:hover:is(
|
|
179
|
+
:not([position]),
|
|
180
|
+
[position^='left'],
|
|
181
|
+
[position^='right']
|
|
182
|
+
)::before,
|
|
183
|
+
&:hover:is(
|
|
184
|
+
:not([position]),
|
|
185
|
+
[position^='left'],
|
|
186
|
+
[position^='right']
|
|
187
|
+
)::after {
|
|
188
|
+
animation: gds-tooltip-animation-h 300ms
|
|
189
|
+
var(--gds-tooltip-transition-easing) forwards;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@layer keyframes {
|
|
195
|
+
@keyframes gds-tooltip-animation-y {
|
|
196
|
+
to {
|
|
197
|
+
opacity: 0.9;
|
|
198
|
+
transform: translate(-50%, 0);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@keyframes gds-tooltip-animation-h {
|
|
203
|
+
to {
|
|
204
|
+
opacity: 0.9;
|
|
205
|
+
transform: translate(0, -50%);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
`;
|
|
211
|
+
|
|
212
|
+
// libs/core/src/components/tooltip/tooltip.ts
|
|
213
|
+
var GdsTooltip = class extends LitElement {
|
|
214
|
+
constructor() {
|
|
215
|
+
super(...arguments);
|
|
216
|
+
this.open = false;
|
|
217
|
+
this.content = null;
|
|
218
|
+
this.position = null;
|
|
219
|
+
}
|
|
220
|
+
render() {
|
|
221
|
+
return html`
|
|
222
|
+
<div
|
|
223
|
+
class="gds-tooltip"
|
|
224
|
+
content=${this.content}
|
|
225
|
+
position=${this.position}
|
|
226
|
+
role="tooltip"
|
|
227
|
+
>
|
|
228
|
+
<slot slot="anchor"></slot>
|
|
229
|
+
</div>
|
|
230
|
+
`;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
GdsTooltip.styles = unsafeCSS(tooltip_styles_default);
|
|
234
|
+
GdsTooltip.shadowRootOptions = {
|
|
235
|
+
mode: "open",
|
|
236
|
+
delegatesFocus: true
|
|
237
|
+
};
|
|
238
|
+
__decorateClass([
|
|
239
|
+
property({ type: Boolean, reflect: true })
|
|
240
|
+
], GdsTooltip.prototype, "open", 2);
|
|
241
|
+
__decorateClass([
|
|
242
|
+
property({ type: String, reflect: true, attribute: "content" })
|
|
243
|
+
], GdsTooltip.prototype, "content", 2);
|
|
244
|
+
__decorateClass([
|
|
245
|
+
property({ type: String, reflect: true, attribute: "position" })
|
|
246
|
+
], GdsTooltip.prototype, "position", 2);
|
|
247
|
+
GdsTooltip = __decorateClass([
|
|
248
|
+
customElement("gds-tooltip")
|
|
249
|
+
], GdsTooltip);
|
|
250
|
+
export {
|
|
251
|
+
GdsTooltip
|
|
252
|
+
};
|