@aquera/nile-elements 2.0.22 → 2.0.24
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/README.md +76 -34
- package/demo/nxtgen-classes.css +24 -4
- package/demo/nxtgen-dark.css +30 -16
- package/demo/nxtgen-properties.css +9 -2
- package/demo/nxtgen-utilities.css +31 -4
- package/demo/nxtgen.css +8 -4
- package/demo/utilities.css +2 -2
- package/demo/variables.css +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1929 -936
- package/dist/nile-app-shell/index.cjs.js +1 -1
- package/dist/nile-app-shell/index.esm.js +1 -1
- package/dist/nile-app-shell/nile-app-shell.cjs.js +1 -1
- package/dist/nile-app-shell/nile-app-shell.cjs.js.map +1 -1
- package/dist/nile-app-shell/nile-app-shell.css.cjs.js +1 -1
- package/dist/nile-app-shell/nile-app-shell.css.cjs.js.map +1 -1
- package/dist/nile-app-shell/nile-app-shell.css.esm.js +72 -65
- package/dist/nile-app-shell/nile-app-shell.esm.js +60 -31
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.cjs.js +1 -1
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.cjs.js.map +1 -1
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.esm.js +1 -1
- package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.cjs.js +1 -1
- package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.cjs.js.map +1 -1
- package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.css.cjs.js +1 -1
- package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.css.cjs.js.map +1 -1
- package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.css.esm.js +25 -7
- package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.esm.js +2 -2
- package/dist/nile-button-filter/nile-button-filter.cjs.js +1 -1
- package/dist/nile-button-filter/nile-button-filter.cjs.js.map +1 -1
- package/dist/nile-button-filter/nile-button-filter.css.cjs.js +1 -1
- package/dist/nile-button-filter/nile-button-filter.css.cjs.js.map +1 -1
- package/dist/nile-button-filter/nile-button-filter.css.esm.js +1 -1
- package/dist/nile-button-filter/nile-button-filter.esm.js +2 -4
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +9 -8
- package/dist/nile-color-picker/nile-color-picker.css.cjs.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.css.cjs.js.map +1 -1
- package/dist/nile-color-picker/nile-color-picker.css.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.css.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.css.cjs.js.map +1 -1
- package/dist/nile-combobox/nile-combobox.css.esm.js +1 -1
- package/dist/nile-command-menu-item/nile-command-menu-item.css.cjs.js +1 -1
- package/dist/nile-command-menu-item/nile-command-menu-item.css.cjs.js.map +1 -1
- package/dist/nile-command-menu-item/nile-command-menu-item.css.esm.js +5 -1
- package/dist/nile-context-menu/nile-context-menu.css.cjs.js +1 -1
- package/dist/nile-context-menu/nile-context-menu.css.cjs.js.map +1 -1
- package/dist/nile-context-menu/nile-context-menu.css.esm.js +2 -3
- package/dist/nile-dropdown-switcher/index.cjs.js +2 -0
- package/dist/nile-dropdown-switcher/index.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher/index.esm.js +1 -0
- package/dist/nile-dropdown-switcher/nile-dropdown-switcher.cjs.js +2 -0
- package/dist/nile-dropdown-switcher/nile-dropdown-switcher.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher/nile-dropdown-switcher.css.cjs.js +2 -0
- package/dist/nile-dropdown-switcher/nile-dropdown-switcher.css.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher/nile-dropdown-switcher.css.esm.js +39 -0
- package/dist/nile-dropdown-switcher/nile-dropdown-switcher.esm.js +1 -0
- package/dist/nile-dropdown-switcher-group/index.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-group/index.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-group/index.esm.js +1 -0
- package/dist/nile-dropdown-switcher-group/nile-dropdown-switcher-group.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-group/nile-dropdown-switcher-group.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-group/nile-dropdown-switcher-group.css.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-group/nile-dropdown-switcher-group.css.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-group/nile-dropdown-switcher-group.css.esm.js +37 -0
- package/dist/nile-dropdown-switcher-group/nile-dropdown-switcher-group.esm.js +8 -0
- package/dist/nile-dropdown-switcher-header/index.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-header/index.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-header/index.esm.js +1 -0
- package/dist/nile-dropdown-switcher-header/nile-dropdown-switcher-header.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-header/nile-dropdown-switcher-header.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-header/nile-dropdown-switcher-header.css.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-header/nile-dropdown-switcher-header.css.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-header/nile-dropdown-switcher-header.css.esm.js +91 -0
- package/dist/nile-dropdown-switcher-header/nile-dropdown-switcher-header.esm.js +33 -0
- package/dist/nile-dropdown-switcher-item/index.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-item/index.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-item/index.esm.js +1 -0
- package/dist/nile-dropdown-switcher-item/nile-dropdown-switcher-item.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-item/nile-dropdown-switcher-item.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-item/nile-dropdown-switcher-item.css.cjs.js +2 -0
- package/dist/nile-dropdown-switcher-item/nile-dropdown-switcher-item.css.cjs.js.map +1 -0
- package/dist/nile-dropdown-switcher-item/nile-dropdown-switcher-item.css.esm.js +102 -0
- package/dist/nile-dropdown-switcher-item/nile-dropdown-switcher-item.esm.js +35 -0
- package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +2 -2
- package/dist/nile-form-group/nile-form-group.css.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.css.cjs.js.map +1 -1
- package/dist/nile-form-group/nile-form-group.css.esm.js +3 -3
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.esm.js +20 -4
- package/dist/nile-inline-sidebar-item-body/nile-inline-sidebar-item-body.css.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item-body/nile-inline-sidebar-item-body.css.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item-body/nile-inline-sidebar-item-body.css.esm.js +3 -3
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.esm.js +3 -3
- package/dist/nile-markdown-editor/nile-markdown-editor.css.cjs.js +1 -1
- package/dist/nile-markdown-editor/nile-markdown-editor.css.cjs.js.map +1 -1
- package/dist/nile-markdown-editor/nile-markdown-editor.css.esm.js +4 -4
- package/dist/nile-menu/nile-menu.css.cjs.js +1 -1
- package/dist/nile-menu/nile-menu.css.cjs.js.map +1 -1
- package/dist/nile-menu/nile-menu.css.esm.js +1 -2
- package/dist/nile-menu-item/nile-menu-item.css.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.css.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.css.esm.js +6 -6
- package/dist/nile-nav-tab/nile-nav-tab.css.cjs.js +1 -1
- package/dist/nile-nav-tab/nile-nav-tab.css.cjs.js.map +1 -1
- package/dist/nile-nav-tab/nile-nav-tab.css.esm.js +3 -3
- package/dist/nile-nav-tab-group/nile-nav-tab-group.css.cjs.js +1 -1
- package/dist/nile-nav-tab-group/nile-nav-tab-group.css.cjs.js.map +1 -1
- package/dist/nile-nav-tab-group/nile-nav-tab-group.css.esm.js +15 -12
- package/dist/nile-option/nile-option.css.cjs.js +1 -1
- package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.esm.js +2 -2
- package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
- package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
- package/dist/nile-pagination/nile-pagination.css.cjs.js +1 -1
- package/dist/nile-pagination/nile-pagination.css.cjs.js.map +1 -1
- package/dist/nile-pagination/nile-pagination.css.esm.js +10 -0
- package/dist/nile-pagination/nile-pagination.esm.js +14 -14
- package/dist/nile-side-bar/nile-side-bar.cjs.js +1 -1
- package/dist/nile-side-bar/nile-side-bar.cjs.js.map +1 -1
- package/dist/nile-side-bar/nile-side-bar.css.cjs.js +1 -1
- package/dist/nile-side-bar/nile-side-bar.css.cjs.js.map +1 -1
- package/dist/nile-side-bar/nile-side-bar.css.esm.js +16 -14
- package/dist/nile-side-bar/nile-side-bar.esm.js +2 -2
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.css.cjs.js +1 -1
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.css.esm.js +11 -4
- package/dist/nile-side-bar-footer/nile-side-bar-footer.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.cjs.js +1 -1
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.esm.js +8 -3
- package/dist/nile-side-bar-footer-item/index.cjs.js +1 -1
- package/dist/nile-side-bar-footer-item/index.esm.js +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.cjs.js +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.esm.js +181 -25
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.esm.js +10 -3
- package/dist/nile-side-bar-footer-text/nile-side-bar-footer-text.css.cjs.js +1 -1
- package/dist/nile-side-bar-footer-text/nile-side-bar-footer-text.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer-text/nile-side-bar-footer-text.css.esm.js +10 -5
- package/dist/nile-side-bar-group/nile-side-bar-group.cjs.js +1 -1
- package/dist/nile-side-bar-group/nile-side-bar-group.cjs.js.map +1 -1
- package/dist/nile-side-bar-group/nile-side-bar-group.css.cjs.js +1 -1
- package/dist/nile-side-bar-group/nile-side-bar-group.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-group/nile-side-bar-group.css.esm.js +52 -9
- package/dist/nile-side-bar-group/nile-side-bar-group.esm.js +4 -4
- package/dist/nile-side-bar-group-item/nile-side-bar-group-item.css.cjs.js +1 -1
- package/dist/nile-side-bar-group-item/nile-side-bar-group-item.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-group-item/nile-side-bar-group-item.css.esm.js +53 -8
- package/dist/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.cjs.js +1 -1
- package/dist/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.cjs.js.map +1 -1
- package/dist/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.css.cjs.js +1 -1
- package/dist/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.css.esm.js +13 -4
- package/dist/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.esm.js +4 -4
- package/dist/nile-side-bar-group-item-text/nile-side-bar-group-item-text.css.cjs.js +1 -1
- package/dist/nile-side-bar-group-item-text/nile-side-bar-group-item-text.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-group-item-text/nile-side-bar-group-item-text.css.esm.js +9 -6
- package/dist/nile-side-bar-header/nile-side-bar-header.cjs.js.map +1 -1
- package/dist/nile-side-bar-header/nile-side-bar-header.css.cjs.js +1 -1
- package/dist/nile-side-bar-header/nile-side-bar-header.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-header/nile-side-bar-header.css.esm.js +13 -6
- package/dist/nile-side-bar-header-switcher/index.cjs.js +2 -0
- package/dist/nile-side-bar-header-switcher/index.cjs.js.map +1 -0
- package/dist/nile-side-bar-header-switcher/index.esm.js +1 -0
- package/dist/nile-side-bar-header-switcher/nile-side-bar-header-switcher.cjs.js +2 -0
- package/dist/nile-side-bar-header-switcher/nile-side-bar-header-switcher.cjs.js.map +1 -0
- package/dist/nile-side-bar-header-switcher/nile-side-bar-header-switcher.css.cjs.js +2 -0
- package/dist/nile-side-bar-header-switcher/nile-side-bar-header-switcher.css.cjs.js.map +1 -0
- package/dist/nile-side-bar-header-switcher/nile-side-bar-header-switcher.css.esm.js +83 -0
- package/dist/nile-side-bar-header-switcher/nile-side-bar-header-switcher.esm.js +24 -0
- package/dist/nile-side-bar-search/index.cjs.js +2 -0
- package/dist/nile-side-bar-search/index.cjs.js.map +1 -0
- package/dist/nile-side-bar-search/index.esm.js +1 -0
- package/dist/nile-side-bar-search/nile-side-bar-search.cjs.js +2 -0
- package/dist/nile-side-bar-search/nile-side-bar-search.cjs.js.map +1 -0
- package/dist/nile-side-bar-search/nile-side-bar-search.css.cjs.js +2 -0
- package/dist/nile-side-bar-search/nile-side-bar-search.css.cjs.js.map +1 -0
- package/dist/nile-side-bar-search/nile-side-bar-search.css.esm.js +103 -0
- package/dist/nile-side-bar-search/nile-side-bar-search.esm.js +25 -0
- package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.esm.js +7 -5
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +51 -2
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +3 -3
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-app-shell/nile-app-shell.css.js +70 -63
- package/dist/src/nile-app-shell/nile-app-shell.css.js.map +1 -1
- package/dist/src/nile-app-shell/nile-app-shell.d.ts +40 -7
- package/dist/src/nile-app-shell/nile-app-shell.js +192 -41
- package/dist/src/nile-app-shell/nile-app-shell.js.map +1 -1
- package/dist/src/nile-app-shell/nile-app-shell.test.d.ts +2 -0
- package/dist/src/nile-app-shell/nile-app-shell.test.js +272 -1020
- package/dist/src/nile-app-shell/nile-app-shell.test.js.map +1 -1
- package/dist/src/nile-app-shell/zz-layout.test.d.ts +15 -0
- package/dist/src/nile-app-shell/zz-layout.test.js +253 -0
- package/dist/src/nile-app-shell/zz-layout.test.js.map +1 -0
- package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.js +1 -1
- package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.js.map +1 -1
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.js +24 -6
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.js.map +1 -1
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.d.ts +8 -2
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.js +56 -2
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.js.map +1 -1
- package/dist/src/nile-button-filter/nile-button-filter.css.js +1 -1
- package/dist/src/nile-button-filter/nile-button-filter.css.js.map +1 -1
- package/dist/src/nile-button-filter/nile-button-filter.js +1 -3
- package/dist/src/nile-button-filter/nile-button-filter.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js +9 -8
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-color-picker/nile-color-picker.css.js +3 -3
- package/dist/src/nile-color-picker/nile-color-picker.css.js.map +1 -1
- package/dist/src/nile-combobox/nile-combobox.css.js +1 -1
- package/dist/src/nile-combobox/nile-combobox.css.js.map +1 -1
- package/dist/src/nile-command-menu-item/nile-command-menu-item.css.js +5 -1
- package/dist/src/nile-command-menu-item/nile-command-menu-item.css.js.map +1 -1
- package/dist/src/nile-context-menu/nile-context-menu.css.js +2 -4
- package/dist/src/nile-context-menu/nile-context-menu.css.js.map +1 -1
- package/dist/src/nile-dropdown-switcher/index.d.ts +1 -0
- package/dist/src/nile-dropdown-switcher/index.js +2 -0
- package/dist/src/nile-dropdown-switcher/index.js.map +1 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.css.d.ts +10 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.css.js +49 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.css.js.map +1 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.d.ts +101 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.js +463 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.js.map +1 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.test.d.ts +4 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.test.js +506 -0
- package/dist/src/nile-dropdown-switcher/nile-dropdown-switcher.test.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-group/index.d.ts +1 -0
- package/dist/src/nile-dropdown-switcher-group/index.js +2 -0
- package/dist/src/nile-dropdown-switcher-group/index.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-group/nile-dropdown-switcher-group.css.d.ts +12 -0
- package/dist/src/nile-dropdown-switcher-group/nile-dropdown-switcher-group.css.js +49 -0
- package/dist/src/nile-dropdown-switcher-group/nile-dropdown-switcher-group.css.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-group/nile-dropdown-switcher-group.d.ts +37 -0
- package/dist/src/nile-dropdown-switcher-group/nile-dropdown-switcher-group.js +72 -0
- package/dist/src/nile-dropdown-switcher-group/nile-dropdown-switcher-group.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-header/index.d.ts +1 -0
- package/dist/src/nile-dropdown-switcher-header/index.js +2 -0
- package/dist/src/nile-dropdown-switcher-header/index.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-header/nile-dropdown-switcher-header.css.d.ts +12 -0
- package/dist/src/nile-dropdown-switcher-header/nile-dropdown-switcher-header.css.js +103 -0
- package/dist/src/nile-dropdown-switcher-header/nile-dropdown-switcher-header.css.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-header/nile-dropdown-switcher-header.d.ts +46 -0
- package/dist/src/nile-dropdown-switcher-header/nile-dropdown-switcher-header.js +105 -0
- package/dist/src/nile-dropdown-switcher-header/nile-dropdown-switcher-header.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-item/index.d.ts +1 -0
- package/dist/src/nile-dropdown-switcher-item/index.js +2 -0
- package/dist/src/nile-dropdown-switcher-item/index.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-item/nile-dropdown-switcher-item.css.d.ts +10 -0
- package/dist/src/nile-dropdown-switcher-item/nile-dropdown-switcher-item.css.js +112 -0
- package/dist/src/nile-dropdown-switcher-item/nile-dropdown-switcher-item.css.js.map +1 -0
- package/dist/src/nile-dropdown-switcher-item/nile-dropdown-switcher-item.d.ts +55 -0
- package/dist/src/nile-dropdown-switcher-item/nile-dropdown-switcher-item.js +154 -0
- package/dist/src/nile-dropdown-switcher-item/nile-dropdown-switcher-item.js.map +1 -0
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js +2 -2
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
- package/dist/src/nile-form-group/nile-form-group.css.js +1 -1
- package/dist/src/nile-form-group/nile-form-group.css.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.js +20 -4
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item-body/nile-inline-sidebar-item-body.css.js +1 -1
- package/dist/src/nile-inline-sidebar-item-body/nile-inline-sidebar-item-body.css.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.js +3 -3
- package/dist/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.js.map +1 -1
- package/dist/src/nile-markdown-editor/nile-markdown-editor.css.js +4 -4
- package/dist/src/nile-markdown-editor/nile-markdown-editor.css.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.css.js +1 -2
- package/dist/src/nile-menu/nile-menu.css.js.map +1 -1
- package/dist/src/nile-menu-item/nile-menu-item.css.js +4 -4
- package/dist/src/nile-menu-item/nile-menu-item.css.js.map +1 -1
- package/dist/src/nile-nav-tab/nile-nav-tab.css.js +3 -3
- package/dist/src/nile-nav-tab/nile-nav-tab.css.js.map +1 -1
- package/dist/src/nile-nav-tab-group/nile-nav-tab-group.css.js +15 -12
- package/dist/src/nile-nav-tab-group/nile-nav-tab-group.css.js.map +1 -1
- package/dist/src/nile-nav-tab-group/nile-nav-tab-group.test.js +111 -0
- package/dist/src/nile-nav-tab-group/nile-nav-tab-group.test.js.map +1 -1
- package/dist/src/nile-option/nile-option.css.js +2 -2
- package/dist/src/nile-option/nile-option.css.js.map +1 -1
- package/dist/src/nile-pagination/nile-pagination.css.js +10 -0
- package/dist/src/nile-pagination/nile-pagination.css.js.map +1 -1
- package/dist/src/nile-pagination/nile-pagination.d.ts +2 -0
- package/dist/src/nile-pagination/nile-pagination.js +13 -9
- package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
- package/dist/src/nile-side-bar/nile-side-bar.css.js +14 -12
- package/dist/src/nile-side-bar/nile-side-bar.css.js.map +1 -1
- package/dist/src/nile-side-bar/nile-side-bar.d.ts +17 -0
- package/dist/src/nile-side-bar/nile-side-bar.js +68 -12
- package/dist/src/nile-side-bar/nile-side-bar.js.map +1 -1
- package/dist/src/nile-side-bar/nile-side-bar.test.d.ts +23 -0
- package/dist/src/nile-side-bar/nile-side-bar.test.js +1614 -1
- package/dist/src/nile-side-bar/nile-side-bar.test.js.map +1 -1
- package/dist/src/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.css.js +11 -4
- package/dist/src/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.css.js.map +1 -1
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.css.js +8 -3
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.css.js.map +1 -1
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.d.ts +7 -5
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.js +7 -5
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.js.map +1 -1
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js +179 -23
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js.map +1 -1
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.d.ts +15 -0
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.js +82 -2
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.js.map +1 -1
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.test.d.ts +9 -0
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.test.js +201 -0
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.test.js.map +1 -0
- package/dist/src/nile-side-bar-footer-text/nile-side-bar-footer-text.css.js +8 -3
- package/dist/src/nile-side-bar-footer-text/nile-side-bar-footer-text.css.js.map +1 -1
- package/dist/src/nile-side-bar-group/nile-side-bar-group.css.js +50 -7
- package/dist/src/nile-side-bar-group/nile-side-bar-group.css.js.map +1 -1
- package/dist/src/nile-side-bar-group/nile-side-bar-group.d.ts +35 -0
- package/dist/src/nile-side-bar-group/nile-side-bar-group.js +90 -3
- package/dist/src/nile-side-bar-group/nile-side-bar-group.js.map +1 -1
- package/dist/src/nile-side-bar-group-item/nile-side-bar-group-item.css.js +52 -7
- package/dist/src/nile-side-bar-group-item/nile-side-bar-group-item.css.js.map +1 -1
- package/dist/src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.css.js +11 -2
- package/dist/src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.css.js.map +1 -1
- package/dist/src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.d.ts +11 -2
- package/dist/src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.js +21 -15
- package/dist/src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.js.map +1 -1
- package/dist/src/nile-side-bar-group-item-text/nile-side-bar-group-item-text.css.js +7 -4
- package/dist/src/nile-side-bar-group-item-text/nile-side-bar-group-item-text.css.js.map +1 -1
- package/dist/src/nile-side-bar-header/nile-side-bar-app-shell.test.js +22 -17
- package/dist/src/nile-side-bar-header/nile-side-bar-app-shell.test.js.map +1 -1
- package/dist/src/nile-side-bar-header/nile-side-bar-header-surface.test.d.ts +4 -0
- package/dist/src/nile-side-bar-header/nile-side-bar-header-surface.test.js +143 -0
- package/dist/src/nile-side-bar-header/nile-side-bar-header-surface.test.js.map +1 -0
- package/dist/src/nile-side-bar-header/nile-side-bar-header.css.js +11 -4
- package/dist/src/nile-side-bar-header/nile-side-bar-header.css.js.map +1 -1
- package/dist/src/nile-side-bar-header/nile-side-bar-header.d.ts +7 -5
- package/dist/src/nile-side-bar-header/nile-side-bar-header.js +7 -5
- package/dist/src/nile-side-bar-header/nile-side-bar-header.js.map +1 -1
- package/dist/src/nile-side-bar-header-switcher/index.d.ts +1 -0
- package/dist/src/nile-side-bar-header-switcher/index.js +2 -0
- package/dist/src/nile-side-bar-header-switcher/index.js.map +1 -0
- package/dist/src/nile-side-bar-header-switcher/nile-side-bar-header-switcher.css.d.ts +14 -0
- package/dist/src/nile-side-bar-header-switcher/nile-side-bar-header-switcher.css.js +97 -0
- package/dist/src/nile-side-bar-header-switcher/nile-side-bar-header-switcher.css.js.map +1 -0
- package/dist/src/nile-side-bar-header-switcher/nile-side-bar-header-switcher.d.ts +38 -0
- package/dist/src/nile-side-bar-header-switcher/nile-side-bar-header-switcher.js +86 -0
- package/dist/src/nile-side-bar-header-switcher/nile-side-bar-header-switcher.js.map +1 -0
- package/dist/src/nile-side-bar-search/index.d.ts +1 -0
- package/dist/src/nile-side-bar-search/index.js +2 -0
- package/dist/src/nile-side-bar-search/index.js.map +1 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.css.d.ts +15 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.css.js +118 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.css.js.map +1 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.d.ts +56 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.js +150 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.js.map +1 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.test.d.ts +3 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.test.js +153 -0
- package/dist/src/nile-side-bar-search/nile-side-bar-search.test.js.map +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +7 -5
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +51 -2
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +3 -3
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/version.cjs.js +1 -1
- package/dist/version.cjs.js.map +1 -1
- package/dist/version.esm.js +1 -1
- package/docs/screenshots/wysiwyg-focus-state-focused.png +0 -0
- package/docs/screenshots/wysiwyg-focus-state-unfocused.png +0 -0
- package/package.json +1 -1
- package/src/index.ts +6 -0
- package/src/nile-app-shell/nile-app-shell.css.ts +70 -63
- package/src/nile-app-shell/nile-app-shell.test.ts +332 -1227
- package/src/nile-app-shell/nile-app-shell.ts +223 -44
- package/src/nile-app-shell/zz-layout.test.ts +271 -0
- package/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.ts +1 -5
- package/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.ts +24 -6
- package/src/nile-app-shell-side-nav/nile-app-shell-side-nav.ts +62 -2
- package/src/nile-button-filter/nile-button-filter.css.ts +1 -1
- package/src/nile-button-filter/nile-button-filter.ts +1 -3
- package/src/nile-calendar/nile-calendar.css.ts +9 -8
- package/src/nile-color-picker/nile-color-picker.css.ts +3 -3
- package/src/nile-combobox/nile-combobox.css.ts +1 -1
- package/src/nile-command-menu-item/nile-command-menu-item.css.ts +5 -1
- package/src/nile-context-menu/nile-context-menu.css.ts +2 -4
- package/src/nile-dropdown-switcher/index.ts +1 -0
- package/src/nile-dropdown-switcher/nile-dropdown-switcher.css.ts +51 -0
- package/src/nile-dropdown-switcher/nile-dropdown-switcher.test.ts +570 -0
- package/src/nile-dropdown-switcher/nile-dropdown-switcher.ts +502 -0
- package/src/nile-dropdown-switcher-group/index.ts +1 -0
- package/src/nile-dropdown-switcher-group/nile-dropdown-switcher-group.css.ts +51 -0
- package/src/nile-dropdown-switcher-group/nile-dropdown-switcher-group.ts +78 -0
- package/src/nile-dropdown-switcher-header/index.ts +1 -0
- package/src/nile-dropdown-switcher-header/nile-dropdown-switcher-header.css.ts +105 -0
- package/src/nile-dropdown-switcher-header/nile-dropdown-switcher-header.ts +105 -0
- package/src/nile-dropdown-switcher-item/index.ts +1 -0
- package/src/nile-dropdown-switcher-item/nile-dropdown-switcher-item.css.ts +114 -0
- package/src/nile-dropdown-switcher-item/nile-dropdown-switcher-item.ts +151 -0
- package/src/nile-filter-chip/nile-filter-chip.css.ts +2 -2
- package/src/nile-form-group/nile-form-group.css.ts +1 -1
- package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.ts +20 -4
- package/src/nile-inline-sidebar-item-body/nile-inline-sidebar-item-body.css.ts +1 -1
- package/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.ts +3 -3
- package/src/nile-markdown-editor/nile-markdown-editor.css.ts +4 -4
- package/src/nile-menu/nile-menu.css.ts +1 -2
- package/src/nile-menu-item/nile-menu-item.css.ts +4 -4
- package/src/nile-nav-tab/nile-nav-tab.css.ts +3 -3
- package/src/nile-nav-tab-group/nile-nav-tab-group.css.ts +15 -12
- package/src/nile-nav-tab-group/nile-nav-tab-group.test.ts +130 -0
- package/src/nile-option/nile-option.css.ts +2 -2
- package/src/nile-pagination/nile-pagination.css.ts +10 -0
- package/src/nile-pagination/nile-pagination.ts +14 -9
- package/src/nile-side-bar/nile-side-bar.css.ts +14 -12
- package/src/nile-side-bar/nile-side-bar.test.ts +1854 -2
- package/src/nile-side-bar/nile-side-bar.ts +72 -15
- package/src/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.css.ts +11 -4
- package/src/nile-side-bar-footer/nile-side-bar-footer.css.ts +8 -3
- package/src/nile-side-bar-footer/nile-side-bar-footer.ts +7 -5
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.ts +179 -23
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.test.ts +219 -0
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.ts +84 -2
- package/src/nile-side-bar-footer-text/nile-side-bar-footer-text.css.ts +8 -3
- package/src/nile-side-bar-group/nile-side-bar-group.css.ts +50 -7
- package/src/nile-side-bar-group/nile-side-bar-group.ts +100 -2
- package/src/nile-side-bar-group-item/nile-side-bar-group-item.css.ts +52 -7
- package/src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.css.ts +11 -2
- package/src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.ts +22 -19
- package/src/nile-side-bar-group-item-text/nile-side-bar-group-item-text.css.ts +7 -4
- package/src/nile-side-bar-header/nile-side-bar-app-shell.test.ts +22 -17
- package/src/nile-side-bar-header/nile-side-bar-header-surface.test.ts +175 -0
- package/src/nile-side-bar-header/nile-side-bar-header.css.ts +11 -4
- package/src/nile-side-bar-header/nile-side-bar-header.ts +7 -5
- package/src/nile-side-bar-header-switcher/index.ts +1 -0
- package/src/nile-side-bar-header-switcher/nile-side-bar-header-switcher.css.ts +99 -0
- package/src/nile-side-bar-header-switcher/nile-side-bar-header-switcher.ts +88 -0
- package/src/nile-side-bar-search/index.ts +1 -0
- package/src/nile-side-bar-search/nile-side-bar-search.css.ts +120 -0
- package/src/nile-side-bar-search/nile-side-bar-search.test.ts +175 -0
- package/src/nile-side-bar-search/nile-side-bar-search.ts +160 -0
- package/src/nile-slide-toggle/nile-slide-toggle.css.ts +1 -1
- package/src/nile-tooltip/nile-tooltip.css.ts +7 -5
- package/src/nile-virtual-select/nile-virtual-select.css.ts +1 -1
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +51 -2
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +1 -1
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +3 -3
- package/test-timings.json +0 -1
- package/vscode-html-custom-data.json +349 -22
|
@@ -13,15 +13,20 @@ export const styles = css `
|
|
|
13
13
|
display: block;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/* NxtGen: a 40px item with 2px block padding so the row inside is 36px; enterprise keeps 208 x 38. */
|
|
16
17
|
.group-item {
|
|
17
18
|
display: flex;
|
|
18
19
|
flex-direction: column;
|
|
20
|
+
box-sizing: border-box;
|
|
19
21
|
height: var(--nile-height-38px, var(--ng-spacing-40px));
|
|
20
|
-
width:
|
|
22
|
+
width: 100%;
|
|
23
|
+
padding-top: var(--nile-spacing-none, var(--ng-spacing-xxs));
|
|
24
|
+
padding-bottom: var(--nile-spacing-none, var(--ng-spacing-xxs));
|
|
21
25
|
overflow: hidden;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
.item-link {
|
|
29
|
+
position: relative;
|
|
25
30
|
display: flex;
|
|
26
31
|
align-items: center;
|
|
27
32
|
justify-content: flex-start;
|
|
@@ -38,29 +43,69 @@ export const styles = css `
|
|
|
38
43
|
line-height: 1.4;
|
|
39
44
|
box-sizing: border-box;
|
|
40
45
|
font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));
|
|
46
|
+
/* The same 8px radius in every state (rest, hover, selected, focus ring), not only once hovered or selected. */
|
|
47
|
+
border-radius: var(--nile-radius-sm, var(--ng-radius-md));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Default: text-secondary-700; the icon is fg-quaternary-400 (set on the nile-icon by nile-side-bar-group-item-icon). */
|
|
51
|
+
::slotted(nile-side-bar-group-item-text) {
|
|
52
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));
|
|
41
53
|
}
|
|
42
54
|
|
|
43
55
|
.item-link:hover {
|
|
44
|
-
background: var(--nile-colors-neutral-400, var(--ng-colors-bg-
|
|
45
|
-
border-radius: var(--nile-radius-sm, var(--ng-radius-
|
|
56
|
+
background: var(--nile-colors-neutral-400, var(--ng-colors-bg-secondary-subtle));
|
|
57
|
+
border-radius: var(--nile-radius-sm, var(--ng-radius-md));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Hover: text-tertiary-hover label and fg-tertiary-hover icon. A selected item keeps its selected colours, so it is excluded from the icon rule. */
|
|
61
|
+
.item-link:hover ::slotted(nile-side-bar-group-item-text) {
|
|
62
|
+
color: var(--nile-colors-dark-800, var(--ng-colors-text-tertiary-hover));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host(:not([active])) .item-link:hover ::slotted(nile-side-bar-group-item-icon) {
|
|
66
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-fg-tertiary-hover));
|
|
46
67
|
}
|
|
47
68
|
|
|
69
|
+
/* The icon is drawn in its own colour: fg-quaternary-400 by default, recoloured by the hover and selected rules above and below. */
|
|
48
70
|
::slotted(nile-side-bar-group-item-icon) {
|
|
49
71
|
flex-shrink: 0;
|
|
72
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-fg-quaternary-400));
|
|
50
73
|
}
|
|
51
74
|
|
|
52
75
|
::slotted(nile-side-bar-group-item-text) {
|
|
53
76
|
flex-grow: 1;
|
|
54
77
|
}
|
|
55
78
|
|
|
79
|
+
/* Every selected item shows the same background/text/icon regardless of hover/focus state. */
|
|
56
80
|
:host([active]) [part="link"] {
|
|
57
|
-
background: var(--nile-colors-primary-100, var(--ng-colors-bg-
|
|
58
|
-
border-radius: var(--nile-radius-sm, var(--ng-radius-
|
|
81
|
+
background: var(--nile-colors-primary-100, var(--ng-colors-bg-primary));
|
|
82
|
+
border-radius: var(--nile-radius-sm, var(--ng-radius-md));
|
|
59
83
|
}
|
|
60
84
|
|
|
85
|
+
:host([active]) ::slotted(nile-side-bar-group-item-text) {
|
|
86
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-brand-secondary-700));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([active]) ::slotted(nile-side-bar-group-item-icon) {
|
|
90
|
+
color: var(--ng-colors-fg-brand-primary-600);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Focus-visible adds only the ring, independent of selection -- a safe no-op on enterprise. */
|
|
94
|
+
.item-link:focus-visible {
|
|
95
|
+
outline: none;
|
|
96
|
+
box-shadow: inset 0 0 0 var(--ng-border-width-2) var(--ng-colors-effects-focus-ring);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Collapsed: 40 x 40 (38 x 38 on enterprise), clipped. */
|
|
61
100
|
:host([collapsed]) .group-item {
|
|
62
|
-
height: 38px;
|
|
63
|
-
width: 38px;
|
|
101
|
+
height: var(--nile-height-38px, var(--ng-spacing-40px));
|
|
102
|
+
width: var(--nile-width-38px, var(--ng-spacing-40px));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Collapsed NxtGen: the 12px side padding left the icon 2px right of the 40px item's centre (x=38 in a 72px rail). Zero it: the icon box then spans the item and centres its glyph at x=36, with the clipped label starting after it. Enterprise keeps its own padding. */
|
|
106
|
+
:host([collapsed]) .item-link {
|
|
107
|
+
padding-left: var(--nile-spacing-md, var(--ng-spacing-none));
|
|
108
|
+
padding-right: var(--nile-spacing-md, var(--ng-spacing-none));
|
|
64
109
|
}
|
|
65
110
|
|
|
66
111
|
:host([disabled]) .item-link {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-side-bar-group-item.css.js","sourceRoot":"","sources":["../../../src/nile-side-bar-group-item/nile-side-bar-group-item.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"nile-side-bar-group-item.css.js","sourceRoot":"","sources":["../../../src/nile-side-bar-group-item/nile-side-bar-group-item.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyGxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * SideBarGroupItem CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n /* NxtGen: a 40px item with 2px block padding so the row inside is 36px; enterprise keeps 208 x 38. */\n .group-item {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n height: var(--nile-height-38px, var(--ng-spacing-40px));\n width: 100%;\n padding-top: var(--nile-spacing-none, var(--ng-spacing-xxs));\n padding-bottom: var(--nile-spacing-none, var(--ng-spacing-xxs));\n overflow: hidden;\n }\n\n .item-link {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n width: 100%;\n padding-top: var(--nile-spacing-lg, var(--ng-spacing-md));\n padding-bottom: var(--nile-spacing-lg, var(--ng-spacing-md));\n padding-left: var(--nile-spacing-md, var(--ng-spacing-lg));\n padding-right: var(--nile-spacing-md, var(--ng-spacing-lg));\n cursor: pointer;\n color: var(--nile-colors-dark-900, var(--ng-colors-graylightmode-900));\n text-decoration: none;\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n line-height: 1.4;\n box-sizing: border-box;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n /* The same 8px radius in every state (rest, hover, selected, focus ring), not only once hovered or selected. */\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n }\n\n /* Default: text-secondary-700; the icon is fg-quaternary-400 (set on the nile-icon by nile-side-bar-group-item-icon). */\n ::slotted(nile-side-bar-group-item-text) {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n }\n\n .item-link:hover {\n background: var(--nile-colors-neutral-400, var(--ng-colors-bg-secondary-subtle));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n }\n\n /* Hover: text-tertiary-hover label and fg-tertiary-hover icon. A selected item keeps its selected colours, so it is excluded from the icon rule. */\n .item-link:hover ::slotted(nile-side-bar-group-item-text) {\n color: var(--nile-colors-dark-800, var(--ng-colors-text-tertiary-hover));\n }\n\n :host(:not([active])) .item-link:hover ::slotted(nile-side-bar-group-item-icon) {\n color: var(--nile-colors-dark-900, var(--ng-colors-fg-tertiary-hover));\n }\n\n /* The icon is drawn in its own colour: fg-quaternary-400 by default, recoloured by the hover and selected rules above and below. */\n ::slotted(nile-side-bar-group-item-icon) {\n flex-shrink: 0;\n color: var(--nile-colors-dark-900, var(--ng-colors-fg-quaternary-400));\n }\n\n ::slotted(nile-side-bar-group-item-text) {\n flex-grow: 1;\n }\n\n /* Every selected item shows the same background/text/icon regardless of hover/focus state. */\n :host([active]) [part=\"link\"] {\n background: var(--nile-colors-primary-100, var(--ng-colors-bg-primary));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n }\n\n :host([active]) ::slotted(nile-side-bar-group-item-text) {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-brand-secondary-700));\n }\n\n :host([active]) ::slotted(nile-side-bar-group-item-icon) {\n color: var(--ng-colors-fg-brand-primary-600);\n }\n\n /* Focus-visible adds only the ring, independent of selection -- a safe no-op on enterprise. */\n .item-link:focus-visible {\n outline: none;\n box-shadow: inset 0 0 0 var(--ng-border-width-2) var(--ng-colors-effects-focus-ring);\n }\n\n /* Collapsed: 40 x 40 (38 x 38 on enterprise), clipped. */\n :host([collapsed]) .group-item {\n height: var(--nile-height-38px, var(--ng-spacing-40px));\n width: var(--nile-width-38px, var(--ng-spacing-40px));\n }\n\n /* Collapsed NxtGen: the 12px side padding left the icon 2px right of the 40px item's centre (x=38 in a 72px rail). Zero it: the icon box then spans the item and centres its glyph at x=36, with the clipped label starting after it. Enterprise keeps its own padding. */\n :host([collapsed]) .item-link {\n padding-left: var(--nile-spacing-md, var(--ng-spacing-none));\n padding-right: var(--nile-spacing-md, var(--ng-spacing-none));\n }\n\n :host([disabled]) .item-link {\n opacity: 0.5;\n pointer-events: none;\n cursor: not-allowed;\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -5,7 +5,8 @@ export const styles = css `
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: center;
|
|
7
7
|
flex-shrink: 0;
|
|
8
|
-
|
|
8
|
+
/* 8px to the label on NxtGen; enterprise keeps 12px. */
|
|
9
|
+
margin-right: var(--nile-spacing-lg, var(--ng-spacing-md));
|
|
9
10
|
color: inherit;
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -17,9 +18,17 @@ export const styles = css `
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
/* NxtGen keeps the icon's x when the bar collapses; enterprise centers it in the rail item. */
|
|
20
22
|
:host([collapsed]) {
|
|
21
|
-
margin-right:
|
|
23
|
+
margin-right: var(--nile-spacing-none, var(--ng-spacing-md));
|
|
22
24
|
width: 100%;
|
|
25
|
+
min-width: var(--nile-spacing-none, var(--ng-height-20px));
|
|
26
|
+
justify-content: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([collapsed]) nile-lite-tooltip {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
23
32
|
justify-content: center;
|
|
24
33
|
}
|
|
25
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-side-bar-group-item-icon.css.js","sourceRoot":"","sources":["../../../src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"nile-side-bar-group-item-icon.css.js","sourceRoot":"","sources":["../../../src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n /* 8px to the label on NxtGen; enterprise keeps 12px. */\n margin-right: var(--nile-spacing-lg, var(--ng-spacing-md));\n color: inherit;\n }\n\n ::slotted(nile-icon) {\n width: 100%;\n height: 100%;\n color: inherit;\n fill: currentColor;\n }\n\n \n /* NxtGen keeps the icon's x when the bar collapses; enterprise centers it in the rail item. */\n :host([collapsed]) {\n margin-right: var(--nile-spacing-none, var(--ng-spacing-md));\n width: 100%; \n min-width: var(--nile-spacing-none, var(--ng-height-20px));\n justify-content: center;\n }\n\n :host([collapsed]) nile-lite-tooltip {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n nile-tooltip::part(body) {\n width: max-content;\n height: max-content;\n padding-top: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-bottom: var(--nile-spacing-xs, var(--ng-spacing-xs));\n padding-left: var(--nile-spacing-sm, var(--ng-spacing-sm));\n padding-right: var(--nile-spacing-sm, var(--ng-spacing-sm));\n overflow-x: hidden;\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -15,6 +15,9 @@ import NileElement from '../internal/nile-element';
|
|
|
15
15
|
* @attr tooltip - Tooltip text shown when sidebar is collapsed
|
|
16
16
|
*
|
|
17
17
|
* @slot - Optional slot to override the icon completely
|
|
18
|
+
*
|
|
19
|
+
* The icon is drawn in the host's `color`, which nile-side-bar-group-item sets: fg-quaternary-400 by
|
|
20
|
+
* default, fg-tertiary-hover on hover and text-brand-secondary-700 when selected.
|
|
18
21
|
*/
|
|
19
22
|
export declare class NileSideBarGroupItemIcon extends NileElement {
|
|
20
23
|
/**
|
|
@@ -26,13 +29,19 @@ export declare class NileSideBarGroupItemIcon extends NileElement {
|
|
|
26
29
|
*/
|
|
27
30
|
tooltip: string;
|
|
28
31
|
method: string;
|
|
32
|
+
/** Icon size: 14px on the enterprise sheet, 20px on NxtGen (the App Shell audit's menu icon), resolved by nile-icon from the theme tokens. */
|
|
29
33
|
size: string;
|
|
30
34
|
enableVisibilityEffect: boolean;
|
|
31
35
|
duration: number;
|
|
32
|
-
private sidebar;
|
|
33
36
|
static get styles(): CSSResultArray;
|
|
37
|
+
/**
|
|
38
|
+
* The container (nile-side-bar or nile-app-shell-side-nav) sets `[collapsed]` on this element, so
|
|
39
|
+
* the tooltip follows that attribute rather than finding a parent sidebar. It has to re-render
|
|
40
|
+
* when the attribute changes, and it is not a reactive property.
|
|
41
|
+
*/
|
|
42
|
+
static get observedAttributes(): string[];
|
|
43
|
+
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
34
44
|
connectedCallback(): void;
|
|
35
|
-
disconnectedCallback(): void;
|
|
36
45
|
private getSiblingText;
|
|
37
46
|
render(): TemplateResult;
|
|
38
47
|
}
|
|
@@ -18,6 +18,9 @@ import NileElement from '../internal/nile-element';
|
|
|
18
18
|
* @attr tooltip - Tooltip text shown when sidebar is collapsed
|
|
19
19
|
*
|
|
20
20
|
* @slot - Optional slot to override the icon completely
|
|
21
|
+
*
|
|
22
|
+
* The icon is drawn in the host's `color`, which nile-side-bar-group-item sets: fg-quaternary-400 by
|
|
23
|
+
* default, fg-tertiary-hover on hover and text-brand-secondary-700 when selected.
|
|
21
24
|
*/
|
|
22
25
|
let NileSideBarGroupItemIcon = class NileSideBarGroupItemIcon extends NileElement {
|
|
23
26
|
constructor() {
|
|
@@ -31,29 +34,32 @@ let NileSideBarGroupItemIcon = class NileSideBarGroupItemIcon extends NileElemen
|
|
|
31
34
|
*/
|
|
32
35
|
this.tooltip = '';
|
|
33
36
|
this.method = 'fill';
|
|
34
|
-
|
|
37
|
+
/** Icon size: 14px on the enterprise sheet, 20px on NxtGen (the App Shell audit's menu icon), resolved by nile-icon from the theme tokens. */
|
|
38
|
+
this.size = 'var(--nile-icon-size-14, var(--ng-height-20px))';
|
|
35
39
|
this.enableVisibilityEffect = false;
|
|
36
40
|
this.duration = 200;
|
|
37
|
-
this.sidebar = null;
|
|
38
41
|
}
|
|
39
42
|
static get styles() {
|
|
40
43
|
return [styles];
|
|
41
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The container (nile-side-bar or nile-app-shell-side-nav) sets `[collapsed]` on this element, so
|
|
47
|
+
* the tooltip follows that attribute rather than finding a parent sidebar. It has to re-render
|
|
48
|
+
* when the attribute changes, and it is not a reactive property.
|
|
49
|
+
*/
|
|
50
|
+
static get observedAttributes() {
|
|
51
|
+
return [...super.observedAttributes, 'collapsed'];
|
|
52
|
+
}
|
|
53
|
+
attributeChangedCallback(name, old, value) {
|
|
54
|
+
super.attributeChangedCallback(name, old, value);
|
|
55
|
+
if (name === 'collapsed')
|
|
56
|
+
this.requestUpdate();
|
|
57
|
+
}
|
|
42
58
|
connectedCallback() {
|
|
43
59
|
if (!this.hasAttribute('slot')) {
|
|
44
60
|
this.setAttribute('slot', 'icon');
|
|
45
61
|
}
|
|
46
62
|
super.connectedCallback();
|
|
47
|
-
this.sidebar = this.closest('nile-side-bar');
|
|
48
|
-
if (this.sidebar) {
|
|
49
|
-
const observer = new MutationObserver(() => this.requestUpdate());
|
|
50
|
-
observer.observe(this.sidebar, { attributes: true, attributeFilter: ['collapsed'] });
|
|
51
|
-
this._observer = observer;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
disconnectedCallback() {
|
|
55
|
-
super.disconnectedCallback();
|
|
56
|
-
this._observer?.disconnect();
|
|
57
63
|
}
|
|
58
64
|
getSiblingText() {
|
|
59
65
|
const parent = this.parentElement;
|
|
@@ -61,14 +67,14 @@ let NileSideBarGroupItemIcon = class NileSideBarGroupItemIcon extends NileElemen
|
|
|
61
67
|
return textEl?.textContent?.trim() ?? '';
|
|
62
68
|
}
|
|
63
69
|
render() {
|
|
64
|
-
const isCollapsed =
|
|
70
|
+
const isCollapsed = this.hasAttribute('collapsed');
|
|
65
71
|
const text = this.tooltip || this.getSiblingText();
|
|
66
72
|
if (isCollapsed && text) {
|
|
67
73
|
return html `
|
|
68
74
|
|
|
69
75
|
<slot>
|
|
70
76
|
<nile-lite-tooltip hoist distance="18" content=${text} placement="right" enableVisibilityEffect=${this.enableVisibilityEffect} duration=${this.duration}>
|
|
71
|
-
${this.icon ? html `<nile-icon size=${this.size} color="
|
|
77
|
+
${this.icon ? html `<nile-icon size=${this.size} color="currentColor" name=${this.icon} method=${this.method}></nile-icon>` : null}
|
|
72
78
|
</nile-lite-tooltip>
|
|
73
79
|
</slot>
|
|
74
80
|
|
|
@@ -76,7 +82,7 @@ let NileSideBarGroupItemIcon = class NileSideBarGroupItemIcon extends NileElemen
|
|
|
76
82
|
}
|
|
77
83
|
return html `
|
|
78
84
|
<slot>
|
|
79
|
-
${this.icon ? html `<nile-icon size=${this.size} color="
|
|
85
|
+
${this.icon ? html `<nile-icon size=${this.size} color="currentColor" name=${this.icon} method=${this.method}></nile-icon>` : null}
|
|
80
86
|
</slot>
|
|
81
87
|
`;
|
|
82
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-side-bar-group-item-icon.js","sourceRoot":"","sources":["../../../src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,WAAW,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"nile-side-bar-group-item-icon.js","sourceRoot":"","sources":["../../../src/nile-side-bar-group-item-icon/nile-side-bar-group-item-icon.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-side-bar-group-item-icon.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile side-bar-group-item-icon component.\n *\n * @tag nile-side-bar-group-item-icon\n *\n * @attr icon - The name of the icon to render inside <nile-icon>\n * @attr tooltip - Tooltip text shown when sidebar is collapsed\n *\n * @slot - Optional slot to override the icon completely\n *\n * The icon is drawn in the host's `color`, which nile-side-bar-group-item sets: fg-quaternary-400 by\n * default, fg-tertiary-hover on hover and text-brand-secondary-700 when selected.\n */\n@customElement('nile-side-bar-group-item-icon')\nexport class NileSideBarGroupItemIcon extends NileElement {\n /**\n * Name of the icon (passed to <nile-icon name=\"\">)\n */\n @property({ type: String, reflect: true })\n icon: string = '';\n\n /**\n * Tooltip text (auto-synced from sibling text if available)\n */\n @property({ type: String })\n tooltip: string = '';\n\n @property({ type: String })\n method: string = 'fill';\n\n /** Icon size: 14px on the enterprise sheet, 20px on NxtGen (the App Shell audit's menu icon), resolved by nile-icon from the theme tokens. */\n @property({ type: String })\n size: string = 'var(--nile-icon-size-14, var(--ng-height-20px))';\n\n @property ({type: Boolean, attribute: true, reflect: true}) enableVisibilityEffect: boolean = false;\n\n @property ({type: Number, attribute: true, reflect: true}) duration: number = 200;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /**\n * The container (nile-side-bar or nile-app-shell-side-nav) sets `[collapsed]` on this element, so\n * the tooltip follows that attribute rather than finding a parent sidebar. It has to re-render\n * when the attribute changes, and it is not a reactive property.\n */\n static get observedAttributes(): string[] {\n return [...super.observedAttributes, 'collapsed'];\n }\n\n attributeChangedCallback(name: string, old: string | null, value: string | null): void {\n super.attributeChangedCallback(name, old, value);\n if (name === 'collapsed') this.requestUpdate();\n }\n\n connectedCallback(): void {\n\tif (!this.hasAttribute('slot')) {\n\t\tthis.setAttribute('slot', 'icon');\n\t }\n super.connectedCallback();\n }\n\n private getSiblingText(): string {\n const parent = this.parentElement;\n const textEl = parent?.querySelector('nile-side-bar-group-item-text');\n return textEl?.textContent?.trim() ?? '';\n }\n\n public render(): TemplateResult {\n const isCollapsed = this.hasAttribute('collapsed');\n const text = this.tooltip || this.getSiblingText();\n\n if (isCollapsed && text) {\n return html`\n\n <slot>\n <nile-lite-tooltip hoist distance=\"18\" content=${text} placement=\"right\" enableVisibilityEffect=${this.enableVisibilityEffect} duration=${this.duration}>\n ${this.icon ? html`<nile-icon size=${this.size} color=\"currentColor\" name=${this.icon} method=${this.method}></nile-icon>` : null}\n </nile-lite-tooltip>\n </slot>\n\n `;\n }\n\n return html`\n <slot>\n ${this.icon ? html`<nile-icon size=${this.size} color=\"currentColor\" name=${this.icon} method=${this.method}></nile-icon>` : null}\n </slot>\n `;\n }\n}\n\nexport default NileSideBarGroupItemIcon;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-side-bar-group-item-icon': NileSideBarGroupItemIcon;\n }\n}\n"]}
|
|
@@ -7,9 +7,10 @@ export const styles = css `
|
|
|
7
7
|
display: block;
|
|
8
8
|
flex: 1 1 auto;
|
|
9
9
|
min-width: 0;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/* NxtGen: Text sm/Semibold, 14/20; enterprise is unchanged. */
|
|
11
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
12
|
+
line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));
|
|
13
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-semibold));
|
|
13
14
|
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
14
15
|
color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));
|
|
15
16
|
white-space: nowrap;
|
|
@@ -21,8 +22,10 @@ export const styles = css `
|
|
|
21
22
|
font: inherit;
|
|
22
23
|
color: inherit;
|
|
23
24
|
}
|
|
25
|
+
/* Enterprise hides the label in the rail. NxtGen keeps it laid out at full width and lets the 40px item clip it, as the Figma rail does. */
|
|
24
26
|
:host([collapsed]) {
|
|
25
|
-
display: none;
|
|
27
|
+
display: var(--nile-display-none, block);
|
|
28
|
+
flex: 0 0 auto;
|
|
26
29
|
}
|
|
27
30
|
`;
|
|
28
31
|
export default [styles];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-side-bar-group-item-text.css.js","sourceRoot":"","sources":["../../../src/nile-side-bar-group-item-text/nile-side-bar-group-item-text.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"nile-side-bar-group-item-text.css.js","sourceRoot":"","sources":["../../../src/nile-side-bar-group-item-text/nile-side-bar-group-item-text.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["import { css } from 'lit';\n\n/**\n * SideBarGroupItemText CSS\n */\nexport const styles = css`\n :host {\n display: block;\n flex: 1 1 auto; \n min-width: 0; \n /* NxtGen: Text sm/Semibold, 14/20; enterprise is unchanged. */\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-semibold));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n ::slotted(*) {\n font: inherit;\n color: inherit;\n }\n /* Enterprise hides the label in the rail. NxtGen keeps it laid out at full width and lets the 40px item clip it, as the Figma rail does. */\n :host([collapsed]) {\n display: var(--nile-display-none, block);\n flex: 0 0 auto;\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -6,18 +6,19 @@ import '../nile-side-bar-footer/nile-side-bar-footer';
|
|
|
6
6
|
const TRANSPARENT = 'rgba(0, 0, 0, 0)';
|
|
7
7
|
const SURFACE = 'rgb(1, 2, 3)';
|
|
8
8
|
/**
|
|
9
|
-
* nile-app-shell owns the nav track's surface, so it
|
|
10
|
-
* sidebar's own
|
|
9
|
+
* nile-app-shell owns the nav track's surface, so it sets the slotted
|
|
10
|
+
* sidebar's background to the sidebar's own bg-tertiary
|
|
11
|
+
* token:
|
|
11
12
|
*
|
|
12
13
|
* ::slotted([slot='side-nav']) {
|
|
13
|
-
* background: var(--nile-
|
|
14
|
+
* background: var(--nile-colors-neutral-100, var(--ng-colors-bg-tertiary));
|
|
14
15
|
* }
|
|
15
16
|
*
|
|
16
17
|
* That reaches the `nile-side-bar` only. The header and footer live one level
|
|
17
18
|
* deeper — they are light-DOM children of the sidebar, slotted into ITS shadow
|
|
18
|
-
* root — so the shell cannot see them
|
|
19
|
-
*
|
|
20
|
-
* `background
|
|
19
|
+
* root — so the shell cannot see them. The sidebar itself makes them paint nothing
|
|
20
|
+
* by default (`::slotted(nile-side-bar-header / -footer)`), so they show the sidebar
|
|
21
|
+
* surface with no `background` attribute. These tests pin that down.
|
|
21
22
|
*/
|
|
22
23
|
async function shellWithSidebar(headerBg, footerBg) {
|
|
23
24
|
const el = await fixture(html `
|
|
@@ -44,25 +45,29 @@ async function shellWithSidebar(headerBg, footerBg) {
|
|
|
44
45
|
}
|
|
45
46
|
const bg = (el) => getComputedStyle(el).backgroundColor;
|
|
46
47
|
describe('side-bar header/footer inside nile-app-shell', () => {
|
|
47
|
-
it('1. the shell
|
|
48
|
+
it('1. the shell gives the sidebar the sidebar surface token (the same colour as the shell behind it)', async () => {
|
|
48
49
|
const { sidebar } = await shellWithSidebar();
|
|
49
|
-
expect(bg(sidebar)).to.equal(
|
|
50
|
+
expect(bg(sidebar)).to.equal(SURFACE);
|
|
50
51
|
});
|
|
51
|
-
it('2.
|
|
52
|
-
const { header, footer } = await shellWithSidebar();
|
|
53
|
-
expect(bg(
|
|
54
|
-
expect(bg(
|
|
52
|
+
it('2. with no property the header and footer paint nothing and follow the sidebar surface, so there is no seam', async () => {
|
|
53
|
+
const { sidebar, header, footer } = await shellWithSidebar();
|
|
54
|
+
expect(bg(sidebar)).to.equal(SURFACE);
|
|
55
|
+
expect(bg(header)).to.equal(TRANSPARENT);
|
|
56
|
+
expect(bg(footer)).to.equal(TRANSPARENT);
|
|
55
57
|
});
|
|
56
58
|
it('3. background="transparent" closes the seam — nav track is one flat surface', async () => {
|
|
57
59
|
const { sidebar, header, footer } = await shellWithSidebar('transparent', 'transparent');
|
|
58
|
-
expect(bg(sidebar)).to.equal(
|
|
60
|
+
expect(bg(sidebar)).to.equal(SURFACE);
|
|
59
61
|
expect(bg(header)).to.equal(TRANSPARENT);
|
|
60
62
|
expect(bg(footer)).to.equal(TRANSPARENT);
|
|
61
63
|
});
|
|
62
|
-
it('4.
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
it('4. every header/footer background value gives the same visible surface inside the sidebar', async () => {
|
|
65
|
+
for (const [headerBg, footerBg] of [['default', 'transparent'], ['transparent', 'default'], ['transparent', 'transparent']]) {
|
|
66
|
+
const { sidebar, header, footer } = await shellWithSidebar(headerBg, footerBg);
|
|
67
|
+
expect(bg(sidebar), `${headerBg}/${footerBg}`).to.equal(SURFACE);
|
|
68
|
+
expect(bg(header), `header ${headerBg}`).to.equal(TRANSPARENT);
|
|
69
|
+
expect(bg(footer), `footer ${footerBg}`).to.equal(TRANSPARENT);
|
|
70
|
+
}
|
|
66
71
|
});
|
|
67
72
|
});
|
|
68
73
|
//# sourceMappingURL=nile-side-bar-app-shell.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-side-bar-app-shell.test.js","sourceRoot":"","sources":["../../../src/nile-side-bar-header/nile-side-bar-app-shell.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AACxC,OAAO,wBAAwB,CAAC;AAChC,OAAO,8CAA8C,CAAC;AAKtD,MAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC,MAAM,OAAO,GAAG,cAAc,CAAC;AAE/B
|
|
1
|
+
{"version":3,"file":"nile-side-bar-app-shell.test.js","sourceRoot":"","sources":["../../../src/nile-side-bar-header/nile-side-bar-app-shell.test.ts"],"names":[],"mappings":"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","sourcesContent":["import { expect, fixture, html, waitUntil } from '@open-wc/testing';\nimport '../nile-app-shell/nile-app-shell';\nimport '../nile-side-bar/nile-side-bar';\nimport './nile-side-bar-header';\nimport '../nile-side-bar-footer/nile-side-bar-footer';\nimport type { NileAppShell } from '../nile-app-shell/nile-app-shell';\nimport type { NileSideBarHeader } from './nile-side-bar-header';\nimport type { NileSideBarFooter } from '../nile-side-bar-footer/nile-side-bar-footer';\n\nconst TRANSPARENT = 'rgba(0, 0, 0, 0)';\nconst SURFACE = 'rgb(1, 2, 3)';\n\n/**\n * nile-app-shell owns the nav track's surface, so it sets the slotted\n * sidebar's background to the sidebar's own bg-tertiary\n * token:\n *\n * ::slotted([slot='side-nav']) {\n * background: var(--nile-colors-neutral-100, var(--ng-colors-bg-tertiary));\n * }\n *\n * That reaches the `nile-side-bar` only. The header and footer live one level\n * deeper — they are light-DOM children of the sidebar, slotted into ITS shadow\n * root — so the shell cannot see them. The sidebar itself makes them paint nothing\n * by default (`::slotted(nile-side-bar-header / -footer)`), so they show the sidebar\n * surface with no `background` attribute. These tests pin that down.\n */\nasync function shellWithSidebar(headerBg?: string, footerBg?: string) {\n const el = await fixture<NileAppShell>(html`\n <nile-app-shell style=\"width: 1400px; height: 600px; --nile-colors-neutral-100: ${SURFACE};\">\n <nile-side-bar slot=\"side-nav\">\n <nile-side-bar-header slot=\"header\" background=\"${headerBg ?? 'default'}\">\n <span slot=\"logo\">Logo</span>\n </nile-side-bar-header>\n <nile-side-bar-footer slot=\"footer\" background=\"${footerBg ?? 'default'}\">\n <span>Help</span>\n </nile-side-bar-footer>\n </nile-side-bar>\n <span slot=\"top-bar\">Title</span>\n <p>page</p>\n </nile-app-shell>\n `);\n await waitUntil(() => el.hasAttribute('has-side-nav'));\n\n const sidebar = el.querySelector('nile-side-bar') as HTMLElement;\n const header = el.querySelector('nile-side-bar-header') as NileSideBarHeader;\n const footer = el.querySelector('nile-side-bar-footer') as NileSideBarFooter;\n await header.updateComplete;\n await footer.updateComplete;\n return { el, sidebar, header, footer };\n}\n\nconst bg = (el: HTMLElement) => getComputedStyle(el).backgroundColor;\n\ndescribe('side-bar header/footer inside nile-app-shell', () => {\n it('1. the shell gives the sidebar the sidebar surface token (the same colour as the shell behind it)', async () => {\n const { sidebar } = await shellWithSidebar();\n expect(bg(sidebar)).to.equal(SURFACE);\n });\n\n it('2. with no property the header and footer paint nothing and follow the sidebar surface, so there is no seam', async () => {\n const { sidebar, header, footer } = await shellWithSidebar();\n expect(bg(sidebar)).to.equal(SURFACE);\n expect(bg(header)).to.equal(TRANSPARENT);\n expect(bg(footer)).to.equal(TRANSPARENT);\n });\n\n it('3. background=\"transparent\" closes the seam — nav track is one flat surface', async () => {\n const { sidebar, header, footer } = await shellWithSidebar('transparent', 'transparent');\n expect(bg(sidebar)).to.equal(SURFACE);\n expect(bg(header)).to.equal(TRANSPARENT);\n expect(bg(footer)).to.equal(TRANSPARENT);\n });\n\n it('4. every header/footer background value gives the same visible surface inside the sidebar', async () => {\n for (const [headerBg, footerBg] of [['default', 'transparent'], ['transparent', 'default'], ['transparent', 'transparent']]) {\n const { sidebar, header, footer } = await shellWithSidebar(headerBg, footerBg);\n expect(bg(sidebar), `${headerBg}/${footerBg}`).to.equal(SURFACE);\n expect(bg(header), `header ${headerBg}`).to.equal(TRANSPARENT);\n expect(bg(footer), `footer ${footerBg}`).to.equal(TRANSPARENT);\n }\n });\n});\n"]}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
|
+
import '../nile-side-bar/nile-side-bar';
|
|
4
|
+
import './nile-side-bar-header';
|
|
5
|
+
import '../nile-side-bar-footer/nile-side-bar-footer';
|
|
6
|
+
import '../nile-side-bar-group/nile-side-bar-group';
|
|
7
|
+
const TRANSPARENT = 'rgba(0, 0, 0, 0)';
|
|
8
|
+
const loadSheet = (href) => new Promise((resolveLoad, reject) => {
|
|
9
|
+
const link = document.createElement('link');
|
|
10
|
+
link.rel = 'stylesheet';
|
|
11
|
+
link.href = href;
|
|
12
|
+
link.onload = () => resolveLoad(link);
|
|
13
|
+
link.onerror = () => reject(new Error(`could not load ${href}`));
|
|
14
|
+
document.head.append(link);
|
|
15
|
+
});
|
|
16
|
+
// A token's colour as the browser resolves it, so no hex value is written in this file.
|
|
17
|
+
const resolve = (token) => {
|
|
18
|
+
const probe = document.createElement('div');
|
|
19
|
+
probe.style.backgroundColor = `var(${token})`;
|
|
20
|
+
document.body.append(probe);
|
|
21
|
+
const colour = getComputedStyle(probe).backgroundColor;
|
|
22
|
+
probe.remove();
|
|
23
|
+
return colour;
|
|
24
|
+
};
|
|
25
|
+
const mount = async ({ background, collapsed, style } = {}) => {
|
|
26
|
+
const bar = await fixture(html `
|
|
27
|
+
<nile-side-bar ?collapsed=${collapsed} style="transition: none">
|
|
28
|
+
<nile-side-bar-header background=${ifDefined(background)} style=${ifDefined(style)}>
|
|
29
|
+
<span slot="logo">Aquera</span>
|
|
30
|
+
</nile-side-bar-header>
|
|
31
|
+
<nile-side-bar-group></nile-side-bar-group>
|
|
32
|
+
<nile-side-bar-footer background=${ifDefined(background)} style=${ifDefined(style)}></nile-side-bar-footer>
|
|
33
|
+
</nile-side-bar>
|
|
34
|
+
`);
|
|
35
|
+
const header = bar.querySelector('nile-side-bar-header');
|
|
36
|
+
const footer = bar.querySelector('nile-side-bar-footer');
|
|
37
|
+
await header.updateComplete;
|
|
38
|
+
await footer.updateComplete;
|
|
39
|
+
await bar.updateComplete;
|
|
40
|
+
return { bar, header, footer };
|
|
41
|
+
};
|
|
42
|
+
const bgOf = (el) => getComputedStyle(el).backgroundColor;
|
|
43
|
+
/** The header paints nothing, so what shows through it is the sidebar's own surface. */
|
|
44
|
+
const expectOneSurface = (bar, header, surface, label) => {
|
|
45
|
+
expect(bgOf(header), `${label}: header paints nothing`).to.equal(TRANSPARENT);
|
|
46
|
+
const footer = bar.querySelector('nile-side-bar-footer');
|
|
47
|
+
expect(bgOf(footer), `${label}: footer paints nothing`).to.equal(TRANSPARENT);
|
|
48
|
+
expect(bgOf(bar), `${label}: sidebar surface`).to.equal(surface);
|
|
49
|
+
};
|
|
50
|
+
for (const theme of ['light', 'dark']) {
|
|
51
|
+
describe(`nile-side-bar-header surface (NxtGen ${theme})`, () => {
|
|
52
|
+
let sheet;
|
|
53
|
+
before(async () => {
|
|
54
|
+
sheet = await loadSheet('/demo/nxtgen-dark.css');
|
|
55
|
+
});
|
|
56
|
+
after(() => {
|
|
57
|
+
sheet.remove();
|
|
58
|
+
document.documentElement.removeAttribute('data-theme');
|
|
59
|
+
});
|
|
60
|
+
beforeEach(() => document.documentElement.setAttribute('data-theme', theme));
|
|
61
|
+
it('follows the sidebar bg-tertiary with no background attribute, expanded and collapsed', async () => {
|
|
62
|
+
for (const collapsed of [false, true]) {
|
|
63
|
+
const { bar, header } = await mount({ collapsed });
|
|
64
|
+
expectOneSurface(bar, header, resolve('--ng-colors-bg-tertiary'), collapsed ? 'collapsed' : 'expanded');
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
it('is not the old bg-primary default', async () => {
|
|
68
|
+
const { header } = await mount();
|
|
69
|
+
expect(bgOf(header)).to.not.equal(resolve('--ng-colors-bg-primary'));
|
|
70
|
+
});
|
|
71
|
+
it('reflects background="default" and still follows the sidebar', async () => {
|
|
72
|
+
const { bar, header } = await mount();
|
|
73
|
+
expect(header.getAttribute('background')).to.equal('default');
|
|
74
|
+
expectOneSurface(bar, header, resolve('--ng-colors-bg-tertiary'), 'default');
|
|
75
|
+
});
|
|
76
|
+
it('keeps background="transparent" working', async () => {
|
|
77
|
+
const { bar, header } = await mount({ background: 'transparent' });
|
|
78
|
+
expectOneSurface(bar, header, resolve('--ng-colors-bg-tertiary'), 'transparent');
|
|
79
|
+
});
|
|
80
|
+
it('lets an author rule on the header win over the sidebar default', async () => {
|
|
81
|
+
const { header, footer } = await mount({ style: 'background: rgb(9, 8, 7)' });
|
|
82
|
+
expect(bgOf(header)).to.equal('rgb(9, 8, 7)');
|
|
83
|
+
expect(bgOf(footer)).to.equal('rgb(9, 8, 7)');
|
|
84
|
+
});
|
|
85
|
+
it('a header on its own keeps painting bg-primary, and transparent still removes it', async () => {
|
|
86
|
+
const alone = await fixture(html `<nile-side-bar-header></nile-side-bar-header>`);
|
|
87
|
+
expect(bgOf(alone)).to.equal(resolve('--ng-colors-bg-primary'));
|
|
88
|
+
const bare = await fixture(html `<nile-side-bar-header background="transparent"></nile-side-bar-header>`);
|
|
89
|
+
expect(bgOf(bare)).to.equal(TRANSPARENT);
|
|
90
|
+
const footer = await fixture(html `<nile-side-bar-footer></nile-side-bar-footer>`);
|
|
91
|
+
expect(bgOf(footer), 'a footer on its own keeps bg-primary').to.equal(resolve('--ng-colors-bg-primary'));
|
|
92
|
+
const bareFooter = await fixture(html `<nile-side-bar-footer background="transparent"></nile-side-bar-footer>`);
|
|
93
|
+
expect(bgOf(bareFooter)).to.equal(TRANSPARENT);
|
|
94
|
+
});
|
|
95
|
+
it('changes no sidebar border, width or header spacing', async () => {
|
|
96
|
+
const expanded = await mount();
|
|
97
|
+
expect(getComputedStyle(expanded.bar).borderRightWidth, 'no NxtGen right border').to.equal('0px');
|
|
98
|
+
expect(expanded.bar.getBoundingClientRect().width).to.equal(260);
|
|
99
|
+
const style = getComputedStyle(expanded.header);
|
|
100
|
+
expect([style.paddingTop, style.paddingLeft, style.paddingRight, style.paddingBottom]).to.deep.equal([
|
|
101
|
+
'12px',
|
|
102
|
+
'16px',
|
|
103
|
+
'16px',
|
|
104
|
+
'16px',
|
|
105
|
+
]);
|
|
106
|
+
const collapsed = await mount({ collapsed: true });
|
|
107
|
+
expect(collapsed.bar.getBoundingClientRect().width).to.equal(72);
|
|
108
|
+
expect(getComputedStyle(collapsed.bar).borderRightWidth).to.equal('0px');
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
describe('nile-side-bar-header surface (Enterprise)', () => {
|
|
113
|
+
let sheet;
|
|
114
|
+
before(async () => {
|
|
115
|
+
sheet = await loadSheet('/demo/variables.css');
|
|
116
|
+
});
|
|
117
|
+
after(() => sheet.remove());
|
|
118
|
+
it('follows the enterprise sidebar surface (neutral-100) with no background attribute, expanded and collapsed', async () => {
|
|
119
|
+
for (const collapsed of [false, true]) {
|
|
120
|
+
const { bar, header } = await mount({ collapsed });
|
|
121
|
+
expectOneSurface(bar, header, resolve('--nile-colors-neutral-100'), collapsed ? 'collapsed' : 'expanded');
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
it('leaves the enterprise sidebar border and size as they were', async () => {
|
|
125
|
+
const { bar } = await mount();
|
|
126
|
+
expect(getComputedStyle(bar).borderRightWidth).to.equal('1px');
|
|
127
|
+
// 240px of width plus the 1px enterprise border (content-box), unchanged by the header.
|
|
128
|
+
expect(bar.getBoundingClientRect().width).to.equal(241);
|
|
129
|
+
const collapsed = await mount({ collapsed: true });
|
|
130
|
+
expect(collapsed.bar.getBoundingClientRect().width).to.equal(71);
|
|
131
|
+
});
|
|
132
|
+
it('keeps background="transparent" working', async () => {
|
|
133
|
+
const { bar, header } = await mount({ background: 'transparent' });
|
|
134
|
+
expectOneSurface(bar, header, resolve('--nile-colors-neutral-100'), 'transparent');
|
|
135
|
+
});
|
|
136
|
+
it('a header or footer on its own keeps painting neutral-100', async () => {
|
|
137
|
+
const alone = await fixture(html `<nile-side-bar-header></nile-side-bar-header>`);
|
|
138
|
+
expect(bgOf(alone)).to.equal(resolve('--nile-colors-neutral-100'));
|
|
139
|
+
const footer = await fixture(html `<nile-side-bar-footer></nile-side-bar-footer>`);
|
|
140
|
+
expect(bgOf(footer)).to.equal(resolve('--nile-colors-neutral-100'));
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=nile-side-bar-header-surface.test.js.map
|