@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.
Files changed (124) hide show
  1. package/README.md +101 -7
  2. package/chunks/chunk.274BU2AI.js +244 -0
  3. package/chunks/chunk.2LQSDOD4.js +29 -0
  4. package/chunks/chunk.2ND5EWHE.js +65 -0
  5. package/chunks/chunk.2OOTOCUG.js +420 -0
  6. package/chunks/chunk.2WO4NHJ2.js +34 -0
  7. package/chunks/chunk.2Y3BHFKO.js +154 -0
  8. package/chunks/chunk.375BWME4.js +29 -0
  9. package/chunks/chunk.3SEVAGLE.js +96 -0
  10. package/chunks/chunk.522C22QY.js +460 -0
  11. package/chunks/chunk.5VURDMKE.js +75 -0
  12. package/chunks/chunk.6NM7ENKA.js +31 -0
  13. package/chunks/chunk.6UA66KQU.js +153 -0
  14. package/chunks/chunk.7P5N6NZL.js +560 -0
  15. package/chunks/chunk.7TCXY7BP.js +0 -0
  16. package/chunks/chunk.D7H7CUS4.js +55 -0
  17. package/chunks/chunk.DFYMYEGD.js +78 -0
  18. package/chunks/chunk.HS7ICQNA.js +0 -0
  19. package/chunks/chunk.IYCENQZG.js +28 -0
  20. package/chunks/chunk.J2A6J77W.js +81 -0
  21. package/chunks/chunk.KC32OWZE.js +274 -0
  22. package/chunks/chunk.KV4SDMFS.js +101 -0
  23. package/chunks/chunk.LUHCF4BJ.js +64 -0
  24. package/chunks/chunk.MAD5DQMN.js +161 -0
  25. package/chunks/chunk.MI4A2C2A.js +0 -0
  26. package/chunks/chunk.NOYHINYP.js +467 -0
  27. package/chunks/chunk.Q2T57HE7.js +0 -0
  28. package/chunks/chunk.QONSFT2N.js +4653 -0
  29. package/chunks/chunk.TMBQL2RO.js +0 -0
  30. package/chunks/chunk.TN6ZYAH3.js +74 -0
  31. package/chunks/chunk.TSDZQZBY.js +0 -0
  32. package/chunks/chunk.TX64TTBN.js +0 -0
  33. package/chunks/chunk.UF6IEONX.js +0 -0
  34. package/chunks/chunk.VOYMQ322.js +61 -0
  35. package/chunks/chunk.VYK7D6QO.js +64 -0
  36. package/chunks/chunk.WDZ2JTCP.js +360 -0
  37. package/chunks/chunk.WJDR7FTS.js +193 -0
  38. package/chunks/chunk.WM7HBMMV.js +54 -0
  39. package/chunks/chunk.XHTJVQUJ.js +140 -0
  40. package/chunks/chunk.XI4H54TV.js +39 -0
  41. package/chunks/chunk.XU4HZLJL.js +0 -0
  42. package/chunks/chunk.YIQIH4RW.js +139 -0
  43. package/chunks/chunk.YJHAKLGR.js +54 -0
  44. package/chunks/chunk.YO24ZYAD.js +0 -0
  45. package/chunks/chunk.ZTE73BY2.js +655 -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 -4278
  98. package/localization.js +40 -44
  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,682 @@
