@nanahoshi/mona-ui 0.45.1 → 0.46.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/THIRD_PARTY_NOTICES.md +34 -0
- package/docs/api/index.json +1 -1
- package/docs/api/theme.json +1 -1
- package/docs/api/theme.md +14 -6
- package/docs/installation.md +1 -1
- package/docs/manifest.json +1 -1
- package/docs/theming-built-in-themes.md +25 -12
- package/docs/theming-custom-themes.md +19 -0
- package/docs/theming.md +2 -1
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +6 -6
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-chat.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +6 -6
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-date-range-picker.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-masked-text-box.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +94 -16
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +6 -6
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +6 -6
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +295 -51
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-chat.d.ts +1 -1
- package/types/nanahoshi-mona-ui-theme.d.ts +71 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from "@angular/common";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import { Component, DOCUMENT as DOCUMENT$1, DestroyRef, Directive, ElementRef, TemplateRef, afterNextRender, computed, contentChild, contentChildren, effect, forwardRef, inject, input, isSignal, model, output, signal, untracked } from "@angular/core";
|
|
3
|
+
import { Component, DOCUMENT as DOCUMENT$1, DestroyRef, Directive, ElementRef, NgZone, TemplateRef, afterNextRender, computed, contentChild, contentChildren, effect, forwardRef, inject, input, isSignal, model, output, signal, untracked } from "@angular/core";
|
|
4
4
|
import { LucideCheck, LucideChevronRight } from "@lucide/angular";
|
|
5
5
|
import { PreventableEvent, classInputToClass } from "@nanahoshi/mona-ui/common";
|
|
6
6
|
import { injectComponentDirection } from "@nanahoshi/mona-ui/i18n";
|
|
@@ -37,6 +37,15 @@ const groupPopupMenuItems = (items) => {
|
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
+
const isPointInTriangle = (point, a, b, c) => {
|
|
41
|
+
const side = (from, to) => (point.x - to.x) * (from.y - to.y) - (from.x - to.x) * (point.y - to.y);
|
|
42
|
+
const sides = [
|
|
43
|
+
side(a, b),
|
|
44
|
+
side(b, c),
|
|
45
|
+
side(c, a)
|
|
46
|
+
];
|
|
47
|
+
return !(sides.some((s) => s < 0) && sides.some((s) => s > 0));
|
|
48
|
+
};
|
|
40
49
|
const isMenuOwnedCheckState = (item) => {
|
|
41
50
|
return item.checkable === true && isSignal(item.checked) && "set" in item.checked;
|
|
42
51
|
};
|
|
@@ -87,7 +96,8 @@ const popupMenuItemThemeVariants = cva(`
|
|
|
87
96
|
}
|
|
88
97
|
} });
|
|
89
98
|
const popupMenuLinkThemeVariants = cva(`flex items-center justify-center`);
|
|
90
|
-
const
|
|
99
|
+
const SUBMENU_AIM_REST_DELAY = 100;
|
|
100
|
+
const SUBMENU_AIM_TOLERANCE = 20;
|
|
91
101
|
var PopupMenuListComponent = class PopupMenuListComponent {
|
|
92
102
|
#childCloseRequest$;
|
|
93
103
|
#destroyRef;
|
|
@@ -100,9 +110,12 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
100
110
|
#popupService;
|
|
101
111
|
#submenuId;
|
|
102
112
|
#typeaheadKey$;
|
|
113
|
+
#zone;
|
|
103
114
|
#childClose$;
|
|
104
115
|
#closing;
|
|
105
116
|
#hoverTimer;
|
|
117
|
+
#pendingHover;
|
|
118
|
+
#pointerTrail;
|
|
106
119
|
constructor() {
|
|
107
120
|
this.#childCloseRequest$ = new Subject();
|
|
108
121
|
this.#destroyRef = inject(DestroyRef);
|
|
@@ -118,8 +131,11 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
118
131
|
this.#popupService = inject(PopupService);
|
|
119
132
|
this.#submenuId = signal(null, ...ngDevMode ? [{ debugName: "#submenuId" }] : /* istanbul ignore next */ []);
|
|
120
133
|
this.#typeaheadKey$ = new Subject();
|
|
134
|
+
this.#zone = inject(NgZone);
|
|
121
135
|
this.#childClose$ = null;
|
|
122
136
|
this.#closing = false;
|
|
137
|
+
this.#pendingHover = null;
|
|
138
|
+
this.#pointerTrail = [];
|
|
123
139
|
this.activeMenuItem = signal(null, ...ngDevMode ? [{ debugName: "activeMenuItem" }] : /* istanbul ignore next */ []);
|
|
124
140
|
this.ariaLabel = this.#parentConfig.ariaLabel || null;
|
|
125
141
|
this.baseClasses = computed(() => {
|
|
@@ -191,7 +207,6 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
191
207
|
});
|
|
192
208
|
});
|
|
193
209
|
this.#destroyRef.onDestroy(() => {
|
|
194
|
-
clearTimeout(this.#hoverTimer);
|
|
195
210
|
this.#closing = true;
|
|
196
211
|
this.closePopup();
|
|
197
212
|
});
|
|
@@ -215,6 +230,10 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
215
230
|
onHostPointerEnter() {
|
|
216
231
|
this.#parentConfig.submenuPointerEnter?.();
|
|
217
232
|
}
|
|
233
|
+
onHostPointerLeave() {
|
|
234
|
+
this.cancelPendingHover();
|
|
235
|
+
this.#pointerTrail = [];
|
|
236
|
+
}
|
|
218
237
|
onItemClick(event, item) {
|
|
219
238
|
if (item.disabled) return;
|
|
220
239
|
if (item.items.length > 0) {
|
|
@@ -227,24 +246,37 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
227
246
|
this.#parentConfig.menuItemClick$.next(popupMenuItemClickEvent);
|
|
228
247
|
}
|
|
229
248
|
onItemPointerEnter(event, item) {
|
|
230
|
-
|
|
249
|
+
this.cancelPendingHover();
|
|
231
250
|
const open = this.#openSubmenuItem();
|
|
232
251
|
if (open === item) {
|
|
233
252
|
this.activeMenuItem.set(item);
|
|
234
253
|
return;
|
|
235
254
|
}
|
|
236
255
|
const target = event.currentTarget;
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
256
|
+
if (open && event.pointerType !== "touch" && this.isHeadingToSubmenu({
|
|
257
|
+
x: event.clientX,
|
|
258
|
+
y: event.clientY
|
|
259
|
+
})) {
|
|
260
|
+
this.#pendingHover = {
|
|
261
|
+
item,
|
|
262
|
+
target
|
|
263
|
+
};
|
|
264
|
+
this.restartRestTimer();
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
this.hoverItem(item, target);
|
|
268
|
+
}
|
|
269
|
+
applyPendingHover() {
|
|
270
|
+
const pending = this.#pendingHover;
|
|
271
|
+
this.cancelPendingHover();
|
|
272
|
+
if (pending) this.hoverItem(pending.item, pending.target);
|
|
273
|
+
}
|
|
274
|
+
cancelPendingHover() {
|
|
275
|
+
clearTimeout(this.#hoverTimer);
|
|
276
|
+
this.#pendingHover = null;
|
|
246
277
|
}
|
|
247
278
|
closePopup() {
|
|
279
|
+
this.cancelPendingHover();
|
|
248
280
|
const ref = this.popupRef;
|
|
249
281
|
this.popupRef = null;
|
|
250
282
|
this.#openSubmenuItem.set(null);
|
|
@@ -418,6 +450,30 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
418
450
|
handleTypeaheadKey(event) {
|
|
419
451
|
this.#typeaheadKey$.next(event.key);
|
|
420
452
|
}
|
|
453
|
+
hoverItem(item, target) {
|
|
454
|
+
this.closePopup();
|
|
455
|
+
if (item.items.length > 0 && !item.disabled) {
|
|
456
|
+
this.activeMenuItem.set(item);
|
|
457
|
+
this.createSubmenu(target, false, item);
|
|
458
|
+
} else this.activeMenuItem.set(null);
|
|
459
|
+
}
|
|
460
|
+
isHeadingToSubmenu(position) {
|
|
461
|
+
const origin = this.#pointerTrail[0];
|
|
462
|
+
const submenuId = this.#submenuId();
|
|
463
|
+
const submenu = submenuId ? this.#document.getElementById(submenuId) : null;
|
|
464
|
+
const menu = this.#menuElement();
|
|
465
|
+
if (!origin || !submenu || !menu || origin.x === position.x && origin.y === position.y) return false;
|
|
466
|
+
const menuRect = menu.getBoundingClientRect();
|
|
467
|
+
const submenuRect = submenu.getBoundingClientRect();
|
|
468
|
+
const edge = submenuRect.left + submenuRect.width / 2 >= menuRect.left + menuRect.width / 2 ? submenuRect.left : submenuRect.right;
|
|
469
|
+
return isPointInTriangle(position, origin, {
|
|
470
|
+
x: edge,
|
|
471
|
+
y: submenuRect.top - SUBMENU_AIM_TOLERANCE
|
|
472
|
+
}, {
|
|
473
|
+
x: edge,
|
|
474
|
+
y: submenuRect.bottom + SUBMENU_AIM_TOLERANCE
|
|
475
|
+
});
|
|
476
|
+
}
|
|
421
477
|
notifyNavigation(item, direction) {
|
|
422
478
|
this.#parentConfig.navigate$.next({
|
|
423
479
|
direction,
|
|
@@ -425,8 +481,18 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
425
481
|
level: this.#parentConfig.level
|
|
426
482
|
});
|
|
427
483
|
}
|
|
484
|
+
onPointerMove(event) {
|
|
485
|
+
const position = {
|
|
486
|
+
x: event.clientX,
|
|
487
|
+
y: event.clientY
|
|
488
|
+
};
|
|
489
|
+
this.#pointerTrail = [...this.#pointerTrail.slice(-2), position];
|
|
490
|
+
if (!this.#pendingHover) return;
|
|
491
|
+
if (this.isHeadingToSubmenu(position)) this.restartRestTimer();
|
|
492
|
+
else this.#zone.run(() => this.applyPendingHover());
|
|
493
|
+
}
|
|
428
494
|
onSubmenuPointerEnter() {
|
|
429
|
-
|
|
495
|
+
this.cancelPendingHover();
|
|
430
496
|
const open = this.#openSubmenuItem();
|
|
431
497
|
if (open) this.activeMenuItem.set(open);
|
|
432
498
|
}
|
|
@@ -463,6 +529,10 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
463
529
|
const active = this.#document.activeElement;
|
|
464
530
|
if (active && !this.#host.nativeElement.contains(active) && active.closest("mona-popup-menu-list")) this.#menuElement()?.focus();
|
|
465
531
|
}
|
|
532
|
+
restartRestTimer() {
|
|
533
|
+
clearTimeout(this.#hoverTimer);
|
|
534
|
+
this.#hoverTimer = setTimeout(() => this.#zone.run(() => this.applyPendingHover()), SUBMENU_AIM_REST_DELAY);
|
|
535
|
+
}
|
|
466
536
|
setKeyboardEvents() {
|
|
467
537
|
const element = this.#menuElement();
|
|
468
538
|
if (!element) return;
|
|
@@ -478,6 +548,11 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
478
548
|
}
|
|
479
549
|
})).subscribe();
|
|
480
550
|
}
|
|
551
|
+
setPointerSubscription() {
|
|
552
|
+
this.#zone.runOutsideAngular(() => {
|
|
553
|
+
fromEvent(this.#host.nativeElement, "pointermove").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => this.onPointerMove(event));
|
|
554
|
+
});
|
|
555
|
+
}
|
|
481
556
|
setPopupCloseSubscription() {
|
|
482
557
|
this.#parentConfig.parentClose$.pipe(takeUntilDestroyed(this.#destroyRef), tap(() => {
|
|
483
558
|
this.#closing = true;
|
|
@@ -492,6 +567,7 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
492
567
|
}
|
|
493
568
|
setSubscriptions() {
|
|
494
569
|
this.setKeyboardEvents();
|
|
570
|
+
this.setPointerSubscription();
|
|
495
571
|
this.setPopupCloseSubscription();
|
|
496
572
|
this.setTypeaheadSubscription();
|
|
497
573
|
}
|
|
@@ -518,7 +594,8 @@ var PopupMenuListComponent = class PopupMenuListComponent {
|
|
|
518
594
|
host: {
|
|
519
595
|
listeners: {
|
|
520
596
|
"focusout": "onFocusOut($event)",
|
|
521
|
-
"pointerenter": "onHostPointerEnter()"
|
|
597
|
+
"pointerenter": "onHostPointerEnter()",
|
|
598
|
+
"pointerleave": "onHostPointerLeave()"
|
|
522
599
|
},
|
|
523
600
|
properties: { "class": "baseClasses()" }
|
|
524
601
|
},
|
|
@@ -566,7 +643,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
566
643
|
host: {
|
|
567
644
|
"[class]": "baseClasses()",
|
|
568
645
|
"(focusout)": "onFocusOut($event)",
|
|
569
|
-
"(pointerenter)": "onHostPointerEnter()"
|
|
646
|
+
"(pointerenter)": "onHostPointerEnter()",
|
|
647
|
+
"(pointerleave)": "onHostPointerLeave()"
|
|
570
648
|
},
|
|
571
649
|
template: "<div\n role=\"menu\"\n [attr.tabindex]=\"0\"\n [attr.aria-orientation]=\"'vertical'\"\n [attr.aria-activedescendant]=\"activeMenuItem()?.uid\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.id]=\"menuId()\"\n [class]=\"containerClasses()\">\n @for (group of menuItems(); track $index) {\n @if (group.title) {\n @let groupTemplate = group.items[0]?.groupTemplate?.() ?? popupGroupTemplate() ?? null;\n <div role=\"group\" [attr.aria-labelledby]=\"group.labelId\">\n <div [id]=\"group.labelId\" role=\"presentation\" [class]=\"groupHeaderClasses()\">\n @if (groupTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.title }\"></ng-container>\n } @else {\n <span>{{ group.title }}</span>\n }\n </div>\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n </div>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n }\n }\n</div>\n\n<ng-template #itemsTemplate let-items>\n @for (item of asItems(items); track $index) {\n @if (item.separator) {\n <div role=\"separator\" class=\"bg-border my-1 h-px\"></div>\n } @else {\n @let iconTemplate = item.iconTemplate?.() ?? popupIconTemplate() ?? null;\n @let shortcutTemplate = item.shortcutTemplate?.() ?? popupShortcutTemplate() ?? null;\n @let textTemplate = item.textTemplate?.() ?? popupTextTemplate() ?? null;\n <div\n [attr.role]=\"item.checkable ? 'menuitemcheckbox' : item.radio ? 'menuitemradio' : 'menuitem'\"\n [attr.aria-checked]=\"item.checkable ? !!item.checked?.() : item.radio ? !!item.selected?.() : null\"\n [id]=\"item.uid\"\n (pointerenter)=\"onItemPointerEnter($event, item)\"\n (click)=\"onItemClick($event, item)\"\n [attr.data-active]=\"item === activeMenuItem()\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-expanded]=\"item.items.length > 0 ? item === openSubmenuItem() : null\"\n [attr.aria-controls]=\"item === openSubmenuItem() ? submenuId() : null\"\n [attr.aria-haspopup]=\"item.items.length > 0 ? 'menu' : null\"\n [attr.aria-label]=\"textTemplate ? null : item.label || null\"\n [attr.data-disabled]=\"item.disabled\"\n [class]=\"menuItemClasses()\">\n @if (iconAreaVisible()) {\n <div [class]=\"iconContainerClasses()\">\n @if (!item.checkable && !item.radio) {\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else if (item.checkable) {\n @if (item.checked?.()) {\n <svg lucideCheck [size]=\"14\"></svg>\n }\n } @else if (item.radio) {\n @if (item.selected?.()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-circle size-2 fill-current\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n }\n }\n </div>\n }\n <div class=\"flex-1\">\n @if (textTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"textTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n {{ item.label }}\n }\n </div>\n @if (item.items.length > 0) {\n @if (!item.checkable) {\n <div [class]=\"linkContainerClasses()\">\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n </div>\n }\n } @else if (shortcutTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </div>\n }\n }\n</ng-template>\n"
|
|
572
650
|
}]
|
|
@@ -26,13 +26,13 @@ const radioButtonCircleThemeVariants = cva(`
|
|
|
26
26
|
peer-disabled:border-disabled-border peer-disabled:bg-disabled-background peer-disabled:text-disabled-foreground
|
|
27
27
|
|
|
28
28
|
peer-focus-visible:border-focus-indicator
|
|
29
|
-
peer-focus-visible:ring-
|
|
29
|
+
peer-focus-visible:ring-(length:--mona-focus-ring-width,2px) peer-focus-visible:ring-focus-indicator/(--mona-focus-ring-opacity,35%)
|
|
30
30
|
peer-focus-visible:outline-hidden
|
|
31
31
|
|
|
32
32
|
data-[invalid='true']:border-error
|
|
33
|
-
data-[invalid='true']:ring-
|
|
33
|
+
data-[invalid='true']:ring-(length:--mona-focus-ring-width,2px) data-[invalid='true']:ring-error/(--mona-focus-ring-opacity,35%)
|
|
34
34
|
data-[invalid='true']:peer-focus-visible:border-error
|
|
35
|
-
data-[invalid='true']:peer-focus-visible:ring-error/35
|
|
35
|
+
data-[invalid='true']:peer-focus-visible:ring-error/(--mona-focus-ring-opacity,35%)
|
|
36
36
|
`, { variants: { rounded: {
|
|
37
37
|
full: "rounded-full",
|
|
38
38
|
large: "rounded-lg",
|
|
@@ -88,12 +88,12 @@ const radioButtonDirectiveThemeVariants = cva(`
|
|
|
88
88
|
checked:after:rounded-full
|
|
89
89
|
|
|
90
90
|
focus-visible:border-focus-indicator
|
|
91
|
-
focus-visible:ring-
|
|
91
|
+
focus-visible:ring-(length:--mona-focus-ring-width,2px) focus-visible:ring-focus-indicator/(--mona-focus-ring-opacity,35%)
|
|
92
92
|
|
|
93
93
|
data-[invalid='true']:border-error
|
|
94
|
-
data-[invalid='true']:ring-
|
|
94
|
+
data-[invalid='true']:ring-(length:--mona-focus-ring-width,2px) data-[invalid='true']:ring-error/(--mona-focus-ring-opacity,35%)
|
|
95
95
|
data-[invalid='true']:focus-visible:border-error
|
|
96
|
-
data-[invalid='true']:focus-visible:ring-error/35
|
|
96
|
+
data-[invalid='true']:focus-visible:ring-error/(--mona-focus-ring-opacity,35%)
|
|
97
97
|
`, {
|
|
98
98
|
variants: { rounded: {
|
|
99
99
|
full: "rounded-full",
|
|
@@ -68,7 +68,7 @@ const segmentedContainerThemeVariants = cva(`
|
|
|
68
68
|
border border-input-border
|
|
69
69
|
p-1
|
|
70
70
|
data-[invalid='true']:border-error
|
|
71
|
-
data-[invalid='true']:ring-
|
|
71
|
+
data-[invalid='true']:ring-(length:--mona-focus-ring-width,2px) data-[invalid='true']:ring-error/(--mona-focus-ring-opacity,35%)
|
|
72
72
|
data-[readonly='true']:[&_*]:cursor-default
|
|
73
73
|
transition-colors duration-(--mona-motion-fast)
|
|
74
74
|
`, {
|
|
@@ -316,13 +316,13 @@ const sliderHandleThemeVariants = cva(`
|
|
|
316
316
|
data-[orientation="vertical"]:data-[dragging="true"]:transition-none
|
|
317
317
|
|
|
318
318
|
data-[focused="true"]:border-focus-indicator
|
|
319
|
-
data-[focused="true"]:ring-
|
|
320
|
-
data-[focused="true"]:ring-focus-indicator/35
|
|
319
|
+
data-[focused="true"]:ring-(length:--mona-focus-ring-width,2px)
|
|
320
|
+
data-[focused="true"]:ring-focus-indicator/(--mona-focus-ring-opacity,35%)
|
|
321
321
|
|
|
322
322
|
data-[invalid="true"]:border-error
|
|
323
|
-
data-[invalid="true"]:ring-
|
|
323
|
+
data-[invalid="true"]:ring-(length:--mona-focus-ring-width,2px) data-[invalid="true"]:ring-error/(--mona-focus-ring-opacity,35%)
|
|
324
324
|
data-[invalid="true"]:data-[focused="true"]:border-error
|
|
325
|
-
data-[invalid="true"]:data-[focused="true"]:ring-error/35
|
|
325
|
+
data-[invalid="true"]:data-[focused="true"]:ring-error/(--mona-focus-ring-opacity,35%)
|
|
326
326
|
`, { variants: { rounded: {
|
|
327
327
|
full: "rounded-full",
|
|
328
328
|
large: "rounded-lg",
|
|
@@ -130,12 +130,12 @@ const switchThemeVariants = cva(`
|
|
|
130
130
|
data-[disabled='true']:data-[active='true']:bg-disabled-background
|
|
131
131
|
|
|
132
132
|
focus-visible:border-focus-indicator
|
|
133
|
-
focus-visible:ring-
|
|
133
|
+
focus-visible:ring-(length:--mona-focus-ring-width,2px) focus-visible:ring-focus-indicator/(--mona-focus-ring-opacity,35%)
|
|
134
134
|
|
|
135
135
|
data-[invalid='true']:border-error
|
|
136
|
-
data-[invalid='true']:ring-
|
|
136
|
+
data-[invalid='true']:ring-(length:--mona-focus-ring-width,2px) data-[invalid='true']:ring-error/(--mona-focus-ring-opacity,35%)
|
|
137
137
|
data-[invalid='true']:focus-visible:border-error
|
|
138
|
-
data-[invalid='true']:focus-visible:ring-error/35
|
|
138
|
+
data-[invalid='true']:focus-visible:ring-error/(--mona-focus-ring-opacity,35%)
|
|
139
139
|
`, { variants: {
|
|
140
140
|
rounded: {
|
|
141
141
|
full: "rounded-full",
|
|
@@ -19,12 +19,12 @@ const textAreaThemeVariants = cva(`
|
|
|
19
19
|
read-only:cursor-default
|
|
20
20
|
|
|
21
21
|
focus-visible:border-focus-indicator
|
|
22
|
-
focus-visible:ring-
|
|
22
|
+
focus-visible:ring-(length:--mona-focus-ring-width,2px) focus-visible:ring-focus-indicator/(--mona-focus-ring-opacity,35%)
|
|
23
23
|
|
|
24
24
|
data-[invalid='true']:border-error
|
|
25
|
-
data-[invalid='true']:ring-
|
|
25
|
+
data-[invalid='true']:ring-(length:--mona-focus-ring-width,2px) data-[invalid='true']:ring-error/(--mona-focus-ring-opacity,35%)
|
|
26
26
|
data-[invalid='true']:focus-visible:border-error
|
|
27
|
-
data-[invalid='true']:focus-visible:ring-error/35
|
|
27
|
+
data-[invalid='true']:focus-visible:ring-error/(--mona-focus-ring-opacity,35%)
|
|
28
28
|
`, { variants: { rounded: {
|
|
29
29
|
large: "rounded-lg",
|
|
30
30
|
medium: "rounded-md",
|
|
@@ -90,12 +90,12 @@ const textBoxThemeVariants = cva(`
|
|
|
90
90
|
data-[readonly='true']:cursor-default
|
|
91
91
|
|
|
92
92
|
focus-within:border-focus-indicator
|
|
93
|
-
focus-within:ring-
|
|
93
|
+
focus-within:ring-(length:--mona-focus-ring-width,2px) focus-within:ring-focus-indicator/(--mona-focus-ring-opacity,35%)
|
|
94
94
|
|
|
95
95
|
data-[invalid='true']:border-error
|
|
96
|
-
data-[invalid='true']:ring-
|
|
96
|
+
data-[invalid='true']:ring-(length:--mona-focus-ring-width,2px) data-[invalid='true']:ring-error/(--mona-focus-ring-opacity,35%)
|
|
97
97
|
data-[invalid='true']:focus-within:border-error
|
|
98
|
-
data-[invalid='true']:focus-within:ring-error/35
|
|
98
|
+
data-[invalid='true']:focus-within:ring-error/(--mona-focus-ring-opacity,35%)
|
|
99
99
|
|
|
100
100
|
[&>input]:h-full [&>input]:w-full
|
|
101
101
|
[&>input]:px-2
|
|
@@ -135,12 +135,12 @@ const inputThemeVariants = cva(`
|
|
|
135
135
|
read-only:cursor-default
|
|
136
136
|
|
|
137
137
|
focus-visible:border-focus-indicator
|
|
138
|
-
focus-visible:ring-
|
|
138
|
+
focus-visible:ring-(length:--mona-focus-ring-width,2px) focus-visible:ring-focus-indicator/(--mona-focus-ring-opacity,35%)
|
|
139
139
|
|
|
140
140
|
data-[invalid='true']:border-error
|
|
141
|
-
data-[invalid='true']:ring-
|
|
141
|
+
data-[invalid='true']:ring-(length:--mona-focus-ring-width,2px) data-[invalid='true']:ring-error/(--mona-focus-ring-opacity,35%)
|
|
142
142
|
data-[invalid='true']:focus-visible:border-error
|
|
143
|
-
data-[invalid='true']:focus-visible:ring-error/35
|
|
143
|
+
data-[invalid='true']:focus-visible:ring-error/(--mona-focus-ring-opacity,35%)
|
|
144
144
|
`, { variants: {
|
|
145
145
|
rounded: {
|
|
146
146
|
full: "rounded-full px-4",
|