@nanahoshi/mona-ui 0.30.0 → 0.31.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 (109) hide show
  1. package/docs/api/button-group.md +1 -0
  2. package/docs/api/color-gradient.md +1 -0
  3. package/docs/api/color-palette.md +1 -0
  4. package/docs/api/color-picker.md +1 -0
  5. package/docs/api/form-field.md +88 -0
  6. package/docs/api/i18n.md +31 -0
  7. package/docs/api/locales.md +14 -14
  8. package/docs/api/segmented.md +1 -0
  9. package/docs/api/switch.md +1 -0
  10. package/docs/dropdown-list.md +1 -1
  11. package/docs/form-field.md +425 -0
  12. package/docs/forms.md +12 -4
  13. package/docs/label.md +4 -5
  14. package/docs/numeric-textbox.md +1 -1
  15. package/docs/radio-button.md +2 -1
  16. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +15 -4
  17. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +25 -1
  18. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +5 -2
  19. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +29 -3
  20. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +25 -1
  21. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +31 -3
  22. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +15 -4
  23. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +15 -4
  24. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +15 -4
  25. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +19 -7
  26. package/fesm2022/nanahoshi-mona-ui-editor.mjs +24 -4
  27. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -0
  28. package/fesm2022/nanahoshi-mona-ui-form-field.mjs +666 -0
  29. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +31 -0
  30. package/fesm2022/nanahoshi-mona-ui-internal.mjs +27 -2
  31. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +27 -0
  32. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +13 -0
  33. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +19 -0
  34. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +19 -0
  35. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +13 -0
  36. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +19 -0
  37. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +13 -0
  38. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +13 -0
  39. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +23 -0
  40. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +19 -0
  41. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +23 -0
  42. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +13 -0
  43. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +13 -0
  44. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +13 -0
  45. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +19 -7
  46. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +14 -5
  47. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +6 -3
  48. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +15 -9
  49. package/fesm2022/nanahoshi-mona-ui-rating.mjs +6 -3
  50. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +25 -1
  51. package/fesm2022/nanahoshi-mona-ui-slider.mjs +8 -5
  52. package/fesm2022/nanahoshi-mona-ui-switch.mjs +25 -1
  53. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +6 -3
  54. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +15 -4
  55. package/form-field/package.json +4 -0
  56. package/i18n/catalogs/en-US.messages.json +13 -0
  57. package/llms.txt +3 -1
  58. package/locales/ar-sa/ar-sa.messages.json +13 -0
  59. package/locales/de-de/de-de.messages.json +13 -0
  60. package/locales/es-es/es-es.messages.json +13 -0
  61. package/locales/fr-fr/fr-fr.messages.json +13 -0
  62. package/locales/id-id/id-id.messages.json +13 -0
  63. package/locales/it-it/it-it.messages.json +13 -0
  64. package/locales/ja-jp/ja-jp.messages.json +13 -0
  65. package/locales/ko-kr/ko-kr.messages.json +13 -0
  66. package/locales/pl-pl/pl-pl.messages.json +13 -0
  67. package/locales/pt-br/pt-br.messages.json +13 -0
  68. package/locales/ru-ru/ru-ru.messages.json +13 -0
  69. package/locales/tr-tr/tr-tr.messages.json +13 -0
  70. package/locales/zh-cn/zh-cn.messages.json +13 -0
  71. package/locales/zh-tw/zh-tw.messages.json +13 -0
  72. package/package.json +5 -1
  73. package/types/nanahoshi-mona-ui-auto-complete.d.ts +2 -0
  74. package/types/nanahoshi-mona-ui-button-group.d.ts +11 -0
  75. package/types/nanahoshi-mona-ui-check-box.d.ts +1 -0
  76. package/types/nanahoshi-mona-ui-color-gradient.d.ts +11 -0
  77. package/types/nanahoshi-mona-ui-color-palette.d.ts +11 -0
  78. package/types/nanahoshi-mona-ui-color-picker.d.ts +11 -0
  79. package/types/nanahoshi-mona-ui-combo-box.d.ts +2 -0
  80. package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -0
  81. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -0
  82. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +2 -0
  83. package/types/nanahoshi-mona-ui-form-field.d.ts +173 -0
  84. package/types/nanahoshi-mona-ui-i18n.d.ts +29 -0
  85. package/types/nanahoshi-mona-ui-internal.d.ts +39 -4
  86. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +13 -0
  87. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +13 -0
  88. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +13 -0
  89. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +13 -0
  90. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +13 -0
  91. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +13 -0
  92. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +13 -0
  93. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +13 -0
  94. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +13 -0
  95. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +13 -0
  96. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +13 -0
  97. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +13 -0
  98. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +13 -0
  99. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +13 -0
  100. package/types/nanahoshi-mona-ui-multi-select.d.ts +2 -0
  101. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -0
  102. package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
  103. package/types/nanahoshi-mona-ui-radio-button.d.ts +2 -0
  104. package/types/nanahoshi-mona-ui-rating.d.ts +1 -0
  105. package/types/nanahoshi-mona-ui-segmented.d.ts +11 -0
  106. package/types/nanahoshi-mona-ui-slider.d.ts +1 -0
  107. package/types/nanahoshi-mona-ui-switch.d.ts +11 -0
  108. package/types/nanahoshi-mona-ui-text-box.d.ts +1 -0
  109. package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -0
