@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,312 @@
|
|
|
1
|
+
<auro-header level="1" id="overview">Input - 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="#frameworks">Frameworks</auro-anchorlink>
|
|
12
|
+
<auro-anchorlink fluid href="#react" class="level2 body-xs" onclick="openAccordion('react')">React</auro-anchorlink>
|
|
13
|
+
<auro-anchorlink fluid href="#svelte" class="level2 body-xs" onclick="openAccordion('svelte')">Svelte</auro-anchorlink>
|
|
14
|
+
<auro-anchorlink fluid href="#minimalConfig">Minimal Config</auro-anchorlink>
|
|
15
|
+
<auro-anchorlink fluid href="#slots">Slots</auro-anchorlink>
|
|
16
|
+
<auro-anchorlink fluid href="#slot-label" class="level2 body-xs">label</auro-anchorlink>
|
|
17
|
+
<auro-anchorlink fluid href="#slot-helpText" class="level2 body-xs">helpText</auro-anchorlink>
|
|
18
|
+
<auro-anchorlink fluid href="#slot-optionalLabel" class="level2 body-xs">optionalLabel</auro-anchorlink>
|
|
19
|
+
<auro-anchorlink fluid href="#slot-displayValue" class="level2 body-xs">displayValue</auro-anchorlink>
|
|
20
|
+
<auro-anchorlink fluid href="#slot-ariaLabel-clear" class="level2 body-xs">ariaLabel.clear</auro-anchorlink>
|
|
21
|
+
<auro-anchorlink fluid href="#slot-ariaLabel-password-show" class="level2 body-xs">ariaLabel.password.show</auro-anchorlink>
|
|
22
|
+
<auro-anchorlink fluid href="#slot-ariaLabel-password-hide" class="level2 body-xs">ariaLabel.password.hide</auro-anchorlink>
|
|
23
|
+
<auro-anchorlink fluid href="#stateManagement">State Management</auro-anchorlink>
|
|
24
|
+
<auro-anchorlink fluid href="#hasFocus" class="level2 body-xs">hasFocus</auro-anchorlink>
|
|
25
|
+
<auro-anchorlink fluid href="#hasValue" class="level2 body-xs">hasValue</auro-anchorlink>
|
|
26
|
+
<auro-anchorlink fluid href="#validity" class="level2 body-xs">Validity</auro-anchorlink>
|
|
27
|
+
<auro-anchorlink fluid href="#value" class="level2 body-xs">Value</auro-anchorlink>
|
|
28
|
+
<auro-anchorlink fluid href="#publicFunctions">Functions</auro-anchorlink>
|
|
29
|
+
<auro-anchorlink fluid href="#clear" class="level2 body-xs">clear()</auro-anchorlink>
|
|
30
|
+
<auro-anchorlink fluid href="#focus" class="level2 body-xs">focus()</auro-anchorlink>
|
|
31
|
+
<auro-anchorlink fluid href="#reset" class="level2 body-xs">reset()</auro-anchorlink>
|
|
32
|
+
<auro-anchorlink fluid href="#validate" class="level2 body-xs">validate()</auro-anchorlink>
|
|
33
|
+
</auro-nav>
|
|
34
|
+
</nav>
|
|
35
|
+
<div class="mainContent">
|
|
36
|
+
<div class="scrollWrapper">
|
|
37
|
+
<section>
|
|
38
|
+
<auro-header level="2" id="setup">Setup</auro-header>
|
|
39
|
+
<auro-accordion-group Emphasis>
|
|
40
|
+
<auro-accordion expanded class="section" id="recommendedAccordion">
|
|
41
|
+
<span slot="trigger">Recommended Installation and Implementation</span>
|
|
42
|
+
<div class="accordion-content">
|
|
43
|
+
<auro-header level="3">Install</auro-header>
|
|
44
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../../docs/templates/componentInstall.md) -->
|
|
45
|
+
<!-- The below content is automatically added from ./../../../docs/templates/componentInstall.md -->
|
|
46
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-formkit</code></pre>
|
|
47
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
48
|
+
<auro-header level="3">Implementation</auro-header>
|
|
49
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/customRegistration.md) -->
|
|
50
|
+
<!-- The below content is automatically added from ./../docs/partials/customRegistration.md -->
|
|
51
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../../docs/partials/customRegistrationDescription.md) -->
|
|
52
|
+
<!-- The below content is automatically added from ./../../../docs/partials/customRegistrationDescription.md -->
|
|
53
|
+
<p>Every Auro component consists of a JavaScript <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and a <a href="https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define">custom element registration</a>. The class defines the component's behavior, and the registration maps it to an HTML tag name so it can be used in markup.</p>
|
|
54
|
+
<p>The default import (shown above) handles both steps automatically, registering the component under its standard tag name.</p>
|
|
55
|
+
<p>If you need multiple versions of the same component on a single page — for example, when two projects depend on different versions — you can register the class under a custom tag name to avoid conflicts.</p>
|
|
56
|
+
<p>To do this, import the component class directly and call its <code>register(name)</code> method with a unique name:</p>
|
|
57
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
58
|
+
<pre class="language-js"><code class="language-js">// Import the class only
|
|
59
|
+
import { AuroInput } from '@aurodesignsystem/auro-formkit/auro-input/class';
|
|
60
|
+
|
|
61
|
+
// Register with a custom name if desired
|
|
62
|
+
AuroInput.register('[custom]-input');</code></pre>
|
|
63
|
+
|
|
64
|
+
<p>This will create a new custom element <code><custom-input></code> that behaves exactly like <code><auro-input></code>, allowing both to coexist on the same page without interfering with each other.</p>
|
|
65
|
+
<pre class="language-html"><code class="language-html"><custom-input>
|
|
66
|
+
<span slot="label">Label</span>
|
|
67
|
+
<span slot="helpText">Help Text</span>
|
|
68
|
+
</custom-input></code></pre>
|
|
69
|
+
</auro-accordion>
|
|
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
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-formkit</code></pre>
|
|
81
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
82
|
+
<auro-header level="3">Implementation</auro-header>
|
|
83
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/defaultRegistration.md) -->
|
|
84
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/defaultRegistration.md -->
|
|
85
|
+
<p>Once installed, the component can be used in your project by importing the component's registered module:</p>
|
|
86
|
+
<pre class="language-js"><code class="language-js">import '@aurodesignsystem/auro-formkit/auro-input';</code></pre>
|
|
87
|
+
<p>This import registers the <code><auro-input></code> custom element globally. You can then use it in your HTML:</p>
|
|
88
|
+
<pre class="language-html"><code class="language-html"><auro-input>
|
|
89
|
+
<span slot="label">Enter your name</span>
|
|
90
|
+
</auro-input></code></pre>
|
|
91
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
92
|
+
</div>
|
|
93
|
+
</auro-accordion>
|
|
94
|
+
<auro-accordion class="section" id="cdnAccordion">
|
|
95
|
+
<span slot="trigger">CDN Installation and Implementation</span>
|
|
96
|
+
<div class="accordion-content">
|
|
97
|
+
<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>
|
|
98
|
+
<auro-header level="3">Install & Implementation</auro-header>
|
|
99
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/cdnRegistration.md) -->
|
|
100
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/cdnRegistration.md -->
|
|
101
|
+
<p>Add the following script tag to your HTML to load the component directly from a CDN:</p>
|
|
102
|
+
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-input/+esm"></script></code></pre>
|
|
103
|
+
<p>This script registers the <code><auro-input></code> custom element globally. You can then use it in your HTML:</p>
|
|
104
|
+
<pre class="language-html"><code class="language-html"><auro-input>
|
|
105
|
+
<span slot="label">Enter your name</span>
|
|
106
|
+
</auro-input></code></pre>
|
|
107
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
108
|
+
</div>
|
|
109
|
+
</auro-accordion>
|
|
110
|
+
</auro-accordion-group>
|
|
111
|
+
</section>
|
|
112
|
+
<section>
|
|
113
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/frameworks.md) -->
|
|
114
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/frameworks.md -->
|
|
115
|
+
<auro-header level="2" id="frameworks">Frameworks</auro-header>
|
|
116
|
+
<auro-accordion-group Emphasis>
|
|
117
|
+
<auro-accordion class="section" id="react">
|
|
118
|
+
<span slot="trigger">React</span>
|
|
119
|
+
<div class="accordion-content">
|
|
120
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/react.md) -->
|
|
121
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/react.md -->
|
|
122
|
+
React 19 includes <a href="https://react.dev/blog/2024/12/05/react-19#support-for-custom-elements">native support for custom elements</a>, so <code><auro-input></code> works directly in JSX without any wrapper library.
|
|
123
|
+
|
|
124
|
+
<auro-header level="3" id="reactImport">Import the Component</auro-header>
|
|
125
|
+
Import and register the components at the top level of your application (e.g. in your root `main.tsx` or `App.tsx`):
|
|
126
|
+
|
|
127
|
+
<pre class="language-js"><code class="language-js">import { AuroInput } from '@aurodesignsystem/auro-formkit/auro-input/class';
|
|
128
|
+
|
|
129
|
+
AuroInput.register('[custom]-input');</code></pre>
|
|
130
|
+
|
|
131
|
+
<auro-header level="3" id="reactTypeScript">TypeScript Declarations</auro-header>
|
|
132
|
+
The component ships with TypeScript type definitions for the `AuroInput` class. However, React's JSX does not automatically map custom element tag names to their types. To get type checking for `<auro-input>` in JSX, add the following declaration to a `.d.ts` file in your project:
|
|
133
|
+
|
|
134
|
+
<pre class="language-js"><code class="language-js">import type { AuroInput } from '@aurodesignsystem/auro-formkit/auro-input/class';
|
|
135
|
+
|
|
136
|
+
declare global {
|
|
137
|
+
namespace JSX {
|
|
138
|
+
interface IntrinsicElements {
|
|
139
|
+
'[custom]-input': React.HTMLAttributes<AuroInput> & Partial<AuroInput>;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}</code></pre>
|
|
143
|
+
|
|
144
|
+
<auro-header level="3" id="reactEvents">Event Handling</auro-header>
|
|
145
|
+
Auro components emit native `CustomEvent`s. Use a `ref` to attach event listeners in a `useEffect`:
|
|
146
|
+
|
|
147
|
+
<pre class="language-js"><code class="language-js">import { useRef, useEffect } from 'react';
|
|
148
|
+
|
|
149
|
+
function MyInput() {
|
|
150
|
+
const inputRef = useRef<HTMLElement>(null);
|
|
151
|
+
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
const el = inputRef.current;
|
|
154
|
+
if (!el) return;
|
|
155
|
+
|
|
156
|
+
const handleInput = () => {
|
|
157
|
+
console.log('Current value:', (el as any).value);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
el.addEventListener('input', handleInput);
|
|
161
|
+
return () => el.removeEventListener('input', handleInput);
|
|
162
|
+
}, []);
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<custom-input ref={inputRef}>
|
|
166
|
+
<span slot="label">Enter your name</span>
|
|
167
|
+
</custom-input>
|
|
168
|
+
);
|
|
169
|
+
}</code></pre>
|
|
170
|
+
|
|
171
|
+
<auro-header level="3" id="reactModuleResolution">Module Resolution</auro-header>
|
|
172
|
+
Ensure your `tsconfig.json` uses `"moduleResolution": "bundler"` so TypeScript can resolve the component's package exports:
|
|
173
|
+
|
|
174
|
+
<pre class="language-js"><code class="language-js">{
|
|
175
|
+
"compilerOptions": {
|
|
176
|
+
"moduleResolution": "bundler"
|
|
177
|
+
}
|
|
178
|
+
}</code></pre>
|
|
179
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
180
|
+
</div>
|
|
181
|
+
</auro-accordion>
|
|
182
|
+
<auro-accordion class="section" id="svelte">
|
|
183
|
+
<span slot="trigger">Svelte</span>
|
|
184
|
+
<div class="accordion-content">
|
|
185
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/svelte.md) -->
|
|
186
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/svelte.md -->
|
|
187
|
+
Svelte has <a href="https://svelte.dev/docs/svelte/custom-elements">native support for custom elements</a>, so <code><auro-input></code> works directly in Svelte templates without any wrapper or configuration.
|
|
188
|
+
|
|
189
|
+
<auro-header level="3" id="svelteImport">Import the Component</auro-header>
|
|
190
|
+
Import and register the components in the `<script>` block:
|
|
191
|
+
|
|
192
|
+
<pre class="language-html"><code class="language-html"><script lang="ts">
|
|
193
|
+
import { AuroInput } from '@aurodesignsystem/auro-formkit/auro-input/class';
|
|
194
|
+
|
|
195
|
+
AuroInput.register('[custom]-input');
|
|
196
|
+
</script></code></pre>
|
|
197
|
+
|
|
198
|
+
<auro-header level="3" id="svelteUsage">Basic Usage</auro-header>
|
|
199
|
+
Use `<auro-input>` directly in your Svelte template. Properties can be bound using standard Svelte attribute syntax:
|
|
200
|
+
|
|
201
|
+
<pre class="language-html"><code class="language-html"><script lang="ts">
|
|
202
|
+
import { AuroInput } from '@aurodesignsystem/auro-formkit/auro-input/class';
|
|
203
|
+
|
|
204
|
+
AuroInput.register('[custom]-input');
|
|
205
|
+
|
|
206
|
+
let inputValue = $state<string>('');
|
|
207
|
+
</script>
|
|
208
|
+
<custom-input value={inputValue}>
|
|
209
|
+
<span slot="label">Enter your name</span>
|
|
210
|
+
</custom-input></code></pre>
|
|
211
|
+
|
|
212
|
+
<auro-header level="3" id="svelteTypeScript">TypeScript Declarations</auro-header>
|
|
213
|
+
Svelte does not automatically know about custom element attributes. To get autocomplete and type checking for `<auro-input>` props in templates, add the following to a `.d.ts` file in your project (e.g. `src/auro-elements.d.ts`):
|
|
214
|
+
|
|
215
|
+
<pre class="language-js"><code class="language-js">import type { AuroInput } from '@aurodesignsystem/auro-formkit/auro-input/class';
|
|
216
|
+
|
|
217
|
+
declare namespace svelteHTML {
|
|
218
|
+
interface IntrinsicElements {
|
|
219
|
+
'[custom]-input': Partial<AuroInput> & svelteHTML.HTMLAttributes<AuroInput>;
|
|
220
|
+
}
|
|
221
|
+
}</code></pre>
|
|
222
|
+
|
|
223
|
+
This enables prop hinting for attributes like `value`, `disabled`, and others directly in Svelte templates.
|
|
224
|
+
|
|
225
|
+
<auro-header level="3" id="svelteEvents">Event Handling</auro-header>
|
|
226
|
+
Auro components emit native `CustomEvent`s. Use the `oninput` handler directly on the element:
|
|
227
|
+
|
|
228
|
+
<pre class="language-html"><code class="language-html"><script lang="ts">
|
|
229
|
+
let value = $state('');
|
|
230
|
+
|
|
231
|
+
function handleInput(e: Event) {
|
|
232
|
+
value = (e.target as HTMLElement & { value: string }).value;
|
|
233
|
+
}
|
|
234
|
+
</script>
|
|
235
|
+
<custom-input oninput={handleInput}>
|
|
236
|
+
<span slot="label">Enter your name</span>
|
|
237
|
+
</custom-input>
|
|
238
|
+
<p>Current value: {value}</p></code></pre>
|
|
239
|
+
|
|
240
|
+
<auro-header level="3" id="svelteModuleResolution">Module Resolution</auro-header>
|
|
241
|
+
Ensure your `tsconfig.json` uses `"moduleResolution": "bundler"` so TypeScript can resolve the component's package exports:
|
|
242
|
+
|
|
243
|
+
<pre class="language-js"><code class="language-js">{
|
|
244
|
+
"compilerOptions": {
|
|
245
|
+
"moduleResolution": "bundler"
|
|
246
|
+
}
|
|
247
|
+
}</code></pre>
|
|
248
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
249
|
+
</div>
|
|
250
|
+
</auro-accordion>
|
|
251
|
+
</auro-accordion-group>
|
|
252
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
253
|
+
</section>
|
|
254
|
+
<section>
|
|
255
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/minimal-config.md) -->
|
|
256
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/minimal-config.md -->
|
|
257
|
+
<auro-header level="3" id="minimalConfig">Minimal Configuration</auro-header>
|
|
258
|
+
Every <code><auro-input></code> implementation requires a label in the <code>label</code> slot to provide an accessible label for the input element.
|
|
259
|
+
|
|
260
|
+
<pre class="language-html"><code class="language-html"><auro-input>
|
|
261
|
+
<span slot="label">Label</span>
|
|
262
|
+
</auro-input></code></pre>
|
|
263
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
264
|
+
</section>
|
|
265
|
+
<section>
|
|
266
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/slots.md) -->
|
|
267
|
+
<!-- The below content is automatically added from ./../docs/partials/getting-started/slots.md -->
|
|
268
|
+
<auro-header level="2" id="slots">Slots</auro-header>
|
|
269
|
+
<p>The following named slots are available on the <code><auro-input></code> element.</p>
|
|
270
|
+
<auro-header level="3" id="slot-label">label</auro-header>
|
|
271
|
+
<p>Sets the label text for the input.</p>
|
|
272
|
+
<auro-header level="3" id="slot-helpText">helpText</auro-header>
|
|
273
|
+
<p>Sets the help text displayed below the input.</p>
|
|
274
|
+
<auro-header level="3" id="slot-optionalLabel">optionalLabel</auro-header>
|
|
275
|
+
<p>Allows overriding the optional display text <code>"(optional)"</code>, which appears next to the label.</p>
|
|
276
|
+
<auro-header level="3" id="slot-displayValue">displayValue</auro-header>
|
|
277
|
+
<p>Allows custom HTML content to display in place of the value when the input is not focused.</p>
|
|
278
|
+
<auro-header level="3" id="slot-ariaLabel-clear">ariaLabel.clear</auro-header>
|
|
279
|
+
<p>Sets <code>aria-label</code> on the clear button for screen readers.</p>
|
|
280
|
+
<auro-header level="3" id="slot-ariaLabel-password-show">ariaLabel.password.show</auro-header>
|
|
281
|
+
<p>Sets <code>aria-label</code> on the password button to toggle on showing the password.</p>
|
|
282
|
+
<auro-header level="3" id="slot-ariaLabel-password-hide">ariaLabel.password.hide</auro-header>
|
|
283
|
+
<p>Sets <code>aria-label</code> on the password button to toggle off showing the password.</p>
|
|
284
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
285
|
+
</section>
|
|
286
|
+
<section>
|
|
287
|
+
<auro-header level="2" id="stateManagement">State Management</auro-header>
|
|
288
|
+
<p>The following read-only properties reflect the current state of the component and can be accessed via JavaScript.</p>
|
|
289
|
+
<auro-header level="3" id="hasFocus">hasFocus</auro-header>
|
|
290
|
+
<p>Returns <code>true</code> when the input element currently has focus.</p>
|
|
291
|
+
<auro-header level="3" id="hasValue">hasValue</auro-header>
|
|
292
|
+
<p>Returns <code>true</code> when the input element has a value.</p>
|
|
293
|
+
<auro-header level="3" id="validity">validity</auro-header>
|
|
294
|
+
<p>Returns the current <code>validityState</code> of the component as a string. Possible values include <code>"valid"</code>, <code>"valueMissing"</code>, and <code>"customError"</code>.</p>
|
|
295
|
+
<auro-header level="3" id="value">value</auro-header>
|
|
296
|
+
<p>Gets or sets the current value of the input element.</p>
|
|
297
|
+
</section>
|
|
298
|
+
<section>
|
|
299
|
+
<auro-header level="2" id="publicFunctions">Functions</auro-header>
|
|
300
|
+
<p>The following public methods are available on the <code><auro-input></code> element.</p>
|
|
301
|
+
<auro-header level="3" id="clear">clear()</auro-header>
|
|
302
|
+
<p>Clears the current value of the input.</p>
|
|
303
|
+
<auro-header level="3" id="focus">focus()</auro-header>
|
|
304
|
+
<p>Programmatically moves focus to the input element.</p>
|
|
305
|
+
<auro-header level="3" id="reset">reset()</auro-header>
|
|
306
|
+
<p>Resets the component to its initial state, clearing the value and validation state.</p>
|
|
307
|
+
<auro-header level="3" id="validate">validate()</auro-header>
|
|
308
|
+
<p>Triggers validation on the component. Pass <code>true</code> to force validation even when <code>noValidate</code> is set.</p>
|
|
309
|
+
</section>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|