evelearn-theme 2.0.28 → 2.0.29
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 +339 -436
- package/package.json +2 -2
- package/tsup.config.ts +14 -0
- package/dist/index.d.ts +0 -324
- package/dist/index.js +0 -2160
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// src/constants.tsx
|
|
2
1
|
function _array_like_to_array(arr, len) {
|
|
3
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
4
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -128,17 +127,31 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
128
127
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
129
128
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
130
129
|
}
|
|
130
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
131
|
+
import { useMemo, useState, useRef, useEffect } from 'react';
|
|
132
|
+
import ReactDOM, { createPortal } from 'react-dom';
|
|
133
|
+
import clsx from 'clsx';
|
|
134
|
+
import { motion } from 'framer-motion';
|
|
135
|
+
import { useField } from 'formik';
|
|
136
|
+
import { useFloating, offset, flip, shift, arrow, useHover, useDismiss, useRole, useInteractions, FloatingPortal, FloatingArrow } from '@floating-ui/react';
|
|
137
|
+
import { useDebouncedCallback } from 'use-debounce';
|
|
138
|
+
var __defProp = Object.defineProperty;
|
|
139
|
+
var __name = function(target, value) {
|
|
140
|
+
return __defProp(target, "name", {
|
|
141
|
+
value: value,
|
|
142
|
+
configurable: true
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
// src/constants.tsx
|
|
131
146
|
var PRIMARY_COLOR = "#00b4d8";
|
|
132
|
-
|
|
133
|
-
import { jsx } from "react/jsx-runtime";
|
|
134
|
-
var ErrorText = function(param) {
|
|
147
|
+
var ErrorText = /* @__PURE__ */ __name(function(param) {
|
|
135
148
|
var text = param.text, style = param.style, classNames = param.classNames;
|
|
136
149
|
return /* @__PURE__ */ jsx("p", {
|
|
137
150
|
className: classNames ? classNames : "text-red-500 font-semibold text-wrap py-auto",
|
|
138
151
|
style: style,
|
|
139
152
|
children: text
|
|
140
153
|
});
|
|
141
|
-
};
|
|
154
|
+
}, "ErrorText");
|
|
142
155
|
var ErrorText_default = ErrorText;
|
|
143
156
|
// src/Common/fieldStyle.ts
|
|
144
157
|
var baseFieldStyle = "font-sans form-input h-11 w-full bg-white border-gray-200 dark:border-gray-500 dark:bg-slate-950 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";
|
|
@@ -149,9 +162,7 @@ var exerciseEditButton = "w-6 h-6 flex justify-center text-gray-700 dark:text-gr
|
|
|
149
162
|
var tippyClassname = "p-2 bg-slate-600 dark:bg-slate-900 opacity-90 text-white font-medium font-header rounded-lg";
|
|
150
163
|
var headerTippyClass = "rounded-lg p-2 bg-slate-950 opacity-95 text-white font-medium";
|
|
151
164
|
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";
|
|
152
|
-
|
|
153
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
154
|
-
var Spinner = function(param) {
|
|
165
|
+
var Spinner = /* @__PURE__ */ __name(function(param) {
|
|
155
166
|
var _param_visible = param.visible, visible = _param_visible === void 0 ? true : _param_visible, size = param.size, isWhite = param.white;
|
|
156
167
|
if (visible === false) return null;
|
|
157
168
|
var color = isWhite ? "stroke-white/90" : "stroke-slate-600/80";
|
|
@@ -161,24 +172,24 @@ var Spinner = function(param) {
|
|
|
161
172
|
return /* @__PURE__ */ jsxs("div", {
|
|
162
173
|
className: "relative h-8 w-8 flex justify-center items-center",
|
|
163
174
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ jsx("svg", {
|
|
165
176
|
className: "absolute top-0 ".concat(dimensions, " ").concat(bgColor),
|
|
166
177
|
viewBox: "0 0 24 24",
|
|
167
178
|
fill: "none",
|
|
168
179
|
strokeWidth: "2.4",
|
|
169
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ jsx("circle", {
|
|
170
181
|
cx: "12",
|
|
171
182
|
cy: "12",
|
|
172
183
|
r: "10"
|
|
173
184
|
})
|
|
174
185
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ jsx("svg", {
|
|
176
187
|
className: spinnerClasses,
|
|
177
188
|
viewBox: "0 0 24 24",
|
|
178
189
|
fill: "none",
|
|
179
190
|
strokeWidth: "2.4",
|
|
180
191
|
strokeLinecap: "round",
|
|
181
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
182
193
|
d: "\n M 12 2 \n A 10 10 0 0 1 22 12 \n A 10 10 0 0 1 12 22 \n A 10 10 0 0 1 2 12 \n A 10 10 0 0 1 12 2\n ",
|
|
183
194
|
strokeDasharray: "13 18.4",
|
|
184
195
|
stroke: "inherit",
|
|
@@ -187,38 +198,36 @@ var Spinner = function(param) {
|
|
|
187
198
|
})
|
|
188
199
|
]
|
|
189
200
|
});
|
|
190
|
-
};
|
|
191
|
-
var SpinnerCentered = function(props) {
|
|
201
|
+
}, "Spinner");
|
|
202
|
+
var SpinnerCentered = /* @__PURE__ */ __name(function(props) {
|
|
192
203
|
if (props.visible === false) return null;
|
|
193
|
-
return /* @__PURE__ */
|
|
204
|
+
return /* @__PURE__ */ jsx("div", {
|
|
194
205
|
className: "w-full flex justify-center items-center",
|
|
195
|
-
children: /* @__PURE__ */
|
|
206
|
+
children: /* @__PURE__ */ jsx(Spinner, _object_spread({}, props))
|
|
196
207
|
});
|
|
197
|
-
};
|
|
208
|
+
}, "SpinnerCentered");
|
|
198
209
|
Spinner.displayName = "Spinner";
|
|
199
210
|
SpinnerCentered.displayName = "Spinner.Centered";
|
|
200
211
|
Spinner.Centered = SpinnerCentered;
|
|
201
212
|
var Spinner_default = Spinner;
|
|
202
|
-
// src/Common/NoResults.tsx
|
|
203
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
204
213
|
var HEIGHT = 160;
|
|
205
214
|
var WIDTH = HEIGHT * (16 / 9);
|
|
206
|
-
var NoResults = function(param) {
|
|
215
|
+
var NoResults = /* @__PURE__ */ __name(function(param) {
|
|
207
216
|
var loading = param.loading, message = param.message;
|
|
208
|
-
return /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
209
218
|
className: "relative w-full flex justify-center items-center",
|
|
210
219
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ jsxs("div", {
|
|
212
221
|
className: "flex justify-start w-full space-x-2 py-3 p-4 bg-slate-100 dark:bg-slate-800 rounded-md",
|
|
213
222
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ jsx("div", {
|
|
215
224
|
style: {
|
|
216
225
|
width: "calc(".concat(WIDTH, "px + 1rem)"),
|
|
217
226
|
height: 320
|
|
218
227
|
},
|
|
219
228
|
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"
|
|
220
229
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ jsx("div", {
|
|
222
231
|
style: {
|
|
223
232
|
width: "calc(".concat(WIDTH, "px + 1rem)"),
|
|
224
233
|
height: 320
|
|
@@ -227,11 +236,11 @@ var NoResults = function(param) {
|
|
|
227
236
|
})
|
|
228
237
|
]
|
|
229
238
|
}),
|
|
230
|
-
!loading && /* @__PURE__ */
|
|
239
|
+
!loading && /* @__PURE__ */ jsx("div", {
|
|
231
240
|
className: "absolute w-full h-full flex justify-center items-center m-auto",
|
|
232
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
233
242
|
className: "p-4 rounded-lg bg-white dark:bg-slate-700 shadow-xl",
|
|
234
|
-
children: /* @__PURE__ */
|
|
243
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
235
244
|
className: "font-semibold text-lg text-gray-700 dark:text-gray-300",
|
|
236
245
|
children: message || "No results"
|
|
237
246
|
})
|
|
@@ -239,13 +248,11 @@ var NoResults = function(param) {
|
|
|
239
248
|
})
|
|
240
249
|
]
|
|
241
250
|
});
|
|
242
|
-
};
|
|
251
|
+
}, "NoResults");
|
|
243
252
|
var NoResults_default = NoResults;
|
|
244
|
-
|
|
245
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
246
|
-
var Container = function(param) {
|
|
253
|
+
var Container = /* @__PURE__ */ __name(function(param) {
|
|
247
254
|
var backgroundImage = param.backgroundImage, style = param.style, children = param.children, onClick = param.onClick;
|
|
248
|
-
return backgroundImage ? /* @__PURE__ */
|
|
255
|
+
return backgroundImage ? /* @__PURE__ */ jsx("div", {
|
|
249
256
|
style: _object_spread({
|
|
250
257
|
backgroundImage: backgroundImage,
|
|
251
258
|
backgroundSize: "cover"
|
|
@@ -253,7 +260,7 @@ var Container = function(param) {
|
|
|
253
260
|
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",
|
|
254
261
|
onClick: onClick,
|
|
255
262
|
children: children ? children : null
|
|
256
|
-
}) : /* @__PURE__ */
|
|
263
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
257
264
|
className: "w-full dark:bg-slate-950 mx-auto overflow-y-auto overflow-x-clip px-0 sm:px-16 relative pt-20",
|
|
258
265
|
onClick: onClick,
|
|
259
266
|
style: style || {
|
|
@@ -261,39 +268,35 @@ var Container = function(param) {
|
|
|
261
268
|
},
|
|
262
269
|
children: children ? children : null
|
|
263
270
|
});
|
|
264
|
-
};
|
|
271
|
+
}, "Container");
|
|
265
272
|
var Container_default = Container;
|
|
266
|
-
|
|
267
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
268
|
-
var Pill = function(param) {
|
|
273
|
+
var Pill = /* @__PURE__ */ __name(function(param) {
|
|
269
274
|
var text = param.text;
|
|
270
|
-
return /* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ jsx("span", {
|
|
271
276
|
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",
|
|
272
277
|
children: text
|
|
273
278
|
});
|
|
274
|
-
};
|
|
279
|
+
}, "Pill");
|
|
275
280
|
var Pill_default = Pill;
|
|
276
|
-
|
|
277
|
-
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
278
|
-
var StepsComponent = function(param) {
|
|
281
|
+
var StepsComponent = /* @__PURE__ */ __name(function(param) {
|
|
279
282
|
var steps = param.steps, activeStep = param.activeStep, onStepPress = param.onStepPress;
|
|
280
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ jsx("div", {
|
|
281
284
|
className: "flex justify-between items-center space-x-1 w-full p-1 mb-2",
|
|
282
285
|
children: steps.map(function(step, index) {
|
|
283
|
-
return /* @__PURE__ */
|
|
286
|
+
return /* @__PURE__ */ jsx("div", {
|
|
284
287
|
className: "flex justify-center items-center space-x-2 w-full",
|
|
285
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
286
289
|
className: "flex flex-col items-center w-full",
|
|
287
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
288
291
|
type: "button",
|
|
289
292
|
onClick: function() {
|
|
290
293
|
return onStepPress(index);
|
|
291
294
|
},
|
|
292
295
|
className: "flex items-center space-x-2 px-4 py-2 rounded-lg w-full min-w-10 md:min-w-20 sm:min-w-40 font-header transition-all duration-150\n ".concat(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"),
|
|
293
|
-
children: /* @__PURE__ */
|
|
296
|
+
children: /* @__PURE__ */ jsxs("p", {
|
|
294
297
|
className: "font-medium truncate",
|
|
295
298
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ jsxs("span", {
|
|
297
300
|
className: "text-semibold",
|
|
298
301
|
children: [
|
|
299
302
|
index + 1,
|
|
@@ -308,24 +311,20 @@ var StepsComponent = function(param) {
|
|
|
308
311
|
}, "step_".concat(index, "_").concat(step.label));
|
|
309
312
|
})
|
|
310
313
|
});
|
|
311
|
-
};
|
|
314
|
+
}, "StepsComponent");
|
|
312
315
|
var StepsComponent_default = StepsComponent;
|
|
313
|
-
|
|
314
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
315
|
-
var Fade = function(param) {
|
|
316
|
+
var Fade = /* @__PURE__ */ __name(function(param) {
|
|
316
317
|
var children = param.children, inProp = param.inProp;
|
|
317
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ jsx("div", {
|
|
318
319
|
className: "animate-fade-in",
|
|
319
320
|
children: children
|
|
320
321
|
});
|
|
321
|
-
};
|
|
322
|
+
}, "Fade");
|
|
322
323
|
var Fade_default = Fade;
|
|
323
|
-
|
|
324
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
325
|
-
var Backdrop = function(param) {
|
|
324
|
+
var Backdrop = /* @__PURE__ */ __name(function(param) {
|
|
326
325
|
var visible = param.visible, onClick = param.onClick, opacity = param.opacity;
|
|
327
326
|
if (!visible) return null;
|
|
328
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ jsx("div", {
|
|
329
328
|
style: {
|
|
330
329
|
opacity: opacity ? opacity : 90,
|
|
331
330
|
zIndex: 21
|
|
@@ -333,11 +332,9 @@ var Backdrop = function(param) {
|
|
|
333
332
|
className: "fixed top-0 left-0 w-full h-screen bg-gray-100 dark:bg-slate-900",
|
|
334
333
|
onClick: onClick
|
|
335
334
|
});
|
|
336
|
-
};
|
|
335
|
+
}, "Backdrop");
|
|
337
336
|
var Backdrop_default = Backdrop;
|
|
338
|
-
|
|
339
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
340
|
-
var Breakpoint = function(param) {
|
|
337
|
+
var Breakpoint = /* @__PURE__ */ __name(function(param) {
|
|
341
338
|
var children = param.children, fromSize = param.fromSize, toSize = param.toSize;
|
|
342
339
|
var className = "";
|
|
343
340
|
if (fromSize && toSize) {
|
|
@@ -347,17 +344,13 @@ var Breakpoint = function(param) {
|
|
|
347
344
|
} else if (toSize) {
|
|
348
345
|
className = "block ".concat(toSize, ":hidden");
|
|
349
346
|
}
|
|
350
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ jsx("div", {
|
|
351
348
|
className: className,
|
|
352
349
|
children: children
|
|
353
350
|
});
|
|
354
|
-
};
|
|
351
|
+
}, "Breakpoint");
|
|
355
352
|
var Breakpoint_default = Breakpoint;
|
|
356
|
-
|
|
357
|
-
import { useEffect, useState } from "react";
|
|
358
|
-
import ReactDOM from "react-dom";
|
|
359
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
360
|
-
var Overlay = function(param) {
|
|
353
|
+
var Overlay = /* @__PURE__ */ __name(function(param) {
|
|
361
354
|
var visible = param.visible, onDismissed = param.onDismissed, onClick = param.onClick, zIndex = param.zIndex, isDark = param.isDark, children = param.children, opacity = param.opacity, _param_withContainer = param.withContainer, withContainer = _param_withContainer === void 0 ? true : _param_withContainer;
|
|
362
355
|
var _useState = _sliced_to_array(useState(null), 2), modalRoot = _useState[0], setModalRoot = _useState[1];
|
|
363
356
|
useEffect(function() {
|
|
@@ -379,9 +372,9 @@ var Overlay = function(param) {
|
|
|
379
372
|
visible
|
|
380
373
|
]);
|
|
381
374
|
if (!visible || !modalRoot) return null;
|
|
382
|
-
return ReactDOM.createPortal(/* @__PURE__ */
|
|
375
|
+
return ReactDOM.createPortal(/* @__PURE__ */ jsx("div", {
|
|
383
376
|
className: "animate-fade-in",
|
|
384
|
-
children: withContainer ? /* @__PURE__ */
|
|
377
|
+
children: withContainer ? /* @__PURE__ */ jsx("div", {
|
|
385
378
|
onClick: onDismissed || onClick,
|
|
386
379
|
className: "top-0 left-0 fixed w-full h-screen dark:bg-black/70 bg-white/60 backdrop-blur-lg flex items-center justify-center",
|
|
387
380
|
style: {
|
|
@@ -391,14 +384,11 @@ var Overlay = function(param) {
|
|
|
391
384
|
children: children
|
|
392
385
|
}) : children
|
|
393
386
|
}), modalRoot);
|
|
394
|
-
};
|
|
387
|
+
}, "Overlay");
|
|
395
388
|
var Overlay_default = Overlay;
|
|
396
|
-
|
|
397
|
-
import clsx from "clsx";
|
|
398
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
399
|
-
var Button = function(param) {
|
|
389
|
+
var Button = /* @__PURE__ */ __name(function(param) {
|
|
400
390
|
var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, loading = param.loading, onClick = param.onClick, _param_kind = param.kind, kind = _param_kind === void 0 ? "primary" : _param_kind, _param_size = param.size, size = _param_size === void 0 ? "small" : _param_size, _param_type = param.type, type = _param_type === void 0 ? "button" : _param_type, children = param.children;
|
|
401
|
-
var styled = function() {
|
|
391
|
+
var styled = /* @__PURE__ */ __name(function() {
|
|
402
392
|
switch(kind){
|
|
403
393
|
case "primary":
|
|
404
394
|
return clsx("bg-primary font-header text-white font-medium transition-all duration-75 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/10");
|
|
@@ -418,11 +408,9 @@ var Button = function(param) {
|
|
|
418
408
|
return clsx("bg-amber-500 font-header text-white transition-all duration-75 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/10");
|
|
419
409
|
case "warning":
|
|
420
410
|
return clsx("bg-red-500 font-header text-white font-medium transition-opacity duration-75 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/10");
|
|
421
|
-
default:
|
|
422
|
-
break;
|
|
423
411
|
}
|
|
424
|
-
};
|
|
425
|
-
var sized = function() {
|
|
412
|
+
}, "styled");
|
|
413
|
+
var sized = /* @__PURE__ */ __name(function() {
|
|
426
414
|
switch(size){
|
|
427
415
|
case "small":
|
|
428
416
|
return "p-1";
|
|
@@ -433,29 +421,25 @@ var Button = function(param) {
|
|
|
433
421
|
default:
|
|
434
422
|
return "px-2 py-1";
|
|
435
423
|
}
|
|
436
|
-
};
|
|
437
|
-
return /* @__PURE__ */
|
|
424
|
+
}, "sized");
|
|
425
|
+
return /* @__PURE__ */ jsx("button", {
|
|
438
426
|
type: type || "button",
|
|
439
427
|
disabled: disabled,
|
|
440
428
|
className: clsx("rounded-lg cursor-pointer focus:outline-none transition duration-100", styled(), sized()),
|
|
441
429
|
onClick: onClick,
|
|
442
|
-
children: /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
443
431
|
className: "w-full max-h-11",
|
|
444
|
-
children: loading ? /* @__PURE__ */
|
|
432
|
+
children: loading ? /* @__PURE__ */ jsx("div", {
|
|
445
433
|
className: "flex w-full justify-center items-center",
|
|
446
|
-
children: /* @__PURE__ */
|
|
434
|
+
children: /* @__PURE__ */ jsx(Spinner_default, {
|
|
447
435
|
white: true
|
|
448
436
|
})
|
|
449
437
|
}) : children
|
|
450
438
|
})
|
|
451
439
|
});
|
|
452
|
-
};
|
|
440
|
+
}, "Button");
|
|
453
441
|
var Button_default = Button;
|
|
454
|
-
|
|
455
|
-
import { useMemo } from "react";
|
|
456
|
-
import { motion } from "framer-motion";
|
|
457
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
458
|
-
var FunButton = function(param) {
|
|
442
|
+
var FunButton = /* @__PURE__ */ __name(function(param) {
|
|
459
443
|
var onClick = param.onClick, disabled = param.disabled, type = param.type, children = param.children, _param_color = param.color, color = _param_color === void 0 ? "primary" : _param_color, loading = param.loading, active = param.active, className = param.className, _param_size = param.size, size = _param_size === void 0 ? "base" : _param_size;
|
|
460
444
|
var _useMemo = useMemo(function() {
|
|
461
445
|
switch(color){
|
|
@@ -533,7 +517,7 @@ var FunButton = function(param) {
|
|
|
533
517
|
classStyle,
|
|
534
518
|
disabled
|
|
535
519
|
]);
|
|
536
|
-
return /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ jsx(motion.button, {
|
|
537
521
|
className: "".concat(computedClassName),
|
|
538
522
|
style: {
|
|
539
523
|
background: front,
|
|
@@ -548,7 +532,7 @@ var FunButton = function(param) {
|
|
|
548
532
|
duration: 0.1,
|
|
549
533
|
ease: "easeInOut"
|
|
550
534
|
},
|
|
551
|
-
children: /* @__PURE__ */
|
|
535
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
552
536
|
className: computedClassStyle,
|
|
553
537
|
style: {
|
|
554
538
|
background: bottom,
|
|
@@ -567,9 +551,9 @@ var FunButton = function(param) {
|
|
|
567
551
|
duration: 0.1,
|
|
568
552
|
ease: "easeInOut"
|
|
569
553
|
},
|
|
570
|
-
children: loading ? /* @__PURE__ */
|
|
554
|
+
children: loading ? /* @__PURE__ */ jsx("div", {
|
|
571
555
|
className: size === "small" ? "min-h-6" : "min-h-10",
|
|
572
|
-
children: /* @__PURE__ */
|
|
556
|
+
children: /* @__PURE__ */ jsx(Spinner_default.Centered, {
|
|
573
557
|
visible: true,
|
|
574
558
|
size: size === "small" ? "small" : "base",
|
|
575
559
|
white: true
|
|
@@ -577,16 +561,11 @@ var FunButton = function(param) {
|
|
|
577
561
|
}) : children
|
|
578
562
|
})
|
|
579
563
|
});
|
|
580
|
-
};
|
|
564
|
+
}, "FunButton");
|
|
581
565
|
var FunButton_default = FunButton;
|
|
582
|
-
|
|
583
|
-
import { useMemo as useMemo2 } from "react";
|
|
584
|
-
import { motion as motion2 } from "framer-motion";
|
|
585
|
-
import clsx2 from "clsx";
|
|
586
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
587
|
-
var FunRoundButton = function(param) {
|
|
566
|
+
var FunRoundButton = /* @__PURE__ */ __name(function(param) {
|
|
588
567
|
var onClick = param.onClick, disabled = param.disabled, type = param.type, children = param.children, color = param.color, active = param.active, className = param.className, _param_size = param.size, size = _param_size === void 0 ? 44 : _param_size;
|
|
589
|
-
var
|
|
568
|
+
var _useMemo = useMemo(function() {
|
|
590
569
|
switch(color){
|
|
591
570
|
case "primary":
|
|
592
571
|
return {
|
|
@@ -627,9 +606,9 @@ var FunRoundButton = function(param) {
|
|
|
627
606
|
}, [
|
|
628
607
|
color,
|
|
629
608
|
disabled
|
|
630
|
-
]), front =
|
|
631
|
-
return /* @__PURE__ */
|
|
632
|
-
className:
|
|
609
|
+
]), front = _useMemo.front, bottom = _useMemo.bottom;
|
|
610
|
+
return /* @__PURE__ */ jsx(motion.button, {
|
|
611
|
+
className: clsx(className || "border-none p-0 flex justify-center items-center cursor-pointer z-10", disabled ? "opacity-70 cursor-default" : "hover:opacity-95"),
|
|
633
612
|
style: {
|
|
634
613
|
background: front,
|
|
635
614
|
height: size,
|
|
@@ -646,7 +625,7 @@ var FunRoundButton = function(param) {
|
|
|
646
625
|
whileTap: {
|
|
647
626
|
y: disabled ? 0 : 2
|
|
648
627
|
},
|
|
649
|
-
children: /* @__PURE__ */
|
|
628
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
650
629
|
className: "flex justify-center items-center z-10",
|
|
651
630
|
style: {
|
|
652
631
|
background: bottom,
|
|
@@ -673,30 +652,25 @@ var FunRoundButton = function(param) {
|
|
|
673
652
|
children: children
|
|
674
653
|
})
|
|
675
654
|
});
|
|
676
|
-
};
|
|
655
|
+
}, "FunRoundButton");
|
|
677
656
|
var FunRoundButton_default = FunRoundButton;
|
|
678
|
-
|
|
679
|
-
import { useMemo as useMemo3 } from "react";
|
|
680
|
-
import { useField } from "formik";
|
|
681
|
-
import clsx3 from "clsx";
|
|
682
|
-
import { jsx as jsx14, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
683
|
-
var Checkbox = function(param) {
|
|
657
|
+
var Checkbox = /* @__PURE__ */ __name(function(param) {
|
|
684
658
|
var name = param.name, labelText = param.labelText, isLarge = param.isLarge, onChange = param.onChange, isDisabled = param.isDisabled;
|
|
685
659
|
var _useField = _sliced_to_array(useField(name), 3), value = _useField[0].value, error = _useField[1].error, _useField_ = _useField[2], setValue = _useField_.setValue, setTouched = _useField_.setTouched;
|
|
686
|
-
var onCheck = function(e) {
|
|
660
|
+
var onCheck = /* @__PURE__ */ __name(function(e) {
|
|
687
661
|
setTouched(true);
|
|
688
662
|
setValue(!value, true);
|
|
689
|
-
};
|
|
690
|
-
var rand =
|
|
663
|
+
}, "onCheck");
|
|
664
|
+
var rand = useMemo(function() {
|
|
691
665
|
return Math.random();
|
|
692
666
|
}, []);
|
|
693
|
-
return /* @__PURE__ */
|
|
667
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
694
668
|
className: "relative flex flex-col justify-center items-center",
|
|
695
669
|
children: [
|
|
696
|
-
/* @__PURE__ */
|
|
670
|
+
/* @__PURE__ */ jsxs("div", {
|
|
697
671
|
className: "flex items-center",
|
|
698
672
|
children: [
|
|
699
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ jsx("input", {
|
|
700
674
|
disabled: !!isDisabled,
|
|
701
675
|
onChange: function(e) {
|
|
702
676
|
onCheck(e);
|
|
@@ -707,30 +681,30 @@ var Checkbox = function(param) {
|
|
|
707
681
|
name: name,
|
|
708
682
|
type: "checkbox",
|
|
709
683
|
checked: !!value,
|
|
710
|
-
className:
|
|
684
|
+
className: clsx("form-checkbox text-blue-600 focus:ring-blue-500 border-gray-300 rounded", isLarge ? "h-5 w-5" : "h-4 w-4")
|
|
711
685
|
}),
|
|
712
|
-
typeof labelText === "string" ? /* @__PURE__ */
|
|
686
|
+
typeof labelText === "string" ? /* @__PURE__ */ jsx("label", {
|
|
713
687
|
htmlFor: "".concat(name).concat(rand),
|
|
714
688
|
className: "ml-2 block text-sm text-gray-800 dark:text-gray-200",
|
|
715
689
|
children: labelText
|
|
716
|
-
}) : /* @__PURE__ */
|
|
690
|
+
}) : /* @__PURE__ */ jsx("label", {
|
|
717
691
|
htmlFor: "".concat(name).concat(rand),
|
|
718
692
|
children: labelText
|
|
719
693
|
})
|
|
720
694
|
]
|
|
721
695
|
}),
|
|
722
|
-
error && /* @__PURE__ */
|
|
696
|
+
error && /* @__PURE__ */ jsx(ErrorText_default, {
|
|
723
697
|
classNames: "absolute w-64 left-6 top-4 text-xs text-red-500",
|
|
724
698
|
text: error
|
|
725
699
|
})
|
|
726
700
|
]
|
|
727
701
|
});
|
|
728
|
-
};
|
|
729
|
-
var MultiChoiceCheckBox = function(param) {
|
|
702
|
+
}, "Checkbox");
|
|
703
|
+
var MultiChoiceCheckBox = /* @__PURE__ */ __name(function(param) {
|
|
730
704
|
var name = param.name, hasMultipleAnswers = param.hasMultipleAnswers, index = param.index, isLarge = param.isLarge, allOptionsName = param.allOptionsName;
|
|
731
705
|
var _useField = _sliced_to_array(useField(name), 3), value = _useField[0].value, ref = _object_destructuring_empty(_useField[1]), _useField_ = _useField[2], setValue = _useField_.setValue, setTouched = _useField_.setTouched;
|
|
732
706
|
var _useField1 = _sliced_to_array(useField(allOptionsName), 3), _useField_1 = _useField1[0], optionsValue = _useField_1.value, _useField_2 = _useField1[2], setOptionsValue = _useField_2.setValue;
|
|
733
|
-
var onCheck = function(e) {
|
|
707
|
+
var onCheck = /* @__PURE__ */ __name(function(e) {
|
|
734
708
|
setTouched(true);
|
|
735
709
|
if (hasMultipleAnswers) {
|
|
736
710
|
setValue(!value);
|
|
@@ -743,12 +717,12 @@ var MultiChoiceCheckBox = function(param) {
|
|
|
743
717
|
isCorrectAnswer: index === idx ? !el.isCorrectAnswer : false
|
|
744
718
|
};
|
|
745
719
|
}));
|
|
746
|
-
};
|
|
747
|
-
return /* @__PURE__ */
|
|
720
|
+
}, "onCheck");
|
|
721
|
+
return /* @__PURE__ */ jsx("div", {
|
|
748
722
|
className: "flex flex-col justify-center items-center",
|
|
749
|
-
children: /* @__PURE__ */
|
|
723
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
750
724
|
className: "flex items-center",
|
|
751
|
-
children: /* @__PURE__ */
|
|
725
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
752
726
|
onChange: function(e) {
|
|
753
727
|
return onCheck(e);
|
|
754
728
|
},
|
|
@@ -757,24 +731,20 @@ var MultiChoiceCheckBox = function(param) {
|
|
|
757
731
|
id: name,
|
|
758
732
|
name: name,
|
|
759
733
|
type: "checkbox",
|
|
760
|
-
className:
|
|
734
|
+
className: clsx("form-checkbox text-blue-600 focus:ring-blue-500 border-gray-300 rounded", isLarge ? "h-5 w-5" : "h-4 w-4")
|
|
761
735
|
})
|
|
762
736
|
})
|
|
763
737
|
});
|
|
764
|
-
};
|
|
738
|
+
}, "MultiChoiceCheckBox");
|
|
765
739
|
Checkbox.Multi = MultiChoiceCheckBox;
|
|
766
740
|
var Checkbox_default = Checkbox;
|
|
767
|
-
|
|
768
|
-
import clsx4 from "clsx";
|
|
769
|
-
import { useField as useField2 } from "formik";
|
|
770
|
-
import { jsx as jsx15, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
771
|
-
var RadioOption = function(param) {
|
|
741
|
+
var RadioOption = /* @__PURE__ */ __name(function(param) {
|
|
772
742
|
var name = param.name, isLarge = param.isLarge, labelText = param.labelText, option = param.option, onSelect = param.onSelect;
|
|
773
|
-
var
|
|
774
|
-
return /* @__PURE__ */
|
|
743
|
+
var _useField = _sliced_to_array(useField(name), 3), value = _useField[0].value, ref = _object_destructuring_empty(_useField[1]), setValue = _useField[2].setValue;
|
|
744
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
775
745
|
className: "flex items-center",
|
|
776
746
|
children: [
|
|
777
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ jsx("input", {
|
|
778
748
|
onChange: function() {
|
|
779
749
|
setValue(option);
|
|
780
750
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
@@ -784,55 +754,52 @@ var RadioOption = function(param) {
|
|
|
784
754
|
name: name,
|
|
785
755
|
type: "checkbox",
|
|
786
756
|
checked: value === option,
|
|
787
|
-
className:
|
|
757
|
+
className: clsx("form-checkbox text-blue-600 focus:ring-blue-500 border-gray-300 rounded", isLarge ? "h-5 w-5" : "h-4 w-4")
|
|
788
758
|
}),
|
|
789
|
-
typeof labelText === "string" ? /* @__PURE__ */
|
|
759
|
+
typeof labelText === "string" ? /* @__PURE__ */ jsx("label", {
|
|
790
760
|
htmlFor: option,
|
|
791
761
|
className: "ml-2 block text-sm text-gray-900",
|
|
792
762
|
children: labelText
|
|
793
|
-
}) : /* @__PURE__ */
|
|
763
|
+
}) : /* @__PURE__ */ jsx("label", {
|
|
794
764
|
htmlFor: option,
|
|
795
765
|
children: labelText
|
|
796
766
|
})
|
|
797
767
|
]
|
|
798
768
|
});
|
|
799
|
-
};
|
|
769
|
+
}, "RadioOption");
|
|
800
770
|
var RadioOption_default = RadioOption;
|
|
801
|
-
|
|
802
|
-
import ReactDOM2 from "react-dom";
|
|
803
|
-
import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
804
|
-
var BottomAlert = function(param) {
|
|
771
|
+
var BottomAlert = /* @__PURE__ */ __name(function(param) {
|
|
805
772
|
var isDark = param.isDark, setDontShowAgain = param.setDontShowAgain, dontShowAgain = param.dontShowAgain, title = param.title, borderColor = param.borderColor, onDismissed = param.onDismissed, cancelText = param.cancelText, confirmText = param.confirmText, onConfirm = param.onConfirm, onCancel = param.onCancel, isSingleAction = param.isSingleAction, children = param.children, buttonColor = param.buttonColor;
|
|
806
|
-
var dismiss = function() {
|
|
773
|
+
var dismiss = /* @__PURE__ */ __name(function() {
|
|
807
774
|
onDismissed === null || onDismissed === void 0 ? void 0 : onDismissed();
|
|
808
|
-
};
|
|
809
|
-
return /* @__PURE__ */
|
|
775
|
+
}, "dismiss");
|
|
776
|
+
return /* @__PURE__ */ jsx("div", {
|
|
810
777
|
className: "top-0 left-0 fixed w-full h-screen flex justify-center",
|
|
811
778
|
style: {
|
|
812
779
|
background: isDark ? "rgba(0, 0, 0, 0.1)" : "rgba(255, 255, 255, 0.1)",
|
|
813
780
|
zIndex: 9999
|
|
814
781
|
},
|
|
815
|
-
children: /* @__PURE__ */
|
|
782
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
816
783
|
className: "absolute top-0 w-full h-screen flex justify-center bg-gray-200/90 dark:bg-slate-800/50",
|
|
817
|
-
children: /* @__PURE__ */
|
|
784
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
818
785
|
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",
|
|
819
|
-
children: /* @__PURE__ */
|
|
786
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
820
787
|
style: {
|
|
821
788
|
borderColor: borderColor || "#0ea5e9"
|
|
822
789
|
},
|
|
823
790
|
children: [
|
|
824
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ jsx("h3", {
|
|
825
792
|
className: "font-semibold font-header text-gray-700 dark:text-gray-300 text-xl",
|
|
826
793
|
children: title
|
|
827
794
|
}),
|
|
828
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ jsx("div", {
|
|
829
796
|
className: "mt-2 text-lg",
|
|
830
797
|
children: children
|
|
831
798
|
}),
|
|
832
|
-
setDontShowAgain ? /* @__PURE__ */
|
|
799
|
+
setDontShowAgain ? /* @__PURE__ */ jsxs("div", {
|
|
833
800
|
className: "flex items-center space-x-1",
|
|
834
801
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ jsx("input", {
|
|
836
803
|
onChange: function() {
|
|
837
804
|
setDontShowAgain(function(s) {
|
|
838
805
|
return !s;
|
|
@@ -843,16 +810,16 @@ var BottomAlert = function(param) {
|
|
|
843
810
|
type: "checkbox",
|
|
844
811
|
className: "form-checkbox text-blue-600 focus:ring-blue-500 border-gray-300 rounded h-4 w-4"
|
|
845
812
|
}),
|
|
846
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ jsx("label", {
|
|
847
814
|
htmlFor: "show_again_check",
|
|
848
815
|
className: "dark:text-gray-200 text-gray-700",
|
|
849
816
|
children: "Don't show again"
|
|
850
817
|
})
|
|
851
818
|
]
|
|
852
819
|
}) : null,
|
|
853
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ jsx("div", {
|
|
854
821
|
className: "mt-4 flex items-center justify-end space-x-4 z-10",
|
|
855
|
-
children: isSingleAction ? /* @__PURE__ */
|
|
822
|
+
children: isSingleAction ? /* @__PURE__ */ jsx(Button_default, {
|
|
856
823
|
type: "button",
|
|
857
824
|
kind: buttonColor,
|
|
858
825
|
onClick: function() {
|
|
@@ -860,12 +827,12 @@ var BottomAlert = function(param) {
|
|
|
860
827
|
dismiss();
|
|
861
828
|
},
|
|
862
829
|
children: confirmText || "Okay"
|
|
863
|
-
}) : /* @__PURE__ */
|
|
830
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
864
831
|
className: "w-1/3 flex justify-end space-x-4",
|
|
865
832
|
children: [
|
|
866
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ jsx("div", {
|
|
867
834
|
className: "w-full flex flex-col",
|
|
868
|
-
children: /* @__PURE__ */
|
|
835
|
+
children: /* @__PURE__ */ jsx(Button_default, {
|
|
869
836
|
type: "button",
|
|
870
837
|
kind: "secondary",
|
|
871
838
|
onClick: function() {
|
|
@@ -875,9 +842,9 @@ var BottomAlert = function(param) {
|
|
|
875
842
|
children: cancelText || "Cancel"
|
|
876
843
|
})
|
|
877
844
|
}),
|
|
878
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ jsx("div", {
|
|
879
846
|
className: "w-full flex flex-col",
|
|
880
|
-
children: /* @__PURE__ */
|
|
847
|
+
children: /* @__PURE__ */ jsx(Button_default, {
|
|
881
848
|
type: "button",
|
|
882
849
|
kind: buttonColor,
|
|
883
850
|
onClick: function() {
|
|
@@ -895,24 +862,17 @@ var BottomAlert = function(param) {
|
|
|
895
862
|
})
|
|
896
863
|
})
|
|
897
864
|
});
|
|
898
|
-
};
|
|
899
|
-
var BAWrapper = function(props) {
|
|
865
|
+
}, "BottomAlert");
|
|
866
|
+
var BAWrapper = /* @__PURE__ */ __name(function(props) {
|
|
900
867
|
if (!props.isVisible) return null;
|
|
901
|
-
return
|
|
902
|
-
};
|
|
868
|
+
return ReactDOM.createPortal(/* @__PURE__ */ jsx(BottomAlert, _object_spread({}, props)), document.body);
|
|
869
|
+
}, "BAWrapper");
|
|
903
870
|
var BottomAlert_default = BAWrapper;
|
|
904
|
-
|
|
905
|
-
import clsx6 from "clsx";
|
|
906
|
-
// src/Common/Tippy.tsx
|
|
907
|
-
import { useState as useState2, useRef, useEffect as useEffect2 } from "react";
|
|
908
|
-
import { useFloating, useInteractions, useHover, useRole, useDismiss, offset, flip, shift, arrow, FloatingArrow, FloatingPortal } from "@floating-ui/react";
|
|
909
|
-
import clsx5 from "clsx";
|
|
910
|
-
import { Fragment, jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
911
|
-
var Tippy = function(param) {
|
|
871
|
+
var Tippy = /* @__PURE__ */ __name(function(param) {
|
|
912
872
|
var children = param.children, content = param.content, _param_placement = param.placement, placement = _param_placement === void 0 ? "top" : _param_placement, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_wrapperClassname = param.wrapperClassname, wrapperClassname = _param_wrapperClassname === void 0 ? "" : _param_wrapperClassname, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, tmp = param.arrow, useArrow = tmp === void 0 ? false : tmp, visible = param.visible;
|
|
913
|
-
var
|
|
873
|
+
var _useState = _sliced_to_array(useState(false), 2), isOpen = _useState[0], setIsOpen = _useState[1];
|
|
914
874
|
var arrowRef = useRef(null);
|
|
915
|
-
|
|
875
|
+
useEffect(function() {
|
|
916
876
|
if (visible) {
|
|
917
877
|
setIsOpen(true);
|
|
918
878
|
}
|
|
@@ -942,13 +902,13 @@ var Tippy = function(param) {
|
|
|
942
902
|
dismiss,
|
|
943
903
|
role
|
|
944
904
|
]), getReferenceProps = _useInteractions.getReferenceProps, getFloatingProps = _useInteractions.getFloatingProps;
|
|
945
|
-
return /* @__PURE__ */
|
|
905
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
946
906
|
children: [
|
|
947
|
-
isOpen && /* @__PURE__ */
|
|
907
|
+
isOpen && /* @__PURE__ */ jsxs(FloatingPortal, {
|
|
948
908
|
children: [
|
|
949
|
-
/* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ jsx("div", _object_spread_props(_object_spread({
|
|
950
910
|
ref: refs.setFloating,
|
|
951
|
-
className:
|
|
911
|
+
className: clsx("".concat(className || tippyClassname))
|
|
952
912
|
}, getFloatingProps()), {
|
|
953
913
|
style: {
|
|
954
914
|
position: strategy,
|
|
@@ -959,7 +919,7 @@ var Tippy = function(param) {
|
|
|
959
919
|
},
|
|
960
920
|
children: content
|
|
961
921
|
})),
|
|
962
|
-
useArrow && /* @__PURE__ */
|
|
922
|
+
useArrow && /* @__PURE__ */ jsx(FloatingArrow, {
|
|
963
923
|
ref: arrowRef,
|
|
964
924
|
context: context,
|
|
965
925
|
className: "fill-gray-900",
|
|
@@ -967,7 +927,7 @@ var Tippy = function(param) {
|
|
|
967
927
|
})
|
|
968
928
|
]
|
|
969
929
|
}),
|
|
970
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ jsx("div", _object_spread_props(_object_spread({
|
|
971
931
|
ref: refs.setReference
|
|
972
932
|
}, getReferenceProps()), {
|
|
973
933
|
className: wrapperClassname,
|
|
@@ -975,52 +935,45 @@ var Tippy = function(param) {
|
|
|
975
935
|
}))
|
|
976
936
|
]
|
|
977
937
|
});
|
|
978
|
-
};
|
|
938
|
+
}, "Tippy");
|
|
979
939
|
var Tippy_default = Tippy;
|
|
980
|
-
|
|
981
|
-
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
982
|
-
var IconInfo = function(param) {
|
|
940
|
+
var IconInfo = /* @__PURE__ */ __name(function(param) {
|
|
983
941
|
var content = param.content, icon = param.icon, number = param.number, color = param.color;
|
|
984
|
-
return /* @__PURE__ */
|
|
942
|
+
return /* @__PURE__ */ jsx("div", {
|
|
985
943
|
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",
|
|
986
|
-
children: /* @__PURE__ */
|
|
944
|
+
children: /* @__PURE__ */ jsx(Tippy_default, {
|
|
987
945
|
className: tippyClassname,
|
|
988
946
|
content: content,
|
|
989
|
-
children: /* @__PURE__ */
|
|
947
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
990
948
|
className: "relative",
|
|
991
949
|
children: [
|
|
992
950
|
icon,
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
className:
|
|
951
|
+
/* @__PURE__ */ jsx("p", {
|
|
952
|
+
className: clsx("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"),
|
|
995
953
|
children: number
|
|
996
954
|
})
|
|
997
955
|
]
|
|
998
956
|
})
|
|
999
957
|
})
|
|
1000
958
|
});
|
|
1001
|
-
};
|
|
959
|
+
}, "IconInfo");
|
|
1002
960
|
var IconInfo_default = IconInfo;
|
|
1003
|
-
|
|
1004
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1005
|
-
var XIcon = function(param) {
|
|
961
|
+
var XIcon = /* @__PURE__ */ __name(function(param) {
|
|
1006
962
|
var className = param.className;
|
|
1007
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
1008
964
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1009
965
|
className: className || "h-5 w-5",
|
|
1010
966
|
viewBox: "0 0 20 20",
|
|
1011
967
|
fill: "currentColor",
|
|
1012
|
-
children: /* @__PURE__ */
|
|
968
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
1013
969
|
fillRule: "evenodd",
|
|
1014
970
|
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",
|
|
1015
971
|
clipRule: "evenodd"
|
|
1016
972
|
})
|
|
1017
973
|
});
|
|
1018
|
-
};
|
|
974
|
+
}, "XIcon");
|
|
1019
975
|
var XIcon_default = XIcon;
|
|
1020
|
-
|
|
1021
|
-
import clsx7 from "clsx";
|
|
1022
|
-
import { jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1023
|
-
var Modal = function(_param) {
|
|
976
|
+
var Modal = /* @__PURE__ */ __name(function(_param) {
|
|
1024
977
|
var visible = _param.visible, children = _param.children, fullscreen = _param.fullscreen, displayDark = _param.displayDark, dismissLink = _param.dismissLink, bgOpacity = _param.bgOpacity, onDismissed = _param.onDismissed, _param_dismissable = _param.dismissable, dismissable = _param_dismissable === void 0 ? true : _param_dismissable, _param_dismissOnBackdropClick = _param.dismissOnBackdropClick, dismissOnBackdropClick = _param_dismissOnBackdropClick === void 0 ? true : _param_dismissOnBackdropClick, style = _param.style, props = _object_without_properties(_param, [
|
|
1025
978
|
"visible",
|
|
1026
979
|
"children",
|
|
@@ -1034,37 +987,37 @@ var Modal = function(_param) {
|
|
|
1034
987
|
"style"
|
|
1035
988
|
]);
|
|
1036
989
|
if (!visible) return null;
|
|
1037
|
-
return /* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ jsx(Overlay_default, _object_spread_props(_object_spread({
|
|
1038
991
|
visible: visible,
|
|
1039
992
|
onClick: dismissOnBackdropClick ? onDismissed : void 0,
|
|
1040
993
|
isDark: displayDark,
|
|
1041
994
|
withContainer: true
|
|
1042
995
|
}, props), {
|
|
1043
|
-
children: /* @__PURE__ */
|
|
1044
|
-
className:
|
|
996
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
997
|
+
className: clsx(displayDark && "dark", "bg-slate-900/20 fixed inset-0 flex items-center justify-center"),
|
|
1045
998
|
style: {
|
|
1046
999
|
zIndex: 1e4
|
|
1047
1000
|
},
|
|
1048
|
-
children: /* @__PURE__ */
|
|
1049
|
-
className:
|
|
1001
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1002
|
+
className: clsx("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"),
|
|
1050
1003
|
children: [
|
|
1051
|
-
dismissLink ? /* @__PURE__ */
|
|
1004
|
+
dismissLink ? /* @__PURE__ */ jsx("a", {
|
|
1052
1005
|
href: dismissLink,
|
|
1053
|
-
children: /* @__PURE__ */
|
|
1006
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1054
1007
|
onClick: onDismissed,
|
|
1055
|
-
children: /* @__PURE__ */
|
|
1008
|
+
children: /* @__PURE__ */ jsx(XIcon_default, {
|
|
1056
1009
|
className: "absolute h-5 w-5 top-4 sm:top-8 right-4 transition-colors cursor-pointer duration-75 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500"
|
|
1057
1010
|
})
|
|
1058
1011
|
})
|
|
1059
|
-
}) : dismissable ? /* @__PURE__ */
|
|
1012
|
+
}) : dismissable ? /* @__PURE__ */ jsx("button", {
|
|
1060
1013
|
className: "absolute top-4 sm:top-8 right-4 transition-colors cursor-pointer duration-75 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500",
|
|
1061
1014
|
type: "button",
|
|
1062
1015
|
onClick: onDismissed,
|
|
1063
|
-
children: /* @__PURE__ */
|
|
1016
|
+
children: /* @__PURE__ */ jsx(XIcon_default, {
|
|
1064
1017
|
className: "h-5 w-5"
|
|
1065
1018
|
})
|
|
1066
1019
|
}) : null,
|
|
1067
|
-
/* @__PURE__ */
|
|
1020
|
+
/* @__PURE__ */ jsx("div", {
|
|
1068
1021
|
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",
|
|
1069
1022
|
onClick: function(e) {
|
|
1070
1023
|
return e.stopPropagation();
|
|
@@ -1072,9 +1025,9 @@ var Modal = function(_param) {
|
|
|
1072
1025
|
style: _object_spread({
|
|
1073
1026
|
maxHeight: "calc(100vh - 6rem)"
|
|
1074
1027
|
}, style),
|
|
1075
|
-
children: /* @__PURE__ */
|
|
1028
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1076
1029
|
className: "p-4 sm:p-10",
|
|
1077
|
-
children: /* @__PURE__ */
|
|
1030
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1078
1031
|
className: "mt-8 sm:mt-0",
|
|
1079
1032
|
children: children
|
|
1080
1033
|
})
|
|
@@ -1084,15 +1037,12 @@ var Modal = function(_param) {
|
|
|
1084
1037
|
})
|
|
1085
1038
|
})
|
|
1086
1039
|
}));
|
|
1087
|
-
};
|
|
1040
|
+
}, "Modal");
|
|
1088
1041
|
var Modal_default = Modal;
|
|
1089
|
-
|
|
1090
|
-
import { useEffect as useEffect3, useMemo as useMemo4, useState as useState3 } from "react";
|
|
1091
|
-
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1092
|
-
var NoticeBox = function(param) {
|
|
1042
|
+
var NoticeBox = /* @__PURE__ */ __name(function(param) {
|
|
1093
1043
|
var children = param.children, type = param.type, isDismissible = param.isDismissible, isVisible = param.isVisible, onDismiss = param.onDismiss;
|
|
1094
|
-
var
|
|
1095
|
-
var styles =
|
|
1044
|
+
var _useState = _sliced_to_array(useState(true), 2), visible = _useState[0], setVisible = _useState[1];
|
|
1045
|
+
var styles = useMemo(function() {
|
|
1096
1046
|
var base = "relative text-base rounded-md p-2 ";
|
|
1097
1047
|
if (!visible) return "hidden";
|
|
1098
1048
|
switch(type){
|
|
@@ -1109,21 +1059,21 @@ var NoticeBox = function(param) {
|
|
|
1109
1059
|
type,
|
|
1110
1060
|
visible
|
|
1111
1061
|
]);
|
|
1112
|
-
|
|
1062
|
+
useEffect(function() {
|
|
1113
1063
|
setVisible(isVisible);
|
|
1114
1064
|
}, [
|
|
1115
1065
|
isVisible
|
|
1116
1066
|
]);
|
|
1117
1067
|
if (!isVisible) return null;
|
|
1118
|
-
return /* @__PURE__ */
|
|
1068
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1119
1069
|
style: {
|
|
1120
1070
|
zIndex: 100
|
|
1121
1071
|
},
|
|
1122
1072
|
className: styles,
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1073
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1124
1074
|
className: "relative",
|
|
1125
1075
|
children: [
|
|
1126
|
-
isDismissible && /* @__PURE__ */
|
|
1076
|
+
isDismissible && /* @__PURE__ */ jsx("button", {
|
|
1127
1077
|
type: "button",
|
|
1128
1078
|
onClick: function() {
|
|
1129
1079
|
setVisible(function(s) {
|
|
@@ -1132,7 +1082,7 @@ var NoticeBox = function(param) {
|
|
|
1132
1082
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
1133
1083
|
},
|
|
1134
1084
|
className: "absolute bottom-1 right-1 transition-colors cursor-pointer duration-75 hover:text-blue-500",
|
|
1135
|
-
children: /* @__PURE__ */
|
|
1085
|
+
children: /* @__PURE__ */ jsx(XIcon_default, {
|
|
1136
1086
|
className: "h-5 w-5"
|
|
1137
1087
|
})
|
|
1138
1088
|
}),
|
|
@@ -1140,59 +1090,53 @@ var NoticeBox = function(param) {
|
|
|
1140
1090
|
]
|
|
1141
1091
|
})
|
|
1142
1092
|
});
|
|
1143
|
-
};
|
|
1093
|
+
}, "NoticeBox");
|
|
1144
1094
|
var NoticeBox_default = NoticeBox;
|
|
1145
|
-
|
|
1146
|
-
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1147
|
-
var StarIcon = function(param) {
|
|
1095
|
+
var StarIcon = /* @__PURE__ */ __name(function(param) {
|
|
1148
1096
|
var className = param.className, percentage = param.percentage, color = param.color;
|
|
1149
|
-
return /* @__PURE__ */
|
|
1097
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
1150
1098
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1151
1099
|
className: className || "h-5 w-5",
|
|
1152
1100
|
viewBox: "0 0 20 20",
|
|
1153
1101
|
fill: "currentColor",
|
|
1154
1102
|
children: [
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
children: /* @__PURE__ */
|
|
1103
|
+
/* @__PURE__ */ jsx("defs", {
|
|
1104
|
+
children: /* @__PURE__ */ jsxs("linearGradient", {
|
|
1157
1105
|
id: "grad",
|
|
1158
1106
|
children: [
|
|
1159
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ jsx("stop", {
|
|
1160
1108
|
offset: "".concat((percentage || 0.5) * 100, "%"),
|
|
1161
1109
|
"stop-color": color ? color : "#4b5563"
|
|
1162
1110
|
}),
|
|
1163
|
-
/* @__PURE__ */
|
|
1111
|
+
/* @__PURE__ */ jsx("stop", {
|
|
1164
1112
|
offset: "".concat(100 - (percentage || 0.5) * 100, "%"),
|
|
1165
1113
|
"stop-color": "white"
|
|
1166
1114
|
})
|
|
1167
1115
|
]
|
|
1168
1116
|
})
|
|
1169
1117
|
}),
|
|
1170
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ jsx("path", {
|
|
1171
1119
|
fill: "url(#grad)",
|
|
1172
1120
|
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"
|
|
1173
1121
|
})
|
|
1174
1122
|
]
|
|
1175
1123
|
});
|
|
1176
|
-
};
|
|
1124
|
+
}, "StarIcon");
|
|
1177
1125
|
var StarIcon_default = StarIcon;
|
|
1178
|
-
|
|
1179
|
-
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1180
|
-
var StartIconSolid = function(param) {
|
|
1126
|
+
var StartIconSolid = /* @__PURE__ */ __name(function(param) {
|
|
1181
1127
|
var className = param.className;
|
|
1182
|
-
return /* @__PURE__ */
|
|
1128
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
1183
1129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1184
1130
|
className: className || "h-5 w-5",
|
|
1185
1131
|
viewBox: "0 0 20 20",
|
|
1186
1132
|
fill: "currentColor",
|
|
1187
|
-
children: /* @__PURE__ */
|
|
1133
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
1188
1134
|
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"
|
|
1189
1135
|
})
|
|
1190
1136
|
});
|
|
1191
|
-
};
|
|
1137
|
+
}, "StartIconSolid");
|
|
1192
1138
|
var StarIconSolid_default = StartIconSolid;
|
|
1193
|
-
|
|
1194
|
-
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1195
|
-
var RatingStars = function(param) {
|
|
1139
|
+
var RatingStars = /* @__PURE__ */ __name(function(param) {
|
|
1196
1140
|
var avgRating = param.avgRating, large = param.large;
|
|
1197
1141
|
var icons = [
|
|
1198
1142
|
1,
|
|
@@ -1202,52 +1146,48 @@ var RatingStars = function(param) {
|
|
|
1202
1146
|
5
|
|
1203
1147
|
].map(function(el) {
|
|
1204
1148
|
if (avgRating === 0) {
|
|
1205
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ jsx(StarIconSolid_default, {
|
|
1206
1150
|
className: "".concat(large ? "h-5 w-5" : "h-3 w-3", " text-gray-200 dark:text-gray-400")
|
|
1207
1151
|
}, "rating_star_".concat(el));
|
|
1208
1152
|
}
|
|
1209
1153
|
if (Number.isInteger(avgRating)) {
|
|
1210
1154
|
if (el <= avgRating) {
|
|
1211
|
-
return /* @__PURE__ */
|
|
1155
|
+
return /* @__PURE__ */ jsx(StarIconSolid_default, {
|
|
1212
1156
|
className: "".concat(large ? "h-5 w-5" : "h-3 w-3", " text-blue-500")
|
|
1213
1157
|
}, "rating_star_".concat(el));
|
|
1214
1158
|
}
|
|
1215
|
-
return /* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ jsx(StarIconSolid_default, {
|
|
1216
1160
|
className: "".concat(large ? "h-5 w-5" : "h-3 w-3", " text-gray-200 dark:text-gray-400")
|
|
1217
1161
|
}, "rating_star_".concat(el));
|
|
1218
1162
|
}
|
|
1219
1163
|
var whole = Math.floor(avgRating);
|
|
1220
1164
|
if (el <= whole) {
|
|
1221
|
-
return /* @__PURE__ */
|
|
1165
|
+
return /* @__PURE__ */ jsx(StarIconSolid_default, {
|
|
1222
1166
|
className: "".concat(large ? "h-5 w-5" : "h-3 w-3", " text-blue-500")
|
|
1223
1167
|
}, "rating_star_".concat(el));
|
|
1224
1168
|
}
|
|
1225
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ jsx(StarIcon_default, {
|
|
1226
1170
|
percentage: avgRating - whole,
|
|
1227
1171
|
color: "#00b4d8",
|
|
1228
1172
|
className: "".concat(large ? "h-5 w-5" : "h-3 w-3")
|
|
1229
1173
|
}, "rating_star_".concat(el));
|
|
1230
1174
|
});
|
|
1231
|
-
return /* @__PURE__ */
|
|
1175
|
+
return /* @__PURE__ */ jsx(Tippy_default, {
|
|
1232
1176
|
content: avgRating === 0 ? "No ratings" : "Average Rating " + avgRating,
|
|
1233
1177
|
className: "bg-gray-800 opacity-90 text-white rounded-md px-2 py-1 cursor-pointer h-fit",
|
|
1234
|
-
children: /* @__PURE__ */
|
|
1178
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1235
1179
|
className: "flex items-center space-x-0 justify-start",
|
|
1236
1180
|
children: icons
|
|
1237
1181
|
})
|
|
1238
1182
|
});
|
|
1239
|
-
};
|
|
1183
|
+
}, "RatingStars");
|
|
1240
1184
|
var RatingStars_default = RatingStars;
|
|
1241
|
-
|
|
1242
|
-
import { useState as useState4 } from "react";
|
|
1243
|
-
import { useDebouncedCallback } from "use-debounce";
|
|
1244
|
-
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1245
|
-
var Slider = function(param) {
|
|
1185
|
+
var Slider = /* @__PURE__ */ __name(function(param) {
|
|
1246
1186
|
var min = param.min, max = param.max, step = param.step, value = param.value, onChange = param.onChange;
|
|
1247
|
-
var handleChange = function(event) {
|
|
1187
|
+
var handleChange = /* @__PURE__ */ __name(function(event) {
|
|
1248
1188
|
onChange(parseFloat(event.target.value));
|
|
1249
|
-
};
|
|
1250
|
-
return /* @__PURE__ */
|
|
1189
|
+
}, "handleChange");
|
|
1190
|
+
return /* @__PURE__ */ jsx("input", {
|
|
1251
1191
|
type: "range",
|
|
1252
1192
|
min: min,
|
|
1253
1193
|
max: max,
|
|
@@ -1256,17 +1196,17 @@ var Slider = function(param) {
|
|
|
1256
1196
|
onChange: handleChange,
|
|
1257
1197
|
className: "w-full h-2 rounded-lg range-input"
|
|
1258
1198
|
});
|
|
1259
|
-
};
|
|
1260
|
-
var DebouncedSlider = function(param) {
|
|
1199
|
+
}, "Slider");
|
|
1200
|
+
var DebouncedSlider = /* @__PURE__ */ __name(function(param) {
|
|
1261
1201
|
var min = param.min, max = param.max, handleUpdate = param.handleUpdate, initialValue = param.initialValue;
|
|
1262
|
-
var
|
|
1202
|
+
var _useState = _sliced_to_array(useState(initialValue), 2), value = _useState[0], setValue = _useState[1];
|
|
1263
1203
|
var debouncedUpdate = useDebouncedCallback(function(v) {
|
|
1264
1204
|
handleUpdate(v);
|
|
1265
1205
|
}, 120, {
|
|
1266
1206
|
trailing: true,
|
|
1267
1207
|
leading: false
|
|
1268
1208
|
});
|
|
1269
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ jsx(Slider, {
|
|
1270
1210
|
min: min,
|
|
1271
1211
|
max: max,
|
|
1272
1212
|
step: 1,
|
|
@@ -1276,35 +1216,30 @@ var DebouncedSlider = function(param) {
|
|
|
1276
1216
|
debouncedUpdate(v);
|
|
1277
1217
|
}
|
|
1278
1218
|
});
|
|
1279
|
-
};
|
|
1219
|
+
}, "DebouncedSlider");
|
|
1280
1220
|
Slider.Debounced = DebouncedSlider;
|
|
1281
1221
|
var Slider_default = Slider;
|
|
1282
|
-
|
|
1283
|
-
import { useField as useField3 } from "formik";
|
|
1284
|
-
import { motion as motion3 } from "framer-motion";
|
|
1285
|
-
import clsx8 from "clsx";
|
|
1286
|
-
import { jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1287
|
-
var Formik = function(param) {
|
|
1222
|
+
var Formik = /* @__PURE__ */ __name(function(param) {
|
|
1288
1223
|
var label = param.label, name = param.name;
|
|
1289
|
-
var
|
|
1290
|
-
var handleChange = function(e) {
|
|
1224
|
+
var _useField = _sliced_to_array(useField(name), 3), value = _useField[0].value, setValue = _useField[2].setValue;
|
|
1225
|
+
var handleChange = /* @__PURE__ */ __name(function(e) {
|
|
1291
1226
|
setValue(e.target.checked);
|
|
1292
|
-
};
|
|
1293
|
-
return /* @__PURE__ */
|
|
1227
|
+
}, "handleChange");
|
|
1228
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
1294
1229
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
1295
1230
|
children: [
|
|
1296
|
-
/* @__PURE__ */
|
|
1231
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1297
1232
|
className: "relative",
|
|
1298
1233
|
children: [
|
|
1299
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ jsx("input", {
|
|
1300
1235
|
type: "checkbox",
|
|
1301
1236
|
className: "opacity-0 absolute",
|
|
1302
1237
|
checked: value,
|
|
1303
1238
|
onChange: handleChange
|
|
1304
1239
|
}),
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
className:
|
|
1307
|
-
children: /* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ jsx("div", {
|
|
1241
|
+
className: clsx("w-10 h-6 rounded-full p-[4px] transition-colors duration-300", value ? "bg-[#00b4d8]" : "bg-[#64748b]"),
|
|
1242
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
1308
1243
|
className: "w-4 h-4 bg-white rounded-full absolute top-1",
|
|
1309
1244
|
initial: false,
|
|
1310
1245
|
animate: {
|
|
@@ -1319,33 +1254,33 @@ var Formik = function(param) {
|
|
|
1319
1254
|
})
|
|
1320
1255
|
]
|
|
1321
1256
|
}),
|
|
1322
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ jsx("span", {
|
|
1323
1258
|
className: "text-sm font-medium text-gray-800 dark:text-gray-200",
|
|
1324
1259
|
children: label
|
|
1325
1260
|
})
|
|
1326
1261
|
]
|
|
1327
1262
|
});
|
|
1328
|
-
};
|
|
1329
|
-
var ToggleSwitch = function(param) {
|
|
1263
|
+
}, "Formik");
|
|
1264
|
+
var ToggleSwitch = /* @__PURE__ */ __name(function(param) {
|
|
1330
1265
|
var label = param.label, onChange = param.onChange, value = param.value;
|
|
1331
|
-
var handleChange = function(e) {
|
|
1266
|
+
var handleChange = /* @__PURE__ */ __name(function(e) {
|
|
1332
1267
|
onChange(e.target.checked);
|
|
1333
|
-
};
|
|
1334
|
-
return /* @__PURE__ */
|
|
1268
|
+
}, "handleChange");
|
|
1269
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
1335
1270
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
1336
1271
|
children: [
|
|
1337
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1338
1273
|
className: "relative",
|
|
1339
1274
|
children: [
|
|
1340
|
-
/* @__PURE__ */
|
|
1275
|
+
/* @__PURE__ */ jsx("input", {
|
|
1341
1276
|
type: "checkbox",
|
|
1342
1277
|
className: "opacity-0 absolute",
|
|
1343
1278
|
checked: value,
|
|
1344
1279
|
onChange: handleChange
|
|
1345
1280
|
}),
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
className:
|
|
1348
|
-
children: /* @__PURE__ */
|
|
1281
|
+
/* @__PURE__ */ jsx("div", {
|
|
1282
|
+
className: clsx("w-10 h-6 rounded-full p-[4px] transition-colors duration-300", value ? "bg-[#00b4d8]" : "bg-[#64748b]"),
|
|
1283
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
1349
1284
|
className: "w-4 h-4 bg-white rounded-full absolute top-1",
|
|
1350
1285
|
initial: false,
|
|
1351
1286
|
animate: {
|
|
@@ -1360,64 +1295,55 @@ var ToggleSwitch = function(param) {
|
|
|
1360
1295
|
})
|
|
1361
1296
|
]
|
|
1362
1297
|
}),
|
|
1363
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ jsx("span", {
|
|
1364
1299
|
className: "text-sm font-medium text-gray-800 dark:text-gray-200",
|
|
1365
1300
|
children: label
|
|
1366
1301
|
})
|
|
1367
1302
|
]
|
|
1368
1303
|
});
|
|
1369
|
-
};
|
|
1304
|
+
}, "ToggleSwitch");
|
|
1370
1305
|
ToggleSwitch.Formik = Formik;
|
|
1371
1306
|
var ToggleSwitch_default = ToggleSwitch;
|
|
1372
|
-
|
|
1373
|
-
import { motion as motion4 } from "framer-motion";
|
|
1374
|
-
// src/Icons/PlusCircleIcon.tsx
|
|
1375
|
-
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1376
|
-
var PlusCircleIcon = function(param) {
|
|
1307
|
+
var PlusCircleIcon = /* @__PURE__ */ __name(function(param) {
|
|
1377
1308
|
var className = param.className;
|
|
1378
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
1379
1310
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1380
1311
|
className: className || "h-5 w-5",
|
|
1381
1312
|
fill: "none",
|
|
1382
1313
|
viewBox: "0 0 24 24",
|
|
1383
1314
|
stroke: "currentColor",
|
|
1384
1315
|
strokeWidth: 2,
|
|
1385
|
-
children: /* @__PURE__ */
|
|
1316
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
1386
1317
|
strokeLinecap: "round",
|
|
1387
1318
|
strokeLinejoin: "round",
|
|
1388
1319
|
d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
1389
1320
|
})
|
|
1390
1321
|
});
|
|
1391
|
-
};
|
|
1322
|
+
}, "PlusCircleIcon");
|
|
1392
1323
|
var PlusCircleIcon_default = PlusCircleIcon;
|
|
1393
|
-
|
|
1394
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1395
|
-
var StartIconSolid2 = function(param) {
|
|
1324
|
+
var StartIconSolid2 = /* @__PURE__ */ __name(function(param) {
|
|
1396
1325
|
var className = param.className;
|
|
1397
|
-
return /* @__PURE__ */
|
|
1326
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
1398
1327
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1399
1328
|
className: className || "h-5 w-5",
|
|
1400
1329
|
fill: "none",
|
|
1401
1330
|
viewBox: "0 0 24 24",
|
|
1402
1331
|
stroke: "currentColor",
|
|
1403
1332
|
strokeWidth: 2,
|
|
1404
|
-
children: /* @__PURE__ */
|
|
1333
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
1405
1334
|
strokeLinecap: "round",
|
|
1406
1335
|
strokeLinejoin: "round",
|
|
1407
1336
|
d: "M13 9l3 3m0 0l-3 3m3-3H8m13 0a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
1408
1337
|
})
|
|
1409
1338
|
});
|
|
1410
|
-
};
|
|
1339
|
+
}, "StartIconSolid");
|
|
1411
1340
|
var ArrowCircleRight_default = StartIconSolid2;
|
|
1412
|
-
|
|
1413
|
-
import clsx9 from "clsx";
|
|
1414
|
-
import { jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1415
|
-
var UserContentSwitcher = function(param) {
|
|
1341
|
+
var UserContentSwitcher = /* @__PURE__ */ __name(function(param) {
|
|
1416
1342
|
var Icon1 = param.icon1, Icon2 = param.icon2, setGalleryMode = param.setGalleryMode, galleryMode = param.galleryMode, title1 = param.title1, title2 = param.title2;
|
|
1417
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1418
1344
|
className: "relative flex flex-row items-center my-2 bg-slate-100 dark:bg-slate-900 w-full h-14 rounded-lg",
|
|
1419
1345
|
children: [
|
|
1420
|
-
/* @__PURE__ */
|
|
1346
|
+
/* @__PURE__ */ jsx(motion.div, {
|
|
1421
1347
|
className: "absolute w-1/2 h-11 rounded-md bg-white dark:bg-slate-600",
|
|
1422
1348
|
animate: {
|
|
1423
1349
|
x: galleryMode === title1.toLowerCase() ? "1%" : "99%"
|
|
@@ -1428,52 +1354,52 @@ var UserContentSwitcher = function(param) {
|
|
|
1428
1354
|
stiffness: 200
|
|
1429
1355
|
}
|
|
1430
1356
|
}),
|
|
1431
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ jsxs("button", {
|
|
1432
1358
|
onClick: function() {
|
|
1433
1359
|
return setGalleryMode(title1.toLowerCase());
|
|
1434
1360
|
},
|
|
1435
1361
|
className: "py-2 flex flex-row w-1/2 justify-center items-center gap-1 z-10",
|
|
1436
1362
|
children: [
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
className:
|
|
1363
|
+
/* @__PURE__ */ jsx("span", {
|
|
1364
|
+
className: clsx("truncate", {
|
|
1439
1365
|
"text-primary dark:text-blue-400": galleryMode === title1.toLowerCase(),
|
|
1440
1366
|
"text-slate-500 dark:text-slate-400 opacity-90": galleryMode !== title1.toLowerCase()
|
|
1441
1367
|
}),
|
|
1442
1368
|
children: title1.toLocaleUpperCase()
|
|
1443
1369
|
}),
|
|
1444
|
-
Icon1 ? /* @__PURE__ */
|
|
1445
|
-
className:
|
|
1370
|
+
Icon1 ? /* @__PURE__ */ jsx(Icon1, {
|
|
1371
|
+
className: clsx("h-5 w-5", {
|
|
1446
1372
|
"text-primary dark:text-blue-400": galleryMode === title1.toLowerCase(),
|
|
1447
1373
|
"text-slate-500 dark:text-slate-400 opacity-90": galleryMode !== title1.toLowerCase()
|
|
1448
1374
|
})
|
|
1449
|
-
}) : /* @__PURE__ */
|
|
1450
|
-
className:
|
|
1375
|
+
}) : /* @__PURE__ */ jsx(PlusCircleIcon_default, {
|
|
1376
|
+
className: clsx("h-5 w-5", {
|
|
1451
1377
|
"text-primary dark:text-blue-400": galleryMode === title1.toLowerCase(),
|
|
1452
1378
|
"text-slate-500 dark:text-slate-400 opacity-90": galleryMode !== title1.toLowerCase()
|
|
1453
1379
|
})
|
|
1454
1380
|
})
|
|
1455
1381
|
]
|
|
1456
1382
|
}),
|
|
1457
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ jsxs("button", {
|
|
1458
1384
|
onClick: function() {
|
|
1459
1385
|
return setGalleryMode(title2.toLowerCase());
|
|
1460
1386
|
},
|
|
1461
1387
|
className: "py-2 flex flex-row w-1/2 justify-center items-center gap-1 z-10",
|
|
1462
1388
|
children: [
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
className:
|
|
1389
|
+
/* @__PURE__ */ jsx("span", {
|
|
1390
|
+
className: clsx("truncate", {
|
|
1465
1391
|
"text-primary dark:text-blue-400": galleryMode === title2.toLowerCase(),
|
|
1466
1392
|
"text-slate-500 dark:text-slate-400 opacity-90": galleryMode !== title2.toLowerCase()
|
|
1467
1393
|
}),
|
|
1468
1394
|
children: title2.toLocaleUpperCase()
|
|
1469
1395
|
}),
|
|
1470
|
-
Icon2 ? /* @__PURE__ */
|
|
1471
|
-
className:
|
|
1396
|
+
Icon2 ? /* @__PURE__ */ jsx(Icon2, {
|
|
1397
|
+
className: clsx("h-5 w-5", {
|
|
1472
1398
|
"text-primary dark:text-blue-400": galleryMode === title2.toLowerCase(),
|
|
1473
1399
|
"text-slate-500 dark:text-slate-400 opacity-90": galleryMode !== title2.toLowerCase()
|
|
1474
1400
|
})
|
|
1475
|
-
}) : /* @__PURE__ */
|
|
1476
|
-
className:
|
|
1401
|
+
}) : /* @__PURE__ */ jsx(ArrowCircleRight_default, {
|
|
1402
|
+
className: clsx("h-5 w-5", {
|
|
1477
1403
|
"text-primary dark:text-blue-400": galleryMode === title2.toLowerCase(),
|
|
1478
1404
|
"text-slate-500 dark:text-slate-400 opacity-90": galleryMode !== title2.toLowerCase()
|
|
1479
1405
|
})
|
|
@@ -1482,22 +1408,20 @@ var UserContentSwitcher = function(param) {
|
|
|
1482
1408
|
})
|
|
1483
1409
|
]
|
|
1484
1410
|
});
|
|
1485
|
-
};
|
|
1411
|
+
}, "UserContentSwitcher");
|
|
1486
1412
|
var UserContentSwitcher_default = UserContentSwitcher;
|
|
1487
|
-
|
|
1488
|
-
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1489
|
-
var ProgressBarSimple = function(param) {
|
|
1413
|
+
var ProgressBarSimple = /* @__PURE__ */ __name(function(param) {
|
|
1490
1414
|
var progress = param.progress, color = param.color, _param_height = param.height, height = _param_height === void 0 ? 10 : _param_height, _param_backgroundColor = param.backgroundColor, backgroundColor = _param_backgroundColor === void 0 ? "#ccc" : _param_backgroundColor;
|
|
1491
|
-
return /* @__PURE__ */
|
|
1415
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1492
1416
|
className: "w-full",
|
|
1493
|
-
children: /* @__PURE__ */
|
|
1417
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1494
1418
|
className: "w-full overflow-hidden transition-all duration-150 ease-in-out",
|
|
1495
1419
|
style: {
|
|
1496
1420
|
backgroundColor: backgroundColor,
|
|
1497
1421
|
height: "".concat(height, "px"),
|
|
1498
1422
|
borderRadius: "".concat(height / 2, "px")
|
|
1499
1423
|
},
|
|
1500
|
-
children: /* @__PURE__ */
|
|
1424
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1501
1425
|
className: "transition-all duration-150 ease-in-out",
|
|
1502
1426
|
style: {
|
|
1503
1427
|
width: "".concat(progress, "%"),
|
|
@@ -1508,20 +1432,17 @@ var ProgressBarSimple = function(param) {
|
|
|
1508
1432
|
})
|
|
1509
1433
|
})
|
|
1510
1434
|
});
|
|
1511
|
-
};
|
|
1435
|
+
}, "ProgressBarSimple");
|
|
1512
1436
|
var ProgressBarSimple_default = ProgressBarSimple;
|
|
1513
|
-
|
|
1514
|
-
import clsx10 from "clsx";
|
|
1515
|
-
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1516
|
-
var ProgressBar = function(param) {
|
|
1437
|
+
var ProgressBar = /* @__PURE__ */ __name(function(param) {
|
|
1517
1438
|
var progress = param.progress;
|
|
1518
|
-
return /* @__PURE__ */
|
|
1519
|
-
children: /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1440
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1520
1441
|
className: "-mt-2 mb-6",
|
|
1521
|
-
children: /* @__PURE__ */
|
|
1442
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1522
1443
|
className: "bg-gray-100 rounded-full h-2",
|
|
1523
|
-
children: /* @__PURE__ */
|
|
1524
|
-
className:
|
|
1444
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1445
|
+
className: clsx("rounded-full h-2", progress === 100 ? "bg-green-400" : "bg-gray-100"),
|
|
1525
1446
|
style: {
|
|
1526
1447
|
width: "".concat(progress, "%"),
|
|
1527
1448
|
minWidth: "100%",
|
|
@@ -1531,26 +1452,26 @@ var ProgressBar = function(param) {
|
|
|
1531
1452
|
})
|
|
1532
1453
|
})
|
|
1533
1454
|
});
|
|
1534
|
-
};
|
|
1535
|
-
var ProgressStepBar = function(param) {
|
|
1455
|
+
}, "ProgressBar");
|
|
1456
|
+
var ProgressStepBar = /* @__PURE__ */ __name(function(param) {
|
|
1536
1457
|
var steps = param.steps, stepIndex = param.stepIndex, onStepClick = param.onStepClick, color = param.color;
|
|
1537
|
-
return /* @__PURE__ */
|
|
1458
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1538
1459
|
className: "flex w-full items-center space-x-0.5 -mt-1 overflow-hidden",
|
|
1539
1460
|
children: steps.map(function(el, i) {
|
|
1540
|
-
return /* @__PURE__ */
|
|
1461
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1541
1462
|
className: "flex-1 relative",
|
|
1542
|
-
children: /* @__PURE__ */
|
|
1463
|
+
children: /* @__PURE__ */ jsx(Tippy_default, {
|
|
1543
1464
|
content: el.label,
|
|
1544
1465
|
className: tippyClassname,
|
|
1545
|
-
children: /* @__PURE__ */
|
|
1466
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1546
1467
|
className: "mb-4",
|
|
1547
|
-
children: /* @__PURE__ */
|
|
1468
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1548
1469
|
onClick: function() {
|
|
1549
1470
|
return onStepClick === null || onStepClick === void 0 ? void 0 : onStepClick(i);
|
|
1550
1471
|
},
|
|
1551
1472
|
className: "cursor-pointer bg-gray-100 rounded-full h-2 overflow-hidden",
|
|
1552
|
-
children: /* @__PURE__ */
|
|
1553
|
-
className:
|
|
1473
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1474
|
+
className: clsx("cursor-pointer rounded-full h-2", stepIndex >= i ? "bg-green-400" : "bg-gray-100"),
|
|
1554
1475
|
style: {
|
|
1555
1476
|
width: "".concat(stepIndex >= i ? 100 : 0, "%"),
|
|
1556
1477
|
transition: "width 0.3s ease"
|
|
@@ -1562,12 +1483,10 @@ var ProgressStepBar = function(param) {
|
|
|
1562
1483
|
}, "index_progress_".concat(el.label));
|
|
1563
1484
|
})
|
|
1564
1485
|
});
|
|
1565
|
-
};
|
|
1486
|
+
}, "ProgressStepBar");
|
|
1566
1487
|
ProgressBar.Step = ProgressStepBar;
|
|
1567
1488
|
var ProgressBar_default = ProgressBar;
|
|
1568
|
-
|
|
1569
|
-
import { jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1570
|
-
var CircleProgress = function(param) {
|
|
1489
|
+
var CircleProgress = /* @__PURE__ */ __name(function(param) {
|
|
1571
1490
|
var twColor = param.twColor, percentage = param.percentage, radius = param.radius, fill = param.fill, strokeWidth = param.strokeWidth;
|
|
1572
1491
|
var r = radius;
|
|
1573
1492
|
var cx = "50%";
|
|
@@ -1575,16 +1494,16 @@ var CircleProgress = function(param) {
|
|
|
1575
1494
|
var w = Math.round(radius / 16);
|
|
1576
1495
|
var strokeWidthCalc = strokeWidth ? strokeWidth : w < 8 ? 8 : w;
|
|
1577
1496
|
var size = radius * 2 + strokeWidthCalc;
|
|
1578
|
-
return /* @__PURE__ */
|
|
1497
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1579
1498
|
style: {
|
|
1580
1499
|
height: size,
|
|
1581
1500
|
width: size
|
|
1582
1501
|
},
|
|
1583
|
-
children: /* @__PURE__ */
|
|
1502
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
1584
1503
|
viewBox: "0 0 ".concat(size, " ").concat(size),
|
|
1585
1504
|
className: "-rotate-90",
|
|
1586
1505
|
children: [
|
|
1587
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ jsx("circle", {
|
|
1588
1507
|
className: "text-white/50 dark:text-slate-200/50",
|
|
1589
1508
|
strokeWidth: strokeWidthCalc - 0.5,
|
|
1590
1509
|
stroke: "currentColor",
|
|
@@ -1593,7 +1512,7 @@ var CircleProgress = function(param) {
|
|
|
1593
1512
|
cx: cx,
|
|
1594
1513
|
cy: cy
|
|
1595
1514
|
}),
|
|
1596
|
-
/* @__PURE__ */
|
|
1515
|
+
/* @__PURE__ */ jsx("circle", {
|
|
1597
1516
|
strokeDasharray: 2 * Math.PI * r,
|
|
1598
1517
|
strokeDashoffset: 2 * Math.PI * r - percentage / 100 * 2 * Math.PI * r,
|
|
1599
1518
|
stroke: twColor || "white/50",
|
|
@@ -1607,12 +1526,10 @@ var CircleProgress = function(param) {
|
|
|
1607
1526
|
]
|
|
1608
1527
|
})
|
|
1609
1528
|
});
|
|
1610
|
-
};
|
|
1529
|
+
}, "CircleProgress");
|
|
1611
1530
|
var CircleProgress_default = CircleProgress;
|
|
1612
|
-
// src/ProgressBar/CourseProgress.tsx
|
|
1613
|
-
import { jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1614
1531
|
var PRIMARY_COLOR2 = "#00b4d8";
|
|
1615
|
-
var CourseProgress = function(param) {
|
|
1532
|
+
var CourseProgress = /* @__PURE__ */ __name(function(param) {
|
|
1616
1533
|
var twColor = param.twColor, percentage = param.percentage, label = param.label;
|
|
1617
1534
|
var cx = "50%";
|
|
1618
1535
|
var cy = "50%";
|
|
@@ -1621,16 +1538,16 @@ var CourseProgress = function(param) {
|
|
|
1621
1538
|
var fullLength = 2 * Math.PI * r;
|
|
1622
1539
|
var length = fullLength * (percentage < 1 ? 1 - percentage : 0.01);
|
|
1623
1540
|
var strokeDashoffset = 2 * Math.PI * r - percentage / 100 * 2 * Math.PI * r;
|
|
1624
|
-
return /* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1625
1542
|
className: "flex items-center flex-col justify-center space-y-0 dark:bg-inherit dark:text-gray-300",
|
|
1626
1543
|
children: [
|
|
1627
|
-
/* @__PURE__ */
|
|
1544
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1628
1545
|
className: "relative flex items-center justify-center -my-2 -mt-1 overflow-hidden rounded-full",
|
|
1629
1546
|
children: [
|
|
1630
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsxs("svg", {
|
|
1631
1548
|
className: "-rotate-90",
|
|
1632
1549
|
children: [
|
|
1633
|
-
/* @__PURE__ */
|
|
1550
|
+
/* @__PURE__ */ jsx("circle", {
|
|
1634
1551
|
className: "text-gray-300",
|
|
1635
1552
|
strokeWidth: strokeWidth,
|
|
1636
1553
|
stroke: "currentColor",
|
|
@@ -1639,14 +1556,12 @@ var CourseProgress = function(param) {
|
|
|
1639
1556
|
cx: cx,
|
|
1640
1557
|
cy: cy
|
|
1641
1558
|
}),
|
|
1642
|
-
/* @__PURE__ */
|
|
1559
|
+
/* @__PURE__ */ jsx("circle", {
|
|
1643
1560
|
style: {
|
|
1644
1561
|
strokeDashoffset: strokeDashoffset
|
|
1645
1562
|
},
|
|
1646
1563
|
color: twColor || PRIMARY_COLOR2,
|
|
1647
|
-
ref: function(ref) {
|
|
1648
|
-
if (ref) {}
|
|
1649
|
-
},
|
|
1564
|
+
ref: function(ref) {},
|
|
1650
1565
|
strokeWidth: strokeWidth,
|
|
1651
1566
|
strokeLinecap: "round",
|
|
1652
1567
|
stroke: "currentColor",
|
|
@@ -1659,35 +1574,35 @@ var CourseProgress = function(param) {
|
|
|
1659
1574
|
})
|
|
1660
1575
|
]
|
|
1661
1576
|
}),
|
|
1662
|
-
/* @__PURE__ */
|
|
1577
|
+
/* @__PURE__ */ jsx("span", {
|
|
1663
1578
|
className: "absolute top-[".concat(50 / 2, "] text-xl leading-none font-medium font-header hidden sm:block"),
|
|
1664
1579
|
children: percentage.toString() + "%"
|
|
1665
1580
|
})
|
|
1666
1581
|
]
|
|
1667
1582
|
}),
|
|
1668
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ jsx("p", {
|
|
1669
1584
|
className: "font-medium sm:text-xl font-header text-center w-full",
|
|
1670
1585
|
children: label
|
|
1671
1586
|
})
|
|
1672
1587
|
]
|
|
1673
1588
|
});
|
|
1674
|
-
};
|
|
1675
|
-
var Small = function(param) {
|
|
1589
|
+
}, "CourseProgress");
|
|
1590
|
+
var Small = /* @__PURE__ */ __name(function(param) {
|
|
1676
1591
|
var twColor = param.twColor, percentage = param.percentage, label = param.label;
|
|
1677
1592
|
var cx = 18;
|
|
1678
1593
|
var cy = 18;
|
|
1679
1594
|
var r = 14;
|
|
1680
1595
|
var strokeWidth = 4;
|
|
1681
1596
|
var strokeDashoffset = 2 * Math.PI * r - percentage / 100 * 2 * Math.PI * r;
|
|
1682
|
-
return /* @__PURE__ */
|
|
1597
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1683
1598
|
className: "flex items-center space-x-2 rounded-full bg-transparent border-2 border-slate-100 w-full",
|
|
1684
1599
|
children: [
|
|
1685
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ jsx("div", {
|
|
1686
1601
|
className: "flex items-center justify-center overflow-hidden",
|
|
1687
|
-
children: /* @__PURE__ */
|
|
1602
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
1688
1603
|
className: "w-10 h-11 transform translate-x-1 translate-y-1",
|
|
1689
1604
|
children: [
|
|
1690
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ jsx("circle", {
|
|
1691
1606
|
className: "text-gray-300",
|
|
1692
1607
|
strokeWidth: strokeWidth,
|
|
1693
1608
|
stroke: "currentColor",
|
|
@@ -1696,14 +1611,12 @@ var Small = function(param) {
|
|
|
1696
1611
|
cx: cx,
|
|
1697
1612
|
cy: cy
|
|
1698
1613
|
}),
|
|
1699
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ jsx("circle", {
|
|
1700
1615
|
style: {
|
|
1701
1616
|
strokeDashoffset: strokeDashoffset
|
|
1702
1617
|
},
|
|
1703
1618
|
className: twColor || "text-blue-500",
|
|
1704
|
-
ref: function(ref) {
|
|
1705
|
-
if (ref) {}
|
|
1706
|
-
},
|
|
1619
|
+
ref: function(ref) {},
|
|
1707
1620
|
strokeWidth: strokeWidth,
|
|
1708
1621
|
strokeLinecap: "round",
|
|
1709
1622
|
stroke: "currentColor",
|
|
@@ -1715,7 +1628,7 @@ var Small = function(param) {
|
|
|
1715
1628
|
]
|
|
1716
1629
|
})
|
|
1717
1630
|
}),
|
|
1718
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ jsxs("p", {
|
|
1719
1632
|
className: "font-medium dark:text-gray-300 text-gray-600 text-sm font-header mt-1",
|
|
1720
1633
|
children: [
|
|
1721
1634
|
label,
|
|
@@ -1725,29 +1638,26 @@ var Small = function(param) {
|
|
|
1725
1638
|
})
|
|
1726
1639
|
]
|
|
1727
1640
|
});
|
|
1728
|
-
};
|
|
1641
|
+
}, "Small");
|
|
1729
1642
|
CourseProgress.Small = Small;
|
|
1730
1643
|
var CourseProgress_default = CourseProgress;
|
|
1731
|
-
// src/ProgressBar/ScrollProgress.tsx
|
|
1732
|
-
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1733
|
-
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1734
1644
|
var PRIMARY_COLOR3 = "#00b4d8";
|
|
1735
|
-
var ScrollProgress = function() {
|
|
1736
|
-
var
|
|
1737
|
-
|
|
1738
|
-
var handleScroll = function() {
|
|
1645
|
+
var ScrollProgress = /* @__PURE__ */ __name(function() {
|
|
1646
|
+
var _useState = _sliced_to_array(useState(0), 2), scrollPercentage = _useState[0], setScrollPercentage = _useState[1];
|
|
1647
|
+
useEffect(function() {
|
|
1648
|
+
var handleScroll = /* @__PURE__ */ __name(function() {
|
|
1739
1649
|
var windowHeight = window.innerHeight;
|
|
1740
1650
|
var documentHeight = document.documentElement.scrollHeight;
|
|
1741
1651
|
var scrollY = window.scrollY;
|
|
1742
1652
|
var scrollPercent = scrollY / (documentHeight - windowHeight) * 100;
|
|
1743
1653
|
setScrollPercentage(scrollPercent);
|
|
1744
|
-
};
|
|
1654
|
+
}, "handleScroll");
|
|
1745
1655
|
window.addEventListener("scroll", handleScroll);
|
|
1746
1656
|
return function() {
|
|
1747
1657
|
window.removeEventListener("scroll", handleScroll);
|
|
1748
1658
|
};
|
|
1749
1659
|
}, []);
|
|
1750
|
-
return /* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1751
1661
|
style: {
|
|
1752
1662
|
height: "4px",
|
|
1753
1663
|
borderRadius: 2,
|
|
@@ -1758,7 +1668,7 @@ var ScrollProgress = function() {
|
|
|
1758
1668
|
left: "0px",
|
|
1759
1669
|
right: "0px"
|
|
1760
1670
|
},
|
|
1761
|
-
children: /* @__PURE__ */
|
|
1671
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1762
1672
|
style: {
|
|
1763
1673
|
height: "100%",
|
|
1764
1674
|
backgroundColor: PRIMARY_COLOR3,
|
|
@@ -1767,26 +1677,23 @@ var ScrollProgress = function() {
|
|
|
1767
1677
|
}
|
|
1768
1678
|
})
|
|
1769
1679
|
});
|
|
1770
|
-
};
|
|
1680
|
+
}, "ScrollProgress");
|
|
1771
1681
|
var ScrollProgress_default = ScrollProgress;
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
var AnimateLogo = function() {
|
|
1776
|
-
var _useState6 = _sliced_to_array(useState6(false), 2), isFirefox = _useState6[0], setIsFirefox = _useState6[1];
|
|
1777
|
-
useEffect5(function() {
|
|
1682
|
+
var AnimateLogo = /* @__PURE__ */ __name(function() {
|
|
1683
|
+
var _useState = _sliced_to_array(useState(false), 2), isFirefox = _useState[0], setIsFirefox = _useState[1];
|
|
1684
|
+
useEffect(function() {
|
|
1778
1685
|
var userAgent = window.navigator.userAgent;
|
|
1779
1686
|
setIsFirefox(userAgent.indexOf("Firefox") > -1);
|
|
1780
1687
|
}, []);
|
|
1781
1688
|
if (isFirefox) {
|
|
1782
|
-
return /* @__PURE__ */
|
|
1689
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
1783
1690
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1784
1691
|
className: "animate-spin",
|
|
1785
1692
|
viewBox: "0 0 600 600",
|
|
1786
|
-
children: /* @__PURE__ */
|
|
1693
|
+
children: /* @__PURE__ */ jsx("g", {
|
|
1787
1694
|
height: 176,
|
|
1788
1695
|
width: 176,
|
|
1789
|
-
children: /* @__PURE__ */
|
|
1696
|
+
children: /* @__PURE__ */ jsxs("path", {
|
|
1790
1697
|
className: "stroke-black dark:stroke-white text-gray-900 dark:text-gray-50",
|
|
1791
1698
|
stroke: "currentColor",
|
|
1792
1699
|
fill: "none",
|
|
@@ -1796,7 +1703,7 @@ var AnimateLogo = function() {
|
|
|
1796
1703
|
strokeDasharray: "1600",
|
|
1797
1704
|
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",
|
|
1798
1705
|
children: [
|
|
1799
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ jsx("animate", {
|
|
1800
1707
|
attributeName: "stroke-dashoffset",
|
|
1801
1708
|
to: "0",
|
|
1802
1709
|
from: "1600",
|
|
@@ -1808,7 +1715,7 @@ var AnimateLogo = function() {
|
|
|
1808
1715
|
keySplines: "0 0.26 0 1;0 0.26 0 1;0 0.26 0 1;0 0.26 0 1",
|
|
1809
1716
|
values: "1600;0;0;1600;1600"
|
|
1810
1717
|
}),
|
|
1811
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ jsx("animateTransform", {
|
|
1812
1719
|
attributeName: "transform",
|
|
1813
1720
|
type: "rotate",
|
|
1814
1721
|
from: "0 300 300",
|
|
@@ -1826,10 +1733,10 @@ var AnimateLogo = function() {
|
|
|
1826
1733
|
})
|
|
1827
1734
|
});
|
|
1828
1735
|
}
|
|
1829
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
1830
1737
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1831
1738
|
viewBox: "0 0 600 600",
|
|
1832
|
-
children: /* @__PURE__ */
|
|
1739
|
+
children: /* @__PURE__ */ jsxs("g", {
|
|
1833
1740
|
style: {
|
|
1834
1741
|
transformOrigin: "center"
|
|
1835
1742
|
},
|
|
@@ -1837,7 +1744,7 @@ var AnimateLogo = function() {
|
|
|
1837
1744
|
height: 176,
|
|
1838
1745
|
width: 176,
|
|
1839
1746
|
children: [
|
|
1840
|
-
/* @__PURE__ */
|
|
1747
|
+
/* @__PURE__ */ jsx("path", {
|
|
1841
1748
|
className: "stroke-black dark:stroke-white text-gray-900 dark:text-gray-50",
|
|
1842
1749
|
stroke: "currentColor",
|
|
1843
1750
|
id: "motionPath",
|
|
@@ -1852,7 +1759,7 @@ var AnimateLogo = function() {
|
|
|
1852
1759
|
strokeWidth: "82",
|
|
1853
1760
|
strokeDasharray: "1600",
|
|
1854
1761
|
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",
|
|
1855
|
-
children: /* @__PURE__ */
|
|
1762
|
+
children: /* @__PURE__ */ jsx("animate", {
|
|
1856
1763
|
attributeName: "stroke-dashoffset",
|
|
1857
1764
|
to: "0",
|
|
1858
1765
|
from: "1600",
|
|
@@ -1865,7 +1772,7 @@ var AnimateLogo = function() {
|
|
|
1865
1772
|
values: "1600;0;0;1600;1600"
|
|
1866
1773
|
})
|
|
1867
1774
|
}),
|
|
1868
|
-
/* @__PURE__ */
|
|
1775
|
+
/* @__PURE__ */ jsx("animateTransform", {
|
|
1869
1776
|
attributeName: "transform",
|
|
1870
1777
|
type: "rotate",
|
|
1871
1778
|
from: "0",
|
|
@@ -1881,16 +1788,12 @@ var AnimateLogo = function() {
|
|
|
1881
1788
|
]
|
|
1882
1789
|
})
|
|
1883
1790
|
});
|
|
1884
|
-
};
|
|
1791
|
+
}, "AnimateLogo");
|
|
1885
1792
|
var AnimateLogo_default = AnimateLogo;
|
|
1886
|
-
|
|
1887
|
-
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
1888
|
-
import { createPortal } from "react-dom";
|
|
1889
|
-
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1890
|
-
var OverlaySpinner = function(param) {
|
|
1793
|
+
var OverlaySpinner = /* @__PURE__ */ __name(function(param) {
|
|
1891
1794
|
var visible = param.visible;
|
|
1892
|
-
var
|
|
1893
|
-
|
|
1795
|
+
var _useState = _sliced_to_array(useState(null), 2), modalRoot = _useState[0], setModalRoot = _useState[1];
|
|
1796
|
+
useEffect(function() {
|
|
1894
1797
|
var root = document.getElementById("spinner-root");
|
|
1895
1798
|
if (!root) {
|
|
1896
1799
|
root = document.createElement("div");
|
|
@@ -1910,21 +1813,21 @@ var OverlaySpinner = function(param) {
|
|
|
1910
1813
|
if (!visible || !modalRoot) {
|
|
1911
1814
|
return null;
|
|
1912
1815
|
}
|
|
1913
|
-
return createPortal(/* @__PURE__ */
|
|
1816
|
+
return createPortal(/* @__PURE__ */ jsx("div", {
|
|
1914
1817
|
style: {
|
|
1915
1818
|
zIndex: 11e3
|
|
1916
1819
|
},
|
|
1917
|
-
children: /* @__PURE__ */
|
|
1820
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1918
1821
|
style: {
|
|
1919
1822
|
zIndex: 11001
|
|
1920
1823
|
},
|
|
1921
1824
|
className: "fixed shrink-0 top-0 left-0 w-full h-screen flex items-center justify-center dark:bg-black/70 bg-white/60",
|
|
1922
|
-
children: /* @__PURE__ */
|
|
1825
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1923
1826
|
className: "h-44 w-44 overflow-visible",
|
|
1924
|
-
children: /* @__PURE__ */
|
|
1827
|
+
children: /* @__PURE__ */ jsx(AnimateLogo_default, {})
|
|
1925
1828
|
})
|
|
1926
1829
|
})
|
|
1927
1830
|
}), modalRoot);
|
|
1928
|
-
};
|
|
1831
|
+
}, "OverlaySpinner");
|
|
1929
1832
|
var OverlaySpinner_default = OverlaySpinner;
|
|
1930
1833
|
export { AnimateLogo_default as AnimateLogo, Backdrop_default as Backdrop, BottomAlert_default as BottomAlert, Breakpoint_default as Breakpoint, Button_default as Button, Checkbox_default as Checkbox, CircleProgress_default as CircleProgress, Container_default as Container, CourseProgress_default as CourseProgress, ErrorText_default as ErrorText, Fade_default as Fade, FunButton_default as FunButton, FunRoundButton_default as FunRoundButton, IconInfo_default as IconInfo, Modal_default as Modal, NoResults_default as NoResults, NoticeBox_default as NoticeBox, Overlay_default as Overlay, OverlaySpinner_default as OverlaySpinner, PRIMARY_COLOR, Pill_default as Pill, ProgressBar_default as ProgressBar, ProgressBarSimple_default as ProgressBarSimple, RadioOption_default as RadioOption, RatingStars_default as RatingStars, ScrollProgress_default as ScrollProgress, Slider_default as Slider, Spinner_default as Spinner, StepsComponent_default as StepsComponent, Tippy_default as Tippy, ToggleSwitch_default as ToggleSwitch, UserContentSwitcher_default as UserContentSwitcher, baseFieldStyle, createExerciseElementStyle, exerciseDeleteButton, exerciseEditButton, headerButtonClass, headerTippyClass, tippyClassname, xIconButton };
|