@universal-material/web 3.8.0 → 3.9.0
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/.claude-plugin/plugin.json +12 -0
- package/README.md +12 -0
- package/app-bar/top-app-bar.d.ts +7 -6
- package/app-bar/top-app-bar.d.ts.map +1 -1
- package/app-bar/top-app-bar.js +71 -35
- package/app-bar/top-app-bar.js.map +1 -1
- package/app-bar/top-app-bar.styles.d.ts.map +1 -1
- package/app-bar/top-app-bar.styles.js +18 -1
- package/app-bar/top-app-bar.styles.js.map +1 -1
- package/badge/badge.d.ts +2 -2
- package/badge/badge.d.ts.map +1 -1
- package/badge/badge.js +6 -6
- package/badge/badge.js.map +1 -1
- package/badge/badge.styles.d.ts.map +1 -1
- package/badge/badge.styles.js +1 -0
- package/badge/badge.styles.js.map +1 -1
- package/bundle.min.js +4469 -1277
- package/button/button-base.d.ts +2 -2
- package/button/button-base.d.ts.map +1 -1
- package/button/button-base.js +5 -5
- package/button/button-base.js.map +1 -1
- package/button/button-set.d.ts +3 -3
- package/button/button-set.d.ts.map +1 -1
- package/button/button-set.js +7 -7
- package/button/button-set.js.map +1 -1
- package/button/button.d.ts +7 -7
- package/button/button.d.ts.map +1 -1
- package/button/button.js +14 -14
- package/button/button.js.map +1 -1
- package/button/fab-menu-color-context.d.ts +2 -2
- package/button/fab-menu-color-context.d.ts.map +1 -1
- package/button/fab-menu-color-context.js.map +1 -1
- package/button/fab-menu-item.d.ts +3 -3
- package/button/fab-menu-item.d.ts.map +1 -1
- package/button/fab-menu-item.js +11 -11
- package/button/fab-menu-item.js.map +1 -1
- package/button/fab-menu.d.ts +20 -5
- package/button/fab-menu.d.ts.map +1 -1
- package/button/fab-menu.js +48 -11
- package/button/fab-menu.js.map +1 -1
- package/button/fab.d.ts +22 -7
- package/button/fab.d.ts.map +1 -1
- package/button/fab.js +49 -11
- package/button/fab.js.map +1 -1
- package/button/icon-button.d.ts +7 -7
- package/button/icon-button.d.ts.map +1 -1
- package/button/icon-button.js +8 -8
- package/button/icon-button.js.map +1 -1
- package/button/toggle-button.d.ts +6 -6
- package/button/toggle-button.d.ts.map +1 -1
- package/button/toggle-button.js +10 -10
- package/button/toggle-button.js.map +1 -1
- package/button-field/button-field.d.ts +3 -3
- package/button-field/button-field.d.ts.map +1 -1
- package/button-field/button-field.js +9 -9
- package/button-field/button-field.js.map +1 -1
- package/calendar/calendar-base.d.ts +1 -1
- package/calendar/calendar-base.d.ts.map +1 -1
- package/calendar/calendar-base.js +10 -10
- package/calendar/calendar-base.js.map +1 -1
- package/calendar/calendar.d.ts +2 -2
- package/calendar/calendar.d.ts.map +1 -1
- package/calendar/calendar.js +8 -8
- package/calendar/calendar.js.map +1 -1
- package/calendar/range-calendar.d.ts +2 -2
- package/calendar/range-calendar.d.ts.map +1 -1
- package/calendar/range-calendar.js +9 -9
- package/calendar/range-calendar.js.map +1 -1
- package/card/card-content.d.ts +2 -2
- package/card/card-content.d.ts.map +1 -1
- package/card/card-content.js +5 -5
- package/card/card-content.js.map +1 -1
- package/card/card-media.d.ts +2 -2
- package/card/card-media.d.ts.map +1 -1
- package/card/card-media.js +5 -5
- package/card/card-media.js.map +1 -1
- package/card/card.d.ts +4 -4
- package/card/card.d.ts.map +1 -1
- package/card/card.js +5 -5
- package/card/card.js.map +1 -1
- package/checkbox/checkbox-list-item.d.ts +4 -4
- package/checkbox/checkbox-list-item.d.ts.map +1 -1
- package/checkbox/checkbox-list-item.js +5 -5
- package/checkbox/checkbox-list-item.js.map +1 -1
- package/checkbox/checkbox.d.ts +3 -3
- package/checkbox/checkbox.d.ts.map +1 -1
- package/checkbox/checkbox.js +7 -7
- package/checkbox/checkbox.js.map +1 -1
- package/chip/chip-set.d.ts +3 -3
- package/chip/chip-set.d.ts.map +1 -1
- package/chip/chip-set.js +6 -6
- package/chip/chip-set.js.map +1 -1
- package/chip/chip.d.ts +5 -5
- package/chip/chip.d.ts.map +1 -1
- package/chip/chip.js +20 -20
- package/chip/chip.js.map +1 -1
- package/chip-field/chip-field.d.ts +3 -3
- package/chip-field/chip-field.d.ts.map +1 -1
- package/chip-field/chip-field.js +9 -9
- package/chip-field/chip-field.js.map +1 -1
- package/collapse/collapse.d.ts +26 -0
- package/collapse/collapse.d.ts.map +1 -0
- package/collapse/collapse.js +62 -0
- package/collapse/collapse.js.map +1 -0
- package/collapse/collapse.styles.d.ts +2 -0
- package/collapse/collapse.styles.d.ts.map +1 -0
- package/collapse/collapse.styles.js +8 -0
- package/collapse/collapse.styles.js.map +1 -0
- package/config.js.map +1 -1
- package/css/universal-material.css +2 -1
- package/css/universal-material.min.css +2 -1
- package/custom-elements.json +16615 -12152
- package/datepicker/datepicker.d.ts +6 -4
- package/datepicker/datepicker.d.ts.map +1 -1
- package/datepicker/datepicker.js +33 -19
- package/datepicker/datepicker.js.map +1 -1
- package/datepicker/datepicker.styles.d.ts.map +1 -1
- package/datepicker/datepicker.styles.js +25 -0
- package/datepicker/datepicker.styles.js.map +1 -1
- package/datepicker/range-datepicker.d.ts +6 -4
- package/datepicker/range-datepicker.d.ts.map +1 -1
- package/datepicker/range-datepicker.js +33 -19
- package/datepicker/range-datepicker.js.map +1 -1
- package/dialog/confirm-dialog-builder.d.ts +3 -3
- package/dialog/confirm-dialog-builder.d.ts.map +1 -1
- package/dialog/confirm-dialog-builder.js.map +1 -1
- package/dialog/dialog-builder.d.ts +5 -4
- package/dialog/dialog-builder.d.ts.map +1 -1
- package/dialog/dialog-builder.js +10 -3
- package/dialog/dialog-builder.js.map +1 -1
- package/dialog/dialog-button-def.d.ts +3 -3
- package/dialog/dialog-button-def.d.ts.map +1 -1
- package/dialog/dialog-button-def.js.map +1 -1
- package/dialog/dialog.d.ts +2 -2
- package/dialog/dialog.d.ts.map +1 -1
- package/dialog/dialog.js +14 -14
- package/dialog/dialog.js.map +1 -1
- package/dialog/message-dialog-builder.d.ts +2 -2
- package/dialog/message-dialog-builder.d.ts.map +1 -1
- package/dialog/message-dialog-builder.js.map +1 -1
- package/elevation/elevation.d.ts +2 -2
- package/elevation/elevation.d.ts.map +1 -1
- package/elevation/elevation.js +4 -4
- package/elevation/elevation.js.map +1 -1
- package/expansion-panel/expansion-panel-container.d.ts +24 -0
- package/expansion-panel/expansion-panel-container.d.ts.map +1 -0
- package/expansion-panel/expansion-panel-container.js +54 -0
- package/expansion-panel/expansion-panel-container.js.map +1 -0
- package/expansion-panel/expansion-panel-container.styles.d.ts +2 -0
- package/expansion-panel/expansion-panel-container.styles.d.ts.map +1 -0
- package/expansion-panel/expansion-panel-container.styles.js +9 -0
- package/expansion-panel/expansion-panel-container.styles.js.map +1 -0
- package/expansion-panel/expansion-panel.d.ts +37 -0
- package/expansion-panel/expansion-panel.d.ts.map +1 -0
- package/expansion-panel/expansion-panel.js +89 -0
- package/expansion-panel/expansion-panel.js.map +1 -0
- package/expansion-panel/expansion-panel.styles.d.ts +2 -0
- package/expansion-panel/expansion-panel.styles.d.ts.map +1 -0
- package/expansion-panel/expansion-panel.styles.js +66 -0
- package/expansion-panel/expansion-panel.styles.js.map +1 -0
- package/field/field-base.d.ts +3 -3
- package/field/field-base.d.ts.map +1 -1
- package/field/field-base.js +20 -20
- package/field/field-base.js.map +1 -1
- package/field/field-defaults-context.d.ts +2 -2
- package/field/field-defaults-context.d.ts.map +1 -1
- package/field/field-defaults-context.js.map +1 -1
- package/field/field-defaults.d.ts +3 -3
- package/field/field-defaults.d.ts.map +1 -1
- package/field/field-defaults.js.map +1 -1
- package/field/field-variant.d.ts +1 -1
- package/field/field-variant.d.ts.map +1 -1
- package/field/field-variant.js.map +1 -1
- package/field/field.d.ts +3 -3
- package/field/field.d.ts.map +1 -1
- package/field/field.js +6 -6
- package/field/field.js.map +1 -1
- package/icon/icon.d.ts +2 -2
- package/icon/icon.d.ts.map +1 -1
- package/icon/icon.js +4 -4
- package/icon/icon.js.map +1 -1
- package/index.d.ts +24 -1
- package/index.d.ts.map +1 -1
- package/index.js +24 -1
- package/index.js.map +1 -1
- package/list/list-item.d.ts +16 -2
- package/list/list-item.d.ts.map +1 -1
- package/list/list-item.js +26 -6
- package/list/list-item.js.map +1 -1
- package/list/list-item.styles.d.ts.map +1 -1
- package/list/list-item.styles.js +13 -0
- package/list/list-item.styles.js.map +1 -1
- package/list/list.d.ts +2 -2
- package/list/list.d.ts.map +1 -1
- package/list/list.js +4 -4
- package/list/list.js.map +1 -1
- package/menu/menu-item.d.ts +3 -3
- package/menu/menu-item.d.ts.map +1 -1
- package/menu/menu-item.js +10 -10
- package/menu/menu-item.js.map +1 -1
- package/menu/menu.d.ts +2 -2
- package/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +13 -13
- package/menu/menu.js.map +1 -1
- package/navigation/drawer-headline.d.ts +2 -2
- package/navigation/drawer-headline.d.ts.map +1 -1
- package/navigation/drawer-headline.js +6 -6
- package/navigation/drawer-headline.js.map +1 -1
- package/navigation/drawer-item.d.ts +3 -3
- package/navigation/drawer-item.d.ts.map +1 -1
- package/navigation/drawer-item.js +17 -12
- package/navigation/drawer-item.js.map +1 -1
- package/navigation/drawer.d.ts +2 -2
- package/navigation/drawer.d.ts.map +1 -1
- package/navigation/drawer.js +4 -4
- package/navigation/drawer.js.map +1 -1
- package/navigation/side-navigation.d.ts +9 -2
- package/navigation/side-navigation.d.ts.map +1 -1
- package/navigation/side-navigation.js +15 -8
- package/navigation/side-navigation.js.map +1 -1
- package/navigation-bar/navigation-bar-item.d.ts +40 -0
- package/navigation-bar/navigation-bar-item.d.ts.map +1 -0
- package/navigation-bar/navigation-bar-item.js +113 -0
- package/navigation-bar/navigation-bar-item.js.map +1 -0
- package/navigation-bar/navigation-bar-item.styles.d.ts +2 -0
- package/navigation-bar/navigation-bar-item.styles.d.ts.map +1 -0
- package/navigation-bar/navigation-bar-item.styles.js +101 -0
- package/navigation-bar/navigation-bar-item.styles.js.map +1 -0
- package/navigation-bar/navigation-bar.d.ts +40 -0
- package/navigation-bar/navigation-bar.d.ts.map +1 -0
- package/navigation-bar/navigation-bar.js +85 -0
- package/navigation-bar/navigation-bar.js.map +1 -0
- package/navigation-bar/navigation-bar.styles.d.ts +2 -0
- package/navigation-bar/navigation-bar.styles.d.ts.map +1 -0
- package/navigation-bar/navigation-bar.styles.js +44 -0
- package/navigation-bar/navigation-bar.styles.js.map +1 -0
- package/navigation-rail/navigation-rail-headline.d.ts +23 -0
- package/navigation-rail/navigation-rail-headline.d.ts.map +1 -0
- package/navigation-rail/navigation-rail-headline.js +28 -0
- package/navigation-rail/navigation-rail-headline.js.map +1 -0
- package/navigation-rail/navigation-rail-headline.styles.d.ts +2 -0
- package/navigation-rail/navigation-rail-headline.styles.d.ts.map +1 -0
- package/navigation-rail/navigation-rail-headline.styles.js +19 -0
- package/navigation-rail/navigation-rail-headline.styles.js.map +1 -0
- package/navigation-rail/navigation-rail-item.d.ts +58 -0
- package/navigation-rail/navigation-rail-item.d.ts.map +1 -0
- package/navigation-rail/navigation-rail-item.js +160 -0
- package/navigation-rail/navigation-rail-item.js.map +1 -0
- package/navigation-rail/navigation-rail-item.styles.d.ts +2 -0
- package/navigation-rail/navigation-rail-item.styles.d.ts.map +1 -0
- package/navigation-rail/navigation-rail-item.styles.js +182 -0
- package/navigation-rail/navigation-rail-item.styles.js.map +1 -0
- package/navigation-rail/navigation-rail.d.ts +66 -0
- package/navigation-rail/navigation-rail.d.ts.map +1 -0
- package/navigation-rail/navigation-rail.js +223 -0
- package/navigation-rail/navigation-rail.js.map +1 -0
- package/navigation-rail/navigation-rail.styles.d.ts +2 -0
- package/navigation-rail/navigation-rail.styles.d.ts.map +1 -0
- package/navigation-rail/navigation-rail.styles.js +220 -0
- package/navigation-rail/navigation-rail.styles.js.map +1 -0
- package/overflow-menu/overflow-menu.d.ts +8 -2
- package/overflow-menu/overflow-menu.d.ts.map +1 -1
- package/overflow-menu/overflow-menu.js +10 -1
- package/overflow-menu/overflow-menu.js.map +1 -1
- package/package.json +19 -3
- package/progress/circular-progress.d.ts +2 -2
- package/progress/circular-progress.d.ts.map +1 -1
- package/progress/circular-progress.js +6 -6
- package/progress/circular-progress.js.map +1 -1
- package/progress/progress-bar.d.ts +2 -2
- package/progress/progress-bar.d.ts.map +1 -1
- package/progress/progress-bar.js +6 -6
- package/progress/progress-bar.js.map +1 -1
- package/radio/radio-list-item.d.ts +4 -4
- package/radio/radio-list-item.d.ts.map +1 -1
- package/radio/radio-list-item.js +5 -5
- package/radio/radio-list-item.js.map +1 -1
- package/radio/radio.d.ts +3 -3
- package/radio/radio.d.ts.map +1 -1
- package/radio/radio.js +6 -6
- package/radio/radio.js.map +1 -1
- package/ripple/ripple.d.ts +2 -2
- package/ripple/ripple.d.ts.map +1 -1
- package/ripple/ripple.js +9 -9
- package/ripple/ripple.js.map +1 -1
- package/scaffold/pane.d.ts +127 -0
- package/scaffold/pane.d.ts.map +1 -0
- package/scaffold/pane.js +220 -0
- package/scaffold/pane.js.map +1 -0
- package/scaffold/pane.styles.d.ts +2 -0
- package/scaffold/pane.styles.d.ts.map +1 -0
- package/scaffold/pane.styles.js +1909 -0
- package/scaffold/pane.styles.js.map +1 -0
- package/scaffold/scaffold.d.ts +45 -0
- package/scaffold/scaffold.d.ts.map +1 -0
- package/scaffold/scaffold.js +170 -0
- package/scaffold/scaffold.js.map +1 -0
- package/scaffold/scaffold.styles.d.ts +2 -0
- package/scaffold/scaffold.styles.d.ts.map +1 -0
- package/scaffold/scaffold.styles.js +69 -0
- package/scaffold/scaffold.styles.js.map +1 -0
- package/scaffold/scroll-container-context.d.ts +4 -0
- package/scaffold/scroll-container-context.d.ts.map +1 -0
- package/scaffold/scroll-container-context.js +3 -0
- package/scaffold/scroll-container-context.js.map +1 -0
- package/scss/utilities/_divider.scss +4 -0
- package/search/search.d.ts +3 -3
- package/search/search.d.ts.map +1 -1
- package/search/search.js +7 -7
- package/search/search.js.map +1 -1
- package/search/search.styles.d.ts.map +1 -1
- package/search/search.styles.js +7 -2
- package/search/search.styles.js.map +1 -1
- package/select/option.d.ts +3 -3
- package/select/option.d.ts.map +1 -1
- package/select/option.js +8 -8
- package/select/option.js.map +1 -1
- package/select/select-navigation-controller.d.ts +4 -4
- package/select/select-navigation-controller.d.ts.map +1 -1
- package/select/select-navigation-controller.js.map +1 -1
- package/select/select.d.ts +18 -12
- package/select/select.d.ts.map +1 -1
- package/select/select.js +77 -31
- package/select/select.js.map +1 -1
- package/shared/button-wrapper.d.ts +1 -1
- package/shared/button-wrapper.d.ts.map +1 -1
- package/shared/button-wrapper.js +8 -8
- package/shared/button-wrapper.js.map +1 -1
- package/shared/char-count-text-field/native-text-field-wrapper.d.ts +2 -2
- package/shared/char-count-text-field/native-text-field-wrapper.d.ts.map +1 -1
- package/shared/char-count-text-field/native-text-field-wrapper.js +6 -6
- package/shared/char-count-text-field/native-text-field-wrapper.js.map +1 -1
- package/shared/menu-field/menu-field-navigation-controller.d.ts +3 -3
- package/shared/menu-field/menu-field-navigation-controller.d.ts.map +1 -1
- package/shared/menu-field/menu-field-navigation-controller.js.map +1 -1
- package/shared/menu-field/menu-field.d.ts +5 -5
- package/shared/menu-field/menu-field.d.ts.map +1 -1
- package/shared/menu-field/menu-field.js.map +1 -1
- package/shared/selection-control/selection-control-list-item.d.ts +2 -2
- package/shared/selection-control/selection-control-list-item.d.ts.map +1 -1
- package/shared/selection-control/selection-control-list-item.js +10 -1
- package/shared/selection-control/selection-control-list-item.js.map +1 -1
- package/shared/selection-control/selection-control.d.ts +1 -1
- package/shared/selection-control/selection-control.d.ts.map +1 -1
- package/shared/selection-control/selection-control.js +15 -7
- package/shared/selection-control/selection-control.js.map +1 -1
- package/shared/sets/set-base.d.ts +1 -1
- package/shared/sets/set-base.d.ts.map +1 -1
- package/shared/sets/set-base.js +2 -2
- package/shared/sets/set-base.js.map +1 -1
- package/shared/text-field-base/text-field-base.d.ts +34 -2
- package/shared/text-field-base/text-field-base.d.ts.map +1 -1
- package/shared/text-field-base/text-field-base.js +63 -4
- package/shared/text-field-base/text-field-base.js.map +1 -1
- package/skills/badge/SKILL.md +43 -0
- package/skills/buttons/SKILL.md +115 -0
- package/skills/card/SKILL.md +162 -0
- package/skills/chips/SKILL.md +95 -0
- package/skills/collapse/SKILL.md +37 -0
- package/skills/datepicker/SKILL.md +110 -0
- package/skills/dialog/SKILL.md +92 -0
- package/skills/drawer/SKILL.md +94 -0
- package/skills/expansion-panel/SKILL.md +65 -0
- package/skills/fab/SKILL.md +79 -0
- package/skills/list/SKILL.md +105 -0
- package/skills/menu/SKILL.md +120 -0
- package/skills/navigation-bar/SKILL.md +87 -0
- package/skills/navigation-rail/SKILL.md +127 -0
- package/skills/overview/SKILL.md +44 -0
- package/skills/progress/SKILL.md +63 -0
- package/skills/scaffold/SKILL.md +392 -0
- package/skills/search/SKILL.md +65 -0
- package/skills/select/SKILL.md +120 -0
- package/skills/selection-controls/SKILL.md +88 -0
- package/skills/setup/SKILL.md +58 -0
- package/skills/slider/SKILL.md +119 -0
- package/skills/snackbar/SKILL.md +70 -0
- package/skills/tab-bar/SKILL.md +55 -0
- package/skills/text-field/SKILL.md +114 -0
- package/skills/theming/SKILL.md +80 -0
- package/skills/top-app-bar/SKILL.md +64 -0
- package/skills/typeahead/SKILL.md +113 -0
- package/slider/slider.d.ts +73 -0
- package/slider/slider.d.ts.map +1 -0
- package/slider/slider.js +506 -0
- package/slider/slider.js.map +1 -0
- package/slider/slider.styles.d.ts +2 -0
- package/slider/slider.styles.d.ts.map +1 -0
- package/slider/slider.styles.js +292 -0
- package/slider/slider.styles.js.map +1 -0
- package/snackbar/snackbar.d.ts +4 -4
- package/snackbar/snackbar.d.ts.map +1 -1
- package/snackbar/snackbar.js +28 -28
- package/snackbar/snackbar.js.map +1 -1
- package/snackbar/snackbar.styles.js +1 -1
- package/snackbar/snackbar.styles.js.map +1 -1
- package/switch/switch-list-item.d.ts +4 -4
- package/switch/switch-list-item.d.ts.map +1 -1
- package/switch/switch-list-item.js +5 -5
- package/switch/switch-list-item.js.map +1 -1
- package/switch/switch.d.ts +3 -3
- package/switch/switch.d.ts.map +1 -1
- package/switch/switch.js +5 -5
- package/switch/switch.js.map +1 -1
- package/tab-bar/tab-bar.d.ts +6 -6
- package/tab-bar/tab-bar.d.ts.map +1 -1
- package/tab-bar/tab-bar.js +40 -23
- package/tab-bar/tab-bar.js.map +1 -1
- package/tab-bar/tab.d.ts +5 -5
- package/tab-bar/tab.d.ts.map +1 -1
- package/tab-bar/tab.js +9 -9
- package/tab-bar/tab.js.map +1 -1
- package/text-area/text-area.d.ts +3 -3
- package/text-area/text-area.d.ts.map +1 -1
- package/text-area/text-area.js +9 -9
- package/text-area/text-area.js.map +1 -1
- package/text-field/text-field.d.ts +15 -3
- package/text-field/text-field.d.ts.map +1 -1
- package/text-field/text-field.js +46 -13
- package/text-field/text-field.js.map +1 -1
- package/typeahead/highlight.d.ts +2 -2
- package/typeahead/highlight.d.ts.map +1 -1
- package/typeahead/highlight.js +7 -7
- package/typeahead/highlight.js.map +1 -1
- package/typeahead/typeahead.d.ts +7 -7
- package/typeahead/typeahead.d.ts.map +1 -1
- package/typeahead/typeahead.js +22 -18
- package/typeahead/typeahead.js.map +1 -1
- package/vscode.html-custom-data.json +870 -481
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar.styles.js","sourceRoot":"","sources":["../../src/navigation-bar/navigation-bar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n display: block;\n --u-elevation-level: 2;\n }\n\n .container {\n position: relative;\n background-color: var(--u-nav-bar-container-color, var(--u-color-surface-container, rgb(243, 237, 247)));\n color: var(--u-nav-bar-text-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n transition: background-color 100ms;\n }\n\n .absolute {\n position: absolute;\n inset-inline: 0;\n inset-block-end: 0;\n z-index: var(--u-nav-bar-z-index, 1010);\n }\n\n .fixed {\n position: fixed;\n inset-inline: 0;\n inset-block-end: 0;\n inset-inline-start: var(--u-app-bar-offset, 0);\n z-index: var(--u-nav-bar-z-index, 1010);\n transition: background-color 100ms, inset-inline-start 375ms cubic-bezier(0.19, 1, 0.22, 1);\n }\n\n .spacing {\n padding-block-start: var(--_content-height);\n }\n\n .content {\n display: flex;\n align-items: stretch;\n justify-content: space-around;\n min-height: var(--u-nav-bar-container-height, 64px);\n padding-inline: 0;\n gap: var(--u-nav-bar-item-between-space, 0);\n }\n`;\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Section header for grouping destinations inside the expanded navigation
|
|
4
|
+
* rail. Slot it into `u-navigation-rail slot="expanded"` between groups of
|
|
5
|
+
* `u-navigation-rail-item`s.
|
|
6
|
+
*
|
|
7
|
+
* The headline is only visible while the rail is in its expanded state —
|
|
8
|
+
* when collapsed (or hidden) the rail switches to its primary `slot="rail"`
|
|
9
|
+
* destinations, so headlines never appear in narrow layouts.
|
|
10
|
+
*
|
|
11
|
+
* Slots:
|
|
12
|
+
* - default: the headline text.
|
|
13
|
+
*/
|
|
14
|
+
export declare class NavigationRailHeadline extends LitElement {
|
|
15
|
+
static styles: import("lit").CSSResult[];
|
|
16
|
+
protected render(): HTMLTemplateResult;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
'u-navigation-rail-headline': NavigationRailHeadline;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=navigation-rail-headline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-headline.d.ts","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail-headline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAM3D;;;;;;;;;;;GAWG;AACH,qBACa,sBAAuB,SAAQ,UAAU;IACpD,OAAgB,MAAM,4BAAwB;cAE3B,MAAM,IAAI,kBAAkB;CAGhD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B,EAAE,sBAAsB,CAAC;KACtD;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { styles as baseStyles } from '../shared/base.styles.js';
|
|
5
|
+
import { styles } from './navigation-rail-headline.styles.js';
|
|
6
|
+
/**
|
|
7
|
+
* Section header for grouping destinations inside the expanded navigation
|
|
8
|
+
* rail. Slot it into `u-navigation-rail slot="expanded"` between groups of
|
|
9
|
+
* `u-navigation-rail-item`s.
|
|
10
|
+
*
|
|
11
|
+
* The headline is only visible while the rail is in its expanded state —
|
|
12
|
+
* when collapsed (or hidden) the rail switches to its primary `slot="rail"`
|
|
13
|
+
* destinations, so headlines never appear in narrow layouts.
|
|
14
|
+
*
|
|
15
|
+
* Slots:
|
|
16
|
+
* - default: the headline text.
|
|
17
|
+
*/
|
|
18
|
+
let NavigationRailHeadline = class NavigationRailHeadline extends LitElement {
|
|
19
|
+
static { this.styles = [baseStyles, styles]; }
|
|
20
|
+
render() {
|
|
21
|
+
return html `<div class="container" part="container"><slot></slot></div>`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
NavigationRailHeadline = __decorate([
|
|
25
|
+
customElement('u-navigation-rail-headline')
|
|
26
|
+
], NavigationRailHeadline);
|
|
27
|
+
export { NavigationRailHeadline };
|
|
28
|
+
//# sourceMappingURL=navigation-rail-headline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-headline.js","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail-headline.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAE9D;;;;;;;;;;;GAWG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU;aACpC,WAAM,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,AAAvB,CAAwB;IAE3B,MAAM;QACvB,OAAO,IAAI,CAAA,6DAA6D,CAAC;IAC3E,CAAC;;AALU,sBAAsB;IADlC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,sBAAsB,CAMlC","sourcesContent":["import { html, HTMLTemplateResult, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { styles as baseStyles } from '../shared/base.styles.js';\nimport { styles } from './navigation-rail-headline.styles.js';\n\n/**\n * Section header for grouping destinations inside the expanded navigation\n * rail. Slot it into `u-navigation-rail slot=\"expanded\"` between groups of\n * `u-navigation-rail-item`s.\n *\n * The headline is only visible while the rail is in its expanded state —\n * when collapsed (or hidden) the rail switches to its primary `slot=\"rail\"`\n * destinations, so headlines never appear in narrow layouts.\n *\n * Slots:\n * - default: the headline text.\n */\n@customElement('u-navigation-rail-headline')\nexport class NavigationRailHeadline extends LitElement {\n static override styles = [baseStyles, styles];\n\n protected override render(): HTMLTemplateResult {\n return html`<div class=\"container\" part=\"container\"><slot></slot></div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-navigation-rail-headline': NavigationRailHeadline;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-headline.styles.d.ts","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail-headline.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAgBlB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
padding-inline-start: var(--u-nav-rail-headline-padding-inline-start, calc(var(--u-nav-rail-item-horizontal-full-width-leading-space, 16px) + var(--u-nav-rail-item-active-indicator-leading-space, 16px)));
|
|
6
|
+
padding-inline-end: var(--u-nav-rail-headline-padding-inline-end, var(--u-nav-rail-item-active-indicator-leading-space, 16px));
|
|
7
|
+
padding-block: var(--u-nav-rail-headline-padding-block, 20px 8px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.container {
|
|
11
|
+
font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));
|
|
12
|
+
line-height: var(--u-nav-rail-headline-line-height, var(--u-title-s-line-height, 1.25rem));
|
|
13
|
+
font-size: var(--u-nav-rail-headline-font-size, var(--u-title-s-font-size, 0.875rem));
|
|
14
|
+
letter-spacing: var(--u-nav-rail-headline-letter-spacing, var(--u-title-s-letter-spacing, 0.0071428571rem));
|
|
15
|
+
font-weight: var(--u-nav-rail-headline-font-weight, var(--u-title-s-font-weight, var(--u-font-weight-medium, 500)));
|
|
16
|
+
color: var(--u-nav-rail-headline-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
//# sourceMappingURL=navigation-rail-headline.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-headline.styles.js","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail-headline.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;CAgBzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n display: block;\n padding-inline-start: var(--u-nav-rail-headline-padding-inline-start, calc(var(--u-nav-rail-item-horizontal-full-width-leading-space, 16px) + var(--u-nav-rail-item-active-indicator-leading-space, 16px)));\n padding-inline-end: var(--u-nav-rail-headline-padding-inline-end, var(--u-nav-rail-item-active-indicator-leading-space, 16px));\n padding-block: var(--u-nav-rail-headline-padding-block, 20px 8px);\n }\n\n .container {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-nav-rail-headline-line-height, var(--u-title-s-line-height, 1.25rem));\n font-size: var(--u-nav-rail-headline-font-size, var(--u-title-s-font-size, 0.875rem));\n letter-spacing: var(--u-nav-rail-headline-letter-spacing, var(--u-title-s-letter-spacing, 0.0071428571rem));\n font-weight: var(--u-nav-rail-headline-font-weight, var(--u-title-s-font-weight, var(--u-font-weight-medium, 500)));\n color: var(--u-nav-rail-headline-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n`;\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { HTMLTemplateResult } from 'lit';
|
|
2
|
+
import { ButtonWrapper } from '../shared/button-wrapper.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
export type NavRailItemVariant = 'collapsed' | 'expanded';
|
|
5
|
+
/**
|
|
6
|
+
* A destination inside a `u-navigation-rail`. Renders two layouts depending
|
|
7
|
+
* on `variant`:
|
|
8
|
+
*
|
|
9
|
+
* - `collapsed` (default): vertical — a 56×32dp pill around the 24dp icon
|
|
10
|
+
* with the label stacked below in label-medium type.
|
|
11
|
+
* - `expanded`: horizontal — a full-width pill wraps icon + label inline
|
|
12
|
+
* (icon at the leading edge, label-large to its right), 56dp tall.
|
|
13
|
+
*
|
|
14
|
+
* Hover/focus/pressed feedback (state layer + ripple) is confined to the
|
|
15
|
+
* active-indicator pill, never the full square. The click target itself
|
|
16
|
+
* stays the full container — clicks anywhere on the item still navigate
|
|
17
|
+
* and emit a ripple inside the pill.
|
|
18
|
+
*
|
|
19
|
+
* The parent `u-navigation-rail` sets `variant` automatically based on the
|
|
20
|
+
* breakpoint and toggle state — consumers don't usually need to set it.
|
|
21
|
+
*
|
|
22
|
+
* Slots:
|
|
23
|
+
* - default: the destination label.
|
|
24
|
+
* - `icon`: the destination icon (24dp).
|
|
25
|
+
* - `badge`: an optional `u-badge` placed at the top-right of the icon.
|
|
26
|
+
*/
|
|
27
|
+
export declare class NavigationRailItem extends ButtonWrapper {
|
|
28
|
+
#private;
|
|
29
|
+
static styles: import("lit").CSSResultGroup[];
|
|
30
|
+
private _hasIcon;
|
|
31
|
+
private _hasLabel;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the rail item is active (selected) or not.
|
|
34
|
+
*/
|
|
35
|
+
active: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Layout variant. `collapsed` (default) stacks icon over label with a
|
|
38
|
+
* 56×32dp pill around the icon. `expanded` lays icon + label side-by-side
|
|
39
|
+
* inside a content-sized 56dp pill aligned to the rail's leading edge.
|
|
40
|
+
*
|
|
41
|
+
* Set automatically by `u-navigation-rail` based on which slot the item
|
|
42
|
+
* is placed into (`slot="rail"` → collapsed, `slot="expanded"` → expanded).
|
|
43
|
+
*/
|
|
44
|
+
variant: NavRailItemVariant;
|
|
45
|
+
private readonly assignedIcons;
|
|
46
|
+
private readonly assignedLabelNodes;
|
|
47
|
+
private readonly _pillRipple;
|
|
48
|
+
connectedCallback(): void;
|
|
49
|
+
disconnectedCallback(): void;
|
|
50
|
+
protected _getContainerClasses(): Record<string, boolean>;
|
|
51
|
+
protected _renderContent(): HTMLTemplateResult;
|
|
52
|
+
}
|
|
53
|
+
declare global {
|
|
54
|
+
interface HTMLElementTagNameMap {
|
|
55
|
+
'u-navigation-rail-item': NavigationRailItem;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=navigation-rail-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-item.d.ts","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAI/C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,qBAAqB,CAAC;AAE7B,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,UAAU,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBACa,kBAAmB,SAAQ,aAAa;;IAEnD,OAAgB,MAAM,iCAGpB;IAEO,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAEnC;;OAEG;IACyC,MAAM,UAAS;IAE3D;;;;;;;OAOG;IAC0B,OAAO,EAAE,kBAAkB,CAAe;IAGvE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAG/C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAU;IAEtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;IAEpD,iBAAiB,IAAI,IAAI;IAYzB,oBAAoB,IAAI,IAAI;cAMlB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;cAQ/C,cAAc,IAAI,kBAAkB;CA8DxD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,kBAAkB,CAAC;KAC9C;CACF"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement, property, query, queryAssignedElements, queryAssignedNodes, state } from 'lit/decorators.js';
|
|
4
|
+
import { ButtonWrapper } from '../shared/button-wrapper.js';
|
|
5
|
+
import { styles } from './navigation-rail-item.styles.js';
|
|
6
|
+
import '../ripple/ripple.js';
|
|
7
|
+
/**
|
|
8
|
+
* A destination inside a `u-navigation-rail`. Renders two layouts depending
|
|
9
|
+
* on `variant`:
|
|
10
|
+
*
|
|
11
|
+
* - `collapsed` (default): vertical — a 56×32dp pill around the 24dp icon
|
|
12
|
+
* with the label stacked below in label-medium type.
|
|
13
|
+
* - `expanded`: horizontal — a full-width pill wraps icon + label inline
|
|
14
|
+
* (icon at the leading edge, label-large to its right), 56dp tall.
|
|
15
|
+
*
|
|
16
|
+
* Hover/focus/pressed feedback (state layer + ripple) is confined to the
|
|
17
|
+
* active-indicator pill, never the full square. The click target itself
|
|
18
|
+
* stays the full container — clicks anywhere on the item still navigate
|
|
19
|
+
* and emit a ripple inside the pill.
|
|
20
|
+
*
|
|
21
|
+
* The parent `u-navigation-rail` sets `variant` automatically based on the
|
|
22
|
+
* breakpoint and toggle state — consumers don't usually need to set it.
|
|
23
|
+
*
|
|
24
|
+
* Slots:
|
|
25
|
+
* - default: the destination label.
|
|
26
|
+
* - `icon`: the destination icon (24dp).
|
|
27
|
+
* - `badge`: an optional `u-badge` placed at the top-right of the icon.
|
|
28
|
+
*/
|
|
29
|
+
let NavigationRailItem = class NavigationRailItem extends ButtonWrapper {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this._hasIcon = false;
|
|
33
|
+
this._hasLabel = false;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the rail item is active (selected) or not.
|
|
36
|
+
*/
|
|
37
|
+
this.active = false;
|
|
38
|
+
/**
|
|
39
|
+
* Layout variant. `collapsed` (default) stacks icon over label with a
|
|
40
|
+
* 56×32dp pill around the icon. `expanded` lays icon + label side-by-side
|
|
41
|
+
* inside a content-sized 56dp pill aligned to the rail's leading edge.
|
|
42
|
+
*
|
|
43
|
+
* Set automatically by `u-navigation-rail` based on which slot the item
|
|
44
|
+
* is placed into (`slot="rail"` → collapsed, `slot="expanded"` → expanded).
|
|
45
|
+
*/
|
|
46
|
+
this.variant = 'collapsed';
|
|
47
|
+
this.#handleIconSlotChange = () => {
|
|
48
|
+
this._hasIcon = this.assignedIcons.length > 0;
|
|
49
|
+
};
|
|
50
|
+
this.#handleLabelSlotChange = () => {
|
|
51
|
+
this._hasLabel = this.assignedLabelNodes.some(node => {
|
|
52
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
53
|
+
return !!node.textContent?.trim();
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
this.#handlePillMouseDown = (e) => {
|
|
59
|
+
if (this.disabled || !this._pillRipple) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this._pillRipple.createRipple(e.clientX, e.clientY, 'mouseup');
|
|
63
|
+
};
|
|
64
|
+
this.#handlePillTouchStart = (e) => {
|
|
65
|
+
if (this.disabled || !this._pillRipple || !e.touches[0]) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
this._pillRipple.createRipple(e.touches[0].clientX, e.touches[0].clientY, 'touchend');
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static { this.styles = [
|
|
72
|
+
ButtonWrapper.styles,
|
|
73
|
+
styles,
|
|
74
|
+
]; }
|
|
75
|
+
connectedCallback() {
|
|
76
|
+
super.connectedCallback();
|
|
77
|
+
this.setAttribute('aria-labelledby', 'text');
|
|
78
|
+
// Suppress the default ButtonWrapper ripple — the M3 nav-rail spec
|
|
79
|
+
// confines feedback to the active-indicator pill (not the full square).
|
|
80
|
+
// We render our own u-ripple inside the pill and forward pointer events
|
|
81
|
+
// from the full container to it.
|
|
82
|
+
this.renderRipple = false;
|
|
83
|
+
this.addEventListener('mousedown', this.#handlePillMouseDown);
|
|
84
|
+
this.addEventListener('touchstart', this.#handlePillTouchStart, { passive: true });
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
super.disconnectedCallback();
|
|
88
|
+
this.removeEventListener('mousedown', this.#handlePillMouseDown);
|
|
89
|
+
this.removeEventListener('touchstart', this.#handlePillTouchStart);
|
|
90
|
+
}
|
|
91
|
+
_getContainerClasses() {
|
|
92
|
+
return {
|
|
93
|
+
...super._getContainerClasses(),
|
|
94
|
+
'has-icon': this._hasIcon,
|
|
95
|
+
'has-label': this._hasLabel,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
_renderContent() {
|
|
99
|
+
const icon = html `
|
|
100
|
+
<span class="icon" part="icon">
|
|
101
|
+
<slot
|
|
102
|
+
name="icon"
|
|
103
|
+
aria-hidden="true"
|
|
104
|
+
@slotchange=${this.#handleIconSlotChange}></slot>
|
|
105
|
+
<slot name="badge"></slot>
|
|
106
|
+
</span>
|
|
107
|
+
`;
|
|
108
|
+
const label = html `
|
|
109
|
+
<span class="label" id="text" part="label">
|
|
110
|
+
<slot @slotchange=${this.#handleLabelSlotChange}></slot>
|
|
111
|
+
</span>
|
|
112
|
+
`;
|
|
113
|
+
if (this.variant === 'expanded') {
|
|
114
|
+
return html `
|
|
115
|
+
<span class="active-indicator" part="active-indicator">
|
|
116
|
+
<u-ripple class="pill-ripple" ?disabled=${this.disabled}></u-ripple>
|
|
117
|
+
${icon}
|
|
118
|
+
${label}
|
|
119
|
+
</span>
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
return html `
|
|
123
|
+
<span class="active-indicator" part="active-indicator">
|
|
124
|
+
<u-ripple class="pill-ripple" ?disabled=${this.disabled}></u-ripple>
|
|
125
|
+
${icon}
|
|
126
|
+
</span>
|
|
127
|
+
${label}
|
|
128
|
+
`;
|
|
129
|
+
}
|
|
130
|
+
#handleIconSlotChange;
|
|
131
|
+
#handleLabelSlotChange;
|
|
132
|
+
#handlePillMouseDown;
|
|
133
|
+
#handlePillTouchStart;
|
|
134
|
+
};
|
|
135
|
+
__decorate([
|
|
136
|
+
state()
|
|
137
|
+
], NavigationRailItem.prototype, "_hasIcon", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
state()
|
|
140
|
+
], NavigationRailItem.prototype, "_hasLabel", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ type: Boolean, reflect: true })
|
|
143
|
+
], NavigationRailItem.prototype, "active", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
property({ reflect: true })
|
|
146
|
+
], NavigationRailItem.prototype, "variant", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
queryAssignedElements({ slot: 'icon', flatten: true })
|
|
149
|
+
], NavigationRailItem.prototype, "assignedIcons", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
queryAssignedNodes({ flatten: true })
|
|
152
|
+
], NavigationRailItem.prototype, "assignedLabelNodes", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
query('.pill-ripple')
|
|
155
|
+
], NavigationRailItem.prototype, "_pillRipple", void 0);
|
|
156
|
+
NavigationRailItem = __decorate([
|
|
157
|
+
customElement('u-navigation-rail-item')
|
|
158
|
+
], NavigationRailItem);
|
|
159
|
+
export { NavigationRailItem };
|
|
160
|
+
//# sourceMappingURL=navigation-rail-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-item.js","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail-item.ts"],"names":[],"mappings":"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","sourcesContent":["import { html, HTMLTemplateResult } from 'lit';\nimport { customElement, property, query, queryAssignedElements, queryAssignedNodes, state } from 'lit/decorators.js';\n\nimport { Ripple } from '../ripple/ripple.js';\nimport { ButtonWrapper } from '../shared/button-wrapper.js';\nimport { styles } from './navigation-rail-item.styles.js';\n\nimport '../ripple/ripple.js';\n\nexport type NavRailItemVariant = 'collapsed' | 'expanded';\n\n/**\n * A destination inside a `u-navigation-rail`. Renders two layouts depending\n * on `variant`:\n *\n * - `collapsed` (default): vertical — a 56×32dp pill around the 24dp icon\n * with the label stacked below in label-medium type.\n * - `expanded`: horizontal — a full-width pill wraps icon + label inline\n * (icon at the leading edge, label-large to its right), 56dp tall.\n *\n * Hover/focus/pressed feedback (state layer + ripple) is confined to the\n * active-indicator pill, never the full square. The click target itself\n * stays the full container — clicks anywhere on the item still navigate\n * and emit a ripple inside the pill.\n *\n * The parent `u-navigation-rail` sets `variant` automatically based on the\n * breakpoint and toggle state — consumers don't usually need to set it.\n *\n * Slots:\n * - default: the destination label.\n * - `icon`: the destination icon (24dp).\n * - `badge`: an optional `u-badge` placed at the top-right of the icon.\n */\n@customElement('u-navigation-rail-item')\nexport class NavigationRailItem extends ButtonWrapper {\n\n static override styles = [\n ButtonWrapper.styles,\n styles,\n ];\n\n @state() private _hasIcon = false;\n @state() private _hasLabel = false;\n\n /**\n * Whether the rail item is active (selected) or not.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /**\n * Layout variant. `collapsed` (default) stacks icon over label with a\n * 56×32dp pill around the icon. `expanded` lays icon + label side-by-side\n * inside a content-sized 56dp pill aligned to the rail's leading edge.\n *\n * Set automatically by `u-navigation-rail` based on which slot the item\n * is placed into (`slot=\"rail\"` → collapsed, `slot=\"expanded\"` → expanded).\n */\n @property({ reflect: true }) variant: NavRailItemVariant = 'collapsed';\n\n @queryAssignedElements({ slot: 'icon', flatten: true })\n private readonly assignedIcons!: HTMLElement[];\n\n @queryAssignedNodes({ flatten: true })\n private readonly assignedLabelNodes!: Node[];\n\n @query('.pill-ripple') private readonly _pillRipple!: Ripple;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('aria-labelledby', 'text');\n // Suppress the default ButtonWrapper ripple — the M3 nav-rail spec\n // confines feedback to the active-indicator pill (not the full square).\n // We render our own u-ripple inside the pill and forward pointer events\n // from the full container to it.\n this.renderRipple = false;\n this.addEventListener('mousedown', this.#handlePillMouseDown);\n this.addEventListener('touchstart', this.#handlePillTouchStart, { passive: true });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('mousedown', this.#handlePillMouseDown);\n this.removeEventListener('touchstart', this.#handlePillTouchStart);\n }\n\n protected override _getContainerClasses(): Record<string, boolean> {\n return {\n ...super._getContainerClasses(),\n 'has-icon': this._hasIcon,\n 'has-label': this._hasLabel,\n };\n }\n\n protected override _renderContent(): HTMLTemplateResult {\n const icon = html`\n <span class=\"icon\" part=\"icon\">\n <slot\n name=\"icon\"\n aria-hidden=\"true\"\n @slotchange=${this.#handleIconSlotChange}></slot>\n <slot name=\"badge\"></slot>\n </span>\n `;\n\n const label = html`\n <span class=\"label\" id=\"text\" part=\"label\">\n <slot @slotchange=${this.#handleLabelSlotChange}></slot>\n </span>\n `;\n\n if (this.variant === 'expanded') {\n return html`\n <span class=\"active-indicator\" part=\"active-indicator\">\n <u-ripple class=\"pill-ripple\" ?disabled=${this.disabled}></u-ripple>\n ${icon}\n ${label}\n </span>\n `;\n }\n\n return html`\n <span class=\"active-indicator\" part=\"active-indicator\">\n <u-ripple class=\"pill-ripple\" ?disabled=${this.disabled}></u-ripple>\n ${icon}\n </span>\n ${label}\n `;\n }\n\n #handleIconSlotChange = (): void => {\n this._hasIcon = this.assignedIcons.length > 0;\n };\n\n #handleLabelSlotChange = (): void => {\n this._hasLabel = this.assignedLabelNodes.some(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n return !!node.textContent?.trim();\n }\n return true;\n });\n };\n\n #handlePillMouseDown = (e: MouseEvent): void => {\n if (this.disabled || !this._pillRipple) {\n return;\n }\n this._pillRipple.createRipple(e.clientX, e.clientY, 'mouseup');\n };\n\n #handlePillTouchStart = (e: TouchEvent): void => {\n if (this.disabled || !this._pillRipple || !e.touches[0]) {\n return;\n }\n this._pillRipple.createRipple(e.touches[0].clientX, e.touches[0].clientY, 'touchend');\n };\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-navigation-rail-item': NavigationRailItem;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-item.styles.d.ts","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAmLlB,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
--_nav-rail-item-icon-size: var(--u-nav-rail-item-icon-size, 24px);
|
|
6
|
+
--_nav-rail-item-state-layer-color: var(--u-nav-rail-item-state-layer-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host(:not([variant=expanded])) {
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex: 1 1 auto;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
color: var(--u-nav-rail-item-inactive-text-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.content {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 100%;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.active-indicator {
|
|
31
|
+
position: relative;
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
flex: 0 0 auto;
|
|
36
|
+
border-radius: var(--u-nav-rail-item-active-indicator-shape, var(--u-shape-corner-full, 9999px));
|
|
37
|
+
transition: background-color 150ms;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.active-indicator::before {
|
|
42
|
+
content: "";
|
|
43
|
+
position: absolute;
|
|
44
|
+
inset: 0;
|
|
45
|
+
background-color: var(--_nav-rail-item-state-layer-color);
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition: opacity 150ms;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
z-index: 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (hover: hover) {
|
|
53
|
+
:host(:not([disabled]):hover) .active-indicator::before {
|
|
54
|
+
opacity: var(--u-state-hover-opacity, 0.08);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
:host(:not([disabled])) .button:focus-visible ~ .content .active-indicator::before {
|
|
58
|
+
opacity: var(--u-state-focus-opacity, 0.1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host(:not([disabled])) .button:active ~ .content .active-indicator::before {
|
|
62
|
+
opacity: var(--u-state-pressed-opacity, 0.1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.pill-ripple {
|
|
66
|
+
position: absolute;
|
|
67
|
+
inset: 0;
|
|
68
|
+
border-radius: inherit;
|
|
69
|
+
z-index: 0;
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
--u-ripple-pressed-color: var(--_nav-rail-item-state-layer-color);
|
|
72
|
+
--u-ripple-hover-color: transparent;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host(:not([variant=expanded])) .content {
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
gap: var(--u-nav-rail-item-vertical-icon-label-space, 4px);
|
|
78
|
+
}
|
|
79
|
+
:host(:not([variant=expanded])) .active-indicator {
|
|
80
|
+
width: var(--u-nav-rail-item-vertical-active-indicator-width, 56px);
|
|
81
|
+
height: var(--u-nav-rail-item-vertical-active-indicator-height, 32px);
|
|
82
|
+
}
|
|
83
|
+
:host(:not([variant=expanded])) .container {
|
|
84
|
+
min-height: var(--u-nav-rail-item-container-height, 64px);
|
|
85
|
+
padding-block: var(--u-nav-rail-item-vertical-padding-block, 4px);
|
|
86
|
+
padding-inline: var(--u-nav-rail-item-vertical-leading-space, 16px) var(--u-nav-rail-item-vertical-trailing-space, 16px);
|
|
87
|
+
}
|
|
88
|
+
:host(:not([variant=expanded])) .label {
|
|
89
|
+
font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));
|
|
90
|
+
line-height: var(--u-nav-rail-item-label-line-height, var(--u-label-m-line-height, 1rem));
|
|
91
|
+
font-size: var(--u-nav-rail-item-label-font-size, var(--u-label-m-font-size, 0.75rem));
|
|
92
|
+
letter-spacing: var(--u-nav-rail-item-label-letter-spacing, var(--u-label-m-letter-spacing, 0.0416666667rem));
|
|
93
|
+
font-weight: var(--u-nav-rail-item-label-font-weight, var(--u-label-m-font-weight, var(--u-font-weight-medium, 500)));
|
|
94
|
+
letter-spacing: var(--u-nav-rail-item-label-letter-spacing, 0.5px);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([variant=expanded]) {
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
:host([variant=expanded]) .content {
|
|
101
|
+
flex-direction: row;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: flex-start;
|
|
104
|
+
align-self: stretch;
|
|
105
|
+
}
|
|
106
|
+
:host([variant=expanded]) .active-indicator {
|
|
107
|
+
flex: 0 0 auto;
|
|
108
|
+
flex-direction: row;
|
|
109
|
+
justify-content: flex-start;
|
|
110
|
+
padding-inline: var(--u-nav-rail-item-active-indicator-leading-space, 16px) var(--u-nav-rail-item-active-indicator-trailing-space, 16px);
|
|
111
|
+
gap: var(--u-nav-rail-item-horizontal-icon-label-space, 8px);
|
|
112
|
+
max-width: 100%;
|
|
113
|
+
align-self: stretch;
|
|
114
|
+
}
|
|
115
|
+
:host([variant=expanded]) .container {
|
|
116
|
+
justify-content: flex-start;
|
|
117
|
+
min-height: var(--u-nav-rail-item-container-height, 64px);
|
|
118
|
+
padding-block: var(--u-nav-rail-item-expanded-padding-block, 2px);
|
|
119
|
+
padding-inline-start: var(--u-nav-rail-item-horizontal-full-width-leading-space, 16px);
|
|
120
|
+
}
|
|
121
|
+
:host([variant=expanded]) .label {
|
|
122
|
+
font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));
|
|
123
|
+
line-height: var(--u-nav-rail-item-label-expanded-line-height, var(--u-label-l-line-height, 1.25rem));
|
|
124
|
+
font-size: var(--u-nav-rail-item-label-expanded-font-size, var(--u-label-l-font-size, 0.875rem));
|
|
125
|
+
letter-spacing: var(--u-nav-rail-item-label-expanded-letter-spacing, var(--u-label-l-letter-spacing, 0.0071428571rem));
|
|
126
|
+
font-weight: var(--u-nav-rail-item-label-expanded-font-weight, var(--u-label-l-font-weight, var(--u-font-weight-medium, 500)));
|
|
127
|
+
text-align: start;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.icon {
|
|
131
|
+
position: relative;
|
|
132
|
+
display: inline-flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
width: var(--_nav-rail-item-icon-size);
|
|
136
|
+
height: var(--_nav-rail-item-icon-size);
|
|
137
|
+
font-size: var(--_nav-rail-item-icon-size);
|
|
138
|
+
line-height: 1;
|
|
139
|
+
color: var(--u-nav-rail-item-inactive-icon-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
|
|
140
|
+
flex: 0 0 auto;
|
|
141
|
+
z-index: 2;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.label {
|
|
145
|
+
color: var(--u-nav-rail-item-inactive-label-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
|
|
146
|
+
text-align: center;
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
text-overflow: ellipsis;
|
|
150
|
+
max-width: 100%;
|
|
151
|
+
z-index: 2;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.container:not(.has-label) .label,
|
|
155
|
+
.container:not(.has-icon) .icon {
|
|
156
|
+
display: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:host(.active) .container .active-indicator,
|
|
160
|
+
:host([active]) .container .active-indicator {
|
|
161
|
+
background-color: var(--u-nav-rail-item-active-indicator-color, var(--u-color-secondary-container, rgb(232, 222, 248)));
|
|
162
|
+
}
|
|
163
|
+
:host(.active) .container .icon,
|
|
164
|
+
:host([active]) .container .icon {
|
|
165
|
+
color: var(--u-nav-rail-item-active-icon-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
166
|
+
}
|
|
167
|
+
:host(.active) .container .label,
|
|
168
|
+
:host([active]) .container .label {
|
|
169
|
+
font-weight: var(--u-nav-rail-item-active-label-weight, var(--u-font-weight-bold, 700));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host(.active:not([variant=expanded])) .container .label,
|
|
173
|
+
:host([active]:not([variant=expanded])) .container .label {
|
|
174
|
+
color: var(--u-nav-rail-item-vertical-active-label-color, var(--u-color-secondary, rgb(98, 91, 113)));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host(.active[variant=expanded]) .container .label,
|
|
178
|
+
:host([active][variant=expanded]) .container .label {
|
|
179
|
+
color: var(--u-nav-rail-item-horizontal-active-label-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
//# sourceMappingURL=navigation-rail-item.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail-item.styles.js","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmLzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n display: flex;\n --_nav-rail-item-icon-size: var(--u-nav-rail-item-icon-size, 24px);\n --_nav-rail-item-state-layer-color: var(--u-nav-rail-item-state-layer-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n\n :host(:not([variant=expanded])) {\n width: 100%;\n }\n\n .container {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n color: var(--u-nav-rail-item-inactive-text-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n .content {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n pointer-events: none;\n }\n\n .active-indicator {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n border-radius: var(--u-nav-rail-item-active-indicator-shape, var(--u-shape-corner-full, 9999px));\n transition: background-color 150ms;\n overflow: hidden;\n }\n\n .active-indicator::before {\n content: \"\";\n position: absolute;\n inset: 0;\n background-color: var(--_nav-rail-item-state-layer-color);\n opacity: 0;\n transition: opacity 150ms;\n pointer-events: none;\n z-index: 1;\n }\n\n @media (hover: hover) {\n :host(:not([disabled]):hover) .active-indicator::before {\n opacity: var(--u-state-hover-opacity, 0.08);\n }\n }\n :host(:not([disabled])) .button:focus-visible ~ .content .active-indicator::before {\n opacity: var(--u-state-focus-opacity, 0.1);\n }\n\n :host(:not([disabled])) .button:active ~ .content .active-indicator::before {\n opacity: var(--u-state-pressed-opacity, 0.1);\n }\n\n .pill-ripple {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n z-index: 0;\n pointer-events: none;\n --u-ripple-pressed-color: var(--_nav-rail-item-state-layer-color);\n --u-ripple-hover-color: transparent;\n }\n\n :host(:not([variant=expanded])) .content {\n flex-direction: column;\n gap: var(--u-nav-rail-item-vertical-icon-label-space, 4px);\n }\n :host(:not([variant=expanded])) .active-indicator {\n width: var(--u-nav-rail-item-vertical-active-indicator-width, 56px);\n height: var(--u-nav-rail-item-vertical-active-indicator-height, 32px);\n }\n :host(:not([variant=expanded])) .container {\n min-height: var(--u-nav-rail-item-container-height, 64px);\n padding-block: var(--u-nav-rail-item-vertical-padding-block, 4px);\n padding-inline: var(--u-nav-rail-item-vertical-leading-space, 16px) var(--u-nav-rail-item-vertical-trailing-space, 16px);\n }\n :host(:not([variant=expanded])) .label {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-nav-rail-item-label-line-height, var(--u-label-m-line-height, 1rem));\n font-size: var(--u-nav-rail-item-label-font-size, var(--u-label-m-font-size, 0.75rem));\n letter-spacing: var(--u-nav-rail-item-label-letter-spacing, var(--u-label-m-letter-spacing, 0.0416666667rem));\n font-weight: var(--u-nav-rail-item-label-font-weight, var(--u-label-m-font-weight, var(--u-font-weight-medium, 500)));\n letter-spacing: var(--u-nav-rail-item-label-letter-spacing, 0.5px);\n }\n\n :host([variant=expanded]) {\n width: 100%;\n }\n :host([variant=expanded]) .content {\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n align-self: stretch;\n }\n :host([variant=expanded]) .active-indicator {\n flex: 0 0 auto;\n flex-direction: row;\n justify-content: flex-start;\n padding-inline: var(--u-nav-rail-item-active-indicator-leading-space, 16px) var(--u-nav-rail-item-active-indicator-trailing-space, 16px);\n gap: var(--u-nav-rail-item-horizontal-icon-label-space, 8px);\n max-width: 100%;\n align-self: stretch;\n }\n :host([variant=expanded]) .container {\n justify-content: flex-start;\n min-height: var(--u-nav-rail-item-container-height, 64px);\n padding-block: var(--u-nav-rail-item-expanded-padding-block, 2px);\n padding-inline-start: var(--u-nav-rail-item-horizontal-full-width-leading-space, 16px);\n }\n :host([variant=expanded]) .label {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-nav-rail-item-label-expanded-line-height, var(--u-label-l-line-height, 1.25rem));\n font-size: var(--u-nav-rail-item-label-expanded-font-size, var(--u-label-l-font-size, 0.875rem));\n letter-spacing: var(--u-nav-rail-item-label-expanded-letter-spacing, var(--u-label-l-letter-spacing, 0.0071428571rem));\n font-weight: var(--u-nav-rail-item-label-expanded-font-weight, var(--u-label-l-font-weight, var(--u-font-weight-medium, 500)));\n text-align: start;\n }\n\n .icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--_nav-rail-item-icon-size);\n height: var(--_nav-rail-item-icon-size);\n font-size: var(--_nav-rail-item-icon-size);\n line-height: 1;\n color: var(--u-nav-rail-item-inactive-icon-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n flex: 0 0 auto;\n z-index: 2;\n }\n\n .label {\n color: var(--u-nav-rail-item-inactive-label-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n z-index: 2;\n }\n\n .container:not(.has-label) .label,\n .container:not(.has-icon) .icon {\n display: none;\n }\n\n :host(.active) .container .active-indicator,\n :host([active]) .container .active-indicator {\n background-color: var(--u-nav-rail-item-active-indicator-color, var(--u-color-secondary-container, rgb(232, 222, 248)));\n }\n :host(.active) .container .icon,\n :host([active]) .container .icon {\n color: var(--u-nav-rail-item-active-icon-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n :host(.active) .container .label,\n :host([active]) .container .label {\n font-weight: var(--u-nav-rail-item-active-label-weight, var(--u-font-weight-bold, 700));\n }\n\n :host(.active:not([variant=expanded])) .container .label,\n :host([active]:not([variant=expanded])) .container .label {\n color: var(--u-nav-rail-item-vertical-active-label-color, var(--u-color-secondary, rgb(98, 91, 113)));\n }\n\n :host(.active[variant=expanded]) .container .label,\n :host([active][variant=expanded]) .container .label {\n color: var(--u-nav-rail-item-horizontal-active-label-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n`;\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
import '../elevation/elevation.js';
|
|
3
|
+
import './navigation-rail-headline.js';
|
|
4
|
+
import './navigation-rail-item.js';
|
|
5
|
+
/**
|
|
6
|
+
* Material 3 navigation rail — a responsive primary navigation surface that
|
|
7
|
+
* adapts to the viewport with two independently configurable destination
|
|
8
|
+
* sets:
|
|
9
|
+
*
|
|
10
|
+
* - **Mobile (< 840px)**: rail is hidden. `toggleDrawer` slides the
|
|
11
|
+
* expanded rail in from the left as a **modal** over the content (with
|
|
12
|
+
* scrim).
|
|
13
|
+
* - **Medium (840–1199px)**: a permanent 96dp **collapsed** sidebar shows
|
|
14
|
+
* `slot="rail"` items. `toggleDrawer` slides the expanded rail in over
|
|
15
|
+
* it as a **modal** (with scrim).
|
|
16
|
+
* - **Large (≥ 1200px)**: the expanded rail is permanent (no modal,
|
|
17
|
+
* no scrim). `toggleDrawer` slides it back off the leading edge,
|
|
18
|
+
* revealing the collapsed bar underneath.
|
|
19
|
+
*
|
|
20
|
+
* The expanded panel animates exactly like the side-navigation drawer:
|
|
21
|
+
* `inset-inline-start` transitions 375ms with the project's awesome cubic
|
|
22
|
+
* bezier easing.
|
|
23
|
+
*
|
|
24
|
+
* Slots:
|
|
25
|
+
* - `rail`: primary destinations shown in the permanent collapsed bar
|
|
26
|
+
* (`u-navigation-rail-item`s, no headlines).
|
|
27
|
+
* - `expanded`: full destination list shown in the expanded panel —
|
|
28
|
+
* `u-navigation-rail-item`s grouped by optional
|
|
29
|
+
* `u-navigation-rail-headline`s.
|
|
30
|
+
* - `top`: optional area pinned to the top of the rail (menu button,
|
|
31
|
+
* brand mark, etc.).
|
|
32
|
+
* - `bottom`: optional area pinned to the bottom of the rail (FAB,
|
|
33
|
+
* secondary action, etc.).
|
|
34
|
+
* - default: page content.
|
|
35
|
+
*/
|
|
36
|
+
export declare class NavigationRail extends LitElement {
|
|
37
|
+
#private;
|
|
38
|
+
static styles: import("lit").CSSResult[];
|
|
39
|
+
/**
|
|
40
|
+
* Toggle the rail's secondary state:
|
|
41
|
+
*
|
|
42
|
+
* - On mobile/medium: slides the expanded rail in from the left as a
|
|
43
|
+
* modal overlay (with scrim). Click on the scrim to close.
|
|
44
|
+
* - On large: slides the expanded rail off, revealing the collapsed
|
|
45
|
+
* 96dp bar underneath.
|
|
46
|
+
*/
|
|
47
|
+
toggleDrawer: boolean;
|
|
48
|
+
private readonly assignedCollapsedItems;
|
|
49
|
+
private readonly assignedExpandedElements;
|
|
50
|
+
private readonly assignedTop;
|
|
51
|
+
private readonly assignedBottom;
|
|
52
|
+
private readonly railEl;
|
|
53
|
+
private readonly railExpandedEl;
|
|
54
|
+
private readonly railItemsEl;
|
|
55
|
+
private readonly railItemsExpandedEl;
|
|
56
|
+
private readonly railThumbEl;
|
|
57
|
+
private readonly railExpandedThumbEl;
|
|
58
|
+
render(): HTMLTemplateResult;
|
|
59
|
+
firstUpdated(): void;
|
|
60
|
+
}
|
|
61
|
+
declare global {
|
|
62
|
+
interface HTMLElementTagNameMap {
|
|
63
|
+
'u-navigation-rail': NavigationRail;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=navigation-rail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-rail.d.ts","sourceRoot":"","sources":["../../src/navigation-rail/navigation-rail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAM3D,OAAO,2BAA2B,CAAC;AACnC,OAAO,+BAA+B,CAAC;AACvC,OAAO,2BAA2B,CAAC;AAGnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBACa,cAAe,SAAQ,UAAU;;IAC5C,OAAgB,MAAM,4BAAwB;IAE9C;;;;;;;OAOG;IACqE,YAAY,UAAS;IAG7F,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAiB;IAGxD,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAiB;IAG1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAG7C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAEhC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAe;IACjD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAe;IACpD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAe;IAEjF,MAAM,IAAI,kBAAkB;IA8B5B,YAAY,IAAI,IAAI;CAwG9B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,cAAc,CAAC;KACrC;CACF"}
|