@egose/shadcn-theme-ng 0.0.18 → 0.0.19

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.
@@ -0,0 +1,137 @@
1
+ import * as i0 from '@angular/core';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { ClassValue } from 'clsx';
4
+ import * as i1 from '@spartan-ng/brain/menu';
5
+ import { BooleanInput } from '@angular/cdk/coercion';
6
+
7
+ declare const menuVariants: (props?: ({
8
+ variant?: "default" | "menubar" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ declare class HlmMenu {
11
+ readonly userClass: i0.InputSignal<ClassValue>;
12
+ protected readonly _computedClass: i0.Signal<string>;
13
+ readonly variant: i0.InputSignal<"default" | "menubar" | null | undefined>;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenu, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenu, "hlm-menu", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnMenu; inputs: {}; outputs: {}; }]>;
16
+ }
17
+
18
+ declare class HlmMenuBar {
19
+ readonly userClass: i0.InputSignal<ClassValue>;
20
+ protected _computedClass: i0.Signal<string>;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuBar, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuBar, "hlm-menu-bar", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnMenuBar; inputs: {}; outputs: {}; }]>;
23
+ }
24
+
25
+ declare class HlmMenuBarItem {
26
+ readonly userClass: i0.InputSignal<ClassValue>;
27
+ protected readonly _computedClass: i0.Signal<string>;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuBarItem, never>;
29
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuBarItem, "[hlmMenuBarItem]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnMenuItem; inputs: {}; outputs: {}; }]>;
30
+ }
31
+
32
+ declare class HlmMenuGroup {
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuGroup, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuGroup, "hlm-menu-group", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.BrnMenuGroup; inputs: {}; outputs: {}; }]>;
35
+ }
36
+
37
+ declare class HlmMenuLabel {
38
+ readonly inset: i0.InputSignalWithTransform<boolean, BooleanInput>;
39
+ readonly userClass: i0.InputSignal<ClassValue>;
40
+ protected _computedClass: i0.Signal<string>;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuLabel, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuLabel, "hlm-menu-label", never, { "inset": { "alias": "inset"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
43
+ }
44
+
45
+ declare class HlmMenuSeparator {
46
+ readonly userClass: i0.InputSignal<ClassValue>;
47
+ protected readonly _computedClass: i0.Signal<string>;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuSeparator, never>;
49
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuSeparator, "hlm-menu-separator", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
50
+ }
51
+
52
+ declare class HlmSubMenu {
53
+ readonly userClass: i0.InputSignal<ClassValue>;
54
+ protected readonly _computedClass: i0.Signal<string>;
55
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmSubMenu, never>;
56
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmSubMenu, "hlm-sub-menu", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnMenu; inputs: {}; outputs: {}; }]>;
57
+ }
58
+
59
+ declare class HlmMenuItem {
60
+ readonly variant: i0.InputSignal<"default" | "destructive">;
61
+ readonly inset: i0.InputSignalWithTransform<boolean, BooleanInput>;
62
+ readonly userClass: i0.InputSignal<ClassValue>;
63
+ protected readonly _computedClass: i0.Signal<string>;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItem, never>;
65
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuItem, "[hlmMenuItem]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "inset": { "alias": "inset"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnMenuItem; inputs: { "disabled": "disabled"; }; outputs: { "triggered": "triggered"; }; }]>;
66
+ }
67
+
68
+ declare class HlmMenuItemIcon {
69
+ readonly userClass: i0.InputSignal<ClassValue>;
70
+ protected _computedClass: i0.Signal<string>;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemIcon, never>;
72
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuItemIcon, "[hlmMenuIcon]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
73
+ }
74
+
75
+ declare class HlmMenuItemSubIndicator {
76
+ readonly userClass: i0.InputSignal<ClassValue>;
77
+ protected readonly _computedClass: i0.Signal<string>;
78
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemSubIndicator, never>;
79
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuItemSubIndicator, "hlm-menu-item-sub-indicator", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
80
+ }
81
+
82
+ declare class HlmMenuItemRadioIndicator {
83
+ readonly userClass: i0.InputSignal<ClassValue>;
84
+ protected readonly _computedClass: i0.Signal<string>;
85
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemRadioIndicator, never>;
86
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuItemRadioIndicator, "hlm-menu-item-radio", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
87
+ }
88
+
89
+ declare class HlmMenuItemCheck {
90
+ readonly userClass: i0.InputSignal<ClassValue>;
91
+ protected _computedClass: i0.Signal<string>;
92
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemCheck, never>;
93
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuItemCheck, "hlm-menu-item-check", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
94
+ }
95
+
96
+ declare class HlmMenuShortcut {
97
+ readonly userClass: i0.InputSignal<ClassValue>;
98
+ protected _computedClass: i0.Signal<string>;
99
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuShortcut, never>;
100
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuShortcut, "hlm-menu-shortcut", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
101
+ }
102
+
103
+ declare class HlmMenuItemCheckbox {
104
+ readonly userClass: i0.InputSignal<ClassValue>;
105
+ protected readonly _computedClass: i0.Signal<string>;
106
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemCheckbox, never>;
107
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuItemCheckbox, "[hlmMenuItemCheckbox]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnMenuItemCheckbox; inputs: { "disabled": "disabled"; "checked": "checked"; }; outputs: { "triggered": "triggered"; }; }]>;
108
+ }
109
+
110
+ declare class HlmMenuItemRadio {
111
+ readonly userClass: i0.InputSignal<ClassValue>;
112
+ protected readonly _computedClass: i0.Signal<string>;
113
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemRadio, never>;
114
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuItemRadio, "[hlmMenuItemRadio]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnMenuItemRadio; inputs: { "disabled": "disabled"; "checked": "checked"; }; outputs: { "triggered": "triggered"; }; }]>;
115
+ }
116
+
117
+ declare const HlmMenuItemImports: (typeof HlmMenuGroup)[];
118
+ declare const HlmMenuStructureImports: readonly [typeof HlmMenuLabel, typeof HlmMenuSeparator];
119
+ declare const HlmMenuImports: readonly [...(typeof HlmMenuGroup)[], typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu];
120
+ declare const HlmMenuBarImports: readonly [...(typeof HlmMenuGroup)[], typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu, typeof HlmMenuBar, typeof HlmMenuBarItem];
121
+ declare class HlmMenuItemModule {
122
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemModule, never>;
123
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HlmMenuItemModule, never, [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio], [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio]>;
124
+ static ɵinj: i0.ɵɵInjectorDeclaration<HlmMenuItemModule>;
125
+ }
126
+ declare class HlmMenuModule {
127
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuModule, never>;
128
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HlmMenuModule, never, [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio, typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu], [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio, typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu]>;
129
+ static ɵinj: i0.ɵɵInjectorDeclaration<HlmMenuModule>;
130
+ }
131
+ declare class HlmMenuBarModule {
132
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuBarModule, never>;
133
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HlmMenuBarModule, never, [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio, typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu, typeof HlmMenuBar, typeof HlmMenuBarItem], [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio, typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu, typeof HlmMenuBar, typeof HlmMenuBarItem]>;
134
+ static ɵinj: i0.ɵɵInjectorDeclaration<HlmMenuBarModule>;
135
+ }
136
+
137
+ export { HlmMenu, HlmMenuBar, HlmMenuBarImports, HlmMenuBarItem, HlmMenuBarModule, HlmMenuGroup, HlmMenuImports, HlmMenuItem, HlmMenuItemCheck, HlmMenuItemCheckbox, HlmMenuItemIcon, HlmMenuItemImports, HlmMenuItemModule, HlmMenuItemRadio, HlmMenuItemRadioIndicator, HlmMenuItemSubIndicator, HlmMenuLabel, HlmMenuModule, HlmMenuSeparator, HlmMenuShortcut, HlmMenuStructureImports, HlmSubMenu, menuVariants };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.18",
2
+ "version": "0.0.19",
3
3
  "description": "Angular shadcn UI theme",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