@@ -37,6 +37,7 @@ export declare class ComboBoxComponent<TData = unknown, TValue = TData> implemen
37
37
  protected readonly clearButtonVisible: import("@angular/core").Signal<boolean>;
38
38
  protected readonly comboBoxValue: import("@angular/core").WritableSignal<string>;
39
39
  protected readonly comboBoxValue$: Subject<string | null>;
40
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
40
41
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
41
42
  protected readonly expanded: import("@angular/core").Signal<boolean>;
42
43
  protected readonly footerTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
@@ -45,6 +46,7 @@ export declare class ComboBoxComponent<TData = unknown, TValue = TData> implemen
45
46
  protected readonly inputClass: import("@angular/core").Signal<string>;
46
47
  protected readonly invalidState: import("@angular/core").Signal<boolean>;
47
48
  protected readonly itemTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
49
+ protected readonly labelledBy: import("@angular/core").Signal<string | null>;
48
50
  protected readonly listId: string;
49
51
  protected readonly listPopupClass: import("@angular/core").Signal<string>;
50
52
  protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaComboBoxMessages>;
@@ -24,11 +24,13 @@ export declare class DatePickerComponent implements FormValueControl<Date | null
24
24
  #private;
25
25
  protected readonly baseClass: import("@angular/core").Signal<string>;
26
26
  protected readonly decadeCellTemplate: import("@angular/core").Signal<CalendarDecadeCellTemplateDirective | undefined>;
27
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
27
28
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
28
29
  protected readonly effectiveFormat: import("@angular/core").Signal<string>;
29
30
  protected readonly expanded: import("@angular/core").Signal<boolean>;
30
31
  protected readonly inputAttributes: import("@angular/core").Signal<AttributeConfig>;
31
32
  protected readonly invalidState: import("@angular/core").Signal<boolean>;
33
+ protected readonly labelledBy: import("@angular/core").Signal<string | null>;
32
34
  protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaDatePickerMessages>;
33
35
  protected readonly monthCellTemplate: import("@angular/core").Signal<CalendarMonthCellTemplateDirective | undefined>;
34
36
  protected readonly pickerPopupClass: import("@angular/core").Signal<string>;
@@ -18,6 +18,7 @@ export declare class DateTimePickerComponent implements FormValueControl<Date |
18
18
  protected readonly baseClass: import("@angular/core").Signal<string>;
19
19
  protected readonly dateTabId: string;
20
20
  protected readonly decadeCellTemplate: import("@angular/core").Signal<CalendarDecadeCellTemplateDirective | undefined>;
21
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
21
22
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
22
23
  protected readonly effectiveFormat: import("@angular/core").Signal<string>;
23
24
  protected readonly effectiveHourFormat: import("@angular/core").Signal<HourFormat>;
@@ -29,6 +30,7 @@ export declare class DateTimePickerComponent implements FormValueControl<Date |
29
30
  protected readonly inputAttributes: import("@angular/core").Signal<AttributeConfig>;
30
31
  protected readonly invalidState: import("@angular/core").Signal<boolean>;
