@ukho/admiralty-core 0.0.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 (637) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -0
  3. package/dist/admiralty/admiralty.esm.js +2 -0
  4. package/dist/admiralty/admiralty.esm.js.map +1 -0
  5. package/dist/admiralty/index.esm.js +2 -0
  6. package/dist/admiralty/index.esm.js.map +1 -0
  7. package/dist/admiralty/p-01cb7adb.entry.js +2 -0
  8. package/dist/admiralty/p-01cb7adb.entry.js.map +1 -0
  9. package/dist/admiralty/p-05415353.entry.js +2 -0
  10. package/dist/admiralty/p-05415353.entry.js.map +1 -0
  11. package/dist/admiralty/p-08baadfe.entry.js +2 -0
  12. package/dist/admiralty/p-08baadfe.entry.js.map +1 -0
  13. package/dist/admiralty/p-1156fb5a.entry.js +2 -0
  14. package/dist/admiralty/p-1156fb5a.entry.js.map +1 -0
  15. package/dist/admiralty/p-1597c067.entry.js +2 -0
  16. package/dist/admiralty/p-1597c067.entry.js.map +1 -0
  17. package/dist/admiralty/p-18cff2de.js +2 -0
  18. package/dist/admiralty/p-18cff2de.js.map +1 -0
  19. package/dist/admiralty/p-1e0fcbb0.entry.js +2 -0
  20. package/dist/admiralty/p-1e0fcbb0.entry.js.map +1 -0
  21. package/dist/admiralty/p-281fb779.entry.js +2 -0
  22. package/dist/admiralty/p-281fb779.entry.js.map +1 -0
  23. package/dist/admiralty/p-31b52c40.entry.js +2 -0
  24. package/dist/admiralty/p-31b52c40.entry.js.map +1 -0
  25. package/dist/admiralty/p-33b7244b.entry.js +2 -0
  26. package/dist/admiralty/p-33b7244b.entry.js.map +1 -0
  27. package/dist/admiralty/p-34cbc7a1.entry.js +2 -0
  28. package/dist/admiralty/p-34cbc7a1.entry.js.map +1 -0
  29. package/dist/admiralty/p-3c9dee38.entry.js +2 -0
  30. package/dist/admiralty/p-3c9dee38.entry.js.map +1 -0
  31. package/dist/admiralty/p-3dfc9fc0.entry.js +2 -0
  32. package/dist/admiralty/p-3dfc9fc0.entry.js.map +1 -0
  33. package/dist/admiralty/p-52cb5c3d.entry.js +2 -0
  34. package/dist/admiralty/p-52cb5c3d.entry.js.map +1 -0
  35. package/dist/admiralty/p-573407ef.entry.js +2 -0
  36. package/dist/admiralty/p-573407ef.entry.js.map +1 -0
  37. package/dist/admiralty/p-61a86783.entry.js +2 -0
  38. package/dist/admiralty/p-61a86783.entry.js.map +1 -0
  39. package/dist/admiralty/p-6293fffb.entry.js +2 -0
  40. package/dist/admiralty/p-6293fffb.entry.js.map +1 -0
  41. package/dist/admiralty/p-69e7a596.entry.js +2 -0
  42. package/dist/admiralty/p-69e7a596.entry.js.map +1 -0
  43. package/dist/admiralty/p-6b102dd7.entry.js +2 -0
  44. package/dist/admiralty/p-6b102dd7.entry.js.map +1 -0
  45. package/dist/admiralty/p-80c03397.entry.js +2 -0
  46. package/dist/admiralty/p-80c03397.entry.js.map +1 -0
  47. package/dist/admiralty/p-914567f9.entry.js +2 -0
  48. package/dist/admiralty/p-914567f9.entry.js.map +1 -0
  49. package/dist/admiralty/p-96a33adb.entry.js +2 -0
  50. package/dist/admiralty/p-96a33adb.entry.js.map +1 -0
  51. package/dist/admiralty/p-aa03be54.entry.js +2 -0
  52. package/dist/admiralty/p-aa03be54.entry.js.map +1 -0
  53. package/dist/admiralty/p-bbe4dd68.entry.js +2 -0
  54. package/dist/admiralty/p-bbe4dd68.entry.js.map +1 -0
  55. package/dist/admiralty/p-c63b9703.entry.js +2 -0
  56. package/dist/admiralty/p-c63b9703.entry.js.map +1 -0
  57. package/dist/admiralty/p-c7dd53e5.js +2 -0
  58. package/dist/admiralty/p-c7dd53e5.js.map +1 -0
  59. package/dist/admiralty/p-c9625a50.entry.js +2 -0
  60. package/dist/admiralty/p-c9625a50.entry.js.map +1 -0
  61. package/dist/admiralty/p-d23537cc.entry.js +2 -0
  62. package/dist/admiralty/p-d23537cc.entry.js.map +1 -0
  63. package/dist/admiralty/p-d5680d2f.entry.js +2 -0
  64. package/dist/admiralty/p-d5680d2f.entry.js.map +1 -0
  65. package/dist/admiralty/p-da4c6170.entry.js +2 -0
  66. package/dist/admiralty/p-da4c6170.entry.js.map +1 -0
  67. package/dist/admiralty/p-dae5bfda.entry.js +2 -0
  68. package/dist/admiralty/p-dae5bfda.entry.js.map +1 -0
  69. package/dist/admiralty/p-de48be42.entry.js +2 -0
  70. package/dist/admiralty/p-de48be42.entry.js.map +1 -0
  71. package/dist/admiralty/p-e1457fd2.entry.js +2 -0
  72. package/dist/admiralty/p-e1457fd2.entry.js.map +1 -0
  73. package/dist/admiralty/p-e1680782.js +3 -0
  74. package/dist/admiralty/p-e1680782.js.map +1 -0
  75. package/dist/admiralty/p-e5f9308a.entry.js +2 -0
  76. package/dist/admiralty/p-e5f9308a.entry.js.map +1 -0
  77. package/dist/admiralty/p-e7bb0eca.entry.js +2 -0
  78. package/dist/admiralty/p-e7bb0eca.entry.js.map +1 -0
  79. package/dist/admiralty/p-eba5b551.entry.js +2 -0
  80. package/dist/admiralty/p-eba5b551.entry.js.map +1 -0
  81. package/dist/admiralty/p-eefe699d.entry.js +2 -0
  82. package/dist/admiralty/p-eefe699d.entry.js.map +1 -0
  83. package/dist/admiralty/p-f049a682.entry.js +2 -0
  84. package/dist/admiralty/p-f049a682.entry.js.map +1 -0
  85. package/dist/admiralty/p-f268e1dd.entry.js +2 -0
  86. package/dist/admiralty/p-f268e1dd.entry.js.map +1 -0
  87. package/dist/admiralty/p-f9815502.entry.js +2 -0
  88. package/dist/admiralty/p-f9815502.entry.js.map +1 -0
  89. package/dist/admiralty/p-ffb0dae5.entry.js +2 -0
  90. package/dist/admiralty/p-ffb0dae5.entry.js.map +1 -0
  91. package/dist/admiralty/p-ffe3ca07.entry.js +2 -0
  92. package/dist/admiralty/p-ffe3ca07.entry.js.map +1 -0
  93. package/dist/cjs/admiralty-breadcrumb.cjs.entry.js +25 -0
  94. package/dist/cjs/admiralty-breadcrumb.cjs.entry.js.map +1 -0
  95. package/dist/cjs/admiralty-breadcrumbs.cjs.entry.js +48 -0
  96. package/dist/cjs/admiralty-breadcrumbs.cjs.entry.js.map +1 -0
  97. package/dist/cjs/admiralty-button.cjs.entry.js +26 -0
  98. package/dist/cjs/admiralty-button.cjs.entry.js.map +1 -0
  99. package/dist/cjs/admiralty-card.cjs.entry.js +22 -0
  100. package/dist/cjs/admiralty-card.cjs.entry.js.map +1 -0
  101. package/dist/cjs/admiralty-checkbox.cjs.entry.js +54 -0
  102. package/dist/cjs/admiralty-checkbox.cjs.entry.js.map +1 -0
  103. package/dist/cjs/admiralty-colour-block.cjs.entry.js +37 -0
  104. package/dist/cjs/admiralty-colour-block.cjs.entry.js.map +1 -0
  105. package/dist/cjs/admiralty-dialogue.cjs.entry.js +39 -0
  106. package/dist/cjs/admiralty-dialogue.cjs.entry.js.map +1 -0
  107. package/dist/cjs/admiralty-expansion.cjs.entry.js +42 -0
  108. package/dist/cjs/admiralty-expansion.cjs.entry.js.map +1 -0
  109. package/dist/cjs/admiralty-file-input.cjs.entry.js +89 -0
  110. package/dist/cjs/admiralty-file-input.cjs.entry.js.map +1 -0
  111. package/dist/cjs/admiralty-filter-group.cjs.entry.js +22 -0
  112. package/dist/cjs/admiralty-filter-group.cjs.entry.js.map +1 -0
  113. package/dist/cjs/admiralty-filter.cjs.entry.js +32 -0
  114. package/dist/cjs/admiralty-filter.cjs.entry.js.map +1 -0
  115. package/dist/cjs/admiralty-footer.cjs.entry.js +25 -0
  116. package/dist/cjs/admiralty-footer.cjs.entry.js.map +1 -0
  117. package/dist/cjs/admiralty-header-menu-item.cjs.entry.js +63 -0
  118. package/dist/cjs/admiralty-header-menu-item.cjs.entry.js.map +1 -0
  119. package/dist/cjs/admiralty-header-profile.cjs.entry.js +44 -0
  120. package/dist/cjs/admiralty-header-profile.cjs.entry.js.map +1 -0
  121. package/dist/cjs/admiralty-header-sub-menu-item.cjs.entry.js +28 -0
  122. package/dist/cjs/admiralty-header-sub-menu-item.cjs.entry.js.map +1 -0
  123. package/dist/cjs/admiralty-header.cjs.entry.js +32 -0
  124. package/dist/cjs/admiralty-header.cjs.entry.js.map +1 -0
  125. package/dist/cjs/admiralty-hint_3.cjs.entry.js +51 -0
  126. package/dist/cjs/admiralty-hint_3.cjs.entry.js.map +1 -0
  127. package/dist/cjs/admiralty-hr.cjs.entry.js +21 -0
  128. package/dist/cjs/admiralty-hr.cjs.entry.js.map +1 -0
  129. package/dist/cjs/admiralty-icon.cjs.entry.js +7045 -0
  130. package/dist/cjs/admiralty-icon.cjs.entry.js.map +1 -0
  131. package/dist/cjs/admiralty-input.cjs.entry.js +62 -0
  132. package/dist/cjs/admiralty-input.cjs.entry.js.map +1 -0
  133. package/dist/cjs/admiralty-link.cjs.entry.js +20 -0
  134. package/dist/cjs/admiralty-link.cjs.entry.js.map +1 -0
  135. package/dist/cjs/admiralty-paginator-wrapper.cjs.entry.js +32 -0
  136. package/dist/cjs/admiralty-paginator-wrapper.cjs.entry.js.map +1 -0
  137. package/dist/cjs/admiralty-paginator.cjs.entry.js +46 -0
  138. package/dist/cjs/admiralty-paginator.cjs.entry.js.map +1 -0
  139. package/dist/cjs/admiralty-phase-banner.cjs.entry.js +23 -0
  140. package/dist/cjs/admiralty-phase-banner.cjs.entry.js.map +1 -0
  141. package/dist/cjs/admiralty-progress-bar.cjs.entry.js +28 -0
  142. package/dist/cjs/admiralty-progress-bar.cjs.entry.js.map +1 -0
  143. package/dist/cjs/admiralty-radio-group.cjs.entry.js +71 -0
  144. package/dist/cjs/admiralty-radio-group.cjs.entry.js.map +1 -0
  145. package/dist/cjs/admiralty-radio.cjs.entry.js +64 -0
  146. package/dist/cjs/admiralty-radio.cjs.entry.js.map +1 -0
  147. package/dist/cjs/admiralty-select.cjs.entry.js +61 -0
  148. package/dist/cjs/admiralty-select.cjs.entry.js.map +1 -0
  149. package/dist/cjs/admiralty-side-nav-item.cjs.entry.js +39 -0
  150. package/dist/cjs/admiralty-side-nav-item.cjs.entry.js.map +1 -0
  151. package/dist/cjs/admiralty-side-nav-wrapper.cjs.entry.js +27 -0
  152. package/dist/cjs/admiralty-side-nav-wrapper.cjs.entry.js.map +1 -0
  153. package/dist/cjs/admiralty-side-nav.cjs.entry.js +22 -0
  154. package/dist/cjs/admiralty-side-nav.cjs.entry.js.map +1 -0
  155. package/dist/cjs/admiralty-table-body.cjs.entry.js +21 -0
  156. package/dist/cjs/admiralty-table-body.cjs.entry.js.map +1 -0
  157. package/dist/cjs/admiralty-table-cell.cjs.entry.js +21 -0
  158. package/dist/cjs/admiralty-table-cell.cjs.entry.js.map +1 -0
  159. package/dist/cjs/admiralty-table-header-cell.cjs.entry.js +21 -0
  160. package/dist/cjs/admiralty-table-header-cell.cjs.entry.js.map +1 -0
  161. package/dist/cjs/admiralty-table-header.cjs.entry.js +21 -0
  162. package/dist/cjs/admiralty-table-header.cjs.entry.js.map +1 -0
  163. package/dist/cjs/admiralty-table-row.cjs.entry.js +21 -0
  164. package/dist/cjs/admiralty-table-row.cjs.entry.js.map +1 -0
  165. package/dist/cjs/admiralty-table.cjs.entry.js +22 -0
  166. package/dist/cjs/admiralty-table.cjs.entry.js.map +1 -0
  167. package/dist/cjs/admiralty-textarea.cjs.entry.js +38 -0
  168. package/dist/cjs/admiralty-textarea.cjs.entry.js.map +1 -0
  169. package/dist/cjs/admiralty-type-ahead-item.cjs.entry.js +22 -0
  170. package/dist/cjs/admiralty-type-ahead-item.cjs.entry.js.map +1 -0
  171. package/dist/cjs/admiralty-type-ahead.cjs.entry.js +185 -0
  172. package/dist/cjs/admiralty-type-ahead.cjs.entry.js.map +1 -0
  173. package/dist/cjs/admiralty.cjs.js +28 -0
  174. package/dist/cjs/admiralty.cjs.js.map +1 -0
  175. package/dist/cjs/button.types-0549d311.js +12 -0
  176. package/dist/cjs/button.types-0549d311.js.map +1 -0
  177. package/dist/cjs/index-18b58c3d.js +9484 -0
  178. package/dist/cjs/index-18b58c3d.js.map +1 -0
  179. package/dist/cjs/index-9db1e550.js +1971 -0
  180. package/dist/cjs/index-9db1e550.js.map +1 -0
  181. package/dist/cjs/index.cjs.js +4 -0
  182. package/dist/cjs/index.cjs.js.map +1 -0
  183. package/dist/cjs/loader.cjs.js +24 -0
  184. package/dist/cjs/loader.cjs.js.map +1 -0
  185. package/dist/collection/assets/svg/Admiralty linear logo.svg +373 -0
  186. package/dist/collection/assets/svg/Admiralty stacked logo.svg +1275 -0
  187. package/dist/collection/assets/svg/AdmiraltyUKHO linear logo.svg +3350 -0
  188. package/dist/collection/assets/svg/UKHO linear logo.svg +3526 -0
  189. package/dist/collection/assets/svg/UKHO stacked logo.svg +2985 -0
  190. package/dist/collection/collection-manifest.json +53 -0
  191. package/dist/collection/components/breadcrumb/breadcrumb.css +89 -0
  192. package/dist/collection/components/breadcrumb/breadcrumb.js +84 -0
  193. package/dist/collection/components/breadcrumb/breadcrumb.js.map +1 -0
  194. package/dist/collection/components/breadcrumbs/breadcrumbs.css +25 -0
  195. package/dist/collection/components/breadcrumbs/breadcrumbs.js +48 -0
  196. package/dist/collection/components/breadcrumbs/breadcrumbs.js.map +1 -0
  197. package/dist/collection/components/button/button.css +384 -0
  198. package/dist/collection/components/button/button.js +109 -0
  199. package/dist/collection/components/button/button.js.map +1 -0
  200. package/dist/collection/components/button/button.types.js +9 -0
  201. package/dist/collection/components/button/button.types.js.map +1 -0
  202. package/dist/collection/components/card/card.css +101 -0
  203. package/dist/collection/components/card/card.js +42 -0
  204. package/dist/collection/components/card/card.js.map +1 -0
  205. package/dist/collection/components/checkbox/checkbox.css +72 -0
  206. package/dist/collection/components/checkbox/checkbox.js +222 -0
  207. package/dist/collection/components/checkbox/checkbox.js.map +1 -0
  208. package/dist/collection/components/colour-block/colour-block.css +53 -0
  209. package/dist/collection/components/colour-block/colour-block.js +141 -0
  210. package/dist/collection/components/colour-block/colour-block.js.map +1 -0
  211. package/dist/collection/components/dialogue/dialogue.css +105 -0
  212. package/dist/collection/components/dialogue/dialogue.js +78 -0
  213. package/dist/collection/components/dialogue/dialogue.js.map +1 -0
  214. package/dist/collection/components/expansion/expansion.css +75 -0
  215. package/dist/collection/components/expansion/expansion.js +133 -0
  216. package/dist/collection/components/expansion/expansion.js.map +1 -0
  217. package/dist/collection/components/file-input/file-input.css +78 -0
  218. package/dist/collection/components/file-input/file-input.js +155 -0
  219. package/dist/collection/components/file-input/file-input.js.map +1 -0
  220. package/dist/collection/components/filter/filter.css +277 -0
  221. package/dist/collection/components/filter/filter.js +88 -0
  222. package/dist/collection/components/filter/filter.js.map +1 -0
  223. package/dist/collection/components/filter-group/filter-group.css +0 -0
  224. package/dist/collection/components/filter-group/filter-group.js +46 -0
  225. package/dist/collection/components/filter-group/filter-group.js.map +1 -0
  226. package/dist/collection/components/footer/footer.css +61 -0
  227. package/dist/collection/components/footer/footer.js +104 -0
  228. package/dist/collection/components/footer/footer.js.map +1 -0
  229. package/dist/collection/components/header/header.css +113 -0
  230. package/dist/collection/components/header/header.js +145 -0
  231. package/dist/collection/components/header/header.js.map +1 -0
  232. package/dist/collection/components/header/header.stories.data.js +146 -0
  233. package/dist/collection/components/header/header.stories.data.js.map +1 -0
  234. package/dist/collection/components/header/header.types.js +2 -0
  235. package/dist/collection/components/header/header.types.js.map +1 -0
  236. package/dist/collection/components/header-menu-item/header-menu-item.css +53 -0
  237. package/dist/collection/components/header-menu-item/header-menu-item.js +122 -0
  238. package/dist/collection/components/header-menu-item/header-menu-item.js.map +1 -0
  239. package/dist/collection/components/header-profile/header-profile.css +81 -0
  240. package/dist/collection/components/header-profile/header-profile.js +148 -0
  241. package/dist/collection/components/header-profile/header-profile.js.map +1 -0
  242. package/dist/collection/components/header-sub-menu-item/header-sub-menu-item.css +35 -0
  243. package/dist/collection/components/header-sub-menu-item/header-sub-menu-item.js +66 -0
  244. package/dist/collection/components/header-sub-menu-item/header-sub-menu-item.js.map +1 -0
  245. package/dist/collection/components/hint/hint.css +26 -0
  246. package/dist/collection/components/hint/hint.js +47 -0
  247. package/dist/collection/components/hint/hint.js.map +1 -0
  248. package/dist/collection/components/horizontal-rule/horizontal-rule.css +23 -0
  249. package/dist/collection/components/horizontal-rule/horizontal-rule.js +18 -0
  250. package/dist/collection/components/horizontal-rule/horizontal-rule.js.map +1 -0
  251. package/dist/collection/components/icon/icon.css +15 -0
  252. package/dist/collection/components/icon/icon.js +79 -0
  253. package/dist/collection/components/icon/icon.js.map +1 -0
  254. package/dist/collection/components/input/input.css +58 -0
  255. package/dist/collection/components/input/input.interface.js +2 -0
  256. package/dist/collection/components/input/input.interface.js.map +1 -0
  257. package/dist/collection/components/input/input.js +308 -0
  258. package/dist/collection/components/input/input.js.map +1 -0
  259. package/dist/collection/components/input-error/input-error.css +30 -0
  260. package/dist/collection/components/input-error/input-error.js +24 -0
  261. package/dist/collection/components/input-error/input-error.js.map +1 -0
  262. package/dist/collection/components/label/label.css +25 -0
  263. package/dist/collection/components/label/label.js +65 -0
  264. package/dist/collection/components/label/label.js.map +1 -0
  265. package/dist/collection/components/link/link.js +51 -0
  266. package/dist/collection/components/link/link.js.map +1 -0
  267. package/dist/collection/components/paginator/paginator.css +29 -0
  268. package/dist/collection/components/paginator/paginator.js +120 -0
  269. package/dist/collection/components/paginator/paginator.js.map +1 -0
  270. package/dist/collection/components/paginator/paginator.stories.data.js +36 -0
  271. package/dist/collection/components/paginator/paginator.stories.data.js.map +1 -0
  272. package/dist/collection/components/phase-banner/phase-banner.css +84 -0
  273. package/dist/collection/components/phase-banner/phase-banner.js +61 -0
  274. package/dist/collection/components/phase-banner/phase-banner.js.map +1 -0
  275. package/dist/collection/components/progress-bar/progress-bar.css +35 -0
  276. package/dist/collection/components/progress-bar/progress-bar.js +90 -0
  277. package/dist/collection/components/progress-bar/progress-bar.js.map +1 -0
  278. package/dist/collection/components/radio/radio.css +49 -0
  279. package/dist/collection/components/radio/radio.js +206 -0
  280. package/dist/collection/components/radio/radio.js.map +1 -0
  281. package/dist/collection/components/radio-group/radio-group.css +14 -0
  282. package/dist/collection/components/radio-group/radio-group.js +148 -0
  283. package/dist/collection/components/radio-group/radio-group.js.map +1 -0
  284. package/dist/collection/components/select/select.css +59 -0
  285. package/dist/collection/components/select/select.js +207 -0
  286. package/dist/collection/components/select/select.js.map +1 -0
  287. package/dist/collection/components/select/select.types.js +3 -0
  288. package/dist/collection/components/select/select.types.js.map +1 -0
  289. package/dist/collection/components/side-nav/side-nav.css +68 -0
  290. package/dist/collection/components/side-nav/side-nav.js +43 -0
  291. package/dist/collection/components/side-nav/side-nav.js.map +1 -0
  292. package/dist/collection/components/side-nav/side-nav.stories.data.js +31 -0
  293. package/dist/collection/components/side-nav/side-nav.stories.data.js.map +1 -0
  294. package/dist/collection/components/side-nav-item/side-nav-item.css +90 -0
  295. package/dist/collection/components/side-nav-item/side-nav-item.js +112 -0
  296. package/dist/collection/components/side-nav-item/side-nav-item.js.map +1 -0
  297. package/dist/collection/components/table/table.css +29 -0
  298. package/dist/collection/components/table/table.js +47 -0
  299. package/dist/collection/components/table/table.js.map +1 -0
  300. package/dist/collection/components/table-body/table-body.css +28 -0
  301. package/dist/collection/components/table-body/table-body.js +23 -0
  302. package/dist/collection/components/table-body/table-body.js.map +1 -0
  303. package/dist/collection/components/table-cell/table-cell.css +28 -0
  304. package/dist/collection/components/table-cell/table-cell.js +23 -0
  305. package/dist/collection/components/table-cell/table-cell.js.map +1 -0
  306. package/dist/collection/components/table-header/table-header.css +20 -0
  307. package/dist/collection/components/table-header/table-header.js +23 -0
  308. package/dist/collection/components/table-header/table-header.js.map +1 -0
  309. package/dist/collection/components/table-header-cell/table-header-cell.css +27 -0
  310. package/dist/collection/components/table-header-cell/table-header-cell.js +23 -0
  311. package/dist/collection/components/table-header-cell/table-header-cell.js.map +1 -0
  312. package/dist/collection/components/table-row/table-row.css +20 -0
  313. package/dist/collection/components/table-row/table-row.js +23 -0
  314. package/dist/collection/components/table-row/table-row.js.map +1 -0
  315. package/dist/collection/components/textarea/textarea.css +269 -0
  316. package/dist/collection/components/textarea/textarea.js +202 -0
  317. package/dist/collection/components/textarea/textarea.js.map +1 -0
  318. package/dist/collection/components/type-ahead/type-ahead.css +73 -0
  319. package/dist/collection/components/type-ahead/type-ahead.js +294 -0
  320. package/dist/collection/components/type-ahead/type-ahead.js.map +1 -0
  321. package/dist/collection/components/type-ahead-item/type-ahead-item.css +3 -0
  322. package/dist/collection/components/type-ahead-item/type-ahead-item.js +43 -0
  323. package/dist/collection/components/type-ahead-item/type-ahead-item.js.map +1 -0
  324. package/dist/collection/index.js +2 -0
  325. package/dist/collection/index.js.map +1 -0
  326. package/dist/components/admiralty-breadcrumb.d.ts +11 -0
  327. package/dist/components/admiralty-breadcrumb.js +48 -0
  328. package/dist/components/admiralty-breadcrumb.js.map +1 -0
  329. package/dist/components/admiralty-breadcrumbs.d.ts +11 -0
  330. package/dist/components/admiralty-breadcrumbs.js +62 -0
  331. package/dist/components/admiralty-breadcrumbs.js.map +1 -0
  332. package/dist/components/admiralty-button.d.ts +11 -0
  333. package/dist/components/admiralty-button.js +8 -0
  334. package/dist/components/admiralty-button.js.map +1 -0
  335. package/dist/components/admiralty-card.d.ts +11 -0
  336. package/dist/components/admiralty-card.js +37 -0
  337. package/dist/components/admiralty-card.js.map +1 -0
  338. package/dist/components/admiralty-checkbox.d.ts +11 -0
  339. package/dist/components/admiralty-checkbox.js +75 -0
  340. package/dist/components/admiralty-checkbox.js.map +1 -0
  341. package/dist/components/admiralty-colour-block.d.ts +11 -0
  342. package/dist/components/admiralty-colour-block.js +68 -0
  343. package/dist/components/admiralty-colour-block.js.map +1 -0
  344. package/dist/components/admiralty-dialogue.d.ts +11 -0
  345. package/dist/components/admiralty-dialogue.js +61 -0
  346. package/dist/components/admiralty-dialogue.js.map +1 -0
  347. package/dist/components/admiralty-expansion.d.ts +11 -0
  348. package/dist/components/admiralty-expansion.js +8 -0
  349. package/dist/components/admiralty-expansion.js.map +1 -0
  350. package/dist/components/admiralty-file-input.d.ts +11 -0
  351. package/dist/components/admiralty-file-input.js +113 -0
  352. package/dist/components/admiralty-file-input.js.map +1 -0
  353. package/dist/components/admiralty-filter-group.d.ts +11 -0
  354. package/dist/components/admiralty-filter-group.js +49 -0
  355. package/dist/components/admiralty-filter-group.js.map +1 -0
  356. package/dist/components/admiralty-filter.d.ts +11 -0
  357. package/dist/components/admiralty-filter.js +59 -0
  358. package/dist/components/admiralty-filter.js.map +1 -0
  359. package/dist/components/admiralty-footer.d.ts +11 -0
  360. package/dist/components/admiralty-footer.js +43 -0
  361. package/dist/components/admiralty-footer.js.map +1 -0
  362. package/dist/components/admiralty-header-menu-item.d.ts +11 -0
  363. package/dist/components/admiralty-header-menu-item.js +80 -0
  364. package/dist/components/admiralty-header-menu-item.js.map +1 -0
  365. package/dist/components/admiralty-header-profile.d.ts +11 -0
  366. package/dist/components/admiralty-header-profile.js +62 -0
  367. package/dist/components/admiralty-header-profile.js.map +1 -0
  368. package/dist/components/admiralty-header-sub-menu-item.d.ts +11 -0
  369. package/dist/components/admiralty-header-sub-menu-item.js +44 -0
  370. package/dist/components/admiralty-header-sub-menu-item.js.map +1 -0
  371. package/dist/components/admiralty-header.d.ts +11 -0
  372. package/dist/components/admiralty-header.js +51 -0
  373. package/dist/components/admiralty-header.js.map +1 -0
  374. package/dist/components/admiralty-hint.d.ts +11 -0
  375. package/dist/components/admiralty-hint.js +8 -0
  376. package/dist/components/admiralty-hint.js.map +1 -0
  377. package/dist/components/admiralty-hr.d.ts +11 -0
  378. package/dist/components/admiralty-hr.js +34 -0
  379. package/dist/components/admiralty-hr.js.map +1 -0
  380. package/dist/components/admiralty-icon.d.ts +11 -0
  381. package/dist/components/admiralty-icon.js +8 -0
  382. package/dist/components/admiralty-icon.js.map +1 -0
  383. package/dist/components/admiralty-input-error.d.ts +11 -0
  384. package/dist/components/admiralty-input-error.js +8 -0
  385. package/dist/components/admiralty-input-error.js.map +1 -0
  386. package/dist/components/admiralty-input.d.ts +11 -0
  387. package/dist/components/admiralty-input.js +8 -0
  388. package/dist/components/admiralty-input.js.map +1 -0
  389. package/dist/components/admiralty-label.d.ts +11 -0
  390. package/dist/components/admiralty-label.js +8 -0
  391. package/dist/components/admiralty-label.js.map +1 -0
  392. package/dist/components/admiralty-link.d.ts +11 -0
  393. package/dist/components/admiralty-link.js +36 -0
  394. package/dist/components/admiralty-link.js.map +1 -0
  395. package/dist/components/admiralty-paginator-wrapper.d.ts +11 -0
  396. package/dist/components/admiralty-paginator-wrapper.js +45 -0
  397. package/dist/components/admiralty-paginator-wrapper.js.map +1 -0
  398. package/dist/components/admiralty-paginator.d.ts +11 -0
  399. package/dist/components/admiralty-paginator.js +73 -0
  400. package/dist/components/admiralty-paginator.js.map +1 -0
  401. package/dist/components/admiralty-phase-banner.d.ts +11 -0
  402. package/dist/components/admiralty-phase-banner.js +39 -0
  403. package/dist/components/admiralty-phase-banner.js.map +1 -0
  404. package/dist/components/admiralty-progress-bar.d.ts +11 -0
  405. package/dist/components/admiralty-progress-bar.js +52 -0
  406. package/dist/components/admiralty-progress-bar.js.map +1 -0
  407. package/dist/components/admiralty-radio-group.d.ts +11 -0
  408. package/dist/components/admiralty-radio-group.js +88 -0
  409. package/dist/components/admiralty-radio-group.js.map +1 -0
  410. package/dist/components/admiralty-radio.d.ts +11 -0
  411. package/dist/components/admiralty-radio.js +84 -0
  412. package/dist/components/admiralty-radio.js.map +1 -0
  413. package/dist/components/admiralty-select.d.ts +11 -0
  414. package/dist/components/admiralty-select.js +106 -0
  415. package/dist/components/admiralty-select.js.map +1 -0
  416. package/dist/components/admiralty-side-nav-item.d.ts +11 -0
  417. package/dist/components/admiralty-side-nav-item.js +56 -0
  418. package/dist/components/admiralty-side-nav-item.js.map +1 -0
  419. package/dist/components/admiralty-side-nav-wrapper.d.ts +11 -0
  420. package/dist/components/admiralty-side-nav-wrapper.js +40 -0
  421. package/dist/components/admiralty-side-nav-wrapper.js.map +1 -0
  422. package/dist/components/admiralty-side-nav.d.ts +11 -0
  423. package/dist/components/admiralty-side-nav.js +37 -0
  424. package/dist/components/admiralty-side-nav.js.map +1 -0
  425. package/dist/components/admiralty-table-body.d.ts +11 -0
  426. package/dist/components/admiralty-table-body.js +34 -0
  427. package/dist/components/admiralty-table-body.js.map +1 -0
  428. package/dist/components/admiralty-table-cell.d.ts +11 -0
  429. package/dist/components/admiralty-table-cell.js +34 -0
  430. package/dist/components/admiralty-table-cell.js.map +1 -0
  431. package/dist/components/admiralty-table-header-cell.d.ts +11 -0
  432. package/dist/components/admiralty-table-header-cell.js +34 -0
  433. package/dist/components/admiralty-table-header-cell.js.map +1 -0
  434. package/dist/components/admiralty-table-header.d.ts +11 -0
  435. package/dist/components/admiralty-table-header.js +34 -0
  436. package/dist/components/admiralty-table-header.js.map +1 -0
  437. package/dist/components/admiralty-table-row.d.ts +11 -0
  438. package/dist/components/admiralty-table-row.js +34 -0
  439. package/dist/components/admiralty-table-row.js.map +1 -0
  440. package/dist/components/admiralty-table.d.ts +11 -0
  441. package/dist/components/admiralty-table.js +37 -0
  442. package/dist/components/admiralty-table.js.map +1 -0
  443. package/dist/components/admiralty-textarea.d.ts +11 -0
  444. package/dist/components/admiralty-textarea.js +84 -0
  445. package/dist/components/admiralty-textarea.js.map +1 -0
  446. package/dist/components/admiralty-type-ahead-item.d.ts +11 -0
  447. package/dist/components/admiralty-type-ahead-item.js +37 -0
  448. package/dist/components/admiralty-type-ahead-item.js.map +1 -0
  449. package/dist/components/admiralty-type-ahead.d.ts +11 -0
  450. package/dist/components/admiralty-type-ahead.js +235 -0
  451. package/dist/components/admiralty-type-ahead.js.map +1 -0
  452. package/dist/components/button.js +55 -0
  453. package/dist/components/button.js.map +1 -0
  454. package/dist/components/expansion.js +62 -0
  455. package/dist/components/expansion.js.map +1 -0
  456. package/dist/components/hint.js +35 -0
  457. package/dist/components/hint.js.map +1 -0
  458. package/dist/components/icon.js +16529 -0
  459. package/dist/components/icon.js.map +1 -0
  460. package/dist/components/index.d.ts +27 -0
  461. package/dist/components/index.js +3 -0
  462. package/dist/components/index.js.map +1 -0
  463. package/dist/components/input-error.js +38 -0
  464. package/dist/components/input-error.js.map +1 -0
  465. package/dist/components/input.js +109 -0
  466. package/dist/components/input.js.map +1 -0
  467. package/dist/components/label.js +37 -0
  468. package/dist/components/label.js.map +1 -0
  469. package/dist/esm/admiralty-breadcrumb.entry.js +21 -0
  470. package/dist/esm/admiralty-breadcrumb.entry.js.map +1 -0
  471. package/dist/esm/admiralty-breadcrumbs.entry.js +44 -0
  472. package/dist/esm/admiralty-breadcrumbs.entry.js.map +1 -0
  473. package/dist/esm/admiralty-button.entry.js +22 -0
  474. package/dist/esm/admiralty-button.entry.js.map +1 -0
  475. package/dist/esm/admiralty-card.entry.js +18 -0
  476. package/dist/esm/admiralty-card.entry.js.map +1 -0
  477. package/dist/esm/admiralty-checkbox.entry.js +50 -0
  478. package/dist/esm/admiralty-checkbox.entry.js.map +1 -0
  479. package/dist/esm/admiralty-colour-block.entry.js +33 -0
  480. package/dist/esm/admiralty-colour-block.entry.js.map +1 -0
  481. package/dist/esm/admiralty-dialogue.entry.js +35 -0
  482. package/dist/esm/admiralty-dialogue.entry.js.map +1 -0
  483. package/dist/esm/admiralty-expansion.entry.js +38 -0
  484. package/dist/esm/admiralty-expansion.entry.js.map +1 -0
  485. package/dist/esm/admiralty-file-input.entry.js +85 -0
  486. package/dist/esm/admiralty-file-input.entry.js.map +1 -0
  487. package/dist/esm/admiralty-filter-group.entry.js +18 -0
  488. package/dist/esm/admiralty-filter-group.entry.js.map +1 -0
  489. package/dist/esm/admiralty-filter.entry.js +28 -0
  490. package/dist/esm/admiralty-filter.entry.js.map +1 -0
  491. package/dist/esm/admiralty-footer.entry.js +21 -0
  492. package/dist/esm/admiralty-footer.entry.js.map +1 -0
  493. package/dist/esm/admiralty-header-menu-item.entry.js +59 -0
  494. package/dist/esm/admiralty-header-menu-item.entry.js.map +1 -0
  495. package/dist/esm/admiralty-header-profile.entry.js +40 -0
  496. package/dist/esm/admiralty-header-profile.entry.js.map +1 -0
  497. package/dist/esm/admiralty-header-sub-menu-item.entry.js +24 -0
  498. package/dist/esm/admiralty-header-sub-menu-item.entry.js.map +1 -0
  499. package/dist/esm/admiralty-header.entry.js +28 -0
  500. package/dist/esm/admiralty-header.entry.js.map +1 -0
  501. package/dist/esm/admiralty-hint_3.entry.js +45 -0
  502. package/dist/esm/admiralty-hint_3.entry.js.map +1 -0
  503. package/dist/esm/admiralty-hr.entry.js +17 -0
  504. package/dist/esm/admiralty-hr.entry.js.map +1 -0
  505. package/dist/esm/admiralty-icon.entry.js +7041 -0
  506. package/dist/esm/admiralty-icon.entry.js.map +1 -0
  507. package/dist/esm/admiralty-input.entry.js +58 -0
  508. package/dist/esm/admiralty-input.entry.js.map +1 -0
  509. package/dist/esm/admiralty-link.entry.js +16 -0
  510. package/dist/esm/admiralty-link.entry.js.map +1 -0
  511. package/dist/esm/admiralty-paginator-wrapper.entry.js +28 -0
  512. package/dist/esm/admiralty-paginator-wrapper.entry.js.map +1 -0
  513. package/dist/esm/admiralty-paginator.entry.js +42 -0
  514. package/dist/esm/admiralty-paginator.entry.js.map +1 -0
  515. package/dist/esm/admiralty-phase-banner.entry.js +19 -0
  516. package/dist/esm/admiralty-phase-banner.entry.js.map +1 -0
  517. package/dist/esm/admiralty-progress-bar.entry.js +24 -0
  518. package/dist/esm/admiralty-progress-bar.entry.js.map +1 -0
  519. package/dist/esm/admiralty-radio-group.entry.js +67 -0
  520. package/dist/esm/admiralty-radio-group.entry.js.map +1 -0
  521. package/dist/esm/admiralty-radio.entry.js +60 -0
  522. package/dist/esm/admiralty-radio.entry.js.map +1 -0
  523. package/dist/esm/admiralty-select.entry.js +57 -0
  524. package/dist/esm/admiralty-select.entry.js.map +1 -0
  525. package/dist/esm/admiralty-side-nav-item.entry.js +35 -0
  526. package/dist/esm/admiralty-side-nav-item.entry.js.map +1 -0
  527. package/dist/esm/admiralty-side-nav-wrapper.entry.js +23 -0
  528. package/dist/esm/admiralty-side-nav-wrapper.entry.js.map +1 -0
  529. package/dist/esm/admiralty-side-nav.entry.js +18 -0
  530. package/dist/esm/admiralty-side-nav.entry.js.map +1 -0
  531. package/dist/esm/admiralty-table-body.entry.js +17 -0
  532. package/dist/esm/admiralty-table-body.entry.js.map +1 -0
  533. package/dist/esm/admiralty-table-cell.entry.js +17 -0
  534. package/dist/esm/admiralty-table-cell.entry.js.map +1 -0
  535. package/dist/esm/admiralty-table-header-cell.entry.js +17 -0
  536. package/dist/esm/admiralty-table-header-cell.entry.js.map +1 -0
  537. package/dist/esm/admiralty-table-header.entry.js +17 -0
  538. package/dist/esm/admiralty-table-header.entry.js.map +1 -0
  539. package/dist/esm/admiralty-table-row.entry.js +17 -0
  540. package/dist/esm/admiralty-table-row.entry.js.map +1 -0
  541. package/dist/esm/admiralty-table.entry.js +18 -0
  542. package/dist/esm/admiralty-table.entry.js.map +1 -0
  543. package/dist/esm/admiralty-textarea.entry.js +34 -0
  544. package/dist/esm/admiralty-textarea.entry.js.map +1 -0
  545. package/dist/esm/admiralty-type-ahead-item.entry.js +18 -0
  546. package/dist/esm/admiralty-type-ahead-item.entry.js.map +1 -0
  547. package/dist/esm/admiralty-type-ahead.entry.js +181 -0
  548. package/dist/esm/admiralty-type-ahead.entry.js.map +1 -0
  549. package/dist/esm/admiralty.js +23 -0
  550. package/dist/esm/admiralty.js.map +1 -0
  551. package/dist/esm/button.types-2655b2cf.js +12 -0
  552. package/dist/esm/button.types-2655b2cf.js.map +1 -0
  553. package/dist/esm/index-a64d8966.js +1942 -0
  554. package/dist/esm/index-a64d8966.js.map +1 -0
  555. package/dist/esm/index-e73d97b7.js +9474 -0
  556. package/dist/esm/index-e73d97b7.js.map +1 -0
  557. package/dist/esm/index.js +3 -0
  558. package/dist/esm/index.js.map +1 -0
  559. package/dist/esm/loader.js +20 -0
  560. package/dist/esm/loader.js.map +1 -0
  561. package/dist/esm/polyfills/core-js.js +11 -0
  562. package/dist/esm/polyfills/css-shim.js +1 -0
  563. package/dist/esm/polyfills/dom.js +79 -0
  564. package/dist/esm/polyfills/es5-html-element.js +1 -0
  565. package/dist/esm/polyfills/index.js +34 -0
  566. package/dist/esm/polyfills/system.js +6 -0
  567. package/dist/index.cjs.js +1 -0
  568. package/dist/index.js +1 -0
  569. package/dist/types/components/breadcrumb/breadcrumb.d.ts +18 -0
  570. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +8 -0
  571. package/dist/types/components/button/button.d.ts +23 -0
  572. package/dist/types/components/button/button.types.d.ts +7 -0
  573. package/dist/types/components/card/card.d.ts +7 -0
  574. package/dist/types/components/checkbox/checkbox.d.ts +52 -0
  575. package/dist/types/components/colour-block/colour-block.d.ts +27 -0
  576. package/dist/types/components/dialogue/dialogue.d.ts +13 -0
  577. package/dist/types/components/expansion/expansion.d.ts +30 -0
  578. package/dist/types/components/file-input/file-input.d.ts +53 -0
  579. package/dist/types/components/filter/filter.d.ts +21 -0
  580. package/dist/types/components/filter-group/filter-group.d.ts +10 -0
  581. package/dist/types/components/footer/footer.d.ts +25 -0
  582. package/dist/types/components/header/header.d.ts +33 -0
  583. package/dist/types/components/header/header.stories.data.d.ts +6 -0
  584. package/dist/types/components/header/header.types.d.ts +10 -0
  585. package/dist/types/components/header-menu-item/header-menu-item.d.ts +34 -0
  586. package/dist/types/components/header-profile/header-profile.d.ts +38 -0
  587. package/dist/types/components/header-sub-menu-item/header-sub-menu-item.d.ts +13 -0
  588. package/dist/types/components/hint/hint.d.ts +11 -0
  589. package/dist/types/components/horizontal-rule/horizontal-rule.d.ts +3 -0
  590. package/dist/types/components/icon/icon.d.ts +17 -0
  591. package/dist/types/components/input/input.d.ts +71 -0
  592. package/dist/types/components/input/input.interface.d.ts +3 -0
  593. package/dist/types/components/input-error/input-error.d.ts +7 -0
  594. package/dist/types/components/label/label.d.ts +15 -0
  595. package/dist/types/components/link/link.d.ts +11 -0
  596. package/dist/types/components/paginator/paginator.d.ts +26 -0
  597. package/dist/types/components/paginator/paginator.stories.data.d.ts +10 -0
  598. package/dist/types/components/phase-banner/phase-banner.d.ts +11 -0
  599. package/dist/types/components/progress-bar/progress-bar.d.ts +19 -0
  600. package/dist/types/components/radio/radio.d.ts +44 -0
  601. package/dist/types/components/radio-group/radio-group.d.ts +27 -0
  602. package/dist/types/components/select/select.d.ts +48 -0
  603. package/dist/types/components/select/select.types.d.ts +4 -0
  604. package/dist/types/components/side-nav/side-nav.d.ts +8 -0
  605. package/dist/types/components/side-nav/side-nav.stories.data.d.ts +10 -0
  606. package/dist/types/components/side-nav-item/side-nav-item.d.ts +26 -0
  607. package/dist/types/components/table/table.d.ts +8 -0
  608. package/dist/types/components/table-body/table-body.d.ts +7 -0
  609. package/dist/types/components/table-cell/table-cell.d.ts +7 -0
  610. package/dist/types/components/table-header/table-header.d.ts +7 -0
  611. package/dist/types/components/table-header-cell/table-header-cell.d.ts +7 -0
  612. package/dist/types/components/table-row/table-row.d.ts +7 -0
  613. package/dist/types/components/textarea/textarea.d.ts +45 -0
  614. package/dist/types/components/type-ahead/type-ahead.d.ts +66 -0
  615. package/dist/types/components/type-ahead-item/type-ahead-item.d.ts +4 -0
  616. package/dist/types/components.d.ts +1637 -0
  617. package/dist/types/index.d.ts +0 -0
  618. package/dist/types/stencil-public-runtime.d.ts +1637 -0
  619. package/loader/cdn.js +3 -0
  620. package/loader/index.cjs.js +3 -0
  621. package/loader/index.d.ts +21 -0
  622. package/loader/index.es2017.js +3 -0
  623. package/loader/index.js +4 -0
  624. package/loader/package.json +11 -0
  625. package/package.json +69 -0
  626. package/styles/core.css +1 -0
  627. package/styles/core.css.map +1 -0
  628. package/styles/webfonts/JohnstonITC/bold/JohnstonITCStd-Bold.woff +0 -0
  629. package/styles/webfonts/JohnstonITC/bold/JohnstonITCStd-Bold.woff2 +0 -0
  630. package/styles/webfonts/JohnstonITC/italic/JohnstonITCStd-MediumIta.woff +0 -0
  631. package/styles/webfonts/JohnstonITC/italic/JohnstonITCStd-MediumIta.woff2 +0 -0
  632. package/styles/webfonts/JohnstonITC/light/JohnstonITCStd-Light.woff +0 -0
  633. package/styles/webfonts/JohnstonITC/light/JohnstonITCStd-Light.woff2 +0 -0
  634. package/styles/webfonts/JohnstonITC/light-italic/JohnstonITCStd-LightIta.woff +0 -0
  635. package/styles/webfonts/JohnstonITC/light-italic/JohnstonITCStd-LightIta.woff2 +0 -0
  636. package/styles/webfonts/JohnstonITC/medium/JohnstonITCStd-Medium.woff +0 -0
  637. package/styles/webfonts/JohnstonITC/medium/JohnstonITCStd-Medium.woff2 +0 -0
