@egose/shadcn-theme-ng-tw 0.2.0 → 0.3.0

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.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/alert/fesm2022/alert.mjs +1 -1
  3. package/autocomplete/fesm2022/autocomplete.mjs +1 -1
  4. package/button/fesm2022/button.mjs +3 -3
  5. package/checkbox/fesm2022/checkbox.mjs +6 -7
  6. package/checkbox/types/checkbox.d.ts +1 -1
  7. package/combobox/fesm2022/combobox.mjs +1 -1
  8. package/date-picker/README.md +15 -11
  9. package/date-picker/fesm2022/date-picker.mjs +148 -30
  10. package/date-picker/types/date-picker.d.ts +102 -9
  11. package/form-autocomplete/README.md +177 -0
  12. package/form-autocomplete/fesm2022/form-autocomplete.mjs +211 -0
  13. package/form-autocomplete/package.json +24 -0
  14. package/form-autocomplete/types/form-autocomplete.d.ts +61 -0
  15. package/form-checkbox/README.md +13 -3
  16. package/form-checkbox/fesm2022/form-checkbox.mjs +22 -9
  17. package/form-checkbox/types/form-checkbox.d.ts +23 -4
  18. package/form-combobox/README.md +202 -0
  19. package/form-combobox/fesm2022/form-combobox.mjs +273 -0
  20. package/form-combobox/package.json +24 -0
  21. package/form-combobox/types/form-combobox.d.ts +73 -0
  22. package/form-date-picker/README.md +48 -22
  23. package/form-date-picker/fesm2022/form-date-picker.mjs +60 -16
  24. package/form-date-picker/types/form-date-picker.d.ts +17 -1
  25. package/form-date-picker-multi/README.md +191 -0
  26. package/form-date-picker-multi/fesm2022/form-date-picker-multi.mjs +239 -0
  27. package/form-date-picker-multi/package.json +24 -0
  28. package/form-date-picker-multi/types/form-date-picker-multi.d.ts +58 -0
  29. package/form-date-range-picker/README.md +253 -0
  30. package/form-date-range-picker/fesm2022/form-date-range-picker.mjs +236 -0
  31. package/form-date-range-picker/package.json +24 -0
  32. package/form-date-range-picker/types/form-date-range-picker.d.ts +55 -0
  33. package/form-input-otp/README.md +194 -0
  34. package/form-input-otp/fesm2022/form-input-otp.mjs +194 -0
  35. package/form-input-otp/package.json +24 -0
  36. package/form-input-otp/types/form-input-otp.d.ts +58 -0
  37. package/form-month-year-picker/README.md +188 -0
  38. package/form-month-year-picker/fesm2022/form-month-year-picker.mjs +229 -0
  39. package/form-month-year-picker/package.json +24 -0
  40. package/form-month-year-picker/types/form-month-year-picker.d.ts +53 -0
  41. package/form-native-select/README.md +205 -0
  42. package/form-native-select/fesm2022/form-native-select.mjs +187 -0
  43. package/form-native-select/package.json +24 -0
  44. package/form-native-select/types/form-native-select.d.ts +57 -0
  45. package/form-phone-input/README.md +188 -0
  46. package/form-phone-input/fesm2022/form-phone-input.mjs +203 -0
  47. package/form-phone-input/package.json +24 -0
  48. package/form-phone-input/types/form-phone-input.d.ts +58 -0
  49. package/form-radio-group/README.md +198 -0
  50. package/form-radio-group/fesm2022/form-radio-group.mjs +211 -0
  51. package/form-radio-group/package.json +24 -0
  52. package/form-radio-group/types/form-radio-group.d.ts +63 -0
  53. package/form-searchable-multiselect/README.md +11 -1
  54. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +19 -10
  55. package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +18 -1
  56. package/form-select/README.md +10 -0
  57. package/form-select/fesm2022/form-select.mjs +24 -15
  58. package/form-select/types/form-select.d.ts +18 -1
  59. package/form-slider/README.md +182 -0
  60. package/form-slider/fesm2022/form-slider.mjs +186 -0
  61. package/form-slider/package.json +24 -0
  62. package/form-slider/types/form-slider.d.ts +60 -0
  63. package/form-switch/README.md +173 -0
  64. package/form-switch/fesm2022/form-switch.mjs +178 -0
  65. package/form-switch/package.json +24 -0
  66. package/form-switch/types/form-switch.d.ts +50 -0
  67. package/form-text-input/README.md +10 -0
  68. package/form-text-input/fesm2022/form-text-input.mjs +19 -10
  69. package/form-text-input/types/form-text-input.d.ts +18 -1
  70. package/form-textarea/README.md +11 -1
  71. package/form-textarea/fesm2022/form-textarea.mjs +19 -10
  72. package/form-textarea/types/form-textarea.d.ts +18 -1
  73. package/form-toggle/README.md +186 -0
  74. package/form-toggle/fesm2022/form-toggle.mjs +241 -0
  75. package/form-toggle/package.json +24 -0
  76. package/form-toggle/types/form-toggle.d.ts +82 -0
  77. package/form-toggle-group/README.md +176 -0
  78. package/form-toggle-group/fesm2022/form-toggle-group.mjs +216 -0
  79. package/form-toggle-group/package.json +24 -0
  80. package/form-toggle-group/types/form-toggle-group.d.ts +65 -0
  81. package/input-group/fesm2022/input-group.mjs +20 -10
  82. package/input-group/types/input-group.d.ts +4 -1
  83. package/native-select/fesm2022/native-select.mjs +18 -6
  84. package/native-select/types/native-select.d.ts +7 -2
  85. package/package.json +57 -1
  86. package/phone-input/README.md +114 -0
  87. package/phone-input/fesm2022/phone-input.mjs +191 -0
  88. package/phone-input/package.json +24 -0
  89. package/phone-input/types/phone-input.d.ts +67 -0
  90. package/sheet/fesm2022/sheet.mjs +1 -1
  91. package/switch/fesm2022/switch.mjs +7 -5
  92. package/switch/types/switch.d.ts +2 -1