31
32
  protected readonly isRtl: import("@angular/core").Signal<boolean>;
33
+ protected readonly labelledBy: import("@angular/core").Signal<string | null>;
32
34
  protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaDateTimePickerMessages>;
33
35
  protected readonly monthCellTemplate: import("@angular/core").Signal<CalendarMonthCellTemplateDirective | undefined>;
34
36
  protected readonly navigatedDate: import("@angular/core").WritableSignal<Date>;
@@ -35,6 +35,7 @@ export declare class DropdownListComponent<TData = unknown, TValue = TData> impl
35
35
  protected readonly affixClass: import("@angular/core").Signal<string>;
36
36
  protected readonly baseClass: import("@angular/core").Signal<string>;
37
37
  protected readonly clearButtonVisible: import("@angular/core").Signal<boolean>;
38
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
38
39
  protected readonly effectiveAriaLabel: import("@angular/core").Signal<string>;
39
40
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
40
41
  protected readonly expanded: import("@angular/core").Signal<boolean>;
@@ -44,6 +45,7 @@ export declare class DropdownListComponent<TData = unknown, TValue = TData> impl
44
45
  protected readonly invalidState: import("@angular/core").Signal<boolean>;
45
46
  protected readonly isEmpty: import("@angular/core").Signal<boolean>;
46
47
  protected readonly itemTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
48
+ protected readonly labelledBy: import("@angular/core").Signal<string | null>;
47
49
  protected readonly listId: string;
48
50
  protected readonly listPopupClass: import("@angular/core").Signal<string>;
49
51
  protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaDropdownListMessages>;
