From ffea80849f029b932e2dfb9f52267ffb45e38639 Mon Sep 17 00:00:00 2001 From: Aritra Mondal Date: Thu, 5 Dec 2024 23:30:31 +0100 Subject: [PATCH 01/23] feat: update bits ui and add @internationalization --- package-lock.json | 9 +++++---- package.json | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35ed689..3b47f29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,13 +23,14 @@ "pg": "^8.13.1" }, "devDependencies": { + "@internationalized/date": "^3.6.0", "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^4.0.0", "@types/eslint": "^9.6.0", "@types/pg": "^8.11.10", "autoprefixer": "^10.4.20", - "bits-ui": "^1.0.0-next.64", + "bits-ui": "^1.0.0-next.65", "clsx": "^2.1.1", "drizzle-kit": "^0.25.0", "eslint": "^9.7.0", @@ -2215,9 +2216,9 @@ } }, "node_modules/bits-ui": { - "version": "1.0.0-next.64", - "resolved": "https://registry.npmjs.org/bits-ui/-/bits-ui-1.0.0-next.64.tgz", - "integrity": "sha512-r1JThjUSKwTkaB1onwIs7ZQoqygSsWhjBaUElCS8m8CCbY1RxmTz0HnbN+Xp2oJgJ4YQgIfiXTG3170l80FEgg==", + "version": "1.0.0-next.65", + "resolved": "https://registry.npmjs.org/bits-ui/-/bits-ui-1.0.0-next.65.tgz", + "integrity": "sha512-6pJ2dYP28kkYhvXKyUh22ocTyzciRrx752FJ8+oKUDQ07qnP4O/D8oAFo9pbZVU1MJ3wSMTXkpOVI/DrkJhChQ==", "dev": true, "dependencies": { "@floating-ui/core": "^1.6.4", diff --git a/package.json b/package.json index 9c56380..7a7f490 100644 --- a/package.json +++ b/package.json @@ -12,18 +12,19 @@ "lint": "prettier --check . && eslint .", "test:unit": "vitest", "test": "npm run test:unit -- --run", - "db:generate": "drizzle-kit generate", - "db:migrate": "drizzle-kit migrate", - "db:studio": "drizzle-kit studio" + "db:generate": "drizzle-kit --config=drizzle.config.ts generate", + "db:migrate": "drizzle-kit --config=drizzle.config.ts migrate", + "db:studio": "drizzle-kit --config=drizzle.config.ts studio" }, "devDependencies": { + "@internationalized/date": "^3.6.0", "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^4.0.0", "@types/eslint": "^9.6.0", "@types/pg": "^8.11.10", "autoprefixer": "^10.4.20", - "bits-ui": "^1.0.0-next.64", + "bits-ui": "^1.0.0-next.65", "clsx": "^2.1.1", "drizzle-kit": "^0.25.0", "eslint": "^9.7.0", From f8a1465c158f65f213b26864aa93193564949546 Mon Sep 17 00:00:00 2001 From: Aritra Mondal Date: Thu, 5 Dec 2024 23:30:40 +0100 Subject: [PATCH 02/23] feat: add drizzle config --- drizzle.config.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 drizzle.config.ts diff --git a/drizzle.config.ts b/drizzle.config.ts new file mode 100644 index 0000000..6b9a518 --- /dev/null +++ b/drizzle.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'drizzle-kit'; + +export default defineConfig({ + schema: './src/lib/db/schema.ts', + out: './src/lib/db/migrations', + dialect: 'postgresql', + dbCredentials: { + url: process.env.SECRET_XATA_PG_ENDPOINT! + }, + verbose: true, + strict: true +}); From 48ecd08225010c35eddcce4acb579c0c8251e7a3 Mon Sep 17 00:00:00 2001 From: Aritra Mondal Date: Thu, 5 Dec 2024 23:31:10 +0100 Subject: [PATCH 03/23] shadcn: add calendar --- .../ui/calendar/calendar-cell.svelte | 19 ++++++ .../ui/calendar/calendar-day.svelte | 31 ++++++++++ .../ui/calendar/calendar-grid-body.svelte | 12 ++++ .../ui/calendar/calendar-grid-head.svelte | 12 ++++ .../ui/calendar/calendar-grid-row.svelte | 12 ++++ .../ui/calendar/calendar-grid.svelte | 16 +++++ .../ui/calendar/calendar-head-cell.svelte | 16 +++++ .../ui/calendar/calendar-header.svelte | 16 +++++ .../ui/calendar/calendar-heading.svelte | 12 ++++ .../ui/calendar/calendar-months.svelte | 20 ++++++ .../ui/calendar/calendar-next-button.svelte | 28 +++++++++ .../ui/calendar/calendar-prev-button.svelte | 28 +++++++++ .../components/ui/calendar/calendar.svelte | 61 +++++++++++++++++++ src/lib/components/ui/calendar/index.ts | 30 +++++++++ 14 files changed, 313 insertions(+) create mode 100644 src/lib/components/ui/calendar/calendar-cell.svelte create mode 100644 src/lib/components/ui/calendar/calendar-day.svelte create mode 100644 src/lib/components/ui/calendar/calendar-grid-body.svelte create mode 100644 src/lib/components/ui/calendar/calendar-grid-head.svelte create mode 100644 src/lib/components/ui/calendar/calendar-grid-row.svelte create mode 100644 src/lib/components/ui/calendar/calendar-grid.svelte create mode 100644 src/lib/components/ui/calendar/calendar-head-cell.svelte create mode 100644 src/lib/components/ui/calendar/calendar-header.svelte create mode 100644 src/lib/components/ui/calendar/calendar-heading.svelte create mode 100644 src/lib/components/ui/calendar/calendar-months.svelte create mode 100644 src/lib/components/ui/calendar/calendar-next-button.svelte create mode 100644 src/lib/components/ui/calendar/calendar-prev-button.svelte create mode 100644 src/lib/components/ui/calendar/calendar.svelte create mode 100644 src/lib/components/ui/calendar/index.ts diff --git a/src/lib/components/ui/calendar/calendar-cell.svelte b/src/lib/components/ui/calendar/calendar-cell.svelte new file mode 100644 index 0000000..8f3f766 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-cell.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-day.svelte b/src/lib/components/ui/calendar/calendar-day.svelte new file mode 100644 index 0000000..e9be9c0 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-day.svelte @@ -0,0 +1,31 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-grid-body.svelte b/src/lib/components/ui/calendar/calendar-grid-body.svelte new file mode 100644 index 0000000..8cd86de --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-grid-body.svelte @@ -0,0 +1,12 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-grid-head.svelte b/src/lib/components/ui/calendar/calendar-grid-head.svelte new file mode 100644 index 0000000..333edc4 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-grid-head.svelte @@ -0,0 +1,12 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-grid-row.svelte b/src/lib/components/ui/calendar/calendar-grid-row.svelte new file mode 100644 index 0000000..9032236 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-grid-row.svelte @@ -0,0 +1,12 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-grid.svelte b/src/lib/components/ui/calendar/calendar-grid.svelte new file mode 100644 index 0000000..1d7edb5 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-grid.svelte @@ -0,0 +1,16 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-head-cell.svelte b/src/lib/components/ui/calendar/calendar-head-cell.svelte new file mode 100644 index 0000000..4e75040 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-head-cell.svelte @@ -0,0 +1,16 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-header.svelte b/src/lib/components/ui/calendar/calendar-header.svelte new file mode 100644 index 0000000..e64feae --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-header.svelte @@ -0,0 +1,16 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-heading.svelte b/src/lib/components/ui/calendar/calendar-heading.svelte new file mode 100644 index 0000000..5d57a50 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-heading.svelte @@ -0,0 +1,12 @@ + + + diff --git a/src/lib/components/ui/calendar/calendar-months.svelte b/src/lib/components/ui/calendar/calendar-months.svelte new file mode 100644 index 0000000..4cd0ed7 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-months.svelte @@ -0,0 +1,20 @@ + + +
+ {@render children?.()} +
diff --git a/src/lib/components/ui/calendar/calendar-next-button.svelte b/src/lib/components/ui/calendar/calendar-next-button.svelte new file mode 100644 index 0000000..3eaff6f --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-next-button.svelte @@ -0,0 +1,28 @@ + + +{#snippet Fallback()} + +{/snippet} + + diff --git a/src/lib/components/ui/calendar/calendar-prev-button.svelte b/src/lib/components/ui/calendar/calendar-prev-button.svelte new file mode 100644 index 0000000..77430c9 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar-prev-button.svelte @@ -0,0 +1,28 @@ + + +{#snippet Fallback()} + +{/snippet} + + diff --git a/src/lib/components/ui/calendar/calendar.svelte b/src/lib/components/ui/calendar/calendar.svelte new file mode 100644 index 0000000..16bebd7 --- /dev/null +++ b/src/lib/components/ui/calendar/calendar.svelte @@ -0,0 +1,61 @@ + + + + + {#snippet children({ months, weekdays })} + + + + + + + {#each months as month} + + + + {#each weekdays as weekday} + + {weekday.slice(0, 2)} + + {/each} + + + + {#each month.weeks as weekDates} + + {#each weekDates as date} + + + + {/each} + + {/each} + + + {/each} + + {/snippet} + diff --git a/src/lib/components/ui/calendar/index.ts b/src/lib/components/ui/calendar/index.ts new file mode 100644 index 0000000..ab257ab --- /dev/null +++ b/src/lib/components/ui/calendar/index.ts @@ -0,0 +1,30 @@ +import Root from "./calendar.svelte"; +import Cell from "./calendar-cell.svelte"; +import Day from "./calendar-day.svelte"; +import Grid from "./calendar-grid.svelte"; +import Header from "./calendar-header.svelte"; +import Months from "./calendar-months.svelte"; +import GridRow from "./calendar-grid-row.svelte"; +import Heading from "./calendar-heading.svelte"; +import GridBody from "./calendar-grid-body.svelte"; +import GridHead from "./calendar-grid-head.svelte"; +import HeadCell from "./calendar-head-cell.svelte"; +import NextButton from "./calendar-next-button.svelte"; +import PrevButton from "./calendar-prev-button.svelte"; + +export { + Day, + Cell, + Grid, + Header, + Months, + GridRow, + Heading, + GridBody, + GridHead, + HeadCell, + NextButton, + PrevButton, + // + Root as Calendar, +}; From c9e32569aafadabcf42da66daf7d24ffb804f2f6 Mon Sep 17 00:00:00 2001 From: Aritra Mondal Date: Thu, 5 Dec 2024 23:31:46 +0100 Subject: [PATCH 04/23] shadcn: update input (add input type time) --- src/lib/components/ui/input/input.svelte | 38 ++++++++++++++++-------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/lib/components/ui/input/input.svelte b/src/lib/components/ui/input/input.svelte index 08c3faf..37ef6c9 100644 --- a/src/lib/components/ui/input/input.svelte +++ b/src/lib/components/ui/input/input.svelte @@ -1,5 +1,6 @@
-
- {label} - - {#if restProps['required']}*{/if} - +
+
+ {label} + + {#if restProps['required']}*{/if} + +
+
- + {#if restProps['type'] === 'time'} +
+ +
+ {/if}
+ + From 53f536542e5fc021b40a12ca3841ce8d6bfd949b Mon Sep 17 00:00:00 2001 From: Aritra Mondal Date: Thu, 5 Dec 2024 23:31:53 +0100 Subject: [PATCH 05/23] feat: add message components --- .../ui/messages/message-delete.svelte | 39 ++++ .../ui/messages/message-form.svelte | 185 ++++++++++++++++++ .../ui/messages/project-card.svelte | 64 ++++++ 3 files changed, 288 insertions(+) create mode 100644 src/lib/components/ui/messages/message-delete.svelte create mode 100644 src/lib/components/ui/messages/message-form.svelte create mode 100644 src/lib/components/ui/messages/project-card.svelte diff --git a/src/lib/components/ui/messages/message-delete.svelte b/src/lib/components/ui/messages/message-delete.svelte new file mode 100644 index 0000000..e653c44 --- /dev/null +++ b/src/lib/components/ui/messages/message-delete.svelte @@ -0,0 +1,39 @@ + + +{#if selectedMessage} +
+
+ Delete - {selectedMessage.title} ? +
+ +
+{/if} diff --git a/src/lib/components/ui/messages/message-form.svelte b/src/lib/components/ui/messages/message-form.svelte new file mode 100644 index 0000000..60088fd --- /dev/null +++ b/src/lib/components/ui/messages/message-form.svelte @@ -0,0 +1,185 @@ + + +
+ {#if formError} +
+
+ + {formError} +
+
+ {/if} + + + {triggerContent} + + + + {#each websiteOptions as websiteOption} + + {websiteOption.label} + + {/each} + + + + + +
+
+ + + {#snippet child({ props })} + + {/snippet} + + + + + +
+
+ +
+
+