Skip to content

Commit

Permalink
fix(tile)!: remove BaseTile
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Oct 19, 2023
1 parent 24d43bd commit 4a82597
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 34 deletions.
4 changes: 4 additions & 0 deletions .changeset/remove-basetile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@patternfly/elements": major
---
`<pf-tile>`: Removed `BaseTile` class. Reimplement (recommended) or extend `PfTile`.
29 changes: 0 additions & 29 deletions elements/pf-tile/BaseTile.ts

This file was deleted.

24 changes: 19 additions & 5 deletions elements/pf-tile/pf-tile.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

import { LitElement, html } from 'lit';
import { customElement } from 'lit/decorators/custom-element.js';
import { property } from 'lit/decorators/property.js';

import { BaseTile } from './BaseTile.js';

import styles from './pf-tile.css';

export type StackedSize = (
Expand Down Expand Up @@ -54,15 +52,31 @@ export type StackedSize = (
* @cssprop {<length>} --pf-c-tile__icon--MarginRight {@default `0`}
* @cssprop {<length>} --pf-c-tile__icon--FontSize {@default `1.5rem`}
*
* @cssprop {<lenght>} --pf-c-tile__header--m-stacked__icon--MarginBottom {@default `0.25rem`}
* @cssprop {<length>} --pf-c-tile__header--m-stacked__icon--MarginBottom {@default `0.25rem`}
*/
@customElement('pf-tile')
export class PfTile extends BaseTile {
export class PfTile extends LitElement {
static readonly styles = [styles];

@property({ reflect: true, type: Boolean }) selected = false;

@property({ reflect: true }) stacked?: StackedSize;

override render() {
return html`
<div part="header">
<div part="icon">
<slot id="icon" name="icon"></slot>
</div>
<div part="title">
<slot id="title" name="title"></slot>
</div>
</div>
<div part="body">
<slot id="body"></slot>
</div>
`;
}
}

declare global {
Expand Down

0 comments on commit 4a82597

Please sign in to comment.