@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, signal, computed, inject, DestroyRef, ElementRef, afterNextRender, Component, contentChild, contentChildren, input, output, afterRenderEffect, ChangeDetectionStrategy, linkedSignal, forwardRef, model, TemplateRef, Directive } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { createElementControlId, isNavigationKey, isTypeaheadKey, setupTypeahead, toCssValue, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
4
|
+
import { themeOverlaySurfaceClasses, createElementControlId, isNavigationKey, isTypeaheadKey, setupTypeahead, toCssValue, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
5
5
|
import { PopupDataInjectionToken, PopupService } from '@nanahoshi/mona-ui/popup';
|
|
6
6
|
import { forEach, select, groupBy, selectMany, any } from '@mirei/ts-collections';
|
|
7
7
|
import { Subject, take, tap, fromEvent, takeUntil, filter, switchMap } from 'rxjs';
|
|
@@ -9,7 +9,6 @@ import { PreventableEvent } from '@nanahoshi/mona-ui/common';
|
|
|
9
9
|
import { v4 } from 'uuid';
|
|
10
10
|
import { NgTemplateOutlet } from '@angular/common';
|
|
11
11
|
import { LucideChevronRight, LucideCheck } from '@lucide/angular';
|
|
12
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
13
12
|
import { twMerge } from 'tailwind-merge';
|
|
14
13
|
import { cva } from 'class-variance-authority';
|
|
15
14
|
|
|
@@ -134,7 +133,7 @@ class PopupMenuItemClickEvent extends PreventableEvent {
|
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
|
|
137
|
-
const
|
|
136
|
+
const popupMenuBaseThemeVariants = cva(`h-full w-full overflow-hidden`, {
|
|
138
137
|
variants: {
|
|
139
138
|
rounded: {
|
|
140
139
|
small: "rounded-sm",
|
|
@@ -144,12 +143,10 @@ const popupMenuBaseVariants = cva(`w-full h-full overflow-hidden`, {
|
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
});
|
|
147
|
-
const
|
|
148
|
-
flex flex-col
|
|
149
|
-
|
|
150
|
-
border border-border
|
|
151
|
-
outline-none
|
|
152
|
-
p-1 shadow-md
|
|
146
|
+
const popupMenuContainerThemeVariants = cva(`
|
|
147
|
+
flex flex-col p-1
|
|
148
|
+
${themeOverlaySurfaceClasses} text-foreground
|
|
149
|
+
border border-border shadow-(--shadow-overlay) outline-none
|
|
153
150
|
`, {
|
|
154
151
|
variants: {
|
|
155
152
|
rounded: {
|
|
@@ -160,7 +157,7 @@ const popupMenuContainerVariants = cva(`
|
|
|
160
157
|
}
|
|
161
158
|
}
|
|
162
159
|
});
|
|
163
|
-
const
|
|
160
|
+
const popupMenuGroupHeaderThemeVariants = cva(`inline-flex w-full select-none px-2 py-1 font-bold text-muted-foreground`, {
|
|
164
161
|
variants: {
|
|
165
162
|
size: {
|
|
166
163
|
small: "text-xs",
|
|
@@ -169,25 +166,17 @@ const popupMenuGroupHeaderVariants = cva(`font-bold inline-flex select-none px-2
|
|
|
169
166
|
}
|
|
170
167
|
}
|
|
171
168
|
});
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
relative flex gap-2
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
focus-within:outline-none
|
|
184
|
-
|
|
185
|
-
data-[disabled='true']:pointer-events-none
|
|
186
|
-
data-[disabled='true']:cursor-not-allowed
|
|
187
|
-
data-[disabled='true']:opacity-50
|
|
188
|
-
|
|
189
|
-
data-[active='true']:bg-hover
|
|
190
|
-
data-[active='true']:text-hover-foreground
|
|
169
|
+
const popupMenuIconContainerThemeVariants = cva(`absolute left-2 flex items-center justify-center`);
|
|
170
|
+
const popupMenuItemThemeVariants = cva(`
|
|
171
|
+
relative flex cursor-pointer select-none items-center gap-2 py-1 pr-2 pl-8
|
|
172
|
+
text-foreground outline-none
|
|
173
|
+
hover:bg-[var(--mona-menu-item-hover-background,var(--color-hover))] hover:text-foreground
|
|
174
|
+
focus-within:bg-[var(--mona-menu-item-hover-background,var(--color-hover))]
|
|
175
|
+
focus-within:text-foreground focus-within:outline-none
|
|
176
|
+
data-[disabled='true']:pointer-events-none data-[disabled='true']:cursor-not-allowed
|
|
177
|
+
data-[disabled='true']:text-disabled-foreground
|
|
178
|
+
data-[active='true']:bg-[var(--mona-menu-item-hover-background,var(--color-hover))]
|
|
179
|
+
data-[active='true']:text-foreground
|
|
191
180
|
`, {
|
|
192
181
|
variants: {
|
|
193
182
|
rounded: {
|
|
@@ -203,56 +192,7 @@ const popupMenuItemVariants = cva(`
|
|
|
203
192
|
}
|
|
204
193
|
}
|
|
205
194
|
});
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
const popupMenuBaseThemeVariants = (theme) => {
|
|
209
|
-
switch (theme) {
|
|
210
|
-
case "mona":
|
|
211
|
-
return popupMenuBaseVariants;
|
|
212
|
-
default:
|
|
213
|
-
return popupMenuBaseVariants;
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
const popupMenuContainerThemeVariants = (theme) => {
|
|
217
|
-
switch (theme) {
|
|
218
|
-
case "mona":
|
|
219
|
-
return popupMenuContainerVariants;
|
|
220
|
-
default:
|
|
221
|
-
return popupMenuContainerVariants;
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
const popupMenuGroupHeaderThemeVariants = (theme) => {
|
|
225
|
-
switch (theme) {
|
|
226
|
-
case "mona":
|
|
227
|
-
return popupMenuGroupHeaderVariants;
|
|
228
|
-
default:
|
|
229
|
-
return popupMenuGroupHeaderVariants;
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
const popupMenuIconContainerThemeVariants = (theme) => {
|
|
233
|
-
switch (theme) {
|
|
234
|
-
case "mona":
|
|
235
|
-
return popupMenuIconContainerVariants;
|
|
236
|
-
default:
|
|
237
|
-
return popupMenuIconContainerVariants;
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
const popupMenuItemThemeVariants = (theme) => {
|
|
241
|
-
switch (theme) {
|
|
242
|
-
case "mona":
|
|
243
|
-
return popupMenuItemVariants;
|
|
244
|
-
default:
|
|
245
|
-
return popupMenuItemVariants;
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
const popupMenuLinkThemeVariants = (theme) => {
|
|
249
|
-
switch (theme) {
|
|
250
|
-
case "mona":
|
|
251
|
-
return popupMenuLinkVariants;
|
|
252
|
-
default:
|
|
253
|
-
return popupMenuLinkVariants;
|
|
254
|
-
}
|
|
255
|
-
};
|
|
195
|
+
const popupMenuLinkThemeVariants = cva(`flex items-center justify-center`);
|
|
256
196
|
|
|
257
197
|
class PopupMenuListComponent {
|
|
258
198
|
#childCloseRequest$;
|
|
@@ -264,7 +204,6 @@ class PopupMenuListComponent {
|
|
|
264
204
|
#navigationItems;
|
|
265
205
|
#parentConfig;
|
|
266
206
|
#popupService;
|
|
267
|
-
#themeService;
|
|
268
207
|
#typeaheadKey$;
|
|
269
208
|
#viaKeyboardNavigation;
|
|
270
209
|
constructor() {
|
|
@@ -312,29 +251,25 @@ class PopupMenuListComponent {
|
|
|
312
251
|
...(ngDevMode ? [{ debugName: "#navigationItems" }] : /* istanbul ignore next */ []));
|
|
313
252
|
this.#parentConfig = inject(PopupDataInjectionToken);
|
|
314
253
|
this.#popupService = inject(PopupService);
|
|
315
|
-
this.#themeService = inject(ThemeService);
|
|
316
254
|
this.#typeaheadKey$ = new Subject();
|
|
317
255
|
this.#viaKeyboardNavigation = signal(false, /* @ts-ignore */
|
|
318
256
|
...(ngDevMode ? [{ debugName: "#viaKeyboardNavigation" }] : /* istanbul ignore next */ []));
|
|
319
257
|
this.activeMenuItem = signal(null, /* @ts-ignore */
|
|
320
258
|
...(ngDevMode ? [{ debugName: "activeMenuItem" }] : /* istanbul ignore next */ []));
|
|
321
259
|
this.baseClasses = computed(() => {
|
|
322
|
-
const theme = this.#themeService.theme();
|
|
323
260
|
const rounded = this.#parentConfig.rounded();
|
|
324
|
-
return popupMenuBaseThemeVariants(
|
|
261
|
+
return popupMenuBaseThemeVariants({ rounded });
|
|
325
262
|
}, /* @ts-ignore */
|
|
326
263
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
327
264
|
this.containerClasses = computed(() => {
|
|
328
|
-
const theme = this.#themeService.theme();
|
|
329
265
|
const rounded = this.#parentConfig.rounded();
|
|
330
|
-
return popupMenuContainerThemeVariants(
|
|
266
|
+
return popupMenuContainerThemeVariants({ rounded });
|
|
331
267
|
}, /* @ts-ignore */
|
|
332
268
|
...(ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []));
|
|
333
269
|
this.groupHeaderClasses = computed(() => {
|
|
334
|
-
const theme = this.#themeService.theme();
|
|
335
270
|
const size = this.#parentConfig.size();
|
|
336
271
|
const hasIcon = this.iconAreaVisible();
|
|
337
|
-
const variantClasses = popupMenuGroupHeaderThemeVariants(
|
|
272
|
+
const variantClasses = popupMenuGroupHeaderThemeVariants({ size });
|
|
338
273
|
const iconClasses = hasIcon ? "pl-8" : "pl-2";
|
|
339
274
|
return twMerge(variantClasses, iconClasses);
|
|
340
275
|
}, /* @ts-ignore */
|
|
@@ -346,23 +281,20 @@ class PopupMenuListComponent {
|
|
|
346
281
|
}, /* @ts-ignore */
|
|
347
282
|
...(ngDevMode ? [{ debugName: "iconAreaVisible" }] : /* istanbul ignore next */ []));
|
|
348
283
|
this.iconContainerClasses = computed(() => {
|
|
349
|
-
|
|
350
|
-
return popupMenuIconContainerThemeVariants(theme)();
|
|
284
|
+
return popupMenuIconContainerThemeVariants();
|
|
351
285
|
}, /* @ts-ignore */
|
|
352
286
|
...(ngDevMode ? [{ debugName: "iconContainerClasses" }] : /* istanbul ignore next */ []));
|
|
353
287
|
this.linkContainerClasses = computed(() => {
|
|
354
|
-
|
|
355
|
-
return popupMenuLinkThemeVariants(theme)();
|
|
288
|
+
return popupMenuLinkThemeVariants();
|
|
356
289
|
}, /* @ts-ignore */
|
|
357
290
|
...(ngDevMode ? [{ debugName: "linkContainerClasses" }] : /* istanbul ignore next */ []));
|
|
358
291
|
this.menuId = computed(() => this.#parentConfig.menuId, /* @ts-ignore */
|
|
359
292
|
...(ngDevMode ? [{ debugName: "menuId" }] : /* istanbul ignore next */ []));
|
|
360
293
|
this.menuItemClasses = computed(() => {
|
|
361
|
-
const theme = this.#themeService.theme();
|
|
362
294
|
const rounded = this.#parentConfig.rounded();
|
|
363
295
|
const size = this.#parentConfig.size();
|
|
364
296
|
const hasIcon = this.iconAreaVisible();
|
|
365
|
-
const variantClasses = popupMenuItemThemeVariants(
|
|
297
|
+
const variantClasses = popupMenuItemThemeVariants({ rounded, size });
|
|
366
298
|
const iconClasses = hasIcon ? "pl-8" : "pl-2";
|
|
367
299
|
return twMerge(variantClasses, iconClasses);
|
|
368
300
|
}, /* @ts-ignore */
|
|
@@ -401,6 +333,13 @@ class PopupMenuListComponent {
|
|
|
401
333
|
}
|
|
402
334
|
this.#parentConfig.menuItemClick$.next(popupMenuItemClickEvent);
|
|
403
335
|
}
|
|
336
|
+
closePopup() {
|
|
337
|
+
if (this.popupRef) {
|
|
338
|
+
this.popupRef.close();
|
|
339
|
+
this.popupRef = null;
|
|
340
|
+
}
|
|
341
|
+
this.#close$.next();
|
|
342
|
+
}
|
|
404
343
|
createSubmenu(target, viaKeyboard) {
|
|
405
344
|
this.#viaKeyboardNavigation.set(viaKeyboard);
|
|
406
345
|
const minWidth = this.#parentConfig.minWidth?.() ?? undefined;
|
|
@@ -533,10 +472,7 @@ class PopupMenuListComponent {
|
|
|
533
472
|
}
|
|
534
473
|
}
|
|
535
474
|
handleEscapeKey() {
|
|
536
|
-
|
|
537
|
-
this.popupRef.close();
|
|
538
|
-
this.popupRef = null;
|
|
539
|
-
}
|
|
475
|
+
this.closePopup();
|
|
540
476
|
}
|
|
541
477
|
handleHomeKey() {
|
|
542
478
|
const firstItem = this.#navigationItems().firstOrDefault();
|
|
@@ -608,28 +544,20 @@ class PopupMenuListComponent {
|
|
|
608
544
|
}
|
|
609
545
|
setPopupCloseSubscription() {
|
|
610
546
|
this.#parentConfig.parentClose$
|
|
611
|
-
.pipe(takeUntilDestroyed(this.#destroyRef), tap(() =>
|
|
612
|
-
if (this.popupRef) {
|
|
613
|
-
this.popupRef.close();
|
|
614
|
-
this.popupRef = null;
|
|
615
|
-
}
|
|
616
|
-
}))
|
|
547
|
+
.pipe(takeUntilDestroyed(this.#destroyRef), tap(() => this.closePopup()))
|
|
617
548
|
.subscribe();
|
|
618
549
|
this.#childCloseRequest$
|
|
619
550
|
.pipe(takeUntilDestroyed(this.#destroyRef), tap(() => {
|
|
620
551
|
const activeItem = this.activeMenuItem();
|
|
621
552
|
this.notifyNavigation(activeItem, "left");
|
|
622
|
-
|
|
623
|
-
this.popupRef.close();
|
|
624
|
-
this.popupRef = null;
|
|
625
|
-
}
|
|
553
|
+
this.closePopup();
|
|
626
554
|
}))
|
|
627
555
|
.subscribe();
|
|
628
556
|
}
|
|
629
557
|
setPointerSubscriptions() {
|
|
630
558
|
this.pointerEnter$
|
|
631
559
|
.pipe(takeUntilDestroyed(this.#destroyRef), takeUntil(this.#parentConfig.parentClose$), filter(e => e.item !== this.activeMenuItem()), tap(e => {
|
|
632
|
-
this.
|
|
560
|
+
this.closePopup();
|
|
633
561
|
if (e.item.items.length === 0) {
|
|
634
562
|
this.activeMenuItem.set(null);
|
|
635
563
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet, DecimalPipe } 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
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
5
4
|
import { getPercentage } from '@nanahoshi/mona-ui/common';
|
|
6
5
|
import { twMerge } from 'tailwind-merge';
|
|
7
6
|
import { cva } from 'class-variance-authority';
|
|
@@ -20,14 +19,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
20
19
|
}]
|
|
21
20
|
}] });
|
|
22
21
|
|
|
23
|
-
const
|
|
22
|
+
const progressBarBaseThemeVariants = cva(`
|
|
24
23
|
relative flex items-center justify-center
|
|
25
|
-
|
|
26
|
-
bg-input-background border border-input-border
|
|
24
|
+
h-5.5 w-full
|
|
27
25
|
overflow-hidden select-none
|
|
26
|
+
bg-surface-muted
|
|
28
27
|
data-[disabled='true']:pointer-events-none
|
|
29
28
|
data-[disabled='true']:cursor-not-allowed
|
|
30
|
-
data-[disabled='true']:
|
|
29
|
+
data-[disabled='true']:bg-disabled-background
|
|
30
|
+
data-[disabled='true']:text-disabled-foreground
|
|
31
|
+
data-[disabled='true']:[&_[data-prev='true']]:bg-disabled-foreground
|
|
31
32
|
`, {
|
|
32
33
|
variants: {
|
|
33
34
|
rounded: {
|
|
@@ -39,29 +40,26 @@ const progressBarBaseVariants = cva(`
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
|
-
const
|
|
43
|
-
absolute w-full
|
|
44
|
-
|
|
45
|
-
bg-[repeating-linear-gradient(135deg,var(--color-background),var(--color-background)_10px,var(--color-secondary)_10px,var(--color-secondary)_20px)]
|
|
43
|
+
const progressBarIndeterminateThemeVariants = cva(`
|
|
44
|
+
absolute flex h-full w-full items-center justify-center
|
|
45
|
+
bg-[repeating-linear-gradient(135deg,var(--color-surface-muted),var(--color-surface-muted)_10px,var(--color-primary)_10px,var(--color-primary)_20px)]
|
|
46
46
|
bg-size-[200%_200%]
|
|
47
47
|
`);
|
|
48
|
-
const
|
|
48
|
+
const progressBarLabelThemeVariants = cva(`
|
|
49
49
|
px-1.5
|
|
50
50
|
`);
|
|
51
|
-
const
|
|
52
|
-
relative
|
|
53
|
-
flex items-center justify-center
|
|
54
|
-
w-full h-full
|
|
51
|
+
const progressBarTrackThemeVariants = cva(`
|
|
52
|
+
relative flex h-full w-full items-center justify-center
|
|
55
53
|
text-xs font-medium
|
|
56
54
|
bg-primary text-primary-foreground
|
|
57
55
|
data-[prev='true']:transition-[background-color]
|
|
58
|
-
data-[prev='true']:duration-
|
|
56
|
+
data-[prev='true']:duration-(--mona-motion-fast)
|
|
59
57
|
data-[prev='true']:ease-in
|
|
60
58
|
data-[next='true']:absolute
|
|
61
|
-
data-[next='true']:bg-
|
|
59
|
+
data-[next='true']:bg-surface-muted
|
|
62
60
|
data-[next='true']:text-foreground
|
|
63
61
|
data-[next='true']:transition-[clip-path]
|
|
64
|
-
data-[next='true']:duration-
|
|
62
|
+
data-[next='true']:duration-(--mona-motion-fast)
|
|
65
63
|
data-[next='true']:ease-in
|
|
66
64
|
data-[value='0']:bg-transparent
|
|
67
65
|
data-[left='true']:justify-start
|
|
@@ -78,39 +76,6 @@ const progressBarTrackVariants = cva(`
|
|
|
78
76
|
}
|
|
79
77
|
});
|
|
80
78
|
|
|
81
|
-
const progressBarBaseThemeVariants = (theme) => {
|
|
82
|
-
switch (theme) {
|
|
83
|
-
case "mona":
|
|
84
|
-
return progressBarBaseVariants;
|
|
85
|
-
default:
|
|
86
|
-
return progressBarBaseVariants;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const progressBarIndeterminateThemeVariants = (theme) => {
|
|
90
|
-
switch (theme) {
|
|
91
|
-
case "mona":
|
|
92
|
-
return progressBarIndeterminateVariants;
|
|
93
|
-
default:
|
|
94
|
-
return progressBarIndeterminateVariants;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const progressBarLabelThemeVariants = (theme) => {
|
|
98
|
-
switch (theme) {
|
|
99
|
-
case "mona":
|
|
100
|
-
return progressBarLabelVariants;
|
|
101
|
-
default:
|
|
102
|
-
return progressBarLabelVariants;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const progressBarTrackThemeVariants = (theme) => {
|
|
106
|
-
switch (theme) {
|
|
107
|
-
case "mona":
|
|
108
|
-
return progressBarTrackVariants;
|
|
109
|
-
default:
|
|
110
|
-
return progressBarTrackVariants;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
79
|
class ProgressBarComponent {
|
|
115
80
|
constructor() {
|
|
116
81
|
this.#color = computed(() => {
|
|
@@ -119,23 +84,19 @@ class ProgressBarComponent {
|
|
|
119
84
|
return typeof color === "string" ? color : color?.(progress);
|
|
120
85
|
}, /* @ts-ignore */
|
|
121
86
|
...(ngDevMode ? [{ debugName: "#color" }] : /* istanbul ignore next */ []));
|
|
122
|
-
this.#themeService = inject(ThemeService);
|
|
123
87
|
this.baseClasses = computed(() => {
|
|
124
|
-
const theme = this.#themeService.theme();
|
|
125
88
|
const rounded = this.rounded();
|
|
126
|
-
const classes = progressBarBaseThemeVariants(
|
|
89
|
+
const classes = progressBarBaseThemeVariants({ rounded });
|
|
127
90
|
const userClass = this.userClass();
|
|
128
91
|
return twMerge(classes, userClass);
|
|
129
92
|
}, /* @ts-ignore */
|
|
130
93
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
131
94
|
this.indeterminateClasses = computed(() => {
|
|
132
|
-
|
|
133
|
-
return progressBarIndeterminateThemeVariants(theme)();
|
|
95
|
+
return progressBarIndeterminateThemeVariants();
|
|
134
96
|
}, /* @ts-ignore */
|
|
135
97
|
...(ngDevMode ? [{ debugName: "indeterminateClasses" }] : /* istanbul ignore next */ []));
|
|
136
98
|
this.labelClasses = computed(() => {
|
|
137
|
-
|
|
138
|
-
return progressBarLabelThemeVariants(theme)();
|
|
99
|
+
return progressBarLabelThemeVariants();
|
|
139
100
|
}, /* @ts-ignore */
|
|
140
101
|
...(ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []));
|
|
141
102
|
this.labelTemplate = contentChild(ProgressBarLabelTemplateDirective, /* @ts-ignore */
|
|
@@ -158,9 +119,8 @@ class ProgressBarComponent {
|
|
|
158
119
|
this.progress = computed(() => getPercentage(this.value(), this.min(), this.max()), /* @ts-ignore */
|
|
159
120
|
...(ngDevMode ? [{ debugName: "progress" }] : /* istanbul ignore next */ []));
|
|
160
121
|
this.trackClasses = computed(() => {
|
|
161
|
-
const theme = this.#themeService.theme();
|
|
162
122
|
const rounded = this.rounded();
|
|
163
|
-
const classes = progressBarTrackThemeVariants(
|
|
123
|
+
const classes = progressBarTrackThemeVariants({ rounded });
|
|
164
124
|
return this.animate()
|
|
165
125
|
? classes
|
|
166
126
|
: twMerge(classes, "data-[next='true']:transition-none data-[prev='true']:transition-none");
|
|
@@ -262,7 +222,6 @@ class ProgressBarComponent {
|
|
|
262
222
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
263
223
|
}
|
|
264
224
|
#color;
|
|
265
|
-
#themeService;
|
|
266
225
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
267
226
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ProgressBarComponent, isStandalone: true, selector: "mona-progress-bar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaValueText: { classPropertyName: "ariaValueText", publicName: "aria-valuetext", isSignal: true, isRequired: false, transformFunction: null }, animate: { classPropertyName: "animate", publicName: "animate", 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 }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelStyles: { classPropertyName: "labelStyles", publicName: "labelStyles", isSignal: true, isRequired: false, transformFunction: null }, labelVisible: { classPropertyName: "labelVisible", publicName: "labelVisible", 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 }, rounded: { classPropertyName: "rounded", publicName: "rounded", 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()" } }, queries: [{ propertyName: "labelTemplate", first: true, predicate: ProgressBarLabelTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"trackClasses()\"\n [style.background-color]=\"trackColor()\"\n [attr.data-prev]=\"true\"\n [attr.data-left]=\"labelPosition() === 'start'\"\n [attr.data-right]=\"labelPosition() === 'end'\"\n [attr.data-indeterminate]=\"indeterminate()\"\n [attr.data-value]=\"progress()\"\n [style.clip-path]=\"prevTrackClipPath()\">\n @if (indeterminate()) {\n <div [class]=\"indeterminateClasses()\" class=\"indeterminate\"></div>\n } @else if (labelVisible()) {\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 <span [class]=\"labelClasses()\" [style]=\"labelStyles()\">{{ progress() | number: \"1.0-2\" }}</span>\n }\n }\n</div>\n\n@if (!indeterminate()) {\n <div\n [class]=\"trackClasses()\"\n [attr.data-next]=\"true\"\n [attr.data-left]=\"labelPosition() === 'start'\"\n [attr.data-right]=\"labelPosition() === 'end'\"\n [style.clip-path]=\"nextTrackClipPath()\">\n @if (labelVisible()) {\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 <span [class]=\"labelClasses()\" [style]=\"labelStyles()\">{{ progress() | number: \"1.0-2\" }}</span>\n }\n }\n </div>\n}\n", styles: [".indeterminate{animation:indeterminate 16s linear infinite}@keyframes indeterminate{0%{background-position:0 0}to{background-position:100% 0}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: DecimalPipe, name: "number" }] }); }
|
|
268
227
|
}
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { computed, input, output, model, Component, Directive } from '@angular/core';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
7
6
|
import { cva } from 'class-variance-authority';
|
|
7
|
+
import { themeControlSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
focus:ring-2 focus:ring-primary focus:ring-offset-2
|
|
9
|
+
const radioButtonThemeVariants = cva(`
|
|
10
|
+
peer absolute inset-0 z-10 h-full w-full
|
|
11
|
+
cursor-pointer appearance-none opacity-0
|
|
12
|
+
outline-none
|
|
14
13
|
disabled:cursor-not-allowed
|
|
15
14
|
`);
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
bg-input-background
|
|
15
|
+
const radioButtonCircleThemeVariants = cva(`
|
|
16
|
+
relative flex h-4.5 w-4.5 items-center justify-center
|
|
17
|
+
cursor-pointer overflow-hidden
|
|
18
|
+
${themeControlSurfaceClasses}
|
|
21
19
|
border border-input-border
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
peer-
|
|
26
|
-
|
|
20
|
+
transition-colors duration-(--mona-motion-fast)
|
|
21
|
+
|
|
22
|
+
peer-disabled:cursor-not-allowed
|
|
23
|
+
peer-disabled:border-disabled-border peer-disabled:bg-disabled-background peer-disabled:text-disabled-foreground
|
|
24
|
+
|
|
25
|
+
peer-focus-visible:border-focus-indicator
|
|
26
|
+
peer-focus-visible:ring-2 peer-focus-visible:ring-focus-indicator/35
|
|
27
27
|
|
|
28
28
|
data-[invalid='true']:border-error
|
|
29
|
-
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/
|
|
29
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
30
|
+
data-[invalid='true']:peer-focus-visible:border-error
|
|
31
|
+
data-[invalid='true']:peer-focus-visible:ring-error/35
|
|
30
32
|
`, {
|
|
31
33
|
variants: {
|
|
32
34
|
rounded: {
|
|
@@ -38,8 +40,10 @@ const radioButtonCircleVariants = cva(`
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
});
|
|
41
|
-
const
|
|
42
|
-
flex
|
|
43
|
+
const radioButtonIndicatorThemeVariants = cva(`
|
|
44
|
+
flex h-3 w-3
|
|
45
|
+
bg-primary
|
|
46
|
+
transition-all duration-(--mona-motion-fast)
|
|
43
47
|
`, {
|
|
44
48
|
variants: {
|
|
45
49
|
rounded: {
|
|
@@ -51,13 +55,12 @@ const radioButtonIndicatorVariants = cva(`
|
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
});
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
relative
|
|
58
|
+
const radioButtonContainerLabelThemeVariants = cva(`
|
|
59
|
+
relative flex h-full w-full items-center justify-center gap-1
|
|
57
60
|
cursor-pointer
|
|
58
61
|
data-[disabled='true']:pointer-events-none
|
|
59
62
|
data-[disabled='true']:cursor-not-allowed
|
|
60
|
-
data-[disabled='true']:
|
|
63
|
+
data-[disabled='true']:text-disabled-foreground
|
|
61
64
|
`, {
|
|
62
65
|
variants: {
|
|
63
66
|
labelSize: {
|
|
@@ -70,30 +73,31 @@ const radioButtonContainerLabelVariants = cva(`
|
|
|
70
73
|
labelSize: "medium"
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
place-content-center
|
|
80
|
-
flex items-center justify-center
|
|
76
|
+
const radioButtonDirectiveThemeVariants = cva(`
|
|
77
|
+
relative flex h-4.5 w-4.5 items-center justify-center place-content-center
|
|
78
|
+
cursor-pointer appearance-none
|
|
79
|
+
${themeControlSurfaceClasses}
|
|
80
|
+
border border-input-border
|
|
81
|
+
outline-none
|
|
81
82
|
|
|
82
|
-
disabled:pointer-events-none
|
|
83
|
-
disabled:
|
|
84
|
-
disabled:opacity-50
|
|
83
|
+
disabled:pointer-events-none disabled:cursor-not-allowed
|
|
84
|
+
disabled:border-disabled-border disabled:bg-disabled-background disabled:text-disabled-foreground
|
|
85
85
|
|
|
86
|
-
after:content-['']
|
|
87
|
-
after:w-3 after:h-3
|
|
88
86
|
after:inline-grid
|
|
87
|
+
after:h-3 after:w-3
|
|
89
88
|
after:place-content-center
|
|
89
|
+
after:content-['']
|
|
90
90
|
|
|
91
91
|
checked:after:bg-primary
|
|
92
92
|
checked:after:rounded-full
|
|
93
93
|
|
|
94
|
-
focus-visible:
|
|
94
|
+
focus-visible:border-focus-indicator
|
|
95
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
95
96
|
|
|
96
97
|
[&.ng-touched.ng-invalid]:border-error
|
|
98
|
+
[&.ng-touched.ng-invalid]:ring-2 [&.ng-touched.ng-invalid]:ring-error/35
|
|
99
|
+
[&.ng-touched.ng-invalid]:focus-visible:border-error
|
|
100
|
+
[&.ng-touched.ng-invalid]:focus-visible:ring-error/35
|
|
97
101
|
`, {
|
|
98
102
|
variants: {
|
|
99
103
|
rounded: {
|
|
@@ -128,70 +132,25 @@ const radioButtonDirectiveVariants = cva(`
|
|
|
128
132
|
]
|
|
129
133
|
});
|
|
130
134
|
|
|
131
|
-
const radioButtonThemeVariants = (theme) => {
|
|
132
|
-
switch (theme) {
|
|
133
|
-
case "mona":
|
|
134
|
-
return radioButtonVariants;
|
|
135
|
-
default:
|
|
136
|
-
return radioButtonVariants; // Default to Mona styles
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
const radioButtonCircleThemeVariants = (theme) => {
|
|
140
|
-
switch (theme) {
|
|
141
|
-
case "mona":
|
|
142
|
-
return radioButtonCircleVariants;
|
|
143
|
-
default:
|
|
144
|
-
return radioButtonCircleVariants; // Default to Mona styles
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
const radioButtonIndicatorThemeVariants = (theme) => {
|
|
148
|
-
switch (theme) {
|
|
149
|
-
case "mona":
|
|
150
|
-
return radioButtonIndicatorVariants;
|
|
151
|
-
default:
|
|
152
|
-
return radioButtonIndicatorVariants; // Default to Mona styles
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
const radioButtonContainerLabelThemeVariants = (theme) => {
|
|
156
|
-
switch (theme) {
|
|
157
|
-
case "mona":
|
|
158
|
-
return radioButtonContainerLabelVariants;
|
|
159
|
-
default:
|
|
160
|
-
return radioButtonContainerLabelVariants; // Default to Mona styles
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
const radioButtonDirectiveThemeVariants = (theme) => {
|
|
164
|
-
switch (theme) {
|
|
165
|
-
case "mona":
|
|
166
|
-
return radioButtonDirectiveVariants;
|
|
167
|
-
default:
|
|
168
|
-
return radioButtonDirectiveVariants; // Default to Mona styles
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
135
|
class RadioButtonComponent {
|
|
173
136
|
constructor() {
|
|
174
|
-
this.#themeService = inject(ThemeService);
|
|
175
137
|
this.containerLabelClasses = computed(() => {
|
|
176
|
-
const theme = this.#themeService.theme();
|
|
177
138
|
const labelSize = this.labelSize();
|
|
178
139
|
const userClasses = this.userClass();
|
|
179
|
-
const variantClasses = radioButtonContainerLabelThemeVariants(
|
|
140
|
+
const variantClasses = radioButtonContainerLabelThemeVariants({ labelSize });
|
|
180
141
|
return twMerge(variantClasses, userClasses);
|
|
181
142
|
}, /* @ts-ignore */
|
|
182
143
|
...(ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []));
|
|
183
144
|
this.radioButtonCircleClasses = computed(() => {
|
|
184
|
-
const theme = this.#themeService.theme();
|
|
185
145
|
const rounded = this.rounded();
|
|
186
|
-
return radioButtonCircleThemeVariants(
|
|
146
|
+
return radioButtonCircleThemeVariants({ rounded });
|
|
187
147
|
}, /* @ts-ignore */
|
|
188
148
|
...(ngDevMode ? [{ debugName: "radioButtonCircleClasses" }] : /* istanbul ignore next */ []));
|
|
189
|
-
this.radioButtonClasses = computed(() => radioButtonThemeVariants(
|
|
149
|
+
this.radioButtonClasses = computed(() => radioButtonThemeVariants(), /* @ts-ignore */
|
|
190
150
|
...(ngDevMode ? [{ debugName: "radioButtonClasses" }] : /* istanbul ignore next */ []));
|
|
191
151
|
this.radioButtonIndicatorClasses = computed(() => {
|
|
192
|
-
const theme = this.#themeService.theme();
|
|
193
152
|
const rounded = this.rounded();
|
|
194
|
-
return radioButtonIndicatorThemeVariants(
|
|
153
|
+
return radioButtonIndicatorThemeVariants({ rounded });
|
|
195
154
|
}, /* @ts-ignore */
|
|
196
155
|
...(ngDevMode ? [{ debugName: "radioButtonIndicatorClasses" }] : /* istanbul ignore next */ []));
|
|
197
156
|
/**
|
|
@@ -276,7 +235,6 @@ class RadioButtonComponent {
|
|
|
276
235
|
this.value = model(undefined, /* @ts-ignore */
|
|
277
236
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
278
237
|
}
|
|
279
|
-
#themeService;
|
|
280
238
|
onBlur(event) {
|
|
281
239
|
this.inputBlur.emit(event);
|
|
282
240
|
this.touch.emit();
|
|
@@ -298,11 +256,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
298
256
|
|
|
299
257
|
class RadioButtonDirective {
|
|
300
258
|
constructor() {
|
|
301
|
-
this.#themeService = inject(ThemeService);
|
|
302
259
|
this.classes = computed(() => {
|
|
303
|
-
const theme = this.#themeService.theme();
|
|
304
260
|
const rounded = this.rounded();
|
|
305
|
-
return radioButtonDirectiveThemeVariants(
|
|
261
|
+
return radioButtonDirectiveThemeVariants({ rounded });
|
|
306
262
|
}, /* @ts-ignore */
|
|
307
263
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
308
264
|
/**
|
|
@@ -312,7 +268,6 @@ class RadioButtonDirective {
|
|
|
312
268
|
this.rounded = input("none", /* @ts-ignore */
|
|
313
269
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
314
270
|
}
|
|
315
|
-
#themeService;
|
|
316
271
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RadioButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
317
272
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: RadioButtonDirective, isStandalone: true, selector: "input[type='radio'][monaRadioButton]", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "'radio'" } }, ngImport: i0 }); }
|
|
318
273
|
}
|