@@ -0,0 +1,173 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ElementRef, TemplateRef } from "@angular/core";
3
+ import { FormField, ValidationError } from "@angular/forms/signals";
4
+ /**
5
+ * The context of a `monaFormFieldErrorTemplate`, rendered once for each error the form field shows.
6
+ */
7
+ interface FormFieldErrorTemplateContext {
8
+ /** The message the form field would show: the validator's own, or the locale's message for the error's kind. */
9
+ readonly $implicit: string;
10
+ /** The validation error, or null for the text of the form field's `error` input. */
11
+ readonly error: ValidationError | null;
12
+ /** The same message as `$implicit`, for `let-message="message"`. */
13
+ readonly message: string;
14
+ }
15
+ /**
16
+ * Where a form field puts its label: above the control (`vertical`) or beside it (`horizontal`).
17
+ */
18
+ type FormFieldOrientation = "horizontal" | "vertical";
19
+ /**
20
+ * Puts a label, a hint and validation errors around one form control, and connects them to it.
21
+ */
22
+ export declare class FormFieldComponent {
23
+ #private;
24
+ protected readonly boundField: import("@angular/core").Signal<FormField<any> | undefined>;
25
+ protected readonly captionId: string;
26
+ protected readonly classes: import("@angular/core").Signal<string>;
27
+ protected readonly controlClasses: import("@angular/core").Signal<string>;
28
+ protected readonly controlRef: import("@angular/core").Signal<ElementRef<HTMLElement>>;
29
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
30
+ protected readonly errorClasses: import("@angular/core").Signal<string>;
31
+ protected readonly errorId: string;
32
+ protected readonly errorItemClasses: string;
33
+ protected readonly errorTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
34
+ protected readonly errors: import("@angular/core").Signal<readonly FormFieldErrorTemplateContext[]>;
35
+ protected readonly hintClasses: import("@angular/core").Signal<string>;
36
+ protected readonly hintId: string;
37
+ protected readonly hintShown: import("@angular/core").Signal<boolean>;
38
+ protected readonly hintTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
39
+ protected readonly labelClasses: import("@angular/core").Signal<string>;
40
+ protected readonly labelShown: import("@angular/core").Signal<boolean>;
41
+ protected readonly labelTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
42
+ protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaFormFieldMessages>;
43
+ protected readonly optionalClasses: string;
44
+ protected readonly requiredClasses: string;
45
+ protected readonly requiredShown: import("@angular/core").Signal<boolean>;
46
+ /**
47
+ * @description Text shown as an error, whether or not the control is touched, such as an error from a server. It
48
+ * comes before the errors of a bound signal form field. Set the control's own `invalid` and `touched` too, so it
49
+ * draws its error state.
50
+ * @default ""
51
+ */
52
+ readonly error: import("@angular/core").InputSignal<string>;
53
+ /**
54
+ * @description Help text shown below the control. It describes the control through `aria-describedby`. Ignored
55
+ * when `monaFormFieldHintTemplate` is provided.
56
+ * @default ""
57
+ */
58
+ readonly hint: import("@angular/core").InputSignal<string>;
59
+ /**
60
+ * @description The label shown above or beside the control. It names the control through `aria-labelledby`.
61
+ * Ignored when `monaFormFieldLabelTemplate` is provided.
62
+ * @default ""
63
+ */
64
+ readonly label: import("@angular/core").InputSignal<string>;
65
+ /**
66
+ * @description Whether to show optional-field text after the label.
67
+ * @default false
68
+ */
69
+ readonly optional: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
70
+ /**
71
+ * @description Text shown after the label when `optional` is set.
72
+ * @default the `formField.optional` message
73
+ */
74
+ readonly optionalText: import("@angular/core").InputSignal<string>;
75
+ /**
76
+ * @description Where the label goes: above the control, or beside it in a column set by the
77
+ * `--mona-form-field-label-width` custom property (10rem by default).
78
+ * @default "vertical"
79
+ */
80
+ readonly orientation: import("@angular/core").InputSignal<FormFieldOrientation>;
81
+ /**
82
+ * @description Shows the required marker after the label. A bound signal form field with a `required` rule shows it
83
+ * too. The marker is hidden from assistive technology, which reads the control's own required state.
84
+ * @default false
85
+ */
86
+ readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
87
+ /**
88
+ * @description Whether a required field shows its marker. Turn it off for a form that marks optional fields instead.
89
+ * @default true
90
+ */
91
+ readonly showRequiredMarker: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
92
+ /**
93
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
94
+ * @default ""
95
+ */
96
+ readonly userClass: import("@angular/core").InputSignal<string>;
97
+ constructor();
98
+ protected onLabelClick(event: MouseEvent): void;
99
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldComponent, never>;
100
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "mona-form-field", never, {
101
+ "error": {
102
+ "alias": "error";
103
+ "required": false;
104
+ "isSignal": true;
105
+ };
106
+ "hint": {
107
+ "alias": "hint";
108
+ "required": false;
109
+ "isSignal": true;
110
+ };
111
+ "label": {
112
+ "alias": "label";
113
+ "required": false;
114
+ "isSignal": true;
115
+ };
116
+ "optional": {
117
+ "alias": "optional";
118
+ "required": false;
119
+ "isSignal": true;
120
+ };
121
+ "optionalText": {
122
+ "alias": "optionalText";
123
+ "required": false;
124
+ "isSignal": true;
125
+ };
126
+ "orientation": {
127
+ "alias": "orientation";
128
+ "required": false;
129
+ "isSignal": true;
130
+ };
131
+ "required": {
132
+ "alias": "required";
133
+ "required": false;
134
+ "isSignal": true;
135
+ };
136
+ "showRequiredMarker": {
137
+ "alias": "showRequiredMarker";
138
+ "required": false;
139
+ "isSignal": true;
140
+ };
141
+ "userClass": {
142
+ "alias": "class";
143
+ "required": false;
144
+ "isSignal": true;
145
+ };
146
+ }, {}, ["boundField", "errorTemplate", "hintTemplate", "labelTemplate"], ["*"], true, never>;
147
+ }
148
+ /**
149
+ * Renders each error the form field shows, in place of its message. The context's `$implicit` is the message and
150
+ * `error` is the validation error, or null for the form field's `error` input.
151
+ */
152
+ export declare class FormFieldErrorTemplateDirective {
153
+ static ngTemplateContextGuard(_directive: FormFieldErrorTemplateDirective, _context: unknown): _context is FormFieldErrorTemplateContext;
154
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldErrorTemplateDirective, never>;
155
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FormFieldErrorTemplateDirective, "ng-template[monaFormFieldErrorTemplate]", never, {}, {}, never, never, true, never>;
156
+ }
157
+ /**
158
+ * Replaces the `hint` text with projected content, such as text with a link. It still describes the control. The
159
+ * template has no context variables.
160
+ */
161
+ export declare class FormFieldHintTemplateDirective {
162
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldHintTemplateDirective, never>;
163
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FormFieldHintTemplateDirective, "ng-template[monaFormFieldHintTemplate]", never, {}, {}, never, never, true, never>;
164
+ }
165
+ /**
166
+ * Replaces the `label` text with projected content. Its text names the control, so keep interactive elements out of
167
+ * it. The template has no context variables.
168
+ */
169
+ export declare class FormFieldLabelTemplateDirective {
170
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldLabelTemplateDirective, never>;
171
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FormFieldLabelTemplateDirective, "ng-template[monaFormFieldLabelTemplate]", never, {}, {}, never, never, true, never>;
172
+ }
173
+ export type { FormFieldErrorTemplateContext, FormFieldOrientation };
@@ -451,6 +451,34 @@ export interface MonaFilterMessages {
451
451
  readonly value: string;
452
452
  }
