@fundamento/make-kit-ekzemplo 0.1.0-next.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.
@@ -0,0 +1,906 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/element.ts
3
+ var BUTONO_SKEMO = {
4
+ "id": "ske_01M2XN0PWS92GP7VFHW161EH0D",
5
+ "ero": "ero_01M2XN0PHDBBD6MNFN75DB9NQ5",
6
+ "props": [
7
+ {
8
+ "name": "variant",
9
+ "kind": "enum",
10
+ "values": [
11
+ "primary",
12
+ "secondary",
13
+ "tertiary"
14
+ ],
15
+ "default": "secondary",
16
+ "description": "Emphasis: at most one primary per container (Regulo one-primary-per-container)."
17
+ },
18
+ {
19
+ "name": "tone",
20
+ "kind": "enum",
21
+ "values": ["default", "danger"],
22
+ "default": "default",
23
+ "description": "Meaning: danger marks an action that destroys data (Regulo destructive-not-primary-color); only with variant=primary."
24
+ },
25
+ {
26
+ "name": "size",
27
+ "kind": "enum",
28
+ "values": [
29
+ "small",
30
+ "medium",
31
+ "large"
32
+ ],
33
+ "default": "medium",
34
+ "description": "Height, padding, type and icon size; every size is at least size.target.min (Regulo touch-target-min)."
35
+ },
36
+ {
37
+ "name": "type",
38
+ "kind": "enum",
39
+ "values": [
40
+ "button",
41
+ "submit",
42
+ "reset"
43
+ ],
44
+ "default": "button",
45
+ "description": "What the button does in a form."
46
+ },
47
+ {
48
+ "name": "disabled",
49
+ "kind": "boolean",
50
+ "default": false,
51
+ "description": "Not available; skipped by the keyboard."
52
+ },
53
+ {
54
+ "name": "loading",
55
+ "kind": "boolean",
56
+ "default": false,
57
+ "description": "Working: keeps focus, announces busy, ignores activation."
58
+ },
59
+ {
60
+ "name": "full-width",
61
+ "kind": "boolean",
62
+ "default": false,
63
+ "description": "Takes the full inline size of its container."
64
+ },
65
+ {
66
+ "name": "label",
67
+ "kind": "string",
68
+ "description": "Accessible name when the label slot is empty (icon-only); never shown."
69
+ }
70
+ ],
71
+ "states": [
72
+ "rest",
73
+ "hover",
74
+ "pressed",
75
+ "focus",
76
+ "disabled",
77
+ "loading"
78
+ ],
79
+ "slots": [
80
+ {
81
+ "name": "label",
82
+ "default": true,
83
+ "text": true
84
+ },
85
+ {
86
+ "name": "icon-start",
87
+ "decorative": true
88
+ },
89
+ {
90
+ "name": "icon-end",
91
+ "decorative": true
92
+ }
93
+ ],
94
+ "parts": {
95
+ "surface": { "fill": { "by": [
96
+ "variant",
97
+ "tone",
98
+ "state"
99
+ ] } },
100
+ "label": {
101
+ "color": { "by": [
102
+ "variant",
103
+ "tone",
104
+ "state"
105
+ ] },
106
+ "typography": { "by": ["size"] }
107
+ },
108
+ "border": {
109
+ "color": { "by": [
110
+ "variant",
111
+ "tone",
112
+ "state"
113
+ ] },
114
+ "width": { "fixed": "border.width.default" }
115
+ },
116
+ "focus-ring": {
117
+ "ring": { "fixed": "focus.ring" },
118
+ "offset": { "fixed": "focus.offset" },
119
+ "color": { "fixed": "color.focus.inner" }
120
+ },
121
+ "icon": {
122
+ "color": { "sameAs": "label.color" },
123
+ "size": { "by": ["size"] }
124
+ },
125
+ "box": {
126
+ "width": { "fixed": "size.target.min" },
127
+ "height": { "by": ["size"] },
128
+ "inline-padding": { "by": ["size"] },
129
+ "gap": { "fixed": "spacing.small" },
130
+ "radius": { "fixed": "radius.role.control" }
131
+ },
132
+ "motion": {
133
+ "duration": { "fixed": "motion.duration.fast" },
134
+ "easing": { "fixed": "motion.easing.standard" }
135
+ }
136
+ },
137
+ "bindings": [
138
+ {
139
+ "part": "surface",
140
+ "property": "fill",
141
+ "when": {
142
+ "variant": "primary",
143
+ "tone": "default",
144
+ "state": "rest"
145
+ },
146
+ "token": "color.action.primary.rest"
147
+ },
148
+ {
149
+ "part": "surface",
150
+ "property": "fill",
151
+ "when": {
152
+ "variant": "primary",
153
+ "tone": "default",
154
+ "state": "hover"
155
+ },
156
+ "token": "color.action.primary.hover"
157
+ },
158
+ {
159
+ "part": "surface",
160
+ "property": "fill",
161
+ "when": {
162
+ "variant": "primary",
163
+ "tone": "default",
164
+ "state": "pressed"
165
+ },
166
+ "token": "color.action.primary.pressed"
167
+ },
168
+ {
169
+ "part": "surface",
170
+ "property": "fill",
171
+ "when": {
172
+ "variant": "primary",
173
+ "tone": "default",
174
+ "state": "disabled"
175
+ },
176
+ "token": "color.action.primary.disabled"
177
+ },
178
+ {
179
+ "part": "surface",
180
+ "property": "fill",
181
+ "when": {
182
+ "variant": "primary",
183
+ "tone": "danger",
184
+ "state": "rest"
185
+ },
186
+ "token": "color.action.danger.rest"
187
+ },
188
+ {
189
+ "part": "surface",
190
+ "property": "fill",
191
+ "when": {
192
+ "variant": "primary",
193
+ "tone": "danger",
194
+ "state": "hover"
195
+ },
196
+ "token": "color.action.danger.hover"
197
+ },
198
+ {
199
+ "part": "surface",
200
+ "property": "fill",
201
+ "when": {
202
+ "variant": "primary",
203
+ "tone": "danger",
204
+ "state": "pressed"
205
+ },
206
+ "token": "color.action.danger.pressed"
207
+ },
208
+ {
209
+ "part": "surface",
210
+ "property": "fill",
211
+ "when": {
212
+ "variant": "primary",
213
+ "tone": "danger",
214
+ "state": "disabled"
215
+ },
216
+ "token": "color.action.primary.disabled"
217
+ },
218
+ {
219
+ "part": "surface",
220
+ "property": "fill",
221
+ "when": {
222
+ "variant": "secondary",
223
+ "tone": "default",
224
+ "state": "rest"
225
+ },
226
+ "token": "color.action.secondary.rest"
227
+ },
228
+ {
229
+ "part": "surface",
230
+ "property": "fill",
231
+ "when": {
232
+ "variant": "secondary",
233
+ "tone": "default",
234
+ "state": "hover"
235
+ },
236
+ "token": "color.action.secondary.hover"
237
+ },
238
+ {
239
+ "part": "surface",
240
+ "property": "fill",
241
+ "when": {
242
+ "variant": "secondary",
243
+ "tone": "default",
244
+ "state": "pressed"
245
+ },
246
+ "token": "color.action.secondary.pressed"
247
+ },
248
+ {
249
+ "part": "surface",
250
+ "property": "fill",
251
+ "when": {
252
+ "variant": "secondary",
253
+ "tone": "default",
254
+ "state": "disabled"
255
+ },
256
+ "token": "color.action.secondary.disabled"
257
+ },
258
+ {
259
+ "part": "surface",
260
+ "property": "fill",
261
+ "when": {
262
+ "variant": "tertiary",
263
+ "tone": "default",
264
+ "state": "rest"
265
+ },
266
+ "token": "color.action.tertiary.rest"
267
+ },
268
+ {
269
+ "part": "surface",
270
+ "property": "fill",
271
+ "when": {
272
+ "variant": "tertiary",
273
+ "tone": "default",
274
+ "state": "hover"
275
+ },
276
+ "token": "color.action.tertiary.hover"
277
+ },
278
+ {
279
+ "part": "surface",
280
+ "property": "fill",
281
+ "when": {
282
+ "variant": "tertiary",
283
+ "tone": "default",
284
+ "state": "pressed"
285
+ },
286
+ "token": "color.action.tertiary.pressed"
287
+ },
288
+ {
289
+ "part": "surface",
290
+ "property": "fill",
291
+ "when": {
292
+ "variant": "tertiary",
293
+ "tone": "default",
294
+ "state": "disabled"
295
+ },
296
+ "token": "color.action.tertiary.disabled"
297
+ },
298
+ {
299
+ "part": "label",
300
+ "property": "color",
301
+ "when": {
302
+ "variant": "primary",
303
+ "tone": "default",
304
+ "state": "rest"
305
+ },
306
+ "token": "color.action.primary.text"
307
+ },
308
+ {
309
+ "part": "label",
310
+ "property": "color",
311
+ "when": {
312
+ "variant": "primary",
313
+ "tone": "default",
314
+ "state": "hover"
315
+ },
316
+ "token": "color.action.primary.text"
317
+ },
318
+ {
319
+ "part": "label",
320
+ "property": "color",
321
+ "when": {
322
+ "variant": "primary",
323
+ "tone": "default",
324
+ "state": "pressed"
325
+ },
326
+ "token": "color.action.primary.text"
327
+ },
328
+ {
329
+ "part": "label",
330
+ "property": "color",
331
+ "when": {
332
+ "variant": "primary",
333
+ "tone": "default",
334
+ "state": "disabled"
335
+ },
336
+ "token": "color.text.disabled"
337
+ },
338
+ {
339
+ "part": "label",
340
+ "property": "color",
341
+ "when": {
342
+ "variant": "primary",
343
+ "tone": "danger",
344
+ "state": "rest"
345
+ },
346
+ "token": "color.action.danger.text"
347
+ },
348
+ {
349
+ "part": "label",
350
+ "property": "color",
351
+ "when": {
352
+ "variant": "primary",
353
+ "tone": "danger",
354
+ "state": "hover"
355
+ },
356
+ "token": "color.action.danger.text"
357
+ },
358
+ {
359
+ "part": "label",
360
+ "property": "color",
361
+ "when": {
362
+ "variant": "primary",
363
+ "tone": "danger",
364
+ "state": "pressed"
365
+ },
366
+ "token": "color.action.danger.text"
367
+ },
368
+ {
369
+ "part": "label",
370
+ "property": "color",
371
+ "when": {
372
+ "variant": "primary",
373
+ "tone": "danger",
374
+ "state": "disabled"
375
+ },
376
+ "token": "color.text.disabled"
377
+ },
378
+ {
379
+ "part": "label",
380
+ "property": "color",
381
+ "when": {
382
+ "variant": "secondary",
383
+ "tone": "default",
384
+ "state": "rest"
385
+ },
386
+ "token": "color.action.secondary.text"
387
+ },
388
+ {
389
+ "part": "label",
390
+ "property": "color",
391
+ "when": {
392
+ "variant": "secondary",
393
+ "tone": "default",
394
+ "state": "hover"
395
+ },
396
+ "token": "color.action.secondary.text"
397
+ },
398
+ {
399
+ "part": "label",
400
+ "property": "color",
401
+ "when": {
402
+ "variant": "secondary",
403
+ "tone": "default",
404
+ "state": "pressed"
405
+ },
406
+ "token": "color.action.secondary.text"
407
+ },
408
+ {
409
+ "part": "label",
410
+ "property": "color",
411
+ "when": {
412
+ "variant": "secondary",
413
+ "tone": "default",
414
+ "state": "disabled"
415
+ },
416
+ "token": "color.text.disabled"
417
+ },
418
+ {
419
+ "part": "label",
420
+ "property": "color",
421
+ "when": {
422
+ "variant": "tertiary",
423
+ "tone": "default",
424
+ "state": "rest"
425
+ },
426
+ "token": "color.action.tertiary.text"
427
+ },
428
+ {
429
+ "part": "label",
430
+ "property": "color",
431
+ "when": {
432
+ "variant": "tertiary",
433
+ "tone": "default",
434
+ "state": "hover"
435
+ },
436
+ "token": "color.action.tertiary.text"
437
+ },
438
+ {
439
+ "part": "label",
440
+ "property": "color",
441
+ "when": {
442
+ "variant": "tertiary",
443
+ "tone": "default",
444
+ "state": "pressed"
445
+ },
446
+ "token": "color.action.tertiary.text"
447
+ },
448
+ {
449
+ "part": "label",
450
+ "property": "color",
451
+ "when": {
452
+ "variant": "tertiary",
453
+ "tone": "default",
454
+ "state": "disabled"
455
+ },
456
+ "token": "color.text.disabled"
457
+ },
458
+ {
459
+ "part": "border",
460
+ "property": "color",
461
+ "when": {
462
+ "variant": "primary",
463
+ "tone": "default",
464
+ "state": "rest"
465
+ },
466
+ "token": "color.action.primary.rest"
467
+ },
468
+ {
469
+ "part": "border",
470
+ "property": "color",
471
+ "when": {
472
+ "variant": "primary",
473
+ "tone": "default",
474
+ "state": "hover"
475
+ },
476
+ "token": "color.action.primary.hover"
477
+ },
478
+ {
479
+ "part": "border",
480
+ "property": "color",
481
+ "when": {
482
+ "variant": "primary",
483
+ "tone": "default",
484
+ "state": "pressed"
485
+ },
486
+ "token": "color.action.primary.pressed"
487
+ },
488
+ {
489
+ "part": "border",
490
+ "property": "color",
491
+ "when": {
492
+ "variant": "primary",
493
+ "tone": "default",
494
+ "state": "disabled"
495
+ },
496
+ "token": "color.border.disabled"
497
+ },
498
+ {
499
+ "part": "border",
500
+ "property": "color",
501
+ "when": {
502
+ "variant": "primary",
503
+ "tone": "danger",
504
+ "state": "rest"
505
+ },
506
+ "token": "color.action.danger.rest"
507
+ },
508
+ {
509
+ "part": "border",
510
+ "property": "color",
511
+ "when": {
512
+ "variant": "primary",
513
+ "tone": "danger",
514
+ "state": "hover"
515
+ },
516
+ "token": "color.action.danger.hover"
517
+ },
518
+ {
519
+ "part": "border",
520
+ "property": "color",
521
+ "when": {
522
+ "variant": "primary",
523
+ "tone": "danger",
524
+ "state": "pressed"
525
+ },
526
+ "token": "color.action.danger.pressed"
527
+ },
528
+ {
529
+ "part": "border",
530
+ "property": "color",
531
+ "when": {
532
+ "variant": "primary",
533
+ "tone": "danger",
534
+ "state": "disabled"
535
+ },
536
+ "token": "color.border.disabled"
537
+ },
538
+ {
539
+ "part": "border",
540
+ "property": "color",
541
+ "when": {
542
+ "variant": "secondary",
543
+ "tone": "default",
544
+ "state": "rest"
545
+ },
546
+ "token": "color.border.default"
547
+ },
548
+ {
549
+ "part": "border",
550
+ "property": "color",
551
+ "when": {
552
+ "variant": "secondary",
553
+ "tone": "default",
554
+ "state": "hover"
555
+ },
556
+ "token": "color.border.default"
557
+ },
558
+ {
559
+ "part": "border",
560
+ "property": "color",
561
+ "when": {
562
+ "variant": "secondary",
563
+ "tone": "default",
564
+ "state": "pressed"
565
+ },
566
+ "token": "color.border.default"
567
+ },
568
+ {
569
+ "part": "border",
570
+ "property": "color",
571
+ "when": {
572
+ "variant": "secondary",
573
+ "tone": "default",
574
+ "state": "disabled"
575
+ },
576
+ "token": "color.border.disabled"
577
+ },
578
+ {
579
+ "part": "border",
580
+ "property": "color",
581
+ "when": {
582
+ "variant": "tertiary",
583
+ "tone": "default",
584
+ "state": "rest"
585
+ },
586
+ "token": "color.action.tertiary.rest"
587
+ },
588
+ {
589
+ "part": "border",
590
+ "property": "color",
591
+ "when": {
592
+ "variant": "tertiary",
593
+ "tone": "default",
594
+ "state": "hover"
595
+ },
596
+ "token": "color.action.tertiary.hover"
597
+ },
598
+ {
599
+ "part": "border",
600
+ "property": "color",
601
+ "when": {
602
+ "variant": "tertiary",
603
+ "tone": "default",
604
+ "state": "pressed"
605
+ },
606
+ "token": "color.action.tertiary.pressed"
607
+ },
608
+ {
609
+ "part": "border",
610
+ "property": "color",
611
+ "when": {
612
+ "variant": "tertiary",
613
+ "tone": "default",
614
+ "state": "disabled"
615
+ },
616
+ "token": "color.action.tertiary.disabled"
617
+ },
618
+ {
619
+ "part": "box",
620
+ "property": "height",
621
+ "when": { "size": "small" },
622
+ "token": "size.control.small"
623
+ },
624
+ {
625
+ "part": "box",
626
+ "property": "inline-padding",
627
+ "when": { "size": "small" },
628
+ "token": "spacing.small"
629
+ },
630
+ {
631
+ "part": "label",
632
+ "property": "typography",
633
+ "when": { "size": "small" },
634
+ "token": "typography.label.2"
635
+ },
636
+ {
637
+ "part": "icon",
638
+ "property": "size",
639
+ "when": { "size": "small" },
640
+ "token": "size.icon.small"
641
+ },
642
+ {
643
+ "part": "box",
644
+ "property": "height",
645
+ "when": { "size": "medium" },
646
+ "token": "size.control.medium"
647
+ },
648
+ {
649
+ "part": "box",
650
+ "property": "inline-padding",
651
+ "when": { "size": "medium" },
652
+ "token": "spacing.medium"
653
+ },
654
+ {
655
+ "part": "label",
656
+ "property": "typography",
657
+ "when": { "size": "medium" },
658
+ "token": "typography.label.1"
659
+ },
660
+ {
661
+ "part": "icon",
662
+ "property": "size",
663
+ "when": { "size": "medium" },
664
+ "token": "size.icon.medium"
665
+ },
666
+ {
667
+ "part": "box",
668
+ "property": "height",
669
+ "when": { "size": "large" },
670
+ "token": "size.control.large"
671
+ },
672
+ {
673
+ "part": "box",
674
+ "property": "inline-padding",
675
+ "when": { "size": "large" },
676
+ "token": "spacing.large"
677
+ },
678
+ {
679
+ "part": "label",
680
+ "property": "typography",
681
+ "when": { "size": "large" },
682
+ "token": "typography.label.1"
683
+ },
684
+ {
685
+ "part": "icon",
686
+ "property": "size",
687
+ "when": { "size": "large" },
688
+ "token": "size.icon.large"
689
+ }
690
+ ],
691
+ "a11y": {
692
+ "role": "button",
693
+ "name": ["slot:label", "prop:label"],
694
+ "states": {
695
+ "disabled": ["aria-disabled"],
696
+ "loading": ["aria-disabled", "aria-busy"]
697
+ },
698
+ "keys": ["Enter", "Space"]
699
+ },
700
+ "constraints": [{
701
+ "when": { "tone": "danger" },
702
+ "allowed": { "variant": ["primary"] },
703
+ "kialo": "The danger tokens describe a filled surface and its text; a danger label on a neutral surface has no tokens, and next to another primary action a destructive action is secondary."
704
+ }],
705
+ "intents": [
706
+ {
707
+ "intent": "destructive",
708
+ "keywords": {
709
+ "en": [
710
+ "delete",
711
+ "remove",
712
+ "destroy",
713
+ "discard"
714
+ ],
715
+ "de": [
716
+ "löschen",
717
+ "entfernen",
718
+ "verwerfen"
719
+ ]
720
+ },
721
+ "props": {
722
+ "variant": "primary",
723
+ "tone": "danger"
724
+ },
725
+ "regulo": "destructive-not-primary-color"
726
+ },
727
+ {
728
+ "intent": "confirm",
729
+ "keywords": {
730
+ "en": [
731
+ "save",
732
+ "submit",
733
+ "confirm",
734
+ "continue"
735
+ ],
736
+ "de": [
737
+ "speichern",
738
+ "senden",
739
+ "bestätigen",
740
+ "weiter"
741
+ ]
742
+ },
743
+ "props": { "variant": "primary" },
744
+ "regulo": "one-primary-per-container"
745
+ },
746
+ {
747
+ "intent": "dismiss",
748
+ "keywords": {
749
+ "en": [
750
+ "cancel",
751
+ "close",
752
+ "back"
753
+ ],
754
+ "de": [
755
+ "abbrechen",
756
+ "schließen",
757
+ "zurück"
758
+ ]
759
+ },
760
+ "props": { "variant": "tertiary" }
761
+ }
762
+ ]
763
+ };
764
+ var BUTONO_CSS = ":host { display: inline-block; vertical-align: middle; }\n:host([full-width]) { display: block; }\n:where([part=\"control\"]) { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; margin: 0; border-style: solid; cursor: pointer; appearance: none; text-decoration: none; white-space: nowrap; transition-property: background-color, color, border-color; }\n:host([full-width]) :where([part=\"control\"]) { display: flex; }\n:where([part=\"control\"]:focus:not(:focus-visible)) { outline-width: 0; }\n:where([part=\"control\"]:disabled, [part=\"control\"][aria-disabled=\"true\"]) { cursor: not-allowed; }\n:where([part=\"control\"]) slot[name^=\"icon-\"]::slotted(*) { flex: none; }\n:where([part=\"control\"]) {\n border-width: var(--fm-border-width-default);\n min-inline-size: var(--fm-size-target-min);\n gap: var(--fm-spacing-small);\n border-radius: var(--fm-radius-role-control);\n transition-duration: var(--fm-motion-duration-fast);\n transition-timing-function: var(--fm-motion-easing-standard);\n}\n:where([part=\"control\"]:focus-visible) {\n outline-width: var(--fm-focus-ring-width);\n outline-style: var(--fm-focus-ring-style);\n outline-color: var(--fm-focus-ring-color);\n outline-offset: var(--fm-focus-offset);\n box-shadow: 0 0 0 var(--fm-focus-offset) var(--fm-color-focus-inner);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"]) {\n background-color: var(--fm-color-action-primary-rest);\n color: var(--fm-color-action-primary-text);\n border-color: var(--fm-color-action-primary-rest);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"]) {\n background-color: var(--fm-color-action-danger-rest);\n color: var(--fm-color-action-danger-text);\n border-color: var(--fm-color-action-danger-rest);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"]) {\n background-color: var(--fm-color-action-secondary-rest);\n color: var(--fm-color-action-secondary-text);\n border-color: var(--fm-color-border-default);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"]) {\n background-color: var(--fm-color-action-tertiary-rest);\n color: var(--fm-color-action-tertiary-text);\n border-color: var(--fm-color-action-tertiary-rest);\n}\n:where([part=\"control\"][data-size=\"small\"]) {\n font-family: var(--fm-typography-label-2-font-family);\n font-size: var(--fm-typography-label-2-font-size);\n font-weight: var(--fm-typography-label-2-font-weight);\n letter-spacing: var(--fm-typography-label-2-letter-spacing);\n line-height: var(--fm-typography-label-2-line-height);\n min-block-size: var(--fm-size-control-small);\n padding-inline: var(--fm-spacing-small);\n}\n:where([part=\"control\"][data-size=\"medium\"]) {\n font-family: var(--fm-typography-label-1-font-family);\n font-size: var(--fm-typography-label-1-font-size);\n font-weight: var(--fm-typography-label-1-font-weight);\n letter-spacing: var(--fm-typography-label-1-letter-spacing);\n line-height: var(--fm-typography-label-1-line-height);\n min-block-size: var(--fm-size-control-medium);\n padding-inline: var(--fm-spacing-medium);\n}\n:where([part=\"control\"][data-size=\"large\"]) {\n font-family: var(--fm-typography-label-1-font-family);\n font-size: var(--fm-typography-label-1-font-size);\n font-weight: var(--fm-typography-label-1-font-weight);\n letter-spacing: var(--fm-typography-label-1-letter-spacing);\n line-height: var(--fm-typography-label-1-line-height);\n min-block-size: var(--fm-size-control-large);\n padding-inline: var(--fm-spacing-large);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"]) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-primary-text);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"]) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-danger-text);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"]) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-secondary-text);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"]) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-tertiary-text);\n}\n:where([part=\"control\"][data-size=\"small\"]) slot[name^=\"icon-\"]::slotted(*) {\n inline-size: var(--fm-size-icon-small);\n block-size: var(--fm-size-icon-small);\n}\n:where([part=\"control\"][data-size=\"medium\"]) slot[name^=\"icon-\"]::slotted(*) {\n inline-size: var(--fm-size-icon-medium);\n block-size: var(--fm-size-icon-medium);\n}\n:where([part=\"control\"][data-size=\"large\"]) slot[name^=\"icon-\"]::slotted(*) {\n inline-size: var(--fm-size-icon-large);\n block-size: var(--fm-size-icon-large);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"]:hover) {\n background-color: var(--fm-color-action-primary-hover);\n color: var(--fm-color-action-primary-text);\n border-color: var(--fm-color-action-primary-hover);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"]:hover) {\n background-color: var(--fm-color-action-danger-hover);\n color: var(--fm-color-action-danger-text);\n border-color: var(--fm-color-action-danger-hover);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"]:hover) {\n background-color: var(--fm-color-action-secondary-hover);\n color: var(--fm-color-action-secondary-text);\n border-color: var(--fm-color-border-default);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"]:hover) {\n background-color: var(--fm-color-action-tertiary-hover);\n color: var(--fm-color-action-tertiary-text);\n border-color: var(--fm-color-action-tertiary-hover);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"]:hover) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-primary-text);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"]:hover) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-danger-text);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"]:hover) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-secondary-text);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"]:hover) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-tertiary-text);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"]:active) {\n background-color: var(--fm-color-action-primary-pressed);\n color: var(--fm-color-action-primary-text);\n border-color: var(--fm-color-action-primary-pressed);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"]:active) {\n background-color: var(--fm-color-action-danger-pressed);\n color: var(--fm-color-action-danger-text);\n border-color: var(--fm-color-action-danger-pressed);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"]:active) {\n background-color: var(--fm-color-action-secondary-pressed);\n color: var(--fm-color-action-secondary-text);\n border-color: var(--fm-color-border-default);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"]:active) {\n background-color: var(--fm-color-action-tertiary-pressed);\n color: var(--fm-color-action-tertiary-text);\n border-color: var(--fm-color-action-tertiary-pressed);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"]:active) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-primary-text);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"]:active) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-danger-text);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"]:active) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-secondary-text);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"]:active) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-tertiary-text);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"][aria-busy=\"true\"]) {\n background-color: var(--fm-color-action-primary-rest);\n color: var(--fm-color-action-primary-text);\n border-color: var(--fm-color-action-primary-rest);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"][aria-busy=\"true\"]) {\n background-color: var(--fm-color-action-danger-rest);\n color: var(--fm-color-action-danger-text);\n border-color: var(--fm-color-action-danger-rest);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"][aria-busy=\"true\"]) {\n background-color: var(--fm-color-action-secondary-rest);\n color: var(--fm-color-action-secondary-text);\n border-color: var(--fm-color-border-default);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"][aria-busy=\"true\"]) {\n background-color: var(--fm-color-action-tertiary-rest);\n color: var(--fm-color-action-tertiary-text);\n border-color: var(--fm-color-action-tertiary-rest);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"][aria-busy=\"true\"]) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-primary-text);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"][aria-busy=\"true\"]) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-danger-text);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"][aria-busy=\"true\"]) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-secondary-text);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"][aria-busy=\"true\"]) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-action-tertiary-text);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"]:disabled) {\n background-color: var(--fm-color-action-primary-disabled);\n color: var(--fm-color-text-disabled);\n border-color: var(--fm-color-border-disabled);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"]:disabled) {\n background-color: var(--fm-color-action-primary-disabled);\n color: var(--fm-color-text-disabled);\n border-color: var(--fm-color-border-disabled);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"]:disabled) {\n background-color: var(--fm-color-action-secondary-disabled);\n color: var(--fm-color-text-disabled);\n border-color: var(--fm-color-border-disabled);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"]:disabled) {\n background-color: var(--fm-color-action-tertiary-disabled);\n color: var(--fm-color-text-disabled);\n border-color: var(--fm-color-action-tertiary-disabled);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"default\"]:disabled) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-text-disabled);\n}\n:where([part=\"control\"][data-variant=\"primary\"][data-tone=\"danger\"]:disabled) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-text-disabled);\n}\n:where([part=\"control\"][data-variant=\"secondary\"][data-tone=\"default\"]:disabled) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-text-disabled);\n}\n:where([part=\"control\"][data-variant=\"tertiary\"][data-tone=\"default\"]:disabled) slot[name^=\"icon-\"]::slotted(*) {\n color: var(--fm-color-text-disabled);\n}\n";
765
+ var SKEMO = BUTONO_SKEMO;
766
+ var CSS = BUTONO_CSS;
767
+ var PROPS = SKEMO.props;
768
+ var CONSTRAINTS = ("constraints" in SKEMO ? SKEMO.constraints : []) ?? [];
769
+ var sheet;
770
+ var warned = /* @__PURE__ */ new Set();
771
+ function warn(message) {
772
+ if (warned.has(message)) return;
773
+ warned.add(message);
774
+ console.warn(message);
775
+ }
776
+ function camel(name) {
777
+ return name.replace(/-([a-z0-9])/g, (_match, letter) => letter.toUpperCase());
778
+ }
779
+ /**
780
+ * The base class. Without a DOM (server-side rendering) HTMLElement does not exist, and a class
781
+ * declaration would throw at import time, so the module stays importable with a stand-in that is
782
+ * never instantiated there.
783
+ */
784
+ var Base = typeof HTMLElement === "undefined" ? class {} : HTMLElement;
785
+ /** Generated from the Skemo of butono; behaviour from the template in @fundamento/projekcioj. */
786
+ var FmButono = class extends Base {
787
+ static formAssociated = true;
788
+ static observedAttributes = PROPS.map((prop) => prop.name);
789
+ #internals;
790
+ #control;
791
+ #label;
792
+ constructor() {
793
+ super();
794
+ this.#internals = this.attachInternals();
795
+ const root = this.attachShadow({
796
+ mode: "open",
797
+ delegatesFocus: true
798
+ });
799
+ if (sheet === void 0) {
800
+ sheet = new CSSStyleSheet();
801
+ sheet.replaceSync(CSS);
802
+ }
803
+ root.adoptedStyleSheets = [sheet];
804
+ root.innerHTML = `<button part="control" type="button"><slot name="icon-start"></slot><slot></slot><slot name="icon-end"></slot></button>`;
805
+ const control = root.querySelector("button");
806
+ const label = root.querySelector("slot:not([name])");
807
+ if (!(control instanceof HTMLButtonElement) || !(label instanceof HTMLSlotElement)) throw new Error("fm-butono: shadow template is incomplete");
808
+ this.#control = control;
809
+ this.#label = label;
810
+ control.addEventListener("click", (event) => this.#activate(event));
811
+ label.addEventListener("slotchange", () => this.#render());
812
+ }
813
+ connectedCallback() {
814
+ this.#render();
815
+ }
816
+ attributeChangedCallback() {
817
+ this.#render();
818
+ }
819
+ /** The value of a prop after validation: an invalid value falls back to the default. */
820
+ value(name) {
821
+ const prop = PROPS.find((candidate) => candidate.name === name);
822
+ if (prop === void 0) return void 0;
823
+ if (prop.kind === "boolean") return this.hasAttribute(name);
824
+ const raw = this.getAttribute(name);
825
+ if (prop.kind === "enum") {
826
+ const allowed = prop.values ?? [];
827
+ if (raw !== null && !allowed.includes(raw)) warn(`fm-butono: ${name}="${raw}" is not allowed; using ${String(prop.default)} (allowed: ${allowed.join(", ")}).`);
828
+ return raw !== null && allowed.includes(raw) ? raw : String(prop.default ?? allowed[0] ?? "");
829
+ }
830
+ return raw ?? void 0;
831
+ }
832
+ /** Enum values after validation and the Skemo constraints. */
833
+ #enums() {
834
+ const values = {};
835
+ for (const prop of PROPS) if (prop.kind === "enum") values[prop.name] = String(this.value(prop.name));
836
+ for (const constraint of CONSTRAINTS) {
837
+ const applies = Object.entries(constraint.when).every(([key, value]) => values[key] === value);
838
+ const violated = Object.entries(constraint.allowed).some(([key, allowed]) => values[key] !== void 0 && !allowed.includes(values[key] ?? ""));
839
+ if (!applies || !violated) continue;
840
+ warn(`fm-butono: ${Object.entries(constraint.when).map(([key, value]) => `${key}="${value}"`).join(" ")} is not allowed here; using the default. ${constraint.kialo}`);
841
+ for (const key of Object.keys(constraint.when)) {
842
+ const prop = PROPS.find((candidate) => candidate.name === key);
843
+ values[key] = String(prop?.default ?? "");
844
+ }
845
+ }
846
+ return values;
847
+ }
848
+ #render() {
849
+ const control = this.#control;
850
+ for (const [name, value] of Object.entries(this.#enums())) control.setAttribute(`data-${name}`, value);
851
+ control.disabled = this.value("disabled") === true;
852
+ if (this.value("loading") === true) {
853
+ control.setAttribute("aria-busy", "true");
854
+ control.setAttribute("aria-disabled", "true");
855
+ } else {
856
+ control.removeAttribute("aria-busy");
857
+ control.removeAttribute("aria-disabled");
858
+ }
859
+ const text = this.#label.assignedNodes({ flatten: true }).map((node) => node.textContent ?? "").join("").trim();
860
+ const name = this.value("label");
861
+ if (text === "" && typeof name === "string" && name !== "") control.setAttribute("aria-label", name);
862
+ else control.removeAttribute("aria-label");
863
+ }
864
+ #activate(event) {
865
+ if (this.value("loading") === true || this.value("disabled") === true) {
866
+ event.preventDefault();
867
+ event.stopImmediatePropagation();
868
+ return;
869
+ }
870
+ const type = this.value("type");
871
+ const form = this.#internals.form;
872
+ if (form === null) return;
873
+ if (type === "submit") form.requestSubmit();
874
+ else if (type === "reset") form.reset();
875
+ }
876
+ };
877
+ /**
878
+ * Registers <fm-butono> once. Called on import, and exported so a wrapper can call it explicitly:
879
+ * a bundler may drop a bare side-effect import, but never a called function (F6). Without a DOM
880
+ * (server-side rendering) it does nothing.
881
+ */
882
+ function defineFmButono() {
883
+ if (typeof customElements === "undefined" || customElements.get("fm-butono") !== void 0) return;
884
+ customElements.define("fm-butono", FmButono);
885
+ }
886
+ defineFmButono();
887
+ for (const prop of PROPS) Object.defineProperty(FmButono.prototype, camel(prop.name), {
888
+ configurable: true,
889
+ enumerable: true,
890
+ get() {
891
+ return this.value(prop.name);
892
+ },
893
+ set(next) {
894
+ if (prop.kind === "boolean") this.toggleAttribute(prop.name, next === true);
895
+ else if (next === void 0 || next === null) this.removeAttribute(prop.name);
896
+ else this.setAttribute(prop.name, String(next));
897
+ }
898
+ });
899
+ /** Registers every Ero once. Importing this module already did it; this is the explicit way. */
900
+ function defineEroj() {
901
+ defineFmButono();
902
+ }
903
+ //#endregion
904
+ exports.FmButono = FmButono;
905
+ exports.defineEroj = defineEroj;
906
+ exports.defineFmButono = defineFmButono;