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.
@@ -0,0 +1,305 @@
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: #265a80;
24
+
25
+ .language-option span {
26
+ color: #ffffff;
27
+ }
28
+ }
29
+
30
+ &.ant-select-item-option-selected {
31
+ background-color: #265a80;
32
+ color: #ffffff;
33
+
34
+ .language-option span {
35
+ color: #ffffff;
36
+ }
37
+ }
38
+
39
+ .language-option {
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 8px;
43
+
44
+ .flag-icon {
45
+ width: 20px;
46
+ height: 14px;
47
+ border-radius: 2px;
48
+ }
49
+
50
+ span {
51
+ font-size: 14px;
52
+ font-weight: 500;
53
+ color: #344054;
54
+ }
55
+ }
56
+ }
57
+ }
58
+ `;
59
+
60
+ const style = styled.div`
61
+ font-family: Outfit;
62
+
63
+ .btns {
64
+ display: flex;
65
+ gap: 12px;
66
+ }
67
+
68
+ .d-container {
69
+ width: 80vw;
70
+ margin-left: auto;
71
+ margin-right: auto;
72
+
73
+ @media (max-width: 1440px) {
74
+ width: 85vw;
75
+ }
76
+
77
+ @media (${TABLET_WIDTH}) {
78
+ width: calc(100vw - 4.6rem);
79
+ }
80
+ }
81
+
82
+ .flex-c {
83
+ display: flex;
84
+ flex-direction: column;
85
+ }
86
+
87
+ .jus-c {
88
+ justify-content: center;
89
+ }
90
+
91
+ .d-navbar {
92
+ box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
93
+ position: fixed;
94
+ top: 0;
95
+ left: 0;
96
+ right: 0;
97
+ background-color: white;
98
+ z-index: 1000;
99
+ width: 100%;
100
+ height: 80px;
101
+ display: flex;
102
+ align-items: center;
103
+
104
+ @media (${TABLET_WIDTH}) {
105
+ height: 72px;
106
+ }
107
+
108
+ @media (${MOBILE_WIDTH}) {
109
+ height: 64px;
110
+ }
111
+
112
+ .main-cont {
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: space-between;
116
+ width: 100%;
117
+ height: 100%;
118
+ padding: 0 80px;
119
+
120
+ @media (max-width: 1200px) {
121
+ padding: 0 32px;
122
+ }
123
+
124
+ @media (${TABLET_WIDTH}) {
125
+ padding: 0 24px;
126
+ }
127
+
128
+ @media (${MOBILE_WIDTH}) {
129
+ padding: 0 16px;
130
+ }
131
+
132
+ .left {
133
+ display: flex;
134
+ align-items: center;
135
+ height: 100%;
136
+
137
+ .navbar-logo {
138
+ cursor: pointer;
139
+ height: 40px;
140
+ width: auto;
141
+ object-fit: contain;
142
+
143
+ @media (${MOBILE_WIDTH}) {
144
+ height: 32px;
145
+ }
146
+ }
147
+
148
+ img {
149
+ cursor: pointer;
150
+ height: 40px;
151
+ width: auto;
152
+ object-fit: contain;
153
+
154
+ @media (${MOBILE_WIDTH}) {
155
+ height: 32px;
156
+ }
157
+ }
158
+ }
159
+
160
+ .right {
161
+ display: flex;
162
+ gap: 1rem;
163
+ align-items: center;
164
+
165
+ .language-select {
166
+ min-width: 100px;
167
+
168
+ .ant-select-selector {
169
+ padding: 8px 12px !important;
170
+ height: auto !important;
171
+ border: none !important;
172
+
173
+ .ant-select-selection-item {
174
+ padding: 0 !important;
175
+ line-height: none !important;
176
+ &:hover{
177
+ background-color: transparent !important;
178
+ border: none !important;
179
+ }
180
+ }
181
+ }
182
+
183
+ .ant-select-arrow {
184
+ color: #667085;
185
+ display: flex;
186
+ align-items: center;
187
+ height: 80%;
188
+ }
189
+ }
190
+
191
+ .language-option {
192
+ display: flex;
193
+ align-items: center;
194
+ gap: 8px;
195
+
196
+ .flag-icon {
197
+ width: 20px;
198
+ height: 15px;
199
+ object-fit: cover;
200
+ border-radius: 2px;
201
+ }
202
+
203
+ span {
204
+ font-size: 14px;
205
+ font-weight: 500;
206
+ color: #344054;
207
+ }
208
+ }
209
+
210
+ .back-btn {
211
+ background: transparent;
212
+ border: 1px solid #D0D5DD;
213
+ border-radius: 8px;
214
+ padding: 8px 16px;
215
+ font-size: 14px;
216
+ font-weight: 500;
217
+ color: #344054;
218
+ cursor: pointer;
219
+ transition: all 0.2s ease;
220
+ box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
221
+
222
+ &:hover {
223
+ background: #F9FAFB;
224
+ border-color: #98A2B3;
225
+ }
226
+
227
+ &:active {
228
+ transform: scale(0.98);
229
+ }
230
+ }
231
+
232
+ .ant-btn {
233
+ font-size: 14px;
234
+ padding: 6px 0;
235
+ text-align: center;
236
+ width: 70px;
237
+
238
+ @media (${MOBILE_WIDTH}) {
239
+ padding: 3px 0;
240
+ }
241
+ }
242
+
243
+ @media (max-width: 1070px) {
244
+ gap: 1rem;
245
+ }
246
+ }
247
+ }
248
+ }
249
+
250
+ &.bordered {
251
+ .d-navbar {
252
+ position: relative;
253
+ box-shadow: unset;
254
+ border-bottom: 1px solid var(--base-gray-40);
255
+ }
256
+ }
257
+
258
+ .tazama-extra {
259
+ &.mobile {
260
+ display: none;
261
+ }
262
+
263
+ @media (${MOBILE_WIDTH}) {
264
+ &.mobile {
265
+ display: flex;
266
+ }
267
+
268
+ &.desktop {
269
+ display: none;
270
+ }
271
+ }
272
+
273
+ .ant-btn {
274
+ width: 90px !important;
275
+ display: flex;
276
+ flex-direction: column;
277
+ justify-content: center;
278
+
279
+ &.w-100 {
280
+ width: 100% !important;
281
+ }
282
+
283
+ span {
284
+ margin: 0 auto;
285
+ }
286
+ }
287
+
288
+ .nav-extra {
289
+ position: fixed;
290
+ top: 0;
291
+ left: 0;
292
+ height: 100dvh;
293
+ width: 100%;
294
+ background: white;
295
+ margin-left: -100%;
296
+ transition: 0.4s margin-left;
297
+
298
+ &.toggled {
299
+ margin-left: 0;
300
+ }
301
+ }
302
+ }
303
+ `;
304
+
305
+ 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;