Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions dev/assets/lucide-icons/cog.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions dev/assets/lucide-icons/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions dev/assets/lucide-icons/messages-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 59 additions & 12 deletions dev/aura.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<title>Aura</title>
<link rel="stylesheet" href="../packages/aura/aura.css" />
<link rel="stylesheet" href="./aura/aura-view.css" />
<script type="module">
window.Vaadin ||= {};
window.Vaadin.featureFlags ||= {};
window.Vaadin.featureFlags.masterDetailLayoutComponent = true;
</script>
<script type="module">
import './aura/aura-color-control.js';
import './aura/aura-font-family-control.js';
Expand All @@ -19,6 +24,7 @@
import '@vaadin/button';
import '@vaadin/checkbox';
import '@vaadin/icon';
import '@vaadin/master-detail-layout';
import '@vaadin/popover';
import '@vaadin/side-nav';
import '@vaadin/vertical-layout';
Expand Down Expand Up @@ -116,18 +122,59 @@
</vaadin-button>
</footer>

<main class="aura-view" theme="surface">
<header>
<vaadin-drawer-toggle theme="tertiary"></vaadin-drawer-toggle>
<h1>View Title</h1>
</header>
<vaadin-vertical-layout theme="padding">
<div theme="surface" style="padding: 2em; --aura-surface-level: 1"> Level 1 </div>
<div theme="surface" style="padding: 2em; --aura-surface-level: 2"> Level 2 </div>
<div theme="surface" style="padding: 2em; --aura-surface-level: 3"> Level 3 </div>
<div theme="surface" style="padding: 2em; --aura-surface-level: 4"> Level 4 </div>
</vaadin-vertical-layout>
</main>
<vaadin-master-detail-layout master-min-size="14rem" detail-min-size="40rem" class="dashboard-section">
<div class="aura-view">
<header>
<vaadin-drawer-toggle theme="tertiary"></vaadin-drawer-toggle>
<h1>Dashboard</h1>
</header>
<vaadin-scroller theme="overflow-indicators">
<vaadin-side-nav theme="contrast">
<vaadin-side-nav-item path="#components">
<vaadin-icon src="./assets/lucide-icons/home.svg" slot="prefix"></vaadin-icon>
<span>Components</span>
</vaadin-side-nav-item>
<vaadin-side-nav-item>
<vaadin-icon src="./assets/lucide-icons/chart-column-big.svg" slot="prefix"></vaadin-icon>
<span>Grid View</span>
</vaadin-side-nav-item>
<vaadin-side-nav-item>
<vaadin-icon src="./assets/lucide-icons/chart-pie.svg" slot="prefix"></vaadin-icon>
<span>Reporting</span>
</vaadin-side-nav-item>
<vaadin-side-nav-item>
<vaadin-icon src="./assets/lucide-icons/cog.svg" slot="prefix"></vaadin-icon>
<span>Settings</span>
<vaadin-side-nav-item slot="children">
<span>Account</span>
</vaadin-side-nav-item>
<vaadin-side-nav-item slot="children">
<span>Preferences</span>
</vaadin-side-nav-item>
<vaadin-side-nav-item slot="children">
<span>Subscription</span>
</vaadin-side-nav-item> </vaadin-side-nav-item
><vaadin-side-nav-item>
<vaadin-icon src="./assets/lucide-icons/messages-square.svg" slot="prefix"></vaadin-icon>
<span>Support</span>
</vaadin-side-nav-item>
</vaadin-side-nav>
</vaadin-scroller>
</div>

<main class="aura-view" slot="detail">
<header>
<vaadin-drawer-toggle theme="tertiary"></vaadin-drawer-toggle>
<h1>Components</h1>
</header>
<vaadin-vertical-layout theme="padding">
<div theme="surface" style="padding: 2em; --aura-surface-level: 1">Level 1</div>
<div theme="surface" style="padding: 2em; --aura-surface-level: 2">Level 2</div>
<div theme="surface" style="padding: 2em; --aura-surface-level: 3">Level 3</div>
<div theme="surface" style="padding: 2em; --aura-surface-level: 4">Level 4</div>
</vaadin-vertical-layout>
</main>
</vaadin-master-detail-layout>
</vaadin-app-layout>

<vaadin-popover
Expand Down
4 changes: 4 additions & 0 deletions packages/aura/aura.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
@import './src/typography.css';

@import './src/components/app-layout.css';
@import './src/components/master-detail-layout.css';
@import './src/components/overlay.css';
@import './src/components/side-nav.css';

:where(html) {
cursor: default;
/* TODO: slightly smaller chevron than the one in base styles - consider if we should do this in base styles */
--_vaadin-icon-chevron-down: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
}
45 changes: 45 additions & 0 deletions packages/aura/src/components/master-detail-layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
vaadin-master-detail-layout::part(detail) {
--aura-surface-level: 2;
background: var(--aura-surface) padding-box;
}

vaadin-master-detail-layout[drawer]::part(detail) {
--aura-surface-opacity: var(--aura-overlay-surface-opacity);
background: var(--aura-surface) padding-box;
-webkit-backdrop-filter: var(--aura-overlay-backdrop-filter);
backdrop-filter: var(--aura-overlay-backdrop-filter);
box-shadow:
inset 1px 0 0 0 var(--aura-overlay-inner-outline-color),
-1px 0 0 0 var(--aura-overlay-outline-color),
var(--aura-shadow-m);
}

