diff --git a/app/javascript/dashboard/assets/scss/widgets/_base.scss b/app/javascript/dashboard/assets/scss/widgets/_base.scss index d5d2e227f..d35c1cfc9 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_base.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_base.scss @@ -31,7 +31,13 @@ hr { ul, ol, dl { - @apply mb-2 list-disc list-outside leading-[1.65]; + @apply list-disc list-outside leading-[1.65]; +} + +ul:not(.reset-base), +ol:not(.reset-base), +dl:not(.reset-base) { + @apply mb-0; } // Form elements diff --git a/app/javascript/dashboard/assets/scss/widgets/_buttons.scss b/app/javascript/dashboard/assets/scss/widgets/_buttons.scss index 587b810ca..640e1395f 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_buttons.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_buttons.scss @@ -96,7 +96,7 @@ button { } // @TODDO - Remove after moving all buttons to woot-button - .icon+.button__content { + .icon + .button__content { @apply w-auto; } diff --git a/app/javascript/dashboard/components-next/dropdown-menu/DropdownPrimitives.story.vue b/app/javascript/dashboard/components-next/dropdown-menu/DropdownPrimitives.story.vue new file mode 100644 index 000000000..c0818283e --- /dev/null +++ b/app/javascript/dashboard/components-next/dropdown-menu/DropdownPrimitives.story.vue @@ -0,0 +1,79 @@ + + + diff --git a/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownBody.vue b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownBody.vue new file mode 100644 index 000000000..4fde89306 --- /dev/null +++ b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownBody.vue @@ -0,0 +1,9 @@ + diff --git a/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownContainer.vue b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownContainer.vue new file mode 100644 index 000000000..ee81e4b98 --- /dev/null +++ b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownContainer.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownItem.vue b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownItem.vue new file mode 100644 index 000000000..92be04fda --- /dev/null +++ b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownItem.vue @@ -0,0 +1,55 @@ + + + diff --git a/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownSection.vue b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownSection.vue new file mode 100644 index 000000000..3879af0a7 --- /dev/null +++ b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownSection.vue @@ -0,0 +1,22 @@ + + + diff --git a/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownSeparator.vue b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownSeparator.vue new file mode 100644 index 000000000..373aa4479 --- /dev/null +++ b/app/javascript/dashboard/components-next/dropdown-menu/base/DropdownSeparator.vue @@ -0,0 +1,3 @@ + diff --git a/app/javascript/dashboard/components-next/dropdown-menu/base/index.js b/app/javascript/dashboard/components-next/dropdown-menu/base/index.js new file mode 100644 index 000000000..69a15a850 --- /dev/null +++ b/app/javascript/dashboard/components-next/dropdown-menu/base/index.js @@ -0,0 +1,13 @@ +import DropdownBody from './DropdownBody.vue'; +import DropdownContainer from './DropdownContainer.vue'; +import DropdownItem from './DropdownItem.vue'; +import DropdownSection from './DropdownSection.vue'; +import DropdownSeparator from './DropdownSeparator.vue'; + +export { + DropdownBody, + DropdownContainer, + DropdownItem, + DropdownSection, + DropdownSeparator, +}; diff --git a/app/javascript/dashboard/components-next/dropdown-menu/base/provider.js b/app/javascript/dashboard/components-next/dropdown-menu/base/provider.js new file mode 100644 index 000000000..67f2cbd0a --- /dev/null +++ b/app/javascript/dashboard/components-next/dropdown-menu/base/provider.js @@ -0,0 +1,19 @@ +import { inject, provide } from 'vue'; + +const DropdownControl = Symbol('DropdownControl'); + +export function useDropdownContext() { + const context = inject(DropdownControl, null); + + if (context === null) { + throw new Error( + `Component is missing a parent component.` + ); + } + + return context; +} + +export function provideDropdownContext(context) { + provide(DropdownControl, context); +} diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarAccountSwitcher.vue b/app/javascript/dashboard/components-next/sidebar/SidebarAccountSwitcher.vue index 8e99977dd..03e7a5e53 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarAccountSwitcher.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarAccountSwitcher.vue @@ -1,24 +1,23 @@ diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarProfileMenu.vue b/app/javascript/dashboard/components-next/sidebar/SidebarProfileMenu.vue index ae88ebe69..347e2e25d 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarProfileMenu.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarProfileMenu.vue @@ -4,11 +4,16 @@ import Auth from 'dashboard/api/auth'; import { useRouter } from 'vue-router'; import { useMapGetter } from 'dashboard/composables/store'; import { useI18n } from 'vue-i18n'; -import { useToggle } from '@vueuse/core'; import Avatar from 'next/avatar/Avatar.vue'; -import Icon from 'next/icon/Icon.vue'; import SidebarProfileMenuStatus from './SidebarProfileMenuStatus.vue'; +import { + DropdownContainer, + DropdownBody, + DropdownSeparator, + DropdownItem, +} from 'next/dropdown-menu/base'; + const emit = defineEmits(['close', 'openKeyShortcutModal']); defineOptions({ @@ -21,14 +26,6 @@ const router = useRouter(); const globalConfig = useMapGetter('globalConfig/get'); const currentUser = useMapGetter('getCurrentUser'); const currentUserAvailability = useMapGetter('getCurrentUserAvailability'); -const [showProfileMenu, toggleProfileMenu] = useToggle(false); - -const closeMenu = () => { - if (showProfileMenu.value) { - emit('close'); - toggleProfileMenu(false); - } -}; const menuItems = computed(() => { return [ @@ -37,7 +34,6 @@ const menuItems = computed(() => { label: t('SIDEBAR_ITEMS.CONTACT_SUPPORT'), icon: 'i-lucide-life-buoy', click: () => { - closeMenu(); window.$chatwoot.toggle(); }, }, @@ -46,7 +42,6 @@ const menuItems = computed(() => { label: t('SIDEBAR_ITEMS.KEYBOARD_SHORTCUTS'), icon: 'i-lucide-keyboard', click: () => { - closeMenu(); emit('openKeyShortcutModal'); }, }, @@ -55,20 +50,26 @@ const menuItems = computed(() => { label: t('SIDEBAR_ITEMS.PROFILE_SETTINGS'), icon: 'i-lucide-user-pen', click: () => { - closeMenu(); router.push({ name: 'profile_settings_index' }); }, }, { show: true, label: t('SIDEBAR_ITEMS.APPEARANCE'), - icon: 'i-lucide-swatch-book', + icon: 'i-lucide-palette', click: () => { - closeMenu(); const ninja = document.querySelector('ninja-keys'); ninja.open({ parent: 'appearance_settings' }); }, }, + { + show: true, + label: t('SIDEBAR_ITEMS.DOCS'), + icon: 'i-lucide-book', + click: () => { + window.open('https://www.chatwoot.com/hc/user-guide/en', '_blank'); + }, + }, { show: currentUser.value.type === 'SuperAdmin', label: t('SIDEBAR_ITEMS.SUPER_ADMIN_CONSOLE'), @@ -79,7 +80,7 @@ const menuItems = computed(() => { { show: true, label: t('SIDEBAR_ITEMS.LOGOUT'), - icon: 'i-lucide-log-out', + icon: 'i-lucide-power', click: Auth.logout, }, ]; @@ -91,56 +92,40 @@ const allowedMenuItems = computed(() => { diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarProfileMenuStatus.vue b/app/javascript/dashboard/components-next/sidebar/SidebarProfileMenuStatus.vue index 9642e4103..418319cc3 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarProfileMenuStatus.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarProfileMenuStatus.vue @@ -1,11 +1,18 @@ diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue b/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue index 8c7f5c3a7..52886ebde 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue @@ -52,7 +52,7 @@ useEventListener(scrollableContainer, 'scroll', () => { :icon class="my-1" /> -