@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,159 @@
1
+ # Input Tel Dropdown >> Use Cases ||20
2
+
3
+ ```js script
4
+ import { html } from '@mdjs/mdjs-preview';
5
+ import { ref, createRef } from 'lit/directives/ref.js';
6
+ import { loadDefaultFeedbackMessages } from '@lion/ui/validate-messages.js';
7
+ import { PhoneUtilManager } from '@lion/ui/input-tel.js';
8
+ import '@lion/ui/define/lion-input-tel-dropdown.js';
9
+ import '../../../docs/fundamentals/systems/form/assets/h-output.js';
10
+
11
+ // TODO: make each example load/use the dependencies by default
12
+ // loadDefaultFeedbackMessages();
13
+ ```
14
+
15
+ ## Input Tel Dropdown
16
+
17
+ When `.allowedRegions` is not configured, all regions/countries will be available in the dropdown
18
+ list. Once a region is chosen, its country/dial code will be adjusted with that of the new locale.
19
+
20
+ ```js preview-story
21
+ export const InputTelDropdown = () => {
22
+ loadDefaultFeedbackMessages();
23
+ return html`
24
+ <lion-input-tel-dropdown
25
+ label="Select region via dropdown"
26
+ help-text="Shows all regions by default"
27
+ name="phoneNumber"
28
+ ></lion-input-tel-dropdown>
29
+ <h-output
30
+ .show="${['modelValue', 'activeRegion']}"
31
+ .readyPromise="${PhoneUtilManager.loadComplete}"
32
+ ></h-output>
33
+ `;
34
+ };
35
+ ```
36
+
37
+ ## Allowed regions
38
+
39
+ When `.allowedRegions` is configured, only those regions/countries will be available in the dropdown
40
+ list.
41
+
42
+ ```js preview-story
43
+ export const allowedRegions = () => {
44
+ loadDefaultFeedbackMessages();
45
+ return html`
46
+ <lion-input-tel-dropdown
47
+ label="Select region via dropdown"
48
+ help-text="With region code 'NL'"
49
+ .modelValue=${'+31612345678'}
50
+ name="phoneNumber"
51
+ .allowedRegions=${['NL', 'DE', 'GB']}
52
+ ></lion-input-tel-dropdown>
53
+ <h-output
54
+ .show="${['modelValue', 'activeRegion']}"
55
+ .readyPromise="${PhoneUtilManager.loadComplete}"
56
+ ></h-output>
57
+ `;
58
+ };
59
+ ```
60
+
61
+ ## Preferred regions
62
+
63
+ When `.preferredRegions` is configured, they will show up on top of the dropdown list to enhance user experience.
64
+
65
+ ```js preview-story
66
+ export const preferredRegionCodes = () => {
67
+ loadDefaultFeedbackMessages();
68
+ return html`
69
+ <lion-input-tel-dropdown
70
+ label="Select region via dropdown"
71
+ help-text="Preferred regions show on top"
72
+ .modelValue=${'+31612345678'}
73
+ name="phoneNumber"
74
+ .allowedRegions=${['BE', 'CA', 'DE', 'GB', 'NL', 'US']}
75
+ .preferredRegions=${['DE', 'NL']}
76
+ ></lion-input-tel-dropdown>
77
+ <h-output
78
+ .show="${['modelValue', 'activeRegion']}"
79
+ .readyPromise="${PhoneUtilManager.loadComplete}"
80
+ ></h-output>
81
+ `;
82
+ };
83
+ ```
84
+
85
+ ## Format
86
+
87
+ ### Format strategy
88
+
89
+ Determines what the formatter output should look like.
90
+ Formatting strategies as provided by awesome-phonenumber / google-libphonenumber.
91
+
92
+ Possible values:
93
+
94
+ | strategy | output |
95
+ | :------------ | ------------------------------------: |
96
+ | e164 | `+46707123456` |
97
+ | international | `+46 70 712 34 56` |
98
+ | national | not applicable for input-tel-dropdown |
99
+ | significant | not applicable for input-tel-dropdown |
100
+ | rfc3966 | `tel:+46-70-712-34-56` |
101
+
102
+ Also see:
103
+
104
+ - [awesome-phonenumber documentation](https://www.npmjs.com/package/awesome-phonenumber)
105
+
106
+ ```js preview-story
107
+ export const formatStrategy = () => {
108
+ loadDefaultFeedbackMessages();
109
+ const inputTel = createRef();
110
+ return html`
111
+ <select @change="${({ target }) => (inputTel.value.formatStrategy = target.value)}">
112
+ <option value="e164">e164</option>
113
+ <option value="international">international</option>
114
+ <option value="rfc3966">rfc3966</option>
115
+ </select>
116
+ <lion-input-tel-dropdown
117
+ ${ref(inputTel)}
118
+ label="Format strategy"
119
+ help-text="Choose a strategy above"
120
+ format-strategy="e164"
121
+ name="phoneNumber"
122
+ ></lion-input-tel-dropdown>
123
+ <h-output
124
+ .show="${['modelValue', 'formatStrategy']}"
125
+ .readyPromise="${PhoneUtilManager.loadComplete}"
126
+ ></h-output>
127
+ `;
128
+ };
129
+ ```
130
+
131
+ ### Format country code style
132
+
133
+ You can style the country code with parentheses.
134
+
135
+ ```js preview-story
136
+ export const formatCountryCodeStyle = () => {
137
+ loadDefaultFeedbackMessages();
138
+ const inputTel = createRef();
139
+ return html`
140
+ <select @change="${({ target }) => (inputTel.value.formatStrategy = target.value)}">
141
+ <option value="e164">e164</option>
142
+ <option value="international">international</option>
143
+ <option value="rfc3966">rfc3966</option>
144
+ </select>
145
+ <lion-input-tel-dropdown
146
+ ${ref(inputTel)}
147
+ label="Format strategy"
148
+ help-text="Choose a strategy above"
149
+ format-country-code-style="parentheses"
150
+ format-strategy="e164"
151
+ name="phoneNumber"
152
+ ></lion-input-tel-dropdown>
153
+ <h-output
154
+ .show="${['modelValue', 'formatStrategy']}"
155
+ .readyPromise="${PhoneUtilManager.loadComplete}"
156
+ ></h-output>
157
+ `;
158
+ };
159
+ ```
@@ -0,0 +1,3 @@
1
+ # Listbox ||20
2
+
3
+ -> go to Overview
@@ -0,0 +1,42 @@
1
+ # Listbox >> Overview ||10
2
+
3
+ A widget that presents a list of options and allows a user to select one or more of them.
4
+ A listbox that allows a single option to be chosen is a `single-select listbox`; one that allows
5
+ multiple options to be selected is a `multi-select listbox`.
6
+
7
+ > From [listbox wai-aria best practices](https://www.w3.org/TR/wai-aria-practices/#Listbox)
8
+
9
+ ```js script
10
+ import { html } from '@mdjs/mdjs-preview';
11
+ import '@lion/ui/define/lion-listbox.js';
12
+ import '@lion/ui/define/lion-option.js';
13
+ ```
14
+
15
+ ```js preview-story
16
+ export const main = () => html`
17
+ <lion-listbox name="listbox" label="Default">
18
+ <lion-option .choiceValue=${'Apple'}>Apple</lion-option>
19
+ <lion-option checked .choiceValue=${'Artichoke'}>Artichoke</lion-option>
20
+ <lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
21
+ <lion-option .choiceValue=${'Banana'}>Banana</lion-option>
22
+ <lion-option .choiceValue=${'Beets'}>Beets</lion-option>
23
+ </lion-listbox>
24
+ `;
25
+ ```
26
+
27
+ ## Features
28
+
29
+ - Single & Multiple Choice
30
+ - Orientation
31
+ - Rotation when using keyboard for selection
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ npm i --save @lion/ui
37
+ ```
38
+
39
+ ```js
40
+ import '@lion/ui/define/lion-listbox.js';
41
+ import '@lion/ui/define/lion-option.js';
42
+ ```
@@ -0,0 +1,65 @@
1
+ export const listboxData = [
2
+ 'Apple',
3
+ 'Artichoke',
4
+ 'Asparagus',
5
+ 'Banana',
6
+ 'Beets',
7
+ 'Bell pepper',
8
+ 'Broccoli',
9
+ 'Brussels sprout',
10
+ 'Cabbage',
11
+ 'Carrot',
12
+ 'Cauliflower',
13
+ 'Celery',
14
+ 'Chard',
15
+ 'Chicory',
16
+ 'Corn',
17
+ 'Cucumber',
18
+ 'Daikon',
19
+ 'Date',
20
+ 'Edamame',
21
+ 'Eggplant',
22
+ 'Elderberry',
23
+ 'Fennel',
24
+ 'Fig',
25
+ 'Garlic',
26
+ 'Grape',
27
+ 'Honeydew melon',
28
+ 'Iceberg lettuce',
29
+ 'Jerusalem artichoke',
30
+ 'Kale',
31
+ 'Kiwi',
32
+ 'Leek',
33
+ 'Lemon',
34
+ 'Mango',
35
+ 'Mangosteen',
36
+ 'Melon',
37
+ 'Mushroom',
38
+ 'Nectarine',
39
+ 'Okra',
40
+ 'Olive',
41
+ 'Onion',
42
+ 'Orange',
43
+ 'Parship',
44
+ 'Pea',
45
+ 'Pear',
46
+ 'Pineapple',
47
+ 'Potato',
48
+ 'Pumpkin',
49
+ 'Quince',
50
+ 'Radish',
51
+ 'Rhubarb',
52
+ 'Shallot',
53
+ 'Spinach',
54
+ 'Squash',
55
+ 'Strawberry',
56
+ 'Sweet potato',
57
+ 'Tomato',
58
+ 'Turnip',
59
+ 'Ugli fruit',
60
+ 'Victoria plum',
61
+ 'Watercress',
62
+ 'Watermelon',
63
+ 'Yam',
64
+ 'Zucchini',
65
+ ];
@@ -0,0 +1,147 @@
1
+ # Listbox >> Use Cases ||20
2
+
3
+ ```js script
4
+ import { html } from '@mdjs/mdjs-preview';
5
+ import { listboxData } from './src/listboxData.js';
6
+ import '@lion/ui/define/lion-listbox.js';
7
+ import '@lion/ui/define/lion-option.js';
8
+ ```
9
+
10
+ ## Multiple choice
11
+
12
+ Add `multiple-choice` flag to allow multiple values to be selected.
13
+ This will:
14
+
15
+ - keep the listbox overlay open on click of an option
16
+ - display a list of selected option representations next to the text box
17
+ - make the value of type `Array` instead of `String`
18
+
19
+ ```js preview-story
20
+ export const multiple = () => html`
21
+ <lion-listbox name="combo" label="Multiple" multiple-choice>
22
+ <lion-option .choiceValue=${'Apple'}>Apple</lion-option>
23
+ <lion-option .choiceValue=${'Artichoke'}>Artichoke</lion-option>
24
+ <lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
25
+ <lion-option .choiceValue=${'Banana'}>Banana</lion-option>
26
+ <lion-option .choiceValue=${'Beets'}>Beets</lion-option>
27
+ <lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
28
+ <lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
29
+ <lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
30
+ <lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
31
+ <lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
32
+ </lion-listbox>
33
+ `;
34
+ ```
35
+
36
+ ## Orientation
37
+
38
+ When `orientation="horizontal"`, left and right arrow keys will be enabled, plus the screenreader
39
+ will be informed about the direction of the options.
40
+ By default, `orientation="vertical"` is set, which enables up and down arrow keys.
41
+
42
+ ```js preview-story
43
+ export const orientationHorizontal = () => html`
44
+ <lion-listbox name="combo" label="Orientation horizontal" orientation="horizontal">
45
+ <lion-option .choiceValue=${'Apple'}>Apple</lion-option>
46
+ <lion-option .choiceValue=${'Artichoke'}>Artichoke</lion-option>
47
+ <lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
48
+ <lion-option .choiceValue=${'Banana'}>Banana</lion-option>
49
+ <lion-option .choiceValue=${'Beets'}>Beets</lion-option>
50
+ <lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
51
+ <lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
52
+ <lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
53
+ <lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
54
+ <lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
55
+ </lion-listbox>
56
+ `;
57
+ ```
58
+
59
+ With `multiple-choice` flag configured, multiple options can be checked.
60
+
61
+ ```js preview-story
62
+ export const orientationHorizontalMultiple = () => html`
63
+ <lion-listbox
64
+ name="combo"
65
+ label="Orientation horizontal multiple"
66
+ orientation="horizontal"
67
+ multiple-choice
68
+ >
69
+ <lion-option .choiceValue=${'Apple'}>Apple</lion-option>
70
+ <lion-option .choiceValue=${'Artichoke'}>Artichoke</lion-option>
71
+ <lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
72
+ <lion-option .choiceValue=${'Banana'}>Banana</lion-option>
73
+ <lion-option .choiceValue=${'Beets'}>Beets</lion-option>
74
+ <lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
75
+ <lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
76
+ <lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
77
+ <lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
78
+ <lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
79
+ </lion-listbox>
80
+ `;
81
+ ```
82
+
83
+ ## Selection-follows-focus
84
+
85
+ When true, will synchronize activedescendant and selected element on arrow key navigation.
86
+ This behavior can usually be seen in `<select>` on the Windows platform.
87
+ Note that this behavior cannot be used when multiple-choice is true.
88
+ See [wai aria spec](https://www.w3.org/TR/wai-aria-practices/#kbd_selection_follows_focus)
89
+
90
+ ```js preview-story
91
+ export const selectionFollowsFocus = () => html`
92
+ <lion-listbox name="combo" label="Selection follows focus" selection-follows-focus>
93
+ <lion-option .choiceValue=${'Apple'}>Apple</lion-option>
94
+ <lion-option .choiceValue=${'Artichoke'} disabled>Artichoke</lion-option>
95
+ <lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
96
+ <lion-option .choiceValue=${'Banana'}>Banana</lion-option>
97
+ <lion-option .choiceValue=${'Beets'}>Beets</lion-option>
98
+ <lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
99
+ <lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
100
+ <lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
101
+ <lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
102
+ <lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
103
+ </lion-listbox>
104
+ `;
105
+ ```
106
+
107
+ ## Rotate keyboard navigation
108
+
109
+ `rotate-keyboard-navigation` attribute on the listbox will give the first option active state when navigated to the next option from last option.
110
+
111
+ ```js preview-story
112
+ export const rotateKeyboardNavigation = () => html`
113
+ <lion-listbox name="combo" label="Rotate keyboard navigation" rotate-keyboard-navigation>
114
+ <lion-option .choiceValue=${'Apple'}>Apple</lion-option>
115
+ <lion-option .choiceValue=${'Artichoke'}>Artichoke</lion-option>
116
+ <lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
117
+ <lion-option .choiceValue=${'Banana'}>Banana</lion-option>
118
+ <lion-option .choiceValue=${'Beets'}>Beets</lion-option>
119
+ <lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
120
+ <lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
121
+ <lion-option .choiceValue=${'Brussels sprout'}>Brussels sprout</lion-option>
122
+ <lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
123
+ <lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
124
+ </lion-listbox>
125
+ `;
126
+ ```
127
+
128
+ ## Disabled options
129
+
130
+ Navigation will skip over disabled options. Let's disable Artichoke and Brussel sprout, because they're gross.
131
+
132
+ ```js preview-story
133
+ export const disabledRotateNavigation = () => html`
134
+ <lion-listbox name="combo" label="Rotate with disabled options" rotate-keyboard-navigation>
135
+ <lion-option .choiceValue=${'Apple'}>Apple</lion-option>
136
+ <lion-option .choiceValue=${'Artichoke'} disabled>Artichoke</lion-option>
137
+ <lion-option .choiceValue=${'Asparagus'}>Asparagus</lion-option>
138
+ <lion-option .choiceValue=${'Banana'}>Banana</lion-option>
139
+ <lion-option .choiceValue=${'Beets'}>Beets</lion-option>
140
+ <lion-option .choiceValue=${'Bell pepper'}>Bell pepper</lion-option>
141
+ <lion-option .choiceValue=${'Broccoli'}>Broccoli</lion-option>
142
+ <lion-option .choiceValue=${'Brussels sprout'} disabled>Brussels sprout</lion-option>
143
+ <lion-option .choiceValue=${'Cabbage'}>Cabbage</lion-option>
144
+ <lion-option .choiceValue=${'Carrot'}>Carrot</lion-option>
145
+ </lion-listbox>
146
+ `;
147
+ ```
@@ -0,0 +1,3 @@
1
+ # Pagination ||30
2
+
3
+ -> go to Overview
@@ -0,0 +1,29 @@
1
+ # Pagination >> Overview ||10
2
+
3
+ A web component that handles pagination.
4
+
5
+ ```js script
6
+ import { html } from '@mdjs/mdjs-preview';
7
+ import '@lion/ui/define/lion-pagination.js';
8
+ ```
9
+
10
+ ```js preview-story
11
+ export const main = () => html` <lion-pagination count="20" current="10"></lion-pagination> `;
12
+ ```
13
+
14
+ ## Features
15
+
16
+ - You can pass the total number of pages in the `count` parameter, and the current page in the `current` parameter. If `current` is not defined it will default to the value 1.
17
+ - On a click or parameter change of `current` it will fire an event back called `current-changed`.
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm i --save @lion/ui
23
+ ```
24
+
25
+ ```js
26
+ import { LionPagination } from '@lion/ui/pagination.js';
27
+ // or
28
+ import '@lion/ui/define/lion-pagination.js';
29
+ ```
@@ -0,0 +1,99 @@
1
+ # Pagination >> Use Cases ||20
2
+
3
+ ```js script
4
+ import { html } from '@mdjs/mdjs-preview';
5
+ import '@lion/ui/define/lion-pagination.js';
6
+ ```
7
+
8
+ ## Without current defined
9
+
10
+ ```js preview-story
11
+ export const withoutCurrentPage = () => {
12
+ return html` <lion-pagination count="20"></lion-pagination> `;
13
+ };
14
+ ```
15
+
16
+ ## Ensure a count value
17
+
18
+ Be sure to set a count value or you will get an "empty" pagination.
19
+
20
+ ```js preview-story
21
+ export const ensureCount = () => {
22
+ return html` <lion-pagination></lion-pagination> `;
23
+ };
24
+ ```
25
+
26
+ ### Methods
27
+
28
+ There are the following methods available to control the pagination.
29
+
30
+ - `next()`: move forward in pagination
31
+ - `previous()`: goes back to pagination
32
+ - `first()`: to the first page
33
+ - `last()`: to the last page
34
+ - `goto(pageNumber)`: to the specific page
35
+
36
+ ```js preview-story
37
+ export const methods = ({ shadowRoot }) => {
38
+ setTimeout(() => {
39
+ shadowRoot.getElementById('pagination-method-demo').innerText =
40
+ shadowRoot.getElementById('pagination-method').current;
41
+ });
42
+
43
+ return html`
44
+ <p>The current page is: <span id="pagination-method-demo"></span></p>
45
+ <lion-pagination
46
+ id="pagination-method"
47
+ count="100"
48
+ current="75"
49
+ @current-changed=${e => {
50
+ const paginationState = shadowRoot.getElementById('pagination-method-demo');
51
+ paginationState.innerText = e.target.current;
52
+ }}
53
+ ></lion-pagination>
54
+ <section style="margin-top:16px">
55
+ <button @click=${() => shadowRoot.getElementById('pagination-method').previous()}>
56
+ Previous
57
+ </button>
58
+ <button @click=${() => shadowRoot.getElementById('pagination-method').next()}>Next</button>
59
+ <br />
60
+ <br />
61
+ <button @click=${() => shadowRoot.getElementById('pagination-method').first()}>First</button>
62
+ <button @click=${() => shadowRoot.getElementById('pagination-method').last()}>Last</button>
63
+ <br />
64
+ <br />
65
+ <button @click=${() => shadowRoot.getElementById('pagination-method').goto(55)}>
66
+ Go to 55
67
+ </button>
68
+ </section>
69
+ `;
70
+ };
71
+ ```
72
+
73
+ ### Event
74
+
75
+ `lion-pagination` fires an event on button click to notify the component's current state. It is useful for analytics purposes or to perform some actions on page change.
76
+
77
+ - `@current-changed`: triggers when the current page is changed
78
+
79
+ ```js preview-story
80
+ export const event = ({ shadowRoot }) => {
81
+ setTimeout(() => {
82
+ shadowRoot.getElementById('pagination-event-demo-text').innerText =
83
+ shadowRoot.getElementById('pagination-event-demo').current;
84
+ });
85
+
86
+ return html`
87
+ <p>The current page is: <span id="pagination-event-demo-text"></span></p>
88
+ <lion-pagination
89
+ id="pagination-event-demo"
90
+ count="10"
91
+ current="5"
92
+ @current-changed=${e => {
93
+ const paginationState = shadowRoot.getElementById('pagination-event-demo-text');
94
+ paginationState.innerText = e.target.current;
95
+ }}
96
+ ></lion-pagination>
97
+ `;
98
+ };
99
+ ```
@@ -0,0 +1,30 @@
1
+ import { css, html } from 'lit';
2
+ import { LionProgressIndicator } from '@lion/ui/progress-indicator.js';
3
+
4
+ export class MyDeterminateProgressBar extends LionProgressIndicator {
5
+ static get styles() {
6
+ return [
7
+ css`
8
+ :host {
9
+ display: block;
10
+ position: relative;
11
+ width: 100%;
12
+ height: 6px;
13
+ overflow: hidden;
14
+ background-color: #eee;
15
+ }
16
+
17
+ .progress__filled {
18
+ height: inherit;
19
+ background-color: green;
20
+ }
21
+ `,
22
+ ];
23
+ }
24
+
25
+ _graphicTemplate() {
26
+ return html` <div class="progress__filled" style="width: ${this._progressPercentage}%"></div> `;
27
+ }
28
+ }
29
+
30
+ customElements.define('my-determinate-progress-bar', MyDeterminateProgressBar);
@@ -0,0 +1,55 @@
1
+ import { html, css } from 'lit';
2
+ import { LionProgressIndicator } from '@lion/ui/progress-indicator.js';
3
+
4
+ export class MyIndeterminateProgressSpinner extends LionProgressIndicator {
5
+ static get styles() {
6
+ return [
7
+ css`
8
+ .progress__icon {
9
+ display: inline-block;
10
+ width: 48px;
11
+ height: 48px;
12
+ animation: spinner-rotate 2s linear infinite;
13
+ }
14
+
15
+ .progress__filled {
16
+ animation: spinner-dash 1.35s ease-in-out infinite;
17
+ fill: none;
18
+ stroke-width: 6px;
19
+ stroke: var(--primary-color);
20
+ }
21
+
22
+ @keyframes spinner-rotate {
23
+ to {
24
+ transform: rotate(360deg);
25
+ }
26
+ }
27
+
28
+ @keyframes spinner-dash {
29
+ 0% {
30
+ stroke-dasharray: 6, 122;
31
+ stroke-dashoffset: 0;
32
+ }
33
+ 50% {
34
+ stroke-dasharray: 100, 28;
35
+ stroke-dashoffset: -16;
36
+ }
37
+ 100% {
38
+ stroke-dasharray: 6, 122;
39
+ stroke-dashoffset: -127;
40
+ }
41
+ }
42
+ `,
43
+ ];
44
+ }
45
+
46
+ _graphicTemplate() {
47
+ return html`
48
+ <svg class="progress__icon" viewBox="20 20 47 47">
49
+ <circle class="progress__filled" cx="44" cy="44" r="20.2" />
50
+ </svg>
51
+ `;
52
+ }
53
+ }
54
+
55
+ customElements.define('my-indeterminate-progress-spinner', MyIndeterminateProgressSpinner);