@@ -51,6 +51,10 @@
51
51
  "types": "./alert/index.d.ts",
52
52
  "default": "./alert/fesm2022/alert.mjs"
53
53
  },
54
+ "./switch": {
55
+ "types": "./switch/index.d.ts",
56
+ "default": "./switch/fesm2022/switch.mjs"
57
+ },
54
58
  "./label": {
55
59
  "types": "./label/index.d.ts",
56
60
  "default": "./label/fesm2022/label.mjs"
@@ -83,6 +87,10 @@
83
87
  "types": "./dialog/index.d.ts",
84
88
  "default": "./dialog/fesm2022/dialog.mjs"
85
89
  },
90
+ "./menu": {
91
+ "types": "./menu/index.d.ts",
92
+ "default": "./menu/fesm2022/menu.mjs"
93
+ },
86
94
  "./radio-group": {
87
95
  "types": "./radio-group/index.d.ts",
88
96
  "default": "./radio-group/fesm2022/radio-group.mjs"
@@ -146,6 +154,10 @@
146
154
  "./form-checkbox": {
147
155
  "types": "./form-checkbox/index.d.ts",
148
156
  "default": "./form-checkbox/fesm2022/form-checkbox.mjs"
157
+ },
158
+ "./layout-simple": {
159
+ "types": "./layout-simple/index.d.ts",
160
+ "default": "./layout-simple/fesm2022/layout-simple.mjs"
149
161
  }
150
162
  }
