@aurodesignsystem-dev/auro-formkit 0.0.0-pr1451.21 → 0.0.0-pr1451.22

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.
Files changed (61) hide show
  1. package/components/checkbox/demo/api.min.js +1 -1
  2. package/components/checkbox/demo/index.min.js +1 -1
  3. package/components/checkbox/dist/index.js +1 -1
  4. package/components/checkbox/dist/registered.js +1 -1
  5. package/components/combobox/demo/api.min.js +3 -3
  6. package/components/combobox/demo/customize.min.js +3 -3
  7. package/components/combobox/demo/getting-started.min.js +3 -3
  8. package/components/combobox/demo/index.min.js +3 -3
  9. package/components/combobox/dist/index.js +3 -3
  10. package/components/combobox/dist/registered.js +3 -3
  11. package/components/counter/demo/api.min.js +2 -2
  12. package/components/counter/demo/index.min.js +2 -2
  13. package/components/counter/dist/index.js +2 -2
  14. package/components/counter/dist/registered.js +2 -2
  15. package/components/datepicker/demo/api.min.js +3 -3
  16. package/components/datepicker/demo/index.min.js +3 -3
  17. package/components/datepicker/dist/index.js +3 -3
  18. package/components/datepicker/dist/registered.js +3 -3
  19. package/components/dropdown/demo/api.min.js +1 -1
  20. package/components/dropdown/demo/index.min.js +1 -1
  21. package/components/dropdown/dist/index.js +1 -1
  22. package/components/dropdown/dist/registered.js +1 -1
  23. package/components/form/demo/api.min.js +13 -13
  24. package/components/form/demo/index.min.js +13 -13
  25. package/components/input/demo/api.min.js +1 -1
  26. package/components/input/demo/customize.min.js +1 -1
  27. package/components/input/demo/getting-started.min.js +1 -1
  28. package/components/input/demo/index.min.js +1 -1
  29. package/components/input/dist/index.js +1 -1
  30. package/components/input/dist/registered.js +1 -1
  31. package/components/menu/README.md +8 -26
  32. package/components/menu/demo/accessibility.html +53 -0
  33. package/components/menu/demo/accessibility.md +34 -0
  34. package/components/menu/demo/api.html +11 -17
  35. package/components/menu/demo/api.md +0 -1059
  36. package/components/menu/demo/customize.html +54 -0
  37. package/components/menu/demo/customize.md +639 -0
  38. package/components/menu/demo/demo-support.js +60 -0
  39. package/components/menu/demo/design.html +53 -0
  40. package/components/menu/demo/design.md +81 -0
  41. package/components/menu/demo/getting-started.html +54 -0
  42. package/components/menu/demo/getting-started.md +169 -0
  43. package/components/menu/demo/index.html +14 -19
  44. package/components/menu/demo/index.md +26 -63
  45. package/components/menu/demo/keyboard-behavior.html +53 -0
  46. package/components/menu/demo/readme.html +11 -15
  47. package/components/menu/demo/readme.md +8 -26
  48. package/components/menu/demo/styles.css +974 -0
  49. package/components/menu/demo/voiceover.html +53 -0
  50. package/components/menu/demo/voiceover.md +33 -0
  51. package/components/radio/demo/api.min.js +1 -1
  52. package/components/radio/demo/index.min.js +1 -1
  53. package/components/radio/dist/index.js +1 -1
  54. package/components/radio/dist/registered.js +1 -1
  55. package/components/select/demo/customize.min.js +2 -2
  56. package/components/select/demo/getting-started.min.js +2 -2
  57. package/components/select/demo/index.min.js +2 -2
  58. package/components/select/dist/index.js +2 -2
  59. package/components/select/dist/registered.js +2 -2
  60. package/custom-elements.json +244 -244
  61. package/package.json +1 -1
