@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.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/admiralty/admiralty.esm.js +2 -0
- package/dist/admiralty/admiralty.esm.js.map +1 -0
- package/dist/admiralty/index.esm.js +2 -0
- package/dist/admiralty/index.esm.js.map +1 -0
- package/dist/admiralty/p-01cb7adb.entry.js +2 -0
- package/dist/admiralty/p-01cb7adb.entry.js.map +1 -0
- package/dist/admiralty/p-05415353.entry.js +2 -0
- package/dist/admiralty/p-05415353.entry.js.map +1 -0
- package/dist/admiralty/p-08baadfe.entry.js +2 -0
- package/dist/admiralty/p-08baadfe.entry.js.map +1 -0
- package/dist/admiralty/p-1156fb5a.entry.js +2 -0
- package/dist/admiralty/p-1156fb5a.entry.js.map +1 -0
- package/dist/admiralty/p-1597c067.entry.js +2 -0
- package/dist/admiralty/p-1597c067.entry.js.map +1 -0
- package/dist/admiralty/p-18cff2de.js +2 -0
- package/dist/admiralty/p-18cff2de.js.map +1 -0
- package/dist/admiralty/p-1e0fcbb0.entry.js +2 -0
- package/dist/admiralty/p-1e0fcbb0.entry.js.map +1 -0
- package/dist/admiralty/p-281fb779.entry.js +2 -0
- package/dist/admiralty/p-281fb779.entry.js.map +1 -0
- package/dist/admiralty/p-31b52c40.entry.js +2 -0
- package/dist/admiralty/p-31b52c40.entry.js.map +1 -0
- package/dist/admiralty/p-33b7244b.entry.js +2 -0
- package/dist/admiralty/p-33b7244b.entry.js.map +1 -0
- package/dist/admiralty/p-34cbc7a1.entry.js +2 -0
- package/dist/admiralty/p-34cbc7a1.entry.js.map +1 -0
- package/dist/admiralty/p-3c9dee38.entry.js +2 -0
- package/dist/admiralty/p-3c9dee38.entry.js.map +1 -0
- package/dist/admiralty/p-3dfc9fc0.entry.js +2 -0
- package/dist/admiralty/p-3dfc9fc0.entry.js.map +1 -0
- package/dist/admiralty/p-52cb5c3d.entry.js +2 -0
- package/dist/admiralty/p-52cb5c3d.entry.js.map +1 -0
- package/dist/admiralty/p-573407ef.entry.js +2 -0
- package/dist/admiralty/p-573407ef.entry.js.map +1 -0
- package/dist/admiralty/p-61a86783.entry.js +2 -0
- package/dist/admiralty/p-61a86783.entry.js.map +1 -0
- package/dist/admiralty/p-6293fffb.entry.js +2 -0
- package/dist/admiralty/p-6293fffb.entry.js.map +1 -0
- package/dist/admiralty/p-69e7a596.entry.js +2 -0
- package/dist/admiralty/p-69e7a596.entry.js.map +1 -0
- package/dist/admiralty/p-6b102dd7.entry.js +2 -0
- package/dist/admiralty/p-6b102dd7.entry.js.map +1 -0
- package/dist/admiralty/p-80c03397.entry.js +2 -0
- package/dist/admiralty/p-80c03397.entry.js.map +1 -0
- package/dist/admiralty/p-914567f9.entry.js +2 -0
- package/dist/admiralty/p-914567f9.entry.js.map +1 -0
- package/dist/admiralty/p-96a33adb.entry.js +2 -0
- package/dist/admiralty/p-96a33adb.entry.js.map +1 -0
- package/dist/admiralty/p-aa03be54.entry.js +2 -0
- package/dist/admiralty/p-aa03be54.entry.js.map +1 -0
- package/dist/admiralty/p-bbe4dd68.entry.js +2 -0
- package/dist/admiralty/p-bbe4dd68.entry.js.map +1 -0
- package/dist/admiralty/p-c63b9703.entry.js +2 -0
- package/dist/admiralty/p-c63b9703.entry.js.map +1 -0
- package/dist/admiralty/p-c7dd53e5.js +2 -0
- package/dist/admiralty/p-c7dd53e5.js.map +1 -0
- package/dist/admiralty/p-c9625a50.entry.js +2 -0
- package/dist/admiralty/p-c9625a50.entry.js.map +1 -0
- package/dist/admiralty/p-d23537cc.entry.js +2 -0
- package/dist/admiralty/p-d23537cc.entry.js.map +1 -0
- package/dist/admiralty/p-d5680d2f.entry.js +2 -0
- package/dist/admiralty/p-d5680d2f.entry.js.map +1 -0
- package/dist/admiralty/p-da4c6170.entry.js +2 -0
- package/dist/admiralty/p-da4c6170.entry.js.map +1 -0
- package/dist/admiralty/p-dae5bfda.entry.js +2 -0
- package/dist/admiralty/p-dae5bfda.entry.js.map +1 -0
- package/dist/admiralty/p-de48be42.entry.js +2 -0
- package/dist/admiralty/p-de48be42.entry.js.map +1 -0
- package/dist/admiralty/p-e1457fd2.entry.js +2 -0
- package/dist/admiralty/p-e1457fd2.entry.js.map +1 -0
- package/dist/admiralty/p-e1680782.js +3 -0
- package/dist/admiralty/p-e1680782.js.map +1 -0
- package/dist/admiralty/p-e5f9308a.entry.js +2 -0
- package/dist/admiralty/p-e5f9308a.entry.js.map +1 -0
- package/dist/admiralty/p-e7bb0eca.entry.js +2 -0
- package/dist/admiralty/p-e7bb0eca.entry.js.map +1 -0
- package/dist/admiralty/p-eba5b551.entry.js +2 -0
- package/dist/admiralty/p-eba5b551.entry.js.map +1 -0
- package/dist/admiralty/p-eefe699d.entry.js +2 -0
- package/dist/admiralty/p-eefe699d.entry.js.map +1 -0
- package/dist/admiralty/p-f049a682.entry.js +2 -0
- package/dist/admiralty/p-f049a682.entry.js.map +1 -0
- package/dist/admiralty/p-f268e1dd.entry.js +2 -0
- package/dist/admiralty/p-f268e1dd.entry.js.map +1 -0
- package/dist/admiralty/p-f9815502.entry.js +2 -0
- package/dist/admiralty/p-f9815502.entry.js.map +1 -0
- package/dist/admiralty/p-ffb0dae5.entry.js +2 -0
- package/dist/admiralty/p-ffb0dae5.entry.js.map +1 -0
- package/dist/admiralty/p-ffe3ca07.entry.js +2 -0
- package/dist/admiralty/p-ffe3ca07.entry.js.map +1 -0
- package/dist/cjs/admiralty-breadcrumb.cjs.entry.js +25 -0
- package/dist/cjs/admiralty-breadcrumb.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-breadcrumbs.cjs.entry.js +48 -0
- package/dist/cjs/admiralty-breadcrumbs.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-button.cjs.entry.js +26 -0
- package/dist/cjs/admiralty-button.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-card.cjs.entry.js +22 -0
- package/dist/cjs/admiralty-card.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-checkbox.cjs.entry.js +54 -0
- package/dist/cjs/admiralty-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-colour-block.cjs.entry.js +37 -0
- package/dist/cjs/admiralty-colour-block.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-dialogue.cjs.entry.js +39 -0
- package/dist/cjs/admiralty-dialogue.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-expansion.cjs.entry.js +42 -0
- package/dist/cjs/admiralty-expansion.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-file-input.cjs.entry.js +89 -0
- package/dist/cjs/admiralty-file-input.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-filter-group.cjs.entry.js +22 -0
- package/dist/cjs/admiralty-filter-group.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-filter.cjs.entry.js +32 -0
- package/dist/cjs/admiralty-filter.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-footer.cjs.entry.js +25 -0
- package/dist/cjs/admiralty-footer.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-header-menu-item.cjs.entry.js +63 -0
- package/dist/cjs/admiralty-header-menu-item.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-header-profile.cjs.entry.js +44 -0
- package/dist/cjs/admiralty-header-profile.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-header-sub-menu-item.cjs.entry.js +28 -0
- package/dist/cjs/admiralty-header-sub-menu-item.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-header.cjs.entry.js +32 -0
- package/dist/cjs/admiralty-header.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-hint_3.cjs.entry.js +51 -0
- package/dist/cjs/admiralty-hint_3.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-hr.cjs.entry.js +21 -0
- package/dist/cjs/admiralty-hr.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-icon.cjs.entry.js +7045 -0
- package/dist/cjs/admiralty-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-input.cjs.entry.js +62 -0
- package/dist/cjs/admiralty-input.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-link.cjs.entry.js +20 -0
- package/dist/cjs/admiralty-link.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-paginator-wrapper.cjs.entry.js +32 -0
- package/dist/cjs/admiralty-paginator-wrapper.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-paginator.cjs.entry.js +46 -0
- package/dist/cjs/admiralty-paginator.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-phase-banner.cjs.entry.js +23 -0
- package/dist/cjs/admiralty-phase-banner.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-progress-bar.cjs.entry.js +28 -0
- package/dist/cjs/admiralty-progress-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-radio-group.cjs.entry.js +71 -0
- package/dist/cjs/admiralty-radio-group.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-radio.cjs.entry.js +64 -0
- package/dist/cjs/admiralty-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-select.cjs.entry.js +61 -0
- package/dist/cjs/admiralty-select.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-side-nav-item.cjs.entry.js +39 -0
- package/dist/cjs/admiralty-side-nav-item.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-side-nav-wrapper.cjs.entry.js +27 -0
- package/dist/cjs/admiralty-side-nav-wrapper.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-side-nav.cjs.entry.js +22 -0
- package/dist/cjs/admiralty-side-nav.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-table-body.cjs.entry.js +21 -0
- package/dist/cjs/admiralty-table-body.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-table-cell.cjs.entry.js +21 -0
- package/dist/cjs/admiralty-table-cell.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-table-header-cell.cjs.entry.js +21 -0
- package/dist/cjs/admiralty-table-header-cell.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-table-header.cjs.entry.js +21 -0
- package/dist/cjs/admiralty-table-header.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-table-row.cjs.entry.js +21 -0
- package/dist/cjs/admiralty-table-row.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-table.cjs.entry.js +22 -0
- package/dist/cjs/admiralty-table.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-textarea.cjs.entry.js +38 -0
- package/dist/cjs/admiralty-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-type-ahead-item.cjs.entry.js +22 -0
- package/dist/cjs/admiralty-type-ahead-item.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty-type-ahead.cjs.entry.js +185 -0
- package/dist/cjs/admiralty-type-ahead.cjs.entry.js.map +1 -0
- package/dist/cjs/admiralty.cjs.js +28 -0
- package/dist/cjs/admiralty.cjs.js.map +1 -0
- package/dist/cjs/button.types-0549d311.js +12 -0
- package/dist/cjs/button.types-0549d311.js.map +1 -0
- package/dist/cjs/index-18b58c3d.js +9484 -0
- package/dist/cjs/index-18b58c3d.js.map +1 -0
- package/dist/cjs/index-9db1e550.js +1971 -0
- package/dist/cjs/index-9db1e550.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +24 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/assets/svg/Admiralty linear logo.svg +373 -0
- package/dist/collection/assets/svg/Admiralty stacked logo.svg +1275 -0
- package/dist/collection/assets/svg/AdmiraltyUKHO linear logo.svg +3350 -0
- package/dist/collection/assets/svg/UKHO linear logo.svg +3526 -0
- package/dist/collection/assets/svg/UKHO stacked logo.svg +2985 -0
- package/dist/collection/collection-manifest.json +53 -0
- package/dist/collection/components/breadcrumb/breadcrumb.css +89 -0
- package/dist/collection/components/breadcrumb/breadcrumb.js +84 -0
- package/dist/collection/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +25 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +48 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/collection/components/button/button.css +384 -0
- package/dist/collection/components/button/button.js +109 -0
- package/dist/collection/components/button/button.js.map +1 -0
- package/dist/collection/components/button/button.types.js +9 -0
- package/dist/collection/components/button/button.types.js.map +1 -0
- package/dist/collection/components/card/card.css +101 -0
- package/dist/collection/components/card/card.js +42 -0
- package/dist/collection/components/card/card.js.map +1 -0
- package/dist/collection/components/checkbox/checkbox.css +72 -0
- package/dist/collection/components/checkbox/checkbox.js +222 -0
- package/dist/collection/components/checkbox/checkbox.js.map +1 -0
- package/dist/collection/components/colour-block/colour-block.css +53 -0
- package/dist/collection/components/colour-block/colour-block.js +141 -0
- package/dist/collection/components/colour-block/colour-block.js.map +1 -0
- package/dist/collection/components/dialogue/dialogue.css +105 -0
- package/dist/collection/components/dialogue/dialogue.js +78 -0
- package/dist/collection/components/dialogue/dialogue.js.map +1 -0
- package/dist/collection/components/expansion/expansion.css +75 -0
- package/dist/collection/components/expansion/expansion.js +133 -0
- package/dist/collection/components/expansion/expansion.js.map +1 -0
- package/dist/collection/components/file-input/file-input.css +78 -0
- package/dist/collection/components/file-input/file-input.js +155 -0
- package/dist/collection/components/file-input/file-input.js.map +1 -0
- package/dist/collection/components/filter/filter.css +277 -0
- package/dist/collection/components/filter/filter.js +88 -0
- package/dist/collection/components/filter/filter.js.map +1 -0
- package/dist/collection/components/filter-group/filter-group.css +0 -0
- package/dist/collection/components/filter-group/filter-group.js +46 -0
- package/dist/collection/components/filter-group/filter-group.js.map +1 -0
- package/dist/collection/components/footer/footer.css +61 -0
- package/dist/collection/components/footer/footer.js +104 -0
- package/dist/collection/components/footer/footer.js.map +1 -0
- package/dist/collection/components/header/header.css +113 -0
- package/dist/collection/components/header/header.js +145 -0
- package/dist/collection/components/header/header.js.map +1 -0
- package/dist/collection/components/header/header.stories.data.js +146 -0
- package/dist/collection/components/header/header.stories.data.js.map +1 -0
- package/dist/collection/components/header/header.types.js +2 -0
- package/dist/collection/components/header/header.types.js.map +1 -0
- package/dist/collection/components/header-menu-item/header-menu-item.css +53 -0
- package/dist/collection/components/header-menu-item/header-menu-item.js +122 -0
- package/dist/collection/components/header-menu-item/header-menu-item.js.map +1 -0
- package/dist/collection/components/header-profile/header-profile.css +81 -0
- package/dist/collection/components/header-profile/header-profile.js +148 -0
- package/dist/collection/components/header-profile/header-profile.js.map +1 -0
- package/dist/collection/components/header-sub-menu-item/header-sub-menu-item.css +35 -0
- package/dist/collection/components/header-sub-menu-item/header-sub-menu-item.js +66 -0
- package/dist/collection/components/header-sub-menu-item/header-sub-menu-item.js.map +1 -0
- package/dist/collection/components/hint/hint.css +26 -0
- package/dist/collection/components/hint/hint.js +47 -0
- package/dist/collection/components/hint/hint.js.map +1 -0
- package/dist/collection/components/horizontal-rule/horizontal-rule.css +23 -0
- package/dist/collection/components/horizontal-rule/horizontal-rule.js +18 -0
- package/dist/collection/components/horizontal-rule/horizontal-rule.js.map +1 -0
- package/dist/collection/components/icon/icon.css +15 -0
- package/dist/collection/components/icon/icon.js +79 -0
- package/dist/collection/components/icon/icon.js.map +1 -0
- package/dist/collection/components/input/input.css +58 -0
- package/dist/collection/components/input/input.interface.js +2 -0
- package/dist/collection/components/input/input.interface.js.map +1 -0
- package/dist/collection/components/input/input.js +308 -0
- package/dist/collection/components/input/input.js.map +1 -0
- package/dist/collection/components/input-error/input-error.css +30 -0
- package/dist/collection/components/input-error/input-error.js +24 -0
- package/dist/collection/components/input-error/input-error.js.map +1 -0
- package/dist/collection/components/label/label.css +25 -0
- package/dist/collection/components/label/label.js +65 -0
- package/dist/collection/components/label/label.js.map +1 -0
- package/dist/collection/components/link/link.js +51 -0
- package/dist/collection/components/link/link.js.map +1 -0
- package/dist/collection/components/paginator/paginator.css +29 -0
- package/dist/collection/components/paginator/paginator.js +120 -0
- package/dist/collection/components/paginator/paginator.js.map +1 -0
- package/dist/collection/components/paginator/paginator.stories.data.js +36 -0
- package/dist/collection/components/paginator/paginator.stories.data.js.map +1 -0
- package/dist/collection/components/phase-banner/phase-banner.css +84 -0
- package/dist/collection/components/phase-banner/phase-banner.js +61 -0
- package/dist/collection/components/phase-banner/phase-banner.js.map +1 -0
- package/dist/collection/components/progress-bar/progress-bar.css +35 -0
- package/dist/collection/components/progress-bar/progress-bar.js +90 -0
- package/dist/collection/components/progress-bar/progress-bar.js.map +1 -0
- package/dist/collection/components/radio/radio.css +49 -0
- package/dist/collection/components/radio/radio.js +206 -0
- package/dist/collection/components/radio/radio.js.map +1 -0
- package/dist/collection/components/radio-group/radio-group.css +14 -0
- package/dist/collection/components/radio-group/radio-group.js +148 -0
- package/dist/collection/components/radio-group/radio-group.js.map +1 -0
- package/dist/collection/components/select/select.css +59 -0
- package/dist/collection/components/select/select.js +207 -0
- package/dist/collection/components/select/select.js.map +1 -0
- package/dist/collection/components/select/select.types.js +3 -0
- package/dist/collection/components/select/select.types.js.map +1 -0
- package/dist/collection/components/side-nav/side-nav.css +68 -0
- package/dist/collection/components/side-nav/side-nav.js +43 -0
- package/dist/collection/components/side-nav/side-nav.js.map +1 -0
- package/dist/collection/components/side-nav/side-nav.stories.data.js +31 -0
- package/dist/collection/components/side-nav/side-nav.stories.data.js.map +1 -0
- package/dist/collection/components/side-nav-item/side-nav-item.css +90 -0
- package/dist/collection/components/side-nav-item/side-nav-item.js +112 -0
- package/dist/collection/components/side-nav-item/side-nav-item.js.map +1 -0
- package/dist/collection/components/table/table.css +29 -0
- package/dist/collection/components/table/table.js +47 -0
- package/dist/collection/components/table/table.js.map +1 -0
- package/dist/collection/components/table-body/table-body.css +28 -0
- package/dist/collection/components/table-body/table-body.js +23 -0
- package/dist/collection/components/table-body/table-body.js.map +1 -0
- package/dist/collection/components/table-cell/table-cell.css +28 -0
- package/dist/collection/components/table-cell/table-cell.js +23 -0
- package/dist/collection/components/table-cell/table-cell.js.map +1 -0
- package/dist/collection/components/table-header/table-header.css +20 -0
- package/dist/collection/components/table-header/table-header.js +23 -0
- package/dist/collection/components/table-header/table-header.js.map +1 -0
- package/dist/collection/components/table-header-cell/table-header-cell.css +27 -0
- package/dist/collection/components/table-header-cell/table-header-cell.js +23 -0
- package/dist/collection/components/table-header-cell/table-header-cell.js.map +1 -0
- package/dist/collection/components/table-row/table-row.css +20 -0
- package/dist/collection/components/table-row/table-row.js +23 -0
- package/dist/collection/components/table-row/table-row.js.map +1 -0
- package/dist/collection/components/textarea/textarea.css +269 -0
- package/dist/collection/components/textarea/textarea.js +202 -0
- package/dist/collection/components/textarea/textarea.js.map +1 -0
- package/dist/collection/components/type-ahead/type-ahead.css +73 -0
- package/dist/collection/components/type-ahead/type-ahead.js +294 -0
- package/dist/collection/components/type-ahead/type-ahead.js.map +1 -0
- package/dist/collection/components/type-ahead-item/type-ahead-item.css +3 -0
- package/dist/collection/components/type-ahead-item/type-ahead-item.js +43 -0
- package/dist/collection/components/type-ahead-item/type-ahead-item.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/components/admiralty-breadcrumb.d.ts +11 -0
- package/dist/components/admiralty-breadcrumb.js +48 -0
- package/dist/components/admiralty-breadcrumb.js.map +1 -0
- package/dist/components/admiralty-breadcrumbs.d.ts +11 -0
- package/dist/components/admiralty-breadcrumbs.js +62 -0
- package/dist/components/admiralty-breadcrumbs.js.map +1 -0
- package/dist/components/admiralty-button.d.ts +11 -0
- package/dist/components/admiralty-button.js +8 -0
- package/dist/components/admiralty-button.js.map +1 -0
- package/dist/components/admiralty-card.d.ts +11 -0
- package/dist/components/admiralty-card.js +37 -0
- package/dist/components/admiralty-card.js.map +1 -0
- package/dist/components/admiralty-checkbox.d.ts +11 -0
- package/dist/components/admiralty-checkbox.js +75 -0
- package/dist/components/admiralty-checkbox.js.map +1 -0
- package/dist/components/admiralty-colour-block.d.ts +11 -0
- package/dist/components/admiralty-colour-block.js +68 -0
- package/dist/components/admiralty-colour-block.js.map +1 -0
- package/dist/components/admiralty-dialogue.d.ts +11 -0
- package/dist/components/admiralty-dialogue.js +61 -0
- package/dist/components/admiralty-dialogue.js.map +1 -0
- package/dist/components/admiralty-expansion.d.ts +11 -0
- package/dist/components/admiralty-expansion.js +8 -0
- package/dist/components/admiralty-expansion.js.map +1 -0
- package/dist/components/admiralty-file-input.d.ts +11 -0
- package/dist/components/admiralty-file-input.js +113 -0
- package/dist/components/admiralty-file-input.js.map +1 -0
- package/dist/components/admiralty-filter-group.d.ts +11 -0
- package/dist/components/admiralty-filter-group.js +49 -0
- package/dist/components/admiralty-filter-group.js.map +1 -0
- package/dist/components/admiralty-filter.d.ts +11 -0
- package/dist/components/admiralty-filter.js +59 -0
- package/dist/components/admiralty-filter.js.map +1 -0
- package/dist/components/admiralty-footer.d.ts +11 -0
- package/dist/components/admiralty-footer.js +43 -0
- package/dist/components/admiralty-footer.js.map +1 -0
- package/dist/components/admiralty-header-menu-item.d.ts +11 -0
- package/dist/components/admiralty-header-menu-item.js +80 -0
- package/dist/components/admiralty-header-menu-item.js.map +1 -0
- package/dist/components/admiralty-header-profile.d.ts +11 -0
- package/dist/components/admiralty-header-profile.js +62 -0
- package/dist/components/admiralty-header-profile.js.map +1 -0
- package/dist/components/admiralty-header-sub-menu-item.d.ts +11 -0
- package/dist/components/admiralty-header-sub-menu-item.js +44 -0
- package/dist/components/admiralty-header-sub-menu-item.js.map +1 -0
- package/dist/components/admiralty-header.d.ts +11 -0
- package/dist/components/admiralty-header.js +51 -0
- package/dist/components/admiralty-header.js.map +1 -0
- package/dist/components/admiralty-hint.d.ts +11 -0
- package/dist/components/admiralty-hint.js +8 -0
- package/dist/components/admiralty-hint.js.map +1 -0
- package/dist/components/admiralty-hr.d.ts +11 -0
- package/dist/components/admiralty-hr.js +34 -0
- package/dist/components/admiralty-hr.js.map +1 -0
- package/dist/components/admiralty-icon.d.ts +11 -0
- package/dist/components/admiralty-icon.js +8 -0
- package/dist/components/admiralty-icon.js.map +1 -0
- package/dist/components/admiralty-input-error.d.ts +11 -0
- package/dist/components/admiralty-input-error.js +8 -0
- package/dist/components/admiralty-input-error.js.map +1 -0
- package/dist/components/admiralty-input.d.ts +11 -0
- package/dist/components/admiralty-input.js +8 -0
- package/dist/components/admiralty-input.js.map +1 -0
- package/dist/components/admiralty-label.d.ts +11 -0
- package/dist/components/admiralty-label.js +8 -0
- package/dist/components/admiralty-label.js.map +1 -0
- package/dist/components/admiralty-link.d.ts +11 -0
- package/dist/components/admiralty-link.js +36 -0
- package/dist/components/admiralty-link.js.map +1 -0
- package/dist/components/admiralty-paginator-wrapper.d.ts +11 -0
- package/dist/components/admiralty-paginator-wrapper.js +45 -0
- package/dist/components/admiralty-paginator-wrapper.js.map +1 -0
- package/dist/components/admiralty-paginator.d.ts +11 -0
- package/dist/components/admiralty-paginator.js +73 -0
- package/dist/components/admiralty-paginator.js.map +1 -0
- package/dist/components/admiralty-phase-banner.d.ts +11 -0
- package/dist/components/admiralty-phase-banner.js +39 -0
- package/dist/components/admiralty-phase-banner.js.map +1 -0
- package/dist/components/admiralty-progress-bar.d.ts +11 -0
- package/dist/components/admiralty-progress-bar.js +52 -0
- package/dist/components/admiralty-progress-bar.js.map +1 -0
- package/dist/components/admiralty-radio-group.d.ts +11 -0
- package/dist/components/admiralty-radio-group.js +88 -0
- package/dist/components/admiralty-radio-group.js.map +1 -0
- package/dist/components/admiralty-radio.d.ts +11 -0
- package/dist/components/admiralty-radio.js +84 -0
- package/dist/components/admiralty-radio.js.map +1 -0
- package/dist/components/admiralty-select.d.ts +11 -0
- package/dist/components/admiralty-select.js +106 -0
- package/dist/components/admiralty-select.js.map +1 -0
- package/dist/components/admiralty-side-nav-item.d.ts +11 -0
- package/dist/components/admiralty-side-nav-item.js +56 -0
- package/dist/components/admiralty-side-nav-item.js.map +1 -0
- package/dist/components/admiralty-side-nav-wrapper.d.ts +11 -0
- package/dist/components/admiralty-side-nav-wrapper.js +40 -0
- package/dist/components/admiralty-side-nav-wrapper.js.map +1 -0
- package/dist/components/admiralty-side-nav.d.ts +11 -0
- package/dist/components/admiralty-side-nav.js +37 -0
- package/dist/components/admiralty-side-nav.js.map +1 -0
- package/dist/components/admiralty-table-body.d.ts +11 -0
- package/dist/components/admiralty-table-body.js +34 -0
- package/dist/components/admiralty-table-body.js.map +1 -0
- package/dist/components/admiralty-table-cell.d.ts +11 -0
- package/dist/components/admiralty-table-cell.js +34 -0
- package/dist/components/admiralty-table-cell.js.map +1 -0
- package/dist/components/admiralty-table-header-cell.d.ts +11 -0
- package/dist/components/admiralty-table-header-cell.js +34 -0
- package/dist/components/admiralty-table-header-cell.js.map +1 -0
- package/dist/components/admiralty-table-header.d.ts +11 -0
- package/dist/components/admiralty-table-header.js +34 -0
- package/dist/components/admiralty-table-header.js.map +1 -0
- package/dist/components/admiralty-table-row.d.ts +11 -0
- package/dist/components/admiralty-table-row.js +34 -0
- package/dist/components/admiralty-table-row.js.map +1 -0
- package/dist/components/admiralty-table.d.ts +11 -0
- package/dist/components/admiralty-table.js +37 -0
- package/dist/components/admiralty-table.js.map +1 -0
- package/dist/components/admiralty-textarea.d.ts +11 -0
- package/dist/components/admiralty-textarea.js +84 -0
- package/dist/components/admiralty-textarea.js.map +1 -0
- package/dist/components/admiralty-type-ahead-item.d.ts +11 -0
- package/dist/components/admiralty-type-ahead-item.js +37 -0
- package/dist/components/admiralty-type-ahead-item.js.map +1 -0
- package/dist/components/admiralty-type-ahead.d.ts +11 -0
- package/dist/components/admiralty-type-ahead.js +235 -0
- package/dist/components/admiralty-type-ahead.js.map +1 -0
- package/dist/components/button.js +55 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/expansion.js +62 -0
- package/dist/components/expansion.js.map +1 -0
- package/dist/components/hint.js +35 -0
- package/dist/components/hint.js.map +1 -0
- package/dist/components/icon.js +16529 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/input-error.js +38 -0
- package/dist/components/input-error.js.map +1 -0
- package/dist/components/input.js +109 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.js +37 -0
- package/dist/components/label.js.map +1 -0
- package/dist/esm/admiralty-breadcrumb.entry.js +21 -0
- package/dist/esm/admiralty-breadcrumb.entry.js.map +1 -0
- package/dist/esm/admiralty-breadcrumbs.entry.js +44 -0
- package/dist/esm/admiralty-breadcrumbs.entry.js.map +1 -0
- package/dist/esm/admiralty-button.entry.js +22 -0
- package/dist/esm/admiralty-button.entry.js.map +1 -0
- package/dist/esm/admiralty-card.entry.js +18 -0
- package/dist/esm/admiralty-card.entry.js.map +1 -0
- package/dist/esm/admiralty-checkbox.entry.js +50 -0
- package/dist/esm/admiralty-checkbox.entry.js.map +1 -0
- package/dist/esm/admiralty-colour-block.entry.js +33 -0
- package/dist/esm/admiralty-colour-block.entry.js.map +1 -0
- package/dist/esm/admiralty-dialogue.entry.js +35 -0
- package/dist/esm/admiralty-dialogue.entry.js.map +1 -0
- package/dist/esm/admiralty-expansion.entry.js +38 -0
- package/dist/esm/admiralty-expansion.entry.js.map +1 -0
- package/dist/esm/admiralty-file-input.entry.js +85 -0
- package/dist/esm/admiralty-file-input.entry.js.map +1 -0
- package/dist/esm/admiralty-filter-group.entry.js +18 -0
- package/dist/esm/admiralty-filter-group.entry.js.map +1 -0
- package/dist/esm/admiralty-filter.entry.js +28 -0
- package/dist/esm/admiralty-filter.entry.js.map +1 -0
- package/dist/esm/admiralty-footer.entry.js +21 -0
- package/dist/esm/admiralty-footer.entry.js.map +1 -0
- package/dist/esm/admiralty-header-menu-item.entry.js +59 -0
- package/dist/esm/admiralty-header-menu-item.entry.js.map +1 -0
- package/dist/esm/admiralty-header-profile.entry.js +40 -0
- package/dist/esm/admiralty-header-profile.entry.js.map +1 -0
- package/dist/esm/admiralty-header-sub-menu-item.entry.js +24 -0
- package/dist/esm/admiralty-header-sub-menu-item.entry.js.map +1 -0
- package/dist/esm/admiralty-header.entry.js +28 -0
- package/dist/esm/admiralty-header.entry.js.map +1 -0
- package/dist/esm/admiralty-hint_3.entry.js +45 -0
- package/dist/esm/admiralty-hint_3.entry.js.map +1 -0
- package/dist/esm/admiralty-hr.entry.js +17 -0
- package/dist/esm/admiralty-hr.entry.js.map +1 -0
- package/dist/esm/admiralty-icon.entry.js +7041 -0
- package/dist/esm/admiralty-icon.entry.js.map +1 -0
- package/dist/esm/admiralty-input.entry.js +58 -0
- package/dist/esm/admiralty-input.entry.js.map +1 -0
- package/dist/esm/admiralty-link.entry.js +16 -0
- package/dist/esm/admiralty-link.entry.js.map +1 -0
- package/dist/esm/admiralty-paginator-wrapper.entry.js +28 -0
- package/dist/esm/admiralty-paginator-wrapper.entry.js.map +1 -0
- package/dist/esm/admiralty-paginator.entry.js +42 -0
- package/dist/esm/admiralty-paginator.entry.js.map +1 -0
- package/dist/esm/admiralty-phase-banner.entry.js +19 -0
- package/dist/esm/admiralty-phase-banner.entry.js.map +1 -0
- package/dist/esm/admiralty-progress-bar.entry.js +24 -0
- package/dist/esm/admiralty-progress-bar.entry.js.map +1 -0
- package/dist/esm/admiralty-radio-group.entry.js +67 -0
- package/dist/esm/admiralty-radio-group.entry.js.map +1 -0
- package/dist/esm/admiralty-radio.entry.js +60 -0
- package/dist/esm/admiralty-radio.entry.js.map +1 -0
- package/dist/esm/admiralty-select.entry.js +57 -0
- package/dist/esm/admiralty-select.entry.js.map +1 -0
- package/dist/esm/admiralty-side-nav-item.entry.js +35 -0
- package/dist/esm/admiralty-side-nav-item.entry.js.map +1 -0
- package/dist/esm/admiralty-side-nav-wrapper.entry.js +23 -0
- package/dist/esm/admiralty-side-nav-wrapper.entry.js.map +1 -0
- package/dist/esm/admiralty-side-nav.entry.js +18 -0
- package/dist/esm/admiralty-side-nav.entry.js.map +1 -0
- package/dist/esm/admiralty-table-body.entry.js +17 -0
- package/dist/esm/admiralty-table-body.entry.js.map +1 -0
- package/dist/esm/admiralty-table-cell.entry.js +17 -0
- package/dist/esm/admiralty-table-cell.entry.js.map +1 -0
- package/dist/esm/admiralty-table-header-cell.entry.js +17 -0
- package/dist/esm/admiralty-table-header-cell.entry.js.map +1 -0
- package/dist/esm/admiralty-table-header.entry.js +17 -0
- package/dist/esm/admiralty-table-header.entry.js.map +1 -0
- package/dist/esm/admiralty-table-row.entry.js +17 -0
- package/dist/esm/admiralty-table-row.entry.js.map +1 -0
- package/dist/esm/admiralty-table.entry.js +18 -0
- package/dist/esm/admiralty-table.entry.js.map +1 -0
- package/dist/esm/admiralty-textarea.entry.js +34 -0
- package/dist/esm/admiralty-textarea.entry.js.map +1 -0
- package/dist/esm/admiralty-type-ahead-item.entry.js +18 -0
- package/dist/esm/admiralty-type-ahead-item.entry.js.map +1 -0
- package/dist/esm/admiralty-type-ahead.entry.js +181 -0
- package/dist/esm/admiralty-type-ahead.entry.js.map +1 -0
- package/dist/esm/admiralty.js +23 -0
- package/dist/esm/admiralty.js.map +1 -0
- package/dist/esm/button.types-2655b2cf.js +12 -0
- package/dist/esm/button.types-2655b2cf.js.map +1 -0
- package/dist/esm/index-a64d8966.js +1942 -0
- package/dist/esm/index-a64d8966.js.map +1 -0
- package/dist/esm/index-e73d97b7.js +9474 -0
- package/dist/esm/index-e73d97b7.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +20 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +18 -0
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +8 -0
- package/dist/types/components/button/button.d.ts +23 -0
- package/dist/types/components/button/button.types.d.ts +7 -0
- package/dist/types/components/card/card.d.ts +7 -0
- package/dist/types/components/checkbox/checkbox.d.ts +52 -0
- package/dist/types/components/colour-block/colour-block.d.ts +27 -0
- package/dist/types/components/dialogue/dialogue.d.ts +13 -0
- package/dist/types/components/expansion/expansion.d.ts +30 -0
- package/dist/types/components/file-input/file-input.d.ts +53 -0
- package/dist/types/components/filter/filter.d.ts +21 -0
- package/dist/types/components/filter-group/filter-group.d.ts +10 -0
- package/dist/types/components/footer/footer.d.ts +25 -0
- package/dist/types/components/header/header.d.ts +33 -0
- package/dist/types/components/header/header.stories.data.d.ts +6 -0
- package/dist/types/components/header/header.types.d.ts +10 -0
- package/dist/types/components/header-menu-item/header-menu-item.d.ts +34 -0
- package/dist/types/components/header-profile/header-profile.d.ts +38 -0
- package/dist/types/components/header-sub-menu-item/header-sub-menu-item.d.ts +13 -0
- package/dist/types/components/hint/hint.d.ts +11 -0
- package/dist/types/components/horizontal-rule/horizontal-rule.d.ts +3 -0
- package/dist/types/components/icon/icon.d.ts +17 -0
- package/dist/types/components/input/input.d.ts +71 -0
- package/dist/types/components/input/input.interface.d.ts +3 -0
- package/dist/types/components/input-error/input-error.d.ts +7 -0
- package/dist/types/components/label/label.d.ts +15 -0
- package/dist/types/components/link/link.d.ts +11 -0
- package/dist/types/components/paginator/paginator.d.ts +26 -0
- package/dist/types/components/paginator/paginator.stories.data.d.ts +10 -0
- package/dist/types/components/phase-banner/phase-banner.d.ts +11 -0
- package/dist/types/components/progress-bar/progress-bar.d.ts +19 -0
- package/dist/types/components/radio/radio.d.ts +44 -0
- package/dist/types/components/radio-group/radio-group.d.ts +27 -0
- package/dist/types/components/select/select.d.ts +48 -0
- package/dist/types/components/select/select.types.d.ts +4 -0
- package/dist/types/components/side-nav/side-nav.d.ts +8 -0
- package/dist/types/components/side-nav/side-nav.stories.data.d.ts +10 -0
- package/dist/types/components/side-nav-item/side-nav-item.d.ts +26 -0
- package/dist/types/components/table/table.d.ts +8 -0
- package/dist/types/components/table-body/table-body.d.ts +7 -0
- package/dist/types/components/table-cell/table-cell.d.ts +7 -0
- package/dist/types/components/table-header/table-header.d.ts +7 -0
- package/dist/types/components/table-header-cell/table-header-cell.d.ts +7 -0
- package/dist/types/components/table-row/table-row.d.ts +7 -0
- package/dist/types/components/textarea/textarea.d.ts +45 -0
- package/dist/types/components/type-ahead/type-ahead.d.ts +66 -0
- package/dist/types/components/type-ahead-item/type-ahead-item.d.ts +4 -0
- package/dist/types/components.d.ts +1637 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/stencil-public-runtime.d.ts +1637 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +69 -0
- package/styles/core.css +1 -0
- package/styles/core.css.map +1 -0
- package/styles/webfonts/JohnstonITC/bold/JohnstonITCStd-Bold.woff +0 -0
- package/styles/webfonts/JohnstonITC/bold/JohnstonITCStd-Bold.woff2 +0 -0
- package/styles/webfonts/JohnstonITC/italic/JohnstonITCStd-MediumIta.woff +0 -0
- package/styles/webfonts/JohnstonITC/italic/JohnstonITCStd-MediumIta.woff2 +0 -0
- package/styles/webfonts/JohnstonITC/light/JohnstonITCStd-Light.woff +0 -0
- package/styles/webfonts/JohnstonITC/light/JohnstonITCStd-Light.woff2 +0 -0
- package/styles/webfonts/JohnstonITC/light-italic/JohnstonITCStd-LightIta.woff +0 -0
- package/styles/webfonts/JohnstonITC/light-italic/JohnstonITCStd-LightIta.woff2 +0 -0
- package/styles/webfonts/JohnstonITC/medium/JohnstonITCStd-Medium.woff +0 -0
- package/styles/webfonts/JohnstonITC/medium/JohnstonITCStd-Medium.woff2 +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"admiralty-textarea.js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;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/textarea/textarea.scss?tag=admiralty-textarea&encapsulation=shadow","./src/components/textarea/textarea.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\r\n@use \"../../scss/base/responsive\";\r\n@use \"../../scss/base/typography\";\r\n@use \"../../scss/vars/typography\" as typography-vars;\r\n\r\n\r\n.text-area-container {\r\n textarea {\r\n display: block;\r\n position: relative;\r\n width: 100%;\r\n min-height: 170px;\r\n border: 2px solid colours.$colour-text;\r\n color: colours.$colour-text;\r\n padding: 12px 18px;\r\n outline: none;\r\n resize: vertical;\r\n overflow: auto;\r\n box-sizing: border-box;\r\n vertical-align: top;\r\n\r\n background-color: colours.$colour-white;\r\n\r\n &:focus-visible {\r\n outline: 3px solid colours.$colour-utility-focus;\r\n box-shadow: colours.$colour-text inset 0 0 0 2px;\r\n }\r\n\r\n &.invalid {\r\n border-color: colours.$colour-utility-error;\r\n\r\n &:focus-visible {\r\n border-color: unset;\r\n outline: 3px solid colours.$colour-utility-focus;\r\n }\r\n }\r\n\r\n &.disabled {\r\n color: colours.$colour-textinput-text-disabled;\r\n border-color: colours.$colour-textinput-border-disabled;\r\n background: colours.$colour-white;\r\n }\r\n }\r\n}\r\n","import { Component, Host, h, Prop, Event, EventEmitter } from '@stencil/core';\n\nlet textareaIds = 0;\n\n@Component({\n tag: 'admiralty-textarea',\n styleUrl: 'textarea.scss',\n shadow: true,\n})\nexport class TextareaComponent {\n private inputId = `admiralty-textarea-${textareaIds++}`;\n\n /**\n * The label which will be used as a placeholder in the unfilled state, and as a field label in the filled state.\n */\n @Prop() label: string = '';\n\n /**\n * The contents of the textarea\n */\n @Prop() text: string = '';\n\n /**\n * The hint which will be used under the label to describe the input.\n */\n @Prop() hint: string;\n\n /**\n * The maximum width for the input field.\n */\n @Prop() width?: number;\n\n /**\n * This dictates whether the form field is disabled.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Whether to show the input in an invalid state\n */\n @Prop() invalid: boolean = false;\n\n /**\n * The message to show when the input is invalid\n */\n @Prop() invalidMessage: string;\n\n /**\n * Event is fired when the form control loses focus\n * @event textareaBlur\n */\n @Event({ eventName: 'textareaBlur' }) textareaBlur: EventEmitter<any>;\n\n /**\n * Event is fired when the form control changes\n * @event textareaChanged\n */\n @Event({ eventName: 'textareaChanged' }) textareaChanged: EventEmitter<string>;\n\n private onBlur = () => {\n this.textareaBlur.emit();\n };\n\n private onChange = (_ev: any) => {\n this.textareaChanged.emit(this.text);\n };\n render() {\n return (\n <Host>\n <div class=\"text-area-container\">\n {this.label ? (\n <admiralty-label for={this.inputId} disabled={this.disabled}>\n {this.label}\n </admiralty-label>\n ) : null}\n {this.hint ? <admiralty-hint disabled={this.disabled}>{this.hint}</admiralty-hint> : null}\n <textarea\n class={{ disabled: this.disabled, invalid: this.invalid }}\n style={this.width ? { maxWidth: `${this.width}px` } : {}}\n id={this.inputId}\n onChange={this.onChange}\n onBlur={this.onBlur}\n >\n {this.text}\n </textarea>\n {this.invalid ? <admiralty-input-error>{this.invalidMessage}</admiralty-input-error> : null}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface AdmiraltyTypeAheadItem extends Components.AdmiraltyTypeAheadItem, HTMLElement {}
|
|
4
|
+
export const AdmiraltyTypeAheadItem: {
|
|
5
|
+
prototype: AdmiraltyTypeAheadItem;
|
|
6
|
+
new (): AdmiraltyTypeAheadItem;
|
|
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, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const typeAheadItemCss = ".sc-admiralty-type-ahead-item-h{display:block}";
|
|
4
|
+
|
|
5
|
+
const AdmiraltyTypeAheadItem$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.value = undefined;
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return h(Host, null);
|
|
13
|
+
}
|
|
14
|
+
static get style() { return typeAheadItemCss; }
|
|
15
|
+
}, [2, "admiralty-type-ahead-item", {
|
|
16
|
+
"value": [1]
|
|
17
|
+
}]);
|
|
18
|
+
function defineCustomElement$1() {
|
|
19
|
+
if (typeof customElements === "undefined") {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const components = ["admiralty-type-ahead-item"];
|
|
23
|
+
components.forEach(tagName => { switch (tagName) {
|
|
24
|
+
case "admiralty-type-ahead-item":
|
|
25
|
+
if (!customElements.get(tagName)) {
|
|
26
|
+
customElements.define(tagName, AdmiraltyTypeAheadItem$1);
|
|
27
|
+
}
|
|
28
|
+
break;
|
|
29
|
+
} });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const AdmiraltyTypeAheadItem = AdmiraltyTypeAheadItem$1;
|
|
33
|
+
const defineCustomElement = defineCustomElement$1;
|
|
34
|
+
|
|
35
|
+
export { AdmiraltyTypeAheadItem, defineCustomElement };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=admiralty-type-ahead-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"admiralty-type-ahead-item.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,gDAAgD;;MCO5DA,wBAAsB;;;;;;EAGjC,MAAM;IACJ,OAAO,EAAC,IAAI,OAAQ,CAAC;GACtB;;;;;;;;;;;;;;;;;;;;;;;;","names":["AdmiraltyTypeAheadItem"],"sources":["./src/components/type-ahead-item/type-ahead-item.scss?tag=admiralty-type-ahead-item&encapsulation=scoped","./src/components/type-ahead-item/type-ahead-item.tsx"],"sourcesContent":[":host {\r\n display: block;\r\n}\r\n","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"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface AdmiraltyTypeAhead extends Components.AdmiraltyTypeAhead, HTMLElement {}
|
|
4
|
+
export const AdmiraltyTypeAhead: {
|
|
5
|
+
prototype: AdmiraltyTypeAhead;
|
|
6
|
+
new (): AdmiraltyTypeAhead;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$6 } from './hint.js';
|
|
3
|
+
import { d as defineCustomElement$5 } from './icon.js';
|
|
4
|
+
import { d as defineCustomElement$4 } from './input.js';
|
|
5
|
+
import { d as defineCustomElement$3 } from './input-error.js';
|
|
6
|
+
import { d as defineCustomElement$2 } from './label.js';
|
|
7
|
+
|
|
8
|
+
const typeAheadCss = ".visually-hidden{position:absolute !important;width:1px !important;height:1px !important;margin:0 !important;padding:0 !important;overflow:hidden !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;border:0 !important;white-space:nowrap !important}*{margin:0px;padding:0px}.text-input-wrap{height:auto !important}.filterTextInput{width:100%}.typeahead-list-container{left:0px;background-color:#ffffff;width:100%;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);border:2px solid #333333;border-top:none;box-sizing:border-box;max-height:205px;overflow-y:auto;z-index:1}.typeahead-list-container .typeahead-list{list-style:none}.typeahead-list-container .typeahead-list li{cursor:pointer;transform:unset !important;padding:6px;min-height:24px}.typeahead-list-container .typeahead-list li:before{content:none}.typeahead-list-container .typeahead-list li.highlighted{background-color:#09315b;color:#ffffff}";
|
|
9
|
+
|
|
10
|
+
const TypeAheadComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.__registerHost();
|
|
14
|
+
this.__attachShadow();
|
|
15
|
+
this.selectionChanged = createEvent(this, "selectionChanged", 7);
|
|
16
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
17
|
+
this._id = `admiralty-typeahead-${++id}`;
|
|
18
|
+
this.hintId = `${this._id}-assistive-hint`;
|
|
19
|
+
this.listId = `${this._id}-list`;
|
|
20
|
+
this.filterList = [];
|
|
21
|
+
this.selectedItemIndex = -1;
|
|
22
|
+
this.isFocused = false;
|
|
23
|
+
this.isSilenced = false;
|
|
24
|
+
this.isAlternateStatusSection = false;
|
|
25
|
+
this.originalSearch = '';
|
|
26
|
+
this.hasBeenFocusedAtLeastOnce = false;
|
|
27
|
+
this.filterResult = new Array();
|
|
28
|
+
this.value = undefined;
|
|
29
|
+
this.label = undefined;
|
|
30
|
+
this.placeholder = undefined;
|
|
31
|
+
this.resultsOnInitFocus = false;
|
|
32
|
+
}
|
|
33
|
+
get inputValue() {
|
|
34
|
+
return this.inputControl.value.toString();
|
|
35
|
+
}
|
|
36
|
+
set inputValue(value) {
|
|
37
|
+
this.inputControl.value = value;
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
const slotItems = this.el.querySelectorAll('admiralty-type-ahead-item');
|
|
41
|
+
slotItems.forEach(el => {
|
|
42
|
+
this.filterList.push(el.getAttribute('value'));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
componentDidLoad() {
|
|
46
|
+
if (this.value) {
|
|
47
|
+
this.inputValue = this.value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
handleFocusIn() {
|
|
51
|
+
if (this.resultsOnInitFocus && !this.hasBeenFocusedAtLeastOnce) {
|
|
52
|
+
this.performFilter('');
|
|
53
|
+
this.hasBeenFocusedAtLeastOnce = true;
|
|
54
|
+
}
|
|
55
|
+
this.isFocused = true;
|
|
56
|
+
this.isSilenced = false;
|
|
57
|
+
}
|
|
58
|
+
handleFocusOut() {
|
|
59
|
+
this.isFocused = false;
|
|
60
|
+
this.statusText = null;
|
|
61
|
+
this.isSilenced = true;
|
|
62
|
+
}
|
|
63
|
+
textChanged(value) {
|
|
64
|
+
this.originalSearch = value;
|
|
65
|
+
this.performFilter(value);
|
|
66
|
+
this.isSilenced = false;
|
|
67
|
+
this.valueChanged.emit(value);
|
|
68
|
+
}
|
|
69
|
+
handleKeyPressed(event) {
|
|
70
|
+
event.stopImmediatePropagation();
|
|
71
|
+
if (event.key === Keys.UP_ARROW || event.key === Keys.DOWN_ARROW) {
|
|
72
|
+
this.navigateSuggestions(event.key);
|
|
73
|
+
this.updateScroll();
|
|
74
|
+
}
|
|
75
|
+
else if (event.key !== Keys.ENTER) {
|
|
76
|
+
this.textChanged(this.inputValue);
|
|
77
|
+
this.selectCurrentItem();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
handleKeyDown(event) {
|
|
81
|
+
event.stopImmediatePropagation();
|
|
82
|
+
if (event.key === Keys.TAB || event.key === Keys.ENTER) {
|
|
83
|
+
this.selectCurrentItem();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
handleItemSelected(value) {
|
|
87
|
+
this.inputValue = value;
|
|
88
|
+
this.textChanged(value);
|
|
89
|
+
this.filterResult = new Array();
|
|
90
|
+
this.selectionChanged.emit(value);
|
|
91
|
+
}
|
|
92
|
+
performFilter(value) {
|
|
93
|
+
const filter = (filterList, text) => {
|
|
94
|
+
const filterResult = filterList.filter(value => {
|
|
95
|
+
return text === null || text.length < 1 || value.toLowerCase().indexOf(text.toLowerCase()) > -1;
|
|
96
|
+
});
|
|
97
|
+
return filterResult;
|
|
98
|
+
};
|
|
99
|
+
this.filterResult = filter(this.filterList, value);
|
|
100
|
+
this.selectedItemIndex = -1;
|
|
101
|
+
}
|
|
102
|
+
addHighlight() {
|
|
103
|
+
if (this.selectedItemIndex > -1) {
|
|
104
|
+
const listItem = this.el.shadowRoot.querySelector(`#${this.getListItemId(this.selectedItemIndex)}`);
|
|
105
|
+
listItem.classList.add('highlighted');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
removeHighlight(i) {
|
|
109
|
+
if (i > -1) {
|
|
110
|
+
const listItem = this.el.shadowRoot.querySelector(`#${this.getListItemId(i)}`);
|
|
111
|
+
listItem.classList.remove('highlighted');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
selectCurrentItem() {
|
|
115
|
+
if (this.selectedItemIndex >= 0) {
|
|
116
|
+
const selectedItemText = this.filterResult[this.selectedItemIndex];
|
|
117
|
+
this.handleItemSelected(selectedItemText);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
handleItemHovered(index) {
|
|
121
|
+
this.removeHighlight(this.selectedItemIndex);
|
|
122
|
+
this.selectedItemIndex = index;
|
|
123
|
+
this.addHighlight();
|
|
124
|
+
}
|
|
125
|
+
handleComponentFocusOut() {
|
|
126
|
+
var _a;
|
|
127
|
+
// Ensure dropdown closed on clicking or tabbing away from this component
|
|
128
|
+
if (((_a = this.filterResult) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
129
|
+
this.filterResult = new Array();
|
|
130
|
+
this.hasBeenFocusedAtLeastOnce = false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Check if the selected option is in view, and scroll if not
|
|
135
|
+
*/
|
|
136
|
+
updateScroll() {
|
|
137
|
+
const container = this.listContainer;
|
|
138
|
+
const ul = container.querySelector('ul');
|
|
139
|
+
const selectedItem = Array.from(ul.childNodes).find((item) => item.ariaPosInSet === `${this.selectedItemIndex + 1}`);
|
|
140
|
+
if (container && selectedItem && container.scrollHeight + container.clientHeight) {
|
|
141
|
+
selectedItem.scrollIntoView();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
navigateSuggestions(key) {
|
|
145
|
+
if (key === Keys.UP_ARROW) {
|
|
146
|
+
this.removeHighlight(this.selectedItemIndex);
|
|
147
|
+
this.selectedItemIndex--;
|
|
148
|
+
if (this.selectedItemIndex === -2) {
|
|
149
|
+
this.selectedItemIndex = this.filterResult.length - 1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (key === Keys.DOWN_ARROW) {
|
|
153
|
+
this.removeHighlight(this.selectedItemIndex);
|
|
154
|
+
this.selectedItemIndex++;
|
|
155
|
+
if (this.selectedItemIndex > this.filterResult.length - 1) {
|
|
156
|
+
this.selectedItemIndex = -1;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (this.selectedItemIndex === -1) {
|
|
160
|
+
this.inputValue = this.originalSearch;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
const value = this.filterResult[this.selectedItemIndex];
|
|
164
|
+
this.inputValue = value;
|
|
165
|
+
this.addHighlight();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
getListItemId(i) {
|
|
169
|
+
return `${this.listId}-item-${i}`;
|
|
170
|
+
}
|
|
171
|
+
render() {
|
|
172
|
+
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)));
|
|
173
|
+
}
|
|
174
|
+
get el() { return this; }
|
|
175
|
+
static get style() { return typeAheadCss; }
|
|
176
|
+
}, [1, "admiralty-type-ahead", {
|
|
177
|
+
"value": [1],
|
|
178
|
+
"label": [1],
|
|
179
|
+
"placeholder": [1],
|
|
180
|
+
"resultsOnInitFocus": [4, "results-on-init-focus"],
|
|
181
|
+
"filterResult": [32]
|
|
182
|
+
}]);
|
|
183
|
+
var Keys;
|
|
184
|
+
(function (Keys) {
|
|
185
|
+
Keys["UP_ARROW"] = "ArrowUp";
|
|
186
|
+
Keys["DOWN_ARROW"] = "ArrowDown";
|
|
187
|
+
Keys["ENTER"] = "Enter";
|
|
188
|
+
Keys["TAB"] = "Tab";
|
|
189
|
+
})(Keys || (Keys = {}));
|
|
190
|
+
let id = 0;
|
|
191
|
+
function defineCustomElement$1() {
|
|
192
|
+
if (typeof customElements === "undefined") {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const components = ["admiralty-type-ahead", "admiralty-hint", "admiralty-icon", "admiralty-input", "admiralty-input-error", "admiralty-label"];
|
|
196
|
+
components.forEach(tagName => { switch (tagName) {
|
|
197
|
+
case "admiralty-type-ahead":
|
|
198
|
+
if (!customElements.get(tagName)) {
|
|
199
|
+
customElements.define(tagName, TypeAheadComponent);
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
case "admiralty-hint":
|
|
203
|
+
if (!customElements.get(tagName)) {
|
|
204
|
+
defineCustomElement$6();
|
|
205
|
+
}
|
|
206
|
+
break;
|
|
207
|
+
case "admiralty-icon":
|
|
208
|
+
if (!customElements.get(tagName)) {
|
|
209
|
+
defineCustomElement$5();
|
|
210
|
+
}
|
|
211
|
+
break;
|
|
212
|
+
case "admiralty-input":
|
|
213
|
+
if (!customElements.get(tagName)) {
|
|
214
|
+
defineCustomElement$4();
|
|
215
|
+
}
|
|
216
|
+
break;
|
|
217
|
+
case "admiralty-input-error":
|
|
218
|
+
if (!customElements.get(tagName)) {
|
|
219
|
+
defineCustomElement$3();
|
|
220
|
+
}
|
|
221
|
+
break;
|
|
222
|
+
case "admiralty-label":
|
|
223
|
+
if (!customElements.get(tagName)) {
|
|
224
|
+
defineCustomElement$2();
|
|
225
|
+
}
|
|
226
|
+
break;
|
|
227
|
+
} });
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const AdmiraltyTypeAhead = TypeAheadComponent;
|
|
231
|
+
const defineCustomElement = defineCustomElement$1;
|
|
232
|
+
|
|
233
|
+
export { AdmiraltyTypeAhead, defineCustomElement };
|
|
234
|
+
|
|
235
|
+
//# sourceMappingURL=admiralty-type-ahead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"admiralty-type-ahead.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,87BAA87B;;MCOt8B,kBAAkB;;;;;;;IACrB,QAAG,GAAG,uBAAuB,EAAE,EAAE,EAAE,CAAC;IAE5C,WAAM,GAAG,GAAG,IAAI,CAAC,GAAG,iBAAiB,CAAC;IACtC,WAAM,GAAG,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC;IAS5B,eAAU,GAAkB,EAAE,CAAC;IAE/B,sBAAiB,GAAG,CAAC,CAAC,CAAC;IACvB,cAAS,GAAG,KAAK,CAAC;IAElB,eAAU,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/type-ahead/type-ahead.scss?tag=admiralty-type-ahead&encapsulation=shadow","./src/components/type-ahead/type-ahead.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\r\n@use \"../../scss/base/a11y\";\r\n@use \"../../scss/vars/typography\";\r\n\r\n* {\r\n margin: 0px;\r\n padding: 0px;\r\n}\r\n\r\n.text-input-wrap {\r\n height: auto !important;\r\n}\r\n\r\n.filterTextInput {\r\n width: 100%;\r\n}\r\n\r\n.typeahead-list-container {\r\n left: 0px;\r\n background-color: colours.$colour-white;\r\n width: 100%;\r\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);\r\n border: 2px solid colours.$colour-text;\r\n border-top: none;\r\n box-sizing: border-box;\r\n max-height: 205px;\r\n overflow-y: auto;\r\n z-index: 1;\r\n\r\n .typeahead-list {\r\n list-style: none;\r\n\r\n li {\r\n cursor: pointer;\r\n transform: unset !important;\r\n padding: 6px;\r\n min-height: 24px;\r\n }\r\n\r\n li:before {\r\n content: none;\r\n }\r\n\r\n li.highlighted {\r\n background-color: colours.$colour-admiralty-blue;\r\n color: colours.$colour-white;\r\n }\r\n }\r\n}\r\n\r\n","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"],"version":3}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$1 } from './icon.js';
|
|
3
|
+
|
|
4
|
+
var ButtonVariant;
|
|
5
|
+
(function (ButtonVariant) {
|
|
6
|
+
ButtonVariant["Primary"] = "primary";
|
|
7
|
+
ButtonVariant["Secondary"] = "secondary";
|
|
8
|
+
ButtonVariant["Warning"] = "warning";
|
|
9
|
+
ButtonVariant["Text"] = "text";
|
|
10
|
+
ButtonVariant["Icon"] = "icon";
|
|
11
|
+
})(ButtonVariant || (ButtonVariant = {}));
|
|
12
|
+
|
|
13
|
+
const buttonCss = "@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}}button.primary{display:inline-flex;align-items:center;justify-content:center;font-family:\"JohnstonITC\", Helvetica, sans-serif;font-size:18px;line-height:24px;font-size:21px;font-weight:normal;background-color:unset;cursor:pointer;height:60px;padding:15px 18px;white-space:nowrap;min-width:200px;background-color:#09315b;color:#ffffff;border:2px solid #09315b}button.primary:focus{outline:3px solid #ffdd00}button.primary:disabled{cursor:default}button.primary:disabled *{pointer-events:none}button.primary i{display:inline-block;font-size:24px;color:#ffffff;padding-left:15px}@media (max-width: 1023px){button.primary{min-width:unset;max-width:200px;width:100%;height:50px;padding:10px 18px}}button.primary i{display:inline-block;font-size:24px;color:#ffffff;padding-left:15px}button.primary:hover{background-color:#03284f;border:2px solid #03284f}button.primary:enabled:active{background-color:#ffffff;border:2px solid #09315b;color:#09315b}button.primary:enabled:active i{color:#09315b}button.primary:enabled:active p{color:#09315b}button.primary:disabled{background-color:#adadad;border:2px solid #adadad}button.secondary{display:inline-flex;align-items:center;justify-content:center;font-family:\"JohnstonITC\", Helvetica, sans-serif;font-size:18px;line-height:24px;font-size:21px;font-weight:normal;background-color:unset;cursor:pointer;height:60px;padding:15px 18px;white-space:nowrap;min-width:200px;background-color:#ffffff;color:#05284e;border:2px solid #05284e}button.secondary:focus{outline:3px solid #ffdd00}button.secondary:disabled{cursor:default}button.secondary:disabled *{pointer-events:none}button.secondary i{display:inline-block;font-size:24px;color:#ffffff;padding-left:15px}@media (max-width: 1023px){button.secondary{min-width:unset;max-width:200px;width:100%;height:50px;padding:10px 18px}}button.secondary i{display:inline-block;font-size:24px;color:#ffffff;padding-left:15px}button.secondary:hover{background-color:#eeeeee;border:2px solid #05284e}button.secondary:enabled:active{background-color:#05284e;border:2px solid #05284e;color:#ffffff}button.secondary:enabled:active i{color:#ffffff}button.secondary:enabled:active p{color:#ffffff}button.secondary:disabled{background-color:#adadad;border:2px solid #adadad}button.secondary i{color:#05284e}button.warning{display:inline-flex;align-items:center;justify-content:center;font-family:\"JohnstonITC\", Helvetica, sans-serif;font-size:18px;line-height:24px;font-size:21px;font-weight:normal;background-color:unset;cursor:pointer;height:60px;padding:15px 18px;white-space:nowrap;min-width:200px;background-color:#e20d0d;color:#ffffff;border:2px solid #e20d0d}button.warning:focus{outline:3px solid #ffdd00}button.warning:disabled{cursor:default}button.warning:disabled *{pointer-events:none}button.warning i{display:inline-block;font-size:24px;color:#ffffff;padding-left:15px}@media (max-width: 1023px){button.warning{min-width:unset;max-width:200px;width:100%;height:50px;padding:10px 18px}}button.warning i{display:inline-block;font-size:24px;color:#ffffff;padding-left:15px}button.warning:hover{background-color:#bd0404;border:2px solid #bd0404}button.warning:enabled:active{background-color:#ffffff;border:2px solid #e20d0d;color:#e20d0d}button.warning:enabled:active i{color:#e20d0d}button.warning:enabled:active p{color:#e20d0d}button.warning:disabled{background-color:#adadad;border:2px solid #adadad}button.warning:disabled>*{opacity:0.5}button.warning i{color:#ffffff}button.text{display:inline-flex;align-items:center;justify-content:center;font-family:\"JohnstonITC\", Helvetica, sans-serif;font-size:18px;line-height:24px;font-size:21px;font-weight:normal;background-color:unset;cursor:pointer;color:#05284e}button.text:focus{outline:3px solid #ffdd00}button.text:disabled{cursor:default}button.text:disabled *{pointer-events:none}button.text i{display:inline-block;font-size:24px;color:#ffffff;padding-left:15px}button.text:enabled:active{color:#05284e}button.text:enabled:active i{color:#05284e}button.text:enabled:active p{color:#05284e}button.text:disabled{color:#adadad}button.text:disabled>*{opacity:0.5}button.text:focus{outline-offset:3px}button.text i{color:#05284e}button.icon{display:inline-flex;align-items:center;justify-content:center;font-family:\"JohnstonITC\", Helvetica, sans-serif;font-size:18px;line-height:24px;font-size:21px;font-weight:normal;background-color:unset;cursor:pointer;min-height:50px;min-width:50px;padding:10px 10px;background-color:var(--button-icon-background-colour, #eeeeee);color:#09315b;border:2px solid #09315b}button.icon:focus{outline:3px solid #ffdd00}button.icon:disabled{cursor:default}button.icon:disabled *{pointer-events:none}button.icon i{display:inline-block;font-size:24px;color:#ffffff;padding-left:15px}button.icon:enabled:active{background-color:#09315b;color:#ffffff}button.icon:disabled{opacity:0.3}button.icon:active:disabled{background-color:#eeeeee}button.icon i{margin:auto;font-size:unset;color:unset;padding-left:unset}";
|
|
14
|
+
|
|
15
|
+
const ButtonComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.__registerHost();
|
|
19
|
+
this.variant = undefined;
|
|
20
|
+
this.icon = undefined;
|
|
21
|
+
this.disabled = false;
|
|
22
|
+
this.type = 'submit';
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return (h("button", { type: this.type, disabled: this.disabled ? true : null, class: this.variant || ButtonVariant.Primary }, h("slot", null), this.icon ? h("admiralty-icon", { "icon-name": this.icon }) : undefined));
|
|
26
|
+
}
|
|
27
|
+
static get style() { return buttonCss; }
|
|
28
|
+
}, [4, "admiralty-button", {
|
|
29
|
+
"variant": [1],
|
|
30
|
+
"icon": [1],
|
|
31
|
+
"disabled": [4],
|
|
32
|
+
"type": [1]
|
|
33
|
+
}]);
|
|
34
|
+
function defineCustomElement() {
|
|
35
|
+
if (typeof customElements === "undefined") {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const components = ["admiralty-button", "admiralty-icon"];
|
|
39
|
+
components.forEach(tagName => { switch (tagName) {
|
|
40
|
+
case "admiralty-button":
|
|
41
|
+
if (!customElements.get(tagName)) {
|
|
42
|
+
customElements.define(tagName, ButtonComponent);
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
case "admiralty-icon":
|
|
46
|
+
if (!customElements.get(tagName)) {
|
|
47
|
+
defineCustomElement$1();
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
} });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { ButtonComponent as B, ButtonVariant as a, defineCustomElement as d };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"button.js","mappings":";;;IAAY;AAAZ,WAAY,aAAa;EACvB,oCAAmB,CAAA;EACnB,wCAAuB,CAAA;EACvB,oCAAmB,CAAA;EACnB,8BAAa,CAAA;EACb,8BAAa,CAAA;AACf,CAAC,EANW,aAAa,KAAb,aAAa;;ACAzB,MAAM,SAAS,GAAG,02KAA02K;;MCS/2K,eAAe;;;;;;oBAaP,KAAK;gBAKsB,QAAQ;;EAEtD,MAAM;IACJ,QACE,cAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,IAAI,aAAa,CAAC,OAAO,IAC1G,eAAa,EACZ,IAAI,CAAC,IAAI,GAAG,mCAA2B,IAAI,CAAC,IAAI,GAAmB,GAAG,SAAS,CACzE,EACT;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/button/button.types.ts","./src/components/button/button.scss?tag=admiralty-button","./src/components/button/button.tsx"],"sourcesContent":["export enum ButtonVariant {\r\n Primary = 'primary',\r\n Secondary = 'secondary',\r\n Warning = 'warning',\r\n Text = 'text',\r\n Icon = 'icon',\r\n}\r\n","@use \"../../scss/base/responsive\";\r\n\r\n@use \"../../scss/vars/colours\";\r\n@use \"../../scss/vars/typography\";\r\n\r\n@mixin button-defaults {\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n\r\n font-family: typography.$font-family;\r\n font-size: typography.$font-size-normal;\r\n line-height: typography.$font-line-height-normal;\r\n font-size: 21px;\r\n font-weight: typography.$font-weight-medium;\r\n background-color: unset;\r\n cursor: pointer;\r\n\r\n &:focus {\r\n outline: 3px solid colours.$colour-utility-focus;\r\n }\r\n\r\n &:disabled {\r\n cursor: default;\r\n * {\r\n pointer-events: none;\r\n }\r\n }\r\n\r\n i {\r\n display: inline-block;\r\n font-size: 24px;\r\n color: colours.$colour-button-icon;\r\n padding-left: 15px;\r\n }\r\n}\r\n\r\n@mixin button {\r\n @include button-defaults;\r\n height: 60px;\r\n padding: 15px 18px;\r\n white-space: nowrap;\r\n min-width: 200px;\r\n\r\n @include responsive.not-desktop {\r\n min-width: unset;\r\n max-width: 200px;\r\n width: 100%;\r\n height: 50px;\r\n padding: 10px 18px;\r\n }\r\n\r\n i {\r\n display: inline-block;\r\n font-size: 24px;\r\n color: colours.$colour-button-icon;\r\n padding-left: 15px;\r\n }\r\n}\r\n\r\n/* Primary Buttons */\r\nbutton.primary {\r\n @include button;\r\n background-color: colours.$colour-button-standard;\r\n color: colours.$colour-button-text;\r\n border: 2px solid colours.$colour-button-standard;\r\n\r\n &:hover {\r\n background-color: colours.$colour-button-hover;\r\n border: 2px solid colours.$colour-button-hover;\r\n }\r\n\r\n &:enabled:active {\r\n background-color: colours.$colour-button-selected;\r\n border: 2px solid colours.$colour-button-border-selected;\r\n color: colours.$colour-button-icon-selected;\r\n\r\n i {\r\n color: colours.$colour-button-icon-selected;\r\n }\r\n\r\n p {\r\n color: colours.$colour-button-text-selected;\r\n }\r\n }\r\n\r\n &:disabled {\r\n background-color: colours.$colour-button-deselected;\r\n border: 2px solid colours.$colour-button-deselected;\r\n }\r\n}\r\n\r\n/* Secondary Buttons */\r\nbutton.secondary {\r\n @include button;\r\n background-color: colours.$colour-button-secondary-standard;\r\n color: colours.$colour-button-secondary-text;\r\n border: 2px solid colours.$colour-button-secondary-border-standard;\r\n\r\n &:hover {\r\n background-color: colours.$colour-button-secondary-hover;\r\n border: 2px solid colours.$colour-button-secondary-border-hover;\r\n }\r\n\r\n &:enabled:active {\r\n background-color: colours.$colour-button-secondary-selected;\r\n border: 2px solid colours.$colour-button-secondary-selected;\r\n color: colours.$colour-button-secondary-icon-selected;\r\n\r\n i {\r\n color: colours.$colour-button-secondary-icon-selected;\r\n }\r\n\r\n p {\r\n color: colours.$colour-button-secondary-text-selected;\r\n }\r\n }\r\n\r\n &:disabled {\r\n background-color: colours.$colour-button-secondary-deselected;\r\n border: 2px solid colours.$colour-button-secondary-deselected;\r\n }\r\n\r\n i {\r\n color: colours.$colour-button-secondary-icon;\r\n }\r\n}\r\n\r\n/* Warning Buttons */\r\nbutton.warning {\r\n @include button;\r\n background-color: colours.$colour-utility-error;\r\n color: colours.$colour-white;\r\n border: 2px solid colours.$colour-utility-error;\r\n\r\n &:hover {\r\n background-color: colours.darken(colours.$colour-utility-error);\r\n border: 2px solid colours.darken(colours.$colour-utility-error);\r\n }\r\n\r\n &:enabled:active {\r\n background-color: colours.$colour-white;\r\n border: 2px solid colours.$colour-utility-error;\r\n color: colours.$colour-utility-error;\r\n\r\n i {\r\n color: colours.$colour-utility-error;\r\n }\r\n\r\n p {\r\n color: colours.$colour-utility-error;\r\n }\r\n }\r\n\r\n &:disabled {\r\n background-color: colours.$colour-button-secondary-deselected;\r\n border: 2px solid colours.$colour-button-secondary-deselected;\r\n & > * {\r\n opacity: 0.5;\r\n }\r\n }\r\n\r\n i {\r\n color: colours.$colour-white;\r\n }\r\n}\r\n\r\n/* Text Buttons */\r\nbutton.text {\r\n @include button-defaults;\r\n color: colours.$colour-button-secondary-text;\r\n\r\n &:enabled:active {\r\n color: colours.$colour-button-secondary-text;\r\n\r\n i {\r\n color: colours.$colour-button-secondary-text;\r\n }\r\n\r\n p {\r\n color: colours.$colour-button-secondary-text;\r\n }\r\n }\r\n\r\n &:disabled {\r\n color: colours.$colour-button-secondary-deselected;\r\n & > * {\r\n opacity: 0.5;\r\n }\r\n }\r\n\r\n &:focus {\r\n outline-offset: 3px;\r\n }\r\n\r\n i {\r\n color: colours.$colour-button-secondary-icon;\r\n }\r\n}\r\n\r\n/* Icon Buttons */\r\nbutton.icon {\r\n @include button-defaults;\r\n min-height: 50px;\r\n min-width: 50px;\r\n padding: 10px 10px;\r\n\r\n background-color: var(--button-icon-background-colour, colours.$colour-bg-grey);\r\n color: colours.$colour-admiralty-blue;\r\n border: 2px solid colours.$colour-admiralty-blue;\r\n\r\n &:enabled:active {\r\n background-color: colours.$colour-admiralty-blue;\r\n color: colours.$colour-white;\r\n }\r\n\r\n &:disabled {\r\n opacity: 0.3;\r\n }\r\n\r\n &:active:disabled {\r\n background-color: colours.$colour-bg-grey;\r\n }\r\n\r\n i {\r\n margin: auto;\r\n font-size: unset;\r\n color: unset;\r\n padding-left: unset;\r\n }\r\n}\r\n","import { Component, Prop, h } from '@stencil/core';\nimport { ButtonVariant } from './button.types';\nimport { IconName } from '@fortawesome/fontawesome-svg-core';\n\n@Component({\n tag: 'admiralty-button',\n styleUrl: 'button.scss',\n shadow: false,\n})\nexport class ButtonComponent {\n /**\n * The type of button to render. Valid values are `primary`, `secondary`, `warning`, `text` and `icon`.\n * Default value is `primary`.\n */\n @Prop() variant: ButtonVariant;\n /**\n * When passed Font Awesome Icon name, then an icon will be rendered.\n */\n @Prop() icon: IconName;\n /**\n * Determines whether the button is disabled. A button in disabled state will not fire click output events.\n */\n @Prop() disabled = false;\n /**\n * The default behavior of the button. Valid values are `button`, `submit` and `reset`.\n * Default value is `submit`.\n */\n @Prop() type: 'button' | 'submit' | 'reset' = 'submit';\n\n render() {\n return (\n <button type={this.type} disabled={this.disabled ? true : null} class={this.variant || ButtonVariant.Primary}>\n <slot></slot>\n {this.icon ? <admiralty-icon icon-name={this.icon}></admiralty-icon> : undefined}\n </button>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { g as faChevronUp, h as faChevronDown, d as defineCustomElement$1 } from './icon.js';
|
|
3
|
+
|
|
4
|
+
const expansionCss = "admiralty-expansion section.expansion{padding:2px 0;border-bottom:1px solid transparent}admiralty-expansion section.expansion.bordered{border-bottom:1px solid #d8d8d8}admiralty-expansion section.expansion .expansion-content{display:none;max-height:0;overflow:visible}admiralty-expansion section.expansion.expanded .expansion-content{display:block;max-height:initial;padding-bottom:12px}admiralty-expansion section.expansion button{background-color:transparent;border:none;height:initial;min-width:unset;max-width:unset;white-space:unset;color:initial;font-size:16px;cursor:pointer;margin:10px 0 22px;padding:0;display:flex;align-items:baseline;width:100%;text-align:left;position:relative}admiralty-expansion section.expansion button .expansion-heading-icon{color:#09315b;margin-left:30px}admiralty-expansion section.expansion button:focus{outline:none}admiralty-expansion section.expansion button h3,admiralty-expansion section.expansion button button{flex-grow:1;margin-bottom:0}admiralty-expansion section.expansion button h3.expansion-heading-right-align,admiralty-expansion section.expansion button button.expansion-heading-right-align{text-align:right}admiralty-expansion section.expansion button:focus h3::before,admiralty-expansion section.expansion button:focus button::before{content:\"\";position:absolute;top:0;bottom:0;right:-3px;left:-3px;box-shadow:0 0 0 3px #ffdd00}";
|
|
5
|
+
|
|
6
|
+
let nextId = 0;
|
|
7
|
+
const ExpansionComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.toggled = createEvent(this, "toggled", 7);
|
|
12
|
+
this.id = `admiralty-expansion-${++nextId}`;
|
|
13
|
+
this.headerId = `${this.id}-header`;
|
|
14
|
+
this.contentId = `${this.id}-content`;
|
|
15
|
+
this.heading = undefined;
|
|
16
|
+
this.expanded = false;
|
|
17
|
+
this.alignHeadingRight = false;
|
|
18
|
+
this.hideBorder = false;
|
|
19
|
+
}
|
|
20
|
+
onToggle() {
|
|
21
|
+
this.expanded = !this.expanded;
|
|
22
|
+
this.toggled.emit(this.expanded);
|
|
23
|
+
}
|
|
24
|
+
getExpansionIcon() {
|
|
25
|
+
return this.expanded ? faChevronUp : faChevronDown;
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return (h("section", { class: {
|
|
29
|
+
expansion: true,
|
|
30
|
+
expanded: this.expanded,
|
|
31
|
+
bordered: !this.hideBorder,
|
|
32
|
+
} }, h("button", { id: this.headerId, type: "button", "aria-expanded": this.expanded, "aria-controls": this.contentId, class: "expansion-heading-button", onClick: this.onToggle.bind(this) }, h("h3", { class: { 'expansion-heading-right-align': this.alignHeadingRight } }, this.heading), h("span", { class: "visually-hidden" }, ", ", this.expanded ? 'Hide' : 'Show', " this section"), h("admiralty-icon", { class: "expansion-heading-icon", "icon-name": this.getExpansionIcon().iconName })), h("div", { class: "expansion-content", id: this.contentId, "aria-labelledby": this.headerId, hidden: !this.expanded }, h("slot", null))));
|
|
33
|
+
}
|
|
34
|
+
static get style() { return expansionCss; }
|
|
35
|
+
}, [4, "admiralty-expansion", {
|
|
36
|
+
"heading": [1],
|
|
37
|
+
"expanded": [1540],
|
|
38
|
+
"alignHeadingRight": [4, "align-heading-right"],
|
|
39
|
+
"hideBorder": [4, "hide-border"]
|
|
40
|
+
}]);
|
|
41
|
+
function defineCustomElement() {
|
|
42
|
+
if (typeof customElements === "undefined") {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const components = ["admiralty-expansion", "admiralty-icon"];
|
|
46
|
+
components.forEach(tagName => { switch (tagName) {
|
|
47
|
+
case "admiralty-expansion":
|
|
48
|
+
if (!customElements.get(tagName)) {
|
|
49
|
+
customElements.define(tagName, ExpansionComponent);
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case "admiralty-icon":
|
|
53
|
+
if (!customElements.get(tagName)) {
|
|
54
|
+
defineCustomElement$1();
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
} });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { ExpansionComponent as E, defineCustomElement as d };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=expansion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"expansion.js","mappings":";;;AAAA,MAAM,YAAY,GAAG,w2CAAw2C;;ACI73C,IAAI,MAAM,GAAG,CAAC,CAAC;MAOF,kBAAkB;;;;;IA0B7B,OAAE,GAAW,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAE/C,aAAQ,GAAW,GAAG,IAAI,CAAC,EAAE,SAAS,CAAC;IACvC,cAAS,GAAW,GAAG,IAAI,CAAC,EAAE,UAAU,CAAC;;oBApBU,KAAK;6BAK5B,KAAK;sBAKZ,KAAK;;EAY1B,QAAQ;IACN,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;GAClC;EAED,gBAAgB;IACd,OAAO,IAAI,CAAC,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAC;GACpD;EAED,MAAM;IACJ,QACE,eACE,KAAK,EAAE;QACL,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,CAAC,IAAI,CAAC,UAAU;OAC3B,IAED,cAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAC,QAAQ,mBAAgB,IAAI,CAAC,QAAQ,mBAAiB,IAAI,CAAC,SAAS,EAAE,KAAK,EAAC,0BAA0B,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IACtK,UAAI,KAAK,EAAE,EAAE,+BAA+B,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAG,IAAI,CAAC,OAAO,CAAM,EAC3F,YAAM,KAAK,EAAC,iBAAiB,UAAI,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,MAAM,kBAAqB,EACrF,sBAAgB,KAAK,EAAC,wBAAwB,eAAY,IAAI,CAAC,gBAAgB,EAAE,CAAC,QAAQ,GAAmB,CACtG,EACT,WAAK,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,IACvG,eAAa,CACT,CACE,EACV;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/expansion/expansion.scss?tag=admiralty-expansion","./src/components/expansion/expansion.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\n\nadmiralty-expansion {\n section.expansion {\n padding: 2px 0;\n border-bottom: 1px solid transparent;\n &.bordered {\n border-bottom: 1px solid colours.$colour-divider;\n }\n\n .expansion-content {\n display: none;\n max-height: 0;\n overflow: visible;\n }\n &.expanded .expansion-content {\n display: block;\n max-height: initial;\n padding-bottom: 12px;\n }\n\n button {\n @extend h3;\n background-color: transparent;\n border: none;\n height: initial;\n min-width: unset;\n max-width: unset;\n white-space: unset;\n color: initial;\n font-size: 16px;\n cursor: pointer;\n margin: 10px 0 22px;\n padding: 0;\n display: flex;\n align-items: baseline;\n width: 100%;\n text-align: left;\n position: relative;\n\n .expansion-heading-icon {\n color: colours.$colour-admiralty-blue;\n margin-left: 30px;\n }\n &:focus {\n outline: none;\n }\n h3 {\n flex-grow: 1;\n margin-bottom: 0;\n\n &.expansion-heading-right-align {\n text-align: right;\n }\n }\n &:focus h3::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: -3px;\n left: -3px;\n box-shadow: 0 0 0 3px colours.$colour-utility-focus;\n }\n }\n }\n}\n","import { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\nimport { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';\nimport { IconDefinition } from '@fortawesome/fontawesome-svg-core';\n\nlet nextId = 0;\n\n@Component({\n tag: 'admiralty-expansion',\n styleUrl: 'expansion.scss',\n shadow: false,\n})\nexport class ExpansionComponent {\n /**\n * The text to display in the heading of the expansion component.\n */\n @Prop() heading: string;\n\n /**\n * Whether the component is expanded.\n */\n @Prop({ mutable: true, reflect: true }) expanded = false;\n\n /**\n * CWhether the heading should be right aligned.\n */\n @Prop() alignHeadingRight = false;\n\n /**\n * Whether the border on the bottom of the component should be hidden.\n */\n @Prop() hideBorder = false;\n\n /**\n * The event that is dispatched when the expanded status is toggled.\n */\n @Event() toggled: EventEmitter<boolean>;\n\n id: string = `admiralty-expansion-${++nextId}`;\n\n headerId: string = `${this.id}-header`;\n contentId: string = `${this.id}-content`;\n\n onToggle() {\n this.expanded = !this.expanded;\n this.toggled.emit(this.expanded);\n }\n\n getExpansionIcon(): IconDefinition {\n return this.expanded ? faChevronUp : faChevronDown;\n }\n\n render() {\n return (\n <section\n class={{\n expansion: true,\n expanded: this.expanded,\n bordered: !this.hideBorder,\n }}\n >\n <button id={this.headerId} type=\"button\" aria-expanded={this.expanded} aria-controls={this.contentId} class=\"expansion-heading-button\" onClick={this.onToggle.bind(this)}>\n <h3 class={{ 'expansion-heading-right-align': this.alignHeadingRight }}>{this.heading}</h3>\n <span class=\"visually-hidden\">, {this.expanded ? 'Hide' : 'Show'} this section</span>\n <admiralty-icon class=\"expansion-heading-icon\" icon-name={this.getExpansionIcon().iconName}></admiralty-icon>\n </button>\n <div class=\"expansion-content\" id={this.contentId} aria-labelledby={this.headerId} hidden={!this.expanded}>\n <slot></slot>\n </div>\n </section>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const hintCss = "p{margin-top:0;margin-bottom:6px;display:block;font-weight:300}p.disabled{color:#adadad}";
|
|
4
|
+
|
|
5
|
+
const HintComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.disabled = undefined;
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h("p", { class: { disabled: this.disabled } }, h("slot", null)));
|
|
14
|
+
}
|
|
15
|
+
static get style() { return hintCss; }
|
|
16
|
+
}, [1, "admiralty-hint", {
|
|
17
|
+
"disabled": [4]
|
|
18
|
+
}]);
|
|
19
|
+
function defineCustomElement() {
|
|
20
|
+
if (typeof customElements === "undefined") {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const components = ["admiralty-hint"];
|
|
24
|
+
components.forEach(tagName => { switch (tagName) {
|
|
25
|
+
case "admiralty-hint":
|
|
26
|
+
if (!customElements.get(tagName)) {
|
|
27
|
+
customElements.define(tagName, HintComponent);
|
|
28
|
+
}
|
|
29
|
+
break;
|
|
30
|
+
} });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { HintComponent as H, defineCustomElement as d };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=hint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"hint.js","mappings":";;AAAA,MAAM,OAAO,GAAG,0FAA0F;;MCW7F,aAAa;;;;;;;EAMxB,MAAM;IACJ,QACE,SAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IACnC,eAAa,CACX,EACJ;GACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/hint/hint.scss?tag=admiralty-hint&encapsulation=shadow","./src/components/hint/hint.tsx"],"sourcesContent":["@use \"../../scss/vars/colours\";\r\n@use \"../../scss/vars/typography\";\r\n\r\np {\r\n margin-top: 0;\r\n margin-bottom: 6px;\r\n display: block;\r\n font-weight: typography.$font-weight-light;\r\n\r\n &.disabled {\r\n color: colours.$colour-textinput-text-disabled;\r\n }\r\n}\r\n","import { Component, h, Prop } from '@stencil/core';\n\n/**\n * @slot - The hint content should be placed in the slot e.g.\n * `<admiralty-hint>Enter your full name</admiralty-hint>`\n */\n@Component({\n tag: 'admiralty-hint',\n styleUrl: 'hint.scss',\n shadow: true,\n})\nexport class HintComponent {\n /**\n * The disabled option can be used to disable the component.\n */\n @Prop() disabled: boolean;\n\n render() {\n return (\n <p class={{ disabled: this.disabled }}>\n <slot></slot>\n </p>\n );\n }\n}\n"],"version":3}
|