Skip to content

Commit fbd48ae

Browse files
committed
initial commit
0 parents  commit fbd48ae

22 files changed

+4216
-0
lines changed

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
.netlify
7+
.wrangler
8+
/.svelte-kit
9+
/build
10+
11+
# OS
12+
.DS_Store
13+
Thumbs.db
14+
15+
# Env
16+
.env
17+
.env.*
18+
!.env.example
19+
!.env.test
20+
21+
# Vite
22+
vite.config.js.timestamp-*
23+
vite.config.ts.timestamp-*
24+
25+
# Yarn
26+
.yarn/*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock

.prettierrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"useTabs": true,
5+
"semi": true,
6+
"singleQuote": true,
7+
"quoteProps": "as-needed",
8+
"jsxSingleQuote": true,
9+
"trailingComma": "all",
10+
"bracketSpacing": true,
11+
"bracketSameLine": true,
12+
"arrowParens": "always",
13+
"singleAttributePerLine": true,
14+
"plugins": ["prettier-plugin-svelte"],
15+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
16+
}

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

components.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://next.shadcn-svelte.com/schema.json",
3+
"style": "default",
4+
"tailwind": {
5+
"config": "tailwind.config.ts",
6+
"css": "src/app.css",
7+
"baseColor": "zinc"
8+
},
9+
"aliases": {
10+
"components": "$shared/components",
11+
"utils": "$shared/utils",
12+
"ui": "$shared/components/ui",
13+
"hooks": "$shared/hooks"
14+
},
15+
"typescript": true,
16+
"registry": "https://next.shadcn-svelte.com/registry"
17+
}

eslint.config.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import prettier from 'eslint-config-prettier';
2+
import js from '@eslint/js';
3+
import { includeIgnoreFile } from '@eslint/compat';
4+
import svelte from 'eslint-plugin-svelte';
5+
import globals from 'globals';
6+
import { fileURLToPath } from 'node:url';
7+
import ts from 'typescript-eslint';
8+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
9+
10+
export default ts.config(
11+
includeIgnoreFile(gitignorePath),
12+
js.configs.recommended,
13+
...ts.configs.recommended,
14+
...svelte.configs['flat/recommended'],
15+
prettier,
16+
...svelte.configs['flat/prettier'],
17+
{
18+
languageOptions: {
19+
globals: {
20+
...globals.browser,
21+
...globals.node,
22+
},
23+
},
24+
},
25+
{
26+
files: ['**/*.svelte'],
27+
28+
languageOptions: {
29+
parserOptions: {
30+
parser: ts.parser,
31+
},
32+
},
33+
},
34+
{
35+
ignores: ['build/', '.svelte-kit/', 'dist/'],
36+
},
37+
);

package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "mm-frontend",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev",
8+
"build": "vite build",
9+
"preview": "vite preview",
10+
"prepare": "svelte-kit sync || echo ''",
11+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
13+
"format": "prettier --write .",
14+
"lint": "prettier --check . && eslint ."
15+
},
16+
"devDependencies": {
17+
"@eslint/compat": "^1.2.5",
18+
"@eslint/js": "^9.18.0",
19+
"@sveltejs/adapter-auto": "^4.0.0",
20+
"@sveltejs/kit": "^2.16.0",
21+
"@sveltejs/vite-plugin-svelte": "^5.0.0",
22+
"@tailwindcss/container-queries": "^0.1.1",
23+
"@tailwindcss/forms": "^0.5.10",
24+
"@tailwindcss/typography": "^0.5.16",
25+
"autoprefixer": "^10.4.20",
26+
"bits-ui": "^1.3.4",
27+
"clsx": "^2.1.1",
28+
"eslint": "^9.18.0",
29+
"eslint-config-prettier": "^10.0.1",
30+
"eslint-plugin-svelte": "^2.46.1",
31+
"globals": "^15.14.0",
32+
"prettier": "^3.4.2",
33+
"prettier-plugin-svelte": "^3.3.3",
34+
"prettier-plugin-tailwindcss": "^0.6.10",
35+
"svelte": "^5.0.0",
36+
"svelte-check": "^4.0.0",
37+
"tailwind-merge": "^3.0.2",
38+
"tailwind-variants": "^0.3.1",
39+
"tailwindcss": "^3.4.17",
40+
"tailwindcss-animate": "^1.0.7",
41+
"typescript": "^5.0.0",
42+
"typescript-eslint": "^8.20.0",
43+
"vite": "^6.0.0"
44+
}
45+
}

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

