@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,24 @@
1
+ {
2
+ "name": "form-autocomplete",
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-autocomplete.mjs",
13
+ "typings": "types/form-autocomplete.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/form-autocomplete.d.ts",
20
+ "default": "./fesm2022/form-autocomplete.mjs"
21
+ }
22
+ },
23
+ "type": "module"
24
+ }
@@ -0,0 +1,61 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ValueProvider } from '@angular/core';
3
+ import { ClassValue } from 'clsx';
4
+
5
+ declare class EgFormAutocomplete {
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
+ placeholder: _angular_core.InputSignal<string>;
16
+ emptyText: _angular_core.InputSignal<string>;
17
+ disabled: _angular_core.InputSignal<boolean>;
18
+ required: _angular_core.InputSignal<boolean>;
19
+ options: _angular_core.InputSignal<string[]>;
20
+ readonly effectiveId: _angular_core.Signal<string>;
21
+ readonly errorId: _angular_core.Signal<string>;
22
+ readonly hintId: _angular_core.Signal<string>;
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
+ controlClass: _angular_core.InputSignal<string>;
32
+ inputClass: _angular_core.InputSignal<string>;
33
+ errorClass: _angular_core.InputSignal<string>;
34
+ hintClass: _angular_core.InputSignal<string>;
35
+ $userClass: _angular_core.Signal<string>;
36
+ $labelClass: _angular_core.Signal<string>;
37
+ $controlClass: _angular_core.Signal<string>;
38
+ $inputClass: _angular_core.Signal<string>;
39
+ $errorClass: _angular_core.Signal<string>;
40
+ $hintClass: _angular_core.Signal<string>;
41
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormAutocomplete, never>;
42
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormAutocomplete, "eg-form-autocomplete", 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; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "controlClass": { "alias": "controlClass"; "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>;
43
+ }
44
+
45
+ interface EgFormAutocompleteConfig {
46
+ /**
47
+ * Global class defaults for `eg-form-autocomplete` styling slots.
48
+ * Each is merged under the matching per-instance `*Class` input
49
+ * (library base < global config < per-instance).
50
+ */
51
+ labelClass?: string;
52
+ controlClass?: string;
53
+ inputClass?: string;
54
+ errorClass?: string;
55
+ hintClass?: string;
56
+ }
57
+ declare function provideEgFormAutocompleteConfig(config: Partial<EgFormAutocompleteConfig>): ValueProvider;
58
+ declare function injectEgFormAutocompleteConfig(): EgFormAutocompleteConfig;
59
+
60
+ export { EgFormAutocomplete, injectEgFormAutocompleteConfig, provideEgFormAutocompleteConfig };
61
+ export type { EgFormAutocompleteConfig };
@@ -98,8 +98,8 @@ Selector (from source): `eg-form-checkbox` (standalone component).
98
98
  | `class` | `ClassValue` | `''` | Extra host classes. |
99
99
  | `checkboxClass` | `string` | `''` | Extra classes for `hlm-checkbox`. |
100
100
  | `labelClass` | `string` | `''` | Extra classes for the label. |
101
- | `$errorClass` | `string` | `''` | Extra classes for `hlm-error`. (Note the `$` prefix — part of the real input name.) |
102
- | `$hintClass` | `string` | `''` | Extra classes for `hlm-hint`. (Note the `$` prefix.) |
101
+ | `errorClass` | `string` | `''` | Extra classes for `hlm-error`. |
102
+ | `hintClass` | `string` | `''` | Extra classes for `hlm-hint`. |
103
103
 
104
104
  | Member | Description |
105
105
  | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
@@ -303,7 +303,17 @@ export class SubmitCheckComponent {
303
303
 
304
304
  ## Theming / CSS variables
305
305
 
306
- No component-specific CSS variables. Style via `class`, `checkboxClass`, `labelClass`, `$errorClass`, `$hintClass` inputs and global tokens. The row layout (`flex items-center gap-1`) is fixed in the template.
306
+ No component-specific CSS variables. Style per-instance via `class`, `checkboxClass`, `labelClass`, `errorClass`, `hintClass` inputs. The row layout (`flex items-center gap-1`) is fixed in the template.
307
+
308
+ Global defaults per styling slot via the wrapper config (precedence: library base < global config < per-instance):
309
+
310
+ ```ts
311
+ import { provideEgFormCheckboxConfig } from '@egose/shadcn-theme-ng/form-checkbox';
312
+
313
+ await bootstrapApplication(App, {
314
+ providers: [provideEgFormCheckboxConfig({ checkboxClass: 'tw:size-5', labelClass: 'tw:font-medium' })],
315
+ });
316
+ ```
307
317
 
308
318
  ## Related subpaths
309
319
 
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { InjectionToken, inject, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
4
  import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
5
5
  import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
@@ -8,9 +8,18 @@ import { HlmFormIdGenerator, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw
8
8
  import { EgFormField } from '@egose/shadcn-theme-ng-tw/form-field-simple';
9
9
  import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
10
10
 
11
+ const EgFormCheckboxConfigToken = new InjectionToken('EgFormCheckboxConfig');
12
+ function provideEgFormCheckboxConfig(config) {
13
+ return { provide: EgFormCheckboxConfigToken, useValue: { ...config } };
14
+ }
15
+ function injectEgFormCheckboxConfig() {
16
+ return inject(EgFormCheckboxConfigToken, { optional: true }) ?? {};
17
+ }
18
+
11
19
  class EgFormCheckbox {
12
20
  formGroupDirective = inject(FormGroupDirective);
13
21
  generatedId = inject(HlmFormIdGenerator).generate('eg-form-checkbox');
22
+ _config = injectEgFormCheckboxConfig();
14
23
  // Classes
15
24
  userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
16
25
  _computedClass = computed(() => hlm('', this.userClass()), /* @ts-ignore */
@@ -55,17 +64,21 @@ class EgFormCheckbox {
55
64
  ...(ngDevMode ? [{ debugName: "checkboxClass" }] : /* istanbul ignore next */ []));
56
65
  labelClass = input('', /* @ts-ignore */
57
66
  ...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
58
- // Computed styling
59
- $checkboxClass = computed(() => hlm(this.checkboxClass()), /* @ts-ignore */
67
+ errorClass = input('', /* @ts-ignore */
68
+ ...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
69
+ hintClass = input('', /* @ts-ignore */
70
+ ...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
71
+ // Computed styling (library base < global config < per-instance)
72
+ $checkboxClass = computed(() => hlm(this._config.checkboxClass, this.checkboxClass()), /* @ts-ignore */
60
73
  ...(ngDevMode ? [{ debugName: "$checkboxClass" }] : /* istanbul ignore next */ []));
61
- $labelClass = computed(() => hlm(this.labelClass()), /* @ts-ignore */
74
+ $labelClass = computed(() => hlm(this._config.labelClass, this.labelClass()), /* @ts-ignore */
62
75
  ...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
63
- $errorClass = input('', /* @ts-ignore */
76
+ $errorClass = computed(() => hlm(this._config.errorClass, this.errorClass()), /* @ts-ignore */
64
77
  ...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
65
- $hintClass = input('', /* @ts-ignore */
78
+ $hintClass = computed(() => hlm(this._config.hintClass, this.hintClass()), /* @ts-ignore */
66
79
  ...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
67
80
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
68
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormCheckbox, isStandalone: true, selector: "eg-form-checkbox", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, 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 }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checkboxClass: { classPropertyName: "checkboxClass", publicName: "checkboxClass", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", 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": "_computedClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
81
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormCheckbox, isStandalone: true, selector: "eg-form-checkbox", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, 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 }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checkboxClass: { classPropertyName: "checkboxClass", publicName: "checkboxClass", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", 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": "_computedClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
69
82
  @let lbl = label();
70
83
  @let cnm = controlName();
71
84
  @let err = error();
@@ -158,7 +171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
158
171
  </eg-form-field>
159
172
  `,
160
173
  }]
161
- }], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], 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 }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkboxClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxClass", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], $errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "$errorClass", required: false }] }], $hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "$hintClass", required: false }] }] } });
174
+ }], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], 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 }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkboxClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxClass", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
162
175
 
163
176
  /*
164
177
  * Public API Surface of form-checkbox
@@ -168,5 +181,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
168
181
  * Generated bundle index. Do not edit.
169
182
  */
170
183
 
171
- export { EgFormCheckbox };
184
+ export { EgFormCheckbox, injectEgFormCheckboxConfig, provideEgFormCheckboxConfig };
172
185
 
@@ -1,9 +1,11 @@
1
1
  import * as _angular_core from '@angular/core';
2
+ import { ValueProvider } from '@angular/core';
2
3
  import { ClassValue } from 'clsx';
3
4
 
4
5
  declare class EgFormCheckbox {
5
6
  private readonly formGroupDirective;
6
7
  private readonly generatedId;
8
+ private readonly _config;
7
9
  readonly userClass: _angular_core.InputSignal<ClassValue>;
8
10
  protected readonly _computedClass: _angular_core.Signal<string>;
9
11
  label: _angular_core.InputSignal<string>;
@@ -22,12 +24,29 @@ declare class EgFormCheckbox {
22
24
  describedBy(): string | null;
23
25
  checkboxClass: _angular_core.InputSignal<string>;
24
26
  labelClass: _angular_core.InputSignal<string>;
27
+ errorClass: _angular_core.InputSignal<string>;
28
+ hintClass: _angular_core.InputSignal<string>;
25
29
  $checkboxClass: _angular_core.Signal<string>;
26
30
  $labelClass: _angular_core.Signal<string>;
27
- $errorClass: _angular_core.InputSignal<string>;
28
- $hintClass: _angular_core.InputSignal<string>;
31
+ $errorClass: _angular_core.Signal<string>;
32
+ $hintClass: _angular_core.Signal<string>;
29
33
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormCheckbox, never>;
30
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormCheckbox, "eg-form-checkbox", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "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; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checkboxClass": { "alias": "checkboxClass"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "$errorClass": { "alias": "$errorClass"; "required": false; "isSignal": true; }; "$hintClass": { "alias": "$hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
34
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormCheckbox, "eg-form-checkbox", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "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; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checkboxClass": { "alias": "checkboxClass"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
31
35
  }
32
36
 
33
- export { EgFormCheckbox };
37
+ interface EgFormCheckboxConfig {
38
+ /**
39
+ * Global class defaults for `eg-form-checkbox` styling slots.
40
+ * Each is merged under the matching per-instance `*Class` input
41
+ * (library base < global config < per-instance).
42
+ */
43
+ checkboxClass?: string;
44
+ labelClass?: string;
45
+ errorClass?: string;
46
+ hintClass?: string;
47
+ }
48
+ declare function provideEgFormCheckboxConfig(config: Partial<EgFormCheckboxConfig>): ValueProvider;
49
+ declare function injectEgFormCheckboxConfig(): EgFormCheckboxConfig;
50
+
51
+ export { EgFormCheckbox, injectEgFormCheckboxConfig, provideEgFormCheckboxConfig };
52
+ export type { EgFormCheckboxConfig };
@@ -0,0 +1,202 @@
1
+ # Form Combobox (`@egose/shadcn-theme-ng/form-combobox`)
2
+
3
+ A ready-made reactive-form combobox: label + searchable dropdown + validation error/hint display in one tag. Supports `multiple` mode (chips anchor, `string[]` model, the default) and `single` mode (trigger button, `string | null` model).
4
+
5
+ The Angular implementation is a standalone wrapper: it renders `HlmFormField` / `HlmError` / `HlmHint` from `@egose/shadcn-theme-ng/form-field`, `HlmLabel`, and the `HlmCombobox*` parts from `@egose/shadcn-theme-ng/combobox` (`HlmComboboxMultiple` + chips for multi, `HlmCombobox` + trigger for single). The picker root is bound with `[formControlName]="controlName()"` (both brain variants implement `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-combobox` and `@egose/shadcn-theme-ng-tw/form-combobox`
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/combobox`, `@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-combobox/src/public-api.ts`):
30
+
31
+ ```ts
32
+ import { EgFormCombobox, provideEgFormComboboxConfig } from '@egose/shadcn-theme-ng/form-combobox';
33
+ // tw variant: replace with '@egose/shadcn-theme-ng-tw/form-combobox'
34
+ ```
35
+
36
+ ## Anatomy / Structure
37
+
38
+ ```html
39
+ <form [formGroup]="form">
40
+ <eg-form-combobox controlName="tags" label="Tags" [options]="tags" [required]="true" error="Pick at least one." />
41
+ </form>
42
+ ```
43
+
44
+ Selector (from source): `eg-form-combobox` (standalone component, host `tw:w-full`).
45
+
46
+ ## API reference
47
+
48
+ ### `EgFormCombobox` — `eg-form-combobox`
49
+
50
+ | Input | Type | Default | Description |
51
+ | -------------- | ------------------------ | ------------------------ | ----------------------------------------------------------------------------------------------------------- |
52
+ | `controlName` | `string` | `''` | `formControlName` key inside the parent `FormGroup`. **Required.** |
53
+ | `mode` | `'single' \| 'multiple'` | `'multiple'` | `multiple` renders chips + multi-select (`string[]`); `single` renders a trigger button (`string \| null`). |
54
+ | `label` | `string \| undefined` | — | Label text (hidden when omitted). |
55
+ | `error` | `string \| undefined` | — | Error text shown when invalid. |
56
+ | `hint` | `string \| undefined` | — | Hint text shown otherwise. |
57
+ | `controlId` | `string \| undefined` | — | Explicit id (first priority for `effectiveId`). |
58
+ | `id` | `string \| undefined` | — | Fallback id (second priority). |
59
+ | `placeholder` | `string` | `'Pick…'` | Search input placeholder. |
60
+ | `emptyText` | `string` | `'Nothing left to add.'` | Text shown when no option matches. |
61
+ | `disabled` | `boolean` | `false` | Locks interaction (form control stays enabled). |
62
+ | `required` | `boolean` | `false` | Shows a red `*` next to the label. |
63
+ | `options` | `string[]` | `[]` | Rendered as `hlm-combobox-item` entries. |
64
+ | `class` | `ClassValue` | `''` | Extra host classes (base `tw:w-full`). |
65
+ | `labelClass` | `string` | `''` | Extra label classes (base `tw:mb-1`). |
66
+ | `controlClass` | `string` | `''` | Extra multi-root classes. |
67
+ | `chipsClass` | `string` | `''` | Extra chips-anchor classes. |
68
+ | `errorClass` | `string` | `''` | Extra error classes (base `tw:mt-0`). |
69
+ | `hintClass` | `string` | `''` | Extra hint classes (base `tw:mt-0`). |
70
+
71
+ | Member | Description |
72
+ | -------------------- | ---------------------------------------------------------------------------------- |
73
+ | `effectiveId` | `controlId() \|\| id() \|\| generated` — wired to chip-input `id` and label `for`. |
74
+ | `errorId` / `hintId` | `effectiveId + '-error' / '-hint'`. |
75
+ | `selectedValues` | Current selection read reactively from the brain model — drives chip rendering. |
76
+
77
+ Requires a `[formGroup]` ancestor (injects `FormGroupDirective`, provides `ControlContainer → FormGroupDirective`).
78
+
79
+ ## Examples
80
+
81
+ ### 1. Required multi-select
82
+
83
+ ```ts
84
+ import { Component, inject } from '@angular/core';
85
+ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
86
+ import { EgFormCombobox } from '@egose/shadcn-theme-ng/form-combobox';
87
+
88
+ @Component({
89
+ selector: 'app-tags',
90
+ standalone: true,
91
+ imports: [ReactiveFormsModule, EgFormCombobox],
92
+ template: `
93
+ <form [formGroup]="form" (ngSubmit)="submit()">
94
+ <eg-form-combobox controlName="tags" label="Tags" [options]="tags" [required]="true" error="Pick at least one." />
95
+ <button type="submit" [disabled]="form.invalid">Save</button>
96
+ </form>
97
+ `,
98
+ })
99
+ export class TagsComponent {
100
+ private readonly fb = inject(FormBuilder);
101
+ readonly form = this.fb.group({ tags: [<string[]>[], Validators.required] });
102
+ readonly tags = ['Angular', 'React', 'Vue', 'Svelte'];
103
+ submit() {
104
+ console.log(this.form.value.tags);
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### 2. Preselected with hint
110
+
111
+ ```ts
112
+ import { Component, inject } from '@angular/core';
113
+ import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
114
+ import { EgFormCombobox } from '@egose/shadcn-theme-ng/form-combobox';
115
+
116
+ @Component({
117
+ selector: 'app-stack',
118
+ standalone: true,
119
+ imports: [ReactiveFormsModule, EgFormCombobox],
120
+ template: `
121
+ <form [formGroup]="form">
122
+ <eg-form-combobox
123
+ controlName="stack"
124
+ label="Stack"
125
+ [options]="options"
126
+ placeholder="Add tag…"
127
+ hint="Type to filter, click to add, × to remove."
128
+ />
129
+ </form>
130
+ `,
131
+ })
132
+ export class StackComponent {
133
+ private readonly fb = inject(FormBuilder);
134
+ readonly form = this.fb.group({ stack: [['Angular']] });
135
+ readonly options = ['Angular', 'React', 'Vue', 'Svelte', 'Solid'];
136
+ }
137
+ ```
138
+
139
+ ### 3. Single-select dropdown
140
+
141
+ ```ts
142
+ import { Component, inject } from '@angular/core';
143
+ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
144
+ import { EgFormCombobox } from '@egose/shadcn-theme-ng/form-combobox';
145
+
146
+ @Component({
147
+ selector: 'app-fruit-single',
148
+ standalone: true,
149
+ imports: [ReactiveFormsModule, EgFormCombobox],
150
+ template: `
151
+ <form [formGroup]="form" (ngSubmit)="submit()">
152
+ <eg-form-combobox
153
+ controlName="fruit"
154
+ label="Fruit"
155
+ mode="single"
156
+ [options]="options"
157
+ placeholder="Select a fruit…"
158
+ [required]="true"
159
+ error="Fruit is required."
160
+ />
161
+ <button type="submit" [disabled]="form.invalid">Save</button>
162
+ </form>
163
+ `,
164
+ })
165
+ export class FruitSingleComponent {
166
+ private readonly fb = inject(FormBuilder);
167
+ readonly form = this.fb.group({ fruit: [null as string | null, Validators.required] });
168
+ readonly options = ['Apple', 'Banana', 'Cherry'];
169
+ submit() {
170
+ console.log(this.form.value.fruit);
171
+ }
172
+ }
173
+ ```
174
+
175
+ ## Accessibility notes
176
+
177
+ - Label `for` ↔ chip-search-input `id` wiring is automatic via `effectiveId` — always pass a `label`.
178
+ - The chip search input exposes no `aria-describedby`, so error/hint ids render without an input-level link.
179
+ - The required `*` is visual; pair with `Validators.required` so assistive tech and validation agree.
180
+
181
+ ## Theming / CSS variables
182
+
183
+ No component-specific CSS variables. Style per-instance via `class` / `labelClass` / `controlClass` / `chipsClass` / `errorClass` / `hintClass` (precedence: library base < global config < per-instance).
184
+
185
+ Global defaults per styling slot via the wrapper config:
186
+
187
+ ```ts
188
+ import { provideEgFormComboboxConfig } from '@egose/shadcn-theme-ng/form-combobox';
189
+
190
+ await bootstrapApplication(App, {
191
+ providers: [provideEgFormComboboxConfig({ labelClass: 'tw:font-medium' })],
192
+ });
193
+ ```
194
+
195
+ The host keeps `tw:w-full`; constrain width with `class` or a wrapping container.
196
+
197
+ ## Related subpaths
198
+
199
+ - `@egose/shadcn-theme-ng/combobox` — raw `HlmCombobox*` parts (single + multi) for custom layouts.
200
+ - `@egose/shadcn-theme-ng/form-autocomplete` — single-value text-search counterpart (`eg-form-autocomplete`).
201
+ - `@egose/shadcn-theme-ng/form-searchable-multiselect` — alternative multi-select with popover checkboxes.
202
+ - `@egose/shadcn-theme-ng/form-field` — `hlm-form-field` / `hlm-error` / `hlm-hint` used internally.