@@ -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,53 @@
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-menu | 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-menu'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-nav@latest/+esm" type="module"></script>
48
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
49
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
50
+
51
+ <script src="./index.min.js" data-demo-script="true" type="module"></script>
52
+ </body>
53
+ </html>
@@ -0,0 +1,81 @@
1
+ <auro-header level="1" id="overview">Menu - Design</auro-header>
2
+ <div class="contentWrapper">
3
+ <div class="mainContent">
4
+ <div class="scrollWrapper">
5
+ <section>
6
+ <auro-header level="2" id="anatomy">Component Anatomy</auro-header>
7
+ <p>The <code>auro-menu</code> component is a list container that renders one or more <code>auro-menuoption</code> elements. The component consists of the following key elements:</p>
8
+ <ul>
9
+ <li><strong>Menu Container</strong> — The outer list element (<code>role="listbox"</code>) that holds all options and manages selection state, keyboard navigation, and active/selected tracking.</li>
10
+ <li><strong>Menu Option</strong> — An individual selectable item (<code>auro-menuoption</code>) within the menu. Each option can carry a <code>value</code>, display label text, and respond to selection, disabled, and hidden states.</li>
11
+ <li><strong>Checkmark Icon</strong> — A visual indicator shown on the selected option(s). Can be hidden with the <code>nocheckmark</code> attribute.</li>
12
+ <li><strong>Divider (<code>&lt;hr&gt;</code>)</strong> — A horizontal rule used to visually separate groups of options within the menu.</li>
13
+ </ul>
14
+ <auro-header level="3" id="menuOption">Menu Option</auro-header>
15
+ <p>Each <code>auro-menuoption</code> is a focusable element that visually responds to common UI states — <strong>Hover</strong>, <strong>Active</strong> (keyboard-highlighted), <strong>Selected</strong>, and <strong>Disabled</strong>. Options support a default slot for display text and a <code>value</code> attribute that is used for programmatic selection.</p>
16
+ <auro-header level="3" id="dividers">Dividers</auro-header>
17
+ <p>Use standard <code>&lt;hr&gt;</code> elements between <code>auro-menuoption</code> elements to create visual group separators. Dividers are non-interactive and are skipped during keyboard navigation.</p>
18
+ <auro-header level="3" id="checkmark">Checkmark</auro-header>
19
+ <p>By default, a checkmark icon appears next to the selected option(s). Use the <code>nocheckmark</code> attribute on <code>auro-menu</code> to hide this indicator when a simpler visual style is preferred.</p>
20
+ </section>
21
+ <section>
22
+ <auro-header level="2" id="shapeSizeLayout">Shape | Size | Layout Support</auro-header>
23
+ <p>The <code>auro-menu</code> component supports the <code>shape</code> and <code>size</code> feature set. The component defaults to <code>shape="box"</code> and <code>size="sm"</code>. The <code>layout</code> attribute is not supported by this component.</p>
24
+ <auro-header level="3" id="size">Size</auro-header>
25
+ <p>Use the <code>size</code> attribute to change the size of menu options. Supported values are <code>sm</code> (default) and <code>md</code>.</p>
26
+ <div class="exampleWrapper">
27
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/size.html) -->
28
+ <!-- The below content is automatically added from ./../apiExamples/size.html -->
29
+ <auro-menu size="md">
30
+ <auro-menuoption value="stops">Stops</auro-menuoption>
31
+ <auro-menuoption value="price">Price</auro-menuoption>
32
+ <auro-menuoption value="duration">Duration</auro-menuoption>
33
+ <auro-menuoption value="departure">Departure</auro-menuoption>
34
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
35
+ </auro-menu>
36
+ <!-- AURO-GENERATED-CONTENT:END -->
37
+ </div>
38
+ <auro-accordion alignRight>
39
+ <span slot="trigger">See code</span>
40
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/size.html) -->
41
+ <!-- The below code snippet is automatically added from ./../apiExamples/size.html -->
42
+ <pre class="language-html"><code class="language-html">&lt;auro-menu size="md"&gt;
43
+ &lt;auro-menuoption value="stops"&gt;Stops&lt;/auro-menuoption&gt;
44
+ &lt;auro-menuoption value="price"&gt;Price&lt;/auro-menuoption&gt;
45
+ &lt;auro-menuoption value="duration"&gt;Duration&lt;/auro-menuoption&gt;
46
+ &lt;auro-menuoption value="departure"&gt;Departure&lt;/auro-menuoption&gt;
47
+ &lt;auro-menuoption value="arrival"&gt;Arrival&lt;/auro-menuoption&gt;
48
+ &lt;/auro-menu&gt;</code></pre>
49
+ <!-- AURO-GENERATED-CONTENT:END -->
50
+ </auro-accordion>
51
+ <auro-header level="3" id="shape">Shape</auro-header>
52
+ <p>Use the <code>shape</code> attribute to change the shape of menu options. Supported values are <code>box</code> (default) and <code>round</code>.</p>
53
+ <div class="exampleWrapper">
54
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/shape.html) -->
55
+ <!-- The below content is automatically added from ./../apiExamples/shape.html -->
56
+ <auro-menu shape="round">
57
+ <auro-menuoption value="stops">Stops</auro-menuoption>
58
+ <auro-menuoption value="price">Price</auro-menuoption>
59
+ <auro-menuoption value="duration">Duration</auro-menuoption>
60
+ <auro-menuoption value="departure">Departure</auro-menuoption>
61
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
62
+ </auro-menu>
63
+ <!-- AURO-GENERATED-CONTENT:END -->
64
+ </div>
65
+ <auro-accordion alignRight>
66
+ <span slot="trigger">See code</span>
67
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/shape.html) -->
68
+ <!-- The below code snippet is automatically added from ./../apiExamples/shape.html -->
69
+ <pre class="language-html"><code class="language-html">&lt;auro-menu shape="round"&gt;
70
+ &lt;auro-menuoption value="stops"&gt;Stops&lt;/auro-menuoption&gt;
71
+ &lt;auro-menuoption value="price"&gt;Price&lt;/auro-menuoption&gt;
72
+ &lt;auro-menuoption value="duration"&gt;Duration&lt;/auro-menuoption&gt;
73
+ &lt;auro-menuoption value="departure"&gt;Departure&lt;/auro-menuoption&gt;
74
+ &lt;auro-menuoption value="arrival"&gt;Arrival&lt;/auro-menuoption&gt;
75
+ &lt;/auro-menu&gt;</code></pre>
76
+ <!-- AURO-GENERATED-CONTENT:END -->
77
+ </auro-accordion>
78
+ </section>
79
+ </div>
80
+ </div>
81
+ </div>
@@ -0,0 +1,54 @@
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
+ 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-menu | Getting Started</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-menu'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('./getting-started.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-nav@latest/+esm" type="module"></script>
48
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
49
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
50
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
51
+
52
+ <script src="./index.min.js" data-demo-script="true" type="module"></script>
53
+ </body>
54
+ </html>
@@ -0,0 +1,169 @@
1
+ <auro-header level="1" id="overview">Menu - 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="#recommendedAccordion" class="level2 body-xs" onclick="openAccordion('recommendedAccordion')">Recommended</auro-anchorlink>
9
+ <auro-anchorlink fluid href="#autoAccordion" class="level2 body-xs" onclick="openAccordion('autoAccordion')">Auto</auro-anchorlink>
10
+ <auro-anchorlink fluid href="#cdnAccordion" class="level2 body-xs" onclick="openAccordion('cdnAccordion')">CDN</auro-anchorlink>
11
+ <auro-anchorlink fluid href="#minimalConfig">Minimal Configuration</auro-anchorlink>
12
+ <auro-anchorlink fluid href="#slots">Slots</auro-anchorlink>
13
+ <auro-anchorlink fluid href="#slotDefault" class="level2 body-xs">Default Slot</auro-anchorlink>
14
+ <auro-anchorlink fluid href="#stateManagement">State Management</auro-anchorlink>
15
+ <auro-anchorlink fluid href="#value" class="level2 body-xs">value</auro-anchorlink>
16
+ <auro-anchorlink fluid href="#optionSelected" class="level2 body-xs">optionSelected</auro-anchorlink>
17
+ <auro-anchorlink fluid href="#optionActive" class="level2 body-xs">optionActive</auro-anchorlink>
18
+ <auro-anchorlink fluid href="#currentLabel" class="level2 body-xs">currentLabel</auro-anchorlink>
19
+ <auro-anchorlink fluid href="#options" class="level2 body-xs">options</auro-anchorlink>
20
+ <auro-anchorlink fluid href="#index" class="level2 body-xs">index</auro-anchorlink>
21
+ <auro-anchorlink fluid href="#functions">Functions</auro-anchorlink>
22
+ <auro-anchorlink fluid href="#makeSelection" class="level2 body-xs">makeSelection()</auro-anchorlink>
23
+ <auro-anchorlink fluid href="#reset" class="level2 body-xs">reset()</auro-anchorlink>
24
+ <auro-anchorlink fluid href="#updateActiveOption" class="level2 body-xs">updateActiveOption()</auro-anchorlink>
25
+ <auro-anchorlink fluid href="#navigateOptions" class="level2 body-xs">navigateOptions()</auro-anchorlink>
26
+ </auro-nav>
27
+ </nav>
28
+ <div class="mainContent">
29
+ <div class="scrollWrapper">
30
+ <section>
31
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/install.md) -->
32
+ <!-- The below content is automatically added from ./../docs/partials/getting-started/install.md -->
33
+ <auro-header level="2" id="setup">Setup</auro-header>
34
+ <auro-accordion-group Emphasis>
35
+ <auro-accordion expanded class="section" id="recommendedAccordion">
36
+ <span slot="trigger">Recommended Installation and Implementation</span>
37
+ <div class="accordion-content">
38
+ <auro-header level="3">Install</auro-header>
39
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../../docs/templates/componentInstall.md) -->
40
+ <!-- The below content is automatically added from ./../../../docs/templates/componentInstall.md -->
41
+
42
+ <pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-formkit</code></pre>
43
+ <!-- AURO-GENERATED-CONTENT:END -->
44
+ <auro-header level="3">Implementation</auro-header>
45
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/customRegistration.md) -->
46
+ <!-- The below content is automatically added from ./../docs/partials/customRegistration.md -->
47
+ There are two key parts to every Auro component: the <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes" target="_blank">class</auro-hyperlink> 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 `register(name)` method with a unique name:
50
+
51
+ <pre class="language-js"><code class="language-js">// Import the class only
52
+ import { AuroMenu, AuroMenuOption } from '@aurodesignsystem/auro-formkit/auro-menu/class';
53
+
54
+ // Register with a custom name if desired
55
+ AuroMenu.register('[custom]-menu');
56
+ AuroMenuOption.register('[custom]-menu-option');</code></pre>
57
+
58
+ This will create a new custom element `<custom-menu>` and `<custom-menu-option>` that behaves exactly like `<auro-menu>` and `<auro-menu-option>`, allowing both to coexist on the same page without interfering with each other.
59
+
60
+ <pre class="language-html"><code class="language-html">&lt;custom-menu&gt;
61
+ &lt;custom-menuoption value="stops"&gt;Stops&lt;/custom-menuoption&gt;
62
+ &lt;custom-menuoption value="price"&gt;Price&lt;/custom-menuoption&gt;
63
+ &lt;custom-menuoption value="duration"&gt;Duration&lt;/custom-menuoption&gt;
64
+ &lt;custom-menuoption value="departure"&gt;Departure&lt;/custom-menuoption&gt;
65
+ &lt;custom-menuoption value="arrival"&gt;Arrival&lt;/custom-menuoption&gt;
66
+ &lt;/custom-menu&gt;</code></pre>
67
+ <!-- AURO-GENERATED-CONTENT:END -->
68
+ </div>
69
+ </auro-accordion>
70
+ <auro-accordion class="section" id="autoAccordion">
71
+ <span slot="trigger">Auto Installation and Implementation</span>
72
+ <div class="accordion-content">
73
+ <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>
74
+ <auro-header level="3">Install</auro-header>
75
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../../docs/templates/componentInstall.md) -->
76
+ <!-- The below content is automatically added from ./../../../docs/templates/componentInstall.md -->
77
+
78
+ <pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-formkit</code></pre>
79
+ <!-- AURO-GENERATED-CONTENT:END -->
80
+ <auro-header level="3">Implementation</auro-header>
81
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/defaultRegistration.md) -->
82
+ <!-- The below content is automatically added from ./../docs/partials/getting-started/defaultRegistration.md -->
83
+ Import the component, then register the custom element:
84
+
85
+ <pre class="language-js"><code class="language-js">import '@aurodesignsystem/auro-formkit/auro-menu';</code></pre>
86
+
87
+ Then use the element in your HTML:
88
+
89
+ <pre class="language-html"><code class="language-html">&lt;auro-menu&gt;
90
+ &lt;auro-menuoption value="option1"&gt;Option 1&lt;/auro-menuoption&gt;
91
+ &lt;auro-menuoption value="option2"&gt;Option 2&lt;/auro-menuoption&gt;
92
+ &lt;auro-menuoption value="option3"&gt;Option 3&lt;/auro-menuoption&gt;
93
+ &lt;/auro-menu&gt;</code></pre>
94
+ <!-- AURO-GENERATED-CONTENT:END -->
95
+ </div>
96
+ </auro-accordion>
97
+ <auro-accordion class="section" id="cdnAccordion">
98
+ <span slot="trigger">CDN Installation</span>
99
+ <div class="accordion-content">
100
+ <p class="warning"><strong>Warning:</strong> CDN 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>
101
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/cdnRegistration.md) -->
102
+ <!-- The below content is automatically added from ./../docs/partials/getting-started/cdnRegistration.md -->
103
+ The menu component can be loaded via CDN without a build step:
104
+
105
+ <pre class="language-html"><code class="language-html">&lt;script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-menu/+esm" type="module"&gt;&lt;/script&gt;</code></pre>
106
+
107
+ Then use the element in your HTML:
108
+
109
+ <pre class="language-html"><code class="language-html">&lt;auro-menu&gt;
110
+ &lt;auro-menuoption value="option1"&gt;Option 1&lt;/auro-menuoption&gt;
111
+ &lt;auro-menuoption value="option2"&gt;Option 2&lt;/auro-menuoption&gt;
112
+ &lt;auro-menuoption value="option3"&gt;Option 3&lt;/auro-menuoption&gt;
113
+ &lt;/auro-menu&gt;</code></pre>
114
+ <!-- AURO-GENERATED-CONTENT:END -->
115
+ </div>
116
+ </auro-accordion>
117
+ </auro-accordion-group>
118
+ <!-- AURO-GENERATED-CONTENT:END -->
119
+ </section>
120
+ <section>
121
+ <auro-header level="2" id="minimalConfig">Minimal Configuration</auro-header>
122
+ <p>The most basic use of <code>&lt;auro-menu&gt;</code> is a list of <code>&lt;auro-menuoption&gt;</code> elements in the default slot. Each option should have a <code>&lt;value&gt;</code> attribute.</p>
123
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
124
+ <!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
125
+ <pre class="language-html"><code class="language-html">&lt;auro-menu&gt;
126
+ &lt;auro-menuoption value="stops"&gt;Stops&lt;/auro-menuoption&gt;
127
+ &lt;auro-menuoption value="price"&gt;Price&lt;/auro-menuoption&gt;
128
+ &lt;auro-menuoption value="duration"&gt;Duration&lt;/auro-menuoption&gt;
129
+ &lt;auro-menuoption value="departure"&gt;Departure&lt;/auro-menuoption&gt;
130
+ &lt;auro-menuoption value="arrival"&gt;Arrival&lt;/auro-menuoption&gt;
131
+ &lt;/auro-menu&gt;</code></pre>
132
+ <!-- AURO-GENERATED-CONTENT:END -->
133
+ </section>
134
+ <section>
135
+ <auro-header level="2" id="slots">Slots</auro-header>
136
+ <auro-header level="3" id="slotDefault">Default Slot</auro-header>
137
+ <p>The default slot accepts <code>auro-menuoption</code> elements and <code>&lt;hr&gt;</code> elements as dividers. You can also nest additional <code>&lt;auro-menu&gt;</code> elements within the default slot.</p>
138
+ </section>
139
+ <section>
140
+ <auro-header level="2" id="stateManagement">State Management</auro-header>
141
+ <p>The following properties reflect the current state of the menu and can be accessed via JavaScript.</p>
142
+ <auro-header level="3" id="value">value</auro-header>
143
+ <p>Gets or sets the selected value. In multi-select mode, this is a JSON stringified array of selected option values (e.g., <code>'["stops","duration"]'</code>).</p>
144
+ <auro-header level="3" id="optionSelected">optionSelected</auro-header>
145
+ <p>Returns the currently selected <code>&lt;auro-menuoption&gt;</code> element, or <code>undefined</code> if no option is selected. When <code>multiSelect</code> is enabled, returns an array of selected elements.</p>
146
+ <auro-header level="3" id="optionActive">optionActive</auro-header>
147
+ <p>Returns the currently active (focused) <code>&lt;auro-menuoption&gt;</code> element. The active option receives visual focus during keyboard navigation.</p>
148
+ <auro-header level="3" id="currentLabel">currentLabel</auro-header>
149
+ <p>Returns the display label of the currently selected option(s). Useful for rendering a summary of the selection outside the menu.</p>
150
+ <auro-header level="3" id="options">options</auro-header>
151
+ <p>Returns a read-only array of available <code>&lt;auro-menuoption&gt;</code> elements currently in the menu.</p>
152
+ <auro-header level="3" id="index">index</auro-header>
153
+ <p>Gets or sets the index of the currently highlighted option. Setting this value programmatically moves the visual focus indicator.</p>
154
+ </section>
155
+ <section>
156
+ <auro-header level="2" id="functions">Functions</auro-header>
157
+ <p>The following public methods are available on the <code>&lt;auro-menu&gt;</code> element.</p>
158
+ <auro-header level="3" id="makeSelection">makeSelection()</auro-header>
159
+ <p>Selects the currently active menu option. This is the programmatic equivalent of clicking on an option or pressing Enter while an option is focused.</p>
160
+ <auro-header level="3" id="reset">reset()</auro-header>
161
+ <p>Resets the menu to its initial state, clearing all selected options and restoring the value to <code>undefined</code>.</p>
162
+ <auro-header level="3" id="updateActiveOption">updateActiveOption(option)</auro-header>
163
+ <p>Sets the specified <code>&lt;auro-menuoption&gt;</code> element as the currently active (highlighted) option.</p>
164
+ <auro-header level="3" id="navigateOptions">navigateOptions(direction)</auro-header>
165
+ <p>Moves the highlight to the next or previous option. Accepts <code>'up'</code> or <code>'down'</code> as the direction parameter.</p>
166
+ </section>
167
+ </div>
168
+ </div>
169
+ </div>
@@ -3,7 +3,7 @@
3
3
  See LICENSE in the project root for license information.
