-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/navigation-secondary/rti
- Loading branch information
Showing
85 changed files
with
17,875 additions
and
211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
'@rhds/elements': minor | ||
--- | ||
|
||
✨ Added `<rh-table>`. | ||
|
||
A table is a container for displaying information. It allows a user to scan, examine, and compare large amounts of data. | ||
|
||
```html | ||
<rh-table> | ||
<table> | ||
<caption> | ||
Concerts | ||
</caption> | ||
<colgroup> | ||
<col> | ||
<col> | ||
<col> | ||
</colgroup> | ||
<thead> | ||
<tr> | ||
<th scope="col" data-label="Date">Date</th> | ||
<th scope="col" data-label="Event">Event<rh-sort-button></rh-sort-button></th> | ||
<th scope="col" data-label="Venue">Venue<rh-sort-button></rh-sort-button></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td data-label="Date">12 February</td> | ||
<td data-label="Event">Waltz with Strauss</td> | ||
<td data-label="Venue">Main Hall</td> | ||
</tr> | ||
<tr> | ||
<td data-label="Date">24 March</td> | ||
<td data-label="Event">The Obelisks</td> | ||
<td data-label="Venue">West Wing</td> | ||
</tr> | ||
<tr> | ||
<td data-label="Date">14 April</td> | ||
<td data-label="Event">The What</td> | ||
<td data-label="Venue">Main Hall</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<small slot="summary">Dates and venues subject to change.</small> | ||
</rh-table> | ||
``` |
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,7 @@ | ||
--- | ||
"@rhds/elements": patch | ||
--- | ||
|
||
`<rh-avatar>`: | ||
`<rh-code-block>`: | ||
`<rh-navigation-secondary>`: Updated custom elements manifest summaries |
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 @@ | ||
--- | ||
"@rhds/elements": patch | ||
--- | ||
|
||
`<rh-navigation-secondary>`: corrected and updated support for current page indicator |
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 @@ | ||
--- | ||
"@rhds/elements": patch | ||
--- | ||
|
||
`<rh-cta>`: adds `color-palette` attribute back with deprecation notice |
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
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
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,146 @@ | ||
import { LitElement, html, css } from 'lit'; | ||
import { classMap } from 'lit/directives/class-map.js'; | ||
|
||
import 'playground-elements'; | ||
import '@rhds/elements/rh-button/rh-button.js'; | ||
import '@rhds/elements/rh-spinner/rh-spinner.js'; | ||
|
||
class RhPlayground extends LitElement { | ||
static styles = css` | ||
:host { | ||
position: relative; | ||
display: block; | ||
--_max-height: 785px; | ||
} | ||
::slotted(pre) { | ||
max-height: var(--_max-height); | ||
margin: 0 !important; | ||
} | ||
[hidden], | ||
div.showing { | ||
display: none !important; | ||
} | ||
div { | ||
max-height: var(--_max-height); | ||
overflow-y: scroll; | ||
} | ||
rh-button { | ||
position: absolute; | ||
inset-block-end: 5px; | ||
inset-inline-end: 5px; | ||
display: block; | ||
} | ||
rh-spinner { | ||
opacity: 0; | ||
transition: opacity 0.5s ease; | ||
position: absolute; | ||
inset-block-start: 50%; | ||
inset-inline-start: 50%; | ||
transform: translateY(-50%) translateX(-50%); | ||
} | ||
.loading rh-spinner { | ||
opacity: 1; | ||
} | ||
.loading ::slotted(pre) { | ||
opacity: .3; | ||
} | ||
playground-project { | ||
display: block; | ||
border: var(--rh-border-width-md, 2px) solid var(--rh-color-border-subtle-on-light, #c7c7c7); | ||
border-radius: var(--rh-border-radius-default, 3px); | ||
overflow: hidden; | ||
} | ||
playground-preview { | ||
resize: vertical; | ||
overflow: hidden; | ||
} | ||
`; | ||
|
||
static properties = { | ||
loading: { type: Boolean, state: true }, | ||
showing: { type: Boolean, state: true }, | ||
tagName: { attribute: 'tag-name' }, | ||
}; | ||
|
||
constructor() { | ||
super(); | ||
/** Is the demo code loading? */ | ||
this.loading = false; | ||
/** Is the demo displayed? */ | ||
this.showing = false; | ||
this.project; // ?: PlaygroundProject | null; | ||
this.tabBar; // ?: PlaygroundTabBar | null; | ||
this.fileEditor; // ?: PlaygroundFileEditor | null; | ||
this.preview; // ?: PlaygroundPreview | null; | ||
} | ||
|
||
render() { | ||
const { showing, loading } = this; | ||
return html` | ||
<div id="snippet" class="${classMap({ showing, loading })}"> | ||
<slot></slot> | ||
<rh-spinner>Loading demo...</rh-spinner> | ||
</div> | ||
<rh-button ?hidden="${showing}" @click="${this.load}">Load Demo</rh-button> | ||
<playground-project ?hidden="${!showing}"> | ||
<playground-tab-bar @click="${this.onChange}"></playground-tab-bar> | ||
<playground-file-editor @click="${this.onChange}" @keydown="${this.onChange}"></playground-file-editor> | ||
<playground-preview></playground-preview> | ||
</playground-project> | ||
`; | ||
} | ||
|
||
firstUpdated() { | ||
this.project = this.shadowRoot?.querySelector('playground-project'); | ||
this.tabBar = this.shadowRoot?.querySelector('playground-tab-bar'); | ||
this.fileEditor = this.shadowRoot?.querySelector('playground-file-editor'); | ||
this.preview = this.shadowRoot?.querySelector('playground-preview'); | ||
if (this.project && this.tabBar && this.fileEditor && this.preview) { | ||
this.tabBar.project = this.project; | ||
this.fileEditor.project = this.project; | ||
this.preview.project = this.project; | ||
} | ||
} | ||
|
||
onChange(event) { | ||
if (event.target === this.tabBar) { | ||
// @ts-expect-error: need a better way to handle this, but works for now | ||
this.switch((event.target)._activeFileName); | ||
} else { | ||
this.switch((event.target).filename); | ||
} | ||
} | ||
|
||
switch(filename) { | ||
if (filename && this.preview && this.fileEditor) { | ||
this.preview.htmlFile = filename; | ||
this.fileEditor.filename = filename; | ||
} | ||
} | ||
|
||
async load() { | ||
this.loading = true; | ||
this.switch('demo/index.html'); | ||
const { configure } = await import(`/assets/playgrounds/${this.tagName}-playground.js`); | ||
configure(this.project); | ||
await import('playground-elements'); | ||
this.show(); | ||
} | ||
|
||
show() { | ||
this.loading = false; | ||
this.showing = true; | ||
} | ||
} | ||
|
||
customElements.define('rh-playground', RhPlayground); |
Oops, something went wrong.