diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0b75758..8b6d78d 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,31 +1,31 @@ /** @type { import("eslint").Linter.Config } */ module.exports = { - root: true, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:svelte/recommended', - 'prettier' - ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] - }, - env: { - browser: true, - es2017: true, - node: true - }, - overrides: [ - { - files: ['*.svelte'], - parser: 'svelte-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser' - } - } - ] + root: true, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:svelte/recommended', + 'prettier' + ], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + parserOptions: { + sourceType: 'module', + ecmaVersion: 2020, + extraFileExtensions: ['.svelte'] + }, + env: { + browser: true, + es2017: true, + node: true + }, + overrides: [ + { + files: ['*.svelte'], + parser: 'svelte-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser' + } + } + ] }; diff --git a/.prettierrc b/.prettierrc index d173948..3f3b530 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,10 +3,7 @@ "singleQuote": true, "trailingComma": "none", "printWidth": 100, - "plugins": [ - "prettier-plugin-svelte", - "prettier-plugin-tailwindcss" - ], + "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], "overrides": [ { "files": "*.svelte", @@ -15,4 +12,4 @@ } } ] -} \ No newline at end of file +} diff --git a/components.json b/components.json index dd16676..d5ec7e1 100644 --- a/components.json +++ b/components.json @@ -1,14 +1,14 @@ { - "$schema": "https://shadcn-svelte.com/schema.json", - "style": "default", - "tailwind": { - "config": "tailwind.config.ts", - "css": "src\\app.css", - "baseColor": "slate" - }, - "aliases": { - "components": "$lib/components", - "utils": "$lib/utils" - }, - "typescript": true -} \ No newline at end of file + "$schema": "https://shadcn-svelte.com/schema.json", + "style": "default", + "tailwind": { + "config": "tailwind.config.ts", + "css": "src\\app.css", + "baseColor": "slate" + }, + "aliases": { + "components": "$lib/components", + "utils": "$lib/utils" + }, + "typescript": true +} diff --git a/package.json b/package.json index 9c2defb..72fa159 100644 --- a/package.json +++ b/package.json @@ -1,51 +1,51 @@ { - "name": "nir-messenger", - "version": "0.0.1", - "private": true, - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "prettier --check . && eslint .", - "format": "prettier --write ." - }, - "devDependencies": { - "@sveltejs/adapter-auto": "^3.0.0", - "@sveltejs/kit": "^2.0.0", - "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/eslint": "^8.56.0", - "@typescript-eslint/eslint-plugin": "^7.0.0", - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.35.1", - "prettier": "^3.1.1", - "prettier-plugin-svelte": "^3.1.2", - "svelte": "^4.2.7", - "svelte-check": "^3.6.0", - "tslib": "^2.4.1", - "typescript": "^5.0.0", - "vite": "^5.0.3", - "tailwindcss": "^3.4.1", - "postcss": "^8.4.33", - "autoprefixer": "^10.4.16", - "prettier-plugin-tailwindcss": "^0.5.1" - }, - "type": "module", - "dependencies": { - "axios": "^1.6.8", - "bits-ui": "^0.21.7", - "clsx": "^2.1.1", - "formsnap": "^1.0.0", - "lucide-svelte": "^0.378.0", - "mode-watcher": "^0.3.0", - "svelte-persisted-store": "^0.9.2", - "svelte-sonner": "^0.3.24", - "sveltekit-superforms": "^2.13.1", - "tailwind-merge": "^2.3.0", - "tailwind-variants": "^0.2.1", - "zod": "^3.23.8" - } + "name": "nir-messenger", + "version": "0.0.1", + "private": true, + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --check . && eslint .", + "format": "prettier --write ." + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^3.0.0", + "@types/eslint": "^8.56.0", + "@typescript-eslint/eslint-plugin": "^7.0.0", + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.35.1", + "prettier": "^3.1.1", + "prettier-plugin-svelte": "^3.1.2", + "svelte": "^4.2.7", + "svelte-check": "^3.6.0", + "tslib": "^2.4.1", + "typescript": "^5.0.0", + "vite": "^5.0.3", + "tailwindcss": "^3.4.1", + "postcss": "^8.4.33", + "autoprefixer": "^10.4.16", + "prettier-plugin-tailwindcss": "^0.5.1" + }, + "type": "module", + "dependencies": { + "axios": "^1.6.8", + "bits-ui": "^0.21.7", + "clsx": "^2.1.1", + "formsnap": "^1.0.0", + "lucide-svelte": "^0.378.0", + "mode-watcher": "^0.3.0", + "svelte-persisted-store": "^0.9.2", + "svelte-sonner": "^0.3.24", + "sveltekit-superforms": "^2.13.1", + "tailwind-merge": "^2.3.0", + "tailwind-variants": "^0.2.1", + "zod": "^3.23.8" + } } diff --git a/postcss.config.js b/postcss.config.js index 0f77216..badd100 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ export default { - plugins: { - tailwindcss: {}, - autoprefixer: {} - } + plugins: { + tailwindcss: {}, + autoprefixer: {} + } }; diff --git a/src/app.css b/src/app.css index 6ff7062..f56c42d 100644 --- a/src/app.css +++ b/src/app.css @@ -1,78 +1,59 @@ @tailwind base; @tailwind components; @tailwind utilities; - + @layer base { - :root { - --background: 0 0% 100%; - --foreground: 222.2 84% 4.9%; - - --muted: 210 40% 96.1%; - --muted-foreground: 215.4 16.3% 46.9%; - - --popover: 0 0% 100%; - --popover-foreground: 222.2 84% 4.9%; - - --card: 0 0% 100%; - --card-foreground: 222.2 84% 4.9%; - - --border: 214.3 31.8% 91.4%; - --input: 214.3 31.8% 91.4%; - - --primary: 222.2 47.4% 11.2%; - --primary-foreground: 210 40% 98%; - - --secondary: 210 40% 96.1%; - --secondary-foreground: 222.2 47.4% 11.2%; - - --accent: 210 40% 96.1%; - --accent-foreground: 222.2 47.4% 11.2%; - - --destructive: 0 72.2% 50.6%; - --destructive-foreground: 210 40% 98%; - - --ring: 222.2 84% 4.9%; - - --radius: 0.5rem; - } - - .dark { - --background: 222.2 84% 4.9%; - --foreground: 210 40% 98%; - - --muted: 217.2 32.6% 17.5%; - --muted-foreground: 215 20.2% 65.1%; - - --popover: 222.2 84% 4.9%; - --popover-foreground: 210 40% 98%; - - --card: 222.2 84% 4.9%; - --card-foreground: 210 40% 98%; - - --border: 217.2 32.6% 17.5%; - --input: 217.2 32.6% 17.5%; - - --primary: 210 40% 98%; - --primary-foreground: 222.2 47.4% 11.2%; - - --secondary: 217.2 32.6% 17.5%; - --secondary-foreground: 210 40% 98%; - - --accent: 217.2 32.6% 17.5%; - --accent-foreground: 210 40% 98%; - - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 210 40% 98%; - - --ring: hsl(212.7,26.8%,83.9); - } + :root { + --background: 253 44% 98%; + --foreground: 253 58% 0%; + --muted: 253 7% 87%; + --muted-foreground: 253 13% 37%; + --popover: 253 44% 98%; + --popover-foreground: 253 58% 0%; + --card: 253 44% 97%; + --card-foreground: 0 0% 0%; + --border: 220 13% 91%; + --input: 220 13% 91%; + --primary: 253 91% 58%; + --primary-foreground: 253 91% 98%; + --secondary: 253 5% 89%; + --secondary-foreground: 253 5% 29%; + --accent: 253 12% 82%; + --accent-foreground: 253 12% 22%; + --destructive: 339.2 90.36% 51.18%; + --destructive-foreground: 0 0% 100%; + --ring: 253 91% 58%; + --radius: 0.5rem; + } + + .dark { + --background: 253 43% 3%; + --foreground: 253 31% 98%; + --muted: 253 7% 13%; + --muted-foreground: 253 13% 63%; + --popover: 253 43% 3%; + --popover-foreground: 253 31% 98%; + --card: 253 43% 4%; + --card-foreground: 253 31% 99%; + --border: 215 27.9% 16.9%; + --input: 215 27.9% 16.9%; + --primary: 253 91% 58%; + --primary-foreground: 253 91% 98%; + --secondary: 253 7% 9%; + --secondary-foreground: 253 7% 69%; + --accent: 253 13% 14%; + --accent-foreground: 253 13% 74%; + --destructive: 339.2 90.36% 51.18%; + --destructive-foreground: 0 0% 100%; + --ring: 253 91% 58%; + } } - + @layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - } -} \ No newline at end of file + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + } +} diff --git a/src/app.d.ts b/src/app.d.ts index d1b0cb7..c7c0ed1 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -10,4 +10,4 @@ declare global { } } -export { }; +export {}; diff --git a/src/app.html b/src/app.html index 257c68a..75766da 100644 --- a/src/app.html +++ b/src/app.html @@ -1,28 +1,24 @@ - + + + + + %sveltekit.head% + - + - - - - %sveltekit.head% - - - - - -
%sveltekit.body%
- - - \ No newline at end of file + +
%sveltekit.body%
+ + diff --git a/src/hooks.server.ts b/src/hooks.server.ts index f994583..cecc8a8 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,6 +1,6 @@ -import type { Handle } from "@sveltejs/kit"; +import type { Handle } from '@sveltejs/kit'; export const handle: Handle = async ({ event, resolve }) => { - const response = await resolve(event); - return response; -}; \ No newline at end of file + const response = await resolve(event); + return response; +}; diff --git a/src/lib/api/channel.ts b/src/lib/api/channel.ts index bdf7a6a..5ff6691 100644 --- a/src/lib/api/channel.ts +++ b/src/lib/api/channel.ts @@ -1,20 +1,31 @@ +import { messagesCache, channelsCache } from '$lib/stores/cache'; import type { Channel, Message } from '../types'; import { apiRequest } from './utils'; export async function getAllChannels() { - return await apiRequest('/channel', 'get'); + return await apiRequest('/channel', 'get', undefined, (data) => { + data.forEach((channel) => { + channelsCache.set(channel.id, channel); + }); + }); } export async function getChannelById(channelId: number) { - return await apiRequest(`/channel/${channelId}`, 'get'); + return await apiRequest(`/channel/${channelId}`, 'get', undefined, (data) => { + channelsCache.set(data.id, data); + }); } export async function createChannel(name: string) { - return await apiRequest('/channel', 'post', { data: { name } }); + return await apiRequest('/channel', 'post', { data: { name } }, (data) => { + channelsCache.set(data.id, data); + }); } export async function deleteChannel(channelId: number) { - return await apiRequest(`/channel/${channelId}`, 'delete'); + return await apiRequest(`/channel/${channelId}`, 'delete', undefined, (data) => { + channelsCache.remove(data.id); + }); } export async function addUserToChannel(channelId: number, userId: number) { @@ -26,5 +37,14 @@ export async function removeUserFromChannel(channelId: number, userId: number) { } export async function getMessagesByChannelId(channelId: number, beforeId?: number, limit?: number) { - return await apiRequest(`/channel/${channelId}/message${beforeId || limit ? '?' : ''}${beforeId ? `before=${beforeId}` : ''}${limit ? `&limit=${limit}` : ''}`, 'get'); -} \ No newline at end of file + return await apiRequest( + `/channel/${channelId}/message${beforeId || limit ? '?' : ''}${beforeId ? `before=${beforeId}` : ''}${limit ? `&limit=${limit}` : ''}`, + 'get', + undefined, + (data) => { + data.forEach((message) => { + messagesCache.set(message.id, message); + }); + } + ); +} diff --git a/src/lib/api/message.ts b/src/lib/api/message.ts index 111f0f4..f92263a 100644 --- a/src/lib/api/message.ts +++ b/src/lib/api/message.ts @@ -1,10 +1,20 @@ +import { messagesCache } from '$lib/stores/cache'; import type { Message } from '../types'; import { apiRequest } from './utils'; export async function getMessageById(messageId: number) { - return await apiRequest(`/message/${messageId}`, 'get'); + return await apiRequest(`/message/${messageId}`, 'get', undefined, (data) => { + messagesCache.set(data.id, data); + }); } export async function createMessage(channelId: number, content: string) { - return await apiRequest('/message', 'post', { data: { channelId, content } }); -} \ No newline at end of file + return await apiRequest( + '/message', + 'post', + { data: { channelId, content } }, + (data) => { + messagesCache.set(data.id, data); + } + ); +} diff --git a/src/lib/api/user.ts b/src/lib/api/user.ts index 2763692..e271a63 100644 --- a/src/lib/api/user.ts +++ b/src/lib/api/user.ts @@ -1,16 +1,28 @@ +import { usersCache } from '$lib/stores/cache'; import type { Token, User } from '../types'; import { apiRequest } from './utils'; export async function getByToken(token: string | undefined | null) { - return await apiRequest('/user/me', 'get', { token: token as string | undefined }); + return await apiRequest( + '/user/me', + 'get', + { token: token as string | undefined }, + (data) => { + usersCache.set(data.id, data); + } + ); } export async function getUserById(userId: number) { - return await apiRequest(`/user/${userId}`, 'get'); + return await apiRequest(`/user/${userId}`, 'get', undefined, (data) => { + usersCache.set(data.id, data); + }); } export async function getUserByUsername(username: string) { - return await apiRequest(`/user/username/${username}`, 'get'); + return await apiRequest(`/user/username/${username}`, 'get', undefined, (data) => { + usersCache.set(data.id, data); + }); } export async function loginUser(username: string, password: string) { @@ -19,4 +31,4 @@ export async function loginUser(username: string, password: string) { export async function registerUser(username: string, password: string) { return await apiRequest('/user/register', 'post', { data: { username, password } }); -} \ No newline at end of file +} diff --git a/src/lib/api/utils.ts b/src/lib/api/utils.ts index 1e40da8..90ed6e7 100644 --- a/src/lib/api/utils.ts +++ b/src/lib/api/utils.ts @@ -1,14 +1,19 @@ -import { API_URL } from "$lib/constants"; -import { getUserToken } from "$lib/stores/user"; -import type { ErrorResponse } from "$lib/types"; -import type { AxiosRequestConfig } from "axios"; -import axios from "axios"; +import { API_URL } from '$lib/constants'; +import { getUserToken } from '$lib/stores/user'; +import type { ErrorResponse } from '$lib/types'; +import type { AxiosRequestConfig } from 'axios'; +import axios from 'axios'; - - -export async function apiRequest(path: string, method: 'get' | 'post' | 'put' | 'delete', options?: AxiosRequestConfig & { token?: string }): Promise { +export async function apiRequest( + path: string, + method: 'get' | 'post' | 'put' | 'delete', + options?: AxiosRequestConfig & { token?: string }, + cacheCallback?: (data: T) => void +): Promise { const url = API_URL + path; + console.log(`[API] ${method.toUpperCase()} ${url}`); + const token = options?.token || getUserToken(); options = { @@ -16,16 +21,18 @@ export async function apiRequest(path: string, method: 'get' | 'post' | 'put' method, headers: { ...options?.headers, - 'Authorization': `Bearer ${token}` + Authorization: `Bearer ${token}` }, validateStatus: () => true, - ...options, - } + ...options + }; const response = await axios.request(options); - if (response.status === 200) - return response.data as T; - else - return response.data as ErrorResponse; -} \ No newline at end of file + if (response.status === 200) { + const data = response.data as T; + if (cacheCallback) cacheCallback(data); + + return data; + } else return response.data as ErrorResponse; +} diff --git a/src/lib/components/theme-switch.svelte b/src/lib/components/theme-switch.svelte new file mode 100644 index 0000000..05bcf58 --- /dev/null +++ b/src/lib/components/theme-switch.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/ui/avatar/avatar-fallback.svelte b/src/lib/components/ui/avatar/avatar-fallback.svelte index 865fc40..71d42d0 100644 --- a/src/lib/components/ui/avatar/avatar-fallback.svelte +++ b/src/lib/components/ui/avatar/avatar-fallback.svelte @@ -1,16 +1,16 @@ - + diff --git a/src/lib/components/ui/avatar/avatar-image.svelte b/src/lib/components/ui/avatar/avatar-image.svelte index 6558dc4..4276f1e 100644 --- a/src/lib/components/ui/avatar/avatar-image.svelte +++ b/src/lib/components/ui/avatar/avatar-image.svelte @@ -1,18 +1,18 @@ diff --git a/src/lib/components/ui/avatar/avatar.svelte b/src/lib/components/ui/avatar/avatar.svelte index ba1379b..a9e2726 100644 --- a/src/lib/components/ui/avatar/avatar.svelte +++ b/src/lib/components/ui/avatar/avatar.svelte @@ -1,18 +1,18 @@ - + diff --git a/src/lib/components/ui/avatar/index.ts b/src/lib/components/ui/avatar/index.ts index d06457b..808d862 100644 --- a/src/lib/components/ui/avatar/index.ts +++ b/src/lib/components/ui/avatar/index.ts @@ -1,13 +1,13 @@ -import Root from "./avatar.svelte"; -import Image from "./avatar-image.svelte"; -import Fallback from "./avatar-fallback.svelte"; +import Root from './avatar.svelte'; +import Image from './avatar-image.svelte'; +import Fallback from './avatar-fallback.svelte'; export { - Root, - Image, - Fallback, - // - Root as Avatar, - Image as AvatarImage, - Fallback as AvatarFallback, + Root, + Image, + Fallback, + // + Root as Avatar, + Image as AvatarImage, + Fallback as AvatarFallback }; diff --git a/src/lib/components/ui/button/button.svelte b/src/lib/components/ui/button/button.svelte index 86827f3..ff9dfa8 100644 --- a/src/lib/components/ui/button/button.svelte +++ b/src/lib/components/ui/button/button.svelte @@ -1,25 +1,25 @@ - + diff --git a/src/lib/components/ui/button/index.ts b/src/lib/components/ui/button/index.ts index a927293..72aca4b 100644 --- a/src/lib/components/ui/button/index.ts +++ b/src/lib/components/ui/button/index.ts @@ -1,49 +1,49 @@ -import { type VariantProps, tv } from "tailwind-variants"; -import type { Button as ButtonPrimitive } from "bits-ui"; -import Root from "./button.svelte"; +import { type VariantProps, tv } from 'tailwind-variants'; +import type { Button as ButtonPrimitive } from 'bits-ui'; +import Root from './button.svelte'; const buttonVariants = tv({ - base: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", - variants: { - variant: { - default: "bg-primary text-primary-foreground hover:bg-primary/90", - destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", - outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", - secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", - ghost: "hover:bg-accent hover:text-accent-foreground", - link: "text-primary underline-offset-4 hover:underline", - }, - size: { - default: "h-10 px-4 py-2", - sm: "h-9 rounded-md px-3", - lg: "h-11 rounded-md px-8", - icon: "h-10 w-10", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, + base: 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', + variants: { + variant: { + default: 'bg-primary text-primary-foreground hover:bg-primary/90', + destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90', + outline: + 'border border-input bg-background hover:bg-accent hover:text-accent-foreground', + secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80', + ghost: 'hover:bg-accent hover:text-accent-foreground', + link: 'text-primary underline-offset-4 hover:underline' + }, + size: { + default: 'h-10 px-4 py-2', + sm: 'h-9 rounded-md px-3', + lg: 'h-11 rounded-md px-8', + icon: 'h-10 w-10' + } + }, + defaultVariants: { + variant: 'default', + size: 'default' + } }); -type Variant = VariantProps["variant"]; -type Size = VariantProps["size"]; +type Variant = VariantProps['variant']; +type Size = VariantProps['size']; type Props = ButtonPrimitive.Props & { - variant?: Variant; - size?: Size; + variant?: Variant; + size?: Size; }; type Events = ButtonPrimitive.Events; export { - Root, - type Props, - type Events, - // - Root as Button, - type Props as ButtonProps, - type Events as ButtonEvents, - buttonVariants, + Root, + type Props, + type Events, + // + Root as Button, + type Props as ButtonProps, + type Events as ButtonEvents, + buttonVariants }; diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte index cbca3c5..9b840b2 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte @@ -1,35 +1,35 @@ - - - - - - + + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte index a94b527..51bf441 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte @@ -1,27 +1,27 @@ - + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte index 9a05d4b..8011d6a 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte @@ -1,31 +1,31 @@ - + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte index 43f1527..7a0d50e 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte @@ -1,19 +1,19 @@ - + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte index 1c74ae1..ffca6e2 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte @@ -1,11 +1,11 @@ - + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte index 79a48ee..9141f5b 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte @@ -1,35 +1,35 @@ - - - - - - + + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte index e14d078..7592012 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte @@ -1,14 +1,14 @@ diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte index d8c7378..db1a184 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte @@ -1,13 +1,13 @@ - - + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte index ff20507..d6b940a 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte @@ -1,30 +1,30 @@ - + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte index 9ba3916..96afe27 100644 --- a/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte @@ -1,32 +1,32 @@ - - + + diff --git a/src/lib/components/ui/dropdown-menu/index.ts b/src/lib/components/ui/dropdown-menu/index.ts index c1749e9..993eb36 100644 --- a/src/lib/components/ui/dropdown-menu/index.ts +++ b/src/lib/components/ui/dropdown-menu/index.ts @@ -1,14 +1,14 @@ -import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; -import Item from "./dropdown-menu-item.svelte"; -import Label from "./dropdown-menu-label.svelte"; -import Content from "./dropdown-menu-content.svelte"; -import Shortcut from "./dropdown-menu-shortcut.svelte"; -import RadioItem from "./dropdown-menu-radio-item.svelte"; -import Separator from "./dropdown-menu-separator.svelte"; -import RadioGroup from "./dropdown-menu-radio-group.svelte"; -import SubContent from "./dropdown-menu-sub-content.svelte"; -import SubTrigger from "./dropdown-menu-sub-trigger.svelte"; -import CheckboxItem from "./dropdown-menu-checkbox-item.svelte"; +import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; +import Item from './dropdown-menu-item.svelte'; +import Label from './dropdown-menu-label.svelte'; +import Content from './dropdown-menu-content.svelte'; +import Shortcut from './dropdown-menu-shortcut.svelte'; +import RadioItem from './dropdown-menu-radio-item.svelte'; +import Separator from './dropdown-menu-separator.svelte'; +import RadioGroup from './dropdown-menu-radio-group.svelte'; +import SubContent from './dropdown-menu-sub-content.svelte'; +import SubTrigger from './dropdown-menu-sub-trigger.svelte'; +import CheckboxItem from './dropdown-menu-checkbox-item.svelte'; const Sub = DropdownMenuPrimitive.Sub; const Root = DropdownMenuPrimitive.Root; @@ -16,33 +16,33 @@ const Trigger = DropdownMenuPrimitive.Trigger; const Group = DropdownMenuPrimitive.Group; export { - Sub, - Root, - Item, - Label, - Group, - Trigger, - Content, - Shortcut, - Separator, - RadioItem, - SubContent, - SubTrigger, - RadioGroup, - CheckboxItem, - // - Root as DropdownMenu, - Sub as DropdownMenuSub, - Item as DropdownMenuItem, - Label as DropdownMenuLabel, - Group as DropdownMenuGroup, - Content as DropdownMenuContent, - Trigger as DropdownMenuTrigger, - Shortcut as DropdownMenuShortcut, - RadioItem as DropdownMenuRadioItem, - Separator as DropdownMenuSeparator, - RadioGroup as DropdownMenuRadioGroup, - SubContent as DropdownMenuSubContent, - SubTrigger as DropdownMenuSubTrigger, - CheckboxItem as DropdownMenuCheckboxItem, + Sub, + Root, + Item, + Label, + Group, + Trigger, + Content, + Shortcut, + Separator, + RadioItem, + SubContent, + SubTrigger, + RadioGroup, + CheckboxItem, + // + Root as DropdownMenu, + Sub as DropdownMenuSub, + Item as DropdownMenuItem, + Label as DropdownMenuLabel, + Group as DropdownMenuGroup, + Content as DropdownMenuContent, + Trigger as DropdownMenuTrigger, + Shortcut as DropdownMenuShortcut, + RadioItem as DropdownMenuRadioItem, + Separator as DropdownMenuSeparator, + RadioGroup as DropdownMenuRadioGroup, + SubContent as DropdownMenuSubContent, + SubTrigger as DropdownMenuSubTrigger, + CheckboxItem as DropdownMenuCheckboxItem }; diff --git a/src/lib/components/ui/form/form-button.svelte b/src/lib/components/ui/form/form-button.svelte index 087c839..efcd79f 100644 --- a/src/lib/components/ui/form/form-button.svelte +++ b/src/lib/components/ui/form/form-button.svelte @@ -1,10 +1,10 @@ - + diff --git a/src/lib/components/ui/form/form-description.svelte b/src/lib/components/ui/form/form-description.svelte index 7d36254..cfae3da 100644 --- a/src/lib/components/ui/form/form-description.svelte +++ b/src/lib/components/ui/form/form-description.svelte @@ -1,17 +1,17 @@ - + diff --git a/src/lib/components/ui/form/form-element-field.svelte b/src/lib/components/ui/form/form-element-field.svelte index 2de747e..731ee54 100644 --- a/src/lib/components/ui/form/form-element-field.svelte +++ b/src/lib/components/ui/form/form-element-field.svelte @@ -1,25 +1,25 @@ -
- -
+
+ +
diff --git a/src/lib/components/ui/form/form-field-errors.svelte b/src/lib/components/ui/form/form-field-errors.svelte index 9395326..8e135d1 100644 --- a/src/lib/components/ui/form/form-field-errors.svelte +++ b/src/lib/components/ui/form/form-field-errors.svelte @@ -1,26 +1,26 @@ - - {#each errors as error} -
{error}
- {/each} -
+ + {#each errors as error} +
{error}
+ {/each} +
diff --git a/src/lib/components/ui/form/form-field.svelte b/src/lib/components/ui/form/form-field.svelte index 6e958a3..6f6f50e 100644 --- a/src/lib/components/ui/form/form-field.svelte +++ b/src/lib/components/ui/form/form-field.svelte @@ -1,25 +1,25 @@ -
- -
+
+ +
diff --git a/src/lib/components/ui/form/form-fieldset.svelte b/src/lib/components/ui/form/form-fieldset.svelte index 81e8f1b..64b4ed8 100644 --- a/src/lib/components/ui/form/form-fieldset.svelte +++ b/src/lib/components/ui/form/form-fieldset.svelte @@ -1,30 +1,30 @@ - + diff --git a/src/lib/components/ui/form/form-label.svelte b/src/lib/components/ui/form/form-label.svelte index fcd1028..01d7b0d 100644 --- a/src/lib/components/ui/form/form-label.svelte +++ b/src/lib/components/ui/form/form-label.svelte @@ -1,17 +1,17 @@ -