yukit-web 0.0.1
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/.npm/_logs/2026-08-20T08_40_55_706Z-debug-0.log +38 -0
- package/.npm/_logs/2026-08-20T08_40_56_280Z-debug-0.log +14 -0
- package/README.md +1465 -0
- package/fesm2022/yukit-web-helm-accordion.mjs +141 -0
- package/fesm2022/yukit-web-helm-accordion.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-alert-dialog.mjs +250 -0
- package/fesm2022/yukit-web-helm-alert-dialog.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-alert.mjs +94 -0
- package/fesm2022/yukit-web-helm-alert.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-aspect-ratio.mjs +47 -0
- package/fesm2022/yukit-web-helm-aspect-ratio.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-attachment.mjs +211 -0
- package/fesm2022/yukit-web-helm-attachment.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-autocomplete.mjs +361 -0
- package/fesm2022/yukit-web-helm-autocomplete.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-avatar.mjs +152 -0
- package/fesm2022/yukit-web-helm-avatar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-badge.mjs +47 -0
- package/fesm2022/yukit-web-helm-badge.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-breadcrumb.mjs +196 -0
- package/fesm2022/yukit-web-helm-breadcrumb.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-bubble.mjs +121 -0
- package/fesm2022/yukit-web-helm-bubble.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-button-group.mjs +86 -0
- package/fesm2022/yukit-web-helm-button-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-button.mjs +77 -0
- package/fesm2022/yukit-web-helm-button.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-calendar.mjs +937 -0
- package/fesm2022/yukit-web-helm-calendar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-card.mjs +141 -0
- package/fesm2022/yukit-web-helm-card.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-carousel.mjs +270 -0
- package/fesm2022/yukit-web-helm-carousel.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-checkbox.mjs +147 -0
- package/fesm2022/yukit-web-helm-checkbox.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-collapsible.mjs +62 -0
- package/fesm2022/yukit-web-helm-collapsible.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-combobox.mjs +624 -0
- package/fesm2022/yukit-web-helm-combobox.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-command.mjs +315 -0
- package/fesm2022/yukit-web-helm-command.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-context-menu.mjs +71 -0
- package/fesm2022/yukit-web-helm-context-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-date-picker.mjs +1517 -0
- package/fesm2022/yukit-web-helm-date-picker.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-dialog.mjs +271 -0
- package/fesm2022/yukit-web-helm-dialog.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-drawer.mjs +233 -0
- package/fesm2022/yukit-web-helm-drawer.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-dropdown-menu.mjs +508 -0
- package/fesm2022/yukit-web-helm-dropdown-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-empty.mjs +125 -0
- package/fesm2022/yukit-web-helm-empty.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-field.mjs +325 -0
- package/fesm2022/yukit-web-helm-field.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-hover-card.mjs +102 -0
- package/fesm2022/yukit-web-helm-hover-card.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input-group.mjs +171 -0
- package/fesm2022/yukit-web-helm-input-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input-otp.mjs +127 -0
- package/fesm2022/yukit-web-helm-input-otp.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-input.mjs +32 -0
- package/fesm2022/yukit-web-helm-input.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-item.mjs +242 -0
- package/fesm2022/yukit-web-helm-item.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-kbd.mjs +46 -0
- package/fesm2022/yukit-web-helm-kbd.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-label.mjs +30 -0
- package/fesm2022/yukit-web-helm-label.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-marker.mjs +77 -0
- package/fesm2022/yukit-web-helm-marker.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-menubar.mjs +90 -0
- package/fesm2022/yukit-web-helm-menubar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-message.mjs +115 -0
- package/fesm2022/yukit-web-helm-message.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-native-select.mjs +180 -0
- package/fesm2022/yukit-web-helm-native-select.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-navigation-menu.mjs +173 -0
- package/fesm2022/yukit-web-helm-navigation-menu.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-pagination.mjs +745 -0
- package/fesm2022/yukit-web-helm-pagination.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-popover.mjs +136 -0
- package/fesm2022/yukit-web-helm-popover.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-progress.mjs +60 -0
- package/fesm2022/yukit-web-helm-progress.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-radio-group.mjs +185 -0
- package/fesm2022/yukit-web-helm-radio-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-resizable.mjs +98 -0
- package/fesm2022/yukit-web-helm-resizable.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-scroll-area.mjs +36 -0
- package/fesm2022/yukit-web-helm-scroll-area.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-select.mjs +412 -0
- package/fesm2022/yukit-web-helm-select.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-separator.mjs +33 -0
- package/fesm2022/yukit-web-helm-separator.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sheet.mjs +254 -0
- package/fesm2022/yukit-web-helm-sheet.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sidebar.mjs +857 -0
- package/fesm2022/yukit-web-helm-sidebar.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-skeleton.mjs +29 -0
- package/fesm2022/yukit-web-helm-skeleton.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-slider.mjs +123 -0
- package/fesm2022/yukit-web-helm-slider.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-sonner.mjs +126 -0
- package/fesm2022/yukit-web-helm-sonner.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-spinner.mjs +48 -0
- package/fesm2022/yukit-web-helm-spinner.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-switch.mjs +126 -0
- package/fesm2022/yukit-web-helm-switch.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-table.mjs +180 -0
- package/fesm2022/yukit-web-helm-table.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-tabs.mjs +251 -0
- package/fesm2022/yukit-web-helm-tabs.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-textarea.mjs +32 -0
- package/fesm2022/yukit-web-helm-textarea.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-toggle-group.mjs +95 -0
- package/fesm2022/yukit-web-helm-toggle-group.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-toggle.mjs +61 -0
- package/fesm2022/yukit-web-helm-toggle.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-tooltip.mjs +57 -0
- package/fesm2022/yukit-web-helm-tooltip.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-typography.mjs +205 -0
- package/fesm2022/yukit-web-helm-typography.mjs.map +1 -0
- package/fesm2022/yukit-web-helm-utils.mjs +272 -0
- package/fesm2022/yukit-web-helm-utils.mjs.map +1 -0
- package/fesm2022/yukit-web.mjs +3592 -0
- package/fesm2022/yukit-web.mjs.map +1 -0
- package/package.json +291 -0
- package/src/lib/theme/spartan-overwrites/accordion.css +4 -0
- package/src/lib/theme/theme.css +161 -0
- package/src/lib/theme/tokens/color.css +356 -0
- package/src/lib/theme/tokens/component-colors.css +167 -0
- package/src/lib/theme/tokens/radius.css +18 -0
- package/src/lib/theme/tokens/typography.css +201 -0
- package/types/yukit-web-helm-accordion.d.ts +32 -0
- package/types/yukit-web-helm-alert-dialog.d.ts +85 -0
- package/types/yukit-web-helm-alert.d.ts +37 -0
- package/types/yukit-web-helm-aspect-ratio.d.ts +16 -0
- package/types/yukit-web-helm-attachment.d.ts +80 -0
- package/types/yukit-web-helm-autocomplete.d.ts +91 -0
- package/types/yukit-web-helm-avatar.d.ts +45 -0
- package/types/yukit-web-helm-badge.d.ts +19 -0
- package/types/yukit-web-helm-breadcrumb.d.ts +52 -0
- package/types/yukit-web-helm-bubble.d.ts +46 -0
- package/types/yukit-web-helm-button-group.d.ts +25 -0
- package/types/yukit-web-helm-button.d.ts +33 -0
- package/types/yukit-web-helm-calendar.d.ts +89 -0
- package/types/yukit-web-helm-card.d.ts +49 -0
- package/types/yukit-web-helm-carousel.d.ts +79 -0
- package/types/yukit-web-helm-checkbox.d.ts +60 -0
- package/types/yukit-web-helm-collapsible.d.ts +22 -0
- package/types/yukit-web-helm-combobox.d.ts +150 -0
- package/types/yukit-web-helm-command.d.ts +84 -0
- package/types/yukit-web-helm-context-menu.d.ts +29 -0
- package/types/yukit-web-helm-date-picker.d.ts +574 -0
- package/types/yukit-web-helm-dialog.d.ts +90 -0
- package/types/yukit-web-helm-drawer.d.ts +71 -0
- package/types/yukit-web-helm-dropdown-menu.d.ts +171 -0
- package/types/yukit-web-helm-empty.d.ts +49 -0
- package/types/yukit-web-helm-field.d.ts +102 -0
- package/types/yukit-web-helm-hover-card.d.ts +31 -0
- package/types/yukit-web-helm-input-group.d.ts +47 -0
- package/types/yukit-web-helm-input-otp.d.ts +40 -0
- package/types/yukit-web-helm-input.d.ts +13 -0
- package/types/yukit-web-helm-item.d.ts +96 -0
- package/types/yukit-web-helm-kbd.d.ts +17 -0
- package/types/yukit-web-helm-label.d.ts +12 -0
- package/types/yukit-web-helm-marker.d.ts +31 -0
- package/types/yukit-web-helm-menubar.d.ts +35 -0
- package/types/yukit-web-helm-message.d.ts +44 -0
- package/types/yukit-web-helm-native-select.d.ts +65 -0
- package/types/yukit-web-helm-navigation-menu.d.ts +49 -0
- package/types/yukit-web-helm-pagination.d.ts +187 -0
- package/types/yukit-web-helm-popover.d.ts +49 -0
- package/types/yukit-web-helm-progress.d.ts +22 -0
- package/types/yukit-web-helm-radio-group.d.ts +66 -0
- package/types/yukit-web-helm-resizable.d.ts +27 -0
- package/types/yukit-web-helm-scroll-area.d.ts +11 -0
- package/types/yukit-web-helm-select.d.ts +114 -0
- package/types/yukit-web-helm-separator.d.ts +13 -0
- package/types/yukit-web-helm-sheet.d.ts +75 -0
- package/types/yukit-web-helm-sidebar.d.ts +232 -0
- package/types/yukit-web-helm-skeleton.d.ts +11 -0
- package/types/yukit-web-helm-slider.d.ts +14 -0
- package/types/yukit-web-helm-sonner.d.ts +52 -0
- package/types/yukit-web-helm-spinner.d.ts +18 -0
- package/types/yukit-web-helm-switch.d.ts +54 -0
- package/types/yukit-web-helm-table.d.ts +82 -0
- package/types/yukit-web-helm-tabs.d.ts +66 -0
- package/types/yukit-web-helm-textarea.d.ts +13 -0
- package/types/yukit-web-helm-toggle-group.d.ts +34 -0
- package/types/yukit-web-helm-toggle.d.ts +22 -0
- package/types/yukit-web-helm-tooltip.d.ts +17 -0
- package/types/yukit-web-helm-typography.d.ts +89 -0
- package/types/yukit-web-helm-utils.d.ts +44 -0
- package/types/yukit-web.d.ts +2426 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import { runInInjectionContext, inject, Injector, ElementRef, PLATFORM_ID, DestroyRef, HostAttributeToken, effect, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { OVERLAY_DEFAULT_CONFIG } from '@angular/cdk/overlay';
|
|
6
|
+
|
|
7
|
+
function hlm(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
// Global map to track class managers per element
|
|
11
|
+
const elementClassManagers = new WeakMap();
|
|
12
|
+
// Global mutation observer for all elements
|
|
13
|
+
let globalObserver = null;
|
|
14
|
+
const observedElements = new Set();
|
|
15
|
+
let sourceCounter = 0;
|
|
16
|
+
/**
|
|
17
|
+
* This function dynamically adds and removes classes for a given element without requiring
|
|
18
|
+
* the a class binding (e.g. `[class]="..."`) which may interfere with other class bindings.
|
|
19
|
+
*
|
|
20
|
+
* 1. This will merge the existing classes on the element with the new classes.
|
|
21
|
+
* 2. It will also remove any classes that were previously added by this function but are no longer present in the new classes.
|
|
22
|
+
* 3. Multiple calls to this function on the same element will be merged efficiently.
|
|
23
|
+
*/
|
|
24
|
+
function classes(computed, options = {}) {
|
|
25
|
+
runInInjectionContext(options.injector ?? inject(Injector), () => {
|
|
26
|
+
const elementRef = options.elementRef ?? inject(ElementRef);
|
|
27
|
+
const platformId = inject(PLATFORM_ID);
|
|
28
|
+
const destroyRef = inject(DestroyRef);
|
|
29
|
+
const baseClasses = inject(new HostAttributeToken('class'), { optional: true });
|
|
30
|
+
const element = elementRef.nativeElement;
|
|
31
|
+
// Create unique identifier for this source
|
|
32
|
+
const sourceId = sourceCounter++;
|
|
33
|
+
// Get or create the class manager for this element
|
|
34
|
+
let manager = elementClassManagers.get(element);
|
|
35
|
+
if (!manager) {
|
|
36
|
+
// Initialize base classes from variation (host attribute 'class')
|
|
37
|
+
const initialBaseClasses = new Set();
|
|
38
|
+
if (baseClasses) {
|
|
39
|
+
toClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));
|
|
40
|
+
}
|
|
41
|
+
manager = {
|
|
42
|
+
element,
|
|
43
|
+
sources: new Map(),
|
|
44
|
+
baseClasses: initialBaseClasses,
|
|
45
|
+
isUpdating: false,
|
|
46
|
+
nextOrder: 0,
|
|
47
|
+
hasInitialized: false,
|
|
48
|
+
restoreRafId: null,
|
|
49
|
+
transitionsSuppressed: false,
|
|
50
|
+
previousTransition: '',
|
|
51
|
+
previousTransitionPriority: '',
|
|
52
|
+
};
|
|
53
|
+
elementClassManagers.set(element, manager);
|
|
54
|
+
// Setup global observer if needed and register this element
|
|
55
|
+
setupGlobalObserver(platformId);
|
|
56
|
+
observedElements.add(element);
|
|
57
|
+
// Suppress transitions until the first effect writes correct classes and
|
|
58
|
+
// the browser has painted them. This prevents CSS transition animations
|
|
59
|
+
// during hydration when classes change from SSR state to client state.
|
|
60
|
+
if (isPlatformBrowser(platformId)) {
|
|
61
|
+
manager.previousTransition = element.style.getPropertyValue('transition');
|
|
62
|
+
manager.previousTransitionPriority = element.style.getPropertyPriority('transition');
|
|
63
|
+
element.style.setProperty('transition', 'none', 'important');
|
|
64
|
+
manager.transitionsSuppressed = true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Assign order once at registration time
|
|
68
|
+
const sourceOrder = manager.nextOrder++;
|
|
69
|
+
function updateClasses() {
|
|
70
|
+
// Get the new classes from the computed function
|
|
71
|
+
const newClasses = toClassList(computed());
|
|
72
|
+
// Update this source's classes, keeping the original order
|
|
73
|
+
manager.sources.set(sourceId, {
|
|
74
|
+
classes: new Set(newClasses),
|
|
75
|
+
order: sourceOrder,
|
|
76
|
+
});
|
|
77
|
+
// Update the element
|
|
78
|
+
updateElement(manager);
|
|
79
|
+
// Re-enable transitions after the first effect writes correct classes.
|
|
80
|
+
// Deferred to next animation frame so the browser paints the class change
|
|
81
|
+
// with transitions disabled first, then re-enables them.
|
|
82
|
+
if (manager.transitionsSuppressed) {
|
|
83
|
+
manager.transitionsSuppressed = false;
|
|
84
|
+
manager.restoreRafId = requestAnimationFrame(() => {
|
|
85
|
+
manager.restoreRafId = null;
|
|
86
|
+
restoreTransitionSuppression(manager);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Register cleanup with DestroyRef
|
|
91
|
+
destroyRef.onDestroy(() => {
|
|
92
|
+
if (manager.restoreRafId !== null) {
|
|
93
|
+
cancelAnimationFrame(manager.restoreRafId);
|
|
94
|
+
manager.restoreRafId = null;
|
|
95
|
+
}
|
|
96
|
+
if (manager.transitionsSuppressed) {
|
|
97
|
+
manager.transitionsSuppressed = false;
|
|
98
|
+
restoreTransitionSuppression(manager);
|
|
99
|
+
}
|
|
100
|
+
// Remove this source from the manager
|
|
101
|
+
manager.sources.delete(sourceId);
|
|
102
|
+
// If no more sources, clean up the manager
|
|
103
|
+
if (manager.sources.size === 0) {
|
|
104
|
+
cleanupManager(element);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// Update element without this source's classes
|
|
108
|
+
updateElement(manager);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* We need this effect to track changes to the computed classes. Ideally, we would use
|
|
113
|
+
* afterRenderEffect here, but that doesn't run in SSR contexts, so we use a standard
|
|
114
|
+
* effect which works in both browser and SSR.
|
|
115
|
+
*/
|
|
116
|
+
effect(updateClasses);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function restoreTransitionSuppression(manager) {
|
|
120
|
+
const prev = manager.previousTransition;
|
|
121
|
+
if (prev) {
|
|
122
|
+
manager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
manager.element.style.removeProperty('transition');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
|
|
129
|
+
function setupGlobalObserver(platformId) {
|
|
130
|
+
if (isPlatformBrowser(platformId) && !globalObserver) {
|
|
131
|
+
// Create single global observer that watches the entire document
|
|
132
|
+
globalObserver = new MutationObserver((mutations) => {
|
|
133
|
+
for (const mutation of mutations) {
|
|
134
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
135
|
+
const element = mutation.target;
|
|
136
|
+
const manager = elementClassManagers.get(element);
|
|
137
|
+
// Only process elements we're managing
|
|
138
|
+
if (manager && observedElements.has(element)) {
|
|
139
|
+
if (manager.isUpdating)
|
|
140
|
+
continue; // Ignore changes we're making
|
|
141
|
+
// Update base classes to include any externally added classes
|
|
142
|
+
const currentClasses = toClassList(element.className);
|
|
143
|
+
const allSourceClasses = new Set();
|
|
144
|
+
// Collect all classes from all sources
|
|
145
|
+
for (const source of manager.sources.values()) {
|
|
146
|
+
for (const className of source.classes) {
|
|
147
|
+
allSourceClasses.add(className);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// Any classes not from sources become new base classes
|
|
151
|
+
manager.baseClasses.clear();
|
|
152
|
+
for (const className of currentClasses) {
|
|
153
|
+
if (!allSourceClasses.has(className)) {
|
|
154
|
+
manager.baseClasses.add(className);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
updateElement(manager);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
// Start observing the entire document for class attribute changes
|
|
163
|
+
globalObserver.observe(document, {
|
|
164
|
+
attributes: true,
|
|
165
|
+
attributeFilter: ['class'],
|
|
166
|
+
subtree: true, // Watch all descendants
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function updateElement(manager) {
|
|
171
|
+
if (manager.isUpdating)
|
|
172
|
+
return; // Prevent recursive updates
|
|
173
|
+
manager.isUpdating = true;
|
|
174
|
+
// Handle initialization: capture base classes after first source registration
|
|
175
|
+
if (!manager.hasInitialized && manager.sources.size > 0) {
|
|
176
|
+
// Get current classes on element (may include SSR classes)
|
|
177
|
+
const currentClasses = toClassList(manager.element.className);
|
|
178
|
+
// Get all classes that will be applied by sources
|
|
179
|
+
const allSourceClasses = new Set();
|
|
180
|
+
for (const source of manager.sources.values()) {
|
|
181
|
+
source.classes.forEach((className) => allSourceClasses.add(className));
|
|
182
|
+
}
|
|
183
|
+
// Only consider classes as "base" if they're not produced by any source
|
|
184
|
+
// This prevents SSR-rendered classes from being preserved as base classes
|
|
185
|
+
currentClasses.forEach((className) => {
|
|
186
|
+
if (!allSourceClasses.has(className)) {
|
|
187
|
+
manager.baseClasses.add(className);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
manager.hasInitialized = true;
|
|
191
|
+
}
|
|
192
|
+
// Get classes from all sources, sorted by registration order (later takes precedence)
|
|
193
|
+
const sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);
|
|
194
|
+
const allSourceClasses = [];
|
|
195
|
+
for (const [, source] of sortedSources) {
|
|
196
|
+
allSourceClasses.push(...source.classes);
|
|
197
|
+
}
|
|
198
|
+
// Combine base classes with all source classes, ensuring base classes take precedence
|
|
199
|
+
const classesToApply = allSourceClasses.length > 0 || manager.baseClasses.size > 0
|
|
200
|
+
? hlm([...allSourceClasses, ...manager.baseClasses])
|
|
201
|
+
: '';
|
|
202
|
+
// Apply the classes to the element
|
|
203
|
+
if (manager.element.className !== classesToApply) {
|
|
204
|
+
manager.element.className = classesToApply;
|
|
205
|
+
}
|
|
206
|
+
manager.isUpdating = false;
|
|
207
|
+
}
|
|
208
|
+
function cleanupManager(element) {
|
|
209
|
+
// Remove from global tracking
|
|
210
|
+
observedElements.delete(element);
|
|
211
|
+
elementClassManagers.delete(element);
|
|
212
|
+
// If no more elements being tracked, cleanup global observer
|
|
213
|
+
if (observedElements.size === 0 && globalObserver) {
|
|
214
|
+
globalObserver.disconnect();
|
|
215
|
+
globalObserver = null;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// Cache for parsed class lists to avoid repeated string operations
|
|
219
|
+
const classListCache = new Map();
|
|
220
|
+
function toClassList(className) {
|
|
221
|
+
// For simple string inputs, use cache to avoid repeated parsing
|
|
222
|
+
if (typeof className === 'string' && classListCache.has(className)) {
|
|
223
|
+
return classListCache.get(className);
|
|
224
|
+
}
|
|
225
|
+
const result = clsx(className)
|
|
226
|
+
.split(' ')
|
|
227
|
+
.filter((c) => c.length > 0);
|
|
228
|
+
// Cache string results, but limit cache size to prevent memory growth
|
|
229
|
+
if (typeof className === 'string' && classListCache.size < 1000) {
|
|
230
|
+
classListCache.set(className, result);
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Provides default configuration for Spartan Helm components.
|
|
237
|
+
*
|
|
238
|
+
* This utility configures the Angular CDK overlay to disable the `usePopover`
|
|
239
|
+
* behavior introduced in Angular 21, which causes CDK overlay-based components
|
|
240
|
+
* (sheets, dialogs, tooltips, etc.) to render above `position: fixed` elements
|
|
241
|
+
* like `<hlm-toaster>`.
|
|
242
|
+
*
|
|
243
|
+
* @returns {EnvironmentProviders} Environment providers to be added to the application config.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```ts
|
|
247
|
+
* // app.config.ts
|
|
248
|
+
* import { provideSpartanHlm } from 'yukit-web/helm/utils';
|
|
249
|
+
*
|
|
250
|
+
* export const appConfig: ApplicationConfig = {
|
|
251
|
+
* providers: [
|
|
252
|
+
* provideSpartanHlm(),
|
|
253
|
+
* // ... other providers
|
|
254
|
+
* ],
|
|
255
|
+
* };
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
function provideSpartanHlm() {
|
|
259
|
+
return makeEnvironmentProviders([
|
|
260
|
+
{
|
|
261
|
+
provide: OVERLAY_DEFAULT_CONFIG,
|
|
262
|
+
useValue: { usePopover: false },
|
|
263
|
+
},
|
|
264
|
+
]);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Generated bundle index. Do not edit.
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
export { classes, hlm, provideSpartanHlm };
|
|
272
|
+
//# sourceMappingURL=yukit-web-helm-utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yukit-web-helm-utils.mjs","sources":["../../../projects/yukit-web/helm/utils/src/lib/hlm.ts","../../../projects/yukit-web/helm/utils/src/lib/provide-spartan-hlm.ts","../../../projects/yukit-web/helm/utils/src/yukit-web-helm-utils.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n\tDestroyRef,\n\teffect,\n\tElementRef,\n\tHostAttributeToken,\n\tinject,\n\tInjector,\n\tPLATFORM_ID,\n\trunInInjectionContext,\n} from '@angular/core';\nimport { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function hlm(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n\n// Global map to track class managers per element\nconst elementClassManagers = new WeakMap<HTMLElement, ElementClassManager>();\n// Global mutation observer for all elements\nlet globalObserver: MutationObserver | null = null;\nconst observedElements = new Set<HTMLElement>();\n\ninterface ElementClassManager {\n\telement: HTMLElement;\n\tsources: Map<number, { classes: Set<string>; order: number }>;\n\tbaseClasses: Set<string>;\n\tisUpdating: boolean;\n\tnextOrder: number;\n\thasInitialized: boolean;\n\trestoreRafId: number | null;\n\t/** Transitions are suppressed until the first effect writes correct classes */\n\ttransitionsSuppressed: boolean;\n\t/** Original inline transition value to restore after suppression (empty string = none was set) */\n\tpreviousTransition: string;\n\t/** Original inline transition priority to preserve !important when restoring */\n\tpreviousTransitionPriority: string;\n}\n\nlet sourceCounter = 0;\n\n/**\n * This function dynamically adds and removes classes for a given element without requiring\n * the a class binding (e.g. `[class]=\"...\"`) which may interfere with other class bindings.\n *\n * 1. This will merge the existing classes on the element with the new classes.\n * 2. It will also remove any classes that were previously added by this function but are no longer present in the new classes.\n * 3. Multiple calls to this function on the same element will be merged efficiently.\n */\nexport function classes(computed: () => ClassValue[] | string, options: ClassesOptions = {}) {\n\trunInInjectionContext(options.injector ?? inject(Injector), () => {\n\t\tconst elementRef = options.elementRef ?? inject(ElementRef);\n\t\tconst platformId = inject(PLATFORM_ID);\n\t\tconst destroyRef = inject(DestroyRef);\n\t\tconst baseClasses = inject(new HostAttributeToken('class'), { optional: true });\n\n\t\tconst element = elementRef.nativeElement;\n\n\t\t// Create unique identifier for this source\n\t\tconst sourceId = sourceCounter++;\n\n\t\t// Get or create the class manager for this element\n\t\tlet manager = elementClassManagers.get(element);\n\n\t\tif (!manager) {\n\t\t\t// Initialize base classes from variation (host attribute 'class')\n\t\t\tconst initialBaseClasses = new Set<string>();\n\n\t\t\tif (baseClasses) {\n\t\t\t\ttoClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));\n\t\t\t}\n\n\t\t\tmanager = {\n\t\t\t\telement,\n\t\t\t\tsources: new Map(),\n\t\t\t\tbaseClasses: initialBaseClasses,\n\t\t\t\tisUpdating: false,\n\t\t\t\tnextOrder: 0,\n\t\t\t\thasInitialized: false,\n\t\t\t\trestoreRafId: null,\n\t\t\t\ttransitionsSuppressed: false,\n\t\t\t\tpreviousTransition: '',\n\t\t\t\tpreviousTransitionPriority: '',\n\t\t\t};\n\t\t\telementClassManagers.set(element, manager);\n\n\t\t\t// Setup global observer if needed and register this element\n\t\t\tsetupGlobalObserver(platformId);\n\t\t\tobservedElements.add(element);\n\n\t\t\t// Suppress transitions until the first effect writes correct classes and\n\t\t\t// the browser has painted them. This prevents CSS transition animations\n\t\t\t// during hydration when classes change from SSR state to client state.\n\t\t\tif (isPlatformBrowser(platformId)) {\n\t\t\t\tmanager.previousTransition = element.style.getPropertyValue('transition');\n\t\t\t\tmanager.previousTransitionPriority = element.style.getPropertyPriority('transition');\n\t\t\t\telement.style.setProperty('transition', 'none', 'important');\n\t\t\t\tmanager.transitionsSuppressed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Assign order once at registration time\n\t\tconst sourceOrder = manager.nextOrder++;\n\n\t\tfunction updateClasses(): void {\n\t\t\t// Get the new classes from the computed function\n\t\t\tconst newClasses = toClassList(computed());\n\n\t\t\t// Update this source's classes, keeping the original order\n\t\t\tmanager!.sources.set(sourceId, {\n\t\t\t\tclasses: new Set(newClasses),\n\t\t\t\torder: sourceOrder,\n\t\t\t});\n\n\t\t\t// Update the element\n\t\t\tupdateElement(manager!);\n\n\t\t\t// Re-enable transitions after the first effect writes correct classes.\n\t\t\t// Deferred to next animation frame so the browser paints the class change\n\t\t\t// with transitions disabled first, then re-enables them.\n\t\t\tif (manager!.transitionsSuppressed) {\n\t\t\t\tmanager!.transitionsSuppressed = false;\n\t\t\t\tmanager!.restoreRafId = requestAnimationFrame(() => {\n\t\t\t\t\tmanager!.restoreRafId = null;\n\t\t\t\t\trestoreTransitionSuppression(manager!);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Register cleanup with DestroyRef\n\t\tdestroyRef.onDestroy(() => {\n\t\t\tif (manager!.restoreRafId !== null) {\n\t\t\t\tcancelAnimationFrame(manager!.restoreRafId);\n\t\t\t\tmanager!.restoreRafId = null;\n\t\t\t}\n\n\t\t\tif (manager!.transitionsSuppressed) {\n\t\t\t\tmanager!.transitionsSuppressed = false;\n\t\t\t\trestoreTransitionSuppression(manager!);\n\t\t\t}\n\n\t\t\t// Remove this source from the manager\n\t\t\tmanager!.sources.delete(sourceId);\n\n\t\t\t// If no more sources, clean up the manager\n\t\t\tif (manager!.sources.size === 0) {\n\t\t\t\tcleanupManager(element);\n\t\t\t} else {\n\t\t\t\t// Update element without this source's classes\n\t\t\t\tupdateElement(manager!);\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * We need this effect to track changes to the computed classes. Ideally, we would use\n\t\t * afterRenderEffect here, but that doesn't run in SSR contexts, so we use a standard\n\t\t * effect which works in both browser and SSR.\n\t\t */\n\t\teffect(updateClasses);\n\t});\n}\n\nfunction restoreTransitionSuppression(manager: ElementClassManager): void {\n\tconst prev = manager.previousTransition;\n\tif (prev) {\n\t\tmanager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);\n\t} else {\n\t\tmanager.element.style.removeProperty('transition');\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nfunction setupGlobalObserver(platformId: Object): void {\n\tif (isPlatformBrowser(platformId) && !globalObserver) {\n\t\t// Create single global observer that watches the entire document\n\t\tglobalObserver = new MutationObserver((mutations) => {\n\t\t\tfor (const mutation of mutations) {\n\t\t\t\tif (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n\t\t\t\t\tconst element = mutation.target as HTMLElement;\n\t\t\t\t\tconst manager = elementClassManagers.get(element);\n\n\t\t\t\t\t// Only process elements we're managing\n\t\t\t\t\tif (manager && observedElements.has(element)) {\n\t\t\t\t\t\tif (manager.isUpdating) continue; // Ignore changes we're making\n\n\t\t\t\t\t\t// Update base classes to include any externally added classes\n\t\t\t\t\t\tconst currentClasses = toClassList(element.className);\n\t\t\t\t\t\tconst allSourceClasses = new Set<string>();\n\n\t\t\t\t\t\t// Collect all classes from all sources\n\t\t\t\t\t\tfor (const source of manager.sources.values()) {\n\t\t\t\t\t\t\tfor (const className of source.classes) {\n\t\t\t\t\t\t\t\tallSourceClasses.add(className);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Any classes not from sources become new base classes\n\t\t\t\t\t\tmanager.baseClasses.clear();\n\n\t\t\t\t\t\tfor (const className of currentClasses) {\n\t\t\t\t\t\t\tif (!allSourceClasses.has(className)) {\n\t\t\t\t\t\t\t\tmanager.baseClasses.add(className);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tupdateElement(manager);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Start observing the entire document for class attribute changes\n\t\tglobalObserver.observe(document, {\n\t\t\tattributes: true,\n\t\t\tattributeFilter: ['class'],\n\t\t\tsubtree: true, // Watch all descendants\n\t\t});\n\t}\n}\n\nfunction updateElement(manager: ElementClassManager): void {\n\tif (manager.isUpdating) return; // Prevent recursive updates\n\n\tmanager.isUpdating = true;\n\n\t// Handle initialization: capture base classes after first source registration\n\tif (!manager.hasInitialized && manager.sources.size > 0) {\n\t\t// Get current classes on element (may include SSR classes)\n\t\tconst currentClasses = toClassList(manager.element.className);\n\n\t\t// Get all classes that will be applied by sources\n\t\tconst allSourceClasses = new Set<string>();\n\t\tfor (const source of manager.sources.values()) {\n\t\t\tsource.classes.forEach((className) => allSourceClasses.add(className));\n\t\t}\n\n\t\t// Only consider classes as \"base\" if they're not produced by any source\n\t\t// This prevents SSR-rendered classes from being preserved as base classes\n\t\tcurrentClasses.forEach((className) => {\n\t\t\tif (!allSourceClasses.has(className)) {\n\t\t\t\tmanager.baseClasses.add(className);\n\t\t\t}\n\t\t});\n\n\t\tmanager.hasInitialized = true;\n\t}\n\n\t// Get classes from all sources, sorted by registration order (later takes precedence)\n\tconst sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);\n\n\tconst allSourceClasses: string[] = [];\n\tfor (const [, source] of sortedSources) {\n\t\tallSourceClasses.push(...source.classes);\n\t}\n\n\t// Combine base classes with all source classes, ensuring base classes take precedence\n\tconst classesToApply =\n\t\tallSourceClasses.length > 0 || manager.baseClasses.size > 0\n\t\t\t? hlm([...allSourceClasses, ...manager.baseClasses])\n\t\t\t: '';\n\n\t// Apply the classes to the element\n\tif (manager.element.className !== classesToApply) {\n\t\tmanager.element.className = classesToApply;\n\t}\n\n\tmanager.isUpdating = false;\n}\n\nfunction cleanupManager(element: HTMLElement): void {\n\t// Remove from global tracking\n\tobservedElements.delete(element);\n\telementClassManagers.delete(element);\n\n\t// If no more elements being tracked, cleanup global observer\n\tif (observedElements.size === 0 && globalObserver) {\n\t\tglobalObserver.disconnect();\n\t\tglobalObserver = null;\n\t}\n}\n\ninterface ClassesOptions {\n\telementRef?: ElementRef<HTMLElement>;\n\tinjector?: Injector;\n}\n\n// Cache for parsed class lists to avoid repeated string operations\nconst classListCache = new Map<string, string[]>();\n\nfunction toClassList(className: string | ClassValue[]): string[] {\n\t// For simple string inputs, use cache to avoid repeated parsing\n\tif (typeof className === 'string' && classListCache.has(className)) {\n\t\treturn classListCache.get(className)!;\n\t}\n\n\tconst result = clsx(className)\n\t\t.split(' ')\n\t\t.filter((c) => c.length > 0);\n\n\t// Cache string results, but limit cache size to prevent memory growth\n\tif (typeof className === 'string' && classListCache.size < 1000) {\n\t\tclassListCache.set(className, result);\n\t}\n\n\treturn result;\n}\n","import { OVERLAY_DEFAULT_CONFIG } from '@angular/cdk/overlay';\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\n/**\n * Provides default configuration for Spartan Helm components.\n *\n * This utility configures the Angular CDK overlay to disable the `usePopover`\n * behavior introduced in Angular 21, which causes CDK overlay-based components\n * (sheets, dialogs, tooltips, etc.) to render above `position: fixed` elements\n * like `<hlm-toaster>`.\n *\n * @returns {EnvironmentProviders} Environment providers to be added to the application config.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { provideSpartanHlm } from 'yukit-web/helm/utils';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideSpartanHlm(),\n * // ... other providers\n * ],\n * };\n * ```\n */\nexport function provideSpartanHlm(): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: OVERLAY_DEFAULT_CONFIG,\n\t\t\tuseValue: { usePopover: false },\n\t\t},\n\t]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAcM,SAAU,GAAG,CAAC,GAAG,MAAoB,EAAA;AAC1C,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC7B;AAEA;AACA,MAAM,oBAAoB,GAAG,IAAI,OAAO,EAAoC;AAC5E;AACA,IAAI,cAAc,GAA4B,IAAI;AAClD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAe;AAkB/C,IAAI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