datastake-daf 0.6.595 → 0.6.597

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.595",
3
+ "version": "0.6.597",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -210,14 +210,14 @@ function AuthForm ({
210
210
  );
211
211
  }}
212
212
  </Form.Item>
213
- <div className="buttons" style={{ marginTop: '8px'}}>
213
+ <div className="buttons" style={{ marginTop: 0}}>
214
214
  <BorderedButton onClick={prev} block className="normal-br">
215
215
  {t("Back")}
216
216
  </BorderedButton>
217
217
  </div>
218
218
  </div>
219
219
  ) : (
220
- <div className="buttons" style={{ marginTop: 0}}>
220
+ <div className="buttons" style={{ marginTop: isMultiStep ? '16px' : 0}}>
221
221
  <BorderedButton type="primary" htmlType="submit" block className="normal-br">
222
222
  {isMultiStep ? t("Next") : submitText}
223
223
  </BorderedButton>
@@ -0,0 +1,502 @@
1
+ import React from "react";
2
+ import AuthLayout from "./index.jsx";
3
+ import ThemeLayout from "../../core/components/ThemeLayout/index.jsx";
4
+
5
+ // Mock translation function
6
+ const mockT = (key) => {
7
+ const translations = {
8
+ "Welcome Back": "Welcome Back",
9
+ "Please introduce yourself": "Please introduce yourself",
10
+ "Sign In": "Sign In",
11
+ "Enter your credentials to access your account": "Enter your credentials to access your account",
12
+ "Create Account": "Create Account",
13
+ "Join us today and start your journey": "Join us today and start your journey",
14
+ "Reset Password": "Reset Password",
15
+ "Enter your email to reset your password": "Enter your email to reset your password",
16
+ "Back": "Back",
17
+ "Email": "Email",
18
+ "Password": "Password",
19
+ "Remember me": "Remember me",
20
+ "Forgot password?": "Forgot password?",
21
+ "Log in": "Log in",
22
+ "Don't have an account?": "Don't have an account?",
23
+ "Sign up": "Sign up",
24
+ };
25
+ return translations[key] || key;
26
+ };
27
+
28
+ // Mock form content
29
+ const LoginForm = () => (
30
+ <div style={{ width: "100%", maxWidth: "400px" }}>
31
+ <div style={{ marginBottom: "20px" }}>
32
+ <label style={{ display: "block", marginBottom: "8px", fontSize: "14px", fontWeight: "500" }}>
33
+ Email
34
+ </label>
35
+ <input
36
+ type="email"
37
+ placeholder="Enter your email"
38
+ required
39
+ style={{
40
+ width: "100%",
41
+ padding: "12px",
42
+ border: "1px solid #ddd",
43
+ borderRadius: "8px",
44
+ fontSize: "14px"
45
+ }}
46
+ />
47
+ </div>
48
+ <div style={{ marginBottom: "20px" }}>
49
+ <label style={{ display: "block", marginBottom: "8px", fontSize: "14px", fontWeight: "500" }}>
50
+ Password
51
+ </label>
52
+ <input
53
+ type="password"
54
+ required
55
+ placeholder="Enter your password"
56
+ style={{
57
+ width: "100%",
58
+ padding: "12px",
59
+ border: "1px solid #ddd",
60
+ borderRadius: "8px",
61
+ fontSize: "14px"
62
+ }}
63
+ />
64
+ </div>
65
+ <div style={{
66
+ display: "flex",
67
+ justifyContent: "space-between",
68
+ alignItems: "center",
69
+ marginBottom: "24px"
70
+ }}>
71
+ <label style={{ display: "flex", alignItems: "center", fontSize: "14px" }}>
72
+ <input type="checkbox" style={{ marginRight: "8px" }} />
73
+ Remember me
74
+ </label>
75
+ <a href="#" style={{ fontSize: "14px", color: "#4F46E5", textDecoration: "none" }}>
76
+ Forgot password?
77
+ </a>
78
+ </div>
79
+ <button
80
+ style={{
81
+ width: "100%",
82
+ padding: "12px",
83
+ backgroundColor: "#3D8EDB",
84
+ color: "white",
85
+ border: "none",
86
+ borderRadius: "8px",
87
+ fontSize: "16px",
88
+ fontWeight: "600",
89
+ cursor: "pointer"
90
+ }}
91
+ onClick={() => console.log("Login clicked")}
92
+ >
93
+ Log in
94
+ </button>
95
+ <p style={{
96
+ textAlign: "center",
97
+ marginTop: "24px",
98
+ fontSize: "14px",
99
+ color: "#6B7280"
100
+ }}>
101
+
102
+ {/* <a href="#" style={{ color: "#4F46E5", textDecoration: "none", fontWeight: "600" }}>
103
+ Sign up
104
+ </a> */}
105
+ </p>
106
+ </div>
107
+ );
108
+
109
+ const SignupForm = () => (
110
+ <div style={{ width: "100%", maxWidth: "400px" }}>
111
+ <div style={{ marginBottom: "20px" }}>
112
+ <label style={{ display: "block", marginBottom: "8px", fontSize: "14px", fontWeight: "500" }}>
113
+ Full Name
114
+ </label>
115
+ <input
116
+ type="text"
117
+ placeholder="Enter your full name"
118
+ style={{
119
+ width: "100%",
120
+ padding: "12px",
121
+ border: "1px solid #ddd",
122
+ borderRadius: "8px",
123
+ fontSize: "14px"
124
+ }}
125
+ />
126
+ </div>
127
+ <div style={{ marginBottom: "20px" }}>
128
+ <label style={{ display: "block", marginBottom: "8px", fontSize: "14px", fontWeight: "500" }}>
129
+ Email
130
+ </label>
131
+ <input
132
+ type="email"
133
+ placeholder="Enter your email"
134
+ style={{
135
+ width: "100%",
136
+ padding: "12px",
137
+ border: "1px solid #ddd",
138
+ borderRadius: "8px",
139
+ fontSize: "14px"
140
+ }}
141
+ />
142
+ </div>
143
+ <div style={{ marginBottom: "20px" }}>
144
+ <label style={{ display: "block", marginBottom: "8px", fontSize: "14px", fontWeight: "500" }}>
145
+ Password
146
+ </label>
147
+ <input
148
+ type="password"
149
+ placeholder="Create a password"
150
+ style={{
151
+ width: "100%",
152
+ padding: "12px",
153
+ border: "1px solid #ddd",
154
+ borderRadius: "8px",
155
+ fontSize: "14px"
156
+ }}
157
+ />
158
+ </div>
159
+ <div style={{ marginBottom: "24px" }}>
160
+ <label style={{ display: "flex", alignItems: "center", fontSize: "14px" }}>
161
+ <input type="checkbox" style={{ marginRight: "8px" }} />
162
+ I agree to the Terms and Conditions
163
+ </label>
164
+ </div>
165
+ <button
166
+ style={{
167
+ width: "100%",
168
+ padding: "12px",
169
+ backgroundColor: "#3D8EDB",
170
+ color: "white",
171
+ border: "none",
172
+ borderRadius: "8px",
173
+ fontSize: "16px",
174
+ fontWeight: "600",
175
+ cursor: "pointer"
176
+ }}
177
+ onClick={() => console.log("Sign up clicked")}
178
+ >
179
+ Create Account
180
+ </button>
181
+ <p style={{
182
+ textAlign: "center",
183
+ marginTop: "24px",
184
+ fontSize: "14px",
185
+ color: "#6B7280"
186
+ }}>
187
+ Already have an account?{" "}
188
+ <a href="#" style={{ color: "#4F46E5", textDecoration: "none", fontWeight: "600" }}>
189
+ Log in
190
+ </a>
191
+ </p>
192
+ </div>
193
+ );
194
+
195
+ export default {
196
+ title: "Layouts/AuthLayout",
197
+ component: AuthLayout,
198
+ tags: ["autodocs"],
199
+ decorators: [
200
+ (Story) => (
201
+ <ThemeLayout>
202
+ <div style={{ width: "100vw", height: "100vh" }}>
203
+ <Story />
204
+ </div>
205
+ </ThemeLayout>
206
+ ),
207
+ ],
208
+ argTypes: {
209
+ title: {
210
+ control: "text",
211
+ description: "Main title of the auth page",
212
+ },
213
+ subTitle: {
214
+ control: "text",
215
+ description: "Subtitle or description text",
216
+ },
217
+ appName: {
218
+ control: "select",
219
+ options: ["default", "sbg", "tif", "mmt", "tazama"],
220
+ description: "Application name for theming",
221
+ },
222
+ showTopHeader: {
223
+ control: "boolean",
224
+ description: "Show or hide the top navigation bar",
225
+ },
226
+ showLanguageSelector: {
227
+ control: "boolean",
228
+ description: "Show or hide the language selector",
229
+ },
230
+ showBack: {
231
+ control: "boolean",
232
+ description: "Show or hide the back button",
233
+ },
234
+ backLabel: {
235
+ control: "text",
236
+ description: "Label for the back button",
237
+ }
238
+ }
239
+ };
240
+
241
+ // Default Login Story
242
+ export const Default = {
243
+ name: "Login Page",
244
+ args: {
245
+ title: "Welcome Back",
246
+ subTitle: "Please introduce yourself",
247
+ appName: "default",
248
+ showTopHeader: true,
249
+ showLanguageSelector: true,
250
+ showBack: false,
251
+ backLabel: "Back",
252
+ },
253
+ render: (args) => (
254
+ <AuthLayout
255
+ t={mockT}
256
+ title={args.title}
257
+ subTitle={args.subTitle}
258
+ logo="/assets/images/datastake-logo.svg"
259
+ appName={args.appName}
260
+ rightImageUrl="/assets/images/tif-bg.png"
261
+ showTopHeader={args.showTopHeader}
262
+ showLanguageSelector={args.showLanguageSelector}
263
+ updateLanguage={(lng) => console.log("Language changed to:", lng)}
264
+ showBack={args.showBack}
265
+ onBack={() => console.log("Back clicked")}
266
+ backLabel={args.backLabel}
267
+ >
268
+ <LoginForm />
269
+ </AuthLayout>
270
+ ),
271
+ };
272
+
273
+ // Sign Up Story
274
+ export const SignUp = {
275
+ name: "Sign Up Page",
276
+ render: () => (
277
+ <AuthLayout
278
+ t={mockT}
279
+ title="Create Account"
280
+ subTitle="Join us today and start your journey"
281
+ logo="/assets/images/datastake-logo.svg"
282
+ appName="default"
283
+ rightImageUrl="/assets/images/auth-bg-2.svg"
284
+ showTopHeader={true}
285
+ showLanguageSelector={true}
286
+ updateLanguage={(lng) => console.log("Language changed to:", lng)}
287
+ >
288
+ <SignupForm />
289
+ </AuthLayout>
290
+ ),
291
+ };
292
+
293
+ // With Back Button
294
+ export const WithBackButton = {
295
+ name: "With Back Button",
296
+ render: () => (
297
+ <AuthLayout
298
+ t={mockT}
299
+ title="Reset Password"
300
+ subTitle="Enter your email to reset your password"
301
+ logo="/assets/images/datastake-logo.svg"
302
+ appName="default"
303
+ rightImageUrl="/assets/images/tif-bg.png"
304
+ showTopHeader={true}
305
+ showLanguageSelector={false}
306
+ showBack={true}
307
+ onBack={() => console.log("Back clicked")}
308
+ backLabel="Back"
309
+ >
310
+ <div style={{ width: "100%", maxWidth: "400px" }}>
311
+ <div style={{ marginBottom: "20px" }}>
312
+ <label style={{ display: "block", marginBottom: "8px", fontSize: "14px", fontWeight: "500" }}>
313
+ Email
314
+ </label>
315
+ <input
316
+ type="email"
317
+ placeholder="Enter your email"
318
+ style={{
319
+ width: "100%",
320
+ padding: "12px",
321
+ border: "1px solid #ddd",
322
+ borderRadius: "8px",
323
+ fontSize: "14px"
324
+ }}
325
+ />
326
+ </div>
327
+ <button
328
+ style={{
329
+ width: "100%",
330
+ padding: "12px",
331
+ backgroundColor: "#4F46E5",
332
+ color: "white",
333
+ border: "none",
334
+ borderRadius: "8px",
335
+ fontSize: "16px",
336
+ fontWeight: "600",
337
+ cursor: "pointer"
338
+ }}
339
+ onClick={() => console.log("Reset clicked")}
340
+ >
341
+ Send Reset Link
342
+ </button>
343
+ </div>
344
+ </AuthLayout>
345
+ ),
346
+ };
347
+
348
+ // No Header
349
+ export const NoHeader = {
350
+ name: "Without Top Header",
351
+ render: () => (
352
+ <AuthLayout
353
+ t={mockT}
354
+ title="Sign In"
355
+ subTitle="Enter your credentials to access your account"
356
+ logo="/assets/images/datastake-logo.svg"
357
+ appName="default"
358
+ rightImageUrl="/assets/images/auth-bg.svg"
359
+ showTopHeader={false}
360
+ showLanguageSelector={false}
361
+ >
362
+ <LoginForm />
363
+ </AuthLayout>
364
+ ),
365
+ };
366
+
367
+ // SBG Theme
368
+ export const SBGTheme = {
369
+ name: "SBG Theme",
370
+ render: () => (
371
+ <AuthLayout
372
+ t={mockT}
373
+ title="Welcome to SBG"
374
+ subTitle="Sustainable Business Growth Platform"
375
+ logo="/assets/sbg-images/sbg-logo.svg"
376
+ appName="sbg"
377
+ rightImageUrl="/assets/images/auth-bg.svg"
378
+ showTopHeader={true}
379
+ showLanguageSelector={true}
380
+ updateLanguage={(lng) => console.log("Language changed to:", lng)}
381
+ >
382
+ <LoginForm />
383
+ </AuthLayout>
384
+ ),
385
+ };
386
+
387
+ // TIF Theme
388
+ export const TIFTheme = {
389
+ name: "TIF Theme",
390
+ render: () => (
391
+ <AuthLayout
392
+ t={mockT}
393
+ title="Welcome to TIF"
394
+ subTitle="Transparency & Information Framework"
395
+ logo="/assets/images/tif-logo.svg"
396
+ appName="tif"
397
+ rightImageUrl="/assets/images/tif-bg.png"
398
+ showTopHeader={true}
399
+ showLanguageSelector={true}
400
+ updateLanguage={(lng) => console.log("Language changed to:", lng)}
401
+ >
402
+ <LoginForm />
403
+ </AuthLayout>
404
+ ),
405
+ };
406
+
407
+ // With Additional Content
408
+ export const WithAdditionalContent = {
409
+ name: "With Additional Content",
410
+ render: () => (
411
+ <AuthLayout
412
+ t={mockT}
413
+ title="Welcome Back"
414
+ subTitle="Please introduce yourself"
415
+ logo="/assets/images/datastake-logo.svg"
416
+ appName="default"
417
+ rightImageUrl="/assets/images/auth-bg.svg"
418
+ showTopHeader={true}
419
+ showLanguageSelector={true}
420
+ updateLanguage={(lng) => console.log("Language changed to:", lng)}
421
+ additionalContent={
422
+ <div style={{
423
+ marginTop: "32px",
424
+ padding: "16px",
425
+ backgroundColor: "#F3F4F6",
426
+ borderRadius: "8px",
427
+ textAlign: "center"
428
+ }}>
429
+ <p style={{ fontSize: "14px", color: "#6B7280", margin: 0 }}>
430
+ Need help? <a href="#" style={{ color: "#4F46E5", textDecoration: "none" }}>Contact Support</a>
431
+ </p>
432
+ </div>
433
+ }
434
+ >
435
+ <LoginForm />
436
+ </AuthLayout>
437
+ ),
438
+ };
439
+
440
+ // Custom Right Image
441
+ export const CustomRightImage = {
442
+ name: "Custom Right Background",
443
+ render: () => (
444
+ <AuthLayout
445
+ t={mockT}
446
+ title="Welcome"
447
+ subTitle="Access your dashboard"
448
+ logo="/assets/images/datastake-logo.svg"
449
+ appName="default"
450
+ rightImageUrl="/assets/images/kota-bg.jpg"
451
+ showTopHeader={true}
452
+ showLanguageSelector={true}
453
+ updateLanguage={(lng) => console.log("Language changed to:", lng)}
454
+ >
455
+ <LoginForm />
456
+ </AuthLayout>
457
+ ),
458
+ };
459
+
460
+ // Minimal Setup
461
+ export const Minimal = {
462
+ name: "Minimal Setup",
463
+ render: () => (
464
+ <AuthLayout
465
+ t={mockT}
466
+ title="Sign In"
467
+ logo="/assets/images/datastake-logo.svg"
468
+ appName="default"
469
+ showTopHeader={false}
470
+ >
471
+ <LoginForm />
472
+ </AuthLayout>
473
+ ),
474
+ };
475
+
476
+ // With JSX Subtitle
477
+ export const WithJSXSubtitle = {
478
+ name: "With JSX Subtitle",
479
+ render: () => (
480
+ <AuthLayout
481
+ t={mockT}
482
+ title="Welcome Back"
483
+ subTitle={
484
+ <span>
485
+ New here?{" "}
486
+ <a href="#" style={{ color: "#4F46E5", textDecoration: "none", fontWeight: "600" }}>
487
+ Create an account
488
+ </a>
489
+ </span>
490
+ }
491
+ logo="/assets/images/datastake-logo.svg"
492
+ appName="default"
493
+ rightImageUrl="/assets/images/auth-bg.svg"
494
+ showTopHeader={true}
495
+ showLanguageSelector={true}
496
+ updateLanguage={(lng) => console.log("Language changed to:", lng)}
497
+ >
498
+ <LoginForm />
499
+ </AuthLayout>
500
+ ),
501
+ };
502
+
@@ -0,0 +1,43 @@
1
+ export const navItems = [
2
+ {
3
+ key: 'home',
4
+ route: '',
5
+ label: 'Home',
6
+ },
7
+ {
8
+ key: 'about',
9
+ route: 'about',
10
+ label: 'About',
11
+ },
12
+ {
13
+ key: 'platform',
14
+ route: 'platform',
15
+ label: 'Platform',
16
+ },
17
+ {
18
+ key: 'applications',
19
+ route: 'applications',
20
+ label: 'Applications',
21
+ },
22
+ {
23
+ key: 'buzz',
24
+ route: 'buzz',
25
+ label: 'Buzz',
26
+ },
27
+ ];
28
+
29
+ export const languages = [
30
+ {
31
+ value: 'en',
32
+ label: '🇬🇧 EN',
33
+ },
34
+ {
35
+ value: 'fr',
36
+ label: '🇫🇷 FR',
37
+ },
38
+ {
39
+ value: 'sp',
40
+ label: '🇪🇸 ES',
41
+ },
42
+ ];
43
+
@@ -0,0 +1,76 @@
1
+ import React from "react";
2
+ import { Select } from "antd";
3
+ import { formatClassname } from "../../../../../helpers/ClassesHelper.js";
4
+ import Style, { GlobalNavbarStyles } from './style';
5
+
6
+ const AuthNavbar = ({
7
+ logo,
8
+ appName = "default",
9
+ showLanguageSelector = true,
10
+ updateLanguage,
11
+ languageConfig = [
12
+ { value: "en", label: "EN", flagUrl: "/assets/images/countries/gb.png" },
13
+ { value: "fr", label: "FR", flagUrl: "/assets/images/countries/fr.png" },
14
+ { value: "sp", label: "ES", flagUrl: "/assets/images/countries/sp.png" },
15
+ ],
16
+ showBack = false,
17
+ backLabel = "Back",
18
+ onBack,
19
+ }) => {
20
+ return (
21
+ <>
22
+ <GlobalNavbarStyles />
23
+ <Style className={formatClassname([showBack && 'bordered'])}>
24
+ <div className="d-navbar">
25
+ <div className="main-cont d-container">
26
+ <div className="left">
27
+ {logo && (
28
+ <img className="navbar-logo" src={logo} alt={`${appName} logo`} />
29
+ )}
30
+ </div>
31
+
32
+ <div className="right">
33
+ {showLanguageSelector && updateLanguage && (
34
+ <Select
35
+ className="language-select"
36
+ defaultValue={localStorage.getItem("datastakeLng") || "en"}
37
+ onChange={(lng) => updateLanguage(lng)}
38
+ popupClassName={formatClassname([
39
+ "language-select-popup",
40
+ appName,
41
+ ])}
42
+ suffixIcon={
43
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
44
+ <path d="M5 7.5L10 12.5L15 7.5" stroke="#667085" strokeWidth="1.66667" strokeLinecap="round" strokeLinejoin="round"/>
45
+ </svg>
46
+ }
47
+ >
48
+ {languageConfig.map((lang) => (
49
+ <Select.Option key={lang.value} value={lang.value}>
50
+ <div className="language-option">
51
+ <img
52
+ src={lang.flagUrl}
53
+ alt={lang.label}
54
+ className="flag-icon"
55
+ />
56
+ <span>{lang.label}</span>
57
+ </div>
58
+ </Select.Option>
59
+ ))}
60
+ </Select>
61
+ )}
62
+
63
+ {showBack && (
64
+ <button className="back-btn" onClick={onBack}>
65
+ {backLabel}
66
+ </button>
67
+ )}
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </Style>
72
+ </>
73
+ );
74
+ };
75
+
76
+ export default AuthNavbar;