evelearn-theme 1.0.0
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/dist/index.d.mts +322 -0
- package/dist/index.d.ts +322 -0
- package/dist/index.js +1549 -0
- package/dist/index.mjs +1484 -0
- package/package.json +39 -0
- package/postcss.config.mjs +6 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1549 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/index.tsx
|
|
60
|
+
var index_exports = {};
|
|
61
|
+
__export(index_exports, {
|
|
62
|
+
AnimateLogo: () => AnimateLogo_default,
|
|
63
|
+
Backdrop: () => Backdrop_default,
|
|
64
|
+
BottomAlert: () => BottomAlert_default,
|
|
65
|
+
Breakpoint: () => Breakpoint_default,
|
|
66
|
+
Button: () => Button_default,
|
|
67
|
+
Checkbox: () => Checkbox_default,
|
|
68
|
+
CircleProgress: () => CircleProgress_default,
|
|
69
|
+
Container: () => Container_default,
|
|
70
|
+
ErrorText: () => ErrorText_default,
|
|
71
|
+
Fade: () => Fade_default,
|
|
72
|
+
FunButton: () => FunButton_default,
|
|
73
|
+
FunRoundButton: () => FunRoundButton_default,
|
|
74
|
+
IconInfo: () => IconInfo_default,
|
|
75
|
+
Modal: () => Modal_default,
|
|
76
|
+
NoResults: () => NoResults_default,
|
|
77
|
+
NoticeBox: () => NoticeBox_default,
|
|
78
|
+
Overlay: () => Overlay_default,
|
|
79
|
+
OverlaySpinner: () => OverlaySpinner_default,
|
|
80
|
+
PRIMARY_COLOR: () => PRIMARY_COLOR2,
|
|
81
|
+
Pill: () => Pill_default,
|
|
82
|
+
ProgressBar: () => ProgressBar_default,
|
|
83
|
+
ProgressBarSimple: () => ProgressBarSimple_default,
|
|
84
|
+
RadioOption: () => RadioOption_default,
|
|
85
|
+
RatingStars: () => RatingStars_default,
|
|
86
|
+
ScrollProgress: () => ScrollProgress_default,
|
|
87
|
+
Slider: () => Slider_default,
|
|
88
|
+
Spinner: () => Spinner_default,
|
|
89
|
+
StepsComponent: () => StepsComponent_default,
|
|
90
|
+
Tippy: () => Tippy_default,
|
|
91
|
+
ToggleSwitch: () => ToggleSwitch_default,
|
|
92
|
+
UserContentSwitcher: () => UserContentSwitcher_default,
|
|
93
|
+
balsamicSans: () => balsamicSans,
|
|
94
|
+
baseFieldStyle: () => baseFieldStyle,
|
|
95
|
+
createExerciseElementStyle: () => createExerciseElementStyle,
|
|
96
|
+
exerciseDeleteButton: () => exerciseDeleteButton,
|
|
97
|
+
exerciseEditButton: () => exerciseEditButton,
|
|
98
|
+
headerButtonClass: () => headerButtonClass,
|
|
99
|
+
headerTippyClass: () => headerTippyClass,
|
|
100
|
+
openSans: () => openSans,
|
|
101
|
+
parkinsans: () => parkinsans,
|
|
102
|
+
tippyClassname: () => tippyClassname,
|
|
103
|
+
toolbarExerciseButton: () => toolbarExerciseButton,
|
|
104
|
+
ubuntu: () => ubuntu,
|
|
105
|
+
xIconButton: () => xIconButton
|
|
106
|
+
});
|
|
107
|
+
module.exports = __toCommonJS(index_exports);
|
|
108
|
+
|
|
109
|
+
// src/Backdrop/Backdrop.tsx
|
|
110
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
111
|
+
var Backdrop = ({ visible, onClick, opacity }) => {
|
|
112
|
+
if (!visible) return null;
|
|
113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
style: {
|
|
117
|
+
opacity: opacity ? opacity : 90,
|
|
118
|
+
zIndex: 21
|
|
119
|
+
},
|
|
120
|
+
className: `fixed top-0 left-0 w-full h-screen bg-gray-100 dark:bg-slate-900`,
|
|
121
|
+
onClick
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
var Backdrop_default = Backdrop;
|
|
126
|
+
|
|
127
|
+
// src/Backdrop/Overlay.tsx
|
|
128
|
+
var import_react = require("react");
|
|
129
|
+
var import_react_dom = __toESM(require("react-dom"));
|
|
130
|
+
|
|
131
|
+
// src/fonts/index.tsx
|
|
132
|
+
var import_google = require("next/font/google");
|
|
133
|
+
var openSans = (0, import_google.Open_Sans)({
|
|
134
|
+
preload: true,
|
|
135
|
+
display: "swap",
|
|
136
|
+
subsets: ["cyrillic", "cyrillic-ext", "greek", "greek-ext", "latin", "latin-ext", "vietnamese", "hebrew"],
|
|
137
|
+
variable: "--font-sans"
|
|
138
|
+
});
|
|
139
|
+
var ubuntu = (0, import_google.Ubuntu)({
|
|
140
|
+
preload: true,
|
|
141
|
+
weight: ["300", "400", "500", "700"],
|
|
142
|
+
display: "auto",
|
|
143
|
+
subsets: ["cyrillic", "cyrillic-ext", "greek", "greek-ext", "latin", "latin-ext"],
|
|
144
|
+
variable: "--font-fallback"
|
|
145
|
+
});
|
|
146
|
+
var parkinsans = (0, import_google.Parkinsans)({
|
|
147
|
+
preload: true,
|
|
148
|
+
weight: ["300", "400", "500", "700"],
|
|
149
|
+
display: "swap",
|
|
150
|
+
adjustFontFallback: false,
|
|
151
|
+
subsets: ["latin", "latin-ext"],
|
|
152
|
+
// fallback: ['--font-fallback'],
|
|
153
|
+
variable: "--font-header"
|
|
154
|
+
});
|
|
155
|
+
var balsamicSans = (0, import_google.Balsamiq_Sans)({
|
|
156
|
+
preload: false,
|
|
157
|
+
display: "swap",
|
|
158
|
+
weight: ["400", "700"],
|
|
159
|
+
subsets: ["cyrillic", "cyrillic-ext", "latin", "latin-ext"],
|
|
160
|
+
variable: "--font-fun"
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// src/Backdrop/Overlay.tsx
|
|
164
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
165
|
+
var Overlay = ({ visible, onDismissed, onClick, zIndex, isDark, children, opacity, withContainer = true }) => {
|
|
166
|
+
const [modalRoot, setModalRoot] = (0, import_react.useState)(null);
|
|
167
|
+
(0, import_react.useEffect)(() => {
|
|
168
|
+
let root = document.getElementById("modal-root");
|
|
169
|
+
if (!root) {
|
|
170
|
+
root = document.createElement("div");
|
|
171
|
+
root.id = "modal-root";
|
|
172
|
+
document.body.appendChild(root);
|
|
173
|
+
}
|
|
174
|
+
setModalRoot(root);
|
|
175
|
+
return () => {
|
|
176
|
+
const root2 = document.getElementById("modal-root");
|
|
177
|
+
if (root2) {
|
|
178
|
+
document.body.removeChild(root2);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}, [visible]);
|
|
182
|
+
if (!visible || !modalRoot) return null;
|
|
183
|
+
return import_react_dom.default.createPortal(
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "animate-fade-in", children: withContainer ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
onClick: onDismissed || onClick,
|
|
188
|
+
className: `top-0 left-0 fixed w-full h-screen flex items-center justify-center ${parkinsans.variable} ${ubuntu.variable} ${openSans.variable}`,
|
|
189
|
+
style: {
|
|
190
|
+
background: isDark ? `rgba(0, 0, 0, ${opacity || "0.7"})` : `rgba(255, 255, 255, ${opacity || "0.6"})`,
|
|
191
|
+
zIndex: zIndex || 9999
|
|
192
|
+
},
|
|
193
|
+
children
|
|
194
|
+
}
|
|
195
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `${ubuntu.variable} ${parkinsans.variable} ${openSans.variable}`, children }) }),
|
|
196
|
+
modalRoot
|
|
197
|
+
);
|
|
198
|
+
};
|
|
199
|
+
var Overlay_default = Overlay;
|
|
200
|
+
|
|
201
|
+
// src/Breakpoint/Breakpoint.tsx
|
|
202
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
203
|
+
var Breakpoint = ({ children, fromSize, toSize }) => {
|
|
204
|
+
let className = "";
|
|
205
|
+
if (fromSize && toSize) {
|
|
206
|
+
className = `hidden ${fromSize}:block ${toSize}:hidden`;
|
|
207
|
+
} else if (fromSize) {
|
|
208
|
+
className = `hidden ${fromSize}:block`;
|
|
209
|
+
} else if (toSize) {
|
|
210
|
+
className = `block ${toSize}:hidden`;
|
|
211
|
+
}
|
|
212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className, children });
|
|
213
|
+
};
|
|
214
|
+
var Breakpoint_default = Breakpoint;
|
|
215
|
+
|
|
216
|
+
// src/Spinners/Spinner.tsx
|
|
217
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
218
|
+
var Spinner = ({ visible = true, size, white, isDark }) => {
|
|
219
|
+
if (visible === false) return null;
|
|
220
|
+
const isWhite = white || isDark;
|
|
221
|
+
const color = isWhite ? "stroke-white/90" : "stroke-slate-600/80";
|
|
222
|
+
const bgColor = isWhite ? "stroke-white/20" : "stroke-slate-500/20";
|
|
223
|
+
const dimensions = size === "small" ? "w-5 h-5" : "w-8 h-8";
|
|
224
|
+
const spinnerClasses = `
|
|
225
|
+
absolute
|
|
226
|
+
top-0
|
|
227
|
+
animate-spin
|
|
228
|
+
${dimensions}
|
|
229
|
+
`;
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative h-8 w-8 flex justify-center items-center", children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
232
|
+
"svg",
|
|
233
|
+
{
|
|
234
|
+
className: `absolute top-0 ${dimensions} ${bgColor}`,
|
|
235
|
+
viewBox: "0 0 24 24",
|
|
236
|
+
fill: "none",
|
|
237
|
+
strokeWidth: "2.4",
|
|
238
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "12", cy: "12", r: "10" })
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
242
|
+
"svg",
|
|
243
|
+
{
|
|
244
|
+
className: spinnerClasses,
|
|
245
|
+
viewBox: "0 0 24 24",
|
|
246
|
+
fill: "none",
|
|
247
|
+
strokeWidth: "2.4",
|
|
248
|
+
strokeLinecap: "round",
|
|
249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
250
|
+
"path",
|
|
251
|
+
{
|
|
252
|
+
d: `
|
|
253
|
+
M 12 2
|
|
254
|
+
A 10 10 0 0 1 22 12
|
|
255
|
+
A 10 10 0 0 1 12 22
|
|
256
|
+
A 10 10 0 0 1 2 12
|
|
257
|
+
A 10 10 0 0 1 12 2
|
|
258
|
+
`,
|
|
259
|
+
strokeDasharray: "13 18.4",
|
|
260
|
+
stroke: "inherit",
|
|
261
|
+
className: color
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
] });
|
|
267
|
+
};
|
|
268
|
+
var SpinnerCentered = (props) => {
|
|
269
|
+
if (props.visible === false) return null;
|
|
270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "w-full flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Spinner, __spreadValues({}, props)) });
|
|
271
|
+
};
|
|
272
|
+
Spinner.displayName = "Spinner";
|
|
273
|
+
SpinnerCentered.displayName = "Spinner.Centered";
|
|
274
|
+
Spinner.Centered = SpinnerCentered;
|
|
275
|
+
var Spinner_default = Spinner;
|
|
276
|
+
|
|
277
|
+
// src/Button/Button.tsx
|
|
278
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
279
|
+
var Button = ({ disabled = false, loading, onClick, kind = "primary", size = "small", type = "button", children }) => {
|
|
280
|
+
const styled = () => {
|
|
281
|
+
switch (kind) {
|
|
282
|
+
case "primary":
|
|
283
|
+
return `bg-primary font-header text-white font-medium transition-all duration-75 ${disabled ? "bg-opacity-50" : "hover:bg-opacity-90"}`;
|
|
284
|
+
case "indigo":
|
|
285
|
+
return `bg-indigo-500 font-header text-white font-medium transition-all duration-75 ${disabled ? "bg-opacity-50" : "hover:bg-opacity-90"}`;
|
|
286
|
+
case "green":
|
|
287
|
+
return `bg-green-500 font-header text-white font-medium transition-all duration-75 ${disabled ? "bg-opacity-50" : "hover:bg-opacity-90"}`;
|
|
288
|
+
case "teal":
|
|
289
|
+
return `bg-teal-500 font-header text-white font-medium transition-all duration-75 ${disabled ? "bg-opacity-50" : "hover:bg-opacity-90"}`;
|
|
290
|
+
case "secondary":
|
|
291
|
+
return "bg-secondary text-white font-header font-medium hover:bg-opacity-90 transition-all duration-75";
|
|
292
|
+
case "base":
|
|
293
|
+
return "bg-white border-1 font-header border-gray-200 dark:bg-slate-600 dark:text-gray-100 dark:hover:bg-slate-400 hover:bg-slate-100 transition-all duration-75";
|
|
294
|
+
case "gray":
|
|
295
|
+
return "bg-slate-400 dark:bg-slate-700 font-header text-white border-1 font-medium hover:bg-opacity-90 transition-opacity duration-75";
|
|
296
|
+
case "alert":
|
|
297
|
+
return "bg-amber-500 font-header text-white transition-all hover:bg-opacity-90 duration-75";
|
|
298
|
+
case "warning":
|
|
299
|
+
return "bg-red-500 font-header text-white font-medium hover:bg-opacity-90 transition-opacity duration-100";
|
|
300
|
+
default:
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
const sized = () => {
|
|
305
|
+
switch (size) {
|
|
306
|
+
case "small":
|
|
307
|
+
return "p-1";
|
|
308
|
+
case "fixed":
|
|
309
|
+
return "box-border w-32 h-11";
|
|
310
|
+
case "large":
|
|
311
|
+
return "px-2 h-11";
|
|
312
|
+
default:
|
|
313
|
+
return "px-2 py-1";
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: type || "button", disabled, className: `rounded-lg focus:outline-none transition duration-100 ${styled()} ${sized()}`, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "w-full max-h-11", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex w-full justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Spinner_default, { white: true }) }) : children }) });
|
|
317
|
+
};
|
|
318
|
+
var Button_default = Button;
|
|
319
|
+
|
|
320
|
+
// src/Button/FunButton.tsx
|
|
321
|
+
var import_react2 = require("react");
|
|
322
|
+
var import_colors = __toESM(require("tailwindcss/dist/colors"));
|
|
323
|
+
var import_framer_motion = require("framer-motion");
|
|
324
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
325
|
+
var FunButton = ({
|
|
326
|
+
onClick,
|
|
327
|
+
disabled,
|
|
328
|
+
type,
|
|
329
|
+
children,
|
|
330
|
+
color = "primary",
|
|
331
|
+
loading,
|
|
332
|
+
active,
|
|
333
|
+
className,
|
|
334
|
+
size = "base"
|
|
335
|
+
}) => {
|
|
336
|
+
const { front, bottom } = (0, import_react2.useMemo)(() => {
|
|
337
|
+
switch (color) {
|
|
338
|
+
case "primary":
|
|
339
|
+
return { bottom: "#00b4d8", front: import_colors.default.sky["600"] };
|
|
340
|
+
case "red":
|
|
341
|
+
return { bottom: "#f00f0f", front: import_colors.default.red["700"] };
|
|
342
|
+
case "green":
|
|
343
|
+
return { bottom: import_colors.default.green["500"], front: import_colors.default.green["600"] };
|
|
344
|
+
case "purple":
|
|
345
|
+
return { bottom: import_colors.default.indigo["500"], front: import_colors.default.indigo["600"] };
|
|
346
|
+
case "teal":
|
|
347
|
+
return { bottom: import_colors.default.teal["500"], front: import_colors.default.teal["600"] };
|
|
348
|
+
case "cyan":
|
|
349
|
+
return { bottom: import_colors.default.cyan["500"], front: import_colors.default.cyan["600"] };
|
|
350
|
+
case "yellow":
|
|
351
|
+
return { bottom: import_colors.default.yellow["500"], front: import_colors.default.yellow["600"] };
|
|
352
|
+
default:
|
|
353
|
+
return { bottom: "#00b4d8", front: import_colors.default.sky["700"] };
|
|
354
|
+
}
|
|
355
|
+
}, [color]);
|
|
356
|
+
const classStyle = (0, import_react2.useMemo)(() => {
|
|
357
|
+
switch (size) {
|
|
358
|
+
case "base":
|
|
359
|
+
return "relative block px-8 py-3 rounded-lg text-lg text-white font-medium font-header hover:bg-opacity-90";
|
|
360
|
+
case "big":
|
|
361
|
+
return "relative block px-12 py-4 rounded-lg text-lg text-white font-medium font-header hover:bg-opacity-90";
|
|
362
|
+
case "small":
|
|
363
|
+
return "relative block px-6 py-1 rounded-lg text-lg text-white font-medium font-header hover:bg-opacity-90";
|
|
364
|
+
case "square":
|
|
365
|
+
return "relative block h-12 w-12 rounded text-lg flex items-center justify-center text-white font-medium font-header hover:bg-opacity-90";
|
|
366
|
+
default:
|
|
367
|
+
return "relative block px-8 py-3 rounded-lg text-lg text-white font-medium font-header hover:bg-opacity-90";
|
|
368
|
+
}
|
|
369
|
+
}, [size]);
|
|
370
|
+
const computedClassName = (0, import_react2.useMemo)(() => {
|
|
371
|
+
const cName = className + " rounded-lg border-none p-0 cursor-pointer opacity-90 hover:bg-opacity-90 transition-opacity";
|
|
372
|
+
return cName + (disabled ? " opacity-70 cursor-default" : "");
|
|
373
|
+
}, [className, disabled]);
|
|
374
|
+
const computedClassStyle = (0, import_react2.useMemo)(() => {
|
|
375
|
+
const cName = classStyle;
|
|
376
|
+
return cName + (disabled ? " opacity-70 cursor-default hover:bg-opacity-70" : "");
|
|
377
|
+
}, [classStyle, disabled]);
|
|
378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
379
|
+
import_framer_motion.motion.button,
|
|
380
|
+
{
|
|
381
|
+
className: `${computedClassName}`,
|
|
382
|
+
style: { background: front, outlineOffset: "4px" },
|
|
383
|
+
type,
|
|
384
|
+
onMouseDown: onClick,
|
|
385
|
+
whileTap: { y: disabled ? 0 : 2 },
|
|
386
|
+
transition: { duration: 0.1, ease: "easeInOut" },
|
|
387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
388
|
+
import_framer_motion.motion.span,
|
|
389
|
+
{
|
|
390
|
+
className: computedClassStyle,
|
|
391
|
+
style: {
|
|
392
|
+
background: bottom,
|
|
393
|
+
opacity: 1
|
|
394
|
+
},
|
|
395
|
+
initial: { y: active ? 0 : -6 },
|
|
396
|
+
animate: { y: active ? 0 : -6 },
|
|
397
|
+
whileTap: { y: disabled ? -6 : 0 },
|
|
398
|
+
transition: { duration: 0.1, ease: "easeInOut" },
|
|
399
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: size === "small" ? "min-h-6" : "min-h-10", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Spinner_default.Centered, { visible: true, size: size === "small" ? "small" : "base", white: true }) }) : children
|
|
400
|
+
}
|
|
401
|
+
)
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
};
|
|
405
|
+
var FunButton_default = FunButton;
|
|
406
|
+
|
|
407
|
+
// src/Button/FunRoundButton.tsx
|
|
408
|
+
var import_react3 = require("react");
|
|
409
|
+
var import_colors2 = __toESM(require("tailwindcss/dist/colors"));
|
|
410
|
+
var import_framer_motion2 = require("framer-motion");
|
|
411
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
412
|
+
var FunRoundButton = ({ onClick, disabled, type, children, color, active, className, size = 44 }) => {
|
|
413
|
+
const { front, bottom } = (0, import_react3.useMemo)(() => {
|
|
414
|
+
switch (color) {
|
|
415
|
+
case "primary":
|
|
416
|
+
return { bottom: "#00b4d8", front: import_colors2.default.sky["600"] };
|
|
417
|
+
case "red":
|
|
418
|
+
return { bottom: disabled ? "hsl(340deg 100% 42%)" : "hsl(345deg 100% 47%)", front: disabled ? "hsl(340deg 100% 52%)" : "hsl(340deg 100% 32%)" };
|
|
419
|
+
case "green":
|
|
420
|
+
return { bottom: disabled ? import_colors2.default.green["300"] : import_colors2.default.green["500"], front: disabled ? import_colors2.default.green["400"] : import_colors2.default.green["600"] };
|
|
421
|
+
case "purple":
|
|
422
|
+
return { bottom: disabled ? import_colors2.default.indigo["300"] : import_colors2.default.indigo["500"], front: disabled ? import_colors2.default.indigo["400"] : import_colors2.default.indigo["600"] };
|
|
423
|
+
case "teal":
|
|
424
|
+
return { bottom: disabled ? import_colors2.default.teal["300"] : import_colors2.default.teal["500"], front: disabled ? import_colors2.default.teal["400"] : import_colors2.default.teal["600"] };
|
|
425
|
+
case "yellow":
|
|
426
|
+
return { bottom: disabled ? import_colors2.default.yellow["300"] : import_colors2.default.yellow["500"], front: disabled ? import_colors2.default.yellow["400"] : import_colors2.default.yellow["600"] };
|
|
427
|
+
default:
|
|
428
|
+
return { bottom: disabled ? import_colors2.default.gray["300"] : "#00b4d8", front: disabled ? import_colors2.default.sky["400"] : import_colors2.default.sky["700"] };
|
|
429
|
+
}
|
|
430
|
+
}, [color, disabled]);
|
|
431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
432
|
+
import_framer_motion2.motion.button,
|
|
433
|
+
{
|
|
434
|
+
className: `${className || "border-none p-0 flex justify-center items-center cursor-pointer z-10"} ${disabled ? "opacity-70 cursor-default" : "hover:opacity-95"}`,
|
|
435
|
+
style: {
|
|
436
|
+
background: front,
|
|
437
|
+
height: size,
|
|
438
|
+
width: size + 2,
|
|
439
|
+
borderRadius: (size + 2) / 2,
|
|
440
|
+
outlineOffset: 0
|
|
441
|
+
},
|
|
442
|
+
type,
|
|
443
|
+
disabled,
|
|
444
|
+
onClick,
|
|
445
|
+
whileHover: { opacity: 0.95 },
|
|
446
|
+
whileTap: { y: disabled ? 0 : 2 },
|
|
447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
448
|
+
import_framer_motion2.motion.span,
|
|
449
|
+
{
|
|
450
|
+
className: "flex justify-center items-center z-10",
|
|
451
|
+
style: {
|
|
452
|
+
background: bottom,
|
|
453
|
+
height: size,
|
|
454
|
+
width: size + 2,
|
|
455
|
+
borderRadius: (size + 2) / 2
|
|
456
|
+
},
|
|
457
|
+
initial: { y: active ? 0 : -6 },
|
|
458
|
+
animate: { y: active ? 0 : -6 },
|
|
459
|
+
transition: { duration: 0.1, ease: "easeInOut" },
|
|
460
|
+
whileHover: { opacity: 0.95 },
|
|
461
|
+
whileTap: { y: disabled ? active ? 0 : -6 : 0 },
|
|
462
|
+
children
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
};
|
|
468
|
+
var FunRoundButton_default = FunRoundButton;
|
|
469
|
+
|
|
470
|
+
// src/Checkbox/Checkbox.tsx
|
|
471
|
+
var import_react4 = require("react");
|
|
472
|
+
var import_formik = require("formik");
|
|
473
|
+
|
|
474
|
+
// src/Common/ErrorText.tsx
|
|
475
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
476
|
+
var ErrorText = ({ text, style, classNames }) => {
|
|
477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: classNames ? classNames : "text-red-500 font-semibold text-wrap py-auto", style, children: text });
|
|
478
|
+
};
|
|
479
|
+
var ErrorText_default = ErrorText;
|
|
480
|
+
|
|
481
|
+
// src/Checkbox/Checkbox.tsx
|
|
482
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
483
|
+
var Checkbox = ({ name, labelText, isLarge, onChange, isDisabled }) => {
|
|
484
|
+
const [{ value }, { error }, { setValue, setTouched }] = (0, import_formik.useField)(name);
|
|
485
|
+
const onCheck = (e) => {
|
|
486
|
+
setTouched(true);
|
|
487
|
+
setValue(!value, true);
|
|
488
|
+
};
|
|
489
|
+
const rand = (0, import_react4.useMemo)(() => {
|
|
490
|
+
return Math.random();
|
|
491
|
+
}, []);
|
|
492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative flex flex-col justify-center items-center", children: [
|
|
493
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center", children: [
|
|
494
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
495
|
+
"input",
|
|
496
|
+
{
|
|
497
|
+
disabled: !!isDisabled,
|
|
498
|
+
onChange: (e) => {
|
|
499
|
+
onCheck(e);
|
|
500
|
+
onChange == null ? void 0 : onChange(Boolean(e.target.value));
|
|
501
|
+
},
|
|
502
|
+
value: value ? "true" : "false",
|
|
503
|
+
id: `${name}${rand}`,
|
|
504
|
+
name,
|
|
505
|
+
type: "checkbox",
|
|
506
|
+
checked: !!value,
|
|
507
|
+
className: `form-checkbox text-blue-600 focus:ring-blue-500 border-gray-300 rounded ${isLarge ? "h-5 w-5" : "h-4 w-4"}`
|
|
508
|
+
}
|
|
509
|
+
),
|
|
510
|
+
typeof labelText === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: `${name}${rand}`, className: "ml-2 block text-sm text-gray-800 dark:text-gray-200", children: labelText }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: `${name}${rand}`, children: labelText })
|
|
511
|
+
] }),
|
|
512
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ErrorText_default, { classNames: "absolute w-64 left-6 top-4 text-xs text-red-500", text: error })
|
|
513
|
+
] });
|
|
514
|
+
};
|
|
515
|
+
var MultiChoiceCheckBox = ({ name, hasMultipleAnswers, index, isLarge, allOptionsName }) => {
|
|
516
|
+
const [{ value }, {}, { setValue, setTouched }] = (0, import_formik.useField)(name);
|
|
517
|
+
const [{ value: optionsValue }, , { setValue: setOptionsValue }] = (0, import_formik.useField)(allOptionsName);
|
|
518
|
+
const onCheck = (e) => {
|
|
519
|
+
setTouched(true);
|
|
520
|
+
if (hasMultipleAnswers) {
|
|
521
|
+
setValue(!value);
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
setOptionsValue(optionsValue == null ? void 0 : optionsValue.map((el, idx) => ({ option: el.option, id: el.id, isCorrectAnswer: index === idx ? !el.isCorrectAnswer : false })));
|
|
525
|
+
};
|
|
526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-col justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
527
|
+
"input",
|
|
528
|
+
{
|
|
529
|
+
onChange: (e) => onCheck(e),
|
|
530
|
+
value: index,
|
|
531
|
+
checked: !!value,
|
|
532
|
+
id: name,
|
|
533
|
+
name,
|
|
534
|
+
type: "checkbox",
|
|
535
|
+
className: `form-checkbox text-blue-600 focus:ring-blue-500 border-gray-300 rounded ${isLarge ? "h-5 w-5" : "h-4 w-4"}`
|
|
536
|
+
}
|
|
537
|
+
) }) });
|
|
538
|
+
};
|
|
539
|
+
Checkbox.Multi = MultiChoiceCheckBox;
|
|
540
|
+
var Checkbox_default = Checkbox;
|
|
541
|
+
|
|
542
|
+
// src/Checkbox/RadioOption.tsx
|
|
543
|
+
var import_formik2 = require("formik");
|
|
544
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
545
|
+
var RadioOption = ({ name, isLarge, labelText, option, onSelect }) => {
|
|
546
|
+
const [{ value }, {}, { setValue }] = (0, import_formik2.useField)(name);
|
|
547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center", children: [
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
549
|
+
"input",
|
|
550
|
+
{
|
|
551
|
+
onChange: () => {
|
|
552
|
+
setValue(option);
|
|
553
|
+
onSelect == null ? void 0 : onSelect();
|
|
554
|
+
},
|
|
555
|
+
value: option,
|
|
556
|
+
id: option,
|
|
557
|
+
name,
|
|
558
|
+
type: "checkbox",
|
|
559
|
+
checked: value === option,
|
|
560
|
+
className: `form-checkbox text-blue-600 focus:ring-blue-500 border-gray-300 rounded ${isLarge ? "h-5 w-5" : "h-4 w-4"}`
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
typeof labelText === "string" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: option, className: "ml-2 block text-sm text-gray-900", children: labelText }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: option, children: labelText })
|
|
564
|
+
] });
|
|
565
|
+
};
|
|
566
|
+
var RadioOption_default = RadioOption;
|
|
567
|
+
|
|
568
|
+
// src/Common/BottomAlert.tsx
|
|
569
|
+
var import_colors3 = __toESM(require("tailwindcss/dist/colors"));
|
|
570
|
+
var import_react_dom2 = __toESM(require("react-dom"));
|
|
571
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
572
|
+
var BottomAlert = ({ isDark, setDontShowAgain, dontShowAgain, title, borderColor, onDismissed, cancelText, confirmText, onConfirm, onCancel, isSingleAction, children, buttonColor }) => {
|
|
573
|
+
const dismiss = () => {
|
|
574
|
+
onDismissed == null ? void 0 : onDismissed();
|
|
575
|
+
};
|
|
576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
577
|
+
"div",
|
|
578
|
+
{
|
|
579
|
+
className: "top-0 left-0 fixed w-full h-screen flex justify-center",
|
|
580
|
+
style: {
|
|
581
|
+
background: isDark ? "rgba(0, 0, 0, 0.1)" : "rgba(255, 255, 255, 0.1)",
|
|
582
|
+
zIndex: 9999
|
|
583
|
+
},
|
|
584
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute top-0 w-full h-screen flex justify-center bg-gray-200 dark:bg-slate-800 dark:bg-opacity-50 bg-opacity-80", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute sm:w-1/2 w-full mx-auto shadow-xl rounded-md p-6 flex z-50 flex-col top-24 bg-white dark:bg-slate-900 overflow-clip rounded-bl-lg rounded-br-lg border-b-8 border-b-blue-500", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { borderColor: borderColor || import_colors3.default.sky["500"] }, children: [
|
|
585
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: "font-semibold font-header text-gray-700 dark:text-gray-300 text-xl", children: title }),
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "mt-2 text-lg", children }),
|
|
587
|
+
setDontShowAgain ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
588
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
589
|
+
"input",
|
|
590
|
+
{
|
|
591
|
+
onChange: () => {
|
|
592
|
+
setDontShowAgain((s) => !s);
|
|
593
|
+
},
|
|
594
|
+
id: `show_again_check`,
|
|
595
|
+
checked: !!dontShowAgain,
|
|
596
|
+
type: "checkbox",
|
|
597
|
+
className: `form-checkbox text-blue-600 focus:ring-blue-500 border-gray-300 rounded h-4 w-4`
|
|
598
|
+
}
|
|
599
|
+
),
|
|
600
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: "show_again_check", className: "dark:text-gray-200 text-gray-700", children: "Don't show again" })
|
|
601
|
+
] }) : null,
|
|
602
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "mt-4 flex items-center justify-end space-x-4 z-10", children: isSingleAction ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
603
|
+
Button_default,
|
|
604
|
+
{
|
|
605
|
+
type: "button",
|
|
606
|
+
kind: buttonColor,
|
|
607
|
+
onClick: () => {
|
|
608
|
+
onConfirm(true);
|
|
609
|
+
dismiss();
|
|
610
|
+
},
|
|
611
|
+
children: confirmText || "Okay"
|
|
612
|
+
}
|
|
613
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w-1/3 flex justify-end space-x-4", children: [
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-full flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
615
|
+
Button_default,
|
|
616
|
+
{
|
|
617
|
+
type: "button",
|
|
618
|
+
kind: "secondary",
|
|
619
|
+
onClick: () => {
|
|
620
|
+
onCancel == null ? void 0 : onCancel();
|
|
621
|
+
dismiss();
|
|
622
|
+
},
|
|
623
|
+
children: cancelText || "Cancel"
|
|
624
|
+
}
|
|
625
|
+
) }),
|
|
626
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-full flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
627
|
+
Button_default,
|
|
628
|
+
{
|
|
629
|
+
type: "button",
|
|
630
|
+
kind: buttonColor,
|
|
631
|
+
onClick: () => {
|
|
632
|
+
onConfirm(true);
|
|
633
|
+
dismiss();
|
|
634
|
+
},
|
|
635
|
+
children: confirmText || "Confirm"
|
|
636
|
+
}
|
|
637
|
+
) })
|
|
638
|
+
] }) })
|
|
639
|
+
] }) }) })
|
|
640
|
+
}
|
|
641
|
+
);
|
|
642
|
+
};
|
|
643
|
+
var BAWrapper = (props) => {
|
|
644
|
+
if (!props.isVisible) return null;
|
|
645
|
+
return import_react_dom2.default.createPortal(
|
|
646
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BottomAlert, __spreadValues({}, props)),
|
|
647
|
+
document.body
|
|
648
|
+
);
|
|
649
|
+
};
|
|
650
|
+
var BottomAlert_default = BAWrapper;
|
|
651
|
+
|
|
652
|
+
// src/Common/Container.tsx
|
|
653
|
+
var import_react5 = require("react");
|
|
654
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
655
|
+
var Container = ({ backgroundColor, backgroundImage, style, children, onClick }) => {
|
|
656
|
+
(0, import_react5.useEffect)(() => {
|
|
657
|
+
if (backgroundColor) {
|
|
658
|
+
document.body.style.background = backgroundColor;
|
|
659
|
+
} else {
|
|
660
|
+
document.body.style.background = "";
|
|
661
|
+
}
|
|
662
|
+
return () => {
|
|
663
|
+
document.body.style.background = "";
|
|
664
|
+
};
|
|
665
|
+
}, [backgroundColor]);
|
|
666
|
+
return backgroundImage ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
667
|
+
"div",
|
|
668
|
+
{
|
|
669
|
+
style: __spreadValues({
|
|
670
|
+
backgroundImage,
|
|
671
|
+
backgroundSize: "cover"
|
|
672
|
+
}, style),
|
|
673
|
+
className: "w-full md:min-h-screen dark:bg-slate-950 mx-auto overflow-y-auto overflow-x-clip px-0 md:px-2 sm:py-4 py-1 relative",
|
|
674
|
+
onClick,
|
|
675
|
+
children: children ? children : null
|
|
676
|
+
}
|
|
677
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
678
|
+
"div",
|
|
679
|
+
{
|
|
680
|
+
className: `w-full dark:bg-slate-950 mx-auto overflow-y-auto overflow-x-clip px-0 sm:px-16 relative pt-20`,
|
|
681
|
+
onClick,
|
|
682
|
+
style: style || { minHeight: "100vh" },
|
|
683
|
+
children: children ? children : null
|
|
684
|
+
}
|
|
685
|
+
);
|
|
686
|
+
};
|
|
687
|
+
var Container_default = Container;
|
|
688
|
+
|
|
689
|
+
// src/Common/fieldStyle.ts
|
|
690
|
+
var baseFieldStyle = "font-sans form-input h-11 w-full bg-white border-gray-200 dark:border-gray-500 dark:bg-slate-800 dark:text-gray-200 text-gray-700 dark:placeholder-gray-400 placeholder-gray-400 rounded-md px-2 py-1 focus:outline-none focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50";
|
|
691
|
+
var createExerciseElementStyle = "flex flex-col justify-between space-y-2 w-full p-4 bg-white dark:bg-slate-800 rounded-xl text-gray-800 dark:text-gray-200 border-2 border-slate-200 dark:border-slate-400 overflow-hidden transition-all";
|
|
692
|
+
var exerciseDeleteButton = "w-6 h-6 flex justify-center text-gray-700 dark:text-gray-200 hover:text-red-600 dark:hover:text-red-500 transition-all duration-150 hover:scale-125";
|
|
693
|
+
var xIconButton = "w-6 h-6 flex justify-center text-gray-700 dark:text-gray-200 hover:text-gray-950 dark:hover:text-gray-100 transition-all duration-150 hover:scale-125";
|
|
694
|
+
var exerciseEditButton = "w-6 h-6 flex justify-center text-gray-700 dark:text-gray-200 hover:text-red-600 dark:hover:text-green-500 transition-all duration-150 hover:scale-125";
|
|
695
|
+
var tippyClassname = "p-2 bg-slate-600 dark:bg-slate-900 opacity-90 text-white font-medium font-header rounded-lg";
|
|
696
|
+
var headerTippyClass = "rounded-lg p-2 bg-slate-950 opacity-95 text-white font-medium";
|
|
697
|
+
var headerButtonClass = "w-10 h-10 rounded-full dark:hover:bg-slate-600 hover:bg-slate-200 bg-transparent flex justify-center items-center flex justify-center items-center text-slate-600 dark:text-slate-100 hover:text-primary dark:hover:text-primary transition-colors duration-50";
|
|
698
|
+
var toolbarExerciseButton = "flex bg-gray-50 bg-opacity-95 items-center sm:justify-between p-4 shadow-sm w-full rounded-xl border-4 border-transparent hover:border-white text-gray-700 hover:text-white hover:bg-indigo-500 transition-colors duration-75";
|
|
699
|
+
|
|
700
|
+
// src/Common/Tippy.tsx
|
|
701
|
+
var import_react6 = require("react");
|
|
702
|
+
var import_react7 = require("@floating-ui/react");
|
|
703
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
704
|
+
var Tippy = ({ children, content, placement = "top", className = "", wrapperClassname = "", disabled = false, arrow: useArrow = false, visible }) => {
|
|
705
|
+
const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
|
|
706
|
+
const arrowRef = (0, import_react6.useRef)(null);
|
|
707
|
+
(0, import_react6.useEffect)(() => {
|
|
708
|
+
if (visible) {
|
|
709
|
+
setIsOpen(true);
|
|
710
|
+
}
|
|
711
|
+
}, [visible]);
|
|
712
|
+
const {
|
|
713
|
+
x,
|
|
714
|
+
y,
|
|
715
|
+
strategy,
|
|
716
|
+
refs,
|
|
717
|
+
context
|
|
718
|
+
} = (0, import_react7.useFloating)({
|
|
719
|
+
placement,
|
|
720
|
+
open: isOpen,
|
|
721
|
+
onOpenChange: setIsOpen,
|
|
722
|
+
middleware: [
|
|
723
|
+
(0, import_react7.offset)(8),
|
|
724
|
+
(0, import_react7.flip)(),
|
|
725
|
+
(0, import_react7.shift)(),
|
|
726
|
+
(0, import_react7.arrow)({ element: arrowRef })
|
|
727
|
+
]
|
|
728
|
+
});
|
|
729
|
+
const hover = (0, import_react7.useHover)(context, {
|
|
730
|
+
enabled: !disabled
|
|
731
|
+
});
|
|
732
|
+
const dismiss = (0, import_react7.useDismiss)(context);
|
|
733
|
+
const role = (0, import_react7.useRole)(context);
|
|
734
|
+
const { getReferenceProps, getFloatingProps } = (0, import_react7.useInteractions)([
|
|
735
|
+
hover,
|
|
736
|
+
dismiss,
|
|
737
|
+
role
|
|
738
|
+
]);
|
|
739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
740
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react7.FloatingPortal, { children: [
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
742
|
+
"div",
|
|
743
|
+
__spreadProps(__spreadValues({
|
|
744
|
+
ref: refs.setFloating,
|
|
745
|
+
className: `z-[9999] ${className || tippyClassname}`
|
|
746
|
+
}, getFloatingProps()), {
|
|
747
|
+
style: {
|
|
748
|
+
position: strategy,
|
|
749
|
+
top: y != null ? y : 0,
|
|
750
|
+
left: x != null ? x : 0,
|
|
751
|
+
width: "max-content"
|
|
752
|
+
},
|
|
753
|
+
children: content
|
|
754
|
+
})
|
|
755
|
+
),
|
|
756
|
+
useArrow && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
757
|
+
import_react7.FloatingArrow,
|
|
758
|
+
{
|
|
759
|
+
ref: arrowRef,
|
|
760
|
+
context,
|
|
761
|
+
className: "fill-gray-900",
|
|
762
|
+
tipRadius: 2
|
|
763
|
+
}
|
|
764
|
+
)
|
|
765
|
+
] }),
|
|
766
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", __spreadProps(__spreadValues({ ref: refs.setReference }, getReferenceProps()), { className: wrapperClassname, children }))
|
|
767
|
+
] });
|
|
768
|
+
};
|
|
769
|
+
var Tippy_default = Tippy;
|
|
770
|
+
|
|
771
|
+
// src/Common/IconInfo.tsx
|
|
772
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
773
|
+
var IconInfo = ({ content, icon, number, color }) => {
|
|
774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-shrink-0 items-center justify-center w-8 h-8 rounded-full bg-slate-400 dark:bg-slate-600 dark:border dark:border-white", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
775
|
+
Tippy_default,
|
|
776
|
+
{
|
|
777
|
+
className: tippyClassname,
|
|
778
|
+
content,
|
|
779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "relative", children: [
|
|
780
|
+
icon,
|
|
781
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: `absolute -bottom-1 ${number > 9 ? number > 99 ? number > 999 ? "w-8 h-8 -right-6 -bottom-3" : "w-6 h-6 -right-5 -bottom-2" : "w-5 h-5 -right-3" : "w-4 -right-3"} flex justify-center items-center text-xs font-sans rounded-full text-white ${color || "bg-secondary"}`, children: number })
|
|
782
|
+
] })
|
|
783
|
+
}
|
|
784
|
+
) });
|
|
785
|
+
};
|
|
786
|
+
var IconInfo_default = IconInfo;
|
|
787
|
+
|
|
788
|
+
// src/Common/Modal.tsx
|
|
789
|
+
var import_link = __toESM(require("next/link"));
|
|
790
|
+
|
|
791
|
+
// src/Icons/XIcon.tsx
|
|
792
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
793
|
+
var XIcon = ({ className }) => {
|
|
794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: className || "h-5 w-5", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) });
|
|
795
|
+
};
|
|
796
|
+
var XIcon_default = XIcon;
|
|
797
|
+
|
|
798
|
+
// src/Common/Modal.tsx
|
|
799
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
800
|
+
var Modal = (_a) => {
|
|
801
|
+
var _b = _a, { visible, children, fullscreen, displayDark, dismissLink, bgOpacity, onDismissed, dismissable = true, dismissOnBackdropClick = true, style } = _b, props = __objRest(_b, ["visible", "children", "fullscreen", "displayDark", "dismissLink", "bgOpacity", "onDismissed", "dismissable", "dismissOnBackdropClick", "style"]);
|
|
802
|
+
if (!visible) return null;
|
|
803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Overlay_default, __spreadProps(__spreadValues({ visible, onClick: dismissOnBackdropClick ? onDismissed : void 0, isDark: displayDark, withContainer: true }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
804
|
+
"div",
|
|
805
|
+
{
|
|
806
|
+
className: `${displayDark && "dark"} bg-slate-900/20 fixed inset-0 flex items-center justify-center`,
|
|
807
|
+
style: { zIndex: 1e4 },
|
|
808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: ["relative mx-1 w-full md:mx-auto md:w-3/4 lg:w-1/2", fullscreen && `md:w-5/6 lg:w-5/6`].join(" "), children: [
|
|
809
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: dismissLink ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
810
|
+
import_link.default,
|
|
811
|
+
{
|
|
812
|
+
href: dismissLink,
|
|
813
|
+
scroll: false,
|
|
814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { onClick: onDismissed, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(XIcon_default, { className: "absolute h-5 w-5 top-5 sm:top-20 right-4 transition-colors cursor-pointer duration-75 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500" }) })
|
|
815
|
+
}
|
|
816
|
+
) : dismissable ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
817
|
+
"button",
|
|
818
|
+
{
|
|
819
|
+
className: "absolute top-5 sm:top-20 right-4 transition-colors cursor-pointer duration-75 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500",
|
|
820
|
+
type: "button",
|
|
821
|
+
onClick: onDismissed,
|
|
822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
823
|
+
XIcon_default,
|
|
824
|
+
{
|
|
825
|
+
className: "h-5 w-5"
|
|
826
|
+
}
|
|
827
|
+
)
|
|
828
|
+
}
|
|
829
|
+
) : null }),
|
|
830
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
831
|
+
"div",
|
|
832
|
+
{
|
|
833
|
+
className: "my-1 sm:mt-16 bg-white dark:bg-slate-900 shadow-lg border border-gray-100 dark:border-none rounded-xl overflow-x-visible overflow-y-visible no-scrollbar",
|
|
834
|
+
onClick: (e) => e.stopPropagation(),
|
|
835
|
+
style: __spreadValues({ maxHeight: "calc(100vh - 6rem)" }, style),
|
|
836
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "p-4 sm:p-10", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mt-8 sm:mt-0", children }) })
|
|
837
|
+
}
|
|
838
|
+
)
|
|
839
|
+
] })
|
|
840
|
+
}
|
|
841
|
+
) }));
|
|
842
|
+
};
|
|
843
|
+
var Modal_default = Modal;
|
|
844
|
+
|
|
845
|
+
// src/Common/NoResults.tsx
|
|
846
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
847
|
+
var HEIGHT = 160;
|
|
848
|
+
var WIDTH = HEIGHT * (16 / 9);
|
|
849
|
+
var NoResults = ({ loading, message }) => {
|
|
850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative w-full flex justify-center items-center", children: [
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-start w-full space-x-2 py-3 p-4 bg-slate-100 dark:bg-slate-800 rounded-md", children: [
|
|
852
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { width: `calc(${WIDTH}px + 1rem)`, height: 320 }, className: "rounded-lg overflow-hidden cursor-pointer hover:shadow-md transition-shadow duration-150 px-2 pt-2 bg-slate-200 dark:bg-slate-700 animate-pulse" }),
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { width: `calc(${WIDTH}px + 1rem)`, height: 320 }, className: "rounded-lg overflow-hidden cursor-pointer hover:shadow-md transition-shadow duration-150 px-2 pt-2 bg-slate-200 dark:bg-slate-700 animate-pulse" })
|
|
854
|
+
] }),
|
|
855
|
+
!loading && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute w-full h-full flex justify-center items-center m-auto", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "p-4 rounded-lg bg-white dark:bg-slate-700 shadow-xl", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "font-semibold text-lg text-gray-700 dark:text-gray-300", children: message || "No results" }) }) })
|
|
856
|
+
] });
|
|
857
|
+
};
|
|
858
|
+
var NoResults_default = NoResults;
|
|
859
|
+
|
|
860
|
+
// src/Common/NoticeBox.tsx
|
|
861
|
+
var import_react8 = require("react");
|
|
862
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
863
|
+
var NoticeBox = ({ children, type, isDismissible, isVisible, onDismiss }) => {
|
|
864
|
+
const [visible, setVisible] = (0, import_react8.useState)(true);
|
|
865
|
+
const styles = (0, import_react8.useMemo)(() => {
|
|
866
|
+
const base = "relative text-base rounded-md p-2 ";
|
|
867
|
+
if (!visible) return "hidden";
|
|
868
|
+
switch (type) {
|
|
869
|
+
case "error":
|
|
870
|
+
return base.concat("w-full absolute top-50 text-red-500 border-red-400 border-2");
|
|
871
|
+
case "info":
|
|
872
|
+
return base.concat("text-green-800 border-green-400 bg-green-100");
|
|
873
|
+
case "warning":
|
|
874
|
+
return base.concat("text-orange-500 border border-orange-400 bg-white");
|
|
875
|
+
default:
|
|
876
|
+
return base.concat("w-full absolute top-0 text-red-500 border-red-500 bg-white p-3 border-2");
|
|
877
|
+
}
|
|
878
|
+
}, [type, visible]);
|
|
879
|
+
(0, import_react8.useEffect)(() => {
|
|
880
|
+
setVisible(isVisible);
|
|
881
|
+
}, [isVisible]);
|
|
882
|
+
if (!isVisible) return null;
|
|
883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
884
|
+
"div",
|
|
885
|
+
{
|
|
886
|
+
style: {
|
|
887
|
+
zIndex: 100
|
|
888
|
+
},
|
|
889
|
+
className: styles,
|
|
890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative", children: [
|
|
891
|
+
isDismissible && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
892
|
+
"button",
|
|
893
|
+
{
|
|
894
|
+
type: "button",
|
|
895
|
+
onClick: () => {
|
|
896
|
+
setVisible((s) => !s);
|
|
897
|
+
onDismiss == null ? void 0 : onDismiss();
|
|
898
|
+
},
|
|
899
|
+
className: "absolute bottom-1 right-1 transition-colors cursor-pointer duration-75 hover:text-blue-500",
|
|
900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(XIcon_default, { className: "h-5 w-5" })
|
|
901
|
+
}
|
|
902
|
+
),
|
|
903
|
+
children
|
|
904
|
+
] })
|
|
905
|
+
}
|
|
906
|
+
);
|
|
907
|
+
};
|
|
908
|
+
var NoticeBox_default = NoticeBox;
|
|
909
|
+
|
|
910
|
+
// src/Common/Pill.tsx
|
|
911
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
912
|
+
var Pill = ({ text }) => {
|
|
913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "rounded-full px-3 py-1 text-sm font-header font-medium bg-white dark:bg-slate-900 text-gray-700 dark:text-gray-300 mr-2 mb-2", children: text });
|
|
914
|
+
};
|
|
915
|
+
var Pill_default = Pill;
|
|
916
|
+
|
|
917
|
+
// src/Icons/StarIcon.tsx
|
|
918
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
919
|
+
var StarIcon = ({ className, percentage, color }) => {
|
|
920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", className: className || "h-5 w-5", viewBox: "0 0 20 20", fill: "currentColor", children: [
|
|
921
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("linearGradient", { id: "grad", children: [
|
|
922
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("stop", { offset: `${(percentage || 0.5) * 100}%`, "stop-color": color ? color : "#4b5563" }),
|
|
923
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("stop", { offset: `${100 - (percentage || 0.5) * 100}%`, "stop-color": "white" })
|
|
924
|
+
] }) }),
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { fill: "url(#grad)", d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" })
|
|
926
|
+
] });
|
|
927
|
+
};
|
|
928
|
+
var StarIcon_default = StarIcon;
|
|
929
|
+
|
|
930
|
+
// src/Icons/StarIconSolid.tsx
|
|
931
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
932
|
+
var StartIconSolid = ({ className }) => {
|
|
933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: className || "h-5 w-5", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) });
|
|
934
|
+
};
|
|
935
|
+
var StarIconSolid_default = StartIconSolid;
|
|
936
|
+
|
|
937
|
+
// src/Common/RatingStars.tsx
|
|
938
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
939
|
+
var RatingStars = ({ avgRating, large }) => {
|
|
940
|
+
const icons = [1, 2, 3, 4, 5].map((el) => {
|
|
941
|
+
if (avgRating === 0) {
|
|
942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StarIconSolid_default, { className: `${large ? "h-5 w-5" : "h-3 w-3"} text-gray-200 dark:text-gray-400` }, `rating_star_${el}`);
|
|
943
|
+
}
|
|
944
|
+
if (Number.isInteger(avgRating)) {
|
|
945
|
+
if (el <= avgRating) {
|
|
946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StarIconSolid_default, { className: `${large ? "h-5 w-5" : "h-3 w-3"} text-blue-500` }, `rating_star_${el}`);
|
|
947
|
+
}
|
|
948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StarIconSolid_default, { className: `${large ? "h-5 w-5" : "h-3 w-3"} text-gray-200 dark:text-gray-400` }, `rating_star_${el}`);
|
|
949
|
+
}
|
|
950
|
+
const whole = Math.floor(avgRating);
|
|
951
|
+
if (el <= whole) {
|
|
952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StarIconSolid_default, { className: `${large ? "h-5 w-5" : "h-3 w-3"} text-blue-500` }, `rating_star_${el}`);
|
|
953
|
+
}
|
|
954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StarIcon_default, { percentage: avgRating - whole, color: "#00b4d8", className: `${large ? "h-5 w-5" : "h-3 w-3"}` }, `rating_star_${el}`);
|
|
955
|
+
});
|
|
956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
957
|
+
Tippy_default,
|
|
958
|
+
{
|
|
959
|
+
content: avgRating === 0 ? "No ratings" : "Average Rating " + avgRating,
|
|
960
|
+
className: "bg-gray-800 opacity-90 text-white rounded-md px-2 py-1 cursor-pointer h-fit",
|
|
961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center space-x-0 justify-start", children: icons })
|
|
962
|
+
}
|
|
963
|
+
);
|
|
964
|
+
};
|
|
965
|
+
var RatingStars_default = RatingStars;
|
|
966
|
+
|
|
967
|
+
// src/Common/Slider.tsx
|
|
968
|
+
var import_react9 = require("react");
|
|
969
|
+
var import_use_debounce = require("use-debounce");
|
|
970
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
971
|
+
var Slider = ({ min, max, step, value, onChange }) => {
|
|
972
|
+
const handleChange = (event) => {
|
|
973
|
+
onChange(parseFloat(event.target.value));
|
|
974
|
+
};
|
|
975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
976
|
+
"input",
|
|
977
|
+
{
|
|
978
|
+
type: "range",
|
|
979
|
+
min,
|
|
980
|
+
max,
|
|
981
|
+
step,
|
|
982
|
+
value,
|
|
983
|
+
onChange: handleChange,
|
|
984
|
+
className: `w-full h-2 rounded-lg range-input`
|
|
985
|
+
}
|
|
986
|
+
);
|
|
987
|
+
};
|
|
988
|
+
var DebouncedSlider = ({ min, max, handleUpdate, initialValue }) => {
|
|
989
|
+
const [value, setValue] = (0, import_react9.useState)(initialValue);
|
|
990
|
+
const debouncedUpdate = (0, import_use_debounce.useDebouncedCallback)((v) => {
|
|
991
|
+
handleUpdate(v);
|
|
992
|
+
}, 120, { trailing: true, leading: false });
|
|
993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
994
|
+
Slider,
|
|
995
|
+
{
|
|
996
|
+
min,
|
|
997
|
+
max,
|
|
998
|
+
step: 1,
|
|
999
|
+
value,
|
|
1000
|
+
onChange: (v) => {
|
|
1001
|
+
setValue(v);
|
|
1002
|
+
debouncedUpdate(v);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
);
|
|
1006
|
+
};
|
|
1007
|
+
Slider.Debounced = DebouncedSlider;
|
|
1008
|
+
var Slider_default = Slider;
|
|
1009
|
+
|
|
1010
|
+
// src/Common/StepsComponent.tsx
|
|
1011
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1012
|
+
var StepsComponent = ({ steps, activeStep, onStepPress }) => {
|
|
1013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex justify-between items-center w-full p-1 mb-2", children: steps.map((step, index) => {
|
|
1014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex justify-center items-center space-x-2 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1015
|
+
"button",
|
|
1016
|
+
{
|
|
1017
|
+
type: "button",
|
|
1018
|
+
onClick: () => onStepPress(index),
|
|
1019
|
+
className: `flex items-center space-x-2 px-4 py-2 rounded-lg min-w-10 md:min-w-20 sm:min-w-40 font-header transition-all duration-150
|
|
1020
|
+
${activeStep === index ? "bg-primary text-white shadow-lg scale-110 border-2 border-primary" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-slate-700 border-2 border-transparent hover:border-primary/30"}`,
|
|
1021
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "font-medium truncate", children: [
|
|
1022
|
+
index + 1,
|
|
1023
|
+
". ",
|
|
1024
|
+
step.label
|
|
1025
|
+
] })
|
|
1026
|
+
}
|
|
1027
|
+
) }) }, `step_${index}_${step.label}`);
|
|
1028
|
+
}) });
|
|
1029
|
+
};
|
|
1030
|
+
var StepsComponent_default = StepsComponent;
|
|
1031
|
+
|
|
1032
|
+
// src/Common/ToggleSwitch.tsx
|
|
1033
|
+
var import_formik3 = require("formik");
|
|
1034
|
+
var import_framer_motion3 = require("framer-motion");
|
|
1035
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1036
|
+
var Formik = ({ label, name }) => {
|
|
1037
|
+
const [{ value }, , { setValue }] = (0, import_formik3.useField)(name);
|
|
1038
|
+
const handleChange = (e) => {
|
|
1039
|
+
setValue(e.target.checked);
|
|
1040
|
+
};
|
|
1041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
1042
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
|
|
1043
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1044
|
+
"input",
|
|
1045
|
+
{
|
|
1046
|
+
type: "checkbox",
|
|
1047
|
+
className: "opacity-0 absolute",
|
|
1048
|
+
checked: value,
|
|
1049
|
+
onChange: handleChange
|
|
1050
|
+
}
|
|
1051
|
+
),
|
|
1052
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `w-10 h-6 rounded-full p-[4px] transition-colors duration-300 ${value ? "bg-[#00b4d8]" : "bg-[#64748b]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1053
|
+
import_framer_motion3.motion.div,
|
|
1054
|
+
{
|
|
1055
|
+
className: "w-4 h-4 bg-white rounded-full absolute top-1",
|
|
1056
|
+
initial: false,
|
|
1057
|
+
animate: {
|
|
1058
|
+
x: value ? 16 : 0
|
|
1059
|
+
},
|
|
1060
|
+
transition: { type: "spring", stiffness: 500, damping: 30 }
|
|
1061
|
+
}
|
|
1062
|
+
) })
|
|
1063
|
+
] }),
|
|
1064
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm font-medium text-gray-800 dark:text-gray-200", children: label })
|
|
1065
|
+
] });
|
|
1066
|
+
};
|
|
1067
|
+
var ToggleSwitch = ({ label, onChange, value }) => {
|
|
1068
|
+
const handleChange = (e) => {
|
|
1069
|
+
onChange(e.target.checked);
|
|
1070
|
+
};
|
|
1071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
1072
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
|
|
1073
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1074
|
+
"input",
|
|
1075
|
+
{
|
|
1076
|
+
type: "checkbox",
|
|
1077
|
+
className: "opacity-0 absolute",
|
|
1078
|
+
checked: value,
|
|
1079
|
+
onChange: handleChange
|
|
1080
|
+
}
|
|
1081
|
+
),
|
|
1082
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `w-10 h-6 rounded-full p-[4px] transition-colors duration-300 ${value ? "bg-[#00b4d8]" : "bg-[#64748b]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1083
|
+
import_framer_motion3.motion.div,
|
|
1084
|
+
{
|
|
1085
|
+
className: "w-4 h-4 bg-white rounded-full absolute top-1",
|
|
1086
|
+
initial: false,
|
|
1087
|
+
animate: {
|
|
1088
|
+
x: value ? 16 : 0
|
|
1089
|
+
},
|
|
1090
|
+
transition: { type: "spring", stiffness: 500, damping: 30 }
|
|
1091
|
+
}
|
|
1092
|
+
) })
|
|
1093
|
+
] }),
|
|
1094
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm font-medium text-gray-800 dark:text-gray-200", children: label })
|
|
1095
|
+
] });
|
|
1096
|
+
};
|
|
1097
|
+
ToggleSwitch.Formik = Formik;
|
|
1098
|
+
var ToggleSwitch_default = ToggleSwitch;
|
|
1099
|
+
|
|
1100
|
+
// src/Common/UserContentSwitcher.tsx
|
|
1101
|
+
var import_framer_motion4 = require("framer-motion");
|
|
1102
|
+
|
|
1103
|
+
// src/Icons/PlusCircleIcon.tsx
|
|
1104
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1105
|
+
var PlusCircleIcon = ({ className }) => {
|
|
1106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: className || "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" }) });
|
|
1107
|
+
};
|
|
1108
|
+
var PlusCircleIcon_default = PlusCircleIcon;
|
|
1109
|
+
|
|
1110
|
+
// src/Icons/ArrowCircleRight.tsx
|
|
1111
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1112
|
+
var StartIconSolid2 = ({ className }) => {
|
|
1113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: className || "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 9l3 3m0 0l-3 3m3-3H8m13 0a9 9 0 11-18 0 9 9 0 0118 0z" }) });
|
|
1114
|
+
};
|
|
1115
|
+
var ArrowCircleRight_default = StartIconSolid2;
|
|
1116
|
+
|
|
1117
|
+
// src/Common/UserContentSwitcher.tsx
|
|
1118
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1119
|
+
var UserContentSwitcher = ({ icon1: Icon1, icon2: Icon2, setGalleryMode, galleryMode, title1, title2 }) => {
|
|
1120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "relative flex flex-row items-center my-2 bg-slate-100 dark:bg-slate-900 w-full h-14 rounded-lg", children: [
|
|
1121
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1122
|
+
import_framer_motion4.motion.div,
|
|
1123
|
+
{
|
|
1124
|
+
className: "absolute w-1/2 h-11 rounded-md bg-white dark:bg-slate-600",
|
|
1125
|
+
animate: {
|
|
1126
|
+
x: galleryMode === title1.toLowerCase() ? "1%" : "99%"
|
|
1127
|
+
},
|
|
1128
|
+
transition: {
|
|
1129
|
+
type: "spring",
|
|
1130
|
+
damping: 20,
|
|
1131
|
+
stiffness: 200
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
),
|
|
1135
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1136
|
+
"button",
|
|
1137
|
+
{
|
|
1138
|
+
onClick: () => setGalleryMode(title1.toLowerCase()),
|
|
1139
|
+
className: "py-2 flex flex-row w-1/2 justify-center items-center gap-1 z-10",
|
|
1140
|
+
children: [
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1142
|
+
"span",
|
|
1143
|
+
{
|
|
1144
|
+
className: `truncate ${galleryMode === title1.toLowerCase() ? "text-primary dark:text-blue-400" : "text-slate-500 dark:text-slate-400 opacity-90"}`,
|
|
1145
|
+
children: title1.toLocaleUpperCase()
|
|
1146
|
+
}
|
|
1147
|
+
),
|
|
1148
|
+
Icon1 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1149
|
+
Icon1,
|
|
1150
|
+
{
|
|
1151
|
+
className: `h-5 w-5 ${galleryMode === title1.toLowerCase() ? "text-primary dark:text-blue-400" : "text-slate-500 dark:text-slate-400 opacity-90"}`
|
|
1152
|
+
}
|
|
1153
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1154
|
+
PlusCircleIcon_default,
|
|
1155
|
+
{
|
|
1156
|
+
className: `h-5 w-5 ${galleryMode === title1.toLowerCase() ? "text-primary dark:text-blue-400" : "text-slate-500 dark:text-slate-400 opacity-90"}`
|
|
1157
|
+
}
|
|
1158
|
+
)
|
|
1159
|
+
]
|
|
1160
|
+
}
|
|
1161
|
+
),
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1163
|
+
"button",
|
|
1164
|
+
{
|
|
1165
|
+
onClick: () => setGalleryMode(title2.toLowerCase()),
|
|
1166
|
+
className: "py-2 flex flex-row w-1/2 justify-center items-center gap-1 z-10",
|
|
1167
|
+
children: [
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1169
|
+
"span",
|
|
1170
|
+
{
|
|
1171
|
+
className: `truncate ${galleryMode === title2.toLowerCase() ? "text-primary dark:text-blue-400" : "text-slate-500 dark:text-slate-400 opacity-90"}`,
|
|
1172
|
+
children: title2.toLocaleUpperCase()
|
|
1173
|
+
}
|
|
1174
|
+
),
|
|
1175
|
+
Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1176
|
+
Icon2,
|
|
1177
|
+
{
|
|
1178
|
+
className: `h-5 w-5 ${galleryMode === title2.toLowerCase() ? "text-primary dark:text-blue-400" : "text-slate-500 dark:text-slate-400 opacity-90"}`
|
|
1179
|
+
}
|
|
1180
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1181
|
+
ArrowCircleRight_default,
|
|
1182
|
+
{
|
|
1183
|
+
className: `h-5 w-5 ${galleryMode === title2.toLowerCase() ? "text-primary dark:text-blue-400" : "text-slate-500 dark:text-slate-400 opacity-90"}`
|
|
1184
|
+
}
|
|
1185
|
+
)
|
|
1186
|
+
]
|
|
1187
|
+
}
|
|
1188
|
+
)
|
|
1189
|
+
] });
|
|
1190
|
+
};
|
|
1191
|
+
var UserContentSwitcher_default = UserContentSwitcher;
|
|
1192
|
+
|
|
1193
|
+
// src/Fade/Fade.tsx
|
|
1194
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1195
|
+
var Fade = ({ children, inProp }) => {
|
|
1196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "animate-fade-in", children });
|
|
1197
|
+
};
|
|
1198
|
+
var Fade_default = Fade;
|
|
1199
|
+
|
|
1200
|
+
// src/ProgressBar/ProgressBarSimple.tsx
|
|
1201
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1202
|
+
var ProgressBarSimple = ({ progress, color, height = 10, backgroundColor = "#ccc" }) => {
|
|
1203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1204
|
+
"div",
|
|
1205
|
+
{
|
|
1206
|
+
className: "w-full overflow-hidden transition-all duration-150 ease-in-out",
|
|
1207
|
+
style: {
|
|
1208
|
+
backgroundColor,
|
|
1209
|
+
height: `${height}px`,
|
|
1210
|
+
borderRadius: `${height / 2}px`
|
|
1211
|
+
},
|
|
1212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1213
|
+
"div",
|
|
1214
|
+
{
|
|
1215
|
+
className: "transition-all duration-150 ease-in-out",
|
|
1216
|
+
style: {
|
|
1217
|
+
width: `${progress}%`,
|
|
1218
|
+
backgroundColor: color,
|
|
1219
|
+
height: `${height}px`,
|
|
1220
|
+
borderRadius: `${height / 2}px`
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
)
|
|
1224
|
+
}
|
|
1225
|
+
) });
|
|
1226
|
+
};
|
|
1227
|
+
var ProgressBarSimple_default = ProgressBarSimple;
|
|
1228
|
+
|
|
1229
|
+
// src/ProgressBar/ProgressBar.tsx
|
|
1230
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1231
|
+
var ProgressBar = ({ progress }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "-mt-2 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "bg-gray-100 rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1232
|
+
"div",
|
|
1233
|
+
{
|
|
1234
|
+
className: `rounded-full h-2 ${progress === 100 ? "bg-green-400" : "bg-gray-100"}`,
|
|
1235
|
+
style: {
|
|
1236
|
+
width: `${progress}%`,
|
|
1237
|
+
minWidth: "100%",
|
|
1238
|
+
position: "absolute"
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
) }) }) });
|
|
1242
|
+
var ProgressStepBar = ({ steps, stepIndex, onStepClick, color }) => {
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex w-full items-center space-x-0.5 -mt-1 overflow-hidden", children: steps.map((el, i) => {
|
|
1244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex-1 relative", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1245
|
+
Tippy_default,
|
|
1246
|
+
{
|
|
1247
|
+
content: el.label,
|
|
1248
|
+
className: tippyClassname,
|
|
1249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1250
|
+
"div",
|
|
1251
|
+
{
|
|
1252
|
+
onClick: () => onStepClick == null ? void 0 : onStepClick(i),
|
|
1253
|
+
className: "cursor-pointer bg-gray-100 rounded-full h-2 overflow-hidden",
|
|
1254
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1255
|
+
"div",
|
|
1256
|
+
{
|
|
1257
|
+
className: `cursor-pointer rounded-full h-2 ${stepIndex >= i ? "bg-green-400" : "bg-gray-100"}`,
|
|
1258
|
+
style: {
|
|
1259
|
+
width: `${stepIndex >= i ? 100 : 0}%`,
|
|
1260
|
+
transition: "width 0.3s ease"
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
)
|
|
1264
|
+
}
|
|
1265
|
+
) })
|
|
1266
|
+
}
|
|
1267
|
+
) }, `index_progress_${el.label}`);
|
|
1268
|
+
}) });
|
|
1269
|
+
};
|
|
1270
|
+
ProgressBar.Step = ProgressStepBar;
|
|
1271
|
+
var ProgressBar_default = ProgressBar;
|
|
1272
|
+
|
|
1273
|
+
// src/ProgressBar/CircleProgress.tsx
|
|
1274
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1275
|
+
var CircleProgress = ({ twColor, percentage, radius, fill, strokeWidth }) => {
|
|
1276
|
+
const r = radius;
|
|
1277
|
+
const cx = "50%";
|
|
1278
|
+
const cy = "50%";
|
|
1279
|
+
const w = Math.round(radius / 16);
|
|
1280
|
+
const strokeWidthCalc = strokeWidth ? strokeWidth : w < 8 ? 8 : w;
|
|
1281
|
+
const size = radius * 2 + strokeWidthCalc;
|
|
1282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { height: size, width: size }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "-rotate-90", children: [
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1284
|
+
"circle",
|
|
1285
|
+
{
|
|
1286
|
+
className: "text-white/50 dark:text-slate-200/50",
|
|
1287
|
+
strokeWidth: strokeWidthCalc - 0.5,
|
|
1288
|
+
stroke: "currentColor",
|
|
1289
|
+
fill: fill || "transparent",
|
|
1290
|
+
r,
|
|
1291
|
+
cx,
|
|
1292
|
+
cy
|
|
1293
|
+
}
|
|
1294
|
+
),
|
|
1295
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1296
|
+
"circle",
|
|
1297
|
+
{
|
|
1298
|
+
strokeDasharray: 2 * Math.PI * r,
|
|
1299
|
+
strokeDashoffset: 2 * Math.PI * r - percentage / 100 * 2 * Math.PI * r,
|
|
1300
|
+
stroke: twColor || "white/50",
|
|
1301
|
+
strokeWidth: strokeWidthCalc,
|
|
1302
|
+
strokeLinecap: "round",
|
|
1303
|
+
fill: "transparent",
|
|
1304
|
+
r,
|
|
1305
|
+
cx,
|
|
1306
|
+
cy
|
|
1307
|
+
}
|
|
1308
|
+
)
|
|
1309
|
+
] }) });
|
|
1310
|
+
};
|
|
1311
|
+
var CircleProgress_default = CircleProgress;
|
|
1312
|
+
|
|
1313
|
+
// src/ProgressBar/ScrollProgress.tsx
|
|
1314
|
+
var import_react10 = require("react");
|
|
1315
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1316
|
+
var PRIMARY_COLOR = "#00b4d8";
|
|
1317
|
+
var ScrollProgress = () => {
|
|
1318
|
+
const [scrollPercentage, setScrollPercentage] = (0, import_react10.useState)(0);
|
|
1319
|
+
(0, import_react10.useEffect)(() => {
|
|
1320
|
+
const handleScroll = () => {
|
|
1321
|
+
const windowHeight = window.innerHeight;
|
|
1322
|
+
const documentHeight = document.documentElement.scrollHeight;
|
|
1323
|
+
const scrollY = window.scrollY;
|
|
1324
|
+
const scrollPercent = scrollY / (documentHeight - windowHeight) * 100;
|
|
1325
|
+
setScrollPercentage(scrollPercent);
|
|
1326
|
+
};
|
|
1327
|
+
window.addEventListener("scroll", handleScroll);
|
|
1328
|
+
return () => {
|
|
1329
|
+
window.removeEventListener("scroll", handleScroll);
|
|
1330
|
+
};
|
|
1331
|
+
}, []);
|
|
1332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1333
|
+
"div",
|
|
1334
|
+
{
|
|
1335
|
+
style: {
|
|
1336
|
+
height: "4px",
|
|
1337
|
+
borderRadius: 2,
|
|
1338
|
+
width: "100%",
|
|
1339
|
+
// backgroundColor: '#d1dced',
|
|
1340
|
+
position: "fixed",
|
|
1341
|
+
top: "62px",
|
|
1342
|
+
left: "0px",
|
|
1343
|
+
right: "0px"
|
|
1344
|
+
},
|
|
1345
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1346
|
+
"div",
|
|
1347
|
+
{
|
|
1348
|
+
style: {
|
|
1349
|
+
height: "100%",
|
|
1350
|
+
backgroundColor: PRIMARY_COLOR,
|
|
1351
|
+
borderRadius: 2,
|
|
1352
|
+
width: `${scrollPercentage}%`
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
)
|
|
1356
|
+
}
|
|
1357
|
+
);
|
|
1358
|
+
};
|
|
1359
|
+
var ScrollProgress_default = ScrollProgress;
|
|
1360
|
+
|
|
1361
|
+
// src/Icons/AnimateLogo.tsx
|
|
1362
|
+
var import_react11 = require("react");
|
|
1363
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1364
|
+
var AnimateLogo = () => {
|
|
1365
|
+
const [isFirefox, setIsFirefox] = (0, import_react11.useState)(false);
|
|
1366
|
+
(0, import_react11.useEffect)(() => {
|
|
1367
|
+
const userAgent = window.navigator.userAgent;
|
|
1368
|
+
setIsFirefox(userAgent.indexOf("Firefox") > -1);
|
|
1369
|
+
}, []);
|
|
1370
|
+
if (isFirefox) {
|
|
1371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: "animate-pulse", viewBox: "0 0 600 600", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1372
|
+
"path",
|
|
1373
|
+
{
|
|
1374
|
+
className: "stroke-black dark:stroke-white text-gray-900 dark:text-gray-50",
|
|
1375
|
+
stroke: "currentColor",
|
|
1376
|
+
fill: "none",
|
|
1377
|
+
strokeLinecap: "round",
|
|
1378
|
+
strokeMiterlimit: "10",
|
|
1379
|
+
strokeWidth: "82",
|
|
1380
|
+
strokeDasharray: "1600",
|
|
1381
|
+
d: "M466.49 164.79c17.79 34.76 25.48 75.66 19.08 118.96-11.28 76.36-67.11 139.06-141.89 158.25-127.11 32.61-243.49-61.27-245.86-184.81C95.79 150.86 182.9 60.52 289.23 58.56c33.95-.63 66.08 7.48 94.22 22.29 0 0 15.68 6.34 10.14 23.19 0 0-68.52 219.82-352.61 268.06",
|
|
1382
|
+
children: [
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1384
|
+
"animate",
|
|
1385
|
+
{
|
|
1386
|
+
attributeName: "stroke-dashoffset",
|
|
1387
|
+
to: "0",
|
|
1388
|
+
from: "1600",
|
|
1389
|
+
dur: "4s",
|
|
1390
|
+
fill: "freeze",
|
|
1391
|
+
repeatCount: "indefinite",
|
|
1392
|
+
calcMode: "cubic",
|
|
1393
|
+
keyTimes: "0;0.375;0.5;0.875;1",
|
|
1394
|
+
keySplines: "0 0.26 0 1;0 0.26 0 1;0 0.26 0 1;0 0.26 0 1",
|
|
1395
|
+
values: "1600;0;0;1600;1600"
|
|
1396
|
+
}
|
|
1397
|
+
),
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1399
|
+
"animateTransform",
|
|
1400
|
+
{
|
|
1401
|
+
attributeName: "transform",
|
|
1402
|
+
type: "rotate",
|
|
1403
|
+
from: "0 300 300",
|
|
1404
|
+
to: "360 300 300",
|
|
1405
|
+
dur: "2s",
|
|
1406
|
+
fill: "freeze",
|
|
1407
|
+
repeatCount: "indefinite",
|
|
1408
|
+
calcMode: "cubic",
|
|
1409
|
+
keyTimes: "0;0.75;1",
|
|
1410
|
+
keySplines: "0 0.26 0 1",
|
|
1411
|
+
values: "0 300 300;360 300 300;360 300 300;"
|
|
1412
|
+
}
|
|
1413
|
+
)
|
|
1414
|
+
]
|
|
1415
|
+
}
|
|
1416
|
+
) }) });
|
|
1417
|
+
}
|
|
1418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 600 600", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1419
|
+
"g",
|
|
1420
|
+
{
|
|
1421
|
+
style: {
|
|
1422
|
+
transformOrigin: "center"
|
|
1423
|
+
},
|
|
1424
|
+
transform: "translate(300 300) rotate(0)",
|
|
1425
|
+
height: 176,
|
|
1426
|
+
width: 176,
|
|
1427
|
+
children: [
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1429
|
+
"path",
|
|
1430
|
+
{
|
|
1431
|
+
className: "stroke-black dark:stroke-white text-gray-900 dark:text-gray-50",
|
|
1432
|
+
stroke: "currentColor",
|
|
1433
|
+
id: "motionPath",
|
|
1434
|
+
fill: "none",
|
|
1435
|
+
strokeLinecap: "round",
|
|
1436
|
+
height: 600,
|
|
1437
|
+
width: 600,
|
|
1438
|
+
style: {
|
|
1439
|
+
transformOrigin: "center"
|
|
1440
|
+
},
|
|
1441
|
+
strokeMiterlimit: "10",
|
|
1442
|
+
strokeWidth: "82",
|
|
1443
|
+
strokeDasharray: "1600",
|
|
1444
|
+
d: "M466.49 164.79c17.79 34.76 25.48 75.66 19.08 118.96-11.28 76.36-67.11 139.06-141.89 158.25-127.11 32.61-243.49-61.27-245.86-184.81C95.79 150.86 182.9 60.52 289.23 58.56c33.95-.63 66.08 7.48 94.22 22.29 0 0 15.68 6.34 10.14 23.19 0 0-68.52 219.82-352.61 268.06",
|
|
1445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1446
|
+
"animate",
|
|
1447
|
+
{
|
|
1448
|
+
attributeName: "stroke-dashoffset",
|
|
1449
|
+
to: "0",
|
|
1450
|
+
from: "1600",
|
|
1451
|
+
dur: "4s",
|
|
1452
|
+
fill: "freeze",
|
|
1453
|
+
repeatCount: "indefinite",
|
|
1454
|
+
calcMode: "cubic",
|
|
1455
|
+
keyTimes: "0;0.375;0.5;0.875;1",
|
|
1456
|
+
keySplines: "0 0.26 0 1;0 0.26 0 1;0 0.26 0 1;0 0.26 0 1",
|
|
1457
|
+
values: "1600;0;0;1600;1600"
|
|
1458
|
+
}
|
|
1459
|
+
)
|
|
1460
|
+
}
|
|
1461
|
+
),
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1463
|
+
"animateTransform",
|
|
1464
|
+
{
|
|
1465
|
+
attributeName: "transform",
|
|
1466
|
+
type: "rotate",
|
|
1467
|
+
from: "0",
|
|
1468
|
+
to: "360",
|
|
1469
|
+
dur: "2s",
|
|
1470
|
+
fill: "freeze",
|
|
1471
|
+
repeatCount: "indefinite",
|
|
1472
|
+
calcMode: "cubic",
|
|
1473
|
+
keyTimes: "0;0.75;1",
|
|
1474
|
+
keySplines: "0 0.26 0 1",
|
|
1475
|
+
values: "0;360;360;"
|
|
1476
|
+
}
|
|
1477
|
+
)
|
|
1478
|
+
]
|
|
1479
|
+
}
|
|
1480
|
+
) });
|
|
1481
|
+
};
|
|
1482
|
+
var AnimateLogo_default = AnimateLogo;
|
|
1483
|
+
|
|
1484
|
+
// src/Spinners/OverlaySpinner.tsx
|
|
1485
|
+
var import_react12 = require("react");
|
|
1486
|
+
var import_react_dom3 = require("react-dom");
|
|
1487
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1488
|
+
var OverlaySpinner = ({ visible }) => {
|
|
1489
|
+
const [mounted, setMounted] = (0, import_react12.useState)(false);
|
|
1490
|
+
(0, import_react12.useEffect)(() => setMounted(true), []);
|
|
1491
|
+
if (!mounted) return null;
|
|
1492
|
+
if (!visible) return null;
|
|
1493
|
+
return (0, import_react_dom3.createPortal)(
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "animate-fade-in", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "fixed top-0 left-0 w-full h-screen flex items-center justify-center z-50 dark:bg-black/70 bg-white/60", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-44 w-44 overflow-visible", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AnimateLogo_default, {}) }) }) }),
|
|
1495
|
+
typeof window !== "undefined" ? document.body : {},
|
|
1496
|
+
"spinner"
|
|
1497
|
+
);
|
|
1498
|
+
};
|
|
1499
|
+
var OverlaySpinner_default = OverlaySpinner;
|
|
1500
|
+
|
|
1501
|
+
// src/constants.tsx
|
|
1502
|
+
var PRIMARY_COLOR2 = "#00b4d8";
|
|
1503
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1504
|
+
0 && (module.exports = {
|
|
1505
|
+
AnimateLogo,
|
|
1506
|
+
Backdrop,
|
|
1507
|
+
BottomAlert,
|
|
1508
|
+
Breakpoint,
|
|
1509
|
+
Button,
|
|
1510
|
+
Checkbox,
|
|
1511
|
+
CircleProgress,
|
|
1512
|
+
Container,
|
|
1513
|
+
ErrorText,
|
|
1514
|
+
Fade,
|
|
1515
|
+
FunButton,
|
|
1516
|
+
FunRoundButton,
|
|
1517
|
+
IconInfo,
|
|
1518
|
+
Modal,
|
|
1519
|
+
NoResults,
|
|
1520
|
+
NoticeBox,
|
|
1521
|
+
Overlay,
|
|
1522
|
+
OverlaySpinner,
|
|
1523
|
+
PRIMARY_COLOR,
|
|
1524
|
+
Pill,
|
|
1525
|
+
ProgressBar,
|
|
1526
|
+
ProgressBarSimple,
|
|
1527
|
+
RadioOption,
|
|
1528
|
+
RatingStars,
|
|
1529
|
+
ScrollProgress,
|
|
1530
|
+
Slider,
|
|
1531
|
+
Spinner,
|
|
1532
|
+
StepsComponent,
|
|
1533
|
+
Tippy,
|
|
1534
|
+
ToggleSwitch,
|
|
1535
|
+
UserContentSwitcher,
|
|
1536
|
+
balsamicSans,
|
|
1537
|
+
baseFieldStyle,
|
|
1538
|
+
createExerciseElementStyle,
|
|
1539
|
+
exerciseDeleteButton,
|
|
1540
|
+
exerciseEditButton,
|
|
1541
|
+
headerButtonClass,
|
|
1542
|
+
headerTippyClass,
|
|
1543
|
+
openSans,
|
|
1544
|
+
parkinsans,
|
|
1545
|
+
tippyClassname,
|
|
1546
|
+
toolbarExerciseButton,
|
|
1547
|
+
ubuntu,
|
|
1548
|
+
xIconButton
|
|
1549
|
+
});
|