151
163
  }
@@ -0,0 +1,64 @@
1
+ # Switch
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+
9
+ ```bash
10
+ ng generate component component-name
11
+ ```
12
+
13
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
+
15
+ ```bash
16
+ ng generate --help
17
+ ```
18
+
19
+ ## Building
20
+
21
+ To build the library, run:
22
+
23
+ ```bash
24
+ ng build switch
25
+ ```
26
+
27
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
+
29
+ ### Publishing the Library
30
+
31
+ Once the project is built, you can publish your library by following these steps:
32
+
33
+ 1. Navigate to the `dist` directory:
34
+
35
+ ```bash
36
+ cd dist/switch
37
+ ```
38
+
39
+ 2. Run the `npm publish` command to publish your library to the npm registry:
40
+ ```bash
41
+ npm publish
42
+ ```
43
+
44
+ ## Running unit tests
45
+
46
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
47
+
48
+ ```bash
49
+ ng test
50
+ ```
51
+
52
+ ## Running end-to-end tests
53
+
54
+ For end-to-end (e2e) testing, run:
55
+
56
+ ```bash
57
+ ng e2e
58
+ ```
59
+
60
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
61
+
62
+ ## Additional Resources
63
+
64
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -0,0 +1,143 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, computed, Directive, forwardRef, model, booleanAttribute, output, linkedSignal, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
+ import { BrnSwitchThumb, BrnSwitch } from '@spartan-ng/brain/switch';
5
+ import { hlm } from '@egose/shadcn-theme-ng/utils';
6
+
7
+ class HlmSwitchThumb {
8
+ userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
9
+ _computedClass = computed(() => hlm('bg-background dark:group-data-[state=unchecked]:bg-foreground dark:group-data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=unchecked]:translate-x-0 group-data-[state=checked]:translate-x-[calc(100%-2px)]', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
10
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmSwitchThumb, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.1", type: HlmSwitchThumb, isStandalone: true, selector: "brn-switch-thumb[hlm],[hlmSwitchThumb]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
12
+ }
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmSwitchThumb, decorators: [{
14
+ type: Directive,
15
+ args: [{
16
+ selector: 'brn-switch-thumb[hlm],[hlmSwitchThumb]',
17
+ host: {
18
+ '[class]': '_computedClass()',
19
+ },
20
+ }]
21
+ }] });
22
+
23
+ const EG_SWITCH_VALUE_ACCESSOR = {
24
+ provide: NG_VALUE_ACCESSOR,
25
+ useExisting: forwardRef(() => HlmSwitch),
26
+ multi: true,
27
+ };
28
+ class HlmSwitch {
29
+ userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
30
+ _computedClass = computed(() => hlm('data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 shadow-xs group inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent outline-none transition-all focus-visible:ring-[3px] data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
31
+ /** The checked state of the switch. */
32
+ checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
33
+ /** The disabled state of the switch. */
34
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{
35
+ transform: booleanAttribute,
36
+ }]));
37
+ /** Used to set the id on the underlying brn element. */
38
+ id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : []));
39
+ /** Used to set the aria-label attribute on the underlying brn element. */
40
+ ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel", alias: 'aria-label' }] : [{ alias: 'aria-label' }]));
41
+ /** Used to set the aria-labelledby attribute on the underlying brn element. */
42
+ ariaLabelledby = input(null, ...(ngDevMode ? [{ debugName: "ariaLabelledby", alias: 'aria-labelledby' }] : [{ alias: 'aria-labelledby' }]));
43
+ /** Used to set the aria-describedby attribute on the underlying brn element. */
44
+ ariaDescribedby = input(null, ...(ngDevMode ? [{ debugName: "ariaDescribedby", alias: 'aria-describedby' }] : [{ alias: 'aria-describedby' }]));
45
+ /** Emits when the checked state of the switch changes. */
46
+ changed = output();
47
+ _disabled = linkedSignal(this.disabled);
48
+ _onChange;
49
+ _onTouched;
50
+ handleChange(value) {
51
+ const checked = value;
52
+ this.checked.set(checked);
53
+ this._onChange?.(checked);
54
+ this.changed.emit(checked);
55
+ }
56
+ /** CONROL VALUE ACCESSOR */
57
+ writeValue(value) {
58
+ this.checked.set(Boolean(value));
59
+ }
60
+ registerOnChange(fn) {
61
+ this._onChange = fn;
62
+ }
63
+ registerOnTouched(fn) {
64
+ this._onTouched = fn;
65
+ }
66
+ setDisabledState(isDisabled) {
67
+ this._disabled.set(isDisabled);
68
+ }
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.1", type: HlmSwitch, isStandalone: true, selector: "hlm-switch", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", changed: "changed" }, host: { properties: { "attr.id": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null" }, classAttribute: "contents" }, providers: [EG_SWITCH_VALUE_ACCESSOR], ngImport: i0, template: `
71
+ <brn-switch
72
+ [class]="_computedClass()"
73
+ [checked]="checked()"
74
+ @ts-ignore
75
+ (changed)="handleChange($event)"
76
+ (touched)="_onTouched?.()"
77
+ [disabled]="_disabled()"
78
+ [id]="id()"
79
+ [aria-label]="ariaLabel()"
80
+ [aria-labelledby]="ariaLabelledby()"
81
+ [aria-describedby]="ariaDescribedby()"
82
+ >
83
+ <brn-switch-thumb hlm />
84
+ </brn-switch>
85
+ `, isInline: true, dependencies: [{ kind: "component", type: BrnSwitchThumb, selector: "brn-switch-thumb" }, { kind: "component", type: BrnSwitch, selector: "brn-switch", inputs: ["checked", "id", "name", "class", "aria-label", "aria-labelledby", "aria-describedby", "required", "disabled", "tabIndex"], outputs: ["checkedChange", "touched"] }, { kind: "directive", type: HlmSwitchThumb, selector: "brn-switch-thumb[hlm],[hlmSwitchThumb]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
86
+ }
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmSwitch, decorators: [{
88
+ type: Component,
89
+ args: [{
90
+ selector: 'hlm-switch',
91
+ imports: [BrnSwitchThumb, BrnSwitch, HlmSwitchThumb],
92
+ host: {
93
+ class: 'contents',
94
+ '[attr.id]': 'null',
95
+ '[attr.aria-label]': 'null',
96
+ '[attr.aria-labelledby]': 'null',
97
+ '[attr.aria-describedby]': 'null',
98
+ },
99
+ // @ts-ignore
100
+ template: `
101
+ <brn-switch
102
+ [class]="_computedClass()"
103
+ [checked]="checked()"
104
+ @ts-ignore
105
+ (changed)="handleChange($event)"
106
+ (touched)="_onTouched?.()"
107
+ [disabled]="_disabled()"
108
+ [id]="id()"
109
+ [aria-label]="ariaLabel()"
110
+ [aria-labelledby]="ariaLabelledby()"
111
+ [aria-describedby]="ariaDescribedby()"
112
+ >
113
+ <brn-switch-thumb hlm />
114
+ </brn-switch>
115
+ `,
116
+ providers: [EG_SWITCH_VALUE_ACCESSOR],
117
+ changeDetection: ChangeDetectionStrategy.OnPush,
118
+ }]
119
+ }] });
120
+
121
+ /*
122
+ * Public API Surface of switch
123
+ */
124
+ const HlmSwitchImports = [HlmSwitch, HlmSwitchThumb];
125
+ class HlmSwitchModule {
126
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
127
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: HlmSwitchModule, imports: [HlmSwitch, HlmSwitchThumb], exports: [HlmSwitch, HlmSwitchThumb] });
128
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmSwitchModule, imports: [HlmSwitch] });
129
+ }
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmSwitchModule, decorators: [{
131
+ type: NgModule,
132
+ args: [{
133
+ imports: [...HlmSwitchImports],
134
+ exports: [...HlmSwitchImports],
135
+ }]
136
+ }] });
137
+
138
+ /**
139
+ * Generated bundle index. Do not edit.
140
+ */
141
+
142
+ export { EG_SWITCH_VALUE_ACCESSOR, HlmSwitch, HlmSwitchImports, HlmSwitchModule, HlmSwitchThumb };
143
+ //# sourceMappingURL=switch.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.mjs","sources":["../../../projects/switch/src/lib/switch-thumb.ts","../../../projects/switch/src/lib/switch.ts","../../../projects/switch/src/public-api.ts","../../../projects/switch/src/switch.ts"],"sourcesContent":["import { Directive, computed, input } from '@angular/core';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport type { ClassValue } from 'clsx';\n\n@Directive({\n selector: 'brn-switch-thumb[hlm],[hlmSwitchThumb]',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmSwitchThumb {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n\n protected readonly _computedClass = computed(() =>\n hlm(\n 'tw:bg-background tw:dark:group-data-[state=unchecked]:bg-foreground tw:dark:group-data-[state=checked]:bg-primary-foreground tw:pointer-events-none tw:block tw:size-4 tw:rounded-full tw:ring-0 tw:transition-transform tw:data-[state=unchecked]:translate-x-0 tw:group-data-[state=checked]:translate-x-[calc(100%-2px)]',\n this.userClass(),\n ),\n );\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n linkedSignal,\n model,\n output,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\nimport { BrnSwitch, BrnSwitchThumb } from '@spartan-ng/brain/switch';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport type { ClassValue } from 'clsx';\nimport { HlmSwitchThumb } from './switch-thumb';\nexport const EG_SWITCH_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => HlmSwitch),\n multi: true,\n};\n\n@Component({\n selector: 'hlm-switch',\n imports: [BrnSwitchThumb, BrnSwitch, HlmSwitchThumb],\n host: {\n class: 'contents',\n '[attr.id]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n },\n // @ts-ignore\n template: `\n <brn-switch\n [class]=\"_computedClass()\"\n [checked]=\"checked()\"\n @ts-ignore\n (changed)=\"handleChange($event)\"\n (touched)=\"_onTouched?.()\"\n [disabled]=\"_disabled()\"\n [id]=\"id()\"\n [aria-label]=\"ariaLabel()\"\n [aria-labelledby]=\"ariaLabelledby()\"\n [aria-describedby]=\"ariaDescribedby()\"\n >\n <brn-switch-thumb hlm />\n </brn-switch>\n `,\n providers: [EG_SWITCH_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HlmSwitch implements ControlValueAccessor {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() =>\n hlm(\n 'tw:data-[state=checked]:bg-primary tw:data-[state=unchecked]:bg-input tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:dark:data-[state=unchecked]:bg-input/80 tw:shadow-xs tw:group tw:inline-flex tw:h-[1.15rem] tw:w-8 tw:shrink-0 tw:items-center tw:rounded-full tw:border tw:border-transparent tw:outline-none tw:transition-all tw:focus-visible:ring-[3px] tw:data-[disabled=true]:cursor-not-allowed tw:data-[disabled=true]:opacity-50',\n this.userClass(),\n ),\n );\n\n /** The checked state of the switch. */\n public readonly checked = model<boolean>(false);\n\n /** The disabled state of the switch. */\n public readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /** Used to set the id on the underlying brn element. */\n public readonly id = input<string | null>(null);\n\n /** Used to set the aria-label attribute on the underlying brn element. */\n public readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n /** Used to set the aria-labelledby attribute on the underlying brn element. */\n public readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n\n /** Used to set the aria-describedby attribute on the underlying brn element. */\n public readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n\n /** Emits when the checked state of the switch changes. */\n public readonly changed = output<boolean>();\n\n protected readonly _disabled = linkedSignal(this.disabled);\n\n protected _onChange?: ChangeFn<boolean>;\n protected _onTouched?: TouchFn;\n\n protected handleChange(value: unknown): void {\n const checked = value as boolean;\n this.checked.set(checked);\n this._onChange?.(checked);\n this.changed.emit(checked);\n }\n\n /** CONROL VALUE ACCESSOR */\n\n writeValue(value: boolean): void {\n this.checked.set(Boolean(value));\n }\n\n registerOnChange(fn: ChangeFn<boolean>): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: TouchFn): void {\n this._onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n }\n}\n","/*\n * Public API Surface of switch\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { HlmSwitch } from './lib/switch';\nimport { HlmSwitchThumb } from './lib/switch-thumb';\n\nexport * from './lib/switch';\nexport * from './lib/switch-thumb';\n\nexport const HlmSwitchImports = [HlmSwitch, HlmSwitchThumb] as const;\n@NgModule({\n imports: [...HlmSwitchImports],\n exports: [...HlmSwitchImports],\n})\nexport class HlmSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAUa,cAAc,CAAA;AACT,IAAA,SAAS,GAAG,KAAK,CAAa,EAAE,6CAAI,KAAK,EAAE,OAAO,EAAA,CAAA,GAAA,CAAhB,EAAE,KAAK,EAAE,OAAO,EAAE,GAAC;AAElD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAC3C,GAAG,CACD,6TAA6T,EAC7T,IAAI,CAAC,SAAS,EAAE,CACjB,0DACF;uGARU,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAA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3
+ import { ControlValueAccessor } from '@angular/forms';
4
+ import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
5
+ import { ClassValue } from 'clsx';
6
+
7
+ declare const EG_SWITCH_VALUE_ACCESSOR: {
8
+ provide: _angular_core.InjectionToken<readonly ControlValueAccessor[]>;
9
+ useExisting: _angular_core.Type<any>;
10
+ multi: boolean;
11
+ };
12
+ declare class HlmSwitch implements ControlValueAccessor {
13
+ readonly userClass: _angular_core.InputSignal<ClassValue>;
14
+ protected readonly _computedClass: _angular_core.Signal<string>;
15
+ /** The checked state of the switch. */
16
+ readonly checked: _angular_core.ModelSignal<boolean>;
17
+ /** The disabled state of the switch. */
18
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
19
+ /** Used to set the id on the underlying brn element. */
20
+ readonly id: _angular_core.InputSignal<string | null>;
21
+ /** Used to set the aria-label attribute on the underlying brn element. */
22
+ readonly ariaLabel: _angular_core.InputSignal<string | null>;
23
+ /** Used to set the aria-labelledby attribute on the underlying brn element. */
24
+ readonly ariaLabelledby: _angular_core.InputSignal<string | null>;
25
+ /** Used to set the aria-describedby attribute on the underlying brn element. */
26
+ readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
27
+ /** Emits when the checked state of the switch changes. */
28
+ readonly changed: _angular_core.OutputEmitterRef<boolean>;
29
+ protected readonly _disabled: _angular_core.WritableSignal<boolean>;
30
+ protected _onChange?: ChangeFn<boolean>;
31
+ protected _onTouched?: TouchFn;
32
+ protected handleChange(value: unknown): void;
33
+ /** CONROL VALUE ACCESSOR */
34
+ writeValue(value: boolean): void;
35
+ registerOnChange(fn: ChangeFn<boolean>): void;
36
+ registerOnTouched(fn: TouchFn): void;
37
+ setDisabledState(isDisabled: boolean): void;
38
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmSwitch, never>;
39
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmSwitch, "hlm-switch", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "changed": "changed"; }, never, never, true, never>;
40
+ }
41
+
42
+ declare class HlmSwitchThumb {
43
+ readonly userClass: _angular_core.InputSignal<ClassValue>;
44
+ protected readonly _computedClass: _angular_core.Signal<string>;
45
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmSwitchThumb, never>;
46
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmSwitchThumb, "brn-switch-thumb[hlm],[hlmSwitchThumb]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
47
+ }
48
+
49
+ declare const HlmSwitchImports: readonly [typeof HlmSwitch, typeof HlmSwitchThumb];
50
+ declare class HlmSwitchModule {
51
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmSwitchModule, never>;
52
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmSwitchModule, never, [typeof HlmSwitch, typeof HlmSwitchThumb], [typeof HlmSwitch, typeof HlmSwitchThumb]>;
53
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmSwitchModule>;
54
+ }
55
+
56
+ export { EG_SWITCH_VALUE_ACCESSOR, HlmSwitch, HlmSwitchImports, HlmSwitchModule, HlmSwitchThumb };