@canmingir/link 1.2.27 → 1.2.31

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.
Files changed (62) hide show
  1. package/package.json +9 -5
  2. package/src/assets/illustrations/avatar-shape.jsx +6 -7
  3. package/src/assets/illustrations/booking-illustration.jsx +4 -14
  4. package/src/assets/illustrations/check-in-illustration.jsx +4 -10
  5. package/src/assets/illustrations/check-out-illustration.jsx +4 -3
  6. package/src/assets/illustrations/coming-soon-illustration.jsx +4 -17
  7. package/src/assets/illustrations/forbidden-illustration.jsx +4 -12
  8. package/src/assets/illustrations/maintenance-illustration.jsx +4 -24
  9. package/src/assets/illustrations/motivation-illustration.jsx +4 -9
  10. package/src/assets/illustrations/order-complete-illustration.jsx +4 -12
  11. package/src/assets/illustrations/page-not-found-illustration.jsx +4 -9
  12. package/src/assets/illustrations/seo-illustration.jsx +4 -16
  13. package/src/assets/illustrations/sever-error-illustration.jsx +4 -21
  14. package/src/assets/illustrations/upgrade-storage-illustration.jsx +4 -20
  15. package/src/assets/illustrations/upload-illustration.jsx +4 -81
  16. package/src/components/TopNavBar/TopNavBar.jsx +6 -2
  17. package/src/components/file-thumbnail/file-thumbnail.jsx +5 -6
  18. package/src/components/label/label.jsx +0 -4
  19. package/src/components/nav-section/horizontal/nav-section-horizontal.jsx +5 -6
  20. package/src/components/settings/drawer/layout-options.jsx +5 -4
  21. package/src/components/settings/drawer/presets-options.jsx +6 -5
  22. package/src/components/settings/drawer/settings-drawer.jsx +7 -4
  23. package/src/components/settings/drawer/stretch-options.jsx +5 -5
  24. package/src/layouts/DashboardLayout/header.jsx +5 -4
  25. package/src/layouts/DashboardLayout/nav-mini.jsx +5 -7
  26. package/src/layouts/DashboardLayout/nav-vertical.jsx +11 -11
  27. package/src/layouts/FullScreenLayout/FullScreenLayout.jsx +5 -1
  28. package/src/layouts/FullScreenLayout/nav-vertical.jsx +11 -11
  29. package/src/layouts/MainLayout/footer.jsx +7 -7
  30. package/src/layouts/MainLayout/header.jsx +3 -2
  31. package/src/layouts/MainLayout/nav/desktop/nav-list.jsx +8 -8
  32. package/src/layouts/MainLayout/nav/mobile/index.jsx +7 -6
  33. package/src/layouts/TwoSideLayout/TwoSideLayout.jsx +9 -3
  34. package/src/layouts/auth/classic.jsx +6 -6
  35. package/src/layouts/auth/modern.jsx +49 -85
  36. package/src/layouts/common/ProjectBar/index.jsx +13 -11
  37. package/src/layouts/common/header-sim.jsx +3 -2
  38. package/src/layouts/common/header-simple.jsx +6 -3
  39. package/src/layouts/common/notifications-popover/index.jsx +18 -13
  40. package/src/layouts/common/notifications-popover/notification-item.jsx +28 -16
  41. package/src/lib/APIPath/APIPath.jsx +2 -2
  42. package/src/lib/APITree/APITree.jsx +3 -1
  43. package/src/lib/AddItemWizard/AddItemWizard.jsx +21 -10
  44. package/src/lib/CustomBreadcrumbs/CustomBreadcrumbs.jsx +3 -2
  45. package/src/lib/Flow/layouts/CardLayout.jsx +4 -3
  46. package/src/lib/Flow/nodes/DefaultCard.jsx +6 -8
  47. package/src/lib/IconSelector/IconSelector.jsx +5 -1
  48. package/src/lib/ItemSummary/ItemSummary.jsx +11 -6
  49. package/src/lib/ItemSummary/ItemsSummary.jsx +38 -26
  50. package/src/lib/Label/Label.jsx +0 -4
  51. package/src/lib/ResourceMenu/ResourceMenu.jsx +3 -1
  52. package/src/lib/SparkleInput/SparkleInput.jsx +31 -28
  53. package/src/lib/TableSelectedAction/TableSelectedAction.jsx +7 -8
  54. package/src/pages/ConfigError.jsx +3 -1
  55. package/src/pages/LoginPage.jsx +72 -2
  56. package/src/theme/index.jsx +47 -48
  57. package/src/theme/overrides/components/loading-button.js +5 -5
  58. package/src/theme/overrides/default-props.jsx +17 -11
  59. package/src/widgets/Login/CognitoLogin.jsx +66 -92
  60. package/src/widgets/Login/DemoLogin.jsx +43 -93
  61. package/src/widgets/Login/styles.jsx +35 -0
  62. package/src/widgets/SettingsDialog.jsx +45 -19