4
4
 
5
5
  HTML in this document is standardized and NOT to be edited.
6
- All demo code should be added/edited in ./demo/demo.md
6
+ All demo code should be added/edited in ./demo/index.md
7
7
 
8
8
  With the exception of adding custom elements if needed for the demo.
9
9
 
@@ -18,8 +18,8 @@
18
18
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
19
19
  <title>Auro Web Component Demo | auro-menu</title>
20
20
 
21
- <!-- Prism.js Stylesheet -->
22
- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
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
23
 
24
24
  <!-- Legacy reference is still needed to support auro-menu's use of legacy token values at this time -->
25
25
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
@@ -32,28 +32,23 @@
32
32
 
33
33
  <!-- Demo Specific Styles -->
34
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="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
36
- </head>
35
+ <link rel="stylesheet" type="text/css" href="./styles.css" />
36
+ </head>
37
37
  <body class="auro-markdown">
38
38
  <main></main>
39
39
 
40
40
  <script type="module">
41
- import 'https://cdn.jsdelivr.net/npm/marked@latest/marked.min.js';
42
- import 'https://cdn.jsdelivr.net/npm/prismjs@latest/prism.js';
43
- fetch('./index.md')
44
- .then((response) => response.text())
45
- .then((text) => {
46
- const rawHtml = marked.parse(text);
47
- document.querySelector('main').innerHTML = rawHtml;
48
- Prism.highlightAll();
49
- });
41
+ import { renderPage } from './demo-support.js';
42
+ await renderPage('./index.md');
50
43
  </script>
