@aurodesignsystem-dev/auro-formkit 0.0.0-pr1451.2 → 0.0.0-pr1451.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkbox/README.md +11 -27
- package/components/checkbox/demo/accessibility.html +49 -0
- package/components/checkbox/demo/accessibility.md +44 -0
- package/components/checkbox/demo/api.html +17 -25
- package/components/checkbox/demo/api.md +40 -416
- package/components/checkbox/demo/api.min.js +5 -4
- package/components/checkbox/demo/customize.html +52 -0
- package/components/checkbox/demo/customize.md +361 -0
- package/components/checkbox/demo/demo-support.js +60 -0
- package/components/checkbox/demo/design.html +52 -0
- package/components/checkbox/demo/design.md +149 -0
- package/components/checkbox/demo/getting-started.html +52 -0
- package/components/checkbox/demo/getting-started.md +261 -0
- package/components/checkbox/demo/index.html +17 -20
- package/components/checkbox/demo/index.md +144 -29
- package/components/checkbox/demo/index.min.js +5 -4
- package/components/checkbox/demo/keyboard-behavior.html +49 -0
- package/components/checkbox/demo/keyboard-behavior.md +0 -3
- package/components/checkbox/demo/layout.md +30 -0
- package/components/checkbox/demo/readme.html +10 -17
- package/components/checkbox/demo/readme.md +11 -27
- package/components/checkbox/demo/styles.css +974 -0
- package/components/checkbox/demo/voiceover.html +49 -0
- package/components/checkbox/demo/voiceover.md +37 -0
- package/components/checkbox/dist/auro-checkbox.d.ts +1 -0
- package/components/checkbox/dist/index.js +5 -4
- package/components/checkbox/dist/registered.js +5 -4
- package/components/combobox/README.md +8 -29
- package/components/combobox/demo/accessibility.html +2 -20
- package/components/combobox/demo/accessibility.md +1 -1
- package/components/combobox/demo/api.html +5 -52
- package/components/combobox/demo/api.md +53 -2261
- package/components/combobox/demo/api.min.js +15 -12
- package/components/combobox/demo/customize.html +53 -0
- package/components/combobox/demo/customize.js +24 -0
- package/components/combobox/demo/customize.md +1249 -0
- package/components/combobox/demo/customize.min.js +18132 -0
- package/components/combobox/demo/demo-support.js +60 -0
- package/components/combobox/demo/design.html +2 -43
- package/components/combobox/demo/design.md +4 -4
- package/components/combobox/demo/getting-started.html +53 -0
- package/components/combobox/demo/{install.js → getting-started.js} +2 -5
- package/components/combobox/demo/getting-started.md +397 -0
- package/components/combobox/demo/{install.min.js → getting-started.min.js} +14 -38
- package/components/combobox/demo/index.html +4 -47
- package/components/combobox/demo/index.md +3 -569
- package/components/combobox/demo/index.min.js +15 -12
- package/components/combobox/demo/keyboard-behavior.html +2 -20
- package/components/combobox/demo/keyboard-behavior.md +2 -2
- package/components/combobox/demo/layout.md +2 -2
- package/components/combobox/demo/readme.html +2 -43
- package/components/combobox/demo/readme.md +8 -29
- package/components/combobox/demo/styles.css +98 -105
- package/components/combobox/demo/voiceover.html +2 -20
- package/components/combobox/demo/voiceover.md +1 -1
- package/components/combobox/dist/index.js +12 -10
- package/components/combobox/dist/registered.js +12 -10
- package/components/counter/README.md +21 -51
- package/components/counter/demo/accessibility.html +49 -0
- package/components/counter/demo/accessibility.md +34 -0
- package/components/counter/demo/api.html +12 -20
- package/components/counter/demo/api.md +49 -1299
- package/components/counter/demo/api.min.js +6 -6
- package/components/counter/demo/customize.html +53 -0
- package/components/counter/demo/customize.md +650 -0
- package/components/counter/demo/demo-support.js +60 -0
- package/components/counter/demo/design.html +52 -0
- package/components/counter/demo/design.md +192 -0
- package/components/counter/demo/getting-started.html +54 -0
- package/components/counter/demo/getting-started.md +332 -0
- package/components/counter/demo/index.html +14 -19
- package/components/counter/demo/index.md +113 -47
- package/components/counter/demo/index.min.js +6 -6
- package/components/counter/demo/keyboard-behavior.html +49 -0
- package/components/counter/demo/keyboard-behavior.md +1 -1
- package/components/counter/demo/keyboardBehavior.html +7 -39
- package/components/counter/demo/layout.md +10 -0
- package/components/counter/demo/readme.html +11 -15
- package/components/counter/demo/readme.md +21 -51
- package/components/counter/demo/styles.css +974 -0
- package/components/counter/demo/voiceover.html +51 -0
- package/components/counter/demo/voiceover.md +80 -0
- package/components/counter/dist/index.js +6 -6
- package/components/counter/dist/registered.js +6 -6
- package/components/datepicker/README.md +10 -24
- package/components/datepicker/demo/accessibility.html +50 -0
- package/components/datepicker/demo/accessibility.md +64 -0
- package/components/datepicker/demo/api.md +69 -1739
- package/components/datepicker/demo/api.min.js +14 -14
- package/components/datepicker/demo/customize.html +53 -0
- package/components/datepicker/demo/customize.md +723 -0
- package/components/datepicker/demo/demo-support.js +60 -0
- package/components/{select/demo/layout.html → datepicker/demo/design.html} +7 -47
- package/components/datepicker/demo/design.md +158 -0
- package/components/datepicker/demo/getting-started.html +53 -0
- package/components/datepicker/demo/getting-started.md +237 -0
- package/components/datepicker/demo/index.html +14 -34
- package/components/datepicker/demo/index.md +160 -103
- package/components/datepicker/demo/index.min.js +14 -14
- package/components/datepicker/demo/keyboard-behavior.html +12 -33
- package/components/datepicker/demo/layout.md +92 -0
- package/components/datepicker/demo/readme.md +10 -24
- package/components/datepicker/demo/styles.css +974 -0
- package/components/{dropdown/demo/keyboardBehavior.html → datepicker/demo/voiceover.html} +14 -36
- package/components/datepicker/demo/voiceover.md +98 -0
- package/components/datepicker/dist/index.js +14 -14
- package/components/datepicker/dist/registered.js +14 -14
- package/components/dropdown/README.md +0 -25
- package/components/dropdown/demo/accessibility.html +49 -0
- package/components/dropdown/demo/accessibility.md +45 -0
- package/components/dropdown/demo/api.html +10 -19
- package/components/dropdown/demo/api.md +40 -1364
- package/components/dropdown/demo/api.min.js +2 -2
- package/components/dropdown/demo/customize.html +54 -0
- package/components/dropdown/demo/customize.md +780 -0
- package/components/dropdown/demo/demo-support.js +60 -0
- package/components/dropdown/demo/design.html +52 -0
- package/components/dropdown/demo/design.md +186 -0
- package/components/dropdown/demo/getting-started.html +54 -0
- package/components/dropdown/demo/getting-started.md +317 -0
- package/components/dropdown/demo/index.html +12 -20
- package/components/dropdown/demo/index.md +70 -225
- package/components/dropdown/demo/index.min.js +2 -2
- package/components/dropdown/demo/keyboard-behavior.html +49 -0
- package/components/dropdown/demo/keyboard-behavior.md +4 -8
- package/components/dropdown/demo/layout.md +21 -0
- package/components/dropdown/demo/readme.html +7 -20
- package/components/dropdown/demo/readme.md +0 -25
- package/components/dropdown/demo/styles.css +974 -0
- package/components/dropdown/demo/voiceover.html +51 -0
- package/components/dropdown/demo/voiceover.md +63 -0
- package/components/dropdown/dist/index.js +2 -2
- package/components/dropdown/dist/registered.js +2 -2
- package/components/form/README.md +9 -13
- package/components/form/demo/accessibility.html +51 -0
- package/components/form/demo/accessibility.md +23 -0
- package/components/form/demo/api.html +11 -14
- package/components/form/demo/api.md +14 -290
- package/components/form/demo/api.min.js +53 -50
- package/components/form/demo/customize.html +54 -0
- package/components/form/demo/customize.md +246 -0
- package/components/form/demo/demo-support.js +60 -0
- package/components/form/demo/getting-started.html +54 -0
- package/components/form/demo/getting-started.md +291 -0
- package/components/form/demo/index.html +12 -14
- package/components/form/demo/index.md +66 -96
- package/components/form/demo/index.min.js +53 -50
- package/components/form/demo/keyboard-behavior.html +51 -0
- package/components/form/demo/readme.html +12 -17
- package/components/form/demo/readme.md +9 -13
- package/components/form/demo/styles.css +974 -0
- package/components/form/demo/voiceover.html +51 -0
- package/components/form/demo/voiceover.md +36 -0
- package/components/helptext/dist/index.js +1 -1
- package/components/helptext/dist/registered.js +1 -1
- package/components/input/README.md +17 -28
- package/components/input/demo/accessibility.html +38 -0
- package/components/input/demo/accessibility.md +69 -0
- package/components/input/demo/api.html +17 -22
- package/components/input/demo/api.js +4 -23
- package/components/input/demo/api.md +67 -1267
- package/components/input/demo/api.min.js +6 -98
- package/components/input/demo/customize.html +54 -0
- package/components/input/demo/customize.js +25 -0
- package/components/input/demo/customize.md +1372 -0
- package/components/input/demo/customize.min.js +7431 -0
- package/components/input/demo/demo-support.js +60 -0
- package/components/input/demo/design.html +39 -0
- package/components/input/demo/design.md +224 -0
- package/components/input/demo/getting-started.html +53 -0
- package/components/input/demo/getting-started.js +8 -0
- package/components/input/demo/getting-started.md +312 -0
- package/components/input/demo/getting-started.min.js +7369 -0
- package/components/input/demo/index.html +16 -22
- package/components/input/demo/index.js +0 -11
- package/components/input/demo/index.md +171 -139
- package/components/input/demo/index.min.js +6 -18
- package/components/input/demo/keyboard-behavior.html +38 -0
- package/components/input/demo/layout.md +77 -0
- package/components/input/demo/readme.md +17 -28
- package/components/input/demo/styles.css +974 -0
- package/components/input/demo/voiceover.html +38 -0
- package/components/input/demo/voiceover.md +70 -0
- package/components/input/dist/base-input.d.ts +1 -0
- package/components/input/dist/index.js +6 -6
- package/components/input/dist/registered.js +6 -6
- package/components/menu/README.md +1 -5
- package/components/menu/demo/api.md +43 -43
- package/components/menu/demo/api.min.js +2 -2
- package/components/menu/demo/index.md +1 -1
- package/components/menu/demo/index.min.js +2 -2
- package/components/menu/demo/readme.md +1 -5
- package/components/menu/dist/index.js +2 -2
- package/components/menu/dist/registered.js +2 -2
- package/components/radio/README.md +9 -22
- package/components/radio/demo/accessibility.html +51 -0
- package/components/radio/demo/accessibility.md +44 -0
- package/components/radio/demo/api.html +13 -20
- package/components/radio/demo/api.md +44 -589
- package/components/radio/demo/api.min.js +3 -3
- package/components/radio/demo/customize.html +53 -0
- package/components/radio/demo/customize.md +368 -0
- package/components/radio/demo/demo-support.js +60 -0
- package/components/radio/demo/design.html +52 -0
- package/components/radio/demo/design.md +143 -0
- package/components/radio/demo/getting-started.html +54 -0
- package/components/radio/demo/getting-started.md +296 -0
- package/components/radio/demo/index.html +16 -19
- package/components/radio/demo/index.md +110 -45
- package/components/radio/demo/index.min.js +3 -3
- package/components/radio/demo/keyboard-behavior.html +51 -0
- package/components/radio/demo/layout.md +30 -0
- package/components/radio/demo/readme.html +11 -17
- package/components/radio/demo/readme.md +9 -22
- package/components/radio/demo/styles.css +974 -0
- package/components/radio/demo/voiceover.html +51 -0
- package/components/radio/demo/voiceover.md +43 -0
- package/components/radio/dist/index.js +3 -3
- package/components/radio/dist/registered.js +3 -3
- package/components/select/README.md +7 -4
- package/components/select/demo/accessibility.html +5 -21
- package/components/select/demo/accessibility.md +1 -1
- package/components/select/demo/api.html +3 -48
- package/components/select/demo/api.md +52 -2342
- package/components/select/demo/customize.html +54 -0
- package/components/select/demo/customize.js +11 -0
- package/components/select/demo/customize.md +1049 -0
- package/components/select/demo/{api.min.js → customize.min.js} +12 -113
- package/components/select/demo/demo-support.js +60 -0
- package/components/select/demo/design.html +3 -44
- package/components/select/demo/design.md +2 -2
- package/components/select/demo/getting-started.html +5 -76
- package/components/select/demo/getting-started.js +20 -3
- package/components/select/demo/getting-started.md +97 -705
- package/components/select/demo/getting-started.min.js +58 -9
- package/components/select/demo/index.html +4 -43
- package/components/select/demo/index.js +5 -3
- package/components/select/demo/index.md +2 -2
- package/components/select/demo/index.min.js +14 -9
- package/components/select/demo/keyboard-behavior.html +6 -47
- package/components/select/demo/keyboard-behavior.md +5 -6
- package/components/select/demo/keyboardBehavior.html +4 -46
- package/components/select/demo/readme.html +3 -44
- package/components/select/demo/readme.md +7 -4
- package/components/select/demo/styles.css +57 -109
- package/components/select/demo/voiceover.html +3 -30
- package/components/select/dist/index.js +5 -5
- package/components/select/dist/registered.js +5 -5
- package/custom-elements.json +249 -246
- package/package.json +3 -3
- package/components/combobox/demo/install.html +0 -94
- package/components/combobox/demo/install.md +0 -98
- package/components/select/demo/api.js +0 -39
- package/components/select/demo/install.md +0 -92
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {unified} from 'https://esm.sh/unified';
|
|
2
|
+
import remarkParse from 'https://esm.sh/remark-parse';
|
|
3
|
+
import remarkGfm from 'https://esm.sh/remark-gfm';
|
|
4
|
+
import remarkRehype from 'https://esm.sh/remark-rehype';
|
|
5
|
+
import rehypeRaw from 'https://esm.sh/rehype-raw';
|
|
6
|
+
import rehypeHighlight from 'https://esm.sh/rehype-highlight';
|
|
7
|
+
import rehypeStringify from 'https://esm.sh/rehype-stringify';
|
|
8
|
+
|
|
9
|
+
export async function renderPage(mdPath) {
|
|
10
|
+
const response = await fetch(mdPath);
|
|
11
|
+
const text = await response.text();
|
|
12
|
+
const result = await unified()
|
|
13
|
+
.use(remarkParse)
|
|
14
|
+
.use(remarkGfm)
|
|
15
|
+
.use(remarkRehype, { allowDangerousHtml: true })
|
|
16
|
+
.use(rehypeRaw)
|
|
17
|
+
.use(rehypeHighlight)
|
|
18
|
+
.use(rehypeStringify)
|
|
19
|
+
.process(text);
|
|
20
|
+
|
|
21
|
+
document.querySelector('main').innerHTML = String(result);
|
|
22
|
+
addCopyButtons();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function addCopyButtons() {
|
|
26
|
+
document.querySelectorAll('pre code[class*="language-"], pre code[class*="hljs"]').forEach((code) => {
|
|
27
|
+
const pre = code.parentElement;
|
|
28
|
+
const wrapper = document.createElement('div');
|
|
29
|
+
wrapper.className = 'pre-wrapper';
|
|
30
|
+
pre.parentNode.insertBefore(wrapper, pre);
|
|
31
|
+
wrapper.appendChild(pre);
|
|
32
|
+
const btn = document.createElement('button');
|
|
33
|
+
btn.className = 'copy-btn';
|
|
34
|
+
btn.textContent = 'Copy';
|
|
35
|
+
btn.addEventListener('click', () => {
|
|
36
|
+
const raw = code.textContent;
|
|
37
|
+
const text = raw.replace(/\u200B/g, '').replace(/^\n+/, '').replace(/\n+$/, '\n').replace(/^\$ /, '');
|
|
38
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
39
|
+
btn.textContent = 'Copied!';
|
|
40
|
+
setTimeout(() => { btn.textContent = 'Copy'; }, 1500);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
wrapper.appendChild(btn);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function openAccordion(id) {
|
|
48
|
+
document.querySelectorAll('auro-accordion').forEach((accordion) => {
|
|
49
|
+
accordion.removeAttribute('expanded');
|
|
50
|
+
});
|
|
51
|
+
const target = document.getElementById(id);
|
|
52
|
+
if (target) {
|
|
53
|
+
target.setAttribute('expanded', '');
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
56
|
+
}, 550);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
window.openAccordion = openAccordion;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
+
See LICENSE in the project root for license information.
|
|
4
|
+
|
|
5
|
+
HTML in this document is standardized and NOT to be edited.
|
|
6
|
+
All demo code should be added/edited in ./demo/design.md
|
|
7
|
+
|
|
8
|
+
With the exception of adding custom elements if needed for the demo.
|
|
9
|
+
|
|
10
|
+
----------------------- DO NOT EDIT -----------------------------
|
|
11
|
+
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
<!DOCTYPE html>
|
|
15
|
+
<html lang="en">
|
|
16
|
+
<head>
|
|
17
|
+
<meta charset="UTF-8" />
|
|
18
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
+
<title>Auro Web Component Demo | auro-checkbox | Design</title>
|
|
20
|
+
|
|
21
|
+
<!-- highlight.js Stylesheet -->
|
|
22
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
|
|
23
|
+
|
|
24
|
+
<!-- Legacy reference is still needed to support auro-checkbox's use of legacy token values at this time -->
|
|
25
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
26
|
+
|
|
27
|
+
<!-- Design Token Alaska Theme -->
|
|
28
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
+
|
|
30
|
+
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
+
|
|
33
|
+
<!-- Demo Specific Styles -->
|
|
34
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
|
|
35
|
+
<link rel="stylesheet" type="text/css" href="./styles.css" />
|
|
36
|
+
</head>
|
|
37
|
+
<body class="auro-markdown">
|
|
38
|
+
<main></main>
|
|
39
|
+
|
|
40
|
+
<script type="module">
|
|
41
|
+
import { renderPage } from './demo-support.js';
|
|
42
|
+
await renderPage('./design.md');
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<!-- If additional elements are needed for the demo, add them here. -->
|
|
46
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
47
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
48
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
|
|
49
|
+
|
|
50
|
+
<script src="./index.min.js" data-demo-script="true" type="module"></script>
|
|
51
|
+
</body>
|
|
52
|
+
</html>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<auro-header level="1" id="overview">Checkbox - Design</auro-header>
|
|
2
|
+
<div class="contentWrapper">
|
|
3
|
+
<div class="mainContent">
|
|
4
|
+
<div class="scrollWrapper">
|
|
5
|
+
<auro-header level="3" id="anatomy">Component Anatomy</auro-header>
|
|
6
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/layout/layout.md) -->
|
|
7
|
+
<!-- The below content is automatically added from ./../docs/partials/layout/layout.md -->
|
|
8
|
+
<p>The component consists of the following elements:</p>
|
|
9
|
+
<ul>
|
|
10
|
+
<li>
|
|
11
|
+
<strong>checkbox group:</strong> a container element (<code><auro-checkbox-group></code>) that manages a collection of checkboxes, handles validation, and provides a shared legend and help text.
|
|
12
|
+
</li>
|
|
13
|
+
<li>
|
|
14
|
+
<strong>checkbox:</strong> an individual selectable element (<code><auro-checkbox></code>) that can be toggled between checked and unchecked states.
|
|
15
|
+
</li>
|
|
16
|
+
<li>
|
|
17
|
+
<strong>legend:</strong> descriptive label rendered above the group of checkboxes, set via the <code>legend</code> slot on the group.
|
|
18
|
+
</li>
|
|
19
|
+
<li>
|
|
20
|
+
<strong>help text:</strong> descriptive text rendered below the group intended to help clarify the intended use of the component and any current validation error with instructions to resolve those errors.
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
<auro-header level="4" id="checkboxGroup">Checkbox Group</auro-header>
|
|
24
|
+
<p>The group element coordinates shared behavior across all child checkboxes, including validation (e.g. <code>required</code>), error state display, and the <code>disabled</code> attribute which disables all options at once.</p>
|
|
25
|
+
<auro-header level="4" id="checkbox">Checkbox</auro-header>
|
|
26
|
+
<p>Each checkbox renders a visual indicator (checkmark) and a label. A checkbox may be in one of the following states:</p>
|
|
27
|
+
<ul>
|
|
28
|
+
<li>
|
|
29
|
+
<code>checked</code> - The checkbox is selected and its value is included in the group's value.
|
|
30
|
+
</li>
|
|
31
|
+
<li>
|
|
32
|
+
<code>disabled</code> - The checkbox is not interactive and cannot be toggled.
|
|
33
|
+
</li>
|
|
34
|
+
<li>
|
|
35
|
+
<code>error</code> - Inherited from the parent group when validation fails.
|
|
36
|
+
</li>
|
|
37
|
+
</ul>
|
|
38
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
39
|
+
<auro-header level="3" id="defaultLayout">Default Layout</auro-header>
|
|
40
|
+
<p>The <code>auro-checkbox-group</code> renders checkboxes in a vertical list by default.</p>
|
|
41
|
+
<div class="exampleWrapper">
|
|
42
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
43
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
44
|
+
<auro-checkbox-group>
|
|
45
|
+
<span slot="legend">Form label goes here</span>
|
|
46
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
47
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2">Checkbox option</auro-checkbox>
|
|
48
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option that has some extra text that should wrap when rendered in a narrow container</auro-checkbox>
|
|
49
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
50
|
+
</auro-checkbox-group>
|
|
51
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
52
|
+
</div>
|
|
53
|
+
<auro-accordion alignRight>
|
|
54
|
+
<span slot="trigger">See code</span>
|
|
55
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
56
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
57
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group>
|
|
58
|
+
<span slot="legend">Form label goes here</span>
|
|
59
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
60
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2">Checkbox option</auro-checkbox>
|
|
61
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option that has some extra text that should wrap when rendered in a narrow container</auro-checkbox>
|
|
62
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
63
|
+
</auro-checkbox-group></code></pre>
|
|
64
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
65
|
+
</auro-accordion>
|
|
66
|
+
<auro-header level="3" id="horizontalLayout">Horizontal Layout</auro-header>
|
|
67
|
+
<p>Use the <code>horizontal</code> attribute to render options on a single horizontal line.</p>
|
|
68
|
+
<p><strong>Note:</strong> The <code>horizontal</code> attribute has a limit of 3 options. Beyond three, options will be listed vertically.</p>
|
|
69
|
+
<div class="exampleWrapper">
|
|
70
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/horizontal.html) -->
|
|
71
|
+
<!-- The below content is automatically added from ./../apiExamples/horizontal.html -->
|
|
72
|
+
<auro-checkbox-group horizontal>
|
|
73
|
+
<span slot="legend">Form label goes here</span>
|
|
74
|
+
<auro-checkbox value="yes" name="horizontal" id="checkbox-horizontal1">Yes</auro-checkbox>
|
|
75
|
+
<auro-checkbox value="no" name="horizontal" id="checkbox-horizontal2">No</auro-checkbox>
|
|
76
|
+
<auro-checkbox value="maybe" name="horizontal" id="checkbox-horizontal3">Maybe</auro-checkbox>
|
|
77
|
+
</auro-checkbox-group>
|
|
78
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
79
|
+
</div>
|
|
80
|
+
<auro-accordion alignRight>
|
|
81
|
+
<span slot="trigger">See code</span>
|
|
82
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/horizontal.html) -->
|
|
83
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/horizontal.html -->
|
|
84
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group horizontal>
|
|
85
|
+
<span slot="legend">Form label goes here</span>
|
|
86
|
+
<auro-checkbox value="yes" name="horizontal" id="checkbox-horizontal1">Yes</auro-checkbox>
|
|
87
|
+
<auro-checkbox value="no" name="horizontal" id="checkbox-horizontal2">No</auro-checkbox>
|
|
88
|
+
<auro-checkbox value="maybe" name="horizontal" id="checkbox-horizontal3">Maybe</auro-checkbox>
|
|
89
|
+
</auro-checkbox-group></code></pre>
|
|
90
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
91
|
+
</auro-accordion>
|
|
92
|
+
<auro-header level="3" id="colors">Colors</auro-header>
|
|
93
|
+
<auro-header level="4" id="defaultColor">Default Color</auro-header>
|
|
94
|
+
<p>When the component is used on a light background.</p>
|
|
95
|
+
<div class="exampleWrapper">
|
|
96
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
97
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
98
|
+
<auro-checkbox-group>
|
|
99
|
+
<span slot="legend">Form label goes here</span>
|
|
100
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
101
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2">Checkbox option</auro-checkbox>
|
|
102
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option that has some extra text that should wrap when rendered in a narrow container</auro-checkbox>
|
|
103
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
104
|
+
</auro-checkbox-group>
|
|
105
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
|
+
</div>
|
|
107
|
+
<auro-accordion alignRight>
|
|
108
|
+
<span slot="trigger">See code</span>
|
|
109
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
110
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
111
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group>
|
|
112
|
+
<span slot="legend">Form label goes here</span>
|
|
113
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
114
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2">Checkbox option</auro-checkbox>
|
|
115
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option that has some extra text that should wrap when rendered in a narrow container</auro-checkbox>
|
|
116
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
117
|
+
</auro-checkbox-group></code></pre>
|
|
118
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
119
|
+
</auro-accordion>
|
|
120
|
+
<auro-header level="4" id="inverseColor">Inverse Color</auro-header>
|
|
121
|
+
<p>When the component is used on a darker background, set <code>appearance="inverse"</code> to invert the component colors for proper contrast and visibility.</p>
|
|
122
|
+
<div class="exampleWrapper--ondark">
|
|
123
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse.html) -->
|
|
124
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
125
|
+
<auro-checkbox-group appearance="inverse">
|
|
126
|
+
<span slot="legend">Form label goes here</span>
|
|
127
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
128
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2" checked>Checkbox option</auro-checkbox>
|
|
129
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option</auro-checkbox>
|
|
130
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
131
|
+
</auro-checkbox-group>
|
|
132
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
133
|
+
</div>
|
|
134
|
+
<auro-accordion alignRight>
|
|
135
|
+
<span slot="trigger">See code</span>
|
|
136
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse.html) -->
|
|
137
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
138
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group appearance="inverse">
|
|
139
|
+
<span slot="legend">Form label goes here</span>
|
|
140
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
141
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2" checked>Checkbox option</auro-checkbox>
|
|
142
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option</auro-checkbox>
|
|
143
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
144
|
+
</auro-checkbox-group></code></pre>
|
|
145
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
146
|
+
</auro-accordion>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
+
See LICENSE in the project root for license information.
|
|
4
|
+
|
|
5
|
+
HTML in this document is standardized and NOT to be edited.
|
|
6
|
+
All demo code should be added/edited in ./demo/getting-started.md
|
|
7
|
+
|
|
8
|
+
----------------------- DO NOT EDIT -----------------------------
|
|
9
|
+
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
<!DOCTYPE html>
|
|
13
|
+
<html lang="en">
|
|
14
|
+
<head>
|
|
15
|
+
<meta charset="UTF-8" />
|
|
16
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
17
|
+
<title>Auro Web Component Demo | auro-checkbox | Getting Started</title>
|
|
18
|
+
|
|
19
|
+
<!-- highlight.js Stylesheet -->
|
|
20
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
|
|
21
|
+
|
|
22
|
+
<!-- Legacy reference is still needed to support auro-checkbox's use of legacy token values at this time -->
|
|
23
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
24
|
+
|
|
25
|
+
<!-- Design Token Alaska Theme -->
|
|
26
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
27
|
+
|
|
28
|
+
<!-- Webcore Stylesheet Alaska Theme -->
|
|
29
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
30
|
+
|
|
31
|
+
<!-- Demo Specific Styles -->
|
|
32
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
|
|
33
|
+
<link rel="stylesheet" type="text/css" href="./styles.css" />
|
|
34
|
+
</head>
|
|
35
|
+
<body class="auro-markdown">
|
|
36
|
+
<main></main>
|
|
37
|
+
|
|
38
|
+
<!-- If additional elements are needed for the demo, add them here. -->
|
|
39
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
40
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-nav@latest/+esm" type="module"></script>
|
|
41
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
42
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
43
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
|
|
44
|
+
<script type="module">
|
|
45
|
+
import { renderPage } from './demo-support.js';
|
|
46
|
+
await renderPage('./getting-started.md');
|
|
47
|
+
import { initExamples } from "./api.min.js";
|
|
48
|
+
initExamples();
|
|
49
|
+
</script>
|
|
50
|
+
<script src="./api.min.js" data-demo-script="true" type="module"></script>
|
|
51
|
+
</body>
|
|
52
|
+
</html>
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
<auro-header level="1" id="overview">Checkbox - Getting Started</auro-header>
|
|
2
|
+
<div class="contentWrapper">
|
|
3
|
+
<nav>
|
|
4
|
+
<auro-nav anchorNavContent=".scrollWrapper">
|
|
5
|
+
<span slot="mobileToggleCollapsed">View More</span>
|
|
6
|
+
<span slot="mobileToggleExpanded">View Less</span>
|
|
7
|
+
<auro-anchorlink fluid href="#setup">Setup</auro-anchorlink>
|
|
8
|
+
<auro-anchorlink fluid href="#recommendedSetup" class="level2 body-xs" onclick="openAccordion('recommendedAccordion')">Recommended</auro-anchorlink>
|
|
9
|
+
<auro-anchorlink fluid href="#autoSetup" class="level2 body-xs" onclick="openAccordion('autoAccordion')">Auto</auro-anchorlink>
|
|
10
|
+
<auro-anchorlink fluid href="#cdnSetup" class="level2 body-xs" onclick="openAccordion('cdnAccordion')">CDN</auro-anchorlink>
|
|
11
|
+
<auro-anchorlink fluid href="#minimalConfig">Minimal Config</auro-anchorlink>
|
|
12
|
+
<auro-anchorlink fluid href="#slots">Slots</auro-anchorlink>
|
|
13
|
+
<auro-anchorlink fluid href="#slotsGroup" class="level2 body-xs">auro-checkbox-group</auro-anchorlink>
|
|
14
|
+
<auro-anchorlink fluid href="#slot-default-group" class="level2 body-xs">- (default)</auro-anchorlink>
|
|
15
|
+
<auro-anchorlink fluid href="#slot-legend" class="level2 body-xs">- legend</auro-anchorlink>
|
|
16
|
+
<auro-anchorlink fluid href="#slot-helpText" class="level2 body-xs">- helpText</auro-anchorlink>
|
|
17
|
+
<auro-anchorlink fluid href="#slot-optionalLabel" class="level2 body-xs">- optionalLabel</auro-anchorlink>
|
|
18
|
+
<auro-anchorlink fluid href="#slotsCheckbox" class="level2 body-xs">auro-checkbox</auro-anchorlink>
|
|
19
|
+
<auro-anchorlink fluid href="#slot-default-checkbox" class="level2 body-xs">- (default)</auro-anchorlink>
|
|
20
|
+
<auro-anchorlink fluid href="#stateManagement">State Management</auro-anchorlink>
|
|
21
|
+
<auro-anchorlink fluid href="#validity" class="level2 body-xs">Validity</auro-anchorlink>
|
|
22
|
+
<auro-anchorlink fluid href="#publicFunctions">Functions</auro-anchorlink>
|
|
23
|
+
<auro-anchorlink fluid href="#reset" class="level2 body-xs">reset()</auro-anchorlink>
|
|
24
|
+
<auro-anchorlink fluid href="#validate" class="level2 body-xs">validate()</auro-anchorlink>
|
|
25
|
+
</auro-nav>
|
|
26
|
+
</nav>
|
|
27
|
+
<div class="mainContent">
|
|
28
|
+
<div class="scrollWrapper">
|
|
29
|
+
<section>
|
|
30
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/pages/install.md) -->
|
|
31
|
+
<!-- The below content is automatically added from ./../docs/pages/install.md -->
|
|
32
|
+
<auro-header level="2" id="setup">Setup</auro-header>
|
|
33
|
+
<auro-accordion-group Emphasis>
|
|
34
|
+
<auro-accordion expanded class="section" id="recommendedAccordion">
|
|
35
|
+
<span slot="trigger">Recommended Installation and Implementation</span>
|
|
36
|
+
<div class="accordion-content">
|
|
37
|
+
<auro-header level="3">Install</auro-header>
|
|
38
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../../docs/templates/componentInstall.md) -->
|
|
39
|
+
<!-- The below content is automatically added from ./../../../docs/templates/componentInstall.md -->
|
|
40
|
+
|
|
41
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-formkit</code></pre>
|
|
42
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
43
|
+
<auro-header level="3">Implementation</auro-header>
|
|
44
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/customRegistration.md) -->
|
|
45
|
+
<!-- The below content is automatically added from ./../docs/partials/customRegistration.md -->
|
|
46
|
+
<auro-header level="2" id="customRegistration">Custom Component Registration for Version Management</auro-header>
|
|
47
|
+
There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition. The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
48
|
+
|
|
49
|
+
You can do this by importing only the component class and using the <code>register(name)</code> method with a unique name:
|
|
50
|
+
|
|
51
|
+
<pre class="language-js"><code class="language-js">// Import the class only
|
|
52
|
+
import { AuroCheckbox, AuroCheckboxGroup } from '@aurodesignsystem/auro-formkit/auro-checkbox/class';
|
|
53
|
+
|
|
54
|
+
// Register with a custom name if desired
|
|
55
|
+
AuroCheckbox.register('custom-checkbox');
|
|
56
|
+
AuroCheckboxGroup.register('custom-checkbox-group');</code></pre>
|
|
57
|
+
|
|
58
|
+
This will create a new custom element <code>>custom-checkbox<</code> and <code>>custom-checkbox-group<</code> that behaves exactly like <code>>auro-checkbox<</code> and <code><auro-checkbox-group></code>, allowing both to coexist on the same page without interfering with each other.
|
|
59
|
+
|
|
60
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/custom.html) -->
|
|
61
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/custom.html -->
|
|
62
|
+
<pre class="language-html"><code class="language-html"><custom-checkbox-group>
|
|
63
|
+
<span slot="legend">Form label goes here</span>
|
|
64
|
+
<custom-checkbox value="value1" name="custom" id="checkbox-custom1">Custom checkbox option</custom-checkbox>
|
|
65
|
+
<custom-checkbox value="value2" name="custom" id="checkbox-custom2" checked>Custom checkbox option</custom-checkbox>
|
|
66
|
+
<custom-checkbox value="value3" name="custom" id="checkbox-custom3">Custom checkbox option</custom-checkbox>
|
|
67
|
+
<custom-checkbox value="value4" name="custom" id="checkbox-custom4">Custom checkbox option</custom-checkbox>
|
|
68
|
+
</custom-checkbox-group></code></pre>
|
|
69
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
70
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
71
|
+
</div>
|
|
72
|
+
</auro-accordion>
|
|
73
|
+
<auro-accordion class="section" id="autoAccordion">
|
|
74
|
+
<span slot="trigger">Auto Installation and Implementation</span>
|
|
75
|
+
<div class="accordion-content">
|
|
76
|
+
<p class="warning"><strong>Warning:</strong> Default registration can cause conflicts if another package registers the same tag name using a different version of the component, leading to unexpected behavior. Use custom registration to avoid this risk.</p>
|
|
77
|
+
<auro-header level="3">Install</auro-header>
|
|
78
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../../docs/templates/componentInstall.md) -->
|
|
79
|
+
<!-- The below content is automatically added from ./../../../docs/templates/componentInstall.md -->
|
|
80
|
+
|
|
81
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-formkit</code></pre>
|
|
82
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
83
|
+
<auro-header level="3">Implementation</auro-header>
|
|
84
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/defaultRegistration.md) -->
|
|
85
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/defaultRegistration.md -->
|
|
86
|
+
<p>Once installed, the component can be used in your project by importing the component's registered module:</p>
|
|
87
|
+
|
|
88
|
+
<pre class="language-js"><code class="language-js">import '@aurodesignsystem/auro-formkit/auro-checkbox';</code></pre>
|
|
89
|
+
<p>This import registers the <code><auro-checkbox></code> and <code><auro-checkbox-group></code> custom elements globally. You can then use them in your HTML:</p>
|
|
90
|
+
|
|
91
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group>
|
|
92
|
+
<span slot="legend">Choose your options</span>
|
|
93
|
+
<auro-checkbox value="option1" name="default" id="cb1">Option 1</auro-checkbox>
|
|
94
|
+
<auro-checkbox value="option2" name="default" id="cb2">Option 2</auro-checkbox>
|
|
95
|
+
</auro-checkbox-group></code></pre>
|
|
96
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
97
|
+
</div>
|
|
98
|
+
</auro-accordion>
|
|
99
|
+
<auro-accordion class="section" id="cdnAccordion">
|
|
100
|
+
<span slot="trigger">CDN Installation and Implementation</span>
|
|
101
|
+
<div class="accordion-content">
|
|
102
|
+
<p class="warning"><strong>Warning:</strong> CDN install & registration can cause conflicts if another package registers the same tag name using a different version of the component, leading to unexpected behavior. Use custom registration to avoid this risk.</p>
|
|
103
|
+
<auro-header level="3">Install & Implementation</auro-header>
|
|
104
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/cdnRegistration.md) -->
|
|
105
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/cdnRegistration.md -->
|
|
106
|
+
<p>Add the following script tag to your HTML to load the component directly from a CDN:</p>
|
|
107
|
+
|
|
108
|
+
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-checkbox/+esm"></script></code></pre>
|
|
109
|
+
<p>This script registers the <code><auro-checkbox></code> and <code><auro-checkbox-group></code> custom elements globally. You can then use them in your HTML:</p>
|
|
110
|
+
|
|
111
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group>
|
|
112
|
+
<span slot="legend">Choose your options</span>
|
|
113
|
+
<auro-checkbox value="option1" name="cdn" id="cb-cdn1">Option 1</auro-checkbox>
|
|
114
|
+
<auro-checkbox value="option2" name="cdn" id="cb-cdn2">Option 2</auro-checkbox>
|
|
115
|
+
</auro-checkbox-group></code></pre>
|
|
116
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
|
+
</div>
|
|
118
|
+
</auro-accordion>
|
|
119
|
+
</auro-accordion-group>
|
|
120
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
121
|
+
</section>
|
|
122
|
+
<section>
|
|
123
|
+
<auro-header level="3" id="minimalConfig">Minimal Configuration</auro-header>
|
|
124
|
+
<p>Every <code><auro-checkbox-group></code> implementation requires:</p>
|
|
125
|
+
<ol>
|
|
126
|
+
<li><strong>A legend in the <code>legend</code> slot</strong> — Provides an accessible label for the checkbox group.</li>
|
|
127
|
+
<li><strong>One or more <code><auro-checkbox></code> elements</strong> — Each with a unique <code>value</code> and <code>name</code> attribute.</li>
|
|
128
|
+
</ol>
|
|
129
|
+
|
|
130
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group>
|
|
131
|
+
<span slot="legend">Form label goes here</span>
|
|
132
|
+
<auro-checkbox value="option1" name="example" id="cb-ex1">Option 1</auro-checkbox>
|
|
133
|
+
<auro-checkbox value="option2" name="example" id="cb-ex2">Option 2</auro-checkbox>
|
|
134
|
+
</auro-checkbox-group></code></pre>
|
|
135
|
+
</section>
|
|
136
|
+
<section>
|
|
137
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/slots.md) -->
|
|
138
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/slots.md -->
|
|
139
|
+
<auro-header level="2" id="slots">Slots</auro-header>
|
|
140
|
+
<auro-header level="3" id="slotsGroup">auro-checkbox-group</auro-header>
|
|
141
|
+
<auro-header level="4" id="slot-default-group">(default)</auro-header>
|
|
142
|
+
<p>Default slot for the checkbox items. Place <code><auro-checkbox></code> elements here.</p>
|
|
143
|
+
<auro-header level="4" id="slot-legend">legend</auro-header>
|
|
144
|
+
<p>Defines the content of the legend label for the checkbox group.</p>
|
|
145
|
+
<auro-header level="4" id="slot-helpText">helpText</auro-header>
|
|
146
|
+
<p>Defines the content of the help text displayed below the checkbox group.</p>
|
|
147
|
+
<auro-header level="4" id="slot-optionalLabel">optionalLabel</auro-header>
|
|
148
|
+
<p>Allows overriding the optional display text <code>"(optional)"</code>, which appears next to the legend.</p>
|
|
149
|
+
<div class="exampleWrapper">
|
|
150
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/optional-label.html) -->
|
|
151
|
+
<!-- The below content is automatically added from ./../apiExamples/optional-label.html -->
|
|
152
|
+
<auro-checkbox-group>
|
|
153
|
+
<span slot="legend">Form label goes here</span>
|
|
154
|
+
<span slot="optionalLabel" style="font-size: small; color: grey"> - optional</span>
|
|
155
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
156
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2" checked>Checkbox option</auro-checkbox>
|
|
157
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option that has some extra text that should wrap when rendered in a narrow container</auro-checkbox>
|
|
158
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
159
|
+
</auro-checkbox-group>
|
|
160
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
161
|
+
</div>
|
|
162
|
+
<auro-accordion alignRight>
|
|
163
|
+
<span slot="trigger">See code</span>
|
|
164
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/optional-label.html) -->
|
|
165
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/optional-label.html -->
|
|
166
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group>
|
|
167
|
+
<span slot="legend">Form label goes here</span>
|
|
168
|
+
<span slot="optionalLabel" style="font-size: small; color: grey"> - optional</span>
|
|
169
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
170
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2" checked>Checkbox option</auro-checkbox>
|
|
171
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option that has some extra text that should wrap when rendered in a narrow container</auro-checkbox>
|
|
172
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
173
|
+
</auro-checkbox-group></code></pre>
|
|
174
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
175
|
+
</auro-accordion>
|
|
176
|
+
<auro-header level="3" id="slotsCheckbox">auro-checkbox</auro-header>
|
|
177
|
+
<auro-header level="3" id="slot-default-checkbox">(default)</auro-header>
|
|
178
|
+
<p>Default slot for the checkbox label text. The content placed inside each <code><auro-checkbox></code> element becomes the visible label rendered next to the checkbox input.</p>
|
|
179
|
+
<div class="exampleWrapper">
|
|
180
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
181
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
182
|
+
<auro-checkbox-group>
|
|
183
|
+
<span slot="legend">Form label goes here</span>
|
|
184
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
185
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2">Checkbox option</auro-checkbox>
|
|
186
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option that has some extra text that should wrap when rendered in a narrow container</auro-checkbox>
|
|
187
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
188
|
+
</auro-checkbox-group>
|
|
189
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
190
|
+
</div>
|
|
191
|
+
<auro-accordion alignRight>
|
|
192
|
+
<span slot="trigger">See code</span>
|
|
193
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
194
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
195
|
+
<pre class="language-html"><code class="language-html"><auro-checkbox-group>
|
|
196
|
+
<span slot="legend">Form label goes here</span>
|
|
197
|
+
<auro-checkbox value="value1" name="basic" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
198
|
+
<auro-checkbox value="value2" name="basic" id="checkbox-basic2">Checkbox option</auro-checkbox>
|
|
199
|
+
<auro-checkbox value="value3" name="basic" id="checkbox-basic3">Checkbox option that has some extra text that should wrap when rendered in a narrow container</auro-checkbox>
|
|
200
|
+
<auro-checkbox value="value4" name="basic" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
201
|
+
</auro-checkbox-group></code></pre>
|
|
202
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
203
|
+
</auro-accordion>
|
|
204
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
205
|
+
</section>
|
|
206
|
+
<section>
|
|
207
|
+
<auro-header level="2" id="stateManagement">State Management</auro-header>
|
|
208
|
+
<p>The following properties reflect the current state of the component and can be accessed via JavaScript.</p>
|
|
209
|
+
<auro-header level="3" id="validity">validity</auro-header>
|
|
210
|
+
<p>Returns the current <code>validityState</code> of the checkbox group as a string. Possible values include <code>"valid"</code>, <code>"valueMissing"</code>, and <code>"customError"</code>.</p>
|
|
211
|
+
</section>
|
|
212
|
+
<section>
|
|
213
|
+
<auro-header level="2" id="publicFunctions">Functions</auro-header>
|
|
214
|
+
<p>The following public methods are available on the <code><auro-checkbox-group></code> element.</p>
|
|
215
|
+
<auro-header level="3" id="reset">reset()</auro-header>
|
|
216
|
+
<p>Resets the checkbox group to its initial state, clearing all checked values and validation state.</p>
|
|
217
|
+
<div class="exampleWrapper">
|
|
218
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/reset-state.html) -->
|
|
219
|
+
<!-- The below content is automatically added from ./../apiExamples/reset-state.html -->
|
|
220
|
+
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
221
|
+
<br/><br/>
|
|
222
|
+
<auro-checkbox-group id="resetStateExample" required setCustomValidityValueMissing="Please select an option">
|
|
223
|
+
<span slot="legend">Form label goes here</span>
|
|
224
|
+
<auro-checkbox value="value1" name="resetState" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
225
|
+
<auro-checkbox value="value2" name="resetState" id="checkbox-basic2">Checkbox option</auro-checkbox>
|
|
226
|
+
<auro-checkbox value="value3" name="resetState" id="checkbox-basic3">Checkbox option</auro-checkbox>
|
|
227
|
+
<auro-checkbox value="value4" name="resetState" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
228
|
+
</auro-checkbox-group>
|
|
229
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
230
|
+
</div>
|
|
231
|
+
<auro-accordion alignRight>
|
|
232
|
+
<span slot="trigger">See code</span>
|
|
233
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset-state.html) -->
|
|
234
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/reset-state.html -->
|
|
235
|
+
<pre class="language-html"><code class="language-html"><auro-button id="resetStateBtn">Reset</auro-button>
|
|
236
|
+
<br/><br/>
|
|
237
|
+
<auro-checkbox-group id="resetStateExample" required setCustomValidityValueMissing="Please select an option">
|
|
238
|
+
<span slot="legend">Form label goes here</span>
|
|
239
|
+
<auro-checkbox value="value1" name="resetState" id="checkbox-basic1">Checkbox option</auro-checkbox>
|
|
240
|
+
<auro-checkbox value="value2" name="resetState" id="checkbox-basic2">Checkbox option</auro-checkbox>
|
|
241
|
+
<auro-checkbox value="value3" name="resetState" id="checkbox-basic3">Checkbox option</auro-checkbox>
|
|
242
|
+
<auro-checkbox value="value4" name="resetState" id="checkbox-basic4">Checkbox option</auro-checkbox>
|
|
243
|
+
</auro-checkbox-group></code></pre>
|
|
244
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
245
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset-state.js) -->
|
|
246
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/reset-state.js -->
|
|
247
|
+
<pre class="language-js"><code class="language-js">export function resetStateExample() {
|
|
248
|
+
const elem = document.querySelector('#resetStateExample');
|
|
249
|
+
|
|
250
|
+
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
251
|
+
elem.reset();
|
|
252
|
+
});
|
|
253
|
+
}</code></pre>
|
|
254
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
255
|
+
</auro-accordion>
|
|
256
|
+
<auro-header level="3" id="validate">validate()</auro-header>
|
|
257
|
+
<p>Triggers validation on the checkbox group. Pass <code>true</code> to force validation even when <code>noValidate</code> is set.</p>
|
|
258
|
+
</section>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|