@@ -0,0 +1,194 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, input, numberAttribute, computed, Component } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
5
+ import { HlmFormIdGenerator, HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
6
+ import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
7
+ import { BrnInputOtp } from '@spartan-ng/brain/input-otp';
8
+ import * as i2 from '@egose/shadcn-theme-ng-tw/input-otp';
9
+ import { HlmInputOtpImports } from '@egose/shadcn-theme-ng-tw/input-otp';
10
+ import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
11
+
12
+ const EgFormInputOtpConfigToken = new InjectionToken('EgFormInputOtpConfig');
13
+ function provideEgFormInputOtpConfig(config) {
14
+ return { provide: EgFormInputOtpConfigToken, useValue: { ...config } };
15
+ }
16
+ function injectEgFormInputOtpConfig() {
17
+ return inject(EgFormInputOtpConfigToken, { optional: true }) ?? {};
18
+ }
19
+
20
+ class EgFormInputOtp {
21
+ formGroupDirective = inject(FormGroupDirective);
22
+ generatedId = inject(HlmFormIdGenerator).generate('eg-form-input-otp');
23
+ _config = injectEgFormInputOtpConfig();
24
+ label = input(undefined, /* @ts-ignore */
25
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
26
+ controlId = input(undefined, /* @ts-ignore */
27
+ ...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
28
+ controlName = input('', /* @ts-ignore */
29
+ ...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ []));
30
+ error = input(undefined, /* @ts-ignore */
31
+ ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
32
+ hint = input(undefined, /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
34
+ id = input(undefined, /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
36
+ length = input(6, { ...(ngDevMode ? { debugName: "length" } : /* istanbul ignore next */ {}), transform: numberAttribute });
37
+ disabled = input(false, /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
39
+ required = input(false, /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
41
+ effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
42
+ ...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
43
+ errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
44
+ ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
45
+ hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
46
+ ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
47
+ slotIndexes = computed(() => Array.from({ length: this.length() }, (_, i) => i), /* @ts-ignore */
48
+ ...(ngDevMode ? [{ debugName: "slotIndexes" }] : /* istanbul ignore next */ []));
49
+ /**
50
+ * Combined lock for the brain `linkedSignal`-based disabled state: the raw
51
+ * input write always carries the resolved value, so a same-pass
52
+ * wrapper-toggle + `control.disable()` cannot clobber CVA state.
53
+ */
54
+ effectiveDisabled() {
55
+ return this.disabled() || !!this.formGroupDirective.form.get(this.controlName())?.disabled;
56
+ }
57
+ // NOTE: BrnInputOtp exposes inputId but no aria-describedby, so error/hint
58
+ // ids render for sighted users without an input-level describedby link.
59
+ // Styling
60
+ userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
61
+ labelClass = input('', /* @ts-ignore */
62
+ ...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
63
+ otpClass = input('', /* @ts-ignore */
64
+ ...(ngDevMode ? [{ debugName: "otpClass" }] : /* istanbul ignore next */ []));
65
+ errorClass = input('', /* @ts-ignore */
66
+ ...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
67
+ hintClass = input('', /* @ts-ignore */
68
+ ...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
69
+ // Computed classes (library base < global config < per-instance)
70
+ $userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
71
+ ...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
72
+ $labelClass = computed(() => hlm('tw:mb-1', this._config.labelClass, this.labelClass()), /* @ts-ignore */
73
+ ...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
74
+ $otpClass = computed(() => hlm(this._config.otpClass, this.otpClass()), /* @ts-ignore */
75
+ ...(ngDevMode ? [{ debugName: "$otpClass" }] : /* istanbul ignore next */ []));
76
+ $errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
77
+ ...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
78
+ $hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
79
+ ...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
80
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormInputOtp, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormInputOtp, isStandalone: true, selector: "eg-form-input-otp", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, otpClass: { classPropertyName: "otpClass", publicName: "otpClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
82
+ @let lbl = label();
83
+ @let cnm = controlName();
84
+ @let err = error();
85
+ @let hnt = hint();
86
+ @let rqrd = required();
87
+
88
+ <hlm-form-field>
89
+ @if (lbl) {
90
+ <label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
91
+ >{{ lbl }}
92
+ @if (rqrd) {
93
+ <span class="tw:text-red-500">*</span>
94
+ }
95
+ </label>
96
+ }
97
+
98
+ <brn-input-otp
99
+ hlmInputOtp
100
+ [length]="length()"
101
+ [formControlName]="cnm"
102
+ [inputId]="effectiveId()"
103
+ [disabled]="effectiveDisabled()"
104
+ [class]="$otpClass()"
105
+ >
106
+ <div hlmInputOtpGroup>
107
+ @for (i of slotIndexes(); track i) {
108
+ <hlm-input-otp-slot [index]="i" />
109
+ }
110
+ </div>
111
+ </brn-input-otp>
112
+
113
+ @if (err) {
114
+ <hlm-error [id]="errorId()" [class]="$errorClass()">
115
+ {{ err }}
116
+ </hlm-error>
117
+ }
118
+
119
+ @if (hnt) {
120
+ <hlm-hint [id]="hintId()" [class]="$hintClass()">
121
+ {{ hnt }}
122
+ </hlm-hint>
123
+ }
124
+ </hlm-form-field>
125
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: HlmFormField, selector: "hlm-form-field", inputs: ["class"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "component", type: BrnInputOtp, selector: "brn-input-otp", inputs: ["hostStyles", "inputId", "inputAutocomplete", "inputStyles", "containerStyles", "disabled", "length", "inputMode", "inputClass", "autofocus", "transformPaste", "value"], outputs: ["valueChange", "completed"] }, { kind: "directive", type: i2.HlmInputOtp, selector: "brn-input-otp[hlmInputOtp], brn-input-otp[hlm]" }, { kind: "directive", type: i2.HlmInputOtpGroup, selector: "[hlmInputOtpGroup],hlm-input-otp-group" }, { kind: "component", type: i2.HlmInputOtpSlot, selector: "hlm-input-otp-slot", inputs: ["index"] }] });
126
+ }
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormInputOtp, decorators: [{
128
+ type: Component,
129
+ args: [{
130
+ selector: 'eg-form-input-otp',
131
+ standalone: true,
132
+ host: {
133
+ '[class]': '$userClass()',
134
+ },
135
+ imports: [ReactiveFormsModule, HlmFormField, HlmError, HlmHint, HlmLabel, BrnInputOtp, HlmInputOtpImports],
136
+ providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
137
+ template: `
138
+ @let lbl = label();
139
+ @let cnm = controlName();
140
+ @let err = error();
141
+ @let hnt = hint();
142
+ @let rqrd = required();
143
+
144
+ <hlm-form-field>
145
+ @if (lbl) {
146
+ <label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
147
+ >{{ lbl }}
148
+ @if (rqrd) {
149
+ <span class="tw:text-red-500">*</span>
150
+ }
151
+ </label>
152
+ }
153
+
154
+ <brn-input-otp
155
+ hlmInputOtp
156
+ [length]="length()"
157
+ [formControlName]="cnm"
158
+ [inputId]="effectiveId()"
159
+ [disabled]="effectiveDisabled()"
160
+ [class]="$otpClass()"
161
+ >
162
+ <div hlmInputOtpGroup>
163
+ @for (i of slotIndexes(); track i) {
164
+ <hlm-input-otp-slot [index]="i" />
165
+ }
166
+ </div>
167
+ </brn-input-otp>
168
+
169
+ @if (err) {
170
+ <hlm-error [id]="errorId()" [class]="$errorClass()">
171
+ {{ err }}
172
+ </hlm-error>
173
+ }
174
+
175
+ @if (hnt) {
176
+ <hlm-hint [id]="hintId()" [class]="$hintClass()">
177
+ {{ hnt }}
178
+ </hlm-hint>
179
+ }
180
+ </hlm-form-field>
181
+ `,
182
+ }]
183
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], otpClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "otpClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
184
+
185
+ /*
186
+ * Public API Surface of form-input-otp
187
+ */
188
+
189
+ /**
190
+ * Generated bundle index. Do not edit.
191
+ */
192
+
193
+ export { EgFormInputOtp, injectEgFormInputOtpConfig, provideEgFormInputOtpConfig };
194
+
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "form-input-otp",
3
+ "version": "0.0.1",
4
+ "peerDependencies": {
5
+ "@angular/common": "^20.3.0 || ^22.0.0",
6
+ "@angular/core": "^20.3.0 || ^22.0.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "sideEffects": false,
12
+ "module": "fesm2022/form-input-otp.mjs",
13
+ "typings": "types/form-input-otp.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/form-input-otp.d.ts",
20
+ "default": "./fesm2022/form-input-otp.mjs"
21
+ }
22
+ },
23
+ "type": "module"
24
+ }
@@ -0,0 +1,58 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ValueProvider } from '@angular/core';
3
+ import { ClassValue } from 'clsx';
4
+ import { NumberInput } from '@angular/cdk/coercion';
5
+
6
+ declare class EgFormInputOtp {
7
+ private readonly formGroupDirective;
8
+ private readonly generatedId;
9
+ private readonly _config;
10
+ label: _angular_core.InputSignal<string | undefined>;
11
+ controlId: _angular_core.InputSignal<string | undefined>;
12
+ controlName: _angular_core.InputSignal<string>;
13
+ error: _angular_core.InputSignal<string | undefined>;
14
+ hint: _angular_core.InputSignal<string | undefined>;
15
+ id: _angular_core.InputSignal<string | undefined>;
16
+ length: _angular_core.InputSignalWithTransform<number, NumberInput>;
17
+ disabled: _angular_core.InputSignal<boolean>;
18
+ required: _angular_core.InputSignal<boolean>;
19
+ readonly effectiveId: _angular_core.Signal<string>;
20
+ readonly errorId: _angular_core.Signal<string>;
21
+ readonly hintId: _angular_core.Signal<string>;
22
+ readonly slotIndexes: _angular_core.Signal<number[]>;
23
+ /**
24
+ * Combined lock for the brain `linkedSignal`-based disabled state: the raw
25
+ * input write always carries the resolved value, so a same-pass
26
+ * wrapper-toggle + `control.disable()` cannot clobber CVA state.
27
+ */
28
+ effectiveDisabled(): boolean;
29
+ userClass: _angular_core.InputSignal<ClassValue>;
30
+ labelClass: _angular_core.InputSignal<string>;
31
+ otpClass: _angular_core.InputSignal<string>;
32
+ errorClass: _angular_core.InputSignal<string>;
33
+ hintClass: _angular_core.InputSignal<string>;
34
+ $userClass: _angular_core.Signal<string>;
35
+ $labelClass: _angular_core.Signal<string>;
36
+ $otpClass: _angular_core.Signal<string>;
37
+ $errorClass: _angular_core.Signal<string>;
38
+ $hintClass: _angular_core.Signal<string>;
39
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormInputOtp, never>;
40
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormInputOtp, "eg-form-input-otp", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "length": { "alias": "length"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "otpClass": { "alias": "otpClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
41
+ }
42
+
43
+ interface EgFormInputOtpConfig {
44
+ /**
45
+ * Global class defaults for `eg-form-input-otp` styling slots.
46
+ * Each is merged under the matching per-instance `*Class` input
47
+ * (library base < global config < per-instance).
48
+ */
49
+ labelClass?: string;
50
+ otpClass?: string;
51
+ errorClass?: string;
52
+ hintClass?: string;
53
+ }
54
+ declare function provideEgFormInputOtpConfig(config: Partial<EgFormInputOtpConfig>): ValueProvider;
55
+ declare function injectEgFormInputOtpConfig(): EgFormInputOtpConfig;
56
+
57
+ export { EgFormInputOtp, injectEgFormInputOtpConfig, provideEgFormInputOtpConfig };
58
+ export type { EgFormInputOtpConfig };
@@ -0,0 +1,188 @@
1
+ # Form Month Year Picker (`@egose/shadcn-theme-ng/form-month-year-picker`)
2
+
3
+ A ready-made reactive-form month/year field: label + `hlm-month-year-picker` + validation error/hint display in one tag. Dates default to the `MM/YYYY` display/edit format.
4
+
5
+ The Angular implementation is a standalone wrapper (not a brain primitive): it renders
6
+ `HlmFormField` / `HlmError` / `HlmHint` from `@egose/shadcn-theme-ng/form-field`, `HlmLabel`, and
7
+ `HlmMonthYearPicker` + `HlmMonthYearInput` from `@egose/shadcn-theme-ng/date-picker`. The inner
8
+ picker is bound with `[formControlName]="controlName()"`, so the parent `FormGroup` owns the
9
+ `Date | null` value. It must live inside a `FormGroupDirective` (`[formGroup]` parent); ids come from
10
+ `HlmFormIdGenerator` unless overridden.
11
+
12
+ > **Ships as:** `@egose/shadcn-theme-ng/form-month-year-picker` and `@egose/shadcn-theme-ng-tw/form-month-year-picker`
13
+ > (the `tw:`-prefixed Tailwind variant). Both expose the identical TypeScript surface; only the
14
+ > emitted Tailwind class strings differ. See the [package README](../../README.md) for install
15
+ > steps, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ # Plain Tailwind (no prefix)
21
+ npm install @egose/shadcn-theme-ng
22
+
23
+ # tw:-prefixed Tailwind variant
24
+ npm install @egose/shadcn-theme-ng-tw
25
+ ```
26
+
27
+ Peer dependencies (Angular, `@spartan-ng/brain`, `@ng-icons/*`, `rxjs`, …) are documented in the
28
+ [package README](../../README.md#peer-dependencies). This subpath additionally relies at runtime on
29
+ `@egose/shadcn-theme-ng/date-picker`, `@egose/shadcn-theme-ng/form-field`, and
30
+ `@egose/shadcn-theme-ng/label`.
31
+
32
+ ## Imports
33
+
34
+ Exported from the subpath root (`projects/form-month-year-picker/src/public-api.ts`):
35
+
36
+ ```ts
37
+ import { EgFormMonthYearPicker } from '@egose/shadcn-theme-ng/form-month-year-picker';
38
+ // tw variant: replace with '@egose/shadcn-theme-ng-tw/form-month-year-picker'
39
+ ```
40
+
41
+ `ControlValueAccessor` behavior: `eg-form-month-year-picker` itself is not a `ControlValueAccessor`;
42
+ the inner `hlm-month-year-picker` is (bound via `formControlName`), so `formControlName`/`formGroup`
43
+ handling, `Validators`, and `disabled` state from the control all flow through the parent form.
44
+
45
+ ## Anatomy / Structure
46
+
47
+ ```html
48
+ <form [formGroup]="form">
49
+ <eg-form-month-year-picker
50
+ controlName="start"
51
+ label="Start month"
52
+ [required]="true"
53
+ error="Start month is required."
54
+ />
55
+ </form>
56
+ ```
57
+
58
+ Selector (from source): `eg-form-month-year-picker` (standalone component, host `tw:w-full`).
59
+
60
+ ## API reference
61
+
62
+ ### `EgFormMonthYearPicker` — `eg-form-month-year-picker`
63
+
64
+ | Input | Type | Default | Description |
65
+ | ------------------- | --------------------------------- | -------------- | ------------------------------------------------------------------------------------------- |
66
+ | `controlName` | `string` | `''` | `formControlName` key inside the parent `FormGroup`. **Required.** |
67
+ | `label` | `string \| undefined` | — | Label text (hidden when omitted). |
68
+ | `error` | `string \| undefined` | — | Error text shown when invalid. |
69
+ | `hint` | `string \| undefined` | — | Hint text shown otherwise. |
70
+ | `controlId` | `string \| undefined` | — | Explicit id (first priority for `effectiveId`). |
71
+ | `id` | `string \| undefined` | — | Fallback id (second priority). |
72
+ | `name` | `string \| undefined` | — | Native `name` forwarded to the inner input (`controlName` wins). |
73
+ | `placeholder` | `string` | `'MM/YYYY'` | Input placeholder. |
74
+ | `readonly` | `boolean` | `false` | Native `readonly` forwarded to the inner input. |
75
+ | `disabled` | `boolean` | `false` | Locks interaction (form control stays enabled). |
76
+ | `required` | `boolean` | `false` | Shows a red `*` next to the label. |
77
+ | `min` / `max` | `Date \| string \| null` | `null` | Date bounds forwarded to the picker. |
78
+ | `autoCloseOnSelect` | `boolean` | config default | Forwarded to the picker (falls back to `provideHlmMonthYearPickerConfig`, default `false`). |
79
+ | `formatDate` | `(date: Date) => string` | config default | Display format (falls back to `provideHlmMonthYearPickerConfig`, default `MM/YYYY`). |
80
+ | `transformDate` | `(date: Date) => Date` | config default | Model transform (falls back to `provideHlmMonthYearPickerConfig`). |
81
+ | `parseDate` | `(value: string) => Date \| null` | config default | Input parsing, forwarded to the input (falls back to `provideHlmMonthYearPickerConfig`). |
82
+ | `formatInputDate` | `(date: Date) => string` | config default | Edit format while focused (falls back to `provideHlmMonthYearPickerConfig`). |
83
+ | `class` | `ClassValue` | `''` | Extra host classes (base `tw:w-full`). |
84
+ | `labelClass` | `string` | `''` | Extra label classes (base `tw:mb-1`). |
85
+ | `pickerClass` | `string` | `''` | Extra picker-container classes (base `tw:mb-1`). |
86
+ | `inputClass` | `string` | `''` | Extra inner-input classes (e.g. `tw:text-lg`). |
87
+ | `errorClass` | `string` | `''` | Extra error classes (base `tw:mt-0`). |
88
+ | `hintClass` | `string` | `''` | Extra hint classes (base `tw:mt-0`). |
89
+
90
+ | Member | Description |
91
+ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
92
+ | `effectiveId` | `controlId() \|\| id() \|\| generated` — wired to input `inputId` and label `for`. |
93
+ | `errorId` / `hintId` | `effectiveId + '-error' / '-hint'`. |
94
+ | `describedBy()` | `errorId` when `error()` is set and control is invalid + dirty/touched, else `hintId` when `hint()` is set, else `null` — wired to input `ariaDescribedby`. |
95
+
96
+ Requires a `[formGroup]` ancestor (injects `FormGroupDirective`, provides `ControlContainer → FormGroupDirective`).
97
+
98
+ ## Examples
99
+
100
+ ### 1. Basic required month field
101
+
102
+ ```ts
103
+ import { Component, inject } from '@angular/core';
104
+ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
105
+ import { EgFormMonthYearPicker } from '@egose/shadcn-theme-ng/form-month-year-picker';
106
+
107
+ @Component({
108
+ selector: 'app-start',
109
+ standalone: true,
110
+ imports: [ReactiveFormsModule, EgFormMonthYearPicker],
111
+ template: `
112
+ <form [formGroup]="form" (ngSubmit)="submit()">
113
+ <eg-form-month-year-picker
114
+ controlName="start"
115
+ label="Start month"
116
+ [required]="true"
117
+ error="Start month is required."
118
+ />
119
+ <button type="submit" [disabled]="form.invalid">Continue</button>
120
+ </form>
121
+ `,
122
+ })
123
+ export class StartComponent {
124
+ private readonly fb = inject(FormBuilder);
125
+ readonly form = this.fb.group({ start: [null as Date | null, Validators.required] });
126
+ submit() {
127
+ console.log(this.form.value.start);
128
+ }
129
+ }
130
+ ```
131
+
132
+ ### 2. Card expiry with hint
133
+
134
+ ```ts
135
+ import { Component, inject } from '@angular/core';
136
+ import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
137
+ import { EgFormMonthYearPicker } from '@egose/shadcn-theme-ng/form-month-year-picker';
138
+
139
+ @Component({
140
+ selector: 'app-expiry',
141
+ standalone: true,
142
+ imports: [ReactiveFormsModule, EgFormMonthYearPicker],
143
+ template: `
144
+ <form [formGroup]="form">
145
+ <eg-form-month-year-picker
146
+ controlName="expiry"
147
+ label="Expiry"
148
+ [min]="today"
149
+ hint="As printed on the card."
150
+ error="Enter a valid future month."
151
+ />
152
+ </form>
153
+ `,
154
+ })
155
+ export class ExpiryComponent {
156
+ private readonly fb = inject(FormBuilder);
157
+ readonly form = this.fb.group({ expiry: [null as Date | null] });
158
+ readonly today = new Date();
159
+ }
160
+ ```
161
+
162
+ ## Accessibility notes
163
+
164
+ - Label `for` ↔ input `inputId` wiring is automatic via `effectiveId`; the input also receives `ariaLabel` and `ariaDescribedby` — always pass a `label`.
165
+ - Closing the picker popover marks the control touched, so errors appear after interaction even without typing.
166
+ - The required `*` is visual; pair with `Validators.required` so assistive tech and validation agree.
167
+
168
+ ## Theming / CSS variables
169
+
170
+ No component-specific CSS variables. Style per-instance via `class` / `labelClass` / `pickerClass` / `inputClass` / `errorClass` / `hintClass` (precedence: library base < global config < per-instance).
171
+
172
+ Global defaults via the month-year picker config:
173
+
174
+ ```ts
175
+ import { provideHlmMonthYearPickerConfig } from '@egose/shadcn-theme-ng/date-picker';
176
+
177
+ await bootstrapApplication(App, {
178
+ providers: [provideHlmMonthYearPickerConfig({ inputClass: 'tw:text-sm', labelClass: 'tw:font-medium' })],
179
+ });
180
+ ```
181
+
182
+ The host keeps `tw:w-full`; constrain width with `class` or a wrapping container.
183
+
184
+ ## Related subpaths
185
+
186
+ - `@egose/shadcn-theme-ng/date-picker` — raw `hlm-month-year-picker` + input/trigger/config tokens for custom layouts.
187
+ - `@egose/shadcn-theme-ng/form-date-picker` — the full-date counterpart (`eg-form-date-picker`).
188
+ - `@egose/shadcn-theme-ng/form-field` — `hlm-form-field` / `hlm-error` / `hlm-hint` used internally.