@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
|
+
{"version":3,"file":"dialogue.js","sourceRoot":"","sources":["../../../src/components/dialogue/dialogue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAQhH,MAAM,OAAO,iBAAiB;;gBAI6B,MAAM;;;EAO/D,kBAAkB;IAChB,QAAQ,IAAI,CAAC,IAAI,EAAE;MACjB,KAAK,MAAM;QACT,OAAO,YAAY,CAAC;MACtB,KAAK,SAAS;QACZ,OAAO,qBAAqB,CAAC;MAC/B,KAAK,SAAS;QACZ,OAAO,OAAO,CAAC;MACjB,KAAK,OAAO;QACV,OAAO,aAAa,CAAC;KACxB;EACH,CAAC;EAED,MAAM;IACJ,OAAO,CACL,eACE,KAAK,EAAE;QACL,QAAQ,EAAE,IAAI;QACd,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI;OAClB;MAED,WAAK,KAAK,EAAC,gBAAgB;QACzB,sBAAgB,KAAK,EAAC,qBAAqB,eAAY,IAAI,CAAC,kBAAkB,EAAE,CAAC,QAAQ,GAAmB;QAC3G,IAAI,CAAC,OAAO,CACT;MACN,eAAa,CACL,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { faCheck, faCircleInfo, faExclamation, faTriangleExclamation } from '@fortawesome/free-solid-svg-icons';\nimport { IconDefinition } from '@fortawesome/fontawesome-svg-core';\n\n@Component({\n tag: 'admiralty-dialogue',\n styleUrl: 'dialogue.scss',\n shadow: true,\n})\nexport class DialogueComponent {\n /**\n * The type of dialogue box to render.\n */\n @Prop() type: 'info' | 'warning' | 'success' | 'error' = 'info';\n\n /**\n * The heading to display.\n */\n @Prop() heading: string;\n\n getIconNameForType(): IconDefinition {\n switch (this.type) {\n case 'info':\n return faCircleInfo;\n case 'warning':\n return faTriangleExclamation;\n case 'success':\n return faCheck;\n case 'error':\n return faExclamation;\n }\n }\n\n render() {\n return (\n <section\n class={{\n dialogue: true,\n [this.type]: true,\n }}\n >\n <div class=\"dialogue-title\">\n <admiralty-icon class=\"dialogue-title-icon\" icon-name={this.getIconNameForType().iconName}></admiralty-icon>\n {this.heading}\n </div>\n <slot></slot>\n </section>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* Core Palette */
|
|
2
|
+
/* Supporting Palette */
|
|
3
|
+
/* Secondary Palette */
|
|
4
|
+
/* Digital Product Colours */
|
|
5
|
+
/* Utility Colours */
|
|
6
|
+
/* Button Colours */
|
|
7
|
+
/* Primary */
|
|
8
|
+
/* Secondary */
|
|
9
|
+
/* Link Colours */
|
|
10
|
+
/* Nav colours */
|
|
11
|
+
/* Table colours */
|
|
12
|
+
/* Tab colours */
|
|
13
|
+
/* form text input colours */
|
|
14
|
+
/* form textarea colours */
|
|
15
|
+
/* radio button */
|
|
16
|
+
/* checkbox */
|
|
17
|
+
/* code snippet */
|
|
18
|
+
admiralty-expansion section.expansion {
|
|
19
|
+
padding: 2px 0;
|
|
20
|
+
border-bottom: 1px solid transparent;
|
|
21
|
+
}
|
|
22
|
+
admiralty-expansion section.expansion.bordered {
|
|
23
|
+
border-bottom: 1px solid #d8d8d8;
|
|
24
|
+
}
|
|
25
|
+
admiralty-expansion section.expansion .expansion-content {
|
|
26
|
+
display: none;
|
|
27
|
+
max-height: 0;
|
|
28
|
+
overflow: visible;
|
|
29
|
+
}
|
|
30
|
+
admiralty-expansion section.expansion.expanded .expansion-content {
|
|
31
|
+
display: block;
|
|
32
|
+
max-height: initial;
|
|
33
|
+
padding-bottom: 12px;
|
|
34
|
+
}
|
|
35
|
+
admiralty-expansion section.expansion button {
|
|
36
|
+
background-color: transparent;
|
|
37
|
+
border: none;
|
|
38
|
+
height: initial;
|
|
39
|
+
min-width: unset;
|
|
40
|
+
max-width: unset;
|
|
41
|
+
white-space: unset;
|
|
42
|
+
color: initial;
|
|
43
|
+
font-size: 16px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
margin: 10px 0 22px;
|
|
46
|
+
padding: 0;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: baseline;
|
|
49
|
+
width: 100%;
|
|
50
|
+
text-align: left;
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
admiralty-expansion section.expansion button .expansion-heading-icon {
|
|
54
|
+
color: #09315b;
|
|
55
|
+
margin-left: 30px;
|
|
56
|
+
}
|
|
57
|
+
admiralty-expansion section.expansion button:focus {
|
|
58
|
+
outline: none;
|
|
59
|
+
}
|
|
60
|
+
admiralty-expansion section.expansion button h3, admiralty-expansion section.expansion button button {
|
|
61
|
+
flex-grow: 1;
|
|
62
|
+
margin-bottom: 0;
|
|
63
|
+
}
|
|
64
|
+
admiralty-expansion section.expansion button h3.expansion-heading-right-align, admiralty-expansion section.expansion button button.expansion-heading-right-align {
|
|
65
|
+
text-align: right;
|
|
66
|
+
}
|
|
67
|
+
admiralty-expansion section.expansion button:focus h3::before, admiralty-expansion section.expansion button:focus button::before {
|
|
68
|
+
content: "";
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 0;
|
|
71
|
+
bottom: 0;
|
|
72
|
+
right: -3px;
|
|
73
|
+
left: -3px;
|
|
74
|
+
box-shadow: 0 0 0 3px #ffdd00;
|
|
75
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
let nextId = 0;
|
|
4
|
+
export class ExpansionComponent {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.id = `admiralty-expansion-${++nextId}`;
|
|
7
|
+
this.headerId = `${this.id}-header`;
|
|
8
|
+
this.contentId = `${this.id}-content`;
|
|
9
|
+
this.heading = undefined;
|
|
10
|
+
this.expanded = false;
|
|
11
|
+
this.alignHeadingRight = false;
|
|
12
|
+
this.hideBorder = false;
|
|
13
|
+
}
|
|
14
|
+
onToggle() {
|
|
15
|
+
this.expanded = !this.expanded;
|
|
16
|
+
this.toggled.emit(this.expanded);
|
|
17
|
+
}
|
|
18
|
+
getExpansionIcon() {
|
|
19
|
+
return this.expanded ? faChevronUp : faChevronDown;
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (h("section", { class: {
|
|
23
|
+
expansion: true,
|
|
24
|
+
expanded: this.expanded,
|
|
25
|
+
bordered: !this.hideBorder,
|
|
26
|
+
} }, 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))));
|
|
27
|
+
}
|
|
28
|
+
static get is() { return "admiralty-expansion"; }
|
|
29
|
+
static get originalStyleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["expansion.scss"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get styleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["expansion.css"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get properties() {
|
|
40
|
+
return {
|
|
41
|
+
"heading": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"mutable": false,
|
|
44
|
+
"complexType": {
|
|
45
|
+
"original": "string",
|
|
46
|
+
"resolved": "string",
|
|
47
|
+
"references": {}
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"optional": false,
|
|
51
|
+
"docs": {
|
|
52
|
+
"tags": [],
|
|
53
|
+
"text": "The text to display in the heading of the expansion component."
|
|
54
|
+
},
|
|
55
|
+
"attribute": "heading",
|
|
56
|
+
"reflect": false
|
|
57
|
+
},
|
|
58
|
+
"expanded": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"mutable": true,
|
|
61
|
+
"complexType": {
|
|
62
|
+
"original": "boolean",
|
|
63
|
+
"resolved": "boolean",
|
|
64
|
+
"references": {}
|
|
65
|
+
},
|
|
66
|
+
"required": false,
|
|
67
|
+
"optional": false,
|
|
68
|
+
"docs": {
|
|
69
|
+
"tags": [],
|
|
70
|
+
"text": "Whether the component is expanded."
|
|
71
|
+
},
|
|
72
|
+
"attribute": "expanded",
|
|
73
|
+
"reflect": true,
|
|
74
|
+
"defaultValue": "false"
|
|
75
|
+
},
|
|
76
|
+
"alignHeadingRight": {
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"mutable": false,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "boolean",
|
|
81
|
+
"resolved": "boolean",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": "CWhether the heading should be right aligned."
|
|
89
|
+
},
|
|
90
|
+
"attribute": "align-heading-right",
|
|
91
|
+
"reflect": false,
|
|
92
|
+
"defaultValue": "false"
|
|
93
|
+
},
|
|
94
|
+
"hideBorder": {
|
|
95
|
+
"type": "boolean",
|
|
96
|
+
"mutable": false,
|
|
97
|
+
"complexType": {
|
|
98
|
+
"original": "boolean",
|
|
99
|
+
"resolved": "boolean",
|
|
100
|
+
"references": {}
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"optional": false,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": "Whether the border on the bottom of the component should be hidden."
|
|
107
|
+
},
|
|
108
|
+
"attribute": "hide-border",
|
|
109
|
+
"reflect": false,
|
|
110
|
+
"defaultValue": "false"
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
static get events() {
|
|
115
|
+
return [{
|
|
116
|
+
"method": "toggled",
|
|
117
|
+
"name": "toggled",
|
|
118
|
+
"bubbles": true,
|
|
119
|
+
"cancelable": true,
|
|
120
|
+
"composed": true,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": "The event that is dispatched when the expanded status is toggled."
|
|
124
|
+
},
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "boolean",
|
|
127
|
+
"resolved": "boolean",
|
|
128
|
+
"references": {}
|
|
129
|
+
}
|
|
130
|
+
}];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=expansion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expansion.js","sourceRoot":"","sources":["../../../src/components/expansion/expansion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAG/E,IAAI,MAAM,GAAG,CAAC,CAAC;AAOf,MAAM,OAAO,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;EACnC,CAAC;EAED,gBAAgB;IACd,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC;EACrD,CAAC;EAED,MAAM;IACJ,OAAO,CACL,eACE,KAAK,EAAE;QACL,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,CAAC,IAAI,CAAC,UAAU;OAC3B;MAED,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;QACtK,UAAI,KAAK,EAAE,EAAE,+BAA+B,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAG,IAAI,CAAC,OAAO,CAAM;QAC3F,YAAM,KAAK,EAAC,iBAAiB;;UAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;0BAAqB;QACrF,sBAAgB,KAAK,EAAC,wBAAwB,eAAY,IAAI,CAAC,gBAAgB,EAAE,CAAC,QAAQ,GAAmB,CACtG;MACT,WAAK,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ;QACvG,eAAa,CACT,CACE,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* Core Palette */
|
|
2
|
+
/* Supporting Palette */
|
|
3
|
+
/* Secondary Palette */
|
|
4
|
+
/* Digital Product Colours */
|
|
5
|
+
/* Utility Colours */
|
|
6
|
+
/* Button Colours */
|
|
7
|
+
/* Primary */
|
|
8
|
+
/* Secondary */
|
|
9
|
+
/* Link Colours */
|
|
10
|
+
/* Nav colours */
|
|
11
|
+
/* Table colours */
|
|
12
|
+
/* Tab colours */
|
|
13
|
+
/* form text input colours */
|
|
14
|
+
/* form textarea colours */
|
|
15
|
+
/* radio button */
|
|
16
|
+
/* checkbox */
|
|
17
|
+
/* code snippet */
|
|
18
|
+
.admiralty-file-input {
|
|
19
|
+
background: #eee;
|
|
20
|
+
display: flex;
|
|
21
|
+
position: relative;
|
|
22
|
+
border: 2px dashed #09315b;
|
|
23
|
+
min-height: 120px;
|
|
24
|
+
align-content: stretch;
|
|
25
|
+
justify-content: stretch;
|
|
26
|
+
margin-bottom: 36px;
|
|
27
|
+
font-family: "JohnstonITC", Helvetica, sans-serif;
|
|
28
|
+
font-size: 18px;
|
|
29
|
+
line-height: 24px;
|
|
30
|
+
font-weight: 300;
|
|
31
|
+
}
|
|
32
|
+
.admiralty-file-input.drop_zone {
|
|
33
|
+
background: #fff !important;
|
|
34
|
+
}
|
|
35
|
+
.admiralty-file-input .upload-icon {
|
|
36
|
+
color: #09315b;
|
|
37
|
+
font-size: 24px;
|
|
38
|
+
font-weight: 900;
|
|
39
|
+
margin: 0.4rem auto;
|
|
40
|
+
text-align: center;
|
|
41
|
+
flex: 0 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
label {
|
|
45
|
+
border-image-repeat: stretch;
|
|
46
|
+
border-image-width: 1;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-content: center;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
flex: 1;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
label span {
|
|
55
|
+
color: #09315b;
|
|
56
|
+
flex: 0 1;
|
|
57
|
+
font-size: 18px;
|
|
58
|
+
font-weight: 300;
|
|
59
|
+
text-align: center;
|
|
60
|
+
margin: 0.4rem 0;
|
|
61
|
+
}
|
|
62
|
+
label span.instructions {
|
|
63
|
+
font-weight: normal;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
input[type=file] {
|
|
67
|
+
align-items: baseline;
|
|
68
|
+
overflow: visible;
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 0;
|
|
71
|
+
bottom: 0;
|
|
72
|
+
z-index: -1;
|
|
73
|
+
width: 100%;
|
|
74
|
+
}
|
|
75
|
+
input[type=file]:focus {
|
|
76
|
+
outline: 3px solid #ffdd00;
|
|
77
|
+
outline-offset: 2px;
|
|
78
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class FileInputComponent {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.id = `admiralty-file-input-${++nextId}`;
|
|
5
|
+
/**
|
|
6
|
+
* Takes the bytes of a file and returns it as human readable figure
|
|
7
|
+
* @param bytes pass bytes throughs as a number
|
|
8
|
+
* @returns convers the bytes to the appropiate largest figure followed by the format ie. 'kb', 'mb' etc
|
|
9
|
+
*/
|
|
10
|
+
this.sizeOf = function (bytes) {
|
|
11
|
+
if (bytes === 0) {
|
|
12
|
+
return '0.00 B';
|
|
13
|
+
}
|
|
14
|
+
var e = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
15
|
+
return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';
|
|
16
|
+
};
|
|
17
|
+
this.label = 'Click to choose a file or drag it';
|
|
18
|
+
this.multiple = false;
|
|
19
|
+
this.files = undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The event that is fired when the user clicks on the file input box and uses the default dialog
|
|
23
|
+
* @param event
|
|
24
|
+
*/
|
|
25
|
+
changeHandler(event) {
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
this.storeFileInfo(event.target.files);
|
|
28
|
+
this.fileInputChange.emit(this.files);
|
|
29
|
+
console.log('changeHandler:', this.files);
|
|
30
|
+
}
|
|
31
|
+
storeFileInfo(files) {
|
|
32
|
+
this.files = this.multiple ? [...files] : [files.item(0)];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Prevents default dragOver behaviour which, stops the file being downloaded to the browser
|
|
36
|
+
* in a new tab
|
|
37
|
+
* @param event
|
|
38
|
+
*/
|
|
39
|
+
dragOverHandler(event) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
this.el.shadowRoot.querySelector('.admiralty-file-input').classList.add('drop_zone');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* When this event is fired the 'drop_zone' class is removed from the wrapper 'admiralty-file-input' div
|
|
45
|
+
* which, turns the background back to off white
|
|
46
|
+
* @param event
|
|
47
|
+
*/
|
|
48
|
+
dragLeaveHander(event) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
this.el.shadowRoot.querySelector('.admiralty-file-input').classList.remove('drop_zone');
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Handles the 'file' the user drops into the input field
|
|
54
|
+
* Does a check if it's a file and update the interface with the filename and the size of the file
|
|
55
|
+
* @param event
|
|
56
|
+
*/
|
|
57
|
+
dropHandler(event) {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
this.el.shadowRoot.querySelector('.admiralty-file-input').classList.remove('drop_zone');
|
|
60
|
+
if (event.dataTransfer.files) {
|
|
61
|
+
this.storeFileInfo(event.dataTransfer.files);
|
|
62
|
+
this.fileInputChange.emit(this.files);
|
|
63
|
+
console.log('Drop: ', this.files);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
get filesDisplay() {
|
|
67
|
+
return `${this.files[0].name} (${this.sizeOf(this.files[0].size)}) ${this.files.length > 1 ? ' ...' : ''}`;
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
var _a;
|
|
71
|
+
return (h(Host, { onDragLeave: event => this.dragLeaveHander(event), onDragOver: event => this.dragOverHandler(event), onDrop: event => this.dropHandler(event) }, h("div", { class: "admiralty-file-input" }, h("label", { htmlFor: this.id }, h("admiralty-icon", { class: "upload-icon", "icon-name": "upload" }), ((_a = this.files) === null || _a === void 0 ? void 0 : _a.length) ? h("span", null, this.filesDisplay) : h("span", { class: "instructions" }, this.label)), h("input", { onChange: event => this.changeHandler(event), id: this.id, "aria-hidden": "true", "aria-label": "File Upload", type: "file", class: "admiralty-form-field", multiple: this.multiple }))));
|
|
72
|
+
}
|
|
73
|
+
static get is() { return "admiralty-file-input"; }
|
|
74
|
+
static get encapsulation() { return "shadow"; }
|
|
75
|
+
static get originalStyleUrls() {
|
|
76
|
+
return {
|
|
77
|
+
"$": ["file-input.scss"]
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
static get styleUrls() {
|
|
81
|
+
return {
|
|
82
|
+
"$": ["file-input.css"]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
static get properties() {
|
|
86
|
+
return {
|
|
87
|
+
"label": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"mutable": false,
|
|
90
|
+
"complexType": {
|
|
91
|
+
"original": "string",
|
|
92
|
+
"resolved": "string",
|
|
93
|
+
"references": {}
|
|
94
|
+
},
|
|
95
|
+
"required": false,
|
|
96
|
+
"optional": false,
|
|
97
|
+
"docs": {
|
|
98
|
+
"tags": [],
|
|
99
|
+
"text": "Used to display instructions to the user and is replaced with the filename the user inputs"
|
|
100
|
+
},
|
|
101
|
+
"attribute": "label",
|
|
102
|
+
"reflect": false,
|
|
103
|
+
"defaultValue": "'Click to choose a file or drag it'"
|
|
104
|
+
},
|
|
105
|
+
"multiple": {
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"mutable": false,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "boolean",
|
|
110
|
+
"resolved": "boolean",
|
|
111
|
+
"references": {}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": "If true, enables multiple files to be selected or dragged"
|
|
118
|
+
},
|
|
119
|
+
"attribute": "multiple",
|
|
120
|
+
"reflect": false,
|
|
121
|
+
"defaultValue": "false"
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
static get states() {
|
|
126
|
+
return {
|
|
127
|
+
"files": {}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
static get events() {
|
|
131
|
+
return [{
|
|
132
|
+
"method": "fileInputChange",
|
|
133
|
+
"name": "fileInputChange",
|
|
134
|
+
"bubbles": true,
|
|
135
|
+
"cancelable": true,
|
|
136
|
+
"composed": true,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": "Emitted when the added file(s) changes"
|
|
140
|
+
},
|
|
141
|
+
"complexType": {
|
|
142
|
+
"original": "File[]",
|
|
143
|
+
"resolved": "File[]",
|
|
144
|
+
"references": {
|
|
145
|
+
"File": {
|
|
146
|
+
"location": "global"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}];
|
|
151
|
+
}
|
|
152
|
+
static get elementRef() { return "el"; }
|
|
153
|
+
}
|
|
154
|
+
let nextId = 0;
|
|
155
|
+
//# sourceMappingURL=file-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../../src/components/file-input/file-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAO9F,MAAM,OAAO,kBAAkB;;IAkB7B,OAAE,GAAW,wBAAwB,EAAE,MAAM,EAAE,CAAC;IAgEhD;;;;OAIG;IACH,WAAM,GAAG,UAAU,KAAa;MAC9B,IAAI,KAAK,KAAK,CAAC,EAAE;QACf,OAAO,QAAQ,CAAC;OACjB;MACD,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;MACrD,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACjF,CAAC,CAAC;iBAvFsB,mCAAmC;oBAKxC,KAAK;;;EAcxB;;;KAGG;EACH,aAAa,CAAC,KAAY;IACxB,KAAK,CAAC,cAAc,EAAE,CAAC;IAEvB,IAAI,CAAC,aAAa,CAAE,KAAK,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAC;IAE7D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5C,CAAC;EAEO,aAAa,CAAC,KAAe;IACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAI,KAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;EACnF,CAAC;EAED;;;;KAIG;EACH,eAAe,CAAC,KAAgB;IAC9B,KAAK,CAAC,cAAc,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;EACvF,CAAC;EAED;;;;KAIG;EACH,eAAe,CAAC,KAAgB;IAC9B,KAAK,CAAC,cAAc,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;EAC1F,CAAC;EAED;;;;KAIG;EACH,WAAW,CAAC,KAAgB;IAC1B,KAAK,CAAC,cAAc,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAExF,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE;MAC5B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;MAC7C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;MACtC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;KACnC;EACH,CAAC;EAED,IAAI,YAAY;IACd,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;EAC7G,CAAC;EAeD,MAAM;;IACJ,OAAO,CACL,EAAC,IAAI,IAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;MACjJ,WAAK,KAAK,EAAC,sBAAsB;QAC/B,aAAO,OAAO,EAAE,IAAI,CAAC,EAAE;UACrB,sBAAgB,KAAK,EAAC,aAAa,eAAW,QAAQ,GAAkB;UACvE,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,MAAM,EAAC,CAAC,CAAC,gBAAO,IAAI,CAAC,YAAY,CAAQ,CAAC,CAAC,CAAC,YAAM,KAAK,EAAC,cAAc,IAAE,IAAI,CAAC,KAAK,CAAQ,CACjG;QACR,aACE,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAC5C,EAAE,EAAE,IAAI,CAAC,EAAE,iBACC,MAAM,gBACP,aAAa,EACxB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,sBAAsB,EAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACvB,CACE,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,MAAM,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Element, Event, Host, h, Prop, State, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-file-input',\n styleUrl: 'file-input.scss',\n shadow: true,\n})\nexport class FileInputComponent {\n @Element() el: HTMLElement;\n\n /**\n * Used to display instructions to the user and is replaced with the filename the user inputs\n */\n @Prop() label: string = 'Click to choose a file or drag it';\n\n /**\n * If true, enables multiple files to be selected or dragged\n */\n @Prop() multiple = false;\n\n /**\n * Emitted when the added file(s) changes\n */\n @Event() fileInputChange: EventEmitter<File[]>;\n\n id: string = `admiralty-file-input-${++nextId}`;\n\n /**\n * INTERNAL - The list of files currently in the field\n */\n @State() files: File[];\n\n /**\n * The event that is fired when the user clicks on the file input box and uses the default dialog\n * @param event\n */\n changeHandler(event: Event) {\n event.preventDefault();\n\n this.storeFileInfo((event.target as HTMLInputElement).files);\n\n this.fileInputChange.emit(this.files);\n console.log('changeHandler:', this.files);\n }\n\n private storeFileInfo(files: FileList) {\n this.files = this.multiple ? [...(files as unknown as File[])] : [files.item(0)];\n }\n\n /**\n * Prevents default dragOver behaviour which, stops the file being downloaded to the browser\n * in a new tab\n * @param event\n */\n dragOverHandler(event: DragEvent) {\n event.preventDefault();\n this.el.shadowRoot.querySelector('.admiralty-file-input').classList.add('drop_zone');\n }\n\n /**\n * When this event is fired the 'drop_zone' class is removed from the wrapper 'admiralty-file-input' div\n * which, turns the background back to off white\n * @param event\n */\n dragLeaveHander(event: DragEvent) {\n event.preventDefault();\n this.el.shadowRoot.querySelector('.admiralty-file-input').classList.remove('drop_zone');\n }\n\n /**\n * Handles the 'file' the user drops into the input field\n * Does a check if it's a file and update the interface with the filename and the size of the file\n * @param event\n */\n dropHandler(event: DragEvent) {\n event.preventDefault();\n this.el.shadowRoot.querySelector('.admiralty-file-input').classList.remove('drop_zone');\n\n if (event.dataTransfer.files) {\n this.storeFileInfo(event.dataTransfer.files);\n this.fileInputChange.emit(this.files);\n console.log('Drop: ', this.files);\n }\n }\n\n get filesDisplay() {\n return `${this.files[0].name} (${this.sizeOf(this.files[0].size)}) ${this.files.length > 1 ? ' ...' : ''}`;\n }\n\n /**\n * Takes the bytes of a file and returns it as human readable figure\n * @param bytes pass bytes throughs as a number\n * @returns convers the bytes to the appropiate largest figure followed by the format ie. 'kb', 'mb' etc\n */\n sizeOf = function (bytes: number) {\n if (bytes === 0) {\n return '0.00 B';\n }\n var e = Math.floor(Math.log(bytes) / Math.log(1024));\n return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';\n };\n\n render() {\n return (\n <Host onDragLeave={event => this.dragLeaveHander(event)} onDragOver={event => this.dragOverHandler(event)} onDrop={event => this.dropHandler(event)}>\n <div class=\"admiralty-file-input\">\n <label htmlFor={this.id}>\n <admiralty-icon class=\"upload-icon\" icon-name=\"upload\"></admiralty-icon>\n {this.files?.length ? <span>{this.filesDisplay}</span> : <span class=\"instructions\">{this.label}</span>}\n </label>\n <input\n onChange={event => this.changeHandler(event)}\n id={this.id}\n aria-hidden=\"true\"\n aria-label=\"File Upload\"\n type=\"file\"\n class=\"admiralty-form-field\"\n multiple={this.multiple}\n />\n </div>\n </Host>\n );\n }\n}\n\nlet nextId = 0;\n"]}
|