remoraid 1.1.0 → 2.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/LICENSE +1 -1
- package/README.md +12 -0
- package/dist/core/index.cjs +1206 -0
- package/dist/core/index.d.ts +264 -0
- package/dist/core/index.js +1237 -0
- package/dist/{styles.css → core/styles.css} +5 -0
- package/dist/jsonforms/index.cjs +721 -0
- package/dist/jsonforms/index.d.ts +28 -0
- package/dist/jsonforms/index.js +724 -0
- package/dist/{ssc.cjs → server/index.cjs} +11 -7
- package/dist/server/index.d.ts +11 -0
- package/dist/{ssc.js → server/index.js} +7 -3
- package/package.json +24 -14
- package/dist/index.cjs +0 -412
- package/dist/index.d.ts +0 -51
- package/dist/index.js +0 -395
- package/dist/ssc.d.ts +0 -10
@@ -26,18 +26,19 @@ var __export = (target, all) => {
|
|
26
26
|
});
|
27
27
|
};
|
28
28
|
|
29
|
-
// src/
|
30
|
-
var
|
31
|
-
__export(
|
29
|
+
// src/server/index.ts
|
30
|
+
var exports_server = {};
|
31
|
+
__export(exports_server, {
|
32
32
|
EnvironmentShell: () => EnvironmentShell
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(exports_server);
|
35
35
|
|
36
|
-
// src/components/EnvironmentShell/index.tsx
|
36
|
+
// src/server/components/EnvironmentShell/index.tsx
|
37
37
|
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
38
38
|
function EnvironmentShell({
|
39
39
|
children,
|
40
|
-
vars
|
40
|
+
vars,
|
41
|
+
message
|
41
42
|
}) {
|
42
43
|
const missingVars = vars.filter((v) => !process.env[v]);
|
43
44
|
if (missingVars.length !== 0) {
|
@@ -59,7 +60,10 @@ function EnvironmentShell({
|
|
59
60
|
}, i, false, undefined, this))
|
60
61
|
}, undefined, false, undefined, this),
|
61
62
|
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("p", {
|
62
|
-
children: "Please specify in your '.env' file.
|
63
|
+
children: "Please specify in your '.env' file."
|
64
|
+
}, undefined, false, undefined, this),
|
65
|
+
message !== undefined && /* @__PURE__ */ jsx_dev_runtime.jsxDEV("p", {
|
66
|
+
children: "message"
|
63
67
|
}, undefined, false, undefined, this)
|
64
68
|
]
|
65
69
|
}, undefined, true, undefined, this);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { MantineSize } from "@mantine/core";
|
2
|
+
interface EnvironmentShellProps {
|
3
|
+
vars: string[];
|
4
|
+
message?: string;
|
5
|
+
m?: MantineSize | number;
|
6
|
+
mt?: MantineSize | number;
|
7
|
+
}
|
8
|
+
import { PropsWithChildren as PropsWithChildren2, ReactNode as ReactNode2 } from "react";
|
9
|
+
interface ServerEnvironmentShellProps extends EnvironmentShellProps {}
|
10
|
+
declare function EnvironmentShell({ children, vars, message }: PropsWithChildren2<ServerEnvironmentShellProps>): ReactNode2;
|
11
|
+
export { EnvironmentShell };
|
@@ -1,8 +1,9 @@
|
|
1
|
-
// src/components/EnvironmentShell/index.tsx
|
1
|
+
// src/server/components/EnvironmentShell/index.tsx
|
2
2
|
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
3
3
|
function EnvironmentShell({
|
4
4
|
children,
|
5
|
-
vars
|
5
|
+
vars,
|
6
|
+
message
|
6
7
|
}) {
|
7
8
|
const missingVars = vars.filter((v) => !process.env[v]);
|
8
9
|
if (missingVars.length !== 0) {
|
@@ -24,7 +25,10 @@ function EnvironmentShell({
|
|
24
25
|
}, i, false, undefined, this))
|
25
26
|
}, undefined, false, undefined, this),
|
26
27
|
/* @__PURE__ */ jsxDEV("p", {
|
27
|
-
children: "Please specify in your '.env' file.
|
28
|
+
children: "Please specify in your '.env' file."
|
29
|
+
}, undefined, false, undefined, this),
|
30
|
+
message !== undefined && /* @__PURE__ */ jsxDEV("p", {
|
31
|
+
children: "message"
|
28
32
|
}, undefined, false, undefined, this)
|
29
33
|
]
|
30
34
|
}, undefined, true, undefined, this);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "remoraid",
|
3
|
-
"version": "
|
3
|
+
"version": "2.0.0",
|
4
4
|
"author": "Konrad Goldammer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -12,7 +12,7 @@
|
|
12
12
|
"@types/bun": "^1.1.10",
|
13
13
|
"@types/css-modules": "^1.0.5",
|
14
14
|
"@types/react": "^19.1.2",
|
15
|
-
"bun-
|
15
|
+
"bun-dts": "^0.1.22",
|
16
16
|
"next": "^15.3.1",
|
17
17
|
"react": "^19.1.0",
|
18
18
|
"react-cookie": "^8.0.1"
|
@@ -24,20 +24,31 @@
|
|
24
24
|
"next": "^15.3.1",
|
25
25
|
"@mantine/core": "^7.17.4",
|
26
26
|
"@mantine/hooks": "^7.17.4",
|
27
|
-
"@
|
27
|
+
"@mantine/dates": "7.17.4",
|
28
|
+
"@tabler/icons-react": "^3.31.0",
|
29
|
+
"@jsonforms/core": "^3.5.1",
|
30
|
+
"@jsonforms/react": "^3.5.1",
|
31
|
+
"@jsonforms/vanilla-renderers": "^3.5.1"
|
28
32
|
},
|
29
33
|
"exports": {
|
30
|
-
"
|
31
|
-
"types": "./dist/index.d.ts",
|
32
|
-
"import": "./dist/index.js",
|
33
|
-
"require": "./dist/index.cjs"
|
34
|
+
"./core": {
|
35
|
+
"types": "./dist/core/index.d.ts",
|
36
|
+
"import": "./dist/core/index.js",
|
37
|
+
"require": "./dist/core/index.cjs"
|
34
38
|
},
|
35
|
-
"./
|
36
|
-
"
|
37
|
-
"import": "./dist/ssc.js",
|
38
|
-
"require": "./dist/ssc.cjs"
|
39
|
+
"./core/styles.css": {
|
40
|
+
"default": "./dist/core/styles.css"
|
39
41
|
},
|
40
|
-
"./
|
42
|
+
"./server": {
|
43
|
+
"types": "./dist/server/index.d.ts",
|
44
|
+
"import": "./dist/server/index.js",
|
45
|
+
"require": "./dist/server/index.cjs"
|
46
|
+
},
|
47
|
+
"./jsonforms": {
|
48
|
+
"types": "./dist/jsonforms/index.d.ts",
|
49
|
+
"import": "./dist/jsonforms/index.js",
|
50
|
+
"require": "./dist/jsonforms/index.cjs"
|
51
|
+
}
|
41
52
|
},
|
42
53
|
"bugs": "https://github.com/konradag/remoraid/issues",
|
43
54
|
"description": "A React components library built on top of Mantine",
|
@@ -54,6 +65,5 @@
|
|
54
65
|
"build": "bun run build.ts",
|
55
66
|
"prepublishOnly": "bun run build"
|
56
67
|
},
|
57
|
-
"type": "module"
|
58
|
-
"types": "./dist/index.d.ts"
|
68
|
+
"type": "module"
|
59
69
|
}
|
package/dist/index.cjs
DELETED
@@ -1,412 +0,0 @@
|
|
1
|
-
"use client";
|
2
|
-
var __create = Object.create;
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
4
|
-
var __defProp = Object.defineProperty;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __toESM = (mod, isNodeMode, target) => {
|
9
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
10
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
11
|
-
for (let key of __getOwnPropNames(mod))
|
12
|
-
if (!__hasOwnProp.call(to, key))
|
13
|
-
__defProp(to, key, {
|
14
|
-
get: () => mod[key],
|
15
|
-
enumerable: true
|
16
|
-
});
|
17
|
-
return to;
|
18
|
-
};
|
19
|
-
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
20
|
-
var __toCommonJS = (from) => {
|
21
|
-
var entry = __moduleCache.get(from), desc;
|
22
|
-
if (entry)
|
23
|
-
return entry;
|
24
|
-
entry = __defProp({}, "__esModule", { value: true });
|
25
|
-
if (from && typeof from === "object" || typeof from === "function")
|
26
|
-
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
27
|
-
get: () => from[key],
|
28
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
29
|
-
}));
|
30
|
-
__moduleCache.set(from, entry);
|
31
|
-
return entry;
|
32
|
-
};
|
33
|
-
var __export = (target, all) => {
|
34
|
-
for (var name in all)
|
35
|
-
__defProp(target, name, {
|
36
|
-
get: all[name],
|
37
|
-
enumerable: true,
|
38
|
-
configurable: true,
|
39
|
-
set: (newValue) => all[name] = () => newValue
|
40
|
-
});
|
41
|
-
};
|
42
|
-
|
43
|
-
// src/index.ts
|
44
|
-
var exports_src = {};
|
45
|
-
__export(exports_src, {
|
46
|
-
useUserExperience: () => useUserExperience,
|
47
|
-
useUpdateUserExperience: () => useUpdateUserExperience,
|
48
|
-
defaultNavbarSettings: () => defaultNavbarSettings,
|
49
|
-
UserExperienceProvider: () => UserExperienceProvider,
|
50
|
-
AppShell: () => AppShell
|
51
|
-
});
|
52
|
-
module.exports = __toCommonJS(exports_src);
|
53
|
-
|
54
|
-
// src/components/AppShell/NavbarMinimal/index.tsx
|
55
|
-
var import_core2 = require("@mantine/core");
|
56
|
-
var import_icons_react = require("@tabler/icons-react");
|
57
|
-
var import_link = __toESM(require("next/link"));
|
58
|
-
var import_navigation = require("next/navigation");
|
59
|
-
var import_react = require("react");
|
60
|
-
|
61
|
-
// src/lib/utils.ts
|
62
|
-
var import_core = require("@mantine/core");
|
63
|
-
var co = (condition, value, fallback) => condition(value) ? value : fallback;
|
64
|
-
var isMantinePrimaryShade = (primaryShade) => {
|
65
|
-
if (isNaN(Number(primaryShade))) {
|
66
|
-
return true;
|
67
|
-
}
|
68
|
-
return false;
|
69
|
-
};
|
70
|
-
var getCustomStyles = (theme, colorScheme) => {
|
71
|
-
return {
|
72
|
-
transparentBackground: colorScheme === "dark" ? import_core.rgba(theme.colors.dark[8], 0.8) : import_core.rgba(theme.white, 0.8),
|
73
|
-
iconSize: "1.125em",
|
74
|
-
primaryColor: theme.colors[theme.primaryColor][isMantinePrimaryShade(theme.primaryShade) ? theme.primaryShade[colorScheme === "auto" ? "light" : colorScheme] : theme.primaryShade],
|
75
|
-
spacingPx: {
|
76
|
-
xs: Number(co((v) => !Number.isNaN(v), Number(import_core.px(theme.spacing.xs)), 0)),
|
77
|
-
sm: Number(co((v) => !Number.isNaN(v), Number(import_core.px(theme.spacing.sm)), 0)),
|
78
|
-
md: Number(co((v) => !Number.isNaN(v), Number(import_core.px(theme.spacing.md)), 0)),
|
79
|
-
lg: Number(co((v) => !Number.isNaN(v), Number(import_core.px(theme.spacing.lg)), 0)),
|
80
|
-
xl: Number(co((v) => !Number.isNaN(v), Number(import_core.px(theme.spacing.xl)), 0))
|
81
|
-
}
|
82
|
-
};
|
83
|
-
};
|
84
|
-
|
85
|
-
// src/components/AppShell/NavbarMinimal/index.tsx
|
86
|
-
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
87
|
-
function NavbarLink({
|
88
|
-
icon: Icon2,
|
89
|
-
label,
|
90
|
-
active,
|
91
|
-
onClick,
|
92
|
-
href,
|
93
|
-
indicator,
|
94
|
-
settings
|
95
|
-
}) {
|
96
|
-
const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] = import_react.useState(false);
|
97
|
-
const iconProps = {
|
98
|
-
size: settings.iconSize,
|
99
|
-
stroke: 1.5
|
100
|
-
};
|
101
|
-
if (!href) {
|
102
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Tooltip, {
|
103
|
-
label,
|
104
|
-
position: "right",
|
105
|
-
transitionProps: { duration: 0 },
|
106
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.UnstyledButton, {
|
107
|
-
onClick,
|
108
|
-
className: "remoraid-navbar-minimal-link",
|
109
|
-
"data-active": active || undefined,
|
110
|
-
w: settings.linkSize,
|
111
|
-
h: settings.linkSize,
|
112
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Icon2, {
|
113
|
-
...iconProps
|
114
|
-
}, undefined, false, undefined, this)
|
115
|
-
}, undefined, false, undefined, this)
|
116
|
-
}, undefined, false, undefined, this);
|
117
|
-
}
|
118
|
-
const button = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.UnstyledButton, {
|
119
|
-
onClick,
|
120
|
-
className: "remoraid-navbar-minimal-link",
|
121
|
-
"data-active": active || undefined,
|
122
|
-
w: settings.linkSize,
|
123
|
-
h: settings.linkSize,
|
124
|
-
component: import_link.default,
|
125
|
-
href,
|
126
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Icon2, {
|
127
|
-
...iconProps
|
128
|
-
}, undefined, false, undefined, this)
|
129
|
-
}, undefined, false, undefined, this);
|
130
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Tooltip, {
|
131
|
-
label,
|
132
|
-
position: "right",
|
133
|
-
transitionProps: { duration: 0 },
|
134
|
-
children: indicator === undefined ? button : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Indicator, {
|
135
|
-
withBorder: true,
|
136
|
-
size: 13,
|
137
|
-
offset: 2,
|
138
|
-
onMouseEnter: () => setIsHoveringRoleIndicator(true),
|
139
|
-
onMouseLeave: () => setIsHoveringRoleIndicator(false),
|
140
|
-
...indicator(isHoveringRoleIndicator),
|
141
|
-
children: button
|
142
|
-
}, undefined, false, undefined, this)
|
143
|
-
}, undefined, false, undefined, this);
|
144
|
-
}
|
145
|
-
var defaultSettings = {
|
146
|
-
hiddenPages: [],
|
147
|
-
linkSize: import_core2.rem("50px"),
|
148
|
-
iconSize: "50%",
|
149
|
-
px: "sm",
|
150
|
-
py: "md"
|
151
|
-
};
|
152
|
-
function NavbarMinimal({
|
153
|
-
logo,
|
154
|
-
pages,
|
155
|
-
user,
|
156
|
-
settings: settingsProp,
|
157
|
-
linkIndicator,
|
158
|
-
logoIndicator,
|
159
|
-
onLogout
|
160
|
-
}) {
|
161
|
-
const pathname = import_navigation.usePathname();
|
162
|
-
const theme = import_core2.useMantineTheme();
|
163
|
-
const { setColorScheme, colorScheme } = import_core2.useMantineColorScheme();
|
164
|
-
const { transparentBackground } = getCustomStyles(theme, colorScheme);
|
165
|
-
const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] = import_react.useState(false);
|
166
|
-
const settings = settingsProp || defaultSettings;
|
167
|
-
const links = pages.filter((link) => !settings.hiddenPages.includes(link.href)).map((link) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(NavbarLink, {
|
168
|
-
active: link.href === pathname,
|
169
|
-
indicator: linkIndicator,
|
170
|
-
settings,
|
171
|
-
...link
|
172
|
-
}, link.label, false, undefined, this));
|
173
|
-
const logoImage = logo({
|
174
|
-
style: {
|
175
|
-
cursor: "pointer",
|
176
|
-
width: settings.linkSize,
|
177
|
-
height: settings.linkSize
|
178
|
-
}
|
179
|
-
});
|
180
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Paper, {
|
181
|
-
h: "100%",
|
182
|
-
py: settings.py,
|
183
|
-
bg: transparentBackground,
|
184
|
-
radius: 0,
|
185
|
-
shadow: "md",
|
186
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Flex, {
|
187
|
-
direction: "column",
|
188
|
-
h: "100%",
|
189
|
-
align: "center",
|
190
|
-
px: settings.px,
|
191
|
-
children: [
|
192
|
-
logoIndicator === undefined ? logoImage : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Indicator, {
|
193
|
-
withBorder: true,
|
194
|
-
offset: 2,
|
195
|
-
size: 13,
|
196
|
-
onMouseEnter: () => setIsHoveringRoleIndicator(true),
|
197
|
-
onMouseLeave: () => setIsHoveringRoleIndicator(false),
|
198
|
-
...logoIndicator(isHoveringRoleIndicator),
|
199
|
-
children: logoImage
|
200
|
-
}, undefined, false, undefined, this),
|
201
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Divider, {
|
202
|
-
my: "md",
|
203
|
-
variant: "dashed",
|
204
|
-
w: "100%"
|
205
|
-
}, undefined, false, undefined, this),
|
206
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Stack, {
|
207
|
-
justify: "flex-start",
|
208
|
-
gap: 0,
|
209
|
-
flex: 1,
|
210
|
-
children: links
|
211
|
-
}, undefined, false, undefined, this),
|
212
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core2.Stack, {
|
213
|
-
justify: "center",
|
214
|
-
gap: 0,
|
215
|
-
children: [
|
216
|
-
user !== undefined && (user === null ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(NavbarLink, {
|
217
|
-
icon: import_icons_react.IconLogin,
|
218
|
-
label: "Login",
|
219
|
-
href: "/login",
|
220
|
-
active: pathname === "/login",
|
221
|
-
settings
|
222
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(NavbarLink, {
|
223
|
-
icon: import_icons_react.IconLogout,
|
224
|
-
label: "Logout",
|
225
|
-
onClick: () => {
|
226
|
-
if (onLogout) {
|
227
|
-
onLogout();
|
228
|
-
}
|
229
|
-
},
|
230
|
-
href: "/login",
|
231
|
-
settings
|
232
|
-
}, undefined, false, undefined, this)),
|
233
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(NavbarLink, {
|
234
|
-
icon: colorScheme === "dark" ? import_icons_react.IconSun : import_icons_react.IconMoon,
|
235
|
-
onClick: () => {
|
236
|
-
if (colorScheme === "dark") {
|
237
|
-
setColorScheme("light");
|
238
|
-
} else {
|
239
|
-
setColorScheme("dark");
|
240
|
-
}
|
241
|
-
},
|
242
|
-
label: "Toggle Color Scheme",
|
243
|
-
settings
|
244
|
-
}, undefined, false, undefined, this)
|
245
|
-
]
|
246
|
-
}, undefined, true, undefined, this)
|
247
|
-
]
|
248
|
-
}, undefined, true, undefined, this)
|
249
|
-
}, undefined, false, undefined, this);
|
250
|
-
}
|
251
|
-
|
252
|
-
// src/lib/navbar-utils.ts
|
253
|
-
var defaultNavbarVariant = "minimal";
|
254
|
-
var defaultNavbarSettings = {
|
255
|
-
minimal: defaultSettings
|
256
|
-
};
|
257
|
-
|
258
|
-
// src/components/UserExperienceProvider/index.tsx
|
259
|
-
var import_react2 = __toESM(require("react"));
|
260
|
-
var import_react_cookie = require("react-cookie");
|
261
|
-
var jsx_dev_runtime2 = require("react/jsx-dev-runtime");
|
262
|
-
var defaultUserExperience = {
|
263
|
-
navbarVariant: defaultNavbarVariant,
|
264
|
-
navbarSettings: defaultNavbarSettings[defaultNavbarVariant],
|
265
|
-
showWelcomeMessage: true
|
266
|
-
};
|
267
|
-
var userExperienceContext = import_react2.default.createContext(defaultUserExperience);
|
268
|
-
var updateUserExperienceContext = import_react2.default.createContext(null);
|
269
|
-
var useUserExperience = () => {
|
270
|
-
return import_react2.useContext(userExperienceContext);
|
271
|
-
};
|
272
|
-
var useUpdateUserExperience = () => {
|
273
|
-
return import_react2.useContext(updateUserExperienceContext);
|
274
|
-
};
|
275
|
-
function UserExperienceProvider({
|
276
|
-
children
|
277
|
-
}) {
|
278
|
-
const [cookies, setCookie] = import_react_cookie.useCookies();
|
279
|
-
const isUserExperience = (x) => {
|
280
|
-
if (typeof x !== "object") {
|
281
|
-
return false;
|
282
|
-
}
|
283
|
-
if (!("showWelcomeMessage" in x)) {
|
284
|
-
return false;
|
285
|
-
}
|
286
|
-
if (!("navbarVariant" in x)) {
|
287
|
-
return false;
|
288
|
-
}
|
289
|
-
if (!("navbarSettings" in x)) {
|
290
|
-
return false;
|
291
|
-
}
|
292
|
-
if (typeof x.navbarSettings !== "object") {
|
293
|
-
return false;
|
294
|
-
}
|
295
|
-
if (!("hiddenPages" in x.navbarSettings)) {
|
296
|
-
return false;
|
297
|
-
}
|
298
|
-
if (!("linkSize" in x.navbarSettings)) {
|
299
|
-
return false;
|
300
|
-
}
|
301
|
-
if (!("px" in x.navbarSettings)) {
|
302
|
-
return false;
|
303
|
-
}
|
304
|
-
if (!("py" in x.navbarSettings)) {
|
305
|
-
return false;
|
306
|
-
}
|
307
|
-
return true;
|
308
|
-
};
|
309
|
-
const userExperience = cookies["userExperience"] && isUserExperience(cookies["userExperience"]) ? cookies["userExperience"] : defaultUserExperience;
|
310
|
-
const updateUserExperience = (p) => {
|
311
|
-
if (typeof p === "function") {
|
312
|
-
setCookie("userExperience", p(userExperience), { path: "/" });
|
313
|
-
return;
|
314
|
-
}
|
315
|
-
setCookie("userExperience", p, { path: "/" });
|
316
|
-
};
|
317
|
-
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(updateUserExperienceContext.Provider, {
|
318
|
-
value: updateUserExperience,
|
319
|
-
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(userExperienceContext.Provider, {
|
320
|
-
value: userExperience,
|
321
|
-
children
|
322
|
-
}, undefined, false, undefined, this)
|
323
|
-
}, undefined, false, undefined, this);
|
324
|
-
}
|
325
|
-
// src/components/AppShell/index.tsx
|
326
|
-
var import_core4 = require("@mantine/core");
|
327
|
-
var import_hooks = require("@mantine/hooks");
|
328
|
-
|
329
|
-
// src/components/AppShell/Footer/index.tsx
|
330
|
-
var import_core3 = require("@mantine/core");
|
331
|
-
var import_icons_react2 = require("@tabler/icons-react");
|
332
|
-
var jsx_dev_runtime3 = require("react/jsx-dev-runtime");
|
333
|
-
function Footer() {
|
334
|
-
const theme = import_core3.useMantineTheme();
|
335
|
-
const { colorScheme } = import_core3.useMantineColorScheme();
|
336
|
-
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_core3.Group, {
|
337
|
-
justify: "center",
|
338
|
-
w: "100%",
|
339
|
-
py: "md",
|
340
|
-
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_icons_react2.IconPennant, {
|
341
|
-
size: 50,
|
342
|
-
color: colorScheme === "dark" ? theme.colors.dark[8] : theme.colors.gray[3]
|
343
|
-
}, undefined, false, undefined, this)
|
344
|
-
}, undefined, false, undefined, this);
|
345
|
-
}
|
346
|
-
|
347
|
-
// src/components/AppShell/index.tsx
|
348
|
-
var jsx_dev_runtime4 = require("react/jsx-dev-runtime");
|
349
|
-
function AppShell({
|
350
|
-
children,
|
351
|
-
logo,
|
352
|
-
pages,
|
353
|
-
navbar,
|
354
|
-
user
|
355
|
-
}) {
|
356
|
-
const theme = import_core4.useMantineTheme();
|
357
|
-
const { colorScheme } = import_core4.useMantineColorScheme();
|
358
|
-
const { spacingPx } = getCustomStyles(theme, colorScheme);
|
359
|
-
const [opened, { toggle }] = import_hooks.useDisclosure();
|
360
|
-
const navbarVariant = navbar && navbar.variant ? navbar.variant : defaultNavbarVariant;
|
361
|
-
const navbarSettings = navbar && navbar.settings ? navbar.settings : defaultNavbarSettings[defaultNavbarVariant];
|
362
|
-
const navbarLinkSizePx = co((v) => !Number.isNaN(v), Number(import_core4.px(navbarSettings.linkSize)), 0);
|
363
|
-
const navbarPaddingPx = typeof navbarSettings.px === "number" ? navbarSettings.px : spacingPx[navbarSettings.px];
|
364
|
-
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core4.AppShell, {
|
365
|
-
header: { height: 0 },
|
366
|
-
navbar: {
|
367
|
-
width: import_core4.rem(`${navbarLinkSizePx + 2 * navbarPaddingPx}px`),
|
368
|
-
breakpoint: "sm",
|
369
|
-
collapsed: { mobile: !opened }
|
370
|
-
},
|
371
|
-
bg: colorScheme === "dark" ? theme.colors.dark[9] : theme.colors.gray[0],
|
372
|
-
children: [
|
373
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core4.AppShell.Header, {
|
374
|
-
withBorder: false,
|
375
|
-
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core4.Group, {
|
376
|
-
p: "md",
|
377
|
-
bg: colorScheme === "dark" ? theme.colors.dark[8] : theme.colors.gray[3],
|
378
|
-
hiddenFrom: "sm",
|
379
|
-
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core4.Burger, {
|
380
|
-
opened,
|
381
|
-
onClick: toggle,
|
382
|
-
h: 20,
|
383
|
-
size: 18
|
384
|
-
}, undefined, false, undefined, this)
|
385
|
-
}, undefined, false, undefined, this)
|
386
|
-
}, undefined, false, undefined, this),
|
387
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core4.AppShell.Navbar, {
|
388
|
-
withBorder: false,
|
389
|
-
children: navbarVariant === "minimal" && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(NavbarMinimal, {
|
390
|
-
logo,
|
391
|
-
pages,
|
392
|
-
user,
|
393
|
-
...navbar
|
394
|
-
}, undefined, false, undefined, this)
|
395
|
-
}, undefined, false, undefined, this),
|
396
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core4.AppShell.Main, {
|
397
|
-
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
|
398
|
-
children: [
|
399
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core4.Paper, {
|
400
|
-
radius: 0,
|
401
|
-
my: "md",
|
402
|
-
h: 20,
|
403
|
-
hiddenFrom: "sm"
|
404
|
-
}, undefined, false, undefined, this),
|
405
|
-
children,
|
406
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Footer, {}, undefined, false, undefined, this)
|
407
|
-
]
|
408
|
-
}, undefined, true, undefined, this)
|
409
|
-
}, undefined, false, undefined, this)
|
410
|
-
]
|
411
|
-
}, undefined, true, undefined, this);
|
412
|
-
}
|
package/dist/index.d.ts
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
// Generated by dts-bundle-generator v9.5.1
|
2
|
-
|
3
|
-
import { IndicatorProps, MantineSize } from '@mantine/core';
|
4
|
-
import { Icon } from '@tabler/icons-react';
|
5
|
-
import { ImageProps } from 'next/image';
|
6
|
-
import React$1 from 'react';
|
7
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
8
|
-
|
9
|
-
export interface Page {
|
10
|
-
icon: Icon;
|
11
|
-
label: string;
|
12
|
-
href: string;
|
13
|
-
}
|
14
|
-
export type NavbarVariant = "minimal";
|
15
|
-
export interface NavbarSettings {
|
16
|
-
hiddenPages: string[];
|
17
|
-
linkSize: string;
|
18
|
-
px: MantineSize | number;
|
19
|
-
py: MantineSize | number;
|
20
|
-
iconSize?: string | number;
|
21
|
-
}
|
22
|
-
export interface UserExperience {
|
23
|
-
navbarVariant: NavbarVariant;
|
24
|
-
navbarSettings: NavbarSettings;
|
25
|
-
showWelcomeMessage: boolean;
|
26
|
-
}
|
27
|
-
export type AppShellLogo = (props: Omit<ImageProps, "src" | "alt">) => React$1.ReactNode;
|
28
|
-
export interface NavbarProps {
|
29
|
-
settings?: NavbarSettings;
|
30
|
-
variant?: NavbarVariant;
|
31
|
-
linkIndicator?: (isHovering: boolean) => IndicatorProps;
|
32
|
-
logoIndicator?: (isHovering: boolean) => IndicatorProps;
|
33
|
-
onLogout?: () => void;
|
34
|
-
}
|
35
|
-
export declare const useUserExperience: () => UserExperience;
|
36
|
-
export declare const useUpdateUserExperience: () => ((p: UserExperience | ((prev: UserExperience) => UserExperience)) => void) | null;
|
37
|
-
export function UserExperienceProvider({ children, }: React$1.PropsWithChildren): React$1.JSX.Element;
|
38
|
-
export interface AppShellProps {
|
39
|
-
logo: AppShellLogo;
|
40
|
-
pages: Page[];
|
41
|
-
navbar?: NavbarProps;
|
42
|
-
user?: {
|
43
|
-
name: string;
|
44
|
-
} | null;
|
45
|
-
}
|
46
|
-
export function AppShell({ children, logo, pages, navbar, user, }: React$1.PropsWithChildren<AppShellProps>): import("react").React$1.JSX.Element;
|
47
|
-
export declare const defaultNavbarSettings: {
|
48
|
-
[V in NavbarVariant]: NavbarSettings;
|
49
|
-
};
|
50
|
-
|
51
|
-
export {};
|