@redvars/peacock 3.8.0 → 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 -284
- 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/demo/index.html +29 -36
- 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-DSuBHd-i.js +0 -585
- package/dist/button-colors-DSuBHd-i.js.map +0 -1
- package/dist/icon-CueRR7wx.js +0 -260
- package/dist/icon-CueRR7wx.js.map +0 -1
- package/dist/icon-button-CYqrnMnF.js +0 -318
- package/dist/icon-button-CYqrnMnF.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/dist/item.js
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { i, a as i$1, b, _ as __decorate, I as IndividualComponent } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { n } from './property-B49QQ8pS.js';
|
|
3
|
+
import { e as e$1 } from './base-Cl6v8-BZ.js';
|
|
4
|
+
import { m as mixinDelegatesAria, a as mixinElementInternals } from './element-internals-2CMts_0M.js';
|
|
5
|
+
import { h as hasMeaningfulContent } from './observe-slot-change-DPxaZrZF.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/
|
|
12
|
+
let e;function r(r){return (n,o)=>e$1(n,o,{get(){return (this.renderRoot??(e??=document.createDocumentFragment())).querySelectorAll(r)}})}
|
|
13
|
+
|
|
14
|
+
var css_248z = i`* {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.screen-reader-only {
|
|
19
|
+
display: none !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[hidden] {
|
|
23
|
+
display: none !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host {
|
|
27
|
+
--item-container-color: transparent;
|
|
28
|
+
--item-height: 3rem;
|
|
29
|
+
--item-multiline-height: 4rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host {
|
|
33
|
+
position: relative;
|
|
34
|
+
display: flex;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
max-width: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.item {
|
|
40
|
+
position: relative;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex: 1;
|
|
43
|
+
gap: var(--item-spacing, 1rem);
|
|
44
|
+
padding-block: 0.625rem;
|
|
45
|
+
padding-inline: var(--item-padding-inline, 1rem);
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
color: var(--item-label-text-color, var(--color-on-surface));
|
|
48
|
+
opacity: var(--item-label-text-opacity, 1);
|
|
49
|
+
font-family: var(--item-label-font-family, var(--typography-body-large-font-family)) !important;
|
|
50
|
+
font-size: var(--item-label-font-size, var(--typography-body-large-font-size)) !important;
|
|
51
|
+
font-weight: var(--item-label-font-weight, var(--typography-body-large-font-weight)) !important;
|
|
52
|
+
line-height: var(--item-label-line-height, var(--typography-body-large-line-height)) !important;
|
|
53
|
+
letter-spacing: var(--item-label-letter-spacing, var(--typography-body-large-letter-spacing)) !important;
|
|
54
|
+
}
|
|
55
|
+
.item [name=overline] {
|
|
56
|
+
color: var(--item-outline-text-color);
|
|
57
|
+
font-family: var(--item-outline-label-font-family, var(--typography-body-medium-font-family)) !important;
|
|
58
|
+
font-size: var(--item-outline-label-font-size, var(--typography-body-medium-font-size)) !important;
|
|
59
|
+
font-weight: var(--item-outline-label-font-weight, var(--typography-body-medium-font-weight)) !important;
|
|
60
|
+
line-height: var(--item-outline-label-line-height, var(--typography-body-medium-line-height)) !important;
|
|
61
|
+
letter-spacing: var(--item-outline-label-letter-spacing, var(--typography-body-medium-letter-spacing)) !important;
|
|
62
|
+
}
|
|
63
|
+
.item [name=supporting-text] {
|
|
64
|
+
color: var(--item-supporting-text-color, var(--color-on-surface-variant));
|
|
65
|
+
font-family: var(--item-supporting-text-font-family, var(--typography-body-medium-font-family)) !important;
|
|
66
|
+
font-size: var(--item-supporting-text-font-size, var(--typography-body-medium-font-size)) !important;
|
|
67
|
+
font-weight: var(--item-supporting-text-font-weight, var(--typography-body-medium-font-weight)) !important;
|
|
68
|
+
line-height: var(--item-supporting-text-line-height, var(--typography-body-medium-line-height)) !important;
|
|
69
|
+
letter-spacing: var(--item-supporting-text-letter-spacing, var(--typography-body-medium-letter-spacing)) !important;
|
|
70
|
+
}
|
|
71
|
+
.item [name=trailing-supporting-text] {
|
|
72
|
+
color: var(--item-trailing-supporting-text-color, var(--color-on-surface-variant));
|
|
73
|
+
font-family: var(--item-trailing-supporting-text-font-family) !important;
|
|
74
|
+
font-size: var(--item-trailing-supporting-text-font-size) !important;
|
|
75
|
+
font-weight: var(--item-trailing-supporting-text-font-weight) !important;
|
|
76
|
+
line-height: var(--item-trailing-supporting-text-line-height) !important;
|
|
77
|
+
letter-spacing: var(--item-trailing-supporting-text-letter-spacing) !important;
|
|
78
|
+
}
|
|
79
|
+
.item .default-slot {
|
|
80
|
+
display: inline;
|
|
81
|
+
}
|
|
82
|
+
.item .default-slot,
|
|
83
|
+
.item .text ::slotted(*) {
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
text-overflow: ellipsis;
|
|
86
|
+
}
|
|
87
|
+
.item .text {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex: 1;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
}
|
|
94
|
+
.item .non-text {
|
|
95
|
+
align-items: center;
|
|
96
|
+
display: flex;
|
|
97
|
+
height: fit-content;
|
|
98
|
+
--icon-size: 1.5rem;
|
|
99
|
+
}
|
|
100
|
+
.item .non-text,
|
|
101
|
+
.item .text {
|
|
102
|
+
z-index: 0;
|
|
103
|
+
min-height: var(--item-height);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([multiline]) .non-text,
|
|
107
|
+
:host([multiline]) .text {
|
|
108
|
+
min-height: var(--item-multiline-height);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[name=container]::slotted(*) {
|
|
112
|
+
inset: 0;
|
|
113
|
+
position: absolute;
|
|
114
|
+
}`;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @label Item
|
|
118
|
+
* @tag wc-item
|
|
119
|
+
* @rawTag item
|
|
120
|
+
*
|
|
121
|
+
* @summary A primitive element used to build higher-level item components such as menu-item, navigation-item, and list-item. Provides start, text, and end slots for flexible content composition.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```html
|
|
125
|
+
* <wc-item>
|
|
126
|
+
* <wc-icon slot="start" name="notifications"></wc-icon>
|
|
127
|
+
*
|
|
128
|
+
* <span slot="overline">Settings</span>
|
|
129
|
+
* <span slot="headline">Notifications</span>
|
|
130
|
+
* <span slot="supporting-text">Manage alerts and reminders</span>
|
|
131
|
+
*
|
|
132
|
+
* <span slot="trailing-supporting-text">3</span>
|
|
133
|
+
* <wc-icon slot="end" name="chevron_right"></wc-icon>
|
|
134
|
+
* </wc-item>
|
|
135
|
+
* ```
|
|
136
|
+
* @tags display
|
|
137
|
+
*/
|
|
138
|
+
let Item = class Item extends mixinDelegatesAria(mixinElementInternals(i$1)) {
|
|
139
|
+
constructor() {
|
|
140
|
+
super(...arguments);
|
|
141
|
+
/**
|
|
142
|
+
* Only needed for SSR.
|
|
143
|
+
*
|
|
144
|
+
* Add this attribute when an item has two lines to avoid a Flash Of Unstyled
|
|
145
|
+
* Content. This attribute is not needed for single line items or items with
|
|
146
|
+
* three or more lines.
|
|
147
|
+
*/
|
|
148
|
+
this.multiline = false;
|
|
149
|
+
}
|
|
150
|
+
__hasNamedSlot(...names) {
|
|
151
|
+
return names.some(name => Array.from(this.children).some(child => child.getAttribute('slot') === name));
|
|
152
|
+
}
|
|
153
|
+
render() {
|
|
154
|
+
const hasStart = this.__hasNamedSlot('start');
|
|
155
|
+
const hasEnd = this.__hasNamedSlot('end');
|
|
156
|
+
const hasTrailingSupportingText = this.__hasNamedSlot('trailing-supporting-text');
|
|
157
|
+
return b `
|
|
158
|
+
<slot name="container"></slot>
|
|
159
|
+
|
|
160
|
+
<div class="item">
|
|
161
|
+
<slot class="non-text" name="start" ?hidden=${!hasStart}></slot>
|
|
162
|
+
<div class="text">
|
|
163
|
+
<slot name="overline" @slotchange=${this.handleTextSlotChange}></slot>
|
|
164
|
+
<slot
|
|
165
|
+
class="default-slot"
|
|
166
|
+
@slotchange=${this.handleTextSlotChange}
|
|
167
|
+
></slot>
|
|
168
|
+
<slot name="headline" @slotchange=${this.handleTextSlotChange}></slot>
|
|
169
|
+
<slot
|
|
170
|
+
name="supporting-text"
|
|
171
|
+
@slotchange=${this.handleTextSlotChange}
|
|
172
|
+
></slot>
|
|
173
|
+
</div>
|
|
174
|
+
<slot
|
|
175
|
+
class="non-text"
|
|
176
|
+
name="trailing-supporting-text"
|
|
177
|
+
?hidden=${!hasTrailingSupportingText}
|
|
178
|
+
></slot>
|
|
179
|
+
<slot class="non-text" name="end" ?hidden=${!hasEnd}></slot>
|
|
180
|
+
</div>
|
|
181
|
+
`;
|
|
182
|
+
}
|
|
183
|
+
handleTextSlotChange() {
|
|
184
|
+
// Check if there's more than one text slot with content. If so, the item is
|
|
185
|
+
// multiline, which has a different min-height than single line items.
|
|
186
|
+
let isMultiline = false;
|
|
187
|
+
let slotsWithContent = 0;
|
|
188
|
+
for (const slot of this.textSlots) {
|
|
189
|
+
if (hasMeaningfulContent(slot)) {
|
|
190
|
+
slotsWithContent += 1;
|
|
191
|
+
}
|
|
192
|
+
if (slotsWithContent > 1) {
|
|
193
|
+
isMultiline = true;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
this.multiline = isMultiline;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
Item.styles = [css_248z];
|
|
201
|
+
__decorate([
|
|
202
|
+
n({ type: Boolean, reflect: true })
|
|
203
|
+
], Item.prototype, "multiline", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
r('.text slot')
|
|
206
|
+
], Item.prototype, "textSlots", void 0);
|
|
207
|
+
Item = __decorate([
|
|
208
|
+
IndividualComponent
|
|
209
|
+
], Item);
|
|
210
|
+
|
|
211
|
+
export { Item };
|
|
212
|
+
//# sourceMappingURL=item.js.map
|
package/dist/item.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.js","sources":["../node_modules/@lit/reactive-element/decorators/query-all.js","../../src/item/item.ts"],"sourcesContent":["import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nlet e;function r(r){return(n,o)=>t(n,o,{get(){return(this.renderRoot??(e??=document.createDocumentFragment())).querySelectorAll(r)}})}export{r as queryAll};\n//# sourceMappingURL=query-all.js.map\n","import { html, LitElement } from 'lit';\nimport { property, queryAll } from 'lit/decorators.js';\nimport styles from './item.scss';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport { mixinElementInternals } from '@/__internal/mixins/element-internals.js';\n\nimport { hasMeaningfulContent } from '@/__internal/utils/observe-slot-change.js';\n\n/**\n * @label Item\n * @tag wc-item\n * @rawTag item\n *\n * @summary A primitive element used to build higher-level item components such as menu-item, navigation-item, and list-item. Provides start, text, and end slots for flexible content composition.\n *\n * @example\n * ```html\n * <wc-item>\n * <wc-icon slot=\"start\" name=\"notifications\"></wc-icon>\n *\n * <span slot=\"overline\">Settings</span>\n * <span slot=\"headline\">Notifications</span>\n * <span slot=\"supporting-text\">Manage alerts and reminders</span>\n *\n * <span slot=\"trailing-supporting-text\">3</span>\n * <wc-icon slot=\"end\" name=\"chevron_right\"></wc-icon>\n * </wc-item>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class Item extends mixinDelegatesAria(\n mixinElementInternals(LitElement),\n) {\n static styles = [styles];\n\n /**\n * Only needed for SSR.\n *\n * Add this attribute when an item has two lines to avoid a Flash Of Unstyled\n * Content. This attribute is not needed for single line items or items with\n * three or more lines.\n */\n @property({ type: Boolean, reflect: true }) multiline = false;\n\n @queryAll('.text slot') private readonly textSlots!: HTMLSlotElement[];\n\n private __hasNamedSlot(...names: string[]) {\n return names.some(name =>\n Array.from(this.children).some(\n child => child.getAttribute('slot') === name,\n ),\n );\n }\n\n override render() {\n const hasStart = this.__hasNamedSlot('start');\n const hasEnd = this.__hasNamedSlot('end');\n const hasTrailingSupportingText = this.__hasNamedSlot(\n 'trailing-supporting-text',\n );\n\n return html`\n <slot name=\"container\"></slot>\n\n <div class=\"item\">\n <slot class=\"non-text\" name=\"start\" ?hidden=${!hasStart}></slot>\n <div class=\"text\">\n <slot name=\"overline\" @slotchange=${this.handleTextSlotChange}></slot>\n <slot\n class=\"default-slot\"\n @slotchange=${this.handleTextSlotChange}\n ></slot>\n <slot name=\"headline\" @slotchange=${this.handleTextSlotChange}></slot>\n <slot\n name=\"supporting-text\"\n @slotchange=${this.handleTextSlotChange}\n ></slot>\n </div>\n <slot\n class=\"non-text\"\n name=\"trailing-supporting-text\"\n ?hidden=${!hasTrailingSupportingText}\n ></slot>\n <slot class=\"non-text\" name=\"end\" ?hidden=${!hasEnd}></slot>\n </div>\n `;\n }\n\n private handleTextSlotChange() {\n // Check if there's more than one text slot with content. If so, the item is\n // multiline, which has a different min-height than single line items.\n let isMultiline = false;\n let slotsWithContent = 0;\n for (const slot of this.textSlots) {\n if (hasMeaningfulContent(slot)) {\n slotsWithContent += 1;\n }\n\n if (slotsWithContent > 1) {\n isMultiline = true;\n break;\n }\n }\n\n this.multiline = isMultiline;\n }\n}\n"],"names":["t","LitElement","html","styles","property","queryAll"],"mappings":";;;;;;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAM,CAAC,CAAC,CAAC,CAAC,GAAGA,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAM,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,GAAG,QAAQ,CAAC,sBAAsB,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACGrI;;;;;;;;;;;;;;;;;;;;;AAqBG;AAEI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,kBAAkB,CAC1C,qBAAqB,CAACC,GAAU,CAAC,CAClC,CAAA;AAFM,IAAA,WAAA,GAAA;;AAKL;;;;;;AAMG;QACyC,IAAA,CAAA,SAAS,GAAG,KAAK;IAgE/D;IA5DU,cAAc,CAAC,GAAG,KAAe,EAAA;AACvC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,IACpB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC5B,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,IAAI,CAC7C,CACF;IACH;IAES,MAAM,GAAA;QACb,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;QAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;QACzC,MAAM,yBAAyB,GAAG,IAAI,C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__decorate, I as IndividualComponent, a as i$1 } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { e } from './class-map-DG7CA1et.js';
|
|
3
|
+
import { N as NativeHyperlinkMixin } from './NativeHyperlinkMixin-D9J4aBTy.js';
|
|
4
|
+
import './directive-ZPhl09Yt.js';
|
|
5
|
+
import './property-B49QQ8pS.js';
|
|
6
|
+
|
|
7
|
+
var css_248z = i`* {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.screen-reader-only {
|
|
12
|
+
display: none !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[hidden] {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host {
|
|
20
|
+
display: inline;
|
|
21
|
+
color: var(--color-primary);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.link {
|
|
25
|
+
border-radius: inherit;
|
|
26
|
+
corner-shape: inherit;
|
|
27
|
+
color: inherit;
|
|
28
|
+
--icon-color: currentColor;
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
}
|
|
31
|
+
.link:hover, .link:focus-visible {
|
|
32
|
+
text-decoration: underline;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host(.inherit) .link {
|
|
36
|
+
color: inherit;
|
|
37
|
+
text-decoration: none !important;
|
|
38
|
+
}`;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @label Link
|
|
42
|
+
* @tag wc-link
|
|
43
|
+
* @rawTag link
|
|
44
|
+
* @summary The link component is used to navigate to a new page or section within the current page.
|
|
45
|
+
* @cssprop --link-color - Controls the color of the link.
|
|
46
|
+
* @tags navigation
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```html
|
|
50
|
+
* <wc-link href="#">Link</wc-link>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
let Link = class Link extends NativeHyperlinkMixin(i$1) {
|
|
54
|
+
render() {
|
|
55
|
+
return b `<a
|
|
56
|
+
class=${e({
|
|
57
|
+
link: true,
|
|
58
|
+
})}
|
|
59
|
+
href=${this.href}
|
|
60
|
+
?download=${this.download}
|
|
61
|
+
target=${this.target}
|
|
62
|
+
?rel=${this.rel}
|
|
63
|
+
?tabindex=${this.parentElement?.tabIndex}
|
|
64
|
+
>
|
|
65
|
+
<slot></slot>
|
|
66
|
+
</a>`;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
Link.styles = [css_248z];
|
|
70
|
+
Link = __decorate([
|
|
71
|
+
IndividualComponent
|
|
72
|
+
], Link);
|
|
73
|
+
|
|
74
|
+
export { Link };
|
|
75
|
+
//# sourceMappingURL=link.js.map
|
package/dist/link.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sources":["../../src/link/link.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport NativeHyperlinkMixin from '@/__internal/mixins/NativeHyperlinkMixin.js';\nimport styles from './link.scss';\nimport IndividualComponent from '@/IndividualComponent.js';\n\n/**\n * @label Link\n * @tag wc-link\n * @rawTag link\n * @summary The link component is used to navigate to a new page or section within the current page.\n * @cssprop --link-color - Controls the color of the link.\n * @tags navigation\n *\n * @example\n * ```html\n * <wc-link href=\"#\">Link</wc-link>\n * ```\n */\n@IndividualComponent\nexport class Link extends NativeHyperlinkMixin(LitElement) {\n static styles = [styles];\n\n render() {\n return html`<a\n class=${classMap({\n link: true,\n })}\n href=${this.href}\n ?download=${this.download}\n target=${this.target}\n ?rel=${this.rel}\n ?tabindex=${this.parentElement?.tabIndex}\n >\n <slot></slot>\n </a>`;\n }\n}\n"],"names":["LitElement","html","classMap","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;;AAYG;AAEI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,oBAAoB,CAACA,GAAU,CAAC,CAAA;IAGxD,MAAM,GAAA;AACJ,QAAA,OAAOC,CAAI,CAAA,CAAA;AACD,YAAA,EAAAC,CAAQ,CAAC;AACf,YAAA,IAAI,EAAE,IAAI;SACX,CAAC;AACK,WAAA,EAAA,IAAI,CAAC,IAAI;AACJ,gBAAA,EAAA,IAAI,CAAC,QAAQ;AAChB,aAAA,EAAA,IAAI,CAAC,MAAM;AACb,WAAA,EAAA,IAAI,CAAC,GAAG;kBACH,IAAI,CAAC,aAAa,EAAE,QAAQ;;;SAGrC;IACP;;AAfO,IAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AADb,IAAI,GAAA,UAAA,CAAA;IADhB;AACY,CAAA,EAAA,IAAI,CAiBhB;;;;"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { i, a as i$1, A, b, _ as __decorate, I as IndividualComponent } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { n } from './property-B49QQ8pS.js';
|
|
3
|
+
import { e } from './class-map-DG7CA1et.js';
|
|
4
|
+
import { e as e$1 } from './query-CHb9Ft_d.js';
|
|
5
|
+
import { o } from './if-defined-BXZpRQ4P.js';
|
|
6
|
+
import { i as isLink } from './is-link-Dk2OV3PM.js';
|
|
7
|
+
import { i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-CuEqjlPT.js';
|
|
8
|
+
import { m as mixinBaseButton, a as mixinHyperlink } from './hyperlink-DLvb6MXE.js';
|
|
9
|
+
import { m as mixinDelegatesAria, a as mixinElementInternals } from './element-internals-2CMts_0M.js';
|
|
10
|
+
|
|
11
|
+
var css_248z$1 = i`* {
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.screen-reader-only {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[hidden] {
|
|
20
|
+
display: none !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host {
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.list {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
}`;
|
|
31
|
+
|
|
32
|
+
var css_248z = i`* {
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.screen-reader-only {
|
|
37
|
+
display: none !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[hidden] {
|
|
41
|
+
display: none !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host {
|
|
45
|
+
display: flex;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
* Reset native button/link styles
|
|
50
|
+
*/
|
|
51
|
+
.native-button {
|
|
52
|
+
background: transparent;
|
|
53
|
+
border: none;
|
|
54
|
+
appearance: none;
|
|
55
|
+
margin: 0;
|
|
56
|
+
outline: none;
|
|
57
|
+
padding: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.native-link {
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
color: inherit;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
}
|
|
65
|
+
.native-link:link, .native-link:visited, .native-link:hover, .native-link:active {
|
|
66
|
+
text-decoration: none;
|
|
67
|
+
color: inherit;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.list-item {
|
|
71
|
+
position: relative;
|
|
72
|
+
width: 100%;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
text-align: start;
|
|
75
|
+
}
|
|
76
|
+
.list-item .list-item-content {
|
|
77
|
+
--item-padding-inline: 1rem;
|
|
78
|
+
--item-height: 1.5rem;
|
|
79
|
+
--item-multiline-height: 3rem;
|
|
80
|
+
--item-label-text-color: var(--_label-text-color);
|
|
81
|
+
--item-label-text-opacity: var(--_label-text-opacity, 1);
|
|
82
|
+
}
|
|
83
|
+
.list-item .leading,
|
|
84
|
+
.list-item .trailing {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
min-width: 1.5rem;
|
|
89
|
+
color: var(--_leading-trailing-color);
|
|
90
|
+
}
|
|
91
|
+
.list-item .trailing {
|
|
92
|
+
margin-inline-start: auto;
|
|
93
|
+
}
|
|
94
|
+
.list-item .content {
|
|
95
|
+
display: block;
|
|
96
|
+
flex: 1;
|
|
97
|
+
min-inline-size: 0;
|
|
98
|
+
}
|
|
99
|
+
.list-item .background {
|
|
100
|
+
background-color: var(--_container-color);
|
|
101
|
+
opacity: var(--_container-opacity, 1);
|
|
102
|
+
border-radius: var(--shape-corner-medium);
|
|
103
|
+
}
|
|
104
|
+
.list-item .focus-ring {
|
|
105
|
+
--focus-ring-container-shape-start-start: var(--shape-corner-medium);
|
|
106
|
+
--focus-ring-container-shape-start-end: var(--shape-corner-medium);
|
|
107
|
+
--focus-ring-container-shape-end-start: var(--shape-corner-medium);
|
|
108
|
+
--focus-ring-container-shape-end-end: var(--shape-corner-medium);
|
|
109
|
+
z-index: 2;
|
|
110
|
+
--focus-ring-inset: 0px;
|
|
111
|
+
}
|
|
112
|
+
.list-item .ripple {
|
|
113
|
+
--ripple-state-opacity: var(--_container-state-opacity, 0);
|
|
114
|
+
--ripple-pressed-color: var(--_container-state-color);
|
|
115
|
+
border-radius: var(--shape-corner-medium);
|
|
116
|
+
}
|
|
117
|
+
.list-item .skeleton {
|
|
118
|
+
z-index: 2;
|
|
119
|
+
--skeleton-container-shape-start-start: var(--shape-corner-medium);
|
|
120
|
+
--skeleton-container-shape-start-end: var(--shape-corner-medium);
|
|
121
|
+
--skeleton-container-shape-end-start: var(--shape-corner-medium);
|
|
122
|
+
--skeleton-container-shape-end-end: var(--shape-corner-medium);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host(:not([skeleton])) .skeleton {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host-context([variant=standard]) {
|
|
130
|
+
--_container-color: transparent;
|
|
131
|
+
--_label-text-color: var(--color-on-surface);
|
|
132
|
+
--_leading-trailing-color: var(--color-on-surface-variant);
|
|
133
|
+
--_container-state-color: var(--color-on-surface);
|
|
134
|
+
}
|
|
135
|
+
:host-context([variant=standard]):host(:hover:not([disabled], [soft-disabled], [skeleton])) {
|
|
136
|
+
--_container-state-opacity: 0.08;
|
|
137
|
+
}
|
|
138
|
+
:host-context([variant=standard]):host(:active:not([disabled], [soft-disabled], [skeleton])) {
|
|
139
|
+
--_container-state-opacity: 0.12;
|
|
140
|
+
}
|
|
141
|
+
:host-context([variant=standard]):host([selected]) {
|
|
142
|
+
--_container-color: var(--color-secondary-container);
|
|
143
|
+
--_label-text-color: var(--color-on-secondary-container);
|
|
144
|
+
--_leading-trailing-color: var(--color-on-secondary-container);
|
|
145
|
+
--_container-state-color: var(--color-on-secondary-container);
|
|
146
|
+
}
|
|
147
|
+
:host-context([variant=standard]):host([disabled]), :host-context([variant=standard]):host([soft-disabled]) {
|
|
148
|
+
cursor: not-allowed;
|
|
149
|
+
--_label-text-color: var(--color-on-surface);
|
|
150
|
+
--_label-text-opacity: 0.38;
|
|
151
|
+
--_leading-trailing-color: var(--color-on-surface);
|
|
152
|
+
--_container-opacity: 0.12;
|
|
153
|
+
}
|
|
154
|
+
:host-context([variant=standard]):host([disabled]) .ripple, :host-context([variant=standard]):host([soft-disabled]) .ripple {
|
|
155
|
+
display: none;
|
|
156
|
+
}`;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @label List Item
|
|
160
|
+
* @tag wc-list-item
|
|
161
|
+
* @rawTag list-item
|
|
162
|
+
*
|
|
163
|
+
* @summary A list item with leading, trailing and content slots.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```html
|
|
167
|
+
* <wc-list-item selected>
|
|
168
|
+
* <wc-icon slot="leading" name="person"></wc-icon>
|
|
169
|
+
* Profile
|
|
170
|
+
* <wc-icon slot="trailing" name="chevron_right"></wc-icon>
|
|
171
|
+
* </wc-list-item>
|
|
172
|
+
* ```
|
|
173
|
+
* @tags display
|
|
174
|
+
*/
|
|
175
|
+
class ListItem extends mixinBaseButton(mixinHyperlink(mixinDelegatesAria(mixinElementInternals(i$1)))) {
|
|
176
|
+
constructor() {
|
|
177
|
+
super();
|
|
178
|
+
this.selected = false;
|
|
179
|
+
/** When true, renders the list-item in a loading skeleton state. */
|
|
180
|
+
this.skeleton = false;
|
|
181
|
+
this.__dispatchClick = (event) => {
|
|
182
|
+
// If the button is soft-disabled or a disabled link, we need to explicitly
|
|
183
|
+
// prevent the click from propagating to other event listeners as well as
|
|
184
|
+
// prevent the default action.
|
|
185
|
+
if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {
|
|
186
|
+
event.stopImmediatePropagation();
|
|
187
|
+
event.preventDefault();
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (!isActivationClick(event) || !this.itemElement) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this.focus();
|
|
194
|
+
dispatchActivationClick(this.itemElement);
|
|
195
|
+
};
|
|
196
|
+
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
197
|
+
}
|
|
198
|
+
connectedCallback() {
|
|
199
|
+
// eslint-disable-next-line wc/guard-super-call
|
|
200
|
+
super.connectedCallback();
|
|
201
|
+
if (!this.hasAttribute('role')) {
|
|
202
|
+
this.setAttribute('role', 'listitem');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
focus() {
|
|
206
|
+
this.itemElement?.focus();
|
|
207
|
+
}
|
|
208
|
+
blur() {
|
|
209
|
+
this.itemElement?.blur();
|
|
210
|
+
}
|
|
211
|
+
__hasNamedSlot(...names) {
|
|
212
|
+
return names.some(name => Array.from(this.children).some(child => child.getAttribute('slot') === name));
|
|
213
|
+
}
|
|
214
|
+
render() {
|
|
215
|
+
const isElementLink = isLink(this);
|
|
216
|
+
const cssClasses = {
|
|
217
|
+
'list-item': true,
|
|
218
|
+
'native-button': !isElementLink,
|
|
219
|
+
'native-link': isElementLink,
|
|
220
|
+
};
|
|
221
|
+
// Needed for closure conformance
|
|
222
|
+
const { ariaLabel } = this;
|
|
223
|
+
if (!isElementLink) {
|
|
224
|
+
return b `
|
|
225
|
+
<button
|
|
226
|
+
id="list-item"
|
|
227
|
+
class=${e(cssClasses)}
|
|
228
|
+
?disabled=${this.disabled}
|
|
229
|
+
aria-label="${ariaLabel || A}"
|
|
230
|
+
?aria-disabled=${this.softDisabled}
|
|
231
|
+
@click=${this.__dispatchClick}
|
|
232
|
+
>
|
|
233
|
+
${this.renderContent()}
|
|
234
|
+
</button>
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
237
|
+
return b `
|
|
238
|
+
<a
|
|
239
|
+
id="list-item"
|
|
240
|
+
class=${e(cssClasses)}
|
|
241
|
+
href=${this.href}
|
|
242
|
+
target=${this.target}
|
|
243
|
+
rel=${o(this.rel)}
|
|
244
|
+
download=${o(this.download)}
|
|
245
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
246
|
+
aria-disabled=${String(this.disabled || this.softDisabled)}
|
|
247
|
+
@click=${this.__dispatchClick}
|
|
248
|
+
>
|
|
249
|
+
${this.renderContent()}
|
|
250
|
+
</a>
|
|
251
|
+
`;
|
|
252
|
+
}
|
|
253
|
+
renderContent() {
|
|
254
|
+
const hasLeading = this.__hasNamedSlot('leading');
|
|
255
|
+
const hasTrailingSupportingText = this.__hasNamedSlot('trailing-supporting-text');
|
|
256
|
+
const hasTrailing = this.__hasNamedSlot('trailing');
|
|
257
|
+
return b `
|
|
258
|
+
<wc-item class="list-item-content">
|
|
259
|
+
<wc-focus-ring
|
|
260
|
+
class="focus-ring"
|
|
261
|
+
for="list-item"
|
|
262
|
+
slot="container"
|
|
263
|
+
></wc-focus-ring>
|
|
264
|
+
<div class="background" slot="container"></div>
|
|
265
|
+
<wc-ripple class="ripple" for="list-item" slot="container"></wc-ripple>
|
|
266
|
+
<wc-skeleton class="skeleton" slot="container"></wc-skeleton>
|
|
267
|
+
|
|
268
|
+
<slot name="leading" slot="start" ?hidden=${!hasLeading}></slot>
|
|
269
|
+
<slot name="overline" slot="overline"></slot>
|
|
270
|
+
<slot name="headline" slot="headline"></slot>
|
|
271
|
+
<slot></slot>
|
|
272
|
+
<slot name="supporting-text" slot="supporting-text"></slot>
|
|
273
|
+
|
|
274
|
+
<slot
|
|
275
|
+
name="trailing-supporting-text"
|
|
276
|
+
slot="trailing-supporting-text"
|
|
277
|
+
?hidden=${!hasTrailingSupportingText}
|
|
278
|
+
></slot>
|
|
279
|
+
<slot name="trailing" slot="end" ?hidden=${!hasTrailing}></slot>
|
|
280
|
+
</wc-item>
|
|
281
|
+
`;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
285
|
+
/** @nocollapse */ // eslint-disable-next-line
|
|
286
|
+
ListItem.shadowRootOptions = {
|
|
287
|
+
mode: 'open',
|
|
288
|
+
delegatesFocus: true,
|
|
289
|
+
};
|
|
290
|
+
ListItem.styles = [css_248z];
|
|
291
|
+
__decorate([
|
|
292
|
+
n({ type: Boolean, reflect: true })
|
|
293
|
+
], ListItem.prototype, "selected", void 0);
|
|
294
|
+
__decorate([
|
|
295
|
+
n({ type: Boolean, reflect: true })
|
|
296
|
+
], ListItem.prototype, "skeleton", void 0);
|
|
297
|
+
__decorate([
|
|
298
|
+
e$1('#list-item')
|
|
299
|
+
], ListItem.prototype, "itemElement", void 0);
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @label List
|
|
303
|
+
* @tag wc-list
|
|
304
|
+
* @rawTag list
|
|
305
|
+
*
|
|
306
|
+
* @summary A list container for one or more list items.
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* ```html
|
|
310
|
+
* <wc-list>
|
|
311
|
+
* <wc-list-item>
|
|
312
|
+
* <wc-icon slot="leading" name="inbox"></wc-icon>
|
|
313
|
+
* Inbox
|
|
314
|
+
* <span slot="trailing">24</span>
|
|
315
|
+
* </wc-list-item>
|
|
316
|
+
* </wc-list>
|
|
317
|
+
* ```
|
|
318
|
+
* @tags display
|
|
319
|
+
*/
|
|
320
|
+
let List = class List extends i$1 {
|
|
321
|
+
constructor() {
|
|
322
|
+
super(...arguments);
|
|
323
|
+
/** */
|
|
324
|
+
this.variant = 'standard';
|
|
325
|
+
}
|
|
326
|
+
connectedCallback() {
|
|
327
|
+
super.connectedCallback();
|
|
328
|
+
this.setAttribute('role', 'list');
|
|
329
|
+
}
|
|
330
|
+
render() {
|
|
331
|
+
const cssClasses = {
|
|
332
|
+
list: true,
|
|
333
|
+
[`variant-${this.variant}`]: true,
|
|
334
|
+
};
|
|
335
|
+
return b `
|
|
336
|
+
<div class=${e(cssClasses)}>
|
|
337
|
+
<slot></slot>
|
|
338
|
+
</div>
|
|
339
|
+
`;
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
List.styles = [css_248z$1];
|
|
343
|
+
List.Item = ListItem;
|
|
344
|
+
__decorate([
|
|
345
|
+
n({ type: String, reflect: true })
|
|
346
|
+
], List.prototype, "variant", void 0);
|
|
347
|
+
List = __decorate([
|
|
348
|
+
IndividualComponent
|
|
349
|
+
], List);
|
|
350
|
+
|
|
351
|
+
export { List as L, ListItem as a };
|
|
352
|
+
//# sourceMappingURL=list-D6JLh1uh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-D6JLh1uh.js","sources":["../../src/list/list-item.ts","../../src/list/list.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport styles from './list-item.scss';\nimport { isLink } from '@/__internal/utils/is-link.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__internal/utils/dispatch-event-utils.js';\nimport { ARIAMixinStrict } from '@/__internal/aria/aria.js';\nimport { mixinBaseButton } from '@/button/base-button/base-button.js';\nimport { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport { mixinElementInternals } from '@/__internal/mixins/element-internals.js';\n\n/**\n * @label List Item\n * @tag wc-list-item\n * @rawTag list-item\n *\n * @summary A list item with leading, trailing and content slots.\n *\n * @example\n * ```html\n * <wc-list-item selected>\n * <wc-icon slot=\"leading\" name=\"person\"></wc-icon>\n * Profile\n * <wc-icon slot=\"trailing\" name=\"chevron_right\"></wc-icon>\n * </wc-list-item>\n * ```\n * @tags display\n */\nexport class ListItem extends mixinBaseButton(\n mixinHyperlink(mixinDelegatesAria(mixinElementInternals(LitElement))),\n) {\n // ── Static ───────────────────────────────────────────────────────────────\n\n /** @nocollapse */ // eslint-disable-next-line\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static styles = [styles];\n\n @property({ type: Boolean, reflect: true }) selected = false;\n\n /** When true, renders the list-item in a loading skeleton state. */\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n @query('#list-item') readonly itemElement!: HTMLElement | null;\n\n constructor() {\n super();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n }\n\n connectedCallback() {\n // eslint-disable-next-line wc/guard-super-call\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n }\n\n override focus() {\n this.itemElement?.focus();\n }\n\n override blur() {\n this.itemElement?.blur();\n }\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // If the button is soft-disabled or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.itemElement) {\n return;\n }\n\n this.focus();\n dispatchActivationClick(this.itemElement);\n };\n\n private __hasNamedSlot(...names: string[]) {\n return names.some(name =>\n Array.from(this.children).some(\n child => child.getAttribute('slot') === name,\n ),\n );\n }\n\n render() {\n const isElementLink = isLink(this);\n\n const cssClasses = {\n 'list-item': true,\n 'native-button': !isElementLink,\n 'native-link': isElementLink,\n };\n\n // Needed for closure conformance\n const { ariaLabel } = this as ARIAMixinStrict;\n\n if (!isElementLink) {\n return html`\n <button\n id=\"list-item\"\n class=${classMap(cssClasses)}\n ?disabled=${this.disabled}\n aria-label=\"${ariaLabel || nothing}\"\n ?aria-disabled=${this.softDisabled}\n @click=${this.__dispatchClick}\n >\n ${this.renderContent()}\n </button>\n `;\n }\n\n return html`\n <a\n id=\"list-item\"\n class=${classMap(cssClasses)}\n href=${this.href}\n target=${this.target}\n rel=${ifDefined(this.rel)}\n download=${ifDefined(this.download)}\n tabindex=${this.disabled ? '-1' : '0'}\n aria-disabled=${String(this.disabled || this.softDisabled)}\n @click=${this.__dispatchClick}\n >\n ${this.renderContent()}\n </a>\n `;\n }\n\n renderContent() {\n const hasLeading = this.__hasNamedSlot('leading');\n const hasTrailingSupportingText = this.__hasNamedSlot(\n 'trailing-supporting-text',\n );\n const hasTrailing = this.__hasNamedSlot('trailing');\n\n return html`\n <wc-item class=\"list-item-content\">\n <wc-focus-ring\n class=\"focus-ring\"\n for=\"list-item\"\n slot=\"container\"\n ></wc-focus-ring>\n <div class=\"background\" slot=\"container\"></div>\n <wc-ripple class=\"ripple\" for=\"list-item\" slot=\"container\"></wc-ripple>\n <wc-skeleton class=\"skeleton\" slot=\"container\"></wc-skeleton>\n\n <slot name=\"leading\" slot=\"start\" ?hidden=${!hasLeading}></slot>\n <slot name=\"overline\" slot=\"overline\"></slot>\n <slot name=\"headline\" slot=\"headline\"></slot>\n <slot></slot>\n <slot name=\"supporting-text\" slot=\"supporting-text\"></slot>\n\n <slot\n name=\"trailing-supporting-text\"\n slot=\"trailing-supporting-text\"\n ?hidden=${!hasTrailingSupportingText}\n ></slot>\n <slot name=\"trailing\" slot=\"end\" ?hidden=${!hasTrailing}></slot>\n </wc-item>\n `;\n }\n}\n","import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './list.scss';\nimport { ListItem } from './list-item.js';\nimport IndividualComponent from '@/IndividualComponent.js';\n\n/**\n * @label List\n * @tag wc-list\n * @rawTag list\n *\n * @summary A list container for one or more list items.\n *\n * @example\n * ```html\n * <wc-list>\n * <wc-list-item>\n * <wc-icon slot=\"leading\" name=\"inbox\"></wc-icon>\n * Inbox\n * <span slot=\"trailing\">24</span>\n * </wc-list-item>\n * </wc-list>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class List extends LitElement {\n static styles = [styles];\n\n static Item = ListItem;\n\n /** */\n @property({ type: String, reflect: true }) variant: 'standard' | 'segmented' =\n 'standard';\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'list');\n }\n\n render() {\n const cssClasses = {\n list: true,\n [`variant-${this.variant}`]: true,\n };\n\n return html`\n <div class=${classMap(cssClasses)}>\n <slot></slot>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","nothing","ifDefined","styles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;AAgBG;AACG,MAAO,QAAS,SAAQ,eAAe,CAC3C,cAAc,CAAC,kBAAkB,CAAC,qBAAqB,CAACA,GAAU,CAAC,CAAC,CAAC,CACtE,CAAA;AAkBC,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QARmC,IAAA,CAAA,QAAQ,GAAG,KAAK;;QAGhB,IAAA,CAAA,QAAQ,GAAY,KAAK;AA0BrE,QAAA,IAAA,CAAA,eAAe,GAAG,CAAC,KAAiC,KAAI;;;;AAItD,YAAA,IAAI,IAAI,CAAC,YA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