@aurodesignsystem-dev/auro-formkit 0.0.0-pr1594.2 → 0.0.0-pr1595.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 +11 -0
  2. package/components/bibtemplate/dist/index.js +13 -0
  3. package/components/bibtemplate/dist/registered.js +13 -0
  4. package/components/checkbox/demo/api.md +17 -11
  5. package/components/checkbox/demo/customize.min.js +23 -6
  6. package/components/checkbox/demo/getting-started.min.js +23 -6
  7. package/components/checkbox/demo/index.min.js +23 -6
  8. package/components/checkbox/dist/auro-checkbox-group.d.ts +8 -0
  9. package/components/checkbox/dist/auro-checkbox.d.ts +4 -0
  10. package/components/checkbox/dist/index.js +23 -6
  11. package/components/checkbox/dist/registered.js +23 -6
  12. package/components/combobox/demo/api.md +24 -16
  13. package/components/combobox/demo/customize.min.js +405 -121
  14. package/components/combobox/demo/getting-started.min.js +405 -121
  15. package/components/combobox/demo/index.min.js +405 -121
  16. package/components/combobox/dist/auro-combobox.d.ts +29 -0
  17. package/components/combobox/dist/index.js +320 -107
  18. package/components/combobox/dist/registered.js +320 -107
  19. package/components/counter/demo/api.md +33 -15
  20. package/components/counter/demo/customize.min.js +201 -64
  21. package/components/counter/demo/index.min.js +201 -64
  22. package/components/counter/dist/auro-counter-button.d.ts +4 -0
  23. package/components/counter/dist/auro-counter-group.d.ts +23 -0
  24. package/components/counter/dist/auro-counter.d.ts +7 -0
  25. package/components/counter/dist/index.js +201 -64
  26. package/components/counter/dist/registered.js +201 -64
  27. package/components/datepicker/demo/api.md +55 -49
  28. package/components/datepicker/demo/customize.min.js +483 -131
  29. package/components/datepicker/demo/index.min.js +483 -131
  30. package/components/datepicker/dist/auro-calendar-cell.d.ts +55 -0
  31. package/components/datepicker/dist/auro-calendar-month.d.ts +9 -1
  32. package/components/datepicker/dist/auro-calendar.d.ts +16 -0
  33. package/components/datepicker/dist/auro-datepicker.d.ts +63 -10
  34. package/components/datepicker/dist/index.js +483 -131
  35. package/components/datepicker/dist/registered.js +483 -131
  36. package/components/dropdown/demo/api.md +25 -22
  37. package/components/dropdown/demo/customize.min.js +106 -37
  38. package/components/dropdown/demo/getting-started.min.js +232 -79
  39. package/components/dropdown/demo/index.min.js +106 -37
  40. package/components/dropdown/dist/auro-dropdown.d.ts +33 -4
  41. package/components/dropdown/dist/auro-dropdownBib.d.ts +17 -5
  42. package/components/dropdown/dist/index.js +106 -37
  43. package/components/dropdown/dist/registered.js +106 -37
  44. package/components/form/demo/customize.min.js +1448 -455
  45. package/components/form/demo/getting-started.min.js +1448 -455
  46. package/components/form/demo/index.min.js +1448 -455
  47. package/components/form/demo/registerDemoDeps.min.js +1448 -455
  48. package/components/helptext/dist/auro-helptext.d.ts +8 -7
  49. package/components/helptext/dist/index.js +7 -2
  50. package/components/helptext/dist/registered.js +7 -2
  51. package/components/input/demo/api.md +30 -30
  52. package/components/input/demo/customize.min.js +126 -42
  53. package/components/input/demo/getting-started.min.js +126 -42
  54. package/components/input/demo/index.min.js +126 -42
  55. package/components/input/dist/base-input.d.ts +67 -22
  56. package/components/input/dist/index.js +126 -42
  57. package/components/input/dist/registered.js +126 -42
  58. package/components/layoutElement/dist/auroElement.d.ts +10 -17
  59. package/components/layoutElement/dist/index.js +20 -20
  60. package/components/layoutElement/dist/registered.js +20 -20
  61. package/components/menu/demo/api.md +30 -27
  62. package/components/menu/demo/index.min.js +105 -34
  63. package/components/menu/dist/auro-menu.d.ts +24 -13
  64. package/components/menu/dist/auro-menuoption.d.ts +26 -0
  65. package/components/menu/dist/index.js +105 -34
  66. package/components/menu/dist/registered.js +105 -34
  67. package/components/radio/demo/api.md +8 -7
  68. package/components/radio/demo/customize.min.js +20 -7
  69. package/components/radio/demo/getting-started.min.js +20 -7
  70. package/components/radio/demo/index.min.js +20 -7
  71. package/components/radio/dist/auro-radio-group.d.ts +7 -0
  72. package/components/radio/dist/auro-radio.d.ts +1 -0
  73. package/components/radio/dist/index.js +20 -7
  74. package/components/radio/dist/registered.js +20 -7
  75. package/components/select/demo/api.md +18 -15
  76. package/components/select/demo/customize.min.js +255 -78
  77. package/components/select/demo/getting-started.min.js +255 -78
  78. package/components/select/demo/index.min.js +255 -78
  79. package/components/select/dist/auro-select.d.ts +17 -0
  80. package/components/select/dist/index.js +170 -64
  81. package/components/select/dist/registered.js +170 -64
  82. package/custom-elements.json +2573 -2680
  83. package/package.json +1 -1
