@egose/shadcn-theme-ng-tw 0.2.0 → 0.4.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 (97) 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 +178 -0
  12. package/form-autocomplete/fesm2022/form-autocomplete.mjs +243 -0
  13. package/form-autocomplete/package.json +24 -0
  14. package/form-autocomplete/types/form-autocomplete.d.ts +81 -0
  15. package/form-checkbox/README.md +29 -18
  16. package/form-checkbox/fesm2022/form-checkbox.mjs +62 -22
  17. package/form-checkbox/types/form-checkbox.d.ts +43 -4
  18. package/form-combobox/README.md +203 -0
  19. package/form-combobox/fesm2022/form-combobox.mjs +305 -0
  20. package/form-combobox/package.json +24 -0
  21. package/form-combobox/types/form-combobox.d.ts +93 -0
  22. package/form-date-picker/README.md +49 -22
  23. package/form-date-picker/fesm2022/form-date-picker.mjs +100 -29
  24. package/form-date-picker/types/form-date-picker.d.ts +37 -1
  25. package/form-date-picker-multi/README.md +192 -0
  26. package/form-date-picker-multi/fesm2022/form-date-picker-multi.mjs +266 -0
  27. package/form-date-picker-multi/package.json +24 -0
  28. package/form-date-picker-multi/types/form-date-picker-multi.d.ts +78 -0
  29. package/form-date-range-picker/README.md +254 -0
  30. package/form-date-range-picker/fesm2022/form-date-range-picker.mjs +263 -0
  31. package/form-date-range-picker/package.json +24 -0
  32. package/form-date-range-picker/types/form-date-range-picker.d.ts +75 -0
  33. package/form-field/README.md +9 -0
  34. package/form-field/fesm2022/form-field.mjs +80 -5
  35. package/form-field/types/form-field.d.ts +50 -2
  36. package/form-field-simple/fesm2022/form-field-simple.mjs +15 -1
  37. package/form-field-simple/types/form-field-simple.d.ts +9 -2
  38. package/form-input-otp/README.md +195 -0
  39. package/form-input-otp/fesm2022/form-input-otp.mjs +226 -0
  40. package/form-input-otp/package.json +24 -0
  41. package/form-input-otp/types/form-input-otp.d.ts +78 -0
  42. package/form-month-year-picker/README.md +189 -0
  43. package/form-month-year-picker/fesm2022/form-month-year-picker.mjs +256 -0
  44. package/form-month-year-picker/package.json +24 -0
  45. package/form-month-year-picker/types/form-month-year-picker.d.ts +73 -0
  46. package/form-native-select/README.md +206 -0
  47. package/form-native-select/fesm2022/form-native-select.mjs +226 -0
  48. package/form-native-select/package.json +24 -0
  49. package/form-native-select/types/form-native-select.d.ts +77 -0
  50. package/form-phone-input/README.md +189 -0
  51. package/form-phone-input/fesm2022/form-phone-input.mjs +230 -0
  52. package/form-phone-input/package.json +24 -0
  53. package/form-phone-input/types/form-phone-input.d.ts +78 -0
  54. package/form-radio-group/README.md +199 -0
  55. package/form-radio-group/fesm2022/form-radio-group.mjs +238 -0
  56. package/form-radio-group/package.json +24 -0
  57. package/form-radio-group/types/form-radio-group.d.ts +83 -0
  58. package/form-searchable-multiselect/README.md +28 -17
  59. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +60 -24
  60. package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +39 -2
  61. package/form-select/README.md +30 -19
  62. package/form-select/fesm2022/form-select.mjs +65 -29
  63. package/form-select/types/form-select.d.ts +39 -2
  64. package/form-slider/README.md +183 -0
  65. package/form-slider/fesm2022/form-slider.mjs +218 -0
  66. package/form-slider/package.json +24 -0
  67. package/form-slider/types/form-slider.d.ts +80 -0
  68. package/form-switch/README.md +174 -0
  69. package/form-switch/fesm2022/form-switch.mjs +205 -0
  70. package/form-switch/package.json +24 -0
  71. package/form-switch/types/form-switch.d.ts +70 -0
  72. package/form-text-input/README.md +37 -26
  73. package/form-text-input/fesm2022/form-text-input.mjs +60 -24
  74. package/form-text-input/types/form-text-input.d.ts +39 -2
  75. package/form-textarea/README.md +33 -22
  76. package/form-textarea/fesm2022/form-textarea.mjs +60 -24
  77. package/form-textarea/types/form-textarea.d.ts +39 -2
  78. package/form-toggle/README.md +187 -0
  79. package/form-toggle/fesm2022/form-toggle.mjs +275 -0
  80. package/form-toggle/package.json +24 -0
  81. package/form-toggle/types/form-toggle.d.ts +100 -0
  82. package/form-toggle-group/README.md +177 -0
  83. package/form-toggle-group/fesm2022/form-toggle-group.mjs +243 -0
  84. package/form-toggle-group/package.json +24 -0
  85. package/form-toggle-group/types/form-toggle-group.d.ts +85 -0
  86. package/input-group/fesm2022/input-group.mjs +20 -10
  87. package/input-group/types/input-group.d.ts +4 -1
  88. package/native-select/fesm2022/native-select.mjs +18 -6
  89. package/native-select/types/native-select.d.ts +7 -2
  90. package/package.json +57 -1
  91. package/phone-input/README.md +114 -0
  92. package/phone-input/fesm2022/phone-input.mjs +191 -0
  93. package/phone-input/package.json +24 -0
  94. package/phone-input/types/phone-input.d.ts +67 -0
  95. package/sheet/fesm2022/sheet.mjs +1 -1
  96. package/switch/fesm2022/switch.mjs +7 -5
  97. package/switch/types/switch.d.ts +2 -1
