@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,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyPaginatorWrapper extends Components.AdmiraltyPaginatorWrapper, HTMLElement {}
4
+ export const AdmiraltyPaginatorWrapper: {
5
+ prototype: AdmiraltyPaginatorWrapper;
6
+ new (): AdmiraltyPaginatorWrapper;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,45 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const PaginatorWrapperComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
4
+ constructor() {
5
+ super();
6
+ this.__registerHost();
7
+ }
8
+ pageChangedHandler(event) {
9
+ const page = event.detail;
10
+ const paginator = this.el.querySelector('admiralty-paginator');
11
+ const perPage = 6;
12
+ const first = page == 1 ? 1 : perPage * (page - 1) + 1;
13
+ const last = page == 8 ? 45 : perPage * page;
14
+ const total = 45;
15
+ const label = `Showing ${first}-${last} of ${total}`;
16
+ if (paginator.label) {
17
+ paginator.label = label;
18
+ }
19
+ paginator.currentPage = page;
20
+ }
21
+ render() {
22
+ return (h("div", null, h("slot", null)));
23
+ }
24
+ get el() { return this; }
25
+ }, [4, "admiralty-paginator-wrapper", undefined, [[0, "pageChange", "pageChangedHandler"]]]);
26
+ function defineCustomElement$1() {
27
+ if (typeof customElements === "undefined") {
28
+ return;
29
+ }
30
+ const components = ["admiralty-paginator-wrapper"];
31
+ components.forEach(tagName => { switch (tagName) {
32
+ case "admiralty-paginator-wrapper":
33
+ if (!customElements.get(tagName)) {
34
+ customElements.define(tagName, PaginatorWrapperComponent);
35
+ }
36
+ break;
37
+ } });
38
+ }
39
+
40
+ const AdmiraltyPaginatorWrapper = PaginatorWrapperComponent;
41
+ const defineCustomElement = defineCustomElement$1;
42
+
43
+ export { AdmiraltyPaginatorWrapper, defineCustomElement };
44
+
45
+ //# sourceMappingURL=admiralty-paginator-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-paginator-wrapper.js","mappings":";;MAWa,yBAAyB;;;;;EAIpC,kBAAkB,CAAC,KAAuB;IACxC,MAAM,IAAI,GAAW,KAAK,CAAC,MAAM,CAAC;IAClC,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAE/D,MAAM,OAAO,GAAG,CAAC,CAAC;IAClB,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,IAAI,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC;IAC7C,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,MAAM,KAAK,GAAG,WAAW,KAAK,IAAI,IAAI,OAAO,KAAK,EAAE,CAAC;IAErD,IAAI,SAAS,CAAC,KAAK,EAAE;MACnB,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;KACzB;IACD,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;GAC9B;EAED,MAAM;IACJ,QACE,eACE,eAAa,CACT,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/paginator/paginator.stories.data.tsx"],"sourcesContent":["import { Component, Element, h, Listen } from '@stencil/core';\n\n/**\n * @internal\n * Wrapper for the Paginator to demonstrate how the label and current page properties\n * can be updated.\n */\n@Component({\n tag: 'admiralty-paginator-wrapper',\n shadow: false,\n})\nexport class PaginatorWrapperComponent {\n @Element() el!: HTMLElement;\n\n @Listen('pageChange')\n pageChangedHandler(event: CustomEvent<any>) {\n const page: number = event.detail;\n const paginator = this.el.querySelector('admiralty-paginator');\n\n const perPage = 6;\n const first = page == 1 ? 1 : perPage * (page - 1) + 1;\n const last = page == 8 ? 45 : perPage * page;\n const total = 45;\n const label = `Showing ${first}-${last} of ${total}`;\n\n if (paginator.label) {\n paginator.label = label;\n }\n paginator.currentPage = page;\n }\n\n render() {\n return (\n <div>\n <slot></slot>\n </div>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyPaginator extends Components.AdmiraltyPaginator, HTMLElement {}
4
+ export const AdmiraltyPaginator: {
5
+ prototype: AdmiraltyPaginator;
6
+ new (): AdmiraltyPaginator;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,73 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { a as ButtonVariant, d as defineCustomElement$3 } from './button.js';
3
+ import { i as faChevronLeft, f as faChevronRight, d as defineCustomElement$2 } from './icon.js';
4
+
5
+ const paginatorCss = "admiralty-paginator nav.standard{display:flex;flex-direction:row;align-items:center}admiralty-paginator nav.standard admiralty-button{margin:6px}admiralty-paginator nav.standard p{padding:0px 18px 0px 0px;margin-bottom:0px}";
6
+
7
+ const PaginatorComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ this.__registerHost();
11
+ this.pageChange = createEvent(this, "pageChange", 7);
12
+ this.maxLength = 7;
13
+ this.pages = 1;
14
+ this.currentPage = 1;
15
+ this.label = '';
16
+ }
17
+ pageChanged(page) {
18
+ this.pageChange.emit(page);
19
+ }
20
+ onKeydown(event, navFn) {
21
+ if (event.key === 'Enter' || event.key === 'Enter') {
22
+ navFn();
23
+ }
24
+ }
25
+ prev() {
26
+ if (this.currentPage > 1) {
27
+ this.pageChanged(this.currentPage - 1);
28
+ }
29
+ }
30
+ next() {
31
+ if (this.currentPage < this.pages) {
32
+ this.pageChanged(this.currentPage + 1);
33
+ }
34
+ }
35
+ render() {
36
+ return (h("nav", { "aria-label": "pagination", class: "standard" }, h("p", { "aria-live": "polite" }, this.label), h("admiralty-button", { variant: ButtonVariant.Icon, icon: faChevronLeft.iconName, disabled: this.currentPage === 1, tabindex: 0, "aria-disabled": this.currentPage === 1, onClick: this.prev.bind(this), onKeyDown: e => this.onKeydown(e, this.prev.bind(this)), "aria-label": "Previous Page" }), h("admiralty-button", { variant: ButtonVariant.Icon, icon: faChevronRight.iconName, disabled: this.currentPage === this.pages, tabindex: 0, "aria-disabled": this.currentPage === this.pages, onClick: this.next.bind(this), onKeyDown: e => this.onKeydown(e, this.next.bind(this)), "aria-label": "Next Page" })));
37
+ }
38
+ static get style() { return paginatorCss; }
39
+ }, [0, "admiralty-paginator", {
40
+ "pages": [2],
41
+ "currentPage": [2, "current-page"],
42
+ "label": [1]
43
+ }]);
44
+ function defineCustomElement$1() {
45
+ if (typeof customElements === "undefined") {
46
+ return;
47
+ }
48
+ const components = ["admiralty-paginator", "admiralty-button", "admiralty-icon"];
49
+ components.forEach(tagName => { switch (tagName) {
50
+ case "admiralty-paginator":
51
+ if (!customElements.get(tagName)) {
52
+ customElements.define(tagName, PaginatorComponent);
53
+ }
54
+ break;
55
+ case "admiralty-button":
56
+ if (!customElements.get(tagName)) {
57
+ defineCustomElement$3();
58
+ }
59
+ break;
60
+ case "admiralty-icon":
61
+ if (!customElements.get(tagName)) {
62
+ defineCustomElement$2();
63
+ }
64
+ break;
65
+ } });
66
+ }
67
+
68
+ const AdmiraltyPaginator = PaginatorComponent;
69
+ const defineCustomElement = defineCustomElement$1;
70
+
71
+ export { AdmiraltyPaginator, defineCustomElement };
72
+
73
+ //# sourceMappingURL=admiralty-paginator.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-paginator.js","mappings":";;;;AAAA,MAAM,YAAY,GAAG,iOAAiO;;MCSzO,kBAAkB;;;;;IAmBpB,cAAS,GAAG,CAAC,CAAC;iBAfP,CAAC;uBAIK,CAAC;iBAIC,EAAE;;EASnB,WAAW,CAAC,IAAY;IAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GAC5B;EAED,SAAS,CAAC,KAAoB,EAAE,KAAe;IAC7C,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;MAClD,KAAK,EAAE,CAAC;KACT;GACF;EAED,IAAI;IACF,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE;MACxB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;KACxC;GACF;EAED,IAAI;IACF,IAAI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE;MACjC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;KACxC;GACF;EAED,MAAM;IACJ,QACE,yBAAgB,YAAY,EAAC,KAAK,EAAC,UAAU,IAC3C,sBAAa,QAAQ,IAAE,IAAI,CAAC,KAAK,CAAK,EACtC,wBACE,OAAO,EAAE,aAAa,CAAC,IAAI,EAC3B,IAAI,EAAE,aAAa,CAAC,QAAQ,EAC5B,QAAQ,EAAE,IAAI,CAAC,WAAW,KAAK,CAAC,EAChC,QAAQ,EAAE,CAAC,mBACI,IAAI,CAAC,WAAW,KAAK,CAAC,EACrC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAC7B,SAAS,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAC5C,eAAe,GACR,EACpB,wBACE,OAAO,EAAE,aAAa,CAAC,IAAI,EAC3B,IAAI,EAAE,cAAc,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,KAAK,EACzC,QAAQ,EAAE,CAAC,mBACI,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,KAAK,EAC9C,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAC7B,SAAS,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAC5C,WAAW,GACJ,CAChB,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/paginator/paginator.scss?tag=admiralty-paginator","./src/components/paginator/paginator.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\n\nadmiralty-paginator nav.standard {\n display: flex;\n flex-direction: row;\n align-items: center;\n\n admiralty-button {\n margin: 6px;\n }\n\n p {\n padding: 0px 18px 0px 0px;\n margin-bottom: 0px;\n }\n}\n","import { Component, Prop, h, Event, EventEmitter } from '@stencil/core';\nimport { ButtonVariant } from '../button/button.types';\nimport { faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons';\n\n@Component({\n tag: 'admiralty-paginator',\n styleUrl: 'paginator.scss',\n shadow: false,\n})\nexport class PaginatorComponent {\n /**\n * The total number of pages. Defaults to 1.\n */\n @Prop() pages = 1;\n /**\n * The current page. Defaults to 1.\n */\n @Prop() currentPage = 1;\n /**\n * The label to display.\n */\n @Prop() label: string = '';\n /**\n * Dispatched when the previous or next button is pressed. The event detail contains\n * the requested page number.\n */\n @Event() pageChange: EventEmitter<number>;\n\n readonly maxLength = 7;\n\n public pageChanged(page: number) {\n this.pageChange.emit(page);\n }\n\n onKeydown(event: KeyboardEvent, navFn: Function) {\n if (event.key === 'Enter' || event.key === 'Enter') {\n navFn();\n }\n }\n\n prev() {\n if (this.currentPage > 1) {\n this.pageChanged(this.currentPage - 1);\n }\n }\n\n next() {\n if (this.currentPage < this.pages) {\n this.pageChanged(this.currentPage + 1);\n }\n }\n\n render() {\n return (\n <nav aria-label=\"pagination\" class=\"standard\">\n <p aria-live=\"polite\">{this.label}</p>\n <admiralty-button\n variant={ButtonVariant.Icon}\n icon={faChevronLeft.iconName}\n disabled={this.currentPage === 1}\n tabindex={0}\n aria-disabled={this.currentPage === 1}\n onClick={this.prev.bind(this)}\n onKeyDown={e => this.onKeydown(e, this.prev.bind(this))}\n aria-label=\"Previous Page\"\n ></admiralty-button>\n <admiralty-button\n variant={ButtonVariant.Icon}\n icon={faChevronRight.iconName}\n disabled={this.currentPage === this.pages}\n tabindex={0}\n aria-disabled={this.currentPage === this.pages}\n onClick={this.next.bind(this)}\n onKeyDown={e => this.onKeydown(e, this.next.bind(this))}\n aria-label=\"Next Page\"\n ></admiralty-button>\n </nav>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyPhaseBanner extends Components.AdmiraltyPhaseBanner, HTMLElement {}
4
+ export const AdmiraltyPhaseBanner: {
5
+ prototype: AdmiraltyPhaseBanner;
6
+ new (): AdmiraltyPhaseBanner;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,39 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const phaseBannerCss = "@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-phase-banner .phase-banner{display:block;line-height:40px;width:100%;padding:0 18px}@media (min-width: 1024px){admiralty-phase-banner .phase-banner{padding:0 20px}}admiralty-phase-banner .phase-banner strong{border:2px solid;font-weight:bold;text-transform:uppercase;letter-spacing:1px;color:#09315b;padding:6px 8px 3px;margin-right:10px}";
4
+
5
+ const PhaseBannerComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.phase = 'alpha';
10
+ this.link = undefined;
11
+ }
12
+ render() {
13
+ return (h("div", { class: "phase-banner" }, h("strong", null, this.phase), h("span", null, "This service is in ", this.phase, " phase - please provide", ' ', h("a", { href: this.link, target: "_blank" }, "feedback"), ' ', "to help us improve it")));
14
+ }
15
+ static get style() { return phaseBannerCss; }
16
+ }, [0, "admiralty-phase-banner", {
17
+ "phase": [1],
18
+ "link": [1]
19
+ }]);
20
+ function defineCustomElement$1() {
21
+ if (typeof customElements === "undefined") {
22
+ return;
23
+ }
24
+ const components = ["admiralty-phase-banner"];
25
+ components.forEach(tagName => { switch (tagName) {
26
+ case "admiralty-phase-banner":
27
+ if (!customElements.get(tagName)) {
28
+ customElements.define(tagName, PhaseBannerComponent);
29
+ }
30
+ break;
31
+ } });
32
+ }
33
+
34
+ const AdmiraltyPhaseBanner = PhaseBannerComponent;
35
+ const defineCustomElement = defineCustomElement$1;
36
+
37
+ export { AdmiraltyPhaseBanner, defineCustomElement };
38
+
39
+ //# sourceMappingURL=admiralty-phase-banner.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-phase-banner.js","mappings":";;AAAA,MAAM,cAAc,GAAG,s1BAAs1B;;MCOh2B,oBAAoB;;;;iBAIG,OAAO;;;EAOzC,MAAM;IACJ,QACE,WAAK,KAAK,EAAC,cAAc,IACvB,kBAAS,IAAI,CAAC,KAAK,CAAU,EAC7B,uCACsB,IAAI,CAAC,KAAK,6BAAyB,GAAG,EAC1D,SAAG,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAC,QAAQ,eAE/B,EAAC,GAAG,0BAEH,CACH,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/phase-banner/phase-banner.scss?tag=admiralty-phase-banner","./src/components/phase-banner/phase-banner.tsx"],"sourcesContent":["@use \"../../scss/base/responsive\";\n@use \"../../scss/vars/colours\";\n\nadmiralty-phase-banner .phase-banner {\n display: block;\n line-height: 40px;\n width: 100%;\n padding: 0 18px;\n @include responsive.desktop-only {\n padding: 0 20px;\n }\n\n strong {\n border: 2px solid;\n font-weight: bold;\n text-transform: uppercase;\n letter-spacing: 1px;\n color: colours.$colour-admiralty-blue;\n padding: 6px 8px 3px;\n margin-right: 10px;\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-phase-banner',\n styleUrl: 'phase-banner.scss',\n shadow: false,\n})\nexport class PhaseBannerComponent {\n /**\n * The phase for the phase banner\n */\n @Prop() phase: 'alpha' | 'beta' = 'alpha';\n\n /**\n * A link to where the end user can provide feedback\n */\n @Prop() link: string;\n\n render() {\n return (\n <div class=\"phase-banner\">\n <strong>{this.phase}</strong>\n <span>\n This service is in {this.phase} phase - please provide{' '}\n <a href={this.link} target=\"_blank\">\n feedback\n </a>{' '}\n to help us improve it\n </span>\n </div>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyProgressBar extends Components.AdmiraltyProgressBar, HTMLElement {}
4
+ export const AdmiraltyProgressBar: {
5
+ prototype: AdmiraltyProgressBar;
6
+ new (): AdmiraltyProgressBar;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,52 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$2 } from './label.js';
3
+
4
+ const progressBarCss = "progress.sc-admiralty-progress-bar{appearance:none;background:#eeeeee;border:none;box-sizing:border-box;color:#09315b;display:inline-block;font-size:18px;flex:1;height:1em;width:100%}progress[value].error.sc-admiralty-progress-bar::-webkit-progress-value{background-color:#e20d0d}progress[value].sc-admiralty-progress-bar::-webkit-progress-value{background-color:#47a234}";
5
+
6
+ const ProgressBarComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.id = `admiralty-progress-${++progressId}`;
11
+ this.label = undefined;
12
+ this.progression = 0;
13
+ this.error = false;
14
+ this.progressionValue = this.progression;
15
+ }
16
+ render() {
17
+ const { id, label, error, progressionValue } = this;
18
+ return (h("div", { class: "admiralty-progress" }, label ? h("admiralty-label", { for: id }, label) : null, h("progress", { id: id, class: { error: error }, value: progressionValue, max: "100" })));
19
+ }
20
+ static get style() { return progressBarCss; }
21
+ }, [2, "admiralty-progress-bar", {
22
+ "label": [1],
23
+ "progression": [2],
24
+ "error": [4],
25
+ "progressionValue": [32]
26
+ }]);
27
+ let progressId = 0;
28
+ function defineCustomElement$1() {
29
+ if (typeof customElements === "undefined") {
30
+ return;
31
+ }
32
+ const components = ["admiralty-progress-bar", "admiralty-label"];
33
+ components.forEach(tagName => { switch (tagName) {
34
+ case "admiralty-progress-bar":
35
+ if (!customElements.get(tagName)) {
36
+ customElements.define(tagName, ProgressBarComponent);
37
+ }
38
+ break;
39
+ case "admiralty-label":
40
+ if (!customElements.get(tagName)) {
41
+ defineCustomElement$2();
42
+ }
43
+ break;
44
+ } });
45
+ }
46
+
47
+ const AdmiraltyProgressBar = ProgressBarComponent;
48
+ const defineCustomElement = defineCustomElement$1;
49
+
50
+ export { AdmiraltyProgressBar, defineCustomElement };
51
+
52
+ //# sourceMappingURL=admiralty-progress-bar.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-progress-bar.js","mappings":";;;AAAA,MAAM,cAAc,GAAG,qXAAqX;;MCO/X,oBAAoB;;;;IACvB,OAAE,GAAG,sBAAsB,EAAE,UAAU,EAAE,CAAC;;uBASpB,CAAC;iBAKN,KAAK;4BAKM,IAAI,CAAC,WAAW;;EAEpD,MAAM;IACJ,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IAEpD,QACE,WAAK,KAAK,EAAC,oBAAoB,IAC5B,KAAK,GAAG,uBAAiB,GAAG,EAAE,EAAE,IAAG,KAAK,CAAmB,GAAG,IAAI,EACnE,gBAAU,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAC,KAAK,GAAG,CAC5E,EACN;GACH;;;;;;;;AAGH,IAAI,UAAU,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/progress-bar/progress-bar.scss?tag=admiralty-progress-bar&encapsulation=scoped","./src/components/progress-bar/progress-bar.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\" as colours;\r\n\r\nprogress {\r\n appearance: none;\r\n background: colours.$colour-button-secondary-hover;\r\n border: none;\r\n box-sizing: border-box;\r\n color: colours.$colour-admiralty-blue;\r\n display: inline-block;\r\n font-size: 18px;\r\n flex: 1;\r\n height: 1em;\r\n width: 100%;\r\n\r\n &[value].error::-webkit-progress-value {\r\n background-color: colours.$colour-utility-error;\r\n }\r\n\r\n &[value]::-webkit-progress-value {\r\n background-color: colours.$colour-utility-success;\r\n }\r\n}\r\n","import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-progress-bar',\n styleUrl: 'progress-bar.scss',\n scoped: true,\n})\nexport class ProgressBarComponent {\n private id = `admiralty-progress-${++progressId}`;\n\n /**\n * If set, adds a label above the progress bar\n */\n @Prop() label?: string;\n\n /** * A value from 0 - 100 that visually represents the current progression\n */\n @Prop() progression: number = 0;\n\n /**\n * Set to true to indicate an error (turns the progress bar red)\n */\n @Prop() error: boolean = false;\n\n /**\n * Progress value, min:0, max: 100\n */\n @State() progressionValue: number = this.progression;\n\n render() {\n const { id, label, error, progressionValue } = this;\n\n return (\n <div class=\"admiralty-progress\">\n {label ? <admiralty-label for={id}>{label}</admiralty-label> : null}\n <progress id={id} class={{ error: error }} value={progressionValue} max=\"100\" />\n </div>\n );\n }\n}\n\nlet progressId = 0;\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyRadioGroup extends Components.AdmiraltyRadioGroup, HTMLElement {}
4
+ export const AdmiraltyRadioGroup: {
5
+ prototype: AdmiraltyRadioGroup;
6
+ new (): AdmiraltyRadioGroup;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,88 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const radioGroupCss = ".radio-group.sc-admiralty-radio-group{display:flex;flex-direction:row}.radio-group.sc-admiralty-radio-group-s>*,.radio-group .sc-admiralty-radio-group-s>*{margin-right:2em !important}.stack.sc-admiralty-radio-group{flex-direction:column}.stack.sc-admiralty-radio-group-s>*,.stack .sc-admiralty-radio-group-s>*{margin-bottom:10px !important}";
4
+
5
+ const RadioGroupComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.radioChange = createEvent(this, "radioChange", 7);
10
+ this.inputId = `admiralty-rg-${radioGroupIds++}`;
11
+ this.setRadioTabindex = (value) => {
12
+ const radios = this.getRadios();
13
+ // Get the first radio that is not disabled and the checked one
14
+ const first = radios.find(radio => !radio.disabled);
15
+ const checked = radios.find(radio => radio.value === value && !radio.disabled);
16
+ if (!first && !checked) {
17
+ return;
18
+ }
19
+ // If an enabled checked radio exists, set it to be the focusable radio
20
+ // otherwise we default to focus the first radio
21
+ const focusable = checked || first;
22
+ for (const radio of radios) {
23
+ const tabindex = radio === focusable ? 0 : -1;
24
+ radio.setButtonTabindex(tabindex);
25
+ }
26
+ };
27
+ this.onClick = (e) => {
28
+ const selectedRadio = e.target && e.target.closest('admiralty-radio');
29
+ if (selectedRadio) {
30
+ const currentValue = this.value;
31
+ const newValue = selectedRadio.value;
32
+ if (newValue !== currentValue) {
33
+ this.value = newValue;
34
+ }
35
+ else {
36
+ this.value = undefined;
37
+ }
38
+ }
39
+ };
40
+ this.name = this.inputId;
41
+ this.value = undefined;
42
+ this.displayVertical = false;
43
+ }
44
+ valueChanged(value) {
45
+ this.setRadioTabindex(value);
46
+ this.radioChange.emit({ value });
47
+ }
48
+ componentDidLoad() {
49
+ this.setRadioTabindex(this.value);
50
+ }
51
+ getRadios() {
52
+ return Array.from(this.el.querySelectorAll('admiralty-radio'));
53
+ }
54
+ render() {
55
+ const { displayVertical } = this;
56
+ return (h(Host, null, h("div", { class: { 'radio-group': true, 'stack': displayVertical }, role: "radiogroup", onClick: this.onClick }, h("slot", null))));
57
+ }
58
+ get el() { return this; }
59
+ static get watchers() { return {
60
+ "value": ["valueChanged"]
61
+ }; }
62
+ static get style() { return radioGroupCss; }
63
+ }, [6, "admiralty-radio-group", {
64
+ "name": [1],
65
+ "value": [1032],
66
+ "displayVertical": [4, "display-vertical"]
67
+ }]);
68
+ let radioGroupIds = 0;
69
+ function defineCustomElement$1() {
70
+ if (typeof customElements === "undefined") {
71
+ return;
72
+ }
73
+ const components = ["admiralty-radio-group"];
74
+ components.forEach(tagName => { switch (tagName) {
75
+ case "admiralty-radio-group":
76
+ if (!customElements.get(tagName)) {
77
+ customElements.define(tagName, RadioGroupComponent);
78
+ }
79
+ break;
80
+ } });
81
+ }
82
+
83
+ const AdmiraltyRadioGroup = RadioGroupComponent;
84
+ const defineCustomElement = defineCustomElement$1;
85
+
86
+ export { AdmiraltyRadioGroup, defineCustomElement };
87
+
88
+ //# sourceMappingURL=admiralty-radio-group.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-radio-group.js","mappings":";;AAAA,MAAM,aAAa,GAAG,sVAAsV;;MCO/V,mBAAmB;;;;;IACtB,YAAO,GAAG,gBAAgB,aAAa,EAAE,EAAE,CAAC;IAmC5C,qBAAgB,GAAG,CAAC,KAAsB;MAChD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;;MAGhC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;MACpD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;MAE/E,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE;QACtB,OAAO;OACR;;;MAID,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,CAAC;MAEnC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,MAAM,QAAQ,GAAG,KAAK,KAAK,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9C,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;OACnC;KACF,CAAC;IAKM,YAAO,GAAG,CAAC,CAAQ;MACzB,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,IAAK,CAAC,CAAC,MAAsB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;MAEvF,IAAI,aAAa,EAAE;QACjB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC;QAChC,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC;QAErC,IAAI,QAAQ,KAAK,YAAY,EAAE;UAC7B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;SACvB;aAAM;UACL,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;SACxB;OACF;KACF,CAAC;gBAjEqB,IAAI,CAAC,OAAO;;2BAUA,KAAK;;EAGxC,YAAY,CAAC,KAAU;IACrB,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;GAClC;EAOD,gBAAgB;IACd,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GACnC;EAuBO,SAAS;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC;GAChE;EAgBD,MAAM;IACJ,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;IAEjC,QACE,EAAC,IAAI,QACH,WAAK,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,IAAI,EAAC,YAAY,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,IACpG,eAAa,CACT,CACD,EACP;GACH;;;;;;;;;;;AAGH,IAAI,aAAa,GAAW,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/radio-group/radio-group.scss?tag=admiralty-radio-group&encapsulation=scoped","./src/components/radio-group/radio-group.tsx"],"sourcesContent":[".radio-group {\r\n display: flex;\r\n flex-direction: row;\r\n\r\n ::slotted(*) {\r\n margin-right: 2em !important;\r\n }\r\n}\r\n\r\n.stack {\r\n flex-direction: column;\r\n\r\n ::slotted(*) {\r\n margin-bottom: 10px !important;\r\n }\r\n}\r\n\r\n","import { Component, Host, h, Prop, Element, Event, EventEmitter, ComponentInterface, Watch } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-radio-group',\n styleUrl: 'radio-group.scss',\n scoped: true,\n})\nexport class RadioGroupComponent implements ComponentInterface {\n private inputId = `admiralty-rg-${radioGroupIds++}`;\n\n @Element() el!: HTMLElement;\n\n /**\n * The name of the control, which is submitted with the form data\n */\n @Prop() name: string = this.inputId;\n\n /**\n * The value of the radio group\n */\n @Prop({ mutable: true }) value: any | null;\n\n /**\n * Setting this true displays the radio options vertically (defaults to false)\n */\n @Prop() displayVertical: boolean = false;\n\n @Watch('value')\n valueChanged(value: any) {\n this.setRadioTabindex(value);\n\n this.radioChange.emit({ value });\n }\n\n /**\n * Event fired when the checked radio button changes\n */\n @Event() radioChange: EventEmitter<any>;\n\n componentDidLoad(): void {\n this.setRadioTabindex(this.value);\n }\n\n private setRadioTabindex = (value: any | undefined) => {\n const radios = this.getRadios();\n\n // Get the first radio that is not disabled and the checked one\n const first = radios.find(radio => !radio.disabled);\n const checked = radios.find(radio => radio.value === value && !radio.disabled);\n\n if (!first && !checked) {\n return;\n }\n\n // If an enabled checked radio exists, set it to be the focusable radio\n // otherwise we default to focus the first radio\n const focusable = checked || first;\n\n for (const radio of radios) {\n const tabindex = radio === focusable ? 0 : -1;\n radio.setButtonTabindex(tabindex);\n }\n };\n\n private getRadios(): any {\n return Array.from(this.el.querySelectorAll('admiralty-radio'));\n }\n private onClick = (e: Event) => {\n const selectedRadio = e.target && (e.target as HTMLElement).closest('admiralty-radio');\n\n if (selectedRadio) {\n const currentValue = this.value;\n const newValue = selectedRadio.value;\n\n if (newValue !== currentValue) {\n this.value = newValue;\n } else {\n this.value = undefined;\n }\n }\n };\n\n render() {\n const { displayVertical } = this;\n\n return (\n <Host>\n <div class={{ 'radio-group': true, 'stack': displayVertical }} role=\"radiogroup\" onClick={this.onClick}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n\nlet radioGroupIds: number = 0;\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltyRadio extends Components.AdmiraltyRadio, HTMLElement {}
4
+ export const AdmiraltyRadio: {
5
+ prototype: AdmiraltyRadio;
6
+ new (): AdmiraltyRadio;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,84 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const radioCss = ".admiralty-radio.sc-admiralty-radio input.sc-admiralty-radio{appearance:none;border:2px solid #09315b;border-radius:1rem;height:1.5rem;width:1.5rem;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;margin-right:18px}.admiralty-radio.sc-admiralty-radio input.sc-admiralty-radio:checked:after{border-radius:100%;background-color:#09315b;width:0.8rem;height:0.8rem;content:\" \"}.admiralty-radio.sc-admiralty-radio input.sc-admiralty-radio:disabled{border:2px solid #adadad}.admiralty-radio.sc-admiralty-radio input.sc-admiralty-radio:focus{outline:3px solid #ffdd00;outline-offset:0}.admiralty-radio.sc-admiralty-radio label.sc-admiralty-radio{font-family:\"JohnstonITC\", Helvetica, sans-serif;font-weight:300;position:relative;top:2px}";
4
+
5
+ const RadioComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.admiraltyFocus = createEvent(this, "admiraltyFocus", 7);
10
+ this.admiraltyBlur = createEvent(this, "admiraltyBlur", 7);
11
+ this.inputId = `admiralty-radio-${radioButtonIds++}`;
12
+ this.radioGroup = null;
13
+ this.updateState = () => {
14
+ if (this.radioGroup) {
15
+ this.checked = this.radioGroup.value === this.value;
16
+ }
17
+ };
18
+ this.onClick = () => {
19
+ this.checked = this.nativeInput.checked;
20
+ };
21
+ this.onFocus = () => {
22
+ this.admiraltyFocus.emit();
23
+ };
24
+ this.onBlur = () => {
25
+ this.admiraltyBlur.emit();
26
+ };
27
+ this.buttonTabindex = -1;
28
+ this.name = this.inputId;
29
+ this.value = undefined;
30
+ this.disabled = false;
31
+ this.checked = false;
32
+ }
33
+ connectedCallback() {
34
+ if (this.value === undefined) {
35
+ this.value = this.inputId;
36
+ }
37
+ const radioGroup = (this.radioGroup = this.el.closest('admiralty-radio-group'));
38
+ if (radioGroup) {
39
+ this.updateState();
40
+ }
41
+ }
42
+ /** @internal */
43
+ async setButtonTabindex(value) {
44
+ this.buttonTabindex = value;
45
+ }
46
+ render() {
47
+ const { buttonTabindex, checked, disabled, inputId, name, value } = this;
48
+ return (h(Host, null, h("div", { class: "admiralty-radio" }, h("input", { "aria-checked": `${checked}`, "aria-hidden": disabled ? 'true' : null, "aria-labelledby": inputId, id: inputId, name: name, tabindex: buttonTabindex, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.onClick, class: "admiralty-radio", type: "radio", value: value, checked: checked, disabled: disabled ? true : null, ref: nativeEl => (this.nativeInput = nativeEl) }), h("label", { htmlFor: inputId }, h("slot", null)))));
49
+ }
50
+ get el() { return this; }
51
+ static get watchers() { return {
52
+ "checked": ["render"],
53
+ "disabled": ["render"]
54
+ }; }
55
+ static get style() { return radioCss; }
56
+ }, [6, "admiralty-radio", {
57
+ "name": [1],
58
+ "value": [1025],
59
+ "disabled": [4],
60
+ "checked": [1028],
61
+ "buttonTabindex": [32],
62
+ "setButtonTabindex": [64]
63
+ }]);
64
+ let radioButtonIds = 0;
65
+ function defineCustomElement$1() {
66
+ if (typeof customElements === "undefined") {
67
+ return;
68
+ }
69
+ const components = ["admiralty-radio"];
70
+ components.forEach(tagName => { switch (tagName) {
71
+ case "admiralty-radio":
72
+ if (!customElements.get(tagName)) {
73
+ customElements.define(tagName, RadioComponent);
74
+ }
75
+ break;
76
+ } });
77
+ }
78
+
79
+ const AdmiraltyRadio = RadioComponent;
80
+ const defineCustomElement = defineCustomElement$1;
81
+
82
+ export { AdmiraltyRadio, defineCustomElement };
83
+
84
+ //# sourceMappingURL=admiralty-radio.js.map
@@ -0,0 +1 @@
1
+ {"file":"admiralty-radio.js","mappings":";;AAAA,MAAM,QAAQ,GAAG,mwBAAmwB;;MCOvwB,cAAc;;;;;;IACjB,YAAO,GAAG,mBAAmB,cAAc,EAAE,EAAE,CAAC;IAEhD,eAAU,GAA0C,IAAI,CAAC;IAuDzD,gBAAW,GAAG;MACpB,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;OACrD;KACF,CAAC;IAEM,YAAO,GAAG;MAChB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;KACzC,CAAC;IAEM,YAAO,GAAG;MAChB,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;KAC5B,CAAC;IAEM,WAAM,GAAG;MACf,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;KAC3B,CAAC;0BA/DwB,CAAC,CAAC;gBAKL,IAAI,CAAC,OAAO;;oBAQN,KAAK;mBAKW,KAAK;;EAYlD,iBAAiB;IACf,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;MAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;KAC3B;IACD,MAAM,UAAU,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAEhF,IAAI,UAAU,EAAE;MACd,IAAI,CAAC,WAAW,EAAE,CAAC;KACpB;GACF;;EAID,MAAM,iBAAiB,CAAC,KAAa;IACnC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;GAC7B;EAsBD,MAAM;IACJ,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEzE,QACE,EAAC,IAAI,QACH,WAAK,KAAK,EAAC,iBAAiB,IAC1B,6BACgB,GAAG,OAAO,EAAE,iBACb,QAAQ,GAAG,MAAM,GAAG,IAAI,qBACpB,OAAO,EACxB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,EAChC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC,WAAW,GAAG,QAA4B,CAAC,GAClE,EACF,aAAO,OAAO,EAAE,OAAO,IACrB,eAAQ,CACF,CACJ,CACD,EACP;GACH;;;;;;;;;;;;;;;AAGH,IAAI,cAAc,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/radio/radio.scss?tag=admiralty-radio&encapsulation=scoped","./src/components/radio/radio.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\" as colours;\n@use \"../../scss/vars/typography\" as typography;\n\n.admiralty-radio {\n input {\n appearance: none;\n border: 2px solid colours.$colour-admiralty-blue;\n border-radius: 1rem;\n height: 1.5rem;\n width: 1.5rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n margin-right: 18px;\n\n &:checked:after {\n border-radius: 100%;\n background-color: colours.$colour-admiralty-blue;\n width: .8rem;\n height: .8rem;\n content: \" \";\n }\n\n &:disabled {\n border: 2px solid colours.$colour-textinput-text-disabled;\n }\n\n &:focus {\n outline: 3px solid colours.$colour-utility-focus;\n outline-offset: 0;\n }\n }\n\n label {\n font-family: typography.$font-family;\n font-weight: typography.$font-weight-light;\n position: relative;\n top: 2px;\n }\n}\n","import { Element, Component, Event, h, Prop, Watch, Host, State, Method, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-radio',\n styleUrl: 'radio.scss',\n scoped: true,\n})\nexport class RadioComponent {\n private inputId = `admiralty-radio-${radioButtonIds++}`;\n private nativeInput!: HTMLInputElement;\n private radioGroup: HTMLAdmiraltyRadioGroupElement | null = null;\n\n @Element() el!: HTMLElement;\n\n /**\n * The tabindex of the radio button.\n * @internal\n */\n @State() buttonTabindex = -1;\n\n /**\n * The name of the radio button for use on selection within a radio group\n */\n @Prop() name: string = this.inputId;\n /**\n * The value of the radio button for use on selection within a radio group\n */\n @Prop({ mutable: true }) value: string | null;\n /**\n * Determines whether the radio button is disabled. A button in disabled state will not fire click output events.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * Determines whether the radio button is selected (or checked)\n */\n @Prop({ mutable: true }) checked?: boolean = false;\n\n /**\n * Emitted when the radio button gains focus.\n */\n @Event() admiraltyFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the radio button loses focus.\n */\n @Event() admiraltyBlur!: EventEmitter<void>;\n\n connectedCallback() {\n if (this.value === undefined) {\n this.value = this.inputId;\n }\n const radioGroup = (this.radioGroup = this.el.closest('admiralty-radio-group'));\n\n if (radioGroup) {\n this.updateState();\n }\n }\n\n /** @internal */\n @Method()\n async setButtonTabindex(value: number) {\n this.buttonTabindex = value;\n }\n\n private updateState = () => {\n if (this.radioGroup) {\n this.checked = this.radioGroup.value === this.value;\n }\n };\n\n private onClick = () => {\n this.checked = this.nativeInput.checked;\n };\n\n private onFocus = () => {\n this.admiraltyFocus.emit();\n };\n\n private onBlur = () => {\n this.admiraltyBlur.emit();\n };\n\n @Watch('checked')\n @Watch('disabled')\n render() {\n const { buttonTabindex, checked, disabled, inputId, name, value } = this;\n\n return (\n <Host>\n <div class=\"admiralty-radio\">\n <input\n aria-checked={`${checked}`}\n aria-hidden={disabled ? 'true' : null}\n aria-labelledby={inputId}\n id={inputId}\n name={name}\n tabindex={buttonTabindex}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.onClick}\n class=\"admiralty-radio\"\n type=\"radio\"\n value={value}\n checked={checked}\n disabled={disabled ? true : null}\n ref={nativeEl => (this.nativeInput = nativeEl as HTMLInputElement)}\n />\n <label htmlFor={inputId}>\n <slot />\n </label>\n </div>\n </Host>\n );\n }\n}\n\nlet radioButtonIds = 0;\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AdmiraltySelect extends Components.AdmiraltySelect, HTMLElement {}
4
+ export const AdmiraltySelect: {
5
+ prototype: AdmiraltySelect;
6
+ new (): AdmiraltySelect;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,106 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$5 } from './hint.js';
3
+ import { d as defineCustomElement$4 } from './icon.js';
4
+ import { d as defineCustomElement$3 } from './input-error.js';
5
+ import { d as defineCustomElement$2 } from './label.js';
6
+
7
+ const selectCss = ".disabled{color:#adadad}.select-wrapper{position:relative}admiralty-icon{font-size:24px;font-weight:normal;pointer-events:none;position:absolute;right:12px;top:12px}select{appearance:none;background-color:#ffffff;border:2px solid #333333;box-sizing:border-box;color:#333333;font-family:\"JohnstonITC\", Helvetica, sans-serif;font-size:18px;line-height:24px;margin-bottom:6px;position:relative;font-weight:300;padding:12px;width:100%}select.error{border-color:#e20d0d}select:focus-visible{outline:3px solid #ffdd00;box-shadow:inset 0 0 0 2px #333333}select.disabled{border-color:#adadad}";
8
+
9
+ const SelectComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
+ constructor() {
11
+ super();
12
+ this.__registerHost();
13
+ this.__attachShadow();
14
+ this.admiraltyChange = createEvent(this, "admiraltyChange", 7);
15
+ this.admiraltyBlur = createEvent(this, "admiraltyBlur", 7);
16
+ this.id = `admiralty-select-${++nextId}`;
17
+ this.disabled = false;
18
+ this.error = false;
19
+ this.errorHint = null;
20
+ this.hint = null;
21
+ this.label = 'Choose a colour';
22
+ this.width = undefined;
23
+ }
24
+ componentWillRender() {
25
+ this.getOptions();
26
+ }
27
+ handleSelect(event) {
28
+ this.admiraltyChange.emit(event.target);
29
+ }
30
+ handleBlur(_event) {
31
+ this.admiraltyBlur.emit();
32
+ }
33
+ /**
34
+ * Summary. gets the options passed the user passes through the slots and
35
+ * extracs the text and value
36
+ */
37
+ getOptions() {
38
+ const slotOptions = this.el.querySelectorAll('option');
39
+ const options = [];
40
+ // grab all the data from the slot and extract the data to be inserted into the template
41
+ slotOptions.forEach(slot => {
42
+ // remove the slotted option to keep the shadowDom clean
43
+ slot.remove();
44
+ options.push({
45
+ text: slot.text,
46
+ value: slot.value,
47
+ });
48
+ });
49
+ this.options = options;
50
+ }
51
+ render() {
52
+ const { disabled, error, errorHint, hint, id, label } = this;
53
+ const disabledClass = disabled ? 'disabled' : '';
54
+ return (h(Host, null, h("div", { class: `admiralty-select ${disabledClass}` }, h("admiralty-label", { for: id }, label), h("admiralty-hint", null, hint), h("div", { class: "select-wrapper", style: this.width ? { maxWidth: `${this.width}px` } : {} }, h("select", { id: id, class: { 'admiralty-form-control': true, 'error': error, 'disabled': disabled }, "aria-disabled": disabled ? 'true' : 'false', "aria-label": label, onChange: event => this.handleSelect(event), onBlur: event => this.handleBlur(event), disabled: disabled }, this.options.map(option => (h("option", { value: option.value }, option.text)))), h("admiralty-icon", { class: `select-down-icon ${disabledClass}`, "icon-name": "angle-down" })), this.error ? h("admiralty-input-error", null, errorHint) : '')));
55
+ }
56
+ get el() { return this; }
57
+ static get style() { return selectCss; }
58
+ }, [1, "admiralty-select", {
59
+ "disabled": [4],
60
+ "error": [4],
61
+ "errorHint": [1, "error-hint"],
62
+ "hint": [1],
63
+ "label": [1],
64
+ "width": [2]
65
+ }]);
66
+ let nextId = 0;
67
+ function defineCustomElement$1() {
68
+ if (typeof customElements === "undefined") {
69
+ return;
70
+ }
71
+ const components = ["admiralty-select", "admiralty-hint", "admiralty-icon", "admiralty-input-error", "admiralty-label"];
72
+ components.forEach(tagName => { switch (tagName) {
73
+ case "admiralty-select":
74
+ if (!customElements.get(tagName)) {
75
+ customElements.define(tagName, SelectComponent);
76
+ }
77
+ break;
78
+ case "admiralty-hint":
79
+ if (!customElements.get(tagName)) {
80
+ defineCustomElement$5();
81
+ }
82
+ break;
83
+ case "admiralty-icon":
84
+ if (!customElements.get(tagName)) {
85
+ defineCustomElement$4();
86
+ }
87
+ break;
88
+ case "admiralty-input-error":
89
+ if (!customElements.get(tagName)) {
90
+ defineCustomElement$3();
91
+ }
92
+ break;
93
+ case "admiralty-label":
94
+ if (!customElements.get(tagName)) {
95
+ defineCustomElement$2();
96
+ }
97
+ break;
98
+ } });
99
+ }
100
+
101
+ const AdmiraltySelect = SelectComponent;
102
+ const defineCustomElement = defineCustomElement$1;
103
+
104
+ export { AdmiraltySelect, defineCustomElement };
105
+
106
+ //# sourceMappingURL=admiralty-select.js.map