This repository has been archived by the owner on Aug 25, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from livraison-dev/feat/command-palette
feat: add search modal and more shortcuts
- Loading branch information
Showing
32 changed files
with
753 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script setup lang="ts"> | ||
</script> | ||
|
||
<template> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" fill="none" style="user-select: none; flex-shrink: 0;"> | ||
<path fill="currentColor" fill-rule="evenodd" d="M2.25 7A2.75 2.75 0 0 1 5 4.25h14A2.75 2.75 0 0 1 21.75 7v10A2.75 2.75 0 0 1 19 19.75H5A2.75 2.75 0 0 1 2.25 17V7ZM5 5.75h5.25v12.5H5c-.69 0-1.25-.56-1.25-1.25V7c0-.69.56-1.25 1.25-1.25Zm6.75 0v12.5H19c.69 0 1.25-.56 1.25-1.25V7c0-.69-.56-1.25-1.25-1.25h-7.25ZM6 7.25a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5H6Zm-.75 3.25A.75.75 0 0 1 6 9.75h2a.75.75 0 0 1 0 1.5H6a.75.75 0 0 1-.75-.75ZM6 12.25a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5H6Z" clip-rule="evenodd" /> | ||
</svg> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup lang="ts"> | ||
defineOptions({ | ||
name: 'SidebarSearchComdGroup', | ||
}) | ||
const props = defineProps<{ | ||
title: string | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<div livraison-app="cmd-group"> | ||
<div | ||
livraison-app="cmd-group-title" | ||
class="pt-4 p-2 text-#8e8d91 dark:text-#9c9ca0 text-xs font-semibold leading-[1.67]" | ||
> | ||
{{ props.title }} | ||
</div> | ||
<div livraison-app="cmd-group-list"> | ||
<slot /> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script setup lang="ts"> | ||
</script> | ||
|
||
<template> | ||
<div livraison-app="cmd-item" class="items-center rounded cursor-default flex min-h-11 select-none px-3 py-1.5 hover:bg-#f4f4f5 dark:hover:bg-#252525 cursor-pointer"> | ||
<div livraison-app="cmd-item-icon" class="items-center text-#77757d dark:text-#a7a7a099 flex shrink-0 text-xl mr-4"> | ||
<slot name="icon" /> | ||
</div> | ||
<div livraison-app="cmd-item-label" class="text-#424149 dark:text-#eaeaea flex-1 text-sm leading-normal overflow-hidden text-ellipsis whitespace-nowrap"> | ||
<div class="font-normal text-justify text-base leading-6 flex flex-nowrap"> | ||
<span class="text-[#1c9ee4] shrink-0 overflow-visible whitespace-pre" /> | ||
<div class="overflow-hidden text-ellipsis whitespace-pre"> | ||
<slot /> | ||
</div> | ||
</div> | ||
</div> | ||
<div livraison-app="cmd-item-suffix" class="gap-x-0.5 flex text-xs"> | ||
<slot name="suffix" /> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script setup lang="ts"> | ||
const searchStore = useSearchStore() | ||
const settingsStore = useSettingsStore() | ||
function handleGoToSettings() { | ||
searchStore.toggleModal() | ||
settingsStore.toggleModalShow() | ||
} | ||
</script> | ||
|
||
<template> | ||
<SidebarSearchItem @click="handleGoToSettings"> | ||
<template #icon> | ||
<Icon name="carbon:arrow-right" class="shrink-0 select-none" /> | ||
</template> | ||
Go to Settings | ||
</SidebarSearchItem> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script setup lang="ts"> | ||
const colorMode = useColorMode() | ||
const settingColorModeList = ref<{ | ||
label: string | ||
value: string | ||
handle: () => void | ||
}[]>([ | ||
{ | ||
label: 'Change Colour Mode to System', | ||
value: 'system', | ||
handle: () => { | ||
colorMode.preference = 'system' | ||
}, | ||
}, | ||
{ | ||
label: 'Change Colour Mode to Dark', | ||
value: 'dark', | ||
handle: () => { | ||
colorMode.preference = 'dark' | ||
}, | ||
}, | ||
{ | ||
label: 'Change Colour Mode to Light', | ||
value: 'light', | ||
handle: () => { | ||
colorMode.preference = 'light' | ||
}, | ||
}, | ||
]) | ||
</script> | ||
|
||
<template> | ||
<template v-for="setting in settingColorModeList" :key="setting.label"> | ||
<SidebarSearchListSettingList | ||
v-if="setting.value !== colorMode.preference" | ||
:label="setting.label" | ||
:handle="setting.handle" | ||
/> | ||
</template> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
label: string | ||
handle: () => void | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<SidebarSearchItem @click="props.handle"> | ||
<template #icon> | ||
<Icon name="carbon:settings" class="shrink-0 select-none" /> | ||
</template> | ||
{{ props.label }} | ||
</SidebarSearchItem> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script setup lang="ts"> | ||
const searchStore = useSearchStore() | ||
const showSidebar = useSidebarStore() | ||
const { metaSymbol } = useShortcuts() | ||
function handleToggleLeftSidebar() { | ||
showSidebar.handleToggleSidebar() | ||
searchStore.toggleModal() | ||
} | ||
</script> | ||
|
||
<template> | ||
<SidebarSearchItem @click="handleToggleLeftSidebar()"> | ||
<template #icon> | ||
<GlobalLeftSidebar class="shrink-0 select-none" /> | ||
</template> | ||
{{ showSidebar.show ? 'Collapse' : 'Expand' }} Left Sidebar | ||
<template #suffix> | ||
<Kbd :label="metaSymbol" /> | ||
<Kbd label="/" /> | ||
</template> | ||
</SidebarSearchItem> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script setup lang="ts"> | ||
</script> | ||
|
||
<template> | ||
<input | ||
placeholder="Type a command or search anything..." | ||
class="text-#424149 dark:text-#eaeaea shrink-0 text-xl h-16.5 w-full px-6 py-[21px] border-b-#e3e2e4 dark:border-b-#2e2e2e border-b border-solid bg-transparent caret-[#1c9ee4] rounded-none border-[none]" | ||
> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script setup lang="ts"> | ||
defineOptions({ | ||
name: 'SidebarSearchModalLabel', | ||
}) | ||
</script> | ||
|
||
<template> | ||
<label class="cursor-default absolute w-px h-px overflow-hidden whitespace-nowrap -m-px p-0 border-0" style="clip: rect(0px, 0px, 0px, 0px)" /> | ||
</template> |
Oops, something went wrong.