@aurodesignsystem/auro-formkit 5.9.1 → 5.9.2

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 (127) hide show
  1. package/CHANGELOG.md +16 -4
  2. package/components/checkbox/README.md +62 -62
  3. package/components/checkbox/demo/api.js +1 -1
  4. package/components/checkbox/demo/api.md +127 -84
  5. package/components/checkbox/demo/api.min.js +125 -42
  6. package/components/checkbox/demo/index.md +9 -281
  7. package/components/checkbox/demo/index.min.js +125 -42
  8. package/components/checkbox/demo/readme.html +3 -4
  9. package/components/checkbox/demo/readme.md +62 -62
  10. package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -8
  11. package/components/checkbox/dist/auro-checkbox.d.ts +74 -20
  12. package/components/checkbox/dist/index.js +125 -42
  13. package/components/checkbox/dist/registered.js +125 -42
  14. package/components/combobox/README.md +76 -74
  15. package/components/combobox/demo/api.html +1 -0
  16. package/components/combobox/demo/api.js +11 -12
  17. package/components/combobox/demo/api.md +1302 -875
  18. package/components/combobox/demo/api.min.js +348 -420
  19. package/components/combobox/demo/index.html +1 -7
  20. package/components/combobox/demo/index.js +0 -19
  21. package/components/combobox/demo/index.md +43 -723
  22. package/components/combobox/demo/index.min.js +301 -230
  23. package/components/combobox/demo/readme.html +3 -4
  24. package/components/combobox/demo/readme.md +76 -74
  25. package/components/combobox/dist/auro-combobox.d.ts +39 -40
  26. package/components/combobox/dist/index.js +159 -143
  27. package/components/combobox/dist/registered.js +159 -143
  28. package/components/counter/README.md +81 -66
  29. package/components/counter/demo/api.html +1 -2
  30. package/components/counter/demo/api.js +2 -2
  31. package/components/counter/demo/api.md +777 -259
  32. package/components/counter/demo/api.min.js +84 -112
  33. package/components/counter/demo/index.html +0 -2
  34. package/components/counter/demo/index.md +20 -329
  35. package/components/counter/demo/index.min.js +82 -93
  36. package/components/counter/demo/readme.html +3 -4
  37. package/components/counter/demo/readme.md +81 -66
  38. package/components/counter/dist/auro-counter-group.d.ts +21 -36
  39. package/components/counter/dist/auro-counter-wrapper.d.ts +1 -6
  40. package/components/counter/dist/auro-counter.d.ts +5 -8
  41. package/components/counter/dist/index.js +82 -93
  42. package/components/counter/dist/registered.js +82 -93
  43. package/components/datepicker/README.md +57 -61
  44. package/components/datepicker/demo/api.js +8 -8
  45. package/components/datepicker/demo/api.md +720 -561
  46. package/components/datepicker/demo/api.min.js +427 -2424
  47. package/components/datepicker/demo/index.md +65 -117
  48. package/components/datepicker/demo/index.min.js +427 -2424
  49. package/components/datepicker/demo/readme.html +3 -4
  50. package/components/datepicker/demo/readme.md +57 -61
  51. package/components/datepicker/dist/auro-calendar.d.ts +60 -34
  52. package/components/datepicker/dist/auro-datepicker.d.ts +31 -31
  53. package/components/datepicker/dist/index.js +256 -2253
  54. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  55. package/components/datepicker/dist/registered.js +256 -2253
  56. package/components/dropdown/README.md +78 -62
  57. package/components/dropdown/demo/api.js +4 -4
  58. package/components/dropdown/demo/api.md +520 -478
  59. package/components/dropdown/demo/api.min.js +48 -39
  60. package/components/dropdown/demo/index.md +65 -119
  61. package/components/dropdown/demo/index.min.js +38 -29
  62. package/components/dropdown/demo/readme.html +3 -4
  63. package/components/dropdown/demo/readme.md +78 -62
  64. package/components/dropdown/dist/auro-dropdown.d.ts +42 -33
  65. package/components/dropdown/dist/index.js +38 -29
  66. package/components/dropdown/dist/registered.js +38 -29
  67. package/components/form/README.md +16 -58
  68. package/components/form/demo/api.md +16 -21
  69. package/components/form/demo/api.min.js +13 -8
  70. package/components/form/demo/index.md +38 -39
  71. package/components/form/demo/index.min.js +13 -8
  72. package/components/form/demo/readme.md +16 -58
  73. package/components/form/dist/auro-form.d.ts +15 -3
  74. package/components/form/dist/index.js +13 -8
  75. package/components/form/dist/registered.js +13 -8
  76. package/components/input/README.md +55 -60
  77. package/components/input/demo/api.js +3 -5
  78. package/components/input/demo/api.md +558 -537
  79. package/components/input/demo/api.min.js +100 -113
  80. package/components/input/demo/index.js +0 -1
  81. package/components/input/demo/index.md +90 -203
  82. package/components/input/demo/index.min.js +85 -97
  83. package/components/input/demo/readme.html +3 -4
  84. package/components/input/demo/readme.md +55 -60
  85. package/components/input/dist/auro-input.d.ts +6 -5
  86. package/components/input/dist/base-input.d.ts +67 -68
  87. package/components/input/dist/index.js +85 -80
  88. package/components/input/dist/registered.js +85 -80
  89. package/components/menu/README.md +61 -61
  90. package/components/menu/demo/api.js +6 -8
  91. package/components/menu/demo/api.md +520 -572
  92. package/components/menu/demo/api.min.js +176 -92
  93. package/components/menu/demo/index.js +0 -5
  94. package/components/menu/demo/index.md +36 -119
  95. package/components/menu/demo/index.min.js +141 -96
  96. package/components/menu/demo/readme.html +3 -4
  97. package/components/menu/demo/readme.md +61 -61
  98. package/components/menu/dist/auro-menu.d.ts +70 -37
  99. package/components/menu/dist/auro-menuoption.d.ts +36 -11
  100. package/components/menu/dist/index.js +141 -45
  101. package/components/menu/dist/registered.js +141 -45
  102. package/components/radio/README.md +61 -57
  103. package/components/radio/demo/api.js +2 -2
  104. package/components/radio/demo/api.md +241 -170
  105. package/components/radio/demo/api.min.js +154 -77
  106. package/components/radio/demo/index.md +22 -99
  107. package/components/radio/demo/index.min.js +145 -68
  108. package/components/radio/demo/readme.html +3 -4
  109. package/components/radio/demo/readme.md +61 -57
  110. package/components/radio/dist/auro-radio-group.d.ts +67 -35
  111. package/components/radio/dist/auro-radio.d.ts +56 -33
  112. package/components/radio/dist/index.js +145 -68
  113. package/components/radio/dist/registered.js +145 -68
  114. package/components/select/README.md +68 -65
  115. package/components/select/demo/api.html +1 -0
  116. package/components/select/demo/api.js +7 -7
  117. package/components/select/demo/api.md +1305 -625
  118. package/components/select/demo/api.min.js +300 -199
  119. package/components/select/demo/index.html +0 -2
  120. package/components/select/demo/index.md +25 -833
  121. package/components/select/demo/index.min.js +299 -167
  122. package/components/select/demo/readme.html +3 -4
  123. package/components/select/demo/readme.md +68 -65
  124. package/components/select/dist/auro-select.d.ts +99 -90
  125. package/components/select/dist/index.js +158 -122
  126. package/components/select/dist/registered.js +158 -122
  127. package/package.json +3 -3