@@ -7,32 +7,35 @@ The `auro-menu` element provides users a way to select from a list of options.
7
7
 
8
8
  ## Properties
9
9
 
10
- | Property | Attribute | Modifiers | Type | Default | Description |
11
- |-------------------------|---------------|-----------|-----------------------|-------------|--------------------------------------------------|
12
- | `currentLabel` | | readonly | `string` | | |
13
- | `disabled` | `disabled` | | `boolean` | | When true, the entire menu and all options are disabled. |
14
- | `hasLoadingPlaceholder` | | readonly | `boolean` | | Getter for loading placeholder state. |
15
- | `index` | | | `number` | | |
16
- | `layout` | | | `string` | | |
17
- | `loading` | `loading` | | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
18
- | `matchWord` | `matchword` | | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
19
- | `multiSelect` | `multiselect` | | `boolean` | false | When true, the selected option can be multiple options. |
20
- | `noCheckmark` | `nocheckmark` | | `boolean` | false | When true, selected option will not show the checkmark. |
21
- | `optionActive` | | | `object` | "undefined" | Specifies the current active menuOption. |
22
- | `optionSelected` | | | `object` | "undefined" | The currently selected menu option(s). In single-select mode this is a single `HTMLElement` (or `undefined` when nothing is selected). In multi-select mode this is an array of `HTMLElement`s. |
23
- | `options` | | readonly | `HTMLElement[]` | | |
24
- | `selectedOption` | | readonly | `HTMLElement \| null` | | Gets the first selected option, or null if none. |
25
- | `selectedOptions` | | readonly | `HTMLElement[]` | | Gets the currently selected options as an array. |
26
- | `value` | `value` | | `string` | "undefined" | The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.<br />Options marked `disabled` or `static` are not selectable by value; `hidden` options remain selectable. In single-select mode, if the value matches a non-selectable option the selection is cleared (`optionSelected` becomes `undefined`) and `auroMenu-selectValueFailure` is dispatched. In multi-select mode, non-selectable entries are dropped from the value and the remaining selectable entries are selected; `auroMenu-selectValueFailure` is dispatched only when none of the entries match a selectable option. |
10
+ | Property | Attribute | Modifiers | Type | Default | Description |
11
+ |-------------------------|---------------|-----------|----------------------------------------|-------------|--------------------------------------------------|
12
+ | `currentLabel` | | readonly | `string` | | |
13
+ | `disabled` | `disabled` | | `boolean` | | When true, the entire menu and all options are disabled. |
14
+ | `hasLoadingPlaceholder` | | readonly | `boolean` | | Getter for loading placeholder state. |
15
+ | `index` | | | `number` | | |
16
+ | `layout` | `layout` | | `string` | | Applies a named layout variant to the menu. Free-form string consumed by the shared architecture helpers; menu defines no closed value set. |
17
+ | `loading` | `loading` | | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
18
+ | `matchWord` | `matchword` | | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
19
+ | `multiSelect` | `multiselect` | | `boolean` | false | When true, the selected option can be multiple options. |
20
+ | `noCheckmark` | `nocheckmark` | | `boolean` | false | When true, selected option will not show the checkmark. |
21
+ | `optionActive` | | | `object` | "undefined" | Specifies the current active menuOption. |
22
+ | `optionSelected` | | | `object` | "undefined" | The currently selected menu option(s). In single-select mode this is a single `HTMLElement` (or `undefined` when nothing is selected). In multi-select mode this is an array of `HTMLElement`s. |
23
+ | `options` | | readonly | `HTMLElement[]` | | |
24
+ | `selectedOption` | | readonly | `HTMLElement \| null` | | Gets the first selected option, or null if none. |
25
+ | `selectedOptions` | | readonly | `HTMLElement[]` | | Gets the currently selected options as an array. |
26
+ | `shape` | `shape` | | `'box' \| 'pill' \| 'snowflake'` | "'box'" | Sets the shape of the menu options. |
27
+ | `size` | `size` | | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | "'sm'" | Sets the size of the menu options. |
28
+ | `value` | `value` | | `string` | "undefined" | The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.<br />Options marked `disabled` or `static` are not selectable by value; `hidden` options remain selectable. In single-select mode, if the value matches a non-selectable option the selection is cleared (`optionSelected` becomes `undefined`) and `auroMenu-selectValueFailure` is dispatched. In multi-select mode, non-selectable entries are dropped from the value and the remaining selectable entries are selected; `auroMenu-selectValueFailure` is dispatched only when none of the entries match a selectable option. |
27
29
 
