forty-cdk 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 (220) hide show
  1. package/accordion/README.md +122 -0
  2. package/aspect-ratio/README.md +76 -0
  3. package/avatar/README.md +100 -0
  4. package/breadcrumbs/README.md +49 -0
  5. package/breakpoints/README.md +81 -0
  6. package/button/README.md +49 -0
  7. package/calendar/README.md +458 -0
  8. package/carousel/README.md +358 -0
  9. package/checkbox/README.md +146 -0
  10. package/combobox/README.md +535 -0
  11. package/context-menu/README.md +139 -0
  12. package/date-field/README.md +184 -0
  13. package/date-picker/README.md +338 -0
  14. package/dialog/README.md +388 -0
  15. package/disclosure/README.md +114 -0
  16. package/drag-drop/README.md +359 -0
  17. package/drawer/README.md +560 -0
  18. package/dropdown-menu/README.md +176 -0
  19. package/fesm2022/forty-cdk-accordion.mjs +348 -0
  20. package/fesm2022/forty-cdk-accordion.mjs.map +1 -0
  21. package/fesm2022/forty-cdk-aspect-ratio.mjs +74 -0
  22. package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -0
  23. package/fesm2022/forty-cdk-avatar.mjs +308 -0
  24. package/fesm2022/forty-cdk-avatar.mjs.map +1 -0
  25. package/fesm2022/forty-cdk-breadcrumbs.mjs +125 -0
  26. package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -0
  27. package/fesm2022/forty-cdk-breakpoints.mjs +117 -0
  28. package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -0
  29. package/fesm2022/forty-cdk-button.mjs +134 -0
  30. package/fesm2022/forty-cdk-button.mjs.map +1 -0
  31. package/fesm2022/forty-cdk-calendar.mjs +2034 -0
  32. package/fesm2022/forty-cdk-calendar.mjs.map +1 -0
  33. package/fesm2022/forty-cdk-carousel.mjs +968 -0
  34. package/fesm2022/forty-cdk-carousel.mjs.map +1 -0
  35. package/fesm2022/forty-cdk-checkbox.mjs +226 -0
  36. package/fesm2022/forty-cdk-checkbox.mjs.map +1 -0
  37. package/fesm2022/forty-cdk-combobox.mjs +2596 -0
  38. package/fesm2022/forty-cdk-combobox.mjs.map +1 -0
  39. package/fesm2022/forty-cdk-context-menu.mjs +413 -0
  40. package/fesm2022/forty-cdk-context-menu.mjs.map +1 -0
  41. package/fesm2022/forty-cdk-core.mjs +9022 -0
  42. package/fesm2022/forty-cdk-core.mjs.map +1 -0
  43. package/fesm2022/forty-cdk-date-field.mjs +744 -0
  44. package/fesm2022/forty-cdk-date-field.mjs.map +1 -0
  45. package/fesm2022/forty-cdk-date-picker.mjs +1011 -0
  46. package/fesm2022/forty-cdk-date-picker.mjs.map +1 -0
  47. package/fesm2022/forty-cdk-dialog.mjs +707 -0
  48. package/fesm2022/forty-cdk-dialog.mjs.map +1 -0
  49. package/fesm2022/forty-cdk-disclosure.mjs +190 -0
  50. package/fesm2022/forty-cdk-disclosure.mjs.map +1 -0
  51. package/fesm2022/forty-cdk-drag-drop.mjs +1180 -0
  52. package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -0
  53. package/fesm2022/forty-cdk-drawer.mjs +1641 -0
  54. package/fesm2022/forty-cdk-drawer.mjs.map +1 -0
  55. package/fesm2022/forty-cdk-dropdown-menu.mjs +350 -0
  56. package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -0
  57. package/fesm2022/forty-cdk-field.mjs +425 -0
  58. package/fesm2022/forty-cdk-field.mjs.map +1 -0
  59. package/fesm2022/forty-cdk-fieldset.mjs +164 -0
  60. package/fesm2022/forty-cdk-fieldset.mjs.map +1 -0
  61. package/fesm2022/forty-cdk-file-upload.mjs +221 -0
  62. package/fesm2022/forty-cdk-file-upload.mjs.map +1 -0
  63. package/fesm2022/forty-cdk-hover-card.mjs +496 -0
  64. package/fesm2022/forty-cdk-hover-card.mjs.map +1 -0
  65. package/fesm2022/forty-cdk-input.mjs +274 -0
  66. package/fesm2022/forty-cdk-input.mjs.map +1 -0
  67. package/fesm2022/forty-cdk-internationalized-date.mjs +1 -1
  68. package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
  69. package/fesm2022/forty-cdk-listbox.mjs +1279 -0
  70. package/fesm2022/forty-cdk-listbox.mjs.map +1 -0
  71. package/fesm2022/forty-cdk-menu.mjs +1439 -0
  72. package/fesm2022/forty-cdk-menu.mjs.map +1 -0
  73. package/fesm2022/forty-cdk-menubar.mjs +787 -0
  74. package/fesm2022/forty-cdk-menubar.mjs.map +1 -0
  75. package/fesm2022/forty-cdk-meter.mjs +211 -0
  76. package/fesm2022/forty-cdk-meter.mjs.map +1 -0
  77. package/fesm2022/forty-cdk-navigation-menu.mjs +1145 -0
  78. package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -0
  79. package/fesm2022/forty-cdk-number-input.mjs +559 -0
  80. package/fesm2022/forty-cdk-number-input.mjs.map +1 -0
  81. package/fesm2022/forty-cdk-otp-input.mjs +527 -0
  82. package/fesm2022/forty-cdk-otp-input.mjs.map +1 -0
  83. package/fesm2022/forty-cdk-pagination.mjs +323 -0
  84. package/fesm2022/forty-cdk-pagination.mjs.map +1 -0
  85. package/fesm2022/forty-cdk-pane-resizer.mjs +297 -0
  86. package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -0
  87. package/fesm2022/forty-cdk-popover.mjs +698 -0
  88. package/fesm2022/forty-cdk-popover.mjs.map +1 -0
  89. package/fesm2022/forty-cdk-progress.mjs +226 -0
  90. package/fesm2022/forty-cdk-progress.mjs.map +1 -0
  91. package/fesm2022/forty-cdk-radio-group.mjs +378 -0
  92. package/fesm2022/forty-cdk-radio-group.mjs.map +1 -0
  93. package/fesm2022/forty-cdk-scroll-area.mjs +640 -0
  94. package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -0
  95. package/fesm2022/forty-cdk-search.mjs +205 -0
  96. package/fesm2022/forty-cdk-search.mjs.map +1 -0
  97. package/fesm2022/forty-cdk-select.mjs +1661 -0
  98. package/fesm2022/forty-cdk-select.mjs.map +1 -0
  99. package/fesm2022/forty-cdk-separator.mjs +82 -0
  100. package/fesm2022/forty-cdk-separator.mjs.map +1 -0
  101. package/fesm2022/forty-cdk-signal-forms.mjs +97 -0
  102. package/fesm2022/forty-cdk-signal-forms.mjs.map +1 -0
  103. package/fesm2022/forty-cdk-slider.mjs +803 -0
  104. package/fesm2022/forty-cdk-slider.mjs.map +1 -0
  105. package/fesm2022/forty-cdk-stepper.mjs +886 -0
  106. package/fesm2022/forty-cdk-stepper.mjs.map +1 -0
  107. package/fesm2022/forty-cdk-switch.mjs +137 -0
  108. package/fesm2022/forty-cdk-switch.mjs.map +1 -0
  109. package/fesm2022/forty-cdk-table.mjs +1518 -0
  110. package/fesm2022/forty-cdk-table.mjs.map +1 -0
  111. package/fesm2022/forty-cdk-tabs.mjs +400 -0
  112. package/fesm2022/forty-cdk-tabs.mjs.map +1 -0
  113. package/fesm2022/forty-cdk-time-field.mjs +593 -0
  114. package/fesm2022/forty-cdk-time-field.mjs.map +1 -0
  115. package/fesm2022/forty-cdk-time-picker.mjs +1013 -0
  116. package/fesm2022/forty-cdk-time-picker.mjs.map +1 -0
  117. package/fesm2022/forty-cdk-toast.mjs +1153 -0
  118. package/fesm2022/forty-cdk-toast.mjs.map +1 -0
  119. package/fesm2022/forty-cdk-toggle.mjs +516 -0
  120. package/fesm2022/forty-cdk-toggle.mjs.map +1 -0
  121. package/fesm2022/forty-cdk-toolbar.mjs +374 -0
  122. package/fesm2022/forty-cdk-toolbar.mjs.map +1 -0
  123. package/fesm2022/forty-cdk-tooltip.mjs +672 -0
  124. package/fesm2022/forty-cdk-tooltip.mjs.map +1 -0
  125. package/fesm2022/forty-cdk-tree.mjs +2007 -0
  126. package/fesm2022/forty-cdk-tree.mjs.map +1 -0
  127. package/fesm2022/forty-cdk-virtualization.mjs +1 -1
  128. package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
  129. package/fesm2022/forty-cdk.mjs +0 -43310
  130. package/fesm2022/forty-cdk.mjs.map +1 -1
  131. package/field/README.md +97 -0
  132. package/fieldset/README.md +86 -0
  133. package/file-upload/README.md +73 -0
  134. package/hover-card/README.md +171 -0
  135. package/input/README.md +156 -0
  136. package/listbox/README.md +424 -0
  137. package/menu/README.md +181 -0
  138. package/menubar/README.md +140 -0
  139. package/meter/README.md +128 -0
  140. package/navigation-menu/README.md +253 -0
  141. package/number-input/README.md +171 -0
  142. package/otp-input/README.md +198 -0
  143. package/package.json +213 -1
  144. package/pagination/README.md +61 -0
  145. package/pane-resizer/README.md +136 -0
  146. package/popover/README.md +262 -0
  147. package/progress/README.md +115 -0
  148. package/radio-group/README.md +129 -0
  149. package/scroll-area/README.md +184 -0
  150. package/search/README.md +42 -0
  151. package/select/README.md +488 -0
  152. package/separator/README.md +84 -0
  153. package/signal-forms/README.md +72 -0
  154. package/slider/README.md +152 -0
  155. package/stepper/README.md +292 -0
  156. package/switch/README.md +116 -0
  157. package/table/README.md +769 -0
  158. package/tabs/README.md +130 -0
  159. package/time-field/README.md +157 -0
  160. package/time-picker/README.md +172 -0
  161. package/toast/README.md +398 -0
  162. package/toggle/README.md +224 -0
  163. package/toolbar/README.md +109 -0
  164. package/tooltip/README.md +274 -0
  165. package/tree/README.md +708 -0
  166. package/types/forty-cdk-accordion.d.ts +242 -0
  167. package/types/forty-cdk-aspect-ratio.d.ts +59 -0
  168. package/types/forty-cdk-avatar.d.ts +133 -0
  169. package/types/forty-cdk-breadcrumbs.d.ts +92 -0
  170. package/types/forty-cdk-breakpoints.d.ts +141 -0
  171. package/types/forty-cdk-button.d.ts +80 -0
  172. package/types/forty-cdk-calendar.d.ts +914 -0
  173. package/types/forty-cdk-carousel.d.ts +530 -0
  174. package/types/forty-cdk-checkbox.d.ts +141 -0
  175. package/types/forty-cdk-combobox.d.ts +1259 -0
  176. package/types/forty-cdk-context-menu.d.ts +313 -0
  177. package/types/forty-cdk-core.d.ts +5774 -0
  178. package/types/forty-cdk-date-field.d.ts +307 -0
  179. package/types/forty-cdk-date-picker.d.ts +622 -0
  180. package/types/forty-cdk-dialog.d.ts +546 -0
  181. package/types/forty-cdk-disclosure.d.ts +127 -0
  182. package/types/forty-cdk-drag-drop.d.ts +456 -0
  183. package/types/forty-cdk-drawer.d.ts +871 -0
  184. package/types/forty-cdk-dropdown-menu.d.ts +242 -0
  185. package/types/forty-cdk-field.d.ts +236 -0
  186. package/types/forty-cdk-fieldset.d.ts +119 -0
  187. package/types/forty-cdk-file-upload.d.ts +124 -0
  188. package/types/forty-cdk-hover-card.d.ts +320 -0
  189. package/types/forty-cdk-input.d.ts +169 -0
  190. package/types/forty-cdk-internationalized-date.d.ts +1 -1
  191. package/types/forty-cdk-listbox.d.ts +513 -0
  192. package/types/forty-cdk-menu.d.ts +629 -0
  193. package/types/forty-cdk-menubar.d.ts +451 -0
  194. package/types/forty-cdk-meter.d.ts +122 -0
  195. package/types/forty-cdk-navigation-menu.d.ts +514 -0
  196. package/types/forty-cdk-number-input.d.ts +319 -0
  197. package/types/forty-cdk-otp-input.d.ts +248 -0
  198. package/types/forty-cdk-pagination.d.ts +214 -0
  199. package/types/forty-cdk-pane-resizer.d.ts +145 -0
  200. package/types/forty-cdk-popover.d.ts +509 -0
  201. package/types/forty-cdk-progress.d.ts +143 -0
  202. package/types/forty-cdk-radio-group.d.ts +222 -0
  203. package/types/forty-cdk-scroll-area.d.ts +258 -0
  204. package/types/forty-cdk-search.d.ts +142 -0
  205. package/types/forty-cdk-select.d.ts +899 -0
  206. package/types/forty-cdk-separator.d.ts +59 -0
  207. package/types/forty-cdk-signal-forms.d.ts +58 -0
  208. package/types/forty-cdk-slider.d.ts +379 -0
  209. package/types/forty-cdk-stepper.d.ts +650 -0
  210. package/types/forty-cdk-switch.d.ts +87 -0
  211. package/types/forty-cdk-table.d.ts +723 -0
  212. package/types/forty-cdk-tabs.d.ts +235 -0
  213. package/types/forty-cdk-time-field.d.ts +307 -0
  214. package/types/forty-cdk-time-picker.d.ts +578 -0
  215. package/types/forty-cdk-toast.d.ts +598 -0
  216. package/types/forty-cdk-toggle.d.ts +310 -0
  217. package/types/forty-cdk-toolbar.d.ts +217 -0
  218. package/types/forty-cdk-tooltip.d.ts +436 -0
  219. package/types/forty-cdk-tree.d.ts +688 -0
  220. package/types/forty-cdk.d.ts +1 -19743
