@lion/ui 0.0.2 → 0.0.4

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 (319) hide show
  1. package/components/core/src/SlotMixin.js +180 -42
  2. package/components/core/test/SlotMixin.test.js +355 -145
  3. package/components/core/types/SlotMixinTypes.ts +12 -1
  4. package/components/input-tel/src/LionInputTel.js +0 -9
  5. package/components/input-tel-dropdown/src/LionInputTelDropdown.js +32 -29
  6. package/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js +5 -6
  7. package/components/localize/src/number/parseNumber.js +15 -36
  8. package/components/localize/test/number/parseNumber.test.js +3 -12
  9. package/components/localize/types/LocalizeMixinTypes.ts +1 -1
  10. package/custom-elements.json +1435 -133
  11. package/dist-types/components/calendar/src/LionCalendar.d.ts +1 -37
  12. package/dist-types/components/calendar/src/LionCalendar.d.ts.map +1 -1
  13. package/dist-types/components/core/src/SlotMixin.d.ts +2 -0
  14. package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
  15. package/dist-types/components/core/test/SlotMixin.test.d.ts +1 -1
  16. package/dist-types/components/core/test/SlotMixin.test.d.ts.map +1 -1
  17. package/dist-types/components/core/types/SlotMixinTypes.d.ts +9 -1
  18. package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
  19. package/dist-types/components/input-amount/src/LionInputAmount.d.ts +1 -37
  20. package/dist-types/components/input-amount/src/LionInputAmount.d.ts.map +1 -1
  21. package/dist-types/components/input-date/src/LionInputDate.d.ts +1 -37
  22. package/dist-types/components/input-date/src/LionInputDate.d.ts.map +1 -1
  23. package/dist-types/components/input-datepicker/src/LionCalendarOverlayFrame.d.ts +1 -37
  24. package/dist-types/components/input-datepicker/src/LionCalendarOverlayFrame.d.ts.map +1 -1
  25. package/dist-types/components/input-email/src/LionInputEmail.d.ts +1 -37
  26. package/dist-types/components/input-email/src/LionInputEmail.d.ts.map +1 -1
  27. package/dist-types/components/input-iban/src/LionInputIban.d.ts +1 -37
  28. package/dist-types/components/input-iban/src/LionInputIban.d.ts.map +1 -1
  29. package/dist-types/components/input-tel/src/LionInputTel.d.ts +1 -42
  30. package/dist-types/components/input-tel/src/LionInputTel.d.ts.map +1 -1
  31. package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +14 -8
  32. package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
  33. package/dist-types/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.d.ts.map +1 -1
  34. package/dist-types/components/localize/src/LocalizeMixin.d.ts +1 -37
  35. package/dist-types/components/localize/src/LocalizeMixin.d.ts.map +1 -1
  36. package/dist-types/components/localize/src/number/parseNumber.d.ts.map +1 -1
  37. package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts +1 -1
  38. package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts.map +1 -1
  39. package/dist-types/components/pagination/src/LionPagination.d.ts +1 -37
  40. package/dist-types/components/pagination/src/LionPagination.d.ts.map +1 -1
  41. package/dist-types/components/progress-indicator/src/LionProgressIndicator.d.ts +1 -37
  42. package/dist-types/components/progress-indicator/src/LionProgressIndicator.d.ts.map +1 -1
  43. package/dist-types/exports/core.d.ts +1 -0
  44. package/dist-types/exports/core.d.ts.map +1 -1
  45. package/dist-types/exports/form-core.d.ts +2 -0
  46. package/dist-types/exports/form-core.d.ts.map +1 -1
  47. package/dist-types/exports/input-tel-dropdown.d.ts +2 -0
  48. package/dist-types/exports/input-tel-dropdown.d.ts.map +1 -1
  49. package/dist-types/exports/input-tel.d.ts +1 -0
  50. package/dist-types/exports/input-tel.d.ts.map +1 -1
  51. package/dist-types/exports/localize.d.ts +3 -0
  52. package/dist-types/exports/localize.d.ts.map +1 -1
  53. package/dist-types/exports/overlays.d.ts +4 -0
  54. package/dist-types/exports/overlays.d.ts.map +1 -1
  55. package/dist-types/tsconfig.tsbuildinfo +1 -1
  56. package/docs/components/accordion/index.md +3 -0
  57. package/docs/components/accordion/overview.md +129 -0
  58. package/docs/components/accordion/reference.md +47 -0
  59. package/docs/components/accordion/use-cases.md +252 -0
  60. package/docs/components/button/examples.md +30 -0
  61. package/docs/components/button/index.md +3 -0
  62. package/docs/components/button/overview.md +30 -0
  63. package/docs/components/button/src/icon.svg.js +5 -0
  64. package/docs/components/button/use-cases.md +106 -0
  65. package/docs/components/calendar/index.md +3 -0
  66. package/docs/components/calendar/overview.md +49 -0
  67. package/docs/components/calendar/use-cases.md +192 -0
  68. package/docs/components/checkbox-group/index.md +3 -0
  69. package/docs/components/checkbox-group/overview.md +40 -0
  70. package/docs/components/checkbox-group/use-cases.md +256 -0
  71. package/docs/components/collapsible/assets/CustomCollapsible.js +113 -0
  72. package/docs/components/collapsible/assets/applyDemoCollapsibleStyles.js +37 -0
  73. package/docs/components/collapsible/examples.md +83 -0
  74. package/docs/components/collapsible/index.md +3 -0
  75. package/docs/components/collapsible/overview.md +39 -0
  76. package/docs/components/collapsible/use-cases.md +79 -0
  77. package/docs/components/combobox/examples.md +153 -0
  78. package/docs/components/combobox/index.md +3 -0
  79. package/docs/components/combobox/overview.md +51 -0
  80. package/docs/components/combobox/src/LinkMixin.js +60 -0
  81. package/docs/components/combobox/src/demo-selection-display.js +191 -0
  82. package/docs/components/combobox/src/gh-combobox/gh-button.js +69 -0
  83. package/docs/components/combobox/src/gh-combobox/gh-combobox.js +508 -0
  84. package/docs/components/combobox/src/google-combobox/assets/google-clear-icon.js +9 -0
  85. package/docs/components/combobox/src/google-combobox/assets/google-search-icon.js +9 -0
  86. package/docs/components/combobox/src/google-combobox/assets/google-voice-search-icon.js +19 -0
  87. package/docs/components/combobox/src/google-combobox/assets/googlelogo_color_272x92dp.png +0 -0
  88. package/docs/components/combobox/src/google-combobox/google-combobox.js +460 -0
  89. package/docs/components/combobox/src/lazyRender.js +29 -0
  90. package/docs/components/combobox/src/levenshtein.js +95 -0
  91. package/docs/components/combobox/src/md-combobox/MdFieldMixin.js +341 -0
  92. package/docs/components/combobox/src/md-combobox/md-combobox.js +89 -0
  93. package/docs/components/combobox/src/md-combobox/md-input.js +5 -0
  94. package/docs/components/combobox/src/md-combobox/style/load-roboto.js +6 -0
  95. package/docs/components/combobox/src/md-combobox/style/md-ripple.js +81 -0
  96. package/docs/components/combobox/src/wa-combobox/wa-combobox.js +368 -0
  97. package/docs/components/combobox/use-cases.md +377 -0
  98. package/docs/components/dialog/index.md +3 -0
  99. package/docs/components/dialog/overview.md +63 -0
  100. package/docs/components/dialog/src/demo-dialog-style.js +3 -0
  101. package/docs/components/dialog/src/demoStyle.js +39 -0
  102. package/docs/components/dialog/src/slots-dialog-content.js +32 -0
  103. package/docs/components/dialog/src/styled-dialog-content.js +38 -0
  104. package/docs/components/dialog/use-cases.md +154 -0
  105. package/docs/components/drawer/index.md +3 -0
  106. package/docs/components/drawer/overview.md +68 -0
  107. package/docs/components/drawer/src/demoStyle.js +71 -0
  108. package/docs/components/drawer/use-cases.md +194 -0
  109. package/docs/components/fieldset/index.md +3 -0
  110. package/docs/components/fieldset/overview.md +49 -0
  111. package/docs/components/fieldset/use-cases.md +185 -0
  112. package/docs/components/form/index.md +3 -0
  113. package/docs/components/form/overview.md +43 -0
  114. package/docs/components/form/use-cases.md +72 -0
  115. package/docs/components/icon/assets/bugs/bug01.svg.js +2 -0
  116. package/docs/components/icon/assets/bugs/bug02.svg.js +2 -0
  117. package/docs/components/icon/assets/bugs/bug05.svg.js +2 -0
  118. package/docs/components/icon/assets/bugs/bug06.svg.js +2 -0
  119. package/docs/components/icon/assets/bugs/bug08.svg.js +2 -0
  120. package/docs/components/icon/assets/bugs/bug12.svg.js +2 -0
  121. package/docs/components/icon/assets/bugs/bug19.svg.js +2 -0
  122. package/docs/components/icon/assets/bugs/bug23.svg.js +2 -0
  123. package/docs/components/icon/assets/bugs/bug24.svg.js +2 -0
  124. package/docs/components/icon/assets/iconset-bugs.js +11 -0
  125. package/docs/components/icon/assets/iconset-misc.js +3 -0
  126. package/docs/components/icon/assets/iconset-space.js +31 -0
  127. package/docs/components/icon/assets/misc/arrowLeft.svg.js +6 -0
  128. package/docs/components/icon/assets/space/aliens-spaceship.svg.js +2 -0
  129. package/docs/components/icon/assets/space/meteor.svg.js +2 -0
  130. package/docs/components/icon/assets/space/moon-flag.svg.js +2 -0
  131. package/docs/components/icon/assets/space/moon.svg.js +2 -0
  132. package/docs/components/icon/assets/space/night.svg.js +2 -0
  133. package/docs/components/icon/assets/space/orbit.svg.js +2 -0
  134. package/docs/components/icon/assets/space/planet.svg.js +2 -0
  135. package/docs/components/icon/assets/space/robot.svg.js +2 -0
  136. package/docs/components/icon/assets/space/rocket.svg.js +2 -0
  137. package/docs/components/icon/assets/space/satellite.svg.js +2 -0
  138. package/docs/components/icon/assets/space/signal.svg.js +2 -0
  139. package/docs/components/icon/assets/space/space-helmet.svg.js +2 -0
  140. package/docs/components/icon/assets/space/sun.svg.js +2 -0
  141. package/docs/components/icon/assets/space/telescope.svg.js +2 -0
  142. package/docs/components/icon/index.md +3 -0
  143. package/docs/components/icon/overview.md +40 -0
  144. package/docs/components/icon/use-cases.md +93 -0
  145. package/docs/components/index.md +7 -0
  146. package/docs/components/input/index.md +3 -0
  147. package/docs/components/input/overview.md +36 -0
  148. package/docs/components/input/use-cases.md +77 -0
  149. package/docs/components/input-amount/index.md +3 -0
  150. package/docs/components/input-amount/overview.md +49 -0
  151. package/docs/components/input-amount/use-cases.md +122 -0
  152. package/docs/components/input-date/index.md +3 -0
  153. package/docs/components/input-date/overview.md +39 -0
  154. package/docs/components/input-date/use-cases.md +83 -0
  155. package/docs/components/input-datepicker/index.md +3 -0
  156. package/docs/components/input-datepicker/overview.md +42 -0
  157. package/docs/components/input-datepicker/use-cases.md +78 -0
  158. package/docs/components/input-email/index.md +3 -0
  159. package/docs/components/input-email/overview.md +32 -0
  160. package/docs/components/input-email/use-cases.md +48 -0
  161. package/docs/components/input-iban/index.md +3 -0
  162. package/docs/components/input-iban/overview.md +37 -0
  163. package/docs/components/input-iban/use-cases.md +102 -0
  164. package/docs/components/input-range/index.md +3 -0
  165. package/docs/components/input-range/overview.md +34 -0
  166. package/docs/components/input-range/use-cases.md +108 -0
  167. package/docs/components/input-stepper/index.md +3 -0
  168. package/docs/components/input-stepper/overview.md +36 -0
  169. package/docs/components/input-stepper/use-cases.md +41 -0
  170. package/docs/components/input-tel/index.md +3 -0
  171. package/docs/components/input-tel/overview.md +62 -0
  172. package/docs/components/input-tel/src/h-region-code-table.js +109 -0
  173. package/docs/components/input-tel/use-cases.md +307 -0
  174. package/docs/components/input-tel-dropdown/examples.md +32 -0
  175. package/docs/components/input-tel-dropdown/index.md +3 -0
  176. package/docs/components/input-tel-dropdown/overview.md +38 -0
  177. package/docs/components/input-tel-dropdown/src/intl-input-tel-dropdown.js +127 -0
  178. package/docs/components/input-tel-dropdown/use-cases.md +159 -0
  179. package/docs/components/listbox/index.md +3 -0
  180. package/docs/components/listbox/overview.md +42 -0
  181. package/docs/components/listbox/src/listboxData.js +65 -0
  182. package/docs/components/listbox/use-cases.md +147 -0
  183. package/docs/components/pagination/index.md +3 -0
  184. package/docs/components/pagination/overview.md +29 -0
  185. package/docs/components/pagination/use-cases.md +99 -0
  186. package/docs/components/progress-indicator/assets/my-determinate-progress-bar.js +30 -0
  187. package/docs/components/progress-indicator/assets/my-indeterminate-progress-spinner.js +55 -0
  188. package/docs/components/progress-indicator/examples.md +125 -0
  189. package/docs/components/progress-indicator/index.md +3 -0
  190. package/docs/components/progress-indicator/overview.md +36 -0
  191. package/docs/components/radio-group/index.md +3 -0
  192. package/docs/components/radio-group/overview.md +46 -0
  193. package/docs/components/radio-group/use-cases.md +140 -0
  194. package/docs/components/select/index.md +3 -0
  195. package/docs/components/select/overview.md +44 -0
  196. package/docs/components/select/use-cases.md +55 -0
  197. package/docs/components/select-rich/examples.md +31 -0
  198. package/docs/components/select-rich/index.md +3 -0
  199. package/docs/components/select-rich/overview.md +46 -0
  200. package/docs/components/select-rich/src/flagStyles.js +1250 -0
  201. package/docs/components/select-rich/src/flags.png +0 -0
  202. package/docs/components/select-rich/src/flags@2x.png +0 -0
  203. package/docs/components/select-rich/src/intl-select-rich.js +194 -0
  204. package/docs/components/select-rich/src/regionMetaList.js +1717 -0
  205. package/docs/components/select-rich/use-cases.md +370 -0
  206. package/docs/components/steps/index.md +3 -0
  207. package/docs/components/steps/overview.md +63 -0
  208. package/docs/components/steps/use-cases.md +163 -0
  209. package/docs/components/switch/index.md +3 -0
  210. package/docs/components/switch/overview.md +75 -0
  211. package/docs/components/switch/reference.md +39 -0
  212. package/docs/components/switch/use-cases.md +76 -0
  213. package/docs/components/tabs/examples.md +23 -0
  214. package/docs/components/tabs/index.md +3 -0
  215. package/docs/components/tabs/overview.md +48 -0
  216. package/docs/components/tabs/src/lea-tab-panel.js +24 -0
  217. package/docs/components/tabs/src/lea-tab.js +45 -0
  218. package/docs/components/tabs/src/lea-tabs.js +28 -0
  219. package/docs/components/tabs/use-cases.md +219 -0
  220. package/docs/components/textarea/index.md +3 -0
  221. package/docs/components/textarea/overview.md +35 -0
  222. package/docs/components/textarea/use-cases.md +95 -0
  223. package/docs/components/tooltip/examples.md +39 -0
  224. package/docs/components/tooltip/index.md +3 -0
  225. package/docs/components/tooltip/overview.md +44 -0
  226. package/docs/components/tooltip/use-cases.md +208 -0
  227. package/docs/fundamentals/index.md +19 -0
  228. package/docs/fundamentals/node-tools/babel-plugin-extend-docs/index.md +1 -0
  229. package/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md +233 -0
  230. package/docs/fundamentals/node-tools/index.md +1 -0
  231. package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +68 -0
  232. package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +111 -0
  233. package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +69 -0
  234. package/docs/fundamentals/node-tools/providence-analytics/assets/_mermaid.svg.js +1202 -0
  235. package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +22 -0
  236. package/docs/fundamentals/node-tools/providence-analytics/index.md +1 -0
  237. package/docs/fundamentals/node-tools/providence-analytics/overview.md +192 -0
  238. package/docs/fundamentals/node-tools/publish-docs/index.md +1 -0
  239. package/docs/fundamentals/node-tools/publish-docs/overview.md +136 -0
  240. package/docs/fundamentals/node-tools/remark-extend/index.md +1 -0
  241. package/docs/fundamentals/node-tools/remark-extend/overview.md +274 -0
  242. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/index.md +1 -0
  243. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +285 -0
  244. package/docs/fundamentals/rationales/TypeScript.md +18 -0
  245. package/docs/fundamentals/rationales/index.md +1 -0
  246. package/docs/fundamentals/rationales/side-effects.md +203 -0
  247. package/docs/fundamentals/rationales/versioning.md +35 -0
  248. package/docs/fundamentals/systems/core/index.md +3 -0
  249. package/docs/fundamentals/systems/core/overview.md +85 -0
  250. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-1.svg +1 -0
  251. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-2.svg +1 -0
  252. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-3.svg +84 -0
  253. package/docs/fundamentals/systems/form/assets/h-output.js +155 -0
  254. package/docs/fundamentals/systems/form/formatting-and-parsing.md +245 -0
  255. package/docs/fundamentals/systems/form/index.md +3 -0
  256. package/docs/fundamentals/systems/form/interaction-states.md +177 -0
  257. package/docs/fundamentals/systems/form/model-value.md +35 -0
  258. package/docs/fundamentals/systems/form/overview.md +82 -0
  259. package/docs/fundamentals/systems/form/styling.md +101 -0
  260. package/docs/fundamentals/systems/form/use-cases.md +156 -0
  261. package/docs/fundamentals/systems/form/validate.md +929 -0
  262. package/docs/fundamentals/systems/icon/index.md +3 -0
  263. package/docs/fundamentals/systems/icon/overview.md +124 -0
  264. package/docs/fundamentals/systems/index.md +1 -0
  265. package/docs/fundamentals/systems/localize/assets/all-locales.js +437 -0
  266. package/docs/fundamentals/systems/localize/assets/en-AU.js +6 -0
  267. package/docs/fundamentals/systems/localize/assets/en-GB.js +6 -0
  268. package/docs/fundamentals/systems/localize/assets/en-US.js +6 -0
  269. package/docs/fundamentals/systems/localize/assets/en.js +4 -0
  270. package/docs/fundamentals/systems/localize/assets/nl-BE.js +6 -0
  271. package/docs/fundamentals/systems/localize/assets/nl-NL.js +6 -0
  272. package/docs/fundamentals/systems/localize/assets/nl.js +4 -0
  273. package/docs/fundamentals/systems/localize/dates.md +195 -0
  274. package/docs/fundamentals/systems/localize/index.md +3 -0
  275. package/docs/fundamentals/systems/localize/numbers.md +217 -0
  276. package/docs/fundamentals/systems/localize/overview.md +48 -0
  277. package/docs/fundamentals/systems/localize/rationale.md +62 -0
  278. package/docs/fundamentals/systems/localize/text.md +125 -0
  279. package/docs/fundamentals/systems/localize/use-cases.md +319 -0
  280. package/docs/fundamentals/systems/overlays/assets/applyDemoOverlayStyles.js +22 -0
  281. package/docs/fundamentals/systems/overlays/assets/demo-overlay-backdrop.js +48 -0
  282. package/docs/fundamentals/systems/overlays/assets/demo-overlay-system.js +42 -0
  283. package/docs/fundamentals/systems/overlays/assets/umbrella-form.js +133 -0
  284. package/docs/fundamentals/systems/overlays/configuration.md +453 -0
  285. package/docs/fundamentals/systems/overlays/form-integration.md +65 -0
  286. package/docs/fundamentals/systems/overlays/index.md +3 -0
  287. package/docs/fundamentals/systems/overlays/overview.md +118 -0
  288. package/docs/fundamentals/systems/overlays/rationale.md +232 -0
  289. package/docs/fundamentals/systems/overlays/scope.md +176 -0
  290. package/docs/fundamentals/systems/overlays/use-cases.md +699 -0
  291. package/docs/fundamentals/tools/ajax/assets/naga.json +9 -0
  292. package/docs/fundamentals/tools/ajax/assets/pabu.json +9 -0
  293. package/docs/fundamentals/tools/ajax/index.md +3 -0
  294. package/docs/fundamentals/tools/ajax/overview.md +128 -0
  295. package/docs/fundamentals/tools/ajax/use-cases.md +456 -0
  296. package/docs/fundamentals/tools/helpers/action-logger.md +165 -0
  297. package/docs/fundamentals/tools/helpers/index.md +3 -0
  298. package/docs/fundamentals/tools/helpers/overview.md +30 -0
  299. package/docs/fundamentals/tools/index.md +1 -0
  300. package/docs/fundamentals/tools/singleton-manager/index.md +3 -0
  301. package/docs/fundamentals/tools/singleton-manager/overview.md +304 -0
  302. package/docs/guides/how-to/create-a-custom-field.md +200 -0
  303. package/docs/guides/how-to/extend-a-native-input.md +66 -0
  304. package/docs/guides/how-to/get-started.md +77 -0
  305. package/docs/guides/how-to/index.md +1 -0
  306. package/docs/guides/index.md +34 -0
  307. package/docs/guides/principles/definitions-and-terms.md +41 -0
  308. package/docs/guides/principles/index.md +26 -0
  309. package/docs/guides/principles/scoped-elements.md +103 -0
  310. package/docs/guides/principles/styling.md +32 -0
  311. package/docs/guides/principles/subclasser-apis.md +28 -0
  312. package/docs/override.js +15 -0
  313. package/exports/core.js +2 -0
  314. package/exports/form-core.js +3 -0
  315. package/exports/input-tel-dropdown.js +3 -0
  316. package/exports/input-tel.js +2 -0
  317. package/exports/localize.js +4 -0
  318. package/exports/overlays.js +5 -0
  319. package/package.json +3 -2
