The Open Source Definition
https://opensource.org/osd/
@@ -51,5 +51,5 @@ 10. License Must Be Technology-Neutral
Version 1.9, last modified, 2007-03-22
Here’s the historical “Annotated OSD ” from the early 2000’s.
diff --git a/elements/pf-banner/docs/pf-banner.md b/elements/pf-v5-banner/docs/pf-banner.md
similarity index 58%
rename from elements/pf-banner/docs/pf-banner.md
rename to elements/pf-v5-banner/docs/pf-banner.md
index 30e91d1aae..c2c4924ee3 100644
--- a/elements/pf-banner/docs/pf-banner.md
+++ b/elements/pf-v5-banner/docs/pf-banner.md
@@ -1,10 +1,10 @@
{% renderOverview %}
- Default
+ Default
{% endrenderOverview %}
{% band header="Usage" %}
{% htmlexample %}
- Default
+ Default
{% endhtmlexample %}
@@ -12,11 +12,11 @@
Available variants are: default, info, danger, success, warning
{% htmlexample %}
- Default
- Info
- Danger
- Success
- Warning
+ Default
+ Info
+ Danger
+ Success
+ Warning
{% endhtmlexample %}
@@ -24,7 +24,7 @@
Banners can be set to stick to the top of their container by adding the `sticky` attribute.
{% htmlexample %}
- Sticky
+ Sticky
{% endhtmlexample %}
@@ -32,16 +32,16 @@
You can add a icon by using the shorthand icon attribute
{% htmlexample %}
- Info
+ Info
{% endhtmlexample %}
- Or you can use the icon slot and slot in a `svg` or `pf-icon` element
+ Or you can use the icon slot and slot in a `svg` or `pf-v5-icon` element
{% htmlexample %}
-
-
+
+
Info
-
+
{% endhtmlexample %}
{% endband %}
diff --git a/elements/pf-banner/docs/screenshot.png b/elements/pf-v5-banner/docs/screenshot.png
similarity index 100%
rename from elements/pf-banner/docs/screenshot.png
rename to elements/pf-v5-banner/docs/screenshot.png
diff --git a/elements/pf-v5-banner/pf-v5-banner.css b/elements/pf-v5-banner/pf-v5-banner.css
new file mode 100644
index 0000000000..6b67a56f9a
--- /dev/null
+++ b/elements/pf-v5-banner/pf-v5-banner.css
@@ -0,0 +1,117 @@
+:host {
+ display: block;
+ /** Top padding for banner */
+ --pf-v5-c-banner--PaddingTop: var(--pf-global--spacer--xs, 0.25rem);
+ /** Right padding for banner */
+ --pf-v5-c-banner--PaddingRight: var(--pf-global--spacer--md, 1rem);
+ /** Right padding for banner on medium screens */
+ --pf-v5-c-banner--md--PaddingRight: var(--pf-global--spacer--lg, 1.5rem);
+ /** Bottom padding for banner */
+ --pf-v5-c-banner--PaddingBottom: var(--pf-global--spacer--xs, 0.25rem);
+ /** Left padding for banner */
+ --pf-v5-c-banner--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ /** Left padding for banner on medium screens */
+ --pf-v5-c-banner--md--PaddingLeft: var(--pf-global--spacer--lg, 1.5rem);
+ /** Font size for banner */
+ --pf-v5-c-banner--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ /** Text color for banner */
+ --pf-v5-c-banner--Color: var(--pf-global--Color--100, #151515);
+ /** Background color for banner */
+ --pf-v5-c-banner--BackgroundColor: var(--pf-global--BackgroundColor--dark-400, #4f5255);
+ /** Link color for banner (references banner color) */
+ --pf-v5-c-banner--link--Color: var(--pf-v5-c-banner--Color);
+ /** Link text decoration for banner */
+ --pf-v5-c-banner--link--TextDecoration: underline;
+ /** Link hover color for banner (references banner color) */
+ --pf-v5-c-banner--link--hover--Color: var(--pf-v5-c-banner--Color);
+ /** Link hover font weight for banner */
+ --pf-v5-c-banner--link--hover--FontWeight: var(--pf-global--FontWeight--semi-bold, 700);
+ /** Disabled link color for banner (references banner color) */
+ --pf-v5-c-banner--link--disabled--Color: var(--pf-v5-c-banner--Color);
+ /** Disabled link text decoration for banner */
+ --pf-v5-c-banner--link--disabled--TextDecoration: none;
+ /** Background color for info banner */
+ --pf-v5-c-banner--m-info--BackgroundColor: var(--pf-global--palette--blue-200, #73bcf7);
+ /** Background color for danger banner */
+ --pf-v5-c-banner--m-danger--BackgroundColor: var(--pf-global--danger-color--100, #c9190b);
+ /** Background color for success banner */
+ --pf-v5-c-banner--m-success--BackgroundColor: var(--pf-global--success-color--100, #3e8635);
+ /** Background color for warning banner */
+ --pf-v5-c-banner--m-warning--BackgroundColor: var(--pf-global--warning-color--100, #f0ab00);
+ /** Z-index for sticky banner */
+ --pf-v5-c-banner--m-sticky--ZIndex: var(--pf-global--ZIndex--md, 300);
+ /** Box shadow for sticky banner */
+ --pf-v5-c-banner--m-sticky--BoxShadow: var(--pf-global--BoxShadow--md-bottom);
+}
+
+#container,
+#container.default {
+ color: var(--pf-global--Color--100, var(--pf-global--Color--light-100, #ffffff));
+ overflow: hidden;
+ text-overflow: ellipsis;
+ padding:
+ var(--pf-v5-c-banner--PaddingTop, var(--pf-global--spacer--xs, 0.25rem))
+ var(--pf-v5-c-banner--PaddingRight, var(--pf-global--spacer--md, 1rem))
+ var(--pf-v5-c-banner--PaddingBottom, var(--pf-global--spacer--xs, 0.25rem))
+ var(--pf-v5-c-banner--PaddingLeft, var(--pf-global--spacer--md, 1rem));
+ font-size: var(--pf-v5-c-banner--FontSize, var(--pf-global--FontSize--sm, 0.875rem));
+ color: var(--pf-global--Color--100, var(--pf-global--Color--light-100, #ffffff));
+ white-space: nowrap;
+ background-color: var(--pf-v5-c-banner--BackgroundColor, var(--pf-global--BackgroundColor--dark-400, #4f5255));
+
+ --pf-v5-icon--size: 1em;
+}
+
+#container.info {
+ color: var(--pf-global--Color--100, var(--pf-global--Color--dark-100, #151515));
+ --pf-v5-c-banner--BackgroundColor: var(--pf-v5-c-banner--m-info--BackgroundColor, var(--pf-global--palette--blue-200, #73bcf7));
+}
+
+#container.danger {
+ --pf-v5-c-banner--BackgroundColor: var(--pf-v5-c-banner--m-danger--BackgroundColor, var(--pf-global--danger-color--100, #c9190b));
+}
+
+#container.success {
+ --pf-v5-c-banner--BackgroundColor: var(--pf-v5-c-banner--m-success--BackgroundColor, var(--pf-global--success-color--100, #3e8635));
+}
+
+#container.warning {
+ color: var(--pf-global--Color--100, var(--pf-global--Color--dark-100, #151515));
+ --pf-v5-c-banner--BackgroundColor: var(--pf-v5-c-banner--m-warning--BackgroundColor, var(--pf-global--warning-color--100, #f0ab00));
+}
+
+#container.hasIcon {
+ display: var(--pf-v5-l-flex--Display, flex);
+ flex-wrap: var(--pf-v5-l-flex--FlexWrap, wrap);
+ align-items: var(--pf-v5-l-flex--AlignItems, baseline);
+ gap: var(--pf-v5-l-flex--spacer, var(--pf-v5-l-flex--spacer--sm, var(--pf-global--spacer--sm, 0.5rem)));
+}
+
+:host([sticky]) {
+ position: sticky;
+ top: 0;
+ z-index: var(--pf-v5-c-banner--m-sticky--ZIndex, var(--pf-global--ZIndex--md, 300));
+ box-shadow:
+ var(--pf-v5-c-banner--m-sticky--BoxShadow,
+ var(--pf-global--BoxShadow--md-bottom, 0 0.5rem 0.5rem -0.375rem rgba(3, 3, 3, 0.18)));
+}
+
+pf-v5-icon,
+::slotted(pf-v5-icon),
+::slotted(svg) {
+ position: relative;
+ inset-block-start: 0.125em;
+}
+
+::slotted(svg) {
+ height: 1em;
+ width: 1em;
+ fill: currentcolor;
+}
+
+@media (min-width: 768px) {
+ #container {
+ --pf-v5-c-banner--PaddingRight: var(--pf-v5-c-banner--md--PaddingRight, var(--pf-global--spacer--lg, 1.5rem));
+ --pf-v5-c-banner--PaddingLeft: var(--pf-v5-c-banner--md--PaddingLeft, var(--pf-global--spacer--lg, 1.5rem));
+ }
+}
diff --git a/elements/pf-banner/pf-banner.ts b/elements/pf-v5-banner/pf-v5-banner.ts
similarity index 87%
rename from elements/pf-banner/pf-banner.ts
rename to elements/pf-v5-banner/pf-v5-banner.ts
index b81a9b797c..5f4f7b2d06 100644
--- a/elements/pf-banner/pf-banner.ts
+++ b/elements/pf-v5-banner/pf-v5-banner.ts
@@ -6,7 +6,7 @@ import { classMap } from 'lit/directives/class-map.js';
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
-import styles from './pf-banner.css';
+import styles from './pf-v5-banner.css';
export type BannerVariant = (
| 'default'
@@ -22,8 +22,8 @@ export type BannerVariant = (
* @summary Allows users to display a stylized banner.
* @alias Banner
*/
-@customElement('pf-banner')
-export class PfBanner extends LitElement {
+@customElement('pf-v5-banner')
+export class PfV5Banner extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
/** Changes the visual appearance of the banner. */
@@ -40,7 +40,7 @@ export class PfBanner extends LitElement {
override willUpdate(changed: PropertyValues): void {
if (changed.has('icon') && this.icon) {
- import('@patternfly/elements/pf-icon/pf-icon.js');
+ import('@patternfly/elements/pf-v5-icon/pf-v5-icon.js');
}
}
@@ -53,7 +53,7 @@ export class PfBanner extends LitElement {
class=${classMap({ hasIcon, [variant ?? '']: !!variant })}>
${!this.icon ? '' : html`
- `}
+ `}
@@ -64,6 +64,6 @@ export class PfBanner extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-banner': PfBanner;
+ 'pf-v5-banner': PfV5Banner;
}
}
diff --git a/elements/pf-banner/test/pf-banner.e2e.ts b/elements/pf-v5-banner/test/pf-banner.e2e.ts
similarity index 95%
rename from elements/pf-banner/test/pf-banner.e2e.ts
rename to elements/pf-v5-banner/test/pf-banner.e2e.ts
index e45c6deb82..c833252a2c 100644
--- a/elements/pf-banner/test/pf-banner.e2e.ts
+++ b/elements/pf-v5-banner/test/pf-banner.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-banner';
+const tagName = 'pf-v5-banner';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-banner/test/pf-banner.spec.ts b/elements/pf-v5-banner/test/pf-banner.spec.ts
similarity index 69%
rename from elements/pf-banner/test/pf-banner.spec.ts
rename to elements/pf-v5-banner/test/pf-banner.spec.ts
index 78fb74a32b..5a6bcd4d1e 100644
--- a/elements/pf-banner/test/pf-banner.spec.ts
+++ b/elements/pf-v5-banner/test/pf-banner.spec.ts
@@ -1,30 +1,30 @@
import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { getColor, hexToRgb } from '@patternfly/pfe-tools/test/hex-to-rgb.js';
-import { PfBanner } from '@patternfly/elements/pf-banner/pf-banner.js';
+import { PfV5Banner } from '@patternfly/elements/pf-v5-banner/pf-v5-banner.js';
-describe('', function() {
+describe('', function() {
describe('simply instantiating', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-banner')).to.be.an.instanceof(PfBanner);
+ expect(document.createElement('pf-v5-banner')).to.be.an.instanceof(PfV5Banner);
});
it('should upgrade', async function() {
- const el = await createFixture(html`
- Default
+ const el = await createFixture(html`
+ Default
`);
- const klass = customElements.get('pf-banner');
+ const klass = customElements.get('pf-v5-banner');
expect(el)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfBanner);
+ .to.be.an.instanceOf(PfV5Banner);
});
describe('without variant attribute', function() {
- let element: PfBanner;
+ let element: PfV5Banner;
beforeEach(async function() {
- element = await createFixture(html`
- Default
+ element = await createFixture(html`
+ Default
`);
await element.updateComplete;
});
@@ -37,10 +37,10 @@ describe('', function() {
});
describe('with variant="info" attribute', function() {
- let element: PfBanner;
+ let element: PfV5Banner;
beforeEach(async function() {
- element = await createFixture(html`
- Info
+ element = await createFixture(html`
+ Info
`);
await element.updateComplete;
});
@@ -53,10 +53,10 @@ describe('', function() {
});
describe('with variant="danger" attribute', function() {
- let element: PfBanner;
+ let element: PfV5Banner;
beforeEach(async function() {
- element = await createFixture(html`
- Info
+ element = await createFixture(html`
+ Info
`);
await element.updateComplete;
});
@@ -69,16 +69,16 @@ describe('', function() {
});
describe('with valid icon attribute', function() {
- let element: PfBanner;
+ let element: PfV5Banner;
beforeEach(async function() {
- element = await createFixture(html`
- Info
+ element = await createFixture(html`
+ Info
`);
await element.updateComplete;
});
// TODO: remove assertions on shadow roots
it('should render an icon', async function() {
- const icon = element.shadowRoot!.querySelector('pf-icon');
+ const icon = element.shadowRoot!.querySelector('pf-v5-icon');
expect(icon).to.exist;
});
});
diff --git a/elements/pf-v5-button/README.md b/elements/pf-v5-button/README.md
new file mode 100644
index 0000000000..7c51266f5b
--- /dev/null
+++ b/elements/pf-v5-button/README.md
@@ -0,0 +1,61 @@
+# PatternFly Elements Button
+
+`` is a web component wrapper around a standard HTML `` element.
+`` is heavily influenced by the findings in this post: [Custom
+elements, shadow DOM and implicit form submission](https://www.hjorthhansen.dev/shadow-dom-and-forms/). You can expect `` to work like a normal `HTMLButtonElement`.
+
+Read more about Button in the [PatternFly Elements Button documentation](https://patternflyelements.org/components/button)
+
+## Installation
+
+Load `` via CDN:
+
+```html
+
+```
+
+Or, if you are using [NPM](https://npm.im), install it
+
+```bash
+npm install @patternfly/elements
+```
+
+Then once installed, import it to your application:
+
+```js
+import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
+```
+
+## Usage
+
+When using this component, you must provide a standard HTML Button Elements as
+the only light DOM child of `pf-v5-button`.
+
+```html
+My Button
+```
+
+### Accessibility
+`` addresses the issues associated with typical implementations of
+web component buttons. When using a `` in a `
{% endhtmlexample %}
### Size
{% htmlexample %}
- Medium Button
- Large Button
+ Medium Button
+ Large Button
{% endhtmlexample %}
### Click listeners
-
- HTML
-
+
+ HTML
+
```html
-Click me!
+Click me!
```
-
- Lit
-
+
+ Lit
+
```js
import { html, render } from 'lit';
-import '@patternfly/elements/pf-button/pf-button.js';
+import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
render(html`
- console.log('clicked!');}">
+ console.log('clicked!');}">
Click me!
-
+
`, document.getElementById('container'));
```
-
- React
-
+
+ React
+
```jsx
-import { Button } from '@patternfly/elements/react/pf-button/pf-button.js';
+import { Button } from '@patternfly/elements/react/pf-v5-button/pf-v5-button.js';
export function Clicker() {
return (
console.log('clicked!');}>
@@ -121,8 +121,8 @@ export function Clicker() {
}
```
-
-
+
+
{% endband %}
diff --git a/elements/pf-button/docs/screenshot.png b/elements/pf-v5-button/docs/screenshot.png
similarity index 100%
rename from elements/pf-button/docs/screenshot.png
rename to elements/pf-v5-button/docs/screenshot.png
diff --git a/elements/pf-button/pf-button-icon.css b/elements/pf-v5-button/pf-v5-button-icon.css
similarity index 77%
rename from elements/pf-button/pf-button-icon.css
rename to elements/pf-v5-button/pf-v5-button-icon.css
index b20fa2abb5..d6519719d7 100644
--- a/elements/pf-button/pf-button-icon.css
+++ b/elements/pf-v5-button/pf-v5-button-icon.css
@@ -5,7 +5,7 @@
******************************/
.hasIcon {
- gap: calc(2 * var(--pf-c-button__icon--m-start--MarginLeft,
+ gap: calc(2 * var(--pf-v5-c-button__icon--m-start--MarginLeft,
var(--pf-global--spacer--xs, 0.25rem)));
}
diff --git a/elements/pf-v5-button/pf-v5-button-tokens.css b/elements/pf-v5-button/pf-v5-button-tokens.css
new file mode 100644
index 0000000000..c3332d148a
--- /dev/null
+++ b/elements/pf-v5-button/pf-v5-button-tokens.css
@@ -0,0 +1,211 @@
+:host {
+ /** PaddingTop for the button */
+ --pf-v5-c-button--PaddingTop: var(--pf-global--spacer--form-element, 0.375rem);
+ /** PaddingRight for the button */
+ --pf-v5-c-button--PaddingRight: var(--pf-global--spacer--md, 1rem);
+ /** PaddingBottom for the button */
+ --pf-v5-c-button--PaddingBottom: var(--pf-global--spacer--form-element, 0.375rem);
+ /** PaddingLeft for the button */
+ --pf-v5-c-button--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ /** LineHeight for the button */
+ --pf-v5-c-button--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+ /** FontWeight for the button */
+ --pf-v5-c-button--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ /** FontSize for the button */
+ --pf-v5-c-button--FontSize: var(--pf-global--FontSize--md, 1rem);
+ /** BackgroundColor for the button */
+ --pf-v5-c-button--BackgroundColor: transparent;
+ /** BorderRadius for the button */
+ --pf-v5-c-button--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
+ /** BorderRadius for the button after element */
+ --pf-v5-c-button--after--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
+ /** BorderColor for the button after element */
+ --pf-v5-c-button--after--BorderColor: transparent;
+ /** BorderWidth for the button after element */
+ --pf-v5-c-button--after--BorderWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** BorderWidth for the button after element on hover */
+ --pf-v5-c-button--hover--after--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** BorderWidth for the button after element on focus */
+ --pf-v5-c-button--focus--after--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** BorderWidth for the button after element when active */
+ --pf-v5-c-button--active--after--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Color for the button when disabled */
+ --pf-v5-c-button--disabled--Color: var(--pf-global--disabled-color--100, #6a6e73);
+ /** BackgroundColor for the button when disabled */
+ --pf-v5-c-button--disabled--BackgroundColor: var(--pf-global--disabled-color--200, #d2d2d2);
+ /** BorderColor for the button after element when disabled */
+ --pf-v5-c-button--disabled--after--BorderColor: transparent;
+ /** BackgroundColor for the primary button variant */
+ --pf-v5-c-button--m-primary--BackgroundColor: var(--pf-global--primary-color--100, #06c);
+ /** Color for the primary button variant */
+ --pf-v5-c-button--m-primary--Color: var(--pf-global--Color--light-100, #fff);
+ /** BackgroundColor for the primary button variant on hover */
+ --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ /** Color for the primary button variant on hover */
+ --pf-v5-c-button--m-primary--hover--Color: var(--pf-global--Color--light-100, #fff);
+ /** BackgroundColor for the primary button variant on focus */
+ --pf-v5-c-button--m-primary--focus--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ /** Color for the primary button variant on focus */
+ --pf-v5-c-button--m-primary--focus--Color: var(--pf-global--Color--light-100, #fff);
+ /** BackgroundColor for the primary button variant when active */
+ --pf-v5-c-button--m-primary--active--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ /** Color for the primary button variant when active */
+ --pf-v5-c-button--m-primary--active--Color: var(--pf-global--Color--light-100, #fff);
+ /** BackgroundColor for the secondary button variant */
+ --pf-v5-c-button--m-secondary--BackgroundColor: transparent;
+ /** BorderColor for the secondary button variant after element */
+ --pf-v5-c-button--m-secondary--after--BorderColor: var(--pf-global--primary-color--100, #06c);
+ /** Color for the secondary button variant */
+ --pf-v5-c-button--m-secondary--Color: var(--pf-global--primary-color--100, #06c);
+ /** BackgroundColor for the secondary button variant on hover */
+ --pf-v5-c-button--m-secondary--hover--BackgroundColor: transparent;
+ /** BorderColor for the secondary button variant after element on hover */
+ --pf-v5-c-button--m-secondary--hover--after--BorderColor: var(--pf-global--primary-color--100, #06c);
+ /** Color for the secondary button variant on hover */
+ --pf-v5-c-button--m-secondary--hover--Color: var(--pf-global--primary-color--100, #06c);
+ /** BackgroundColor for the secondary button variant on focus */
+ --pf-v5-c-button--m-secondary--focus--BackgroundColor: transparent;
+ /** BorderColor for the secondary button variant after element on focus */
+ --pf-v5-c-button--m-secondary--focus--after--BorderColor: var(--pf-global--primary-color--100, #06c);
+ /** Color for the secondary button variant on focus */
+ --pf-v5-c-button--m-secondary--focus--Color: var(--pf-global--primary-color--100, #06c);
+ /** BackgroundColor for the secondary button variant when active */
+ --pf-v5-c-button--m-secondary--active--BackgroundColor: transparent;
+ --pf-v5-c-button--m-secondary--active--after--BorderColor: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-button--m-secondary--active--Color: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-button--m-secondary--m-danger--BackgroundColor: transparent;
+ --pf-v5-c-button--m-secondary--m-danger--Color: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-button--m-secondary--m-danger--after--BorderColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-button--m-secondary--m-danger--hover--BackgroundColor: transparent;
+ --pf-v5-c-button--m-secondary--m-danger--hover--Color: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-secondary--m-danger--hover--after--BorderColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-button--m-secondary--m-danger--focus--BackgroundColor: transparent;
+ --pf-v5-c-button--m-secondary--m-danger--focus--Color: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-secondary--m-danger--focus--after--BorderColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-button--m-secondary--m-danger--active--BackgroundColor: transparent;
+ --pf-v5-c-button--m-secondary--m-danger--active--Color: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-secondary--m-danger--active--after--BorderColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-button--m-tertiary--BackgroundColor: transparent;
+ --pf-v5-c-button--m-tertiary--after--BorderColor: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-tertiary--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-tertiary--hover--BackgroundColor: transparent;
+ --pf-v5-c-button--m-tertiary--hover--after--BorderColor: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-tertiary--hover--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-tertiary--focus--BackgroundColor: transparent;
+ --pf-v5-c-button--m-tertiary--focus--after--BorderColor: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-tertiary--focus--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-tertiary--active--BackgroundColor: transparent;
+ --pf-v5-c-button--m-tertiary--active--after--BorderColor: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-tertiary--active--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-warning--BackgroundColor: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-button--m-warning--Color: var(--pf-global--Color--dark-100, #151515);
+ --pf-v5-c-button--m-warning--hover--BackgroundColor: var(--pf-global--palette--gold-500, #c58c00);
+ --pf-v5-c-button--m-warning--hover--Color: var(--pf-global--Color--dark-100, #151515);
+ --pf-v5-c-button--m-warning--focus--BackgroundColor: var(--pf-global--palette--gold-500, #c58c00);
+ --pf-v5-c-button--m-warning--focus--Color: var(--pf-global--Color--dark-100, #151515);
+ --pf-v5-c-button--m-warning--active--BackgroundColor: var(--pf-global--palette--gold-500, #c58c00);
+ --pf-v5-c-button--m-warning--active--Color: var(--pf-global--Color--dark-100, #151515);
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-button--m-danger--Color: var(--pf-global--Color--light-100, #fff);
+ --pf-v5-c-button--m-danger--hover--BackgroundColor: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-danger--hover--Color: var(--pf-global--Color--light-100, #fff);
+ --pf-v5-c-button--m-danger--focus--BackgroundColor: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-danger--focus--Color: var(--pf-global--Color--light-100, #fff);
+ --pf-v5-c-button--m-danger--active--BackgroundColor: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-danger--active--Color: var(--pf-global--Color--light-100, #fff);
+ --pf-v5-c-button--m-link--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--Color: var(--pf-global--link--Color, #06c);
+ --pf-v5-c-button--m-link--hover--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--hover--Color: var(--pf-global--link--Color--hover, #004080);
+ --pf-v5-c-button--m-link--focus--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--focus--Color: var(--pf-global--link--Color--hover, #004080);
+ --pf-v5-c-button--m-link--active--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--active--Color: var(--pf-global--link--Color--hover, #004080);
+ --pf-v5-c-button--m-link--disabled--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--m-inline--FontSize: inherit;
+ --pf-v5-c-button--m-link--m-inline--hover--TextDecoration: var(--pf-global--link--TextDecoration--hover, underline);
+ --pf-v5-c-button--m-link--m-inline--hover--Color: var(--pf-global--link--Color--hover, #004080);
+ --pf-v5-c-button--m-link--m-inline--PaddingTop: 0;
+ --pf-v5-c-button--m-link--m-inline--PaddingRight: 0;
+ --pf-v5-c-button--m-link--m-inline--PaddingBottom: 0;
+ --pf-v5-c-button--m-link--m-inline--PaddingLeft: 0;
+ --pf-v5-c-button--m-link--m-inline__progress--Left: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-button--m-link--m-inline--m-in-progress--PaddingLeft: calc(var(--pf-v5-c-button--m-link--m-inline__progress--Left) + 1rem + var(--pf-global--spacer--sm, 0.5rem));
+ --pf-v5-c-button--m-link--m-danger--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--m-danger--Color: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-button--m-link--m-danger--hover--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--m-danger--hover--Color: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-link--m-danger--focus--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--m-danger--focus--Color: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-link--m-danger--active--BackgroundColor: transparent;
+ --pf-v5-c-button--m-link--m-danger--active--Color: var(--pf-global--danger-color--200, #a30000);
+ --pf-v5-c-button--m-plain--BackgroundColor: transparent;
+ --pf-v5-c-button--m-plain--Color: var(--pf-global--Color--200, #6a6e73);
+ --pf-v5-c-button--m-plain--hover--BackgroundColor: transparent;
+ --pf-v5-c-button--m-plain--hover--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-plain--focus--BackgroundColor: transparent;
+ --pf-v5-c-button--m-plain--focus--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-plain--active--BackgroundColor: transparent;
+ --pf-v5-c-button--m-plain--active--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-plain--disabled--Color: var(--pf-global--disabled-color--200, #d2d2d2);
+ --pf-v5-c-button--m-plain--disabled--BackgroundColor: transparent;
+ --pf-v5-c-button--m-control--BackgroundColor: var(--pf-global--BackgroundColor--100, #fff);
+ --pf-v5-c-button--m-control--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-control--BorderRadius: 0;
+ --pf-v5-c-button--m-control--after--BorderWidth: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-button--m-control--after--BorderTopColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-button--m-control--after--BorderRightColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-button--m-control--after--BorderBottomColor: var(--pf-global--BorderColor--200, #8a8d90);
+ --pf-v5-c-button--m-control--after--BorderLeftColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-button--m-control--disabled--BackgroundColor: var(--pf-global--disabled-color--300, #f0f0f0);
+ --pf-v5-c-button--m-control--hover--BackgroundColor: var(--pf-global--BackgroundColor--100, #fff);
+ --pf-v5-c-button--m-control--hover--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-control--hover--after--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-button--m-control--hover--after--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-button--m-control--active--BackgroundColor: var(--pf-global--BackgroundColor--100, #fff);
+ --pf-v5-c-button--m-control--active--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-control--active--after--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-button--m-control--active--after--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-button--m-control--focus--BackgroundColor: var(--pf-global--BackgroundColor--100, #fff);
+ --pf-v5-c-button--m-control--focus--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-control--focus--after--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-button--m-control--focus--after--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-button--m-control--m-expanded--BackgroundColor: var(--pf-global--BackgroundColor--100, #fff);
+ --pf-v5-c-button--m-control--m-expanded--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-button--m-control--m-expanded--after--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-button--m-control--m-expanded--after--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-button--m-small--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ --pf-v5-c-button--m-display-lg--PaddingTop: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-button--m-display-lg--PaddingRight: var(--pf-global--spacer--xl, 2rem);
+ --pf-v5-c-button--m-display-lg--PaddingBottom: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-button--m-display-lg--PaddingLeft: var(--pf-global--spacer--xl, 2rem);
+ --pf-v5-c-button--m-display-lg--FontWeight: var(--pf-global--FontWeight--bold, 700);
+ --pf-v5-c-button--m-link--m-display-lg--FontSize: var(--pf-global--FontSize--lg, 1.125rem);
+ --pf-v5-c-button__icon--m-start--MarginRight: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-button__icon--m-end--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-button__progress--width: calc(var(--pf-global--icon--FontSize--md, 1.125rem) + var(--pf-global--spacer--sm, 0.5rem));
+ --pf-v5-c-button__progress--Opacity: 0;
+ --pf-v5-c-button__progress--TranslateY: -50%;
+ --pf-v5-c-button__progress--TranslateX: 0;
+ --pf-v5-c-button__progress--Top: 50%;
+ --pf-v5-c-button__progress--Left: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-button--m-progress--TransitionProperty: padding;
+ --pf-v5-c-button--m-progress--TransitionDuration: var(--pf-global--TransitionDuration, 250ms);
+ --pf-v5-c-button--m-progress--PaddingRight: calc(var(--pf-global--spacer--md, 1rem) + var(--pf-v5-c-button__progress--width) / 2);
+ --pf-v5-c-button--m-progress--PaddingLeft: calc(var(--pf-global--spacer--md, 1rem) + var(--pf-v5-c-button__progress--width) / 2);
+ --pf-v5-c-button--m-in-progress--PaddingRight: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-button--m-in-progress--PaddingLeft: calc(var(--pf-global--spacer--md, 1rem) + var(--pf-v5-c-button__progress--width));
+ --pf-v5-c-button--m-in-progress--m-plain--Color: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-button--m-in-progress--m-plain__progress--Left: 50%;
+ --pf-v5-c-button--m-in-progress--m-plain__progress--TranslateX: -50%;
+ --pf-v5-c-button__count--MarginLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-button--disabled__c-badge--Color: var(--pf-global--Color--dark-100, #151515);
+ --pf-v5-c-button--disabled__c-badge--BackgroundColor: var(--pf-global--BackgroundColor--200, #f0f0f0);
+ --pf-v5-c-button--m-primary__c-badge--BorderColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-button--m-primary__c-badge--BorderWidth: var(--pf-global--BorderWidth--sm, 1px);
+
+ /** Internal button color property */
+ --_button-color: var(--pf-v5-c-button--m-primary--Color);
+ /** Internal button background color property */
+ --_button-background-color: var(--pf-v5-c-button--m-primary--BackgroundColor);
+}
diff --git a/elements/pf-v5-button/pf-v5-button.css b/elements/pf-v5-button/pf-v5-button.css
new file mode 100644
index 0000000000..b0cd26d64f
--- /dev/null
+++ b/elements/pf-v5-button/pf-v5-button.css
@@ -0,0 +1,611 @@
+:host {
+ font-size: var(--pf-v5-c-button--FontSize);
+ font-weight: var(--pf-v5-c-button--FontWeight);
+ line-height: var(--pf-v5-c-button--LineHeight);
+ text-align: center;
+ white-space: nowrap;
+ font-size: var(--pf-v5-c-button--FontSize,
+ var(--pf-global--FontSize--md, 1rem));
+ font-weight: var(--pf-v5-c-button--FontWeight,
+ var(--pf-global--FontWeight--normal, 400));
+ line-height: var(--pf-v5-c-button--LineHeight,
+ var(--pf-global--LineHeight--md, 1.5));
+ display: inline-block;
+ height: max-content;
+ cursor: pointer;
+ position: relative;
+ font-family: inherit;
+ border-width: 0;
+ border-style: solid;
+ border-radius: var(--pf-v5-c-button--BorderRadius,
+ var(--pf-global--BorderRadius--sm, 3px));
+}
+
+:host([hidden]),
+[hidden] {
+ display: none !important;
+}
+
+:host([inline]) {
+ display: inline;
+ --pf-v5-c-button--PaddingTop: 0;
+ --pf-v5-c-button--PaddingLeft: 0;
+ --pf-v5-c-button--PaddingBottom: 0;
+ --pf-v5-c-button--PaddingRight: 0;
+}
+
+pf-v5-icon,
+::slotted(pf-v5-icon) {
+ color: currentcolor;
+ padding-inline-start: var(--_button-icon-padding-inline-start);
+ padding-inline-end: var(--_button-icon-padding-inline-end);
+ vertical-align: var(--_button-icon-vertical-align);
+}
+
+#icon {
+ margin-inline-end: var(--pf-v5-c-button__icon--m-start--MarginRight,
+ var(--pf-global--spacer--xs, 0.25rem));
+}
+
+#button {
+ display: inline-block;
+ color: var(--_button-color);
+ padding:
+ var(--pf-v5-c-button--PaddingTop,
+ var(--pf-global--spacer--form-element, 0.375rem))
+ var(--pf-v5-c-button--PaddingRight,
+ var(--pf-global--spacer--md, 1rem))
+ var(--pf-v5-c-button--PaddingBottom,
+ var(--pf-global--spacer--form-element, 0.375rem))
+ var(--pf-v5-c-button--PaddingLeft,
+ var(--pf-global--spacer--md, 1rem));
+ &::before,
+ &::after {
+ position: absolute;
+ inset: 0;
+ content: "";
+ }
+ &::before {
+ background-color: var(--_button-background-color);
+ border-radius: var(--pf-v5-c-button--BorderRadius,
+ var(--pf-global--BorderRadius--sm, 3px));
+ }
+ &::after {
+ pointer-events: none;
+ border-style: solid;
+ border-width: var(--pf-v5-c-button--after--BorderWidth);
+ border-color: var(--pf-v5-c-button--after--BorderColor);
+ border-radius: var(--pf-v5-c-button--after--BorderRadius);
+ }
+ &.anchor {
+ text-decoration: none;
+ &::after {
+ pointer-events: all;
+ }
+ }
+}
+
+#text {
+ display: inline;
+ position: relative;
+}
+
+:host(:focus) {
+ --pf-v5-c-button--m-primary--Color: var(--pf-v5-c-button--m-primary--focus--Color,
+ var(--pf-global--Color--light-100, #fff));
+ --pf-v5-c-button--m-primary--BackgroundColor: var(--pf-v5-c-button--m-primary--focus--BackgroundColor,
+ var(--pf-global--primary-color--200, #004080));
+ --pf-v5-c-button--after--BorderWidth: var(--pf-v5-c-button--focus--after--BorderWidth,
+ var(--pf-global--BorderWidth--md, 2px));
+ /* DANGER */
+ --pf-v5-c-button--m-danger--Color: var(--pf-v5-c-button--m-danger--focus--Color,
+ var(--pf-global--Color--light-100, #fff));
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-v5-c-button--m-danger--focus--BackgroundColor,
+ var(--pf-global--danger-color--200, #a30000));
+ /* LINK */
+ --pf-v5-c-button--m-link--Color: var(--pf-v5-c-button--m-link--focus--Color,
+ var(--pf-global--link--Color--hover, #004080));
+ --pf-v5-c-button--m-link--BackgroundColor: var(--pf-v5-c-button--m-link--hover--BackgroundColor, transparent);
+ /* PLAIN */
+ --pf-v5-c-button--m-plain--Color: var(--pf-v5-c-button--m-plain--focus--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-plain--BackgroundColor: var(--pf-v5-c-button--m-plain--focus--BackgroundColor,
+ transparent);
+}
+
+:host(:hover) {
+ --pf-v5-c-button--m-primary--Color: var(--pf-v5-c-button--m-primary--hover--Color,
+ var(--pf-global--Color--light-100, #fff));
+ --pf-v5-c-button--m-primary--BackgroundColor: var(--pf-v5-c-button--m-primary--hover--BackgroundColor,
+ var(--pf-global--primary-color--200, #004080));
+ --pf-v5-c-button--after--BorderWidth: var(--pf-v5-c-button--hover--after--BorderWidth,
+ var(--pf-global--BorderWidth--md, 2px));
+ /* DANGER */
+ --pf-v5-c-button--m-danger--Color: var(--pf-v5-c-button--m-danger--hover--Color,
+ var(--pf-global--Color--light-100, #fff));
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-v5-c-button--m-danger--hover--BackgroundColor,
+ var(--pf-global--danger-color--200, #a30000));
+ /* LINK */
+ --pf-v5-c-button--m-link--Color: var(--pf-v5-c-button--m-link--hover--Color,
+ var(--pf-global--link--Color--hover, #004080));
+ --pf-v5-c-button--m-link--BackgroundColor: var(--pf-v5-c-button--m-link--hover--BackgroundColor, transparent);
+ /* PLAIN */
+ --pf-v5-c-button--m-plain--Color: var(--pf-v5-c-button--m-plain--hover--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-plain--BackgroundColor: var(--pf-v5-c-button--m-plain--hover--BackgroundColor,
+ transparent);
+}
+
+:host(:active) {
+ --pf-v5-c-button--m-primary--Color: var(--pf-v5-c-button--m-primary--active--Color,
+ var(--pf-global--Color--light-100, #fff));
+ --pf-v5-c-button--m-primary--BackgroundColor: var(--pf-v5-c-button--m-primary--active--BackgroundColor,
+ var(--pf-global--primary-color--200, #004080));
+ --pf-v5-c-button--after--BorderWidth: var(--pf-v5-c-button--active--after--BorderWidth,
+ var(--pf-global--BorderWidth--md, 2px));
+ /* DANGER */
+ --pf-v5-c-button--m-danger--Color: var(--pf-v5-c-button--m-danger--active--Color,
+ var(--pf-global--Color--light-100, #fff));
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-v5-c-button--m-danger--active--BackgroundColor,
+ var(--pf-global--danger-color--200, #a30000));
+ /* LINK */
+ --pf-v5-c-button--m-link--Color: var(--pf-v5-c-button--m-link--active--Color,
+ var(--pf-global--link--Color--hover, #004080));
+ --pf-v5-c-button--m-link--BackgroundColor: var(--pf-v5-c-button--m-link--active--BackgroundColor, transparent);
+}
+
+.disabled,
+:host(:disabled),
+:host([danger]:disabled),
+:host([link]:disabled) .link {
+ pointer-events: none;
+ cursor: default;
+}
+
+[part=icon] {
+ --pf-v5-icon--size: 16px;
+ display: inline-flex;
+ align-items: center;
+ position: absolute;
+ & ::slotted(*) {
+ width: 16px;
+ max-width: 16px;
+ height: 16px;
+ max-height: 16px;
+ }
+}
+
+.hasIcon [part=icon] {
+ cursor: pointer;
+}
+
+.hasIcon #button {
+ position: absolute;
+ inset: 0;
+}
+
+/******************************
+ * *
+ * PLAIN *
+ * *
+ ******************************/
+
+#button.plain {
+ --pf-v5-c-button--disabled--BackgroundColor: var(--pf-v5-c-button--m-plain--disabled--BackgroundColor, transparent);
+ --pf-v5-c-button--after--BorderWidth: 0 !important;
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-tertiary--after--BorderColor,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--disabled--Color: var(--pf-v5-c-button--m-plain--disabled--Color,
+ var(--pf-global--disabled-color--200, #d2d2d2));
+ --_button-color: var(--pf-v5-c-button--m-plain--Color,
+ var(--pf-global--Color--200, #6a6e73));
+ --_button-background-color: var(--pf-v5-c-button--m-plain--BackgroundColor,
+ transparent);
+ :host(:active) & {
+ --pf-v5-c-button--m-plain--Color: var(--pf-v5-c-button--m-plain--active--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-plain--BackgroundColor: var(--pf-v5-c-button--m-plain--active--BackgroundColor,
+ tranparent);
+ }
+ &:not(.hasIcon) [part=icon],
+ &.loading [part=icon] {
+ left: 16px;
+ }
+ & [part=icon] {
+ display: contents;
+ }
+ &.disabled,
+ &.link.disabled {
+ --_button-color: var(--pf-v5-c-button--disabled--Color,
+ var(--pf-v5-c-button--m-plain--disabled--Color,
+ var(--pf-global--disabled--color--200, #d2d2d2)));
+ }
+}
+
+.hasIcon:not(.plain) [part=icon] {
+ position: relative;
+}
+
+/******************************
+ * *
+ * ICON POSITION RIGHT *
+ * *
+ ******************************/
+
+:host([icon-position=right]) .loading [part=icon] {
+ order: 1;
+}
+
+:host([icon-position=right]) #button.hasIcon {
+ padding-left: var(--pf-v5-c-button--PaddingLeft, var(--pf-global--spacer--md, 1rem));
+ padding-right: calc(16px + 8px + var(--pf-v5-c-button--PaddingRight, var(--pf-global--spacer--md, 1rem)));
+}
+
+/******************************
+ * *
+ * WARNING *
+ * *
+ ******************************/
+
+#button.warning {
+ --_button-color: var(--pf-v5-c-button--m-warning--Color,
+ var(--pf-global--Color--dark-100, #151515));
+ --_button-background-color: var(--pf-v5-c-button--m-warning--BackgroundColor,
+ var(--pf-global--warning-color--100, #f0ab00));
+ :host(:focus) & {
+ --pf-v5-c-button--m-warning--Color: var(--pf-v5-c-button--m-warning--focus--Color,
+ var(--pf-global--Color--dark-100, #151515));
+ --pf-v5-c-button--m-warning--BackgroundColor: var(--pf-v5-c-button--m-warning--focus--BackgroundColor,
+ var(--pf-global--palette--gold-500, #c58c00));
+ }
+ :host(:hover) & {
+ --pf-v5-c-button--m-warning--Color: var(--pf-v5-c-button--m-warning--hover--Color,
+ var(--pf-global--Color--dark-100, #151515));
+ --pf-v5-c-button--m-warning--BackgroundColor: var(--pf-v5-c-button--m-warning--hover--BackgroundColor,
+ var(--pf-global--palette--gold-500, #c58c00));
+ }
+ :host(:active) & {
+ --pf-v5-c-button--m-warning--Color: var(--pf-v5-c-button--m-warning--active--Color,
+ var(--pf-global--Color--dark-100, #151515));
+ --pf-v5-c-button--m-warning--BackgroundColor: var(--pf-v5-c-button--m-warning--active--BackgroundColor,
+ var(--pf-global--palette--gold-500, #c58c00));
+ }
+ &.disabled {
+ --_button-color: var(--pf-v5-c-button--disabled--Color,
+ var(--pf-global--disabled-color--100, #6a6e73));
+ --_button-background-color: var(--pf-v5-c-button--disabled--BackgroundColor,
+ var(--pf-global--disabled-color--200, #d2d2d2));
+ }
+}
+
+/******************************
+ * *
+ * LOADING *
+ * *
+ ******************************/
+
+:host([loading]) #button {
+ position: relative;
+ display: flex;
+ align-items: center;
+}
+
+#button.loading {
+ & [part=icon] {
+ display: inline-block;
+ z-index: 1;
+ position: absolute;
+ cursor: pointer;
+ top: var(--pf-v5-c-button__progress--Top, 50%);
+ left: var(--pf-v5-c-button__progress--Left,
+ var(--pf-global--spacer--md, 1rem));
+ line-height: 1;
+ transform: translate(
+ var(--pf-v5-c-button__progress--TranslateX, 0),
+ var(--pf-v5-c-button__progress--TranslateY, -50%));
+ margin-inline-end: var(--pf-v5-c-button__icon--m-start--MarginRight,
+ var(--pf-global--spacer--xs, 0.25rem));
+ }
+ &.primary:not(.plain),
+ &.danger {
+ --pf-v5-c-spinner--Color: white;
+ }
+ &:not(.plain) {
+ padding-left: calc(12px + var(--pf-v5-c-button--PaddingLeft, var(--pf-global--spacer--md, 1rem)));
+ --pf-v5-c-button--PaddingRight: var(--pf-v5-c-button--m-in-progress--PaddingRight,
+ var(--pf-global--spacer--md, 1rem));
+ --pf-v5-c-button--PaddingLeft: var(--pf-v5-c-button--m-in-progress--PaddingLeft,
+ calc(
+ var(--pf-global--spacer--md, 1rem) + var(--pf-v5-c-button__progress--width,
+ calc(var(--pf-global--icon--FontSize--md, 1.125rem) + var(--pf-global--spacer--sm, 0.5rem))) / 2));
+ }
+
+}
+
+/******************************
+ * *
+ * SECONDARY *
+ * *
+ ******************************/
+
+#button.secondary {
+ --pf-v5-c-button--m-danger--Color: var(--pf-v5-c-button--m-secondary--m-danger--Color,
+ var(--pf-global--danger-color--100, #c9190b));
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-v5-c-button--m-secondary--m-danger--BackgroundColor, transparent);
+ --_button-color: var(--pf-v5-c-button--m-secondary--Color,
+ var(--pf-global--primary-color--100, #06c));
+ --_button-background-color: var(--pf-v5-c-button--m-secondary--BackgroundColor, transparent);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-secondary--after--BorderColor,
+ var(--pf-global--primary-color--100, #06c));
+ :host(:focus) & {
+ --pf-v5-c-button--m-secondary--Color: var(--pf-v5-c-button--m-secondary--focus--Color,
+ var(--pf-global--primary-color--100, #06c));
+ --pf-v5-c-button--m-secondary--BackgroundColor: var(--pf-v5-c-button--m-secondary--focus--BackgroundColor, transparent);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-secondary--focus--after--BorderColor,
+ var(--pf-global--primary-color--100, #06c));
+ /* DANGER */
+ --pf-v5-c-button--m-danger--Color: var(--pf-v5-c-button--m-secondary--m-danger--focus--Color,
+ var(--pf-global--danger--color--200, #a30000));
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-v5-c-button--m-secondary--m-danger--focus--BackgroundColor, transparent);
+ }
+ :host(:hover) & {
+ --pf-v5-c-button--m-secondary--Color: var(--pf-v5-c-button--m-secondary--hover--Color,
+ var(--pf-global--primary-color--100, #06c));
+ --pf-v5-c-button--m-secondary--BackgroundColor: var(--pf-v5-c-button--m-secondary--hover--BackgroundColor,
+ transparent);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-secondary--hover--after--BorderColor,
+ var(--pf-global--primary-color--100, #06c));
+ /* DANGER */
+ --pf-v5-c-button--m-danger--Color: var(--pf-v5-c-button--m-secondary--m-danger--hover--Color,
+ var(--pf-global--danger--color--200, #a30000));
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-v5-c-button--m-secondary--m-danger--hover--BackgroundColor, transparent);
+ }
+ :host(:active) & {
+ --pf-v5-c-button--m-secondary--Color: var(--pf-v5-c-button--m-secondary--active--Color,
+ var(--pf-global--primary-color--100, #06c));
+ --pf-v5-c-button--m-secondary--BackgroundColor: var(--pf-v5-c-button--m-secondary--active--BackgroundColor, transparent);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-secondary--active--after--BorderColor,
+ var(--pf-global--primary-color--100, #06c));
+ /* DANGER */
+ --pf-v5-c-button--m-danger--Color: var(--pf-v5-c-button--m-secondary--m-danger--active--Color,
+ var(--pf-global--danger--color--200, #a30000));
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-v5-c-button--m-secondary--m-danger--active--BackgroundColor, transparent);
+ }
+ &.danger {
+ --_button-color: var(--pf-v5-c-button--m-secondary--m-danger--Color,
+ var(--pf-global--danger--color--100, #c9190b));
+ --_button-background-color: var(--pf-v5-c-button--m-secondary--m-danger--BackgroundColor, transparent);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-secondary--m-danger--after--BorderColor,
+ var(--pf-global--danger--color--100, #c9190b));
+ :host(:focus) & {
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-secondary--m-danger--focus--after--BorderColor,
+ var(--pf-global--danger--color--100, #c9190b));
+ }
+ :host(:hover) & {
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-secondary--m-danger--hover--after--BorderColor,
+ var(--pf-global--danger--color--100, #c9190b));
+ }
+ :host(:active) & {
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-secondary--m-danger--active--after--BorderColor,
+ var(--pf-global--danger--color--100, #c9190b));
+ }
+ }
+}
+
+/******************************
+ * *
+ * TERTIARY *
+ * *
+ ******************************/
+
+#button.tertiary {
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-tertiary--after--BorderColor,
+ var(--pf-global--Color--100, #151515));
+ --_button-color: var(--pf-v5-c-button--m-tertiary--Color,
+ var(--pf-global--Color--100, #151515));
+ --_button-background-color: var(--pf-v5-c-button--m-tertiary--BackgroundColor, transparent);
+ :host(:focus) & {
+ --pf-v5-c-button--m-tertiary--Color: var(--pf-v5-c-button--m-tertiary--focus--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-tertiary--BackgroundColor: var(--pf-v5-c-button--m-tertiary--focus--BackgroundColor,
+ transparent);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-tertiary--focus--after--BorderColor,
+ var(--pf-global--Color--100, #151515));
+ }
+ :host(:hover) & {
+ --pf-v5-c-button--m-tertiary--Color: var(--pf-v5-c-button--m-tertiary--hover--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-tertiary--BackgroundColor: var(--pf-v5-c-button--m-tertiary--hover--BackgroundColor, transparent);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-tertiary--hover--after--BorderColor,
+ var(--pf-global--Color--100, #151515));
+ }
+ :host(:active) & {
+ --pf-v5-c-button--m-tertiary--Color: var(--pf-v5-c-button--m-tertiary--active--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-tertiary--BackgroundColor: var(--pf-v5-c-button--m-tertiary--active--BackgroundColor, transparent);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--m-tertiary--active--after--BorderColor,
+ var(--pf-global--Color--100, #151515));
+ }
+}
+
+/******************************
+ * *
+ * CONTROL *
+ * *
+ ******************************/
+
+#button.control {
+ --pf-v5-c-button--BorderRadius: var(--pf-v5-c-button--m-control--BorderRadius, 0);
+ --pf-v5-c-button--disabled--BackgroundColor: var(--pf-v5-c-button--m-control--disabled--BackgroundColor,
+ var(--pf-global--disabled-color--300, #f0f0f0));
+ --pf-v5-c-button--after--BorderRadius: 0;
+ --pf-v5-c-button--after--BorderWidth: var(--pf-v5-c-button--m-control--after--BorderWidth,
+ var(--pf-global--BorderWidth--sm, 1px));
+ --pf-v5-c-button--after--BorderColor:
+ var(--pf-v5-c-button--m-control--after--BorderTopColor,
+ var(--pf-global--BorderColor--300, #f0f0f0))
+ var(--pf-v5-c-button--m-control--after--BorderRightColor,
+ var(--pf-global--BorderColor--300, #f0f0f0))
+ var(--pf-v5-c-button--m-control--after--BorderBottomColor,
+ var(--pf-global--BorderColor--200, #8a8d90))
+ var(--pf-v5-c-button--m-control--after--BorderLeftColor,
+ var(--pf-global--BorderColor--300, #f0f0f0));
+ --_button-color: var(--pf-v5-c-button--m-control--Color,
+ var(--pf-global--Color--100, #151515));
+ --_button-background-color: var(--pf-v5-c-button--m-control--BackgroundColor,
+ var(--pf-global--BackgroundColor--100, #fff));
+ :host(:focus) & {
+ --pf-v5-c-button--m-control--Color: var(--pf-v5-c-button--m-control--focus--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-control--BackgroundColor: var(--pf-v5-c-button--m-control--focus--BackgroundColor,
+ var(--pf-global--BackgroundColor--100, #fff));
+ --pf-v5-c-button--m-control--after--BorderBottomColor: var(--pf-v5-c-button--m-control--focus--after--BorderBottomColor,
+ var(--pf-global--active-color--100, #06c));
+ &::after {
+ border-block-end-width: var(--pf-v5-c-button--m-control--focus--after--BorderBottomWidth,
+ var(--pf-global--BorderWidth--md, 2px));
+ }
+ }
+ :host(:hover) & {
+ --pf-v5-c-button--m-control--Color: var(--pf-v5-c-button--m-control--hover--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-control--BackgroundColor: var(--pf-v5-c-button--m-control--hover--BackgroundColor,
+ var(--pf-global--BackgroundColor--100, #fff));
+ --pf-v5-c-button--m-control--after--BorderBottomColor: var(--pf-v5-c-button--m-control--hover--after--BorderBottomColor,
+ var(--pf-global--active-color--100, #06c));
+ &::after {
+ border-block-end-width: var(--pf-v5-c-button--m-control--hover--after--BorderBottomWidth,
+ var(--pf-global--BorderWidth--md, 2px));
+ }
+ }
+ :host(:active) & {
+ --pf-v5-c-button--m-control--Color: var(--pf-v5-c-button--m-control--active--Color,
+ var(--pf-global--Color--100, #151515));
+ --pf-v5-c-button--m-control--BackgroundColor: var(--pf-v5-c-button--m-control--active--BackgroundColor,
+ var(--pf-global--BackgroundColor--100, #fff));
+ --pf-v5-c-button--m-control--after--BorderBottomColor: var(--pf-v5-c-button--m-control--active--after--BorderBottomColor,
+ var(--pf-global--active-color--100, #06c));
+ &::after {
+ border-block-end-width: var(--pf-v5-c-button--m-control--active--after--BorderBottomWidth,
+ var(--pf-global--BorderWidth--md, 2px));
+ }
+ }
+}
+
+/******************************
+ * *
+ * LINK *
+ * *
+ ******************************/
+
+#button.link {
+ --pf-v5-c-button--disabled--BackgroundColor: var(--pf-v5-c-button--m-link--disabled--BackgroundColor, transparent);
+ --_button-color: var(--pf-v5-c-button--m-link--Color, var(--pf-global--link--Color, #06c));
+ --_button-background-color: var(--pf-v5-c-button--m-link--BackgroundColor,
+ var(--pf-v5-c-button--m-link--BackgroundColor, transparent));
+ &.inline {
+ :host(:hover) & {
+ text-decoration: var(--pf-v5-c-button--m-link--m-inline--hover--TextDecoration,
+ var(--pf-global--link--TextDecoration--hover, underline));
+ }
+ }
+ &.danger {
+ --pf-v5-c-button--m-danger--Color: var(--pf-v5-c-button--m-link--m-danger--Color,
+ var(--pf-global--danger-color--100, #c9190b));
+ --pf-v5-c-button--m-danger--BackgroundColor: var(--pf-v5-c-button--m-link--m-danger--BackgroundColor, transparent);
+ :host(:hover) & {
+ --pf-v5-c-button--m-link--m-danger--Color: var(--pf-v5-c-button--m-link--m-danger--hover--Color,
+ var(--pf-global--danger-color--200, #a30000));
+ --pf-v5-c-button--m-link--m-danger--BackgroundColor: var(--pf-v5-c-button--m-link--m-danger--hover--BackgroundColor, transparent);
+ }
+ :host(:focus) & {
+ --pf-v5-c-button--m-link--m-danger--Color: var(--pf-v5-c-button--m-link--m-danger--focus--Color,
+ var(--pf-global--danger-color--200, #a30000));
+ --pf-v5-c-button--m-link--m-danger--BackgroundColor: var(--pf-v5-c-button--m-link--m-danger--focus--BackgroundColor, transparent);
+ }
+ :host(:active) & {
+ --pf-v5-c-button--m-link--m-danger--Color: var(--pf-v5-c-button--m-link--m-danger--active--Color,
+ var(--pf-global--danger-color--200, #a30000));
+ --pf-v5-c-button--m-link--m-danger--BackgroundColor: var(--pf-v5-c-button--m-link--m-danger--active--BackgroundColor, transparent);
+ }
+ }
+}
+
+/******************************
+ * *
+ * DISABLED *
+ * *
+ ******************************/
+
+:host(:is(:disabled,[disabled])) {
+ pointer-events: none;
+ cursor: default;
+}
+
+#button.disabled {
+ &:not(.plain) {
+ --_button-color: var(--pf-v5-c-button--disabled--Color,
+ var(--pf-global--disabled-color--100, #6a6e73));
+ --_button-background-color: var(--pf-v5-c-button--disabled--BackgroundColor,
+ var(--pf-global--disabled-color--200, #d2d2d2));
+ }
+ &::after {
+ border-color: var(--pf-v5-c-button--disabled--after--BorderColor, transparent);
+ }
+}
+
+/******************************
+ * *
+ * BLOCK *
+ * *
+ ******************************/
+
+:host([block]) {
+ display: flex;
+ width: 100%;
+ justify-content: center;
+}
+
+/******************************
+ * *
+ * LARGE *
+ * *
+ ******************************/
+
+:host([size="large"]) {
+ --pf-v5-c-button--PaddingTop: var(--pf-v5-c-button--m-display-lg--PaddingTop,
+ var(--pf-global--spacer--md, 1rem));
+ --pf-v5-c-button--PaddingRight: var(--pf-v5-c-button--m-display-lg--PaddingRight,
+ var(--pf-global--spacer--xl, 2rem));
+ --pf-v5-c-button--PaddingBottom: var(--pf-v5-c-button--m-display-lg--PaddingBottom,
+ var(--pf-global--spacer--md, 1rem));
+ --pf-v5-c-button--PaddingLeft: var(--pf-v5-c-button--m-display-lg--PaddingLeft,
+ var(--pf-global--spacer--xl, 2rem));
+ --pf-v5-c-button--FontWeight: var(--pf-v5-c-button--m-display-lg--FontWeight,
+ var(--pf-global--FontWeight--bold, 700));
+}
+
+/******************************
+ * *
+ * SMALL *
+ * *
+ ******************************/
+
+:host([size="small"]) {
+ --pf-v5-c-button--FontSize: var(--pf-v5-c-button--m-small--FontSize,
+ var(--pf-global--FontSize--md, 1rem));
+}
+
+/******************************
+ * *
+ * DANGER *
+ * *
+ ******************************/
+
+#button.danger {
+ --_button-color: var(--pf-v5-c-button--m-danger--Color,
+ var(--pf-global--Color--light-100, #fff));
+ --_button-background-color: var(--pf-v5-c-button--m-danger--BackgroundColor,
+ var(--pf-global--danger-color--100, #c9190b));
+}
+
diff --git a/elements/pf-button/pf-button.ts b/elements/pf-v5-button/pf-v5-button.ts
similarity index 92%
rename from elements/pf-button/pf-button.ts
rename to elements/pf-v5-button/pf-v5-button.ts
index 83a0ad1940..14ff6b8127 100644
--- a/elements/pf-button/pf-button.ts
+++ b/elements/pf-v5-button/pf-v5-button.ts
@@ -7,13 +7,13 @@ import { classMap } from 'lit/directives/class-map.js';
import { InternalsController } from '@patternfly/pfe-core/controllers/internals-controller.js';
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
-import '@patternfly/elements/pf-icon/pf-icon.js';
-import '@patternfly/elements/pf-spinner/pf-spinner.js';
+import '@patternfly/elements/pf-v5-icon/pf-v5-icon.js';
+import '@patternfly/elements/pf-v5-spinner/pf-v5-spinner.js';
-import tokensStyles from './pf-button-tokens.css';
-import iconStyles from './pf-button-icon.css';
+import tokensStyles from './pf-v5-button-tokens.css';
+import iconStyles from './pf-v5-button-icon.css';
-import styles from './pf-button.css';
+import styles from './pf-v5-button.css';
export type ButtonVariant = (
| 'primary'
@@ -34,8 +34,8 @@ export type ButtonVariant = (
* @alias Button
* @attr {string} [loading-label='loading'] - ARIA label for the loading indicator
*/
-@customElement('pf-button')
-export class PfButton extends LitElement {
+@customElement('pf-v5-button')
+export class PfV5Button extends LitElement {
static readonly formAssociated = true;
static readonly styles: CSSStyleSheet[] = [
@@ -148,13 +148,13 @@ export class PfButton extends LitElement {
part="icon"
name="icon"
?hidden="${!hasIcon}">
-
-
+
+ aria-label="${this.getAttribute('loading-label') ?? 'loading'}">
`;
@@ -233,6 +233,6 @@ export class PfButton extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-button': PfButton;
+ 'pf-v5-button': PfV5Button;
}
}
diff --git a/elements/pf-button/test/pf-button.e2e.ts b/elements/pf-v5-button/test/pf-button.e2e.ts
similarity index 95%
rename from elements/pf-button/test/pf-button.e2e.ts
rename to elements/pf-v5-button/test/pf-button.e2e.ts
index 5072a7e6d7..f74a6ea00b 100644
--- a/elements/pf-button/test/pf-button.e2e.ts
+++ b/elements/pf-v5-button/test/pf-button.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-button';
+const tagName = 'pf-v5-button';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-button/test/pf-button.spec.ts b/elements/pf-v5-button/test/pf-button.spec.ts
similarity index 82%
rename from elements/pf-button/test/pf-button.spec.ts
rename to elements/pf-v5-button/test/pf-button.spec.ts
index 034d2129d7..e8648456f5 100644
--- a/elements/pf-button/test/pf-button.spec.ts
+++ b/elements/pf-v5-button/test/pf-button.spec.ts
@@ -3,7 +3,7 @@ import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { clickElementAtCenter } from '@patternfly/pfe-tools/test/utils.js';
-import { PfButton } from '@patternfly/elements/pf-button/pf-button.js';
+import { PfV5Button } from '@patternfly/elements/pf-v5-button/pf-v5-button.js';
import '@patternfly/pfe-tools/test/stub-logger.js';
@@ -13,20 +13,20 @@ function press(key: string) {
};
}
-describe('', function() {
+describe('', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-button')).to.be.an.instanceof(PfButton);
+ expect(document.createElement('pf-v5-button')).to.be.an.instanceof(PfV5Button);
});
it('should upgrade', async function() {
- const el = await createFixture(html`Button `);
- expect(el, 'pf-button should be an instance of PfButton')
- .to.be.an.instanceOf(customElements.get('pf-button'))
+ const el = await createFixture(html`Button `);
+ expect(el, 'pf-v5-button should be an instance of PfV5Button')
+ .to.be.an.instanceOf(customElements.get('pf-v5-button'))
.and
- .to.be.an.instanceOf(PfButton);
+ .to.be.an.instanceOf(PfV5Button);
});
describe('in a fieldset', function() {
- let element: PfButton;
+ let element: PfV5Button;
let fieldset: HTMLFieldSetElement;
let form: HTMLFormElement;
let submitEvent: SubmitEvent;
@@ -36,13 +36,13 @@ describe('', function() {
- OK
+ OK
`);
fieldset = form.querySelector('fieldset')!;
- element = form.querySelector('pf-button')!;
+ element = form.querySelector('pf-v5-button')!;
form.querySelector('input')?.focus();
form.addEventListener('submit', function(event) {
event.preventDefault();
@@ -68,7 +68,7 @@ describe('', function() {
it('does focus the button', function() {
expect(document.activeElement)
.to
- .be.an.instanceof(PfButton);
+ .be.an.instanceof(PfV5Button);
});
describe('pressing Space', function() {
@@ -100,7 +100,7 @@ describe('', function() {
expect(document.activeElement)
.to
.not
- .be.an.instanceof(PfButton);
+ .be.an.instanceof(PfV5Button);
});
});
// this was a regression spotted by @brianferry
@@ -124,7 +124,7 @@ describe('', function() {
it('does focus the button', function() {
expect(document.activeElement)
.to
- .be.an.instanceof(PfButton);
+ .be.an.instanceof(PfV5Button);
});
});
});
diff --git a/elements/pf-card/README.md b/elements/pf-v5-card/README.md
similarity index 65%
rename from elements/pf-card/README.md
rename to elements/pf-v5-card/README.md
index c37fdab170..bd13b2d07a 100644
--- a/elements/pf-card/README.md
+++ b/elements/pf-v5-card/README.md
@@ -4,10 +4,10 @@ Read more about Card in the [PatternFly Elements Card documentation](https://pat
## Installation
-Load `` via CDN:
+Load `` via CDN:
```html
-
+
```
Or, if you are using [NPM](https://npm.im), install it
@@ -19,16 +19,16 @@ npm install @patternfly/elements
Then once installed, import it to your application:
```js
-import '@patternfly/elements/pf-card/pf-card.js';
+import '@patternfly/elements/pf-v5-card/pf-v5-card.js';
```
## Usage
```html
-
+
Card header
- This is the pf-card body.
+ This is the pf-v5-card body.
Footer link
-
+
```
diff --git a/elements/pf-card/demo/header-images-and-actions.html b/elements/pf-v5-card/demo/header-images-and-actions.html
similarity index 75%
rename from elements/pf-card/demo/header-images-and-actions.html
rename to elements/pf-v5-card/demo/header-images-and-actions.html
index 03cd21ee88..edaeea341e 100644
--- a/elements/pf-card/demo/header-images-and-actions.html
+++ b/elements/pf-v5-card/demo/header-images-and-actions.html
@@ -1,4 +1,4 @@
-
+
-
-
-
- Action
- Link
- Disabled Action
- Disabled Link
+
+
+
+ Action
+ Link
+ Disabled Action
+ Disabled Link
- Separated Action
- Separated Link
-
-
+ Separated Action
+ Separated Link
+
+
Title
Body
Footer
-
+
diff --git a/elements/pf-card/demo/index.html b/elements/pf-v5-card/demo/index.html
similarity index 61%
rename from elements/pf-card/demo/index.html
rename to elements/pf-v5-card/demo/index.html
index 3f5df03b08..c79954f0a5 100644
--- a/elements/pf-card/demo/index.html
+++ b/elements/pf-v5-card/demo/index.html
@@ -1,15 +1,15 @@
-
+
Header
Body
Footer
-
+
diff --git a/elements/pf-card/demo/modifiers.html b/elements/pf-v5-card/demo/modifiers.html
similarity index 62%
rename from elements/pf-card/demo/modifiers.html
rename to elements/pf-v5-card/demo/modifiers.html
index d25fab3f30..a564146119 100644
--- a/elements/pf-card/demo/modifiers.html
+++ b/elements/pf-v5-card/demo/modifiers.html
@@ -1,44 +1,44 @@
-
+
Flat
-
+
Rounded
-
+
Plain
-
+
Full Height
-
+
Compact
-
+
Large
diff --git a/elements/pf-v5-chip/demo/overflow.html b/elements/pf-v5-chip/demo/overflow.html
new file mode 100644
index 0000000000..9726df2337
--- /dev/null
+++ b/elements/pf-v5-chip/demo/overflow.html
@@ -0,0 +1,6 @@
+Overflow chip
+
+
+
diff --git a/elements/pf-v5-chip/demo/read-only.html b/elements/pf-v5-chip/demo/read-only.html
new file mode 100644
index 0000000000..09c7df12b5
--- /dev/null
+++ b/elements/pf-v5-chip/demo/read-only.html
@@ -0,0 +1,8 @@
+Read-only chip
+
+
+
+
+
diff --git a/elements/pf-v5-chip/demo/with-badge.html b/elements/pf-v5-chip/demo/with-badge.html
new file mode 100644
index 0000000000..839480a861
--- /dev/null
+++ b/elements/pf-v5-chip/demo/with-badge.html
@@ -0,0 +1,8 @@
+Chip 7
+
+
+
+
diff --git a/elements/pf-chip/docs/pf-chip.md b/elements/pf-v5-chip/docs/pf-chip.md
similarity index 59%
rename from elements/pf-chip/docs/pf-chip.md
rename to elements/pf-v5-chip/docs/pf-chip.md
index b468ee2896..68c02f3353 100644
--- a/elements/pf-chip/docs/pf-chip.md
+++ b/elements/pf-v5-chip/docs/pf-chip.md
@@ -1,11 +1,11 @@
{% renderOverview %}
- Chip 1
+ Chip 1
{% endrenderOverview %}
{% band header="Usage" %}
@@ -13,8 +13,8 @@ import '@patternfly/elements/pf-tooltip/pf-tooltip.js';
### Default
{% htmlexample %}
- Chip 1
- Chip 7
+ Chip 1
+ Chip 7
{% endhtmlexample %}
### Chip variants
@@ -24,24 +24,24 @@ Chips can be removable or read-only. The Overflow chip is a special chip that is
#### Read-only
{% htmlexample %}
- Read-only chip
+ Read-only chip
{% endhtmlexample %}
#### Overflow chip
{% htmlexample %}
- Overflow-chip
+ Overflow-chip
{% endhtmlexample %}
#### Max-width
{% htmlexample %}
-
- Really long chip that goes on and on
+ Really long chip that goes on and on
Really long chip that goes on and on
-
+
{% endhtmlexample %}
### Chip group
@@ -53,44 +53,44 @@ Chip groups are typically used in filter and selection use cases to indicate to
Chip groups are useful to express complex filters to a data set, for example.
{% htmlexample %}
-
- Chip 1
- Chip 2
- Chip 3
- Chip 4
-
+
+ Chip 1
+ Chip 2
+ Chip 3
+ Chip 4
+
{% endhtmlexample %}
#### Chip group with categories
{% htmlexample %}
-
+
Category one
- Chip 1
- Chip 2
- Chip 3
- Chip 4
-
+ Chip 1
+ Chip 2
+ Chip 3
+ Chip 4
+
-
+
Category two
- Chip 5
- Chip 6
- Chip 7
- Chip 8
-
+ Chip 5
+ Chip 6
+ Chip 7
+ Chip 8
+
{% endhtmlexample %}
#### Chip group with removable categories
{% htmlexample %}
-
+
Category three
- Chip 1
- Chip 2
- Chip 3
- Chip 4
-
+ Chip 1
+ Chip 2
+ Chip 3
+ Chip 4
+
{% endhtmlexample %}
{% endband %}
@@ -124,16 +124,16 @@ Chip groups use the [APG's Roving tabindex](https://www.w3.org/WAI/ARIA/apg/prac
{% endband %}
-{% renderSlots for="pf-chip", header="Slots on `pf-chip`" %}{% endrenderSlots %}
-{% renderAttributes for="pf-chip", header="Attributes on `pf-chip`" %}{% endrenderAttributes %}
-{% renderMethods for="pf-chip", header="Methods on `pf-chip`" %}{% endrenderMethods %}
-{% renderEvents for="pf-chip", header="Events on `pf-chip`" %}{% endrenderEvents %}
-{% renderCssCustomProperties for="pf-chip", header="CSS Custom Properties on `pf-chip`" %}{% endrenderCssCustomProperties %}
-{% renderCssParts for="pf-chip", header="CSS Parts on `pf-chip`" %}{% endrenderCssParts %}
-
-{% renderSlots for="pf-chip-group", header="Slots on `pf-chip-group`" %}{% endrenderSlots %}
-{% renderAttributes for="pf-chip-group", header="Attributes on `pf-chip-group`" %}{% endrenderAttributes %}
-{% renderMethods for="pf-chip-group", header="Methods on `pf-chip-group`" %}{% endrenderMethods %}
-{% renderEvents for="pf-chi-group", header="Events on `pf-chip-group`" %}{% endrenderEvents %}
-{% renderCssCustomProperties for="pf-chip-group", header="CSS Custom Properties on `pf-chip`" %}{% endrenderCssCustomProperties %}
-{% renderCssParts for="pf-chip-group", header="CSS Parts on `pf-chip-group`" %}{% endrenderCssParts %}
+{% renderSlots for="pf-v5-chip", header="Slots on `pf-v5-chip`" %}{% endrenderSlots %}
+{% renderAttributes for="pf-v5-chip", header="Attributes on `pf-v5-chip`" %}{% endrenderAttributes %}
+{% renderMethods for="pf-v5-chip", header="Methods on `pf-v5-chip`" %}{% endrenderMethods %}
+{% renderEvents for="pf-v5-chip", header="Events on `pf-v5-chip`" %}{% endrenderEvents %}
+{% renderCssCustomProperties for="pf-v5-chip", header="CSS Custom Properties on `pf-v5-chip`" %}{% endrenderCssCustomProperties %}
+{% renderCssParts for="pf-v5-chip", header="CSS Parts on `pf-v5-chip`" %}{% endrenderCssParts %}
+
+{% renderSlots for="pf-v5-chip-group", header="Slots on `pf-v5-chip-group`" %}{% endrenderSlots %}
+{% renderAttributes for="pf-v5-chip-group", header="Attributes on `pf-v5-chip-group`" %}{% endrenderAttributes %}
+{% renderMethods for="pf-v5-chip-group", header="Methods on `pf-v5-chip-group`" %}{% endrenderMethods %}
+{% renderEvents for="pf-v5-chi-group", header="Events on `pf-v5-chip-group`" %}{% endrenderEvents %}
+{% renderCssCustomProperties for="pf-v5-chip-group", header="CSS Custom Properties on `pf-v5-chip`" %}{% endrenderCssCustomProperties %}
+{% renderCssParts for="pf-v5-chip-group", header="CSS Parts on `pf-v5-chip-group`" %}{% endrenderCssParts %}
diff --git a/elements/pf-chip/docs/screenshot.png b/elements/pf-v5-chip/docs/screenshot.png
similarity index 100%
rename from elements/pf-chip/docs/screenshot.png
rename to elements/pf-v5-chip/docs/screenshot.png
diff --git a/elements/pf-chip/pf-chip-group.css b/elements/pf-v5-chip/pf-v5-chip-group.css
similarity index 50%
rename from elements/pf-chip/pf-chip-group.css
rename to elements/pf-v5-chip/pf-v5-chip-group.css
index c3a5ecbf66..d05d8ca442 100644
--- a/elements/pf-chip/pf-chip-group.css
+++ b/elements/pf-v5-chip/pf-v5-chip-group.css
@@ -1,34 +1,34 @@
:host {
/** MarginBottom for the chip group list */
- --pf-c-chip-group__list--MarginBottom: calc(var(--pf-global--spacer--xs, 0.25rem) * -1);
+ --pf-v5-c-chip-group__list--MarginBottom: calc(var(--pf-global--spacer--xs, 0.25rem) * -1);
/** MarginRight for the chip group list */
- --pf-c-chip-group__list--MarginRight: calc(var(--pf-global--spacer--xs, 0.25rem) * -1);
+ --pf-v5-c-chip-group__list--MarginRight: calc(var(--pf-global--spacer--xs, 0.25rem) * -1);
/** PaddingTop for the chip group category */
- --pf-c-chip-group--m-category--PaddingTop: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-chip-group--m-category--PaddingTop: var(--pf-global--spacer--xs, 0.25rem);
/** PaddingRight for the chip group category */
- --pf-c-chip-group--m-category--PaddingRight: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-chip-group--m-category--PaddingRight: var(--pf-global--spacer--xs, 0.25rem);
/** PaddingBottom for the chip group category */
- --pf-c-chip-group--m-category--PaddingBottom: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-chip-group--m-category--PaddingBottom: var(--pf-global--spacer--xs, 0.25rem);
/** PaddingLeft for the chip group category */
- --pf-c-chip-group--m-category--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-chip-group--m-category--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
/** BorderRadius for the chip group category */
- --pf-c-chip-group--m-category--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
+ --pf-v5-c-chip-group--m-category--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
/** BackgroundColor for the chip group category */
- --pf-c-chip-group--m-category--BackgroundColor: var(--pf-global--BackgroundColor--200, #f0f0f0);
+ --pf-v5-c-chip-group--m-category--BackgroundColor: var(--pf-global--BackgroundColor--200, #f0f0f0);
/** MarginRight for the chip group label */
- --pf-c-chip-group__label--MarginRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-chip-group__label--MarginRight: var(--pf-global--spacer--sm, 0.5rem);
/** FontSize for the chip group label */
- --pf-c-chip-group__label--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ --pf-v5-c-chip-group__label--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
/** MaxWidth for the chip group label */
- --pf-c-chip-group__label--MaxWidth: 18ch;
+ --pf-v5-c-chip-group__label--MaxWidth: 18ch;
/** MarginTop for the chip group close button */
- --pf-c-chip-group__close--MarginTop: calc(var(--pf-global--spacer--xs, 0.25rem) * -1);
+ --pf-v5-c-chip-group__close--MarginTop: calc(var(--pf-global--spacer--xs, 0.25rem) * -1);
/** MarginBottom for the chip group close button */
- --pf-c-chip-group__close--MarginBottom: calc(var(--pf-global--spacer--xs, 0.25rem) * -1);
+ --pf-v5-c-chip-group__close--MarginBottom: calc(var(--pf-global--spacer--xs, 0.25rem) * -1);
/** MarginRight for chip group list items */
- --pf-c-chip-group__list-item--MarginRight: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-chip-group__list-item--MarginRight: var(--pf-global--spacer--xs, 0.25rem);
/** MarginBottom for chip group list items */
- --pf-c-chip-group__list-item--MarginBottom: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-chip-group__list-item--MarginBottom: var(--pf-global--spacer--xs, 0.25rem);
display: inline-flex;
flex-wrap: wrap;
align-items: center;
@@ -58,35 +58,35 @@
#outer.has-category {
padding: var(--pf-global--spacer--xs, 0.25rem) var(--pf-global--spacer--sm, 0.5rem) !important;
- background-color: var(--pf-theme--color--surface--lighter, #f0f0f0);
+ background-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0);
}
#chips {
- margin-right: var(--pf-c-chip-group__list--MarginRight);
- margin-bottom: var(--pf-c-chip-group__list--MarginBottom);
+ margin-right: var(--pf-v5-c-chip-group__list--MarginRight);
+ margin-bottom: var(--pf-v5-c-chip-group__list--MarginBottom);
font-family: var(--pf-global--FontFamily--sans-serif, "RedHatTextUpdated", "Overpass", overpass, helvetica, arial, sans-serif);
font-size: var(--pf-global--FontSize--sm, 14px);
font-weight: var(--pf-global--FontWeight--normal, 400);
line-height: 1.6;
}
-#chips ::slotted(pf-chip) {
+#chips ::slotted(pf-v5-chip) {
display: inline-flex;
min-width: 0;
- margin-right: var(--pf-c-chip-group__list-item--MarginRight);
- margin-bottom: var(--pf-c-chip-group__list-item--MarginBottom);
+ margin-right: var(--pf-v5-c-chip-group__list-item--MarginRight);
+ margin-bottom: var(--pf-v5-c-chip-group__list-item--MarginBottom);
}
#close-button {
- --pf-icon--size: 16px;
- margin: var(--pf-c-chip__c-button--MarginTop)
- var(--pf-c-chip__c-button--MarginRight)
- var(--pf-c-chip__c-button--MarginBottom)
- var(--pf-c-chip__c-button--MarginLeft);
- padding: var(--pf-c-chip__c-button--PaddingTop)
- var(--pf-c-chip__c-button--PaddingRight)
- var(--pf-c-chip__c-button--PaddingBottom)
- var(--pf-c-chip__c-button--PaddingLeft);
+ --pf-v5-icon--size: 16px;
+ margin: var(--pf-v5-c-chip__c-button--MarginTop)
+ var(--pf-v5-c-chip__c-button--MarginRight)
+ var(--pf-v5-c-chip__c-button--MarginBottom)
+ var(--pf-v5-c-chip__c-button--MarginLeft);
+ padding: var(--pf-v5-c-chip__c-button--PaddingTop)
+ var(--pf-v5-c-chip__c-button--PaddingRight)
+ var(--pf-v5-c-chip__c-button--PaddingBottom)
+ var(--pf-v5-c-chip__c-button--PaddingLeft);
inset-block-start: 0.125em;
}
diff --git a/elements/pf-chip/pf-chip-group.ts b/elements/pf-v5-chip/pf-v5-chip-group.ts
similarity index 85%
rename from elements/pf-chip/pf-chip-group.ts
rename to elements/pf-v5-chip/pf-v5-chip-group.ts
index 16c6795797..239f31b57d 100644
--- a/elements/pf-chip/pf-chip-group.ts
+++ b/elements/pf-v5-chip/pf-v5-chip-group.ts
@@ -8,18 +8,18 @@ import { classMap } from 'lit/directives/class-map.js';
import { observes } from '@patternfly/pfe-core/decorators/observes.js';
import { RovingTabindexController } from '@patternfly/pfe-core/controllers/roving-tabindex-controller.js';
-import { PfChip, PfChipRemoveEvent } from './pf-chip.js';
+import { PfV5Chip, PfV5ChipRemoveEvent } from './pf-v5-chip.js';
-import styles from './pf-chip-group.css';
-import shared from './pf-chip-shared.css';
+import styles from './pf-v5-chip-group.css';
+import shared from './pf-v5-chip-shared.css';
-export class PfChipGroupExpandEvent extends Event {
+export class PfV5ChipGroupExpandEvent extends Event {
constructor() {
super('expand', { bubbles: true, cancelable: true });
}
}
-export class PfChipGroupRemoveEvent extends Event {
+export class PfV5ChipGroupRemoveEvent extends Event {
constructor() {
super('remove', { bubbles: true, cancelable: true });
}
@@ -40,10 +40,10 @@ const REMAINING_RE = /\$\{\s*remaining\s*\}/g;
* @fires remove - Fires when chip group is closed/removed
* @slot category-name
* Category name text for chip group category. If this prop is supplied chip group with have a label and category styling applied
- * @slot - `` elements.
+ * @slot - `` elements.
*/
-@customElement('pf-chip-group')
-export class PfChipGroup extends LitElement {
+@customElement('pf-v5-chip-group')
+export class PfV5ChipGroup extends LitElement {
static readonly styles: CSSStyleSheet[] = [shared, styles];
static override readonly shadowRootOptions: ShadowRootInit = {
@@ -86,14 +86,14 @@ export class PfChipGroup extends LitElement {
*/
@property({ reflect: true, type: Boolean }) closeable = false;
- @query('#overflow') private _overflowChip?: PfChip;
+ @query('#overflow') private _overflowChip?: PfV5Chip;
@query('#close-button') private _button?: HTMLButtonElement;
@queryAssignedNodes({ slot: 'category-name', flatten: true }) private _categorySlotted?: Node[];
- get #chips(): NodeListOf {
- return this.querySelectorAll('pf-chip:not([slot]):not([overflow-chip])');
+ get #chips(): NodeListOf {
+ return this.querySelectorAll('pf-v5-chip:not([slot]):not([overflow-chip])');
}
#tabindex = RovingTabindexController.of(this, {
@@ -111,7 +111,7 @@ export class PfChipGroup extends LitElement {
get activeChip() {
const button = this.#tabindex.items.at(this.#tabindex.atFocusedItemIndex);
const shadow = button?.getRootNode() as ShadowRoot;
- return shadow?.host as PfChip;
+ return shadow?.host as PfV5Chip;
}
set activeChip(chip: HTMLElement) {
@@ -150,22 +150,22 @@ export class PfChipGroup extends LitElement {
?hidden="${!this.accessibleLabel}">${this.accessibleLabel ?? ''}
- ${this.remaining < 1 ? ''
: this.open ? this.expandedText
- : this.collapsedText.replace(REMAINING_RE, this.remaining.toString())}
-
+
+ @click="${this.#onCloseClick}">
`;
}
@@ -185,7 +185,7 @@ export class PfChipGroup extends LitElement {
* handles chip group close
*/
#onCloseClick() {
- this.dispatchEvent(new PfChipGroupRemoveEvent());
+ this.dispatchEvent(new PfV5ChipGroupRemoveEvent());
}
/**
@@ -200,7 +200,7 @@ export class PfChipGroup extends LitElement {
if (this._overflowChip) {
this.focusOnChip(this._overflowChip);
}
- this.dispatchEvent(new PfChipGroupExpandEvent());
+ this.dispatchEvent(new PfV5ChipGroupExpandEvent());
}
#onSlotchange() {
@@ -208,12 +208,12 @@ export class PfChipGroup extends LitElement {
}
#onRemove(event: Event) {
- if (event instanceof PfChipRemoveEvent) {
+ if (event instanceof PfV5ChipRemoveEvent) {
const index = this.#tabindex.atFocusedItemIndex;
if (event.chip) {
this.#tabindex.atFocusedItemIndex = index + 1;
}
- } else if (event instanceof PfChipGroupRemoveEvent) {
+ } else if (event instanceof PfV5ChipGroupRemoveEvent) {
this.remove();
}
}
@@ -231,15 +231,15 @@ export class PfChipGroup extends LitElement {
/**
* Activates the specified chip and sets focus on it
- * @param chip pf-chip element
+ * @param chip pf-v5-chip element
*/
- focusOnChip(chip: PfChip): void {
+ focusOnChip(chip: PfV5Chip): void {
this.#tabindex.atFocusedItemIndex = this.#tabindex.items.indexOf(chip);
}
}
declare global {
interface HTMLElementTagNameMap {
- 'pf-chip-group': PfChipGroup;
+ 'pf-v5-chip-group': PfV5ChipGroup;
}
}
diff --git a/elements/pf-v5-chip/pf-v5-chip-shared.css b/elements/pf-v5-chip/pf-v5-chip-shared.css
new file mode 100644
index 0000000000..338d53453c
--- /dev/null
+++ b/elements/pf-v5-chip/pf-v5-chip-shared.css
@@ -0,0 +1,11 @@
+:host {
+ --pf-v5-c-chip__c-button--PaddingTop: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-chip__c-button--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-chip__c-button--PaddingBottom: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-chip__c-button--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-chip__c-button--MarginTop: calc(var(--pf-v5-c-chip--PaddingTop) * -1);
+ --pf-v5-c-chip__c-button--MarginRight: calc(var(--pf-v5-c-chip--PaddingRight) / 2 * -1);
+ --pf-v5-c-chip__c-button--MarginBottom: calc(var(--pf-v5-c-chip--PaddingBottom) * -1);
+ --pf-v5-c-chip__c-button--FontSize: var(--pf-global--FontSize--xs, 0.75rem);
+ --pf-v5-c-chip__c-badge--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+}
diff --git a/elements/pf-v5-chip/pf-v5-chip.css b/elements/pf-v5-chip/pf-v5-chip.css
new file mode 100644
index 0000000000..375a1eac2f
--- /dev/null
+++ b/elements/pf-v5-chip/pf-v5-chip.css
@@ -0,0 +1,129 @@
+:host {
+ /** Top padding for chip */
+ --pf-v5-c-chip--PaddingTop: var(--pf-global--spacer--xs, 0.25rem);
+ /** Right padding for chip */
+ --pf-v5-c-chip--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ /** Bottom padding for chip */
+ --pf-v5-c-chip--PaddingBottom: var(--pf-global--spacer--xs, 0.25rem);
+ /** Left padding for chip */
+ --pf-v5-c-chip--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ /** Background color for chip */
+ --pf-v5-c-chip--BackgroundColor: var(--pf-global--Color--light-100, #fff);
+ /** Border radius for chip */
+ --pf-v5-c-chip--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
+ /** Border color for chip */
+ --pf-v5-c-chip--before--BorderColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ /** Border width for chip */
+ --pf-v5-c-chip--before--BorderWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** Border radius for chip border (references chip border radius) */
+ --pf-v5-c-chip--before--BorderRadius: var(--pf-v5-c-chip--BorderRadius);
+ /** Text color for overflow chip */
+ --pf-v5-c-chip--m-overflow__text--Color: var(--pf-global--primary-color--100, #06c);
+ /** Background color for draggable chip */
+ --pf-v5-c-chip--m-draggable--BackgroundColor: var(--pf-global--BackgroundColor--200, #f0f0f0);
+ /** Box shadow for draggable chip */
+ --pf-v5-c-chip--m-draggable--BoxShadow: var(--pf-global--BoxShadow--sm, 0 0.0625rem 0.125rem 0 rgba(3, 3, 3, 0.12), 0 0 0.125rem 0 rgba(3, 3, 3, 0.06));
+ /** Font size for draggable chip icon */
+ --pf-v5-c-chip--m-draggable__icon--FontSize: var(--pf-global--icon--FontSize--sm, 0.625rem);
+ /** Font size for chip text */
+ --pf-v5-c-chip__text--FontSize: var(--pf-global--FontSize--xs, 0.75rem);
+ /** Color for chip text */
+ --pf-v5-c-chip__text--Color: var(--pf-global--Color--100, #151515);
+ /** Maximum width for chip text */
+ --pf-v5-c-chip__text--MaxWidth: 16ch;
+ /** Left margin for chip icon */
+ --pf-v5-c-chip__icon--MarginLeft: var(--pf-global--spacer--sm, 0.5rem);
+ color: var(--pf-global--Color--100, #151515);
+ position: relative;
+ display: inline-flex;
+ align-items: center;
+ min-width: 0;
+ list-style: none;
+ /** Background color of chip */
+ background-color: var(--pf-v5-c-chip--BackgroundColor);
+ /** Border radius of chip */
+ border-radius: var(--pf-v5-c-chip--BorderRadius);
+ padding:
+ var(--pf-v5-c-chip--PaddingTop)
+ var(--pf-v5-c-chip--PaddingRight)
+ var(--pf-v5-c-chip--PaddingBottom)
+ var(--pf-v5-c-chip--PaddingLeft);
+}
+
+[hidden],
+:host([hidden]) {
+ display: none !important;
+}
+
+div#outer {
+ display: contents;
+}
+
+#outer:before {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ content: "";
+ border:
+ /** Border width */
+ var(--pf-v5-c-chip--before--BorderWidth)
+ solid
+ /** Border color */
+ var(--pf-v5-c-chip--before--BorderColor);
+ /** Border radius of chip border */
+ border-radius: var(--pf-v5-c-chip--before--BorderRadius);
+}
+
+span {
+ display: inline-block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ position: relative;
+ /** Maximum width of chip text */
+ max-width: var(--pf-v5-c-chip__text--MaxWidth);
+ /** Font size of chip text */
+ font-size: var(--pf-v5-c-chip__text--FontSize);
+ /** Color of chip text */
+ color: var(--pf-v5-c-chip__text--Color);
+}
+
+:host([readonly]) span {
+ color: var(--pf-global--Color--200, #6a6e73);
+}
+
+/* OVERFLOW */
+
+button#outer {
+ display: flex;
+ background: none;
+ border: 1px solid transparent;
+}
+
+button#outer span {
+ /** Color for overflow chip text */
+ color: var(--pf-v5-c-chip--m-overflow__text--Color);
+}
+
+/* CLOSE */
+
+#close-button {
+ --pf-v5-icon--size: 12px;
+ --pf-v5-c-button--PaddingTop: var(--pf-v5-c-chip__c-button--PaddingTop);
+ --pf-v5-c-button--PaddingRight: var(--pf-v5-c-chip__c-button--PaddingRight);
+ --pf-v5-c-button--PaddingBottom: var(--pf-v5-c-chip__c-button--PaddingBottom);
+ --pf-v5-c-button--PaddingLeft: var(--pf-v5-c-chip__c-button--PaddingLeft);
+ --pf-v5-c-button--FontSize: var(--pf-v5-c-chip__c-button--FontSize);
+ margin-top: var(--pf-v5-c-chip__c-button--MarginTop);
+ margin-right: var(--pf-v5-c-chip__c-button--MarginRight);
+ margin-bottom: var(--pf-v5-c-chip__c-button--MarginBottom);
+ inset-block-start: 0.125em;
+}
+
+::slotted(pf-v5-badge) {
+ font-size: var(--pf-global--FontSize--xs, 12px);
+ margin: 0 0 0 var(--pf-global--spacer--xs, 0.25rem) !important;
+ min-width: unset;
+}
diff --git a/elements/pf-chip/pf-chip.ts b/elements/pf-v5-chip/pf-v5-chip.ts
similarity index 80%
rename from elements/pf-chip/pf-chip.ts
rename to elements/pf-v5-chip/pf-v5-chip.ts
index 80cc03515f..d7878a247b 100644
--- a/elements/pf-chip/pf-chip.ts
+++ b/elements/pf-v5-chip/pf-v5-chip.ts
@@ -2,13 +2,13 @@ import { LitElement, html, type TemplateResult } from 'lit';
import { customElement } from 'lit/decorators/custom-element.js';
import { property } from 'lit/decorators/property.js';
-import '@patternfly/elements/pf-button/pf-button.js';
+import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
-import styles from './pf-chip.css';
-import shared from './pf-chip-shared.css';
+import styles from './pf-v5-chip.css';
+import shared from './pf-v5-chip-shared.css';
-export class PfChipRemoveEvent extends Event {
- constructor(public chip: PfChip) {
+export class PfV5ChipRemoveEvent extends Event {
+ constructor(public chip: PfV5Chip) {
super('remove', { bubbles: true });
}
}
@@ -19,8 +19,8 @@ export class PfChipRemoveEvent extends Event {
* @fires {ChipRemoveEvent} remove - Fires when chip is removed
* @fires {Event} click - when close button is clicked
*/
-@customElement('pf-chip')
-export class PfChip extends LitElement {
+@customElement('pf-v5-chip')
+export class PfV5Chip extends LitElement {
static readonly styles: CSSStyleSheet[] = [shared, styles];
static override readonly shadowRootOptions: ShadowRootInit = {
@@ -59,19 +59,19 @@ export class PfChip extends LitElement {
-
+ @click="${this.#onClick}">
`;
}
#onClick() {
- if (this.dispatchEvent(new PfChipRemoveEvent(this))) {
+ if (this.dispatchEvent(new PfV5ChipRemoveEvent(this))) {
this.remove();
}
}
@@ -79,6 +79,6 @@ export class PfChip extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-chip': PfChip;
+ 'pf-v5-chip': PfV5Chip;
}
}
diff --git a/elements/pf-chip/test/pf-chip-group.spec.ts b/elements/pf-v5-chip/test/pf-chip-group.spec.ts
similarity index 73%
rename from elements/pf-chip/test/pf-chip-group.spec.ts
rename to elements/pf-v5-chip/test/pf-chip-group.spec.ts
index b844d77a56..2952ac858e 100644
--- a/elements/pf-chip/test/pf-chip-group.spec.ts
+++ b/elements/pf-v5-chip/test/pf-chip-group.spec.ts
@@ -1,8 +1,8 @@
import { expect, html, nextFrame } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { a11ySnapshot, querySnapshot, querySnapshotAll, type A11yTreeSnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
-import { PfChipGroup } from '../pf-chip-group.js';
-import { PfChip } from '../pf-chip.js';
+import { PfV5ChipGroup } from '../pf-v5-chip-group.js';
+import { PfV5Chip } from '../pf-v5-chip.js';
import { sendKeys } from '@web/test-runner-commands';
function press(key: string) {
@@ -11,36 +11,36 @@ function press(key: string) {
};
}
-describe('', async function() {
- let element: PfChipGroup;
+describe('', async function() {
+ let element: PfV5ChipGroup;
describe('simply instantiating', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-chip-group')).to.be.an.instanceof(PfChipGroup);
+ expect(document.createElement('pf-v5-chip-group')).to.be.an.instanceof(PfV5ChipGroup);
});
it('should upgrade', async function() {
- element = await createFixture(html` `);
- const klass = customElements.get('pf-chip-group');
+ element = await createFixture(html` `);
+ const klass = customElements.get('pf-v5-chip-group');
expect(element)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfChipGroup);
+ .to.be.an.instanceOf(PfV5ChipGroup);
});
});
describe('with 4 chips', function() {
- let element: PfChipGroup;
+ let element: PfV5ChipGroup;
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
- element = await createFixture(html`
-
- Chip 1
- Chip 2
- Chip 3
- Chip 4
-
+ element = await createFixture(html`
+
+ Chip 1
+ Chip 2
+ Chip 3
+ Chip 4
+
`);
});
@@ -89,16 +89,16 @@ describe('', async function() {
});
describe('with 4 chips and `closeable` attribute', function() {
- let element: PfChipGroup;
+ let element: PfV5ChipGroup;
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
- element = await createFixture(html`
-
- Chip 1
- Chip 2
- Chip 3
- Chip 4
-
+ element = await createFixture(html`
+
+ Chip 1
+ Chip 2
+ Chip 3
+ Chip 4
+
`);
});
@@ -124,24 +124,24 @@ describe('', async function() {
});
describe('with 4 chips and `collapsed-text`, `expanded-text`, and `label` attributes', async function() {
- let chip1: PfChip;
- let chip2: PfChip;
- let element: PfChipGroup;
+ let chip1: PfV5Chip;
+ let chip2: PfV5Chip;
+ let element: PfV5ChipGroup;
let snapshot: A11yTreeSnapshot;
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
- element = await createFixture(html`
- (html`
+
- Chip 1
- Chip 2
- Chip 3
- Chip 4
-
+ Chip 1
+ Chip 2
+ Chip 3
+ Chip 4
+
`);
- [chip1, chip2] = document.querySelectorAll('pf-chip');
+ [chip1, chip2] = document.querySelectorAll('pf-v5-chip');
snapshot = await a11ySnapshot();
});
@@ -174,13 +174,13 @@ describe('', async function() {
describe('with 4 chips and `num-chips="2"` attribute', function() {
beforeEach(async function() {
- await createFixture(html`
-
- Chip 1
- Chip 2
- Chip 3
- Chip 4
-
+ await createFixture(html`
+
+ Chip 1
+ Chip 2
+ Chip 3
+ Chip 4
+
`);
});
it('only 2 chips should be visible', async function() {
@@ -190,17 +190,17 @@ describe('', async function() {
});
describe('with 4 chips and `num-chips="4"` attribute', function() {
- let element: PfChipGroup;
+ let element: PfV5ChipGroup;
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
- element = await createFixture(html`
-
- Chip 1
- Chip 2
- Chip 3
- Chip 4
-
+ element = await createFixture(html`
+
+ Chip 1
+ Chip 2
+ Chip 3
+ Chip 4
+
`);
});
diff --git a/elements/pf-chip/test/pf-chip.e2e.ts b/elements/pf-v5-chip/test/pf-chip.e2e.ts
similarity index 95%
rename from elements/pf-chip/test/pf-chip.e2e.ts
rename to elements/pf-v5-chip/test/pf-chip.e2e.ts
index 77e5e203e5..6a3f21c845 100644
--- a/elements/pf-chip/test/pf-chip.e2e.ts
+++ b/elements/pf-v5-chip/test/pf-chip.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-chip';
+const tagName = 'pf-v5-chip';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-chip/test/pf-chip.spec.ts b/elements/pf-v5-chip/test/pf-chip.spec.ts
similarity index 78%
rename from elements/pf-chip/test/pf-chip.spec.ts
rename to elements/pf-v5-chip/test/pf-chip.spec.ts
index 7d39ae6dab..ca2a293cc2 100644
--- a/elements/pf-chip/test/pf-chip.spec.ts
+++ b/elements/pf-v5-chip/test/pf-chip.spec.ts
@@ -1,6 +1,6 @@
import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
-import { PfChip } from '../pf-chip.js';
+import { PfV5Chip } from '../pf-v5-chip.js';
import { sendKeys } from '@web/test-runner-commands';
import { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
@@ -17,25 +17,25 @@ function activeElement(element: HTMLElement) {
return element.shadowRoot?.activeElement;
}
-describe('', async function() {
+describe('', async function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-chip')).to.be.an.instanceof(PfChip);
+ expect(document.createElement('pf-v5-chip')).to.be.an.instanceof(PfV5Chip);
});
it('should upgrade', async function() {
- const klass = customElements.get('pf-chip');
- expect(await createFixture(html` `))
+ const klass = customElements.get('pf-v5-chip');
+ expect(await createFixture(html` `))
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfChip);
+ .to.be.an.instanceOf(PfV5Chip);
});
describe('simply instantiating', function() {
- let element: PfChip;
+ let element: PfV5Chip;
beforeEach(async function() {
- element = await createFixture(html`
-
+ element = await createFixture(html`
+
`);
});
@@ -64,18 +64,18 @@ describe('', async function() {
beforeEach(() => element.focus());
beforeEach(press('Enter'));
it('should close', function() {
- expect(document.querySelector('pf-chip')).to.be.null;
+ expect(document.querySelector('pf-v5-chip')).to.be.null;
});
});
});
});
describe('with `overflow-chip` attribute', function() {
- let element: PfChip;
+ let element: PfV5Chip;
beforeEach(async function() {
- element = await createFixture(html`
- Overflow
+ element = await createFixture(html`
+ Overflow
`);
});
@@ -106,24 +106,24 @@ describe('', async function() {
beforeEach(() => element.focus());
beforeEach(press('Enter'));
it('should NOT close', function() {
- expect(document.querySelector('pf-chip')).to.not.be.null;
+ expect(document.querySelector('pf-v5-chip')).to.not.be.null;
});
});
describe('clicking element', function() {
beforeEach(() => clickElementAtCenter(element));
it('should NOT close', function() {
- expect(document.querySelector('pf-chip')).to.not.be.null;
+ expect(document.querySelector('pf-v5-chip')).to.not.be.null;
});
});
});
describe('readonly', async function() {
- let element: PfChip;
+ let element: PfV5Chip;
beforeEach(async function() {
- element = await createFixture(html`
-
+ element = await createFixture(html`
+
`);
});
diff --git a/elements/pf-clipboard-copy/README.md b/elements/pf-v5-clipboard-copy/README.md
similarity index 51%
rename from elements/pf-clipboard-copy/README.md
rename to elements/pf-v5-clipboard-copy/README.md
index e8725e5883..bce08e1814 100644
--- a/elements/pf-clipboard-copy/README.md
+++ b/elements/pf-v5-clipboard-copy/README.md
@@ -4,5 +4,5 @@ Copy-to-clipboard widget
## Usage
```html
-Content to copy
+Content to copy
```
diff --git a/elements/pf-clipboard-copy/demo/code.html b/elements/pf-v5-clipboard-copy/demo/code.html
similarity index 74%
rename from elements/pf-clipboard-copy/demo/code.html
rename to elements/pf-v5-clipboard-copy/demo/code.html
index f2465cad27..fe7a95dc66 100644
--- a/elements/pf-clipboard-copy/demo/code.html
+++ b/elements/pf-v5-clipboard-copy/demo/code.html
@@ -1,6 +1,6 @@
JSON object (pre-formatted code)
-
+
{ "menu": {
"id": "file",
"value": "File",
@@ -12,11 +12,11 @@ JSON object (pre-formatted code)
]
}
}}
-
+
diff --git a/elements/pf-v5-clipboard-copy/demo/inline-compact-code.html b/elements/pf-v5-clipboard-copy/demo/inline-compact-code.html
new file mode 100644
index 0000000000..0bde4ce5fb
--- /dev/null
+++ b/elements/pf-v5-clipboard-copy/demo/inline-compact-code.html
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/elements/pf-v5-clipboard-copy/demo/inline-compact.html b/elements/pf-v5-clipboard-copy/demo/inline-compact.html
new file mode 100644
index 0000000000..8046701a73
--- /dev/null
+++ b/elements/pf-v5-clipboard-copy/demo/inline-compact.html
@@ -0,0 +1,32 @@
+
+ 2.3.4-2-redhat
+ Inline compact with additional action
+ 2.3.4-2-redhat
+
+
+
+
+
+ Inline compact in sentence
+ Basic
+
+ Lorem ipsum 2.3.4-2-redhat
+
+ Long copy string
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890 Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris, ullamcorper pharetra lacus nibh vitae enim.
+
+ Long copy string in block
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+ https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890 Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris, ullamcorper pharetra lacus nibh vitae enim.
+
+
+
+
+
diff --git a/elements/pf-clipboard-copy/demo/read-only-expandable.html b/elements/pf-v5-clipboard-copy/demo/read-only-expandable.html
similarity index 62%
rename from elements/pf-clipboard-copy/demo/read-only-expandable.html
rename to elements/pf-v5-clipboard-copy/demo/read-only-expandable.html
index 09d7e20e50..bce867384a 100644
--- a/elements/pf-clipboard-copy/demo/read-only-expandable.html
+++ b/elements/pf-v5-clipboard-copy/demo/read-only-expandable.html
@@ -1,12 +1,12 @@
-
+
Got a lot of text here, need to see all of it?
Click that arrow on the left side and check out the resulting expansion.
-
+
diff --git a/elements/pf-clipboard-copy/docs/CHANGELOG.old.md b/elements/pf-v5-clipboard-copy/docs/CHANGELOG.old.md
similarity index 100%
rename from elements/pf-clipboard-copy/docs/CHANGELOG.old.md
rename to elements/pf-v5-clipboard-copy/docs/CHANGELOG.old.md
diff --git a/elements/pf-clipboard-copy/docs/pf-clipboard-copy.md b/elements/pf-v5-clipboard-copy/docs/pf-clipboard-copy.md
similarity index 64%
rename from elements/pf-clipboard-copy/docs/pf-clipboard-copy.md
rename to elements/pf-v5-clipboard-copy/docs/pf-clipboard-copy.md
index f05c0d260e..a667c4a728 100644
--- a/elements/pf-clipboard-copy/docs/pf-clipboard-copy.md
+++ b/elements/pf-v5-clipboard-copy/docs/pf-clipboard-copy.md
@@ -1,42 +1,42 @@
{% renderInstallation %} {% endrenderInstallation %}
{% renderOverview %}
-
+
{% endrenderOverview %}
{% band header="Usage" %}
### Read-only
{% htmlexample %}
-
+
{% endhtmlexample %}
### Expanded
{% htmlexample %}
-
+
Got a lot of text here, need to see all of it?
Click that arrow on the left side and check out the resulting expansion.
-
+
{% endhtmlexample %}
### Read-only expanded
{% htmlexample %}
-
+
Got a lot of text here, need to see all of it?
Click that arrow on the left side and check out the resulting expansion.
-
+
{% endhtmlexample %}
### Read-only expanded by default
{% htmlexample %}
-
+
Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting expansion.
asodifna osdif
-
+
{% endhtmlexample %}
### JSON object (pre-formatted code)
{% htmlexample %}
-
+
{ "menu": {
"id": "file",
"value": "File",
@@ -48,37 +48,37 @@
]
}
}}
-
+
{% endhtmlexample %}
### Inline compact
{% htmlexample %}
- 2.3.4-2-redhat
+ 2.3.4-2-redhat
{% endhtmlexample %}
### Inline compact code
{% htmlexample %}
- 2.3.4-2-redhat
+ 2.3.4-2-redhat
{% endhtmlexample %}
### Inline compact with additional action
{% htmlexample %}
- 2.3.4-2-redhat
-
-
-
-
+ 2.3.4-2-redhat
+
+
+
+
{% endhtmlexample %}
### Inline compact in sentence
#### Basic
{% htmlexample %}
- Lorem ipsum 2.3.4-2-redhat
+ Lorem ipsum 2.3.4-2-redhat
{% endhtmlexample %}
#### Long copy string
{% htmlexample %}
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris,
ullamcorper pharetra lacus nibh vitae enim.
{% endhtmlexample %}
@@ -86,7 +86,7 @@
#### Long copy string in block
{% htmlexample %}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
+ https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris,
ullamcorper pharetra lacus nibh vitae enim.
diff --git a/elements/pf-clipboard-copy/docs/screenshot.png b/elements/pf-v5-clipboard-copy/docs/screenshot.png
similarity index 100%
rename from elements/pf-clipboard-copy/docs/screenshot.png
rename to elements/pf-v5-clipboard-copy/docs/screenshot.png
diff --git a/elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.css b/elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.css
new file mode 100644
index 0000000000..4652ced7a1
--- /dev/null
+++ b/elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.css
@@ -0,0 +1,187 @@
+:host {
+ /** Transition for the toggle icon */
+ --pf-v5-c-clipboard-copy__toggle-icon--Transition: .2s ease-in 0s;
+ /** Rotate value for the toggle icon when expanded */
+ --pf-v5-c-clipboard-copy--m-expanded__toggle-icon--Rotate: 90deg;
+ /** PaddingTop for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--PaddingTop: var(--pf-global--spacer--md, 1rem);
+ /** PaddingRight for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--PaddingRight: var(--pf-global--spacer--md, 1rem);
+ /** PaddingBottom for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--PaddingBottom: var(--pf-global--spacer--md, 1rem);
+ /** PaddingLeft for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ /** BackgroundColor for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--BackgroundColor: var(--pf-global--BackgroundColor--light-100, #fff);
+ /** BorderTopWidth for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--BorderTopWidth: 0;
+ /** BorderRightWidth for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--BorderRightWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** BorderBottomWidth for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--BorderBottomWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** BorderLeftWidth for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--BorderLeftWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** BorderColor for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--BorderColor: var(--pf-global--BorderColor--100, #d2d2d2);
+ /** OutlineOffset for the expandable content */
+ --pf-v5-c-clipboard-copy__expandable-content--OutlineOffset: calc(-1 * var(--pf-global--spacer--xs, 0.25rem));
+ /** PaddingTop for the inline variant */
+ --pf-v5-c-clipboard-copy--m-inline--PaddingTop: 0;
+ /** PaddingBottom for the inline variant */
+ --pf-v5-c-clipboard-copy--m-inline--PaddingBottom: 0;
+ /** PaddingLeft for the inline variant */
+ --pf-v5-c-clipboard-copy--m-inline--PaddingLeft: var(--pf-global--spacer--xs, 0.25rem);
+ /** BackgroundColor for the inline variant */
+ --pf-v5-c-clipboard-copy--m-inline--BackgroundColor: var(--pf-global--BackgroundColor--200, #f0f0f0);
+ /** FontFamily for the code text */
+ --pf-v5-c-clipboard-copy__text--m-code--FontFamily: var(--pf-global--FontFamily--monospace, "Liberation Mono", consolas, "SFMono-Regular", menlo, monaco, "Courier New", monospace);
+ /** FontSize for the code text */
+ --pf-v5-c-clipboard-copy__text--m-code--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ /** MarginTop for actions item */
+ --pf-v5-c-clipboard-copy__actions-item--MarginTop: calc(-1 * var(--pf-global--spacer--form-element, 0.375rem));
+ /** MarginBottom for actions item */
+ --pf-v5-c-clipboard-copy__actions-item--MarginBottom: calc(-1 * var(--pf-global--spacer--form-element, 0.375rem));
+ /** PaddingTop for actions item button */
+ --pf-v5-c-clipboard-copy__actions-item--button--PaddingTop: var(--pf-global--spacer--xs, 0.25rem);
+ /** PaddingRight for actions item button */
+ --pf-v5-c-clipboard-copy__actions-item--button--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ /** PaddingBottom for actions item button */
+ --pf-v5-c-clipboard-copy__actions-item--button--PaddingBottom: var(--pf-global--spacer--xs, 0.25rem);
+ /** PaddingLeft for actions item button */
+ --pf-v5-c-clipboard-copy__actions-item--button--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-icon--size: var(--pf-global--FontSize--md, 1rem);
+}
+
+[hidden],
+[inert],
+[inert]::slotted(*) {
+ display: none !important;
+}
+
+#container {
+ flex-direction: column;
+}
+
+#container,
+#input-group,
+#wrapper {
+ display: flex;
+}
+
+.inline #wrapper {
+ display: inline-flex;
+}
+
+#input-group > * + * {
+ margin-left: -1px;
+}
+
+input {
+ color: var(--pf-v5-c-form-control--Color);
+ width: var(--pf-v5-c-form-control--Width);
+ padding:
+ var(--pf-v5-c-form-control--PaddingTop)
+ var(--pf-v5-c-form-control--PaddingRight)
+ var(--pf-v5-c-form-control--PaddingBottom)
+ var(--pf-v5-c-form-control--PaddingLeft);
+ font-size: var(--pf-v5-c-form-control--FontSize);
+ line-height: var(--pf-v5-c-form-control--LineHeight);
+ background-color: var(--pf-v5-c-form-control--BackgroundColor);
+ background-repeat: no-repeat;
+ border: var(--pf-v5-c-form-control--BorderWidth) solid;
+ border-color:
+ var(--pf-v5-c-form-control--BorderTopColor)
+ var(--pf-v5-c-form-control--BorderRightColor)
+ var(--pf-v5-c-form-control--BorderBottomColor)
+ var(--pf-v5-c-form-control--BorderLeftColor);
+ border-radius: var(--pf-v5-c-form-control--BorderRadius);
+ margin: 0;
+ appearance: none;
+ height: var(--pf-v5-c-form-control--Height);
+ text-overflow: ellipsis;
+ flex: 1 1 auto;
+}
+
+input[disabled] {
+ background-color: var(--pf-v5-c-form-control--readonly--BackgroundColor);
+}
+
+textarea {
+ display: flex;
+ flex: 1 1 auto;
+ padding:
+ var(--pf-v5-c-clipboard-copy__expandable-content--PaddingTop)
+ var(--pf-v5-c-clipboard-copy__expandable-content--PaddingRight)
+ var(--pf-v5-c-clipboard-copy__expandable-content--PaddingBottom)
+ var(--pf-v5-c-clipboard-copy__expandable-content--PaddingLeft);
+ word-wrap: break-word;
+ background-color: var(--pf-v5-c-clipboard-copy__expandable-content--BackgroundColor);
+ background-clip: padding-box;
+ border: solid var(--pf-v5-c-clipboard-copy__expandable-content--BorderColor);
+ border-width:
+ var(--pf-v5-c-clipboard-copy__expandable-content--BorderTopWidth)
+ var(--pf-v5-c-clipboard-copy__expandable-content--BorderRightWidth)
+ var(--pf-v5-c-clipboard-copy__expandable-content--BorderBottomWidth)
+ var(--pf-v5-c-clipboard-copy__expandable-content--BorderLeftWidth);
+ box-shadow: var(--pf-v5-c-clipboard-copy__expandable-content--BoxShadow);
+ margin: 0;
+ color: inherit;
+ font-family: inherit;
+}
+
+#input-group {
+ display: flex;
+ height: 100%;
+}
+
+#container.code textarea {
+ font-family: var(--pf-global--FontFamily--monospace,
+ var(--pf-global--FontFamily--redhat--monospace,
+ "RedHatMono",
+ "Liberation Mono",
+ consolas,
+ "SFMono-Regular",
+ menlo,
+ monaco,
+ "Courier New",
+ monospace));
+}
+
+#container.expanded #expand-button pf-v5-icon {
+ rotate: 90deg;
+}
+
+#container.inline {
+ display: inline;
+ background-color: var(--pf-v5-c-clipboard-copy--m-inline--BackgroundColor);
+ padding-block-start: var(--pf-v5-c-clipboard-copy--m-inline--PaddingTop);
+ padding-block-end: var(--pf-v5-c-clipboard-copy--m-inline--PaddingBottom);
+ padding-inline-start: var(--pf-v5-c-clipboard-copy--m-inline--PaddingLeft);
+ word-break: break-word;
+ white-space: normal;
+}
+
+#container:is(.compact, .inline) #input-group {
+ display: contents;
+}
+
+#container:is(.compact, .inline) #input-group {
+ background-color: var(--pf-v5-c-button--m-plain--BackgroundColor,
+ var(--pf-global--BackgroundColor--200, #f0f0f0));
+}
+
+#container.compact.block {
+ display: block;
+ background-color: var(--pf-v5-c-clipboard-copy--m-inline--BackgroundColor);
+}
+
+#container:is(.compact, .inline) #copy-button,
+#container:is(.compact, .inline) slot[name="actions"]::slotted(*) {
+ --pf-v5-c-button--PaddingTop: var(--pf-v5-c-clipboard-copy__actions-item--button--PaddingTop) !important;
+ --pf-v5-c-button--PaddingRight: var(--pf-v5-c-clipboard-copy__actions-item--button--PaddingRight) !important;
+ --pf-v5-c-button--PaddingBottom: var(--pf-v5-c-clipboard-copy__actions-item--button--PaddingBottom) !important;
+ --pf-v5-c-button--PaddingLeft: var(--pf-v5-c-clipboard-copy__actions-item--button--PaddingLeft) !important;
+ margin-block-start: calc(-1 * var(--pf-v5-c-button--PaddingTop));
+ margin-block-end: calc(-1 * var(--pf-v5-c-button--PaddingBottom));
+}
+
diff --git a/elements/pf-clipboard-copy/pf-clipboard-copy.ts b/elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.ts
similarity index 87%
rename from elements/pf-clipboard-copy/pf-clipboard-copy.ts
rename to elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.ts
index 52f6b957ab..ae30df1548 100644
--- a/elements/pf-clipboard-copy/pf-clipboard-copy.ts
+++ b/elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.ts
@@ -4,16 +4,16 @@ import { property } from 'lit/decorators/property.js';
import { classMap } from 'lit/directives/class-map.js';
import { ifDefined } from 'lit/directives/if-defined.js';
-import styles from './pf-clipboard-copy.css';
+import styles from './pf-v5-clipboard-copy.css';
import formControlStyles from '../form-control.css';
-import '@patternfly/elements/pf-button/pf-button.js';
-import '@patternfly/elements/pf-icon/pf-icon.js';
-import '@patternfly/elements/pf-tooltip/pf-tooltip.js';
+import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
+import '@patternfly/elements/pf-v5-icon/pf-v5-icon.js';
+import '@patternfly/elements/pf-v5-tooltip/pf-v5-tooltip.js';
const sleep = (ms?: number) => new Promise(r => setTimeout(r, ms));
-export class PfClipboardCopyCopiedEvent extends Event {
+export class PfV5ClipboardCopyCopiedEvent extends Event {
constructor(public text: string) {
super('copy', { bubbles: true });
}
@@ -22,10 +22,10 @@ export class PfClipboardCopyCopiedEvent extends Event {
/**
* The **clipboard copy** component allows users to quickly and easily copy content to their clipboard.
* @alias Clipboard Copy
- * @fires {PfClipboardCopyCopiedEvent} copy - when the text snippet is successfully copied.
+ * @fires {PfV5ClipboardCopyCopiedEvent} copy - when the text snippet is successfully copied.
*/
-@customElement('pf-clipboard-copy')
-export class PfClipboardCopy extends LitElement {
+@customElement('pf-v5-clipboard-copy')
+export class PfV5ClipboardCopy extends LitElement {
static readonly styles: CSSStyleSheet[] = [formControlStyles, styles];
static override readonly shadowRootOptions: ShadowRootInit = {
@@ -98,13 +98,13 @@ export class PfClipboardCopy extends LitElement {
@@ -162,7 +162,7 @@ export class PfClipboardCopy extends LitElement {
*/
async copy(): Promise
{
await navigator.clipboard.writeText(this.value);
- this.dispatchEvent(new PfClipboardCopyCopiedEvent(this.value));
+ this.dispatchEvent(new PfV5ClipboardCopyCopiedEvent(this.value));
await sleep(this.entryDelay);
this.#copied = true;
this.requestUpdate();
@@ -174,6 +174,6 @@ export class PfClipboardCopy extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-clipboard-copy': PfClipboardCopy;
+ 'pf-v5-clipboard-copy': PfV5ClipboardCopy;
}
}
diff --git a/elements/pf-clipboard-copy/test/pf-clipboard-copy.e2e.ts b/elements/pf-v5-clipboard-copy/test/pf-clipboard-copy.e2e.ts
similarity index 94%
rename from elements/pf-clipboard-copy/test/pf-clipboard-copy.e2e.ts
rename to elements/pf-v5-clipboard-copy/test/pf-clipboard-copy.e2e.ts
index 0d2f1f8da4..e10a81becd 100644
--- a/elements/pf-clipboard-copy/test/pf-clipboard-copy.e2e.ts
+++ b/elements/pf-v5-clipboard-copy/test/pf-clipboard-copy.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-clipboard-copy';
+const tagName = 'pf-v5-clipboard-copy';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-clipboard-copy/test/pf-clipboard-copy.spec.ts b/elements/pf-v5-clipboard-copy/test/pf-clipboard-copy.spec.ts
similarity index 86%
rename from elements/pf-clipboard-copy/test/pf-clipboard-copy.spec.ts
rename to elements/pf-v5-clipboard-copy/test/pf-clipboard-copy.spec.ts
index 94bbf01a86..3ef8fd3ac0 100644
--- a/elements/pf-clipboard-copy/test/pf-clipboard-copy.spec.ts
+++ b/elements/pf-v5-clipboard-copy/test/pf-clipboard-copy.spec.ts
@@ -3,12 +3,12 @@ import type { SinonStub } from 'sinon';
import { sendKeys } from '@web/test-runner-commands';
import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
-import { PfClipboardCopy } from '@patternfly/elements/pf-clipboard-copy/pf-clipboard-copy.js';
+import { PfV5ClipboardCopy } from '@patternfly/elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.js';
import { stub } from 'sinon';
-describe('', function() {
- let element: PfClipboardCopy;
+describe('', function() {
+ let element: PfV5ClipboardCopy;
beforeEach(function stubCopy() {
stub(navigator.clipboard, 'writeText');
});
@@ -18,21 +18,21 @@ describe('', function() {
});
beforeEach(async function() {
- element = await createFixture(html`
-
+ element = await createFixture(html`
+
`);
});
it('imperatively instantiates', function() {
- expect(document.createElement('pf-clipboard-copy')).to.be.an.instanceof(PfClipboardCopy);
+ expect(document.createElement('pf-v5-clipboard-copy')).to.be.an.instanceof(PfV5ClipboardCopy);
});
it('should upgrade', async function() {
- const klass = customElements.get('pf-clipboard-copy');
+ const klass = customElements.get('pf-v5-clipboard-copy');
expect(element)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfClipboardCopy);
+ .to.be.an.instanceOf(PfV5ClipboardCopy);
});
describe('setting value attribute', function() {
diff --git a/elements/pf-code-block/README.md b/elements/pf-v5-code-block/README.md
similarity index 75%
rename from elements/pf-code-block/README.md
rename to elements/pf-v5-code-block/README.md
index 83c2ac1fed..602af5d35f 100644
--- a/elements/pf-code-block/README.md
+++ b/elements/pf-v5-code-block/README.md
@@ -1,5 +1,5 @@
# PatternFly Elements Code Block
-`` is a component that contains two or more lines of ready-only
+`` is a component that contains two or more lines of ready-only
code. The code in a code block can be copied to the clipboard.
Read more about Code Block in the [PatternFly Elements Code Block
@@ -7,22 +7,22 @@ documentation](https://patternflyelements.org/components/code-block)
## Installation
-Load `` via CDN:
+Load `` via CDN:
```html
-
+
```
Or, if you are using [NPM](https://npm.im), install it
```bash
-npm install @patternfly/pf-code-block
+npm install @patternfly/pf-v5-code-block
```
Then once installed, import it to your application:
```js
-import '@patternfly/pf-code-block';
+import '@patternfly/pf-v5-code-block';
```
## Usage
@@ -34,10 +34,10 @@ Script text content will be automatically dedented.
To add copy-to-clipboard functionality, be sure to import
-`@patternfly/pf-clipboard` and add the `pf-clipboard` to the `action` slot.
+`@patternfly/pf-v5-clipboard` and add the `pf-v5-clipboard` to the `action` slot.
```html
-
+
-
+
```
### Expandable
@@ -61,7 +61,7 @@ because of how the whitespace will be handled. Failing to do this can result in
unwanted line breaks.
```html
-
+
-
-
+
+
```
diff --git a/elements/pf-code-block/demo/expandable.html b/elements/pf-v5-code-block/demo/expandable.html
similarity index 60%
rename from elements/pf-code-block/demo/expandable.html
rename to elements/pf-v5-code-block/demo/expandable.html
index d53b405681..45a052191d 100644
--- a/elements/pf-code-block/demo/expandable.html
+++ b/elements/pf-v5-code-block/demo/expandable.html
@@ -1,5 +1,5 @@
-
+
-
-
+
+
-
-
+
+
diff --git a/elements/pf-v5-dropdown/demo/descriptions.html b/elements/pf-v5-dropdown/demo/descriptions.html
new file mode 100644
index 0000000000..88f01603ec
--- /dev/null
+++ b/elements/pf-v5-dropdown/demo/descriptions.html
@@ -0,0 +1,11 @@
+
+ item1
+ item2le deuxième élément
+ item3
+ item4
+
+
+
+
diff --git a/elements/pf-v5-dropdown/demo/disabled-item.html b/elements/pf-v5-dropdown/demo/disabled-item.html
new file mode 100644
index 0000000000..135a230970
--- /dev/null
+++ b/elements/pf-v5-dropdown/demo/disabled-item.html
@@ -0,0 +1,17 @@
+
+ Toggle dropdown
+ item4
+
+
+ item1
+ item2
+
+ item3
+
+ disabled item
+
+
+
+
diff --git a/elements/pf-v5-dropdown/demo/disabled.html b/elements/pf-v5-dropdown/demo/disabled.html
new file mode 100644
index 0000000000..bb64906e25
--- /dev/null
+++ b/elements/pf-v5-dropdown/demo/disabled.html
@@ -0,0 +1,15 @@
+
+ item1
+ item2
+ nav item
+
+
+Interactive content behind the menu should not be activated when a disabled menu item is clicked.
+Should not toggle behind dropdown
+ OOPS! I did it again
+
+
+
+
diff --git a/elements/pf-v5-dropdown/demo/groups.html b/elements/pf-v5-dropdown/demo/groups.html
new file mode 100644
index 0000000000..5d3d7c5406
--- /dev/null
+++ b/elements/pf-v5-dropdown/demo/groups.html
@@ -0,0 +1,19 @@
+
+ item4
+
+
+ item1
+ item2
+
+ item3
+
+
+ item1
+ item2
+
+
+
+
+
diff --git a/elements/pf-v5-dropdown/demo/index.html b/elements/pf-v5-dropdown/demo/index.html
new file mode 100644
index 0000000000..43f718bd9d
--- /dev/null
+++ b/elements/pf-v5-dropdown/demo/index.html
@@ -0,0 +1,10 @@
+
+ item1
+ item2
+ item3
+
+
+
+
diff --git a/elements/pf-dropdown/docs/pf-dropdown.md b/elements/pf-v5-dropdown/docs/pf-dropdown.md
similarity index 51%
rename from elements/pf-dropdown/docs/pf-dropdown.md
rename to elements/pf-v5-dropdown/docs/pf-dropdown.md
index 4ac1866281..5ee758a6d4 100644
--- a/elements/pf-dropdown/docs/pf-dropdown.md
+++ b/elements/pf-v5-dropdown/docs/pf-dropdown.md
@@ -1,20 +1,20 @@
{% renderInstallation %} {% endrenderInstallation %}
{% renderOverview %}
-
- Action
- Link
- Disabled Action
- Link
+
+ Action
+ Link
+ Disabled Action
+ Link
- Separated Action
+ Separated Action
- Separated Link
-
+ Separated Link
+
{% endrenderOverview %}
{% band header="Usage" %}
@@ -29,15 +29,15 @@ The following example shows a few different states of dropdown items. As shown i
This example also uses an `hr` to split the menu into 2 sections with a horizontal line.
{% htmlexample %}
-
- Action
- Link
- Disabled Action
- Link
+
+ Action
+ Link
+ Disabled Action
+ Link
- Separated Action
- Separated Link
-
+ Separated Action
+ Separated Link
+
{% endhtmlexample %}
### Custom toggle
@@ -45,19 +45,19 @@ This example also uses an `hr` to split the menu into 2 sections with a horizont
A custom toggle can be added using the `toggle` slot.
{% htmlexample %}
-
-
+
+
My Custom Dropdown
-
- Action
- Link
- Disabled Action
- Link
+
+ Action
+ Link
+ Disabled Action
+ Link
- Separated Action
- Separated Link
-
+ Separated Action
+ Separated Link
+
{% endhtmlexample %}
### With kebab toggle
@@ -65,66 +65,66 @@ A custom toggle can be added using the `toggle` slot.
When there isn't enough space for a labeled button, a slotted toggle button with a kebab icon (three dots) can be used to toggle the dropdown menu open or closed. Make sure to add an `aria-label` to the toggle so that assistive technology users know what the button is.
{% htmlexample %}
-
-
+
+
-
- Action
- Link
- Disabled Action
- Link
+
+ Action
+ Link
+ Disabled Action
+ Link
- Separated Action
- Separated Link
-
+ Separated Action
+ Separated Link
+
{% endhtmlexample %}
### With groups of items
-To group sets of related dropdown items together, use a `pf-dropdown-group`. When more than 1 `pf-dropdown-group` is created in a menu, use the label and labelHeadingLevel properties to assign a name and heading level to each group.
+To group sets of related dropdown items together, use a `pf-v5-dropdown-group`. When more than 1 `pf-v5-dropdown-group` is created in a menu, use the label and labelHeadingLevel properties to assign a name and heading level to each group.
{% htmlexample %}
-
-
- Action
- Link
-
+
+
+ Action
+ Link
+
-
- Group 2 action
- Group 2 link
-
+
+ Group 2 action
+ Group 2 link
+
-
- Group 3 action
- Group 3 link
-
-
+
+ Group 3 action
+ Group 3 link
+
+
{% endhtmlexample %}
### With item descriptions
-To provide users with more context about a `pf-dropdown-item`, pass a short message to `description` slot. As shown in the example below, an item's description will appear below its label.
+To provide users with more context about a `pf-v5-dropdown-item`, pass a short message to `description` slot. As shown in the example below, an item's description will appear below its label.
{% htmlexample %}
-
-
+
+
Action
This is a description
-
-
+
+
Link
This is a very long description that describes the menu item
-
-
+
+
Disabled action
Disabled action description
-
-
+
+
Disabled link
Disabled link description
-
-
+
+
{% endhtmlexample %}
### Dropdown with icon
@@ -132,16 +132,16 @@ To provide users with more context about a `pf-dropdown-item`, pass a short mess
Use the `icon` slot to add an icon.
{% htmlexample %}
-
-
-
+
+
+
User
-
-
-
+
+
+
Lock
-
-
+
+
{% endhtmlexample %}
### Disabled dropdown
@@ -149,10 +149,10 @@ Use the `icon` slot to add an icon.
Use the `disabled` attribute to disable an entire dropdown.
{% htmlexample %}
-
- Action
- Link
-
+
+ Action
+ Link
+
{% endhtmlexample %}
{% endband %}
@@ -196,25 +196,25 @@ Menu items use the [APG's Roving tabindex](https://www.w3.org/WAI/ARIA/apg/pract
{% endband %}
{% renderSlots %}{% endrenderSlots %}
-{% renderSlots for="pf-dropdown-item", level=3, header="Slots on `pf-dropdown-item`" %}{% endrenderSlots %}
-{% renderSlots for="pf-dropdown-group", level=3, header="Slots on `pf-dropdown-group`" %}{% endrenderSlots %}
+{% renderSlots for="pf-v5-dropdown-item", level=3, header="Slots on `pf-v5-dropdown-item`" %}{% endrenderSlots %}
+{% renderSlots for="pf-v5-dropdown-group", level=3, header="Slots on `pf-v5-dropdown-group`" %}{% endrenderSlots %}
{% renderAttributes %}{% endrenderAttributes %}
-{% renderAttributes for="pf-dropdown-item", level=3, header="Slots on `pf-dropdown-item`" %}{% endrenderAttributes %}
-{% renderAttributes for="pf-dropdown-group", level=3, header="Slots on `pf-dropdown-group`" %}{% endrenderAttributes %}
+{% renderAttributes for="pf-v5-dropdown-item", level=3, header="Slots on `pf-v5-dropdown-item`" %}{% endrenderAttributes %}
+{% renderAttributes for="pf-v5-dropdown-group", level=3, header="Slots on `pf-v5-dropdown-group`" %}{% endrenderAttributes %}
{% renderMethods %}{% endrenderMethods %}
-{% renderMethods for="pf-dropdown-item", level=3, header="Slots on `pf-dropdown-item`" %}{% endrenderMethods %}
-{% renderMethods for="pf-dropdown-group", level=3, header="Slots on `pf-dropdown-group`" %}{% endrenderMethods %}
+{% renderMethods for="pf-v5-dropdown-item", level=3, header="Slots on `pf-v5-dropdown-item`" %}{% endrenderMethods %}
+{% renderMethods for="pf-v5-dropdown-group", level=3, header="Slots on `pf-v5-dropdown-group`" %}{% endrenderMethods %}
{% renderEvents %}{% endrenderEvents %}
-{% renderEvents for="pf-dropdown-item", level=3, header="Slots on `pf-dropdown-item`" %}{% endrenderEvents %}
-{% renderEvents for="pf-dropdown-group", level=3, header="Slots on `pf-dropdown-group`" %}{% endrenderEvents %}
+{% renderEvents for="pf-v5-dropdown-item", level=3, header="Slots on `pf-v5-dropdown-item`" %}{% endrenderEvents %}
+{% renderEvents for="pf-v5-dropdown-group", level=3, header="Slots on `pf-v5-dropdown-group`" %}{% endrenderEvents %}
{% renderCssCustomProperties %}{% endrenderCssCustomProperties %}
-{% renderCssCustomProperties for="pf-dropdown-item", level=3, header="CSS Properties on `pf-dropdown-item`" %}{% endrenderCssCustomProperties %}
-{% renderCssCustomProperties for="pf-dropdown-group", level=3, header="CSS Properties on `pf-dropdown-group`" %}{% endrenderCssCustomProperties %}
+{% renderCssCustomProperties for="pf-v5-dropdown-item", level=3, header="CSS Properties on `pf-v5-dropdown-item`" %}{% endrenderCssCustomProperties %}
+{% renderCssCustomProperties for="pf-v5-dropdown-group", level=3, header="CSS Properties on `pf-v5-dropdown-group`" %}{% endrenderCssCustomProperties %}
{% renderCssParts %}{% endrenderCssParts %}
-{% renderCssParts for="pf-dropdown-item", level=3, header="Parts on `pf-dropdown-item`" %}{% endrenderCssParts %}
-{% renderCssParts for="pf-dropdown-group", level=3, header="Parts on `pf-dropdown-group`" %}{% endrenderCssParts %}
+{% renderCssParts for="pf-v5-dropdown-item", level=3, header="Parts on `pf-v5-dropdown-item`" %}{% endrenderCssParts %}
+{% renderCssParts for="pf-v5-dropdown-group", level=3, header="Parts on `pf-v5-dropdown-group`" %}{% endrenderCssParts %}
diff --git a/elements/pf-dropdown/docs/screenshot.png b/elements/pf-v5-dropdown/docs/screenshot.png
similarity index 100%
rename from elements/pf-dropdown/docs/screenshot.png
rename to elements/pf-v5-dropdown/docs/screenshot.png
diff --git a/elements/pf-dropdown/pf-dropdown-group.css b/elements/pf-v5-dropdown/pf-v5-dropdown-group.css
similarity index 71%
rename from elements/pf-dropdown/pf-dropdown-group.css
rename to elements/pf-v5-dropdown/pf-v5-dropdown-group.css
index 2b45ab5bc3..5bffd9b9e2 100644
--- a/elements/pf-dropdown/pf-dropdown-group.css
+++ b/elements/pf-v5-dropdown/pf-v5-dropdown-group.css
@@ -22,14 +22,14 @@ p {
::slotted(hr) {
margin: 0;
- border-color: var(--pf-c-divider--BackgroundColor, var(--pf-global--BorderColor--100, #d2d2d2));
+ border-color: var(--pf-v5-c-divider--BackgroundColor, var(--pf-global--BorderColor--100, #d2d2d2));
border-style: solid;
}
::slotted([role="separator"]:not(hr)) {
width: 100%;
height: 1px;
- background-color: var(--pf-c-divider--BackgroundColor, var(--pf-global--BorderColor--100, #d2d2d2));
+ background-color: var(--pf-v5-c-divider--BackgroundColor, var(--pf-global--BorderColor--100, #d2d2d2));
padding: 0px;
margin: 0px;
border: 0;
diff --git a/elements/pf-dropdown/pf-dropdown-group.ts b/elements/pf-v5-dropdown/pf-v5-dropdown-group.ts
similarity index 81%
rename from elements/pf-dropdown/pf-dropdown-group.ts
rename to elements/pf-v5-dropdown/pf-v5-dropdown-group.ts
index cabe98d10a..65fb2aee4f 100644
--- a/elements/pf-dropdown/pf-dropdown-group.ts
+++ b/elements/pf-v5-dropdown/pf-v5-dropdown-group.ts
@@ -2,15 +2,15 @@ import { LitElement, html, type TemplateResult } from 'lit';
import { customElement } from 'lit/decorators/custom-element.js';
import { property } from 'lit/decorators/property.js';
-import styles from './pf-dropdown-group.css';
+import styles from './pf-v5-dropdown-group.css';
/**
* Represents a group of items for a dropdown component.
* @slot
* Content for the group of dropdown items
*/
-@customElement('pf-dropdown-group')
-export class PfDropdownGroup extends LitElement {
+@customElement('pf-v5-dropdown-group')
+export class PfV5DropdownGroup extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
static override readonly shadowRootOptions: ShadowRootInit = {
@@ -33,6 +33,6 @@ export class PfDropdownGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-dropdown-group': PfDropdownGroup;
+ 'pf-v5-dropdown-group': PfV5DropdownGroup;
}
}
diff --git a/elements/pf-dropdown/pf-dropdown-item.css b/elements/pf-v5-dropdown/pf-v5-dropdown-item.css
similarity index 68%
rename from elements/pf-dropdown/pf-dropdown-item.css
rename to elements/pf-v5-dropdown/pf-v5-dropdown-item.css
index 5dfb664158..32b9958c81 100644
--- a/elements/pf-dropdown/pf-dropdown-item.css
+++ b/elements/pf-v5-dropdown/pf-v5-dropdown-item.css
@@ -7,31 +7,31 @@
cursor: pointer;
/** Dropdown item font size */
font-size: var(
- --pf-c-dropdown__menu-item--FontSize,
+ --pf-v5-c-dropdown__menu-item--FontSize,
var(--pf-global--FontSize--md, 1rem)
);
/** Dropdown item font weight */
font-weight: var(
- --pf-c-dropdown__menu-item--FontWeight,
+ --pf-v5-c-dropdown__menu-item--FontWeight,
var(--pf-global--FontWeight--normal, 400)
);
/** Dropdown item line height */
line-height: var(
- --pf-c-dropdown__menu-item--LineHeight,
+ --pf-v5-c-dropdown__menu-item--LineHeight,
var(--pf-global--LineHeight--md, 1.5)
);
/** Dropdown item color */
color: var(
- --pf-c-dropdown__menu-item--Color,
+ --pf-v5-c-dropdown__menu-item--Color,
var(--pf-global--Color--dark-100, #151515)
);
/** Dropdown item background color */
background-color: var(
- --pf-c-dropdown__menu-item--BackgroundColor,
+ --pf-v5-c-dropdown__menu-item--BackgroundColor,
transparent
);
border: 3px solid var(
- --pf-c-dropdown__menu-item--BackgroundColor,
+ --pf-v5-c-dropdown__menu-item--BackgroundColor,
transparent
);
}
@@ -46,23 +46,23 @@
&, & a {
cursor: not-allowed;
}
- --pf-c-dropdown__menu-item--Color: var(
- --pf-c-dropdown__menu-item--disabled--Color,
+ --pf-v5-c-dropdown__menu-item--Color: var(
+ --pf-v5-c-dropdown__menu-item--disabled--Color,
var(--pf-global--Color--dark-200, #6a6e73)
);
- --pf-c-dropdown__menu-item--BackgroundColor: var(
- --pf-c-dropdown__menu-item--disabled--BackgroundColor,
+ --pf-v5-c-dropdown__menu-item--BackgroundColor: var(
+ --pf-v5-c-dropdown__menu-item--disabled--BackgroundColor,
transparent
);
}
:host(:hover) {
- --pf-c-dropdown__menu-item--Color: var(
- --pf-c-dropdown__menu-item--hover--Color,
+ --pf-v5-c-dropdown__menu-item--Color: var(
+ --pf-v5-c-dropdown__menu-item--hover--Color,
var(--pf-global--Color--dark-100, #151515)
);
- --pf-c-dropdown__menu-item--BackgroundColor: var(
- --pf-c-dropdown__menu-item--hover--BackgroundColor,
+ --pf-v5-c-dropdown__menu-item--BackgroundColor: var(
+ --pf-v5-c-dropdown__menu-item--hover--BackgroundColor,
var(--pf-global--BackgroundColor--light-300, #f0f0f0)
);
text-decoration: none;
@@ -81,22 +81,22 @@
/** Dropdown item padding */
padding: var(
/** Dropdown item padding top */
- --pf-c-dropdown__menu-item--PaddingTop,
+ --pf-v5-c-dropdown__menu-item--PaddingTop,
var(--pf-global--spacer--sm, 0.5rem)
)
var(
/** Dropdown item padding right */
- --pf-c-dropdown__menu-item--PaddingRight,
+ --pf-v5-c-dropdown__menu-item--PaddingRight,
var(--pf-global--spacer--md, 1rem)
)
var(
/** Dropdown item padding bottom */
- --pf-c-dropdown__menu-item--PaddingBottom,
+ --pf-v5-c-dropdown__menu-item--PaddingBottom,
var(--pf-global--spacer--sm, 0.5rem)
)
var(
/** Dropdown item padding left */
- --pf-c-dropdown__menu-item--PaddingLeft,
+ --pf-v5-c-dropdown__menu-item--PaddingLeft,
var(--pf-global--spacer--md, 1rem)
);
}
@@ -123,12 +123,12 @@
display: block;
flex: 1 0 100%;
font-size: var(
- --pf-c-dropdown__menu-item-description--FontSize, var(
+ --pf-v5-c-dropdown__menu-item-description--FontSize, var(
--pf-global--FontSize--sm, 0.75rem
)
);
color: var(
- --pf-c-dropdown__menu-item-description--Color, var(
+ --pf-v5-c-dropdown__menu-item-description--Color, var(
--pf-global--Color--dark-200, #6a6e73
)
);
@@ -137,7 +137,7 @@
a {
color: var(
- --pf-c-dropdown__menu-item--Color,
+ --pf-v5-c-dropdown__menu-item--Color,
var(--pf-global--Color--dark-100, #151515)
) !important;
text-decoration: none !important;
diff --git a/elements/pf-dropdown/pf-dropdown-item.ts b/elements/pf-v5-dropdown/pf-v5-dropdown-item.ts
similarity index 90%
rename from elements/pf-dropdown/pf-dropdown-item.ts
rename to elements/pf-v5-dropdown/pf-v5-dropdown-item.ts
index 29a6dcecee..5832b44844 100644
--- a/elements/pf-dropdown/pf-dropdown-item.ts
+++ b/elements/pf-v5-dropdown/pf-v5-dropdown-item.ts
@@ -5,9 +5,9 @@ import { classMap } from 'lit/directives/class-map.js';
import { query } from 'lit/decorators/query.js';
import { consume } from '@lit/context';
-import { context, type PfDropdownContext } from './context.js';
+import { context, type PfV5DropdownContext } from './context.js';
-import styles from './pf-dropdown-item.css';
+import styles from './pf-v5-dropdown-item.css';
export class DropdownItemChange extends Event {
constructor() {
@@ -24,8 +24,8 @@ export class DropdownItemChange extends Event {
* @slot -
* Content for the dropdown item
*/
-@customElement('pf-dropdown-item')
-export class PfDropdownItem extends LitElement {
+@customElement('pf-v5-dropdown-item')
+export class PfV5DropdownItem extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
static override readonly shadowRootOptions: ShadowRootInit = {
@@ -60,7 +60,7 @@ export class PfDropdownItem extends LitElement {
@consume({ context, subscribe: true })
@property({ attribute: false })
- private ctx?: PfDropdownContext;
+ private ctx?: PfV5DropdownContext;
/** @internal */
@query('#item') menuItem!: HTMLElement;
@@ -92,6 +92,6 @@ export class PfDropdownItem extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-dropdown-item': PfDropdownItem;
+ 'pf-v5-dropdown-item': PfV5DropdownItem;
}
}
diff --git a/elements/pf-v5-dropdown/pf-v5-dropdown-menu.css b/elements/pf-v5-dropdown/pf-v5-dropdown-menu.css
new file mode 100644
index 0000000000..5241320477
--- /dev/null
+++ b/elements/pf-v5-dropdown/pf-v5-dropdown-menu.css
@@ -0,0 +1,37 @@
+:host {
+ background: var(--pf-v5-c-dropdown__menu--BackgroundColor, #fff);
+}
+
+.disabled {
+ --pf-v5-c-dropdown__menu-item--Color: var(
+ --pf-v5-c-dropdown__menu-item--disabled--Color,
+ var(--pf-global--Color--dark-200, #6a6e73)
+ ) !important;
+ --pf-v5-c-dropdown__menu-item--BackgroundColor: var(
+ --pf-v5-c-dropdown__menu-item--disabled--BackgroundColor,
+ transparent
+ ) !important;
+}
+
+:host([hidden]),
+[hidden] {
+ display: none !important;
+}
+
+::slotted(hr) {
+ margin: 0;
+ border-color: var(--pf-v5-c-divider--BackgroundColor, var(--pf-global--BorderColor--100, #d2d2d2));
+ border-style: solid;
+}
+
+::slotted([role="separator"]:not(hr)) {
+ width: 100%;
+ height: 1px;
+ background-color: var(--pf-v5-c-divider--BackgroundColor, var(--pf-global--BorderColor--100, #d2d2d2));
+ padding: 0px;
+ margin: 0px;
+ border: 0;
+ display: block;
+ pointer-events: none;
+}
+
diff --git a/elements/pf-dropdown/pf-dropdown-menu.ts b/elements/pf-v5-dropdown/pf-v5-dropdown-menu.ts
similarity index 77%
rename from elements/pf-dropdown/pf-dropdown-menu.ts
rename to elements/pf-v5-dropdown/pf-v5-dropdown-menu.ts
index 36a3390040..c41721c7cc 100644
--- a/elements/pf-dropdown/pf-dropdown-menu.ts
+++ b/elements/pf-v5-dropdown/pf-v5-dropdown-menu.ts
@@ -2,30 +2,30 @@ import { LitElement, html, type TemplateResult } from 'lit';
import { customElement } from 'lit/decorators/custom-element.js';
import { consume } from '@lit/context';
import { state } from 'lit/decorators/state.js';
-import { context, type PfDropdownContext } from './context.js';
+import { context, type PfV5DropdownContext } from './context.js';
import { RovingTabindexController } from '@patternfly/pfe-core/controllers/roving-tabindex-controller.js';
import { InternalsController } from '@patternfly/pfe-core/controllers/internals-controller.js';
-import { PfDropdownItem, DropdownItemChange } from './pf-dropdown-item.js';
-import { PfDropdownGroup } from './pf-dropdown-group.js';
+import { PfV5DropdownItem, DropdownItemChange } from './pf-v5-dropdown-item.js';
+import { PfV5DropdownGroup } from './pf-v5-dropdown-group.js';
-import styles from './pf-dropdown-menu.css';
+import styles from './pf-v5-dropdown-menu.css';
import { classMap } from 'lit/directives/class-map.js';
function isDisabledItemClick(event: MouseEvent) {
- const item: PfDropdownItem | undefined =
- event.composedPath().find((x): x is PfDropdownItem => x instanceof PfDropdownItem);
+ const item: PfV5DropdownItem | undefined =
+ event.composedPath().find((x): x is PfV5DropdownItem => x instanceof PfV5DropdownItem);
return !!item?.disabled;
}
/**
* A **dropdown** presents a menu of actions or links in a constrained space that will trigger a
* process or navigate to a new location.
- * @slot - Must contain one or more `` or ``
+ * @slot - Must contain one or more `` or ``
*/
-@customElement('pf-dropdown-menu')
-export class PfDropdownMenu extends LitElement {
+@customElement('pf-v5-dropdown-menu')
+export class PfV5DropdownMenu extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
static override readonly shadowRootOptions: ShadowRootInit = {
@@ -35,7 +35,7 @@ export class PfDropdownMenu extends LitElement {
@consume({ context, subscribe: true })
@state()
- private ctx?: PfDropdownContext;
+ private ctx?: PfV5DropdownContext;
#internals = InternalsController.of(this, { role: 'menu' });
@@ -63,7 +63,7 @@ export class PfDropdownMenu extends LitElement {
return this.#tabindex.atFocusedItemIndex;
}
- get items(): PfDropdownItem[] {
+ get items(): PfV5DropdownItem[] {
return this.#getSlottedItems(this.shadowRoot?.querySelector('slot'));
}
@@ -112,7 +112,7 @@ export class PfDropdownMenu extends LitElement {
if (this.ctx?.disabled) {
event.preventDefault();
event.stopPropagation();
- } else if (event.target instanceof PfDropdownItem) {
+ } else if (event.target instanceof PfV5DropdownItem) {
this.#focusItem(event.target.menuItem);
}
}
@@ -127,7 +127,7 @@ export class PfDropdownMenu extends LitElement {
if (this.ctx?.disabled || isDisabledItemClick(event)) {
event.preventDefault();
event.stopPropagation();
- } else if (event.target instanceof PfDropdownItem) {
+ } else if (event.target instanceof PfV5DropdownItem) {
this.#focusItem(event.target.menuItem);
}
}
@@ -139,16 +139,16 @@ export class PfDropdownMenu extends LitElement {
}
}
- #getSlottedItems(slot?: HTMLSlotElement | null): PfDropdownItem[] {
+ #getSlottedItems(slot?: HTMLSlotElement | null): PfV5DropdownItem[] {
return slot
?.assignedElements()
.flatMap(element => {
if (element instanceof HTMLSlotElement) {
return this.#getSlottedItems(element);
- } else if (element instanceof PfDropdownItem) {
+ } else if (element instanceof PfV5DropdownItem) {
return [element];
- } else if (element instanceof PfDropdownGroup) {
- return Array.from(element.querySelectorAll('pf-dropdown-item'));
+ } else if (element instanceof PfV5DropdownGroup) {
+ return Array.from(element.querySelectorAll('pf-v5-dropdown-item'));
} else {
return [];
}
@@ -158,6 +158,6 @@ export class PfDropdownMenu extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-dropdown-menu': PfDropdownMenu;
+ 'pf-v5-dropdown-menu': PfV5DropdownMenu;
}
}
diff --git a/elements/pf-v5-dropdown/pf-v5-dropdown.css b/elements/pf-v5-dropdown/pf-v5-dropdown.css
new file mode 100644
index 0000000000..44a743ba33
--- /dev/null
+++ b/elements/pf-v5-dropdown/pf-v5-dropdown.css
@@ -0,0 +1,351 @@
+:host {
+ display: inline-block;
+ position: relative;
+ --pf-v5-c-dropdown__toggle--PaddingTop: var(--pf-global--spacer--form-element, 0.375rem);
+ --pf-v5-c-dropdown__toggle--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle--PaddingBottom: var(--pf-global--spacer--form-element, 0.375rem);
+ --pf-v5-c-dropdown__toggle--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle--MinWidth: 0;
+ --pf-v5-c-dropdown__toggle--FontSize: var(--pf-global--FontSize--md, 1rem);
+ --pf-v5-c-dropdown__toggle--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ --pf-v5-c-dropdown__toggle--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-dropdown__toggle--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+ --pf-v5-c-dropdown__toggle--BackgroundColor: transparent;
+ --pf-v5-c-dropdown__toggle--before--BorderWidth: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-dropdown__toggle--before--BorderTopColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-dropdown__toggle--before--BorderRightColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-dropdown__toggle--before--BorderBottomColor: var(--pf-global--BorderColor--200, #8a8d90);
+ --pf-v5-c-dropdown__toggle--before--BorderLeftColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-dropdown__toggle--hover--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--focus--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--focus--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--active--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--active--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-dropdown--m-expanded__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown--m-expanded__toggle--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--disabled--BackgroundColor: var(--pf-global--disabled-color--300, #f0f0f0);
+ --pf-v5-c-dropdown__toggle--m-plain--Color: var(--pf-global--Color--200, #6a6e73);
+ --pf-v5-c-dropdown__toggle--m-plain--hover--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-dropdown__toggle--m-plain--disabled--Color: var(--pf-global--disabled-color--200, #d2d2d2);
+ --pf-v5-c-dropdown__toggle--m-plain--PaddingRight: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-dropdown__toggle--m-plain--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-dropdown__toggle--m-plain--child--LineHeight: normal;
+ --pf-v5-c-dropdown__toggle--m-primary--Color: var(--pf-global--Color--light-100, #fff);
+ --pf-v5-c-dropdown__toggle--m-primary--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
+ --pf-v5-c-dropdown__toggle--m-primary--BackgroundColor: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--m-primary--hover--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown__toggle--m-primary--focus--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown__toggle--m-primary--active--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown--m-expanded__toggle--m-primary--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown__toggle--m-primary--disabled--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-dropdown__toggle--m-secondary--Color: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--m-secondary--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
+ --pf-v5-c-dropdown__toggle--m-secondary--BackgroundColor: transparent;
+ --pf-v5-c-dropdown__toggle--m-secondary--before--BorderWidth: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-dropdown__toggle--m-secondary--hover--before--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--focus--before--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--active--before--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--before--BorderColor: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--m-secondary--hover--before--BorderColor: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--m-secondary--focus--before--BorderColor: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--m-secondary--active--before--BorderColor: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown--m-expanded__toggle--m-secondary--before--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown--m-expanded__toggle--m-secondary--before--BorderColor: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle-button--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-dropdown__toggle-progress--Visibility: hidden;
+ --pf-v5-c-dropdown__toggle-progress--c-spinner--diameter: var(--pf-global--FontSize--sm, 0.875rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--child--PaddingTop: var(--pf-global--spacer--form-element, 0.375rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--child--PaddingRight: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--child--PaddingBottom: var(--pf-global--spacer--form-element, 0.375rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--child--PaddingLeft: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--child--BackgroundColor: transparent;
+ --pf-v5-c-dropdown__toggle--m-split-button--first-child--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--last-child--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-action--child--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-action--child--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-action__toggle-button--MarginRight: calc(-1 * var(--pf-global--BorderWidth--sm, 1px));
+ --pf-v5-c-dropdown__toggle--m-split-button__toggle-check__input--TranslateY: -0.0625rem;
+ --pf-v5-c-dropdown__toggle--m-split-button__toggle-text--MarginLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle--m-split-button--child--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--BorderRadius: var(--pf-v5-c-dropdown__toggle--m-split-button--child--BorderRadius);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--BackgroundColor: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--hover--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--focus--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--active--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-primary--child--m-expanded--BackgroundColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-primary--m-action--child--BorderLeftColor: var(--pf-global--primary-color--200, #004080);
+ --pf-v5-c-dropdown__toggle--m-split-button--m-primary--m-action--child--BorderLeftWidth: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-dropdown--m-expanded__toggle--m-secondary--m-split-button--child--before--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--Color: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--hover--before--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--focus--before--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--active--before--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderWidth--base: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderColor--base: var(--pf-global--primary-color--100, #06c);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderColor: var(--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderColor--base);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderWidth: var(--pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--BorderWidth--base);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--hover--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--focus--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle--m-secondary--m-split-button--child--before--active--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-dropdown__toggle-icon--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+ --pf-v5-c-dropdown__toggle-icon--MarginRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle-icon--MarginLeft: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-dropdown--m-top--m-expanded__toggle-icon--Rotate: 180deg;
+ --pf-v5-c-dropdown--m-plain__toggle-icon--Color: var(--pf-global--Color--200, #6a6e73);
+ --pf-v5-c-dropdown--m-plain--hover__toggle-icon--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-dropdown__menu--BackgroundColor: var(--pf-global--BackgroundColor--light-100, #fff);
+ /** Dropdown box shadow */
+ --pf-v5-c-dropdown__menu--BoxShadow: var(--pf-global--BoxShadow--md, 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06));
+ /** Dropdown top padding */
+ --pf-v5-c-dropdown__menu--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__menu--PaddingBottom: var(--pf-global--spacer--sm, 0.5rem);
+ /** Dropdown top position */
+ --pf-v5-c-dropdown__menu--Top: calc(100% + var(--pf-global--spacer--xs, 0.25rem));
+ /** Dropdown z-index */
+ --pf-v5-c-dropdown__menu--ZIndex: var(--pf-global--ZIndex--sm, 200);
+ --pf-v5-c-dropdown--m-top__menu--Top: 0;
+ --pf-v5-c-dropdown--m-top__menu--TranslateY: calc(-100% - var(--pf-global--spacer--xs, 0.25rem));
+ --pf-v5-c-dropdown__menu-item--BackgroundColor: transparent;
+ --pf-v5-c-dropdown__menu-item--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ /** Dropdown menu item right padding */
+ --pf-v5-c-dropdown__menu-item--PaddingRight: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-dropdown__menu-item--PaddingBottom: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__menu-item--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-dropdown__menu-item--FontSize: var(--pf-global--FontSize--md, 1rem);
+ --pf-v5-c-dropdown__menu-item--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ --pf-v5-c-dropdown__menu-item--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+ --pf-v5-c-dropdown__menu-item--Color: var(--pf-global--Color--dark-100, #151515);
+ --pf-v5-c-dropdown__menu-item--hover--Color: var(--pf-global--Color--dark-100, #151515);
+ --pf-v5-c-dropdown__menu-item--disabled--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ --pf-v5-c-dropdown__menu-item--hover--BackgroundColor: var(--pf-global--BackgroundColor--light-300, #f0f0f0);
+ --pf-v5-c-dropdown__menu-item--disabled--BackgroundColor: transparent;
+ --pf-v5-c-dropdown__menu-item--m-text--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ --pf-v5-c-dropdown__menu-item-icon--MarginRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__menu-item-icon--Width: var(--pf-global--icon--FontSize--lg, 1.5rem);
+ --pf-v5-c-dropdown__menu-item-icon--Height: var(--pf-global--icon--FontSize--lg, 1.5rem);
+ --pf-v5-c-dropdown__menu-item-description--FontSize: var(--pf-global--FontSize--xs, 0.75rem);
+ --pf-v5-c-dropdown__menu-item-description--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ --pf-v5-c-dropdown__group--group--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__group-title--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__group-title--PaddingRight: var(--pf-v5-c-dropdown__menu-item--PaddingRight);
+ --pf-v5-c-dropdown__group-title--PaddingBottom: var(--pf-v5-c-dropdown__menu-item--PaddingBottom);
+ --pf-v5-c-dropdown__group-title--PaddingLeft: var(--pf-v5-c-dropdown__menu-item--PaddingLeft);
+ --pf-v5-c-dropdown__group-title--FontSize: var(--pf-global--FontSize--xs, 0.75rem);
+ --pf-v5-c-dropdown__group-title--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ --pf-v5-c-dropdown__group-title--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ --pf-v5-c-dropdown__toggle-image--MarginTop: 0;
+ --pf-v5-c-dropdown__toggle-image--MarginBottom: 0;
+ --pf-v5-c-dropdown__toggle-image--MarginRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown--c-divider--MarginTop: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown--c-divider--MarginBottom: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-dropdown__toggle--c-badge__toggle-icon--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-dropdown__toggle--c-badge__toggle-icon--MarginRight: 0;
+ --pf-v5-c-dropdown--c-menu--Top: calc(100% + var(--pf-global--spacer--xs, 0.25rem));
+ --pf-v5-c-dropdown--c-menu--ZIndex: var(--pf-global--ZIndex--sm, 200);
+ --pf-v5-c-dropdown--m-top--c-menu--Top: 0;
+ --pf-v5-c-dropdown--m-top--c-menu--TranslateY: calc(-100% - var(--pf-global--spacer--xs, 0.25rem));
+ --pf-v5-c-dropdown--m-full-height__toggle--before--BorderTopWidth: 0;
+ --pf-v5-c-dropdown--m-full-height__toggle--expanded--before--BorderBottomWidth: var(--pf-global--BorderWidth--xl, 4px);
+ --pf-v5-c-dropdown--m-full-height__toggle--hover--before--BorderBottomWidth: var(--pf-global--BorderWidth--xl, 4px);
+ --pf-v5-c-dropdown--m-full-height__toggle--active--before--BorderBottomWidth: var(--pf-global--BorderWidth--xl, 4px);
+ --pf-v5-c-dropdown--m-full-height__toggle--focus--before--BorderBottomWidth: var(--pf-global--BorderWidth--xl, 4px);
+ --pf-v5-c-dropdown--m-full-height__toggle--PaddingRight: var(--pf-global--spacer--lg, 1.5rem);
+ --pf-v5-c-dropdown--m-full-height__toggle--PaddingLeft: var(--pf-global--spacer--lg, 1.5rem);
+ --_font-size: var(
+ --pf-v5-c-dropdown__menu-item--FontSize,
+ var(--pf-global--FontSize--md, 1rem)
+ );
+ --_font-weight: var(
+ --pf-v5-c-dropdown__menu-item--FontWeight,
+ var(--pf-global--FontWeight--normal, 400)
+ );
+ --_line-height: var(
+ --pf-v5-c-dropdown__menu-item--LineHeight,
+ var(--pf-global--LineHeight--md, 1.5)
+ );
+ --_color: var(
+ --pf-v5-c-dropdown__menu-item--Color,
+ var(--pf-global--Color--dark-100, #151515)
+ );
+ --_background-color: var(
+ --pf-v5-c-dropdown__menu-item--BackgroundColor,
+ transparent
+ );
+}
+
+:host([disabled]) {
+ color: var(--pf-global--Color--dark-200, #6a6e73);
+}
+
+:host([hidden]),
+[hidden] {
+ display: none !important;
+}
+
+slot[name="toggle"] {
+ cursor: pointer;
+}
+
+pf-v5-button#default-toggle,
+::slotted([slot="toggle"]) {
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ min-width: var(--pf-v5-c-dropdown__toggle--MinWidth);
+ max-width: 100%;
+ padding:
+ var(--pf-v5-c-dropdown__toggle--PaddingTop)
+ var(--pf-v5-c-dropdown__toggle--PaddingRight)
+ var(--pf-v5-c-dropdown__toggle--PaddingBottom)
+ var(--pf-v5-c-dropdown__toggle--PaddingLeft);
+ font-size: var(--pf-v5-c-dropdown__toggle--FontSize);
+ font-weight: var(--pf-v5-c-dropdown__toggle--FontWeight);
+ line-height: var(--pf-v5-c-dropdown__toggle--LineHeight);
+ color: var(--pf-v5-c-dropdown__toggle--Color);
+ background-color: var(--pf-v5-c-dropdown__toggle--BackgroundColor);
+ border: none;
+}
+
+pf-v5-dropdown-menu,
+::slotted(pf-v5-dropdown-menu) {
+ position: absolute !important;
+ top: var(
+ --pf-v5-c-dropdown__menu--Top,
+ calc(100% + var(--pf-global--spacer--xs, 0.25rem))
+ ) !important;
+ left: var(
+ --pf-v5-c-dropdown__menu--Left,
+ 0
+ ) !important;
+ right: var(
+ --pf-v5-c-dropdown__menu--Right,
+ auto
+ ) !important;
+ z-index: var(
+ --pf-v5-c-dropdown__menu--ZIndex,
+ var(--pf-global--ZIndex--sm, 200)
+ ) !important;
+ padding-top: var(
+ --pf-v5-c-dropdown__menu--PaddingTop,
+ var(--pf-global--spacer--sm, 0.5rem)
+ ) !important;
+ padding-bottom: var(
+ --pf-v5-c-dropdown__menu--PaddingBottom,
+ var(--pf-global--spacer--sm, 0.5rem)
+ ) !important;
+ background: var(--pf-v5-c-dropdown__menu--BackgroundColor, #fff) !important;
+ background-clip: padding-box !important;
+ box-shadow: var(
+ --pf-v5-c-dropdown__menu--BoxShadow,
+ var(
+ --pf-global--BoxShadow--md,
+ 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12),
+ 0 0 0.25rem 0 rgba(3, 3, 3, 0.06)
+ )
+ ) !important;
+ min-width: 100% !important;
+ margin: 0 !important;
+}
+
+pf-v5-button svg {
+ width: 1em;
+ height: 1em;
+ flex: 0 0 auto;
+ margin-inline-start: 1em;
+}
+
+::slotted(hr) {
+ margin: 0;
+ border-color: var(--pf-v5-c-divider--BackgroundColor, var(--pf-global--BorderColor--100, #d2d2d2));
+ border-style: solid;
+}
+
+::slotted([role="separator"]:not(hr)) {
+ width: 100%;
+ height: 1px;
+ background-color: var(--pf-v5-c-divider--BackgroundColor, var(--pf-global--BorderColor--100, #d2d2d2));
+ padding: 0px;
+ margin: 0px;
+ border: 0;
+ display: block;
+}
+
+.disabled {
+ & pf-v5-dropdown-menu,
+ & ::slotted(pf-v5-dropdown-menu) {
+ background-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ cursor: not-allowed !important;
+ }
+ & pf-v5-button#default-toggle,
+ & ::slotted([slot="toggle"]) {
+ --pf-v5-c-button--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--after--BorderColor: var(--pf-v5-c-button--disabled--after--BorderColor);
+
+ --pf-v5-c-button--m-primary--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-primary--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+
+ --pf-v5-c-button--m-secondary--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-secondary--focus--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-secondary--hover--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-secondary--active--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-secondary--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-secondary--after--BorderColor: transparent;
+ --pf-v5-c-button--m-secondary--hover--after--BorderColor: transparent;
+ --pf-v5-c-button--m-secondary--focus--after--BorderColor: transparent;
+ --pf-v5-c-button--m-secondary--active--after--BorderColor: transparent;
+ --pf-v5-c-button--m-secondary--focus--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-secondary--hover--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-secondary--active--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-secondary--focus--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+
+ --pf-v5-c-button--m-control--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-control--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-control--focus--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-control--hover--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-control--active--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-control--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-control--after--BorderColor: transparent;
+ --pf-v5-c-button--m-control--hover--after--BorderColor: transparent;
+ --pf-v5-c-button--m-control--focus--after--BorderColor: transparent;
+ --pf-v5-c-button--m-control--active--after--BorderColor: transparent;
+ --pf-v5-c-button--m-control--focus--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-control--hover--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-control--active--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-control--focus--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-control--after--BorderBottomColor: transparent;
+ --pf-v5-c-button--m-control--focus--after--BorderBottomColor: transparent;
+ --pf-v5-c-button--m-control--hover--after--BorderBottomColor: transparent;
+ --pf-v5-c-button--m-control--active--after--BorderBottomColor: transparent;
+
+ --pf-v5-c-button--m-plain--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-plain--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-plain--focus--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-plain--hover--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-plain--active--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-plain--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-plain--after--BorderColor: transparent;
+ --pf-v5-c-button--m-plain--hover--after--BorderColor: transparent;
+ --pf-v5-c-button--m-plain--focus--after--BorderColor: transparent;
+ --pf-v5-c-button--m-plain--active--after--BorderColor: transparent;
+ --pf-v5-c-button--m-plain--focus--Color: var(--pf-v5-c-button--disabled--Color);
+ --pf-v5-c-button--m-plain--hover--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-plain--active--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ --pf-v5-c-button--m-plain--focus--BackgroundColor: var(--pf-v5-c-button--disabled--BackgroundColor);
+ }
+
+ & pf-v5-button:focus,
+ & ::slotted([slot="toggle"]:focus) {
+ outline: 3px solid var(--pf-global--link--Color, #0066cc);
+ }
+}
+
+pf-v5-button#default-toggle,
+::slotted(pf-v5-button[variant="control"]) {
+ --_button-icon-vertical-align: -0.25em;
+ --_button-icon-padding-inline-start: var(--pf-v5-c-dropdown__toggle--PaddingLeft,
+ var(--pf-global--spacer--md, 1rem));
+ --_button-icon-padding-inline-end: var(-pf-v5-c-dropdown__toggle--PaddingRight,
+ var(--pf-global--spacer--sm, 0.5rem));
+}
diff --git a/elements/pf-dropdown/pf-dropdown.ts b/elements/pf-v5-dropdown/pf-v5-dropdown.ts
similarity index 80%
rename from elements/pf-dropdown/pf-dropdown.ts
rename to elements/pf-v5-dropdown/pf-v5-dropdown.ts
index 73ee488079..af58ad54b0 100644
--- a/elements/pf-dropdown/pf-dropdown.ts
+++ b/elements/pf-v5-dropdown/pf-v5-dropdown.ts
@@ -10,16 +10,16 @@ import { FloatingDOMController } from '@patternfly/pfe-core/controllers/floating
import { Logger } from '@patternfly/pfe-core/controllers/logger.js';
import { getRandomId } from '@patternfly/pfe-core/functions/random.js';
-import { context, type PfDropdownContext } from './context.js';
-import { PfDropdownItem } from './pf-dropdown-item.js';
-import { PfDropdownMenu } from './pf-dropdown-menu.js';
+import { context, type PfV5DropdownContext } from './context.js';
+import { PfV5DropdownItem } from './pf-v5-dropdown-item.js';
+import { PfV5DropdownMenu } from './pf-v5-dropdown-menu.js';
-import '@patternfly/elements/pf-button/pf-button.js';
+import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
-import styles from './pf-dropdown.css';
+import styles from './pf-v5-dropdown.css';
-export class PfDropdownSelectEvent extends Event {
+export class PfV5DropdownSelectEvent extends Event {
constructor(
public originalEvent: Event | KeyboardEvent,
public value: string
@@ -32,12 +32,12 @@ export class PfDropdownSelectEvent extends Event {
* A **dropdown** presents a menu of actions or links in a constrained space that
* will trigger a process or navigate to a new location.
* @alias Dropdown
- * @fires {PfDropdownSelectEvent} select - when a user select dropdown value
+ * @fires {PfV5DropdownSelectEvent} select - when a user select dropdown value
* @fires open - when the dropdown toggles open
* @fires close - when the dropdown toggles closed
*/
-@customElement('pf-dropdown')
-export class PfDropdown extends LitElement {
+@customElement('pf-v5-dropdown')
+export class PfV5Dropdown extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
static override readonly shadowRootOptions: ShadowRootInit = {
@@ -61,7 +61,7 @@ export class PfDropdown extends LitElement {
@queryAssignedElements({ slot: 'menu', flatten: true })
private _menuElements!: HTMLElement[];
- @provide({ context }) private ctx: PfDropdownContext = { disabled: false };
+ @provide({ context }) private ctx: PfV5DropdownContext = { disabled: false };
#logger = new Logger(this);
@@ -99,22 +99,22 @@ export class PfDropdown extends LitElement {
this.toggle()}">
-
+
Dropdown
-
-
+
+
-
+
-
+
`;
}
@@ -169,7 +169,7 @@ export class PfDropdown extends LitElement {
this.dispatchEvent(new Event(will));
if (this.expanded) {
await this.#float.show();
- if (menu instanceof PfDropdownMenu) {
+ if (menu instanceof PfV5DropdownMenu) {
menu.activeItem?.focus();
}
} else {
@@ -184,11 +184,11 @@ export class PfDropdown extends LitElement {
}
}
- #onSelect(event: KeyboardEvent | Event & { target: PfDropdownItem }) {
+ #onSelect(event: KeyboardEvent | Event & { target: PfV5DropdownItem }) {
const [menu] = this._menuElements;
- if (menu instanceof PfDropdownMenu) {
- const target = event.target as PfDropdownItem || menu.activeItem;
- this.dispatchEvent(new PfDropdownSelectEvent(event, `${target?.value}`));
+ if (menu instanceof PfV5DropdownMenu) {
+ const target = event.target as PfV5DropdownItem || menu.activeItem;
+ this.dispatchEvent(new PfV5DropdownSelectEvent(event, `${target?.value}`));
this.hide();
}
}
@@ -207,8 +207,8 @@ export class PfDropdown extends LitElement {
const [menu] = this._menuElements;
if (root instanceof ShadowRoot
|| root instanceof Document
- && event.relatedTarget instanceof PfDropdownItem
- && menu instanceof PfDropdownMenu
+ && event.relatedTarget instanceof PfV5DropdownItem
+ && menu instanceof PfV5DropdownMenu
&& !menu.items.includes(event.relatedTarget)
) {
this.hide();
@@ -253,6 +253,6 @@ export class PfDropdown extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-dropdown': PfDropdown;
+ 'pf-v5-dropdown': PfV5Dropdown;
}
}
diff --git a/elements/pf-dropdown/test/pf-dropdown.e2e.ts b/elements/pf-v5-dropdown/test/pf-dropdown.e2e.ts
similarity index 95%
rename from elements/pf-dropdown/test/pf-dropdown.e2e.ts
rename to elements/pf-v5-dropdown/test/pf-dropdown.e2e.ts
index 97435b0d68..4d2d41ef9b 100644
--- a/elements/pf-dropdown/test/pf-dropdown.e2e.ts
+++ b/elements/pf-v5-dropdown/test/pf-dropdown.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-dropdown';
+const tagName = 'pf-v5-dropdown';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-dropdown/test/pf-dropdown.spec.ts b/elements/pf-v5-dropdown/test/pf-dropdown.spec.ts
similarity index 87%
rename from elements/pf-dropdown/test/pf-dropdown.spec.ts
rename to elements/pf-v5-dropdown/test/pf-dropdown.spec.ts
index 39aac0b05e..9d7c9ffbdf 100644
--- a/elements/pf-dropdown/test/pf-dropdown.spec.ts
+++ b/elements/pf-v5-dropdown/test/pf-dropdown.spec.ts
@@ -2,7 +2,7 @@ import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { sendKeys, resetMouse } from '@web/test-runner-commands';
import { clickElementAtCenter } from '@patternfly/pfe-tools/test/utils.js';
-import { PfDropdown } from '@patternfly/elements/pf-dropdown/pf-dropdown.js';
+import { PfV5Dropdown } from '@patternfly/elements/pf-v5-dropdown/pf-v5-dropdown.js';
import { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
function press(key: string) {
@@ -11,33 +11,33 @@ function press(key: string) {
};
}
-describe('', function() {
- let element: PfDropdown;
+describe('', function() {
+ let element: PfV5Dropdown;
const updateComplete = () => element.updateComplete;
describe('simply instantiating', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-dropdown')).to.be.an.instanceof(PfDropdown);
+ expect(document.createElement('pf-v5-dropdown')).to.be.an.instanceof(PfV5Dropdown);
});
it('should upgrade', async function() {
- element = await createFixture(html` `);
- const klass = customElements.get('pf-dropdown');
+ element = await createFixture(html` `);
+ const klass = customElements.get('pf-v5-dropdown');
expect(element)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfDropdown);
+ .to.be.an.instanceOf(PfV5Dropdown);
});
});
describe('with default toggle button', function() {
beforeEach(async function() {
- element = await createFixture(html`
-
- item 1
- item 2
-
+ element = await createFixture(html`
+
+ item 1
+ item 2
+
`);
});
diff --git a/elements/pf-v5-helper-text/demo/dynamic-list.html b/elements/pf-v5-helper-text/demo/dynamic-list.html
new file mode 100644
index 0000000000..cd883df086
--- /dev/null
+++ b/elements/pf-v5-helper-text/demo/dynamic-list.html
@@ -0,0 +1,30 @@
+
+
+
+ Must be at least 14 characters
+
+
+ Cannot contain any variation of the word "redhat"
+
+
+ Must include at least 3 of the following: lowercase letter, uppercase letters, numbers, symbols
+
+
+
+
+
+
+
diff --git a/elements/pf-helper-text/demo/dynamic.html b/elements/pf-v5-helper-text/demo/dynamic.html
similarity index 51%
rename from elements/pf-helper-text/demo/dynamic.html
rename to elements/pf-v5-helper-text/demo/dynamic.html
index e1f2f2a2ee..920ec038c4 100644
--- a/elements/pf-helper-text/demo/dynamic.html
+++ b/elements/pf-v5-helper-text/demo/dynamic.html
@@ -1,40 +1,40 @@
-
This is default helper text
-
+
-
This is indeterminate helper text
-
+
-
This is warning helper text
-
+
-
This is success helper text
-
+
-
This is error helper text
-
+
diff --git a/elements/pf-v5-helper-text/demo/static.html b/elements/pf-v5-helper-text/demo/static.html
new file mode 100644
index 0000000000..ffee3e1851
--- /dev/null
+++ b/elements/pf-v5-helper-text/demo/static.html
@@ -0,0 +1,16 @@
+This is default helper text
+This is indeterminate helper text
+This is warning helper text
+This is success helper text
+This is error helper text
+
+
+
+
diff --git a/elements/pf-helper-text/docs/pf-helper-text.md b/elements/pf-v5-helper-text/docs/pf-helper-text.md
similarity index 89%
rename from elements/pf-helper-text/docs/pf-helper-text.md
rename to elements/pf-v5-helper-text/docs/pf-helper-text.md
index 3e83d2c20a..e9ffe85f78 100644
--- a/elements/pf-helper-text/docs/pf-helper-text.md
+++ b/elements/pf-v5-helper-text/docs/pf-helper-text.md
@@ -1,5 +1,5 @@
{% renderOverview %}
-
+
{% endrenderOverview %}
{% band header="Usage" %}{% endband %}
diff --git a/elements/pf-v5-helper-text/pf-v5-helper-text.css b/elements/pf-v5-helper-text/pf-v5-helper-text.css
new file mode 100644
index 0000000000..a0c85dd861
--- /dev/null
+++ b/elements/pf-v5-helper-text/pf-v5-helper-text.css
@@ -0,0 +1,35 @@
+:host {
+ display: flex;
+ align-items: center;
+ gap: var(--pf-v5-c-helper-text--Gap, 0.25rem);
+ font-size: var(--pf-v5-c-helper-text--FontSize, 0.875rem);
+ color: var(--pf-v5-c-helper-text__item-text--Color, #151515);
+ line-height: 1.4;
+}
+
+/* Color variants */
+:host([variant='indeterminate']) {
+ color: var(--pf-v5-c-helper-text__item-text--m-indeterminate--Color, #6a6e73);
+}
+
+:host([variant='warning']) {
+ color: var(--pf-v5-c-helper-text__item-text--m-warning--Color, #795600);
+}
+
+:host([variant='success']) {
+ color: var(--pf-v5-c-helper-text__item-text--m-success--Color, #1e4f18);
+}
+
+:host([variant='error']) {
+ color: var(--pf-v5-c-helper-text__item-text--m-error--Color, #a30000);
+}
+
+::slotted(ul) {
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+}
+
+pf-v5-icon {
+ fill: currentColor;
+}
diff --git a/elements/pf-helper-text/pf-helper-text.ts b/elements/pf-v5-helper-text/pf-v5-helper-text.ts
similarity index 86%
rename from elements/pf-helper-text/pf-helper-text.ts
rename to elements/pf-v5-helper-text/pf-v5-helper-text.ts
index 506f716eb2..d0e5ccf302 100644
--- a/elements/pf-helper-text/pf-helper-text.ts
+++ b/elements/pf-v5-helper-text/pf-v5-helper-text.ts
@@ -5,9 +5,9 @@ import { ifDefined } from 'lit/directives/if-defined.js';
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
-import '@patternfly/elements/pf-icon/pf-icon.js';
+import '@patternfly/elements/pf-v5-icon/pf-v5-icon.js';
-import styles from './pf-helper-text.css';
+import styles from './pf-v5-helper-text.css';
/** Map of status to default icons (Font Awesome solid set). */
const StatusIconMap = {
@@ -29,8 +29,8 @@ const StatusIconMap = {
* @csspart icon - The container for the icon.
* @csspart text - The container for the text.
*/
-@customElement('pf-helper-text')
-export class PfHelperText extends LitElement {
+@customElement('pf-v5-helper-text')
+export class PfV5HelperText extends LitElement {
public static readonly styles: CSSStyleSheet[] = [styles];
/**
@@ -45,7 +45,7 @@ export class PfHelperText extends LitElement {
/**
* Custom icon name to override the default icon.
- * Requires `` to be imported.
+ * Requires `` to be imported.
*/
@property() icon?: string;
@@ -76,9 +76,9 @@ export class PfHelperText extends LitElement {
return html`
-
+ role="presentation">
@@ -90,6 +90,6 @@ export class PfHelperText extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-helper-text': PfHelperText;
+ 'pf-v5-helper-text': PfV5HelperText;
}
}
diff --git a/elements/pf-helper-text/test/pf-helper-text.e2e.ts b/elements/pf-v5-helper-text/test/pf-helper-text.e2e.ts
similarity index 95%
rename from elements/pf-helper-text/test/pf-helper-text.e2e.ts
rename to elements/pf-v5-helper-text/test/pf-helper-text.e2e.ts
index 3eec449fd4..ab593d7b37 100644
--- a/elements/pf-helper-text/test/pf-helper-text.e2e.ts
+++ b/elements/pf-v5-helper-text/test/pf-helper-text.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-helper-text';
+const tagName = 'pf-v5-helper-text';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-helper-text/test/pf-helper-text.spec.ts b/elements/pf-v5-helper-text/test/pf-helper-text.spec.ts
similarity index 59%
rename from elements/pf-helper-text/test/pf-helper-text.spec.ts
rename to elements/pf-v5-helper-text/test/pf-helper-text.spec.ts
index 3f40a1058d..fb3d24f7b7 100644
--- a/elements/pf-helper-text/test/pf-helper-text.spec.ts
+++ b/elements/pf-v5-helper-text/test/pf-helper-text.spec.ts
@@ -1,32 +1,32 @@
import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
-import { PfHelperText } from '@patternfly/elements/pf-helper-text/pf-helper-text.js';
+import { PfV5HelperText } from '@patternfly/elements/pf-v5-helper-text/pf-v5-helper-text.js';
-describe('', function() {
+describe('', function() {
describe('simply instantiating', function() {
- let element: PfHelperText;
+ let element: PfV5HelperText;
it('imperatively instantiates', function() {
- expect(document.createElement('pf-helper-text')).to.be.an.instanceof(PfHelperText);
+ expect(document.createElement('pf-v5-helper-text')).to.be.an.instanceof(PfV5HelperText);
});
it('should upgrade', async function() {
- element = await createFixture(html` `);
- const klass = customElements.get('pf-helper-text');
+ element = await createFixture(html` `);
+ const klass = customElements.get('pf-v5-helper-text');
expect(element)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfHelperText);
+ .to.be.an.instanceOf(PfV5HelperText);
});
});
describe('variant property', function() {
it('should default to "default" variant', async function() {
- const element = await createFixture(html` `);
+ const element = await createFixture(html` `);
expect(element.variant).to.equal('default');
});
it('should reflect variant attribute', async function() {
- const element = await createFixture(html` `);
+ const element = await createFixture(html` `);
expect(element.variant).to.equal('success');
expect(element.getAttribute('variant')).to.equal('success');
});
@@ -34,14 +34,14 @@ describe('', function() {
describe('icon display', function() {
it('should show icon when icon property is set', async function() {
- const element = await createFixture(html`Success `);
+ const element = await createFixture(html`Success `);
await element.updateComplete;
const iconContainer = element.shadowRoot?.querySelector('#icon');
expect(iconContainer?.hasAttribute('hidden')).to.be.false;
});
it('should hide icon when no icon or slotted icon is present', async function() {
- const element = await createFixture(html`Text `);
+ const element = await createFixture(html`Text `);
await element.updateComplete;
const iconContainer = element.shadowRoot?.querySelector('#icon');
expect(iconContainer?.hasAttribute('hidden')).to.be.true;
@@ -50,12 +50,12 @@ describe('', function() {
describe('text content', function() {
it('should render text content in default slot', async function() {
- const element = await createFixture(html`Helper text content `);
+ const element = await createFixture(html`Helper text content `);
expect(element.textContent?.trim()).to.equal('Helper text content');
});
it('should have aria-live on text container', async function() {
- const element = await createFixture(html`Text `);
+ const element = await createFixture(html`Text `);
await element.updateComplete;
const textContainer = element.shadowRoot?.querySelector('#text');
expect(textContainer?.getAttribute('aria-live')).to.equal('polite');
diff --git a/elements/pf-v5-hint/demo/index.html b/elements/pf-v5-hint/demo/index.html
new file mode 100644
index 0000000000..e89b899bd9
--- /dev/null
+++ b/elements/pf-v5-hint/demo/index.html
@@ -0,0 +1,47 @@
+Default with no title
+
+ Welcome to the new documentation experience.
+ Learn more about the improved features .
+
+
+
+
+
+
+ Link
+ Action
+ Disabled Link
+ Disabled Action
+
+ Separated Link
+ Separated Action
+
+
+ Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
+ Try it for 90 days
+
+
+
+
+
diff --git a/elements/pf-v5-hint/demo/with-title.html b/elements/pf-v5-hint/demo/with-title.html
new file mode 100644
index 0000000000..277cd71c55
--- /dev/null
+++ b/elements/pf-v5-hint/demo/with-title.html
@@ -0,0 +1,59 @@
+Hint with title
+
+
+
+
+
+ Link
+ Action
+ Disabled Link
+ Disabled Action
+
+ Separated Link
+ Separated Action
+
+
+ Do more with Find it Fix it capabilities
+ Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
+
+
+
+
+
+
+ Link
+ Action
+ Disabled Link
+ Disabled Action
+
+ Separated Link
+ Separated Action
+
+
+ Do more with Find it Fix it capabilities
+ Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
+ Try it for 90 days
+
+
+
+
+
diff --git a/elements/pf-hint/docs/pf-hint.md b/elements/pf-v5-hint/docs/pf-hint.md
similarity index 67%
rename from elements/pf-hint/docs/pf-hint.md
rename to elements/pf-v5-hint/docs/pf-hint.md
index d9f8030343..414ddec562 100644
--- a/elements/pf-hint/docs/pf-hint.md
+++ b/elements/pf-v5-hint/docs/pf-hint.md
@@ -1,8 +1,8 @@
{% renderOverview %}
-
+
Welcome to the new documentation experience.
Learn more about the improved features .
-
+
{% endrenderOverview %}
{% band header="Usage" %}
@@ -10,81 +10,81 @@
Basic hint without a title, used for simple informational messages.
{% htmlexample %}
-
+
Welcome to the new documentation experience.
Learn more about the improved features .
-
+
{% endhtmlexample %}
### Hint with title
Add a title to your hint by using the `title` slot to provide more context.
{% htmlexample %}
-
+
Do more with Find it Fix it capabilities
Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
-
+
{% endhtmlexample %}
### With a footer
Add action links or buttons to the footer using the `footer` slot.
{% htmlexample %}
-
+
Do more with Find it Fix it capabilities
Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
-
+
Try it for 90 days
-
-
+
+
{% endhtmlexample %}
### With actions
Add an actions menu (like a kebab dropdown) using the `actions` slot.
{% htmlexample %}
-
-
-
-
-
+
+
+
+
+
Link
-
-
+
+
Action
-
-
-
+
+
+
Do more with Find it Fix it capabilities
Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
-
+
{% endhtmlexample %}
### Complete example
A hint with all available slots.
{% htmlexample %}
-
-
-
-
-
+
+
+
+
+
Link
-
-
+
+
Action
-
-
+
+
Disabled link
-
-
-
+
+
+
Do more with Find it Fix it capabilities
Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
-
+
Try it for 90 days
-
-
+
+
{% endhtmlexample %}
{% endband %}
diff --git a/elements/pf-v5-hint/pf-v5-hint.css b/elements/pf-v5-hint/pf-v5-hint.css
new file mode 100644
index 0000000000..2a5d34cf10
--- /dev/null
+++ b/elements/pf-v5-hint/pf-v5-hint.css
@@ -0,0 +1,120 @@
+:host {
+ display: block;
+
+ /* Container */
+ --pf-v5-c-hint--GridRowGap: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-hint--PaddingTop: var(--pf-global--spacer--lg, 1.5rem);
+ --pf-v5-c-hint--PaddingRight: var(--pf-global--spacer--lg, 1.5rem);
+ --pf-v5-c-hint--PaddingBottom: var(--pf-global--spacer--lg, 1.5rem);
+ --pf-v5-c-hint--PaddingLeft: var(--pf-global--spacer--lg, 1.5rem);
+ --pf-v5-c-hint--BackgroundColor: var(--pf-global--palette--blue-50, #e7f1fa);
+ --pf-v5-c-hint--BorderColor: var(--pf-global--palette--blue-100, #bee1f4);
+ --pf-v5-c-hint--BorderWidth: 1px;
+ --pf-v5-c-hint--BorderRadius: var(--pf-global--BorderRadius--sm, 3px);
+ --pf-v5-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm, 0 0.0625rem 0.125rem 0 rgba(3, 3, 3, 0.12), 0 0 0.125rem 0 rgba(3, 3, 3, 0.06));
+
+ /* Title */
+ --pf-v5-c-hint__title--FontSize: 1.125rem;
+ --pf-v5-c-hint__title--FontWeight: var(--pf-global--FontWeight--semi-bold, 700);
+ --pf-v5-c-hint__title--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-hint__title--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+
+ /* Body */
+ --pf-v5-c-hint__body--FontSize: 1rem;
+ --pf-v5-c-hint__body--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-hint__body--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+
+ /* Footer */
+ --pf-v5-c-hint__footer--MarginTop: 0;
+ --pf-v5-c-hint__footer--child--MarginRight: 1rem;
+
+ /* Actions */
+ --pf-v5-c-hint__actions--Top: var(--pf-global--spacer--lg, 1.5rem);
+ --pf-v5-c-hint__actions--Right: var(--pf-global--spacer--lg, 1.5rem);
+ --pf-v5-c-hint__actions--MarginLeft: 3rem;
+ --pf-v5-c-hint__actions--c-dropdown--MarginTop: calc(0.375rem * -1);
+}
+
+#container {
+ position: relative;
+ display: grid;
+ grid-template-columns: 1fr auto;
+ gap: var(--pf-v5-c-hint--GridRowGap);
+ padding:
+ var(--pf-v5-c-hint--PaddingTop)
+ var(--pf-v5-c-hint--PaddingRight)
+ var(--pf-v5-c-hint--PaddingBottom)
+ var(--pf-v5-c-hint--PaddingLeft);
+ background-color: var(--pf-v5-c-hint--BackgroundColor);
+ border: var(--pf-v5-c-hint--BorderWidth) solid var(--pf-v5-c-hint--BorderColor);
+ border-radius: var(--pf-v5-c-hint--BorderRadius);
+ box-shadow: var(--pf-v5-c-hint--BoxShadow);
+ overflow: visible;
+}
+
+#container > * {
+ grid-column: 1;
+}
+
+#actions {
+ grid-column: 2;
+ grid-row: 1 / -1;
+ align-self: start;
+ position: relative;
+ z-index: 1000;
+}
+
+#actions ::slotted(pf-v5-dropdown) {
+ margin-top: var(--pf-v5-c-hint__actions--c-dropdown--MarginTop);
+ --pf-v5-c-dropdown__menu--MinWidth: auto;
+ --pf-v5-c-dropdown__menu--Left: auto;
+ --pf-v5-c-dropdown__menu--Right: 0;
+}
+
+#title {
+ font-size: var(--pf-v5-c-hint__title--FontSize);
+ font-weight: var(--pf-v5-c-hint__title--FontWeight);
+ color: var(--pf-v5-c-hint__title--Color);
+ line-height: var(--pf-v5-c-hint__title--LineHeight);
+}
+
+#body {
+ font-size: var(--pf-v5-c-hint__body--FontSize);
+ color: var(--pf-v5-c-hint__body--Color);
+ line-height: var(--pf-v5-c-hint__body--LineHeight);
+}
+
+#footer {
+ margin-top: var(--pf-v5-c-hint__footer--MarginTop);
+ font-size: var(--pf-v5-c-hint__body--FontSize);
+ line-height: var(--pf-v5-c-hint__body--LineHeight);
+}
+
+#footer ::slotted(*) {
+ margin-right: var(--pf-v5-c-hint__footer--child--MarginRight);
+}
+
+#footer ::slotted(*:last-child) {
+ margin-right: 0;
+}
+
+/* Hidden elements */
+[hidden] {
+ display: none !important;
+}
+
+/* Link styling within hint */
+::slotted(a) {
+ color: var(--pf-global--link--Color, #06c);
+ text-decoration: none;
+}
+
+::slotted(a:hover) {
+ color: var(--pf-global--link--Color--hover, #004080);
+ text-decoration: underline;
+}
+
+/* Button styling in footer */
+::slotted(pf-v5-button) {
+ --pf-v5-c-button--m-link--Color: var(--pf-global--link--Color, #06c);
+}
diff --git a/elements/pf-hint/pf-hint.ts b/elements/pf-v5-hint/pf-v5-hint.ts
similarity index 86%
rename from elements/pf-hint/pf-hint.ts
rename to elements/pf-v5-hint/pf-v5-hint.ts
index d3fe94a80a..c9a1348e0e 100644
--- a/elements/pf-hint/pf-hint.ts
+++ b/elements/pf-v5-hint/pf-v5-hint.ts
@@ -4,7 +4,7 @@ import { classMap } from 'lit/directives/class-map.js';
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
-import styles from './pf-hint.css';
+import styles from './pf-v5-hint.css';
/**
* A **hint** is in-app messaging that provides a one-step reminder, explanation,
@@ -14,8 +14,8 @@ import styles from './pf-hint.css';
* @summary Provides inline contextual help or information to users
* @alias Hint
*/
-@customElement('pf-hint')
-export class PfHint extends LitElement {
+@customElement('pf-v5-hint')
+export class PfV5Hint extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
#slots = new SlotController(this, 'title', null, 'footer', 'actions');
@@ -31,27 +31,27 @@ export class PfHint extends LitElement {
})}>
+ class="pf-v5-c-hint__body">
`;
}
@@ -182,7 +182,7 @@ export class PfLabelGroup extends LitElement {
}
#onCloseClick() {
- this.dispatchEvent(new PfLabelGroupRemoveEvent());
+ this.dispatchEvent(new PfV5LabelGroupRemoveEvent());
}
async #onMoreClick(event: Event) {
@@ -193,7 +193,7 @@ export class PfLabelGroup extends LitElement {
if (this.#overflowLabel) {
this.#tabindex.atFocusedItemIndex = this.#tabindex.items.indexOf(this.#overflowLabel);
}
- this.dispatchEvent(new PfLabelGroupExpandEvent());
+ this.dispatchEvent(new PfV5LabelGroupExpandEvent());
}
#onSlotchange() {
@@ -201,7 +201,7 @@ export class PfLabelGroup extends LitElement {
}
#onRemove(event: Event) {
- if (event instanceof PfLabelGroupRemoveEvent) {
+ if (event instanceof PfV5LabelGroupRemoveEvent) {
this.remove();
}
}
@@ -215,6 +215,6 @@ export class PfLabelGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-label-group': PfLabelGroup;
+ 'pf-v5-label-group': PfV5LabelGroup;
}
}
diff --git a/elements/pf-label-group/test/pf-label-group.e2e.ts b/elements/pf-v5-label-group/test/pf-label-group.e2e.ts
similarity index 95%
rename from elements/pf-label-group/test/pf-label-group.e2e.ts
rename to elements/pf-v5-label-group/test/pf-label-group.e2e.ts
index 790889b1d6..4f70a1ebeb 100644
--- a/elements/pf-label-group/test/pf-label-group.e2e.ts
+++ b/elements/pf-v5-label-group/test/pf-label-group.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-label-group';
+const tagName = 'pf-v5-label-group';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-label-group/test/pf-label-group.spec.ts b/elements/pf-v5-label-group/test/pf-label-group.spec.ts
similarity index 63%
rename from elements/pf-label-group/test/pf-label-group.spec.ts
rename to elements/pf-v5-label-group/test/pf-label-group.spec.ts
index 5a79c3a6d1..a2578da959 100644
--- a/elements/pf-label-group/test/pf-label-group.spec.ts
+++ b/elements/pf-v5-label-group/test/pf-label-group.spec.ts
@@ -1,7 +1,7 @@
import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { a11ySnapshot, querySnapshotAll } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
-import { PfLabelGroup } from '../pf-label-group.js';
+import { PfV5LabelGroup } from '../pf-v5-label-group.js';
import { sendKeys } from '@web/test-runner-commands';
function press(key: string) {
@@ -10,33 +10,33 @@ function press(key: string) {
};
}
-describe('', function() {
- let element: PfLabelGroup;
+describe('', function() {
+ let element: PfV5LabelGroup;
describe('simply instantiating', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-label-group')).to.be.an.instanceof(PfLabelGroup);
+ expect(document.createElement('pf-v5-label-group')).to.be.an.instanceof(PfV5LabelGroup);
});
it('should upgrade', async function() {
- element = await createFixture(html` `);
- const klass = customElements.get('pf-label-group');
+ element = await createFixture(html` `);
+ const klass = customElements.get('pf-v5-label-group');
expect(element)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfLabelGroup);
+ .to.be.an.instanceOf(PfV5LabelGroup);
});
});
describe('with 4 labels', function() {
beforeEach(async function() {
- element = await createFixture(html`
-
- Label 1
- Label 2
- Label 3
- Label 4
-
+ element = await createFixture(html`
+
+ Label 1
+ Label 2
+ Label 3
+ Label 4
+
`);
});
@@ -66,13 +66,13 @@ describe('', function() {
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
- element = await createFixture(html`
-
- Label 1
- Label 2
- Label 3
- Label 4
-
+ element = await createFixture(html`
+
+ Label 1
+ Label 2
+ Label 3
+ Label 4
+
`);
});
@@ -101,15 +101,15 @@ describe('', function() {
describe('with 4 labels and custom text attributes', function() {
beforeEach(async function() {
- element = await createFixture(html`
- (html`
+
- Label 1
- Label 2
- Label 3
- Label 4
-
+ Label 1
+ Label 2
+ Label 3
+ Label 4
+
`);
});
@@ -120,13 +120,13 @@ describe('', function() {
describe('with 4 labels and `num-labels="2"` attribute', function() {
beforeEach(async function() {
- element = await createFixture(html`
-
- Label 1
- Label 2
- Label 3
- Label 4
-
+ element = await createFixture(html`
+
+ Label 1
+ Label 2
+ Label 3
+ Label 4
+
`);
});
@@ -138,13 +138,13 @@ describe('', function() {
describe('with 4 labels and `num-labels="4"` attribute', function() {
beforeEach(async function() {
- element = await createFixture(html`
-
- Label 1
- Label 2
- Label 3
- Label 4
-
+ element = await createFixture(html`
+
+ Label 1
+ Label 2
+ Label 3
+ Label 4
+
`);
});
@@ -156,12 +156,12 @@ describe('', function() {
describe('with category', function() {
beforeEach(async function() {
- element = await createFixture(html`
-
+ element = await createFixture(html`
+
Group
- Label 1
- Label 2
-
+ Label 1
+ Label 2
+
`);
});
diff --git a/elements/pf-label/README.md b/elements/pf-v5-label/README.md
similarity index 66%
rename from elements/pf-label/README.md
rename to elements/pf-v5-label/README.md
index c349b4da7e..5a235a419e 100644
--- a/elements/pf-label/README.md
+++ b/elements/pf-v5-label/README.md
@@ -1,17 +1,17 @@
# Label
An inline-block element component that provides a distinct visual style for
metadata in a UI. Commonly used as visual representations for tags, labels can
-include an optional pf-icon and are available in a solid and outline style
+include an optional pf-v5-icon and are available in a solid and outline style
variant.
Read more about Label in the [PatternFly Elements Label documentation](https://patternflyelements.org/components/label)
## Installation
-Load `` via CDN:
+Load `` via CDN:
```html
-
+
```
Or, if you are using [NPM](https://npm.im), install it
@@ -23,29 +23,29 @@ npm install @patternfly/elements
Then once installed, import it to your application:
```js
-import '@patternfly/elements/pf-label/pf-label.js';
+import '@patternfly/elements/pf-v5-label/pf-v5-label.js';
```
## Usage
Default
```html
-Some Text Your label text here
+Some Text Your label text here
```
Color Options: `grey (default), blue ,green, orange, red, purple, cyan`
```html
-Some Text Your label text here
+Some Text Your label text here
```
With and Icon:
```html
-Some Text Your label text here
+Some Text Your label text here
```
Outline variant:
```html
-Some Text Your label text here
+Some Text Your label text here
```
> ### Conveying meaning to assistive technologies
@@ -55,7 +55,7 @@ Outline variant:
```html
-
+
Some text Some additional info
-
+
```
diff --git a/elements/pf-v5-label/demo/compact.html b/elements/pf-v5-label/demo/compact.html
new file mode 100644
index 0000000000..ca72baf22a
--- /dev/null
+++ b/elements/pf-v5-label/demo/compact.html
@@ -0,0 +1,21 @@
+
+ Default
+ Blue label
+ Green label
+ Orange label
+ Red label
+ Purple label
+ Cyan label
+ Gold label
+ Grey label
+
+
+
+
+
diff --git a/elements/pf-v5-label/demo/filled-color.html b/elements/pf-v5-label/demo/filled-color.html
new file mode 100644
index 0000000000..03a80c68a5
--- /dev/null
+++ b/elements/pf-v5-label/demo/filled-color.html
@@ -0,0 +1,32 @@
+
+ Blue
+ Green
+ Orange
+ Red Hat
+ Purple
+ Cyan
+ Gold
+ Grey
+
+
+
+
+
diff --git a/elements/pf-v5-label/demo/icon.html b/elements/pf-v5-label/demo/icon.html
new file mode 100644
index 0000000000..936d743edc
--- /dev/null
+++ b/elements/pf-v5-label/demo/icon.html
@@ -0,0 +1,33 @@
+
+
+
Default
+
Blue label
+
Green label
+
Orange label
+
Red label
+
Purple label
+
Cyan label
+
Gold label
+
+
+
+
Default
+
Blue label
+
Green label
+
Orange label
+
Red label
+
Purple label
+
Cyan label
+
Gold label
+
+
+
+
+
+
diff --git a/elements/pf-label/demo/index.html b/elements/pf-v5-label/demo/index.html
similarity index 52%
rename from elements/pf-label/demo/index.html
rename to elements/pf-v5-label/demo/index.html
index 9050ebf7f6..a1bfef0c68 100644
--- a/elements/pf-label/demo/index.html
+++ b/elements/pf-v5-label/demo/index.html
@@ -1,9 +1,9 @@
diff --git a/elements/pf-v5-label/demo/patternfly.html b/elements/pf-v5-label/demo/patternfly.html
new file mode 100644
index 0000000000..47e45906d8
--- /dev/null
+++ b/elements/pf-v5-label/demo/patternfly.html
@@ -0,0 +1,200 @@
+
+ Filled
+ Grey
+ Grey icon
+ Grey removable
+ Grey icon removable
+ Grey link
+ Grey link removable
+ Grey label with icon that overflows
+
+
+
+ Blue
+ Blue
+ Blue icon
+ Blue removable
+ Blue icon removable
+ Blue link
+ Blue link removable
+ Blue label with icon that overflows
+
+
+
+ Green
+ Green
+ Green icon
+ Green removable
+ Green icon removable
+ Green link
+ Green link removable
+ Green label with icon that overflows
+
+
+
+ Orange
+ Orange
+ Orange icon
+ Orange removable
+ Orange icon removable
+ Orange link
+ Orange link removable
+ Orange label with icon that overflows
+
+
+
+ Red
+ Red
+ Red icon
+ Red removable
+ Red icon removable
+ Red link
+ Red link removable
+ Red label with icon that overflows
+
+
+
+ Purple
+ Purple
+ Purple icon
+ Purple removable
+ Purple icon removable
+ Purple link
+ Purple link removable
+ Purple label with icon that overflows
+
+
+
+ Cyan
+ Cyan
+ Cyan icon
+ Cyan removable
+ Cyan icon removable
+ Cyan link
+ Cyan link removable
+ Cyan label with icon that overflows
+
+
+
+ Gold
+ Gold
+ Gold icon
+ Gold removable
+ Gold icon removable
+ Gold link
+ Gold link removable
+ Gold label with icon that overflows
+
+
+
+ Outline
+ Grey
+ Grey icon
+ Grey removable
+ Grey icon removable
+ Grey link
+ Grey link removable
+ Grey label with icon that overflows
+
+
+
+ Outline Blue
+ Blue
+ Blue icon
+ Blue removable
+ Blue icon removable
+ Blue link
+ Blue link removable
+ Blue label with icon that overflows
+
+
+
+ Outline Green
+ Green
+ Green icon
+ Green removable
+ Green icon removable
+ Green link
+ Green link removable
+ Green label with icon that overflows
+
+
+
+ Outline Orange
+ Orange
+ Orange icon
+ Orange removable
+ Orange icon removable
+ Orange link
+ Orange link removable
+ Orange label with icon that overflows
+
+
+
+ Outline Red
+ Red
+ Red icon
+ Red removable
+ Red icon removable
+ Red link
+ Red link removable
+ Red label with icon that overflows
+
+
+
+ Outline Purple
+ Purple
+ Purple icon
+ Purple removable
+ Purple icon removable
+ Purple link
+ Purple link removable
+ Purple label with icon that overflows
+
+
+
+ Outline Cyan
+ Cyan
+ Cyan icon
+ Cyan removable
+ Cyan icon removable
+ Cyan link
+ Cyan link removable
+ Cyan label with icon that overflows
+
+
+
+ Outline Gold
+ Gold
+ Gold icon
+ Gold removable
+ Gold icon removable
+ Gold link
+ Gold link removable
+ Gold label with icon that overflows
+
+
+
+ Outline Compact
+ Gold
+ Gold icon
+ Gold removable
+ Gold icon removable
+ Gold link
+ Gold link removable
+ Gold label with icon that overflows
+
+
+
+
+
diff --git a/elements/pf-label/docs/CHANGELOG.old.md b/elements/pf-v5-label/docs/CHANGELOG.old.md
similarity index 100%
rename from elements/pf-label/docs/CHANGELOG.old.md
rename to elements/pf-v5-label/docs/CHANGELOG.old.md
diff --git a/elements/pf-label/docs/pf-label.md b/elements/pf-v5-label/docs/pf-label.md
similarity index 67%
rename from elements/pf-label/docs/pf-label.md
rename to elements/pf-v5-label/docs/pf-label.md
index 34c7ae8423..fd0467cc74 100644
--- a/elements/pf-label/docs/pf-label.md
+++ b/elements/pf-v5-label/docs/pf-label.md
@@ -1,26 +1,26 @@
{% renderInstallation %} {% endrenderInstallation %}
{% renderOverview %}
- Default
+ Default
{% endrenderOverview %}
{% band header="Usage" %}
### Default
{% htmlexample %}
- Default
+ Default
{% endhtmlexample %}
### With a color
Available colors are: grey (default), blue, green, orange, red, purple, cyan, gold
{% htmlexample %}
- Blue
- Green
- Orange
- Red
- Purple
- Cyan
- Gold
+ Blue
+ Green
+ Orange
+ Red
+ Purple
+ Cyan
+ Gold
{% endhtmlexample %}
@@ -42,39 +42,39 @@
width: 1px;
}
-
+
Red Warning
-
+
{% endhtmlexample %}
### Outline variant
Swaps the color style for a outline styled variant
{% htmlexample %}
-
Blue
-
Green
-
Orange
-
Red
-
Purple
-
Cyan
-
Gold
-
Default
+
Blue
+
Green
+
Orange
+
Red
+
Purple
+
Cyan
+
Gold
+
Default
{% endhtmlexample %}
### With icon as an attribute
- Adds a optional fixed size `pf-icon` to the label as a prefix
+ Adds a optional fixed size `pf-v5-icon` to the label as a prefix
{% htmlexample %}
-
Globe
+
Globe
{% endhtmlexample %}
Read more about Icon in the [PatternFly Elements Icon documentation](https://patternflyelements.org/components/icon)
### With user defined image using `slot="icon"`
- Adds user defined SVG or `pf-icon` to the label.
+ Adds user defined SVG or `pf-v5-icon` to the label.
{% htmlexample %}
-
Globe
+ Globe
-
+
{% endhtmlexample %}
{% htmlexample %}
-
Globe
-
-
+
Globe
+
+
{% endhtmlexample %}
### Compact style
Creates a compact style label which can be combined with color, variant and icon
{% htmlexample %}
-
Globe
+ Globe
-
-
Green
-
Orange
-
Red
-
Purple
-
Cyan
-
Gold
-
Default
+
+
Green
+
Orange
+
Red
+
Purple
+
Cyan
+
Gold
+
Default
{% endhtmlexample %}
{% endband %}
diff --git a/elements/pf-label/docs/screenshot.png b/elements/pf-v5-label/docs/screenshot.png
similarity index 100%
rename from elements/pf-label/docs/screenshot.png
rename to elements/pf-v5-label/docs/screenshot.png
diff --git a/elements/pf-v5-label/pf-v5-label.css b/elements/pf-v5-label/pf-v5-label.css
new file mode 100644
index 0000000000..ca373b887b
--- /dev/null
+++ b/elements/pf-v5-label/pf-v5-label.css
@@ -0,0 +1,248 @@
+:host {
+ position: relative;
+ white-space: nowrap;
+ border: 0;
+}
+
+pf-v5-icon, ::slotted(pf-v5-icon) {
+ color: currentColor;
+}
+
+:host,
+#container {
+ display: inline-flex;
+ align-items: center;
+ vertical-align: middle;
+}
+
+#container {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ border-width: 0;
+ /** label top padding */
+ padding-top: var(--pf-v5-c-label--PaddingTop, var(--pf-global--spacer--xs, 0.25rem));
+ /** label left padding */
+ padding-left: var(--pf-v5-c-label--PaddingLeft, var(--pf-global--spacer--sm, 0.5rem));
+ /** label bottom padding */
+ padding-bottom: var(--pf-v5-c-label--PaddingBottom, var(--pf-global--spacer--xs, 0.25rem));
+ /** label right padding */
+ padding-right: var(--pf-v5-c-label--PaddingRight, var(--pf-global--spacer--sm, 0.5rem));
+ /** label font size */
+ font-size: var(--pf-v5-c-label--FontSize, var(--pf-global--FontSize--sm, 0.875rem));
+ /** label text color */
+ color: var(--pf-v5-c-label--Color, var(--pf-global--Color--100, #151515));
+ /** label background color */
+ background-color: var(--pf-v5-c-label--BackgroundColor, var(--pf-global--palette--black-150, #f5f5f5));
+ /** label border radius */
+ border-radius: var(--pf-v5-c-label--BorderRadius, 30em);
+ /** label content max width */
+ max-width: var(--pf-v5-c-label__content--MaxWidth, 100%);
+ /** label content text color */
+ color: var(--pf-v5-c-label__content--Color, var(--pf-global--Color--100, #151515));
+
+ --pf-global--icon--FontSize--sm: 14px;
+}
+
+#container::before {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ pointer-events: none;
+ content: "";
+ border-radius: var(--pf-v5-c-label--BorderRadius, 30em);
+ /** label content border width and color */
+ border: var(--pf-v5-c-label__content--before--BorderWidth, 1px) solid var(--pf-v5-c-label__content--before--BorderColor, var(--pf-global--palette--black-300, #d2d2d2));
+}
+
+[part=icon] {
+ display: none;
+ pointer-events: none;
+}
+
+.hasIcon [part=icon] {
+ display: inline-flex;
+ width: 1em;
+}
+
+.compact {
+ /** compact label top padding */
+ --pf-v5-c-label--PaddingTop: var(--pf-v5-c-label--m-compact--PaddingTop, 0);
+ /** compact label right padding */
+ --pf-v5-c-label--PaddingRight: var(--pf-v5-c-label--m-compact--PaddingRight, var(--pf-global--spacer--sm, 0.5rem));
+ /** compact label bottom padding */
+ --pf-v5-c-label--PaddingBottom: var(--pf-v5-c-label--m-compact--PaddingBottom, 0);
+ /** compact label left padding */
+ --pf-v5-c-label--PaddingLeft: var(--pf-v5-c-label--m-compact--PaddingLeft, var(--pf-global--spacer--sm, 0.5rem));
+ --pf-global--icon--FontSize--sm: 12px;
+}
+
+.blue {
+ /** blue label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-blue__content--Color, var(--pf-global--info-color--200, #002952));
+ /** blue label background color */
+ --pf-v5-c-label--BackgroundColor: var(--pf-v5-c-label--m-blue--BackgroundColor, var(--pf-global--palette--blue-50, #e7f1fa));
+ /** blue label content border color */
+ --pf-v5-c-label__content--before--BorderColor: var(--pf-v5-c-label--m-blue__content--before--BorderColor, var(--pf-global--palette--blue-100, #bee1f4));
+}
+
+.blue.outline {
+ /** outline blue label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-outline__content--Color, var(--pf-v5-c-label--m-outline--m-blue__content--Color, var(--pf-global--primary-color--100, #06c)));
+}
+
+.cyan {
+ /** cyan label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-cyan__content--Color, var(--pf-global--default-color--300, #003737));
+ /** cyan label background color */
+ --pf-v5-c-label--BackgroundColor: var(--pf-v5-c-label--m-cyan--BackgroundColor, var(--pf-global--palette--cyan-50, #f2f9f9));
+ /** cyan label content border color */
+ --pf-v5-c-label__content--before--BorderColor: var(--pf-v5-c-label--m-cyan__content--before--BorderColor, var(--pf-global--palette--cyan-100, #a2d9d9));
+}
+
+.cyan.outline {
+ /** outline cyan label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-outline__content--Color, var(--pf-v5-c-label--m-outline--m-cyan__content--Color, var(--pf-global--palette--cyan-400, #005f60)))
+}
+
+.green {
+ /** green label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-green__content--Color,var(--pf-global--success-color--200, #1e4f18));
+ /** green label background color */
+ --pf-v5-c-label--BackgroundColor: var(--pf-v5-c-label--m-green--BackgroundColor, var(--pf-global--palette--green-50, #f3faf2));
+ /** green label content border color */
+ --pf-v5-c-label__content--before--BorderColor: var(--pf-v5-c-label--m-green__content--before--BorderColor, var(--pf-global--palette--green-100, #bde5b8));
+}
+
+.green.outline{
+ /** outline green label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-outline__content--Color, var(--pf-v5-c-label--m-outline--m-green__content--Color, var(--pf-global--success-color--100, #3e8635)))
+}
+
+.orange {
+ /** orange label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-orange__content--Color, var(--pf-global--palette--orange-700, #3b1f00));
+ /** orange label background color */
+ --pf-v5-c-label--BackgroundColor: var(--pf-v5-c-label--m-orange--BackgroundColor, var(--pf-global--palette--orange-50, #fff6ec));
+ /** orange label content border color */
+ --pf-v5-c-label__content--before--BorderColor: var(--pf-v5-c-label--m-orange__content--before--BorderColor, var(--pf-global--palette--orange-100, #f4b678));
+}
+
+.orange.outline {
+ /** outline orange label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-outline__content--Color, var(--pf-v5-c-label--m-outline--m-orange__content--Color, var(--pf-global--palette--orange-500, #8f4700)))
+}
+
+.purple {
+ /** purple label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-purple__content--Color, var(--pf-global--palette--purple-700, #1f0066));
+ /** purple label background color */
+ --pf-v5-c-label--BackgroundColor: var(--pf-v5-c-label--m-purple--BackgroundColor, var(--pf-global--palette--purple-50, #f2f0fc));
+ /** purple label content border color */
+ --pf-v5-c-label__content--before--BorderColor: var(--pf-v5-c-label--m-purple__content--before--BorderColor, var(--pf-global--palette--purple-100, #cbc1ff));
+}
+
+.purple.outline {
+ /** outline purple label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-outline__content--Color, var(--pf-v5-c-label--m-outline--m-purple__content--Color, var(--pf-global--palette--purple-500, #6753ac)))
+}
+
+.red {
+ /** red label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-red__content--Color, var(--pf-global--palette--red-300, #7d1007));
+ /** red label background color */
+ --pf-v5-c-label--BackgroundColor: var(--pf-v5-c-label--m-red--BackgroundColor, var(--pf-global--palette--red-50, #faeae8));
+ /** red label content border color */
+ --pf-v5-c-label__content--before--BorderColor: var(--pf-v5-c-label--m-red__content--before--BorderColor, var(--pf-global--palette--red-100, #c9190b));
+}
+
+.red.outline {
+ /** outline red label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-outline__content--Color, var(--pf-v5-c-label--m-outline--m-red__content--Color, var(--pf-global--danger-color--100, #c9190b)))
+}
+
+.gold {
+ /** gold label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-gold__content--Color, var(--pf-global--palette--gold-700, #3d2c00));
+ /** gold label background color */
+ --pf-v5-c-label--BackgroundColor: var(--pf-v5-c-label--m-gold--BackgroundColor, var(--pf-global--palette--gold-50, #fdf7e7));
+ /** gold label content border color */
+ --pf-v5-c-label__content--before--BorderColor: var(--pf-v5-c-label--m-gold__content--before--BorderColor, var(--pf-global--palette--gold-100, #f9e0a2));
+}
+
+.gold.outline {
+ /** outline gold label content text color */
+ --pf-v5-c-label__content--Color: var(--pf-v5-c-label--m-outline__content--Color, var(--pf-v5-c-label--m-outline--m-gold__content--Color, var(--pf-global--palette--gold-600, #795600)))
+}
+
+.outline {
+ /** outline label background color */
+ --pf-v5-c-label--BackgroundColor: var(--pf-v5-c-label--m-outline--BackgroundColor, #ffffff);
+ --pf-v5-c-label__content--before--BorderColor: var(--pf-global--palette--black-300, #d2d2d2);
+}
+
+.hasIcon [part=icon] {
+ left: var(--pf-v5-c-label--PaddingLeft, var(--pf-global--spacer--md, 1rem));
+ margin-inline-end: var(--pf-v5-c-label__icon--MarginRight, var(--pf-global--spacer--xs, 0.25rem));
+}
+
+.blue .hasIcon [part=icon] {
+ /** blue label icon color */
+ color: var(--pf-v5-c-label__icon--Color, var(--pf-v5-c-label--m-blue__icon--Color, var(--pf-global--primary-color--100, #06c)));
+}
+
+.cyan .hasIcon [part=icon] {
+ /** cyan label icon color */
+ color: var(--pf-v5-c-label__icon--Color, var(--pf-v5-c-label--m-cyan__icon--Color, var(--pf-global--default-color--200, #009596)));
+}
+
+.green .hasIcon [part=icon] {
+ /** green label icon color */
+ color: var(--pf-v5-c-label__icon--Color, var(--pf-v5-c-label--m-green__icon--Color, var(--pf-global--success-color--100, #3e8635)));
+}
+
+.orange .hasIcon [part=icon] {
+ /** orange label icon color */
+ color: var(--pf-v5-c-label__icon--Color, var(--pf-v5-c-label--m-orange__icon--Color, var(--pf-global--palette--orange-300, #ec7a08)));
+}
+
+.purple .hasIcon [part=icon] {
+ /** purple label icon color */
+ color: var(--pf-v5-c-label__icon--Color, var(--pf-v5-c-label--m-purple__icon--Color, var(--pf-global--palette--purple-500, #6753ac)));
+}
+
+.red .hasIcon [part=icon] {
+ /** red label icon color */
+ color: var(--pf-v5-c-label__icon--Color, var(--pf-v5-c-label--m-red__icon--Color, var(--pf-global--danger-color--100, #c9190b)));
+}
+
+.gold .hasIcon [part=icon] {
+ /** gold label icon color */
+ color: var(--pf-v5-c-label__icon--Color, var(--pf-v5-c-label--m-gold__icon--Color, var(--pf-global--palette--gold-400, #f0ab00)));
+}
+
+pf-v5-button {
+ --pf-v5-c-button--FontSize: var(--pf-v5-c-label__c-button--FontSize,
+ var(--pf-global--FontSize--xs, 0.75rem));
+ --pf-v5-c-button--PaddingTop: var(--pf-v5-c-label__c-button--PaddingTop,
+ var(--pf-global--spacer--xs, 0.25rem));
+ --pf-v5-c-button--PaddingRight: var(--pf-v5-c-label__c-button--PaddingRight,
+ var(--pf-global--spacer--sm, 0.5rem));
+ --pf-v5-c-button--PaddingBottom: var(--pf-v5-c-label__c-button--PaddingBottom,
+ var(--pf-global--spacer--xs, 0.25rem));
+ --pf-v5-c-button--PaddingLeft: var(--pf-v5-c-label__c-button--PaddingLeft,
+ var(--pf-global--spacer--sm, 0.5rem));
+ margin-top: var(--pf-v5-c-label__c-button--MarginTop, -0.5rem);
+ margin-right: var(--pf-v5-c-label__c-button--MarginRight, -0.5rem);
+ margin-bottom: var(--pf-v5-c-label__c-button--MarginBottom, -0.5rem);
+ margin-left: var(--pf-v5-c-label__c-button--MarginLeft, 0.25rem);
+}
+
+svg {
+ vertical-align:-0.125em;
+ fill: currentColor;
+ height: 1em;
+ width: 1em;
+}
diff --git a/elements/pf-label/pf-label.ts b/elements/pf-v5-label/pf-v5-label.ts
similarity index 90%
rename from elements/pf-label/pf-label.ts
rename to elements/pf-v5-label/pf-v5-label.ts
index eea234bd62..c5c65c0c86 100644
--- a/elements/pf-label/pf-label.ts
+++ b/elements/pf-v5-label/pf-v5-label.ts
@@ -5,9 +5,9 @@ import { classMap } from 'lit/directives/class-map.js';
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
-import '@patternfly/elements/pf-button/pf-button.js';
+import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
-import styles from './pf-label.css';
+import styles from './pf-v5-label.css';
export class LabelCloseEvent extends Event {
constructor() {
@@ -22,8 +22,8 @@ export class LabelCloseEvent extends Event {
* @alias Label
* @fires {LabelCloseEvent} close - when a removable label's close button is clicked
*/
-@customElement('pf-label')
-export class PfLabel extends LitElement {
+@customElement('pf-v5-label')
+export class PfV5Label extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
static override readonly shadowRootOptions: ShadowRootInit = {
@@ -96,21 +96,21 @@ export class PfLabel extends LitElement {
summary: container for the label icon
-->
-
+ .icon="${this.icon || undefined as unknown as string}">
-
-
+
`;
@@ -123,12 +123,12 @@ export class PfLabel extends LitElement {
}
}
-export type LabelVariant = PfLabel['variant'];
+export type LabelVariant = PfV5Label['variant'];
-export type LabelColor = PfLabel['color'];
+export type LabelColor = PfV5Label['color'];
declare global {
interface HTMLElementTagNameMap {
- 'pf-label': PfLabel;
+ 'pf-v5-label': PfV5Label;
}
}
diff --git a/elements/pf-label/test/pf-label.e2e.ts b/elements/pf-v5-label/test/pf-label.e2e.ts
similarity index 95%
rename from elements/pf-label/test/pf-label.e2e.ts
rename to elements/pf-v5-label/test/pf-label.e2e.ts
index b0e512b6dd..f75986a59b 100644
--- a/elements/pf-label/test/pf-label.e2e.ts
+++ b/elements/pf-v5-label/test/pf-label.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-label';
+const tagName = 'pf-v5-label';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-label/test/pf-label.spec.ts b/elements/pf-v5-label/test/pf-label.spec.ts
similarity index 71%
rename from elements/pf-label/test/pf-label.spec.ts
rename to elements/pf-v5-label/test/pf-label.spec.ts
index b7866eba29..5103774def 100644
--- a/elements/pf-label/test/pf-label.spec.ts
+++ b/elements/pf-v5-label/test/pf-label.spec.ts
@@ -1,57 +1,57 @@
import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { getColor, hexToRgb } from '@patternfly/pfe-tools/test/hex-to-rgb.js';
-import { PfLabel } from '@patternfly/elements/pf-label/pf-label.js';
-import { PfIcon } from '@patternfly/elements/pf-icon/pf-icon.js';
+import { PfV5Label } from '@patternfly/elements/pf-v5-label/pf-v5-label.js';
+import { PfV5Icon } from '@patternfly/elements/pf-v5-icon/pf-v5-icon.js';
import '@patternfly/pfe-tools/test/stub-logger.js';
const example = html`
-
Default
+
Default
`;
const exampleWithColorAttribute = html`
-
Red
+
Red
`;
const exampleWithColorAttributeEmpty = html`
-
Default
+
Default
`;
const exampleWithOutlineAttribute = html`
-
Default Outline
+
Default Outline
`;
const exampleWithCompactAttribute = html`
-
Default Compact
+
Default Compact
`;
-describe('
', function() {
+describe('', function() {
before(function() {
// replace the default built-in icon set resolveIconName function
// with one that loads local icons. we don't want tests dependent on
// prod servers.
- PfIcon.addIconSet('rh', function(name: string) {
- return new URL(`/elements/pf-icon/test/${name.replace('rh', 'rh-icon')}.svg`);
+ PfV5Icon.addIconSet('rh', function(name: string) {
+ return new URL(`/elements/pf-v5-icon/test/${name.replace('rh', 'rh-icon')}.svg`);
});
});
it('imperatively instantiates', function() {
- expect(document.createElement('pf-label')).to.be.an.instanceof(PfLabel);
+ expect(document.createElement('pf-v5-label')).to.be.an.instanceof(PfV5Label);
});
it('should upgrade', async function() {
- const el = await createFixture(example);
- const klass = customElements.get('pf-label');
+ const el = await createFixture(example);
+ const klass = customElements.get('pf-v5-label');
expect(el)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfLabel);
+ .to.be.an.instanceOf(PfV5Label);
});
it('should display default variant', async function() {
- const el = await createFixture(example);
+ const el = await createFixture(example);
await el.updateComplete;
const container = el.shadowRoot!.querySelector('#container')!;
const beforeStyles = getComputedStyle(container, '::before');
@@ -62,7 +62,7 @@ describe('', function() {
});
it('should display color variant if color attribute is present', async function() {
- const el = await createFixture(exampleWithColorAttribute);
+ const el = await createFixture(exampleWithColorAttribute);
await el.updateComplete;
const container = el.shadowRoot!.querySelector('#container')!;
const beforeStyles = getComputedStyle(container, '::before');
@@ -73,7 +73,7 @@ describe('', function() {
});
it('should display default variant if color attribute is present but empty', async function() {
- const el = await createFixture( exampleWithColorAttributeEmpty);
+ const el = await createFixture( exampleWithColorAttributeEmpty);
await el.updateComplete;
const container = el.shadowRoot!.querySelector('#container')!;
const beforeStyles = getComputedStyle(container, '::before');
@@ -84,7 +84,7 @@ describe('', function() {
});
it('should display outline variant if the attribute outline is present', async function() {
- const el = await createFixture(exampleWithOutlineAttribute);
+ const el = await createFixture(exampleWithOutlineAttribute);
await el.updateComplete;
const container = el.shadowRoot!.querySelector('#container')!;
const beforeStyles = getComputedStyle(container, '::before');
@@ -95,37 +95,37 @@ describe('', function() {
});
describe('with valid icon attribute', function() {
- let element: PfLabel;
+ let element: PfV5Label;
beforeEach(async function() {
- element = await createFixture(html`
- Default Icon
+ element = await createFixture(html`
+ Default Icon
`);
element.updateComplete;
});
- it('should render a pf-icon', async function() {
- const icon = element.shadowRoot!.querySelector('pf-icon')!;
+ it('should render a pf-v5-icon', async function() {
+ const icon = element.shadowRoot!.querySelector('pf-v5-icon')!;
expect(icon.hidden).to.be.false;
expect(icon.icon).to.equal(element.icon);
});
});
describe('with empty icon attribute', function() {
- let element: PfLabel;
+ let element: PfV5Label;
beforeEach(async function() {
- element = await createFixture(html`
- Default
+ element = await createFixture(html`
+ Default
`);
element.updateComplete;
});
- it('should not render a pf-icon', async function() {
- const icon = element.shadowRoot!.querySelector('pf-icon')!;
+ it('should not render a pf-v5-icon', async function() {
+ const icon = element.shadowRoot!.querySelector('pf-v5-icon')!;
expect(icon.hidden).to.be.true;
expect(icon.icon).to.be.undefined;
});
});
it('should display compact version if the attribute is-compact is present', async function() {
- const el = await createFixture(exampleWithCompactAttribute);
+ const el = await createFixture(exampleWithCompactAttribute);
await el.updateComplete;
const container = el.shadowRoot!.querySelector('#container')!;
const beforeStyles = getComputedStyle(container, '::before');
diff --git a/elements/pf-modal/README.md b/elements/pf-v5-modal/README.md
similarity index 79%
rename from elements/pf-modal/README.md
rename to elements/pf-v5-modal/README.md
index f8ec3b3459..95875cfe7e 100644
--- a/elements/pf-modal/README.md
+++ b/elements/pf-v5-modal/README.md
@@ -1,15 +1,15 @@
# PatternFly Elements Modal
-`pf-modal` is a self-contained modal window that is hidden on page load and (when activated) restricts the user from interacting with content in the main window.
+`pf-v5-modal` is a self-contained modal window that is hidden on page load and (when activated) restricts the user from interacting with content in the main window.
Read more about Modal in the [PatternFly Elements Modal documentation](https://patternflyelements.org/components/modal)
## Installation
-Load `` via CDN:
+Load `` via CDN:
```html
-
+
```
Or, if you are using [NPM](https://npm.im), install it
@@ -21,7 +21,7 @@ npm install @patternfly/elements
Then once installed, import it to your application:
```js
-import '@patternfly/elements/pf-modal/pf-modal.js';
+import '@patternfly/elements/pf-v5-modal/pf-v5-modal.js';
```
## Usage
@@ -29,14 +29,14 @@ import '@patternfly/elements/pf-modal/pf-modal.js';
Open a modal dialog with the `showModal()` method, or by setting the `open` boolean attribute.
```html
-
+
Modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Learn more
-
+
```
@@ -45,18 +45,18 @@ document.querySelector('pf-modal').showModal();
You may assign a button-like trigger element to the modal by setting the modal element's `trigger` attribute to the trigger's ID.
```html
-
+
Modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Learn more
-
+
Open modal
```
You may also imperatively set the trigger element with the `setTrigger()` method:
```js
-const modal = document.querySelector('pf-modal');
+const modal = document.querySelector('pf-v5-modal');
const trigger = document.querySelector('button#my-trigger');
modal.setTrigger(trigger);
```
diff --git a/elements/pf-modal/demo/custom-header-footer.html b/elements/pf-v5-modal/demo/custom-header-footer.html
similarity index 68%
rename from elements/pf-modal/demo/custom-header-footer.html
rename to elements/pf-v5-modal/demo/custom-header-footer.html
index 8701e84c4f..3e261a9558 100644
--- a/elements/pf-modal/demo/custom-header-footer.html
+++ b/elements/pf-v5-modal/demo/custom-header-footer.html
@@ -1,5 +1,5 @@
-
+
With custom header/footer content.
Allows for custom content in the header and/or footer by slotting HTML.
When static text describing the modal is available, it can be wrapped
@@ -9,21 +9,21 @@
With custom header/footer content.
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
+
Custom modal footer.
-
-
+
+
@@ -52,8 +52,8 @@
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/custom-icon.html b/elements/pf-v5-modal/demo/custom-icon.html
similarity index 63%
rename from elements/pf-modal/demo/custom-icon.html
rename to elements/pf-v5-modal/demo/custom-icon.html
index 27189df3e0..13ef0b7292 100644
--- a/elements/pf-modal/demo/custom-icon.html
+++ b/elements/pf-v5-modal/demo/custom-icon.html
@@ -1,24 +1,24 @@
-
+
-
+
Modal Header
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- Show modal
+
+ Show modal
@@ -47,8 +47,8 @@
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/description.html b/elements/pf-v5-modal/demo/description.html
similarity index 84%
rename from elements/pf-modal/demo/description.html
rename to elements/pf-v5-modal/demo/description.html
index 8db4de88d2..def4b6f5dc 100644
--- a/elements/pf-modal/demo/description.html
+++ b/elements/pf-v5-modal/demo/description.html
@@ -1,5 +1,5 @@
-
+
Modal with description
A description is used when you want to provide more info about the modal than the title is
able to describe. The content in the description is static and will not scroll with the rest of the modal body.
@@ -31,20 +31,20 @@
Modal with description
mollis risus at ligula finibus, vitae volutpat ex auctor. Morbi vel cursus felis. Maecenas lobortis porttitor
odio, non venenatis risus varius vitae. Proin gravida mi odio, sed pretium neque luctus vitae. Mauris ut libero
bibendum, finibus dui non, rutrum sapien. Quisque ac bibendum erat. Vestibulum tincidunt risus nisi.
- Confirm
- Cancel
-
- Show modal
+ Confirm
+ Cancel
+
+ Show modal
@@ -73,8 +73,8 @@ Modal with description
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/index.html b/elements/pf-v5-modal/demo/index.html
similarity index 65%
rename from elements/pf-modal/demo/index.html
rename to elements/pf-v5-modal/demo/index.html
index 9574c1cad7..75f26f00a6 100644
--- a/elements/pf-modal/demo/index.html
+++ b/elements/pf-v5-modal/demo/index.html
@@ -1,25 +1,25 @@
-
+
Simple modal header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
- Confirm
- Cancel
-
-
+ Confirm
+ Cancel
+
+
@@ -48,8 +48,8 @@ Simple modal header
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/no-header.html b/elements/pf-v5-modal/demo/no-header.html
similarity index 67%
rename from elements/pf-modal/demo/no-header.html
rename to elements/pf-v5-modal/demo/no-header.html
index 88393b031c..8f9f731fe9 100644
--- a/elements/pf-modal/demo/no-header.html
+++ b/elements/pf-v5-modal/demo/no-header.html
@@ -1,19 +1,19 @@
-
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
+
+
@@ -42,8 +42,8 @@
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/overflowing-content.html b/elements/pf-v5-modal/demo/overflowing-content.html
similarity index 84%
rename from elements/pf-modal/demo/overflowing-content.html
rename to elements/pf-v5-modal/demo/overflowing-content.html
index 8a4e790cc1..2ae883cc2c 100644
--- a/elements/pf-modal/demo/overflowing-content.html
+++ b/elements/pf-v5-modal/demo/overflowing-content.html
@@ -1,7 +1,7 @@
If the content that you're passing to the modal is likely to overflow the modal content area, it is still
accessible via keyboard scrolling.
-
+
Modal with overflowing content
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
@@ -30,20 +30,20 @@
Modal with overflowing content
mollis risus at ligula finibus, vitae volutpat ex auctor. Morbi vel cursus felis. Maecenas lobortis porttitor
odio, non venenatis risus varius vitae. Proin gravida mi odio, sed pretium neque luctus vitae. Mauris ut libero
bibendum, finibus dui non, rutrum sapien. Quisque ac bibendum erat. Vestibulum tincidunt risus nisi.
- Confirm
- Cancel
-
- Show modal
+ Confirm
+ Cancel
+
+ Show modal
@@ -72,8 +72,8 @@ Modal with overflowing content
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/styling.html b/elements/pf-v5-modal/demo/styling.html
similarity index 62%
rename from elements/pf-modal/demo/styling.html
rename to elements/pf-v5-modal/demo/styling.html
index 1b5bfaa3bf..470867efcb 100644
--- a/elements/pf-modal/demo/styling.html
+++ b/elements/pf-v5-modal/demo/styling.html
@@ -1,26 +1,26 @@
- --pf-c-modal-box--Width CSS Custom Property
-
+ --pf-v5-c-modal-box--Width CSS Custom Property
+
Width 50% header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
- Confirm
- Cancel
-
- Show modal
+ Confirm
+ Cancel
+
+ Show modal
@@ -49,8 +49,8 @@ Width 50% header
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/top-aligned.html b/elements/pf-v5-modal/demo/top-aligned.html
similarity index 65%
rename from elements/pf-modal/demo/top-aligned.html
rename to elements/pf-v5-modal/demo/top-aligned.html
index 32ec70ae0c..d02185346e 100644
--- a/elements/pf-modal/demo/top-aligned.html
+++ b/elements/pf-v5-modal/demo/top-aligned.html
@@ -1,26 +1,26 @@
Top aligned
-
+
Top modal header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
- Confirm
- Cancel
-
- Show modal
+ Confirm
+ Cancel
+
+ Show modal
@@ -49,8 +49,8 @@ Top modal header
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/trigger-attribute.html b/elements/pf-v5-modal/demo/trigger-attribute.html
similarity index 69%
rename from elements/pf-modal/demo/trigger-attribute.html
rename to elements/pf-v5-modal/demo/trigger-attribute.html
index e26fe0e851..f26847f645 100644
--- a/elements/pf-modal/demo/trigger-attribute.html
+++ b/elements/pf-v5-modal/demo/trigger-attribute.html
@@ -1,30 +1,30 @@
You may set an external button as the trigger by setting its' ID as the modal's trigger attribute.
-
+
External trigger
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
- Confirm
- Cancel
-
+ Confirm
+ Cancel
+
Arbitrary content can intervene between the external trigger and the modal element, as long as they are within the
same root.
- Show modal with external trigger
+ Show modal with external trigger
@@ -53,8 +53,8 @@ External trigger
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/variants.html b/elements/pf-v5-modal/demo/variants.html
similarity index 66%
rename from elements/pf-modal/demo/variants.html
rename to elements/pf-v5-modal/demo/variants.html
index 1b89ddea75..211d8caab0 100644
--- a/elements/pf-modal/demo/variants.html
+++ b/elements/pf-v5-modal/demo/variants.html
@@ -1,56 +1,56 @@
Small
-
+
Small modal header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
- Confirm
- Cancel
-
-
+ Confirm
+ Cancel
+
+
Medium
-
+
Medium modal header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
- Confirm
- Cancel
-
-
+ Confirm
+ Cancel
+
+
Large
-
+
Large modal header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
- Confirm
- Cancel
-
-
+ Confirm
+ Cancel
+
+
@@ -79,8 +79,8 @@ Large modal header
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/demo/warning-alert.html b/elements/pf-v5-modal/demo/warning-alert.html
similarity index 62%
rename from elements/pf-modal/demo/warning-alert.html
rename to elements/pf-v5-modal/demo/warning-alert.html
index f2a55e6ed1..547dff0071 100644
--- a/elements/pf-modal/demo/warning-alert.html
+++ b/elements/pf-v5-modal/demo/warning-alert.html
@@ -1,24 +1,24 @@
-
+
-
+
Modal Header
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- Show modal
+
+ Show modal
@@ -47,8 +47,8 @@
}
body {
- --pf-modal--MinWidth: 800px;
- --pf-modal--MaxWidth: 800px;
- --pf-modal--MaxHeight: 800px;
+ --pf-v5-modal--MinWidth: 800px;
+ --pf-v5-modal--MaxWidth: 800px;
+ --pf-v5-modal--MaxHeight: 800px;
}
diff --git a/elements/pf-modal/docs/CHANGELOG.old.md b/elements/pf-v5-modal/docs/CHANGELOG.old.md
similarity index 100%
rename from elements/pf-modal/docs/CHANGELOG.old.md
rename to elements/pf-v5-modal/docs/CHANGELOG.old.md
diff --git a/elements/pf-modal/docs/pf-modal.md b/elements/pf-v5-modal/docs/pf-modal.md
similarity index 82%
rename from elements/pf-modal/docs/pf-modal.md
rename to elements/pf-v5-modal/docs/pf-modal.md
index 09e5685a97..dada4b71a5 100644
--- a/elements/pf-modal/docs/pf-modal.md
+++ b/elements/pf-v5-modal/docs/pf-modal.md
@@ -1,22 +1,22 @@
{% renderInstallation %} {% endrenderInstallation %}
{% renderOverview %}
-
+
Modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Learn more
-
- Open modal
+
+ Open modal
{% endrenderOverview %}
{% band header="Usage" %}
{% htmlexample %}
-
+
Modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Learn more
-
- Open modal
+
+ Open modal
{% endhtmlexample %}
{% endband %}
@@ -24,30 +24,30 @@
{% renderAttributes %}
{% htmlexample %}
-
+
Small modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Learn more
-
- Open a small modal
+
+ Open a small modal
{% endhtmlexample %}
{% htmlexample %}
-
+
Medium modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Learn more
-
- Open a medium modal
+
+ Open a medium modal
{% endhtmlexample %}
{% htmlexample %}
-
+
Large modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Learn more
-
- Open a large modal
+
+ Open a large modal
{% endhtmlexample %}
{% endrenderAttributes %}
diff --git a/elements/pf-modal/docs/screenshot.png b/elements/pf-v5-modal/docs/screenshot.png
similarity index 100%
rename from elements/pf-modal/docs/screenshot.png
rename to elements/pf-v5-modal/docs/screenshot.png
diff --git a/elements/pf-modal/pf-modal.css b/elements/pf-v5-modal/pf-v5-modal.css
similarity index 71%
rename from elements/pf-modal/pf-modal.css
rename to elements/pf-v5-modal/pf-v5-modal.css
index df415d3880..26145802be 100644
--- a/elements/pf-modal/pf-modal.css
+++ b/elements/pf-v5-modal/pf-v5-modal.css
@@ -1,7 +1,7 @@
:host {
display: block;
position: relative;
- --_spacer-align-top: var(--pf-c-modal-box--m-align-top--spacer,
+ --_spacer-align-top: var(--pf-v5-c-modal-box--m-align-top--spacer,
var(--pf-global--spacer--sm, 0.5rem));
--_height-offset: min(var(--_spacer-align-top), var(--pf-global--spacer--2xl, 3rem));
}
@@ -20,7 +20,7 @@ section {
align-items: center;
justify-content: center;
/** Z-index for modal box */
- z-index: var(--pf-c-modal-box--ZIndex,
+ z-index: var(--pf-v5-c-modal-box--ZIndex,
var(--pf-global--ZIndex--xl,
500));
}
@@ -36,7 +36,7 @@ section {
width: 100%;
top: 0;
left: 0;
- background-color: var(--pf-c-backdrop--BackgroundColor,
+ background-color: var(--pf-v5-c-backdrop--BackgroundColor,
var(--pf-global--BackgroundColor--dark-transparent-100,
rgba(3, 3, 3, 0.62)));
}
@@ -46,25 +46,25 @@ section {
margin: 0 auto;
/** Width of modal */
- width: var(--pf-c-modal-box--Width,
+ width: var(--pf-v5-c-modal-box--Width,
calc(100% - var(--pf-global--spacer--xl,2rem)));
/** Max width of modal */
- max-width: var(--pf-c-modal-box--MaxWidth,
+ max-width: var(--pf-v5-c-modal-box--MaxWidth,
calc(100% - var(--pf-global--spacer--xl,2rem)));
/** Max height of modal */
- max-height: var(--pf-c-modal-box--MaxHeight,
+ max-height: var(--pf-v5-c-modal-box--MaxHeight,
calc(100% - var(--pf-global--spacer--2xl,3rem)));
/** Box shadow for modal */
- box-shadow: var(--pf-c-modal-box--BoxShadow,
+ box-shadow: var(--pf-v5-c-modal-box--BoxShadow,
var(--pf-global--BoxShadow--xl,
0 1rem 2rem 0 rgba(3, 3, 3, 0.16),
0 0 0.5rem 0 rgba(3, 3, 3, 0.1)));
/** Background color for modal */
- background-color: var(--pf-c-modal-box--BackgroundColor,
+ background-color: var(--pf-v5-c-modal-box--BackgroundColor,
var(--pf-global--BackgroundColor--100,
var(--pf-global--BackgroundColor--100, #fff)));
@@ -80,26 +80,26 @@ section {
:host([width="small"]) [part=dialog],
:host([variant="small"]) [part=dialog] {
/** Max width for small modal */
- --pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth, 35rem);
+ --pf-v5-c-modal-box--Width: var(--pf-v5-c-modal-box--m-sm--sm--MaxWidth, 35rem);
}
:host([width="medium"]) [part=dialog],
:host([variant="medium"]) [part=dialog] {
/** Max width for medium modal */
- --pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width, 52.5rem);
+ --pf-v5-c-modal-box--Width: var(--pf-v5-c-modal-box--m-md--Width, 52.5rem);
}
:host([width="large"]) [part=dialog],
:host([variant="large"]) [part=dialog] {
/** Max width for large modal */
- --pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth, 70rem);
+ --pf-v5-c-modal-box--Width: var(--pf-v5-c-modal-box--m-lg--lg--MaxWidth, 70rem);
}
[part=content] {
overflow-y: auto;
overscroll-behavior: contain;
- max-height: var(--pf-c-modal-box--MaxHeight,
+ max-height: var(--pf-v5-c-modal-box--MaxHeight,
calc(100vh - var(--pf-global--spacer--2xl,
3rem)));
@@ -113,7 +113,7 @@ section {
header {
position: sticky;
top: 0;
- background-color: var(--pf-c-modal-box--BackgroundColor,
+ background-color: var(--pf-v5-c-modal-box--BackgroundColor,
var(--pf-global--BackgroundColor--100,
var(--pf-global--BackgroundColor--100,
#fff)));
@@ -121,12 +121,12 @@ header {
header ::slotted(:is(h1,h2,h3,h4,h5,h6)[slot="header"]) {
/** Font size for modal title */
- font-size: var(--pf-c-modal-box__title--FontSize,
+ font-size: var(--pf-v5-c-modal-box__title--FontSize,
var(--pf-global--FontSize--2xl,
1.5rem));
font-weight: var(--pf-global--FontWeight--normal, 400);
/** Font family for modal title */
- font-family: var(--pf-c-modal-box__title--FontFamily,
+ font-family: var(--pf-v5-c-modal-box__title--FontFamily,
var(--pf-global--FontFamily--heading--sans-serif,
var(--pf-global--FontFamily--redhat-updated--heading--sans-serif,
"RedHatDisplayUpdated", "Overpass", overpass, helvetica, arial, sans-serif)));
@@ -143,23 +143,23 @@ header ::slotted(:is(h1,h2,h3,h4,h5,h6)[slot="header"]) {
cursor: pointer;
line-height: 24px;
padding-block:
- var(--pf-c-button--PaddingTop,
+ var(--pf-v5-c-button--PaddingTop,
var(--pf-global--spacer--form-element, 0.375rem));
padding-inline:
- var(--pf-c-button--PaddingRight,
+ var(--pf-v5-c-button--PaddingRight,
var(--pf-global--spacer--md, 1rem));
top: 0;
right: calc(var(--pf-global--spacer--lg, 1.5rem) / -3);
- color: var(--pf-c-button--m-plain--Color,
+ color: var(--pf-v5-c-button--m-plain--Color,
var(--pf-global--Color--200,
#6a6e73));
- font-size: var(--pf-c-button--FontSize,
+ font-size: var(--pf-v5-c-button--FontSize,
var(--pf-global--FontSize--md,
1rem));
}
[part=close-button]:is(:focus-within, :focus-visible, :hover) {
- color: var(--pf-c-button--m-plain--focus--Color, var(--pf-global--Color--100, #151515));
+ color: var(--pf-v5-c-button--m-plain--focus--Color, var(--pf-global--Color--100, #151515));
}
[part=close-button] > svg {
@@ -171,20 +171,20 @@ header ::slotted(:is(h1,h2,h3,h4,h5,h6)[slot="header"]) {
:host([position="top"]) #dialog {
align-self: start;
- margin-block: var(--pf-c-modal-box--m-align-top--MarginTop,
- var(--pf-c-modal-box--m-align-top--spacer,
+ margin-block: var(--pf-v5-c-modal-box--m-align-top--MarginTop,
+ var(--pf-v5-c-modal-box--m-align-top--spacer,
2rem));
margin-inline: var(--pf-global--spacer--md, 1rem);
width: 100%;
- max-width: var(--pf-c-modal-box--m-align-top--MaxWidth,
+ max-width: var(--pf-v5-c-modal-box--m-align-top--MaxWidth,
calc(100% - min(
- var(--pf-c-modal-box--m-align-top--spacer, 2rem) * 2,
+ var(--pf-v5-c-modal-box--m-align-top--spacer, 2rem) * 2,
var(--pf-global--spacer--xl, 2rem))));
- max-height: var(--pf-c-modal-box--m-align-top--MaxHeight,
+ max-height: var(--pf-v5-c-modal-box--m-align-top--MaxHeight,
calc(100% - var(--_height-offset) - var(--_spacer-align-top)));
}
diff --git a/elements/pf-modal/pf-modal.ts b/elements/pf-v5-modal/pf-v5-modal.ts
similarity index 98%
rename from elements/pf-modal/pf-modal.ts
rename to elements/pf-v5-modal/pf-v5-modal.ts
index ae7024cfe2..7d83083fa5 100644
--- a/elements/pf-modal/pf-modal.ts
+++ b/elements/pf-v5-modal/pf-v5-modal.ts
@@ -11,7 +11,7 @@ import { getRandomId } from '@patternfly/pfe-core/functions/random.js';
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
-import style from './pf-modal.css';
+import style from './pf-v5-modal.css';
export class ModalCancelEvent extends ComposedEvent {
constructor() {
@@ -42,8 +42,8 @@ export class ModalOpenEvent extends ComposedEvent {
* @fires {ModalOpenEvent} open - Fires when a user clicks on the trigger or manually opens a modal.
* @fires {ModalCloseEvent} close - Fires when either a user clicks on either the close button or the overlay or manually closes a modal.
*/
-@customElement('pf-modal')
-export class PfModal extends LitElement {
+@customElement('pf-v5-modal')
+export class PfV5Modal extends LitElement {
static override readonly shadowRootOptions: ShadowRootInit = {
...LitElement.shadowRootOptions,
delegatesFocus: true,
@@ -229,7 +229,7 @@ export class PfModal extends LitElement {
const { open, overlay, dialog } = this;
if (open) {
const path = event.composedPath();
- const { closeOnOutsideClick } = this.constructor as typeof PfModal;
+ const { closeOnOutsideClick } = this.constructor as typeof PfV5Modal;
if (closeOnOutsideClick && path.includes(overlay!) && !path.includes(dialog!)) {
event.preventDefault();
@@ -315,6 +315,6 @@ export class PfModal extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-modal': PfModal;
+ 'pf-v5-modal': PfV5Modal;
}
}
diff --git a/elements/pf-modal/test/pf-modal.e2e.ts b/elements/pf-v5-modal/test/pf-modal.e2e.ts
similarity index 96%
rename from elements/pf-modal/test/pf-modal.e2e.ts
rename to elements/pf-v5-modal/test/pf-modal.e2e.ts
index 391383f3cf..6191e4c5c0 100644
--- a/elements/pf-modal/test/pf-modal.e2e.ts
+++ b/elements/pf-v5-modal/test/pf-modal.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-modal';
+const tagName = 'pf-v5-modal';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-modal/test/pf-modal.spec.ts b/elements/pf-v5-modal/test/pf-modal.spec.ts
similarity index 82%
rename from elements/pf-modal/test/pf-modal.spec.ts
rename to elements/pf-v5-modal/test/pf-modal.spec.ts
index c1115ca940..4a12e80128 100644
--- a/elements/pf-modal/test/pf-modal.spec.ts
+++ b/elements/pf-v5-modal/test/pf-modal.spec.ts
@@ -1,58 +1,58 @@
import { expect, nextFrame, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { setViewport } from '@web/test-runner-commands';
-import { PfModal } from '@patternfly/elements/pf-modal/pf-modal.js';
+import { PfV5Modal } from '@patternfly/elements/pf-v5-modal/pf-v5-modal.js';
import '@patternfly/pfe-tools/test/stub-logger.js';
// One element, defined here, is used
// in multiple tests. It's torn down and recreated each time.
const TEMPLATES = {
- testElement: html` `,
+ testElement: html` `,
smallModal: html`
-
+
Small modal
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
+
`,
mediumModal: html`
-
+
Medium modal
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
+
`,
largeModal: html`
-
+
Large modal
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
+
`,
};
-describe('', function() {
+describe('', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-modal')).to.be.an.instanceof(PfModal);
+ expect(document.createElement('pf-v5-modal')).to.be.an.instanceof(PfV5Modal);
});
it('should upgrade', async function() {
- const el = await createFixture(TEMPLATES.testElement);
- expect(el, 'pf-modal should be an instance of PfModal')
- .to.be.an.instanceOf(customElements.get('pf-modal'))
+ const el = await createFixture(TEMPLATES.testElement);
+ expect(el, 'pf-v5-modal should be an instance of PfV5Modal')
+ .to.be.an.instanceOf(customElements.get('pf-v5-modal'))
.and
- .to.be.an.instanceOf(PfModal);
+ .to.be.an.instanceOf(PfV5Modal);
});
// Example test.
it('should apply attributes correctly', async function() {
// Use the same markup that's declared at the top of the file.
- const el = await createFixture(html`
-
+ const el = await createFixture(html`
+
Modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
+
`);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
const button = el.shadowRoot!.querySelector('[part=close-button]')!;
@@ -65,12 +65,12 @@ describe('', function() {
});
it('should open the modal window when the trigger is clicked', async function() {
- const el = await createFixture(html`
-
+ const el = await createFixture(html`
+
Modal with a header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- Open a modal
+
+ Open a modal
`);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
const trigger = document.getElementById('trigger')!;
@@ -88,7 +88,7 @@ describe('', function() {
});
it('should remove the hidden attribute from the host on upgrade', async function() {
- const el = await createFixture(TEMPLATES.testElement);
+ const el = await createFixture(TEMPLATES.testElement);
await new Promise(r => setTimeout(r, 25));
// test for the hidden attribute on the host
@@ -102,7 +102,7 @@ describe('', function() {
describe('with variant=small attribute', function() {
it('has small modal width', async function() {
- const el = await createFixture(TEMPLATES.smallModal);
+ const el = await createFixture(TEMPLATES.smallModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -111,7 +111,7 @@ describe('', function() {
describe('with variant=medium attribute', function() {
it('has medium modal width', async function() {
- const el = await createFixture(TEMPLATES.mediumModal);
+ const el = await createFixture(TEMPLATES.mediumModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -120,7 +120,7 @@ describe('', function() {
describe('with variant=large attribute', function() {
it('has large modal width', async function() {
- const el = await createFixture(TEMPLATES.largeModal);
+ const el = await createFixture(TEMPLATES.largeModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -135,7 +135,7 @@ describe('', function() {
describe('with variant=small attribute', function() {
it('has small modal width', async function() {
- const el = await createFixture(TEMPLATES.smallModal);
+ const el = await createFixture(TEMPLATES.smallModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -144,7 +144,7 @@ describe('', function() {
describe('with variant=medium attribute', function() {
it('has medium modal width', async function() {
- const el = await createFixture(TEMPLATES.mediumModal);
+ const el = await createFixture(TEMPLATES.mediumModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -153,7 +153,7 @@ describe('', function() {
describe('with variant=large attribute', function() {
it('has large modal width', async function() {
- const el = await createFixture(TEMPLATES.largeModal);
+ const el = await createFixture(TEMPLATES.largeModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -168,7 +168,7 @@ describe('', function() {
describe('with variant=small attribute', function() {
it('has small modal width', async function() {
- const el = await createFixture(TEMPLATES.smallModal);
+ const el = await createFixture(TEMPLATES.smallModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -177,7 +177,7 @@ describe('', function() {
describe('with variant=medium attribute', function() {
it('has medium modal width', async function() {
- const el = await createFixture(TEMPLATES.mediumModal);
+ const el = await createFixture(TEMPLATES.mediumModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -186,7 +186,7 @@ describe('', function() {
describe('with variant=large attribute', function() {
it('has large modal width', async function() {
- const el = await createFixture(TEMPLATES.largeModal);
+ const el = await createFixture(TEMPLATES.largeModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -201,7 +201,7 @@ describe('', function() {
describe('with variant=small attribute', function() {
it('has small modal width', async function() {
- const el = await createFixture(TEMPLATES.smallModal);
+ const el = await createFixture(TEMPLATES.smallModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -210,7 +210,7 @@ describe('', function() {
describe('with variant=medium attribute', function() {
it('has medium modal width', async function() {
- const el = await createFixture(TEMPLATES.mediumModal);
+ const el = await createFixture(TEMPLATES.mediumModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
@@ -219,7 +219,7 @@ describe('', function() {
describe('with variant=large attribute', function() {
it('has large modal width', async function() {
- const el = await createFixture(TEMPLATES.largeModal);
+ const el = await createFixture(TEMPLATES.largeModal);
const modalWindow = el.shadowRoot!.querySelector('#dialog')!;
expect(getComputedStyle(modalWindow).getPropertyValue('max-width'))
.to.equal('calc(100% - 32px)');
diff --git a/elements/pf-panel/README.md b/elements/pf-v5-panel/README.md
similarity index 80%
rename from elements/pf-panel/README.md
rename to elements/pf-v5-panel/README.md
index f2eeb4dd94..5c2ec71f2d 100644
--- a/elements/pf-panel/README.md
+++ b/elements/pf-v5-panel/README.md
@@ -4,7 +4,7 @@ Panel contains content with optional header and footer content.
## Usage
```html
-
+
Panel content
-
+
```
diff --git a/elements/pf-panel/demo/bordered.html b/elements/pf-v5-panel/demo/bordered.html
similarity index 54%
rename from elements/pf-panel/demo/bordered.html
rename to elements/pf-v5-panel/demo/bordered.html
index 5dc10860a0..1d521901ce 100644
--- a/elements/pf-panel/demo/bordered.html
+++ b/elements/pf-v5-panel/demo/bordered.html
@@ -1,11 +1,11 @@
diff --git a/elements/pf-popover/demo/icons.html b/elements/pf-v5-popover/demo/icons.html
similarity index 60%
rename from elements/pf-popover/demo/icons.html
rename to elements/pf-v5-popover/demo/icons.html
index f29104ed8f..7a299ea8c2 100644
--- a/elements/pf-popover/demo/icons.html
+++ b/elements/pf-v5-popover/demo/icons.html
@@ -1,43 +1,43 @@
Icon attribute
-
- Toggle popover
-
+ Toggle popover
+
Icon slot
-
-
+
+
Popover with icon
Popovers are triggered by click rather than hover.
Popover footer
- Toggle popover
-
+ Toggle popover
+
Custom Icon Set
-
-
+
+
Popover heading
Popovers are triggered by click rather than hover.
Popover footer
- Toggle popover
-
+ Toggle popover
+
-Hover to cite
+Hover to cite
-
+
Richard M. Stallman
Free software is a political movement; open source is a development model.
-
+
```
-
- Lit
-
+
+ Lit
+
```js
import { LitElement, html } from 'lit';
-import '@patternfly/elements/pf-button/pf-button.js';
-import '@patternfly/elements/pf-popover/pf-popover.js';
+import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
+import '@patternfly/elements/pf-v5-popover/pf-v5-popover.js';
class Citer extends LitElement {
render() {
return html`
- Hover to Cite
+ Hover to Cite
-
+
Richard M. Stallman
Free software is a political movement; open source is a development model.
-
+
`;
}
- get #popover() { return this.shadowRoot.querySelector('pf-popover'); }
+ get #popover() { return this.shadowRoot.querySelector('pf-v5-popover'); }
#onMouseover() { this.#popover.show(); }
@@ -87,13 +87,13 @@ class Citer extends LitElement {
}
```
-
- React
-
+
+ React
+
```jsx
-import { Button } from '@patternfly/elements/react/pf-button/pf-button.js';
-import { Popover } from '@patternfly/elements/react/pf-popover/pf-popover.js';
+import { Button } from '@patternfly/elements/react/pf-v5-button/pf-v5-button.js';
+import { Popover } from '@patternfly/elements/react/pf-v5-popover/pf-v5-popover.js';
import { useRef } from 'react';
@@ -117,8 +117,8 @@ export function Citer() {
}
```
-
-
+
+
{% endband %}
{% renderSlots %}{% endrenderSlots %}
diff --git a/elements/pf-popover/docs/screenshot.png b/elements/pf-v5-popover/docs/screenshot.png
similarity index 100%
rename from elements/pf-popover/docs/screenshot.png
rename to elements/pf-v5-popover/docs/screenshot.png
diff --git a/elements/pf-v5-popover/pf-v5-popover.css b/elements/pf-v5-popover/pf-v5-popover.css
new file mode 100644
index 0000000000..621f623a79
--- /dev/null
+++ b/elements/pf-v5-popover/pf-v5-popover.css
@@ -0,0 +1,224 @@
+:host {
+ display: inline;
+ /** Width of the arrow */
+ --_floating-arrow-size: var(--pf-v5-c-popover__arrow--Width, var(--pf-global--arrow--width-lg, 1.5625rem));
+ /** Heading font color */
+ --_header-text-color: var(--pf-v5-c-popover__title-text--Color, inherit);
+ /** Heading icon font color */
+ --_header-icon-color: var(--pf-v5-c-popover__title-icon--Color, var(--pf-global--Color--100, #151515));
+ --_animation-speed: var(--pf-v5-popover--animation-speed, 300ms);
+ --_z-index: var(--pf-v5-popover--z-index, 9999);
+}
+
+.visually-hidden {
+ position: fixed;
+ top: 0;
+ left: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+
+[hidden] {
+ display: none !important;
+}
+
+#container {
+ display: inline-flex;
+ position: relative;
+}
+
+#trigger {
+ display: inline-block;
+ position: relative;
+}
+
+#arrow {
+ display: block;
+ position: absolute;
+ /** Arrow background color */
+ background-color: var(--pf-v5-c-popover__arrow--BackgroundColor, var(--pf-global--BackgroundColor--100, #fff));
+ /** Arrow box shadow */
+ box-shadow: var(
+ --pf-v5-c-popover__arrow--BoxShadow,
+ var(--pf-global--BoxShadow--lg, 0 0.5rem 1rem 0 rgba(3, 3, 3, 0.16), 0 0 0.375rem 0 rgba(3, 3, 3, 0.08))
+ );
+ content: '';
+ /** Height of the arrow */
+ height: var(--pf-v5-c-popover__arrow--Height, var(--pf-global--arrow--width-lg, 1.5625rem));
+ /** Width of the arrow */
+ width: var(--pf-v5-c-popover__arrow--Width, var(--pf-global--arrow--width-lg, 1.5625rem));
+ rotate: 45deg;
+ z-index: -1;
+ pointer-events: none;
+}
+
+#popover {
+ display: block;
+ position: absolute;
+ opacity: 0;
+ z-index: -1;
+ transition: visibility 0s, opacity var(--_animation-speed) cubic-bezier(0.54, 1.5, 0.38, 1.11) 0s;
+ left: 0;
+ top: 0;
+ translate: var(--_floating-content-translate);
+ /** Popover box shadow */
+ box-shadow: var(
+ --pf-v5-c-popover--BoxShadow,
+ var(--pf-global--BoxShadow--lg, 0 0.5rem 1rem 0 rgba(3, 3, 3, 0.16), 0 0 0.375rem 0 rgba(3, 3, 3, 0.08))
+ );
+ border: 0;
+ padding: 0;
+ visibility: hidden;
+}
+
+#popover[open] {
+ opacity: 1;
+ z-index: var(--_z-index);
+ visibility: visible;
+}
+
+[part='content'] {
+ position: relative;
+ /** Popover padding (top, right, bottom, left) */
+ padding: var(--pf-v5-c-popover__content--PaddingTop, var(--pf-global--spacer--md, 1rem))
+ var(--pf-v5-c-popover__content--PaddingRight, var(--pf-global--spacer--md, 1rem))
+ var(--pf-v5-c-popover__content--PaddingBottom, var(--pf-global--spacer--md, 1rem))
+ var(--pf-v5-c-popover__content--PaddingLeft, var(--pf-global--spacer--md, 1rem));
+ word-break: break-word;
+ /** Popover line height */
+ line-height: var(--pf-v5-c-popover--line-height, 1.5);
+ /** Popover font-size */
+ font-size: var(--pf-v5-c-popover__content--FontSize, var(--pf-global--FontSize--sm, 0.875rem));
+ color: var(--pf-v5-c-popover__content--Color, var(--pf-global--Color--100, #151515));
+ /** Popover background color */
+ background-color: var(--pf-v5-c-popover__content--BackgroundColor, var(--pf-global--BackgroundColor--100, #fff));
+ /** Popover max-width */
+ max-width: var(
+ --pf-v5-c-popover--MaxWidth,
+ calc(var(--pf-v5-c-popover__content--PaddingLeft, 1rem) + var(--pf-v5-c-popover__content--PaddingRight, 1rem) + 18.75rem)
+ );
+ /** Popover min-width */
+ min-width: var(
+ --pf-v5-c-popover--MinWidth,
+ calc(var(--pf-v5-c-popover__content--PaddingLeft, 1rem) + var(--pf-v5-c-popover__content--PaddingRight, 1rem) + 18.75rem)
+ );
+ width: max-content;
+}
+
+[part='close-button'] {
+ cursor: pointer;
+ position: absolute;
+ /** Close button right position */
+ right: var(
+ --pf-v5-c-popover--c-button--Right,
+ calc(var(--pf-v5-c-popover__content--PaddingRight, 1rem) - var(--pf-global--spacer--md, 1rem))
+ );
+ /** Close button top position */
+ top: var(
+ --pf-v5-c-popover--c-button--Top,
+ calc(var(--pf-v5-c-popover__content--PaddingTop, 1rem) - var(--pf-global--spacer--form-element, 0.375rem))
+ );
+}
+
+[part='content'] > [part='close-button']:not([hidden]) ~ *:not([hidden]) {
+ /** Padding between close button and its immediate sibling */
+ padding-right: var(--pf-v5-c-popover--c-button--sibling--PaddingRight, var(--pf-global--spacer--2xl, 3rem));
+}
+
+[part='header'] {
+ display: flex;
+ align-items: baseline;
+}
+
+[part='icon'] {
+ color: var(--_header-icon-color);
+ /** Heading icon right margin */
+ margin-right: var(--pf-v5-c-popover__title-icon--MarginRight, var(--pf-global--spacer--sm, 0.5rem));
+}
+
+[part='icon'] ::slotted(*),
+[part='icon'] * {
+ vertical-align: -0.125em;
+}
+
+[part='icon'],
+[part='heading']::slotted(:is(h2, h3, h4, h5, h6)),
+[part='heading'] :is(h2, h3, h4, h5, h6) {
+ /** Header font-size */
+ font-size: var(--pf-v5-c-popover__title--FontSize, var(--pf-global--FontSize--md, 1rem));
+ font-weight: var(--pf-global--FontWeight--normal, 400);
+ --pf-v5-icon--size: var(
+ --pf-v5-c-popover__title--FontSize,
+ var(--pf-global--FontSize--md, var(--pf-global--icon--FontSize--md, 1em))
+ );
+}
+
+[part='heading']::slotted(:is(h2, h3, h4, h5, h6)),
+[part='heading'] :is(h2, h3, h4, h5, h6) {
+ color: var(--_header-text-color);
+ margin-top: 0;
+ /** Header bottom margin */
+ margin-bottom: var(--pf-v5-c-popover__title--MarginBottom, var(--pf-global--spacer--sm, 0.5rem));
+ /** Header line height */
+ line-height: var(--pf-v5-c-popover__title--LineHeight, var(--pf-global--LineHeight--md, 1.5));
+ /** Header font-family */
+ font-family: var(
+ --pf-v5-c-popover__title--FontFamily,
+ var(
+ --pf-global--FontFamily--heading--sans-serif,
+ 'RedHatDisplay',
+ 'Overpass',
+ overpass,
+ helvetica,
+ arial,
+ sans-serif
+ )
+ );
+}
+
+[part='body'] {
+ display: block;
+ word-wrap: break-word;
+}
+
+[part='footer'] {
+ /** Footer top margin */
+ margin-top: var(--pf-v5-c-popover__footer--MarginTop, var(--pf-global--spacer--md, 1rem));
+}
+
+:host([alert-severity='default']) {
+ /** Default alert heading color */
+ --_header-text-color: var(--pf-v5-c-popover--m-default__title-text--Color, var(--pf-global--default-color--300, #003737));
+ /** Default alert icon color */
+ --_header-icon-color: var(--pf-v5-c-popover--m-default__title-icon--Color, var(--pf-global--default-color--200, #009596));
+}
+
+:host([alert-severity='info']) {
+ /** Info alert heading color */
+ --_header-text-color: var(--pf-v5-c-popover--m-info__title-text--Color, var(--pf-global--info-color--200, #002952));
+ /** Info alert icon color */
+ --_header-icon-color: var(--pf-v5-c-popover--m-info__title-icon--Color, var(--pf-global--info-color--100, #2b9af3));
+}
+
+:host([alert-severity='warning']) {
+ /** Warning alert icon color */
+ --_header-icon-color: var(--pf-v5-c-popover--m-warning__title-icon--Color, var(--pf-global--warning-color--100, #f0ab00));
+ /** Warning alert heading color */
+ --_header-text-color: var(--pf-v5-c-popover--m-warning__title-text--Color, var(--pf-global--warning-color--200, #795600));
+}
+
+:host([alert-severity='success']) {
+ /** Success alert icon color */
+ --_header-icon-color: var(--pf-v5-c-popover--m-success__title-icon--Color, var(--pf-global--success-color--100, #3e8635));
+ /** Success alert heading color */
+ --_header-text-color: var(--pf-v5-c-popover--m-success__title-text--Color, var(--pf-global--success-color--200, #1e4f18));
+}
+
+:host([alert-severity='danger']) {
+ /** Danger alert icon color */
+ --_header-icon-color: var(--pf-v5-c-popover--m-danger__title-icon--Color, var(--pf-global--danger-color--100, #c9190b));
+ /** Danger alert heading color */
+ --_header-text-color: var(--pf-v5-c-popover--m-danger__title-text--Color, var(--pf-global--danger-color--200, #a30000));
+}
diff --git a/elements/pf-popover/pf-popover.ts b/elements/pf-v5-popover/pf-v5-popover.ts
similarity index 95%
rename from elements/pf-popover/pf-popover.ts
rename to elements/pf-v5-popover/pf-v5-popover.ts
index d459d46452..cc2c294c46 100644
--- a/elements/pf-popover/pf-popover.ts
+++ b/elements/pf-v5-popover/pf-v5-popover.ts
@@ -13,9 +13,9 @@ import { deprecation } from '@patternfly/pfe-core/decorators/deprecation.js';
import { bound } from '@patternfly/pfe-core/decorators/bound.js';
import { ComposedEvent, StringListConverter } from '@patternfly/pfe-core/core.js';
-import '@patternfly/elements/pf-button/pf-button.js';
+import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
-import styles from './pf-popover.css';
+import styles from './pf-v5-popover.css';
type HeadingLevel = 2 | 3 | 4 | 5 | 6;
@@ -50,11 +50,11 @@ export class PopoverShownEvent extends ComposedEvent {
* @summary Toggle the visibility of helpful or contextual information.
* @alias Popover
*/
-@customElement('pf-popover')
-export class PfPopover extends LitElement {
+@customElement('pf-v5-popover')
+export class PfV5Popover extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
- private static instances = new Set();
+ private static instances = new Set();
private static alertIcons = new Map(Object.entries({
default: 'bell',
@@ -67,7 +67,7 @@ export class PfPopover extends LitElement {
static {
if (!isServer) {
document.addEventListener('click', function(event) {
- for (const instance of PfPopover.instances) {
+ for (const instance of PfV5Popover.instances) {
if (!instance.noOutsideClick) {
instance.#outsideClick(event);
}
@@ -241,7 +241,7 @@ export class PfPopover extends LitElement {
`;
const headerIcon = this.icon
- ?? PfPopover.alertIcons.get(this.alertSeverity as AlertSeverity)
+ ?? PfV5Popover.alertIcons.get(this.alertSeverity as AlertSeverity)
?? '';
return html`
@@ -265,7 +265,7 @@ export class PfPopover extends LitElement {
-
-
+
${!(hasHeading && hasIcon) ? headingSlotWithFallback : html`
@@ -283,9 +283,9 @@ export class PfPopover extends LitElement {
-
+ size="md">
${!this.alertSeverity ? nothing : html`
${this.alertSeverityText ?? `${this.alertSeverity} alert:`} `}
@@ -310,7 +310,7 @@ export class PfPopover extends LitElement {
disconnectedCallback(): void {
super.disconnectedCallback();
- PfPopover.instances.delete(this);
+ PfV5Popover.instances.delete(this);
this.#referenceTrigger?.removeEventListener('click', this.toggle);
this.#referenceTrigger?.removeEventListener('keydown', this.#onKeydown);
}
@@ -395,7 +395,7 @@ export class PfPopover extends LitElement {
});
this._popover?.show();
this.dispatchEvent(new PopoverShownEvent());
- PfPopover.instances.add(this);
+ PfV5Popover.instances.add(this);
}
/**
@@ -406,7 +406,7 @@ export class PfPopover extends LitElement {
await this.#float.hide();
this._popover?.close();
this.dispatchEvent(new PopoverHiddenEvent());
- PfPopover.instances.delete(this);
+ PfV5Popover.instances.delete(this);
this.#hideDialog = true;
this.requestUpdate();
}
@@ -414,6 +414,6 @@ export class PfPopover extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-popover': PfPopover;
+ 'pf-v5-popover': PfV5Popover;
}
}
diff --git a/elements/pf-popover/test/pf-popover.e2e.ts b/elements/pf-v5-popover/test/pf-popover.e2e.ts
similarity index 95%
rename from elements/pf-popover/test/pf-popover.e2e.ts
rename to elements/pf-v5-popover/test/pf-popover.e2e.ts
index 78709c9997..2033dd201e 100644
--- a/elements/pf-popover/test/pf-popover.e2e.ts
+++ b/elements/pf-v5-popover/test/pf-popover.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-popover';
+const tagName = 'pf-v5-popover';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-popover/test/pf-popover.spec.ts b/elements/pf-v5-popover/test/pf-popover.spec.ts
similarity index 86%
rename from elements/pf-popover/test/pf-popover.spec.ts
rename to elements/pf-v5-popover/test/pf-popover.spec.ts
index bd44cd1722..3c8ac3daba 100644
--- a/elements/pf-popover/test/pf-popover.spec.ts
+++ b/elements/pf-v5-popover/test/pf-popover.spec.ts
@@ -2,8 +2,8 @@ import { expect, html, fixture, fixtureCleanup, nextFrame } from '@open-wc/testi
import { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
import { clickElementAtCenter } from '@patternfly/pfe-tools/test/utils.js';
import { sendKeys, resetMouse } from '@web/test-runner-commands';
-import { PfPopover } from '@patternfly/elements/pf-popover/pf-popover.js';
-import { PfButton } from '@patternfly/elements/pf-button/pf-button.js';
+import { PfV5Popover } from '@patternfly/elements/pf-v5-popover/pf-v5-popover.js';
+import { PfV5Button } from '@patternfly/elements/pf-v5-button/pf-v5-button.js';
function press(key: string) {
return async function() {
@@ -11,12 +11,12 @@ function press(key: string) {
};
}
-describe('', function() {
- let element: PfPopover;
+describe('', function() {
+ let element: PfV5Popover;
/** create a simple test fixture */
async function setupSimpleInstance() {
- element = await fixture(html` `);
+ element = await fixture(html` `);
}
/** Wait on the element's update cycle */
@@ -30,7 +30,7 @@ describe('', function() {
}
function resetElement() {
- document.querySelectorAll('pf-popover').forEach(e => e.remove());
+ document.querySelectorAll('pf-v5-popover').forEach(e => e.remove());
// @ts-expect-error: resetting test state, so we don't mind the ts error.
element = undefined;
}
@@ -41,16 +41,16 @@ describe('', function() {
describe('simply instantiating', function() {
beforeEach(setupSimpleInstance);
it('should upgrade', async function() {
- const klass = customElements.get('pf-popover');
+ const klass = customElements.get('pf-v5-popover');
expect(element)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfPopover);
+ .to.be.an.instanceOf(PfV5Popover);
});
it('should be accessible', expectA11yAxe);
it('imperatively instantiates', function() {
- expect(document.createElement('pf-popover'))
- .to.be.an.instanceof(PfPopover);
+ expect(document.createElement('pf-v5-popover'))
+ .to.be.an.instanceof(PfV5Popover);
});
it('should not report anything to assistive technology', async function() {
const snapshot = await a11ySnapshot();
@@ -69,12 +69,12 @@ describe('', function() {
/** create a test fixture with slotted trigger and content attrs */
beforeEach(async function setupPopoverWithSlottedTriggerAndContentAttrs() {
- element = await fixture(html`
- (html`
+
- Toggle popover
-
+ Toggle popover
+
`);
});
@@ -88,12 +88,12 @@ describe('', function() {
describe('tabbing to the trigger', function() {
beforeEach(resetElement);
beforeEach(async function setupPopoverWithSlottedTriggerAndContentAttrs() {
- element = await fixture(html`
- (html`
+
- Toggle popover
-
+ Toggle popover
+
`);
});
@@ -102,7 +102,7 @@ describe('', function() {
beforeEach(updateComplete);
it('doesn\'t steal tab order', function() {
- expect(document.activeElement).to.be.an.instanceof(PfButton);
+ expect(document.activeElement).to.be.an.instanceof(PfV5Button);
});
describe('and pressing Enter', function() {
@@ -156,16 +156,16 @@ describe('', function() {
beforeEach(async function() {
const container = await fixture(html`
-
+ footer="Popover footer">
Toggle popover 1
Toggle popover 2
`);
- element = container.querySelector('pf-popover')!;
+ element = container.querySelector('pf-v5-popover')!;
btn1 = container.querySelector('#btn-1')!;
btn2 = container.querySelector('#btn-2')!;
});
diff --git a/elements/pf-v5-progress-stepper/README.md b/elements/pf-v5-progress-stepper/README.md
new file mode 100644
index 0000000000..c1bf817dc6
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/README.md
@@ -0,0 +1,41 @@
+# PatternFly Elements Progress Stepper
+
+A component that gives the user a visual representation of the current state of
+their progress through an application (typically a multistep form).
+
+Read more about Progress Stepper in the [PatternFly Elements Progress Steps
+documentation][docs].
+
+## Installation
+
+Load `` via CDN:
+
+```html
+
+```
+
+Or, if you are using [NPM](https://npm.im), install it
+
+```bash
+npm install @patternfly/elements
+```
+
+Then once installed, import it to your application:
+
+```js
+import '@patternfly/elements/pf-v5-progress-stepper/pf-v5-progress-stepper.js';
+```
+
+## Usage
+
+```html
+
+ Completed
+ Issue
+ Failure
+ Running
+ Last
+
+```
+
+[docs]: https://patternflyelements.org/components/progress-stepper
diff --git a/elements/pf-v5-progress-stepper/demo/alignment.html b/elements/pf-v5-progress-stepper/demo/alignment.html
new file mode 100644
index 0000000000..77e9fdbfe5
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/demo/alignment.html
@@ -0,0 +1,38 @@
+
+ With alignment
+ Vertical alignment
+ Center alignment
+
+ First Step
+ Second Step
+ Third Step
+
+
+
+
+
+
diff --git a/elements/pf-v5-progress-stepper/demo/compact.html b/elements/pf-v5-progress-stepper/demo/compact.html
new file mode 100644
index 0000000000..4145a1f056
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/demo/compact.html
@@ -0,0 +1,38 @@
+
+ Compact
+ Vertical alignment
+ Center alignment
+
+ First Step
+ Second Step
+ Third Step
+
+
+
+
+
+
diff --git a/elements/pf-v5-progress-stepper/demo/custom-icons.html b/elements/pf-v5-progress-stepper/demo/custom-icons.html
new file mode 100644
index 0000000000..95225c30a8
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/demo/custom-icons.html
@@ -0,0 +1,18 @@
+
+
+ Successful completion
+ In process
+ Pending
+
+
+
+
+
+
diff --git a/elements/pf-v5-progress-stepper/demo/danger.html b/elements/pf-v5-progress-stepper/demo/danger.html
new file mode 100644
index 0000000000..a967fe6679
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/demo/danger.html
@@ -0,0 +1,20 @@
+
+
+ First Step
+ Second Step
+ Third Step
+ Fourth Step
+ Fifth Step
+
+
+
+
+
+
diff --git a/elements/pf-v5-progress-stepper/demo/index.html b/elements/pf-v5-progress-stepper/demo/index.html
new file mode 100644
index 0000000000..b2d3b2f222
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/demo/index.html
@@ -0,0 +1,18 @@
+
+
+ First Step
+ Second Step
+ Third Step
+
+
+
+
+
+
diff --git a/elements/pf-v5-progress-stepper/demo/info.html b/elements/pf-v5-progress-stepper/demo/info.html
new file mode 100644
index 0000000000..aa93f3a16b
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/demo/info.html
@@ -0,0 +1,37 @@
+
+
+ First Step
+ Second Step
+ Third Step
+ Fourth Step
+ Fifth Step
+
+
+
+
+
+
diff --git a/elements/pf-v5-progress-stepper/demo/step-descriptions.html b/elements/pf-v5-progress-stepper/demo/step-descriptions.html
new file mode 100644
index 0000000000..b77dec2d55
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/demo/step-descriptions.html
@@ -0,0 +1,18 @@
+
+
+ First Step
+ Second Step
+ Third Step
+
+
+
+
+
+
diff --git a/elements/pf-progress-stepper/docs/CHANGELOG.old.md b/elements/pf-v5-progress-stepper/docs/CHANGELOG.old.md
similarity index 100%
rename from elements/pf-progress-stepper/docs/CHANGELOG.old.md
rename to elements/pf-v5-progress-stepper/docs/CHANGELOG.old.md
diff --git a/elements/pf-v5-progress-stepper/docs/pf-progress-stepper.md b/elements/pf-v5-progress-stepper/docs/pf-progress-stepper.md
new file mode 100644
index 0000000000..4803153f39
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/docs/pf-progress-stepper.md
@@ -0,0 +1,37 @@
+{% renderInstallation %} {% endrenderInstallation %}
+
+{% renderOverview %}
+
+ Completed
+ Issue
+ Failure
+ Running
+ Last
+
+{% endrenderOverview %}
+
+{% band header="Usage" %}
+ {% htmlexample %}
+
+ Completed
+ Issue
+ Failure
+ Running
+ Last
+
+ {% endhtmlexample %}
+{% endband %}
+
+{% renderSlots %}{% endrenderSlots %}
+
+{% renderSlots for='pf-v5-progress-step', header='Slots on `pf-v5-progress-step`' %}{% endrenderSlots %}
+
+{% renderAttributes %}{% endrenderAttributes %}
+
+{% renderMethods %}{% endrenderMethods %}
+
+{% renderEvents %}{% endrenderEvents %}
+
+{% renderCssCustomProperties %}{% endrenderCssCustomProperties %}
+
+{% renderCssParts %}{% endrenderCssParts %}
diff --git a/elements/pf-progress-stepper/docs/screenshot.png b/elements/pf-v5-progress-stepper/docs/screenshot.png
similarity index 100%
rename from elements/pf-progress-stepper/docs/screenshot.png
rename to elements/pf-v5-progress-stepper/docs/screenshot.png
diff --git a/elements/pf-v5-progress-stepper/pf-v5-progress-step.css b/elements/pf-v5-progress-stepper/pf-v5-progress-step.css
new file mode 100644
index 0000000000..10e2bd49ed
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/pf-v5-progress-step.css
@@ -0,0 +1,124 @@
+[hidden] {
+ display: none !important;
+}
+
+#icon {
+ z-index: var(--pf-v5-c-progress-stepper__step-icon--ZIndex);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--pf-v5-c-progress-stepper__step-icon--Width);
+ height: var(--pf-v5-c-progress-stepper__step-icon--Height);
+ color: var(--pf-v5-c-progress-stepper__step-icon--Color);
+ background-color: var(--pf-v5-c-progress-stepper__step-icon--BackgroundColor);
+ border: var(--pf-v5-c-progress-stepper__step-icon--BorderWidth) solid var(--pf-v5-c-progress-stepper__step-icon--BorderColor);
+ border-radius: 50%;
+ font-size: var(--pf-v5-c-progress-stepper__step-icon--FontSize);
+ --pf-v5-icon--size: 1.125em;
+}
+
+#main {
+ position: var(--pf-v5-c-progress-stepper__step-main--Position, initial);
+ min-width: 0;
+ margin: var(--pf-v5-c-progress-stepper__step-main--MarginTop) var(--pf-v5-c-progress-stepper__step-main--MarginRight) var(--pf-v5-c-progress-stepper__step-main--MarginBottom) var(--pf-v5-c-progress-stepper__step-main--MarginLeft);
+ text-align: var(--pf-v5-c-progress-stepper--step-main--TextAlign, auto);
+ overflow-wrap: anywhere;
+}
+
+:host(:not([current])) #main.compact {
+ position: fixed;
+ top: 0;
+ left: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+ margin-bottom: var(--pf-v5-c-progress-stepper--m-compact__step-main--MarginBottom);
+}
+
+:host([current]) #main.compact {
+ grid-column: 1/-1;
+ grid-row: 1/2;
+}
+
+#title {
+ font-size: var(--pf-v5-c-progress-stepper__step-title--FontSize);
+ font-weight: var(--pf-v5-c-progress-stepper__step-title--FontWeight);
+ color: var(--pf-v5-c-progress-stepper__step-title--Color);
+ text-align: var(--pf-v5-c-progress-stepper__step-title--TextAlign);
+ border: 0;
+}
+
+#description {
+ margin-top: var(--pf-v5-c-progress-stepper__step-description--MarginTop);
+ font-size: var(--pf-v5-c-progress-stepper__step-description--FontSize);
+ color: var(--pf-v5-c-progress-stepper__step-description--Color);
+ text-align: var(--pf-v5-c-progress-stepper__step-description--TextAlign);
+ display: block;
+}
+
+:host {
+ display: contents;
+}
+
+#connector {
+ position: relative;
+ display: flex;
+ justify-content: var(--pf-v5-c-progress-stepper__step-connector--JustifyContent);
+ width: 100%;
+}
+
+#connector.compact {
+ min-width: var(--pf-v5-c-progress-stepper--m-compact__step-connector--MinWidth);
+ grid-row: var(--pf-v5-c-progress-stepper--m-compact__step-connector--GridRow);
+ padding-bottom: var(--pf-v5-c-progress-stepper--m-compact__step-connector--PaddingBottom);
+}
+
+:host(:not(:last-of-type)) #main::before {
+ content: var(--pf-v5-c-progress-stepper__step-main--before--Content);
+ position: absolute;
+ top: calc(100% + var(--pf-v5-c-progress-stepper__step-main--MarginTop));
+ left: calc(50% - var(--pf-v5-c-progress-stepper__step-connector--before--BorderRightWidth) / 2);
+ width: auto;
+ height: calc(var(--pf-v5-c-progress-stepper__step-main--MarginTop) + var(--pf-v5-c-progress-stepper__step-main--MarginBottom));
+ border-right: var(--pf-v5-c-progress-stepper__step-connector--before--BorderRightWidth) solid var(--pf-v5-c-progress-stepper__step-connector--before--BorderRightColor);
+}
+
+:host(:not(:last-of-type)) #connector::before {
+ position: absolute;
+ top: var(--pf-v5-c-progress-stepper__step-connector--before--Top);
+ left: var(--pf-v5-c-progress-stepper__step-connector--before--Left);
+ width: var(--pf-v5-c-progress-stepper__step-connector--before--Width);
+ height: var(--pf-v5-c-progress-stepper__step-connector--before--Height);
+ content: var(--pf-v5-c-progress-stepper__step-connector--before--Content);
+ border-right: var(--pf-v5-c-progress-stepper__step-connector--before--BorderRightWidth) solid var(--pf-v5-c-progress-stepper__step-connector--before--BorderRightColor);
+ border-bottom: var(--pf-v5-c-progress-stepper__step-connector--before--BorderBottomWidth) solid var(--pf-v5-c-progress-stepper__step-connector--before--BorderBottomColor);
+ transform: var(--pf-v5-c-progress-stepper__step-connector--before--Transform);
+}
+
+:host([current]) {
+ --pf-v5-c-progress-stepper__step-title--FontWeight: var(--pf-v5-c-progress-stepper__step--m-current__step-title--FontWeight);
+ --pf-v5-c-progress-stepper__step-title--Color: var(--pf-v5-c-progress-stepper__step--m-current__step-title--Color);
+}
+
+:host([variant="success"]) {
+ --pf-v5-c-progress-stepper__step-icon--Color: var(--pf-global--success-color--100, #3e8635);
+}
+
+:host([variant="info"]) {
+ --pf-v5-c-progress-stepper__step-icon--Color: var(--pf-global--info-color--100, #2b9af3);
+}
+
+:host([variant="warning"]) {
+ --pf-v5-c-progress-stepper__step-icon--Color: var(--pf-global--warning-color--100, #f0ab00);
+}
+
+:host([variant="danger"]) {
+ --pf-v5-c-progress-stepper__step-icon--Color: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-progress-stepper__step-title--Color: var(--pf-v5-c-progress-stepper__step--m-danger__step-title--Color);
+ --pf-v5-c-progress-stepper__step-title--m-help-text--hover--Color: var(--pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--hover--Color);
+ --pf-v5-c-progress-stepper__step-title--m-help-text--focus--Color: var(--pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--focus--Color);
+ --pf-v5-c-progress-stepper__step-title--m-help-text--TextDecorationColor: var(--pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--TextDecorationColor);
+ --pf-v5-c-progress-stepper__step-title--m-help-text--hover--TextDecorationColor: var(--pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--hover--TextDecorationColor);
+ --pf-v5-c-progress-stepper__step-title--m-help-text--focus--TextDecorationColor: var(--pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--focus--TextDecorationColor);
+}
diff --git a/elements/pf-progress-stepper/pf-progress-step.ts b/elements/pf-v5-progress-stepper/pf-v5-progress-step.ts
similarity index 81%
rename from elements/pf-progress-stepper/pf-progress-step.ts
rename to elements/pf-v5-progress-stepper/pf-v5-progress-step.ts
index 6ebe9e2a1f..421e9497d6 100644
--- a/elements/pf-progress-stepper/pf-progress-step.ts
+++ b/elements/pf-v5-progress-stepper/pf-v5-progress-step.ts
@@ -1,5 +1,5 @@
import type { PropertyValues, TemplateResult } from 'lit';
-import type { PfProgressStepper } from './pf-progress-stepper.js';
+import type { PfV5ProgressStepper } from './pf-v5-progress-stepper.js';
import { LitElement, html } from 'lit';
import { customElement } from 'lit/decorators/custom-element.js';
@@ -10,7 +10,7 @@ import { classMap } from 'lit/directives/class-map.js';
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
import { InternalsController } from '@patternfly/pfe-core/controllers/internals-controller.js';
-import style from './pf-progress-step.css';
+import style from './pf-v5-progress-step.css';
const ICONS = new Map(Object.entries({
success: { icon: 'check-circle' },
@@ -27,9 +27,9 @@ const ICONS = new Map(Object.entries({
* @slot icon
* Overrides the icon property
*/
-@customElement('pf-progress-step')
-export class PfProgressStep extends LitElement {
- protected static parentTagName = 'pf-progress-stepper';
+@customElement('pf-v5-progress-step')
+export class PfV5ProgressStep extends LitElement {
+ protected static parentTagName = 'pf-v5-progress-stepper';
static readonly styles: CSSStyleSheet[] = [style];
@@ -56,14 +56,14 @@ export class PfProgressStep extends LitElement {
const hasDescription = !!(this.description ?? this.#slots.hasSlotted('description'));
const icon = this.icon ?? ICONS.get(this.variant ?? 'default')?.icon;
const set = this.iconSet ?? ICONS.get(this.variant ?? 'default')?.set;
- const { parentTagName } = (this.constructor as typeof PfProgressStep);
- const { compact = false } = this.closest?.(parentTagName) ?? {};
+ const { parentTagName } = (this.constructor as typeof PfV5ProgressStep);
+ const { compact = false } = this.closest?.(parentTagName) ?? {};
return html`
-
+ set="${ifDefined(set)}">
@@ -82,6 +82,6 @@ export class PfProgressStep extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-progress-step': PfProgressStep;
+ 'pf-v5-progress-step': PfV5ProgressStep;
}
}
diff --git a/elements/pf-v5-progress-stepper/pf-v5-progress-stepper.css b/elements/pf-v5-progress-stepper/pf-v5-progress-stepper.css
new file mode 100644
index 0000000000..08765561a2
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/pf-v5-progress-stepper.css
@@ -0,0 +1,324 @@
+[hidden] {
+ display: none !important;
+}
+
+:host {
+ /** Grid auto flow for vertical layout */
+ --pf-v5-c-progress-stepper--m-vertical--GridAutoFlow: row;
+ /** Grid template columns for vertical layout */
+ --pf-v5-c-progress-stepper--m-vertical--GridTemplateColumns: auto 1fr;
+ /** Top position for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--Top: 0;
+ /** Left position for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--Left: calc(var(--pf-v5-c-progress-stepper__step-icon--Width) / 2);
+ /** Width for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--Width: auto;
+ /** Height for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--Height: 100%;
+ /** Right border width for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderRightWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Right border color for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderRightColor: var(--pf-global--BorderColor--100, #d2d2d2);
+ /** Bottom border width for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderBottomWidth: 0;
+ /** Bottom border color for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderBottomColor: transparent;
+ /** Transform for vertical step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-vertical__step-connector--before--Transform: translateX(-50%);
+ /** Top margin for vertical step main content */
+ --pf-v5-c-progress-stepper--m-vertical__step-main--MarginTop: var(--pf-global--spacer--xs, 0.25rem);
+ /** Right margin for vertical step main content */
+ --pf-v5-c-progress-stepper--m-vertical__step-main--MarginRight: 0;
+ /** Bottom margin for vertical step main content */
+ --pf-v5-c-progress-stepper--m-vertical__step-main--MarginBottom: var(--pf-global--spacer--xl, 2rem);
+ /** Left margin for vertical step main content */
+ --pf-v5-c-progress-stepper--m-vertical__step-main--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+ /** Grid template columns for vertical compact layout */
+ --pf-v5-c-progress-stepper--m-vertical--m-compact--GridTemplateColumns: 1fr;
+ /** Padding bottom for vertical compact step connector */
+ --pf-v5-c-progress-stepper--m-vertical--m-compact__step-connector--PaddingBottom: var(--pf-global--spacer--xs, 0.25rem);
+ /** Grid row for vertical compact step connector */
+ --pf-v5-c-progress-stepper--m-vertical--m-compact__step-connector--GridRow: auto;
+ /** Right margin for vertical compact step main content */
+ --pf-v5-c-progress-stepper--m-vertical--m-compact__step-main--MarginRight: 0;
+ /** Right margin for vertical centered step main content */
+ --pf-v5-c-progress-stepper--m-vertical--m-center__step-main--MarginRight: 0;
+ /** Left margin for vertical centered step main content */
+ --pf-v5-c-progress-stepper--m-vertical--m-center__step-main--MarginLeft: 0;
+ /** Grid auto flow for horizontal layout */
+ --pf-v5-c-progress-stepper--m-horizontal--GridAutoFlow: column;
+ /** Grid template columns for horizontal layout */
+ --pf-v5-c-progress-stepper--m-horizontal--GridTemplateColumns: initial;
+ /** Top position for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Top: calc(var(--pf-v5-c-progress-stepper__step-icon--Height) / 2);
+ /** Left position for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Left: 0;
+ /** Width for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Width: 100%;
+ /** Height for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Height: auto;
+ /** Right border width for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--BorderRightWidth: 0;
+ /** Right border color for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--BorderRightColor: unset;
+ /** Bottom border width for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Bottom border color for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--BorderBottomColor: var(--pf-global--BorderColor--100, #d2d2d2);
+ /** Transform for horizontal step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Transform: translateY(-50%);
+ /** Top margin for horizontal step main content */
+ --pf-v5-c-progress-stepper--m-horizontal__step-main--MarginTop: var(--pf-global--spacer--xs, 0.25rem);
+ /** Right margin for horizontal step main content */
+ --pf-v5-c-progress-stepper--m-horizontal__step-main--MarginRight: var(--pf-global--spacer--xs, 0.25rem);
+ /** Bottom margin for horizontal step main content */
+ --pf-v5-c-progress-stepper--m-horizontal__step-main--MarginBottom: 0;
+ /** Left margin for horizontal step main content */
+ --pf-v5-c-progress-stepper--m-horizontal__step-main--MarginLeft: 0;
+ /** Grid template columns for horizontal compact layout */
+ --pf-v5-c-progress-stepper--m-horizontal--m-compact--GridTemplateColumns: repeat(auto-fill, 1.75rem);
+ /** Padding bottom for horizontal compact step connector */
+ --pf-v5-c-progress-stepper--m-horizontal--m-compact__step-connector--PaddingBottom: 0;
+ /** Grid row for horizontal compact step connector */
+ --pf-v5-c-progress-stepper--m-horizontal--m-compact__step-connector--GridRow: 2;
+ /** Grid auto flow for compact layout */
+ --pf-v5-c-progress-stepper--m-compact--GridAutoFlow: row;
+ /** Top margin for compact step main content */
+ --pf-v5-c-progress-stepper--m-compact__step-main--MarginTop: 0;
+ /** Bottom margin for compact step main content */
+ --pf-v5-c-progress-stepper--m-compact__step-main--MarginBottom: var(--pf-global--spacer--xs, 0.25rem);
+ /** Minimum width for compact step connector */
+ --pf-v5-c-progress-stepper--m-compact__step-connector--MinWidth: 1.75rem;
+ /** Width for compact step icon */
+ --pf-v5-c-progress-stepper--m-compact__step-icon--Width: 1.125rem;
+ /** Font size for compact step icon */
+ --pf-v5-c-progress-stepper--m-compact__step-icon--FontSize: var(--pf-global--icon--FontSize--sm, 0.625rem);
+ /** Font size for compact step title */
+ --pf-v5-c-progress-stepper--m-compact__step-title--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ /** Font weight for compact step title */
+ --pf-v5-c-progress-stepper--m-compact__step-title--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ /** Top margin for compact pficon */
+ --pf-v5-c-progress-stepper--m-compact__pficon--MarginTop: 2px;
+ /** Top margin for compact exclamation triangle icon */
+ --pf-v5-c-progress-stepper--m-compact__fa-exclamation-triangle--MarginTop: -3px;
+ /** Left position for centered step connector pseudo-element */
+ --pf-v5-c-progress-stepper--m-center__step-connector--before--Left: 50%;
+ /** Grid template columns for centered layout */
+ --pf-v5-c-progress-stepper--m-center--GridTemplateColumns: 1fr;
+ /** Justify content for centered step connector */
+ --pf-v5-c-progress-stepper--m-center__step-connector--JustifyContent: center;
+ /** Right margin for centered step main content */
+ --pf-v5-c-progress-stepper--m-center__step-main--MarginRight: var(--pf-global--spacer--xs, 0.25rem);
+ /** Left margin for centered step main content */
+ --pf-v5-c-progress-stepper--m-center__step-main--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+ /** Text alignment for centered step main content */
+ --pf-v5-c-progress-stepper--m-center__step-main--TextAlign: center;
+ /** Right margin for centered step description */
+ --pf-v5-c-progress-stepper--m-center__step-description--MarginRight: 0;
+ /** Left margin for centered step description */
+ --pf-v5-c-progress-stepper--m-center__step-description--MarginLeft: 0;
+ /** Grid template rows */
+ --pf-v5-c-progress-stepper--GridTemplateRows: auto 1fr;
+ /** Justify content for step connector */
+ --pf-v5-c-progress-stepper__step-connector--JustifyContent: start;
+ /** Z-index for step icon */
+ --pf-v5-c-progress-stepper__step-icon--ZIndex: var(--pf-global--ZIndex--xs, 100);
+ /** Width of the step icon */
+ --pf-v5-c-progress-stepper__step-icon--Width: 1.75rem;
+ /** Height of the step icon */
+ --pf-v5-c-progress-stepper__step-icon--Height: var(--pf-v5-c-progress-stepper__step-icon--Width);
+ /** Font size of the step icon */
+ --pf-v5-c-progress-stepper__step-icon--FontSize: var(--pf-global--FontSize--md, 1rem);
+ /** Color of the step icon */
+ --pf-v5-c-progress-stepper__step-icon--Color: var(--pf-global--Color--100, #151515);
+ /** Background color of the step icon */
+ --pf-v5-c-progress-stepper__step-icon--BackgroundColor: var(--pf-global--BackgroundColor--light-200, #fafafa);
+ /** Border width of the step icon */
+ --pf-v5-c-progress-stepper__step-icon--BorderWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Border color of the step icon */
+ --pf-v5-c-progress-stepper__step-icon--BorderColor: var(--pf-global--BorderColor--100, #d2d2d2);
+ /** Top margin for pficon */
+ --pf-v5-c-progress-stepper__pficon--MarginTop: 3px;
+ /** Top margin for exclamation triangle icon */
+ --pf-v5-c-progress-stepper__fa-exclamation-triangle--MarginTop: -5px;
+ /** Color of the step title */
+ --pf-v5-c-progress-stepper__step-title--Color: var(--pf-global--Color--100, #151515);
+ /** Text alignment of the step title */
+ --pf-v5-c-progress-stepper__step-title--TextAlign: left;
+ /** Font size of the step title */
+ --pf-v5-c-progress-stepper__step-title--FontSize: var(--pf-global--FontSize--md, 1rem);
+ /** Font weight of the step title */
+ --pf-v5-c-progress-stepper__step-title--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ /** Font weight for current step title */
+ --pf-v5-c-progress-stepper__step--m-current__step-title--FontWeight: var(--pf-global--FontWeight--bold, 700);
+ /** Color for current step title */
+ --pf-v5-c-progress-stepper__step--m-current__step-title--Color: var(--pf-global--Color--100, #151515);
+ /** Color for pending step title */
+ --pf-v5-c-progress-stepper__step--m-pending__step-title--Color: var(--pf-global--Color--200, #6a6e73);
+ /** Color for danger step title */
+ --pf-v5-c-progress-stepper__step--m-danger__step-title--Color: var(--pf-global--danger-color--100, #c9190b);
+ /** Text decoration color for help text step title */
+ --pf-v5-c-progress-stepper__step-title--m-help-text--TextDecorationColor: var(--pf-global--BorderColor--200, #8a8d90);
+ /** Text decoration thickness for help text step title */
+ --pf-v5-c-progress-stepper__step-title--m-help-text--TextDecorationThickness: var(--pf-global--BorderWidth--sm, 1px);
+ /** Text underline offset for help text step title */
+ --pf-v5-c-progress-stepper__step-title--m-help-text--TextUnderlineOffset: 0.25rem;
+ /** Text decoration color for help text step title on hover */
+ --pf-v5-c-progress-stepper__step-title--m-help-text--hover--TextDecorationColor: var(--pf-global--Color--100, #151515);
+ /** Text decoration color for help text step title on focus */
+ --pf-v5-c-progress-stepper__step-title--m-help-text--focus--TextDecorationColor: var(--pf-global--Color--100, #151515);
+ /** Color for help text step title on hover */
+ --pf-v5-c-progress-stepper__step-title--m-help-text--hover--Color: var(--pf-global--Color--100, #151515);
+ /** Color for help text step title on focus */
+ --pf-v5-c-progress-stepper__step-title--m-help-text--focus--Color: var(--pf-global--Color--100, #151515);
+ /** Color for danger help text step title on hover */
+ --pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--hover--Color: var(--pf-global--danger-color--200, #a30000);
+ /** Color for danger help text step title on focus */
+ --pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--focus--Color: var(--pf-global--danger-color--200, #a30000);
+ /** Text decoration color for danger help text step title */
+ --pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--TextDecorationColor: var(--pf-global--danger-color--100, #c9190b);
+ /** Text decoration color for danger help text step title on hover */
+ --pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--hover--TextDecorationColor: var(--pf-global--danger-color--200, #a30000);
+ /** Text decoration color for danger help text step title on focus */
+ --pf-v5-c-progress-stepper__step--m-danger__step-title--m-help-text--focus--TextDecoerationColor: var(--pf-global--danger-color--200, #a30000);
+ /** Top margin for step description */
+ --pf-v5-c-progress-stepper__step-description--MarginTop: var(--pf-global--spacer--xs, 0.25rem);
+ /** Font size of the step description */
+ --pf-v5-c-progress-stepper__step-description--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ /** Color of the step description */
+ --pf-v5-c-progress-stepper__step-description--Color: var(--pf-global--Color--200, #6a6e73);
+ /** Text alignment of the step description */
+ --pf-v5-c-progress-stepper__step-description--TextAlign: left;
+ /** Grid auto flow (defaults to vertical) */
+ --pf-v5-c-progress-stepper--GridAutoFlow: var(--pf-v5-c-progress-stepper--m-vertical--GridAutoFlow);
+ /** Grid template columns (defaults to vertical) */
+ --pf-v5-c-progress-stepper--GridTemplateColumns: var(--pf-v5-c-progress-stepper--m-vertical--GridTemplateColumns);
+ /** Top position for step connector pseudo-element (defaults to vertical) */
+ --pf-v5-c-progress-stepper__step-connector--before--Top: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Top);
+ --pf-v5-c-progress-stepper__step-connector--before--Left: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Left);
+ --pf-v5-c-progress-stepper__step-connector--before--Width: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Width);
+ --pf-v5-c-progress-stepper__step-connector--before--Height: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Height);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderRightWidth: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderRightWidth);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderRightColor: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderRightColor);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderBottomWidth: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderBottomWidth);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderBottomColor: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderBottomColor);
+ --pf-v5-c-progress-stepper__step-connector--before--Transform: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Transform);
+ --pf-v5-c-progress-stepper__step-main--MarginTop: var(--pf-v5-c-progress-stepper--m-vertical__step-main--MarginTop);
+ --pf-v5-c-progress-stepper__step-main--MarginRight: var(--pf-v5-c-progress-stepper--m-vertical__step-main--MarginRight);
+ --pf-v5-c-progress-stepper__step-main--MarginBottom: var(--pf-v5-c-progress-stepper--m-vertical__step-main--MarginBottom);
+ --pf-v5-c-progress-stepper__step-main--MarginLeft: var(--pf-v5-c-progress-stepper--m-vertical__step-main--MarginLeft);
+ --pf-v5-c-progress-stepper--m-compact--GridTemplateColumns: var(--pf-v5-c-progress-stepper--m-vertical--m-compact--GridTemplateColumns);
+ --pf-v5-c-progress-stepper--m-compact__step-connector--GridRow: var(--pf-v5-c-progress-stepper--m-vertical--m-compact__step-connector--GridRow);
+ --pf-v5-c-progress-stepper--m-compact__step-connector--PaddingBottom: var(--pf-v5-c-progress-stepper--m-vertical--m-compact__step-connector--PaddingBottom);
+ --pf-v5-c-progress-stepper--m-center__step-connector--before--Content: none;
+ --pf-v5-c-progress-stepper--m-center__step-main--before--Content: '';
+ --pf-v5-c-progress-stepper__step-connector--before--Content: '';
+ --pf-v5-c-progress-stepper__step-main--before--Content: none;
+ position: relative;
+ display: grid;
+ grid-auto-flow: var(--pf-v5-c-progress-stepper--GridAutoFlow);
+ grid-template-columns: var(--pf-v5-c-progress-stepper--GridTemplateColumns);
+ grid-template-rows: var(--pf-v5-c-progress-stepper--GridTemplateRows);
+ grid-auto-columns: 1fr;
+}
+
+@media (min-width: 768px) {
+ :host {
+ --pf-v5-c-progress-stepper--GridAutoFlow: var(--pf-v5-c-progress-stepper--m-horizontal--GridAutoFlow, column);
+ --pf-v5-c-progress-stepper--GridTemplateColumns: var(--pf-v5-c-progress-stepper--m-horizontal--GridTemplateColumns, initial);
+ --pf-v5-c-progress-stepper__step-connector--before--Top: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Top);
+ --pf-v5-c-progress-stepper__step-connector--before--Left: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Left);
+ --pf-v5-c-progress-stepper__step-connector--before--Width: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Width);
+ --pf-v5-c-progress-stepper__step-connector--before--Height: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Height);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderRightWidth: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--BorderRightWidth);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderRightColor: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--BorderRightColor);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderBottomWidth: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--BorderBottomWidth);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderBottomColor: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--BorderBottomColor);
+ --pf-v5-c-progress-stepper__step-connector--before--Transform: var(--pf-v5-c-progress-stepper--m-horizontal__step-connector--before--Transform);
+ --pf-v5-c-progress-stepper__step-main--MarginTop: var(--pf-v5-c-progress-stepper--m-horizontal__step-main--MarginTop);
+ --pf-v5-c-progress-stepper__step-main--MarginRight: var(--pf-v5-c-progress-stepper--m-horizontal__step-main--MarginRight);
+ --pf-v5-c-progress-stepper__step-main--MarginBottom: var(--pf-v5-c-progress-stepper--m-horizontal__step-main--MarginBottom);
+ --pf-v5-c-progress-stepper__step-main--MarginLeft: var(--pf-v5-c-progress-stepper--m-horizontal__step-main--MarginLeft);
+ --pf-v5-c-progress-stepper--m-compact--GridTemplateColumns: var(--pf-v5-c-progress-stepper--m-horizontal--m-compact--GridTemplateColumns);
+ --pf-v5-c-progress-stepper--m-compact__step-connector--GridRow: var(--pf-v5-c-progress-stepper--m-horizontal--m-compact__step-connector--GridRow);
+ --pf-v5-c-progress-stepper--m-compact__step-connector--PaddingBottom: var(--pf-v5-c-progress-stepper--m-horizontal--m-compact__step-connector--PaddingBottom);
+ --pf-v5-c-progress-stepper__step-connector--before--Content: var(--pf-v5-c-progress-stepper--m-center__step-connector--before--Content);
+ --pf-v5-c-progress-stepper__step-main--before--Content: var(--pf-v5-c-progress-stepper--m-center__step-main--before--Content);
+ --pf-v5-c-progress-stepper--m-center__step-connector--before--Content: '';
+ --pf-v5-c-progress-stepper--m-center__step-main--before--Content: none;
+ }
+}
+
+:host([center]) {
+ --pf-v5-c-progress-stepper__step-connector--JustifyContent: var(--pf-v5-c-progress-stepper--m-center__step-connector--JustifyContent);
+ --pf-v5-c-progress-stepper__step-main--MarginRight: var(--pf-v5-c-progress-stepper--m-center__step-main--MarginRight);
+ --pf-v5-c-progress-stepper__step-main--MarginLeft: var(--pf-v5-c-progress-stepper--m-center__step-main--MarginLeft);
+ --pf-v5-c-progress-stepper--step-main--TextAlign: var(--pf-v5-c-progress-stepper--m-center__step-main--TextAlign, auto);
+ --pf-v5-c-progress-stepper__step-title--TextAlign: var(--pf-v5-c-progress-stepper--m-center__step-title--TextAlign, auto);
+ --pf-v5-c-progress-stepper__step-description--MarginRight: var(--pf-v5-c-progress-stepper--m-center__step-description--MarginRight);
+ --pf-v5-c-progress-stepper__step-description--MarginLeft: var(--pf-v5-c-progress-stepper--m-center__step-description--MarginLeft);
+ --pf-v5-c-progress-stepper__step-description--TextAlign: var(--pf-v5-c-progress-stepper--m-center__step-description--TextAlign, auto);
+ --pf-v5-c-progress-stepper--m-vertical__step-main--MarginRight: var(--pf-v5-c-progress-stepper--m-vertical--m-center__step-main--MarginRight);
+ --pf-v5-c-progress-stepper--m-vertical__step-main--MarginLeft: var(--pf-v5-c-progress-stepper--m-vertical--m-center__step-main--MarginLeft);
+ --pf-v5-c-progress-stepper__step-connector--before--Content: var(--pf-v5-c-progress-stepper--m-center__step-connector--before--Content);
+ --pf-v5-c-progress-stepper__step-main--before--Content: var(--pf-v5-c-progress-stepper--m-center__step-main--before--Content);
+ --pf-v5-c-progress-stepper__step-connector--before--Left: var(--pf-v5-c-progress-stepper--m-center__step-connector--before--Left);
+
+ grid-template-columns: var(--pf-v5-c-progress-stepper--m-center--GridTemplateColumns);
+}
+
+:host([center]:not([compact])) {
+ --pf-v5-c-progress-stepper__step-main--before--Content: var(--pf-v5-c-progress-stepper--m-center__step-main--before--Content);
+ --pf-v5-c-progress-stepper__step-connector--before--Content: var(--pf-v5-c-progress-stepper--m-center__step-connector--before--Content);
+}
+
+:host([vertical]) ::slotted(pf-v5-progress-step) {
+ flex-direction: row;
+ align-items: flex-start;
+}
+
+:host([vertical]) {
+ --pf-v5-c-progress-stepper--GridAutoFlow: var(--pf-v5-c-progress-stepper--m-vertical--GridAutoFlow);
+ --pf-v5-c-progress-stepper--GridTemplateColumns: var(--pf-v5-c-progress-stepper--m-vertical--GridTemplateColumns);
+ --pf-v5-c-progress-stepper__step-connector--before--Top: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Top);
+ --pf-v5-c-progress-stepper__step-connector--before--Left: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Left);
+ --pf-v5-c-progress-stepper__step-connector--before--Width: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Width);
+ --pf-v5-c-progress-stepper__step-connector--before--Height: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Height);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderRightWidth: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderRightWidth);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderRightColor: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderRightColor);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderBottomWidth: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderBottomWidth);
+ --pf-v5-c-progress-stepper__step-connector--before--BorderBottomColor: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--BorderBottomColor);
+ --pf-v5-c-progress-stepper__step-connector--before--Transform: var(--pf-v5-c-progress-stepper--m-vertical__step-connector--before--Transform);
+ --pf-v5-c-progress-stepper__step-main--MarginTop: var(--pf-v5-c-progress-stepper--m-vertical__step-main--MarginTop);
+ --pf-v5-c-progress-stepper__step-main--MarginRight: var(--pf-v5-c-progress-stepper--m-vertical__step-main--MarginRight);
+ --pf-v5-c-progress-stepper__step-main--MarginBottom: var(--pf-v5-c-progress-stepper--m-vertical__step-main--MarginBottom);
+ --pf-v5-c-progress-stepper__step-main--MarginLeft: var(--pf-v5-c-progress-stepper--m-vertical__step-main--MarginLeft);
+ --pf-v5-c-progress-stepper--m-compact--GridTemplateColumns: var(--pf-v5-c-progress-stepper--m-vertical--m-compact--GridTemplateColumns);
+ --pf-v5-c-progress-stepper--m-compact__step-connector--GridRow: var(--pf-v5-c-progress-stepper--m-vertical--m-compact__step-connector--GridRow);
+ --pf-v5-c-progress-stepper--m-compact__step-connector--PaddingBottom: var(--pf-v5-c-progress-stepper--m-vertical--m-compact__step-connector--PaddingBottom);
+ --pf-v5-c-progress-stepper__step-connector--before--Content: '';
+ --pf-v5-c-progress-stepper__step-main--before--Content: none;
+ --pf-v5-c-progress-stepper--m-center__step-connector--before--Content: none;
+ --pf-v5-c-progress-stepper--m-center__step-main--before--Content: '';
+ --pf-v5-c-progress-stepper__step-main--Position: relative;
+}
+
+:host([vertical][center]) {
+ --pf-v5-c-progress-stepper__step-connector--before--Left: var(--pf-v5-c-progress-stepper--m-center__step-connector--before--Left);
+}
+
+:host([compact]) {
+ --pf-v5-c-progress-stepper__step-main--MarginTop: var(--pf-v5-c-progress-stepper--m-compact__step-main--MarginTop);
+ --pf-v5-c-progress-stepper__step-main--MarginBottom: var(--pf-v5-c-progress-stepper--m-compact__step-main--MarginBottom);
+ --pf-v5-c-progress-stepper__step-icon--Width: var(--pf-v5-c-progress-stepper--m-compact__step-icon--Width);
+ --pf-v5-c-progress-stepper__step-icon--FontSize: var(--pf-v5-c-progress-stepper--m-compact__step-icon--FontSize);
+ --pf-v5-c-progress-stepper__step-title--FontSize: var(--pf-v5-c-progress-stepper--m-compact__step-title--FontSize);
+ --pf-v5-c-progress-stepper__step--m-current__step-title--FontWeight: var(--pf-v5-c-progress-stepper--m-compact__step-title--FontWeight);
+ --pf-v5-c-progress-stepper__pficon--MarginTop: var(--pf-v5-c-progress-stepper--m-compact__pficon--MarginTop);
+ --pf-v5-c-progress-stepper__fa-exclamation-triangle--MarginTop: var(--pf-v5-c-progress-stepper--m-compact__fa-exclamation-triangle--MarginTop);
+ --pf-v5-c-progress-stepper--m-vertical__step-main--MarginLeft: var(--pf-v5-c-progress-stepper--m-vertical--m-compact__step-main--MarginLeft);
+ --pf-v5-c-progress-stepper--m-vertical__step-main--MarginRight: var(--pf-v5-c-progress-stepper--m-vertical--m-compact__step-main--MarginRight);
+ display: inline-grid;
+ grid-template-columns: var(--pf-v5-c-progress-stepper--m-compact--GridTemplateColumns);
+ grid-auto-flow: var(--pf-v5-c-progress-stepper--m-compact--GridAutoFlow);
+}
diff --git a/elements/pf-progress-stepper/pf-progress-stepper.ts b/elements/pf-v5-progress-stepper/pf-v5-progress-stepper.ts
similarity index 71%
rename from elements/pf-progress-stepper/pf-progress-stepper.ts
rename to elements/pf-v5-progress-stepper/pf-v5-progress-stepper.ts
index e82097e188..ff4eb936eb 100644
--- a/elements/pf-progress-stepper/pf-progress-stepper.ts
+++ b/elements/pf-v5-progress-stepper/pf-v5-progress-stepper.ts
@@ -2,20 +2,20 @@ import { LitElement, html, type PropertyValues, type TemplateResult } from 'lit'
import { customElement } from 'lit/decorators/custom-element.js';
import { property } from 'lit/decorators/property.js';
-import style from './pf-progress-stepper.css';
+import style from './pf-v5-progress-stepper.css';
-import { PfProgressStep } from './pf-progress-step.js';
+import { PfV5ProgressStep } from './pf-v5-progress-step.js';
import { InternalsController } from '@patternfly/pfe-core/controllers/internals-controller.js';
-import '@patternfly/elements/pf-icon/pf-icon.js';
+import '@patternfly/elements/pf-v5-icon/pf-v5-icon.js';
/**
* A **progress stepper** displays a timeline of tasks in a workflow and tracks the user's current progress through this workflow.
* @alias Progress Stepper
*/
-@customElement('pf-progress-stepper')
-export class PfProgressStepper extends LitElement {
- protected static childTagName = 'pf-progress-step';
+@customElement('pf-v5-progress-stepper')
+export class PfV5ProgressStepper extends LitElement {
+ protected static childTagName = 'pf-v5-progress-step';
static readonly styles: CSSStyleSheet[] = [style];
@@ -38,10 +38,10 @@ export class PfProgressStepper extends LitElement {
#mo = new MutationObserver(() => this.#onMutation());
get value(): number {
- const { childTagName } = (this.constructor as typeof PfProgressStepper);
- const steps = this.querySelectorAll?.
(childTagName) ?? [];
+ const { childTagName } = (this.constructor as typeof PfV5ProgressStepper);
+ const steps = this.querySelectorAll?.(childTagName) ?? [];
const current = this.querySelector?.(`${childTagName}[current]`);
- const n = Array.from(steps).indexOf(current as PfProgressStep) + 1;
+ const n = Array.from(steps).indexOf(current as PfV5ProgressStep) + 1;
return (n / steps.length) * 100;
}
@@ -62,13 +62,13 @@ export class PfProgressStepper extends LitElement {
updated(changed: PropertyValues): void {
if (changed.has('compact')) {
- this.querySelectorAll?.('pf-progress-step').forEach(step => step.requestUpdate());
+ this.querySelectorAll?.('pf-v5-progress-step').forEach(step => step.requestUpdate());
}
}
}
declare global {
interface HTMLElementTagNameMap {
- 'pf-progress-stepper': PfProgressStepper;
+ 'pf-v5-progress-stepper': PfV5ProgressStepper;
}
}
diff --git a/elements/pf-progress-stepper/test/pf-progress-stepper.e2e.ts b/elements/pf-v5-progress-stepper/test/pf-progress-stepper.e2e.ts
similarity index 94%
rename from elements/pf-progress-stepper/test/pf-progress-stepper.e2e.ts
rename to elements/pf-v5-progress-stepper/test/pf-progress-stepper.e2e.ts
index c218f62249..9686044a19 100644
--- a/elements/pf-progress-stepper/test/pf-progress-stepper.e2e.ts
+++ b/elements/pf-v5-progress-stepper/test/pf-progress-stepper.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-progress-stepper';
+const tagName = 'pf-v5-progress-stepper';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-v5-progress-stepper/test/pf-progress-stepper.spec.ts b/elements/pf-v5-progress-stepper/test/pf-progress-stepper.spec.ts
new file mode 100644
index 0000000000..dec24386de
--- /dev/null
+++ b/elements/pf-v5-progress-stepper/test/pf-progress-stepper.spec.ts
@@ -0,0 +1,21 @@
+import { html, expect } from '@open-wc/testing';
+
+import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
+
+import { PfV5ProgressStepper } from '@patternfly/elements/pf-v5-progress-stepper/pf-v5-progress-stepper.js';
+import { PfV5ProgressStep } from '../pf-v5-progress-step.js';
+
+describe('', function() {
+ it('imperatively instantiates', function() {
+ expect(document.createElement('pf-v5-progress-stepper')).to.be.an.instanceof(PfV5ProgressStepper);
+ expect(document.createElement('pf-v5-progress-step')).to.be.an.instanceof(PfV5ProgressStep);
+ });
+
+ it('it should upgrade', async function() {
+ const el = await createFixture(html` `);
+ expect(el)
+ .to.be.an.instanceOf(customElements.get('pf-v5-progress-stepper'))
+ .and
+ .to.be.an.instanceOf(PfV5ProgressStepper);
+ });
+});
diff --git a/elements/pf-progress/README.md b/elements/pf-v5-progress/README.md
similarity index 65%
rename from elements/pf-progress/README.md
rename to elements/pf-v5-progress/README.md
index b03913e672..688ff7ecbb 100644
--- a/elements/pf-progress/README.md
+++ b/elements/pf-v5-progress/README.md
@@ -6,10 +6,10 @@ Read more about Progress in the [PatternFly Elements Progress documentation][doc
## Installation
-Load `` via CDN:
+Load `` via CDN:
```html
-
+
```
Or, if you are using [NPM](https://npm.im), install it
@@ -21,13 +21,13 @@ npm install @patternfly/elements
Then once installed, import it to your application:
```js
-import '@patternfly/elements/pf-progress/pf-progress.js';
+import '@patternfly/elements/pf-v5-progress/pf-v5-progress.js';
```
## Usage
```html
-
+
```
[docs]: https://patternflyelements.org/components/progress
diff --git a/elements/pf-v5-progress/demo/index.html b/elements/pf-v5-progress/demo/index.html
new file mode 100644
index 0000000000..6707c5b632
--- /dev/null
+++ b/elements/pf-v5-progress/demo/index.html
@@ -0,0 +1,5 @@
+
+
+
diff --git a/elements/pf-progress/demo/kitchen-sink.css b/elements/pf-v5-progress/demo/kitchen-sink.css
similarity index 74%
rename from elements/pf-progress/demo/kitchen-sink.css
rename to elements/pf-v5-progress/demo/kitchen-sink.css
index 6271c537ff..ccd286b44c 100644
--- a/elements/pf-progress/demo/kitchen-sink.css
+++ b/elements/pf-v5-progress/demo/kitchen-sink.css
@@ -1,4 +1,4 @@
-pf-progress {
+pf-v5-progress {
padding-bottom: 0.25rem;
display: block;
}
\ No newline at end of file
diff --git a/elements/pf-v5-progress/demo/kitchen-sink.html b/elements/pf-v5-progress/demo/kitchen-sink.html
new file mode 100644
index 0000000000..ca3b20d5ab
--- /dev/null
+++ b/elements/pf-v5-progress/demo/kitchen-sink.html
@@ -0,0 +1,141 @@
+
+
+
+pf-v5-progress
+
+Default States
+
+
+
+Value
+
+
+Description
+
+
+Aria-label
+
+
+Max
+
+
+Min
+
+
+Size (sm, lg)
+
+
+
+Measure Location (Inside, Outside, None)
+
+
+
+
+Variant (Sucess, danger, warning)
+
+
+
+
+Variant (Success, Danger, Warning) and Size (sm, lg)
+
+
+
+
+
+
+
+Variant (Success, Danger, Warning) and Measure Location (Inside, Outside, None)
+
+
+
+
+
+
+
+
+
+
+Variant (Success, Danger, Warning), Size (sm, lg) and Measure Location (Inside, Outside, None)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Label w/ no description
+
+Value
+
+Value
+
+
+Size (sm, lg)
+
+Size (sm)
+
+
+Size (lg)
+
+
+Measure Location (Inside, Outside)
+
+Measure Location (Inside)
+
+
+Measure Location (Outside)
+
+
+Variant (Sucess, danger, warning)
+
+Variant (Success)
+
+
+Variant (Danger)
+
+
+Variant (Warning)
+
+
+Variant (Success, Danger, Warning) and Size (sm, lg)
+
+Variant (Success) and Size (sm)
+
+
+Variant (Success) and Size (lg)
+
+
+Variant (Danger) and Size (sm)
+
+
+Variant (Danger) and Size (lg)
+
+
+Variant (Warning) and Size (sm)
+
+
+Variant (Warning) and Size (lg)
+
+
+Truncated description
+
+
+
diff --git a/elements/pf-progress/demo/truncated-description.html b/elements/pf-v5-progress/demo/truncated-description.html
similarity index 73%
rename from elements/pf-progress/demo/truncated-description.html
rename to elements/pf-v5-progress/demo/truncated-description.html
index 72d7e9f0f3..ab77ce90a0 100644
--- a/elements/pf-progress/demo/truncated-description.html
+++ b/elements/pf-v5-progress/demo/truncated-description.html
@@ -1,20 +1,20 @@
diff --git a/elements/pf-progress/docs/pf-progress.md b/elements/pf-v5-progress/docs/pf-progress.md
similarity index 72%
rename from elements/pf-progress/docs/pf-progress.md
rename to elements/pf-v5-progress/docs/pf-progress.md
index 5214bf4444..e66c25db5e 100644
--- a/elements/pf-progress/docs/pf-progress.md
+++ b/elements/pf-v5-progress/docs/pf-progress.md
@@ -1,38 +1,38 @@
{% renderInstallation %} {% endrenderInstallation %}
{% renderOverview %}
-
+
{% endrenderOverview %}
{% band header="Usage" %}
### Success variant
{% htmlexample %}
-
+
{% endhtmlexample %}
### Inside measurement
{% htmlexample %}
-
+
{% endhtmlexample %}
### Large size
{% htmlexample %}
-
+
{% endhtmlexample %}
### Inside measurement
{% htmlexample %}
-
+
{% endhtmlexample %}
### Truncated Description
{% htmlexample %}
-
+ >
{% endhtmlexample %}
{% endband %}
diff --git a/elements/pf-progress/pf-progress.css b/elements/pf-v5-progress/pf-v5-progress.css
similarity index 52%
rename from elements/pf-progress/pf-progress.css
rename to elements/pf-v5-progress/pf-v5-progress.css
index dd32a0e915..2088aefb98 100644
--- a/elements/pf-progress/pf-progress.css
+++ b/elements/pf-v5-progress/pf-v5-progress.css
@@ -9,63 +9,63 @@
--_pf-c-progress--m-danger__bar--BackgroundColorWithOpacity: #c9190b33; /* WARNING: not a recognized token value */
/** Gap between sections of progress bar */
- --pf-c-progress--GridGap: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-progress--GridGap: var(--pf-global--spacer--md, 1rem);
/** Color of progress bar */
- --pf-c-progress__bar--before--BackgroundColor: var(--pf-global--primary-color--100, #0066cc);
+ --pf-v5-c-progress__bar--before--BackgroundColor: var(--pf-global--primary-color--100, #0066cc);
/** Height of progress bar */
- --pf-c-progress__bar--Height: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-progress__bar--Height: var(--pf-global--spacer--md, 1rem);
/** Background color of progress bar */
- --pf-c-progress__bar--BackgroundColor: var(--pf-global--BackgroundColor--light-100, #ffffff);
+ --pf-v5-c-progress__bar--BackgroundColor: var(--pf-global--BackgroundColor--light-100, #ffffff);
/** Color of status icon */
- --pf-c-progress__status-icon--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-progress__status-icon--Color: var(--pf-global--Color--100, #151515);
/** Margin left of status icon */
- --pf-c-progress__status-icon--MarginLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-progress__status-icon--MarginLeft: var(--pf-global--spacer--sm, 0.5rem);
/** Height of progress bar indicator */
- --pf-c-progress__indicator--Height: var(--pf-c-progress__bar--Height);
+ --pf-v5-c-progress__indicator--Height: var(--pf-v5-c-progress__bar--Height);
/** Background color of progress bar indicator */
- --pf-c-progress__indicator--BackgroundColor: var(--pf-c-progress__bar--before--BackgroundColor);
+ --pf-v5-c-progress__indicator--BackgroundColor: var(--pf-v5-c-progress__bar--before--BackgroundColor);
/** Background color of progress bar when variant is success */
- --pf-c-progress--m-success__bar--BackgroundColor: var(--pf-global--success-color--100, #3e8635);
+ --pf-v5-c-progress--m-success__bar--BackgroundColor: var(--pf-global--success-color--100, #3e8635);
/** Background color of progress bar when variant is warning */
- --pf-c-progress--m-warning__bar--BackgroundColor: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-progress--m-warning__bar--BackgroundColor: var(--pf-global--warning-color--100, #f0ab00);
/** Background color of progress bar when variant is danger */
- --pf-c-progress--m-danger__bar--BackgroundColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-progress--m-danger__bar--BackgroundColor: var(--pf-global--danger-color--100, #c9190b);
/** Color of status icon when variant is success */
- --pf-c-progress--m-success__status-icon--Color: var(--pf-global--success-color--100, #3e8635);
+ --pf-v5-c-progress--m-success__status-icon--Color: var(--pf-global--success-color--100, #3e8635);
/** Color of status icon when variant is warning */
- --pf-c-progress--m-warning__status-icon--Color: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-progress--m-warning__status-icon--Color: var(--pf-global--warning-color--100, #f0ab00);
/** Color of status icon when variant is danger */
- --pf-c-progress--m-danger__status-icon--Color: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-progress--m-danger__status-icon--Color: var(--pf-global--danger-color--100, #c9190b);
/** Color of progress bar measure when variant is success and measure location is inside */
- --pf-c-progress--m-success--m-inside__measure--Color: var(--pf-global--Color--light-100, #ffffff);
+ --pf-v5-c-progress--m-success--m-inside__measure--Color: var(--pf-global--Color--light-100, #ffffff);
/** Font size of progress bar measure when measure location is outside */
- --pf-c-progress--m-outside__measure--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ --pf-v5-c-progress--m-outside__measure--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
/** Height of progress bar when size is small */
- --pf-c-progress--m-sm__bar--Height: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-progress--m-sm__bar--Height: var(--pf-global--spacer--sm, 0.5rem);
/** Font size of progress bar description when size is small */
- --pf-c-progress--m-sm__description--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ --pf-v5-c-progress--m-sm__description--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
/** Height of progress bar when size is large */
- --pf-c-progress--m-lg__bar--Height: var(--pf-global--spacer--lg, 1.5rem);
+ --pf-v5-c-progress--m-lg__bar--Height: var(--pf-global--spacer--lg, 1.5rem);
display: grid;
align-items: end;
- grid-gap: var(--pf-c-progress--GridGap);
+ grid-gap: var(--pf-v5-c-progress--GridGap);
grid-template-columns: 1fr auto;
grid-template-rows: 1fr auto;
width: 100%;
}
.sm {
- --pf-c-progress__bar--Height: var(--pf-c-progress--m-sm__bar--Height);
- --pf-c-progress__indicator--Height: var(--pf-c-progress--m-sm__bar--Height);
+ --pf-v5-c-progress__bar--Height: var(--pf-v5-c-progress--m-sm__bar--Height);
+ --pf-v5-c-progress__indicator--Height: var(--pf-v5-c-progress--m-sm__bar--Height);
}
.sm #description {
- font-size: var(--pf-c-progress--m-sm__description--FontSize);
+ font-size: var(--pf-v5-c-progress--m-sm__description--FontSize);
}
.lg {
- --pf-c-progress__bar--Height: var(--pf-c-progress--m-lg__bar--Height);
- --pf-c-progress__indicator--Height: var(--pf-c-progress--m-lg__bar--Height);
+ --pf-v5-c-progress__bar--Height: var(--pf-v5-c-progress--m-lg__bar--Height);
+ --pf-v5-c-progress__indicator--Height: var(--pf-v5-c-progress--m-lg__bar--Height);
}
.outside #description {
@@ -81,7 +81,7 @@
.outside progress,
.outside span {
display: inline-block;
- font-size: var(--pf-c-progress--m-outside__measure--FontSize);
+ font-size: var(--pf-v5-c-progress--m-outside__measure--FontSize);
grid-column: 1/2;
}
@@ -110,21 +110,21 @@
}
#container.success {
- --pf-c-progress__bar--before--BackgroundColor: var(--pf-c-progress--m-success__bar--BackgroundColor);
+ --pf-v5-c-progress__bar--before--BackgroundColor: var(--pf-v5-c-progress--m-success__bar--BackgroundColor);
--_pf-c-progress__bar--before--BackgroundColorWithOpacity: var(--_pf-c-progress--m-success__bar--BackgroundColorWithOpacity);
- --pf-c-progress__status-icon--Color: var(--pf-c-progress--m-success__status-icon--Color);
+ --pf-v5-c-progress__status-icon--Color: var(--pf-v5-c-progress--m-success__status-icon--Color);
}
#container.warning {
- --pf-c-progress__bar--before--BackgroundColor: var(--pf-c-progress--m-warning__bar--BackgroundColor);
+ --pf-v5-c-progress__bar--before--BackgroundColor: var(--pf-v5-c-progress--m-warning__bar--BackgroundColor);
--_pf-c-progress__bar--before--BackgroundColorWithOpacity: var(--_pf-c-progress--m-warning__bar--BackgroundColorWithOpacity);
- --pf-c-progress__status-icon--Color: var(--pf-c-progress--m-warning__status-icon--Color);
+ --pf-v5-c-progress__status-icon--Color: var(--pf-v5-c-progress--m-warning__status-icon--Color);
}
#container.danger {
- --pf-c-progress__bar--before--BackgroundColor: var(--pf-c-progress--m-danger__bar--BackgroundColor);
+ --pf-v5-c-progress__bar--before--BackgroundColor: var(--pf-v5-c-progress--m-danger__bar--BackgroundColor);
--_pf-c-progress__bar--before--BackgroundColorWithOpacity: var(--_pf-c-progress--m-danger__bar--BackgroundColorWithOpacity);
- --pf-c-progress__status-icon--Color: var(--pf-c-progress--m-danger__status-icon--Color);
+ --pf-v5-c-progress__status-icon--Color: var(--pf-v5-c-progress--m-danger__status-icon--Color);
}
#description {
@@ -148,9 +148,9 @@
justify-content: end;
}
-pf-icon {
- margin-left: var(--pf-c-progress__status-icon--MarginLeft);
- color: var(--pf-c-progress__status-icon--Color);
+pf-v5-icon {
+ margin-left: var(--pf-v5-c-progress__status-icon--MarginLeft);
+ color: var(--pf-v5-c-progress__status-icon--Color);
}
progress {
@@ -158,21 +158,21 @@ progress {
grid-column: 1/3;
grid-row: 2/3;
align-self: center;
- height: var(--pf-c-progress__bar--Height);
- background-color: var(--pf-c-progress__bar--BackgroundColor);
+ height: var(--pf-v5-c-progress__bar--Height);
+ background-color: var(--pf-v5-c-progress__bar--BackgroundColor);
}
.indicator {
position: absolute;
top: 0;
left: 0;
- height: var(--pf-c-progress__indicator--Height);
- background-color: var(--pf-c-progress__indicator--BackgroundColor);
+ height: var(--pf-v5-c-progress__indicator--Height);
+ background-color: var(--pf-v5-c-progress__indicator--BackgroundColor);
}
.indicator {
width: 100%;
- height: var(--pf-c-progress__bar--Height);
+ height: var(--pf-v5-c-progress__bar--Height);
display: block;
}
@@ -181,7 +181,7 @@ span {
grid-column: 1/3;
grid-row: 2/3;
text-align: center;
- color: var(--pf-c-progress--m-success--m-inside__measure--Color);
+ color: var(--pf-v5-c-progress--m-success--m-inside__measure--Color);
}
span::after {
@@ -198,7 +198,7 @@ progress[value] {
background: var(--_pf-c-progress__bar--before--BackgroundColorWithOpacity);
width: 100%;
- height: var(--pf-c-progress__bar--Height);
+ height: var(--pf-v5-c-progress__bar--Height);
}
progress:not([value]) {
@@ -212,18 +212,18 @@ progress[value]::-webkit-progress-bar {
}
progress[value]::-moz-progress-bar {
- background: var(--pf-c-progress__bar--before--BackgroundColor);
+ background: var(--pf-v5-c-progress__bar--before--BackgroundColor);
}
progress[value]::-webkit-progress-value {
background-size: 100% 100%;
background-image: linear-gradient(
90deg,
- var(--pf-c-progress__bar--before--BackgroundColor) 100%,
- var(--pf-c-progress__bar--before--BackgroundColor) 100%
+ var(--pf-v5-c-progress__bar--before--BackgroundColor) 100%,
+ var(--pf-v5-c-progress__bar--before--BackgroundColor) 100%
);
}
-pf-tooltip {
+pf-v5-tooltip {
height: 0.01px;
}
diff --git a/elements/pf-progress/pf-progress.ts b/elements/pf-v5-progress/pf-v5-progress.ts
similarity index 89%
rename from elements/pf-progress/pf-progress.ts
rename to elements/pf-v5-progress/pf-v5-progress.ts
index 973b8d02d9..2791b1601c 100644
--- a/elements/pf-progress/pf-progress.ts
+++ b/elements/pf-v5-progress/pf-v5-progress.ts
@@ -6,7 +6,7 @@ import { property } from 'lit/decorators/property.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { styleMap } from 'lit/directives/style-map.js';
-import styles from './pf-progress.css';
+import styles from './pf-v5-progress.css';
const ICONS = new Map(Object.entries({
success: { icon: 'circle-check' },
@@ -19,8 +19,8 @@ const ICONS = new Map(Object.entries({
* @summary Display completion status of ongoing process or task.
* @alias Progress
*/
-@customElement('pf-progress')
-export class PfProgress extends LitElement {
+@customElement('pf-v5-progress')
+export class PfV5Progress extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
#internals = this.attachInternals();
@@ -71,10 +71,10 @@ export class PfProgress extends LitElement {
this.#internals.ariaValueNow = this.#calculatedPercentage.toString();
}
if (this.#icon) {
- import('@patternfly/elements/pf-icon/pf-icon.js');
+ import('@patternfly/elements/pf-v5-icon/pf-v5-icon.js');
}
if (this.descriptionTruncated) {
- import('@patternfly/elements/pf-tooltip/pf-tooltip.js');
+ import('@patternfly/elements/pf-v5-tooltip/pf-v5-tooltip.js');
}
}
@@ -97,18 +97,18 @@ export class PfProgress extends LitElement {
${description ?? ''}
${!descriptionTruncated ? '' : html`
-
+
`}
${measureLocation === 'none' ? '' : html`
${measureLocation !== 'inside' ? '' : width}
-
+ >
`}
@@ -131,6 +131,6 @@ export class PfProgress extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-progress': PfProgress;
+ 'pf-v5-progress': PfV5Progress;
}
}
diff --git a/elements/pf-progress/test/pf-progress.e2e.ts b/elements/pf-v5-progress/test/pf-progress.e2e.ts
similarity index 95%
rename from elements/pf-progress/test/pf-progress.e2e.ts
rename to elements/pf-v5-progress/test/pf-progress.e2e.ts
index 2da4cdda68..5aa242fb07 100644
--- a/elements/pf-progress/test/pf-progress.e2e.ts
+++ b/elements/pf-v5-progress/test/pf-progress.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-progress';
+const tagName = 'pf-v5-progress';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-progress/test/pf-progress.spec.ts b/elements/pf-v5-progress/test/pf-progress.spec.ts
similarity index 57%
rename from elements/pf-progress/test/pf-progress.spec.ts
rename to elements/pf-v5-progress/test/pf-progress.spec.ts
index 3265c59949..bc0b45a15f 100644
--- a/elements/pf-progress/test/pf-progress.spec.ts
+++ b/elements/pf-v5-progress/test/pf-progress.spec.ts
@@ -1,21 +1,21 @@
import { expect, html, fixture } from '@open-wc/testing';
-import { PfProgress } from '@patternfly/elements/pf-progress/pf-progress.js';
+import { PfV5Progress } from '@patternfly/elements/pf-v5-progress/pf-v5-progress.js';
-describe('', function() {
- let element: PfProgress;
+describe('', function() {
+ let element: PfV5Progress;
beforeEach(async function() {
- element = await fixture(html`
- (html`
+
-
+
`);
});
it('should upgrade', async function() {
- const klass = customElements.get('pf-progress');
- expect(element).to.be.an.instanceOf(klass).and.to.be.an.instanceOf(PfProgress);
+ const klass = customElements.get('pf-v5-progress');
+ expect(element).to.be.an.instanceOf(klass).and.to.be.an.instanceOf(PfV5Progress);
});
it('should be accessible', async function() {
@@ -23,17 +23,17 @@ describe('', function() {
});
it('should set the correct value on the progress bar', async function() {
- const element = await fixture(html`
-
-
+ const element = await fixture(html`
+
+
`);
expect(element.value).to.equal(33);
});
it('should set the correct title on the progress bar', async function() {
- const element = await fixture(html`
-
-
+ const element = await fixture(html`
+
+
`);
expect(element.title).to.equal('Progress title');
});
@@ -42,9 +42,9 @@ describe('', function() {
const max = Math.floor(Math.random() * 100);
const value = Math.floor(Math.random() * (max));
- const element = await fixture(html`
-
-
+ const element = await fixture(html`
+
+
`);
expect(element.value).to.equal(value);
expect(element.max).to.equal(max);
diff --git a/elements/pf-search-input/README.md b/elements/pf-v5-search-input/README.md
similarity index 61%
rename from elements/pf-search-input/README.md
rename to elements/pf-v5-search-input/README.md
index 3b4180e2ce..4310350042 100644
--- a/elements/pf-search-input/README.md
+++ b/elements/pf-v5-search-input/README.md
@@ -5,11 +5,11 @@ A search input lets users type in words to find specific items or information. A
A search input consists of a text field where users can type to find specific content or items. Unlike selects or dropdowns, which offer predefined options, a search input lets users enter their own keywords to filter or locate results. It includes a clear (×) button to easily remove the current input, allowing users to start a new search quickly.
```html
-
- Alabama
- New Jersey
- New York
- New Mexico
- North Carolina
-
+
+ Alabama
+ New Jersey
+ New York
+ New Mexico
+ North Carolina
+
```
diff --git a/elements/pf-v5-search-input/demo/disabled.html b/elements/pf-v5-search-input/demo/disabled.html
new file mode 100644
index 0000000000..6db81b0db3
--- /dev/null
+++ b/elements/pf-v5-search-input/demo/disabled.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elements/pf-v5-search-input/demo/index.html b/elements/pf-v5-search-input/demo/index.html
new file mode 100644
index 0000000000..94abec8be0
--- /dev/null
+++ b/elements/pf-v5-search-input/demo/index.html
@@ -0,0 +1,42 @@
+
+
+ What is Red Hat Enterprise Linux?
+ How does Red Hat OpenShift work?
+ Why use Red Hat Ansible for automation?
+ Where can Red Hat OpenShift be deployed?
+ When should you use Red Hat Enterprise Linux?
+ What is Red Hat Satellite?
+ How does Red Hat integrate with AWS and other clouds?
+ Why choose Red Hat over other Linux vendors?
+ Where can I learn Red Hat technologies?
+ When does support end for RHEL versions?
+ What are Red Hat certifications?
+ How do you secure a RHEL server?
+ Why use OpenShift instead of vanilla Kubernetes?
+ Where is Red Hat headquartered?
+ When should you use Red Hat CoreOS?
+ What is Red Hat Insights?
+ How do you manage Red Hat subscriptions?
+ Why is RHEL considered enterprise-grade?
+ Where can I download RHEL for testing?
+ When was Red Hat founded?
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elements/pf-v5-search-input/demo/pf-search-input-with-submit.html b/elements/pf-v5-search-input/demo/pf-search-input-with-submit.html
new file mode 100644
index 0000000000..563212ff17
--- /dev/null
+++ b/elements/pf-v5-search-input/demo/pf-search-input-with-submit.html
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elements/pf-search-input/docs/pf-search-input.md b/elements/pf-v5-search-input/docs/pf-search-input.md
similarity index 61%
rename from elements/pf-search-input/docs/pf-search-input.md
rename to elements/pf-v5-search-input/docs/pf-search-input.md
index 9a37f81ec5..6b84d6d1f3 100644
--- a/elements/pf-search-input/docs/pf-search-input.md
+++ b/elements/pf-v5-search-input/docs/pf-search-input.md
@@ -1,24 +1,24 @@
{% renderInstallation %} {% endrenderInstallation %}
{% renderOverview %}
-
- Blue
- Black
- Brown
- Bronze
- Green
- Magenta
- Orange
- Purple
- Periwinkle
- Pink
- Red
- Yellow
-
+
+ Blue
+ Black
+ Brown
+ Bronze
+ Green
+ Magenta
+ Orange
+ Purple
+ Periwinkle
+ Pink
+ Red
+ Yellow
+
{% endrenderOverview %}
{% band header="Usage" %}
@@ -26,17 +26,17 @@ import '@patternfly/elements/pf-search-input/pf-search-input.js';
#### Search Input
{% htmlexample %}
- {% renderFile "./elements/pf-search-input/demo/index.html" %}
+ {% renderFile "./elements/pf-v5-search-input/demo/index.html" %}
{% endhtmlexample %}
#### Search Input Form
{% htmlexample %}
- {% renderFile "./elements/pf-search-input/demo/pf-search-input-with-submit.html" %}
+ {% renderFile "./elements/pf-v5-search-input/demo/pf-v5-search-input-with-submit.html" %}
{% endhtmlexample %}
#### Disabled
{% htmlexample %}
- {% renderFile "./elements/pf-search-input/demo/disabled.html" %}
+ {% renderFile "./elements/pf-v5-search-input/demo/disabled.html" %}
{% endhtmlexample %}
{% endband %}
@@ -76,16 +76,16 @@ Listbox options use the [APG's Roving tabindex](https://www.w3.org/WAI/ARIA/apg/
{% endband %}
-{% renderSlots for="pf-search-input", header="Slots on `pf-search-input`" %}{% endrenderSlots %}
-{% renderAttributes for="pf-search-input", header="Attributes on `pf-search-input`" %}{% endrenderAttributes %}
-{% renderMethods for="pf-search-input", header="Methods on `pf-search-input`" %}{% endrenderMethods %}
-{% renderEvents for="pf-search-input", header="Events on `pf-search-input`" %}{% endrenderEvents %}
-{% renderCssCustomProperties for="pf-search-input", header="CSS Custom Properties on `pf-search-input`" %}{% endrenderCssCustomProperties %}
-{% renderCssParts for="pf-search-input", header="CSS Parts on `pf-search-input`" %}{% endrenderCssParts %}
-
-{% renderSlots for="pf-option", header="Slots on `pf-option`" %}{% endrenderSlots %}
-{% renderAttributes for="pf-option", header="Attributes on `pf-option`" %}{% endrenderAttributes %}
-{% renderMethods for="pf-option", header="Methods on `pf-option`" %}{% endrenderMethods %}
-{% renderEvents for="pf-option", header="Events on `pf-option`" %}{% endrenderEvents %}
-{% renderCssCustomProperties for="pf-option", header="CSS Custom Properties on `pf-option`" %}{% endrenderCssCustomProperties %}
-{% renderCssParts for="pf-option", header="CSS Parts on `pf-option`" %}{% endrenderCssParts %}
+{% renderSlots for="pf-v5-search-input", header="Slots on `pf-v5-search-input`" %}{% endrenderSlots %}
+{% renderAttributes for="pf-v5-search-input", header="Attributes on `pf-v5-search-input`" %}{% endrenderAttributes %}
+{% renderMethods for="pf-v5-search-input", header="Methods on `pf-v5-search-input`" %}{% endrenderMethods %}
+{% renderEvents for="pf-v5-search-input", header="Events on `pf-v5-search-input`" %}{% endrenderEvents %}
+{% renderCssCustomProperties for="pf-v5-search-input", header="CSS Custom Properties on `pf-v5-search-input`" %}{% endrenderCssCustomProperties %}
+{% renderCssParts for="pf-v5-search-input", header="CSS Parts on `pf-v5-search-input`" %}{% endrenderCssParts %}
+
+{% renderSlots for="pf-v5-option", header="Slots on `pf-v5-option`" %}{% endrenderSlots %}
+{% renderAttributes for="pf-v5-option", header="Attributes on `pf-v5-option`" %}{% endrenderAttributes %}
+{% renderMethods for="pf-v5-option", header="Methods on `pf-v5-option`" %}{% endrenderMethods %}
+{% renderEvents for="pf-v5-option", header="Events on `pf-v5-option`" %}{% endrenderEvents %}
+{% renderCssCustomProperties for="pf-v5-option", header="CSS Custom Properties on `pf-v5-option`" %}{% endrenderCssCustomProperties %}
+{% renderCssParts for="pf-v5-option", header="CSS Parts on `pf-v5-option`" %}{% endrenderCssParts %}
diff --git a/elements/pf-search-input/docs/screenshot.png b/elements/pf-v5-search-input/docs/screenshot.png
similarity index 100%
rename from elements/pf-search-input/docs/screenshot.png
rename to elements/pf-v5-search-input/docs/screenshot.png
diff --git a/elements/pf-v5-search-input/pf-v5-search-input.css b/elements/pf-v5-search-input/pf-v5-search-input.css
new file mode 100644
index 0000000000..faf2fcbd6f
--- /dev/null
+++ b/elements/pf-v5-search-input/pf-v5-search-input.css
@@ -0,0 +1,308 @@
+:host {
+ font-family: var(--pf-global--FontFamily--sans-serif, "RedHatTextUpdated", "Overpass", overpass, helvetica, arial, sans-serif);
+ font-size: var(--pf-global--FontSize--md, 16px);
+ font-weight: var(--pf-global--FontWeight--normal, 400);
+ color: var(--pf-global--Color--100, #151515);
+ --_pf-option-checkboxes-display: none;
+ --_pf-option-svg-display: block;
+ --pf-v5-c-search-input__toggle--PaddingTop: var(--pf-global--spacer--form-element, 0.375rem);
+ --pf-v5-c-search-input__toggle--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-search-input__toggle--PaddingBottom: var(--pf-global--spacer--form-element, 0.375rem);
+ --pf-v5-c-search-input__toggle--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-search-input__toggle--MinWidth: var(--pf-global--target-size--MinWidth, 44px);
+ --pf-v5-c-search-input__toggle--FontSize: var(--pf-global--FontSize--md, 1rem);
+ --pf-v5-c-search-input__toggle--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ --pf-v5-c-search-input__toggle--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+ --pf-v5-c-search-input__toggle--BackgroundColor: var(--pf-global--BackgroundColor--100, #fff);
+ --pf-v5-c-search-input__toggle--before--BorderTopWidth: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-search-input__toggle--before--BorderRightWidth: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-search-input__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-search-input__toggle--before--BorderLeftWidth: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-search-input__toggle--before--BorderWidth: initial;
+ --pf-v5-c-search-input__toggle--before--BorderTopColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-search-input__toggle--before--BorderRightColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-search-input__toggle--before--BorderBottomColor: var(--pf-global--BorderColor--200, #8a8d90);
+ --pf-v5-c-search-input__toggle--before--BorderLeftColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ --pf-v5-c-search-input__toggle--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-search-input__toggle--hover--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-search-input__toggle--focus--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-search-input__toggle--focus--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-search-input__toggle--active--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-search-input__toggle--active--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-search-input__toggle--m-expanded--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ --pf-v5-c-search-input__toggle--m-expanded--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-search-input__toggle--disabled--BackgroundColor: var(--pf-global--disabled-color--300, #f0f0f0);
+ --pf-v5-c-search-input__toggle--m-plain--before--BorderColor: transparent;
+ --pf-v5-c-search-input__toggle--m-placeholder--Color: transparent;
+ --pf-v5-c-search-input--m-invalid__toggle--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-search-input--m-invalid__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-search-input--m-invalid__toggle--hover--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-search-input--m-invalid__toggle--focus--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-search-input--m-invalid__toggle--active--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-search-input--m-invalid__toggle--m-expanded--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-search-input--m-invalid__toggle-status-icon--Color: var(--pf-global--danger-color--100, #c9190b);
+ --pf-v5-c-search-input--m-success__toggle--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ --pf-v5-c-search-input--m-success__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-search-input--m-success__toggle--hover--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ --pf-v5-c-search-input--m-success__toggle--focus--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ --pf-v5-c-search-input--m-success__toggle--active--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ --pf-v5-c-search-input--m-success__toggle--m-expanded--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ --pf-v5-c-search-input--m-success__toggle-status-icon--Color: var(--pf-global--success-color--100, #3e8635);
+ --pf-v5-c-search-input--m-warning__toggle--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-search-input--m-warning__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ --pf-v5-c-search-input--m-warning__toggle--hover--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-search-input--m-warning__toggle--focus--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-search-input--m-warning__toggle--active--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-search-input--m-warning__toggle--m-expanded--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-search-input--m-warning__toggle-status-icon--Color: var(--pf-global--warning-color--100, #f0ab00);
+ --pf-v5-c-search-input__toggle-wrapper--not-last-child--MarginRight: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-search-input__toggle-wrapper--MaxWidth: calc(100% - var(--pf-global--spacer--lg, 1.5rem));
+ --pf-v5-c-search-input__toggle--m-placeholder__toggle-text--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ --pf-v5-c-search-input__toggle-icon--toggle-text--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-search-input__toggle-status-icon--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-search-input__toggle-status-icon--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-search-input--m-plain__toggle-arrow--Color: var(--pf-global--Color--200, #6a6e73);
+ --pf-v5-c-search-input--m-plain--hover__toggle-arrow--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-search-input__toggle-clear--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-search-input__toggle-clear--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ --pf-v5-c-search-input__toggle-clear--toggle-button--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-search-input__toggle-button--Color: var(--pf-global--Color--100, #151515);
+ --pf-v5-c-search-input__list-item--m-loading--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-search-input__menu-content--MaxHeight: 20rem;
+}
+
+:host,
+#outer {
+ display: flex;
+ flex-direction: column;
+ align-items: stretch;
+ inline-size: 100%;
+}
+
+:host([hidden]),
+*[hidden] {
+ display: none !important;
+}
+
+:host([aria-disabled="true"]) {
+ pointer-events: none;
+ cursor: not-allowed;
+}
+
+#outer.disabled {
+ color: var(--pf-global--Color--dark-200, #6a6e73);
+}
+
+#outer {
+ position: relative;
+}
+
+#listbox-container {
+ display: inline-flex;
+ position: absolute;
+ background-color: var(--pf-v5-theme--color--surface--lightest, #fff) !important;
+ opacity: 0;
+ --_active-descendant-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ box-shadow: 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06);
+}
+
+#outer.expanded #listbox-container {
+ opacity: 1;
+ z-index: 9999 !important;
+ max-block-size: var(--pf-v5-c-search-input__menu-content--MaxHeight, 20rem);
+ overflow-y: scroll;
+}
+
+#listbox {
+ display: flex;
+ flex-direction: column;
+ position: relative;
+ inline-size: 100%;
+}
+
+#listbox slot.disabled {
+ color: var(--pf-v5-c-list__item-icon--Color, #6a6e73) !important;
+ background-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ border-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ pointer-events: none;
+ cursor: not-allowed;
+
+ --_active-descendant-color: transparent;
+ --_svg-color: var(--pf-v5-c-list__item-icon--Color, #6a6e73) !important;
+}
+
+#toggle {
+ background-color: var(--pf-v5-c-search-input__toggle--BackgroundColor, #fff) !important;
+}
+
+#toggle,
+#toggle-input {
+ display: flex;
+ font-family: var(--pf-global--FontFamily--sans-serif, "RedHatTextUpdated", "Overpass", overpass, helvetica, arial, sans-serif);
+ font-size: var(--pf-v5-c-search-input__toggle--FontSize, 1rem);
+ font-weight: var(--pf-v5-c-search-input__toggle--FontWeight, 400);
+ line-height: var(--pf-v5-c-search-input__toggle--LineHeight, 1.5);
+}
+
+#toggle {
+ border: 1px solid var(--pf-global--BorderColor--100, #d2d2d2);
+ border-bottom-color: var(--pf-v5-theme--color--text, #151515);
+ justify-content: space-between;
+}
+
+.disabled #toggle {
+ color: var(--pf-global--Color--dark-200, #6a6e73) !important;
+ background-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ border-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ caret-color: transparent;
+}
+
+#toggle-input {
+ background: transparent;
+ border: none;
+ text-align: left;
+ border-radius: 0;
+ padding-inline-start: 3rem;
+}
+
+#toggle-input {
+ justify-content: space-between;
+ inline-size: 100%;
+ box-sizing: border-box;
+ block-size: 2.25rem;
+}
+
+.disabled #toggle-input {
+ pointer-events: none;
+ cursor: not-allowed;
+}
+
+.close-button {
+ --pf-v5-c-button--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-button--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ --pf-v5-c-button--PaddingTop: var(--pf-global--spacer--xs, 0.25rem);
+ --pf-v5-c-button--PaddingBottom: var(--pf-global--spacer--xs, 0.25rem);
+
+ color: currentColor;
+ background-color: transparent;
+ max-block-size: 2.25rem;
+ max-inline-size: 2.25rem;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 0px;
+ position: relative;
+
+ pf-v5-icon {
+ position: relative;
+ inset-block-start: 5px;
+ }
+}
+
+.close-button-container {
+ block-size: 2.25rem;
+ inline-size: 2.25rem;
+}
+
+#toggle-text {
+ flex: 1 1 auto;
+}
+
+#description {
+ display: block;
+}
+
+#listbox.checkboxes {
+ --_pf-option-checkboxes-display: none;
+ --_pf-option-svg-display: none;
+}
+
+.visually-hidden {
+ border: 0;
+ clip: rect(0, 0, 0, 0);
+ block-size: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ white-space: nowrap;
+ inline-size: 1px;
+}
+
+::slotted(hr) {
+ --pf-v5-c-divider--BorderWidth--base: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-divider--BorderColor--base: var(--pf-v5-c-divider--BackgroundColor);
+ --pf-v5-c-divider--Height: var(--pf-v5-c-divider--BorderWidth--base);
+ --pf-v5-c-divider--BackgroundColor: var(--pf-global--BorderColor--100, #d2d2d2);
+ --pf-v5-c-divider--after--BackgroundColor: var(--pf-v5-c-divider--BorderColor--base);
+ --pf-v5-c-divider--after--FlexBasis: 100%;
+ --pf-v5-c-divider--after--Inset: 0%;
+ --pf-v5-c-divider--m-vertical--after--FlexBasis: 100%;
+ --pf-v5-c-divider--m-horizontal--Display: flex;
+ --pf-v5-c-divider--m-horizontal--FlexDirection: row;
+ --pf-v5-c-divider--m-horizontal--after--Height: var(--pf-v5-c-divider--Height);
+ --pf-v5-c-divider--m-horizontal--after--Width: auto;
+ --pf-v5-c-divider--m-vertical--Display: inline-flex;
+ --pf-v5-c-divider--m-vertical--FlexDirection: column;
+ --pf-v5-c-divider--m-vertical--after--Height: auto;
+ --pf-v5-c-divider--m-vertical--after--Width: var(--pf-v5-c-divider--BorderWidth--base);
+ --pf-v5-hidden-visible--visible--Display: var(--pf-v5-c-divider--Display);
+ --pf-v5-c-divider--Display: var(--pf-v5-c-divider--m-horizontal--Display);
+ --pf-v5-c-divider--FlexDirection: var(--pf-v5-c-divider--m-horizontal--FlexDirection);
+ --pf-v5-c-divider--after--Width: var(--pf-v5-c-divider--m-horizontal--after--Width);
+ --pf-v5-c-divider--after--Height: var(--pf-v5-c-divider--m-horizontal--after--Height);
+ display: var(--pf-v5-c-divider--Display, flex);
+ flex-direction: var(--pf-v5-c-divider--FlexDirection);
+ border: 0;
+ inline-size: 100%;
+ margin-top: var(--pf-v5-c-search-input-menu--c-divider--MarginTop);
+ margin-bottom: var(--pf-v5-c-search-input-menu--c-divider--MarginBottom);
+}
+
+::slotted(hr)::after {
+ content: '';
+ inline-size: var(--pf-v5-c-divider--after--Width, 100%) !important;
+ block-size: var(--pf-v5-c-divider--after--Height, 1px);
+ background-color: var(--pf-v5-c-divider--after--BackgroundColor);
+ flex: 1 0 100%;
+}
+
+div.search-icon {
+ position: absolute;
+ inset-block-start: 50%;
+ inset-inline-start: var(--pf-global--spacer--md, 1rem);
+ transform: translateY(-50%);
+ display: flex;
+ align-items: center;
+}
+
+#outer:focus-within {
+ #toggle {
+ border-bottom: none;
+ border-bottom-left-radius: 4px;
+
+ #toggle-input {
+ border-bottom: var(--pf-global--spacer--xs, 0.125rem) solid var(--pf-v5-theme--color--accent, #0066cc);
+ }
+ }
+
+ .close-button-container {
+ position: relative;
+
+ &::after {
+ content: '';
+ inline-size: 36px;
+ block-size: var(--pf-global--spacer--xs, 0.125rem);
+ inset-block-end: 0px;
+ inset-inline-start: 0px;
+ background-color: var(--pf-v5-theme--color--accent, #0066cc);
+ position: absolute;
+ }
+ }
+}
+
+::slotted(pf-v5-option[selected]) {
+ --_pf-option-svg-display: none;
+ --_pf-option-selected-background-color: var(--pf-global--BackgroundColor--100, #fff);
+}
\ No newline at end of file
diff --git a/elements/pf-search-input/pf-search-input.ts b/elements/pf-v5-search-input/pf-v5-search-input.ts
similarity index 88%
rename from elements/pf-search-input/pf-search-input.ts
rename to elements/pf-v5-search-input/pf-v5-search-input.ts
index fe0fb9a192..3252d0ee8b 100644
--- a/elements/pf-search-input/pf-search-input.ts
+++ b/elements/pf-v5-search-input/pf-v5-search-input.ts
@@ -14,11 +14,11 @@ import { InternalsController } from '@patternfly/pfe-core/controllers/internals-
import { FloatingDOMController } from '@patternfly/pfe-core/controllers/floating-dom-controller.js';
import { observes } from '@patternfly/pfe-core/decorators/observes.js';
-import { PfOption } from '../pf-select/pf-option.js';
-import styles from './pf-search-input.css';
+import { PfV5Option } from '../pf-v5-select/pf-v5-option.js';
+import styles from './pf-v5-search-input.css';
-/** Fired when a `` element's value changes */
-export class PfSearchChangeEvent extends Event {
+/** Fired when a `` element's value changes */
+export class PfV5SearchChangeEvent extends Event {
constructor() {
super('change', { bubbles: true });
}
@@ -39,8 +39,8 @@ export class PfSearchChangeEvent extends Event {
* @fires open - when the menu toggles open
* @fires close - when the menu toggles closed
*/
-@customElement('pf-search-input')
-export class PfSearchInput extends LitElement {
+@customElement('pf-v5-search-input')
+export class PfV5SearchInput extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
static readonly formAssociated = true;
@@ -80,7 +80,7 @@ export class PfSearchInput extends LitElement {
@query('#listbox-container') private _listboxContainer?: HTMLElement;
- @query('#placeholder') private _placeholder?: PfOption;
+ @query('#placeholder') private _placeholder?: PfV5Option;
#internals = InternalsController.of(this);
@@ -105,7 +105,7 @@ export class PfSearchInput extends LitElement {
requestShowListbox: () => this.#showListbox(),
requestHideListbox: () => void (this.expanded &&= false),
setItemHidden: (item, hidden) => (item.id !== 'placeholder') && void (item.hidden = hidden),
- isItem: item => item instanceof PfOption,
+ isItem: item => item instanceof PfV5Option,
setItemActive: (item, active) => this.#setItemActive(item, active),
setItemSelected: (item, selected) => this.#setItemSelected(item, selected),
});
@@ -119,14 +119,14 @@ export class PfSearchInput extends LitElement {
}
/** List of options */
- get options(): PfOption[] {
+ get options(): PfV5Option[] {
if (isServer) {
return []; // TODO: expose a DOM property to allow setting options in SSR scenarios
} else {
return [
this._placeholder,
- ...Array.from(this.querySelectorAll('pf-option')),
- ].filter((x): x is PfOption => !!x && !x.hidden);
+ ...Array.from(this.querySelectorAll('pf-v5-option')),
+ ].filter((x): x is PfV5Option => !!x && !x.hidden);
}
}
@@ -141,7 +141,7 @@ export class PfSearchInput extends LitElement {
class="${classMap({ disabled, expanded, [anchor]: !!anchor, [alignment]: !!alignment })}">
${this.#combobox.renderItemsToShadowRoot()}
-
+
@@ -198,7 +198,7 @@ export class PfSearchInput extends LitElement {
@observes('value')
private valueChanged() {
this.#internals.setFormValue(this.value ?? '');
- this.dispatchEvent(new PfSearchChangeEvent());
+ this.dispatchEvent(new PfV5SearchChangeEvent());
}
async #doExpand() {
@@ -266,7 +266,7 @@ export class PfSearchInput extends LitElement {
#onSubmit(event: KeyboardEvent) {
if (event.key === 'Enter' || event.key === ' ') {
- this.dispatchEvent(new PfSearchChangeEvent());
+ this.dispatchEvent(new PfV5SearchChangeEvent());
}
}
@@ -274,7 +274,7 @@ export class PfSearchInput extends LitElement {
this.value = value;
// it's necessary to reset the 'selected' state of combobox
// since otherwise, combobox controller will attempt to prevent us from
- // re-selecting the last-selected item, even though pf-search-input
+ // re-selecting the last-selected item, even though pf-v5-search-input
// doesn't have a selected property
this.#combobox.selected = [];
}
@@ -307,7 +307,7 @@ export class PfSearchInput extends LitElement {
}
}
- #setItemSelected(item: PfOption, selected: boolean) {
+ #setItemSelected(item: PfV5Option, selected: boolean) {
item.selected = selected;
if (selected) {
this._toggleInput!.value = item.value;
@@ -315,7 +315,7 @@ export class PfSearchInput extends LitElement {
}
}
- #setItemActive(item: PfOption, active: boolean) {
+ #setItemActive(item: PfV5Option, active: boolean) {
item.active = active;
if (this.expanded && active) {
item?.scrollIntoView({ behavior: 'auto', block: 'nearest', inline: 'nearest' });
@@ -334,6 +334,6 @@ export class PfSearchInput extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-search-input': PfSearchInput;
+ 'pf-v5-search-input': PfV5SearchInput;
}
}
diff --git a/elements/pf-search-input/test/pf-search-input.e2e.ts b/elements/pf-v5-search-input/test/pf-search-input.e2e.ts
similarity index 94%
rename from elements/pf-search-input/test/pf-search-input.e2e.ts
rename to elements/pf-v5-search-input/test/pf-search-input.e2e.ts
index b1d9dbb21a..04d688a4e4 100644
--- a/elements/pf-search-input/test/pf-search-input.e2e.ts
+++ b/elements/pf-v5-search-input/test/pf-search-input.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-search-input';
+const tagName = 'pf-v5-search-input';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-search-input/test/pf-search-input.spec.ts b/elements/pf-v5-search-input/test/pf-search-input.spec.ts
similarity index 86%
rename from elements/pf-search-input/test/pf-search-input.spec.ts
rename to elements/pf-v5-search-input/test/pf-search-input.spec.ts
index 47089be493..6317a2e001 100644
--- a/elements/pf-search-input/test/pf-search-input.spec.ts
+++ b/elements/pf-v5-search-input/test/pf-search-input.spec.ts
@@ -1,6 +1,6 @@
import { aTimeout, expect, html, nextFrame } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
-import { PfSearchInput } from '../pf-search-input.js';
+import { PfV5SearchInput } from '../pf-v5-search-input.js';
import { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
import { sendKeys } from '@web/test-runner-commands';
import { clickElementAtCenter, clickElementAtOffset } from '@patternfly/pfe-tools/test/utils.js';
@@ -12,22 +12,22 @@ function press(key: string) {
}
// a11yShapshot does not surface the options
-function getVisibleOptionValues(element: PfSearchInput): string[] {
+function getVisibleOptionValues(element: PfV5SearchInput): string[] {
return element.options.filter(x => !x.hidden).map(x => x.value);
}
// a11yShapshot does not surface the options
-function getActiveOption(element: PfSearchInput) {
+function getActiveOption(element: PfV5SearchInput) {
return element.options.find(x => x.active);
}
/**
* NOTE because of the copy-to-shadow-root shtick in ActivedescendantController,
* we can't just pick an option (from light dom);
- * @param element pf-select
+ * @param element pf-v5-select
* @param index item index
*/
-async function clickItemAtIndex(element: PfSearchInput, index: number) {
+async function clickItemAtIndex(element: PfV5SearchInput, index: number) {
const itemHeight = 44;
await clickElementAtOffset(element, [
10,
@@ -38,34 +38,34 @@ async function clickItemAtIndex(element: PfSearchInput, index: number) {
}
-describe('', function() {
+describe('', function() {
describe('simply instantiating', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
it('imperatively instantiates', function() {
- expect(document.createElement('pf-search-input')).to.be.an.instanceof(PfSearchInput);
+ expect(document.createElement('pf-v5-search-input')).to.be.an.instanceof(PfV5SearchInput);
});
it('should upgrade', async function() {
- element = await createFixture(html` `);
- const klass = customElements.get('pf-search-input');
+ element = await createFixture(html` `);
+ const klass = customElements.get('pf-v5-search-input');
expect(element)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfSearchInput);
+ .to.be.an.instanceOf(PfV5SearchInput);
});
});
describe('with accessible-label attribute and 3 items', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
- `);
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+ `);
});
it('passes aXe audit', async function() {
@@ -114,16 +114,16 @@ describe('', function() {
});
describe('with 3 items and associated elements', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
-
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+
label1
label2
`);
@@ -169,7 +169,7 @@ describe('', function() {
});
describe('in a deep shadow root', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const focus = () => element.focus();
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
@@ -178,18 +178,18 @@ describe('', function() {
-
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
-
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+
@@ -206,7 +206,7 @@ describe('', function() {
}
attachShadowRoots(document);
- const select = fixture.shadowRoot?.firstElementChild?.shadowRoot?.querySelector('pf-search-input');
+ const select = fixture.shadowRoot?.firstElementChild?.shadowRoot?.querySelector('pf-v5-search-input');
if (select) {
element = select;
await element?.updateComplete;
@@ -237,22 +237,22 @@ describe('', function() {
});
describe('with 8 items', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- `);
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ `);
});
it('does not pass aXe audit', async function() {
@@ -413,24 +413,24 @@ describe('', function() {
});
describe('with alphabetically sorted items', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const label = 'label';
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- Blue
- Green
- Magenta
- Orange
- Purple
- Periwinkle
- Pink
- Red
- Yellow
- `);
+ element = await createFixture(html`
+
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Periwinkle
+ Pink
+ Red
+ Yellow
+ `);
});
beforeEach(nextFrame);
@@ -566,7 +566,7 @@ describe('', function() {
});
// Skipping the test case as the role is visible in the accessibility tree,
- // and since the pf-button uses ElementInternals, the test case is unable to access the role.
+ // and since the pf-v5-button uses ElementInternals, the test case is unable to access the role.
it.skip('labels the close button with the label', async function() {
expect(await a11ySnapshot()).to.axContainQuery({
role: 'button',
@@ -815,17 +815,17 @@ describe('', function() {
});
describe('with `disabled` attribute', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
-
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+
Disabled `);
await updateComplete();
});
@@ -884,17 +884,17 @@ describe('', function() {
});
describe('clicking the close button', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
-
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+
Disabled `);
await updateComplete();
});
@@ -970,21 +970,21 @@ describe('', function() {
});
describe('Outside click behavior', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
let outsideElement: HTMLElement;
beforeEach(async function() {
- element = await createFixture(html`
-
- 11
- 12
- 13
- 21
- 22
- 23
-
+ element = await createFixture(html`
+
+ 11
+ 12
+ 13
+ 21
+ 22
+ 23
+
`);
// Create a dummy div to represent an "outside" area
@@ -1035,20 +1035,20 @@ describe('', function() {
});
describe('on focus-out behavior', function() {
- let element: PfSearchInput;
+ let element: PfV5SearchInput;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- 11
- 12
- 13
- 21
- 22
- 23
-
+ element = await createFixture(html`
+
+ 11
+ 12
+ 13
+ 21
+ 22
+ 23
+
`);
beforeEach(updateComplete);
@@ -1097,9 +1097,9 @@ describe('', function() {
});
});
- describe('form submission with pf-search-input', function() {
+ describe('form submission with pf-v5-search-input', function() {
let form: HTMLFormElement;
- let searchInput: PfSearchInput;
+ let searchInput: PfV5SearchInput;
const updateComplete = () => searchInput.updateComplete;
const focus = () => searchInput.focus();
let submittedData: FormData | null;
@@ -1107,16 +1107,16 @@ describe('', function() {
beforeEach(async function() {
form = await createFixture(html`
-
- Alabama
- New York
- New Jersey
-
+
+ Alabama
+ New York
+ New Jersey
+
Submit
`);
- searchInput = form.querySelector('pf-search-input')!;
+ searchInput = form.querySelector('pf-v5-search-input')!;
beforeEach(updateComplete);
form.addEventListener('submit', e => {
@@ -1161,7 +1161,7 @@ describe('', function() {
});
describe('on form submit event', function() {
- it('should submit the selected value from pf-search-input', async function() {
+ it('should submit the selected value from pf-v5-search-input', async function() {
const event = new SubmitEvent('submit', {
bubbles: true,
cancelable: true,
diff --git a/elements/pf-select/README.md b/elements/pf-v5-select/README.md
similarity index 52%
rename from elements/pf-select/README.md
rename to elements/pf-v5-select/README.md
index 1451de32b0..5afd701756 100644
--- a/elements/pf-select/README.md
+++ b/elements/pf-v5-select/README.md
@@ -9,14 +9,14 @@ Selects differ from dropdowns in that they persist selection, whereas dropdowns
```html
Colors
-
- Blue
- Green
- Magenta
- Orange
- Purple
- Pink
- Red
- Yellow
-
+
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Pink
+ Red
+ Yellow
+
```
diff --git a/elements/pf-select/demo/checkbox-input-no-badge.html b/elements/pf-v5-select/demo/checkbox-input-no-badge.html
similarity index 50%
rename from elements/pf-select/demo/checkbox-input-no-badge.html
rename to elements/pf-v5-select/demo/checkbox-input-no-badge.html
index f1561396fc..6ec09f07d9 100644
--- a/elements/pf-select/demo/checkbox-input-no-badge.html
+++ b/elements/pf-v5-select/demo/checkbox-input-no-badge.html
@@ -1,23 +1,23 @@
diff --git a/elements/pf-v5-select/demo/grouped-checkbox-input.html b/elements/pf-v5-select/demo/grouped-checkbox-input.html
new file mode 100644
index 0000000000..65f862ecd1
--- /dev/null
+++ b/elements/pf-v5-select/demo/grouped-checkbox-input.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
diff --git a/elements/pf-v5-select/demo/grouped-single.html b/elements/pf-v5-select/demo/grouped-single.html
new file mode 100644
index 0000000000..aea5bd3605
--- /dev/null
+++ b/elements/pf-v5-select/demo/grouped-single.html
@@ -0,0 +1,30 @@
+
+
+
+ Running
+ Stopped
+ Down
+ Degraded
+ Needs maintenance
+
+
+
+ Dell
+ Samsung
+ Hewlett-Packard
+
+
+
+
+
+
+
diff --git a/elements/pf-v5-select/demo/index.html b/elements/pf-v5-select/demo/index.html
new file mode 100644
index 0000000000..f467988e17
--- /dev/null
+++ b/elements/pf-v5-select/demo/index.html
@@ -0,0 +1,26 @@
+
+
+ Mr
+ Miss
+ Mrs
+ Ms
+
+ Dr
+ Other
+
+
+
+
+
+
+
diff --git a/elements/pf-v5-select/demo/single-with-description.html b/elements/pf-v5-select/demo/single-with-description.html
new file mode 100644
index 0000000000..fa06826f30
--- /dev/null
+++ b/elements/pf-v5-select/demo/single-with-description.html
@@ -0,0 +1,25 @@
+
+
+ Mr
+ Miss
+ Mrs
+ Ms
+ Dr
+ Descriptions can also be HTML
+
+ Other
+
+
+
+
+
+
diff --git a/elements/pf-v5-select/demo/typeahead.html b/elements/pf-v5-select/demo/typeahead.html
new file mode 100644
index 0000000000..e4759de006
--- /dev/null
+++ b/elements/pf-v5-select/demo/typeahead.html
@@ -0,0 +1,29 @@
+
+ State
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/elements/pf-v5-select/demos-to-implement-later/multiple.html b/elements/pf-v5-select/demos-to-implement-later/multiple.html
new file mode 100644
index 0000000000..d72e11a696
--- /dev/null
+++ b/elements/pf-v5-select/demos-to-implement-later/multiple.html
@@ -0,0 +1,19 @@
+
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Pink
+ Red
+ Yellow
+
+
+
+ Shift will toggling off multiple items.
+ Ctrl+A will toggle selection on all items.
+
+
+
diff --git a/elements/pf-v5-select/demos-to-implement-later/typeahead-chips.html b/elements/pf-v5-select/demos-to-implement-later/typeahead-chips.html
new file mode 100644
index 0000000000..a8d12b2296
--- /dev/null
+++ b/elements/pf-v5-select/demos-to-implement-later/typeahead-chips.html
@@ -0,0 +1,17 @@
+Pick a color:
+
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Pink
+ Red
+ Yellow
+
+
+
diff --git a/elements/pf-v5-select/demos-to-implement-later/typeahead-create-option.html b/elements/pf-v5-select/demos-to-implement-later/typeahead-create-option.html
new file mode 100644
index 0000000000..133234fb94
--- /dev/null
+++ b/elements/pf-v5-select/demos-to-implement-later/typeahead-create-option.html
@@ -0,0 +1,17 @@
+Pick a color:
+
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Pink
+ Red
+ Yellow
+
+
+
diff --git a/elements/pf-v5-select/demos-to-implement-later/typeahead-custom-filter.html b/elements/pf-v5-select/demos-to-implement-later/typeahead-custom-filter.html
new file mode 100644
index 0000000000..93dba489bf
--- /dev/null
+++ b/elements/pf-v5-select/demos-to-implement-later/typeahead-custom-filter.html
@@ -0,0 +1,18 @@
+
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Pink
+ Red
+ Yellow
+
+
+
diff --git a/elements/pf-v5-select/demos-to-implement-later/typeahead-disable-filter.html b/elements/pf-v5-select/demos-to-implement-later/typeahead-disable-filter.html
new file mode 100644
index 0000000000..9303be00d5
--- /dev/null
+++ b/elements/pf-v5-select/demos-to-implement-later/typeahead-disable-filter.html
@@ -0,0 +1,15 @@
+Pick a color:
+
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Pink
+ Red
+ Yellow
+
+
+
diff --git a/elements/pf-v5-select/demos-to-implement-later/typeahead-multiple.html b/elements/pf-v5-select/demos-to-implement-later/typeahead-multiple.html
new file mode 100644
index 0000000000..bd314fb629
--- /dev/null
+++ b/elements/pf-v5-select/demos-to-implement-later/typeahead-multiple.html
@@ -0,0 +1,15 @@
+
+ Select a state
+
+ Alabama
+ Florida
+ New Jersey
+ New Mexico
+ New York
+ North Carolina
+
+
+
+
diff --git a/elements/pf-select/docs/pf-select.md b/elements/pf-v5-select/docs/pf-select.md
similarity index 60%
rename from elements/pf-select/docs/pf-select.md
rename to elements/pf-v5-select/docs/pf-select.md
index e784e783bd..3393a9fb7e 100644
--- a/elements/pf-select/docs/pf-select.md
+++ b/elements/pf-v5-select/docs/pf-select.md
@@ -1,21 +1,21 @@
{% renderInstallation %} {% endrenderInstallation %}
{% renderOverview %}
-
- Blue
- Green
- Magenta
- Orange
- Purple
- Pink
- Red
- Yellow
-
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Pink
+ Red
+ Yellow
+
{% endrenderOverview %}
{% band header="Usage" %}
@@ -26,17 +26,17 @@ Focus on options using arrow keys or
by typing the first character of an option.
{% htmlexample %}
- {% renderFile "./elements/pf-select/demo/index.html" %}
+ {% renderFile "./elements/pf-v5-select/demo/index.html" %}
{% endhtmlexample %}
#### Single with description
{% htmlexample %}
- {% renderFile "./elements/pf-select/demo/single-with-description.html" %}
+ {% renderFile "./elements/pf-v5-select/demo/single-with-description.html" %}
{% endhtmlexample %}
#### Grouped single
{% htmlexample %}
- {% renderFile "./elements/pf-select/demo/grouped-single.html" %}
+ {% renderFile "./elements/pf-v5-select/demo/grouped-single.html" %}
{% endhtmlexample %}
#### Checkbox input
@@ -46,7 +46,7 @@ Multiple options can be selected. Any arrow keys work.
Ctrl+A will toggle selection on all items.
{% htmlexample %}
- {% renderFile "./elements/pf-select/demo/checkbox-input.html" %}
+ {% renderFile "./elements/pf-v5-select/demo/checkbox-input.html" %}
{% endhtmlexample %}
{# save this for v5
@@ -55,18 +55,18 @@ Multiple options can be selected. Any arrow keys work.
Below are option variants:
{% htmlexample %}
-
- Basic option
-
+
+ Basic option
+
Option with description
This is a description
-
-
-
+
+
+
Option with icon
-
- Aria-disabled option
-
+
+ Aria-disabled option
+
{% endhtmlexample %}
#}
When setting the `disabled` attribute on options, they are still focusable, but
@@ -77,7 +77,7 @@ readers. This functions similarly to the `aria-disabled="true"` attribute.
### Typeahead
{% htmlexample %}
- {% renderFile "./elements/pf-select/demo/typeahead.html" %}
+ {% renderFile "./elements/pf-v5-select/demo/typeahead.html" %}
{% endhtmlexample %}
{#
@@ -85,7 +85,7 @@ readers. This functions similarly to the `aria-disabled="true"` attribute.
#### Multiple
{% htmlexample %}
- {% renderFile "./elements/pf-select/demo/typeahead-multiple.html" %}
+ {% renderFile "./elements/pf-v5-select/demo/typeahead-multiple.html" %}
{% endhtmlexample %}
#### Custom filtering
@@ -95,7 +95,7 @@ readers. This functions similarly to the `aria-disabled="true"` attribute.
which is a predicate function that takes an option.
{% htmlexample %}
- {% renderFile "./elements/pf-select/demo/typeahead-custom-filter.html" %}
+ {% renderFile "./elements/pf-v5-select/demo/typeahead-custom-filter.html" %}
{% endhtmlexample %}
#}
@@ -142,23 +142,23 @@ Listbox options use the [APG's Roving tabindex](https://www.w3.org/WAI/ARIA/apg/
{% endband %}
-{% renderSlots for="pf-select", header="Slots on `pf-select`" %}{% endrenderSlots %}
-{% renderAttributes for="pf-select", header="Attributes on `pf-select`" %}{% endrenderAttributes %}
-{% renderMethods for="pf-select", header="Methods on `pf-select`" %}{% endrenderMethods %}
-{% renderEvents for="pf-select", header="Events on `pf-select`" %}{% endrenderEvents %}
-{% renderCssCustomProperties for="pf-select", header="CSS Custom Properties on `pf-select`" %}{% endrenderCssCustomProperties %}
-{% renderCssParts for="pf-select", header="CSS Parts on `pf-select`" %}{% endrenderCssParts %}
-
-{% renderSlots for="pf-option-group", header="Slots on `pf-option-group`" %}{% endrenderSlots %}
-{% renderAttributes for="pf-option-group", header="Attributes on `pf-option-group`" %}{% endrenderAttributes %}
-{% renderMethods for="pf-option-group", header="Methods on `pf-option-group`" %}{% endrenderMethods %}
-{% renderEvents for="pf-option-group", header="Events on `pf-option-group`" %}{% endrenderEvents %}
-{% renderCssCustomProperties for="pf-option-group", header="CSS Custom Properties on `pf-option-group`" %}{% endrenderCssCustomProperties %}
-{% renderCssParts for="pf-option-group", header="CSS Parts on `pf-option-group`" %}{% endrenderCssParts %}
-
-{% renderSlots for="pf-option", header="Slots on `pf-option`" %}{% endrenderSlots %}
-{% renderAttributes for="pf-option", header="Attributes on `pf-option`" %}{% endrenderAttributes %}
-{% renderMethods for="pf-option", header="Methods on `pf-option`" %}{% endrenderMethods %}
-{% renderEvents for="pf-option", header="Events on `pf-option`" %}{% endrenderEvents %}
-{% renderCssCustomProperties for="pf-option", header="CSS Custom Properties on `pf-option`" %}{% endrenderCssCustomProperties %}
-{% renderCssParts for="pf-option", header="CSS Parts on `pf-option`" %}{% endrenderCssParts %}
+{% renderSlots for="pf-v5-select", header="Slots on `pf-v5-select`" %}{% endrenderSlots %}
+{% renderAttributes for="pf-v5-select", header="Attributes on `pf-v5-select`" %}{% endrenderAttributes %}
+{% renderMethods for="pf-v5-select", header="Methods on `pf-v5-select`" %}{% endrenderMethods %}
+{% renderEvents for="pf-v5-select", header="Events on `pf-v5-select`" %}{% endrenderEvents %}
+{% renderCssCustomProperties for="pf-v5-select", header="CSS Custom Properties on `pf-v5-select`" %}{% endrenderCssCustomProperties %}
+{% renderCssParts for="pf-v5-select", header="CSS Parts on `pf-v5-select`" %}{% endrenderCssParts %}
+
+{% renderSlots for="pf-v5-option-group", header="Slots on `pf-v5-option-group`" %}{% endrenderSlots %}
+{% renderAttributes for="pf-v5-option-group", header="Attributes on `pf-v5-option-group`" %}{% endrenderAttributes %}
+{% renderMethods for="pf-v5-option-group", header="Methods on `pf-v5-option-group`" %}{% endrenderMethods %}
+{% renderEvents for="pf-v5-option-group", header="Events on `pf-v5-option-group`" %}{% endrenderEvents %}
+{% renderCssCustomProperties for="pf-v5-option-group", header="CSS Custom Properties on `pf-v5-option-group`" %}{% endrenderCssCustomProperties %}
+{% renderCssParts for="pf-v5-option-group", header="CSS Parts on `pf-v5-option-group`" %}{% endrenderCssParts %}
+
+{% renderSlots for="pf-v5-option", header="Slots on `pf-v5-option`" %}{% endrenderSlots %}
+{% renderAttributes for="pf-v5-option", header="Attributes on `pf-v5-option`" %}{% endrenderAttributes %}
+{% renderMethods for="pf-v5-option", header="Methods on `pf-v5-option`" %}{% endrenderMethods %}
+{% renderEvents for="pf-v5-option", header="Events on `pf-v5-option`" %}{% endrenderEvents %}
+{% renderCssCustomProperties for="pf-v5-option", header="CSS Custom Properties on `pf-v5-option`" %}{% endrenderCssCustomProperties %}
+{% renderCssParts for="pf-v5-option", header="CSS Parts on `pf-v5-option`" %}{% endrenderCssParts %}
diff --git a/elements/pf-select/docs/screenshot.png b/elements/pf-v5-select/docs/screenshot.png
similarity index 100%
rename from elements/pf-select/docs/screenshot.png
rename to elements/pf-v5-select/docs/screenshot.png
diff --git a/elements/pf-select/pf-option-group.css b/elements/pf-v5-select/pf-v5-option-group.css
similarity index 69%
rename from elements/pf-select/pf-option-group.css
rename to elements/pf-v5-select/pf-v5-option-group.css
index cf4b47c5ef..4b34f2daf3 100644
--- a/elements/pf-select/pf-option-group.css
+++ b/elements/pf-v5-select/pf-v5-option-group.css
@@ -7,9 +7,9 @@
pointer-events: none;
cursor: not-allowed;
color: var(--pf-global--Color--200, #6a6e73) !important;
- background-color: var(--pf-theme--color--surface--lighter, #f0f0f0) !important;
- border-color: var(--pf-theme--color--surface--lighter, #f0f0f0) !important;
- --_active-descendant-color: var(--pf-theme--color--surface--lighter, #f0f0f0) !important;
+ background-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ border-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ --_active-descendant-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
--_svg-color: var(--pf-global--Color--200, #6a6e73) !important;
}
diff --git a/elements/pf-select/pf-option-group.ts b/elements/pf-v5-select/pf-v5-option-group.ts
similarity index 84%
rename from elements/pf-select/pf-option-group.ts
rename to elements/pf-v5-select/pf-v5-option-group.ts
index 8c6be3cc22..4d2af22fc3 100644
--- a/elements/pf-select/pf-option-group.ts
+++ b/elements/pf-v5-select/pf-v5-option-group.ts
@@ -5,15 +5,15 @@ import { property } from 'lit/decorators/property.js';
import { InternalsController } from '@patternfly/pfe-core/controllers/internals-controller.js';
-import styles from './pf-option-group.css';
+import styles from './pf-v5-option-group.css';
/**
* Group of options within a listbox
- * @slot - `` or ` ` elements
+ * @slot - `` or ` ` elements
* @slot label - Group label. Overrides the `label` attribute.
*/
-@customElement('pf-option-group')
-export class PfOptionGroup extends LitElement {
+@customElement('pf-v5-option-group')
+export class PfV5OptionGroup extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
/** Group description. Overridden by `label` slot. */
@@ -41,6 +41,6 @@ export class PfOptionGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-option-group': PfOptionGroup;
+ 'pf-v5-option-group': PfV5OptionGroup;
}
}
diff --git a/elements/pf-select/pf-option.css b/elements/pf-v5-select/pf-v5-option.css
similarity index 83%
rename from elements/pf-select/pf-option.css
rename to elements/pf-v5-select/pf-v5-option.css
index 2206aaab67..07ac0bdf47 100644
--- a/elements/pf-select/pf-option.css
+++ b/elements/pf-v5-select/pf-v5-option.css
@@ -29,7 +29,7 @@
}
#outer.active {
- background-color: var(--_active-descendant-color, var(--pf-theme--color--surface--lighter, #f0f0f0));
+ background-color: var(--_active-descendant-color, var(--pf-v5-theme--color--surface--lighter, #f0f0f0));
}
:host([disabled]) #outer {
@@ -48,8 +48,8 @@ span {
}
svg {
- font-size: var(--pf-c-select__menu-item-icon--FontSize, var(--pf-global--icon--FontSize--sm, 0.675rem));
- color: var(--_svg-color, var(--pf-theme--color--accent, #0066cc));
+ font-size: var(--pf-v5-c-select__menu-item-icon--FontSize, var(--pf-global--icon--FontSize--sm, 0.675rem));
+ color: var(--_svg-color, var(--pf-v5-theme--color--accent, #0066cc));
width: 1em;
height: 1em;
margin-inline-start: 1em;
diff --git a/elements/pf-select/pf-option.ts b/elements/pf-v5-select/pf-v5-option.ts
similarity index 96%
rename from elements/pf-select/pf-option.ts
rename to elements/pf-v5-select/pf-v5-option.ts
index e36bd2aca0..22637eb066 100644
--- a/elements/pf-select/pf-option.ts
+++ b/elements/pf-v5-select/pf-v5-option.ts
@@ -8,7 +8,7 @@ import { InternalsController } from '@patternfly/pfe-core/controllers/internals-
import { observes } from '@patternfly/pfe-core/decorators/observes.js';
-import styles from './pf-option.css';
+import styles from './pf-v5-option.css';
/**
* Option within a listbox
@@ -19,8 +19,8 @@ import styles from './pf-option.css';
* @slot description
* optional description
*/
-@customElement('pf-option')
-export class PfOption extends LitElement {
+@customElement('pf-v5-option')
+export class PfV5Option extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
/** whether option is disabled */
@@ -130,6 +130,6 @@ export class PfOption extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-option': PfOption;
+ 'pf-v5-option': PfV5Option;
}
}
diff --git a/elements/pf-v5-select/pf-v5-select.css b/elements/pf-v5-select/pf-v5-select.css
new file mode 100644
index 0000000000..df81ffb212
--- /dev/null
+++ b/elements/pf-v5-select/pf-v5-select.css
@@ -0,0 +1,536 @@
+:host {
+ font-family: var(--pf-global--FontFamily--sans-serif, "RedHatTextUpdated", "Overpass", overpass, helvetica, arial, sans-serif);
+ font-size: var(--pf-global--FontSize--md, 16px);
+ font-weight: var(--pf-global--FontWeight--normal, 400);
+ color: var(--pf-global--Color--100, #151515);
+ --_pf-option-checkboxes-display: none;
+ --_pf-option-svg-display: block;
+ --_pf-option-selected-background-color: var(--rh-color-gray-20, #e0e0e0);
+ /** Select toggle top padding */
+ --pf-v5-c-select__toggle--PaddingTop: var(--pf-global--spacer--form-element, 0.375rem);
+ /** Select toggle right padding */
+ --pf-v5-c-select__toggle--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select toggle bottom padding */
+ --pf-v5-c-select__toggle--PaddingBottom: var(--pf-global--spacer--form-element, 0.375rem);
+ /** Select toggle left padding */
+ --pf-v5-c-select__toggle--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select toggle minimum width */
+ --pf-v5-c-select__toggle--MinWidth: var(--pf-global--target-size--MinWidth, 44px);
+ /** Select toggle font size */
+ --pf-v5-c-select__toggle--FontSize: var(--pf-global--FontSize--md, 1rem);
+ /** Select toggle font weight */
+ --pf-v5-c-select__toggle--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ /** Select toggle line height */
+ --pf-v5-c-select__toggle--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+ /** Select toggle background color */
+ --pf-v5-c-select__toggle--BackgroundColor: var(--pf-global--BackgroundColor--100, #fff);
+ /** Select toggle border top width */
+ --pf-v5-c-select__toggle--before--BorderTopWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** Select toggle border right width */
+ --pf-v5-c-select__toggle--before--BorderRightWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** Select toggle border bottom width */
+ --pf-v5-c-select__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** Select toggle border left width */
+ --pf-v5-c-select__toggle--before--BorderLeftWidth: var(--pf-global--BorderWidth--sm, 1px);
+ /** Select toggle border width */
+ --pf-v5-c-select__toggle--before--BorderWidth: initial;
+ /** Select toggle border top color */
+ --pf-v5-c-select__toggle--before--BorderTopColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ /** Select toggle border right color */
+ --pf-v5-c-select__toggle--before--BorderRightColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ /** Select toggle border bottom color */
+ --pf-v5-c-select__toggle--before--BorderBottomColor: var(--pf-global--BorderColor--200, #8a8d90);
+ /** Select toggle border left color */
+ --pf-v5-c-select__toggle--before--BorderLeftColor: var(--pf-global--BorderColor--300, #f0f0f0);
+ /** Select toggle text color */
+ --pf-v5-c-select__toggle--Color: var(--pf-global--Color--100, #151515);
+ /** Select toggle hover border bottom color */
+ --pf-v5-c-select__toggle--hover--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ /** Select toggle focus border bottom color */
+ --pf-v5-c-select__toggle--focus--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ /** Select toggle focus border bottom width */
+ --pf-v5-c-select__toggle--focus--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Select toggle active border bottom color */
+ --pf-v5-c-select__toggle--active--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ /** Select toggle active border bottom width */
+ --pf-v5-c-select__toggle--active--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Select toggle expanded border bottom color */
+ --pf-v5-c-select__toggle--m-expanded--before--BorderBottomColor: var(--pf-global--active-color--100, #06c);
+ /** Select toggle expanded border bottom width */
+ --pf-v5-c-select__toggle--m-expanded--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Select toggle disabled background color */
+ --pf-v5-c-select__toggle--disabled--BackgroundColor: var(--pf-global--disabled-color--300, #f0f0f0);
+ /** Select toggle plain border color */
+ --pf-v5-c-select__toggle--m-plain--before--BorderColor: transparent;
+ /** Select toggle placeholder color */
+ --pf-v5-c-select__toggle--m-placeholder--Color: transparent;
+ /** Select invalid state toggle border bottom color */
+ --pf-v5-c-select--m-invalid__toggle--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ /** Select invalid state toggle border bottom width */
+ --pf-v5-c-select--m-invalid__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Select invalid state toggle hover border bottom color */
+ --pf-v5-c-select--m-invalid__toggle--hover--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ /** Select invalid state toggle focus border bottom color */
+ --pf-v5-c-select--m-invalid__toggle--focus--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ /** Select invalid state toggle active border bottom color */
+ --pf-v5-c-select--m-invalid__toggle--active--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ /** Select invalid state toggle expanded border bottom color */
+ --pf-v5-c-select--m-invalid__toggle--m-expanded--before--BorderBottomColor: var(--pf-global--danger-color--100, #c9190b);
+ /** Select invalid state toggle status icon color */
+ --pf-v5-c-select--m-invalid__toggle-status-icon--Color: var(--pf-global--danger-color--100, #c9190b);
+ /** Select success state toggle border bottom color */
+ --pf-v5-c-select--m-success__toggle--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ /** Select success state toggle border bottom width */
+ --pf-v5-c-select--m-success__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Select success state toggle hover border bottom color */
+ --pf-v5-c-select--m-success__toggle--hover--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ /** Select success state toggle focus border bottom color */
+ --pf-v5-c-select--m-success__toggle--focus--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ /** Select success state toggle active border bottom color */
+ --pf-v5-c-select--m-success__toggle--active--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ /** Select success state toggle expanded border bottom color */
+ --pf-v5-c-select--m-success__toggle--m-expanded--before--BorderBottomColor: var(--pf-global--success-color--100, #3e8635);
+ /** Select success state toggle status icon color */
+ --pf-v5-c-select--m-success__toggle-status-icon--Color: var(--pf-global--success-color--100, #3e8635);
+ /** Select warning state toggle border bottom color */
+ --pf-v5-c-select--m-warning__toggle--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ /** Select warning state toggle border bottom width */
+ --pf-v5-c-select--m-warning__toggle--before--BorderBottomWidth: var(--pf-global--BorderWidth--md, 2px);
+ /** Select warning state toggle hover border bottom color */
+ --pf-v5-c-select--m-warning__toggle--hover--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ /** Select warning state toggle focus border bottom color */
+ --pf-v5-c-select--m-warning__toggle--focus--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ /** Select warning state toggle active border bottom color */
+ --pf-v5-c-select--m-warning__toggle--active--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ /** Select warning state toggle expanded border bottom color */
+ --pf-v5-c-select--m-warning__toggle--m-expanded--before--BorderBottomColor: var(--pf-global--warning-color--100, #f0ab00);
+ /** Select warning state toggle status icon color */
+ --pf-v5-c-select--m-warning__toggle-status-icon--Color: var(--pf-global--warning-color--100, #f0ab00);
+ /** Select toggle wrapper not last child right margin */
+ --pf-v5-c-select__toggle-wrapper--not-last-child--MarginRight: var(--pf-global--spacer--xs, 0.25rem);
+ /** Select toggle wrapper maximum width */
+ --pf-v5-c-select__toggle-wrapper--MaxWidth: calc(100% - var(--pf-global--spacer--lg, 1.5rem));
+ /** Select toggle wrapper chip group top margin */
+ --pf-v5-c-select__toggle-wrapper--c-chip-group--MarginTop: 0.3125rem;
+ /** Select toggle wrapper chip group bottom margin */
+ --pf-v5-c-select__toggle-wrapper--c-chip-group--MarginBottom: 0.3125rem;
+ /** Select typeahead toggle flex basis */
+ --pf-v5-c-select__toggle-typeahead--FlexBasis: 10em;
+ /** Select typeahead toggle background color */
+ --pf-v5-c-select__toggle-typeahead--BackgroundColor: transparent;
+ /** Select typeahead toggle top border */
+ --pf-v5-c-select__toggle-typeahead--BorderTop: var(--pf-global--BorderWidth--sm, 1px) solid transparent;
+ /** Select typeahead toggle right border */
+ --pf-v5-c-select__toggle-typeahead--BorderRight: none;
+ /** Select typeahead toggle left border */
+ --pf-v5-c-select__toggle-typeahead--BorderLeft: none;
+ /** Select typeahead toggle minimum width */
+ --pf-v5-c-select__toggle-typeahead--MinWidth: 7.5rem;
+ /** Select typeahead toggle focus bottom padding */
+ --pf-v5-c-select__toggle-typeahead--focus--PaddingBottom: calc(var(--pf-global--spacer--form-element, 0.375rem) - var(--pf-global--BorderWidth--md));
+ /** Select toggle placeholder text color */
+ --pf-v5-c-select__toggle--m-placeholder__toggle-text--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ /** Select toggle icon left margin */
+ --pf-v5-c-select__toggle-icon--toggle-text--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+ /** Select toggle badge left padding */
+ --pf-v5-c-select__toggle-badge--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select toggle status icon left margin */
+ --pf-v5-c-select__toggle-status-icon--MarginLeft: var(--pf-global--spacer--xs, 0.25rem);
+ /** Select toggle status icon color */
+ --pf-v5-c-select__toggle-status-icon--Color: var(--pf-global--Color--100, #151515);
+ /** Select toggle arrow left margin */
+ --pf-v5-c-select__toggle-arrow--MarginLeft: var(--pf-global--spacer--md, 1rem);
+ /** Select toggle arrow right margin */
+ --pf-v5-c-select__toggle-arrow--MarginRight: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select toggle arrow with clear left margin */
+ --pf-v5-c-select__toggle-arrow--with-clear--MarginLeft: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select toggle arrow top expanded rotation */
+ --pf-v5-c-select__toggle-arrow--m-top--m-expanded__toggle-arrow--Rotate: 180deg;
+ /** Select plain toggle arrow color */
+ --pf-v5-c-select--m-plain__toggle-arrow--Color: var(--pf-global--Color--200, #6a6e73);
+ /** Select plain hover toggle arrow color */
+ --pf-v5-c-select--m-plain--hover__toggle-arrow--Color: var(--pf-global--Color--100, #151515);
+ /** Select toggle clear right padding */
+ --pf-v5-c-select__toggle-clear--PaddingRight: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select toggle clear left padding */
+ --pf-v5-c-select__toggle-clear--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ /** Select toggle clear button left padding */
+ --pf-v5-c-select__toggle-clear--toggle-button--PaddingLeft: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select toggle button text color */
+ --pf-v5-c-select__toggle-button--Color: var(--pf-global--Color--100, #151515);
+ /** Select menu background color */
+ --pf-v5-c-select__menu--BackgroundColor: var(--pf-global--BackgroundColor--light-100, #fff);
+ /** Select menu box shadow */
+ --pf-v5-c-select__menu--BoxShadow: var(--pf-global--BoxShadow--md, 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06));
+ /** Select menu top padding */
+ --pf-v5-c-select__menu--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu bottom padding */
+ --pf-v5-c-select__menu--PaddingBottom: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu top position */
+ --pf-v5-c-select__menu--Top: calc(100% + var(--pf-global--spacer--xs, 0.25rem));
+ /** Select menu z-index */
+ --pf-v5-c-select__menu--ZIndex: var(--pf-global--ZIndex--sm, 200);
+ /** Select menu width */
+ --pf-v5-c-select__menu--Width: auto;
+ /** Select menu minimum width */
+ --pf-v5-c-select__menu--MinWidth: 100%;
+ /** Select menu top transform Y */
+ --pf-v5-c-select__menu--m-top--TranslateY: calc(-100% - var(--pf-global--spacer--xs, 0.25rem));
+ /** Select list item loading top padding */
+ --pf-v5-c-select__list-item--m-loading--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu item top padding */
+ --pf-v5-c-select__menu-item--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu item right padding */
+ --pf-v5-c-select__menu-item--PaddingRight: var(--pf-global--spacer--md, 1rem);
+ /** Select menu item selected right padding */
+ --pf-v5-c-select__menu-item--m-selected--PaddingRight: var(--pf-global--spacer--2xl, 3rem);
+ /** Select menu item bottom padding */
+ --pf-v5-c-select__menu-item--PaddingBottom: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu item left padding */
+ --pf-v5-c-select__menu-item--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ /** Select menu item font size */
+ --pf-v5-c-select__menu-item--FontSize: var(--pf-global--FontSize--md, 1rem);
+ /** Select menu item font weight */
+ --pf-v5-c-select__menu-item--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ /** Select menu item line height */
+ --pf-v5-c-select__menu-item--LineHeight: var(--pf-global--LineHeight--md, 1.5);
+ /** Select menu item text color */
+ --pf-v5-c-select__menu-item--Color: var(--pf-global--Color--dark-100, #151515);
+ /** Select menu item disabled text color */
+ --pf-v5-c-select__menu-item--disabled--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ /** Select menu item width */
+ --pf-v5-c-select__menu-item--Width: 100%;
+ /** Select menu item hover background color */
+ --pf-v5-c-select__menu-item--hover--BackgroundColor: var(--pf-global--BackgroundColor--light-300, #f0f0f0);
+ /** Select menu item focus background color */
+ --pf-v5-c-select__menu-item--focus--BackgroundColor: var(--pf-global--BackgroundColor--light-300, #f0f0f0);
+ /** Select menu item disabled background color */
+ --pf-v5-c-select__menu-item--disabled--BackgroundColor: transparent;
+ /** Select menu item link width */
+ --pf-v5-c-select__menu-item--m-link--Width: auto;
+ /** Select menu item link hover background color */
+ --pf-v5-c-select__menu-item--m-link--hover--BackgroundColor: transparent;
+ /** Select menu item link focus background color */
+ --pf-v5-c-select__menu-item--m-link--focus--BackgroundColor: transparent;
+ /** Select menu item action color */
+ --pf-v5-c-select__menu-item--m-action--Color: var(--pf-global--Color--200, #6a6e73);
+ /** Select menu item action hover color */
+ --pf-v5-c-select__menu-item--m-action--hover--Color: var(--pf-global--Color--100, #151515);
+ /** Select menu item action focus color */
+ --pf-v5-c-select__menu-item--m-action--focus--Color: var(--pf-global--Color--100, #151515);
+ /** Select menu item action disabled color */
+ --pf-v5-c-select__menu-item--m-action--disabled--Color: var(--pf-global--disabled-color--200, #d2d2d2);
+ /** Select menu item action width */
+ --pf-v5-c-select__menu-item--m-action--Width: auto;
+ /** Select menu item action font size */
+ --pf-v5-c-select__menu-item--m-action--FontSize: var(--pf-global--icon--FontSize--sm, 0.625rem);
+ /** Select menu item action hover background color */
+ --pf-v5-c-select__menu-item--m-action--hover--BackgroundColor: transparent;
+ /** Select menu item action focus background color */
+ --pf-v5-c-select__menu-item--m-action--focus--BackgroundColor: transparent;
+ /** Select menu item hover action color */
+ --pf-v5-c-select__menu-item--hover__menu-item--m-action--Color: var(--pf-global--Color--200, #6a6e73);
+ /** Select menu item favorite action color */
+ --pf-v5-c-select__menu-item--m-favorite-action--Color: var(--pf-global--Color--200, #6a6e73);
+ /** Select menu item favorite action hover color */
+ --pf-v5-c-select__menu-item--m-favorite-action--hover--Color: var(--pf-global--Color--100, #151515);
+ /** Select menu item favorite action focus color */
+ --pf-v5-c-select__menu-item--m-favorite-action--focus--Color: var(--pf-global--Color--100, #151515);
+ /** Select menu wrapper favorite action color */
+ --pf-v5-c-select__menu-wrapper--m-favorite__menu-item--m-favorite-action--Color: var(--pf-global--palette--gold-400, #f0ab00);
+ /** Select menu wrapper favorite action hover color */
+ --pf-v5-c-select__menu-wrapper--m-favorite__menu-item--m-favorite-action--hover--Color: var(--pf-global--palette--gold-500, #c58c00);
+ /** Select menu wrapper favorite action focus color */
+ --pf-v5-c-select__menu-wrapper--m-favorite__menu-item--m-favorite-action--focus--Color: var(--pf-global--palette--gold-500, #c58c00);
+ /** Select menu item load color */
+ --pf-v5-c-select__menu-item--m-load--Color: var(--pf-global--link--Color, #06c);
+ /** Select menu item icon color */
+ --pf-v5-c-select__menu-item-icon--Color: var(--pf-global--active-color--100, #06c);
+ /** Select menu item icon font size */
+ --pf-v5-c-select__menu-item-icon--FontSize: var(--pf-global--icon--FontSize--sm, 0.625rem);
+ /** Select menu item icon right position */
+ --pf-v5-c-select__menu-item-icon--Right: var(--pf-global--spacer--md, 1rem);
+ /** Select menu item icon top position */
+ --pf-v5-c-select__menu-item-icon--Top: 50%;
+ /** Select menu item icon transform Y */
+ --pf-v5-c-select__menu-item-icon--TranslateY: -50%;
+ /** Select menu item action icon minimum height */
+ --pf-v5-c-select__menu-item-action-icon--MinHeight: calc(var(--pf-v5-c-select__menu-item--FontSize) * var(--pf-v5-c-select__menu-item--LineHeight));
+ /** Select menu item match font weight */
+ --pf-v5-c-select__menu-item--match--FontWeight: var(--pf-global--FontWeight--bold, 700);
+ /** Select menu search top padding */
+ --pf-v5-c-select__menu-search--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu search right padding */
+ --pf-v5-c-select__menu-search--PaddingRight: var(--pf-v5-c-select__menu-item--PaddingRight);
+ /** Select menu search bottom padding */
+ --pf-v5-c-select__menu-search--PaddingBottom: var(--pf-global--spacer--md, 1rem);
+ /** Select menu search left padding */
+ --pf-v5-c-select__menu-search--PaddingLeft: var(--pf-v5-c-select__menu-item--PaddingLeft);
+ /** Select menu group top padding */
+ --pf-v5-c-select__menu-group--menu-group--PaddingTop: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu group title top padding */
+ --pf-v5-c-select__menu-group-title--PaddingTop: var(--pf-v5-c-select__menu-item--PaddingTop);
+ /** Select menu group title right padding */
+ --pf-v5-c-select__menu-group-title--PaddingRight: var(--pf-v5-c-select__menu-item--PaddingRight);
+ /** Select menu group title bottom padding */
+ --pf-v5-c-select__menu-group-title--PaddingBottom: var(--pf-v5-c-select__menu-item--PaddingBottom);
+ /** Select menu group title left padding */
+ --pf-v5-c-select__menu-group-title--PaddingLeft: var(--pf-v5-c-select__menu-item--PaddingLeft);
+ /** Select menu group title font size */
+ --pf-v5-c-select__menu-group-title--FontSize: var(--pf-global--FontSize--xs, 0.75rem);
+ /** Select menu group title font weight */
+ --pf-v5-c-select__menu-group-title--FontWeight: var(--pf-global--FontWeight--normal, 400);
+ /** Select menu group title color */
+ --pf-v5-c-select__menu-group-title--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ /** Select menu item count left margin */
+ --pf-v5-c-select__menu-item-count--MarginLeft: var(--pf-global--spacer--md, 1rem);
+ /** Select menu item count font size */
+ --pf-v5-c-select__menu-item-count--FontSize: var(--pf-global--FontSize--sm, 0.875rem);
+ /** Select menu item count color */
+ --pf-v5-c-select__menu-item-count--Color: var(--pf-global--Color--200, #6a6e73);
+ /** Select menu item disabled count color */
+ --pf-v5-c-select__menu-item--disabled__menu-item-count--Color: var(--pf-global--Color--dark-200, #6a6e73);
+ /** Select menu item description font size */
+ --pf-v5-c-select__menu-item-description--FontSize: var(--pf-global--FontSize--xs, 0.75rem);
+ /** Select menu item description color */
+ --pf-v5-c-select__menu-item-description--Color: var(--pf-global--Color--200, #6a6e73);
+ /** Select menu item description right padding */
+ --pf-v5-c-select__menu-item-description--PaddingRight: var(--pf-v5-c-select__menu-item--PaddingRight);
+ /** Select menu item main right padding */
+ --pf-v5-c-select__menu-item-main--PaddingRight: var(--pf-v5-c-select__menu-item--PaddingRight);
+ /** Select menu item selected main right padding */
+ --pf-v5-c-select__menu-item--m-selected__menu-item-main--PaddingRight: var(--pf-v5-c-select__menu-item--m-selected--PaddingRight);
+ /** Select menu footer box shadow */
+ --pf-v5-c-select__menu-footer--BoxShadow: var(--pf-global--BoxShadow--sm-top, 0 -0.125rem 0.25rem -0.0625rem rgba(3, 3, 3, 0.16));
+ /** Select menu footer top padding */
+ --pf-v5-c-select__menu-footer--PaddingTop: var(--pf-global--spacer--md, 1rem);
+ /** Select menu footer right padding */
+ --pf-v5-c-select__menu-footer--PaddingRight: var(--pf-global--spacer--md, 1rem);
+ /** Select menu footer bottom padding */
+ --pf-v5-c-select__menu-footer--PaddingBottom: var(--pf-global--spacer--md, 1rem);
+ /** Select menu footer left padding */
+ --pf-v5-c-select__menu-footer--PaddingLeft: var(--pf-global--spacer--md, 1rem);
+ /** Select menu footer top margin */
+ --pf-v5-c-select__menu-footer--MarginTop: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu footer bottom margin */
+ --pf-v5-c-select__menu-footer--MarginBottom: calc(var(--pf-global--spacer--sm, 0.5rem) * -1);
+ /** Select menu divider top margin */
+ --pf-v5-c-select-menu--c-divider--MarginTop: var(--pf-global--spacer--sm, 0.5rem);
+ /** Select menu divider bottom margin */
+ --pf-v5-c-select-menu--c-divider--MarginBottom: var(--pf-global--spacer--sm, 0.5rem);
+}
+
+:host, #outer {
+ display: flex;
+ flex-direction: column;
+ align-items: stretch;
+}
+
+:host([hidden]),
+*[hidden] {
+ display: none !important;
+}
+
+:host([disabled]) {
+ pointer-events: none !important;
+}
+
+#outer.disabled {
+ color: var(--pf-global--Color--dark-200, #6a6e73) !important;
+}
+
+#outer {
+ position: relative;
+}
+
+/* TODO(bennyp): see if we can get rid of this wrapping node, for perf reasons */
+#listbox-container {
+ display: inline-flex;
+ border: 1px solid var(--pf-global--BorderColor--100, #d2d2d2);
+ position: absolute;
+ background-color: var(--pf-v5-theme--color--surface--lightest, #fff) !important;
+ opacity: 0;
+ --_active-descendant-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important
+}
+
+#outer.expanded #listbox-container {
+ opacity: 1;
+ z-index: 9999 !important;
+}
+
+#listbox {
+ display: flex;
+ flex-direction: column;
+ position: relative;
+ width: 100%;
+}
+
+#listbox slot.disabled {
+ color: var(--pf-v5-c-list__item-icon--Color, #6a6e73) !important;
+ background-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ border-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ pointer-events: none;
+ cursor: not-allowed;;
+ --_active-descendant-color: transparent;
+ --_svg-color: var(--pf-v5-c-list__item-icon--Color, #6a6e73) !important;
+}
+
+
+#toggle {
+ background-color: var(--pf-v5-theme--color--surface--lightest, #fff) !important;
+}
+
+#toggle,
+#toggle-button,
+#toggle-input {
+ display: flex;
+ align-items: center;
+ font-family: var(--pf-global--FontFamily--sans-serif, "RedHatTextUpdated", "Overpass", overpass, helvetica, arial, sans-serif);
+ font-size: var(--pf-global--FontSize--md, 16px);
+ font-weight: var(--pf-global--FontWeight--normal, 400);
+ line-height: 1.6;
+}
+
+#toggle {
+ border: 1px solid var(--pf-global--BorderColor--100, #d2d2d2);
+ border-bottom-color: var(--pf-v5-theme--color--text, #151515);
+ justify-content: space-between;
+}
+
+.expanded #toggle {
+ border-bottom-width: 2px;
+ border-bottom-color: var(--pf-v5-theme--color--accent, #0066cc);
+}
+
+.disabled #toggle {
+ color: var(--pf-global--Color--dark-200, #6a6e73) !important;
+ background-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+ border-color: var(--pf-v5-theme--color--surface--lighter, #f0f0f0) !important;
+}
+
+#toggle-input,
+#toggle-button {
+ background: transparent;
+ border: none;
+ text-align: left;
+ border-radius: 0;
+ flex: 1 0 auto;
+ min-height: 44px;
+ min-width: 44px;
+}
+
+#toggle-input {
+ justify-content: space-between;
+ padding: var(--pf-global--spacer--xs, 0.25rem) var(--pf-global--spacer--sm, 0.5rem);
+}
+
+.disabled #toggle-input {
+ pointer-events: none;
+}
+
+#toggle-button {
+ color: currentColor;
+ background-color: transparent;
+ justify-content: flex-end;
+ padding: var(--pf-global--spacer--sm, 0.5rem);
+}
+
+#toggle-button:focus:before {
+ border-bottom-color: var(--pf-v5-c-select__toggle--focus--before--BorderBottomColor);
+ border-bottom-width: var(--pf-v5-c-select__toggle--focus--before--BorderBottomWidth);
+}
+
+#outer.typeahead #toggle-button {
+ flex: 0 0 auto;
+}
+
+#toggle-badge {
+ flex: 1 0 auto;
+ margin-inline-start: 0.25em;
+}
+
+#toggle-text {
+ flex: 1 1 auto;
+}
+
+#toggle-text.badge {
+ flex: 0 1 auto;
+}
+
+pf-v5-badge {
+ padding: 0;
+}
+
+#toggle svg {
+ width: 1em;
+ height: 1em;
+ flex: 0 0 auto;
+ margin-inline-start: 1em;
+}
+
+#description {
+ display: block;
+}
+
+#listbox.checkboxes {
+ --_pf-option-checkboxes-display: inline;
+ --_pf-option-svg-display: none;
+}
+
+::slotted(pf-v5-option-group + hr) {
+ display: none !important;
+}
+
+::slotted(hr:has(+ pf-v5-option-group)) {
+ display: none !important;
+}
+
+.visually-hidden {
+ border: 0;
+ clip: rect(0, 0, 0, 0);
+ block-size: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ white-space: nowrap;
+ inline-size: 1px;
+}
+
+::slotted(hr) {
+ --pf-v5-c-divider--BorderWidth--base: var(--pf-global--BorderWidth--sm, 1px);
+ --pf-v5-c-divider--BorderColor--base: var(--pf-v5-c-divider--BackgroundColor);
+ --pf-v5-c-divider--Height: var(--pf-v5-c-divider--BorderWidth--base);
+ --pf-v5-c-divider--BackgroundColor: var(--pf-global--BorderColor--100, #d2d2d2);
+ --pf-v5-c-divider--after--BackgroundColor: var(--pf-v5-c-divider--BorderColor--base);
+ --pf-v5-c-divider--after--FlexBasis: 100%;
+ --pf-v5-c-divider--after--Inset: 0%;
+ --pf-v5-c-divider--m-vertical--after--FlexBasis: 100%;
+ --pf-v5-c-divider--m-horizontal--Display: flex;
+ --pf-v5-c-divider--m-horizontal--FlexDirection: row;
+ --pf-v5-c-divider--m-horizontal--after--Height: var(--pf-v5-c-divider--Height);
+ --pf-v5-c-divider--m-horizontal--after--Width: auto;
+ --pf-v5-c-divider--m-vertical--Display: inline-flex;
+ --pf-v5-c-divider--m-vertical--FlexDirection: column;
+ --pf-v5-c-divider--m-vertical--after--Height: auto;
+ --pf-v5-c-divider--m-vertical--after--Width: var(--pf-v5-c-divider--BorderWidth--base);
+ --pf-v5-hidden-visible--visible--Display: var(--pf-v5-c-divider--Display);
+ --pf-v5-c-divider--Display: var(--pf-v5-c-divider--m-horizontal--Display);
+ --pf-v5-c-divider--FlexDirection: var(--pf-v5-c-divider--m-horizontal--FlexDirection);
+ --pf-v5-c-divider--after--Width: var(--pf-v5-c-divider--m-horizontal--after--Width);
+ --pf-v5-c-divider--after--Height: var(--pf-v5-c-divider--m-horizontal--after--Height);
+ display: var(--pf-v5-c-divider--Display, flex);
+ flex-direction: var(--pf-v5-c-divider--FlexDirection);
+ border: 0;
+ width: 100%;
+ margin-top: var(--pf-v5-c-select-menu--c-divider--MarginTop);
+ margin-bottom: var(--pf-v5-c-select-menu--c-divider--MarginBottom);
+}
+
+::slotted(hr)::after {
+ content: '';
+ width: var(--pf-v5-c-divider--after--Width, 100%) !important;
+ height: var(--pf-v5-c-divider--after--Height, 1px);
+ background-color: var(--pf-v5-c-divider--after--BackgroundColor);
+ flex: 1 0 100%;
+}
diff --git a/elements/pf-select/pf-select.ts b/elements/pf-v5-select/pf-v5-select.ts
similarity index 87%
rename from elements/pf-select/pf-select.ts
rename to elements/pf-v5-select/pf-v5-select.ts
index 0bcf091e47..eda637b4c6 100644
--- a/elements/pf-select/pf-select.ts
+++ b/elements/pf-v5-select/pf-v5-select.ts
@@ -1,4 +1,4 @@
-import type { PfChipGroup } from '../pf-chip/pf-chip-group.js';
+import type { PfV5ChipGroup } from '../pf-v5-chip/pf-v5-chip-group.js';
import type { Placement } from '@patternfly/pfe-core/controllers/floating-dom-controller.js';
import type { TemplateResult } from 'lit';
@@ -19,12 +19,12 @@ import { FloatingDOMController } from '@patternfly/pfe-core/controllers/floating
import { arraysAreEquivalent } from '@patternfly/pfe-core/functions/arraysAreEquivalent.js';
import { observes } from '@patternfly/pfe-core/decorators/observes.js';
-import { PfOption } from './pf-option.js';
-import { type PfChip, PfChipRemoveEvent } from '../pf-chip/pf-chip.js';
+import { PfV5Option } from './pf-v5-option.js';
+import { type PfV5Chip, PfV5ChipRemoveEvent } from '../pf-v5-chip/pf-v5-chip.js';
-import styles from './pf-select.css';
+import styles from './pf-v5-select.css';
-export class PfSelectChangeEvent extends Event {
+export class PfV5SelectChangeEvent extends Event {
constructor() {
super('change', { bubbles: true });
}
@@ -40,8 +40,8 @@ export class PfSelectChangeEvent extends Event {
* @fires open - when the menu toggles open
* @fires close - when the menu toggles closed
*/
-@customElement('pf-select')
-export class PfSelect extends LitElement {
+@customElement('pf-v5-select')
+export class PfV5Select extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
static readonly formAssociated = true;
@@ -95,7 +95,7 @@ export class PfSelect extends LitElement {
type: Boolean,
}) checkboxSelectionBadgeHidden = false;
- @query('pf-chip-group') private _chipGroup?: PfChipGroup;
+ @query('pf-v5-chip-group') private _chipGroup?: PfV5ChipGroup;
@query('#toggle-input') private _toggleInput?: HTMLInputElement;
@@ -105,9 +105,9 @@ export class PfSelect extends LitElement {
@query('#listbox-container') private _listboxContainer?: HTMLElement;
- @query('#placeholder') private _placeholder?: PfOption;
+ @query('#placeholder') private _placeholder?: PfV5Option;
- #isNotPlaceholderOption = (option: PfOption) => option !== this._placeholder;
+ #isNotPlaceholderOption = (option: PfV5Option) => option !== this._placeholder;
#internals = InternalsController.of(this);
@@ -129,7 +129,7 @@ export class PfSelect extends LitElement {
requestShowListbox: () => void (this.expanded ||= true),
requestHideListbox: () => void (this.expanded &&= false),
setItemHidden: (item, hidden) => (item.id !== 'placeholder') && void (item.hidden = hidden),
- isItem: item => item instanceof PfOption,
+ isItem: item => item instanceof PfV5Option,
setItemActive: (item, active) => item.active = active,
setItemSelected: (item, selected) => item.selected = selected,
});
@@ -139,24 +139,24 @@ export class PfSelect extends LitElement {
* or array of select option values for multi select.
*/
@property({ hasChanged: (a, b) => !arraysAreEquivalent(a, b) })
- set selected(selected: PfOption | PfOption[]) {
+ set selected(selected: PfV5Option | PfV5Option[]) {
const list = Array.isArray(selected) ? selected : [selected];
this.#combobox.selected = list;
}
- get selected(): PfOption[] {
+ get selected(): PfV5Option[] {
return this.#combobox.selected;
}
/** List of options */
- get options(): PfOption[] {
+ get options(): PfV5Option[] {
if (isServer) {
return []; // TODO: expose a DOM property to allow setting options in SSR scenarios
} else {
return [
this._placeholder,
- ...Array.from(this.querySelectorAll('pf-option')),
- ].filter((x): x is PfOption => !!x && !x.hidden);
+ ...Array.from(this.querySelectorAll('pf-v5-option')),
+ ].filter((x): x is PfV5Option => !!x && !x.hidden);
}
}
@@ -200,12 +200,12 @@ export class PfSelect extends LitElement {
class="${classMap({ disabled, typeahead, expanded, [anchor]: !!anchor, [alignment]: !!alignment })}">
${!(typeahead && selectedOptions.length < 1) ? '' : html`
-
+
${repeat(selectedOptions, opt => opt.id, opt => html`
- ${opt.textContent} `)}
- `}
+ @remove="${this.#onChipRemove.bind(this, opt)}">${opt.textContent}`)}
+ `}
${!typeahead ? '' : html`
${this.#buttonLabel}${!hasBadge ? '' : html`
- ${selectedOptions.length}
+ ${selectedOptions.length}
`}
-
${placeholder ?? ''}
+ >
${placeholder ?? ''}
${this.#combobox.renderItemsToShadowRoot()}
-
+
@@ -265,7 +265,7 @@ export class PfSelect extends LitElement {
}
@observes('selected')
- private async selectedChanged(_: PfOption[], selected: PfOption[]) {
+ private async selectedChanged(_: PfV5Option[], selected: PfV5Option[]) {
this.value = selected.map(x => x.value).join();
await this.updateComplete;
switch (this.variant) {
@@ -289,14 +289,14 @@ export class PfSelect extends LitElement {
this.#combobox.multi = this.variant === 'typeaheadmulti' || this.variant === 'checkbox';
this.#combobox.hostConnected();
if (this.variant === 'checkbox') {
- import('@patternfly/elements/pf-badge/pf-badge.js');
+ import('@patternfly/elements/pf-v5-badge/pf-v5-badge.js');
}
}
@observes('value')
private valueChanged() {
this.#internals.setFormValue(this.value ?? '');
- this.dispatchEvent(new PfSelectChangeEvent());
+ this.dispatchEvent(new PfV5SelectChangeEvent());
}
@observes('variant')
@@ -308,7 +308,7 @@ export class PfSelect extends LitElement {
const hasChips = this.variant === 'typeaheadmulti';
if (hasChips && this._toggleInput?.value) {
const chip =
- this.shadowRoot?.querySelector(`pf-chip#chip-${this._toggleInput?.value}`) as PfChip;
+ this.shadowRoot?.querySelector(`pf-v5-chip#chip-${this._toggleInput?.value}`) as PfV5Chip;
if (chip && this._chipGroup) {
this._chipGroup.focusOnChip(chip);
this._toggleInput.value = '';
@@ -337,10 +337,10 @@ export class PfSelect extends LitElement {
/**
* handles chip's remove button clicking
* @param event remove event
- * @param opt pf-option
+ * @param opt pf-v5-option
*/
- #onChipRemove(opt: PfOption, event: Event) {
- if (event instanceof PfChipRemoveEvent) {
+ #onChipRemove(opt: PfV5Option, event: Event) {
+ if (event instanceof PfV5ChipRemoveEvent) {
opt.selected = false;
this._toggleInput?.focus();
}
@@ -389,7 +389,7 @@ export class PfSelect extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-select': PfSelect;
+ 'pf-v5-select': PfV5Select;
}
}
diff --git a/elements/pf-select/test/pf-select.e2e.ts b/elements/pf-v5-select/test/pf-select.e2e.ts
similarity index 95%
rename from elements/pf-select/test/pf-select.e2e.ts
rename to elements/pf-v5-select/test/pf-select.e2e.ts
index b537e0eff7..2b6d824f23 100644
--- a/elements/pf-select/test/pf-select.e2e.ts
+++ b/elements/pf-v5-select/test/pf-select.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-select';
+const tagName = 'pf-v5-select';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-select/test/pf-select.spec.ts b/elements/pf-v5-select/test/pf-select.spec.ts
similarity index 91%
rename from elements/pf-select/test/pf-select.spec.ts
rename to elements/pf-v5-select/test/pf-select.spec.ts
index 07c4cd6469..ed33aff65a 100644
--- a/elements/pf-select/test/pf-select.spec.ts
+++ b/elements/pf-v5-select/test/pf-select.spec.ts
@@ -1,10 +1,10 @@
import { expect, html, aTimeout, nextFrame } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
-import { PfSelect } from '../pf-select.js';
+import { PfV5Select } from '../pf-v5-select.js';
import { sendKeys } from '@web/test-runner-commands';
import { a11ySnapshot, querySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
import { clickElementAtCenter, clickElementAtOffset } from '@patternfly/pfe-tools/test/utils.js';
-import type { PfOption } from '../pf-option.js';
+import type { PfV5Option } from '../pf-v5-option.js';
async function holdShift() {
await sendKeys({ down: 'Shift' });
@@ -30,30 +30,30 @@ function press(key: string) {
/**
* Compare selection to an array of strings
- * @param element pf-select
+ * @param element pf-v5-select
* @returns a list of values of each selected option
*/
-function getSelectedOptionValues(element: PfSelect): string[] {
- return Array.from(element.querySelectorAll('[selected]'), x => x.value);
+function getSelectedOptionValues(element: PfV5Select): string[] {
+ return Array.from(element.querySelectorAll('[selected]'), x => x.value);
}
// a11yShapshot does not surface the options
-function getVisibleOptionValues(element: PfSelect): string[] {
+function getVisibleOptionValues(element: PfV5Select): string[] {
return element.options.filter(x => !x.hidden).map(x => x.value);
}
// a11yShapshot does not surface the options
-function getActiveOption(element: PfSelect) {
+function getActiveOption(element: PfV5Select) {
return element.options.find(x => x.active);
}
/**
* NOTE because of the copy-to-shadow-root shtick in ActivedescendantController,
* we can't just pick an option (from light dom);
- * @param element pf-select
+ * @param element pf-v5-select
* @param index item index
*/
-async function clickItemAtIndex(element: PfSelect, index: number) {
+async function clickItemAtIndex(element: PfV5Select, index: number) {
const itemHeight = 44;
await clickElementAtOffset(element, [
10,
@@ -63,30 +63,30 @@ async function clickItemAtIndex(element: PfSelect, index: number) {
});
}
-describe('', function() {
+describe('', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-select')).to.be.an.instanceof(PfSelect);
+ expect(document.createElement('pf-v5-select')).to.be.an.instanceof(PfV5Select);
});
it('should upgrade', async function() {
- expect(await createFixture(html` `))
- .to.be.an.instanceOf(customElements.get('pf-select'))
+ expect(await createFixture(html` `))
+ .to.be.an.instanceOf(customElements.get('pf-v5-select'))
.and
- .to.be.an.instanceOf(PfSelect);
+ .to.be.an.instanceOf(PfV5Select);
});
describe('with accessible-label attribute and 3 items', function() {
- let element: PfSelect;
+ let element: PfV5Select;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
- `);
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+ `);
});
it('passes aXe audit', async function() {
@@ -148,17 +148,17 @@ describe('', function() {
});
describe('with `placeholder` attribute and 3 items', function() {
- let element: PfSelect;
+ let element: PfV5Select;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
- `);
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+ `);
});
it('passes aXe audit', async function() {
@@ -242,17 +242,17 @@ describe('', function() {
});
describe('with 3 items and associated elements', function() {
- let element: PfSelect;
+ let element: PfV5Select;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
-
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+
label1
label2
`);
@@ -317,7 +317,7 @@ describe('', function() {
});
describe('in a deep shadow root', function() {
- let element: PfSelect;
+ let element: PfV5Select;
const focus = () => element.focus();
const updateComplete = () => element.updateComplete;
beforeEach(async function() {
@@ -326,18 +326,18 @@ describe('', function() {
-
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
-
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+
@@ -354,7 +354,7 @@ describe('', function() {
}
attachShadowRoots(document);
- const select = fixture.shadowRoot?.firstElementChild?.shadowRoot?.querySelector('pf-select');
+ const select = fixture.shadowRoot?.firstElementChild?.shadowRoot?.querySelector('pf-v5-select');
if (select) {
element = select;
await element?.updateComplete;
@@ -394,22 +394,22 @@ describe('', function() {
});
describe('with 8 items', function() {
- let element: PfSelect;
+ let element: PfV5Select;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- `);
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ `);
});
it('does not pass aXe audit', async function() {
@@ -726,26 +726,26 @@ describe('', function() {
});
});
-describe('', function() {
- let element: PfSelect;
- let items: PfOption[];
+describe('', function() {
+ let element: PfV5Select;
+ let items: PfV5Option[];
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
- (html`
+
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- `);
- items = Array.from(element.querySelectorAll('pf-option'));
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ `);
+ items = Array.from(element.querySelectorAll('pf-v5-option'));
});
it('is accessible', async function() {
@@ -1044,26 +1044,26 @@ describe('', function() {
});
});
-describe('', function() {
- let element: PfSelect;
+describe('', function() {
+ let element: PfV5Select;
const label = 'label';
const placeholder = 'placeholder';
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- Blue
- Green
- Magenta
- Orange
- Purple
- Periwinkle
- Pink
- Red
- Yellow
- `);
+ element = await createFixture(html`
+
+ Blue
+ Green
+ Magenta
+ Orange
+ Purple
+ Periwinkle
+ Pink
+ Red
+ Yellow
+ `);
});
beforeEach(nextFrame);
@@ -1527,15 +1527,15 @@ describe('', function() {
});
});
-describe('', function() {
- let element: PfSelect;
+describe('', function() {
+ let element: PfV5Select;
beforeEach(async function() {
- element = await createFixture(html`
-
- 1
- 2
- 3
-
+ element = await createFixture(html`
+
+ 1
+ 2
+ 3
+
label1
label2
`);
@@ -1563,23 +1563,23 @@ describe('', function() {
});
// try again when we implement activedescendant
-describe.skip('', function() {
- let element: PfSelect;
+describe.skip('', function() {
+ let element: PfV5Select;
const updateComplete = () => element.updateComplete;
const focus = () => element.focus();
beforeEach(async function() {
- element = await createFixture(html`
-
- Amethyst
- Beryl
- Chalcedony
- Diamond
- Emerald
- Fool's Gold
- Garnet
- Halite
- Iris
- `);
+ element = await createFixture(html`
+
+ Amethyst
+ Beryl
+ Chalcedony
+ Diamond
+ Emerald
+ Fool's Gold
+ Garnet
+ Halite
+ Iris
+ `);
});
describe('focus()', function() {
diff --git a/elements/pf-v5-spinner/README.md b/elements/pf-v5-spinner/README.md
new file mode 100644
index 0000000000..b915a948f5
--- /dev/null
+++ b/elements/pf-v5-spinner/README.md
@@ -0,0 +1,46 @@
+# PatternFly Elements Spinner
+
+`` is used to indicate to users that an action is in progress.
+
+Read more about Spinner in the [PatternFly Elements Spinner documentation](https://patternflyelements.org/components/spinner)
+
+## Installation
+
+Load `` via CDN:
+
+```html
+
+```
+
+Or, if you are using [NPM](https://npm.im), install it
+
+```bash
+npm install @patternfly/elements
+```
+
+Then once installed, import it to your application:
+
+```js
+import '@patternfly/elements/pf-v5-spinner/pf-v5-spinner.js';
+```
+
+## Usage
+```html
+Loading...
+```
+
+### Size variations
+
+```html
+Loading...
+Loading...
+Loading...
+Loading...
+```
+
+### Custom size
+
+```html
+Loading...
+```
+
diff --git a/elements/pf-v5-spinner/demo/diameter.html b/elements/pf-v5-spinner/demo/diameter.html
new file mode 100644
index 0000000000..a73e257c8a
--- /dev/null
+++ b/elements/pf-v5-spinner/demo/diameter.html
@@ -0,0 +1,15 @@
+
+ Custom size
+ Loading...
+
+
+
+
+
diff --git a/elements/pf-v5-spinner/demo/index.html b/elements/pf-v5-spinner/demo/index.html
new file mode 100644
index 0000000000..21e42b03fd
--- /dev/null
+++ b/elements/pf-v5-spinner/demo/index.html
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/elements/pf-v5-spinner/demo/size.html b/elements/pf-v5-spinner/demo/size.html
new file mode 100644
index 0000000000..52fcd54998
--- /dev/null
+++ b/elements/pf-v5-spinner/demo/size.html
@@ -0,0 +1,18 @@
+
+ Size variations
+ Loading...
+ Loading...
+ Loading...
+ Loading...
+
+
+
+
+
diff --git a/elements/pf-spinner/docs/CHANGELOG.old.md b/elements/pf-v5-spinner/docs/CHANGELOG.old.md
similarity index 100%
rename from elements/pf-spinner/docs/CHANGELOG.old.md
rename to elements/pf-v5-spinner/docs/CHANGELOG.old.md
diff --git a/elements/pf-spinner/docs/pf-spinner.md b/elements/pf-v5-spinner/docs/pf-spinner.md
similarity index 66%
rename from elements/pf-spinner/docs/pf-spinner.md
rename to elements/pf-v5-spinner/docs/pf-spinner.md
index 0aa5d3241f..595494f714 100644
--- a/elements/pf-spinner/docs/pf-spinner.md
+++ b/elements/pf-v5-spinner/docs/pf-spinner.md
@@ -3,25 +3,25 @@
{% renderOverview %}
A spinner is used to indicate to users that an action is in progress.
- Loading...
+ Loading...
{% endrenderOverview %}
{% band header="Usage" %}
### Basic
{% htmlexample %}
- Loading...
+ Loading...
{% endhtmlexample %}
### Size variations
{% htmlexample %}
- Loading...
- Loading...
- Loading...
- Loading...
+ Loading...
+ Loading...
+ Loading...
+ Loading...
{% endhtmlexample %}
### Custom size
{% htmlexample %}
- Loading...
+ Loading...
{% endhtmlexample %}
{% endband %}
diff --git a/elements/pf-spinner/docs/screenshot.png b/elements/pf-v5-spinner/docs/screenshot.png
similarity index 100%
rename from elements/pf-spinner/docs/screenshot.png
rename to elements/pf-v5-spinner/docs/screenshot.png
diff --git a/elements/pf-spinner/pf-spinner.css b/elements/pf-v5-spinner/pf-v5-spinner.css
similarity index 59%
rename from elements/pf-spinner/pf-spinner.css
rename to elements/pf-v5-spinner/pf-v5-spinner.css
index c9d3990ef0..7fe6fe2651 100644
--- a/elements/pf-spinner/pf-spinner.css
+++ b/elements/pf-v5-spinner/pf-v5-spinner.css
@@ -12,20 +12,20 @@
svg {
overflow: hidden;
/** Width for spinner */
- width: var(--pf-c-spinner--Width,
+ width: var(--pf-v5-c-spinner--Width,
/** Diameter for spinner */
- var(--pf-c-spinner--diameter,
+ var(--pf-v5-c-spinner--diameter,
var(--pf-global--icon--FontSize--xl, 3.375rem)));
/** Height for spinner */
- height: var(--pf-c-spinner--Height,
- var(--pf-c-spinner--diameter,
+ height: var(--pf-v5-c-spinner--Height,
+ var(--pf-v5-c-spinner--diameter,
var(--pf-global--icon--FontSize--xl, 3.375rem)));
animation:
- pf-c-spinner-animation-rotate
+ pf-v5-c-spinner-animation-rotate
/** Animation duration for spinner */
- calc(var(--pf-c-spinner--AnimationDuration, 1.4s) * 2)
+ calc(var(--pf-v5-c-spinner--AnimationDuration, 1.4s) * 2)
/** Animation timing function for spinner */
- var(--pf-c-spinner--AnimationTimingFunction, linear) infinite;
+ var(--pf-v5-c-spinner--AnimationTimingFunction, linear) infinite;
}
circle {
@@ -36,41 +36,41 @@ circle {
stroke-dasharray: 283;
stroke-dashoffset: 280;
/** Color for spinner */
- stroke: var(--pf-c-spinner--Color, var(--pf-global--primary-color--100, #06c));
+ stroke: var(--pf-v5-c-spinner--Color, var(--pf-global--primary-color--100, #06c));
/** Stroke width for spinner */
- stroke-width: var(--pf-c-spinner--stroke-width, 10);
+ stroke-width: var(--pf-v5-c-spinner--stroke-width, 10);
animation:
- pf-c-spinner-animation-dash
- var(--pf-c-spinner--AnimationDuration, 1.4s)
+ pf-v5-c-spinner-animation-dash
+ var(--pf-v5-c-spinner--AnimationDuration, 1.4s)
/** Path animation timing function for spinner */
- var(--pf-c-spinner__path--AnimationTimingFunction, ease-in-out) infinite;
+ var(--pf-v5-c-spinner__path--AnimationTimingFunction, ease-in-out) infinite;
}
:host([size="sm"]) svg {
/** Diameter for small spinner */
- --pf-c-spinner--diameter: var(--pf-c-spinner--m-sm--diameter,
+ --pf-v5-c-spinner--diameter: var(--pf-v5-c-spinner--m-sm--diameter,
var(--pf-global--icon--FontSize--sm, 0.625rem));
}
:host([size="md"]) svg {
/** Diameter for medium spinner */
- --pf-c-spinner--diameter: var(--pf-c-spinner--m-md--diameter,
+ --pf-v5-c-spinner--diameter: var(--pf-v5-c-spinner--m-md--diameter,
var(--pf-global--icon--FontSize--md, 1.125rem));
}
:host([size="lg"]) svg {
/** Diameter for large spinner */
- --pf-c-spinner--diameter: var(--pf-c-spinner--m-lg--diameter,
+ --pf-v5-c-spinner--diameter: var(--pf-v5-c-spinner--m-lg--diameter,
var(--pf-global--icon--FontSize--lg, 1.5rem));
}
:host([size="xl"]) svg {
/** Diameter for extra large spinner */
- --pf-c-spinner--diameter: var(--pf-c-spinner--m-xl--diameter,
+ --pf-v5-c-spinner--diameter: var(--pf-v5-c-spinner--m-xl--diameter,
var(--pf-global--icon--FontSize--xl, 3.375rem));
}
-@keyframes pf-c-spinner-animation-rotate {
+@keyframes pf-v5-c-spinner-animation-rotate {
0% {
transform: rotate(0deg);
}
@@ -79,14 +79,14 @@ circle {
}
}
-@keyframes pf-c-spinner-animation-dash {
+@keyframes pf-v5-c-spinner-animation-dash {
0% {
stroke-dashoffset: 280;
transform: rotate(0);
}
15% {
/** Path stroke width for spinner */
- stroke-width: calc(var(--pf-c-spinner__path--StrokeWidth, 10) - 4);
+ stroke-width: calc(var(--pf-v5-c-spinner__path--StrokeWidth, 10) - 4);
}
40% {
stroke-dashoffset: 150;
diff --git a/elements/pf-spinner/pf-spinner.ts b/elements/pf-v5-spinner/pf-v5-spinner.ts
similarity index 83%
rename from elements/pf-spinner/pf-spinner.ts
rename to elements/pf-v5-spinner/pf-v5-spinner.ts
index 62f906825a..6e108ce929 100644
--- a/elements/pf-spinner/pf-spinner.ts
+++ b/elements/pf-v5-spinner/pf-v5-spinner.ts
@@ -5,7 +5,7 @@ import { property } from 'lit/decorators/property.js';
import { InternalsController } from '@patternfly/pfe-core/controllers/internals-controller.js';
-import styles from './pf-spinner.css';
+import styles from './pf-v5-spinner.css';
/**
* A **spinner** is used to indicate to users that an action is in progress. For actions
@@ -13,8 +13,8 @@ import styles from './pf-spinner.css';
* @alias Spinner
*/
-@customElement('pf-spinner')
-export class PfSpinner extends LitElement {
+@customElement('pf-v5-spinner')
+export class PfV5Spinner extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
// eslint-disable-next-line no-unused-private-class-members
@@ -29,7 +29,7 @@ export class PfSpinner extends LitElement {
override render(): TemplateResult<1> {
return html`
+ style="${styleMap({ '--pf-v5-c-spinner--diameter': this.diameter })}">
`;
@@ -38,6 +38,6 @@ export class PfSpinner extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-spinner': PfSpinner;
+ 'pf-v5-spinner': PfV5Spinner;
}
}
diff --git a/elements/pf-spinner/test/pf-spinner.e2e.ts b/elements/pf-v5-spinner/test/pf-spinner.e2e.ts
similarity index 95%
rename from elements/pf-spinner/test/pf-spinner.e2e.ts
rename to elements/pf-v5-spinner/test/pf-spinner.e2e.ts
index e034c6cc06..c2d15212da 100644
--- a/elements/pf-spinner/test/pf-spinner.e2e.ts
+++ b/elements/pf-v5-spinner/test/pf-spinner.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-spinner';
+const tagName = 'pf-v5-spinner';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-spinner/test/pf-spinner.spec.ts b/elements/pf-v5-spinner/test/pf-spinner.spec.ts
similarity index 58%
rename from elements/pf-spinner/test/pf-spinner.spec.ts
rename to elements/pf-v5-spinner/test/pf-spinner.spec.ts
index 12b2621499..991004ff54 100644
--- a/elements/pf-spinner/test/pf-spinner.spec.ts
+++ b/elements/pf-v5-spinner/test/pf-spinner.spec.ts
@@ -1,31 +1,31 @@
import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
-import { PfSpinner } from '@patternfly/elements/pf-spinner/pf-spinner.js';
+import { PfV5Spinner } from '@patternfly/elements/pf-v5-spinner/pf-v5-spinner.js';
-describe('', function() {
+describe('', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-spinner')).to.be.an.instanceof(PfSpinner);
+ expect(document.createElement('pf-v5-spinner')).to.be.an.instanceof(PfV5Spinner);
});
it('should upgrade', async function() {
- const element = await createFixture(html`Loading... `);
- expect(element, 'pf-spinner should be an instance of PfeSpinner')
- .to.be.an.instanceOf(customElements.get('pf-spinner'))
+ const element = await createFixture(html`Loading... `);
+ expect(element, 'pf-v5-spinner should be an instance of PfeSpinner')
+ .to.be.an.instanceOf(customElements.get('pf-v5-spinner'))
.and
- .to.be.an.instanceOf(PfSpinner);
+ .to.be.an.instanceOf(PfV5Spinner);
});
it('should properly initialize the component', async function() {
- const element = await createFixture(html`
- Loading...
+ const element = await createFixture(html`
+ Loading...
`);
expect(element.getAttribute('size')).to.equal('xl');
});
describe('basic usage', function() {
- let element: PfSpinner;
+ let element: PfV5Spinner;
beforeEach(async function() {
- element = await createFixture(html`Loading... `);
+ element = await createFixture(html`Loading... `);
});
it('is accessible', async function() {
await expect(element).to.be.accessible();
@@ -33,7 +33,7 @@ describe('', function() {
});
describe('size attribute', function() {
- let element: PfSpinner;
+ let element: PfV5Spinner;
function convertRemToPixels(rem: `${number}rem`) {
const { fontSize } = getComputedStyle(document.documentElement);
@@ -41,8 +41,8 @@ describe('', function() {
}
beforeEach(async function() {
- element = await createFixture(html`
- Loading...
+ element = await createFixture(html`
+ Loading...
`);
});
@@ -63,8 +63,8 @@ describe('', function() {
describe('diameter attribute', function() {
it('sets the element diameter', async function() {
const customDiameterValue = 80;
- const element = await createFixture(html`
- Loading...
+ const element = await createFixture(html`
+ Loading...
`);
expect(element.offsetWidth).to.equal(customDiameterValue);
diff --git a/elements/pf-switch/README.md b/elements/pf-v5-switch/README.md
similarity index 63%
rename from elements/pf-switch/README.md
rename to elements/pf-v5-switch/README.md
index caabdba9cd..7ec65248dc 100644
--- a/elements/pf-switch/README.md
+++ b/elements/pf-v5-switch/README.md
@@ -1,16 +1,16 @@
# PatternFly Elements Switch
-`` is a switch that toggles the state of a setting (between on and
+`` is a switch that toggles the state of a setting (between on and
off). Switches provide a more explicit, visible representation on a setting.
Read more about Switch in the [PatternFly Elements Switch documentation](https://patternflyelements.org/components/switch)
## Installation
-Load `` via CDN:
+Load `` via CDN:
```html
-
+
```
Or, if you are using [NPM](https://npm.im), install it
@@ -22,22 +22,22 @@ npm install @patternfly/elements
Then once installed, import it to your application:
```js
-import '@patternfly/elements/pf-switch/pf-switch.js';
+import '@patternfly/elements/pf-v5-switch/pf-v5-switch.js';
```
### Note
-For `` to work in Safari, you'll need to load the [element-internals-polyfill](https://www.npmjs.com/package/element-internals-polyfill). Safari is in the process of [adding element internals to WebKit](https://bugs.webkit.org/show_bug.cgi?id=197960) so this polyfill should be temporary.
+For `` to work in Safari, you'll need to load the [element-internals-polyfill](https://www.npmjs.com/package/element-internals-polyfill). Safari is in the process of [adding element internals to WebKit](https://bugs.webkit.org/show_bug.cgi?id=197960) so this polyfill should be temporary.
## Usage
```html
-
+
Message when on
Message when off
```
### Form Associated
-`` is a form-associated custom element. That means that it can
+`` is a form-associated custom element. That means that it can
participate in HTML forms just like a native ` `. For example, if you add
the `name` attribute, or the `id` attribute, the element will appear in the
FormData object. For example, if you add the `name` attribute, or the `id`
@@ -46,11 +46,11 @@ attribute, the element will appear in the `FormData` object.
```html
Dark Mode
-
+
@@ -60,13 +60,13 @@ attribute, the element will appear in the `FormData` object.
### Without label
```html
-
+
```
### Checked with label
```html
-
+
Message when on
Message when off
```
@@ -77,13 +77,13 @@ attribute, the element will appear in the `FormData` object.
Checked and Disabled
-
+
Message when on
Message when off
-
+
Message when on
Message when off
diff --git a/elements/pf-switch/demo/checked.html b/elements/pf-v5-switch/demo/checked.html
similarity index 50%
rename from elements/pf-switch/demo/checked.html
rename to elements/pf-v5-switch/demo/checked.html
index c4e718db5f..1fa1c478fa 100644
--- a/elements/pf-switch/demo/checked.html
+++ b/elements/pf-v5-switch/demo/checked.html
@@ -2,7 +2,7 @@
Checked with label
-
+
Message when on
Message when off
@@ -13,8 +13,8 @@
diff --git a/elements/pf-switch/demo/disabled.html b/elements/pf-v5-switch/demo/disabled.html
similarity index 57%
rename from elements/pf-switch/demo/disabled.html
rename to elements/pf-v5-switch/demo/disabled.html
index 28f3862fb0..5926498974 100644
--- a/elements/pf-switch/demo/disabled.html
+++ b/elements/pf-v5-switch/demo/disabled.html
@@ -2,14 +2,14 @@
Checked and Disabled
-
+
Message when on
Message when off
-
+
Message when on
Message when off
@@ -20,7 +20,7 @@
diff --git a/elements/pf-switch/demo/index.html b/elements/pf-v5-switch/demo/index.html
similarity index 67%
rename from elements/pf-switch/demo/index.html
rename to elements/pf-v5-switch/demo/index.html
index 5407c73a3a..7036288f8d 100644
--- a/elements/pf-switch/demo/index.html
+++ b/elements/pf-v5-switch/demo/index.html
@@ -3,7 +3,7 @@
Option A
-
+
Message when on
Message when off
@@ -12,30 +12,30 @@
Option B (no explicit label)
-
+
Form Disabled State
-
+
Fieldset A is disabled
Fieldset A is enabled
-
+
Fieldset A is disabled
Fieldset A is enabled
-
+
Fieldset B is disabled
Fieldset B is enabled
-
+
Switch B is disabled
Switch B is enabled
@@ -46,8 +46,8 @@
diff --git a/elements/pf-v5-switch/demo/without-label.html b/elements/pf-v5-switch/demo/without-label.html
new file mode 100644
index 0000000000..cc56ce03ab
--- /dev/null
+++ b/elements/pf-v5-switch/demo/without-label.html
@@ -0,0 +1,39 @@
+
+
+
+ Without label
+
+
+
+
+
+
+
+
diff --git a/elements/pf-switch/docs/CHANGELOG.old.md b/elements/pf-v5-switch/docs/CHANGELOG.old.md
similarity index 100%
rename from elements/pf-switch/docs/CHANGELOG.old.md
rename to elements/pf-v5-switch/docs/CHANGELOG.old.md
diff --git a/elements/pf-switch/docs/pf-switch.md b/elements/pf-v5-switch/docs/pf-switch.md
similarity index 83%
rename from elements/pf-switch/docs/pf-switch.md
rename to elements/pf-v5-switch/docs/pf-switch.md
index 236833b15d..b65872d7e3 100644
--- a/elements/pf-switch/docs/pf-switch.md
+++ b/elements/pf-v5-switch/docs/pf-switch.md
@@ -4,7 +4,7 @@
A switch toggles the state of a setting (between on and off). Switches
provide a more explicit, visible representation on a setting.
-
+
Message when on
Message when off
@@ -14,7 +14,7 @@
{% band header="Usage" %}
### Basic
{% htmlexample %}
-
+
Message when on
Message when off
@@ -23,12 +23,12 @@
### Without label
{% htmlexample %}
-
+
{% endhtmlexample %}
### Checked with label
{% htmlexample %}
-
+
Message when on
Message when off
@@ -40,14 +40,14 @@
Checked and Disabled
-
+
Message when on
Message when off
-
+
Message when on
Message when off
diff --git a/elements/pf-switch/docs/screenshot.png b/elements/pf-v5-switch/docs/screenshot.png
similarity index 100%
rename from elements/pf-switch/docs/screenshot.png
rename to elements/pf-v5-switch/docs/screenshot.png
diff --git a/elements/pf-v5-switch/pf-v5-switch.css b/elements/pf-v5-switch/pf-v5-switch.css
new file mode 100644
index 0000000000..5f44607921
--- /dev/null
+++ b/elements/pf-v5-switch/pf-v5-switch.css
@@ -0,0 +1,154 @@
+:host {
+ display: inline-block;
+ outline: none;
+}
+
+svg {
+ fill: currentcolor;
+}
+
+[hidden] {
+ display: none !important;
+}
+
+:host([checked]) #container {
+ /** Color of the label when switch is checked */
+ color: var(--pf-v5-c-switch__input--checked__label--Color,
+ var(--pf-global--Color--dark-100, #151515));
+ /** Background color of the toggle when switch is checked */
+ background-color: var(--pf-v5-c-switch__input--checked__toggle--BackgroundColor,
+ var(--pf-global--primary-color--100, #06c));
+}
+
+:host([checked]) #container::before {
+ /** Translation of the toggle knob when checked */
+ translate: var(--pf-v5-c-switch__input--checked__toggle--before--TranslateX,
+ calc(100% + var(--pf-v5-c-switch__toggle-icon--Offset, 0.125rem)));
+}
+
+:host(:is(:focus,:focus-within)) #container {
+ /** Focus outline width */
+ outline: var(--pf-v5-c-switch__input--focus__toggle--OutlineWidth,
+ var(--pf-global--BorderWidth--md, 2px)) solid var(--pf-v5-c-switch__input--focus__toggle--OutlineColor,
+ var(--pf-global--primary-color--100, #06c));
+ /** Focus outline offset */
+ outline-offset: var(--pf-v5-c-switch__input--focus__toggle--OutlineOffset,
+ var(--pf-global--spacer--sm, 0.5rem));
+}
+
+:host(:disabled) {
+ pointer-events: none;
+ cursor: not-allowed;
+}
+
+:host(:disabled) #container {
+ cursor: not-allowed;
+
+ /** Color of the label when switch is disabled */
+ color: var(--pf-v5-c-switch__input--disabled__label--Color,
+ var(--pf-global--disabled-color--100, #6a6e73));
+ /** Background color when switch is disabled */
+ background-color: var(--pf-v5-c-switch__input--disabled__toggle--BackgroundColor,
+ var(--pf-global--disabled-color--200, #d2d2d2));
+}
+
+:host(:disabled) #container::before {
+ /** Background color of the toggle knob when disabled */
+ background-color: var(--pf-v5-c-switch__input--disabled__toggle--before--BackgroundColor,
+ var(--pf-global--palette--black-150, #f5f5f5));
+}
+
+:host([checked]:disabled) #container::before {
+ translate: var(--pf-v5-c-switch__input--checked__toggle--before--TranslateX,
+ calc(100% + var(--pf-v5-c-switch__toggle-icon--Offset, 0.125rem)));
+}
+
+:host(:disabled:focus-within) #container {
+ outline: none;
+}
+
+#container {
+ position: relative;
+ display: inline-flex;
+ align-items: center;
+ /** Width of the toggle */
+ width: var(--pf-v5-c-switch__toggle--Width,
+ calc(var(--pf-v5-c-switch__toggle--Height,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) * var(--pf-v5-c-switch--LineHeight,
+ var(--pf-global--LineHeight--md, 1.5)))) + var(--pf-v5-c-switch__toggle-icon--Offset, 0.125rem) + var(--pf-v5-c-switch__toggle--before--Width,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) - var(--pf-v5-c-switch__toggle-icon--Offset, 0.125rem)))));
+ height: var(--pf-v5-c-switch__toggle--Height,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) * var(--pf-v5-c-switch--LineHeight,
+ var(--pf-global--LineHeight--md, 1.5))));
+ /** Background color of the toggle */
+ background-color: var(--pf-v5-c-switch__toggle--BackgroundColor,
+ var(--pf-global--palette--black-500, #8a8d90));
+ /** Border radius of the toggle */
+ border-radius: var(--pf-v5-c-switch__toggle--BorderRadius,
+ var(--pf-v5-c-switch__toggle--Height, calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) * var(--pf-v5-c-switch--LineHeight,
+ var(--pf-global--LineHeight--md, 1.5)))));
+}
+
+#container::before {
+ position: absolute;
+ display: block;
+ content: "";
+ /** Top position of the toggle knob */
+ top: var(--pf-v5-c-switch__toggle--before--Top,
+ calc((var(--pf-v5-c-switch__toggle--Height,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) * var(--pf-v5-c-switch--LineHeight,
+ var(--pf-global--LineHeight--md, 1.5)))) - var(--pf-v5-c-switch__toggle--before--Height,
+ var(--pf-v5-c-switch__toggle--before--Width,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) - var(--pf-v5-c-switch__toggle-icon--Offset, 0.125rem))))) / 2));
+ /** Left position of the toggle knob */
+ left: var(--pf-v5-c-switch__toggle--before--Left,
+ var(--pf-v5-c-switch__toggle--before--Top,
+ calc((var(--pf-v5-c-switch__toggle--Height,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) * var(--pf-v5-c-switch--LineHeight,
+ var(--pf-global--LineHeight--md, 1.5)))) - var(--pf-v5-c-switch__toggle--before--Height,
+ var(--pf-v5-c-switch__toggle--before--Width,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) - var(--pf-v5-c-switch__toggle-icon--Offset, 0.125rem))))) / 2)));
+ /** Width of the toggle knob */
+ width: var(--pf-v5-c-switch__toggle--before--Width,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) - var(--pf-v5-c-switch__toggle-icon--Offset, 0.125rem)));
+ /** Height of the toggle knob */
+ height: var(--pf-v5-c-switch__toggle--before--Height,
+ var(--pf-v5-c-switch__toggle--before--Width,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) - var(--pf-v5-c-switch__toggle-icon--Offset, 0.125rem))));
+ /** Background color of the toggle knob */
+ background-color: var(--pf-v5-c-switch__toggle--before--backgroundcolor,
+ var(--pf-global--backgroundcolor--100, #fff));
+ /** Border radius of the toggle knob */
+ border-radius: var(--pf-v5-c-switch__toggle--before--BorderRadius,
+ var(--pf-global--BorderRadius--lg, 30em));
+ /** Box shadow of the toggle knob */
+ box-shadow: var(--pf-v5-c-switch__toggle--before--BoxShadow,
+ var(--pf-global--BoxShadow--md, 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06)));
+ /** Transition of the toggle knob */
+ transition: var(--pf-v5-c-switch__toggle--before--Transition,
+ var(--pf-v5-c-switch__toggle--before--Transition, translate .25s ease 0s));
+}
+
+svg {
+ /** Horizontal margin of the toggle icon */
+ margin-inline: var(--pf-v5-c-switch__toggle-icon--Left,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) * .4));
+ /** Font size of the toggle icon */
+ font-size: var(--pf-v5-c-switch__toggle-icon--FontSize,
+ calc(var(--pf-v5-c-switch--FontSize,
+ var(--pf-global--FontSize--md, 1rem)) * .625));
+ /** Color of the toggle icon */
+ color: var(--pf-v5-c-switch__toggle-icon--Color,
+ var(--pf-global--Color--light-100, #fff));
+}
diff --git a/elements/pf-switch/pf-switch.ts b/elements/pf-v5-switch/pf-v5-switch.ts
similarity index 96%
rename from elements/pf-switch/pf-switch.ts
rename to elements/pf-v5-switch/pf-v5-switch.ts
index 6b87fe359d..afde2d7f86 100644
--- a/elements/pf-switch/pf-switch.ts
+++ b/elements/pf-v5-switch/pf-v5-switch.ts
@@ -4,7 +4,7 @@ import { property } from 'lit/decorators/property.js';
import { InternalsController } from '@patternfly/pfe-core/controllers/internals-controller.js';
-import styles from './pf-switch.css';
+import styles from './pf-v5-switch.css';
/**
* A **switch** toggles the state of a setting (between on and off). Switches and
@@ -14,8 +14,8 @@ import styles from './pf-switch.css';
* @fires {Event} change - Fires when the switch selection changes.
*/
-@customElement('pf-switch')
-export class PfSwitch extends LitElement {
+@customElement('pf-v5-switch')
+export class PfV5Switch extends LitElement {
static readonly styles: CSSStyleSheet[] = [styles];
static readonly formAssociated = true;
@@ -128,6 +128,6 @@ export class PfSwitch extends LitElement {
declare global {
interface HTMLElementTagNameMap {
- 'pf-switch': PfSwitch;
+ 'pf-v5-switch': PfV5Switch;
}
}
diff --git a/elements/pf-switch/test/pf-switch.e2e.ts b/elements/pf-v5-switch/test/pf-switch.e2e.ts
similarity index 95%
rename from elements/pf-switch/test/pf-switch.e2e.ts
rename to elements/pf-v5-switch/test/pf-switch.e2e.ts
index e06cc70125..5b41db14f6 100644
--- a/elements/pf-switch/test/pf-switch.e2e.ts
+++ b/elements/pf-v5-switch/test/pf-switch.e2e.ts
@@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';
-const tagName = 'pf-switch';
+const tagName = 'pf-v5-switch';
test.describe(tagName, () => {
test('snapshot', async ({ page }) => {
diff --git a/elements/pf-switch/test/pf-switch.spec.ts b/elements/pf-v5-switch/test/pf-switch.spec.ts
similarity index 77%
rename from elements/pf-switch/test/pf-switch.spec.ts
rename to elements/pf-v5-switch/test/pf-switch.spec.ts
index 7331c07010..a4f9c10da8 100644
--- a/elements/pf-switch/test/pf-switch.spec.ts
+++ b/elements/pf-v5-switch/test/pf-switch.spec.ts
@@ -3,31 +3,31 @@ import { expect, html, nextFrame } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
-import { PfSwitch } from '@patternfly/elements/pf-switch/pf-switch.js';
+import { PfV5Switch } from '@patternfly/elements/pf-v5-switch/pf-v5-switch.js';
-describe('', function() {
+describe('', function() {
it('imperatively instantiates', function() {
- expect(document.createElement('pf-switch')).to.be.an.instanceof(PfSwitch);
+ expect(document.createElement('pf-v5-switch')).to.be.an.instanceof(PfV5Switch);
});
describe('simply instantiating', function() {
- let element: PfSwitch;
+ let element: PfV5Switch;
let snapshot: A11yTreeSnapshot;
beforeEach(async function() {
- const container = await createFixture(html`
+ const container = await createFixture(html`
`);
- element = container.querySelector('pf-switch')!;
- snapshot = await a11ySnapshot({ selector: 'pf-switch' });
+ element = container.querySelector('pf-v5-switch')!;
+ snapshot = await a11ySnapshot({ selector: 'pf-v5-switch' });
});
it('should upgrade', async function() {
- const klass = customElements.get('pf-switch');
+ const klass = customElements.get('pf-v5-switch');
expect(element)
.to.be.an.instanceOf(klass)
.and
- .to.be.an.instanceOf(PfSwitch);
+ .to.be.an.instanceOf(PfV5Switch);
});
it('has accessible role', function() {
expect(snapshot.role).to.equal('switch');
@@ -44,19 +44,19 @@ describe('', function() {
});
describe('with labels for on and off state', function() {
- let element: PfSwitch;
+ let element: PfV5Switch;
let snapshot: A11yTreeSnapshot;
beforeEach(async function() {
- const container = await createFixture(html`
+ const container = await createFixture(html`
-
+
Message when on
Message when off
`);
- element = container.querySelector('pf-switch')!;
+ element = container.querySelector('pf-v5-switch')!;
snapshot = await a11ySnapshot({ selector: '#switch' });
});
@@ -88,11 +88,11 @@ describe('', function() {
});
describe('when checked attr is present', function() {
- let element: PfSwitch;
+ let element: PfV5Switch;
let snapshot: A11yTreeSnapshot;
beforeEach(async function() {
- element = await createFixture(html`
-
+ element = await createFixture(html`
+