@spartan-ng/cli 0.0.1-alpha.334 → 0.0.1-alpha.336
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/package.json +1 -1
- package/src/generators/base/versions.d.ts +20 -20
- package/src/generators/base/versions.js +20 -20
- package/src/generators/base/versions.js.map +1 -1
- package/src/generators/ui/generator.js +6 -0
- package/src/generators/ui/generator.js.map +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-content.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-item.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion.directive.ts.template +1 -1
- package/src/generators/ui/libs/ui-badge-helm/files/lib/hlm-badge.directive.ts.template +16 -2
- package/src/generators/ui/libs/ui-checkbox-helm/files/index.ts.template +3 -3
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox-checkicon.component.ts.template +7 -1
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +120 -0
- package/src/generators/ui/libs/ui-switch-helm/files/index.ts.template +3 -3
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-ng-model.component.ignore.spec.ts.template +31 -0
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.component.ts.template +114 -0
- package/src/generators/ui/supported-ui-libraries.json +44 -41
- package/src/generators/ui/libs/ui-button-helm/files/.DS_Store.template +0 -0
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.directive.ts.template +0 -30
- package/src/generators/ui/libs/ui-dialog-helm/files/.DS_Store.template +0 -0
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.directive.ts.template +0 -26
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
export declare const FALLBACK_ANGULAR_VERSION = "^17.0.0";
|
|
2
2
|
export declare const NG_ICONS_VERSION = "^25.1.0";
|
|
3
|
-
export declare const SPARTAN_ACCORDION_BRAIN_VERSION = "0.0.1-alpha.
|
|
4
|
-
export declare const SPARTAN_ALERT_DIALOG_BRAIN_VERSION = "0.0.1-alpha.
|
|
5
|
-
export declare const SPARTAN_AVATAR_BRAIN_VERSION = "0.0.1-alpha.
|
|
6
|
-
export declare const SPARTAN_COMMAND_BRAIN_VERSION = "0.0.1-alpha.
|
|
7
|
-
export declare const SPARTAN_COLLAPSIBLE_BRAIN_VERSION = "0.0.1-alpha.
|
|
8
|
-
export declare const SPARTAN_CORE_VERSION = "0.0.1-alpha.
|
|
9
|
-
export declare const SPARTAN_DIALOG_BRAIN_VERSION = "0.0.1-alpha.
|
|
10
|
-
export declare const SPARTAN_HOVERCARD_BRAIN_VERSION = "0.0.1-alpha.
|
|
11
|
-
export declare const SPARTAN_LABEL_BRAIN_VERSION = "0.0.1-alpha.
|
|
12
|
-
export declare const SPARTAN_MENU_BRAIN_VERSION = "0.0.1-alpha.
|
|
13
|
-
export declare const SPARTAN_POPOVER_BRAIN_VERSION = "0.0.1-alpha.
|
|
14
|
-
export declare const SPARTAN_PROGRESS_BRAIN_VERSION = "0.0.1-alpha.
|
|
15
|
-
export declare const SPARTAN_RADIO_GROUP_BRAIN_VERSION = "0.0.1-alpha.
|
|
16
|
-
export declare const SPARTAN_SEPARATOR_BRAIN_VERSION = "0.0.1-alpha.
|
|
17
|
-
export declare const SPARTAN_SHEET_BRAIN_VERSION = "0.0.1-alpha.
|
|
18
|
-
export declare const SPARTAN_SWITCH_VERSION = "0.0.1-alpha.
|
|
19
|
-
export declare const SPARTAN_TABS_VERSION = "0.0.1-alpha.
|
|
20
|
-
export declare const SPARTAN_TABLE_VERSION = "0.0.1-alpha.
|
|
21
|
-
export declare const SPARTAN_TOGGLE_VERSION = "0.0.1-alpha.
|
|
22
|
-
export declare const TAILWIND_MERGE_VERSION = "^
|
|
3
|
+
export declare const SPARTAN_ACCORDION_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
4
|
+
export declare const SPARTAN_ALERT_DIALOG_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
5
|
+
export declare const SPARTAN_AVATAR_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
6
|
+
export declare const SPARTAN_COMMAND_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
7
|
+
export declare const SPARTAN_COLLAPSIBLE_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
8
|
+
export declare const SPARTAN_CORE_VERSION = "0.0.1-alpha.335";
|
|
9
|
+
export declare const SPARTAN_DIALOG_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
10
|
+
export declare const SPARTAN_HOVERCARD_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
11
|
+
export declare const SPARTAN_LABEL_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
12
|
+
export declare const SPARTAN_MENU_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
13
|
+
export declare const SPARTAN_POPOVER_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
14
|
+
export declare const SPARTAN_PROGRESS_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
15
|
+
export declare const SPARTAN_RADIO_GROUP_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
16
|
+
export declare const SPARTAN_SEPARATOR_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
17
|
+
export declare const SPARTAN_SHEET_BRAIN_VERSION = "0.0.1-alpha.335";
|
|
18
|
+
export declare const SPARTAN_SWITCH_VERSION = "0.0.1-alpha.335";
|
|
19
|
+
export declare const SPARTAN_TABS_VERSION = "0.0.1-alpha.335";
|
|
20
|
+
export declare const SPARTAN_TABLE_VERSION = "0.0.1-alpha.335";
|
|
21
|
+
export declare const SPARTAN_TOGGLE_VERSION = "0.0.1-alpha.335";
|
|
22
|
+
export declare const TAILWIND_MERGE_VERSION = "^2.2.0";
|
|
23
23
|
export declare const TAILWINDCSS_VERSION = "^3.0.2";
|
|
24
24
|
export declare const TAILWIND_ANIMATE_VERSION = "^1.0.6";
|
|
@@ -6,27 +6,27 @@ exports.FALLBACK_ANGULAR_VERSION = '^17.0.0';
|
|
|
6
6
|
// ng-icon dependency
|
|
7
7
|
exports.NG_ICONS_VERSION = '^25.1.0';
|
|
8
8
|
// spartan dependencies
|
|
9
|
-
exports.SPARTAN_ACCORDION_BRAIN_VERSION = '0.0.1-alpha.
|
|
10
|
-
exports.SPARTAN_ALERT_DIALOG_BRAIN_VERSION = '0.0.1-alpha.
|
|
11
|
-
exports.SPARTAN_AVATAR_BRAIN_VERSION = '0.0.1-alpha.
|
|
12
|
-
exports.SPARTAN_COMMAND_BRAIN_VERSION = '0.0.1-alpha.
|
|
13
|
-
exports.SPARTAN_COLLAPSIBLE_BRAIN_VERSION = '0.0.1-alpha.
|
|
14
|
-
exports.SPARTAN_CORE_VERSION = '0.0.1-alpha.
|
|
15
|
-
exports.SPARTAN_DIALOG_BRAIN_VERSION = '0.0.1-alpha.
|
|
16
|
-
exports.SPARTAN_HOVERCARD_BRAIN_VERSION = '0.0.1-alpha.
|
|
17
|
-
exports.SPARTAN_LABEL_BRAIN_VERSION = '0.0.1-alpha.
|
|
18
|
-
exports.SPARTAN_MENU_BRAIN_VERSION = '0.0.1-alpha.
|
|
19
|
-
exports.SPARTAN_POPOVER_BRAIN_VERSION = '0.0.1-alpha.
|
|
20
|
-
exports.SPARTAN_PROGRESS_BRAIN_VERSION = '0.0.1-alpha.
|
|
21
|
-
exports.SPARTAN_RADIO_GROUP_BRAIN_VERSION = '0.0.1-alpha.
|
|
22
|
-
exports.SPARTAN_SEPARATOR_BRAIN_VERSION = '0.0.1-alpha.
|
|
23
|
-
exports.SPARTAN_SHEET_BRAIN_VERSION = '0.0.1-alpha.
|
|
24
|
-
exports.SPARTAN_SWITCH_VERSION = '0.0.1-alpha.
|
|
25
|
-
exports.SPARTAN_TABS_VERSION = '0.0.1-alpha.
|
|
26
|
-
exports.SPARTAN_TABLE_VERSION = '0.0.1-alpha.
|
|
27
|
-
exports.SPARTAN_TOGGLE_VERSION = '0.0.1-alpha.
|
|
9
|
+
exports.SPARTAN_ACCORDION_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
10
|
+
exports.SPARTAN_ALERT_DIALOG_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
11
|
+
exports.SPARTAN_AVATAR_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
12
|
+
exports.SPARTAN_COMMAND_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
13
|
+
exports.SPARTAN_COLLAPSIBLE_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
14
|
+
exports.SPARTAN_CORE_VERSION = '0.0.1-alpha.335';
|
|
15
|
+
exports.SPARTAN_DIALOG_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
16
|
+
exports.SPARTAN_HOVERCARD_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
17
|
+
exports.SPARTAN_LABEL_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
18
|
+
exports.SPARTAN_MENU_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
19
|
+
exports.SPARTAN_POPOVER_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
20
|
+
exports.SPARTAN_PROGRESS_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
21
|
+
exports.SPARTAN_RADIO_GROUP_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
22
|
+
exports.SPARTAN_SEPARATOR_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
23
|
+
exports.SPARTAN_SHEET_BRAIN_VERSION = '0.0.1-alpha.335';
|
|
24
|
+
exports.SPARTAN_SWITCH_VERSION = '0.0.1-alpha.335';
|
|
25
|
+
exports.SPARTAN_TABS_VERSION = '0.0.1-alpha.335';
|
|
26
|
+
exports.SPARTAN_TABLE_VERSION = '0.0.1-alpha.335';
|
|
27
|
+
exports.SPARTAN_TOGGLE_VERSION = '0.0.1-alpha.335';
|
|
28
28
|
// dev dependencies
|
|
29
|
-
exports.TAILWIND_MERGE_VERSION = '^
|
|
29
|
+
exports.TAILWIND_MERGE_VERSION = '^2.2.0';
|
|
30
30
|
exports.TAILWINDCSS_VERSION = '^3.0.2';
|
|
31
31
|
exports.TAILWIND_ANIMATE_VERSION = '^1.0.6';
|
|
32
32
|
//# sourceMappingURL=versions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/base/versions.ts"],"names":[],"mappings":";;;AAAA,qBAAqB;AACR,QAAA,wBAAwB,GAAG,SAAS,CAAC;AAClD,qBAAqB;AACR,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAC1C,uBAAuB;AACV,QAAA,+BAA+B,GAAG,iBAAiB,CAAC;AACpD,QAAA,kCAAkC,GAAG,iBAAiB,CAAC;AACvD,QAAA,4BAA4B,GAAG,iBAAiB,CAAC;AACjD,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAClD,QAAA,iCAAiC,GAAG,iBAAiB,CAAC;AACtD,QAAA,oBAAoB,GAAG,iBAAiB,CAAC;AACzC,QAAA,4BAA4B,GAAG,iBAAiB,CAAC;AACjD,QAAA,+BAA+B,GAAG,iBAAiB,CAAC;AACpD,QAAA,2BAA2B,GAAG,iBAAiB,CAAC;AAChD,QAAA,0BAA0B,GAAG,iBAAiB,CAAC;AAC/C,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAClD,QAAA,8BAA8B,GAAG,iBAAiB,CAAC;AACnD,QAAA,iCAAiC,GAAG,iBAAiB,CAAC;AACtD,QAAA,+BAA+B,GAAG,iBAAiB,CAAC;AACpD,QAAA,2BAA2B,GAAG,iBAAiB,CAAC;AAChD,QAAA,sBAAsB,GAAG,iBAAiB,CAAC;AAC3C,QAAA,oBAAoB,GAAG,iBAAiB,CAAC;AACzC,QAAA,qBAAqB,GAAG,iBAAiB,CAAC;AAC1C,QAAA,sBAAsB,GAAG,iBAAiB,CAAC;AACxD,mBAAmB;AACN,QAAA,sBAAsB,GAAG,
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/base/versions.ts"],"names":[],"mappings":";;;AAAA,qBAAqB;AACR,QAAA,wBAAwB,GAAG,SAAS,CAAC;AAClD,qBAAqB;AACR,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAC1C,uBAAuB;AACV,QAAA,+BAA+B,GAAG,iBAAiB,CAAC;AACpD,QAAA,kCAAkC,GAAG,iBAAiB,CAAC;AACvD,QAAA,4BAA4B,GAAG,iBAAiB,CAAC;AACjD,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAClD,QAAA,iCAAiC,GAAG,iBAAiB,CAAC;AACtD,QAAA,oBAAoB,GAAG,iBAAiB,CAAC;AACzC,QAAA,4BAA4B,GAAG,iBAAiB,CAAC;AACjD,QAAA,+BAA+B,GAAG,iBAAiB,CAAC;AACpD,QAAA,2BAA2B,GAAG,iBAAiB,CAAC;AAChD,QAAA,0BAA0B,GAAG,iBAAiB,CAAC;AAC/C,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAClD,QAAA,8BAA8B,GAAG,iBAAiB,CAAC;AACnD,QAAA,iCAAiC,GAAG,iBAAiB,CAAC;AACtD,QAAA,+BAA+B,GAAG,iBAAiB,CAAC;AACpD,QAAA,2BAA2B,GAAG,iBAAiB,CAAC;AAChD,QAAA,sBAAsB,GAAG,iBAAiB,CAAC;AAC3C,QAAA,oBAAoB,GAAG,iBAAiB,CAAC;AACzC,QAAA,qBAAqB,GAAG,iBAAiB,CAAC;AAC1C,QAAA,sBAAsB,GAAG,iBAAiB,CAAC;AACxD,mBAAmB;AACN,QAAA,sBAAsB,GAAG,QAAQ,CAAC;AAClC,QAAA,mBAAmB,GAAG,QAAQ,CAAC;AAC/B,QAAA,wBAAwB,GAAG,QAAQ,CAAC"}
|
|
@@ -69,6 +69,9 @@ function createPrimitiveLibraries(response, availablePrimitiveNames, availablePr
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
const addIconForDependentPrimitive = (primitivesToCreate, primitivesDependingOnIcon) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
+
if (primitivesToCreate.includes('icon')) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
72
75
|
if (primitivesDependingOnIcon.some((primitive) => primitivesToCreate.includes(primitive))) {
|
|
73
76
|
//TODO: Need to check if icon is already installed and skip if it already is
|
|
74
77
|
const installIcon = (yield (0, enquirer_1.prompt)({
|
|
@@ -83,6 +86,9 @@ const addIconForDependentPrimitive = (primitivesToCreate, primitivesDependingOnI
|
|
|
83
86
|
}
|
|
84
87
|
});
|
|
85
88
|
const addButtonForDependentPrimitive = (primitivesToCreate, primitivesDependingOnBtn) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
+
if (primitivesToCreate.includes('button')) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
86
92
|
if (primitivesDependingOnBtn.some((primitive) => primitivesToCreate.includes(primitive))) {
|
|
87
93
|
//TODO: Need to check if icon is already installed and skip if it already is
|
|
88
94
|
const installBtn = (yield (0, enquirer_1.prompt)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/ui/generator.ts"],"names":[],"mappings":";;;AAAA,uCAAqG;AACrG,uCAAkC;AAElC,+CAAqE;AAGrE,SAA8B,cAAc,CAAC,IAAU,EAAE,OAAwD;;QAChH,MAAM,KAAK,GAAwB,EAAE,CAAC;QACtC,MAAM,mBAAmB,GAAG,2CAAa,+BAA+B,EAAC,CAAC;QAC1E,MAAM,uBAAuB,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAC/G,IAAI,QAAQ,GAA6B,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;QAC5D,IAAI,OAAO,CAAC,IAAI,IAAI,uBAA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AI,CAAC,EAAE;QACtB,IAAI,CAAC,MAAM,EAAE;YACZ,MAAM,IAAA,iBAAM,EAAC;gBACZ,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,uFAAuF;aAChG,CAAC,CAAC;SACH;QACD,iBAAiB,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;KAC1C;AACF,CAAC,CAAA,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { hlm } from '@spartan-ng/ui-core';
|
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
5
5
|
|
|
6
6
|
@Directive({
|
|
7
|
-
selector: '[hlmAccordionContent],brn-accordion-content[hlm]',
|
|
7
|
+
selector: '[hlmAccordionContent],brn-accordion-content [hlm], hlm-accordion-content:not(notHlm)',
|
|
8
8
|
standalone: true,
|
|
9
9
|
host: {
|
|
10
10
|
'[class]': '_computedClass()',
|
package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-item.directive.ts.template
CHANGED
|
@@ -4,7 +4,7 @@ import { hlm } from '@spartan-ng/ui-core';
|
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
5
5
|
|
|
6
6
|
@Directive({
|
|
7
|
-
selector: '[hlmAccordionItem],brn-accordion-item[hlm]',
|
|
7
|
+
selector: '[hlmAccordionItem],brn-accordion-item[hlm],hlm-accordion-item',
|
|
8
8
|
standalone: true,
|
|
9
9
|
host: {
|
|
10
10
|
'[class]': '_computedClass()',
|
|
@@ -4,7 +4,7 @@ import { cva, VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
5
5
|
|
|
6
6
|
export const badgeVariants = cva(
|
|
7
|
-
'inline-flex items-center border rounded-full px-2.5 py-0.5
|
|
7
|
+
'inline-flex items-center border rounded-full px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
@@ -13,6 +13,10 @@ export const badgeVariants = cva(
|
|
|
13
13
|
destructive: 'bg-destructive border-transparent text-destructive-foreground',
|
|
14
14
|
outline: 'text-foreground border-border',
|
|
15
15
|
},
|
|
16
|
+
size: {
|
|
17
|
+
default: 'text-xs',
|
|
18
|
+
lg: 'text-sm',
|
|
19
|
+
},
|
|
16
20
|
static: { true: '', false: '' },
|
|
17
21
|
},
|
|
18
22
|
compoundVariants: [
|
|
@@ -34,6 +38,7 @@ export const badgeVariants = cva(
|
|
|
34
38
|
],
|
|
35
39
|
defaultVariants: {
|
|
36
40
|
variant: 'default',
|
|
41
|
+
size: 'default',
|
|
37
42
|
static: false,
|
|
38
43
|
},
|
|
39
44
|
},
|
|
@@ -66,8 +71,17 @@ export class HlmBadgeDirective {
|
|
|
66
71
|
this._static.set(value);
|
|
67
72
|
}
|
|
68
73
|
|
|
74
|
+
private readonly _size = signal<badgeVariants['size']>('default');
|
|
75
|
+
@Input()
|
|
76
|
+
set size(size: badgeVariants['size']) {
|
|
77
|
+
this._size.set(size);
|
|
78
|
+
}
|
|
79
|
+
|
|
69
80
|
protected _computedClass = computed(() => this._generateClass());
|
|
70
81
|
private _generateClass() {
|
|
71
|
-
return hlm(
|
|
82
|
+
return hlm(
|
|
83
|
+
badgeVariants({ variant: this._variant(), size: this._size(), static: this._static() }),
|
|
84
|
+
this._userCls(),
|
|
85
|
+
);
|
|
72
86
|
}
|
|
73
87
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
import { HlmCheckboxCheckIconComponent } from './lib/hlm-checkbox-checkicon.component';
|
|
4
|
-
import {
|
|
4
|
+
import { HlmCheckboxComponent } from './lib/hlm-checkbox.component';
|
|
5
5
|
|
|
6
6
|
export * from './lib/hlm-checkbox-checkicon.component';
|
|
7
|
-
export * from './lib/hlm-checkbox.
|
|
7
|
+
export * from './lib/hlm-checkbox.component';
|
|
8
8
|
|
|
9
|
-
export const HlmCheckboxImports = [
|
|
9
|
+
export const HlmCheckboxImports = [HlmCheckboxComponent, HlmCheckboxCheckIconComponent] as const;
|
|
10
10
|
@NgModule({
|
|
11
11
|
imports: [...HlmCheckboxImports],
|
|
12
12
|
exports: [...HlmCheckboxImports],
|
|
@@ -14,7 +14,7 @@ import { ClassValue } from 'clsx';
|
|
|
14
14
|
'[class]': '_computedClass()',
|
|
15
15
|
},
|
|
16
16
|
template: `
|
|
17
|
-
<hlm-icon size="sm" name="
|
|
17
|
+
<hlm-icon size="sm" [name]="_iconName()" />
|
|
18
18
|
`,
|
|
19
19
|
})
|
|
20
20
|
export class HlmCheckboxCheckIconComponent {
|
|
@@ -26,6 +26,12 @@ export class HlmCheckboxCheckIconComponent {
|
|
|
26
26
|
this._userCls.set(userCls);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
protected readonly _iconName = signal<string>('radixCheck');
|
|
30
|
+
@Input()
|
|
31
|
+
set iconName(iconName: string) {
|
|
32
|
+
this._iconName.set(iconName);
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
protected _computedClass = computed(() => this._generateClass());
|
|
30
36
|
private _generateClass() {
|
|
31
37
|
return hlm(
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { booleanAttribute, Component, computed, EventEmitter, forwardRef, Input, Output, signal } from '@angular/core';
|
|
2
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import { BrnCheckboxComponent, indeterminateBooleanAttribute } from '@spartan-ng/ui-checkbox-brain';
|
|
4
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
5
|
+
import { ClassValue } from 'clsx';
|
|
6
|
+
import { HlmCheckboxCheckIconComponent } from './hlm-checkbox-checkicon.component';
|
|
7
|
+
|
|
8
|
+
export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
9
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10
|
+
useExisting: forwardRef(() => HlmCheckboxComponent),
|
|
11
|
+
multi: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'hlm-checkbox',
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [BrnCheckboxComponent, HlmCheckboxCheckIconComponent],
|
|
18
|
+
template: `
|
|
19
|
+
<brn-checkbox
|
|
20
|
+
[class]="_computedClass()"
|
|
21
|
+
[checked]="_checked()"
|
|
22
|
+
(changed)="_handleChange()"
|
|
23
|
+
(touched)="_onTouched()"
|
|
24
|
+
[disabled]="_disabled()"
|
|
25
|
+
[id]="id"
|
|
26
|
+
>
|
|
27
|
+
<hlm-checkbox-checkicon [iconName]="_checkIconName()" />
|
|
28
|
+
</brn-checkbox>
|
|
29
|
+
`,
|
|
30
|
+
host: {
|
|
31
|
+
class: 'contents',
|
|
32
|
+
'[attr.id]': 'null',
|
|
33
|
+
'[attr.aria-label]': 'null',
|
|
34
|
+
'[attr.aria-labelledby]': 'null',
|
|
35
|
+
'[attr.aria-describedby]': 'null',
|
|
36
|
+
},
|
|
37
|
+
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
38
|
+
})
|
|
39
|
+
export class HlmCheckboxComponent {
|
|
40
|
+
private readonly _userCls = signal<ClassValue>('');
|
|
41
|
+
@Input()
|
|
42
|
+
set class(userCls: ClassValue) {
|
|
43
|
+
this._userCls.set(userCls);
|
|
44
|
+
}
|
|
45
|
+
protected readonly _checkIconName = signal<string>('radixCheck');
|
|
46
|
+
@Input()
|
|
47
|
+
set checkIconName(checkIconName: string) {
|
|
48
|
+
this._checkIconName.set(checkIconName);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@Output()
|
|
52
|
+
public changed = new EventEmitter<boolean>();
|
|
53
|
+
|
|
54
|
+
protected _handleChange(): void {
|
|
55
|
+
if (this._disabled()) return;
|
|
56
|
+
|
|
57
|
+
const previousChecked = this._checked();
|
|
58
|
+
this._checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
|
|
59
|
+
this._onChange(!previousChecked);
|
|
60
|
+
this.changed.emit(!previousChecked);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
protected _checked = signal<boolean | 'indeterminate'>(false);
|
|
64
|
+
@Input({ transform: indeterminateBooleanAttribute })
|
|
65
|
+
set checked(value: boolean | 'indeterminate') {
|
|
66
|
+
this._checked.set(value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
protected readonly _disabled = signal(false);
|
|
70
|
+
@Input({ transform: booleanAttribute })
|
|
71
|
+
set disabled(value: boolean) {
|
|
72
|
+
this._disabled.set(value);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Used to set the id on the underlying brn element. */
|
|
76
|
+
@Input()
|
|
77
|
+
id: string | null = null;
|
|
78
|
+
|
|
79
|
+
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
80
|
+
@Input('aria-label')
|
|
81
|
+
ariaLabel: string | null = null;
|
|
82
|
+
|
|
83
|
+
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
84
|
+
@Input('aria-labelledby')
|
|
85
|
+
ariaLabelledby: string | null = null;
|
|
86
|
+
|
|
87
|
+
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
88
|
+
@Input('aria-describedby')
|
|
89
|
+
ariaDescribedby: string | null = null;
|
|
90
|
+
|
|
91
|
+
protected _computedClass = computed(() =>
|
|
92
|
+
hlm(
|
|
93
|
+
'group inline-flex border border-foreground shrink-0 cursor-pointer items-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring' +
|
|
94
|
+
' focus-visible:ring-offset-2 focus-visible:ring-offset-background data-[state=checked]:text-background data-[state=unchecked]:bg-foreground data-[state=checked]:bg-primary data-[state=unchecked]:bg-background',
|
|
95
|
+
this._disabled() ? 'cursor-not-allowed opacity-50' : '',
|
|
96
|
+
this._userCls(),
|
|
97
|
+
),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
/** CONROL VALUE ACCESSOR */
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
103
|
+
writeValue(value: any): void {
|
|
104
|
+
this.checked = !!value;
|
|
105
|
+
}
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars,,@typescript-eslint/no-explicit-any
|
|
107
|
+
protected _onChange = (_: any) => {};
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
109
|
+
protected _onTouched = () => {};
|
|
110
|
+
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
112
|
+
registerOnChange(fn: any): void {
|
|
113
|
+
this._onChange = fn;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
117
|
+
registerOnTouched(fn: any): void {
|
|
118
|
+
this._onTouched = fn;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
import { HlmSwitchThumbDirective } from './lib/hlm-switch-thumb.directive';
|
|
4
|
-
import {
|
|
4
|
+
import { HlmSwitchComponent } from './lib/hlm-switch.component';
|
|
5
5
|
|
|
6
6
|
export * from './lib/hlm-switch-thumb.directive';
|
|
7
|
-
export * from './lib/hlm-switch.
|
|
7
|
+
export * from './lib/hlm-switch.component';
|
|
8
8
|
|
|
9
|
-
export const HlmSwitchImports = [
|
|
9
|
+
export const HlmSwitchImports = [HlmSwitchComponent, HlmSwitchThumbDirective] as const;
|
|
10
10
|
@NgModule({
|
|
11
11
|
imports: [...HlmSwitchImports],
|
|
12
12
|
exports: [...HlmSwitchImports],
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { HlmSwitchComponent } from './hlm-switch.component';
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'hlm-switch-ng-model',
|
|
6
|
+
standalone: true,
|
|
7
|
+
template: `
|
|
8
|
+
<label class="flex items-center" hlmLabel>
|
|
9
|
+
<hlm-switch
|
|
10
|
+
[(ngModel)]="switchValue"
|
|
11
|
+
id="testSwitchForm"
|
|
12
|
+
aria-label="test switch"
|
|
13
|
+
(changed)="handleChange($event)"
|
|
14
|
+
/>
|
|
15
|
+
</label>
|
|
16
|
+
|
|
17
|
+
<p data-testid="switchValue">{{ switchValue }}</p>
|
|
18
|
+
<p data-testid="changedValue">{{ changedValueTo }}</p>
|
|
19
|
+
`,
|
|
20
|
+
imports: [HlmSwitchComponent, FormsModule],
|
|
21
|
+
})
|
|
22
|
+
export class SwitchFormComponent {
|
|
23
|
+
@Input()
|
|
24
|
+
public switchValue = false;
|
|
25
|
+
|
|
26
|
+
protected changedValueTo: boolean | undefined;
|
|
27
|
+
|
|
28
|
+
handleChange(value: boolean) {
|
|
29
|
+
this.changedValueTo = value;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, booleanAttribute, computed, forwardRef, signal } from '@angular/core';
|
|
2
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import { hlm } from '@spartan-ng/ui-core';
|
|
4
|
+
import { BrnSwitchComponent, BrnSwitchThumbComponent } from '@spartan-ng/ui-switch-brain';
|
|
5
|
+
import { ClassValue } from 'clsx';
|
|
6
|
+
import { HlmSwitchThumbDirective } from './hlm-switch-thumb.directive';
|
|
7
|
+
|
|
8
|
+
export const HLM_SWITCH_VALUE_ACCESSOR = {
|
|
9
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10
|
+
useExisting: forwardRef(() => HlmSwitchComponent),
|
|
11
|
+
multi: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'hlm-switch',
|
|
16
|
+
imports: [BrnSwitchThumbComponent, BrnSwitchComponent, HlmSwitchThumbDirective],
|
|
17
|
+
standalone: true,
|
|
18
|
+
host: {
|
|
19
|
+
class: 'contents',
|
|
20
|
+
'[attr.id]': 'null',
|
|
21
|
+
'[attr.aria-label]': 'null',
|
|
22
|
+
'[attr.aria-labelledby]': 'null',
|
|
23
|
+
'[attr.aria-describedby]': 'null',
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<brn-switch
|
|
27
|
+
[class]="_computedClass()"
|
|
28
|
+
[checked]="_checked()"
|
|
29
|
+
(changed)="_handleChange($event)"
|
|
30
|
+
(touched)="_onTouched()"
|
|
31
|
+
[disabled]="_disabled()"
|
|
32
|
+
[id]="id"
|
|
33
|
+
[aria-label]="ariaLabel"
|
|
34
|
+
[aria-labelledby]="ariaLabelledby"
|
|
35
|
+
[aria-describedby]="ariaDescribedby"
|
|
36
|
+
>
|
|
37
|
+
<brn-switch-thumb hlm />
|
|
38
|
+
</brn-switch>
|
|
39
|
+
`,
|
|
40
|
+
providers: [HLM_SWITCH_VALUE_ACCESSOR],
|
|
41
|
+
})
|
|
42
|
+
export class HlmSwitchComponent {
|
|
43
|
+
private readonly _userCls = signal<ClassValue>('');
|
|
44
|
+
@Input()
|
|
45
|
+
set class(userCls: ClassValue) {
|
|
46
|
+
this._userCls.set(userCls);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@Output()
|
|
50
|
+
public changed = new EventEmitter<boolean>();
|
|
51
|
+
|
|
52
|
+
protected _handleChange(value: boolean): void {
|
|
53
|
+
this._checked.set(value);
|
|
54
|
+
this._onChange(value);
|
|
55
|
+
this.changed.emit(value);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
protected _checked = signal(false);
|
|
59
|
+
@Input({ transform: booleanAttribute })
|
|
60
|
+
set checked(value: boolean) {
|
|
61
|
+
this._checked.set(value);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected readonly _disabled = signal(false);
|
|
65
|
+
@Input({ transform: booleanAttribute })
|
|
66
|
+
set disabled(value: boolean) {
|
|
67
|
+
this._disabled.set(value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Used to set the id on the underlying brn element. */
|
|
71
|
+
@Input()
|
|
72
|
+
id: string | null = null;
|
|
73
|
+
|
|
74
|
+
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
75
|
+
@Input('aria-label')
|
|
76
|
+
ariaLabel: string | null = null;
|
|
77
|
+
|
|
78
|
+
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
79
|
+
@Input('aria-labelledby')
|
|
80
|
+
ariaLabelledby: string | null = null;
|
|
81
|
+
|
|
82
|
+
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
83
|
+
@Input('aria-describedby')
|
|
84
|
+
ariaDescribedby: string | null = null;
|
|
85
|
+
|
|
86
|
+
protected _computedClass = computed(() =>
|
|
87
|
+
hlm(
|
|
88
|
+
'group inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
|
89
|
+
this._disabled() ? 'cursor-not-allowed opacity-50' : '',
|
|
90
|
+
this._userCls(),
|
|
91
|
+
),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
/** CONROL VALUE ACCESSOR */
|
|
95
|
+
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
|
+
writeValue(value: any): void {
|
|
98
|
+
this.checked = !!value;
|
|
99
|
+
}
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars,,@typescript-eslint/no-explicit-any
|
|
101
|
+
protected _onChange = (_: any) => {};
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
103
|
+
protected _onTouched = () => {};
|
|
104
|
+
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
106
|
+
registerOnChange(fn: any): void {
|
|
107
|
+
this._onChange = fn;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
|
+
registerOnTouched(fn: any): void {
|
|
112
|
+
this._onTouched = fn;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"internalName": "ui-accordion-helm",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/core": "^17.0.0",
|
|
6
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
6
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
7
7
|
"clsx": "^1.2.1",
|
|
8
|
-
"@spartan-ng/ui-accordion-brain": "0.0.1-alpha.
|
|
8
|
+
"@spartan-ng/ui-accordion-brain": "0.0.1-alpha.335",
|
|
9
9
|
"@ng-icons/radix-icons": "^25.1.0"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"internalName": "ui-alert-helm",
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@angular/core": "^17.0.0",
|
|
16
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
16
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
17
17
|
"class-variance-authority": "^0.6.0",
|
|
18
18
|
"clsx": "^1.2.1"
|
|
19
19
|
}
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"internalName": "ui-alert-dialog-helm",
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@angular/core": "^17.0.0",
|
|
25
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
25
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
26
26
|
"clsx": "^1.2.1",
|
|
27
|
-
"@spartan-ng/ui-alertdialog-brain": "0.0.1-alpha.
|
|
28
|
-
"@spartan-ng/ui-dialog-brain": "0.0.1-alpha.
|
|
27
|
+
"@spartan-ng/ui-alertdialog-brain": "0.0.1-alpha.335",
|
|
28
|
+
"@spartan-ng/ui-dialog-brain": "0.0.1-alpha.335"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"aspectratio": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@angular/core": "^17.0.0",
|
|
35
35
|
"@angular/cdk": "^17.0.0",
|
|
36
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
36
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
37
37
|
"clsx": "^1.2.1"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"internalName": "ui-avatar-helm",
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@angular/core": "^17.0.0",
|
|
44
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
44
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
45
45
|
"clsx": "^1.2.1",
|
|
46
46
|
"class-variance-authority": "^0.6.0"
|
|
47
47
|
}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"internalName": "ui-badge-helm",
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@angular/core": "^17.0.0",
|
|
53
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
53
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
54
54
|
"class-variance-authority": "^0.6.0",
|
|
55
55
|
"clsx": "^1.2.1"
|
|
56
56
|
}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"internalName": "ui-button-helm",
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@angular/core": "^17.0.0",
|
|
62
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
62
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
63
63
|
"class-variance-authority": "^0.6.0",
|
|
64
64
|
"clsx": "^1.2.1"
|
|
65
65
|
}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"internalName": "ui-card-helm",
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@angular/core": "^17.0.0",
|
|
71
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
71
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
72
72
|
"class-variance-authority": "^0.6.0",
|
|
73
73
|
"clsx": "^1.2.1"
|
|
74
74
|
}
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"internalName": "ui-command-helm",
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"@angular/core": "^17.0.0",
|
|
80
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
80
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
81
81
|
"clsx": "^1.2.1"
|
|
82
82
|
}
|
|
83
83
|
},
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"internalName": "ui-dialog-helm",
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@angular/core": "^17.0.0",
|
|
88
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
88
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
89
89
|
"clsx": "^1.2.1",
|
|
90
|
-
"@spartan-ng/ui-dialog-brain": "0.0.1-alpha.
|
|
90
|
+
"@spartan-ng/ui-dialog-brain": "0.0.1-alpha.335",
|
|
91
91
|
"@ng-icons/radix-icons": "^25.1.0"
|
|
92
92
|
}
|
|
93
93
|
},
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"@angular/core": "^17.0.0",
|
|
98
98
|
"@angular/common": "^17.0.0",
|
|
99
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
99
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
100
100
|
"@ng-icons/core": "^25.1.0",
|
|
101
101
|
"class-variance-authority": "^0.6.0",
|
|
102
102
|
"clsx": "^1.2.1"
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"internalName": "ui-input-helm",
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"@angular/core": "^17.0.0",
|
|
109
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
109
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
110
110
|
"class-variance-authority": "^0.6.0",
|
|
111
111
|
"clsx": "^1.2.1"
|
|
112
112
|
}
|
|
@@ -115,28 +115,28 @@
|
|
|
115
115
|
"internalName": "ui-label-helm",
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"@angular/core": "^17.0.0",
|
|
118
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
118
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
119
119
|
"class-variance-authority": "^0.6.0",
|
|
120
120
|
"clsx": "^1.2.1",
|
|
121
|
-
"@spartan-ng/ui-label-brain": "0.0.1-alpha.
|
|
121
|
+
"@spartan-ng/ui-label-brain": "0.0.1-alpha.335"
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"menu": {
|
|
125
125
|
"internalName": "ui-menu-helm",
|
|
126
126
|
"peerDependencies": {
|
|
127
127
|
"@angular/core": "^17.0.0",
|
|
128
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
128
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
129
129
|
"@ng-icons/radix-icons": "^25.1.0",
|
|
130
130
|
"clsx": "^1.2.1",
|
|
131
131
|
"class-variance-authority": "^0.6.0",
|
|
132
|
-
"@spartan-ng/ui-menu-brain": "0.0.1-alpha.
|
|
132
|
+
"@spartan-ng/ui-menu-brain": "0.0.1-alpha.335"
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
"popover": {
|
|
136
136
|
"internalName": "ui-popover-helm",
|
|
137
137
|
"peerDependencies": {
|
|
138
138
|
"@angular/core": "^17.0.0",
|
|
139
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
139
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
140
140
|
"clsx": "^1.2.1"
|
|
141
141
|
}
|
|
142
142
|
},
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"internalName": "ui-progress-helm",
|
|
145
145
|
"peerDependencies": {
|
|
146
146
|
"@angular/core": "^17.0.0",
|
|
147
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
147
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
148
148
|
"clsx": "^1.2.1"
|
|
149
149
|
}
|
|
150
150
|
},
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"internalName": "ui-radio-group-helm",
|
|
153
153
|
"peerDependencies": {
|
|
154
154
|
"@angular/core": "^17.0.0",
|
|
155
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
155
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
156
156
|
"clsx": "^1.2.1"
|
|
157
157
|
}
|
|
158
158
|
},
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"internalName": "ui-scroll-area-helm",
|
|
161
161
|
"peerDependencies": {
|
|
162
162
|
"@angular/core": "^17.0.0",
|
|
163
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
163
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
164
164
|
"ngx-scrollbar": "^13.0.1",
|
|
165
165
|
"clsx": "^1.2.1"
|
|
166
166
|
}
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"internalName": "ui-separator-helm",
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@angular/core": "^17.0.0",
|
|
172
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
172
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
173
173
|
"clsx": "^1.2.1"
|
|
174
174
|
}
|
|
175
175
|
},
|
|
@@ -177,19 +177,19 @@
|
|
|
177
177
|
"internalName": "ui-sheet-helm",
|
|
178
178
|
"peerDependencies": {
|
|
179
179
|
"@angular/core": "^17.0.0",
|
|
180
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
180
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
181
181
|
"clsx": "^1.2.1",
|
|
182
182
|
"class-variance-authority": "^0.6.0",
|
|
183
183
|
"@ng-icons/radix-icons": "^25.1.0",
|
|
184
|
-
"@spartan-ng/ui-sheet-brain": "0.0.1-alpha.
|
|
185
|
-
"@spartan-ng/ui-dialog-brain": "0.0.1-alpha.
|
|
184
|
+
"@spartan-ng/ui-sheet-brain": "0.0.1-alpha.335",
|
|
185
|
+
"@spartan-ng/ui-dialog-brain": "0.0.1-alpha.335"
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
188
|
"skeleton": {
|
|
189
189
|
"internalName": "ui-skeleton-helm",
|
|
190
190
|
"peerDependencies": {
|
|
191
191
|
"@angular/core": "^17.0.0",
|
|
192
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
192
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
193
193
|
"clsx": "^1.2.1"
|
|
194
194
|
}
|
|
195
195
|
},
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"internalName": "ui-spinner-helm",
|
|
198
198
|
"peerDependencies": {
|
|
199
199
|
"@angular/core": "^17.0.0",
|
|
200
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
200
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
201
201
|
"class-variance-authority": "^0.6.0",
|
|
202
202
|
"clsx": "^1.2.1"
|
|
203
203
|
}
|
|
@@ -206,25 +206,27 @@
|
|
|
206
206
|
"internalName": "ui-switch-helm",
|
|
207
207
|
"peerDependencies": {
|
|
208
208
|
"@angular/core": "^17.0.0",
|
|
209
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
210
|
-
"
|
|
209
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
210
|
+
"@spartan-ng/ui-switch-brain": "0.0.1-alpha.335",
|
|
211
|
+
"clsx": "^1.2.1",
|
|
212
|
+
"@angular/forms": "^17.0.0"
|
|
211
213
|
}
|
|
212
214
|
},
|
|
213
215
|
"tabs": {
|
|
214
216
|
"internalName": "ui-tabs-helm",
|
|
215
217
|
"peerDependencies": {
|
|
216
218
|
"@angular/core": "^17.0.0",
|
|
217
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
219
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
218
220
|
"clsx": "^1.2.1",
|
|
219
221
|
"class-variance-authority": "^0.6.0",
|
|
220
|
-
"@spartan-ng/ui-tabs-brain": "0.0.1-alpha.
|
|
222
|
+
"@spartan-ng/ui-tabs-brain": "0.0.1-alpha.335"
|
|
221
223
|
}
|
|
222
224
|
},
|
|
223
225
|
"toggle": {
|
|
224
226
|
"internalName": "ui-toggle-helm",
|
|
225
227
|
"peerDependencies": {
|
|
226
228
|
"@angular/core": "^17.0.0",
|
|
227
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
229
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
228
230
|
"clsx": "^1.2.1",
|
|
229
231
|
"class-variance-authority": "^0.6.0"
|
|
230
232
|
}
|
|
@@ -233,7 +235,7 @@
|
|
|
233
235
|
"internalName": "ui-typography-helm",
|
|
234
236
|
"peerDependencies": {
|
|
235
237
|
"@angular/core": "^17.0.0",
|
|
236
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
238
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
237
239
|
"clsx": "^1.2.1"
|
|
238
240
|
}
|
|
239
241
|
},
|
|
@@ -242,7 +244,7 @@
|
|
|
242
244
|
"peerDependencies": {
|
|
243
245
|
"@angular/common": "^17.0.0",
|
|
244
246
|
"@angular/core": "^17.0.0",
|
|
245
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
247
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
246
248
|
"clsx": "^1.2.1"
|
|
247
249
|
}
|
|
248
250
|
},
|
|
@@ -250,7 +252,7 @@
|
|
|
250
252
|
"internalName": "ui-hover-card-helm",
|
|
251
253
|
"peerDependencies": {
|
|
252
254
|
"@angular/core": "^17.0.0",
|
|
253
|
-
"@spartan-ng/ui-core": "0.0.1-alpha.
|
|
255
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
254
256
|
"clsx": "^1.2.1"
|
|
255
257
|
}
|
|
256
258
|
},
|
|
@@ -258,8 +260,9 @@
|
|
|
258
260
|
"internalName": "ui-checkbox-helm",
|
|
259
261
|
"peerDependencies": {
|
|
260
262
|
"@angular/core": "^17.0.0",
|
|
261
|
-
"@
|
|
262
|
-
"@spartan-ng/ui-
|
|
263
|
+
"@angular/forms": "^17.0.0",
|
|
264
|
+
"@spartan-ng/ui-core": "0.0.1-alpha.335",
|
|
265
|
+
"@spartan-ng/ui-checkbox-brain": "0.0.1-alpha.335",
|
|
263
266
|
"clsx": "^1.2.1",
|
|
264
267
|
"@ng-icons/radix-icons": "^25.1.0"
|
|
265
268
|
}
|
|
@@ -268,7 +271,7 @@
|
|
|
268
271
|
"internalName": "ui-tooltip-helm",
|
|
269
272
|
"peerDependencies": {
|
|
270
273
|
"@angular/core": "^17.0.0",
|
|
271
|
-
"@spartan-ng/ui-tooltip-brain": "0.0.1-alpha.
|
|
274
|
+
"@spartan-ng/ui-tooltip-brain": "0.0.1-alpha.335"
|
|
272
275
|
}
|
|
273
276
|
}
|
|
274
277
|
}
|
|
Binary file
|
package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.directive.ts.template
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { computed, Directive, inject, Input, signal } from '@angular/core';
|
|
2
|
-
import { BrnCheckboxComponent } from '@spartan-ng/ui-checkbox-brain';
|
|
3
|
-
import { hlm } from '@spartan-ng/ui-core';
|
|
4
|
-
import { ClassValue } from 'clsx';
|
|
5
|
-
|
|
6
|
-
@Directive({
|
|
7
|
-
selector: 'brn-checkbox[hlm],[hlmCheckbox]',
|
|
8
|
-
standalone: true,
|
|
9
|
-
host: {
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
|
-
},
|
|
12
|
-
})
|
|
13
|
-
export class HlmCheckboxDirective {
|
|
14
|
-
private readonly _brnCheckbox = inject(BrnCheckboxComponent);
|
|
15
|
-
private readonly _userCls = signal<ClassValue>('');
|
|
16
|
-
@Input()
|
|
17
|
-
set class(userCls: ClassValue) {
|
|
18
|
-
this._userCls.set(userCls);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
22
|
-
private _generateClass() {
|
|
23
|
-
return hlm(
|
|
24
|
-
'group inline-flex border border-foreground shrink-0 cursor-pointer items-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring' +
|
|
25
|
-
' focus-visible:ring-offset-2 focus-visible:ring-offset-background data-[state=checked]:text-background data-[state=unchecked]:bg-foreground data-[state=checked]:bg-primary data-[state=unchecked]:bg-background',
|
|
26
|
-
this._brnCheckbox.disabled ? 'cursor-not-allowed opacity-50' : '',
|
|
27
|
-
this._userCls(),
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
Binary file
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Directive, Input, computed, signal } from '@angular/core';
|
|
2
|
-
import { hlm } from '@spartan-ng/ui-core';
|
|
3
|
-
import { ClassValue } from 'clsx';
|
|
4
|
-
|
|
5
|
-
@Directive({
|
|
6
|
-
selector: 'brn-switch[hlm],[hlmSwitch]',
|
|
7
|
-
standalone: true,
|
|
8
|
-
host: {
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
|
-
},
|
|
11
|
-
})
|
|
12
|
-
export class HlmSwitchDirective {
|
|
13
|
-
private readonly _userCls = signal<ClassValue>('');
|
|
14
|
-
@Input()
|
|
15
|
-
set class(userCls: ClassValue) {
|
|
16
|
-
this._userCls.set(userCls);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected _computedClass = computed(() => this._generateClass());
|
|
20
|
-
private _generateClass() {
|
|
21
|
-
return hlm(
|
|
22
|
-
'group inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
|
23
|
-
this._userCls(),
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
}
|