ab-nextjs-core 0.1.0 → 0.1.2

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.
@@ -0,0 +1,134 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-core
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-core
27
+ * @name: AB Screen Layout - Component Stylesheet (plain CSS, Tailwind-independent)
28
+ * @file: ab-screen-layout/styles.module.css
29
+ * @type: CSS Module
30
+ * @authors: Abraham Ukachi <abraham.ukachi@laplateforme.io>
31
+ */
32
+
33
+ /*
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ * MOTTO: We'll always do more 😜!!!
36
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ */
38
+
39
+
40
+ /* ===== AB SCREEN LAYOUT STYLES ===== */
41
+
42
+ .abScreenLayout {
43
+ position: relative;
44
+ display: flex;
45
+ flex-direction: column;
46
+ width: 100%;
47
+ height: 100%;
48
+ }
49
+
50
+ .abScreenLayout__headerWrapper {
51
+ position: absolute;
52
+ top: 0;
53
+ left: 0;
54
+ right: 0;
55
+ display: flex;
56
+ flex-direction: column;
57
+ width: 100%;
58
+ height: auto;
59
+ z-index: 20;
60
+ pointer-events: none;
61
+ }
62
+
63
+ .abScreenLayout__contentWrapper {
64
+ position: relative;
65
+ display: flex;
66
+ flex-direction: column;
67
+ width: 100%;
68
+ height: 100%;
69
+ justify-content: space-between;
70
+ z-index: 10;
71
+ }
72
+
73
+ @media (min-width: 768px) {
74
+ .abScreenLayout__contentWrapper { flex-direction: row; }
75
+ }
76
+
77
+ @media (min-width: 1536px) {
78
+ .abScreenLayout__contentWrapper > *:nth-child(1) {
79
+ margin: 1.5rem;
80
+ border-radius: 1.5rem;
81
+ max-height: calc(100vh - 3rem);
82
+ }
83
+ }
84
+
85
+ .abScreenLayout__footerWrapper {
86
+ position: absolute;
87
+ bottom: 0;
88
+ left: 0;
89
+ right: 0;
90
+ display: flex;
91
+ flex-direction: column;
92
+ width: 100%;
93
+ height: auto;
94
+ z-index: 20;
95
+ pointer-events: none;
96
+ }
97
+
98
+ .abScreenLayout__backdrop {
99
+ position: absolute;
100
+ inset: 0;
101
+ display: flex;
102
+ flex-direction: column;
103
+ align-items: center;
104
+ width: 100%;
105
+ height: 100%;
106
+ z-index: 40;
107
+ backdrop-filter: blur(4px);
108
+ }
109
+
110
+ .abScreenLayout__menus,
111
+ .abScreenLayout__dialogs,
112
+ .abScreenLayout__toasts {
113
+ position: absolute;
114
+ inset: 0;
115
+ width: 100%;
116
+ height: 100%;
117
+ z-index: 50;
118
+ }
119
+
120
+ .abScreenLayout__toasts { animation: abCoreFadeIn 300ms ease-in-out; }
121
+
122
+ .abScreenLayout__canvas {
123
+ position: absolute;
124
+ inset: 0;
125
+ width: 100%;
126
+ height: 100%;
127
+ pointer-events: none;
128
+ z-index: 50;
129
+ }
130
+
131
+ @keyframes abCoreFadeIn {
132
+ from { opacity: 0; }
133
+ to { opacity: 1; }
134
+ }
package/index.ts ADDED
@@ -0,0 +1,58 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-core
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-core
27
+ * @name: Core - Package Catalog
28
+ * @file: index.ts
29
+ * @type: TypeScript
30
+ * @authors: Abraham Ukachi <abraham.ukachi@laplateforme.io>
31
+ */
32
+
33
+ /*
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ * MOTTO: We'll always do more 😜!!!
36
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ */
38
+
39
+ import type { CoreCatalogEntry } from './types'
40
+
41
+ const supportedCore: Array<CoreCatalogEntry> = [
42
+ // ------ SERVER components ------
43
+ { name: 'AbAppLayout', file: 'server/ab-app-layout/index.tsx', kind: 'server', status: 'Done' },
44
+ { name: 'AbScreenLayout', file: 'server/ab-screen-layout/index.tsx', kind: 'server', status: 'Done' },
45
+ { name: 'AbMainLayout', file: 'server/ab-main-layout/index.tsx', kind: 'server', status: 'Done' },
46
+ { name: 'AbAsideLayout', file: 'server/ab-aside-layout/index.tsx', kind: 'server', status: 'Done' },
47
+
48
+ // ------ CLIENT components ------
49
+ { name: 'AbAppLayout', file: 'ab-app-layout/index.tsx', kind: 'client', status: 'Done' },
50
+ { name: 'AbScreenLayout', file: 'ab-screen-layout/index.tsx', kind: 'client', status: 'Done' },
51
+ { name: 'AbMainLayout', file: 'ab-main-layout/index.tsx', kind: 'client', status: 'Done' },
52
+ { name: 'AbAsideLayout', file: 'ab-aside-layout/index.tsx', kind: 'client', status: 'Done' },
53
+ ]
54
+
55
+ const abCore = { supportedCore }
56
+
57
+ export { supportedCore }
58
+ export default abCore
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "ab-nextjs-core",
3
- "version": "0.1.0",
4
- "description": "🌱 A lightweight collection of server & client React components as core abElements (i.e. ab-app-layout, ab-screen-layout, ...) created by Abraham Ukachi, and optimized for Next.js applications 😎.",
3
+ "version": "0.1.2",
4
+ "description": "\ud83c\udf31 A lightweight collection of server & client React components as core abElements (i.e. ab-app-layout, ab-screen-layout, ...) created by Abraham Ukachi, and optimized for Next.js applications \ud83d\ude0e.",
5
+ "type": "module",
5
6
  "main": "index.ts",
