@lion/ui 0.22.0 → 0.23.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 (218) hide show
  1. package/README.md +35 -0
  2. package/components/combobox/src/LionCombobox.js +10 -2
  3. package/components/combobox/test/lion-combobox.test.js +31 -0
  4. package/components/form-core/src/choice-group/ChoiceGroupMixin.js +7 -0
  5. package/components/form-core/types/choice-group/ChoiceGroupMixinTypes.ts +5 -0
  6. package/components/input-amount/src/LionInputAmount.js +17 -6
  7. package/components/input-amount/src/formatters.js +5 -3
  8. package/components/input-amount/test/formatters.test.js +88 -74
  9. package/components/input-amount/test/lion-input-amount.test.js +51 -36
  10. package/components/input-tel/test/validators.test.js +9 -0
  11. package/components/listbox/src/ListboxMixin.js +19 -3
  12. package/components/listbox/types/ListboxMixinTypes.ts +7 -1
  13. package/components/menu/README.md +360 -0
  14. package/components/menu/src/InteractiveListMixin.js +867 -0
  15. package/components/menu/src/LionMenu.js +436 -0
  16. package/components/menu/src/MoreButtonMenuMixin.js +295 -0
  17. package/components/menu/src/MultiLevelListMixin.js +312 -0
  18. package/components/menu/src/utils/isInView.js +26 -0
  19. package/components/menu/src/utils/listItemInteractions.js +124 -0
  20. package/components/menu/test/InteractiveListMixin.test.js +3 -0
  21. package/components/menu/test/MoreButtonMenuMixin.test.js +4 -0
  22. package/components/menu/test/MultiLevelListMixin.test.js +3 -0
  23. package/components/menu/test/lion-menu-interactions.test.js +3 -0
  24. package/components/menu/test/lion-menu.test.js +14 -0
  25. package/components/menu/test-helpers/mimicKeyPress.js +9 -0
  26. package/components/menu/test-suites/InteractiveListMixin.suite.js +537 -0
  27. package/components/menu/test-suites/LionMenu.suite.js +114 -0
  28. package/components/menu/test-suites/LionMenuInteractions.suite.js +583 -0
  29. package/components/menu/test-suites/MoreButtonMenuMixin.suite.js +372 -0
  30. package/components/menu/test-suites/MultiLevelListMixin.suite.js +309 -0
  31. package/components/menu/types/InteractiveListMixinTypes.ts +126 -0
  32. package/components/menu/types/MoreButtonMenuMixinTypes.ts +51 -0
  33. package/components/menu/types/MultiLevelListMixinTypes.ts +28 -0
  34. package/components/menu/types/OverlayWithListInvokerMixinTypes.ts +61 -0
  35. package/components/overlays/NEXT.md +49 -0
  36. package/components/overlays/src/OverlayController.js +304 -125
  37. package/components/overlays/src/OverlayMixin.js +81 -17
  38. package/components/overlays/src/utils/adopt-styles.js +1 -1
  39. package/components/overlays/src/utils/is-equal-config.js +15 -6
  40. package/components/overlays/test/OverlayController.test.js +223 -25
  41. package/components/overlays/test-suites/OverlayMixin.suite.js +8 -8
  42. package/components/overlays/types/ArrowMixinTypes.ts +1 -3
  43. package/components/overlays/types/OverlayConfig.ts +20 -5
  44. package/components/overlays/types/OverlayMixinTypes.ts +2 -0
  45. package/components/select-rich/src/LionSelectRich.js +12 -0
  46. package/components/select-rich/test/lion-select-rich-interaction.test.js +53 -0
  47. package/components/select-rich/test/lion-select-rich-upgrade.test.js +30 -0
  48. package/custom-elements.json +3120 -149
  49. package/dist-types/components/combobox/src/LionCombobox.d.ts +1 -1
  50. package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
  51. package/dist-types/components/dialog/src/LionDialog.d.ts +6 -2
  52. package/dist-types/components/dialog/src/LionDialog.d.ts.map +1 -1
  53. package/dist-types/components/form-core/src/choice-group/ChoiceGroupMixin.d.ts.map +1 -1
  54. package/dist-types/components/form-core/types/choice-group/ChoiceGroupMixinTypes.d.ts +5 -0
  55. package/dist-types/components/form-core/types/choice-group/ChoiceGroupMixinTypes.d.ts.map +1 -1
  56. package/dist-types/components/input-amount/src/LionInputAmount.d.ts +3 -1
  57. package/dist-types/components/input-amount/src/LionInputAmount.d.ts.map +1 -1
  58. package/dist-types/components/input-amount/src/formatters.d.ts +6 -4
  59. package/dist-types/components/input-amount/src/formatters.d.ts.map +1 -1
  60. package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +1 -1
  61. package/dist-types/components/listbox/src/ListboxMixin.d.ts.map +1 -1
  62. package/dist-types/components/listbox/types/ListboxMixinTypes.d.ts +7 -1
  63. package/dist-types/components/listbox/types/ListboxMixinTypes.d.ts.map +1 -1
  64. package/dist-types/components/menu/src/InteractiveListMixin.d.ts +35 -0
  65. package/dist-types/components/menu/src/InteractiveListMixin.d.ts.map +1 -0
  66. package/dist-types/components/menu/src/LionMenu.d.ts +129 -0
  67. package/dist-types/components/menu/src/LionMenu.d.ts.map +1 -0
  68. package/dist-types/components/menu/src/MoreButtonMenuMixin.d.ts +8 -0
  69. package/dist-types/components/menu/src/MoreButtonMenuMixin.d.ts.map +1 -0
  70. package/dist-types/components/menu/src/MultiLevelListMixin.d.ts +7 -0
  71. package/dist-types/components/menu/src/MultiLevelListMixin.d.ts.map +1 -0
  72. package/dist-types/components/menu/src/utils/isInView.d.ts +9 -0
  73. package/dist-types/components/menu/src/utils/isInView.d.ts.map +1 -0
  74. package/dist-types/components/menu/src/utils/listItemInteractions.d.ts +48 -0
  75. package/dist-types/components/menu/src/utils/listItemInteractions.d.ts.map +1 -0
  76. package/dist-types/components/menu/test/InteractiveListMixin.test.d.ts +2 -0
  77. package/dist-types/components/menu/test/InteractiveListMixin.test.d.ts.map +1 -0
  78. package/dist-types/components/menu/test/MoreButtonMenuMixin.test.d.ts +2 -0
  79. package/dist-types/components/menu/test/MoreButtonMenuMixin.test.d.ts.map +1 -0
  80. package/dist-types/components/menu/test/MultiLevelListMixin.test.d.ts +2 -0
  81. package/dist-types/components/menu/test/MultiLevelListMixin.test.d.ts.map +1 -0
  82. package/dist-types/components/menu/test/lion-menu-interactions.test.d.ts +2 -0
  83. package/dist-types/components/menu/test/lion-menu-interactions.test.d.ts.map +1 -0
  84. package/dist-types/components/menu/test/lion-menu.test.d.ts +2 -0
  85. package/dist-types/components/menu/test/lion-menu.test.d.ts.map +1 -0
  86. package/dist-types/components/menu/test-helpers/mimicKeyPress.d.ts +7 -0
  87. package/dist-types/components/menu/test-helpers/mimicKeyPress.d.ts.map +1 -0
  88. package/dist-types/components/menu/test-suites/InteractiveListMixin.suite.d.ts +11 -0
  89. package/dist-types/components/menu/test-suites/InteractiveListMixin.suite.d.ts.map +1 -0
  90. package/dist-types/components/menu/test-suites/LionMenu.suite.d.ts +9 -0
  91. package/dist-types/components/menu/test-suites/LionMenu.suite.d.ts.map +1 -0
  92. package/dist-types/components/menu/test-suites/LionMenuInteractions.suite.d.ts +5 -0
  93. package/dist-types/components/menu/test-suites/LionMenuInteractions.suite.d.ts.map +1 -0
  94. package/dist-types/components/menu/test-suites/MoreButtonMenuMixin.suite.d.ts +11 -0
  95. package/dist-types/components/menu/test-suites/MoreButtonMenuMixin.suite.d.ts.map +1 -0
  96. package/dist-types/components/menu/test-suites/MultiLevelListMixin.suite.d.ts +11 -0
  97. package/dist-types/components/menu/test-suites/MultiLevelListMixin.suite.d.ts.map +1 -0
  98. package/dist-types/components/menu/types/InteractiveListMixinTypes.d.ts +72 -0
  99. package/dist-types/components/menu/types/InteractiveListMixinTypes.d.ts.map +1 -0
  100. package/dist-types/components/menu/types/MoreButtonMenuMixinTypes.d.ts +30 -0
  101. package/dist-types/components/menu/types/MoreButtonMenuMixinTypes.d.ts.map +1 -0
  102. package/dist-types/components/menu/types/MultiLevelListMixinTypes.d.ts +16 -0
  103. package/dist-types/components/menu/types/MultiLevelListMixinTypes.d.ts.map +1 -0
  104. package/dist-types/components/menu/types/OverlayWithListInvokerMixinTypes.d.ts +35 -0
  105. package/dist-types/components/menu/types/OverlayWithListInvokerMixinTypes.d.ts.map +1 -0
  106. package/dist-types/components/overlays/src/OverlayController.d.ts +22 -5
  107. package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
  108. package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
  109. package/dist-types/components/overlays/src/utils/is-equal-config.d.ts.map +1 -1
  110. package/dist-types/components/overlays/types/ArrowMixinTypes.d.ts.map +1 -1
  111. package/dist-types/components/overlays/types/OverlayConfig.d.ts +12 -2
  112. package/dist-types/components/overlays/types/OverlayConfig.d.ts.map +1 -1
  113. package/dist-types/components/overlays/types/OverlayMixinTypes.d.ts +1 -0
  114. package/dist-types/components/overlays/types/OverlayMixinTypes.d.ts.map +1 -1
  115. package/dist-types/components/select-rich/src/LionSelectRich.d.ts +13 -2
  116. package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
  117. package/dist-types/components/select-rich/test/lion-select-rich-interaction.test.d.ts.map +1 -1
  118. package/dist-types/components/select-rich/test/lion-select-rich-upgrade.test.d.ts +2 -0
  119. package/dist-types/components/select-rich/test/lion-select-rich-upgrade.test.d.ts.map +1 -0
  120. package/dist-types/components/tooltip/src/LionTooltip.d.ts +1 -1
  121. package/dist-types/exports/define/lion-item.d.ts +2 -0
  122. package/dist-types/exports/define/lion-item.d.ts.map +1 -0
  123. package/dist-types/exports/define/lion-menu.d.ts +2 -0
  124. package/dist-types/exports/define/lion-menu.d.ts.map +1 -0
  125. package/dist-types/exports/define/lion-menuitem.d.ts +2 -0
  126. package/dist-types/exports/define/lion-menuitem.d.ts.map +1 -0
  127. package/dist-types/exports/menu-test-suites.d.ts +4 -0
  128. package/dist-types/exports/menu-test-suites.d.ts.map +1 -0
  129. package/dist-types/exports/menu.d.ts +3 -0
  130. package/dist-types/exports/menu.d.ts.map +1 -0
  131. package/dist-types/exports/overlays.d.ts +6 -0
  132. package/dist-types/exports/overlays.d.ts.map +1 -1
  133. package/dist-types/tsconfig.tsbuildinfo +1 -1
  134. package/docs/components/checkbox-group/overview.md +2 -2
  135. package/docs/components/collapsible/overview.md +1 -1
  136. package/docs/components/combobox/api-table.md +53 -39
  137. package/docs/components/combobox/overview.md +1 -1
  138. package/docs/components/combobox/use-cases.md +1 -1
  139. package/docs/components/dialog/api-table.md +32 -6
  140. package/docs/components/dialog/overview.md +1 -1
  141. package/docs/components/fieldset/overview.md +5 -5
  142. package/docs/components/form/overview.md +3 -3
  143. package/docs/components/form/use-cases.md +2 -2
  144. package/docs/components/icon/use-cases.md +1 -1
  145. package/docs/components/input/overview.md +1 -1
  146. package/docs/components/input-amount/api-table.md +9 -7
  147. package/docs/components/input-amount/overview.md +3 -3
  148. package/docs/components/input-amount/use-cases.md +15 -4
  149. package/docs/components/input-amount-dropdown/api-table.md +2 -0
  150. package/docs/components/input-date/overview.md +3 -3
  151. package/docs/components/input-datepicker/api-table.md +63 -45
  152. package/docs/components/input-datepicker/overview.md +5 -5
  153. package/docs/components/input-email/overview.md +2 -2
  154. package/docs/components/input-file/overview.md +1 -1
  155. package/docs/components/input-iban/overview.md +2 -2
  156. package/docs/components/input-range/overview.md +2 -2
  157. package/docs/components/input-stepper/overview.md +1 -1
  158. package/docs/components/input-tel/overview.md +1 -1
  159. package/docs/components/input-tel/use-cases.md +6 -6
  160. package/docs/components/input-tel-dropdown/overview.md +1 -1
  161. package/docs/components/listbox/use-cases.md +1 -1
  162. package/docs/components/menu/api-table.md +44 -0
  163. package/docs/components/menu/applyMenuDemoStyles.js +173 -0
  164. package/docs/components/menu/extensions.md +262 -0
  165. package/docs/components/menu/index.md +13 -0
  166. package/docs/components/menu/migration.md +129 -0
  167. package/docs/components/menu/overview.md +448 -0
  168. package/docs/components/menu/src/DemoNavigationBar.js +441 -0
  169. package/docs/components/menu/src/DemoSpinButton.js +215 -0
  170. package/docs/components/menu/src/DemoToolbar.js +101 -0
  171. package/docs/components/menu/src/DemoTree.js +55 -0
  172. package/docs/components/menu/src/navigation-bar-types.js +41 -0
  173. package/docs/components/menu/use-cases.md +74 -0
  174. package/docs/components/radio-group/overview.md +3 -3
  175. package/docs/components/select/use-cases.md +1 -1
  176. package/docs/components/select-rich/api-table.md +51 -33
  177. package/docs/components/select-rich/use-cases.md +2 -2
  178. package/docs/components/tabs/examples.md +1 -1
  179. package/docs/components/tooltip/api-table.md +33 -7
  180. package/docs/fundamentals/index.md +4 -4
  181. package/docs/fundamentals/node-tools/providence-analytics/overview.md +1 -1
  182. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  183. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  184. package/docs/fundamentals/rationales/accessibility.md +1 -1
  185. package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
  186. package/docs/fundamentals/systems/core/overview.md +1 -1
  187. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  188. package/docs/fundamentals/systems/form/model-value.md +1 -1
  189. package/docs/fundamentals/systems/form/overview.md +28 -28
  190. package/docs/fundamentals/systems/form/validate.md +2 -2
  191. package/docs/fundamentals/systems/localize/overview.md +4 -4
  192. package/docs/fundamentals/systems/overlays/api-table.md +46 -43
  193. package/docs/fundamentals/systems/overlays/configuration.md +2 -2
  194. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  195. package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
  196. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  197. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  198. package/docs/guides/how-to/create-a-custom-field.md +5 -5
  199. package/docs/guides/how-to/create-a-form.md +4 -4
  200. package/docs/guides/how-to/extend-a-native-input.md +2 -2
  201. package/docs/guides/how-to/index.md +1 -1
  202. package/docs/guides/index.md +8 -8
  203. package/docs/guides/principles/index.md +5 -5
  204. package/docs/guides/principles/styling.md +1 -1
  205. package/exports/define/lion-item.js +3 -0
  206. package/exports/define/lion-menu.js +3 -0
  207. package/exports/define/lion-menuitem.js +3 -0
  208. package/exports/menu-test-suites.js +4 -0
  209. package/exports/menu.js +3 -0
  210. package/exports/overlays.js +6 -0
  211. package/menu-test-suites.js +4 -0
  212. package/menu.js +3 -0
  213. package/overlays.js +6 -0
  214. package/package.json +11 -4
  215. package/vendor/README.md +61 -0
  216. package/vendor/awesome-phonenumber-7.9.0-tlouisse.libphonenumber-9.0.41.tgz +0 -0
  217. package/vscode.html-custom-data.json +76 -8
  218. package/web-types.json +202 -17
