@nanahoshi/mona-ui 0.3.0 → 0.5.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.
- package/card/package.json +4 -0
- package/collapsible/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-button.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-card.mjs +307 -0
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +304 -0
- package/fesm2022/nanahoshi-mona-ui-common.mjs +19 -1
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +20 -9
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-D-JCCvYJ.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-7zwgl7u1.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs → nanahoshi-mona-ui-grid-grid-list.component-n3eQNIza.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-BhS7c7rW.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-B4VB3xFw.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-A6Cq2a4Q.mjs} +11 -11
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +18 -16
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2025 -0
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +96 -0
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +71 -25
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +49 -2
- package/package.json +17 -1
- package/sidebar/package.json +4 -0
- package/skeleton/package.json +4 -0
- package/types/nanahoshi-mona-ui-card.d.ts +104 -0
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -1
- package/types/nanahoshi-mona-ui-collapsible.d.ts +92 -0
- package/types/nanahoshi-mona-ui-common.d.ts +6 -2
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +11 -3
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +6 -4
- package/types/nanahoshi-mona-ui-sidebar.d.ts +695 -0
- package/types/nanahoshi-mona-ui-skeleton.d.ts +51 -0
- package/types/nanahoshi-mona-ui-theme.d.ts +28 -2
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
import * as _nanahoshi_mona_ui_sidebar from '@nanahoshi/mona-ui/sidebar';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { Signal, EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
4
|
+
import { ClassInputType } from '@nanahoshi/mona-ui/common';
|
|
5
|
+
import * as i1 from '@angular/cdk/a11y';
|
|
6
|
+
import * as i1$1 from '@nanahoshi/mona-ui/text-box';
|
|
7
|
+
import * as i1$2 from '@nanahoshi/mona-ui/button';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* How the sidebar behaves when it is collapsed.
|
|
11
|
+
*
|
|
12
|
+
* - `offcanvas` — the sidebar collapses to zero width and leaves the layout.
|
|
13
|
+
* - `icon` — the sidebar shrinks to a narrow rail that keeps icons visible.
|
|
14
|
+
* - `none` — the sidebar cannot be collapsed and stays at its full width.
|
|
15
|
+
*/
|
|
16
|
+
type SidebarCollapsibleMode = "offcanvas" | "icon" | "none";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Which edge of the layout the sidebar sits on. Also determines its order within the layout
|
|
20
|
+
* and which side its rail and border are drawn on.
|
|
21
|
+
*
|
|
22
|
+
* `start` and `end` are the preferred values: they follow the document's writing direction, so a
|
|
23
|
+
* `start` sidebar sits on the left in LTR and on the right in RTL without the consumer branching.
|
|
24
|
+
*
|
|
25
|
+
* `left` and `right` are retained as aliases of `start` and `end`. They were always a poor
|
|
26
|
+
* description of the behaviour — the layout orders the sidebar with flexbox, which is
|
|
27
|
+
* direction-relative, so `side="left"` already rendered on the right under RTL.
|
|
28
|
+
*/
|
|
29
|
+
type SidebarSide = "start" | "end" | "left" | "right";
|
|
30
|
+
/** The direction-relative side, once the `left`/`right` aliases have been folded in. */
|
|
31
|
+
type SidebarLogicalSide = "start" | "end";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The visual treatment of the sidebar region.
|
|
35
|
+
*
|
|
36
|
+
* - `sidebar` — flush against the edge of the layout, separated by a single border.
|
|
37
|
+
* - `floating` — detached from the edge, with its own rounded, bordered surface.
|
|
38
|
+
* - `inset` — the sidebar itself is plain, and the inset region beside it becomes the raised surface.
|
|
39
|
+
*/
|
|
40
|
+
type SidebarVariant = "sidebar" | "floating" | "inset";
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @description
|
|
44
|
+
* The sidebar region itself. Content is projected in author order, so header, content and footer
|
|
45
|
+
* parts appear exactly where they are written.
|
|
46
|
+
*
|
|
47
|
+
* Below the layout's `mobileBreakpoint` it presents as a modal overlay drawer: focus is trapped
|
|
48
|
+
* inside it while open, restored to whatever opened it on close, and the rest of the layout is made
|
|
49
|
+
* inert. It is not a navigation landmark by itself — wrap the menus in a labelled `nav`, or set
|
|
50
|
+
* `role` and `ariaLabel` if the whole region is navigation.
|
|
51
|
+
*/
|
|
52
|
+
declare class SidebarComponent {
|
|
53
|
+
#private;
|
|
54
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
55
|
+
/** The compact presentation: an overlay pinned to one edge rather than a column in the flow. */
|
|
56
|
+
protected readonly drawer: _angular_core.Signal<boolean>;
|
|
57
|
+
/** Published rather than the raw input, so a `left`/`right` alias still reports as `start`/`end`. */
|
|
58
|
+
protected readonly logicalSide: _angular_core.Signal<_nanahoshi_mona_ui_sidebar.SidebarLogicalSide>;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the panel is out of view entirely. The icon rail does not count — it is still on screen
|
|
61
|
+
* and still operable — but a closed drawer and a fully collapsed off-canvas sidebar both do.
|
|
62
|
+
*/
|
|
63
|
+
protected readonly hidden: _angular_core.Signal<boolean>;
|
|
64
|
+
protected readonly offCanvasClosed: _angular_core.Signal<boolean>;
|
|
65
|
+
/** A drawer is a modal surface; a docked sidebar keeps whatever role the consumer gave it. */
|
|
66
|
+
protected readonly resolvedRole: _angular_core.Signal<string | null>;
|
|
67
|
+
protected readonly sidebarId: _angular_core.Signal<string>;
|
|
68
|
+
protected readonly state: _angular_core.Signal<"expanded" | "collapsed">;
|
|
69
|
+
/**
|
|
70
|
+
* `width` and `iconWidth` are the width the sidebar's *contents* get, because that is what the
|
|
71
|
+
* parts inside are measured against — an icon rail less a region's padding is meant to leave
|
|
72
|
+
* exactly one icon square. The variant's border is painted inside the box under the global
|
|
73
|
+
* `border-box`, so it is added back on here rather than being taken out of that measurement.
|
|
74
|
+
*/
|
|
75
|
+
protected readonly widthString: _angular_core.Signal<string>;
|
|
76
|
+
/**
|
|
77
|
+
* @description Accessible name for the sidebar region. Required when `role` is set, and used as the
|
|
78
|
+
* drawer's name on compact viewports.
|
|
79
|
+
* @default ""
|
|
80
|
+
*/
|
|
81
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
82
|
+
/**
|
|
83
|
+
* @description How the sidebar behaves when collapsed. `"icon"` keeps a narrow rail of icons visible,
|
|
84
|
+
* `"offcanvas"` removes it from the layout entirely, and `"none"` disables collapsing altogether.
|
|
85
|
+
* @default "offcanvas"
|
|
86
|
+
*/
|
|
87
|
+
readonly collapsible: _angular_core.InputSignal<SidebarCollapsibleMode>;
|
|
88
|
+
/**
|
|
89
|
+
* @description Sets whether this sidebar is open. Supports two-way binding. While the viewport is
|
|
90
|
+
* compact this reflects the drawer, so one binding drives both presentations.
|
|
91
|
+
* @default true
|
|
92
|
+
*/
|
|
93
|
+
readonly expanded: _angular_core.ModelSignal<boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* @description Width of the icon rail while collapsed. Only applies when `collapsible` is `"icon"`.
|
|
96
|
+
* Numbers are treated as pixels.
|
|
97
|
+
* @default "3rem"
|
|
98
|
+
*/
|
|
99
|
+
readonly iconWidth: _angular_core.InputSignal<string | number>;
|
|
100
|
+
/**
|
|
101
|
+
* @description Id for the sidebar element, referenced by triggers through `aria-controls`. Supply a
|
|
102
|
+
* stable value when the markup is server rendered, so the client does not hydrate onto a different
|
|
103
|
+
* generated id. Falls back to a generated id.
|
|
104
|
+
* @default ""
|
|
105
|
+
*/
|
|
106
|
+
readonly id: _angular_core.InputSignal<string>;
|
|
107
|
+
/**
|
|
108
|
+
* @description Width of the overlay drawer on compact viewports. Numbers are treated as pixels.
|
|
109
|
+
* @default "18rem"
|
|
110
|
+
*/
|
|
111
|
+
readonly mobileWidth: _angular_core.InputSignal<string | number>;
|
|
112
|
+
/**
|
|
113
|
+
* @description Remembers whether this sidebar was left open, under this key. Unset means nothing is
|
|
114
|
+
* stored — no key, no storage written.
|
|
115
|
+
*
|
|
116
|
+
* Only the docked state is kept. A drawer is never restored open: on the viewport that makes one,
|
|
117
|
+
* it would cover the page on load. A stored value wins over `expanded`, and is pushed back out
|
|
118
|
+
* through that binding, so do not set a key on a sidebar whose state is already restored elsewhere.
|
|
119
|
+
*
|
|
120
|
+
* Where it is kept is `SIDEBAR_STORAGE`, which defaults to `localStorage`. A server-rendered
|
|
121
|
+
* application cannot read that until hydration and so flashes the default first; supply storage the
|
|
122
|
+
* server can read through `provideSidebarStorage()`.
|
|
123
|
+
* @default ""
|
|
124
|
+
*/
|
|
125
|
+
readonly persistKey: _angular_core.InputSignal<string>;
|
|
126
|
+
/**
|
|
127
|
+
* @description ARIA role for the sidebar region. Leave unset and wrap the menus in a labelled `nav`
|
|
128
|
+
* when the sidebar holds more than navigation; set `"navigation"` with an `aria-label` when it does
|
|
129
|
+
* not. Ignored on compact viewports, where the drawer is a `dialog`.
|
|
130
|
+
* @default ""
|
|
131
|
+
*/
|
|
132
|
+
readonly role: _angular_core.InputSignal<string>;
|
|
133
|
+
/**
|
|
134
|
+
* @description Which edge the sidebar sits on. Prefer `"start"` and `"end"`, which follow the
|
|
135
|
+
* document's writing direction; `"left"` and `"right"` are aliases of them.
|
|
136
|
+
* @default "start"
|
|
137
|
+
*/
|
|
138
|
+
readonly side: _angular_core.InputSignal<SidebarSide>;
|
|
139
|
+
/**
|
|
140
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
141
|
+
* @default ""
|
|
142
|
+
*/
|
|
143
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
144
|
+
/**
|
|
145
|
+
* @description The visual treatment of the sidebar. `"floating"` detaches it from the edge on its own
|
|
146
|
+
* surface, and `"inset"` moves that raised surface onto the region beside it instead.
|
|
147
|
+
* @default "sidebar"
|
|
148
|
+
*/
|
|
149
|
+
readonly variant: _angular_core.InputSignal<SidebarVariant>;
|
|
150
|
+
/**
|
|
151
|
+
* @description Width of the sidebar while expanded. Numbers are treated as pixels.
|
|
152
|
+
* @default "16rem"
|
|
153
|
+
*/
|
|
154
|
+
readonly width: _angular_core.InputSignal<string | number>;
|
|
155
|
+
constructor();
|
|
156
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarComponent, never>;
|
|
157
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarComponent, "mona-sidebar", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "iconWidth": { "alias": "iconWidth"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "mobileWidth": { "alias": "mobileWidth"; "required": false; "isSignal": true; }; "persistKey": { "alias": "persistKey"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "side": { "alias": "side"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, ["*"], true, [{ directive: typeof i1.CdkTrapFocus; inputs: {}; outputs: {}; }]>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @description
|
|
162
|
+
* Lays its children out in a row and owns what they share. Project one or more `mona-sidebar`
|
|
163
|
+
* elements and an element marked with `monaSidebarInset` into it. Each sidebar keeps its own open
|
|
164
|
+
* state, on its own `[(expanded)]` binding, so a layout can hold a navigation column on one edge and
|
|
165
|
+
* an inspector on the other.
|
|
166
|
+
*
|
|
167
|
+
* Below `mobileBreakpoint` sidebars present as overlay drawers instead of columns. A drawer has its
|
|
168
|
+
* own open state, so a sidebar collapsed on a desktop does not come back open on a phone, and it is
|
|
169
|
+
* reset whenever the viewport crosses the breakpoint. Only one drawer is open at a time: opening one
|
|
170
|
+
* closes any other, and they share the single backdrop this layout paints behind them.
|
|
171
|
+
*/
|
|
172
|
+
declare class SidebarLayoutComponent {
|
|
173
|
+
#private;
|
|
174
|
+
protected readonly backdropClass: _angular_core.Signal<string>;
|
|
175
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
176
|
+
protected readonly compact: _angular_core.Signal<boolean>;
|
|
177
|
+
/** One backdrop serves every sidebar, because only one of their drawers is ever open. */
|
|
178
|
+
protected readonly mobileOpen: _angular_core.Signal<boolean>;
|
|
179
|
+
/**
|
|
180
|
+
* @description Viewport width, in pixels, below which the sidebar presents as an overlay drawer.
|
|
181
|
+
* Set to `0` to keep the docked presentation at every size.
|
|
182
|
+
* @default 768
|
|
183
|
+
*/
|
|
184
|
+
readonly mobileBreakpoint: _angular_core.InputSignal<number>;
|
|
185
|
+
/**
|
|
186
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
187
|
+
* @default ""
|
|
188
|
+
*/
|
|
189
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
190
|
+
constructor();
|
|
191
|
+
protected onBackdropClick(): void;
|
|
192
|
+
protected onEscape(event: Event): void;
|
|
193
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarLayoutComponent, never>;
|
|
194
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarLayoutComponent, "mona-sidebar-layout", never, { "mobileBreakpoint": { "alias": "mobileBreakpoint"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @description
|
|
199
|
+
* A loading placeholder shaped like a menu item. Drops its label bar on the icon rail, where the
|
|
200
|
+
* real labels are not visible either.
|
|
201
|
+
*/
|
|
202
|
+
declare class SidebarMenuSkeletonComponent {
|
|
203
|
+
#private;
|
|
204
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
205
|
+
protected readonly iconOnly: _angular_core.Signal<boolean>;
|
|
206
|
+
/**
|
|
207
|
+
* @description Width of the label bar. Varying it across a list keeps the placeholder from looking
|
|
208
|
+
* like a rigid grid. Numbers are treated as pixels.
|
|
209
|
+
* @default "60%"
|
|
210
|
+
*/
|
|
211
|
+
readonly labelWidth: _angular_core.InputSignal<string | number>;
|
|
212
|
+
/**
|
|
213
|
+
* @description Renders a square standing in for the item's icon.
|
|
214
|
+
* @default true
|
|
215
|
+
*/
|
|
216
|
+
readonly showIcon: _angular_core.InputSignal<boolean>;
|
|
217
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMenuSkeletonComponent, never>;
|
|
218
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarMenuSkeletonComponent, "mona-sidebar-menu-skeleton", never, { "labelWidth": { "alias": "labelWidth"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare class SidebarContentDirective {
|
|
222
|
+
#private;
|
|
223
|
+
/**
|
|
224
|
+
* A scrollbar takes its width out of the content box, and the icon rail has none to give: at a
|
|
225
|
+
* `3rem` rail it claims about a third of it and squeezes every icon in the region. There is nothing
|
|
226
|
+
* to read on the rail anyway — the labels are gone — so the overflow is simply clipped there.
|
|
227
|
+
*/
|
|
228
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
229
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarContentDirective, never>;
|
|
230
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarContentDirective, "[monaSidebarContent]", never, {}, {}, never, never, true, never>;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @description
|
|
235
|
+
* The region at the bottom of the sidebar, below its content. Holds what stays put while the content
|
|
236
|
+
* scrolls — a profile menu, a sign-out.
|
|
237
|
+
*/
|
|
238
|
+
declare class SidebarFooterDirective {
|
|
239
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
240
|
+
/**
|
|
241
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
242
|
+
* @default ""
|
|
243
|
+
*/
|
|
244
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
245
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarFooterDirective, never>;
|
|
246
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarFooterDirective, "[monaSidebarFooter]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @description
|
|
251
|
+
* A titled section of the sidebar, grouping a label and its menu. Stack as many as the sidebar
|
|
252
|
+
* needs; each is an ordinary block, so a `monaSidebarSeparator` between them is optional.
|
|
253
|
+
*/
|
|
254
|
+
declare class SidebarGroupDirective {
|
|
255
|
+
protected readonly baseClass: string;
|
|
256
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarGroupDirective, never>;
|
|
257
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarGroupDirective, "[monaSidebarGroup]", never, {}, {}, never, never, true, never>;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @description
|
|
262
|
+
* A control in the corner of a group header — an add or overflow button. Stands down on the icon
|
|
263
|
+
* rail, where there is no header row left to sit in. Give it an `aria-label`: it is icon-only.
|
|
264
|
+
*/
|
|
265
|
+
declare class SidebarGroupActionDirective {
|
|
266
|
+
#private;
|
|
267
|
+
protected readonly hidden: _angular_core.Signal<boolean>;
|
|
268
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarGroupActionDirective, never>;
|
|
269
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarGroupActionDirective, "button[monaSidebarGroupAction]", never, {}, {}, never, never, true, never>;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @description
|
|
274
|
+
* The body of a `monaSidebarGroup`, below its header. Wraps the menu itself.
|
|
275
|
+
*/
|
|
276
|
+
declare class SidebarGroupContentDirective {
|
|
277
|
+
protected readonly baseClass: string;
|
|
278
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarGroupContentDirective, never>;
|
|
279
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarGroupContentDirective, "[monaSidebarGroupContent]", never, {}, {}, never, never, true, never>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @description
|
|
284
|
+
* The row above a group's content, holding its label and any group action. Collapses to nothing on
|
|
285
|
+
* the icon rail rather than leaving an empty gap where the label used to be.
|
|
286
|
+
*/
|
|
287
|
+
declare class SidebarGroupHeaderDirective {
|
|
288
|
+
#private;
|
|
289
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
290
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarGroupHeaderDirective, never>;
|
|
291
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarGroupHeaderDirective, "[monaSidebarGroupHeader]", never, {}, {}, never, never, true, never>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @description
|
|
296
|
+
* The name of a group. Fades out on the icon rail, where there is no width to read it in.
|
|
297
|
+
*/
|
|
298
|
+
declare class SidebarGroupLabelDirective {
|
|
299
|
+
#private;
|
|
300
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
301
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarGroupLabelDirective, never>;
|
|
302
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarGroupLabelDirective, "[monaSidebarGroupLabel]", never, {}, {}, never, never, true, never>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @description
|
|
307
|
+
* The region at the top of the sidebar, above its content. Holds what stays put while the content
|
|
308
|
+
* scrolls — a workspace switcher, a search box.
|
|
309
|
+
*/
|
|
310
|
+
declare class SidebarHeaderDirective {
|
|
311
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
312
|
+
/**
|
|
313
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
314
|
+
* @default ""
|
|
315
|
+
*/
|
|
316
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
317
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarHeaderDirective, never>;
|
|
318
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarHeaderDirective, "[monaSidebarHeader]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @description
|
|
323
|
+
* A text input sized for the sidebar, composing `monaTextBox`. Stands down on the icon rail,
|
|
324
|
+
* where there is no room to type.
|
|
325
|
+
*/
|
|
326
|
+
declare class SidebarInputDirective {
|
|
327
|
+
#private;
|
|
328
|
+
protected readonly baseClass: string;
|
|
329
|
+
protected readonly hidden: _angular_core.Signal<boolean>;
|
|
330
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarInputDirective, never>;
|
|
331
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarInputDirective, "input[monaSidebarInput]", never, {}, {}, never, never, true, [{ directive: typeof i1$1.TextBoxDirective; inputs: {}; outputs: {}; }]>;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @description
|
|
336
|
+
* Marks the main region beside the sidebar. Fills the remaining width and scrolls independently.
|
|
337
|
+
* Takes on the raised surface when the sidebar uses the `inset` variant.
|
|
338
|
+
*
|
|
339
|
+
* It sits beside the sidebars rather than inside one, so it answers to the layout as a whole: it steps
|
|
340
|
+
* out of the way for whichever drawer is open, and where a layout holds more than one sidebar it takes
|
|
341
|
+
* its surface from the first one in author order.
|
|
342
|
+
*/
|
|
343
|
+
declare class SidebarInsetDirective {
|
|
344
|
+
#private;
|
|
345
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
346
|
+
protected readonly behindDrawer: _angular_core.Signal<boolean>;
|
|
347
|
+
/**
|
|
348
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
349
|
+
* @default ""
|
|
350
|
+
*/
|
|
351
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
352
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarInsetDirective, never>;
|
|
353
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarInsetDirective, "[monaSidebarInset]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @description
|
|
358
|
+
* A trailing control on a menu item — an overflow menu, a pin. Sits inside the row's highlight and
|
|
359
|
+
* stands down on the icon rail. Give it an `aria-label`: it is icon-only.
|
|
360
|
+
*/
|
|
361
|
+
declare class SidebarMenuActionDirective {
|
|
362
|
+
#private;
|
|
363
|
+
protected readonly baseClass: string;
|
|
364
|
+
protected readonly hidden: _angular_core.Signal<boolean>;
|
|
365
|
+
constructor();
|
|
366
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMenuActionDirective, never>;
|
|
367
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarMenuActionDirective, "button[monaSidebarMenuAction]", never, {}, {}, never, never, true, [{ directive: typeof i1$2.ButtonDirective; inputs: {}; outputs: {}; }]>;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* @description
|
|
372
|
+
* A trailing count or status badge on a menu item. Stands down on the icon rail, where it would
|
|
373
|
+
* crowd out the icon it belongs to.
|
|
374
|
+
*/
|
|
375
|
+
declare class SidebarMenuBadgeDirective {
|
|
376
|
+
#private;
|
|
377
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
378
|
+
/**
|
|
379
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
380
|
+
* @default ""
|
|
381
|
+
*/
|
|
382
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
383
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMenuBadgeDirective, never>;
|
|
384
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarMenuBadgeDirective, "[monaSidebarMenuBadge]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
declare class SidebarMenuDirective {
|
|
388
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
389
|
+
/**
|
|
390
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
391
|
+
* @default ""
|
|
392
|
+
*/
|
|
393
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
394
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMenuDirective, never>;
|
|
395
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarMenuDirective, "ul[monaSidebarMenu]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* How much room the button's leading visual needs.
|
|
400
|
+
*
|
|
401
|
+
* - `medium` — sized for an icon, which the icon rail insets so it sits centred in the square.
|
|
402
|
+
* - `large` — sized for a full-height visual such as an avatar, which fills the rail square edge to
|
|
403
|
+
* edge, and which is given a taller row while the sidebar is expanded.
|
|
404
|
+
*/
|
|
405
|
+
type SidebarMenuButtonSize = "medium" | "large";
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* @description
|
|
409
|
+
* A row in a sidebar menu. Applies to a `button` for an action and to an `a` for a destination —
|
|
410
|
+
* an anchor keeps `href`, `routerLink`, middle-click, open-in-new-tab and the browser's own status
|
|
411
|
+
* bar preview, none of which a button can offer.
|
|
412
|
+
*
|
|
413
|
+
* On a compact viewport, following a link closes the drawer, since the destination it navigates to is
|
|
414
|
+
* underneath it.
|
|
415
|
+
*/
|
|
416
|
+
declare class SidebarMenuButtonDirective {
|
|
417
|
+
#private;
|
|
418
|
+
protected readonly ariaDisabled: _angular_core.Signal<"true" | null>;
|
|
419
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
420
|
+
/**
|
|
421
|
+
* Marks the row the user is currently on. `page` regardless of host element: `active` describes a
|
|
422
|
+
* destination, and a sidebar built from buttons rather than anchors is still a set of destinations
|
|
423
|
+
* as far as a screen reader is concerned.
|
|
424
|
+
*/
|
|
425
|
+
protected readonly current: _angular_core.Signal<"page" | null>;
|
|
426
|
+
protected readonly nativeDisabled: _angular_core.Signal<"" | null>;
|
|
427
|
+
/**
|
|
428
|
+
* On the rail the row becomes a square exactly the size of its leading visual and clips its own
|
|
429
|
+
* overflow, so any label is pushed out of view instead of competing for space.
|
|
430
|
+
*/
|
|
431
|
+
protected readonly railBox: _angular_core.Signal<boolean>;
|
|
432
|
+
protected readonly railTitle: _angular_core.Signal<string | null>;
|
|
433
|
+
protected readonly tabIndex: _angular_core.Signal<0 | null>;
|
|
434
|
+
protected readonly type: string | null;
|
|
435
|
+
/**
|
|
436
|
+
* @description Closes the overlay drawer after this row is activated. Only applies on compact
|
|
437
|
+
* viewports, where the drawer covers the destination being navigated to. Set to `false` for rows
|
|
438
|
+
* that do not navigate, such as a disclosure trigger.
|
|
439
|
+
* @default true
|
|
440
|
+
*/
|
|
441
|
+
readonly closeOnSelect: _angular_core.InputSignal<boolean>;
|
|
442
|
+
/**
|
|
443
|
+
* @description Renders the row as unavailable and suppresses activation.
|
|
444
|
+
* @default false
|
|
445
|
+
*/
|
|
446
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
447
|
+
/**
|
|
448
|
+
* @description How much room this row's leading visual needs. Use `"large"` when it opens with
|
|
449
|
+
* something avatar sized, so the icon rail lets it fill the square instead of insetting and clipping it.
|
|
450
|
+
* @default "medium"
|
|
451
|
+
*/
|
|
452
|
+
readonly size: _angular_core.InputSignal<SidebarMenuButtonSize>;
|
|
453
|
+
/**
|
|
454
|
+
* @description Text identifying this item while the sidebar is collapsed to its icon rail, where the
|
|
455
|
+
* label is clipped away. Applied as the host's `title`, so the browser surfaces it on hover, and an
|
|
456
|
+
* ancestor carrying `monaTooltip` with `mode="content"` renders it as a styled tooltip instead.
|
|
457
|
+
* @default ""
|
|
458
|
+
*/
|
|
459
|
+
readonly tooltip: _angular_core.InputSignal<string>;
|
|
460
|
+
/**
|
|
461
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
462
|
+
* @default ""
|
|
463
|
+
*/
|
|
464
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
465
|
+
protected onClick(event: Event): void;
|
|
466
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMenuButtonDirective, never>;
|
|
467
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarMenuButtonDirective, "a[monaSidebarMenuButton], button[monaSidebarMenuButton]", ["monaSidebarMenuButton"], { "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
declare class SidebarMenuItemDirective {
|
|
471
|
+
#private;
|
|
472
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
473
|
+
/**
|
|
474
|
+
* @description Marks this row as the current sidebar destination. The row owns the selected
|
|
475
|
+
* surface so trailing badges and actions remain inside one continuous highlight.
|
|
476
|
+
* @default false
|
|
477
|
+
*/
|
|
478
|
+
readonly active: _angular_core.InputSignal<boolean>;
|
|
479
|
+
/**
|
|
480
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
481
|
+
* @default ""
|
|
482
|
+
*/
|
|
483
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
484
|
+
constructor();
|
|
485
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMenuItemDirective, never>;
|
|
486
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarMenuItemDirective, "li[monaSidebarMenuItem]", never, { "active": { "alias": "active"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* @description
|
|
491
|
+
* An indented submenu inside a `monaSidebarMenuItem` that is also a `monaCollapsible`.
|
|
492
|
+
*
|
|
493
|
+
* It carries no hiding of its own on the icon rail. `SidebarMenuItemDirective` closes the disclosure
|
|
494
|
+
* there instead, which leaves the trigger's `aria-expanded` truthful and lets the collapsible content
|
|
495
|
+
* directive apply its own `inert`. Hiding it here as well used to produce the opposite: a submenu the
|
|
496
|
+
* trigger still described as expanded, with focusable items, that nobody could see.
|
|
497
|
+
*/
|
|
498
|
+
declare class SidebarMenuSubDirective {
|
|
499
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
500
|
+
/**
|
|
501
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
502
|
+
* @default ""
|
|
503
|
+
*/
|
|
504
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
505
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMenuSubDirective, never>;
|
|
506
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarMenuSubDirective, "ul[monaSidebarMenuSub]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* @description
|
|
511
|
+
* A thin strip along the sidebar's inner edge that toggles it. Place it inside `mona-sidebar`,
|
|
512
|
+
* which positions it. Hidden on narrow viewports, where the edge is too easy to hit by accident.
|
|
513
|
+
*
|
|
514
|
+
* Deliberately outside the tab order: it is a pointer shortcut for what `monaSidebarTrigger` already
|
|
515
|
+
* does, and a second tab stop onto an unlabelled 4px strip would be noise for keyboard users. Provide
|
|
516
|
+
* a `monaSidebarTrigger` as well — the rail is not a substitute for it — and give the rail an
|
|
517
|
+
* `aria-label` so pointer users of assistive technology can still identify it.
|
|
518
|
+
*/
|
|
519
|
+
declare class SidebarRailDirective {
|
|
520
|
+
#private;
|
|
521
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
522
|
+
protected readonly expanded: _angular_core.Signal<boolean>;
|
|
523
|
+
protected readonly sidebarId: _angular_core.Signal<string>;
|
|
524
|
+
protected onClick(): void;
|
|
525
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarRailDirective, never>;
|
|
526
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarRailDirective, "button[monaSidebarRail]", never, {}, {}, never, never, true, never>;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* @description
|
|
531
|
+
* A horizontal rule between sidebar regions. Tightens its inset on the icon rail.
|
|
532
|
+
*/
|
|
533
|
+
declare class SidebarSeparatorDirective {
|
|
534
|
+
#private;
|
|
535
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
536
|
+
/**
|
|
537
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
538
|
+
* @default ""
|
|
539
|
+
*/
|
|
540
|
+
readonly userClass: _angular_core.InputSignalWithTransform<string, ClassInputType>;
|
|
541
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarSeparatorDirective, never>;
|
|
542
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarSeparatorDirective, "[monaSidebarSeparator]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* @description
|
|
547
|
+
* Toggles a sidebar. Can be placed anywhere inside a `mona-sidebar-layout`, including in the inset,
|
|
548
|
+
* and adds no styling of its own.
|
|
549
|
+
*
|
|
550
|
+
* By default it drives the sidebar it is written inside. Set `for` to the id of a `mona-sidebar` to
|
|
551
|
+
* drive that one instead, which is what a trigger in a shared header needs when the layout holds more
|
|
552
|
+
* than one sidebar. A `for` that matches no sidebar leaves the trigger inert rather than throwing, so
|
|
553
|
+
* a sidebar that has not rendered yet does not take the page down with it.
|
|
554
|
+
*
|
|
555
|
+
* A `button` is the right host and needs nothing further. On any other element the directive supplies
|
|
556
|
+
* the rest of the button contract — `role`, a tab stop, and Enter/Space activation — so a `div` or
|
|
557
|
+
* `span` trigger is still operable by keyboard rather than silently mouse-only.
|
|
558
|
+
*/
|
|
559
|
+
declare class SidebarTriggerDirective {
|
|
560
|
+
#private;
|
|
561
|
+
protected readonly expanded: _angular_core.Signal<boolean | null>;
|
|
562
|
+
protected readonly role: string | null;
|
|
563
|
+
protected readonly sidebarId: _angular_core.Signal<string | null>;
|
|
564
|
+
protected readonly tabIndex: number | null;
|
|
565
|
+
protected readonly type: string | null;
|
|
566
|
+
/**
|
|
567
|
+
* @description Id of the `mona-sidebar` to toggle. Leave unset to toggle the sidebar this trigger
|
|
568
|
+
* is written inside.
|
|
569
|
+
* @default ""
|
|
570
|
+
*/
|
|
571
|
+
readonly for: _angular_core.InputSignal<string>;
|
|
572
|
+
protected onClick(): void;
|
|
573
|
+
protected onEnterKeydown(event: Event): void;
|
|
574
|
+
protected onSpaceKeydown(event: Event): void;
|
|
575
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarTriggerDirective, never>;
|
|
576
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SidebarTriggerDirective, "[monaSidebarTrigger]", ["monaSidebarTrigger"], { "for": { "alias": "for"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* The safe, read-and-command view of one sidebar, returned by `injectSidebar()`.
|
|
581
|
+
*
|
|
582
|
+
* Structural facts — side, variant, collapsible mode — are readable but not settable. They are
|
|
583
|
+
* authored as inputs on `mona-sidebar`, and letting a descendant write them would leave the service
|
|
584
|
+
* and the component disagreeing about the same sidebar, with the component winning on the next
|
|
585
|
+
* change detection pass. Consumers who need them to change should bind the inputs.
|
|
586
|
+
*/
|
|
587
|
+
interface SidebarController {
|
|
588
|
+
/** Closes the sidebar. On a compact viewport this closes the drawer instead. */
|
|
589
|
+
collapse(): void;
|
|
590
|
+
/** How the sidebar behaves when collapsed, as authored on `mona-sidebar`. */
|
|
591
|
+
readonly collapsible: Signal<SidebarCollapsibleMode>;
|
|
592
|
+
/**
|
|
593
|
+
* Whether the viewport is narrow enough that the sidebar presents as an overlay drawer rather
|
|
594
|
+
* than as a column in the layout.
|
|
595
|
+
*/
|
|
596
|
+
readonly compact: Signal<boolean>;
|
|
597
|
+
/** Opens the sidebar. On a compact viewport this opens the drawer instead. */
|
|
598
|
+
expand(): void;
|
|
599
|
+
/**
|
|
600
|
+
* Whether the sidebar is showing at full width. On a compact viewport this reports the drawer's
|
|
601
|
+
* state, so a single binding drives both presentations.
|
|
602
|
+
*/
|
|
603
|
+
readonly expanded: Signal<boolean>;
|
|
604
|
+
/**
|
|
605
|
+
* Whether the sidebar is currently reduced to its icon rail, meaning parts that only make sense
|
|
606
|
+
* at full width — labels, trailing actions, submenus — should step aside. Never true while
|
|
607
|
+
* compact, where the drawer always presents at full width.
|
|
608
|
+
*/
|
|
609
|
+
readonly iconOnly: Signal<boolean>;
|
|
610
|
+
/** Whether the overlay drawer is open. Only meaningful while `compact` is true. */
|
|
611
|
+
readonly mobileOpen: Signal<boolean>;
|
|
612
|
+
/** Which edge the sidebar sits on, resolved to a direction-relative side. */
|
|
613
|
+
readonly side: Signal<SidebarLogicalSide>;
|
|
614
|
+
/** The id of the sidebar element, for `aria-controls` on a custom trigger. */
|
|
615
|
+
readonly sidebarId: Signal<string>;
|
|
616
|
+
/** The expanded state as a string, for `data-state` bindings and styling hooks. */
|
|
617
|
+
readonly state: Signal<"expanded" | "collapsed">;
|
|
618
|
+
/** Flips the sidebar between open and closed, on whichever presentation is current. */
|
|
619
|
+
toggle(): void;
|
|
620
|
+
/** The visual treatment of the sidebar, as authored on `mona-sidebar`. */
|
|
621
|
+
readonly variant: Signal<SidebarVariant>;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Where a sidebar remembers whether it was left open. Supplied through `SIDEBAR_STORAGE`, and only
|
|
626
|
+
* ever consulted for a sidebar that was given a `persistKey`.
|
|
627
|
+
*
|
|
628
|
+
* Only the docked state is ever handed to it. A drawer on a compact viewport is deliberately never
|
|
629
|
+
* persisted: restoring one open would cover the page on load, in front of the content the reader
|
|
630
|
+
* asked for.
|
|
631
|
+
*/
|
|
632
|
+
interface SidebarStorage {
|
|
633
|
+
/**
|
|
634
|
+
* The remembered state for `key`, or `null` when nothing has been stored under it — including
|
|
635
|
+
* when this storage cannot answer, such as on the server. A `null` leaves the sidebar on whatever
|
|
636
|
+
* its `expanded` input says.
|
|
637
|
+
*/
|
|
638
|
+
read(key: string): boolean | null;
|
|
639
|
+
/** Records the docked state for `key`. Failing to store it must not throw. */
|
|
640
|
+
write(key: string, expanded: boolean): void;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Replaces where sidebars remember whether they were left open. The default is `localStorage`, which
|
|
645
|
+
* the server cannot read; supply a cookie- or request-backed storage here to have a server-rendered
|
|
646
|
+
* application render the remembered state rather than correcting it on hydration.
|
|
647
|
+
*/
|
|
648
|
+
declare function provideSidebarStorage(storage: SidebarStorage): EnvironmentProviders;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* The default `SidebarStorage`: `localStorage`, under the sidebar's `persistKey`.
|
|
652
|
+
*
|
|
653
|
+
* Reads report `null` anywhere `localStorage` cannot answer, and writes are dropped there. That
|
|
654
|
+
* covers the server, where there is no such thing, and a browser that refuses it — Safari's private
|
|
655
|
+
* mode throws on access rather than returning empty, and a full quota throws on write. None of that
|
|
656
|
+
* is worth taking an application down over: the sidebar simply opens the way its input says.
|
|
657
|
+
*
|
|
658
|
+
* A server-rendered application gets the default state in its markup and the remembered one on
|
|
659
|
+
* hydration, which shows as a flash. Storage that the server can read too — a cookie, or state
|
|
660
|
+
* transferred from the request — avoids it; supply it through `provideSidebarStorage()`.
|
|
661
|
+
*/
|
|
662
|
+
declare class LocalStorageSidebarStorage implements SidebarStorage {
|
|
663
|
+
#private;
|
|
664
|
+
/** Takes the value of `PLATFORM_ID`, which is a string in practice though typed loosely. */
|
|
665
|
+
constructor(platformId: string | object);
|
|
666
|
+
read(key: string): boolean | null;
|
|
667
|
+
write(key: string, expanded: boolean): void;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Where sidebars given a `persistKey` remember whether they were left open. Defaults to
|
|
672
|
+
* `localStorage`. Replace it with `provideSidebarStorage()` — with something the server can read too,
|
|
673
|
+
* for an application that renders there.
|
|
674
|
+
*/
|
|
675
|
+
declare const SIDEBAR_STORAGE: InjectionToken<SidebarStorage>;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* @description
|
|
679
|
+
* Reads the sidebar that encloses the calling component or directive. Must be called from an
|
|
680
|
+
* injection context inside a `mona-sidebar-layout`.
|
|
681
|
+
*
|
|
682
|
+
* Returns the sidebar's state and the commands that are safe to issue from anywhere — opening,
|
|
683
|
+
* closing and toggling, each routed to whichever presentation is current. Structural facts such as
|
|
684
|
+
* the side, variant and collapsible mode are readable but not settable; those are authored as inputs
|
|
685
|
+
* on `mona-sidebar`, and writing them from a descendant would only desynchronise the two.
|
|
686
|
+
*
|
|
687
|
+
* @param options.optional Returns `null` instead of throwing when there is no enclosing layout.
|
|
688
|
+
*/
|
|
689
|
+
declare function injectSidebar(): SidebarController;
|
|
690
|
+
declare function injectSidebar(options: {
|
|
691
|
+
optional: true;
|
|
692
|
+
}): SidebarController | null;
|
|
693
|
+
|
|
694
|
+
export { LocalStorageSidebarStorage, SIDEBAR_STORAGE, SidebarComponent, SidebarContentDirective, SidebarFooterDirective, SidebarGroupActionDirective, SidebarGroupContentDirective, SidebarGroupDirective, SidebarGroupHeaderDirective, SidebarGroupLabelDirective, SidebarHeaderDirective, SidebarInputDirective, SidebarInsetDirective, SidebarLayoutComponent, SidebarMenuActionDirective, SidebarMenuBadgeDirective, SidebarMenuButtonDirective, SidebarMenuDirective, SidebarMenuItemDirective, SidebarMenuSkeletonComponent, SidebarMenuSubDirective, SidebarRailDirective, SidebarSeparatorDirective, SidebarTriggerDirective, injectSidebar, provideSidebarStorage };
|
|
695
|
+
export type { SidebarCollapsibleMode, SidebarController, SidebarLogicalSide, SidebarMenuButtonSize, SidebarSide, SidebarStorage, SidebarVariant };
|