├── .env.example ├── .eslintignore ├── .eslintrc.cjs ├── .github └── workflows │ └── deploy-vercel.yml ├── .gitignore ├── .prettierignore ├── LICENSE.md ├── README.md ├── bun.lockb ├── components.json ├── drizzle.config.ts ├── mdsvex.config.mjs ├── package.json ├── postcss.config.cjs ├── prettier.config.mjs ├── src ├── app.d.ts ├── app.html ├── app.postcss ├── content │ └── pages │ │ ├── about.svelte.md │ │ ├── privacy.svelte.md │ │ └── terms.svelte.md ├── emails │ └── magic-link-email.svelte ├── hooks.server.ts ├── lib │ ├── actions │ │ └── autosize-action.ts │ ├── auth.ts │ ├── components │ │ ├── back-button.svelte │ │ ├── chat │ │ │ ├── button-scroll-to-bottom.svelte │ │ │ ├── chat-list.svelte │ │ │ ├── chat-message-actions.svelte │ │ │ ├── chat-message.svelte │ │ │ ├── chat-panel.svelte │ │ │ ├── chat-sidebar-actions.svelte │ │ │ ├── chat-sidebar-footer.svelte │ │ │ ├── chat-sidebar-item.svelte │ │ │ ├── chat-sidebar-list.svelte │ │ │ ├── chat-sidebar.svelte │ │ │ ├── chat.svelte │ │ │ ├── clear-history.svelte │ │ │ ├── empty-screen.svelte │ │ │ ├── footer-text.svelte │ │ │ └── prompt-form.svelte │ │ ├── cookies.svelte │ │ ├── copy-button.svelte │ │ ├── error-card.svelte │ │ ├── external-link.svelte │ │ ├── icons │ │ │ ├── apple.svelte │ │ │ ├── aria.svelte │ │ │ ├── discord.svelte │ │ │ ├── github.svelte │ │ │ ├── google.svelte │ │ │ ├── index.ts │ │ │ ├── logo.svelte │ │ │ ├── npm.svelte │ │ │ ├── paypal.svelte │ │ │ ├── pnpm.svelte │ │ │ ├── radix-svelte.svelte │ │ │ ├── radix.svelte │ │ │ ├── tailwind.svelte │ │ │ └── yarn.svelte │ │ ├── layout │ │ │ ├── container.svelte │ │ │ ├── container.ts │ │ │ ├── heading.svelte │ │ │ ├── heading.ts │ │ │ ├── index.ts │ │ │ ├── main-nav.svelte │ │ │ ├── mobile-link.svelte │ │ │ ├── mobile-nav.svelte │ │ │ ├── page-layout-md.svelte │ │ │ ├── shell.svelte │ │ │ ├── shell.ts │ │ │ ├── sidebar-nav-items.svelte │ │ │ ├── sidebar-nav.svelte │ │ │ ├── site-footer.svelte │ │ │ └── site-header.svelte │ │ ├── mdsvex │ │ │ ├── a.svelte │ │ │ ├── blockquote.svelte │ │ │ ├── h1.svelte │ │ │ ├── h2.svelte │ │ │ ├── h3.svelte │ │ │ ├── h4.svelte │ │ │ ├── h5.svelte │ │ │ ├── h6.svelte │ │ │ ├── hr.svelte │ │ │ ├── img.svelte │ │ │ ├── index.ts │ │ │ ├── li.svelte │ │ │ ├── mdsvex.svelte │ │ │ ├── ol.svelte │ │ │ ├── p.svelte │ │ │ ├── pre.svelte │ │ │ ├── table.svelte │ │ │ ├── td.svelte │ │ │ ├── th.svelte │ │ │ ├── tr.svelte │ │ │ └── ul.svelte │ │ ├── svelte-themes │ │ │ ├── SvelteTheme.svelte │ │ │ ├── ThemeScript.svelte │ │ │ ├── constants.ts │ │ │ ├── helpers.ts │ │ │ └── index.ts │ │ ├── theme-toggle.svelte │ │ ├── toaster.svelte │ │ ├── ui │ │ │ ├── accordion │ │ │ │ ├── accordion-content.svelte │ │ │ │ ├── accordion-item.svelte │ │ │ │ ├── accordion-trigger.svelte │ │ │ │ └── index.ts │ │ │ ├── alert-dialog │ │ │ │ ├── alert-dialog-action.svelte │ │ │ │ ├── alert-dialog-cancel.svelte │ │ │ │ ├── alert-dialog-content.svelte │ │ │ │ ├── alert-dialog-description.svelte │ │ │ │ ├── alert-dialog-footer.svelte │ │ │ │ ├── alert-dialog-header.svelte │ │ │ │ ├── alert-dialog-overlay.svelte │ │ │ │ ├── alert-dialog-portal.svelte │ │ │ │ ├── alert-dialog-title.svelte │ │ │ │ └── index.ts │ │ │ ├── alert │ │ │ │ ├── alert-description.svelte │ │ │ │ ├── alert-title.svelte │ │ │ │ ├── alert.svelte │ │ │ │ └── index.ts │ │ │ ├── aspect-ratio │ │ │ │ ├── aspect-ratio.svelte │ │ │ │ └── index.ts │ │ │ ├── avatar │ │ │ │ ├── avatar-fallback.svelte │ │ │ │ ├── avatar-image.svelte │ │ │ │ ├── avatar.svelte │ │ │ │ └── index.ts │ │ │ ├── badge │ │ │ │ ├── badge.svelte │ │ │ │ └── index.ts │ │ │ ├── button │ │ │ │ ├── button.svelte │ │ │ │ └── index.ts │ │ │ ├── card │ │ │ │ ├── card-content.svelte │ │ │ │ ├── card-description.svelte │ │ │ │ ├── card-footer.svelte │ │ │ │ ├── card-header.svelte │ │ │ │ ├── card-title.svelte │ │ │ │ ├── card.svelte │ │ │ │ └── index.ts │ │ │ ├── checkbox │ │ │ │ ├── checkbox.svelte │ │ │ │ └── index.ts │ │ │ ├── collapsible │ │ │ │ ├── collapsible-content.svelte │ │ │ │ └── index.ts │ │ │ ├── context-menu │ │ │ │ ├── context-menu-checkbox-item.svelte │ │ │ │ ├── context-menu-content.svelte │ │ │ │ ├── context-menu-item.svelte │ │ │ │ ├── context-menu-label.svelte │ │ │ │ ├── context-menu-radio-group.svelte │ │ │ │ ├── context-menu-radio-item.svelte │ │ │ │ ├── context-menu-separator.svelte │ │ │ │ ├── context-menu-shortcut.svelte │ │ │ │ ├── context-menu-sub-content.svelte │ │ │ │ ├── context-menu-sub-trigger.svelte │ │ │ │ └── index.ts │ │ │ ├── dialog │ │ │ │ ├── dialog-content.svelte │ │ │ │ ├── dialog-description.svelte │ │ │ │ ├── dialog-footer.svelte │ │ │ │ ├── dialog-header.svelte │ │ │ │ ├── dialog-overlay.svelte │ │ │ │ ├── dialog-portal.svelte │ │ │ │ ├── dialog-title.svelte │ │ │ │ └── index.ts │ │ │ ├── dropdown-menu │ │ │ │ ├── dropdown-menu-checkbox-item.svelte │ │ │ │ ├── dropdown-menu-content.svelte │ │ │ │ ├── dropdown-menu-item.svelte │ │ │ │ ├── dropdown-menu-label.svelte │ │ │ │ ├── dropdown-menu-radio-group.svelte │ │ │ │ ├── dropdown-menu-radio-item.svelte │ │ │ │ ├── dropdown-menu-separator.svelte │ │ │ │ ├── dropdown-menu-shortcut.svelte │ │ │ │ ├── dropdown-menu-sub-content.svelte │ │ │ │ ├── dropdown-menu-sub-trigger.svelte │ │ │ │ └── index.ts │ │ │ ├── form │ │ │ │ ├── form-button.svelte │ │ │ │ ├── form-checkbox.svelte │ │ │ │ ├── form-description.svelte │ │ │ │ ├── form-input.svelte │ │ │ │ ├── form-item.svelte │ │ │ │ ├── form-label.svelte │ │ │ │ ├── form-native-select.svelte │ │ │ │ ├── form-radio-group.svelte │ │ │ │ ├── form-select-trigger.svelte │ │ │ │ ├── form-select.svelte │ │ │ │ ├── form-switch.svelte │ │ │ │ ├── form-textarea.svelte │ │ │ │ ├── form-validation.svelte │ │ │ │ └── index.ts │ │ │ ├── hover-card │ │ │ │ ├── hover-card-content.svelte │ │ │ │ └── index.ts │ │ │ ├── input │ │ │ │ ├── index.ts │ │ │ │ └── input.svelte │ │ │ ├── label │ │ │ │ ├── index.ts │ │ │ │ └── label.svelte │ │ │ ├── menubar │ │ │ │ ├── index.ts │ │ │ │ ├── menubar-checkbox-item.svelte │ │ │ │ ├── menubar-content.svelte │ │ │ │ ├── menubar-item.svelte │ │ │ │ ├── menubar-label.svelte │ │ │ │ ├── menubar-radio-item.svelte │ │ │ │ ├── menubar-separator.svelte │ │ │ │ ├── menubar-shortcut.svelte │ │ │ │ ├── menubar-sub-content.svelte │ │ │ │ ├── menubar-sub-trigger.svelte │ │ │ │ ├── menubar-trigger.svelte │ │ │ │ └── menubar.svelte │ │ │ ├── popover │ │ │ │ ├── index.ts │ │ │ │ └── popover-content.svelte │ │ │ ├── progress │ │ │ │ ├── index.ts │ │ │ │ └── progress.svelte │ │ │ ├── radio-group │ │ │ │ ├── index.ts │ │ │ │ ├── radio-group-item.svelte │ │ │ │ └── radio-group.svelte │ │ │ ├── select │ │ │ │ ├── index.ts │ │ │ │ ├── select-content.svelte │ │ │ │ ├── select-item.svelte │ │ │ │ ├── select-label.svelte │ │ │ │ ├── select-separator.svelte │ │ │ │ ├── select-trigger.svelte │ │ │ │ └── select.svelte │ │ │ ├── separator │ │ │ │ ├── index.ts │ │ │ │ └── separator.svelte │ │ │ ├── sheet │ │ │ │ ├── index.ts │ │ │ │ ├── sheet-content.svelte │ │ │ │ ├── sheet-description.svelte │ │ │ │ ├── sheet-footer.svelte │ │ │ │ ├── sheet-header.svelte │ │ │ │ ├── sheet-overlay.svelte │ │ │ │ ├── sheet-portal.svelte │ │ │ │ └── sheet-title.svelte │ │ │ ├── skeleton │ │ │ │ ├── index.ts │ │ │ │ └── skeleton.svelte │ │ │ ├── slider │ │ │ │ ├── index.ts │ │ │ │ └── slider.svelte │ │ │ ├── switch │ │ │ │ ├── index.ts │ │ │ │ └── switch.svelte │ │ │ ├── table │ │ │ │ ├── index.ts │ │ │ │ ├── table-body.svelte │ │ │ │ ├── table-caption.svelte │ │ │ │ ├── table-cell.svelte │ │ │ │ ├── table-footer.svelte │ │ │ │ ├── table-head.svelte │ │ │ │ ├── table-header.svelte │ │ │ │ ├── table-row.svelte │ │ │ │ └── table.svelte │ │ │ ├── tabs │ │ │ │ ├── index.ts │ │ │ │ ├── tabs-content.svelte │ │ │ │ ├── tabs-list.svelte │ │ │ │ └── tabs-trigger.svelte │ │ │ ├── textarea │ │ │ │ ├── index.ts │ │ │ │ └── textarea.svelte │ │ │ ├── toggle │ │ │ │ ├── index.ts │ │ │ │ └── toggle.svelte │ │ │ └── tooltip │ │ │ │ ├── index.ts │ │ │ │ └── tooltip-content.svelte │ │ ├── user-avatar.svelte │ │ └── user-menu.svelte │ ├── config │ │ ├── dashboard.ts │ │ ├── nav.ts │ │ └── site.ts │ ├── constants.ts │ ├── images │ │ ├── github.svg │ │ ├── svelte-logo.svg │ │ ├── svelte-welcome.png │ │ └── svelte-welcome.webp │ ├── schemas │ │ ├── account-schema.ts │ │ └── contact-schema.ts │ ├── stores │ │ ├── breakpoint-store.ts │ │ ├── cookies-store.ts │ │ └── scroll-utils-store.ts │ ├── types │ │ ├── auth-js.d.ts │ │ ├── db.ts │ │ ├── nav.ts │ │ └── types.d.ts │ ├── utils.ts │ └── vitals.ts ├── routes │ ├── (app) │ │ ├── (marketing) │ │ │ ├── +error.svelte │ │ │ ├── +layout.svelte │ │ │ ├── +page.server.ts │ │ │ ├── +page.svelte │ │ │ ├── [slug] │ │ │ │ ├── +page.svelte │ │ │ │ └── +page.ts │ │ │ ├── blog │ │ │ │ ├── +page.server.ts │ │ │ │ └── +page.svelte │ │ │ └── contact │ │ │ │ ├── +page.server.ts │ │ │ │ └── +page.svelte │ │ ├── +layout.server.ts │ │ ├── +layout.svelte │ │ ├── auth │ │ │ ├── (not-authed) │ │ │ │ ├── +layout.server.ts │ │ │ │ ├── sign-in │ │ │ │ │ └── +page.svelte │ │ │ │ ├── sign-up │ │ │ │ │ └── +page.svelte │ │ │ │ └── verify-req │ │ │ │ │ ├── +page.svelte │ │ │ │ │ └── +page.ts │ │ │ ├── +layout.svelte │ │ │ ├── auth-error │ │ │ │ └── +page.svelte │ │ │ └── sign-out │ │ │ │ ├── +page.server.ts │ │ │ │ └── +page.svelte │ │ ├── chat │ │ │ ├── +layout.server.ts │ │ │ ├── +layout.svelte │ │ │ ├── +page.svelte │ │ │ ├── button-scroll-to-bottom.svelte │ │ │ ├── chat-list.svelte │ │ │ ├── chat-message-actions.svelte │ │ │ ├── chat-message.svelte │ │ │ ├── chat-panel.svelte │ │ │ ├── chat-sidebar-actions.svelte │ │ │ ├── chat-sidebar-footer.svelte │ │ │ ├── chat-sidebar-item.svelte │ │ │ ├── chat-sidebar-list.svelte │ │ │ ├── chat-sidebar.svelte │ │ │ ├── chat.svelte │ │ │ ├── clear-history.svelte │ │ │ ├── empty-screen.svelte │ │ │ ├── footer-text.svelte │ │ │ └── prompt-form.svelte │ │ └── dashboard │ │ │ ├── +layout.server.ts │ │ │ ├── +layout.svelte │ │ │ ├── +page.ts │ │ │ └── account │ │ │ ├── +page.server.ts │ │ │ └── +page.svelte │ ├── +layout.server.ts │ ├── +layout.svelte │ └── api │ │ ├── auth │ │ └── session │ │ │ └── +server.ts │ │ └── chat │ │ └── +server.ts ├── server │ ├── db │ │ ├── chat-db.ts │ │ ├── index.ts │ │ ├── schema.ts │ │ └── user-db.ts │ └── email.ts └── styles │ └── mdsvex.css ├── static ├── favicon.png └── robots.txt ├── svelte.config.js ├── tailwind.config.js ├── tsconfig.json └── vite.config.ts /.env.example: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # App 3 | # ----------------------------------------------------------------------------- 4 | NEXT_PUBLIC_APP_URL=http://localhost:3000 5 | 6 | # ----------------------------------------------------------------------------- 7 | # Database 8 | # ----------------------------------------------------------------------------- 9 | DATABASE_URL='file:./db.sqlite' 10 | DATABASE_AUTH_TOKEN= 11 | 12 | # ----------------------------------------------------------------------------- 13 | # Authentication (NextAuth.js) 14 | # ----------------------------------------------------------------------------- 15 | AUTH_URL=http://localhost:3000 16 | AUTH_SECRET=2gxHTLx+ZyCCCbb808/IK0kKErvYwLcbRIb7jJVCJ3E= 17 | 18 | GOOGLE_CLIENT_ID= 19 | GOOGLE_CLIENT_SECRET= 20 | 21 | # ----------------------------------------------------------------------------- 22 | # Email 23 | # ----------------------------------------------------------------------------- 24 | RESEND_API_KEY= 25 | EMAIL_SERVER_FROM= 26 | 27 | # ----------------------------------------------------------------------------- 28 | # Various 29 | # ----------------------------------------------------------------------------- 30 | OPENAI_API_KEY= -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | 15 | src/lib/components/ui/**/* -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: [ 4 | 'eslint:recommended', 5 | 'plugin:@typescript-eslint/recommended', 6 | 'plugin:svelte/recommended', 7 | "plugin:prettier/recommended" 8 | ], 9 | parser: '@typescript-eslint/parser', 10 | plugins: ['@typescript-eslint'], 11 | parserOptions: { 12 | sourceType: 'module', 13 | ecmaVersion: 2020, 14 | extraFileExtensions: ['.svelte'] 15 | }, 16 | env: { 17 | browser: true, 18 | es2017: true, 19 | node: true 20 | }, 21 | overrides: [ 22 | { 23 | files: ['*.svelte'], 24 | parser: 'svelte-eslint-parser', 25 | parserOptions: { 26 | parser: '@typescript-eslint/parser' 27 | } 28 | } 29 | ] 30 | }; 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | .vercel 10 | .output 11 | vite.config.js.timestamp-* 12 | vite.config.ts.timestamp-* 13 | db.sqlite 14 | .idea -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Julius Lipp 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliuslipp/sveltekit-shadcn-ai/07d1ff53476e335cf06e66892fc6d4d41f4b230e/bun.lockb -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://shadcn-svelte.com/schema.json", 3 | "style": "new-york", 4 | "tailwind": { 5 | "config": "tailwind.config.js", 6 | "css": "src/app.postcss", 7 | "baseColor": "slate" 8 | }, 9 | "aliases": { 10 | "components": "$lib/components", 11 | "utils": "$lib/utils" 12 | } 13 | } -------------------------------------------------------------------------------- /drizzle.config.ts: -------------------------------------------------------------------------------- 1 | import * as dotenv from "dotenv"; 2 | import type { Config } from "drizzle-kit"; 3 | 4 | dotenv.config(); 5 | 6 | const config = { 7 | schema: "src/server/db/schema.ts", 8 | out: "drizzle", 9 | driver: "turso", 10 | tablesFilter: ["svelte-app-starter_*"], 11 | dbCredentials: { 12 | url: process.env.DATABASE_URL!, 13 | authToken: process.env.DATABASE_AUTH_TOKEN, 14 | }, 15 | } satisfies Config; 16 | 17 | export default config; 18 | -------------------------------------------------------------------------------- /mdsvex.config.mjs: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { defineMDSveXConfig as defineConfig } from "mdsvex"; 3 | 4 | const config = defineConfig({ 5 | extensions: [".svelte.md", ".md", ".svx"], 6 | layout: path.resolve("./src/lib/components/mdsvex/mdsvex.svelte"), 7 | smartypants: { 8 | dashes: "oldschool", 9 | }, 10 | remarkPlugins: [], 11 | rehypePlugins: [], 12 | }); 13 | 14 | export default config; 15 | -------------------------------------------------------------------------------- /postcss.config.cjs: -------------------------------------------------------------------------------- 1 | const tailwindcss = require("tailwindcss"); 2 | const autoprefixer = require("autoprefixer"); 3 | const cssnano = require("cssnano"); 4 | const config = { 5 | plugins: [ 6 | //Some plugins, like tailwindcss/nesting, need to run before Tailwind, 7 | tailwindcss(), 8 | //But others, like autoprefixer, need to run after, 9 | autoprefixer, 10 | cssnano({preset: "default"}) 11 | ] 12 | }; 13 | 14 | module.exports = config; -------------------------------------------------------------------------------- /prettier.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Config} */ 2 | export default { 3 | endOfLine: "lf", 4 | semi: true, 5 | singleQuote: false, 6 | tabWidth: 2, 7 | trailingComma: "es5", 8 | // @ts-ignore 9 | importOrder: [ 10 | "^(react/(.*)$)|^(react$)", 11 | "^(next/(.*)$)|^(next$)", 12 | "", 13 | "", 14 | "^types$", 15 | "^@/env(.*)$", 16 | "^@/types/(.*)$", 17 | "^@/config/(.*)$", 18 | "^@/lib/(.*)$", 19 | "^@/hooks/(.*)$", 20 | "^@/components/ui/(.*)$", 21 | "^@/components/(.*)$", 22 | "^@/styles/(.*)$", 23 | "^@/app/(.*)$", 24 | "", 25 | "^[./]", 26 | ], 27 | importOrderSeparation: false, 28 | importOrderSortSpecifiers: true, 29 | importOrderBuiltinModulesToTop: true, 30 | importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"], 31 | importOrderMergeDuplicateImports: true, 32 | importOrderCombineTypeAndValueImports: true, 33 | pluginSearchDirs: ["."], 34 | overrides: [{"files": "*.svelte", "options": {"parser": "svelte"}}], 35 | plugins: ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss", "prettier-plugin-svelte"], 36 | } 37 | -------------------------------------------------------------------------------- /src/app.d.ts: -------------------------------------------------------------------------------- 1 | // See https://kit.svelte.dev/docs/types#app 2 | // for information about these interfaces 3 | declare global { 4 | namespace App { 5 | // interface Error {} 6 | // interface Locals {} 7 | // interface PageData {} 8 | // interface Platform {} 9 | } 10 | } 11 | 12 | export {}; 13 | -------------------------------------------------------------------------------- /src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %sveltekit.head% 8 | 9 | 18 | 19 | 20 |
%sveltekit.body%
21 | 22 | 23 | -------------------------------------------------------------------------------- /src/content/pages/about.svelte.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: About Us 3 | description: "Us!" 4 | --- 5 | 6 | ... 7 | 8 | ## Our Mission 9 | 10 | ... 11 | 12 | ## Our Journey 13 | 14 | ... 15 | ## Meet the Team 16 | 17 | ... 18 | 19 | - [Julius Lipp](https://www.linkedin.com/in/julius-lipp/): What up. 20 | 21 | ## Contact Us 22 | 23 | 24 |
25 | Crafted with dedication and ❤️ 26 |
27 | -------------------------------------------------------------------------------- /src/content/pages/privacy.svelte.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Privacy Policy 3 | description: last updated June 22, 2023 4 | --- 5 | 6 | is committed to protecting your privacy and ensuring that your personal information is handled in a safe and responsible manner. This Privacy Policy outlines how we collect, use, and protect your information when you access and use our Embeddings as a Service API. By using our service, you consent to the collection, use, and disclosure of your information as described in this Privacy Policy. 7 | 8 | ## Consent 9 | -------------------------------------------------------------------------------- /src/content/pages/terms.svelte.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Terms & Conditions 3 | description: last updated June 22, 2023 4 | --- 5 | Please read these Terms and Conditions ("Terms", "Terms and Conditions") carefully. 6 | -------------------------------------------------------------------------------- /src/lib/actions/autosize-action.ts: -------------------------------------------------------------------------------- 1 | import autosize from "autosize"; 2 | 3 | const autosizeAction = (node: HTMLElement) => { 4 | autosize(node); 5 | 6 | return { 7 | destroy() { 8 | autosize.destroy(node); 9 | }, 10 | }; 11 | }; 12 | 13 | autosizeAction.update = autosize.update; 14 | autosizeAction.destroy = autosize.destroy; 15 | 16 | export { autosizeAction }; 17 | -------------------------------------------------------------------------------- /src/lib/auth.ts: -------------------------------------------------------------------------------- 1 | import type { DefaultSession, Session } from "@auth/core/types"; 2 | import { redirect } from "@sveltejs/kit"; 3 | 4 | interface ObjectWithSession { 5 | data: { 6 | session?: Session; 7 | }; 8 | } 9 | 10 | export const getOrRedirect = (session: Session | undefined) => { 11 | if (!session?.user) { 12 | throw redirect(303, "/auth/sign-in"); 13 | } 14 | 15 | return session; 16 | }; 17 | 18 | export const getUser = ( 19 | { data: { session } }: ObjectWithSession = { data: {} } 20 | ): DefaultSession["user"] | undefined => session?.user; 21 | -------------------------------------------------------------------------------- /src/lib/components/back-button.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 19 | -------------------------------------------------------------------------------- /src/lib/components/chat/button-scroll-to-bottom.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 36 | -------------------------------------------------------------------------------- /src/lib/components/chat/chat-list.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 | {#if $messages?.length} 11 |
12 | {#each $messages as message, index} 13 |
14 | 15 | {#if index < $messages.length - 1} 16 | 17 | {/if} 18 |
19 | {/each} 20 |
21 | {/if} 22 | -------------------------------------------------------------------------------- /src/lib/components/chat/chat-message-actions.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 |
19 | 20 |
21 | -------------------------------------------------------------------------------- /src/lib/components/chat/chat-message.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
18 |
26 | {#if message.role === "user"} 27 | 28 | {:else} 29 | 30 | {/if} 31 |
32 |
33 | {message.content} 34 |
35 | 36 |
37 | -------------------------------------------------------------------------------- /src/lib/components/chat/chat-sidebar-footer.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
12 | 13 |
14 | -------------------------------------------------------------------------------- /src/lib/components/chat/chat-sidebar-item.svelte: -------------------------------------------------------------------------------- 1 | 17 | 18 |
19 |
20 | {#if chat.sharePath} 21 | 22 | 26 | 27 | 28 | This is a shared chat. 29 | 30 | {:else} 31 | 32 | {/if} 33 |
34 | 46 | {#if isActive} 47 |
48 | 49 |
50 | {/if} 51 |
52 | -------------------------------------------------------------------------------- /src/lib/components/chat/chat-sidebar-list.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 | {#if chats.length} 14 |
15 | {#each chats as chat (chat.id)} 16 | 17 | 18 | 19 | {/each} 20 |
21 | {:else} 22 |
23 |

No chat history

24 |
25 | {/if} 26 |
27 | -------------------------------------------------------------------------------- /src/lib/components/chat/chat-sidebar.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 19 | 20 | 23 | 24 | Chat History 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/lib/components/chat/chat.svelte: -------------------------------------------------------------------------------- 1 | 29 | 30 |
31 | {#if $messages.length} 32 | 33 | {:else} 34 | 35 | {/if} 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /src/lib/components/chat/footer-text.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |

15 | Best in class 16 |

17 | -------------------------------------------------------------------------------- /src/lib/components/copy-button.svelte: -------------------------------------------------------------------------------- 1 | 33 | 34 | 48 | -------------------------------------------------------------------------------- /src/lib/components/external-link.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 27 | 28 | -------------------------------------------------------------------------------- /src/lib/components/icons/apple.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /src/lib/components/icons/aria.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /src/lib/components/icons/google.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 21 | 22 | -------------------------------------------------------------------------------- /src/lib/components/icons/logo.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 20 | 31 | 32 | -------------------------------------------------------------------------------- /src/lib/components/icons/npm.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /src/lib/components/icons/paypal.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /src/lib/components/icons/pnpm.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /src/lib/components/icons/radix-svelte.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 19 | 20 | -------------------------------------------------------------------------------- /src/lib/components/icons/radix.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | -------------------------------------------------------------------------------- /src/lib/components/icons/tailwind.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /src/lib/components/layout/container.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/lib/components/layout/container.ts: -------------------------------------------------------------------------------- 1 | import { tv, type VariantProps } from "tailwind-variants"; 2 | 3 | export const containerVariants = tv({ 4 | base: "overflow-hidden py-12 md:py-16 [&>*]:mx-auto [&>*]:max-w-xl sm:[&>*]:max-w-2xl md:[&>*]:max-w-3xl lg:[&>*]:max-w-4xl", 5 | variants: { 6 | variant: { 7 | default: "", 8 | contrast: "bg-accent", 9 | main: "pt-8 sm:pt-16 lg:pt-20", 10 | fullScreen: "h-screen -mt-20", 11 | centered: 12 | "container flex h-screen w-full max-w-full flex-col justify-center", 13 | }, 14 | }, 15 | defaultVariants: { 16 | variant: "default", 17 | }, 18 | }); 19 | 20 | export type Variant = VariantProps["variant"]; 21 | -------------------------------------------------------------------------------- /src/lib/components/layout/heading.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 |
16 |

22 | {title} 23 |

24 | {#if description} 25 |

32 | {description} 33 |

34 | {/if} 35 |
36 | -------------------------------------------------------------------------------- /src/lib/components/layout/heading.ts: -------------------------------------------------------------------------------- 1 | import { tv, type VariantProps } from "tailwind-variants"; 2 | 3 | export const headingVariants = tv({ 4 | base: "text-3xl font-bold tracking-tight", 5 | variants: { 6 | variant: { 7 | default: "", 8 | contrast: "bg-accent", 9 | main: "pt-8 sm:pt-16 lg:pt-20", 10 | }, 11 | }, 12 | defaultVariants: { 13 | variant: "default", 14 | }, 15 | }); 16 | 17 | export type Variant = VariantProps["variant"]; 18 | -------------------------------------------------------------------------------- /src/lib/components/layout/index.ts: -------------------------------------------------------------------------------- 1 | export { default as SiteFooter } from "./site-footer.svelte"; 2 | export { default as SiteHeader } from "./site-header.svelte"; 3 | export { default as SidebarNav } from "./sidebar-nav.svelte"; 4 | export { default as Container } from "./container.svelte"; 5 | export { default as Shell } from "./shell.svelte"; 6 | export { default as Heading } from "./heading.svelte"; 7 | -------------------------------------------------------------------------------- /src/lib/components/layout/main-nav.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 36 | -------------------------------------------------------------------------------- /src/lib/components/layout/mobile-link.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | (open = false)} 15 | class={cn( 16 | $page.url.pathname === href ? "text-foreground" : "text-foreground/60", 17 | className 18 | )} 19 | {...$$restProps} 20 | > 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/lib/components/layout/page-layout-md.svelte: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /src/lib/components/layout/shell.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/lib/components/layout/shell.ts: -------------------------------------------------------------------------------- 1 | import { tv, type VariantProps } from "tailwind-variants"; 2 | 3 | export const shellVariants = tv({ 4 | base: "grid items-center gap-8 w-full p-4 md:p-8", 5 | variants: { 6 | variant: { 7 | default: "", 8 | container: "container", 9 | page: "px-0 md:px-0", 10 | auth: "container max-w-lg p-0 lg:p-0 max-h-full", 11 | fullScreen: "h-screen -mt-16", 12 | markdown: "container max-w-3xl p-8 md:p-10 lg:p-10 gap-0", 13 | }, 14 | }, 15 | defaultVariants: { 16 | variant: "default", 17 | }, 18 | }); 19 | 20 | export type Variant = VariantProps["variant"]; 21 | -------------------------------------------------------------------------------- /src/lib/components/layout/sidebar-nav-items.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 | {#if items.length} 11 |
12 | {#each items as item, index (index)} 13 | {#if item.href} 14 | 20 | 29 | 36 | 37 | {:else} 38 | 41 | {item.title} 42 | 43 | {/if} 44 | {/each} 45 |
46 | {/if} 47 | -------------------------------------------------------------------------------- /src/lib/components/layout/sidebar-nav.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | {#if items.length} 13 |
14 | {#each items as item, index (index)} 15 | {#if item.children} 16 |
17 | {#if item.href} 18 | 19 |

20 | {item.title} 21 |

22 |
23 | {:else} 24 |

25 | {item.title} 26 |

27 | {/if} 28 | 29 | {#if item?.items} 30 | {#if item?.items?.length} 31 | 32 | {/if} 33 | {/if} 34 |
35 | {:else} 36 | 37 | {/if} 38 | {/each} 39 |
40 | {/if} 41 | 42 | 43 |
44 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/a.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/blockquote.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
12 | 13 |
14 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/h1.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |

12 | 13 |

14 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/h2.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |

15 | 16 |

17 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/h3.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |

15 | 16 |

17 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/h4.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |

15 | 16 |

17 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/h5.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
15 | 16 |
17 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/h6.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
15 | 16 |
17 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/hr.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/img.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/index.ts: -------------------------------------------------------------------------------- 1 | export { default as a } from "./a.svelte"; 2 | export { default as blockquote } from "./blockquote.svelte"; 3 | export { default as h1 } from "./h1.svelte"; 4 | export { default as h2 } from "./h2.svelte"; 5 | export { default as h3 } from "./h3.svelte"; 6 | export { default as h4 } from "./h4.svelte"; 7 | export { default as h5 } from "./h5.svelte"; 8 | export { default as h6 } from "./h6.svelte"; 9 | export { default as hr } from "./hr.svelte"; 10 | export { default as img } from "./img.svelte"; 11 | export { default as li } from "./li.svelte"; 12 | export { default as ol } from "./ol.svelte"; 13 | export { default as p } from "./p.svelte"; 14 | export { default as pre } from "./pre.svelte"; 15 | export { default as table } from "./table.svelte"; 16 | export { default as td } from "./td.svelte"; 17 | export { default as th } from "./th.svelte"; 18 | export { default as tr } from "./tr.svelte"; 19 | export { default as ul } from "./ul.svelte"; 20 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/li.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
  • 9 | 10 |
  • 11 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/mdsvex.svelte: -------------------------------------------------------------------------------- 1 | 2 | 49 | 50 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/ol.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
      9 | 10 |
    11 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/p.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |

    12 | 13 |

    14 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/pre.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 |
    22 | 	
    23 | 
    24 | 28 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/table.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
    9 | 10 | 11 |
    12 |
    13 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/td.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/th.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/tr.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/lib/components/mdsvex/ul.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
      9 | 10 |
    11 | -------------------------------------------------------------------------------- /src/lib/components/svelte-themes/constants.ts: -------------------------------------------------------------------------------- 1 | export const colorSchemes = ["light", "dark"]; 2 | export const MEDIA = "(prefers-color-scheme: dark)"; 3 | -------------------------------------------------------------------------------- /src/lib/components/svelte-themes/helpers.ts: -------------------------------------------------------------------------------- 1 | import { MEDIA } from "./constants"; 2 | import type { ThemeStore } from "./index"; 3 | 4 | export const getTheme = ( 5 | key: string, 6 | fallback?: string 7 | ): string | undefined => { 8 | if (typeof window === "undefined") return undefined; 9 | let theme; 10 | try { 11 | theme = localStorage.getItem(key) || undefined; 12 | } catch (e) { 13 | // Unsupported 14 | } 15 | return theme || fallback; 16 | }; 17 | 18 | export const getResolvedTheme = (theme: string, themes: string[]): string => { 19 | if (theme === "system") { 20 | const systemTheme = getSystemTheme(); 21 | return themes.includes(systemTheme) ? systemTheme : themes[0]; 22 | } 23 | return theme; 24 | }; 25 | 26 | export const disableAnimation = () => { 27 | const css = document.createElement("style"); 28 | css.appendChild( 29 | document.createTextNode( 30 | `*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}` 31 | ) 32 | ); 33 | document.head.appendChild(css); 34 | 35 | return () => { 36 | // Force restyle 37 | (() => window.getComputedStyle(document.body))(); 38 | 39 | // Wait for next tick before removing 40 | setTimeout(() => { 41 | document.head.removeChild(css); 42 | }, 1); 43 | }; 44 | }; 45 | 46 | export const getSystemTheme = ( 47 | e?: MediaQueryList 48 | ): ThemeStore["systemTheme"] => { 49 | if (!e) { 50 | e = window.matchMedia(MEDIA); 51 | } 52 | 53 | const isDark = e.matches; 54 | const systemTheme = isDark ? "dark" : "light"; 55 | return systemTheme; 56 | }; 57 | -------------------------------------------------------------------------------- /src/lib/components/svelte-themes/index.ts: -------------------------------------------------------------------------------- 1 | import { writable } from "svelte/store"; 2 | 3 | export interface ThemeStore { 4 | /** List of all available theme names */ 5 | themes: string[]; 6 | /** Forced theme name for the current page */ 7 | forcedTheme?: string; 8 | /** Update the theme */ 9 | /** Active theme name */ 10 | theme?: string; 11 | /** If `enableSystem` is true and the active theme is "system", this returns whether the system preference resolved to "dark" or "light". Otherwise, identical to `theme` */ 12 | resolvedTheme?: string; 13 | /** If enableSystem is true, returns the System theme preference ("dark" or "light"), regardless what the active theme is */ 14 | systemTheme?: "dark" | "light"; 15 | } 16 | 17 | const themeStore = writable({ 18 | themes: [], 19 | forcedTheme: undefined, 20 | theme: undefined, 21 | resolvedTheme: undefined, 22 | systemTheme: undefined, 23 | }); 24 | 25 | export const setTheme = (theme: string): void => { 26 | themeStore.update((store) => ({ ...store, theme })); 27 | }; 28 | export default themeStore; 29 | -------------------------------------------------------------------------------- /src/lib/components/toaster.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | -------------------------------------------------------------------------------- /src/lib/components/ui/accordion/accordion-content.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 | 23 |
    24 | 25 |
    26 |
    27 | -------------------------------------------------------------------------------- /src/lib/components/ui/accordion/accordion-item.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/lib/components/ui/accordion/accordion-trigger.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | svg]:rotate-180", 18 | className 19 | )} 20 | {...$$restProps} 21 | on:click 22 | > 23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/lib/components/ui/accordion/index.ts: -------------------------------------------------------------------------------- 1 | import { Accordion as AccordionPrimitive } from "bits-ui"; 2 | import Content from "./accordion-content.svelte"; 3 | import Item from "./accordion-item.svelte"; 4 | import Trigger from "./accordion-trigger.svelte"; 5 | 6 | const Root = AccordionPrimitive.Root; 7 | export { 8 | Root, 9 | Content, 10 | Item, 11 | Trigger, 12 | // 13 | Root as Accordion, 14 | Content as AccordionContent, 15 | Item as AccordionItem, 16 | Trigger as AccordionTrigger 17 | }; 18 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-action.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-content.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-description.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
    18 | 19 |
    20 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-header.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
    15 | 16 |
    17 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 25 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-portal.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/alert-dialog-title.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert-dialog/index.ts: -------------------------------------------------------------------------------- 1 | import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; 2 | 3 | const Root = AlertDialogPrimitive.Root; 4 | const Trigger = AlertDialogPrimitive.Trigger; 5 | 6 | import Title from "./alert-dialog-title.svelte"; 7 | import Action from "./alert-dialog-action.svelte"; 8 | import Cancel from "./alert-dialog-cancel.svelte"; 9 | import Portal from "./alert-dialog-portal.svelte"; 10 | import Footer from "./alert-dialog-footer.svelte"; 11 | import Header from "./alert-dialog-header.svelte"; 12 | import Overlay from "./alert-dialog-overlay.svelte"; 13 | import Content from "./alert-dialog-content.svelte"; 14 | import Description from "./alert-dialog-description.svelte"; 15 | 16 | export { 17 | Root, 18 | Title, 19 | Action, 20 | Cancel, 21 | Portal, 22 | Footer, 23 | Header, 24 | Trigger, 25 | Overlay, 26 | Content, 27 | Description, 28 | // 29 | Root as AlertDialog, 30 | Title as AlertDialogTitle, 31 | Action as AlertDialogAction, 32 | Cancel as AlertDialogCancel, 33 | Portal as AlertDialogPortal, 34 | Footer as AlertDialogFooter, 35 | Header as AlertDialogHeader, 36 | Trigger as AlertDialogTrigger, 37 | Overlay as AlertDialogOverlay, 38 | Content as AlertDialogContent, 39 | Description as AlertDialogDescription 40 | }; 41 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert/alert-description.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
    12 | 13 |
    14 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert/alert-title.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert/alert.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /src/lib/components/ui/alert/index.ts: -------------------------------------------------------------------------------- 1 | import { tv, type VariantProps } from "tailwind-variants"; 2 | 3 | import Root from "./alert.svelte"; 4 | import Description from "./alert-description.svelte"; 5 | import Title from "./alert-title.svelte"; 6 | 7 | export const alertVariants = tv({ 8 | base: "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", 9 | variants: { 10 | variant: { 11 | default: "bg-background text-foreground", 12 | destructive: 13 | "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive" 14 | } 15 | }, 16 | defaultVariants: { 17 | variant: "default" 18 | } 19 | }); 20 | 21 | export type Variant = VariantProps["variant"]; 22 | export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; 23 | 24 | export { 25 | Root, 26 | Description, 27 | Title, 28 | // 29 | Root as Alert, 30 | Description as AlertDescription, 31 | Title as AlertTitle 32 | }; 33 | -------------------------------------------------------------------------------- /src/lib/components/ui/aspect-ratio/aspect-ratio.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/lib/components/ui/aspect-ratio/index.ts: -------------------------------------------------------------------------------- 1 | import Root from "./aspect-ratio.svelte"; 2 | 3 | export { Root, Root as AspectRatio }; 4 | -------------------------------------------------------------------------------- /src/lib/components/ui/avatar/avatar-fallback.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/lib/components/ui/avatar/avatar-image.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /src/lib/components/ui/avatar/avatar.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/lib/components/ui/avatar/index.ts: -------------------------------------------------------------------------------- 1 | import Root from "./avatar.svelte"; 2 | import Image from "./avatar-image.svelte"; 3 | import Fallback from "./avatar-fallback.svelte"; 4 | 5 | export { 6 | Root, 7 | Image, 8 | Fallback, 9 | // 10 | Root as Avatar, 11 | Image as AvatarImage, 12 | Fallback as AvatarFallback 13 | }; 14 | -------------------------------------------------------------------------------- /src/lib/components/ui/badge/badge.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/lib/components/ui/badge/index.ts: -------------------------------------------------------------------------------- 1 | import { tv, type VariantProps } from "tailwind-variants"; 2 | 3 | export { default as Badge } from "./badge.svelte"; 4 | export const badgeVariants = tv({ 5 | base: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 select-none", 6 | variants: { 7 | variant: { 8 | default: 9 | "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80", 10 | secondary: 11 | "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", 12 | destructive: 13 | "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80", 14 | outline: "text-foreground" 15 | } 16 | }, 17 | defaultVariants: { 18 | variant: "default" 19 | } 20 | }); 21 | 22 | export type Variant = VariantProps["variant"]; 23 | -------------------------------------------------------------------------------- /src/lib/components/ui/button/button.svelte: -------------------------------------------------------------------------------- 1 | 18 | 19 | 27 | {#if loading} 28 | 29 | Loading 30 | {/if} 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/lib/components/ui/card/card-content.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
    12 | 13 |
    14 | -------------------------------------------------------------------------------- /src/lib/components/ui/card/card-description.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |

    12 | 13 |

    14 | -------------------------------------------------------------------------------- /src/lib/components/ui/card/card-footer.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
    12 | 13 |
    14 | -------------------------------------------------------------------------------- /src/lib/components/ui/card/card-header.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
    12 | 13 |
    14 | -------------------------------------------------------------------------------- /src/lib/components/ui/card/card-title.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/lib/components/ui/card/card.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 |
    24 | 25 |
    26 | -------------------------------------------------------------------------------- /src/lib/components/ui/card/index.ts: -------------------------------------------------------------------------------- 1 | import Root from "./card.svelte"; 2 | import Content from "./card-content.svelte"; 3 | import Description from "./card-description.svelte"; 4 | import Footer from "./card-footer.svelte"; 5 | import Header from "./card-header.svelte"; 6 | import Title from "./card-title.svelte"; 7 | 8 | export { 9 | Root, 10 | Content, 11 | Description, 12 | Footer, 13 | Header, 14 | Title, 15 | // 16 | Root as Card, 17 | Content as CardContent, 18 | Description as CardDescription, 19 | Footer as CardFooter, 20 | Header as CardHeader, 21 | Title as CardTitle 22 | }; 23 | 24 | export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; 25 | -------------------------------------------------------------------------------- /src/lib/components/ui/checkbox/checkbox.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 23 | 28 | {#if isIndeterminate} 29 | 30 | {:else} 31 | 32 | {/if} 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/lib/components/ui/checkbox/index.ts: -------------------------------------------------------------------------------- 1 | import Root from "./checkbox.svelte"; 2 | export { 3 | Root, 4 | // 5 | Root as Checkbox 6 | }; 7 | -------------------------------------------------------------------------------- /src/lib/components/ui/collapsible/collapsible-content.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/lib/components/ui/collapsible/index.ts: -------------------------------------------------------------------------------- 1 | import { Collapsible as CollapsiblePrimitive } from "bits-ui"; 2 | import Content from "./collapsible-content.svelte"; 3 | 4 | const Root = CollapsiblePrimitive.Root; 5 | const Trigger = CollapsiblePrimitive.Trigger; 6 | 7 | export { 8 | Root, 9 | Content, 10 | Trigger, 11 | // 12 | Root as Collapsible, 13 | Content as CollapsibleContent, 14 | Trigger as CollapsibleTrigger 15 | }; 16 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-content.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-item.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-label.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-radio-group.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-radio-item.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-separator.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-shortcut.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-sub-content.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/lib/components/ui/context-menu/index.ts: -------------------------------------------------------------------------------- 1 | import { ContextMenu as ContextMenuPrimitive } from "bits-ui"; 2 | 3 | import Item from "./context-menu-item.svelte"; 4 | import Label from "./context-menu-label.svelte"; 5 | import Content from "./context-menu-content.svelte"; 6 | import Shortcut from "./context-menu-shortcut.svelte"; 7 | import RadioItem from "./context-menu-radio-item.svelte"; 8 | import Separator from "./context-menu-separator.svelte"; 9 | import RadioGroup from "./context-menu-radio-group.svelte"; 10 | import SubContent from "./context-menu-sub-content.svelte"; 11 | import SubTrigger from "./context-menu-sub-trigger.svelte"; 12 | import CheckboxItem from "./context-menu-checkbox-item.svelte"; 13 | 14 | const Sub = ContextMenuPrimitive.Sub; 15 | const Root = ContextMenuPrimitive.Root; 16 | const Trigger = ContextMenuPrimitive.Trigger; 17 | const Group = ContextMenuPrimitive.Group; 18 | 19 | export { 20 | Sub, 21 | Root, 22 | Item, 23 | Label, 24 | Group, 25 | Trigger, 26 | Content, 27 | Shortcut, 28 | Separator, 29 | RadioItem, 30 | SubContent, 31 | SubTrigger, 32 | RadioGroup, 33 | CheckboxItem, 34 | // 35 | Root as ContextMenu, 36 | Sub as ContextMenuSub, 37 | Item as ContextMenuItem, 38 | Label as ContextMenuLabel, 39 | Group as ContextMenuGroup, 40 | Content as ContextMenuContent, 41 | Trigger as ContextMenuTrigger, 42 | Shortcut as ContextMenuShortcut, 43 | RadioItem as ContextMenuRadioItem, 44 | Separator as ContextMenuSeparator, 45 | RadioGroup as ContextMenuRadioGroup, 46 | SubContent as ContextMenuSubContent, 47 | SubTrigger as ContextMenuSubTrigger, 48 | CheckboxItem as ContextMenuCheckboxItem 49 | }; 50 | -------------------------------------------------------------------------------- /src/lib/components/ui/dialog/dialog-content.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 28 | 29 | 32 | 33 | Close 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/lib/components/ui/dialog/dialog-description.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/lib/components/ui/dialog/dialog-footer.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
    18 | 19 |
    20 | -------------------------------------------------------------------------------- /src/lib/components/ui/dialog/dialog-header.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 |
    15 | 16 |
    17 | -------------------------------------------------------------------------------- /src/lib/components/ui/dialog/dialog-overlay.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 25 | -------------------------------------------------------------------------------- /src/lib/components/ui/dialog/dialog-portal.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/lib/components/ui/dialog/dialog-title.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/lib/components/ui/dialog/index.ts: -------------------------------------------------------------------------------- 1 | import { Dialog as DialogPrimitive } from "bits-ui"; 2 | 3 | const Root = DialogPrimitive.Root; 4 | const Trigger = DialogPrimitive.Trigger; 5 | 6 | import Title from "./dialog-title.svelte"; 7 | import Portal from "./dialog-portal.svelte"; 8 | import Footer from "./dialog-footer.svelte"; 9 | import Header from "./dialog-header.svelte"; 10 | import Overlay from "./dialog-overlay.svelte"; 11 | import Content from "./dialog-content.svelte"; 12 | import Description from "./dialog-description.svelte"; 13 | 14 | export { 15 | Root, 16 | Title, 17 | Portal, 18 | Footer, 19 | Header, 20 | Trigger, 21 | Overlay, 22 | Content, 23 | Description, 24 | // 25 | Root as Dialog, 26 | Title as DialogTitle, 27 | Portal as DialogPortal, 28 | Footer as DialogFooter, 29 | Header as DialogHeader, 30 | Trigger as DialogTrigger, 31 | Overlay as DialogOverlay, 32 | Content as DialogContent, 33 | Description as DialogDescription 34 | }; 35 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/lib/components/ui/dropdown-menu/index.ts: -------------------------------------------------------------------------------- 1 | import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; 2 | import Item from "./dropdown-menu-item.svelte"; 3 | import Label from "./dropdown-menu-label.svelte"; 4 | import Content from "./dropdown-menu-content.svelte"; 5 | import Shortcut from "./dropdown-menu-shortcut.svelte"; 6 | import RadioItem from "./dropdown-menu-radio-item.svelte"; 7 | import Separator from "./dropdown-menu-separator.svelte"; 8 | import RadioGroup from "./dropdown-menu-radio-group.svelte"; 9 | import SubContent from "./dropdown-menu-sub-content.svelte"; 10 | import SubTrigger from "./dropdown-menu-sub-trigger.svelte"; 11 | import CheckboxItem from "./dropdown-menu-checkbox-item.svelte"; 12 | 13 | const Sub = DropdownMenuPrimitive.Sub; 14 | const Root = DropdownMenuPrimitive.Root; 15 | const Trigger = DropdownMenuPrimitive.Trigger; 16 | const Group = DropdownMenuPrimitive.Group; 17 | 18 | export { 19 | Sub, 20 | Root, 21 | Item, 22 | Label, 23 | Group, 24 | Trigger, 25 | Content, 26 | Shortcut, 27 | Separator, 28 | RadioItem, 29 | SubContent, 30 | SubTrigger, 31 | RadioGroup, 32 | CheckboxItem, 33 | // 34 | Root as DropdownMenu, 35 | Sub as DropdownMenuSub, 36 | Item as DropdownMenuItem, 37 | Label as DropdownMenuLabel, 38 | Group as DropdownMenuGroup, 39 | Content as DropdownMenuContent, 40 | Trigger as DropdownMenuTrigger, 41 | Shortcut as DropdownMenuShortcut, 42 | RadioItem as DropdownMenuRadioItem, 43 | Separator as DropdownMenuSeparator, 44 | RadioGroup as DropdownMenuRadioGroup, 45 | SubContent as DropdownMenuSubContent, 46 | SubTrigger as DropdownMenuSubTrigger, 47 | CheckboxItem as DropdownMenuCheckboxItem 48 | }; 49 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-button.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-checkbox.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | { 18 | onCheckedChange?.(v); 19 | setValue(v); 20 | }} 21 | {...$$restProps} 22 | on:click 23 | on:keydown 24 | /> 25 | 26 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-description.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-input.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 29 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-item.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 |
    11 | 12 |
    13 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-label.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-native-select.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-radio-group.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | { 15 | onValueChange?.(v); 16 | setValue(v); 17 | }} 18 | {...$$restProps} 19 | > 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-select-trigger.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-select.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | { 13 | onSelectedChange?.(v); 14 | setValue(v ? v.value : undefined); 15 | }} 16 | {...$$restProps} 17 | > 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-switch.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | { 17 | onCheckedChange?.(v); 18 | setValue(v); 19 | }} 20 | {...$$restProps} 21 | on:click 22 | on:keydown 23 | /> 24 | 25 | -------------------------------------------------------------------------------- /src/lib/components/ui/form/form-textarea.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 |