@redvars/peacock 3.8.1 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseInput-14YmcfK7.js → BaseInput-CU1zZYKc.js} +3 -3
- package/dist/{BaseInput-14YmcfK7.js.map → BaseInput-CU1zZYKc.js.map} +1 -1
- package/dist/ButtonConstants-CahP2_NA.js +4 -0
- package/dist/ButtonConstants-CahP2_NA.js.map +1 -0
- package/dist/{IndividualComponent-DUINtMGK.js → IndividualComponent-Bdwyrvd6.js} +2 -2
- package/dist/{IndividualComponent-DUINtMGK.js.map → IndividualComponent-Bdwyrvd6.js.map} +1 -1
- package/dist/{NativeHyperlinkMixin-DrYXyfMQ.js → NativeHyperlinkMixin-D9J4aBTy.js} +4 -30
- package/dist/NativeHyperlinkMixin-D9J4aBTy.js.map +1 -0
- package/dist/accordion-item.js +338 -0
- package/dist/accordion-item.js.map +1 -0
- package/dist/accordion.js +159 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.js +190 -0
- package/dist/alert.js.map +1 -0
- package/dist/app-bar.js +324 -0
- package/dist/app-bar.js.map +1 -0
- package/dist/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/attachable-controller-CAKVrfcG.js +119 -0
- package/dist/attachable-controller-CAKVrfcG.js.map +1 -0
- package/dist/avatar.js +114 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.js +91 -0
- package/dist/badge.js.map +1 -0
- package/dist/base-Cl6v8-BZ.js +9 -0
- package/dist/base-Cl6v8-BZ.js.map +1 -0
- package/dist/bottom-sheet.js +14 -5
- package/dist/bottom-sheet.js.map +1 -1
- package/dist/breadcrumb-item.js +163 -0
- package/dist/breadcrumb-item.js.map +1 -0
- package/dist/breadcrumb.js +95 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button-group.js +87 -137
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +863 -133
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +8 -4
- package/dist/calendar-column-view.js.map +1 -1
- package/dist/calendar-month-view.js +8 -4
- package/dist/calendar-month-view.js.map +1 -1
- package/dist/calendar.js +8 -4
- package/dist/calendar.js.map +1 -1
- package/dist/canvas.js +8 -4
- package/dist/canvas.js.map +1 -1
- package/dist/card-content.js +1 -1
- package/dist/card.js +23 -45
- package/dist/card.js.map +1 -1
- package/dist/cb-compound-expression.js +6 -2
- package/dist/cb-compound-expression.js.map +1 -1
- package/dist/cb-divider.js +7 -3
- package/dist/cb-divider.js.map +1 -1
- package/dist/cb-expression.js +6 -2
- package/dist/cb-expression.js.map +1 -1
- package/dist/cb-predicate.js +7 -3
- package/dist/cb-predicate.js.map +1 -1
- package/dist/{chart-bar-cn6rrna-.js → chart-bar-CYoGNXnK.js} +6 -2
- package/dist/{chart-bar-cn6rrna-.js.map → chart-bar-CYoGNXnK.js.map} +1 -1
- package/dist/chart-bar.js +7 -6
- package/dist/chart-bar.js.map +1 -1
- package/dist/chart-doughnut.js +8 -3
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +8 -3
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js +7 -6
- package/dist/chart-stacked-bar.js.map +1 -1
- package/dist/checkbox.js +526 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chip.js +459 -0
- package/dist/chip.js.map +1 -0
- package/dist/{class-map-YU7g0o3B.js → class-map-DG7CA1et.js} +2 -2
- package/dist/{class-map-YU7g0o3B.js.map → class-map-DG7CA1et.js.map} +1 -1
- package/dist/clock.js +6 -2
- package/dist/clock.js.map +1 -1
- package/dist/code-editor.js +45 -30
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +9 -5
- package/dist/code-highlighter.js.map +1 -1
- package/dist/condition-builder.js +5 -1
- package/dist/condition-builder.js.map +1 -1
- package/dist/container.js +141 -0
- package/dist/container.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +721 -769
- package/dist/custom-elements.json +3213 -1979
- package/dist/datasource-B2eRh6Or.js +108 -0
- package/dist/datasource-B2eRh6Or.js.map +1 -0
- package/dist/dispatch-event-utils-CuEqjlPT.js.map +1 -1
- package/dist/divider.js +135 -0
- package/dist/divider.js.map +1 -0
- package/dist/dropdown-button.js +11 -6
- package/dist/dropdown-button.js.map +1 -1
- package/dist/element-internals-2CMts_0M.js +290 -0
- package/dist/element-internals-2CMts_0M.js.map +1 -0
- package/dist/elevation.js +94 -0
- package/dist/elevation.js.map +1 -0
- package/dist/empty-state.js +194 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/{event-manager-D-QCmUgR.js → event-manager-DTyX2uYD.js} +2 -2
- package/dist/{event-manager-D-QCmUgR.js.map → event-manager-DTyX2uYD.js.map} +1 -1
- package/dist/fab.js +138 -145
- package/dist/fab.js.map +1 -1
- package/dist/field.js +461 -0
- package/dist/field.js.map +1 -0
- package/dist/{popover-DUPmMVWS.js → floating-controller-CnUZnOhK.js} +2 -171
- package/dist/floating-controller-CnUZnOhK.js.map +1 -0
- package/dist/{flow-designer-node-BWrPuxAR.js → flow-designer-node-DsVwQTac.js} +7 -3
- package/dist/{flow-designer-node-BWrPuxAR.js.map → flow-designer-node-DsVwQTac.js.map} +1 -1
- package/dist/flow-designer-node.js +3 -3
- package/dist/flow-designer.js +19 -12
- package/dist/flow-designer.js.map +1 -1
- package/dist/focus-ring.js +126 -0
- package/dist/focus-ring.js.map +1 -0
- package/dist/form-associated-BXADnjOB.js +388 -0
- package/dist/form-associated-BXADnjOB.js.map +1 -0
- package/dist/html-editor.js +21 -9
- package/dist/html-editor.js.map +1 -1
- package/dist/hyperlink-DLvb6MXE.js +98 -0
- package/dist/hyperlink-DLvb6MXE.js.map +1 -0
- package/dist/icon-button.js +1064 -0
- package/dist/icon-button.js.map +1 -0
- package/dist/icon.js +170 -0
- package/dist/icon.js.map +1 -0
- package/dist/if-defined-BXZpRQ4P.js +10 -0
- package/dist/if-defined-BXZpRQ4P.js.map +1 -0
- package/dist/image.js +201 -0
- package/dist/image.js.map +1 -0
- package/dist/index.js +73 -20
- package/dist/index.js.map +1 -1
- package/dist/is-dark-mode-DOcaw4Yq.js.map +1 -1
- package/dist/is-link-Dk2OV3PM.js +6 -0
- package/dist/is-link-Dk2OV3PM.js.map +1 -0
- package/dist/item.js +212 -0
- package/dist/item.js.map +1 -0
- package/dist/link.js +75 -0
- package/dist/link.js.map +1 -0
- package/dist/list-D6JLh1uh.js +352 -0
- package/dist/list-D6JLh1uh.js.map +1 -0
- package/dist/list.js +14 -0
- package/dist/list.js.map +1 -0
- package/dist/{peacock-loader.js → loader.js} +83 -22
- package/dist/loader.js.map +1 -0
- package/dist/menu-item.js +318 -0
- package/dist/menu-item.js.map +1 -0
- package/dist/menu.js +534 -0
- package/dist/menu.js.map +1 -0
- package/dist/modal.js +9 -5
- package/dist/modal.js.map +1 -1
- package/dist/navigation-rail-item.js +385 -0
- package/dist/navigation-rail-item.js.map +1 -0
- package/dist/navigation-rail.js +217 -0
- package/dist/navigation-rail.js.map +1 -0
- package/dist/notification-manager.js +8 -4
- package/dist/notification-manager.js.map +1 -1
- package/dist/notification.js +8 -4
- package/dist/notification.js.map +1 -1
- package/dist/number-counter.js +7 -3
- package/dist/number-counter.js.map +1 -1
- package/dist/{observe-slot-change-D8Xg-kSS.js → observe-slot-change-DPxaZrZF.js} +3 -4
- package/dist/observe-slot-change-DPxaZrZF.js.map +1 -0
- package/dist/option.js +121 -0
- package/dist/option.js.map +1 -0
- package/dist/pagination.js +255 -0
- package/dist/pagination.js.map +1 -0
- package/dist/popover-content.js +7 -3
- package/dist/popover-content.js.map +1 -1
- package/dist/popover.js +175 -3
- package/dist/popover.js.map +1 -1
- package/dist/{property-1psGvXOq.js → property-B49QQ8pS.js} +2 -2
- package/dist/{property-1psGvXOq.js.map → property-B49QQ8pS.js.map} +1 -1
- package/dist/query-CHb9Ft_d.js +10 -0
- package/dist/query-CHb9Ft_d.js.map +1 -0
- package/dist/query-assigned-elements-BJaGSqM0.js +10 -0
- package/dist/query-assigned-elements-BJaGSqM0.js.map +1 -0
- package/dist/radio.js +476 -0
- package/dist/radio.js.map +1 -0
- package/dist/ripple.js +506 -0
- package/dist/ripple.js.map +1 -0
- package/dist/search.js +12 -7
- package/dist/search.js.map +1 -1
- package/dist/segmented-button-group.js +137 -0
- package/dist/segmented-button-group.js.map +1 -0
- package/dist/segmented-button.js +289 -0
- package/dist/segmented-button.js.map +1 -0
- package/dist/select-Dwtk0RIU.js +3937 -0
- package/dist/select-Dwtk0RIU.js.map +1 -0
- package/dist/side-sheet.js +8 -4
- package/dist/side-sheet.js.map +1 -1
- package/dist/skeleton.js +122 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/slider.js +346 -0
- package/dist/slider.js.map +1 -0
- package/dist/snackbar.js +335 -0
- package/dist/snackbar.js.map +1 -0
- package/dist/spinner.js +100 -0
- package/dist/spinner.js.map +1 -0
- package/dist/split-button.js +10 -5
- package/dist/split-button.js.map +1 -1
- package/dist/spread-B5cgadZl.js +32 -0
- package/dist/spread-B5cgadZl.js.map +1 -0
- package/dist/src/__internal/aria/aria.d.ts +98 -0
- package/dist/src/__internal/aria/delegate.d.ts +54 -0
- package/dist/src/__internal/events/dispatch-hooks.d.ts +80 -0
- package/dist/src/__internal/mixins/element-internals.d.ts +40 -0
- package/dist/src/__internal/mixins/form-associated.d.ts +174 -0
- package/dist/src/__internal/mixins/form-submitter.d.ts +59 -0
- package/dist/src/__internal/mixins/hyperlink.d.ts +42 -0
- package/dist/src/__internal/mixins/mixin.d.ts +49 -0
- package/dist/src/{__utils → __internal/utils}/observe-slot-change.d.ts +1 -0
- package/dist/src/accordion/accordion-item.d.ts +3 -1
- package/dist/src/accordion/accordion.d.ts +1 -1
- package/dist/src/alert/alert.d.ts +43 -0
- package/dist/src/alert/index.d.ts +1 -0
- package/dist/src/app-bar/app-bar.d.ts +92 -0
- package/dist/src/app-bar/index.d.ts +1 -0
- package/dist/src/avatar/avatar.d.ts +2 -0
- package/dist/src/bottom-sheet/bottom-sheet.d.ts +1 -1
- package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +1 -0
- package/dist/src/button/ButtonTypes.d.ts +5 -0
- package/dist/src/button/base-button/base-button.d.ts +18 -0
- package/dist/src/button/button/button.d.ts +29 -37
- package/dist/src/button/button-group/button-group.d.ts +17 -18
- package/dist/src/{fab → button/fab}/fab.d.ts +8 -26
- package/dist/src/button/icon-button/icon-button.d.ts +20 -27
- package/dist/src/button/index.d.ts +1 -0
- package/dist/src/calendar/calendar.d.ts +1 -1
- package/dist/src/canvas/canvas.d.ts +1 -1
- package/dist/src/card/card.d.ts +5 -6
- package/dist/src/chart-bar/chart-bar.d.ts +1 -1
- package/dist/src/chart-bar/chart-stacked-bar.d.ts +1 -1
- package/dist/src/checkbox/checkbox.d.ts +5 -1
- package/dist/src/chip/chip/chip.d.ts +9 -8
- package/dist/src/container/container.d.ts +5 -1
- package/dist/src/divider/divider.d.ts +2 -0
- package/dist/src/empty-state/empty-state.d.ts +1 -0
- package/dist/src/field/field.d.ts +19 -1
- package/dist/src/focus-ring/focus-ring.d.ts +3 -7
- package/dist/src/html-editor/html-editor.d.ts +1 -1
- package/dist/src/icon/icon.d.ts +9 -4
- package/dist/src/image/image.d.ts +4 -0
- package/dist/src/index.d.ts +7 -6
- package/dist/src/item/item.d.ts +20 -29
- package/dist/src/link/link.d.ts +1 -1
- package/dist/src/list/list-item.d.ts +7 -5
- package/dist/src/list/list.d.ts +3 -2
- package/dist/src/menu/menu/menu.d.ts +14 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +10 -2
- package/dist/src/modal/modal.d.ts +1 -1
- package/dist/src/navigation-rail/navigation-rail-item.d.ts +5 -4
- package/dist/src/navigation-rail/navigation-rail.d.ts +1 -1
- package/dist/src/radio/radio.d.ts +5 -0
- package/dist/src/ripple/ripple.d.ts +10 -1
- package/dist/src/search/search.d.ts +1 -1
- package/dist/src/segmented-button/segmented-button-group.d.ts +2 -2
- package/dist/src/segmented-button/segmented-button.d.ts +2 -0
- package/dist/src/side-sheet/side-sheet.d.ts +1 -1
- package/dist/src/skeleton/skeleton.d.ts +1 -0
- package/dist/src/slider/slider.d.ts +1 -0
- package/dist/src/snackbar/snackbar.d.ts +12 -2
- package/dist/src/svg/svg.d.ts +5 -0
- package/dist/src/table/table.d.ts +5 -0
- package/dist/src/tabs/tab.d.ts +2 -7
- package/dist/src/toolbar/toolbar.d.ts +2 -2
- package/dist/{state-DwbEjqVk.js → state-DkTK9EGF.js} +2 -2
- package/dist/{state-DwbEjqVk.js.map → state-DkTK9EGF.js.map} +1 -1
- package/dist/{style-map-DVmWOuYy.js → style-map-BQD5Et1D.js} +2 -2
- package/dist/{style-map-DVmWOuYy.js.map → style-map-BQD5Et1D.js.map} +1 -1
- package/dist/sub-menu.js +241 -0
- package/dist/sub-menu.js.map +1 -0
- package/dist/svg.js +273 -0
- package/dist/svg.js.map +1 -0
- package/dist/tab-group.js +188 -0
- package/dist/tab-group.js.map +1 -0
- package/dist/tab-panel.js +61 -0
- package/dist/tab-panel.js.map +1 -0
- package/dist/tab.js +658 -0
- package/dist/tab.js.map +1 -0
- package/dist/table.js +620 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.js +240 -0
- package/dist/tabs.js.map +1 -0
- package/dist/throttle-C7ZAPqtu.js +24 -0
- package/dist/throttle-C7ZAPqtu.js.map +1 -0
- package/dist/toolbar.js +9 -5
- package/dist/toolbar.js.map +1 -1
- package/dist/tooltip.js +270 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-BsGUjx94.js → unsafe-html-Ct0N2_UU.js} +2 -2
- package/dist/{unsafe-html-BsGUjx94.js.map → unsafe-html-Ct0N2_UU.js.map} +1 -1
- package/dist/when-DEJm_QN9.js +9 -0
- package/dist/when-DEJm_QN9.js.map +1 -0
- package/package.json +4 -2
- package/readme.md +3 -3
- package/scss/mixin.scss +8 -6
- package/src/__internal/aria/aria.ts +293 -0
- package/src/__internal/aria/delegate.ts +206 -0
- package/src/__internal/events/dispatch-hooks.ts +182 -0
- package/src/__internal/mixins/element-internals.ts +73 -0
- package/src/__internal/mixins/form-associated.ts +295 -0
- package/src/__internal/mixins/form-submitter.ts +133 -0
- package/src/__internal/mixins/hyperlink.ts +71 -0
- package/src/__internal/mixins/mixin.ts +58 -0
- package/src/{__utils → __internal/utils}/observe-slot-change.ts +2 -5
- package/src/accordion/accordion-item.ts +6 -2
- package/src/accordion/accordion.ts +4 -2
- package/src/accordion/demo/index.html +95 -90
- package/src/alert/alert.scss +82 -0
- package/src/{banner/banner.ts → alert/alert.ts} +22 -22
- package/src/alert/index.ts +1 -0
- package/src/app-bar/app-bar-colors.scss +17 -0
- package/src/app-bar/app-bar.scss +165 -0
- package/src/app-bar/app-bar.ts +155 -0
- package/src/app-bar/index.ts +1 -0
- package/src/avatar/avatar.ts +4 -0
- package/src/badge/badge.ts +2 -0
- package/src/bottom-sheet/bottom-sheet.ts +8 -2
- package/src/breadcrumb/breadcrumb/breadcrumb.ts +2 -0
- package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +3 -0
- package/src/button/ButtonTypes.ts +17 -0
- package/src/button/base-button/base-button.ts +85 -0
- package/src/button/button/button-base.scss +306 -0
- package/src/button/button/button-colors.scss +27 -32
- package/src/button/button/button-layers.scss +126 -39
- package/src/button/button/button-shapes.scss +73 -0
- package/src/button/button/button.scss +12 -286
- package/src/button/button/button.ts +174 -194
- package/src/button/button-group/button-group.scss +43 -36
- package/src/button/button-group/button-group.ts +26 -137
- package/src/{fab → button/fab}/fab-colors.scss +0 -10
- package/src/button/fab/fab-sizes.scss +37 -0
- package/src/button/fab/fab.scss +172 -0
- package/src/{fab → button/fab}/fab.ts +69 -105
- package/src/button/icon-button/icon-button-sizes.scss +18 -3
- package/src/button/icon-button/icon-button.scss +5 -0
- package/src/button/icon-button/icon-button.ts +111 -141
- package/src/button/index.ts +7 -0
- package/src/calendar/calendar.ts +2 -2
- package/src/canvas/canvas.ts +2 -2
- package/src/card/card.scss +3 -3
- package/src/card/card.ts +20 -40
- package/src/chart-bar/chart-bar.ts +2 -2
- package/src/chart-bar/chart-stacked-bar.ts +2 -2
- package/src/checkbox/checkbox.ts +12 -4
- package/src/chip/chip/chip.scss +1 -1
- package/src/chip/chip/chip.ts +35 -55
- package/src/chip/demo/index.html +30 -26
- package/src/code-editor/code-editor.ts +68 -58
- package/src/code-editor/demo/index.html +32 -27
- package/src/code-highlighter/code-highlighter.ts +1 -1
- package/src/code-highlighter/demo/index.html +24 -21
- package/src/container/container.ts +8 -2
- package/src/date-picker/date-picker.ts +2 -3
- package/src/divider/divider.ts +5 -1
- package/src/dropdown-button/demo/index.html +106 -101
- package/src/dropdown-button/dropdown-button.ts +1 -1
- package/src/elevation/elevation.ts +2 -0
- package/src/empty-state/empty-state.ts +3 -0
- package/src/field/field.ts +52 -33
- package/src/focus-ring/focus-ring.ts +5 -7
- package/src/html-editor/html-editor.ts +28 -16
- package/src/icon/datasource.ts +1 -1
- package/src/icon/icon.ts +27 -15
- package/src/image/image.ts +18 -6
- package/src/index.ts +24 -6
- package/src/input/input.ts +2 -2
- package/src/item/item.scss +126 -162
- package/src/item/item.ts +70 -323
- package/src/link/link.ts +3 -1
- package/src/list/list-item.scss +43 -31
- package/src/list/list-item.ts +79 -75
- package/src/list/list.scss +1 -13
- package/src/list/list.ts +6 -3
- package/src/{peacock-loader.ts → loader.ts} +91 -79
- package/src/menu/menu/menu.scss +14 -11
- package/src/menu/menu/menu.ts +20 -8
- package/src/menu/menu-item/menu-item.scss +35 -3
- package/src/menu/menu-item/menu-item.ts +40 -34
- package/src/menu/sub-menu/sub-menu.ts +3 -0
- package/src/modal/modal.ts +2 -2
- package/src/navigation-rail/navigation-rail-item.ts +21 -36
- package/src/navigation-rail/navigation-rail.scss +1 -0
- package/src/navigation-rail/navigation-rail.ts +4 -2
- package/src/number-field/number-field.ts +2 -2
- package/src/pagination/pagination.ts +2 -0
- package/src/popover/popover.ts +3 -3
- package/src/radio/radio.ts +13 -5
- package/src/ripple/ripple.ts +14 -1
- package/src/search/search.ts +3 -3
- package/src/segmented-button/segmented-button-group.ts +8 -4
- package/src/segmented-button/segmented-button.ts +4 -0
- package/src/select/option.ts +2 -0
- package/src/side-sheet/side-sheet.ts +2 -2
- package/src/sidebar-menu/sidebar-menu-item.ts +3 -2
- package/src/skeleton/skeleton.ts +3 -0
- package/src/slider/slider.ts +4 -1
- package/src/snackbar/snackbar.ts +40 -25
- package/src/spinner/spinner.ts +2 -0
- package/src/svg/svg.ts +27 -9
- package/src/switch/switch.ts +1 -1
- package/src/table/table.ts +16 -3
- package/src/tabs/demo/index.html +79 -79
- package/src/tabs/tab-group.ts +2 -0
- package/src/tabs/tab-panel.ts +2 -0
- package/src/tabs/tab.scss +4 -4
- package/src/tabs/tab.ts +16 -39
- package/src/tabs/tabs.ts +2 -0
- package/src/textarea/textarea.ts +2 -2
- package/src/time-picker/time-picker.ts +2 -2
- package/src/toolbar/toolbar.ts +3 -3
- package/src/tooltip/tooltip.ts +14 -8
- package/src/url-field/url-field.ts +2 -3
- package/dist/ButtonConstants-D06bY4uy.js +0 -114
- package/dist/ButtonConstants-D06bY4uy.js.map +0 -1
- package/dist/NativeHyperlinkMixin-DrYXyfMQ.js.map +0 -1
- package/dist/banner.js +0 -186
- package/dist/banner.js.map +0 -1
- package/dist/button-colors-D7sJyPy8.js +0 -586
- package/dist/button-colors-D7sJyPy8.js.map +0 -1
- package/dist/icon-CueRR7wx.js +0 -260
- package/dist/icon-CueRR7wx.js.map +0 -1
- package/dist/icon-button-CAzYr_qr.js +0 -318
- package/dist/icon-button-CAzYr_qr.js.map +0 -1
- package/dist/navigation-rail-CM_svs5_.js +0 -14184
- package/dist/navigation-rail-CM_svs5_.js.map +0 -1
- package/dist/observe-slot-change-D8Xg-kSS.js.map +0 -1
- package/dist/peacock-loader.js.map +0 -1
- package/dist/popover-DUPmMVWS.js.map +0 -1
- package/dist/query-QBcUV-L_.js +0 -15
- package/dist/query-QBcUV-L_.js.map +0 -1
- package/dist/src/banner/banner.d.ts +0 -43
- package/dist/src/banner/index.d.ts +0 -1
- package/dist/src/button/GroupButtonInterface.d.ts +0 -4
- package/src/banner/banner.scss +0 -82
- package/src/banner/index.ts +0 -1
- package/src/button/GroupButtonInterface.ts +0 -4
- package/src/button/button/only-button.scss +0 -13
- package/src/fab/fab-sizes.scss +0 -37
- package/src/fab/fab.scss +0 -143
- /package/dist/src/{__controllers → __internal/controllers}/attachable-controller.d.ts +0 -0
- /package/dist/src/{__controllers → __internal/controllers}/floating-controller.d.ts +0 -0
- /package/dist/src/{__directive → __internal/directive}/spread.d.ts +0 -0
- /package/dist/src/{__mixins → __internal/mixins}/MixinConstructor.d.ts +0 -0
- /package/dist/src/{__mixins → __internal/mixins}/NativeButtonMixin.d.ts +0 -0
- /package/dist/src/{__mixins → __internal/mixins}/NativeHyperlinkMixin.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/cache-fetch.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/copy-to-clipboard.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/dispatch-event-utils.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/is-dark-mode.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/is-in-viewport.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/is-link.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/observe-theme-change.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/sanitize-svg.d.ts +0 -0
- /package/dist/src/{__utils → __internal/utils}/throttle.d.ts +0 -0
- /package/dist/src/{fab → button/fab}/index.d.ts +0 -0
- /package/dist/src/{peacock-loader.d.ts → loader.d.ts} +0 -0
- /package/dist/test/{banner.test.d.ts → alert.test.d.ts} +0 -0
- /package/src/{__controllers → __internal/controllers}/attachable-controller.ts +0 -0
- /package/src/{__controllers → __internal/controllers}/floating-controller.ts +0 -0
- /package/src/{__directive → __internal/directive}/spread.ts +0 -0
- /package/src/{__mixins → __internal/mixins}/MixinConstructor.ts +0 -0
- /package/src/{__mixins → __internal/mixins}/NativeButtonMixin.ts +0 -0
- /package/src/{__mixins → __internal/mixins}/NativeHyperlinkMixin.ts +0 -0
- /package/src/{__mixins → __internal/mixins}/README.md +0 -0
- /package/src/{__utils → __internal/utils}/cache-fetch.ts +0 -0
- /package/src/{__utils → __internal/utils}/copy-to-clipboard.ts +0 -0
- /package/src/{__utils → __internal/utils}/dispatch-event-utils.ts +0 -0
- /package/src/{__utils → __internal/utils}/is-dark-mode.ts +0 -0
- /package/src/{__utils → __internal/utils}/is-in-viewport.ts +0 -0
- /package/src/{__utils → __internal/utils}/is-link.ts +0 -0
- /package/src/{__utils → __internal/utils}/observe-theme-change.ts +0 -0
- /package/src/{__utils → __internal/utils}/sanitize-svg.ts +0 -0
- /package/src/{__utils → __internal/utils}/throttle.ts +0 -0
- /package/src/{fab → button/fab}/index.ts +0 -0
package/src/tabs/tab.ts
CHANGED
|
@@ -5,14 +5,15 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
5
5
|
import {
|
|
6
6
|
dispatchActivationClick,
|
|
7
7
|
isActivationClick,
|
|
8
|
-
} from '@/
|
|
9
|
-
import { observerSlotChangesWithCallback } from '@/
|
|
10
|
-
import { throttle } from '@/
|
|
11
|
-
import { isLink } from '@/
|
|
12
|
-
import { spread } from '@/
|
|
8
|
+
} from '@/__internal/utils/dispatch-event-utils.js';
|
|
9
|
+
import { observerSlotChangesWithCallback } from '@/__internal/utils/observe-slot-change.js';
|
|
10
|
+
import { throttle } from '@/__internal/utils/throttle.js';
|
|
11
|
+
import { isLink } from '@/__internal/utils/is-link.js';
|
|
12
|
+
import { spread } from '@/__internal/directive/spread.js';
|
|
13
13
|
|
|
14
14
|
import styles from './tab.scss';
|
|
15
15
|
import type { Tabs } from './tabs.js';
|
|
16
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* @label Tab
|
|
@@ -29,6 +30,7 @@ import type { Tabs } from './tabs.js';
|
|
|
29
30
|
* ```
|
|
30
31
|
* @tags navigation
|
|
31
32
|
*/
|
|
33
|
+
@IndividualComponent
|
|
32
34
|
export class Tab extends LitElement {
|
|
33
35
|
#id = crypto.randomUUID();
|
|
34
36
|
|
|
@@ -53,9 +55,9 @@ export class Tab extends LitElement {
|
|
|
53
55
|
@property({ type: String, reflect: true }) href?: string;
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
|
-
* Sets the delay for throttle in milliseconds.
|
|
58
|
+
* Sets the delay for throttle in milliseconds. When null (default), no throttle is applied.
|
|
57
59
|
*/
|
|
58
|
-
@property() throttleDelay
|
|
60
|
+
@property() throttleDelay?: number;
|
|
59
61
|
|
|
60
62
|
@state() hasFocus = false;
|
|
61
63
|
|
|
@@ -65,12 +67,6 @@ export class Tab extends LitElement {
|
|
|
65
67
|
|
|
66
68
|
@state() slotHasBadge = false;
|
|
67
69
|
|
|
68
|
-
/**
|
|
69
|
-
* States
|
|
70
|
-
*/
|
|
71
|
-
@state()
|
|
72
|
-
isPressed = false;
|
|
73
|
-
|
|
74
70
|
private _tabindex = 0;
|
|
75
71
|
|
|
76
72
|
@query('.tab-element') readonly tabElement!: HTMLElement | null;
|
|
@@ -86,13 +82,16 @@ export class Tab extends LitElement {
|
|
|
86
82
|
constructor() {
|
|
87
83
|
super();
|
|
88
84
|
this._tabindex = 0;
|
|
85
|
+
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
override firstUpdated() {
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
if (typeof this.throttleDelay === 'number') {
|
|
90
|
+
this.__dispatchClickWithThrottle = throttle(
|
|
91
|
+
this.__dispatchClick,
|
|
92
|
+
this.throttleDelay,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
96
95
|
observerSlotChangesWithCallback(
|
|
97
96
|
this.renderRoot.querySelector('slot:not([name])'),
|
|
98
97
|
hasContent => {
|
|
@@ -141,21 +140,6 @@ export class Tab extends LitElement {
|
|
|
141
140
|
dispatchActivationClick(this.tabElement);
|
|
142
141
|
};
|
|
143
142
|
|
|
144
|
-
__handlePress = (event: KeyboardEvent | MouseEvent) => {
|
|
145
|
-
if (this.disabled) return;
|
|
146
|
-
if (
|
|
147
|
-
event instanceof KeyboardEvent &&
|
|
148
|
-
event.type === 'keydown' &&
|
|
149
|
-
(event.key === 'Enter' || event.key === ' ')
|
|
150
|
-
) {
|
|
151
|
-
this.isPressed = true;
|
|
152
|
-
} else if (event.type === 'mousedown') {
|
|
153
|
-
this.isPressed = true;
|
|
154
|
-
} else {
|
|
155
|
-
this.isPressed = false;
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
|
|
159
143
|
__getParentTabsVariant(): Tabs['variant'] {
|
|
160
144
|
return (this.closest('wc-tabs') as Tabs | null)?.variant ?? 'primary';
|
|
161
145
|
}
|
|
@@ -176,7 +160,6 @@ export class Tab extends LitElement {
|
|
|
176
160
|
tab: true,
|
|
177
161
|
'tab-element': true,
|
|
178
162
|
disabled: this.disabled,
|
|
179
|
-
pressed: this.isPressed,
|
|
180
163
|
active: this.active,
|
|
181
164
|
[`variant-${variant}`]: true,
|
|
182
165
|
'has-content': this.slotHasContent,
|
|
@@ -189,9 +172,6 @@ export class Tab extends LitElement {
|
|
|
189
172
|
id="button"
|
|
190
173
|
class=${classMap(cssClasses)}
|
|
191
174
|
tabindex="0"
|
|
192
|
-
@mousedown=${this.__handlePress}
|
|
193
|
-
@keydown=${this.__handlePress}
|
|
194
|
-
@keyup=${this.__handlePress}
|
|
195
175
|
?aria-describedby=${this.__getDisabledReasonID()}
|
|
196
176
|
aria-disabled=${`${this.disabled}`}
|
|
197
177
|
?disabled=${this.disabled}
|
|
@@ -207,9 +187,6 @@ export class Tab extends LitElement {
|
|
|
207
187
|
tabindex="0"
|
|
208
188
|
href=${this.href}
|
|
209
189
|
target=${this.target}
|
|
210
|
-
@mousedown=${this.__handlePress}
|
|
211
|
-
@keydown=${this.__handlePress}
|
|
212
|
-
@keyup=${this.__handlePress}
|
|
213
190
|
role="button"
|
|
214
191
|
?aria-describedby=${this.__getDisabledReasonID()}
|
|
215
192
|
aria-disabled=${`${this.disabled}`}
|
package/src/tabs/tabs.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { html, LitElement } from 'lit';
|
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import styles from './tabs.scss';
|
|
4
4
|
import { Tab } from './tab.js';
|
|
5
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @label Tabs
|
|
@@ -21,6 +22,7 @@ import { Tab } from './tab.js';
|
|
|
21
22
|
* ```
|
|
22
23
|
* @tags navigation
|
|
23
24
|
*/
|
|
25
|
+
@IndividualComponent
|
|
24
26
|
export class Tabs extends LitElement {
|
|
25
27
|
static styles = [styles];
|
|
26
28
|
|
package/src/textarea/textarea.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { property, query, state } from 'lit/decorators.js';
|
|
3
3
|
|
|
4
|
-
import { redispatchEvent } from '@/
|
|
5
|
-
import { spread } from '@/
|
|
4
|
+
import { redispatchEvent } from '@/__internal/utils/dispatch-event-utils.js';
|
|
5
|
+
import { spread } from '@/__internal/directive/spread.js';
|
|
6
6
|
|
|
7
7
|
import BaseInput from '../input/BaseInput.js';
|
|
8
8
|
import styles from './textarea.scss';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { property, query, state } from 'lit/decorators.js';
|
|
3
3
|
|
|
4
|
-
import { redispatchEvent } from '@/
|
|
5
|
-
import { spread } from '@/
|
|
4
|
+
import { redispatchEvent } from '@/__internal/utils/dispatch-event-utils.js';
|
|
5
|
+
import { spread } from '@/__internal/directive/spread.js';
|
|
6
6
|
|
|
7
7
|
import BaseInput from '../input/BaseInput.js';
|
|
8
8
|
import styles from './time-picker.scss';
|
package/src/toolbar/toolbar.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, html } from 'lit';
|
|
1
|
+
import { LitElement, html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import IndividualComponent from '@/IndividualComponent.js';
|
|
@@ -10,9 +10,9 @@ import colorStyles from './toolbar-colors.scss';
|
|
|
10
10
|
* @tag wc-toolbar
|
|
11
11
|
* @rawTag toolbar
|
|
12
12
|
*
|
|
13
|
-
* @summary A
|
|
13
|
+
* @summary A toolbar / app bar for navigation and actions.
|
|
14
14
|
* @overview
|
|
15
|
-
* <p>The toolbar component implements the
|
|
15
|
+
* <p>The toolbar component implements the app bar pattern. It supports a
|
|
16
16
|
* docked (attached) variant for bottom-panel navigation and a floating (detached pill-shaped)
|
|
17
17
|
* variant. The floating variant supports both horizontal and vertical orientations.</p>
|
|
18
18
|
*
|
package/src/tooltip/tooltip.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { html, LitElement } from 'lit';
|
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import styles from './tooltip.scss';
|
|
5
|
-
import { FloatingController } from '../
|
|
5
|
+
import { FloatingController } from '../__internal/controllers/floating-controller.js';
|
|
6
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
6
7
|
|
|
7
8
|
// Define a type for valid trigger combinations
|
|
8
9
|
export type TooltipTrigger = 'hover' | 'focus' | 'click';
|
|
@@ -19,6 +20,7 @@ export type TooltipTrigger = 'hover' | 'focus' | 'click';
|
|
|
19
20
|
* <wc-tooltip preview>Tooltip</wc-tooltip>
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
23
|
+
@IndividualComponent
|
|
22
24
|
export class Tooltip extends LitElement {
|
|
23
25
|
static styles = [styles];
|
|
24
26
|
|
|
@@ -43,7 +45,12 @@ export class Tooltip extends LitElement {
|
|
|
43
45
|
|
|
44
46
|
private _floating: FloatingController | null = null;
|
|
45
47
|
|
|
46
|
-
private resolveTrigger():
|
|
48
|
+
private resolveTrigger():
|
|
49
|
+
| 'hover'
|
|
50
|
+
| 'click'
|
|
51
|
+
| 'focus'
|
|
52
|
+
| 'manual'
|
|
53
|
+
| 'hover-focus' {
|
|
47
54
|
if (this.preview) return 'manual';
|
|
48
55
|
|
|
49
56
|
const triggerTokens = this.trigger.split(' ');
|
|
@@ -77,17 +84,16 @@ export class Tooltip extends LitElement {
|
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
__getFocusTarget(): HTMLElement | null {
|
|
80
|
-
|
|
81
87
|
if (this._focusTarget) {
|
|
82
88
|
return this._focusTarget;
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
const focusTarget = document.getElementById(this.for);
|
|
86
|
-
|
|
87
|
-
return focusTarget
|
|
88
|
-
|
|
92
|
+
if (focusTarget) {
|
|
93
|
+
return focusTarget;
|
|
94
|
+
}
|
|
89
95
|
|
|
90
|
-
|
|
96
|
+
return this.parentElement;
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
private attachListeners() {
|
|
@@ -107,7 +113,7 @@ export class Tooltip extends LitElement {
|
|
|
107
113
|
offset: 0,
|
|
108
114
|
trigger: this.resolveTrigger(),
|
|
109
115
|
closeOnClickOutside: true,
|
|
110
|
-
onOpenChange:
|
|
116
|
+
onOpenChange: isOpen => {
|
|
111
117
|
if (this.open === isOpen) return;
|
|
112
118
|
this.open = isOpen;
|
|
113
119
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html, nothing } from 'lit';
|
|
2
2
|
import { property, query, state } from 'lit/decorators.js';
|
|
3
3
|
|
|
4
|
-
import { redispatchEvent } from '@/
|
|
4
|
+
import { redispatchEvent } from '@/__internal/utils/dispatch-event-utils.js';
|
|
5
5
|
|
|
6
6
|
import BaseInput from '../input/BaseInput.js';
|
|
7
7
|
import styles from './url-field.scss';
|
|
@@ -217,7 +217,6 @@ export class UrlField extends BaseInput {
|
|
|
217
217
|
/>
|
|
218
218
|
`
|
|
219
219
|
: html`<div class="url-display">${this.renderDisplayValue()}</div>`}
|
|
220
|
-
|
|
221
220
|
${!this.editing && !this.disabled && !this.readonly
|
|
222
221
|
? html`
|
|
223
222
|
<wc-icon-button
|
|
@@ -236,4 +235,4 @@ export class UrlField extends BaseInput {
|
|
|
236
235
|
</wc-field>
|
|
237
236
|
`;
|
|
238
237
|
}
|
|
239
|
-
}
|
|
238
|
+
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { A, _ as __decorate } from './IndividualComponent-DUINtMGK.js';
|
|
2
|
-
import { e, i, t } from './directive-ZPhl09Yt.js';
|
|
3
|
-
import { n } from './property-1psGvXOq.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2018 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const o=o=>o??A;
|
|
10
|
-
|
|
11
|
-
class SpreadDirective extends i {
|
|
12
|
-
constructor(partInfo) {
|
|
13
|
-
super(partInfo);
|
|
14
|
-
if (partInfo.type !== t.ELEMENT) {
|
|
15
|
-
throw new Error('spread() can only be used on elements');
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
-
render(_props) {
|
|
20
|
-
return '';
|
|
21
|
-
}
|
|
22
|
-
update(part, [props]) {
|
|
23
|
-
if (!props)
|
|
24
|
-
return;
|
|
25
|
-
// eslint-disable-next-line guard-for-in,no-restricted-syntax
|
|
26
|
-
for (const key in props) {
|
|
27
|
-
const value = props[key];
|
|
28
|
-
if (value === undefined || value === null) {
|
|
29
|
-
part.element.removeAttribute(key);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
part.element.setAttribute(key, value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const spread = e(SpreadDirective);
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 2. Apply the type annotation to the variable.
|
|
41
|
-
*/
|
|
42
|
-
const NativeButtonMixin = (superclass) => {
|
|
43
|
-
// Naming the class (BaseButtonElement) instead of using 'Mixin' or anonymous
|
|
44
|
-
// prevents the "__childPart" visibility error.
|
|
45
|
-
class ButtonElement extends superclass {
|
|
46
|
-
constructor() {
|
|
47
|
-
super(...arguments);
|
|
48
|
-
/**
|
|
49
|
-
* The type of the underlying `<button>` element. Maps to the native `type` attribute.
|
|
50
|
-
* Possible values are `"button"`, `"submit"`, `"reset"`. Defaults to `"button"`.
|
|
51
|
-
*/
|
|
52
|
-
this.htmlType = 'button';
|
|
53
|
-
/**
|
|
54
|
-
* When `true`, the button is disabled and cannot be interacted with. Reflects to the `disabled` attribute. Defaults to `false`.
|
|
55
|
-
*/
|
|
56
|
-
this.disabled = false;
|
|
57
|
-
/**
|
|
58
|
-
* When `true`, the button is visually styled as disabled and cannot be interacted with, but remains focusable.
|
|
59
|
-
* Use this in combination with `disabledReason` to communicate why the button is unavailable.
|
|
60
|
-
* Reflects to the `soft-disabled` attribute. Defaults to `false`.
|
|
61
|
-
*/
|
|
62
|
-
this.softDisabled = false;
|
|
63
|
-
/**
|
|
64
|
-
* A human-readable explanation of why the button is disabled or soft-disabled.
|
|
65
|
-
* Rendered as a visually hidden tooltip and linked via `aria-describedby` for accessibility.
|
|
66
|
-
* Maps to the `disabled-reason` attribute.
|
|
67
|
-
*/
|
|
68
|
-
this.disabledReason = '';
|
|
69
|
-
/**
|
|
70
|
-
* The `id` of the `<form>` element to associate the button with.
|
|
71
|
-
* If omitted, the button is associated with its nearest ancestor form.
|
|
72
|
-
* Maps to the native `form` attribute.
|
|
73
|
-
*/
|
|
74
|
-
this.form = '';
|
|
75
|
-
/**
|
|
76
|
-
* The name of the button, submitted as part of a name/value pair when the associated form is submitted.
|
|
77
|
-
* Maps to the native `name` attribute.
|
|
78
|
-
*/
|
|
79
|
-
this.name = '';
|
|
80
|
-
/**
|
|
81
|
-
* The value of the button, submitted as part of a name/value pair when the associated form is submitted.
|
|
82
|
-
* Maps to the native `value` attribute.
|
|
83
|
-
*/
|
|
84
|
-
this.value = '';
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
__decorate([
|
|
88
|
-
n({ type: String })
|
|
89
|
-
], ButtonElement.prototype, "htmlType", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
n({ type: Boolean, reflect: true })
|
|
92
|
-
], ButtonElement.prototype, "disabled", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
n({ type: Boolean, reflect: true, attribute: 'soft-disabled' })
|
|
95
|
-
], ButtonElement.prototype, "softDisabled", void 0);
|
|
96
|
-
__decorate([
|
|
97
|
-
n({ attribute: 'disabled-reason' })
|
|
98
|
-
], ButtonElement.prototype, "disabledReason", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
n()
|
|
101
|
-
], ButtonElement.prototype, "form", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
n()
|
|
104
|
-
], ButtonElement.prototype, "name", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
n()
|
|
107
|
-
], ButtonElement.prototype, "value", void 0);
|
|
108
|
-
return ButtonElement;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const DISABLED_REASON_ID = 'button-disabled-reason';
|
|
112
|
-
|
|
113
|
-
export { DISABLED_REASON_ID as D, NativeButtonMixin as N, o, spread as s };
|
|
114
|
-
//# sourceMappingURL=ButtonConstants-D06bY4uy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonConstants-D06bY4uy.js","sources":["../node_modules/lit-html/directives/if-defined.js","../../src/__directive/spread.ts","../../src/__mixins/NativeButtonMixin.ts","../../src/button/ButtonConstants.ts"],"sourcesContent":["import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","import {\n directive,\n Directive,\n ElementPart,\n PartInfo,\n PartType,\n} from 'lit/directive.js';\n\nclass SpreadDirective extends Directive {\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error('spread() can only be used on elements');\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n render(_props: { [key: string]: any } | undefined) {\n return '';\n }\n\n update(part: ElementPart, [props]: [{ [key: string]: any } | undefined]) {\n if (!props) return;\n // eslint-disable-next-line guard-for-in,no-restricted-syntax\n for (const key in props) {\n const value = props[key];\n if (value === undefined || value === null) {\n part.element.removeAttribute(key);\n } else {\n part.element.setAttribute(key, value);\n }\n }\n }\n}\n\nexport const spread = directive(SpreadDirective);\n","import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport type { MixinConstructor } from './MixinConstructor.js';\n\n/**\n * 1. Define an interface for the members the mixin adds.\n * This makes the type annotation much cleaner.\n */\nexport interface NativeButtonInterface {\n htmlType: 'button' | 'submit' | 'reset';\n disabled: boolean;\n softDisabled: boolean;\n disabledReason: string;\n form: string;\n name: string;\n value: string;\n}\n\n/**\n * 2. Apply the type annotation to the variable.\n */\nconst NativeButtonMixin: <T extends MixinConstructor<LitElement>>(\n superclass: T,\n) => T & MixinConstructor<NativeButtonInterface> = <\n T extends MixinConstructor<LitElement>,\n>(\n superclass: T,\n) => {\n // Naming the class (BaseButtonElement) instead of using 'Mixin' or anonymous\n // prevents the \"__childPart\" visibility error.\n class ButtonElement extends superclass implements NativeButtonInterface {\n /**\n * The type of the underlying `<button>` element. Maps to the native `type` attribute.\n * Possible values are `\"button\"`, `\"submit\"`, `\"reset\"`. Defaults to `\"button\"`.\n */\n @property({ type: String }) htmlType: 'button' | 'submit' | 'reset' =\n 'button';\n\n /**\n * When `true`, the button is disabled and cannot be interacted with. Reflects to the `disabled` attribute. Defaults to `false`.\n */\n @property({ type: Boolean, reflect: true })\n disabled: boolean = false;\n\n /**\n * When `true`, the button is visually styled as disabled and cannot be interacted with, but remains focusable.\n * Use this in combination with `disabledReason` to communicate why the button is unavailable.\n * Reflects to the `soft-disabled` attribute. Defaults to `false`.\n */\n @property({ type: Boolean, reflect: true, attribute: 'soft-disabled' })\n softDisabled: boolean = false;\n\n /**\n * A human-readable explanation of why the button is disabled or soft-disabled.\n * Rendered as a visually hidden tooltip and linked via `aria-describedby` for accessibility.\n * Maps to the `disabled-reason` attribute.\n */\n @property({ attribute: 'disabled-reason' })\n disabledReason: string = '';\n\n /**\n * The `id` of the `<form>` element to associate the button with.\n * If omitted, the button is associated with its nearest ancestor form.\n * Maps to the native `form` attribute.\n */\n @property()\n form: string = '';\n\n /**\n * The name of the button, submitted as part of a name/value pair when the associated form is submitted.\n * Maps to the native `name` attribute.\n */\n @property()\n name: string = '';\n\n /**\n * The value of the button, submitted as part of a name/value pair when the associated form is submitted.\n * Maps to the native `value` attribute.\n */\n @property()\n value: string = '';\n }\n\n return ButtonElement as T & MixinConstructor<NativeButtonInterface>;\n};\n\nexport default NativeButtonMixin;\n","export const DISABLED_REASON_ID = 'button-disabled-reason';\n"],"names":["t","Directive","PartType","directive","property"],"mappings":";;;;AACA;AACA;AACA;AACA;AACA,GAAQ,MAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAEA;;ACGjB,MAAM,eAAgB,SAAQC,CAAS,CAAA;AACrC,IAAA,WAAA,CAAY,QAAkB,EAAA;QAC5B,KAAK,CAAC,QAAQ,CAAC;QACf,IAAI,QAAQ,CAAC,IAAI,KAAKC,CAAQ,CAAC,OAAO,EAAE;AACtC,YAAA,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC;QAC1D;IACF;;AAGA,IAAA,MAAM,CAAC,MAA0C,EAAA;AAC/C,QAAA,OAAO,EAAE;IACX;AAEA,IAAA,MAAM,CAAC,IAAiB,EAAE,CAAC,KAAK,CAAuC,EAAA;AACrE,QAAA,IAAI,CAAC,KAAK;YAAE;;AAEZ,QAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACvB,YAAA,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC;YACxB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;AACzC,gBAAA,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC;YACnC;iBAAO;gBACL,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;YACvC;QACF;IACF;AACD;MAEY,MAAM,GAAGC,CAAS,CAAC,eAAe;;ACjB/C;;AAEG;AACH,MAAM,iBAAiB,GAE4B,CAGjD,UAAa,KACX;;;IAGF,MAAM,aAAc,SAAQ,UAAU,CAAA;AAAtC,QAAA,WAAA,GAAA;;AACE;;;AAGG;YACyB,IAAA,CAAA,QAAQ,GAClC,QAAQ;AAEV;;AAEG;YAEH,IAAA,CAAA,QAAQ,GAAY,KAAK;AAEzB;;;;AAIG;YAEH,IAAA,CAAA,YAAY,GAAY,KAAK;AAE7B;;;;AAIG;YAEH,IAAA,CAAA,cAAc,GAAW,EAAE;AAE3B;;;;AAIG;YAEH,IAAA,CAAA,IAAI,GAAW,EAAE;AAEjB;;;AAGG;YAEH,IAAA,CAAA,IAAI,GAAW,EAAE;AAEjB;;;AAGG;YAEH,IAAA,CAAA,KAAK,GAAW,EAAE;QACpB;AAAC;AA9C6B,IAAA,UAAA,CAAA;AAA3B,QAAAC,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACf,KAAA,EAAA,aAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAMX,IAAA,UAAA,CAAA;QADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChB,KAAA,EAAA,aAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAQ1B,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE;AACxC,KAAA,EAAA,aAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAQ9B,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE;AACd,KAAA,EAAA,aAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAQ5B,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ;AACS,KAAA,EAAA,aAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAOlB,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ;AACS,KAAA,EAAA,aAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAOlB,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ;AACU,KAAA,EAAA,aAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAGrB,IAAA,OAAO,aAA4D;AACrE;;ACpFO,MAAM,kBAAkB,GAAG;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeHyperlinkMixin-DrYXyfMQ.js","sources":["../../src/__utils/throttle.ts","../../src/__utils/is-link.ts","../../src/__mixins/NativeHyperlinkMixin.ts"],"sourcesContent":["export function throttle(\n func: Function,\n delay: number,\n options = { leading: true, trailing: true },\n) {\n let timerId: any;\n let lastExec = 0;\n\n return function (...args: any[]) {\n // @ts-ignore\n const context = this;\n const now = Date.now();\n\n const shouldCallNow = options.leading && now - lastExec >= delay;\n\n if (shouldCallNow) {\n func.apply(context, args);\n lastExec = now;\n } else if (options.trailing && !timerId) {\n timerId = setTimeout(() => {\n func.apply(context, args);\n lastExec = Date.now();\n timerId = null;\n }, delay);\n }\n };\n}","export function isLink(element: any): boolean {\n return element.href !== undefined;\n}\n","import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport type { MixinConstructor } from './MixinConstructor.js';\n\n/**\n * 1. Define an interface for the members the mixin adds.\n * This makes the type annotation much cleaner.\n */\nexport interface NativeHyperlinkInterface {\n href?: string;\n target: '_self' | '_parent' | '_blank' | '_top' | string;\n rel?: string;\n download?: string;\n}\n\n/**\n * 2. Apply the type annotation to the variable.\n */\nconst NativeHyperlinkMixin: <T extends MixinConstructor<LitElement>>(\n superclass: T,\n) => T & MixinConstructor<NativeHyperlinkInterface> = <\n T extends MixinConstructor<LitElement>,\n>(\n superclass: T,\n) => {\n // Naming the class (BaseHyperlinkElement) instead of using 'Mixin' or anonymous\n // prevents the \"__childPart\" visibility error.\n class BaseHyperlinkElement\n extends superclass\n implements NativeHyperlinkInterface\n {\n /**\n * The URL that the hyperlink points to. When set, the component renders as an `<a>` element.\n * Maps to the native `href` attribute.\n */\n @property({ reflect: true })\n href?: string;\n\n /**\n * Where to display the linked URL. Maps to the native `target` attribute.\n * Possible values are `\"_self\"`, `\"_blank\"`, `\"_parent\"`, `\"_top\"`, or a custom frame name.\n * When using `\"_blank\"`, consider setting `rel=\"noopener noreferrer\"` for security. Defaults to `\"_self\"`.\n */\n @property()\n target: '_self' | '_parent' | '_blank' | '_top' | string = '_self';\n\n /**\n * The relationship between the current document and the linked URL.\n * Maps to the native `rel` attribute on the rendered `<a>` element.\n * When `target=\"_blank\"`, use `\"noopener noreferrer\"` to prevent tab-napping attacks.\n */\n @property()\n rel?: string;\n\n /**\n * Causes the browser to download the linked URL instead of navigating to it.\n * If a string value is provided, it is used as the suggested filename.\n * Omit or leave undefined to preserve normal navigation behaviour.\n * Maps to the native `download` attribute. Only applies when `href` is set.\n */\n @property()\n download?: string;\n }\n\n return BaseHyperlinkElement as T & MixinConstructor<NativeHyperlinkInterface>;\n};\n\nexport default NativeHyperlinkMixin;\n"],"names":["property"],"mappings":";;;SAAgB,QAAQ,CACtB,IAAc,EACd,KAAa,EACb,OAAO,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAA;AAE3C,IAAA,IAAI,OAAY;IAChB,IAAI,QAAQ,GAAG,CAAC;IAEhB,OAAO,UAAU,GAAG,IAAW,EAAA;;QAE7B,MAAM,OAAO,GAAG,IAAI;AACpB,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;QAEtB,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,IAAI,GAAG,GAAG,QAAQ,IAAI,KAAK;QAEhE,IAAI,aAAa,EAAE;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;YACzB,QAAQ,GAAG,GAAG;QAChB;AAAO,aAAA,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,EAAE;AACvC,YAAA,OAAO,GAAG,UAAU,CAAC,MAAK;AACxB,gBAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AACzB,gBAAA,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE;gBACrB,OAAO,GAAG,IAAI;YAChB,CAAC,EAAE,KAAK,CAAC;QACX;AACF,IAAA,CAAC;AACH;;AC1BM,SAAU,MAAM,CAAC,OAAY,EAAA;AACjC,IAAA,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS;AACnC;;ACaA;;AAEG;AACH,MAAM,oBAAoB,GAE4B,CAGpD,UAAa,KACX;;;IAGF,MAAM,oBACJ,SAAQ,UAAU,CAAA;AADpB,QAAA,WAAA,GAAA;;AAWE;;;;AAIG;YAEH,IAAA,CAAA,MAAM,GAAqD,OAAO;QAkBpE;AAAC;AA1BC,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;AACb,KAAA,EAAA,oBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAQd,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ;AAC0D,KAAA,EAAA,oBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAQnE,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ;AACI,KAAA,EAAA,oBAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;AASb,IAAA,UAAA,CAAA;AADC,QAAAA,CAAQ;AACS,KAAA,EAAA,oBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGpB,IAAA,OAAO,oBAAsE;AAC/E;;;;"}
|
package/dist/banner.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { a as i, _ as __decorate, I as IndividualComponent, i as i$1, A, b } from './IndividualComponent-DUINtMGK.js';
|
|
2
|
-
import { n } from './property-1psGvXOq.js';
|
|
3
|
-
import { e } from './class-map-YU7g0o3B.js';
|
|
4
|
-
import './directive-ZPhl09Yt.js';
|
|
5
|
-
|
|
6
|
-
var css_248z = i`* {
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.screen-reader-only {
|
|
11
|
-
display: none !important;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
:host {
|
|
15
|
-
display: block;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.banner {
|
|
19
|
-
align-items: flex-start;
|
|
20
|
-
background: var(--banner-container-color);
|
|
21
|
-
border-radius: var(--banner-border-radius);
|
|
22
|
-
display: grid;
|
|
23
|
-
gap: var(--spacing-100);
|
|
24
|
-
grid-template-columns: auto 1fr;
|
|
25
|
-
padding: var(--spacing-200);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.banner-icon {
|
|
29
|
-
align-items: center;
|
|
30
|
-
color: var(--banner-icon-color);
|
|
31
|
-
display: inline-flex;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
--icon-size: 1.5rem;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.banner-content .banner-label {
|
|
37
|
-
display: inline;
|
|
38
|
-
font-family: var(--typography-label-large-font-family) !important;
|
|
39
|
-
font-size: var(--typography-label-large-font-size) !important;
|
|
40
|
-
font-weight: var(--typography-label-large-font-weight) !important;
|
|
41
|
-
line-height: var(--typography-label-large-line-height) !important;
|
|
42
|
-
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
43
|
-
color: var(--banner-label-text-color);
|
|
44
|
-
margin-inline-end: var(--spacing-050);
|
|
45
|
-
}
|
|
46
|
-
.banner-content .banner-description {
|
|
47
|
-
display: inline;
|
|
48
|
-
font-family: var(--typography-body-medium-font-family) !important;
|
|
49
|
-
font-size: var(--typography-body-medium-font-size) !important;
|
|
50
|
-
font-weight: var(--typography-body-medium-font-weight) !important;
|
|
51
|
-
line-height: var(--typography-body-medium-line-height) !important;
|
|
52
|
-
letter-spacing: var(--typography-body-medium-letter-spacing) !important;
|
|
53
|
-
color: var(--banner-description-text-color);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
:host {
|
|
57
|
-
--banner-container-color: var(--color-tertiary-container);
|
|
58
|
-
--banner-label-text-color: var(--color-on-tertiary-container);
|
|
59
|
-
--banner-description-text-color: var(--color-on-tertiary-container);
|
|
60
|
-
--banner-icon-color: var(--color-on-tertiary-container);
|
|
61
|
-
--banner-border-radius: var(--shape-corner-small);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.banner.info,
|
|
65
|
-
.banner-content.info {
|
|
66
|
-
--banner-container-color: var(--color-primary-container);
|
|
67
|
-
--banner-label-text-color: var(--color-on-primary-container);
|
|
68
|
-
--banner-description-text-color: var(--color-on-primary-container);
|
|
69
|
-
--banner-icon-color: var(--color-on-primary-container);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.banner.success,
|
|
73
|
-
.banner-content.success {
|
|
74
|
-
--banner-container-color: var(--color-success-container);
|
|
75
|
-
--banner-label-text-color: var(--color-on-success-container);
|
|
76
|
-
--banner-description-text-color: var(--color-on-success-container);
|
|
77
|
-
--banner-icon-color: var(--color-on-success-container);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.banner.warning,
|
|
81
|
-
.banner-content.warning {
|
|
82
|
-
--banner-container-color: var(--color-warning-container);
|
|
83
|
-
--banner-label-text-color: var(--color-on-warning-container);
|
|
84
|
-
--banner-description-text-color: var(--color-on-warning-container);
|
|
85
|
-
--banner-icon-color: var(--color-on-warning-container);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.banner.error,
|
|
89
|
-
.banner-content.error {
|
|
90
|
-
--banner-container-color: var(--color-error-container);
|
|
91
|
-
--banner-label-text-color: var(--color-on-error-container);
|
|
92
|
-
--banner-description-text-color: var(--color-on-error-container);
|
|
93
|
-
--banner-icon-color: var(--color-on-error-container);
|
|
94
|
-
}`;
|
|
95
|
-
|
|
96
|
-
const VARIANT_LABELS = {
|
|
97
|
-
note: 'Note',
|
|
98
|
-
info: 'Info',
|
|
99
|
-
success: 'Success',
|
|
100
|
-
warning: 'Warning',
|
|
101
|
-
error: 'Error',
|
|
102
|
-
};
|
|
103
|
-
const VARIANT_ICONS = {
|
|
104
|
-
note: 'star',
|
|
105
|
-
info: 'info',
|
|
106
|
-
success: 'check_circle',
|
|
107
|
-
warning: 'warning',
|
|
108
|
-
error: 'error',
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* @label Banner
|
|
112
|
-
* @tag wc-banner
|
|
113
|
-
* @rawTag banner
|
|
114
|
-
* @summary Banners show short, prominent contextual messages with optional icon and description.
|
|
115
|
-
*
|
|
116
|
-
* @cssprop --banner-container-color - Background color of the banner container.
|
|
117
|
-
* @cssprop --banner-label-text-color - Label text color.
|
|
118
|
-
* @cssprop --banner-description-text-color - Description text color.
|
|
119
|
-
* @cssprop --banner-icon-color - Icon color.
|
|
120
|
-
* @cssprop --banner-border-radius - Border radius of the banner surface.
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* ```html
|
|
124
|
-
* <wc-banner variant="note" description="Use semantic roles that preserve a 3:1 contrast ratio."></wc-banner>
|
|
125
|
-
* ```
|
|
126
|
-
* @tags display, feedback
|
|
127
|
-
*/
|
|
128
|
-
let Banner = class Banner extends i$1 {
|
|
129
|
-
constructor() {
|
|
130
|
-
super(...arguments);
|
|
131
|
-
/**
|
|
132
|
-
* Visual intent of the banner.
|
|
133
|
-
*/
|
|
134
|
-
this.variant = 'note';
|
|
135
|
-
/**
|
|
136
|
-
* Optional description text when a default slot is not provided.
|
|
137
|
-
*/
|
|
138
|
-
this.description = '';
|
|
139
|
-
}
|
|
140
|
-
get resolvedLabel() {
|
|
141
|
-
return this.label || VARIANT_LABELS[this.variant];
|
|
142
|
-
}
|
|
143
|
-
get resolvedIcon() {
|
|
144
|
-
return this.icon || VARIANT_ICONS[this.variant];
|
|
145
|
-
}
|
|
146
|
-
render() {
|
|
147
|
-
return b `
|
|
148
|
-
<div class=${e({ 'banner': true, [this.variant]: true })} role="status" aria-live="polite">
|
|
149
|
-
<div class="banner-icon" aria-hidden="true">
|
|
150
|
-
<slot name="icon">
|
|
151
|
-
<wc-icon name=${this.resolvedIcon}></wc-icon>
|
|
152
|
-
</slot>
|
|
153
|
-
</div>
|
|
154
|
-
|
|
155
|
-
<div class=${e({ 'banner-content': true, [this.variant]: true })}>
|
|
156
|
-
<div class="banner-label">
|
|
157
|
-
<slot name="label">${this.resolvedLabel}:</slot>
|
|
158
|
-
</div>
|
|
159
|
-
|
|
160
|
-
<div class="banner-description">
|
|
161
|
-
<slot>${this.description || A}</slot>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
`;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
Banner.styles = [css_248z];
|
|
169
|
-
__decorate([
|
|
170
|
-
n({ type: String, reflect: true })
|
|
171
|
-
], Banner.prototype, "variant", void 0);
|
|
172
|
-
__decorate([
|
|
173
|
-
n({ type: String })
|
|
174
|
-
], Banner.prototype, "label", void 0);
|
|
175
|
-
__decorate([
|
|
176
|
-
n({ type: String })
|
|
177
|
-
], Banner.prototype, "icon", void 0);
|
|
178
|
-
__decorate([
|
|
179
|
-
n({ type: String })
|
|
180
|
-
], Banner.prototype, "description", void 0);
|
|
181
|
-
Banner = __decorate([
|
|
182
|
-
IndividualComponent
|
|
183
|
-
], Banner);
|
|
184
|
-
|
|
185
|
-
export { Banner };
|
|
186
|
-
//# sourceMappingURL=banner.js.map
|
package/dist/banner.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sources":["../../src/banner/banner.ts"],"sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './banner.scss';\n\ntype BannerVariant = 'note' | 'info' | 'success' | 'warning' | 'error';\n\nconst VARIANT_LABELS: Record<BannerVariant, string> = {\n note: 'Note',\n info: 'Info',\n success: 'Success',\n warning: 'Warning',\n error: 'Error',\n};\n\nconst VARIANT_ICONS: Record<BannerVariant, string> = {\n note: 'star',\n info: 'info',\n success: 'check_circle',\n warning: 'warning',\n error: 'error',\n};\n\n/**\n * @label Banner\n * @tag wc-banner\n * @rawTag banner\n * @summary Banners show short, prominent contextual messages with optional icon and description.\n *\n * @cssprop --banner-container-color - Background color of the banner container.\n * @cssprop --banner-label-text-color - Label text color.\n * @cssprop --banner-description-text-color - Description text color.\n * @cssprop --banner-icon-color - Icon color.\n * @cssprop --banner-border-radius - Border radius of the banner surface.\n *\n * @example\n * ```html\n * <wc-banner variant=\"note\" description=\"Use semantic roles that preserve a 3:1 contrast ratio.\"></wc-banner>\n * ```\n * @tags display, feedback\n */\n@IndividualComponent\nexport class Banner extends LitElement {\n static styles = [styles];\n\n /**\n * Visual intent of the banner.\n */\n @property({ type: String, reflect: true })\n variant: BannerVariant = 'note';\n\n /**\n * Optional explicit label text. Falls back to a variant-based label.\n */\n @property({ type: String })\n label?: string;\n\n /**\n * Optional explicit icon name. Falls back to a variant-based icon.\n */\n @property({ type: String })\n icon?: string;\n\n /**\n * Optional description text when a default slot is not provided.\n */\n @property({ type: String })\n description = '';\n\n private get resolvedLabel() {\n return this.label || VARIANT_LABELS[this.variant];\n }\n\n private get resolvedIcon() {\n return this.icon || VARIANT_ICONS[this.variant];\n }\n\n render() {\n return html`\n <div class=${classMap({ 'banner': true, [this.variant]: true })} role=\"status\" aria-live=\"polite\">\n <div class=\"banner-icon\" aria-hidden=\"true\">\n <slot name=\"icon\">\n <wc-icon name=${this.resolvedIcon}></wc-icon>\n </slot>\n </div>\n\n <div class=${classMap({ 'banner-content': true, [this.variant]: true })}>\n <div class=\"banner-label\">\n <slot name=\"label\">${this.resolvedLabel}:</slot>\n </div>\n\n <div class=\"banner-description\">\n <slot>${this.description || nothing}</slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","nothing","styles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,cAAc,GAAkC;AACpD,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,KAAK,EAAE,OAAO;CACf;AAED,MAAM,aAAa,GAAkC;AACnD,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,KAAK,EAAE,OAAO;CACf;AAED;;;;;;;;;;;;;;;;;AAiBG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQA,GAAU,CAAA;AAA/B,IAAA,WAAA,GAAA;;AAGL;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAkB,MAAM;AAc/B;;AAEG;QAEH,IAAA,CAAA,WAAW,GAAG,EAAE;IA+BlB;AA7BE,IAAA,IAAY,aAAa,GAAA;QACvB,OAAO,IAAI,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;IACnD;AAEA,IAAA,IAAY,YAAY,GAAA;QACtB,OAAO,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC;IACjD;IAEA,MAAM,GAAA;AACJ,QAAA,OAAOC,CAAI,CAAA;AACI,iBAAA,EAAAC,CAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC,CAAA;;;AAGzC,0BAAA,EAAA,IAAI,CAAC,YAAY,CAAA;;;;AAIxB,mBAAA,EAAAA,CAAQ,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC,CAAA;;AAE9C,+BAAA,EAAA,IAAI,CAAC,aAAa,CAAA;;;;oBAI/B,IAAI,CAAC,WAAW,IAAIC,CAAO,CAAA;;;;KAI1C;IACH;;AAtDO,MAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AAMxB,UAAA,CAAA;IADCC,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACT,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAMhC,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACX,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAMf,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACZ,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMd,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACT,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAzBN,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAwDlB;;;;"}
|