@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
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, c as __classPrivateFieldGet, b } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { n } from './property-B49QQ8pS.js';
|
|
3
|
+
import { r } from './state-DkTK9EGF.js';
|
|
4
|
+
import { e } from './query-CHb9Ft_d.js';
|
|
5
|
+
import { e as e$1 } from './class-map-DG7CA1et.js';
|
|
6
|
+
import { i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-CuEqjlPT.js';
|
|
7
|
+
import { o as observerSlotChangesWithCallback } from './observe-slot-change-DPxaZrZF.js';
|
|
8
|
+
import { t as throttle } from './throttle-C7ZAPqtu.js';
|
|
9
|
+
import { i as isLink } from './is-link-Dk2OV3PM.js';
|
|
10
|
+
import './base-Cl6v8-BZ.js';
|
|
11
|
+
import './directive-ZPhl09Yt.js';
|
|
12
|
+
|
|
13
|
+
var css_248z = i`* {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.screen-reader-only {
|
|
18
|
+
display: none !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[hidden] {
|
|
22
|
+
display: none !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host {
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Reset native button/link styles */
|
|
30
|
+
.item-element {
|
|
31
|
+
background: transparent;
|
|
32
|
+
border: none;
|
|
33
|
+
appearance: none;
|
|
34
|
+
margin: 0;
|
|
35
|
+
outline: none;
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
text-align: unset;
|
|
38
|
+
color: inherit;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.item {
|
|
42
|
+
position: relative;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
width: 100%;
|
|
48
|
+
min-height: 3.5rem; /* 56dp */
|
|
49
|
+
padding-block: 0.25rem; /* 4dp vertical padding */
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
gap: 0.25rem; /* 4dp gap between indicator and label */
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
/* Color tokens */
|
|
54
|
+
--_inactive-icon-color: var(--nav-rail-inactive-icon-color, var(--color-on-surface-variant));
|
|
55
|
+
--_active-icon-color: var(--nav-rail-active-icon-color, var(--color-on-secondary-container));
|
|
56
|
+
--_inactive-label-color: var(--nav-rail-inactive-label-color, var(--color-on-surface-variant));
|
|
57
|
+
--_active-label-color: var(--nav-rail-active-label-color, var(--color-on-surface));
|
|
58
|
+
--_indicator-color: var(--nav-rail-indicator-color, var(--color-secondary-container));
|
|
59
|
+
--_indicator-shape: var(--nav-rail-indicator-shape, var(--shape-corner-full));
|
|
60
|
+
--_indicator-width: var(--nav-rail-indicator-width, 3.5rem); /* 56dp */
|
|
61
|
+
--_indicator-height: var(--nav-rail-indicator-height, 2rem); /* 32dp */
|
|
62
|
+
--_state-color: var(--_inactive-icon-color);
|
|
63
|
+
/* Focus ring */
|
|
64
|
+
}
|
|
65
|
+
.item .focus-ring {
|
|
66
|
+
z-index: 3;
|
|
67
|
+
--focus-ring-container-shape-start-start: var(--shape-corner-small);
|
|
68
|
+
--focus-ring-container-shape-start-end: var(--shape-corner-small);
|
|
69
|
+
--focus-ring-container-shape-end-start: var(--shape-corner-small);
|
|
70
|
+
--focus-ring-container-shape-end-end: var(--shape-corner-small);
|
|
71
|
+
}
|
|
72
|
+
.item {
|
|
73
|
+
/* Active indicator (pill behind icon) */
|
|
74
|
+
}
|
|
75
|
+
.item .indicator {
|
|
76
|
+
position: relative;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
width: var(--_indicator-width);
|
|
81
|
+
height: var(--_indicator-height);
|
|
82
|
+
border-radius: var(--_indicator-shape);
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
transition: background-color var(--duration-short4, 200ms) var(--easing-standard, ease);
|
|
86
|
+
}
|
|
87
|
+
.item .indicator .ripple {
|
|
88
|
+
inset: 0;
|
|
89
|
+
z-index: 0;
|
|
90
|
+
--ripple-pressed-color: var(--_state-color);
|
|
91
|
+
border-radius: inherit;
|
|
92
|
+
}
|
|
93
|
+
.item .indicator .icon-container {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
z-index: 1;
|
|
98
|
+
position: relative;
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
}
|
|
101
|
+
.item .indicator .icon-container ::slotted(*) {
|
|
102
|
+
--icon-size: 1.5rem; /* 24dp */
|
|
103
|
+
--icon-color: var(--_inactive-icon-color);
|
|
104
|
+
color: var(--_inactive-icon-color);
|
|
105
|
+
display: flex;
|
|
106
|
+
}
|
|
107
|
+
.item {
|
|
108
|
+
/* Label */
|
|
109
|
+
}
|
|
110
|
+
.item .label {
|
|
111
|
+
font-family: var(--typography-label-medium-font-family) !important;
|
|
112
|
+
font-size: var(--typography-label-medium-font-size) !important;
|
|
113
|
+
font-weight: var(--typography-label-medium-font-weight) !important;
|
|
114
|
+
line-height: var(--typography-label-medium-line-height) !important;
|
|
115
|
+
letter-spacing: var(--typography-label-medium-letter-spacing) !important;
|
|
116
|
+
color: var(--_inactive-label-color);
|
|
117
|
+
text-align: center;
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
z-index: 1;
|
|
120
|
+
transition: color var(--duration-short4, 200ms) var(--easing-standard, ease), font-weight var(--duration-short4, 200ms) var(--easing-standard, ease);
|
|
121
|
+
}
|
|
122
|
+
.item {
|
|
123
|
+
/* Hide label when collapsed via class */
|
|
124
|
+
}
|
|
125
|
+
.item .label.hidden {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
.item {
|
|
129
|
+
/* Active icon slot: hidden by default */
|
|
130
|
+
}
|
|
131
|
+
.item .active-icon-slot {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
.item .hidden-slot {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
137
|
+
.item {
|
|
138
|
+
/* Item content layout */
|
|
139
|
+
}
|
|
140
|
+
.item .item-content {
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-direction: column;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: 0.25rem;
|
|
145
|
+
width: 100%;
|
|
146
|
+
z-index: 1;
|
|
147
|
+
}
|
|
148
|
+
.item {
|
|
149
|
+
/* Active state */
|
|
150
|
+
}
|
|
151
|
+
.item.active {
|
|
152
|
+
--_state-color: var(--_active-icon-color);
|
|
153
|
+
}
|
|
154
|
+
.item.active .indicator {
|
|
155
|
+
background-color: var(--_indicator-color);
|
|
156
|
+
}
|
|
157
|
+
.item.active .indicator .icon-container ::slotted(*) {
|
|
158
|
+
--icon-color: var(--_active-icon-color);
|
|
159
|
+
color: var(--_active-icon-color);
|
|
160
|
+
}
|
|
161
|
+
.item.active .label {
|
|
162
|
+
color: var(--_active-label-color);
|
|
163
|
+
font-weight: var(--typography-label-medium-font-weight-bold, 700);
|
|
164
|
+
}
|
|
165
|
+
.item {
|
|
166
|
+
/* Active icon slot: show when active and slot has content */
|
|
167
|
+
}
|
|
168
|
+
.item.active.has-active-icon .active-icon-slot {
|
|
169
|
+
display: flex;
|
|
170
|
+
}
|
|
171
|
+
.item.active.has-active-icon .icon-slot {
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
174
|
+
.item {
|
|
175
|
+
/* Disabled state */
|
|
176
|
+
}
|
|
177
|
+
.item.disabled {
|
|
178
|
+
cursor: not-allowed;
|
|
179
|
+
}
|
|
180
|
+
.item.disabled .indicator .icon-container ::slotted(*) {
|
|
181
|
+
--icon-color: var(--color-on-surface);
|
|
182
|
+
color: var(--color-on-surface);
|
|
183
|
+
opacity: 0.38;
|
|
184
|
+
}
|
|
185
|
+
.item.disabled .label {
|
|
186
|
+
color: var(--color-on-surface);
|
|
187
|
+
opacity: 0.38;
|
|
188
|
+
}
|
|
189
|
+
.item.disabled .ripple {
|
|
190
|
+
display: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@media (prefers-reduced-motion: reduce) {
|
|
194
|
+
.item .indicator,
|
|
195
|
+
.item .label {
|
|
196
|
+
transition: none;
|
|
197
|
+
}
|
|
198
|
+
}`;
|
|
199
|
+
|
|
200
|
+
var _NavigationRailItem_id;
|
|
201
|
+
/**
|
|
202
|
+
* @label Navigation Rail Item
|
|
203
|
+
* @tag wc-navigation-rail-item
|
|
204
|
+
* @rawTag navigation-rail-item
|
|
205
|
+
*
|
|
206
|
+
* @summary An individual item within a navigation rail.
|
|
207
|
+
* @overview
|
|
208
|
+
* <p>Navigation rail items display a destination with an icon and optional label.</p>
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* ```html
|
|
212
|
+
* <wc-navigation-rail-item>
|
|
213
|
+
* <wc-icon slot="icon">home</wc-icon>
|
|
214
|
+
* Home
|
|
215
|
+
* </wc-navigation-rail-item>
|
|
216
|
+
* ```
|
|
217
|
+
* @tags navigation
|
|
218
|
+
*/
|
|
219
|
+
let NavigationRailItem = class NavigationRailItem extends i$1 {
|
|
220
|
+
constructor() {
|
|
221
|
+
super();
|
|
222
|
+
_NavigationRailItem_id.set(this, crypto.randomUUID());
|
|
223
|
+
/** Whether this item is currently active/selected. */
|
|
224
|
+
this.active = false;
|
|
225
|
+
/** Whether this item is disabled. */
|
|
226
|
+
this.disabled = false;
|
|
227
|
+
/** Whether the parent rail is in collapsed mode (labels hidden). */
|
|
228
|
+
this.collapsed = false;
|
|
229
|
+
/** Link target. */
|
|
230
|
+
this.target = '_self';
|
|
231
|
+
/** Reason the item is disabled (shown to screen readers). */
|
|
232
|
+
this.disabledReason = '';
|
|
233
|
+
/** Sets the delay for throttle in milliseconds. When null (default), no throttle is applied. */
|
|
234
|
+
this.throttleDelay = null;
|
|
235
|
+
/** True when the default slot contains label content. */
|
|
236
|
+
this._hasLabel = false;
|
|
237
|
+
/** True when the `active-icon` slot contains content. */
|
|
238
|
+
this._hasActiveIcon = false;
|
|
239
|
+
this.__dispatchClickWithThrottle = event => {
|
|
240
|
+
this.__dispatchClick(event);
|
|
241
|
+
};
|
|
242
|
+
this.__dispatchClick = (event) => {
|
|
243
|
+
if (this.disabled && this.href) {
|
|
244
|
+
event.stopImmediatePropagation();
|
|
245
|
+
event.preventDefault();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (!isActivationClick(event) || !this.itemElement) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
this.focus();
|
|
252
|
+
dispatchActivationClick(this.itemElement);
|
|
253
|
+
};
|
|
254
|
+
this.addEventListener('click', this.__dispatchClickWithThrottle);
|
|
255
|
+
}
|
|
256
|
+
focus() {
|
|
257
|
+
this.itemElement?.focus();
|
|
258
|
+
}
|
|
259
|
+
blur() {
|
|
260
|
+
this.itemElement?.blur();
|
|
261
|
+
}
|
|
262
|
+
firstUpdated() {
|
|
263
|
+
if (typeof this.throttleDelay === 'number') {
|
|
264
|
+
this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
|
|
265
|
+
}
|
|
266
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot.label'), hasContent => {
|
|
267
|
+
this._hasLabel = hasContent;
|
|
268
|
+
this.requestUpdate();
|
|
269
|
+
});
|
|
270
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot.active-icon-slot'), hasContent => {
|
|
271
|
+
this._hasActiveIcon = hasContent;
|
|
272
|
+
this.requestUpdate();
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
__getDisabledReasonID() {
|
|
276
|
+
return this.disabled && this.disabledReason
|
|
277
|
+
? `disabled-reason-${__classPrivateFieldGet(this, _NavigationRailItem_id, "f")}`
|
|
278
|
+
: A;
|
|
279
|
+
}
|
|
280
|
+
__renderDisabledReason() {
|
|
281
|
+
const disabledReasonID = this.__getDisabledReasonID();
|
|
282
|
+
if (disabledReasonID)
|
|
283
|
+
return b `<div
|
|
284
|
+
id="disabled-reason-${__classPrivateFieldGet(this, _NavigationRailItem_id, "f")}"
|
|
285
|
+
role="tooltip"
|
|
286
|
+
aria-label=${this.disabledReason}
|
|
287
|
+
class="screen-reader-only"
|
|
288
|
+
>
|
|
289
|
+
${this.disabledReason}
|
|
290
|
+
</div>`;
|
|
291
|
+
return A;
|
|
292
|
+
}
|
|
293
|
+
__renderItemContent() {
|
|
294
|
+
return b `
|
|
295
|
+
<wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
|
|
296
|
+
|
|
297
|
+
<div class="item-content">
|
|
298
|
+
<div class="indicator">
|
|
299
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
300
|
+
<div class="icon-container">
|
|
301
|
+
<slot name="active-icon" class="active-icon-slot"></slot>
|
|
302
|
+
<slot name="icon" class="icon-slot"></slot>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
<div class="label ${this.collapsed ? 'hidden' : ''}"><slot></slot></div>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
${this.__renderDisabledReason()}
|
|
309
|
+
`;
|
|
310
|
+
}
|
|
311
|
+
render() {
|
|
312
|
+
const cssClasses = {
|
|
313
|
+
item: true,
|
|
314
|
+
'item-element': true,
|
|
315
|
+
active: this.active,
|
|
316
|
+
disabled: this.disabled,
|
|
317
|
+
'has-label': this._hasLabel,
|
|
318
|
+
'has-active-icon': this._hasActiveIcon,
|
|
319
|
+
};
|
|
320
|
+
if (!isLink(this)) {
|
|
321
|
+
return b `<button
|
|
322
|
+
id="item"
|
|
323
|
+
class=${e$1(cssClasses)}
|
|
324
|
+
?disabled=${this.disabled}
|
|
325
|
+
aria-disabled=${`${this.disabled}`}
|
|
326
|
+
aria-current=${this.active ? 'page' : A}
|
|
327
|
+
?aria-describedby=${this.__getDisabledReasonID()}
|
|
328
|
+
>
|
|
329
|
+
${this.__renderItemContent()}
|
|
330
|
+
</button>`;
|
|
331
|
+
}
|
|
332
|
+
return b `<a
|
|
333
|
+
id="item"
|
|
334
|
+
class=${e$1(cssClasses)}
|
|
335
|
+
href=${this.href}
|
|
336
|
+
target=${this.target}
|
|
337
|
+
aria-current=${this.active ? 'page' : A}
|
|
338
|
+
aria-disabled=${`${this.disabled}`}
|
|
339
|
+
?aria-describedby=${this.__getDisabledReasonID()}
|
|
340
|
+
>
|
|
341
|
+
${this.__renderItemContent()}
|
|
342
|
+
</a>`;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
_NavigationRailItem_id = new WeakMap();
|
|
346
|
+
NavigationRailItem.styles = [css_248z];
|
|
347
|
+
__decorate([
|
|
348
|
+
n({ type: Boolean, reflect: true })
|
|
349
|
+
], NavigationRailItem.prototype, "active", void 0);
|
|
350
|
+
__decorate([
|
|
351
|
+
n({ type: Boolean, reflect: true })
|
|
352
|
+
], NavigationRailItem.prototype, "disabled", void 0);
|
|
353
|
+
__decorate([
|
|
354
|
+
n({ type: Boolean, reflect: true })
|
|
355
|
+
], NavigationRailItem.prototype, "collapsed", void 0);
|
|
356
|
+
__decorate([
|
|
357
|
+
n({ reflect: true })
|
|
358
|
+
], NavigationRailItem.prototype, "href", void 0);
|
|
359
|
+
__decorate([
|
|
360
|
+
n()
|
|
361
|
+
], NavigationRailItem.prototype, "target", void 0);
|
|
362
|
+
__decorate([
|
|
363
|
+
n({ reflect: true })
|
|
364
|
+
], NavigationRailItem.prototype, "value", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
n({ attribute: 'disabled-reason' })
|
|
367
|
+
], NavigationRailItem.prototype, "disabledReason", void 0);
|
|
368
|
+
__decorate([
|
|
369
|
+
n({ type: Number })
|
|
370
|
+
], NavigationRailItem.prototype, "throttleDelay", void 0);
|
|
371
|
+
__decorate([
|
|
372
|
+
r()
|
|
373
|
+
], NavigationRailItem.prototype, "_hasLabel", void 0);
|
|
374
|
+
__decorate([
|
|
375
|
+
r()
|
|
376
|
+
], NavigationRailItem.prototype, "_hasActiveIcon", void 0);
|
|
377
|
+
__decorate([
|
|
378
|
+
e('.item-element')
|
|
379
|
+
], NavigationRailItem.prototype, "itemElement", void 0);
|
|
380
|
+
NavigationRailItem = __decorate([
|
|
381
|
+
IndividualComponent
|
|
382
|
+
], NavigationRailItem);
|
|
383
|
+
|
|
384
|
+
export { NavigationRailItem };
|
|
385
|
+
//# sourceMappingURL=navigation-rail-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-item.js","sources":["../../src/navigation-rail/navigation-rail-item.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__internal/utils/dispatch-event-utils.js';\nimport { observerSlotChangesWithCallback } from '@/__internal/utils/observe-slot-change.js';\nimport { throttle } from '@/__internal/utils/throttle.js';\nimport { isLink } from '@/__internal/utils/is-link.js';\nimport styles from './navigation-rail-item.scss';\nimport IndividualComponent from '@/IndividualComponent.js';\n\n/**\n * @label Navigation Rail Item\n * @tag wc-navigation-rail-item\n * @rawTag navigation-rail-item\n *\n * @summary An individual item within a navigation rail.\n * @overview\n * <p>Navigation rail items display a destination with an icon and optional label.</p>\n *\n * @example\n * ```html\n * <wc-navigation-rail-item>\n * <wc-icon slot=\"icon\">home</wc-icon>\n * Home\n * </wc-navigation-rail-item>\n * ```\n * @tags navigation\n */\n@IndividualComponent\nexport class NavigationRailItem extends LitElement {\n #id = crypto.randomUUID();\n\n static styles = [styles];\n\n /** Whether this item is currently active/selected. */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /** Whether this item is disabled. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Whether the parent rail is in collapsed mode (labels hidden). */\n @property({ type: Boolean, reflect: true }) collapsed = false;\n\n /** If provided, the item renders as a link. */\n @property({ reflect: true }) href?: string;\n\n /** Link target. */\n @property() target: string = '_self';\n\n /** Value used for identification when managing active state externally. */\n @property({ reflect: true }) value?: string;\n\n /** Reason the item is disabled (shown to screen readers). */\n @property({ attribute: 'disabled-reason' }) disabledReason: string = '';\n\n /** Sets the delay for throttle in milliseconds. When null (default), no throttle is applied. */\n @property({ type: Number }) throttleDelay: number | null = null;\n\n /** True when the default slot contains label content. */\n @state() private _hasLabel = false;\n\n /** True when the `active-icon` slot contains content. */\n @state() private _hasActiveIcon = false;\n\n @query('.item-element') readonly itemElement!: HTMLElement | null;\n\n constructor() {\n super();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n }\n\n override focus() {\n this.itemElement?.focus();\n }\n\n override blur() {\n this.itemElement?.blur();\n }\n\n override firstUpdated() {\n if (typeof this.throttleDelay === 'number') {\n this.__dispatchClickWithThrottle = throttle(\n this.__dispatchClick,\n this.throttleDelay,\n );\n }\n\n observerSlotChangesWithCallback(\n this.renderRoot.querySelector('slot.label'),\n hasContent => {\n this._hasLabel = hasContent;\n this.requestUpdate();\n },\n );\n\n observerSlotChangesWithCallback(\n this.renderRoot.querySelector('slot.active-icon-slot'),\n hasContent => {\n this._hasActiveIcon = hasContent;\n this.requestUpdate();\n },\n );\n }\n\n __dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void =\n event => {\n this.__dispatchClick(event);\n };\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n if (this.disabled && this.href) {\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 __getDisabledReasonID() {\n return this.disabled && this.disabledReason\n ? `disabled-reason-${this.#id}`\n : nothing;\n }\n\n __renderDisabledReason() {\n const disabledReasonID = this.__getDisabledReasonID();\n if (disabledReasonID)\n return html`<div\n id=\"disabled-reason-${this.#id}\"\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"screen-reader-only\"\n >\n ${this.disabledReason}\n </div>`;\n return nothing;\n }\n\n __renderItemContent() {\n return html`\n <wc-focus-ring class=\"focus-ring\" for=\"item\"></wc-focus-ring>\n\n <div class=\"item-content\">\n <div class=\"indicator\">\n <wc-ripple class=\"ripple\"></wc-ripple>\n <div class=\"icon-container\">\n <slot name=\"active-icon\" class=\"active-icon-slot\"></slot>\n <slot name=\"icon\" class=\"icon-slot\"></slot>\n </div>\n </div>\n <div class=\"label ${this.collapsed ? 'hidden' : ''}\"><slot></slot></div>\n </div>\n\n ${this.__renderDisabledReason()}\n `;\n }\n\n render() {\n const cssClasses = {\n item: true,\n 'item-element': true,\n active: this.active,\n disabled: this.disabled,\n 'has-label': this._hasLabel,\n 'has-active-icon': this._hasActiveIcon,\n };\n\n if (!isLink(this)) {\n return html`<button\n id=\"item\"\n class=${classMap(cssClasses)}\n ?disabled=${this.disabled}\n aria-disabled=${`${this.disabled}`}\n aria-current=${this.active ? 'page' : nothing}\n ?aria-describedby=${this.__getDisabledReasonID()}\n >\n ${this.__renderItemContent()}\n </button>`;\n }\n\n return html`<a\n id=\"item\"\n class=${classMap(cssClasses)}\n href=${this.href}\n target=${this.target}\n aria-current=${this.active ? 'page' : nothing}\n aria-disabled=${`${this.disabled}`}\n ?aria-describedby=${this.__getDisabledReasonID()}\n >\n ${this.__renderItemContent()}\n </a>`;\n }\n}\n"],"names":["LitElement","nothing","html","classMap","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;;;AAiBG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQA,GAAU,CAAA;AAqChD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AArCT,QAAA,sBAAA,CAAA,GAAA,CAAA,IAAA,EAAM,MAAM,CAAC,UAAU,EAAE,CAAA;;QAKmB,IAAA,CAAA,MAAM,GAAG,KAAK;;QAGd,IAAA,CAAA,QAAQ,GAAG,KAAK;;QAGhB,IAAA,CAAA,SAAS,GAAG,KAAK;;QAMjD,IAAA,CAAA,MAAM,GAAW,OAAO;;QAMQ,IAAA,CAAA,cAAc,GAAW,EAAE;;QAG3C,IAAA,CAAA,aAAa,GAAkB,IAAI;;QAG9C,IAAA,CAAA,SAAS,GAAG,KAAK;;QAGjB,IAAA,CAAA,cAAc,GAAG,KAAK;QA0CvC,IAAA,CAAA,2BAA2B,GACzB,KAAK,IAAG;AACN,YAAA,IAAI,CAAC,eAAe,C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kBAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAGA,UAAA,CAAA;AAA3C,IAAAA,CAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE;AAA8B,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAG5C,UAAA,CAAA;AAA3B,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AAAsC,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAG/C,UAAA,CAAA;AAAhB,IAAAC,CAAK;AAA6B,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAGlB,UAAA,CAAA;AAAhB,IAAAA,CAAK;AAAkC,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAEP,UAAA,CAAA;IAAhCC,CAAK,CAAC,eAAe;AAA4C,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAnCvD,kBAAkB,GAAA,UAAA,CAAA;IAD9B;AACY,CAAA,EAAA,kBAAkB,CAyK9B;;;;"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { n } from './property-B49QQ8pS.js';
|
|
3
|
+
import { e } from './class-map-DG7CA1et.js';
|
|
4
|
+
import { NavigationRailItem } from './navigation-rail-item.js';
|
|
5
|
+
import './directive-ZPhl09Yt.js';
|
|
6
|
+
import './state-DkTK9EGF.js';
|
|
7
|
+
import './query-CHb9Ft_d.js';
|
|
8
|
+
import './base-Cl6v8-BZ.js';
|
|
9
|
+
import './dispatch-event-utils-CuEqjlPT.js';
|
|
10
|
+
import './observe-slot-change-DPxaZrZF.js';
|
|
11
|
+
import './throttle-C7ZAPqtu.js';
|
|
12
|
+
import './is-link-Dk2OV3PM.js';
|
|
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
|
+
display: block;
|
|
28
|
+
height: 100%;
|
|
29
|
+
width: var(--nav-rail-width, 5rem); /* 80dp */
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.rail {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
align-items: center;
|
|
37
|
+
height: 100%;
|
|
38
|
+
width: 100%;
|
|
39
|
+
border-radius: inherit;
|
|
40
|
+
background-color: var(--nav-rail-container-color, var(--color-surface));
|
|
41
|
+
padding-block: var(--nav-rail-padding-block, 0.75rem); /* 12dp */
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
}
|
|
44
|
+
.rail .header {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
width: 100%;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
padding-block-end: 2.5rem;
|
|
51
|
+
}
|
|
52
|
+
.rail .header:empty {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
.rail .footer {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: flex-end;
|
|
60
|
+
width: 100%;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
margin-top: auto;
|
|
63
|
+
background-color: var(--nav-rail-container-color);
|
|
64
|
+
}
|
|
65
|
+
.rail .footer:empty {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
.rail wc-divider {
|
|
69
|
+
width: calc(100% - 1rem);
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
}
|
|
72
|
+
.rail .items {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
align-items: center;
|
|
76
|
+
width: 100%;
|
|
77
|
+
gap: 0.75rem; /* 12dp between items */
|
|
78
|
+
flex: 1 1 auto;
|
|
79
|
+
min-height: 0;
|
|
80
|
+
}
|
|
81
|
+
.rail .items ::slotted(wc-navigation-rail-item) {
|
|
82
|
+
width: 100%;
|
|
83
|
+
}`;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @label Navigation Rail
|
|
87
|
+
* @tag wc-navigation-rail
|
|
88
|
+
* @rawTag navigation-rail
|
|
89
|
+
*
|
|
90
|
+
* @summary A vertical side navigation for medium-sized screens,.
|
|
91
|
+
* @overview
|
|
92
|
+
* <p>Navigation rail provides access to primary destinations in an app using icons—with or without labels—on a vertical rail.</p>
|
|
93
|
+
* <p>Use navigation rail on medium-sized screens (tablets) with 3–7 destinations.</p>
|
|
94
|
+
*
|
|
95
|
+
* @slot header - Content displayed above the rail items.
|
|
96
|
+
* @slot footer - Content pinned to the bottom of the rail.
|
|
97
|
+
*
|
|
98
|
+
* @cssprop --nav-rail-width - Width of the rail container. Defaults to 5rem (80dp).
|
|
99
|
+
* @cssprop --nav-rail-container-color - Background color of the rail. Defaults to surface color.
|
|
100
|
+
* @cssprop --nav-rail-indicator-color - Color of the active indicator. Defaults to secondary-container.
|
|
101
|
+
* @cssprop --nav-rail-indicator-shape - Shape (border-radius) of the active indicator. Defaults to full (pill).
|
|
102
|
+
* @cssprop --nav-rail-indicator-width - Width of the active indicator. Defaults to 3.5rem (56dp).
|
|
103
|
+
* @cssprop --nav-rail-indicator-height - Height of the active indicator. Defaults to 2rem (32dp).
|
|
104
|
+
* @cssprop --nav-rail-inactive-icon-color - Color of inactive icons. Defaults to on-surface-variant.
|
|
105
|
+
* @cssprop --nav-rail-active-icon-color - Color of active icons. Defaults to on-secondary-container.
|
|
106
|
+
* @cssprop --nav-rail-inactive-label-color - Color of inactive labels. Defaults to on-surface-variant.
|
|
107
|
+
* @cssprop --nav-rail-active-label-color - Color of active labels. Defaults to on-surface.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```html
|
|
111
|
+
* <wc-navigation-rail>
|
|
112
|
+
* <wc-navigation-rail-item active>
|
|
113
|
+
* <wc-icon slot="icon" name="home"></wc-icon>
|
|
114
|
+
* Home
|
|
115
|
+
* </wc-navigation-rail-item>
|
|
116
|
+
* <wc-navigation-rail-item>
|
|
117
|
+
* <wc-icon slot="icon" name="search"></wc-icon>
|
|
118
|
+
* Search
|
|
119
|
+
* </wc-navigation-rail-item>
|
|
120
|
+
* </wc-navigation-rail>
|
|
121
|
+
* ```
|
|
122
|
+
* @tags navigation
|
|
123
|
+
*/
|
|
124
|
+
let NavigationRail = class NavigationRail extends i$1 {
|
|
125
|
+
constructor() {
|
|
126
|
+
super(...arguments);
|
|
127
|
+
/**
|
|
128
|
+
* Display mode of the navigation rail.
|
|
129
|
+
* - `"expanded"`: shows labels.
|
|
130
|
+
* - `"collapsed"`: hides labels.
|
|
131
|
+
*/
|
|
132
|
+
this.mode = 'expanded';
|
|
133
|
+
/**
|
|
134
|
+
* Whether to show a divider between the header and items sections.
|
|
135
|
+
*/
|
|
136
|
+
this.showDivider = false;
|
|
137
|
+
this._handleItemClick = (event) => {
|
|
138
|
+
const target = event.target;
|
|
139
|
+
const item = target.closest('wc-navigation-rail-item');
|
|
140
|
+
if (!item || item.disabled)
|
|
141
|
+
return;
|
|
142
|
+
// Deactivate all items and activate the clicked one
|
|
143
|
+
for (const railItem of this._getItems()) {
|
|
144
|
+
railItem.active = railItem === item;
|
|
145
|
+
}
|
|
146
|
+
this.dispatchEvent(new CustomEvent('nav-change', {
|
|
147
|
+
detail: {
|
|
148
|
+
value: item.value,
|
|
149
|
+
item,
|
|
150
|
+
},
|
|
151
|
+
bubbles: true,
|
|
152
|
+
composed: true,
|
|
153
|
+
}));
|
|
154
|
+
};
|
|
155
|
+
this._syncItemMode = () => {
|
|
156
|
+
const isCollapsed = this.mode === 'collapsed';
|
|
157
|
+
for (const railItem of this._getItems()) {
|
|
158
|
+
railItem.collapsed = isCollapsed;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
connectedCallback() {
|
|
163
|
+
super.connectedCallback();
|
|
164
|
+
this.addEventListener('click', this._handleItemClick);
|
|
165
|
+
this.setAttribute('role', 'navigation');
|
|
166
|
+
this.setAttribute('aria-label', this.getAttribute('aria-label') ?? 'Main navigation');
|
|
167
|
+
}
|
|
168
|
+
disconnectedCallback() {
|
|
169
|
+
this.removeEventListener('click', this._handleItemClick);
|
|
170
|
+
super.disconnectedCallback();
|
|
171
|
+
}
|
|
172
|
+
firstUpdated() {
|
|
173
|
+
this._syncItemMode();
|
|
174
|
+
}
|
|
175
|
+
updated(changedProperties) {
|
|
176
|
+
if (changedProperties.has('mode')) {
|
|
177
|
+
this._syncItemMode();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
_getItems() {
|
|
181
|
+
return Array.from(this.querySelectorAll('wc-navigation-rail-item'));
|
|
182
|
+
}
|
|
183
|
+
render() {
|
|
184
|
+
const cssClasses = {
|
|
185
|
+
rail: true,
|
|
186
|
+
[`mode-${this.mode}`]: true,
|
|
187
|
+
};
|
|
188
|
+
return b `
|
|
189
|
+
<div class=${e(cssClasses)}>
|
|
190
|
+
<div class="header">
|
|
191
|
+
<slot name="header"></slot>
|
|
192
|
+
</div>
|
|
193
|
+
${this.showDivider ? b `<wc-divider></wc-divider>` : ''}
|
|
194
|
+
<nav class="items" role="presentation">
|
|
195
|
+
<slot @slotchange=${this._syncItemMode}></slot>
|
|
196
|
+
</nav>
|
|
197
|
+
<div class="footer">
|
|
198
|
+
<slot name="footer"></slot>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
`;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
NavigationRail.styles = [css_248z];
|
|
205
|
+
NavigationRail.Item = NavigationRailItem;
|
|
206
|
+
__decorate([
|
|
207
|
+
n({ reflect: true })
|
|
208
|
+
], NavigationRail.prototype, "mode", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
n({ type: Boolean, attribute: 'show-divider' })
|
|
211
|
+
], NavigationRail.prototype, "showDivider", void 0);
|
|
212
|
+
NavigationRail = __decorate([
|
|
213
|
+
IndividualComponent
|
|
214
|
+
], NavigationRail);
|
|
215
|
+
|
|
216
|
+
export { NavigationRail };
|
|
217
|
+
//# sourceMappingURL=navigation-rail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail.js","sources":["../../src/navigation-rail/navigation-rail.ts"],"sourcesContent":["import { html, LitElement, PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './navigation-rail.scss';\nimport { NavigationRailItem } from './navigation-rail-item.js';\nimport IndividualComponent from '@/IndividualComponent.js';\n\n/**\n * @label Navigation Rail\n * @tag wc-navigation-rail\n * @rawTag navigation-rail\n *\n * @summary A vertical side navigation for medium-sized screens,.\n * @overview\n * <p>Navigation rail provides access to primary destinations in an app using icons—with or without labels—on a vertical rail.</p>\n * <p>Use navigation rail on medium-sized screens (tablets) with 3–7 destinations.</p>\n *\n * @slot header - Content displayed above the rail items.\n * @slot footer - Content pinned to the bottom of the rail.\n *\n * @cssprop --nav-rail-width - Width of the rail container. Defaults to 5rem (80dp).\n * @cssprop --nav-rail-container-color - Background color of the rail. Defaults to surface color.\n * @cssprop --nav-rail-indicator-color - Color of the active indicator. Defaults to secondary-container.\n * @cssprop --nav-rail-indicator-shape - Shape (border-radius) of the active indicator. Defaults to full (pill).\n * @cssprop --nav-rail-indicator-width - Width of the active indicator. Defaults to 3.5rem (56dp).\n * @cssprop --nav-rail-indicator-height - Height of the active indicator. Defaults to 2rem (32dp).\n * @cssprop --nav-rail-inactive-icon-color - Color of inactive icons. Defaults to on-surface-variant.\n * @cssprop --nav-rail-active-icon-color - Color of active icons. Defaults to on-secondary-container.\n * @cssprop --nav-rail-inactive-label-color - Color of inactive labels. Defaults to on-surface-variant.\n * @cssprop --nav-rail-active-label-color - Color of active labels. Defaults to on-surface.\n *\n * @example\n * ```html\n * <wc-navigation-rail>\n * <wc-navigation-rail-item active>\n * <wc-icon slot=\"icon\" name=\"home\"></wc-icon>\n * Home\n * </wc-navigation-rail-item>\n * <wc-navigation-rail-item>\n * <wc-icon slot=\"icon\" name=\"search\"></wc-icon>\n * Search\n * </wc-navigation-rail-item>\n * </wc-navigation-rail>\n * ```\n * @tags navigation\n */\n@IndividualComponent\nexport class NavigationRail extends LitElement {\n static styles = [styles];\n\n static Item = NavigationRailItem;\n\n /**\n * Display mode of the navigation rail.\n * - `\"expanded\"`: shows labels.\n * - `\"collapsed\"`: hides labels.\n */\n @property({ reflect: true }) mode: 'expanded' | 'collapsed' = 'expanded';\n\n /**\n * Whether to show a divider between the header and items sections.\n */\n @property({ type: Boolean, attribute: 'show-divider' }) showDivider = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this._handleItemClick);\n this.setAttribute('role', 'navigation');\n this.setAttribute('aria-label', this.getAttribute('aria-label') ?? 'Main navigation');\n }\n\n disconnectedCallback() {\n this.removeEventListener('click', this._handleItemClick);\n super.disconnectedCallback();\n }\n\n protected override firstUpdated() {\n this._syncItemMode();\n }\n\n protected override updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('mode')) {\n this._syncItemMode();\n }\n }\n\n private _handleItemClick = (event: Event) => {\n const target = event.target as HTMLElement;\n const item = target.closest('wc-navigation-rail-item') as NavigationRailItem | null;\n\n if (!item || item.disabled) return;\n\n // Deactivate all items and activate the clicked one\n for (const railItem of this._getItems()) {\n railItem.active = railItem === item;\n }\n\n this.dispatchEvent(\n new CustomEvent('nav-change', {\n detail: {\n value: item.value,\n item,\n },\n bubbles: true,\n composed: true,\n }),\n );\n };\n\n private _getItems(): NavigationRailItem[] {\n return Array.from(\n this.querySelectorAll('wc-navigation-rail-item'),\n ) as NavigationRailItem[];\n }\n\n private _syncItemMode = () => {\n const isCollapsed = this.mode === 'collapsed';\n for (const railItem of this._getItems()) {\n railItem.collapsed = isCollapsed;\n }\n };\n\n render() {\n const cssClasses = {\n rail: true,\n [`mode-${this.mode}`]: true,\n };\n\n return html`\n <div class=${classMap(cssClasses)}>\n <div class=\"header\">\n <slot name=\"header\"></slot>\n </div>\n ${this.showDivider ? html`<wc-divider></wc-divider>` : ''}\n <nav class=\"items\" role=\"presentation\">\n <slot @slotchange=${this._syncItemMode}></slot>\n </nav>\n <div class=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQA,GAAU,CAAA;AAAvC,IAAA,WAAA,GAAA;;AAKL;;;;AAIG;QAC0B,IAAA,CAAA,IAAI,GAA6B,UAAU;AAExE;;AAEG;QACqD,IAAA,CAAA,WAAW,GAAG,KAAK;AAwBnE,QAAA,IAAA,CAAA,gBAAgB,GAAG,CAAC,KAAY,KAAI;AAC1C,YAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB;YAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAA8B;AAEnF,YAAA,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ;gBAAE;;YAG5B,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;AACvC,gBAAA,QAAQ,CAAC,MAAM,GAAG,QAAQ,KAAK,IAAI;YACrC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M,GAAA;AACJ,QAAA,MAAM,UAAU,GAAG;AACjB,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAA,CAAE,GAAG,IAAI;SAC5B;AAED,QAAA,OAAOC,CAAI,CAAA;mBACIC,CAAQ,CAAC,UAAU,CAAC,CAAA;;;;UAI7B,IAAI,CAAC,WAAW,GAAGD,CAAI,CAAA,CAAA,yBAAA,CAA2B,GAAG,EAAE;;AAEnC,4BAAA,EAAA,IAAI,CAAC,aAAa,CAAA;;;;;;KAM3C;IACH;;AA9FO,cAAA,CAAA,MAAM,GAAG,CAACE,QAAM,CAAC;AAEjB,cAAA,CAAA,IAAI,GAAG,kBAAH;AAOkB,UAAA,CAAA;AAA5B,IAAAC,CAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;AAA8C,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAKjB,UAAA,CAAA;IAAvDA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE;AAAsB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAfjE,cAAc,GAAA,UAAA,CAAA;IAD1B;AACY,CAAA,EAAA,cAAc,CAgG1B;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n } from './property-
|
|
3
|
-
import { r } from './state-
|
|
4
|
-
import { e } from './class-map-
|
|
1
|
+
import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './IndividualComponent-Bdwyrvd6.js';
|
|
2
|
+
import { n } from './property-B49QQ8pS.js';
|
|
3
|
+
import { r } from './state-DkTK9EGF.js';
|
|
4
|
+
import { e } from './class-map-DG7CA1et.js';
|
|
5
5
|
import './directive-ZPhl09Yt.js';
|
|
6
6
|
|
|
7
7
|
var css_248z = i`* {
|
|
@@ -12,6 +12,10 @@ var css_248z = i`* {
|
|
|
12
12
|
display: none !important;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
[hidden] {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
@keyframes reveal-top {
|
|
16
20
|
0% {
|
|
17
21
|
opacity: 0;
|