diff --git a/docs/pages/components/nav-group.md b/docs/pages/components/nav-group.md index 757b5dcd7..4ed11f3c5 100644 --- a/docs/pages/components/nav-group.md +++ b/docs/pages/components/nav-group.md @@ -7,7 +7,36 @@ layout: component ```html:preview - Nav Item + + + Search + + + + + Notifications + + + + + +
+ + Payments +
+ + + Transactions + + + + Invoices + + + + Disputed Charges + +
``` @@ -19,4 +48,4 @@ TODO ### Second Example -TODO +TODO \ No newline at end of file diff --git a/src/components/nav-group/nav-group.component.ts b/src/components/nav-group/nav-group.component.ts index 48e7a34b6..7b12d5ebb 100644 --- a/src/components/nav-group/nav-group.component.ts +++ b/src/components/nav-group/nav-group.component.ts @@ -2,6 +2,9 @@ import { html } from 'lit'; import WebAwesomeElement from '../../internal/webawesome-element.js'; import styles from './nav-group.styles.js'; import type { CSSResultGroup } from 'lit'; +import { when } from 'lit/directives/when.js'; +import { property } from 'lit/decorators.js'; +import WaDetails from '../details/details.component.js'; /** * @summary Short summary of the component's intended use. @@ -10,16 +13,36 @@ import type { CSSResultGroup } from 'lit'; * @since 3.0 * * @slot - The default slot. - * @slot example - An example slot. - * - * @csspart base - The component's base wrapper. */ export default class WaNavGroup extends WebAwesomeElement { static styles: CSSResultGroup = styles; + static dependencies = { + 'wa-details': WaDetails + } + + /** + * The label to display either as the summary for or above the + */ + @property({ reflect: true }) label = "" + @property({ reflect: true, type: Boolean }) expandable: boolean = false + render() { - return html`
- -
`; + return html`
+ ${when(this.expandable, + () => html` + +
+ + ${this.label} + +
+ + +
+ `, + () => html`` + )} +
`; } } diff --git a/src/components/nav-item/nav-item.styles.ts b/src/components/nav-item/nav-item.styles.ts index bc4fbdb1d..90daf4bc3 100644 --- a/src/components/nav-item/nav-item.styles.ts +++ b/src/components/nav-item/nav-item.styles.ts @@ -10,6 +10,12 @@ export default css` width: auto; cursor: pointer; list-style-type: none; + + } + + .base { + /* when we change to "display: list-item" apparently it sets box-sizing to content-box... */ + box-sizing: border-box; } .control { @@ -32,6 +38,7 @@ export default css` line-height: var(--wa-font-height-compact); padding: var(--wa-space-square-s); border-radius: var(--wa-corners-1x); + } .control::-moz-focus-inner {