28
30
  ## Methods
29
31
 
30
- | Method | Type | Description |
31
- |----------------------|--------------------------------------------------|--------------------------------------------------|
32
- | `navigateOptions` | `(direction: string): void` | Navigates through options using keyboard.<br /><br />**direction**: 'up' or 'down'. |
33
- | `reset` | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
34
- | `selectByValue` | `(value: string \| string[] \| null \| undefined): void` | Selects options by value. Options marked `disabled` or `static` are not selectable; `hidden` options remain selectable. In single-select mode, if the value matches a non-selectable option the selection is cleared and `auroMenu-selectValueFailure` is dispatched. In multi-select mode, non-selectable entries are dropped and the remaining selectable entries are selected; `auroMenu-selectValueFailure` is dispatched only when none of the entries match a selectable option. Passing `undefined`, `null`, an empty string, or an empty array clears the selection without dispatching a failure.<br /><br />**value**: The value(s) to select. |
35
- | `updateActiveOption` | `(indexOrOption: number \| HTMLElement): void` | Updates the active option state and dispatches events.<br />Accepts either a numeric index or an HTMLElement option.<br /><br />**indexOrOption**: Index of the option or the option element to make active. |
32
+ | Method | Type | Description |
33
+ |----------------------------------|--------------------------------------------------|--------------------------------------------------|
34
+ | `initializeArchitectureDefaults` | `(): void` | |
35
+ | `navigateOptions` | `(direction: string): void` | Navigates through options using keyboard.<br /><br />**direction**: 'up' or 'down'. |
36
+ | `reset` | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
37
+ | `selectByValue` | `(value: string \| string[] \| null \| undefined): void` | Selects options by value. Options marked `disabled` or `static` are not selectable; `hidden` options remain selectable. In single-select mode, if the value matches a non-selectable option the selection is cleared and `auroMenu-selectValueFailure` is dispatched. In multi-select mode, non-selectable entries are dropped and the remaining selectable entries are selected; `auroMenu-selectValueFailure` is dispatched only when none of the entries match a selectable option. Passing `undefined`, `null`, an empty string, or an empty array clears the selection without dispatching a failure.<br /><br />**value**: The value(s) to select. |
38
+ | `updateActiveOption` | `(indexOrOption: number \| HTMLElement): void` | Updates the active option state and dispatches events.<br />Accepts either a numeric index or an HTMLElement option.<br /><br />**indexOrOption**: Index of the option or the option element to make active. |
36
39
 
37
40
  ## Events
38
41
 
@@ -41,7 +44,7 @@ The `auro-menu` element provides users a way to select from a list of options.
41
44
  | `auroMenu-activatedOption` | `CustomEvent<Element>` | Notifies that a menuoption has been made `active`. |
42
45
  | `auroMenu-customEventFired` | `CustomEvent<any>` | Notifies that a custom event has been fired. |
43
46
  | `auroMenu-loadingChange` | `CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>` | Notifies when the loading attribute is changed. |
44
- | `auroMenu-optionsChange` | `CustomEvent<{ options: Element[] \| undefined; }>` | |
47
+ | `auroMenu-optionsChange` | `CustomEvent<{ options: Array }>` | Notifies that the set of available menu options has changed. |
45
48
  | `auroMenu-selectValueFailure` | `CustomEvent<any>` | Notifies that an attempt to select a menuoption by matching a value has failed. |
