@redvars/peacock 3.8.0 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseInput-14YmcfK7.js → BaseInput-CU1zZYKc.js} +3 -3
- package/dist/{BaseInput-14YmcfK7.js.map → BaseInput-CU1zZYKc.js.map} +1 -1
- package/dist/ButtonConstants-CahP2_NA.js +4 -0
- package/dist/ButtonConstants-CahP2_NA.js.map +1 -0
- package/dist/{IndividualComponent-DUINtMGK.js → IndividualComponent-Bdwyrvd6.js} +2 -2
- package/dist/{IndividualComponent-DUINtMGK.js.map → IndividualComponent-Bdwyrvd6.js.map} +1 -1
- package/dist/{NativeHyperlinkMixin-DrYXyfMQ.js → NativeHyperlinkMixin-D9J4aBTy.js} +4 -30
- package/dist/NativeHyperlinkMixin-D9J4aBTy.js.map +1 -0
- package/dist/accordion-item.js +338 -0
- package/dist/accordion-item.js.map +1 -0
- package/dist/accordion.js +159 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.js +190 -0
- package/dist/alert.js.map +1 -0
- package/dist/app-bar.js +324 -0
- package/dist/app-bar.js.map +1 -0
- package/dist/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/attachable-controller-CAKVrfcG.js +119 -0
- package/dist/attachable-controller-CAKVrfcG.js.map +1 -0
- package/dist/avatar.js +114 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.js +91 -0
- package/dist/badge.js.map +1 -0
- package/dist/base-Cl6v8-BZ.js +9 -0
- package/dist/base-Cl6v8-BZ.js.map +1 -0
- package/dist/bottom-sheet.js +14 -5
- package/dist/bottom-sheet.js.map +1 -1
- package/dist/breadcrumb-item.js +163 -0
- package/dist/breadcrumb-item.js.map +1 -0
- package/dist/breadcrumb.js +95 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button-group.js +87 -137
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +863 -133
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +8 -4
- package/dist/calendar-column-view.js.map +1 -1
- package/dist/calendar-month-view.js +8 -4
- package/dist/calendar-month-view.js.map +1 -1
- package/dist/calendar.js +8 -4
- package/dist/calendar.js.map +1 -1
- package/dist/canvas.js +8 -4
- package/dist/canvas.js.map +1 -1
- package/dist/card-content.js +1 -1
- package/dist/card.js +23 -45
- package/dist/card.js.map +1 -1
- package/dist/cb-compound-expression.js +6 -2
- package/dist/cb-compound-expression.js.map +1 -1
- package/dist/cb-divider.js +7 -3
- package/dist/cb-divider.js.map +1 -1
- package/dist/cb-expression.js +6 -2
- package/dist/cb-expression.js.map +1 -1
- package/dist/cb-predicate.js +7 -3
- package/dist/cb-predicate.js.map +1 -1
- package/dist/{chart-bar-cn6rrna-.js → chart-bar-CYoGNXnK.js} +6 -2
- package/dist/{chart-bar-cn6rrna-.js.map → chart-bar-CYoGNXnK.js.map} +1 -1
- package/dist/chart-bar.js +7 -6
- package/dist/chart-bar.js.map +1 -1
- package/dist/chart-doughnut.js +8 -3
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +8 -3
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js +7 -6
- package/dist/chart-stacked-bar.js.map +1 -1
- package/dist/checkbox.js +526 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chip.js +459 -0
- package/dist/chip.js.map +1 -0
- package/dist/{class-map-YU7g0o3B.js → class-map-DG7CA1et.js} +2 -2
- package/dist/{class-map-YU7g0o3B.js.map → class-map-DG7CA1et.js.map} +1 -1
- package/dist/clock.js +6 -2
- package/dist/clock.js.map +1 -1
- package/dist/code-editor.js +45 -30
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +9 -5
- package/dist/code-highlighter.js.map +1 -1
- package/dist/condition-builder.js +5 -1
- package/dist/condition-builder.js.map +1 -1
- package/dist/container.js +141 -0
- package/dist/container.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +721 -769
- package/dist/custom-elements.json +3213 -1979
- package/dist/datasource-B2eRh6Or.js +108 -0
- package/dist/datasource-B2eRh6Or.js.map +1 -0
- package/dist/dispatch-event-utils-CuEqjlPT.js.map +1 -1
- package/dist/divider.js +135 -0
- package/dist/divider.js.map +1 -0
- package/dist/dropdown-button.js +11 -6
- package/dist/dropdown-button.js.map +1 -1
- package/dist/element-internals-2CMts_0M.js +290 -0
- package/dist/element-internals-2CMts_0M.js.map +1 -0
- package/dist/elevation.js +94 -0
- package/dist/elevation.js.map +1 -0
- package/dist/empty-state.js +194 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/{event-manager-D-QCmUgR.js → event-manager-DTyX2uYD.js} +2 -2
- package/dist/{event-manager-D-QCmUgR.js.map → event-manager-DTyX2uYD.js.map} +1 -1
- package/dist/fab.js +138 -145
- package/dist/fab.js.map +1 -1
- package/dist/field.js +461 -0
- package/dist/field.js.map +1 -0
- package/dist/{popover-DUPmMVWS.js → floating-controller-CnUZnOhK.js} +2 -171
- package/dist/floating-controller-CnUZnOhK.js.map +1 -0
- package/dist/{flow-designer-node-BWrPuxAR.js → flow-designer-node-DsVwQTac.js} +7 -3
- package/dist/{flow-designer-node-BWrPuxAR.js.map → flow-designer-node-DsVwQTac.js.map} +1 -1
- package/dist/flow-designer-node.js +3 -3
- package/dist/flow-designer.js +19 -12
- package/dist/flow-designer.js.map +1 -1
- package/dist/focus-ring.js +126 -0
- package/dist/focus-ring.js.map +1 -0
- package/dist/form-associated-BXADnjOB.js +388 -0
- package/dist/form-associated-BXADnjOB.js.map +1 -0
- package/dist/html-editor.js +21 -9
- package/dist/html-editor.js.map +1 -1
- package/dist/hyperlink-DLvb6MXE.js +98 -0
- package/dist/hyperlink-DLvb6MXE.js.map +1 -0
- package/dist/icon-button.js +1064 -0
- package/dist/icon-button.js.map +1 -0
- package/dist/icon.js +170 -0
- package/dist/icon.js.map +1 -0
- package/dist/if-defined-BXZpRQ4P.js +10 -0
- package/dist/if-defined-BXZpRQ4P.js.map +1 -0
- package/dist/image.js +201 -0
- package/dist/image.js.map +1 -0
- package/dist/index.js +73 -20
- package/dist/index.js.map +1 -1
- package/dist/is-dark-mode-DOcaw4Yq.js.map +1 -1
- package/dist/is-link-Dk2OV3PM.js +6 -0
- package/dist/is-link-Dk2OV3PM.js.map +1 -0
- package/dist/item.js +212 -0
- package/dist/item.js.map +1 -0
- package/dist/link.js +75 -0
- package/dist/link.js.map +1 -0
- package/dist/list-D6JLh1uh.js +352 -0
- package/dist/list-D6JLh1uh.js.map +1 -0
- package/dist/list.js +14 -0
- package/dist/list.js.map +1 -0
- package/dist/{peacock-loader.js → loader.js} +83 -22
- package/dist/loader.js.map +1 -0
- package/dist/menu-item.js +318 -0
- package/dist/menu-item.js.map +1 -0
- package/dist/menu.js +534 -0
- package/dist/menu.js.map +1 -0
- package/dist/modal.js +9 -5
- package/dist/modal.js.map +1 -1
- package/dist/navigation-rail-item.js +385 -0
- package/dist/navigation-rail-item.js.map +1 -0
- package/dist/navigation-rail.js +217 -0
- package/dist/navigation-rail.js.map +1 -0
- package/dist/notification-manager.js +8 -4
- package/dist/notification-manager.js.map +1 -1
- package/dist/notification.js +8 -4
- package/dist/notification.js.map +1 -1
- package/dist/number-counter.js +7 -3
- package/dist/number-counter.js.map +1 -1
- package/dist/{observe-slot-change-D8Xg-kSS.js → observe-slot-change-DPxaZrZF.js} +3 -4
- package/dist/observe-slot-change-DPxaZrZF.js.map +1 -0
- package/dist/option.js +121 -0
- package/dist/option.js.map +1 -0
- package/dist/pagination.js +255 -0
- package/dist/pagination.js.map +1 -0
- package/dist/popover-content.js +7 -3
- package/dist/popover-content.js.map +1 -1
- package/dist/popover.js +175 -3
- package/dist/popover.js.map +1 -1
- package/dist/{property-1psGvXOq.js → property-B49QQ8pS.js} +2 -2
- package/dist/{property-1psGvXOq.js.map → property-B49QQ8pS.js.map} +1 -1
- package/dist/query-CHb9Ft_d.js +10 -0
- package/dist/query-CHb9Ft_d.js.map +1 -0
- package/dist/query-assigned-elements-BJaGSqM0.js +10 -0
- package/dist/query-assigned-elements-BJaGSqM0.js.map +1 -0
- package/dist/radio.js +476 -0
- package/dist/radio.js.map +1 -0
- package/dist/ripple.js +506 -0
- package/dist/ripple.js.map +1 -0
- package/dist/search.js +12 -7
- package/dist/search.js.map +1 -1
- package/dist/segmented-button-group.js +137 -0
- package/dist/segmented-button-group.js.map +1 -0
- package/dist/segmented-button.js +289 -0
- package/dist/segmented-button.js.map +1 -0
- package/dist/select-Dwtk0RIU.js +3937 -0
- package/dist/select-Dwtk0RIU.js.map +1 -0
- package/dist/side-sheet.js +8 -4
- package/dist/side-sheet.js.map +1 -1
- package/dist/skeleton.js +122 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/slider.js +346 -0
- package/dist/slider.js.map +1 -0
- package/dist/snackbar.js +335 -0
- package/dist/snackbar.js.map +1 -0
- package/dist/spinner.js +100 -0
- package/dist/spinner.js.map +1 -0
- package/dist/split-button.js +10 -5
- package/dist/split-button.js.map +1 -1
- package/dist/spread-B5cgadZl.js +32 -0
- package/dist/spread-B5cgadZl.js.map +1 -0
- package/dist/src/__internal/aria/aria.d.ts +98 -0
- package/dist/src/__internal/aria/delegate.d.ts +54 -0
- package/dist/src/__internal/events/dispatch-hooks.d.ts +80 -0
- package/dist/src/__internal/mixins/element-internals.d.ts +40 -0
- package/dist/src/__internal/mixins/form-associated.d.ts +174 -0
- package/dist/src/__internal/mixins/form-submitter.d.ts +59 -0
- package/dist/src/__internal/mixins/hyperlink.d.ts +42 -0
- package/dist/src/__internal/mixins/mixin.d.ts +49 -0
- package/dist/src/{__utils → __internal/utils}/observe-slot-change.d.ts +1 -0
- package/dist/src/accordion/accordion-item.d.ts +3 -1
- package/dist/src/accordion/accordion.d.ts +1 -1
- package/dist/src/alert/alert.d.ts +43 -0
- package/dist/src/alert/index.d.ts +1 -0
- package/dist/src/app-bar/app-bar.d.ts +92 -0
- package/dist/src/app-bar/index.d.ts +1 -0
- package/dist/src/avatar/avatar.d.ts +2 -0
- package/dist/src/bottom-sheet/bottom-sheet.d.ts +1 -1
- package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +1 -0
- package/dist/src/button/ButtonTypes.d.ts +5 -0
- package/dist/src/button/base-button/base-button.d.ts +18 -0
- package/dist/src/button/button/button.d.ts +29 -37
- package/dist/src/button/button-group/button-group.d.ts +17 -18
- package/dist/src/{fab → button/fab}/fab.d.ts +8 -26
- package/dist/src/button/icon-button/icon-button.d.ts +20 -27
- package/dist/src/button/index.d.ts +1 -0
- package/dist/src/calendar/calendar.d.ts +1 -1
- package/dist/src/canvas/canvas.d.ts +1 -1
- package/dist/src/card/card.d.ts +5 -6
- package/dist/src/chart-bar/chart-bar.d.ts +1 -1
- package/dist/src/chart-bar/chart-stacked-bar.d.ts +1 -1
- package/dist/src/checkbox/checkbox.d.ts +5 -1
- package/dist/src/chip/chip/chip.d.ts +9 -8
- package/dist/src/container/container.d.ts +5 -1
- package/dist/src/divider/divider.d.ts +2 -0
- package/dist/src/empty-state/empty-state.d.ts +1 -0
- package/dist/src/field/field.d.ts +19 -1
- package/dist/src/focus-ring/focus-ring.d.ts +3 -7
- package/dist/src/html-editor/html-editor.d.ts +1 -1
- package/dist/src/icon/icon.d.ts +9 -4
- package/dist/src/image/image.d.ts +4 -0
- package/dist/src/index.d.ts +7 -6
- package/dist/src/item/item.d.ts +20 -29
- package/dist/src/link/link.d.ts +1 -1
- package/dist/src/list/list-item.d.ts +7 -5
- package/dist/src/list/list.d.ts +3 -2
- package/dist/src/menu/menu/menu.d.ts +14 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +10 -2
- package/dist/src/modal/modal.d.ts +1 -1
- package/dist/src/navigation-rail/navigation-rail-item.d.ts +5 -4
- package/dist/src/navigation-rail/navigation-rail.d.ts +1 -1
- package/dist/src/radio/radio.d.ts +5 -0
- package/dist/src/ripple/ripple.d.ts +10 -1
- package/dist/src/search/search.d.ts +1 -1
- package/dist/src/segmented-button/segmented-button-group.d.ts +2 -2
- package/dist/src/segmented-button/segmented-button.d.ts +2 -0
- package/dist/src/side-sheet/side-sheet.d.ts +1 -1
- package/dist/src/skeleton/skeleton.d.ts +1 -0
- package/dist/src/slider/slider.d.ts +1 -0
- package/dist/src/snackbar/snackbar.d.ts +12 -2
- package/dist/src/svg/svg.d.ts +5 -0
- package/dist/src/table/table.d.ts +5 -0
- package/dist/src/tabs/tab.d.ts +2 -7
- package/dist/src/toolbar/toolbar.d.ts +2 -2
- package/dist/{state-DwbEjqVk.js → state-DkTK9EGF.js} +2 -2
- package/dist/{state-DwbEjqVk.js.map → state-DkTK9EGF.js.map} +1 -1
- package/dist/{style-map-DVmWOuYy.js → style-map-BQD5Et1D.js} +2 -2
- package/dist/{style-map-DVmWOuYy.js.map → style-map-BQD5Et1D.js.map} +1 -1
- package/dist/sub-menu.js +241 -0
- package/dist/sub-menu.js.map +1 -0
- package/dist/svg.js +273 -0
- package/dist/svg.js.map +1 -0
- package/dist/tab-group.js +188 -0
- package/dist/tab-group.js.map +1 -0
- package/dist/tab-panel.js +61 -0
- package/dist/tab-panel.js.map +1 -0
- package/dist/tab.js +658 -0
- package/dist/tab.js.map +1 -0
- package/dist/table.js +620 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.js +240 -0
- package/dist/tabs.js.map +1 -0
- package/dist/throttle-C7ZAPqtu.js +24 -0
- package/dist/throttle-C7ZAPqtu.js.map +1 -0
- package/dist/toolbar.js +9 -5
- package/dist/toolbar.js.map +1 -1
- package/dist/tooltip.js +270 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-BsGUjx94.js → unsafe-html-Ct0N2_UU.js} +2 -2
- package/dist/{unsafe-html-BsGUjx94.js.map → unsafe-html-Ct0N2_UU.js.map} +1 -1
- package/dist/when-DEJm_QN9.js +9 -0
- package/dist/when-DEJm_QN9.js.map +1 -0
- package/package.json +4 -2
- package/readme.md +3 -3
- package/scss/mixin.scss +8 -6
- package/src/__internal/aria/aria.ts +293 -0
- package/src/__internal/aria/delegate.ts +206 -0
- package/src/__internal/events/dispatch-hooks.ts +182 -0
- package/src/__internal/mixins/element-internals.ts +73 -0
- package/src/__internal/mixins/form-associated.ts +295 -0
- package/src/__internal/mixins/form-submitter.ts +133 -0
- package/src/__internal/mixins/hyperlink.ts +71 -0
- package/src/__internal/mixins/mixin.ts +58 -0
- package/src/{__utils → __internal/utils}/observe-slot-change.ts +2 -5
- package/src/accordion/accordion-item.ts +6 -2
- package/src/accordion/accordion.ts +4 -2
- package/src/accordion/demo/index.html +95 -90
- package/src/alert/alert.scss +82 -0
- package/src/{banner/banner.ts → alert/alert.ts} +22 -22
- package/src/alert/index.ts +1 -0
- package/src/app-bar/app-bar-colors.scss +17 -0
- package/src/app-bar/app-bar.scss +165 -0
- package/src/app-bar/app-bar.ts +155 -0
- package/src/app-bar/index.ts +1 -0
- package/src/avatar/avatar.ts +4 -0
- package/src/badge/badge.ts +2 -0
- package/src/bottom-sheet/bottom-sheet.ts +8 -2
- package/src/breadcrumb/breadcrumb/breadcrumb.ts +2 -0
- package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +3 -0
- package/src/button/ButtonTypes.ts +17 -0
- package/src/button/base-button/base-button.ts +85 -0
- package/src/button/button/button-base.scss +306 -0
- package/src/button/button/button-colors.scss +27 -32
- package/src/button/button/button-layers.scss +126 -39
- package/src/button/button/button-shapes.scss +73 -0
- package/src/button/button/button.scss +12 -284
- package/src/button/button/button.ts +174 -194
- package/src/button/button-group/button-group.scss +43 -36
- package/src/button/button-group/button-group.ts +26 -137
- package/src/{fab → button/fab}/fab-colors.scss +0 -10
- package/src/button/fab/fab-sizes.scss +37 -0
- package/src/button/fab/fab.scss +172 -0
- package/src/{fab → button/fab}/fab.ts +69 -105
- package/src/button/icon-button/icon-button-sizes.scss +18 -3
- package/src/button/icon-button/icon-button.scss +5 -0
- package/src/button/icon-button/icon-button.ts +111 -141
- package/src/button/index.ts +7 -0
- package/src/calendar/calendar.ts +2 -2
- package/src/canvas/canvas.ts +2 -2
- package/src/card/card.scss +3 -3
- package/src/card/card.ts +20 -40
- package/src/chart-bar/chart-bar.ts +2 -2
- package/src/chart-bar/chart-stacked-bar.ts +2 -2
- package/src/checkbox/checkbox.ts +12 -4
- package/src/chip/chip/chip.scss +1 -1
- package/src/chip/chip/chip.ts +35 -55
- package/src/chip/demo/index.html +30 -26
- package/src/code-editor/code-editor.ts +68 -58
- package/src/code-editor/demo/index.html +32 -27
- package/src/code-highlighter/code-highlighter.ts +1 -1
- package/src/code-highlighter/demo/index.html +24 -21
- package/src/container/container.ts +8 -2
- package/src/date-picker/date-picker.ts +2 -3
- package/src/divider/divider.ts +5 -1
- package/src/dropdown-button/demo/index.html +106 -101
- package/src/dropdown-button/dropdown-button.ts +1 -1
- package/src/elevation/elevation.ts +2 -0
- package/src/empty-state/empty-state.ts +3 -0
- package/src/field/field.ts +52 -33
- package/src/focus-ring/demo/index.html +29 -36
- package/src/focus-ring/focus-ring.ts +5 -7
- package/src/html-editor/html-editor.ts +28 -16
- package/src/icon/datasource.ts +1 -1
- package/src/icon/icon.ts +27 -15
- package/src/image/image.ts +18 -6
- package/src/index.ts +24 -6
- package/src/input/input.ts +2 -2
- package/src/item/item.scss +126 -162
- package/src/item/item.ts +70 -323
- package/src/link/link.ts +3 -1
- package/src/list/list-item.scss +43 -31
- package/src/list/list-item.ts +79 -75
- package/src/list/list.scss +1 -13
- package/src/list/list.ts +6 -3
- package/src/{peacock-loader.ts → loader.ts} +91 -79
- package/src/menu/menu/menu.scss +14 -11
- package/src/menu/menu/menu.ts +20 -8
- package/src/menu/menu-item/menu-item.scss +35 -3
- package/src/menu/menu-item/menu-item.ts +40 -34
- package/src/menu/sub-menu/sub-menu.ts +3 -0
- package/src/modal/modal.ts +2 -2
- package/src/navigation-rail/navigation-rail-item.ts +21 -36
- package/src/navigation-rail/navigation-rail.scss +1 -0
- package/src/navigation-rail/navigation-rail.ts +4 -2
- package/src/number-field/number-field.ts +2 -2
- package/src/pagination/pagination.ts +2 -0
- package/src/popover/popover.ts +3 -3
- package/src/radio/radio.ts +13 -5
- package/src/ripple/ripple.ts +14 -1
- package/src/search/search.ts +3 -3
- package/src/segmented-button/segmented-button-group.ts +8 -4
- package/src/segmented-button/segmented-button.ts +4 -0
- package/src/select/option.ts +2 -0
- package/src/side-sheet/side-sheet.ts +2 -2
- package/src/sidebar-menu/sidebar-menu-item.ts +3 -2
- package/src/skeleton/skeleton.ts +3 -0
- package/src/slider/slider.ts +4 -1
- package/src/snackbar/snackbar.ts +40 -25
- package/src/spinner/spinner.ts +2 -0
- package/src/svg/svg.ts +27 -9
- package/src/switch/switch.ts +1 -1
- package/src/table/table.ts +16 -3
- package/src/tabs/demo/index.html +79 -79
- package/src/tabs/tab-group.ts +2 -0
- package/src/tabs/tab-panel.ts +2 -0
- package/src/tabs/tab.scss +4 -4
- package/src/tabs/tab.ts +16 -39
- package/src/tabs/tabs.ts +2 -0
- package/src/textarea/textarea.ts +2 -2
- package/src/time-picker/time-picker.ts +2 -2
- package/src/toolbar/toolbar.ts +3 -3
- package/src/tooltip/tooltip.ts +14 -8
- package/src/url-field/url-field.ts +2 -3
- package/dist/ButtonConstants-D06bY4uy.js +0 -114
- package/dist/ButtonConstants-D06bY4uy.js.map +0 -1
- package/dist/NativeHyperlinkMixin-DrYXyfMQ.js.map +0 -1
- package/dist/banner.js +0 -186
- package/dist/banner.js.map +0 -1
- package/dist/button-colors-DSuBHd-i.js +0 -585
- package/dist/button-colors-DSuBHd-i.js.map +0 -1
- package/dist/icon-CueRR7wx.js +0 -260
- package/dist/icon-CueRR7wx.js.map +0 -1
- package/dist/icon-button-CYqrnMnF.js +0 -318
- package/dist/icon-button-CYqrnMnF.js.map +0 -1
- package/dist/navigation-rail-CM_svs5_.js +0 -14184
- package/dist/navigation-rail-CM_svs5_.js.map +0 -1
- package/dist/observe-slot-change-D8Xg-kSS.js.map +0 -1
- package/dist/peacock-loader.js.map +0 -1
- package/dist/popover-DUPmMVWS.js.map +0 -1
- package/dist/query-QBcUV-L_.js +0 -15
- package/dist/query-QBcUV-L_.js.map +0 -1
- package/dist/src/banner/banner.d.ts +0 -43
- package/dist/src/banner/index.d.ts +0 -1
- package/dist/src/button/GroupButtonInterface.d.ts +0 -4
- package/src/banner/banner.scss +0 -82
- package/src/banner/index.ts +0 -1
- package/src/button/GroupButtonInterface.ts +0 -4
- package/src/button/button/only-button.scss +0 -13
- package/src/fab/fab-sizes.scss +0 -37
- package/src/fab/fab.scss +0 -143
- /package/dist/src/{__controllers → __internal/controllers}/attachable-controller.d.ts +0 -0
- /package/dist/src/{__controllers → __internal/controllers}/floating-controller.d.ts +0 -0
- /package/dist/src/{__directive → __internal/directive}/spread.d.ts +0 -0
- /package/dist/src/{__mixins → __internal/mixins}/MixinConstructor.d.ts +0 -0
- /package/dist/src/{__mixins → __internal/mixins}/NativeButtonMixin.d.ts +0 -0
- /package/dist/src/{__mixins → __internal/mixins}/NativeHyperlinkMixin.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/cache-fetch.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/copy-to-clipboard.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/dispatch-event-utils.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/is-dark-mode.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/is-in-viewport.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/is-link.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/observe-theme-change.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/sanitize-svg.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/throttle.d.ts +0 -0
- /package/dist/src/{fab → button/fab}/index.d.ts +0 -0
- /package/dist/src/{peacock-loader.d.ts → loader.d.ts} +0 -0
- /package/dist/test/{banner.test.d.ts → alert.test.d.ts} +0 -0
- /package/src/{__controllers → __internal/controllers}/attachable-controller.ts +0 -0
- /package/src/{__controllers → __internal/controllers}/floating-controller.ts +0 -0
- /package/src/{__directive → __internal/directive}/spread.ts +0 -0
- /package/src/{__mixins → __internal/mixins}/MixinConstructor.ts +0 -0
- /package/src/{__mixins → __internal/mixins}/NativeButtonMixin.ts +0 -0
- /package/src/{__mixins → __internal/mixins}/NativeHyperlinkMixin.ts +0 -0
- /package/src/{__mixins → __internal/mixins}/README.md +0 -0
- /package/src/{__utils → __internal/utils}/cache-fetch.ts +0 -0
- /package/src/{__utils → __internal/utils}/copy-to-clipboard.ts +0 -0
- /package/src/{__utils → __internal/utils}/dispatch-event-utils.ts +0 -0
- /package/src/{__utils → __internal/utils}/is-dark-mode.ts +0 -0
- /package/src/{__utils → __internal/utils}/is-in-viewport.ts +0 -0
- /package/src/{__utils → __internal/utils}/is-link.ts +0 -0
- /package/src/{__utils → __internal/utils}/observe-theme-change.ts +0 -0
- /package/src/{__utils → __internal/utils}/sanitize-svg.ts +0 -0
- /package/src/{__utils → __internal/utils}/throttle.ts +0 -0
- /package/src/{fab → button/fab}/index.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, E } from './IndividualComponent-
|
|
1
|
+
import { A, E } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
2
|
import { e as e$1, i, t } from './directive-ZPhl09Yt.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -8,4 +8,4 @@ import { e as e$1, i, t } from './directive-ZPhl09Yt.js';
|
|
|
8
8
|
*/class e extends i{constructor(i){if(super(i),this.it=A,i.type!==t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A||null==r)return this._t=void 0,this.it=r;if(r===E)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName="unsafeHTML",e.resultType=1;const o=e$1(e);
|
|
9
9
|
|
|
10
10
|
export { e, o };
|
|
11
|
-
//# sourceMappingURL=unsafe-html-
|
|
11
|
+
//# sourceMappingURL=unsafe-html-Ct0N2_UU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unsafe-html-
|
|
1
|
+
{"version":3,"file":"unsafe-html-Ct0N2_UU.js","sources":["../node_modules/lit-html/directives/unsafe-html.js"],"sourcesContent":["import{nothing as t,noChange as i}from\"../lit-html.js\";import{directive as r,Directive as s,PartType as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends s{constructor(i){if(super(i),this.it=t,i.type!==n.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this._t=void 0,this.it=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=r(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n"],"names":["s","t","n","i","r"],"mappings":";;;AACA;AACA;AACA;AACA;AACA,GAAG,MAAM,CAAC,SAASA,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAACC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAGC,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,uCAAuC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAGD,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAGE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAM,MAAC,CAAC,CAACC,GAAC,CAAC,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when-DEJm_QN9.js","sources":["../node_modules/lit-html/directives/when.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n,r,t){return n?r(n):t?.(n)}export{n as when};\n//# sourceMappingURL=when.js.map\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;;;;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@redvars/peacock",
|
|
3
3
|
"description": "The foundation for beautiful user interfaces",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "3.8.
|
|
5
|
+
"version": "3.8.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"analyze": "cem analyze --config \"./custom-elements-manifest.config.mjs\" && node bin/typedoc-gen.mjs",
|
|
33
33
|
"start": "rollup -c && concurrently -k -r \"rollup -c -w\" \"web-dev-server\"",
|
|
34
|
+
"start:for-docs": "rollup -c -w",
|
|
34
35
|
"build": "npm run build:lit && npm run analyze -- --exclude dist && npm run build:scss",
|
|
35
36
|
"build:lit": "rollup -c",
|
|
36
37
|
"build:scss": "node ./bin/scss-build.mjs",
|
|
@@ -126,7 +127,8 @@
|
|
|
126
127
|
{
|
|
127
128
|
"ignorePackages": true
|
|
128
129
|
}
|
|
129
|
-
]
|
|
130
|
+
],
|
|
131
|
+
"class-methods-use-this": "off"
|
|
130
132
|
}
|
|
131
133
|
},
|
|
132
134
|
"prettier": {
|
package/readme.md
CHANGED
|
@@ -44,9 +44,9 @@ Visit [https://peacock.redvars.com](https://peacock.redvars.com) to view the doc
|
|
|
44
44
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
45
45
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
|
|
46
46
|
|
|
47
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.
|
|
47
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.2/dist/assets/styles.css"></link>
|
|
48
48
|
<script type='module'
|
|
49
|
-
src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.
|
|
49
|
+
src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.2/dist/loader.js'></script>
|
|
50
50
|
</head>
|
|
51
51
|
|
|
52
52
|
<wc-button>Button</wc-button>
|
|
@@ -109,7 +109,7 @@ include notifications, tooltips, and progress bars.
|
|
|
109
109
|
| Name | Component | State |
|
|
110
110
|
|-------------------------------------------------------------------------------|----------------------|-------|
|
|
111
111
|
| [Badge](https://peacock.redvars.com/components/badge) | wc-badge | 🟢 |
|
|
112
|
-
| [
|
|
112
|
+
| [Alert](https://peacock.redvars.com/components/alert) | wc-alert | 🟡 |
|
|
113
113
|
| [Circular Progress](https://peacock.redvars.com/components/circular-progress) | wc-circular-progress | 🟢 |
|
|
114
114
|
| [Linear Progress](https://peacock.redvars.com/components/linear-progress) | wc-linear-progress | 🟢 |
|
|
115
115
|
| [Notification](https://peacock.redvars.com/components/notification) | wc-notification | 🟢 |
|
package/scss/mixin.scss
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
.screen-reader-only {
|
|
7
7
|
display: none !important;
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
[hidden] {
|
|
11
|
+
display: none !important;
|
|
12
|
+
}
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
@mixin reset-button-styles {
|
|
@@ -33,7 +37,7 @@
|
|
|
33
37
|
|
|
34
38
|
@mixin get-typography($name) {
|
|
35
39
|
font-family: var(--typography-#{$name}-font-family) !important;
|
|
36
|
-
font-size:
|
|
40
|
+
font-size: var(--typography-#{$name}-font-size) !important;
|
|
37
41
|
font-weight: var(--typography-#{$name}-font-weight) !important;
|
|
38
42
|
line-height: var(--typography-#{$name}-line-height) !important;
|
|
39
43
|
letter-spacing: var(--typography-#{$name}-letter-spacing) !important;
|
|
@@ -41,13 +45,13 @@
|
|
|
41
45
|
|
|
42
46
|
@mixin get-typography-not-important($name) {
|
|
43
47
|
font-family: var(--typography-#{$name}-font-family);
|
|
44
|
-
font-size:
|
|
48
|
+
font-size: var(--typography-#{$name}-font-size);
|
|
45
49
|
font-weight: var(--typography-#{$name}-font-weight);
|
|
46
50
|
line-height: var(--typography-#{$name}-line-height);
|
|
47
51
|
letter-spacing: var(--typography-#{$name}-letter-spacing);
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
@mixin focus-ring($color:var(--color-black)) {
|
|
54
|
+
@mixin focus-ring($color: var(--color-black)) {
|
|
51
55
|
outline: 2px solid $color;
|
|
52
56
|
}
|
|
53
57
|
|
|
@@ -81,13 +85,11 @@
|
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
|
|
84
|
-
|
|
85
88
|
// Layers
|
|
86
89
|
@mixin layer-background {
|
|
87
|
-
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
// NOTE: `apply-container-shape` and `copy-container-shape` were removed.
|
|
91
93
|
// These helpers previously copied container-shape custom properties and
|
|
92
94
|
// applied them as physical border radii. They are intentionally deleted
|
|
93
95
|
// because the loader now manages container shape via CSS custom properties
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accessibility Object Model reflective aria property name types.
|
|
3
|
+
*/
|
|
4
|
+
// eslint-disable-next-line no-undef
|
|
5
|
+
export type ARIAProperty = keyof ARIAMixin;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Accessibility Object Model reflective aria properties.
|
|
9
|
+
*/
|
|
10
|
+
export const ARIA_PROPERTIES: ARIAProperty[] = [
|
|
11
|
+
'role',
|
|
12
|
+
'ariaAtomic',
|
|
13
|
+
'ariaAutoComplete',
|
|
14
|
+
'ariaBusy',
|
|
15
|
+
'ariaChecked',
|
|
16
|
+
'ariaColCount',
|
|
17
|
+
'ariaColIndex',
|
|
18
|
+
'ariaColSpan',
|
|
19
|
+
'ariaCurrent',
|
|
20
|
+
'ariaDisabled',
|
|
21
|
+
'ariaExpanded',
|
|
22
|
+
'ariaHasPopup',
|
|
23
|
+
'ariaHidden',
|
|
24
|
+
'ariaInvalid',
|
|
25
|
+
'ariaKeyShortcuts',
|
|
26
|
+
'ariaLabel',
|
|
27
|
+
'ariaLevel',
|
|
28
|
+
'ariaLive',
|
|
29
|
+
'ariaModal',
|
|
30
|
+
'ariaMultiLine',
|
|
31
|
+
'ariaMultiSelectable',
|
|
32
|
+
'ariaOrientation',
|
|
33
|
+
'ariaPlaceholder',
|
|
34
|
+
'ariaPosInSet',
|
|
35
|
+
'ariaPressed',
|
|
36
|
+
'ariaReadOnly',
|
|
37
|
+
'ariaRequired',
|
|
38
|
+
'ariaRoleDescription',
|
|
39
|
+
'ariaRowCount',
|
|
40
|
+
'ariaRowIndex',
|
|
41
|
+
'ariaRowSpan',
|
|
42
|
+
'ariaSelected',
|
|
43
|
+
'ariaSetSize',
|
|
44
|
+
'ariaSort',
|
|
45
|
+
'ariaValueMax',
|
|
46
|
+
'ariaValueMin',
|
|
47
|
+
'ariaValueNow',
|
|
48
|
+
'ariaValueText',
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Accessibility Object Model aria attribute name types.
|
|
53
|
+
*/
|
|
54
|
+
// eslint-disable-next-line no-use-before-define
|
|
55
|
+
export type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Accessibility Object Model aria attributes.
|
|
59
|
+
*/
|
|
60
|
+
// eslint-disable-next-line no-use-before-define
|
|
61
|
+
export const ARIA_ATTRIBUTES = ARIA_PROPERTIES.map(ariaPropertyToAttribute);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Checks if an attribute is one of the AOM aria attributes.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* isAriaAttribute('aria-label'); // true
|
|
68
|
+
*
|
|
69
|
+
* @param attribute The attribute to check.
|
|
70
|
+
* @return True if the attribute is an aria attribute, or false if not.
|
|
71
|
+
*/
|
|
72
|
+
export function isAriaAttribute(attribute: string): attribute is ARIAAttribute {
|
|
73
|
+
return ARIA_ATTRIBUTES.includes(attribute as ARIAAttribute);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Converts an AOM aria property into its corresponding attribute.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ariaPropertyToAttribute('ariaLabel'); // 'aria-label'
|
|
81
|
+
*
|
|
82
|
+
* @param property The aria property.
|
|
83
|
+
* @return The aria attribute.
|
|
84
|
+
*/
|
|
85
|
+
export function ariaPropertyToAttribute<K extends ARIAProperty>(property: K) {
|
|
86
|
+
return (
|
|
87
|
+
property
|
|
88
|
+
.replace('aria', 'aria-')
|
|
89
|
+
// IDREF attributes also include an "Element" or "Elements" suffix
|
|
90
|
+
.replace(/Elements?/g, '')
|
|
91
|
+
// eslint-disable-next-line no-use-before-define
|
|
92
|
+
.toLowerCase() as ARIAPropertyToAttribute<K>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Converts an `ariaFoo` string type to an `aria-foo` string type.
|
|
97
|
+
// eslint-disable-next-line no-unused-vars
|
|
98
|
+
type ARIAPropertyToAttribute<K extends string> =
|
|
99
|
+
K extends `aria${infer Suffix}Element${infer OptS}` // eslint-disable-line
|
|
100
|
+
? `aria-${Lowercase<Suffix>}`
|
|
101
|
+
: K extends `aria${infer Suffix}`
|
|
102
|
+
? `aria-${Lowercase<Suffix>}`
|
|
103
|
+
: K;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* An extension of `ARIAMixin` that enforces strict value types for aria
|
|
107
|
+
* properties.
|
|
108
|
+
*
|
|
109
|
+
* This is needed for correct typing in render functions with lit analyzer.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* render() {
|
|
113
|
+
* const {ariaLabel} = this as ARIAMixinStrict;
|
|
114
|
+
* return html`
|
|
115
|
+
* <button aria-label=${ariaLabel || nothing}>
|
|
116
|
+
* <slot></slot>
|
|
117
|
+
* </button>
|
|
118
|
+
* `;
|
|
119
|
+
* }
|
|
120
|
+
*/
|
|
121
|
+
// eslint-disable-next-line no-undef
|
|
122
|
+
export interface ARIAMixinStrict extends ARIAMixin {
|
|
123
|
+
ariaAtomic: 'true' | 'false' | null;
|
|
124
|
+
ariaAutoComplete: 'none' | 'inline' | 'list' | 'both' | null;
|
|
125
|
+
ariaBusy: 'true' | 'false' | null;
|
|
126
|
+
ariaChecked: 'true' | 'false' | null;
|
|
127
|
+
ariaColCount: `${number}` | null;
|
|
128
|
+
ariaColIndex: `${number}` | null;
|
|
129
|
+
ariaColSpan: `${number}` | null;
|
|
130
|
+
ariaCurrent:
|
|
131
|
+
| 'page'
|
|
132
|
+
| 'step'
|
|
133
|
+
| 'location'
|
|
134
|
+
| 'date'
|
|
135
|
+
| 'time'
|
|
136
|
+
| 'true'
|
|
137
|
+
| 'false'
|
|
138
|
+
| null;
|
|
139
|
+
ariaDisabled: 'true' | 'false' | null;
|
|
140
|
+
ariaExpanded: 'true' | 'false' | null;
|
|
141
|
+
ariaHasPopup:
|
|
142
|
+
| 'false'
|
|
143
|
+
| 'true'
|
|
144
|
+
| 'menu'
|
|
145
|
+
| 'listbox'
|
|
146
|
+
| 'tree'
|
|
147
|
+
| 'grid'
|
|
148
|
+
| 'dialog'
|
|
149
|
+
| null;
|
|
150
|
+
ariaHidden: 'true' | 'false' | null;
|
|
151
|
+
ariaInvalid: 'true' | 'false' | null;
|
|
152
|
+
ariaKeyShortcuts: string | null;
|
|
153
|
+
ariaLabel: string | null;
|
|
154
|
+
ariaLevel: `${number}` | null;
|
|
155
|
+
ariaLive: 'assertive' | 'off' | 'polite' | null;
|
|
156
|
+
ariaModal: 'true' | 'false' | null;
|
|
157
|
+
ariaMultiLine: 'true' | 'false' | null;
|
|
158
|
+
ariaMultiSelectable: 'true' | 'false' | null;
|
|
159
|
+
ariaOrientation: 'horizontal' | 'vertical' | 'undefined' | null;
|
|
160
|
+
ariaPlaceholder: string | null;
|
|
161
|
+
ariaPosInSet: `${number}` | null;
|
|
162
|
+
ariaPressed: 'true' | 'false' | null;
|
|
163
|
+
ariaReadOnly: 'true' | 'false' | null;
|
|
164
|
+
ariaRequired: 'true' | 'false' | null;
|
|
165
|
+
ariaRoleDescription: string | null;
|
|
166
|
+
ariaRowCount: `${number}` | null;
|
|
167
|
+
ariaRowIndex: `${number}` | null;
|
|
168
|
+
ariaRowSpan: `${number}` | null;
|
|
169
|
+
ariaSelected: 'true' | 'false' | null;
|
|
170
|
+
ariaSetSize: `${number}` | null;
|
|
171
|
+
ariaSort: 'ascending' | 'descending' | 'none' | 'other' | null;
|
|
172
|
+
ariaValueMax: `${number}` | null;
|
|
173
|
+
ariaValueMin: `${number}` | null;
|
|
174
|
+
ariaValueNow: `${number}` | null;
|
|
175
|
+
ariaValueText: string | null;
|
|
176
|
+
// eslint-disable-next-line no-use-before-define
|
|
177
|
+
role: ARIARole | null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Valid values for `role`.
|
|
182
|
+
*/
|
|
183
|
+
export type ARIARole =
|
|
184
|
+
| 'alert'
|
|
185
|
+
| 'alertdialog'
|
|
186
|
+
| 'button'
|
|
187
|
+
| 'checkbox'
|
|
188
|
+
| 'dialog'
|
|
189
|
+
| 'gridcell'
|
|
190
|
+
| 'link'
|
|
191
|
+
| 'log'
|
|
192
|
+
| 'marquee'
|
|
193
|
+
| 'menuitem'
|
|
194
|
+
| 'menuitemcheckbox'
|
|
195
|
+
| 'menuitemradio'
|
|
196
|
+
| 'option'
|
|
197
|
+
| 'progressbar'
|
|
198
|
+
| 'radio'
|
|
199
|
+
| 'scrollbar'
|
|
200
|
+
| 'searchbox'
|
|
201
|
+
| 'slider'
|
|
202
|
+
| 'spinbutton'
|
|
203
|
+
| 'status'
|
|
204
|
+
| 'switch'
|
|
205
|
+
| 'tab'
|
|
206
|
+
| 'tabpanel'
|
|
207
|
+
| 'textbox'
|
|
208
|
+
| 'timer'
|
|
209
|
+
| 'tooltip'
|
|
210
|
+
| 'treeitem'
|
|
211
|
+
| 'combobox'
|
|
212
|
+
| 'grid'
|
|
213
|
+
| 'listbox'
|
|
214
|
+
| 'menu'
|
|
215
|
+
| 'menubar'
|
|
216
|
+
| 'radiogroup'
|
|
217
|
+
| 'tablist'
|
|
218
|
+
| 'tree'
|
|
219
|
+
| 'treegrid'
|
|
220
|
+
| 'application'
|
|
221
|
+
| 'article'
|
|
222
|
+
| 'cell'
|
|
223
|
+
| 'columnheader'
|
|
224
|
+
| 'definition'
|
|
225
|
+
| 'directory'
|
|
226
|
+
| 'document'
|
|
227
|
+
| 'feed'
|
|
228
|
+
| 'figure'
|
|
229
|
+
| 'group'
|
|
230
|
+
| 'heading'
|
|
231
|
+
| 'img'
|
|
232
|
+
| 'list'
|
|
233
|
+
| 'listitem'
|
|
234
|
+
| 'math'
|
|
235
|
+
| 'none'
|
|
236
|
+
| 'note'
|
|
237
|
+
| 'presentation'
|
|
238
|
+
| 'region'
|
|
239
|
+
| 'row'
|
|
240
|
+
| 'rowgroup'
|
|
241
|
+
| 'rowheader'
|
|
242
|
+
| 'separator'
|
|
243
|
+
| 'table'
|
|
244
|
+
| 'term'
|
|
245
|
+
| 'text'
|
|
246
|
+
| 'toolbar'
|
|
247
|
+
| 'banner'
|
|
248
|
+
| 'complementary'
|
|
249
|
+
| 'contentinfo'
|
|
250
|
+
| 'form'
|
|
251
|
+
| 'main'
|
|
252
|
+
| 'navigation'
|
|
253
|
+
| 'region'
|
|
254
|
+
| 'search'
|
|
255
|
+
| 'doc-abstract'
|
|
256
|
+
| 'doc-acknowledgments'
|
|
257
|
+
| 'doc-afterword'
|
|
258
|
+
| 'doc-appendix'
|
|
259
|
+
| 'doc-backlink'
|
|
260
|
+
| 'doc-biblioentry'
|
|
261
|
+
| 'doc-bibliography'
|
|
262
|
+
| 'doc-biblioref'
|
|
263
|
+
| 'doc-chapter'
|
|
264
|
+
| 'doc-colophon'
|
|
265
|
+
| 'doc-conclusion'
|
|
266
|
+
| 'doc-cover'
|
|
267
|
+
| 'doc-credit'
|
|
268
|
+
| 'doc-credits'
|
|
269
|
+
| 'doc-dedication'
|
|
270
|
+
| 'doc-endnote'
|
|
271
|
+
| 'doc-endnotes'
|
|
272
|
+
| 'doc-epigraph'
|
|
273
|
+
| 'doc-epilogue'
|
|
274
|
+
| 'doc-errata'
|
|
275
|
+
| 'doc-example'
|
|
276
|
+
| 'doc-footnote'
|
|
277
|
+
| 'doc-foreword'
|
|
278
|
+
| 'doc-glossary'
|
|
279
|
+
| 'doc-glossref'
|
|
280
|
+
| 'doc-index'
|
|
281
|
+
| 'doc-introduction'
|
|
282
|
+
| 'doc-noteref'
|
|
283
|
+
| 'doc-notice'
|
|
284
|
+
| 'doc-pagebreak'
|
|
285
|
+
| 'doc-pagelist'
|
|
286
|
+
| 'doc-part'
|
|
287
|
+
| 'doc-preface'
|
|
288
|
+
| 'doc-prologue'
|
|
289
|
+
| 'doc-pullquote'
|
|
290
|
+
| 'doc-qna'
|
|
291
|
+
| 'doc-subtitle'
|
|
292
|
+
| 'doc-tip'
|
|
293
|
+
| 'doc-toc';
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { LitElement, ReactiveElement, isServer } from 'lit';
|
|
8
|
+
|
|
9
|
+
import { MixinBase, MixinReturn } from '../mixins/mixin.js';
|
|
10
|
+
import {
|
|
11
|
+
ARIA_PROPERTIES,
|
|
12
|
+
ariaPropertyToAttribute,
|
|
13
|
+
isAriaAttribute,
|
|
14
|
+
} from './aria.js';
|
|
15
|
+
|
|
16
|
+
// Private symbols
|
|
17
|
+
const privateIgnoreAttributeChangesFor = Symbol(
|
|
18
|
+
'privateIgnoreAttributeChangesFor',
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
function ariaAttributeToDataAttribute(ariaAttribute: string) {
|
|
22
|
+
// aria-haspopup -> data-aria-haspopup
|
|
23
|
+
return `data-${ariaAttribute}`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function ariaAttributeToDataProperty(ariaAttribute: string) {
|
|
27
|
+
// aria-haspopup -> dataset.ariaHaspopup
|
|
28
|
+
return ariaAttribute.replace(/-\w/, dashLetter =>
|
|
29
|
+
dashLetter[1].toUpperCase(),
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Overrides the constructor's native `ARIAMixin` properties to ensure that
|
|
35
|
+
* aria properties reflect the values that were shifted to a data attribute.
|
|
36
|
+
*
|
|
37
|
+
* @param ctor The `ReactiveElement` constructor to patch.
|
|
38
|
+
*/
|
|
39
|
+
function setupDelegatesAriaProperties(ctor: typeof ReactiveElement) {
|
|
40
|
+
for (const ariaProperty of ARIA_PROPERTIES) {
|
|
41
|
+
// The casing between ariaProperty and the dataProperty may be different.
|
|
42
|
+
// ex: aria-haspopup -> ariaHasPopup
|
|
43
|
+
const ariaAttribute = ariaPropertyToAttribute(ariaProperty);
|
|
44
|
+
// ex: aria-haspopup -> data-aria-haspopup
|
|
45
|
+
const dataAttribute = ariaAttributeToDataAttribute(ariaAttribute);
|
|
46
|
+
// ex: aria-haspopup -> dataset.ariaHaspopup
|
|
47
|
+
const dataProperty = ariaAttributeToDataProperty(ariaAttribute);
|
|
48
|
+
|
|
49
|
+
// Call `ReactiveElement.createProperty()` so that the `aria-*` and `data-*`
|
|
50
|
+
// attributes are added to the `static observedAttributes` array. This
|
|
51
|
+
// triggers `attributeChangedCallback` for the delegates aria mixin to
|
|
52
|
+
// handle.
|
|
53
|
+
ctor.createProperty(ariaProperty, {
|
|
54
|
+
attribute: ariaAttribute,
|
|
55
|
+
noAccessor: true,
|
|
56
|
+
});
|
|
57
|
+
ctor.createProperty(Symbol(dataAttribute), {
|
|
58
|
+
attribute: dataAttribute,
|
|
59
|
+
noAccessor: true,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Re-define the `ARIAMixin` properties to handle data attribute shifting.
|
|
63
|
+
// It is safe to use `Object.defineProperty` here because the properties
|
|
64
|
+
// are native and not renamed.
|
|
65
|
+
// tslint:disable-next-line:ban-unsafe-reflection
|
|
66
|
+
Object.defineProperty(ctor.prototype, ariaProperty, {
|
|
67
|
+
configurable: true,
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get(this: ReactiveElement): string | null {
|
|
70
|
+
return this.dataset[dataProperty] ?? null;
|
|
71
|
+
},
|
|
72
|
+
set(this: ReactiveElement, value: string | null): void {
|
|
73
|
+
const prevValue = this.dataset[dataProperty] ?? null;
|
|
74
|
+
if (value === prevValue) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (value === null) {
|
|
79
|
+
delete this.dataset[dataProperty];
|
|
80
|
+
} else {
|
|
81
|
+
this.dataset[dataProperty] = value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.requestUpdate(ariaProperty, prevValue);
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Mixes in aria delegation for elements that delegate focus and aria to inner
|
|
92
|
+
* shadow root elements.
|
|
93
|
+
*
|
|
94
|
+
* This mixin fixes invalid aria announcements with shadow roots, caused by
|
|
95
|
+
* duplicate aria attributes on both the host and the inner shadow root element.
|
|
96
|
+
*
|
|
97
|
+
* Note: this mixin **does not yet support** ID reference attributes, such as
|
|
98
|
+
* `aria-labelledby` or `aria-controls`.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* class MyButton extends mixinDelegatesAria(LitElement) {
|
|
103
|
+
* static shadowRootOptions = {mode: 'open', delegatesFocus: true};
|
|
104
|
+
*
|
|
105
|
+
* render() {
|
|
106
|
+
* return html`
|
|
107
|
+
* <button aria-label=${this.ariaLabel || nothing}>
|
|
108
|
+
* <slot></slot>
|
|
109
|
+
* </button>
|
|
110
|
+
* `;
|
|
111
|
+
* }
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
* ```html
|
|
115
|
+
* <my-button aria-label="Plus one">+1</my-button>
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* Use `ARIAMixinStrict` for lit analyzer strict types, such as the "role"
|
|
119
|
+
* attribute.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* return html`
|
|
124
|
+
* <button role=${(this as ARIAMixinStrict).role || nothing}>
|
|
125
|
+
* <slot></slot>
|
|
126
|
+
* </button>
|
|
127
|
+
* `;
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* In the future, updates to the Accessibility Object Model (AOM) will provide
|
|
131
|
+
* built-in aria delegation features that will replace this mixin.
|
|
132
|
+
*
|
|
133
|
+
* @param base The class to mix functionality into.
|
|
134
|
+
* @return The provided class with aria delegation mixed in.
|
|
135
|
+
*/
|
|
136
|
+
export function mixinDelegatesAria<T extends MixinBase<LitElement>>(
|
|
137
|
+
base: T,
|
|
138
|
+
): MixinReturn<T> {
|
|
139
|
+
if (isServer) {
|
|
140
|
+
// Don't shift attributes when running with lit-ssr. The SSR renderer
|
|
141
|
+
// implements a subset of DOM APIs, including the methods this mixin
|
|
142
|
+
// overrides, causing errors. We don't need to shift on the server anyway
|
|
143
|
+
// since elements will shift attributes immediately once they hydrate.
|
|
144
|
+
return base;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
abstract class WithDelegatesAriaElement extends base {
|
|
148
|
+
[privateIgnoreAttributeChangesFor] = new Set();
|
|
149
|
+
|
|
150
|
+
override attributeChangedCallback(
|
|
151
|
+
name: string,
|
|
152
|
+
oldValue: string | null,
|
|
153
|
+
newValue: string | null,
|
|
154
|
+
) {
|
|
155
|
+
if (!isAriaAttribute(name)) {
|
|
156
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (this[privateIgnoreAttributeChangesFor].has(name)) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Don't trigger another `attributeChangedCallback` once we remove the
|
|
165
|
+
// aria attribute from the host. We check the explicit name of the
|
|
166
|
+
// attribute to ignore since `attributeChangedCallback` can be called
|
|
167
|
+
// multiple times out of an expected order when hydrating an element with
|
|
168
|
+
// multiple attributes.
|
|
169
|
+
this[privateIgnoreAttributeChangesFor].add(name);
|
|
170
|
+
this.removeAttribute(name);
|
|
171
|
+
this[privateIgnoreAttributeChangesFor].delete(name);
|
|
172
|
+
const dataProperty = ariaAttributeToDataProperty(name);
|
|
173
|
+
if (newValue === null) {
|
|
174
|
+
delete this.dataset[dataProperty];
|
|
175
|
+
} else {
|
|
176
|
+
this.dataset[dataProperty] = newValue;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
this.requestUpdate(ariaAttributeToDataProperty(name), oldValue);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
override getAttribute(name: string) {
|
|
183
|
+
if (isAriaAttribute(name)) {
|
|
184
|
+
return super.getAttribute(ariaAttributeToDataAttribute(name));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return super.getAttribute(name);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
override removeAttribute(name: string) {
|
|
191
|
+
super.removeAttribute(name);
|
|
192
|
+
if (isAriaAttribute(name)) {
|
|
193
|
+
super.removeAttribute(ariaAttributeToDataAttribute(name));
|
|
194
|
+
// Since `aria-*` attributes are already removed`, we need to request
|
|
195
|
+
// an update because `attributeChangedCallback` will not be called.
|
|
196
|
+
this.requestUpdate();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
setupDelegatesAriaProperties(
|
|
202
|
+
WithDelegatesAriaElement as unknown as typeof ReactiveElement,
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
return WithDelegatesAriaElement;
|
|
206
|
+
}
|