@redvars/peacock 3.8.1 → 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 -286
- 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/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-D7sJyPy8.js +0 -586
- package/dist/button-colors-D7sJyPy8.js.map +0 -1
- package/dist/icon-CueRR7wx.js +0 -260
- package/dist/icon-CueRR7wx.js.map +0 -1
- package/dist/icon-button-CAzYr_qr.js +0 -318
- package/dist/icon-button-CAzYr_qr.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
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accessibility Object Model reflective aria property name types.
|
|
3
|
+
*/
|
|
4
|
+
export type ARIAProperty = keyof ARIAMixin;
|
|
5
|
+
/**
|
|
6
|
+
* Accessibility Object Model reflective aria properties.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ARIA_PROPERTIES: ARIAProperty[];
|
|
9
|
+
/**
|
|
10
|
+
* Accessibility Object Model aria attribute name types.
|
|
11
|
+
*/
|
|
12
|
+
export type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;
|
|
13
|
+
/**
|
|
14
|
+
* Accessibility Object Model aria attributes.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ARIA_ATTRIBUTES: ("role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
|
|
17
|
+
/**
|
|
18
|
+
* Checks if an attribute is one of the AOM aria attributes.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* isAriaAttribute('aria-label'); // true
|
|
22
|
+
*
|
|
23
|
+
* @param attribute The attribute to check.
|
|
24
|
+
* @return True if the attribute is an aria attribute, or false if not.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isAriaAttribute(attribute: string): attribute is ARIAAttribute;
|
|
27
|
+
/**
|
|
28
|
+
* Converts an AOM aria property into its corresponding attribute.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ariaPropertyToAttribute('ariaLabel'); // 'aria-label'
|
|
32
|
+
*
|
|
33
|
+
* @param property The aria property.
|
|
34
|
+
* @return The aria attribute.
|
|
35
|
+
*/
|
|
36
|
+
export declare function ariaPropertyToAttribute<K extends ARIAProperty>(property: K): ARIAPropertyToAttribute<K>;
|
|
37
|
+
type ARIAPropertyToAttribute<K extends string> = K extends `aria${infer Suffix}Element${infer OptS}` ? `aria-${Lowercase<Suffix>}` : K extends `aria${infer Suffix}` ? `aria-${Lowercase<Suffix>}` : K;
|
|
38
|
+
/**
|
|
39
|
+
* An extension of `ARIAMixin` that enforces strict value types for aria
|
|
40
|
+
* properties.
|
|
41
|
+
*
|
|
42
|
+
* This is needed for correct typing in render functions with lit analyzer.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* render() {
|
|
46
|
+
* const {ariaLabel} = this as ARIAMixinStrict;
|
|
47
|
+
* return html`
|
|
48
|
+
* <button aria-label=${ariaLabel || nothing}>
|
|
49
|
+
* <slot></slot>
|
|
50
|
+
* </button>
|
|
51
|
+
* `;
|
|
52
|
+
* }
|
|
53
|
+
*/
|
|
54
|
+
export interface ARIAMixinStrict extends ARIAMixin {
|
|
55
|
+
ariaAtomic: 'true' | 'false' | null;
|
|
56
|
+
ariaAutoComplete: 'none' | 'inline' | 'list' | 'both' | null;
|
|
57
|
+
ariaBusy: 'true' | 'false' | null;
|
|
58
|
+
ariaChecked: 'true' | 'false' | null;
|
|
59
|
+
ariaColCount: `${number}` | null;
|
|
60
|
+
ariaColIndex: `${number}` | null;
|
|
61
|
+
ariaColSpan: `${number}` | null;
|
|
62
|
+
ariaCurrent: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | null;
|
|
63
|
+
ariaDisabled: 'true' | 'false' | null;
|
|
64
|
+
ariaExpanded: 'true' | 'false' | null;
|
|
65
|
+
ariaHasPopup: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | null;
|
|
66
|
+
ariaHidden: 'true' | 'false' | null;
|
|
67
|
+
ariaInvalid: 'true' | 'false' | null;
|
|
68
|
+
ariaKeyShortcuts: string | null;
|
|
69
|
+
ariaLabel: string | null;
|
|
70
|
+
ariaLevel: `${number}` | null;
|
|
71
|
+
ariaLive: 'assertive' | 'off' | 'polite' | null;
|
|
72
|
+
ariaModal: 'true' | 'false' | null;
|
|
73
|
+
ariaMultiLine: 'true' | 'false' | null;
|
|
74
|
+
ariaMultiSelectable: 'true' | 'false' | null;
|
|
75
|
+
ariaOrientation: 'horizontal' | 'vertical' | 'undefined' | null;
|
|
76
|
+
ariaPlaceholder: string | null;
|
|
77
|
+
ariaPosInSet: `${number}` | null;
|
|
78
|
+
ariaPressed: 'true' | 'false' | null;
|
|
79
|
+
ariaReadOnly: 'true' | 'false' | null;
|
|
80
|
+
ariaRequired: 'true' | 'false' | null;
|
|
81
|
+
ariaRoleDescription: string | null;
|
|
82
|
+
ariaRowCount: `${number}` | null;
|
|
83
|
+
ariaRowIndex: `${number}` | null;
|
|
84
|
+
ariaRowSpan: `${number}` | null;
|
|
85
|
+
ariaSelected: 'true' | 'false' | null;
|
|
86
|
+
ariaSetSize: `${number}` | null;
|
|
87
|
+
ariaSort: 'ascending' | 'descending' | 'none' | 'other' | null;
|
|
88
|
+
ariaValueMax: `${number}` | null;
|
|
89
|
+
ariaValueMin: `${number}` | null;
|
|
90
|
+
ariaValueNow: `${number}` | null;
|
|
91
|
+
ariaValueText: string | null;
|
|
92
|
+
role: ARIARole | null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Valid values for `role`.
|
|
96
|
+
*/
|
|
97
|
+
export type ARIARole = 'alert' | 'alertdialog' | 'button' | 'checkbox' | 'dialog' | 'gridcell' | 'link' | 'log' | 'marquee' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | 'progressbar' | 'radio' | 'scrollbar' | 'searchbox' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'tabpanel' | 'textbox' | 'timer' | 'tooltip' | 'treeitem' | 'combobox' | 'grid' | 'listbox' | 'menu' | 'menubar' | 'radiogroup' | 'tablist' | 'tree' | 'treegrid' | 'application' | 'article' | 'cell' | 'columnheader' | 'definition' | 'directory' | 'document' | 'feed' | 'figure' | 'group' | 'heading' | 'img' | 'list' | 'listitem' | 'math' | 'none' | 'note' | 'presentation' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'separator' | 'table' | 'term' | 'text' | 'toolbar' | 'banner' | 'complementary' | 'contentinfo' | 'form' | 'main' | 'navigation' | 'region' | 'search' | 'doc-abstract' | 'doc-acknowledgments' | 'doc-afterword' | 'doc-appendix' | 'doc-backlink' | 'doc-biblioentry' | 'doc-bibliography' | 'doc-biblioref' | 'doc-chapter' | 'doc-colophon' | 'doc-conclusion' | 'doc-cover' | 'doc-credit' | 'doc-credits' | 'doc-dedication' | 'doc-endnote' | 'doc-endnotes' | 'doc-epigraph' | 'doc-epilogue' | 'doc-errata' | 'doc-example' | 'doc-footnote' | 'doc-foreword' | 'doc-glossary' | 'doc-glossref' | 'doc-index' | 'doc-introduction' | 'doc-noteref' | 'doc-notice' | 'doc-pagebreak' | 'doc-pagelist' | 'doc-part' | 'doc-preface' | 'doc-prologue' | 'doc-pullquote' | 'doc-qna' | 'doc-subtitle' | 'doc-tip' | 'doc-toc';
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
import { MixinBase, MixinReturn } from '../mixins/mixin.js';
|
|
8
|
+
/**
|
|
9
|
+
* Mixes in aria delegation for elements that delegate focus and aria to inner
|
|
10
|
+
* shadow root elements.
|
|
11
|
+
*
|
|
12
|
+
* This mixin fixes invalid aria announcements with shadow roots, caused by
|
|
13
|
+
* duplicate aria attributes on both the host and the inner shadow root element.
|
|
14
|
+
*
|
|
15
|
+
* Note: this mixin **does not yet support** ID reference attributes, such as
|
|
16
|
+
* `aria-labelledby` or `aria-controls`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* class MyButton extends mixinDelegatesAria(LitElement) {
|
|
21
|
+
* static shadowRootOptions = {mode: 'open', delegatesFocus: true};
|
|
22
|
+
*
|
|
23
|
+
* render() {
|
|
24
|
+
* return html`
|
|
25
|
+
* <button aria-label=${this.ariaLabel || nothing}>
|
|
26
|
+
* <slot></slot>
|
|
27
|
+
* </button>
|
|
28
|
+
* `;
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
* ```html
|
|
33
|
+
* <my-button aria-label="Plus one">+1</my-button>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* Use `ARIAMixinStrict` for lit analyzer strict types, such as the "role"
|
|
37
|
+
* attribute.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* return html`
|
|
42
|
+
* <button role=${(this as ARIAMixinStrict).role || nothing}>
|
|
43
|
+
* <slot></slot>
|
|
44
|
+
* </button>
|
|
45
|
+
* `;
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* In the future, updates to the Accessibility Object Model (AOM) will provide
|
|
49
|
+
* built-in aria delegation features that will replace this mixin.
|
|
50
|
+
*
|
|
51
|
+
* @param base The class to mix functionality into.
|
|
52
|
+
* @return The provided class with aria delegation mixed in.
|
|
53
|
+
*/
|
|
54
|
+
export declare function mixinDelegatesAria<T extends MixinBase<LitElement>>(base: T): MixinReturn<T>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add a hook for an event that is called after the event is dispatched and
|
|
3
|
+
* propagates to other event listeners.
|
|
4
|
+
*
|
|
5
|
+
* This is useful for behaviors that need to check if an event is canceled.
|
|
6
|
+
*
|
|
7
|
+
* The callback is invoked synchronously, which allows for better integration
|
|
8
|
+
* with synchronous platform APIs (like `<form>` or `<label>` clicking).
|
|
9
|
+
*
|
|
10
|
+
* Note: `setupDispatchHooks()` must be called on the element before adding any
|
|
11
|
+
* other event listeners. Call it in the constructor of an element or
|
|
12
|
+
* controller.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* class MyControl extends LitElement {
|
|
17
|
+
* constructor() {
|
|
18
|
+
* super();
|
|
19
|
+
* setupDispatchHooks(this, 'click');
|
|
20
|
+
* this.addEventListener('click', event => {
|
|
21
|
+
* afterDispatch(event, () => {
|
|
22
|
+
* if (event.defaultPrevented) {
|
|
23
|
+
* return
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* // ... perform logic
|
|
27
|
+
* });
|
|
28
|
+
* });
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* class MyController implements ReactiveController {
|
|
36
|
+
* constructor(host: ReactiveElement) {
|
|
37
|
+
* // setupDispatchHooks() may be called multiple times for the same
|
|
38
|
+
* // element and events, making it safe for multiple controllers to use it.
|
|
39
|
+
* setupDispatchHooks(host, 'click');
|
|
40
|
+
* host.addEventListener('click', event => {
|
|
41
|
+
* afterDispatch(event, () => {
|
|
42
|
+
* if (event.defaultPrevented) {
|
|
43
|
+
* return;
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* // ... perform logic
|
|
47
|
+
* });
|
|
48
|
+
* });
|
|
49
|
+
* }
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @param event The event to add a hook to.
|
|
54
|
+
* @param callback A hook that is called after the event finishes dispatching.
|
|
55
|
+
*/
|
|
56
|
+
export declare function afterDispatch(event: Event, callback: () => void): void;
|
|
57
|
+
/**
|
|
58
|
+
* Sets up an element to add dispatch hooks to given event types. This must be
|
|
59
|
+
* called before adding any event listeners that need to use dispatch hooks
|
|
60
|
+
* like `afterDispatch()`.
|
|
61
|
+
*
|
|
62
|
+
* This function is safe to call multiple times with the same element or event
|
|
63
|
+
* types. Call it in the constructor of elements, mixins, and controllers to
|
|
64
|
+
* ensure it is set up before external listeners.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* class MyControl extends LitElement {
|
|
69
|
+
* constructor() {
|
|
70
|
+
* super();
|
|
71
|
+
* setupDispatchHooks(this, 'click');
|
|
72
|
+
* this.addEventListener('click', this.listenerUsingAfterDispatch);
|
|
73
|
+
* }
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @param element The element to set up event dispatch hooks for.
|
|
78
|
+
* @param eventTypes The event types to add dispatch hooks to.
|
|
79
|
+
*/
|
|
80
|
+
export declare function setupDispatchHooks(element: Element, ...eventTypes: [string, ...string[]]): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { MixinBase, MixinReturn } from './mixin.js';
|
|
3
|
+
/**
|
|
4
|
+
* A unique symbol used for protected access to an instance's
|
|
5
|
+
* `ElementInternals`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* class MyElement extends mixinElementInternals(LitElement) {
|
|
10
|
+
* constructor() {
|
|
11
|
+
* super();
|
|
12
|
+
* this[internals].role = 'button';
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const internals: unique symbol;
|
|
18
|
+
/**
|
|
19
|
+
* An instance with an `internals` symbol property for the component's
|
|
20
|
+
* `ElementInternals`.
|
|
21
|
+
*
|
|
22
|
+
* Use this when protected access is needed for an instance's `ElementInternals`
|
|
23
|
+
* from other files. A unique symbol is used to access the internals.
|
|
24
|
+
*/
|
|
25
|
+
export interface WithElementInternals {
|
|
26
|
+
/**
|
|
27
|
+
* An instance's `ElementInternals`.
|
|
28
|
+
*/
|
|
29
|
+
[internals]: ElementInternals;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Mixes in an attached `ElementInternals` instance.
|
|
33
|
+
*
|
|
34
|
+
* This mixin is only needed when other shared code needs access to a
|
|
35
|
+
* component's `ElementInternals`, such as form-associated mixins.
|
|
36
|
+
*
|
|
37
|
+
* @param base The class to mix functionality into.
|
|
38
|
+
* @return The provided class with `WithElementInternals` mixed in.
|
|
39
|
+
*/
|
|
40
|
+
export declare function mixinElementInternals<T extends MixinBase<LitElement>>(base: T): MixinReturn<T, WithElementInternals>;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { WithElementInternals } from './element-internals.js';
|
|
3
|
+
import { MixinBase, MixinReturn } from './mixin.js';
|
|
4
|
+
/**
|
|
5
|
+
* A form-associated element.
|
|
6
|
+
*/
|
|
7
|
+
export interface FormAssociated {
|
|
8
|
+
/**
|
|
9
|
+
* The associated form element with which this element's value will submit.
|
|
10
|
+
*/
|
|
11
|
+
readonly form: HTMLFormElement | null;
|
|
12
|
+
/**
|
|
13
|
+
* The labels this element is associated with.
|
|
14
|
+
*/
|
|
15
|
+
readonly labels: NodeList;
|
|
16
|
+
/**
|
|
17
|
+
* The HTML name to use in form submission.
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether or not the element is disabled.
|
|
22
|
+
*/
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the current form value of a component. Defaults to the component's
|
|
26
|
+
* `value` attribute.
|
|
27
|
+
*
|
|
28
|
+
* @return The current form value.
|
|
29
|
+
*/
|
|
30
|
+
[getFormValue](): FormValue | null;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the current form state of a component. Defaults to the component's
|
|
33
|
+
* `[getFormValue]()` result.
|
|
34
|
+
*
|
|
35
|
+
* Use this when the state of an element is different from its value, such as
|
|
36
|
+
* checkboxes (internal boolean state and a user string value).
|
|
37
|
+
*
|
|
38
|
+
* @return The current form state, defaults to the form value.
|
|
39
|
+
*/
|
|
40
|
+
[getFormState](): FormValue | null;
|
|
41
|
+
/**
|
|
42
|
+
* A callback for when a form component should be disabled or enabled. This
|
|
43
|
+
* can be called in a variety of situations, such as disabled `<fieldset>`s.
|
|
44
|
+
*
|
|
45
|
+
* @param disabled Whether or not the form control should be disabled.
|
|
46
|
+
*/
|
|
47
|
+
formDisabledCallback(disabled: boolean): void;
|
|
48
|
+
/**
|
|
49
|
+
* An optional callback for when the form requests to reset its value.
|
|
50
|
+
* Typically, the default value that is reset is represented in the attribute
|
|
51
|
+
* of an element.
|
|
52
|
+
*
|
|
53
|
+
* This means the attribute used for the value should not update as the value
|
|
54
|
+
* changes. For example, a checkbox should not change its default `checked`
|
|
55
|
+
* attribute when selected. Ensure form values do not reflect.
|
|
56
|
+
*/
|
|
57
|
+
formResetCallback?(): void;
|
|
58
|
+
/**
|
|
59
|
+
* An optional callback for when the form restores the state of a component.
|
|
60
|
+
* For example, when a page is reloaded or forms are autofilled.
|
|
61
|
+
*
|
|
62
|
+
* @param state The state to restore, or null to reset the form control's
|
|
63
|
+
* value.
|
|
64
|
+
* @param reason The reason state was restored, either `'restore'` or
|
|
65
|
+
* `'autocomplete'`.
|
|
66
|
+
*/
|
|
67
|
+
formStateRestoreCallback?(state: FormRestoreState | null, reason: FormRestoreReason): void;
|
|
68
|
+
/**
|
|
69
|
+
* An optional callback for when the associated form changes.
|
|
70
|
+
*
|
|
71
|
+
* @param form The new associated form, or `null` if there is none.
|
|
72
|
+
*/
|
|
73
|
+
formAssociatedCallback?(form: HTMLFormElement | null): void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The constructor of a `FormAssociated` element.
|
|
77
|
+
*/
|
|
78
|
+
export interface FormAssociatedConstructor {
|
|
79
|
+
/**
|
|
80
|
+
* Indicates that an element is participating in form association.
|
|
81
|
+
*/
|
|
82
|
+
readonly formAssociated: true;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A symbol property to retrieve the form value for an element.
|
|
86
|
+
*/
|
|
87
|
+
export declare const getFormValue: unique symbol;
|
|
88
|
+
/**
|
|
89
|
+
* A symbol property to retrieve the form state for an element.
|
|
90
|
+
*/
|
|
91
|
+
export declare const getFormState: unique symbol;
|
|
92
|
+
/**
|
|
93
|
+
* Mixes in form-associated behavior for a class. This allows an element to add
|
|
94
|
+
* values to `<form>` elements.
|
|
95
|
+
*
|
|
96
|
+
* Implementing classes should provide a `[formValue]` to return the current
|
|
97
|
+
* value of the element, as well as reset and restore callbacks.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const base = mixinFormAssociated(mixinElementInternals(LitElement));
|
|
102
|
+
*
|
|
103
|
+
* class MyControl extends base {
|
|
104
|
+
* \@property()
|
|
105
|
+
* value = '';
|
|
106
|
+
*
|
|
107
|
+
* override [getFormValue]() {
|
|
108
|
+
* return this.value;
|
|
109
|
+
* }
|
|
110
|
+
*
|
|
111
|
+
* override formResetCallback() {
|
|
112
|
+
* const defaultValue = this.getAttribute('value');
|
|
113
|
+
* this.value = defaultValue;
|
|
114
|
+
* }
|
|
115
|
+
*
|
|
116
|
+
* override formStateRestoreCallback(state: string) {
|
|
117
|
+
* this.value = state;
|
|
118
|
+
* }
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* Elements may optionally provide a `[formState]` if their values do not
|
|
123
|
+
* represent the state of the component.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* const base = mixinFormAssociated(mixinElementInternals(LitElement));
|
|
128
|
+
*
|
|
129
|
+
* class MyCheckbox extends base {
|
|
130
|
+
* \@property()
|
|
131
|
+
* value = 'on';
|
|
132
|
+
*
|
|
133
|
+
* \@property({type: Boolean})
|
|
134
|
+
* checked = false;
|
|
135
|
+
*
|
|
136
|
+
* override [getFormValue]() {
|
|
137
|
+
* return this.checked ? this.value : null;
|
|
138
|
+
* }
|
|
139
|
+
*
|
|
140
|
+
* override [getFormState]() {
|
|
141
|
+
* return String(this.checked);
|
|
142
|
+
* }
|
|
143
|
+
*
|
|
144
|
+
* override formResetCallback() {
|
|
145
|
+
* const defaultValue = this.hasAttribute('checked');
|
|
146
|
+
* this.checked = defaultValue;
|
|
147
|
+
* }
|
|
148
|
+
*
|
|
149
|
+
* override formStateRestoreCallback(state: string) {
|
|
150
|
+
* this.checked = Boolean(state);
|
|
151
|
+
* }
|
|
152
|
+
* }
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* @param base The class to mix functionality into. The base class must use
|
|
156
|
+
* `mixinElementInternals()`.
|
|
157
|
+
* @return The provided class with `FormAssociated` mixed in.
|
|
158
|
+
*/
|
|
159
|
+
export declare function mixinFormAssociated<T extends MixinBase<LitElement & WithElementInternals>>(base: T): MixinReturn<T & FormAssociatedConstructor, FormAssociated>;
|
|
160
|
+
/**
|
|
161
|
+
* A value that can be provided for form submission and state.
|
|
162
|
+
*/
|
|
163
|
+
export type FormValue = File | string | FormData;
|
|
164
|
+
/**
|
|
165
|
+
* A value to be restored for a component's form value. If a component's form
|
|
166
|
+
* state is a `FormData` object, its entry list of name and values will be
|
|
167
|
+
* provided.
|
|
168
|
+
*/
|
|
169
|
+
export type FormRestoreState = File | string | Array<[string, FormDataEntryValue]>;
|
|
170
|
+
/**
|
|
171
|
+
* The reason a form component is being restored for, either `'restore'` for
|
|
172
|
+
* browser restoration or `'autocomplete'` for restoring user values.
|
|
173
|
+
*/
|
|
174
|
+
export type FormRestoreReason = 'restore' | 'autocomplete';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { WithElementInternals } from './element-internals.js';
|
|
3
|
+
import { MixinBase, MixinReturn } from './mixin.js';
|
|
4
|
+
/**
|
|
5
|
+
* A string indicating the form submission behavior of the element.
|
|
6
|
+
*
|
|
7
|
+
* - submit: The element submits the form. This is the default value if the
|
|
8
|
+
* attribute is not specified, or if it is dynamically changed to an empty or
|
|
9
|
+
* invalid value.
|
|
10
|
+
* - reset: The element resets the form.
|
|
11
|
+
* - button: The element does nothing.
|
|
12
|
+
*/
|
|
13
|
+
export type FormSubmitterType = 'button' | 'submit' | 'reset';
|
|
14
|
+
/**
|
|
15
|
+
* An element that can submit or reset a `<form>`, similar to
|
|
16
|
+
* `<button type="submit">`.
|
|
17
|
+
*/
|
|
18
|
+
export interface FormSubmitter {
|
|
19
|
+
/**
|
|
20
|
+
* A string indicating the form submission behavior of the element.
|
|
21
|
+
*
|
|
22
|
+
* - submit: The element submits the form. This is the default value if the
|
|
23
|
+
* attribute is not specified, or if it is dynamically changed to an empty or
|
|
24
|
+
* invalid value.
|
|
25
|
+
* - reset: The element resets the form.
|
|
26
|
+
* - button: The element does nothing.
|
|
27
|
+
*/
|
|
28
|
+
type: string;
|
|
29
|
+
/**
|
|
30
|
+
* The HTML name to use in form submission. When combined with a `value`, the
|
|
31
|
+
* submitting button's name/value will be added to the form.
|
|
32
|
+
*
|
|
33
|
+
* Names must reflect to a `name` attribute for form integration.
|
|
34
|
+
*/
|
|
35
|
+
name: string;
|
|
36
|
+
/**
|
|
37
|
+
* The value of the button. When combined with a `name`, the submitting
|
|
38
|
+
* button's name/value will be added to the form.
|
|
39
|
+
*/
|
|
40
|
+
value: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Mixes in form submitter behavior for a class.
|
|
44
|
+
*
|
|
45
|
+
* A click listener is added to each element instance. If the click is not
|
|
46
|
+
* default prevented, it will submit the element's form, if any.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const base = mixinFormSubmitter(mixinElementInternals(LitElement));
|
|
51
|
+
* class MyButton extends base {
|
|
52
|
+
* static formAssociated = true;
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param base The class to mix functionality into.
|
|
57
|
+
* @return The provided class with `FormSubmitter` mixed in.
|
|
58
|
+
*/
|
|
59
|
+
export declare function mixinFormSubmitter<T extends MixinBase<LitElement & WithElementInternals>>(base: T): MixinReturn<T, FormSubmitter>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { MixinBase, MixinReturn } from './mixin.js';
|
|
3
|
+
/**
|
|
4
|
+
* An element that navigates to a URL when activated, similar to `<a href>`.
|
|
5
|
+
*/
|
|
6
|
+
export interface Hyperlink {
|
|
7
|
+
/**
|
|
8
|
+
* The URL the hyperlink points to. When set, the component renders as an
|
|
9
|
+
* `<a>` element. Maps to the native `href` attribute.
|
|
10
|
+
*/
|
|
11
|
+
href?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Where to display the linked URL. Maps to the native `target` attribute.
|
|
14
|
+
* Possible values: `"_self"`, `"_blank"`, `"_parent"`, `"_top"`, or a
|
|
15
|
+
* frame name. When using `"_blank"`, set `rel="noopener noreferrer"`.
|
|
16
|
+
*/
|
|
17
|
+
target: '_self' | '_parent' | '_blank' | '_top' | string;
|
|
18
|
+
/**
|
|
19
|
+
* The relationship between the current document and the linked URL.
|
|
20
|
+
* Maps to the native `rel` attribute. Use `"noopener noreferrer"` when
|
|
21
|
+
* `target="_blank"` to prevent tab-napping attacks.
|
|
22
|
+
*/
|
|
23
|
+
rel: string;
|
|
24
|
+
/**
|
|
25
|
+
* Causes the browser to download the linked URL instead of navigating.
|
|
26
|
+
* A string value is used as the suggested filename. Only applies when
|
|
27
|
+
* `href` is set. Maps to the native `download` attribute.
|
|
28
|
+
*/
|
|
29
|
+
download: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Mixes in hyperlink behavior for a class.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* class MyLink extends mixinHyperlink(LitElement) {}
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @param base The class to mix functionality into.
|
|
40
|
+
* @return The provided class with `Hyperlink` mixed in.
|
|
41
|
+
*/
|
|
42
|
+
export declare function mixinHyperlink<T extends MixinBase<LitElement>>(base: T): MixinReturn<T, Hyperlink>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base class for a mixin with an optional expected base class type.
|
|
3
|
+
*
|
|
4
|
+
* @template ExpectedBase Optional expected base class type, such as
|
|
5
|
+
* `LitElement`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* interface Foo {
|
|
10
|
+
* isFoo: boolean;
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* function mixinFoo<T extends MixinBase>(base: T): MixinReturn<T, Foo> {
|
|
14
|
+
* // Mixins must be `abstract`
|
|
15
|
+
* abstract class FooImpl extends base implements Foo {
|
|
16
|
+
* isFoo = true;
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* return FooImpl;
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export type MixinBase<ExpectedBase = object> = abstract new (...args: any[]) => ExpectedBase;
|
|
24
|
+
/**
|
|
25
|
+
* The return value of a mixin.
|
|
26
|
+
*
|
|
27
|
+
* @template MixinBase The generic that extends `MixinBase` used for the mixin's
|
|
28
|
+
* base class argument.
|
|
29
|
+
* @template MixinClass Optional interface of fuctionality that was mixed in.
|
|
30
|
+
* Omit if no additional APIs were added (such as purely overriding base
|
|
31
|
+
* class functionality).
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* interface Foo {
|
|
36
|
+
* isFoo: boolean;
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* // Mixins must be `abstract`
|
|
40
|
+
* function mixinFoo<T extends MixinBase>(base: T): MixinReturn<T, Foo> {
|
|
41
|
+
* abstract class FooImpl extends base implements Foo {
|
|
42
|
+
* isFoo = true;
|
|
43
|
+
* }
|
|
44
|
+
*
|
|
45
|
+
* return FooImpl;
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export type MixinReturn<MixinBase, MixinClass = object> = (abstract new (...args: any[]) => MixinClass) & MixinBase;
|
|
@@ -3,7 +3,7 @@ import { LitElement } from 'lit';
|
|
|
3
3
|
* @label Accordion Item
|
|
4
4
|
* @tag wc-accordion-item
|
|
5
5
|
* @rawTag accordion-item
|
|
6
|
-
* @summary An expansion panel with a header that reveals or hides associated content.
|
|
6
|
+
* @summary An expansion panel with a header that reveals or hides associated content.
|
|
7
7
|
*
|
|
8
8
|
* @slot - The body content revealed when the panel is expanded.
|
|
9
9
|
* @slot heading - The panel title. Renders as `body-large` text.
|
|
@@ -48,7 +48,9 @@ export declare class AccordionItem extends LitElement {
|
|
|
48
48
|
* `'before'` places it at the leading start.
|
|
49
49
|
*/
|
|
50
50
|
togglePosition: 'before' | 'after';
|
|
51
|
+
/** True when the `description` slot contains at least one non-empty node. */
|
|
51
52
|
private _hasDescriptionSlot;
|
|
53
|
+
/** True when the `heading` slot contains at least one non-empty node. */
|
|
52
54
|
private _hasHeadingSlot;
|
|
53
55
|
private readonly buttonElement;
|
|
54
56
|
focus(): void;
|
|
@@ -4,7 +4,7 @@ import { AccordionItem } from './accordion-item.js';
|
|
|
4
4
|
* @label Accordion
|
|
5
5
|
* @tag wc-accordion
|
|
6
6
|
* @rawTag accordion
|
|
7
|
-
* @summary A vertically stacked set of expansion panels.
|
|
7
|
+
* @summary A vertically stacked set of expansion panels.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```html
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type AlertVariant = 'note' | 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
/**
|
|
4
|
+
* @label Alert
|
|
5
|
+
* @tag wc-alert
|
|
6
|
+
* @rawTag alert
|
|
7
|
+
* @summary Alerts show short, prominent contextual messages with optional icon and description.
|
|
8
|
+
*
|
|
9
|
+
* @cssprop --alert-container-color - Background color of the alert container.
|
|
10
|
+
* @cssprop --alert-label-text-color - Label text color.
|
|
11
|
+
* @cssprop --alert-description-text-color - Description text color.
|
|
12
|
+
* @cssprop --alert-icon-color - Icon color.
|
|
13
|
+
* @cssprop --alert-border-radius - Border radius of the alert surface.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```html
|
|
17
|
+
* <wc-alert variant="note" description="Use semantic roles that preserve a 3:1 contrast ratio."></wc-alert>
|
|
18
|
+
* ```
|
|
19
|
+
* @tags display, feedback
|
|
20
|
+
*/
|
|
21
|
+
export declare class Alert extends LitElement {
|
|
22
|
+
static styles: import("lit").CSSResultGroup[];
|
|
23
|
+
/**
|
|
24
|
+
* Visual intent of the alert.
|
|
25
|
+
*/
|
|
26
|
+
variant: AlertVariant;
|
|
27
|
+
/**
|
|
28
|
+
* Optional explicit label text. Falls back to a variant-based label.
|
|
29
|
+
*/
|
|
30
|
+
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional explicit icon name. Falls back to a variant-based icon.
|
|
33
|
+
*/
|
|
34
|
+
icon?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Optional description text when a default slot is not provided.
|
|
37
|
+
*/
|
|
38
|
+
description: string;
|
|
39
|
+
private get resolvedLabel();
|
|
40
|
+
private get resolvedIcon();
|
|
41
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Alert } from './alert.js';
|