@re-code/aurora 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/aurora/aurora.esm.js +1 -1
- package/dist/aurora/{p-8ed72e5b.entry.js → p-01ff4d34.entry.js} +1 -1
- package/dist/aurora/{p-c3668073.entry.js → p-0554ffea.entry.js} +1 -1
- package/dist/aurora/{p-278d3434.entry.js → p-0a0a2bfe.entry.js} +1 -1
- package/dist/aurora/{p-e1c97234.entry.js → p-0a7e9e8e.entry.js} +1 -1
- package/dist/aurora/{p-c330982c.entry.js → p-1670a9bd.entry.js} +1 -1
- package/dist/aurora/{p-efd60427.entry.js → p-17c6de2c.entry.js} +1 -1
- package/dist/aurora/{p-a87dc1d3.entry.js → p-24ff90e0.entry.js} +1 -1
- package/dist/aurora/p-27da7b8a.entry.js +1 -0
- package/dist/aurora/p-380d8ebe.entry.js +1 -0
- package/dist/aurora/{p-a1e257c7.entry.js → p-3cfccef1.entry.js} +1 -1
- package/dist/aurora/{p-e72126a2.entry.js → p-4fd71d14.entry.js} +1 -1
- package/dist/aurora/{p-89b66c7a.entry.js → p-5606ed9c.entry.js} +1 -1
- package/dist/aurora/p-56fc4315.entry.js +1 -0
- package/dist/aurora/{p-685b9e53.entry.js → p-5a027df1.entry.js} +1 -1
- package/dist/aurora/{p-487df7d8.entry.js → p-5dd73182.entry.js} +1 -1
- package/dist/aurora/{p-17e65032.entry.js → p-62d79933.entry.js} +1 -1
- package/dist/aurora/p-6a1363da.entry.js +1 -0
- package/dist/aurora/{p-fd4e9cdd.entry.js → p-6e9c8e27.entry.js} +1 -1
- package/dist/aurora/{p-31a86367.entry.js → p-742abb2c.entry.js} +1 -1
- package/dist/aurora/{p-40bb52c3.entry.js → p-7a9bc20f.entry.js} +1 -1
- package/dist/aurora/{p-35edd036.entry.js → p-7cc6bb71.entry.js} +1 -1
- package/dist/aurora/{p-689f37db.entry.js → p-7fa0ee48.entry.js} +1 -1
- package/dist/aurora/{p-ee2ea46e.entry.js → p-815611f9.entry.js} +1 -1
- package/dist/aurora/{p-a8e984e1.entry.js → p-8800c466.entry.js} +1 -1
- package/dist/aurora/{p-5d2a88ca.entry.js → p-9e9377b5.entry.js} +1 -1
- package/dist/aurora/p-DMeUBbqF.js +7 -0
- package/dist/aurora/{p-DXbj-yic.js → p-DNpzZvak.js} +1 -1
- package/dist/aurora/p-DjW6oMgu.js +7 -0
- package/dist/aurora/{p-DzNA1eDU.js → p-DqAwSryz.js} +1 -1
- package/dist/aurora/p-NvNa2Iiu.js +1 -0
- package/dist/aurora/p-a376a248.entry.js +1 -0
- package/dist/aurora/{p-0608e910.entry.js → p-a63d1f80.entry.js} +1 -1
- package/dist/aurora/p-b0ebcc51.entry.js +1 -0
- package/dist/aurora/p-be98a1d7.entry.js +1 -0
- package/dist/aurora/{p-ed998b0c.entry.js → p-bf922703.entry.js} +1 -1
- package/dist/aurora/{p-ee4475a6.entry.js → p-c1422894.entry.js} +1 -1
- package/dist/aurora/{p-372a3416.entry.js → p-c2164ffe.entry.js} +1 -1
- package/dist/aurora/{p-2a16d544.entry.js → p-cb63ca43.entry.js} +1 -1
- package/dist/aurora/p-cc1015fe.entry.js +1 -0
- package/dist/aurora/{p-88b72de7.entry.js → p-cf16464e.entry.js} +1 -1
- package/dist/aurora/p-cfa0166b.entry.js +1 -0
- package/dist/aurora/{p-e7c81a6b.entry.js → p-d85e1d60.entry.js} +1 -1
- package/dist/aurora/{p-64229ad2.entry.js → p-f176be8b.entry.js} +1 -1
- package/dist/aurora/{p-bd1f6486.entry.js → p-f3383f3c.entry.js} +1 -1
- package/dist/aurora/p-f5d3aefa.entry.js +1 -0
- package/dist/aurora/{p-038b2190.entry.js → p-f85687a5.entry.js} +1 -1
- package/dist/aurora/{p-546a2f69.entry.js → p-fe143404.entry.js} +1 -1
- package/dist/cjs/au-alert.cjs.entry.js +1 -1
- package/dist/cjs/au-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/au-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/au-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/au-combobox.cjs.entry.js +6 -6
- package/dist/cjs/au-container.cjs.entry.js +1 -1
- package/dist/cjs/au-dialog.cjs.entry.js +4 -4
- package/dist/cjs/au-divider.cjs.entry.js +1 -1
- package/dist/cjs/au-field.cjs.entry.js +1 -1
- package/dist/cjs/{au-icon-D0L9Wwy0.js → au-icon-0-khGfX2.js} +1 -1
- package/dist/cjs/au-icon.cjs.entry.js +1 -1
- package/dist/cjs/au-input.cjs.entry.js +6 -6
- package/dist/cjs/au-kbd.cjs.entry.js +355 -0
- package/dist/cjs/au-list-item.cjs.entry.js +195 -0
- package/dist/cjs/au-list.cjs.entry.js +78 -0
- package/dist/cjs/au-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/au-menu.cjs.entry.js +1 -1
- package/dist/cjs/au-nav-link.cjs.entry.js +1 -1
- package/dist/cjs/au-navbar.cjs.entry.js +4 -4
- package/dist/cjs/au-number-input.cjs.entry.js +4 -4
- package/dist/cjs/au-popover.cjs.entry.js +1 -1
- package/dist/cjs/au-progress.cjs.entry.js +107 -0
- package/dist/cjs/au-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/au-radio.cjs.entry.js +1 -1
- package/dist/cjs/au-segmented-control.cjs.entry.js +3 -3
- package/dist/cjs/au-segmented-option.cjs.entry.js +1 -1
- package/dist/cjs/au-select.cjs.entry.js +4 -4
- package/dist/cjs/au-sidebar-nav.cjs.entry.js +1 -1
- package/dist/cjs/au-skeleton.cjs.entry.js +106 -0
- package/dist/cjs/au-slider.cjs.entry.js +3 -3
- package/dist/cjs/au-splitter.cjs.entry.js +2 -2
- package/dist/cjs/au-stat.cjs.entry.js +262 -0
- package/dist/cjs/au-switch.cjs.entry.js +4 -4
- package/dist/cjs/au-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/au-tab.cjs.entry.js +1 -1
- package/dist/cjs/au-table.cjs.entry.js +337 -0
- package/dist/cjs/au-tabs.cjs.entry.js +4 -4
- package/dist/cjs/au-textarea.cjs.entry.js +3 -3
- package/dist/cjs/au-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/au-toast.cjs.entry.js +1 -1
- package/dist/cjs/au-toc.cjs.entry.js +1 -1
- package/dist/cjs/au-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/aurora.cjs.js +1 -1
- package/dist/cjs/{icon-loader-DyRasOnf.js → icon-loader-Dij7pYkP.js} +3 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/trending-down-BKjmYE1H.js +19 -0
- package/dist/cjs/trending-up-CoWuXxqz.js +19 -0
- package/dist/collection/collection-manifest.json +7 -0
- package/dist/collection/components/data-display/au-kbd/au-kbd.constants.js +85 -0
- package/dist/collection/components/data-display/au-kbd/au-kbd.css +98 -0
- package/dist/collection/components/data-display/au-kbd/au-kbd.js +189 -0
- package/dist/collection/components/data-display/au-kbd/au-kbd.types.js +1 -0
- package/dist/collection/components/data-display/au-kbd/index.js +2 -0
- package/dist/collection/components/data-display/au-kbd/internal/describe.js +67 -0
- package/dist/collection/components/data-display/au-kbd/internal/parse.js +85 -0
- package/dist/collection/components/data-display/au-kbd/internal/platform.js +19 -0
- package/dist/collection/components/data-display/au-list/au-list.constants.js +8 -0
- package/dist/collection/components/data-display/au-list/au-list.css +30 -0
- package/dist/collection/components/data-display/au-list/au-list.js +132 -0
- package/dist/collection/components/data-display/au-list/au-list.types.js +1 -0
- package/dist/collection/components/data-display/au-list/index.js +2 -0
- package/dist/collection/components/data-display/au-list-item/au-list-item.css +196 -0
- package/dist/collection/components/data-display/au-list-item/au-list-item.js +305 -0
- package/dist/collection/components/data-display/au-list-item/index.js +1 -0
- package/dist/collection/components/data-display/au-list-item/internal/interactive-content.js +29 -0
- package/dist/collection/components/data-display/au-stat/au-stat.constants.js +44 -0
- package/dist/collection/components/data-display/au-stat/au-stat.css +139 -0
- package/dist/collection/components/data-display/au-stat/au-stat.js +491 -0
- package/dist/collection/components/data-display/au-stat/au-stat.types.js +1 -0
- package/dist/collection/components/data-display/au-stat/index.js +2 -0
- package/dist/collection/components/data-display/au-stat/internal/announcement.js +13 -0
- package/dist/collection/components/data-display/au-table/au-table.constants.js +21 -0
- package/dist/collection/components/data-display/au-table/au-table.css +20 -0
- package/dist/collection/components/data-display/au-table/au-table.js +482 -0
- package/dist/collection/components/data-display/au-table/au-table.types.js +1 -0
- package/dist/collection/components/data-display/au-table/index.js +2 -0
- package/dist/collection/components/data-display/au-table/internal/scroller-label.js +11 -0
- package/dist/collection/components/data-display/au-table/internal/sort.js +17 -0
- package/dist/collection/components/feedback/au-alert/au-alert.js +1 -1
- package/dist/collection/components/feedback/au-progress/au-progress.constants.js +38 -0
- package/dist/collection/components/feedback/au-progress/au-progress.css +201 -0
- package/dist/collection/components/feedback/au-progress/au-progress.js +226 -0
- package/dist/collection/components/feedback/au-progress/au-progress.types.js +1 -0
- package/dist/collection/components/feedback/au-progress/index.js +2 -0
- package/dist/collection/components/feedback/au-skeleton/au-skeleton.constants.js +33 -0
- package/dist/collection/components/feedback/au-skeleton/au-skeleton.css +108 -0
- package/dist/collection/components/feedback/au-skeleton/au-skeleton.js +159 -0
- package/dist/collection/components/feedback/au-skeleton/au-skeleton.types.js +1 -0
- package/dist/collection/components/feedback/au-skeleton/index.js +2 -0
- package/dist/collection/components/feedback/au-toast/au-toast.js +1 -1
- package/dist/collection/components/feedback/au-toast-region/au-toast-region.js +1 -1
- package/dist/collection/components/forms/au-checkbox/au-checkbox.js +4 -4
- package/dist/collection/components/forms/au-combobox/au-combobox.js +6 -6
- package/dist/collection/components/forms/au-field/au-field.js +1 -1
- package/dist/collection/components/forms/au-input/au-input.js +6 -6
- package/dist/collection/components/forms/au-number-input/au-number-input.js +4 -4
- package/dist/collection/components/forms/au-radio/au-radio.js +1 -1
- package/dist/collection/components/forms/au-radio-group/au-radio-group.js +3 -3
- package/dist/collection/components/forms/au-segmented-control/au-segmented-control.js +3 -3
- package/dist/collection/components/forms/au-segmented-option/au-segmented-option.js +1 -1
- package/dist/collection/components/forms/au-select/au-select.js +4 -4
- package/dist/collection/components/forms/au-slider/au-slider.js +3 -3
- package/dist/collection/components/forms/au-switch/au-switch.js +4 -4
- package/dist/collection/components/forms/au-textarea/au-textarea.js +3 -3
- package/dist/collection/components/layout/au-container/au-container.js +1 -1
- package/dist/collection/components/layout/au-divider/au-divider.js +1 -1
- package/dist/collection/components/layout/au-splitter/au-splitter.js +2 -2
- package/dist/collection/components/navigation/au-breadcrumb/au-breadcrumb.js +1 -1
- package/dist/collection/components/navigation/au-breadcrumb-item/au-breadcrumb-item.js +1 -1
- package/dist/collection/components/navigation/au-nav-link/au-nav-link.js +1 -1
- package/dist/collection/components/navigation/au-navbar/au-navbar.js +4 -4
- package/dist/collection/components/navigation/au-sidebar-nav/au-sidebar-nav.js +1 -1
- package/dist/collection/components/navigation/au-tab/au-tab.js +1 -1
- package/dist/collection/components/navigation/au-tab-panel/au-tab-panel.js +1 -1
- package/dist/collection/components/navigation/au-tabs/au-tabs.js +4 -4
- package/dist/collection/components/navigation/au-toc/au-toc.js +1 -1
- package/dist/collection/components/overlays/au-dialog/au-dialog.js +4 -4
- package/dist/collection/components/overlays/au-menu/au-menu.js +1 -1
- package/dist/collection/components/overlays/au-menu-item/au-menu-item.js +1 -1
- package/dist/collection/components/overlays/au-popover/au-popover.js +1 -1
- package/dist/collection/components/overlays/au-tooltip/au-tooltip.js +1 -1
- package/dist/collection/components/primitives/au-icon/core-icons.js +2 -0
- package/dist/components/au-alert.js +1 -1
- package/dist/components/au-avatar.js +1 -1
- package/dist/components/au-breadcrumb-item.js +1 -1
- package/dist/components/au-breadcrumb.js +1 -1
- package/dist/components/au-checkbox.js +1 -1
- package/dist/components/au-chip.js +1 -1
- package/dist/components/au-code-block.js +1 -1
- package/dist/components/au-combobox.js +1 -1
- package/dist/components/au-container.js +1 -1
- package/dist/components/au-dialog.js +1 -1
- package/dist/components/au-divider.js +1 -1
- package/dist/components/au-field.js +1 -1
- package/dist/components/au-icon.js +1 -1
- package/dist/components/au-input.js +1 -1
- package/dist/components/au-kbd.d.ts +11 -0
- package/dist/components/au-kbd.js +1 -0
- package/dist/components/au-list-item.d.ts +11 -0
- package/dist/components/au-list-item.js +1 -0
- package/dist/components/au-list.d.ts +11 -0
- package/dist/components/au-list.js +1 -0
- package/dist/components/au-menu-item.js +1 -1
- package/dist/components/au-menu.js +1 -1
- package/dist/components/au-nav-link.js +1 -1
- package/dist/components/au-navbar.js +1 -1
- package/dist/components/au-number-input.js +1 -1
- package/dist/components/au-popover.js +1 -1
- package/dist/components/au-progress.d.ts +11 -0
- package/dist/components/au-progress.js +1 -0
- package/dist/components/au-radio-group.js +1 -1
- package/dist/components/au-radio.js +1 -1
- package/dist/components/au-segmented-control.js +1 -1
- package/dist/components/au-segmented-option.js +1 -1
- package/dist/components/au-select.js +1 -1
- package/dist/components/au-sidebar-nav.js +1 -1
- package/dist/components/au-skeleton.d.ts +11 -0
- package/dist/components/au-skeleton.js +1 -0
- package/dist/components/au-slider.js +1 -1
- package/dist/components/au-splitter.js +1 -1
- package/dist/components/au-stat.d.ts +11 -0
- package/dist/components/au-stat.js +1 -0
- package/dist/components/au-switch.js +1 -1
- package/dist/components/au-tab-panel.js +1 -1
- package/dist/components/au-tab.js +1 -1
- package/dist/components/au-table.d.ts +11 -0
- package/dist/components/au-table.js +1 -0
- package/dist/components/au-tabs.js +1 -1
- package/dist/components/au-textarea.js +1 -1
- package/dist/components/au-toast-region.js +1 -1
- package/dist/components/au-toast.js +1 -1
- package/dist/components/au-toc.js +1 -1
- package/dist/components/au-tooltip.js +1 -1
- package/dist/components/p-B5BhPkwP.js +1 -0
- package/dist/components/p-DMeUBbqF.js +7 -0
- package/dist/components/p-DjW6oMgu.js +7 -0
- package/dist/components/{p-DzNA1eDU.js → p-DqAwSryz.js} +1 -1
- package/dist/components/{p-DAqsVCAy.js → p-Dw0zb4x_.js} +1 -1
- package/dist/components/{p-DIL-tsh4.js → p-ZpauIcNt.js} +1 -1
- package/dist/custom-elements.json +1338 -66
- package/dist/esm/au-alert.entry.js +1 -1
- package/dist/esm/au-breadcrumb-item.entry.js +1 -1
- package/dist/esm/au-breadcrumb.entry.js +1 -1
- package/dist/esm/au-checkbox.entry.js +4 -4
- package/dist/esm/au-code-block.entry.js +1 -1
- package/dist/esm/au-combobox.entry.js +7 -7
- package/dist/esm/au-container.entry.js +1 -1
- package/dist/esm/au-dialog.entry.js +4 -4
- package/dist/esm/au-divider.entry.js +1 -1
- package/dist/esm/au-field.entry.js +1 -1
- package/dist/esm/{au-icon-B17psn7x.js → au-icon-6iJTkDID.js} +1 -1
- package/dist/esm/au-icon.entry.js +1 -1
- package/dist/esm/au-input.entry.js +6 -6
- package/dist/esm/au-kbd.entry.js +353 -0
- package/dist/esm/au-list-item.entry.js +193 -0
- package/dist/esm/au-list.entry.js +76 -0
- package/dist/esm/au-menu-item.entry.js +1 -1
- package/dist/esm/au-menu.entry.js +1 -1
- package/dist/esm/au-nav-link.entry.js +1 -1
- package/dist/esm/au-navbar.entry.js +4 -4
- package/dist/esm/au-number-input.entry.js +4 -4
- package/dist/esm/au-popover.entry.js +1 -1
- package/dist/esm/au-progress.entry.js +105 -0
- package/dist/esm/au-radio-group.entry.js +3 -3
- package/dist/esm/au-radio.entry.js +1 -1
- package/dist/esm/au-segmented-control.entry.js +3 -3
- package/dist/esm/au-segmented-option.entry.js +1 -1
- package/dist/esm/au-select.entry.js +4 -4
- package/dist/esm/au-sidebar-nav.entry.js +1 -1
- package/dist/esm/au-skeleton.entry.js +104 -0
- package/dist/esm/au-slider.entry.js +3 -3
- package/dist/esm/au-splitter.entry.js +2 -2
- package/dist/esm/au-stat.entry.js +260 -0
- package/dist/esm/au-switch.entry.js +4 -4
- package/dist/esm/au-tab-panel.entry.js +1 -1
- package/dist/esm/au-tab.entry.js +1 -1
- package/dist/esm/au-table.entry.js +335 -0
- package/dist/esm/au-tabs.entry.js +4 -4
- package/dist/esm/au-textarea.entry.js +3 -3
- package/dist/esm/au-toast-region.entry.js +2 -2
- package/dist/esm/au-toast.entry.js +1 -1
- package/dist/esm/au-toc.entry.js +1 -1
- package/dist/esm/au-tooltip.entry.js +1 -1
- package/dist/esm/aurora.js +1 -1
- package/dist/esm/{icon-loader-CqLCmu4h.js → icon-loader-B2WSNZ27.js} +3 -1
- package/dist/esm/{live-announcer-CXd2OhYs.js → live-announcer-IAjNBWYI.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/trending-down-DjW6oMgu.js +17 -0
- package/dist/esm/trending-up-DMeUBbqF.js +17 -0
- package/dist/styles.css +139 -0
- package/dist/types/components/data-display/au-kbd/au-kbd.constants.d.ts +41 -0
- package/dist/types/components/data-display/au-kbd/au-kbd.d.ts +36 -0
- package/dist/types/components/data-display/au-kbd/au-kbd.types.d.ts +1 -0
- package/dist/types/components/data-display/au-kbd/index.d.ts +3 -0
- package/dist/types/components/data-display/au-kbd/internal/describe.d.ts +13 -0
- package/dist/types/components/data-display/au-kbd/internal/parse.d.ts +18 -0
- package/dist/types/components/data-display/au-kbd/internal/platform.d.ts +13 -0
- package/dist/types/components/data-display/au-list/au-list.constants.d.ts +8 -0
- package/dist/types/components/data-display/au-list/au-list.d.ts +29 -0
- package/dist/types/components/data-display/au-list/au-list.types.d.ts +1 -0
- package/dist/types/components/data-display/au-list/index.d.ts +3 -0
- package/dist/types/components/data-display/au-list-item/au-list-item.d.ts +61 -0
- package/dist/types/components/data-display/au-list-item/index.d.ts +1 -0
- package/dist/types/components/data-display/au-list-item/internal/interactive-content.d.ts +2 -0
- package/dist/types/components/data-display/au-stat/au-stat.constants.d.ts +44 -0
- package/dist/types/components/data-display/au-stat/au-stat.d.ts +67 -0
- package/dist/types/components/data-display/au-stat/au-stat.types.d.ts +1 -0
- package/dist/types/components/data-display/au-stat/index.d.ts +3 -0
- package/dist/types/components/data-display/au-stat/internal/announcement.d.ts +16 -0
- package/dist/types/components/data-display/au-table/au-table.constants.d.ts +26 -0
- package/dist/types/components/data-display/au-table/au-table.d.ts +86 -0
- package/dist/types/components/data-display/au-table/au-table.types.d.ts +1 -0
- package/dist/types/components/data-display/au-table/index.d.ts +3 -0
- package/dist/types/components/data-display/au-table/internal/scroller-label.d.ts +9 -0
- package/dist/types/components/data-display/au-table/internal/sort.d.ts +11 -0
- package/dist/types/components/feedback/au-progress/au-progress.constants.d.ts +31 -0
- package/dist/types/components/feedback/au-progress/au-progress.d.ts +32 -0
- package/dist/types/components/feedback/au-progress/au-progress.types.d.ts +1 -0
- package/dist/types/components/feedback/au-progress/index.d.ts +3 -0
- package/dist/types/components/feedback/au-skeleton/au-skeleton.constants.d.ts +27 -0
- package/dist/types/components/feedback/au-skeleton/au-skeleton.d.ts +31 -0
- package/dist/types/components/feedback/au-skeleton/au-skeleton.types.d.ts +1 -0
- package/dist/types/components/feedback/au-skeleton/index.d.ts +3 -0
- package/dist/types/components.d.ts +712 -0
- package/dist/types/vue.d.ts +7 -0
- package/package.json +53 -1
- package/dist/aurora/p-746825ce.entry.js +0 -1
- package/dist/aurora/p-CoyAdNcI.js +0 -1
- package/dist/aurora/p-b2feddb2.entry.js +0 -1
- package/dist/aurora/p-f89bde2b.entry.js +0 -1
- package/dist/components/p-M21eKzKU.js +0 -1
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-B8lDYTMv.js');
|
|
4
|
+
var warnOnce = require('./warn-once-lHF-gQZp.js');
|
|
5
|
+
|
|
6
|
+
/** Literals only: no import from the foundations, so the `/constants` subpath stays standalone. */
|
|
7
|
+
/** `auto` detects the platform at render time; `apple` is macOS, iOS and iPadOS; `other` is the rest. */
|
|
8
|
+
const KBD_PLATFORM = {
|
|
9
|
+
auto: 'auto',
|
|
10
|
+
apple: 'apple',
|
|
11
|
+
other: 'other',
|
|
12
|
+
};
|
|
13
|
+
/** The known key ids. A letter, a digit, a function key or an unknown token has no id. */
|
|
14
|
+
const KBD_KEY = {
|
|
15
|
+
mod: 'mod',
|
|
16
|
+
meta: 'meta',
|
|
17
|
+
ctrl: 'ctrl',
|
|
18
|
+
alt: 'alt',
|
|
19
|
+
shift: 'shift',
|
|
20
|
+
enter: 'enter',
|
|
21
|
+
escape: 'escape',
|
|
22
|
+
tab: 'tab',
|
|
23
|
+
backspace: 'backspace',
|
|
24
|
+
delete: 'delete',
|
|
25
|
+
space: 'space',
|
|
26
|
+
up: 'up',
|
|
27
|
+
down: 'down',
|
|
28
|
+
left: 'left',
|
|
29
|
+
right: 'right',
|
|
30
|
+
home: 'home',
|
|
31
|
+
end: 'end',
|
|
32
|
+
pageup: 'pageup',
|
|
33
|
+
pagedown: 'pagedown',
|
|
34
|
+
capslock: 'capslock',
|
|
35
|
+
plus: 'plus',
|
|
36
|
+
};
|
|
37
|
+
/** The English names read for each key, per platform. `keyNames` overrides them per element. */
|
|
38
|
+
const KBD_DEFAULT_NAMES = {
|
|
39
|
+
apple: {
|
|
40
|
+
mod: 'Command',
|
|
41
|
+
meta: 'Command',
|
|
42
|
+
ctrl: 'Control',
|
|
43
|
+
alt: 'Option',
|
|
44
|
+
shift: 'Shift',
|
|
45
|
+
enter: 'Return',
|
|
46
|
+
escape: 'Escape',
|
|
47
|
+
tab: 'Tab',
|
|
48
|
+
backspace: 'Delete',
|
|
49
|
+
delete: 'Forward Delete',
|
|
50
|
+
space: 'Space',
|
|
51
|
+
up: 'Up Arrow',
|
|
52
|
+
down: 'Down Arrow',
|
|
53
|
+
left: 'Left Arrow',
|
|
54
|
+
right: 'Right Arrow',
|
|
55
|
+
home: 'Home',
|
|
56
|
+
end: 'End',
|
|
57
|
+
pageup: 'Page Up',
|
|
58
|
+
pagedown: 'Page Down',
|
|
59
|
+
capslock: 'Caps Lock',
|
|
60
|
+
plus: 'Plus',
|
|
61
|
+
},
|
|
62
|
+
other: {
|
|
63
|
+
mod: 'Control',
|
|
64
|
+
meta: 'Meta',
|
|
65
|
+
ctrl: 'Control',
|
|
66
|
+
alt: 'Alt',
|
|
67
|
+
shift: 'Shift',
|
|
68
|
+
enter: 'Enter',
|
|
69
|
+
escape: 'Escape',
|
|
70
|
+
tab: 'Tab',
|
|
71
|
+
backspace: 'Backspace',
|
|
72
|
+
delete: 'Delete',
|
|
73
|
+
space: 'Space',
|
|
74
|
+
up: 'Up Arrow',
|
|
75
|
+
down: 'Down Arrow',
|
|
76
|
+
left: 'Left Arrow',
|
|
77
|
+
right: 'Right Arrow',
|
|
78
|
+
home: 'Home',
|
|
79
|
+
end: 'End',
|
|
80
|
+
pageup: 'Page Up',
|
|
81
|
+
pagedown: 'Page Down',
|
|
82
|
+
capslock: 'Caps Lock',
|
|
83
|
+
plus: 'Plus',
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
const platforms = new Set(Object.values(KBD_PLATFORM));
|
|
87
|
+
new Set(Object.values(KBD_KEY));
|
|
88
|
+
const isKbdPlatform = (value) => typeof value === 'string' && platforms.has(value);
|
|
89
|
+
|
|
90
|
+
/** Case-insensitive aliases (KD-D4, spec section 3.3). */
|
|
91
|
+
const ALIASES = {
|
|
92
|
+
mod: KBD_KEY.mod,
|
|
93
|
+
meta: KBD_KEY.meta,
|
|
94
|
+
cmd: KBD_KEY.meta,
|
|
95
|
+
command: KBD_KEY.meta,
|
|
96
|
+
super: KBD_KEY.meta,
|
|
97
|
+
win: KBD_KEY.meta,
|
|
98
|
+
ctrl: KBD_KEY.ctrl,
|
|
99
|
+
control: KBD_KEY.ctrl,
|
|
100
|
+
alt: KBD_KEY.alt,
|
|
101
|
+
option: KBD_KEY.alt,
|
|
102
|
+
opt: KBD_KEY.alt,
|
|
103
|
+
shift: KBD_KEY.shift,
|
|
104
|
+
enter: KBD_KEY.enter,
|
|
105
|
+
return: KBD_KEY.enter,
|
|
106
|
+
escape: KBD_KEY.escape,
|
|
107
|
+
esc: KBD_KEY.escape,
|
|
108
|
+
tab: KBD_KEY.tab,
|
|
109
|
+
backspace: KBD_KEY.backspace,
|
|
110
|
+
delete: KBD_KEY.delete,
|
|
111
|
+
del: KBD_KEY.delete,
|
|
112
|
+
space: KBD_KEY.space,
|
|
113
|
+
arrowup: KBD_KEY.up,
|
|
114
|
+
up: KBD_KEY.up,
|
|
115
|
+
arrowdown: KBD_KEY.down,
|
|
116
|
+
down: KBD_KEY.down,
|
|
117
|
+
arrowleft: KBD_KEY.left,
|
|
118
|
+
left: KBD_KEY.left,
|
|
119
|
+
arrowright: KBD_KEY.right,
|
|
120
|
+
right: KBD_KEY.right,
|
|
121
|
+
home: KBD_KEY.home,
|
|
122
|
+
end: KBD_KEY.end,
|
|
123
|
+
pageup: KBD_KEY.pageup,
|
|
124
|
+
pgup: KBD_KEY.pageup,
|
|
125
|
+
pagedown: KBD_KEY.pagedown,
|
|
126
|
+
pgdn: KBD_KEY.pagedown,
|
|
127
|
+
capslock: KBD_KEY.capslock,
|
|
128
|
+
plus: KBD_KEY.plus,
|
|
129
|
+
};
|
|
130
|
+
const FUNCTION_KEY = /^f([1-9]|1\d|2[0-4])$/i;
|
|
131
|
+
const PLUS = { id: KBD_KEY.plus, text: KBD_KEY.plus };
|
|
132
|
+
/** A single character and an F-key are upper-cased; any other text is kept as written. */
|
|
133
|
+
function normalizeKbdText(raw) {
|
|
134
|
+
return Array.from(raw).length === 1 || FUNCTION_KEY.test(raw) ? raw.toUpperCase() : raw;
|
|
135
|
+
}
|
|
136
|
+
function toToken(raw) {
|
|
137
|
+
const id = Object.hasOwn(ALIASES, raw.toLowerCase()) ? ALIASES[raw.toLowerCase()] : undefined;
|
|
138
|
+
if (id !== undefined)
|
|
139
|
+
return { id, text: id };
|
|
140
|
+
return { id: null, text: normalizeKbdText(raw) };
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Parse one key combination (KD-D2). Pure. `+` separates keys; a lone `+` and a trailing `++`
|
|
144
|
+
* are the plus key. Empty tokens are dropped and flag the input as malformed. Order is kept.
|
|
145
|
+
*/
|
|
146
|
+
function parseKbdKeys(input) {
|
|
147
|
+
if (typeof input !== 'string')
|
|
148
|
+
return { tokens: [], malformed: false };
|
|
149
|
+
const value = input.trim();
|
|
150
|
+
if (value === '')
|
|
151
|
+
return { tokens: [], malformed: false };
|
|
152
|
+
if (value === '+')
|
|
153
|
+
return { tokens: [{ ...PLUS }], malformed: false };
|
|
154
|
+
const trailingPlus = value.endsWith('++');
|
|
155
|
+
const rest = trailingPlus ? value.slice(0, -2) : value;
|
|
156
|
+
let malformed = false;
|
|
157
|
+
const tokens = [];
|
|
158
|
+
if (rest !== '' || !trailingPlus) {
|
|
159
|
+
for (const part of rest.split('+')) {
|
|
160
|
+
const raw = part.trim();
|
|
161
|
+
if (raw === '')
|
|
162
|
+
malformed = true;
|
|
163
|
+
else
|
|
164
|
+
tokens.push(toToken(raw));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
malformed = true;
|
|
169
|
+
}
|
|
170
|
+
if (trailingPlus)
|
|
171
|
+
tokens.push({ ...PLUS });
|
|
172
|
+
return { tokens, malformed };
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const K = KBD_KEY;
|
|
176
|
+
/** The drawn glyph of each known key, per platform (spec section 3.3). */
|
|
177
|
+
const GLYPHS = {
|
|
178
|
+
apple: {
|
|
179
|
+
[K.mod]: '⌘',
|
|
180
|
+
[K.meta]: '⌘',
|
|
181
|
+
[K.ctrl]: '⌃',
|
|
182
|
+
[K.alt]: '⌥',
|
|
183
|
+
[K.shift]: '⇧',
|
|
184
|
+
[K.enter]: '↩',
|
|
185
|
+
[K.escape]: 'Esc',
|
|
186
|
+
[K.tab]: '⇥',
|
|
187
|
+
[K.backspace]: '⌫',
|
|
188
|
+
[K.delete]: '⌦',
|
|
189
|
+
[K.space]: 'Space',
|
|
190
|
+
[K.up]: '↑',
|
|
191
|
+
[K.down]: '↓',
|
|
192
|
+
[K.left]: '←',
|
|
193
|
+
[K.right]: '→',
|
|
194
|
+
[K.home]: 'Home',
|
|
195
|
+
[K.end]: 'End',
|
|
196
|
+
[K.pageup]: 'PgUp',
|
|
197
|
+
[K.pagedown]: 'PgDn',
|
|
198
|
+
[K.capslock]: '⇪',
|
|
199
|
+
[K.plus]: '+',
|
|
200
|
+
},
|
|
201
|
+
other: {
|
|
202
|
+
[K.mod]: 'Ctrl',
|
|
203
|
+
[K.meta]: 'Meta',
|
|
204
|
+
[K.ctrl]: 'Ctrl',
|
|
205
|
+
[K.alt]: 'Alt',
|
|
206
|
+
[K.shift]: 'Shift',
|
|
207
|
+
[K.enter]: 'Enter',
|
|
208
|
+
[K.escape]: 'Esc',
|
|
209
|
+
[K.tab]: 'Tab',
|
|
210
|
+
[K.backspace]: 'Backspace',
|
|
211
|
+
[K.delete]: 'Del',
|
|
212
|
+
[K.space]: 'Space',
|
|
213
|
+
[K.up]: '↑',
|
|
214
|
+
[K.down]: '↓',
|
|
215
|
+
[K.left]: '←',
|
|
216
|
+
[K.right]: '→',
|
|
217
|
+
[K.home]: 'Home',
|
|
218
|
+
[K.end]: 'End',
|
|
219
|
+
[K.pageup]: 'PgUp',
|
|
220
|
+
[K.pagedown]: 'PgDn',
|
|
221
|
+
[K.capslock]: 'Caps Lock',
|
|
222
|
+
[K.plus]: '+',
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* The glyph and the name of one key (KD-D4). Pure. `names` overrides the default **names** of
|
|
227
|
+
* known keys; a blank override is ignored. Any other token reads as it is drawn.
|
|
228
|
+
*/
|
|
229
|
+
function describeKbdKey(token, platform, names) {
|
|
230
|
+
if (token.id !== null) {
|
|
231
|
+
const override = names?.[token.id];
|
|
232
|
+
const name = typeof override === 'string' && override.trim() !== ''
|
|
233
|
+
? override.trim()
|
|
234
|
+
: KBD_DEFAULT_NAMES[platform][token.id];
|
|
235
|
+
return { glyph: GLYPHS[platform][token.id], name };
|
|
236
|
+
}
|
|
237
|
+
const glyph = normalizeKbdText(token.text);
|
|
238
|
+
return { glyph, name: glyph };
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const APPLE_UA_DATA = /^(macos|ios)$/i;
|
|
242
|
+
const APPLE_PLATFORM = /^(Mac|iPhone|iPad|iPod)/i;
|
|
243
|
+
/**
|
|
244
|
+
* Resolve `auto` (KD-D3). Pure. A non-blank `userAgentData.platform` decides alone; otherwise
|
|
245
|
+
* `navigator.platform` (iPadOS reports `MacIntel`). With no navigator (SSR, a Node test) it is `other`.
|
|
246
|
+
*/
|
|
247
|
+
function detectKbdPlatform(navigatorLike) {
|
|
248
|
+
if (!navigatorLike)
|
|
249
|
+
return KBD_PLATFORM.other;
|
|
250
|
+
const hinted = navigatorLike.userAgentData?.platform;
|
|
251
|
+
if (typeof hinted === 'string' && hinted.trim() !== '') {
|
|
252
|
+
return APPLE_UA_DATA.test(hinted.trim()) ? KBD_PLATFORM.apple : KBD_PLATFORM.other;
|
|
253
|
+
}
|
|
254
|
+
const legacy = navigatorLike.platform;
|
|
255
|
+
return typeof legacy === 'string' && APPLE_PLATFORM.test(legacy.trim())
|
|
256
|
+
? KBD_PLATFORM.apple
|
|
257
|
+
: KBD_PLATFORM.other;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const auKbdCss = () => `:host{display:inline}:host([empty]){display:none}.kbd{align-items:baseline;color:var(--aurora-kbd-color, var(--aurora-color-text, #202733));direction:ltr;display:inline-flex;font-family:var(--aurora-kbd-font-family, var(--aurora-font-family-code, var(--aurora-font-family-mono, ui-monospace, monospace)));font-size:var(--aurora-kbd-font-size, 0.85em);gap:var(--aurora-kbd-gap, 0.25em);line-height:1.35;unicode-bidi:isolate;vertical-align:baseline;white-space:nowrap}.kbd__key{background:var(--aurora-kbd-background, var(--aurora-color-surface-muted, #f0f2f5));border:var(--aurora-kbd-border-width, 1px) solid var(--aurora-kbd-border-color, var(--aurora-color-border, #d4d9e1));border-bottom-width:var(--aurora-kbd-border-bottom-width, 2px);border-radius:var(--aurora-kbd-radius, var(--aurora-radius-sm, 0.375rem));box-sizing:border-box;color:var(--aurora-kbd-color, var(--aurora-color-text, #202733));font-family:inherit;font-size:inherit;min-inline-size:var(--aurora-kbd-min-inline-size, 1.6em);padding-inline:var(--aurora-kbd-padding-inline, 0.4em);position:relative;text-align:center}.kbd__separator{color:var(--aurora-kbd-separator-color, var(--aurora-color-text-muted, #566273))}.kbd__name{border:0;clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;user-select:none;white-space:nowrap;width:1px}.kbd__name::after{content:" ";white-space:pre}@media (forced-colors: active){.kbd,.kbd__key,.kbd__separator{color:CanvasText}.kbd__key{border-color:CanvasText}}`;
|
|
261
|
+
|
|
262
|
+
const SPACE = ' ';
|
|
263
|
+
const AuKbd = class {
|
|
264
|
+
constructor(hostRef) {
|
|
265
|
+
index.registerInstance(this, hostRef);
|
|
266
|
+
}
|
|
267
|
+
get host() { return index.getElement(this); }
|
|
268
|
+
/** One key combination written with `+` (`Mod+K`, `Shift+Alt+ArrowUp`, `Ctrl++`). Blank shows the default slot instead. */
|
|
269
|
+
keys = '';
|
|
270
|
+
/** `auto` detects the platform when rendering. `apple` (macOS, iOS, iPadOS) and `other` are deterministic. An unsupported value acts as `auto` and warns once. */
|
|
271
|
+
platform = KBD_PLATFORM.auto;
|
|
272
|
+
/** JavaScript property only: overrides the visually hidden names (never the glyphs) of known keys, by key id. Blank values are ignored. */
|
|
273
|
+
keyNames;
|
|
274
|
+
parsed = { tokens: [], malformed: false };
|
|
275
|
+
componentWillLoad() {
|
|
276
|
+
this.syncEmpty();
|
|
277
|
+
}
|
|
278
|
+
componentWillRender() {
|
|
279
|
+
this.parsed = parseKbdKeys(this.keys);
|
|
280
|
+
this.warnAboutProperties();
|
|
281
|
+
this.syncEmpty();
|
|
282
|
+
}
|
|
283
|
+
warn(key, message) {
|
|
284
|
+
warnOnce.warnOncePerDocument(this.host.ownerDocument, `au-kbd:${key}`, `[au-kbd] ${message}`);
|
|
285
|
+
}
|
|
286
|
+
warnAboutProperties() {
|
|
287
|
+
if (this.parsed.malformed) {
|
|
288
|
+
this.warn('keys', `The keys value ${JSON.stringify(this.keys)} has an empty key (a stray "+"); the empty key is dropped. Write the plus key as "Plus" or as a trailing "++".`);
|
|
289
|
+
}
|
|
290
|
+
if (!isKbdPlatform(this.platform)) {
|
|
291
|
+
this.warn('platform', `Unsupported platform ${JSON.stringify(this.platform)}; it acts as "auto". Use "auto", "apple" or "other".`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/** `apple` or `other` as written; anything else is detected from `navigator`, so it is read at render time. */
|
|
295
|
+
resolvePlatform() {
|
|
296
|
+
if (this.platform === KBD_PLATFORM.apple || this.platform === KBD_PLATFORM.other) {
|
|
297
|
+
return this.platform;
|
|
298
|
+
}
|
|
299
|
+
return detectKbdPlatform(typeof navigator === 'undefined' ? undefined : navigator);
|
|
300
|
+
}
|
|
301
|
+
get usesKeys() {
|
|
302
|
+
return typeof this.keys === 'string' && this.keys.trim() !== '';
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* The component-owned `empty` attribute (KD-D13): blank `keys` and no content in the host. It is
|
|
306
|
+
* set imperatively, not through `<Host>`, so a consumer-written `empty` is removed as well.
|
|
307
|
+
*/
|
|
308
|
+
syncEmpty() {
|
|
309
|
+
const hasContent = Array.from(this.host.childNodes).some((node) => node.nodeType === 1 || (node.nodeType === 3 && (node.textContent ?? '').trim() !== ''));
|
|
310
|
+
if (!this.usesKeys && !hasContent)
|
|
311
|
+
this.host.setAttribute('empty', '');
|
|
312
|
+
else
|
|
313
|
+
this.host.removeAttribute('empty');
|
|
314
|
+
}
|
|
315
|
+
handleSlotChange = () => {
|
|
316
|
+
this.syncEmpty();
|
|
317
|
+
};
|
|
318
|
+
get names() {
|
|
319
|
+
return typeof this.keyNames === 'object' && this.keyNames !== null ? this.keyNames : undefined;
|
|
320
|
+
}
|
|
321
|
+
renderKey(token, platform) {
|
|
322
|
+
const { glyph, name } = describeKbdKey(token, platform, this.names);
|
|
323
|
+
if (glyph === name) {
|
|
324
|
+
return (index.h("kbd", { part: "key", class: "kbd__key" }, glyph));
|
|
325
|
+
}
|
|
326
|
+
// No whitespace between the two spans: the hidden name follows the glyph without a gap.
|
|
327
|
+
return (index.h("kbd", { part: "key", class: "kbd__key" }, index.h("span", { part: "glyph", "aria-hidden": "true" }, glyph), index.h("span", { class: "kbd__name" }, name)));
|
|
328
|
+
}
|
|
329
|
+
/** Keys, with one literal space between a key and what follows (KD-D6), and a silent `+` outside Apple (KD-D7). */
|
|
330
|
+
renderKeys(platform) {
|
|
331
|
+
const children = [];
|
|
332
|
+
this.parsed.tokens.forEach((token, index$1) => {
|
|
333
|
+
if (index$1 > 0) {
|
|
334
|
+
if (platform === KBD_PLATFORM.apple) {
|
|
335
|
+
children.push(SPACE);
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
children.push(SPACE, index.h("span", { part: "separator", class: "kbd__separator", "aria-hidden": "true" }, "+"), SPACE);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
children.push(this.renderKey(token, platform));
|
|
342
|
+
});
|
|
343
|
+
return children;
|
|
344
|
+
}
|
|
345
|
+
render() {
|
|
346
|
+
if (!this.usesKeys) {
|
|
347
|
+
return (index.h(index.Host, null, index.h("kbd", { part: "base", class: "kbd" }, index.h("kbd", { part: "key", class: "kbd__key" }, index.h("slot", { onSlotchange: this.handleSlotChange })))));
|
|
348
|
+
}
|
|
349
|
+
const platform = this.resolvePlatform();
|
|
350
|
+
return (index.h(index.Host, null, index.h("kbd", { part: "base", class: `kbd kbd--${platform}` }, this.renderKeys(platform))));
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
AuKbd.style = auKbdCss();
|
|
354
|
+
|
|
355
|
+
exports.au_kbd = AuKbd;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-B8lDYTMv.js');
|
|
4
|
+
var navigation = require('./navigation-lpcPjVEI.js');
|
|
5
|
+
var linkState = require('./link-state-B3rIWSPS.js');
|
|
6
|
+
var warnOnce = require('./warn-once-lHF-gQZp.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Elements that take focus or activation of their own. Inside a link row they would sit under the
|
|
10
|
+
* stretched link overlay and add a second tab stop (spec phase5-step9-list, LS-D6).
|
|
11
|
+
*/
|
|
12
|
+
const INTERACTIVE_SELECTOR = [
|
|
13
|
+
'a[href]',
|
|
14
|
+
'button',
|
|
15
|
+
'input',
|
|
16
|
+
'select',
|
|
17
|
+
'textarea',
|
|
18
|
+
'summary',
|
|
19
|
+
'iframe',
|
|
20
|
+
'[contenteditable]:not([contenteditable="false"])',
|
|
21
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
22
|
+
'au-button',
|
|
23
|
+
'au-chip',
|
|
24
|
+
'au-nav-link',
|
|
25
|
+
'au-input',
|
|
26
|
+
'au-checkbox',
|
|
27
|
+
'au-switch',
|
|
28
|
+
'au-select',
|
|
29
|
+
'au-combobox',
|
|
30
|
+
'au-segmented-control',
|
|
31
|
+
'au-slider',
|
|
32
|
+
].join(',');
|
|
33
|
+
/** True when an element, or one of its descendants, is interactive content. */
|
|
34
|
+
function hasInteractiveContent(elements) {
|
|
35
|
+
return elements.some((element) => element.matches(INTERACTIVE_SELECTOR) || element.querySelector(INTERACTIVE_SELECTOR) !== null);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const auListItemCss = () => `:host{--_item-color:var(--aurora-list-item-color, var(--aurora-color-text, #202733));--_item-description-color:var( --aurora-list-item-description-color, var(--aurora-color-text-muted, #566273) );--_item-hover-background:var( --aurora-list-item-hover-background, var(--aurora-color-surface-muted, rgba(127, 127, 127, 0.12)) );--_item-radius:var(--aurora-list-item-radius, var(--aurora-radius-md, 0.5rem));--_item-indicator-color:var( --aurora-list-item-current-indicator-color, var(--aurora-color-primary, #0b5cad) );--_item-thickness:var(--aurora-list-item-current-indicator-thickness, 3px);--_item-padding-inline:var( --aurora-list-item-padding-inline, var(--aurora-spacing-medium, 1rem) );--_item-gap:var(--aurora-list-item-gap, var(--aurora-spacing-small, 0.5rem));--_item-focus-ring:var( --aurora-list-item-focus-ring-color, var(--aurora-focus-ring-color, var(--aurora-color-focus, Highlight)) );--_item-transition-duration:var( --aurora-list-item-transition-duration, var(--aurora-motion-duration-fast, 120ms) );border-block-start:var(--_aurora-list-divider-width, 0) solid var(--aurora-list-divider-color, var(--aurora-color-border, #d4d9e1));display:block}:host(:first-child){border-block-start-width:0}.item{align-items:center;border-inline-start:var(--_item-thickness) solid transparent;border-radius:var(--_item-radius);box-sizing:border-box;color:var(--_item-color);display:flex;font-family:var(--aurora-font-family, inherit);font-size:var(--_aurora-list-item-font-size, var(--aurora-font-size-md, 1rem));gap:var(--_item-gap);isolation:isolate;line-height:var(--aurora-line-height-normal, 1.5);padding-block:var(--_aurora-list-item-padding-block, var(--aurora-spacing-small, 0.5rem));padding-inline-end:var(--_item-padding-inline);padding-inline-start:calc(var(--_item-padding-inline) - var(--_item-thickness));position:relative;transition-duration:var(--_item-transition-duration);transition-property:background-color;transition-timing-function:var(--aurora-motion-easing-standard, ease)}:host(:not([has-leading])) .item__leading,:host(:not([has-description])) .item__description,:host(:not([has-trailing])) .item__trailing{display:none}.item__leading,.item__trailing{align-items:center;display:inline-flex;flex:none}.item__trailing{color:var(--_item-description-color)}.item__content{display:flex;flex:1 1 auto;flex-direction:column;min-inline-size:0}.item__label,.item__link{min-inline-size:0;overflow-wrap:anywhere}.item__description{color:var(--_item-description-color);font-size:0.875em}.item--link{cursor:pointer}.item--link:hover{background:var(--_item-hover-background)}.item__link{color:var(--_item-color);cursor:inherit;font-weight:var(--aurora-font-weight-medium, 500);text-decoration:none;transition-duration:var(--_item-transition-duration);transition-property:color;transition-timing-function:var(--aurora-motion-easing-standard, ease)}.item__link::after{border-radius:var(--_item-radius);content:"";inset:0;position:absolute;z-index:1}.item__link:focus-visible{outline:none}.item__link:focus-visible::after{outline:var(--aurora-focus-ring-width, 2px) solid var(--_item-focus-ring);outline-offset:calc(-1 * var(--aurora-focus-ring-width, 2px))}.item--current{border-inline-start-color:var(--_item-indicator-color)}.item--current .item__link,.item--current .item__label{font-weight:var(--aurora-font-weight-semibold, 600)}.item__link[aria-disabled=true]{cursor:var(--aurora-disabled-cursor, not-allowed);opacity:var(--aurora-disabled-opacity, 0.58)}.item__new-tab-icon{block-size:0.875em;flex:none;inline-size:0.875em;margin-inline-start:0.25em;vertical-align:-0.1em}.item__visually-hidden{border:0;clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion: reduce){.item,.item__link{transition-duration:0s}}@media (forced-colors: active){:host{border-block-start-color:CanvasText}.item,.item__description,.item__trailing,.item__label{color:CanvasText}.item--link:hover{background:transparent}.item--current{border-inline-start-color:Highlight}.item__link{color:LinkText}.item__link[aria-disabled=true]{color:GrayText;opacity:1}.item__link:focus-visible::after{outline-color:Highlight}}`;
|
|
39
|
+
|
|
40
|
+
const LIST_TAG = 'au-list';
|
|
41
|
+
const SLOT_NAMES = ['default', 'leading', 'description', 'trailing'];
|
|
42
|
+
const AuListItem = class {
|
|
43
|
+
constructor(hostRef) {
|
|
44
|
+
index.registerInstance(this, hostRef);
|
|
45
|
+
}
|
|
46
|
+
get host() { return index.getElement(this); }
|
|
47
|
+
/** Destination. A non-blank value turns the row into a link. Rendered as written. Not reflected. */
|
|
48
|
+
href;
|
|
49
|
+
/** Link target. `_blank` adds `rel` tokens and the new-tab indicator. Not reflected. */
|
|
50
|
+
target;
|
|
51
|
+
/** Link `rel` tokens. Merged with `noopener noreferrer` for `_blank`. Not reflected. */
|
|
52
|
+
rel;
|
|
53
|
+
/** Visually hidden text that tells a screen reader a link opens a new tab. Localizable. */
|
|
54
|
+
newTabLabel;
|
|
55
|
+
/**
|
|
56
|
+
* The current item: `page`, `step`, `location`, `date`, `time` or `true`. `false` is omitted. Set
|
|
57
|
+
* by the consumer or router. On a link it is `aria-current` of the inner link; on a static item
|
|
58
|
+
* it is `aria-current` of the host. Never reflected.
|
|
59
|
+
*/
|
|
60
|
+
current;
|
|
61
|
+
/** Makes a link row unavailable (not focusable, click canceled). Ignored on a static item. */
|
|
62
|
+
disabled = false;
|
|
63
|
+
/** True while the slot holds an element or non-blank text. Written to `has-*` host attributes. */
|
|
64
|
+
hasLeading = false;
|
|
65
|
+
hasDescription = false;
|
|
66
|
+
hasTrailing = false;
|
|
67
|
+
slots = {};
|
|
68
|
+
hrefChanged() {
|
|
69
|
+
this.inspectInteractiveContent();
|
|
70
|
+
}
|
|
71
|
+
componentWillLoad() {
|
|
72
|
+
const doc = this.host.ownerDocument;
|
|
73
|
+
if (this.host.hasAttribute('aria-current')) {
|
|
74
|
+
warnOnce.warnOncePerDocument(doc, 'au-list-item:aria-current', 'au-list-item: aria-current on the host is not supported and was removed. Use the current attribute: the item writes aria-current on its link, or on itself when it is static.');
|
|
75
|
+
}
|
|
76
|
+
if (this.host.parentElement?.localName !== LIST_TAG) {
|
|
77
|
+
warnOnce.warnOncePerDocument(doc, 'au-list-item:no-parent', 'au-list-item: this item is not a child of au-list, so it is a listitem without a list.');
|
|
78
|
+
}
|
|
79
|
+
this.measure();
|
|
80
|
+
}
|
|
81
|
+
componentWillRender() {
|
|
82
|
+
if (navigation.normalizeAriaCurrent(this.current).invalid) {
|
|
83
|
+
warnOnce.warnOncePerDocument(this.host.ownerDocument, 'au-list-item:current', `au-list-item: current="${this.current}" is not supported and was not rendered. Use page, step, location, date, time or true.`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
componentDidLoad() {
|
|
87
|
+
this.inspectInteractiveContent();
|
|
88
|
+
}
|
|
89
|
+
componentDidRender() {
|
|
90
|
+
this.enforceHostCurrent();
|
|
91
|
+
}
|
|
92
|
+
linkInput() {
|
|
93
|
+
return {
|
|
94
|
+
href: this.href,
|
|
95
|
+
target: this.target,
|
|
96
|
+
rel: this.rel,
|
|
97
|
+
newTabLabel: this.newTabLabel,
|
|
98
|
+
unavailable: this.disabled,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
get isLink() {
|
|
102
|
+
return linkState.resolveLinkState(this.linkInput()).isLink;
|
|
103
|
+
}
|
|
104
|
+
/** Only a static item has `aria-current` on its host (LS-D7). */
|
|
105
|
+
get hostCurrent() {
|
|
106
|
+
return this.isLink ? null : navigation.normalizeAriaCurrent(this.current).value;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Stencil only removes attributes it rendered, so a consumer's host `aria-current` would
|
|
110
|
+
* survive. The item is its one writer: make the attribute match what it renders.
|
|
111
|
+
*/
|
|
112
|
+
enforceHostCurrent() {
|
|
113
|
+
const expected = this.hostCurrent;
|
|
114
|
+
if (this.host.getAttribute('aria-current') === expected)
|
|
115
|
+
return;
|
|
116
|
+
if (expected)
|
|
117
|
+
this.host.setAttribute('aria-current', expected);
|
|
118
|
+
else
|
|
119
|
+
this.host.removeAttribute('aria-current');
|
|
120
|
+
}
|
|
121
|
+
/** The nodes in a slot: the assigned ones once rendered, else the matching light-DOM children. */
|
|
122
|
+
nodesIn(name) {
|
|
123
|
+
const slot = this.slots[name];
|
|
124
|
+
if (slot)
|
|
125
|
+
return slot.assignedNodes({ flatten: true });
|
|
126
|
+
return Array.from(this.host.childNodes).filter((node) => {
|
|
127
|
+
if (node.nodeType !== 1)
|
|
128
|
+
return name === 'default';
|
|
129
|
+
const slotName = node.getAttribute('slot');
|
|
130
|
+
return name === 'default' ? !slotName : slotName === name;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
has(name) {
|
|
134
|
+
return this.nodesIn(name).some((node) => node.nodeType === 1 || (node.nodeType === 3 && (node.textContent ?? '').trim() !== ''));
|
|
135
|
+
}
|
|
136
|
+
measure() {
|
|
137
|
+
this.hasLeading = this.has('leading');
|
|
138
|
+
this.hasDescription = this.has('description');
|
|
139
|
+
this.hasTrailing = this.has('trailing');
|
|
140
|
+
}
|
|
141
|
+
/** A link row is one tab stop: a control in a slot would sit under the overlay (LS-D6). */
|
|
142
|
+
inspectInteractiveContent() {
|
|
143
|
+
if (!this.isLink)
|
|
144
|
+
return;
|
|
145
|
+
const elements = SLOT_NAMES.flatMap((name) => this.nodesIn(name)).filter((node) => node.nodeType === 1);
|
|
146
|
+
if (!hasInteractiveContent(elements))
|
|
147
|
+
return;
|
|
148
|
+
warnOnce.warnOncePerDocument(this.host.ownerDocument, 'au-list-item:interactive-content', 'au-list-item: a link row holds interactive content (a link, button or form control) in a slot. The row is already one link, so it would sit under the link overlay and add a tab stop. Keep the slots to phrasing content, or use a static item.');
|
|
149
|
+
}
|
|
150
|
+
handleSlotChange = () => {
|
|
151
|
+
this.measure();
|
|
152
|
+
this.inspectInteractiveContent();
|
|
153
|
+
};
|
|
154
|
+
handleClick = (event) => {
|
|
155
|
+
// An <a> without href still fires click, unlike a disabled <button>: stop it here.
|
|
156
|
+
if (!this.isLink || !this.disabled)
|
|
157
|
+
return;
|
|
158
|
+
event.preventDefault();
|
|
159
|
+
event.stopPropagation();
|
|
160
|
+
};
|
|
161
|
+
slotRef(name) {
|
|
162
|
+
return (element) => {
|
|
163
|
+
if (element)
|
|
164
|
+
this.slots[name] = element;
|
|
165
|
+
else
|
|
166
|
+
delete this.slots[name];
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
baseClasses() {
|
|
170
|
+
const link = linkState.resolveLinkState(this.linkInput());
|
|
171
|
+
return {
|
|
172
|
+
item: true,
|
|
173
|
+
'item--link': link.isLink && !this.disabled,
|
|
174
|
+
'item--current': navigation.normalizeAriaCurrent(this.current).value !== null,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
renderLink() {
|
|
178
|
+
const link = linkState.resolveLinkState(this.linkInput());
|
|
179
|
+
const current = navigation.normalizeAriaCurrent(this.current).value;
|
|
180
|
+
return (index.h("a", { part: "link", class: "item__link", ...link.attributes, ...(current ? { 'aria-current': current } : {}), ...(this.hasDescription ? { 'aria-describedby': 'description' } : {}), onClick: this.handleClick }, index.h("slot", { onSlotchange: this.handleSlotChange, ref: this.slotRef('default') }), link.opensNewTab ? index.h("span", { class: "item__visually-hidden" }, link.newTabText) : null, link.opensNewTab ? (index.h("svg", { class: "item__new-tab-icon", part: "new-tab-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, linkState.NEW_TAB_ICON_PATHS.map((d) => (index.h("path", { d: d }))))) : null));
|
|
181
|
+
}
|
|
182
|
+
render() {
|
|
183
|
+
const hostCurrent = this.hostCurrent;
|
|
184
|
+
return (index.h(index.Host, { key: '6f9fad5b74348be1b065d3edd9d78f5961408377', role: "listitem", ...(hostCurrent ? { 'aria-current': hostCurrent } : {}), ...(this.hasLeading ? { 'has-leading': '' } : {}), ...(this.hasDescription ? { 'has-description': '' } : {}), ...(this.hasTrailing ? { 'has-trailing': '' } : {}) }, index.h("div", { key: '1f7d7ccc9155bc777d7b4eeb6e5a182c3f069212', part: "base", class: this.baseClasses() }, index.h("span", { key: '72bb82751fc36d3a9fddc452524e94edac0f17f6', part: "leading", class: "item__leading" }, index.h("slot", { key: 'd9f12466ee4509954993b56bc14cf60a7ba461a2', name: "leading", onSlotchange: this.handleSlotChange, ref: this.slotRef('leading') })), index.h("span", { key: 'e47c1e2bf2155f1d65b23794ce232e064a40d754', part: "content", class: "item__content" }, this.isLink ? (this.renderLink()) : (index.h("span", { part: "label", class: "item__label" }, index.h("slot", { onSlotchange: this.handleSlotChange, ref: this.slotRef('default') }))), index.h("span", { key: '96800d9596606c096b5db5d0f804d020fe464cfa', part: "description", class: "item__description", id: "description" }, index.h("slot", { key: 'ab490cb957be7bbfd37a474d11b684b3121ab83d', name: "description", onSlotchange: this.handleSlotChange, ref: this.slotRef('description') }))), index.h("span", { key: '751e0323c390abfc10fd8f5085fcb30ba732b9ca', part: "trailing", class: "item__trailing" }, index.h("slot", { key: 'fe96baeb9ec8f2d647763441c7d48bdb244f0e74', name: "trailing", onSlotchange: this.handleSlotChange, ref: this.slotRef('trailing') })))));
|
|
185
|
+
}
|
|
186
|
+
static get delegatesFocus() { return true; }
|
|
187
|
+
static get watchers() { return {
|
|
188
|
+
"href": [{
|
|
189
|
+
"hrefChanged": 0
|
|
190
|
+
}]
|
|
191
|
+
}; }
|
|
192
|
+
};
|
|
193
|
+
AuListItem.style = auListItemCss();
|
|
194
|
+
|
|
195
|
+
exports.au_list_item = AuListItem;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-B8lDYTMv.js');
|
|
4
|
+
var warnOnce = require('./warn-once-lHF-gQZp.js');
|
|
5
|
+
|
|
6
|
+
/** Literals only: no import from the foundations, so the `/constants` subpath stays standalone. */
|
|
7
|
+
/** Row density. `small` is the compact density, `medium` the default. */
|
|
8
|
+
const LIST_SIZE = {
|
|
9
|
+
small: 'small',
|
|
10
|
+
medium: 'medium',
|
|
11
|
+
};
|
|
12
|
+
const sizes = new Set(Object.values(LIST_SIZE));
|
|
13
|
+
const isListSize = (value) => typeof value === 'string' && sizes.has(value);
|
|
14
|
+
|
|
15
|
+
const auListCss = () => `:host{--_aurora-list-item-padding-block:var( --aurora-list-item-padding-block-medium, var(--aurora-spacing-small, 0.5rem) );--_aurora-list-item-font-size:var( --aurora-list-item-font-size-medium, var(--aurora-font-size-md, 1rem) );display:block}:host([size=small]){--_aurora-list-item-padding-block:var( --aurora-list-item-padding-block-small, var(--aurora-spacing-extra-small, 0.25rem) );--_aurora-list-item-font-size:var( --aurora-list-item-font-size-small, var(--aurora-font-size-sm, 0.875rem) )}:host([dividers]){--_aurora-list-divider-width:1px}.list{display:block}`;
|
|
16
|
+
|
|
17
|
+
const ITEM_TAG = 'au-list-item';
|
|
18
|
+
/** Elements that render nothing and so never count as a foreign child. */
|
|
19
|
+
const IGNORED_TAGS = new Set(['template', 'script', 'style']);
|
|
20
|
+
const AuList = class {
|
|
21
|
+
constructor(hostRef) {
|
|
22
|
+
index.registerInstance(this, hostRef);
|
|
23
|
+
}
|
|
24
|
+
get host() { return index.getElement(this); }
|
|
25
|
+
/** Row density: `small` or `medium`. Unsupported values render `medium` and warn once. */
|
|
26
|
+
size = LIST_SIZE.medium;
|
|
27
|
+
/** Draws a divider between rows (a border above every item but the first). */
|
|
28
|
+
dividers = false;
|
|
29
|
+
slotElement;
|
|
30
|
+
sizeChanged() {
|
|
31
|
+
this.normalizeSize();
|
|
32
|
+
}
|
|
33
|
+
componentWillLoad() {
|
|
34
|
+
this.normalizeSize();
|
|
35
|
+
}
|
|
36
|
+
componentDidLoad() {
|
|
37
|
+
this.warnAboutChildren();
|
|
38
|
+
}
|
|
39
|
+
componentDidRender() {
|
|
40
|
+
this.enforceRole();
|
|
41
|
+
}
|
|
42
|
+
/** The component is the one writer of `role`: a consumer value (`log`, `menu`) is put back. */
|
|
43
|
+
enforceRole() {
|
|
44
|
+
if (this.host.getAttribute('role') !== 'list')
|
|
45
|
+
this.host.setAttribute('role', 'list');
|
|
46
|
+
}
|
|
47
|
+
/** An unsupported size renders `medium` (also on the reflected attribute) and warns once. */
|
|
48
|
+
normalizeSize() {
|
|
49
|
+
if (isListSize(this.size))
|
|
50
|
+
return;
|
|
51
|
+
warnOnce.warnOncePerDocument(this.host.ownerDocument, 'au-list:size', `au-list: size=${JSON.stringify(this.size)} is not supported and renders "medium". Use "small" or "medium".`);
|
|
52
|
+
this.size = LIST_SIZE.medium;
|
|
53
|
+
}
|
|
54
|
+
handleSlotChange = () => {
|
|
55
|
+
this.warnAboutChildren();
|
|
56
|
+
};
|
|
57
|
+
/** Discovery is only used to warn: the list writes nothing on its items. */
|
|
58
|
+
warnAboutChildren() {
|
|
59
|
+
const nodes = this.slotElement?.assignedElements({ flatten: true }) ?? [];
|
|
60
|
+
const foreign = nodes.find((element) => element.localName !== ITEM_TAG && !IGNORED_TAGS.has(element.localName));
|
|
61
|
+
if (!foreign)
|
|
62
|
+
return;
|
|
63
|
+
warnOnce.warnOncePerDocument(this.host.ownerDocument, 'au-list:foreign-child', `au-list: <${foreign.localName}> is not an ${ITEM_TAG}. It would be a child of the list that is not a listitem. Only ${ITEM_TAG} belongs in the default slot.`);
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return (index.h(index.Host, { key: '6931b6bf4cb4dc1ac4972fd9faf6f07df4e20098', role: "list" }, index.h("div", { key: '3459c848d615a5936c3e5167b43a9473803dc4ff', part: "base", class: "list" }, index.h("slot", { key: '41fe35d5b1fca2b3731140b474199950f0a177f4', onSlotchange: this.handleSlotChange, ref: (element) => {
|
|
67
|
+
this.slotElement = element;
|
|
68
|
+
} }))));
|
|
69
|
+
}
|
|
70
|
+
static get watchers() { return {
|
|
71
|
+
"size": [{
|
|
72
|
+
"sizeChanged": 0
|
|
73
|
+
}]
|
|
74
|
+
}; }
|
|
75
|
+
};
|
|
76
|
+
AuList.style = auListCss();
|
|
77
|
+
|
|
78
|
+
exports.au_list = AuList;
|
|
@@ -47,7 +47,7 @@ const AuMenuItem = class {
|
|
|
47
47
|
const type = menu.isMenuItemType(this.type) ? this.type : menu.MENU_ITEM_TYPE.item;
|
|
48
48
|
const checkable = type !== menu.MENU_ITEM_TYPE.item;
|
|
49
49
|
const checked = this.checked ? 'true' : 'false';
|
|
50
|
-
return (index.h(index.Host, { key: '
|
|
50
|
+
return (index.h(index.Host, { key: '302594dae0faaf04de310a413158e21b640e180b', role: ROLES[type], "aria-checked": checkable ? checked : undefined }, checkable ? (index.h("span", { class: { 'menu-item__check': true, 'menu-item__check--checked': this.checked }, part: "check", "aria-hidden": "true" }, type === menu.MENU_ITEM_TYPE.checkbox ? (index.h("au-icon", { icon: CHECK_ICON, decorative: true })) : (index.h("span", { class: "menu-item__dot" })))) : null, index.h("span", { key: '73a3647747511daa9ffb69aa74b2336ed4fe360e', class: "menu-item__start", part: "start" }, index.h("slot", { key: '80b94cec1bff4f73749412de57ec4786f22acc26', name: "start" })), index.h("span", { key: '1e66b31f6f82d2a8ccf6941d5a3750e334b8c318', class: "menu-item__label", part: "label" }, index.h("slot", { key: '51c62164283a6ae3473cee06b6b9b14878ecb6bb' })), index.h("span", { key: 'c0cd49c5725d4c8545716fb54d4bfff018bc99a5', class: "menu-item__end", part: "end" }, index.h("slot", { key: '606cbef7c5bc7ec4ce41802cebf399f075992956', name: "end" }))));
|
|
51
51
|
}
|
|
52
52
|
static get watchers() { return {
|
|
53
53
|
"type": [{
|
|
@@ -332,7 +332,7 @@ const AuMenu = class {
|
|
|
332
332
|
console.warn(message);
|
|
333
333
|
}
|
|
334
334
|
render() {
|
|
335
|
-
return (index.h(index.Host, { key: '
|
|
335
|
+
return (index.h(index.Host, { key: 'd796cdb364ae4229ecc4c53f69b3fb19ee0e4f85', role: "menu", tabindex: this.itemCount === 0 ? '-1' : undefined }, index.h("slot", { key: '3b3cb26ef1ebbcbbd56f4c05a67cf784cbf38ab3', ref: (element) => {
|
|
336
336
|
this.slotElement = element;
|
|
337
337
|
}, onSlotchange: this.handleSlotChange })));
|
|
338
338
|
}
|