Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(health-index): Adding rh-health-index element #1549

Merged
merged 39 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
88c37e4
Adding rh-health-index element
markcaron May 2, 2024
6947d5d
fix(health-index): lint, change prop to grade
markcaron May 2, 2024
57cb589
fix(health-index): eslint
markcaron May 2, 2024
5df12e0
fix(health-index): correct class name
markcaron May 2, 2024
c3ae3ce
fix(health-index): correct class name
markcaron May 2, 2024
77a46e1
fix(health-index) code docs and screenshot
markcaron May 2, 2024
4bb5592
docs(health-index): add overview
markcaron May 2, 2024
e4bc33a
Merge branch 'staging/charmander' into feat/health-index
adamjohnson May 9, 2024
5828f21
Merge branch 'staging/charmander' into feat/health-index
adamjohnson May 13, 2024
f8b577c
Update elements/rh-health-index/demo/color-context.html
markcaron Jun 6, 2024
9f3106d
fix(health-index): added changeset, a11y test, changed template, read…
markcaron Jun 6, 2024
7cd4b97
Merge branch 'feat/health-index' of github.com:RedHat-UX/red-hat-desi…
markcaron Jun 6, 2024
6ebc9ce
fix(health-index): Adding/fixing a11y tests
markcaron Jun 6, 2024
0c5ee90
chore(health-index): linting
markcaron Jun 6, 2024
44fec15
chore(health-index): linting again
markcaron Jun 6, 2024
18700c9
refactor(health-index): fix colors, refactor CSS vars
markcaron Jun 10, 2024
d31bdaf
perf(health-index): reduce bundle and DOM size
bennypowers Jun 11, 2024
e09b8d8
fix(health-index): colours and linting
bennypowers Jun 11, 2024
5f342c5
Merge branch 'staging/charmander' into feat/health-index
bennypowers Jun 11, 2024
4aed0f6
feat(health-index): meter role
bennypowers Jun 13, 2024
c6f9571
Merge branch 'staging/charmander' into feat/health-index
bennypowers Jun 13, 2024
495ab43
Merge branch 'staging/charmander' into feat/health-index
bennypowers Jun 16, 2024
e02d5bd
fix(health-index): voiceover
bennypowers Jun 17, 2024
210d5b0
docs(health-index): format demos
bennypowers Jun 17, 2024
637f545
fix(health-index): screen readers
bennypowers Jun 17, 2024
b6629fd
fix(health-index): role
bennypowers Jun 17, 2024
2a76da0
docs(health-index): sr demos
bennypowers Jun 17, 2024
87e0b3f
perf: remove superfluous attribute prop
bennypowers Jun 18, 2024
9306ae5
Merge branch 'staging/charmander' into feat/health-index
bennypowers Jun 18, 2024
dae4ef6
docs: update .changeset/calm-fireants-kneel.md
bennypowers Jun 18, 2024
db0a328
docs(health-index): correct shortcodes for code page
zeroedin Jun 18, 2024
800b934
docs(health-index): adding images
markcaron Jun 18, 2024
be52271
chore: remove errant commite files
zeroedin Jun 18, 2024
278b2aa
docs(health-index): adding repoStatus, relateItems, and style docs
markcaron Jun 18, 2024
94208a2
Merge branch 'feat/health-index' of github.com:RedHat-UX/red-hat-desi…
markcaron Jun 18, 2024
1ea86dd
Merge branch 'staging/charmander' into feat/health-index
bennypowers Jun 19, 2024
94a1bf5
feat(health-index): adding and updating docs pages, adding a11y guide…
markcaron Jun 20, 2024
3853713
Merge branch 'staging/charmander' into feat/health-index
bennypowers Jun 21, 2024
21cc979
docs(health-index): role info
bennypowers Jun 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions elements/rh-health-index/README.md
adamjohnson marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Health Index
Add a description of the component here.

## Usage
Describe how best to use this web component along with best practices.

```html
<rh-health-index>

</rh-health-index>
```
74 changes: 74 additions & 0 deletions elements/rh-health-index/demo/color-context.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<rh-context-demo>
<ul class="demo">
<li>
<h2>SM</h2>
<div><rh-health-index grade="A" size="sm">A</rh-health-index></div>
<div><rh-health-index grade="B" size="sm">B</rh-health-index></div>
<div><rh-health-index grade="C" size="sm">C</rh-health-index></div>
<div><rh-health-index grade="D" size="sm">D</rh-health-index></div>
<div><rh-health-index grade="E" size="sm">E</rh-health-index></div>
<div><rh-health-index grade="F" size="sm">F</rh-health-index></div>
</li>
<li>
<h2>Default</h2>
<div><rh-health-index grade="A">A</rh-health-index></div>
<div><rh-health-index grade="B">B</rh-health-index></div>
<div><rh-health-index grade="C">C</rh-health-index></div>
<div><rh-health-index grade="D">D</rh-health-index></div>
<div><rh-health-index grade="E">E</rh-health-index></div>
<div><rh-health-index grade="F">F</rh-health-index></div>
</li>

<li>
<h2>LG</h2>
<div><rh-health-index grade="A" size="lg">A</rh-health-index></div>
<div><rh-health-index grade="B" size="lg">B</rh-health-index></div>
<div><rh-health-index grade="C" size="lg">C</rh-health-index></div>
<div><rh-health-index grade="D" size="lg">D</rh-health-index></div>
<div><rh-health-index grade="E" size="lg">E</rh-health-index></div>
<div><rh-health-index grade="F" size="lg">F</rh-health-index></div>
</li>

