@nanahoshi/mona-ui 0.1.1 → 0.2.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/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 +38 -53
- 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 +53 -149
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +48 -95
- 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 +26 -77
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +16 -38
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +41 -46
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +32 -52
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +9 -12
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +40 -27
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +51 -51
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -153
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +32 -53
- 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 +26 -56
- 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 +35 -62
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -108
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +37 -63
- 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 +47 -92
- 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 -58
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -107
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +22 -30
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +40 -61
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +41 -27
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +35 -99
- 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 +6 -9
- 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 +8 -11
- 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 +4 -6
- 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 +10 -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
|
@@ -4,10 +4,10 @@ import { Directive, inject, DestroyRef, ElementRef, computed, contentChild, Temp
|
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { LucideCircleX } from '@lucide/angular';
|
|
6
6
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
7
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
8
7
|
import { fromEvent, filter } from 'rxjs';
|
|
9
8
|
import { twMerge } from 'tailwind-merge';
|
|
10
9
|
import { cva } from 'class-variance-authority';
|
|
10
|
+
import { themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @description Apply to an `<ng-template>` directly inside `<mona-chip>` to render prefix content
|
|
@@ -24,11 +24,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
24
24
|
}]
|
|
25
25
|
}] });
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
inline-flex items-center justify-between gap-1.5
|
|
29
|
-
text-xs font-medium
|
|
30
|
-
outline-none
|
|
31
|
-
transition-colors duration-
|
|
27
|
+
const chipThemeVariants = cva(`
|
|
28
|
+
inline-flex shrink-0 items-center justify-between gap-1.5
|
|
29
|
+
cursor-pointer text-xs font-medium
|
|
30
|
+
shadow-(--shadow-control) outline-none
|
|
31
|
+
transition-colors duration-(--mona-motion-fast) ease-in-out
|
|
32
32
|
`, {
|
|
33
33
|
variants: {
|
|
34
34
|
disabled: {
|
|
@@ -37,58 +37,60 @@ const chipVariants = cva(`
|
|
|
37
37
|
},
|
|
38
38
|
look: {
|
|
39
39
|
default: `
|
|
40
|
-
|
|
40
|
+
${themeRaisedSurfaceClasses} text-foreground
|
|
41
41
|
border border-border
|
|
42
|
-
hover:bg-hover hover:text-
|
|
43
|
-
active:bg-active active:text-
|
|
44
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
42
|
+
hover:bg-hover hover:text-foreground
|
|
43
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
44
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
45
45
|
`,
|
|
46
46
|
primary: `
|
|
47
47
|
bg-primary text-primary-foreground
|
|
48
48
|
hover:bg-primary-hover hover:text-primary-foreground
|
|
49
49
|
active:bg-primary-active active:text-primary-foreground
|
|
50
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
50
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
51
51
|
`,
|
|
52
52
|
success: `
|
|
53
53
|
bg-success text-success-foreground
|
|
54
54
|
hover:bg-success-hover hover:text-success-foreground
|
|
55
55
|
active:bg-success-active active:text-success-foreground
|
|
56
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
56
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
57
57
|
`,
|
|
58
58
|
error: `
|
|
59
59
|
bg-error text-error-foreground
|
|
60
60
|
hover:bg-error-hover hover:text-error-foreground
|
|
61
61
|
active:bg-error-active active:text-error-foreground
|
|
62
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
62
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
63
63
|
`,
|
|
64
64
|
warning: `
|
|
65
65
|
bg-warning text-warning-foreground
|
|
66
66
|
hover:bg-warning-hover hover:text-warning-foreground
|
|
67
67
|
active:bg-warning-active active:text-warning-foreground
|
|
68
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
68
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
69
69
|
`,
|
|
70
70
|
info: `
|
|
71
71
|
bg-info text-info-foreground
|
|
72
72
|
hover:bg-info-hover hover:text-info-foreground
|
|
73
73
|
active:bg-info-active active:text-info-foreground
|
|
74
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
74
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
75
75
|
`,
|
|
76
76
|
outline: `
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
bg-transparent text-foreground
|
|
78
|
+
border border-input-border
|
|
79
|
+
hover:bg-hover hover:text-foreground
|
|
80
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
81
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
81
82
|
`,
|
|
82
83
|
secondary: `
|
|
83
84
|
bg-secondary text-secondary-foreground
|
|
84
85
|
hover:bg-secondary-hover hover:text-secondary-foreground
|
|
85
86
|
active:bg-secondary-active active:text-secondary-foreground
|
|
86
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
87
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
87
88
|
`,
|
|
88
89
|
ghost: `
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
bg-transparent text-foreground shadow-none
|
|
91
|
+
hover:bg-hover hover:text-foreground
|
|
92
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
93
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
92
94
|
`
|
|
93
95
|
},
|
|
94
96
|
rounded: {
|
|
@@ -125,9 +127,9 @@ const chipVariants = cva(`
|
|
|
125
127
|
look: "default",
|
|
126
128
|
selected: true,
|
|
127
129
|
class: `
|
|
128
|
-
bg-selected text-foreground
|
|
129
|
-
hover:bg-selected
|
|
130
|
-
active:bg-selected
|
|
130
|
+
bg-(--color-selected) text-(--color-selected-foreground)
|
|
131
|
+
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
132
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
131
133
|
`
|
|
132
134
|
},
|
|
133
135
|
{
|
|
@@ -188,18 +190,18 @@ const chipVariants = cva(`
|
|
|
188
190
|
look: "outline",
|
|
189
191
|
selected: true,
|
|
190
192
|
class: `
|
|
191
|
-
bg-
|
|
192
|
-
hover:bg-
|
|
193
|
-
active:bg-
|
|
193
|
+
bg-(--color-selected) text-(--color-selected-foreground)
|
|
194
|
+
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
195
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
194
196
|
`
|
|
195
197
|
},
|
|
196
198
|
{
|
|
197
199
|
look: "ghost",
|
|
198
200
|
selected: true,
|
|
199
201
|
class: `
|
|
200
|
-
bg-
|
|
201
|
-
hover:bg-
|
|
202
|
-
active:bg-
|
|
202
|
+
bg-(--color-selected) text-(--color-selected-foreground)
|
|
203
|
+
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
204
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
203
205
|
`
|
|
204
206
|
}
|
|
205
207
|
],
|
|
@@ -208,23 +210,12 @@ const chipVariants = cva(`
|
|
|
208
210
|
}
|
|
209
211
|
});
|
|
210
212
|
|
|
211
|
-
const chipThemeVariants = (theme) => {
|
|
212
|
-
switch (theme) {
|
|
213
|
-
case "mona":
|
|
214
|
-
return chipVariants;
|
|
215
|
-
default:
|
|
216
|
-
return chipVariants;
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
|
|
220
213
|
class ChipComponent {
|
|
221
214
|
#destroyRef;
|
|
222
215
|
#elementRef;
|
|
223
|
-
#themeService;
|
|
224
216
|
constructor() {
|
|
225
217
|
this.#destroyRef = inject(DestroyRef);
|
|
226
218
|
this.#elementRef = inject(ElementRef);
|
|
227
|
-
this.#themeService = inject(ThemeService);
|
|
228
219
|
this.ariaChecked = computed(() => {
|
|
229
220
|
if (!this.toggleable()) {
|
|
230
221
|
return undefined;
|
|
@@ -233,14 +224,13 @@ class ChipComponent {
|
|
|
233
224
|
}, /* @ts-ignore */
|
|
234
225
|
...(ngDevMode ? [{ debugName: "ariaChecked" }] : /* istanbul ignore next */ []));
|
|
235
226
|
this.baseClass = computed(() => {
|
|
236
|
-
const theme = this.#themeService.theme();
|
|
237
227
|
const disabled = this.disabled();
|
|
238
228
|
const look = this.look();
|
|
239
229
|
const rounded = this.rounded();
|
|
240
230
|
const size = this.size();
|
|
241
231
|
const selected = this.selected();
|
|
242
232
|
const userClass = this.userClass();
|
|
243
|
-
const variantClasses = chipThemeVariants(
|
|
233
|
+
const variantClasses = chipThemeVariants({ disabled, look, rounded, size, selected });
|
|
244
234
|
return twMerge(variantClasses, userClass);
|
|
245
235
|
}, /* @ts-ignore */
|
|
246
236
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
@@ -2,7 +2,6 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, TemplateRef, Directive, computed, contentChild, input, Component } from '@angular/core';
|
|
4
4
|
import { getPercentage } from '@nanahoshi/mona-ui/common';
|
|
5
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
6
5
|
import { twMerge } from 'tailwind-merge';
|
|
7
6
|
import { cva } from 'class-variance-authority';
|
|
8
7
|
|
|
@@ -20,42 +19,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
20
19
|
}]
|
|
21
20
|
}] });
|
|
22
21
|
|
|
23
|
-
const
|
|
24
|
-
flex items-center justify-center
|
|
25
|
-
|
|
26
|
-
[&_svg]:
|
|
27
|
-
[&_svg]:
|
|
28
|
-
[&_svg]:left-1/2
|
|
22
|
+
const circularProgressBarBaseThemeVariants = cva(`
|
|
23
|
+
relative flex items-center justify-center select-none
|
|
24
|
+
text-foreground
|
|
25
|
+
[&_svg]:absolute [&_svg]:top-1/2 [&_svg]:left-1/2
|
|
26
|
+
[&_svg]:h-full [&_svg]:w-full
|
|
29
27
|
[&_svg]:-translate-x-1/2 [&_svg]:-translate-y-1/2
|
|
30
28
|
[&_svg_circle]:origin-center
|
|
31
29
|
[&_svg_circle]:-rotate-90
|
|
32
|
-
[&_svg_circle]:transition-[stroke-dashoffset,stroke] duration-
|
|
33
|
-
[&_svg_circle]:data-[stroke-trail='true']:stroke-
|
|
30
|
+
[&_svg_circle]:transition-[stroke-dashoffset,stroke] duration-(--mona-motion-fast) ease-in
|
|
31
|
+
[&_svg_circle]:data-[stroke-trail='true']:stroke-surface-muted
|
|
34
32
|
`, {
|
|
35
33
|
variants: {
|
|
36
34
|
disabled: {
|
|
37
|
-
true: "
|
|
35
|
+
true: "pointer-events-none cursor-not-allowed opacity-50",
|
|
38
36
|
false: ""
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
});
|
|
42
40
|
|
|
43
|
-
const circularProgressBarBaseThemeVariants = (theme) => {
|
|
44
|
-
switch (theme) {
|
|
45
|
-
case "mona":
|
|
46
|
-
return circularProgressBarBaseVariants;
|
|
47
|
-
default:
|
|
48
|
-
return circularProgressBarBaseVariants;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
41
|
class CircularProgressBarComponent {
|
|
53
42
|
constructor() {
|
|
54
|
-
this.#themeService = inject(ThemeService);
|
|
55
43
|
this.baseClasses = computed(() => {
|
|
56
|
-
const theme = this.#themeService.theme();
|
|
57
44
|
const disabled = this.disabled();
|
|
58
|
-
const classes = circularProgressBarBaseThemeVariants(
|
|
45
|
+
const classes = circularProgressBarBaseThemeVariants({ disabled });
|
|
59
46
|
const animateClass = this.animate() ? "" : "[&_svg_circle]:transition-none";
|
|
60
47
|
return twMerge(classes, this.userClass(), animateClass);
|
|
61
48
|
}, /* @ts-ignore */
|
|
@@ -166,7 +153,6 @@ class CircularProgressBarComponent {
|
|
|
166
153
|
this.value = input(0, /* @ts-ignore */
|
|
167
154
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
168
155
|
}
|
|
169
|
-
#themeService;
|
|
170
156
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CircularProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
171
157
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CircularProgressBarComponent, isStandalone: true, selector: "mona-circular-progress-bar", inputs: { animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaValueText: { classPropertyName: "ariaValueText", publicName: "aria-valuetext", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar" }, properties: { "class": "baseClasses()", "attr.aria-busy": "indeterminate() || null", "attr.aria-label": "ariaLabel() || null", "attr.aria-valuemin": "indeterminate() ? null : min()", "attr.aria-valuemax": "indeterminate() ? null : max()", "attr.aria-valuenow": "indeterminate() ? null : value()", "attr.aria-valuetext": "ariaValueText() || null", "attr.aria-disabled": "disabled() || null", "attr.data-disabled": "disabled() || null", "style.width": "pixelSize()", "style.height": "pixelSize()" } }, queries: [{ propertyName: "labelTemplate", first: true, predicate: CircularProgressBarLabelTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<svg>\n <circle\n [attr.cx]=\"center().x\"\n [attr.cy]=\"center().y\"\n [attr.r]=\"radius()\"\n [attr.data-stroke-trail]=\"true\"\n [attr.stroke-dasharray]=\"circumference()\"\n [attr.stroke-width]=\"thickness()\"\n fill=\"transparent\" />\n <circle\n [attr.cx]=\"center().x\"\n [attr.cy]=\"center().y\"\n [attr.r]=\"radius()\"\n [attr.stroke]=\"strokeColor()\"\n [attr.stroke-dasharray]=\"circumference()\"\n [attr.stroke-dashoffset]=\"strokeDashOffset()\"\n [attr.stroke-width]=\"thickness()\"\n fill=\"transparent\"\n [class.indeterminate]=\"indeterminate()\" />\n</svg>\n@if (!indeterminate()) {\n <div class=\"mona-circular-progress-bar-label\">\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), min: min(), max: max(), percent: progress() }\">\n </ng-container>\n } @else {\n {{ progress() }}\n }\n </div>\n}\n", styles: [".indeterminate{animation:rotate 2s linear infinite}@keyframes rotate{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
172
158
|
}
|
|
@@ -10,28 +10,27 @@ import { DropdownButtonComponent, DropdownButtonItemComponent } from '@nanahoshi
|
|
|
10
10
|
import { NumericTextBoxComponent, NumericTextBoxPrefixTemplateDirective } from '@nanahoshi/mona-ui/numeric-text-box';
|
|
11
11
|
import { SliderComponent } from '@nanahoshi/mona-ui/slider';
|
|
12
12
|
import { TextBoxComponent, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective } from '@nanahoshi/mona-ui/text-box';
|
|
13
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
14
13
|
import { Subject, fromEvent, switchMap, takeUntil, distinctUntilChanged } from 'rxjs';
|
|
15
14
|
import { cva } from 'class-variance-authority';
|
|
16
15
|
|
|
17
|
-
const
|
|
16
|
+
const colorGradientBaseThemeVariants = cva(`
|
|
18
17
|
flex flex-col min-w-64
|
|
19
|
-
|
|
18
|
+
gap-2 p-2
|
|
20
19
|
select-none
|
|
21
20
|
|
|
21
|
+
data-[disabled='true']:pointer-events-none
|
|
22
22
|
data-[disabled='true']:cursor-not-allowed
|
|
23
23
|
data-[disabled='true']:opacity-50
|
|
24
|
-
data-[disabled='true']:pointer-events-none
|
|
25
24
|
|
|
26
25
|
data-[invalid='true']:border
|
|
27
26
|
data-[invalid='true']:border-error
|
|
28
27
|
data-[invalid='true']:ring-1
|
|
29
|
-
data-[invalid='true']:ring-error
|
|
28
|
+
data-[invalid='true']:ring-error/35
|
|
30
29
|
`);
|
|
31
|
-
const
|
|
32
|
-
relative w-full
|
|
30
|
+
const colorGradientHsvRectangleThemeVariants = cva(`
|
|
31
|
+
relative h-40 w-full
|
|
33
32
|
bg-[linear-gradient(to_bottom,rgba(0,0,0,0),black),linear-gradient(to_right,white,rgba(255,255,255,0))]
|
|
34
|
-
border border-border
|
|
33
|
+
border border-border-subtle
|
|
35
34
|
`, {
|
|
36
35
|
variants: {
|
|
37
36
|
rounded: {
|
|
@@ -43,17 +42,15 @@ const colorGradientHsvRectangleVariants = cva(`
|
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
});
|
|
46
|
-
const
|
|
45
|
+
const colorGradientHsvRectangleHandleThemeVariants = cva(`
|
|
47
46
|
absolute
|
|
48
|
-
|
|
47
|
+
h-3 w-3
|
|
49
48
|
cursor-pointer
|
|
50
|
-
|
|
51
|
-
outline outline-
|
|
52
|
-
shadow-md
|
|
49
|
+
bg-transparent
|
|
50
|
+
border-2 border-black/90 outline outline-white/90 shadow-sm
|
|
53
51
|
|
|
54
|
-
focus-visible:ring-2
|
|
55
|
-
focus-visible:ring-
|
|
56
|
-
focus-visible:ring-offset-2
|
|
52
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
53
|
+
focus-visible:ring-offset-2 focus-visible:ring-offset-surface
|
|
57
54
|
`, {
|
|
58
55
|
variants: {
|
|
59
56
|
rounded: {
|
|
@@ -65,9 +62,9 @@ const colorGradientHsvRectangleHandleVariants = cva(`
|
|
|
65
62
|
}
|
|
66
63
|
}
|
|
67
64
|
});
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
border border-border
|
|
65
|
+
const colorGradientPreviewThemeVariants = cva(`
|
|
66
|
+
flex h-10 w-10
|
|
67
|
+
border border-border-subtle
|
|
71
68
|
`, {
|
|
72
69
|
variants: {
|
|
73
70
|
rounded: {
|
|
@@ -79,59 +76,17 @@ const colorGradientPreviewVariants = cva(`
|
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
78
|
});
|
|
82
|
-
const
|
|
79
|
+
const colorGradientSliderHandleThemeVariants = cva(`
|
|
80
|
+
h-3 w-3
|
|
81
|
+
bg-transparent
|
|
83
82
|
border-3 border-white/90
|
|
84
83
|
outline outline-solid outline-black/90
|
|
85
|
-
bg-transparent
|
|
86
|
-
w-3 h-3
|
|
87
84
|
`);
|
|
88
85
|
|
|
89
|
-
const colorGradientBaseThemeVariants = (theme) => {
|
|
90
|
-
switch (theme) {
|
|
91
|
-
case "mona":
|
|
92
|
-
return colorGradientBaseVariants;
|
|
93
|
-
default:
|
|
94
|
-
return colorGradientBaseVariants;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const colorGradientHsvRectangleThemeVariants = (theme) => {
|
|
98
|
-
switch (theme) {
|
|
99
|
-
case "mona":
|
|
100
|
-
return colorGradientHsvRectangleVariants;
|
|
101
|
-
default:
|
|
102
|
-
return colorGradientHsvRectangleVariants;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const colorGradientHsvRectangleHandleThemeVariants = (theme) => {
|
|
106
|
-
switch (theme) {
|
|
107
|
-
case "mona":
|
|
108
|
-
return colorGradientHsvRectangleHandleVariants;
|
|
109
|
-
default:
|
|
110
|
-
return colorGradientHsvRectangleHandleVariants;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const colorGradientPreviewThemeVariants = (theme) => {
|
|
114
|
-
switch (theme) {
|
|
115
|
-
case "mona":
|
|
116
|
-
return colorGradientPreviewVariants;
|
|
117
|
-
default:
|
|
118
|
-
return colorGradientPreviewVariants;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
const colorGradientSliderHandleThemeVariants = (theme) => {
|
|
122
|
-
switch (theme) {
|
|
123
|
-
case "mona":
|
|
124
|
-
return colorGradientSliderHandleVariants;
|
|
125
|
-
default:
|
|
126
|
-
return colorGradientSliderHandleVariants;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
|
|
130
86
|
class ColorGradientComponent {
|
|
131
87
|
#clipboard;
|
|
132
88
|
#destroyRef;
|
|
133
89
|
#injector;
|
|
134
|
-
#themeService;
|
|
135
90
|
#valueChange$;
|
|
136
91
|
#viewReady;
|
|
137
92
|
#zone;
|
|
@@ -141,7 +96,6 @@ class ColorGradientComponent {
|
|
|
141
96
|
this.#clipboard = inject(Clipboard);
|
|
142
97
|
this.#destroyRef = inject(DestroyRef);
|
|
143
98
|
this.#injector = inject(Injector);
|
|
144
|
-
this.#themeService = inject(ThemeService);
|
|
145
99
|
this.#valueChange$ = new Subject();
|
|
146
100
|
this.#viewReady = signal(false, /* @ts-ignore */
|
|
147
101
|
...(ngDevMode ? [{ debugName: "#viewReady" }] : /* istanbul ignore next */ []));
|
|
@@ -161,8 +115,7 @@ class ColorGradientComponent {
|
|
|
161
115
|
}, /* @ts-ignore */
|
|
162
116
|
...(ngDevMode ? [{ debugName: "alphaSliderBackground" }] : /* istanbul ignore next */ []));
|
|
163
117
|
this.baseClasses = computed(() => {
|
|
164
|
-
|
|
165
|
-
return colorGradientBaseThemeVariants(theme)();
|
|
118
|
+
return colorGradientBaseThemeVariants();
|
|
166
119
|
}, /* @ts-ignore */
|
|
167
120
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
168
121
|
this.colorInputs = computed(() => {
|
|
@@ -184,9 +137,8 @@ class ColorGradientComponent {
|
|
|
184
137
|
this.colorMode = signal("rgb", /* @ts-ignore */
|
|
185
138
|
...(ngDevMode ? [{ debugName: "colorMode" }] : /* istanbul ignore next */ []));
|
|
186
139
|
this.colorPreviewClasses = computed(() => {
|
|
187
|
-
const theme = this.#themeService.theme();
|
|
188
140
|
const rounded = this.rounded();
|
|
189
|
-
return colorGradientPreviewThemeVariants(
|
|
141
|
+
return colorGradientPreviewThemeVariants({ rounded });
|
|
190
142
|
}, /* @ts-ignore */
|
|
191
143
|
...(ngDevMode ? [{ debugName: "colorPreviewClasses" }] : /* istanbul ignore next */ []));
|
|
192
144
|
this.colorPreviews = computed(() => [
|
|
@@ -234,15 +186,13 @@ class ColorGradientComponent {
|
|
|
234
186
|
}, /* @ts-ignore */
|
|
235
187
|
...(ngDevMode ? [{ debugName: "hsvRectangleBackground" }] : /* istanbul ignore next */ []));
|
|
236
188
|
this.hsvRectangleClasses = computed(() => {
|
|
237
|
-
const theme = this.#themeService.theme();
|
|
238
189
|
const rounded = this.rounded() === "full" ? "large" : this.rounded();
|
|
239
|
-
return colorGradientHsvRectangleThemeVariants(
|
|
190
|
+
return colorGradientHsvRectangleThemeVariants({ rounded });
|
|
240
191
|
}, /* @ts-ignore */
|
|
241
192
|
...(ngDevMode ? [{ debugName: "hsvRectangleClasses" }] : /* istanbul ignore next */ []));
|
|
242
193
|
this.hsvRectangleHandleClasses = computed(() => {
|
|
243
|
-
const theme = this.#themeService.theme();
|
|
244
194
|
const rounded = this.rounded();
|
|
245
|
-
return colorGradientHsvRectangleHandleThemeVariants(
|
|
195
|
+
return colorGradientHsvRectangleHandleThemeVariants({ rounded });
|
|
246
196
|
}, /* @ts-ignore */
|
|
247
197
|
...(ngDevMode ? [{ debugName: "hsvRectangleHandleClasses" }] : /* istanbul ignore next */ []));
|
|
248
198
|
this.hueValue$ = new Subject();
|
|
@@ -261,8 +211,7 @@ class ColorGradientComponent {
|
|
|
261
211
|
}, /* @ts-ignore */
|
|
262
212
|
...(ngDevMode ? [{ debugName: "selectedColor" }] : /* istanbul ignore next */ []));
|
|
263
213
|
this.sliderHandleClasses = computed(() => {
|
|
264
|
-
|
|
265
|
-
return colorGradientSliderHandleThemeVariants(theme)();
|
|
214
|
+
return colorGradientSliderHandleThemeVariants();
|
|
266
215
|
}, /* @ts-ignore */
|
|
267
216
|
...(ngDevMode ? [{ debugName: "sliderHandleClasses" }] : /* istanbul ignore next */ []));
|
|
268
217
|
this.sliderHeight = 10;
|
|
@@ -817,7 +766,7 @@ class ColorGradientComponent {
|
|
|
817
766
|
}
|
|
818
767
|
}
|
|
819
768
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ColorGradientComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
820
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ColorGradientComponent, isStandalone: true, selector: "mona-color-gradient", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, opacity: { classPropertyName: "opacity", publicName: "opacity", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showButtons: { classPropertyName: "showButtons", publicName: "showButtons", isSignal: true, isRequired: false, transformFunction: null }, showHexInput: { classPropertyName: "showHexInput", publicName: "showHexInput", isSignal: true, isRequired: false, transformFunction: null }, showColorInputs: { classPropertyName: "showColorInputs", publicName: "showColorInputs", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply", cancel: "cancel", touch: "touch", value: "valueChange" }, host: { properties: { "class": "baseClasses()", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.aria-invalid": "invalidState() ? 'true' : null" } }, viewQueries: [{ propertyName: "hsvHandle", first: true, predicate: ["hsvPointer"], descendants: true, isSignal: true }, { propertyName: "hsvRectangle", first: true, predicate: ["hsvRectangle"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"hsvRectangleClasses()\" [style.background-color]=\"hsvRectangleBackground()\" #hsvRectangle>\n <div\n [class]=\"hsvRectangleHandleClasses()\"\n [style.left.px]=\"hsvHandleLeft()\"\n [style.top.px]=\"hsvHandleTop()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-label]=\"'Color saturation and value'\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"hsv().s\"\n [attr.aria-valuetext]=\"'Saturation ' + hsv().s + '%, Value ' + hsv().v + '%'\"\n [attr.aria-disabled]=\"disabled() || null\"\n (keydown)=\"onHsvHandleKeyDown($event)\"\n (blur)=\"onHsvHandleBlur()\"\n #hsvPointer></div>\n</div>\n<div class=\"flex items-center gap-2\">\n <div class=\"flex flex-1 flex-col gap-1 mr-2\">\n <mona-slider\n [minValue]=\"0\"\n [maxValue]=\"360\"\n [trackBackground]=\"'linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)'\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"hsv().h ?? 0\"\n (valueChange)=\"hueValue$.next($event)\"\n (touch)=\"onSliderBlur()\"></mona-slider>\n @if (opacity()) {\n <mona-slider\n [minValue]=\"0\"\n [maxValue]=\"255\"\n [trackBackground]=\"alphaSliderBackground()\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"alpha()\"\n (valueChange)=\"onAlphaChange($event)\"\n (touch)=\"onSliderBlur()\"></mona-slider>\n }\n </div>\n @for (preview of colorPreviews(); track preview.type) {\n <div\n [class]=\"colorPreviewClasses()\"\n [class.cursor-pointer]=\"$index === 1\"\n [style.background-color]=\"preview.color\"\n [attr.title]=\"$index === 1 ? preview.title : null\"\n [attr.aria-label]=\"$index === 1 ? preview.title : null\"\n [attr.aria-hidden]=\"$index === 0 ? 'true' : null\"\n [attr.role]=\"$index === 1 ? 'button' : null\"\n [attr.tabindex]=\"$index === 1 ? 0 : null\"\n (click)=\"preview.onClick?.()\"\n (keydown)=\"onPreviousColorKeyDown($event, preview.onClick)\"></div>\n }\n <button monaButton look=\"ghost\" size=\"small\" aria-label=\"Clear color\" (click)=\"onClearClick()\">\n <i class=\"ri-blur-off-line\"></i>\n </button>\n</div>\n<div class=\"flex flex-col gap-2\">\n @if (showColorInputs()) {\n <div class=\"flex gap-2\">\n <div class=\"flex gap-1\">\n @for (input of colorInputs(); track input.key) {\n <mona-numeric-text-box\n [value]=\"input.value\"\n [minValue]=\"input.min\"\n [maxValue]=\"input.max\"\n [decimals]=\"0\"\n [spinners]=\"false\"\n [nullable]=\"false\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n class=\"w-18\"\n (valueChange)=\"input.change($event)\"\n (inputBlur)=\"onNumericInputBlur()\">\n <ng-template monaNumericTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: input.label }\"></ng-container>\n </ng-template>\n </mona-numeric-text-box>\n }\n </div>\n <div class=\"flex flex-1 items-center justify-end\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n size=\"small\"\n aria-label=\"Switch color mode\"\n (click)=\"onSwitchColorModeClick()\">\n <i class=\"ri-expand-up-down-line\"></i>\n </button>\n </div>\n </div>\n }\n @if (showHexInput()) {\n <mona-text-box\n [rounded]=\"rounded()\"\n [value]=\"hex()\"\n (valueChange)=\"onHexChange($event)\"\n (inputBlur)=\"onHexInputBlur()\"\n (inputFocus)=\"onHexInputFocus()\"\n class=\"w-full\">\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: 'HEX', classes: 'w-auto px-2' }\"></ng-container>\n </ng-template>\n <ng-template monaTextBoxSuffixTemplate>\n <mona-dropdown-button look=\"ghost\" aria-label=\"Copy color\" class=\"h-full\">\n <svg lucideCopy [size]=\"12\"></svg>\n <mona-dropdown-button-item\n label=\"Copy as HEX\"\n (menuClick)=\"onCopyColorSelect('hex')\"></mona-dropdown-button-item>\n <mona-dropdown-button-item\n label=\"Copy as RGB\"\n (menuClick)=\"onCopyColorSelect('rgb')\"></mona-dropdown-button-item>\n </mona-dropdown-button>\n </ng-template>\n </mona-text-box>\n }\n @if (showButtons()) {\n <div class=\"flex items-center justify-end gap-2\">\n <button monaButton [rounded]=\"rounded()\" look=\"primary\" (click)=\"onApply()\">Apply</button>\n <button monaButton [rounded]=\"rounded()\" (click)=\"onCancel()\">Cancel</button>\n </div>\n }\n</div>\n\n<ng-template #numericInputPrefixTemplate let-text let-classes=\"classes\">\n <span\n [class]=\"classes\"\n class=\"inline-flex items-center justify-center select-none w-7.5 bg-secondary h-full text-xs font-semibold border-r border-r-input-border\"\n >{{ text }}</span\n >\n</ng-template>\n", dependencies: [{ kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "maxValue", "minValue", "nullable", "readonly", "required", "invalid", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "touch", "valueChange"] }, { kind: "directive", type: NumericTextBoxPrefixTemplateDirective, selector: "ng-template[monaNumericTextBoxPrefixTemplate]" }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["clearButton", "disabled", "inputAttributes", "inputClass", "inputStyle", "invalid", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "ng-template[monaTextBoxPrefixTemplate]" }, { kind: "directive", type: TextBoxSuffixTemplateDirective, selector: "ng-template[monaTextBoxSuffixTemplate]" }, { kind: "component", type: SliderComponent, selector: "mona-slider", inputs: ["aria-label", "aria-labelledby", "value"], outputs: ["valueChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DropdownButtonComponent, selector: "mona-dropdown-button", inputs: ["aria-label", "aria-labelledby", "iconOnly", "disabled", "loading", "look", "rounded", "size", "text", "class"], outputs: ["menuItemClick"] }, { kind: "component", type: DropdownButtonItemComponent, selector: "mona-dropdown-button-item" }, { kind: "component", type: LucideCopy, selector: "svg[lucideCopy]" }] }); }
|
|
769
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ColorGradientComponent, isStandalone: true, selector: "mona-color-gradient", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, opacity: { classPropertyName: "opacity", publicName: "opacity", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showButtons: { classPropertyName: "showButtons", publicName: "showButtons", isSignal: true, isRequired: false, transformFunction: null }, showHexInput: { classPropertyName: "showHexInput", publicName: "showHexInput", isSignal: true, isRequired: false, transformFunction: null }, showColorInputs: { classPropertyName: "showColorInputs", publicName: "showColorInputs", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply", cancel: "cancel", touch: "touch", value: "valueChange" }, host: { properties: { "class": "baseClasses()", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.aria-invalid": "invalidState() ? 'true' : null" } }, viewQueries: [{ propertyName: "hsvHandle", first: true, predicate: ["hsvPointer"], descendants: true, isSignal: true }, { propertyName: "hsvRectangle", first: true, predicate: ["hsvRectangle"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"hsvRectangleClasses()\" [style.background-color]=\"hsvRectangleBackground()\" #hsvRectangle>\n <div\n [class]=\"hsvRectangleHandleClasses()\"\n [style.left.px]=\"hsvHandleLeft()\"\n [style.top.px]=\"hsvHandleTop()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-label]=\"'Color saturation and value'\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"hsv().s\"\n [attr.aria-valuetext]=\"'Saturation ' + hsv().s + '%, Value ' + hsv().v + '%'\"\n [attr.aria-disabled]=\"disabled() || null\"\n (keydown)=\"onHsvHandleKeyDown($event)\"\n (blur)=\"onHsvHandleBlur()\"\n #hsvPointer></div>\n</div>\n<div class=\"flex items-center gap-2\">\n <div class=\"flex flex-1 flex-col gap-1 mr-2\">\n <mona-slider\n [minValue]=\"0\"\n [maxValue]=\"360\"\n [trackBackground]=\"'linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)'\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"hsv().h ?? 0\"\n (valueChange)=\"hueValue$.next($event)\"\n (touch)=\"onSliderBlur()\"></mona-slider>\n @if (opacity()) {\n <mona-slider\n [minValue]=\"0\"\n [maxValue]=\"255\"\n [trackBackground]=\"alphaSliderBackground()\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"alpha()\"\n (valueChange)=\"onAlphaChange($event)\"\n (touch)=\"onSliderBlur()\"></mona-slider>\n }\n </div>\n @for (preview of colorPreviews(); track preview.type) {\n <div\n [class]=\"colorPreviewClasses()\"\n [class.cursor-pointer]=\"$index === 1\"\n [style.background-color]=\"preview.color\"\n [attr.title]=\"$index === 1 ? preview.title : null\"\n [attr.aria-label]=\"$index === 1 ? preview.title : null\"\n [attr.aria-hidden]=\"$index === 0 ? 'true' : null\"\n [attr.role]=\"$index === 1 ? 'button' : null\"\n [attr.tabindex]=\"$index === 1 ? 0 : null\"\n (click)=\"preview.onClick?.()\"\n (keydown)=\"onPreviousColorKeyDown($event, preview.onClick)\"></div>\n }\n <button monaButton look=\"ghost\" size=\"small\" aria-label=\"Clear color\" (click)=\"onClearClick()\">\n <i class=\"ri-blur-off-line\"></i>\n </button>\n</div>\n<div class=\"flex flex-col gap-2\">\n @if (showColorInputs()) {\n <div class=\"flex gap-2\">\n <div class=\"flex gap-1\">\n @for (input of colorInputs(); track input.key) {\n <mona-numeric-text-box\n [value]=\"input.value\"\n [minValue]=\"input.min\"\n [maxValue]=\"input.max\"\n [decimals]=\"0\"\n [spinners]=\"false\"\n [nullable]=\"false\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n class=\"w-18\"\n (valueChange)=\"input.change($event)\"\n (inputBlur)=\"onNumericInputBlur()\">\n <ng-template monaNumericTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: input.label }\"></ng-container>\n </ng-template>\n </mona-numeric-text-box>\n }\n </div>\n <div class=\"flex flex-1 items-center justify-end\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n size=\"small\"\n aria-label=\"Switch color mode\"\n (click)=\"onSwitchColorModeClick()\">\n <i class=\"ri-expand-up-down-line\"></i>\n </button>\n </div>\n </div>\n }\n @if (showHexInput()) {\n <mona-text-box\n [rounded]=\"rounded()\"\n [value]=\"hex()\"\n (valueChange)=\"onHexChange($event)\"\n (inputBlur)=\"onHexInputBlur()\"\n (inputFocus)=\"onHexInputFocus()\"\n class=\"w-full\">\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: 'HEX', classes: 'w-auto px-2' }\"></ng-container>\n </ng-template>\n <ng-template monaTextBoxSuffixTemplate>\n <mona-dropdown-button look=\"ghost\" aria-label=\"Copy color\" class=\"h-full\">\n <svg lucideCopy [size]=\"12\"></svg>\n <mona-dropdown-button-item\n label=\"Copy as HEX\"\n (menuClick)=\"onCopyColorSelect('hex')\"></mona-dropdown-button-item>\n <mona-dropdown-button-item\n label=\"Copy as RGB\"\n (menuClick)=\"onCopyColorSelect('rgb')\"></mona-dropdown-button-item>\n </mona-dropdown-button>\n </ng-template>\n </mona-text-box>\n }\n @if (showButtons()) {\n <div class=\"flex items-center justify-end gap-2\">\n <button monaButton [rounded]=\"rounded()\" look=\"primary\" (click)=\"onApply()\">Apply</button>\n <button monaButton [rounded]=\"rounded()\" (click)=\"onCancel()\">Cancel</button>\n </div>\n }\n</div>\n\n<ng-template #numericInputPrefixTemplate let-text let-classes=\"classes\">\n <span\n [class]=\"classes\"\n class=\"inline-flex items-center justify-center select-none w-7.5 [background-color:var(--mona-input-addon-background,var(--color-secondary))] h-full text-foreground text-xs font-semibold border-r border-r-input-border\"\n >{{ text }}</span\n >\n</ng-template>\n", dependencies: [{ kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "maxValue", "minValue", "nullable", "readonly", "required", "invalid", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "touch", "valueChange"] }, { kind: "directive", type: NumericTextBoxPrefixTemplateDirective, selector: "ng-template[monaNumericTextBoxPrefixTemplate]" }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["clearButton", "disabled", "inputAttributes", "inputClass", "inputStyle", "invalid", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "ng-template[monaTextBoxPrefixTemplate]" }, { kind: "directive", type: TextBoxSuffixTemplateDirective, selector: "ng-template[monaTextBoxSuffixTemplate]" }, { kind: "component", type: SliderComponent, selector: "mona-slider", inputs: ["aria-label", "aria-labelledby", "value"], outputs: ["valueChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DropdownButtonComponent, selector: "mona-dropdown-button", inputs: ["aria-label", "aria-labelledby", "iconOnly", "disabled", "loading", "look", "rounded", "size", "text", "class"], outputs: ["menuItemClick"] }, { kind: "component", type: DropdownButtonItemComponent, selector: "mona-dropdown-button-item" }, { kind: "component", type: LucideCopy, selector: "svg[lucideCopy]" }] }); }
|
|
821
770
|
}
|
|
822
771
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ColorGradientComponent, decorators: [{
|
|
823
772
|
type: Component,
|
|
@@ -838,7 +787,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
838
787
|
"[attr.data-disabled]": "disabled()",
|
|
839
788
|
"[attr.data-invalid]": "invalidState() || null",
|
|
840
789
|
"[attr.aria-invalid]": "invalidState() ? 'true' : null"
|
|
841
|
-
}, template: "<div [class]=\"hsvRectangleClasses()\" [style.background-color]=\"hsvRectangleBackground()\" #hsvRectangle>\n <div\n [class]=\"hsvRectangleHandleClasses()\"\n [style.left.px]=\"hsvHandleLeft()\"\n [style.top.px]=\"hsvHandleTop()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-label]=\"'Color saturation and value'\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"hsv().s\"\n [attr.aria-valuetext]=\"'Saturation ' + hsv().s + '%, Value ' + hsv().v + '%'\"\n [attr.aria-disabled]=\"disabled() || null\"\n (keydown)=\"onHsvHandleKeyDown($event)\"\n (blur)=\"onHsvHandleBlur()\"\n #hsvPointer></div>\n</div>\n<div class=\"flex items-center gap-2\">\n <div class=\"flex flex-1 flex-col gap-1 mr-2\">\n <mona-slider\n [minValue]=\"0\"\n [maxValue]=\"360\"\n [trackBackground]=\"'linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)'\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"hsv().h ?? 0\"\n (valueChange)=\"hueValue$.next($event)\"\n (touch)=\"onSliderBlur()\"></mona-slider>\n @if (opacity()) {\n <mona-slider\n [minValue]=\"0\"\n [maxValue]=\"255\"\n [trackBackground]=\"alphaSliderBackground()\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"alpha()\"\n (valueChange)=\"onAlphaChange($event)\"\n (touch)=\"onSliderBlur()\"></mona-slider>\n }\n </div>\n @for (preview of colorPreviews(); track preview.type) {\n <div\n [class]=\"colorPreviewClasses()\"\n [class.cursor-pointer]=\"$index === 1\"\n [style.background-color]=\"preview.color\"\n [attr.title]=\"$index === 1 ? preview.title : null\"\n [attr.aria-label]=\"$index === 1 ? preview.title : null\"\n [attr.aria-hidden]=\"$index === 0 ? 'true' : null\"\n [attr.role]=\"$index === 1 ? 'button' : null\"\n [attr.tabindex]=\"$index === 1 ? 0 : null\"\n (click)=\"preview.onClick?.()\"\n (keydown)=\"onPreviousColorKeyDown($event, preview.onClick)\"></div>\n }\n <button monaButton look=\"ghost\" size=\"small\" aria-label=\"Clear color\" (click)=\"onClearClick()\">\n <i class=\"ri-blur-off-line\"></i>\n </button>\n</div>\n<div class=\"flex flex-col gap-2\">\n @if (showColorInputs()) {\n <div class=\"flex gap-2\">\n <div class=\"flex gap-1\">\n @for (input of colorInputs(); track input.key) {\n <mona-numeric-text-box\n [value]=\"input.value\"\n [minValue]=\"input.min\"\n [maxValue]=\"input.max\"\n [decimals]=\"0\"\n [spinners]=\"false\"\n [nullable]=\"false\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n class=\"w-18\"\n (valueChange)=\"input.change($event)\"\n (inputBlur)=\"onNumericInputBlur()\">\n <ng-template monaNumericTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: input.label }\"></ng-container>\n </ng-template>\n </mona-numeric-text-box>\n }\n </div>\n <div class=\"flex flex-1 items-center justify-end\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n size=\"small\"\n aria-label=\"Switch color mode\"\n (click)=\"onSwitchColorModeClick()\">\n <i class=\"ri-expand-up-down-line\"></i>\n </button>\n </div>\n </div>\n }\n @if (showHexInput()) {\n <mona-text-box\n [rounded]=\"rounded()\"\n [value]=\"hex()\"\n (valueChange)=\"onHexChange($event)\"\n (inputBlur)=\"onHexInputBlur()\"\n (inputFocus)=\"onHexInputFocus()\"\n class=\"w-full\">\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: 'HEX', classes: 'w-auto px-2' }\"></ng-container>\n </ng-template>\n <ng-template monaTextBoxSuffixTemplate>\n <mona-dropdown-button look=\"ghost\" aria-label=\"Copy color\" class=\"h-full\">\n <svg lucideCopy [size]=\"12\"></svg>\n <mona-dropdown-button-item\n label=\"Copy as HEX\"\n (menuClick)=\"onCopyColorSelect('hex')\"></mona-dropdown-button-item>\n <mona-dropdown-button-item\n label=\"Copy as RGB\"\n (menuClick)=\"onCopyColorSelect('rgb')\"></mona-dropdown-button-item>\n </mona-dropdown-button>\n </ng-template>\n </mona-text-box>\n }\n @if (showButtons()) {\n <div class=\"flex items-center justify-end gap-2\">\n <button monaButton [rounded]=\"rounded()\" look=\"primary\" (click)=\"onApply()\">Apply</button>\n <button monaButton [rounded]=\"rounded()\" (click)=\"onCancel()\">Cancel</button>\n </div>\n }\n</div>\n\n<ng-template #numericInputPrefixTemplate let-text let-classes=\"classes\">\n <span\n [class]=\"classes\"\n class=\"inline-flex items-center justify-center select-none w-7.5
|
|
790
|
+
}, template: "<div [class]=\"hsvRectangleClasses()\" [style.background-color]=\"hsvRectangleBackground()\" #hsvRectangle>\n <div\n [class]=\"hsvRectangleHandleClasses()\"\n [style.left.px]=\"hsvHandleLeft()\"\n [style.top.px]=\"hsvHandleTop()\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-label]=\"'Color saturation and value'\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"hsv().s\"\n [attr.aria-valuetext]=\"'Saturation ' + hsv().s + '%, Value ' + hsv().v + '%'\"\n [attr.aria-disabled]=\"disabled() || null\"\n (keydown)=\"onHsvHandleKeyDown($event)\"\n (blur)=\"onHsvHandleBlur()\"\n #hsvPointer></div>\n</div>\n<div class=\"flex items-center gap-2\">\n <div class=\"flex flex-1 flex-col gap-1 mr-2\">\n <mona-slider\n [minValue]=\"0\"\n [maxValue]=\"360\"\n [trackBackground]=\"'linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)'\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"hsv().h ?? 0\"\n (valueChange)=\"hueValue$.next($event)\"\n (touch)=\"onSliderBlur()\"></mona-slider>\n @if (opacity()) {\n <mona-slider\n [minValue]=\"0\"\n [maxValue]=\"255\"\n [trackBackground]=\"alphaSliderBackground()\"\n [selectionBackground]=\"'transparent'\"\n [handleClasses]=\"sliderHandleClasses()\"\n [trackSize]=\"sliderHeight\"\n [rounded]=\"rounded()\"\n [value]=\"alpha()\"\n (valueChange)=\"onAlphaChange($event)\"\n (touch)=\"onSliderBlur()\"></mona-slider>\n }\n </div>\n @for (preview of colorPreviews(); track preview.type) {\n <div\n [class]=\"colorPreviewClasses()\"\n [class.cursor-pointer]=\"$index === 1\"\n [style.background-color]=\"preview.color\"\n [attr.title]=\"$index === 1 ? preview.title : null\"\n [attr.aria-label]=\"$index === 1 ? preview.title : null\"\n [attr.aria-hidden]=\"$index === 0 ? 'true' : null\"\n [attr.role]=\"$index === 1 ? 'button' : null\"\n [attr.tabindex]=\"$index === 1 ? 0 : null\"\n (click)=\"preview.onClick?.()\"\n (keydown)=\"onPreviousColorKeyDown($event, preview.onClick)\"></div>\n }\n <button monaButton look=\"ghost\" size=\"small\" aria-label=\"Clear color\" (click)=\"onClearClick()\">\n <i class=\"ri-blur-off-line\"></i>\n </button>\n</div>\n<div class=\"flex flex-col gap-2\">\n @if (showColorInputs()) {\n <div class=\"flex gap-2\">\n <div class=\"flex gap-1\">\n @for (input of colorInputs(); track input.key) {\n <mona-numeric-text-box\n [value]=\"input.value\"\n [minValue]=\"input.min\"\n [maxValue]=\"input.max\"\n [decimals]=\"0\"\n [spinners]=\"false\"\n [nullable]=\"false\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n class=\"w-18\"\n (valueChange)=\"input.change($event)\"\n (inputBlur)=\"onNumericInputBlur()\">\n <ng-template monaNumericTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: input.label }\"></ng-container>\n </ng-template>\n </mona-numeric-text-box>\n }\n </div>\n <div class=\"flex flex-1 items-center justify-end\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n size=\"small\"\n aria-label=\"Switch color mode\"\n (click)=\"onSwitchColorModeClick()\">\n <i class=\"ri-expand-up-down-line\"></i>\n </button>\n </div>\n </div>\n }\n @if (showHexInput()) {\n <mona-text-box\n [rounded]=\"rounded()\"\n [value]=\"hex()\"\n (valueChange)=\"onHexChange($event)\"\n (inputBlur)=\"onHexInputBlur()\"\n (inputFocus)=\"onHexInputFocus()\"\n class=\"w-full\">\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: 'HEX', classes: 'w-auto px-2' }\"></ng-container>\n </ng-template>\n <ng-template monaTextBoxSuffixTemplate>\n <mona-dropdown-button look=\"ghost\" aria-label=\"Copy color\" class=\"h-full\">\n <svg lucideCopy [size]=\"12\"></svg>\n <mona-dropdown-button-item\n label=\"Copy as HEX\"\n (menuClick)=\"onCopyColorSelect('hex')\"></mona-dropdown-button-item>\n <mona-dropdown-button-item\n label=\"Copy as RGB\"\n (menuClick)=\"onCopyColorSelect('rgb')\"></mona-dropdown-button-item>\n </mona-dropdown-button>\n </ng-template>\n </mona-text-box>\n }\n @if (showButtons()) {\n <div class=\"flex items-center justify-end gap-2\">\n <button monaButton [rounded]=\"rounded()\" look=\"primary\" (click)=\"onApply()\">Apply</button>\n <button monaButton [rounded]=\"rounded()\" (click)=\"onCancel()\">Cancel</button>\n </div>\n }\n</div>\n\n<ng-template #numericInputPrefixTemplate let-text let-classes=\"classes\">\n <span\n [class]=\"classes\"\n class=\"inline-flex items-center justify-center select-none w-7.5 [background-color:var(--mona-input-addon-background,var(--color-secondary))] h-full text-foreground text-xs font-semibold border-r border-r-input-border\"\n >{{ text }}</span\n >\n</ng-template>\n" }]
|
|
842
791
|
}], ctorParameters: () => [], propDecorators: { hsvHandle: [{ type: i0.ViewChild, args: ["hsvPointer", { isSignal: true }] }], hsvRectangle: [{ type: i0.ViewChild, args: ["hsvRectangle", { isSignal: true }] }], apply: [{ type: i0.Output, args: ["apply"] }], cancel: [{ type: i0.Output, args: ["cancel"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], opacity: [{ type: i0.Input, args: [{ isSignal: true, alias: "opacity", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }], showHexInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHexInput", required: false }] }], showColorInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColorInputs", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
843
792
|
|
|
844
793
|
/*
|