@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
package/src/list/list-item.ts
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { html, LitElement } from 'lit';
|
|
2
|
-
import { property, query
|
|
1
|
+
import { html, LitElement, nothing } from 'lit';
|
|
2
|
+
import { property, query } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
import styles from './list-item.scss';
|
|
6
|
-
import
|
|
7
|
-
import NativeHyperlinkMixin from '@/__mixins/NativeHyperlinkMixin.js';
|
|
8
|
-
import { isLink } from '@/__utils/is-link.js';
|
|
6
|
+
import { isLink } from '@/__internal/utils/is-link.js';
|
|
9
7
|
import {
|
|
10
8
|
dispatchActivationClick,
|
|
11
9
|
isActivationClick,
|
|
12
|
-
} from '@/
|
|
10
|
+
} from '@/__internal/utils/dispatch-event-utils.js';
|
|
11
|
+
import { ARIAMixinStrict } from '@/__internal/aria/aria.js';
|
|
12
|
+
import { mixinBaseButton } from '@/button/base-button/base-button.js';
|
|
13
|
+
import { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';
|
|
14
|
+
import { mixinDelegatesAria } from '@/__internal/aria/delegate.js';
|
|
15
|
+
import { mixinElementInternals } from '@/__internal/mixins/element-internals.js';
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* @label List Item
|
|
16
19
|
* @tag wc-list-item
|
|
17
20
|
* @rawTag list-item
|
|
18
21
|
*
|
|
19
|
-
* @summary A
|
|
22
|
+
* @summary A list item with leading, trailing and content slots.
|
|
20
23
|
*
|
|
21
24
|
* @example
|
|
22
25
|
* ```html
|
|
@@ -28,16 +31,30 @@ import {
|
|
|
28
31
|
* ```
|
|
29
32
|
* @tags display
|
|
30
33
|
*/
|
|
31
|
-
export class ListItem extends
|
|
32
|
-
|
|
34
|
+
export class ListItem extends mixinBaseButton(
|
|
35
|
+
mixinHyperlink(mixinDelegatesAria(mixinElementInternals(LitElement))),
|
|
33
36
|
) {
|
|
37
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
38
|
+
|
|
39
|
+
/** @nocollapse */ // eslint-disable-next-line
|
|
40
|
+
static override shadowRootOptions: ShadowRootInit = {
|
|
41
|
+
mode: 'open',
|
|
42
|
+
delegatesFocus: true,
|
|
43
|
+
};
|
|
44
|
+
|
|
34
45
|
static styles = [styles];
|
|
35
46
|
|
|
36
47
|
@property({ type: Boolean, reflect: true }) selected = false;
|
|
37
48
|
|
|
38
|
-
|
|
49
|
+
/** When true, renders the list-item in a loading skeleton state. */
|
|
50
|
+
@property({ type: Boolean, reflect: true }) skeleton: boolean = false;
|
|
39
51
|
|
|
40
|
-
@
|
|
52
|
+
@query('#list-item') readonly itemElement!: HTMLElement | null;
|
|
53
|
+
|
|
54
|
+
constructor() {
|
|
55
|
+
super();
|
|
56
|
+
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
57
|
+
}
|
|
41
58
|
|
|
42
59
|
connectedCallback() {
|
|
43
60
|
// eslint-disable-next-line wc/guard-super-call
|
|
@@ -57,7 +74,10 @@ export class ListItem extends NativeButtonMixin(
|
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
__dispatchClick = (event: MouseEvent | KeyboardEvent) => {
|
|
60
|
-
|
|
77
|
+
// If the button is soft-disabled or a disabled link, we need to explicitly
|
|
78
|
+
// prevent the click from propagating to other event listeners as well as
|
|
79
|
+
// prevent the default action.
|
|
80
|
+
if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {
|
|
61
81
|
event.stopImmediatePropagation();
|
|
62
82
|
event.preventDefault();
|
|
63
83
|
return;
|
|
@@ -71,62 +91,35 @@ export class ListItem extends NativeButtonMixin(
|
|
|
71
91
|
dispatchActivationClick(this.itemElement);
|
|
72
92
|
};
|
|
73
93
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (event.key === ' ') {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
this.itemElement.click();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (event.key === 'Enter' && !isLink(this)) {
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
this.itemElement.click();
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
__handlePress = (event: KeyboardEvent | MouseEvent) => {
|
|
94
|
-
if (this.disabled || this.softDisabled) return;
|
|
95
|
-
|
|
96
|
-
if (
|
|
97
|
-
event instanceof KeyboardEvent &&
|
|
98
|
-
event.type === 'keydown' &&
|
|
99
|
-
(event.key === 'Enter' || event.key === ' ')
|
|
100
|
-
) {
|
|
101
|
-
this.isPressed = true;
|
|
102
|
-
} else if (event.type === 'mousedown') {
|
|
103
|
-
this.isPressed = true;
|
|
104
|
-
} else {
|
|
105
|
-
this.isPressed = false;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
94
|
+
private __hasNamedSlot(...names: string[]) {
|
|
95
|
+
return names.some(name =>
|
|
96
|
+
Array.from(this.children).some(
|
|
97
|
+
child => child.getAttribute('slot') === name,
|
|
98
|
+
),
|
|
99
|
+
);
|
|
100
|
+
}
|
|
108
101
|
|
|
109
102
|
render() {
|
|
103
|
+
const isElementLink = isLink(this);
|
|
104
|
+
|
|
110
105
|
const cssClasses = {
|
|
111
106
|
'list-item': true,
|
|
112
|
-
'
|
|
113
|
-
|
|
114
|
-
disabled: this.disabled || this.softDisabled,
|
|
115
|
-
pressed: this.isPressed,
|
|
107
|
+
'native-button': !isElementLink,
|
|
108
|
+
'native-link': isElementLink,
|
|
116
109
|
};
|
|
117
110
|
|
|
118
|
-
|
|
111
|
+
// Needed for closure conformance
|
|
112
|
+
const { ariaLabel } = this as ARIAMixinStrict;
|
|
113
|
+
|
|
114
|
+
if (!isElementLink) {
|
|
119
115
|
return html`
|
|
120
116
|
<button
|
|
121
|
-
id="item"
|
|
117
|
+
id="list-item"
|
|
122
118
|
class=${classMap(cssClasses)}
|
|
123
|
-
type=${this.htmlType}
|
|
124
119
|
?disabled=${this.disabled}
|
|
120
|
+
aria-label="${ariaLabel || nothing}"
|
|
125
121
|
?aria-disabled=${this.softDisabled}
|
|
126
122
|
@click=${this.__dispatchClick}
|
|
127
|
-
@mousedown=${this.__handlePress}
|
|
128
|
-
@keydown=${this.__handleKeyDown}
|
|
129
|
-
@keyup=${this.__handlePress}
|
|
130
123
|
>
|
|
131
124
|
${this.renderContent()}
|
|
132
125
|
</button>
|
|
@@ -135,7 +128,7 @@ export class ListItem extends NativeButtonMixin(
|
|
|
135
128
|
|
|
136
129
|
return html`
|
|
137
130
|
<a
|
|
138
|
-
id="item"
|
|
131
|
+
id="list-item"
|
|
139
132
|
class=${classMap(cssClasses)}
|
|
140
133
|
href=${this.href}
|
|
141
134
|
target=${this.target}
|
|
@@ -144,9 +137,6 @@ export class ListItem extends NativeButtonMixin(
|
|
|
144
137
|
tabindex=${this.disabled ? '-1' : '0'}
|
|
145
138
|
aria-disabled=${String(this.disabled || this.softDisabled)}
|
|
146
139
|
@click=${this.__dispatchClick}
|
|
147
|
-
@mousedown=${this.__handlePress}
|
|
148
|
-
@keydown=${this.__handleKeyDown}
|
|
149
|
-
@keyup=${this.__handlePress}
|
|
150
140
|
>
|
|
151
141
|
${this.renderContent()}
|
|
152
142
|
</a>
|
|
@@ -154,22 +144,36 @@ export class ListItem extends NativeButtonMixin(
|
|
|
154
144
|
}
|
|
155
145
|
|
|
156
146
|
renderContent() {
|
|
147
|
+
const hasLeading = this.__hasNamedSlot('leading');
|
|
148
|
+
const hasTrailingSupportingText = this.__hasNamedSlot(
|
|
149
|
+
'trailing-supporting-text',
|
|
150
|
+
);
|
|
151
|
+
const hasTrailing = this.__hasNamedSlot('trailing');
|
|
152
|
+
|
|
157
153
|
return html`
|
|
158
|
-
<wc-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
154
|
+
<wc-item class="list-item-content">
|
|
155
|
+
<wc-focus-ring
|
|
156
|
+
class="focus-ring"
|
|
157
|
+
for="list-item"
|
|
158
|
+
slot="container"
|
|
159
|
+
></wc-focus-ring>
|
|
160
|
+
<div class="background" slot="container"></div>
|
|
161
|
+
<wc-ripple class="ripple" for="list-item" slot="container"></wc-ripple>
|
|
162
|
+
<wc-skeleton class="skeleton" slot="container"></wc-skeleton>
|
|
163
|
+
|
|
164
|
+
<slot name="leading" slot="start" ?hidden=${!hasLeading}></slot>
|
|
165
|
+
<slot name="overline" slot="overline"></slot>
|
|
166
|
+
<slot name="headline" slot="headline"></slot>
|
|
167
|
+
<slot></slot>
|
|
168
|
+
<slot name="supporting-text" slot="supporting-text"></slot>
|
|
169
|
+
|
|
170
|
+
<slot
|
|
171
|
+
name="trailing-supporting-text"
|
|
172
|
+
slot="trailing-supporting-text"
|
|
173
|
+
?hidden=${!hasTrailingSupportingText}
|
|
174
|
+
></slot>
|
|
175
|
+
<slot name="trailing" slot="end" ?hidden=${!hasTrailing}></slot>
|
|
176
|
+
</wc-item>
|
|
173
177
|
`;
|
|
174
178
|
}
|
|
175
179
|
}
|
package/src/list/list.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use '../../scss/mixin';
|
|
2
2
|
|
|
3
3
|
@include mixin.base-styles;
|
|
4
4
|
|
|
@@ -9,16 +9,4 @@
|
|
|
9
9
|
.list {
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
|
-
gap: var(--spacing-050);
|
|
13
|
-
padding-block: var(--spacing-050);
|
|
14
|
-
border-radius: var(--shape-corner-large);
|
|
15
|
-
background-color: var(--_container-color);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.list.variant-standard {
|
|
19
|
-
--_container-color: var(--color-surface-container);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.list.variant-vibrant {
|
|
23
|
-
--_container-color: var(--color-tertiary-container);
|
|
24
12
|
}
|
package/src/list/list.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { LitElement, html } from 'lit';
|
|
1
|
+
import { LitElement, html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import styles from './list.scss';
|
|
5
5
|
import { ListItem } from './list-item.js';
|
|
6
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @label List
|
|
9
10
|
* @tag wc-list
|
|
10
11
|
* @rawTag list
|
|
11
12
|
*
|
|
12
|
-
* @summary A
|
|
13
|
+
* @summary A list container for one or more list items.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```html
|
|
@@ -23,12 +24,14 @@ import { ListItem } from './list-item.js';
|
|
|
23
24
|
* ```
|
|
24
25
|
* @tags display
|
|
25
26
|
*/
|
|
27
|
+
@IndividualComponent
|
|
26
28
|
export class List extends LitElement {
|
|
27
29
|
static styles = [styles];
|
|
28
30
|
|
|
29
31
|
static Item = ListItem;
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
/** */
|
|
34
|
+
@property({ type: String, reflect: true }) variant: 'standard' | 'segmented' =
|
|
32
35
|
'standard';
|
|
33
36
|
|
|
34
37
|
connectedCallback() {
|
|
@@ -1,90 +1,99 @@
|
|
|
1
|
+
import { LoaderConfig, LoaderUtils } from './LoaderUtils.js';
|
|
2
|
+
import { loadCSS } from './CssLoader.js';
|
|
3
|
+
|
|
1
4
|
// Eager loaded
|
|
5
|
+
import { Elevation } from '@/elevation/elevation.js';
|
|
6
|
+
import { FocusRing } from '@/focus-ring/focus-ring.js';
|
|
7
|
+
import { Ripple } from '@/ripple/ripple.js';
|
|
8
|
+
import { Icon } from '@/icon/icon.js';
|
|
9
|
+
import { Avatar } from '@/avatar/avatar.js';
|
|
10
|
+
import { Badge } from '@/badge/badge.js';
|
|
11
|
+
import { Divider } from '@/divider/divider.js';
|
|
12
|
+
import { Button } from '@/button/button/button.js';
|
|
13
|
+
import ButtonGroup from '@/button/button-group/button-group.js';
|
|
14
|
+
import { IconButton } from '@/button/icon-button/icon-button.js';
|
|
15
|
+
import { Fab } from '@/button/fab/fab.js';
|
|
16
|
+
import { SegmentedButton } from '@/segmented-button/segmented-button.js';
|
|
17
|
+
import { SegmentedButtonGroup } from '@/segmented-button/segmented-button-group.js';
|
|
18
|
+
import { SplitButton } from '@/split-button/split-button.js';
|
|
19
|
+
import { DropdownButton } from '@/dropdown-button/dropdown-button.js';
|
|
20
|
+
import { Input } from '@/input/input.js';
|
|
21
|
+
import { UrlField } from '@/url-field/url-field.js';
|
|
22
|
+
import { Field } from '@/field/field.js';
|
|
23
|
+
import { NumberField } from '@/number-field/number-field.js';
|
|
24
|
+
import { DatePicker } from '@/date-picker/date-picker.js';
|
|
25
|
+
import { TimePicker } from '@/time-picker/time-picker.js';
|
|
26
|
+
import { Textarea } from '@/textarea/textarea.js';
|
|
27
|
+
import { Switch } from '@/switch/switch.js';
|
|
28
|
+
import { Checkbox } from '@/checkbox/checkbox.js';
|
|
29
|
+
import { Radio } from '@/radio/radio.js';
|
|
2
30
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
31
|
+
import { Menu } from '@/menu/menu/menu.js';
|
|
32
|
+
import { MenuItem } from '@/menu/menu-item/menu-item.js';
|
|
33
|
+
import { SubMenu } from '@/menu/sub-menu/sub-menu.js';
|
|
34
|
+
import { Item } from '@/item/item.js';
|
|
35
|
+
import { List } from '@/list/list.js';
|
|
36
|
+
import { ListItem } from '@/list/list-item.js';
|
|
6
37
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import { Fab } from './fab/fab.js';
|
|
15
|
-
import { SegmentedButton } from './segmented-button/segmented-button.js';
|
|
16
|
-
import { SegmentedButtonGroup } from './segmented-button/segmented-button-group.js';
|
|
17
|
-
import { SplitButton } from './split-button/split-button.js';
|
|
18
|
-
import { DropdownButton } from './dropdown-button/dropdown-button.js';
|
|
19
|
-
import { Input } from './input/input.js';
|
|
20
|
-
import { UrlField } from './url-field/url-field.js';
|
|
21
|
-
import { Field } from './field/field.js';
|
|
22
|
-
import { NumberField } from './number-field/number-field.js';
|
|
23
|
-
import { DatePicker } from './date-picker/date-picker.js';
|
|
24
|
-
import { TimePicker } from './time-picker/time-picker.js';
|
|
25
|
-
import { Textarea } from './textarea/textarea.js';
|
|
26
|
-
import { Switch } from './switch/switch.js';
|
|
27
|
-
import { Checkbox } from './checkbox/checkbox.js';
|
|
28
|
-
import { Radio } from './radio/radio.js';
|
|
38
|
+
import { Accordion } from '@/accordion/accordion.js';
|
|
39
|
+
import { Link } from '@/link/link.js';
|
|
40
|
+
import { Tag } from '@/chip/tag/tag.js';
|
|
41
|
+
import { Chip } from '@/chip/chip/chip.js';
|
|
42
|
+
import { ChipSet } from '@/chip/chip-set/chip-set.js';
|
|
43
|
+
import { LinearProgress } from '@/progress/linear-progress/linear-progress.js';
|
|
44
|
+
import { CircularProgress } from '@/progress/circular-progress/circular-progress.js';
|
|
29
45
|
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { List } from './list/list.js';
|
|
35
|
-
import { ListItem } from './list/list-item.js';
|
|
46
|
+
import { Tooltip } from '@/tooltip/tooltip.js';
|
|
47
|
+
import { Popover } from '@/popover/popover.js';
|
|
48
|
+
import { PopoverContent } from '@/popover/popover-content.js';
|
|
49
|
+
import { Breadcrumb, BreadcrumbItem } from '@/breadcrumb/index.js';
|
|
36
50
|
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import { Tag } from './chip/tag/tag.js';
|
|
40
|
-
import { Chip } from './chip/chip/chip.js';
|
|
41
|
-
import { ChipSet } from './chip/chip-set/chip-set.js';
|
|
42
|
-
import { LinearProgress } from './progress/linear-progress/linear-progress.js';
|
|
43
|
-
import { CircularProgress } from './progress/circular-progress/circular-progress.js';
|
|
51
|
+
import { Skeleton } from '@/skeleton/skeleton.js';
|
|
52
|
+
import { Spinner } from '@/spinner/spinner.js';
|
|
44
53
|
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
54
|
+
import { EmptyState } from '@/empty-state/empty-state.js';
|
|
55
|
+
import { Container } from '@/container/container.js';
|
|
56
|
+
import { Image } from '@/image/image.js';
|
|
57
|
+
import { Svg } from '@/svg/svg.js';
|
|
49
58
|
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
59
|
+
import { TabGroup } from '@/tabs/tab-group.js';
|
|
60
|
+
import { Tabs } from '@/tabs/tabs.js';
|
|
61
|
+
import { Tab } from '@/tabs/tab.js';
|
|
62
|
+
import { TabPanel } from '@/tabs/tab-panel.js';
|
|
63
|
+
import { Slider } from '@/slider/slider.js';
|
|
64
|
+
import { Table } from '@/table/table.js';
|
|
65
|
+
import { Pagination } from '@/pagination/pagination.js';
|
|
66
|
+
import { SidebarMenu } from '@/sidebar-menu/sidebar-menu.js';
|
|
67
|
+
import { SidebarMenuItem } from '@/sidebar-menu/sidebar-menu-item.js';
|
|
68
|
+
import { SidebarSubMenu } from '@/sidebar-menu/sidebar-sub-menu.js';
|
|
69
|
+
import { Card } from '@/card/card.js';
|
|
70
|
+
import { CardContent } from '@/card/card-content.js';
|
|
71
|
+
import { Alert } from '@/alert/alert.js';
|
|
72
|
+
import { Notification } from '@/notification/notification.js';
|
|
73
|
+
import { NotificationManager } from '@/notification-manager/notification-manager.js';
|
|
74
|
+
import { Snackbar } from '@/snackbar/snackbar.js';
|
|
75
|
+
import { BottomSheet } from '@/bottom-sheet/bottom-sheet.js';
|
|
76
|
+
import { SideSheet } from '@/side-sheet/side-sheet.js';
|
|
77
|
+
import { Modal } from '@/modal/modal.js';
|
|
78
|
+
import { Select } from '@/select/select.js';
|
|
79
|
+
import { SelectOptionElement } from '@/select/option.js';
|
|
80
|
+
import { Search } from '@/search/search.js';
|
|
81
|
+
import { Toolbar } from '@/toolbar/toolbar.js';
|
|
82
|
+
import { AppBar } from '@/app-bar/app-bar.js';
|
|
83
|
+
import { NavigationRail } from '@/navigation-rail/navigation-rail.js';
|
|
84
|
+
import { NavigationRailItem } from '@/navigation-rail/navigation-rail-item.js';
|
|
52
85
|
|
|
53
|
-
|
|
54
|
-
import { Container } from './container/container.js';
|
|
55
|
-
import { Image } from './image/image.js';
|
|
56
|
-
import { Svg } from './svg/svg.js';
|
|
86
|
+
const distDirectory = `${import.meta.url}/..`;
|
|
57
87
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
import { TabGroup } from './tabs/tab-group.js';
|
|
61
|
-
import { Tabs } from './tabs/tabs.js';
|
|
62
|
-
import { Tab } from './tabs/tab.js';
|
|
63
|
-
import { TabPanel } from './tabs/tab-panel.js';
|
|
64
|
-
import { Slider } from './slider/slider.js';
|
|
65
|
-
import { Table } from './table/table.js';
|
|
66
|
-
import { Pagination } from './pagination/pagination.js';
|
|
67
|
-
import { SidebarMenu } from './sidebar-menu/sidebar-menu.js';
|
|
68
|
-
import { SidebarMenuItem } from './sidebar-menu/sidebar-menu-item.js';
|
|
69
|
-
import { SidebarSubMenu } from './sidebar-menu/sidebar-sub-menu.js';
|
|
70
|
-
import { Card } from './card/card.js';
|
|
71
|
-
import { CardContent } from './card/card-content.js';
|
|
72
|
-
import { Banner } from './banner/banner.js';
|
|
73
|
-
import { Notification } from './notification/notification.js';
|
|
74
|
-
import { NotificationManager } from './notification-manager/notification-manager.js';
|
|
75
|
-
import { Snackbar } from './snackbar/snackbar.js';
|
|
76
|
-
import { BottomSheet } from './bottom-sheet/bottom-sheet.js';
|
|
77
|
-
import { SideSheet } from './side-sheet/side-sheet.js';
|
|
78
|
-
import { Modal } from './modal/modal.js';
|
|
79
|
-
import { Select } from './select/select.js';
|
|
80
|
-
import { SelectOptionElement } from './select/option.js';
|
|
81
|
-
import { Search } from './search/search.js';
|
|
82
|
-
import { Toolbar } from './toolbar/toolbar.js';
|
|
83
|
-
import { NavigationRail } from './navigation-rail/navigation-rail.js';
|
|
84
|
-
import { NavigationRailItem } from './navigation-rail/navigation-rail-item.js';
|
|
88
|
+
const url = new URL(import.meta.url);
|
|
89
|
+
const params = url.searchParams;
|
|
85
90
|
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
// Example: accessing app.js?theme=dark&user=123
|
|
92
|
+
const includeStyles = params.has('styles');
|
|
93
|
+
|
|
94
|
+
if (includeStyles) {
|
|
95
|
+
await loadCSS(`${distDirectory}/assets/styles.css`);
|
|
96
|
+
}
|
|
88
97
|
|
|
89
98
|
/*
|
|
90
99
|
import tooltipStyles from './popover/tooltip.css-component.scss';
|
|
@@ -190,8 +199,8 @@ const loaderConfig: LoaderConfig = {
|
|
|
190
199
|
'wc-card-content': {
|
|
191
200
|
CustomElementClass: CardContent,
|
|
192
201
|
},
|
|
193
|
-
'wc-
|
|
194
|
-
CustomElementClass:
|
|
202
|
+
'wc-alert': {
|
|
203
|
+
CustomElementClass: Alert,
|
|
195
204
|
},
|
|
196
205
|
'wc-notification': {
|
|
197
206
|
CustomElementClass: Notification,
|
|
@@ -345,6 +354,9 @@ const loaderConfig: LoaderConfig = {
|
|
|
345
354
|
'wc-toolbar': {
|
|
346
355
|
CustomElementClass: Toolbar,
|
|
347
356
|
},
|
|
357
|
+
'wc-app-bar': {
|
|
358
|
+
CustomElementClass: AppBar,
|
|
359
|
+
},
|
|
348
360
|
'wc-navigation-rail': {
|
|
349
361
|
CustomElementClass: NavigationRail,
|
|
350
362
|
},
|
package/src/menu/menu/menu.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use '../../../scss/mixin';
|
|
2
2
|
|
|
3
3
|
@include mixin.base-styles;
|
|
4
4
|
|
|
@@ -18,9 +18,11 @@
|
|
|
18
18
|
--_menu-exit-easing: cubic-bezier(0.3, 0, 0.8, 0.15);
|
|
19
19
|
|
|
20
20
|
transition-property: opacity, transform, visibility;
|
|
21
|
-
transition-duration:
|
|
21
|
+
transition-duration:
|
|
22
|
+
var(--_menu-exit-duration), var(--_menu-exit-duration), 0ms;
|
|
22
23
|
transition-delay: 0ms, 0ms, var(--_menu-exit-duration);
|
|
23
|
-
transition-timing-function:
|
|
24
|
+
transition-timing-function:
|
|
25
|
+
var(--_menu-exit-easing), var(--_menu-exit-easing), linear;
|
|
24
26
|
|
|
25
27
|
&.closed {
|
|
26
28
|
opacity: 0;
|
|
@@ -34,9 +36,11 @@
|
|
|
34
36
|
visibility: visible;
|
|
35
37
|
pointer-events: auto;
|
|
36
38
|
transform: translateY(0) scale(1);
|
|
37
|
-
transition-duration:
|
|
39
|
+
transition-duration:
|
|
40
|
+
var(--_menu-enter-duration), var(--_menu-enter-duration), 0ms;
|
|
38
41
|
transition-delay: 0ms, 0ms, 0ms;
|
|
39
|
-
transition-timing-function:
|
|
42
|
+
transition-timing-function:
|
|
43
|
+
var(--_menu-enter-easing), var(--_menu-enter-easing), linear;
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
&.preview {
|
|
@@ -69,10 +73,7 @@
|
|
|
69
73
|
.background {
|
|
70
74
|
display: block;
|
|
71
75
|
position: absolute;
|
|
72
|
-
|
|
73
|
-
top: 0;
|
|
74
|
-
width: 100%;
|
|
75
|
-
height: 100%;
|
|
76
|
+
inset: 0;
|
|
76
77
|
background-color: var(--_container-color);
|
|
77
78
|
opacity: var(--_container-opacity, 1);
|
|
78
79
|
|
|
@@ -86,7 +87,9 @@
|
|
|
86
87
|
.elevation {
|
|
87
88
|
--elevation-level: 2;
|
|
88
89
|
transition-duration: 280ms;
|
|
89
|
-
--elevation-container-shape-start-start: var(
|
|
90
|
+
--elevation-container-shape-start-start: var(
|
|
91
|
+
--_container-shape-start-start
|
|
92
|
+
);
|
|
90
93
|
--elevation-container-shape-start-end: var(--_container-shape-start-end);
|
|
91
94
|
--elevation-container-shape-end-start: var(--_container-shape-end-start);
|
|
92
95
|
--elevation-container-shape-end-end: var(--_container-shape-end-end);
|
|
@@ -101,7 +104,7 @@
|
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
.menu {
|
|
107
|
+
.menu {
|
|
105
108
|
--_container-shape-start-start: var(--shape-corner-large);
|
|
106
109
|
--_container-shape-start-end: var(--shape-corner-large);
|
|
107
110
|
--_container-shape-end-start: var(--shape-corner-large);
|
package/src/menu/menu/menu.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { property, query, state } from 'lit/decorators.js';
|
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import type { Placement } from '@floating-ui/dom';
|
|
5
5
|
import styles from './menu.scss';
|
|
6
|
-
import { FloatingController } from '../../
|
|
6
|
+
import { FloatingController } from '../../__internal/controllers/floating-controller.js';
|
|
7
7
|
import { MenuItem } from '../menu-item/menu-item.js';
|
|
8
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
8
9
|
|
|
9
10
|
type CloseReason =
|
|
10
11
|
| { kind: 'click-selection' }
|
|
@@ -28,43 +29,56 @@ type CloseReason =
|
|
|
28
29
|
* </wc-menu>
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
32
|
+
@IndividualComponent
|
|
31
33
|
export class Menu extends LitElement {
|
|
32
34
|
static styles = [styles];
|
|
33
35
|
|
|
34
36
|
static Item = MenuItem;
|
|
35
37
|
|
|
38
|
+
/** Whether the menu is currently visible. */
|
|
36
39
|
@property({ type: Boolean, reflect: true }) open = false;
|
|
37
40
|
|
|
41
|
+
/** Visual variant of the menu. `"vibrant"` applies stronger color emphasis. */
|
|
38
42
|
@property({ type: String, reflect: true }) variant: 'standard' | 'vibrant' =
|
|
39
43
|
'standard';
|
|
40
44
|
|
|
45
|
+
/** ID of the anchor element the menu is positioned relative to. */
|
|
41
46
|
@property({ type: String }) anchor = '';
|
|
42
47
|
|
|
48
|
+
/** When true, renders the menu in a static preview state (always visible, no animation). */
|
|
43
49
|
@property({ type: Boolean, reflect: true }) preview = false;
|
|
44
50
|
|
|
51
|
+
/** When true, the menu will not close when a click occurs outside it. */
|
|
45
52
|
@property({ type: Boolean, attribute: 'stay-open-on-outside-click' })
|
|
46
53
|
stayOpenOnOutsideClick = false;
|
|
47
54
|
|
|
55
|
+
/** When true, the menu will not close when focus leaves it. */
|
|
48
56
|
@property({ type: Boolean, attribute: 'stay-open-on-focusout' })
|
|
49
57
|
stayOpenOnFocusout = false;
|
|
50
58
|
|
|
59
|
+
/** Set to true when this menu is being used as a submenu inside another menu. */
|
|
51
60
|
@property({ type: Boolean, attribute: 'is-submenu' }) isSubmenu = false;
|
|
52
61
|
|
|
62
|
+
/** Floating UI placement of the menu relative to its anchor. */
|
|
53
63
|
@property({ type: String }) placement: Placement = 'bottom-start';
|
|
54
64
|
|
|
65
|
+
/** Distance in pixels between the menu and its anchor element. */
|
|
55
66
|
@property({ type: Number }) offset = 6;
|
|
56
67
|
|
|
68
|
+
/** Index of the currently focused/active item within the enabled items list. */
|
|
57
69
|
@state() private activeIndex = -1;
|
|
58
70
|
|
|
59
71
|
@query('.menu') private readonly menuListElement!: HTMLElement;
|
|
60
72
|
|
|
73
|
+
/** Direct reference to the anchor element; takes precedence over the `anchor` ID property. */
|
|
61
74
|
anchorElement: HTMLElement | null = null;
|
|
62
75
|
|
|
76
|
+
/** Controller managing floating-UI positioning. */
|
|
63
77
|
private readonly _floatingController = new FloatingController(this, {
|
|
64
78
|
trigger: 'manual',
|
|
65
79
|
closeOnClickOutside: false,
|
|
66
80
|
strategy: 'fixed',
|
|
67
|
-
onOpenChange:
|
|
81
|
+
onOpenChange: isOpen => {
|
|
68
82
|
if (isOpen || !this.open) {
|
|
69
83
|
return;
|
|
70
84
|
}
|
|
@@ -73,8 +87,10 @@ export class Menu extends LitElement {
|
|
|
73
87
|
},
|
|
74
88
|
});
|
|
75
89
|
|
|
90
|
+
/** Element that had focus before the menu opened; restored on close. */
|
|
76
91
|
private _lastFocusedElement: HTMLElement | null = null;
|
|
77
92
|
|
|
93
|
+
/** Reason that triggered the most recent close, included in the `closed` event detail. */
|
|
78
94
|
private _closeReason: CloseReason = { kind: 'programmatic' };
|
|
79
95
|
|
|
80
96
|
connectedCallback() {
|
|
@@ -234,9 +250,7 @@ export class Menu extends LitElement {
|
|
|
234
250
|
|
|
235
251
|
private _isEventFromThisMenu(event: Event) {
|
|
236
252
|
const path = event.composedPath();
|
|
237
|
-
const sourceMenu = path.find(
|
|
238
|
-
target => target instanceof Menu,
|
|
239
|
-
);
|
|
253
|
+
const sourceMenu = path.find(target => target instanceof Menu);
|
|
240
254
|
|
|
241
255
|
return sourceMenu === this;
|
|
242
256
|
}
|
|
@@ -358,8 +372,6 @@ export class Menu extends LitElement {
|
|
|
358
372
|
}
|
|
359
373
|
};
|
|
360
374
|
|
|
361
|
-
|
|
362
|
-
|
|
363
375
|
private _onSlotChange = () => {
|
|
364
376
|
this._syncRovingTabIndex();
|
|
365
377
|
};
|
|
@@ -446,7 +458,7 @@ export class Menu extends LitElement {
|
|
|
446
458
|
render() {
|
|
447
459
|
return html`<div
|
|
448
460
|
class=${classMap({
|
|
449
|
-
|
|
461
|
+
menu: true,
|
|
450
462
|
open: !this.preview && this.open,
|
|
451
463
|
closed: !this.preview && !this.open,
|
|
452
464
|
preview: this.preview,
|