@aurodesignsystem-dev/auro-formkit 0.0.0-pr1474.3 → 0.0.0-pr1475.0

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 (83) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +7 -0
  2. package/components/bibtemplate/dist/index.js +9 -1
  3. package/components/bibtemplate/dist/registered.js +9 -1
  4. package/components/checkbox/demo/customize.html +2 -1
  5. package/components/checkbox/demo/customize.min.js +1 -1
  6. package/components/checkbox/demo/getting-started.min.js +1 -1
  7. package/components/checkbox/demo/index.min.js +1 -1
  8. package/components/checkbox/dist/index.js +1 -1
  9. package/components/checkbox/dist/registered.js +1 -1
  10. package/components/combobox/demo/customize.html +2 -1
  11. package/components/combobox/demo/customize.md +130 -106
  12. package/components/combobox/demo/customize.min.js +209 -16
  13. package/components/combobox/demo/getting-started.min.js +209 -16
  14. package/components/combobox/demo/index.min.js +209 -16
  15. package/components/combobox/dist/index.js +209 -16
  16. package/components/combobox/dist/registered.js +209 -16
  17. package/components/counter/demo/customize.min.js +208 -15
  18. package/components/counter/demo/index.min.js +208 -15
  19. package/components/counter/demo/keyboard-behavior.md +1 -0
  20. package/components/counter/dist/index.js +10 -2
  21. package/components/counter/dist/registered.js +10 -2
  22. package/components/datepicker/demo/accessibility.md +51 -3
  23. package/components/datepicker/demo/api.md +9 -0
  24. package/components/datepicker/demo/customize.html +2 -0
  25. package/components/datepicker/demo/customize.js +19 -0
  26. package/components/datepicker/demo/customize.md +72 -8
  27. package/components/datepicker/demo/customize.min.js +25690 -0
  28. package/components/datepicker/demo/design.md +3 -1
  29. package/components/datepicker/demo/index.js +2 -1
  30. package/components/datepicker/demo/index.md +81 -1
  31. package/components/datepicker/demo/index.min.js +1223 -101
  32. package/components/datepicker/demo/keyboard-behavior.md +201 -2
  33. package/components/datepicker/demo/voiceover.md +19 -12
  34. package/components/datepicker/dist/index.js +1155 -104
  35. package/components/datepicker/dist/registered.js +1155 -104
  36. package/components/datepicker/dist/src/auro-calendar-cell.d.ts +59 -0
  37. package/components/datepicker/dist/src/auro-calendar-month.d.ts +28 -0
  38. package/components/datepicker/dist/src/auro-calendar.d.ts +84 -0
  39. package/components/datepicker/dist/src/auro-datepicker.d.ts +80 -0
  40. package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +5 -3
  41. package/components/dropdown/demo/accessibility.md +11 -0
  42. package/components/dropdown/demo/api.md +1 -0
  43. package/components/dropdown/demo/customize.md +3 -0
  44. package/components/dropdown/demo/customize.min.js +198 -13
  45. package/components/dropdown/demo/getting-started.min.js +198 -13
  46. package/components/dropdown/demo/index.min.js +198 -13
  47. package/components/dropdown/demo/keyboard-behavior.md +1 -0
  48. package/components/dropdown/dist/auro-dropdown.d.ts +30 -1
  49. package/components/dropdown/dist/index.js +198 -13
  50. package/components/dropdown/dist/registered.js +198 -13
  51. package/components/form/demo/customize.html +6 -6
  52. package/components/form/demo/customize.js +0 -17
  53. package/components/form/demo/customize.md +51 -125
  54. package/components/form/demo/customize.min.js +1776 -327
  55. package/components/form/demo/getting-started.min.js +1776 -291
  56. package/components/form/demo/index.min.js +1776 -291
  57. package/components/form/demo/registerDemoDeps.min.js +1769 -139
  58. package/components/form/dist/auro-form.d.ts +5 -45
  59. package/components/form/dist/index.js +7 -152
  60. package/components/form/dist/registered.js +7 -152
  61. package/components/input/demo/customize.html +2 -1
  62. package/components/input/demo/customize.min.js +1 -1
  63. package/components/input/demo/getting-started.min.js +1 -1
  64. package/components/input/demo/index.min.js +1 -1
  65. package/components/input/dist/index.js +1 -1
  66. package/components/input/dist/registered.js +1 -1
  67. package/components/radio/demo/customize.min.js +2186 -0
  68. package/components/radio/demo/demo-support.min.js +55807 -0
  69. package/components/radio/demo/getting-started.js +1 -1
  70. package/components/radio/demo/getting-started.md +1 -1
  71. package/components/radio/demo/getting-started.min.js +2205 -0
  72. package/components/radio/demo/index.min.js +1 -1
  73. package/components/radio/dist/index.js +1 -1
  74. package/components/radio/dist/registered.js +1 -1
  75. package/components/select/demo/customize.html +2 -2
  76. package/components/select/demo/customize.min.js +208 -15
  77. package/components/select/demo/getting-started.min.js +208 -15
  78. package/components/select/demo/index.min.js +208 -15
  79. package/components/select/demo/keyboard-behavior.md +1 -0
  80. package/components/select/dist/index.js +208 -15
  81. package/components/select/dist/registered.js +208 -15
  82. package/custom-elements.json +2130 -1518
  83. package/package.json +2 -2
