diff --git a/bun.lockb b/bun.lockb index b37539f..ce8b05f 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/errors/ErrorBoundary.vue b/components/errors/ErrorBoundary.vue deleted file mode 100644 index dd5d512..0000000 --- a/components/errors/ErrorBoundary.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - \ No newline at end of file diff --git a/components/oauth/login.vue b/components/oauth/login.vue new file mode 100644 index 0000000..4bf775b --- /dev/null +++ b/components/oauth/login.vue @@ -0,0 +1,141 @@ + + + \ No newline at end of file diff --git a/components/social-elements/instance/Presentation.vue b/components/social-elements/instance/Presentation.vue deleted file mode 100644 index 26d951a..0000000 --- a/components/social-elements/instance/Presentation.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - \ No newline at end of file diff --git a/components/social-elements/users/Account.vue b/components/social-elements/users/Account.vue deleted file mode 100644 index b15ab9d..0000000 --- a/components/social-elements/users/Account.vue +++ /dev/null @@ -1,172 +0,0 @@ - - - \ No newline at end of file diff --git a/components/social-elements/users/AccountActionsDropdown.vue b/components/social-elements/users/AccountActionsDropdown.vue deleted file mode 100644 index acc486f..0000000 --- a/components/social-elements/users/AccountActionsDropdown.vue +++ /dev/null @@ -1,164 +0,0 @@ - - - \ No newline at end of file diff --git a/components/social-elements/users/Badge.vue b/components/social-elements/users/Badge.vue deleted file mode 100644 index a53c1a6..0000000 --- a/components/social-elements/users/Badge.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - \ No newline at end of file diff --git a/components/social-elements/users/UserCard.vue b/components/social-elements/users/UserCard.vue deleted file mode 100644 index 34c2c02..0000000 --- a/components/social-elements/users/UserCard.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - \ No newline at end of file diff --git a/components/ui/form/FormControl.vue b/components/ui/form/FormControl.vue new file mode 100644 index 0000000..39ceec8 --- /dev/null +++ b/components/ui/form/FormControl.vue @@ -0,0 +1,16 @@ + + + diff --git a/components/ui/form/FormDescription.vue b/components/ui/form/FormDescription.vue new file mode 100644 index 0000000..5bf2b09 --- /dev/null +++ b/components/ui/form/FormDescription.vue @@ -0,0 +1,20 @@ + + + diff --git a/components/ui/form/FormItem.vue b/components/ui/form/FormItem.vue new file mode 100644 index 0000000..da875ca --- /dev/null +++ b/components/ui/form/FormItem.vue @@ -0,0 +1,19 @@ + + + diff --git a/components/ui/form/FormLabel.vue b/components/ui/form/FormLabel.vue new file mode 100644 index 0000000..4da9c2c --- /dev/null +++ b/components/ui/form/FormLabel.vue @@ -0,0 +1,23 @@ + + + diff --git a/components/ui/form/FormMessage.vue b/components/ui/form/FormMessage.vue new file mode 100644 index 0000000..2377e43 --- /dev/null +++ b/components/ui/form/FormMessage.vue @@ -0,0 +1,16 @@ + + + diff --git a/components/ui/form/index.ts b/components/ui/form/index.ts new file mode 100644 index 0000000..ff08c0b --- /dev/null +++ b/components/ui/form/index.ts @@ -0,0 +1,7 @@ +export { default as FormControl } from "./FormControl.vue"; +export { default as FormDescription } from "./FormDescription.vue"; +export { default as FormItem } from "./FormItem.vue"; +export { default as FormLabel } from "./FormLabel.vue"; +export { default as FormMessage } from "./FormMessage.vue"; +export { FORM_ITEM_INJECTION_KEY } from "./injectionKeys"; +export { Field as FormField, Form } from "vee-validate"; diff --git a/components/ui/form/injectionKeys.ts b/components/ui/form/injectionKeys.ts new file mode 100644 index 0000000..bb97756 --- /dev/null +++ b/components/ui/form/injectionKeys.ts @@ -0,0 +1,3 @@ +import type { InjectionKey } from "vue"; + +export const FORM_ITEM_INJECTION_KEY = Symbol() as InjectionKey; diff --git a/components/ui/form/useFormField.ts b/components/ui/form/useFormField.ts new file mode 100644 index 0000000..fe33234 --- /dev/null +++ b/components/ui/form/useFormField.ts @@ -0,0 +1,37 @@ +import { + FieldContextKey, + useFieldError, + useIsFieldDirty, + useIsFieldTouched, + useIsFieldValid, +} from "vee-validate"; +import { inject } from "vue"; +import { FORM_ITEM_INJECTION_KEY } from "./injectionKeys"; + +export function useFormField() { + const fieldContext = inject(FieldContextKey); + const fieldItemContext = inject(FORM_ITEM_INJECTION_KEY); + + if (!fieldContext) { + throw new Error("useFormField should be used within "); + } + + const { name } = fieldContext; + const id = fieldItemContext; + + const fieldState = { + valid: useIsFieldValid(name), + isDirty: useIsFieldDirty(name), + isTouched: useIsFieldTouched(name), + error: useFieldError(name), + }; + + return { + id, + name, + formItemId: `${id}-form-item`, + formDescriptionId: `${id}-form-item-description`, + formMessageId: `${id}-form-item-message`, + ...fieldState, + }; +} diff --git a/components/ui/input/Input.vue b/components/ui/input/Input.vue index 770afee..53a87ce 100644 --- a/components/ui/input/Input.vue +++ b/components/ui/input/Input.vue @@ -19,5 +19,5 @@ const modelValue = useVModel(props, "modelValue", emits, { diff --git a/composables/AccountAcct.ts b/composables/AccountAcct.ts index da87dff..4863c21 100644 --- a/composables/AccountAcct.ts +++ b/composables/AccountAcct.ts @@ -4,14 +4,16 @@ import type { Account } from "@versia/client/types"; export const useAccountFromAcct = ( client: MaybeRef, acct: string, -): Ref => { +): { account: Ref; isLoading: Ref } => { const output = ref(null as Account | null); + const isLoading = ref(true); ref(client) .value?.lookupAccount(acct) .then((res) => { + isLoading.value = false; output.value = res.data; }); - return output; + return { account: output, isLoading }; }; diff --git a/layouts/default.vue b/layouts/default.vue index 351ed97..6bce066 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,10 +1,8 @@ \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts index 324146d..9986777 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -19,6 +19,11 @@ export default defineNuxtConfig({ components: { dirs: [], }, + tailwindcss: { + // Don't inject the default @tailwind utilities CSS + // To avoid conflicts with our own styles + cssPath: false, + }, future: { compatibilityVersion: 4, }, diff --git a/package.json b/package.json index e283541..a8b99de 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "shiki": "^1.24.0", "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", + "vee-validate": "^4.14.7", "vue": "^3.5.13", "vue-router": "^4.5.0", "vue-sonner": "^1.3.0", diff --git a/pages/[username]/index.vue b/pages/[username]/index.vue index d449de6..5e2f524 100644 --- a/pages/[username]/index.vue +++ b/pages/[username]/index.vue @@ -1,16 +1,25 @@ \ No newline at end of file diff --git a/pages/oauth/authorize.vue b/pages/oauth/authorize.vue index f424a97..dd1814d 100644 --- a/pages/oauth/authorize.vue +++ b/pages/oauth/authorize.vue @@ -1,165 +1,59 @@ + + - - \ No newline at end of file diff --git a/server/plugins/DocumentComment.ts b/server/plugins/DocumentComment.ts index 7d4f508..913c2ec 100644 --- a/server/plugins/DocumentComment.ts +++ b/server/plugins/DocumentComment.ts @@ -12,8 +12,7 @@ const art = ` * Join development at https://github.com/versia-pub * * With ❤️ from us: -* - @jessew@social.lysand.org -* - @aprl@social.lysand.org +* - @jessew@beta.versia.social `; export default defineNitroPlugin((nitroApp) => { diff --git a/styles/index.css b/styles/index.css index 5d6a199..30f61c5 100644 --- a/styles/index.css +++ b/styles/index.css @@ -1,5 +1,9 @@ @tailwind base; +@tailwind components; + +@tailwind utilities; + @layer base { :root { --background: 0 0% 100%;