Skip to content

Commit e8ad423

Browse files
committed
feat: auth
0 parents  commit e8ad423

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+36769
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{js,json,yml}]
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 2

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "dashboard-3stats"
4+
}
5+
}

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.yarn/*
2+
!.yarn/patches
3+
!.yarn/plugins
4+
!.yarn/releases
5+
!.yarn/sdks
6+
!.yarn/versions
7+
8+
# Swap the comments on the following lines if you don't wish to use zero-installs
9+
# Documentation here: https://yarnpkg.com/features/zero-installs
10+
#!.yarn/cache
11+
.pnp.*
12+
13+
14+
15+
# Idea
16+
.idea
17+
18+
19+
# Build
20+

.yarn/releases/yarn-4.0.0-rc.14.cjs

Lines changed: 779 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
yarnPath: .yarn/releases/yarn-4.0.0-rc.14.cjs
2+
3+
pnpEnableEsmLoader: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# PWApp

build.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { buildHelper } from '@espoal/build'
2+
3+
buildHelper({
4+
entryPoints: ['vendors/react/react.mjs'],
5+
outDir: 'vendors/'
6+
})
7+
8+
buildHelper({
9+
entryPoints: ['main/index.mjs'],
10+
external: ['@vendors/react']
11+
})
12+
13+
buildHelper({
14+
entryPoints: ['pkgs/auth/Auth.mjs'],
15+
external: ['@vendors/react']
16+
})

dist/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "dist",
3+
"packageManager": "[email protected]"
4+
}

dist/public/Auth.mjs

Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
// pnp:/home/mamluk/Projects/pwa/pkgs/auth/Auth.mjs
2+
import { React as React3, Routes, Route, Navigate } from "/vendors/react.mjs";
3+
4+
// pnp:/home/mamluk/Projects/pwa/pkgs/auth/LoginPage.mjs
5+
import { React, Link } from "/vendors/react.mjs";
6+
7+
// pnp:/home/mamluk/Projects/pwa/libs/assets/index.mjs
8+
var AuthImage = "/assets/images/auth-image.jpg";
9+
var AuthDecoration = "/assets/images/auth-decoration.png";
10+
11+
// pnp:/home/mamluk/Projects/pwa/pkgs/auth/LoginPage.mjs
12+
var LoginPage = () => {
13+
return /* @__PURE__ */ React.createElement("main", {
14+
className: "bg-white"
15+
}, /* @__PURE__ */ React.createElement("div", {
16+
className: "relative md:flex"
17+
}, /* @__PURE__ */ React.createElement("div", {
18+
className: "md:w-1/2"
19+
}, /* @__PURE__ */ React.createElement("div", {
20+
className: "min-h-screen h-full flex flex-col after:flex-1"
21+
}, /* @__PURE__ */ React.createElement("div", {
22+
className: "flex-1"
23+
}, /* @__PURE__ */ React.createElement("div", {
24+
className: "flex items-center justify-between h-16 px-4 sm:px-6 lg:px-8"
25+
}, /* @__PURE__ */ React.createElement(Link, {
26+
className: "block",
27+
to: "/"
28+
}, /* @__PURE__ */ React.createElement("svg", {
29+
width: "32",
30+
height: "32",
31+
viewBox: "0 0 32 32"
32+
}, /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", {
33+
x1: "28.538%",
34+
y1: "20.229%",
35+
x2: "100%",
36+
y2: "108.156%",
37+
id: "logo-a"
38+
}, /* @__PURE__ */ React.createElement("stop", {
39+
stopColor: "#A5B4FC",
40+
stopOpacity: "0",
41+
offset: "0%"
42+
}), /* @__PURE__ */ React.createElement("stop", {
43+
stopColor: "#A5B4FC",
44+
offset: "100%"
45+
})), /* @__PURE__ */ React.createElement("linearGradient", {
46+
x1: "88.638%",
47+
y1: "29.267%",
48+
x2: "22.42%",
49+
y2: "100%",
50+
id: "logo-b"
51+
}, /* @__PURE__ */ React.createElement("stop", {
52+
stopColor: "#38BDF8",
53+
stopOpacity: "0",
54+
offset: "0%"
55+
}), /* @__PURE__ */ React.createElement("stop", {
56+
stopColor: "#38BDF8",
57+
offset: "100%"
58+
}))), /* @__PURE__ */ React.createElement("rect", {
59+
fill: "#6366F1",
60+
width: "32",
61+
height: "32",
62+
rx: "16"
63+
}), /* @__PURE__ */ React.createElement("path", {
64+
d: "M18.277.16C26.035 1.267 32 7.938 32 16c0 8.837-7.163 16-16 16a15.937 15.937 0 01-10.426-3.863L18.277.161z",
65+
fill: "#4F46E5"
66+
}), /* @__PURE__ */ React.createElement("path", {
67+
d: "M7.404 2.503l18.339 26.19A15.93 15.93 0 0116 32C7.163 32 0 24.837 0 16 0 10.327 2.952 5.344 7.404 2.503z",
68+
fill: "url(#logo-a)"
69+
}), /* @__PURE__ */ React.createElement("path", {
70+
d: "M2.223 24.14L29.777 7.86A15.926 15.926 0 0132 16c0 8.837-7.163 16-16 16-5.864 0-10.991-3.154-13.777-7.86z",
71+
fill: "url(#logo-b)"
72+
}))))), /* @__PURE__ */ React.createElement("div", {
73+
className: "max-w-sm mx-auto px-4 py-8"
74+
}, /* @__PURE__ */ React.createElement("h1", {
75+
className: "text-3xl text-slate-800 font-bold mb-6"
76+
}, "Welcome back! \u2728"), /* @__PURE__ */ React.createElement("form", null, /* @__PURE__ */ React.createElement("div", {
77+
className: "space-y-4"
78+
}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", {
79+
className: "block text-sm font-medium mb-1",
80+
htmlFor: "email"
81+
}, "Email Address"), /* @__PURE__ */ React.createElement("input", {
82+
id: "email",
83+
className: "form-input w-full",
84+
type: "email"
85+
})), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", {
86+
className: "block text-sm font-medium mb-1",
87+
htmlFor: "password"
88+
}, "Password"), /* @__PURE__ */ React.createElement("input", {
89+
id: "password",
90+
className: "form-input w-full",
91+
type: "password",
92+
autoComplete: "on"
93+
}))), /* @__PURE__ */ React.createElement("div", {
94+
className: "flex items-center justify-between mt-6"
95+
}, /* @__PURE__ */ React.createElement("div", {
96+
className: "mr-1"
97+
}, /* @__PURE__ */ React.createElement(Link, {
98+
className: "text-sm underline hover:no-underline",
99+
to: "/reset-password"
100+
}, "Forgot Password?")), /* @__PURE__ */ React.createElement(Link, {
101+
className: "btn bg-indigo-500 hover:bg-indigo-600 text-white ml-3",
102+
to: "/"
103+
}, "Sign In"))), /* @__PURE__ */ React.createElement("div", {
104+
className: "pt-5 mt-6 border-t border-slate-200"
105+
}, /* @__PURE__ */ React.createElement("div", {
106+
className: "text-sm"
107+
}, "Don\u2019t you have an account? ", /* @__PURE__ */ React.createElement(Link, {
108+
className: "font-medium text-indigo-500 hover:text-indigo-600",
109+
to: "/signup"
110+
}, "Sign Up")), /* @__PURE__ */ React.createElement("div", {
111+
className: "mt-5"
112+
}, /* @__PURE__ */ React.createElement("div", {
113+
className: "bg-amber-100 text-amber-600 px-3 py-2 rounded"
114+
}, /* @__PURE__ */ React.createElement("svg", {
115+
className: "inline w-3 h-3 shrink-0 fill-current mr-2",
116+
viewBox: "0 0 12 12"
117+
}, /* @__PURE__ */ React.createElement("path", {
118+
d: "M10.28 1.28L3.989 7.575 1.695 5.28A1 1 0 00.28 6.695l3 3a1 1 0 001.414 0l7-7A1 1 0 0010.28 1.28z"
119+
})), /* @__PURE__ */ React.createElement("span", {
120+
className: "text-sm"
121+
}, "To support you during the pandemic super pro features are free until March 31st."))))))), /* @__PURE__ */ React.createElement("div", {
122+
className: "hidden md:block absolute top-0 bottom-0 right-0 md:w-1/2",
123+
"aria-hidden": "true"
124+
}, /* @__PURE__ */ React.createElement("img", {
125+
className: "object-cover object-center w-full h-full",
126+
src: AuthImage,
127+
width: "760",
128+
height: "1024",
129+
alt: "Authentication"
130+
}), /* @__PURE__ */ React.createElement("img", {
131+
className: "absolute top-1/4 left-0 transform -translate-x-1/2 ml-8 hidden lg:block",
132+
src: AuthDecoration,
133+
width: "218",
134+
height: "224",
135+
alt: "Authentication decoration"
136+
}))));
137+
};
138+
139+
// pnp:/home/mamluk/Projects/pwa/pkgs/auth/SignupPage.mjs
140+
import { React as React2, Link as Link2 } from "/vendors/react.mjs";
141+
var SignupPage = () => {
142+
return /* @__PURE__ */ React2.createElement("main", {
143+
className: "bg-white"
144+
}, /* @__PURE__ */ React2.createElement("div", {
145+
className: "relative md:flex"
146+
}, /* @__PURE__ */ React2.createElement("div", {
147+
className: "md:w-1/2"
148+
}, /* @__PURE__ */ React2.createElement("div", {
149+
className: "min-h-screen h-full flex flex-col after:flex-1"
150+
}, /* @__PURE__ */ React2.createElement("div", {
151+
className: "flex-1"
152+
}, /* @__PURE__ */ React2.createElement("div", {
153+
className: "flex items-center justify-between h-16 px-4 sm:px-6 lg:px-8"
154+
}, /* @__PURE__ */ React2.createElement(Link2, {
155+
className: "block",
156+
to: "/"
157+
}, /* @__PURE__ */ React2.createElement("svg", {
158+
width: "32",
159+
height: "32",
160+
viewBox: "0 0 32 32"
161+
}, /* @__PURE__ */ React2.createElement("defs", null, /* @__PURE__ */ React2.createElement("linearGradient", {
162+
x1: "28.538%",
163+
y1: "20.229%",
164+
x2: "100%",
165+
y2: "108.156%",
166+
id: "logo-a"
167+
}, /* @__PURE__ */ React2.createElement("stop", {
168+
stopColor: "#A5B4FC",
169+
stopOpacity: "0",
170+
offset: "0%"
171+
}), /* @__PURE__ */ React2.createElement("stop", {
172+
stopColor: "#A5B4FC",
173+
offset: "100%"
174+
})), /* @__PURE__ */ React2.createElement("linearGradient", {
175+
x1: "88.638%",
176+
y1: "29.267%",
177+
x2: "22.42%",
178+
y2: "100%",
179+
id: "logo-b"
180+
}, /* @__PURE__ */ React2.createElement("stop", {
181+
stopColor: "#38BDF8",
182+
stopOpacity: "0",
183+
offset: "0%"
184+
}), /* @__PURE__ */ React2.createElement("stop", {
185+
stopColor: "#38BDF8",
186+
offset: "100%"
187+
}))), /* @__PURE__ */ React2.createElement("rect", {
188+
fill: "#6366F1",
189+
width: "32",
190+
height: "32",
191+
rx: "16"
192+
}), /* @__PURE__ */ React2.createElement("path", {
193+
d: "M18.277.16C26.035 1.267 32 7.938 32 16c0 8.837-7.163 16-16 16a15.937 15.937 0 01-10.426-3.863L18.277.161z",
194+
fill: "#4F46E5"
195+
}), /* @__PURE__ */ React2.createElement("path", {
196+
d: "M7.404 2.503l18.339 26.19A15.93 15.93 0 0116 32C7.163 32 0 24.837 0 16 0 10.327 2.952 5.344 7.404 2.503z",
197+
fill: "url(#logo-a)"
198+
}), /* @__PURE__ */ React2.createElement("path", {
199+
d: "M2.223 24.14L29.777 7.86A15.926 15.926 0 0132 16c0 8.837-7.163 16-16 16-5.864 0-10.991-3.154-13.777-7.86z",
200+
fill: "url(#logo-b)"
201+
}))))), /* @__PURE__ */ React2.createElement("div", {
202+
className: "max-w-sm mx-auto px-4 py-8"
203+
}, /* @__PURE__ */ React2.createElement("h1", {
204+
className: "text-3xl text-slate-800 font-bold mb-6"
205+
}, "Create your Account \u2728"), /* @__PURE__ */ React2.createElement("form", null, /* @__PURE__ */ React2.createElement("div", {
206+
className: "space-y-4"
207+
}, /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("label", {
208+
className: "block text-sm font-medium mb-1",
209+
htmlFor: "email"
210+
}, "Email Address ", /* @__PURE__ */ React2.createElement("span", {
211+
className: "text-rose-500"
212+
}, "*")), /* @__PURE__ */ React2.createElement("input", {
213+
id: "email",
214+
className: "form-input w-full",
215+
type: "email"
216+
})), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("label", {
217+
className: "block text-sm font-medium mb-1",
218+
htmlFor: "name"
219+
}, "Full Name ", /* @__PURE__ */ React2.createElement("span", {
220+
className: "text-rose-500"
221+
}, "*")), /* @__PURE__ */ React2.createElement("input", {
222+
id: "name",
223+
className: "form-input w-full",
224+
type: "text"
225+
})), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("label", {
226+
className: "block text-sm font-medium mb-1",
227+
htmlFor: "role"
228+
}, "Your Role ", /* @__PURE__ */ React2.createElement("span", {
229+
className: "text-rose-500"
230+
}, "*")), /* @__PURE__ */ React2.createElement("select", {
231+
id: "role",
232+
className: "form-select w-full"
233+
}, /* @__PURE__ */ React2.createElement("option", null, "Designer"), /* @__PURE__ */ React2.createElement("option", null, "Developer"), /* @__PURE__ */ React2.createElement("option", null, "Accountant"))), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("label", {
234+
className: "block text-sm font-medium mb-1",
235+
htmlFor: "password"
236+
}, "Password"), /* @__PURE__ */ React2.createElement("input", {
237+
id: "password",
238+
className: "form-input w-full",
239+
type: "password",
240+
autoComplete: "on"
241+
}))), /* @__PURE__ */ React2.createElement("div", {
242+
className: "flex items-center justify-between mt-6"
243+
}, /* @__PURE__ */ React2.createElement("div", {
244+
className: "mr-1"
245+
}, /* @__PURE__ */ React2.createElement("label", {
246+
className: "flex items-center"
247+
}, /* @__PURE__ */ React2.createElement("input", {
248+
type: "checkbox",
249+
className: "form-checkbox"
250+
}), /* @__PURE__ */ React2.createElement("span", {
251+
className: "text-sm ml-2"
252+
}, "Email me about product news."))), /* @__PURE__ */ React2.createElement(Link2, {
253+
className: "btn bg-indigo-500 hover:bg-indigo-600 text-white ml-3 whitespace-nowrap",
254+
to: "/"
255+
}, "Sign Up"))), /* @__PURE__ */ React2.createElement("div", {
256+
className: "pt-5 mt-6 border-t border-slate-200"
257+
}, /* @__PURE__ */ React2.createElement("div", {
258+
className: "text-sm"
259+
}, "Have an account? ", /* @__PURE__ */ React2.createElement(Link2, {
260+
className: "font-medium text-indigo-500 hover:text-indigo-600",
261+
to: "/signin"
262+
}, "Sign In")))))), /* @__PURE__ */ React2.createElement("div", {
263+
className: "hidden md:block absolute top-0 bottom-0 right-0 md:w-1/2",
264+
"aria-hidden": "true"
265+
}, /* @__PURE__ */ React2.createElement("img", {
266+
className: "object-cover object-center w-full h-full",
267+
src: AuthImage,
268+
width: "760",
269+
height: "1024",
270+
alt: "Authentication"
271+
}), /* @__PURE__ */ React2.createElement("img", {
272+
className: "absolute top-1/4 left-0 transform -translate-x-1/2 ml-8 hidden lg:block",
273+
src: AuthDecoration,
274+
width: "218",
275+
height: "224",
276+
alt: "Authentication decoration"
277+
}))));
278+
};
279+
280+
// pnp:/home/mamluk/Projects/pwa/pkgs/auth/Auth.mjs
281+
var Auth = () => {
282+
return /* @__PURE__ */ React3.createElement(Routes, null, /* @__PURE__ */ React3.createElement(Route, {
283+
path: "login",
284+
element: /* @__PURE__ */ React3.createElement(LoginPage, null)
285+
}), /* @__PURE__ */ React3.createElement(Route, {
286+
path: "signup",
287+
element: /* @__PURE__ */ React3.createElement(SignupPage, null)
288+
}), /* @__PURE__ */ React3.createElement(Route, {
289+
path: "*",
290+
element: /* @__PURE__ */ React3.createElement(Navigate, {
291+
replace: true,
292+
to: "/notFound"
293+
})
294+
}));
295+
};
296+
export {
297+
Auth
298+
};
17.4 KB
Loading

0 commit comments

Comments
 (0)