@urbicon-ui/blocks 6.33.0 → 6.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Calendar/calendar.variants.d.ts +63 -63
- package/dist/i18n/index.d.ts +378 -2
- package/dist/mint/README.md +33 -0
- package/dist/mint/compose.d.ts +7 -1
- package/dist/mint/compose.js +35 -8
- package/dist/mint/engine.d.ts +34 -0
- package/dist/mint/engine.js +106 -0
- package/dist/mint/index.d.ts +2 -2
- package/dist/mint/index.js +1 -1
- package/dist/mint/micro-interactions.d.ts +9 -3
- package/dist/mint/micro-interactions.js +18 -87
- package/dist/mint/presets.d.ts +7 -1
- package/dist/mint/presets.js +9 -3
- package/dist/mint/registry.d.ts +41 -2
- package/dist/mint/registry.js +79 -26
- package/dist/mint/ripple.js +1 -1
- package/dist/primitives/Alert/alert.variants.d.ts +8 -8
- package/dist/primitives/Button/Button.svelte +5 -1
- package/dist/primitives/JourneyTimeline/journey-timeline.variants.d.ts +22 -22
- package/dist/primitives/Spinner/spinner.variants.d.ts +16 -16
- package/dist/primitives/Stepper/stepper.variants.d.ts +11 -11
- package/dist/primitives/Toast/toast.variants.d.ts +12 -12
- package/dist/primitives/Tooltip/tooltip.variants.d.ts +3 -3
- package/package.json +3 -3
package/dist/i18n/index.d.ts
CHANGED
|
@@ -379,7 +379,195 @@ declare const blocksTranslations: {
|
|
|
379
379
|
};
|
|
380
380
|
};
|
|
381
381
|
};
|
|
382
|
-
export declare const blocksI18n: import("@urbicon-ui/i18n").PackageI18n<
|
|
382
|
+
export declare const blocksI18n: import("@urbicon-ui/i18n").PackageI18n<{
|
|
383
|
+
readonly accessibility: {
|
|
384
|
+
readonly avatar: "Avatar";
|
|
385
|
+
readonly breadcrumb: "Breadcrumb";
|
|
386
|
+
readonly breadcrumbExpand: "Show all breadcrumb items";
|
|
387
|
+
readonly clearInput: "Clear input";
|
|
388
|
+
readonly clearSearch: "Clear search";
|
|
389
|
+
readonly clearSelection: "Clear selection";
|
|
390
|
+
readonly closeDialog: "Close dialog";
|
|
391
|
+
readonly closeDrawer: "Close drawer";
|
|
392
|
+
readonly dismiss: "Dismiss";
|
|
393
|
+
readonly fileUpload: "File upload";
|
|
394
|
+
readonly loading: "Loading";
|
|
395
|
+
readonly maximum: "Maximum";
|
|
396
|
+
readonly minimum: "Minimum";
|
|
397
|
+
readonly pagination: "Page navigation";
|
|
398
|
+
readonly progress: "Progress";
|
|
399
|
+
readonly slider: "Slider";
|
|
400
|
+
readonly toggle: "Toggle";
|
|
401
|
+
readonly toggleOptions: "Toggle options";
|
|
402
|
+
readonly removableBadge: "Removable badge";
|
|
403
|
+
readonly removeBadge: "Remove badge";
|
|
404
|
+
readonly removeFile: "Remove {{name}}";
|
|
405
|
+
readonly removeTag: "Remove {{label}}";
|
|
406
|
+
};
|
|
407
|
+
readonly button: {
|
|
408
|
+
readonly close: "Close";
|
|
409
|
+
readonly apply: "Apply";
|
|
410
|
+
readonly cancel: "Cancel";
|
|
411
|
+
readonly confirm: "Confirm";
|
|
412
|
+
};
|
|
413
|
+
readonly menu: {
|
|
414
|
+
readonly placeholder: "Select an option...";
|
|
415
|
+
};
|
|
416
|
+
readonly common: {
|
|
417
|
+
readonly loading: "Loading...";
|
|
418
|
+
};
|
|
419
|
+
readonly languages: {
|
|
420
|
+
readonly de: "Deutsch";
|
|
421
|
+
readonly en: "English";
|
|
422
|
+
readonly es: "Español";
|
|
423
|
+
readonly fr: "Français";
|
|
424
|
+
readonly it: "Italiano";
|
|
425
|
+
readonly nl: "Nederlands";
|
|
426
|
+
};
|
|
427
|
+
readonly localeSwitcher: {
|
|
428
|
+
readonly ariaLabel: "Language selection";
|
|
429
|
+
readonly placeholder: "Select language...";
|
|
430
|
+
};
|
|
431
|
+
readonly pagination: {
|
|
432
|
+
readonly next: "Next";
|
|
433
|
+
readonly first: "First";
|
|
434
|
+
readonly last: "Last";
|
|
435
|
+
readonly page: "Page";
|
|
436
|
+
readonly previous: "Previous";
|
|
437
|
+
readonly pageInfo: "{{label}} {{current}} of {{total}}";
|
|
438
|
+
readonly rangeInfo: "{{start}}–{{end}} of {{total}}";
|
|
439
|
+
};
|
|
440
|
+
readonly calendar: {
|
|
441
|
+
readonly recurring: "Recurring event";
|
|
442
|
+
readonly previousMonth: "Previous month";
|
|
443
|
+
readonly nextMonth: "Next month";
|
|
444
|
+
readonly previousWeek: "Previous week";
|
|
445
|
+
readonly nextWeek: "Next week";
|
|
446
|
+
readonly previousDay: "Previous day";
|
|
447
|
+
readonly nextDay: "Next day";
|
|
448
|
+
readonly previousYear: "Previous year";
|
|
449
|
+
readonly nextYear: "Next year";
|
|
450
|
+
readonly today: "Today";
|
|
451
|
+
readonly calendarGrid: "Calendar";
|
|
452
|
+
readonly weekdays: "Weekdays";
|
|
453
|
+
readonly weekNumber: "Week number";
|
|
454
|
+
readonly events: "Events";
|
|
455
|
+
readonly noEvents: "No events";
|
|
456
|
+
readonly showMore: "{{count}} more";
|
|
457
|
+
readonly legend: "Legend";
|
|
458
|
+
readonly yearView: "Year overview";
|
|
459
|
+
readonly weekView: "Week view";
|
|
460
|
+
readonly viewMonth: "Month";
|
|
461
|
+
readonly viewYear: "Year";
|
|
462
|
+
readonly viewWeek: "Week";
|
|
463
|
+
readonly viewDay: "Day";
|
|
464
|
+
readonly multiDayLabel: "Day {{current}} of {{total}}";
|
|
465
|
+
readonly agendaView: "Agenda view";
|
|
466
|
+
readonly viewAgenda: "Agenda";
|
|
467
|
+
readonly viewSwitcher: "View mode";
|
|
468
|
+
};
|
|
469
|
+
readonly planner: {
|
|
470
|
+
readonly previousWeek: "Previous week";
|
|
471
|
+
readonly nextWeek: "Next week";
|
|
472
|
+
readonly previousMonth: "Previous month";
|
|
473
|
+
readonly nextMonth: "Next month";
|
|
474
|
+
readonly previousRange: "Previous range";
|
|
475
|
+
readonly nextRange: "Next range";
|
|
476
|
+
readonly today: "Today";
|
|
477
|
+
readonly grid: "Planner";
|
|
478
|
+
readonly itemCount: "{{count}} items";
|
|
479
|
+
};
|
|
480
|
+
readonly commandPalette: {
|
|
481
|
+
readonly noResults: "No results found.";
|
|
482
|
+
readonly search: "Search...";
|
|
483
|
+
readonly hints: {
|
|
484
|
+
readonly navigate: "Navigate";
|
|
485
|
+
readonly select: "Select";
|
|
486
|
+
readonly close: "Close";
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
readonly compositionBar: {
|
|
490
|
+
readonly total: "Total";
|
|
491
|
+
readonly summary: "Composition: {{total}} ({{count}} shares) — {{parts}}";
|
|
492
|
+
readonly share: "Share";
|
|
493
|
+
readonly value: "Value";
|
|
494
|
+
readonly percent: "Percent";
|
|
495
|
+
readonly remaining: "remaining";
|
|
496
|
+
};
|
|
497
|
+
readonly guide: {
|
|
498
|
+
readonly next: "Next";
|
|
499
|
+
readonly previous: "Back";
|
|
500
|
+
readonly skip: "Skip tour";
|
|
501
|
+
readonly done: "Done";
|
|
502
|
+
readonly step: "Step {{current}} of {{total}}";
|
|
503
|
+
readonly tour: "Guided tour";
|
|
504
|
+
readonly close: "Close";
|
|
505
|
+
readonly openHelp: "Help";
|
|
506
|
+
readonly backToList: "All topics";
|
|
507
|
+
readonly info: "More information";
|
|
508
|
+
readonly infoAbout: "More information about {{label}}";
|
|
509
|
+
readonly dismiss: "Dismiss hint";
|
|
510
|
+
readonly startTour: "Start the guided tour";
|
|
511
|
+
readonly actionRequired: "Complete the highlighted action to continue";
|
|
512
|
+
readonly filterPlaceholder: "Filter topics…";
|
|
513
|
+
readonly noResults: "No matching topics";
|
|
514
|
+
};
|
|
515
|
+
readonly journeyTimeline: {
|
|
516
|
+
readonly label: "Journey";
|
|
517
|
+
readonly status: {
|
|
518
|
+
readonly complete: "Completed";
|
|
519
|
+
readonly active: "In progress";
|
|
520
|
+
readonly pending: "Pending";
|
|
521
|
+
readonly attention: "Needs attention";
|
|
522
|
+
readonly blocked: "Blocked";
|
|
523
|
+
readonly skipped: "Skipped";
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
readonly datepicker: {
|
|
527
|
+
readonly placeholder: "Select a date...";
|
|
528
|
+
readonly rangePlaceholder: "Select a date range...";
|
|
529
|
+
readonly openCalendar: "Open calendar";
|
|
530
|
+
readonly invalidDate: "Invalid date";
|
|
531
|
+
readonly outOfRange: "Date is outside the allowed range";
|
|
532
|
+
readonly invalidRange: "Invalid date range";
|
|
533
|
+
};
|
|
534
|
+
readonly fileUpload: {
|
|
535
|
+
readonly exists: "File already added";
|
|
536
|
+
readonly invalidType: "File type {{type}} is not allowed";
|
|
537
|
+
readonly tooLarge: "File exceeds {{size}} limit";
|
|
538
|
+
readonly tooMany: "Maximum {{count}} files allowed";
|
|
539
|
+
readonly tooSmall: "File must be at least {{size}}";
|
|
540
|
+
};
|
|
541
|
+
readonly sankey: {
|
|
542
|
+
readonly summary: "Sankey diagram: {{nodes}} nodes, {{links}} links — {{flows}}";
|
|
543
|
+
readonly source: "Source";
|
|
544
|
+
readonly target: "Target";
|
|
545
|
+
readonly value: "Value";
|
|
546
|
+
};
|
|
547
|
+
readonly slider: {
|
|
548
|
+
readonly rangeStatus: {
|
|
549
|
+
readonly insideRecommended: "In recommended range";
|
|
550
|
+
readonly insideValid: "In valid range";
|
|
551
|
+
readonly insideValidOnly: "Outside recommended range, but valid";
|
|
552
|
+
readonly outsideValid: "Outside valid range";
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
readonly themeSwitcher: {
|
|
556
|
+
readonly lightMode: "Light mode";
|
|
557
|
+
readonly darkMode: "Dark mode";
|
|
558
|
+
readonly systemTheme: "System theme";
|
|
559
|
+
};
|
|
560
|
+
readonly chart: {
|
|
561
|
+
readonly category: "Category";
|
|
562
|
+
readonly series: "Series {{index}}";
|
|
563
|
+
readonly segment: "Segment";
|
|
564
|
+
readonly value: "Value";
|
|
565
|
+
readonly share: "Share";
|
|
566
|
+
};
|
|
567
|
+
readonly stepper: {
|
|
568
|
+
readonly optional: "Optional";
|
|
569
|
+
};
|
|
570
|
+
}>;
|
|
383
571
|
/**
|
|
384
572
|
* Context-scoped translation hook for the blocks package. Call during component
|
|
385
573
|
* initialisation, then use the returned `t` (conventionally aliased `bt`):
|
|
@@ -392,7 +580,195 @@ export declare const blocksI18n: import("@urbicon-ui/i18n").PackageI18n<import("
|
|
|
392
580
|
* Resolves against the nearest `<I18nProvider>`'s locale (or the base locale
|
|
393
581
|
* when none is mounted) and re-renders reactively on locale change.
|
|
394
582
|
*/
|
|
395
|
-
export declare const useBlocksI18n:
|
|
583
|
+
export declare const useBlocksI18n: () => import("@urbicon-ui/i18n").TypedTranslationFunction<{
|
|
584
|
+
readonly accessibility: {
|
|
585
|
+
readonly avatar: "Avatar";
|
|
586
|
+
readonly breadcrumb: "Breadcrumb";
|
|
587
|
+
readonly breadcrumbExpand: "Show all breadcrumb items";
|
|
588
|
+
readonly clearInput: "Clear input";
|
|
589
|
+
readonly clearSearch: "Clear search";
|
|
590
|
+
readonly clearSelection: "Clear selection";
|
|
591
|
+
readonly closeDialog: "Close dialog";
|
|
592
|
+
readonly closeDrawer: "Close drawer";
|
|
593
|
+
readonly dismiss: "Dismiss";
|
|
594
|
+
readonly fileUpload: "File upload";
|
|
595
|
+
readonly loading: "Loading";
|
|
596
|
+
readonly maximum: "Maximum";
|
|
597
|
+
readonly minimum: "Minimum";
|
|
598
|
+
readonly pagination: "Page navigation";
|
|
599
|
+
readonly progress: "Progress";
|
|
600
|
+
readonly slider: "Slider";
|
|
601
|
+
readonly toggle: "Toggle";
|
|
602
|
+
readonly toggleOptions: "Toggle options";
|
|
603
|
+
readonly removableBadge: "Removable badge";
|
|
604
|
+
readonly removeBadge: "Remove badge";
|
|
605
|
+
readonly removeFile: "Remove {{name}}";
|
|
606
|
+
readonly removeTag: "Remove {{label}}";
|
|
607
|
+
};
|
|
608
|
+
readonly button: {
|
|
609
|
+
readonly close: "Close";
|
|
610
|
+
readonly apply: "Apply";
|
|
611
|
+
readonly cancel: "Cancel";
|
|
612
|
+
readonly confirm: "Confirm";
|
|
613
|
+
};
|
|
614
|
+
readonly menu: {
|
|
615
|
+
readonly placeholder: "Select an option...";
|
|
616
|
+
};
|
|
617
|
+
readonly common: {
|
|
618
|
+
readonly loading: "Loading...";
|
|
619
|
+
};
|
|
620
|
+
readonly languages: {
|
|
621
|
+
readonly de: "Deutsch";
|
|
622
|
+
readonly en: "English";
|
|
623
|
+
readonly es: "Español";
|
|
624
|
+
readonly fr: "Français";
|
|
625
|
+
readonly it: "Italiano";
|
|
626
|
+
readonly nl: "Nederlands";
|
|
627
|
+
};
|
|
628
|
+
readonly localeSwitcher: {
|
|
629
|
+
readonly ariaLabel: "Language selection";
|
|
630
|
+
readonly placeholder: "Select language...";
|
|
631
|
+
};
|
|
632
|
+
readonly pagination: {
|
|
633
|
+
readonly next: "Next";
|
|
634
|
+
readonly first: "First";
|
|
635
|
+
readonly last: "Last";
|
|
636
|
+
readonly page: "Page";
|
|
637
|
+
readonly previous: "Previous";
|
|
638
|
+
readonly pageInfo: "{{label}} {{current}} of {{total}}";
|
|
639
|
+
readonly rangeInfo: "{{start}}–{{end}} of {{total}}";
|
|
640
|
+
};
|
|
641
|
+
readonly calendar: {
|
|
642
|
+
readonly recurring: "Recurring event";
|
|
643
|
+
readonly previousMonth: "Previous month";
|
|
644
|
+
readonly nextMonth: "Next month";
|
|
645
|
+
readonly previousWeek: "Previous week";
|
|
646
|
+
readonly nextWeek: "Next week";
|
|
647
|
+
readonly previousDay: "Previous day";
|
|
648
|
+
readonly nextDay: "Next day";
|
|
649
|
+
readonly previousYear: "Previous year";
|
|
650
|
+
readonly nextYear: "Next year";
|
|
651
|
+
readonly today: "Today";
|
|
652
|
+
readonly calendarGrid: "Calendar";
|
|
653
|
+
readonly weekdays: "Weekdays";
|
|
654
|
+
readonly weekNumber: "Week number";
|
|
655
|
+
readonly events: "Events";
|
|
656
|
+
readonly noEvents: "No events";
|
|
657
|
+
readonly showMore: "{{count}} more";
|
|
658
|
+
readonly legend: "Legend";
|
|
659
|
+
readonly yearView: "Year overview";
|
|
660
|
+
readonly weekView: "Week view";
|
|
661
|
+
readonly viewMonth: "Month";
|
|
662
|
+
readonly viewYear: "Year";
|
|
663
|
+
readonly viewWeek: "Week";
|
|
664
|
+
readonly viewDay: "Day";
|
|
665
|
+
readonly multiDayLabel: "Day {{current}} of {{total}}";
|
|
666
|
+
readonly agendaView: "Agenda view";
|
|
667
|
+
readonly viewAgenda: "Agenda";
|
|
668
|
+
readonly viewSwitcher: "View mode";
|
|
669
|
+
};
|
|
670
|
+
readonly planner: {
|
|
671
|
+
readonly previousWeek: "Previous week";
|
|
672
|
+
readonly nextWeek: "Next week";
|
|
673
|
+
readonly previousMonth: "Previous month";
|
|
674
|
+
readonly nextMonth: "Next month";
|
|
675
|
+
readonly previousRange: "Previous range";
|
|
676
|
+
readonly nextRange: "Next range";
|
|
677
|
+
readonly today: "Today";
|
|
678
|
+
readonly grid: "Planner";
|
|
679
|
+
readonly itemCount: "{{count}} items";
|
|
680
|
+
};
|
|
681
|
+
readonly commandPalette: {
|
|
682
|
+
readonly noResults: "No results found.";
|
|
683
|
+
readonly search: "Search...";
|
|
684
|
+
readonly hints: {
|
|
685
|
+
readonly navigate: "Navigate";
|
|
686
|
+
readonly select: "Select";
|
|
687
|
+
readonly close: "Close";
|
|
688
|
+
};
|
|
689
|
+
};
|
|
690
|
+
readonly compositionBar: {
|
|
691
|
+
readonly total: "Total";
|
|
692
|
+
readonly summary: "Composition: {{total}} ({{count}} shares) — {{parts}}";
|
|
693
|
+
readonly share: "Share";
|
|
694
|
+
readonly value: "Value";
|
|
695
|
+
readonly percent: "Percent";
|
|
696
|
+
readonly remaining: "remaining";
|
|
697
|
+
};
|
|
698
|
+
readonly guide: {
|
|
699
|
+
readonly next: "Next";
|
|
700
|
+
readonly previous: "Back";
|
|
701
|
+
readonly skip: "Skip tour";
|
|
702
|
+
readonly done: "Done";
|
|
703
|
+
readonly step: "Step {{current}} of {{total}}";
|
|
704
|
+
readonly tour: "Guided tour";
|
|
705
|
+
readonly close: "Close";
|
|
706
|
+
readonly openHelp: "Help";
|
|
707
|
+
readonly backToList: "All topics";
|
|
708
|
+
readonly info: "More information";
|
|
709
|
+
readonly infoAbout: "More information about {{label}}";
|
|
710
|
+
readonly dismiss: "Dismiss hint";
|
|
711
|
+
readonly startTour: "Start the guided tour";
|
|
712
|
+
readonly actionRequired: "Complete the highlighted action to continue";
|
|
713
|
+
readonly filterPlaceholder: "Filter topics…";
|
|
714
|
+
readonly noResults: "No matching topics";
|
|
715
|
+
};
|
|
716
|
+
readonly journeyTimeline: {
|
|
717
|
+
readonly label: "Journey";
|
|
718
|
+
readonly status: {
|
|
719
|
+
readonly complete: "Completed";
|
|
720
|
+
readonly active: "In progress";
|
|
721
|
+
readonly pending: "Pending";
|
|
722
|
+
readonly attention: "Needs attention";
|
|
723
|
+
readonly blocked: "Blocked";
|
|
724
|
+
readonly skipped: "Skipped";
|
|
725
|
+
};
|
|
726
|
+
};
|
|
727
|
+
readonly datepicker: {
|
|
728
|
+
readonly placeholder: "Select a date...";
|
|
729
|
+
readonly rangePlaceholder: "Select a date range...";
|
|
730
|
+
readonly openCalendar: "Open calendar";
|
|
731
|
+
readonly invalidDate: "Invalid date";
|
|
732
|
+
readonly outOfRange: "Date is outside the allowed range";
|
|
733
|
+
readonly invalidRange: "Invalid date range";
|
|
734
|
+
};
|
|
735
|
+
readonly fileUpload: {
|
|
736
|
+
readonly exists: "File already added";
|
|
737
|
+
readonly invalidType: "File type {{type}} is not allowed";
|
|
738
|
+
readonly tooLarge: "File exceeds {{size}} limit";
|
|
739
|
+
readonly tooMany: "Maximum {{count}} files allowed";
|
|
740
|
+
readonly tooSmall: "File must be at least {{size}}";
|
|
741
|
+
};
|
|
742
|
+
readonly sankey: {
|
|
743
|
+
readonly summary: "Sankey diagram: {{nodes}} nodes, {{links}} links — {{flows}}";
|
|
744
|
+
readonly source: "Source";
|
|
745
|
+
readonly target: "Target";
|
|
746
|
+
readonly value: "Value";
|
|
747
|
+
};
|
|
748
|
+
readonly slider: {
|
|
749
|
+
readonly rangeStatus: {
|
|
750
|
+
readonly insideRecommended: "In recommended range";
|
|
751
|
+
readonly insideValid: "In valid range";
|
|
752
|
+
readonly insideValidOnly: "Outside recommended range, but valid";
|
|
753
|
+
readonly outsideValid: "Outside valid range";
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
readonly themeSwitcher: {
|
|
757
|
+
readonly lightMode: "Light mode";
|
|
758
|
+
readonly darkMode: "Dark mode";
|
|
759
|
+
readonly systemTheme: "System theme";
|
|
760
|
+
};
|
|
761
|
+
readonly chart: {
|
|
762
|
+
readonly category: "Category";
|
|
763
|
+
readonly series: "Series {{index}}";
|
|
764
|
+
readonly segment: "Segment";
|
|
765
|
+
readonly value: "Value";
|
|
766
|
+
readonly share: "Share";
|
|
767
|
+
};
|
|
768
|
+
readonly stepper: {
|
|
769
|
+
readonly optional: "Optional";
|
|
770
|
+
};
|
|
771
|
+
}>;
|
|
396
772
|
export declare const hasBlocksTranslation: (key: string) => boolean, getBlocksLocales: () => import("@urbicon-ui/i18n").Locale[];
|
|
397
773
|
export type BlocksTranslationKey = keyof typeof enTranslations;
|
|
398
774
|
export { blocksTranslations };
|
package/dist/mint/README.md
CHANGED
|
@@ -162,6 +162,39 @@ mintRegistry.register('my-mint', (config) => ({
|
|
|
162
162
|
- **Throttling**: Verhindert Spam bei schnellen Interaktionen
|
|
163
163
|
- **Cleanup**: Automatische Bereinigung bei Component-Unmount
|
|
164
164
|
|
|
165
|
+
## Auflösung & Tree-Shaking (resolveIcon-Muster)
|
|
166
|
+
|
|
167
|
+
`mintRegistry.apply(el, mint, fallbacks?)` löst jeden Mint-Namen in dieser
|
|
168
|
+
Reihenfolge auf:
|
|
169
|
+
|
|
170
|
+
1. **Registry-Eintrag** — Consumer-`register()`-Override oder bereits geladene
|
|
171
|
+
Built-ins (gewinnt immer, wie der IconProvider bei `resolveIcon`).
|
|
172
|
+
2. **`fallbacks`** — statisch importierte Factories des Aufrufers. Button
|
|
173
|
+
importiert `scaleMint` direkt (`{ scale: scaleMint }`), damit sein Default
|
|
174
|
+
tree-shaken mitkommt, ohne das gesamte Built-in-Set zu ziehen.
|
|
175
|
+
3. **Demand-Load** — unbekannte Namen laden das Built-in-Set einmalig per
|
|
176
|
+
dynamischem `import('./presets')` nach (Chunk wird nur gefetcht, wenn
|
|
177
|
+
tatsächlich ein dynamischer Mint-Name verwendet wird) und wenden den Effekt
|
|
178
|
+
danach an. `<Button mint="ripple">` funktioniert also weiterhin ohne
|
|
179
|
+
manuelles `registerDefaultMints()`.
|
|
180
|
+
|
|
181
|
+
**Kontrakt Demand-Load (dokumentiert):** Mint-Effekte sind dekorativ.
|
|
182
|
+
Interaktionen im Fetch-Fenster werden NICHT nachgespielt — auf langsamen
|
|
183
|
+
Netzen kann der erste Klick für einen noch nicht geladenen click-getriggerten
|
|
184
|
+
Effekt (`ripple`, `shake`, …) verloren gehen; hover-getriggerte Effekte
|
|
185
|
+
greifen ab dem nächsten `mouseenter`. Consumer-Overrides überleben den
|
|
186
|
+
Demand-Load immer (die Built-ins registrieren sich nur auf freie Namen —
|
|
187
|
+
`registerBuiltin`). Wer First-Interaction-Garantien braucht, registriert den
|
|
188
|
+
Effekt statisch beim App-Start: `registerDefaultMints()` oder
|
|
189
|
+
`mintRegistry.register(name, factory)` mit direkt importierter Factory.
|
|
190
|
+
|
|
191
|
+
Modul-Layout (load-bearing für die Chunk-Zuordnung): `engine.ts` enthält die
|
|
192
|
+
Micro-Interaction-Engine + `scaleMint` (schifft statisch mit Button);
|
|
193
|
+
`micro-interactions.ts` enthält NUR die Registrierungen und ist ausschließlich
|
|
194
|
+
über den demand-geladenen `presets.ts`-Chunk erreichbar. Neue statisch
|
|
195
|
+
verschiffte Default-Effekte gehören in `engine.ts` (oder ein eigenes Modul),
|
|
196
|
+
niemals in `micro-interactions.ts`.
|
|
197
|
+
|
|
165
198
|
## Accessibility
|
|
166
199
|
|
|
167
200
|
Das Mint-System respektiert automatisch `prefers-reduced-motion`:
|
package/dist/mint/compose.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { mintRegistry } from './registry.js';
|
|
2
2
|
import type { CompositeConfig, Mint } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Compose multiple mints into one
|
|
4
|
+
* Compose multiple mints into one.
|
|
5
|
+
*
|
|
6
|
+
* String members resolve like `mintRegistry.apply` does: a registry entry
|
|
7
|
+
* (consumer override or loaded built-in) applies synchronously; unresolved
|
|
8
|
+
* names demand-load the built-in set once and init after the load (skipped if
|
|
9
|
+
* the composite was destroyed in the meantime). A name that is still unknown
|
|
10
|
+
* after the load warns loudly instead of silently dropping the effect.
|
|
5
11
|
*/
|
|
6
12
|
export declare function composeMints(...mints: Array<Mint | string>): Mint;
|
|
7
13
|
/**
|
package/dist/mint/compose.js
CHANGED
|
@@ -1,26 +1,53 @@
|
|
|
1
|
-
import { mintRegistry } from './registry.js';
|
|
1
|
+
import { loadBuiltinMints, mintRegistry } from './registry.js';
|
|
2
2
|
/**
|
|
3
|
-
* Compose multiple mints into one
|
|
3
|
+
* Compose multiple mints into one.
|
|
4
|
+
*
|
|
5
|
+
* String members resolve like `mintRegistry.apply` does: a registry entry
|
|
6
|
+
* (consumer override or loaded built-in) applies synchronously; unresolved
|
|
7
|
+
* names demand-load the built-in set once and init after the load (skipped if
|
|
8
|
+
* the composite was destroyed in the meantime). A name that is still unknown
|
|
9
|
+
* after the load warns loudly instead of silently dropping the effect.
|
|
4
10
|
*/
|
|
5
11
|
export function composeMints(...mints) {
|
|
6
12
|
return {
|
|
7
13
|
init(el, config) {
|
|
8
14
|
const instances = [];
|
|
15
|
+
let disposed = false;
|
|
16
|
+
const applyInstance = (instance) => {
|
|
17
|
+
instance.init(el, config);
|
|
18
|
+
instances.push(instance);
|
|
19
|
+
};
|
|
20
|
+
const unresolved = [];
|
|
9
21
|
mints.forEach((mint) => {
|
|
10
22
|
if (typeof mint === 'string') {
|
|
11
23
|
const factory = mintRegistry.get(mint);
|
|
12
24
|
if (factory) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
applyInstance(factory(config));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
unresolved.push(mint);
|
|
16
29
|
}
|
|
17
30
|
}
|
|
18
31
|
else {
|
|
19
|
-
mint
|
|
20
|
-
instances.push(mint);
|
|
32
|
+
applyInstance(mint);
|
|
21
33
|
}
|
|
22
34
|
});
|
|
35
|
+
if (unresolved.length > 0) {
|
|
36
|
+
void loadBuiltinMints().then(() => {
|
|
37
|
+
if (disposed)
|
|
38
|
+
return;
|
|
39
|
+
unresolved.forEach((name) => {
|
|
40
|
+
const factory = mintRegistry.get(name);
|
|
41
|
+
if (!factory) {
|
|
42
|
+
console.warn(`[composeMints] Unknown mint: ${name}`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
applyInstance(factory(config));
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
23
49
|
this.destroy = () => {
|
|
50
|
+
disposed = true;
|
|
24
51
|
instances.forEach((instance) => {
|
|
25
52
|
instance.destroy?.(el);
|
|
26
53
|
});
|
|
@@ -46,5 +73,5 @@ export function createCompositeMint() {
|
|
|
46
73
|
* Called by registerDefaultMints() - not at module level.
|
|
47
74
|
*/
|
|
48
75
|
export function registerComposite(registry) {
|
|
49
|
-
registry.
|
|
76
|
+
registry.registerBuiltin('composite', createCompositeMint);
|
|
50
77
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { MicroInteractionConfig, Mint, MintFactory } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Micro-interaction engine + the statically-shipped default effect (scale).
|
|
4
|
+
*
|
|
5
|
+
* This module split is load-bearing for tree-shaking: everything in this file
|
|
6
|
+
* ships statically with components that import `scaleMint` (Button's mint
|
|
7
|
+
* default), while the per-effect registrations stay in
|
|
8
|
+
* `./micro-interactions.ts`, which is only reachable through the
|
|
9
|
+
* demand-loaded `./presets.ts` chunk. Rollup assigns a shared module's whole
|
|
10
|
+
* used-export-set to the chunk that statically owns it — if the registrations
|
|
11
|
+
* lived in this file, `registerMicroInteractions` (used by the lazy presets
|
|
12
|
+
* chunk) would be pulled into every Button consumer's initial bundle again.
|
|
13
|
+
* Add future statically-defaulted effects here (or in their own module),
|
|
14
|
+
* never in `micro-interactions.ts`.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Check if user prefers reduced motion
|
|
18
|
+
* @internal Shared with ./micro-interactions.ts; not part of the public API.
|
|
19
|
+
*/
|
|
20
|
+
export declare function prefersReducedMotion(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Generic micro-interaction factory
|
|
23
|
+
*/
|
|
24
|
+
export declare function createMicroInteraction(className: string, defaultConfig?: MicroInteractionConfig): Mint<MicroInteractionConfig>;
|
|
25
|
+
/**
|
|
26
|
+
* The `scale` micro-interaction factory, exported standalone so components
|
|
27
|
+
* whose mint *default* is `'scale'` (Button) can import it directly and pass
|
|
28
|
+
* it as a fallback: `mintRegistry.apply(el, mint, { scale: scaleMint })`.
|
|
29
|
+
* That is the `resolveIcon` tree-shaking pattern — the default effect ships
|
|
30
|
+
* with the component; the rest of the built-in set stays demand-loaded.
|
|
31
|
+
* `registerDefaultMints()` registers this same factory, so the registry path
|
|
32
|
+
* and the fallback path are behaviour-identical.
|
|
33
|
+
*/
|
|
34
|
+
export declare const scaleMint: MintFactory<MicroInteractionConfig>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Micro-interaction engine + the statically-shipped default effect (scale).
|
|
3
|
+
*
|
|
4
|
+
* This module split is load-bearing for tree-shaking: everything in this file
|
|
5
|
+
* ships statically with components that import `scaleMint` (Button's mint
|
|
6
|
+
* default), while the per-effect registrations stay in
|
|
7
|
+
* `./micro-interactions.ts`, which is only reachable through the
|
|
8
|
+
* demand-loaded `./presets.ts` chunk. Rollup assigns a shared module's whole
|
|
9
|
+
* used-export-set to the chunk that statically owns it — if the registrations
|
|
10
|
+
* lived in this file, `registerMicroInteractions` (used by the lazy presets
|
|
11
|
+
* chunk) would be pulled into every Button consumer's initial bundle again.
|
|
12
|
+
* Add future statically-defaulted effects here (or in their own module),
|
|
13
|
+
* never in `micro-interactions.ts`.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Check if user prefers reduced motion
|
|
17
|
+
* @internal Shared with ./micro-interactions.ts; not part of the public API.
|
|
18
|
+
*/
|
|
19
|
+
export function prefersReducedMotion() {
|
|
20
|
+
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generic micro-interaction factory
|
|
24
|
+
*/
|
|
25
|
+
export function createMicroInteraction(className, defaultConfig = {}) {
|
|
26
|
+
return {
|
|
27
|
+
init(el, config = {}) {
|
|
28
|
+
// Merge default config with provided config
|
|
29
|
+
const finalConfig = { ...defaultConfig, ...config };
|
|
30
|
+
// Skip if disabled or prefers reduced motion
|
|
31
|
+
if (finalConfig.disabled || prefersReducedMotion())
|
|
32
|
+
return;
|
|
33
|
+
const trigger = finalConfig.trigger || 'hover';
|
|
34
|
+
const duration = finalConfig.duration || 200;
|
|
35
|
+
const delay = finalConfig.delay || 0;
|
|
36
|
+
// Determine event based on trigger
|
|
37
|
+
const eventMap = {
|
|
38
|
+
hover: 'mouseenter',
|
|
39
|
+
click: 'click',
|
|
40
|
+
focus: 'focus',
|
|
41
|
+
load: 'load'
|
|
42
|
+
};
|
|
43
|
+
const event = eventMap[trigger] || 'mouseenter';
|
|
44
|
+
const handler = () => {
|
|
45
|
+
// Skip if this specific animation is already running
|
|
46
|
+
const animatingAttr = `data-animating-${className}`;
|
|
47
|
+
if (el.getAttribute(animatingAttr) === 'true')
|
|
48
|
+
return;
|
|
49
|
+
// Apply delay if specified
|
|
50
|
+
const applyAnimation = () => {
|
|
51
|
+
el.setAttribute(animatingAttr, 'true');
|
|
52
|
+
// Add dynamic styles if intensity is specified
|
|
53
|
+
if (finalConfig.intensity && className.includes('scale')) {
|
|
54
|
+
el.style.setProperty('--scale-intensity', finalConfig.intensity.toString());
|
|
55
|
+
}
|
|
56
|
+
el.classList.add(className);
|
|
57
|
+
const cleanup = () => {
|
|
58
|
+
el.classList.remove(className);
|
|
59
|
+
el.removeAttribute(animatingAttr);
|
|
60
|
+
el.style.removeProperty('--scale-intensity');
|
|
61
|
+
el.removeEventListener('animationend', cleanup);
|
|
62
|
+
el.removeEventListener('transitionend', cleanup);
|
|
63
|
+
};
|
|
64
|
+
el.addEventListener('animationend', cleanup, { once: true });
|
|
65
|
+
el.addEventListener('transitionend', cleanup, { once: true });
|
|
66
|
+
// Fallback timeout
|
|
67
|
+
setTimeout(cleanup, duration + 50);
|
|
68
|
+
};
|
|
69
|
+
if (delay > 0) {
|
|
70
|
+
setTimeout(applyAnimation, delay);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
applyAnimation();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
// Special handling for load trigger
|
|
77
|
+
if (trigger === 'load') {
|
|
78
|
+
// Execute immediately if element is already loaded
|
|
79
|
+
requestAnimationFrame(() => handler());
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
el.addEventListener(event, handler, { passive: true });
|
|
83
|
+
}
|
|
84
|
+
// Store cleanup function
|
|
85
|
+
this.destroy = () => {
|
|
86
|
+
if (event !== 'load') {
|
|
87
|
+
el.removeEventListener(event, handler);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The `scale` micro-interaction factory, exported standalone so components
|
|
95
|
+
* whose mint *default* is `'scale'` (Button) can import it directly and pass
|
|
96
|
+
* it as a fallback: `mintRegistry.apply(el, mint, { scale: scaleMint })`.
|
|
97
|
+
* That is the `resolveIcon` tree-shaking pattern — the default effect ships
|
|
98
|
+
* with the component; the rest of the built-in set stays demand-loaded.
|
|
99
|
+
* `registerDefaultMints()` registers this same factory, so the registry path
|
|
100
|
+
* and the fallback path are behaviour-identical.
|
|
101
|
+
*/
|
|
102
|
+
export const scaleMint = (config) => createMicroInteraction('blocks-mint-scale', {
|
|
103
|
+
trigger: 'hover',
|
|
104
|
+
duration: 200,
|
|
105
|
+
...config
|
|
106
|
+
});
|
package/dist/mint/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { composeMints, createCompositeMint } from './compose.js';
|
|
2
|
-
export { createMicroInteraction } from './
|
|
2
|
+
export { createMicroInteraction, scaleMint } from './engine.js';
|
|
3
3
|
export { mintPresets, registerBusinessMints, registerDefaultMints, registerPlayfulMints } from './presets.js';
|
|
4
|
-
export { mintRegistry } from './registry.js';
|
|
4
|
+
export { type MintFallbacks, mintRegistry } from './registry.js';
|
|
5
5
|
export { createRippleMint } from './ripple.js';
|
|
6
6
|
export { mint, useMint } from './svelte.js';
|
|
7
7
|
export * from './types.js';
|
package/dist/mint/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Core exports
|
|
2
2
|
export { composeMints, createCompositeMint } from './compose.js';
|
|
3
3
|
// Mint factories
|
|
4
|
-
export { createMicroInteraction } from './
|
|
4
|
+
export { createMicroInteraction, scaleMint } from './engine.js';
|
|
5
5
|
// Presets
|
|
6
6
|
export { mintPresets, registerBusinessMints, registerDefaultMints, registerPlayfulMints } from './presets.js';
|
|
7
7
|
export { mintRegistry } from './registry.js';
|