@nanahoshi/mona-ui 0.1.1 → 0.2.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/auto-complete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/button-group/package.json +4 -0
- package/calendar/package.json +4 -0
- package/check-box/package.json +4 -0
- package/chip/package.json +4 -0
- package/circular-progress-bar/package.json +4 -0
- package/color-gradient/package.json +4 -0
- package/color-palette/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/combo-box/package.json +4 -0
- package/common/package.json +4 -0
- package/contextmenu/package.json +4 -0
- package/date-input/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/datetime-picker/package.json +4 -0
- package/dialog/package.json +4 -0
- package/dropdown-button/package.json +4 -0
- package/dropdown-list/package.json +4 -0
- package/dropdowns/package.json +4 -0
- package/editor/package.json +4 -0
- package/expansion-panel/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +19 -53
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +15 -26
- package/fesm2022/nanahoshi-mona-ui-button.mjs +67 -68
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +54 -150
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +67 -99
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +35 -45
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +9 -23
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +27 -78
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +17 -39
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +39 -48
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +34 -54
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +9 -12
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +42 -29
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +53 -53
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -153
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +33 -54
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +7 -12
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +59 -219
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +24 -75
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +11 -44
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +11 -41
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DZk18LJC.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs → nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs} +9 -16
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +15 -44
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs} +11 -20
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +109 -393
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +27 -57
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +31 -122
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +4 -26
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +5 -18
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +48 -154
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +36 -63
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -108
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +38 -64
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +21 -73
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +8 -30
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +29 -50
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +36 -108
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +19 -60
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +78 -98
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +53 -144
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +54 -110
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +7 -20
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +15 -50
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +28 -91
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +37 -59
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -107
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +19 -31
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -65
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +43 -29
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +40 -102
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +13 -41
- package/fesm2022/nanahoshi-mona-ui-window.mjs +29 -108
- package/fieldset/package.json +4 -0
- package/filter/package.json +4 -0
- package/grid/package.json +4 -0
- package/internal/filter-input/package.json +4 -0
- package/internal/indicator-icon/package.json +4 -0
- package/internal/list/package.json +4 -0
- package/internal/package.json +4 -0
- package/internal/tree/package.json +4 -0
- package/list/package.json +4 -0
- package/list-box/package.json +4 -0
- package/list-view/package.json +4 -0
- package/menubar/package.json +4 -0
- package/multi-select/package.json +4 -0
- package/notification/package.json +4 -0
- package/numeric-text-box/package.json +4 -0
- package/package.json +2 -1
- package/pager/package.json +4 -0
- package/placeholder/package.json +4 -0
- package/popover/package.json +4 -0
- package/popup/package.json +4 -0
- package/popup-menu/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/query/package.json +4 -0
- package/radio-button/package.json +4 -0
- package/scroll-view/package.json +4 -0
- package/slider/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/tabs/package.json +4 -0
- package/text-area/package.json +4 -0
- package/text-box/package.json +4 -0
- package/theme/package.json +4 -0
- package/time-picker/package.json +4 -0
- package/time-selector/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree-view/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
- package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
- package/types/nanahoshi-mona-ui-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
- package/types/nanahoshi-mona-ui-check-box.d.ts +18 -10
- package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
- package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
- package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -5
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
- package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +2 -3
- package/types/nanahoshi-mona-ui-grid.d.ts +14 -15
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
- package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
- package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
- package/types/nanahoshi-mona-ui-menubar.d.ts +6 -7
- package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
- package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
- package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +28 -13
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
- package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
- package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
- package/types/nanahoshi-mona-ui-stepper.d.ts +12 -13
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +14 -16
- package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
- package/types/nanahoshi-mona-ui-text-box.d.ts +16 -7
- package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-time-selector.d.ts +11 -11
- package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
- package/types/nanahoshi-mona-ui-window.d.ts +16 -17
- package/window/package.json +4 -0
|
@@ -2,17 +2,16 @@ import { DOCUMENT } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, DestroyRef, Renderer2, computed, linkedSignal, viewChild, TemplateRef, input, output, afterRenderEffect, Component, ElementRef, EnvironmentInjector, signal, createComponent, Directive, ChangeDetectionStrategy } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import { createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
5
|
+
import { themeOverlaySurfaceClasses, createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
6
6
|
import { PopupService, fadePopupAnimation } from '@nanahoshi/mona-ui/popup';
|
|
7
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
8
7
|
import { take, takeUntil, Subscription, fromEvent, tap } from 'rxjs';
|
|
9
8
|
import { cva } from 'class-variance-authority';
|
|
10
9
|
import { twMerge } from 'tailwind-merge';
|
|
11
10
|
|
|
12
|
-
const
|
|
13
|
-
flex items-center justify-center
|
|
14
|
-
|
|
15
|
-
shadow-
|
|
11
|
+
const tooltipBaseThemeVariants = cva(`
|
|
12
|
+
relative z-1 flex items-center justify-center
|
|
13
|
+
${themeOverlaySurfaceClasses} text-foreground
|
|
14
|
+
border border-border shadow-(--shadow-overlay)
|
|
16
15
|
`, {
|
|
17
16
|
variants: {
|
|
18
17
|
rounded: {
|
|
@@ -24,13 +23,11 @@ const tooltipBaseVariants = cva(`
|
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
});
|
|
27
|
-
const
|
|
28
|
-
absolute
|
|
26
|
+
const tooltipArrowThemeVariants = cva(`
|
|
27
|
+
absolute z-0 h-3 w-3 rotate-45 transform-center box-border
|
|
29
28
|
pointer-events-none
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border border-border
|
|
29
|
+
${themeOverlaySurfaceClasses}
|
|
30
|
+
border border-border shadow-(--shadow-overlay)
|
|
34
31
|
|
|
35
32
|
data-[position="top"]:-bottom-1.5
|
|
36
33
|
data-[position="top"]:border-t-0
|
|
@@ -53,23 +50,6 @@ const tooltipArrowVariants = cva(`
|
|
|
53
50
|
data-[position="right"]:[clip-path:inset(1px_1px_0_0)]
|
|
54
51
|
`);
|
|
55
52
|
|
|
56
|
-
const tooltipBaseThemeVariants = (theme) => {
|
|
57
|
-
switch (theme) {
|
|
58
|
-
case "mona":
|
|
59
|
-
return tooltipBaseVariants;
|
|
60
|
-
default:
|
|
61
|
-
return tooltipBaseVariants;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const tooltipArrowThemeVariants = (theme) => {
|
|
65
|
-
switch (theme) {
|
|
66
|
-
case "mona":
|
|
67
|
-
return tooltipArrowVariants;
|
|
68
|
-
default:
|
|
69
|
-
return tooltipArrowVariants;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
53
|
/**
|
|
74
54
|
* Derives the tooltip arrow position from a ConnectionPositionPair.
|
|
75
55
|
* This function determines where the arrow should be positioned based on
|
|
@@ -143,7 +123,6 @@ class TooltipComponent {
|
|
|
143
123
|
#document;
|
|
144
124
|
#popupService;
|
|
145
125
|
#renderer;
|
|
146
|
-
#themeService;
|
|
147
126
|
#currentAnchor;
|
|
148
127
|
#eventSubscription;
|
|
149
128
|
#hideTimeoutId;
|
|
@@ -155,7 +134,6 @@ class TooltipComponent {
|
|
|
155
134
|
this.#document = inject(DOCUMENT);
|
|
156
135
|
this.#popupService = inject(PopupService);
|
|
157
136
|
this.#renderer = inject(Renderer2);
|
|
158
|
-
this.#themeService = inject(ThemeService);
|
|
159
137
|
this.#currentAnchor = null;
|
|
160
138
|
this.#eventSubscription = null;
|
|
161
139
|
this.#hideTimeoutId = null;
|
|
@@ -163,14 +141,12 @@ class TooltipComponent {
|
|
|
163
141
|
this.#popupRef = null;
|
|
164
142
|
this.#showTimeoutId = null;
|
|
165
143
|
this.arrowClasses = computed(() => {
|
|
166
|
-
|
|
167
|
-
return tooltipArrowThemeVariants(theme)();
|
|
144
|
+
return tooltipArrowThemeVariants();
|
|
168
145
|
}, /* @ts-ignore */
|
|
169
146
|
...(ngDevMode ? [{ debugName: "arrowClasses" }] : /* istanbul ignore next */ []));
|
|
170
147
|
this.baseClasses = computed(() => {
|
|
171
|
-
const theme = this.#themeService.theme();
|
|
172
148
|
const rounded = this.rounded();
|
|
173
|
-
return tooltipBaseThemeVariants(
|
|
149
|
+
return tooltipBaseThemeVariants({ rounded });
|
|
174
150
|
}, /* @ts-ignore */
|
|
175
151
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
176
152
|
this.currentArrowPosition = linkedSignal(() => this.position(), /* @ts-ignore */
|
|
@@ -635,17 +611,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
635
611
|
}], ctorParameters: () => [], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], hideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideDelay", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipRounded", required: false }] }], showDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDelay", required: false }] }], hidden: [{ type: i0.Output, args: ["hidden"] }], shown: [{ type: i0.Output, args: ["shown"] }] } });
|
|
636
612
|
class TooltipTemplateComponent {
|
|
637
613
|
constructor() {
|
|
638
|
-
this.#themeService = inject(ThemeService);
|
|
639
614
|
this.arrowClasses = computed(() => {
|
|
640
|
-
|
|
641
|
-
return tooltipArrowThemeVariants(theme)();
|
|
615
|
+
return tooltipArrowThemeVariants();
|
|
642
616
|
}, /* @ts-ignore */
|
|
643
617
|
...(ngDevMode ? [{ debugName: "arrowClasses" }] : /* istanbul ignore next */ []));
|
|
644
618
|
this.baseClasses = computed(() => {
|
|
645
|
-
const theme = this.#themeService.theme();
|
|
646
619
|
const rounded = this.rounded();
|
|
647
620
|
const userClasses = `p-2`;
|
|
648
|
-
const variants = tooltipBaseThemeVariants(
|
|
621
|
+
const variants = tooltipBaseThemeVariants({ rounded });
|
|
649
622
|
return twMerge(variants, userClasses);
|
|
650
623
|
}, /* @ts-ignore */
|
|
651
624
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -674,7 +647,6 @@ class TooltipTemplateComponent {
|
|
|
674
647
|
this.templateRef = viewChild.required(TemplateRef, /* @ts-ignore */
|
|
675
648
|
...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
676
649
|
}
|
|
677
|
-
#themeService;
|
|
678
650
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TooltipTemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
679
651
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: TooltipTemplateComponent, isStandalone: true, selector: "ng-component", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, tooltipId: { classPropertyName: "tooltipId", publicName: "tooltipId", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
680
652
|
<ng-template>
|
|
@@ -2,14 +2,13 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Directive, inject, DestroyRef, DOCUMENT, ElementRef, NgZone, input, afterNextRender, Pipe, ApplicationRef, Injector, signal, ViewContainerRef, computed, viewChild, TemplateRef, createComponent, Component, forwardRef, Injectable, contentChild, output, model, effect, untracked } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { fromEvent, Subject, asapScheduler, map, take } from 'rxjs';
|
|
5
|
-
import { createElementControlId, focusElement, setWindowStyles } from '@nanahoshi/mona-ui/internal';
|
|
5
|
+
import { themeOverlaySurfaceClasses, createElementControlId, focusElement, setWindowStyles } from '@nanahoshi/mona-ui/internal';
|
|
6
6
|
import { PopupDataInjectionToken, PopupCloseEvent, PopupCloseSource, PopupService } from '@nanahoshi/mona-ui/popup';
|
|
7
7
|
import * as i1 from '@angular/cdk/a11y';
|
|
8
8
|
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
9
9
|
import { NgTemplateOutlet } from '@angular/common';
|
|
10
10
|
import { LucideMinimize, LucideMaximize, LucideMinus, LucideDynamicIcon, LucideX } from '@lucide/angular';
|
|
11
11
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
12
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
13
12
|
import { cva } from 'class-variance-authority';
|
|
14
13
|
|
|
15
14
|
class WindowActionTemplateDirective {
|
|
@@ -432,9 +431,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
432
431
|
}]
|
|
433
432
|
}], ctorParameters: () => [], propDecorators: { direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: true }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], windowRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "windowRef", required: true }] }] } });
|
|
434
433
|
|
|
435
|
-
const
|
|
436
|
-
flex
|
|
437
|
-
|
|
434
|
+
const windowBaseThemeVariants = cva(`
|
|
435
|
+
flex h-full w-full flex-col
|
|
436
|
+
${themeOverlaySurfaceClasses} text-foreground
|
|
438
437
|
`, {
|
|
439
438
|
variants: {
|
|
440
439
|
rounded: {
|
|
@@ -448,11 +447,10 @@ const windowBaseVariants = cva(`
|
|
|
448
447
|
rounded: "medium"
|
|
449
448
|
}
|
|
450
449
|
});
|
|
451
|
-
const
|
|
452
|
-
flex flex-col
|
|
453
|
-
relative w-full h-full
|
|
450
|
+
const windowContentContainerThemeVariants = cva(`
|
|
451
|
+
relative flex h-full w-full flex-col
|
|
454
452
|
border border-border
|
|
455
|
-
shadow-
|
|
453
|
+
shadow-(--shadow-overlay)
|
|
456
454
|
`, {
|
|
457
455
|
variants: {
|
|
458
456
|
rounded: {
|
|
@@ -463,10 +461,11 @@ const windowContentContainerVariants = cva(`
|
|
|
463
461
|
}
|
|
464
462
|
}
|
|
465
463
|
});
|
|
466
|
-
const
|
|
464
|
+
const windowContentThemeVariants = cva(`
|
|
467
465
|
flex-1 overflow-auto
|
|
466
|
+
[scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
|
|
468
467
|
`);
|
|
469
|
-
const
|
|
468
|
+
const windowResizerThemeVariants = cva(`
|
|
470
469
|
absolute flex
|
|
471
470
|
`, {
|
|
472
471
|
variants: {
|
|
@@ -482,17 +481,17 @@ const windowResizerVariants = cva(`
|
|
|
482
481
|
}
|
|
483
482
|
}
|
|
484
483
|
});
|
|
485
|
-
const
|
|
486
|
-
flex items-center
|
|
484
|
+
const windowTitleBarActionThemeVariants = cva(`
|
|
485
|
+
flex items-center justify-evenly
|
|
487
486
|
`);
|
|
488
|
-
const
|
|
487
|
+
const windowTitleBarThemeVariants = cva(`
|
|
489
488
|
flex items-center justify-start
|
|
490
|
-
px-2 py-1 text-sm
|
|
491
|
-
border-b border-border
|
|
489
|
+
overflow-hidden px-2 py-1 text-sm
|
|
490
|
+
border-b border-border-subtle
|
|
492
491
|
`, {
|
|
493
492
|
variants: {
|
|
494
493
|
look: {
|
|
495
|
-
default: "bg-
|
|
494
|
+
default: "bg-surface-muted text-foreground",
|
|
496
495
|
primary: "bg-primary text-primary-foreground"
|
|
497
496
|
},
|
|
498
497
|
rounded: {
|
|
@@ -503,14 +502,12 @@ const windowTitleBarVariants = cva(`
|
|
|
503
502
|
}
|
|
504
503
|
}
|
|
505
504
|
});
|
|
506
|
-
const
|
|
507
|
-
flex items-center
|
|
508
|
-
|
|
509
|
-
overflow-hidden text-ellipsis
|
|
505
|
+
const windowTitleContainerThemeVariants = cva(`
|
|
506
|
+
flex h-full flex-1 items-center overflow-hidden
|
|
507
|
+
cursor-default select-none text-ellipsis
|
|
510
508
|
`);
|
|
511
|
-
const
|
|
512
|
-
font-semibold
|
|
513
|
-
overflow-hidden text-ellipsis whitespace-nowrap
|
|
509
|
+
const windowTitleThemeVariants = cva(`
|
|
510
|
+
overflow-hidden text-ellipsis whitespace-nowrap font-semibold
|
|
514
511
|
`, {
|
|
515
512
|
variants: {
|
|
516
513
|
look: {
|
|
@@ -520,79 +517,12 @@ const windowTitleVariants = cva(`
|
|
|
520
517
|
}
|
|
521
518
|
});
|
|
522
519
|
|
|
523
|
-
const windowBaseThemeVariants = (theme) => {
|
|
524
|
-
switch (theme) {
|
|
525
|
-
case "mona":
|
|
526
|
-
return windowBaseVariants;
|
|
527
|
-
default:
|
|
528
|
-
return windowBaseVariants;
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
const windowContentContainerThemeVariants = (theme) => {
|
|
532
|
-
switch (theme) {
|
|
533
|
-
case "mona":
|
|
534
|
-
return windowContentContainerVariants;
|
|
535
|
-
default:
|
|
536
|
-
return windowContentContainerVariants;
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
const windowContentThemeVariants = (theme) => {
|
|
540
|
-
switch (theme) {
|
|
541
|
-
case "mona":
|
|
542
|
-
return windowContentVariants;
|
|
543
|
-
default:
|
|
544
|
-
return windowContentVariants;
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
const windowResizerThemeVariants = (theme) => {
|
|
548
|
-
switch (theme) {
|
|
549
|
-
case "mona":
|
|
550
|
-
return windowResizerVariants;
|
|
551
|
-
default:
|
|
552
|
-
return windowResizerVariants;
|
|
553
|
-
}
|
|
554
|
-
};
|
|
555
|
-
const windowTitleBarActionThemeVariants = (theme) => {
|
|
556
|
-
switch (theme) {
|
|
557
|
-
case "mona":
|
|
558
|
-
return windowTitleBarActionVariants;
|
|
559
|
-
default:
|
|
560
|
-
return windowTitleBarActionVariants;
|
|
561
|
-
}
|
|
562
|
-
};
|
|
563
|
-
const windowTitleBarThemeVariants = (theme) => {
|
|
564
|
-
switch (theme) {
|
|
565
|
-
case "mona":
|
|
566
|
-
return windowTitleBarVariants;
|
|
567
|
-
default:
|
|
568
|
-
return windowTitleBarVariants;
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
const windowTitleContainerThemeVariants = (theme) => {
|
|
572
|
-
switch (theme) {
|
|
573
|
-
case "mona":
|
|
574
|
-
return windowTitleContainerVariants;
|
|
575
|
-
default:
|
|
576
|
-
return windowTitleContainerVariants;
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
const windowTitleThemeVariants = (theme) => {
|
|
580
|
-
switch (theme) {
|
|
581
|
-
case "mona":
|
|
582
|
-
return windowTitleVariants;
|
|
583
|
-
default:
|
|
584
|
-
return windowTitleVariants;
|
|
585
|
-
}
|
|
586
|
-
};
|
|
587
|
-
|
|
588
520
|
class ResizePositionPipe {
|
|
589
|
-
#themeService = inject(ThemeService);
|
|
590
521
|
transform(position) {
|
|
591
522
|
if (!position) {
|
|
592
523
|
return null;
|
|
593
524
|
}
|
|
594
|
-
|
|
595
|
-
return windowResizerThemeVariants(theme)({ position });
|
|
525
|
+
return windowResizerThemeVariants({ position });
|
|
596
526
|
}
|
|
597
527
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ResizePositionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
598
528
|
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: ResizePositionPipe, isStandalone: true, name: "monaResizePosition" }); }
|
|
@@ -611,7 +541,6 @@ class WindowContentComponent {
|
|
|
611
541
|
#injector;
|
|
612
542
|
#sizeBeforeMaximize;
|
|
613
543
|
#sizeBeforeMinimize;
|
|
614
|
-
#themeService;
|
|
615
544
|
#trapFocus;
|
|
616
545
|
#viewContainerRef;
|
|
617
546
|
constructor() {
|
|
@@ -623,25 +552,21 @@ class WindowContentComponent {
|
|
|
623
552
|
...(ngDevMode ? [{ debugName: "#sizeBeforeMaximize" }] : /* istanbul ignore next */ []));
|
|
624
553
|
this.#sizeBeforeMinimize = signal(0, /* @ts-ignore */
|
|
625
554
|
...(ngDevMode ? [{ debugName: "#sizeBeforeMinimize" }] : /* istanbul ignore next */ []));
|
|
626
|
-
this.#themeService = inject(ThemeService);
|
|
627
555
|
this.#trapFocus = inject(CdkTrapFocus);
|
|
628
556
|
this.#viewContainerRef = inject(ViewContainerRef);
|
|
629
557
|
this.baseClass = computed(() => {
|
|
630
|
-
const theme = this.#themeService.theme();
|
|
631
558
|
const rounded = this.windowData.rounded;
|
|
632
|
-
return windowBaseThemeVariants(
|
|
559
|
+
return windowBaseThemeVariants({ rounded });
|
|
633
560
|
}, /* @ts-ignore */
|
|
634
561
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
635
562
|
this.componentAnchor = viewChild.required("componentAnchor", { ...(ngDevMode ? { debugName: "componentAnchor" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
636
563
|
this.contentClass = computed(() => {
|
|
637
|
-
|
|
638
|
-
return windowContentThemeVariants(theme)();
|
|
564
|
+
return windowContentThemeVariants();
|
|
639
565
|
}, /* @ts-ignore */
|
|
640
566
|
...(ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []));
|
|
641
567
|
this.contentContainerClass = computed(() => {
|
|
642
|
-
const theme = this.#themeService.theme();
|
|
643
568
|
const rounded = this.windowData.rounded;
|
|
644
|
-
return windowContentContainerThemeVariants(
|
|
569
|
+
return windowContentContainerThemeVariants({ rounded });
|
|
645
570
|
}, /* @ts-ignore */
|
|
646
571
|
...(ngDevMode ? [{ debugName: "contentContainerClass" }] : /* istanbul ignore next */ []));
|
|
647
572
|
this.contentTemplate = computed(() => {
|
|
@@ -661,26 +586,22 @@ class WindowContentComponent {
|
|
|
661
586
|
this.minimized = signal(false, /* @ts-ignore */
|
|
662
587
|
...(ngDevMode ? [{ debugName: "minimized" }] : /* istanbul ignore next */ []));
|
|
663
588
|
this.titleBarActionClass = computed(() => {
|
|
664
|
-
|
|
665
|
-
return windowTitleBarActionThemeVariants(theme)();
|
|
589
|
+
return windowTitleBarActionThemeVariants();
|
|
666
590
|
}, /* @ts-ignore */
|
|
667
591
|
...(ngDevMode ? [{ debugName: "titleBarActionClass" }] : /* istanbul ignore next */ []));
|
|
668
592
|
this.titleBarClass = computed(() => {
|
|
669
|
-
const theme = this.#themeService.theme();
|
|
670
593
|
const look = this.windowData.look;
|
|
671
594
|
const rounded = this.windowData.rounded;
|
|
672
|
-
return windowTitleBarThemeVariants(
|
|
595
|
+
return windowTitleBarThemeVariants({ look, rounded });
|
|
673
596
|
}, /* @ts-ignore */
|
|
674
597
|
...(ngDevMode ? [{ debugName: "titleBarClass" }] : /* istanbul ignore next */ []));
|
|
675
598
|
this.titleClass = computed(() => {
|
|
676
|
-
const theme = this.#themeService.theme();
|
|
677
599
|
const look = this.windowData.look;
|
|
678
|
-
return windowTitleThemeVariants(
|
|
600
|
+
return windowTitleThemeVariants({ look });
|
|
679
601
|
}, /* @ts-ignore */
|
|
680
602
|
...(ngDevMode ? [{ debugName: "titleClass" }] : /* istanbul ignore next */ []));
|
|
681
603
|
this.titleContainerClass = computed(() => {
|
|
682
|
-
|
|
683
|
-
return windowTitleContainerThemeVariants(theme)();
|
|
604
|
+
return windowTitleContainerThemeVariants();
|
|
684
605
|
}, /* @ts-ignore */
|
|
685
606
|
...(ngDevMode ? [{ debugName: "titleContainerClass" }] : /* istanbul ignore next */ []));
|
|
686
607
|
this.windowData = inject(PopupDataInjectionToken);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanahoshi/mona-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A very light Angular UI framework",
|
|
5
5
|
"author": "Nanahoshi",
|
|
6
6
|
"repository": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"@lucide/angular": "^1.21.0",
|
|
45
45
|
"@mirei/ts-collections": "^17.5.6",
|
|
46
46
|
"class-variance-authority": "^0.7.1",
|
|
47
|
+
"culori": "^4.0.2",
|
|
47
48
|
"luxon": "^3.7.2",
|
|
48
49
|
"remixicon": "^4.9.1",
|
|
49
50
|
"tailwind-merge": "^3.6.0",
|