@wazobiatech/wazui 0.0.10 → 0.0.11
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/.storybook/main.ts +41 -0
- package/.storybook/preview-head.html +3 -0
- package/.storybook/preview.ts +53 -0
- package/package.json +1 -1
- package/src/assets/dashboard/book.svg +6 -0
- package/src/assets/dashboard/edit.svg +5 -0
- package/src/assets/dashboard/emerald.svg +9 -0
- package/src/assets/dashboard/eye.svg +4 -0
- package/src/assets/dashboard/gold.svg +9 -0
- package/src/assets/dashboard/percentage-square.svg +6 -0
- package/src/assets/dashboard/sapphire.svg +9 -0
- package/src/assets/dashboard/send-2.svg +4 -0
- package/src/assets/desktop.svg +7 -0
- package/src/assets/fonts/UniversalFeature/FeatureJungle-Light.otf +0 -0
- package/src/assets/fonts/UniversalFeature/FeatureJungle-Light.woff +0 -0
- package/src/assets/fonts/UniversalFeature/FeatureJungle-Light.woff2 +0 -0
- package/src/assets/fonts/UniversalFeature/FeatureJungle-Regular.otf +0 -0
- package/src/assets/fonts/UniversalFeature/FeatureJungle-Regular.woff +0 -0
- package/src/assets/fonts/UniversalFeature/FeatureJungle-Regular.woff2 +0 -0
- package/src/assets/fonts/UniversalJungle/UniversalJungle-420.otf +0 -0
- package/src/assets/fonts/UniversalJungle/UniversalJungle-420.woff +0 -0
- package/src/assets/fonts/UniversalJungle/UniversalJungle-420.woff2 +0 -0
- package/src/assets/fonts/UniversalJungle/UniversalJungle-515.otf +0 -0
- package/src/assets/fonts/UniversalJungle/UniversalJungle-515.woff +0 -0
- package/src/assets/fonts/UniversalJungle/UniversalJungle-515.woff2 +0 -0
- package/src/assets/instagram.svg +9 -0
- package/src/assets/mobile.svg +4 -0
- package/src/assets/no-data-image.svg +41 -0
- package/src/assets/no-image-icon.svg +84 -0
- package/src/assets/pexels.svg +9 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/sounds/draft.mp3 +0 -0
- package/src/assets/sounds/error.mp3 +0 -0
- package/src/assets/sounds/publish.mp3 +0 -0
- package/src/assets/tablet.svg +4 -0
- package/src/assets/unsplash.svg +3 -0
- package/src/assets/upload-image.svg +43 -0
- package/src/assets/user.svg +4 -0
- package/src/components/shadcn/index.ts +31 -0
- package/src/config/env.ts +15 -0
- package/src/contexts/ThemeContext.tsx +11 -0
- package/src/data/users.json +6014 -0
- package/src/decorators/ActionModalDecorator.tsx +10 -0
- package/src/decorators/ApolloDecorator.tsx +19 -0
- package/src/decorators/DolosApolloDecorator.tsx +31 -0
- package/src/decorators/JestDecorators.tsx +34 -0
- package/src/decorators/ReactQueryDecorator.tsx +13 -0
- package/src/decorators/RouterDecorator.tsx +5 -0
- package/src/decorators/UnsafePropsDecorator.tsx +0 -0
- package/src/env.ts +99 -0
- package/src/hooks/use-autogrow.ts +28 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/useAuthors.ts +78 -0
- package/src/hooks/useDebounce.ts +18 -0
- package/src/hooks/useMercuryProjectToken.ts +112 -0
- package/src/hooks/useProjectToken.ts +21 -0
- package/src/hooks/useTheme.ts +12 -0
- package/src/index.css +397 -0
- package/src/index.ts +104 -0
- package/src/mocks/env.ts +12 -0
- package/src/providers/QueryProvider/index.tsx +10 -0
- package/src/providers/ThemeProvider/index.tsx +52 -0
- package/src/types/category.types.ts +13 -0
- package/src/types/image.types.ts +44 -0
- package/src/types/post.types.ts +121 -0
- package/src/types/theme.types.ts +10 -0
- package/src/types/users.types.ts +5 -0
- package/src/utils/apolloClient.ts +160 -0
- package/src/utils/articleMetadata.ts +97 -0
- package/src/utils/audio.ts +10 -0
- package/src/utils/imageProcessing.ts +399 -0
- package/src/utils/images.ts +279 -0
- package/src/utils/mercury.ts +0 -0
- package/src/utils/utils.ts +638 -0
- package/src/utils/videos.ts +29 -0
- package/src/vite-env.d.ts +1 -0
- package/.env.test +0 -5
package/src/index.css
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
@import 'tw-animate-css';
|
|
2
|
+
@import 'react-advanced-cropper/dist/style.css';
|
|
3
|
+
@import 'quill/dist/quill.core.css';
|
|
4
|
+
@import 'quill/dist/quill.snow.css';
|
|
5
|
+
@import "tailwindcss";
|
|
6
|
+
|
|
7
|
+
@font-face {
|
|
8
|
+
font-family: 'UniversalJungle';
|
|
9
|
+
src: url('./assets/fonts/UniversalJungle/UniversalJungle-420.woff') format('woff');
|
|
10
|
+
}
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: 'UniversalFeature';
|
|
13
|
+
src: url('./assets/fonts/UniversalFeature/FeatureJungle-Light.woff') format('woff');
|
|
14
|
+
font-style: normal;
|
|
15
|
+
font-display: swap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@custom-variant dark (&:is(.dark *));
|
|
19
|
+
|
|
20
|
+
@theme {
|
|
21
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
22
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
23
|
+
--radius-lg: var(--radius);
|
|
24
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
25
|
+
--color-background: var(--background);
|
|
26
|
+
--color-foreground: var(--foreground);
|
|
27
|
+
--color-card: var(--card);
|
|
28
|
+
--color-card-foreground: var(--card-foreground);
|
|
29
|
+
--color-popover: var(--popover);
|
|
30
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
31
|
+
--color-primary: var(--primary);
|
|
32
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
33
|
+
--color-secondary: var(--secondary);
|
|
34
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
35
|
+
--color-muted: var(--muted);
|
|
36
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
37
|
+
--color-accent: var(--accent);
|
|
38
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
39
|
+
--color-destructive: var(--destructive);
|
|
40
|
+
--color-border: var(--border);
|
|
41
|
+
--color-input: var(--input);
|
|
42
|
+
--color-ring: var(--ring);
|
|
43
|
+
--color-chart-1: var(--chart-1);
|
|
44
|
+
--color-chart-2: var(--chart-2);
|
|
45
|
+
--color-chart-3: var(--chart-3);
|
|
46
|
+
--color-chart-4: var(--chart-4);
|
|
47
|
+
--color-chart-5: var(--chart-5);
|
|
48
|
+
--color-sidebar: var(--sidebar);
|
|
49
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
50
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
51
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
52
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
53
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
54
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
55
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
56
|
+
/* --sidebar-width: var(--sidebar-width); */
|
|
57
|
+
--font-display: var(--font-display);
|
|
58
|
+
|
|
59
|
+
--text: 10px;
|
|
60
|
+
--text-xs: 11px;
|
|
61
|
+
--text-sm: 12px;
|
|
62
|
+
--text-base: 14px;
|
|
63
|
+
--text-md: 18px;
|
|
64
|
+
--text-xl: 20px;
|
|
65
|
+
--text-2xl: 24px;
|
|
66
|
+
--text-3xl: 30px;
|
|
67
|
+
|
|
68
|
+
--font-weight-normal: 420;
|
|
69
|
+
|
|
70
|
+
--radius: 4px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:root {
|
|
74
|
+
--radius: 0.5rem;
|
|
75
|
+
--background: oklch(1 0 0);
|
|
76
|
+
--foreground: #7a7a7a;
|
|
77
|
+
/* --foreground: #434343; */
|
|
78
|
+
--card: oklch(1 0 0);
|
|
79
|
+
--card-foreground: #7a7a7a;
|
|
80
|
+
--popover: oklch(1 0 0);
|
|
81
|
+
--popover-foreground: #7a7a7a;
|
|
82
|
+
--primary: #86fc65;
|
|
83
|
+
--primary-foreground: #272727;
|
|
84
|
+
--secondary: #fbbc9aa3;
|
|
85
|
+
--secondary-foreground: #6ffff0;
|
|
86
|
+
--muted: #f9f9f9;
|
|
87
|
+
--muted-foreground: #8d8d8d;
|
|
88
|
+
/* --muted-foreground: #acbcc4; */
|
|
89
|
+
--accent: #befef7;
|
|
90
|
+
--accent-foreground: #001a24;
|
|
91
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
92
|
+
--border: #e9e9e9;
|
|
93
|
+
--input: oklch(0.92 0.004 286.32);
|
|
94
|
+
--ring: #a4f87a;
|
|
95
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
96
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
97
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
98
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
99
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
100
|
+
--sidebar: oklch(0.985 0 0);
|
|
101
|
+
--sidebar-foreground: #7a7a7a;
|
|
102
|
+
--sidebar-primary: #a4f87a;
|
|
103
|
+
--sidebar-primary-foreground: oklch(0.982 0.018 155.826);
|
|
104
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
105
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
106
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
107
|
+
--sidebar-ring: #a4f87a;
|
|
108
|
+
/* --sidebar-width: 1rem; */
|
|
109
|
+
--font-display: 'UniversalJungle', sans-serif;
|
|
110
|
+
/* --font-display: 'Playwrite RO', cursives; */
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.dark {
|
|
114
|
+
--background: black;
|
|
115
|
+
--foreground: oklch(0.985 0 0);
|
|
116
|
+
--card: oklch(0.21 0.006 285.885);
|
|
117
|
+
--card-foreground: oklch(0.985 0 0);
|
|
118
|
+
--popover: oklch(0.21 0.006 285.885);
|
|
119
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
120
|
+
--primary: oklch(0.696 0.17 162.48);
|
|
121
|
+
--primary-foreground: oklch(0.393 0.095 152.535);
|
|
122
|
+
--secondary: oklch(0.274 0.006 286.033);
|
|
123
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
124
|
+
--muted: oklch(0.274 0.006 286.033);
|
|
125
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
|
126
|
+
--accent: oklch(0.274 0.006 286.033);
|
|
127
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
128
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
129
|
+
--border: oklch(1 0 0 / 10%);
|
|
130
|
+
--input: oklch(1 0 0 / 15%);
|
|
131
|
+
--ring: oklch(0.527 0.154 150.069);
|
|
132
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
133
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
134
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
135
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
136
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
137
|
+
--sidebar: oklch(0.21 0.006 285.885);
|
|
138
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
139
|
+
--sidebar-primary: oklch(0.696 0.17 162.48);
|
|
140
|
+
--sidebar-primary-foreground: oklch(0.393 0.095 152.535);
|
|
141
|
+
--sidebar-accent: oklch(0.274 0.006 286.033);
|
|
142
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
143
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
144
|
+
--sidebar-ring: oklch(0.527 0.154 150.069);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.brand {
|
|
148
|
+
--radius: 1rem;
|
|
149
|
+
--background: oklch(1 0 0);
|
|
150
|
+
--foreground: #7a7a7a;
|
|
151
|
+
--card: oklch(1 0 0);
|
|
152
|
+
--card-foreground: #7a7a7a;
|
|
153
|
+
--popover: oklch(1 0 0);
|
|
154
|
+
--popover-foreground: #7a7a7a;
|
|
155
|
+
--primary: oklch(0.795 0.184 86.047);
|
|
156
|
+
--primary-foreground: oklch(0.421 0.095 57.708);
|
|
157
|
+
--secondary: oklch(0.967 0.001 286.375);
|
|
158
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
159
|
+
--muted: oklch(0.967 0.001 286.375);
|
|
160
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
|
161
|
+
--accent: oklch(0.967 0.001 286.375);
|
|
162
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
163
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
164
|
+
--border: oklch(0.92 0.004 286.32);
|
|
165
|
+
--input: oklch(0.92 0.004 286.32);
|
|
166
|
+
--ring: oklch(0.795 0.184 86.047);
|
|
167
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
168
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
169
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
170
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
171
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
172
|
+
--sidebar: oklch(0.985 0 0);
|
|
173
|
+
--sidebar-foreground: #7a7a7a;
|
|
174
|
+
--sidebar-primary: oklch(0.795 0.184 86.047);
|
|
175
|
+
--sidebar-primary-foreground: oklch(0.421 0.095 57.708);
|
|
176
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
177
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
178
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
179
|
+
--sidebar-ring: oklch(0.795 0.184 86.047);
|
|
180
|
+
/* --font-display: 'UniversalFeature', cursives; */
|
|
181
|
+
--font-display: 'Playwrite RO', cursives;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@layer base {
|
|
185
|
+
* {
|
|
186
|
+
@apply border-border outline-ring/50;
|
|
187
|
+
}
|
|
188
|
+
body {
|
|
189
|
+
@apply bg-background text-foreground font-display font-normal text-base;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Hide scrollbar for Chrome, Safari and Opera */
|
|
194
|
+
.no-scrollbar::-webkit-scrollbar {
|
|
195
|
+
display: none;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Hide scrollbar for IE, Edge and Firefox */
|
|
199
|
+
.no-scrollbar {
|
|
200
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
201
|
+
scrollbar-width: none; /* Firefox */
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
#editorParent > div {
|
|
205
|
+
height: 100%;
|
|
206
|
+
padding-bottom: 20px;
|
|
207
|
+
}
|
|
208
|
+
.ql-editor {
|
|
209
|
+
max-height: 100%;
|
|
210
|
+
padding-bottom: 20px;
|
|
211
|
+
word-break: break-word;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.quill-editor .ql-editor p,
|
|
215
|
+
.quill-editor .ql-editor li,
|
|
216
|
+
.quill-editor .ql-editor.ql-blank::before {
|
|
217
|
+
margin: 10px 0;
|
|
218
|
+
font-family: 'UniversalJungle';
|
|
219
|
+
font-weight: 420;
|
|
220
|
+
font-size: 16px;
|
|
221
|
+
line-height: 150%;
|
|
222
|
+
letter-spacing: 0%;
|
|
223
|
+
vertical-align: middle;
|
|
224
|
+
color: #5f5e5e;
|
|
225
|
+
font-style: normal;
|
|
226
|
+
}
|
|
227
|
+
.quill-editor .ql-editor.ql-blank::before {
|
|
228
|
+
opacity: 0.5;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.quill-editor .ql-editor li {
|
|
232
|
+
line-height: 1.7;
|
|
233
|
+
font-size: 16px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.quill-editor img {
|
|
237
|
+
position: relative;
|
|
238
|
+
width: 100%;
|
|
239
|
+
object-fit: cover;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.quill-editor {
|
|
243
|
+
border: 0 !important;
|
|
244
|
+
}
|
|
245
|
+
.quill-editor .ql-picker-options {
|
|
246
|
+
padding: 0;
|
|
247
|
+
}
|
|
248
|
+
.ql-picker {
|
|
249
|
+
line-height: 0;
|
|
250
|
+
}
|
|
251
|
+
.ql-editor ol li[data-list='bullet']:before {
|
|
252
|
+
content: none !important;
|
|
253
|
+
font-style: inherit !important;
|
|
254
|
+
}
|
|
255
|
+
#toolbar .ql-picker-label::before,
|
|
256
|
+
#toolbar .ql-picker-item::before {
|
|
257
|
+
/* color: var(--muted-foreground) !important; */
|
|
258
|
+
}
|
|
259
|
+
#toolbar .ql-stroke {
|
|
260
|
+
/* stroke: var(--muted-foreground) !important; */
|
|
261
|
+
}
|
|
262
|
+
#toolbar .ql-stroke:hover {
|
|
263
|
+
/* stroke: black !important; */
|
|
264
|
+
}
|
|
265
|
+
#toolbar .ql-picker-options:hover {
|
|
266
|
+
/* color: black !important; */
|
|
267
|
+
}
|
|
268
|
+
#toolbar .ql-header .ql-picker-item {
|
|
269
|
+
padding: 12px 16px !important;
|
|
270
|
+
border-bottom: 0.5px solid #e4e7ec;
|
|
271
|
+
/* color: black !important; */
|
|
272
|
+
}
|
|
273
|
+
.quill-editor .ql-picker-item::before:hover {
|
|
274
|
+
color: black !important;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.quill-editor .ql-editor .ql-video {
|
|
278
|
+
position: relative;
|
|
279
|
+
left: 20%;
|
|
280
|
+
width: 60%;
|
|
281
|
+
min-height: 400px;
|
|
282
|
+
position: relative;
|
|
283
|
+
overflow: auto;
|
|
284
|
+
}
|
|
285
|
+
.quill-editor .ql-tooltip {
|
|
286
|
+
left: 10% !important;
|
|
287
|
+
z-index: 10;
|
|
288
|
+
}
|
|
289
|
+
.custom-link-tooltip {
|
|
290
|
+
padding: 12px !important;
|
|
291
|
+
border-radius: 8px !important;
|
|
292
|
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
|
|
293
|
+
border: 1px solid #e5e7eb !important;
|
|
294
|
+
background: white !important;
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
gap: 8px;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.custom-link-tooltip input {
|
|
301
|
+
border: 1px solid #d1d5db !important;
|
|
302
|
+
border-radius: 4px !important;
|
|
303
|
+
padding: 6px 8px !important;
|
|
304
|
+
font-size: 13px !important;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.custom-link-tooltip input:focus {
|
|
308
|
+
outline: none !important;
|
|
309
|
+
border-color: #3b82f6 !important;
|
|
310
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
|
|
311
|
+
}
|
|
312
|
+
.custom-link-tooltip a.ql-action {
|
|
313
|
+
background-color: #3b82f6 !important;
|
|
314
|
+
color: white;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.ql-toolbar button[data-tooltip]:hover::before,
|
|
318
|
+
.ql-toolbar select[data-tooltip]:hover::before,
|
|
319
|
+
.ql-toolbar span[data-tooltip]:hover::before {
|
|
320
|
+
content: attr(data-tooltip);
|
|
321
|
+
position: absolute;
|
|
322
|
+
bottom: 100%;
|
|
323
|
+
left: 50%;
|
|
324
|
+
transform: translateX(-50%);
|
|
325
|
+
color: white;
|
|
326
|
+
padding: 4px 8px;
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
font-size: 12px;
|
|
329
|
+
white-space: nowrap;
|
|
330
|
+
z-index: 1000;
|
|
331
|
+
pointer-events: none;
|
|
332
|
+
margin-bottom: 4px;
|
|
333
|
+
color: var(--primary-foreground);
|
|
334
|
+
background-color: var(--primary);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.ql-toolbar button[data-tooltip]:hover::after,
|
|
338
|
+
.ql-toolbar select[data-tooltip]:hover::after,
|
|
339
|
+
.ql-toolbar span[data-tooltip]:hover::after {
|
|
340
|
+
content: '';
|
|
341
|
+
position: absolute;
|
|
342
|
+
bottom: 70%;
|
|
343
|
+
left: 50%;
|
|
344
|
+
transform: translateX(-40%);
|
|
345
|
+
border: 6px solid transparent;
|
|
346
|
+
border-top-color: var(--primary);
|
|
347
|
+
z-index: 1000;
|
|
348
|
+
pointer-events: none;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.ql-toolbar button,
|
|
352
|
+
.ql-toolbar select,
|
|
353
|
+
.ql-toolbar span {
|
|
354
|
+
position: relative;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.waz_shadow {
|
|
358
|
+
box-shadow: 0px 4px 12px 0px #00000012;
|
|
359
|
+
}
|
|
360
|
+
.waz_slight_shadow {
|
|
361
|
+
/* box-shadow: 0px 4px 8px 0px #a0a0a021; */
|
|
362
|
+
border: 0.5px solid #e3e3e3;
|
|
363
|
+
}
|
|
364
|
+
.slight_border {
|
|
365
|
+
border-width: 0.5px;
|
|
366
|
+
border-color: #6c6c6c;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
@keyframes wazui_progress_bar {
|
|
370
|
+
0% {
|
|
371
|
+
transform: translateX(-98%);
|
|
372
|
+
}
|
|
373
|
+
100% {
|
|
374
|
+
transform: translateX(0%);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
@layer base {
|
|
378
|
+
* {
|
|
379
|
+
@apply border-border outline-ring/50;
|
|
380
|
+
}
|
|
381
|
+
body {
|
|
382
|
+
@apply bg-background text-foreground text-base leading-[4.5];
|
|
383
|
+
}
|
|
384
|
+
a:not(.quill-editor a),
|
|
385
|
+
th {
|
|
386
|
+
@apply !text-[#101828];
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
button {
|
|
390
|
+
@apply text-base;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
h1 {
|
|
394
|
+
@apply text-[#434343];
|
|
395
|
+
font-weight: 500;
|
|
396
|
+
}
|
|
397
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Import styles
|
|
2
|
+
import './index.css';
|
|
3
|
+
|
|
4
|
+
import TimeAgo from 'javascript-time-ago';
|
|
5
|
+
|
|
6
|
+
import en from 'javascript-time-ago/locale/en';
|
|
7
|
+
import ru from 'javascript-time-ago/locale/ru';
|
|
8
|
+
|
|
9
|
+
TimeAgo.addDefaultLocale(en);
|
|
10
|
+
TimeAgo.addLocale(ru);
|
|
11
|
+
|
|
12
|
+
export type { Post } from './types/post.types';
|
|
13
|
+
export type { FilterField, StatusFilter } from './components/wazui/WazUiBlogComponent/types';
|
|
14
|
+
export { cleanHTML } from './utils/utils';
|
|
15
|
+
// Export Shadcn UI components
|
|
16
|
+
export { Button } from './components/shadcn/ui/button';
|
|
17
|
+
export * from './components/shadcn/ui/dropdown-menu';
|
|
18
|
+
// Export all other shadcn components except Table to avoid conflict
|
|
19
|
+
export * from './components/shadcn/ui/alert';
|
|
20
|
+
export * from './components/shadcn/ui/badge';
|
|
21
|
+
export * from './components/shadcn/ui/breadcrumb';
|
|
22
|
+
export * from './components/shadcn/ui/calendar';
|
|
23
|
+
export * from './components/shadcn/ui/card';
|
|
24
|
+
export * from './components/shadcn/ui/checkbox';
|
|
25
|
+
export * from './components/shadcn/ui/collapsible';
|
|
26
|
+
export * from './components/shadcn/ui/command';
|
|
27
|
+
export * from './components/shadcn/ui/context-menu';
|
|
28
|
+
export * from './components/shadcn/ui/dialog';
|
|
29
|
+
export * from './components/shadcn/ui/form';
|
|
30
|
+
export * from './components/shadcn/ui/input';
|
|
31
|
+
export * from './components/shadcn/ui/label';
|
|
32
|
+
export * from './components/shadcn/ui/popover';
|
|
33
|
+
export * from './components/shadcn/ui/radio-group';
|
|
34
|
+
export * from './components/shadcn/ui/select';
|
|
35
|
+
export * from './components/shadcn/ui/separator';
|
|
36
|
+
export * from './components/shadcn/ui/sheet';
|
|
37
|
+
export * from './components/shadcn/ui/sidebar';
|
|
38
|
+
// Explicitly export useSidebar to ensure it's included in the main bundle
|
|
39
|
+
export { useSidebar } from './components/shadcn/ui/sidebar';
|
|
40
|
+
export * from './components/shadcn/ui/skeleton';
|
|
41
|
+
export * from './components/shadcn/ui/switch';
|
|
42
|
+
export * from './components/shadcn/ui/tabs';
|
|
43
|
+
export * from './components/shadcn/ui/textarea';
|
|
44
|
+
export * from './components/shadcn/ui/toggle-group';
|
|
45
|
+
export * from './components/shadcn/ui/toggle';
|
|
46
|
+
export * from './components/shadcn/ui/tooltip';
|
|
47
|
+
export * from './components/shadcn/ui/sonner';
|
|
48
|
+
// Export Table with alias to avoid conflict
|
|
49
|
+
export {
|
|
50
|
+
Table as ShadcnTable,
|
|
51
|
+
TableHeader,
|
|
52
|
+
TableBody,
|
|
53
|
+
TableFooter,
|
|
54
|
+
TableHead,
|
|
55
|
+
TableRow,
|
|
56
|
+
TableCell,
|
|
57
|
+
TableCaption,
|
|
58
|
+
} from './components/shadcn/ui/table';
|
|
59
|
+
|
|
60
|
+
// Export WAZUI components
|
|
61
|
+
export { default as WazUIButton } from './components/wazui/WazUIButton/WazUiButton';
|
|
62
|
+
export { default as WazUIBlogComponent } from './components/wazui/WazUiBlogComponent/WazUIBlogComponent';
|
|
63
|
+
// export { default as WazUIBlogComponentWithProvider } from './components/wazui/WazUiBlogComponent/WazUIBlogComponentWithProvider';
|
|
64
|
+
export { default as WazUiPostCard } from './components/wazui/WazUiPostCard/WazUiPostCard';
|
|
65
|
+
export { FilterFieldType, BlogStatus } from './components/wazui/WazUiBlogComponent/types';
|
|
66
|
+
export { WazUIPostActions } from './components/wazui/WazUiPostCard/WazUIPostActions';
|
|
67
|
+
export { WazUIPostCategories } from './components/wazui/WazUiPostCard/WazUIPostCategories';
|
|
68
|
+
export { WazUIPostTags } from './components/wazui/WazUiPostCard/WazUiPostTags';
|
|
69
|
+
export { WazUIPostStatistics } from './components/wazui/WazUiPostCard/WazUiPostStatistics';
|
|
70
|
+
export { default as WazUIThemeProvider } from './providers/ThemeProvider';
|
|
71
|
+
export { default as useWazUITheme } from './hooks/useTheme';
|
|
72
|
+
|
|
73
|
+
export { default as WazUIQueryProvider } from './providers/QueryProvider';
|
|
74
|
+
export { WazuiActionModalProvider } from './components/wazui/WazuiActionModal/provider';
|
|
75
|
+
export { withReactQuery } from './decorators/ReactQueryDecorator';
|
|
76
|
+
|
|
77
|
+
export { default as WazUiGqlMediaLibrary } from './components/wazui/WazUiGqlMediaLibrary/WazUiGqlMediaLibrary';
|
|
78
|
+
export { default as WazUiCreateBlogContent } from './components/wazui/WazUiCreateBlogContent/WazUiCreateBlogContent';
|
|
79
|
+
export { default as BlogPostsComponent } from './components/wazui/BlogPostsComponent/BlogPostsComponent';
|
|
80
|
+
export { default as CategoriesComponent } from './components/wazui/CategoriesComponent/CategoriesComponent';
|
|
81
|
+
export { default as TagsComponent } from './components/wazui/TagsComponent/TagsComponent';
|
|
82
|
+
export { default as RecipesComponent } from './components/wazui/RecipesComponent/RecipesComponent';
|
|
83
|
+
export { default as RedirectsComponent } from './components/wazui/RedirectsComponent/RedirectsComponent';
|
|
84
|
+
export { default as BlogCategoryContent } from './components/wazui/BlogCategoryContent/BlogCategoryContent';
|
|
85
|
+
export { default as BlogTagContent } from './components/wazui/BlogTagContent/BlogTagContent';
|
|
86
|
+
export { default as BlogPostContentComponent } from './components/wazui/BlogPostContentComponent/BlogPostContentComponent';
|
|
87
|
+
export { default as PurgeCache } from './components/wazui/PurgeCache/PurgeCache';
|
|
88
|
+
export { default as ClearCacheHistory } from './components/wazui/ClearCacheHistory/ClearCacheHistory';
|
|
89
|
+
export { default as RecipeContentComponent } from './components/wazui/RecipeContentComponent/RecipeContentComponent';
|
|
90
|
+
export { default as RecipeTags } from './components/wazui/RecipeTags/RecipeTags';
|
|
91
|
+
export { default as RecipeCategories } from './components/wazui/RecipeCategories/RecipeCategories';
|
|
92
|
+
export { default as WazUIBlogDashboard } from './components/wazui/WazUIBlogDashboard/WazUIBlogDashboard';
|
|
93
|
+
export { default as WazUIPagesComponent } from './components/wazui/WazUiPagesComponent/WazUiPagesComponent';
|
|
94
|
+
export type {
|
|
95
|
+
WazUIBlogDashboardProps,
|
|
96
|
+
DashboardMetric,
|
|
97
|
+
ChartDataPoint,
|
|
98
|
+
ArticleData,
|
|
99
|
+
WriterData,
|
|
100
|
+
} from './components/wazui/WazUIBlogDashboard/types';
|
|
101
|
+
export { useAuthors } from './hooks/useAuthors';
|
|
102
|
+
export * from '@tanstack/react-table';
|
|
103
|
+
export * from 'zod';
|
|
104
|
+
export { fetchMercuryToken } from './hooks/useMercuryProjectToken';
|
package/src/mocks/env.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Mock for env.ts to avoid import.meta issues in Jest
|
|
2
|
+
export const env = {
|
|
3
|
+
VITE_PORTAL_GRAPHQL_ENDPOINT: 'https://test.example.com',
|
|
4
|
+
VITE_DOLOS_URL: 'https://test.example.com',
|
|
5
|
+
VITE_DOLOS_TRANSFORMATION_ENDPOINT: 'https://test.example.com',
|
|
6
|
+
VITE_MUSE_TOKEN: 'test-token',
|
|
7
|
+
VITE_MUSE_ENDPOINT: 'https://test.example.com',
|
|
8
|
+
VITE_REVALIDATION_WAZOBIA_TOKEN: 'test-token',
|
|
9
|
+
VITE_REVALIDATION_DRIPLONDON_TOKEN: 'test-token',
|
|
10
|
+
VITE_REVALIDATION_TWISTEDFOOD_TOKEN: 'test-token',
|
|
11
|
+
VITE_REVALIDATION_VT_TOKEN: 'test-token',
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
const queryClient = new QueryClient();
|
|
5
|
+
|
|
6
|
+
function QueryProvider({ children }: { children: ReactNode }) {
|
|
7
|
+
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default QueryProvider;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import ThemeContext from '../../contexts/ThemeContext';
|
|
3
|
+
import { Theme, ThemeProviderProps } from '../../types/theme.types';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
|
|
6
|
+
function ThemeProvider({
|
|
7
|
+
children,
|
|
8
|
+
defaultTheme = 'system',
|
|
9
|
+
storageKey = 'vite-ui-theme',
|
|
10
|
+
...props
|
|
11
|
+
}: ThemeProviderProps) {
|
|
12
|
+
const [theme, setTheme] = useState<Theme>(() => {
|
|
13
|
+
if (typeof window !== 'undefined') {
|
|
14
|
+
// Access localStorage only in the browser
|
|
15
|
+
return (window.localStorage.getItem(storageKey) as Theme) || defaultTheme;
|
|
16
|
+
}
|
|
17
|
+
return defaultTheme; // Fallback for SSR
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const root = window.document.documentElement;
|
|
22
|
+
|
|
23
|
+
root.classList.remove('light', 'dark', 'brand');
|
|
24
|
+
|
|
25
|
+
if (theme === 'system') {
|
|
26
|
+
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
27
|
+
? 'dark'
|
|
28
|
+
: 'light';
|
|
29
|
+
|
|
30
|
+
root.classList.add(systemTheme);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
root.classList.add(theme);
|
|
35
|
+
}, [theme]);
|
|
36
|
+
|
|
37
|
+
const value = {
|
|
38
|
+
theme,
|
|
39
|
+
setTheme: (theme: Theme) => {
|
|
40
|
+
window.localStorage.setItem(storageKey, theme);
|
|
41
|
+
setTheme(theme);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<ThemeContext.Provider {...props} value={value}>
|
|
47
|
+
{children}
|
|
48
|
+
</ThemeContext.Provider>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default ThemeProvider;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Transformation } from '../components/wazui/WazUiGqlMediaLibrary/types';
|
|
2
|
+
|
|
3
|
+
export type ImageTransformation = Transformation & {
|
|
4
|
+
format?:
|
|
5
|
+
| 'JPEG'
|
|
6
|
+
| 'PNG'
|
|
7
|
+
| 'WEBP'
|
|
8
|
+
| 'AVIF'
|
|
9
|
+
| 'GIF'
|
|
10
|
+
| 'SVG'
|
|
11
|
+
| 'BMP'
|
|
12
|
+
| 'ICO'
|
|
13
|
+
| 'HEIC'
|
|
14
|
+
| 'HEIF'
|
|
15
|
+
| 'PDF';
|
|
16
|
+
quality?: number;
|
|
17
|
+
width?: number;
|
|
18
|
+
height?: number;
|
|
19
|
+
blur?: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export interface DeviceCoordinates {
|
|
23
|
+
left: number;
|
|
24
|
+
top: number;
|
|
25
|
+
right: number;
|
|
26
|
+
bottom: number;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ParsedConfig {
|
|
32
|
+
coordinates?: {
|
|
33
|
+
desktop?: DeviceCoordinates;
|
|
34
|
+
tablet?: DeviceCoordinates;
|
|
35
|
+
mobile?: DeviceCoordinates;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface ImageUrlResult {
|
|
39
|
+
url: string;
|
|
40
|
+
srcset: string;
|
|
41
|
+
desktop: string;
|
|
42
|
+
tablet: string;
|
|
43
|
+
mobile: string;
|
|
44
|
+
}
|