@@ -3094,7 +3094,7 @@ class AuroHelpText extends LitElement {
3094
3094
  }
3095
3095
  }
3096
3096
 
3097
- var formkitVersion = '202512120003';
3097
+ var formkitVersion = '202601271813';
3098
3098
 
3099
3099
  class AuroElement extends LitElement {
3100
3100
  static get properties() {
@@ -3200,12 +3200,14 @@ class AuroElement extends LitElement {
3200
3200
  }
3201
3201
  }
3202
3202
 
3203
- // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
3203
+ // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
3204
3204
  // See LICENSE in the project root for license information.
3205
3205
 
3206
3206
 
3207
-
3208
- /*
3207
+ /**
3208
+ * The `auro-dropdown` element provides a way to place content in a bib that can be toggled.
3209
+ * @customElement auro-dropdown
3210
+ *
3209
3211
  * @slot - Default slot for the popover content.
3210
3212
  * @slot helpText - Defines the content of the helpText.
3211
3213
  * @slot trigger - Defines the content of the trigger.
@@ -3241,7 +3243,7 @@ class AuroDropdown extends AuroElement {
3241
3243
  /** @private */
3242
3244
  this.bibElement = createRef();
3243
3245
 
3244
- this.privateDefaults();
3246
+ this._intializeDefaults();
3245
3247
  }
3246
3248
 
