@cngx/common 0.1.0-rc.8 → 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 (90) hide show
  1. package/a11y/README.md +15 -2
  2. package/button/README.md +258 -0
  3. package/command/README.md +42 -2
  4. package/data/README.md +15 -12
  5. package/fesm2022/cngx-common-a11y.mjs +1076 -319
  6. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  7. package/fesm2022/cngx-common-audio.mjs +99 -77
  8. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  9. package/fesm2022/cngx-common-button.mjs +1084 -0
  10. package/fesm2022/cngx-common-button.mjs.map +1 -0
  11. package/fesm2022/cngx-common-card.mjs +138 -78
  12. package/fesm2022/cngx-common-card.mjs.map +1 -1
  13. package/fesm2022/cngx-common-chart.mjs +799 -327
  14. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  15. package/fesm2022/cngx-common-command.mjs +101 -25
  16. package/fesm2022/cngx-common-command.mjs.map +1 -1
  17. package/fesm2022/cngx-common-data.mjs +861 -423
  18. package/fesm2022/cngx-common-data.mjs.map +1 -1
  19. package/fesm2022/cngx-common-dialog.mjs +198 -160
  20. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  21. package/fesm2022/cngx-common-display.mjs +693 -329
  22. package/fesm2022/cngx-common-display.mjs.map +1 -1
  23. package/fesm2022/cngx-common-interactive.mjs +7303 -2774
  24. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  25. package/fesm2022/cngx-common-layout.mjs +2174 -442
  26. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  27. package/fesm2022/cngx-common-menu-button.mjs +557 -0
  28. package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
  29. package/fesm2022/cngx-common-popover.mjs +2109 -557
  30. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  31. package/fesm2022/cngx-common-stepper.mjs +548 -419
  32. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  33. package/fesm2022/cngx-common-tabs.mjs +442 -331
  34. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  35. package/fesm2022/cngx-common-timeline.mjs +44 -71
  36. package/fesm2022/cngx-common-timeline.mjs.map +1 -1
  37. package/fesm2022/cngx-common.mjs +10 -10
  38. package/fesm2022/cngx-common.mjs.map +1 -1
  39. package/interactive/README.md +30 -19
  40. package/layout/README.md +17 -1
  41. package/menu-button/README.md +234 -0
  42. package/package.json +31 -8
  43. package/popover/README.md +81 -4
  44. package/popover/tooltip-indicator.scss +52 -0
  45. package/schematics/collection.json +9 -0
  46. package/schematics/ng-add/index.js +9 -0
  47. package/schematics/ng-add/schema.json +96 -0
  48. package/schematics/package.json +3 -0
  49. package/stepper/README.md +5 -5
  50. package/theming/components/cngx-accordion.css +36 -7
  51. package/theming/components/cngx-async.css +185 -37
  52. package/theming/components/cngx-backdrop.css +3 -1
  53. package/theming/components/cngx-badge.css +20 -5
  54. package/theming/components/cngx-bottom-sheet.css +2 -0
  55. package/theming/components/cngx-breadcrumb.css +3 -1
  56. package/theming/components/cngx-button-group.css +325 -0
  57. package/theming/components/cngx-button-toggle.css +55 -23
  58. package/theming/components/cngx-button.css +975 -0
  59. package/theming/components/cngx-data-grid.css +2 -0
  60. package/theming/components/cngx-dialog.css +3 -1
  61. package/theming/components/cngx-divider.css +24 -9
  62. package/theming/components/cngx-drawer.css +153 -0
  63. package/theming/components/cngx-icon-glyph.css +76 -0
  64. package/theming/components/cngx-listbox.css +79 -25
  65. package/theming/components/cngx-menu.css +112 -52
  66. package/theming/components/cngx-nav.css +1220 -0
  67. package/theming/components/cngx-popover-sheet.css +434 -0
  68. package/theming/components/cngx-popover.css +37 -9
  69. package/theming/components/cngx-recycler-placeholder.css +2 -0
  70. package/theming/components/cngx-ripple.css +74 -16
  71. package/theming/components/cngx-sidebar.css +71 -0
  72. package/theming/components/cngx-slider.css +3 -1
  73. package/theming/components/cngx-tooltip.css +2 -0
  74. package/timeline/README.md +2 -2
  75. package/types/cngx-common-a11y.d.ts +488 -112
  76. package/types/cngx-common-audio.d.ts +60 -88
  77. package/types/cngx-common-button.d.ts +698 -0
  78. package/types/cngx-common-card.d.ts +104 -78
  79. package/types/cngx-common-chart.d.ts +677 -389
  80. package/types/cngx-common-command.d.ts +55 -41
  81. package/types/cngx-common-data.d.ts +506 -360
  82. package/types/cngx-common-dialog.d.ts +94 -127
  83. package/types/cngx-common-display.d.ts +475 -300
  84. package/types/cngx-common-interactive.d.ts +4383 -1721
  85. package/types/cngx-common-layout.d.ts +1399 -288
  86. package/types/cngx-common-menu-button.d.ts +382 -0
  87. package/types/cngx-common-popover.d.ts +990 -268
  88. package/types/cngx-common-stepper.d.ts +374 -465
  89. package/types/cngx-common-tabs.d.ts +309 -403
  90. package/types/cngx-common-timeline.d.ts +50 -109
