create-croissant 0.1.39 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/template/README.md +4 -4
- package/template/apps/desktop/electron-builder.yml +6 -6
- package/template/apps/desktop/electron.vite.config.ts +8 -8
- package/template/apps/desktop/package.json +5 -5
- package/template/apps/desktop/src/main/index.ts +32 -32
- package/template/apps/desktop/src/preload/index.d.ts +3 -3
- package/template/apps/desktop/src/preload/index.ts +8 -8
- package/template/apps/desktop/src/renderer/src/App.tsx +5 -5
- package/template/apps/desktop/src/renderer/src/assets/base.css +4 -4
- package/template/apps/desktop/src/renderer/src/assets/main.css +3 -3
- package/template/apps/desktop/src/renderer/src/components/Versions.tsx +4 -4
- package/template/apps/desktop/src/renderer/src/main.tsx +7 -7
- package/template/apps/desktop/tsconfig.json +1 -4
- package/template/apps/desktop/tsconfig.node.json +7 -1
- package/template/apps/desktop/tsconfig.web.json +3 -9
- package/template/apps/mobile/app/(tabs)/_layout.tsx +11 -10
- package/template/apps/mobile/app/(tabs)/explore.tsx +29 -27
- package/template/apps/mobile/app/(tabs)/index.tsx +25 -24
- package/template/apps/mobile/app/_layout.tsx +8 -8
- package/template/apps/mobile/app/modal.tsx +6 -6
- package/template/apps/mobile/components/external-link.tsx +5 -5
- package/template/apps/mobile/components/haptic-tab.tsx +4 -4
- package/template/apps/mobile/components/hello-wave.tsx +5 -4
- package/template/apps/mobile/components/parallax-scroll-view.tsx +15 -13
- package/template/apps/mobile/components/themed-text.tsx +14 -14
- package/template/apps/mobile/components/themed-view.tsx +3 -3
- package/template/apps/mobile/components/ui/collapsible.tsx +14 -13
- package/template/apps/mobile/components/ui/icon-symbol.ios.tsx +4 -4
- package/template/apps/mobile/components/ui/icon-symbol.tsx +9 -9
- package/template/apps/mobile/constants/theme.ts +19 -19
- package/template/apps/mobile/hooks/use-color-scheme.ts +1 -1
- package/template/apps/mobile/hooks/use-color-scheme.web.ts +3 -3
- package/template/apps/mobile/hooks/use-theme-color.ts +4 -4
- package/template/apps/mobile/package.json +3 -3
- package/template/apps/mobile/scripts/reset-project.js +2 -2
- package/template/apps/mobile/tsconfig.json +2 -9
- package/template/apps/platform/drizzle.config.ts +5 -5
- package/template/apps/platform/package.json +4 -4
- package/template/apps/platform/src/components/app-sidebar.tsx +60 -69
- package/template/apps/platform/src/components/login-form.tsx +32 -39
- package/template/apps/platform/src/components/search-form.tsx +5 -13
- package/template/apps/platform/src/components/signup-form.tsx +39 -49
- package/template/apps/platform/src/components/version-switcher.tsx +11 -21
- package/template/apps/platform/src/lib/auth-utils.ts +12 -14
- package/template/apps/platform/src/lib/orpc.ts +17 -17
- package/template/apps/platform/src/router.tsx +5 -5
- package/template/apps/platform/src/routes/__root.tsx +13 -15
- package/template/apps/platform/src/routes/_auth/account.tsx +61 -50
- package/template/apps/platform/src/routes/_auth/dashboard.tsx +17 -17
- package/template/apps/platform/src/routes/_auth/examples/client-orpc-auth.tsx +13 -13
- package/template/apps/platform/src/routes/_auth/examples/ssr-orpc-auth.tsx +16 -16
- package/template/apps/platform/src/routes/_auth.tsx +5 -5
- package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +108 -88
- package/template/apps/platform/src/routes/_public/examples/isr.tsx +14 -14
- package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +92 -75
- package/template/apps/platform/src/routes/_public/index.tsx +22 -19
- package/template/apps/platform/src/routes/_public/login.tsx +4 -4
- package/template/apps/platform/src/routes/_public/signup.tsx +6 -5
- package/template/apps/platform/src/routes/_public.tsx +5 -5
- package/template/apps/platform/src/routes/api/auth/$.ts +13 -13
- package/template/apps/platform/src/routes/api/rpc.$.ts +13 -13
- package/template/apps/platform/vite.config.ts +8 -8
- package/template/docker-compose.yml +1 -1
- package/template/package.json +24 -22
- package/template/packages/auth/package.json +9 -9
- package/template/packages/auth/src/lib/auth.ts +1 -1
- package/template/packages/db/package.json +7 -7
- package/template/packages/db/src/index.ts +4 -4
- package/template/packages/db/src/schema.ts +2 -2
- package/template/packages/orpc/package.json +6 -6
- package/template/packages/orpc/src/lib/planets.ts +39 -43
- package/template/packages/orpc/src/lib/router.ts +15 -15
- package/template/packages/ui/package.json +10 -10
- package/template/packages/ui/src/components/accordion.tsx +20 -22
- package/template/packages/ui/src/components/alert-dialog.tsx +31 -56
- package/template/packages/ui/src/components/alert.tsx +15 -23
- package/template/packages/ui/src/components/aspect-ratio.tsx +3 -3
- package/template/packages/ui/src/components/avatar.tsx +19 -35
- package/template/packages/ui/src/components/badge.tsx +13 -17
- package/template/packages/ui/src/components/breadcrumb.tsx +22 -44
- package/template/packages/ui/src/components/button-group.tsx +16 -25
- package/template/packages/ui/src/components/button.tsx +8 -9
- package/template/packages/ui/src/components/calendar.tsx +43 -82
- package/template/packages/ui/src/components/card.tsx +15 -26
- package/template/packages/ui/src/components/carousel.tsx +70 -78
- package/template/packages/ui/src/components/chart.tsx +84 -117
- package/template/packages/ui/src/components/checkbox.tsx +8 -9
- package/template/packages/ui/src/components/collapsible.tsx +5 -9
- package/template/packages/ui/src/components/combobox.tsx +44 -68
- package/template/packages/ui/src/components/command.tsx +32 -47
- package/template/packages/ui/src/components/context-menu.tsx +45 -71
- package/template/packages/ui/src/components/dialog.tsx +29 -51
- package/template/packages/ui/src/components/direction.tsx +1 -4
- package/template/packages/ui/src/components/drawer.tsx +24 -38
- package/template/packages/ui/src/components/dropdown-menu.tsx +45 -55
- package/template/packages/ui/src/components/empty.tsx +16 -27
- package/template/packages/ui/src/components/field.tsx +49 -63
- package/template/packages/ui/src/components/hover-card.tsx +9 -14
- package/template/packages/ui/src/components/input-group.tsx +40 -52
- package/template/packages/ui/src/components/input-otp.tsx +17 -18
- package/template/packages/ui/src/components/input.tsx +6 -6
- package/template/packages/ui/src/components/item.tsx +31 -44
- package/template/packages/ui/src/components/kbd.tsx +5 -5
- package/template/packages/ui/src/components/label.tsx +6 -6
- package/template/packages/ui/src/components/menubar.tsx +51 -64
- package/template/packages/ui/src/components/mode-toggle.tsx +9 -15
- package/template/packages/ui/src/components/native-select.tsx +18 -24
- package/template/packages/ui/src/components/navigation-menu.tsx +28 -35
- package/template/packages/ui/src/components/pagination.tsx +19 -31
- package/template/packages/ui/src/components/popover.tsx +13 -26
- package/template/packages/ui/src/components/progress.tsx +13 -30
- package/template/packages/ui/src/components/radio-group.tsx +7 -7
- package/template/packages/ui/src/components/resizable.tsx +12 -20
- package/template/packages/ui/src/components/scroll-area.tsx +8 -12
- package/template/packages/ui/src/components/select.tsx +31 -42
- package/template/packages/ui/src/components/separator.tsx +6 -10
- package/template/packages/ui/src/components/sheet.tsx +25 -38
- package/template/packages/ui/src/components/sidebar.tsx +137 -170
- package/template/packages/ui/src/components/skeleton.tsx +3 -3
- package/template/packages/ui/src/components/slider.tsx +5 -5
- package/template/packages/ui/src/components/sonner.tsx +20 -24
- package/template/packages/ui/src/components/spinner.tsx +10 -5
- package/template/packages/ui/src/components/switch.tsx +6 -6
- package/template/packages/ui/src/components/table.tsx +18 -45
- package/template/packages/ui/src/components/tabs.tsx +14 -22
- package/template/packages/ui/src/components/textarea.tsx +5 -5
- package/template/packages/ui/src/components/theme-provider.tsx +43 -48
- package/template/packages/ui/src/components/toggle-group.tsx +18 -20
- package/template/packages/ui/src/components/toggle.tsx +9 -10
- package/template/packages/ui/src/components/tooltip.tsx +10 -22
- package/template/packages/ui/src/hooks/use-mobile.ts +11 -11
- package/template/packages/ui/src/lib/utils.ts +4 -4
- package/template/packages/ui/src/styles/globals.css +106 -106
- package/template/turbo.json +15 -6
- package/template/.prettierignore +0 -10
- package/template/apps/desktop/.prettierignore +0 -6
- package/template/apps/desktop/eslint.config.ts +0 -11
- package/template/apps/desktop/prettier.config.ts +0 -3
- package/template/apps/mobile/eslint.config.js +0 -10
- package/template/apps/platform/eslint.config.ts +0 -11
- package/template/apps/platform/prettier.config.ts +0 -3
- package/template/packages/auth/eslint.config.ts +0 -3
- package/template/packages/auth/prettier.config.ts +0 -3
- package/template/packages/config-eslint/index.ts +0 -24
- package/template/packages/config-eslint/package.json +0 -11
- package/template/packages/config-prettier/index.ts +0 -14
- package/template/packages/config-prettier/package.json +0 -7
- package/template/packages/db/eslint.config.ts +0 -3
- package/template/packages/db/prettier.config.ts +0 -3
- package/template/packages/orpc/eslint.config.ts +0 -3
- package/template/packages/orpc/prettier.config.ts +0 -3
- package/template/packages/ui/eslint.config.ts +0 -3
- package/template/packages/ui/prettier.config.ts +0 -3
- package/template/prettier.config.ts +0 -15
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workspace/auth",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
4
|
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./lib/*": "./src/lib/*.ts",
|
|
8
|
+
"./hooks/*": "./src/hooks/*.ts"
|
|
9
|
+
},
|
|
6
10
|
"scripts": {
|
|
7
11
|
"lint": "eslint",
|
|
8
12
|
"format": "prettier --write \"**/*.{ts,tsx}\"",
|
|
@@ -10,19 +14,15 @@
|
|
|
10
14
|
"generate": "better-auth generate --output ../db/src/lib/auth-schema.ts"
|
|
11
15
|
},
|
|
12
16
|
"dependencies": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
17
|
+
"@workspace/db": "*",
|
|
18
|
+
"better-auth": "^1.6.9"
|
|
15
19
|
},
|
|
16
20
|
"devDependencies": {
|
|
21
|
+
"@better-auth/cli": "^1.4.22",
|
|
17
22
|
"@workspace/config-eslint": "*",
|
|
18
|
-
"@workspace/config-typescript": "*",
|
|
19
23
|
"@workspace/config-prettier": "*",
|
|
20
|
-
"@
|
|
24
|
+
"@workspace/config-typescript": "*",
|
|
21
25
|
"drizzle-kit": "^0.31.10",
|
|
22
26
|
"tsx": "^4.21.0"
|
|
23
|
-
},
|
|
24
|
-
"exports": {
|
|
25
|
-
"./lib/*": "./src/lib/*.ts",
|
|
26
|
-
"./hooks/*": "./src/hooks/*.ts"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workspace/db",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
4
|
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.ts",
|
|
8
|
+
"./schema": "./src/schema.ts"
|
|
9
|
+
},
|
|
6
10
|
"scripts": {
|
|
7
11
|
"lint": "eslint",
|
|
8
12
|
"format": "prettier --write \"**/*.{ts,tsx}\"",
|
|
@@ -16,15 +20,11 @@
|
|
|
16
20
|
"pg": "^8.20.0"
|
|
17
21
|
},
|
|
18
22
|
"devDependencies": {
|
|
23
|
+
"@types/pg": "^8.20.0",
|
|
19
24
|
"@workspace/config-eslint": "*",
|
|
20
|
-
"@workspace/config-typescript": "*",
|
|
21
25
|
"@workspace/config-prettier": "*",
|
|
22
|
-
"@
|
|
26
|
+
"@workspace/config-typescript": "*",
|
|
23
27
|
"drizzle-kit": "^0.31.10",
|
|
24
28
|
"tsx": "^4.21.0"
|
|
25
|
-
},
|
|
26
|
-
"exports": {
|
|
27
|
-
".": "./src/index.ts",
|
|
28
|
-
"./schema": "./src/schema.ts"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { drizzle } from
|
|
3
|
-
import * as schema from
|
|
1
|
+
import "dotenv/config";
|
|
2
|
+
import { drizzle } from "drizzle-orm/node-postgres";
|
|
3
|
+
import * as schema from "./schema";
|
|
4
4
|
|
|
5
5
|
export const db = drizzle(process.env.DATABASE_URL!, { schema });
|
|
6
6
|
|
|
7
|
-
export { schema };
|
|
7
|
+
export { schema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./auth-schema"
|
|
2
|
-
export * from "./planets-schema"
|
|
1
|
+
export * from "./auth-schema";
|
|
2
|
+
export * from "./planets-schema";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workspace/orpc",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
4
|
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./router": "./src/lib/router.ts"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"lint": "eslint",
|
|
8
11
|
"format": "prettier --write \"**/*.{ts,tsx}\"",
|
|
@@ -15,12 +18,9 @@
|
|
|
15
18
|
"@workspace/db": "*"
|
|
16
19
|
},
|
|
17
20
|
"devDependencies": {
|
|
21
|
+
"@types/node": "^22.19.1",
|
|
18
22
|
"@workspace/config-eslint": "*",
|
|
19
|
-
"@workspace/config-typescript": "*",
|
|
20
23
|
"@workspace/config-prettier": "*",
|
|
21
|
-
"@
|
|
22
|
-
},
|
|
23
|
-
"exports": {
|
|
24
|
-
"./router": "./src/lib/router.ts"
|
|
24
|
+
"@workspace/config-typescript": "*"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,79 +1,75 @@
|
|
|
1
|
-
import { ORPCError, os } from
|
|
2
|
-
import { db, schema } from
|
|
3
|
-
import { eq } from
|
|
4
|
-
import { type } from
|
|
5
|
-
import type { RPCContext } from
|
|
1
|
+
import { ORPCError, os } from "@orpc/server";
|
|
2
|
+
import { db, schema } from "@workspace/db";
|
|
3
|
+
import { eq } from "drizzle-orm";
|
|
4
|
+
import { type } from "arktype";
|
|
5
|
+
import type { RPCContext } from "./router";
|
|
6
6
|
|
|
7
|
-
const { planets } = schema
|
|
7
|
+
const { planets } = schema;
|
|
8
8
|
|
|
9
|
-
const o = os.$context<RPCContext>()
|
|
9
|
+
const o = os.$context<RPCContext>();
|
|
10
10
|
|
|
11
11
|
export const planetRouter = o.router({
|
|
12
|
-
getPlanets: o
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}),
|
|
12
|
+
getPlanets: o.handler(async () => {
|
|
13
|
+
const allPlanets = await db.select().from(planets);
|
|
14
|
+
return allPlanets;
|
|
15
|
+
}),
|
|
17
16
|
|
|
18
17
|
createPlanet: o
|
|
19
18
|
.input(
|
|
20
19
|
type({
|
|
21
|
-
name:
|
|
22
|
-
|
|
23
|
-
distanceFromSun:
|
|
24
|
-
diameter:
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
name: "string>0",
|
|
21
|
+
"description?": "string",
|
|
22
|
+
distanceFromSun: "number",
|
|
23
|
+
diameter: "number",
|
|
24
|
+
"hasRings?": "boolean",
|
|
25
|
+
"atmosphere?": "string",
|
|
27
26
|
}),
|
|
28
27
|
)
|
|
29
28
|
.handler(async ({ input }) => {
|
|
30
|
-
const [newPlanet] = await db.insert(planets).values(input).returning()
|
|
31
|
-
return newPlanet
|
|
29
|
+
const [newPlanet] = await db.insert(planets).values(input).returning();
|
|
30
|
+
return newPlanet;
|
|
32
31
|
}),
|
|
33
32
|
|
|
34
33
|
updatePlanet: o
|
|
35
34
|
.input(
|
|
36
35
|
type({
|
|
37
|
-
id:
|
|
38
|
-
name:
|
|
39
|
-
|
|
40
|
-
distanceFromSun:
|
|
41
|
-
diameter:
|
|
42
|
-
hasRings:
|
|
43
|
-
|
|
36
|
+
id: "number",
|
|
37
|
+
name: "string>0",
|
|
38
|
+
"description?": "string",
|
|
39
|
+
distanceFromSun: "number",
|
|
40
|
+
diameter: "number",
|
|
41
|
+
hasRings: "boolean",
|
|
42
|
+
"atmosphere?": "string",
|
|
44
43
|
}),
|
|
45
44
|
)
|
|
46
45
|
.handler(async ({ input }) => {
|
|
47
|
-
const { id, ...data } = input
|
|
46
|
+
const { id, ...data } = input;
|
|
48
47
|
const results = await db
|
|
49
48
|
.update(planets)
|
|
50
49
|
.set({ ...data, updatedAt: new Date() })
|
|
51
50
|
.where(eq(planets.id, id))
|
|
52
|
-
.returning()
|
|
53
|
-
|
|
51
|
+
.returning();
|
|
52
|
+
|
|
54
53
|
if (results.length === 0) {
|
|
55
|
-
throw new ORPCError(
|
|
54
|
+
throw new ORPCError("NOT_FOUND");
|
|
56
55
|
}
|
|
57
|
-
|
|
58
|
-
return results[0]
|
|
56
|
+
|
|
57
|
+
return results[0];
|
|
59
58
|
}),
|
|
60
59
|
|
|
61
60
|
deletePlanet: o
|
|
62
61
|
.input(
|
|
63
62
|
type({
|
|
64
|
-
id:
|
|
63
|
+
id: "number",
|
|
65
64
|
}),
|
|
66
65
|
)
|
|
67
66
|
.handler(async ({ input }) => {
|
|
68
|
-
const results = await db
|
|
69
|
-
|
|
70
|
-
.where(eq(planets.id, input.id))
|
|
71
|
-
.returning()
|
|
72
|
-
|
|
67
|
+
const results = await db.delete(planets).where(eq(planets.id, input.id)).returning();
|
|
68
|
+
|
|
73
69
|
if (results.length === 0) {
|
|
74
|
-
throw new ORPCError(
|
|
70
|
+
throw new ORPCError("NOT_FOUND");
|
|
75
71
|
}
|
|
76
|
-
|
|
77
|
-
return results[0]
|
|
72
|
+
|
|
73
|
+
return results[0];
|
|
78
74
|
}),
|
|
79
|
-
})
|
|
75
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ORPCError, os } from
|
|
2
|
-
import { type } from
|
|
3
|
-
import { planetRouter } from
|
|
4
|
-
import type { Session } from
|
|
1
|
+
import { ORPCError, os } from "@orpc/server";
|
|
2
|
+
import { type } from "arktype";
|
|
3
|
+
import { planetRouter } from "./planets";
|
|
4
|
+
import type { Session } from "@workspace/auth/lib/auth";
|
|
5
5
|
|
|
6
6
|
export type RPCContext = {
|
|
7
|
-
session: Session | null
|
|
8
|
-
}
|
|
7
|
+
session: Session | null;
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
const o = os.$context<RPCContext>()
|
|
10
|
+
const o = os.$context<RPCContext>();
|
|
11
11
|
|
|
12
12
|
export const router = o.router({
|
|
13
13
|
planets: planetRouter,
|
|
@@ -15,32 +15,32 @@ export const router = o.router({
|
|
|
15
15
|
hello: o
|
|
16
16
|
.input(
|
|
17
17
|
type({
|
|
18
|
-
|
|
18
|
+
"name?": "string",
|
|
19
19
|
}),
|
|
20
20
|
)
|
|
21
21
|
.handler(({ input }) => {
|
|
22
22
|
return {
|
|
23
|
-
message: `Hello, ${input.name ??
|
|
24
|
-
}
|
|
23
|
+
message: `Hello, ${input.name ?? "world"}!`,
|
|
24
|
+
};
|
|
25
25
|
}),
|
|
26
26
|
|
|
27
27
|
getSecretData: o
|
|
28
28
|
.use(async ({ context, next }) => {
|
|
29
29
|
if (!context.session) {
|
|
30
|
-
throw new ORPCError(
|
|
30
|
+
throw new ORPCError("UNAUTHORIZED");
|
|
31
31
|
}
|
|
32
32
|
return next({
|
|
33
33
|
context: {
|
|
34
34
|
session: context.session,
|
|
35
35
|
},
|
|
36
|
-
})
|
|
36
|
+
});
|
|
37
37
|
})
|
|
38
38
|
.handler(({ context }) => {
|
|
39
39
|
return {
|
|
40
40
|
secret: `This is secret data for ${context.session.user.name}`,
|
|
41
41
|
email: context.session.user.email,
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
}),
|
|
44
|
-
})
|
|
44
|
+
});
|
|
45
45
|
|
|
46
|
-
export type AppRouter = typeof router
|
|
46
|
+
export type AppRouter = typeof router;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workspace/ui",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
4
|
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./globals.css": "./src/styles/globals.css",
|
|
8
|
+
"./lib/*": "./src/lib/*.ts",
|
|
9
|
+
"./components/*": "./src/components/*.tsx",
|
|
10
|
+
"./hooks/*": "./src/hooks/*.ts"
|
|
11
|
+
},
|
|
6
12
|
"scripts": {
|
|
7
13
|
"lint": "eslint",
|
|
8
14
|
"format": "prettier --write \"**/*.{ts,tsx}\"",
|
|
@@ -31,20 +37,14 @@
|
|
|
31
37
|
"vaul": "^1.1.2"
|
|
32
38
|
},
|
|
33
39
|
"devDependencies": {
|
|
34
|
-
"@workspace/config-eslint": "*",
|
|
35
|
-
"@workspace/config-typescript": "*",
|
|
36
|
-
"@workspace/config-prettier": "*",
|
|
37
40
|
"@tailwindcss/vite": "^4.2.4",
|
|
38
41
|
"@turbo/gen": "^2.9.6",
|
|
39
42
|
"@types/node": "^25.6.0",
|
|
40
43
|
"@types/react": "^19.2.14",
|
|
41
44
|
"@types/react-dom": "^19.2.3",
|
|
45
|
+
"@workspace/config-eslint": "*",
|
|
46
|
+
"@workspace/config-prettier": "*",
|
|
47
|
+
"@workspace/config-typescript": "*",
|
|
42
48
|
"tailwindcss": "^4.2.4"
|
|
43
|
-
},
|
|
44
|
-
"exports": {
|
|
45
|
-
"./globals.css": "./src/styles/globals.css",
|
|
46
|
-
"./lib/*": "./src/lib/*.ts",
|
|
47
|
-
"./components/*": "./src/components/*.tsx",
|
|
48
|
-
"./hooks/*": "./src/hooks/*.ts"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion"
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
2
2
|
|
|
3
|
-
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
4
|
-
import { cn } from "@workspace/ui/lib/utils"
|
|
3
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "@workspace/ui/lib/utils";
|
|
5
5
|
|
|
6
6
|
function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
|
|
7
7
|
return (
|
|
@@ -10,7 +10,7 @@ function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
|
|
|
10
10
|
className={cn("flex w-full flex-col", className)}
|
|
11
11
|
{...props}
|
|
12
12
|
/>
|
|
13
|
-
)
|
|
13
|
+
);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
|
|
@@ -20,37 +20,35 @@ function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
|
|
|
20
20
|
className={cn("not-last:border-b", className)}
|
|
21
21
|
{...props}
|
|
22
22
|
/>
|
|
23
|
-
)
|
|
23
|
+
);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function AccordionTrigger({
|
|
27
|
-
className,
|
|
28
|
-
children,
|
|
29
|
-
...props
|
|
30
|
-
}: AccordionPrimitive.Trigger.Props) {
|
|
26
|
+
function AccordionTrigger({ className, children, ...props }: AccordionPrimitive.Trigger.Props) {
|
|
31
27
|
return (
|
|
32
28
|
<AccordionPrimitive.Header className="flex">
|
|
33
29
|
<AccordionPrimitive.Trigger
|
|
34
30
|
data-slot="accordion-trigger"
|
|
35
31
|
className={cn(
|
|
36
32
|
"group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
|
|
37
|
-
className
|
|
33
|
+
className,
|
|
38
34
|
)}
|
|
39
35
|
{...props}
|
|
40
36
|
>
|
|
41
37
|
{children}
|
|
42
|
-
<ChevronDownIcon
|
|
43
|
-
|
|
38
|
+
<ChevronDownIcon
|
|
39
|
+
data-slot="accordion-trigger-icon"
|
|
40
|
+
className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"
|
|
41
|
+
/>
|
|
42
|
+
<ChevronUpIcon
|
|
43
|
+
data-slot="accordion-trigger-icon"
|
|
44
|
+
className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
|
|
45
|
+
/>
|
|
44
46
|
</AccordionPrimitive.Trigger>
|
|
45
47
|
</AccordionPrimitive.Header>
|
|
46
|
-
)
|
|
48
|
+
);
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
function AccordionContent({
|
|
50
|
-
className,
|
|
51
|
-
children,
|
|
52
|
-
...props
|
|
53
|
-
}: AccordionPrimitive.Panel.Props) {
|
|
51
|
+
function AccordionContent({ className, children, ...props }: AccordionPrimitive.Panel.Props) {
|
|
54
52
|
return (
|
|
55
53
|
<AccordionPrimitive.Panel
|
|
56
54
|
data-slot="accordion-content"
|
|
@@ -60,13 +58,13 @@ function AccordionContent({
|
|
|
60
58
|
<div
|
|
61
59
|
className={cn(
|
|
62
60
|
"h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
63
|
-
className
|
|
61
|
+
className,
|
|
64
62
|
)}
|
|
65
63
|
>
|
|
66
64
|
{children}
|
|
67
65
|
</div>
|
|
68
66
|
</AccordionPrimitive.Panel>
|
|
69
|
-
)
|
|
67
|
+
);
|
|
70
68
|
}
|
|
71
69
|
|
|
72
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
70
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog"
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
5
5
|
|
|
6
|
-
import { cn } from "@workspace/ui/lib/utils"
|
|
7
|
-
import { Button } from "@workspace/ui/components/button"
|
|
6
|
+
import { cn } from "@workspace/ui/lib/utils";
|
|
7
|
+
import { Button } from "@workspace/ui/components/button";
|
|
8
8
|
|
|
9
9
|
function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
|
|
10
|
-
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props}
|
|
10
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
|
|
14
|
-
return
|
|
15
|
-
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
16
|
-
)
|
|
14
|
+
return <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
|
|
20
|
-
return
|
|
21
|
-
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
22
|
-
)
|
|
18
|
+
return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />;
|
|
23
19
|
}
|
|
24
20
|
|
|
25
|
-
function AlertDialogOverlay({
|
|
26
|
-
className,
|
|
27
|
-
...props
|
|
28
|
-
}: AlertDialogPrimitive.Backdrop.Props) {
|
|
21
|
+
function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.Backdrop.Props) {
|
|
29
22
|
return (
|
|
30
23
|
<AlertDialogPrimitive.Backdrop
|
|
31
24
|
data-slot="alert-dialog-overlay"
|
|
32
25
|
className={cn(
|
|
33
26
|
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
34
|
-
className
|
|
27
|
+
className,
|
|
35
28
|
)}
|
|
36
29
|
{...props}
|
|
37
30
|
/>
|
|
38
|
-
)
|
|
31
|
+
);
|
|
39
32
|
}
|
|
40
33
|
|
|
41
34
|
function AlertDialogContent({
|
|
@@ -43,7 +36,7 @@ function AlertDialogContent({
|
|
|
43
36
|
size = "default",
|
|
44
37
|
...props
|
|
45
38
|
}: AlertDialogPrimitive.Popup.Props & {
|
|
46
|
-
size?: "default" | "sm"
|
|
39
|
+
size?: "default" | "sm";
|
|
47
40
|
}) {
|
|
48
41
|
return (
|
|
49
42
|
<AlertDialogPortal>
|
|
@@ -53,60 +46,51 @@ function AlertDialogContent({
|
|
|
53
46
|
data-size={size}
|
|
54
47
|
className={cn(
|
|
55
48
|
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
56
|
-
className
|
|
49
|
+
className,
|
|
57
50
|
)}
|
|
58
51
|
{...props}
|
|
59
52
|
/>
|
|
60
53
|
</AlertDialogPortal>
|
|
61
|
-
)
|
|
54
|
+
);
|
|
62
55
|
}
|
|
63
56
|
|
|
64
|
-
function AlertDialogHeader({
|
|
65
|
-
className,
|
|
66
|
-
...props
|
|
67
|
-
}: React.ComponentProps<"div">) {
|
|
57
|
+
function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
68
58
|
return (
|
|
69
59
|
<div
|
|
70
60
|
data-slot="alert-dialog-header"
|
|
71
61
|
className={cn(
|
|
72
62
|
"grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
|
|
73
|
-
className
|
|
63
|
+
className,
|
|
74
64
|
)}
|
|
75
65
|
{...props}
|
|
76
66
|
/>
|
|
77
|
-
)
|
|
67
|
+
);
|
|
78
68
|
}
|
|
79
69
|
|
|
80
|
-
function AlertDialogFooter({
|
|
81
|
-
className,
|
|
82
|
-
...props
|
|
83
|
-
}: React.ComponentProps<"div">) {
|
|
70
|
+
function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
84
71
|
return (
|
|
85
72
|
<div
|
|
86
73
|
data-slot="alert-dialog-footer"
|
|
87
74
|
className={cn(
|
|
88
75
|
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
89
|
-
className
|
|
76
|
+
className,
|
|
90
77
|
)}
|
|
91
78
|
{...props}
|
|
92
79
|
/>
|
|
93
|
-
)
|
|
80
|
+
);
|
|
94
81
|
}
|
|
95
82
|
|
|
96
|
-
function AlertDialogMedia({
|
|
97
|
-
className,
|
|
98
|
-
...props
|
|
99
|
-
}: React.ComponentProps<"div">) {
|
|
83
|
+
function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">) {
|
|
100
84
|
return (
|
|
101
85
|
<div
|
|
102
86
|
data-slot="alert-dialog-media"
|
|
103
87
|
className={cn(
|
|
104
88
|
"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
|
|
105
|
-
className
|
|
89
|
+
className,
|
|
106
90
|
)}
|
|
107
91
|
{...props}
|
|
108
92
|
/>
|
|
109
|
-
)
|
|
93
|
+
);
|
|
110
94
|
}
|
|
111
95
|
|
|
112
96
|
function AlertDialogTitle({
|
|
@@ -118,11 +102,11 @@ function AlertDialogTitle({
|
|
|
118
102
|
data-slot="alert-dialog-title"
|
|
119
103
|
className={cn(
|
|
120
104
|
"font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
121
|
-
className
|
|
105
|
+
className,
|
|
122
106
|
)}
|
|
123
107
|
{...props}
|
|
124
108
|
/>
|
|
125
|
-
)
|
|
109
|
+
);
|
|
126
110
|
}
|
|
127
111
|
|
|
128
112
|
function AlertDialogDescription({
|
|
@@ -134,24 +118,15 @@ function AlertDialogDescription({
|
|
|
134
118
|
data-slot="alert-dialog-description"
|
|
135
119
|
className={cn(
|
|
136
120
|
"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
137
|
-
className
|
|
121
|
+
className,
|
|
138
122
|
)}
|
|
139
123
|
{...props}
|
|
140
124
|
/>
|
|
141
|
-
)
|
|
125
|
+
);
|
|
142
126
|
}
|
|
143
127
|
|
|
144
|
-
function AlertDialogAction({
|
|
145
|
-
className
|
|
146
|
-
...props
|
|
147
|
-
}: React.ComponentProps<typeof Button>) {
|
|
148
|
-
return (
|
|
149
|
-
<Button
|
|
150
|
-
data-slot="alert-dialog-action"
|
|
151
|
-
className={cn(className)}
|
|
152
|
-
{...props}
|
|
153
|
-
/>
|
|
154
|
-
)
|
|
128
|
+
function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>) {
|
|
129
|
+
return <Button data-slot="alert-dialog-action" className={cn(className)} {...props} />;
|
|
155
130
|
}
|
|
156
131
|
|
|
157
132
|
function AlertDialogCancel({
|
|
@@ -168,7 +143,7 @@ function AlertDialogCancel({
|
|
|
168
143
|
render={<Button variant={variant} size={size} />}
|
|
169
144
|
{...props}
|
|
170
145
|
/>
|
|
171
|
-
)
|
|
146
|
+
);
|
|
172
147
|
}
|
|
173
148
|
|
|
174
149
|
export {
|
|
@@ -184,4 +159,4 @@ export {
|
|
|
184
159
|
AlertDialogPortal,
|
|
185
160
|
AlertDialogTitle,
|
|
186
161
|
AlertDialogTrigger,
|
|
187
|
-
}
|
|
162
|
+
};
|