@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,236 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, input, 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 { injectHlmDateRangePickerConfig, HlmDateRangePicker, HlmDateRangeInput } from '@egose/shadcn-theme-ng-tw/date-picker';
8
+ import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
9
+
10
+ class EgFormDateRangePicker {
11
+ formGroupDirective = inject(FormGroupDirective);
12
+ generatedId = inject(HlmFormIdGenerator).generate('eg-form-date-range-picker');
13
+ _config = injectHlmDateRangePickerConfig();
14
+ // Inputs
15
+ label = input(undefined, /* @ts-ignore */
16
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
17
+ controlId = input(undefined, /* @ts-ignore */
18
+ ...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
19
+ controlName = input('', /* @ts-ignore */
20
+ ...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ []));
21
+ error = input(undefined, /* @ts-ignore */
22
+ ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
23
+ hint = input(undefined, /* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
25
+ // HTML attributes
26
+ id = input(undefined, /* @ts-ignore */
27
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
28
+ name = input(undefined, /* @ts-ignore */
29
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
30
+ placeholder = input('Pick a date range', /* @ts-ignore */
31
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
32
+ readonly = input(false, /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
34
+ disabled = input(false, /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
36
+ required = input(false, /* @ts-ignore */
37
+ ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
38
+ min = input(null, /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
40
+ max = input(null, /* @ts-ignore */
41
+ ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
42
+ // Picker behavior (defaults fall back to the injected HlmDateRangePickerConfig,
43
+ // so global `provideHlmDateRangePickerConfig` values keep working unless overridden)
44
+ autoCloseOnEndSelection = input(this._config.autoCloseOnEndSelection, /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "autoCloseOnEndSelection" }] : /* istanbul ignore next */ []));
46
+ captionLayout = input('label', /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []));
48
+ formatDates = input(this._config.formatDates, /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "formatDates" }] : /* istanbul ignore next */ []));
50
+ transformDates = input(this._config.transformDates, /* @ts-ignore */
51
+ ...(ngDevMode ? [{ debugName: "transformDates" }] : /* istanbul ignore next */ []));
52
+ parseDate = input(this._config.parseDate, /* @ts-ignore */
53
+ ...(ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []));
54
+ formatInputDates = input(this._config.formatInputDates, /* @ts-ignore */
55
+ ...(ngDevMode ? [{ debugName: "formatInputDates" }] : /* istanbul ignore next */ []));
56
+ effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
57
+ ...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
58
+ errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
59
+ ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
60
+ hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
61
+ ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
62
+ /**
63
+ * Bounds projected onto the picker's `Date` model. The cast keeps the
64
+ * template's generic inference on `Date` while passing runtime values
65
+ * (including `string` bounds, as in `eg-form-date-picker`) through untouched.
66
+ */
67
+ $min = computed(() => this.min(), /* @ts-ignore */
68
+ ...(ngDevMode ? [{ debugName: "$min" }] : /* istanbul ignore next */ []));
69
+ $max = computed(() => this.max(), /* @ts-ignore */
70
+ ...(ngDevMode ? [{ debugName: "$max" }] : /* istanbul ignore next */ []));
71
+ describedBy() {
72
+ const control = this.formGroupDirective.form.get(this.controlName());
73
+ return this.error() && control?.invalid && (control.dirty || control.touched)
74
+ ? this.errorId()
75
+ : this.hint()
76
+ ? this.hintId()
77
+ : null;
78
+ }
79
+ // Styling
80
+ userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
81
+ labelClass = input('', /* @ts-ignore */
82
+ ...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
83
+ pickerClass = input('', /* @ts-ignore */
84
+ ...(ngDevMode ? [{ debugName: "pickerClass" }] : /* istanbul ignore next */ []));
85
+ inputClass = input('', /* @ts-ignore */
86
+ ...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
87
+ errorClass = input('', /* @ts-ignore */
88
+ ...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
89
+ hintClass = input('', /* @ts-ignore */
90
+ ...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
91
+ // Computed classes (library base < global config < per-instance)
92
+ $userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
93
+ ...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
94
+ $labelClass = computed(() => hlm('tw:mb-1', this._config.labelClass, this.labelClass()), /* @ts-ignore */
95
+ ...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
96
+ $pickerClass = computed(() => hlm('tw:mb-1', this._config.pickerClass, this.pickerClass()), /* @ts-ignore */
97
+ ...(ngDevMode ? [{ debugName: "$pickerClass" }] : /* istanbul ignore next */ []));
98
+ $inputClass = computed(() => hlm(this._config.inputClass, this.inputClass()), /* @ts-ignore */
99
+ ...(ngDevMode ? [{ debugName: "$inputClass" }] : /* istanbul ignore next */ []));
100
+ $errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
101
+ ...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
102
+ $hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
103
+ ...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
104
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormDateRangePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
105
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormDateRangePicker, isStandalone: true, selector: "eg-form-date-range-picker", 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 }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", 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 }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, autoCloseOnEndSelection: { classPropertyName: "autoCloseOnEndSelection", publicName: "autoCloseOnEndSelection", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, formatDates: { classPropertyName: "formatDates", publicName: "formatDates", isSignal: true, isRequired: false, transformFunction: null }, transformDates: { classPropertyName: "transformDates", publicName: "transformDates", isSignal: true, isRequired: false, transformFunction: null }, parseDate: { classPropertyName: "parseDate", publicName: "parseDate", isSignal: true, isRequired: false, transformFunction: null }, formatInputDates: { classPropertyName: "formatInputDates", publicName: "formatInputDates", 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 }, pickerClass: { classPropertyName: "pickerClass", publicName: "pickerClass", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", 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: `
106
+ @let lbl = label();
107
+ @let cnm = controlName();
108
+ @let err = error();
109
+ @let hnt = hint();
110
+ @let rqrd = required();
111
+
112
+ <hlm-form-field>
113
+ @if (lbl) {
114
+ <label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
115
+ >{{ lbl }}
116
+ @if (rqrd) {
117
+ <span class="tw:text-red-500">*</span>
118
+ }
119
+ </label>
120
+ }
121
+
122
+ <hlm-date-range-picker
123
+ [min]="$min()"
124
+ [max]="$max()"
125
+ [disabled]="disabled()"
126
+ [autoCloseOnEndSelection]="autoCloseOnEndSelection()"
127
+ [captionLayout]="captionLayout()"
128
+ [formatDates]="formatDates()"
129
+ [transformDates]="transformDates()"
130
+ [formControlName]="cnm"
131
+ [class]="$pickerClass()"
132
+ >
133
+ <hlm-date-range-input
134
+ [inputId]="effectiveId()"
135
+ [name]="cnm || name()"
136
+ [readonly]="readonly()"
137
+ [ariaLabel]="lbl"
138
+ [ariaDescribedby]="describedBy()"
139
+ [placeholder]="placeholder()"
140
+ [parseDate]="parseDate()"
141
+ [formatInputDates]="formatInputDates()"
142
+ [inputClass]="$inputClass()"
143
+ />
144
+ </hlm-date-range-picker>
145
+
146
+ @if (err) {
147
+ <hlm-error [id]="errorId()" [class]="$errorClass()">
148
+ {{ err }}
149
+ </hlm-error>
150
+ }
151
+
152
+ @if (hnt) {
153
+ <hlm-hint [id]="hintId()" [class]="$hintClass()">
154
+ {{ hnt }}
155
+ </hlm-hint>
156
+ }
157
+ </hlm-form-field>
158
+ `, 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: HlmDateRangePicker, selector: "hlm-date-range-picker", inputs: ["captionLayout", "min", "max", "disabled", "date", "autoCloseOnEndSelection", "formatDates", "transformDates"], outputs: ["dateChange"] }, { kind: "component", type: HlmDateRangeInput, selector: "hlm-date-range-input", inputs: ["name", "readonly", "ariaLabel", "ariaDescribedby", "class", "inputClass", "parseDate", "formatInputDates"] }] });
159
+ }
160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormDateRangePicker, decorators: [{
161
+ type: Component,
162
+ args: [{
163
+ selector: 'eg-form-date-range-picker',
164
+ standalone: true,
165
+ host: {
166
+ '[class]': '$userClass()',
167
+ },
168
+ imports: [ReactiveFormsModule, HlmFormField, HlmError, HlmHint, HlmLabel, HlmDateRangePicker, HlmDateRangeInput],
169
+ providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
170
+ template: `
171
+ @let lbl = label();
172
+ @let cnm = controlName();
173
+ @let err = error();
174
+ @let hnt = hint();
175
+ @let rqrd = required();
176
+
177
+ <hlm-form-field>
178
+ @if (lbl) {
179
+ <label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
180
+ >{{ lbl }}
181
+ @if (rqrd) {
182
+ <span class="tw:text-red-500">*</span>
183
+ }
184
+ </label>
185
+ }
186
+
187
+ <hlm-date-range-picker
188
+ [min]="$min()"
189
+ [max]="$max()"
190
+ [disabled]="disabled()"
191
+ [autoCloseOnEndSelection]="autoCloseOnEndSelection()"
192
+ [captionLayout]="captionLayout()"
193
+ [formatDates]="formatDates()"
194
+ [transformDates]="transformDates()"
195
+ [formControlName]="cnm"
196
+ [class]="$pickerClass()"
197
+ >
198
+ <hlm-date-range-input
199
+ [inputId]="effectiveId()"
200
+ [name]="cnm || name()"
201
+ [readonly]="readonly()"
202
+ [ariaLabel]="lbl"
203
+ [ariaDescribedby]="describedBy()"
204
+ [placeholder]="placeholder()"
205
+ [parseDate]="parseDate()"
206
+ [formatInputDates]="formatInputDates()"
207
+ [inputClass]="$inputClass()"
208
+ />
209
+ </hlm-date-range-picker>
210
+
211
+ @if (err) {
212
+ <hlm-error [id]="errorId()" [class]="$errorClass()">
213
+ {{ err }}
214
+ </hlm-error>
215
+ }
216
+
217
+ @if (hnt) {
218
+ <hlm-hint [id]="hintId()" [class]="$hintClass()">
219
+ {{ hnt }}
220
+ </hlm-hint>
221
+ }
222
+ </hlm-form-field>
223
+ `,
224
+ }]
225
+ }], 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 }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], autoCloseOnEndSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseOnEndSelection", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], formatDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatDates", required: false }] }], transformDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "transformDates", required: false }] }], parseDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "parseDate", required: false }] }], formatInputDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatInputDates", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], pickerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "pickerClass", required: false }] }], inputClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
226
+
227
+ /*
228
+ * Public API Surface of form-date-range-picker
229
+ */
230
+
231
+ /**
232
+ * Generated bundle index. Do not edit.
233
+ */
234
+
235
+ export { EgFormDateRangePicker };
236
+
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "form-date-range-picker",
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-date-range-picker.mjs",
13
+ "typings": "types/form-date-range-picker.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/form-date-range-picker.d.ts",
20
+ "default": "./fesm2022/form-date-range-picker.mjs"
21
+ }
22
+ },
23
+ "type": "module"
24
+ }
@@ -0,0 +1,55 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ClassValue } from 'clsx';
3
+
4
+ type DateRangeCaptionLayout = 'dropdown' | 'label' | 'dropdown-months' | 'dropdown-years';
5
+ declare class EgFormDateRangePicker {
6
+ private readonly formGroupDirective;
7
+ private readonly generatedId;
8
+ private readonly _config;
9
+ label: _angular_core.InputSignal<string | undefined>;
10
+ controlId: _angular_core.InputSignal<string | undefined>;
11
+ controlName: _angular_core.InputSignal<string>;
12
+ error: _angular_core.InputSignal<string | undefined>;
13
+ hint: _angular_core.InputSignal<string | undefined>;
14
+ id: _angular_core.InputSignal<string | undefined>;
15
+ name: _angular_core.InputSignal<string | undefined>;
16
+ placeholder: _angular_core.InputSignal<string>;
17
+ readonly: _angular_core.InputSignal<boolean>;
18
+ disabled: _angular_core.InputSignal<boolean>;
19
+ required: _angular_core.InputSignal<boolean>;
20
+ min: _angular_core.InputSignal<string | Date | null>;
21
+ max: _angular_core.InputSignal<string | Date | null>;
22
+ autoCloseOnEndSelection: _angular_core.InputSignal<boolean>;
23
+ captionLayout: _angular_core.InputSignal<DateRangeCaptionLayout>;
24
+ formatDates: _angular_core.InputSignal<(dates: [Date | null, Date | null]) => string>;
25
+ transformDates: _angular_core.InputSignal<(dates: [Date, Date]) => [Date, Date]>;
26
+ parseDate: _angular_core.InputSignal<(value: string) => [Date, Date] | null>;
27
+ formatInputDates: _angular_core.InputSignal<(dates: [Date | null, Date | null]) => string>;
28
+ readonly effectiveId: _angular_core.Signal<string>;
29
+ readonly errorId: _angular_core.Signal<string>;
30
+ readonly hintId: _angular_core.Signal<string>;
31
+ /**
32
+ * Bounds projected onto the picker's `Date` model. The cast keeps the
33
+ * template's generic inference on `Date` while passing runtime values
34
+ * (including `string` bounds, as in `eg-form-date-picker`) through untouched.
35
+ */
36
+ protected readonly $min: _angular_core.Signal<Date | undefined>;
37
+ protected readonly $max: _angular_core.Signal<Date | undefined>;
38
+ describedBy(): string | null;
39
+ userClass: _angular_core.InputSignal<ClassValue>;
40
+ labelClass: _angular_core.InputSignal<string>;
41
+ pickerClass: _angular_core.InputSignal<string>;
42
+ inputClass: _angular_core.InputSignal<string>;
43
+ errorClass: _angular_core.InputSignal<string>;
44
+ hintClass: _angular_core.InputSignal<string>;
45
+ $userClass: _angular_core.Signal<string>;
46
+ $labelClass: _angular_core.Signal<string>;
47
+ $pickerClass: _angular_core.Signal<string>;
48
+ $inputClass: _angular_core.Signal<string>;
49
+ $errorClass: _angular_core.Signal<string>;
50
+ $hintClass: _angular_core.Signal<string>;
51
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormDateRangePicker, never>;
52
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormDateRangePicker, "eg-form-date-range-picker", 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; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "autoCloseOnEndSelection": { "alias": "autoCloseOnEndSelection"; "required": false; "isSignal": true; }; "captionLayout": { "alias": "captionLayout"; "required": false; "isSignal": true; }; "formatDates": { "alias": "formatDates"; "required": false; "isSignal": true; }; "transformDates": { "alias": "transformDates"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "pickerClass": { "alias": "pickerClass"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
53
+ }
54
+
55
+ export { EgFormDateRangePicker };
@@ -0,0 +1,194 @@
1
+ # Form Input OTP (`@egose/shadcn-theme-ng/form-input-otp`)
2
+
3
+ A ready-made reactive-form one-time-code field: label + `brn-input-otp` slots + validation error/hint display in one tag. The model is a plain `string`.
4
+
5
+ The Angular implementation is a standalone wrapper: it renders `HlmFormField` / `HlmError` / `HlmHint` from `@egose/shadcn-theme-ng/form-field`, `HlmLabel`, and `BrnInputOtp` + `HlmInputOtp*` parts from `@egose/shadcn-theme-ng/input-otp` and `@spartan-ng/brain/input-otp`. The OTP input is bound with `[formControlName]="controlName()"` and renders one `hlm-input-otp-slot` per `length` unit in a single group. It must live inside a `FormGroupDirective` (`[formGroup]` parent); ids come from `HlmFormIdGenerator` unless overridden.
6
+
7
+ > **Ships as:** `@egose/shadcn-theme-ng/form-input-otp` and `@egose/shadcn-theme-ng-tw/form-input-otp`
8
+ > (the `tw:`-prefixed Tailwind variant). Both expose the identical TypeScript surface; only the
9
+ > emitted Tailwind class strings differ. See the [package README](../../README.md) for install
10
+ > steps, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ # Plain Tailwind (no prefix)
16
+ npm install @egose/shadcn-theme-ng
17
+
18
+ # tw:-prefixed Tailwind variant
19
+ npm install @egose/shadcn-theme-ng-tw
20
+ ```
21
+
22
+ Peer dependencies (Angular, `@spartan-ng/brain`, `rxjs`, …) are documented in the
23
+ [package README](../../README.md#peer-dependencies). This subpath additionally relies at runtime on
24
+ `@egose/shadcn-theme-ng/input-otp`, `@egose/shadcn-theme-ng/form-field`, and
25
+ `@egose/shadcn-theme-ng/label`.
26
+
27
+ ## Imports
28
+
29
+ Exported from the subpath root (`projects/form-input-otp/src/public-api.ts`):
30
+
31
+ ```ts
32
+ import { EgFormInputOtp, provideEgFormInputOtpConfig } from '@egose/shadcn-theme-ng/form-input-otp';
33
+ // tw variant: replace with '@egose/shadcn-theme-ng-tw/form-input-otp'
34
+ ```
35
+
36
+ Standalone usage:
37
+
38
+ ```ts
39
+ import { Component } from '@angular/core';
40
+ import { ReactiveFormsModule } from '@angular/forms';
41
+ import { EgFormInputOtp } from '@egose/shadcn-theme-ng/form-input-otp';
42
+
43
+ @Component({
44
+ selector: 'app-demo',
45
+ standalone: true,
46
+ imports: [ReactiveFormsModule, EgFormInputOtp],
47
+ template: `...`,
48
+ })
49
+ export class DemoComponent {}
50
+ ```
51
+
52
+ NgModule-based consumer: add `EgFormInputOtp` (and `ReactiveFormsModule`) to the module's
53
+ `imports` — it is a standalone component, not a module.
54
+
55
+ `ControlValueAccessor` behavior: `eg-form-input-otp` itself is not a `ControlValueAccessor`; the
56
+ inner `brn-input-otp` is (bound via `formControlName`), so `formControlName`/`formGroup` handling,
57
+ `Validators`, and `disabled` state from the control all flow through the parent form.
58
+
59
+ ## Anatomy / Structure
60
+
61
+ ```html
62
+ <form [formGroup]="form">
63
+ <eg-form-input-otp
64
+ controlName="code"
65
+ label="Verification code"
66
+ [length]="6"
67
+ [required]="true"
68
+ error="Enter the 6-digit code."
69
+ />
70
+ </form>
71
+ ```
72
+
73
+ Selector (from source): `eg-form-input-otp` (standalone component, host `tw:w-full`).
74
+
75
+ ## API reference
76
+
77
+ ### `EgFormInputOtp` — `eg-form-input-otp`
78
+
79
+ | Input | Type | Default | Description |
80
+ | ------------- | --------------------- | ------- | ------------------------------------------------------------------ |
81
+ | `controlName` | `string` | `''` | `formControlName` key inside the parent `FormGroup`. **Required.** |
82
+ | `label` | `string \| undefined` | — | Label text (hidden when omitted). |
83
+ | `error` | `string \| undefined` | — | Error text shown when invalid. |
84
+ | `hint` | `string \| undefined` | — | Hint text shown otherwise. |
85
+ | `controlId` | `string \| undefined` | — | Explicit id (first priority for `effectiveId`). |
86
+ | `id` | `string \| undefined` | — | Fallback id (second priority). |
87
+ | `length` | `number` | `6` | Slot count; one `hlm-input-otp-slot` is rendered per unit. |
88
+ | `disabled` | `boolean` | `false` | Locks interaction (form control stays enabled). |
89
+ | `required` | `boolean` | `false` | Shows a red `*` next to the label. |
90
+ | `class` | `ClassValue` | `''` | Extra host classes (base `tw:w-full`). |
91
+ | `labelClass` | `string` | `''` | Extra label classes (base `tw:mb-1`). |
92
+ | `otpClass` | `string` | `''` | Extra OTP container classes. |
93
+ | `errorClass` | `string` | `''` | Extra error classes (base `tw:mt-0`). |
94
+ | `hintClass` | `string` | `''` | Extra hint classes (base `tw:mt-0`). |
95
+
96
+ | Member | Description |
97
+ | -------------------- | -------------------------------------------------------------------------------- |
98
+ | `effectiveId` | `controlId() \|\| id() \|\| generated` — wired to OTP `inputId` and label `for`. |
99
+ | `errorId` / `hintId` | `effectiveId + '-error' / '-hint'`. |
100
+ | `slotIndexes` | `0..length-1` — drives slot rendering. |
101
+
102
+ Requires a `[formGroup]` ancestor (injects `FormGroupDirective`, provides `ControlContainer → FormGroupDirective`).
103
+
104
+ ## Examples
105
+
106
+ ### 1. Basic verification code
107
+
108
+ ```ts
109
+ import { Component, inject } from '@angular/core';
110
+ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
111
+ import { EgFormInputOtp } from '@egose/shadcn-theme-ng/form-input-otp';
112
+
113
+ @Component({
114
+ selector: 'app-verify',
115
+ standalone: true,
116
+ imports: [ReactiveFormsModule, EgFormInputOtp],
117
+ template: `
118
+ <form [formGroup]="form" (ngSubmit)="submit()">
119
+ <eg-form-input-otp
120
+ controlName="code"
121
+ label="Verification code"
122
+ [length]="6"
123
+ [required]="true"
124
+ error="Enter the 6-digit code."
125
+ />
126
+ <button type="submit" [disabled]="form.invalid">Verify</button>
127
+ </form>
128
+ `,
129
+ })
130
+ export class VerifyComponent {
131
+ private readonly fb = inject(FormBuilder);
132
+ readonly form = this.fb.group({ code: ['', [Validators.required, Validators.minLength(6)]] });
133
+ submit() {
134
+ console.log(this.form.value.code);
135
+ }
136
+ }
137
+ ```
138
+
139
+ ### 2. Short PIN with hint
140
+
141
+ ```ts
142
+ import { Component, inject } from '@angular/core';
143
+ import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
144
+ import { EgFormInputOtp } from '@egose/shadcn-theme-ng/form-input-otp';
145
+
146
+ @Component({
147
+ selector: 'app-pin',
148
+ standalone: true,
149
+ imports: [ReactiveFormsModule, EgFormInputOtp],
150
+ template: `
151
+ <form [formGroup]="form">
152
+ <eg-form-input-otp
153
+ controlName="pin"
154
+ label="PIN"
155
+ [length]="4"
156
+ hint="Check your authenticator app."
157
+ error="PIN is required."
158
+ />
159
+ </form>
160
+ `,
161
+ })
162
+ export class PinComponent {
163
+ private readonly fb = inject(FormBuilder);
164
+ readonly form = this.fb.group({ pin: [''] });
165
+ }
166
+ ```
167
+
168
+ ## Accessibility notes
169
+
170
+ - Label `for` ↔ OTP `inputId` wiring is automatic via `effectiveId` — always pass a `label`.
171
+ - `BrnInputOtp` exposes no `aria-describedby`, so error/hint ids render without an input-level link.
172
+ - The required `*` is visual; pair with `Validators.required` (plus `minLength`) so assistive tech and validation agree.
173
+
174
+ ## Theming / CSS variables
175
+
176
+ No component-specific CSS variables. Style per-instance via `class` / `labelClass` / `otpClass` / `errorClass` / `hintClass` (precedence: library base < global config < per-instance).
177
+
178
+ Global defaults per styling slot via the wrapper config:
179
+
180
+ ```ts
181
+ import { provideEgFormInputOtpConfig } from '@egose/shadcn-theme-ng/form-input-otp';
182
+
183
+ await bootstrapApplication(App, {
184
+ providers: [provideEgFormInputOtpConfig({ labelClass: 'tw:font-medium' })],
185
+ });
186
+ ```
187
+
188
+ The host keeps `tw:w-full`; constrain width with `class` or a wrapping container.
189
+
190
+ ## Related subpaths
191
+
192
+ - `@egose/shadcn-theme-ng/input-otp` — raw `brn-input-otp` + slot/group/separator parts for custom layouts.
193
+ - `@egose/shadcn-theme-ng/form-field` — `hlm-form-field` / `hlm-error` / `hlm-hint` used internally.
194
+ - `@egose/shadcn-theme-ng/form-field-simple` — alternative minimal wrapper when you compose controls by hand.