@@ -0,0 +1,382 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal, InjectionToken, Type, Provider } from '@angular/core';
3
+ import * as i1 from '@cngx/common/button';
4
+ import { CngxButtonBrain, CngxButtonStart, CngxButtonEnd, CngxButtonHostState, CngxButtonState } from '@cngx/common/button';
5
+ import * as i2 from '@cngx/common/interactive';
6
+ import * as i3 from '@cngx/common/popover';
7
+
8
+ /**
9
+ * Open state and click toggle of a menu button host.
10
+ *
11
+ * @internal
12
+ */
13
+ interface CngxMenuToggle {
14
+ /** `true` while the menu is open. */
15
+ readonly expanded: Signal<boolean>;
16
+ /**
17
+ * Toggles the popover. A blocked trigger neither opens nor closes on click;
18
+ * an open menu closes by Escape, Tab, an outside press or an item
19
+ * activation.
20
+ */
21
+ readonly handleClick: () => void;
22
+ }
23
+
24
+ /**
25
+ * A button that opens a menu, after the WAI-ARIA APG Menu Button Pattern. Variant, tone, size,
26
+ * `disabled` with a reason and the busy layer come from `CngxButtonBrain`, as on `cngxButton`.
27
+ *
28
+ * `[menu]` takes the `cngxMenu`, `[popover]` the `cngxPopover` around it. `aria-haspopup` and
29
+ * `aria-controls` follow without a binding. ArrowDown, Enter or Space opens on the first item,
30
+ * ArrowUp on the last; Escape or an activation closes and returns focus to the button.
31
+ *
32
+ * The button has no action of its own: put async work on the menu items, not on a co-hosted
33
+ * `cngxAsyncClick`. A disabled menu button does not open, and an open menu closes when it becomes
34
+ * disabled.
35
+ *
36
+ * The end renders a decorative chevron caret. `provideButtonCaretIcon` swaps it, a projected
37
+ * `cngxButtonEnd` replaces it on one button.
38
+ *
39
+ * ```html
40
+ * <button cngxMenuButton="outline" [menu]="menu" [popover]="pop">Export</button>
41
+ * <div cngxPopover placement="bottom-start" #pop="cngxPopover">
42
+ * <ul cngxMenu label="Export format" #menu="cngxMenu">
43
+ * <li cngxMenuItem value="pdf">PDF</li>
44
+ * <li cngxMenuItem value="csv">CSV</li>
45
+ * </ul>
46
+ * </div>
47
+ * ```
48
+ *
49
+ * @wcag AA
50
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/menu-button.component.ts
51
+ * @since 0.3.0
52
+ * @relatedTo CngxButton, CngxButtonBrain, CngxMenuTrigger, CngxPopoverTrigger, CngxMenu, provideButtonCaretIcon, CngxIconMenuButton, CNGX_BUTTON_CARET_ICON
53
+ * <example-url>/#/common/menu-button/menu-button/basic</example-url>
54
+ * <example-url>/#/common/menu-button/menu-button/disabled-with-reason</example-url>
55
+ * <example-url>/#/common/menu-button/menu-button/custom-caret</example-url>
56
+ * @axis level molecule
57
+ */
58
+ declare class CngxMenuButton {
59
+ /** @internal */
60
+ protected readonly brain: CngxButtonBrain;
61
+ /**
62
+ * @internal - neither opens nor closes on click while the button is
63
+ * blocked. The brain's capture guard swallows every click while blocked,
64
+ * consumer `(click)` handlers included.
65
+ */
66
+ protected readonly toggle: CngxMenuToggle;
67
+ /** `true` while the menu is open. */
68
+ readonly expanded: _angular_core.Signal<boolean>;
69
+ protected readonly startSlot: _angular_core.Signal<CngxButtonStart | undefined>;
70
+ protected readonly endSlot: _angular_core.Signal<CngxButtonEnd | undefined>;
71
+ /** @internal - app-wide glyph from `CNGX_BUTTON_CARET_ICON`. */
72
+ protected readonly customCaret: _angular_core.Type<unknown> | null;
73
+ /** @internal - default chevron from the shared icon set. */
74
+ protected readonly caretIcon: {
75
+ readonly viewBox: "0 0 24 24";
76
+ readonly d: "M6 9l6 6 6-6";
77
+ readonly paint: "stroke";
78
+ readonly micro: {
79
+ readonly viewBox: "0 0 12 12";
80
+ readonly d: "M9 5L6 8L3 5L4 4L6 6L8 4Z";
81
+ };
82
+ readonly small: null;
83
+ };
84
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuButton, never>;
85
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxMenuButton, "button[cngxMenuButton]", ["cngxMenuButton"], {}, {}, ["startSlot", "endSlot"], ["[cngxButtonStart]", "*", "[cngxButtonEnd]"], true, [{ directive: typeof i1.CngxButtonBrain; inputs: { "variant": "cngxMenuButton"; "tone": "tone"; "size": "size"; "disabled": "disabled"; "disabledReason": "disabledReason"; "cngxDescribedBy": "cngxDescribedBy"; "type": "type"; }; outputs: {}; }, { directive: typeof i2.CngxMenuTrigger; inputs: { "cngxMenuTrigger": "menu"; "popover": "popover"; }; outputs: {}; }, { directive: typeof i3.CngxPopoverTrigger; inputs: { "cngxPopoverTrigger": "popover"; }; outputs: {}; }]>;
86
+ }
87
+
88
+ /**
89
+ * The caret role of a `cngxSplitButton`, as a host directive on a button host on
90
+ * `CngxButtonBrain`. As a direct child of a split the host becomes the caret, anywhere else it
91
+ * stays an ordinary button. `cngxIconMenuButton` renders on it.
92
+ *
93
+ * While the main action is blocked it refuses activation through `CNGX_BUTTON_HOST_STATE` and
94
+ * adds the cause to `aria-describedby`. The host renders `label()` as visually hidden text (an
95
+ * `aria-label` still wins) and `busyNote()` in a `hidden` span with `[id]="busyNoteId"`. Its click
96
+ * toggle must refuse every click while the brain is `blocked()`.
97
+ *
98
+ * Co-host `CngxPopoverTrigger`: the split reads the caret's popover through it to hang the menu
99
+ * under the group. A host that provides `CNGX_BUTTON_HOST_STATE` itself replaces this entry and
100
+ * folds `refusing()` into its own state.
101
+ *
102
+ * @wcag AA
103
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/split-caret.directive.ts
104
+ * @since 0.3.0
105
+ * @relatedTo CngxSplitButton, CngxIconMenuButton, CngxButtonBrain, CNGX_SPLIT_BUTTON, CNGX_MENU_BUTTON_I18N, CNGX_BUTTON_HOST_STATE, CngxPopoverTrigger
106
+ * <example-url>/#/common/menu-button/split-button/custom-caret-host</example-url>
107
+ * @axis level molecule
108
+ */
109
+ declare class CngxSplitCaret implements CngxButtonHostState {
110
+ private readonly state;
111
+ private readonly split;
112
+ private readonly i18n;
113
+ /** `true` while the host is the caret of a split (its direct child). */
114
+ readonly isCaret: _angular_core.Signal<boolean>;
115
+ /** `true` while the host is the caret and the main action is blocked. */
116
+ readonly refusing: _angular_core.Signal<boolean>;
117
+ /** Id the host template puts on its hidden busy note. */
118
+ readonly busyNoteId: string;
119
+ /** The caret's name, `menuButton.splitToggle`. */
120
+ readonly label: _angular_core.Signal<string>;
121
+ /** The busy note, `menuButton.splitMainBusy`. */
122
+ readonly busyNote: _angular_core.Signal<string>;
123
+ private readonly mainDescriptionIds;
124
+ constructor();
125
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSplitCaret, never>;
126
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSplitCaret, "[cngxSplitCaret]", ["cngxSplitCaret"], {}, {}, never, never, true, never>;
127
+ }
128
+
129
+ /**
130
+ * The square, icon-only menu button: the kebab of a row, toolbar or card, and the caret of a
131
+ * `cngxSplitButton`. Bindings and keyboard model of `cngxMenuButton`, `cngxIconButton` skin,
132
+ * `ghost` by default.
133
+ *
134
+ * Outside a split it renders the projected glyph and needs a name: without `aria-label`,
135
+ * `aria-labelledby` or `title` it warns [`CNGX1071`](/error-codes/cngx1071.md) in development. As
136
+ * the direct child of a `cngxSplitButton` it is the caret and needs neither glyph nor label.
137
+ *
138
+ * ```html
139
+ * <button cngxIconMenuButton aria-label="Row actions" [menu]="menu" [popover]="pop">
140
+ * <svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor">
141
+ * <circle cx="12" cy="5" r="2" /><circle cx="12" cy="12" r="2" /><circle cx="12" cy="19" r="2" />
142
+ * </svg>
143
+ * </button>
144
+ * ```
145
+ *
146
+ * @wcag AA
147
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/icon-menu-button.component.ts
148
+ * @since 0.3.0
149
+ * @relatedTo CngxMenuButton, CngxButtonBrain, CngxSplitButton, CngxSplitCaret, CngxIconButton, CngxMenuTrigger, CNGX_MENU_BUTTON_I18N, CNGX_BUTTON_CARET_ICON, CngxPopoverTrigger
150
+ * <example-url>/#/common/menu-button/icon-menu-button/kebab</example-url>
151
+ * <example-url>/#/common/menu-button/split-button/basic</example-url>
152
+ * @axis level molecule
153
+ */
154
+ declare class CngxIconMenuButton {
155
+ /** @internal */
156
+ protected readonly brain: CngxButtonBrain;
157
+ /** @internal - the caret role inside a `cngxSplitButton`. */
158
+ protected readonly caret: CngxSplitCaret;
159
+ /** @internal - neither opens nor closes on click while blocked. */
160
+ protected readonly toggle: CngxMenuToggle;
161
+ /** `true` while the menu is open. */
162
+ readonly expanded: _angular_core.Signal<boolean>;
163
+ /** @internal - app-wide glyph from `CNGX_BUTTON_CARET_ICON`. */
164
+ protected readonly customCaret: _angular_core.Type<unknown> | null;
165
+ /** @internal - default chevron from the shared icon set. */
166
+ protected readonly caretIcon: {
167
+ readonly viewBox: "0 0 24 24";
168
+ readonly d: "M6 9l6 6 6-6";
169
+ readonly paint: "stroke";
170
+ readonly micro: {
171
+ readonly viewBox: "0 0 12 12";
172
+ readonly d: "M9 5L6 8L3 5L4 4L6 6L8 4Z";
173
+ };
174
+ readonly small: null;
175
+ };
176
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxIconMenuButton, never>;
177
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxIconMenuButton, "button[cngxIconMenuButton]", ["cngxIconMenuButton"], {}, {}, never, ["*"], true, [{ directive: typeof i1.CngxButtonBrain; inputs: { "variant": "cngxIconMenuButton"; "tone": "tone"; "size": "size"; "disabled": "disabled"; "disabledReason": "disabledReason"; "cngxDescribedBy": "cngxDescribedBy"; "type": "type"; }; outputs: {}; }, { directive: typeof i2.CngxMenuTrigger; inputs: { "cngxMenuTrigger": "menu"; "popover": "popover"; }; outputs: {}; }, { directive: typeof i3.CngxPopoverTrigger; inputs: { "cngxPopoverTrigger": "popover"; }; outputs: {}; }, { directive: typeof CngxSplitCaret; inputs: {}; outputs: {}; }]>;
178
+ }
179
+
180
+ /**
181
+ * What a `cngxSplitButton` tells its caret. A custom caret host can read it for more than
182
+ * `CngxSplitCaret` supplies.
183
+ *
184
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/split-button.token.ts
185
+ * @since 0.3.0
186
+ * @relatedTo CngxSplitButton, CngxSplitCaret, CngxIconMenuButton, CNGX_SPLIT_BUTTON, CNGX_BUTTON_STATE
187
+ */
188
+ interface CngxSplitButtonContext {
189
+ /** `true` while the main button refuses activation. */
190
+ readonly mainBlocked: Signal<boolean>;
191
+ /** `true` while the main button runs, including a run its host reflects (`[externalState]`). */
192
+ readonly mainBusy: Signal<boolean>;
193
+ /** Id of the main button's reason while it is disabled with one, else `null`. */
194
+ readonly mainReasonId: Signal<string | null>;
195
+ /** The caret's button state. */
196
+ readonly caret: Signal<CngxButtonState | undefined>;
197
+ }
198
+ /**
199
+ * Provided by `CngxSplitButton`, injected by `CngxSplitCaret`.
200
+ *
201
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/split-button.token.ts
202
+ * @since 0.3.0
203
+ * @relatedTo CngxSplitButton, CngxSplitCaret, CngxIconMenuButton, CngxSplitButtonContext, CNGX_BUTTON_STATE
204
+ */
205
+ declare const CNGX_SPLIT_BUTTON: InjectionToken<CngxSplitButtonContext>;
206
+
207
+ /**
208
+ * A main button for the default action and a `cngxIconMenuButton` caret for the alternatives,
209
+ * framed as one `role="group"` button group. The group needs a name
210
+ * ([`CNGX1072`](/error-codes/cngx1072.md)); `variant` and `size` pass to both buttons.
211
+ *
212
+ * Both roles are direct children (an `ng-container` in between is fine): the caret carries
213
+ * `CngxSplitCaret`, the main action is the first other cngx button. Without a main button the
214
+ * split warns [`CNGX1073`](/error-codes/cngx1073.md).
215
+ *
216
+ * While the main button is disabled, running or refused by `[enabled]="false"`, the caret reads
217
+ * `aria-disabled`, does not open, closes an open menu and names the cause in `aria-describedby`.
218
+ * The main button keeps `aria-busy` and the announcement.
219
+ *
220
+ * The caret's menu hangs under the whole group. The split takes the explicit anchor slot of the
221
+ * caret's popover only while it is free, so a `[cngxPopoverAnchor]` of your own keeps precedence.
222
+ *
223
+ * ```html
224
+ * <div cngxSplitButton variant="solid" aria-label="Publish">
225
+ * <button cngxButton [cngxAsyncClick]="publish">Publish</button>
226
+ * <button cngxIconMenuButton [menu]="menu" [popover]="pop"></button>
227
+ * </div>
228
+ * ```
229
+ *
230
+ * @wcag AA
231
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/split-button.directive.ts
232
+ * @since 0.3.0
233
+ * @relatedTo CngxIconMenuButton, CngxSplitCaret, CngxButton, CngxButtonGroup, CNGX_BUTTON_STATE, CngxAsyncClick, CNGX_MENU_BUTTON_I18N, CNGX_SPLIT_BUTTON, CngxPopoverAnchor
234
+ * <example-url>/#/common/menu-button/split-button/basic</example-url>
235
+ * <example-url>/#/common/menu-button/split-button/busy-and-disabled</example-url>
236
+ * @axis level molecule
237
+ */
238
+ declare class CngxSplitButton implements CngxSplitButtonContext {
239
+ private readonly buttons;
240
+ private readonly caretRole;
241
+ /** The caret's button state. */
242
+ readonly caret: _angular_core.Signal<i1.CngxButtonState | undefined>;
243
+ private readonly host;
244
+ private readonly menuPopover;
245
+ /** `anchor-name` of the caret popover while the host holds its explicit anchor slot. */
246
+ protected readonly anchorName: _angular_core.Signal<string | null>;
247
+ private readonly main;
248
+ /** `true` while the main button refuses activation; `false` without one. */
249
+ readonly mainBlocked: _angular_core.Signal<boolean>;
250
+ /** `true` while the main button runs; `false` without one. */
251
+ readonly mainBusy: _angular_core.Signal<boolean>;
252
+ /** Id of the main button's reason while it is disabled with one, else `null`. */
253
+ readonly mainReasonId: _angular_core.Signal<string | null>;
254
+ constructor();
255
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSplitButton, never>;
256
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSplitButton, "[cngxSplitButton]", ["cngxSplitButton"], {}, {}, ["buttons", "caretRole"], never, true, [{ directive: typeof i1.CngxButtonGroup; inputs: { "variant": "variant"; "size": "size"; }; outputs: {}; }]>;
257
+ }
258
+
259
+ /**
260
+ * The caret glyph component of every `cngxMenuButton` without a projected `cngxButtonEnd`, and of
261
+ * every split caret. Without it the caret is `CNGX_ICON_CHEVRON_DOWN`. It renders inside an
262
+ * `aria-hidden` `<cngx-icon>`, so it draws a glyph and nothing else.
263
+ *
264
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/caret-icon.token.ts
265
+ * @since 0.3.0
266
+ * @relatedTo provideButtonCaretIcon, injectButtonCaretIcon, CngxMenuButton, CngxIconMenuButton
267
+ * <example-url>/#/common/menu-button/menu-button/custom-caret</example-url>
268
+ */
269
+ declare const CNGX_BUTTON_CARET_ICON: InjectionToken<Type<unknown>>;
270
+ /**
271
+ * Provides the caret below the provider, in `providers` or `viewProviders`. The nearest provider
272
+ * wins.
273
+ *
274
+ * ```ts
275
+ * bootstrapApplication(App, { providers: [provideButtonCaretIcon(MaterialCaret)] });
276
+ * ```
277
+ *
278
+ * @param component The glyph component; it renders inside the `aria-hidden` caret `<cngx-icon>`.
279
+ *
280
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/caret-icon.token.ts
281
+ * @since 0.3.0
282
+ * @relatedTo CNGX_BUTTON_CARET_ICON, injectButtonCaretIcon
283
+ * <example-url>/#/common/menu-button/menu-button/custom-caret</example-url>
284
+ */
285
+ declare function provideButtonCaretIcon(component: Type<unknown>): Provider;
286
+ /**
287
+ * The caret set with `provideButtonCaretIcon`, or `null` for the default chevron.
288
+ *
289
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/caret-icon.token.ts
290
+ * @since 0.3.0
291
+ * @relatedTo CNGX_BUTTON_CARET_ICON, provideButtonCaretIcon
292
+ */
293
+ declare function injectButtonCaretIcon(): Type<unknown> | null;
294
+
295
+ /**
296
+ * The `menuButton` section of a `CngxLanguagePack`.
297
+ *
298
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/i18n/menu-button-language-section.ts
299
+ * @since 0.3.0
300
+ * @relatedTo CNGX_MENU_BUTTON_I18N, CNGX_MENU_BUTTON_LANGUAGE_EN
301
+ */
302
+ interface CngxMenuButtonLanguageSection {
303
+ /** Accessible name of a split caret. An `aria-label` on the caret wins. */
304
+ readonly splitToggle: string;
305
+ /** Description of the split caret while the main action runs, never part of its name. */
306
+ readonly splitMainBusy: string;
307
+ }
308
+ /**
309
+ * The English `menuButton` section, the default of `CNGX_MENU_BUTTON_I18N`.
310
+ *
311
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/i18n/menu-button-language-section.ts
312
+ * @since 0.3.0
313
+ * @relatedTo CNGX_MENU_BUTTON_I18N, CngxMenuButtonLanguageSection
314
+ */
315
+ declare const CNGX_MENU_BUTTON_LANGUAGE_EN: CngxMenuButtonLanguageSection;
316
+ declare module '@cngx/core/i18n' {
317
+ interface CngxLanguagePack {
318
+ readonly menuButton: CngxMenuButtonLanguageSection;
319
+ }
320
+ }
321
+
322
+ /**
323
+ * The menu-button copy, the `menuButton` section of a language pack.
324
+ *
325
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/i18n/menu-button-i18n.ts
326
+ * @since 0.3.0
327
+ * @relatedTo CNGX_MENU_BUTTON_I18N
328
+ */
329
+ type CngxMenuButtonI18n = CngxMenuButtonLanguageSection;
330
+ /**
331
+ * The resolved menu-button copy: the `menuButton` section of the active language pack over the
332
+ * English defaults. A `Signal`, so the names follow a runtime language switch.
333
+ *
334
+ * @wcag AA
335
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/i18n/menu-button-i18n.ts
336
+ * @since 0.3.0
337
+ * @relatedTo CngxIconMenuButton, CngxSplitButton, CngxSplitCaret, provideMenuButtonI18n, injectMenuButtonI18n, CNGX_MENU_BUTTON_LANGUAGE_EN, provideCngxI18n
338
+ */
339
+ declare const CNGX_MENU_BUTTON_I18N: InjectionToken<Signal<CngxMenuButtonLanguageSection>>;
340
+ /**
341
+ * A label override feature of `provideMenuButtonI18n`.
342
+ *
343
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/i18n/menu-button-i18n.ts
344
+ * @since 0.3.0
345
+ * @relatedTo CNGX_MENU_BUTTON_I18N, withMenuButtonI18nLabels
346
+ */
347
+ type CngxMenuButtonI18nFeature = (bundle: Signal<CngxMenuButtonI18n>) => Signal<CngxMenuButtonI18n>;
348
+ /**
349
+ * Overrides single keys. Unset keys keep the language pack's phrase, or the English default. Pass
350
+ * a `Signal` to switch the language at runtime.
351
+ *
352
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/i18n/menu-button-i18n.ts
353
+ * @since 0.3.0
354
+ * @relatedTo CNGX_MENU_BUTTON_I18N, provideMenuButtonI18n
355
+ */
356
+ declare function withMenuButtonI18nLabels(overrides: Partial<CngxMenuButtonI18n> | Signal<Partial<CngxMenuButtonI18n>>): CngxMenuButtonI18nFeature;
357
+ /**
358
+ * Provides the menu-button copy. The features apply on top of the active language pack, so a
359
+ * subtree overrides single keys of the app's language.
360
+ * A nested provider starts again from the language pack instead of merging onto the outer one,
361
+ * so it repeats every outer override it still needs.
362
+ *
363
+ * ```ts
364
+ * providers: [provideMenuButtonI18n(withMenuButtonI18nLabels({ splitToggle: 'More actions' }))]
365
+ * ```
366
+ *
367
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/i18n/menu-button-i18n.ts
368
+ * @since 0.3.0
369
+ * @relatedTo CNGX_MENU_BUTTON_I18N, withMenuButtonI18nLabels
370
+ */
371
+ declare function provideMenuButtonI18n(...features: readonly CngxMenuButtonI18nFeature[]): Provider;
372
+ /**
373
+ * Reads the resolved copy. `CngxSplitCaret` already exposes it as `label()` and `busyNote()`.
374
+ *
375
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/menu-button/i18n/menu-button-i18n.ts
376
+ * @since 0.3.0
377
+ * @relatedTo CNGX_MENU_BUTTON_I18N, CngxSplitCaret
378
+ */
379
+ declare function injectMenuButtonI18n(): Signal<CngxMenuButtonI18n>;
380
+
381
+ export { CNGX_BUTTON_CARET_ICON, CNGX_MENU_BUTTON_I18N, CNGX_MENU_BUTTON_LANGUAGE_EN, CNGX_SPLIT_BUTTON, CngxIconMenuButton, CngxMenuButton, CngxSplitButton, CngxSplitCaret, injectButtonCaretIcon, injectMenuButtonI18n, provideButtonCaretIcon, provideMenuButtonI18n, withMenuButtonI18nLabels };
382
+ export type { CngxMenuButtonI18n, CngxMenuButtonI18nFeature, CngxMenuButtonLanguageSection, CngxSplitButtonContext };