@egose/shadcn-theme-ng 0.0.9 → 0.0.10
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 +49 -49
- package/accordion/fesm2022/accordion.mjs.map +1 -1
- package/accordion/index.d.ts +21 -21
- package/alert/fesm2022/alert.mjs +45 -45
- package/alert/fesm2022/alert.mjs.map +1 -1
- package/alert/index.d.ts +18 -18
- package/badge/fesm2022/badge.mjs +6 -6
- package/badge/fesm2022/badge.mjs.map +1 -1
- package/badge/index.d.ts +4 -4
- package/button/fesm2022/button.mjs +19 -19
- package/button/fesm2022/button.mjs.map +1 -1
- package/button/index.d.ts +9 -9
- package/form-field/fesm2022/form-field.mjs +30 -30
- package/form-field/fesm2022/form-field.mjs.map +1 -1
- package/form-field/index.d.ts +16 -16
- package/icon/fesm2022/icon.mjs +20 -20
- package/icon/fesm2022/icon.mjs.map +1 -1
- package/icon/index.d.ts +13 -13
- package/input/fesm2022/input.mjs +16 -16
- package/input/fesm2022/input.mjs.map +1 -1
- package/input/index.d.ts +9 -9
- package/label/fesm2022/label.mjs +14 -14
- package/label/fesm2022/label.mjs.map +1 -1
- package/label/index.d.ts +9 -9
- package/package.json +1 -18
- package/radio-group/fesm2022/radio-group.mjs +26 -26
- package/radio-group/fesm2022/radio-group.mjs.map +1 -1
- package/radio-group/index.d.ts +15 -15
- package/select/fesm2022/select.mjs +97 -97
- package/select/fesm2022/select.mjs.map +1 -1
- package/select/index.d.ts +35 -35
- package/sonner/fesm2022/sonner.mjs +14 -14
- package/sonner/fesm2022/sonner.mjs.map +1 -1
- package/sonner/index.d.ts +9 -9
- package/spinner/fesm2022/spinner.mjs +14 -14
- package/spinner/fesm2022/spinner.mjs.map +1 -1
- package/spinner/index.d.ts +9 -9
- package/switch/fesm2022/switch.mjs +24 -24
- package/switch/fesm2022/switch.mjs.map +1 -1
- package/switch/index.d.ts +12 -12
- package/tabs/fesm2022/tabs.mjs +45 -45
- package/tabs/fesm2022/tabs.mjs.map +1 -1
- package/tabs/index.d.ts +21 -21
- package/tooltip/fesm2022/tooltip.mjs +22 -22
- package/tooltip/fesm2022/tooltip.mjs.map +1 -1
- package/tooltip/index.d.ts +12 -12
package/alert/index.d.ts
CHANGED
|
@@ -8,39 +8,39 @@ declare const alertVariants: (props?: ({
|
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
type AlertVariants = VariantProps<typeof alertVariants>;
|
|
10
10
|
type VariantType = NonNullable<AlertVariants['variant']>;
|
|
11
|
-
declare class
|
|
11
|
+
declare class HlmAlert {
|
|
12
12
|
readonly userClass: i0.InputSignal<ClassValue>;
|
|
13
13
|
protected readonly _computedClass: i0.Signal<string>;
|
|
14
14
|
readonly variant: i0.InputSignal<"primary" | "secondary" | "success" | "warning" | "danger" | "info" | "light" | "dark" | "accent" | "destructive" | "muted" | "link" | "ghost" | null | undefined>;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
16
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmAlert, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmAlert, "[hlmAlert]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
declare class
|
|
19
|
+
declare class HlmAlertDescription {
|
|
20
20
|
readonly userClass: i0.InputSignal<ClassValue>;
|
|
21
21
|
protected readonly _computedClass: i0.Signal<string>;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
23
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmAlertDescription, never>;
|
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmAlertDescription, "[hlmAlertDesc],[hlmAlertDescription]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
declare class
|
|
27
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
28
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
26
|
+
declare class HlmAlertIcon {
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmAlertIcon, never>;
|
|
28
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmAlertIcon, "[hlmAlertIcon]", never, {}, {}, never, never, true, never>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
declare class
|
|
31
|
+
declare class HlmAlertTitle {
|
|
32
32
|
readonly userClass: i0.InputSignal<ClassValue>;
|
|
33
33
|
protected readonly _computedClass: i0.Signal<string>;
|
|
34
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
35
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmAlertTitle, never>;
|
|
35
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmAlertTitle, "[hlmAlertTitle]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
declare const
|
|
39
|
-
declare class
|
|
40
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
41
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<
|
|
42
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<
|
|
38
|
+
declare const HlmAlertImports: readonly [typeof HlmAlert, typeof HlmAlertTitle, typeof HlmAlertDescription, typeof HlmAlertIcon];
|
|
39
|
+
declare class HlmAlertModule {
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmAlertModule, never>;
|
|
41
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HlmAlertModule, never, [typeof HlmAlert, typeof HlmAlertTitle, typeof HlmAlertDescription, typeof HlmAlertIcon], [typeof HlmAlert, typeof HlmAlertTitle, typeof HlmAlertDescription, typeof HlmAlertIcon]>;
|
|
42
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HlmAlertModule>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export {
|
|
45
|
+
export { HlmAlert, HlmAlertDescription, HlmAlertIcon, HlmAlertImports, HlmAlertModule, HlmAlertTitle };
|
|
46
46
|
export type { AlertVariants, VariantType };
|
package/badge/fesm2022/badge.mjs
CHANGED
|
@@ -48,7 +48,7 @@ const badgeVariants = cva([
|
|
|
48
48
|
appearance: 'solid',
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
|
-
class
|
|
51
|
+
class HlmBadge {
|
|
52
52
|
/** Props */
|
|
53
53
|
variant = 'primary';
|
|
54
54
|
size = 'default';
|
|
@@ -110,13 +110,13 @@ class EgBadge {
|
|
|
110
110
|
};
|
|
111
111
|
return colors[variant];
|
|
112
112
|
}
|
|
113
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
114
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
113
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmBadge, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
114
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", 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.
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmBadge, decorators: [{
|
|
117
117
|
type: Component,
|
|
118
118
|
args: [{
|
|
119
|
-
selector: 'span[
|
|
119
|
+
selector: 'span[hlmBadge], a[hlmBadge]',
|
|
120
120
|
standalone: true,
|
|
121
121
|
imports: [],
|
|
122
122
|
host: {
|
|
@@ -142,5 +142,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
142
142
|
* Generated bundle index. Do not edit.
|
|
143
143
|
*/
|
|
144
144
|
|
|
145
|
-
export {
|
|
145
|
+
export { HlmBadge, badgeVariants };
|
|
146
146
|
//# sourceMappingURL=badge.mjs.map
|
|
@@ -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 { cn } 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[
|
|
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 { cn } 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 cn(\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;AAC1F,YAAA,KAAK,EAAE,2DAA2D;AAClE,YAAA,IAAI,EAAE,0DAA0D;AAChE,YAAA,KAAK,EAAE,kDAAkD;AAC1D,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,2BAA2B;AAC/B,YAAA,OAAO,EAAE,2BAA2B;AACpC,YAAA,EAAE,EAAE,6BAA6B;AAClC,SAAA;AACD,QAAA,UAAU,EAAE;AACV,YAAA,KAAK,EAAE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AA,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;;;;"}
|
package/badge/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
|
12
12
|
type BadgeVariantType = NonNullable<BadgeVariants['variant']>;
|
|
13
13
|
type BadgeSizeType = NonNullable<BadgeVariants['size']>;
|
|
14
14
|
type BadgeAppearanceType = NonNullable<BadgeVariants['appearance']>;
|
|
15
|
-
declare class
|
|
15
|
+
declare class HlmBadge {
|
|
16
16
|
/** Props */
|
|
17
17
|
variant: BadgeVariantType;
|
|
18
18
|
size: BadgeSizeType;
|
|
@@ -25,9 +25,9 @@ declare class EgBadge {
|
|
|
25
25
|
/** Helper functions */
|
|
26
26
|
private getOutlineClasses;
|
|
27
27
|
private getOutlineFilledClasses;
|
|
28
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
29
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmBadge, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmBadge, "span[hlmBadge], a[hlmBadge]", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "userClass": { "alias": "userClass"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export {
|
|
32
|
+
export { HlmBadge, badgeVariants };
|
|
33
33
|
export type { BadgeAppearanceType, BadgeSizeType, BadgeVariantType, BadgeVariants };
|
|
@@ -3,7 +3,7 @@ import { signal, computed, Input, Component, NgModule } from '@angular/core';
|
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import * as i1 from '@spartan-ng/brain/button';
|
|
5
5
|
import { BrnButton } from '@spartan-ng/brain/button';
|
|
6
|
-
import {
|
|
6
|
+
import { HlmSpinner } from '@egose/shadcn-theme-ng/spinner';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import { cn } from '@egose/shadcn-theme-ng/utils';
|
|
9
9
|
|
|
@@ -73,7 +73,7 @@ const buttonVariants = cva([
|
|
|
73
73
|
loading: false,
|
|
74
74
|
},
|
|
75
75
|
});
|
|
76
|
-
class
|
|
76
|
+
class HlmButton {
|
|
77
77
|
/** Props */
|
|
78
78
|
variant = 'primary';
|
|
79
79
|
size = 'default';
|
|
@@ -185,8 +185,8 @@ class EgButton {
|
|
|
185
185
|
};
|
|
186
186
|
return colors[variant];
|
|
187
187
|
}
|
|
188
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
189
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
189
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", 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
190
|
<ng-template #projected>
|
|
191
191
|
<ng-content></ng-content>
|
|
192
192
|
</ng-template>
|
|
@@ -197,7 +197,7 @@ class EgButton {
|
|
|
197
197
|
<ng-container *ngTemplateOutlet="projected" />
|
|
198
198
|
</span>
|
|
199
199
|
<span class="tw:absolute tw:inset-0 tw:flex tw:items-center tw:justify-center">
|
|
200
|
-
<
|
|
200
|
+
<hlm-spinner size="small" [spinnerClass]="spinnerClass()" />
|
|
201
201
|
</span>
|
|
202
202
|
</div>
|
|
203
203
|
} @else {
|
|
@@ -211,14 +211,14 @@ class EgButton {
|
|
|
211
211
|
}
|
|
212
212
|
</div>
|
|
213
213
|
}
|
|
214
|
-
`, isInline: true, dependencies: [{ kind: "component", type:
|
|
214
|
+
`, 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
215
|
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmButton, decorators: [{
|
|
217
217
|
type: Component,
|
|
218
218
|
args: [{
|
|
219
|
-
selector: 'button[
|
|
219
|
+
selector: 'button[hlmButton], a[hlmButton]',
|
|
220
220
|
standalone: true,
|
|
221
|
-
imports: [BrnButton,
|
|
221
|
+
imports: [BrnButton, HlmSpinner, NgTemplateOutlet],
|
|
222
222
|
hostDirectives: [{ directive: BrnButton, inputs: ['disabled'] }],
|
|
223
223
|
host: {
|
|
224
224
|
'[class]': '_computedClass()',
|
|
@@ -237,7 +237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
237
237
|
<ng-container *ngTemplateOutlet="projected" />
|
|
238
238
|
</span>
|
|
239
239
|
<span class="tw:absolute tw:inset-0 tw:flex tw:items-center tw:justify-center">
|
|
240
|
-
<
|
|
240
|
+
<hlm-spinner size="small" [spinnerClass]="spinnerClass()" />
|
|
241
241
|
</span>
|
|
242
242
|
</div>
|
|
243
243
|
} @else {
|
|
@@ -278,17 +278,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
278
278
|
/*
|
|
279
279
|
* Public API Surface of button
|
|
280
280
|
*/
|
|
281
|
-
const
|
|
282
|
-
class
|
|
283
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
284
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
285
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
281
|
+
const HlmButtonImports = [HlmButton];
|
|
282
|
+
class HlmButtonModule {
|
|
283
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
284
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: HlmButtonModule, imports: [HlmButton], exports: [HlmButton] });
|
|
285
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmButtonModule, imports: [HlmButtonImports] });
|
|
286
286
|
}
|
|
287
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmButtonModule, decorators: [{
|
|
288
288
|
type: NgModule,
|
|
289
289
|
args: [{
|
|
290
|
-
imports: [...
|
|
291
|
-
exports: [...
|
|
290
|
+
imports: [...HlmButtonImports],
|
|
291
|
+
exports: [...HlmButtonImports],
|
|
292
292
|
}]
|
|
293
293
|
}] });
|
|
294
294
|
|
|
@@ -296,5 +296,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
296
296
|
* Generated bundle index. Do not edit.
|
|
297
297
|
*/
|
|
298
298
|
|
|
299
|
-
export {
|
|
299
|
+
export { HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants };
|
|
300
300
|
//# sourceMappingURL=button.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.mjs","sources":["../../../projects/button/src/lib/button.ts","../../../projects/button/src/public-api.ts","../../../projects/button/src/button.ts"],"sourcesContent":["import { Component, Input, computed, signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BrnButton } from '@spartan-ng/brain/button';\nimport { EgSpinner } from '@egose/shadcn-theme-ng/spinner';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { type ClassValue } from 'clsx';\nimport { cn } from '@egose/shadcn-theme-ng/utils';\n\nexport const buttonVariants = cva(\n [\n 'tw:cursor-pointer',\n 'tw:active:translate-y-[0.5px]',\n 'tw:disabled:pointer-events-none',\n 'tw:disabled:opacity-50',\n 'tw:focus-visible:outline-none',\n 'tw:focus-visible:ring-1',\n 'tw:focus-visible:ring-ring',\n 'tw:font-medium',\n 'tw:gap-2',\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:rounded-sm',\n 'tw:text-sm',\n 'tw:transform',\n 'tw:transition',\n 'tw:transition-colors',\n 'tw:whitespace-nowrap',\n 'tw:[&_svg]:pointer-events-none',\n 'tw:[&_svg]:shrink-0',\n 'tw:[&_svg]:size-4',\n ],\n {\n variants: {\n variant: {\n primary:\n 'tw:border tw:border-primary tw:bg-primary tw:text-primary-foreground tw:shadow-sm tw:hover:bg-primary/90',\n secondary:\n 'tw:border tw:border-secondary tw:bg-secondary tw:text-secondary-foreground tw:shadow-sm tw:hover:bg-secondary/90',\n success:\n 'tw:border tw:border-success tw:bg-success tw:text-success-foreground tw:shadow-sm tw:hover:bg-success/90',\n warning:\n 'tw:border tw:border-warning tw:bg-warning tw:text-warning-foreground tw:shadow-sm tw:hover:bg-warning/90',\n danger: 'tw:border tw:border-danger tw:bg-danger tw:text-danger-foreground tw:shadow-sm tw:hover:bg-danger/90',\n info: 'tw:border tw:border-info tw:bg-info tw:text-info-foreground tw:shadow-sm tw:hover:bg-info/90',\n light: 'tw:border tw:border-light tw:bg-light tw:text-light-foreground tw:shadow-sm tw:hover:bg-light/90',\n dark: 'tw:border tw:border-dark tw:bg-dark tw:text-dark-foreground tw:shadow-sm tw:hover:bg-dark/90',\n accent: 'tw:border tw:border-accent tw:bg-accent tw:text-accent-foreground tw:shadow-sm tw:hover:bg-accent/90',\n destructive:\n 'tw:border tw:border-destructive tw:bg-destructive tw:text-destructive-foreground tw:shadow-sm tw:hover:bg-destructive/90',\n muted: 'tw:border tw:border-muted tw:bg-muted tw:text-muted-foreground tw:shadow-sm 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 default: 'tw:h-9 tw:px-4 tw:py-2',\n sm: 'tw:h-8 tw:rounded-sm tw:px-3 tw:text-xs',\n lg: 'tw:h-10 tw:rounded-sm tw:px-8',\n icon: 'tw:h-9 tw:w-9',\n 'compact-default': 'tw:h-8 tw:px-2 tw:py-1',\n 'compact-sm': 'tw:h-7 tw:px-2 tw:py-1',\n 'compact-lg': 'tw:h-9 tw:px-2 tw:py-1',\n 'compact-icon': 'tw:h-8 tw:w-8',\n },\n appearance: {\n solid: '',\n outline: 'tw:bg-white tw:border',\n 'outline-filled': 'tw:bg-white tw:border',\n },\n loading: {\n true: 'tw:pointer-events-none',\n false: null,\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'default',\n appearance: 'solid',\n loading: false,\n },\n },\n);\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\nexport type VariantType = NonNullable<ButtonVariants['variant']>;\nexport type SizeType = NonNullable<ButtonVariants['size']>;\nexport type AppearanceType = NonNullable<ButtonVariants['appearance']>;\n\n@Component({\n selector: 'button[egButton], a[egButton]',\n standalone: true,\n imports: [BrnButton, EgSpinner, NgTemplateOutlet],\n hostDirectives: [{ directive: BrnButton, inputs: ['disabled'] }],\n host: {\n '[class]': '_computedClass()',\n '[attr.aria-busy]': 'loading || null',\n '[attr.disabled]': '(loading || disabled) ? true : null',\n '[attr.type]': 'type',\n },\n template: `\n <ng-template #projected>\n <ng-content></ng-content>\n </ng-template>\n\n @if (loading) {\n <div class=\"tw:relative tw:inline-flex tw:items-center\">\n <span class=\"tw:invisible\">\n <ng-container *ngTemplateOutlet=\"projected\" />\n </span>\n <span class=\"tw:absolute tw:inset-0 tw:flex tw:items-center tw:justify-center\">\n <eg-spinner size=\"small\" [spinnerClass]=\"spinnerClass()\" />\n </span>\n </div>\n } @else {\n <div class=\"tw:flex tw:items-center tw:gap-1\">\n @if (icon && iconPosition === 'left') {\n <ng-container *ngTemplateOutlet=\"icon\" />\n }\n <ng-container *ngTemplateOutlet=\"projected\" />\n @if (icon && iconPosition === 'right') {\n <ng-container *ngTemplateOutlet=\"icon\" />\n }\n </div>\n }\n `,\n})\nexport class EgButton {\n /** Props */\n @Input() variant: VariantType = 'primary';\n @Input() size: SizeType = 'default';\n @Input() appearance: AppearanceType = 'solid';\n @Input() loading = false;\n @Input() icon?: any;\n @Input() iconPosition: 'left' | 'right' = 'left';\n @Input() userClass: ClassValue = '';\n @Input() spinnerUserClass: ClassValue = '';\n @Input() disabled = false;\n @Input() type: 'button' | 'submit' | 'reset' = 'button';\n\n private readonly _additionalClasses = signal<ClassValue>('');\n\n /** Computed button 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 cn(\n buttonVariants({\n variant: this.variant,\n size: this.size,\n appearance: this.appearance,\n loading: this.loading,\n className: this.userClass,\n }),\n outlineClasses,\n this.loading ? 'tw:pointer-events-none' : '',\n this._additionalClasses(),\n );\n });\n\n /** Computed spinner classes */\n protected readonly spinnerClass = computed(() => {\n const base =\n this.appearance === 'outline' || this.appearance === 'outline-filled'\n ? this.getOutlineSpinnerClasses(this.variant)\n : this.getSpinnerClasses(this.variant);\n return cn(base, this.spinnerUserClass);\n });\n\n setClass(classes: string): void {\n this._additionalClasses.set(classes);\n }\n\n /** Helper functions */\n private getOutlineClasses(variant: VariantType) {\n const colors: Record<VariantType, string> = {\n primary: 'tw:border-primary tw:text-primary tw:shadow-sm tw:hover:bg-primary/10',\n secondary: 'tw:border-secondary tw:text-secondary tw:shadow-sm tw:hover:bg-secondary/10',\n success: 'tw:border-success tw:text-success tw:shadow-sm tw:hover:bg-success/10',\n warning: 'tw:border-warning tw:text-warning tw:shadow-sm tw:hover:bg-warning/10',\n danger: 'tw:border-danger tw:text-danger tw:shadow-sm tw:hover:bg-danger/10',\n info: 'tw:border-info tw:text-info tw:shadow-sm tw:hover:bg-info/10',\n light: 'tw:border-light tw:text-light-foreground tw:shadow-sm tw:hover:bg-light/10',\n dark: 'tw:border-dark tw:text-dark tw:shadow-sm tw:hover:bg-dark/10',\n accent: 'tw:border-accent tw:text-accent tw:shadow-sm tw:hover:bg-accent/10',\n destructive: 'tw:border-destructive tw:text-destructive tw:shadow-sm tw:hover:bg-destructive/10',\n muted: 'tw:border-muted tw:text-muted-foreground tw:shadow-sm 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: VariantType) {\n const colors: Record<VariantType, 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 private getSpinnerClasses(variant: VariantType) {\n const colors: Record<VariantType, string> = {\n primary: 'tw:[&>svg]:text-primary-foreground',\n secondary: 'tw:[&>svg]:text-secondary-foreground',\n success: 'tw:[&>svg]:text-success-foreground',\n warning: 'tw:[&>svg]:text-warning-foreground',\n danger: 'tw:[&>svg]:text-danger-foreground',\n info: 'tw:[&>svg]:text-info-foreground',\n light: 'tw:[&>svg]:text-light-foreground',\n dark: 'tw:[&>svg]:text-dark-foreground',\n accent: 'tw:[&>svg]:text-accent-foreground',\n destructive: 'tw:[&>svg]:text-destructive-foreground',\n muted: 'tw:[&>svg]:text-muted-foreground',\n link: 'tw:[&>svg]:text-primary',\n ghost: 'tw:[&>svg]:text-light-foreground',\n };\n return colors[variant];\n }\n\n private getOutlineSpinnerClasses(variant: VariantType) {\n const colors: Record<VariantType, string> = {\n primary: 'tw:[&>svg]:text-primary',\n secondary: 'tw:[&>svg]:text-secondary',\n success: 'tw:[&>svg]:text-success',\n warning: 'tw:[&>svg]:text-warning',\n danger: 'tw:[&>svg]:text-danger',\n info: 'tw:[&>svg]:text-info',\n light: 'tw:[&>svg]:text-light',\n dark: 'tw:[&>svg]:text-dark',\n accent: 'tw:[&>svg]:text-accent',\n destructive: 'tw:[&>svg]:text-destructive',\n muted: 'tw:[&>svg]:text-muted-foreground',\n link: 'tw:[&>svg]:text-primary',\n ghost: 'tw:[&>svg]:text-light-foreground',\n };\n return colors[variant];\n }\n}\n","/*\n * Public API Surface of button\n */\n\nimport { NgModule } from '@angular/core';\nimport { EgButton } from './lib/button';\nexport * from './lib/button';\n\nexport const EgButtonImports = [EgButton] as const;\n\n@NgModule({\n imports: [...EgButtonImports],\n exports: [...EgButtonImports],\n})\nexport class EgButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAQO,MAAM,cAAc,GAAG,GAAG,CAC/B;IACE,mBAAmB;IACnB,+BAA+B;IAC/B,iCAAiC;IACjC,wBAAwB;IACxB,+BAA+B;IAC/B,yBAAyB;IACzB,4BAA4B;IAC5B,gBAAgB;IAChB,UAAU;IACV,gBAAgB;IAChB,iBAAiB;IACjB,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,cAAc;IACd,eAAe;IACf,sBAAsB;IACtB,sBAAsB;IACtB,gCAAgC;IAChC,qBAAqB;IACrB,mBAAmB;CACpB,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EACL,0GAA0G;AAC5G,YAAA,SAAS,EACP,kHAAkH;AACpH,YAAA,OAAO,EACL,0GAA0G;AAC5G,YAAA,OAAO,EACL,0GAA0G;AAC5G,YAAA,MAAM,EAAE,sGAAsG;AAC9G,YAAA,IAAI,EAAE,8FAA8F;AACpG,YAAA,KAAK,EAAE,kGAAkG;AACzG,YAA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api.ts","../../../projects/button/src/button.ts"],"sourcesContent":["import { Component, Input, computed, signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BrnButton } from '@spartan-ng/brain/button';\nimport { HlmSpinner } from '@egose/shadcn-theme-ng/spinner';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { type ClassValue } from 'clsx';\nimport { cn } from '@egose/shadcn-theme-ng/utils';\n\nexport const buttonVariants = cva(\n [\n 'tw:cursor-pointer',\n 'tw:active:translate-y-[0.5px]',\n 'tw:disabled:pointer-events-none',\n 'tw:disabled:opacity-50',\n 'tw:focus-visible:outline-none',\n 'tw:focus-visible:ring-1',\n 'tw:focus-visible:ring-ring',\n 'tw:font-medium',\n 'tw:gap-2',\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:rounded-sm',\n 'tw:text-sm',\n 'tw:transform',\n 'tw:transition',\n 'tw:transition-colors',\n 'tw:whitespace-nowrap',\n 'tw:[&_svg]:pointer-events-none',\n 'tw:[&_svg]:shrink-0',\n 'tw:[&_svg]:size-4',\n ],\n {\n variants: {\n variant: {\n primary:\n 'tw:border tw:border-primary tw:bg-primary tw:text-primary-foreground tw:shadow-sm tw:hover:bg-primary/90',\n secondary:\n 'tw:border tw:border-secondary tw:bg-secondary tw:text-secondary-foreground tw:shadow-sm tw:hover:bg-secondary/90',\n success:\n 'tw:border tw:border-success tw:bg-success tw:text-success-foreground tw:shadow-sm tw:hover:bg-success/90',\n warning:\n 'tw:border tw:border-warning tw:bg-warning tw:text-warning-foreground tw:shadow-sm tw:hover:bg-warning/90',\n danger: 'tw:border tw:border-danger tw:bg-danger tw:text-danger-foreground tw:shadow-sm tw:hover:bg-danger/90',\n info: 'tw:border tw:border-info tw:bg-info tw:text-info-foreground tw:shadow-sm tw:hover:bg-info/90',\n light: 'tw:border tw:border-light tw:bg-light tw:text-light-foreground tw:shadow-sm tw:hover:bg-light/90',\n dark: 'tw:border tw:border-dark tw:bg-dark tw:text-dark-foreground tw:shadow-sm tw:hover:bg-dark/90',\n accent: 'tw:border tw:border-accent tw:bg-accent tw:text-accent-foreground tw:shadow-sm tw:hover:bg-accent/90',\n destructive:\n 'tw:border tw:border-destructive tw:bg-destructive tw:text-destructive-foreground tw:shadow-sm tw:hover:bg-destructive/90',\n muted: 'tw:border tw:border-muted tw:bg-muted tw:text-muted-foreground tw:shadow-sm 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 default: 'tw:h-9 tw:px-4 tw:py-2',\n sm: 'tw:h-8 tw:rounded-sm tw:px-3 tw:text-xs',\n lg: 'tw:h-10 tw:rounded-sm tw:px-8',\n icon: 'tw:h-9 tw:w-9',\n 'compact-default': 'tw:h-8 tw:px-2 tw:py-1',\n 'compact-sm': 'tw:h-7 tw:px-2 tw:py-1',\n 'compact-lg': 'tw:h-9 tw:px-2 tw:py-1',\n 'compact-icon': 'tw:h-8 tw:w-8',\n },\n appearance: {\n solid: '',\n outline: 'tw:bg-white tw:border',\n 'outline-filled': 'tw:bg-white tw:border',\n },\n loading: {\n true: 'tw:pointer-events-none',\n false: null,\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'default',\n appearance: 'solid',\n loading: false,\n },\n },\n);\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\nexport type VariantType = NonNullable<ButtonVariants['variant']>;\nexport type SizeType = NonNullable<ButtonVariants['size']>;\nexport type AppearanceType = NonNullable<ButtonVariants['appearance']>;\n\n@Component({\n selector: 'button[hlmButton], a[hlmButton]',\n standalone: true,\n imports: [BrnButton, HlmSpinner, NgTemplateOutlet],\n hostDirectives: [{ directive: BrnButton, inputs: ['disabled'] }],\n host: {\n '[class]': '_computedClass()',\n '[attr.aria-busy]': 'loading || null',\n '[attr.disabled]': '(loading || disabled) ? true : null',\n '[attr.type]': 'type',\n },\n template: `\n <ng-template #projected>\n <ng-content></ng-content>\n </ng-template>\n\n @if (loading) {\n <div class=\"tw:relative tw:inline-flex tw:items-center\">\n <span class=\"tw:invisible\">\n <ng-container *ngTemplateOutlet=\"projected\" />\n </span>\n <span class=\"tw:absolute tw:inset-0 tw:flex tw:items-center tw:justify-center\">\n <hlm-spinner size=\"small\" [spinnerClass]=\"spinnerClass()\" />\n </span>\n </div>\n } @else {\n <div class=\"tw:flex tw:items-center tw:gap-1\">\n @if (icon && iconPosition === 'left') {\n <ng-container *ngTemplateOutlet=\"icon\" />\n }\n <ng-container *ngTemplateOutlet=\"projected\" />\n @if (icon && iconPosition === 'right') {\n <ng-container *ngTemplateOutlet=\"icon\" />\n }\n </div>\n }\n `,\n})\nexport class HlmButton {\n /** Props */\n @Input() variant: VariantType = 'primary';\n @Input() size: SizeType = 'default';\n @Input() appearance: AppearanceType = 'solid';\n @Input() loading = false;\n @Input() icon?: any;\n @Input() iconPosition: 'left' | 'right' = 'left';\n @Input() userClass: ClassValue = '';\n @Input() spinnerUserClass: ClassValue = '';\n @Input() disabled = false;\n @Input() type: 'button' | 'submit' | 'reset' = 'button';\n\n private readonly _additionalClasses = signal<ClassValue>('');\n\n /** Computed button 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 cn(\n buttonVariants({\n variant: this.variant,\n size: this.size,\n appearance: this.appearance,\n loading: this.loading,\n className: this.userClass,\n }),\n outlineClasses,\n this.loading ? 'tw:pointer-events-none' : '',\n this._additionalClasses(),\n );\n });\n\n /** Computed spinner classes */\n protected readonly spinnerClass = computed(() => {\n const base =\n this.appearance === 'outline' || this.appearance === 'outline-filled'\n ? this.getOutlineSpinnerClasses(this.variant)\n : this.getSpinnerClasses(this.variant);\n return cn(base, this.spinnerUserClass);\n });\n\n setClass(classes: string): void {\n this._additionalClasses.set(classes);\n }\n\n /** Helper functions */\n private getOutlineClasses(variant: VariantType) {\n const colors: Record<VariantType, string> = {\n primary: 'tw:border-primary tw:text-primary tw:shadow-sm tw:hover:bg-primary/10',\n secondary: 'tw:border-secondary tw:text-secondary tw:shadow-sm tw:hover:bg-secondary/10',\n success: 'tw:border-success tw:text-success tw:shadow-sm tw:hover:bg-success/10',\n warning: 'tw:border-warning tw:text-warning tw:shadow-sm tw:hover:bg-warning/10',\n danger: 'tw:border-danger tw:text-danger tw:shadow-sm tw:hover:bg-danger/10',\n info: 'tw:border-info tw:text-info tw:shadow-sm tw:hover:bg-info/10',\n light: 'tw:border-light tw:text-light-foreground tw:shadow-sm tw:hover:bg-light/10',\n dark: 'tw:border-dark tw:text-dark tw:shadow-sm tw:hover:bg-dark/10',\n accent: 'tw:border-accent tw:text-accent tw:shadow-sm tw:hover:bg-accent/10',\n destructive: 'tw:border-destructive tw:text-destructive tw:shadow-sm tw:hover:bg-destructive/10',\n muted: 'tw:border-muted tw:text-muted-foreground tw:shadow-sm 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: VariantType) {\n const colors: Record<VariantType, 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 private getSpinnerClasses(variant: VariantType) {\n const colors: Record<VariantType, string> = {\n primary: 'tw:[&>svg]:text-primary-foreground',\n secondary: 'tw:[&>svg]:text-secondary-foreground',\n success: 'tw:[&>svg]:text-success-foreground',\n warning: 'tw:[&>svg]:text-warning-foreground',\n danger: 'tw:[&>svg]:text-danger-foreground',\n info: 'tw:[&>svg]:text-info-foreground',\n light: 'tw:[&>svg]:text-light-foreground',\n dark: 'tw:[&>svg]:text-dark-foreground',\n accent: 'tw:[&>svg]:text-accent-foreground',\n destructive: 'tw:[&>svg]:text-destructive-foreground',\n muted: 'tw:[&>svg]:text-muted-foreground',\n link: 'tw:[&>svg]:text-primary',\n ghost: 'tw:[&>svg]:text-light-foreground',\n };\n return colors[variant];\n }\n\n private getOutlineSpinnerClasses(variant: VariantType) {\n const colors: Record<VariantType, string> = {\n primary: 'tw:[&>svg]:text-primary',\n secondary: 'tw:[&>svg]:text-secondary',\n success: 'tw:[&>svg]:text-success',\n warning: 'tw:[&>svg]:text-warning',\n danger: 'tw:[&>svg]:text-danger',\n info: 'tw:[&>svg]:text-info',\n light: 'tw:[&>svg]:text-light',\n dark: 'tw:[&>svg]:text-dark',\n accent: 'tw:[&>svg]:text-accent',\n destructive: 'tw:[&>svg]:text-destructive',\n muted: 'tw:[&>svg]:text-muted-foreground',\n link: 'tw:[&>svg]:text-primary',\n ghost: 'tw:[&>svg]:text-light-foreground',\n };\n return colors[variant];\n }\n}\n","/*\n * Public API Surface of button\n */\n\nimport { NgModule } from '@angular/core';\nimport { HlmButton } from './lib/button';\nexport * from './lib/button';\n\nexport const HlmButtonImports = [HlmButton] as const;\n\n@NgModule({\n imports: [...HlmButtonImports],\n exports: [...HlmButtonImports],\n})\nexport class HlmButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAQO,MAAM,cAAc,GAAG,GAAG,CAC/B;IACE,mBAAmB;IACnB,+BA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AAA,EAAA,CANK,SAAS,CAAA,EAAA,OAAA,EAAA,CAAT,SAAS,CAAA,EAAA,CAAA;AAM7B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAHb,gBAAgB,CAAA,EAAA,CAAA;;2FAGlB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,gBAAgB,CAAC;AAC9B,oBAAA,OAAO,EAAE,CAAC,GAAG,gBAAgB,CAAC;AAC/B,iBAAA;;;ACbD;;AAEG;;;;"}
|
package/button/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
|
14
14
|
type VariantType = NonNullable<ButtonVariants['variant']>;
|
|
15
15
|
type SizeType = NonNullable<ButtonVariants['size']>;
|
|
16
16
|
type AppearanceType = NonNullable<ButtonVariants['appearance']>;
|
|
17
|
-
declare class
|
|
17
|
+
declare class HlmButton {
|
|
18
18
|
/** Props */
|
|
19
19
|
variant: VariantType;
|
|
20
20
|
size: SizeType;
|
|
@@ -37,16 +37,16 @@ declare class EgButton {
|
|
|
37
37
|
private getOutlineFilledClasses;
|
|
38
38
|
private getSpinnerClasses;
|
|
39
39
|
private getOutlineSpinnerClasses;
|
|
40
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
41
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmButton, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmButton, "button[hlmButton], a[hlmButton]", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconPosition": { "alias": "iconPosition"; "required": false; }; "userClass": { "alias": "userClass"; "required": false; }; "spinnerUserClass": { "alias": "spinnerUserClass"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnButton; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
declare const
|
|
45
|
-
declare class
|
|
46
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
47
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<
|
|
48
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<
|
|
44
|
+
declare const HlmButtonImports: readonly [typeof HlmButton];
|
|
45
|
+
declare class HlmButtonModule {
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmButtonModule, never>;
|
|
47
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HlmButtonModule, never, [typeof HlmButton], [typeof HlmButton]>;
|
|
48
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HlmButtonModule>;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export {
|
|
51
|
+
export { HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants };
|
|
52
52
|
export type { AppearanceType, ButtonVariants, SizeType, VariantType };
|
|
@@ -3,62 +3,62 @@ import { input, computed, Directive, contentChild, contentChildren, effect, Chan
|
|
|
3
3
|
import { cn } from '@egose/shadcn-theme-ng/utils';
|
|
4
4
|
import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
|
|
5
5
|
|
|
6
|
-
class
|
|
6
|
+
class HlmError {
|
|
7
7
|
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
8
8
|
_computedClass = computed(() => cn('tw:text-destructive tw:block tw:text-sm tw:font-medium', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
9
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
10
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmError, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
10
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.0", type: HlmError, isStandalone: true, selector: "hlm-error", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
11
11
|
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmError, decorators: [{
|
|
13
13
|
type: Directive,
|
|
14
14
|
args: [{
|
|
15
|
-
selector: '
|
|
15
|
+
selector: 'hlm-error',
|
|
16
16
|
host: {
|
|
17
17
|
'[class]': '_computedClass()',
|
|
18
18
|
},
|
|
19
19
|
}]
|
|
20
20
|
}] });
|
|
21
21
|
|
|
22
|
-
class
|
|
22
|
+
class HlmFormField {
|
|
23
23
|
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
24
24
|
_computedClass = computed(() => cn('tw:block tw:space-y-2', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
25
25
|
control = contentChild(BrnFormFieldControl, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
26
|
-
errorChildren = contentChildren(
|
|
26
|
+
errorChildren = contentChildren(HlmError, ...(ngDevMode ? [{ debugName: "errorChildren" }] : []));
|
|
27
27
|
_hasDisplayedMessage = computed(() => this.errorChildren() && this.errorChildren().length > 0 && this.control()?.errorState() ? 'error' : 'hint', ...(ngDevMode ? [{ debugName: "_hasDisplayedMessage" }] : []));
|
|
28
28
|
constructor() {
|
|
29
29
|
effect(() => {
|
|
30
30
|
if (!this.control()) {
|
|
31
|
-
throw new Error('
|
|
31
|
+
throw new Error('hlm-form-field must contain a BrnFormFieldControl.');
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
36
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: HlmFormField, isStandalone: true, selector: "hlm-form-field", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, queries: [{ propertyName: "control", first: true, predicate: BrnFormFieldControl, descendants: true, isSignal: true }, { propertyName: "errorChildren", predicate: HlmError, isSignal: true }], ngImport: i0, template: `
|
|
37
37
|
<ng-content />
|
|
38
38
|
|
|
39
39
|
@switch (_hasDisplayedMessage()) {
|
|
40
40
|
@case ('error') {
|
|
41
|
-
<ng-content select="
|
|
41
|
+
<ng-content select="hlm-error" />
|
|
42
42
|
}
|
|
43
43
|
@default {
|
|
44
|
-
<ng-content select="
|
|
44
|
+
<ng-content select="hlm-hint" />
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
48
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormField, decorators: [{
|
|
50
50
|
type: Component,
|
|
51
51
|
args: [{
|
|
52
|
-
selector: '
|
|
52
|
+
selector: 'hlm-form-field',
|
|
53
53
|
template: `
|
|
54
54
|
<ng-content />
|
|
55
55
|
|
|
56
56
|
@switch (_hasDisplayedMessage()) {
|
|
57
57
|
@case ('error') {
|
|
58
|
-
<ng-content select="
|
|
58
|
+
<ng-content select="hlm-error" />
|
|
59
59
|
}
|
|
60
60
|
@default {
|
|
61
|
-
<ng-content select="
|
|
61
|
+
<ng-content select="hlm-hint" />
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
`,
|
|
@@ -69,16 +69,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
69
69
|
}]
|
|
70
70
|
}], ctorParameters: () => [] });
|
|
71
71
|
|
|
72
|
-
class
|
|
72
|
+
class HlmHint {
|
|
73
73
|
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
74
74
|
_computedClass = computed(() => cn('tw:text-muted-foreground tw:block tw:text-sm', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
75
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
76
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
75
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmHint, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
76
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.0", type: HlmHint, isStandalone: true, selector: "hlm-hint", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
77
77
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmHint, decorators: [{
|
|
79
79
|
type: Directive,
|
|
80
80
|
args: [{
|
|
81
|
-
selector: '
|
|
81
|
+
selector: 'hlm-hint',
|
|
82
82
|
host: {
|
|
83
83
|
'[class]': '_computedClass()',
|
|
84
84
|
},
|
|
@@ -88,17 +88,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
88
88
|
/*
|
|
89
89
|
* Public API Surface of form-field
|
|
90
90
|
*/
|
|
91
|
-
const
|
|
92
|
-
class
|
|
93
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
94
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
95
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
91
|
+
const HlmFormFieldImports = [HlmFormField, HlmError, HlmHint];
|
|
92
|
+
class HlmFormFieldModule {
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
94
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: HlmFormFieldModule, imports: [HlmFormField, HlmError, HlmHint], exports: [HlmFormField, HlmError, HlmHint] });
|
|
95
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormFieldModule });
|
|
96
96
|
}
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormFieldModule, decorators: [{
|
|
98
98
|
type: NgModule,
|
|
99
99
|
args: [{
|
|
100
|
-
imports: [...
|
|
101
|
-
exports: [...
|
|
100
|
+
imports: [...HlmFormFieldImports],
|
|
101
|
+
exports: [...HlmFormFieldImports],
|
|
102
102
|
}]
|
|
103
103
|
}] });
|
|
104
104
|
|
|
@@ -106,5 +106,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
106
106
|
* Generated bundle index. Do not edit.
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
|
-
export {
|
|
109
|
+
export { HlmError, HlmFormField, HlmFormFieldImports, HlmFormFieldModule, HlmHint };
|
|
110
110
|
//# sourceMappingURL=form-field.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.mjs","sources":["../../../projects/form-field/src/lib/error.ts","../../../projects/form-field/src/lib/form-field.ts","../../../projects/form-field/src/lib/hint.ts","../../../projects/form-field/src/public-api.ts","../../../projects/form-field/src/form-field.ts"],"sourcesContent":["import { computed, Directive, input } from '@angular/core';\nimport { cn } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Directive({\n selector: '
|
|
1
|
+
{"version":3,"file":"form-field.mjs","sources":["../../../projects/form-field/src/lib/error.ts","../../../projects/form-field/src/lib/form-field.ts","../../../projects/form-field/src/lib/hint.ts","../../../projects/form-field/src/public-api.ts","../../../projects/form-field/src/form-field.ts"],"sourcesContent":["import { computed, Directive, input } from '@angular/core';\nimport { cn } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Directive({\n selector: 'hlm-error',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmError {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() =>\n cn('tw:text-destructive tw:block tw:text-sm tw:font-medium', this.userClass()),\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n effect,\n input,\n} from '@angular/core';\nimport { BrnFormFieldControl } from '@spartan-ng/brain/form-field';\nimport { cn } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\nimport { HlmError } from './error';\n\n@Component({\n selector: 'hlm-form-field',\n template: `\n <ng-content />\n\n @switch (_hasDisplayedMessage()) {\n @case ('error') {\n <ng-content select=\"hlm-error\" />\n }\n @default {\n <ng-content select=\"hlm-hint\" />\n }\n }\n `,\n host: {\n '[class]': '_computedClass()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HlmFormField {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() => cn('tw:block tw:space-y-2', this.userClass()));\n public readonly control = contentChild(BrnFormFieldControl);\n\n public readonly errorChildren = contentChildren(HlmError);\n\n protected readonly _hasDisplayedMessage = computed<'error' | 'hint'>(() =>\n this.errorChildren() && this.errorChildren().length > 0 && this.control()?.errorState() ? 'error' : 'hint',\n );\n\n constructor() {\n effect(() => {\n if (!this.control()) {\n throw new Error('hlm-form-field must contain a BrnFormFieldControl.');\n }\n });\n }\n}\n","import { computed, Directive, input } from '@angular/core';\nimport { cn } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Directive({\n selector: 'hlm-hint',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmHint {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() =>\n cn('tw:text-muted-foreground tw:block tw:text-sm', this.userClass()),\n );\n}\n","/*\n * Public API Surface of form-field\n */\n\nimport { NgModule } from '@angular/core';\nimport { HlmError } from './lib/error';\nimport { HlmFormField } from './lib/form-field';\nimport { HlmHint } from './lib/hint';\n\nexport * from './lib/error';\nexport * from './lib/form-field';\nexport * from './lib/hint';\n\nexport const HlmFormFieldImports = [HlmFormField, HlmError, HlmHint];\n\n@NgModule({\n imports: [...HlmFormFieldImports],\n exports: [...HlmFormFieldImports],\n})\nexport class HlmFormFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,QAAQ,CAAA;AACH,IAAA,SAAS,GAAG,KAAK,CAAa,EAAE,6CAAI,KAAK,EAAE,OAAO,EAAA,CAAA,GAAA,CAAhB,EAAE,KAAK,EAAE,OAAO,EAAE,GAAC;AAClD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAC3C,EAAE,CAAC,wDAAwD,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,0DAC/E;uGAJU,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,kBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBANpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,kBAAkB;AAC9B,qBAAA;AACF,iBAAA;;;MCwBY,YAAY,CAAA;AACP,IAAA,SAAS,GAAG,KAAK,CAAa,EAAE,6CAAI,KAAK,EAAE,OAAO,EAAA,CAAA,GAAA,CAAhB,EAAE,KAAK,EAAE,OAAO,EAAE,GAAC;AAClD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,uB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