@@ -1,18 +1,30 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { ValueProvider } from '@angular/core';
3
3
  import { BrnDateInput, BrnDatePickerTriggerBase, BrnDatePickerBase } from '@spartan-ng/brain/date-picker';
4
- import * as i1 from '@egose/shadcn-theme-ng-tw/input-group';
5
4
  import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
5
+ import { ClassValue } from 'clsx';
6
+ import * as i1 from '@egose/shadcn-theme-ng-tw/input-group';
6
7
  import { ControlValueAccessor } from '@angular/forms';
7
8
  import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
8
9
  import { BrnOverlayState } from '@spartan-ng/brain/overlay';
9
10
  import * as _spartan_ng_brain_popover from '@spartan-ng/brain/popover';
10
11
  import { BrnPopover } from '@spartan-ng/brain/popover';
11
12
  import * as i1$1 from '@spartan-ng/brain/field';
12
- import { ClassValue } from 'clsx';
13
13
 
14
14
  declare class HlmDateMultiInput<T> extends BrnDateInput<T[]> implements BrnDatePickerTriggerBase {
15
15
  private readonly _config;
16
+ /** Native `name` attribute forwarded to the inner `<input>`. */
17
+ readonly name: _angular_core.InputSignal<string | undefined>;
18
+ /** Native `readonly` state forwarded to the inner `<input>`. */
19
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
20
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
21
+ readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
22
+ /** Extra classes merged onto the host group container (over the `HlmInputGroup` base). */
23
+ readonly userClass: _angular_core.InputSignal<ClassValue>;
24
+ /** Extra classes merged onto the inner `<input>` (over the input-group input base). */
25
+ readonly inputClass: _angular_core.InputSignal<ClassValue>;
26
+ protected readonly $inputClass: _angular_core.Signal<string>;
27
+ constructor();
16
28
  /**
17
29
  * Parses input text into dates. Return `null` for invalid input - the
18
30
  * picker's dates are cleared while the text is preserved so the user can
@@ -31,7 +43,7 @@ declare class HlmDateMultiInput<T> extends BrnDateInput<T[]> implements BrnDateP
31
43
  protected parseValue(value: string): T[] | null;
32
44
  protected formatInputValue(value: T[]): string;
33
45
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmDateMultiInput<any>, never>;
34
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDateMultiInput<any>, "hlm-date-multi-input", never, { "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
46
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDateMultiInput<any>, "hlm-date-multi-input", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
35
47
  }
36
48
 
37
49
  declare const HLM_DATE_PICKER_VALUE_ACCESSOR: {
@@ -112,6 +124,16 @@ declare class HlmDatePickerInput<T> extends BrnDateInput<T> implements BrnDatePi
112
124
  private readonly _config;
113
125
  readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
114
126
  readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
127
+ /** Native `name` attribute forwarded to the inner `<input>`. */
128
+ readonly name: _angular_core.InputSignal<string | undefined>;
129
+ /** Native `readonly` state forwarded to the inner `<input>`. */
130
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
131
+ /** Extra classes merged onto the host group container (over the `HlmInputGroup` base). */
132
+ readonly userClass: _angular_core.InputSignal<ClassValue>;
133
+ /** Extra classes merged onto the inner `<input>` (over the input-group input base). */
134
+ readonly inputClass: _angular_core.InputSignal<ClassValue>;
135
+ protected readonly $inputClass: _angular_core.Signal<string>;
136
+ constructor();
115
137
  /**
116
138
  * Parses input text into a date value. Return `null` for invalid
117
139
  * input - the picker's date is cleared while the text is preserved so
@@ -130,7 +152,7 @@ declare class HlmDatePickerInput<T> extends BrnDateInput<T> implements BrnDatePi
130
152
  protected parseValue(value: string): T | null;
131
153
  protected formatInputValue(value: T): string;
132
154
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmDatePickerInput<any>, never>;
133
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDatePickerInput<any>, "hlm-date-picker-input", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
155
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDatePickerInput<any>, "hlm-date-picker-input", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
134
156
  }
135
157
 
136
158
  declare const HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR: {
@@ -164,9 +186,10 @@ declare class HlmDatePickerMulti<T> implements BrnDatePickerBase<T[]>, ControlVa
164
186
  /** Defines how the date should be transformed before saving to model/form. */
165
187
  readonly transformDates: _angular_core.InputSignal<(date: T[]) => T[]>;
166
188
  protected readonly _popoverState: _angular_core.WritableSignal<BrnOverlayState | null>;
167
- protected readonly _disabled: _angular_core.WritableSignal<boolean>;
189
+ private readonly _formDisabled;
168
190
  /** @internal The disabled state as a readonly signal */
169
191
  readonly disabledState: _angular_core.Signal<boolean>;
192
+ protected readonly _disabled: _angular_core.Signal<boolean>;
170
193
  readonly formattedDate: _angular_core.Signal<string | undefined>;
171
194
  readonly dateChange: _angular_core.OutputEmitterRef<T[]>;
172
195
  readonly labelableId: _angular_core.Signal<string | undefined>;
@@ -225,6 +248,18 @@ declare class HlmDatePickerTrigger implements BrnDatePickerTriggerBase {
225
248
 
226
249
  declare class HlmDateRangeInput<T> extends BrnDateInput<[T, T]> implements BrnDatePickerTriggerBase {
227
250
  private readonly _config;
251
+ /** Native `name` attribute forwarded to the inner `<input>`. */
252
+ readonly name: _angular_core.InputSignal<string | undefined>;
253
+ /** Native `readonly` state forwarded to the inner `<input>`. */
254
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
255
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
256
+ readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
257
+ /** Extra classes merged onto the host group container (over the `HlmInputGroup` base). */
258
+ readonly userClass: _angular_core.InputSignal<ClassValue>;
259
+ /** Extra classes merged onto the inner `<input>` (over the input-group input base). */
260
+ readonly inputClass: _angular_core.InputSignal<ClassValue>;
261
+ protected readonly $inputClass: _angular_core.Signal<string>;
262
+ constructor();
228
263
  /**
229
264
  * Parses input text into a date range. Return `null` for invalid
230
265
  * input - the picker's range is cleared while the text is preserved so
@@ -243,7 +278,7 @@ declare class HlmDateRangeInput<T> extends BrnDateInput<[T, T]> implements BrnDa
243
278
  protected parseValue(value: string): [T, T] | null;
244
279
  protected formatInputValue(value: [T, T]): string;
245
280
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmDateRangeInput<any>, never>;
246
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDateRangeInput<any>, "hlm-date-range-input", never, { "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
281
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDateRangeInput<any>, "hlm-date-range-input", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
247
282
  }
248
283
 
249
284
  declare const HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR: {
@@ -275,9 +310,10 @@ declare class HlmDateRangePicker<T> implements BrnDatePickerBase<[T, T]>, Contro
275
310
  /** Defines how the date should be transformed before saving to model/form. */
276
311
  readonly transformDates: _angular_core.InputSignal<(date: [T, T]) => [T, T]>;
277
312
  protected readonly _popoverState: _angular_core.WritableSignal<BrnOverlayState | null>;
278
- protected readonly _disabled: _angular_core.WritableSignal<boolean>;
313
+ private readonly _formDisabled;
279
314
  /** @internal The disabled state as a readonly signal */
280
315
  readonly disabledState: _angular_core.Signal<boolean>;
316
+ protected readonly _disabled: _angular_core.Signal<boolean>;
281
317
  readonly formattedDate: _angular_core.Signal<string | undefined>;
282
318
  readonly dateChange: _angular_core.OutputEmitterRef<[T, T] | null>;
283
319
  readonly labelableId: _angular_core.Signal<string | undefined>;
@@ -311,6 +347,18 @@ declare class HlmDateRangePicker<T> implements BrnDatePickerBase<[T, T]>, Contro
311
347
 
312
348
  declare class HlmMonthYearInput<T> extends BrnDateInput<T> implements BrnDatePickerTriggerBase {
313
349
  private readonly _config;
350
+ /** Native `name` attribute forwarded to the inner `<input>`. */
351
+ readonly name: _angular_core.InputSignal<string | undefined>;
352
+ /** Native `readonly` state forwarded to the inner `<input>`. */
353
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
354
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
355
+ readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
356
+ /** Extra classes merged onto the host group container (over the `HlmInputGroup` base). */
357
+ readonly userClass: _angular_core.InputSignal<ClassValue>;
358
+ /** Extra classes merged onto the inner `<input>` (over the input-group input base). */
359
+ readonly inputClass: _angular_core.InputSignal<ClassValue>;
360
+ protected readonly $inputClass: _angular_core.Signal<string>;
361
+ constructor();
314
362
  /**
315
363
  * Parses input text into a date value. Return `null` for invalid
316
364
  * input - the picker's date is cleared while the text is preserved so
@@ -329,7 +377,7 @@ declare class HlmMonthYearInput<T> extends BrnDateInput<T> implements BrnDatePic
329
377
  protected parseValue(value: string): T | null;
330
378
  protected formatInputValue(value: T): string;
331
379
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmMonthYearInput<any>, never>;
332
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmMonthYearInput<any>, "hlm-month-year-input", never, { "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
380
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmMonthYearInput<any>, "hlm-month-year-input", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
333
381
  }
334
382
 
335
383
  declare const HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR: {
@@ -359,9 +407,10 @@ declare class HlmMonthYearPicker<T> implements BrnDatePickerBase<T>, ControlValu
359
407
  /** Defines how the date should be transformed before saving to model/form. */
360
408
  readonly transformDate: _angular_core.InputSignal<(date: T) => T>;
361
409
  protected readonly _popoverState: _angular_core.WritableSignal<BrnOverlayState | null>;
362
- protected readonly _disabled: _angular_core.WritableSignal<boolean>;
410
+ private readonly _formDisabled;
363
411
  /** @internal The disabled state as a readonly signal */
364
412
  readonly disabledState: _angular_core.Signal<boolean>;
413
+ protected readonly _disabled: _angular_core.Signal<boolean>;
365
414
  readonly formattedDate: _angular_core.Signal<string | undefined>;
366
415
  readonly dateChange: _angular_core.OutputEmitterRef<T | null>;
367
416
  readonly labelableId: _angular_core.Signal<string | undefined>;
@@ -426,6 +475,17 @@ interface HlmDatePickerMultiConfig<T> {
426
475
  * @returns the parsed date, or `null` when the value can't be parsed
427
476
  */
428
477
  parseDate: (value: string) => T[] | null;
478
+ /**
479
+ * Global class defaults for form-wrapper styling slots.
480
+ * Each is merged under the matching per-instance `*Class` input
481
+ * (library base < global config < per-instance), mirroring how
482
+ * `formatDates` provides a global behavior default.
483
+ */
484
+ labelClass?: string;
485
+ pickerClass?: string;
486
+ inputClass?: string;
487
+ errorClass?: string;
488
+ hintClass?: string;
429
489
  }
430
490
  declare function provideHlmDatePickerMultiConfig<T>(config: Partial<HlmDatePickerMultiConfig<T>>): ValueProvider;
431
491
  declare function injectHlmDatePickerMultiConfig<T>(): HlmDatePickerMultiConfig<T>;
@@ -464,6 +524,17 @@ interface HlmDatePickerConfig<T> {
464
524
  * @returns the parsed date, or `null` when the value can't be parsed
465
525
  */
466
526
  parseDate: (value: string) => T | null;
527
+ /**
528
+ * Global class defaults for `eg-form-date-picker` styling slots.
529
+ * Each is merged under the matching per-instance `*Class` input
530
+ * (library base < global config < per-instance), mirroring how
531
+ * `formatDate` provides a global behavior default.
532
+ */
533
+ labelClass?: string;
534
+ pickerClass?: string;
535
+ inputClass?: string;
536
+ errorClass?: string;
537
+ hintClass?: string;
467
538
  }
468
539
  declare function provideHlmDatePickerConfig<T>(config: Partial<HlmDatePickerConfig<T>>): ValueProvider;
469
540
  declare function injectHlmDatePickerConfig<T>(): HlmDatePickerConfig<T>;
@@ -502,6 +573,17 @@ interface HlmDateRangePickerConfig<T> {
502
573
  * @returns the parsed range, or `null` when the value can't be parsed
503
574
  */
504
575
  parseDate: (value: string) => [T, T] | null;
576
+ /**
577
+ * Global class defaults for form-wrapper styling slots.
578
+ * Each is merged under the matching per-instance `*Class` input
579
+ * (library base < global config < per-instance), mirroring how
580
+ * `formatDates` provides a global behavior default.
581
+ */
582
+ labelClass?: string;
583
+ pickerClass?: string;
584
+ inputClass?: string;
585
+ errorClass?: string;
586
+ hintClass?: string;
505
587
  }
506
588
  declare function provideHlmDateRangePickerConfig<T>(config: Partial<HlmDateRangePickerConfig<T>>): ValueProvider;
507
589
  declare function injectHlmDateRangePickerConfig<T>(): HlmDateRangePickerConfig<T>;
@@ -540,6 +622,17 @@ interface HlmMonthYearPickerConfig<T> {
540
622
  * @returns the parsed date, or `null` when the value can't be parsed
541
623
  */
542
624
  parseDate: (value: string) => T | null;
625
+ /**
626
+ * Global class defaults for form-wrapper styling slots.
627
+ * Each is merged under the matching per-instance `*Class` input
628
+ * (library base < global config < per-instance), mirroring how
629
+ * `formatDate` provides a global behavior default.
630
+ */
631
+ labelClass?: string;
632
+ pickerClass?: string;
633
+ inputClass?: string;
634
+ errorClass?: string;
635
+ hintClass?: string;
543
636
  }
544
637
  declare function provideHlmMonthYearPickerConfig<T>(config: Partial<HlmMonthYearPickerConfig<T>>): ValueProvider;
545
638
  declare function injectHlmMonthYearPickerConfig<T>(): HlmMonthYearPickerConfig<T>;
@@ -0,0 +1,178 @@
1
+ # Form Autocomplete (`@egose/shadcn-theme-ng/form-autocomplete`)
2
+
3
+ A ready-made reactive-form autocomplete field: label + `hlm-autocomplete` text input with suggestion list + validation error/hint display in one tag. The model is a `string`.
4
+
5
+ The Angular implementation is a standalone wrapper: it renders `HlmFormField` / `HlmError` / `HlmHint` from `@egose/shadcn-theme-ng/form-field`, `HlmLabel`, and the `HlmAutocomplete*` parts from `@egose/shadcn-theme-ng/autocomplete`. The autocomplete root is bound with `[formControlName]="controlName()"` (`BrnAutocomplete` implements `ControlValueAccessor`), so the parent `FormGroup` owns the value. It must live inside a `FormGroupDirective` (`[formGroup]` parent); ids come from `HlmFormIdGenerator` unless overridden.
6
+
7
+ > **Ships as:** `@egose/shadcn-theme-ng/form-autocomplete` and `@egose/shadcn-theme-ng-tw/form-autocomplete`
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`, `@ng-icons/*`, `rxjs`, …) are documented in the
23
+ [package README](../../README.md#peer-dependencies). This subpath additionally relies at runtime on
24
+ `@egose/shadcn-theme-ng/autocomplete`, `@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-autocomplete/src/public-api.ts`):
30
+
31
+ ```ts
32
+ import { EgFormAutocomplete, provideEgFormAutocompleteConfig } from '@egose/shadcn-theme-ng/form-autocomplete';
33
+ // tw variant: replace with '@egose/shadcn-theme-ng-tw/form-autocomplete'
34
+ ```
35
+
36
+ ## Anatomy / Structure
37
+
38
+ ```html
39
+ <form [formGroup]="form">
40
+ <eg-form-autocomplete
41
+ controlName="fruit"
42
+ label="Fruit"
43
+ [options]="fruits"
44
+ [required]="true"
45
+ error="Fruit is required."
46
+ />
47
+ </form>
48
+ ```
49
+
50
+ Selector (from source): `eg-form-autocomplete` (standalone component, host `tw:w-full`).
51
+
52
+ ## API reference
53
+
54
+ ### `EgFormAutocomplete` — `eg-form-autocomplete`
55
+
56
+ | Input | Type | Default | Description |
57
+ | -------------- | --------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
58
+ | `controlName` | `string` | `''` | `formControlName` key inside the parent `FormGroup`. **Required.** |
59
+ | `label` | `string \| undefined` | — | Label text (hidden when omitted). |
60
+ | `error` | `string \| undefined` | — | Error text shown when invalid. |
61
+ | `autoError` | `boolean` | `true` | Auto-resolve the message from the control's `ValidationErrors` when `error` is unset. Explicit `error` always wins; `error=""` counts as unset. Global wording via `provideEgFormErrorMessages`. |
62
+ | `hint` | `string \| undefined` | — | Hint text shown otherwise. |
63
+ | `controlId` | `string \| undefined` | — | Explicit id (first priority for `effectiveId`). |
64
+ | `id` | `string \| undefined` | — | Fallback id (second priority). |
65
+ | `placeholder` | `string` | `'Type to search…'` | Input placeholder. |
66
+ | `emptyText` | `string` | `'No result.'` | Text shown when no option matches. |
67
+ | `disabled` | `boolean` | `false` | Locks interaction (form control stays enabled). |
68
+ | `required` | `boolean` | `false` | Shows a red `*` next to the label. |
69
+ | `options` | `string[]` | `[]` | Rendered as `hlm-autocomplete-item` entries. |
70
+ | `class` | `ClassValue` | `''` | Extra host classes (base `tw:w-full`). |
71
+ | `labelClass` | `string` | `''` | Extra label classes (base `tw:mb-1`). |
72
+ | `controlClass` | `string` | `''` | Extra autocomplete-root classes. |
73
+ | `inputClass` | `string` | `''` | Extra text-input classes. |
74
+ | `errorClass` | `string` | `''` | Extra error classes (base `tw:mt-0`). |
75
+ | `hintClass` | `string` | `''` | Extra hint classes (base `tw:mt-0`). |
76
+
77
+ | Member | Description |
78
+ | -------------------- | ---------------------------------------------------------------------------------- |
79
+ | `effectiveId` | `controlId() \|\| id() \|\| generated` — wired to input `inputId` and label `for`. |
80
+ | `errorId` / `hintId` | `effectiveId + '-error' / '-hint'`. |
81
+
82
+ Requires a `[formGroup]` ancestor (injects `FormGroupDirective`, provides `ControlContainer → FormGroupDirective`).
83
+
84
+ ## Examples
85
+
86
+ ### 1. Basic required autocomplete
87
+
88
+ ```ts
89
+ import { Component, inject } from '@angular/core';
90
+ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
91
+ import { EgFormAutocomplete } from '@egose/shadcn-theme-ng/form-autocomplete';
92
+
93
+ @Component({
94
+ selector: 'app-fruit',
95
+ standalone: true,
96
+ imports: [ReactiveFormsModule, EgFormAutocomplete],
97
+ template: `
98
+ <form [formGroup]="form" (ngSubmit)="submit()">
99
+ <eg-form-autocomplete
100
+ controlName="fruit"
101
+ label="Fruit"
102
+ [options]="fruits"
103
+ [required]="true"
104
+ error="Fruit is required."
105
+ />
106
+ <button type="submit" [disabled]="form.invalid">Continue</button>
107
+ </form>
108
+ `,
109
+ })
110
+ export class FruitComponent {
111
+ private readonly fb = inject(FormBuilder);
112
+ readonly form = this.fb.group({ fruit: ['', Validators.required] });
113
+ readonly fruits = ['Apple', 'Banana', 'Cherry'];
114
+ submit() {
115
+ console.log(this.form.value.fruit);
116
+ }
117
+ }
118
+ ```
119
+
120
+ ### 2. Custom empty text + hint
121
+
122
+ ```ts
123
+ import { Component, inject } from '@angular/core';
124
+ import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
125
+ import { EgFormAutocomplete } from '@egose/shadcn-theme-ng/form-autocomplete';
126
+
127
+ @Component({
128
+ selector: 'app-city',
129
+ standalone: true,
130
+ imports: [ReactiveFormsModule, EgFormAutocomplete],
131
+ template: `
132
+ <form [formGroup]="form">
133
+ <eg-form-autocomplete
134
+ controlName="city"
135
+ label="City"
136
+ [options]="cities"
137
+ placeholder="Start typing…"
138
+ emptyText="No matching city."
139
+ hint="We ship to these cities."
140
+ />
141
+ </form>
142
+ `,
143
+ })
144
+ export class CityComponent {
145
+ private readonly fb = inject(FormBuilder);
146
+ readonly form = this.fb.group({ city: [''] });
147
+ readonly cities = ['Berlin', 'Paris', 'Rome'];
148
+ }
149
+ ```
150
+
151
+ ## Accessibility notes
152
+
153
+ - Label `for` ↔ input `inputId` wiring is automatic via `effectiveId` — always pass a `label`.
154
+ - The autocomplete input exposes no `aria-describedby`, so error/hint ids render without an input-level link.
155
+ - The required `*` is visual; pair with `Validators.required` so assistive tech and validation agree.
156
+
157
+ ## Theming / CSS variables
158
+
159
+ No component-specific CSS variables. Style per-instance via `class` / `labelClass` / `controlClass` / `inputClass` / `errorClass` / `hintClass` (precedence: library base < global config < per-instance).
160
+
161
+ Global defaults per styling slot via the wrapper config:
162
+
163
+ ```ts
164
+ import { provideEgFormAutocompleteConfig } from '@egose/shadcn-theme-ng/form-autocomplete';
165
+
166
+ await bootstrapApplication(App, {
167
+ providers: [provideEgFormAutocompleteConfig({ inputClass: 'tw:text-sm', labelClass: 'tw:font-medium' })],
168
+ });
169
+ ```
170
+
171
+ The host keeps `tw:w-full`; constrain width with `class` (e.g. `tw:max-w-sm`) or a wrapping container.
172
+
173
+ ## Related subpaths
174
+
175
+ - `@egose/shadcn-theme-ng/autocomplete` — raw `HlmAutocomplete*` parts for custom layouts.
176
+ - `@egose/shadcn-theme-ng/form-combobox` — multi-select counterpart with chips (`eg-form-combobox`).
177
+ - `@egose/shadcn-theme-ng/form-field` — `hlm-form-field` / `hlm-error` / `hlm-hint` used internally.
178
+ - `@egose/shadcn-theme-ng/form-field-simple` — alternative minimal wrapper when you compose controls by hand.