From 9ca0bba5264b09ae239867720b18226d60b94b4c Mon Sep 17 00:00:00 2001 From: Marco Crapts Date: Fri, 26 May 2023 00:50:19 +0200 Subject: [PATCH] refactor to UI components --- components.d.ts | 4 ++++ src/components/Note/Autocomplete.vue | 17 +++++--------- src/components/Note/NoteReferences.vue | 32 +++++++++++--------------- src/components/Search/SearchBar.vue | 6 ++--- src/components/Search/SearchResult.vue | 28 +++++++++------------- src/components/TopBar.vue | 6 ++--- src/components/TopBar/Settings.vue | 2 +- src/components/ViewModes/ListView.vue | 4 ++-- src/components/ui/UIAlert.vue | 4 ++-- src/components/ui/UIBadge.vue | 31 +++++++++++++++++++++++++ src/components/ui/UIButton.vue | 29 +++++++++++++++-------- src/components/ui/UIButtonGroup.vue | 2 +- src/components/ui/UIDropdown.vue | 4 ++-- src/components/ui/UIDropdownItem.vue | 2 +- src/components/ui/UIMenu.vue | 16 +++++++++++++ src/components/ui/UIMenuItem.vue | 28 ++++++++++++++++++++++ src/components/ui/UIModal.vue | 6 ++--- src/components/ui/UITable.vue | 4 ++-- src/components/ui/UITextInput.vue | 12 +++++++--- tailwind.config.ts | 1 + 20 files changed, 160 insertions(+), 78 deletions(-) create mode 100644 src/components/ui/UIBadge.vue create mode 100644 src/components/ui/UIMenu.vue create mode 100644 src/components/ui/UIMenuItem.vue diff --git a/components.d.ts b/components.d.ts index 650dd6c..1d2df31 100644 --- a/components.d.ts +++ b/components.d.ts @@ -31,10 +31,14 @@ declare module '@vue/runtime-core' { Spinner: typeof import('./src/components/Spinner.vue')['default'] TopBar: typeof import('./src/components/TopBar.vue')['default'] UIAlert: typeof import('./src/components/ui/UIAlert.vue')['default'] + UIBadge: typeof import('./src/components/ui/UIBadge.vue')['default'] UIButton: typeof import('./src/components/ui/UIButton.vue')['default'] UIButtonGroup: typeof import('./src/components/ui/UIButtonGroup.vue')['default'] + UICard: typeof import('./src/components/ui/UICard.vue')['default'] UIDropdown: typeof import('./src/components/ui/UIDropdown.vue')['default'] UIDropdownItem: typeof import('./src/components/ui/UIDropdownItem.vue')['default'] + UIMenu: typeof import('./src/components/ui/UIMenu.vue')['default'] + UIMenuItem: typeof import('./src/components/ui/UIMenuItem.vue')['default'] UIModal: typeof import('./src/components/ui/UIModal.vue')['default'] UITable: typeof import('./src/components/ui/UITable.vue')['default'] UITextInput: typeof import('./src/components/ui/UITextInput.vue')['default'] diff --git a/src/components/Note/Autocomplete.vue b/src/components/Note/Autocomplete.vue index c6f78c2..3ca4b61 100644 --- a/src/components/Note/Autocomplete.vue +++ b/src/components/Note/Autocomplete.vue @@ -45,16 +45,11 @@ const handleKeypress = (event: { [key: string]: number }) => { defineExpose({ handleKeypress }) diff --git a/src/components/Note/NoteReferences.vue b/src/components/Note/NoteReferences.vue index 11e2853..c6b65c3 100644 --- a/src/components/Note/NoteReferences.vue +++ b/src/components/Note/NoteReferences.vue @@ -5,22 +5,18 @@ const props = defineProps<{ }>() diff --git a/src/components/Search/SearchBar.vue b/src/components/Search/SearchBar.vue index 8ab1806..7f995c4 100644 --- a/src/components/Search/SearchBar.vue +++ b/src/components/Search/SearchBar.vue @@ -66,7 +66,7 @@ const resultsRefs = ref[]>([]) @keydown="handleKeydown" />
- +
diff --git a/src/components/Search/SearchResult.vue b/src/components/Search/SearchResult.vue index 5ef8e75..3d37ad4 100644 --- a/src/components/Search/SearchResult.vue +++ b/src/components/Search/SearchResult.vue @@ -14,21 +14,15 @@ const emit = defineEmits<{ const element = ref(null) diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index 0044ae3..540557c 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -41,7 +41,7 @@ const authModalInitialStateOpen = ref(authUI.isPendingRedirect()) @@ -51,7 +51,7 @@ const authModalInitialStateOpen = ref(authUI.isPendingRedirect()) Sign in @@ -79,7 +79,7 @@ const authModalInitialStateOpen = ref(authUI.isPendingRedirect()) #logo:hover { text-shadow: 0 0 5px white, 0 0 10px white, 0 0 15px white; } -.btn-outline { +.topbar-button { @apply hover:border-white hover:bg-white hover:text-primary focus-visible:outline-white; } diff --git a/src/components/TopBar/Settings.vue b/src/components/TopBar/Settings.vue index 93c950f..c82051f 100644 --- a/src/components/TopBar/Settings.vue +++ b/src/components/TopBar/Settings.vue @@ -26,7 +26,7 @@ const handleClick = (fn: (...args: any[]) => any) => { diff --git a/src/components/ViewModes/ListView.vue b/src/components/ViewModes/ListView.vue index ee1b44c..384905c 100644 --- a/src/components/ViewModes/ListView.vue +++ b/src/components/ViewModes/ListView.vue @@ -93,10 +93,10 @@ const deleteSelectedNotes = (closeModal: () => void) => { {{ note.wordCount }} -
+ {{ note.references.length }} -
+ {{ formatDate(note.modified) }} diff --git a/src/components/ui/UIAlert.vue b/src/components/ui/UIAlert.vue index bfeec4e..9fefa37 100644 --- a/src/components/ui/UIAlert.vue +++ b/src/components/ui/UIAlert.vue @@ -7,12 +7,12 @@ const props = withDefaults(defineProps(), { }) const styleClass = computed(() => { - const colorClass = `alert-${props.color}` + const colorClass = `dui-alert-${props.color}` return [colorClass] }) diff --git a/src/components/ui/UIBadge.vue b/src/components/ui/UIBadge.vue new file mode 100644 index 0000000..16b9d5b --- /dev/null +++ b/src/components/ui/UIBadge.vue @@ -0,0 +1,31 @@ + + diff --git a/src/components/ui/UIButton.vue b/src/components/ui/UIButton.vue index c2f061c..038a360 100644 --- a/src/components/ui/UIButton.vue +++ b/src/components/ui/UIButton.vue @@ -1,8 +1,8 @@ diff --git a/src/components/ui/UIButtonGroup.vue b/src/components/ui/UIButtonGroup.vue index 9114c46..d25f396 100644 --- a/src/components/ui/UIButtonGroup.vue +++ b/src/components/ui/UIButtonGroup.vue @@ -1,3 +1,3 @@ diff --git a/src/components/ui/UIDropdown.vue b/src/components/ui/UIDropdown.vue index 4108b5f..4b035c4 100644 --- a/src/components/ui/UIDropdown.vue +++ b/src/components/ui/UIDropdown.vue @@ -1,9 +1,9 @@ diff --git a/tailwind.config.ts b/tailwind.config.ts index 564e585..6e8b046 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -31,6 +31,7 @@ export default { }, plugins: [require('daisyui')], daisyui: { + prefix: 'dui-', themes: [ { contexted: {