@egose/shadcn-theme-ng 0.0.10 → 0.0.12
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/accordion/fesm2022/accordion.mjs +25 -25
- package/accordion/fesm2022/accordion.mjs.map +1 -1
- package/alert/fesm2022/alert.mjs +109 -33
- package/alert/fesm2022/alert.mjs.map +1 -1
- package/alert/index.d.ts +6 -3
- package/autocomplete/README.md +64 -0
- package/autocomplete/fesm2022/autocomplete.mjs +524 -0
- package/autocomplete/fesm2022/autocomplete.mjs.map +1 -0
- package/autocomplete/index.d.ts +158 -0
- package/badge/fesm2022/badge.mjs +5 -5
- package/badge/fesm2022/badge.mjs.map +1 -1
- package/basic-alert/README.md +64 -0
- package/basic-alert/fesm2022/basic-alert.mjs +111 -0
- package/basic-alert/fesm2022/basic-alert.mjs.map +1 -0
- package/basic-alert/index.d.ts +14 -0
- package/button/fesm2022/button.mjs +16 -14
- package/button/fesm2022/button.mjs.map +1 -1
- package/button/index.d.ts +1 -1
- package/calendar/README.md +64 -0
- package/calendar/fesm2022/calendar.mjs +637 -0
- package/calendar/fesm2022/calendar.mjs.map +1 -0
- package/calendar/index.d.ts +111 -0
- package/confirmation-dialog/README.md +64 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +93 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +1 -0
- package/confirmation-dialog/index.d.ts +24 -0
- package/date-picker/README.md +64 -0
- package/date-picker/fesm2022/date-picker.mjs +599 -0
- package/date-picker/fesm2022/date-picker.mjs.map +1 -0
- package/date-picker/index.d.ts +227 -0
- package/dialog/README.md +64 -0
- package/dialog/fesm2022/dialog.mjs +278 -0
- package/dialog/fesm2022/dialog.mjs.map +1 -0
- package/dialog/index.d.ts +89 -0
- package/exports.json +1 -1
- package/form-date-picker/README.md +64 -0
- package/form-date-picker/fesm2022/form-date-picker.mjs +146 -0
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +1 -0
- package/form-date-picker/index.d.ts +32 -0
- package/form-field/fesm2022/form-field.mjs +19 -17
- package/form-field/fesm2022/form-field.mjs.map +1 -1
- package/form-select/README.md +64 -0
- package/form-select/fesm2022/form-select.mjs +165 -0
- package/form-select/fesm2022/form-select.mjs.map +1 -0
- package/form-select/index.d.ts +33 -0
- package/form-text-input/README.md +64 -0
- package/form-text-input/fesm2022/form-text-input.mjs +197 -0
- package/form-text-input/fesm2022/form-text-input.mjs.map +1 -0
- package/form-text-input/index.d.ts +47 -0
- package/form-textarea/README.md +64 -0
- package/form-textarea/fesm2022/form-textarea.mjs +156 -0
- package/form-textarea/fesm2022/form-textarea.mjs.map +1 -0
- package/form-textarea/index.d.ts +33 -0
- package/icon/fesm2022/icon.mjs +7 -7
- package/input/fesm2022/input.mjs +11 -11
- package/input/fesm2022/input.mjs.map +1 -1
- package/label/fesm2022/label.mjs +9 -9
- package/label/fesm2022/label.mjs.map +1 -1
- package/package.json +56 -5
- package/popover/README.md +64 -0
- package/popover/fesm2022/popover.mjs +69 -0
- package/popover/fesm2022/popover.mjs.map +1 -0
- package/popover/index.d.ts +30 -0
- package/radio-group/fesm2022/radio-group.mjs +17 -17
- package/radio-group/fesm2022/radio-group.mjs.map +1 -1
- package/select/fesm2022/select.mjs +42 -42
- package/select/fesm2022/select.mjs.map +1 -1
- package/separator/README.md +64 -0
- package/separator/fesm2022/separator.mjs +46 -0
- package/separator/fesm2022/separator.mjs.map +1 -0
- package/separator/index.d.ts +19 -0
- package/sonner/fesm2022/sonner.mjs +9 -9
- package/sonner/fesm2022/sonner.mjs.map +1 -1
- package/spinner/fesm2022/spinner.mjs +10 -10
- package/spinner/fesm2022/spinner.mjs.map +1 -1
- package/switch/fesm2022/switch.mjs +13 -13
- package/switch/fesm2022/switch.mjs.map +1 -1
- package/tabs/fesm2022/tabs.mjs +27 -27
- package/tabs/fesm2022/tabs.mjs.map +1 -1
- package/tooltip/fesm2022/tooltip.mjs +10 -10
- package/utils/fesm2022/utils.mjs +2 -2
- package/utils/fesm2022/utils.mjs.map +1 -1
- package/utils/index.d.ts +2 -2
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ElementRef, TemplateRef, ValueProvider } from '@angular/core';
|
|
3
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
4
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
5
|
+
import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
6
|
+
import { ClassValue } from 'clsx';
|
|
7
|
+
import * as i1 from '@spartan-ng/brain/autocomplete';
|
|
8
|
+
|
|
9
|
+
declare const HLM_AUTOCOMPLETE_VALUE_ACCESSOR: {
|
|
10
|
+
provide: _angular_core.InjectionToken<readonly ControlValueAccessor[]>;
|
|
11
|
+
useExisting: _angular_core.Type<any>;
|
|
12
|
+
multi: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare class HlmAutocomplete<T> implements ControlValueAccessor {
|
|
15
|
+
private static _id;
|
|
16
|
+
private readonly _config;
|
|
17
|
+
private readonly _brnPopover;
|
|
18
|
+
private readonly _inputRef;
|
|
19
|
+
protected readonly _elementRef: ElementRef<any>;
|
|
20
|
+
/** The user defined class */
|
|
21
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
22
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
23
|
+
/** Custom class for the autocomplete list. */
|
|
24
|
+
readonly autocompleteListClass: _angular_core.InputSignal<ClassValue>;
|
|
25
|
+
protected readonly _computedAutocompleteListClass: _angular_core.Signal<string>;
|
|
26
|
+
/** Custom class for the empty and loading state container. */
|
|
27
|
+
readonly autocompleteEmptyClass: _angular_core.InputSignal<ClassValue>;
|
|
28
|
+
protected readonly _computedAutocompleteEmptyClass: _angular_core.Signal<string>;
|
|
29
|
+
/** The list of filtered options to display in the autocomplete. */
|
|
30
|
+
readonly filteredOptions: _angular_core.InputSignal<T[]>;
|
|
31
|
+
/** The selected value. */
|
|
32
|
+
readonly value: _angular_core.InputSignal<T | undefined>;
|
|
33
|
+
protected readonly _value: _angular_core.WritableSignal<T | undefined>;
|
|
34
|
+
/** The search query. */
|
|
35
|
+
readonly search: _angular_core.InputSignal<string | undefined>;
|
|
36
|
+
protected readonly _search: _angular_core.WritableSignal<string>;
|
|
37
|
+
/** Function to transform an option value to a search string. Defaults to identity function for strings. */
|
|
38
|
+
readonly transformValueToSearch: _angular_core.InputSignal<(value: T) => string>;
|
|
39
|
+
/** Optional template for rendering each option. */
|
|
40
|
+
readonly optionTemplate: _angular_core.InputSignal<TemplateRef<HlmAutocompleteOption<T>> | undefined>;
|
|
41
|
+
/** Whether the autocomplete is in a loading state. */
|
|
42
|
+
readonly loading: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
43
|
+
/** Placeholder text for the input field. */
|
|
44
|
+
readonly searchPlaceholderText: _angular_core.InputSignal<string>;
|
|
45
|
+
/** Text to display when loading options. */
|
|
46
|
+
readonly loadingText: _angular_core.InputSignal<string>;
|
|
47
|
+
/** Text to display when no options are found. */
|
|
48
|
+
readonly emptyText: _angular_core.InputSignal<string>;
|
|
49
|
+
/** Aria label for the toggle button. */
|
|
50
|
+
readonly ariaLabelToggleButton: _angular_core.InputSignal<string>;
|
|
51
|
+
/** The id of the input field. */
|
|
52
|
+
readonly inputId: _angular_core.InputSignal<string>;
|
|
53
|
+
/** Whether the autocomplete is disabled. */
|
|
54
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
55
|
+
protected readonly _disabled: _angular_core.WritableSignal<boolean>;
|
|
56
|
+
/** Emitted when the selected value changes. */
|
|
57
|
+
readonly valueChange: _angular_core.OutputEmitterRef<T | null>;
|
|
58
|
+
/** Emitted when the search query changes. */
|
|
59
|
+
readonly searchChange: _angular_core.OutputEmitterRef<string>;
|
|
60
|
+
protected _onChange?: ChangeFn<T | null>;
|
|
61
|
+
protected _onTouched?: TouchFn;
|
|
62
|
+
protected _setPopoverState(state: 'open' | 'closed'): void;
|
|
63
|
+
protected _openPopover(): void;
|
|
64
|
+
protected _toggleOptions(): void;
|
|
65
|
+
protected _onSearchChanged(event: Event): void;
|
|
66
|
+
protected _clearOption(): void;
|
|
67
|
+
protected _optionSelected(option: T): void;
|
|
68
|
+
/** CONTROL VALUE ACCESSOR */
|
|
69
|
+
writeValue(value: T | null): void;
|
|
70
|
+
registerOnChange(fn: ChangeFn<T | null>): void;
|
|
71
|
+
registerOnTouched(fn: TouchFn): void;
|
|
72
|
+
setDisabledState(isDisabled: boolean): void;
|
|
73
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocomplete<any>, never>;
|
|
74
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocomplete<any>, "hlm-autocomplete", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "autocompleteListClass": { "alias": "autocompleteListClass"; "required": false; "isSignal": true; }; "autocompleteEmptyClass": { "alias": "autocompleteEmptyClass"; "required": false; "isSignal": true; }; "filteredOptions": { "alias": "filteredOptions"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; "transformValueToSearch": { "alias": "transformValueToSearch"; "required": false; "isSignal": true; }; "optionTemplate": { "alias": "optionTemplate"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "searchPlaceholderText": { "alias": "searchPlaceholderText"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "ariaLabelToggleButton": { "alias": "ariaLabelToggleButton"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "searchChange": "searchChange"; }, never, ["[loading]", "[empty]"], true, never>;
|
|
75
|
+
}
|
|
76
|
+
interface HlmAutocompleteOption<T> {
|
|
77
|
+
$implicit: T;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare class HlmAutocompleteEmpty {
|
|
81
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
82
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
83
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteEmpty, never>;
|
|
84
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmAutocompleteEmpty, "[hlmAutocompleteEmpty]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare class HlmAutocompleteGroup {
|
|
88
|
+
/** The user defined class */
|
|
89
|
+
readonly userClass: _angular_core.InputSignal<string>;
|
|
90
|
+
/** The styles to apply */
|
|
91
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
92
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteGroup, never>;
|
|
93
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteGroup, "hlm-autocomplete-group", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnAutocompleteGroup; inputs: { "id": "id"; }; outputs: {}; }]>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare class HlmAutocompleteItem {
|
|
97
|
+
/** The user defined class */
|
|
98
|
+
readonly userClass: _angular_core.InputSignal<string>;
|
|
99
|
+
/** The styles to apply */
|
|
100
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
101
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteItem, never>;
|
|
102
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteItem, "button[hlm-autocomplete-item]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnAutocompleteItem; inputs: { "value": "value"; "disabled": "disabled"; "id": "id"; }; outputs: { "selected": "selected"; }; }]>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare class HlmAutocompleteList {
|
|
106
|
+
/** The user defined class */
|
|
107
|
+
readonly userClass: _angular_core.InputSignal<string>;
|
|
108
|
+
/** The styles to apply */
|
|
109
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
110
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteList, never>;
|
|
111
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteList, "hlm-autocomplete-list", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnAutocompleteList; inputs: { "id": "id"; }; outputs: {}; }]>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare class HlmAutocompleteSearch {
|
|
115
|
+
/** The user defined class */
|
|
116
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
117
|
+
/** The styles to apply */
|
|
118
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
119
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteSearch, never>;
|
|
120
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteSearch, "hlm-autocomplete-search", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare class HlmAutocompleteSearchInput {
|
|
124
|
+
/** The user defined class */
|
|
125
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
126
|
+
/** The styles to apply */
|
|
127
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
128
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteSearchInput, never>;
|
|
129
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmAutocompleteSearchInput, "input[hlm-autocomplete-search-input]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnAutocompleteSearchInput; inputs: { "value": "value"; }; outputs: {}; }]>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare class HlmAutocompleteTrigger {
|
|
133
|
+
private readonly _host;
|
|
134
|
+
private readonly _brnDialog;
|
|
135
|
+
/** Whether the trigger is disabled. */
|
|
136
|
+
readonly disabledTrigger: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
137
|
+
constructor();
|
|
138
|
+
open(): void;
|
|
139
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteTrigger, never>;
|
|
140
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmAutocompleteTrigger, "[hlmAutocompleteTrigger]", never, { "disabledTrigger": { "alias": "disabledTrigger"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
type TransformValueToString<T> = (value: T) => string;
|
|
144
|
+
interface HlmAutocompleteConfig<T> {
|
|
145
|
+
transformValueToSearch: TransformValueToString<T>;
|
|
146
|
+
}
|
|
147
|
+
declare function provideHlmAutocompleteConfig<T>(config: Partial<HlmAutocompleteConfig<T>>): ValueProvider;
|
|
148
|
+
declare function injectHlmAutocompleteConfig<T>(): HlmAutocompleteConfig<T>;
|
|
149
|
+
|
|
150
|
+
declare const HlmAutocompleteImports: readonly [typeof HlmAutocomplete, typeof HlmAutocompleteEmpty, typeof HlmAutocompleteGroup, typeof HlmAutocompleteItem, typeof HlmAutocompleteList, typeof HlmAutocompleteSearch, typeof HlmAutocompleteSearchInput, typeof HlmAutocompleteTrigger];
|
|
151
|
+
declare class HlmAutocompleteModule {
|
|
152
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmAutocompleteModule, never>;
|
|
153
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmAutocompleteModule, never, [typeof HlmAutocomplete, typeof HlmAutocompleteEmpty, typeof HlmAutocompleteGroup, typeof HlmAutocompleteItem, typeof HlmAutocompleteList, typeof HlmAutocompleteSearch, typeof HlmAutocompleteSearchInput, typeof HlmAutocompleteTrigger], [typeof HlmAutocomplete, typeof HlmAutocompleteEmpty, typeof HlmAutocompleteGroup, typeof HlmAutocompleteItem, typeof HlmAutocompleteList, typeof HlmAutocompleteSearch, typeof HlmAutocompleteSearchInput, typeof HlmAutocompleteTrigger]>;
|
|
154
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmAutocompleteModule>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { HLM_AUTOCOMPLETE_VALUE_ACCESSOR, HlmAutocomplete, HlmAutocompleteEmpty, HlmAutocompleteGroup, HlmAutocompleteImports, HlmAutocompleteItem, HlmAutocompleteList, HlmAutocompleteModule, HlmAutocompleteSearch, HlmAutocompleteSearchInput, HlmAutocompleteTrigger, injectHlmAutocompleteConfig, provideHlmAutocompleteConfig };
|
|
158
|
+
export type { HlmAutocompleteConfig, TransformValueToString };
|
package/badge/fesm2022/badge.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, computed, Input, Component } from '@angular/core';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
|
-
import {
|
|
4
|
+
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
5
5
|
|
|
6
6
|
/* Tailwind + CVA variant config */
|
|
7
7
|
const badgeVariants = cva([
|
|
@@ -63,7 +63,7 @@ class HlmBadge {
|
|
|
63
63
|
if (this.appearance === 'outline-filled') {
|
|
64
64
|
outlineClasses.push(this.getOutlineFilledClasses(this.variant));
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return hlm(badgeVariants({
|
|
67
67
|
variant: this.variant,
|
|
68
68
|
size: this.size,
|
|
69
69
|
appearance: this.appearance,
|
|
@@ -110,10 +110,10 @@ class HlmBadge {
|
|
|
110
110
|
};
|
|
111
111
|
return colors[variant];
|
|
112
112
|
}
|
|
113
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
114
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
113
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmBadge, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
114
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: HlmBadge, isStandalone: true, selector: "span[hlmBadge], a[hlmBadge]", inputs: { variant: "variant", size: "size", appearance: "appearance", userClass: "userClass" }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true });
|
|
115
115
|
}
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmBadge, decorators: [{
|
|
117
117
|
type: Component,
|
|
118
118
|
args: [{
|
|
119
119
|
selector: 'span[hlmBadge], a[hlmBadge]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.mjs","sources":["../../../projects/badge/src/lib/badge.ts","../../../projects/badge/src/public-api.ts","../../../projects/badge/src/badge.ts"],"sourcesContent":["import { Component, Input, computed, signal } from '@angular/core';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { type ClassValue } from 'clsx';\nimport {
|
|
1
|
+
{"version":3,"file":"badge.mjs","sources":["../../../projects/badge/src/lib/badge.ts","../../../projects/badge/src/public-api.ts","../../../projects/badge/src/badge.ts"],"sourcesContent":["import { Component, Input, computed, signal } from '@angular/core';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { type ClassValue } from 'clsx';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\n\n/* Tailwind + CVA variant config */\nexport const badgeVariants = cva(\n [\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:rounded-sm',\n 'tw:font-medium',\n 'tw:whitespace-nowrap',\n 'tw:transition-colors',\n 'tw:focus-visible:outline-none',\n 'tw:focus-visible:ring-1',\n 'tw:focus-visible:ring-ring',\n ],\n {\n variants: {\n variant: {\n primary: 'tw:bg-primary tw:text-primary-foreground tw:hover:bg-primary/90',\n secondary: 'tw:bg-secondary tw:text-secondary-foreground tw:hover:bg-secondary/90',\n success: 'tw:bg-success tw:text-success-foreground tw:hover:bg-success/90',\n warning: 'tw:bg-warning tw:text-warning-foreground tw:hover:bg-warning/90',\n danger: 'tw:bg-danger tw:text-danger-foreground tw:hover:bg-danger/90',\n info: 'tw:bg-info tw:text-info-foreground tw:hover:bg-info/90',\n light: 'tw:bg-light tw:text-light-foreground tw:hover:bg-light/90',\n dark: 'tw:bg-dark tw:text-dark-foreground tw:hover:bg-dark/90',\n accent: 'tw:bg-accent tw:text-accent-foreground tw:hover:bg-accent/90',\n destructive: 'tw:bg-destructive tw:text-destructive-foreground tw:hover:bg-destructive/90',\n muted: 'tw:bg-muted tw:text-muted-foreground tw:hover:bg-muted/90',\n link: 'tw:text-primary tw:underline-offset-4 tw:hover:underline',\n ghost: 'tw:hover:bg-light tw:hover:text-light-foreground',\n },\n size: {\n sm: 'tw:h-5 tw:px-2 tw:text-xs',\n default: 'tw:h-6 tw:px-3 tw:text-sm',\n lg: 'tw:h-7 tw:px-4 tw:text-base',\n },\n appearance: {\n solid: '',\n outline: 'tw:bg-white tw:border',\n 'outline-filled': 'tw:bg-white tw:border',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'default',\n appearance: 'solid',\n },\n },\n);\n\nexport type BadgeVariants = VariantProps<typeof badgeVariants>;\nexport type BadgeVariantType = NonNullable<BadgeVariants['variant']>;\nexport type BadgeSizeType = NonNullable<BadgeVariants['size']>;\nexport type BadgeAppearanceType = NonNullable<BadgeVariants['appearance']>;\n\n@Component({\n selector: 'span[hlmBadge], a[hlmBadge]',\n standalone: true,\n imports: [],\n host: {\n '[class]': '_computedClass()',\n },\n template: ` <ng-content></ng-content> `,\n})\nexport class HlmBadge {\n /** Props */\n @Input() variant: BadgeVariantType = 'primary';\n @Input() size: BadgeSizeType = 'default';\n @Input() appearance: BadgeAppearanceType = 'solid';\n @Input() userClass: ClassValue = '';\n\n private readonly _additionalClasses = signal<ClassValue>('');\n\n /** Computed badge class merging */\n protected readonly _computedClass = computed(() => {\n const outlineClasses =\n this.appearance === 'outline' || this.appearance === 'outline-filled'\n ? [this.getOutlineClasses(this.variant)]\n : [];\n if (this.appearance === 'outline-filled') {\n outlineClasses.push(this.getOutlineFilledClasses(this.variant));\n }\n return hlm(\n badgeVariants({\n variant: this.variant,\n size: this.size,\n appearance: this.appearance,\n className: this.userClass,\n }),\n outlineClasses,\n this._additionalClasses(),\n );\n });\n\n setClass(classes: string): void {\n this._additionalClasses.set(classes);\n }\n\n /** Helper functions */\n private getOutlineClasses(variant: BadgeVariantType) {\n const colors: Record<BadgeVariantType, string> = {\n primary: 'tw:border-primary tw:text-primary tw:hover:bg-primary/10',\n secondary: 'tw:border-secondary tw:text-secondary tw:hover:bg-secondary/10',\n success: 'tw:border-success tw:text-success tw:hover:bg-success/10',\n warning: 'tw:border-warning tw:text-warning tw:hover:bg-warning/10',\n danger: 'tw:border-danger tw:text-danger tw:hover:bg-danger/10',\n info: 'tw:border-info tw:text-info tw:hover:bg-info/10',\n light: 'tw:border-light tw:text-light-foreground tw:hover:bg-light/10',\n dark: 'tw:border-dark tw:text-dark tw:hover:bg-dark/10',\n accent: 'tw:border-accent tw:text-accent tw:hover:bg-accent/10',\n destructive: 'tw:border-destructive tw:text-destructive tw:hover:bg-destructive/10',\n muted: 'tw:border-muted tw:text-muted-foreground tw:hover:bg-muted/10',\n link: 'tw:text-primary',\n ghost: 'tw:text-light-foreground',\n };\n return colors[variant];\n }\n\n private getOutlineFilledClasses(variant: BadgeVariantType) {\n const colors: Record<BadgeVariantType, string> = {\n primary: 'tw:hover:bg-primary tw:hover:text-primary-foreground',\n secondary: 'tw:hover:bg-secondary tw:hover:text-secondary-foreground',\n success: 'tw:hover:bg-success tw:hover:text-success-foreground',\n warning: 'tw:hover:bg-warning tw:hover:text-warning-foreground',\n danger: 'tw:hover:bg-danger tw:hover:text-danger-foreground',\n info: 'tw:hover:bg-info tw:hover:text-info-foreground',\n light: 'tw:hover:bg-light tw:hover:text-light-foreground',\n dark: 'tw:hover:bg-dark tw:hover:text-dark-foreground',\n accent: 'tw:hover:bg-accent tw:hover:text-accent-foreground',\n destructive: 'tw:hover:bg-destructive tw:hover:text-destructive-foreground',\n muted: 'tw:hover:bg-muted tw:hover:text-muted-foreground',\n link: 'tw:hover:underline',\n ghost: 'tw:hover:bg-light',\n };\n return colors[variant];\n }\n}\n","/*\n * Public API Surface of badge\n */\n\nexport * from './lib/badge';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAKA;AACO,MAAM,aAAa,GAAG,GAAG,CAC9B;IACE,gBAAgB;IAChB,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,sBAAsB;IACtB,sBAAsB;IACtB,+BAA+B;IAC/B,yBAAyB;IACzB,4BAA4B;CAC7B,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,iEAAiE;AAC1E,YAAA,SAAS,EAAE,uEAAuE;AAClF,YAAA,OAAO,EAAE,iEAAiE;AAC1E,YAAA,OAAO,EAAE,iEAAiE;AAC1E,YAAA,MAAM,EAAE,8DAA8D;AACtE,YAAA,IAAI,EAAE,wDAAwD;AAC9D,YAAA,KAAK,EAAE,2DAA2D;AAClE,YAAA,IAAI,EAAE,wDAAwD;AAC9D,YAAA,MAAM,EAAE,8DAA8D;AACtE,YAAA,WAAW,EAAE,6EAA6E;AA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,KAAK,EAAE,mBAAmB;SAC3B;AACD,QAAA,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB;uGAvEW,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAR,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,QAAQ,8OAFT,CAAA,2BAAA,CAA6B,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAE5B,QAAQ,EAAA,UAAA,EAAA,CAAA;kBATpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,kBAAkB;AAC9B,qBAAA;AACD,oBAAA,QAAQ,EAAE,CAAA,2BAAA,CAA6B;AACxC,iBAAA;8BAGU,OAAO,EAAA,CAAA;sBAAf;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,SAAS,EAAA,CAAA;sBAAjB;;;ACzEH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# BasicAlert
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build basic-alert
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd dist/basic-alert
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Running unit tests
|
|
45
|
+
|
|
46
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ng test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running end-to-end tests
|
|
53
|
+
|
|
54
|
+
For end-to-end (e2e) testing, run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ng e2e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
+
|
|
62
|
+
## Additional Resources
|
|
63
|
+
|
|
64
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, Component } from '@angular/core';
|
|
3
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
4
|
+
import { lucideGhost, lucideLink, lucideZap, lucideThumbsUp, lucideStar, lucideBell, lucideCircleAlert, lucideBatteryWarning, lucideInfo, lucideCircleCheck } from '@ng-icons/lucide';
|
|
5
|
+
import { HlmAlert, HlmAlertIcon, HlmAlertTitle, HlmAlertDescription } from '@egose/shadcn-theme-ng/alert';
|
|
6
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
7
|
+
|
|
8
|
+
class EgBasicAlert {
|
|
9
|
+
variant = 'info';
|
|
10
|
+
appearance = 'solid';
|
|
11
|
+
title = '';
|
|
12
|
+
description = '';
|
|
13
|
+
getIconName(variant) {
|
|
14
|
+
switch (variant) {
|
|
15
|
+
case 'success':
|
|
16
|
+
return 'lucideCircleCheck';
|
|
17
|
+
case 'info':
|
|
18
|
+
return 'lucideInfo';
|
|
19
|
+
case 'warning':
|
|
20
|
+
return 'lucideBatteryWarning';
|
|
21
|
+
case 'danger':
|
|
22
|
+
case 'destructive':
|
|
23
|
+
return 'lucideCircleAlert';
|
|
24
|
+
case 'muted':
|
|
25
|
+
return 'lucideBell';
|
|
26
|
+
case 'accent':
|
|
27
|
+
return 'lucideStar';
|
|
28
|
+
case 'primary':
|
|
29
|
+
return 'lucideThumbsUp';
|
|
30
|
+
case 'secondary':
|
|
31
|
+
return 'lucideZap';
|
|
32
|
+
case 'link':
|
|
33
|
+
return 'lucideLink';
|
|
34
|
+
case 'ghost':
|
|
35
|
+
return 'lucideGhost';
|
|
36
|
+
case 'light':
|
|
37
|
+
case 'dark':
|
|
38
|
+
default:
|
|
39
|
+
return 'lucideInfo';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgBasicAlert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: EgBasicAlert, isStandalone: true, selector: "eg-basic-alert", inputs: { variant: "variant", appearance: "appearance", title: "title", description: "description" }, providers: [
|
|
44
|
+
provideIcons({
|
|
45
|
+
lucideCircleCheck,
|
|
46
|
+
lucideInfo,
|
|
47
|
+
lucideBatteryWarning,
|
|
48
|
+
lucideCircleAlert,
|
|
49
|
+
lucideBell,
|
|
50
|
+
lucideStar,
|
|
51
|
+
lucideThumbsUp,
|
|
52
|
+
lucideZap,
|
|
53
|
+
lucideLink,
|
|
54
|
+
lucideGhost,
|
|
55
|
+
}),
|
|
56
|
+
], ngImport: i0, template: `
|
|
57
|
+
<div hlmAlert [variant]="variant" [appearance]="appearance" class="">
|
|
58
|
+
<ng-icon hlm hlmAlertIcon [name]="getIconName(variant)" />
|
|
59
|
+
<h4 hlmAlertTitle class="tw:capitalize">{{ title }}</h4>
|
|
60
|
+
<p hlmAlertDescription>{{ description }}</p>
|
|
61
|
+
</div>
|
|
62
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: HlmAlert, selector: "[hlmAlert]", inputs: ["class", "variant", "appearance"] }, { kind: "directive", type: HlmAlertIcon, selector: "[hlmAlertIcon]" }, { kind: "directive", type: HlmAlertTitle, selector: "[hlmAlertTitle]", inputs: ["class"] }, { kind: "directive", type: HlmAlertDescription, selector: "[hlmAlertDesc],[hlmAlertDescription]", inputs: ["class"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: HlmIcon, selector: "ng-icon[hlm]", inputs: ["size"] }] });
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgBasicAlert, decorators: [{
|
|
65
|
+
type: Component,
|
|
66
|
+
args: [{
|
|
67
|
+
selector: 'eg-basic-alert',
|
|
68
|
+
standalone: true,
|
|
69
|
+
imports: [HlmAlert, HlmAlertIcon, HlmAlertTitle, HlmAlertDescription, NgIcon, HlmIcon],
|
|
70
|
+
providers: [
|
|
71
|
+
provideIcons({
|
|
72
|
+
lucideCircleCheck,
|
|
73
|
+
lucideInfo,
|
|
74
|
+
lucideBatteryWarning,
|
|
75
|
+
lucideCircleAlert,
|
|
76
|
+
lucideBell,
|
|
77
|
+
lucideStar,
|
|
78
|
+
lucideThumbsUp,
|
|
79
|
+
lucideZap,
|
|
80
|
+
lucideLink,
|
|
81
|
+
lucideGhost,
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
template: `
|
|
85
|
+
<div hlmAlert [variant]="variant" [appearance]="appearance" class="">
|
|
86
|
+
<ng-icon hlm hlmAlertIcon [name]="getIconName(variant)" />
|
|
87
|
+
<h4 hlmAlertTitle class="tw:capitalize">{{ title }}</h4>
|
|
88
|
+
<p hlmAlertDescription>{{ description }}</p>
|
|
89
|
+
</div>
|
|
90
|
+
`,
|
|
91
|
+
}]
|
|
92
|
+
}], propDecorators: { variant: [{
|
|
93
|
+
type: Input
|
|
94
|
+
}], appearance: [{
|
|
95
|
+
type: Input
|
|
96
|
+
}], title: [{
|
|
97
|
+
type: Input
|
|
98
|
+
}], description: [{
|
|
99
|
+
type: Input
|
|
100
|
+
}] } });
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
* Public API Surface of basic-alert
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Generated bundle index. Do not edit.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export { EgBasicAlert };
|
|
111
|
+
//# sourceMappingURL=basic-alert.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-alert.mjs","sources":["../../../projects/basic-alert/src/lib/basic-alert.ts","../../../projects/basic-alert/src/public-api.ts","../../../projects/basic-alert/src/basic-alert.ts"],"sourcesContent":["import { Component, Input } from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n lucideCircleAlert,\n lucideCircleCheck,\n lucideInfo,\n lucideBatteryWarning,\n lucideBell,\n lucideStar,\n lucideThumbsUp,\n lucideZap,\n lucideLink,\n lucideGhost,\n} from '@ng-icons/lucide';\nimport {\n HlmAlert,\n HlmAlertIcon,\n HlmAlertTitle,\n HlmAlertDescription,\n type VariantType,\n type AppearanceType,\n} from '@egose/shadcn-theme-ng/alert';\nimport { HlmIcon } from '@egose/shadcn-theme-ng/icon';\n\n@Component({\n selector: 'eg-basic-alert',\n standalone: true,\n imports: [HlmAlert, HlmAlertIcon, HlmAlertTitle, HlmAlertDescription, NgIcon, HlmIcon],\n providers: [\n provideIcons({\n lucideCircleCheck,\n lucideInfo,\n lucideBatteryWarning,\n lucideCircleAlert,\n lucideBell,\n lucideStar,\n lucideThumbsUp,\n lucideZap,\n lucideLink,\n lucideGhost,\n }),\n ],\n template: `\n <div hlmAlert [variant]=\"variant\" [appearance]=\"appearance\" class=\"\">\n <ng-icon hlm hlmAlertIcon [name]=\"getIconName(variant)\" />\n <h4 hlmAlertTitle class=\"tw:capitalize\">{{ title }}</h4>\n <p hlmAlertDescription>{{ description }}</p>\n </div>\n `,\n})\nexport class EgBasicAlert {\n @Input() variant: VariantType = 'info';\n @Input() appearance: AppearanceType = 'solid';\n @Input() title = '';\n @Input() description = '';\n\n getIconName(variant: VariantType): string {\n switch (variant) {\n case 'success':\n return 'lucideCircleCheck';\n case 'info':\n return 'lucideInfo';\n case 'warning':\n return 'lucideBatteryWarning';\n case 'danger':\n case 'destructive':\n return 'lucideCircleAlert';\n case 'muted':\n return 'lucideBell';\n case 'accent':\n return 'lucideStar';\n case 'primary':\n return 'lucideThumbsUp';\n case 'secondary':\n return 'lucideZap';\n case 'link':\n return 'lucideLink';\n case 'ghost':\n return 'lucideGhost';\n case 'light':\n case 'dark':\n default:\n return 'lucideInfo';\n }\n }\n}\n","/*\n * Public API Surface of basic-alert\n */\n\nexport * from './lib/basic-alert';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAkDa,YAAY,CAAA;IACd,OAAO,GAAgB,MAAM;IAC7B,UAAU,GAAmB,OAAO;IACpC,KAAK,GAAG,EAAE;IACV,WAAW,G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,UAAU;4BACV,WAAW;yBACZ,CAAC;AACH,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;AAMT,EAAA,CAAA;AACF,iBAAA;8BAEU,OAAO,EAAA,CAAA;sBAAf;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,WAAW,EAAA,CAAA;sBAAnB;;;ACtDH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VariantType, AppearanceType } from '@egose/shadcn-theme-ng/alert';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class EgBasicAlert {
|
|
5
|
+
variant: VariantType;
|
|
6
|
+
appearance: AppearanceType;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
getIconName(variant: VariantType): string;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EgBasicAlert, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EgBasicAlert, "eg-basic-alert", never, { "variant": { "alias": "variant"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; }, {}, never, never, true, never>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { EgBasicAlert };
|
|
@@ -5,7 +5,7 @@ import * as i1 from '@spartan-ng/brain/button';
|
|
|
5
5
|
import { BrnButton } from '@spartan-ng/brain/button';
|
|
6
6
|
import { HlmSpinner } from '@egose/shadcn-theme-ng/spinner';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
|
-
import {
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
9
9
|
|
|
10
10
|
const buttonVariants = cva([
|
|
11
11
|
'tw:cursor-pointer',
|
|
@@ -47,13 +47,15 @@ const buttonVariants = cva([
|
|
|
47
47
|
ghost: 'tw:hover:bg-light tw:hover:text-light-foreground',
|
|
48
48
|
},
|
|
49
49
|
size: {
|
|
50
|
+
xs: 'tw:h-7 tw:rounded-xs tw:px-2 tw:text-xs',
|
|
51
|
+
sm: 'tw:h-8 tw:rounded-sm tw:px-3',
|
|
50
52
|
default: 'tw:h-9 tw:px-4 tw:py-2',
|
|
51
|
-
|
|
52
|
-
lg: 'tw:h-10 tw:rounded-sm tw:px-8',
|
|
53
|
+
lg: 'tw:h-10 tw:rounded-sm tw:px-7 tw:text-base',
|
|
53
54
|
icon: 'tw:h-9 tw:w-9',
|
|
54
|
-
'compact-
|
|
55
|
+
'compact-xs': 'tw:h-6 tw:px-2 tw:py-1 tw:text-xs',
|
|
55
56
|
'compact-sm': 'tw:h-7 tw:px-2 tw:py-1',
|
|
56
|
-
'compact-
|
|
57
|
+
'compact-default': 'tw:h-8 tw:px-2 tw:py-1',
|
|
58
|
+
'compact-lg': 'tw:h-9 tw:px-2 tw:py-1 tw:text-base',
|
|
57
59
|
'compact-icon': 'tw:h-8 tw:w-8',
|
|
58
60
|
},
|
|
59
61
|
appearance: {
|
|
@@ -94,7 +96,7 @@ class HlmButton {
|
|
|
94
96
|
if (this.appearance === 'outline-filled') {
|
|
95
97
|
outlineClasses.push(this.getOutlineFilledClasses(this.variant));
|
|
96
98
|
}
|
|
97
|
-
return
|
|
99
|
+
return hlm(buttonVariants({
|
|
98
100
|
variant: this.variant,
|
|
99
101
|
size: this.size,
|
|
100
102
|
appearance: this.appearance,
|
|
@@ -107,7 +109,7 @@ class HlmButton {
|
|
|
107
109
|
const base = this.appearance === 'outline' || this.appearance === 'outline-filled'
|
|
108
110
|
? this.getOutlineSpinnerClasses(this.variant)
|
|
109
111
|
: this.getSpinnerClasses(this.variant);
|
|
110
|
-
return
|
|
112
|
+
return hlm(base, this.spinnerUserClass);
|
|
111
113
|
}, ...(ngDevMode ? [{ debugName: "spinnerClass" }] : []));
|
|
112
114
|
setClass(classes) {
|
|
113
115
|
this._additionalClasses.set(classes);
|
|
@@ -185,8 +187,8 @@ class HlmButton {
|
|
|
185
187
|
};
|
|
186
188
|
return colors[variant];
|
|
187
189
|
}
|
|
188
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
189
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
190
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
191
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: HlmButton, isStandalone: true, selector: "button[hlmButton], a[hlmButton]", inputs: { variant: "variant", size: "size", appearance: "appearance", loading: "loading", icon: "icon", iconPosition: "iconPosition", userClass: "userClass", spinnerUserClass: "spinnerUserClass", disabled: "disabled", type: "type" }, host: { properties: { "class": "_computedClass()", "attr.aria-busy": "loading || null", "attr.disabled": "(loading || disabled) ? true : null", "attr.type": "type" } }, hostDirectives: [{ directive: i1.BrnButton, inputs: ["disabled", "disabled"] }], ngImport: i0, template: `
|
|
190
192
|
<ng-template #projected>
|
|
191
193
|
<ng-content></ng-content>
|
|
192
194
|
</ng-template>
|
|
@@ -213,7 +215,7 @@ class HlmButton {
|
|
|
213
215
|
}
|
|
214
216
|
`, isInline: true, dependencies: [{ kind: "component", type: HlmSpinner, selector: "hlm-spinner", inputs: ["size", "show", "class", "spinnerClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
215
217
|
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmButton, decorators: [{
|
|
217
219
|
type: Component,
|
|
218
220
|
args: [{
|
|
219
221
|
selector: 'button[hlmButton], a[hlmButton]',
|
|
@@ -280,11 +282,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
280
282
|
*/
|
|
281
283
|
const HlmButtonImports = [HlmButton];
|
|
282
284
|
class HlmButtonModule {
|
|
283
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
284
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
285
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
286
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: HlmButtonModule, imports: [HlmButton], exports: [HlmButton] });
|
|
287
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmButtonModule, imports: [HlmButtonImports] });
|
|
286
288
|
}
|
|
287
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmButtonModule, decorators: [{
|
|
288
290
|
type: NgModule,
|
|
289
291
|
args: [{
|
|
290
292
|
imports: [...HlmButtonImports],
|