@@ -7,9 +7,11 @@ import config from "../config/config";
7
7
  import { storage } from "@nucleoidjs/webstorage";
8
8
  import { useEffect } from "react";
9
9
  import { useNavigate } from "react-router-dom";
10
+
11
+ import { Box, Stack, Typography, alpha } from "@mui/material";
12
+
10
13
  function LoginPage() {
11
14
  const { name, template, credentials } = config();
12
- const formColor = "#a8a9ad";
13
15
  const navigate = useNavigate();
14
16
 
15
17
  function token() {
@@ -32,10 +34,78 @@ function LoginPage() {
32
34
 
33
35
  return (
34
36
  <Page title={`Sign in to ${name}`}>
37
+ <Stack
38
+ spacing={0}
39
+ sx={{
40
+ mb: 4,
41
+ position: "relative",
42
+ }}
43
+ >
44
+ <Typography
45
+ variant="overline"
46
+ sx={{
47
+ color: "primary.main",
48
+ fontWeight: 700,
49
+ letterSpacing: "0.2em",
50
+ fontSize: "0.65rem",
51
+ mb: 1,
52
+ }}
53
+ >
54
+ {name}
55
+ </Typography>
56
+
57
+ <Typography
58
+ variant="h3"
59
+ sx={{ fontWeight: 800, lineHeight: 1.1, letterSpacing: "-0.02em" }}
60
+ >
61
+ Welcome{" "}
62
+ <Box
63
+ component="span"
64
+ sx={{
65
+ background: (theme) =>
66
+ `linear-gradient(135deg, ${theme.palette.primary.main}, ${theme.palette.primary.light})`,
67
+ backgroundClip: "text",
68
+ WebkitBackgroundClip: "text",
69
+ WebkitTextFillColor: "transparent",
70
+ }}
71
+ >
72
+ back.
73
+ </Box>
74
+ </Typography>
75
+
76
+ <Typography variant="body2" sx={{ color: "text.secondary", mt: 1.5 }}>
77
+ Enter your credentials to access the platform.
78
+ </Typography>
79
+
80
+ <Box
81
+ sx={{
82
+ mt: 2,
83
+ width: 32,
84
+ height: 3,
85
+ borderRadius: 2,
86
+ bgcolor: "primary.main",
87
+ }}
88
+ />
89
+ </Stack>
90
+
35
91
  {credentials?.provider === "COGNITO" && <CognitoLogin />}
36
92
  {credentials?.provider === "DEMO" && <DemoLogin />}
37
93
 
38
- <LoginForm icon={template.login.icon} name={name} formColor={formColor} />
94
+ <LoginForm icon={template.login.icon} name={name} formColor="#a8a9ad" />
95
+
96
+ <Box
97
+ sx={{
98
+ mt: 4,
99
+ pt: 3,
100
+ borderTop: (theme) =>
101
+ `1px solid ${alpha(theme.palette.divider, 0.5)}`,
102
+ textAlign: "center",
103
+ }}
104
+ >
105
+ <Typography variant="caption" sx={{ color: "text.disabled" }}>
106
+ Secure · Encrypted · Private
107
+ </Typography>
108
+ </Box>
39
109
  </Page>
40
110
  );
41
111
  }
@@ -23,8 +23,9 @@ export default function ThemeProvider({ children }) {
23
23
  const contrast = createContrast(settings.themeContrast, settings.themeMode);
24
24
  const presets = createPresets(settings.themeColorPresets);
25
25
 
26
- const memoizedValue = useMemo(
27
- () => ({
26
+ const theme = useMemo(() => {
27
+ // 1. Define the base configuration
28
+ const baseOptions = {
28
29
  palette: {
29
30
  ...palette(settings.themeMode),
30
31
  ...presets.palette,
@@ -38,56 +39,54 @@ export default function ThemeProvider({ children }) {
38
39
  shadows: shadows(settings.themeMode),
39
40
  shape: { borderRadius: 8 },
40
41
  typography,
41
- }),
42
- [
43
- settings.themeMode,
44
- settings.themeDirection,
45
- presets.palette,
46
- presets.customShadows,
47
- contrast.palette,
48
- ]
49
- );
50
-
51
- const theme = createTheme(memoizedValue);
52
-
53
- theme.components = merge(componentsOverrides(theme), contrast.components, {
54
- MuiCssBaseline: {
55
- styleOverrides: {
56
- body: {
57
- scrollbarColor:
58
- theme.palette.mode === "dark"
59
- ? `${theme.palette.grey[700]} ${theme.palette.background.default}`
60
- : `${theme.palette.grey[500]} ${theme.palette.background.default}`,
61
- scrollbarWidth: "thin",
62
-
63
- "&::-webkit-scrollbar": {
64
- width: 10,
65
- height: 10,
66
- },
42
+ };
67
43
 
68
- "&::-webkit-scrollbar-track": {
69
- backgroundColor: theme.palette.background.default,
70
- },
71
-
72
- "&::-webkit-scrollbar-thumb": {
73
- backgroundColor:
74
- theme.palette.mode === "dark"
75
- ? theme.palette.grey[700]
76
- : theme.palette.grey[500],
77
- borderRadius: 8,
78
- border: `2px solid ${theme.palette.background.default}`,
79
- },
44
+ // 2. Create a temporary theme instance to generate overrides
45
+ // (Overrides often need access to the palette/spacing of the theme)
46
+ const tempTheme = createTheme(baseOptions);
80
47
 
81
- "&::-webkit-scrollbar-thumb:hover": {
82
- backgroundColor:
83
- theme.palette.mode === "dark"
84
- ? theme.palette.grey[600]
85
- : theme.palette.grey[700],
48
+ // 3. Merge components into the configuration
49
+ baseOptions.components = merge(
50
+ componentsOverrides(tempTheme),
51
+ contrast.components,
52
+ {
53
+ MuiCssBaseline: {
54
+ styleOverrides: {
55
+ body: {
56
+ scrollbarColor:
57
+ tempTheme.palette.mode === "dark"
58
+ ? `${tempTheme.palette.grey[700]} ${tempTheme.palette.background.default}`
59
+ : `${tempTheme.palette.grey[500]} ${tempTheme.palette.background.default}`,
60
+ scrollbarWidth: "thin",
61
+ "&::-webkit-scrollbar": { width: 10, height: 10 },
62
+ "&::-webkit-scrollbar-track": {
63
+ backgroundColor: tempTheme.palette.background.default,
64
+ },
65
+ "&::-webkit-scrollbar-thumb": {
66
+ backgroundColor:
67
+ tempTheme.palette.mode === "dark"
68
+ ? tempTheme.palette.grey[700]
69
+ : tempTheme.palette.grey[500],
70
+ borderRadius: 8,
71
+ border: `2px solid ${tempTheme.palette.background.default}`,
72
+ },
73
+ },
86
74
  },
87
75
  },
88
- },
89
- },
90
- });
76
+ }
77
+ );
78
+
79
+ // 4. Return the final, complete theme
80
+ return createTheme(baseOptions);
81
+ }, [
82
+ settings.themeMode,
83
+ settings.themeDirection,
84
+ settings.themeContrast, // Added this to the dependency array
85
+ presets.palette,
86
+ presets.customShadows,
87
+ contrast.palette,
88
+ contrast.components,
89
+ ]);
91
90
 
92
91
  return (
93
92
  <MuiThemeProvider theme={theme}>
@@ -1,4 +1,4 @@
1
- import { loadingButtonClasses } from "@mui/lab/LoadingButton";
1
+ import { buttonClasses } from "@mui/material/Button";
2
2
 
3
3
  // ----------------------------------------------------------------------
4
4
 
@@ -8,17 +8,17 @@ export function loadingButton(theme) {
8
8
  styleOverrides: {
9
9
  root: ({ ownerState }) => ({
10
10
  ...(ownerState.variant === "soft" && {
11
- [`& .${loadingButtonClasses.loadingIndicatorStart}`]: {
11
+ [`& .${buttonClasses.loadingIndicatorStart}`]: {
12
12
  left: 10,
13
13
  },
14
- [`& .${loadingButtonClasses.loadingIndicatorEnd}`]: {
14
+ [`& .${buttonClasses.loadingIndicatorEnd}`]: {
15
15
  right: 14,
16
16
  },
17
17
  ...(ownerState.size === "small" && {
18
- [`& .${loadingButtonClasses.loadingIndicatorStart}`]: {
18
+ [`& .${buttonClasses.loadingIndicatorStart}`]: {
19
19
  left: 10,
20
20
  },
21
- [`& .${loadingButtonClasses.loadingIndicatorEnd}`]: {
21
+ [`& .${buttonClasses.loadingIndicatorEnd}`]: {
22
22
  right: 10,
23
23
  },
24
24
  }),
@@ -105,11 +105,14 @@ export function defaultProps(theme) {
105
105
  },
106
106
  MuiCardHeader: {
107
107
  defaultProps: {
108
- titleTypographyProps: { variant: "h6" },
109
- subheaderTypographyProps: {
110
- variant: "body2",
111
- marginTop: theme.spacing(0.5),
112
- },
108
+ slotProps: {
109
+ title: { variant: "h6" },
110
+
111
+ subheader: {
112
+ variant: "body2",
113
+ marginTop: theme.spacing(0.5),
114
+ }
115
+ }
113
116
  },
114
117
  },
115
118
  MuiChip: {
@@ -134,12 +137,15 @@ export function defaultProps(theme) {
134
137
  },
135
138
  MuiListItemText: {
136
139
  defaultProps: {
137
- primaryTypographyProps: {
138
- typography: "subtitle2",
139
- },
140
- secondaryTypographyProps: {
141
- component: "span",
142
- },
140
+ slotProps: {
141
+ primary: {
142
+ typography: "subtitle2",
143
+ },
144
+
145
+ secondary: {
146
+ component: "span",
147
+ }
148
+ }
143
149
  },
144
150
  },
145
151
  MuiPaper: {
@@ -15,31 +15,13 @@ import {
15
15
  alpha,
16
16
  } from "@mui/material";
17
17
  import {
18
- CheckOutlined,
19
- EmailOutlined,
20
18
  LockOutlined,
21
19
  MarkEmailReadOutlined,
22
20
  Visibility,
23
21
  VisibilityOff,
24
22
  } from "@mui/icons-material";
25
23
  import { confirmSignup, getTokens, login, signup } from "./amplifyAuth";
26
-
27
- const inputSx = {
28
- "& .MuiOutlinedInput-root": {
29
- fontSize: "1rem",
30
- "& input": { py: 1.5 },
31
- "&:hover fieldset": { borderColor: "primary.main" },
32
- },
33
- };
34
-
35
- const primaryButtonSx = {
36
- py: 1.5,
37
- fontSize: "1rem",
38
- fontWeight: 600,
39
- textTransform: "none",
40
- borderRadius: 1.5,
41
- "&:active": { transform: "translateY(0px)" },
42
- };
24
+ import { inputSx, primaryButtonSx } from "./styles";
43
25
 
44
26
  export default function CognitoLogin() {
45
27
  const [mode, setMode] = useState("login");
@@ -159,124 +141,107 @@ export default function CognitoLogin() {
159
141
 
160
142
  return (
161
143
  <Stack spacing={3} sx={{ mb: 2 }}>
162
- <Box sx={{ textAlign: "center" }}>
144
+ <Box sx={{ display: "flex", alignItems: "center", gap: 1.5 }}>
163
145
  <Box
164
146
  sx={{
165
- width: 52,
166
- height: 52,
167
- borderRadius: 2,
147
+ width: 40,
148
+ height: 40,
149
+ borderRadius: 1.5,
168
150
  display: "inline-flex",
169
151
  alignItems: "center",
170
152
  justifyContent: "center",
171
- mb: 2,
153
+ flexShrink: 0,
172
154
  bgcolor: (theme) => alpha(theme.palette.primary.main, 0.1),
173
155
  color: "primary.main",
174
156
  }}
175
157
  >
176
158
  {mode === "confirm" ? (
177
- <MarkEmailReadOutlined sx={{ fontSize: 26 }} />
159
+ <MarkEmailReadOutlined sx={{ fontSize: 22 }} />
178
160
  ) : (
179
- <LockOutlined sx={{ fontSize: 26 }} />
161
+ <LockOutlined sx={{ fontSize: 22 }} />
180
162
  )}
181
163
  </Box>
182
-
183
- <Typography variant="h4" fontWeight={700} gutterBottom>
184
- {titles[mode].heading}
185
- </Typography>
186
- <Typography variant="body2" color="text.secondary">
187
- {titles[mode].sub}
188
- </Typography>
164
+ <Box>
165
+ <Typography variant="h6" sx={{ fontWeight: 700, lineHeight: 1.2 }}>
166
+ {titles[mode].heading}
167
+ </Typography>
168
+ <Typography variant="caption" sx={{ color: "text.secondary" }}>
169
+ {titles[mode].sub}
170
+ </Typography>
171
+ </Box>
189
172
  </Box>
190
-
191
- <Stack spacing={2}>
173
+ <Stack spacing={1.5}>
192
174
  <TextField
175
+ variant="filled"
193
176
  label="Email"
194
177
  value={email}
195
178
  onChange={(e) => setEmail(e.target.value)}
196
179
  fullWidth
197
- InputProps={{
198
- startAdornment: (
199
- <InputAdornment position="start">
200
- <EmailOutlined sx={{ color: "text.secondary", fontSize: 22 }} />
201
- </InputAdornment>
202
- ),
203
- }}
204
180
  sx={inputSx}
181
+ slotProps={{ input: { disableUnderline: true } }}
205
182
  />
206
183
 
207
184
  {mode !== "confirm" && (
208
185
  <TextField
186
+ variant="filled"
209
187
  type={showPassword ? "text" : "password"}
210
188
  label="Password"
211
189
  value={password}
212
190
  onChange={(e) => setPassword(e.target.value)}
213
191
  fullWidth
214
- InputProps={{
215
- startAdornment: (
216
- <InputAdornment position="start">
217
- <LockOutlined
218
- sx={{ color: "text.secondary", fontSize: 22 }}
219
- />
220
- </InputAdornment>
221
- ),
222
- endAdornment: passwordAdornment,
223
- }}
224
192
  sx={inputSx}
193
+ slotProps={{
194
+ input: {
195
+ disableUnderline: true,
196
+ endAdornment: passwordAdornment,
197
+ },
198
+ }}
225
199
  />
226
200
  )}
227
201
 
228
202
  {mode === "signup" && (
229
203
  <TextField
204
+ variant="filled"
230
205
  type={showConfirmPassword ? "text" : "password"}
231
206
  label="Confirm Password"
232
207
  value={confirmPassword}
233
208
  onChange={(e) => setConfirmPassword(e.target.value)}
234
209
  fullWidth
235
- InputProps={{
236
- startAdornment: (
237
- <InputAdornment position="start">
238
- <LockOutlined
239
- sx={{ color: "text.secondary", fontSize: 22 }}
240
- />
241
- </InputAdornment>
242
- ),
243
- endAdornment: (
244
- <InputAdornment position="end">
245
- <IconButton
246
- onClick={() => setShowConfirmPassword(!showConfirmPassword)}
247
- edge="end"
248
- size="small"
249
- tabIndex={-1}
250
- >
251
- {showConfirmPassword ? <VisibilityOff /> : <Visibility />}
252
- </IconButton>
253
- </InputAdornment>
254
- ),
255
- }}
256
210
  sx={inputSx}
211
+ slotProps={{
212
+ input: {
213
+ disableUnderline: true,
214
+ endAdornment: (
215
+ <InputAdornment position="end">
216
+ <IconButton
217
+ onClick={() =>
218
+ setShowConfirmPassword(!showConfirmPassword)
219
+ }
220
+ edge="end"
221
+ size="small"
222
+ tabIndex={-1}
223
+ >
224
+ {showConfirmPassword ? <VisibilityOff /> : <Visibility />}
225
+ </IconButton>
226
+ </InputAdornment>
227
+ ),
228
+ },
229
+ }}
257
230
  />
258
231
  )}
259
232
 
260
233
  {mode === "confirm" && (
261
234
  <TextField
235
+ variant="filled"
262
236
  label="Confirmation Code"
263
237
  value={code}
264
238
  onChange={(e) => setCode(e.target.value)}
265
239
  fullWidth
266
- InputProps={{
267
- startAdornment: (
268
- <InputAdornment position="start">
269
- <CheckOutlined
270
- sx={{ color: "text.secondary", fontSize: 22 }}
271
- />
272
- </InputAdornment>
273
- ),
274
- }}
275
240
  sx={inputSx}
241
+ slotProps={{ input: { disableUnderline: true } }}
276
242
  />
277
243
  )}
278
244
  </Stack>
279
-
280
245
  {mode === "login" && (
281
246
  <Stack spacing={1.5}>
282
247
  <Button
@@ -284,20 +249,24 @@ export default function CognitoLogin() {
284
249
  onClick={handleLogin}
285
250
  size="large"
286
251
  fullWidth
252
+ disableElevation
287
253
  sx={primaryButtonSx}
288
254
  >
289
- Sign in
255
+ Sign in &rarr;
290
256
  </Button>
291
257
  <Button
292
258
  onClick={() => setMode("signup")}
293
259
  fullWidth
294
- sx={{ textTransform: "none", fontWeight: 500 }}
260
+ sx={{
261
+ textTransform: "none",
262
+ fontWeight: 600,
263
+ color: "text.secondary",
264
+ }}
295
265
  >
296
- Create an account
266
+ No account? Create one
297
267
  </Button>
298
268
  </Stack>
299
269
  )}
300
-
301
270
  {mode === "signup" && (
302
271
  <Stack spacing={1.5}>
303
272
  <Button
@@ -305,29 +274,34 @@ export default function CognitoLogin() {
305
274
  onClick={handleSignup}
306
275
  size="large"
307
276
  fullWidth
277
+ disableElevation
308
278
  sx={primaryButtonSx}
309
279
  >
310
- Sign Up
280
+ Create account &rarr;
311
281
  </Button>
312
282
  <Button
313
283
  onClick={() => setMode("login")}
314
284
  fullWidth
315
- sx={{ textTransform: "none", fontWeight: 500 }}
285
+ sx={{
286
+ textTransform: "none",
287
+ fontWeight: 600,
288
+ color: "text.secondary",
289
+ }}
316
290
  >
317
- Back to login
291
+ &larr; Back to sign in
318
292
  </Button>
319
293
  </Stack>
320
294
  )}
321
-
322
295
  {mode === "confirm" && (
323
296
  <Button
324
297
  variant="contained"
325
298
  onClick={handleConfirm}
326
299
  size="large"
327
300
  fullWidth
301
+ disableElevation
328
302
  sx={primaryButtonSx}
329
303
  >
330
- Confirm
304
+ Verify &rarr;
331
305
  </Button>
332
306
  )}
333
307
  </Stack>