src/app.css

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
@layer base {
6+
:root {
7+
--background: 0 0% 100%;
8+
--foreground: 240 10% 3.9%;
9+
--muted: 240 4.8% 95.9%;
10+
--muted-foreground: 240 3.8% 46.1%;
11+
--popover: 0 0% 100%;
12+
--popover-foreground: 240 10% 3.9%;
13+
--card: 0 0% 100%;
14+
--card-foreground: 240 10% 3.9%;
15+
--border: 240 5.9% 90%;
16+
--input: 240 5.9% 90%;
17+
--primary: 240 5.9% 10%;
18+
--primary-foreground: 0 0% 98%;
19+
--secondary: 240 4.8% 95.9%;
20+
--secondary-foreground: 240 5.9% 10%;
21+
--accent: 240 4.8% 95.9%;
22+
--accent-foreground: 240 5.9% 10%;
23+
--destructive: 0 72.2% 50.6%;
24+
--destructive-foreground: 0 0% 98%;
25+
--ring: 240 10% 3.9%;
26+
--radius: 0.5rem;
27+
--sidebar-background: 0 0% 98%;
28+
--sidebar-foreground: 240 5.3% 26.1%;
29+
--sidebar-primary: 240 5.9% 10%;
30+
--sidebar-primary-foreground: 0 0% 98%;
31+
--sidebar-accent: 240 4.8% 95.9%;
32+
--sidebar-accent-foreground: 240 5.9% 10%;
33+
--sidebar-border: 220 13% 91%;
34+
--sidebar-ring: 217.2 91.2% 59.8%;
35+
}
36+
37+
.dark {
38+
--background: 240 10% 3.9%;
39+
--foreground: 0 0% 98%;
40+
--muted: 240 3.7% 15.9%;
41+
--muted-foreground: 240 5% 64.9%;
42+
--popover: 240 10% 3.9%;
43+
--popover-foreground: 0 0% 98%;
44+
--card: 240 10% 3.9%;
45+
--card-foreground: 0 0% 98%;
46+
--border: 240 3.7% 15.9%;
47+
--input: 240 3.7% 15.9%;
48+
--primary: 0 0% 98%;
49+
--primary-foreground: 240 5.9% 10%;
50+
--secondary: 240 3.7% 15.9%;
51+
--secondary-foreground: 0 0% 98%;
52+
--accent: 240 3.7% 15.9%;
53+
--accent-foreground: 0 0% 98%;
54+
--destructive: 0 62.8% 30.6%;
55+
--destructive-foreground: 0 0% 98%;
56+
--ring: 240 4.9% 83.9%;
57+
--sidebar-background: 240 5.9% 10%;
58+
--sidebar-foreground: 240 4.8% 95.9%;
59+
--sidebar-primary: 224.3 76.3% 48%;
60+
--sidebar-primary-foreground: 0 0% 100%;
61+
--sidebar-accent: 240 3.7% 15.9%;
62+
--sidebar-accent-foreground: 240 4.8% 95.9%;
63+
--sidebar-border: 240 3.7% 15.9%;
64+
--sidebar-ring: 217.2 91.2% 59.8%;
65+
}
66+
}
67+
68+
@layer base {
69+
* {
70+
@apply border-border;
71+
}
72+
body {
73+
@apply bg-background text-foreground;
74+
}
75+
}

