@nanahoshi/mona-ui 0.1.0 → 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 +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +24 -58
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -48
- package/fesm2022/nanahoshi-mona-ui-button.mjs +130 -129
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +69 -165
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +81 -128
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +102 -112
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +11 -25
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +41 -92
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +27 -49
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +64 -65
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +39 -61
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +12 -15
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +44 -33
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +58 -60
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +52 -165
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +36 -59
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +56 -61
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +302 -81
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +33 -84
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +12 -45
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +18 -48
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs +121 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +26 -55
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs +231 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +167 -451
- 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 +57 -87
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -139
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +10 -32
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +8 -21
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -156
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +40 -69
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +32 -116
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +81 -107
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +33 -85
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +12 -34
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +31 -52
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +38 -110
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +21 -62
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +66 -111
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +60 -151
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +117 -173
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +32 -45
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +29 -64
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +38 -101
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +58 -79
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +42 -118
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +29 -37
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -81
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +45 -39
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +45 -109
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +54 -82
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-window.mjs +35 -115
- 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 +31 -5
- 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 +6 -6
- 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 -8
- 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 +7 -8
- 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-editor.d.ts +17 -17
- 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 +3 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +16 -17
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
- 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 +7 -8
- 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 +13 -14
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +15 -17
- 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
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +0 -130
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +0 -240
|
@@ -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
|
|
18
|
-
flex flex-col min-w-64
|
|
19
|
-
|
|
20
|
-
select-none
|
|
21
|
-
|
|
22
|
-
data-[disabled='true']:
|
|
23
|
-
data-[disabled='true']:
|
|
24
|
-
data-[disabled='true']:
|
|
25
|
-
|
|
26
|
-
data-[invalid='true']:border
|
|
27
|
-
data-[invalid='true']:border-error
|
|
28
|
-
data-[invalid='true']:ring-1
|
|
29
|
-
data-[invalid='true']:ring-error
|
|
16
|
+
const colorGradientBaseThemeVariants = cva(`
|
|
17
|
+
flex flex-col min-w-64
|
|
18
|
+
gap-2 p-2
|
|
19
|
+
select-none
|
|
20
|
+
|
|
21
|
+
data-[disabled='true']:pointer-events-none
|
|
22
|
+
data-[disabled='true']:cursor-not-allowed
|
|
23
|
+
data-[disabled='true']:opacity-50
|
|
24
|
+
|
|
25
|
+
data-[invalid='true']:border
|
|
26
|
+
data-[invalid='true']:border-error
|
|
27
|
+
data-[invalid='true']:ring-1
|
|
28
|
+
data-[invalid='true']:ring-error/35
|
|
30
29
|
`);
|
|
31
|
-
const
|
|
32
|
-
relative w-full
|
|
33
|
-
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
|
|
30
|
+
const colorGradientHsvRectangleThemeVariants = cva(`
|
|
31
|
+
relative h-40 w-full
|
|
32
|
+
bg-[linear-gradient(to_bottom,rgba(0,0,0,0),black),linear-gradient(to_right,white,rgba(255,255,255,0))]
|
|
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
|
|
47
|
-
absolute
|
|
48
|
-
|
|
49
|
-
cursor-pointer
|
|
50
|
-
|
|
51
|
-
outline outline-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
focus-visible:ring-2
|
|
55
|
-
focus-visible:ring-primary/40
|
|
56
|
-
focus-visible:ring-offset-2
|
|
45
|
+
const colorGradientHsvRectangleHandleThemeVariants = cva(`
|
|
46
|
+
absolute
|
|
47
|
+
h-3 w-3
|
|
48
|
+
cursor-pointer
|
|
49
|
+
bg-transparent
|
|
50
|
+
border-2 border-black/90 outline outline-white/90 shadow-sm
|
|
51
|
+
|
|
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
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
const colorGradientSliderHandleThemeVariants = cva(`
|
|
80
|
+
h-3 w-3
|
|
81
|
+
bg-transparent
|
|
82
|
+
border-3 border-white/90
|
|
83
|
+
outline outline-solid outline-black/90
|
|
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>\r\n <div\r\n [class]=\"hsvRectangleHandleClasses()\"\r\n [style.left.px]=\"hsvHandleLeft()\"\r\n [style.top.px]=\"hsvHandleTop()\"\r\n [attr.tabindex]=\"disabled() ? -1 : 0\"\r\n [attr.role]=\"'slider'\"\r\n [attr.aria-label]=\"'Color saturation and value'\"\r\n [attr.aria-valuemin]=\"0\"\r\n [attr.aria-valuemax]=\"100\"\r\n [attr.aria-valuenow]=\"hsv().s\"\r\n [attr.aria-valuetext]=\"'Saturation ' + hsv().s + '%, Value ' + hsv().v + '%'\"\r\n [attr.aria-disabled]=\"disabled() || null\"\r\n (keydown)=\"onHsvHandleKeyDown($event)\"\r\n (blur)=\"onHsvHandleBlur()\"\r\n #hsvPointer></div>\r\n</div>\r\n<div class=\"flex items-center gap-2\">\r\n <div class=\"flex flex-1 flex-col gap-1 mr-2\">\r\n <mona-slider\r\n [minValue]=\"0\"\r\n [maxValue]=\"360\"\r\n [trackBackground]=\"'linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)'\"\r\n [selectionBackground]=\"'transparent'\"\r\n [handleClasses]=\"sliderHandleClasses()\"\r\n [trackSize]=\"sliderHeight\"\r\n [rounded]=\"rounded()\"\r\n [value]=\"hsv().h ?? 0\"\r\n (valueChange)=\"hueValue$.next($event)\"\r\n (touch)=\"onSliderBlur()\"></mona-slider>\r\n @if (opacity()) {\r\n <mona-slider\r\n [minValue]=\"0\"\r\n [maxValue]=\"255\"\r\n [trackBackground]=\"alphaSliderBackground()\"\r\n [selectionBackground]=\"'transparent'\"\r\n [handleClasses]=\"sliderHandleClasses()\"\r\n [trackSize]=\"sliderHeight\"\r\n [rounded]=\"rounded()\"\r\n [value]=\"alpha()\"\r\n (valueChange)=\"onAlphaChange($event)\"\r\n (touch)=\"onSliderBlur()\"></mona-slider>\r\n }\r\n </div>\r\n @for (preview of colorPreviews(); track preview.type) {\r\n <div\r\n [class]=\"colorPreviewClasses()\"\r\n [class.cursor-pointer]=\"$index === 1\"\r\n [style.background-color]=\"preview.color\"\r\n [attr.title]=\"$index === 1 ? preview.title : null\"\r\n [attr.aria-label]=\"$index === 1 ? preview.title : null\"\r\n [attr.aria-hidden]=\"$index === 0 ? 'true' : null\"\r\n [attr.role]=\"$index === 1 ? 'button' : null\"\r\n [attr.tabindex]=\"$index === 1 ? 0 : null\"\r\n (click)=\"preview.onClick?.()\"\r\n (keydown)=\"onPreviousColorKeyDown($event, preview.onClick)\"></div>\r\n }\r\n <button monaButton look=\"ghost\" size=\"small\" aria-label=\"Clear color\" (click)=\"onClearClick()\">\r\n <i class=\"ri-blur-off-line\"></i>\r\n </button>\r\n</div>\r\n<div class=\"flex flex-col gap-2\">\r\n @if (showColorInputs()) {\r\n <div class=\"flex gap-2\">\r\n <div class=\"flex gap-1\">\r\n @for (input of colorInputs(); track input.key) {\r\n <mona-numeric-text-box\r\n [value]=\"input.value\"\r\n [minValue]=\"input.min\"\r\n [maxValue]=\"input.max\"\r\n [decimals]=\"0\"\r\n [spinners]=\"false\"\r\n [nullable]=\"false\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"'small'\"\r\n class=\"w-18\"\r\n (valueChange)=\"input.change($event)\"\r\n (inputBlur)=\"onNumericInputBlur()\">\r\n <ng-template monaNumericTextBoxPrefixTemplate>\r\n <ng-container\r\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: input.label }\"></ng-container>\r\n </ng-template>\r\n </mona-numeric-text-box>\r\n }\r\n </div>\r\n <div class=\"flex flex-1 items-center justify-end\">\r\n <button\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n size=\"small\"\r\n aria-label=\"Switch color mode\"\r\n (click)=\"onSwitchColorModeClick()\">\r\n <i class=\"ri-expand-up-down-line\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n @if (showHexInput()) {\r\n <mona-text-box\r\n [rounded]=\"rounded()\"\r\n [value]=\"hex()\"\r\n (valueChange)=\"onHexChange($event)\"\r\n (inputBlur)=\"onHexInputBlur()\"\r\n (inputFocus)=\"onHexInputFocus()\"\r\n class=\"w-full\">\r\n <ng-template monaTextBoxPrefixTemplate>\r\n <ng-container\r\n [ngTemplateOutlet]=\"numericInputPrefixTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: 'HEX', classes: 'w-auto px-2' }\"></ng-container>\r\n </ng-template>\r\n <ng-template monaTextBoxSuffixTemplate>\r\n <mona-dropdown-button look=\"ghost\" aria-label=\"Copy color\" class=\"h-full\">\r\n <svg lucideCopy [size]=\"12\"></svg>\r\n <mona-dropdown-button-item\r\n label=\"Copy as HEX\"\r\n (menuClick)=\"onCopyColorSelect('hex')\"></mona-dropdown-button-item>\r\n <mona-dropdown-button-item\r\n label=\"Copy as RGB\"\r\n (menuClick)=\"onCopyColorSelect('rgb')\"></mona-dropdown-button-item>\r\n </mona-dropdown-button>\r\n </ng-template>\r\n </mona-text-box>\r\n }\r\n @if (showButtons()) {\r\n <div class=\"flex items-center justify-end gap-2\">\r\n <button monaButton [rounded]=\"rounded()\" look=\"primary\" (click)=\"onApply()\">Apply</button>\r\n <button monaButton [rounded]=\"rounded()\" (click)=\"onCancel()\">Cancel</button>\r\n </div>\r\n }\r\n</div>\r\n\r\n<ng-template #numericInputPrefixTemplate let-text let-classes=\"classes\">\r\n <span\r\n [class]=\"classes\"\r\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\"\r\n >{{ text }}</span\r\n >\r\n</ng-template>\r\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>\
|
|
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
|
/*
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, computed, signal, input, output, model, Component } from '@angular/core';
|
|
3
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
4
3
|
import { count } from '@mirei/ts-collections';
|
|
5
4
|
import { cva } from 'class-variance-authority';
|
|
6
5
|
|
|
7
|
-
const
|
|
8
|
-
grid gap-0.125 p-0.0625
|
|
9
|
-
data-[disabled='true']:
|
|
10
|
-
data-[disabled='true']:
|
|
11
|
-
data-[disabled='true']:
|
|
12
|
-
data-[readonly='true']:cursor-default
|
|
13
|
-
data-[invalid='true']:border
|
|
14
|
-
data-[invalid='true']:border-error
|
|
15
|
-
data-[invalid='true']:ring-1
|
|
16
|
-
data-[invalid='true']:ring-error
|
|
6
|
+
const colorPaletteBaseThemeVariants = cva(`
|
|
7
|
+
grid gap-0.125 p-0.0625
|
|
8
|
+
data-[disabled='true']:pointer-events-none
|
|
9
|
+
data-[disabled='true']:cursor-not-allowed
|
|
10
|
+
data-[disabled='true']:opacity-50
|
|
11
|
+
data-[readonly='true']:cursor-default
|
|
12
|
+
data-[invalid='true']:border
|
|
13
|
+
data-[invalid='true']:border-error
|
|
14
|
+
data-[invalid='true']:ring-1
|
|
15
|
+
data-[invalid='true']:ring-error/35
|
|
17
16
|
`);
|
|
18
|
-
const
|
|
19
|
-
cursor-pointer
|
|
20
|
-
|
|
21
|
-
data-[
|
|
22
|
-
data-[selected='true']:
|
|
23
|
-
data-[selected='true']:
|
|
24
|
-
data-[selected='true']:outline-2
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
focus:not-data-[selected='true']:border
|
|
30
|
-
focus:not-data-[selected='true']:
|
|
31
|
-
focus:not-data-[selected='true']:outline-
|
|
32
|
-
focus:not-data-[selected='true']:
|
|
17
|
+
const colorPaletteItemThemeVariants = cva(`
|
|
18
|
+
cursor-pointer
|
|
19
|
+
transition-transform
|
|
20
|
+
data-[readonly='true']:cursor-default
|
|
21
|
+
data-[selected='true']:scale-90
|
|
22
|
+
data-[selected='true']:border-2 data-[selected='true']:border-black/90
|
|
23
|
+
data-[selected='true']:outline data-[selected='true']:outline-2 data-[selected='true']:outline-white/90
|
|
24
|
+
hover:scale-95
|
|
25
|
+
|
|
26
|
+
focus-visible:z-1
|
|
27
|
+
focus-visible:not-data-[selected='true']:border-2
|
|
28
|
+
focus-visible:not-data-[selected='true']:border-black/90
|
|
29
|
+
focus-visible:not-data-[selected='true']:outline
|
|
30
|
+
focus-visible:not-data-[selected='true']:outline-2
|
|
31
|
+
focus-visible:not-data-[selected='true']:outline-white/90
|
|
33
32
|
`, {
|
|
34
33
|
variants: {
|
|
35
34
|
rounded: {
|
|
@@ -42,23 +41,6 @@ const colorPaletteItemVariants = cva(`
|
|
|
42
41
|
}
|
|
43
42
|
});
|
|
44
43
|
|
|
45
|
-
const colorPaletteBaseThemeVariants = (theme) => {
|
|
46
|
-
switch (theme) {
|
|
47
|
-
case "mona":
|
|
48
|
-
return colorPaletteBaseVariants;
|
|
49
|
-
default:
|
|
50
|
-
return colorPaletteBaseVariants;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const colorPaletteItemThemeVariants = (theme) => {
|
|
54
|
-
switch (theme) {
|
|
55
|
-
case "mona":
|
|
56
|
-
return colorPaletteItemVariants;
|
|
57
|
-
default:
|
|
58
|
-
return colorPaletteItemVariants;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
44
|
const flatColorScheme = {
|
|
63
45
|
name: "flat",
|
|
64
46
|
columns: 20,
|
|
@@ -687,10 +669,8 @@ const websafeColorScheme = {
|
|
|
687
669
|
class ColorPaletteComponent {
|
|
688
670
|
constructor() {
|
|
689
671
|
this.#elementRef = inject((ElementRef));
|
|
690
|
-
this.#themeService = inject(ThemeService);
|
|
691
672
|
this.baseClasses = computed(() => {
|
|
692
|
-
|
|
693
|
-
return colorPaletteBaseThemeVariants(theme)();
|
|
673
|
+
return colorPaletteBaseThemeVariants();
|
|
694
674
|
}, /* @ts-ignore */
|
|
695
675
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
696
676
|
this.colorScheme = computed(() => {
|
|
@@ -714,9 +694,8 @@ class ColorPaletteComponent {
|
|
|
714
694
|
}, /* @ts-ignore */
|
|
715
695
|
...(ngDevMode ? [{ debugName: "colorScheme" }] : /* istanbul ignore next */ []));
|
|
716
696
|
this.paletteItemClasses = computed(() => {
|
|
717
|
-
const theme = this.#themeService.theme();
|
|
718
697
|
const rounded = this.rounded();
|
|
719
|
-
return colorPaletteItemThemeVariants(
|
|
698
|
+
return colorPaletteItemThemeVariants({ rounded });
|
|
720
699
|
}, /* @ts-ignore */
|
|
721
700
|
...(ngDevMode ? [{ debugName: "paletteItemClasses" }] : /* istanbul ignore next */ []));
|
|
722
701
|
this.colorRows = computed(() => {
|
|
@@ -807,7 +786,6 @@ class ColorPaletteComponent {
|
|
|
807
786
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
808
787
|
}
|
|
809
788
|
#elementRef;
|
|
810
|
-
#themeService;
|
|
811
789
|
focusColorTile(index) {
|
|
812
790
|
setTimeout(() => {
|
|
813
791
|
const colorTiles = this.#elementRef.nativeElement.querySelectorAll("[data-color-index]");
|