@redvars/peacock 3.8.1 → 3.8.3
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/babel-DBsfpl3B.js +18 -0
- package/dist/babel-DBsfpl3B.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 +45 -52
- 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 +82 -11216
- package/dist/code-highlighter.js.map +1 -1
- package/dist/color-picker.js +701 -0
- package/dist/color-picker.js.map +1 -0
- 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 +823 -778
- package/dist/custom-elements.json +4067 -2207
- 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/estree-C2LDzX4U.js +47 -0
- package/dist/estree-C2LDzX4U.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 +139 -148
- 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-D22sQuVy.js +27 -0
- package/dist/html-D22sQuVy.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-_g_oLekF.js +14095 -0
- package/dist/index-_g_oLekF.js.map +1 -0
- package/dist/index.js +74 -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 +213 -0
- package/dist/item.js.map +1 -0
- package/dist/link.js +75 -0
- package/dist/link.js.map +1 -0
- package/dist/list-H0itjRte.js +526 -0
- package/dist/list-H0itjRte.js.map +1 -0
- package/dist/list.js +14 -0
- package/dist/list.js.map +1 -0
- package/dist/{peacock-loader.js → loader.js} +87 -22
- package/dist/loader.js.map +1 -0
- package/dist/menu-item.js +388 -0
- package/dist/menu-item.js.map +1 -0
- package/dist/menu.js +520 -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 +400 -0
- package/dist/navigation-rail-item.js.map +1 -0
- package/dist/navigation-rail.js +219 -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/pierre-dark-DFWl0m-C.js +4 -0
- package/dist/pierre-dark-DFWl0m-C.js.map +1 -0
- package/dist/pierre-light-BEkAPImt.js +4 -0
- package/dist/pierre-light-BEkAPImt.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/postcss-BhbitHaI.js +64 -0
- package/dist/postcss-BhbitHaI.js.map +1 -0
- 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-CspawZ18.js +3944 -0
- package/dist/select-CspawZ18.js.map +1 -0
- package/dist/side-sheet.js +9 -5
- 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/code-highlighter/code-highlighter.d.ts +2 -2
- package/dist/src/color-picker/color-picker.d.ts +85 -0
- package/dist/src/color-picker/index.d.ts +1 -0
- 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 +8 -6
- package/dist/src/item/item.d.ts +19 -29
- package/dist/src/link/link.d.ts +1 -1
- package/dist/src/list/list-item.d.ts +10 -6
- package/dist/src/list/list.d.ts +27 -2
- package/dist/src/menu/menu/menu.d.ts +14 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +11 -4
- 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/standalone-Ccq0tWwA.js +32 -0
- package/dist/standalone-Ccq0tWwA.js.map +1 -0
- 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 +246 -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 +4 -4
- package/scss/mixin.scss +9 -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 +307 -0
- package/src/button/button/button-colors.scss +27 -32
- package/src/button/button/button-layers.scss +126 -43
- 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 -109
- 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 +21 -8
- 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 +95 -40
- package/src/code-highlighter/demo/index.html +24 -21
- package/src/color-picker/color-picker.scss +217 -0
- package/src/color-picker/color-picker.ts +478 -0
- package/src/color-picker/index.ts +1 -0
- 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 +25 -6
- package/src/input/input.ts +2 -2
- package/src/item/item.scss +127 -161
- package/src/item/item.ts +69 -323
- package/src/link/link.ts +3 -1
- package/src/list/list-item.scss +48 -32
- package/src/list/list-item.ts +109 -79
- package/src/list/list.scss +1 -13
- package/src/list/list.ts +170 -5
- package/src/{peacock-loader.ts → loader.ts} +95 -79
- package/src/menu/menu/menu.scss +15 -26
- package/src/menu/menu/menu.ts +20 -9
- package/src/menu/menu-item/menu-item.scss +82 -20
- package/src/menu/menu-item/menu-item.ts +85 -46
- package/src/menu/sub-menu/sub-menu.scss +5 -1
- package/src/menu/sub-menu/sub-menu.ts +3 -0
- package/src/modal/modal.ts +2 -2
- package/src/navigation-rail/navigation-rail-item.scss +25 -8
- package/src/navigation-rail/navigation-rail-item.ts +21 -36
- package/src/navigation-rail/navigation-rail.scss +25 -21
- 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 +3 -3
- package/src/sidebar-menu/sidebar-menu-item.scss +12 -6
- 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
|
@@ -1,90 +1,100 @@
|
|
|
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 { ColorPicker } from '@/color-picker/color-picker.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 { Alert } from '@/alert/alert.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 { AppBar } from '@/app-bar/app-bar.js';
|
|
84
|
+
import { NavigationRail } from '@/navigation-rail/navigation-rail.js';
|
|
85
|
+
import { NavigationRailItem } from '@/navigation-rail/navigation-rail-item.js';
|
|
52
86
|
|
|
53
|
-
|
|
54
|
-
import { Container } from './container/container.js';
|
|
55
|
-
import { Image } from './image/image.js';
|
|
56
|
-
import { Svg } from './svg/svg.js';
|
|
87
|
+
const distDirectory = `${import.meta.url}/..`;
|
|
57
88
|
|
|
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';
|
|
89
|
+
const url = new URL(import.meta.url);
|
|
90
|
+
const params = url.searchParams;
|
|
85
91
|
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
// Example: accessing app.js?theme=dark&user=123
|
|
93
|
+
const includeStyles = params.has('styles');
|
|
94
|
+
|
|
95
|
+
if (includeStyles) {
|
|
96
|
+
await loadCSS(`${distDirectory}/assets/styles.css`);
|
|
97
|
+
}
|
|
88
98
|
|
|
89
99
|
/*
|
|
90
100
|
import tooltipStyles from './popover/tooltip.css-component.scss';
|
|
@@ -190,8 +200,8 @@ const loaderConfig: LoaderConfig = {
|
|
|
190
200
|
'wc-card-content': {
|
|
191
201
|
CustomElementClass: CardContent,
|
|
192
202
|
},
|
|
193
|
-
'wc-
|
|
194
|
-
CustomElementClass:
|
|
203
|
+
'wc-alert': {
|
|
204
|
+
CustomElementClass: Alert,
|
|
195
205
|
},
|
|
196
206
|
'wc-notification': {
|
|
197
207
|
CustomElementClass: Notification,
|
|
@@ -306,6 +316,9 @@ const loaderConfig: LoaderConfig = {
|
|
|
306
316
|
'wc-slider': {
|
|
307
317
|
CustomElementClass: Slider,
|
|
308
318
|
},
|
|
319
|
+
'wc-color-picker': {
|
|
320
|
+
CustomElementClass: ColorPicker,
|
|
321
|
+
},
|
|
309
322
|
'wc-table': {
|
|
310
323
|
CustomElementClass: Table,
|
|
311
324
|
},
|
|
@@ -345,6 +358,9 @@ const loaderConfig: LoaderConfig = {
|
|
|
345
358
|
'wc-toolbar': {
|
|
346
359
|
CustomElementClass: Toolbar,
|
|
347
360
|
},
|
|
361
|
+
'wc-app-bar': {
|
|
362
|
+
CustomElementClass: AppBar,
|
|
363
|
+
},
|
|
348
364
|
'wc-navigation-rail': {
|
|
349
365
|
CustomElementClass: NavigationRail,
|
|
350
366
|
},
|
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
|
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
width: var(--menu-width, max-content);
|
|
10
10
|
max-width: 100vw;
|
|
11
11
|
min-width: 112px;
|
|
12
|
-
padding-block: var(--spacing-050);
|
|
13
12
|
transform-origin: top center;
|
|
14
13
|
|
|
15
14
|
--_menu-enter-duration: var(--duration-medium1);
|
|
@@ -18,9 +17,11 @@
|
|
|
18
17
|
--_menu-exit-easing: cubic-bezier(0.3, 0, 0.8, 0.15);
|
|
19
18
|
|
|
20
19
|
transition-property: opacity, transform, visibility;
|
|
21
|
-
transition-duration:
|
|
20
|
+
transition-duration:
|
|
21
|
+
var(--_menu-exit-duration), var(--_menu-exit-duration), 0ms;
|
|
22
22
|
transition-delay: 0ms, 0ms, var(--_menu-exit-duration);
|
|
23
|
-
transition-timing-function:
|
|
23
|
+
transition-timing-function:
|
|
24
|
+
var(--_menu-exit-easing), var(--_menu-exit-easing), linear;
|
|
24
25
|
|
|
25
26
|
&.closed {
|
|
26
27
|
opacity: 0;
|
|
@@ -34,9 +35,11 @@
|
|
|
34
35
|
visibility: visible;
|
|
35
36
|
pointer-events: auto;
|
|
36
37
|
transform: translateY(0) scale(1);
|
|
37
|
-
transition-duration:
|
|
38
|
+
transition-duration:
|
|
39
|
+
var(--_menu-enter-duration), var(--_menu-enter-duration), 0ms;
|
|
38
40
|
transition-delay: 0ms, 0ms, 0ms;
|
|
39
|
-
transition-timing-function:
|
|
41
|
+
transition-timing-function:
|
|
42
|
+
var(--_menu-enter-easing), var(--_menu-enter-easing), linear;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
&.preview {
|
|
@@ -47,7 +50,6 @@
|
|
|
47
50
|
.menu-content {
|
|
48
51
|
display: flex;
|
|
49
52
|
flex-direction: column;
|
|
50
|
-
gap: var(--spacing-050);
|
|
51
53
|
z-index: 1;
|
|
52
54
|
width: 100%;
|
|
53
55
|
|
|
@@ -69,12 +71,9 @@
|
|
|
69
71
|
.background {
|
|
70
72
|
display: block;
|
|
71
73
|
position: absolute;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
height: 100%;
|
|
76
|
-
background-color: var(--_container-color);
|
|
77
|
-
opacity: var(--_container-opacity, 1);
|
|
74
|
+
inset: 0;
|
|
75
|
+
|
|
76
|
+
border: 1px solid var(--color-red);
|
|
78
77
|
|
|
79
78
|
border-start-start-radius: var(--_container-shape-start-start);
|
|
80
79
|
border-start-end-radius: var(--_container-shape-start-end);
|
|
@@ -82,16 +81,6 @@
|
|
|
82
81
|
border-end-end-radius: var(--_container-shape-end-end);
|
|
83
82
|
pointer-events: none;
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
.elevation {
|
|
87
|
-
--elevation-level: 2;
|
|
88
|
-
transition-duration: 280ms;
|
|
89
|
-
--elevation-container-shape-start-start: var(--_container-shape-start-start);
|
|
90
|
-
--elevation-container-shape-start-end: var(--_container-shape-start-end);
|
|
91
|
-
--elevation-container-shape-end-start: var(--_container-shape-end-start);
|
|
92
|
-
--elevation-container-shape-end-end: var(--_container-shape-end-end);
|
|
93
|
-
--elevation-container-shape-variant: var(--_container-corner-shape-variant);
|
|
94
|
-
}
|
|
95
84
|
}
|
|
96
85
|
|
|
97
86
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -101,17 +90,17 @@
|
|
|
101
90
|
}
|
|
102
91
|
}
|
|
103
92
|
|
|
104
|
-
.menu {
|
|
93
|
+
.menu {
|
|
105
94
|
--_container-shape-start-start: var(--shape-corner-large);
|
|
106
95
|
--_container-shape-start-end: var(--shape-corner-large);
|
|
107
96
|
--_container-shape-end-start: var(--shape-corner-large);
|
|
108
97
|
--_container-shape-end-end: var(--shape-corner-large);
|
|
109
98
|
|
|
110
99
|
&.variant-standard {
|
|
111
|
-
--
|
|
100
|
+
--menu-item-container-color: var(--color-surface-container);
|
|
112
101
|
}
|
|
113
102
|
|
|
114
103
|
&.variant-vibrant {
|
|
115
|
-
--
|
|
104
|
+
--menu-item-container-color: var(--color-tertiary-container);
|
|
116
105
|
}
|
|
117
106
|
}
|
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,
|
|
@@ -455,7 +467,6 @@ export class Menu extends LitElement {
|
|
|
455
467
|
aria-hidden=${String(!this.open)}
|
|
456
468
|
>
|
|
457
469
|
<div class="background"></div>
|
|
458
|
-
<wc-elevation class="elevation"></wc-elevation>
|
|
459
470
|
|
|
460
471
|
<div class="menu-content">
|
|
461
472
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use '../../../scss/mixin';
|
|
2
2
|
|
|
3
3
|
@include mixin.base-styles;
|
|
4
4
|
|
|
5
5
|
:host {
|
|
6
6
|
outline: none;
|
|
7
|
+
position: relative;
|
|
7
8
|
|
|
8
9
|
--menu-item-container-shape-start-start: var(--shape-corner-extra-small);
|
|
9
10
|
--menu-item-container-shape-start-end: var(--shape-corner-extra-small);
|
|
@@ -11,27 +12,88 @@
|
|
|
11
12
|
--menu-item-container-shape-end-end: var(--shape-corner-extra-small);
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
/*
|
|
16
|
+
* Reset native button/link styles
|
|
17
|
+
*/
|
|
18
|
+
.native-button {
|
|
19
|
+
@include mixin.reset-button-styles;
|
|
20
|
+
}
|
|
21
|
+
.native-link {
|
|
22
|
+
@include mixin.reset-link-styles;
|
|
23
|
+
}
|
|
24
|
+
|
|
14
25
|
.menu-item {
|
|
26
|
+
position: relative;
|
|
15
27
|
width: 100%;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
text-align: start;
|
|
29
|
+
padding-top: 2px;
|
|
30
|
+
padding-inline: var(--spacing-050);
|
|
31
|
+
|
|
32
|
+
.menu-item-background {
|
|
33
|
+
background-color: var(--menu-item-container-color);
|
|
34
|
+
position: absolute;
|
|
35
|
+
inset: 0px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.menu-item-content {
|
|
39
|
+
--item-height: 1.5rem;
|
|
40
|
+
--item-multiline-height: 3rem;
|
|
41
|
+
--item-padding-inline: 10px;
|
|
42
|
+
--item-container-shape-start-start: var(
|
|
43
|
+
--menu-item-container-shape-start-start
|
|
44
|
+
);
|
|
45
|
+
--item-container-shape-start-end: var(
|
|
46
|
+
--menu-item-container-shape-start-end
|
|
47
|
+
);
|
|
48
|
+
--item-container-shape-end-start: var(
|
|
49
|
+
--menu-item-container-shape-end-start
|
|
50
|
+
);
|
|
51
|
+
--item-container-shape-end-end: var(--menu-item-container-shape-end-end);
|
|
52
|
+
--item-container-shape-variant: none;
|
|
53
|
+
|
|
54
|
+
--item-label-font-family: var(--typography-label-large-font-family);
|
|
55
|
+
--item-label-font-size: var(--typography-label-large-font-size);
|
|
56
|
+
--item-label-font-weight: var(--typography-label-large-font-weight);
|
|
57
|
+
--item-label-line-height: var(--typography-label-large-line-height);
|
|
58
|
+
--item-label-letter-spacing: var(--typography-label-large-letter-spacing);
|
|
59
|
+
|
|
60
|
+
--item-label-text-color: var(--menu-item-label-color);
|
|
61
|
+
--item-leading-trailing-color: var(--menu-item-label-color);
|
|
62
|
+
--item-supporting-text-color: var(--menu-item-label-color);
|
|
63
|
+
--item-container-selected-color: var(--menu-item-container-selected-color);
|
|
64
|
+
--item-label-text-selected-color: var(--menu-item-label-selected-color);
|
|
65
|
+
--item-icon-size: var(--button-icon-size, var(--_button-icon-size));
|
|
66
|
+
|
|
67
|
+
.background {
|
|
68
|
+
background-color: var(--menu-item-container-color);
|
|
69
|
+
opacity: var(--_container-opacity, 1);
|
|
70
|
+
border-radius: var(--shape-corner-medium);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.focus-ring {
|
|
74
|
+
--focus-ring-container-shape-start-start: var(--shape-corner-medium);
|
|
75
|
+
--focus-ring-container-shape-start-end: var(--shape-corner-medium);
|
|
76
|
+
--focus-ring-container-shape-end-start: var(--shape-corner-medium);
|
|
77
|
+
--focus-ring-container-shape-end-end: var(--shape-corner-medium);
|
|
78
|
+
z-index: 2;
|
|
79
|
+
--focus-ring-inset: 0px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ripple {
|
|
83
|
+
--ripple-state-opacity: var(--_container-state-opacity, 0);
|
|
84
|
+
--ripple-pressed-color: var(--_container-state-color);
|
|
85
|
+
border-radius: var(--shape-corner-medium);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.skeleton {
|
|
89
|
+
z-index: 2;
|
|
90
|
+
|
|
91
|
+
--skeleton-container-shape-start-start: var(--shape-corner-medium);
|
|
92
|
+
--skeleton-container-shape-start-end: var(--shape-corner-medium);
|
|
93
|
+
--skeleton-container-shape-end-start: var(--shape-corner-medium);
|
|
94
|
+
--skeleton-container-shape-end-end: var(--shape-corner-medium);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
35
97
|
}
|
|
36
98
|
|
|
37
99
|
:host([selected]) {
|