src/app.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// See https://svelte.dev/docs/kit/types#app.d.ts
2+
// for information about these interfaces
3+
declare global {
4+
namespace App {
5+
// interface Error {}
6+
// interface Locals {}
7+
// interface PageData {}
8+
// interface PageState {}
9+
// interface Platform {}
10+
}
11+
}
12+
13+
export {};

src/app.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link
6+
rel="icon"
7+
href="%sveltekit.assets%/favicon.png" />
8+
<meta
9+
name="viewport"
10+
content="width=device-width, initial-scale=1" />
11+
%sveltekit.head%
12+
</head>
13+
<body data-sveltekit-preload-data="hover">
14+
<div style="display: contents">%sveltekit.body%</div>
15+
</body>
16+
</html>

src/routes/+layout.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script lang="ts">
2+
import '../app.css';
3+
let { children } = $props();
4+
</script>
5+
6+
{@render children()}

src/routes/+page.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
import { Button } from '$shared/components/ui/button';
3+
</script>
4+
5+
<h1>Welcome to SvelteKit</h1>
6+
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>
7+
8+
<Button>Aboba</Button>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<script
2+
lang="ts"
3+
module>
4+
import type { WithElementRef } from 'bits-ui';
5+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
6+
import { type VariantProps, tv } from 'tailwind-variants';
7+
8+
export const buttonVariants = tv({
9+
base: 'ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
10+
variants: {
11+
variant: {
12+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
13+
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
14+
outline: 'border-input bg-background hover:bg-accent hover:text-accent-foreground border',
15+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
16+
ghost: 'hover:bg-accent hover:text-accent-foreground',
17+
link: 'text-primary underline-offset-4 hover:underline',
18+
},
19+
size: {
20+
default: 'h-10 px-4 py-2',
21+
sm: 'h-9 rounded-md px-3',
22+
lg: 'h-11 rounded-md px-8',
23+
icon: 'h-10 w-10',
24+
},
25+
},
26+
defaultVariants: {
27+
variant: 'default',
28+
size: 'default',
29+
},
30+
});
31+
32+
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
33+
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
34+
35+
export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
36+
WithElementRef<HTMLAnchorAttributes> & {
37+
variant?: ButtonVariant;
38+
size?: ButtonSize;
39+
};
40+
</script>
41+
42+
<script lang="ts">
43+
import { cn } from '$shared/utils.js';
44+
45+
let {
46+
class: className,
47+
variant = 'default',
48+
size = 'default',
49+
ref = $bindable(null),
50+
href = undefined,
51+
type = 'button',
52+
children,
53+
...restProps
54+
}: ButtonProps = $props();
55+
</script>
56+
57+
{#if href}
58+
<a
59+
bind:this={ref}
60+
class={cn(buttonVariants({ variant, size }), className)}
61+
{href}
62+
{...restProps}>
63+
{@render children?.()}
64+
</a>
65+
{:else}
66+
<button
67+
bind:this={ref}
68+
class={cn(buttonVariants({ variant, size }), className)}
69+
{type}
70+
{...restProps}>
71+
{@render children?.()}
72+
</button>
73+
{/if}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Root, {
2+
type ButtonProps,
3+
type ButtonSize,
4+
type ButtonVariant,
5+
buttonVariants,
6+
} from './button.svelte';
7+
8+
export {
9+
Root,
10+
type ButtonProps as Props,
11+
//
12+
Root as Button,
13+
buttonVariants,
14+
type ButtonProps,
15+
type ButtonSize,
16+
type ButtonVariant,
17+
};

src/shared/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { type ClassValue, clsx } from 'clsx';
2+
import { twMerge } from 'tailwind-merge';
3+
4+
export function cn(...inputs: ClassValue[]) {
5+
return twMerge(clsx(inputs));
6+
}

0 commit comments

Comments
 (0)