diff --git a/ui/packages/consul-ui/app/components/app/index.scss b/ui/packages/consul-ui/app/components/app/index.scss
index 8dc88a2ab3..eea9542d0c 100644
--- a/ui/packages/consul-ui/app/components/app/index.scss
+++ b/ui/packages/consul-ui/app/components/app/index.scss
@@ -25,6 +25,16 @@
@extend %main-nav-horizontal;
margin-left: auto;
}
+%main-nav-vertical-hoisted {
+ top: 11px;
+}
+%main-nav-vertical-hoisted > .popover-menu > label > button {
+ @extend %main-nav-horizontal-action;
+ border: none;
+}
+%main-nav-vertical-hoisted.is-active > label > * {
+ @extend %main-nav-horizontal-action-active;
+}
%main-nav-sidebar,
main {
@extend %transition-pushover;
diff --git a/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs b/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs
index e5c467e34b..825361cf32 100644
--- a/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs
+++ b/ui/packages/consul-ui/app/components/hashicorp-consul/index.hbs
@@ -18,14 +18,54 @@
<:main-nav>
{{#if @dc}}
+
+
+
+
+ {{@dc.Name}}
+
+
+{{#let components.MenuItem components.MenuSeparator as |MenuItem MenuSeparator|}}
+
+ {{#each (sort-by 'Name' @dcs) as |item|}}
+
+
+ {{item.Name}}
+ {{#if item.Local}}
+ Local
+ {{/if}}
+
+
+ {{/each}}
+{{/let}}
+
+
+
+
{{#let (or this.nspaces @nspaces) as |nspaces|}}
{{#if (can "choose nspaces" nspaces=nspaces)}}
- Namespace
-
+
{{@nspace.Name}}
@@ -70,41 +110,6 @@
{{/if}}
{{/let}}
-
- Datacenter
-
-
- {{@dc.Name}}
-
-
- {{#let components.MenuItem components.MenuSeparator as |MenuItem MenuSeparator|}}
-
- {{#each (sort-by 'Name' @dcs) as |item|}}
-
-
- {{item.Name}}
- {{#if item.Local}}
- Local
- {{/if}}
-
-
- {{/each}}
- {{/let}}
-
-
-
-
{{#if (can "read services")}}
Services
diff --git a/ui/packages/consul-ui/app/components/hashicorp-consul/index.scss b/ui/packages/consul-ui/app/components/hashicorp-consul/index.scss
index 84f5a8bda8..9d229c7ebb 100644
--- a/ui/packages/consul-ui/app/components/hashicorp-consul/index.scss
+++ b/ui/packages/consul-ui/app/components/hashicorp-consul/index.scss
@@ -1,4 +1,11 @@
.hashicorp-consul {
+ [role="banner"] nav .dcs {
+ @extend %main-nav-vertical-hoisted;
+ left: 100px;
+ }
+ [role="banner"] nav .dcs .popover-menu[aria-label]::before {
+ display: none;
+ }
[role="banner"] a svg {
fill: var(--brand-600);
}
diff --git a/ui/packages/consul-ui/app/components/main-nav-vertical/README.mdx b/ui/packages/consul-ui/app/components/main-nav-vertical/README.mdx
new file mode 100644
index 0000000000..9359a4831b
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/main-nav-vertical/README.mdx
@@ -0,0 +1,71 @@
+---
+class: css
+---
+# MainNavVertical
+
+Used for styles of vertically orientated main application menus/navigation.
+
+Menu item active state is applied on `.is-active` ` ` elements. Additionally you can use the following placeholders for setting certin states manually:
+
+- `%menu-nav-vertical-action-active` The 'active' or currently selected state.
+- `%menu-nav-vertical-action-intent` The highlighted state, usually for `:hover`
+ and `:focus`.
+
+`%menu-nav-vertical-hoisted` will 'hoist' an ` ` element to the top of the
+containing block, the containing block defaults to the current viewport. If
+you need to define a different ancestor for a containing block you can use
+`transform` (see below).
+
+```hbs preview-template
+
+```
+
+```css preview-template
+.main-nav-vertical {
+ @extend %main-nav-vertical;
+}
+.main-nav-vertical li.hoisted {
+ @extend %main-nav-vertical-hoisted;
+}
+.main-nav-vertical .with-intent > * {
+ @extend %main-nav-vertical-action-intent;
+}
+.main-nav-vertical .custom-active > * {
+ @extend %main-nav-vertical-action-active;
+}
+.wrapper {
+ /* a transform is required to mark this element as the containing block */
+ /* for hoisting, otherwise the viewport is the containing block */
+ transform: translate(0, 0);
+ background-color: var(--gray-600);
+ padding-top: 64px;
+}
+```
diff --git a/ui/packages/consul-ui/app/components/main-nav-vertical/debug.scss b/ui/packages/consul-ui/app/components/main-nav-vertical/debug.scss
new file mode 100644
index 0000000000..21b3507127
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/main-nav-vertical/debug.scss
@@ -0,0 +1,29 @@
+#docfy-demo-preview-main-nav-vertical {
+ .main-nav-vertical {
+ @extend %main-nav-vertical;
+ }
+ .main-nav-vertical li.hoisted {
+ @extend %main-nav-vertical-hoisted;
+ }
+ .main-nav-vertical .with-intent > * {
+ @extend %main-nav-vertical-action-intent;
+ }
+ .main-nav-vertical .custom-active > * {
+ @extend %main-nav-vertical-action-active;
+ }
+ .wrapper {
+ /* a transform is required to mark this element as the containing block */
+ /* for hoisting, otherwise the viewport is the containing block */
+ transform: translate(0, 0);
+ background-color: var(--gray-600);
+ padding-top: 64px;
+ }
+ // TODO: Reduce the need for these debug overrides
+ .main-nav-vertical {
+ position: static;
+ height: auto;
+ }
+ .main-nav-vertical ul {
+ margin-bottom: 0 !important;
+ }
+}
diff --git a/ui/packages/consul-ui/app/components/main-nav-vertical/layout.scss b/ui/packages/consul-ui/app/components/main-nav-vertical/layout.scss
index 04d016a405..9007228c7f 100644
--- a/ui/packages/consul-ui/app/components/main-nav-vertical/layout.scss
+++ b/ui/packages/consul-ui/app/components/main-nav-vertical/layout.scss
@@ -40,3 +40,8 @@
%main-nav-vertical-menu-panel {
min-width: 248px;
}
+%main-nav-vertical-hoisted {
+ visibility: visible;
+ position: fixed;
+ z-index: 10;
+}
diff --git a/ui/packages/consul-ui/app/components/main-nav-vertical/skin.scss b/ui/packages/consul-ui/app/components/main-nav-vertical/skin.scss
index d816bcc8f8..2d49eeedae 100644
--- a/ui/packages/consul-ui/app/components/main-nav-vertical/skin.scss
+++ b/ui/packages/consul-ui/app/components/main-nav-vertical/skin.scss
@@ -40,6 +40,12 @@
background-color: var(--gray-150);
border-color: var(--gray-999);
}
+%main-nav-vertical .popover-menu[aria-label]::before {
+ content: attr(aria-label);
+ display: block;
+ margin-top: -.5rem;
+ margin-bottom: .5rem;
+}
%main-nav-vertical .is-local span:last-of-type {
@extend %pill-200;
color: var(--gray-000);
diff --git a/ui/packages/consul-ui/app/styles/debug.scss b/ui/packages/consul-ui/app/styles/debug.scss
index 77e7d176c0..8f797eda4a 100644
--- a/ui/packages/consul-ui/app/styles/debug.scss
+++ b/ui/packages/consul-ui/app/styles/debug.scss
@@ -1,6 +1,9 @@
-@import './base/reset/index';
-@import './base/index';
+@import './app';
@import 'prism-coldark-dark';
+
+// temporary component debugging setup
+@import 'consul-ui/components/main-nav-vertical/debug';
+
.docs {
.tabular-collection,
.list-collection {
@@ -31,8 +34,12 @@
}
ol,
ul {
- list-style-position: inside;
+ list-style-position: outside;
margin-bottom: 1rem;
+ margin-left: 2rem;
+ }
+ ul {
+ list-style-type: disc;
}
}
.docfy-demo {
diff --git a/ui/packages/consul-ui/lib/startup/templates/head.html.js b/ui/packages/consul-ui/lib/startup/templates/head.html.js
index 11453cedb2..6bc28f79b3 100644
--- a/ui/packages/consul-ui/lib/startup/templates/head.html.js
+++ b/ui/packages/consul-ui/lib/startup/templates/head.html.js
@@ -7,10 +7,9 @@ module.exports = ({ appName, environment, rootURL, config }) => `
-
- ${
- environment === 'development' ? ` ` : ``
- }
+
${
environment === 'test' ? ` ` : ``
}