@skalfa/skalfa-app 1.0.0
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/.env.example +44 -0
- package/README.md +28 -0
- package/app/auth/edit/page.tsx +65 -0
- package/app/auth/login/page.tsx +63 -0
- package/app/auth/me/page.tsx +58 -0
- package/app/auth/register/page.tsx +69 -0
- package/app/auth/verify/page.tsx +53 -0
- package/app/dashboard/layout.tsx +47 -0
- package/app/dashboard/page.tsx +9 -0
- package/app/dashboard/user/page.tsx +77 -0
- package/app/index.ts +14 -0
- package/app/layout.tsx +38 -0
- package/app/page.tsx +13 -0
- package/barrels.json +6 -0
- package/blueprints/starter.blueprint.json +103 -0
- package/components/base.components/accordion/Accordion.component.tsx +82 -0
- package/components/base.components/breadcrumb/Breadcrumb.component.tsx +80 -0
- package/components/base.components/button/Button.component.tsx +91 -0
- package/components/base.components/button/IconButton.component.tsx +88 -0
- package/components/base.components/button/button.decorate.ts +82 -0
- package/components/base.components/card/AlertCard.component.tsx +69 -0
- package/components/base.components/card/Card.component.tsx +25 -0
- package/components/base.components/card/DashboardCard.component.tsx +44 -0
- package/components/base.components/card/GalleryCard.component.tsx +50 -0
- package/components/base.components/card/ProductCard.component.tsx +65 -0
- package/components/base.components/card/ProfileCard.component.tsx +71 -0
- package/components/base.components/carousel/Carousel.component.tsx +113 -0
- package/components/base.components/chip/Chip.component.tsx +39 -0
- package/components/base.components/document/DocumentViewer.component.tsx +164 -0
- package/components/base.components/document/ExportExcel.component.tsx +340 -0
- package/components/base.components/document/ImportExcel.component.tsx +315 -0
- package/components/base.components/document/PrintTable.component.tsx +204 -0
- package/components/base.components/document/RenderPDF.component.tsx +416 -0
- package/components/base.components/index.ts +85 -0
- package/components/base.components/input/Checkbox.component.tsx +109 -0
- package/components/base.components/input/Input.component.tsx +332 -0
- package/components/base.components/input/InputCheckbox.component.tsx +174 -0
- package/components/base.components/input/InputCurrency.component.tsx +163 -0
- package/components/base.components/input/InputDate.component.tsx +352 -0
- package/components/base.components/input/InputDatetime.component.tsx +260 -0
- package/components/base.components/input/InputDocument.component.tsx +352 -0
- package/components/base.components/input/InputImage.component.tsx +533 -0
- package/components/base.components/input/InputMap.component.tsx +318 -0
- package/components/base.components/input/InputNumber.component.tsx +192 -0
- package/components/base.components/input/InputOtp.component.tsx +169 -0
- package/components/base.components/input/InputPassword.component.tsx +236 -0
- package/components/base.components/input/InputRadio.component.tsx +175 -0
- package/components/base.components/input/InputTime.component.tsx +276 -0
- package/components/base.components/input/InputValues.component.tsx +68 -0
- package/components/base.components/input/Radio.component.tsx +102 -0
- package/components/base.components/input/Select.component.tsx +541 -0
- package/components/base.components/modal/BottomSheet.component.tsx +246 -0
- package/components/base.components/modal/FloatingPage.component.tsx +104 -0
- package/components/base.components/modal/Modal.component.tsx +96 -0
- package/components/base.components/modal/ModalConfirm.component.tsx +218 -0
- package/components/base.components/modal/Toast.component.tsx +126 -0
- package/components/base.components/nav/Bottombar.component.tsx +116 -0
- package/components/base.components/nav/Footer.component.tsx +144 -0
- package/components/base.components/nav/Headbar.component.tsx +104 -0
- package/components/base.components/nav/Navbar.component.tsx +100 -0
- package/components/base.components/nav/Sidebar.component.tsx +301 -0
- package/components/base.components/nav/Tabbar.component.tsx +60 -0
- package/components/base.components/nav/Wizard.component.tsx +73 -0
- package/components/base.components/supervision/FormSupervision.component.tsx +434 -0
- package/components/base.components/supervision/TableSupervision.component.tsx +697 -0
- package/components/base.components/table/ControlBar.component.tsx +497 -0
- package/components/base.components/table/FilterComponent.tsx +518 -0
- package/components/base.components/table/Pagination.component.tsx +159 -0
- package/components/base.components/table/Table.component.tsx +469 -0
- package/components/base.components/typography/TypographyArticle.component.tsx +26 -0
- package/components/base.components/typography/TypographyColumn.component.tsx +20 -0
- package/components/base.components/typography/TypographyContent.component.tsx +20 -0
- package/components/base.components/typography/TypographyTips.component.tsx +20 -0
- package/components/base.components/wrap/Draggable.component.tsx +303 -0
- package/components/base.components/wrap/IDBProvider.tsx +12 -0
- package/components/base.components/wrap/Image.component.tsx +10 -0
- package/components/base.components/wrap/OutsideClick.component.tsx +48 -0
- package/components/base.components/wrap/ScrollContainer.component.tsx +104 -0
- package/components/base.components/wrap/ShortcutProvider.tsx +57 -0
- package/components/base.components/wrap/Swipe.component.tsx +93 -0
- package/components/construct.components/example.tsx +1 -0
- package/components/construct.components/index.ts +5 -0
- package/components/index.ts +3 -0
- package/components/structure.components/example.tsx +1 -0
- package/components/structure.components/index.ts +5 -0
- package/contexts/AppProvider.tsx +12 -0
- package/contexts/Auth.context.tsx +64 -0
- package/contexts/Toggle.context.tsx +44 -0
- package/contexts/index.ts +7 -0
- package/eslint.config.mjs +34 -0
- package/langs/index.ts +1 -0
- package/langs/validation.langs.ts +17 -0
- package/next.config.ts +17 -0
- package/package.json +43 -0
- package/postcss.config.mjs +12 -0
- package/public/204.svg +19 -0
- package/public/500.svg +39 -0
- package/public/images/avatar.jpg +0 -0
- package/public/images/example.png +0 -0
- package/schema/idb/app.schema.ts +9 -0
- package/schema/index.ts +5 -0
- package/styles/globals.css +231 -0
- package/styles/tailwind.safelist +69 -0
- package/tailwind.config.ts +10 -0
- package/tsconfig.json +35 -0
- package/utils/commands/barrels.ts +28 -0
- package/utils/commands/blueprint.ts +421 -0
- package/utils/commands/light.ts +21 -0
- package/utils/commands/logger.ts +42 -0
- package/utils/commands/stubs/table-blueprint.stub +13 -0
- package/utils/commands/use-pdf.ts +29 -0
- package/utils/index.ts +3 -0
package/.env.example
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# =========================>
|
|
2
|
+
# ## Base configuration
|
|
3
|
+
# =========================>
|
|
4
|
+
NEXT_PUBLIC_APP_NAME="NEXT-LIGHT"
|
|
5
|
+
NEXT_PUBLIC_DEBUG=false
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# =========================>
|
|
9
|
+
# ## Api configuration
|
|
10
|
+
# =========================>
|
|
11
|
+
NEXT_PUBLIC_API_HOST="http://localhost:4000/api"
|
|
12
|
+
NEXT_PUBLIC_STORAGE_HOST="http://localhost:4000/storage"
|
|
13
|
+
NEXT_PUBLIC_API_HEADERS=""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# =========================>
|
|
17
|
+
# ## Socket configuration
|
|
18
|
+
# =========================>
|
|
19
|
+
NEXT_PUBLIC_SOCKET_HOST=""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# =========================>
|
|
23
|
+
# ## Cookie configuration
|
|
24
|
+
# =========================>
|
|
25
|
+
NEXT_PUBLIC_COOKIE_KEY=""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# =========================>
|
|
29
|
+
# ## Socket configuration
|
|
30
|
+
# =========================>
|
|
31
|
+
NEXT_PUBLIC_SOCKET_HOST=""
|
|
32
|
+
NEXT_PUBLIC_SOCKET_KEY=""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# =========================>
|
|
36
|
+
# ## Map configuration
|
|
37
|
+
# =========================>
|
|
38
|
+
NEXT_PUBLIC_MAP_KEY="";
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# =========================>
|
|
42
|
+
# ## Exposed port (when using docker)
|
|
43
|
+
# =========================>
|
|
44
|
+
NEXT_PUBLIC_PORT=3000
|
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# NEXT LIGHT V.3
|
|
2
|
+
|
|
3
|
+
This is not a framework or pacakage for react js, but a starter template to start developing your website app using next js and several packages already installed in it (including tailwind css)
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
Find out and learn about Next-Light in the [Next-Light Documentation](https://light.sejedigital.com/next)
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Beautiful and powerful components available
|
|
12
|
+
- Components made easy to modify
|
|
13
|
+
- API Helpers
|
|
14
|
+
- ETC
|
|
15
|
+
|
|
16
|
+
## Instalations
|
|
17
|
+
|
|
18
|
+
### yarn
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
yarn install && yarn run dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### npm
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
npm install && npm run dev
|
|
28
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useRouter } from "next/navigation";
|
|
4
|
+
import { useAuthContext } from "@contexts";
|
|
5
|
+
import { ButtonComponent, CardComponent, FormSupervisionComponent } from "@components";
|
|
6
|
+
|
|
7
|
+
export default function EditProfile() {
|
|
8
|
+
const router = useRouter();
|
|
9
|
+
const { user } = useAuthContext();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<div className="h-screen flex flex-col justify-center items-center">
|
|
14
|
+
<h1 className="text-2xl font-extrabold italic">WELCOME TO NEXT-LIGHT v.3</h1>
|
|
15
|
+
<p className="text-sm font-semibold mt-6">Edit account!</p>
|
|
16
|
+
|
|
17
|
+
<CardComponent className="mt-4 p-6 w-[400px] rounded-2xl">
|
|
18
|
+
<FormSupervisionComponent
|
|
19
|
+
fields={[
|
|
20
|
+
{
|
|
21
|
+
construction: {
|
|
22
|
+
name: "name",
|
|
23
|
+
label: "Nama",
|
|
24
|
+
placeholder: "Ex: Joko Gunawan",
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
construction: {
|
|
29
|
+
name: "email",
|
|
30
|
+
label: "E-mail",
|
|
31
|
+
placeholder: "Ex: example@mail.com",
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
construction: {
|
|
36
|
+
type: "file",
|
|
37
|
+
name: "image",
|
|
38
|
+
label: "Picture",
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
]}
|
|
42
|
+
defaultValue={user}
|
|
43
|
+
submitControl={{
|
|
44
|
+
path: "me/update"
|
|
45
|
+
}}
|
|
46
|
+
onSuccess={() => {
|
|
47
|
+
router.push("/auth/me")
|
|
48
|
+
}}
|
|
49
|
+
footerControl={({loading}) => (
|
|
50
|
+
<>
|
|
51
|
+
<ButtonComponent
|
|
52
|
+
type="submit"
|
|
53
|
+
label="Save Changes"
|
|
54
|
+
block
|
|
55
|
+
className="mt-4"
|
|
56
|
+
loading={loading}
|
|
57
|
+
/>
|
|
58
|
+
</>
|
|
59
|
+
)}
|
|
60
|
+
/>
|
|
61
|
+
</CardComponent>
|
|
62
|
+
</div>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useRouter } from "next/navigation";
|
|
4
|
+
import { ButtonComponent, CardComponent, FormSupervisionComponent } from "@components";
|
|
5
|
+
import { useAuthContext } from "@contexts";
|
|
6
|
+
import Link from "next/link";
|
|
7
|
+
|
|
8
|
+
export default function Login() {
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
const {setAccessToken,setUser} = useAuthContext();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<div className="h-screen flex flex-col justify-center items-center">
|
|
15
|
+
<h1 className="text-2xl font-extrabold italic">WELCOME TO NEXT-LIGHT v.3</h1>
|
|
16
|
+
<p className="text-sm font-semibold mt-6">Sign in with your account!</p>
|
|
17
|
+
|
|
18
|
+
<CardComponent className="mt-4 p-6 w-[400px] rounded-2xl">
|
|
19
|
+
<FormSupervisionComponent
|
|
20
|
+
fields={[
|
|
21
|
+
{
|
|
22
|
+
construction: {
|
|
23
|
+
name: "email",
|
|
24
|
+
label: "E-mail",
|
|
25
|
+
placeholder: "Ex: example@mail.com",
|
|
26
|
+
validations: "required|min:10|max:50|email"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
construction: {
|
|
31
|
+
type: "password",
|
|
32
|
+
name: "password",
|
|
33
|
+
label: "Password",
|
|
34
|
+
placeholder: "Ex: secret123",
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]}
|
|
38
|
+
submitControl={{
|
|
39
|
+
path: "login"
|
|
40
|
+
}}
|
|
41
|
+
onSuccess={(res) => {
|
|
42
|
+
setAccessToken(res?.data?.token)
|
|
43
|
+
setUser(res?.data?.user)
|
|
44
|
+
router.push("/auth/me")
|
|
45
|
+
}}
|
|
46
|
+
footerControl={() => (
|
|
47
|
+
<>
|
|
48
|
+
<ButtonComponent
|
|
49
|
+
type="submit"
|
|
50
|
+
label="Login Now"
|
|
51
|
+
block
|
|
52
|
+
className="mt-4"
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
<p className="mt-4 text-center">Don't have an account yet? <Link href="/auth/register" className="text-primary underline">Create Account</Link></p>
|
|
56
|
+
</>
|
|
57
|
+
)}
|
|
58
|
+
/>
|
|
59
|
+
</CardComponent>
|
|
60
|
+
</div>
|
|
61
|
+
</>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useRouter } from "next/navigation";
|
|
4
|
+
import { auth } from "@utils";
|
|
5
|
+
import { useAuthContext } from "@contexts";
|
|
6
|
+
import { ButtonComponent, CardComponent, ImageComponent } from "@components";
|
|
7
|
+
|
|
8
|
+
export default function Login() {
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
const {user} = useAuthContext();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<div className="h-screen flex flex-col justify-center items-center">
|
|
15
|
+
<h1 className="text-2xl font-extrabold italic">WELCOME TO NEXT-LIGHT v.3</h1>
|
|
16
|
+
<p className="text-sm font-semibold mt-6">Your account!</p>
|
|
17
|
+
|
|
18
|
+
<CardComponent className="mt-4 p-6 w-[400px] rounded-2xl">
|
|
19
|
+
<div className="flex gap-4">
|
|
20
|
+
{user?.image && (
|
|
21
|
+
|
|
22
|
+
<div className="bg-slate-200 aspect-[3/4] w-full rounded flex justify-center items-center">
|
|
23
|
+
<ImageComponent src={process.env.NEXT_PUBLIC_STORAGE_HOST + user?.image} width={400} height={600} alt="" />
|
|
24
|
+
</div>
|
|
25
|
+
)}
|
|
26
|
+
<div className="flex flex-col gap-4">
|
|
27
|
+
<div>
|
|
28
|
+
<p className="text-xs font-semibold text-light-foreground">
|
|
29
|
+
Name
|
|
30
|
+
</p>
|
|
31
|
+
<p>{user?.name}</p>
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
<p className="text-xs font-semibold text-light-foreground">
|
|
35
|
+
Email
|
|
36
|
+
</p>
|
|
37
|
+
<p>{user?.email}</p>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<ButtonComponent href="/auth/edit" label="Change" variant="light" block className="py-1.5" />
|
|
41
|
+
<ButtonComponent
|
|
42
|
+
label="Logout"
|
|
43
|
+
variant="outline"
|
|
44
|
+
paint="danger"
|
|
45
|
+
className="py-1.5"
|
|
46
|
+
block
|
|
47
|
+
onClick={() => {
|
|
48
|
+
auth.deleteAccessToken()
|
|
49
|
+
router.push("/auth/login")
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</CardComponent>
|
|
55
|
+
</div>
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
5
|
+
import { ButtonComponent, CardComponent, FormSupervisionComponent } from "@components";
|
|
6
|
+
import { useAuthContext } from "@contexts";
|
|
7
|
+
|
|
8
|
+
export default function Register() {
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
const {setRegisterToken} = useAuthContext();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<div className="h-screen flex flex-col justify-center items-center">
|
|
15
|
+
<h1 className="text-2xl font-extrabold italic">WELCOME TO NEXT-LIGHT v.3</h1>
|
|
16
|
+
<p className="text-sm font-semibold mt-6">Create new account!</p>
|
|
17
|
+
|
|
18
|
+
<CardComponent className="mt-4 p-6 w-[400px] rounded-2xl">
|
|
19
|
+
<FormSupervisionComponent
|
|
20
|
+
fields={[
|
|
21
|
+
{
|
|
22
|
+
construction: {
|
|
23
|
+
name: "name",
|
|
24
|
+
label: "Nama",
|
|
25
|
+
placeholder: "Ex: Joko Gunawan",
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
construction: {
|
|
30
|
+
name: "email",
|
|
31
|
+
label: "E-mail",
|
|
32
|
+
placeholder: "Ex: example@mail.com",
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: "enter-password",
|
|
37
|
+
construction: {
|
|
38
|
+
name: "password",
|
|
39
|
+
label: "Password",
|
|
40
|
+
placeholder: "Ex: secret123",
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
]}
|
|
44
|
+
submitControl={{
|
|
45
|
+
path: "register"
|
|
46
|
+
}}
|
|
47
|
+
onSuccess={(res) => {
|
|
48
|
+
setRegisterToken(res?.data?.token)
|
|
49
|
+
router.push("/auth/verify")
|
|
50
|
+
}}
|
|
51
|
+
footerControl={({loading}) => (
|
|
52
|
+
<>
|
|
53
|
+
<ButtonComponent
|
|
54
|
+
type="submit"
|
|
55
|
+
label="Create Account"
|
|
56
|
+
block
|
|
57
|
+
className="mt-4"
|
|
58
|
+
loading={loading}
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
<p className="mt-4 text-center">Already have an account? <Link href="/auth/login" className="text-primary underline">Login</Link></p>
|
|
62
|
+
</>
|
|
63
|
+
)}
|
|
64
|
+
/>
|
|
65
|
+
</CardComponent>
|
|
66
|
+
</div>
|
|
67
|
+
</>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
5
|
+
import { ButtonComponent, CardComponent, FormSupervisionComponent } from "@components";
|
|
6
|
+
import { useAuthContext } from "@contexts/.";
|
|
7
|
+
|
|
8
|
+
export default function Verify() {
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
const {registerToken} = useAuthContext();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<div className="h-screen flex flex-col justify-center items-center">
|
|
15
|
+
<h1 className="text-2xl font-extrabold italic">WELCOME TO NEXT-LIGHT v.3</h1>
|
|
16
|
+
<p className="text-sm font-semibold mt-6">Verify your email!</p>
|
|
17
|
+
|
|
18
|
+
<CardComponent className="mt-4 p-6 w-[400px] rounded-2xl">
|
|
19
|
+
<FormSupervisionComponent
|
|
20
|
+
fields={[
|
|
21
|
+
{
|
|
22
|
+
type: "otp",
|
|
23
|
+
construction: {
|
|
24
|
+
name: "token",
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
]}
|
|
28
|
+
submitControl={{
|
|
29
|
+
path: "verify",
|
|
30
|
+
bearer: registerToken || "",
|
|
31
|
+
}}
|
|
32
|
+
onSuccess={() => {
|
|
33
|
+
router.push("/auth/login")
|
|
34
|
+
}}
|
|
35
|
+
footerControl={({loading}) => (
|
|
36
|
+
<>
|
|
37
|
+
<ButtonComponent
|
|
38
|
+
type="submit"
|
|
39
|
+
label="Submit"
|
|
40
|
+
block
|
|
41
|
+
className="mt-4"
|
|
42
|
+
loading={loading}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<p className="mt-4 text-center">Already have an account? <Link href="/auth/login" className="text-primary underline">Login</Link></p>
|
|
46
|
+
</>
|
|
47
|
+
)}
|
|
48
|
+
/>
|
|
49
|
+
</CardComponent>
|
|
50
|
+
</div>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { SidebarComponent, SidebarContentComponent } from "@components";
|
|
3
|
+
|
|
4
|
+
export default function ExampleLayout({ children }: { children: ReactNode }) {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<div className="flex">
|
|
8
|
+
<SidebarComponent
|
|
9
|
+
basePath="/dashboard"
|
|
10
|
+
head={
|
|
11
|
+
<div className="px-4">
|
|
12
|
+
<a href="#" className="text-2xl font-extrabold italic">
|
|
13
|
+
NEXT-LIGHT v.3
|
|
14
|
+
</a>
|
|
15
|
+
<p className="text-sm -mt-1 font-semibold text-slate-400">
|
|
16
|
+
The Magic Starter Template
|
|
17
|
+
</p>
|
|
18
|
+
</div>
|
|
19
|
+
}
|
|
20
|
+
items={[
|
|
21
|
+
{
|
|
22
|
+
label: "WELCOME",
|
|
23
|
+
items: [
|
|
24
|
+
{
|
|
25
|
+
label: "Welcome",
|
|
26
|
+
path: "/",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "USER",
|
|
32
|
+
items: [
|
|
33
|
+
{
|
|
34
|
+
label: "User",
|
|
35
|
+
path: "/user",
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
<SidebarContentComponent>
|
|
42
|
+
<div className="p-2 lg:p-4">{children}</div>
|
|
43
|
+
</SidebarContentComponent>
|
|
44
|
+
</div>
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { TableSupervisionComponent} from "@components";
|
|
2
|
+
import { Suspense } from "react";
|
|
3
|
+
|
|
4
|
+
export default function Table() {
|
|
5
|
+
return (
|
|
6
|
+
<Suspense fallback={<div>Loading...</div>}>
|
|
7
|
+
<TableSupervisionComponent
|
|
8
|
+
title="User"
|
|
9
|
+
fetchControl={{
|
|
10
|
+
path: "users",
|
|
11
|
+
}}
|
|
12
|
+
columnControl={[
|
|
13
|
+
{
|
|
14
|
+
selector: "name",
|
|
15
|
+
label: "Nama",
|
|
16
|
+
sortable: true,
|
|
17
|
+
filterable: true,
|
|
18
|
+
width: "350px",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
selector: "email",
|
|
22
|
+
label: "Email",
|
|
23
|
+
sortable: true,
|
|
24
|
+
width: "250px",
|
|
25
|
+
},
|
|
26
|
+
]}
|
|
27
|
+
detailControl={[
|
|
28
|
+
{
|
|
29
|
+
label: "Nama",
|
|
30
|
+
item: "name",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "Email",
|
|
34
|
+
item: "email",
|
|
35
|
+
}
|
|
36
|
+
]}
|
|
37
|
+
formControl={{
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
construction: {
|
|
41
|
+
name: "email",
|
|
42
|
+
label: "E-mail",
|
|
43
|
+
placeholder: "Ex: example@mail.com",
|
|
44
|
+
validations: ["required"],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
construction: {
|
|
49
|
+
name: "name",
|
|
50
|
+
label: "Name",
|
|
51
|
+
placeholder: "Ex: Joko Gunawan",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
construction: {
|
|
56
|
+
name: "password",
|
|
57
|
+
label: "Password",
|
|
58
|
+
placeholder: "Ex: secret123",
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
construction: {
|
|
63
|
+
type: "file",
|
|
64
|
+
name: "image",
|
|
65
|
+
label: "Picture",
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
}}
|
|
70
|
+
controlBar={["CREATE", "FILTER", "SEARCH", "SORT", "SELECTABLE", "IMPORT", "EXPORT", "PRINT", "REFRESH"]}
|
|
71
|
+
responsiveControl={{
|
|
72
|
+
mobile: true,
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
</Suspense>
|
|
76
|
+
);
|
|
77
|
+
}
|
package/app/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from "./layout";
|
|
6
|
+
export * from "./page";
|
|
7
|
+
export * from "./auth/edit/page";
|
|
8
|
+
export * from "./auth/login/page";
|
|
9
|
+
export * from "./auth/me/page";
|
|
10
|
+
export * from "./auth/register/page";
|
|
11
|
+
export * from "./auth/verify/page";
|
|
12
|
+
export * from "./dashboard/layout";
|
|
13
|
+
export * from "./dashboard/page";
|
|
14
|
+
export * from "./dashboard/user/page";
|
package/app/layout.tsx
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import { Roboto } from "next/font/google";
|
|
4
|
+
import "@styles/globals.css";
|
|
5
|
+
|
|
6
|
+
import moment from "moment";
|
|
7
|
+
import "moment/locale/id";
|
|
8
|
+
|
|
9
|
+
import { config } from "@fortawesome/fontawesome-svg-core";
|
|
10
|
+
import "@fortawesome/fontawesome-svg-core/styles.css";
|
|
11
|
+
|
|
12
|
+
import { ContextAppProvider } from "@contexts/AppProvider";
|
|
13
|
+
import { IDBProvider, ShortcutProvider } from "@components";
|
|
14
|
+
|
|
15
|
+
moment.locale("id");
|
|
16
|
+
config.autoAddCss = false;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const font = Roboto({
|
|
20
|
+
subsets: ["latin"],
|
|
21
|
+
weight: ["100", "300", "400", "500", "700", "900"],
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export default function AppLayout({ children }: { children: ReactNode }) {
|
|
26
|
+
return (
|
|
27
|
+
<html lang="id" className={font.className}>
|
|
28
|
+
<body className="antialiased">
|
|
29
|
+
<ContextAppProvider>
|
|
30
|
+
<ShortcutProvider />
|
|
31
|
+
<IDBProvider>
|
|
32
|
+
{children}
|
|
33
|
+
</IDBProvider>
|
|
34
|
+
</ContextAppProvider>
|
|
35
|
+
</body>
|
|
36
|
+
</html>
|
|
37
|
+
);
|
|
38
|
+
}
|
package/app/page.tsx
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default function Home() {
|
|
2
|
+
return (
|
|
3
|
+
<>
|
|
4
|
+
<div className="h-screen flex flex-col justify-center items-center">
|
|
5
|
+
<h1 className="text-2xl font-extrabold italic">NEXT-LIGHT v.3</h1>
|
|
6
|
+
|
|
7
|
+
<p className="text-sm -mt-1 font-semibold text-light-foreground">
|
|
8
|
+
The Magic Starter Template
|
|
9
|
+
</p>
|
|
10
|
+
</div>
|
|
11
|
+
</>
|
|
12
|
+
);
|
|
13
|
+
}
|