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