Skip to content

Commit

Permalink
release: chansey (#1461)
Browse files Browse the repository at this point in the history
* docs: draft release notes

* fix(tabs): improve long tab content with container queries (#1411)

* fix(tabs): improve long tab content with container queries

* chore(tabs): add changeset

* docs(tabs): update long tab content

* docs: update .changeset/silver-hornets-cry.md

---------

Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>

* feat(skip-link): add `<rh-skip-link>` (#1515)

* feat(skip-link): add `<rh-skip-link>`

* chore(skip-link): add changeset

* docs(skip-link): add appropriate screenshot

* fix: added lightdom-shim.css to export

* chore: add Adam Johnson to contributors list

* chore(skip-link): update readme

* fix(skip-link): implement lightdom-shim

* docs(skip-link): added JSDoc

* docs(skip-link): enlarge screenshot

* test(skip-link): add tests

* chore(skip-link): lint tests

* fix(skip-link): remove empty demo files

* fix(skip-link): create container and move styles

* fix(skip-link): reformat `.changeset`

* fix(skip-link): add important to every CSS property

* docs(skip-link): reformat `.changeset`.

* fix(skip-link): Remove `!important` from lightdom shim.

* fix(skip-link): set `font-size`

* refactor(skip-link): change container `id` name

* test(skip-link): refactor tests

* feat: add more skip links docs content

Note: There are a few images that still need to be added.

* feat: add images to accessibility page

* feat: add static image of skip link to Overview subpage

* docs(skip-link): add sample element

* feat: add deprecation alert to skip navigation page

* test(skip-link): use `aTimeout` for focus test

* feat: make the best practices more clear

* docs(skip-link): add repoStatus

* docs(skip-links): remove extraneous repoStatus shortcodes

---------

Co-authored-by: marionnegp <mapatel@redhat.com>
Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

* feat(back-to-top): add `<rh-back-to-top>` (#1517)

* feat(back-to-top): add `<rh-back-to-top>`

* chore(back-to-top): lint

* fix(back-to-top): support dev server and docs demo

* fix(back-to-top): suggestion for focus ring when on differnt backgrounds

* docs(back-to-top): update readme

* test(back-to-top): add tests

* chore(back-to-top): add changeset

* docs(back-to-top): remove comment

* chore(back-to-top): update changeset with example

* chore(back-to-top): remove unused demo.css

* docs(back-to-top): improve screenshot

* docs(back-to-top): attempt fix for playground view

* fix(back-to-top): change attribute to visible="always"

* docs(back-to-top): add back to top to repo status

* docs: fix bug when component isnt yet in the repoStatus.yml

* docs(back-to-top): update shortcodes for repoStatus

---------

Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>

* fix!: context types (#1518)

* fix(lib)!: context types

webcomponents-cg/community-protocols#59
made a breaking change to the way the context protocol works.
This commit brings our types in line with the new types on the protocol

* fix(context)!: adapt our contexts to new types

see lit/lit#4614 and https://github.com/webcomponents-cg/community-protocols/pull/59/files

* docs: create changeset

---------

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

* feat(code-block): actions and line numbers (#1496)

* feat(code-block): wip extensions

* feat(code-block): wrap

* feat(code-block): show more

* perf(code-block): don't clone to compute lines

thanks @nikkimk!

* feat(code-block): line numbers

* feat(code-block): icons

still tbd: switching text of toggle button from "toggle wrap" to "toggle overflow" - probably should be a pattern thing

* fix(code-block): toggle slots for actions

* fix(code-block): style adjustments

* fix(code-block): classic css whoopsie

* fix(code-block): gradient

this was fun to debug. the key insight is that pseudo elements of a grid
are *also* grid items

* docs(code-block): changesets

* docs(code-block): jsdoc

* fix(code-block): review notes

* docs(code-block): remove expandable demo

it was decided (cc @coreyvickery) that expandable would automatically determined

* docs(code-block): remove card with tabs demo

should be revisited after PFE3/TabsAriaController

* fix(code-block): refactor in anticipation of rh-fab

* fix(code-block): polish up actions

* fix(code-block): wrap fab state

* fix(code-block): badge, not tag

* fix: 🦄

* fix(code-block): remove actions slot

* fix(code-block): expand button styles

* fix(code-block): tooltip state in wrap

* feat: update code for action buttons in color context demo

---------

Co-authored-by: marionnegp <mapatel@redhat.com>

* chore: update to @patternfly/pfe-core version 3.0 (#1508)

* chore: update patternfly/elements dep to 3.0

* chore: update lit and typescript deps

* chore: update typescript config and declaration

* fix(tile): update internals controller instantiation

* fix(button): update internals controller instantiation

* fix(accordion): update rti api for setting active item

* fix(menu): update rti api for setting active item

* fix(navigation-secondary): update rti api for setting active item

* fix(subnav): update rti api for setting active item

* fix(tabs): update rti api for setting active item

* chore: remove pfe elements from dep to a devDep add pfe-core as dep

* docs(dialog): remove unneeded imports from demo

* chore: lint

* chore: update deps

* test(tile): tile group a11y spec

* chore: node version

* docs: remove cases of band shortcode

* docs: uxdot-search a11y tweaks

* docs: 11ty plugins

* docs: import package

* fix(button): lint a11y in template

* fix(audio-player): label dialog from it's opening button

* chore: add playwright browser install to test workflow

* fix(tooltip): a11y template linting

* fix(tabs): use context instead of lightdom classes

* docs: add @lit/context to importMap

* style(tabs): lint css

* fix(tabs) revert use context instead of lightdom classes

* fix(tabs): Reverts 4b27d24

* chore: update lit/context to 1.1.1

* fix(menu): implement updated RTIC api

* test(menu): remove pageup and pagedown tests reserved for scrolling page

* refactor: no side effects in getters

* test(footer): deflake tests

* test(tooltip): assert on ax tree instead of shadow root

* fix(tooltip): invert css to hide content until open / initialized

* fix(tabs): use aria-tabs-controller

* fix(tabs): refactor using pfe-core 3

* fix(tabs): tab context

* fix(tabs): box context

---------

Co-authored-by: Benny Powers <web@bennypowers.com>
Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>

* chore: eslint 9 (#1523)

* chore: update linters

* style: lint everything

* chore: add optional dependency for rollup-darwin-x64

* style: lint line length and autofixes

* chore: add .cache files to eslint ignore

* style(tile): lint line length

* style: more linting

* fix(tile): replace mistakenly deleted expression

* fix(navigation-secondary): query for all nav links

update RTIC usage

* fix(navigation-secondary): update items on slotchange

* test(skip-link): visibility assertion

---------

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

* feat(site-status): add `<rh-site-status>` (#1507)

* feat(site-status): add site-status

* fix(site-status): add missing export

* chore(site-stutus): fix comment

* fix(site-status): lint

* fix(site-status): add color-context

* test(site-staus): fix missing semi colon

* fix(site-status): remove errant import

* fix(site-status): allow endpoint to be overridden

* docs(site-status): add incorrect endpoint demo

* docs(site-status): correct auto generated template for demo

* test(site-status): improve tests

* fix(site-status): lint

* fix(site-status): lint

* fix(site-status): ugh lint...

* fix(site-status): revert customizable endpoint, add href to status page link

* test(site-status): improve tests

* docs(site-status): add status demos

* docs(site-status): stub docs

* docs(site-status): add jsdoc

* docs: add site-status to related items

* fix(site-status): add type guard for api response

* docs(site-status): update readme

* docs(site-status): imporove jsdoc

* docs(site-status): add docs pages and images

* chore(site-status): add changeset

* chore(site-status): update changeset to include example

* chore(site-status): remove unused demo files

* fix(site-status): remove unused part

* style(site-status): reorder type

* fix(site-status): make #isApiStatus static

* fix(site-status): class decorators cant be use with static private identifier

* fix(site-status): move getStatus to firstUpdated, remove extraneous throw

* fix(site-status): handle capitalization in css

* fix(site-status): correct first letter uppercase style

* fix(site-status): revert response error removal

* fix(site-status): remove status as statusText includes the 404 text.

* fix(site-status): correct viewbox attr

* docs(site-status): add repoStatus

* test(site-status): use sinon for fetch stub

* test(site-status): remove unused aTimeout

* fix(site-status): switch api call to a try catch

* fix(site-status): remove contextProvider not used in design spec

* fix(site-status): use block instead of display contents on host

* fix(site-status): move restore of fetch to top describes

* fix(site-status): implement loading-text slot for translations and accessibility with aria-polite and aria-busy

* docs(site-status): improve demos with loading state demo

* fix(site-status): add focus and hover states

* docs(site-status): add if status is still loading to accessibility

* fix(site-status): readding color context provider

* chore(site-status): lint

* fix(site-status): remove context provider add dark styles

* docs(site-status): readding arg check to fetch override

* chore(site-status): lint

* docs: update .changeset/witty-papayas-tease.md

* style: lint

* feat: react wrappers (#1527)

* docs: draft release notes

* fix(tabs): improve long tab content with container queries (#1411)

* fix(tabs): improve long tab content with container queries

* chore(tabs): add changeset

* docs(tabs): update long tab content

* docs: update .changeset/silver-hornets-cry.md

---------

Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>

* feat(skip-link): add `<rh-skip-link>` (#1515)

* feat(skip-link): add `<rh-skip-link>`

* chore(skip-link): add changeset

* docs(skip-link): add appropriate screenshot

* fix: added lightdom-shim.css to export

* chore: add Adam Johnson to contributors list

* chore(skip-link): update readme

* fix(skip-link): implement lightdom-shim

* docs(skip-link): added JSDoc

* docs(skip-link): enlarge screenshot

* test(skip-link): add tests

* chore(skip-link): lint tests

* fix(skip-link): remove empty demo files

* fix(skip-link): create container and move styles

* fix(skip-link): reformat `.changeset`

* fix(skip-link): add important to every CSS property

* docs(skip-link): reformat `.changeset`.

* fix(skip-link): Remove `!important` from lightdom shim.

* fix(skip-link): set `font-size`

* refactor(skip-link): change container `id` name

* test(skip-link): refactor tests

* feat: add more skip links docs content

Note: There are a few images that still need to be added.

* feat: add images to accessibility page

* feat: add static image of skip link to Overview subpage

* docs(skip-link): add sample element

* feat: add deprecation alert to skip navigation page

* test(skip-link): use `aTimeout` for focus test

* feat: make the best practices more clear

* docs(skip-link): add repoStatus

* docs(skip-links): remove extraneous repoStatus shortcodes

---------

Co-authored-by: marionnegp <mapatel@redhat.com>
Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

* feat(back-to-top): add `<rh-back-to-top>` (#1517)

* feat(back-to-top): add `<rh-back-to-top>`

* chore(back-to-top): lint

* fix(back-to-top): support dev server and docs demo

* fix(back-to-top): suggestion for focus ring when on differnt backgrounds

* docs(back-to-top): update readme

* test(back-to-top): add tests

* chore(back-to-top): add changeset

* docs(back-to-top): remove comment

* chore(back-to-top): update changeset with example

* chore(back-to-top): remove unused demo.css

* docs(back-to-top): improve screenshot

* docs(back-to-top): attempt fix for playground view

* fix(back-to-top): change attribute to visible="always"

* docs(back-to-top): add back to top to repo status

* docs: fix bug when component isnt yet in the repoStatus.yml

* docs(back-to-top): update shortcodes for repoStatus

---------

Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>

* fix!: context types (#1518)

* fix(lib)!: context types

webcomponents-cg/community-protocols#59
made a breaking change to the way the context protocol works.
This commit brings our types in line with the new types on the protocol

* fix(context)!: adapt our contexts to new types

see lit/lit#4614 and https://github.com/webcomponents-cg/community-protocols/pull/59/files

* docs: create changeset

---------

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

* feat(code-block): actions and line numbers (#1496)

* feat(code-block): wip extensions

* feat(code-block): wrap

* feat(code-block): show more

* perf(code-block): don't clone to compute lines

thanks @nikkimk!

* feat(code-block): line numbers

* feat(code-block): icons

still tbd: switching text of toggle button from "toggle wrap" to "toggle overflow" - probably should be a pattern thing

* fix(code-block): toggle slots for actions

* fix(code-block): style adjustments

* fix(code-block): classic css whoopsie

* fix(code-block): gradient

this was fun to debug. the key insight is that pseudo elements of a grid
are *also* grid items

* docs(code-block): changesets

* docs(code-block): jsdoc

* fix(code-block): review notes

* docs(code-block): remove expandable demo

it was decided (cc @coreyvickery) that expandable would automatically determined

* docs(code-block): remove card with tabs demo

should be revisited after PFE3/TabsAriaController

* fix(code-block): refactor in anticipation of rh-fab

* fix(code-block): polish up actions

* fix(code-block): wrap fab state

* fix(code-block): badge, not tag

* fix: 🦄

* fix(code-block): remove actions slot

* fix(code-block): expand button styles

* fix(code-block): tooltip state in wrap

* feat: update code for action buttons in color context demo

---------

Co-authored-by: marionnegp <mapatel@redhat.com>

* chore: update to @patternfly/pfe-core version 3.0 (#1508)

* chore: update patternfly/elements dep to 3.0

* chore: update lit and typescript deps

* chore: update typescript config and declaration

* fix(tile): update internals controller instantiation

* fix(button): update internals controller instantiation

* fix(accordion): update rti api for setting active item

* fix(menu): update rti api for setting active item

* fix(navigation-secondary): update rti api for setting active item

* fix(subnav): update rti api for setting active item

* fix(tabs): update rti api for setting active item

* chore: remove pfe elements from dep to a devDep add pfe-core as dep

* docs(dialog): remove unneeded imports from demo

* chore: lint

* chore: update deps

* test(tile): tile group a11y spec

* chore: node version

* docs: remove cases of band shortcode

* docs: uxdot-search a11y tweaks

* docs: 11ty plugins

* docs: import package

* fix(button): lint a11y in template

* fix(audio-player): label dialog from it's opening button

* chore: add playwright browser install to test workflow

* fix(tooltip): a11y template linting

* fix(tabs): use context instead of lightdom classes

* docs: add @lit/context to importMap

* style(tabs): lint css

* fix(tabs) revert use context instead of lightdom classes

* fix(tabs): Reverts 4b27d24

* chore: update lit/context to 1.1.1

* fix(menu): implement updated RTIC api

* test(menu): remove pageup and pagedown tests reserved for scrolling page

* refactor: no side effects in getters

* test(footer): deflake tests

* test(tooltip): assert on ax tree instead of shadow root

* fix(tooltip): invert css to hide content until open / initialized

* fix(tabs): use aria-tabs-controller

* fix(tabs): refactor using pfe-core 3

* fix(tabs): tab context

* fix(tabs): box context

---------

Co-authored-by: Benny Powers <web@bennypowers.com>
Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>

* chore: eslint 9 (#1523)

* chore: update linters

* style: lint everything

* chore: add optional dependency for rollup-darwin-x64

* style: lint line length and autofixes

* chore: add .cache files to eslint ignore

* style(tile): lint line length

* style: more linting

* fix(tile): replace mistakenly deleted expression

* fix(navigation-secondary): query for all nav links

update RTIC usage

* fix(navigation-secondary): update items on slotchange

* test(skip-link): visibility assertion

---------

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

* feat(site-status): add `<rh-site-status>` (#1507)

* feat(site-status): add site-status

* fix(site-status): add missing export

* chore(site-stutus): fix comment

* fix(site-status): lint

* fix(site-status): add color-context

* test(site-staus): fix missing semi colon

* fix(site-status): remove errant import

* fix(site-status): allow endpoint to be overridden

* docs(site-status): add incorrect endpoint demo

* docs(site-status): correct auto generated template for demo

* test(site-status): improve tests

* fix(site-status): lint

* fix(site-status): lint

* fix(site-status): ugh lint...

* fix(site-status): revert customizable endpoint, add href to status page link

* test(site-status): improve tests

* docs(site-status): add status demos

* docs(site-status): stub docs

* docs(site-status): add jsdoc

* docs: add site-status to related items

* fix(site-status): add type guard for api response

* docs(site-status): update readme

* docs(site-status): imporove jsdoc

* docs(site-status): add docs pages and images

* chore(site-status): add changeset

* chore(site-status): update changeset to include example

* chore(site-status): remove unused demo files

* fix(site-status): remove unused part

* style(site-status): reorder type

* fix(site-status): make #isApiStatus static

* fix(site-status): class decorators cant be use with static private identifier

* fix(site-status): move getStatus to firstUpdated, remove extraneous throw

* fix(site-status): handle capitalization in css

* fix(site-status): correct first letter uppercase style

* fix(site-status): revert response error removal

* fix(site-status): remove status as statusText includes the 404 text.

* fix(site-status): correct viewbox attr

* docs(site-status): add repoStatus

* test(site-status): use sinon for fetch stub

* test(site-status): remove unused aTimeout

* fix(site-status): switch api call to a try catch

* fix(site-status): remove contextProvider not used in design spec

* fix(site-status): use block instead of display contents on host

* fix(site-status): move restore of fetch to top describes

* fix(site-status): implement loading-text slot for translations and accessibility with aria-polite and aria-busy

* docs(site-status): improve demos with loading state demo

* fix(site-status): add focus and hover states

* docs(site-status): add if status is still loading to accessibility

* fix(site-status): readding color context provider

* chore(site-status): lint

* fix(site-status): remove context provider add dark styles

* docs(site-status): readding arg check to fetch override

* chore(site-status): lint

* docs: update .changeset/witty-papayas-tease.md

* style: lint

* feat: react wrapper components

---------

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>
Co-authored-by: Adam Johnson <adam.b.johnson1@gmail.com>
Co-authored-by: marionnegp <mapatel@redhat.com>

* docs: add Get started: Developers (#1439)

* feat: add content and update template

* feat: add script tags to some code blocks

* feat: fix page order and headings

* fix: add script tags

* feat: updated installation content and code on Tokens subpage

* feat: change layout-with-subnav template and frontmatter

* fix: Change the link in the side nav from "Overview" to "Developers"

* feat: link to Developers page from Get Started: Overview

* feat: add usage content and update installation info

* fix: add script tags to code blocks

* docs: update docs/get-started/developers/tokens.md

* docs: update docs/get-started/developers/usage.md

* docs: react usage

---------

Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>
Co-authored-by: Benny Powers <web@bennypowers.com>

* docs: add <rh-back-to-top> content (#1526)

* feat: add more back to top docs

* fix: fix broken image links

* feat: add static image in "Overview" section and note to view demo to see sample elemenet

---------

Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>

* fix(alert): body copy and button color (#1521)

* feat: define color of body copy

* feat: use rh-surface to wrap alert

* docs: add changeset

* fix(alert): make sure surface is available

---------

Co-authored-by: Benny Powers - עם ישראל חי! <bennypowers@users.noreply.github.com>
Co-authored-by: Benny Powers <web@bennypowers.com>

* fix(menu): improve keyboard accessibility on firefox (#1529)

* fix(menu): delegateFocus and on focus() set first active RTI element

* fix(button): on focus() set shadow button to focus, firefox bug

* docs(menu): remove slot=button elements from demos

* fix(menu): move padding to ::slotted(a)

* chore: add changeset

* docs(menu): remove toggle button from color-context dmeo

* chore: update changeset

* fix: adds accents slot to rh-accordion-header (#1505)

* added a part container

* adds accents slot in rh-accordion-header

* remove max-width from span

* fixes lint error

* creates a context for accents attribute

* style: reduced font size for repo status hyperlink

* fixes lint errors

* Update accents conditional

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

* adds changeset

* fixes wrapping issue in mobile view

* fixes wrapping around the header text in mobile view

* fix(accordion): use a container query for accents position

* adds icon-set to rh-tag(s)

---------

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

* docs(tag): fix broken icons (#1531)

docs(tag): fix icon names

* chore: add a lit 3 patch changeset (#1533)

chore: add changeset for dependencies upgrade

* docs: Chansey release notes (#1532)

* Updating release notes

* Fixing release/d typo

---------

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>

---------

Co-authored-by: Steven Spriggs <steven.spriggs@gmail.com>
Co-authored-by: Adam Johnson <adam.b.johnson1@gmail.com>
Co-authored-by: marionnegp <mapatel@redhat.com>
Co-authored-by: Marionne Patel <95588923+marionnegp@users.noreply.github.com>
Co-authored-by: Diwanshi Gadgil <diwanshipandey@gmail.com>
Co-authored-by: Mark Caron <markcaron@users.noreply.github.com>
  • Loading branch information
7 people authored Apr 22, 2024
1 parent 2577702 commit fecdcbf
Show file tree
Hide file tree
Showing 271 changed files with 22,515 additions and 40,797 deletions.
4 changes: 4 additions & 0 deletions .changeset/free-lizards-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@rhds/elements": minor
---
`<rh-codeblock>`: added line numbers
11 changes: 11 additions & 0 deletions .changeset/hot-spiders-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@rhds/elements": minor
---

✨ Added `<rh-site-status>`

Website status communicates the operational status of a website or domain using a status icon and link. It is usually located in the Footer component.

```html
<rh-site-status></rh-site-status>
```
6 changes: 6 additions & 0 deletions .changeset/large-kings-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rhds/elements": patch
---

`<rh-menu>`: improved focus accessibility for keyboard navigation users on firefox
`<rh-button>`: improved focus accessibility on firefox
11 changes: 11 additions & 0 deletions .changeset/late-cobras-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@rhds/elements": minor
---

✨ Added `<rh-back-to-top>`.

Back to top component is a fragment link that allows users to quickly navigate to the top of a lengthy content.

```html
<rh-back-to-top href="#top">Back to top</rh-back-to-top>
```
5 changes: 5 additions & 0 deletions .changeset/lemon-comics-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rhds/elements": patch
---

`<rh-accordion>`: added a accents slot with placement options as inline and bottom
5 changes: 5 additions & 0 deletions .changeset/light-rice-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rhds/elements": patch
---

Context: aligned context implementation with updated [protocol defintions](https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md#definitions)
5 changes: 5 additions & 0 deletions .changeset/nervous-hairs-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rhds/elements": patch
---

Update dependencies, including Lit version 3
5 changes: 5 additions & 0 deletions .changeset/new-grapes-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rhds/elements": patch
---

`<rh-alert>`: make sure alerts always have to correct (lightest) colour palette
5 changes: 5 additions & 0 deletions .changeset/silver-hornets-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rhds/elements": patch
---

`<rh-tabs>`: allow tabs with long text content to fit into different-sized containers
13 changes: 13 additions & 0 deletions .changeset/slow-drinks-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@rhds/elements": minor
---

✨ Added `<rh-skip-link>`.

A skip link is used to skip repetitive content on a page. It is hidden by default and can be activated by hitting the "Tab" key after loading/refreshing a page.

```html
<rh-skip-link>
<a href="#main-content">Skip to main content</a>
</rh-skip-link>
```
38 changes: 38 additions & 0 deletions .changeset/spicy-cups-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
"@rhds/elements": minor
---
⚛️ Added React wrapper components

You can now more easily integrate RHDS elements into your React apps by importing our wrapper components

First, make sure that you list `@lit/react` as a dependency in your project

```sh
npm install --save @lit/react
```

Then import the element components you need and treat them like any other react component

```js
import { Tabs } from '@rhds/elements/react/rh-tabs/rh-tabs.js';
import { Tab } from '@rhds/elements/react/rh-tabs/rh-tab.js';
import { TabPanel } from '@rhds/elements/react/rh-tabs/rh-tab-panel.js';

import { useState } from 'react';

const tabs = [
{ heading: 'Hello Red Hat', content: 'Let\'s break down silos' },
{ heading: 'Web components', content: 'They work everywhere' }
];

function App() {
const [index, setExpanded] = useState(-1);
return (
<span>expanded {expanded}</span>
<Tabs>{tabs.map(({ heading, content }, i) => (
<Tab slot="tab" onExpand={() => setExpanded(i)}>{heading}</Tab>
<TabPanel>{content}</TabPanel>))}
</Tabs>
);
}
```
4 changes: 4 additions & 0 deletions .changeset/tame-comics-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@rhds/elements": minor
---
`<rh-codeblock>`: added `Show more` toggle
16 changes: 16 additions & 0 deletions .changeset/witty-papayas-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@rhds/elements": minor
---
`<rh-codeblock>`: added copy and wrap actions, with localizable slots for the button labels

```html
<rh-code-block actions="wrap copy">
<span slot="action-label-copy">Copy to Clipboard</span>
<span slot="action-label-copy" hidden data-code-block-state="active">Copied!</span>
<span slot="action-label-wrap">Toggle word wrap</span>
<span slot="action-label-wrap" hidden data-code-block-state="active">Toggle overflow</span>
<script type="text/css">:host {
display: block;
}</script>
</rh-code-block>
```
55 changes: 0 additions & 55 deletions .eslintignore

This file was deleted.

12 changes: 0 additions & 12 deletions .eslintrc.json

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:

- name: Install dependencies
run: npm ci --prefer-offline

- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Lint
id: lint
run: npm run lint
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ docs/assets/playgrounds/
# Build artifacts
elements/*/*.js
elements/*/test/*.js
react
lib/**/*.js
!elements/**/demo/*.css
*.map
Expand Down
14 changes: 7 additions & 7 deletions .markdownlint-cli2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ export default {
description: 'Require changesets to use the correct package name',
tags: ['frontmatter'],
function({ name, frontMatterLines, ...rest }, onError) {
const yaml = YAML.load(frontMatterLines.filter(Boolean).filter(x => x !== '---'))
const yaml = YAML.load(frontMatterLines.filter(Boolean).filter(x => x !== '---'));
for (const [key, value] of Object.entries(yaml)) {
if (['patch','minor','major'].includes(value)) {
if (['patch', 'minor', 'major'].includes(value)) {
if (key !== '@rhds/elements') {
onError({
lineNumber: 2,
detail: `incorrect package name ${key}`,
})
});
}
}
}
}
},
}],
dot: true,
files: './changeset/*.md',
config: {
default: false,
'default': false,
'markdownlint-changeset-packagename': true,
}
}
},
};
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.1
v20.10.0
5 changes: 1 addition & 4 deletions declaration.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
declare module '*.css' {
import type { CSSResult } from 'lit';

// import style from './some-styles.css';
const style: CSSResult;
const style: CSSStyleSheet
export default style;
}

Expand Down
53 changes: 30 additions & 23 deletions docs/_data/playgrounds.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ function groupBy(prop, xs) {

function getDemoFilename(x) {
return `demo/${(x.url.split('/demo/').pop() || `${x.primaryElementName}.html`).replace(/\/$/, '.html')}`
.replace('.html', '/index.html')
.replace(`${x.primaryElementName}/index.html`, 'index.html');
.replace('.html', '/index.html')
.replace(`${x.primaryElementName}/index.html`, 'index.html');
}

/**
Expand All @@ -26,7 +26,8 @@ function getDemoFilename(x) {
* > One of `.`, or **WORD** (_>= 1x_)
* `"`
*/
const DEMO_SUBRESOURCE_RE = /(?<attr>href|src)="\/elements\/rh-(?<unprefixed>.*)\/(?<filename>.*)\.(?<extension>[.\w]+)"/g;
const DEMO_SUBRESOURCE_RE =
/(?<attr>href|src)="\/elements\/rh-(?<unprefixed>.*)\/(?<filename>.*)\.(?<extension>[.\w]+)"/g;

/**
* `/elements/`
Expand Down Expand Up @@ -63,16 +64,16 @@ function demoPaths(content, pathname) {

function isModuleScript(node) {
return (
node.tagName === 'script' &&
node.attrs.some(x => x.name === 'type' && x.value === 'module')
node.tagName === 'script'
&& node.attrs.some(x => x.name === 'type' && x.value === 'module')
);
}

function isStyleLink(node) {
return (
node.tagName === 'link' &&
node.attrs.some(x => x.name === 'rel' && x.value === 'stylesheet') &&
node.attrs.some(x => x.name === 'href')
node.tagName === 'link'
&& node.attrs.some(x => x.name === 'rel' && x.value === 'stylesheet')
&& node.attrs.some(x => x.name === 'href')
);
}

Expand Down Expand Up @@ -130,11 +131,11 @@ module.exports = async function(data) {
Tools.createCommentNode('playground-fold'),
Tools.createElement('link', {
rel: 'stylesheet',
href: 'https://static.redhat.com/libs/redhat/redhat-font/4/webfonts/red-hat-font.min.css'
href: 'https://static.redhat.com/libs/redhat/redhat-font/4/webfonts/red-hat-font.min.css',
}),
Tools.createElement('link', {
rel: 'stylesheet',
href: 'https://static.redhat.com/libs/redhat/redhat-theme/6/advanced-theme.css'
href: 'https://static.redhat.com/libs/redhat/redhat-theme/6/advanced-theme.css',
}),
Tools.createElement('link', {
rel: 'stylesheet',
Expand All @@ -147,17 +148,19 @@ module.exports = async function(data) {
const filename = getDemoFilename(demo);

/** @see docs/_plugins/rhds.cjs demoPaths transform */
const base = url.pathToFileURL(path.join(process.cwd(), 'elements', primaryElementName, 'demo/'));
const base = url.pathToFileURL(path.join(process.cwd(),
'elements',
primaryElementName,
'demo/'));
const docsDir = url.pathToFileURL(path.join(process.cwd(), 'docs/'));
const isMainDemo = filename === 'demo/index.html';
const demoSlug = filename.split('/').at(1);

const addSubresourceURL = async subresourceURL => {
if (subresourceURL && !subresourceURL.startsWith('http')) {
const subresourceFileURL = !subresourceURL.startsWith('/')
const subresourceFileURL = !subresourceURL.startsWith('/') ?
// non-tabular ternary
// eslint-disable-next-line operator-linebreak
? new URL(subresourceURL, base)
new URL(subresourceURL, base)
: new URL(subresourceURL.replace('/', './'), docsDir);
try {
const resourceName =
Expand All @@ -171,7 +174,11 @@ module.exports = async function(data) {
fileMap.set(resourceName, { content, hidden: true });
}
} catch (e) {
throw new SubresourceError(`Error generating playground for ${demo.slug}.\nCould not find subresource ${subresourceURL} at ${subresourceFileURL?.href ?? 'unknown'}`, e, subresourceFileURL);
throw new SubresourceError(
`Error generating playground for ${demo.slug}.\nCould not find subresource ${subresourceURL} at ${subresourceFileURL?.href ?? 'unknown'}`,
e,
subresourceFileURL,
);
}
}
};
Expand All @@ -183,13 +190,13 @@ module.exports = async function(data) {
});

const hrefSubresourceElements = Tools.queryAll(fragment, node =>
Tools.isElementNode(node) &&
isStyleLink(node));
Tools.isElementNode(node)
&& isStyleLink(node));

const srcSubresourceElements = Tools.queryAll(fragment, node =>
Tools.isElementNode(node) &&
SRC_SUBRESOURCE_TAGNAMES.has(node.tagName) &&
hasLocalSrcAttr(node));
Tools.isElementNode(node)
&& SRC_SUBRESOURCE_TAGNAMES.has(node.tagName)
&& hasLocalSrcAttr(node));

// register demo css resources
for (const el of hrefSubresourceElements) {
Expand Down Expand Up @@ -219,9 +226,9 @@ module.exports = async function(data) {
// HACK: https://github.com/google/playground-elements/issues/93#issuecomment-1775247123
const inlineModules =
Tools.queryAll(fragment, node =>
Tools.isElementNode(node) &&
isModuleScript(node) &&
!node.attrs.some(({ name }) => name === 'src'));
Tools.isElementNode(node)
&& isModuleScript(node)
&& !node.attrs.some(({ name }) => name === 'src'));

Array.from(inlineModules).forEach((el, i) => {
const moduleName = `${primaryElementName}-${demoSlug.replace('.html', '')}-inline-script-${i++}.js`;
Expand Down
Loading

0 comments on commit fecdcbf

Please sign in to comment.