46
49
  | `auroMenu-selectValueReset` | `CustomEvent<any>` | Notifies that the component value has been reset. |
47
50
  | `auroMenu-selectedOption` | `CustomEvent<any>` | Notifies that a new menuoption selection has been made. |
@@ -68,15 +71,15 @@ The `auro-menuoption` element provides users a way to define a menu option.
68
71
 
69
72
  | Property | Attribute | Modifiers | Type | Default | Description |
70
73
  |---------------|---------------|-----------|-----------|---------|--------------------------------------------------|
71
- | `disabled` | `disabled` | | `boolean` | false | |
74
+ | `disabled` | `disabled` | | `boolean` | false | When true, the option is disabled and cannot be selected. |
72
75
  | `iconTag` | | | | | |
73
76
  | `isActive` | | readonly | `boolean` | | Returns whether the menu option is currently active and selectable. |
74
77
  | `layout` | | | `string` | | |
75
- | `noCheckmark` | `noCheckmark` | | `boolean` | false | |
78
+ | `noCheckmark` | `nocheckmark` | | `boolean` | false | When true, this option will not show the checkmark when selected. |
76
79
  | `noMatch` | `nomatch` | | `boolean` | false | When true, marks this option as the "no matching results" placeholder shown by combobox<br />when the user's input does not match any available options. |
77
80
  | `persistent` | `persistent` | | `boolean` | false | When true, this option is excluded from `matchWord` DOM rewriting — useful for utility rows (e.g., "Add new…") that must render identically regardless of the current filter. |
78
81
  | `selected` | `selected` | | `boolean` | false | **Deprecated.** Use the `value` attribute on `auro-menu` to set the selected option when the menu renders (or call `menu.selectByValue(value)` programmatically). Support for the child-level `selected` attribute will be removed in a future major release. |
79
- | `value` | `value` | | `string` | | |
82
+ | `value` | `value` | | `string` | | The value associated with this menu option. |
80
83
 
81
84
  ## Methods
82
85
 
@@ -30,37 +30,37 @@ var colorCss$1 = i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-div
30
30
 
31
31
  var tokensCss = i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
32
32
 