@@ -0,0 +1,310 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, ModelSignal, Signal, Provider } from '@angular/core';
3
+ import { FormCheckboxControl, FormValueControl } from '@angular/forms/signals';
4
+ import { FormUiControlBase, WritingDirection, RovingTabindex, ListNavigationAction, CollectionHandle } from 'forty-cdk/core';
5
+ import * as forty_cdk_toggle from 'forty-cdk/toggle';
6
+
7
+ /**
8
+ * Headless implementation of the [WAI-ARIA Toggle Button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/) —
9
+ * a single-purpose `<button>` whose pressed state is reflected via
10
+ * `aria-pressed`. Implements Angular's `FormCheckboxControl` from
11
+ * `@angular/forms/signals` so a single toggle auto-wires with `[formField]`
12
+ * (bold / italic, mute, favourite — the common `aria-pressed` form inputs).
13
+ *
14
+ * Apply on a native `<button>` so Enter / Space and disabled handling come
15
+ * from the platform. The directive toggles its state on click and reflects
16
+ * ARIA + `data-state` for styling.
17
+ *
18
+ * For a set of toggles with arrow-key navigation and single / multiple
19
+ * selection semantics, use `[forToggleGroup]` + `[forToggleGroupItem]`.
20
+ *
21
+ * @example
22
+ * ```html
23
+ * <button forToggle [(checked)]="bold">B</button>
24
+ *
25
+ * <!-- With Signal Forms: -->
26
+ * <button forToggle [formField]="prefs.bold">B</button>
27
+ * ```
28
+ */
29
+ declare class ForToggle extends FormUiControlBase implements FormCheckboxControl {
30
+ /**
31
+ * Two-way bindable on/off state. Required by `FormCheckboxControl`, so the
32
+ * toggle auto-wires with `[formField]`; the host reflects it through
33
+ * `aria-pressed` and `data-state` (still a toggle button — only the value's
34
+ * name is `checked`). The `model()` change emitter (`(checkedChange)`) fires
35
+ * only on internal transitions (user click), never on consumer writes via
36
+ * `[(checked)]`.
37
+ */
38
+ readonly checked: _angular_core.ModelSignal<boolean>;
39
+ constructor();
40
+ protected onClick(): void;
41
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForToggle, never>;
42
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForToggle, "[forToggle]", ["forToggle"], { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; }, never, never, true, never>;
43
+ }
44
+
45
+ /**
46
+ * Per-item handle stored in the group's `Collection`. The directive
47
+ * registers itself on construction so the group can compute selection,
48
+ * roving tabindex, and arrow-key navigation in DOM order.
49
+ */
50
+ interface ForToggleGroupItemHandle extends CollectionHandle {
51
+ readonly value: Signal<string>;
52
+ readonly disabled: Signal<boolean>;
53
+ }
54
+ /**
55
+ * Coordination contract owned by `ForToggleGroup`. Items read selection
56
+ * and navigation policy from here and call back through `toggle` and
57
+ * `navigate` to drive state changes.
58
+ */
59
+ interface ForToggleGroupContext {
60
+ readonly value: ModelSignal<readonly string[]>;
61
+ readonly multiple: Signal<boolean>;
62
+ /**
63
+ * The group's effective disabled — its own `disabled` input OR'd with a
64
+ * surrounding disabled `[forFieldset]`. Each item ORs this into its own
65
+ * `effectiveDisabled`, so a disabled group (or fieldset) disables every item.
66
+ */
67
+ readonly effectiveDisabled: Signal<boolean>;
68
+ readonly orientation: Signal<'horizontal' | 'vertical'>;
69
+ readonly dir: Signal<WritingDirection>;
70
+ readonly loop: Signal<boolean>;
71
+ /**
72
+ * Roving-tabindex tracker. Items call `setActive` on `(focus)` and prefer
73
+ * `active()` in their tabindex computed so the tab stop follows the last
74
+ * focused item (APG re-entry), matching Tabs / Tree.
75
+ */
76
+ readonly roving: RovingTabindex;
77
+ isSelected(value: string): boolean;
78
+ toggle(value: string): void;
79
+ navigate(currentItem: HTMLElement, action: ListNavigationAction): void;
80
+ isFirstFocusableItem(el: HTMLElement): boolean;
81
+ registerItem(handle: ForToggleGroupItemHandle): void;
82
+ unregisterItem(handle: ForToggleGroupItemHandle): void;
83
+ }
84
+ declare const FOR_TOGGLE_GROUP_CONTEXT: InjectionToken<ForToggleGroupContext>;
85
+
86
+ /**
87
+ * Headless group of toggle buttons: a `role="group"` container whose items
88
+ * each carry `aria-pressed`, modelled on the
89
+ * [WAI-ARIA Button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/)
90
+ * (toggle-button variant). Owns the
91
+ * selected-values set, navigation policy, and the registry of
92
+ * `[forToggleGroupItem]` children. Implements
93
+ * `FormValueControl<readonly string[]>` from `@angular/forms/signals` for
94
+ * `[formField]` auto-wiring. (The Toolbar pattern applies only when a group is
95
+ * nested inside `[forToolbar]`; see the composition note on
96
+ * `ForToggleGroupItem`.)
97
+ *
98
+ * Two selection modes:
99
+ * - multiple (`multiple=true`): clicking an item flips its presence in
100
+ * `value`. Matches a "formatting toolbar" (Bold, Italic, Underline).
101
+ * - single (`multiple=false`, default): clicking selects exclusively;
102
+ * clicking an already-selected item de-selects it (you can land on `[]`).
103
+ * Matches an "alignment toolbar" (Left, Center, Right) where users may
104
+ * want to clear the choice.
105
+ *
106
+ * `value` is always `readonly string[]` so consumers can flip `multiple`
107
+ * without re-typing their state. In single mode the array carries 0 or
108
+ * 1 entries.
109
+ *
110
+ * Roving tabindex: only one item is in the Tab sequence at a time. With
111
+ * a non-empty selection, the first selected item; otherwise the first
112
+ * enabled item in DOM order. Arrow keys move focus (no
113
+ * selection-on-focus — toggles always require an explicit click).
114
+ *
115
+ * `ForToggle` (the standalone single-button toggle) is also a form
116
+ * control, but a `FormCheckboxControl` carrying a single boolean value.
117
+ * Use `ForToggleGroup` (in single or multiple mode) when you need a set
118
+ * of pressed values as the form value.
119
+ */
120
+ declare class ForToggleGroup extends FormUiControlBase implements FormValueControl<readonly string[]>, ForToggleGroupContext {
121
+ #private;
122
+ /**
123
+ * Two-way bindable. The currently pressed values, in arbitrary order.
124
+ * In single mode the array holds 0 or 1 entries. The `model()` change
125
+ * emitter (`(valueChange)`) fires only on internal transitions (item
126
+ * click), never on consumer writes via `[(value)]`. Required by
127
+ * `FormValueControl<readonly string[]>`.
128
+ */
129
+ readonly value: _angular_core.ModelSignal<readonly string[]>;
130
+ /**
131
+ * When false (default), only one item can be pressed at a time. Clicking
132
+ * an already-pressed item clears the selection. When true, clicks toggle
133
+ * each item independently.
134
+ */
135
+ readonly multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
136
+ /** Layout direction for keyboard navigation. */
137
+ readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
138
+ /**
139
+ * Reading direction. RTL swaps ArrowLeft/ArrowRight. When unset (default
140
+ * `null`), the inherited ambient direction is resolved from the nearest
141
+ * ancestor carrying a `dir` attribute (or `<html dir>`), defaulting to
142
+ * `'ltr'`. An explicit `[dir]` always wins and the resolved value is
143
+ * reflected to the host `dir` attribute.
144
+ */
145
+ readonly _dirInput: _angular_core.InputSignal<WritingDirection | null>;
146
+ readonly dir: _angular_core.Signal<WritingDirection>;
147
+ /**
148
+ * When true (default), arrow nav wraps at the ends. The default is read
149
+ * from `provideForToggleDefaults` for the surrounding scope.
150
+ */
151
+ readonly loop: _angular_core.InputSignalWithTransform<boolean, unknown>;
152
+ /**
153
+ * Roving-tabindex tracker. Items promote themselves to active on `(focus)`
154
+ * and read `active()` in their tabindex computed, so re-entry (Shift+Tab
155
+ * back into the group) restores the last focused item — matching Tabs /
156
+ * Tree. Before any focus, `active()` is `null` and the tabindex falls back
157
+ * to the first-selected / first-enabled entry point.
158
+ */
159
+ readonly roving: RovingTabindex;
160
+ constructor();
161
+ isSelected(v: string): boolean;
162
+ toggle(v: string): void;
163
+ navigate(currentItem: HTMLElement, action: ListNavigationAction): void;
164
+ /**
165
+ * Tabindex policy: with at least one selection, the first selected item
166
+ * is the entry point; otherwise the first enabled item in DOM order.
167
+ */
168
+ isFirstFocusableItem(el: HTMLElement): boolean;
169
+ registerItem(handle: ForToggleGroupItemHandle): void;
170
+ unregisterItem(handle: ForToggleGroupItemHandle): void;
171
+ protected onFocusOut(event: FocusEvent): void;
172
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForToggleGroup, never>;
173
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForToggleGroup, "[forToggleGroup]", ["forToggleGroup"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "_dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
174
+ }
175
+
176
+ /**
177
+ * One toggle button inside a `[forToggleGroup]`. Apply on a `<button>`.
178
+ *
179
+ * Pressed state is derived from the group's `value`. Click goes through
180
+ * `group.toggle(value())` so single-vs-multiple semantics live in the
181
+ * group, not the item.
182
+ *
183
+ * Roving tabindex: only one item is in the Tab sequence at a time
184
+ * (the first selected, or the first enabled when nothing is pressed).
185
+ * Arrow keys move focus inside the group; the consumer never has to
186
+ * wire keyboard navigation manually.
187
+ *
188
+ * **Composition with [forToolbar]:** when the group is nested inside a
189
+ * `[forToolbar]`, focus management is delegated to the toolbar — the
190
+ * tabindex policy and arrow-key navigation flow across all toolbar items
191
+ * (buttons, links, toggle items) instead of staying confined to the
192
+ * group. Selection still lives on the group; only focus is shared.
193
+ */
194
+ declare class ForToggleGroupItem {
195
+ #private;
196
+ protected readonly group: forty_cdk_toggle.ForToggleGroupContext;
197
+ /** Identifier added to / removed from the group's `value`. Required. */
198
+ readonly value: _angular_core.InputSignal<string>;
199
+ /** Per-item disabled (in addition to the group's `disabled`). */
200
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
201
+ readonly pressed: _angular_core.Signal<boolean>;
202
+ readonly effectiveDisabled: _angular_core.Signal<boolean>;
203
+ /**
204
+ * Tabindex per APG: once any item has been focused, the roving tracker owns
205
+ * the tab stop so re-entry restores the last focused item; before that, fall
206
+ * back to the entry point (first selected / first enabled). The roving host
207
+ * is the toolbar when nested inside one, otherwise the group. Disabled items
208
+ * are always -1.
209
+ */
210
+ readonly tabindex: _angular_core.Signal<0 | -1>;
211
+ constructor();
212
+ protected onClick(): void;
213
+ protected onFocus(): void;
214
+ protected onKeyDown(event: KeyboardEvent): void;
215
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForToggleGroupItem, never>;
216
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForToggleGroupItem, "[forToggleGroupItem]", ["forToggleGroupItem"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
217
+ }
218
+
219
+ /**
220
+ * Defaults inherited by descendant toggle groups in the surrounding injector
221
+ * scope. Configure with `provideForToggleDefaults` either at the application
222
+ * root or in any component's `providers` array; partial overrides merge with
223
+ * the parent scope.
224
+ */
225
+ interface ForToggleDefaults {
226
+ /**
227
+ * Whether arrow navigation wraps around past the first / last enabled
228
+ * toggle-group item. Mirrors `ForRadioGroup`'s `loop` default.
229
+ */
230
+ loop: boolean;
231
+ }
232
+ /** Token holding the resolved toggle defaults for the current scope. */
233
+ declare const FOR_TOGGLE_DEFAULTS: _angular_core.InjectionToken<ForToggleDefaults>;
234
+ /**
235
+ * Configures forty-cdk toggle defaults for this injector scope. Partial
236
+ * overrides inherit unspecified keys from the parent scope (or library
237
+ * defaults at the root).
238
+ */
239
+ declare function provideForToggleDefaults(defaults?: Partial<ForToggleDefaults>): Provider[];
240
+
241
+ /**
242
+ * Exact public names of every `ForToggle` input, its models included. Spread it into the
243
+ * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the
244
+ * primitive's full surface — the Signal Forms members `[formField]` binds among them —
245
+ * without hand-maintaining the list. Always spread into an inline object literal as shown
246
+ * below: the literal is what keeps the entry statically analyzable for consumers compiling
247
+ * against the published package. An anti-drift spec fails when this list no longer matches
248
+ * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported
249
+ * wrapping patterns.
250
+ *
251
+ * @example
252
+ * ```ts
253
+ * @Component({
254
+ * selector: 'button[myToggle]',
255
+ * template: '',
256
+ * hostDirectives: [
257
+ * {
258
+ * directive: ForToggle,
259
+ * inputs: [...FOR_TOGGLE_HOST_DIRECTIVE_INPUTS],
260
+ * outputs: [...FOR_TOGGLE_HOST_DIRECTIVE_OUTPUTS],
261
+ * },
262
+ * ],
263
+ * })
264
+ * export class MyToggle {}
265
+ * ```
266
+ */
267
+ declare const FOR_TOGGLE_HOST_DIRECTIVE_INPUTS: readonly ["checked", "dirty", "disabled", "errors", "invalid", "name", "pending", "readonly", "required", "touched"];
268
+ /**
269
+ * Exact public names of every `ForToggle` output, the Signal Forms `touch` output
270
+ * included. Spread it into the `outputs` array of the same `hostDirectives` entry as
271
+ * {@link FOR_TOGGLE_HOST_DIRECTIVE_INPUTS}.
272
+ */
273
+ declare const FOR_TOGGLE_HOST_DIRECTIVE_OUTPUTS: readonly ["checkedChange", "touchedChange", "touch"];
274
+
275
+ /**
276
+ * Exact public names of every `ForToggleGroup` input, its models included. Spread it into the
277
+ * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the
278
+ * primitive's full surface — the Signal Forms members `[formField]` binds among them —
279
+ * without hand-maintaining the list. Always spread into an inline object literal as shown
280
+ * below: the literal is what keeps the entry statically analyzable for consumers compiling
281
+ * against the published package. An anti-drift spec fails when this list no longer matches
282
+ * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported
283
+ * wrapping patterns.
284
+ *
285
+ * @example
286
+ * ```ts
287
+ * @Component({
288
+ * selector: 'div[myToggleGroup]',
289
+ * template: '',
290
+ * hostDirectives: [
291
+ * {
292
+ * directive: ForToggleGroup,
293
+ * inputs: [...FOR_TOGGLE_GROUP_HOST_DIRECTIVE_INPUTS],
294
+ * outputs: [...FOR_TOGGLE_GROUP_HOST_DIRECTIVE_OUTPUTS],
295
+ * },
296
+ * ],
297
+ * })
298
+ * export class MyToggleGroup {}
299
+ * ```
300
+ */
301
+ declare const FOR_TOGGLE_GROUP_HOST_DIRECTIVE_INPUTS: readonly ["value", "dir", "dirty", "disabled", "errors", "invalid", "loop", "multiple", "name", "orientation", "pending", "readonly", "required", "touched"];
302
+ /**
303
+ * Exact public names of every `ForToggleGroup` output, the Signal Forms `touch` output
304
+ * included. Spread it into the `outputs` array of the same `hostDirectives` entry as
305
+ * {@link FOR_TOGGLE_GROUP_HOST_DIRECTIVE_INPUTS}.
306
+ */
307
+ declare const FOR_TOGGLE_GROUP_HOST_DIRECTIVE_OUTPUTS: readonly ["valueChange", "touchedChange", "touch"];
308
+
309
+ export { FOR_TOGGLE_DEFAULTS, FOR_TOGGLE_GROUP_CONTEXT, FOR_TOGGLE_GROUP_HOST_DIRECTIVE_INPUTS, FOR_TOGGLE_GROUP_HOST_DIRECTIVE_OUTPUTS, FOR_TOGGLE_HOST_DIRECTIVE_INPUTS, FOR_TOGGLE_HOST_DIRECTIVE_OUTPUTS, ForToggle, ForToggleGroup, ForToggleGroupItem, provideForToggleDefaults };
310
+ export type { ForToggleDefaults, ForToggleGroupContext, ForToggleGroupItemHandle };
@@ -0,0 +1,217 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, Signal, Provider } from '@angular/core';
3
+ import { HostRovingContext, HostRovingItemHandle, WritingDirection, RovingTabindex, ListNavigationAction } from 'forty-cdk/core';
4
+ import * as forty_cdk_toolbar from 'forty-cdk/toolbar';
5
+
6
+ /**
7
+ * Per-item handle stored in the toolbar's `Collection`. Buttons, links, and
8
+ * toggle-group items (when nested) register themselves on construction so the
9
+ * toolbar can run roving-tabindex and arrow-key navigation in DOM order.
10
+ *
11
+ * Extends the lifted `HostRovingItemHandle` so any `_internal/` consumer
12
+ * that registers against the toolbar via `FOR_HOST_ROVING_CONTEXT` works
13
+ * without a toolbar-specific handle type.
14
+ */
15
+ type ForToolbarItemHandle = HostRovingItemHandle;
16
+ /**
17
+ * Coordination contract owned by `ForToolbar`.
18
+ *
19
+ * Extends the neutral `HostRovingContext` (the lifted "host owns roving
20
+ * navigation for embedded items" contract in `_internal/`) plus
21
+ * toolbar-specific extras (`loop`). Toolbar provides both
22
+ * `FOR_TOOLBAR_CONTEXT` and `FOR_HOST_ROVING_CONTEXT` from the same
23
+ * instance via `useExisting`, so any neutral consumer (e.g.
24
+ * `ForToggleGroupItem`) and any toolbar-specific consumer pull the same
25
+ * object without taking a cross-primitive import.
26
+ */
27
+ interface ForToolbarContext extends HostRovingContext {
28
+ readonly loop: Signal<boolean>;
29
+ }
30
+ declare const FOR_TOOLBAR_CONTEXT: InjectionToken<ForToolbarContext>;
31
+
32
+ /**
33
+ * Headless implementation of the
34
+ * [WAI-ARIA Toolbar pattern](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/).
35
+ *
36
+ * Hosts buttons, links, separators, and (optionally) a `[forToggleGroup]`
37
+ * for grouped toggles. Manages roving tabindex across all interactive
38
+ * children so the toolbar takes a single Tab stop and arrow keys move
39
+ * focus inside.
40
+ *
41
+ * Composition with `ForToggleGroup` is automatic: items inside a
42
+ * `[forToggleGroup]` whose ancestor is `[forToolbar]` register with the
43
+ * toolbar's roving and use its keyboard navigation, so arrow keys move
44
+ * fluidly across the whole bar.
45
+ *
46
+ * @example
47
+ * ```html
48
+ * <div forToolbar aria-label="Formatting">
49
+ * <button forToolbarButton>Undo</button>
50
+ * <button forToolbarButton>Redo</button>
51
+ * <span forToolbarSeparator></span>
52
+ * <div forToggleGroup multiple>
53
+ * <button forToggleGroupItem value="bold">B</button>
54
+ * <button forToggleGroupItem value="italic">I</button>
55
+ * </div>
56
+ * <span forToolbarSeparator></span>
57
+ * <a forToolbarLink href="/help">Help</a>
58
+ * </div>
59
+ * ```
60
+ */
61
+ declare class ForToolbar implements ForToolbarContext {
62
+ #private;
63
+ /**
64
+ * Manual `aria-label` for the toolbar. Use this when no visible label element
65
+ * exists; otherwise prefer pointing `aria-labelledby` at one. A `null`
66
+ * (default) or empty value emits no attribute. Matches the uniform labelling
67
+ * input on `ForListbox` / `ForMenubar`.
68
+ */
69
+ readonly ariaLabel: _angular_core.InputSignal<string | null>;
70
+ readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
71
+ /**
72
+ * Writing direction. When unset (default `null`), the inherited ambient
73
+ * direction is resolved from the nearest ancestor carrying a `dir` attribute
74
+ * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.
75
+ * The resolved value is reflected to the host `dir` attribute and swaps
76
+ * ArrowLeft / ArrowRight semantics in RTL.
77
+ */
78
+ readonly _dirInput: _angular_core.InputSignal<WritingDirection | null>;
79
+ readonly dir: _angular_core.Signal<WritingDirection>;
80
+ /**
81
+ * Whether arrow navigation wraps around past the first / last enabled
82
+ * item. Default `true`. The default is read from `provideForToolbarDefaults`
83
+ * for the surrounding scope.
84
+ */
85
+ readonly loop: _angular_core.InputSignalWithTransform<boolean, unknown>;
86
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
87
+ /**
88
+ * Roving-tabindex tracker shared by every toolbar item (buttons, links, and
89
+ * nested toggle-group items). Items promote themselves to active on
90
+ * `(focus)` and read `active()` in their tabindex computed, so re-entry
91
+ * (Shift+Tab back into the toolbar) restores the last focused item —
92
+ * matching Tabs / Tree. Before any focus, `active()` is `null` and the
93
+ * tabindex falls back to the first-enabled entry point.
94
+ */
95
+ readonly roving: RovingTabindex;
96
+ constructor();
97
+ navigate(currentItem: HTMLElement, action: ListNavigationAction): void;
98
+ isFirstFocusableItem(el: HTMLElement): boolean;
99
+ registerItem(handle: ForToolbarItemHandle): void;
100
+ unregisterItem(handle: ForToolbarItemHandle): void;
101
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForToolbar, never>;
102
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForToolbar, "[forToolbar]", ["forToolbar"], { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "_dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
103
+ }
104
+
105
+ /**
106
+ * Plain push button inside `[forToolbar]`. Apply on `<button>` so Enter /
107
+ * Space activate via native semantics. The directive forces `type="button"`
108
+ * to avoid accidental form submission inside a `<form>`.
109
+ */
110
+ declare class ForToolbarButton {
111
+ #private;
112
+ protected readonly toolbar: forty_cdk_toolbar.ForToolbarContext | null;
113
+ /** Per-item disabled (in addition to the toolbar's `disabled`). */
114
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
115
+ readonly effectiveDisabled: _angular_core.Signal<boolean>;
116
+ /**
117
+ * Tabindex per APG: once any toolbar item has been focused, the roving
118
+ * tracker owns the tab stop so re-entry restores the last focused item;
119
+ * before that, fall back to the first-enabled entry point. Disabled items
120
+ * are always -1; a button used outside a toolbar keeps its natural 0.
121
+ */
122
+ readonly tabindex: _angular_core.Signal<0 | -1>;
123
+ constructor();
124
+ protected onFocus(): void;
125
+ protected onKeyDown(event: KeyboardEvent): void;
126
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForToolbarButton, never>;
127
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForToolbarButton, "[forToolbarButton]", ["forToolbarButton"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
128
+ }
129
+
130
+ /**
131
+ * Hyperlink inside `[forToolbar]`. Apply on `<a>`. Honors the toolbar's
132
+ * roving tabindex and arrow-key navigation; `Enter` follows the link via
133
+ * native semantics.
134
+ */
135
+ declare class ForToolbarLink {
136
+ #private;
137
+ protected readonly toolbar: forty_cdk_toolbar.ForToolbarContext | null;
138
+ /**
139
+ * When true the link is announced as disabled and clicks are suppressed.
140
+ * Native `<a>` doesn't have a `disabled` attribute — we rely on
141
+ * `aria-disabled` and prevent navigation in the click handler.
142
+ */
143
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
144
+ /**
145
+ * Tabindex per APG: once any toolbar item has been focused, the roving
146
+ * tracker owns the tab stop so re-entry restores the last focused item;
147
+ * before that, fall back to the first-enabled entry point. Disabled links
148
+ * are always -1; a link used outside a toolbar keeps its natural 0.
149
+ */
150
+ readonly tabindex: _angular_core.Signal<0 | -1>;
151
+ constructor();
152
+ protected onClick(event: MouseEvent): void;
153
+ protected onFocus(): void;
154
+ protected onKeyDown(event: KeyboardEvent): void;
155
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForToolbarLink, never>;
156
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForToolbarLink, "[forToolbarLink]", ["forToolbarLink"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
157
+ }
158
+
159
+ /**
160
+ * Visual separator inside a toolbar. Defaults `orientation` to the opposite
161
+ * of the toolbar's main axis (a vertical line in a horizontal toolbar, and
162
+ * vice versa) — pass `orientation` explicitly to override.
163
+ *
164
+ * Reflects the same role / aria-orientation / data-orientation contract as
165
+ * `ForSeparator`, but anchored to the toolbar's cross-axis so an unconfigured
166
+ * separator renders perpendicular to the toolbar.
167
+ */
168
+ declare class ForToolbarSeparator {
169
+ #private;
170
+ /**
171
+ * Axis the separator divides along. When omitted, falls back to the
172
+ * cross-axis of the parent toolbar (horizontal toolbar → vertical
173
+ * separator, and vice versa).
174
+ */
175
+ readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical" | undefined>;
176
+ /**
177
+ * When true, the separator is purely visual: it gets `role="none"` and no
178
+ * `aria-orientation`, so assistive tech treats surrounding content as a
179
+ * single flow.
180
+ */
181
+ readonly decorative: _angular_core.InputSignalWithTransform<boolean, unknown>;
182
+ /**
183
+ * Cross-axis of the parent toolbar — the orientation an unconfigured
184
+ * separator inherits.
185
+ */
186
+ readonly defaultOrientation: _angular_core.Signal<"horizontal" | "vertical">;
187
+ protected readonly effectiveOrientation: _angular_core.Signal<"horizontal" | "vertical">;
188
+ protected ariaOrientation(): 'vertical' | null;
189
+ constructor();
190
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForToolbarSeparator, never>;
191
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForToolbarSeparator, "[forToolbarSeparator]", ["forToolbarSeparator"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "decorative": { "alias": "decorative"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
192
+ }
193
+
194
+ /**
195
+ * Defaults inherited by descendant toolbars in the surrounding injector
196
+ * scope. Configure with `provideForToolbarDefaults` either at the
197
+ * application root or in any component's `providers` array; partial
198
+ * overrides merge with the parent scope.
199
+ */
200
+ interface ForToolbarDefaults {
201
+ /**
202
+ * Whether arrow navigation wraps around past the first / last enabled
203
+ * item. Matches the WAI-ARIA Toolbar APG default.
204
+ */
205
+ loop: boolean;
206
+ }
207
+ /** Token holding the resolved toolbar defaults for the current scope. */
208
+ declare const FOR_TOOLBAR_DEFAULTS: _angular_core.InjectionToken<ForToolbarDefaults>;
209
+ /**
210
+ * Configures forty-cdk toolbar defaults for this injector scope. Partial
211
+ * overrides inherit unspecified keys from the parent scope (or library
212
+ * defaults at the root).
213
+ */
214
+ declare function provideForToolbarDefaults(defaults?: Partial<ForToolbarDefaults>): Provider[];
215
+
216
+ export { FOR_TOOLBAR_CONTEXT, FOR_TOOLBAR_DEFAULTS, ForToolbar, ForToolbarButton, ForToolbarLink, ForToolbarSeparator, provideForToolbarDefaults };
217
+ export type { ForToolbarContext, ForToolbarDefaults, ForToolbarItemHandle };