vaadin-master-detail-layout[containment='viewport'][drawer]::part(detail) {
box-shadow: var(--aura-overlay-shadow);
}

/* TODO could be a built-in variant */
vaadin-master-detail-layout[theme~='inset-drawer'][drawer]::part(detail),
vaadin-master-detail-layout[containment='viewport'][drawer]::part(detail) {
margin: calc(var(--aura-app-layout-inset) / 2);
border-radius: var(--_app-layout-radius);
}

vaadin-master-detail-layout > vaadin-master-detail-layout,
vaadin-master-detail-layout:not([drawer])::part(detail) {
border-start-end-radius: var(--_app-layout-radius);
border-end-end-radius: var(--_app-layout-radius);
}

/* TODO these end up affecting all MDLs, not just the one directly inside the App Layout */
::view-transition-group(vaadin-mdl-backdrop),
::view-transition-group(vaadin-mdl-master),
::view-transition-group(vaadin-mdl-detail) {
border-radius: var(--_app-layout-radius);
overflow: hidden;
}

/* ::view-transition-group(vaadin-mdl-detail.viewport) {
border-radius: 0;
overflow: visible;
} */
113 changes: 113 additions & 0 deletions packages/aura/src/components/side-nav.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
html {
--vaadin-side-nav-label-line-height: var(--aura-line-height-xs);
--vaadin-side-nav-label-font-weight: var(--aura-font-weight-medium);
--vaadin-side-nav-item-font-weight: var(--aura-font-weight-medium);
--vaadin-side-nav-item-border-width: 1px;
--vaadin-side-nav-items-gap: var(--vaadin-gap-xs);
}

vaadin-side-nav + vaadin-side-nav {
margin-top: var(--vaadin-gap-l);
}

vaadin-side-nav-item::part(content) {
transition:
color 120ms,
border-color 120ms,
background-color 120ms;
background-clip: padding-box;
--aura-surface-level: 3;
}

vaadin-side-nav-item:not([disabled])::part(content):hover {
--vaadin-side-nav-item-color: var(--vaadin-color);
}

vaadin-side-nav-item[current]::part(content) {
--vaadin-side-nav-item-background: var(--aura-surface);
--vaadin-side-nav-item-border-color: var(--vaadin-border-color-subtle);
}

/* @media (prefers-reduced-motion: no-preference) {
vaadin-side-nav[collapsed]::part(children),
vaadin-side-nav-item::part(children) {
--vaadin-side-nav-hidden-display: flex;
transition: 200ms;
transition-property: display, height, opacity;
transition-behavior: allow-discrete;
interpolate-size: allow-keywords;
overflow: hidden;
height: 0;

@starting-style {
height: 0;
opacity: 0;
}
}

vaadin-side-nav:not([collapsed])::part(children),
vaadin-side-nav-item[expanded]::part(children) {
height: auto;
}
} */

/* Contrast variant */

vaadin-side-nav[theme~='contrast'] vaadin-side-nav-item[current]::part(content) {
color-scheme: var(--_side-nav-current-item-color-scheme, dark);
background: var(--aura-surface-solid);
border-color: transparent;
outline-offset: 2px;
}

vaadin-side-nav[theme~='contrast'] vaadin-side-nav-item[current] > :not([slot='children']) {
--aura-red: var(--vaadin-color);
--aura-red-text: var(--vaadin-color);
--aura-orange: var(--vaadin-color);
--aura-orange-text: var(--vaadin-color);
--aura-yellow: var(--vaadin-color);
--aura-yellow-text: var(--vaadin-color);
--aura-green: var(--vaadin-color);
--aura-green-text: var(--vaadin-color);
--aura-blue: var(--vaadin-color);
--aura-blue-text: var(--vaadin-color);
--aura-purple: var(--vaadin-color);
--aura-purple-text: var(--vaadin-color);
}

@container style(--aura-color-scheme: dark) {
[slot='drawer'] {
--_side-nav-current-item-color-scheme: light;
}
}

@container style(--aura-content-color-scheme: dark) {
vaadin-app-layout > :not([slot]) {
--_side-nav-current-item-color-scheme: light;
}
}

@container style(--aura-content-color-scheme: light) {
vaadin-app-layout > :not([slot]) {
--_side-nav-current-item-color-scheme: dark;
}
}

@media (prefers-color-scheme: dark) {
@container style(--aura-content-color-scheme: light dark) {
vaadin-app-layout > :not([slot]) {
--_side-nav-current-item-color-scheme: light;
}
}

@container style(--aura-color-scheme: light dark) {
[slot='drawer'] {
--_side-nav-current-item-color-scheme: light;
}
}
}

/* TODO bug in component/base styles: hide label part if no label is provided */
vaadin-side-nav:not(:has([slot='label']))::part(label) {
display: none;
}
2 changes: 2 additions & 0 deletions packages/aura/src/surface.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ html,
[theme~='surface-solid'],
vaadin-app-layout::part(navbar),
vaadin-app-layout::part(drawer),
vaadin-master-detail-layout::part(detail),
vaadin-side-nav-item::part(content),
::part(overlay) {
--aura-surface-opacity: 0.5;

Expand Down