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

v2.3rc #131

Merged
merged 18 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
895a0b2
feat(validation): install and use formvalidation repo
jordanjones243 Mar 28, 2024
0477850
fix(required): stop error ui in dynamic implementation #125
jordanjones243 Mar 29, 2024
aefaa5f
docs(dynamic): refactor structure and add dynamic example #125
jordanjones243 Mar 29, 2024
ea9a5fb
test(dom): add test for dom creation of element
jordanjones243 Apr 1, 2024
872f2b2
perf(error): update error handling
jordanjones243 Apr 2, 2024
287e552
feat(event): add events dispatched by validation repo
jordanjones243 Apr 2, 2024
62fc347
refactor(docs): update generateDocs method
jordanjones243 Apr 2, 2024
2f51c39
docs(event): add event from validation to jsdocs #125
jordanjones243 Apr 30, 2024
a6875f4
feat(library): add library to repo for custom component use
jordanjones243 Apr 30, 2024
2ce622a
docs(required): update required example
jordanjones243 Apr 30, 2024
5578ec0
perf(validation): update logic around validation handling #125
jordanjones243 Apr 30, 2024
78fafd3
docs(jsdocs): update event type and remove deprecated events
jordanjones243 May 2, 2024
635a715
chore: update dependencies
jordanjones243 May 3, 2024
86daa96
docs(examples): edit IDs and remove extra basic example
jordanjones243 May 8, 2024
b5b6927
chore: update dependencies
jordanjones243 May 9, 2024
4b5b256
docs(demo): update demo example structure
jordanjones243 May 13, 2024
19adde7
feat(selected): add optionSelected attribute to radio group #97
jordanjones243 May 13, 2024
93002ca
docs(required): add additional explanation for required example
jordanjones243 May 13, 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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import "@aurodesignsystem/auro-radio";
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->

```html
<auro-radio id="radio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="basicRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
```
<!-- AURO-GENERATED-CONTENT:END -->

Expand Down Expand Up @@ -117,6 +117,8 @@ In cases where the project is not able to process JS assets, there are pre-proce
The `<auro-radio>` element is designed to be a single component for the use of creating an input `type="radio"` with an associated `<label>` that meets all use case and accessibility standards.

The following examples illustrate fully functional `<auro-radio>` elements wrapped with the `<auro-radio-group>` element. The `<auro-radio-group>` element is REQUIRED in order to mantain the relationship between individual `<auro-radio>` elements for functional radio button actions.

**Note**: The `<auro-radio>` element is only for to for use as a set of two or more `<auro-radio>` elements within an `<auro-radio-group>` element.
<!-- AURO-GENERATED-CONTENT:END -->

## API Code Examples
Expand All @@ -127,7 +129,7 @@ The following examples illustrate fully functional `<auro-radio>` elements wrapp
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->

```html
<auro-radio id="radio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="basicRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
```
<!-- AURO-GENERATED-CONTENT:END -->

Expand Down
2 changes: 1 addition & 1 deletion apiExamples/basic.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<auro-radio id="radio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="basicRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
6 changes: 3 additions & 3 deletions apiExamples/basicGroup.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<auro-radio-group>
<span slot="legend">Form label goes here</span>
<auro-radio id="radio28" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="radio29" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="radio30" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
<auro-radio id="basicGroupRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="basicGroupRadio2" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="basicGroupRadio3" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
</auro-radio-group>
8 changes: 4 additions & 4 deletions apiExamples/basic2.html → apiExamples/checked.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<auro-radio-group>
<span slot="legend">Are you willing to volunteer resources?</span>
<auro-radio id="radio4" label="Yes" name="radioDemo" value="yes">Volunteering is AWESOME!</auro-radio>
<auro-radio id="radio5" label="No" name="radioDemo" value="no">Sorry, I do not have the time or resources</auro-radio>
<auro-radio id="radio6" label="Maybe" name="radioDemo" value="maybe">Please send me more information</auro-radio>
<span slot="legend">Form label goes here</span>
<auro-radio id="radio4" label="Yes" name="radioDemo" value="yes">Yes</auro-radio>
<auro-radio id="radio5" label="No" name="radioDemo" value="no" checked>No</auro-radio>
<auro-radio id="radio6" label="Maybe" name="radioDemo" value="maybe">Maybe</auro-radio>
</auro-radio-group>
6 changes: 3 additions & 3 deletions apiExamples/customRadio.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<custom-radio-group>
<span slot="legend">Form label goes here</span>
<custom-radio id="radio7" label="Yes" name="radioDemo" value="yes"></custom-radio>
<custom-radio id="radio8" label="No" name="radioDemo" value="no"></custom-radio>
<custom-radio id="radio9" label="Maybe" name="radioDemo" value="maybe"></custom-radio>
<custom-radio id="customRadio1" label="Yes" name="radioDemo" value="yes"></custom-radio>
<custom-radio id="customRadio2" label="No" name="radioDemo" value="no"></custom-radio>
<custom-radio id="customRadio3" label="Maybe" name="radioDemo" value="maybe"></custom-radio>
</custom-radio-group>
14 changes: 11 additions & 3 deletions apiExamples/disabled.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<auro-radio-group>
<span slot="legend">Form label goes here</span>
<auro-radio id="radio10" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="radio11" label="No" name="radioDemo" value="no" disabled></auro-radio>
<auro-radio id="radio12" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
<auro-radio id="disabledRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="disabledRadio2" label="No" name="radioDemo" value="no" disabled></auro-radio>
<auro-radio id="disabledRadio3" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
</auro-radio-group>