453
453
  export type FilterMessages = MonaFilterMessages;
454
+ /**
455
+ * The form field's optional marker and the error messages it shows for the built-in signal forms validators. A
456
+ * validator's own `message` wins over these.
457
+ */
458
+ export interface MonaFormFieldMessages {
459
+ /** For an `email` error. */
460
+ readonly email: string;
461
+ /** For an error of a kind without a message of its own, such as a custom validator's or a parse error. */
462
+ readonly invalid: string;
463
+ /** For a `max` error. */
464
+ max(max: number): string;
465
+ /** For a `maxDate` error, with the date formatted in the locale. */
466
+ maxDate(maxDate: string): string;
467
+ /** For a `maxLength` error. */
468
+ maxLength(maxLength: number): string;
469
+ /** For a `min` error. */
470
+ min(min: number): string;
471
+ /** For a `minDate` error, with the date formatted in the locale. */
472
+ minDate(minDate: string): string;
473
+ /** For a `minLength` error. */
474
+ minLength(minLength: number): string;
475
+ /** Shown after the label of a field marked `optional`. */
476
+ readonly optional: string;
477
+ /** For a `pattern` error. */
478
+ readonly pattern: string;
479
+ /** For a `required` error. */
480
+ readonly required: string;
481
+ }
454
482
  export interface MonaGridMessages {
455
483
  readonly all: string;
456
484
  readonly apply: string;
@@ -798,6 +826,7 @@ export interface MonaLocaleMessages {
798
826
  dropdowns: MonaDropdownsMessages;
799
827
  editor: MonaEditorMessages;
800
828
  filter: MonaFilterMessages;
829
+ formField: MonaFormFieldMessages;
801
830
  grid: MonaGridMessages;
802
831
  label: MonaLabelMessages;
803
832
  list: MonaListMessages;
@@ -1,6 +1,6 @@
1
1
  import { Action, Action as Action$1, AttributeConfig, AttributeConfig as AttributeConfig$1 } from "@nanahoshi/mona-ui/common";
2
2
  import * as i0 from "@angular/core";
3
- import { DestroyRef, ElementRef, InjectionToken, Signal } from "@angular/core";
3
+ import { DestroyRef, ElementRef, InjectionToken, Provider, Signal } from "@angular/core";
4
4
  import { ConnectionPositionPair, OverlayRef, ScrollStrategy } from "@angular/cdk/overlay";
5
5
  import { Observable } from "rxjs";
6
6
  export declare class AttributeBinderDirective {
@@ -119,28 +119,63 @@ export interface MonaLabelContext {
119
119
  readonly register: (control: MonaLabelledControl) => () => void;
120
120
  }
121
121
  /**
122
- * Provided by `mona-label` to the content it wraps.
122
+ * Provided by `mona-label` and `mona-form-field` to the content they wrap.
123
123
  */
124
- export declare const MONA_LABEL: InjectionToken<MonaLabelContext>;
124
+ export declare const MONA_LABEL: InjectionToken<MonaLabelContext | null>;
125
+ /**
126
+ * A control inside a `mona-form-field`.
127
+ */
128
+ export interface MonaFormFieldControl {
129
+ /** What a click on the caption does, when it isn't just focus. Null for a control that only takes focus. */
130
+ readonly activate: (() => void) | null;
131
+ readonly element: HTMLElement;
132
+ readonly focus: () => void;
133
+ }
134
+ export interface MonaFormFieldContext {
135
+ /** Ids of the form field's hint and error, space-separated, or null while it shows neither. */
136
+ readonly describedBy: Signal<string | null>;
137
+ /** Registers a control and returns the function that removes it. */
138
+ readonly register: (control: MonaFormFieldControl) => () => void;
139
+ }
140
+ /**
141
+ * Provided by `mona-form-field` to the content it wraps, next to {@link MONA_LABEL}.
142
+ */
143
+ export declare const MONA_FORM_FIELD: InjectionToken<MonaFormFieldContext | null>;
144
+ /**
145
+ * View providers for a control that renders other controls in its own view, such as the inputs of a color gradient or
146
+ * the filter of a dropdown's popup. A label or form field around the control names and describes the control itself;
147
+ * these stop it from reaching the parts inside, which have names of their own.
148
+ */
149
+ export declare const FIELD_ASSOCIATION_BOUNDARY: readonly Provider[];
125
150
  export interface LabelAssociationOptions {
126
151
  /**
127
152
  * What a click on the caption does for a wrapped control. Leave it out when the control has a native input, since
128
153
  * the browser already handles that click.
129
154
  */
130
155
  readonly activate?: () => void;
156
+ /** The control's own `aria-describedby`, which comes before a form field's hint and error. */
157
+ readonly ariaDescribedBy?: () => string | null | undefined;
131
158
  readonly ariaLabel: () => string | null | undefined;
132
159
  readonly ariaLabelledBy: () => string | null | undefined;
160
+ /** Moves focus to the control. A form field calls it on a click on its caption, unless `activate` is set. */
161
+ readonly focus: () => void;
133
162
  /** False for a control that renders its own `<label>`, whose text must stay its name. */
134
163
  readonly wrapped?: boolean;
135
164
  }
136
165
  export interface LabelAssociation {
166
+ /** The ids for `aria-describedby`: the control's own, then a form field's hint and error. */
167
+ readonly describedBy: Signal<string | null>;
137
168
  /** The id for `aria-labelledby`. An explicit `aria-labelledby` wins, and an explicit `aria-label` turns it off. */
138
169
  readonly labelledBy: Signal<string | null>;
139
170
  /** Called by a label that points at the control through `[for]`. */
140
171
  readonly setLabelledBy: (id: string | null) => void;
141
172
  }
142
173
  /**
143
- * Connects a control to a `mona-label` or `label[monaLabel]` that names it, by wrapping it or through `[for]`.
174
+ * Connects a control to a `mona-label` or `label[monaLabel]` that names it, by wrapping it or through `[for]`, and to a
175
+ * `mona-form-field` that names and describes it.
176
+ *
177
+ * The contexts are looked up from the parent element, past the control's own view providers, so a control that
178
+ * declares {@link FIELD_ASSOCIATION_BOUNDARY} still reaches the label around it.
144
179
  */
145
180
  export declare function injectLabelAssociation(options: LabelAssociationOptions): LabelAssociation;
146
181
  /**
@@ -296,6 +296,19 @@ export declare const MONA_AR_SA_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_DE_DE_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_ES_ES_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_FR_FR_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_ID_ID_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_IT_IT_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_JA_JP_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_KO_KR_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_PL_PL_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_PT_BR_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_RU_RU_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_TR_TR_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_ZH_CN_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;
@@ -296,6 +296,19 @@ export declare const MONA_ZH_TW_LOCALE: {
296
296
  startsWith: string;
297
297
  value: string;
298
298
  };
299
+ formField: {
300
+ email: string;
301
+ invalid: string;
302
+ max: (max: number) => string;
303
+ maxDate: (maxDate: string) => string;
304
+ maxLength: (maxLength: number) => string;
305
+ min: (min: number) => string;
306
+ minDate: (minDate: string) => string;
307
+ minLength: (minLength: number) => string;
308
+ optional: string;
309
+ pattern: string;
310
+ required: string;
311
+ };
299
312
  grid: {
300
313
  all: string;
301
314
  apply: string;