51
44
 
45
+ <!-- If additional elements are needed for the demo, add them here. -->
52
46
  <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
53
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
54
- <script type="module" data-demo-script="true">
55
- import { initExamples } from "./index.min.js"
56
- initExamples();
57
- </script>
47
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-nav@latest/+esm" type="module"></script>
48
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
49
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
50
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
51
+
52
+ <script src="./index.min.js" data-demo-script="true" type="module"></script>
58
53
  </body>
59
54
  </html>
@@ -1,70 +1,33 @@
1
- <!--
2
- THIS PAGE'S CONTENT SHOULD BE KEPT MINIMAL.
3
- ONLY ADD EXAMPLES THAT ARE TRULY NECESSARY FOR THE INDEX PAGE — THE BASIC EXAMPLE IS USUALLY ENOUGH.
4
- ALL OTHER EXAMPLES SHOULD GO IN THE API DOCUMENTATION.
5
- -->
6
-
7
- # Menu
8
-
1
+ <auro-header level="1" id="overview">Menu</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="#description">Description</auro-anchorlink>
8
+ <auro-anchorlink fluid href="#useCases">User Stories</auro-anchorlink>
9
+ </auro-nav>
10
+ </nav>
11
+ <div class="mainContent">
12
+ <div class="scrollWrapper">
13
+ <section>
14
+ <auro-header level="2" id="description">Description</auro-header>
9
15
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
10
16
  <!-- The below content is automatically added from ./../docs/partials/description.md -->
