consul/ui/packages/consul-ui/app/components/panel
hashicorp-copywrite[bot] 5fb9df1640
[COMPLIANCE] License changes (#18443)
* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-11 09:12:13 -04:00
..
README.mdx UI: Update Consul UI colors to use HDS colors (#16111) 2023-02-27 09:30:12 -07:00
debug.scss [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
index.css.js [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
index.scss [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
layout.scss [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
skin.scss [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00

README.mdx

---
type: css
---
# Panel

Very basic 'panel' card-like CSS component currently used for menu-panels.

When building components using `panel` please make use of the CSS custom
properties available to help maintain consistency within the panel.

**Very important**: Please avoid using style attributes for doing this the
below is only for illustrative purposes. Please use this CSS component as a
building block for other CSS instead.

```hbs preview-template
<figure>
  <figcaption>Panel with no padding (in dark mode)</figcaption>
  <div class={{class-map 'panel' 'theme-dark'}} ...attributes>
    <div>
      <p>Some text purposefully with no padding</p>
    </div>
    <hr />
    <div>
      <p>Along with a separator ^ again purposefully with no padding</p>
    </div>
  </div>
</figure>
<figure>
  <figcaption>Panel using inherited padding for consistency</figcaption>
  <div class={{class-map 'panel'}} ...attributes>
    <Action
      style={{style-map
        (array 'width' '100%')
        (array 'border-bottom' '1px solid var(--tone-border)')
        (array 'padding' 'var(--padding-x) var(--padding-y)')
      }}
    >
      Full Width Button
    </Action>
    <div style={{style-map (array 'padding' 'var(--padding-x) var(--padding-y)')}}>
      <p>Some text with padding</p>
    </div>
    <hr />
    <div style={{style-map (array 'padding' 'var(--padding-x) var(--padding-y)')}}>
      <p>Along with a separator ^ again with padding</p>
    </div>
  </div>
</figure>
<figure>
  <figcaption>Panel using larger padding and different color borders</figcaption>
  <div
    class={{class-map 'panel'}}
    style={{style-map
      (array '--padding-x' '24px')
      (array '--padding-y' '24px')
      (array '--tone-border' 'var(--token-color-consul-foreground)')
    }}
    ...attributes
  >
    <Action
      style={{style-map
        (array 'width' '100%')
        (array 'border-bottom' '1px solid var(--tone-border)')
        (array 'padding' 'var(--padding-x) var(--padding-y)')
      }}
    >
      Full Width Button
    </Action>
    <div style={{style-map (array 'padding' 'var(--padding-x) var(--padding-y)')}}>
      <p>Some text with padding</p>
    </div>
    <hr />
    <div style={{style-map (array 'padding' 'var(--padding-x) var(--padding-y)')}}>
      <p>Along with a separator ^ again with padding</p>
    </div>
  </div>
</figure>
```

```css
.panel {
  @extend %panel;
}
.panel hr {
  @extend %panel-separator;
}
```

## CSS Properties

| Property        | Type     | Default                           | Description                                                          |
| --------------- | -------- | --------------------------------- | -------------------------------------------------------------------- |
| `--tone-border` | `color`  | --token-color-palette-neutral-300 | Default color for all borders                                        |
| `--padding-x`   | `length` | 14px                              | Default x padding to be used for padding values within the component |
| `--padding-y`   | `length` | 14px                              | Default y padding to be used for padding values within the component |