-
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 complex items in table
- Loading branch information
1 parent
91870ce
commit af1849a
Showing
17 changed files
with
522 additions
and
176 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
114 changes: 114 additions & 0 deletions
114
packages/pharos-site/src/components/statics/component-status/initComponents.js
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,114 @@ | ||
import { | ||
PharosAlert, | ||
PharosBreadcrumb, | ||
PharosBreadcrumbItem, | ||
PharosButton, | ||
PharosCheckbox, | ||
PharosCheckboxGroup, | ||
PharosCoachMark, | ||
PharosCombobox, | ||
PharosDropdownMenu, | ||
PharosDropdownMenuItem, | ||
PharosDropdownMenuNav, | ||
PharosDropdownMenuNavLink, | ||
PharosDropdownMenuNavCategory, | ||
PharosFooter, | ||
PharosHeader, | ||
PharosHeading, | ||
PharosIcon, | ||
PharosImageCard, | ||
PharosInputGroup, | ||
PharosInputGroupSelect, | ||
PharosLayout, | ||
PharosLink, | ||
PharosLoadingSpinner, | ||
PharosModal, | ||
PharosPagination, | ||
PharosPopover, | ||
PharosProgressBar, | ||
PharosRadioButton, | ||
PharosRadioGroup, | ||
PharosSelect, | ||
PharosSheet, | ||
PharosSidenav, | ||
PharosSidenavLink, | ||
PharosSidenavMenu, | ||
PharosSidenavSection, | ||
PharosSwitch, | ||
PharosTabs, | ||
PharosTab, | ||
PharosTable, | ||
PharosTableBody, | ||
PharosTableHeader, | ||
PharosTableRow, | ||
Pharos, | ||
PharosTableCell, | ||
PharosTableHeaderCell, | ||
PharosTabPanel, | ||
PharosTextInput, | ||
PharosTextarea, | ||
PharosToast, | ||
PharosToaster, | ||
PharosToastButton, | ||
PharosToggleButton, | ||
PharosToggleButtonGroup, | ||
PharosTooltip, | ||
} from '../packages/pharos/lib/index'; | ||
import registerComponents from '../packages/pharos/lib/utils/registerComponents'; | ||
|
||
registerComponents('storybook', [ | ||
PharosAlert, | ||
PharosBreadcrumb, | ||
PharosBreadcrumbItem, | ||
PharosButton, | ||
PharosCheckbox, | ||
PharosCheckboxGroup, | ||
PharosCoachMark, | ||
PharosCombobox, | ||
PharosDropdownMenu, | ||
PharosDropdownMenuItem, | ||
PharosDropdownMenuNav, | ||
PharosDropdownMenuNavLink, | ||
PharosDropdownMenuNavCategory, | ||
PharosFooter, | ||
PharosHeader, | ||
PharosHeading, | ||
PharosIcon, | ||
PharosImageCard, | ||
PharosInputGroup, | ||
PharosInputGroupSelect, | ||
PharosLayout, | ||
PharosLink, | ||
PharosLoadingSpinner, | ||
PharosModal, | ||
PharosPagination, | ||
PharosPopover, | ||
PharosProgressBar, | ||
PharosRadioButton, | ||
PharosRadioGroup, | ||
PharosSelect, | ||
PharosSheet, | ||
PharosSidenav, | ||
PharosSidenavLink, | ||
PharosSidenavMenu, | ||
PharosSidenavSection, | ||
PharosSwitch, | ||
PharosTabs, | ||
PharosTab, | ||
PharosTable, | ||
PharosTableBody, | ||
PharosTableHeader, | ||
PharosTableHeaderCell, | ||
PharosTableCell, | ||
PharosTableRow, | ||
Pharos, | ||
PharosTabPanel, | ||
PharosTextInput, | ||
PharosTextarea, | ||
PharosToast, | ||
PharosToaster, | ||
PharosToastButton, | ||
PharosToggleButton, | ||
PharosToggleButtonGroup, | ||
PharosTooltip, | ||
]); |
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: table-row-group; | ||
} |
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 { tableBodyStyles } from './pharos-table-body.css'; | ||
|
||
/** | ||
* Pharos table Body component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
export class PharosTableBody extends ScopedRegistryMixin(PharosElement) { | ||
constructor() { | ||
super(); | ||
this.role = 'rowgroup'; | ||
} | ||
|
||
public static override get styles(): CSSResultArray { | ||
return [tableBodyStyles]; | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:host { | ||
display: table-cell; | ||
border: 1px solid var(--pharos-table-body-color-border, var(--pharos-color-ui-30)); | ||
padding: var(--pharos-spacing-1-x); | ||
} |
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) { | ||
constructor() { | ||
super(); | ||
this.role = 'cell'; | ||
} | ||
|
||
public static override get styles(): CSSResultArray { | ||
return [tableCellStyles]; | ||
} | ||
|
||
protected override render(): TemplateResult { | ||
return html`<slot></slot>`; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/pharos/src/components/table/pharos-table-header-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,6 @@ | ||
:host { | ||
display: table-cell; | ||
font-weight: bold; | ||
border: 1px solid var(--pharos-table-header-color-border, var(--pharos-color-ui-30)); | ||
padding: var(--pharos-spacing-1-x); | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/pharos/src/components/table/pharos-table-header-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,25 @@ | ||
import { html, type CSSResultArray, type TemplateResult } from 'lit'; | ||
import ScopedRegistryMixin from '../../utils/mixins/scoped-registry'; | ||
import { PharosElement } from '../base/pharos-element'; | ||
import { tableHeaderCellStyles } from './pharos-table-header-cell.css'; | ||
|
||
/** | ||
* Pharos table Cell Row component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
export class PharosTableHeaderCell extends ScopedRegistryMixin(PharosElement) { | ||
constructor() { | ||
super(); | ||
this.role = 'columnheader'; | ||
} | ||
public static override get styles(): CSSResultArray { | ||
return [tableHeaderCellStyles]; | ||
} | ||
|
||
protected override render(): TemplateResult { | ||
return html`<slot></slot>`; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/pharos/src/components/table/pharos-table-header.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,4 @@ | ||
:host { | ||
display: table-header-group; | ||
background-color: var(--pharos-table-header-color-background, var(--pharos-color-ui-20)); | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/pharos/src/components/table/pharos-table-header.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 { tableHeaderStyles } from './pharos-table-header.css'; | ||
|
||
/** | ||
* Pharos table Head component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
export class PharosTableHeader extends ScopedRegistryMixin(PharosElement) { | ||
constructor() { | ||
super(); | ||
this.role = 'rowgroup'; | ||
} | ||
|
||
public static override get styles(): CSSResultArray { | ||
return [tableHeaderStyles]; | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
display: table-row; | ||
} |
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) { | ||
constructor() { | ||
super(); | ||
this.role = 'row'; | ||
} | ||
|
||
public static override get styles(): CSSResultArray { | ||
return [tableRowStyles]; | ||
} | ||
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
File renamed without changes.
Oops, something went wrong.