11
- The `<auro-menu>` element provides a list of options for a user to select from.
12
-
13
- A list of options is created within the `<slot>` of the `<auro-menu>` element by using the `<auro-menuoption>` element to define options. Use a standard `<hr>` element to create dividers within the list of options.
14
-
15
- The `<auro-menu>` element is designed for contextual menus, e.g. a dropdown menus. They are not intended to be used for navigation menus which have a different semantic meaning. The `<auro-menu>` element does not support hide/show functionality within its scope. This functionality will be managed by a wrapping element such as a drop-down menu composite element.
16
- <!-- AURO-GENERATED-CONTENT:END -->
17
+ The <code>&lt;auro-menu&gt;</code> element provides a list of options for a user to select from.
17
18
 
18
- ## Use Cases
19
+ A list of options is created within the <code>&lt;slot&gt;</code> of the <code>&lt;auro-menu&gt;</code> element by using the <code>&lt;auro-menuoption&gt;</code> element to define options. Use a standard <code>&lt;hr&gt;</code> element to create dividers within the list of options.
19
20
 
21
+ The <code>&lt;auro-menu&gt;</code> element is designed for contextual menus, e.g. a dropdown menus. They are not intended to be used for navigation menus which have a different semantic meaning. The <code>&lt;auro-menu&gt;</code> element does not support hide/show functionality within its scope. This functionality will be managed by a wrapping element such as a drop-down menu composite element.
22
+ <!-- AURO-GENERATED-CONTENT:END -->
23
+ </section>
24
+ <section>
25
+ <auro-header level="2" id="useCases">User Stories</auro-header>
20
26
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/useCases.md) -->
21
27
  <!-- The below content is automatically added from ./../docs/partials/useCases.md -->