1
+ import {
2
+ GdsFormControlElement
3
+ } from "../../chunks/chunk.YIQIH4RW.js";
4
+ import {
5
+ tokens
6
+ } from "../../chunks/chunk.7P5N6NZL.js";
7
+ import "../../chunks/chunk.WM7HBMMV.js";
8
+ import "../../chunks/chunk.2LQSDOD4.js";
9
+ import "../../chunks/chunk.7TCXY7BP.js";
10
+ import {
11
+ constrainSlots
12
+ } from "../../chunks/chunk.6NM7ENKA.js";
13
+ import "../../chunks/chunk.YO24ZYAD.js";
14
+ import {
15
+ watch
16
+ } from "../../chunks/chunk.2WO4NHJ2.js";
17
+ import {
18
+ gdsCustomElement,
19
+ html
20
+ } from "../../chunks/chunk.VOYMQ322.js";
21
+ import {
22
+ __decorateClass,
23
+ __privateAdd,
24
+ __privateGet,
25
+ __privateMethod,
26
+ __spreadProps,
27
+ __spreadValues
28
+ } from "../../chunks/chunk.5VURDMKE.js";
29
+
30
+ // libs/core/src/components/input/input.ts
31
+ import { LitElement, unsafeCSS } from "lit";
32
+ import { property, queryAsync } from "lit/decorators.js";
33
+ import { until } from "lit/directives/until.js";
34
+ import { nothing as nothing2 } from "lit/html.js";
35
+ import { when } from "lit/directives/when.js";
36
+ import { choose } from "lit/directives/choose.js";
37
+ import { msg } from "@lit/localize";
38
+
39
+ // libs/core/src/utils/directives/forward-attributes.ts
40
+ import { Directive, PartType, directive } from "lit/directive.js";
41
+ import { nothing } from "lit/html.js";
42
+ var ForwardAttributesDirective = class extends Directive {
43
+ constructor(partInfo) {
44
+ super(partInfo);
45
+ if (partInfo.type !== PartType.ELEMENT) {
46
+ throw new Error(
47
+ "The `forwardAttributes` directive must be used in element bindings"
48
+ );
49
+ }
50
+ }
51
+ render(_filter) {
52
+ return nothing;
53
+ }
54
+ update(part, [filter]) {
55
+ var _a;
56
+ const element = part.element;
57
+ const host = (_a = part.options) == null ? void 0 : _a.host;
58
+ Array.from(host.attributes).forEach((attr) => {
59
+ if (filter(attr)) {
60
+ element.setAttribute(attr.name, attr.value);
61
+ }
62
+ });
63
+ }
64
+ };
65
+ var forwardAttributes = directive(ForwardAttributesDirective);
66
+
67
+ // libs/core/src/components/input/input.styles.css
68
+ var input_styles_default = `@layer tokens, a11y, base, simplified;
69
+
70
+ @layer tokens {
71
+ :host {
72
+ --_color-bg: var(--gds-sys-color-container-container);
73
+
74
+ --_color-border: var(--gds-sys-color-stroke-stroke);
75
+ --_border-radius: 0.5rem;
76
+ --_border-width: 0.0625rem;
77
+ --_border-width-hover: 0.125rem;
78
+
79
+ --_color-outline-alpha: 60%;
80
+ --_color-outline: color-mix(
81
+ in srgb,
82
+ var(--_color-border),
83
+ transparent var(--_color-outline-alpha)
84
+ );
85
+
86
+ --_transition: var(--gds-sys-transition);
87
+ --_lh: 1.25;
88
+ --_core-min-block-size: 3.5rem;
89
+ --_gap: 0.5rem;
90
+ --_padding-block: 0.625rem;
91
+ --_padding-inline: 1rem;
92
+ --_core-icon-size: 1.5rem;
93
+ --_inner-height: 2rem;
94
+ }
95
+ }
96
+
97
+ @layer a11y {
98
+ /* @media (prefers-color-scheme: dark) {
99
+ :host {
100
+ --_color-bg: var(--_color-bg-dark);
101
+ }
102
+ } */
103
+
104
+ @media (prefers-reduced-motion: reduce) {
105
+ :host {
106
+ --_transition: none;
107
+ }
108
+ }
109
+
110
+ @media (prefers-reduced-transparency: reduce) {
111
+ :host {
112
+ --_transparency: 1;
113
+ }
114
+ }
115
+
116
+ /* @media (prefers-contrast: more) {
117
+ :host {
118
+ --_color-bg: hsla(60, 4%, 96%, 1);
119
+ --_color-outline-alpha: 0%;
120
+ }
121
+ } */
122
+ }
123
+
124
+ @layer base {
125
+ * {
126
+ box-sizing: border-box;
127
+ }
128
+
129
+ :host {
130
+ contain: layout;
131
+ display: block;
132
+ isolation: isolate;
133
+ }
134
+
135
+ .head {
136
+ align-items: center;
137
+ display: flex;
138
+ justify-content: space-between;
139
+ padding-inline-end: 1rem;
140
+ }
141
+
142
+ label {
143
+ font-weight: 400;
144
+ }
145
+
146
+ .foot {
147
+ align-items: center;
148
+ display: flex;
149
+ justify-content: space-between;
150
+ padding-inline-end: 1rem;
151
+
152
+ gds-badge {
153
+ align-self: flex-end;
154
+ }
155
+
156
+ :first-child {
157
+ flex-grow: 1;
158
+ }
159
+ }
160
+
161
+ .supporting-text,
162
+ .error-text {
163
+ font-size: 0.875rem;
164
+ }
165
+
166
+ slot[name='extended-supporting-text'] {
167
+ background-color: #eee;
168
+ border: 1px solid #ccc;
169
+ border-radius: 0.5rem;
170
+ display: block;
171
+ font-size: 0.875rem;
172
+ margin-top: 0.5rem;
173
+ opacity: 0;
174
+ padding: 1rem;
175
+ transition: var(--_transition);
176
+
177
+ [aria-hidden='false'] & {
178
+ opacity: 1;
179
+ }
180
+ }
181
+
182
+ div.extended-supporting-text {
183
+ display: grid;
184
+ grid-template-rows: 0fr;
185
+ transition: var(--_transition);
186
+
187
+ > * {
188
+ overflow: hidden;
189
+ }
190
+
191
+ &[aria-hidden='false'] {
192
+ grid-template-rows: 1fr;
193
+ opacity: 1;
194
+ }
195
+ }
196
+
197
+ input[type='number']::-webkit-inner-spin-button {
198
+ display: none;
199
+ }
200
+
201
+ input,
202
+ textarea {
203
+ -webkit-appearance: none;
204
+ -moz-appearance: none;
205
+ appearance: none;
206
+ background-color: transparent;
207
+ border: 0;
208
+ box-sizing: border-box;
209
+ font-family: inherit;
210
+ font-size: var(--_fs);
211
+ line-height: var(--_lh);
212
+ margin: unset;
213
+ min-height: var(--_inner-height);
214
+ outline: none;
215
+ overflow: hidden;
216
+ padding: unset;
217
+ transition: var(--_transition);
218
+ width: 100%;
219
+
220
+ &:focus:not(:focus-visible) {
221
+ outline: none;
222
+ }
223
+
224
+ &::-webkit-inner-spin-button,
225
+ &::-webkit-calendar-picker-indicator {
226
+ -webkit-appearance: none;
227
+ appearance: none;
228
+ background-color: rgb(195, 0, 255);
229
+ background-image: none;
230
+ height: 100%;
231
+ position: absolute;
232
+ right: 0;
233
+ top: 0;
234
+ width: 40px;
235
+ }
236
+ }
237
+
238
+ textarea {
239
+ max-height: max(var(--_inner-height), calc(1lh * var(--_lines)));
240
+ min-height: max(var(--_inner-height), calc(1lh * var(--_lines)));
241
+ overflow: hidden;
242
+ resize: none;
243
+ transition: unset;
244
+ }
245
+
246
+ .field {
247
+ align-items: flex-start;
248
+ background-color: var(--_color-bg);
249
+ block-size: -moz-max-content;
250
+ block-size: max-content;
251
+ border: var(--_border-width-hover) solid transparent;
252
+ border-block-end-color: transparent;
253
+ border-start-end-radius: var(--_border-radius);
254
+ border-start-start-radius: var(--_border-radius);
255
+ box-shadow: 0 var(--_border-width) 0 var(--_color-border);
256
+ cursor: text;
257
+ display: flex;
258
+ flex-direction: row;
259
+ gap: var(--_gap);
260
+ justify-content: center;
261
+ margin-block: var(--_gap);
262
+ min-block-size: var(--_core-min-block-size);
263
+ outline-color: transparent;
264
+ outline-offset: var(--_border-width);
265
+ outline-style: solid;
266
+ outline-width: var(--_border-width-hover);
267
+ padding-block: var(--_padding-block);
268
+ padding-inline: var(--_padding-inline);
269
+ position: relative;
270
+ transition: var(--_transition);
271
+
272
+ &:focus:not(:focus-visible) {
273
+ outline: none;
274
+ }
275
+
276
+ &:hover {
277
+ --_border-width: var(--_border-width-hover);
278
+ }
279
+
280
+ &:has(input:focus, textarea:focus) {
281
+ --_border-width: var(--_border-width-hover);
282
+ border: var(--_border-width) solid var(--_color-border);
283
+ border-radius: var(--_border-radius);
284
+ box-shadow: none;
285
+ outline-color: var(--_color-outline);
286
+ transition: var(--_transition);
287
+ }
288
+
289
+ slot {
290
+ align-items: center;
291
+ display: flex;
292
+ height: var(--_inner-height);
293
+ }
294
+ }
295
+
296
+ :host(:invalid) .field {
297
+ --_color-bg: var(--gds-sys-color-status-negative-negative-bright);
298
+ --_color-border: var(--gds-sys-color-stroke-stroke-negative);
299
+ --_color-outline: var(--gds-sys-color-stroke-stroke-negative);
300
+ color: var(--gds-sys-color-status-negative-on-negative-bright);
301
+ }
302
+
303
+ :host(:invalid) .error-text {
304
+ color: var(--gds-sys-color-status-negative-on-negative-bright);
305
+ }
306
+
307
+ :host(:invalid) label {
308
+ color: var(--gds-sys-color-status-negative-on-negative-bright);
309
+ }
310
+ }
311
+
312
+ @layer simplified {
313
+ :host([variant='simplified']) label {
314
+ align-items: center;
315
+ background-color: transparent;
316
+ display: block;
317
+ height: -moz-max-content;
318
+ height: max-content;
319
+ inset: 0;
320
+ width: 100%;
321
+
322
+ div {
323
+ line-height: var(--_lh);
324
+ position: absolute;
325
+ top: 50%;
326
+ transform: translateY(-50%);
327
+ transition: var(--_transition);
328
+ }
329
+ }
330
+
331
+ :host([variant='simplified'])
332
+ label:has(
333
+ input:not(:-moz-placeholder-shown, [readonly]),
334
+ textarea:not(:-moz-placeholder-shown, [readonly])
335
+ ) {
336
+ div {
337
+ font-size: 0.75rem;
338
+ font-weight: 500;
339
+ top: 0.375rem;
340
+ transform: translateY(
341
+ translateY(calc(0px - var(--gds-input-label-translate)))
342
+ );
343
+ }
344
+
345
+ input,
346
+ textarea {
347
+ margin-top: 0.75rem;
348
+ }
349
+ }
350
+
351
+ :host([variant='simplified'])
352
+ label:has(
353
+ input:not(:placeholder-shown, [readonly]),
354
+ textarea:not(:placeholder-shown, [readonly])
355
+ ),
356
+ :host([variant='simplified']) label:focus-within {
357
+ div {
358
+ font-size: 0.75rem;
359
+ font-weight: 500;
360
+ top: 0.375rem;
361
+ transform: translateY(
362
+ translateY(calc(0px - var(--gds-input-label-translate)))
363
+ );
364
+ }
365
+
366
+ input,
367
+ textarea {
368
+ margin-top: 0.75rem;
369
+ }
370
+ }
371
+ }
372
+ `;
373
+
374
+ // libs/core/src/components/input/input.ts
375
+ var _renderDefault, renderDefault_fn, _renderSimplified, renderSimplified_fn, _forwardableAttrs, _handleOnInput, _handleOnChange, _handleFieldClick, _handleClearBtnClick, _handleSupportingTextBtnClick, _renderNativeInput, renderNativeInput_fn, _renderNativeTextarea, renderNativeTextarea_fn, _renderSupportingText, renderSupportingText_fn, _renderExtendedSupportingText, renderExtendedSupportingText_fn, _renderClearButton, renderClearButton_fn, _shouldShowRemainingChars, shouldShowRemainingChars_get, _renderRemainingCharsBadge, renderRemainingCharsBadge_fn, _asyncRenderExtendedSupportingTextButton, asyncRenderExtendedSupportingTextButton_fn;
376
+ var GdsInput = class extends GdsFormControlElement {
377
+ constructor() {
378
+ super();
379
+ // variant="default"
380
+ __privateAdd(this, _renderDefault);
381
+ // variant="simplified"
382
+ __privateAdd(this, _renderSimplified);
383
+ __privateAdd(this, _renderNativeInput);
384
+ __privateAdd(this, _renderNativeTextarea);
385
+ __privateAdd(this, _renderSupportingText);
386
+ __privateAdd(this, _renderExtendedSupportingText);
387
+ __privateAdd(this, _renderClearButton);
388
+ __privateAdd(this, _shouldShowRemainingChars);
389
+ __privateAdd(this, _renderRemainingCharsBadge);
390
+ /**
391
+ * Returns a promise that resolves when the DOM query for the extended supporting text slot has resolved.
392
+ * If the slot is empty, an empty template is returned, otherwise the support text toggle button is returned.
393
+ */
394
+ __privateAdd(this, _asyncRenderExtendedSupportingTextButton);
395
+ this.value = "";
396
+ this.label = "";
397
+ this.supportingText = "";
398
+ this.showExtendedSupportingText = false;
399
+ this.clearable = false;
400
+ this.maxlength = Number.MAX_SAFE_INTEGER;
401
+ this.variant = "default";
402
+ this.multiline = false;
403
+ // Any attribute name added here will get forwarded to the native <input> element.
404
+ __privateAdd(this, _forwardableAttrs, (attr) => ["type", "placeholder", "required"].includes(attr.name));
405
+ __privateAdd(this, _handleOnInput, (e) => {
406
+ const element = e.target;
407
+ this.value = element.value;
408
+ });
409
+ __privateAdd(this, _handleOnChange, (e) => {
410
+ const element = e.target;
411
+ this.value = element.value;
412
+ this.dispatchEvent(
413
+ new Event("change", {
414
+ bubbles: true,
415
+ composed: true
416
+ })
417
+ );
418
+ });
419
+ __privateAdd(this, _handleFieldClick, () => {
420
+ this.elInput.then((el) => el.focus());
421
+ });
422
+ __privateAdd(this, _handleClearBtnClick, () => {
423
+ this.value = "";
424
+ });
425
+ __privateAdd(this, _handleSupportingTextBtnClick, () => {
426
+ this.showExtendedSupportingText = !this.showExtendedSupportingText;
427
+ this.dispatchEvent(
428
+ new CustomEvent("gds-ui-state", {
429
+ bubbles: true,
430
+ composed: true,
431
+ detail: this.showExtendedSupportingText
432
+ })
433
+ );
434
+ });
435
+ /**
436
+ * Event handler for the form reset event.
437
+ */
438
+ this._handleFormReset = () => {
439
+ this.value = "";
440
+ };
441
+ constrainSlots(this);
442
+ }
443
+ connectedCallback() {
444
+ super.connectedCallback();
445
+ this._setAutoHeight();
446
+ }
447
+ render() {
448
+ return html`${choose(this.variant, [
449
+ ["default", () => __privateMethod(this, _renderDefault, renderDefault_fn).call(this)],
450
+ ["simplified", () => __privateMethod(this, _renderSimplified, renderSimplified_fn).call(this)]
451
+ ])}`;
452
+ }
453
+ _setAutoHeight() {
454
+ if (!this.multiline)
455
+ return;
456
+ this.elInput.then((element) => {
457
+ const lines = (element.value.split("\n").length || 1).toString();
458
+ element == null ? void 0 : element.style.setProperty("--_lines", lines.toString());
459
+ });
460
+ }
461
+ };
462
+ _renderDefault = new WeakSet();
463
+ renderDefault_fn = function() {
464
+ return html`
465
+ <div class="head">
466
+ <label for="input">${this.label}</label>
467
+ ${until(__privateMethod(this, _asyncRenderExtendedSupportingTextButton, asyncRenderExtendedSupportingTextButton_fn).call(this), nothing2)}
468
+ </div>
469
+
470
+ ${__privateMethod(this, _renderSupportingText, renderSupportingText_fn).call(this)} ${__privateMethod(this, _renderExtendedSupportingText, renderExtendedSupportingText_fn).call(this)}
471
+
472
+ <div class="field" @click=${__privateGet(this, _handleFieldClick)}>
473
+ <slot name="lead" gds-allow="gds-icon"></slot>
474
+ ${when(
475
+ this.multiline,
476
+ () => html`${__privateMethod(this, _renderNativeTextarea, renderNativeTextarea_fn).call(this)}`,
477
+ () => html`${__privateMethod(this, _renderNativeInput, renderNativeInput_fn).call(this)}`
478
+ )}
479
+ <slot name="trail" gds-allow="gds-badge"></slot>
480
+ ${__privateMethod(this, _renderClearButton, renderClearButton_fn).call(this)}
481
+ </div>
482
+
483
+ <div class="foot">
484
+ <div>
485
+ ${when(
486
+ this.invalid,
487
+ () => html`<span class="error-text">Error information</span>`
488
+ )}
489
+ </div>
490
+ ${when(
491
+ __privateGet(this, _shouldShowRemainingChars, shouldShowRemainingChars_get),
492
+ () => __privateMethod(this, _renderRemainingCharsBadge, renderRemainingCharsBadge_fn).call(this)
493
+ )}
494
+ </div>
495
+ `;
496
+ };
497
+ _renderSimplified = new WeakSet();
498
+ renderSimplified_fn = function() {
499
+ return html`
500
+ <div class="field" @click=${__privateGet(this, _handleFieldClick)}>
501
+ <slot name="lead" gds-allow="gds-icon"></slot>
502
+ <label for="input">
503
+ <div>${this.label}</div>
504
+ ${when(
505
+ this.multiline,
506
+ () => html`${__privateMethod(this, _renderNativeTextarea, renderNativeTextarea_fn).call(this)}`,
507
+ () => html`${__privateMethod(this, _renderNativeInput, renderNativeInput_fn).call(this)}`
508
+ )}
509
+ </label>
510
+ <slot name="trail" gds-allow="gds-badge"></slot>
511
+ ${__privateMethod(this, _renderClearButton, renderClearButton_fn).call(this)}
512
+ </div>
513
+
514
+ <div class="foot">
515
+ ${__privateMethod(this, _renderSupportingText, renderSupportingText_fn).call(this)}
516
+ ${when(
517
+ __privateGet(this, _shouldShowRemainingChars, shouldShowRemainingChars_get),
518
+ () => __privateMethod(this, _renderRemainingCharsBadge, renderRemainingCharsBadge_fn).call(this)
519
+ )}
520
+ ${until(__privateMethod(this, _asyncRenderExtendedSupportingTextButton, asyncRenderExtendedSupportingTextButton_fn).call(this), nothing2)}
521
+ </div>
522
+
523
+ ${__privateMethod(this, _renderExtendedSupportingText, renderExtendedSupportingText_fn).call(this)}
524
+ `;
525
+ };
526
+ _forwardableAttrs = new WeakMap();
527
+ _handleOnInput = new WeakMap();
528
+ _handleOnChange = new WeakMap();
529
+ _handleFieldClick = new WeakMap();
530
+ _handleClearBtnClick = new WeakMap();
531
+ _handleSupportingTextBtnClick = new WeakMap();
532
+ _renderNativeInput = new WeakSet();
533
+ renderNativeInput_fn = function() {
534
+ return html`
535
+ <input
536
+ @input=${__privateGet(this, _handleOnInput)}
537
+ @change=${__privateGet(this, _handleOnChange)}
538
+ .value=${this.value}
539
+ id="input"
540
+ aria-describedby="supporting-text"
541
+ placeholder=" "
542
+ ${forwardAttributes(__privateGet(this, _forwardableAttrs))}
543
+ />
544
+ `;
545
+ };
546
+ _renderNativeTextarea = new WeakSet();
547
+ renderNativeTextarea_fn = function() {
548
+ return html`
549
+ <textarea
550
+ @input=${__privateGet(this, _handleOnInput)}
551
+ @change=${__privateGet(this, _handleOnChange)}
552
+ .value=${this.value}
553
+ id="input"
554
+ aria-describedby="supporting-text"
555
+ placeholder=" "
556
+ ${forwardAttributes(__privateGet(this, _forwardableAttrs))}
557
+ ></textarea>
558
+ `;
559
+ };
560
+ _renderSupportingText = new WeakSet();
561
+ renderSupportingText_fn = function() {
562
+ return html`
563
+ <div class="supporting-text" id="supporting-text">
564
+ ${this.supportingText}
565
+ </div>
566
+ `;
567
+ };
568
+ _renderExtendedSupportingText = new WeakSet();
569
+ renderExtendedSupportingText_fn = function() {
570
+ return html`
571
+ <div
572
+ class="extended-supporting-text"
573
+ aria-hidden="${!this.showExtendedSupportingText}"
574
+ ?inert="${!this.showExtendedSupportingText}"
575
+ >
576
+ <div>
577
+ <slot
578
+ name="extended-supporting-text"
579
+ @slotchange=${() => this.requestUpdate()}
580
+ ></slot>
581
+ </div>
582
+ </div>
583
+ `;
584
+ };
585
+ _renderClearButton = new WeakSet();
586
+ renderClearButton_fn = function() {
587
+ if (this.clearable && this.value.length > 0)
588
+ return html`
589
+ <gds-button
590
+ size="small"
591
+ variant="tertiary"
592
+ label="${msg("Clear input")}"
593
+ @click=${__privateGet(this, _handleClearBtnClick)}
594
+ >
595
+ <gds-icon name="x"></gds-icon>
596
+ </gds-button>
597
+ `;
598
+ else
599
+ return nothing2;
600
+ };
601
+ _shouldShowRemainingChars = new WeakSet();
602
+ shouldShowRemainingChars_get = function() {
603
+ return this.maxlength < Number.MAX_SAFE_INTEGER;
604
+ };
605
+ _renderRemainingCharsBadge = new WeakSet();
606
+ renderRemainingCharsBadge_fn = function() {
607
+ const remaining = this.maxlength - this.value.length;
608
+ let variant;
609
+ if (remaining < 0) {
610
+ variant = "error";
611
+ } else if (remaining < 20) {
612
+ variant = "warning";
613
+ } else {
614
+ variant = "success";
615
+ }
616
+ return html`<gds-badge variant="${variant}">${remaining}</gds-badge>`;
617
+ };
618
+ _asyncRenderExtendedSupportingTextButton = new WeakSet();
619
+ asyncRenderExtendedSupportingTextButton_fn = async function() {
620
+ return this.elExtendedSupportingTextSlot.then((slot) => {
621
+ if (slot.assignedElements().length > 0)
622
+ return html`
623
+ <gds-button
624
+ size="small"
625
+ variant="tertiary"
626
+ label="${msg("Show extended supporting text")}"
627
+ @click=${__privateGet(this, _handleSupportingTextBtnClick)}
628
+ >
629
+ <gds-icon name="info"></gds-icon>
630
+ </gds-button>
631
+ `;
632
+ else
633
+ return nothing2;
634
+ });
635
+ };
636
+ GdsInput.shadowRootOptions = __spreadProps(__spreadValues({}, LitElement.shadowRootOptions), {
637
+ delegatesFocus: true
638
+ });
639
+ GdsInput.styles = [tokens, unsafeCSS(input_styles_default)];
640
+ __decorateClass([
641
+ property()
642
+ ], GdsInput.prototype, "value", 2);
643
+ __decorateClass([
644
+ property()
645
+ ], GdsInput.prototype, "label", 2);
646
+ __decorateClass([
647
+ property({ attribute: "supporting-text" })
648
+ ], GdsInput.prototype, "supportingText", 2);
649
+ __decorateClass([
650
+ property({
651
+ attribute: "show-extended-supporting-text",
652
+ type: Boolean,
653
+ reflect: true
654
+ })
655
+ ], GdsInput.prototype, "showExtendedSupportingText", 2);
656
+ __decorateClass([
657
+ property({ type: Boolean })
658
+ ], GdsInput.prototype, "clearable", 2);
659
+ __decorateClass([
660
+ property({ type: Number })
661
+ ], GdsInput.prototype, "maxlength", 2);
662
+ __decorateClass([
663
+ property()
664
+ ], GdsInput.prototype, "variant", 2);
665
+ __decorateClass([
666
+ property({ type: Boolean })
667
+ ], GdsInput.prototype, "multiline", 2);
668
+ __decorateClass([
669
+ queryAsync("input, textarea")
670
+ ], GdsInput.prototype, "elInput", 2);
671
+ __decorateClass([
672
+ queryAsync('slot[name="extended-supporting-text"]')
673
+ ], GdsInput.prototype, "elExtendedSupportingTextSlot", 2);
674
+ __decorateClass([
675
+ watch("value")
676
+ ], GdsInput.prototype, "_setAutoHeight", 1);
677
+ GdsInput = __decorateClass([
678
+ gdsCustomElement("gds-input")
679
+ ], GdsInput);
680
+ export {
681
+ GdsInput
682
+ };
@@ -0,0 +1,9 @@
1
+ import {
2
+ GdsRadioGroup
3
+ } from "../../chunks/chunk.TN6ZYAH3.js";
4
+ import "../../chunks/chunk.7TCXY7BP.js";
5
+ import "../../chunks/chunk.6NM7ENKA.js";
6
+ import "../../chunks/chunk.5VURDMKE.js";
7
+ export {
8
+ GdsRadioGroup
9
+ };