datastake-daf 0.6.577 → 0.6.578

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,169 @@
1
+
2
+
3
+
4
+ .auth-navbar {
5
+ width: 100%;
6
+ height: 64px;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: space-between;
10
+ background: #ffffff;
11
+ border-bottom: 1px solid #eaecf0;
12
+ padding: 0 80px;
13
+ position: sticky;
14
+ top: 0;
15
+ z-index: 10;
16
+
17
+ @media (max-width: 1200px) {
18
+ padding: 0 32px;
19
+ }
20
+
21
+ .navbar-left {
22
+ display: flex;
23
+ align-items: center;
24
+
25
+ .navbar-logo {
26
+ height: 32px;
27
+ object-fit: contain;
28
+ }
29
+ }
30
+
31
+ .navbar-right {
32
+ display: flex;
33
+ align-items: center;
34
+ gap: 12px;
35
+
36
+ .language-select {
37
+ min-width: 110px;
38
+
39
+ .ant-select-selector {
40
+ background: #fff !important;
41
+ border: 1px solid #d0d5dd !important;
42
+ border-radius: 8px !important;
43
+ padding: 8px 12px !important;
44
+ height: 40px !important;
45
+ display: flex;
46
+ align-items: center;
47
+ transition: all 0.2s ease;
48
+
49
+ &:hover {
50
+ border-color: #98a2b3 !important;
51
+ }
52
+ }
53
+
54
+ .ant-select-selection-item {
55
+ display: flex;
56
+ align-items: center;
57
+ padding-right: 0 !important;
58
+ }
59
+
60
+ .language-option {
61
+ display: flex;
62
+ align-items: center;
63
+ gap: 8px;
64
+
65
+ .flag-icon {
66
+ width: 20px;
67
+ height: 14px;
68
+ object-fit: cover;
69
+ border-radius: 2px;
70
+ }
71
+
72
+ span {
73
+ font-size: 14px;
74
+ font-weight: 500;
75
+ color: #344054;
76
+ }
77
+ }
78
+
79
+ .ant-select-arrow {
80
+ color: #667085;
81
+ right: 12px;
82
+
83
+ svg {
84
+ width: 20px;
85
+ height: 20px;
86
+ }
87
+ }
88
+ }
89
+
90
+ .back-btn {
91
+ border: 1px solid #d0d5dd;
92
+ background: #fff;
93
+ border-radius: 8px;
94
+ padding: 10px 16px;
95
+ height: 40px;
96
+ font-size: 14px;
97
+ font-weight: 600;
98
+ color: #344054;
99
+ cursor: pointer;
100
+ transition: all 0.2s ease;
101
+ white-space: nowrap;
102
+
103
+ &:hover {
104
+ background: #f9fafb;
105
+ border-color: #98a2b3;
106
+ }
107
+
108
+ &:active {
109
+ background: #f2f4f7;
110
+ }
111
+ }
112
+ }
113
+
114
+ @media (max-width: 768px) {
115
+ padding: 0 16px;
116
+ .navbar-logo { height: 28px; }
117
+ .navbar-right { gap: 8px; }
118
+ }
119
+ }
120
+
121
+ .language-select-popup {
122
+ .ant-select-dropdown {
123
+ padding: 4px;
124
+ background: #ffffff;
125
+ border-radius: 8px;
126
+ box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08),
127
+ 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
128
+ border: none !important;
129
+ }
130
+
131
+ .ant-select-item {
132
+ border-radius: 6px;
133
+ padding: 8px 12px;
134
+ min-height: 40px;
135
+ transition: all 0.2s ease;
136
+
137
+ &:hover {
138
+ background-color: #f9fafb;
139
+ }
140
+
141
+ &.ant-select-item-option-selected {
142
+ background-color: #155eef;
143
+ color: #ffffff;
144
+ padding: 4px !important;
145
+
146
+ .language-option span {
147
+ color: #ffffff;
148
+ }
149
+ }
150
+
151
+ .language-option {
152
+ display: flex;
153
+ align-items: center;
154
+ gap: 8px;
155
+
156
+ .flag-icon {
157
+ width: 20px;
158
+ height: 14px;
159
+ border-radius: 2px;
160
+ }
161
+
162
+ span {
163
+ font-size: 14px;
164
+ font-weight: 500;
165
+ color: #344054;
166
+ }
167
+ }
168
+ }
169
+ }
@@ -0,0 +1,301 @@
1
+ import styled, { createGlobalStyle } from "styled-components";
2
+ import { MOBILE_WIDTH, TABLET_WIDTH } from "datastake-daf/src/constants/Style";
3
+
4
+ // Global styles for portaled elements (dropdowns, modals, etc.)
5
+ export const GlobalNavbarStyles = createGlobalStyle`
6
+ .language-select-popup {
7
+ .ant-select-dropdown {
8
+ padding: 4px;
9
+ background: #ffffff;
10
+ border-radius: 8px;
11
+ box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08),
12
+ 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
13
+ border: none !important;
14
+ }
15
+
16
+ .ant-select-item {
17
+ border-radius: 6px;
18
+ padding: 8px 12px;
19
+ min-height: 40px;
20
+ transition: all 0.2s ease;
21
+
22
+ &:hover {
23
+ background-color: #f9fafb;
24
+ }
25
+
26
+ &.ant-select-item-option-selected {
27
+ background-color: #f9fafb;
28
+ font-weight: 500;
29
+
30
+ .language-option span {
31
+ font-weight: 600;
32
+ }
33
+ }
34
+
35
+ .language-option {
36
+ display: flex;
37
+ align-items: center;
38
+ gap: 8px;
39
+
40
+ .flag-icon {
41
+ width: 20px;
42
+ height: 14px;
43
+ border-radius: 2px;
44
+ }
45
+
46
+ span {
47
+ font-size: 14px;
48
+ font-weight: 500;
49
+ color: #344054;
50
+ }
51
+ }
52
+ }
53
+ }
54
+ `;
55
+
56
+ const style = styled.div`
57
+ font-family: Outfit;
58
+
59
+ .btns {
60
+ display: flex;
61
+ gap: 12px;
62
+ }
63
+
64
+ .d-container {
65
+ width: 80vw;
66
+ margin-left: auto;
67
+ margin-right: auto;
68
+
69
+ @media (max-width: 1440px) {
70
+ width: 85vw;
71
+ }
72
+
73
+ @media (${TABLET_WIDTH}) {
74
+ width: calc(100vw - 4.6rem);
75
+ }
76
+ }
77
+
78
+ .flex-c {
79
+ display: flex;
80
+ flex-direction: column;
81
+ }
82
+
83
+ .jus-c {
84
+ justify-content: center;
85
+ }
86
+
87
+ .d-navbar {
88
+ box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
89
+ position: fixed;
90
+ top: 0;
91
+ left: 0;
92
+ right: 0;
93
+ background-color: white;
94
+ z-index: 1000;
95
+ width: 100%;
96
+ height: 80px;
97
+ display: flex;
98
+ align-items: center;
99
+
100
+ @media (${TABLET_WIDTH}) {
101
+ height: 72px;
102
+ }
103
+
104
+ @media (${MOBILE_WIDTH}) {
105
+ height: 64px;
106
+ }
107
+
108
+ .main-cont {
109
+ display: flex;
110
+ align-items: center;
111
+ justify-content: space-between;
112
+ width: 100%;
113
+ height: 100%;
114
+ padding: 0 80px;
115
+
116
+ @media (max-width: 1200px) {
117
+ padding: 0 32px;
118
+ }
119
+
120
+ @media (${TABLET_WIDTH}) {
121
+ padding: 0 24px;
122
+ }
123
+
124
+ @media (${MOBILE_WIDTH}) {
125
+ padding: 0 16px;
126
+ }
127
+
128
+ .left {
129
+ display: flex;
130
+ align-items: center;
131
+ height: 100%;
132
+
133
+ .navbar-logo {
134
+ cursor: pointer;
135
+ height: 40px;
136
+ width: auto;
137
+ object-fit: contain;
138
+
139
+ @media (${MOBILE_WIDTH}) {
140
+ height: 32px;
141
+ }
142
+ }
143
+
144
+ img {
145
+ cursor: pointer;
146
+ height: 40px;
147
+ width: auto;
148
+ object-fit: contain;
149
+
150
+ @media (${MOBILE_WIDTH}) {
151
+ height: 32px;
152
+ }
153
+ }
154
+ }
155
+
156
+ .right {
157
+ display: flex;
158
+ gap: 1rem;
159
+ align-items: center;
160
+
161
+ .language-select {
162
+ min-width: 100px;
163
+
164
+ .ant-select-selector {
165
+ padding: 8px 12px !important;
166
+ height: auto !important;
167
+ border: none !important;
168
+
169
+ .ant-select-selection-item {
170
+ padding: 0 !important;
171
+ line-height: none !important;
172
+ &:hover{
173
+ background-color: transparent !important;
174
+ border: none !important;
175
+ }
176
+ }
177
+ }
178
+
179
+ .ant-select-arrow {
180
+ color: #667085;
181
+ display: flex;
182
+ align-items: center;
183
+ height: 80%;
184
+ }
185
+ }
186
+
187
+ .language-option {
188
+ display: flex;
189
+ align-items: center;
190
+ gap: 8px;
191
+
192
+ .flag-icon {
193
+ width: 20px;
194
+ height: 15px;
195
+ object-fit: cover;
196
+ border-radius: 2px;
197
+ }
198
+
199
+ span {
200
+ font-size: 14px;
201
+ font-weight: 500;
202
+ color: #344054;
203
+ }
204
+ }
205
+
206
+ .back-btn {
207
+ background: transparent;
208
+ border: 1px solid #D0D5DD;
209
+ border-radius: 8px;
210
+ padding: 8px 16px;
211
+ font-size: 14px;
212
+ font-weight: 500;
213
+ color: #344054;
214
+ cursor: pointer;
215
+ transition: all 0.2s ease;
216
+ box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
217
+
218
+ &:hover {
219
+ background: #F9FAFB;
220
+ border-color: #98A2B3;
221
+ }
222
+
223
+ &:active {
224
+ transform: scale(0.98);
225
+ }
226
+ }
227
+
228
+ .ant-btn {
229
+ font-size: 14px;
230
+ padding: 6px 0;
231
+ text-align: center;
232
+ width: 70px;
233
+
234
+ @media (${MOBILE_WIDTH}) {
235
+ padding: 3px 0;
236
+ }
237
+ }
238
+
239
+ @media (max-width: 1070px) {
240
+ gap: 1rem;
241
+ }
242
+ }
243
+ }
244
+ }
245
+
246
+ &.bordered {
247
+ .d-navbar {
248
+ position: relative;
249
+ box-shadow: unset;
250
+ border-bottom: 1px solid var(--base-gray-40);
251
+ }
252
+ }
253
+
254
+ .tazama-extra {
255
+ &.mobile {
256
+ display: none;
257
+ }
258
+
259
+ @media (${MOBILE_WIDTH}) {
260
+ &.mobile {
261
+ display: flex;
262
+ }
263
+
264
+ &.desktop {
265
+ display: none;
266
+ }
267
+ }
268
+
269
+ .ant-btn {
270
+ width: 90px !important;
271
+ display: flex;
272
+ flex-direction: column;
273
+ justify-content: center;
274
+
275
+ &.w-100 {
276
+ width: 100% !important;
277
+ }
278
+
279
+ span {
280
+ margin: 0 auto;
281
+ }
282
+ }
283
+
284
+ .nav-extra {
285
+ position: fixed;
286
+ top: 0;
287
+ left: 0;
288
+ height: 100dvh;
289
+ width: 100%;
290
+ background: white;
291
+ margin-left: -100%;
292
+ transition: 0.4s margin-left;
293
+
294
+ &.toggled {
295
+ margin-left: 0;
296
+ }
297
+ }
298
+ }
299
+ `;
300
+
301
+ export default style;
@@ -0,0 +1,85 @@
1
+ import React from "react";
2
+ import AuthNavbar from "./components/Navbar/index.jsx";
3
+ import { formatClassname } from "../../../helpers/ClassesHelper.js";
4
+ import Style from './style';
5
+
6
+ const AuthLayout = ({
7
+ children,
8
+ StyleComponent,
9
+ t = (key) => key,
10
+ title = "Welcome Back",
11
+ subTitle = "Please introduce yourself",
12
+ logo,
13
+ appName = "default",
14
+ containerClassName = "",
15
+ leftClassName = "",
16
+ rightClassName = "",
17
+ rightImgClassName = "",
18
+ rightImageUrl,
19
+ additionalContent,
20
+ showTopHeader = true,
21
+ showLanguageSelector = true,
22
+ updateLanguage,
23
+ showBack = false,
24
+ onBack,
25
+ backLabel = "Back",
26
+ }) => {
27
+ const Wrapper = StyleComponent || "div";
28
+ const wrapperClassName = formatClassname([
29
+ "auth-layout",
30
+ appName,
31
+ containerClassName,
32
+ ]);
33
+
34
+ return (
35
+
36
+
37
+ <>
38
+ {showTopHeader && (
39
+ <AuthNavbar
40
+ logo={logo}
41
+ appName={appName}
42
+ showLanguageSelector={showLanguageSelector}
43
+ updateLanguage={updateLanguage}
44
+ showBack={showBack}
45
+ onBack={onBack}
46
+ backLabel={backLabel}
47
+ />
48
+ )}
49
+ <Style>
50
+ <div className="main-cont">
51
+ <div className={formatClassname(["d-cont left", leftClassName])}>
52
+ <div className="main">
53
+ {logo && (
54
+ <div className="left-logo">
55
+ <img src={logo} alt={`${appName} logo`} />
56
+ </div>
57
+ )}
58
+ <div className="left-header">
59
+ {title && <h2>{t(title)}</h2>}
60
+ {subTitle && (
61
+ <p>{typeof subTitle === "string" ? t(subTitle) : subTitle}</p>
62
+ )}
63
+ </div>
64
+ {children}
65
+ {additionalContent}
66
+ </div>
67
+ </div>
68
+
69
+ <div
70
+ className={formatClassname(["d-cont right", rightClassName])}
71
+ style={
72
+ rightImageUrl
73
+ ? { backgroundImage: `url(${rightImageUrl})`, backgroundSize: "cover" }
74
+ : {}
75
+ }
76
+ >
77
+ <div className={formatClassname(["right-img", rightImgClassName])} />
78
+ </div>
79
+ </div>
80
+ </Style>
81
+ </>
82
+ );
83
+ };
84
+
85
+ export default AuthLayout;
@@ -0,0 +1,77 @@
1
+ .auth-layout {
2
+ min-height: 100vh;
3
+ display: flex;
4
+ flex-direction: column;
5
+ background-color: #fff;
6
+ font-family: "Outfit", sans-serif;
7
+
8
+ .main-cont {
9
+ flex: 1;
10
+ display: flex;
11
+ height: calc(100vh - 64px); // Subtract header height
12
+ transition: all 0.2s ease;
13
+
14
+ @media (max-width: 768px) {
15
+ flex-direction: column;
16
+ height: auto;
17
+ }
18
+ }
19
+
20
+ .d-cont.left {
21
+ width: 50%;
22
+ padding: 6rem 2rem;
23
+ display: flex;
24
+ justify-content: center;
25
+ overflow-y: auto;
26
+ background: #fff;
27
+
28
+ .main {
29
+ width: 350px;
30
+ margin: auto;
31
+
32
+ .left-logo img {
33
+ height: 40px;
34
+ margin-bottom: 48px;
35
+ }
36
+
37
+ .left-header h2 {
38
+ font-size: 36px;
39
+ font-weight: 600;
40
+ color: #101828;
41
+ margin-bottom: 12px;
42
+ }
43
+
44
+ .left-header p {
45
+ font-size: 16px;
46
+ color: #667085;
47
+ }
48
+ }
49
+ }
50
+
51
+ .d-cont.right {
52
+ width: 50%;
53
+ background-size: cover;
54
+ background-position: center;
55
+ background-repeat: no-repeat;
56
+
57
+ @media (max-width: 768px) {
58
+ display: none;
59
+ }
60
+ }
61
+
62
+ &.sbg {
63
+ --primary-color: #992f24;
64
+ .ant-btn-primary {
65
+ background: var(--primary-color);
66
+ border-color: var(--primary-color);
67
+ }
68
+ }
69
+
70
+ &.nashiriki {
71
+ --primary-color: #004b91;
72
+ .ant-btn-primary {
73
+ background: var(--primary-color);
74
+ border-color: var(--primary-color);
75
+ }
76
+ }
77
+ }