@nanahoshi/mona-ui 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -11
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -17
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-button.mjs +109 -107
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +53 -53
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +80 -80
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +98 -98
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +38 -38
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +25 -25
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +41 -37
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +17 -19
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +6 -6
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +11 -13
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +18 -20
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -40
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +14 -16
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +52 -52
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +462 -81
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +8 -8
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.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-DZk18LJC.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs +128 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs} +13 -13
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs +240 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs} +120 -120
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +81 -81
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +35 -35
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +8 -8
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +7 -7
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -50
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -14
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -24
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +69 -69
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +12 -12
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +55 -55
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +49 -49
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +96 -96
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +30 -30
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +24 -24
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +42 -42
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -39
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +22 -22
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +54 -54
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +11 -19
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +51 -51
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-window.mjs +27 -28
- package/package.json +30 -5
- package/types/nanahoshi-mona-ui-button.d.ts +4 -3
- package/types/nanahoshi-mona-ui-color-picker.d.ts +0 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +2 -2
- package/types/nanahoshi-mona-ui-editor.d.ts +17 -17
- package/types/nanahoshi-mona-ui-fieldset.d.ts +1 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +2 -2
- package/types/nanahoshi-mona-ui-grid.d.ts +3 -3
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
- package/types/nanahoshi-mona-ui-menubar.d.ts +2 -2
- package/types/nanahoshi-mona-ui-stepper.d.ts +2 -2
- package/types/nanahoshi-mona-ui-tabs.d.ts +2 -2
- 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
|
@@ -16,12 +16,12 @@ import { Subject, filter, debounceTime, identity, take, tap } from 'rxjs';
|
|
|
16
16
|
import { twMerge } from 'tailwind-merge';
|
|
17
17
|
import { cva } from 'class-variance-authority';
|
|
18
18
|
|
|
19
|
-
const autoCompleteBaseVariants = cva(`
|
|
20
|
-
flex
|
|
21
|
-
border border-input-border outline-none
|
|
22
|
-
bg-background shadow-xs
|
|
23
|
-
focus-within:ring-1 focus-within:ring-primary/40
|
|
24
|
-
transition-[color,box-shadow,border] ease-in-out duration-300
|
|
19
|
+
const autoCompleteBaseVariants = cva(`
|
|
20
|
+
flex
|
|
21
|
+
border border-input-border outline-none
|
|
22
|
+
bg-background shadow-xs text-foreground
|
|
23
|
+
focus-within:ring-1 focus-within:ring-primary/40
|
|
24
|
+
transition-[color,box-shadow,border] ease-in-out duration-300
|
|
25
25
|
`, {
|
|
26
26
|
variants: {
|
|
27
27
|
disabled: {
|
|
@@ -58,11 +58,11 @@ const autoCompleteBaseVariants = cva(`
|
|
|
58
58
|
size: "medium"
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
const autoCompleteTextInputVariants = cva(`
|
|
62
|
-
border-none outline-none
|
|
63
|
-
bg-transparent shadow-none
|
|
64
|
-
px-2 h-full w-full text-ellipsis
|
|
65
|
-
focus-within:ring-0 focus-visible:ring-0
|
|
61
|
+
const autoCompleteTextInputVariants = cva(`
|
|
62
|
+
border-none outline-none
|
|
63
|
+
bg-transparent shadow-none
|
|
64
|
+
px-2 h-full w-full text-ellipsis
|
|
65
|
+
focus-within:ring-0 focus-visible:ring-0
|
|
66
66
|
`, {
|
|
67
67
|
variants: {
|
|
68
68
|
rounded: {
|
|
@@ -6,10 +6,10 @@ import { twMerge } from 'tailwind-merge';
|
|
|
6
6
|
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
|
|
9
|
-
const breadcrumbListVariants = cva(`
|
|
10
|
-
flex items-center
|
|
11
|
-
overflow-hidden gap-1
|
|
12
|
-
list-none select-none py-1 px-2
|
|
9
|
+
const breadcrumbListVariants = cva(`
|
|
10
|
+
flex items-center
|
|
11
|
+
overflow-hidden gap-1
|
|
12
|
+
list-none select-none py-1 px-2
|
|
13
13
|
`, {
|
|
14
14
|
variants: {
|
|
15
15
|
disabled: {
|
|
@@ -18,15 +18,15 @@ const breadcrumbListVariants = cva(`
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
|
-
const breadcrumbListItemVariants = cva(`
|
|
22
|
-
flex items-center
|
|
23
|
-
truncate cursor-pointer
|
|
24
|
-
h-full text-primary/70
|
|
25
|
-
bg-transparent border-0
|
|
26
|
-
outline-none rounded-sm px-1
|
|
27
|
-
hover:text-primary
|
|
28
|
-
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40
|
|
29
|
-
transition-colors duration-100 ease-in-out
|
|
21
|
+
const breadcrumbListItemVariants = cva(`
|
|
22
|
+
flex items-center
|
|
23
|
+
truncate cursor-pointer
|
|
24
|
+
h-full text-primary/70
|
|
25
|
+
bg-transparent border-0
|
|
26
|
+
outline-none rounded-sm px-1
|
|
27
|
+
hover:text-primary
|
|
28
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40
|
|
29
|
+
transition-colors duration-100 ease-in-out
|
|
30
30
|
`, {
|
|
31
31
|
variants: {
|
|
32
32
|
disabled: {
|
|
@@ -144,11 +144,11 @@ class BreadcrumbItemComponent {
|
|
|
144
144
|
...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
145
145
|
}
|
|
146
146
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
147
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: BreadcrumbItemComponent, isStandalone: true, selector: "mona-breadcrumb-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\
|
|
147
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: BreadcrumbItemComponent, isStandalone: true, selector: "mona-breadcrumb-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }); }
|
|
148
148
|
}
|
|
149
149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemComponent, decorators: [{
|
|
150
150
|
type: Component,
|
|
151
|
-
args: [{ selector: "mona-breadcrumb-item", template: "<ng-template>\
|
|
151
|
+
args: [{ selector: "mona-breadcrumb-item", template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }]
|
|
152
152
|
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], templateRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
153
153
|
|
|
154
154
|
class BreadcrumbComponent {
|
|
@@ -196,14 +196,14 @@ class BreadcrumbComponent {
|
|
|
196
196
|
item.itemClick.emit();
|
|
197
197
|
}
|
|
198
198
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
199
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: BreadcrumbComponent, isStandalone: true, selector: "mona-breadcrumb", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "ariaLabel()" } }, queries: [{ propertyName: "itemComponents", predicate: BreadcrumbItemComponent, isSignal: true }, { propertyName: "separatorTemplate", first: true, predicate: BreadcrumbSeparatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<ol role=\"list\" [class]=\"listClass()\">\
|
|
199
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: BreadcrumbComponent, isStandalone: true, selector: "mona-breadcrumb", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "ariaLabel()" } }, queries: [{ propertyName: "itemComponents", predicate: BreadcrumbItemComponent, isSignal: true }, { propertyName: "separatorTemplate", first: true, predicate: BreadcrumbSeparatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<ol role=\"list\" [class]=\"listClass()\">\n @for (item of itemComponents(); track item) {\n <li>\n @if ($last) {\n <span aria-current=\"page\" [class]=\"currentItemClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n } @else {\n <button\n type=\"button\"\n monaBreadcrumbItem\n [disabled]=\"disabled() || item.disabled()\"\n (click)=\"onItemClick(item)\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </button>\n }\n </li>\n\n @if (!$last) {\n <li aria-hidden=\"true\" role=\"presentation\">\n @if (separatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"separatorTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: $index }\"></ng-container>\n } @else {\n <svg lucideChevronRight [size]=\"18\"></svg>\n }\n </li>\n }\n }\n</ol>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: BreadcrumbItemDirective, selector: "button[monaBreadcrumbItem]", inputs: ["disabled", "listDisabled", "class"] }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }] }); }
|
|
200
200
|
}
|
|
201
201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
202
202
|
type: Component,
|
|
203
203
|
args: [{ selector: "mona-breadcrumb", imports: [NgTemplateOutlet, BreadcrumbItemDirective, LucideChevronRight], host: {
|
|
204
204
|
role: "navigation",
|
|
205
205
|
"[attr.aria-label]": "ariaLabel()"
|
|
206
|
-
}, template: "<ol role=\"list\" [class]=\"listClass()\">\
|
|
206
|
+
}, template: "<ol role=\"list\" [class]=\"listClass()\">\n @for (item of itemComponents(); track item) {\n <li>\n @if ($last) {\n <span aria-current=\"page\" [class]=\"currentItemClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n } @else {\n <button\n type=\"button\"\n monaBreadcrumbItem\n [disabled]=\"disabled() || item.disabled()\"\n (click)=\"onItemClick(item)\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </button>\n }\n </li>\n\n @if (!$last) {\n <li aria-hidden=\"true\" role=\"presentation\">\n @if (separatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"separatorTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: $index }\"></ng-container>\n } @else {\n <svg lucideChevronRight [size]=\"18\"></svg>\n }\n </li>\n }\n }\n</ol>\n" }]
|
|
207
207
|
}], propDecorators: { itemComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BreadcrumbItemComponent), { isSignal: true }] }], separatorTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BreadcrumbSeparatorTemplateDirective), { ...{
|
|
208
208
|
read: TemplateRef
|
|
209
209
|
}, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
@@ -7,14 +7,14 @@ import { map, pairwise } from 'rxjs';
|
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
|
|
10
|
-
const buttonGroupVariants = cva(`
|
|
11
|
-
inline-flex items-center justify-center
|
|
12
|
-
border border-border shadow-xs
|
|
13
|
-
[&>button]:border-0
|
|
14
|
-
[&>button]:focus-visible:ring-2
|
|
15
|
-
[&>button]:focus-visible:z-10
|
|
16
|
-
[&>button]:rounded-none
|
|
17
|
-
[&>button]:shadow-none
|
|
10
|
+
const buttonGroupVariants = cva(`
|
|
11
|
+
inline-flex items-center justify-center
|
|
12
|
+
border border-border shadow-xs
|
|
13
|
+
[&>button]:border-0
|
|
14
|
+
[&>button]:focus-visible:ring-2
|
|
15
|
+
[&>button]:focus-visible:z-10
|
|
16
|
+
[&>button]:rounded-none
|
|
17
|
+
[&>button]:shadow-none
|
|
18
18
|
`, {
|
|
19
19
|
variants: {
|
|
20
20
|
look: {
|
|
@@ -29,28 +29,28 @@ const buttonGroupVariants = cva(`
|
|
|
29
29
|
warning: ""
|
|
30
30
|
},
|
|
31
31
|
rounded: {
|
|
32
|
-
full: `
|
|
33
|
-
rounded-full
|
|
34
|
-
[&>button]:first:rounded-ss-full [&>button]:first:rounded-es-full
|
|
35
|
-
[&>button]:last:rounded-se-full [&>button]:last:rounded-ee-full
|
|
32
|
+
full: `
|
|
33
|
+
rounded-full
|
|
34
|
+
[&>button]:first:rounded-ss-full [&>button]:first:rounded-es-full
|
|
35
|
+
[&>button]:last:rounded-se-full [&>button]:last:rounded-ee-full
|
|
36
36
|
`,
|
|
37
|
-
large: `
|
|
38
|
-
rounded-lg
|
|
39
|
-
[&>button]:first:rounded-ss-lg [&>button]:first:rounded-es-lg
|
|
40
|
-
[&>button]:last:rounded-se-lg [&>button]:last:rounded-ee-lg
|
|
37
|
+
large: `
|
|
38
|
+
rounded-lg
|
|
39
|
+
[&>button]:first:rounded-ss-lg [&>button]:first:rounded-es-lg
|
|
40
|
+
[&>button]:last:rounded-se-lg [&>button]:last:rounded-ee-lg
|
|
41
41
|
`,
|
|
42
|
-
medium: `
|
|
43
|
-
rounded-md
|
|
44
|
-
[&>button]:first:rounded-ss-md [&>button]:first:rounded-es-md
|
|
45
|
-
[&>button]:last:rounded-se-md [&>button]:last:rounded-ee-md
|
|
42
|
+
medium: `
|
|
43
|
+
rounded-md
|
|
44
|
+
[&>button]:first:rounded-ss-md [&>button]:first:rounded-es-md
|
|
45
|
+
[&>button]:last:rounded-se-md [&>button]:last:rounded-ee-md
|
|
46
46
|
`,
|
|
47
|
-
none: `
|
|
48
|
-
rounded-none
|
|
47
|
+
none: `
|
|
48
|
+
rounded-none
|
|
49
49
|
`,
|
|
50
|
-
small: `
|
|
51
|
-
rounded-sm
|
|
52
|
-
[&>button]:first:rounded-ss-sm [&>button]:first:rounded-es-sm
|
|
53
|
-
[&>button]:last:rounded-se-sm [&>button]:last:rounded-ee-sm
|
|
50
|
+
small: `
|
|
51
|
+
rounded-sm
|
|
52
|
+
[&>button]:first:rounded-ss-sm [&>button]:first:rounded-es-sm
|
|
53
|
+
[&>button]:last:rounded-se-sm [&>button]:last:rounded-ee-sm
|
|
54
54
|
`
|
|
55
55
|
},
|
|
56
56
|
size: {
|
|
@@ -27,12 +27,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
27
27
|
type: Injectable
|
|
28
28
|
}] });
|
|
29
29
|
|
|
30
|
-
const buttonVariants = cva(`
|
|
31
|
-
inline-flex items-center justify-center gap-2
|
|
32
|
-
text-sm font-medium cursor-pointer whitespace-nowrap
|
|
33
|
-
outline-none shadow-xs
|
|
34
|
-
focus-visible:outline-none focus-visible:shadow
|
|
35
|
-
transition-colors duration-100 ease-in-out
|
|
30
|
+
const buttonVariants = cva(`
|
|
31
|
+
inline-flex items-center justify-center gap-2
|
|
32
|
+
text-sm font-medium cursor-pointer whitespace-nowrap
|
|
33
|
+
outline-none shadow-xs
|
|
34
|
+
focus-visible:outline-none focus-visible:shadow
|
|
35
|
+
transition-colors duration-100 ease-in-out
|
|
36
36
|
`, {
|
|
37
37
|
variants: {
|
|
38
38
|
disabled: {
|
|
@@ -48,68 +48,68 @@ const buttonVariants = cva(`
|
|
|
48
48
|
false: ""
|
|
49
49
|
},
|
|
50
50
|
look: {
|
|
51
|
-
default: `
|
|
52
|
-
bg-background text-foreground
|
|
53
|
-
border border-input-border
|
|
54
|
-
hover:bg-hover active:bg-active
|
|
55
|
-
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
51
|
+
default: `
|
|
52
|
+
bg-background text-foreground
|
|
53
|
+
border border-input-border
|
|
54
|
+
hover:bg-hover active:bg-active
|
|
55
|
+
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
56
56
|
`,
|
|
57
|
-
primary: `
|
|
58
|
-
bg-primary text-primary-foreground
|
|
59
|
-
hover:bg-primary-hover active:bg-primary-active
|
|
60
|
-
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
57
|
+
primary: `
|
|
58
|
+
bg-primary text-primary-foreground
|
|
59
|
+
hover:bg-primary-hover active:bg-primary-active
|
|
60
|
+
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
61
61
|
`,
|
|
62
|
-
success: `
|
|
63
|
-
bg-success text-success-foreground
|
|
64
|
-
hover:bg-success-hover
|
|
65
|
-
active:bg-success-active
|
|
66
|
-
focus-visible:ring-2 focus-visible:ring-success/40
|
|
62
|
+
success: `
|
|
63
|
+
bg-success text-success-foreground
|
|
64
|
+
hover:bg-success-hover
|
|
65
|
+
active:bg-success-active
|
|
66
|
+
focus-visible:ring-2 focus-visible:ring-success/40
|
|
67
67
|
`,
|
|
68
|
-
error: `
|
|
69
|
-
bg-error text-error-foreground
|
|
70
|
-
hover:bg-error-hover
|
|
71
|
-
active:bg-error-active
|
|
72
|
-
focus-visible:ring-2 focus-visible:ring-error/40
|
|
68
|
+
error: `
|
|
69
|
+
bg-error text-error-foreground
|
|
70
|
+
hover:bg-error-hover
|
|
71
|
+
active:bg-error-active
|
|
72
|
+
focus-visible:ring-2 focus-visible:ring-error/40
|
|
73
73
|
`,
|
|
74
|
-
warning: `
|
|
75
|
-
bg-warning text-warning-foreground
|
|
76
|
-
hover:bg-warning-hover
|
|
77
|
-
active:bg-warning-active
|
|
78
|
-
focus-visible:ring-2 focus-visible:ring-warning/40
|
|
74
|
+
warning: `
|
|
75
|
+
bg-warning text-warning-foreground
|
|
76
|
+
hover:bg-warning-hover
|
|
77
|
+
active:bg-warning-active
|
|
78
|
+
focus-visible:ring-2 focus-visible:ring-warning/40
|
|
79
79
|
`,
|
|
80
|
-
info: `
|
|
81
|
-
bg-info text-info-foreground
|
|
82
|
-
hover:bg-info-hover
|
|
83
|
-
active:bg-info-active
|
|
84
|
-
focus-visible:ring-2 focus-visible:ring-info/40
|
|
80
|
+
info: `
|
|
81
|
+
bg-info text-info-foreground
|
|
82
|
+
hover:bg-info-hover
|
|
83
|
+
active:bg-info-active
|
|
84
|
+
focus-visible:ring-2 focus-visible:ring-info/40
|
|
85
85
|
`,
|
|
86
|
-
outline: `
|
|
87
|
-
border border-border
|
|
88
|
-
hover:bg-accent
|
|
89
|
-
active:bg-accent-dark
|
|
90
|
-
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
86
|
+
outline: `
|
|
87
|
+
border border-border
|
|
88
|
+
hover:bg-accent
|
|
89
|
+
active:bg-accent-dark
|
|
90
|
+
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
91
91
|
`,
|
|
92
|
-
secondary: `
|
|
93
|
-
bg-secondary text-secondary-foreground
|
|
94
|
-
hover:bg-secondary-hover
|
|
95
|
-
active:bg-secondary-active
|
|
96
|
-
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
92
|
+
secondary: `
|
|
93
|
+
bg-secondary text-secondary-foreground
|
|
94
|
+
hover:bg-secondary-hover
|
|
95
|
+
active:bg-secondary-active
|
|
96
|
+
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
97
97
|
`,
|
|
98
|
-
ghost: `
|
|
99
|
-
shadow-none
|
|
100
|
-
hover:bg-secondary-hover
|
|
101
|
-
active:bg-secondary-active
|
|
102
|
-
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
98
|
+
ghost: `
|
|
99
|
+
shadow-none
|
|
100
|
+
hover:bg-secondary-hover
|
|
101
|
+
active:bg-secondary-active
|
|
102
|
+
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
103
103
|
`,
|
|
104
|
-
link: `
|
|
105
|
-
shadow-none
|
|
106
|
-
underline-offset-4 hover:underline
|
|
107
|
-
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
104
|
+
link: `
|
|
105
|
+
shadow-none
|
|
106
|
+
underline-offset-4 hover:underline
|
|
107
|
+
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
108
108
|
`,
|
|
109
|
-
clear: `
|
|
110
|
-
bg-transparent border-0 shadow-none
|
|
111
|
-
hover:bg-transparent active:bg-transparent
|
|
112
|
-
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
109
|
+
clear: `
|
|
110
|
+
bg-transparent border-0 shadow-none
|
|
111
|
+
hover:bg-transparent active:bg-transparent
|
|
112
|
+
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
113
113
|
`
|
|
114
114
|
},
|
|
115
115
|
rounded: {
|
|
@@ -132,99 +132,99 @@ const buttonVariants = cva(`
|
|
|
132
132
|
{
|
|
133
133
|
look: "default",
|
|
134
134
|
selected: true,
|
|
135
|
-
class: `
|
|
136
|
-
bg-selected text-foreground
|
|
137
|
-
hover:bg-selected/95 hover:text-foreground
|
|
138
|
-
active:bg-selected/100 active:text-foreground
|
|
135
|
+
class: `
|
|
136
|
+
bg-selected text-foreground
|
|
137
|
+
hover:bg-selected/95 hover:text-foreground
|
|
138
|
+
active:bg-selected/100 active:text-foreground
|
|
139
139
|
`
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
look: "primary",
|
|
143
143
|
selected: true,
|
|
144
|
-
class: `
|
|
145
|
-
bg-primary-selected text-primary-foreground
|
|
146
|
-
hover:bg-primary-selected/95 hover:text-primary-foreground
|
|
147
|
-
active:bg-primary-selected/100 active:text-primary-foreground
|
|
144
|
+
class: `
|
|
145
|
+
bg-primary-selected text-primary-foreground
|
|
146
|
+
hover:bg-primary-selected/95 hover:text-primary-foreground
|
|
147
|
+
active:bg-primary-selected/100 active:text-primary-foreground
|
|
148
148
|
`
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
look: "secondary",
|
|
152
152
|
selected: true,
|
|
153
|
-
class: `
|
|
154
|
-
bg-secondary-selected text-secondary-foreground
|
|
155
|
-
hover:bg-secondary-selected/95 hover:text-secondary-foreground
|
|
156
|
-
active:bg-secondary-selected/100 active:text-secondary-foreground
|
|
153
|
+
class: `
|
|
154
|
+
bg-secondary-selected text-secondary-foreground
|
|
155
|
+
hover:bg-secondary-selected/95 hover:text-secondary-foreground
|
|
156
|
+
active:bg-secondary-selected/100 active:text-secondary-foreground
|
|
157
157
|
`
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
look: "success",
|
|
161
161
|
selected: true,
|
|
162
|
-
class: `
|
|
163
|
-
bg-success-selected text-success-foreground
|
|
164
|
-
hover:bg-success-selected/95 hover:text-success-foreground
|
|
165
|
-
active:bg-success-selected/100 active:text-success-foreground
|
|
162
|
+
class: `
|
|
163
|
+
bg-success-selected text-success-foreground
|
|
164
|
+
hover:bg-success-selected/95 hover:text-success-foreground
|
|
165
|
+
active:bg-success-selected/100 active:text-success-foreground
|
|
166
166
|
`
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
look: "error",
|
|
170
170
|
selected: true,
|
|
171
|
-
class: `
|
|
172
|
-
bg-error-selected text-error-foreground
|
|
173
|
-
hover:bg-error-selected/95 hover:text-error-foreground
|
|
174
|
-
active:bg-error-selected/100 active:text-error-foreground
|
|
171
|
+
class: `
|
|
172
|
+
bg-error-selected text-error-foreground
|
|
173
|
+
hover:bg-error-selected/95 hover:text-error-foreground
|
|
174
|
+
active:bg-error-selected/100 active:text-error-foreground
|
|
175
175
|
`
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
look: "warning",
|
|
179
179
|
selected: true,
|
|
180
|
-
class: `
|
|
181
|
-
bg-warning-selected text-warning-foreground
|
|
182
|
-
hover:bg-warning-selected/95 hover:text-warning-foreground
|
|
183
|
-
active:bg-warning-selected/100 active:text-warning-foreground
|
|
180
|
+
class: `
|
|
181
|
+
bg-warning-selected text-warning-foreground
|
|
182
|
+
hover:bg-warning-selected/95 hover:text-warning-foreground
|
|
183
|
+
active:bg-warning-selected/100 active:text-warning-foreground
|
|
184
184
|
`
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
look: "info",
|
|
188
188
|
selected: true,
|
|
189
|
-
class: `
|
|
190
|
-
bg-info-selected text-info-foreground
|
|
191
|
-
hover:bg-info-selected/95 hover:text-info-foreground
|
|
192
|
-
active:bg-info-selected/100 active:text-info-foreground
|
|
189
|
+
class: `
|
|
190
|
+
bg-info-selected text-info-foreground
|
|
191
|
+
hover:bg-info-selected/95 hover:text-info-foreground
|
|
192
|
+
active:bg-info-selected/100 active:text-info-foreground
|
|
193
193
|
`
|
|
194
194
|
},
|
|
195
195
|
{
|
|
196
196
|
look: "outline",
|
|
197
197
|
selected: true,
|
|
198
|
-
class: `
|
|
199
|
-
bg-primary-selected text-primary-foreground
|
|
200
|
-
hover:bg-primary-selected/95 hover:text-primary-foreground
|
|
201
|
-
active:bg-primary-selected/100 active:text-primary-foreground
|
|
198
|
+
class: `
|
|
199
|
+
bg-primary-selected text-primary-foreground
|
|
200
|
+
hover:bg-primary-selected/95 hover:text-primary-foreground
|
|
201
|
+
active:bg-primary-selected/100 active:text-primary-foreground
|
|
202
202
|
`
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
look: "ghost",
|
|
206
206
|
selected: true,
|
|
207
|
-
class: `
|
|
208
|
-
bg-secondary-selected text-secondary-foreground
|
|
209
|
-
hover:bg-secondary-selected/95 hover:text-secondary-foreground
|
|
210
|
-
active:bg-secondary-selected/100 active:text-secondary-foreground
|
|
207
|
+
class: `
|
|
208
|
+
bg-secondary-selected text-secondary-foreground
|
|
209
|
+
hover:bg-secondary-selected/95 hover:text-secondary-foreground
|
|
210
|
+
active:bg-secondary-selected/100 active:text-secondary-foreground
|
|
211
211
|
`
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
look: "link",
|
|
215
215
|
selected: true,
|
|
216
|
-
class: `
|
|
217
|
-
bg-secondary-selected text-secondary-foreground
|
|
218
|
-
hover:bg-secondary-selected/95 hover:text-secondary-foreground
|
|
219
|
-
active:bg-secondary-selected/100 active:text-secondary-foreground
|
|
216
|
+
class: `
|
|
217
|
+
bg-secondary-selected text-secondary-foreground
|
|
218
|
+
hover:bg-secondary-selected/95 hover:text-secondary-foreground
|
|
219
|
+
active:bg-secondary-selected/100 active:text-secondary-foreground
|
|
220
220
|
`
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
223
|
look: "clear",
|
|
224
224
|
selected: true,
|
|
225
|
-
class: `
|
|
226
|
-
bg-transparent border-0
|
|
227
|
-
hover:bg-transparent active:bg-transparent
|
|
225
|
+
class: `
|
|
226
|
+
bg-transparent border-0
|
|
227
|
+
hover:bg-transparent active:bg-transparent
|
|
228
228
|
`
|
|
229
229
|
},
|
|
230
230
|
{
|
|
@@ -282,6 +282,8 @@ class ButtonDirective {
|
|
|
282
282
|
this.#themeService = inject(ThemeService);
|
|
283
283
|
this.#loaderComponentRef = null;
|
|
284
284
|
this.#toggleSubscription = null;
|
|
285
|
+
this.displaysPressedState = computed(() => this.isInButtonGroup() || !!this.toggleable(), /* @ts-ignore */
|
|
286
|
+
...(ngDevMode ? [{ debugName: "displaysPressedState" }] : /* istanbul ignore next */ []));
|
|
285
287
|
this.effectiveDisabled = computed(() => this.#buttonService?.groupDisabled() || this.disabled(), /* @ts-ignore */
|
|
286
288
|
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
287
289
|
this.effectiveLook = computed(() => this.#buttonService?.groupLook() ?? this.look(), /* @ts-ignore */
|
|
@@ -290,7 +292,7 @@ class ButtonDirective {
|
|
|
290
292
|
...(ngDevMode ? [{ debugName: "effectiveRounded" }] : /* istanbul ignore next */ []));
|
|
291
293
|
this.effectiveSize = computed(() => this.#buttonService?.groupSize() ?? this.size(), /* @ts-ignore */
|
|
292
294
|
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
293
|
-
this.effectiveToggleable = computed(() => this.
|
|
295
|
+
this.effectiveToggleable = computed(() => this.toggleable() ?? this.isInButtonGroup(), /* @ts-ignore */
|
|
294
296
|
...(ngDevMode ? [{ debugName: "effectiveToggleable" }] : /* istanbul ignore next */ []));
|
|
295
297
|
this.isInButtonGroup = computed(() => !!this.#buttonService, /* @ts-ignore */
|
|
296
298
|
...(ngDevMode ? [{ debugName: "isInButtonGroup" }] : /* istanbul ignore next */ []));
|
|
@@ -385,10 +387,10 @@ class ButtonDirective {
|
|
|
385
387
|
/**
|
|
386
388
|
* @description Enables toggle behavior — each click flips the `selected` state and `aria-pressed` is managed.
|
|
387
389
|
* Must use `[toggleable]="true"` binding syntax, not bare attribute form.
|
|
388
|
-
* @default
|
|
390
|
+
* @default undefined
|
|
389
391
|
*/
|
|
390
|
-
this.toggleable = input(
|
|
391
|
-
...(ngDevMode ? [{ debugName: "toggleable" }] : /* istanbul ignore next */ []));
|
|
392
|
+
this.toggleable = input(/* @ts-ignore */
|
|
393
|
+
...(ngDevMode ? [undefined, { debugName: "toggleable" }] : /* istanbul ignore next */ []));
|
|
392
394
|
/**
|
|
393
395
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
394
396
|
* @default ""
|
|
@@ -464,7 +466,7 @@ class ButtonDirective {
|
|
|
464
466
|
});
|
|
465
467
|
}
|
|
466
468
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
467
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ButtonDirective, isStandalone: true, selector: "button[monaButton]", inputs: { ariaHasPopup: { classPropertyName: "ariaHasPopup", publicName: "aria-haspopup", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", loading: "loadingChange", look: "lookChange", selected: "selectedChange" }, host: { properties: { "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-disabled": "effectiveDisabled() || loading() ? 'true' : undefined", "attr.aria-haspopup": "ariaHasPopup() !== 'false' ? ariaHasPopup() : null", "attr.aria-pressed": "
|
|
469
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ButtonDirective, isStandalone: true, selector: "button[monaButton]", inputs: { ariaHasPopup: { classPropertyName: "ariaHasPopup", publicName: "aria-haspopup", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", loading: "loadingChange", look: "lookChange", selected: "selectedChange" }, host: { properties: { "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-disabled": "effectiveDisabled() || loading() ? 'true' : undefined", "attr.aria-haspopup": "ariaHasPopup() !== 'false' ? ariaHasPopup() : null", "attr.aria-pressed": "displaysPressedState() ? (selected() ? 'true' : 'false') : undefined", "attr.data-look": "effectiveLook()", "attr.data-size": "effectiveSize()", "attr.disabled": "effectiveDisabled() || loading() ? '' : undefined", "attr.tabindex": "effectiveDisabled() || loading() ? -1 : tabindex()", "attr.type": "'button'", "class": "baseClass()" } }, ngImport: i0 }); }
|
|
468
470
|
}
|
|
469
471
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonDirective, decorators: [{
|
|
470
472
|
type: Directive,
|
|
@@ -474,7 +476,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
474
476
|
"[attr.aria-busy]": "loading() ? 'true' : undefined",
|
|
475
477
|
"[attr.aria-disabled]": "effectiveDisabled() || loading() ? 'true' : undefined",
|
|
476
478
|
"[attr.aria-haspopup]": "ariaHasPopup() !== 'false' ? ariaHasPopup() : null",
|
|
477
|
-
"[attr.aria-pressed]": "
|
|
479
|
+
"[attr.aria-pressed]": "displaysPressedState() ? (selected() ? 'true' : 'false') : undefined",
|
|
478
480
|
"[attr.data-look]": "effectiveLook()",
|
|
479
481
|
"[attr.data-size]": "effectiveSize()",
|
|
480
482
|
"[attr.disabled]": "effectiveDisabled() || loading() ? '' : undefined",
|