@@ -0,0 +1,173 @@
1
+ import { html, render } from 'lit';
2
+
3
+ function renderLitAsNode(tpl) {
4
+ const container = document.createElement('div');
5
+ render(tpl, container);
6
+ return container.firstElementChild;
7
+ }
8
+
9
+ let isApplied = false;
10
+
11
+ export function applyMenuDemoStyles() {
12
+ if (isApplied) {
13
+ return;
14
+ }
15
+
16
+ const fontAwesome = html`<link
17
+ rel="stylesheet"
18
+ href="https://use.fontawesome.com/releases/v5.1.0/css/all.css"
19
+ integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt"
20
+ crossorigin="anonymous"
21
+ />`;
22
+ document.head.appendChild(renderLitAsNode(fontAwesome));
23
+
24
+ const styles = html` <style>
25
+ [role='menu']:focus {
26
+ outline: none;
27
+ }
28
+
29
+ [role='toolbar'],
30
+ [role='tree'],
31
+ [role='menubar'],
32
+ [role='menu'] {
33
+ background: white;
34
+ font-family: sans-serif;
35
+ font-size: 12px;
36
+ }
37
+
38
+ [level] > [role='menu'] {
39
+ border: 1px solid black;
40
+ }
41
+
42
+ [role='treeitem']:not([aria-expanded]),
43
+ [role='treeitem'][aria-expanded],
44
+ [role^='menuitem']:not([aria-expanded]),
45
+ [role^='menuitem'][aria-expanded] {
46
+ all: unset;
47
+ display: block;
48
+ width: 100%;
49
+ position: relative;
50
+ box-sizing: border-box;
51
+ padding: 4px 24px 4px 8px;
52
+ }
53
+
54
+ [role='treeitem']:not([aria-expanded]),
55
+ [role='treeitem'][aria-expanded] {
56
+ padding-left: 16px;
57
+ }
58
+
59
+ [role='treeitem'][active]:not([aria-expanded]),
60
+ [role='treeitem'][active][aria-expanded],
61
+ [role^='menuitem'][active]:not([aria-expanded]),
62
+ [role^='menuitem'][active][aria-expanded] {
63
+ background: lightgrey;
64
+ }
65
+
66
+ [role^='menuitem'][checked]:not([aria-expanded]),
67
+ [role^='menuitem'][checked][aria-expanded] {
68
+ background: #eee;
69
+ }
70
+
71
+ [role='treeitem'],
72
+ [role^='menuitem'] {
73
+ position: relative;
74
+ cursor: default;
75
+ }
76
+
77
+ [role='treeitem']::after,
78
+ [role^='menuitem']::after {
79
+ position: absolute;
80
+ top: 5px;
81
+ font-size: 10px;
82
+ }
83
+
84
+ [role^='menuitem']::after {
85
+ right: 4px;
86
+ }
87
+
88
+ [role^='treeitem']::after {
89
+ left: 4px;
90
+ }
91
+
92
+ [role^='menuitem'][aria-expanded]::after {
93
+ content: '▶';
94
+ }
95
+
96
+ [role^='menuitem'][aria-expanded='true']::after {
97
+ content: '▼';
98
+ }
99
+
100
+ [axis='inline'] [role^='menuitem'][aria-expanded]::after {
101
+ content: '▼';
102
+ }
103
+
104
+ [role='menuitemcheckbox'][aria-checked='true']::after {
105
+ content: '🗹';
106
+ }
107
+
108
+ [role='menuitemradio'][aria-checked='true']::after {
109
+ content: '◉';
110
+ }
111
+
112
+ [role='separator'] {
113
+ border-bottom: 1px solid gray;
114
+ }
115
+
116
+ [role='treeitem'][aria-expanded]::after {
117
+ content: '+';
118
+ }
119
+
120
+ demo-tree[level='1'] [role='treeitem']:not([aria-expanded]),
121
+ demo-tree[level='1'] [role='treeitem'][aria-expanded] {
122
+ padding-left: 24px;
123
+ }
124
+
125
+ lion-menu[level='1'] [role^='menuitem']:not([aria-expanded]),
126
+ lion-menu[level='1'] [role^='menuitem'][aria-expanded] {
127
+ padding-left: 16px;
128
+ }
129
+
130
+ demo-tree[level='2'] [role='treeitem']:not([aria-expanded]),
131
+ demo-tree[level='2'] [role='treeitem'][aria-expanded] {
132
+ padding-left: 32px;
133
+ }
134
+ lion-menu[level='2'] [role^='menuitem']:not([aria-expanded]),
135
+ lion-menu[level='2'] [role^='menuitem'][aria-expanded] {
136
+ padding-left: 24px;
137
+ }
138
+
139
+ [role='toolbar'] {
140
+ padding: 8px;
141
+ background: #eee;
142
+ }
143
+ [role='toolbar'] button {
144
+ background: none;
145
+ padding: 4px 8px;
146
+ border: 1px transparent;
147
+ }
148
+ [role='toolbar'] button[aria-pressed='true'],
149
+ [role='toolbar'] button[aria-checked='true'] {
150
+ background: white;
151
+ border: 1px black;
152
+ }
153
+
154
+ [role='toolbar'] > div[role='separator'] {
155
+ margin-left: 8px;
156
+ margin-right: 8px;
157
+ border-left: 1px solid lightgray;
158
+ }
159
+
160
+ button[slot='invoker'] {
161
+ background: none;
162
+ color: inherit;
163
+ border: none;
164
+ padding: 0;
165
+ font: inherit;
166
+ display: block;
167
+ width: 100%;
168
+ text-align: left;
169
+ }
170
+ </style>`;
171
+ document.head.appendChild(renderLitAsNode(styles));
172
+ isApplied = true;
173
+ }
@@ -0,0 +1,262 @@
1
+ ---
2
+ title: 'Menu: Extensions'
3
+ parts:
4
+ - Menu
5
+ - Extensions
6
+ eleventyNavigation:
7
+ key: 'Menu: Extensions'
8
+ order: 10
9
+ parent: Menu
10
+ title: Extensions
11
+ ---
12
+
13
+ # Menu: Extensions
14
+
15
+ ```js script
16
+ import { html } from 'lit';
17
+ import './src/DemoNavigationBar.js';
18
+
19
+ // N.B. data structure designed to be compatible with existing extension layer
20
+ // TODO: maybe refactor api and bridge
21
+
22
+ const menuData = [
23
+ {
24
+ title: 'Products',
25
+ link: 'products',
26
+ sub: [
27
+ {
28
+ title: 'Payments',
29
+ link: 'payments-collections',
30
+ sub: [
31
+ { title: 'Payments & Collections', link: '#' },
32
+ { title: 'Merchant Commerce Solutions', link: 'merchant-commerce-solutions' },
33
+ { title: 'Instant Payments', link: 'instant-payments' },
34
+ { title: 'SEPA Direct Debit', link: 'SEPA-direct-debit' },
35
+ { title: 'SEPA Credit Transfer', link: 'SEPA-credit-transfer' },
36
+ { title: 'International Credit Transfer', link: 'international-credit-transfer' },
37
+ { title: 'Account Reporting', link: 'account-deporting' },
38
+ ],
39
+ },
40
+ {
41
+ title: 'Savings',
42
+ link: 'savings-collection',
43
+ sub: [
44
+ { title: 'Liquidity & Cash Management', link: 'liquidity-cash-management' },
45
+ { title: 'Physcial Cash Management', link: 'physcial-cash-management' },
46
+ { title: 'Notional Cash Management', link: 'notional-cash-management' },
47
+ { title: 'Virtual Cash Management', link: 'virtual-cash-management' },
48
+ { title: 'Liquidity Management', link: 'liquidity-management' },
49
+ { title: 'Excess Cash', link: 'excess-cash' },
50
+ ],
51
+ },
52
+ {
53
+ title: 'Investing',
54
+ link: 'investing-collection',
55
+ sub: [
56
+ { title: 'Digital Banking Services', link: 'home' },
57
+ { title: 'InsideBusiness', link: 'home' },
58
+ { title: 'Connectivity Solutions', link: 'connectivity-solutions' },
59
+ ],
60
+ },
61
+ {
62
+ title: 'Mortgages',
63
+ link: 'mortgages-collections',
64
+ sub: [
65
+ { title: 'Payments & Collections', link: '#' },
66
+ { title: 'Merchant Commerce Solutions', link: 'merchant-commerce-solutions' },
67
+ { title: 'Instant Payments', link: 'instant-payments' },
68
+ { title: 'SEPA Direct Debit', link: 'SEPA-direct-debit' },
69
+ { title: 'SEPA Credit Transfer', link: 'SEPA-credit-transfer' },
70
+ { title: 'International Credit Transfer', link: 'international-credit-transfer' },
71
+ { title: 'Account Reporting', link: 'account-deporting' },
72
+ ],
73
+ },
74
+ {
75
+ title: 'Loans',
76
+ link: 'loans-collection',
77
+ sub: [
78
+ { title: 'Liquidity & Cash Management', link: 'liquidity-cash-management' },
79
+ { title: 'Physcial Cash Management', link: 'physcial-cash-management' },
80
+ { title: 'Notional Cash Management', link: 'notional-cash-management' },
81
+ { title: 'Virtual Cash Management', link: 'virtual-cash-management' },
82
+ { title: 'Liquidity Management', link: 'liquidity-management' },
83
+ { title: 'Excess Cash', link: 'excess-cash' },
84
+ ],
85
+ },
86
+ {
87
+ title: 'Insurances',
88
+ link: 'insurances-collection',
89
+ sub: [
90
+ { title: 'Digital Banking Services', link: 'home' },
91
+ { title: 'InsideBusiness', link: 'home' },
92
+ { title: 'Connectivity Solutions', link: 'connectivity-solutions' },
93
+ ],
94
+ },
95
+ {
96
+ title: 'Digital banking',
97
+ link: 'digital-banking',
98
+ },
99
+ ],
100
+ },
101
+ {
102
+ title: "Who it's for",
103
+ link: 'who',
104
+ sub: [
105
+ {
106
+ title: 'Parents & kids',
107
+ link: 'parents-kids',
108
+ sub: [
109
+ { title: 'Child current account', link: '#child-current' },
110
+ { title: 'Youth current account', link: '#youth-current' },
111
+ { title: 'Child savings account', link: '#child-savings' },
112
+ ],
113
+ },
114
+ {
115
+ title: 'Students',
116
+ link: 'students',
117
+ sub: [
118
+ { title: 'Student account', link: '#student-account' },
119
+ { title: 'Smart payments', link: '#smart-payments' },
120
+ { title: 'Smart savings', link: '#smart-savings' },
121
+ { title: 'Smart banking', link: '#smart-banking' },
122
+ { title: 'Smart for now', link: '#smart-for-now' },
123
+ { title: 'Smart for later', link: '#smart-for-later' },
124
+ ],
125
+ },
126
+ {
127
+ title: "I'm an expat",
128
+ link: 'expat',
129
+ sub: [
130
+ { title: 'Open a Dutch banking account', link: '#open' },
131
+ { title: 'Investments', link: '#investments' },
132
+ { title: 'Mortgage', link: '#mortgage' },
133
+ { title: 'Health insurance', link: '#insurance' },
134
+ ],
135
+ },
136
+ ],
137
+ },
138
+ {
139
+ title: 'Themes',
140
+ link: 'themes',
141
+ sub: [
142
+ {
143
+ title: 'Living',
144
+ link: 'living-collections',
145
+ sub: [
146
+ { title: 'Payments & Collections', link: '#' },
147
+ { title: 'Merchant Commerce Solutions', link: 'merchant-commerce-solutions' },
148
+ { title: 'Instant Payments', link: 'instant-payments' },
149
+ { title: 'SEPA Direct Debit', link: 'SEPA-direct-debit' },
150
+ { title: 'SEPA Credit Transfer', link: 'SEPA-credit-transfer' },
151
+ { title: 'International Credit Transfer', link: 'international-credit-transfer' },
152
+ { title: 'Account Reporting', link: 'account-deporting' },
153
+ ],
154
+ },
155
+ {
156
+ title: 'Wealth',
157
+ link: 'wealth-collections',
158
+ sub: [
159
+ { title: 'Liquidity & Cash Management', link: 'liquidity-cash-management' },
160
+ { title: 'Physcial Cash Management', link: 'physcial-cash-management' },
161
+ { title: 'Notional Cash Management', link: 'notional-cash-management' },
162
+ { title: 'Virtual Cash Management', link: 'virtual-cash-management' },
163
+ { title: 'Liquidity Management', link: 'liquidity-management' },
164
+ { title: 'Excess Cash', link: 'excess-cash' },
165
+ ],
166
+ },
167
+ ],
168
+ },
169
+ {
170
+ title: 'Loyalty shop',
171
+ link: '#points',
172
+ },
173
+ {
174
+ title: 'Make an appointment',
175
+ link: '#appointment',
176
+ },
177
+ {
178
+ title: 'Products 2',
179
+ link: 'products-2',
180
+ sub: [
181
+ {
182
+ title: 'Payments',
183
+ link: 'payments-collections',
184
+ sub: [
185
+ { title: 'Payments & Collections', link: '#' },
186
+ { title: 'Merchant Commerce Solutions', link: 'merchant-commerce-solutions' },
187
+ { title: 'Instant Payments', link: 'instant-payments' },
188
+ { title: 'SEPA Direct Debit', link: 'SEPA-direct-debit' },
189
+ { title: 'SEPA Credit Transfer', link: 'SEPA-credit-transfer' },
190
+ { title: 'International Credit Transfer', link: 'international-credit-transfer' },
191
+ { title: 'Account Reporting', link: 'account-deporting' },
192
+ ],
193
+ },
194
+ ],
195
+ },
196
+
197
+ {
198
+ title: 'Products 3',
199
+ sub: [
200
+ {
201
+ title: 'Payments',
202
+ link: 'payments-collections',
203
+ sub: [
204
+ { title: 'Payments & Collections', link: '#' },
205
+ { title: 'Merchant Commerce Solutions', link: 'merchant-commerce-solutions' },
206
+ { title: 'Instant Payments', link: 'instant-payments' },
207
+ { title: 'SEPA Direct Debit', link: 'SEPA-direct-debit' },
208
+ { title: 'SEPA Credit Transfer', link: 'SEPA-credit-transfer' },
209
+ { title: 'International Credit Transfer', link: 'international-credit-transfer' },
210
+ { title: 'Account Reporting', link: 'account-deporting' },
211
+ ],
212
+ },
213
+ ],
214
+ },
215
+ {
216
+ title: 'Loyalty shop 2',
217
+ link: '#points',
218
+ },
219
+ {
220
+ title: 'Make an appointment 2',
221
+ link: '#appointment',
222
+ },
223
+ ];
224
+
225
+ const secondaryMenu = [
226
+ {
227
+ title: 'Back to old website',
228
+ link: 'https://www.ingwb.com',
229
+ target: '_self',
230
+ trackid: 'backToOldWebsite',
231
+ },
232
+ ];
233
+
234
+ const ctaPrimary = {
235
+ id: 'cta-primary',
236
+ label: 'Log in',
237
+ href: '#login',
238
+ };
239
+
240
+ const ctaSecondary = {
241
+ id: 'cta-secondary',
242
+ label: 'Open an account',
243
+ href: '#open-account',
244
+ };
245
+
246
+ // N.B. these should be provided via api call
247
+ const suggestions = ['A', 'B', 'C', 'D'];
248
+ ```
249
+
250
+ ```js preview-story
251
+ export const navigationBar = () => {
252
+ return html`<demo-navigation-bar
253
+ .menuItems="${menuData}"
254
+ .menuSupportItems="${secondaryMenu}"
255
+ .ctaPrimary="${ctaPrimary}"
256
+ .ctaSecondary="${ctaSecondary}"
257
+ .suggestions="${suggestions}"
258
+ >
259
+ .prefilledSuggestion="${suggestions[0]}"</demo-navigation-bar
260
+ >`;
261
+ };
262
+ ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Menu
3
+ parts:
4
+ - Menu
5
+ eleventyNavigation:
6
+ key: Menu
7
+ order: 20
8
+ title: Menu
9
+ ---
10
+
11
+ # Menu
12
+
13
+ -> go to Overview
@@ -0,0 +1,129 @@
1
+ ---
2
+ title: 'Menu: Migration from the prerelease'
3
+ parts:
4
+ - Menu
5
+ - Migration
6
+ eleventyNavigation:
7
+ key: 'Menu: Migration'
8
+ order: 30
9
+ parent: Menu
10
+ title: Migration
11
+ ---
12
+
13
+ # Menu: Migration from the prerelease
14
+
15
+ The menu shipped as prereleases of `@lion/ui` (dist-tag `menu-system`, driven by the
16
+ `.changeset/pre.json` pre-mode of the same name): `0.16.1-menu-system.N` from the 2021 branch and
17
+ `0.21.1-menu-system.0`, the latest one published from this work in progress. It now lands as a regular
18
+ minor of `@lion/ui`: pre-mode is left behind and `@lion/menu` (the `0.0.0` scratch manifest of the 2021
19
+ branch) is gone. Everything below is about moving an implementation from those prereleases to this
20
+ version.
21
+
22
+ ## 1. Package and entry points
23
+
24
+ | prerelease | now |
25
+ | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | `@lion/ui@0.16.1-menu-system.N` ... `@lion/ui@0.21.1-menu-system.0` | the released `@lion/ui` minor |
27
+ | `@lion/ui/exports/menu.js` | same path; exports `LionMenu`, `LionItem`, `LionMenuitem` |
28
+ | `@lion/ui/define/lion-menu.js` | unchanged |
29
+ | `@lion/ui/define/lion-item.js` | unchanged |
30
+ | `@lion/ui/define/lion-menuitem.js` | new entry (see 3) |
31
+ | `@lion/ui/define/lion-menu-overlay.js`, `.../lion-toolbar.js`, `.../lion-tree.js` | removed |
32
+ | `@lion/ui/exports/menu-test-suites.js` | same path; exports `runInteractiveListMixinSuite`, `runMultiLevelListMixinSuite`, `runLionMenuInteractionsSuite` (was `runLionMenuHybridSuite`) |
33
+ | `@lion/ui/components/menu/index.js`, `.../menu/lion-menu.js`, `.../menu/package.json` | removed |
34
+
35
+ Only `@lion/ui/exports/*` and `@lion/ui/define/*` are in the package `exports` map, so the
36
+ component paths (`@lion/ui/components/...`) were never importable — that has not changed.
37
+
38
+ ## 2. Components that left the package
39
+
40
+ | prerelease | now |
41
+ | ------------------- | ------------------------------------------------------------------------------------------------------------- |
42
+ | `LionMenuOverlay` | the overlay integration (`OverlayWithListInvokerMixin`) lives on `LionMenu` itself: `openable-mode="overlay"` |
43
+ | `LionMenuHybrid` | same as above; `openable-mode="disclosure"` (the default) is the old disclosure behaviour |
44
+ | `LionToolbar` | `docs/components/menu/src/DemoToolbar.js` (`<demo-toolbar>`, a `LionMenu` with `bar`) |
45
+ | `LionTree` | `docs/components/menu/src/DemoTree.js` (`<demo-tree>`, a `MultiLevelListMixin` host with `role="tree"`) |
46
+ | `LionSpinbutton` | `docs/components/menu/src/DemoSpinButton.js` (`<demo-spin-button>`) |
47
+ | `LionNavigationBar` | `docs/components/menu/src/DemoNavigationBar.js` (`<demo-navigation-bar>`) |
48
+
49
+ The tags `lion-tree`, `lion-toolbar`, `lion-spinbutton`, `lion-menu-overlay` and
50
+ `lion-navigation-bar` are no longer registered anywhere. If you used one of those elements, either
51
+ copy the demo implementation into your project (they are configuration on top of the same mixins) or
52
+ configure the mixin yourself (`_listRole`, `_activeMode`, `bar`).
53
+
54
+ ## 3. Element definitions
55
+
56
+ - `<lion-menu>`, `<lion-item>` and `<lion-menuitem>` keep their tag names.
57
+ - `lion-menuitem` now has its own define entry. Before, importing
58
+ `components/menu/src/InteractiveListMixin.js` registered it as a side effect; importing the mixin no
59
+ longer defines any element.
60
+ - Put your `customElements.define` calls (or the `@lion/ui/define/*` imports) in one place, as
61
+ before: the package's `sideEffects` list only covers the define entries.
62
+
63
+ ## 4. Api that did not change
64
+
65
+ `LionMenu`, `LionItem` and `LionMenuitem` keep their tag names and the following properties, so
66
+ implementations that only read or set those keep working: `selectionFollowsFocus` (the ARIA APG
67
+ term, as on `ListboxMixin`), `itemWrap`, `activeIndex`, `checkedIndex`, `listItems`, `_activeMode`,
68
+ `_listRole` (all from `InteractiveListMixin`), plus `bar` and `openableMode` on `LionMenu`.
69
+
70
+ ## 5. Renamed api: this component now speaks the focusgroup vocabulary
71
+
72
+ The old names came from the 2021 branch; they are replaced by the
73
+ [focusgroup](https://open-ui.org/components/focusgroup.explainer/) vocabulary, so implementations
74
+ that follow the platform proposal find the same names here. This is a hard rename: the old names are
75
+ gone.
76
+
77
+ | prerelease | now | note |
78
+ | ----------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
+ | `orientation="vertical"` / `orientation="horizontal"` | `axis="block"` / `axis="inline"` | `block` is the default; the attribute reflects |
80
+ | `rotateKeyboardNavigation` | `wrap` | the focusgroup axis/wrap modifiers |
81
+ | `multipleChoice` | `multiple` | the platform name (`<select multiple>`) |
82
+ | `noPreselect` | `hasNoDefaultSelected` | the initial selectedness the platform calls "default selected" (`HTMLOptionElement.defaultSelected`); the same property and attribute exist on `ListboxMixin` |
83
+
84
+ ```html
85
+ <lion-menu axis="inline" wrap multiple>
86
+ <lion-menuitem>Item 1</lion-menuitem>
87
+ <lion-menuitem>Item 2</lion-menuitem>
88
+ </lion-menu>
89
+ ```
90
+
91
+ Tokens of the focusgroup _attribute_ that are not part of this api: the behavior token (`menu`,
92
+ `menubar`, `toolbar`, `listbox`, `tablist`, ...) is the role/active mode configuration
93
+ (`_listRole`/`_activeMode`), `nomemory` has no counterpart (there is no focus-memory api here), and
94
+ `focusgroupstart` / `focusgroup="none"` are not mapped. The platform attribute itself is not read by
95
+ this component: on Chrome 150 and newer the browser acts on it when it is present in the dom, so do
96
+ not put it on a lion element together with the properties below (native focusgroup behavior and this
97
+ mixin's keyboard handling would both apply).
98
+
99
+ ## 6. Api that is new
100
+
101
+ | api | change |
102
+ | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
103
+ | `OverlayConfig` | accepts `placementMode: 'custom'`, `syncChildrenCloseState`, `elementToFocusOnShow`, `isActivated`, `requireConnectedNodes` |
104
+ | `@lion/ui/exports/overlays.js` | exports `withClickInteraction` and `withHoverInteraction` |
105
+ | types | `components/menu/types/*` are emitted `.ts` now; in the prerelease `InteractiveListMixinTypes.d.ts` was an input file that never reached `dist-types`, so editors could not resolve it |
106
+
107
+ ## 7. Migration checklist
108
+
109
+ 1. Replace the prerelease dependency with the released `@lion/ui` version and drop any
110
+ `menu-system` dist-tag pin (`0.16.1-menu-system.N` up to `0.21.1-menu-system.0`).
111
+ 2. Keep the `@lion/ui/exports/menu.js` and `@lion/ui/define/*` imports; no element was renamed.
112
+ 3. Rename the properties: `orientation` -> `axis` (value `vertical` -> `block`, `horizontal` ->
113
+ `inline`), `rotateKeyboardNavigation` -> `wrap`, `multipleChoice` -> `multiple`. The attribute
114
+ names follow the property names.
115
+ 4. Replace `LionMenuHybrid`/`LionMenuOverlay` usage with `LionMenu` + `openable-mode`, and
116
+ `LionToolbar`/`LionTree`/`LionSpinbutton`/`LionNavigationBar` with your own copy of the demo
117
+ implementations.
118
+ 5. Import `@lion/ui/define/lion-menuitem.js` if you relied on the side-effect definition of
119
+ `lion-menuitem`.
120
+ 6. If you called `runLionMenuHybridSuite`, call `runLionMenuInteractionsSuite` instead.
121
+
122
+ ## 8. Not covered yet
123
+
124
+ - The mixins themselves (`InteractiveListMixin`, `MultiLevelListMixin`, `MoreButtonMenuMixin`,
125
+ `OverlayWithListInvokerMixin`) are not re-exported from `@lion/ui/exports/menu.js`, and deep
126
+ component paths are not in the package `exports` map. If you extend one of them, the test suites in
127
+ `@lion/ui/exports/menu-test-suites.js` are the supported surface; your own copy of the mixin is the
128
+ workaround until that is decided.
129
+ - The `MoreButtonMenuMixin` item-wrap strategy is still "more-menu" only (`itemWrap`).