@duetds/components 6.0.2 → 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 +51 -41
- 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 +6 -5
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +4 -4
- 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-8089a1a8.js → focus-utils-8a615003.js} +1 -1
- package/lib/cjs/{index-9d0e33db.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-card/duet-card.js +4 -2
- package/lib/collection/components/duet-choice/duet-choice.js +1 -1
- 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-9e76623d.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-9ed4eac7.system.entry.js → p-01c551f1.system.entry.js} +1 -1
- package/lib/duet/p-02305a1e.js +4 -0
- package/lib/duet/{p-f51969f5.entry.js → p-033bfa67.entry.js} +1 -1
- package/lib/duet/{p-86a3b203.system.entry.js → p-07a850a5.system.entry.js} +1 -1
- package/lib/duet/{p-211e59a0.system.entry.js → p-09e2ff96.system.entry.js} +1 -1
- package/lib/duet/{p-07f83b14.entry.js → p-0b74af40.entry.js} +1 -1
- package/lib/duet/{p-0c59905a.entry.js → p-0c2a51ac.entry.js} +1 -1
- package/lib/duet/{p-e56705ac.system.entry.js → p-0c9f0b8a.system.entry.js} +2 -2
- package/lib/duet/{p-4af6e3b1.entry.js → p-0d96924d.entry.js} +1 -1
- package/lib/duet/{p-67a78cbe.system.entry.js → p-0e48bca9.system.entry.js} +1 -1
- package/lib/duet/{p-82abc212.system.entry.js → p-0e98f667.system.entry.js} +1 -1
- package/lib/duet/{p-f5a06ff6.system.js → p-1999f503.system.js} +1 -1
- package/lib/duet/{p-e3a6351b.system.entry.js → p-1a41550e.system.entry.js} +1 -1
- package/lib/duet/{p-4d6b341d.system.entry.js → p-1bd57792.system.entry.js} +1 -1
- package/lib/duet/{p-567cab28.system.entry.js → p-1e0d7680.system.entry.js} +1 -1
- package/lib/duet/{p-921085f6.system.entry.js → p-1ebd7945.system.entry.js} +1 -1
- package/lib/duet/p-1fc60a60.system.js +4 -0
- package/lib/duet/{p-f416e108.entry.js → p-21662682.entry.js} +1 -1
- package/lib/duet/{p-2eea39f3.entry.js → p-23943f39.entry.js} +1 -1
- package/lib/duet/{p-9a3826e8.system.entry.js → p-23a8fa64.system.entry.js} +1 -1
- package/lib/duet/{p-902552a7.system.entry.js → p-264a0e0c.system.entry.js} +1 -1
- package/lib/duet/{p-5f407bd1.entry.js → p-27f72e70.entry.js} +1 -1
- package/lib/duet/{p-3c80d2fc.entry.js → p-2a3b1a2e.entry.js} +1 -1
- package/lib/duet/{p-6c022105.system.entry.js → p-2b320481.system.entry.js} +1 -1
- package/lib/duet/p-32f7178a.system.js +4 -0
- package/lib/duet/{p-196b2664.entry.js → p-3620ded5.entry.js} +1 -1
- package/lib/duet/{p-7d43d67b.entry.js → p-3904232a.entry.js} +1 -1
- package/lib/duet/{p-c89b1c28.entry.js → p-3b173cbd.entry.js} +1 -1
- package/lib/duet/{p-a9a9d22b.system.entry.js → p-430acad4.system.entry.js} +1 -1
- package/lib/duet/{p-5bde4aed.system.entry.js → p-4463946b.system.entry.js} +1 -1
- package/lib/duet/{p-cb1f9512.system.entry.js → p-44e9b1c8.system.entry.js} +1 -1
- package/lib/duet/p-49ce11a1.entry.js +4 -0
- package/lib/duet/{p-5d286e53.system.entry.js → p-4d6feeb5.system.entry.js} +1 -1
- package/lib/duet/{p-b4e8f605.system.entry.js → p-4d767c61.system.entry.js} +1 -1
- package/lib/duet/{p-94d496e1.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-0250c7b7.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-f8a52ab0.entry.js → p-5af6d9e2.entry.js} +1 -1
- package/lib/duet/{p-626a5916.entry.js → p-5e1d64d8.entry.js} +1 -1
- package/lib/duet/{p-422c0465.system.entry.js → p-5f6452ce.system.entry.js} +1 -1
- package/lib/duet/{p-b57a4b2d.system.entry.js → p-60e29f52.system.entry.js} +1 -1
- package/lib/duet/{p-29157f26.system.entry.js → p-613c4099.system.entry.js} +1 -1
- package/lib/duet/{p-f0e4f685.system.entry.js → p-61444a3d.system.entry.js} +1 -1
- package/lib/duet/{p-9ef03ba6.js → p-6aca8584.js} +1 -1
- package/lib/duet/{p-0c83d107.system.entry.js → p-6e5f2016.system.entry.js} +1 -1
- package/lib/duet/{p-0930ce38.system.entry.js → p-6f93638a.system.entry.js} +1 -1
- package/lib/duet/{p-bc23dcde.entry.js → p-71105750.entry.js} +1 -1
- package/lib/duet/{p-3bbfe384.entry.js → p-73c6e5fb.entry.js} +1 -1
- package/lib/duet/{p-af3a016a.system.entry.js → p-751f6957.system.entry.js} +1 -1
- package/lib/duet/{p-920f9ff2.system.js → p-77600ed7.system.js} +1 -1
- package/lib/duet/{p-32883741.system.entry.js → p-77ca874f.system.entry.js} +1 -1
- package/lib/duet/{p-4427f4b2.entry.js → p-787f9eba.entry.js} +1 -1
- package/lib/duet/{p-8a91c7bb.system.entry.js → p-7ad2cb10.system.entry.js} +1 -1
- package/lib/duet/p-7de4d97d.entry.js +4 -0
- package/lib/duet/{p-20b5e96b.system.entry.js → p-8107aeb5.system.entry.js} +1 -1
- package/lib/duet/{p-a687eeaa.system.entry.js → p-86cb85b9.system.entry.js} +1 -1
- package/lib/duet/{p-d644302f.js → p-875ae637.js} +1 -1
- package/lib/duet/{p-39e1c6da.system.entry.js → p-8aafa8e7.system.entry.js} +1 -1
- package/lib/duet/{p-8bcd7936.entry.js → p-8b09a46f.entry.js} +1 -1
- package/lib/duet/{p-9059b7e3.entry.js → p-8c08e7ba.entry.js} +1 -1
- package/lib/duet/p-8e8f8b29.entry.js +4 -0
- package/lib/duet/{p-012e33e8.entry.js → p-9094fcf8.entry.js} +1 -1
- package/lib/duet/{p-2ebf682d.entry.js → p-988a781d.entry.js} +1 -1
- package/lib/duet/{p-194f22b3.system.entry.js → p-a395d4bc.system.entry.js} +1 -1
- package/lib/duet/{p-3f1c98d0.entry.js → p-a585113b.entry.js} +1 -1
- package/lib/duet/{p-e233e6ed.entry.js → p-aa8973fc.entry.js} +1 -1
- package/lib/duet/{p-b014fdca.entry.js → p-ab7f4070.entry.js} +1 -1
- package/lib/duet/{p-278340d9.system.entry.js → p-ab89d948.system.entry.js} +1 -1
- package/lib/duet/{p-14a2d6f2.entry.js → p-aef02083.entry.js} +1 -1
- package/lib/duet/{p-24978396.entry.js → p-afdc57da.entry.js} +1 -1
- package/lib/duet/{p-a124d4a0.entry.js → p-b2abaa9e.entry.js} +1 -1
- package/lib/duet/{p-68419f1e.entry.js → p-b55e55b5.entry.js} +1 -1
- package/lib/duet/{p-007d0250.system.entry.js → p-bbc91480.system.entry.js} +1 -1
- package/lib/duet/{p-ecc8ec3e.entry.js → p-bbe1a2cd.entry.js} +1 -1
- package/lib/duet/{p-9bd36dc0.system.entry.js → p-bd3c926c.system.entry.js} +1 -1
- package/lib/duet/{p-3feb442e.system.entry.js → p-bec16aea.system.entry.js} +1 -1
- package/lib/duet/p-bf59e11d.entry.js +4 -0
- package/lib/duet/{p-d5ef1959.system.entry.js → p-c4217626.system.entry.js} +1 -1
- package/lib/duet/{p-e1a1e52d.system.entry.js → p-c5f6ea62.system.entry.js} +1 -1
- package/lib/duet/{p-6ebb40da.entry.js → p-c6d05091.entry.js} +1 -1
- package/lib/duet/{p-c3d3f68d.system.entry.js → p-c73a591d.system.entry.js} +1 -1
- package/lib/duet/{p-35eaa5a8.entry.js → p-c863a0d1.entry.js} +1 -1
- package/lib/duet/{p-33300690.entry.js → p-c986532d.entry.js} +1 -1
- package/lib/duet/{p-b43a8c7a.entry.js → p-caa49454.entry.js} +1 -1
- package/lib/duet/{p-ddf8a652.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-4f235805.entry.js → p-defba7cd.entry.js} +1 -1
- package/lib/duet/{p-b9e9ac80.system.js → p-df785776.system.js} +1 -1
- package/lib/duet/{p-ea60602a.entry.js → p-e9862947.entry.js} +1 -1
- package/lib/duet/{p-b9b19fe9.entry.js → p-eb74c96e.entry.js} +1 -1
- package/lib/duet/{p-f96da661.entry.js → p-ece47184.entry.js} +1 -1
- package/lib/duet/{p-178e0ae7.entry.js → p-f09f968c.entry.js} +1 -1
- package/lib/duet/{p-2171d336.entry.js → p-f97776be.entry.js} +1 -1
- package/lib/duet/{p-1c0fdc62.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 +6 -5
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +4 -4
- 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-0d0e51b6.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-236f580e.js +4 -0
- package/lib/esm-es5/{index-0d0e51b6.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-card/duet-card.d.ts +2 -0
- 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 -14109
- package/lib/duet/p-16d21cef.entry.js +0 -4
- package/lib/duet/p-6002f3d2.system.js +0 -4
- package/lib/duet/p-79817456.entry.js +0 -4
- package/lib/duet/p-835f4429.entry.js +0 -4
- package/lib/duet/p-a93a04b9.system.js +0 -4
- package/lib/duet/p-b6ef2e72.entry.js +0 -4
- package/lib/duet/p-d1746325.js +0 -4
- package/lib/esm-es5/focus-utils-9e76623d.js +0 -4
- package/lib/esm-es5/tokens-8ff8c570.js +0 -4
|
@@ -0,0 +1,341 @@
|
|
|
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 { a as getLanguage, g as getLocaleString } from './p-ede854e1.js';
|
|
8
|
+
import { g as getColorByName } from './p-86faf728.js';
|
|
9
|
+
import { d as defineCustomElement$3 } from './p-7739604d.js';
|
|
10
|
+
import { d as defineCustomElement$2 } from './p-3d987b87.js';
|
|
11
|
+
import { d as defineCustomElement$1 } from './p-b08e57cf.js';
|
|
12
|
+
|
|
13
|
+
const duetButtonCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:8px !important;margin-bottom:12px !important;position:relative;z-index:1;display:inline-flex;width:auto;max-width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}:host:last-child,:host:last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){:host{width:100%}}:host(.input-button){z-index:250}:host(.duet-small){margin-right:2px !important;margin-bottom:8px !important}:host(.duet-small):last-child,:host(.duet-small):last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){:host(.duet-small){width:auto}}:host(.duet-expand){width:100% !important}:host(.duet-m-0){margin:0 !important}:host(.duet-fixed){width:auto !important}:host(:last-child){margin-right:0 !important}.duet-button-container{position:relative;width:100%}.duet-button{padding:14px 27px 15px !important;-webkit-user-select:none;user-select:none;position:relative;z-index:100;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:600;-webkit-hyphens:auto;hyphens:auto;line-height:1.1;color:#0077b3 !important;text-align:center;text-decoration:none;cursor:pointer;background:transparent;border-style:solid;border-width:2px;border-radius:20rem;transition:background-color 300ms ease, color 300ms ease, border 300ms ease, box-shadow 300ms ease}.duet-button.duet-p-0{padding:0 !important}.duet-button.duet-m-0{margin:0 !important}.duet-button:not(.input-button-primary,.input-button-secondary){font-variant-numeric:tabular-nums}.duet-button.duet-button-text-center{text-align:center !important}.duet-button.duet-button-is-small:not(.duet-button-icon-only){padding:9px 19px 10px !important;min-width:5.3333333333rem;font-size:0.875rem}.duet-button.duet-button-is-small:not(.duet-button-icon-only).icon{padding-left:48px !important}.duet-button.duet-button-is-small:not(.duet-button-icon-only).icon-right{padding-right:48px !important;padding-left:20px !important}.duet-theme-turva .duet-button{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#c60c30 !important}.duet-button .duet-button-contents{position:relative;display:inline-block;margin:0 auto;pointer-events:none}.duet-button.duet-no-wrap{white-space:nowrap}.duet-button.icon{padding-left:52px !important}.duet-button.icon-right{padding-right:52px !important;padding-left:28px !important}.duet-button svg{width:100%;min-width:100%;fill:currentColor}.duet-button .duet-button-icon{position:absolute;top:50%;left:-28px;display:flex;align-items:center;justify-content:center;width:16px;height:16px;margin:0 !important;transform:translateY(-50%)}.duet-button .duet-button-icon duet-icon{width:16px;height:16px}.duet-button .duet-button-icon.right{right:-28px;left:auto}.duet-button .duet-button-icon.large{left:-32px;width:20px;height:20px}.duet-button .duet-button-icon.large duet-icon{width:20px;height:20px}.duet-button .duet-button-icon.large.right{right:-32px;left:auto}.duet-button .duet-button-icon.medium-small{left:-16px;width:10px;height:10px;padding-top:1px}.duet-button .duet-button-icon.medium-small duet-icon{width:10px;height:10px}.duet-button .duet-button-icon.medium-small.right{right:-16px;left:auto}.duet-button .duet-button-icon.small{left:-16px;width:7px;height:7px}.duet-button .duet-button-icon.small duet-icon{width:7px;height:7px}.duet-button .duet-button-icon.small.right{right:-16px;left:auto}.duet-button:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva .duet-button:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-button:active{opacity:0.75;transition:none}.duet-button.default{border-color:#e1e3e6}.duet-theme-turva .duet-button.default{color:#c60c30 !important;border-color:#e4e4e6}.duet-button.default:hover{border-color:#0077b3}.duet-theme-turva .duet-button.default:hover{border-color:#c60c30}.duet-button.default.duet-button-negative{background-color:white}.duet-theme-turva .duet-button.default.duet-button-negative{background-color:#e4e4e6 !important}.duet-button.default.duet-button-negative:hover{color:#0077b3 !important;border-color:#0077b3}.duet-theme-turva .duet-button.default.duet-button-negative:hover{color:#c60c30 !important;border-color:#c60c30}.duet-button.primary,.duet-button.input-button-primary{color:white !important;background:#0077b3;border-color:#0077b3}.duet-theme-turva .duet-button.primary,.duet-theme-turva .duet-button.input-button-primary{color:white !important;background:#c60c30;border-color:#c60c30}.duet-button.primary:hover,.duet-button.input-button-primary:hover{background:#005f8f;border-color:#005f8f;box-shadow:0 4px 20px rgba(34, 34, 34, 0.1)}.duet-theme-turva .duet-button.primary:hover,.duet-theme-turva .duet-button.input-button-primary:hover{background:#940925;border-color:#940925}.duet-button.primary:focus,.duet-button.input-button-primary:focus{outline:0;box-shadow:0 0 0 1px white, 0 0 0 4px rgba(0, 119, 179, 0.75)}.duet-theme-turva .duet-button.primary:focus,.duet-theme-turva .duet-button.input-button-primary:focus{box-shadow:0 0 0 1px white, 0 0 0 4px rgba(23, 28, 58, 0.7)}.duet-button.secondary,.duet-button.input-button-secondary{color:#00294d !important;background:transparent;border-color:#00294d}.duet-theme-turva .duet-button.secondary,.duet-theme-turva .duet-button.input-button-secondary{color:#171c3a !important;border-color:#171c3a}.duet-button.secondary:hover,.duet-button.input-button-secondary:hover{color:#0077b3 !important;border-color:#0077b3}.duet-theme-turva .duet-button.secondary:hover,.duet-theme-turva .duet-button.input-button-secondary:hover{color:#c60c30 !important;border-color:#c60c30}.duet-button.secondary.duet-button-negative,.duet-button.input-button-secondary.duet-button-negative{color:#e1e3e6 !important;border-color:white}.duet-theme-turva .duet-button.secondary.duet-button-negative,.duet-theme-turva .duet-button.input-button-secondary.duet-button-negative{color:#e4e4e6 !important}.duet-button.secondary.duet-button-negative:hover,.duet-button.input-button-secondary.duet-button-negative:hover{color:#0077b3 !important;border-color:#0077b3}.duet-theme-turva .duet-button.secondary.duet-button-negative:hover,.duet-theme-turva .duet-button.input-button-secondary.duet-button-negative:hover{color:#c60c30 !important;border-color:#c60c30}.duet-button.negative{color:#00294d !important;background:white;border-color:white}.duet-theme-turva .duet-button.negative{color:#171c3a !important}.duet-button.negative:hover{color:white !important;background:transparent;border-color:white}.duet-button.negative:focus{outline:0;box-shadow:0 0 0 1px #00294d, 0 0 0 4px rgba(255, 255, 255, 0.7)}.duet-theme-turva .duet-button.negative:focus{box-shadow:0 0 0 1px #171c3a, 0 0 0 4px rgba(255, 255, 255, 0.7)}.duet-button.destructive-primary{color:white !important;background:#de2362;border-color:#de2362}.duet-theme-turva .duet-button.destructive-primary{color:white !important;background:#e02a0d;border-color:#e02a0d}.duet-button.destructive-primary:hover{background:#b21c4e;border-color:#b21c4e;box-shadow:0 4px 20px rgba(34, 34, 34, 0.1)}.duet-theme-turva .duet-button.destructive-primary:hover{background:#b3220a}.duet-button.destructive,.duet-button.destructive-secondary{color:#de2362 !important;background:white;border-color:#de2362}.duet-theme-turva .duet-button.destructive,.duet-theme-turva .duet-button.destructive-secondary{color:#e02a0d !important;background:white;border-color:#e02a0d}.duet-button.destructive:hover,.duet-button.destructive-secondary:hover{color:white !important;background:#b21c4e;border-color:#b21c4e}.duet-theme-turva .duet-button.destructive:hover,.duet-theme-turva .duet-button.destructive-secondary:hover{color:white !important;background:#b3220a;border-color:#b3220a}.duet-button.plain{min-width:48px;padding-right:0 !important;padding-left:0 !important;line-height:1.5;text-align:left;background:transparent;border:0;border-color:transparent;border-radius:4px}.duet-theme-turva .duet-button.plain{color:#c60c30 !important;background:transparent;border-color:transparent}.duet-button.plain.icon{padding-left:20px !important}.duet-button.plain.icon.icon-right{padding-right:20px !important;padding-left:0 !important}.duet-button.plain.icon.medium{padding-left:24px !important}.duet-button.plain.icon.medium.icon-right{padding-right:24px !important;padding-left:0 !important}.duet-button.plain.icon.large{padding-left:30px !important}.duet-button.plain.icon.large.icon-right{padding-right:30px !important;padding-left:0 !important}.duet-button.plain .duet-button-icon.left{left:-16.6666666667px !important}.duet-button.plain .duet-button-icon.left.medium{left:-24px !important}.duet-button.plain .duet-button-icon.left.large{left:-30px !important}.duet-button.plain .duet-button-icon.right{right:-16.6666666667px !important}.duet-button.plain .duet-button-icon.right.medium{right:-24px !important}.duet-button.plain .duet-button-icon.right.large{right:-30px !important}.duet-button.plain[disabled]{color:#657787 !important;background:transparent !important;border-color:transparent !important}.duet-theme-turva .duet-button.plain[disabled]{color:transparent !important;background:transparent !important;border-color:#e4e4e6 !important}.duet-button.plain:hover{color:#004d80 !important;background:transparent !important}.duet-theme-turva .duet-button.plain:hover{color:#940925 !important}.duet-button.plain.duet-button-negative{color:white !important}.duet-theme-turva .duet-button.plain.duet-button-negative{color:#e4e4e6 !important}.duet-button.plain.duet-button-negative:hover{color:#0077b3 !important}.duet-theme-turva .duet-button.plain.duet-button-negative:hover{color:#c60c30 !important}.duet-button.duet-button-icon-only{min-width:48px;min-height:48px;padding:0 !important}.duet-button.duet-button-icon-only .duet-button-contents{position:static}.duet-button.duet-button-icon-only .duet-button-icon.left.large,.duet-button.duet-button-icon-only .duet-button-icon.left.medium,.duet-button.duet-button-icon-only .duet-button-icon.left.small{position:absolute;top:50% !important;left:50% !important;padding:0;margin:0;transform:translateX(-50%) translateY(-50%)}.duet-button.duet-button.input-button-primary,.duet-button.duet-button.input-button-secondary{box-sizing:content-box;min-width:48px;min-height:48px;padding:0 !important;border-width:1px;border-top-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:0}.duet-button.duet-button.input-button-primary .duet-button-contents,.duet-button.duet-button.input-button-secondary .duet-button-contents{position:static}.duet-button.duet-button.input-button-primary .duet-button-icon.left.large,.duet-button.duet-button.input-button-primary .duet-button-icon.left.medium,.duet-button.duet-button.input-button-primary .duet-button-icon.left.small,.duet-button.duet-button.input-button-secondary .duet-button-icon.left.large,.duet-button.duet-button.input-button-secondary .duet-button-icon.left.medium,.duet-button.duet-button.input-button-secondary .duet-button-icon.left.small{position:absolute;top:50% !important;left:50% !important;padding:0;margin:0;transform:translateX(-50%) translateY(-50%)}.duet-button[disabled],.duet-button[disabled]:hover,.duet-button.duet-button-negative[disabled],.duet-button.duet-button-negative[disabled]:hover{color:#657787 !important;background:#e1e3e6 !important;border-color:#e1e3e6 !important;box-shadow:none !important}.duet-theme-turva .duet-button[disabled],.duet-theme-turva .duet-button[disabled]:hover,.duet-theme-turva .duet-button.duet-button-negative [disabled],.duet-theme-turva .duet-button.duet-button-negative [disabled]:hover{color:#747475 !important;background:#e4e4e6 !important;border-color:#e4e4e6 !important}.duet-button-is-loading.primary,.duet-button-is-loading.input-button-primary{color:white}.duet-button-is-loading.default{color:#0077b3}.duet-button-is-loading.default.duet-theme-turva{color:#c60c30}.duet-button-is-loading .duet-button-contents{visibility:hidden;opacity:0}";
|
|
14
|
+
|
|
15
|
+
const DuetButton = /*@__PURE__*/ proxyCustomElement(class extends H {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.__registerHost();
|
|
19
|
+
this.__attachShadow();
|
|
20
|
+
this.duetFocus = createEvent(this, "duetFocus", 7);
|
|
21
|
+
this.duetBlur = createEvent(this, "duetBlur", 7);
|
|
22
|
+
/**
|
|
23
|
+
* Use this property to add an aria-haspopup attribute to a button, if you are using it as a menu button.
|
|
24
|
+
*/
|
|
25
|
+
this.accessiblePopup = "false";
|
|
26
|
+
/**
|
|
27
|
+
* Details of the component
|
|
28
|
+
*/
|
|
29
|
+
this.accessibleDetails = undefined;
|
|
30
|
+
/**
|
|
31
|
+
* String of id's that indicate alternative labels elements
|
|
32
|
+
*/
|
|
33
|
+
this.accessibleLabelledBy = undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Aria description the button
|
|
36
|
+
*/
|
|
37
|
+
this.accessibleDescription = undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Loading state of the button
|
|
40
|
+
*/
|
|
41
|
+
this.loading = false;
|
|
42
|
+
/**
|
|
43
|
+
* Style variation of the button.
|
|
44
|
+
* @negative - value is deprecated and should be used in combination with negative prop in the future
|
|
45
|
+
* @destructive - value is deprecated and should be replace with destructive-secondary
|
|
46
|
+
*/
|
|
47
|
+
this.variation = "default";
|
|
48
|
+
/**
|
|
49
|
+
* Negative variation, can be combined with Variation to produce negative versions
|
|
50
|
+
*/
|
|
51
|
+
this.negative = false;
|
|
52
|
+
/**
|
|
53
|
+
* Theme of the button.
|
|
54
|
+
*/
|
|
55
|
+
this.theme = "";
|
|
56
|
+
/**
|
|
57
|
+
* Controls the margin of the component.
|
|
58
|
+
*/
|
|
59
|
+
this.margin = "auto";
|
|
60
|
+
/**
|
|
61
|
+
* Controls the padding of the component.
|
|
62
|
+
*/
|
|
63
|
+
this.padding = "auto";
|
|
64
|
+
/**
|
|
65
|
+
* Centers the text of a button
|
|
66
|
+
*/
|
|
67
|
+
this.centerText = false;
|
|
68
|
+
/**
|
|
69
|
+
* Controls the text wrapping.
|
|
70
|
+
*/
|
|
71
|
+
this.wrapping = "auto";
|
|
72
|
+
/**
|
|
73
|
+
* Expands the button to fill 100% of the container width.
|
|
74
|
+
*/
|
|
75
|
+
this.expand = false;
|
|
76
|
+
/**
|
|
77
|
+
* Keep the button fixed width even on mobile viewports.
|
|
78
|
+
*/
|
|
79
|
+
this.fixed = false;
|
|
80
|
+
/**
|
|
81
|
+
* Makes the button component disabled. This prevents users from being able to
|
|
82
|
+
* interact with the button, and conveys its inactive state to assistive technologies.
|
|
83
|
+
*/
|
|
84
|
+
this.disabled = false;
|
|
85
|
+
/**
|
|
86
|
+
* Allows the button to submit a form.
|
|
87
|
+
*/
|
|
88
|
+
this.submit = false;
|
|
89
|
+
/**
|
|
90
|
+
* Forces URL to open in a new browser tab. Used together with URL prop.
|
|
91
|
+
*/
|
|
92
|
+
this.external = false;
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing
|
|
95
|
+
* @default "fi"
|
|
96
|
+
*/
|
|
97
|
+
this.language = getLanguage();
|
|
98
|
+
/**
|
|
99
|
+
* Property to change accessibleLabelExternal defaults on the component.
|
|
100
|
+
* normally you would handle these strings on an application level and override @accessibleLabelExternal when needed
|
|
101
|
+
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
102
|
+
*/
|
|
103
|
+
this.accessibleLabelExternalDefaults = DuetStringsExternalDefaults;
|
|
104
|
+
/**
|
|
105
|
+
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
106
|
+
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
107
|
+
*/
|
|
108
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
109
|
+
/**
|
|
110
|
+
* Icon to display to the left of the button content.
|
|
111
|
+
* This is ignored/overridden when button is used as an external link.
|
|
112
|
+
*/
|
|
113
|
+
this.icon = "";
|
|
114
|
+
/**
|
|
115
|
+
* Custom color to be used for text, as a design token entered in camelCase or
|
|
116
|
+
* kebab-case. Example: "color-primary".
|
|
117
|
+
*/
|
|
118
|
+
this.color = "";
|
|
119
|
+
/**
|
|
120
|
+
* Show icon on the right side of the button content.
|
|
121
|
+
*/
|
|
122
|
+
this.iconRight = false;
|
|
123
|
+
/**
|
|
124
|
+
* Icon size.
|
|
125
|
+
*/
|
|
126
|
+
this.iconSize = "medium";
|
|
127
|
+
/**
|
|
128
|
+
* Button’s size.
|
|
129
|
+
*/
|
|
130
|
+
this.size = "medium";
|
|
131
|
+
/**
|
|
132
|
+
* Whether this button should use styles meant for displaying just an icon.
|
|
133
|
+
*/
|
|
134
|
+
this.iconOnly = false;
|
|
135
|
+
/**
|
|
136
|
+
* Component event handling.
|
|
137
|
+
*/
|
|
138
|
+
this.handleClick = (ev) => {
|
|
139
|
+
// If this button wants to specifically submit a form
|
|
140
|
+
// climb up the dom to see if we're in a <form>
|
|
141
|
+
// and if so, then use JS to submit it.
|
|
142
|
+
// To understand better, see: https://www.hjorthhansen.dev/shadow-dom-form-participation/
|
|
143
|
+
if (!this.url && this.element.closest("form")) {
|
|
144
|
+
ev.preventDefault();
|
|
145
|
+
this.proxyButton.click();
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
this.onFocus = () => {
|
|
149
|
+
this.duetFocus.emit();
|
|
150
|
+
};
|
|
151
|
+
this.onBlur = () => {
|
|
152
|
+
this.duetBlur.emit();
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Component lifecycle events.
|
|
157
|
+
*/
|
|
158
|
+
componentWillLoad() {
|
|
159
|
+
inheritGlobalTheme(this);
|
|
160
|
+
if (this.url && this.external && this.icon) {
|
|
161
|
+
console.warn("[DUET]: Button used as an external link will override any icon that is set");
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
connectedCallback() {
|
|
165
|
+
this.proxyButton = document.createElement("button");
|
|
166
|
+
this.proxyButton.style.display = "none";
|
|
167
|
+
this.syncToProxyButton();
|
|
168
|
+
if (!this.url && this.element.closest("form")) {
|
|
169
|
+
this.element.insertAdjacentElement("beforebegin", this.proxyButton);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
disconnectedCallback() {
|
|
173
|
+
this.proxyButton.remove();
|
|
174
|
+
this.proxyButton = null;
|
|
175
|
+
}
|
|
176
|
+
syncToProxyButton() {
|
|
177
|
+
this.proxyButton.type = this.getButtonType();
|
|
178
|
+
this.proxyButton.disabled = this.disabled;
|
|
179
|
+
// attributes should be removed in cases where name/value is not set
|
|
180
|
+
if (this.name != null) {
|
|
181
|
+
this.proxyButton.name = this.name;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
this.proxyButton.removeAttribute("name");
|
|
185
|
+
}
|
|
186
|
+
if (this.value != null) {
|
|
187
|
+
this.proxyButton.value = this.value;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
this.proxyButton.removeAttribute("value");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
getButtonType() {
|
|
194
|
+
return this.submit ? "submit" : "button";
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Sets focus on the specified `duet-button`. Use this method instead of the global
|
|
198
|
+
* `button.focus()`.
|
|
199
|
+
*/
|
|
200
|
+
async setFocus(options) {
|
|
201
|
+
if (this.nativeButton) {
|
|
202
|
+
this.nativeButton.focus(options);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* render() function.
|
|
207
|
+
* Always the last one in the class.
|
|
208
|
+
*/
|
|
209
|
+
render() {
|
|
210
|
+
const isExternalLink = this.external && this.url;
|
|
211
|
+
// enforce consistency for external links
|
|
212
|
+
const icon = isExternalLink ? "action-new-window" : this.icon;
|
|
213
|
+
const iconRight = isExternalLink ? true : this.iconRight;
|
|
214
|
+
const commonChildren = (h("span", { class: "duet-button-contents", style: { color: getColorByName(this.color) } }, icon && (h("div", { "aria-hidden": "true", class: {
|
|
215
|
+
"duet-button-icon": true,
|
|
216
|
+
left: !iconRight,
|
|
217
|
+
right: iconRight,
|
|
218
|
+
[this.iconSize]: true,
|
|
219
|
+
} }, h("duet-icon", { size: "auto", margin: "none", name: icon, color: "currentColor" }))), h("slot", null)));
|
|
220
|
+
const commonProps = {
|
|
221
|
+
onFocus: this.onFocus,
|
|
222
|
+
onBlur: this.onBlur,
|
|
223
|
+
ref: button => (this.nativeButton = button),
|
|
224
|
+
id: this.identifier,
|
|
225
|
+
class: {
|
|
226
|
+
"duet-m-0": this.margin === "none",
|
|
227
|
+
"duet-p-0": this.padding === "none",
|
|
228
|
+
"duet-no-wrap": this.wrapping === "none",
|
|
229
|
+
"duet-button": true,
|
|
230
|
+
"duet-button-is-small": this.size === "small",
|
|
231
|
+
"duet-button-icon-only": this.iconOnly,
|
|
232
|
+
"duet-button-text-center": this.centerText,
|
|
233
|
+
"duet-button-negative": this.negative || this.variation === "negative",
|
|
234
|
+
[this.variation]: true,
|
|
235
|
+
disabled: this.disabled,
|
|
236
|
+
icon: !!icon,
|
|
237
|
+
"icon-right": iconRight,
|
|
238
|
+
[this.iconSize]: true,
|
|
239
|
+
},
|
|
240
|
+
"aria-controls": this.accessibleControls,
|
|
241
|
+
"aria-label": this.accessibleLabel,
|
|
242
|
+
"aria-expanded": this.accessibleExpanded != null ? this.accessibleExpanded.toString() : undefined,
|
|
243
|
+
"aria-activedescendant": this.accessibleActiveDescendant,
|
|
244
|
+
"aria-owns": this.accessibleOwns,
|
|
245
|
+
"aria-describedby": this.accessibleDescribedBy,
|
|
246
|
+
"aria-labelledby": this.accessibleLabelledBy,
|
|
247
|
+
"aria-details": this.accessibleDetails,
|
|
248
|
+
"aria-description": this.accessibleDescription,
|
|
249
|
+
};
|
|
250
|
+
return (h(Host, { onClick: this.handleClick, class: {
|
|
251
|
+
"duet-m-0": this.margin === "none",
|
|
252
|
+
"duet-small": this.size === "small",
|
|
253
|
+
"duet-fixed": this.fixed,
|
|
254
|
+
"duet-expand": this.expand,
|
|
255
|
+
"input-button": this.variation === "input-button-primary" || this.variation === "input-button-secondary",
|
|
256
|
+
} }, h("div", { class: {
|
|
257
|
+
"duet-button-container": true,
|
|
258
|
+
"duet-button-is-loading": this.loading,
|
|
259
|
+
"duet-theme-turva": this.theme === "turva",
|
|
260
|
+
"duet-button-negative": this.negative || this.variation === "negative",
|
|
261
|
+
[this.variation]: true,
|
|
262
|
+
} }, this.url ? (h("a", Object.assign({}, commonProps, { href: this.url, target: this.external ? "_blank" : "_self", rel: this.external ? "noopener" : undefined }), commonChildren, this.external && h("duet-visually-hidden", null, ", ", this.accessibleLabelExternal))) : (h("button", Object.assign({}, commonProps, { type: this.getButtonType(), disabled: this.disabled, name: this.name, value: this.value, "aria-pressed": this.accessiblePressed != null ? this.accessiblePressed.toString() : undefined, "aria-haspopup": this.accessiblePopup != null ? this.accessiblePopup.toString() : undefined }), commonChildren)), this.loading && h("duet-spinner", { color: "currentColor" }))));
|
|
263
|
+
}
|
|
264
|
+
get element() { return this; }
|
|
265
|
+
static get watchers() { return {
|
|
266
|
+
"disabled": ["syncToProxyButton"],
|
|
267
|
+
"submit": ["syncToProxyButton"],
|
|
268
|
+
"value": ["syncToProxyButton"],
|
|
269
|
+
"name": ["syncToProxyButton"]
|
|
270
|
+
}; }
|
|
271
|
+
static get style() { return duetButtonCss; }
|
|
272
|
+
}, [1, "duet-button", {
|
|
273
|
+
"accessibleLabel": [1, "accessible-label"],
|
|
274
|
+
"accessibleControls": [1, "accessible-controls"],
|
|
275
|
+
"accessiblePopup": [1, "accessible-popup"],
|
|
276
|
+
"accessibleActiveDescendant": [1, "accessible-active-descendant"],
|
|
277
|
+
"accessibleOwns": [1, "accessible-owns"],
|
|
278
|
+
"accessibleDescribedBy": [1, "accessible-described-by"],
|
|
279
|
+
"accessibleDetails": [1, "accessible-details"],
|
|
280
|
+
"accessibleLabelledBy": [1, "accessible-labelled-by"],
|
|
281
|
+
"accessibleDescription": [1, "accessible-description"],
|
|
282
|
+
"accessibleExpanded": [4, "accessible-expanded"],
|
|
283
|
+
"accessiblePressed": [4, "accessible-pressed"],
|
|
284
|
+
"loading": [4],
|
|
285
|
+
"variation": [1],
|
|
286
|
+
"negative": [4],
|
|
287
|
+
"theme": [1025],
|
|
288
|
+
"margin": [1],
|
|
289
|
+
"padding": [1],
|
|
290
|
+
"centerText": [4, "center-text"],
|
|
291
|
+
"wrapping": [1],
|
|
292
|
+
"expand": [4],
|
|
293
|
+
"fixed": [4],
|
|
294
|
+
"disabled": [516],
|
|
295
|
+
"name": [1],
|
|
296
|
+
"value": [1],
|
|
297
|
+
"identifier": [1],
|
|
298
|
+
"submit": [516],
|
|
299
|
+
"external": [4],
|
|
300
|
+
"language": [1],
|
|
301
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
302
|
+
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
303
|
+
"icon": [1],
|
|
304
|
+
"color": [1],
|
|
305
|
+
"iconRight": [4, "icon-right"],
|
|
306
|
+
"iconSize": [1, "icon-size"],
|
|
307
|
+
"size": [1],
|
|
308
|
+
"iconOnly": [4, "icon-only"],
|
|
309
|
+
"url": [513],
|
|
310
|
+
"setFocus": [64]
|
|
311
|
+
}]);
|
|
312
|
+
function defineCustomElement() {
|
|
313
|
+
if (typeof customElements === "undefined") {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const components = ["duet-button", "duet-icon", "duet-spinner", "duet-visually-hidden"];
|
|
317
|
+
components.forEach(tagName => { switch (tagName) {
|
|
318
|
+
case "duet-button":
|
|
319
|
+
if (!customElements.get(tagName)) {
|
|
320
|
+
customElements.define(tagName, DuetButton);
|
|
321
|
+
}
|
|
322
|
+
break;
|
|
323
|
+
case "duet-icon":
|
|
324
|
+
if (!customElements.get(tagName)) {
|
|
325
|
+
defineCustomElement$3();
|
|
326
|
+
}
|
|
327
|
+
break;
|
|
328
|
+
case "duet-spinner":
|
|
329
|
+
if (!customElements.get(tagName)) {
|
|
330
|
+
defineCustomElement$2();
|
|
331
|
+
}
|
|
332
|
+
break;
|
|
333
|
+
case "duet-visually-hidden":
|
|
334
|
+
if (!customElements.get(tagName)) {
|
|
335
|
+
defineCustomElement$1();
|
|
336
|
+
}
|
|
337
|
+
break;
|
|
338
|
+
} });
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export { DuetButton as D, defineCustomElement as d };
|
|
@@ -0,0 +1,87 @@
|
|
|
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 { c as createID } from './p-c1325e35.js';
|
|
7
|
+
import { d as defineCustomElement$1 } from './p-e5c8a58f.js';
|
|
8
|
+
|
|
9
|
+
const duetFieldsetCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;display:block;width:100%}:host(.duet-m-0){margin:0 !important}fieldset{border:0}legend{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-legend-wrapper{position:relative;display:block;width:100%;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:600;line-height:1.5;color:#00294d;text-align:left;background:transparent}.duet-theme-turva .duet-legend-wrapper{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}.duet-fieldset-label{margin-bottom:12px !important;margin-top:8px}.duet-legend-has-caption .duet-fieldset-label{margin-bottom:6px !important}.duet-legend-has-tooltip .duet-fieldset-label{padding-right:36px}@media (min-width: 48em){.duet-legend-has-tooltip .duet-fieldset-label{margin-bottom:3px !important;padding-right:0}}@media (min-width: 48em){.duet-legend-has-tooltip.duet-legend-has-caption .duet-fieldset-label{margin-bottom:-3px !important}}.duet-fieldset-caption{margin-bottom:12px !important}.duet-fieldset-help{display:block;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:0.875rem;font-weight:400;line-height:1.25;color:#de2362;border-radius:4px}.duet-fieldset-help span{display:block;margin-top:12px}.duet-theme-turva .duet-fieldset-help{color:#e02a0d}::slotted(duet-tooltip){position:absolute;top:4px;right:0}@media (min-width: 48em){::slotted(duet-tooltip){position:relative;right:auto}}.duet-legend-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
10
|
+
|
|
11
|
+
const DuetFieldset = /*@__PURE__*/ proxyCustomElement(class extends H {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.__registerHost();
|
|
15
|
+
this.__attachShadow();
|
|
16
|
+
this.errorId = createID("DuetError");
|
|
17
|
+
this.labelId = createID("DuetLabel");
|
|
18
|
+
this.hasTooltip = false;
|
|
19
|
+
/**
|
|
20
|
+
* Theme of the fieldset.
|
|
21
|
+
*/
|
|
22
|
+
this.theme = "";
|
|
23
|
+
/**
|
|
24
|
+
* Controls the margin of the component.
|
|
25
|
+
*/
|
|
26
|
+
this.margin = "auto";
|
|
27
|
+
/**
|
|
28
|
+
* Visually hide the label, but still show it to screen readers.
|
|
29
|
+
*/
|
|
30
|
+
this.labelHidden = false;
|
|
31
|
+
this.checkHasTooltip = () => {
|
|
32
|
+
this.hasTooltip = !!this.element.querySelector("[slot='tooltip']");
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Component lifecycle events.
|
|
37
|
+
*/
|
|
38
|
+
componentWillLoad() {
|
|
39
|
+
inheritGlobalTheme(this);
|
|
40
|
+
this.checkHasTooltip();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* render() function
|
|
44
|
+
* Always the last one in the class.
|
|
45
|
+
*/
|
|
46
|
+
render() {
|
|
47
|
+
return (h(Host, { class: { "duet-m-0": this.margin === "none" } }, h("fieldset", { "aria-labelledby": `${this.labelId} ${this.errorId}`, class: {
|
|
48
|
+
"duet-fieldset": true,
|
|
49
|
+
"duet-theme-turva": this.theme === "turva",
|
|
50
|
+
} }, h("legend", { id: this.labelId }, h("span", null, this.label), this.caption && h("span", null, this.caption)), h("div", { class: {
|
|
51
|
+
"duet-legend-wrapper": true,
|
|
52
|
+
"duet-legend-has-caption": !!this.caption,
|
|
53
|
+
"duet-legend-has-tooltip": this.hasTooltip,
|
|
54
|
+
"duet-legend-hidden": this.labelHidden,
|
|
55
|
+
} }, h("div", { class: "duet-fieldset-label" }, h("span", { "aria-hidden": "true" }, this.label), h("slot", { onSlotchange: this.checkHasTooltip, name: "tooltip" })), this.caption && (h("div", { class: "duet-fieldset-caption", "aria-hidden": "true" }, h("duet-caption", { margin: "none" }, this.caption)))), h("slot", null), h("span", { class: "duet-fieldset-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h("span", null, this.error)))));
|
|
56
|
+
}
|
|
57
|
+
get element() { return this; }
|
|
58
|
+
static get style() { return duetFieldsetCss; }
|
|
59
|
+
}, [1, "duet-fieldset", {
|
|
60
|
+
"theme": [1025],
|
|
61
|
+
"margin": [1],
|
|
62
|
+
"caption": [1],
|
|
63
|
+
"label": [1],
|
|
64
|
+
"error": [1],
|
|
65
|
+
"labelHidden": [4, "label-hidden"],
|
|
66
|
+
"hasTooltip": [32]
|
|
67
|
+
}]);
|
|
68
|
+
function defineCustomElement() {
|
|
69
|
+
if (typeof customElements === "undefined") {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const components = ["duet-fieldset", "duet-caption"];
|
|
73
|
+
components.forEach(tagName => { switch (tagName) {
|
|
74
|
+
case "duet-fieldset":
|
|
75
|
+
if (!customElements.get(tagName)) {
|
|
76
|
+
customElements.define(tagName, DuetFieldset);
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
case "duet-caption":
|
|
80
|
+
if (!customElements.get(tagName)) {
|
|
81
|
+
defineCustomElement$1();
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
} });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { DuetFieldset as D, defineCustomElement as d };
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
|
|
7
|
+
const duetCaptionCss = ":host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:16px !important;display:flex;flex:0 0 100%;width:100%;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;line-height:1.5;color:#657787;vertical-align:top}:host.duet-p-0{padding:0 !important}:host.duet-m-0{margin:0 !important}:host(.duet-caption-small){font-size:0.875rem;line-height:1.25}:host(.duet-theme-turva){font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#747475}:host(.duet-caption-selected){color:#0077b3}:host(.duet-caption-selected.duet-theme-turva){color:#171c3a}:host(.duet-m-0){margin:0 !important}";
|
|
8
|
+
|
|
9
|
+
const DuetCaption = /*@__PURE__*/ proxyCustomElement(class extends H {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
/**
|
|
15
|
+
* Theme of the caption.
|
|
16
|
+
*/
|
|
17
|
+
this.theme = "";
|
|
18
|
+
/**
|
|
19
|
+
* Controls the margin of the component.
|
|
20
|
+
*/
|
|
21
|
+
this.margin = "auto";
|
|
22
|
+
/**
|
|
23
|
+
* Selected state of the caption. Used inside Choice component.
|
|
24
|
+
*/
|
|
25
|
+
this.selected = false;
|
|
26
|
+
/**
|
|
27
|
+
* Controls the size of the caption.
|
|
28
|
+
*/
|
|
29
|
+
this.size = "medium";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Component lifecycle events.
|
|
33
|
+
*/
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
inheritGlobalTheme(this);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* render() function
|
|
39
|
+
* Always the last one in the class.
|
|
40
|
+
*/
|
|
41
|
+
render() {
|
|
42
|
+
return (h(Host, { class: {
|
|
43
|
+
"duet-caption": true,
|
|
44
|
+
"duet-caption-selected": this.selected,
|
|
45
|
+
"duet-caption-small": this.size === "small",
|
|
46
|
+
"duet-theme-turva": this.theme === "turva",
|
|
47
|
+
"duet-m-0": this.margin === "none",
|
|
48
|
+
} }, h("slot", null)));
|
|
49
|
+
}
|
|
50
|
+
static get style() { return duetCaptionCss; }
|
|
51
|
+
}, [1, "duet-caption", {
|
|
52
|
+
"theme": [1025],
|
|
53
|
+
"margin": [1],
|
|
54
|
+
"selected": [4],
|
|
55
|
+
"size": [1]
|
|
56
|
+
}]);
|
|
57
|
+
function defineCustomElement() {
|
|
58
|
+
if (typeof customElements === "undefined") {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const components = ["duet-caption"];
|
|
62
|
+
components.forEach(tagName => { switch (tagName) {
|
|
63
|
+
case "duet-caption":
|
|
64
|
+
if (!customElements.get(tagName)) {
|
|
65
|
+
customElements.define(tagName, DuetCaption);
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
68
|
+
} });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { DuetCaption as D, defineCustomElement as d };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { c as convertHtmlQuotes } from './p-5a9d75e1.js';
|
|
5
|
+
|
|
6
|
+
const localeLookUpTable = {
|
|
7
|
+
fi: "fi-FI",
|
|
8
|
+
en: "en-GB",
|
|
9
|
+
us: "en-US",
|
|
10
|
+
sv: "sv-SE",
|
|
11
|
+
};
|
|
12
|
+
const localeMonetarySignifierLookUpTable = {
|
|
13
|
+
fi: "€",
|
|
14
|
+
en: "£",
|
|
15
|
+
us: "$",
|
|
16
|
+
sv: "€",
|
|
17
|
+
};
|
|
18
|
+
const defLanguageArray = ["fi", "en", "sv"];
|
|
19
|
+
const defaultLanguage = "fi";
|
|
20
|
+
const getCurrentLanguage = () => {
|
|
21
|
+
return document.documentElement.lang ? document.documentElement.lang.toLowerCase() : defaultLanguage;
|
|
22
|
+
};
|
|
23
|
+
const isOfTypeLanguage = (keyInput) => {
|
|
24
|
+
return defLanguageArray.includes(keyInput);
|
|
25
|
+
};
|
|
26
|
+
const checkForLanguage = (languageString = getCurrentLanguage()) => {
|
|
27
|
+
if (isOfTypeLanguage(languageString)) {
|
|
28
|
+
return languageString;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return defaultLanguage;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Returns the current language as a string representation (taken from html lang attribute)
|
|
36
|
+
* If language is not fi|sv|en it will default to "fi"
|
|
37
|
+
* @param {string} lang=fi - "fi" | "sv" | "en"
|
|
38
|
+
* @default {string} "fi"
|
|
39
|
+
*/
|
|
40
|
+
const getLanguage = (languageString = getCurrentLanguage()) => checkForLanguage(languageString);
|
|
41
|
+
/**
|
|
42
|
+
* Returns the current language and locale
|
|
43
|
+
* If language is not fi|sv|en it will default to "fi"
|
|
44
|
+
* special case where lang can be ALSO be "us" in addition to other types - if user decides to override local language
|
|
45
|
+
* @param {string} lang="fi" - "fi" | "sv" | "en" | "us"
|
|
46
|
+
* @default {object} {locale: "fi-FI", money: "€"}
|
|
47
|
+
*/
|
|
48
|
+
const getLocale = (lang) => {
|
|
49
|
+
const returnObj = {
|
|
50
|
+
locale: localeLookUpTable[lang],
|
|
51
|
+
money: localeMonetarySignifierLookUpTable[lang],
|
|
52
|
+
};
|
|
53
|
+
if (returnObj.locale && returnObj.money) {
|
|
54
|
+
return returnObj;
|
|
55
|
+
}
|
|
56
|
+
throw new Error(`Locale for "${lang}" not found`);
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Takes any json object that is passed and/or htmlencoded and converts it to proper json
|
|
60
|
+
*/
|
|
61
|
+
const sanitizeString = (string) => {
|
|
62
|
+
const argIsString = typeof string === "string";
|
|
63
|
+
if (argIsString) {
|
|
64
|
+
try {
|
|
65
|
+
return JSON.parse(convertHtmlQuotes(string));
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
console.log("sanitizeString received a string, that didnt parse to json object", string, e);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return string;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Returns the current string / object from a given translation object
|
|
75
|
+
* If language is not fi|sv|en it will default to "fi"
|
|
76
|
+
* special case where lang can be ALSO be "us" in addition to other types - if user decides to override local language
|
|
77
|
+
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"} | string will get JSON.parsed
|
|
78
|
+
* @param {boolean} languageOverride = false - in case you want to override the actual language set in html tag
|
|
79
|
+
* @default {object} {locale: "fi-FI", money: "€"}
|
|
80
|
+
* @returns {(string|Object)} given example contains {fi:"something"} and language===fi this will return "something"
|
|
81
|
+
*/
|
|
82
|
+
const getLocaleString = (langObject, languageOverride) => {
|
|
83
|
+
const obj = sanitizeString(langObject);
|
|
84
|
+
if (languageOverride) {
|
|
85
|
+
return obj[checkForLanguage(languageOverride)];
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return obj[getLanguage()];
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { getLanguage as a, getLocale as b, getLocaleString as g, sanitizeString as s };
|