frontile 0.18.6 → 0.18.8
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/declarations/-private/icons.d.ts +4 -0
- package/declarations/-private/icons.d.ts.map +1 -1
- package/declarations/components/buttons/chip.d.ts +2 -3
- package/declarations/components/buttons/chip.d.ts.map +1 -1
- package/declarations/components/collections/dropdown/dropdown.d.ts +50 -53
- package/declarations/components/collections/dropdown/dropdown.d.ts.map +1 -1
- package/declarations/components/collections/listbox/item.d.ts +52 -1
- package/declarations/components/collections/listbox/item.d.ts.map +1 -1
- package/declarations/components/forms/form.d.ts +3 -2
- package/declarations/components/forms/form.d.ts.map +1 -1
- package/declarations/components/forms/native-select.d.ts.map +1 -1
- package/declarations/components/forms/select/select.d.ts +17 -0
- package/declarations/components/forms/select/select.d.ts.map +1 -1
- package/declarations/components/forms/select/trigger.d.ts +8 -0
- package/declarations/components/forms/select/trigger.d.ts.map +1 -1
- package/declarations/components/forms/select/types.d.ts +8 -4
- package/declarations/components/forms/select/types.d.ts.map +1 -1
- package/declarations/components/layout/app-layout-state.d.ts +32 -0
- package/declarations/components/layout/app-layout-state.d.ts.map +1 -0
- package/declarations/components/layout/app-layout.d.ts +1298 -0
- package/declarations/components/layout/app-layout.d.ts.map +1 -0
- package/declarations/components/layout/aside-toggle.d.ts +55 -0
- package/declarations/components/layout/aside-toggle.d.ts.map +1 -0
- package/declarations/components/layout/aside.d.ts +1055 -0
- package/declarations/components/layout/aside.d.ts.map +1 -0
- package/declarations/components/layout/bottom-nav-more.d.ts +123 -0
- package/declarations/components/layout/bottom-nav-more.d.ts.map +1 -0
- package/declarations/components/layout/bottom-nav.d.ts +60 -0
- package/declarations/components/layout/bottom-nav.d.ts.map +1 -0
- package/declarations/components/layout/context.d.ts +143 -0
- package/declarations/components/layout/context.d.ts.map +1 -0
- package/declarations/components/layout/index.d.ts +14 -0
- package/declarations/components/layout/index.d.ts.map +1 -0
- package/declarations/components/layout/main.d.ts +28 -0
- package/declarations/components/layout/main.d.ts.map +1 -0
- package/declarations/components/layout/menu-toggle.d.ts +58 -0
- package/declarations/components/layout/menu-toggle.d.ts.map +1 -0
- package/declarations/components/layout/nav-context.d.ts +45 -0
- package/declarations/components/layout/nav-context.d.ts.map +1 -0
- package/declarations/components/layout/nav-folder.d.ts +216 -0
- package/declarations/components/layout/nav-folder.d.ts.map +1 -0
- package/declarations/components/layout/nav-item.d.ts +220 -0
- package/declarations/components/layout/nav-item.d.ts.map +1 -0
- package/declarations/components/layout/nav-link.d.ts +67 -0
- package/declarations/components/layout/nav-link.d.ts.map +1 -0
- package/declarations/components/layout/navbar.d.ts +1028 -0
- package/declarations/components/layout/navbar.d.ts.map +1 -0
- package/declarations/components/layout/page-header.d.ts +40 -0
- package/declarations/components/layout/page-header.d.ts.map +1 -0
- package/declarations/components/layout/sidebar-group.d.ts +41 -0
- package/declarations/components/layout/sidebar-group.d.ts.map +1 -0
- package/declarations/components/layout/sidebar-toggle.d.ts +71 -0
- package/declarations/components/layout/sidebar-toggle.d.ts.map +1 -0
- package/declarations/components/layout/sidebar.d.ts +1215 -0
- package/declarations/components/layout/sidebar.d.ts.map +1 -0
- package/declarations/components/navigation/index.d.ts +1 -0
- package/declarations/components/navigation/index.d.ts.map +1 -1
- package/declarations/components/navigation/stepper/collapse-menu.d.ts +42 -0
- package/declarations/components/navigation/stepper/collapse-menu.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/list.d.ts +24 -0
- package/declarations/components/navigation/stepper/list.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/panel.d.ts +42 -0
- package/declarations/components/navigation/stepper/panel.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/step.d.ts +123 -0
- package/declarations/components/navigation/stepper/step.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/stepper.d.ts +947 -0
- package/declarations/components/navigation/stepper/stepper.d.ts.map +1 -0
- package/declarations/components/navigation/stepper.d.ts +6 -0
- package/declarations/components/navigation/stepper.d.ts.map +1 -0
- package/declarations/components/navigation/tab-nav/item.d.ts +2 -2
- package/declarations/components/navigation/tab-nav/item.d.ts.map +1 -1
- package/declarations/components/overlays/portal.d.ts.map +1 -1
- package/declarations/components/status/badge.d.ts +83 -0
- package/declarations/components/status/badge.d.ts.map +1 -0
- package/declarations/components/status/index.d.ts +1 -0
- package/declarations/components/status/index.d.ts.map +1 -1
- package/declarations/components/utilities/collapsible.d.ts +19 -2
- package/declarations/components/utilities/collapsible.d.ts.map +1 -1
- package/declarations/index.d.ts +1 -0
- package/declarations/index.d.ts.map +1 -1
- package/declarations/layout.d.ts +2 -0
- package/declarations/layout.d.ts.map +1 -0
- package/declarations/utils/breakpoint.d.ts +16 -0
- package/declarations/utils/breakpoint.d.ts.map +1 -0
- package/declarations/utils/document-listener.d.ts +6 -0
- package/declarations/utils/document-listener.d.ts.map +1 -0
- package/declarations/utils/listManager.d.ts +7 -1
- package/declarations/utils/listManager.d.ts.map +1 -1
- package/declarations/utils/route-active.d.ts +34 -0
- package/declarations/utils/route-active.d.ts.map +1 -0
- package/declarations/utils/selection-indicator.d.ts +7 -4
- package/declarations/utils/selection-indicator.d.ts.map +1 -1
- package/dist/components/buttons/chip.js +12 -1
- package/dist/components/buttons/chip.js.map +1 -1
- package/dist/components/collections/calendar/header.js +1 -1
- package/dist/components/collections/dropdown/dropdown.js +172 -48
- package/dist/components/collections/dropdown/dropdown.js.map +1 -1
- package/dist/components/collections/listbox/item.js +36 -2
- package/dist/components/collections/listbox/item.js.map +1 -1
- package/dist/components/collections/table/column-visibility.js +1 -1
- package/dist/components/collections/table/sort-button.js +1 -1
- package/dist/components/disclosure/accordion/item.js +1 -1
- package/dist/components/forms/autocomplete.js +1 -1
- package/dist/components/forms/date-picker/end-content.js +1 -1
- package/dist/components/forms/form.js.map +1 -1
- package/dist/components/forms/native-select.js +2 -2
- package/dist/components/forms/native-select.js.map +1 -1
- package/dist/components/forms/select/end-content.js +1 -1
- package/dist/components/forms/select/select.js +3 -2
- package/dist/components/forms/select/select.js.map +1 -1
- package/dist/components/forms/select/trigger.js +1 -1
- package/dist/components/forms/select/trigger.js.map +1 -1
- package/dist/components/layout/app-layout-state.js +64 -0
- package/dist/components/layout/app-layout-state.js.map +1 -0
- package/dist/components/layout/app-layout.js +441 -0
- package/dist/components/layout/app-layout.js.map +1 -0
- package/dist/components/layout/aside-toggle.js +55 -0
- package/dist/components/layout/aside-toggle.js.map +1 -0
- package/dist/components/layout/aside.js +98 -0
- package/dist/components/layout/aside.js.map +1 -0
- package/dist/components/layout/bottom-nav-more.js +150 -0
- package/dist/components/layout/bottom-nav-more.js.map +1 -0
- package/dist/components/layout/bottom-nav.js +65 -0
- package/dist/components/layout/bottom-nav.js.map +1 -0
- package/dist/components/layout/context.js +103 -0
- package/dist/components/layout/context.js.map +1 -0
- package/dist/components/layout/index.js +14 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/main.js +34 -0
- package/dist/components/layout/main.js.map +1 -0
- package/dist/components/layout/menu-toggle.js +61 -0
- package/dist/components/layout/menu-toggle.js.map +1 -0
- package/dist/components/layout/nav-context.js +85 -0
- package/dist/components/layout/nav-context.js.map +1 -0
- package/dist/components/layout/nav-folder.js +271 -0
- package/dist/components/layout/nav-folder.js.map +1 -0
- package/dist/components/layout/nav-item.js +192 -0
- package/dist/components/layout/nav-item.js.map +1 -0
- package/dist/components/layout/nav-link.js +58 -0
- package/dist/components/layout/nav-link.js.map +1 -0
- package/dist/components/layout/navbar.js +51 -0
- package/dist/components/layout/navbar.js.map +1 -0
- package/dist/components/layout/page-header.js +45 -0
- package/dist/components/layout/page-header.js.map +1 -0
- package/dist/components/layout/sidebar-group.js +41 -0
- package/dist/components/layout/sidebar-group.js.map +1 -0
- package/dist/components/layout/sidebar-toggle.js +82 -0
- package/dist/components/layout/sidebar-toggle.js.map +1 -0
- package/dist/components/layout/sidebar.js +252 -0
- package/dist/components/layout/sidebar.js.map +1 -0
- package/dist/components/navigation/breadcrumbs/separator.js +1 -1
- package/dist/components/navigation/index.js +4 -0
- package/dist/components/navigation/index.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +1 -1
- package/dist/components/navigation/stepper/collapse-menu.js +128 -0
- package/dist/components/navigation/stepper/collapse-menu.js.map +1 -0
- package/dist/components/navigation/stepper/list.js +17 -0
- package/dist/components/navigation/stepper/list.js.map +1 -0
- package/dist/components/navigation/stepper/panel.js +26 -0
- package/dist/components/navigation/stepper/panel.js.map +1 -0
- package/dist/components/navigation/stepper/step.js +130 -0
- package/dist/components/navigation/stepper/step.js.map +1 -0
- package/dist/components/navigation/stepper/stepper.js +475 -0
- package/dist/components/navigation/stepper/stepper.js.map +1 -0
- package/dist/components/navigation/stepper.js +5 -0
- package/dist/components/navigation/stepper.js.map +1 -0
- package/dist/components/navigation/tab-nav/item.js +6 -40
- package/dist/components/navigation/tab-nav/item.js.map +1 -1
- package/dist/components/notifications/index.js +1 -1
- package/dist/components/notifications/notification-card.js +2 -2
- package/dist/components/notifications/notifications-container.js +1 -1
- package/dist/components/overlays/portal.js +11 -2
- package/dist/components/overlays/portal.js.map +1 -1
- package/dist/components/status/alert.js +1 -1
- package/dist/components/status/badge.js +52 -0
- package/dist/components/status/badge.js.map +1 -0
- package/dist/components/status/index.js +1 -0
- package/dist/components/status/index.js.map +1 -1
- package/dist/components/utilities/collapsible.js +33 -5
- package/dist/components/utilities/collapsible.js.map +1 -1
- package/dist/{icons-DZ61nCzv.js → icons-55dthVFk.js} +14 -2
- package/dist/{icons-DZ61nCzv.js.map → icons-55dthVFk.js.map} +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.js +14 -0
- package/dist/layout.js.map +1 -0
- package/dist/navigation.js +4 -0
- package/dist/navigation.js.map +1 -1
- package/dist/{notification-card-dz-eE6z9.js → notification-card-BPfDo-Gf.js} +2 -2
- package/dist/{notification-card-dz-eE6z9.js.map → notification-card-BPfDo-Gf.js.map} +1 -1
- package/dist/notifications.js +1 -1
- package/dist/status.js +1 -0
- package/dist/status.js.map +1 -1
- package/dist/utils/breakpoint.js +56 -0
- package/dist/utils/breakpoint.js.map +1 -0
- package/dist/utils/document-listener.js +10 -0
- package/dist/utils/document-listener.js.map +1 -0
- package/dist/utils/listManager.js +12 -2
- package/dist/utils/listManager.js.map +1 -1
- package/dist/utils/route-active.js +70 -0
- package/dist/utils/route-active.js.map +1 -0
- package/dist/utils/selection-indicator.js +25 -5
- package/dist/utils/selection-indicator.js.map +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import NavItem from './nav-item';
|
|
3
|
+
import { NavItemRegistry } from './nav-context';
|
|
4
|
+
import type { NavFolderContext, NavItemHandle } from './nav-context';
|
|
5
|
+
import type { ComponentLike, WithBoundArgs } from '@glint/template';
|
|
6
|
+
interface NavFolderArgs {
|
|
7
|
+
/** The folder's label, shown in its trigger. */
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* An icon component, shown before the label. It is hidden from assistive
|
|
11
|
+
* technology.
|
|
12
|
+
*/
|
|
13
|
+
icon?: ComponentLike;
|
|
14
|
+
/**
|
|
15
|
+
* Makes the open state controlled. Clicks then only call `@onOpenChange`,
|
|
16
|
+
* and so does an automatic open when a child becomes active.
|
|
17
|
+
*
|
|
18
|
+
* This is the inline open state. In the collapsed icon rail the folder
|
|
19
|
+
* opens as a menu instead, whose state is its own: `@open` does not
|
|
20
|
+
* control it and `@onOpenChange` is not called for it. The inline state
|
|
21
|
+
* still follows an active child there, and shows on expanding.
|
|
22
|
+
*/
|
|
23
|
+
open?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The initial open state when `@open` is not given.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue false
|
|
28
|
+
*/
|
|
29
|
+
defaultOpen?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Called with the requested inline open state whenever it would change.
|
|
32
|
+
* Not called when the menu of the collapsed icon rail opens or closes.
|
|
33
|
+
*/
|
|
34
|
+
onOpenChange?: (open: boolean) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Hides the folder. A folder is also hidden when none of its items is
|
|
37
|
+
* visible.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue false
|
|
40
|
+
*/
|
|
41
|
+
isHidden?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Class names added to the folder's root element. Merged with Tailwind
|
|
44
|
+
* Merge, so a class that conflicts with a theme class wins.
|
|
45
|
+
*/
|
|
46
|
+
class?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Supplied by `Sidebar`: whether the sidebar is drawn as the icon rail,
|
|
49
|
+
* where the folder opens as a menu. Not part of the public API.
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
rail?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Supplied by `Sidebar`: the side rail tooltips, and so the menu, open
|
|
56
|
+
* on. Not part of the public API.
|
|
57
|
+
*
|
|
58
|
+
* @defaultValue 'right'
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
tooltipPlacement?: 'left' | 'right';
|
|
62
|
+
/**
|
|
63
|
+
* Supplied by `Sidebar` while it renders in the mobile drawer: handed to
|
|
64
|
+
* each item so following one closes the drawer. Not part of the public API.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
onActivate?: () => void;
|
|
69
|
+
/**
|
|
70
|
+
* Supplied by `BottomNav.More`: the container this folder belongs to. The
|
|
71
|
+
* folder registers a handle with it that reports its children: active when
|
|
72
|
+
* a visible child is, hidden when the folder or every child is, badged
|
|
73
|
+
* when a visible child is. Not part of the public API.
|
|
74
|
+
*
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
parent?: NavFolderContext;
|
|
78
|
+
}
|
|
79
|
+
interface NavFolderSignature {
|
|
80
|
+
Args: NavFolderArgs;
|
|
81
|
+
Blocks: {
|
|
82
|
+
/** Yields `Item`, a `NavItem` that belongs to this folder. */
|
|
83
|
+
default: [
|
|
84
|
+
{
|
|
85
|
+
Item: WithBoundArgs<typeof NavItem, 'rail' | 'tooltipPlacement' | 'onActivate' | 'folder'>;
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
};
|
|
89
|
+
Element: HTMLDivElement;
|
|
90
|
+
}
|
|
91
|
+
interface FolderTriggerSignature {
|
|
92
|
+
Args: {
|
|
93
|
+
label: string;
|
|
94
|
+
icon?: ComponentLike;
|
|
95
|
+
isOpen: boolean;
|
|
96
|
+
isActive: boolean;
|
|
97
|
+
classes: {
|
|
98
|
+
navFolderTrigger: string;
|
|
99
|
+
navItemIcon: string;
|
|
100
|
+
navItemLabel: string;
|
|
101
|
+
navFolderChevron: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
Element: HTMLAnchorElement | HTMLButtonElement;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A collapsible group of navigation items, one level deep. The trigger is a
|
|
108
|
+
* disclosure button (`aria-expanded`, `aria-controls`); the items sit in a
|
|
109
|
+
* `role="group"` panel labelled by it. The folder opens when
|
|
110
|
+
* one of its items is active, on load and whenever an item newly becomes
|
|
111
|
+
* active, but never forces itself open otherwise. It is hidden when none of
|
|
112
|
+
* its items is visible.
|
|
113
|
+
*
|
|
114
|
+
* In the collapsed icon rail (not in the mobile drawer) the trigger is a
|
|
115
|
+
* `Dropdown` menu button instead, and the items are the menu's link items,
|
|
116
|
+
* beside the rail. The menu brings the keyboard model (arrows, type-ahead,
|
|
117
|
+
* Escape returning focus to the trigger); tabbing out of it or following an
|
|
118
|
+
* item closes it.
|
|
119
|
+
*/
|
|
120
|
+
declare class NavFolder extends Component<NavFolderSignature> {
|
|
121
|
+
#private;
|
|
122
|
+
/** The registered items; see `NavItemRegistry`. */
|
|
123
|
+
registry: NavItemRegistry;
|
|
124
|
+
internalOpen: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* The rail menu's open state, separate from the inline one so neither
|
|
127
|
+
* disturbs the other. Only honored in the rail; see `isMenuOpen`.
|
|
128
|
+
*/
|
|
129
|
+
menuOpen: boolean;
|
|
130
|
+
/** Whether the rail trigger's tooltip would be open; see `isTooltipShown`. */
|
|
131
|
+
tooltipOpen: boolean;
|
|
132
|
+
constructor(owner: unknown, args: NavFolderSignature['Args']);
|
|
133
|
+
get visibleItems(): NavItemHandle[];
|
|
134
|
+
/** A hidden item never makes the folder active. */
|
|
135
|
+
get hasActiveDescendant(): boolean;
|
|
136
|
+
/** Hidden by `@isHidden`, or because no item is visible (or there is none). */
|
|
137
|
+
get isFolderHidden(): true | undefined;
|
|
138
|
+
get isControlled(): boolean;
|
|
139
|
+
/** The inline open state, whatever the sidebar's shape. */
|
|
140
|
+
get isOpen(): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* In the icon rail the items sit in a menu. `rail` is never set inside the
|
|
143
|
+
* mobile drawer, which is always expanded, so the folder is inline there.
|
|
144
|
+
*/
|
|
145
|
+
get isMenuMode(): boolean;
|
|
146
|
+
get isMenuOpen(): boolean;
|
|
147
|
+
/** What the folder reports as open: the menu in the rail, else the panel. */
|
|
148
|
+
get isExpanded(): boolean;
|
|
149
|
+
/** A collapsed panel keeps its links out of the tab order. */
|
|
150
|
+
get inert(): true | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* The rail trigger is only an icon, so it shows its label as a tooltip,
|
|
153
|
+
* with no delay like the rail items beside it, but never over its open
|
|
154
|
+
* menu. Two guards, because the tooltip can open in the same event that
|
|
155
|
+
* opens the menu (a click focuses the trigger first, and a keyboard focus
|
|
156
|
+
* opens a no-delay tooltip at once): opening the menu closes the tooltip,
|
|
157
|
+
* and while the menu is open the tooltip's own requests to open are
|
|
158
|
+
* ignored. Its listeners stay installed, so a pointer leaving the trigger
|
|
159
|
+
* meanwhile is still heard.
|
|
160
|
+
*/
|
|
161
|
+
get isTooltipShown(): boolean;
|
|
162
|
+
setTooltipOpen: (open: boolean) => void;
|
|
163
|
+
setMenuOpen: (open: boolean) => void;
|
|
164
|
+
/**
|
|
165
|
+
* Tab (either way) in the open menu closes it; the menu hands focus back
|
|
166
|
+
* to the trigger, so the next Tab moves on from there. Without this the
|
|
167
|
+
* menu's focus trap would keep focus cycling inside it.
|
|
168
|
+
*/
|
|
169
|
+
closeMenuOnTab: (event: KeyboardEvent) => void;
|
|
170
|
+
/**
|
|
171
|
+
* The menu beside the rail: toward the content, top edges aligned. Flips
|
|
172
|
+
* for an end sidebar, whose tooltips open on the left.
|
|
173
|
+
*/
|
|
174
|
+
get menuPlacement(): 'left-start' | 'right-start';
|
|
175
|
+
setOpen(open: boolean): void;
|
|
176
|
+
toggle: () => void;
|
|
177
|
+
/**
|
|
178
|
+
* Leaving the rail (expanding the sidebar) removes the menu with the
|
|
179
|
+
* `Dropdown` around it, so it also resets the rail state: the next
|
|
180
|
+
* collapse starts closed. Deferred: this runs during render, which has
|
|
181
|
+
* already read the state.
|
|
182
|
+
*/
|
|
183
|
+
resetOutsideRail: import("ember-modifier").FunctionBasedModifier<{
|
|
184
|
+
Args: {
|
|
185
|
+
Positional: [boolean];
|
|
186
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
187
|
+
};
|
|
188
|
+
Element: HTMLElement;
|
|
189
|
+
}>;
|
|
190
|
+
/**
|
|
191
|
+
* Opens the folder when an item *newly* becomes active: on load (the first
|
|
192
|
+
* time an active item is seen) and after a later transition into one.
|
|
193
|
+
* Re-renders that leave it active do nothing, so a folder the user closed
|
|
194
|
+
* stays closed. Deferred to after render, where changing state is safe.
|
|
195
|
+
*/
|
|
196
|
+
followActive: import("ember-modifier").FunctionBasedModifier<{
|
|
197
|
+
Args: {
|
|
198
|
+
Positional: [boolean];
|
|
199
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
200
|
+
};
|
|
201
|
+
Element: HTMLElement;
|
|
202
|
+
}>;
|
|
203
|
+
get triggerId(): string;
|
|
204
|
+
get panelId(): string;
|
|
205
|
+
get classes(): {
|
|
206
|
+
navFolder: string;
|
|
207
|
+
navFolderPanel: string;
|
|
208
|
+
};
|
|
209
|
+
/** The slots of the folder's trigger, with the icon and label of a row. */
|
|
210
|
+
get triggerClasses(): FolderTriggerSignature['Args']['classes'];
|
|
211
|
+
/** Merged, so a consumer class wins over a conflicting theme class. */
|
|
212
|
+
get className(): string;
|
|
213
|
+
}
|
|
214
|
+
export { NavFolder, type NavFolderSignature, type NavFolderArgs };
|
|
215
|
+
export default NavFolder;
|
|
216
|
+
//# sourceMappingURL=nav-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-folder.d.ts","sourceRoot":"","sources":["../../../src/components/layout/nav-folder.gts"],"names":[],"mappings":"AAmhBA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAa3C,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEpE,UAAU,aAAa;IACrB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,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IrC;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,2DAA2D;IAC3D,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;OAGG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,6EAA6E;IAC7E,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,8DAA8D;IAC9D,IAAI,KAAK,IAAI,IAAI,GAAG,SAAS,CAE5B;IAED;;;;;;;;;OASG;IACH,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,cAAc,GAAI,MAAM,OAAO,KAAG,IAAI,CAEpC;IAEF,WAAW,GAAI,MAAM,OAAO,KAAG,IAAI,CAKjC;IAEF;;;;OAIG;IACH,cAAc,GAAI,OAAO,aAAa,KAAG,IAAI,CAK3C;IAEF;;;OAGG;IACH,IAAI,aAAa,IAAI,YAAY,GAAG,aAAa,CAEhD;IAED,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAO5B,MAAM,QAAO,IAAI,CAEf;IAEF;;;;;OAKG;IACH,gBAAgB;;;;;;OAUb;IAEH;;;;;OAKG;IACH,YAAY;;;;;;OAUT;IAEH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IACI,OAAO;;;MAMV;IAED,2EAA2E;IAC3E,IACI,cAAc,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAQ9D;IAED,uEAAuE;IACvE,IAAI,SAAS,IAAI,MAAM,CAEtB;CAkJF;AAED,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,CAAC;AAClE,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { NavFolderContext } from './nav-context';
|
|
3
|
+
import type { ListboxItem } from '../collections/listbox/item';
|
|
4
|
+
import type RouterService from '@ember/routing/router-service';
|
|
5
|
+
import type { ComponentLike, WithBoundArgs } from '@glint/template';
|
|
6
|
+
/** How the item lays out its icon and label. */
|
|
7
|
+
type NavItemLayout = 'inline' | 'stacked' | 'icon';
|
|
8
|
+
interface NavItemArgs {
|
|
9
|
+
/**
|
|
10
|
+
* Renders a `LinkTo` for this route and derives the active state from the
|
|
11
|
+
* router. Omit it (and pass `@href`) to stay entirely router-free.
|
|
12
|
+
*/
|
|
13
|
+
route?: string;
|
|
14
|
+
/** Dynamic segments for `@route`. */
|
|
15
|
+
models?: unknown[];
|
|
16
|
+
/** A single dynamic segment for `@route`. */
|
|
17
|
+
model?: unknown;
|
|
18
|
+
/** Query params for `@route`. */
|
|
19
|
+
query?: Record<string, unknown>;
|
|
20
|
+
/** Renders a plain anchor. Ignored when `@route` is given. */
|
|
21
|
+
href?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Overrides the active state. Always wins over anything derived from the
|
|
24
|
+
* router, and is the only source of truth when `@route` is not used.
|
|
25
|
+
*/
|
|
26
|
+
isActive?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Marks the link as disabled. The href is dropped as well, so the link
|
|
29
|
+
* cannot be followed; an item with neither `@href` nor `@route` is a
|
|
30
|
+
* button, which gets the native `disabled` attribute.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue false
|
|
33
|
+
*/
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Renders nothing at all. For items the current user may not see.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue false
|
|
39
|
+
*/
|
|
40
|
+
isHidden?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* An icon component, shown before the label. In the icon rail it is the
|
|
43
|
+
* only visible part of the item. It is hidden from assistive technology.
|
|
44
|
+
*/
|
|
45
|
+
icon?: ComponentLike;
|
|
46
|
+
/**
|
|
47
|
+
* How the item lays out its icon and label. `inline` puts the label beside
|
|
48
|
+
* the icon and follows the sidebar's icon rail; `stacked` puts a small label
|
|
49
|
+
* under the icon; `icon` shows the icon alone, with the label as a tooltip.
|
|
50
|
+
* `stacked` and `icon` ignore the sidebar's collapsed state.
|
|
51
|
+
*
|
|
52
|
+
* @defaultValue 'inline'
|
|
53
|
+
*/
|
|
54
|
+
layout?: NavItemLayout;
|
|
55
|
+
/**
|
|
56
|
+
* Shorter text shown in place of the label in the `stacked` layout. The
|
|
57
|
+
* full label stays the link's accessible name.
|
|
58
|
+
*/
|
|
59
|
+
shortLabel?: string;
|
|
60
|
+
/**
|
|
61
|
+
* A count or short status shown as a pill: at the end of the row, or on
|
|
62
|
+
* the icon's corner where only the icon shows (the collapsed rail, the
|
|
63
|
+
* stacked and icon layouts). Nothing is shown for `undefined`, `null`, `0`
|
|
64
|
+
* or an empty string.
|
|
65
|
+
*/
|
|
66
|
+
badge?: string | number;
|
|
67
|
+
/**
|
|
68
|
+
* Screen-reader text for the badge, read after the label. Defaults to the
|
|
69
|
+
* badge value.
|
|
70
|
+
*/
|
|
71
|
+
badgeLabel?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Class names added to this item's theme classes. Merged with Tailwind
|
|
74
|
+
* Merge, so a class that conflicts with a theme class wins.
|
|
75
|
+
*/
|
|
76
|
+
class?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Supplied by `Sidebar`: whether the sidebar is drawn as the icon rail.
|
|
79
|
+
* Not part of the public API.
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
rail?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Supplied by `Sidebar` (or `BottomNav`): the side of the item its
|
|
86
|
+
* tooltip opens on.
|
|
87
|
+
* Not part of the public API.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
tooltipPlacement?: 'left' | 'right' | 'top';
|
|
92
|
+
/**
|
|
93
|
+
* Supplied by `Sidebar` while it renders in the mobile drawer: called when
|
|
94
|
+
* the item's link is clicked, so the drawer closes. Not called for a
|
|
95
|
+
* disabled item. Not part of the public API.
|
|
96
|
+
*
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
onActivate?: () => void;
|
|
100
|
+
/**
|
|
101
|
+
* Supplied by `NavFolder`: the folder this item belongs to. The item
|
|
102
|
+
* registers itself with it so the folder can follow its active and hidden
|
|
103
|
+
* state. Not part of the public API.
|
|
104
|
+
*
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
folder?: NavFolderContext;
|
|
108
|
+
/**
|
|
109
|
+
* Supplied by `BottomNav.More`: shows the badge as a small dot with no
|
|
110
|
+
* text, whatever `@badge` is. `@badgeLabel` is its screen-reader text.
|
|
111
|
+
* Not part of the public API.
|
|
112
|
+
*
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
badgeDot?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Supplied by `BottomNav.More`: never shows the label as a tooltip, even
|
|
118
|
+
* in the `icon` layout. Not part of the public API.
|
|
119
|
+
*
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
noTooltip?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Supplied by `NavFolder` in the icon rail: the `Dropdown` menu's item
|
|
125
|
+
* component. The item then renders as a link row of that menu (a
|
|
126
|
+
* `role="menuitem"` holding the link) instead of a nav row. Not part of
|
|
127
|
+
* the public API.
|
|
128
|
+
*
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
menuItem?: WithBoundArgs<typeof ListboxItem, 'manager' | 'onLinkActivate'>;
|
|
132
|
+
/**
|
|
133
|
+
* Supplied by `NavFolder` in the icon rail: the item only registers with
|
|
134
|
+
* its folder and renders nothing, so the folder can follow its active state
|
|
135
|
+
* while its menu is closed. Not part of the public API.
|
|
136
|
+
*
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
registerOnly?: boolean;
|
|
140
|
+
}
|
|
141
|
+
interface NavItemSignature {
|
|
142
|
+
Args: NavItemArgs;
|
|
143
|
+
Blocks: {
|
|
144
|
+
/** The item's label. */
|
|
145
|
+
default: [];
|
|
146
|
+
};
|
|
147
|
+
Element: HTMLAnchorElement | HTMLButtonElement | HTMLLIElement;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* A styled navigation link. It takes the same routing arguments as
|
|
151
|
+
* `TabNav.Item`: `@route` renders a `LinkTo` and the router decides whether it
|
|
152
|
+
* is active; `@href` renders a plain anchor and needs no router. The active
|
|
153
|
+
* item carries `aria-current="page"`. In the icon rail the label is visually
|
|
154
|
+
* hidden but keeps naming the link, and shows as a tooltip on hover or focus.
|
|
155
|
+
*/
|
|
156
|
+
declare class NavItem extends Component<NavItemSignature> {
|
|
157
|
+
router: RouterService;
|
|
158
|
+
constructor(owner: unknown, args: NavItemSignature['Args']);
|
|
159
|
+
get layout(): NavItemLayout;
|
|
160
|
+
/** The item's theme slots for its layout. */
|
|
161
|
+
get classes(): {
|
|
162
|
+
navItem: string;
|
|
163
|
+
navItemIcon: string;
|
|
164
|
+
navItemLabel: string;
|
|
165
|
+
navItemShortLabel: string;
|
|
166
|
+
navItemBadge: string;
|
|
167
|
+
navItemBadgeLabel: string;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Only the inline layout follows the sidebar's collapsed state, which hides
|
|
171
|
+
* `[data-sidebar-label]` elements.
|
|
172
|
+
*/
|
|
173
|
+
get isInline(): true | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Where the badge sits: on the icon's corner when the icon is all there is
|
|
176
|
+
* to see (the stacked and icon layouts), at the row's end otherwise. An
|
|
177
|
+
* inline row with an icon moves it onto the icon in the collapsed rail.
|
|
178
|
+
*/
|
|
179
|
+
get badgePlacement(): 'icon' | 'end' | 'rail';
|
|
180
|
+
/** A badge inside the icon: the stacked and icon layouts. */
|
|
181
|
+
get badgeOnIcon(): boolean;
|
|
182
|
+
/** A badge after the label: every other row. */
|
|
183
|
+
get badgeAtEnd(): boolean;
|
|
184
|
+
get hasShortLabel(): boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Whether a badge is shown: not for `undefined`, `null`, `0` or `''`.
|
|
187
|
+
* Always for `@badgeDot`.
|
|
188
|
+
*/
|
|
189
|
+
get hasBadge(): boolean;
|
|
190
|
+
/** The label is not otherwise visible, so a tooltip names the item. */
|
|
191
|
+
get showTooltip(): boolean;
|
|
192
|
+
get badgeText(): string | number | undefined;
|
|
193
|
+
/** The pill's visible text: none for a dot. */
|
|
194
|
+
get badgeValue(): string | number | undefined;
|
|
195
|
+
/** The label and badge of a menu row, which shows its label at any size. */
|
|
196
|
+
get menuClasses(): {
|
|
197
|
+
navItemIcon: string;
|
|
198
|
+
navItemLabel: string;
|
|
199
|
+
navItemBadge: string;
|
|
200
|
+
navItemBadgeLabel: string;
|
|
201
|
+
};
|
|
202
|
+
/** Merged, so a consumer class wins over a conflicting theme class. */
|
|
203
|
+
get className(): string;
|
|
204
|
+
/** The row's key in a rail folder's menu. */
|
|
205
|
+
menuKey: string;
|
|
206
|
+
/**
|
|
207
|
+
* Whether the item is the current page, router included. Cached so the
|
|
208
|
+
* link, the folder's handle and a rail menu row share one router lookup.
|
|
209
|
+
*/
|
|
210
|
+
get isCurrent(): boolean;
|
|
211
|
+
/**
|
|
212
|
+
* In a rail folder's menu a disabled item is plain text: no link args, so
|
|
213
|
+
* there is nothing to follow.
|
|
214
|
+
*/
|
|
215
|
+
get menuLink(): Pick<NavItemArgs, 'href' | 'route'>;
|
|
216
|
+
activate: () => void;
|
|
217
|
+
}
|
|
218
|
+
export { NavItem, type NavItemSignature, type NavItemArgs, type NavItemLayout };
|
|
219
|
+
export default NavItem;
|
|
220
|
+
//# sourceMappingURL=nav-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-item.d.ts","sourceRoot":"","sources":["../../../src/components/layout/nav-item.gts"],"names":[],"mappings":"AAkdA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAU3C,OAAO,KA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G,SAAS,CAE3C;IAED,+CAA+C;IAC/C,IAAI,UAAU,IAAI,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5C;IAED,4EAA4E;IAC5E,IACI,WAAW;;;;;MAYd;IAED,uEAAuE;IACvE,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,6CAA6C;IAC7C,OAAO,SAAiB;IAExB;;;OAGG;IACH,IACI,SAAS,IAAI,OAAO,CAEvB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,CAKlD;IAED,QAAQ,QAAO,IAAI,CAIjB;CAmPH;AAED,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,CAAC;AAChF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { normalizeRouteArgs } from '../../utils/route-active';
|
|
3
|
+
import type RouterService from '@ember/routing/router-service';
|
|
4
|
+
interface NavLinkArgs {
|
|
5
|
+
/**
|
|
6
|
+
* Renders a `LinkTo` for this route and derives the active state from the
|
|
7
|
+
* router. Omit it (and pass `@href`) to stay entirely router-free.
|
|
8
|
+
*/
|
|
9
|
+
route?: string;
|
|
10
|
+
/** Dynamic segments for `@route`. */
|
|
11
|
+
models?: unknown[];
|
|
12
|
+
/** A single dynamic segment for `@route`. */
|
|
13
|
+
model?: unknown;
|
|
14
|
+
/** Query params for `@route`. */
|
|
15
|
+
query?: Record<string, unknown>;
|
|
16
|
+
/** Renders a plain anchor. Ignored when `@route` is given. */
|
|
17
|
+
href?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Overrides the active state. Always wins over anything derived from the
|
|
20
|
+
* router, and is the only source of truth when `@route` is not used.
|
|
21
|
+
*/
|
|
22
|
+
isActive?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Marks the link as disabled. The href is dropped as well, so the link
|
|
25
|
+
* cannot be followed; a button also gets the native `disabled` attribute.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue false
|
|
28
|
+
*/
|
|
29
|
+
isDisabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Renders nothing at all. For links the current user may not see.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue false
|
|
34
|
+
*/
|
|
35
|
+
isHidden?: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface NavLinkSignature {
|
|
38
|
+
Args: NavLinkArgs;
|
|
39
|
+
Blocks: {
|
|
40
|
+
/** The link's content. */
|
|
41
|
+
default: [];
|
|
42
|
+
};
|
|
43
|
+
Element: HTMLAnchorElement | HTMLButtonElement;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The headless element behind a navigation item: it handles routing, active
|
|
47
|
+
* state, ARIA, disabled and hidden, and renders no styling of its own.
|
|
48
|
+
* `@route` renders a `LinkTo`, `@href` a plain anchor, and neither a
|
|
49
|
+
* `<button type="button">`. Attributes, classes and modifiers are spread onto
|
|
50
|
+
* the rendered element.
|
|
51
|
+
*/
|
|
52
|
+
declare class NavLink extends Component<NavLinkSignature> {
|
|
53
|
+
router: RouterService;
|
|
54
|
+
get routeArgs(): ReturnType<typeof normalizeRouteArgs>;
|
|
55
|
+
get isActive(): boolean;
|
|
56
|
+
get isDisabled(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* `LinkTo` cannot be talked out of a real, navigable href, so a disabled
|
|
59
|
+
* route link falls through to the plain anchor, where dropping the href is
|
|
60
|
+
* what disables it.
|
|
61
|
+
*/
|
|
62
|
+
get rendersLink(): boolean;
|
|
63
|
+
get rendersAnchor(): boolean;
|
|
64
|
+
}
|
|
65
|
+
export { NavLink, type NavLinkSignature, type NavLinkArgs };
|
|
66
|
+
export default NavLink;
|
|
67
|
+
//# sourceMappingURL=nav-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-link.d.ts","sourceRoot":"","s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