22
- The <code>&lt;auro-menu&gt;</code> element should be used in situations where users may:
23
-
24
- * A user needs to select one option from a list of options.
25
- <!-- AURO-GENERATED-CONTENT:END -->
26
-
27
- ## Example(s)
28
-
29
- ### Basic
30
-
31
- <div class="exampleWrapper">
32
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/preselect.html) -->
33
- <!-- The below content is automatically added from ./../apiExamples/preselect.html -->
34
- <auro-menu>
35
- <auro-menuoption value="new tab">New tab</auro-menuoption>
36
- <auro-menuoption value="new window" selected>New window</auro-menuoption>
37
- <auro-menuoption value="open file">Open file</auro-menuoption>
38
- <auro-menuoption value="open location">Open location</auro-menuoption>
39
- <hr>
40
- <auro-menuoption value="close window">Close window</auro-menuoption>
41
- <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
42
- <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
43
- <hr>
44
- <auro-menuoption value="share" disabled>Share</auro-menuoption>
45
- <hr>
46
- <auro-menuoption value="print">Print</auro-menuoption>
47
- </auro-menu>
28
+ The <code>&lt;auro-menu&gt;</code> element is not intended for stand-alone use. It serves as the options list within <auro-hyperlink href="https://auro.alaskaair.com/components/auro/select" target="_blank">auro-select</auro-hyperlink> and <auro-hyperlink href="https://auro.alaskaair.com/components/auro/combobox" target="_blank">auro-combobox</auro-hyperlink>. Refer to those components for use cases and implementation guidance.
48
29
  <!-- AURO-GENERATED-CONTENT:END -->