6
7
  "types": "types/index.d.ts",
7
8
  "homepage": "https://github.com/abraham-ukachi/ab-nextjs-core",
@@ -12,13 +13,18 @@
12
13
  "bugs": {
13
14
  "url": "https://github.com/abraham-ukachi/ab-nextjs-core/issues"
14
15
  },
16
+ "scripts": {
17
+ "lint": "eslint . --fix",
18
+ "test": "vitest run"
19
+ },
15
20
  "keywords": [
16
21
  "react",
17
22
  "nextjs",
18
23
  "core",
19
24
  "abraham",
20
25
  "ukachi",
21
- "ab-nextjs-core"
26
+ "ab-nextjs-core",
27
+ "ab-elements"
22
28
  ],
23
29
  "author": {
24
30
  "name": "Abraham Ukachi",
@@ -26,7 +32,53 @@
26
32
  "email": "abraham.ukachi@laplateforme.io"
27
33
  },
28
34
  "license": "MIT",
29
- "scripts": {
30
- "test": "echo \"Error: no test specified\" && exit 1"
35
+ "peerDependencies": {
36
+ "clsx": "^2",
37
+ "next": "16.3.4",
38
+ "react": "^19",
39
+ "react-dom": "^19"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^20",
43
+ "@types/react": "^19",
44
+ "clsx": "^2.1.1",
45
+ "eslint": "^9.39.0",
46
+ "eslint-config-next": "16.3.4",
47
+ "next": "16.3.4",
48
+ "react": "^19",
49
+ "react-dom": "^19",
50
+ "typescript": "^5",
51
+ "vitest": "^3"
52
+ },
53
+ "files": [
54
+ "index.ts",
55
+ "types",
56
+ "server",
57
+ "ab-app-layout",
58
+ "ab-screen-layout",
59
+ "ab-main-layout",
60
+ "ab-aside-layout",
61
+ "ab-linear-progress",
62
+ "ab-page-provider",
63
+ "README.md",
64
+ "LICENSE",
65
+ "CHANGELOG.md"
66
+ ],
67
+ "exports": {
68
+ ".": {
69
+ "types": "./types/index.d.ts",
70
+ "default": "./index.ts"
71
+ },
72
+ "./package.json": "./package.json",
73
+ "./server/ab-app-layout": "./server/ab-app-layout/index.tsx",
74
+ "./server/ab-screen-layout": "./server/ab-screen-layout/index.tsx",
75
+ "./server/ab-main-layout": "./server/ab-main-layout/index.tsx",
76
+ "./server/ab-aside-layout": "./server/ab-aside-layout/index.tsx",
77
+ "./ab-app-layout": "./ab-app-layout/index.tsx",
78
+ "./ab-screen-layout": "./ab-screen-layout/index.tsx",
79
+ "./ab-main-layout": "./ab-main-layout/index.tsx",
80
+ "./ab-aside-layout": "./ab-aside-layout/index.tsx",
81
+ "./ab-page-provider": "./ab-page-provider/index.tsx",
82
+ "./ab-linear-progress": "./ab-linear-progress/index.tsx"
31
83
  }
32
- }
84
+ }
@@ -0,0 +1,113 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-core
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-core
27
+ * @authors: Abraham Ukachi <abraham.ukachi@laplateforme.io>
28
+ */
29
+
30
+ /*
31
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
32
+ * MOTTO: We'll always do more 😜!!!
33
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34
+ */
35
+
36
+ import type { ReactElement, ReactNode } from 'react';
37
+ import clsx from 'clsx';
38
+ import AbLinearProgress from '../../ab-linear-progress';
39
+ import styles from './styles.module.css';
40
+
41
+ export interface AbAppLayoutProps {
42
+ orientation: 'vertical' | 'horizontal';
43
+ className?: string;
44
+ hidden?: boolean;
45
+ pageName?: string;
46
+ header?: ReactNode;
47
+ sideBar?: ReactNode;
48
+ content?: ReactNode;
49
+ navBar?: ReactNode;
50
+ footer?: ReactNode;
51
+ children?: ReactNode;
52
+ menus?: ReactNode;
53
+ }
54
+
55
+ /**
56
+ * Ab App Layout — Core Server Component (from LYD LydAppLayout).
57
+ * Slots only — does NOT default to LYD Sidebar/NavBar/next-intl.
58
+ */
59
+ const AbAppLayout = ({
60
+ orientation,
61
+ className,
62
+ hidden,
63
+ pageName,
64
+ header,
65
+ sideBar,
66
+ content,
67
+ navBar,
68
+ footer,
69
+ children,
70
+ menus,
71
+ }: AbAppLayoutProps): ReactElement => {
72
+ return (
73
+ <div
74
+ className={clsx(['AbAppLayout', styles.abAppLayout, className])}
75
+ hidden={hidden}
76
+ data-page-name={pageName}
77
+ data-orientation={orientation ?? ''}
78
+ >
79
+ <div className={clsx(['HeaderWrapper', styles.abAppLayout__headerWrapper])}>
80
+ {header}
81
+ </div>
82
+
83
+ <div className={clsx(['ContentWrapper', styles.abAppLayout__contentWrapper])}>
84
+ {sideBar}
85
+ {content ?? children}
86
+ {navBar}
87
+ </div>
88
+
89
+ <div className={clsx(['FooterWrapper', styles.abAppLayout__footerWrapper])}>
90
+ {footer}
91
+ </div>
92
+
93
+ <div id="backdrop" className={clsx(['Backdrop', styles.abAppLayout__backdrop])} hidden />
94
+ <div id="menus" className={clsx(['Menus', styles.abAppLayout__menus])} hidden>
95
+ {menus}
96
+ </div>
97
+ <div id="dialogs" className={clsx(['Dialogs', styles.abAppLayout__dialogs])} hidden />
98
+ <div id="toasts" className={clsx(['Toasts', styles.abAppLayout__toasts])} hidden />
99
+
100
+ <AbLinearProgress
101
+ className="absolute top-0 left-0 right-0 z-50 !h-0.5 lg:!h-1"
102
+ color="secondary"
103
+ hidden={true}
104
+ isIndeterminate={true}
105
+ progress={25}
106
+ />
107
+
108
+ <canvas className={clsx(['Canvas', styles.abAppLayout__canvas])} />
109
+ </div>
110
+ );
111
+ };
112
+
113
+ export default AbAppLayout;
@@ -0,0 +1,145 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-core
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-core
27
+ * @name: AB App Layout - Component Stylesheet (plain CSS, Tailwind-independent)
28
+ * @file: server/ab-app-layout/styles.module.css
29
+ * @type: CSS Module
30
+ * @authors: Abraham Ukachi <abraham.ukachi@laplateforme.io>
31
+ */
32
+
33
+ /*
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ * MOTTO: We'll always do more 😜!!!
36
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ */
38
+
39
+
40
+ /* ===== AB APP LAYOUT STYLES ===== */
41
+
42
+ .abAppLayout {
43
+ position: relative;
44
+ display: flex;
45
+ flex-direction: column;
46
+ width: 100%;
47
+ height: 100%;
48
+ }
49
+
50
+ .abAppLayout__headerWrapper {
51
+ position: absolute;
52
+ top: 0;
53
+ left: 0;
54
+ right: 0;
55
+ display: flex;
56
+ flex-direction: column;
57
+ width: 100%;
58
+ height: auto;
59
+ z-index: 20;
60
+ pointer-events: none;
61
+ }
62
+
63
+ .abAppLayout__contentWrapper {
64
+ position: relative;
65
+ display: flex;
66
+ flex-direction: column;
67
+ width: 100%;
68
+ height: 100%;
69
+ justify-content: space-between;
70
+ z-index: 10;
71
+ }
72
+
73
+ @media (min-width: 768px) {
74
+ .abAppLayout__contentWrapper { flex-direction: row; }
75
+ }
76
+
77
+ @media (min-width: 1536px) {
78
+ .abAppLayout__contentWrapper > *:nth-child(1) {
79
+ border-top-right-radius: 1.5rem;
80
+ border-bottom-right-radius: 1.5rem;
81
+ overflow: hidden;
82
+ margin-top: auto;
83
+ margin-bottom: auto;
84
+ margin-left: 0;
85
+ margin-right: 0;
86
+ max-height: calc(100vh - 3rem);
87
+ }
88
+
89
+ .abAppLayout__contentWrapper > *:nth-child(2) {
90
+ margin: 1.5rem;
91
+ border-radius: 1.5rem;
92
+ max-height: calc(100vh - 3rem);
93
+ }
94
+ }
95
+
96
+ .abAppLayout__footerWrapper {
97
+ position: absolute;
98
+ bottom: 0;
99
+ left: 0;
100
+ right: 0;
101
+ display: flex;
102
+ flex-direction: column;
103
+ width: 100%;
104
+ height: auto;
105
+ z-index: 20;
106
+ pointer-events: none;
107
+ }
108
+
109
+ .abAppLayout__backdrop {
110
+ position: absolute;
111
+ inset: 0;
112
+ display: flex;
113
+ flex-direction: column;
114
+ align-items: center;
115
+ width: 100%;
116
+ height: 100%;
117
+ z-index: 40;
118
+ backdrop-filter: blur(4px);
119
+ }
120
+
121
+ .abAppLayout__menus,
122
+ .abAppLayout__dialogs,
123
+ .abAppLayout__toasts {
124
+ position: absolute;
125
+ inset: 0;
126
+ width: 100%;
127
+ height: 100%;
128
+ z-index: 50;
129
+ }
130
+
131
+ .abAppLayout__toasts { animation: abCoreFadeIn 300ms ease-in-out; }
132
+
133
+ .abAppLayout__canvas {
134
+ position: absolute;
135
+ inset: 0;
136
+ width: 100%;
137
+ height: 100%;
138
+ pointer-events: none;
139
+ z-index: 50;
140
+ }
141
+
142
+ @keyframes abCoreFadeIn {
143
+ from { opacity: 0; }
144
+ to { opacity: 1; }
145
+ }
@@ -0,0 +1,117 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-core
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-core
27
+ * @authors: Abraham Ukachi <abraham.ukachi@laplateforme.io>
28
+ */
29
+
30
+ /*
31
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
32
+ * MOTTO: We'll always do more 😜!!!
33
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34
+ */
35
+
36
+ import type { ReactElement, ReactNode } from 'react';
37
+ import clsx from 'clsx';
38
+ import AbLinearProgress from '../../ab-linear-progress';
39
+ import styles from './styles.module.css';
40
+
41
+ export interface AbAsideLayoutProps {
42
+ orientation: 'vertical' | 'horizontal';
43
+ className?: string;
44
+ hidden?: boolean;
45
+ pageName?: string;
46
+ header?: ReactNode;
47
+ content?: ReactNode;
48
+ footer?: ReactNode;
49
+ children?: ReactNode;
50
+ dividerHidden?: boolean;
51
+ menus?: ReactNode;
52
+ }
53
+
54
+ /**
55
+ * Ab Aside Layout — Core Server Component (from LYD LydAsideLayout).
56
+ */
57
+ const AbAsideLayout = ({
58
+ orientation,
59
+ className,
60
+ hidden,
61
+ pageName,
62
+ header,
63
+ content,
64
+ footer,
65
+ children,
66
+ dividerHidden,
67
+ menus,
68
+ }: AbAsideLayoutProps): ReactElement => {
69
+ return (
70
+ <aside
71
+ className={clsx(['AbAsideLayout', styles.abAsideLayout, className])}
72
+ hidden={hidden}
73
+ data-page-name={pageName}
74
+ >
75
+ <div className={clsx(['HeaderWrapper', styles.abAsideLayout__headerWrapper])}>
76
+ {header}
77
+ </div>
78
+
79
+ <div
80
+ className={clsx([
81
+ 'ContentWrapper',
82
+ styles.abAsideLayout__contentWrapper,
83
+ orientation === 'horizontal' && '!flex-row',
84
+ ])}
85
+ >
86
+ {content ?? children}
87
+ </div>
88
+
89
+ <div className={clsx(['FooterWrapper', styles.abAsideLayout__footerWrapper])}>
90
+ {footer}
91
+ </div>
92
+
93
+ <div className={clsx(['Backdrop', styles.abAsideLayout__backdrop])} hidden />
94
+ <div className={clsx(['Menus', styles.abAsideLayout__menus])} hidden>
95
+ {menus}
96
+ </div>
97
+ <div className={clsx(['Dialogs', styles.abAsideLayout__dialogs])} hidden />
98
+ <div className={clsx(['Toasts', styles.abAsideLayout__toasts])} hidden />
99
+
100
+ {!dividerHidden && (
101
+ <span className={clsx(['divider', 'vertical', 'left', styles.abAsideLayout__divider])} />
102
+ )}
103
+
104
+ <AbLinearProgress
105
+ className="absolute top-0 left-0 right-0 z-50 !h-0.5 lg:!h-1"
106
+ color="secondary"
107
+ hidden={true}
108
+ isIndeterminate={true}
109
+ progress={25}
110
+ />
111
+
112
+ <canvas className={clsx(['Canvas', styles.abAsideLayout__canvas])} />
113
+ </aside>
114
+ );
115
+ };
116
+
117
+ export default AbAsideLayout;