-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table): allow custom content in table cells - WIP
- Loading branch information
1 parent
9a5672b
commit ae1ddc5
Showing
12 changed files
with
564 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/pharos/src/components/table-body/pharos-table-body.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
display: contents; | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/pharos/src/components/table-body/pharos-table-body.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { html, type CSSResultArray, type TemplateResult } from 'lit'; | ||
import ScopedRegistryMixin from '../../utils/mixins/scoped-registry'; | ||
import { PharosElement } from '../base/pharos-element'; | ||
import { tableBodyStyles } from './pharos-table-body.css'; | ||
|
||
/** | ||
* Pharos table Body component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
export class PharosTableBody extends ScopedRegistryMixin(PharosElement) { | ||
public static override get styles(): CSSResultArray { | ||
return [tableBodyStyles]; | ||
} | ||
|
||
protected override firstUpdated(): void { | ||
this.setAttribute('role', 'rowgroup'); | ||
} | ||
|
||
protected override render(): TemplateResult { | ||
return html`<slot></slot>`; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/pharos/src/components/table-cell/pharos-table-cell.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:host { | ||
outline: 1px solid var(--pharos-table-body-color-border, var(--pharos-color-ui-30)); | ||
padding: var(--pharos-spacing-1-x); | ||
border-collapse: collapse; | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/pharos/src/components/table-cell/pharos-table-cell.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { html, type CSSResultArray, type TemplateResult } from 'lit'; | ||
import ScopedRegistryMixin from '../../utils/mixins/scoped-registry'; | ||
import { PharosElement } from '../base/pharos-element'; | ||
import { tableCellStyles } from './pharos-table-cell.css'; | ||
|
||
/** | ||
* Pharos table Cell Row component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
|
||
export class PharosTableCell extends ScopedRegistryMixin(PharosElement) { | ||
public static override get styles(): CSSResultArray { | ||
return [tableCellStyles]; | ||
} | ||
|
||
protected override firstUpdated(): void { | ||
this.setAttribute('role', 'rowgroup'); | ||
} | ||
|
||
protected override render(): TemplateResult { | ||
return html`<slot></slot>`; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/pharos/src/components/table-row/pharos-table-row.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:host { | ||
display: contents; | ||
gap: 10px; | ||
align-items: center; | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/pharos/src/components/table-row/pharos-table-row.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { html, type CSSResultArray, type TemplateResult } from 'lit'; | ||
import ScopedRegistryMixin from '../../utils/mixins/scoped-registry'; | ||
import { PharosElement } from '../base/pharos-element'; | ||
import { tableRowStyles } from './pharos-table-row.css'; | ||
|
||
/** | ||
* Pharos table Row component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
export class PharosTableRow extends ScopedRegistryMixin(PharosElement) { | ||
public static override get styles(): CSSResultArray { | ||
return [tableRowStyles]; | ||
} | ||
|
||
protected override firstUpdated(): void { | ||
this.setAttribute('role', 'rowgroup'); | ||
} | ||
|
||
protected override render(): TemplateResult { | ||
return html`<slot></slot>`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.