49
- </div>
50
- <auro-accordion alignRight>
51
- <span slot="trigger">See code</span>
52
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/preselect.html) -->
53
- <!-- The below code snippet is automatically added from ./../apiExamples/preselect.html -->
54
-
55
- <pre class="language-html"><code class="language-html">&lt;auro-menu&gt;
56
- &lt;auro-menuoption value="new tab"&gt;New tab&lt;/auro-menuoption&gt;
57
- &lt;auro-menuoption value="new window" selected&gt;New window&lt;/auro-menuoption&gt;
58
- &lt;auro-menuoption value="open file"&gt;Open file&lt;/auro-menuoption&gt;
59
- &lt;auro-menuoption value="open location"&gt;Open location&lt;/auro-menuoption&gt;
60
- &lt;hr&gt;
61
- &lt;auro-menuoption value="close window"&gt;Close window&lt;/auro-menuoption&gt;
62
- &lt;auro-menuoption value="close tab" disabled&gt;Close tab&lt;/auro-menuoption&gt;
63
- &lt;auro-menuoption value="save page as..."&gt;Save page as...&lt;/auro-menuoption&gt;
64
- &lt;hr&gt;
65
- &lt;auro-menuoption value="share" disabled&gt;Share&lt;/auro-menuoption&gt;
66
- &lt;hr&gt;
67
- &lt;auro-menuoption value="print"&gt;Print&lt;/auro-menuoption&gt;
68
- &lt;/auro-menu&gt;</code></pre>
69
- <!-- AURO-GENERATED-CONTENT:END -->
70
- </auro-accordion>
30
+ </section>
31
+ </div>
32
+ </div>
33
+ </div>