@buffercreations/levelsui 0.1.4 → 0.1.5
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/01. Elements/navigation/items/navigation-item/docs/README.md +4 -0
- package/01. Elements/navigation/items/navigation-item/src/navigation-item.scss +6 -3
- package/02. Layouts/application/app-shell/docs/README.md +4 -0
- package/02. Layouts/application/app-shell/docs/api.json +20 -1
- package/02. Layouts/application/app-shell/src/app-shell.scss +14 -2
- package/03. Components/navigation/bars/bottom-navigation-bar/bottom-navigation-bar.definition.json +35 -0
- package/03. Components/navigation/bars/bottom-navigation-bar/docs/README.md +9 -0
- package/03. Components/navigation/bars/bottom-navigation-bar/docs/api.json +31 -0
- package/03. Components/navigation/bars/bottom-navigation-bar/examples/index.json +10 -0
- package/03. Components/navigation/bars/bottom-navigation-bar/examples/standard/code.html +9 -0
- package/03. Components/navigation/bars/bottom-navigation-bar/examples/standard/preview.html +9 -0
- package/03. Components/navigation/bars/bottom-navigation-bar/src/bottom-navigation-bar.scss +38 -0
- package/03. Components/navigation/drawers/navigation-drawer/docs/README.md +5 -0
- package/03. Components/navigation/drawers/navigation-drawer/docs/api.json +36 -0
- package/03. Components/navigation/drawers/navigation-drawer/examples/index.json +10 -0
- package/03. Components/navigation/drawers/navigation-drawer/examples/standard/code.html +9 -0
- package/03. Components/navigation/drawers/navigation-drawer/examples/standard/preview.html +9 -0
- package/03. Components/navigation/drawers/navigation-drawer/navigation-drawer.definition.json +36 -0
- package/03. Components/navigation/drawers/navigation-drawer/src/navigation-drawer.scss +25 -0
- package/03. Components/navigation/rails/global-navigation-rail/docs/README.md +11 -0
- package/03. Components/navigation/rails/global-navigation-rail/docs/api.json +51 -0
- package/03. Components/navigation/rails/global-navigation-rail/examples/basic/code.html +21 -0
- package/03. Components/navigation/rails/global-navigation-rail/examples/basic/preview.html +21 -0
- package/03. Components/navigation/rails/global-navigation-rail/examples/horizontal/code.html +21 -0
- package/03. Components/navigation/rails/global-navigation-rail/examples/horizontal/preview.html +21 -0
- package/03. Components/navigation/rails/global-navigation-rail/examples/index.json +17 -0
- package/03. Components/navigation/rails/global-navigation-rail/global-navigation-rail.definition.json +37 -0
- package/03. Components/navigation/rails/global-navigation-rail/src/global-navigation-rail.scss +74 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/docs/README.md +41 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/docs/api.json +71 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/examples/closed/code.html +74 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/examples/closed/preview.html +74 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/examples/index.json +24 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/examples/joined/code.html +74 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/examples/joined/preview.html +74 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/examples/pinned/code.html +74 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/examples/pinned/preview.html +74 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/floating-contextual-navigation.definition.json +42 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/src/floating-contextual-navigation.js +227 -0
- package/03. Components/navigation/sidebars/floating-contextual-navigation/src/floating-contextual-navigation.scss +85 -0
- package/03. Components/navigation/sidebars/floating-sidebar/docs/README.md +4 -0
- package/03. Components/navigation/sidebars/floating-sidebar/src/floating-sidebar.js +14 -9
- package/03. Components/navigation/sidebars/floating-sidebar/src/floating-sidebar.scss +30 -1
- package/03. Components/navigation/sidebars/responsive-navigation/docs/README.md +25 -0
- package/03. Components/navigation/sidebars/responsive-navigation/docs/api.json +51 -0
- package/03. Components/navigation/sidebars/responsive-navigation/examples/drawer-only/code.html +95 -0
- package/03. Components/navigation/sidebars/responsive-navigation/examples/drawer-only/preview.html +95 -0
- package/03. Components/navigation/sidebars/responsive-navigation/examples/index.json +17 -0
- package/03. Components/navigation/sidebars/responsive-navigation/examples/standard/code.html +95 -0
- package/03. Components/navigation/sidebars/responsive-navigation/examples/standard/preview.html +95 -0
- package/03. Components/navigation/sidebars/responsive-navigation/responsive-navigation.definition.json +37 -0
- package/03. Components/navigation/sidebars/responsive-navigation/src/responsive-navigation.js +152 -0
- package/03. Components/navigation/sidebars/responsive-navigation/src/responsive-navigation.scss +82 -0
- package/dist/catalogue.json +88 -0
- package/dist/components/app-shell.css +10 -2
- package/dist/components/bottom-navigation-bar.css +44 -0
- package/dist/components/floating-contextual-navigation.css +84 -0
- package/dist/components/floating-sidebar.css +27 -1
- package/dist/components/global-navigation-rail.css +75 -0
- package/dist/components/navigation-drawer.css +23 -0
- package/dist/components/navigation-item.css +5 -3
- package/dist/components/responsive-navigation.css +92 -0
- package/package.json +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// Responsive Navigation — Level 03 / Components.
|
|
2
|
+
// Compose independent navigation Assets. BufferCore owns disclosure and dismissal.
|
|
3
|
+
import { createDisclosure } from '@buffercreations/buffercore/behaviours/disclosure';
|
|
4
|
+
import { createFocusTrap } from '@buffercreations/buffercore/behaviours/focus-trap';
|
|
5
|
+
import { acquireScrollLock } from '@buffercreations/buffercore/behaviours/scroll-lock';
|
|
6
|
+
import { mountFloatingContextualNavigation } from '../../floating-contextual-navigation/src/floating-contextual-navigation.js';
|
|
7
|
+
|
|
8
|
+
const instances = new WeakMap();
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Coordinate the large contextual presentation with a small horizontal Rail and drawer.
|
|
12
|
+
* Markup supplies one unique data-responsive-hub button and matching drawer
|
|
13
|
+
* section per Hub; no navigation content or labels are generated in JavaScript.
|
|
14
|
+
* @param {HTMLElement} root - Responsive Navigation root.
|
|
15
|
+
* @returns {{selectHub: Function, openMenu: Function, closeMenu: Function, destroy: Function}}
|
|
16
|
+
*/
|
|
17
|
+
export function mountResponsiveNavigation(root) {
|
|
18
|
+
if (!root?.querySelector) throw new TypeError('Responsive Navigation requires an element root');
|
|
19
|
+
if (instances.has(root)) return instances.get(root);
|
|
20
|
+
|
|
21
|
+
const desktop = root.querySelector('[data-responsive-large]');
|
|
22
|
+
const small = root.querySelector('[data-responsive-small]');
|
|
23
|
+
const bottom = small?.querySelector('.bcc-global-navigation-rail[data-orientation="horizontal"]');
|
|
24
|
+
const toggle = bottom?.querySelector('[data-responsive-menu-toggle]');
|
|
25
|
+
const launcher = small?.querySelector('[data-responsive-drawer-launch]');
|
|
26
|
+
const drawer = small?.querySelector('[data-responsive-drawer]');
|
|
27
|
+
const scrim = small?.querySelector('[data-responsive-scrim]');
|
|
28
|
+
const closeButton = drawer?.querySelector('[data-responsive-close]');
|
|
29
|
+
const triggers = [...(bottom?.querySelectorAll('[data-responsive-hub]') ?? [])];
|
|
30
|
+
const sections = [...(drawer?.querySelectorAll('[data-responsive-content]') ?? [])];
|
|
31
|
+
if (!desktop || !small || !bottom || !toggle || !drawer?.id || !scrim || !closeButton || !triggers.length) {
|
|
32
|
+
throw new Error('Responsive Navigation requires large presentation, small rail, drawer, scrim and controls');
|
|
33
|
+
}
|
|
34
|
+
const hubs = new Map(triggers.map(el => [el.dataset.responsiveHub, el]));
|
|
35
|
+
const content = new Map(sections.map(el => [el.dataset.responsiveContent, el]));
|
|
36
|
+
if (hubs.size !== triggers.length || content.size !== sections.length ||
|
|
37
|
+
[...hubs.keys()].some(id => !id || !content.has(id)) || [...content.keys()].some(id => !hubs.has(id))) {
|
|
38
|
+
throw new Error('Responsive Hub identifiers and content must match uniquely');
|
|
39
|
+
}
|
|
40
|
+
const doc = root.ownerDocument;
|
|
41
|
+
const win = doc.defaultView;
|
|
42
|
+
const query = root.dataset.responsiveQuery || '(max-width: 48rem)';
|
|
43
|
+
const media = win.matchMedia(query);
|
|
44
|
+
let activeHub = root.dataset.hub && hubs.has(root.dataset.hub) ? root.dataset.hub : hubs.keys().next().value;
|
|
45
|
+
let desktopController = null;
|
|
46
|
+
let smallMode = false;
|
|
47
|
+
let destroyed = false;
|
|
48
|
+
let lastFocus = null;
|
|
49
|
+
let releaseScrollLock = null;
|
|
50
|
+
const focusTrap = createFocusTrap({container: drawer, initialFocus: closeButton, returnFocus: false});
|
|
51
|
+
toggle.setAttribute('aria-controls', drawer.id);
|
|
52
|
+
if (launcher) launcher.setAttribute('aria-controls', drawer.id);
|
|
53
|
+
|
|
54
|
+
// The drawer is non-modal: use Core Disclosure for ARIA, inert and Escape.
|
|
55
|
+
// Outside dismissal is provided by the scrim; no bespoke document listeners.
|
|
56
|
+
const disclosure = createDisclosure({
|
|
57
|
+
trigger: toggle, panel: drawer, mode: 'hidden', closeOnOutside: false,
|
|
58
|
+
onChange(open) {
|
|
59
|
+
scrim.hidden = !open;
|
|
60
|
+
if (launcher) launcher.setAttribute('aria-expanded', String(open));
|
|
61
|
+
if (open) {
|
|
62
|
+
lastFocus = doc.activeElement;
|
|
63
|
+
releaseScrollLock = acquireScrollLock({document: doc});
|
|
64
|
+
focusTrap.activate();
|
|
65
|
+
} else {
|
|
66
|
+
focusTrap.deactivate({restoreFocus: false});
|
|
67
|
+
releaseScrollLock?.();
|
|
68
|
+
releaseScrollLock = null;
|
|
69
|
+
if (drawer.contains(doc.activeElement)) {
|
|
70
|
+
(lastFocus?.isConnected ? lastFocus : toggle).focus({preventScroll: true});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
function renderHub() {
|
|
77
|
+
root.dataset.hub = activeHub;
|
|
78
|
+
for (const [id, trigger] of hubs) trigger.setAttribute('aria-pressed', String(id === activeHub));
|
|
79
|
+
for (const [id, section] of content) section.hidden = id !== activeHub;
|
|
80
|
+
const title = drawer.querySelector('[data-responsive-title]');
|
|
81
|
+
if (title) title.textContent = hubs.get(activeHub).getAttribute('aria-label') || activeHub;
|
|
82
|
+
}
|
|
83
|
+
function selectHub(id, {fromDesktop = false} = {}) {
|
|
84
|
+
if (!hubs.has(id)) throw new Error(`Unknown responsive Hub: ${id}`);
|
|
85
|
+
activeHub = id;
|
|
86
|
+
renderHub();
|
|
87
|
+
if (smallMode) disclosure.close();
|
|
88
|
+
else if (!fromDesktop) desktopController?.pin(id);
|
|
89
|
+
}
|
|
90
|
+
function openMenu() { if (smallMode) disclosure.open(); }
|
|
91
|
+
function closeMenu() { disclosure.close(); }
|
|
92
|
+
function onBottomClick(event) { selectHub(event.currentTarget.dataset.responsiveHub); }
|
|
93
|
+
function onDrawerLinkClick(event) { if (event.target.closest('a[href]')) closeMenu(); }
|
|
94
|
+
function onDesktopChange(event) {
|
|
95
|
+
if (event.detail?.hub && hubs.has(event.detail.hub) && event.detail.state === 'pinned') {
|
|
96
|
+
selectHub(event.detail.hub, {fromDesktop: true});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function onModeChange() {
|
|
100
|
+
if (destroyed) return;
|
|
101
|
+
const nextSmall = media.matches;
|
|
102
|
+
if (nextSmall === smallMode && desktopController) return;
|
|
103
|
+
closeMenu();
|
|
104
|
+
smallMode = nextSmall;
|
|
105
|
+
desktop.inert = nextSmall;
|
|
106
|
+
small.inert = !nextSmall;
|
|
107
|
+
if (nextSmall) {
|
|
108
|
+
desktopController?.destroy();
|
|
109
|
+
desktopController = null;
|
|
110
|
+
// Hide desktop contextual preview before leaving the presentation.
|
|
111
|
+
desktop.dataset.state = 'closed';
|
|
112
|
+
} else {
|
|
113
|
+
desktopController = mountFloatingContextualNavigation(desktop);
|
|
114
|
+
desktopController.pin(activeHub);
|
|
115
|
+
}
|
|
116
|
+
root.dataset.presentation = nextSmall ? 'small' : 'large';
|
|
117
|
+
if ((nextSmall ? desktop : small).contains(doc.activeElement)) {
|
|
118
|
+
(nextSmall ? hubs.get(activeHub) : [...desktop.querySelectorAll('[data-contextual-hub]')].find(el => el.dataset.contextualHub === activeHub))?.focus({preventScroll: true});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
for (const trigger of triggers) trigger.addEventListener('click', onBottomClick);
|
|
122
|
+
closeButton.addEventListener('click', closeMenu);
|
|
123
|
+
launcher?.addEventListener('click', openMenu);
|
|
124
|
+
drawer.addEventListener('click', onDrawerLinkClick);
|
|
125
|
+
scrim.addEventListener('click', closeMenu);
|
|
126
|
+
desktop.addEventListener('contextualnavigationchange', onDesktopChange);
|
|
127
|
+
media.addEventListener('change', onModeChange);
|
|
128
|
+
renderHub();
|
|
129
|
+
onModeChange();
|
|
130
|
+
const controller = { selectHub, openMenu, closeMenu,
|
|
131
|
+
destroy() {
|
|
132
|
+
if (destroyed) return;
|
|
133
|
+
destroyed = true;
|
|
134
|
+
media.removeEventListener('change', onModeChange);
|
|
135
|
+
desktop.removeEventListener('contextualnavigationchange', onDesktopChange);
|
|
136
|
+
for (const trigger of triggers) trigger.removeEventListener('click', onBottomClick);
|
|
137
|
+
closeButton.removeEventListener('click', closeMenu);
|
|
138
|
+
scrim.removeEventListener('click', closeMenu);
|
|
139
|
+
launcher?.removeEventListener('click', openMenu);
|
|
140
|
+
drawer.removeEventListener('click', onDrawerLinkClick);
|
|
141
|
+
desktopController?.destroy();
|
|
142
|
+
disclosure.destroy();
|
|
143
|
+
focusTrap.destroy();
|
|
144
|
+
releaseScrollLock?.();
|
|
145
|
+
desktop.inert = false;
|
|
146
|
+
small.inert = false;
|
|
147
|
+
instances.delete(root);
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
instances.set(root, controller);
|
|
151
|
+
return controller;
|
|
152
|
+
}
|
package/03. Components/navigation/sidebars/responsive-navigation/src/responsive-navigation.scss
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Responsive Navigation — Level 03 / Components.
|
|
2
|
+
// This Asset owns responsive presentation switching and overlay placement.
|
|
3
|
+
.bcc-responsive-navigation {
|
|
4
|
+
position: relative;
|
|
5
|
+
min-inline-size: 0;
|
|
6
|
+
min-block-size: 100%;
|
|
7
|
+
}
|
|
8
|
+
.bcc-responsive-navigation__small { display: none; }
|
|
9
|
+
.bcc-responsive-navigation__launcher { display: none; }
|
|
10
|
+
.bcc-responsive-navigation__large { min-inline-size: 0; }
|
|
11
|
+
|
|
12
|
+
// Keep this media query paired with the controller's default 48rem threshold.
|
|
13
|
+
// Consumers can override the breakpoint in both CSS and JS through an explicit
|
|
14
|
+
// host configuration; CSS custom properties alone cannot control media queries.
|
|
15
|
+
@media (max-width: 48rem) {
|
|
16
|
+
.bcc-responsive-navigation__large { display: none; }
|
|
17
|
+
.bcc-responsive-navigation__small {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
min-block-size: 100svh;
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
.bcc-responsive-navigation:is([data-small-pattern="drawer"], [data-mobile-pattern="drawer"]) .bcc-responsive-navigation__bottom { display: none; }
|
|
24
|
+
.bcc-responsive-navigation:is([data-small-pattern="drawer"], [data-mobile-pattern="drawer"]) .bcc-responsive-navigation__launcher {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: var(--bc-fluid-2xs);
|
|
28
|
+
}
|
|
29
|
+
.bcc-responsive-navigation__content { flex: 1 1 auto; min-inline-size: 0; }
|
|
30
|
+
.bcc-responsive-navigation__bottom {
|
|
31
|
+
position: sticky;
|
|
32
|
+
inset-block-end: 0;
|
|
33
|
+
z-index: var(--bc-layer-sticky);
|
|
34
|
+
}
|
|
35
|
+
.bcc-responsive-navigation__scrim {
|
|
36
|
+
position: fixed;
|
|
37
|
+
inset: 0;
|
|
38
|
+
z-index: var(--bc-layer-modal);
|
|
39
|
+
// The scrim is a native button for click-to-dismiss. Override the shared
|
|
40
|
+
// Button's default, hover and active fills with the same overlay Semantic.
|
|
41
|
+
--bce-button-background: var(--bc-color-overlay-soft);
|
|
42
|
+
--bce-button-hover-background: var(--bc-color-overlay-soft);
|
|
43
|
+
--bce-button-active-background: var(--bc-color-overlay-soft);
|
|
44
|
+
--bce-button-outline: transparent;
|
|
45
|
+
--bce-button-hover-outline: transparent;
|
|
46
|
+
--bce-button-active-outline: transparent;
|
|
47
|
+
|
|
48
|
+
min-height: 0;
|
|
49
|
+
max-width: none;
|
|
50
|
+
padding: 0;
|
|
51
|
+
border: 0;
|
|
52
|
+
border-radius: 0;
|
|
53
|
+
background-color: var(--bc-color-overlay-soft);
|
|
54
|
+
}
|
|
55
|
+
.bcc-responsive-navigation__drawer {
|
|
56
|
+
position: fixed;
|
|
57
|
+
z-index: calc(var(--bc-layer-modal) + 1);
|
|
58
|
+
inset-block: 0;
|
|
59
|
+
inset-inline-start: 0;
|
|
60
|
+
inline-size: min(var(--bcc-navigation-drawer-width, var(--bc-size-ui-256)), 90vw);
|
|
61
|
+
block-size: 100dvh;
|
|
62
|
+
}
|
|
63
|
+
.bcc-responsive-navigation__drawer > .bcc-navigation-drawer {
|
|
64
|
+
block-size: 100%;
|
|
65
|
+
--bcc-navigation-drawer-surface: var(--bcc-floating-sidebar-surface, var(--bc-color-canvas-secondary));
|
|
66
|
+
--bcc-navigation-drawer-radius: var(--bcc-floating-sidebar-radius, var(--bc-radius-lg));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
.bcc-responsive-navigation__scrim[hidden],
|
|
70
|
+
.bcc-responsive-navigation__drawer[hidden] { display: none !important; }
|
|
71
|
+
@media (prefers-reduced-motion: reduce) {
|
|
72
|
+
.bcc-responsive-navigation__drawer { transition: none; }
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Medium retains the vertical Rail but never permanently reserves a sidebar track.
|
|
76
|
+
// Small switches to the horizontal Rail and modal contextual drawer.
|
|
77
|
+
@media (min-width: 48.001rem) and (max-width: 64rem) {
|
|
78
|
+
.bcc-responsive-navigation__large.bcc-floating-contextual-navigation,
|
|
79
|
+
.bcc-responsive-navigation__large.bcc-floating-contextual-navigation[data-state="pinned"] {
|
|
80
|
+
grid-template-columns: var(--bcc-global-navigation-rail-width, var(--bc-size-ui-64)) 0px minmax(0, 1fr);
|
|
81
|
+
}
|
|
82
|
+
}
|
package/dist/catalogue.json
CHANGED
|
@@ -69,6 +69,23 @@
|
|
|
69
69
|
"version": null,
|
|
70
70
|
"dependencies": {}
|
|
71
71
|
},
|
|
72
|
+
{
|
|
73
|
+
"id": "bottom-navigation-bar",
|
|
74
|
+
"name": "Bottom Navigation Bar",
|
|
75
|
+
"level": "components",
|
|
76
|
+
"category": [
|
|
77
|
+
"navigation",
|
|
78
|
+
"bars"
|
|
79
|
+
],
|
|
80
|
+
"family": null,
|
|
81
|
+
"description": "Touch-first primary navigation using Navigation Menu and Navigation Item.",
|
|
82
|
+
"version": null,
|
|
83
|
+
"dependencies": {
|
|
84
|
+
"components": [
|
|
85
|
+
"navigation-menu"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
72
89
|
{
|
|
73
90
|
"id": "button",
|
|
74
91
|
"name": "Button",
|
|
@@ -207,6 +224,24 @@
|
|
|
207
224
|
"version": null,
|
|
208
225
|
"dependencies": {}
|
|
209
226
|
},
|
|
227
|
+
{
|
|
228
|
+
"id": "floating-contextual-navigation",
|
|
229
|
+
"name": "Floating Contextual Navigation",
|
|
230
|
+
"level": "components",
|
|
231
|
+
"category": [
|
|
232
|
+
"navigation",
|
|
233
|
+
"sidebars"
|
|
234
|
+
],
|
|
235
|
+
"family": null,
|
|
236
|
+
"description": "Global Hub rail with click-to-pin selection, temporary per-Hub hover preview and a fully hideable Floating Sidebar panel.",
|
|
237
|
+
"version": null,
|
|
238
|
+
"dependencies": {
|
|
239
|
+
"components": [
|
|
240
|
+
"global-navigation-rail",
|
|
241
|
+
"floating-sidebar"
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
},
|
|
210
245
|
{
|
|
211
246
|
"id": "floating-sidebar",
|
|
212
247
|
"name": "Floating Sidebar",
|
|
@@ -242,6 +277,23 @@
|
|
|
242
277
|
"version": null,
|
|
243
278
|
"dependencies": {}
|
|
244
279
|
},
|
|
280
|
+
{
|
|
281
|
+
"id": "global-navigation-rail",
|
|
282
|
+
"name": "Global Navigation Rail",
|
|
283
|
+
"level": "components",
|
|
284
|
+
"category": [
|
|
285
|
+
"navigation",
|
|
286
|
+
"rails"
|
|
287
|
+
],
|
|
288
|
+
"family": null,
|
|
289
|
+
"description": "Icon-first global navigation rail with vertical and horizontal orientations, composed from Navigation Menu and Navigation Item.",
|
|
290
|
+
"version": null,
|
|
291
|
+
"dependencies": {
|
|
292
|
+
"components": [
|
|
293
|
+
"navigation-menu"
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
},
|
|
245
297
|
{
|
|
246
298
|
"id": "grid",
|
|
247
299
|
"name": "Grid",
|
|
@@ -266,6 +318,23 @@
|
|
|
266
318
|
"version": null,
|
|
267
319
|
"dependencies": {}
|
|
268
320
|
},
|
|
321
|
+
{
|
|
322
|
+
"id": "navigation-drawer",
|
|
323
|
+
"name": "Navigation Drawer",
|
|
324
|
+
"level": "components",
|
|
325
|
+
"category": [
|
|
326
|
+
"navigation",
|
|
327
|
+
"drawers"
|
|
328
|
+
],
|
|
329
|
+
"family": null,
|
|
330
|
+
"description": "Dismissible navigation surface composed from Navigation Menu and Navigation Item.",
|
|
331
|
+
"version": null,
|
|
332
|
+
"dependencies": {
|
|
333
|
+
"components": [
|
|
334
|
+
"navigation-menu"
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
},
|
|
269
338
|
{
|
|
270
339
|
"id": "navigation-item",
|
|
271
340
|
"name": "Navigation Item",
|
|
@@ -333,6 +402,25 @@
|
|
|
333
402
|
"version": null,
|
|
334
403
|
"dependencies": {}
|
|
335
404
|
},
|
|
405
|
+
{
|
|
406
|
+
"id": "responsive-navigation",
|
|
407
|
+
"name": "Responsive Navigation",
|
|
408
|
+
"level": "components",
|
|
409
|
+
"category": [
|
|
410
|
+
"navigation",
|
|
411
|
+
"sidebars"
|
|
412
|
+
],
|
|
413
|
+
"family": null,
|
|
414
|
+
"description": "Small/medium/large navigation composition using the shared Rail, Floating Contextual Navigation and contextual Drawer.",
|
|
415
|
+
"version": null,
|
|
416
|
+
"dependencies": {
|
|
417
|
+
"components": [
|
|
418
|
+
"floating-contextual-navigation",
|
|
419
|
+
"global-navigation-rail",
|
|
420
|
+
"navigation-drawer"
|
|
421
|
+
]
|
|
422
|
+
}
|
|
423
|
+
},
|
|
336
424
|
{
|
|
337
425
|
"id": "section",
|
|
338
426
|
"name": "Section",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
container: bcl-app-shell/inline-size;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
:where(.bcl-app-shell__header, .bcl-app-shell__footer, .bcl-app-shell__body, .bcl-app-shell__sidebar, .bcl-app-shell__aside, .bcl-app-shell__main) {
|
|
16
|
+
:where(.bcl-app-shell__header, .bcl-app-shell__footer, .bcl-app-shell__body, .bcl-app-shell__sidebar, .bcl-app-shell__aside, .bcl-app-shell__main, .bcl-app-shell__bottom) {
|
|
17
17
|
min-inline-size: 0;
|
|
18
18
|
overflow-wrap: anywhere;
|
|
19
19
|
}
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
grid-template-columns: minmax(0, var(--bcl-app-shell-left-track)) minmax(var(--bcl-app-shell-main-min), 1fr) minmax(0, var(--bcl-app-shell-right-track));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
:where(.bcl-app-shell--left-rail) {
|
|
53
|
+
--bcl-app-shell-left-width: var(--bc-size-ui-96);
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
:where(.bcl-app-shell--left-sm) {
|
|
53
57
|
--bcl-app-shell-left-width: var(--bc-size-ui-192);
|
|
54
58
|
}
|
|
@@ -96,7 +100,7 @@
|
|
|
96
100
|
:where(.bcl-app-shell__body) {
|
|
97
101
|
grid-template-columns: minmax(0, 1fr);
|
|
98
102
|
}
|
|
99
|
-
:where(.bcl-app-shell__sidebar, .bcl-app-shell__aside, .bcl-app-shell__main) {
|
|
103
|
+
:where(.bcl-app-shell__sidebar, .bcl-app-shell__aside, .bcl-app-shell__main, .bcl-app-shell__bottom) {
|
|
100
104
|
grid-column: 1;
|
|
101
105
|
}
|
|
102
106
|
:where(.bcl-app-shell--sticky-left > .bcl-app-shell__body > .bcl-app-shell__sidebar, .bcl-app-shell--sticky-right > .bcl-app-shell__body > .bcl-app-shell__aside) {
|
|
@@ -104,4 +108,8 @@
|
|
|
104
108
|
max-block-size: none;
|
|
105
109
|
overflow: visible;
|
|
106
110
|
}
|
|
111
|
+
}
|
|
112
|
+
:where(.bcl-app-shell__bottom) {
|
|
113
|
+
flex: none;
|
|
114
|
+
min-inline-size: 0;
|
|
107
115
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.bcc-bottom-navigation-bar {
|
|
2
|
+
--bcc-bottom-navigation-bar-surface: var(--bc-color-canvas-secondary);
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: stretch;
|
|
5
|
+
inline-size: 100%;
|
|
6
|
+
padding-block: var(--bc-fluid-2xs);
|
|
7
|
+
padding-inline: var(--bc-fluid-2xs);
|
|
8
|
+
padding-block-end: max(var(--bc-fluid-2xs), env(safe-area-inset-bottom));
|
|
9
|
+
background: var(--bcc-bottom-navigation-bar-surface);
|
|
10
|
+
border-block-start: var(--bc-border-width-xs) solid var(--bc-color-border-neutral);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.bcc-bottom-navigation-bar > .bcc-navigation-menu {
|
|
14
|
+
inline-size: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.bcc-bottom-navigation-bar .bcc-navigation-menu__list {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: stretch;
|
|
20
|
+
justify-content: space-around;
|
|
21
|
+
gap: var(--bc-fluid-2xs);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.bcc-bottom-navigation-bar .bcc-navigation-menu__item {
|
|
25
|
+
flex: 1 1 0;
|
|
26
|
+
min-inline-size: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.bcc-bottom-navigation-bar .bce-navigation-item {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
inline-size: 100%;
|
|
35
|
+
min-block-size: var(--bc-size-ui-48);
|
|
36
|
+
gap: var(--bc-fluid-3xs);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.bcc-bottom-navigation-bar .bce-navigation-item__label {
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
text-overflow: ellipsis;
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
max-inline-size: 100%;
|
|
44
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.bcc-floating-contextual-navigation {
|
|
2
|
+
--bcc-floating-contextual-navigation-panel-width: var(--bc-size-ui-256);
|
|
3
|
+
--bcc-floating-contextual-navigation-gap: var(--bc-fluid-2xs);
|
|
4
|
+
position: relative;
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-columns: var(--bcc-global-navigation-rail-width, var(--bc-size-ui-64)) 0px minmax(0, 1fr);
|
|
7
|
+
align-items: start;
|
|
8
|
+
column-gap: 0;
|
|
9
|
+
min-inline-size: 0;
|
|
10
|
+
min-block-size: 100%;
|
|
11
|
+
transition: grid-template-columns var(--bc-motion-interaction);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.bcc-floating-contextual-navigation--joined {
|
|
15
|
+
--bcc-floating-contextual-navigation-gap: 0px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bcc-floating-contextual-navigation[data-state=pinned] {
|
|
19
|
+
grid-template-columns: var(--bcc-global-navigation-rail-width, var(--bc-size-ui-64)) calc(var(--bcc-floating-contextual-navigation-panel-width) + var(--bcc-floating-contextual-navigation-gap)) minmax(0, 1fr);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.bcc-floating-contextual-navigation__global,
|
|
23
|
+
.bcc-floating-contextual-navigation__workspace {
|
|
24
|
+
min-inline-size: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.bcc-floating-contextual-navigation__global {
|
|
28
|
+
grid-column: 1;
|
|
29
|
+
grid-row: 1;
|
|
30
|
+
block-size: 100%;
|
|
31
|
+
min-block-size: 100svh;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.bcc-floating-contextual-navigation__workspace {
|
|
35
|
+
grid-column: 3;
|
|
36
|
+
grid-row: 1;
|
|
37
|
+
min-inline-size: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.bcc-floating-contextual-navigation__panel-header {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
gap: var(--bc-fluid-2xs);
|
|
45
|
+
margin-block-end: var(--bc-fluid-xs);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.bcc-floating-contextual-navigation__close {
|
|
49
|
+
flex: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.bcc-floating-contextual-navigation__panel {
|
|
53
|
+
position: absolute;
|
|
54
|
+
z-index: 5;
|
|
55
|
+
inset-block-start: 0;
|
|
56
|
+
inset-inline-start: calc(var(--bcc-global-navigation-rail-width, var(--bc-size-ui-64)) + var(--bcc-floating-contextual-navigation-gap));
|
|
57
|
+
inline-size: var(--bcc-floating-contextual-navigation-panel-width);
|
|
58
|
+
block-size: 100%;
|
|
59
|
+
max-inline-size: calc(100% - var(--bcc-global-navigation-rail-width, var(--bc-size-ui-64)) - var(--bcc-floating-contextual-navigation-gap));
|
|
60
|
+
opacity: 0;
|
|
61
|
+
visibility: hidden;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
transform: translateX(calc(0px - var(--bc-size-ui-16)));
|
|
64
|
+
transition: opacity var(--bc-motion-interaction), transform var(--bc-motion-interaction), visibility 0s linear var(--bc-motion-interaction-duration);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.bcc-floating-contextual-navigation:is([data-state=preview], [data-state=pinned]) > .bcc-floating-contextual-navigation__panel {
|
|
68
|
+
opacity: 1;
|
|
69
|
+
visibility: visible;
|
|
70
|
+
pointer-events: auto;
|
|
71
|
+
transform: translateX(0);
|
|
72
|
+
transition: opacity var(--bc-motion-interaction), transform var(--bc-motion-interaction), visibility 0s;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.bcc-floating-contextual-navigation__panel > .bcc-floating-sidebar {
|
|
76
|
+
block-size: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media (prefers-reduced-motion: reduce) {
|
|
80
|
+
.bcc-floating-contextual-navigation,
|
|
81
|
+
.bcc-floating-contextual-navigation__panel {
|
|
82
|
+
transition: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
.bcc-floating-sidebar {
|
|
2
2
|
--bcc-floating-sidebar-width: var(--bc-size-ui-256);
|
|
3
|
-
--bcc-floating-sidebar-rail-width:
|
|
3
|
+
--bcc-floating-sidebar-rail-width: calc(
|
|
4
|
+
var(--bcc-floating-sidebar-padding) * 2 +
|
|
5
|
+
var(--bc-size-ui-16) * 2 +
|
|
6
|
+
var(--bc-size-ui-20)
|
|
7
|
+
);
|
|
4
8
|
--bcc-floating-sidebar-gap: var(--bc-fluid-md);
|
|
5
9
|
--bcc-floating-sidebar-padding: var(--bc-fluid-xs);
|
|
6
10
|
--bcc-floating-sidebar-surface: var(--bc-color-canvas-secondary);
|
|
@@ -106,6 +110,7 @@
|
|
|
106
110
|
.bcc-floating-sidebar[data-collapsed=true] > .bcc-floating-sidebar__rail {
|
|
107
111
|
flex-basis: var(--bcc-floating-sidebar-rail-width);
|
|
108
112
|
inline-size: var(--bcc-floating-sidebar-rail-width);
|
|
113
|
+
scrollbar-width: none;
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
.bcc-floating-sidebar[data-collapsed=true] .bcc-floating-sidebar__brand,
|
|
@@ -123,6 +128,10 @@
|
|
|
123
128
|
transform: translateX(0);
|
|
124
129
|
}
|
|
125
130
|
|
|
131
|
+
.bcc-floating-sidebar[data-collapsed=true] > .bcc-floating-sidebar__rail::-webkit-scrollbar {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
126
135
|
.bcc-floating-sidebar .bcc-navigation-menu__heading {
|
|
127
136
|
max-block-size: var(--bc-size-ui-40);
|
|
128
137
|
overflow: hidden;
|
|
@@ -160,4 +169,21 @@
|
|
|
160
169
|
.bcc-floating-sidebar--animated .bcc-floating-sidebar__toggle-icon {
|
|
161
170
|
transition: none;
|
|
162
171
|
}
|
|
172
|
+
}
|
|
173
|
+
.bcc-floating-sidebar--embedded {
|
|
174
|
+
display: block;
|
|
175
|
+
inline-size: 100%;
|
|
176
|
+
block-size: 100%;
|
|
177
|
+
min-inline-size: 0;
|
|
178
|
+
--bcc-floating-sidebar-width: 100%;
|
|
179
|
+
--bcc-floating-sidebar-gap: 0px;
|
|
180
|
+
--bcc-floating-sidebar-height: 100%;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.bcc-floating-sidebar--embedded > .bcc-floating-sidebar__rail {
|
|
184
|
+
position: static;
|
|
185
|
+
flex: none;
|
|
186
|
+
inline-size: 100%;
|
|
187
|
+
block-size: 100%;
|
|
188
|
+
max-block-size: none;
|
|
163
189
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.bcc-global-navigation-rail {
|
|
2
|
+
--bcc-global-navigation-rail-width: var(--bc-size-ui-64);
|
|
3
|
+
--bcc-global-navigation-rail-height: 100%;
|
|
4
|
+
--bcc-global-navigation-rail-surface: var(--bc-color-canvas-secondary);
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
gap: var(--bc-fluid-xs);
|
|
10
|
+
inline-size: var(--bcc-global-navigation-rail-width);
|
|
11
|
+
block-size: var(--bcc-global-navigation-rail-height);
|
|
12
|
+
min-block-size: 0;
|
|
13
|
+
padding: var(--bc-fluid-2xs);
|
|
14
|
+
border-radius: var(--bc-radius-lg);
|
|
15
|
+
background: var(--bcc-global-navigation-rail-surface);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bcc-global-navigation-rail > .bcc-navigation-menu {
|
|
19
|
+
inline-size: 100%;
|
|
20
|
+
min-inline-size: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.bcc-global-navigation-rail__footer {
|
|
24
|
+
margin-block-start: auto;
|
|
25
|
+
inline-size: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bcc-global-navigation-rail[data-orientation=horizontal] {
|
|
29
|
+
--bcc-global-navigation-rail-width: 100%;
|
|
30
|
+
--bcc-global-navigation-rail-height: auto;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
align-items: stretch;
|
|
33
|
+
padding-block-end: max(var(--bc-fluid-2xs), env(safe-area-inset-bottom));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.bcc-global-navigation-rail[data-orientation=horizontal] > .bcc-navigation-menu {
|
|
37
|
+
min-inline-size: 0;
|
|
38
|
+
flex: 1 1 auto;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bcc-global-navigation-rail[data-orientation=horizontal] .bcc-navigation-menu__list {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: row;
|
|
44
|
+
align-items: stretch;
|
|
45
|
+
justify-content: space-around;
|
|
46
|
+
gap: var(--bc-fluid-2xs);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.bcc-global-navigation-rail[data-orientation=horizontal] .bcc-navigation-menu__item {
|
|
50
|
+
flex: 1 1 0;
|
|
51
|
+
min-inline-size: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bcc-global-navigation-rail[data-orientation=horizontal] .bce-navigation-item {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
inline-size: 100%;
|
|
60
|
+
min-block-size: var(--bc-size-ui-48);
|
|
61
|
+
gap: var(--bc-fluid-3xs);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.bcc-global-navigation-rail[data-orientation=horizontal] .bce-navigation-item__label {
|
|
65
|
+
max-inline-size: 100%;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
text-overflow: ellipsis;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.bcc-global-navigation-rail[data-orientation=horizontal] > .bcc-global-navigation-rail__footer {
|
|
72
|
+
margin-block-start: 0;
|
|
73
|
+
margin-inline-start: auto;
|
|
74
|
+
inline-size: auto;
|
|
75
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.bcc-navigation-drawer {
|
|
2
|
+
--bcc-navigation-drawer-width: var(--bc-size-ui-256);
|
|
3
|
+
--bcc-navigation-drawer-surface: var(--bcc-floating-sidebar-surface, var(--bc-color-canvas-secondary));
|
|
4
|
+
--bcc-navigation-drawer-radius: var(--bcc-floating-sidebar-radius, var(--bc-radius-lg));
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
inline-size: min(var(--bcc-navigation-drawer-width), 100%);
|
|
7
|
+
max-block-size: 100%;
|
|
8
|
+
overflow-y: auto;
|
|
9
|
+
overscroll-behavior: contain;
|
|
10
|
+
padding: var(--bc-fluid-sm);
|
|
11
|
+
background: var(--bcc-navigation-drawer-surface);
|
|
12
|
+
border: var(--bc-border-width-xs) solid var(--bc-color-border-neutral);
|
|
13
|
+
border-radius: var(--bcc-navigation-drawer-radius);
|
|
14
|
+
box-shadow: var(--bc-shadow-context-floating);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.bcc-navigation-drawer__header {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
gap: var(--bc-fluid-2xs);
|
|
22
|
+
margin-block-end: var(--bc-fluid-sm);
|
|
23
|
+
}
|