-
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.
docs: uxdot elements to typescript (#1812)
* docs: sidenav fixes also ports uxdot-sidenav elements to typescript also loads global css on each page also reduces dom payload for uxdot-sidenav elements chore: fix serve command docs: fix tokens sidenav * chore: update node version * docs: reduce jspm cdn usage * fix(icon): improve ssr performance * docs: port toc to typescript * feat(skip-link): href attr * docs: replace uxdot-skip-navigation with rh-skip-link * fix(alert): toast methods styles and types * docs: port uxdot-copy-button to ts * docs: port uxdot-copy-permalink to typescript * docs: port uxdot-best-practice to typescript * docs: port uxdot-feedback to typescript * docs: port uxdot-feedback to typescript * fix(footer): universal footer ssr * docs: port uxdot-header to typescript also improve layout esp. on mobile * docs: port uxdot-header to typescript * docs: port uxdot-masthead to typescript * docs: port uxdot-search to typescript * docs: port uxdot-repo-status-list to typescript * chore: gitignore * chore: gitignore * Revert "feat(skip-link): href attr" This reverts commit b9a28ea. * chore: build
- Loading branch information
1 parent
ea0d84a
commit 1ec3653
Showing
86 changed files
with
1,774 additions
and
1,944 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,4 @@ | ||
--- | ||
"@rhds/elements": patch | ||
--- | ||
`<rh-footer-universal>`: improve compatibility with <abbr title="Server side rendering">SSR</abbr> |
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 @@ | ||
--- | ||
"@rhds/elements": patch | ||
--- | ||
`<rh-alert>`: fixed styles and typings for the `RhAlert.toast()` method |
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 @@ | ||
--- | ||
"@rhds/elements": patch | ||
--- | ||
`<rh-icon>`: prevent error when hydrating server-side-rendered icons |
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 |
---|---|---|
@@ -1 +1 @@ | ||
v20.10.0 | ||
v22.7.0 |
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 |
---|---|---|
@@ -1,92 +1,65 @@ | ||
<uxdot-sidenav trigger="hamburger"> | ||
<ul> | ||
<uxdot-sidenav-item href="/" {{ 'active' if page.url === '/'}}>Home</uxdot-sidenav-item> | ||
{# | ||
Loop through nav dropdowns | ||
This uses data passed in via the eleventy.config.cjs file in the root | ||
TODO: more this data to a global data, ideally this data would be normalized | ||
prior to getting to the component template level. | ||
#} | ||
{%- for link in sideNavDropdowns -%} | ||
{%- set active = link.url === page.url -%} | ||
{%- set open = link.url in page.url -%} | ||
<li> | ||
<uxdot-sidenav-dropdown {{ 'open' if open }}> | ||
<details {{ 'open' if open }}> | ||
<summary>{{ link.title }}</summary> | ||
<uxdot-sidenav-dropdown-menu> | ||
{% if link.collection === "elementDocs" %} | ||
{%- set active = '/elements/' === page.url -%} | ||
<uxdot-sidenav-dropdown-menu-item href="/elements/" | ||
{{ 'active' if active }}>All elements</uxdot-sidenav-dropdown-menu-item> | ||
{%- for tagName, docs in collections.elementDocs | groupby('tagName') -%} | ||
{%- set fst = docs[0] -%} | ||
{%- set slug = fst.slug -%} | ||
{%- set href = '/elements/' + slug + '/' -%} | ||
{%- set active = href === page.url -%} | ||
{%- set name = (fst.alias) or (slug | deslugify) %} | ||
{%- set planned = isPlanned(repoStatus, name) %} | ||
{% if not (tagName in comingSoonItems) %} | ||
<uxdot-sidenav-dropdown-menu-item href="{{ href }}" | ||
{{ 'active' if active }}> | ||
{{ (fst.alias) or (slug | deslugify) }}{% if planned %} <rh-tag icon="notification-fill" color="gray">Planned</rh-tag>{% endif %} | ||
</uxdot-sidenav-dropdown-menu-item> | ||
{% endif %} | ||
{%- endfor -%} | ||
{% else %} | ||
{% if link.collection === 'token' %} | ||
{%- set active = page.url === "/tokens/" %} | ||
<uxdot-sidenav-dropdown-menu-item href="/tokens/" | ||
{{ 'active' if active }}>Overview</uxdot-sidenav-dropdown-menu-item> | ||
{% endif -%} | ||
<uxdot-sidenav-item href="/" {{ 'active' if page.url === '/'}}>Home</uxdot-sidenav-item> | ||
{# | ||
Loop through nav dropdowns | ||
This uses data passed in via the eleventy.config.cjs file in the root | ||
TODO: more this data to a global data, ideally this data would be normalized | ||
prior to getting to the component template level. | ||
#} | ||
{%- for link in sideNavDropdowns -%} | ||
{%- set active = link.url === page.url -%} | ||
{%- set open = link.url in page.url -%} | ||
<uxdot-sidenav-dropdown {{ 'open' if open }}> | ||
<details {{ 'open' if open }}> | ||
<summary>{{ link.title }}</summary> | ||
<uxdot-sidenav-dropdown-menu> | ||
{% if link.collection === "elementDocs" %} | ||
{%- set active = '/elements/' === page.url -%} | ||
<uxdot-sidenav-dropdown-menu-item href="/elements/" {{ 'active' if active }}>All elements</uxdot-sidenav-dropdown-menu-item> | ||
{%- for tagName, docs in collections.elementDocs | groupby('tagName') -%} | ||
{%- set fst = docs[0] -%} | ||
{%- set slug = fst.slug -%} | ||
{%- set href = '/elements/' + slug + '/' -%} | ||
{%- set active = href === page.url -%} | ||
{%- set name = (fst.alias) or (slug | deslugify) %} | ||
{%- set planned = isPlanned(repoStatus, name) %} | ||
{% if not (tagName in comingSoonItems) %} | ||
<uxdot-sidenav-dropdown-menu-item href="{{ href }}" {{ 'active' if active }}> | ||
{{- fst.alias or (slug | deslugify) -}} | ||
{%- if planned -%}<rh-tag icon="notification-fill" color="gray">Planned</rh-tag>{%- endif -%} | ||
</uxdot-sidenav-dropdown-menu-item> | ||
{% endif %} | ||
{%- endfor -%} | ||
{% else %} | ||
{% if link.collection === 'token' %} | ||
{%- set active = page.url === "/tokens/" %} | ||
<uxdot-sidenav-dropdown-menu-item href="/tokens/" {{ 'active' if active }}>Overview</uxdot-sidenav-dropdown-menu-item> | ||
{% endif -%} | ||
|
||
{%- if (link.collection !== 'elementDocs') and (link.collection !== 'token') -%} | ||
{%- set sortedOn = "data.order" %} | ||
{%- set sideNavCollection = collections[link.collection] | sort(attribute=sortedOn, case_sensitive=true) %} | ||
{% else %} | ||
{%- set sideNavCollection = collections[link.collection] %} | ||
{%- endif -%} | ||
{%- if (link.collection !== 'elementDocs') and (link.collection !== 'token') -%} | ||
{%- set sortedOn = "data.order" %} | ||
{%- set sideNavCollection = collections[link.collection] | sort(attribute=sortedOn, case_sensitive=true) %} | ||
{% else %} | ||
{%- set sideNavCollection = collections[link.collection] %} | ||
{%- endif -%} | ||
|
||
{%- for sublink in sideNavCollection -%} | ||
{%- set active = sublink.url === page.url -%} | ||
<uxdot-sidenav-dropdown-menu-item href="{{ sublink.url }}" | ||
{{ 'active' if active }}> | ||
{{- (sublink.data.sidenavTitle) | ||
or (sublink.data.title or '' | capitalize) | ||
or (sublink.title or ''| capitalize) -}} | ||
</uxdot-sidenav-dropdown-menu-item> | ||
{%- endfor -%} | ||
{% endif %} | ||
</uxdot-sidenav-dropdown-menu> | ||
</details> | ||
</uxdot-sidenav-dropdown> | ||
</li> | ||
{% endfor %} | ||
{%- for sublink in sideNavCollection -%} | ||
{%- set active = sublink.url === page.url -%} | ||
<uxdot-sidenav-dropdown-menu-item href="{{ sublink.url }}" {{ 'active' if active }}> | ||
{{- (sublink.data.sidenavTitle or sublink.data.title or sublink.title) | capitalize -}} | ||
</uxdot-sidenav-dropdown-menu-item> | ||
{%- endfor -%} | ||
{% endif %} | ||
</uxdot-sidenav-dropdown-menu> | ||
</details> | ||
</uxdot-sidenav-dropdown> | ||
|
||
<li> | ||
<uxdot-sidenav-item> | ||
<a href="/design-code-status/">Design/code status</a> | ||
</uxdot-sidenav-item> | ||
</li> | ||
{% endfor %} | ||
|
||
<li> | ||
<uxdot-sidenav-item> | ||
<a href="/release-notes/">Release notes</a> | ||
</uxdot-sidenav-item> | ||
</li> | ||
|
||
<li> | ||
<uxdot-sidenav-item> | ||
<a href="{{ '/support/' | url }}">Get support</a> | ||
</uxdot-sidenav-item> | ||
</li> | ||
|
||
{%- if runMode == 'watch' -%} | ||
<li> | ||
<uxdot-sidenav-item> | ||
<a href="/cheatsheet" class="link">Cheat sheet!</a> | ||
</uxdot-sidenav-item> | ||
</li> | ||
{%- endif -%} | ||
</ul> | ||
<uxdot-sidenav-item href="/design-code-status/">Design/code status</uxdot-sidenav-item> | ||
<uxdot-sidenav-item href="/release-notes/">Release notes</uxdot-sidenav-item> | ||
<uxdot-sidenav-item href="/support/">Get support</uxdot-sidenav-item> | ||
{%- if runMode == 'watch' -%} | ||
<uxdot-sidenav-item class="link" href="/cheatsheet">Cheat sheet!</uxdot-sidenav-item> | ||
{%- endif -%} | ||
</uxdot-sidenav> |
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 |
---|---|---|
|
@@ -17,11 +17,17 @@ | |
|
||
{# only load components that need hydrated (aka interactivity) #} | ||
<script type="module"> | ||
import '@rhds/elements/rh-footer/rh-footer-universal.js'; | ||
import '/assets/javascript/elements/uxdot-copy-permalink.js'; | ||
import '/assets/javascript/elements/uxdot-sidenav.js'; | ||
import '/assets/javascript/elements/uxdot-example.js'; | ||
</script> | ||
|
||
{%- if hasToc %} | ||
<link rel="stylesheet" href="/assets/javascript/elements/uxdot-toc-lightdom.css"> | ||
<script type="module" src="/assets/javascript/elements/uxdot-toc.js"></script> | ||
{%- endif %} | ||
|
||
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js"></script> | ||
|
||
|
Oops, something went wrong.