@@ -0,0 +1,44 @@
1
+ # Tooltip >> Overview ||10
2
+
3
+ A web component used for basic popups on hover.
4
+ Its purpose is to show content appearing when the user hovers over an invoker element with the cursor or with the keyboard, or if the invoker element is focused.
5
+
6
+ ```js script
7
+ import { html } from '@mdjs/mdjs-preview';
8
+ import '@lion/ui/define/lion-tooltip.js';
9
+ ```
10
+
11
+ ```js preview-story
12
+ export const main = () => html`
13
+ <style>
14
+ .demo-tooltip-invoker {
15
+ margin: 50px;
16
+ }
17
+ </style>
18
+ <lion-tooltip has-arrow>
19
+ <button slot="invoker" class="demo-tooltip-invoker">Hover me</button>
20
+ <div slot="content">This is a tooltip</div>
21
+ </lion-tooltip>
22
+ `;
23
+ ```
24
+
25
+ ## Features
26
+
27
+ - Show content when hovering the invoker
28
+ - Show content when the invoker is focused
29
+ - Does not show content when invoker is disabled
30
+ - Uses Popper.js under the hood, to have the content pop up relative to the invoker
31
+ - Use `.config` to override the overlay configuration
32
+ - Config has `popperConfig` property that has a one to one relation with Popper.js configuration API.
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ npm i --save @lion/ui
38
+ ```
39
+
40
+ ```js
41
+ import { LionTooltip } from '@lion/ui/tooltip.js';
42
+ // or
43
+ import '@lion/ui/define/lion-tooltip.js';
44
+ ```
@@ -0,0 +1,208 @@
1
+ # Tooltip >> Use Cases ||20
2
+
3
+ ```js script
4
+ import { css, html } from '@mdjs/mdjs-preview';
5
+ import { LionTooltip } from '@lion/ui/tooltip.js';
6
+ import '@lion/ui/define/lion-tooltip.js';
7
+ ```
8
+
9
+ ## invokerRelation
10
+
11
+ There is a difference between tooltips used as a primary label or as a description. In most cases a button will already have its own label, so the tooltip will be used as a description with extra information, which is already set as default. Only in case of icon buttons you want to use the tooltip as the primary label. To do so you need to set the `invokerRelation` to `label`.
12
+
13
+ > For detailed information please read: [inclusive tooltips](https://inclusive-components.design/tooltips-toggletips/#inclusivetooltips).
14
+
15
+ ```js preview-story
16
+ export const invokerRelation = () => {
17
+ const invokerRelationConfig = { invokerRelation: 'label' };
18
+ return html`
19
+ <style>
20
+ .demo-tooltip-invoker {
21
+ margin: 50px;
22
+ }
23
+ </style>
24
+ <lion-tooltip .config=${invokerRelationConfig}>
25
+ <button slot="invoker" class="demo-tooltip-invoker">📅</button>
26
+ <div slot="content">Agenda<div>
27
+ </lion-tooltip>
28
+ `;
29
+ };
30
+ ```
31
+
32
+ ## Placements
33
+
34
+ You can easily change the placement of the content node relative to the invoker, by adjusting the `placement` inside the `popperConfig`.
35
+
36
+ ```js preview-story
37
+ export const placements = () => {
38
+ const placementTopConfig = { popperConfig: { placement: 'top' } };
39
+ const placementRightConfig = { popperConfig: { placement: 'right' } };
40
+ const placementBottomConfig = { popperConfig: { placement: 'bottom' } };
41
+ const placementLeftConfig = { popperConfig: { placement: 'left' } };
42
+ return html`
43
+ <style>
44
+ button[slot='invoker'] {
45
+ margin: 50px;
46
+ }
47
+ div[slot='content'] {
48
+ background-color: white;
49
+ padding: 4px;
50
+ }
51
+ </style>
52
+ <div class="demo-box-placements">
53
+ <lion-tooltip has-arrow .config=${placementTopConfig}>
54
+ <button slot="invoker">Top</button>
55
+ <div slot="content">Top placement</div>
56
+ </lion-tooltip>
57
+ <lion-tooltip has-arrow .config=${placementRightConfig}>
58
+ <button slot="invoker">Right</button>
59
+ <div slot="content">Right placement</div>
60
+ </lion-tooltip>
61
+ <lion-tooltip has-arrow .config=${placementBottomConfig}>
62
+ <button slot="invoker">Bottom</button>
63
+ <div slot="content">Bottom placement</div>
64
+ </lion-tooltip>
65
+ <lion-tooltip has-arrow .config=${placementLeftConfig}>
66
+ <button slot="invoker">Left</button>
67
+ <div slot="content">Left placement</div>
68
+ </lion-tooltip>
69
+ </div>
70
+ `;
71
+ };
72
+ ```
73
+
74
+ ## Override Popper configuration
75
+
76
+ You can override the Popper configuration, the API is one to one with Popper's API, and includes modifiers.
77
+
78
+ ```js preview-story
79
+ export const overridePopperConfig = () => {
80
+ const overridePopperConfig = {
81
+ popperConfig: {
82
+ placement: 'bottom-start',
83
+ strategy: 'fixed',
84
+ modifiers: [
85
+ {
86
+ name: 'keepTogether',
87
+ options: {},
88
+ enabled: true,
89
+ },
90
+ {
91
+ name: 'preventOverflow',
92
+ options: {
93
+ boundariesElement: 'viewport',
94
+ padding: 16,
95
+ },
96
+ enabled: false,
97
+ },
98
+ {
99
+ name: 'flip',
100
+ options: {
101
+ boundariesElement: 'viewport',
102
+ padding: 4,
103
+ },
104
+ enabled: true,
105
+ },
106
+ {
107
+ name: 'offset',
108
+ options: {
109
+ // Note the different offset notation
110
+ offset: [0, 4],
111
+ },
112
+ enabled: true,
113
+ },
114
+ ],
115
+ },
116
+ };
117
+ return html`
118
+ <style>
119
+ .demo-tooltip-invoker {
120
+ margin: 50px;
121
+ }
122
+ </style>
123
+ <lion-tooltip .config=${overridePopperConfig}>
124
+ <button slot="invoker" class="demo-tooltip-invoker">Hover me</button>
125
+ <div slot="content">This is a tooltip<div>
126
+ </lion-tooltip>
127
+ `;
128
+ };
129
+ ```
130
+
131
+ Modifier explanations:
132
+
133
+ - keepTogether: prevents detachment of content element from reference element, which could happen if the invoker is not in the viewport any more. If this is disabled, the content will always be in view.
134
+ - preventOverflow: enables shifting and sliding behavior on the secondary axis (e.g. if top placement, this is horizontal shifting and sliding). The padding property defines the margin with the boundariesElement, which is usually the viewport.
135
+ - flip: enables flipping behavior on the primary axis (e.g. if top placement, flipping to bottom if there is not enough space on the top). The padding property defines the margin with the boundariesElement, which is usually the viewport.
136
+ - offset: enables an offset between the content node and the invoker node. First argument is horizontal margin, second argument is vertical margin.
137
+
138
+ ## Arrow
139
+
140
+ By default, the arrow is disabled for our tooltip. Via the `has-arrow` property it can be enabled.
141
+
142
+ > As a Subclasser, you can decide to turn the arrow on by default if this fits your Design System, by setting `this.hasArrow = true;` in the constructor.
143
+
144
+ ```js preview-story
145
+ export const arrow = () => html`
146
+ <style>
147
+ .demo-tooltip-invoker {
148
+ margin: 50px;
149
+ }
150
+ </style>
151
+ <lion-tooltip has-arrow>
152
+ <button slot="invoker" class="demo-tooltip-invoker">Hover me</button>
153
+ <div slot="content">This is a tooltip</div>
154
+ </lion-tooltip>
155
+ `;
156
+ ```
157
+
158
+ ### Use a custom arrow
159
+
160
+ If you plan on providing a custom arrow, you can extend the `lion-tooltip`.
161
+
162
+ All you need to do is override the `_arrowTemplate` method to pass your own SVG, and extend the styles to pass the proper dimensions of your arrow.
163
+ The rest of the work is done by Popper.js (for positioning) and the `lion-tooltip-arrow` (arrow dimensions, rotation, etc.).
164
+
165
+ ```js preview-story
166
+ export const customArrow = () => {
167
+ if (!customElements.get('custom-tooltip')) {
168
+ customElements.define(
169
+ 'custom-tooltip',
170
+ class extends LionTooltip {
171
+ static get styles() {
172
+ return [
173
+ ...super.styles,
174
+ css`
175
+ :host {
176
+ --tooltip-arrow-width: 20px;
177
+ --tooltip-arrow-height: 8px;
178
+ }
179
+ `,
180
+ ];
181
+ }
182
+ constructor() {
183
+ super();
184
+ this.hasArrow = true;
185
+ }
186
+ _arrowTemplate() {
187
+ return html`
188
+ <svg viewBox="0 0 20 8" class="arrow__graphic">
189
+ <path d="M 0,0 h 20 L 10,8 z"></path>
190
+ </svg>
191
+ `;
192
+ }
193
+ },
194
+ );
195
+ }
196
+ return html`
197
+ <style>
198
+ .demo-tooltip-invoker {
199
+ margin: 50px;
200
+ }
201
+ </style>
202
+ <custom-tooltip>
203
+ <button slot="invoker" class="demo-tooltip-invoker">Hover me</button>
204
+ <div slot="content">This is a tooltip</div>
205
+ </custom-tooltip>
206
+ `;
207
+ };
208
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ title: Documentation
3
+ eleventyNavigation:
4
+ key: Fundamentals
5
+ order: 20
6
+ ---
7
+
8
+ Here you find more details about what we offer.
9
+
10
+ Let's see what each section describes.
11
+
12
+ 1. [](https://github.com/ing-bank/lion/blob/edc6920a90aa7658358819e7c324daf6badf7d30/docs/fundamentals/systems/core/overview.md) <br>
13
+ These are the fundamental systems that power all of our components.
14
+ 2. [Tools](https://github.com/ing-bank/lion/blob/edc6920a90aa7658358819e7c324daf6badf7d30/docs/fundamentals/tools/helpers/overview.md) <br>
15
+ Frontend Tools useful for web development but are not visual and therefore are not components.
16
+ 3. [Node Tools](https://github.com/ing-bank/lion/blob/edc6920a90aa7658358819e7c324daf6badf7d30/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md) <br>
17
+ Node tools to analyse the code and for extending the documentation.
18
+ 4. [Rationales](https://github.com/ing-bank/lion/blob/edc6920a90aa7658358819e7c324daf6badf7d30/docs/fundamentals/rationales/side-effects.md) <br>
19
+ The reasoning behind some of our decisions.
@@ -0,0 +1 @@
1
+ # Node Tools >> Babel Extend Docs ||10
@@ -0,0 +1,233 @@
1
+ # Node Tools >> Babel Extend Docs >> Overview ||10
2
+
3
+ A plugin which rewrites imports and templates according to a configuration.
4
+ This enables the reuse of existing documentation from source packages while still using your extensions code.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ npm i -D babel-plugin-extend-docs
10
+ ```
11
+
12
+ We want to only execute `babel-plugin-extend-docs` on the actual files we want to modify/extend.
13
+
14
+ You may also consider using [babel overrides](https://babeljs.io/docs/en/options#overrides).
15
+
16
+ 👉 _web-dev-server.config.js_
17
+
18
+ ```js
19
+ import path from 'path';
20
+ import { fromRollup } from '@web/dev-server-rollup';
21
+ import rollupBabel from '@rollup/plugin-babel';
22
+
23
+ const extendDocsConfig = {
24
+ changes: [
25
+ // possible changes as described below
26
+ ],
27
+ };
28
+
29
+ // note that you need to use `.default` for babel
30
+ const babel = fromRollup(rollupBabel.default);
31
+
32
+ export default {
33
+ nodeResolve: true,
34
+ plugins: [
35
+ babel({
36
+ include: ['./glob/to/files/**/*.js'],
37
+ plugins: [[path.resolve('./'), extendDocsConfig]],
38
+ }),
39
+ ],
40
+ };
41
+ ```
42
+
43
+ ## Features
44
+
45
+ - Renames named imports and all it's usage
46
+ - Adjusts import paths
47
+ - Replace tags in template literals
48
+
49
+ ## A Change
50
+
51
+ A change is what gets placed between in the extendDocsConfig within the `changes` array.
52
+
53
+ > automating the generation of changes is optional but encouraged
54
+
55
+ It has the following possibilities:
56
+
57
+ ```js
58
+ changes: [
59
+ {
60
+ description: 'MyCounter', // not needed but can be added for easier reading of the config
61
+ variable: {
62
+ // see below
63
+ },
64
+ tag: {
65
+ // see below
66
+ },
67
+ },
68
+ ];
69
+ ```
70
+
71
+ ### Paths
72
+
73
+ Both `variable` and `tag` are required to have a `paths` array which defines how to remap import paths. Generally it should be a single entry.
74
+
75
+ ```js
76
+ paths: [
77
+ { from: 'source-pkg/counter', to: 'extension-pkg/counter' },
78
+ ],
79
+ ```
80
+
81
+ ## Replacement of tags
82
+
83
+ We have an existing demo code which we want to reuse.
84
+
85
+ ```js
86
+ import { LitElement, html } from 'lit';
87
+ import 'source-pkg/counter/define';
88
+ class MyApp extends LitElement {
89
+ render() {
90
+ return html`
91
+ <h1>Example App</h1>
92
+ <source-counter></source-counter>
93
+ `;
94
+ }
95
+ }
96
+ customElements.define('my-app', MyApp);
97
+ ```
98
+
99
+ We created a "better" version of `<source-counter>` so we would like to use that in the demo.
100
+ Our extension is called `<extension-counter>` and is available via `extension-pkg/counter/define`.
101
+
102
+ Within `babel-plugin-extend-docs` we can define to replace the tag + it's import.
103
+
104
+ ```js
105
+ tag: {
106
+ from: 'source-counter',
107
+ to: 'extension-counter',
108
+ paths: [{ from: 'source-pkg/counter/define', to: 'extension-pkg/counter/define' }],
109
+ }
110
+ ```
111
+
112
+ ### Result of Replacement of tags
113
+
114
+ ```js
115
+ import { LitElement, html } from 'lit';
116
+ import 'extension-pkg/counter/define';
117
+ class MyApp extends LitElement {
118
+ render() {
119
+ return html`
120
+ <h1>Example App</h1>
121
+ <extension-counter></extension-counter>
122
+ `;
123
+ }
124
+ }
125
+ customElements.define('my-app', MyApp);
126
+ ```
127
+
128
+ ## Replacement of classes
129
+
130
+ We have an existing demo code which we want to reuse.
131
+
132
+ ```js
133
+ import { LitElement, html } from 'lit';
134
+ import { SourceCounter } from 'source-pkg/counter';
135
+ class TenCounter extends SourceCounter {
136
+ inc() {
137
+ this.count += 10;
138
+ }
139
+ }
140
+ customElements.define('ten-counter', TenCounter);
141
+
142
+ class MyApp extends LitElement {
143
+ render() {
144
+ return html`
145
+ <h1>Example App</h1>
146
+ <ten-counter></ten-counter>
147
+ `;
148
+ }
149
+ }
150
+ customElements.define('my-app', MyApp);
151
+ ```
152
+
153
+ We created a "better" version of `SourceCounter` so we would like that `TenCounter` now extends it instead.
154
+
155
+ Within `babel-plugin-extend-docs` we can define to replace the class + it's import.
156
+
157
+ ```js
158
+ variable: {
159
+ from: 'SourceCounter',
160
+ to: 'ExtensionCounter',
161
+ paths: [
162
+ { from: 'source-pkg/counter', to: 'extension-pkg/counter' },
163
+ ],
164
+ },
165
+ ```
166
+
167
+ ### Result of Replacement of classes
168
+
169
+ ```js
170
+ import { LitElement, html } from 'lit';
171
+ import { SourceCounter } from 'extension-pkg/counter';
172
+ class TenCounter extends SourceCounter {
173
+ inc() {
174
+ this.count += 10;
175
+ }
176
+ }
177
+ customElements.define('ten-counter', TenCounter);
178
+ class MyApp extends LitElement {
179
+ render() {
180
+ return html`
181
+ <h1>Example App</h1>
182
+ <ten-counter></ten-counter>
183
+ `;
184
+ }
185
+ }
186
+ customElements.define('my-app', MyApp);
187
+ ```
188
+
189
+ ## Full Demo & Api Example
190
+
191
+ You can run the example locally via `npm run start` or look at its [source code](https://github.com/ing-bank/lion/tree/master/packages-node/babel-plugin-extend-docs/demo/).
192
+ _Note we are configuring babel via the [server.config.mjs](https://github.com/ing-bank/lion/tree/master/packages-node/babel-plugin-extend-docs/demo/server.config.mjs)_
193
+
194
+ 👉 _server.config.mjs_
195
+
196
+ ```js
197
+ import path from 'path';
198
+ import { fromRollup } from '@web/dev-server-rollup';
199
+ import rollupBabel from '@rollup/plugin-babel';
200
+
201
+ const extendDocsConfig = {
202
+ changes: [
203
+ {
204
+ name: 'SourceCounter',
205
+ variable: {
206
+ from: 'SourceCounter',
207
+ to: 'ExtensionCounter',
208
+ paths: [{ from: '#source/counter', to: '#extension/counter' }],
209
+ },
210
+ tag: {
211
+ from: 'source-counter',
212
+ to: 'extension-counter',
213
+ paths: [{ from: '#source/counter/define', to: '#extension/counter/define' }],
214
+ },
215
+ },
216
+ ],
217
+ };
218
+
219
+ // note that you need to use `.default` for babel
220
+ const babel = fromRollup(rollupBabel.default);
221
+
222
+ export default {
223
+ nodeResolve: true,
224
+ watch: true,
225
+ open: 'demo/',
226
+ plugins: [
227
+ babel({
228
+ include: ['./demo/**/*.demo.js'],
229
+ plugins: [[path.resolve('./'), extendDocsConfig]],
230
+ }),
231
+ ],
232
+ };
233
+ ```
@@ -0,0 +1 @@
1
+ # Node Tools ||30
@@ -0,0 +1,68 @@
1
+ # Node Tools >> Providence Analytics >> Local configuration ||40
2
+
3
+ The Providence configuration file is read by providence cli (optional) and by the dashboard (required).
4
+ It has a few requirements:
5
+
6
+ - it must be called `providence.conf.js` or `providence.conf.mjs`
7
+ - it must be in ESM format
8
+ - it must be located in the root of a repository (under `process.cwd()`)
9
+
10
+ ## Meta data
11
+
12
+ ### Category info
13
+
14
+ Based on the filePath of a result, a category can be added.
15
+ For example:
16
+
17
+ ```js
18
+ export default {
19
+ metaConfig: {
20
+ categoryConfig: [
21
+ {
22
+ // This is the name found in package.json
23
+ project: '@lion/ui/root.js',
24
+ // These conditions will be run on overy filePath
25
+ categories: {
26
+ core: p => p.startsWith('./packages/core'),
27
+ utils: p => p.startsWith('./packages/ajax') || p.startsWith('./packages/localize'),
28
+ overlays: p =>
29
+ p.startsWith('./packages/overlays') ||
30
+ p.startsWith('./packages/dialog') ||
31
+ p.startsWith('./packages/tooltip'),
32
+ ...
33
+ },
34
+ },
35
+ ],
36
+ },
37
+ }
38
+ ```
39
+
40
+ > N.B. category info is regarded as subjective, therefore it's advised to move this away from
41
+ > Analyzers (and thus file-system cache). Categories can be added realtime in the dashboard.
42
+
43
+ ## Project paths
44
+
45
+ ### referenceCollections
46
+
47
+ A list of file system paths. They can be defined relative from the current project root or they can be full paths.
48
+ When a [MatchAnalyzer](https://github.com/ing-bank/lion/blob/edc6920a90aa7658358819e7c324daf6badf7d30/docs/fundamentals/node-tools/providence-analytics/analyzer.md) like `match-imports` or `match-subclasses` is used, the default reference(s) can be configured here. For instance: ['/path/to/@lion/ui/form.js']
49
+
50
+ An example:
51
+
52
+ ```js
53
+ referenceCollections: {
54
+ // Our products
55
+ 'lion-based-ui': [
56
+ './providence-input-data/references/lion-based-ui',
57
+ './providence-input-data/references/lion-based-ui-labs',
58
+ ],
59
+ ...
60
+ }
61
+ ```
62
+
63
+ ### searchTargetCollections
64
+
65
+ A list of file system paths. They can be defined relative from the current project root
66
+ or they can be full paths.
67
+ When not defined, the current project will be the search target (this is most common when
68
+ providence is used as a dev dependency).
@@ -0,0 +1,111 @@
1
+ # Node Tools >> Providence Analytics >> QueryResult ||50
2
+
3
+ When an Analyzer has run, it returns a QueryResult. This is a json object that contains all
4
+ meta info (mainly configuration parameters) and the query output.
5
+ A QueryResult always contains the analysis of one project (a target project). Optionally,
6
+ it can contain a reference project as well.
7
+
8
+ ## Anatomy
9
+
10
+ A QueryResult starts with a meta section, followed by the actual results
11
+
12
+ ### Meta
13
+
14
+ The meta section lists all configuration options the analyzer was run with. Here, you see an
15
+ example of a `find-imports` QueryResult:
16
+
17
+ ```js
18
+ "meta": {
19
+ "searchType": "ast-analyzer",
20
+ "analyzerMeta": {
21
+ "name": "find-imports",
22
+ "requiredAst": "babel",
23
+ "identifier": "importing-target-project_0.0.2-target-mock__1970011674",
24
+ "targetProject": {
25
+ "name": "importing-target-project",
26
+ "commitHash": "3e5014d6ecdff1fc71138cdb29aaf7bf367588f5",
27
+ "version": "0.0.2-target-mock"
28
+ },
29
+ "configuration": {
30
+ "keepInternalSources": false
31
+ }
32
+ }
33
+ },
34
+ ```
35
+
36
+ ### Output
37
+
38
+ The output is usually more specifically tied to the Analyzer. What most regular Analyzers
39
+ (not being MatchAnalyzers that require a referenceProjectPath) have in common, is that their
40
+ results are being shown per "entry" (an entry corresponds with an AST generated by Babel, which in
41
+ turn corresponds to a file found in a target or reference project).
42
+
43
+ Below an example is shown of `find-imports` QueryOutput:
44
+
45
+ ```js
46
+ "queryOutput": [
47
+ {
48
+ "project": {
49
+ "name": "importing-target-project",
50
+ "mainEntry": "./target-src/match-imports/root-level-imports.js",
51
+ "version": "0.0.2-target-mock",
52
+ "commitHash": "3e5014d6ecdff1fc71138cdb29aaf7bf367588f5"
53
+ },
54
+ "entries": [
55
+ {
56
+ "file": "./target-src/find-imports/all-notations.js",
57
+ "result": [
58
+ {
59
+ "importSpecifiers": [
60
+ "[file]"
61
+ ],
62
+ "source": "imported/source",
63
+ "normalizedSource": "imported/source",
64
+ "fullSource": "imported/source"
65
+ },
66
+ {
67
+ "importSpecifiers": [
68
+ "[default]"
69
+ ],
70
+ "source": "imported/source-a",
71
+ "normalizedSource": "imported/source-a",
72
+ "fullSource": "imported/source-a"
73
+ },
74
+ ...
75
+ ```
76
+
77
+ MatchAnalyzers usually do post processing on the entries. The output below (for the `match-imports`
78
+ Analyzer) shows an ordering by matched specifier.
79
+
80
+ ```js
81
+ "queryOutput": [
82
+ {
83
+ "exportSpecifier": {
84
+ "name": "[default]",
85
+ "project": "exporting-ref-project",
86
+ "filePath": "./index.js",
87
+ "id": "[default]::./index.js::exporting-ref-project"
88
+ },
89
+ "matchesPerProject": [
90
+ {
91
+ "project": "importing-target-project",
92
+ "files": [
93
+ "./target-src/match-imports/root-level-imports.js",
94
+ "./target-src/match-subclasses/internalProxy.js"
95
+ ]
96
+ }
97
+ ]
98
+ },
99
+ ...
100
+ ```
101
+
102
+ Due to some legacy decisions, the QueryOutput allows for multiple target- and reference projects.
103
+ Aggregation of data now takes place in the dashboard.
104
+ QueryOutputs always contain one or a combination of two projects. This means that the
105
+ QueryOutput structure could be simplified in the future.
106
+
107
+ ## Environment agnosticism
108
+
109
+ The output files stored in the file system always need to be machine independent:
110
+ this means that all machine specific information, like a complete filepath, needs to be removed from a QueryOutput (paths relative from project root are still allowed).
111
+ In that way, the caching mechanism (based on hash comparisons) as described in [Analyzer](https://github.com/ing-bank/lion/blob/edc6920a90aa7658358819e7c324daf6badf7d30/docs/fundamentals/node-tools/providence-analytics/analyzer.md) is guaranteed to work across different machines.