<li>
<h2>XL</h2>
<div><rh-health-index grade="A" size="xl">A</rh-health-index></div>
<div><rh-health-index grade="B" size="xl">B</rh-health-index></div>
<div><rh-health-index grade="C" size="xl">C</rh-health-index></div>
<div><rh-health-index grade="D" size="xl">D</rh-health-index></div>
<div><rh-health-index grade="E" size="xl">E</rh-health-index></div>
<div><rh-health-index grade="F" size="xl">F</rh-health-index></div>
</li>
</ul>
</rh-context-demo>

<script type="module">
import '@rhds/elements/lib/elements/rh-context-demo/rh-context-demo.js';
import '@rhds/elements/rh-surface/rh-surface.js';
import '@rhds/elements/rh-health-index/rh-health-index.js';
</script>

<style>
.demo {
margin: 2rem;
padding: 0;
list-style: none;
width: 800px;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
gap: 2rem;
}

.demo h2 {
font-size: var(--rh-font-size-body-text-lg, 1.125rem);
}

.demo li {
margin: 0;
padding: 0;
}

.demo rh-surface,
.demo div {
margin-block-end: 1rem;
}
markcaron marked this conversation as resolved.
Show resolved Hide resolved
</style>
71 changes: 71 additions & 0 deletions elements/rh-health-index/demo/rh-health-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<ul class="demo">
<li>
<h2>SM</h2>
<div><rh-health-index grade="A" size="sm">A</rh-health-index></div>
<div><rh-health-index grade="B" size="sm">B</rh-health-index></div>
<div><rh-health-index grade="C" size="sm">C</rh-health-index></div>
<div><rh-health-index grade="D" size="sm">D</rh-health-index></div>
<div><rh-health-index grade="E" size="sm">E</rh-health-index></div>
<div><rh-health-index grade="F" size="sm">F</rh-health-index></div>
</li>
<li>
<h2>Default</h2>
<div><rh-health-index grade="A">A</rh-health-index></div>
<div><rh-health-index grade="B">B</rh-health-index></div>
<div><rh-health-index grade="C">C</rh-health-index></div>
<div><rh-health-index grade="D">D</rh-health-index></div>
<div><rh-health-index grade="E">E</rh-health-index></div>
<div><rh-health-index grade="F">F</rh-health-index></div>
</li>

<li>
<h2>LG</h2>
<div><rh-health-index grade="A" size="lg">A</rh-health-index></div>
<div><rh-health-index grade="B" size="lg">B</rh-health-index></div>
<div><rh-health-index grade="C" size="lg">C</rh-health-index></div>
<div><rh-health-index grade="D" size="lg">D</rh-health-index></div>
<div><rh-health-index grade="E" size="lg">E</rh-health-index></div>
<div><rh-health-index grade="F" size="lg">F</rh-health-index></div>
</li>

<li>
<h2>XL</h2>
<div><rh-health-index grade="A" size="xl">A</rh-health-index></div>
<div><rh-health-index grade="B" size="xl">B</rh-health-index></div>
<div><rh-health-index grade="C" size="xl">C</rh-health-index></div>
<div><rh-health-index grade="D" size="xl">D</rh-health-index></div>
<div><rh-health-index grade="E" size="xl">E</rh-health-index></div>
<div><rh-health-index grade="F" size="xl">F</rh-health-index></div>
</li>
</ul>

<script type="module">
import '@rhds/elements/rh-surface/rh-surface.js';
import '@rhds/elements/rh-health-index/rh-health-index.js';
</script>

<style>
.demo {
margin: 2rem;
padding: 0;
list-style: none;
width: 800px;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
gap: 2rem;
}

.demo h2 {
font-size: var(--rh-font-size-body-text-lg, 1.125rem);
}

.demo li {
margin: 0;
padding: 0;
}

.demo rh-surface,
.demo div {
margin-block-end: 1rem;
}
</style>
20 changes: 20 additions & 0 deletions elements/rh-health-index/docs/00-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Overview
{{ tagName | getElementDescription }}

{% repoStatusList %}

## Sample element
<rh-health-index grade="A">A</rh-health-index>


## Demos
View a live version of this component and see how it can be customized.
{% playground tagName=tagName %}{% endplayground %}
{% cta href="./demo/", target="_blank" %}
View the `<rh-health-index>` demo in a new tab
{% endcta %}

## When to use
- When you need to displays a health grade (A–F) for a particular item or package.

{% repoStatusChecklist %}
17 changes: 17 additions & 0 deletions elements/rh-health-index/docs/40-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% renderOverview %}
<rh-health-index></rh-health-index>
{% endrenderOverview %}

{% band header="Usage" %}{% endband %}

{% renderSlots %}{% endrenderSlots %}

{% renderAttributes %}{% endrenderAttributes %}

{% renderMethods %}{% endrenderMethods %}

{% renderEvents %}{% endrenderEvents %}

{% renderCssCustomProperties %}{% endrenderCssCustomProperties %}

{% renderCssParts %}{% endrenderCssParts %}
Binary file added elements/rh-health-index/docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading