adp-web-components 0.3.18 → 0.3.20
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/dist/cjs/{branch-slot-dropdown_15.cjs.entry.js → branch-date-dropdown_17.cjs.entry.js} +958 -68
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +9 -9
- package/dist/cjs/flexible-container.cjs.entry.js +3 -3
- package/dist/cjs/form-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/form-date-picker.cjs.entry.js +5 -5
- package/dist/cjs/form-input_7.cjs.entry.js +21 -19
- package/dist/cjs/form-switch.cjs.entry.js +2 -2
- package/dist/cjs/form-time-picker.cjs.entry.js +6 -6
- package/dist/cjs/{functions-C9XsBzrL.js → functions-BAUJUMt-.js} +44 -19
- package/dist/cjs/general-form.cjs.entry.js +6 -6
- package/dist/cjs/general-inquiry-form.cjs.entry.js +6 -6
- package/dist/cjs/{get-local-language-BnUadlVY.js → get-local-language-DI_UK6D5.js} +1 -1
- package/dist/cjs/{get-mock-files-Dr5dpq1N.js → get-mock-files-B1tNGb9m.js} +1 -1
- package/dist/cjs/information-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +2 -2
- package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +3 -3
- package/dist/cjs/{mappers-BlH-TAo7.js → mappers-DnWgECCv.js} +54 -18
- package/dist/cjs/part-lookup.cjs.entry.js +2 -2
- package/dist/cjs/service-booking-form.cjs.entry.js +6 -6
- package/dist/cjs/shift-accordion.cjs.entry.js +2 -2
- package/dist/cjs/shift-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/cjs/shift-slider.cjs.entry.js +1 -1
- package/dist/cjs/shift-switch.cjs.entry.js +2 -2
- package/dist/cjs/shift-tab-content.cjs.entry.js +2 -2
- package/dist/cjs/shift-tabs_2.cjs.entry.js +92 -34
- package/dist/cjs/ssc-lookup-form.cjs.entry.js +6 -6
- package/dist/cjs/test-drive-form.cjs.entry.js +6 -6
- package/dist/cjs/triangle-alert-CTvU1eGY.js +248 -0
- package/dist/cjs/vehicle-accessories_8.cjs.entry.js +177 -117
- package/dist/cjs/vehicle-lookup.cjs.entry.js +3 -3
- package/dist/cjs/vehicle-quotation-form.cjs.entry.js +17 -18
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/components/empty.css +1 -1
- package/dist/collection/components/components/flexible-container.css +1 -1
- package/dist/collection/components/components/flexible-container.js +2 -2
- package/dist/collection/components/components/information-table.css +1 -1
- package/dist/collection/components/components/loading-spinner.css +1 -1
- package/dist/collection/components/components/loading-spinner.js +1 -1
- package/dist/collection/components/components/shift-accordion.css +1 -1
- package/dist/collection/components/components/shift-accordion.js +1 -1
- package/dist/collection/components/components/shift-checkbox.js +1 -1
- package/dist/collection/components/components/shift-portal.css +1 -1
- package/dist/collection/components/components/shift-select-dropdown.css +1 -1
- package/dist/collection/components/components/shift-select-dropdown.js +2 -2
- package/dist/collection/components/components/shift-select.css +1 -1
- package/dist/collection/components/components/shift-select.js +3 -3
- package/dist/collection/components/components/shift-slider.js +1 -1
- package/dist/collection/components/components/shift-switch.js +1 -1
- package/dist/collection/components/components/shift-tab-content.css +1 -1
- package/dist/collection/components/components/shift-tab-content.js +1 -1
- package/dist/collection/components/components/shift-tabs.css +1 -1
- package/dist/collection/components/components/shift-tabs.js +2 -2
- package/dist/collection/components/form-elements/branch-date-dropdown.css +1 -0
- package/dist/collection/components/form-elements/branch-date-dropdown.js +682 -0
- package/dist/collection/components/form-elements/branch-date-picker.css +1 -0
- package/dist/collection/components/form-elements/branch-date-picker.js +1197 -0
- package/dist/collection/components/form-elements/branch-slot-dropdown.css +1 -1
- package/dist/collection/components/form-elements/branch-slot-dropdown.js +11 -6
- package/dist/collection/components/form-elements/branch-slot-picker.css +1 -1
- package/dist/collection/components/form-elements/branch-slot-picker.js +166 -18
- package/dist/collection/components/form-elements/form-checkbox.js +1 -1
- package/dist/collection/components/form-elements/form-date-picker-legacy.js +4 -4
- package/dist/collection/components/form-elements/form-dialog.css +1 -1
- package/dist/collection/components/form-elements/form-dialog.js +1 -1
- package/dist/collection/components/form-elements/form-file.js +2 -2
- package/dist/collection/components/form-elements/form-input.js +6 -4
- package/dist/collection/components/form-elements/form-inputs.css +1 -1
- package/dist/collection/components/form-elements/form-phone-number.js +4 -2
- package/dist/collection/components/form-elements/form-picker-input.js +6 -4
- package/dist/collection/components/form-elements/form-shadow-input.js +1 -1
- package/dist/collection/components/form-elements/form-stepper-control.js +2 -2
- package/dist/collection/components/form-elements/form-stepper-submit.js +2 -2
- package/dist/collection/components/form-elements/form-stepper.js +1 -1
- package/dist/collection/components/form-elements/form-structure-error.js +1 -1
- package/dist/collection/components/form-elements/form-submit.js +2 -2
- package/dist/collection/components/form-elements/form-switch.js +1 -1
- package/dist/collection/components/form-elements/form-text-area.js +6 -4
- package/dist/collection/components/form-elements/form-time-picker-legacy.js +5 -5
- package/dist/collection/components/form-elements/form-vin-input.js +6 -4
- package/dist/collection/components/forms/defaults/mappers.js +54 -18
- package/dist/collection/components/forms/defaults/style.css +1 -1
- package/dist/collection/components/forms/general-form.js +2 -2
- package/dist/collection/components/forms/general-inquiry.js +2 -2
- package/dist/collection/components/forms/service-booking.js +2 -2
- package/dist/collection/components/forms/ssc-lookup.js +2 -2
- package/dist/collection/components/forms/test-drive.js +2 -2
- package/dist/collection/components/forms/vehicle-quotation/themes.css +1 -1
- package/dist/collection/components/forms/vehicle-quotation.js +15 -16
- package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +2 -2
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +2 -2
- package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-part-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-part-lookup.js +1 -1
- package/dist/collection/components/part-lookup/part-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/components/claimable-item-popover.js +37 -29
- package/dist/collection/components/vehicle-lookup/components/claimable-trace-modal.js +6 -2
- package/dist/collection/components/vehicle-lookup/components/service-history-sub-row.js +3 -3
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +121 -70
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +89 -29
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-timeline.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-timeline.js +1 -1
- package/dist/collection/components/vin-extractor/vin-extractor.css +1 -1
- package/dist/collection/components/vin-extractor/vin-extractor.js +1 -1
- package/dist/collection/features/form-hook/functions.js +42 -18
- package/dist/collection/global/lib/overlay.js +154 -0
- package/dist/collection/global/lib/slot-day-rules.js +65 -0
- package/dist/collection/templates/assets/adp-wordmark.svg +1 -0
- package/dist/collection/templates/assets/favicon.svg +17 -0
- package/dist/collection/templates/forms/docs-content/params.js +1199 -0
- package/dist/collection/templates/forms/docs-content/structure.js +1153 -0
- package/dist/collection/templates/forms/docs-content/theming.js +1240 -0
- package/dist/collection/templates/harness-theme.js +44 -0
- package/dist/collection/templates/harness.js +775 -0
- package/dist/collection/templates/highlight.js +194 -0
- package/dist/collection/templates/nav.js +320 -0
- package/dist/collection/templates/site-header.js +642 -0
- package/dist/collection/templates/site-locales.js +771 -0
- package/dist/components/branch-date-dropdown.d.ts +11 -0
- package/dist/components/branch-date-dropdown.js +5 -0
- package/dist/components/branch-date-picker.d.ts +11 -0
- package/dist/components/branch-date-picker.js +5 -0
- package/dist/components/branch-slot-dropdown.js +1 -1
- package/dist/components/branch-slot-picker.js +1 -1
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/flexible-container.js +1 -1
- package/dist/components/form-checkbox.js +1 -1
- package/dist/components/form-date-picker.js +1 -1
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-file.js +1 -1
- package/dist/components/form-input-preview.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-phone-number.js +1 -1
- package/dist/components/form-picker-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.js +1 -1
- package/dist/components/form-stepper-control.js +1 -1
- package/dist/components/form-stepper-submit.js +1 -1
- package/dist/components/form-stepper.js +1 -1
- package/dist/components/form-structure-error.js +1 -1
- package/dist/components/form-structure.js +1 -1
- package/dist/components/form-submit.js +1 -1
- package/dist/components/form-switch.js +1 -1
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/form-time-picker.js +1 -1
- package/dist/components/form-vin-input.js +1 -1
- package/dist/components/general-form.js +1 -1
- package/dist/components/general-inquiry-form.js +1 -1
- package/dist/components/information-table.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/manufacturer-part-lookup.js +1 -1
- package/dist/components/p--lk4OUJg.js +5 -0
- package/dist/components/p-38ox9qxm.js +5 -0
- package/dist/components/p-5OD_mwiD.js +5 -0
- package/dist/components/{p-D7wRHBb3.js → p-68bjv9gT.js} +1 -1
- package/dist/components/p-B0_5_VvS.js +5 -0
- package/dist/components/p-B1xVBTqj.js +5 -0
- package/dist/components/{p-B0lK-5c_.js → p-B2bD-55K.js} +1 -1
- package/dist/components/{p-Bs5AIefE.js → p-BI5NL1Rh.js} +1 -1
- package/dist/components/{p-Be01Kv65.js → p-BPXRokES.js} +1 -1
- package/dist/components/{p-oZMLGlUq.js → p-BULuujHY.js} +1 -1
- package/dist/components/{p-B6EgLMus.js → p-BWlX-Nz-.js} +1 -1
- package/dist/components/p-Bc5HIbcj.js +5 -0
- package/dist/components/p-BcWJAP8j.js +5 -0
- package/dist/components/p-BpB_86n0.js +5 -0
- package/dist/components/p-BpHkd1L9.js +5 -0
- package/dist/components/{p-B0tcNl8W.js → p-BsnGFZeT.js} +1 -1
- package/dist/components/{p-B_jDD5xI.js → p-BvLVCp-j.js} +1 -1
- package/dist/components/p-C3KLOUbk.js +5 -0
- package/dist/components/{p-DgJ9CCPI.js → p-CJtTHErI.js} +1 -1
- package/dist/components/{p-DcB3e3j1.js → p-CMAmzdM7.js} +1 -1
- package/dist/components/p-CVpbr1tR.js +5 -0
- package/dist/components/{p-BVdlf8rx.js → p-CXbi5iPZ.js} +1 -1
- package/dist/components/p-C_1_eN4N.js +5 -0
- package/dist/components/{p-TtDq4UV5.js → p-Ce2mazYo.js} +1 -1
- package/dist/components/p-Cg6Prz81.js +5 -0
- package/dist/components/{p-l738xIxs.js → p-Cpjvk1pk.js} +1 -1
- package/dist/components/p-CqJiXtPb.js +5 -0
- package/dist/components/p-CrPyvAdX.js +5 -0
- package/dist/components/{p-C31A3MHr.js → p-CsU_c7eX.js} +1 -1
- package/dist/components/{p-Ci6k5mSb.js → p-D42YuMNZ.js} +1 -1
- package/dist/components/{p-Dhi7g1w3.js → p-DCpRGVqe.js} +1 -1
- package/dist/components/{p-D9pKibY5.js → p-DCsMDWbS.js} +1 -1
- package/dist/components/{p-BMnQwtNn.js → p-DQ0uTCi2.js} +1 -1
- package/dist/components/p-DTmI_Yx0.js +5 -0
- package/dist/components/p-DnspXuVN.js +5 -0
- package/dist/components/p-DqSdjh2n.js +5 -0
- package/dist/components/p-Dv2j7fhS.js +5 -0
- package/dist/components/{p-BUczNscD.js → p-K-OF4DG-.js} +1 -1
- package/dist/components/p-KSvRVGk-.js +5 -0
- package/dist/components/p-KbiYvxzP.js +5 -0
- package/dist/components/{p-DG-IgRFW.js → p-OY4Ixaeq.js} +1 -1
- package/dist/components/{p-BiaT4YFg.js → p-SIS25ChD.js} +1 -1
- package/dist/components/p-Wgb4y0H3.js +5 -0
- package/dist/components/p-X3AzJ0KD.js +5 -0
- package/dist/components/{p-gzdpekMI.js → p-bCeQwUKM.js} +1 -1
- package/dist/components/p-d3ZIPeEC.js +5 -0
- package/dist/components/{p-DlqfD7uh.js → p-ikaUQvOO.js} +1 -1
- package/dist/components/p-mbVTvSJF.js +5 -0
- package/dist/components/{p-DTdm5I7a.js → p-rQ3Z9EnS.js} +1 -1
- package/dist/components/{p-BmQrqnnJ.js → p-uYkn8a0m.js} +1 -1
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.js +1 -1
- package/dist/components/shift-accordion.js +1 -1
- package/dist/components/shift-checkbox.js +1 -1
- package/dist/components/shift-portal.js +1 -1
- package/dist/components/shift-select-dropdown.js +1 -1
- package/dist/components/shift-select.js +1 -1
- package/dist/components/shift-slider.js +1 -1
- package/dist/components/shift-switch.js +1 -1
- package/dist/components/shift-tab-content.js +1 -1
- package/dist/components/shift-tabs.js +1 -1
- package/dist/components/ssc-lookup-form.js +1 -1
- package/dist/components/test-drive-form.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-claimable-items.js +1 -1
- package/dist/components/vehicle-item-claim-form.js +1 -1
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-paint-thickness.js +1 -1
- package/dist/components/vehicle-quotation-form.js +1 -1
- package/dist/components/vehicle-sale-information.js +1 -1
- package/dist/components/vehicle-service-history.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/vehicle-warranty-details.js +1 -1
- package/dist/components/vehicle-warranty-timeline.js +1 -1
- package/dist/components/vin-extractor.js +1 -1
- package/dist/esm/{branch-slot-dropdown_15.entry.js → branch-date-dropdown_17.entry.js} +957 -69
- package/dist/esm/dead-stock-lookup_3.entry.js +9 -9
- package/dist/esm/flexible-container.entry.js +3 -3
- package/dist/esm/form-checkbox.entry.js +2 -2
- package/dist/esm/form-date-picker.entry.js +5 -5
- package/dist/esm/form-input_7.entry.js +21 -19
- package/dist/esm/form-switch.entry.js +2 -2
- package/dist/esm/form-time-picker.entry.js +6 -6
- package/dist/esm/{functions-COLiDjnd.js → functions-DSwc1YVL.js} +44 -20
- package/dist/esm/general-form.entry.js +6 -6
- package/dist/esm/general-inquiry-form.entry.js +6 -6
- package/dist/esm/{get-local-language-CACck9dv.js → get-local-language-DdSAPSCV.js} +1 -1
- package/dist/esm/{get-mock-files-BEIYZlS_.js → get-mock-files-D4naDetb.js} +1 -1
- package/dist/esm/information-table.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-spinner.entry.js +2 -2
- package/dist/esm/manufacturer-part-lookup.entry.js +3 -3
- package/dist/esm/{mappers-9IKbvPiR.js → mappers-CZs2R7k6.js} +54 -18
- package/dist/esm/part-lookup.entry.js +2 -2
- package/dist/esm/service-booking-form.entry.js +6 -6
- package/dist/esm/shift-accordion.entry.js +2 -2
- package/dist/esm/shift-checkbox.entry.js +2 -2
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/shift-slider.entry.js +1 -1
- package/dist/esm/shift-switch.entry.js +2 -2
- package/dist/esm/shift-tab-content.entry.js +2 -2
- package/dist/esm/shift-tabs_2.entry.js +92 -34
- package/dist/esm/ssc-lookup-form.entry.js +6 -6
- package/dist/esm/test-drive-form.entry.js +6 -6
- package/dist/esm/triangle-alert-BlnfPzWh.js +237 -0
- package/dist/esm/vehicle-accessories_8.entry.js +177 -117
- package/dist/esm/vehicle-lookup.entry.js +3 -3
- package/dist/esm/vehicle-quotation-form.entry.js +17 -18
- package/dist/integration-manifest.json +1 -1
- package/dist/locales/vehicleLookup/serviceHistory/en.json +2 -2
- package/dist/shift-components/{p-a91ed0fc.entry.js → p-0b576888.entry.js} +1 -1
- package/dist/shift-components/p-11ffa908.entry.js +5 -0
- package/dist/shift-components/{p-b2048d87.entry.js → p-152057de.entry.js} +1 -1
- package/dist/shift-components/p-198333fa.entry.js +5 -0
- package/dist/shift-components/{p-537507ee.entry.js → p-247ac2db.entry.js} +1 -1
- package/dist/shift-components/{p-1923fdb9.entry.js → p-295e445f.entry.js} +1 -1
- package/dist/shift-components/p-431522f2.entry.js +5 -0
- package/dist/shift-components/{p-b1270d98.entry.js → p-49dc6d73.entry.js} +1 -1
- package/dist/shift-components/{p-ac91d4ce.entry.js → p-4b6f801a.entry.js} +1 -1
- package/dist/shift-components/{p-6263bc0c.entry.js → p-4cdeab63.entry.js} +1 -1
- package/dist/shift-components/{p-829f24b9.entry.js → p-52530fba.entry.js} +1 -1
- package/dist/shift-components/p-5ad4d072.entry.js +5 -0
- package/dist/shift-components/{p-a0d13479.entry.js → p-5e8e5ed7.entry.js} +1 -1
- package/dist/shift-components/{p-65aad39b.entry.js → p-68e41217.entry.js} +1 -1
- package/dist/shift-components/{p-f2b86186.entry.js → p-76b0ea8c.entry.js} +1 -1
- package/dist/shift-components/{p-fdf94f65.entry.js → p-85d43a41.entry.js} +1 -1
- package/dist/shift-components/p-B9INqdFT.js +5 -0
- package/dist/shift-components/p-BkVfhjgg.js +5 -0
- package/dist/shift-components/{p--JyU3LyU.js → p-D2Ofzg_i.js} +1 -1
- package/dist/shift-components/p-DDtDRGFL.js +5 -0
- package/dist/shift-components/{p-jmNTa9tM.js → p-OfPuHUYc.js} +1 -1
- package/dist/shift-components/p-b44b2c00.entry.js +5 -0
- package/dist/shift-components/{p-48a9feb9.entry.js → p-b4544d10.entry.js} +1 -1
- package/dist/shift-components/{p-853f1b8b.entry.js → p-bfe0661c.entry.js} +1 -1
- package/dist/shift-components/{p-e7a99998.entry.js → p-c7fc8d5f.entry.js} +1 -1
- package/dist/shift-components/{p-bb172fc4.entry.js → p-ca0683e9.entry.js} +1 -1
- package/dist/shift-components/{p-cfcfdb20.entry.js → p-cbdc1c2e.entry.js} +1 -1
- package/dist/shift-components/p-d3bbba07.entry.js +5 -0
- package/dist/shift-components/{p-ec2a7d65.entry.js → p-df0c7ac1.entry.js} +1 -1
- package/dist/shift-components/p-f4679148.entry.js +5 -0
- package/dist/shift-components/{p-c4cf0a18.entry.js → p-feb443ec.entry.js} +1 -1
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/stencil-docs.json +1677 -12
- package/dist/templates/production-host/vehicle-service-history.html +14 -0
- package/dist/types/components/form-elements/branch-date-dropdown.d.ts +74 -0
- package/dist/types/components/form-elements/branch-date-picker.d.ts +174 -0
- package/dist/types/components/form-elements/branch-slot-dropdown.d.ts +6 -0
- package/dist/types/components/form-elements/branch-slot-picker.d.ts +27 -0
- package/dist/types/components/forms/defaults/mappers.d.ts +15 -9
- package/dist/types/components/vehicle-lookup/components/claimable-item-popover.d.ts +10 -1
- package/dist/types/components/vehicle-lookup/components/claimable-trace-modal.d.ts +3 -0
- package/dist/types/components/vehicle-lookup/vehicle-claimable-items.d.ts +14 -4
- package/dist/types/components/vehicle-lookup/vehicle-item-claim-form.d.ts +23 -3
- package/dist/types/components.d.ts +533 -6
- package/dist/types/features/form-hook/functions.d.ts +14 -0
- package/dist/types/global/lib/overlay.d.ts +61 -0
- package/dist/types/global/lib/slot-day-rules.d.ts +25 -0
- package/dist/types/locales/vehicleLookup/serviceHistory/type.d.ts +2 -2
- package/dist/types/locales/vehicleLookup/warrantyTimeline/type.d.ts +4 -4
- package/dist/types/locales/vehicleLookup/wrapper-type.d.ts +2 -2
- package/package.json +15 -3
- package/dist/cjs/triangle-alert-BjQBwsRv.js +0 -92
- package/dist/components/p-BQHywBX6.js +0 -5
- package/dist/components/p-Bb4mauUH.js +0 -5
- package/dist/components/p-Bl_BMBad.js +0 -5
- package/dist/components/p-BogCz_yJ.js +0 -5
- package/dist/components/p-BvFDjUZZ.js +0 -5
- package/dist/components/p-C2trAVtF.js +0 -5
- package/dist/components/p-CCuYl9VQ.js +0 -5
- package/dist/components/p-CNqcMKLv.js +0 -5
- package/dist/components/p-CZWmJ1vV.js +0 -5
- package/dist/components/p-Cg4l7ICV.js +0 -5
- package/dist/components/p-Ci6LbIzY.js +0 -5
- package/dist/components/p-CuTemmgW.js +0 -5
- package/dist/components/p-D0oXezbg.js +0 -5
- package/dist/components/p-DBKG_o1-.js +0 -5
- package/dist/components/p-Dlm9wHfQ.js +0 -5
- package/dist/components/p-DsMy6H9e.js +0 -5
- package/dist/components/p-Dseg250d.js +0 -5
- package/dist/components/p-EVz84xxv.js +0 -5
- package/dist/components/p-SnXklPq9.js +0 -5
- package/dist/components/p-k8G1hnHC.js +0 -5
- package/dist/components/p-uPiGNvhQ.js +0 -5
- package/dist/esm/triangle-alert-Brtqhx2d.js +0 -86
- package/dist/shift-components/p-34dffc00.entry.js +0 -5
- package/dist/shift-components/p-6fa1121c.entry.js +0 -5
- package/dist/shift-components/p-782fe0e1.entry.js +0 -5
- package/dist/shift-components/p-9a6450f6.entry.js +0 -5
- package/dist/shift-components/p-B9kqtQjS.js +0 -5
- package/dist/shift-components/p-D0Md1Xf7.js +0 -5
- package/dist/shift-components/p-c66b18c9.entry.js +0 -5
- package/dist/shift-components/p-c9a7e5ab.entry.js +0 -5
- package/dist/shift-components/p-fa7a961c.entry.js +0 -5
- package/dist/shift-components/p-hABirfUj.js +0 -5
- /package/dist/collection/templates/{vehicle-lookup → prototypes}/prototype-assets/extended-warranty/adp-logo.svg +0 -0
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The landing page's top bar, as one implementation that two pages can mount.
|
|
3
|
+
*
|
|
4
|
+
* It used to be 340 lines of markup inside src/index.html plus the half of
|
|
5
|
+
* `landing()` that fed it. A second documentation page needed the same
|
|
6
|
+
* navigation, and the only honest way to give it one is to have one copy — so
|
|
7
|
+
* the markup, the state and the path arithmetic all live here, and index.html
|
|
8
|
+
* renders this rather than owning it.
|
|
9
|
+
*
|
|
10
|
+
* ── Mounting ──────────────────────────────────────────────────────────────────
|
|
11
|
+
* A page with no Alpine state of its own needs one module tag and nothing else:
|
|
12
|
+
*
|
|
13
|
+
* <script src="/templates/harness-theme.js"></script>
|
|
14
|
+
* <script src="/templates/site-locales.js"></script>
|
|
15
|
+
* <script type="module">
|
|
16
|
+
* import { mountSiteHeader } from '../site-header.js';
|
|
17
|
+
* mountSiteHeader();
|
|
18
|
+
* </script>
|
|
19
|
+
* <script defer src="/templates/vendor/alpine.js"></script>
|
|
20
|
+
*
|
|
21
|
+
* That stamps the header wrapped in its own `x-data` scope. Order matters twice
|
|
22
|
+
* over. The two classic scripts are BLOCKING because theme and text direction
|
|
23
|
+
* are decided before first paint. And this module must sit ahead of the Alpine
|
|
24
|
+
* tag: deferred and module scripts share one queue in document order, Alpine
|
|
25
|
+
* evaluates `x-data` at walk time, and a module behind it stamps markup that
|
|
26
|
+
* Alpine has already walked past.
|
|
27
|
+
*
|
|
28
|
+
* A page that already has a scope covering the header passes
|
|
29
|
+
* `{ alpineScope: false }` and builds its own data object out of `siteHeader()`.
|
|
30
|
+
* index.html does, because `landing()` drives the body from the same catalog and
|
|
31
|
+
* the `:inert` on <main> and <footer> reads the header's `mobile` — a second
|
|
32
|
+
* nested scope would shadow it.
|
|
33
|
+
*
|
|
34
|
+
* ── Paths ─────────────────────────────────────────────────────────────────────
|
|
35
|
+
* Catalog paths are site-absolute (`/templates/…`), which only resolves when the
|
|
36
|
+
* site IS the server root. index.html sits at depth 0, a demo page at depth 2,
|
|
37
|
+
* and the built site can be mounted under any prefix — so every path is
|
|
38
|
+
* re-resolved against the directory this module was loaded from. `nav.js` and
|
|
39
|
+
* `harness.js` carry the same two lines for the same reason: the release build
|
|
40
|
+
* rewrites `src=` and `href=` attributes but never an import specifier or a
|
|
41
|
+
* string, so anything computed has to compute itself.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/** The site root: this file is always <root>/templates/site-header.js. */
|
|
45
|
+
const SITE_ROOT = new URL('../', import.meta.url);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* How far the CURRENT page sits below that root, as a relative prefix.
|
|
49
|
+
*
|
|
50
|
+
* Relative, rather than the absolute `.pathname` that nav.js produces, because
|
|
51
|
+
* index.html's own `site()` produced relative hrefs and this has to render the
|
|
52
|
+
* identical attribute. Depth 0 gives '', depth 2 gives '../../', and a mount
|
|
53
|
+
* under /docs/ cancels out of both sides.
|
|
54
|
+
*/
|
|
55
|
+
const PATH_PREFIX = (() => {
|
|
56
|
+
const root = SITE_ROOT.pathname;
|
|
57
|
+
const here = new URL('.', window.location.href).pathname;
|
|
58
|
+
const depth = here.startsWith(root) ? here.slice(root.length).split('/').filter(Boolean).length : 0;
|
|
59
|
+
|
|
60
|
+
return '../'.repeat(depth);
|
|
61
|
+
})();
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
* The three product areas, in presentation order. Declared here rather than read
|
|
65
|
+
* from the catalog on purpose: a group with nothing published has no catalog
|
|
66
|
+
* entry at all, and disappearing from the menu is a different message from "the
|
|
67
|
+
* demo is pending".
|
|
68
|
+
*/
|
|
69
|
+
const COMPONENT_GROUPS = ['vehicle-lookup', 'part-lookup', 'forms'];
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Neither file the header reads is required to exist: the build stamp ships only
|
|
73
|
+
* in a released site, and the catalog only after `npm start` or `npm run
|
|
74
|
+
* release` has run. Either one failing has to leave a readable page.
|
|
75
|
+
*/
|
|
76
|
+
async function read(url) {
|
|
77
|
+
try {
|
|
78
|
+
const response = await fetch(url);
|
|
79
|
+
|
|
80
|
+
return response.ok ? await response.json() : null;
|
|
81
|
+
} catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The header's Alpine state, plus anything the host page adds.
|
|
88
|
+
*
|
|
89
|
+
* `extra` is merged through property DESCRIPTORS rather than spread, because a
|
|
90
|
+
* spread invokes every getter and copies the result — `version`, `groups` and
|
|
91
|
+
* `pageCount` here, and several more on the page that hosts this, would all
|
|
92
|
+
* freeze at their boot-time values.
|
|
93
|
+
*/
|
|
94
|
+
export function siteHeader(extra = {}) {
|
|
95
|
+
if (!window.siteLocales || !window.harnessTheme) {
|
|
96
|
+
throw new Error('site-header.js needs templates/site-locales.js and templates/harness-theme.js loaded (blocking, in <head>) before it runs');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const state = {
|
|
100
|
+
catalog: { areas: [], pages: [] },
|
|
101
|
+
build: null,
|
|
102
|
+
language: window.siteLocales.current(),
|
|
103
|
+
languages: window.siteLocales.languages,
|
|
104
|
+
theme: window.harnessTheme.current(),
|
|
105
|
+
open: null,
|
|
106
|
+
mobile: false,
|
|
107
|
+
expanded: null,
|
|
108
|
+
filter: '',
|
|
109
|
+
|
|
110
|
+
async init() {
|
|
111
|
+
const [catalog, build] = await Promise.all([read(new URL('catalog.json', import.meta.url)), read(new URL('build-info.json', SITE_ROOT))]);
|
|
112
|
+
|
|
113
|
+
if (catalog) this.catalog = catalog;
|
|
114
|
+
if (build) this.build = build;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
/* ---------- copy ---------- */
|
|
118
|
+
|
|
119
|
+
t(key) {
|
|
120
|
+
return window.siteLocales.t(this.language, key);
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
get languageLabel() {
|
|
124
|
+
return this.languages.find(option => option.code === this.language)?.label ?? this.language;
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
/* ---------- catalog ---------- */
|
|
128
|
+
|
|
129
|
+
/*
|
|
130
|
+
* The build stamp first. It records the version the site was BUILT against,
|
|
131
|
+
* which is a published one; catalog.json carries package.json's version,
|
|
132
|
+
* which is whatever is being prepared next and is routinely not installable
|
|
133
|
+
* yet.
|
|
134
|
+
*/
|
|
135
|
+
get version() {
|
|
136
|
+
return this.build?.componentVersion ?? this.catalog.package?.version ?? '';
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
get pageCount() {
|
|
140
|
+
return this.catalog.pages.length;
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
get groups() {
|
|
144
|
+
const needle = this.filter.trim().toLowerCase();
|
|
145
|
+
|
|
146
|
+
return COMPONENT_GROUPS.map(id => ({
|
|
147
|
+
id,
|
|
148
|
+
label: this.t('groups.' + id),
|
|
149
|
+
blurb: this.t('blurb.' + id),
|
|
150
|
+
pages: this.catalog.pages.filter(page => page.area === id && (!needle || (page.title + ' ' + page.path).toLowerCase().includes(needle))),
|
|
151
|
+
}));
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
/* ---------- controls ---------- */
|
|
155
|
+
|
|
156
|
+
toggle(id) {
|
|
157
|
+
this.open = this.open === id ? null : id;
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
expand(id) {
|
|
161
|
+
this.expanded = this.expanded === id ? null : id;
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
setLanguage(code) {
|
|
165
|
+
this.language = window.siteLocales.apply(code);
|
|
166
|
+
this.open = null;
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
setTheme(theme) {
|
|
170
|
+
this.theme = theme;
|
|
171
|
+
window.harnessTheme.apply(theme);
|
|
172
|
+
this.open = null;
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
/** A catalog path, as an href valid from wherever this page sits. */
|
|
176
|
+
// Is this catalog page the one being viewed? Resolved against the document so it
|
|
177
|
+
// survives any mount depth, and tolerant of the trailing-slash/.html rewriting the
|
|
178
|
+
// host does — /forms/ticket-forms, /forms/ticket-forms.html and /forms/ticket-forms/
|
|
179
|
+
// are the same page.
|
|
180
|
+
isCurrentPage(path) {
|
|
181
|
+
if (typeof window === 'undefined' || !path) return false;
|
|
182
|
+
|
|
183
|
+
const strip = p =>
|
|
184
|
+
p
|
|
185
|
+
.replace(/\/index\.html$/, '/')
|
|
186
|
+
.replace(/\.html$/, '')
|
|
187
|
+
.replace(/\/$/, '');
|
|
188
|
+
|
|
189
|
+
try {
|
|
190
|
+
return strip(new URL(this.site(path), window.location.href).pathname) === strip(window.location.pathname);
|
|
191
|
+
} catch {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
site(value) {
|
|
197
|
+
const relative = PATH_PREFIX + String(value).replace(/^\//, '');
|
|
198
|
+
|
|
199
|
+
return relative || './';
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
Object.defineProperties(state, Object.getOwnPropertyDescriptors(extra));
|
|
204
|
+
|
|
205
|
+
return state;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/*
|
|
209
|
+
* Alpine resolves `x-data` against the global scope, and index.html's page script
|
|
210
|
+
* is a CLASSIC script that cannot import — the same reason window.adpHighlight
|
|
211
|
+
* exists. So the factory is hung on window as well as exported.
|
|
212
|
+
*/
|
|
213
|
+
window.siteHeader = siteHeader;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The markup, lifted out of index.html — comments included, because they explain
|
|
217
|
+
* choices the classes do not. The indentation is the six spaces it had in that
|
|
218
|
+
* file, so the rendered DOM is what index.html produced before the extraction.
|
|
219
|
+
*
|
|
220
|
+
* ── The padding on the three popovers is geometry, not taste ──────────────────
|
|
221
|
+
* Concentric corners only look concentric when the outer radius equals the inner
|
|
222
|
+
* radius plus the padding between them. All three popovers are `rounded-box`
|
|
223
|
+
* (--radius-box, 12px), so:
|
|
224
|
+
*
|
|
225
|
+
* groups menu rows are rounded-lg (8px) -> p-1 (4px). 4 + 8 = 12
|
|
226
|
+
* language menu daisyUI menu rows take -> p-1.5 (6px). 6 + 6 = 12
|
|
227
|
+
* theme menu --radius-field (6px) -> p-1.5 (6px). 6 + 6 = 12
|
|
228
|
+
*
|
|
229
|
+
* Round the padding off to a "tidier" number and the rows stop tracking the
|
|
230
|
+
* shell: too little and they look square inside a round box, too much and the
|
|
231
|
+
* corners read as two unrelated curves. If --radius-box or --radius-field moves
|
|
232
|
+
* in harness.src.css, these three move with it.
|
|
233
|
+
*/
|
|
234
|
+
const MARKUP = /* html */ `
|
|
235
|
+
<header class="bg-base-100/90 border-base-300 sticky top-0 z-30 border-b backdrop-blur">
|
|
236
|
+
<div class="mx-auto flex max-w-[1240px] items-center gap-3 px-5 py-2.5 sm:px-8">
|
|
237
|
+
<!--
|
|
238
|
+
The wordmark sits on a gold TILE rather than being painted gold.
|
|
239
|
+
#F9CB4B measures 1.54:1 against white, so gold text is not a brand
|
|
240
|
+
colour on a light page, it is invisible text — which is why the
|
|
241
|
+
stylesheet splits the brand into \`primary\` (fills) and \`accent\`
|
|
242
|
+
(anything that must read as a colour). A fill carrying ink is the one
|
|
243
|
+
place the real gold appears at full strength: 10.48:1, and it matches
|
|
244
|
+
the favicon and the docs site.
|
|
245
|
+
-->
|
|
246
|
+
<a :href="site('/')" class="group flex shrink-0 items-center gap-3" :aria-label="t('nav.home')">
|
|
247
|
+
<span class="bg-primary flex items-center justify-center rounded-lg px-2.5 py-2 transition-opacity group-hover:opacity-85">
|
|
248
|
+
<span class="adp-logo text-primary-content h-4 w-[42px]" aria-hidden="true"></span>
|
|
249
|
+
</span>
|
|
250
|
+
<span class="hidden text-base font-semibold tracking-tight sm:inline">
|
|
251
|
+
<span>SHFT</span>
|
|
252
|
+
<span class="text-base-content/60 group-hover:text-base-content font-normal transition-colors">your day</span>
|
|
253
|
+
</span>
|
|
254
|
+
</a>
|
|
255
|
+
|
|
256
|
+
<span class="badge badge-sm badge-ghost font-mono" x-show="version" x-text="'v' + version"></span>
|
|
257
|
+
|
|
258
|
+
<!-- ── wide: inline controls ── -->
|
|
259
|
+
<div class="ms-auto hidden items-center gap-1 lg:flex" @click.outside="open = null">
|
|
260
|
+
<div class="relative">
|
|
261
|
+
<button type="button" class="btn btn-sm btn-ghost gap-1.5" :aria-expanded="open === 'groups'" aria-controls="menu-groups" @click="toggle('groups')">
|
|
262
|
+
<span x-text="t('nav.components')"></span>
|
|
263
|
+
<svg
|
|
264
|
+
class="h-3 w-3 opacity-60 transition-transform"
|
|
265
|
+
:class="open === 'groups' && 'rotate-180'"
|
|
266
|
+
viewBox="0 0 24 24"
|
|
267
|
+
fill="none"
|
|
268
|
+
stroke="currentColor"
|
|
269
|
+
stroke-width="2.5"
|
|
270
|
+
stroke-linecap="round"
|
|
271
|
+
aria-hidden="true"
|
|
272
|
+
>
|
|
273
|
+
<path d="m6 9 6 6 6-6" />
|
|
274
|
+
</svg>
|
|
275
|
+
</button>
|
|
276
|
+
|
|
277
|
+
<div
|
|
278
|
+
id="menu-groups"
|
|
279
|
+
class="bg-base-100 border-base-300 rounded-box absolute end-0 top-full z-50 mt-1 max-h-[70vh] w-[min(24rem,calc(100vw-2rem))] overflow-y-auto border p-1 shadow-xl"
|
|
280
|
+
x-show="open === 'groups'"
|
|
281
|
+
x-cloak
|
|
282
|
+
x-transition:enter="transition ease-out duration-150"
|
|
283
|
+
x-transition:enter-start="opacity-0 -translate-y-1"
|
|
284
|
+
x-transition:leave="transition ease-in duration-100"
|
|
285
|
+
x-transition:leave-end="opacity-0"
|
|
286
|
+
>
|
|
287
|
+
<label class="input input-sm mb-2 w-full" x-show="pageCount > 7">
|
|
288
|
+
<svg class="h-4 w-4 opacity-50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
289
|
+
<circle cx="11" cy="11" r="7" />
|
|
290
|
+
<path d="m20 20-3.5-3.5" stroke-linecap="round" />
|
|
291
|
+
</svg>
|
|
292
|
+
<input x-model="filter" type="search" :placeholder="t('nav.filter')" :aria-label="t('nav.filter')" />
|
|
293
|
+
</label>
|
|
294
|
+
|
|
295
|
+
<template x-for="group in groups" :key="group.id">
|
|
296
|
+
<div>
|
|
297
|
+
<!--
|
|
298
|
+
Three shapes, because a group's page count changes what the
|
|
299
|
+
row IS. None: a label, not a control — there is nothing to
|
|
300
|
+
open. One: a link, because a disclosure revealing a single
|
|
301
|
+
item is a click for nothing. More: a closed disclosure.
|
|
302
|
+
-->
|
|
303
|
+
<template x-if="!group.pages.length && !filter">
|
|
304
|
+
<p class="flex items-center justify-between gap-2 px-3 py-2">
|
|
305
|
+
<span class="text-base-content/70 text-sm" x-text="group.label"></span>
|
|
306
|
+
<span class="badge badge-xs badge-outline shrink-0" x-text="t('components.soon')"></span>
|
|
307
|
+
</p>
|
|
308
|
+
</template>
|
|
309
|
+
|
|
310
|
+
<template x-if="group.pages.length === 1">
|
|
311
|
+
<a
|
|
312
|
+
:href="site(group.pages[0].path)"
|
|
313
|
+
class="hover:bg-base-200 flex items-center justify-between gap-2 rounded-lg px-3 py-2 text-sm transition-colors"
|
|
314
|
+
:class="isCurrentPage(group.pages[0].path) && 'bg-primary/15 font-semibold'"
|
|
315
|
+
:aria-current="isCurrentPage(group.pages[0].path) ? 'page' : null"
|
|
316
|
+
>
|
|
317
|
+
<span x-text="group.label"></span>
|
|
318
|
+
<span class="text-base-content/65 truncate text-xs" x-text="group.pages[0].title"></span>
|
|
319
|
+
</a>
|
|
320
|
+
</template>
|
|
321
|
+
|
|
322
|
+
<template x-if="group.pages.length > 1">
|
|
323
|
+
<div>
|
|
324
|
+
<button
|
|
325
|
+
type="button"
|
|
326
|
+
class="hover:bg-base-200 flex w-full items-center gap-2 rounded-lg px-3 py-2 text-start text-sm transition-colors"
|
|
327
|
+
:aria-expanded="expanded === group.id"
|
|
328
|
+
:class="group.pages.some(p => isCurrentPage(p.path)) && 'font-semibold'"
|
|
329
|
+
@click="expand(group.id)"
|
|
330
|
+
>
|
|
331
|
+
<svg
|
|
332
|
+
class="h-3 w-3 shrink-0 opacity-50 transition-transform rtl:-scale-x-100"
|
|
333
|
+
:class="expanded === group.id && 'rotate-90'"
|
|
334
|
+
viewBox="0 0 24 24"
|
|
335
|
+
fill="none"
|
|
336
|
+
stroke="currentColor"
|
|
337
|
+
stroke-width="2.5"
|
|
338
|
+
stroke-linecap="round"
|
|
339
|
+
aria-hidden="true"
|
|
340
|
+
>
|
|
341
|
+
<path d="m9 6 6 6-6 6" />
|
|
342
|
+
</svg>
|
|
343
|
+
<span x-text="group.label"></span>
|
|
344
|
+
<span class="badge badge-xs badge-ghost ms-auto tabular-nums" x-text="group.pages.length"></span>
|
|
345
|
+
</button>
|
|
346
|
+
|
|
347
|
+
<ul
|
|
348
|
+
class="menu menu-sm w-full p-0 ps-4"
|
|
349
|
+
x-show="expanded === group.id"
|
|
350
|
+
x-transition:enter="transition ease-out duration-150"
|
|
351
|
+
x-transition:enter-start="opacity-0 -translate-y-1"
|
|
352
|
+
x-transition:leave="transition ease-in duration-100"
|
|
353
|
+
x-transition:leave-end="opacity-0"
|
|
354
|
+
>
|
|
355
|
+
<template x-for="page in group.pages" :key="page.path">
|
|
356
|
+
<li>
|
|
357
|
+
<a
|
|
358
|
+
:href="site(page.path)"
|
|
359
|
+
class="truncate"
|
|
360
|
+
:class="isCurrentPage(page.path) && 'bg-primary/15 font-semibold'"
|
|
361
|
+
:aria-current="isCurrentPage(page.path) ? 'page' : null"
|
|
362
|
+
x-text="page.title"
|
|
363
|
+
></a>
|
|
364
|
+
</li>
|
|
365
|
+
</template>
|
|
366
|
+
</ul>
|
|
367
|
+
</div>
|
|
368
|
+
</template>
|
|
369
|
+
</div>
|
|
370
|
+
</template>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
<a class="btn btn-sm btn-ghost" href="https://adp.shift.software/" target="_blank" rel="noreferrer" x-text="t('nav.docs')"></a>
|
|
375
|
+
|
|
376
|
+
<span class="bg-base-300 mx-1 h-6 w-px" aria-hidden="true"></span>
|
|
377
|
+
|
|
378
|
+
<div class="relative">
|
|
379
|
+
<!-- The accessible name carries the CURRENT value, not just the
|
|
380
|
+
category: a bare aria-label="Language" overrides the visible
|
|
381
|
+
"English", so voice control cannot reach it by what it says. -->
|
|
382
|
+
<button
|
|
383
|
+
type="button"
|
|
384
|
+
class="btn btn-sm btn-ghost gap-1.5"
|
|
385
|
+
:aria-expanded="open === 'language'"
|
|
386
|
+
aria-controls="menu-language"
|
|
387
|
+
:aria-label="t('nav.language') + ': ' + languageLabel"
|
|
388
|
+
@click="toggle('language')"
|
|
389
|
+
>
|
|
390
|
+
<svg class="h-4 w-4 opacity-70" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
391
|
+
<circle cx="12" cy="12" r="9" />
|
|
392
|
+
<path d="M3.5 9h17M3.5 15h17M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18" />
|
|
393
|
+
</svg>
|
|
394
|
+
<span :lang="language" x-text="languageLabel"></span>
|
|
395
|
+
</button>
|
|
396
|
+
|
|
397
|
+
<ul
|
|
398
|
+
id="menu-language"
|
|
399
|
+
class="menu menu-sm bg-base-100 border-base-300 rounded-box absolute end-0 top-full z-50 mt-1 w-44 border p-1.5 shadow-xl"
|
|
400
|
+
x-show="open === 'language'"
|
|
401
|
+
x-cloak
|
|
402
|
+
x-transition:enter="transition ease-out duration-150"
|
|
403
|
+
x-transition:enter-start="opacity-0 -translate-y-1"
|
|
404
|
+
x-transition:leave="transition ease-in duration-100"
|
|
405
|
+
x-transition:leave-end="opacity-0"
|
|
406
|
+
>
|
|
407
|
+
<template x-for="option in languages" :key="option.code">
|
|
408
|
+
<li>
|
|
409
|
+
<button
|
|
410
|
+
type="button"
|
|
411
|
+
:class="language === option.code && 'menu-active'"
|
|
412
|
+
:aria-current="language === option.code ? 'true' : null"
|
|
413
|
+
@click="setLanguage(option.code)"
|
|
414
|
+
>
|
|
415
|
+
<span :lang="option.code" x-text="option.label"></span>
|
|
416
|
+
<span class="badge badge-xs badge-ghost ms-auto font-mono uppercase" x-text="option.code"></span>
|
|
417
|
+
</button>
|
|
418
|
+
</li>
|
|
419
|
+
</template>
|
|
420
|
+
</ul>
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
<div class="relative">
|
|
424
|
+
<button
|
|
425
|
+
type="button"
|
|
426
|
+
class="btn btn-sm btn-ghost gap-1.5"
|
|
427
|
+
:aria-expanded="open === 'theme'"
|
|
428
|
+
aria-controls="menu-theme"
|
|
429
|
+
:aria-label="t('nav.theme') + ': ' + t('theme.' + theme)"
|
|
430
|
+
@click="toggle('theme')"
|
|
431
|
+
>
|
|
432
|
+
<svg class="h-4 w-4 opacity-70" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
|
|
433
|
+
<circle cx="12" cy="12" r="4.5" />
|
|
434
|
+
<path d="M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.2 5.2l1.4 1.4M17.4 17.4l1.4 1.4M18.8 5.2l-1.4 1.4M6.6 17.4l-1.4 1.4" />
|
|
435
|
+
</svg>
|
|
436
|
+
<span x-text="t('theme.' + theme)"></span>
|
|
437
|
+
</button>
|
|
438
|
+
|
|
439
|
+
<ul
|
|
440
|
+
id="menu-theme"
|
|
441
|
+
class="menu menu-sm bg-base-100 border-base-300 rounded-box absolute end-0 top-full z-50 mt-1 w-36 border p-1.5 shadow-xl"
|
|
442
|
+
x-show="open === 'theme'"
|
|
443
|
+
x-cloak
|
|
444
|
+
x-transition:enter="transition ease-out duration-150"
|
|
445
|
+
x-transition:enter-start="opacity-0 -translate-y-1"
|
|
446
|
+
x-transition:leave="transition ease-in duration-100"
|
|
447
|
+
x-transition:leave-end="opacity-0"
|
|
448
|
+
>
|
|
449
|
+
<template x-for="option in ['system', 'light', 'dark']" :key="option">
|
|
450
|
+
<li>
|
|
451
|
+
<button
|
|
452
|
+
type="button"
|
|
453
|
+
:class="theme === option && 'menu-active'"
|
|
454
|
+
:aria-current="theme === option ? 'true' : null"
|
|
455
|
+
@click="setTheme(option)"
|
|
456
|
+
x-text="t('theme.' + option)"
|
|
457
|
+
></button>
|
|
458
|
+
</li>
|
|
459
|
+
</template>
|
|
460
|
+
</ul>
|
|
461
|
+
</div>
|
|
462
|
+
</div>
|
|
463
|
+
|
|
464
|
+
<button
|
|
465
|
+
type="button"
|
|
466
|
+
class="btn btn-sm btn-ghost ms-auto lg:hidden"
|
|
467
|
+
:aria-expanded="mobile"
|
|
468
|
+
aria-controls="mobile-sheet"
|
|
469
|
+
:aria-label="t('nav.menu')"
|
|
470
|
+
@click="mobile = true"
|
|
471
|
+
>
|
|
472
|
+
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true">
|
|
473
|
+
<path d="M4 7h16M4 12h16M4 17h16" />
|
|
474
|
+
</svg>
|
|
475
|
+
</button>
|
|
476
|
+
</div>
|
|
477
|
+
</header>
|
|
478
|
+
|
|
479
|
+
<!-- ═══════════════════════════ mobile sheet ═══════════════════════════ -->
|
|
480
|
+
<div class="fixed inset-0 z-50 lg:hidden" x-show="mobile" x-cloak role="dialog" aria-modal="true" :aria-label="t('nav.menu')" id="mobile-sheet">
|
|
481
|
+
<div class="bg-base-content/40 absolute inset-0 backdrop-blur-sm" x-show="mobile" x-transition.opacity @click="mobile = false"></div>
|
|
482
|
+
|
|
483
|
+
<div
|
|
484
|
+
class="bg-base-100 absolute inset-y-0 end-0 flex w-full flex-col shadow-2xl sm:w-[22rem]"
|
|
485
|
+
x-show="mobile"
|
|
486
|
+
x-transition:enter="transition ease-out duration-200"
|
|
487
|
+
x-transition:enter-start="translate-x-full rtl:-translate-x-full"
|
|
488
|
+
x-transition:leave="transition ease-in duration-150"
|
|
489
|
+
x-transition:leave-end="translate-x-full rtl:-translate-x-full"
|
|
490
|
+
>
|
|
491
|
+
<div class="border-base-300 flex items-center justify-between border-b px-4 py-3">
|
|
492
|
+
<span class="bg-primary flex items-center justify-center rounded-lg px-2.5 py-2">
|
|
493
|
+
<span class="adp-logo text-primary-content h-4 w-[42px]" aria-hidden="true"></span>
|
|
494
|
+
</span>
|
|
495
|
+
<button type="button" class="btn btn-sm btn-ghost" :aria-label="t('nav.close')" @click="mobile = false">
|
|
496
|
+
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true">
|
|
497
|
+
<path d="M6 6l12 12M18 6L6 18" />
|
|
498
|
+
</svg>
|
|
499
|
+
</button>
|
|
500
|
+
</div>
|
|
501
|
+
|
|
502
|
+
<div class="flex-1 overflow-y-auto overscroll-contain px-4 py-4">
|
|
503
|
+
<p class="eyebrow text-base-content/65 mb-2" x-text="t('nav.components')"></p>
|
|
504
|
+
|
|
505
|
+
<template x-for="group in groups" :key="group.id">
|
|
506
|
+
<div class="mb-1">
|
|
507
|
+
<template x-if="!group.pages.length && !filter">
|
|
508
|
+
<p class="flex items-center justify-between gap-2 py-2">
|
|
509
|
+
<span class="text-base-content/70 text-sm" x-text="group.label"></span>
|
|
510
|
+
<span class="badge badge-xs badge-outline shrink-0" x-text="t('components.soon')"></span>
|
|
511
|
+
</p>
|
|
512
|
+
</template>
|
|
513
|
+
|
|
514
|
+
<template x-if="group.pages.length === 1">
|
|
515
|
+
<a
|
|
516
|
+
:href="site(group.pages[0].path)"
|
|
517
|
+
class="hover:bg-base-200 -mx-2 block rounded-lg px-2 py-2 text-sm"
|
|
518
|
+
:class="isCurrentPage(group.pages[0].path) && 'bg-primary/15 font-semibold'"
|
|
519
|
+
:aria-current="isCurrentPage(group.pages[0].path) ? 'page' : null"
|
|
520
|
+
x-text="group.label"
|
|
521
|
+
></a>
|
|
522
|
+
</template>
|
|
523
|
+
|
|
524
|
+
<template x-if="group.pages.length > 1">
|
|
525
|
+
<div>
|
|
526
|
+
<button
|
|
527
|
+
type="button"
|
|
528
|
+
class="hover:bg-base-200 -mx-2 flex w-full items-center gap-2 rounded-lg px-2 py-2 text-start text-sm"
|
|
529
|
+
:aria-expanded="expanded === group.id"
|
|
530
|
+
@click="expand(group.id)"
|
|
531
|
+
>
|
|
532
|
+
<svg
|
|
533
|
+
class="h-3 w-3 shrink-0 opacity-50 transition-transform rtl:-scale-x-100"
|
|
534
|
+
:class="expanded === group.id && 'rotate-90'"
|
|
535
|
+
viewBox="0 0 24 24"
|
|
536
|
+
fill="none"
|
|
537
|
+
stroke="currentColor"
|
|
538
|
+
stroke-width="2.5"
|
|
539
|
+
stroke-linecap="round"
|
|
540
|
+
aria-hidden="true"
|
|
541
|
+
>
|
|
542
|
+
<path d="m9 6 6 6-6 6" />
|
|
543
|
+
</svg>
|
|
544
|
+
<span x-text="group.label"></span>
|
|
545
|
+
<span class="badge badge-xs badge-ghost ms-auto tabular-nums" x-text="group.pages.length"></span>
|
|
546
|
+
</button>
|
|
547
|
+
|
|
548
|
+
<ul
|
|
549
|
+
class="menu menu-sm w-full p-0 ps-4"
|
|
550
|
+
x-show="expanded === group.id"
|
|
551
|
+
x-transition:enter="transition ease-out duration-150"
|
|
552
|
+
x-transition:enter-start="opacity-0 -translate-y-1"
|
|
553
|
+
>
|
|
554
|
+
<template x-for="page in group.pages" :key="page.path">
|
|
555
|
+
<li>
|
|
556
|
+
<a
|
|
557
|
+
:href="site(page.path)"
|
|
558
|
+
class="truncate"
|
|
559
|
+
:class="isCurrentPage(page.path) && 'bg-primary/15 font-semibold'"
|
|
560
|
+
:aria-current="isCurrentPage(page.path) ? 'page' : null"
|
|
561
|
+
x-text="page.title"
|
|
562
|
+
></a>
|
|
563
|
+
</li>
|
|
564
|
+
</template>
|
|
565
|
+
</ul>
|
|
566
|
+
</div>
|
|
567
|
+
</template>
|
|
568
|
+
</div>
|
|
569
|
+
</template>
|
|
570
|
+
|
|
571
|
+
<div class="border-base-300 mt-4 border-t pt-4">
|
|
572
|
+
<a class="btn btn-sm btn-ghost w-full justify-start" href="https://adp.shift.software/" target="_blank" rel="noreferrer" x-text="t('nav.docs')"></a>
|
|
573
|
+
</div>
|
|
574
|
+
|
|
575
|
+
<p class="eyebrow text-base-content/65 mt-6 mb-2" x-text="t('nav.language')"></p>
|
|
576
|
+
<div class="grid grid-cols-2 gap-1.5">
|
|
577
|
+
<template x-for="option in languages" :key="option.code">
|
|
578
|
+
<button
|
|
579
|
+
type="button"
|
|
580
|
+
class="btn btn-sm justify-start"
|
|
581
|
+
:class="language === option.code ? 'btn-primary' : 'btn-outline'"
|
|
582
|
+
:aria-pressed="language === option.code"
|
|
583
|
+
@click="setLanguage(option.code)"
|
|
584
|
+
>
|
|
585
|
+
<span :lang="option.code" x-text="option.label"></span>
|
|
586
|
+
</button>
|
|
587
|
+
</template>
|
|
588
|
+
</div>
|
|
589
|
+
|
|
590
|
+
<p class="eyebrow text-base-content/65 mt-6 mb-2" x-text="t('nav.theme')"></p>
|
|
591
|
+
<div class="grid grid-cols-3 gap-1.5">
|
|
592
|
+
<template x-for="option in ['system', 'light', 'dark']" :key="option">
|
|
593
|
+
<button
|
|
594
|
+
type="button"
|
|
595
|
+
class="btn btn-sm"
|
|
596
|
+
:class="theme === option ? 'btn-primary' : 'btn-outline'"
|
|
597
|
+
:aria-pressed="theme === option"
|
|
598
|
+
@click="setTheme(option)"
|
|
599
|
+
x-text="t('theme.' + option)"
|
|
600
|
+
></button>
|
|
601
|
+
</template>
|
|
602
|
+
</div>
|
|
603
|
+
</div>
|
|
604
|
+
</div>
|
|
605
|
+
</div>
|
|
606
|
+
`.trim();
|
|
607
|
+
|
|
608
|
+
/** Whether the header has already been stamped into this document. */
|
|
609
|
+
let mounted = false;
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Stamps the header — and the mobile sheet that belongs to it — into the page.
|
|
613
|
+
*
|
|
614
|
+
* target element, or selector for one, to REPLACE. Defaults to the first
|
|
615
|
+
* `[data-site-header]` placeholder; with none in the page, the
|
|
616
|
+
* header is prepended to <body>. Replaced rather than filled, so
|
|
617
|
+
* the placeholder leaves no wrapper of its own behind.
|
|
618
|
+
* alpineScope wrap the markup in its own `x-data`. Pass false when the page
|
|
619
|
+
* already has a scope built from `siteHeader()`.
|
|
620
|
+
*
|
|
621
|
+
* Returns the mounted <header>.
|
|
622
|
+
*/
|
|
623
|
+
export function mountSiteHeader({ target = '[data-site-header]', alpineScope = true } = {}) {
|
|
624
|
+
if (mounted) return document.querySelector('header');
|
|
625
|
+
|
|
626
|
+
const placeholder = typeof target === 'string' ? document.querySelector(target) : target;
|
|
627
|
+
|
|
628
|
+
// A <template> parses without executing or fetching anything, and keeps the
|
|
629
|
+
// comments and the whitespace text nodes exactly as written.
|
|
630
|
+
const parsed = document.createElement('template');
|
|
631
|
+
|
|
632
|
+
parsed.innerHTML = alpineScope ? `<div x-data="siteHeader()" @keydown.escape.window="open = null; mobile = false">\n${MARKUP}\n</div>` : MARKUP;
|
|
633
|
+
|
|
634
|
+
const nodes = [...parsed.content.childNodes];
|
|
635
|
+
|
|
636
|
+
if (placeholder) placeholder.replaceWith(...nodes);
|
|
637
|
+
else document.body.prepend(...nodes);
|
|
638
|
+
|
|
639
|
+
mounted = true;
|
|
640
|
+
|
|
641
|
+
return document.querySelector('header');
|
|
642
|
+
}
|