3247
3249
  /**
@@ -3262,7 +3264,7 @@ class AuroDropdown extends AuroElement {
3262
3264
  * @private
3263
3265
  * @returns {void} Internal defaults.
3264
3266
  */
3265
- privateDefaults() {
3267
+ _intializeDefaults() {
3266
3268
  this.appearance = 'default';
3267
3269
  this.chevron = false;
3268
3270
  this.disabled = false;
@@ -3383,9 +3385,18 @@ class AuroDropdown extends AuroElement {
3383
3385
  static get properties() {
3384
3386
  return {
3385
3387
 
3388
+ /**
3389
+ * The value for the role attribute of the trigger element.
3390
+ */
3391
+ a11yRole: {
3392
+ type: String || undefined,
3393
+ attribute: false,
3394
+ reflect: false
3395
+ },
3396
+
3386
3397
  /**
3387
3398
  * Defines whether the component will be on lighter or darker backgrounds.
3388
- * @property {'default', 'inverse'}
3399
+ * @type {'default' | 'inverse'}
3389
3400
  * @default 'default'
3390
3401
  */
3391
3402
  appearance: {
@@ -3395,7 +3406,6 @@ class AuroDropdown extends AuroElement {
3395
3406
 
3396
3407
  /**
3397
3408
  * If declared, bib's position will be automatically calculated where to appear.
3398
- * @default false
3399
3409
  */
3400
3410
  autoPlacement: {
3401
3411
  type: Boolean,
@@ -3404,7 +3414,6 @@ class AuroDropdown extends AuroElement {
3404
3414
 
3405
3415
  /**
3406
3416
  * If declared, the dropdown will only show by calling the API .show() public method.
3407
- * @default false
3408
3417
  */
3409
3418
  disableEventShow: {
3410
3419
  type: Boolean,
@@ -3421,11 +3430,11 @@ class AuroDropdown extends AuroElement {
3421
3430
 
3422
3431
  /**
3423
3432
  * If declared, the dropdown displays a chevron on the right.
3424
- * @attr {Boolean} chevron
3425
3433
  */
3426
3434
  chevron: {
3427
3435
  type: Boolean,
3428
- reflect: true
3436
+ reflect: true,
3437
+ attribute: 'chevron'
3429
3438
  },
3430
3439
 
3431
3440
  /**
@@ -3462,7 +3471,7 @@ class AuroDropdown extends AuroElement {
3462
3471
  },
3463
3472
 
3464
3473
  /**
3465
- * If declared in combination with not using the `simple` property or `helpText` slot content, will apply red color to both.
3474
+ * If declared, will apply error UI to the dropdown.
3466
3475
  */
3467
3476
  error: {
3468
3477
  type: Boolean,
@@ -3517,18 +3526,28 @@ class AuroDropdown extends AuroElement {
3517
3526
  },
3518
3527
 
3519
3528
  /**
3520
- * Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
3521
- * at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
3529
+ * Defines the screen size breakpoint at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
3522
3530
  *
3523
3531
  * When expanded, the dropdown will automatically display in fullscreen mode
3524
3532
  * if the screen size is equal to or smaller than the selected breakpoint.
3525
- * @default sm
3533
+ * @type {'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'disabled'}
3534
+ * @default 'sm'
3526
3535
  */
3527
3536
  fullscreenBreakpoint: {
3528
3537
  type: String,
3529
3538
  reflect: true
3530
3539
  },
3531
3540
 
3541
+ /**
3542
+ * Sets the layout of the dropdown.
3543
+ * @type {'classic' | 'emphasized' | 'snowflake'}
3544
+ * @default 'classic'
3545
+ */
3546
+ layout: {
3547
+ type: String,
3548
+ reflect: true
3549
+ },
3550
+
3532
3551
  /**
3533
3552
  * Defines if the trigger should size based on the parent element providing the border UI.
3534
3553
  * @private
@@ -3549,7 +3568,6 @@ class AuroDropdown extends AuroElement {
3549
3568
  /**
3550
3569
  * If declared, the bib will NOT flip to an alternate position
3551
3570
  * when there isn't enough space in the specified `placement`.
3552
- * @default false
3553
3571
  */
3554
3572
  noFlip: {
3555
3573
  type: Boolean,
@@ -3558,7 +3576,6 @@ class AuroDropdown extends AuroElement {
3558
3576
 
3559
3577
  /**
3560
3578
  * If declared, the dropdown will shift its position to avoid being cut off by the viewport.
3561
- * @default false
3562
3579
  */
3563
3580
  shift: {
3564
3581
  type: Boolean,
@@ -3591,7 +3608,7 @@ class AuroDropdown extends AuroElement {
3591
3608
  },
3592
3609
 
3593
3610
  /**
3594
- * DEPRECATED - use `appearance` instead.
3611
+ * DEPRECATED - use `appearance="inverse"` instead.
3595
3612
  */
3596
3613
  onDark: {
3597
3614
  type: Boolean,
@@ -3608,7 +3625,8 @@ class AuroDropdown extends AuroElement {
3608
3625
 
3609
3626
  /**
3610
3627
  * Position where the bib should appear relative to the trigger.
3611
- * @default bottom-start
3628
+ * @type {'top' | 'right' | 'bottom' | 'left' | 'bottom-start' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-end' | 'left-start' | 'left-end'}
3629
+ * @default 'bottom-start'
3612
3630
  */
3613
3631
  placement: {
3614
3632
  type: String,
@@ -3620,15 +3638,6 @@ class AuroDropdown extends AuroElement {
3620
3638
  */
3621
3639
  tabIndex: {
3622
3640
  type: Number
3623
- },
3624
-
3625
- /**
3626
- * The value for the role attribute of the trigger element.
3627
- */
3628
- a11yRole: {
3629
- type: String || undefined,
3630
- attribute: false,
3631
- reflect: false
3632
3641
  }
3633
3642
  };
3634
3643
  }
@@ -3655,7 +3664,7 @@ class AuroDropdown extends AuroElement {
3655
3664
 
3656
3665
  /**
3657
3666
  * This will register this element with the browser.
3658
- * @param {string} [name="auro-dropdown"] - The name of element that you want to register to.
3667
+ * @param {string} [name="auro-dropdown"] - The name of the element that you want to register.
3659
3668
  *
3660
3669
  * @example
3661
3670
  * AuroDropdown.register("custom-dropdown") // this will register this element to <custom-dropdown/>
@@ -18,6 +18,7 @@ The following sections are editable by making changes to the following files:
18
18
  -->
19
19
 
20
20
  # Form
21
+
21
22
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
22
23
  <!-- The below content is automatically added from ./docs/partials/description.md -->
23
24
  `<auro-form>` is a [HTML custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) designed to
@@ -31,7 +32,15 @@ them (along with events) to the parent form element as a JSON object.
31
32
  <!-- AURO-GENERATED-CONTENT This file is to be used for any additional content that should be included in the README.md which is specific to this component. -->
32
33
  <!-- AURO-GENERATED-CONTENT:END -->
33
34
 
35
+ ## Form Use Cases
36
+
37
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
38
+ <!-- The below content is automatically added from ./docs/partials/useCases.md -->
39
+ The `<auro-form>` element should be used in situations where users want to build HTML forms.
40
+ <!-- AURO-GENERATED-CONTENT:END -->
41
+
34
42
  ## Getting Started
43
+
35
44
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/componentInstall.md) -->
36
45
  <!-- The below content is automatically added from ../../docs/templates/componentInstall.md -->
37
46
 
@@ -44,30 +53,7 @@ $ npm i @aurodesignsystem/auro-formkit
44
53
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/gettingStarted.md) -->
45
54
  <!-- The below content is automatically added from ../../docs/templates/gettingStarted.md -->
46
55
 
47
- ### Import Options
48
-
49
- #### Automatic Registration
50
-
51
- For automatic registration, simply import the component:
52
-
53
- ```javascript
54
- // Registers <auro-form> automatically
55
- import '@aurodesignsystem/auro-formkit/auro-form';
56
- ```
57
-
58
- #### Custom Registration
59
-
60
- To protect from versioning conflicts with other instances of the component being loaded, it is recommended to use our static `AuroForm.register('custom-form')` method on the component class and pass in a unique name.
61
-
62
- ```javascript
63
- // Import the class only
64
- import { AuroForm } from '@aurodesignsystem/auro-formkit/auro-form/class';
65
-
66
- // Register with a custom name if desired
67
- AuroForm.register('custom-form');
68
- ```
69
-
70
- #### TypeScript Module Resolution
56
+ ### TypeScript Module Resolution
71
57
 
72
58
  When using TypeScript set `moduleResolution` to `bundler`, add the following to your `tsconfig.json`:
73
59
 
@@ -80,30 +66,10 @@ When using TypeScript set `moduleResolution` to `bundler`, add the following to
80
66
  ```
81
67
 
82
68
  This configuration enables proper module resolution for the component's TypeScript files.
83
- <!-- AURO-GENERATED-CONTENT:END -->
84
- **Reference component in HTML**
85
-
86
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
87
- <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
88
-
89
- ```html
90
- <auro-form>
91
- <auro-input id="search-box" name="searchBox" required>
92
- <span slot="label">Search flights</span>
93
- </auro-input>
94
- <auro-button type="submit">Submit</auro-button>
95
- </auro-form>
96
- ```
97
- <!-- AURO-GENERATED-CONTENT:END -->
98
-
99
- ### Design Token CSS Custom Property dependency
100
-
101
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/designTokens.md) -->
102
- The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
103
-
104
69
  <!-- AURO-GENERATED-CONTENT:END -->
105
70
 
106
71
  ## Install from CDN
72
+
107
73
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/bundleInstallDescription.md) -->
108
74
  <!-- The below content is automatically added from ../../docs/templates/bundleInstallDescription.md -->
109
75
  In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
@@ -113,19 +79,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
113
79
  ```
114
80
  <!-- AURO-GENERATED-CONTENT:END -->
115
81
 
116
- ## UI development browser support
117
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/browserSupport.md) -->
118
- For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
119
-
120
- <!-- AURO-GENERATED-CONTENT:END -->
121
-
122
- ## auro-form use cases
123
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
124
- <!-- The below content is automatically added from ./docs/partials/useCases.md -->
125
- The `<auro-form>` element should be used in situations where users want to build HTML forms.
126
- <!-- AURO-GENERATED-CONTENT:END -->
127
-
128
- ## Formkit development
82
+ ## Formkit Development
129
83
 
130
84
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/partials/developmentDescription.md) -->
131
85
  <!-- The below content is automatically added from ../../docs/partials/developmentDescription.md -->
@@ -139,4 +93,8 @@ To only develop a single component, use the `--filter` flag:
139
93
  ```shell
140
94
  npx turbo dev --filter=@aurodesignsystem/auro-input
141
95
  ```
96
+ <!-- AURO-GENERATED-CONTENT:END -->
97
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
98
+ <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
99
+ The `auro-form` component does not support custom registration at this time.
142
100
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -3,30 +3,25 @@
3
3
 
4
4
  # auro-form
5
5
 
6
- The auro-form element provides users a way to ... (it would be great if you fill this out).
6
+ The `auro-form` element provides users a way to create and manage forms in a consistent manner.
7
7
 
8
- ## Attributes
9
-
10
- | Attribute | Type | Description |
11
- |------------|-----------|--------------------------------------------------|
12
- | [cssClass](#cssClass) | `String` | Applies designated CSS class to demo element - you want to delete me! |
13
- | [fixed](#fixed) | `Boolean` | Uses fixed pixel values for element shape |
14
-
15
8
  ## Properties
16
9
 
17
- | Property | Modifiers | Type | Default | Description |
18
- |----------------------------|-----------|--------------------------------------------------|---------|--------------------------------------------------|
19
- | [formState](#formState) | | `FormState` | {} | |
20
- | [isInitialState](#isInitialState) | readonly | `boolean` | | Mostly internal way to determine if a form is in the initial state. |
21
- | [mutationEventListener](#mutationEventListener) | | | | |
22
- | [reset](#reset) | | | | |
23
- | [resetElements](#resetElements) | readonly | `HTMLButtonElement[]` | | Returns a collection of elements that will reset the form. |
24
- | [sharedInputListener](#sharedInputListener) | | | | |
25
- | [sharedValidationListener](#sharedValidationListener) | | | | |
26
- | [submit](#submit) | | | | |
27
- | [submitElements](#submitElements) | readonly | `HTMLButtonElement[]` | | Getter for internal _submitElements. |
28
- | [validity](#validity) | readonly | `"valid" \| "invalid"` | | Current validity state of the form, based on form element events. |
29
- | [value](#value) | readonly | `Record<string, string \| number \| boolean \| string[] \| null>` | | Reduce the form value into a key-value pair.<br /><br />NOTE: form keys use `name` first, and `id` second if `name` is not available.<br />This follows standard HTML5 form behavior - submission uses `name` by default when creating<br />the FormData object. |
10
+ | Property | Attribute | Modifiers | Type | Default | Description |
11
+ |----------------------------|------------|-----------|--------------------------------------------------|---------|--------------------------------------------------|
12
+ | [cssClass](#cssClass) | `cssClass` | | `boolean` | | Applies designated CSS class to demo element - you want to delete me! |
13
+ | [fixed](#fixed) | `fixed` | | `boolean` | | If declared, use fixed pixel values for element shape. |
14
+ | [formState](#formState) | | | `FormState` | {} | |
15
+ | [isInitialState](#isInitialState) | | readonly | `boolean` | | Mostly internal way to determine if a form is in the initial state. |
16
+ | [mutationEventListener](#mutationEventListener) | | | | | |
17
+ | [reset](#reset) | | | | | |
18
+ | [resetElements](#resetElements) | | readonly | `HTMLButtonElement[]` | | Returns a collection of elements that will reset the form. |
19
+ | [sharedInputListener](#sharedInputListener) | | | | | |
20
+ | [sharedValidationListener](#sharedValidationListener) | | | | | |
21
+ | [submit](#submit) | | | | | |
22
+ | [submitElements](#submitElements) | | readonly | `HTMLButtonElement[]` | | Getter for internal _submitElements. |
23
+ | [validity](#validity) | | readonly | `"valid" \| "invalid"` | | Current validity state of the form, based on form element events. |
24
+ | [value](#value) | | readonly | `Record<string, string \| number \| boolean \| string[] \| null>` | | Reduce the form value into a key-value pair.<br /><br />NOTE: form keys use `name` first, and `id` second if `name` is not available.<br />This follows standard HTML5 form behavior - submission uses `name` by default when creating<br />the FormData object. |
30
25
 
31
26
  ## Methods
32
27
 
@@ -109,7 +109,7 @@ class AuroLibraryRuntimeUtils {
109
109
  }
110
110
  }
111
111
 
112
- /* eslint-disable no-underscore-dangle,max-lines */
112
+ /* eslint-disable no-underscore-dangle, max-lines, object-property-newline */
113
113
 
114
114
 
115
115
  /**
@@ -124,20 +124,25 @@ class AuroLibraryRuntimeUtils {
124
124
  * @typedef {Object.<string, FormStateMember>} FormState - The form state.
125
125
  */
126
126
 
127
-
128
- // See https://git.io/JJ6SJ for "How to document your components using JSDoc"
129
127
  /**
130
- * The auro-form element provides users a way to ... (it would be great if you fill this out).
128
+ * The `auro-form` element provides users a way to create and manage forms in a consistent manner.
129
+ * @customElement auro-form
131
130
  *
132
- * @attr {Boolean} fixed - Uses fixed pixel values for element shape
133
- * @attr {String} cssClass - Applies designated CSS class to demo element - you want to delete me!
134
131
  * @event {Event} change - Fires when form state changes.
135
132
  */
136
-
137
- // build the component class
138
133
  class AuroForm extends i {
139
134
  static get properties() {
140
135
  return {
136
+
137
+ /**
138
+ * Applies designated CSS class to demo element - you want to delete me!
139
+ */
140
+ cssClass: { type: Boolean },
141
+
142
+ /**
143
+ * If declared, use fixed pixel values for element shape.
144
+ */
145
+ fixed: { type: Boolean, reflect: true },
141
146
  formState: { attribute: false },
142
147
  _validity: { attribute: false },
143
148
  _isInitialState: { attribute: false },
@@ -17,7 +17,7 @@ It automatically "scrapes" its inner content for any auro form elements, and sur
17
17
  them (along with events) to the parent form element as a JSON object.
18
18
  <!-- AURO-GENERATED-CONTENT:END -->
19
19
 
20
- ## Form value generation
20
+ ## Form Value Generation
21
21
 
22
22
  Auro form exists to make a developer's life easier through surfacing all Auro form elements in a given form as a single
23
23
  JSON object.
@@ -32,7 +32,7 @@ The following is required on each Auro form element in a form for it to be colle
32
32
  That being said, we do _not_ require form elements to be direct children of `auro-form`.
33
33
  They can be nested within other elements for styling, such as a `div`, `span` or `fieldset`.
34
34
 
35
- ### Form data structure
35
+ ### Form Data Structure
36
36
 
37
37
  In a correctly registered scenario, `auro-form`
38
38
  will automatically recognize the auro form elements and collect data from each on the form's `value` key as a JSON object.
@@ -68,7 +68,7 @@ interface AuroFormState {
68
68
  }
69
69
  ```
70
70
 
71
- ## Accessing form data
71
+ ## Accessing Form Data
72
72
 
73
73
  As Auro components are designed to be framework-agnostic, data can be retrieved using simple vanilla JavaScript patterns.
74
74
  If you have ever worked with a standard HTML5 form, you are already equipped to work with Auro forms!
@@ -76,11 +76,11 @@ If you have ever worked with a standard HTML5 form, you are already equipped to
76
76
  Once you have a reference to the form element (React ref, querySelector, etc.),
77
77
  you can access the form data using the following methods:
78
78
 
79
- **Data keys + get methods**:
79
+ **Data Keys + Get Methods**:
80
80
  - `.value` - Getter which returns the current form data as a JSON object.
81
81
  - `.validity` - Returns the current validity state of the form (`valid` or `invalid`).
82
82
 
83
- **Extra information**:
83
+ **Extra Information**:
84
84
  - `.isInitialState` - Returns a boolean indicating if the form is in its initial state.
85
85
 
86
86
  **Events**
@@ -88,11 +88,11 @@ you can access the form data using the following methods:
88
88
  - `reset` - Fires when the form is reset.
89
89
  - `submit` - Fires when the form is submitted.
90
90
 
91
- **Advanced features**:
91
+ **Advanced Features**:
92
92
  - `.formState` - This is the internal form state. It includes extra `required` and `validity` information for each form element.
93
93
  This key is not required for normal form usage, but can add additional context for more complex forms.
94
94
 
95
- ## Important note for custom elements
95
+ ## Important Note for Custom Elements
96
96
 
97
97
  This **only applies to custom-named elements**.
98
98
 
@@ -104,8 +104,8 @@ which are only assigned during the initial render.
104
104
  For example, the following is correct:
105
105
 
106
106
  ```javascript
107
- import {AuroInput} from '@aurodesignsystem/auro-input';
108
- import {AuroForm} from '@aurodesignsystem/auro-form';
107
+ import { AuroInput } from '@aurodesignsystem/auro-formkit/auro-input/class';
108
+ import { AuroForm } from '@aurodesignsystem/auro-formkit/auro-form/class';
109
109
 
110
110
  AuroInput.register('my-custom-input'); // adds an internal identifier auro-form uses to recognize the custom element
111
111
  AuroForm.register(); // render looks for said identifier
@@ -114,8 +114,8 @@ AuroForm.register(); // render looks for said identifier
114
114
  The following is NOT correct and will result in forms not working as expected:
115
115
 
116
116
  ```javascript
117
- import {AuroInput} from '@aurodesignsystem/auro-input';
118
- import {AuroForm} from '@aurodesignsystem/auro-form';
117
+ import { AuroInput } from '@aurodesignsystem/auro-formkit/auro-input/class';
118
+ import { AuroForm } from '@aurodesignsystem/auro-formkit/auro-form/class';
119
119
 
120
120
  AuroForm.register(); // forms start rendering, looking for auro inputs, or custom-named inputs
121
121
  AuroInput.register('my-custom-input'); // too late, form has already rendered and did not find the custom element
@@ -124,6 +124,7 @@ AuroInput.register('my-custom-input'); // too late, form has already rendered an
124
124
  ## Examples
125
125
 
126
126
  ### Basic Form
127
+
127
128
  The most basic form implementation requires an `auro-input` and an optional auro button with `type="submit"`.
128
129
 
129
130
  By default, Auro Form connects a `submit` event to all `type="submit"` buttons within the form.
@@ -135,6 +136,7 @@ By default, Auro Form connects a `submit` event to all `type="submit"` buttons w
135
136
  <auro-input id="search-box" name="searchBox" required>
136
137
  <span slot="label">Search flights</span>
137
138
  </auro-input>
139
+ <br />
138
140
  <auro-button type="submit">Submit</auro-button>
139
141
  </auro-form>
140
142
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -149,13 +151,15 @@ By default, Auro Form connects a `submit` event to all `type="submit"` buttons w
149
151
  <auro-input id="search-box" name="searchBox" required>
150
152
  <span slot="label">Search flights</span>
151
153
  </auro-input>
154
+ <br />
152
155
  <auro-button type="submit">Submit</auro-button>
153
156
  </auro-form>
154
157
  ```
155
158
  <!-- AURO-GENERATED-CONTENT:END -->
156
159
  </auro-accordion>
157
160
 
158
- ### Form with column layout
161
+ ### Form with Column Layout
162
+
159
163
  Auro Form is designed to be completely unstyled by default, allowing developers to use divs, structural elements, or
160
164
  custom CSS to style the form.
161
165
 
@@ -264,7 +268,8 @@ This example shows that you can use advanced layouts with Auro Form, such as a c
264
268
  <!-- AURO-GENERATED-CONTENT:END -->
265
269
  </auro-accordion>
266
270
 
267
- ### Complex form
271
+ ### Complex Form
272
+
268
273
  Finally, a more complex form example with multiple form elements, including a date picker and a select element.
269
274
 
270
275
  <div class="exampleWrapper">
@@ -294,19 +299,16 @@ Finally, a more complex form example with multiple form elements, including a da
294
299
  <auro-form class="complex-form">
295
300
  <auro-input id="first-name" name="firstName" required>
296
301
  <span slot="label">First Name</span>
297
- </auro-input>
298
- <div>
299
- <auro-input id="last-name" name="lastName" required>
300
- <span slot="label">Last Name</span>
301
- </auro-input>
302
- </div>
303
- <div>
304
- <div>
305
- <auro-input id="occupation" name="occupation" required>
306
- <span slot="label">Occupation</span>
307
- </auro-input>
308
- </div>
309
- </div>
302
+ </auro-input>
303
+ <br />
304
+ <auro-input id="last-name" name="lastName" required>
305
+ <span slot="label">Last Name</span>
306
+ </auro-input>
307
+ <br />
308
+ <auro-input id="occupation" name="occupation" required>
309
+ <span slot="label">Occupation</span>
310
+ </auro-input>
311
+ <br />
310
312
  <auro-input-two id="cool-fact" name="coolFact" required>
311
313
  <span slot="label">Cool Fact</span>
312
314
  </auro-input-two>
@@ -362,19 +364,16 @@ Finally, a more complex form example with multiple form elements, including a da
362
364
  <auro-form class="complex-form">
363
365
  <auro-input id="first-name" name="firstName" required>
364
366
  <span slot="label">First Name</span>
365
- </auro-input>
366
- <div>
367
- <auro-input id="last-name" name="lastName" required>
368
- <span slot="label">Last Name</span>
369
- </auro-input>
370
- </div>
371
- <div>
372
- <div>
373
- <auro-input id="occupation" name="occupation" required>
374
- <span slot="label">Occupation</span>
375
- </auro-input>
376
- </div>
377
- </div>
367
+ </auro-input>
368
+ <br />
369
+ <auro-input id="last-name" name="lastName" required>
370
+ <span slot="label">Last Name</span>
371
+ </auro-input>
372
+ <br />
373
+ <auro-input id="occupation" name="occupation" required>
374
+ <span slot="label">Occupation</span>
375
+ </auro-input>
376
+ <br />
378
377
  <auro-input-two id="cool-fact" name="coolFact" required>
379
378
  <span slot="label">Cool Fact</span>
380
379
  </auro-input-two>
@@ -109,7 +109,7 @@ class AuroLibraryRuntimeUtils {
109
109
  }
110
110
  }
111
111
 
112
- /* eslint-disable no-underscore-dangle,max-lines */
112
+ /* eslint-disable no-underscore-dangle, max-lines, object-property-newline */
113
113
 
114
114
 
115
115
  /**
@@ -124,20 +124,25 @@ class AuroLibraryRuntimeUtils {
124
124
  * @typedef {Object.<string, FormStateMember>} FormState - The form state.
125
125
  */
126
126
 
127
-
128
- // See https://git.io/JJ6SJ for "How to document your components using JSDoc"
129
127
  /**
130
- * The auro-form element provides users a way to ... (it would be great if you fill this out).
128
+ * The `auro-form` element provides users a way to create and manage forms in a consistent manner.
129
+ * @customElement auro-form
131
130
  *
132
- * @attr {Boolean} fixed - Uses fixed pixel values for element shape
133
- * @attr {String} cssClass - Applies designated CSS class to demo element - you want to delete me!
134
131
  * @event {Event} change - Fires when form state changes.
135
132
  */
136
-
137
- // build the component class
138
133
  class AuroForm extends i {
139
134
  static get properties() {
140
135
  return {
136
+
137
+ /**
138
+ * Applies designated CSS class to demo element - you want to delete me!
139
+ */
140
+ cssClass: { type: Boolean },
141
+
142
+ /**
143
+ * If declared, use fixed pixel values for element shape.
144
+ */
145
+ fixed: { type: Boolean, reflect: true },
141
146
  formState: { attribute: false },
142
147
  _validity: { attribute: false },
143
148
  _isInitialState: { attribute: false },