+
+```
+
+
+```css
+ p, ul {
+ @extend %csv-list;
+ }
+ ol li {
+ @extend %csv;
+ }
+ ol {
+ list-style-type: none;
+ }
+```
+
+## Properties
+
+| Property | Type | Default | Description |
+| --- | --- | --- | --- |
+| `--csv-list-separator` | `string` | `,` | The separator to use between the list items. |
diff --git a/ui/packages/consul-ui/app/components/csv-list/debug.scss b/ui/packages/consul-ui/app/components/csv-list/debug.scss
new file mode 100644
index 0000000000..eea7038e19
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/csv-list/debug.scss
@@ -0,0 +1,12 @@
+[id^=docfy-demo-preview-csv-list] {
+ p, ul {
+ @extend %csv-list;
+ }
+ ol li {
+ @extend %csv;
+ }
+ ol {
+ list-style-type: none;
+ }
+}
+
diff --git a/ui/packages/consul-ui/app/components/csv-list/index.scss b/ui/packages/consul-ui/app/components/csv-list/index.scss
new file mode 100644
index 0000000000..504b252899
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/csv-list/index.scss
@@ -0,0 +1,16 @@
+:root {
+ --csv-list-separator: ',';
+}
+%csv-list {
+ // mainly used for block elements, you may need to overwrite this with an
+ // inline-flex to keep any inline-ness
+ display: flex;
+}
+%csv-list > * {
+ @extend %csv;
+}
+%csv:not(:last-child)::after {
+ display: inline;
+ content: var(--csv-list-separator);
+ margin-right: 0.3em;
+}
diff --git a/ui/packages/consul-ui/app/components/horizontal-kv-list/README.mdx b/ui/packages/consul-ui/app/components/horizontal-kv-list/README.mdx
new file mode 100644
index 0000000000..f39a689d9b
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/horizontal-kv-list/README.mdx
@@ -0,0 +1,238 @@
+---
+class: css
+---
+# horizontal-kv-list
+
+Provides a horizontally stacked list of key/value pairs, commonly used with a
+definition/description list.
+
+The keys can be configured to be either, visible, invisible, or with an icon.
+
+- **Icon Configuration:** Add a `class` that describes the key/value pair and configure the icon for that class in the CSS
+- **Visible Title Configuration:** Add an empty `class` attribute. A trailing `:`
+ will be added to the title (ensure you collapse the whitespace in the `dt`).
+- **Invisible Title Configuration:** Don't add a `class` attribute at all, i.e. by default
+ the title is not shown.
+
+If you are providing an icon, you should also use the `{{tooltip}}` modifier
+to provide a textual tooltip for the icon. Using the `{{tooltip}}` modifier
+with no arguments will make it use the text/DOM content of the DOM element it
+is attached to, see below for a full usage example.
+
+`` components are commonly added to the value, and can be added
+to the left or right of the value.
+
+```hbs preview-template
+
+
+
+
+
+```
+When conditionally listing key/values within a single `dl`, be aware that if no key/values should be shown, then you will be left with an empty `dl`. If you collapse the whitespace using handlebars whitespace collapsing `~`, then this empty `dl` will be removed from the flow via CSS. Alternatively consider using multiple `dl`s which can be wrapped with conditionals individually and therefore leave no empty DOM.
+
+When using as individual `dl` lists be aware of whitespace between `dl`s. There are various ways you can counter this:
+
+1. remove the whitespace `
`.
+2. Wrap the whitespace in comments `
`
+3. Use handlebars whitespace removal `~` as above.
+4. Put a `display: inline-flex` on the parent element (this can affect other layout).
+
+Depending on your exact usecase one of the above options may be more suited than others.
+
+```hbs preview-template
+
+```
+
+
+```css
+dl {
+ @extend %horizontal-kv-list;
+}
+.lock-delay::before {
+ @extend %with-delay-mask, %as-pseudo;
+ color: var(--gray-700);
+}
+.ttl::before {
+ @extend %with-history-mask, %as-pseudo;
+ color: var(--blue-500);
+}
+.service-identity {
+ @extend %badge;
+}
+.kind-terminating-gateway {
+ @extend %badge, %badge-with-icon;
+}
+.kind-terminating-gateway::before {
+ @extend %with-gateway-mask, %as-pseudo;
+}
+.reversed > dl {
+ @extend %horizontal-kv-list-reversed;
+}
+.reversed .service-identity {
+ @extend %badge-reversed;
+}
+.reversed .kind-terminating-gateway {
+ @extend %badge-with-icon-reversed;
+}
+```
+
+## Properties
+
+| Property | Type | Default | Description |
+| --- | --- | --- | --- |
+| `--horizontal-kv-list-separator-width` | `length-percentage` | `18px` | The width of the whitespace between two sets of key/value pairs |
+| `--horizontal-kv-list-key-separator` | `string` | `:` | Separator used for between `Key: Value` for textual key/values |
+| `--horizontal-kv-list-key-wrapper-start` | `string` | `(` | Starting wrapper used for wrapping `Value (Key)` for reversed textual key/values |
+| `--horizontal-kv-list-key-wrapper-end` | `string` | `)` | Ending wrapper used for wrapping `Value (Key)` for reversed textual key/values |
diff --git a/ui/packages/consul-ui/app/components/horizontal-kv-list/debug.scss b/ui/packages/consul-ui/app/components/horizontal-kv-list/debug.scss
new file mode 100644
index 0000000000..f8c365dcee
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/horizontal-kv-list/debug.scss
@@ -0,0 +1,31 @@
+[id^=docfy-demo-preview-horizontal-kv-list] {
+ dl {
+ @extend %horizontal-kv-list;
+ }
+ .lock-delay::before {
+ @extend %with-delay-mask, %as-pseudo;
+ color: var(--gray-700);
+ }
+ .ttl::before {
+ @extend %with-history-mask, %as-pseudo;
+ color: var(--blue-500);
+ }
+ .service-identity {
+ @extend %badge;
+ }
+ .kind-terminating-gateway {
+ @extend %badge, %badge-with-icon;
+ }
+ .kind-terminating-gateway::before {
+ @extend %with-gateway-mask, %as-pseudo;
+ }
+ .reversed > dl {
+ @extend %horizontal-kv-list-reversed;
+ }
+ .reversed .service-identity {
+ @extend %badge-reversed;
+ }
+ .reversed .kind-terminating-gateway {
+ @extend %badge-with-icon-reversed;
+ }
+}
diff --git a/ui/packages/consul-ui/app/components/horizontal-kv-list/index.scss b/ui/packages/consul-ui/app/components/horizontal-kv-list/index.scss
new file mode 100644
index 0000000000..338ff82c5b
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/horizontal-kv-list/index.scss
@@ -0,0 +1,23 @@
+@import './skin';
+@import './layout';
+
+:root {
+ --horizontal-kv-list-separator-width: 18px;
+ --horizontal-kv-list-key-separator: ':';
+ --horizontal-kv-list-key-wrapper-start: '(';
+ --horizontal-kv-list-key-wrapper-end: ')';
+}
+%horizontal-kv-list:not([class]) dt:not([class]) {
+ @extend %horizontal-kv-list-hidden-title;
+}
+%horizontal-kv-list[class] dt,
+%horizontal-kv-list dt[class] {
+ @extend %horizontal-kv-list-visible-title;
+}
+%horizontal-kv-list-hidden-title {
+ @extend %visually-hidden;
+}
+%horizontal-kv-list-visible-title {
+ @extend %unvisually-hidden;
+ overflow: hidden;
+}
diff --git a/ui/packages/consul-ui/app/components/horizontal-kv-list/layout.scss b/ui/packages/consul-ui/app/components/horizontal-kv-list/layout.scss
new file mode 100644
index 0000000000..fab1160e97
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/horizontal-kv-list/layout.scss
@@ -0,0 +1,44 @@
+%horizontal-kv-list {
+ display: inline-flex;
+ flex-wrap: nowrap;
+}
+%horizontal-kv-list-reversed {
+ flex-direction: row-reverse;
+}
+%horizontal-kv-list:empty {
+ display: none;
+}
+%horizontal-kv-list > * > * {
+ display: inline-block;
+}
+%horizontal-kv-list > * {
+ // align-self: center;
+ white-space: nowrap;
+}
+%horizontal-kv-list > dd {
+ flex-wrap: wrap;
+}
+%horizontal-kv-list-visible-title {
+ min-width: 18px;
+}
+%horizontal-kv-list-reversed:not(:first-of-type),
+%horizontal-kv-list dd + dt,
+%horizontal-kv-list dd + %horizontal-kv-list-hidden-title + dd {
+ margin-left: var(--horizontal-kv-list-separator-width);
+}
+/* this quite possibly should be dealt with by the parent/container not this */
+/* component. It adds the same whitespace separation between multiple kv-lists */
+/* in this case, as we can make lists with dls, or dt/dd combos, multiple dls */
+/* are seens as one component and therefore this is spacing not positioning */
+%horizontal-kv-list + %horizontal-kv-list:not(:first-of-type) {
+ margin-left: var(--horizontal-kv-list-separator-width);
+}
+/**/
+%horizontal-kv-list-reversed dt,
+%horizontal-kv-list-visible-title + dd {
+ margin-left: 4px;
+}
+
+%horizontal-kv-list-reversed dt + dd {
+ margin-left: 0;
+}
diff --git a/ui/packages/consul-ui/app/components/horizontal-kv-list/skin.scss b/ui/packages/consul-ui/app/components/horizontal-kv-list/skin.scss
new file mode 100644
index 0000000000..9cbf85d80d
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/horizontal-kv-list/skin.scss
@@ -0,0 +1,13 @@
+%horizontal-kv-list dt[class=""]::after,
+%horizontal-kv-list dt[class=""]::after {
+ display: inline;
+}
+%horizontal-kv-list dt[class=""]::after {
+ content: var(--horizontal-kv-list-key-separator);
+}
+%horizontal-kv-list-reversed dt[class=""]::after {
+ content: var(--horizontal-kv-list-key-wrapper-end);
+}
+%horizontal-kv-list-reversed dt[class=""]::before {
+ content: var(--horizontal-kv-list-key-wrapper-start);
+}
diff --git a/ui/packages/consul-ui/app/components/icon-definition/README.mdx b/ui/packages/consul-ui/app/components/icon-definition/README.mdx
new file mode 100644
index 0000000000..0373316819
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/icon-definition/README.mdx
@@ -0,0 +1,34 @@
+---
+class: css
+---
+# icon-definition
+
+This CSS component is deprecated, please use `%horizontal-kv-list` instead (which this component uses)
+
+```hbs preview-template
+
+
+ Lock Delay
+
+
10ms
+
+
+
+ Scope
+
+
local
+
+```
+
+```css
+dl {
+ @extend %icon-definition;
+}
+.lock-delay dt::before {
+ @extend %with-delay-mask, %as-pseudo;
+}
+```
diff --git a/ui/packages/consul-ui/app/components/icon-definition/debug.scss b/ui/packages/consul-ui/app/components/icon-definition/debug.scss
new file mode 100644
index 0000000000..4c3c4fb12c
--- /dev/null
+++ b/ui/packages/consul-ui/app/components/icon-definition/debug.scss
@@ -0,0 +1,8 @@
+#docfy-demo-preview-icon-definition {
+ dl {
+ @extend %icon-definition;
+ }
+ .lock-delay dt::before {
+ @extend %with-delay-mask, %as-pseudo;
+ }
+}
diff --git a/ui/packages/consul-ui/app/styles/components/icon-definition.scss b/ui/packages/consul-ui/app/components/icon-definition/index.scss
similarity index 94%
rename from ui/packages/consul-ui/app/styles/components/icon-definition.scss
rename to ui/packages/consul-ui/app/components/icon-definition/index.scss
index 0afcdb2941..16c34ebbea 100644
--- a/ui/packages/consul-ui/app/styles/components/icon-definition.scss
+++ b/ui/packages/consul-ui/app/components/icon-definition/index.scss
@@ -1,4 +1,9 @@
-@import './icon-definition/index';
+%icon-definition {
+ @extend %horizontal-kv-list;
+}
+%icon-definition > dt > * {
+ display: none;
+}
%icon-definition.passing dt::before,
%composite-row-header .passing dd::before {
diff --git a/ui/packages/consul-ui/app/components/tag-list/README.mdx b/ui/packages/consul-ui/app/components/tag-list/README.mdx
index 1421cef7fa..1dcd327f45 100644
--- a/ui/packages/consul-ui/app/components/tag-list/README.mdx
+++ b/ui/packages/consul-ui/app/components/tag-list/README.mdx
@@ -4,6 +4,8 @@ Template only component for rendering a list of tags. You can pass either/or/and
Tags are de-duplicated when rendered.
+Uses `%horizontal-kv-list` for positioning/icon and `%csv-list` for tag separating
+
```hbs preview-template
- This list has no tags therefore the tags _and_ red border div will **not** be rendered.
+ This list has no tags therefore the tags _and_ red border div will not be rendered.
* {
- align-self: center;
-}
-%icon-definition > dd {
- white-space: nowrap;
- margin-left: 4px;
-}
-%icon-definition > dt > * {
- display: none;
-}
diff --git a/ui/packages/consul-ui/app/styles/components/icon-definition/skin.scss b/ui/packages/consul-ui/app/styles/components/icon-definition/skin.scss
deleted file mode 100644
index e449ba8713..0000000000
--- a/ui/packages/consul-ui/app/styles/components/icon-definition/skin.scss
+++ /dev/null
@@ -1,2 +0,0 @@
-%icon-definition {
-}
diff --git a/ui/packages/consul-ui/app/styles/components/list-row/layout.scss b/ui/packages/consul-ui/app/styles/components/list-row/layout.scss
index e3b59be6fc..8440596fa9 100644
--- a/ui/packages/consul-ui/app/styles/components/list-row/layout.scss
+++ b/ui/packages/consul-ui/app/styles/components/list-row/layout.scss
@@ -26,7 +26,6 @@
flex-wrap: nowrap;
}
-%list-row-detail dl,
%list-row-detail > span {
margin-right: 18px;
}
diff --git a/ui/packages/consul-ui/app/styles/components/tag-list.scss b/ui/packages/consul-ui/app/styles/components/tag-list.scss
deleted file mode 100644
index 6bc2ea8e70..0000000000
--- a/ui/packages/consul-ui/app/styles/components/tag-list.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-@import './tag-list/index';
-.tag-list,
-td.tags {
- @extend %tag-list;
-}
diff --git a/ui/packages/consul-ui/app/styles/components/tag-list/index.scss b/ui/packages/consul-ui/app/styles/components/tag-list/index.scss
deleted file mode 100644
index bc18252196..0000000000
--- a/ui/packages/consul-ui/app/styles/components/tag-list/index.scss
+++ /dev/null
@@ -1,2 +0,0 @@
-@import './skin';
-@import './layout';
diff --git a/ui/packages/consul-ui/app/styles/components/tag-list/layout.scss b/ui/packages/consul-ui/app/styles/components/tag-list/layout.scss
deleted file mode 100644
index d1c866afdb..0000000000
--- a/ui/packages/consul-ui/app/styles/components/tag-list/layout.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-%tag-list {
- white-space: nowrap;
- display: inline-flex;
-}
-// TODO: Currently this is here to overwrite
-// the default definition list layout used in edit pages
-// ideally we'd be more specific with those to say
-// only add padding to dl's in edit pages
-%tag-list dt::before {
- @extend %with-tag-mask, %as-pseudo;
- margin-right: 4px;
- margin-top: 3px;
- background-color: $gray-500;
-}
-%tag-list dd {
- display: inline-flex;
- flex-wrap: wrap;
- padding-left: 0px;
-}
-%tag-list dd > *:not(:last-child)::after {
- content: ',';
- margin-right: 0.3em;
- display: inline;
-}
diff --git a/ui/packages/consul-ui/app/styles/components/tag-list/skin.scss b/ui/packages/consul-ui/app/styles/components/tag-list/skin.scss
deleted file mode 100644
index ef5a8f9ea1..0000000000
--- a/ui/packages/consul-ui/app/styles/components/tag-list/skin.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-%tag-list::before {
- background-color: $gray-500;
-}
diff --git a/ui/packages/consul-ui/app/styles/debug.scss b/ui/packages/consul-ui/app/styles/debug.scss
index be65420160..2b59748f33 100644
--- a/ui/packages/consul-ui/app/styles/debug.scss
+++ b/ui/packages/consul-ui/app/styles/debug.scss
@@ -3,6 +3,10 @@
// temporary component debugging setup
@import 'consul-ui/components/main-nav-vertical/debug';
+@import 'consul-ui/components/badge/debug';
+@import 'consul-ui/components/csv-list/debug';
+@import 'consul-ui/components/horizontal-kv-list/debug';
+@import 'consul-ui/components/icon-definition/debug';
html.is-debug body > .brand-loader {
display: none !important;
@@ -27,6 +31,10 @@ html.is-debug body > .brand-loader {
@extend %with-glimmer-logo-color-icon, %as-pseudo;
margin-right: 5px;
}
+ li.consul-components.css-component a::before,
+ li.components.css-component a::before {
+ @extend %with-glimmer-logo-color-icon, %as-pseudo;
+ }
li.consul-components.ember-component a::before,
li.components.ember-component a::before {
@extend %with-ember-circle-logo-color-icon, %as-pseudo;
@@ -78,6 +86,10 @@ html.is-debug body > .brand-loader {
> table tr:hover {
box-shadow: none;
}
+ > ol code,
+ > ul code {
+ @extend %inline-code;
+ }
}
.docfy-demo {
& {
diff --git a/ui/packages/consul-ui/app/templates/debug.hbs b/ui/packages/consul-ui/app/templates/debug.hbs
index 0e3b2f4461..89bb4d3ee7 100644
--- a/ui/packages/consul-ui/app/templates/debug.hbs
+++ b/ui/packages/consul-ui/app/templates/debug.hbs
@@ -24,6 +24,7 @@
class={{concat
(slugify section.label) ' '
(if (eq child.frontmatter.class 'ember') 'ember-component') ' '
+ (if (eq child.frontmatter.class 'css') 'css-component') ' '
(if (is-href (to-route child.url)) 'is-active')
}}
>