diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html
index bcb2f3796c..5dca9a4c2a 100644
--- a/.storybook/preview-head.html
+++ b/.storybook/preview-head.html
@@ -16,25 +16,6 @@
-
-
-
-
diff --git a/.storybook/preview.js b/.storybook/preview.js
index 2b16d285c6..7212f9359b 100644
--- a/.storybook/preview.js
+++ b/.storybook/preview.js
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+import '@material/web/all.js';
+
/** @type { import('@storybook/web-components').Preview } */
const preview = {
parameters: {
diff --git a/client/src/www/ui_components/app-root.js b/client/src/www/ui_components/app-root.js
index 32e48336a0..992c60813d 100644
--- a/client/src/www/ui_components/app-root.js
+++ b/client/src/www/ui_components/app-root.js
@@ -14,6 +14,7 @@
limitations under the License.
*/
+import '@material/web/all.js';
import '@polymer/polymer/polymer-legacy.js';
import '@polymer/polymer/lib/legacy/polymer.dom.js';
import '@polymer/app-layout/app-drawer/app-drawer.js';
diff --git a/client/src/www/views/language_view/index.ts b/client/src/www/views/language_view/index.ts
index ead516e5d2..c371a10b0a 100644
--- a/client/src/www/views/language_view/index.ts
+++ b/client/src/www/views/language_view/index.ts
@@ -17,7 +17,6 @@
import {LitElement, html, css, nothing} from 'lit';
import {customElement, property} from 'lit/decorators.js';
import {classMap} from 'lit/directives/class-map.js';
-import '@material/web/all.js';
@customElement('language-view')
export class LanguageView extends LitElement {
diff --git a/client/src/www/views/servers_view/server_list/index.ts b/client/src/www/views/servers_view/server_list/index.ts
index 266ddef124..04d97d301c 100644
--- a/client/src/www/views/servers_view/server_list/index.ts
+++ b/client/src/www/views/servers_view/server_list/index.ts
@@ -31,12 +31,11 @@ export class ServerList extends LitElement {
width: 100%;
}
- /* TODO(daniellacosse): Remove the hard-coded heights. */
server-row-card {
margin: 0 auto 8px auto;
- height: 130px;
}
+ /* TODO(daniellacosse): Remove the hard-coded heights. */
server-hero-card {
height: 400px;
}
@@ -48,11 +47,18 @@ export class ServerList extends LitElement {
render() {
if (this.hasSingleServer) {
- return html``;
+ return html``;
} else {
return html`
${this.servers.map(
- server => html``
+ server =>
+ html``
)}
`;
}
diff --git a/client/src/www/views/servers_view/server_list_item/index.ts b/client/src/www/views/servers_view/server_list_item/index.ts
index 0ff6db1fdc..8d70bf6580 100644
--- a/client/src/www/views/servers_view/server_list_item/index.ts
+++ b/client/src/www/views/servers_view/server_list_item/index.ts
@@ -11,7 +11,7 @@
limitations under the License.
*/
-import {Menu} from '@material/mwc-menu';
+import type {Menu} from '@material/web/menu/menu';
import {type Localizer} from '@outline/infrastructure/i18n';
import {Ref} from 'lit/directives/ref';
diff --git a/client/src/www/views/servers_view/server_list_item/server_card/index.ts b/client/src/www/views/servers_view/server_list_item/server_card/index.ts
index ba5cbf6642..d7e342bdb8 100644
--- a/client/src/www/views/servers_view/server_list_item/server_card/index.ts
+++ b/client/src/www/views/servers_view/server_list_item/server_card/index.ts
@@ -11,10 +11,7 @@
limitations under the License.
*/
-import {Menu} from '@material/mwc-menu';
-import '@material/mwc-button';
-import '@material/mwc-icon-button';
-import '@material/mwc-menu';
+import type {Menu} from '@material/web/menu/menu';
import {Localizer} from '@outline/infrastructure/i18n';
import {css, html, LitElement} from 'lit';
@@ -59,7 +56,6 @@ const sharedCSS = css`
display: grid;
gap: var(--outline-slim-gutter);
grid-gap: var(--outline-slim-gutter);
- height: 100%;
overflow: hidden;
width: 100%;
}
@@ -69,7 +65,6 @@ const sharedCSS = css`
color: var(--outline-text-color);
gap: var(--outline-slim-gutter);
grid-area: metadata;
- height: 100%;
display: flex;
align-items: center;
}
@@ -109,6 +104,10 @@ const sharedCSS = css`
word-break: break-all;
}
+ .card-menu {
+ --md-menu-container-color: var(--outline-card-background);
+ }
+
.card-menu-button {
align-self: start;
grid-area: menu;
@@ -128,6 +127,12 @@ const sharedCSS = css`
color: var(--outline-error);
margin: 0 var(--outline-slim-gutter);
}
+
+ .card-footer-button {
+ --md-sys-color-primary: var(--outline-primary);
+
+ text-transform: uppercase;
+ }
`;
// TODO(daniellacosse): wrap components in a closure to avoid unnecessary work
@@ -143,7 +148,9 @@ const getSharedComponents = (element: ServerListItemElement & LitElement) => {
const messages = {
serverName: server.name,
error: hasErrorMessage ? localize(server.errorMessageId) : '',
- connectButton: localize(isConnectedState ? 'disconnect-button-label' : 'connect-button-label'),
+ connectButton: localize(
+ isConnectedState ? 'disconnect-button-label' : 'connect-button-label'
+ ),
};
const dispatchers = {
@@ -157,16 +164,25 @@ const getSharedComponents = (element: ServerListItemElement & LitElement) => {
),
forget: () =>
element.dispatchEvent(
- new CustomEvent(ServerListItemEvent.FORGET, {detail: {serverId: server.id}, bubbles: true, composed: true})
- ),
- connectToggle: () =>
- element.dispatchEvent(
- new CustomEvent(isConnectedState ? ServerListItemEvent.DISCONNECT : ServerListItemEvent.CONNECT, {
+ new CustomEvent(ServerListItemEvent.FORGET, {
detail: {serverId: server.id},
bubbles: true,
composed: true,
})
),
+ connectToggle: () =>
+ element.dispatchEvent(
+ new CustomEvent(
+ isConnectedState
+ ? ServerListItemEvent.DISCONNECT
+ : ServerListItemEvent.CONNECT,
+ {
+ detail: {serverId: server.id},
+ bubbles: true,
+ composed: true,
+ }
+ )
+ ),
};
const handleMenuOpen = () => {
@@ -177,8 +193,8 @@ const getSharedComponents = (element: ServerListItemElement & LitElement) => {
return;
}
- if (!menuElement.anchor) {
- menuElement.anchor = menuButtonElement;
+ if (!menuElement.anchorElement) {
+ menuElement.anchorElement = menuButtonElement;
}
menuElement.show();
@@ -190,33 +206,41 @@ const getSharedComponents = (element: ServerListItemElement & LitElement) => {
elements: {
metadataText: html`
-
+
`,
menu: html`
-
- ${localize('server-rename')}
- ${localize('server-forget')}
-
+
`,
menuButton: html`
-
+ >
+ more_vert
+
`,
footer: html`
`,
},
@@ -238,9 +262,13 @@ export class ServerRowCard extends LitElement implements ServerListItemElement {
sharedCSS,
css`
.card {
- --min-indicator-size: calc(var(--server-name-size) + var(--outline-mini-gutter) + var(--server-address-size));
+ --min-indicator-size: calc(
+ var(--server-name-size) + var(--outline-mini-gutter) +
+ var(--server-address-size)
+ );
--max-indicator-size: calc(
- var(--outline-slim-gutter) + var(--server-name-size) + var(--outline-mini-gutter) + var(--server-address-size) +
+ var(--outline-slim-gutter) + var(--server-name-size) +
+ var(--outline-mini-gutter) + var(--server-address-size) +
var(--outline-slim-gutter)
);
@@ -264,7 +292,9 @@ export class ServerRowCard extends LitElement implements ServerListItemElement {
return html`
-
+
${elements.metadataText}
${elements.menuButton} ${elements.footer}
@@ -278,7 +308,10 @@ export class ServerRowCard extends LitElement implements ServerListItemElement {
* Display a featured Server in a showcase.
*/
@customElement('server-hero-card')
-export class ServerHeroCard extends LitElement implements ServerListItemElement {
+export class ServerHeroCard
+ extends LitElement
+ implements ServerListItemElement
+{
@property() server: ServerListItem;
@property() localize: Localizer;
@@ -334,7 +367,9 @@ export class ServerHeroCard extends LitElement implements ServerListItemElement
render() {
const {elements, dispatchers, messages} = getSharedComponents(this);
- const connectionStatusText = this.localize(`${this.server.connectionState}-server-state`);
+ const connectionStatusText = this.localize(
+ `${this.server.connectionState}-server-state`
+ );
const connectToggleKeyboardDispatcher = (event: KeyboardEvent) => {
event.preventDefault();
event.stopImmediatePropagation();
@@ -346,7 +381,9 @@ export class ServerHeroCard extends LitElement implements ServerListItemElement
return html`
-
${elements.metadataText}
+
+ ${elements.metadataText}
+
${elements.menuButton}
-
+
${elements.footer}