@@ -3243,7 +3243,7 @@ function applyKeyboardStrategy(component, strategy, options = {}) {
3243
3243
  });
3244
3244
  }
3245
3245
 
3246
- var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
3246
+ var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host([desktopmodal]:popover-open)::backdrop{background:transparent}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
3247
3247
 
3248
3248
  var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
3249
3249
 
@@ -3874,7 +3874,7 @@ class AuroHelpText extends LitElement {
3874
3874
  }
3875
3875
  }
3876
3876
 
3877
- var formkitVersion = '202605122144';
3877
+ var formkitVersion = '202605182147';
3878
3878
 
3879
3879
  class AuroElement extends LitElement {
3880
3880
  static get properties() {
@@ -4054,6 +4054,7 @@ class AuroDropdown extends AuroElement {
4054
4054
  _intializeDefaults() {
4055
4055
  this.appearance = 'default';
4056
4056
  this.chevron = false;
4057
+ this.desktopModal = false;
4057
4058
  this.disabled = false;
4058
4059
  this.disableKeyboardHandling = false;
4059
4060
  this.error = false;
@@ -4234,6 +4235,14 @@ class AuroDropdown extends AuroElement {
4234
4235
  reflect: true
4235
4236
  },
4236
4237
 
4238
+ /**
4239
+ * If declared, the dropdown will behave as a modal dialog when in a desktop viewport size.
4240
+ */
4241
+ desktopModal: {
4242
+ type: Boolean,
4243
+ reflect: true
4244
+ },
4245
+
4237
4246
  /**
4238
4247
  * If declared, the dropdown will only show by calling the API .show() public method.
4239
4248
  */
@@ -4521,6 +4530,15 @@ class AuroDropdown extends AuroElement {
4521
4530
 
4522
4531
  disconnectedCallback() {
4523
4532
  super.disconnectedCallback();
4533
+ this._clearPageInert();
4534
+ if (this._bibTabHandler) {
4535
+ this.removeEventListener('keydown', this._bibTabHandler);
4536
+ this._bibTabHandler = undefined;
4537
+ }
4538
+ if (this.focusTrap) {
4539
+ this.focusTrap.disconnect();
4540
+ this.focusTrap = undefined;
4541
+ }
4524
4542
  if (this.floater) {
4525
4543
  this.floater.hideBib('disconnect');
4526
4544
  this.floater.disconnect();
@@ -4548,19 +4566,34 @@ class AuroDropdown extends AuroElement {
4548
4566
  if (this.isPopoverVisible) {
4549
4567
  // Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
4550
4568
  // Desktop: use show() for Floating UI positioning + FocusTrap for focus management
4551
- const useModal = this.isBibFullscreen;
4552
- this.bibElement.value.open(useModal);
4569
+ this.bibElement.value.open(this.isBibFullscreen);
4570
+ this.updateFocusTrap();
4571
+
4572
+ // Desktop modal: make siblings inert so content outside is not interactive
4573
+ if (this.desktopModal && !this.isBibFullscreen) {
4574
+ this._setPageInert();
4575
+ }
4553
4576
  } else {
4554
4577
  this.bibElement.value.close();
4578
+ this._clearPageInert();
4555
4579
  }
4556
4580
  }
4557
4581
 
4558
4582
  // When fullscreen strategy changes while open, re-open dialog with correct mode
4559
4583
  // (e.g. resizing from desktop → mobile while dropdown is open)
4560
4584
  if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
4561
- const useModal = this.isBibFullscreen;
4562
4585
  this.bibElement.value.close();
4563
- this.bibElement.value.open(useModal);
4586
+ this.bibElement.value.open(this.isBibFullscreen);
4587
+
4588
+ // Re-initialize focus management for the new strategy
4589
+ this.updateFocusTrap();
4590
+
4591
+ // Toggle inert: desktop modal needs it, fullscreen showModal() handles it natively
4592
+ if (this.desktopModal && !this.isBibFullscreen) {
4593
+ this._setPageInert();
4594
+ } else {
4595
+ this._clearPageInert();
4596
+ }
4564
4597
  }
4565
4598
  }
4566
4599
 
@@ -4570,8 +4603,14 @@ class AuroDropdown extends AuroElement {
4570
4603
  * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
4571
4604
  */
4572
4605
  handleDropdownToggle(event) {
4573
- this.updateFocusTrap();
4574
4606
  this.isPopoverVisible = event.detail.expanded;
4607
+
4608
+ // Tear down FocusTrap when closing. Creation happens in updated()
4609
+ // after the dialog is open so getFocusableElements can find content.
4610
+ if (!this.isPopoverVisible) {
4611
+ this.updateFocusTrap();
4612
+ }
4613
+
4575
4614
  const eventType = event.detail.eventType || "unknown";
4576
4615
  if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
4577
4616
  this.trigger.focus();
@@ -4670,19 +4709,164 @@ class AuroDropdown extends AuroElement {
4670
4709
  * @private
4671
4710
  */
4672
4711
  updateFocusTrap() {
4712
+ // Always clean up existing handlers/traps before setting up new ones
4713
+ // to prevent duplicate listeners on repeated calls.
4714
+ if (this._bibTabHandler) {
4715
+ this.removeEventListener('keydown', this._bibTabHandler);
4716
+ this._bibTabHandler = undefined;
4717
+ }
4718
+
4719
+ if (this.focusTrap) {
4720
+ this.focusTrap.disconnect();
4721
+ this.focusTrap = undefined;
4722
+ }
4723
+
4673
4724
  if (this.isPopoverVisible) {
4674
4725
  if (!this.isBibFullscreen) {
4675
- // Desktop: show() doesn't trap focus, so use FocusTrap
4676
- this.focusTrap = new FocusTrap(this.bibContent);
4677
- this.focusTrap.focusFirstElement();
4726
+ if (this.desktopModal) {
4727
+ // Desktop modal: trap focus only within the bib content.
4728
+ // Can't use FocusTrap on the bib element because keydown events
4729
+ // from slotted content bubble through the dropdown host (light DOM),
4730
+ // not through the bib (shadow projection target). Using FocusTrap
4731
+ // on the dropdown would include the trigger in the tab cycle.
4732
+ // Instead, listen for Tab on the dropdown and manually wrap focus
4733
+ // within the bib's focusable elements.
4734
+ this._bibTabHandler = (event) => {
4735
+ if (event.key !== 'Tab') {
4736
+ return;
4737
+ }
4738
+
4739
+ // Collect focusable elements from the bib content.
4740
+ const focusables = getFocusableElements(this.bibContent);
4741
+
4742
+ // Fallback: try from slotted content directly
4743
+ if (!focusables.length) {
4744
+ const slot = this.shadowRoot.querySelector('.slotContent slot');
4745
+ const assignedNodes = slot ? slot.assignedNodes({ flatten: true }) : [];
4746
+
4747
+ for (const node of assignedNodes) {
4748
+ if (node.nodeType === Node.ELEMENT_NODE) {
4749
+ focusables.push(...getFocusableElements(node));
4750
+ }
4751
+ }
4752
+ }
4753
+
4754
+ if (!focusables.length) {
4755
+ return;
4756
+ }
4757
+
4758
+ event.preventDefault();
4759
+
4760
+ const direction = event.shiftKey ? -1 : 1; // eslint-disable-line no-magic-numbers
4761
+
4762
+ // Walk the active element chain through shadow roots
4763
+ const actives = this._getActiveElements();
4764
+
4765
+ let idx = focusables.findIndex((el) => actives.includes(el));
4766
+
4767
+ if (idx === -1) { // eslint-disable-line no-magic-numbers
4768
+ // Focus is not on a known element — move to first/last
4769
+ idx = direction === 1 ? -1 : focusables.length; // eslint-disable-line no-magic-numbers
4770
+ }
4771
+
4772
+ // Try each element in order, skipping any that can't receive focus
4773
+ // (e.g. hidden elements, elements in collapsed sections)
4774
+ for (let index = 0; index < focusables.length; index++) { // eslint-disable-line no-plusplus
4775
+ let nextIdx = idx + direction;
4776
+
4777
+ // Wrap around
4778
+ if (nextIdx < 0) {
4779
+ nextIdx = focusables.length - 1;
4780
+ } else if (nextIdx >= focusables.length) {
4781
+ nextIdx = 0;
4782
+ }
4783
+
4784
+ focusables[nextIdx].focus();
4785
+
4786
+ // Verify focus actually moved to the target
4787
+ const newActives = this._getActiveElements();
4788
+
4789
+ if (newActives.includes(focusables[nextIdx])) {
4790
+ return;
4791
+ }
4792
+
4793
+ // Focus didn't stick — skip this element and try the next
4794
+ idx = nextIdx;
4795
+ }
4796
+ };
4797
+ this.addEventListener('keydown', this._bibTabHandler);
4798
+ } else {
4799
+ // Normal desktop: use FocusTrap on the bib element
4800
+ this.focusTrap = new FocusTrap(this.bibContent);
4801
+ this.focusTrap.focusFirstElement();
4802
+ }
4678
4803
  }
4679
4804
  // Fullscreen: showModal() provides native focus trapping
4805
+ }
4806
+ }
4807
+
4808
+ /**
4809
+ * Returns the chain of active (focused) elements through shadow roots.
4810
+ * @private
4811
+ * @returns {Array<HTMLElement>}
4812
+ */
4813
+ _getActiveElements() {
4814
+ let { activeElement } = document;
4815
+ const actives = [activeElement];
4816
+
4817
+ while (activeElement?.shadowRoot?.activeElement) {
4818
+ activeElement = activeElement.shadowRoot.activeElement;
4819
+ actives.push(activeElement);
4820
+ }
4821
+
4822
+ return actives;
4823
+ }
4824
+
4825
+ /**
4826
+ * Sets `inert` on sibling elements of the dropdown's top-level host
4827
+ * so that content outside the dropdown is not interactive while the modal is open.
4828
+ * Walks up through shadow DOM boundaries to find the outermost host element
4829
+ * in the light DOM, then sets `inert` on that element's siblings.
4830
+ * @private
4831
+ */
4832
+ _setPageInert() {
4833
+ if (this._inertSiblings) {
4680
4834
  return;
4681
4835
  }
4682
4836
 
4683
- if (this.focusTrap) {
4684
- this.focusTrap.disconnect();
4685
- this.focusTrap = undefined;
4837
+ this._inertSiblings = [];
4838
+
4839
+ // Walk up through shadow DOM boundaries to find the topmost host
4840
+ // element in the light DOM. For example, if this dropdown is inside
4841
+ // auro-datepicker's shadow DOM, we walk up to the datepicker element
4842
+ // so we set inert on its siblings — not on the datepicker itself.
4843
+ let host = this;
4844
+ while (host.getRootNode() instanceof ShadowRoot) {
4845
+ host = host.getRootNode().host;
4846
+ }
4847
+
4848
+ const parent = host.parentElement;
4849
+
4850
+ if (parent) {
4851
+ for (const sibling of parent.children) {
4852
+ if (sibling !== host && !sibling.inert) {
4853
+ sibling.inert = true;
4854
+ this._inertSiblings.push(sibling);
4855
+ }
4856
+ }
4857
+ }
4858
+ }
4859
+
4860
+ /**
4861
+ * Restores `inert` state on siblings that were made inert by `_setPageInert`.
4862
+ * @private
4863
+ */
4864
+ _clearPageInert() {
4865
+ if (this._inertSiblings) {
4866
+ for (const sibling of this._inertSiblings) {
4867
+ sibling.inert = false;
4868
+ }
4869
+ this._inertSiblings = undefined;
4686
4870
  }
4687
4871
  }
4688
4872
 
@@ -4921,6 +5105,7 @@ class AuroDropdown extends AuroElement {
4921
5105
  shape="${this.shape}"
4922
5106
  ?data-show="${this.isPopoverVisible}"
4923
5107
  ?isfullscreen="${this.isBibFullscreen}"
5108
+ ?desktopmodal="${this.desktopModal}"
4924
5109
  .dialogLabel="${this.bibDialogLabel}"
4925
5110
  ${ref(this.bibElement)}
4926
5111
  >
@@ -36,6 +36,11 @@
36
36
  <body class="auro-markdown">
37
37
  <main></main>
38
38
 
39
+ <script type="module">
40
+ import { renderPage } from './demo-support.min.js';
41
+ await renderPage('./customize.md');
42
+ </script>
43
+
39
44
  <!-- If additional elements are needed for the demo, add them here. -->
40
45
  <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
41
46
  <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-nav@latest/+esm" type="module"></script>
@@ -44,11 +49,6 @@
44
49
  <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
45
50
  <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
46
51
 
47
- <script type="module" data-demo-script="true">
48
- import { renderPage } from './demo-support.min.js';
49
- await renderPage('./customize.md');
50
- import { initExamples } from "./customize.min.js";
51
- initExamples();
52
- </script>
52
+ <script src="./customize.min.js" data-demo-script="true" type="module"></script>
53
53
  </body>
54
54
  </html>
@@ -1,26 +1,9 @@
1
- /* eslint-disable jsdoc/require-jsdoc */
2
-
3
1
  import { AuroForm } from '../src/auro-form.js';
4
2
  import './registerDemoDeps.js';
5
3
  import { AuroInput } from '@aurodesignsystem/auro-input';
6
4
  import { AuroDatePicker } from '@aurodesignsystem/auro-datepicker';
7
- import { disabledExample } from '../apiExamples/disabled.js';
8
5
 
9
6
  AuroInput.register('input-two');
10
7
  AuroDatePicker.register();
11
8
  AuroForm.register();
12
9
  AuroForm.register('custom-form');
13
-
14
- export async function initExamples(initCount) {
15
- initCount = initCount || 0;
16
-
17
- try {
18
- await disabledExample();
19
- } catch (err) {
20
- if (initCount <= 20) {
21
- setTimeout(() => {
22
- initExamples(initCount + 1);
23
- }, 100);
24
- }
25
- }
26
- }
@@ -7,8 +7,6 @@
7
7
  <auro-anchorlink fluid href="#layout">Layout</auro-anchorlink>
8
8
  <auro-anchorlink fluid href="#columnLayout" class="level2 body-xs">Column Layout</auro-anchorlink>
9
9
  <auro-anchorlink fluid href="#complexForm" class="level2 body-xs">Complex Form</auro-anchorlink>
10
- <auro-anchorlink fluid href="#fieldState">Field State</auro-anchorlink>
11
- <auro-anchorlink fluid href="#disabledFields" class="level2 body-xs">Disabled Fields</auro-anchorlink>
12
10
  </auro-nav>
13
11
  </nav>
14
12
  <div class="mainContent">
@@ -26,14 +24,16 @@
26
24
  display: grid;
27
25
  grid-template-columns: 1fr 1fr;
28
26
  gap: 1rem;
29
- align-items: start;
30
27
  }
31
28
 
32
- .columned-form .span-2 {
33
- grid-column: span 2;
29
+ .columned-form div {
30
+ display: flex;
31
+ flex-direction: column;
32
+ padding: 1rem;
33
+ gap: 1rem;
34
34
  }
35
35
 
36
- .columned-form-controls {
36
+ .controls {
37
37
  display: flex;
38
38
  justify-content: flex-end;
39
39
  margin-top: 1rem;
@@ -41,25 +41,29 @@
41
41
  </style>
42
42
  <auro-form>
43
43
  <div class="columned-form">
44
- <auro-input id="cl-first-name" name="firstName" required>
45
- <span slot="label">First Name</span>
44
+ <div>
45
+ <auro-input id="search-box" name="searchBox" required>
46
+ <span slot="label">Search flights</span>
46
47
  </auro-input>
47
- <auro-input id="cl-last-name" name="lastName" required>
48
+ <auro-input id="last-name" name="lastName" required>
48
49
  <span slot="label">Last Name</span>
49
- </auro-input>
50
- <auro-input id="cl-email" name="email" type="email" class="span-2" required>
51
- <span slot="label">Email</span>
52
- </auro-input>
53
- <auro-datepicker id="cl-date-range" name="dateRange" class="span-2" required range>
54
- <span slot="fromLabel">Departure</span>
55
- <span slot="toLabel">Return</span>
56
- <span slot="bib.fullscreen.fromLabel">Departure</span>
57
- <span slot="bib.fullscreen.toLabel">Return</span>
50
+ </auro-input>
51
+ </div>
52
+ <div>
53
+ <div class="datepickerBlock">
54
+ <h4>Pick a date range</h4>
55
+ <auro-datepicker id="date-range" name="dateRange" required range>
56
+ <span slot="fromLabel">Start</span>
57
+ <span slot="toLabel">End</span>
58
+ <span slot="bib.fullscreen.fromLabel">Start</span>
59
+ <span slot="bib.fullscreen.toLabel">End</span>
58
60
  </auro-datepicker>
59
61
  </div>
60
- <div class="columned-form-controls">
62
+ <div class="controls">
61
63
  <auro-button type="submit">Submit</auro-button>
62
64
  </div>
65
+ </div>
66
+ </div>
63
67
  </auro-form>
64
68
  <!-- AURO-GENERATED-CONTENT:END -->
65
69
  </div>
@@ -72,14 +76,16 @@
72
76
  display: grid;
73
77
  grid-template-columns: 1fr 1fr;
74
78
  gap: 1rem;
75
- align-items: start;
76
79
  }
77
80
 
78
- .columned-form .span-2 {
79
- grid-column: span 2;
81
+ .columned-form div {
82
+ display: flex;
83
+ flex-direction: column;
84
+ padding: 1rem;
85
+ gap: 1rem;
80
86
  }
81
87
 
82
- .columned-form-controls {
88
+ .controls {
83
89
  display: flex;
84
90
  justify-content: flex-end;
85
91
  margin-top: 1rem;
@@ -87,24 +93,28 @@
87
93
  &lt;/style&gt;
88
94
  &lt;auro-form&gt;
89
95
  &lt;div class="columned-form"&gt;
90
- &lt;auro-input id="cl-first-name" name="firstName" required&gt;
91
- &lt;span slot="label"&gt;First Name&lt;/span&gt;
92
- &lt;/auro-input&gt;
93
- &lt;auro-input id="cl-last-name" name="lastName" required&gt;
94
- &lt;span slot="label"&gt;Last Name&lt;/span&gt;
95
- &lt;/auro-input&gt;
96
- &lt;auro-input id="cl-email" name="email" type="email" class="span-2" required&gt;
97
- &lt;span slot="label"&gt;Email&lt;/span&gt;
98
- &lt;/auro-input&gt;
99
- &lt;auro-datepicker id="cl-date-range" name="dateRange" class="span-2" required range&gt;
100
- &lt;span slot="fromLabel"&gt;Departure&lt;/span&gt;
101
- &lt;span slot="toLabel"&gt;Return&lt;/span&gt;
102
- &lt;span slot="bib.fullscreen.fromLabel"&gt;Departure&lt;/span&gt;
103
- &lt;span slot="bib.fullscreen.toLabel"&gt;Return&lt;/span&gt;
104
- &lt;/auro-datepicker&gt;
105
- &lt;/div&gt;
106
- &lt;div class="columned-form-controls"&gt;
107
- &lt;auro-button type="submit"&gt;Submit&lt;/auro-button&gt;
96
+ &lt;div&gt;
97
+ &lt;auro-input id="search-box" name="searchBox" required&gt;
98
+ &lt;span slot="label"&gt;Search flights&lt;/span&gt;
99
+ &lt;/auro-input&gt;
100
+ &lt;auro-input id="last-name" name="lastName" required&gt;
101
+ &lt;span slot="label"&gt;Last Name&lt;/span&gt;
102
+ &lt;/auro-input&gt;
103
+ &lt;/div&gt;
104
+ &lt;div&gt;
105
+ &lt;div class="datepickerBlock"&gt;
106
+ &lt;h4&gt;Pick a date range&lt;/h4&gt;
107
+ &lt;auro-datepicker id="date-range" name="dateRange" required range&gt;
108
+ &lt;span slot="fromLabel"&gt;Start&lt;/span&gt;
109
+ &lt;span slot="toLabel"&gt;End&lt;/span&gt;
110
+ &lt;span slot="bib.fullscreen.fromLabel"&gt;Start&lt;/span&gt;
111
+ &lt;span slot="bib.fullscreen.toLabel"&gt;End&lt;/span&gt;
112
+ &lt;/auro-datepicker&gt;
113
+ &lt;/div&gt;
114
+ &lt;div class="controls"&gt;
115
+ &lt;auro-button type="submit"&gt;Submit&lt;/auro-button&gt;
116
+ &lt;/div&gt;
117
+ &lt;/div&gt;
108
118
  &lt;/div&gt;
109
119
  &lt;/auro-form&gt;</code></pre>
110
120
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -231,90 +241,6 @@
231
241
  <!-- AURO-GENERATED-CONTENT:END -->
232
242
  </auro-accordion>
233
243
  </section>
234
- <section>
235
- <auro-header level="2" id="fieldState">Field State</auro-header>
236
- <p>Per the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/disabled">HTML spec</a>, form controls with the <code>disabled</code> attribute are excluded from form submission and are not validated. <code>auro-form</code> mirrors that behavior.</p>
237
- <auro-header level="3" id="disabledFields">Disabled Fields</auro-header>
238
- <p>When a child form element has the <code>disabled</code> attribute:</p>
239
- <ul>
240
- <li>Its <code>name</code> is omitted from <code>form.value</code> and from the <code>submit</code> event's <code>detail.value</code>, even if the element carries a value.</li>
241
- <li>It does not contribute to <code>validity</code> — a disabled <code>required</code> field will not block submission.</li>
242
- <li>It does not taint <code>isInitialState</code> — a disabled field carrying a preset value still leaves the form in its initial state.</li>
243
- </ul>
244
- <p><strong>Behavior change:</strong> a form whose only invalid field was a <code>disabled</code> AND <code>required</code> field is now submittable, where previously it would have been blocked. If you were using <code>disabled</code> on a populated field to carry a value through to submission (for example, a read-only account number or a preset reference id), switch that field to <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/hidden"><code>&lt;input type="hidden"&gt;</code></a> — hidden inputs are submitted with the form even though they are not interactive, which is the native pattern for "include this value, but don't show or validate it."</p>
245
- <p>In the example below the Mileage Plan number is preset and disabled. Fill in the remaining required fields and submit the form — the output region below the form will show the contents of the <code>submit</code> event's <code>detail.value</code>. Notice that only <code>firstName</code> and <code>lastName</code> appear; <code>loyaltyNumber</code> is omitted even though the field has a value.</p>
246
- <div class="exampleWrapper">
247
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
248
- <!-- The below content is automatically added from ./../apiExamples/disabled.html -->
249
- <auro-form id="disabledExampleForm">
250
- <auro-input id="first-name" name="firstName" required>
251
- <span slot="label">First Name</span>
252
- </auro-input>
253
- <br />
254
- <auro-input id="last-name" name="lastName" required>
255
- <span slot="label">Last Name</span>
256
- </auro-input>
257
- <br />
258
- <auro-input id="loyalty-number" name="loyaltyNumber" value="AS-123456" disabled>
259
- <span slot="label">Mileage Plan number</span>
260
- <span slot="helpText">Account number is read-only and is not submitted with the form.</span>
261
- </auro-input>
262
- <br />
263
- <auro-button type="submit">Submit</auro-button>
264
- </auro-form>
265
- <output id="disabledExampleOutput" form="disabledExampleForm" aria-live="polite">Submit the form to see what data gets stored.</output>
266
- <style>
267
- #disabledExampleOutput {
268
- display: block;
269
- margin-top: 2rem;
270
- padding: 1rem 1.25rem;
271
- border-left: 4px solid #2a2a2a;
272
- border-radius: 0.25rem;
273
- background: #f5f5f5;
274
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
275
- font-size: 0.875rem;
276
- white-space: pre-wrap;
277
- }
278
- </style>
279
- <!-- AURO-GENERATED-CONTENT:END -->
280
- </div>
281
- <auro-accordion alignRight>
282
- <span slot="trigger">See code</span>
283
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
284
- <!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
285
- <pre class="language-html"><code class="language-html">&lt;auro-form id="disabledExampleForm"&gt;
286
- &lt;auro-input id="first-name" name="firstName" required&gt;
287
- &lt;span slot="label"&gt;First Name&lt;/span&gt;
288
- &lt;/auro-input&gt;
289
- &lt;br /&gt;
290
- &lt;auro-input id="last-name" name="lastName" required&gt;
291
- &lt;span slot="label"&gt;Last Name&lt;/span&gt;
292
- &lt;/auro-input&gt;
293
- &lt;br /&gt;
294
- &lt;auro-input id="loyalty-number" name="loyaltyNumber" value="AS-123456" disabled&gt;
295
- &lt;span slot="label"&gt;Mileage Plan number&lt;/span&gt;
296
- &lt;span slot="helpText"&gt;Account number is read-only and is not submitted with the form.&lt;/span&gt;
297
- &lt;/auro-input&gt;
298
- &lt;br /&gt;
299
- &lt;auro-button type="submit"&gt;Submit&lt;/auro-button&gt;
300
- &lt;/auro-form&gt;
301
- &lt;output id="disabledExampleOutput" form="disabledExampleForm" aria-live="polite"&gt;Submit the form to see what data gets stored.&lt;/output&gt;
302
- &lt;style&gt;
303
- #disabledExampleOutput {
304
- display: block;
305
- margin-top: 2rem;
306
- padding: 1rem 1.25rem;
307
- border-left: 4px solid #2a2a2a;
308
- border-radius: 0.25rem;
309
- background: #f5f5f5;
310
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
311
- font-size: 0.875rem;
312
- white-space: pre-wrap;
313
- }
314
- &lt;/style&gt;</code></pre>
315
- <!-- AURO-GENERATED-CONTENT:END -->
316
- </auro-accordion>
317
- </section>
318
244
  </div>
319
245
  </div>
320
246
  </div>