33
+ /**
34
+ * AuroElement is the shared base class for layout-aware Auro form components.
35
+ *
36
+ * It defines the common `layout`, `shape`, `size`, and `ondark` reactive
37
+ * properties and the architecture helpers (`renderLayout`, `resetShapeClasses`,
38
+ * `resetLayoutClasses`) that subclasses use to render a chosen layout and apply
39
+ * the matching `shape-*` / `layout-*` wrapper classes. Subclasses supply their
40
+ * own default and valid value set for `layout`, `shape`, and `size`.
41
+ */
33
42
  class AuroElement extends i$2 {
34
43
  static get properties() {
35
44
  return {
36
45
 
37
46
  /**
38
- * Defines the language of an element.
39
- * @default {'default'}
47
+ * When true, renders the component styled for use on a dark background.
40
48
  */
41
- layout: {
42
- type: String,
43
- attribute: "layout",
44
- reflect: true
45
- },
46
-
47
- shape: {
48
- type: String,
49
- attribute: "shape",
50
- reflect: true
51
- },
52
-
53
- size: {
54
- type: String,
55
- attribute: "size",
56
- reflect: true
57
- },
58
-
59
49
  onDark: {
60
50
  type: Boolean,
61
51
  attribute: "ondark",
62
52
  reflect: true
63
53
  }
54
+
55
+ // NOTE: `layout`, `shape`, and `size` are intentionally NOT declared here.
56
+ // Their valid value sets differ per component, and the CEM analyzer roots
57
+ // an inherited property's `type` in the class that declares it — a base
58
+ // declaration would force every subclass's `@type` to be discarded and
59
+ // emitted as plain `string`. Each subclass declares its own `layout` /
60
+ // `shape` / `size` with an exact `@type` union instead. AuroElement still
61
+ // consumes `this.layout` / `this.shape` / `this.size` in its render and
62
+ // architecture helpers below (subclasses guarantee the reactive props).
63
+ // See AlaskaAirlines/discussions#653.
64
64
  };
65
65
  }
66
66
 
@@ -423,6 +423,7 @@ let menuInstanceIdCounter = 0;
423
423
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
424
424
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
425
425
  * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
426
+ * @event {CustomEvent<{ options: Array }>} auroMenu-optionsChange - Notifies that the set of available menu options has changed.
426
427
  * @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
427
428
  * @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
428
429
  * @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
@@ -437,15 +438,7 @@ class AuroMenu extends AuroElement {
437
438
 
438
439
  // State properties (reactive)
439
440
 
440
- /**
441
- * @private
442
- */
443
- this.shape = "box";
444
-
445
- /**
446
- * @private
447
- */
448
- this.size = "sm";
441
+ this.initializeArchitectureDefaults();
449
442
 
450
443
  // Value of the selected options
451
444
  this.value = undefined;
@@ -486,8 +479,6 @@ class AuroMenu extends AuroElement {
486
479
 
487
480
  // Instance properties (non-reactive)
488
481
 
489
- menuInstanceIdCounter += 1;
490
-
491
482
  Object.assign(this, {
492
483
  // Root-level menu (true) or a nested submenu (false)
493
484
  rootMenu: true,
@@ -499,7 +490,7 @@ class AuroMenu extends AuroElement {
499
490
  loadingSlots: null,
500
491
  // Unique id for this menu instance; prefixes every auto-generated option
501
492
  // key so keys never collide across menus in the same document.
502
- _menuInstanceId: `menu-${menuInstanceIdCounter}`,
493
+ _menuInstanceId: `menu-${menuInstanceIdCounter += 1}`,
503
494
  // Monotonically increasing counter for option key generation. Never
504
495
  // resets, so a key is never reused within this instance's lifetime.
505
496
  _optionKeyCounter: 0,
@@ -515,10 +506,50 @@ class AuroMenu extends AuroElement {
515
506
  });
516
507
  }
517
508
 
509
+ // Defaults for the layout/shape/size architecture props are set in a helper
510
+ // (not the constructor body) so the CEM analyzer keeps their `@type` unions
511
+ // instead of inferring `string` from a constructor-literal assignment.
512
+ // See AlaskaAirlines/discussions#653.
513
+ initializeArchitectureDefaults() {
514
+ this.shape = "box";
515
+ this.size = "sm";
516
+ }
517
+
518
518
  static get properties() {
519
519
  return {
520
520
  ...super.properties,
521
521
 
522
+ /**
523
+ * Applies a named layout variant to the menu. Free-form string consumed by the shared architecture helpers; menu defines no closed value set.
524
+ */
525
+ layout: {
526
+ type: String,
527
+ attribute: "layout",
528
+ reflect: true
529
+ },
530
+
531
+ /**
532
+ * Sets the shape of the menu options.
533
+ * @type {'box' | 'pill' | 'snowflake'}
534
+ * @default 'box'
535
+ */
536
+ shape: {
537
+ type: String,
538
+ attribute: "shape",
539
+ reflect: true
540
+ },
541
+
542
+ /**
543
+ * Sets the size of the menu options.
544
+ * @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
545
+ * @default 'sm'
546
+ */
547
+ size: {
548
+ type: String,
549
+ attribute: "size",
550
+ reflect: true
551
+ },
552
+
522
553
  /**
523
554
  * When true, the entire menu and all options are disabled.
524
555
  */
@@ -1853,9 +1884,36 @@ class AuroMenuOption extends AuroElement {
1853
1884
  static get properties() {
1854
1885
  return {
1855
1886
  ...super.properties,
1887
+
1888
+ /**
1889
+ * Sets the shape of the option. When unset, it inherits the shape of the parent `auro-menu`.
1890
+ * @type {'box' | 'pill' | 'snowflake'}
1891
+ * @default 'box'
1892
+ */
1893
+ shape: {
1894
+ type: String,
1895
+ attribute: "shape",
1896
+ reflect: true
1897
+ },
1898
+
1899
+ /**
1900
+ * Sets the size of the option. When unset, it inherits the size of the parent `auro-menu`.
1901
+ * @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
1902
+ * @default 'sm'
1903
+ */
1904
+ size: {
1905
+ type: String,
1906
+ attribute: "size",
1907
+ reflect: true
1908
+ },
1909
+
1910
+ /**
1911
+ * When true, this option will not show the checkmark when selected.
1912
+ */
1856
1913
  noCheckmark: {
1857
1914
  type: Boolean,
1858
- reflect: true
1915
+ reflect: true,
1916
+ attribute: 'nocheckmark'
1859
1917
  },
1860
1918
 
1861
1919
  /**
@@ -1867,17 +1925,30 @@ class AuroMenuOption extends AuroElement {
1867
1925
  type: Boolean,
1868
1926
  reflect: true
1869
1927
  },
1928
+
1929
+ /**
1930
+ * When true, the option is disabled and cannot be selected.
1931
+ */
1870
1932
  disabled: {
1871
1933
  type: Boolean,
1872
1934
  reflect: true
1873
1935
  },
1936
+
1937
+ /**
1938
+ * The value associated with this menu option.
1939
+ */
1874
1940
  value: {
1875
1941
  type: String,
1876
1942
  reflect: true
1877
1943
  },
1944
+
1945
+ /**
1946
+ * Sets the tab order of the menu option.
1947
+ */
1878
1948
  tabIndex: {
1879
1949
  type: Number,
1880
- reflect: true
1950
+ reflect: true,
1951
+ attribute: 'tabindex'
1881
1952
  },
1882
1953
 
1883
1954
  /**
@@ -5,6 +5,7 @@
5
5
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
6
6
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
7
7
  * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
8
+ * @event {CustomEvent<{ options: Array }>} auroMenu-optionsChange - Notifies that the set of available menu options has changed.
8
9
  * @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
9
10
  * @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
10
11
  * @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
@@ -14,6 +15,26 @@
14
15
  */
15
16
  export class AuroMenu extends AuroElement {
16
17
  static get properties(): {
18
+ /**
19
+ * Applies a named layout variant to the menu. Free-form string consumed by the shared architecture helpers; menu defines no closed value set.
20
+ */
21
+ layout: {
22
+ type: StringConstructor;
23
+ attribute: string;
24
+ reflect: boolean;
25
+ };
26
+ /**
27
+ * Sets the shape of the menu options.
28
+ * @type {'box' | 'pill' | 'snowflake'}
29
+ * @default 'box'
30
+ */
31
+ shape: "box" | "pill" | "snowflake";
32
+ /**
33
+ * Sets the size of the menu options.
34
+ * @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
35
+ * @default 'sm'
36
+ */
37
+ size: "xs" | "sm" | "md" | "lg" | "xl";
17
38
  /**
18
39
  * When true, the entire menu and all options are disabled.
19
40
  */
@@ -77,11 +98,6 @@ export class AuroMenu extends AuroElement {
77
98
  reflect: boolean;
78
99
  attribute: string;
79
100
  };
80
- layout: {
81
- type: StringConstructor;
82
- attribute: string;
83
- reflect: boolean;
84
- };
85
101
  };
86
102
  static get styles(): import("lit").CSSResult[];
87
103
  /**
@@ -93,14 +109,6 @@ export class AuroMenu extends AuroElement {
93
109
  *
94
110
  */
95
111
  static register(name?: string): void;
96
- /**
97
- * @private
98
- */
99
- private shape;
100
- /**
101
- * @private
102
- */
103
- private size;
104
112
  value: any;
105
113
  optionSelected: any;
106
114
  matchWord: any;
@@ -131,6 +139,9 @@ export class AuroMenu extends AuroElement {
131
139
  * @private
132
140
  */
133
141
  private handleSlotChange;
142
+ initializeArchitectureDefaults(): void;
143
+ shape: string | undefined;
144
+ size: string | undefined;
134
145
  /**
135
146
  * @readonly
136
147
  * @returns {Array<HTMLElement>} - Returns the array of available menu options.
@@ -10,9 +10,25 @@
10
10
  */
11
11
  export class AuroMenuOption extends AuroElement {
12
12
  static get properties(): {
13
+ /**
14
+ * Sets the shape of the option. When unset, it inherits the shape of the parent `auro-menu`.
15
+ * @type {'box' | 'pill' | 'snowflake'}
16
+ * @default 'box'
17
+ */
18
+ shape: "box" | "pill" | "snowflake";
19
+ /**
20
+ * Sets the size of the option. When unset, it inherits the size of the parent `auro-menu`.
21
+ * @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
22
+ * @default 'sm'
23
+ */
24
+ size: "xs" | "sm" | "md" | "lg" | "xl";
25
+ /**
26
+ * When true, this option will not show the checkmark when selected.
27
+ */
13
28
  noCheckmark: {
14
29
  type: BooleanConstructor;
15
30
  reflect: boolean;
31
+ attribute: string;
16
32
  };
17
33
  /**
18
34
  * **Deprecated.** Use the `value` attribute on `auro-menu` to set the selected option when the menu renders (or call `menu.selectByValue(value)` programmatically). Support for the child-level `selected` attribute will be removed in a future major release.
@@ -23,17 +39,27 @@ export class AuroMenuOption extends AuroElement {
23
39
  type: BooleanConstructor;
24
40
  reflect: boolean;
25
41
  };
42
+ /**
43
+ * When true, the option is disabled and cannot be selected.
44
+ */
26
45
  disabled: {
27
46
  type: BooleanConstructor;
28
47
  reflect: boolean;
29
48
  };
49
+ /**
50
+ * The value associated with this menu option.
51
+ */
30
52
  value: {
31
53
  type: StringConstructor;
32
54
  reflect: boolean;
33
55
  };
56
+ /**
57
+ * Sets the tab order of the menu option.
58
+ */
34
59
  tabIndex: {
35
60
  type: NumberConstructor;
36
61
  reflect: boolean;
62
+ attribute: string;
37
63
  };
38
64
  /**
39
65
  * @private
@@ -9,37 +9,37 @@ var colorCss$1 = css`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-div
9
9
 
10
10
  var tokensCss = css`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
11
11
 
12
+ /**
13
+ * AuroElement is the shared base class for layout-aware Auro form components.
14
+ *
15
+ * It defines the common `layout`, `shape`, `size`, and `ondark` reactive
16
+ * properties and the architecture helpers (`renderLayout`, `resetShapeClasses`,
17
+ * `resetLayoutClasses`) that subclasses use to render a chosen layout and apply
18
+ * the matching `shape-*` / `layout-*` wrapper classes. Subclasses supply their
19
+ * own default and valid value set for `layout`, `shape`, and `size`.
20
+ */
12
21
  class AuroElement extends LitElement {
13
22
  static get properties() {
14
23
  return {
15
24
 
16
25
  /**
17
- * Defines the language of an element.
18
- * @default {'default'}
26
+ * When true, renders the component styled for use on a dark background.
19
27
  */
20
- layout: {
21
- type: String,
22
- attribute: "layout",
23
- reflect: true
24
- },
25
-
26
- shape: {
27
- type: String,
28
- attribute: "shape",
29
- reflect: true
30
- },
31
-
32
- size: {
33
- type: String,
34
- attribute: "size",
35
- reflect: true
36
- },
37
-
38
28
  onDark: {
39
29
  type: Boolean,
40
30
  attribute: "ondark",
41
31
  reflect: true
42
32
  }
33
+
34
+ // NOTE: `layout`, `shape`, and `size` are intentionally NOT declared here.
35
+ // Their valid value sets differ per component, and the CEM analyzer roots
36
+ // an inherited property's `type` in the class that declares it — a base
37
+ // declaration would force every subclass's `@type` to be discarded and
38
+ // emitted as plain `string`. Each subclass declares its own `layout` /
39
+ // `shape` / `size` with an exact `@type` union instead. AuroElement still
40
+ // consumes `this.layout` / `this.shape` / `this.size` in its render and
41
+ // architecture helpers below (subclasses guarantee the reactive props).
42
+ // See AlaskaAirlines/discussions#653.
43
43
  };
44
44
  }
45
45
 
@@ -430,6 +430,7 @@ let menuInstanceIdCounter = 0;
430
430
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
431
431
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
432
432
  * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
433
+ * @event {CustomEvent<{ options: Array }>} auroMenu-optionsChange - Notifies that the set of available menu options has changed.
433
434
  * @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
434
435
  * @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
435
436
  * @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
@@ -444,15 +445,7 @@ class AuroMenu extends AuroElement {
444
445
 
445
446
  // State properties (reactive)
446
447
 
447
- /**
448
- * @private
449
- */
450
- this.shape = "box";
451
-
452
- /**
453
- * @private
454
- */
455
- this.size = "sm";
448
+ this.initializeArchitectureDefaults();
456
449
 
457
450
  // Value of the selected options
458
451
  this.value = undefined;
@@ -493,8 +486,6 @@ class AuroMenu extends AuroElement {
493
486
 
494
487
  // Instance properties (non-reactive)
495
488
 
496
- menuInstanceIdCounter += 1;
497
-
498
489
  Object.assign(this, {
499
490
  // Root-level menu (true) or a nested submenu (false)
500
491
  rootMenu: true,
@@ -506,7 +497,7 @@ class AuroMenu extends AuroElement {
506
497
  loadingSlots: null,
507
498
  // Unique id for this menu instance; prefixes every auto-generated option
508
499
  // key so keys never collide across menus in the same document.
509
- _menuInstanceId: `menu-${menuInstanceIdCounter}`,
500
+ _menuInstanceId: `menu-${menuInstanceIdCounter += 1}`,
510
501
  // Monotonically increasing counter for option key generation. Never
511
502
  // resets, so a key is never reused within this instance's lifetime.
512
503
  _optionKeyCounter: 0,
@@ -522,10 +513,50 @@ class AuroMenu extends AuroElement {
522
513
  });
523
514
  }
524
515
 
516
+ // Defaults for the layout/shape/size architecture props are set in a helper
517
+ // (not the constructor body) so the CEM analyzer keeps their `@type` unions
518
+ // instead of inferring `string` from a constructor-literal assignment.
519
+ // See AlaskaAirlines/discussions#653.
520
+ initializeArchitectureDefaults() {
521
+ this.shape = "box";
522
+ this.size = "sm";
523
+ }
524
+
525
525
  static get properties() {
526
526
  return {
527
527
  ...super.properties,
528
528
 
529
+ /**
530
+ * Applies a named layout variant to the menu. Free-form string consumed by the shared architecture helpers; menu defines no closed value set.
531
+ */
532
+ layout: {
533
+ type: String,
534
+ attribute: "layout",
535
+ reflect: true
536
+ },
537
+
538
+ /**
539
+ * Sets the shape of the menu options.
540
+ * @type {'box' | 'pill' | 'snowflake'}
541
+ * @default 'box'
542
+ */
543
+ shape: {
544
+ type: String,
545
+ attribute: "shape",
546
+ reflect: true
547
+ },
548
+
549
+ /**
550
+ * Sets the size of the menu options.
551
+ * @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
552
+ * @default 'sm'
553
+ */
554
+ size: {
555
+ type: String,
556
+ attribute: "size",
557
+ reflect: true
558
+ },
559
+
529
560
  /**
530
561
  * When true, the entire menu and all options are disabled.
531
562
  */
@@ -1847,9 +1878,36 @@ class AuroMenuOption extends AuroElement {
1847
1878
  static get properties() {
1848
1879
  return {
1849
1880
  ...super.properties,
1881
+
1882
+ /**
1883
+ * Sets the shape of the option. When unset, it inherits the shape of the parent `auro-menu`.
1884
+ * @type {'box' | 'pill' | 'snowflake'}
1885
+ * @default 'box'
1886
+ */
1887
+ shape: {
1888
+ type: String,
1889
+ attribute: "shape",
1890
+ reflect: true
1891
+ },
1892
+
1893
+ /**
1894
+ * Sets the size of the option. When unset, it inherits the size of the parent `auro-menu`.
1895
+ * @type {'xs' | 'sm' | 'md' | 'lg' | 'xl'}
1896
+ * @default 'sm'
1897
+ */
1898
+ size: {
1899
+ type: String,
1900
+ attribute: "size",
1901
+ reflect: true
1902
+ },
1903
+
1904
+ /**
1905
+ * When true, this option will not show the checkmark when selected.
1906
+ */
1850
1907
  noCheckmark: {
1851
1908
  type: Boolean,
1852
- reflect: true
1909
+ reflect: true,
1910
+ attribute: 'nocheckmark'
1853
1911
  },
1854
1912
 
1855
1913
  /**
@@ -1861,17 +1919,30 @@ class AuroMenuOption extends AuroElement {
1861
1919
  type: Boolean,
1862
1920
  reflect: true
1863
1921
  },
1922
+
1923
+ /**
1924
+ * When true, the option is disabled and cannot be selected.
1925
+ */
1864
1926
  disabled: {
1865
1927
  type: Boolean,
1866
1928
  reflect: true
1867
1929
  },
1930
+
1931
+ /**
1932
+ * The value associated with this menu option.
1933
+ */
1868
1934
  value: {
1869
1935
  type: String,
1870
1936
  reflect: true
1871
1937
  },
1938
+
1939
+ /**
1940
+ * Sets the tab order of the menu option.
1941
+ */
1872
1942
  tabIndex: {
1873
1943
  type: Number,
1874
- reflect: true
1944
+ reflect: true,
1945
+ attribute: 'tabindex'
1875
1946
  },
1876
1947
 
1877
1948
  /**