@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
|
@@ -3,22 +3,28 @@ 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 { when } from 'lit/directives/when.js';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import colorStyles from '../button/button-colors.scss';
|
|
9
|
-
import sizeStyles from './icon-button-sizes.scss';
|
|
10
|
-
import { spread } from '@/__directive/spread.js';
|
|
11
|
-
import { throttle } from '@/__utils/throttle.js';
|
|
12
|
-
import { isLink } from '@/__utils/is-link.js';
|
|
13
|
-
import { observerSlotChangesWithCallback } from '@/__utils/observe-slot-change.js';
|
|
6
|
+
import styles from './icon-button.scss';
|
|
7
|
+
import { isLink } from '@/__internal/utils/is-link.js';
|
|
14
8
|
import {
|
|
15
9
|
dispatchActivationClick,
|
|
16
10
|
isActivationClick,
|
|
17
|
-
} from '@/
|
|
18
|
-
import NativeButtonMixin from '@/__mixins/NativeButtonMixin.js';
|
|
19
|
-
import NativeHyperlinkMixin from '@/__mixins/NativeHyperlinkMixin.js';
|
|
20
|
-
import { GroupButtonInterface } from '@/button/GroupButtonInterface.js';
|
|
11
|
+
} from '@/__internal/utils/dispatch-event-utils.js';
|
|
21
12
|
import { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';
|
|
13
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
14
|
+
import { mixinBaseButton } from '../base-button/base-button.js';
|
|
15
|
+
import { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';
|
|
16
|
+
import { mixinDelegatesAria } from '@/__internal/aria/delegate.js';
|
|
17
|
+
import { mixinFormSubmitter } from '@/__internal/mixins/form-submitter.js';
|
|
18
|
+
import { mixinFormAssociated } from '@/__internal/mixins/form-associated.js';
|
|
19
|
+
import { mixinElementInternals } from '@/__internal/mixins/element-internals.js';
|
|
20
|
+
import { ARIAMixinStrict } from '@/__internal/aria/aria.js';
|
|
21
|
+
import type {
|
|
22
|
+
ButtonColor,
|
|
23
|
+
ButtonLevel,
|
|
24
|
+
ButtonShape,
|
|
25
|
+
ButtonSize,
|
|
26
|
+
ButtonVariant,
|
|
27
|
+
} from '@/button/ButtonTypes.js';
|
|
22
28
|
|
|
23
29
|
/**
|
|
24
30
|
* @label Icon Button
|
|
@@ -63,23 +69,40 @@ import { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';
|
|
|
63
69
|
* ```
|
|
64
70
|
* @tags display
|
|
65
71
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
@IndividualComponent
|
|
73
|
+
export class IconButton extends mixinBaseButton(
|
|
74
|
+
mixinHyperlink(
|
|
75
|
+
mixinDelegatesAria(
|
|
76
|
+
mixinFormSubmitter(
|
|
77
|
+
mixinFormAssociated(mixinElementInternals(LitElement)),
|
|
78
|
+
),
|
|
79
|
+
),
|
|
80
|
+
),
|
|
81
|
+
) {
|
|
82
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
83
|
+
|
|
84
|
+
/** @nocollapse */ // eslint-disable-next-line
|
|
85
|
+
static override shadowRootOptions: ShadowRootInit = {
|
|
86
|
+
mode: 'open',
|
|
87
|
+
delegatesFocus: true,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
static override styles = [styles];
|
|
71
91
|
|
|
72
92
|
/**
|
|
73
93
|
* Button size.
|
|
74
94
|
* Possible values are `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`. Defaults to `"sm"`.
|
|
75
95
|
*/
|
|
76
|
-
@property({ reflect: true }) size:
|
|
96
|
+
@property({ reflect: true }) size: ButtonSize = 'sm';
|
|
77
97
|
|
|
78
98
|
/**
|
|
79
99
|
* Type is preset of color and variant. Type will be only applied.
|
|
80
100
|
*
|
|
81
101
|
*/
|
|
82
|
-
@property({ type: String })
|
|
102
|
+
@property({ type: String }) level?: ButtonLevel;
|
|
103
|
+
|
|
104
|
+
/** Shape of the button container. */
|
|
105
|
+
@property({ type: String, reflect: true }) shape?: ButtonShape = 'square';
|
|
83
106
|
|
|
84
107
|
/**
|
|
85
108
|
* The visual style of the button.
|
|
@@ -91,75 +114,32 @@ export class IconButton
|
|
|
91
114
|
* `"tonal"` is a light color button.
|
|
92
115
|
* `"elevated"` is elevated button
|
|
93
116
|
*/
|
|
94
|
-
@property({ reflect: true }) variant:
|
|
95
|
-
| 'elevated'
|
|
96
|
-
| 'filled'
|
|
97
|
-
| 'tonal'
|
|
98
|
-
| 'outlined'
|
|
99
|
-
| 'text'
|
|
100
|
-
| 'neo' = 'filled';
|
|
117
|
+
@property({ reflect: true }) variant: ButtonVariant = 'filled';
|
|
101
118
|
|
|
102
119
|
/**
|
|
103
120
|
* Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.
|
|
104
121
|
*/
|
|
105
|
-
@property({ reflect: true }) color:
|
|
106
|
-
| 'primary'
|
|
107
|
-
| 'success'
|
|
108
|
-
| 'danger'
|
|
109
|
-
| 'warning'
|
|
110
|
-
| 'surface'
|
|
111
|
-
| 'on-surface' = 'primary';
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Additional ARIA attributes to pass to the inner button/anchor element.
|
|
115
|
-
*/
|
|
116
|
-
@property({ reflect: true })
|
|
117
|
-
configAria?: { [key: string]: any };
|
|
122
|
+
@property({ reflect: true }) color: ButtonColor = 'primary';
|
|
118
123
|
|
|
124
|
+
/** When true, renders the button in a loading skeleton state. */
|
|
119
125
|
@property({ type: Boolean, reflect: true }) skeleton: boolean = false;
|
|
120
126
|
|
|
127
|
+
/** When true, the button acts as a toggle. Use with `selected`. */
|
|
121
128
|
@property({ type: Boolean, reflect: true }) toggle: boolean = false;
|
|
122
129
|
|
|
130
|
+
/** When true (and `toggle` is set), the button is in the selected/pressed state. */
|
|
123
131
|
@property({ type: Boolean, reflect: true }) selected: boolean = false;
|
|
124
132
|
|
|
125
|
-
/**
|
|
126
|
-
* Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
|
|
127
|
-
*/
|
|
128
|
-
@property() throttleDelay = 200;
|
|
129
|
-
|
|
133
|
+
/** Optional tooltip text displayed on hover. */
|
|
130
134
|
@property() tooltip?: string;
|
|
131
135
|
|
|
132
|
-
@property({ type: Boolean, reflect: true })
|
|
133
|
-
pressed = false;
|
|
134
|
-
|
|
135
136
|
@query('.button') readonly buttonElement!: HTMLElement | null;
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
super
|
|
138
|
+
constructor() {
|
|
139
|
+
super();
|
|
139
140
|
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
140
|
-
window.addEventListener('mouseup', this.__handlePress);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
override disconnectedCallback() {
|
|
144
|
-
window.removeEventListener('mouseup', this.__handlePress);
|
|
145
|
-
this.removeEventListener('click', this.__dispatchClickWithThrottle);
|
|
146
|
-
super.disconnectedCallback();
|
|
147
141
|
}
|
|
148
142
|
|
|
149
|
-
__handlePress = (event: KeyboardEvent | MouseEvent) => {
|
|
150
|
-
if (this.disabled || this.skeleton || this.softDisabled) return;
|
|
151
|
-
this.pressed =
|
|
152
|
-
(event instanceof KeyboardEvent &&
|
|
153
|
-
event.type === 'keydown' &&
|
|
154
|
-
(event.key === 'Enter' || event.key === ' ')) ||
|
|
155
|
-
event.type === 'mousedown';
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
__dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void =
|
|
159
|
-
event => {
|
|
160
|
-
this.__dispatchClick(event);
|
|
161
|
-
};
|
|
162
|
-
|
|
163
143
|
__dispatchClick = (event: MouseEvent | KeyboardEvent) => {
|
|
164
144
|
// If the button is soft-disabled or a disabled link, we need to explicitly
|
|
165
145
|
// prevent the click from propagating to other event listeners as well as
|
|
@@ -174,34 +154,10 @@ export class IconButton
|
|
|
174
154
|
return;
|
|
175
155
|
}
|
|
176
156
|
|
|
177
|
-
if (this.toggle) {
|
|
178
|
-
this.selected = !this.selected;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
157
|
this.focus();
|
|
182
158
|
dispatchActivationClick(this.buttonElement);
|
|
183
159
|
};
|
|
184
160
|
|
|
185
|
-
__renderDisabledReason(softDisabled: boolean) {
|
|
186
|
-
if (softDisabled)
|
|
187
|
-
return html`<div
|
|
188
|
-
id=${DISABLED_REASON_ID}
|
|
189
|
-
role="tooltip"
|
|
190
|
-
aria-label=${this.disabledReason}
|
|
191
|
-
class="screen-reader-only"
|
|
192
|
-
>
|
|
193
|
-
${this.disabledReason}
|
|
194
|
-
</div>`;
|
|
195
|
-
return nothing;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
__renderTooltip() {
|
|
199
|
-
if (this.tooltip) {
|
|
200
|
-
return html`<wc-tooltip class="tooltip" for="button">${this.tooltip}</wc-tooltip>`;
|
|
201
|
-
}
|
|
202
|
-
return nothing;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
161
|
override focus() {
|
|
206
162
|
this.buttonElement?.focus();
|
|
207
163
|
}
|
|
@@ -210,11 +166,8 @@ export class IconButton
|
|
|
210
166
|
this.buttonElement?.blur();
|
|
211
167
|
}
|
|
212
168
|
|
|
213
|
-
override firstUpdated() {
|
|
214
|
-
|
|
215
|
-
this.__dispatchClick,
|
|
216
|
-
this.throttleDelay,
|
|
217
|
-
);
|
|
169
|
+
override firstUpdated(changedProperties: Map<PropertyKey, unknown>) {
|
|
170
|
+
super.firstUpdated(changedProperties);
|
|
218
171
|
this.__convertTypeToVariantAndColor();
|
|
219
172
|
}
|
|
220
173
|
|
|
@@ -234,85 +187,102 @@ export class IconButton
|
|
|
234
187
|
}
|
|
235
188
|
}
|
|
236
189
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
)}
|
|
250
|
-
<wc-ripple class="ripple" for="button"></wc-ripple>
|
|
251
|
-
<wc-skeleton class="skeleton"></wc-skeleton>
|
|
190
|
+
renderDisabledReason(softDisabled: boolean) {
|
|
191
|
+
if (softDisabled)
|
|
192
|
+
return html`<div
|
|
193
|
+
id=${DISABLED_REASON_ID}
|
|
194
|
+
role="tooltip"
|
|
195
|
+
aria-label=${this.disabledReason}
|
|
196
|
+
class="screen-reader-only"
|
|
197
|
+
>
|
|
198
|
+
${this.disabledReason}
|
|
199
|
+
</div>`;
|
|
200
|
+
return nothing;
|
|
201
|
+
}
|
|
252
202
|
|
|
253
|
-
|
|
203
|
+
renderTooltip() {
|
|
204
|
+
if (this.tooltip) {
|
|
205
|
+
const buttonId = isLink(this) ? 'link' : 'button';
|
|
206
|
+
return html`<wc-tooltip class="tooltip" for=${buttonId}
|
|
207
|
+
>${this.tooltip}</wc-tooltip
|
|
208
|
+
>`;
|
|
209
|
+
}
|
|
210
|
+
return nothing;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
renderButtonContent() {
|
|
214
|
+
return html`
|
|
215
|
+
<slot class="icon-slot"></slot>
|
|
216
|
+
<div class="touch"></div>
|
|
217
|
+
${this.renderDisabledReason(this.softDisabled)}
|
|
254
218
|
`;
|
|
255
219
|
}
|
|
256
220
|
|
|
257
221
|
renderButtonElement() {
|
|
222
|
+
const isElementLink = isLink(this);
|
|
223
|
+
const { ariaLabel, ariaHasPopup, ariaExpanded } = this as ARIAMixinStrict;
|
|
224
|
+
|
|
258
225
|
const cssClasses = {
|
|
259
226
|
button: true,
|
|
260
|
-
'button
|
|
261
|
-
|
|
262
|
-
[`variant-${this.variant}`]: true,
|
|
263
|
-
[`color-${this.color}`]: true,
|
|
264
|
-
disabled: this.disabled || this.softDisabled,
|
|
265
|
-
pressed: this.pressed,
|
|
266
|
-
skeleton: this.skeleton,
|
|
227
|
+
'native-button': !isElementLink,
|
|
228
|
+
'native-link': isElementLink,
|
|
267
229
|
};
|
|
268
230
|
|
|
269
231
|
if (!isLink(this)) {
|
|
270
|
-
cssClasses['native-button'] = true;
|
|
271
232
|
return html`<button
|
|
272
233
|
class=${classMap(cssClasses)}
|
|
273
234
|
id="button"
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
@keydown=${this.__handlePress}
|
|
278
|
-
@keyup=${this.__handlePress}
|
|
235
|
+
aria-label="${ariaLabel || nothing}"
|
|
236
|
+
aria-haspopup="${ariaHasPopup || nothing}"
|
|
237
|
+
aria-expanded="${ariaExpanded || nothing}"
|
|
279
238
|
aria-describedby=${ifDefined(
|
|
280
239
|
this.softDisabled ? DISABLED_REASON_ID : undefined,
|
|
281
240
|
)}
|
|
282
241
|
?aria-disabled=${this.softDisabled}
|
|
283
242
|
?disabled=${this.disabled}
|
|
284
|
-
${spread(this.configAria)}
|
|
285
243
|
>
|
|
286
244
|
${this.renderButtonContent()}
|
|
287
245
|
</button>`;
|
|
288
246
|
}
|
|
289
|
-
cssClasses['native-link'] = true;
|
|
290
247
|
return html`<a
|
|
291
248
|
class=${classMap(cssClasses)}
|
|
292
|
-
id="
|
|
249
|
+
id="link"
|
|
293
250
|
href=${this.href}
|
|
294
251
|
target=${this.target}
|
|
295
252
|
tabindex=${this.disabled ? '-1' : '0'}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
@keyup=${this.__handlePress}
|
|
300
|
-
role="button"
|
|
253
|
+
aria-label="${ariaLabel || nothing}"
|
|
254
|
+
aria-haspopup="${ariaHasPopup || nothing}"
|
|
255
|
+
aria-expanded="${ariaExpanded || nothing}"
|
|
301
256
|
aria-describedby=${ifDefined(
|
|
302
257
|
this.softDisabled ? DISABLED_REASON_ID : undefined,
|
|
303
258
|
)}
|
|
304
259
|
?aria-disabled=${this.softDisabled}
|
|
305
|
-
${spread(this.configAria)}
|
|
306
260
|
>
|
|
307
261
|
${this.renderButtonContent()}
|
|
308
262
|
</a>`;
|
|
309
263
|
}
|
|
310
264
|
|
|
311
|
-
|
|
265
|
+
// ── Render ────────────────────────────────────────────────────────────────
|
|
266
|
+
|
|
267
|
+
override render() {
|
|
268
|
+
const buttonId = isLink(this) ? 'link' : 'button';
|
|
269
|
+
|
|
312
270
|
return html`
|
|
313
|
-
<
|
|
314
|
-
<
|
|
315
|
-
${
|
|
271
|
+
<wc-focus-ring class="focus-ring" for=${buttonId}></wc-focus-ring>
|
|
272
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
273
|
+
${when(
|
|
274
|
+
this.variant === 'neo',
|
|
275
|
+
() => html`<div class="neo-background"></div>`,
|
|
276
|
+
)}
|
|
277
|
+
<div class="background"></div>
|
|
278
|
+
${when(
|
|
279
|
+
this.variant === 'outlined' || this.variant === 'neo',
|
|
280
|
+
() => html`<div class="outline"></div>`,
|
|
281
|
+
)}
|
|
282
|
+
<wc-ripple class="ripple" for="button"></wc-ripple>
|
|
283
|
+
<wc-skeleton class="skeleton"></wc-skeleton>
|
|
284
|
+
|
|
285
|
+
${this.renderButtonElement()} ${this.renderTooltip()}
|
|
316
286
|
`;
|
|
317
287
|
}
|
|
318
288
|
}
|
package/src/button/index.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export { Button } from './button/button.js';
|
|
2
2
|
export { default as ButtonGroup } from './button-group/button-group.js';
|
|
3
3
|
export { IconButton } from './icon-button/icon-button.js';
|
|
4
|
+
export type {
|
|
5
|
+
ButtonSize,
|
|
6
|
+
ButtonLevel,
|
|
7
|
+
ButtonShape,
|
|
8
|
+
ButtonVariant,
|
|
9
|
+
ButtonColor,
|
|
10
|
+
} from './ButtonTypes.js';
|
package/src/calendar/calendar.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, html, nothing } from 'lit';
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
2
|
import { property, state } from 'lit/decorators.js';
|
|
3
3
|
import { addDays, addMonths, formatDate } from './utils.js';
|
|
4
4
|
import { CalendarEvent } from './calendar-event.js';
|
|
@@ -10,7 +10,7 @@ import styles from './calendar.scss';
|
|
|
10
10
|
* @label Calendar
|
|
11
11
|
* @tag wc-calendar
|
|
12
12
|
* @rawTag calendar
|
|
13
|
-
* @summary A
|
|
13
|
+
* @summary A full calendar component for displaying events in day, week, or month views.
|
|
14
14
|
*
|
|
15
15
|
* @cssprop --calendar-border-color - Border color used throughout the calendar grid.
|
|
16
16
|
* @cssprop --calendar-event-bg-color - Background color for calendar events.
|
package/src/canvas/canvas.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, LitElement, svg, nothing } from 'lit';
|
|
1
|
+
import { html, LitElement, svg, nothing } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import IndividualComponent from '@/IndividualComponent.js';
|
|
@@ -89,7 +89,7 @@ interface CanvasViewBox {
|
|
|
89
89
|
* @label Canvas
|
|
90
90
|
* @tag wc-canvas
|
|
91
91
|
* @rawTag canvas
|
|
92
|
-
* @summary A
|
|
92
|
+
* @summary A SVG canvas for drawing shapes, lines, and connectors on a dotted grid.
|
|
93
93
|
*
|
|
94
94
|
* @cssprop --canvas-background - Background color for the canvas wrapper. Defaults to surface-container-low.
|
|
95
95
|
* @cssprop --canvas-dot-color - Color of the background grid dots. Defaults to outline-variant.
|
package/src/card/card.scss
CHANGED
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
--_container-state-opacity: 0.08;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
&:
|
|
161
|
+
&:active:not([disabled]) {
|
|
162
162
|
--_container-elevation-level: 1;
|
|
163
163
|
--_container-state-opacity: 0.12;
|
|
164
164
|
}
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
--_container-state-opacity: 0.08;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
&:
|
|
188
|
+
&:active:not([disabled]) {
|
|
189
189
|
--_container-elevation-level: 0;
|
|
190
190
|
--_container-state-opacity: 0.1;
|
|
191
191
|
}
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
--_container-state-opacity: 0.08;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
&:
|
|
219
|
+
&:active:not([disabled]) {
|
|
220
220
|
--_container-state-opacity: 0.12;
|
|
221
221
|
}
|
|
222
222
|
|
package/src/card/card.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { LitElement, html, nothing } from 'lit';
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
2
|
import { property, query, state } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import {
|
|
5
5
|
dispatchActivationClick,
|
|
6
6
|
isActivationClick,
|
|
7
|
-
} from '../
|
|
8
|
-
import { isLink } from '@/
|
|
9
|
-
import { observerSlotChangesWithCallback } from '@/
|
|
10
|
-
import { throttle } from '@/
|
|
7
|
+
} from '../__internal/utils/dispatch-event-utils.js';
|
|
8
|
+
import { isLink } from '@/__internal/utils/is-link.js';
|
|
9
|
+
import { observerSlotChangesWithCallback } from '@/__internal/utils/observe-slot-change.js';
|
|
10
|
+
import { throttle } from '@/__internal/utils/throttle.js';
|
|
11
11
|
import IndividualComponent from '@/IndividualComponent.js';
|
|
12
12
|
import styles from './card.scss';
|
|
13
13
|
import colorStyles from './card-colors.scss';
|
|
14
|
-
import NativeHyperlinkMixin from '@/
|
|
14
|
+
import NativeHyperlinkMixin from '@/__internal/mixins/NativeHyperlinkMixin.js';
|
|
15
15
|
|
|
16
16
|
type CardVariant = 'elevated' | 'filled' | 'outlined';
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ type CardVariant = 'elevated' | 'filled' | 'outlined';
|
|
|
19
19
|
* @label Card
|
|
20
20
|
* @tag wc-card
|
|
21
21
|
* @rawTag card
|
|
22
|
-
* @summary A
|
|
22
|
+
* @summary A card surface for grouping related content.
|
|
23
23
|
* @cssprop --card-padding - Inner padding for the card container. Defaults to 1rem.
|
|
24
24
|
* @cssprop --card-shape - Corner radius for the card container. Defaults to a large radius.
|
|
25
25
|
* @cssprop --card-gap - Gap between slotted children.
|
|
@@ -56,16 +56,13 @@ export class Card extends NativeHyperlinkMixin(LitElement) {
|
|
|
56
56
|
disabledReason: string = '';
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* Sets the delay for throttle in milliseconds.
|
|
59
|
+
* Sets the delay for throttle in milliseconds. When null (default), no throttle is applied.
|
|
60
60
|
*/
|
|
61
|
-
@property() throttleDelay
|
|
61
|
+
@property() throttleDelay?: number;
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* States
|
|
65
65
|
*/
|
|
66
|
-
@state()
|
|
67
|
-
isPressed = false;
|
|
68
|
-
|
|
69
66
|
@state()
|
|
70
67
|
private slotHasContent = false;
|
|
71
68
|
|
|
@@ -73,11 +70,18 @@ export class Card extends NativeHyperlinkMixin(LitElement) {
|
|
|
73
70
|
|
|
74
71
|
#tabindex?: number = 0;
|
|
75
72
|
|
|
73
|
+
constructor() {
|
|
74
|
+
super();
|
|
75
|
+
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
76
|
+
}
|
|
77
|
+
|
|
76
78
|
override firstUpdated() {
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
if (typeof this.throttleDelay === 'number') {
|
|
80
|
+
this.__dispatchClickWithThrottle = throttle(
|
|
81
|
+
this.__dispatchClick,
|
|
82
|
+
this.throttleDelay,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
81
85
|
observerSlotChangesWithCallback(
|
|
82
86
|
this.renderRoot.querySelector('slot'),
|
|
83
87
|
hasContent => {
|
|
@@ -130,21 +134,6 @@ export class Card extends NativeHyperlinkMixin(LitElement) {
|
|
|
130
134
|
return nothing;
|
|
131
135
|
}
|
|
132
136
|
|
|
133
|
-
__handlePress = (event: KeyboardEvent | MouseEvent) => {
|
|
134
|
-
if (this.disabled) return;
|
|
135
|
-
if (
|
|
136
|
-
event instanceof KeyboardEvent &&
|
|
137
|
-
event.type === 'keydown' &&
|
|
138
|
-
(event.key === 'Enter' || event.key === ' ')
|
|
139
|
-
) {
|
|
140
|
-
this.isPressed = true;
|
|
141
|
-
} else if (event.type === 'mousedown') {
|
|
142
|
-
this.isPressed = true;
|
|
143
|
-
} else {
|
|
144
|
-
this.isPressed = false;
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
137
|
render() {
|
|
149
138
|
const isLinkElement = isLink(this);
|
|
150
139
|
const disableSlotTabbing = this.actionable || isLinkElement;
|
|
@@ -167,7 +156,6 @@ export class Card extends NativeHyperlinkMixin(LitElement) {
|
|
|
167
156
|
[`variant-${this.variant}`]: true,
|
|
168
157
|
actionable: (this.actionable && !this.disabled) || isLinkElement,
|
|
169
158
|
disabled: this.disabled,
|
|
170
|
-
pressed: this.isPressed,
|
|
171
159
|
'has-content': this.slotHasContent,
|
|
172
160
|
};
|
|
173
161
|
|
|
@@ -182,10 +170,6 @@ export class Card extends NativeHyperlinkMixin(LitElement) {
|
|
|
182
170
|
class=${classMap(cssClasses)}
|
|
183
171
|
id="card"
|
|
184
172
|
tabindex=${this.#tabindex}
|
|
185
|
-
@click=${this.__dispatchClickWithThrottle}
|
|
186
|
-
@mousedown=${this.__handlePress}
|
|
187
|
-
@keydown=${this.__handlePress}
|
|
188
|
-
@keyup=${this.__handlePress}
|
|
189
173
|
?aria-describedby=${this.__getDisabledReasonID()}
|
|
190
174
|
aria-disabled=${`${this.disabled}`}
|
|
191
175
|
?disabled=${this.disabled}
|
|
@@ -199,10 +183,6 @@ export class Card extends NativeHyperlinkMixin(LitElement) {
|
|
|
199
183
|
tabindex=${this.#tabindex}
|
|
200
184
|
href=${this.href}
|
|
201
185
|
target=${this.target}
|
|
202
|
-
@click=${this.__dispatchClickWithThrottle}
|
|
203
|
-
@mousedown=${this.__handlePress}
|
|
204
|
-
@keydown=${this.__handlePress}
|
|
205
|
-
@keyup=${this.__handlePress}
|
|
206
186
|
role="button"
|
|
207
187
|
?aria-describedby=${this.__getDisabledReasonID()}
|
|
208
188
|
aria-disabled=${`${this.disabled}`}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, LitElement, PropertyValues } from 'lit';
|
|
1
|
+
import { html, LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { property, query } from 'lit/decorators.js';
|
|
3
3
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
4
|
import { select, max, scaleBand, scaleLinear, scaleOrdinal, axisLeft, axisBottom, ScaleOrdinal } from 'd3';
|
|
@@ -34,7 +34,7 @@ function debounce<T extends (...args: any[]) => void>(fn: T, wait: number): T {
|
|
|
34
34
|
* @label Chart Bar
|
|
35
35
|
* @tag wc-chart-bar
|
|
36
36
|
* @rawTag chart-bar
|
|
37
|
-
* @summary A vertical bar chart that follows
|
|
37
|
+
* @summary A vertical bar chart that follows color and spacing tokens.
|
|
38
38
|
* @tags charts
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, LitElement, PropertyValues } from 'lit';
|
|
1
|
+
import { html, LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { property, query } from 'lit/decorators.js';
|
|
3
3
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
4
|
import { select, max, scaleBand, scaleLinear, scaleOrdinal, axisLeft, axisBottom, stack, Series, SeriesPoint, ScaleOrdinal } from 'd3';
|
|
@@ -42,7 +42,7 @@ function debounce<T extends (...args: any[]) => void>(fn: T, wait: number): T {
|
|
|
42
42
|
* @label Chart Stacked Bar
|
|
43
43
|
* @tag wc-chart-stacked-bar
|
|
44
44
|
* @rawTag chart-stacked-bar
|
|
45
|
-
* @summary A stacked bar chart that groups series by category using
|
|
45
|
+
* @summary A stacked bar chart that groups series by category using tokens.
|
|
46
46
|
* @tags charts
|
|
47
47
|
*
|
|
48
48
|
* @example
|
package/src/checkbox/checkbox.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { html, LitElement, svg } from 'lit';
|
|
1
|
+
import { html, LitElement, svg } from 'lit';
|
|
2
2
|
import { property, query, state } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
import { spread } from '@/
|
|
4
|
+
import { spread } from '@/__internal/directive/spread.js';
|
|
5
5
|
import styles from './checkbox.scss';
|
|
6
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @label Checkbox
|
|
@@ -11,7 +12,7 @@ import styles from './checkbox.scss';
|
|
|
11
12
|
* @summary Captures boolean input with an optional indeterminate mode.
|
|
12
13
|
* @overview
|
|
13
14
|
* <p>Checkboxes allow users to select one or more items from a set. Checkboxes can turn an option on or off.</p>
|
|
14
|
-
* <p>
|
|
15
|
+
* <p>checkboxes feature a smooth animation and clear visual states for checked, unchecked, and indeterminate.</p>
|
|
15
16
|
* @cssprop --checkbox-size: Size of the checkbox container.
|
|
16
17
|
* @cssprop --checkbox-selected-color: Color of the checkbox when selected.
|
|
17
18
|
* @cssprop --checkbox-unselected-color: Color of the checkbox border when unselected.
|
|
@@ -27,6 +28,7 @@ import styles from './checkbox.scss';
|
|
|
27
28
|
* <wc-checkbox label="Accept terms"></wc-checkbox>
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
31
|
+
@IndividualComponent
|
|
30
32
|
export class Checkbox extends LitElement {
|
|
31
33
|
static styles = [styles];
|
|
32
34
|
|
|
@@ -91,12 +93,15 @@ export class Checkbox extends LitElement {
|
|
|
91
93
|
@property({ type: Object })
|
|
92
94
|
configAria: Record<string, string> = {};
|
|
93
95
|
|
|
96
|
+
/** True while the checkbox container has keyboard focus. */
|
|
94
97
|
@state()
|
|
95
98
|
private hasFocus = false;
|
|
96
99
|
|
|
100
|
+
/** True while the user is actively pressing the checkbox (mouse/keyboard). */
|
|
97
101
|
@state()
|
|
98
102
|
private isActive = false;
|
|
99
103
|
|
|
104
|
+
/** True when slotted label content is present. */
|
|
100
105
|
@state()
|
|
101
106
|
private slotHasContent = false;
|
|
102
107
|
|
|
@@ -106,6 +111,9 @@ export class Checkbox extends LitElement {
|
|
|
106
111
|
@query('.input-native')
|
|
107
112
|
private nativeElement?: HTMLInputElement;
|
|
108
113
|
|
|
114
|
+
// ── Private fields ────────────────────────────────────────────────────────
|
|
115
|
+
|
|
116
|
+
/** Captured `tabindex` attribute value forwarded to the inner container. */
|
|
109
117
|
private tabindex?: string;
|
|
110
118
|
|
|
111
119
|
connectedCallback() {
|
|
@@ -257,7 +265,7 @@ export class Checkbox extends LitElement {
|
|
|
257
265
|
${spread(this.configAria)}
|
|
258
266
|
>
|
|
259
267
|
<wc-ripple class="ripple"></wc-ripple>
|
|
260
|
-
<wc-focus-ring class="focus-ring" for=
|
|
268
|
+
<wc-focus-ring class="focus-ring" for="container"></wc-focus-ring>
|
|
261
269
|
<div class="outline"></div>
|
|
262
270
|
<div class="background"></div>
|
|
263
271
|
<svg class="icon" viewBox="0 0 12 12">
|