@@ -0,0 +1,294 @@
1
+ import { Host, h } from '@stencil/core';
2
+ export class TypeAheadComponent {
3
+ constructor() {
4
+ this._id = `admiralty-typeahead-${++id}`;
5
+ this.hintId = `${this._id}-assistive-hint`;
6
+ this.listId = `${this._id}-list`;
7
+ this.filterList = [];
8
+ this.selectedItemIndex = -1;
9
+ this.isFocused = false;
10
+ this.isSilenced = false;
11
+ this.isAlternateStatusSection = false;
12
+ this.originalSearch = '';
13
+ this.hasBeenFocusedAtLeastOnce = false;
14
+ this.filterResult = new Array();
15
+ this.value = undefined;
16
+ this.label = undefined;
17
+ this.placeholder = undefined;
18
+ this.resultsOnInitFocus = false;
19
+ }
20
+ get inputValue() {
21
+ return this.inputControl.value.toString();
22
+ }
23
+ set inputValue(value) {
24
+ this.inputControl.value = value;
25
+ }
26
+ connectedCallback() {
27
+ const slotItems = this.el.querySelectorAll('admiralty-type-ahead-item');
28
+ slotItems.forEach(el => {
29
+ this.filterList.push(el.getAttribute('value'));
30
+ });
31
+ }
32
+ componentDidLoad() {
33
+ if (this.value) {
34
+ this.inputValue = this.value;
35
+ }
36
+ }
37
+ handleFocusIn() {
38
+ if (this.resultsOnInitFocus && !this.hasBeenFocusedAtLeastOnce) {
39
+ this.performFilter('');
40
+ this.hasBeenFocusedAtLeastOnce = true;
41
+ }
42
+ this.isFocused = true;
43
+ this.isSilenced = false;
44
+ }
45
+ handleFocusOut() {
46
+ this.isFocused = false;
47
+ this.statusText = null;
48
+ this.isSilenced = true;
49
+ }
50
+ textChanged(value) {
51
+ this.originalSearch = value;
52
+ this.performFilter(value);
53
+ this.isSilenced = false;
54
+ this.valueChanged.emit(value);
55
+ }
56
+ handleKeyPressed(event) {
57
+ event.stopImmediatePropagation();
58
+ if (event.key === Keys.UP_ARROW || event.key === Keys.DOWN_ARROW) {
59
+ this.navigateSuggestions(event.key);
60
+ this.updateScroll();
61
+ }
62
+ else if (event.key !== Keys.ENTER) {
63
+ this.textChanged(this.inputValue);
64
+ this.selectCurrentItem();
65
+ }
66
+ }
67
+ handleKeyDown(event) {
68
+ event.stopImmediatePropagation();
69
+ if (event.key === Keys.TAB || event.key === Keys.ENTER) {
70
+ this.selectCurrentItem();
71
+ }
72
+ }
73
+ handleItemSelected(value) {
74
+ this.inputValue = value;
75
+ this.textChanged(value);
76
+ this.filterResult = new Array();
77
+ this.selectionChanged.emit(value);
78
+ }
79
+ performFilter(value) {
80
+ const filter = (filterList, text) => {
81
+ const filterResult = filterList.filter(value => {
82
+ return text === null || text.length < 1 || value.toLowerCase().indexOf(text.toLowerCase()) > -1;
83
+ });
84
+ return filterResult;
85
+ };
86
+ this.filterResult = filter(this.filterList, value);
87
+ this.selectedItemIndex = -1;
88
+ }
89
+ addHighlight() {
90
+ if (this.selectedItemIndex > -1) {
91
+ const listItem = this.el.shadowRoot.querySelector(`#${this.getListItemId(this.selectedItemIndex)}`);
92
+ listItem.classList.add('highlighted');
93
+ }
94
+ }
95
+ removeHighlight(i) {
96
+ if (i > -1) {
97
+ const listItem = this.el.shadowRoot.querySelector(`#${this.getListItemId(i)}`);
98
+ listItem.classList.remove('highlighted');
99
+ }
100
+ }
101
+ selectCurrentItem() {
102
+ if (this.selectedItemIndex >= 0) {
103
+ const selectedItemText = this.filterResult[this.selectedItemIndex];
104
+ this.handleItemSelected(selectedItemText);
105
+ }
106
+ }
107
+ handleItemHovered(index) {
108
+ this.removeHighlight(this.selectedItemIndex);
109
+ this.selectedItemIndex = index;
110
+ this.addHighlight();
111
+ }
112
+ handleComponentFocusOut() {
113
+ var _a;
114
+ // Ensure dropdown closed on clicking or tabbing away from this component
115
+ if (((_a = this.filterResult) === null || _a === void 0 ? void 0 : _a.length) > 0) {
116
+ this.filterResult = new Array();
117
+ this.hasBeenFocusedAtLeastOnce = false;
118
+ }
119
+ }
120
+ /**
121
+ * Check if the selected option is in view, and scroll if not
122
+ */
123
+ updateScroll() {
124
+ const container = this.listContainer;
125
+ const ul = container.querySelector('ul');
126
+ const selectedItem = Array.from(ul.childNodes).find((item) => item.ariaPosInSet === `${this.selectedItemIndex + 1}`);
127
+ if (container && selectedItem && container.scrollHeight + container.clientHeight) {
128
+ selectedItem.scrollIntoView();
129
+ }
130
+ }
131
+ navigateSuggestions(key) {
132
+ if (key === Keys.UP_ARROW) {
133
+ this.removeHighlight(this.selectedItemIndex);
134
+ this.selectedItemIndex--;
135
+ if (this.selectedItemIndex === -2) {
136
+ this.selectedItemIndex = this.filterResult.length - 1;
137
+ }
138
+ }
139
+ if (key === Keys.DOWN_ARROW) {
140
+ this.removeHighlight(this.selectedItemIndex);
141
+ this.selectedItemIndex++;
142
+ if (this.selectedItemIndex > this.filterResult.length - 1) {
143
+ this.selectedItemIndex = -1;
144
+ }
145
+ }
146
+ if (this.selectedItemIndex === -1) {
147
+ this.inputValue = this.originalSearch;
148
+ }
149
+ else {
150
+ const value = this.filterResult[this.selectedItemIndex];
151
+ this.inputValue = value;
152
+ this.addHighlight();
153
+ }
154
+ }
155
+ getListItemId(i) {
156
+ return `${this.listId}-item-${i}`;
157
+ }
158
+ render() {
159
+ return (h(Host, { onFocusout: _ev => this.handleComponentFocusOut() }, h("div", { class: "visually-hidden" }, h("div", { class: "results-status-a", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !this.isSilenced && this.isAlternateStatusSection ? this.statusText : ''), h("div", { class: "results-status-b", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !this.isSilenced && !this.isAlternateStatusSection ? this.statusText : '')), h("admiralty-input", { type: "text", ref: el => (this.inputControl = el), label: this.label, placeholder: this.placeholder, class: "filterTextInput", onKeyUp: ev => this.handleKeyPressed(ev), onKeyDown: ev => this.handleKeyDown(ev), onFocusin: _ev => this.handleFocusIn(), onFocusout: _ev => this.handleFocusOut(), "aria-expanded": this.isFocused && this.filterResult.length > 0 }), h("span", { id: this.hintId, class: "visually-hidden" }, "When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."), this.filterResult.length > 0 ? (h("div", { class: "typeahead-list-container", ref: el => (this.listContainer = el) }, h("ul", { class: "typeahead-list", id: this.listId, role: "listbox" }, this.filterResult.map((item, i) => (h("li", { id: this.getListItemId(i), onMouseDown: _ev => this.handleItemSelected(item), onMouseOver: _ev => this.handleItemHovered(i), "aria-selected": i === this.selectedItemIndex, role: "option", tabindex: "-1", "aria-posinset": i + 1, "aria-setsize": this.filterResult.length }, item)))))) : null, h("slot", null)));
160
+ }
161
+ static get is() { return "admiralty-type-ahead"; }
162
+ static get encapsulation() { return "shadow"; }
163
+ static get originalStyleUrls() {
164
+ return {
165
+ "$": ["type-ahead.scss"]
166
+ };
167
+ }
168
+ static get styleUrls() {
169
+ return {
170
+ "$": ["type-ahead.css"]
171
+ };
172
+ }
173
+ static get properties() {
174
+ return {
175
+ "value": {
176
+ "type": "string",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "string",
180
+ "resolved": "string",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "The value of the textinput"
188
+ },
189
+ "attribute": "value",
190
+ "reflect": false
191
+ },
192
+ "label": {
193
+ "type": "string",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "string",
197
+ "resolved": "string",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "The text content of the label for the input box"
205
+ },
206
+ "attribute": "label",
207
+ "reflect": false
208
+ },
209
+ "placeholder": {
210
+ "type": "string",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "string",
214
+ "resolved": "string",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": "The placeholder text for the input field"
222
+ },
223
+ "attribute": "placeholder",
224
+ "reflect": false
225
+ },
226
+ "resultsOnInitFocus": {
227
+ "type": "boolean",
228
+ "mutable": false,
229
+ "complexType": {
230
+ "original": "boolean",
231
+ "resolved": "boolean",
232
+ "references": {}
233
+ },
234
+ "required": false,
235
+ "optional": false,
236
+ "docs": {
237
+ "tags": [],
238
+ "text": "Optional property to show results when input box is initally focused"
239
+ },
240
+ "attribute": "results-on-init-focus",
241
+ "reflect": false,
242
+ "defaultValue": "false"
243
+ }
244
+ };
245
+ }
246
+ static get states() {
247
+ return {
248
+ "filterResult": {}
249
+ };
250
+ }
251
+ static get events() {
252
+ return [{
253
+ "method": "selectionChanged",
254
+ "name": "selectionChanged",
255
+ "bubbles": true,
256
+ "cancelable": true,
257
+ "composed": true,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": "Optional function that will be executed when the user selects an item from the typeahead"
261
+ },
262
+ "complexType": {
263
+ "original": "string",
264
+ "resolved": "string",
265
+ "references": {}
266
+ }
267
+ }, {
268
+ "method": "valueChanged",
269
+ "name": "valueChanged",
270
+ "bubbles": true,
271
+ "cancelable": true,
272
+ "composed": true,
273
+ "docs": {
274
+ "tags": [],
275
+ "text": "Event that is fired whenever the value of the typeahead changes\ne.g. selection from the dropdown or manually typed entry"
276
+ },
277
+ "complexType": {
278
+ "original": "string",
279
+ "resolved": "string",
280
+ "references": {}
281
+ }
282
+ }];
283
+ }
284
+ static get elementRef() { return "el"; }
285
+ }
286
+ var Keys;
287
+ (function (Keys) {
288
+ Keys["UP_ARROW"] = "ArrowUp";
289
+ Keys["DOWN_ARROW"] = "ArrowDown";
290
+ Keys["ENTER"] = "Enter";
291
+ Keys["TAB"] = "Tab";
292
+ })(Keys || (Keys = {}));
293
+ let id = 0;
294
+ //# sourceMappingURL=type-ahead.js.map
@@ -0,0 +1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AAK,EAAC,0BAA0B,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxE,UAAI,KAAK,EAAC,gBAAgB,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAC,SAAS,IACvD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAClC,UACE,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EACzB,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EACjD,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,mBAC9B,CAAC,KAAK,IAAI,CAAC,iBAAiB,EAC3C,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAC,IAAI,mBACE,CAAC,GAAG,CAAC,kBACN,IAAI,CAAC,YAAY,CAAC,MAAM,IAErC,IAAI,CACF,CACN,CAAC,CACC,CACD,CACP,CAAC,CAAC,CAAC,IAAI;MACR,eAAa,CACR,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAK,IAKJ;AALD,WAAK,IAAI;EACP,4BAAoB,CAAA;EACpB,gCAAwB,CAAA;EACxB,uBAAe,CAAA;EACf,mBAAW,CAAA;AACb,CAAC,EALI,IAAI,KAAJ,IAAI,QAKR;AAED,IAAI,EAAE,GAAG,CAAC,CAAC","sourcesContent":["import { Component, EventEmitter, Host, Prop, Event, h, State, Element } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-type-ahead',\n styleUrl: 'type-ahead.scss',\n shadow: true,\n})\nexport class TypeAheadComponent {\n private _id = `admiralty-typeahead-${++id}`;\n\n hintId = `${this._id}-assistive-hint`;\n listId = `${this._id}-list`;\n\n @Element() el: HTMLElement;\n\n listContainer!: HTMLDivElement;\n inputControl!: HTMLAdmiraltyInputElement;\n\n @State() filterResult: string[] = new Array<string>();\n\n filterList: Array<string> = [];\n\n selectedItemIndex = -1;\n isFocused = false;\n\n isSilenced = false;\n isAlternateStatusSection = false;\n statusText: string;\n\n private originalSearch = '';\n private hasBeenFocusedAtLeastOnce = false;\n\n private get inputValue() {\n return this.inputControl.value.toString();\n }\n\n private set inputValue(value: string) {\n this.inputControl.value = value;\n }\n\n /**\n * The value of the textinput\n */\n @Prop() value: string;\n\n /**\n * The text content of the label for the input box\n */\n @Prop() label: string;\n\n /**\n * The placeholder text for the input field\n */\n @Prop() placeholder: string;\n\n /**\n * Optional property to show results when input box is initally focused\n */\n @Prop() resultsOnInitFocus: boolean = false;\n\n /**\n * Optional function that will be executed when the user selects an item from the typeahead\n */\n @Event() selectionChanged: EventEmitter<string>;\n\n /**\n * Event that is fired whenever the value of the typeahead changes\n * e.g. selection from the dropdown or manually typed entry\n */\n @Event() valueChanged: EventEmitter<string>;\n\n connectedCallback() {\n const slotItems = this.el.querySelectorAll('admiralty-type-ahead-item');\n slotItems.forEach(el => {\n this.filterList.push(el.getAttribute('value'));\n });\n }\n\n componentDidLoad() {\n if (this.value) {\n this.inputValue = this.value;\n }\n }\n\n handleFocusIn() {\n if (this.resultsOnInitFocus && !this.hasBeenFocusedAtLeastOnce) {\n this.performFilter('');\n this.hasBeenFocusedAtLeastOnce = true;\n }\n\n this.isFocused = true;\n this.isSilenced = false;\n }\n\n handleFocusOut() {\n this.isFocused = false;\n this.statusText = null;\n this.isSilenced = true;\n }\n\n private textChanged(value: string): void {\n this.originalSearch = value;\n this.performFilter(value);\n this.isSilenced = false;\n this.valueChanged.emit(value);\n }\n\n handleKeyPressed(event: KeyboardEvent): void {\n event.stopImmediatePropagation();\n\n if (event.key === Keys.UP_ARROW || event.key === Keys.DOWN_ARROW) {\n this.navigateSuggestions(event.key);\n this.updateScroll();\n } else if (event.key !== Keys.ENTER) {\n this.textChanged(this.inputValue);\n this.selectCurrentItem();\n }\n }\n\n handleKeyDown(event: KeyboardEvent): void {\n event.stopImmediatePropagation();\n\n if (event.key === Keys.TAB || event.key === Keys.ENTER) {\n this.selectCurrentItem();\n }\n }\n\n handleItemSelected(value: string): void {\n this.inputValue = value;\n this.textChanged(value);\n this.filterResult = new Array<string>();\n this.selectionChanged.emit(value);\n }\n\n private performFilter(value: string) {\n const filter = (filterList: string[], text: string) => {\n const filterResult = filterList.filter(value => {\n return text === null || text.length < 1 || value.toLowerCase().indexOf(text.toLowerCase()) > -1;\n });\n return filterResult;\n };\n\n this.filterResult = filter(this.filterList, value);\n\n this.selectedItemIndex = -1;\n }\n\n private addHighlight() {\n if (this.selectedItemIndex > -1) {\n const listItem = this.el.shadowRoot.querySelector(`#${this.getListItemId(this.selectedItemIndex)}`);\n listItem.classList.add('highlighted');\n }\n }\n\n private removeHighlight(i: number) {\n if (i > -1) {\n const listItem = this.el.shadowRoot.querySelector(`#${this.getListItemId(i)}`);\n listItem.classList.remove('highlighted');\n }\n }\n\n private selectCurrentItem(): void {\n if (this.selectedItemIndex >= 0) {\n const selectedItemText = this.filterResult[this.selectedItemIndex];\n this.handleItemSelected(selectedItemText);\n }\n }\n\n handleItemHovered(index: number): void {\n this.removeHighlight(this.selectedItemIndex);\n this.selectedItemIndex = index;\n this.addHighlight();\n }\n\n handleComponentFocusOut() {\n // Ensure dropdown closed on clicking or tabbing away from this component\n if (this.filterResult?.length > 0) {\n this.filterResult = new Array<string>();\n this.hasBeenFocusedAtLeastOnce = false;\n }\n }\n\n /**\n * Check if the selected option is in view, and scroll if not\n */\n private updateScroll() {\n const container = this.listContainer;\n\n const ul = container.querySelector('ul');\n const selectedItem: any = Array.from(ul.childNodes).find((item: any) => item.ariaPosInSet === `${this.selectedItemIndex + 1}`);\n\n if (container && selectedItem && container.scrollHeight + container.clientHeight) {\n selectedItem.scrollIntoView();\n }\n }\n\n private navigateSuggestions(key: Keys) {\n if (key === Keys.UP_ARROW) {\n this.removeHighlight(this.selectedItemIndex);\n this.selectedItemIndex--;\n if (this.selectedItemIndex === -2) {\n this.selectedItemIndex = this.filterResult.length - 1;\n }\n }\n if (key === Keys.DOWN_ARROW) {\n this.removeHighlight(this.selectedItemIndex);\n this.selectedItemIndex++;\n if (this.selectedItemIndex > this.filterResult.length - 1) {\n this.selectedItemIndex = -1;\n }\n }\n if (this.selectedItemIndex === -1) {\n this.inputValue = this.originalSearch;\n } else {\n const value = this.filterResult[this.selectedItemIndex];\n\n this.inputValue = value;\n\n this.addHighlight();\n }\n }\n\n private getListItemId(i: number) {\n return `${this.listId}-item-${i}`;\n }\n\n render() {\n return (\n <Host onFocusout={_ev => this.handleComponentFocusOut()}>\n <div class=\"visually-hidden\">\n <div class=\"results-status-a\" role=\"status\" aria-atomic=\"true\" aria-live=\"polite\">\n {!this.isSilenced && this.isAlternateStatusSection ? this.statusText : ''}\n </div>\n <div class=\"results-status-b\" role=\"status\" aria-atomic=\"true\" aria-live=\"polite\">\n {!this.isSilenced && !this.isAlternateStatusSection ? this.statusText : ''}\n </div>\n </div>\n <admiralty-input\n type=\"text\"\n ref={el => (this.inputControl = el)}\n label={this.label}\n placeholder={this.placeholder}\n class=\"filterTextInput\"\n onKeyUp={ev => this.handleKeyPressed(ev)}\n onKeyDown={ev => this.handleKeyDown(ev)}\n onFocusin={_ev => this.handleFocusIn()}\n onFocusout={_ev => this.handleFocusOut()}\n aria-expanded={this.isFocused && this.filterResult.length > 0}\n ></admiralty-input>\n\n <span id={this.hintId} class=\"visually-hidden\">\n When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.\n </span>\n {this.filterResult.length > 0 ? (\n <div class=\"typeahead-list-container\" ref={el => (this.listContainer = el)}>\n <ul class=\"typeahead-list\" id={this.listId} role=\"listbox\">\n {this.filterResult.map((item, i) => (\n <li\n id={this.getListItemId(i)}\n onMouseDown={_ev => this.handleItemSelected(item)}\n onMouseOver={_ev => this.handleItemHovered(i)}\n aria-selected={i === this.selectedItemIndex}\n role=\"option\"\n tabindex=\"-1\"\n aria-posinset={i + 1}\n aria-setsize={this.filterResult.length}\n >\n {item}\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n <slot></slot>\n </Host>\n );\n }\n}\n\nenum Keys {\n UP_ARROW = 'ArrowUp',\n DOWN_ARROW = 'ArrowDown',\n ENTER = 'Enter',\n TAB = 'Tab',\n}\n\nlet id = 0;\n"]}
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: block;
3
+ }
@@ -0,0 +1,43 @@
1
+ import { Host, h } from '@stencil/core';
2
+ export class AdmiraltyTypeAheadItem {
3
+ constructor() {
4
+ this.value = undefined;
5
+ }
6
+ render() {
7
+ return h(Host, null);
8
+ }
9
+ static get is() { return "admiralty-type-ahead-item"; }
10
+ static get encapsulation() { return "scoped"; }
11
+ static get originalStyleUrls() {
12
+ return {
13
+ "$": ["type-ahead-item.scss"]
14
+ };
15
+ }
16
+ static get styleUrls() {
17
+ return {
18
+ "$": ["type-ahead-item.css"]
19
+ };
20
+ }
21
+ static get properties() {
22
+ return {
23
+ "value": {
24
+ "type": "string",
25
+ "mutable": false,
26
+ "complexType": {
27
+ "original": "string",
28
+ "resolved": "string",
29
+ "references": {}
30
+ },
31
+ "required": true,
32
+ "optional": false,
33
+ "docs": {
34
+ "tags": [],
35
+ "text": ""
36
+ },
37
+ "attribute": "value",
38
+ "reflect": false
39
+ }
40
+ };
41
+ }
42
+ }
43
+ //# sourceMappingURL=type-ahead-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-ahead-item.js","sourceRoot":"","sources":["../../../src/components/type-ahead-item/type-ahead-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,sBAAsB;;;;EAGjC,MAAM;IACJ,OAAO,EAAC,IAAI,OAAQ,CAAC;EACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-type-ahead-item',\n styleUrl: 'type-ahead-item.scss',\n scoped: true,\n})\nexport class AdmiraltyTypeAheadItem {\n @Prop() value!: string;\n\n render() {\n return <Host></Host>;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ //export { Components, JSX } from './components';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iDAAiD","sourcesContent":["//export { Components, JSX } from './components';\r\n"]}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyBreadcrumb extends Components.AdmiraltyBreadcrumb, HTMLElement {}
4
+ export const AdmiraltyBreadcrumb: {
5
+ prototype: AdmiraltyBreadcrumb;
6
+ new (): AdmiraltyBreadcrumb;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,48 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { f as faChevronRight, d as defineCustomElement$2 } from './icon.js';
3
+
4
+ const breadcrumbCss = "@media (max-width: 1023px){.desktop-only{display:none}}@media (min-width: 1024px){.not-desktop{display:none}}@media (min-width: 1024px){.tablet-only{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-only{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-or-desktop{display:none}}@media (min-width: 1024px){.phone-or-tablet{display:none}}@media (min-width: 1024px){.phone-only{display:none}}@media (max-width: 1023px) and (min-width: 480px){.phone-only{display:none}}:host{display:flex;align-items:center}.breadcrumb-icon{margin:0 10px;font-size:12px}a{display:inline-block;font-size:14px;font-weight:300;text-decoration:none;color:#333333;margin:10px 2px}a:hover{color:#09315b}a.active{color:#09315b;font-weight:normal}";
5
+
6
+ const BreadcrumbComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.__attachShadow();
11
+ this.active = false;
12
+ this.first = undefined;
13
+ this.href = undefined;
14
+ }
15
+ render() {
16
+ return (h(Host, null, !this.first && h("admiralty-icon", { class: "breadcrumb-icon", "icon-name": faChevronRight.iconName }), h("a", { class: { active: this.active }, href: this.href || '#' }, h("slot", null))));
17
+ }
18
+ static get style() { return breadcrumbCss; }
19
+ }, [1, "admiralty-breadcrumb", {
20
+ "active": [4],
21
+ "first": [4],
22
+ "href": [1]
23
+ }]);
24
+ function defineCustomElement$1() {
25
+ if (typeof customElements === "undefined") {
26
+ return;
27
+ }
28
+ const components = ["admiralty-breadcrumb", "admiralty-icon"];
29
+ components.forEach(tagName => { switch (tagName) {
30
+ case "admiralty-breadcrumb":
31
+ if (!customElements.get(tagName)) {
32
+ customElements.define(tagName, BreadcrumbComponent);
33
+ }
34
+ break;
35
+ case "admiralty-icon":
36
+ if (!customElements.get(tagName)) {
37
+ defineCustomElement$2();
38
+ }
39
+ break;
40
+ } });
41
+ }
42
+
43
+ const AdmiraltyBreadcrumb = BreadcrumbComponent;
44
+ const defineCustomElement = defineCustomElement$1;
45
+
46
+ export { AdmiraltyBreadcrumb, defineCustomElement };
47
+
48
+ //# sourceMappingURL=admiralty-breadcrumb.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-breadcrumb.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,uvBAAuvB;;MCQhwB,mBAAmB;;;;;kBAMb,KAAK;;;;EAatB,MAAM;IACJ,QACE,EAAC,IAAI,QACF,CAAC,IAAI,CAAC,KAAK,IAAI,sBAAgB,KAAK,EAAC,iBAAiB,eAAY,cAAc,CAAC,QAAQ,GAAmB,EAC7G,SAAG,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,GAAG,IACvD,eAAa,CACX,CACC,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/breadcrumb/breadcrumb.scss?tag=admiralty-breadcrumb&encapsulation=shadow","./src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["@use \"../../scss/base/responsive\";\r\n\r\n@use \"../../scss/vars/colours\";\r\n@use \"../../scss/vars/typography\";\r\n\r\n:host {\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.breadcrumb-icon {\r\n margin: 0 10px;\r\n font-size: 12px;\r\n}\r\n\r\na {\r\n display: inline-block;\r\n font-size: 14px;\r\n font-weight: typography.$font-weight-light;\r\n text-decoration: none;\r\n color: colours.$colour-nav-item;\r\n margin: 10px 2px;\r\n\r\n &:hover {\r\n color: colours.$colour-admiralty-blue;\r\n }\r\n\r\n &.active {\r\n color: colours.$colour-admiralty-blue;\r\n font-weight: typography.$font-weight-medium;\r\n }\r\n}\r\n","import { Component, Prop, h, Host } from '@stencil/core';\nimport { faChevronRight } from '@fortawesome/free-solid-svg-icons';\n\n@Component({\n tag: 'admiralty-breadcrumb',\n styleUrl: 'breadcrumb.scss',\n shadow: true,\n})\nexport class BreadcrumbComponent {\n /**\n * When `true` the breadcrumb will by styled to show that it is the\n * currently active breadcrumb. Defaults to `true` for the\n * last breadcrumb if it is not set on any.\n */\n @Prop() active = false;\n\n /**\n * @internal\n * When set to `true` the breadcrumb will not be prefixed with a chevron.\n */\n @Prop() first!: boolean;\n\n /**\n * Contains a URL or a URL fragment that the hyperlink points to.\n */\n @Prop() href: string | undefined;\n\n render() {\n return (\n <Host>\n {!this.first && <admiralty-icon class=\"breadcrumb-icon\" icon-name={faChevronRight.iconName}></admiralty-icon>}\n <a class={{ active: this.active }} href={this.href || '#'}>\n <slot></slot>\n </a>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyBreadcrumbs extends Components.AdmiraltyBreadcrumbs, HTMLElement {}
4
+ export const AdmiraltyBreadcrumbs: {
5
+ prototype: AdmiraltyBreadcrumbs;
6
+ new (): AdmiraltyBreadcrumbs;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,62 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const breadcrumbsCss = ".breadcrumbs{width:100%;box-sizing:border-box;display:inline-flex;border-bottom:1px solid #d8d8d8;background-color:#ffffff;padding:0 20px}";
4
+
5
+ const BreadcrumbsComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ this.breadcrumbsInit = () => {
11
+ this.setActiveBreadcrumb();
12
+ };
13
+ this.setActiveBreadcrumb = () => {
14
+ const breadcrumbs = this.getBreadcrumbs();
15
+ // Check if an active breadcrumb exists already
16
+ const active = breadcrumbs.find(breadcrumb => breadcrumb.active);
17
+ // Set the active status
18
+ for (const breadcrumb of breadcrumbs) {
19
+ const isFirst = breadcrumb === breadcrumbs[0];
20
+ const isLast = breadcrumb === breadcrumbs[breadcrumbs.length - 1];
21
+ if (isFirst) {
22
+ breadcrumb.first = true;
23
+ }
24
+ // When no active breadcrumb, set the last one to active
25
+ if (!active && isLast) {
26
+ breadcrumb.active = true;
27
+ }
28
+ }
29
+ };
30
+ this.getBreadcrumbs = () => {
31
+ return Array.from(this.el.querySelectorAll('admiralty-breadcrumb'));
32
+ };
33
+ }
34
+ componentWillLoad() {
35
+ this.breadcrumbsInit();
36
+ }
37
+ render() {
38
+ return (h("nav", { class: "breadcrumbs", "aria-label": "breadcrumbs" }, h("slot", null)));
39
+ }
40
+ get el() { return this; }
41
+ static get style() { return breadcrumbsCss; }
42
+ }, [1, "admiralty-breadcrumbs"]);
43
+ function defineCustomElement$1() {
44
+ if (typeof customElements === "undefined") {
45
+ return;
46
+ }
47
+ const components = ["admiralty-breadcrumbs"];
48
+ components.forEach(tagName => { switch (tagName) {
49
+ case "admiralty-breadcrumbs":
50
+ if (!customElements.get(tagName)) {
51
+ customElements.define(tagName, BreadcrumbsComponent);
52
+ }
53
+ break;
54
+ } });
55
+ }
56
+
57
+ const AdmiraltyBreadcrumbs = BreadcrumbsComponent;
58
+ const defineCustomElement = defineCustomElement$1;
59
+
60
+ export { AdmiraltyBreadcrumbs, defineCustomElement };
61
+
62
+ //# sourceMappingURL=admiralty-breadcrumbs.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-breadcrumbs.js","mappings":";;AAAA,MAAM,cAAc,GAAG,4IAA4I;;MCOtJ,oBAAoB;EALjC;;;;IAYU,oBAAe,GAAG;MACxB,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC5B,CAAC;IAEM,wBAAmB,GAAG;MAC5B,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;;MAG1C,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;;MAGjE,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;QACpC,MAAM,OAAO,GAAG,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,UAAU,KAAK,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAElE,IAAI,OAAO,EAAE;UACX,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC;SACzB;;QAGD,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE;UACrB,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC;SAC1B;OACF;KACF,CAAC;IAEM,mBAAc,GAAG;MACvB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,CAAC;KACrE,CAAC;GASH;EAzCC,iBAAiB;IACf,IAAI,CAAC,eAAe,EAAE,CAAC;GACxB;EAgCD,MAAM;IACJ,QACE,WAAK,KAAK,EAAC,aAAa,gBAAY,aAAa,IAC/C,eAAa,CACT,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/breadcrumbs/breadcrumbs.scss?tag=admiralty-breadcrumbs&encapsulation=shadow","./src/components/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\r\n\r\n.breadcrumbs {\r\n width: 100%;\r\n box-sizing: border-box;\r\n display: inline-flex;\r\n border-bottom: 1px solid colours.$colour-divider;\r\n background-color: colours.$colour-bg;\r\n padding: 0 20px;\r\n}\r\n","import { Component, Element, h } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-breadcrumbs',\n styleUrl: 'breadcrumbs.scss',\n shadow: true,\n})\nexport class BreadcrumbsComponent {\n @Element() el!: HTMLElement;\n\n componentWillLoad() {\n this.breadcrumbsInit();\n }\n\n private breadcrumbsInit = () => {\n this.setActiveBreadcrumb();\n };\n\n private setActiveBreadcrumb = () => {\n const breadcrumbs = this.getBreadcrumbs();\n\n // Check if an active breadcrumb exists already\n const active = breadcrumbs.find(breadcrumb => breadcrumb.active);\n\n // Set the active status\n for (const breadcrumb of breadcrumbs) {\n const isFirst = breadcrumb === breadcrumbs[0];\n const isLast = breadcrumb === breadcrumbs[breadcrumbs.length - 1];\n\n if (isFirst) {\n breadcrumb.first = true;\n }\n\n // When no active breadcrumb, set the last one to active\n if (!active && isLast) {\n breadcrumb.active = true;\n }\n }\n };\n\n private getBreadcrumbs = (): HTMLAdmiraltyBreadcrumbElement[] => {\n return Array.from(this.el.querySelectorAll('admiralty-breadcrumb'));\n };\n\n render() {\n return (\n <nav class=\"breadcrumbs\" aria-label=\"breadcrumbs\">\n <slot></slot>\n </nav>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyButton extends Components.AdmiraltyButton, HTMLElement {}
4
+ export const AdmiraltyButton: {
5
+ prototype: AdmiraltyButton;
6
+ new (): AdmiraltyButton;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,8 @@
1
+ import { B as ButtonComponent, d as defineCustomElement$1 } from './button.js';
2
+
3
+ const AdmiraltyButton = ButtonComponent;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { AdmiraltyButton, defineCustomElement };
7
+
8
+ //# sourceMappingURL=admiralty-button.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-button.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyCard extends Components.AdmiraltyCard, HTMLElement {}
4
+ export const AdmiraltyCard: {
5
+ prototype: AdmiraltyCard;
6
+ new (): AdmiraltyCard;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,37 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const cardCss = "@media (max-width: 1023px){.desktop-only{display:none}}@media (min-width: 1024px){.not-desktop{display:none}}@media (min-width: 1024px){.tablet-only{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-only{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-or-desktop{display:none}}@media (min-width: 1024px){.phone-or-tablet{display:none}}@media (min-width: 1024px){.phone-only{display:none}}@media (max-width: 1023px) and (min-width: 480px){.phone-only{display:none}}admiralty-card .card{display:flex;flex-direction:column;border:1px solid #d8d8d8}admiralty-card .card>h6{height:60px;line-height:60px;border:1px solid #09315b;color:#ffffff;background-color:#09315b;margin:0;padding:0 30px}@media (max-width: 1023px){admiralty-card .card>h6{padding:0px 18px;height:48px;line-height:48px}}admiralty-card .card>div{border-top:none;flex-grow:1;padding:30px}@media (max-width: 1023px){admiralty-card .card>div{padding:24px 18px}}admiralty-card .text-input-form .text-input-wrap{margin-bottom:30px}admiralty-card .text-input-form .text-input-wrap:last-child{margin-bottom:0}";
4
+
5
+ const CardComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.heading = undefined;
10
+ }
11
+ render() {
12
+ return (h("section", { class: "card" }, this.heading ? h("h6", null, this.heading) : null, h("div", null, h("slot", null))));
13
+ }
14
+ static get style() { return cardCss; }
15
+ }, [4, "admiralty-card", {
16
+ "heading": [1]
17
+ }]);
18
+ function defineCustomElement$1() {
19
+ if (typeof customElements === "undefined") {
20
+ return;
21
+ }
22
+ const components = ["admiralty-card"];
23
+ components.forEach(tagName => { switch (tagName) {
24
+ case "admiralty-card":
25
+ if (!customElements.get(tagName)) {
26
+ customElements.define(tagName, CardComponent);
27
+ }
28
+ break;
29
+ } });
30
+ }
31
+
32
+ const AdmiraltyCard = CardComponent;
33
+ const defineCustomElement = defineCustomElement$1;
34
+
35
+ export { AdmiraltyCard, defineCustomElement };
36
+
37
+ //# sourceMappingURL=admiralty-card.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-card.js","mappings":";;AAAA,MAAM,OAAO,GAAG,mlCAAmlC;;MCOtlC,aAAa;;;;;;EAMxB,MAAM;IACJ,QACE,eAAS,KAAK,EAAC,MAAM,IAClB,IAAI,CAAC,OAAO,GAAG,cAAK,IAAI,CAAC,OAAO,CAAM,GAAG,IAAI,EAC9C,eACE,eAAa,CACT,CACE,EACV;GACH;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/card/card.scss?tag=admiralty-card","./src/components/card/card.tsx"],"sourcesContent":["@use \"../../scss/base/responsive\";\n\n@use \"../../scss/vars/colours\";\n\nadmiralty-card {\n .card {\n display: flex;\n flex-direction: column;\n border: 1px solid colours.$colour-divider;\n\n & > h6 {\n height: 60px;\n line-height: 60px;\n border: 1px solid colours.$colour-admiralty-blue;\n color: colours.$colour-white;\n background-color: colours.$colour-admiralty-blue;\n margin: 0;\n padding: 0 30px;\n @include responsive.not-desktop {\n padding: 0px 18px;\n height: 48px;\n line-height: 48px;\n }\n }\n\n & > div {\n border-top: none;\n flex-grow: 1;\n padding: 30px;\n @include responsive.not-desktop {\n padding: 24px 18px;\n }\n }\n }\n\n .text-input-form {\n .text-input-wrap {\n margin-bottom: 30px;\n }\n\n .text-input-wrap:last-child {\n margin-bottom: 0;\n }\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-card',\n styleUrl: 'card.scss',\n shadow: false,\n})\nexport class CardComponent {\n /**\n * The title of the card.\n */\n @Prop() heading: string;\n\n render() {\n return (\n <section class=\"card\">\n {this.heading ? <h6>{this.heading}</h6> : null}\n <div>\n <slot></slot>\n </div>\n </section>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyCheckbox extends Components.AdmiraltyCheckbox, HTMLElement {}
4
+ export const AdmiraltyCheckbox: {
5
+ prototype: AdmiraltyCheckbox;
6
+ new (): AdmiraltyCheckbox;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;