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