@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,104 @@
|
|
|
1
|
+
import { r as registerInstance, g as getElement, h } from './index-KLUZmSN-.js';
|
|
2
|
+
import { w as warnOncePerDocument } from './warn-once-Ci-XzGE3.js';
|
|
3
|
+
|
|
4
|
+
/** Literals only: no import from the foundations, so the `/constants` subpath stays standalone. */
|
|
5
|
+
/** `text` draws one or more bars (`lines`), `circle` an avatar-sized disc and `rect` a media or card block. */
|
|
6
|
+
const SKELETON_SHAPE = {
|
|
7
|
+
text: 'text',
|
|
8
|
+
circle: 'circle',
|
|
9
|
+
rect: 'rect',
|
|
10
|
+
};
|
|
11
|
+
/** `shimmer` moves a highlight across each bar. Reduced motion is always static, whatever the value. */
|
|
12
|
+
const SKELETON_ANIMATION = {
|
|
13
|
+
shimmer: 'shimmer',
|
|
14
|
+
none: 'none',
|
|
15
|
+
};
|
|
16
|
+
/** The most lines a text skeleton renders. A larger value is clamped, so a typo cannot render hundreds of nodes. */
|
|
17
|
+
const SKELETON_MAX_LINES = 20;
|
|
18
|
+
const shapes = new Set(Object.values(SKELETON_SHAPE));
|
|
19
|
+
const animations = new Set(Object.values(SKELETON_ANIMATION));
|
|
20
|
+
const isSkeletonShape = (value) => typeof value === 'string' && shapes.has(value);
|
|
21
|
+
const isSkeletonAnimation = (value) => typeof value === 'string' && animations.has(value);
|
|
22
|
+
/**
|
|
23
|
+
* The number of lines to render. `undefined` and `null` (a removed attribute) are the unset default
|
|
24
|
+
* (one line, valid). `NaN`, a value below 1 and a non-finite value give one line and are invalid; a
|
|
25
|
+
* value above the maximum is clamped and is invalid too. Fractions are floored.
|
|
26
|
+
*/
|
|
27
|
+
function normalizeSkeletonLines(value) {
|
|
28
|
+
if (value === undefined || value === null)
|
|
29
|
+
return { lines: 1, invalid: false };
|
|
30
|
+
const number = Math.floor(Number(value));
|
|
31
|
+
if (!Number.isFinite(number) || number < 1)
|
|
32
|
+
return { lines: 1, invalid: true };
|
|
33
|
+
if (number > SKELETON_MAX_LINES)
|
|
34
|
+
return { lines: SKELETON_MAX_LINES, invalid: true };
|
|
35
|
+
return { lines: number, invalid: false };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const auSkeletonCss = () => `:host{display:block}:host([shape=circle]){inline-size:fit-content}.skeleton{display:block}.skeleton--text{display:flex;flex-direction:column;gap:var(--aurora-skeleton-line-gap, 0.5em);inline-size:var(--aurora-skeleton-inline-size, 100%)}.skeleton__line,.skeleton--circle,.skeleton--rect{background-color:var(--aurora-skeleton-background, color-mix(in srgb, var(--aurora-color-text, #202733) 10%, var(--aurora-color-canvas, #ffffff)));box-sizing:border-box}.skeleton__line{block-size:var(--aurora-skeleton-line-block-size, 0.875em);border-radius:var(--aurora-skeleton-radius, var(--aurora-radius-sm, 0.25rem));inline-size:100%}.skeleton__line--last{inline-size:var(--aurora-skeleton-last-line-inline-size, 60%)}.skeleton--circle{block-size:var(--aurora-skeleton-size, 2.5rem);border-radius:50%;inline-size:var(--aurora-skeleton-size, 2.5rem)}.skeleton--rect{block-size:var(--aurora-skeleton-block-size, 6rem);border-radius:var(--aurora-skeleton-radius, var(--aurora-radius-md, 0.5rem));inline-size:var(--aurora-skeleton-inline-size, 100%)}.skeleton--shimmer .skeleton__line,.skeleton--shimmer.skeleton--circle,.skeleton--shimmer.skeleton--rect{animation:skeleton-shimmer var(--aurora-skeleton-animation-duration, 1.5s) ease-in-out infinite;background-image:linear-gradient(90deg, transparent 25%, var(--aurora-skeleton-highlight, color-mix(in srgb, var(--aurora-color-canvas, #ffffff) 60%, transparent)) 50%, transparent 75%);background-repeat:no-repeat;background-size:200% 100%}@keyframes skeleton-shimmer{from{background-position:100% 0}to{background-position:0 0}}:host(:dir(rtl)) .skeleton--shimmer .skeleton__line,:host(:dir(rtl)) .skeleton--shimmer.skeleton--circle,:host(:dir(rtl)) .skeleton--shimmer.skeleton--rect{animation-direction:reverse}@media (prefers-reduced-motion: reduce){.skeleton--shimmer .skeleton__line,.skeleton--shimmer.skeleton--circle,.skeleton--shimmer.skeleton--rect{animation:none;background-image:none}}@media (forced-colors: active){.skeleton__line,.skeleton--circle,.skeleton--rect,.skeleton--shimmer .skeleton__line,.skeleton--shimmer.skeleton--circle,.skeleton--shimmer.skeleton--rect{animation:none;background:Canvas;border:1px solid GrayText}}`;
|
|
39
|
+
|
|
40
|
+
const AuSkeleton = class {
|
|
41
|
+
constructor(hostRef) {
|
|
42
|
+
registerInstance(this, hostRef);
|
|
43
|
+
}
|
|
44
|
+
get host() { return getElement(this); }
|
|
45
|
+
/** What the placeholder stands in for: `text` (lines), `circle` (an avatar) or `rect` (media or a card block). An unsupported value renders `text` and warns once. */
|
|
46
|
+
shape = SKELETON_SHAPE.text;
|
|
47
|
+
/** The number of lines of a `text` skeleton, from 1 to 20; the last of several is shorter. Ignored for `circle` and `rect`. An invalid value renders one line (or twenty when too large) and warns once. */
|
|
48
|
+
lines = 1;
|
|
49
|
+
/** `shimmer` moves a highlight across the bars; `none` is static. Reduced motion is always static. An unsupported value renders `shimmer` and warns once. */
|
|
50
|
+
animation = SKELETON_ANIMATION.shimmer;
|
|
51
|
+
componentWillLoad() {
|
|
52
|
+
this.syncHidden();
|
|
53
|
+
}
|
|
54
|
+
componentWillRender() {
|
|
55
|
+
this.warnAboutProperties();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The host is always decorative (SK-D2). Stencil diffs against the previous vnode, not the live
|
|
59
|
+
* DOM, so `<Host aria-hidden>` would not undo a later consumer write; the attribute is written
|
|
60
|
+
* imperatively after every render instead.
|
|
61
|
+
*/
|
|
62
|
+
componentDidRender() {
|
|
63
|
+
this.syncHidden();
|
|
64
|
+
}
|
|
65
|
+
syncHidden() {
|
|
66
|
+
this.host.setAttribute('aria-hidden', 'true');
|
|
67
|
+
}
|
|
68
|
+
get safeShape() {
|
|
69
|
+
return isSkeletonShape(this.shape) ? this.shape : SKELETON_SHAPE.text;
|
|
70
|
+
}
|
|
71
|
+
get safeAnimation() {
|
|
72
|
+
return isSkeletonAnimation(this.animation) ? this.animation : SKELETON_ANIMATION.shimmer;
|
|
73
|
+
}
|
|
74
|
+
warn(key, message) {
|
|
75
|
+
warnOncePerDocument(this.host.ownerDocument, `au-skeleton:${key}`, `[au-skeleton] ${message}`);
|
|
76
|
+
}
|
|
77
|
+
warnAboutProperties() {
|
|
78
|
+
if (!isSkeletonShape(this.shape)) {
|
|
79
|
+
this.warn('shape', `Unsupported shape ${JSON.stringify(this.shape)}; it renders as "text". Use "text", "circle" or "rect".`);
|
|
80
|
+
}
|
|
81
|
+
if (!isSkeletonAnimation(this.animation)) {
|
|
82
|
+
this.warn('animation', `Unsupported animation ${JSON.stringify(this.animation)}; it renders as "shimmer". Use "shimmer" or "none".`);
|
|
83
|
+
}
|
|
84
|
+
// `lines` only means something for a text skeleton (SK-D4).
|
|
85
|
+
if (this.safeShape === SKELETON_SHAPE.text && normalizeSkeletonLines(this.lines).invalid) {
|
|
86
|
+
this.warn('lines', `Unsupported lines ${JSON.stringify(this.lines)}; use an integer from 1 to 20. It renders as one line, or twenty when larger.`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
renderLines() {
|
|
90
|
+
const { lines } = normalizeSkeletonLines(this.lines);
|
|
91
|
+
return Array.from({ length: lines }, (_, index) => {
|
|
92
|
+
const last = lines > 1 && index === lines - 1;
|
|
93
|
+
return (h("span", { part: last ? 'line line-last' : 'line', class: `skeleton__line${last ? ' skeleton__line--last' : ''}` }));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
const shape = this.safeShape;
|
|
98
|
+
const motion = this.safeAnimation === SKELETON_ANIMATION.none ? 'static' : 'shimmer';
|
|
99
|
+
return (h("span", { key: '6a0924fdece21086972f228c24f5ae36a751ae46', part: "base", class: `skeleton skeleton--${shape} skeleton--${motion}` }, shape === SKELETON_SHAPE.text && this.renderLines()));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
AuSkeleton.style = auSkeletonCss();
|
|
103
|
+
|
|
104
|
+
export { AuSkeleton as au_skeleton };
|
|
@@ -243,15 +243,15 @@ const AuSlider = class {
|
|
|
243
243
|
'aria-describedby': this.descriptionIds,
|
|
244
244
|
'aria-valuetext': formatted ? formatted : undefined,
|
|
245
245
|
});
|
|
246
|
-
return (h(Host, { key: '
|
|
246
|
+
return (h(Host, { key: '3af341a80f2156043f60a881455ac37e819c5350', class: {
|
|
247
247
|
'slider-host--disabled': disabled,
|
|
248
248
|
'slider-host--invalid': this.isInvalid,
|
|
249
|
-
} }, h("div", { key: '
|
|
249
|
+
} }, h("div", { key: 'caaf6394be09f8527ff72478d3679a7293c6954e', class: {
|
|
250
250
|
slider: true,
|
|
251
251
|
[`slider--${orientation}`]: true,
|
|
252
252
|
'slider--disabled': disabled,
|
|
253
253
|
'slider--invalid': this.isInvalid,
|
|
254
|
-
} }, labelText || this.showValue ? (h("div", { class: "slider__header" }, labelText ? (h("label", { class: "slider__label", part: "label", htmlFor: this.inputId }, labelText)) : null, this.showValue ? (h("span", { class: "slider__value", part: "value", "aria-hidden": "true" }, valueText)) : null)) : null, h("div", { key: '
|
|
254
|
+
} }, labelText || this.showValue ? (h("div", { class: "slider__header" }, labelText ? (h("label", { class: "slider__label", part: "label", htmlFor: this.inputId }, labelText)) : null, this.showValue ? (h("span", { class: "slider__value", part: "value", "aria-hidden": "true" }, valueText)) : null)) : null, h("div", { key: 'ee0900e9e07879e2c1b25af558291abaa50c9e88', class: "slider__track-wrap" }, h("input", { key: '64c5276b4f488d5920c5a8f1db60da4f1537cf80', ref: (element) => {
|
|
255
255
|
this.inputElement = element;
|
|
256
256
|
if (!element)
|
|
257
257
|
return;
|
|
@@ -218,9 +218,9 @@ const AuSplitter = class {
|
|
|
218
218
|
const separatorAttributes = this.disabled
|
|
219
219
|
? { 'aria-disabled': 'true' }
|
|
220
220
|
: { tabindex: '0' };
|
|
221
|
-
return (h(Host, { key: '
|
|
221
|
+
return (h(Host, { key: '983ad617dcebff258fe3690c3d6615379521a37e' }, h("div", { key: '6367c20784ee1990408a1c12e4829cd9fb09d55c', part: "base", class: "base", "data-dragging": this.dragging ? '' : undefined, style: { '--_aurora-splitter-start': `${value}%` }, ref: (element) => {
|
|
222
222
|
this.baseElement = element;
|
|
223
|
-
} }, h("div", { key: '
|
|
223
|
+
} }, h("div", { key: 'f0d80ab760c8d26d988700ea697f66a15afbd68c', part: "start", class: "pane pane--start", id: START_ID }, h("slot", { key: 'b813d5a0794bb8c922542714356b0cea0850dc70', name: "start" })), h("div", { key: '2592541654155cfccabee2660dceec3d6d20d9f6', part: "separator", class: "separator", role: "separator", "aria-orientation": orientation === SPLITTER_ORIENTATION.horizontal ? 'vertical' : 'horizontal', "aria-valuenow": String(Math.round(value)), "aria-valuemin": String(min), "aria-valuemax": String(max), "aria-controls": START_ID, "aria-label": label === '' ? SPLITTER_DEFAULT_LABEL : label, ...separatorAttributes, onKeyDown: this.handleKeyDown, onPointerDown: this.handlePointerDown, onPointerMove: this.handlePointerMove, onPointerUp: this.endDrag, onPointerCancel: this.endDrag }), h("div", { key: 'cb1db61e78ada8d6acbda286ca850fbbb2d753d6', part: "end", class: "pane pane--end" }, h("slot", { key: 'f8cd2c712d462ff45cc30f05a665eeb86e138b12', name: "end" })))));
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
AuSplitter.style = auSplitterCss();
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { r as registerInstance, g as getElement, h, H as Host } from './index-KLUZmSN-.js';
|
|
2
|
+
import { c as cancelAnnouncement, b as announce } from './live-announcer-IAjNBWYI.js';
|
|
3
|
+
import { w as warnOncePerDocument } from './warn-once-Ci-XzGE3.js';
|
|
4
|
+
import './deep-active-element-C-bRwiWx.js';
|
|
5
|
+
|
|
6
|
+
/** Literals only: no import of the generated constants, so the `/constants` subpath stays standalone. */
|
|
7
|
+
const STAT_SIZE = {
|
|
8
|
+
small: 'small',
|
|
9
|
+
medium: 'medium',
|
|
10
|
+
large: 'large',
|
|
11
|
+
};
|
|
12
|
+
/** Direction of the change. Independent of `intent` (ST-D4): the component never infers one from the other. */
|
|
13
|
+
const STAT_TREND = {
|
|
14
|
+
up: 'up',
|
|
15
|
+
down: 'down',
|
|
16
|
+
flat: 'flat',
|
|
17
|
+
};
|
|
18
|
+
/** Color of the delta row only. */
|
|
19
|
+
const STAT_INTENT = {
|
|
20
|
+
neutral: 'neutral',
|
|
21
|
+
success: 'success',
|
|
22
|
+
danger: 'danger',
|
|
23
|
+
};
|
|
24
|
+
/** `polite` announces value changes through the document announcer. `off` (default) never does. */
|
|
25
|
+
const STAT_LIVE = {
|
|
26
|
+
off: 'off',
|
|
27
|
+
polite: 'polite',
|
|
28
|
+
};
|
|
29
|
+
/** Defaults of the four localizable labels (hidden direction words and the empty state). */
|
|
30
|
+
const STAT_DEFAULT_LABELS = {
|
|
31
|
+
up: 'Up',
|
|
32
|
+
down: 'Down',
|
|
33
|
+
flat: 'Unchanged',
|
|
34
|
+
empty: 'No data',
|
|
35
|
+
};
|
|
36
|
+
/** The decorative icon of each direction. Literals typed `BuiltInIconName`, pinned to the core icons by AC-8.IC6. */
|
|
37
|
+
const STAT_TREND_ICON = {
|
|
38
|
+
up: 'trending-up',
|
|
39
|
+
down: 'trending-down',
|
|
40
|
+
flat: 'minus',
|
|
41
|
+
};
|
|
42
|
+
const sizes = new Set(Object.values(STAT_SIZE));
|
|
43
|
+
const trends = new Set(Object.values(STAT_TREND));
|
|
44
|
+
const intents = new Set(Object.values(STAT_INTENT));
|
|
45
|
+
const lives = new Set(Object.values(STAT_LIVE));
|
|
46
|
+
const isStatSize = (value) => typeof value === 'string' && sizes.has(value);
|
|
47
|
+
const isStatTrend = (value) => typeof value === 'string' && trends.has(value);
|
|
48
|
+
const isStatIntent = (value) => typeof value === 'string' && intents.has(value);
|
|
49
|
+
const isStatLive = (value) => typeof value === 'string' && lives.has(value);
|
|
50
|
+
|
|
51
|
+
const clean = (value) => typeof value === 'string' ? value.trim() : '';
|
|
52
|
+
/**
|
|
53
|
+
* The text the announcer speaks for a stat (ST-D10): the non-blank parts joined with `, `, namely
|
|
54
|
+
* the label, the value with its unit (or the empty label), and the direction word with the delta.
|
|
55
|
+
* Pure, so it can be unit-tested.
|
|
56
|
+
*/
|
|
57
|
+
function composeStatAnnouncement(parts) {
|
|
58
|
+
const value = clean(parts.value);
|
|
59
|
+
const unit = clean(parts.unit);
|
|
60
|
+
const measured = value === '' ? clean(parts.emptyLabel) : [value, unit].filter(Boolean).join(' ');
|
|
61
|
+
const change = [clean(parts.trendWord), clean(parts.delta)].filter(Boolean).join(' ');
|
|
62
|
+
return [clean(parts.label), measured, change].filter(Boolean).join(', ');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const auStatCss = () => `:host{display:block;min-width:0}.stat{--_stat-value-font-size:var(--aurora-stat-value-font-size, var(--aurora-font-size-2xl, 1.5rem));--_stat-delta-color:var(--aurora-stat-neutral-color, var(--aurora-color-text-muted, #566273));margin:0;min-width:0;padding:0;position:relative}.stat--small{--_stat-value-font-size:var(--aurora-stat-value-font-size, var(--aurora-font-size-xl, 1.25rem))}.stat--medium{--_stat-value-font-size:var(--aurora-stat-value-font-size, var(--aurora-font-size-2xl, 1.5rem))}.stat--large{--_stat-value-font-size:var( --aurora-stat-value-font-size, var(--aurora-font-size-3xl, 1.875rem) )}.stat--intent-neutral{--_stat-delta-color:var(--aurora-stat-neutral-color, var(--aurora-color-text-muted, #566273))}.stat--intent-success{--_stat-delta-color:var(--aurora-stat-success-color, var(--aurora-color-success, #176b48))}.stat--intent-danger{--_stat-delta-color:var(--aurora-stat-danger-color, var(--aurora-color-danger, #a32635))}.stat__group{display:flex;flex-direction:column;gap:var(--aurora-stat-gap, var(--aurora-spacing-extra-small, 0.25rem));min-width:0}.stat__label{align-items:center;color:var(--aurora-stat-label-color, var(--aurora-color-text-muted, #566273));display:flex;font-family:var(--aurora-font-family-small, Lato, sans-serif);font-size:var(--aurora-stat-label-font-size, var(--aurora-font-size-sm, 0.875rem));line-height:1.35;margin:0;overflow-wrap:anywhere}.stat__start{display:contents}::slotted([slot=start]){flex:none;margin-inline-end:0.375em}.stat__value{color:var(--aurora-stat-value-color, var(--aurora-color-text, #202733));font-family:var(--aurora-font-family-heading, Montserrat, sans-serif);font-size:var(--_stat-value-font-size);font-weight:var(--aurora-stat-value-font-weight, var(--aurora-font-weight-semibold, 600));line-height:1.2;margin:0;overflow-wrap:anywhere}.stat__number,.stat__delta-text{font-kerning:none;font-variant-numeric:tabular-nums}.stat__unit{color:var(--aurora-stat-unit-color, var(--aurora-color-text-muted, #566273));font-size:0.6em;font-weight:var(--aurora-font-weight-normal, 400)}.stat__delta{color:var(--_stat-delta-color);font-family:var(--aurora-font-family-small, Lato, sans-serif);font-size:var(--aurora-stat-delta-font-size, var(--aurora-font-size-sm, 0.875rem));line-height:1.35;margin:0;overflow-wrap:anywhere}.stat__trend-icon{--aurora-icon-size:1em;vertical-align:-0.125em}.stat__description{color:var(--aurora-stat-label-color, var(--aurora-color-text-muted, #566273));font-family:var(--aurora-font-family-small, Lato, sans-serif);font-size:var(--aurora-stat-label-font-size, var(--aurora-font-size-sm, 0.875rem));line-height:1.35;margin:0}.stat__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 (forced-colors: active){.stat__label,.stat__value,.stat__unit,.stat__delta,.stat__delta-text,.stat__description,.stat__trend-icon{color:CanvasText}}`;
|
|
66
|
+
|
|
67
|
+
const EMPTY_DASH = '\u2014';
|
|
68
|
+
/** One announcer key per instance, so a stat replaces its own pending text and no other. */
|
|
69
|
+
let nextInstance = 0;
|
|
70
|
+
const text = (value) => value === undefined || value === null ? '' : String(value).trim();
|
|
71
|
+
const AuStat = class {
|
|
72
|
+
constructor(hostRef) {
|
|
73
|
+
registerInstance(this, hostRef);
|
|
74
|
+
}
|
|
75
|
+
get host() { return getElement(this); }
|
|
76
|
+
/** The term of the description list. Trimmed. A blank label warns once. */
|
|
77
|
+
label = '';
|
|
78
|
+
/** The value, rendered as written (`String()` for a number). Blank shows the empty state. */
|
|
79
|
+
value = '';
|
|
80
|
+
/** The unit, shown after the value. Omitted when blank. */
|
|
81
|
+
unit = '';
|
|
82
|
+
/** The change, rendered as written, sign included (`+3.2 %`). */
|
|
83
|
+
delta = '';
|
|
84
|
+
/** Direction of the change. Adds a decorative icon and a visually hidden direction word. Unsupported values render no direction and warn once. */
|
|
85
|
+
trend;
|
|
86
|
+
/** Color of the delta row only, independent of `trend`. Unsupported values render `neutral` and warn once. */
|
|
87
|
+
intent = STAT_INTENT.neutral;
|
|
88
|
+
/** `polite` announces changes through the document announcer. Unsupported values render `off` and warn once. */
|
|
89
|
+
live = STAT_LIVE.off;
|
|
90
|
+
/** Size of the value. Unsupported values render `medium` and warn once. */
|
|
91
|
+
size = STAT_SIZE.medium;
|
|
92
|
+
/** Hidden direction word for `trend="up"`. Blank falls back to `Up`. */
|
|
93
|
+
upLabel = STAT_DEFAULT_LABELS.up;
|
|
94
|
+
/** Hidden direction word for `trend="down"`. Blank falls back to `Down`. */
|
|
95
|
+
downLabel = STAT_DEFAULT_LABELS.down;
|
|
96
|
+
/** Hidden direction word for `trend="flat"`. Blank falls back to `Unchanged`. */
|
|
97
|
+
flatLabel = STAT_DEFAULT_LABELS.flat;
|
|
98
|
+
/** Hidden text (and announcement) for a blank value. Blank falls back to `No data`. */
|
|
99
|
+
emptyLabel = STAT_DEFAULT_LABELS.empty;
|
|
100
|
+
/** True while the `description` slot has an assigned element. */
|
|
101
|
+
described = false;
|
|
102
|
+
/** The announcement text last seen (ST-D9). Undefined until the first load completes. */
|
|
103
|
+
baseline;
|
|
104
|
+
announcerKey = `au-stat:${(nextInstance += 1)}`;
|
|
105
|
+
componentWillLoad() {
|
|
106
|
+
this.measureDescription();
|
|
107
|
+
}
|
|
108
|
+
componentDidLoad() {
|
|
109
|
+
this.baseline = this.announcementText();
|
|
110
|
+
}
|
|
111
|
+
connectedCallback() {
|
|
112
|
+
// A moved or re-attached stat takes its current text as the baseline (changes while detached are silent).
|
|
113
|
+
if (this.baseline !== undefined)
|
|
114
|
+
this.baseline = this.announcementText();
|
|
115
|
+
}
|
|
116
|
+
disconnectedCallback() {
|
|
117
|
+
cancelAnnouncement(this.announcerKey, this.host.ownerDocument);
|
|
118
|
+
}
|
|
119
|
+
contentChanged() {
|
|
120
|
+
if (this.baseline === undefined)
|
|
121
|
+
return;
|
|
122
|
+
const next = this.announcementText();
|
|
123
|
+
if (next === this.baseline)
|
|
124
|
+
return;
|
|
125
|
+
this.baseline = next;
|
|
126
|
+
if (this.live === STAT_LIVE.polite && this.canAnnounce()) {
|
|
127
|
+
announce(next, { politeness: 'polite', key: this.announcerKey }, this.host.ownerDocument);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
liveChanged() {
|
|
131
|
+
if (this.baseline === undefined)
|
|
132
|
+
return;
|
|
133
|
+
this.baseline = this.announcementText();
|
|
134
|
+
if (this.live !== STAT_LIVE.polite) {
|
|
135
|
+
cancelAnnouncement(this.announcerKey, this.host.ownerDocument);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** A hidden host (a closed popover or dock) or a detached one stays silent (ST-D9). */
|
|
139
|
+
canAnnounce() {
|
|
140
|
+
return this.host.isConnected && this.host.getClientRects().length > 0;
|
|
141
|
+
}
|
|
142
|
+
announcementText() {
|
|
143
|
+
const trend = this.safeTrend;
|
|
144
|
+
return composeStatAnnouncement({
|
|
145
|
+
label: this.label,
|
|
146
|
+
value: text(this.value),
|
|
147
|
+
unit: this.unit,
|
|
148
|
+
trendWord: trend === undefined ? '' : this.directionWord(trend),
|
|
149
|
+
delta: this.delta,
|
|
150
|
+
emptyLabel: this.emptyText,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
componentWillRender() {
|
|
154
|
+
this.warnAboutProperties();
|
|
155
|
+
}
|
|
156
|
+
get safeSize() {
|
|
157
|
+
return isStatSize(this.size) ? this.size : STAT_SIZE.medium;
|
|
158
|
+
}
|
|
159
|
+
get safeIntent() {
|
|
160
|
+
return isStatIntent(this.intent) ? this.intent : STAT_INTENT.neutral;
|
|
161
|
+
}
|
|
162
|
+
get safeTrend() {
|
|
163
|
+
return isStatTrend(this.trend) ? this.trend : undefined;
|
|
164
|
+
}
|
|
165
|
+
warn(key, message) {
|
|
166
|
+
warnOncePerDocument(this.host.ownerDocument, `au-stat:${key}`, `[au-stat] ${message}`);
|
|
167
|
+
}
|
|
168
|
+
warnAboutProperties() {
|
|
169
|
+
if (text(this.label) === '') {
|
|
170
|
+
this.warn('missing-label', 'Missing label: the term of the description list is empty. Set the label attribute.');
|
|
171
|
+
}
|
|
172
|
+
if (!isStatSize(this.size)) {
|
|
173
|
+
this.warn('size', `Unsupported size ${JSON.stringify(this.size)}; it renders "medium". Use "small", "medium" or "large".`);
|
|
174
|
+
}
|
|
175
|
+
if (this.isSet(this.trend) && !isStatTrend(this.trend)) {
|
|
176
|
+
this.warn('trend', `Unsupported trend ${JSON.stringify(this.trend)}; no direction is rendered. Use "up", "down" or "flat".`);
|
|
177
|
+
}
|
|
178
|
+
if (!isStatIntent(this.intent)) {
|
|
179
|
+
this.warn('intent', `Unsupported intent ${JSON.stringify(this.intent)}; it renders "neutral". Use "neutral", "success" or "danger".`);
|
|
180
|
+
}
|
|
181
|
+
if (!isStatLive(this.live)) {
|
|
182
|
+
this.warn('live', `Unsupported live ${JSON.stringify(this.live)}; it renders "off", so nothing is announced. Use "off" or "polite".`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/** A trend of `undefined`, `null` or a blank string means "no direction", not a mistake. */
|
|
186
|
+
isSet(value) {
|
|
187
|
+
return value !== undefined && value !== null && text(value) !== '';
|
|
188
|
+
}
|
|
189
|
+
/** The visually hidden direction word, with the default when the label is blank. */
|
|
190
|
+
directionWord(trend) {
|
|
191
|
+
const labels = {
|
|
192
|
+
up: [this.upLabel, STAT_DEFAULT_LABELS.up],
|
|
193
|
+
down: [this.downLabel, STAT_DEFAULT_LABELS.down],
|
|
194
|
+
flat: [this.flatLabel, STAT_DEFAULT_LABELS.flat],
|
|
195
|
+
};
|
|
196
|
+
const [custom, fallback] = labels[trend];
|
|
197
|
+
return text(custom) || fallback;
|
|
198
|
+
}
|
|
199
|
+
get emptyText() {
|
|
200
|
+
return text(this.emptyLabel) || STAT_DEFAULT_LABELS.empty;
|
|
201
|
+
}
|
|
202
|
+
/** An element assigned to `description`. Text cannot be assigned to a named slot. */
|
|
203
|
+
measureDescription() {
|
|
204
|
+
this.described = Array.from(this.host.children).some((child) => child.getAttribute('slot') === 'description');
|
|
205
|
+
}
|
|
206
|
+
handleDescriptionChange = () => {
|
|
207
|
+
this.measureDescription();
|
|
208
|
+
};
|
|
209
|
+
renderValue(value, unit) {
|
|
210
|
+
if (value === '') {
|
|
211
|
+
return (h("dd", { part: "value", class: "stat__value" }, h("span", { part: "number", class: "stat__number", "aria-hidden": "true" }, EMPTY_DASH), h("span", { class: "stat__visually-hidden" }, this.emptyText)));
|
|
212
|
+
}
|
|
213
|
+
return (h("dd", { part: "value", class: "stat__value" }, h("span", { part: "number", class: "stat__number" }, value), unit !== '' && ' ', unit !== '' && (h("span", { part: "unit", class: "stat__unit" }, unit))));
|
|
214
|
+
}
|
|
215
|
+
renderDelta(trend, delta) {
|
|
216
|
+
if (delta === '' && trend === undefined)
|
|
217
|
+
return null;
|
|
218
|
+
return (h("dd", { part: "delta", class: "stat__delta" }, trend !== undefined && (h("au-icon", { part: "trend-icon", class: "stat__trend-icon", icon: STAT_TREND_ICON[trend], decorative: true })), trend !== undefined && (h("span", { part: "trend-label", class: "stat__visually-hidden" }, this.directionWord(trend))), trend !== undefined && delta !== '' && ' ', delta !== '' && (h("span", { part: "delta-text", class: "stat__delta-text" }, delta))));
|
|
219
|
+
}
|
|
220
|
+
render() {
|
|
221
|
+
const trend = this.safeTrend;
|
|
222
|
+
const description = h("slot", { key: '2cc75e8084e7202b222eb7bac38ccf63685a0942', name: "description", onSlotchange: this.handleDescriptionChange });
|
|
223
|
+
return (h(Host, { key: 'c50f47e2206a641fb6bb37a2535da931944dce75' }, h("dl", { key: '6531686606609edf978023d64128ce44acd3fc93', part: "base", class: `stat stat--${this.safeSize} stat--intent-${this.safeIntent}` }, h("div", { key: '64bfeb24696cdd0522558dced3befa459596c379', part: "group", class: "stat__group" }, h("dt", { key: '57f7b40f54d53b4b6da4749a37c6a5172be05034', part: "label", class: "stat__label" }, h("span", { key: 'e22d4b68635d8ccdb947cc10b7e109b72eb4f99c', part: "start", class: "stat__start" }, h("slot", { key: '2561e47fc3d00f6c1f1fbf4e5a860d7a61210404', name: "start" })), text(this.label)), this.renderValue(text(this.value), text(this.unit)), this.renderDelta(trend, text(this.delta)), this.described && (h("dd", { key: '0681accd58a6c224cd8a9d329850aacd6e74896f', part: "description", class: "stat__description" }, description)))), !this.described && h("span", { key: '53477e8a01c555fbad766284c3c57c2db10138e3', hidden: true }, description)));
|
|
224
|
+
}
|
|
225
|
+
static get watchers() { return {
|
|
226
|
+
"label": [{
|
|
227
|
+
"contentChanged": 0
|
|
228
|
+
}],
|
|
229
|
+
"value": [{
|
|
230
|
+
"contentChanged": 0
|
|
231
|
+
}],
|
|
232
|
+
"unit": [{
|
|
233
|
+
"contentChanged": 0
|
|
234
|
+
}],
|
|
235
|
+
"delta": [{
|
|
236
|
+
"contentChanged": 0
|
|
237
|
+
}],
|
|
238
|
+
"trend": [{
|
|
239
|
+
"contentChanged": 0
|
|
240
|
+
}],
|
|
241
|
+
"upLabel": [{
|
|
242
|
+
"contentChanged": 0
|
|
243
|
+
}],
|
|
244
|
+
"downLabel": [{
|
|
245
|
+
"contentChanged": 0
|
|
246
|
+
}],
|
|
247
|
+
"flatLabel": [{
|
|
248
|
+
"contentChanged": 0
|
|
249
|
+
}],
|
|
250
|
+
"emptyLabel": [{
|
|
251
|
+
"contentChanged": 0
|
|
252
|
+
}],
|
|
253
|
+
"live": [{
|
|
254
|
+
"liveChanged": 0
|
|
255
|
+
}]
|
|
256
|
+
}; }
|
|
257
|
+
};
|
|
258
|
+
AuStat.style = auStatCss();
|
|
259
|
+
|
|
260
|
+
export { AuStat as au_stat };
|
|
@@ -147,19 +147,19 @@ const AuSwitch = class {
|
|
|
147
147
|
'aria-invalid': this.isInvalid ? 'true' : undefined,
|
|
148
148
|
'aria-describedby': this.descriptionIds,
|
|
149
149
|
});
|
|
150
|
-
return (h(Host, { key: '
|
|
150
|
+
return (h(Host, { key: '4986a8a1ca543e107da7949efa307113cff87714', class: {
|
|
151
151
|
'switch-host--disabled': this.isDisabled,
|
|
152
152
|
'switch-host--invalid': this.isInvalid,
|
|
153
|
-
} }, h("div", { key: '
|
|
153
|
+
} }, h("div", { key: 'b4685afda1ab303b7e859b15eab4474ea3038b58', class: {
|
|
154
154
|
switch: true,
|
|
155
155
|
'switch--checked': this.checked,
|
|
156
156
|
'switch--disabled': this.isDisabled,
|
|
157
157
|
'switch--invalid': this.isInvalid,
|
|
158
|
-
} }, h("label", { key: '
|
|
158
|
+
} }, h("label", { key: '82d61c4d8050875627631463c74061e21b02129d', class: "switch__label", part: "label" }, h("input", { key: 'c78c494a5e3beae2e1dcc194779519e01247ba10', ref: (element) => {
|
|
159
159
|
this.inputElement = element;
|
|
160
160
|
if (element && element.checked !== this.checked)
|
|
161
161
|
element.checked = this.checked;
|
|
162
|
-
}, id: this.switchId, class: "switch__control", part: "control", type: "checkbox", role: "switch", checked: this.checked, required: this.required, disabled: this.isDisabled, ...nativeAttributes, onInput: this.handleInput, onChange: this.handleChange }), h("span", { key: '
|
|
162
|
+
}, id: this.switchId, class: "switch__control", part: "control", type: "checkbox", role: "switch", checked: this.checked, required: this.required, disabled: this.isDisabled, ...nativeAttributes, onInput: this.handleInput, onChange: this.handleChange }), h("span", { key: '5d03f1208c81f04e545ce652133a9b2ad228ed45', class: "switch__track", part: "track", "aria-hidden": "true" }, h("span", { key: '336873aa45d649424ccd7bbb7c6644dbe9213062', class: "switch__thumb", part: "thumb", "aria-hidden": "true" })), h("span", { key: '82d7210ec03b2e04ea9e1850f5cbca09b011a30a', class: "switch__text", part: "text" }, h("slot", { key: '9023a1158a19815b43a72e74162c9fb9e4194313' }, labelText)), this.required ? (h("span", { class: "switch__required", "aria-hidden": "true" }, "*")) : null), hintText ? (h("p", { class: "switch__hint", id: this.hintId, part: "hint" }, hintText)) : null, errorText ? (h("p", { class: "switch__error", id: this.errorId, part: "error", "aria-live": "polite" }, errorText)) : null)));
|
|
163
163
|
}
|
|
164
164
|
static get formAssociated() { return true; }
|
|
165
165
|
static get watchers() { return {
|
|
@@ -45,7 +45,7 @@ const AuTabPanel = class {
|
|
|
45
45
|
first.after(this.host.ownerDocument.importNode(content, true));
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '5bac0591714959242818a220b5b696e5fdf13ace', role: "tabpanel", hidden: !this.active }, this.activated ? h("slot", null) : null));
|
|
49
49
|
}
|
|
50
50
|
static get watchers() { return {
|
|
51
51
|
"value": [{
|
package/dist/esm/au-tab.entry.js
CHANGED
|
@@ -20,7 +20,7 @@ const AuTab = class {
|
|
|
20
20
|
dispatchItemUpdate(this.host);
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: '1f231220ec57ae50e0a1636e03b8cb357bc8f65c', role: "tab", "aria-selected": this.selected ? 'true' : 'false' }, h("span", { key: '0254822f3b0c330981a81743f126cab8e7508de2', part: "content" }, h("slot", { key: '3a4459efd4ade5d704f4df414ec14a8fec3959c2' }))));
|
|
24
24
|
}
|
|
25
25
|
static get watchers() { return {
|
|
26
26
|
"value": [{
|