@duetds/components 6.0.3 → 6.0.4
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/hydrate/index.js +46 -38
- package/lib/cjs/duet-action-button.cjs.entry.js +3 -3
- package/lib/cjs/duet-alert.cjs.entry.js +1 -1
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-caption_4.cjs.entry.js +3 -3
- package/lib/cjs/duet-card.cjs.entry.js +3 -3
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
- package/lib/cjs/duet-combobox.cjs.entry.js +1 -1
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +2 -2
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +17 -14
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +1 -1
- package/lib/cjs/duet-grid_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-header_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-icon.cjs.entry.js +3 -3
- package/lib/cjs/duet-input_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +2 -2
- package/lib/cjs/duet-notification_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
- package/lib/cjs/duet-pagination_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-progress.cjs.entry.js +1 -1
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-range-slider.cjs.entry.js +2 -2
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +1 -1
- package/lib/cjs/duet-select.cjs.entry.js +1 -1
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +1 -1
- package/lib/cjs/duet-tray.cjs.entry.js +2 -2
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +1 -1
- package/lib/cjs/{focus-utils-15207057.js → focus-utils-8a615003.js} +1 -1
- package/lib/cjs/{index-28a9133b.js → index-d106d801.js} +1 -1
- package/lib/cjs/loader.cjs.js +1 -1
- package/lib/cjs/{token-utils-fef5b4eb.js → token-utils-f6e2f4ef.js} +1 -1
- package/lib/cjs/{tokens-29450bcb.js → tokens-4c69b122.js} +18 -15
- package/lib/cjs/{tokens.module-ef598645.js → tokens.module-1bb2d45e.js} +12 -10
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +1 -1
- package/lib/collection/components/duet-upload/duet-upload.js +18 -15
- package/lib/dist-custom-elements/duet-action-button.d.ts +11 -0
- package/lib/dist-custom-elements/duet-action-button.js +9 -0
- package/lib/dist-custom-elements/duet-alert.d.ts +11 -0
- package/lib/dist-custom-elements/duet-alert.js +9 -0
- package/lib/dist-custom-elements/duet-badge.d.ts +11 -0
- package/lib/dist-custom-elements/duet-badge.js +9 -0
- package/lib/dist-custom-elements/duet-breadcrumb.d.ts +11 -0
- package/lib/dist-custom-elements/duet-breadcrumb.js +73 -0
- package/lib/dist-custom-elements/duet-breadcrumbs.d.ts +11 -0
- package/lib/dist-custom-elements/duet-breadcrumbs.js +90 -0
- package/lib/dist-custom-elements/duet-button.d.ts +11 -0
- package/lib/dist-custom-elements/duet-button.js +9 -0
- package/lib/dist-custom-elements/duet-caption.d.ts +11 -0
- package/lib/dist-custom-elements/duet-caption.js +9 -0
- package/lib/dist-custom-elements/duet-card.d.ts +11 -0
- package/lib/dist-custom-elements/duet-card.js +190 -0
- package/lib/dist-custom-elements/duet-checkbox.d.ts +11 -0
- package/lib/dist-custom-elements/duet-checkbox.js +163 -0
- package/lib/dist-custom-elements/duet-choice-group.d.ts +11 -0
- package/lib/dist-custom-elements/duet-choice-group.js +226 -0
- package/lib/dist-custom-elements/duet-choice.d.ts +11 -0
- package/lib/dist-custom-elements/duet-choice.js +390 -0
- package/lib/dist-custom-elements/duet-collapsible.d.ts +11 -0
- package/lib/dist-custom-elements/duet-collapsible.js +170 -0
- package/lib/dist-custom-elements/duet-combobox.d.ts +11 -0
- package/lib/dist-custom-elements/duet-combobox.js +432 -0
- package/lib/dist-custom-elements/duet-cookie-consent.d.ts +11 -0
- package/lib/dist-custom-elements/duet-cookie-consent.js +94 -0
- package/lib/dist-custom-elements/duet-date-picker.d.ts +11 -0
- package/lib/dist-custom-elements/duet-date-picker.js +906 -0
- package/lib/dist-custom-elements/duet-divider.d.ts +11 -0
- package/lib/dist-custom-elements/duet-divider.js +9 -0
- package/lib/dist-custom-elements/duet-editable-table.d.ts +11 -0
- package/lib/dist-custom-elements/duet-editable-table.js +9 -0
- package/lib/dist-custom-elements/duet-empty-state.d.ts +11 -0
- package/lib/dist-custom-elements/duet-empty-state.js +9 -0
- package/lib/dist-custom-elements/duet-fieldset.d.ts +11 -0
- package/lib/dist-custom-elements/duet-fieldset.js +9 -0
- package/lib/dist-custom-elements/duet-footer.d.ts +11 -0
- package/lib/dist-custom-elements/duet-footer.js +199 -0
- package/lib/dist-custom-elements/duet-grid-item.d.ts +11 -0
- package/lib/dist-custom-elements/duet-grid-item.js +9 -0
- package/lib/dist-custom-elements/duet-grid.d.ts +11 -0
- package/lib/dist-custom-elements/duet-grid.js +9 -0
- package/lib/dist-custom-elements/duet-header.d.ts +11 -0
- package/lib/dist-custom-elements/duet-header.js +764 -0
- package/lib/dist-custom-elements/duet-heading.d.ts +11 -0
- package/lib/dist-custom-elements/duet-heading.js +9 -0
- package/lib/dist-custom-elements/duet-hero.d.ts +11 -0
- package/lib/dist-custom-elements/duet-hero.js +314 -0
- package/lib/dist-custom-elements/duet-icon.d.ts +11 -0
- package/lib/dist-custom-elements/duet-icon.js +9 -0
- package/lib/dist-custom-elements/duet-input.d.ts +11 -0
- package/lib/dist-custom-elements/duet-input.js +9 -0
- package/lib/dist-custom-elements/duet-label.d.ts +11 -0
- package/lib/dist-custom-elements/duet-label.js +9 -0
- package/lib/dist-custom-elements/duet-layout.d.ts +11 -0
- package/lib/dist-custom-elements/duet-layout.js +107 -0
- package/lib/dist-custom-elements/duet-link.d.ts +11 -0
- package/lib/dist-custom-elements/duet-link.js +9 -0
- package/lib/dist-custom-elements/duet-list-item.d.ts +11 -0
- package/lib/dist-custom-elements/duet-list-item.js +9 -0
- package/lib/dist-custom-elements/duet-list.d.ts +11 -0
- package/lib/dist-custom-elements/duet-list.js +9 -0
- package/lib/dist-custom-elements/duet-logo.d.ts +11 -0
- package/lib/dist-custom-elements/duet-logo.js +9 -0
- package/lib/dist-custom-elements/duet-modal.d.ts +11 -0
- package/lib/dist-custom-elements/duet-modal.js +331 -0
- package/lib/dist-custom-elements/duet-notification-drawer.d.ts +11 -0
- package/lib/dist-custom-elements/duet-notification-drawer.js +194 -0
- package/lib/dist-custom-elements/duet-notification.d.ts +11 -0
- package/lib/dist-custom-elements/duet-notification.js +114 -0
- package/lib/dist-custom-elements/duet-number-input.d.ts +11 -0
- package/lib/dist-custom-elements/duet-number-input.js +516 -0
- package/lib/dist-custom-elements/duet-pagination.d.ts +11 -0
- package/lib/dist-custom-elements/duet-pagination.js +396 -0
- package/lib/dist-custom-elements/duet-paragraph.d.ts +11 -0
- package/lib/dist-custom-elements/duet-paragraph.js +9 -0
- package/lib/dist-custom-elements/duet-progress.d.ts +11 -0
- package/lib/dist-custom-elements/duet-progress.js +9 -0
- package/lib/dist-custom-elements/duet-radio-group.d.ts +11 -0
- package/lib/dist-custom-elements/duet-radio-group.js +216 -0
- package/lib/dist-custom-elements/duet-radio.d.ts +11 -0
- package/lib/dist-custom-elements/duet-radio.js +167 -0
- package/lib/dist-custom-elements/duet-range-slider.d.ts +11 -0
- package/lib/dist-custom-elements/duet-range-slider.js +209 -0
- package/lib/dist-custom-elements/duet-range-stepper.d.ts +11 -0
- package/lib/dist-custom-elements/duet-range-stepper.js +225 -0
- package/lib/dist-custom-elements/duet-scrollable.d.ts +11 -0
- package/lib/dist-custom-elements/duet-scrollable.js +9 -0
- package/lib/dist-custom-elements/duet-select.d.ts +11 -0
- package/lib/dist-custom-elements/duet-select.js +9 -0
- package/lib/dist-custom-elements/duet-spacer.d.ts +11 -0
- package/lib/dist-custom-elements/duet-spacer.js +9 -0
- package/lib/dist-custom-elements/duet-spinner.d.ts +11 -0
- package/lib/dist-custom-elements/duet-spinner.js +9 -0
- package/lib/dist-custom-elements/duet-step.d.ts +11 -0
- package/lib/dist-custom-elements/duet-step.js +150 -0
- package/lib/dist-custom-elements/duet-stepper.d.ts +11 -0
- package/lib/dist-custom-elements/duet-stepper.js +164 -0
- package/lib/dist-custom-elements/duet-tab-group.d.ts +11 -0
- package/lib/dist-custom-elements/duet-tab-group.js +301 -0
- package/lib/dist-custom-elements/duet-tab.d.ts +11 -0
- package/lib/dist-custom-elements/duet-tab.js +59 -0
- package/lib/dist-custom-elements/duet-table.d.ts +11 -0
- package/lib/dist-custom-elements/duet-table.js +9 -0
- package/lib/dist-custom-elements/duet-textarea.d.ts +11 -0
- package/lib/dist-custom-elements/duet-textarea.js +297 -0
- package/lib/dist-custom-elements/duet-toggle.d.ts +11 -0
- package/lib/dist-custom-elements/duet-toggle.js +150 -0
- package/lib/dist-custom-elements/duet-tooltip.d.ts +11 -0
- package/lib/dist-custom-elements/duet-tooltip.js +9 -0
- package/lib/dist-custom-elements/duet-tray.d.ts +11 -0
- package/lib/dist-custom-elements/duet-tray.js +175 -0
- package/lib/dist-custom-elements/duet-upload-aria-status.d.ts +11 -0
- package/lib/dist-custom-elements/duet-upload-aria-status.js +9 -0
- package/lib/dist-custom-elements/duet-upload.d.ts +11 -0
- package/lib/dist-custom-elements/duet-upload.js +1514 -0
- package/lib/dist-custom-elements/duet-visually-hidden.d.ts +11 -0
- package/lib/dist-custom-elements/duet-visually-hidden.js +9 -0
- package/lib/dist-custom-elements/index.d.ts +26 -0
- package/lib/dist-custom-elements/index.js +37 -0
- package/lib/dist-custom-elements/p-01de0640.js +37 -0
- package/lib/{esm/tokens-8ff8c570.js → dist-custom-elements/p-02305a1e.js} +18 -15
- package/lib/dist-custom-elements/p-08cfe544.js +125 -0
- package/lib/dist-custom-elements/p-09ed1ffa.js +160 -0
- package/lib/dist-custom-elements/p-0a928609.js +241 -0
- package/lib/dist-custom-elements/p-0b3f675e.js +47 -0
- package/lib/{esm/focus-utils-559691b3.js → dist-custom-elements/p-0b8f16f1.js} +1 -1
- package/lib/dist-custom-elements/p-115c79b6.js +6 -0
- package/lib/dist-custom-elements/p-12721178.js +57 -0
- package/lib/dist-custom-elements/p-14dcd82b.js +133 -0
- package/lib/dist-custom-elements/p-16d518fd.js +66 -0
- package/lib/dist-custom-elements/p-213ef84c.js +87 -0
- package/lib/dist-custom-elements/p-266411cf.js +307 -0
- package/lib/dist-custom-elements/p-3d987b87.js +75 -0
- package/lib/dist-custom-elements/p-3fc2d124.js +1666 -0
- package/lib/dist-custom-elements/p-4717744e.js +110 -0
- package/lib/dist-custom-elements/p-4ebf1618.js +13 -0
- package/lib/dist-custom-elements/p-56118313.js +53 -0
- package/lib/dist-custom-elements/p-565779f5.js +199 -0
- package/lib/dist-custom-elements/p-5a9d75e1.js +55 -0
- package/lib/dist-custom-elements/p-65d3ead5.js +428 -0
- package/lib/dist-custom-elements/p-6886544b.js +129 -0
- package/lib/dist-custom-elements/p-6e74e660.js +275 -0
- package/lib/dist-custom-elements/p-704245ef.js +9 -0
- package/lib/dist-custom-elements/p-76f00bd5.js +10 -0
- package/lib/dist-custom-elements/p-7739604d.js +214 -0
- package/lib/dist-custom-elements/p-81c9b244.js +65 -0
- package/lib/{esm/token-utils-df78f4d8.js → dist-custom-elements/p-86faf728.js} +1 -1
- package/lib/dist-custom-elements/p-88511d7a.js +275 -0
- package/lib/dist-custom-elements/p-9c732bb9.js +193 -0
- package/lib/dist-custom-elements/p-acdba2db.js +114 -0
- package/lib/dist-custom-elements/p-b08e57cf.js +37 -0
- package/lib/dist-custom-elements/p-b9058029.js +138 -0
- package/lib/dist-custom-elements/p-bd4b92c4.js +86 -0
- package/lib/dist-custom-elements/p-bd779757.js +184 -0
- package/lib/dist-custom-elements/p-c1325e35.js +11 -0
- package/lib/dist-custom-elements/p-c70f3ccb.js +70 -0
- package/lib/dist-custom-elements/p-d004da5f.js +6 -0
- package/lib/dist-custom-elements/p-d4c234ed.js +390 -0
- package/lib/dist-custom-elements/p-d8549efe.js +20 -0
- package/lib/dist-custom-elements/p-d96debb6.js +287 -0
- package/lib/dist-custom-elements/p-da03a443.js +154 -0
- package/lib/dist-custom-elements/p-e294c0fb.js +341 -0
- package/lib/dist-custom-elements/p-e4d5fbc0.js +87 -0
- package/lib/dist-custom-elements/p-e5c8a58f.js +71 -0
- package/lib/dist-custom-elements/p-ede854e1.js +92 -0
- package/lib/dist-custom-elements/p-ef8eff22.js +64 -0
- package/lib/dist-custom-elements/p-f11208c3.js +6 -0
- package/lib/dist-custom-elements/p-f7db7c40.js +98 -0
- package/lib/dist-custom-elements/p-fc5362e7.js +61 -0
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-6c875cfa.system.entry.js → p-01c551f1.system.entry.js} +1 -1
- package/lib/duet/p-02305a1e.js +4 -0
- package/lib/duet/{p-1010fb94.entry.js → p-033bfa67.entry.js} +1 -1
- package/lib/duet/{p-946aa901.system.entry.js → p-07a850a5.system.entry.js} +1 -1
- package/lib/duet/{p-9e54127f.system.entry.js → p-09e2ff96.system.entry.js} +1 -1
- package/lib/duet/{p-d0cee171.entry.js → p-0b74af40.entry.js} +1 -1
- package/lib/duet/{p-2bd79d6b.entry.js → p-0c2a51ac.entry.js} +1 -1
- package/lib/duet/{p-eb54474f.system.entry.js → p-0c9f0b8a.system.entry.js} +1 -1
- package/lib/duet/{p-104bf1b5.entry.js → p-0d96924d.entry.js} +1 -1
- package/lib/duet/{p-d444107c.system.entry.js → p-0e48bca9.system.entry.js} +1 -1
- package/lib/duet/{p-de815460.system.entry.js → p-0e98f667.system.entry.js} +1 -1
- package/lib/duet/{p-cfa50753.system.js → p-1999f503.system.js} +1 -1
- package/lib/duet/{p-4034b322.system.entry.js → p-1a41550e.system.entry.js} +1 -1
- package/lib/duet/{p-bec24271.system.entry.js → p-1bd57792.system.entry.js} +1 -1
- package/lib/duet/{p-dab594cf.system.entry.js → p-1e0d7680.system.entry.js} +1 -1
- package/lib/duet/{p-6841adb8.system.entry.js → p-1ebd7945.system.entry.js} +1 -1
- package/lib/duet/p-1fc60a60.system.js +4 -0
- package/lib/duet/{p-47ed8218.entry.js → p-21662682.entry.js} +1 -1
- package/lib/duet/{p-b008fe25.entry.js → p-23943f39.entry.js} +1 -1
- package/lib/duet/{p-92d95bde.system.entry.js → p-23a8fa64.system.entry.js} +1 -1
- package/lib/duet/{p-72443e94.system.entry.js → p-264a0e0c.system.entry.js} +1 -1
- package/lib/duet/{p-5d967d15.entry.js → p-27f72e70.entry.js} +1 -1
- package/lib/duet/{p-09364233.entry.js → p-2a3b1a2e.entry.js} +1 -1
- package/lib/duet/{p-df11c241.system.entry.js → p-2b320481.system.entry.js} +1 -1
- package/lib/duet/p-32f7178a.system.js +4 -0
- package/lib/duet/{p-e3983bfe.entry.js → p-3620ded5.entry.js} +1 -1
- package/lib/duet/{p-b01e2523.entry.js → p-3904232a.entry.js} +1 -1
- package/lib/duet/{p-2bba6489.entry.js → p-3b173cbd.entry.js} +1 -1
- package/lib/duet/{p-087d72dd.system.entry.js → p-430acad4.system.entry.js} +1 -1
- package/lib/duet/{p-23ba48a5.system.entry.js → p-4463946b.system.entry.js} +1 -1
- package/lib/duet/{p-8157e5bb.system.entry.js → p-44e9b1c8.system.entry.js} +1 -1
- package/lib/duet/p-49ce11a1.entry.js +4 -0
- package/lib/duet/{p-06ab2787.system.entry.js → p-4d6feeb5.system.entry.js} +1 -1
- package/lib/duet/{p-f7ac05dd.system.entry.js → p-4d767c61.system.entry.js} +1 -1
- package/lib/duet/{p-e0f6ebf4.system.entry.js → p-4f1fe415.system.entry.js} +1 -1
- package/lib/duet/{p-de3c0f4d.js → p-532e9db7.js} +1 -1
- package/lib/duet/{p-9f8a51b4.system.entry.js → p-55fd512b.system.entry.js} +1 -1
- package/lib/duet/{p-398a79a0.js → p-588be556.js} +1 -1
- package/lib/duet/{p-074bfd45.entry.js → p-5af6d9e2.entry.js} +1 -1
- package/lib/duet/{p-9308c1e6.entry.js → p-5e1d64d8.entry.js} +1 -1
- package/lib/duet/{p-4c93a18e.system.entry.js → p-5f6452ce.system.entry.js} +1 -1
- package/lib/duet/{p-de986d77.system.entry.js → p-60e29f52.system.entry.js} +1 -1
- package/lib/duet/{p-e1654a8b.system.entry.js → p-613c4099.system.entry.js} +1 -1
- package/lib/duet/{p-94c07a46.system.entry.js → p-61444a3d.system.entry.js} +1 -1
- package/lib/duet/{p-d0f72f22.js → p-6aca8584.js} +1 -1
- package/lib/duet/{p-db15d420.system.entry.js → p-6e5f2016.system.entry.js} +1 -1
- package/lib/duet/{p-63dbd5af.system.entry.js → p-6f93638a.system.entry.js} +1 -1
- package/lib/duet/{p-c8d9da51.entry.js → p-71105750.entry.js} +1 -1
- package/lib/duet/{p-db115036.entry.js → p-73c6e5fb.entry.js} +1 -1
- package/lib/duet/{p-b3dc55a6.system.entry.js → p-751f6957.system.entry.js} +1 -1
- package/lib/duet/{p-1931d33f.system.js → p-77600ed7.system.js} +1 -1
- package/lib/duet/{p-571440c7.system.entry.js → p-77ca874f.system.entry.js} +1 -1
- package/lib/duet/{p-c2e37fb4.entry.js → p-787f9eba.entry.js} +1 -1
- package/lib/duet/{p-674e546f.system.entry.js → p-7ad2cb10.system.entry.js} +1 -1
- package/lib/duet/{p-b066a6b7.entry.js → p-7de4d97d.entry.js} +1 -1
- package/lib/duet/{p-3d029dce.system.entry.js → p-8107aeb5.system.entry.js} +1 -1
- package/lib/duet/{p-31004a7b.system.entry.js → p-86cb85b9.system.entry.js} +1 -1
- package/lib/duet/{p-f2eaad1e.js → p-875ae637.js} +1 -1
- package/lib/duet/{p-de146ffa.system.entry.js → p-8aafa8e7.system.entry.js} +1 -1
- package/lib/duet/{p-064dd5fd.entry.js → p-8b09a46f.entry.js} +1 -1
- package/lib/duet/{p-16521f2d.entry.js → p-8c08e7ba.entry.js} +1 -1
- package/lib/duet/{p-0626271f.entry.js → p-8e8f8b29.entry.js} +1 -1
- package/lib/duet/{p-300147ad.entry.js → p-9094fcf8.entry.js} +1 -1
- package/lib/duet/{p-5beb69ac.entry.js → p-988a781d.entry.js} +1 -1
- package/lib/duet/{p-cca9c605.system.entry.js → p-a395d4bc.system.entry.js} +1 -1
- package/lib/duet/{p-97a369d6.entry.js → p-a585113b.entry.js} +1 -1
- package/lib/duet/{p-ef4b4f35.entry.js → p-aa8973fc.entry.js} +1 -1
- package/lib/duet/{p-23ad5f8a.entry.js → p-ab7f4070.entry.js} +1 -1
- package/lib/duet/{p-49db53a1.system.entry.js → p-ab89d948.system.entry.js} +1 -1
- package/lib/duet/{p-20271117.entry.js → p-aef02083.entry.js} +1 -1
- package/lib/duet/{p-c5499bc3.entry.js → p-afdc57da.entry.js} +1 -1
- package/lib/duet/{p-9f18afd6.entry.js → p-b2abaa9e.entry.js} +1 -1
- package/lib/duet/{p-744ce6ce.entry.js → p-b55e55b5.entry.js} +1 -1
- package/lib/duet/{p-3cc55c8a.system.entry.js → p-bbc91480.system.entry.js} +1 -1
- package/lib/duet/{p-1aca544d.entry.js → p-bbe1a2cd.entry.js} +1 -1
- package/lib/duet/{p-8c409ffe.system.entry.js → p-bd3c926c.system.entry.js} +1 -1
- package/lib/duet/{p-e2ac0727.system.entry.js → p-bec16aea.system.entry.js} +1 -1
- package/lib/duet/p-bf59e11d.entry.js +4 -0
- package/lib/duet/{p-ab2f08b3.system.entry.js → p-c4217626.system.entry.js} +1 -1
- package/lib/duet/{p-5658ac20.system.entry.js → p-c5f6ea62.system.entry.js} +1 -1
- package/lib/duet/{p-41cb95cb.entry.js → p-c6d05091.entry.js} +1 -1
- package/lib/duet/{p-0f7f7e7d.system.entry.js → p-c73a591d.system.entry.js} +1 -1
- package/lib/duet/{p-6b0a4b3b.entry.js → p-c863a0d1.entry.js} +1 -1
- package/lib/duet/{p-c41b07d7.entry.js → p-c986532d.entry.js} +1 -1
- package/lib/duet/{p-ae515c54.entry.js → p-caa49454.entry.js} +1 -1
- package/lib/duet/{p-9fcac068.system.entry.js → p-ccb0de84.system.entry.js} +1 -1
- package/lib/duet/{p-18cc5627.system.js → p-d209191d.system.js} +1 -1
- package/lib/duet/{p-bb9624c3.entry.js → p-defba7cd.entry.js} +1 -1
- package/lib/duet/{p-339e5901.system.js → p-df785776.system.js} +1 -1
- package/lib/duet/{p-691f609b.entry.js → p-e9862947.entry.js} +1 -1
- package/lib/duet/{p-5d1787cb.entry.js → p-eb74c96e.entry.js} +1 -1
- package/lib/duet/{p-0ae59d7c.entry.js → p-ece47184.entry.js} +1 -1
- package/lib/duet/{p-89048c6f.entry.js → p-f09f968c.entry.js} +1 -1
- package/lib/duet/{p-68c3b19f.entry.js → p-f97776be.entry.js} +1 -1
- package/lib/duet/{p-6eecfced.system.entry.js → p-fe8fc877.system.entry.js} +1 -1
- package/lib/esm/duet-action-button.entry.js +3 -3
- package/lib/esm/duet-alert.entry.js +1 -1
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-breadcrumb.entry.js +1 -1
- package/lib/esm/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +3 -3
- package/lib/esm/duet-caption_4.entry.js +3 -3
- package/lib/esm/duet-card.entry.js +3 -3
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +3 -3
- package/lib/esm/duet-collapsible.entry.js +2 -2
- package/lib/esm/duet-combobox.entry.js +1 -1
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +2 -2
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-editable-table_3.entry.js +17 -14
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +1 -1
- package/lib/esm/duet-grid_2.entry.js +2 -2
- package/lib/esm/duet-header_2.entry.js +3 -3
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-icon.entry.js +3 -3
- package/lib/esm/duet-input_2.entry.js +1 -1
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +2 -2
- package/lib/esm/duet-notification_2.entry.js +1 -1
- package/lib/esm/duet-number-input.entry.js +1 -1
- package/lib/esm/duet-pagination_2.entry.js +1 -1
- package/lib/esm/duet-progress.entry.js +1 -1
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-range-slider.entry.js +2 -2
- package/lib/esm/duet-scrollable_3.entry.js +1 -1
- package/lib/esm/duet-select.entry.js +1 -1
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +1 -1
- package/lib/esm/duet-tray.entry.js +2 -2
- package/lib/esm/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +1 -1
- package/lib/esm/focus-utils-236f580e.js +18 -0
- package/lib/esm/{index-f600b8dc.js → index-b601aac1.js} +1 -1
- package/lib/esm/loader.js +1 -1
- package/lib/esm/token-utils-ebf797ab.js +92 -0
- package/lib/esm/tokens-b9d87fda.js +459 -0
- package/lib/esm/{tokens.module-f4572ed7.js → tokens.module-385c4cf8.js} +12 -10
- package/lib/esm-es5/duet-action-button.entry.js +1 -1
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-badge.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm-es5/duet-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +2 -2
- package/lib/esm-es5/duet-combobox.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-editable-table_3.entry.js +1 -1
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +1 -1
- package/lib/esm-es5/duet-pagination_2.entry.js +1 -1
- package/lib/esm-es5/duet-progress.entry.js +1 -1
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-range-slider.entry.js +1 -1
- package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +2 -2
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/{focus-utils-559691b3.js → focus-utils-236f580e.js} +1 -1
- package/lib/esm-es5/{index-f600b8dc.js → index-b601aac1.js} +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/{token-utils-df78f4d8.js → token-utils-ebf797ab.js} +1 -1
- package/lib/esm-es5/tokens-b9d87fda.js +4 -0
- package/lib/esm-es5/{tokens.module-f4572ed7.js → tokens.module-385c4cf8.js} +1 -1
- package/lib/types/components/duet-upload/duet-upload.d.ts +8 -8
- package/lib/types/components.d.ts +4 -4
- package/package.json +5 -5
- package/lib/custom-elements-bundle/index.d.ts +0 -399
- package/lib/custom-elements-bundle/index.js +0 -14110
- package/lib/duet/p-6002f3d2.system.js +0 -4
- package/lib/duet/p-7c198c75.entry.js +0 -4
- package/lib/duet/p-a93a04b9.system.js +0 -4
- package/lib/duet/p-d1746325.js +0 -4
- package/lib/duet/p-f2ab3e5c.entry.js +0 -4
- package/lib/esm-es5/tokens-8ff8c570.js +0 -4
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { p as proxyCustomElement, H, h, b as Host } from './p-3fc2d124.js';
|
|
5
|
+
import { i as inheritGlobalTheme } from './p-4ebf1618.js';
|
|
6
|
+
import { f as findCheckedOption, w as watchForOptions } from './p-12721178.js';
|
|
7
|
+
import { d as defineCustomElement$6 } from './p-e5c8a58f.js';
|
|
8
|
+
import { d as defineCustomElement$5 } from './p-e4d5fbc0.js';
|
|
9
|
+
import { d as defineCustomElement$4 } from './p-7739604d.js';
|
|
10
|
+
import { d as defineCustomElement$3 } from './p-88511d7a.js';
|
|
11
|
+
import { d as defineCustomElement$2 } from './p-b08e57cf.js';
|
|
12
|
+
|
|
13
|
+
const duetChoiceGroupCss = "*.sc-duet-choice-group,*.sc-duet-choice-group::after,*.sc-duet-choice-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:flex;margin-bottom:0}}.horizontal.sc-duet-choice-group-h .duet-choice-group.duet-no-stacking.sc-duet-choice-group{display:flex}.duet-choice-group.sc-duet-choice-group{position:relative;width:100%;margin-bottom:-12px}";
|
|
14
|
+
|
|
15
|
+
const duetChoiceSelector = ":scope duet-choice:not(:scope duet-choice duet-choice-group duet-choice):not(:scope duet-choice duet-fieldset duet-choice)";
|
|
16
|
+
const DuetChoiceGroup$1 = /*@__PURE__*/ proxyCustomElement(class extends H {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.__registerHost();
|
|
20
|
+
/**
|
|
21
|
+
* Direction of the choice group.
|
|
22
|
+
*/
|
|
23
|
+
this.direction = "vertical";
|
|
24
|
+
/**
|
|
25
|
+
* Controls the margin of the component.
|
|
26
|
+
*/
|
|
27
|
+
this.margin = "auto";
|
|
28
|
+
/**
|
|
29
|
+
* Theme of the choice group.
|
|
30
|
+
*/
|
|
31
|
+
this.theme = "";
|
|
32
|
+
/**
|
|
33
|
+
* Display choice group in error state along with an error message.
|
|
34
|
+
*/
|
|
35
|
+
this.error = "";
|
|
36
|
+
/**
|
|
37
|
+
* Legend displayed for the choice buttons in this group.
|
|
38
|
+
*/
|
|
39
|
+
this.label = "Label";
|
|
40
|
+
/**
|
|
41
|
+
* Visually hide the label, but still show it to screen readers.
|
|
42
|
+
*/
|
|
43
|
+
this.labelHidden = false;
|
|
44
|
+
/**
|
|
45
|
+
* Additional caption to show inside the label of the choice group.
|
|
46
|
+
*/
|
|
47
|
+
this.caption = undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Tooltip to display next to the label of the choice group.
|
|
50
|
+
*/
|
|
51
|
+
this.tooltip = undefined;
|
|
52
|
+
/**
|
|
53
|
+
* With direction setting you can force the tooltip to always open towards left
|
|
54
|
+
* or right instead of automatically determining the direction.
|
|
55
|
+
*/
|
|
56
|
+
this.tooltipDirection = "auto";
|
|
57
|
+
/**
|
|
58
|
+
* Enable or disable the automatic responsive behaviour of the choice group
|
|
59
|
+
* component when horizontal setting is used. Setting this option to "true"
|
|
60
|
+
* makes sure that contents are stacked vertically on mobile.
|
|
61
|
+
*/
|
|
62
|
+
this.responsive = false;
|
|
63
|
+
this.getChoices = () => {
|
|
64
|
+
return Array.from(this.element.querySelectorAll(duetChoiceSelector));
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Component event handling.
|
|
68
|
+
*/
|
|
69
|
+
this.onSelect = (ev) => {
|
|
70
|
+
if (ev.detail.component !== "duet-choice") {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const selectedChoice = ev.target;
|
|
74
|
+
if (selectedChoice) {
|
|
75
|
+
this.value = selectedChoice.value;
|
|
76
|
+
}
|
|
77
|
+
// Prevent events from bubbling up the DOM tree in case
|
|
78
|
+
// this group is a sub-group of another choice group.
|
|
79
|
+
ev.cancelBubble = true;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Component lifecycle events.
|
|
84
|
+
*/
|
|
85
|
+
async connectedCallback() {
|
|
86
|
+
const el = this.element;
|
|
87
|
+
if (this.value === undefined) {
|
|
88
|
+
const choice = findCheckedOption(el, duetChoiceSelector);
|
|
89
|
+
if (choice !== undefined) {
|
|
90
|
+
await choice.componentOnReady();
|
|
91
|
+
if (this.value === undefined) {
|
|
92
|
+
this.value = choice.value;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
this.mutationO = watchForOptions(el, duetChoiceSelector, newOption => {
|
|
97
|
+
if (newOption !== undefined) {
|
|
98
|
+
newOption.componentOnReady().then(() => {
|
|
99
|
+
const choices = this.getChoices();
|
|
100
|
+
if (choices.includes(newOption)) {
|
|
101
|
+
this.value = newOption.value;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.updateChoices();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
this.updateChoices();
|
|
110
|
+
}
|
|
111
|
+
disconnectedCallback() {
|
|
112
|
+
if (this.mutationO) {
|
|
113
|
+
this.mutationO.disconnect();
|
|
114
|
+
this.mutationO = undefined;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
componentWillLoad() {
|
|
118
|
+
inheritGlobalTheme(this);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Local methods
|
|
122
|
+
*/
|
|
123
|
+
async updateChoices() {
|
|
124
|
+
/**
|
|
125
|
+
* Make sure we get all choices first so values are up to date prior
|
|
126
|
+
* to caching the choice group value
|
|
127
|
+
*/
|
|
128
|
+
const choices = this.getChoices();
|
|
129
|
+
const { value } = this;
|
|
130
|
+
let hasChecked = false;
|
|
131
|
+
// Walk the DOM in reverse order, since the last selected one wins
|
|
132
|
+
for (const choice of choices) {
|
|
133
|
+
choice.name = this.name;
|
|
134
|
+
choice.groupDisabled = this.disabled;
|
|
135
|
+
choice.groupDirection = this.direction;
|
|
136
|
+
choice.groupResponsive = this.responsive;
|
|
137
|
+
if (!hasChecked && choice.value === value) {
|
|
138
|
+
// Correct value for this choice, but this choice isn't checked yet
|
|
139
|
+
// and we haven't found a checked yet
|
|
140
|
+
hasChecked = true;
|
|
141
|
+
choice.checked = true;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
// This choice doesn't have the correct value or the choice group has been already checked
|
|
145
|
+
choice.checked = false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// Reset value if
|
|
149
|
+
if (!hasChecked) {
|
|
150
|
+
this.value = undefined;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* render() function
|
|
155
|
+
* Always the last one in the class.
|
|
156
|
+
*/
|
|
157
|
+
render() {
|
|
158
|
+
return (h(Host, { onDuetChange: this.onSelect, class: { horizontal: this.direction === "horizontal" } }, h("duet-fieldset", { label: this.label, labelHidden: this.labelHidden, caption: this.caption, error: this.error, margin: this.margin, theme: this.theme }, this.tooltip && (h("duet-tooltip", { slot: "tooltip", direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), h("div", { class: { "duet-choice-group": true, "duet-no-stacking": !this.responsive } }, h("slot", null)))));
|
|
159
|
+
}
|
|
160
|
+
get element() { return this; }
|
|
161
|
+
static get watchers() { return {
|
|
162
|
+
"value": ["updateChoices"],
|
|
163
|
+
"disabled": ["updateChoices"],
|
|
164
|
+
"name": ["updateChoices"],
|
|
165
|
+
"direction": ["updateChoices"],
|
|
166
|
+
"responsive": ["updateChoices"]
|
|
167
|
+
}; }
|
|
168
|
+
static get style() { return duetChoiceGroupCss; }
|
|
169
|
+
}, [6, "duet-choice-group", {
|
|
170
|
+
"direction": [1],
|
|
171
|
+
"margin": [1],
|
|
172
|
+
"theme": [1025],
|
|
173
|
+
"error": [1],
|
|
174
|
+
"name": [1],
|
|
175
|
+
"label": [1],
|
|
176
|
+
"labelHidden": [4, "label-hidden"],
|
|
177
|
+
"caption": [1],
|
|
178
|
+
"tooltip": [1],
|
|
179
|
+
"tooltipDirection": [1, "tooltip-direction"],
|
|
180
|
+
"responsive": [4],
|
|
181
|
+
"value": [1537],
|
|
182
|
+
"disabled": [4]
|
|
183
|
+
}]);
|
|
184
|
+
function defineCustomElement$1() {
|
|
185
|
+
if (typeof customElements === "undefined") {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const components = ["duet-choice-group", "duet-caption", "duet-fieldset", "duet-icon", "duet-tooltip", "duet-visually-hidden"];
|
|
189
|
+
components.forEach(tagName => { switch (tagName) {
|
|
190
|
+
case "duet-choice-group":
|
|
191
|
+
if (!customElements.get(tagName)) {
|
|
192
|
+
customElements.define(tagName, DuetChoiceGroup$1);
|
|
193
|
+
}
|
|
194
|
+
break;
|
|
195
|
+
case "duet-caption":
|
|
196
|
+
if (!customElements.get(tagName)) {
|
|
197
|
+
defineCustomElement$6();
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
case "duet-fieldset":
|
|
201
|
+
if (!customElements.get(tagName)) {
|
|
202
|
+
defineCustomElement$5();
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case "duet-icon":
|
|
206
|
+
if (!customElements.get(tagName)) {
|
|
207
|
+
defineCustomElement$4();
|
|
208
|
+
}
|
|
209
|
+
break;
|
|
210
|
+
case "duet-tooltip":
|
|
211
|
+
if (!customElements.get(tagName)) {
|
|
212
|
+
defineCustomElement$3();
|
|
213
|
+
}
|
|
214
|
+
break;
|
|
215
|
+
case "duet-visually-hidden":
|
|
216
|
+
if (!customElements.get(tagName)) {
|
|
217
|
+
defineCustomElement$2();
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
} });
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const DuetChoiceGroup = DuetChoiceGroup$1;
|
|
224
|
+
const defineCustomElement = defineCustomElement$1;
|
|
225
|
+
|
|
226
|
+
export { DuetChoiceGroup, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DuetChoice extends Components.DuetChoice, HTMLElement {}
|
|
4
|
+
export const DuetChoice: {
|
|
5
|
+
prototype: DuetChoice;
|
|
6
|
+
new (): DuetChoice;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { p as proxyCustomElement, H, c as createEvent, h, b as Host } from './p-3fc2d124.js';
|
|
5
|
+
import { i as inheritGlobalTheme } from './p-4ebf1618.js';
|
|
6
|
+
import { D as DuetStringsExternalDefaults } from './p-76f00bd5.js';
|
|
7
|
+
import { c as createID } from './p-c1325e35.js';
|
|
8
|
+
import { F as FocusGuard } from './p-0b8f16f1.js';
|
|
9
|
+
import { i as isKeyboardClick, a as isQuestionKey, b as isEscapeKey } from './p-d8549efe.js';
|
|
10
|
+
import { g as getLocaleString, a as getLanguage } from './p-ede854e1.js';
|
|
11
|
+
import { d as defineCustomElement$5 } from './p-e5c8a58f.js';
|
|
12
|
+
import { d as defineCustomElement$4 } from './p-7739604d.js';
|
|
13
|
+
import { d as defineCustomElement$3 } from './p-81c9b244.js';
|
|
14
|
+
import { d as defineCustomElement$2 } from './p-b08e57cf.js';
|
|
15
|
+
|
|
16
|
+
var messagingInfo={"title":"messaging-info","tags":"messaging info information circle","svg":"<svg fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\"><path d=\"M13.5 17.25A2.252 2.252 0 0 1 11.25 15v-3.75h-.75a.75.75 0 0 1 0-1.5h.75c.827 0 1.5.673 1.5 1.5V15c0 .414.336.75.75.75h.75a.75.75 0 0 1 0 1.5z\"/><circle cx=\"11.625\" cy=\"7.125\" r=\"1.125\"/><path d=\"M12 24C5.383 24 0 18.617 0 12S5.383 0 12 0s12 5.383 12 12-5.383 12-12 12zm0-22.5C6.21 1.5 1.5 6.21 1.5 12S6.21 22.5 12 22.5 22.5 17.79 22.5 12 17.79 1.5 12 1.5z\"/></svg>"};
|
|
17
|
+
|
|
18
|
+
const duetChoiceCss = "*.sc-duet-choice,*.sc-duet-choice::after,*.sc-duet-choice::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;flex-direction:column;width:auto;max-width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-choice-h:last-child,.sc-duet-choice-h:last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){.sc-duet-choice-h{width:100%}}.duet-expand.sc-duet-choice-h{width:100% !important}.duet-m-0.sc-duet-choice-h{margin:0 !important}.duet-fixed.sc-duet-choice-h{width:auto !important}.vertical.sc-duet-choice-h{margin-right:0 !important}.horizontal.sc-duet-choice-h{margin-bottom:0 !important}@media (min-width: 48em){.horizontal-responsive.sc-duet-choice-h{margin-bottom:0 !important;margin-right:16px !important}.horizontal-responsive.sc-duet-choice-h:last-child,.horizontal-responsive.sc-duet-choice-h:last-of-type{margin-right:0 !important}}.sc-duet-choice-h:last-child:not(:only-child){margin-right:0 !important}.duet-choice-card.sc-duet-choice{position:relative;display:block;width:100%;min-width:8rem;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:400;-webkit-hyphens:auto;hyphens:auto;line-height:1.1;color:#00294d !important;text-align:left;background:white;border-width:2px}.duet-choice-card.duet-p-0.sc-duet-choice{padding:0 !important}.duet-choice-card.duet-m-0.sc-duet-choice{margin:0 !important}.duet-theme-turva.sc-duet-choice .duet-choice-card.sc-duet-choice{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a !important}.duet-choice-card-flextainer.sc-duet-choice{display:flex}.duet-choice-label.sc-duet-choice{-webkit-user-select:none;user-select:none;position:relative;z-index:100;display:flex;gap:1rem;align-items:center;justify-content:flex-start;width:100%;height:100%;min-height:3.875rem;padding:1rem;font-size:1rem;font-weight:600;text-decoration:none;word-break:break-word;cursor:pointer;border:2px solid #e1e3e6;border-radius:4px;transition:background-color 150ms ease}.duet-choice-label.has-before-text.sc-duet-choice .duet-choice-card-icon.sc-duet-choice,.duet-choice-label.has-before-text.sc-duet-choice .duet-choice-card-text.sc-duet-choice{align-self:flex-start;margin-top:0.25rem}.duet-choice-label.sc-duet-choice>div.sc-duet-choice:last-child{flex:1;align-self:flex-start;justify-self:flex-end;margin-top:0.25rem}.has-info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-top-right-radius:0;border-bottom-right-radius:0}.info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom-right-radius:0;border-bottom-left-radius:0}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#909599}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#909599}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#747475}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-choice-label.sc-duet-choice:active{opacity:0.75;transition:none !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#0077b3 !important;background:#f3f9fc;border-color:#0077b3 !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#0077b3}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#171c3a !important;background:#f5f5f7;border-color:#171c3a !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#c60c30}.checked.collapsible.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom:0 !important;border-bottom-right-radius:0;border-bottom-left-radius:0}input.sc-duet-choice:focus{outline:0}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3)}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2)}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#657787 !important;cursor:default !important;background:#f5f8fa !important;border-color:#e1e3e6 !important}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#657787 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#747475 !important;background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#747475 !important}.checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e1e3e6 !important;border-color:#e1e3e6 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e4e4e6 !important;border-color:#e4e4e6 !important}.duet-checkmark-container.sc-duet-choice{position:relative;width:20px;height:20px;margin-left:auto;border:1px solid #909599;border-radius:4px;transition:border 300ms ease}.duet-theme-turva.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#747475}.checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#0077b3;border-color:#0077b3;transition:none}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#171c3a;border-color:#171c3a !important}.duet-checkmark-container.duet-checkmark-radio.sc-duet-choice{border-radius:50%}[disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfcfd1 !important}.checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfcfd1 !important}.duet-checkmark.sc-duet-choice{position:absolute;top:10px;left:3px;width:5.3333333333px;height:11.8518518519px;border-top:2px solid white;border-right:2px solid white;opacity:1;transform:scaleX(-1) rotate(135deg) translateZ(0);transform-origin:left top;animation-name:duet-checkmark;animation-duration:600ms;animation-timing-function:ease-out;animation-fill-mode:forwards}@keyframes duet-checkmark{0%{width:0;height:0;opacity:1}20%{width:5.3333333333px;height:0;opacity:1}40%,100%{width:5.3333333333px;height:11.8518518519px;opacity:1}}.duet-choice-card-icon.sc-duet-choice{position:relative}.duet-choice-card-icon.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-section-hidden.sc-duet-choice{display:none}.duet-choice-card-info.duet-choice-card-collapsed.sc-duet-choice,.duet-choice-card-collapsed.duet-choice-card-collapsible.sc-duet-choice{position:relative;width:auto;padding:0 !important;background:unset !important;border:0;border-radius:0}.duet-choice-card-info.sc-duet-choice,.duet-choice-card-collapsible.sc-duet-choice{padding:28px !important;position:relative;z-index:200;width:100%;font-weight:400;color:#00294d;border:2px solid #e1e3e6;border-top:0;border-radius:0 0 4px 4px}.duet-theme-turva.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.duet-theme-turva.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{color:#171c3a;border-color:#171c3a}.checked.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.checked.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{display:block}.duet-choice-card-info-expanded.sc-duet-choice,.duet-choice-card-collapsible-expanded.sc-duet-choice{display:block}.duet-choice-card-collapsible.sc-duet-choice{background:white;border:2px solid #0077b3;border-top:0}.duet-choice-card-collapsible.duet-theme-turva.sc-duet-choice{background:white;border-color:#171c3a}.duet-choice-card-collapsible-disabled.sc-duet-choice{background:#f5f8fa;border-color:#e1e3e6}.duet-choice-card-collapsible-disabled.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-card-info.sc-duet-choice{font-size:0.875rem;line-height:1.5;background:#f5f8fa;transition:150ms ease-out}.duet-choice-card-info.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-info-toggle.sc-duet-choice{display:flex;flex-shrink:0;align-items:flex-start;justify-content:center;width:57.6px;padding-top:1.25rem;cursor:pointer;background:white;border:2px solid #e1e3e6;border-left:0 none;border-top-right-radius:4px;border-bottom-right-radius:4px;-webkit-appearance:none;appearance:none}.duet-choice-info-toggle[aria-expanded=true].sc-duet-choice{background:#f5f8fa;border-bottom-color:transparent;border-bottom-right-radius:0}.duet-choice-info-toggle[disabled].sc-duet-choice{pointer-events:none;background:#f5f8fa !important;border-color:#e1e3e6 !important}.duet-choice-info-toggle[disabled].sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#909599 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice{background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#747475 !important}.duet-choice-info-toggle.sc-duet-choice:focus{outline:none}.user-is-tabbing.sc-duet-choice-h .duet-choice-info-toggle.sc-duet-choice:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-choice-info-toggle.sc-duet-choice{border-left-color:#909599}.checked.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice{border-left-color:#0077b3 !important}.duet-choice-info-toggle.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#0077b3}.duet-theme-turva.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#c60c30}.duet-choice-input.sc-duet-choice{position:absolute !important;width:auto;height:auto;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);color:transparent}";
|
|
19
|
+
|
|
20
|
+
const DuetChoice$1 = /*@__PURE__*/ proxyCustomElement(class extends H {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.__registerHost();
|
|
24
|
+
this.duetChange = createEvent(this, "duetChange", 7);
|
|
25
|
+
this.duetFocus = createEvent(this, "duetFocus", 7);
|
|
26
|
+
this.duetBlur = createEvent(this, "duetBlur", 7);
|
|
27
|
+
this.hasHeader = false;
|
|
28
|
+
this.choiceId = createID("DuetChoice");
|
|
29
|
+
this.expandId = createID("DuetChoiceExpand");
|
|
30
|
+
this.headerId = createID("DuetChoiceHeader");
|
|
31
|
+
this.infoButtonId = createID("DuetChoiceInfoButton");
|
|
32
|
+
/**
|
|
33
|
+
* State() variables
|
|
34
|
+
* Inlined decorator, alphabetical order.
|
|
35
|
+
*/
|
|
36
|
+
this.isHovering = false;
|
|
37
|
+
this.isInfoOpen = false;
|
|
38
|
+
this.isBlurred = false;
|
|
39
|
+
/**
|
|
40
|
+
* Theme of the choice.
|
|
41
|
+
*/
|
|
42
|
+
this.theme = "";
|
|
43
|
+
/**
|
|
44
|
+
* Label for the choice button.
|
|
45
|
+
*/
|
|
46
|
+
this.label = "label";
|
|
47
|
+
/**
|
|
48
|
+
* Property to change accessibleLabelInfoButton defaults on the component.
|
|
49
|
+
* normally you would handle these strings on an application level and override @accessibleLabelInfoButton when needed
|
|
50
|
+
*/
|
|
51
|
+
this.accessibleLabelInfoButtonDefaults = DuetStringsExternalDefaults;
|
|
52
|
+
/**
|
|
53
|
+
* Accessible label that is read for screen reader users in the info toggle trigger button.
|
|
54
|
+
* Not visible for normal users.
|
|
55
|
+
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
56
|
+
*/
|
|
57
|
+
this.accessibleLabelInfoButton = getLocaleString(this.accessibleLabelInfoButtonDefaults);
|
|
58
|
+
/**
|
|
59
|
+
* Aria Details of the component
|
|
60
|
+
*/
|
|
61
|
+
this.accessibleDetails = undefined;
|
|
62
|
+
/**
|
|
63
|
+
* String of id's that indicate alternative labels elements
|
|
64
|
+
*/
|
|
65
|
+
this.accessibleLabelledBy = undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Aria description the button
|
|
68
|
+
*/
|
|
69
|
+
this.accessibleDescription = undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Additional caption to show inside the label of the choice button.
|
|
72
|
+
*/
|
|
73
|
+
this.caption = "";
|
|
74
|
+
/**
|
|
75
|
+
* Type of the choice button. You can set the type of the choice to be either
|
|
76
|
+
* “radio” or “checkbox”. Depending on this selection we convey the selection
|
|
77
|
+
* type to assistive technologies as well. When type “radio” is chosen it is
|
|
78
|
+
* required to place the choices inside Choice Group component.
|
|
79
|
+
*/
|
|
80
|
+
this.type = "checkbox";
|
|
81
|
+
/**
|
|
82
|
+
* Checked state of the choice button.
|
|
83
|
+
*/
|
|
84
|
+
this.checked = false;
|
|
85
|
+
/**
|
|
86
|
+
* Makes the choice button open a new section underneath it when clicked or
|
|
87
|
+
* tapped. This new section can be used to show more options related to this
|
|
88
|
+
* choice. Please note that this feature can’t be used together with the "info"
|
|
89
|
+
* functionality and that it only accepts plain dom nodes (no shadow dom elements
|
|
90
|
+
* such as duet-paragraph can be used as this will break accessibility)
|
|
91
|
+
*/
|
|
92
|
+
this.collapsible = false;
|
|
93
|
+
/**
|
|
94
|
+
* Controls the margin of the component.
|
|
95
|
+
*/
|
|
96
|
+
this.margin = "auto";
|
|
97
|
+
/**
|
|
98
|
+
* Icon to display to the left of the choice button label.
|
|
99
|
+
*/
|
|
100
|
+
this.icon = "";
|
|
101
|
+
/**
|
|
102
|
+
* Expands the choice button to fill 100% of the container width.
|
|
103
|
+
*/
|
|
104
|
+
this.expand = false;
|
|
105
|
+
/**
|
|
106
|
+
* Controls the padding of the component.
|
|
107
|
+
*/
|
|
108
|
+
this.padding = "auto";
|
|
109
|
+
/**
|
|
110
|
+
* Makes the choice component disabled. This prevents users from being able to
|
|
111
|
+
* interact with the choice, and conveys its inactive state to assistive technologies.
|
|
112
|
+
*/
|
|
113
|
+
this.disabled = false;
|
|
114
|
+
/**
|
|
115
|
+
* Set whether the input is required or not. Please note that this is necessary for
|
|
116
|
+
* accessible inputs when the user is required to fill them. When using this property
|
|
117
|
+
* you need to also set “novalidate” attribute to your form element to prevent
|
|
118
|
+
* browser from displaying its own validation errors.
|
|
119
|
+
*/
|
|
120
|
+
this.required = false;
|
|
121
|
+
/**
|
|
122
|
+
* Placeholder defaults
|
|
123
|
+
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
124
|
+
*/
|
|
125
|
+
this.infoLabelDefaults = {
|
|
126
|
+
fi: "Lisätietoja",
|
|
127
|
+
en: "More information about",
|
|
128
|
+
sv: "Mera information om",
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Hint text to display before the user types into the date picker input.
|
|
132
|
+
* @default {
|
|
133
|
+
* fi: "Lisätietoja",
|
|
134
|
+
* en: "More information about",
|
|
135
|
+
* sv: "Mera information om",
|
|
136
|
+
* }
|
|
137
|
+
*/
|
|
138
|
+
this.infoLabel = getLocaleString(this.infoLabelDefaults, getLanguage());
|
|
139
|
+
this.onMouseEnter = () => {
|
|
140
|
+
this.isHovering = true;
|
|
141
|
+
};
|
|
142
|
+
this.onMouseLeave = () => {
|
|
143
|
+
this.isHovering = false;
|
|
144
|
+
};
|
|
145
|
+
this.onClick = (ev) => {
|
|
146
|
+
this.toggleChecked(ev);
|
|
147
|
+
};
|
|
148
|
+
this.handleKeyDown = (ev) => {
|
|
149
|
+
if (isKeyboardClick(ev)) {
|
|
150
|
+
this.toggleChecked(ev);
|
|
151
|
+
}
|
|
152
|
+
if (isQuestionKey(ev) && this.hasInfo) {
|
|
153
|
+
this.toggleInfo();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
this.onChange = () => {
|
|
157
|
+
this.checked = this.nativeInput.checked || false;
|
|
158
|
+
this.duetChange.emit({
|
|
159
|
+
checked: this.checked,
|
|
160
|
+
value: this.value,
|
|
161
|
+
component: "duet-choice",
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
this.onBlur = (ev) => {
|
|
165
|
+
this.duetBlur.emit({
|
|
166
|
+
originalEvent: ev,
|
|
167
|
+
checked: this.checked,
|
|
168
|
+
value: this.value,
|
|
169
|
+
component: "duet-choice",
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
this.onFocus = (ev) => {
|
|
173
|
+
this.duetFocus.emit({
|
|
174
|
+
originalEvent: ev,
|
|
175
|
+
checked: this.checked,
|
|
176
|
+
value: this.value,
|
|
177
|
+
component: "duet-choice",
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Local methods
|
|
182
|
+
*/
|
|
183
|
+
this.toggleChecked = ev => {
|
|
184
|
+
if (this.disabled || this.groupDisabled) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
this.isInfoOpen = false;
|
|
188
|
+
// if it's a radio button and it's already checked
|
|
189
|
+
// we shouldn't fire an event, so exit early
|
|
190
|
+
if (this.type === "radio" && this.checked) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this.checked = !this.checked;
|
|
194
|
+
this.duetChange.emit({
|
|
195
|
+
originalEvent: ev,
|
|
196
|
+
checked: this.checked,
|
|
197
|
+
value: this.value,
|
|
198
|
+
component: "duet-choice",
|
|
199
|
+
});
|
|
200
|
+
ev.preventDefault();
|
|
201
|
+
ev.stopPropagation();
|
|
202
|
+
};
|
|
203
|
+
this.toggleInfo = () => {
|
|
204
|
+
this.isInfoOpen = !this.isInfoOpen;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Component lifecycle events.
|
|
209
|
+
*/
|
|
210
|
+
componentWillLoad() {
|
|
211
|
+
inheritGlobalTheme(this);
|
|
212
|
+
this.hasInfo = !!this.element.querySelector("[slot='info']");
|
|
213
|
+
this.hasHeader = !!this.element.querySelector('[slot="header"]');
|
|
214
|
+
this.hasAdditional = !!this.element.querySelector("[slot='additional']");
|
|
215
|
+
this.hasLabel = !!this.element.querySelector(":scope > [slot='label']");
|
|
216
|
+
this.hasBeforeText = !!this.element.querySelector("[slot='before-text']");
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Component event handling.
|
|
220
|
+
*/
|
|
221
|
+
handleHostBlur(ev) {
|
|
222
|
+
/**
|
|
223
|
+
* When moving away from a choice, collapse the info bar to assist visually impared people on focusing
|
|
224
|
+
*/
|
|
225
|
+
if (this.hasInfo && this.isInfoOpen && this.isKeyDown) {
|
|
226
|
+
// @ts-ignore
|
|
227
|
+
const isTargetContainedInHost = this.element.contains(ev === null || ev === void 0 ? void 0 : ev.relatedTarget) || false;
|
|
228
|
+
if (!isTargetContainedInHost) {
|
|
229
|
+
this.toggleInfo();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
handleHostKeyDown() {
|
|
234
|
+
this.isKeyDown = true;
|
|
235
|
+
}
|
|
236
|
+
handleHostKeyUp(ev) {
|
|
237
|
+
this.isKeyDown = false;
|
|
238
|
+
if (isEscapeKey(ev) && this.isInfoOpen) {
|
|
239
|
+
this.toggleInfo();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Sets focus on the specified `duet-choice`. Use this method instead of the global
|
|
244
|
+
* `input.focus()`.
|
|
245
|
+
*/
|
|
246
|
+
async setFocus(options) {
|
|
247
|
+
this.nativeInput.focus(options);
|
|
248
|
+
}
|
|
249
|
+
getAriaDescribedby() {
|
|
250
|
+
if (this.accessibleDescribedBy) {
|
|
251
|
+
return this.accessibleDescribedBy;
|
|
252
|
+
}
|
|
253
|
+
if (this.collapsible || this.hasInfo) {
|
|
254
|
+
if (this.hasHeader) {
|
|
255
|
+
return this.headerId;
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
return this.expandId;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
getClassNames() {
|
|
264
|
+
if (this.hasInfo && !this.collapsible) {
|
|
265
|
+
return {
|
|
266
|
+
"duet-choice-card-info": true,
|
|
267
|
+
"duet-choice-card-info-expanded": this.isInfoOpen,
|
|
268
|
+
"duet-choice-card-collapsed": !this.isInfoOpen,
|
|
269
|
+
"duet-theme-turva": this.theme === "turva",
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
if (!this.hasInfo && this.collapsible) {
|
|
273
|
+
return {
|
|
274
|
+
"duet-choice-card-collapsible": true,
|
|
275
|
+
"duet-choice-card-collapsible-expanded": this.checked,
|
|
276
|
+
"duet-choice-card-collapsed": !this.checked,
|
|
277
|
+
"duet-choice-card-collapsible-disabled": this.disabled || this.groupDisabled ? true : false,
|
|
278
|
+
"duet-theme-turva": this.theme === "turva",
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
"duet-choice-default-slot": true,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* render() function
|
|
287
|
+
* Always the last one in the class.
|
|
288
|
+
*/
|
|
289
|
+
render() {
|
|
290
|
+
const identifier = this.identifier || this.choiceId;
|
|
291
|
+
return (h(Host, { class: {
|
|
292
|
+
horizontal: this.groupDirection === "horizontal" && !this.groupResponsive,
|
|
293
|
+
"horizontal-responsive": this.groupDirection === "horizontal" && this.groupResponsive,
|
|
294
|
+
"duet-m-0": this.margin === "none",
|
|
295
|
+
"duet-expand": this.expand,
|
|
296
|
+
"duet-theme-turva": this.theme === "turva",
|
|
297
|
+
} }, h("div", { class: {
|
|
298
|
+
"duet-choice-card-flextainer": true,
|
|
299
|
+
"duet-theme-turva": this.theme === "turva",
|
|
300
|
+
} }, h("div", { class: {
|
|
301
|
+
"duet-choice-card": true,
|
|
302
|
+
"has-icon": !!this.icon,
|
|
303
|
+
"has-info": this.hasInfo,
|
|
304
|
+
checked: this.checked,
|
|
305
|
+
info: this.isInfoOpen,
|
|
306
|
+
collapsible: this.collapsible,
|
|
307
|
+
"duet-p-0": this.padding === "none",
|
|
308
|
+
} }, h("input", { class: "duet-choice-input", type: this.type, onFocus: this.onFocus, onBlur: this.onBlur, onChange: this.onChange, disabled: this.disabled || this.groupDisabled, required: this.required, id: identifier, name: this.name, value: this.value, checked: this.checked, "aria-controls": this.accessibleControls, "aria-activedescendant": this.accessibleActiveDescendant, "aria-labelledby": this.accessibleLabelledBy, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, "aria-owns": this.accessibleOwns, "aria-describedby": this.getAriaDescribedby(), onKeyDown: this.handleKeyDown, ref: input => (this.nativeInput = input) }), h("label", { htmlFor: identifier, class: { "duet-choice-label": true, "no-hover": this.isHovering, "has-before-text": this.hasBeforeText }, onClick: this.onClick }, this.hasBeforeText && h("slot", { name: "before-text" }), this.icon && (h("div", { class: "duet-choice-card-icon" }, h("duet-icon", { margin: "none", size: "small", name: this.icon, color: "currentColor" }))), h("div", { class: "duet-choice-card-text" }, h("div", null, this.hasLabel ? h("slot", { name: "label" }) : this.label), this.caption && (h("div", null, h("duet-spacer", { size: "xx-small" }), h("duet-caption", { margin: "none", selected: this.checked }, this.caption))), this.hasAdditional && (h("div", null, h("duet-spacer", { size: "xx-small" }), h("slot", { name: "additional" })))), h("div", null, h("div", { class: { "duet-checkmark-container": true, "duet-checkmark-radio": this.type === "radio" } }, this.checked && h("div", { class: "duet-checkmark" }))))), this.hasInfo && !this.collapsible && (h("button", { ref: button => (this.infoButtonEl = button), id: this.infoButtonId, class: {
|
|
309
|
+
"duet-choice-info-toggle": true,
|
|
310
|
+
"duet-theme-turva": this.theme === "turva",
|
|
311
|
+
}, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onClick: this.toggleInfo, disabled: this.disabled || this.groupDisabled, "aria-expanded": this.isInfoOpen ? "true" : "false", "aria-label": `${this.infoLabel} ${this.label}`, "aria-controls": this.expandId, "aria-flowto": this.expandId, tabindex: this.type === "radio" && !this.checked ? "-1" : "0", type: "button" }, h("duet-visually-hidden", { "aria-hidden": !this.isBlurred ? "true" : "false" }, this.accessibleLabelInfoButton), h("div", { class: "duet-choice-info-icon" }, h("duet-icon", { icon: messagingInfo.svg, margin: "none", size: "small", color: "currentColor" }))))), this.collapsible || this.hasInfo ? (h("div", { class: this.getClassNames(), id: this.expandId }, h("span", { class: {
|
|
312
|
+
"duet-choice-section-visible": this.collapsible ? this.checked : this.isInfoOpen,
|
|
313
|
+
"duet-choice-section-hidden": this.collapsible ? !this.checked : !this.isInfoOpen,
|
|
314
|
+
} }, h("span", { id: this.headerId }, h("slot", { name: "header" })), this.hasInfo ? (h("span", null, h("span", { "aria-relevant": "all", "aria-atomic": "true", "aria-live": this.isInfoOpen ? "polite" : "off" }, h("slot", { name: "info" })), h("slot", null))) : (h("span", null, h("slot", null)))), this.isInfoOpen && h(FocusGuard, { moveFocusTo: this.infoButtonEl }))) : null));
|
|
315
|
+
}
|
|
316
|
+
get element() { return this; }
|
|
317
|
+
static get style() { return duetChoiceCss; }
|
|
318
|
+
}, [6, "duet-choice", {
|
|
319
|
+
"theme": [1025],
|
|
320
|
+
"label": [1],
|
|
321
|
+
"accessibleLabelInfoButtonDefaults": [1, "accessible-label-info-default"],
|
|
322
|
+
"accessibleLabelInfoButton": [1, "accessible-label-info-button"],
|
|
323
|
+
"accessibleActiveDescendant": [1, "accessible-active-descendant"],
|
|
324
|
+
"accessibleControls": [1, "accessible-controls"],
|
|
325
|
+
"accessibleOwns": [1, "accessible-owns"],
|
|
326
|
+
"accessibleDescribedBy": [1, "accessible-described-by"],
|
|
327
|
+
"accessibleDetails": [1, "accessible-details"],
|
|
328
|
+
"accessibleLabelledBy": [1, "accessible-labelled-by"],
|
|
329
|
+
"accessibleDescription": [1, "accessible-description"],
|
|
330
|
+
"caption": [1],
|
|
331
|
+
"value": [1537],
|
|
332
|
+
"type": [513],
|
|
333
|
+
"name": [1],
|
|
334
|
+
"checked": [1540],
|
|
335
|
+
"collapsible": [4],
|
|
336
|
+
"margin": [1],
|
|
337
|
+
"icon": [1],
|
|
338
|
+
"expand": [4],
|
|
339
|
+
"padding": [1],
|
|
340
|
+
"identifier": [1],
|
|
341
|
+
"groupDirection": [1, "group-direction"],
|
|
342
|
+
"groupDisabled": [4, "group-disabled"],
|
|
343
|
+
"groupResponsive": [4, "group-responsive"],
|
|
344
|
+
"disabled": [516],
|
|
345
|
+
"required": [4],
|
|
346
|
+
"infoLabelDefaults": [1, "accessible-label-info-default"],
|
|
347
|
+
"infoLabel": [1, "info-label"],
|
|
348
|
+
"isHovering": [32],
|
|
349
|
+
"isInfoOpen": [32],
|
|
350
|
+
"isBlurred": [32],
|
|
351
|
+
"setFocus": [64]
|
|
352
|
+
}, [[2, "blur", "handleHostBlur"], [2, "keydown", "handleHostKeyDown"], [2, "keyup", "handleHostKeyUp"]]]);
|
|
353
|
+
function defineCustomElement$1() {
|
|
354
|
+
if (typeof customElements === "undefined") {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const components = ["duet-choice", "duet-caption", "duet-icon", "duet-spacer", "duet-visually-hidden"];
|
|
358
|
+
components.forEach(tagName => { switch (tagName) {
|
|
359
|
+
case "duet-choice":
|
|
360
|
+
if (!customElements.get(tagName)) {
|
|
361
|
+
customElements.define(tagName, DuetChoice$1);
|
|
362
|
+
}
|
|
363
|
+
break;
|
|
364
|
+
case "duet-caption":
|
|
365
|
+
if (!customElements.get(tagName)) {
|
|
366
|
+
defineCustomElement$5();
|
|
367
|
+
}
|
|
368
|
+
break;
|
|
369
|
+
case "duet-icon":
|
|
370
|
+
if (!customElements.get(tagName)) {
|
|
371
|
+
defineCustomElement$4();
|
|
372
|
+
}
|
|
373
|
+
break;
|
|
374
|
+
case "duet-spacer":
|
|
375
|
+
if (!customElements.get(tagName)) {
|
|
376
|
+
defineCustomElement$3();
|
|
377
|
+
}
|
|
378
|
+
break;
|
|
379
|
+
case "duet-visually-hidden":
|
|
380
|
+
if (!customElements.get(tagName)) {
|
|
381
|
+
defineCustomElement$2();
|
|
382
|
+
}
|
|
383
|
+
break;
|
|
384
|
+
} });
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const DuetChoice = DuetChoice$1;
|
|
388
|
+
const defineCustomElement = defineCustomElement$1;
|
|
389
|
+
|
|
390
|
+
export { DuetChoice, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DuetCollapsible extends Components.DuetCollapsible, HTMLElement {}
|
|
4
|
+
export const DuetCollapsible: {
|
|
5
|
+
prototype: DuetCollapsible;
|
|
6
|
+
new (): DuetCollapsible;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|