<auro-radio-group disabled>
<span slot="legend">Form label goes here</span>
<auro-radio id="disabledRadio4" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="disabledRadio5" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="disabledRadio6" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
</auro-radio-group>

6 changes: 0 additions & 6 deletions apiExamples/disabledGroup.html

This file was deleted.

3 changes: 3 additions & 0 deletions apiExamples/dynamic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<auro-radio-group required id="dynamicExample">
<span slot="legend">Form label goes here</span>
</auro-radio-group>
16 changes: 16 additions & 0 deletions apiExamples/dynamic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export function dynamicExample() {
const values = ['Yes', 'No', 'Maybe'];
const radioGroup = document.getElementById('dynamicExample');

for (let i = 0; i < values.length; i++) {
const radio = document.createElement('auro-radio');

radio.id = `dynamicRadio${i}`;
radio.label = values[i];
radio.name = 'radioDemo';
radio.value = values[i];
radio.textContent = values[i];

radioGroup.appendChild(radio);
}
}
8 changes: 4 additions & 4 deletions apiExamples/error.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<auro-radio-group>
<auro-radio-group error="There is an error with this form entry">
<span slot="legend">Form label goes here</span>
<auro-radio id="radio16" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="radio17" label="No" name="radioDemo" value="no" error></auro-radio>
<auro-radio id="radio18" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
<auro-radio id="errorRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="errorRadio2" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="errorRadio3" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
</auro-radio-group>
6 changes: 0 additions & 6 deletions apiExamples/errorGroup.html

This file was deleted.

6 changes: 3 additions & 3 deletions apiExamples/horizontal.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<auro-radio-group horizontal>
<span slot="legend">Form label goes here</span>
<auro-radio id="radio22" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="radio23" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="radio24" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
<auro-radio id="horizontalRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="horizontalRadio2" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="horizontalRadio3" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
</auro-radio-group>
6 changes: 3 additions & 3 deletions apiExamples/optionalLabel.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<auro-radio-group>
<span slot="legend">Form label goes here</span>
<span slot="optionalLabel">(add custom label here)</span>
<auro-radio id="radio28" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="radio29" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="radio30" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
<auro-radio id="labelRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="labelRadio2" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="labelRadio3" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
</auro-radio-group>
8 changes: 4 additions & 4 deletions apiExamples/required.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<auro-radio-group required>
<auro-radio-group required setCustomValidityValueMissing="value missing">
<span slot="legend">Form label goes here</span>
<auro-radio id="radio25" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="radio26" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="radio27" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
<auro-radio id="requiredRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
<auro-radio id="requiredRadio2" label="No" name="radioDemo" value="no"></auro-radio>
<auro-radio id="requiredRadio3" label="Maybe" name="radioDemo" value="maybe"></auro-radio>
</auro-radio-group>
7 changes: 5 additions & 2 deletions demo/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See LICENSE in the project root for license information.

HTML in this document is standardized and NOT to be edited.
All demo code should be added/edited in ./demo/apiExamples.md
All demo code should be added/edited in ./demo/api.md

With the exception of adding custom elements if needed for the demo.

Expand All @@ -22,7 +22,6 @@
href="https://cdn.jsdelivr.net/npm/[email protected]/themes/prism.css"
/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/tokens/CSSCustomProperties.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/tokens/CSSCustomProperties.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
</head>
Expand All @@ -41,6 +40,10 @@
});
</script>
<script type="module" src="../index.js"></script>
<script type="module">
import { initExamples } from './api.min.js';
initExamples();
</script>

<!-- If additional elements are needed for the demo, add them here. -->
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/dist/auro-accordion__bundled.js" type="module"></script>
Expand Down
16 changes: 16 additions & 0 deletions demo/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { dynamicExample } from "../apiExamples/dynamic";

export function initExamples(initCount) {
initCount = initCount || 0;

try {
dynamicExample();
} catch (error) {
if (initCount <= 20) {
// setTimeout handles issue where content is sometimes loaded after the functions get called
setTimeout(() => {
initExamples(initCount + 1);
}, 100);
}
}
}
Loading
Loading