@moontra/moonui-pro 2.6.2 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +148 -8
- package/dist/index.mjs +1092 -328
- package/package.json +1 -1
- package/src/components/credit-card-input/index.tsx +406 -0
- package/src/components/form-wizard/index.tsx +2 -2
- package/src/components/index.ts +18 -1
- package/src/components/moonui-quiz-form/index.tsx +817 -0
- package/src/components/multi-step-form/index.tsx +3 -3
- package/src/components/phone-number-input/index.tsx +335 -0
- package/src/components/quiz-form/index.tsx +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
3
3
|
import * as t from 'react';
|
|
4
4
|
import t__default, { useState, useRef, useCallback, forwardRef, createContext, useEffect, useContext, useMemo, useLayoutEffect, useDebugValue, Component } from 'react';
|
|
5
5
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
6
|
-
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, ChevronLeft, Calendar as Calendar$1, Edit, Trash2,
|
|
6
|
+
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, CreditCard, Globe, CheckCircle2, XCircle, RotateCcw, Download, Clock, HelpCircle, ChevronLeft, Calendar as Calendar$1, Edit, Trash2, MapPin, User, GripVertical, MessageCircle, Paperclip, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Palette, Highlighter, Link2, Image as Image$1, Table as Table$1, Settings, Undo, Redo, Eye, RefreshCw, Wand2, Maximize, FileText, Languages, TrendingUp, TrendingDown, ZoomOut, ZoomIn, FileSpreadsheet, FileJson, Maximize2, Move, Menu, Bell, CheckCheck, CheckCircle, Settings2, LogOut, Edit3, LayoutGrid, Upload, Share2, Save, Filter, FileDown, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, Pin, Sun, Moon, Monitor, Star, ExternalLink, CalendarIcon, DollarSign, Users, Github, GitFork, Activity, Server, EyeOff, RotateCw, Zap, Timer, Cpu, MemoryStick, HardDrive, Network, BarChart3, Video, Music, Archive, File as File$1, Columns, Grip, Unlock, Minimize2, Map as Map$1, Target, MoreVertical, BellOff, ArrowDownRight, ArrowUpRight } from 'lucide-react';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
@@ -4044,7 +4044,7 @@ var me = t.forwardRef((r3, o3) => {
|
|
|
4044
4044
|
var e2;
|
|
4045
4045
|
return Array.from(((e2 = I.current) == null ? void 0 : e2.querySelectorAll(ce)) || []);
|
|
4046
4046
|
}
|
|
4047
|
-
function
|
|
4047
|
+
function X19(e2) {
|
|
4048
4048
|
let s3 = V()[e2];
|
|
4049
4049
|
s3 && E.setState("value", s3.getAttribute(T));
|
|
4050
4050
|
}
|
|
@@ -4059,10 +4059,10 @@ var me = t.forwardRef((r3, o3) => {
|
|
|
4059
4059
|
s3 = e2 > 0 ? we(s3, N) : De(s3, N), i3 = s3 == null ? void 0 : s3.querySelector(ce);
|
|
4060
4060
|
i3 ? E.setState("value", i3.getAttribute(T)) : Q(e2);
|
|
4061
4061
|
}
|
|
4062
|
-
let oe = () =>
|
|
4062
|
+
let oe = () => X19(V().length - 1), ie3 = (e2) => {
|
|
4063
4063
|
e2.preventDefault(), e2.metaKey ? oe() : e2.altKey ? re(1) : Q(1);
|
|
4064
4064
|
}, se = (e2) => {
|
|
4065
|
-
e2.preventDefault(), e2.metaKey ?
|
|
4065
|
+
e2.preventDefault(), e2.metaKey ? X19(0) : e2.altKey ? re(-1) : Q(-1);
|
|
4066
4066
|
};
|
|
4067
4067
|
return t.createElement(Primitive2.div, { ref: o3, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e2) => {
|
|
4068
4068
|
var s3;
|
|
@@ -4089,7 +4089,7 @@ var me = t.forwardRef((r3, o3) => {
|
|
|
4089
4089
|
break;
|
|
4090
4090
|
}
|
|
4091
4091
|
case "Home": {
|
|
4092
|
-
e2.preventDefault(),
|
|
4092
|
+
e2.preventDefault(), X19(0);
|
|
4093
4093
|
break;
|
|
4094
4094
|
}
|
|
4095
4095
|
case "End": {
|
|
@@ -60477,7 +60477,7 @@ var FormWizardNavigation = ({
|
|
|
60477
60477
|
)
|
|
60478
60478
|
] });
|
|
60479
60479
|
};
|
|
60480
|
-
var
|
|
60480
|
+
var MoonUIFormWizardPro = t__default.forwardRef(({
|
|
60481
60481
|
steps,
|
|
60482
60482
|
currentStep = 0,
|
|
60483
60483
|
onStepChange,
|
|
@@ -60559,7 +60559,7 @@ var FormWizardPro = t__default.forwardRef(({
|
|
|
60559
60559
|
}
|
|
60560
60560
|
);
|
|
60561
60561
|
});
|
|
60562
|
-
|
|
60562
|
+
MoonUIFormWizardPro.displayName = "MoonUIFormWizardPro";
|
|
60563
60563
|
var r2 = (t4, r3, o3) => {
|
|
60564
60564
|
if (t4 && "reportValidity" in t4) {
|
|
60565
60565
|
const s3 = get(o3, r3);
|
|
@@ -72111,7 +72111,7 @@ function createStepSchema(fields) {
|
|
|
72111
72111
|
});
|
|
72112
72112
|
return external_exports.object(shape);
|
|
72113
72113
|
}
|
|
72114
|
-
function
|
|
72114
|
+
function MoonUIMultiStepFormPro({
|
|
72115
72115
|
steps,
|
|
72116
72116
|
onSubmit,
|
|
72117
72117
|
defaultValues,
|
|
@@ -72197,7 +72197,7 @@ function MultiStepFormPro({
|
|
|
72197
72197
|
}
|
|
72198
72198
|
};
|
|
72199
72199
|
return /* @__PURE__ */ jsx(
|
|
72200
|
-
|
|
72200
|
+
MoonUIFormWizardPro,
|
|
72201
72201
|
{
|
|
72202
72202
|
...wizardProps,
|
|
72203
72203
|
steps: wizardSteps,
|
|
@@ -72208,376 +72208,1140 @@ function MultiStepFormPro({
|
|
|
72208
72208
|
function cn2(...classes) {
|
|
72209
72209
|
return classes.filter(Boolean).join(" ");
|
|
72210
72210
|
}
|
|
72211
|
-
|
|
72212
|
-
|
|
72213
|
-
|
|
72214
|
-
|
|
72215
|
-
|
|
72211
|
+
var cardPatterns = {
|
|
72212
|
+
visa: /^4/,
|
|
72213
|
+
mastercard: /^5[1-5]/,
|
|
72214
|
+
amex: /^3[47]/,
|
|
72215
|
+
discover: /^6(?:011|5)/,
|
|
72216
|
+
diners: /^3(?:0[0-5]|[68])/,
|
|
72217
|
+
jcb: /^35/,
|
|
72218
|
+
unionpay: /^62/
|
|
72219
|
+
};
|
|
72220
|
+
function formatCardNumber(value, cardType) {
|
|
72221
|
+
const v = value.replace(/\s+/g, "").replace(/[^0-9]/gi, "");
|
|
72222
|
+
const matches2 = cardType === "amex" ? v.match(/\d{1,4}/g) : v.match(/\d{1,4}/g);
|
|
72223
|
+
return matches2 ? matches2.join(" ") : v;
|
|
72224
|
+
}
|
|
72225
|
+
function formatExpiry(value) {
|
|
72226
|
+
const v = value.replace(/\s+/g, "").replace(/[^0-9]/gi, "");
|
|
72227
|
+
if (v.length >= 2) {
|
|
72228
|
+
return v.slice(0, 2) + (v.length > 2 ? "/" + v.slice(2, 4) : "");
|
|
72229
|
+
}
|
|
72230
|
+
return v;
|
|
72231
|
+
}
|
|
72232
|
+
function detectCardType(number4) {
|
|
72233
|
+
const cleanNumber = number4.replace(/\s+/g, "");
|
|
72234
|
+
for (const [type, pattern] of Object.entries(cardPatterns)) {
|
|
72235
|
+
if (pattern.test(cleanNumber)) {
|
|
72236
|
+
return type;
|
|
72237
|
+
}
|
|
72216
72238
|
}
|
|
72217
|
-
return
|
|
72239
|
+
return null;
|
|
72218
72240
|
}
|
|
72219
|
-
|
|
72220
|
-
|
|
72221
|
-
|
|
72241
|
+
function validateCardNumber(number4) {
|
|
72242
|
+
const cleanNumber = number4.replace(/\s+/g, "");
|
|
72243
|
+
if (!/^\d+$/.test(cleanNumber))
|
|
72244
|
+
return false;
|
|
72245
|
+
let sum = 0;
|
|
72246
|
+
let isEven = false;
|
|
72247
|
+
for (let i3 = cleanNumber.length - 1; i3 >= 0; i3--) {
|
|
72248
|
+
let digit = parseInt(cleanNumber.charAt(i3), 10);
|
|
72249
|
+
if (isEven) {
|
|
72250
|
+
digit *= 2;
|
|
72251
|
+
if (digit > 9) {
|
|
72252
|
+
digit -= 9;
|
|
72253
|
+
}
|
|
72254
|
+
}
|
|
72255
|
+
sum += digit;
|
|
72256
|
+
isEven = !isEven;
|
|
72257
|
+
}
|
|
72258
|
+
return sum % 10 === 0;
|
|
72259
|
+
}
|
|
72260
|
+
function validateExpiry(expiry) {
|
|
72261
|
+
const parts = expiry.split("/");
|
|
72262
|
+
if (parts.length !== 2)
|
|
72263
|
+
return false;
|
|
72264
|
+
const month = parseInt(parts[0], 10);
|
|
72265
|
+
const year = parseInt("20" + parts[1], 10);
|
|
72266
|
+
if (month < 1 || month > 12)
|
|
72267
|
+
return false;
|
|
72268
|
+
const now = /* @__PURE__ */ new Date();
|
|
72269
|
+
const expiryDate = new Date(year, month - 1);
|
|
72270
|
+
return expiryDate > now;
|
|
72271
|
+
}
|
|
72272
|
+
var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
72273
|
+
value = { number: "", expiry: "", cvc: "", name: "" },
|
|
72274
|
+
onChange,
|
|
72275
|
+
showCardPreview = true,
|
|
72276
|
+
showCardType = true,
|
|
72277
|
+
showSecurityBadge = true,
|
|
72278
|
+
autoFormat = true,
|
|
72279
|
+
validateOnChange = false,
|
|
72280
|
+
labels = {},
|
|
72281
|
+
placeholders = {},
|
|
72282
|
+
errors = {},
|
|
72283
|
+
className,
|
|
72284
|
+
inputClassName,
|
|
72285
|
+
labelClassName,
|
|
72286
|
+
errorClassName,
|
|
72287
|
+
disabled,
|
|
72288
|
+
required: required2,
|
|
72289
|
+
...props
|
|
72290
|
+
}, ref) => {
|
|
72291
|
+
const [cardType, setCardType] = useState(null);
|
|
72292
|
+
const [focused, setFocused] = useState(null);
|
|
72293
|
+
const [localErrors, setLocalErrors] = useState({});
|
|
72294
|
+
const numberRef = useRef(null);
|
|
72295
|
+
const expiryRef = useRef(null);
|
|
72296
|
+
const cvcRef = useRef(null);
|
|
72297
|
+
const nameRef = useRef(null);
|
|
72298
|
+
useEffect(() => {
|
|
72299
|
+
const detectedType = detectCardType(value.number);
|
|
72300
|
+
setCardType(detectedType);
|
|
72301
|
+
}, [value.number]);
|
|
72302
|
+
useEffect(() => {
|
|
72303
|
+
if (!validateOnChange)
|
|
72304
|
+
return;
|
|
72305
|
+
const newErrors = {};
|
|
72306
|
+
if (value.number && !validateCardNumber(value.number)) {
|
|
72307
|
+
newErrors.number = "Invalid card number";
|
|
72308
|
+
}
|
|
72309
|
+
if (value.expiry && !validateExpiry(value.expiry)) {
|
|
72310
|
+
newErrors.expiry = "Invalid expiry date";
|
|
72311
|
+
}
|
|
72312
|
+
if (value.cvc && (value.cvc.length < 3 || value.cvc.length > 4)) {
|
|
72313
|
+
newErrors.cvc = "Invalid CVC";
|
|
72314
|
+
}
|
|
72315
|
+
setLocalErrors(newErrors);
|
|
72316
|
+
}, [value, validateOnChange]);
|
|
72317
|
+
const handleChange = (field, newValue) => {
|
|
72318
|
+
let formattedValue = newValue;
|
|
72319
|
+
if (autoFormat) {
|
|
72320
|
+
if (field === "number") {
|
|
72321
|
+
formattedValue = formatCardNumber(newValue, cardType || void 0);
|
|
72322
|
+
const maxLength = cardType === "amex" ? 18 : 19;
|
|
72323
|
+
if (formattedValue.length > maxLength)
|
|
72324
|
+
return;
|
|
72325
|
+
} else if (field === "expiry") {
|
|
72326
|
+
formattedValue = formatExpiry(newValue);
|
|
72327
|
+
if (formattedValue.length > 5)
|
|
72328
|
+
return;
|
|
72329
|
+
} else if (field === "cvc") {
|
|
72330
|
+
formattedValue = newValue.replace(/\D/g, "");
|
|
72331
|
+
const maxLength = cardType === "amex" ? 4 : 3;
|
|
72332
|
+
if (formattedValue.length > maxLength)
|
|
72333
|
+
return;
|
|
72334
|
+
}
|
|
72335
|
+
}
|
|
72336
|
+
onChange?.({
|
|
72337
|
+
...value,
|
|
72338
|
+
[field]: formattedValue
|
|
72339
|
+
});
|
|
72340
|
+
if (autoFormat) {
|
|
72341
|
+
if (field === "number" && formattedValue.length === (cardType === "amex" ? 18 : 19)) {
|
|
72342
|
+
expiryRef.current?.focus();
|
|
72343
|
+
} else if (field === "expiry" && formattedValue.length === 5) {
|
|
72344
|
+
cvcRef.current?.focus();
|
|
72345
|
+
} else if (field === "cvc" && formattedValue.length === (cardType === "amex" ? 4 : 3)) {
|
|
72346
|
+
nameRef.current?.focus();
|
|
72347
|
+
}
|
|
72348
|
+
}
|
|
72349
|
+
};
|
|
72350
|
+
const displayErrors = { ...localErrors, ...errors };
|
|
72351
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-4", className), ...props, children: [
|
|
72352
|
+
showCardPreview && /* @__PURE__ */ jsxs(
|
|
72353
|
+
motion.div,
|
|
72354
|
+
{
|
|
72355
|
+
className: "relative w-full max-w-md mx-auto h-48 rounded-xl bg-gradient-to-r from-gray-700 to-gray-900 p-6 text-white shadow-xl",
|
|
72356
|
+
initial: { opacity: 0, y: -20 },
|
|
72357
|
+
animate: { opacity: 1, y: 0 },
|
|
72358
|
+
transition: { duration: 0.3 },
|
|
72359
|
+
children: [
|
|
72360
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start mb-8", children: [
|
|
72361
|
+
/* @__PURE__ */ jsx("div", { className: "text-lg font-semibold", children: cardType ? cardType.toUpperCase() : "CARD" }),
|
|
72362
|
+
/* @__PURE__ */ jsx(CreditCard, { className: "w-8 h-8" })
|
|
72363
|
+
] }),
|
|
72364
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
72365
|
+
/* @__PURE__ */ jsx("div", { className: "text-xl font-mono tracking-wider", children: value.number || "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022" }),
|
|
72366
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
|
|
72367
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
72368
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs opacity-70", children: "NAME" }),
|
|
72369
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm uppercase", children: value.name || "YOUR NAME" })
|
|
72370
|
+
] }),
|
|
72371
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
72372
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs opacity-70", children: "EXPIRES" }),
|
|
72373
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm", children: value.expiry || "MM/YY" })
|
|
72374
|
+
] })
|
|
72375
|
+
] })
|
|
72376
|
+
] })
|
|
72377
|
+
]
|
|
72378
|
+
}
|
|
72379
|
+
),
|
|
72380
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
72381
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
72382
|
+
/* @__PURE__ */ jsxs(MoonUILabelPro, { htmlFor: "card-number", className: labelClassName, children: [
|
|
72383
|
+
labels.number || "Card Number",
|
|
72384
|
+
required2 && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
72385
|
+
] }),
|
|
72386
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
72387
|
+
/* @__PURE__ */ jsx(
|
|
72388
|
+
MoonUIInputPro,
|
|
72389
|
+
{
|
|
72390
|
+
ref: numberRef,
|
|
72391
|
+
id: "card-number",
|
|
72392
|
+
type: "text",
|
|
72393
|
+
inputMode: "numeric",
|
|
72394
|
+
value: value.number,
|
|
72395
|
+
onChange: (e2) => handleChange("number", e2.target.value),
|
|
72396
|
+
onFocus: () => setFocused("number"),
|
|
72397
|
+
onBlur: () => setFocused(null),
|
|
72398
|
+
placeholder: placeholders.number || "1234 5678 9012 3456",
|
|
72399
|
+
className: cn(
|
|
72400
|
+
"pr-20",
|
|
72401
|
+
displayErrors.number && "border-destructive",
|
|
72402
|
+
inputClassName
|
|
72403
|
+
),
|
|
72404
|
+
disabled
|
|
72405
|
+
}
|
|
72406
|
+
),
|
|
72407
|
+
showCardType && cardType && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm font-medium text-muted-foreground", children: cardType.toUpperCase() })
|
|
72408
|
+
] }),
|
|
72409
|
+
displayErrors.number && /* @__PURE__ */ jsx("p", { className: cn("text-sm text-destructive", errorClassName), children: displayErrors.number })
|
|
72410
|
+
] }),
|
|
72411
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
72412
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
72413
|
+
/* @__PURE__ */ jsxs(MoonUILabelPro, { htmlFor: "card-expiry", className: labelClassName, children: [
|
|
72414
|
+
labels.expiry || "Expiry Date",
|
|
72415
|
+
required2 && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
72416
|
+
] }),
|
|
72417
|
+
/* @__PURE__ */ jsx(
|
|
72418
|
+
MoonUIInputPro,
|
|
72419
|
+
{
|
|
72420
|
+
ref: expiryRef,
|
|
72421
|
+
id: "card-expiry",
|
|
72422
|
+
type: "text",
|
|
72423
|
+
inputMode: "numeric",
|
|
72424
|
+
value: value.expiry,
|
|
72425
|
+
onChange: (e2) => handleChange("expiry", e2.target.value),
|
|
72426
|
+
onFocus: () => setFocused("expiry"),
|
|
72427
|
+
onBlur: () => setFocused(null),
|
|
72428
|
+
placeholder: placeholders.expiry || "MM/YY",
|
|
72429
|
+
className: cn(
|
|
72430
|
+
displayErrors.expiry && "border-destructive",
|
|
72431
|
+
inputClassName
|
|
72432
|
+
),
|
|
72433
|
+
disabled
|
|
72434
|
+
}
|
|
72435
|
+
),
|
|
72436
|
+
displayErrors.expiry && /* @__PURE__ */ jsx("p", { className: cn("text-sm text-destructive", errorClassName), children: displayErrors.expiry })
|
|
72437
|
+
] }),
|
|
72438
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
72439
|
+
/* @__PURE__ */ jsxs(MoonUILabelPro, { htmlFor: "card-cvc", className: labelClassName, children: [
|
|
72440
|
+
labels.cvc || "CVC",
|
|
72441
|
+
required2 && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
72442
|
+
] }),
|
|
72443
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
72444
|
+
/* @__PURE__ */ jsx(
|
|
72445
|
+
MoonUIInputPro,
|
|
72446
|
+
{
|
|
72447
|
+
ref: cvcRef,
|
|
72448
|
+
id: "card-cvc",
|
|
72449
|
+
type: "text",
|
|
72450
|
+
inputMode: "numeric",
|
|
72451
|
+
value: value.cvc,
|
|
72452
|
+
onChange: (e2) => handleChange("cvc", e2.target.value),
|
|
72453
|
+
onFocus: () => setFocused("cvc"),
|
|
72454
|
+
onBlur: () => setFocused(null),
|
|
72455
|
+
placeholder: placeholders.cvc || cardType === "amex" ? "1234" : "123",
|
|
72456
|
+
className: cn(
|
|
72457
|
+
displayErrors.cvc && "border-destructive",
|
|
72458
|
+
inputClassName
|
|
72459
|
+
),
|
|
72460
|
+
disabled
|
|
72461
|
+
}
|
|
72462
|
+
),
|
|
72463
|
+
showSecurityBadge && /* @__PURE__ */ jsx(Lock, { className: "absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" })
|
|
72464
|
+
] }),
|
|
72465
|
+
displayErrors.cvc && /* @__PURE__ */ jsx("p", { className: cn("text-sm text-destructive", errorClassName), children: displayErrors.cvc })
|
|
72466
|
+
] })
|
|
72467
|
+
] }),
|
|
72468
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
72469
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { htmlFor: "card-name", className: labelClassName, children: labels.name || "Cardholder Name" }),
|
|
72470
|
+
/* @__PURE__ */ jsx(
|
|
72471
|
+
MoonUIInputPro,
|
|
72472
|
+
{
|
|
72473
|
+
ref: nameRef,
|
|
72474
|
+
id: "card-name",
|
|
72475
|
+
type: "text",
|
|
72476
|
+
value: value.name,
|
|
72477
|
+
onChange: (e2) => handleChange("name", e2.target.value),
|
|
72478
|
+
onFocus: () => setFocused("name"),
|
|
72479
|
+
onBlur: () => setFocused(null),
|
|
72480
|
+
placeholder: placeholders.name || "John Doe",
|
|
72481
|
+
className: cn(
|
|
72482
|
+
displayErrors.name && "border-destructive",
|
|
72483
|
+
inputClassName
|
|
72484
|
+
),
|
|
72485
|
+
disabled
|
|
72486
|
+
}
|
|
72487
|
+
),
|
|
72488
|
+
displayErrors.name && /* @__PURE__ */ jsx("p", { className: cn("text-sm text-destructive", errorClassName), children: displayErrors.name })
|
|
72489
|
+
] })
|
|
72490
|
+
] }),
|
|
72491
|
+
showSecurityBadge && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
72492
|
+
/* @__PURE__ */ jsx(Lock, { className: "w-4 h-4" }),
|
|
72493
|
+
/* @__PURE__ */ jsx("span", { children: "Your payment information is secure and encrypted" })
|
|
72494
|
+
] })
|
|
72495
|
+
] });
|
|
72496
|
+
});
|
|
72497
|
+
MoonUICreditCardInputPro.displayName = "MoonUICreditCardInputPro";
|
|
72498
|
+
var countries = [
|
|
72499
|
+
{ code: "US", name: "United States", dialCode: "+1", flag: "\u{1F1FA}\u{1F1F8}", format: "(xxx) xxx-xxxx" },
|
|
72500
|
+
{ code: "GB", name: "United Kingdom", dialCode: "+44", flag: "\u{1F1EC}\u{1F1E7}", format: "xxxx xxxxxx" },
|
|
72501
|
+
{ code: "TR", name: "Turkey", dialCode: "+90", flag: "\u{1F1F9}\u{1F1F7}", format: "(xxx) xxx xx xx" },
|
|
72502
|
+
{ code: "DE", name: "Germany", dialCode: "+49", flag: "\u{1F1E9}\u{1F1EA}", format: "xxx xxxxxxxx" },
|
|
72503
|
+
{ code: "FR", name: "France", dialCode: "+33", flag: "\u{1F1EB}\u{1F1F7}", format: "x xx xx xx xx" },
|
|
72504
|
+
{ code: "IT", name: "Italy", dialCode: "+39", flag: "\u{1F1EE}\u{1F1F9}", format: "xxx xxxxxxx" },
|
|
72505
|
+
{ code: "ES", name: "Spain", dialCode: "+34", flag: "\u{1F1EA}\u{1F1F8}", format: "xxx xxx xxx" },
|
|
72506
|
+
{ code: "CN", name: "China", dialCode: "+86", flag: "\u{1F1E8}\u{1F1F3}", format: "xxx xxxx xxxx" },
|
|
72507
|
+
{ code: "JP", name: "Japan", dialCode: "+81", flag: "\u{1F1EF}\u{1F1F5}", format: "xx xxxx xxxx" },
|
|
72508
|
+
{ code: "KR", name: "South Korea", dialCode: "+82", flag: "\u{1F1F0}\u{1F1F7}", format: "xx xxxx xxxx" },
|
|
72509
|
+
{ code: "IN", name: "India", dialCode: "+91", flag: "\u{1F1EE}\u{1F1F3}", format: "xxxxx xxxxx" },
|
|
72510
|
+
{ code: "BR", name: "Brazil", dialCode: "+55", flag: "\u{1F1E7}\u{1F1F7}", format: "(xx) xxxxx-xxxx" },
|
|
72511
|
+
{ code: "MX", name: "Mexico", dialCode: "+52", flag: "\u{1F1F2}\u{1F1FD}", format: "xxx xxx xxxx" },
|
|
72512
|
+
{ code: "CA", name: "Canada", dialCode: "+1", flag: "\u{1F1E8}\u{1F1E6}", format: "(xxx) xxx-xxxx" },
|
|
72513
|
+
{ code: "AU", name: "Australia", dialCode: "+61", flag: "\u{1F1E6}\u{1F1FA}", format: "xxx xxx xxx" },
|
|
72514
|
+
{ code: "RU", name: "Russia", dialCode: "+7", flag: "\u{1F1F7}\u{1F1FA}", format: "(xxx) xxx-xx-xx" },
|
|
72515
|
+
{ code: "NL", name: "Netherlands", dialCode: "+31", flag: "\u{1F1F3}\u{1F1F1}", format: "x xxxxxxxx" },
|
|
72516
|
+
{ code: "SE", name: "Sweden", dialCode: "+46", flag: "\u{1F1F8}\u{1F1EA}", format: "xx xxx xx xx" },
|
|
72517
|
+
{ code: "NO", name: "Norway", dialCode: "+47", flag: "\u{1F1F3}\u{1F1F4}", format: "xxx xx xxx" },
|
|
72518
|
+
{ code: "FI", name: "Finland", dialCode: "+358", flag: "\u{1F1EB}\u{1F1EE}", format: "xx xxxxxxx" }
|
|
72519
|
+
];
|
|
72520
|
+
function formatPhoneNumber(number4, format3) {
|
|
72521
|
+
const cleaned = number4.replace(/\D/g, "");
|
|
72522
|
+
let formatted = "";
|
|
72523
|
+
let digitIndex = 0;
|
|
72524
|
+
for (let i3 = 0; i3 < format3.length && digitIndex < cleaned.length; i3++) {
|
|
72525
|
+
if (format3[i3] === "x") {
|
|
72526
|
+
formatted += cleaned[digitIndex];
|
|
72527
|
+
digitIndex++;
|
|
72528
|
+
} else {
|
|
72529
|
+
formatted += format3[i3];
|
|
72530
|
+
}
|
|
72531
|
+
}
|
|
72532
|
+
return formatted;
|
|
72533
|
+
}
|
|
72534
|
+
function validatePhoneNumber(number4, countryCode) {
|
|
72535
|
+
const cleaned = number4.replace(/\D/g, "");
|
|
72536
|
+
const country = countries.find((c2) => c2.code === countryCode);
|
|
72537
|
+
if (!country)
|
|
72538
|
+
return false;
|
|
72539
|
+
const expectedLength = country.format.split("").filter((c2) => c2 === "x").length;
|
|
72540
|
+
return cleaned.length === expectedLength;
|
|
72541
|
+
}
|
|
72542
|
+
function toInternationalFormat(countryCode, phoneNumber) {
|
|
72543
|
+
const country = countries.find((c2) => c2.code === countryCode);
|
|
72544
|
+
if (!country)
|
|
72545
|
+
return phoneNumber;
|
|
72546
|
+
const cleaned = phoneNumber.replace(/\D/g, "");
|
|
72547
|
+
return `${country.dialCode}${cleaned}`;
|
|
72548
|
+
}
|
|
72549
|
+
var MoonUIPhoneNumberInputPro = t__default.forwardRef(({
|
|
72550
|
+
value = { country: "US", number: "" },
|
|
72551
|
+
onChange,
|
|
72552
|
+
defaultCountry = "US",
|
|
72553
|
+
countries: customCountries,
|
|
72554
|
+
showFlags = true,
|
|
72555
|
+
showDialCode = true,
|
|
72556
|
+
autoFormat = true,
|
|
72557
|
+
validateOnChange = true,
|
|
72558
|
+
showValidationIcon = true,
|
|
72559
|
+
label,
|
|
72560
|
+
error: error42,
|
|
72561
|
+
helperText,
|
|
72562
|
+
required: required2,
|
|
72563
|
+
className,
|
|
72564
|
+
inputClassName,
|
|
72565
|
+
selectClassName,
|
|
72566
|
+
labelClassName,
|
|
72567
|
+
errorClassName,
|
|
72568
|
+
disabled,
|
|
72569
|
+
allowInternationalFormat = true,
|
|
72570
|
+
...props
|
|
72571
|
+
}, ref) => {
|
|
72572
|
+
const [isValid, setIsValid] = useState(false);
|
|
72573
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
72574
|
+
const inputRef = useRef(null);
|
|
72575
|
+
const countryList = customCountries || countries;
|
|
72576
|
+
const selectedCountry = countryList.find((c2) => c2.code === value.country) || countryList[0];
|
|
72577
|
+
useEffect(() => {
|
|
72578
|
+
if (validateOnChange && value.number) {
|
|
72579
|
+
const valid = validatePhoneNumber(value.number, value.country);
|
|
72580
|
+
setIsValid(valid);
|
|
72581
|
+
}
|
|
72582
|
+
}, [value, validateOnChange]);
|
|
72583
|
+
const handleCountryChange = (countryCode) => {
|
|
72584
|
+
const fullNumber = allowInternationalFormat ? toInternationalFormat(countryCode, value.number) : value.number;
|
|
72585
|
+
onChange?.({
|
|
72586
|
+
country: countryCode,
|
|
72587
|
+
number: value.number,
|
|
72588
|
+
fullNumber,
|
|
72589
|
+
isValid: validatePhoneNumber(value.number, countryCode)
|
|
72590
|
+
});
|
|
72591
|
+
};
|
|
72592
|
+
const handleNumberChange = (e2) => {
|
|
72593
|
+
let newValue = e2.target.value;
|
|
72594
|
+
if (autoFormat) {
|
|
72595
|
+
const cleaned = newValue.replace(/\D/g, "");
|
|
72596
|
+
newValue = formatPhoneNumber(cleaned, selectedCountry.format);
|
|
72597
|
+
}
|
|
72598
|
+
const valid = validatePhoneNumber(newValue, value.country);
|
|
72599
|
+
const fullNumber = allowInternationalFormat ? toInternationalFormat(value.country, newValue) : newValue;
|
|
72600
|
+
onChange?.({
|
|
72601
|
+
country: value.country,
|
|
72602
|
+
number: newValue,
|
|
72603
|
+
fullNumber,
|
|
72604
|
+
isValid: valid
|
|
72605
|
+
});
|
|
72606
|
+
};
|
|
72607
|
+
const handlePaste2 = (e2) => {
|
|
72608
|
+
if (!autoFormat)
|
|
72609
|
+
return;
|
|
72610
|
+
e2.preventDefault();
|
|
72611
|
+
const pastedText = e2.clipboardData.getData("text");
|
|
72612
|
+
const cleaned = pastedText.replace(/\D/g, "");
|
|
72613
|
+
const formatted = formatPhoneNumber(cleaned, selectedCountry.format);
|
|
72614
|
+
const valid = validatePhoneNumber(formatted, value.country);
|
|
72615
|
+
const fullNumber = allowInternationalFormat ? toInternationalFormat(value.country, formatted) : formatted;
|
|
72616
|
+
onChange?.({
|
|
72617
|
+
country: value.country,
|
|
72618
|
+
number: formatted,
|
|
72619
|
+
fullNumber,
|
|
72620
|
+
isValid: valid
|
|
72621
|
+
});
|
|
72622
|
+
};
|
|
72623
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-2", className), ...props, children: [
|
|
72624
|
+
label && /* @__PURE__ */ jsxs(MoonUILabelPro, { htmlFor: "phone-number", className: labelClassName, children: [
|
|
72625
|
+
label,
|
|
72626
|
+
required2 && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
72627
|
+
] }),
|
|
72628
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
72629
|
+
/* @__PURE__ */ jsxs(
|
|
72630
|
+
MoonUISelectPro,
|
|
72631
|
+
{
|
|
72632
|
+
value: value.country,
|
|
72633
|
+
onValueChange: handleCountryChange,
|
|
72634
|
+
disabled,
|
|
72635
|
+
children: [
|
|
72636
|
+
/* @__PURE__ */ jsx(
|
|
72637
|
+
MoonUISelectTriggerPro,
|
|
72638
|
+
{
|
|
72639
|
+
className: cn(
|
|
72640
|
+
"w-[140px]",
|
|
72641
|
+
error42 && "border-destructive",
|
|
72642
|
+
selectClassName
|
|
72643
|
+
),
|
|
72644
|
+
children: /* @__PURE__ */ jsx(MoonUISelectValuePro, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
72645
|
+
showFlags && /* @__PURE__ */ jsx("span", { className: "text-lg", children: selectedCountry.flag }),
|
|
72646
|
+
showDialCode && /* @__PURE__ */ jsx("span", { className: "text-sm", children: selectedCountry.dialCode }),
|
|
72647
|
+
!showFlags && !showDialCode && /* @__PURE__ */ jsx("span", { className: "text-sm", children: selectedCountry.code })
|
|
72648
|
+
] }) })
|
|
72649
|
+
}
|
|
72650
|
+
),
|
|
72651
|
+
/* @__PURE__ */ jsx(MoonUISelectContentPro, { children: countryList.map((country) => /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: country.code, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
72652
|
+
showFlags && /* @__PURE__ */ jsx("span", { className: "text-lg", children: country.flag }),
|
|
72653
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: country.name }),
|
|
72654
|
+
showDialCode && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: country.dialCode })
|
|
72655
|
+
] }) }, country.code)) })
|
|
72656
|
+
]
|
|
72657
|
+
}
|
|
72658
|
+
),
|
|
72659
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
|
|
72660
|
+
/* @__PURE__ */ jsx(
|
|
72661
|
+
MoonUIInputPro,
|
|
72662
|
+
{
|
|
72663
|
+
ref: inputRef,
|
|
72664
|
+
id: "phone-number",
|
|
72665
|
+
type: "tel",
|
|
72666
|
+
value: value.number,
|
|
72667
|
+
onChange: handleNumberChange,
|
|
72668
|
+
onPaste: handlePaste2,
|
|
72669
|
+
onFocus: () => setIsFocused(true),
|
|
72670
|
+
onBlur: () => setIsFocused(false),
|
|
72671
|
+
placeholder: selectedCountry.format.replace(/x/g, "\u2022"),
|
|
72672
|
+
className: cn(
|
|
72673
|
+
"pr-10",
|
|
72674
|
+
error42 && "border-destructive",
|
|
72675
|
+
inputClassName
|
|
72676
|
+
),
|
|
72677
|
+
disabled
|
|
72678
|
+
}
|
|
72679
|
+
),
|
|
72680
|
+
showValidationIcon && value.number && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: isValid ? /* @__PURE__ */ jsx(
|
|
72681
|
+
motion.div,
|
|
72682
|
+
{
|
|
72683
|
+
initial: { scale: 0, opacity: 0 },
|
|
72684
|
+
animate: { scale: 1, opacity: 1 },
|
|
72685
|
+
exit: { scale: 0, opacity: 0 },
|
|
72686
|
+
transition: { duration: 0.2 },
|
|
72687
|
+
children: /* @__PURE__ */ jsx(Check, { className: "w-4 h-4 text-green-500" })
|
|
72688
|
+
},
|
|
72689
|
+
"valid"
|
|
72690
|
+
) : /* @__PURE__ */ jsx(
|
|
72691
|
+
motion.div,
|
|
72692
|
+
{
|
|
72693
|
+
initial: { scale: 0, opacity: 0 },
|
|
72694
|
+
animate: { scale: 1, opacity: 1 },
|
|
72695
|
+
exit: { scale: 0, opacity: 0 },
|
|
72696
|
+
transition: { duration: 0.2 },
|
|
72697
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4 text-destructive" })
|
|
72698
|
+
},
|
|
72699
|
+
"invalid"
|
|
72700
|
+
) }) })
|
|
72701
|
+
] })
|
|
72702
|
+
] }),
|
|
72703
|
+
(error42 || helperText) && /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: error42 ? /* @__PURE__ */ jsx(
|
|
72704
|
+
motion.p,
|
|
72705
|
+
{
|
|
72706
|
+
initial: { opacity: 0, height: 0 },
|
|
72707
|
+
animate: { opacity: 1, height: "auto" },
|
|
72708
|
+
exit: { opacity: 0, height: 0 },
|
|
72709
|
+
className: cn("text-sm text-destructive", errorClassName),
|
|
72710
|
+
children: error42
|
|
72711
|
+
},
|
|
72712
|
+
"error"
|
|
72713
|
+
) : /* @__PURE__ */ jsx(
|
|
72714
|
+
motion.p,
|
|
72715
|
+
{
|
|
72716
|
+
initial: { opacity: 0, height: 0 },
|
|
72717
|
+
animate: { opacity: 1, height: "auto" },
|
|
72718
|
+
exit: { opacity: 0, height: 0 },
|
|
72719
|
+
className: "text-sm text-muted-foreground",
|
|
72720
|
+
children: helperText
|
|
72721
|
+
},
|
|
72722
|
+
"helper"
|
|
72723
|
+
) }),
|
|
72724
|
+
allowInternationalFormat && value.number && isValid && /* @__PURE__ */ jsxs(
|
|
72725
|
+
motion.div,
|
|
72726
|
+
{
|
|
72727
|
+
initial: { opacity: 0, y: -10 },
|
|
72728
|
+
animate: { opacity: 1, y: 0 },
|
|
72729
|
+
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
72730
|
+
children: [
|
|
72731
|
+
/* @__PURE__ */ jsx(Globe, { className: "w-4 h-4" }),
|
|
72732
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
72733
|
+
"International: ",
|
|
72734
|
+
toInternationalFormat(value.country, value.number)
|
|
72735
|
+
] })
|
|
72736
|
+
]
|
|
72737
|
+
}
|
|
72738
|
+
)
|
|
72739
|
+
] });
|
|
72740
|
+
});
|
|
72741
|
+
MoonUIPhoneNumberInputPro.displayName = "MoonUIPhoneNumberInputPro";
|
|
72742
|
+
var quizFormVariants = cva(
|
|
72743
|
+
"relative w-full rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
72744
|
+
{
|
|
72745
|
+
variants: {
|
|
72746
|
+
variant: {
|
|
72747
|
+
default: "border-border",
|
|
72748
|
+
exam: "border-primary/20 bg-primary/5",
|
|
72749
|
+
personality: "border-secondary/20 bg-secondary/5"
|
|
72750
|
+
},
|
|
72751
|
+
size: {
|
|
72752
|
+
sm: "p-4",
|
|
72753
|
+
md: "p-6",
|
|
72754
|
+
lg: "p-8"
|
|
72755
|
+
}
|
|
72756
|
+
},
|
|
72757
|
+
defaultVariants: {
|
|
72758
|
+
variant: "default",
|
|
72759
|
+
size: "md"
|
|
72760
|
+
}
|
|
72761
|
+
}
|
|
72762
|
+
);
|
|
72763
|
+
var MoonUIQuizFormPro = t__default.forwardRef(({
|
|
72764
|
+
className,
|
|
72765
|
+
variant,
|
|
72766
|
+
size: size4,
|
|
72222
72767
|
questions: initialQuestions,
|
|
72768
|
+
settings = {},
|
|
72223
72769
|
onComplete,
|
|
72224
|
-
|
|
72225
|
-
|
|
72226
|
-
|
|
72227
|
-
|
|
72228
|
-
|
|
72229
|
-
|
|
72230
|
-
|
|
72231
|
-
|
|
72232
|
-
passingScore = 70,
|
|
72233
|
-
instantFeedback = false,
|
|
72234
|
-
showHints = false,
|
|
72235
|
-
className
|
|
72236
|
-
}) => {
|
|
72237
|
-
const [questions] = useState(
|
|
72238
|
-
() => shuffleQuestions ? shuffleArray(initialQuestions) : initialQuestions
|
|
72239
|
-
);
|
|
72240
|
-
const [answers, setAnswers] = useState({});
|
|
72241
|
-
const [results, setResults] = useState([]);
|
|
72242
|
-
const [timeRemaining, setTimeRemaining] = useState(totalTimeLimit || 0);
|
|
72243
|
-
const [questionStartTime, setQuestionStartTime] = useState({});
|
|
72770
|
+
onProgress,
|
|
72771
|
+
title,
|
|
72772
|
+
description,
|
|
72773
|
+
...props
|
|
72774
|
+
}, ref) => {
|
|
72775
|
+
const [questions, setQuestions] = useState([]);
|
|
72776
|
+
const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0);
|
|
72777
|
+
const [userAnswers, setUserAnswers] = useState({});
|
|
72244
72778
|
const [showResults, setShowResults] = useState(false);
|
|
72245
|
-
const [
|
|
72779
|
+
const [quizResult, setQuizResult] = useState(null);
|
|
72780
|
+
const [timeLeft, setTimeLeft] = useState(
|
|
72781
|
+
settings.timeLimit ? settings.timeLimit * 60 : null
|
|
72782
|
+
);
|
|
72783
|
+
const [questionStartTime, setQuestionStartTime] = useState(Date.now());
|
|
72784
|
+
const [showHint, setShowHint] = useState(false);
|
|
72785
|
+
const [attempts, setAttempts] = useState(0);
|
|
72246
72786
|
useEffect(() => {
|
|
72247
|
-
|
|
72787
|
+
let processedQuestions = [...initialQuestions];
|
|
72788
|
+
if (settings.shuffleQuestions) {
|
|
72789
|
+
processedQuestions = shuffleArray(processedQuestions);
|
|
72790
|
+
}
|
|
72791
|
+
if (settings.shuffleOptions) {
|
|
72792
|
+
processedQuestions = processedQuestions.map((q) => {
|
|
72793
|
+
if (q.options) {
|
|
72794
|
+
return { ...q, options: shuffleArray([...q.options]) };
|
|
72795
|
+
}
|
|
72796
|
+
return q;
|
|
72797
|
+
});
|
|
72798
|
+
}
|
|
72799
|
+
setQuestions(processedQuestions);
|
|
72800
|
+
}, [initialQuestions, settings.shuffleQuestions, settings.shuffleOptions]);
|
|
72801
|
+
useEffect(() => {
|
|
72802
|
+
if (timeLeft === null || timeLeft <= 0 || showResults)
|
|
72248
72803
|
return;
|
|
72249
|
-
const
|
|
72250
|
-
|
|
72251
|
-
if (prev <= 1) {
|
|
72252
|
-
|
|
72804
|
+
const timer = setInterval(() => {
|
|
72805
|
+
setTimeLeft((prev) => {
|
|
72806
|
+
if (prev === null || prev <= 1) {
|
|
72807
|
+
handleComplete();
|
|
72253
72808
|
return 0;
|
|
72254
72809
|
}
|
|
72255
72810
|
return prev - 1;
|
|
72256
72811
|
});
|
|
72257
72812
|
}, 1e3);
|
|
72258
|
-
return () => clearInterval(
|
|
72259
|
-
}, [
|
|
72813
|
+
return () => clearInterval(timer);
|
|
72814
|
+
}, [timeLeft, showResults]);
|
|
72260
72815
|
useEffect(() => {
|
|
72261
|
-
if (
|
|
72262
|
-
|
|
72263
|
-
|
|
72264
|
-
|
|
72265
|
-
|
|
72266
|
-
|
|
72267
|
-
|
|
72268
|
-
|
|
72269
|
-
|
|
72816
|
+
if (onProgress) {
|
|
72817
|
+
onProgress(currentQuestionIndex + 1, questions.length);
|
|
72818
|
+
}
|
|
72819
|
+
}, [currentQuestionIndex, questions.length, onProgress]);
|
|
72820
|
+
const currentQuestion = questions[currentQuestionIndex];
|
|
72821
|
+
const shuffleArray = (array2) => {
|
|
72822
|
+
const newArray = [...array2];
|
|
72823
|
+
for (let i3 = newArray.length - 1; i3 > 0; i3--) {
|
|
72824
|
+
const j = Math.floor(Math.random() * (i3 + 1));
|
|
72825
|
+
[newArray[i3], newArray[j]] = [newArray[j], newArray[i3]];
|
|
72826
|
+
}
|
|
72827
|
+
return newArray;
|
|
72828
|
+
};
|
|
72829
|
+
const saveAnswer = (answer) => {
|
|
72830
|
+
const timeSpent = Date.now() - questionStartTime;
|
|
72831
|
+
setUserAnswers((prev) => ({
|
|
72832
|
+
...prev,
|
|
72833
|
+
[currentQuestion.id]: {
|
|
72834
|
+
questionId: currentQuestion.id,
|
|
72835
|
+
answer,
|
|
72836
|
+
timeSpent
|
|
72837
|
+
}
|
|
72838
|
+
}));
|
|
72839
|
+
};
|
|
72840
|
+
const handleNext = () => {
|
|
72841
|
+
if (currentQuestionIndex < questions.length - 1) {
|
|
72842
|
+
setCurrentQuestionIndex((prev) => prev + 1);
|
|
72843
|
+
setQuestionStartTime(Date.now());
|
|
72844
|
+
setShowHint(false);
|
|
72845
|
+
} else {
|
|
72846
|
+
handleComplete();
|
|
72847
|
+
}
|
|
72848
|
+
};
|
|
72849
|
+
const handlePrevious = () => {
|
|
72850
|
+
if (currentQuestionIndex > 0) {
|
|
72851
|
+
setCurrentQuestionIndex((prev) => prev - 1);
|
|
72852
|
+
setShowHint(false);
|
|
72853
|
+
}
|
|
72854
|
+
};
|
|
72855
|
+
const handleComplete = () => {
|
|
72856
|
+
const result = calculateResult();
|
|
72857
|
+
setQuizResult(result);
|
|
72858
|
+
setShowResults(true);
|
|
72859
|
+
setAttempts((prev) => prev + 1);
|
|
72860
|
+
if (onComplete) {
|
|
72861
|
+
onComplete(result);
|
|
72862
|
+
}
|
|
72863
|
+
};
|
|
72864
|
+
const calculateResult = () => {
|
|
72270
72865
|
let totalScore = 0;
|
|
72271
|
-
|
|
72272
|
-
|
|
72866
|
+
let userScore = 0;
|
|
72867
|
+
const answers = [];
|
|
72868
|
+
questions.forEach((question) => {
|
|
72869
|
+
const userAnswer = userAnswers[question.id];
|
|
72273
72870
|
const points = question.points || 1;
|
|
72274
72871
|
totalScore += points;
|
|
72275
72872
|
let isCorrect = false;
|
|
72276
|
-
if (answer
|
|
72277
|
-
|
|
72278
|
-
|
|
72279
|
-
|
|
72280
|
-
|
|
72281
|
-
|
|
72282
|
-
|
|
72873
|
+
if (userAnswer?.answer && question.correctAnswer !== void 0) {
|
|
72874
|
+
switch (question.type) {
|
|
72875
|
+
case "single-choice":
|
|
72876
|
+
case "true-false":
|
|
72877
|
+
case "text":
|
|
72878
|
+
isCorrect = userAnswer.answer === question.correctAnswer;
|
|
72879
|
+
break;
|
|
72880
|
+
case "multiple-choice":
|
|
72881
|
+
if (Array.isArray(userAnswer.answer) && Array.isArray(question.correctAnswer)) {
|
|
72882
|
+
isCorrect = userAnswer.answer.length === question.correctAnswer.length && userAnswer.answer.every((a2) => question.correctAnswer.includes(a2));
|
|
72883
|
+
}
|
|
72884
|
+
break;
|
|
72885
|
+
case "matching":
|
|
72886
|
+
if (typeof userAnswer.answer === "object" && typeof question.correctAnswer === "object") {
|
|
72887
|
+
const correct = question.correctAnswer;
|
|
72888
|
+
const user = userAnswer.answer;
|
|
72889
|
+
isCorrect = Object.keys(correct).every((key) => correct[key] === user[key]);
|
|
72890
|
+
}
|
|
72891
|
+
break;
|
|
72892
|
+
case "rating":
|
|
72893
|
+
isCorrect = true;
|
|
72894
|
+
break;
|
|
72283
72895
|
}
|
|
72284
72896
|
}
|
|
72285
|
-
|
|
72286
|
-
|
|
72287
|
-
|
|
72897
|
+
if (isCorrect) {
|
|
72898
|
+
userScore += points;
|
|
72899
|
+
}
|
|
72900
|
+
answers.push({
|
|
72288
72901
|
questionId: question.id,
|
|
72289
|
-
answer,
|
|
72902
|
+
userAnswer: userAnswer?.answer || null,
|
|
72903
|
+
correctAnswer: question.correctAnswer,
|
|
72290
72904
|
isCorrect,
|
|
72291
|
-
points:
|
|
72292
|
-
|
|
72293
|
-
};
|
|
72905
|
+
points: isCorrect ? points : 0
|
|
72906
|
+
});
|
|
72294
72907
|
});
|
|
72295
|
-
|
|
72296
|
-
|
|
72297
|
-
|
|
72298
|
-
|
|
72299
|
-
|
|
72300
|
-
|
|
72301
|
-
|
|
72302
|
-
|
|
72908
|
+
const percentage = totalScore > 0 ? userScore / totalScore * 100 : 0;
|
|
72909
|
+
const totalTimeSpent = Object.values(userAnswers).reduce(
|
|
72910
|
+
(sum, answer) => sum + (answer.timeSpent || 0),
|
|
72911
|
+
0
|
|
72912
|
+
);
|
|
72913
|
+
return {
|
|
72914
|
+
score: userScore,
|
|
72915
|
+
totalScore,
|
|
72916
|
+
percentage,
|
|
72917
|
+
passed: settings.passingScore ? percentage >= settings.passingScore : void 0,
|
|
72918
|
+
answers,
|
|
72919
|
+
timeSpent: totalTimeSpent,
|
|
72920
|
+
completedAt: /* @__PURE__ */ new Date()
|
|
72921
|
+
};
|
|
72922
|
+
};
|
|
72923
|
+
const handleRestart = () => {
|
|
72924
|
+
setCurrentQuestionIndex(0);
|
|
72925
|
+
setUserAnswers({});
|
|
72926
|
+
setShowResults(false);
|
|
72927
|
+
setQuizResult(null);
|
|
72928
|
+
setTimeLeft(settings.timeLimit ? settings.timeLimit * 60 : null);
|
|
72929
|
+
setQuestionStartTime(Date.now());
|
|
72930
|
+
setShowHint(false);
|
|
72931
|
+
if (settings.shuffleQuestions) {
|
|
72932
|
+
setQuestions(shuffleArray([...initialQuestions]));
|
|
72303
72933
|
}
|
|
72304
72934
|
};
|
|
72935
|
+
const handleDownloadResults = () => {
|
|
72936
|
+
if (!quizResult)
|
|
72937
|
+
return;
|
|
72938
|
+
const data = {
|
|
72939
|
+
title,
|
|
72940
|
+
completedAt: quizResult.completedAt,
|
|
72941
|
+
score: quizResult.score,
|
|
72942
|
+
totalScore: quizResult.totalScore,
|
|
72943
|
+
percentage: quizResult.percentage,
|
|
72944
|
+
passed: quizResult.passed,
|
|
72945
|
+
timeSpent: quizResult.timeSpent,
|
|
72946
|
+
answers: quizResult.answers.map((a2) => {
|
|
72947
|
+
const question = questions.find((q) => q.id === a2.questionId);
|
|
72948
|
+
return {
|
|
72949
|
+
question: question?.question,
|
|
72950
|
+
userAnswer: a2.userAnswer,
|
|
72951
|
+
correctAnswer: a2.correctAnswer,
|
|
72952
|
+
isCorrect: a2.isCorrect,
|
|
72953
|
+
points: a2.points
|
|
72954
|
+
};
|
|
72955
|
+
})
|
|
72956
|
+
};
|
|
72957
|
+
const blob = new Blob([JSON.stringify(data, null, 2)], { type: "application/json" });
|
|
72958
|
+
const url2 = URL.createObjectURL(blob);
|
|
72959
|
+
const link = document.createElement("a");
|
|
72960
|
+
link.href = url2;
|
|
72961
|
+
link.download = `quiz-results-${Date.now()}.json`;
|
|
72962
|
+
link.click();
|
|
72963
|
+
URL.revokeObjectURL(url2);
|
|
72964
|
+
};
|
|
72305
72965
|
const formatTime = (seconds) => {
|
|
72306
72966
|
const mins = Math.floor(seconds / 60);
|
|
72307
72967
|
const secs = seconds % 60;
|
|
72308
72968
|
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
|
72309
72969
|
};
|
|
72310
|
-
const
|
|
72311
|
-
|
|
72312
|
-
|
|
72313
|
-
|
|
72314
|
-
|
|
72315
|
-
|
|
72316
|
-
|
|
72317
|
-
|
|
72318
|
-
|
|
72319
|
-
|
|
72320
|
-
|
|
72321
|
-
|
|
72322
|
-
|
|
72323
|
-
|
|
72324
|
-
|
|
72325
|
-
|
|
72326
|
-
|
|
72327
|
-
|
|
72328
|
-
|
|
72329
|
-
|
|
72330
|
-
|
|
72331
|
-
|
|
72332
|
-
|
|
72333
|
-
|
|
72334
|
-
|
|
72335
|
-
|
|
72336
|
-
|
|
72337
|
-
] }),
|
|
72338
|
-
question.points && question.points > 1 && /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "outline", children: [
|
|
72339
|
-
question.points,
|
|
72340
|
-
" points"
|
|
72341
|
-
] })
|
|
72342
|
-
] }),
|
|
72343
|
-
/* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-xl", children: question.question }),
|
|
72344
|
-
question.description && /* @__PURE__ */ jsx(MoonUICardDescriptionPro, { children: question.description })
|
|
72345
|
-
] }),
|
|
72346
|
-
/* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "space-y-4", children: [
|
|
72347
|
-
question.image && /* @__PURE__ */ jsx(
|
|
72348
|
-
"img",
|
|
72349
|
-
{
|
|
72350
|
-
src: question.image,
|
|
72351
|
-
alt: "Question illustration",
|
|
72352
|
-
className: "w-full rounded-lg"
|
|
72353
|
-
}
|
|
72354
|
-
),
|
|
72355
|
-
question.type === "single-choice" && questionOptions && /* @__PURE__ */ jsx(
|
|
72356
|
-
MoonUIRadioGroupPro,
|
|
72357
|
-
{
|
|
72358
|
-
value: currentAnswer || "",
|
|
72359
|
-
onValueChange: handleAnswerChange,
|
|
72360
|
-
children: questionOptions.map((option, optionIndex) => /* @__PURE__ */ jsxs(
|
|
72361
|
-
motion.div,
|
|
72362
|
-
{
|
|
72363
|
-
initial: { opacity: 0, x: -20 },
|
|
72364
|
-
animate: { opacity: 1, x: 0 },
|
|
72365
|
-
transition: { delay: optionIndex * 0.1 },
|
|
72366
|
-
className: "flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50 transition-colors",
|
|
72367
|
-
children: [
|
|
72368
|
-
/* @__PURE__ */ jsx(MoonUIRadioGroupItemPro, { value: String(option.value), id: `${question.id}-${option.value}` }),
|
|
72369
|
-
/* @__PURE__ */ jsx(
|
|
72370
|
-
MoonUILabelPro,
|
|
72371
|
-
{
|
|
72372
|
-
htmlFor: `${question.id}-${option.value}`,
|
|
72373
|
-
className: "flex-1 cursor-pointer",
|
|
72374
|
-
children: option.label || option.value
|
|
72375
|
-
}
|
|
72376
|
-
)
|
|
72377
|
-
]
|
|
72378
|
-
},
|
|
72379
|
-
String(option.value)
|
|
72380
|
-
))
|
|
72381
|
-
}
|
|
72382
|
-
),
|
|
72383
|
-
question.type === "multiple-choice" && questionOptions && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: questionOptions.map((option, optionIndex) => /* @__PURE__ */ jsxs(
|
|
72384
|
-
motion.div,
|
|
72970
|
+
const renderQuestion = () => {
|
|
72971
|
+
if (!currentQuestion)
|
|
72972
|
+
return null;
|
|
72973
|
+
const userAnswer = userAnswers[currentQuestion.id]?.answer;
|
|
72974
|
+
switch (currentQuestion.type) {
|
|
72975
|
+
case "single-choice":
|
|
72976
|
+
case "true-false":
|
|
72977
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: currentQuestion.options?.map((option, index2) => /* @__PURE__ */ jsx(
|
|
72978
|
+
motion.button,
|
|
72979
|
+
{
|
|
72980
|
+
initial: { opacity: 0, x: -20 },
|
|
72981
|
+
animate: { opacity: 1, x: 0 },
|
|
72982
|
+
transition: { delay: index2 * 0.1 },
|
|
72983
|
+
onClick: () => saveAnswer(option),
|
|
72984
|
+
className: cn(
|
|
72985
|
+
"w-full text-left p-4 rounded-lg border transition-colors",
|
|
72986
|
+
userAnswer === option ? "border-primary bg-primary/10" : "border-border hover:border-primary/50"
|
|
72987
|
+
),
|
|
72988
|
+
children: option
|
|
72989
|
+
},
|
|
72990
|
+
index2
|
|
72991
|
+
)) });
|
|
72992
|
+
case "multiple-choice":
|
|
72993
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: currentQuestion.options?.map((option, index2) => {
|
|
72994
|
+
const selected = Array.isArray(userAnswer) && userAnswer.includes(option);
|
|
72995
|
+
return /* @__PURE__ */ jsx(
|
|
72996
|
+
motion.button,
|
|
72385
72997
|
{
|
|
72386
72998
|
initial: { opacity: 0, x: -20 },
|
|
72387
72999
|
animate: { opacity: 1, x: 0 },
|
|
72388
|
-
transition: { delay:
|
|
72389
|
-
|
|
72390
|
-
|
|
72391
|
-
|
|
72392
|
-
|
|
72393
|
-
|
|
72394
|
-
|
|
72395
|
-
|
|
72396
|
-
|
|
72397
|
-
|
|
72398
|
-
|
|
72399
|
-
|
|
72400
|
-
|
|
72401
|
-
|
|
72402
|
-
|
|
72403
|
-
|
|
72404
|
-
|
|
72405
|
-
),
|
|
72406
|
-
/* @__PURE__ */ jsx(
|
|
72407
|
-
MoonUILabelPro,
|
|
72408
|
-
{
|
|
72409
|
-
htmlFor: `${question.id}-${option.value}`,
|
|
72410
|
-
className: "flex-1 cursor-pointer",
|
|
72411
|
-
children: option.label || option.value
|
|
72412
|
-
}
|
|
72413
|
-
)
|
|
72414
|
-
]
|
|
73000
|
+
transition: { delay: index2 * 0.1 },
|
|
73001
|
+
onClick: () => {
|
|
73002
|
+
const current = userAnswer || [];
|
|
73003
|
+
const newAnswer = selected ? current.filter((a2) => a2 !== option) : [...current, option];
|
|
73004
|
+
saveAnswer(newAnswer);
|
|
73005
|
+
},
|
|
73006
|
+
className: cn(
|
|
73007
|
+
"w-full text-left p-4 rounded-lg border transition-colors",
|
|
73008
|
+
selected ? "border-primary bg-primary/10" : "border-border hover:border-primary/50"
|
|
73009
|
+
),
|
|
73010
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
73011
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
73012
|
+
"w-5 h-5 rounded border-2 transition-colors",
|
|
73013
|
+
selected ? "bg-primary border-primary" : "border-border"
|
|
73014
|
+
), children: selected && /* @__PURE__ */ jsx(CheckCircle2, { className: "w-full h-full text-primary-foreground" }) }),
|
|
73015
|
+
option
|
|
73016
|
+
] })
|
|
72415
73017
|
},
|
|
72416
|
-
|
|
72417
|
-
)
|
|
72418
|
-
|
|
72419
|
-
|
|
72420
|
-
|
|
72421
|
-
|
|
72422
|
-
|
|
72423
|
-
|
|
72424
|
-
|
|
72425
|
-
|
|
72426
|
-
|
|
72427
|
-
] }),
|
|
72428
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50", children: [
|
|
72429
|
-
/* @__PURE__ */ jsx(MoonUIRadioGroupItemPro, { value: "false", id: `${question.id}-false` }),
|
|
72430
|
-
/* @__PURE__ */ jsx(MoonUILabelPro, { htmlFor: `${question.id}-false`, className: "flex-1 cursor-pointer", children: "False" })
|
|
72431
|
-
] })
|
|
72432
|
-
]
|
|
72433
|
-
}
|
|
72434
|
-
),
|
|
72435
|
-
question.type === "text" && /* @__PURE__ */ jsx(
|
|
72436
|
-
MoonUITextareaPro,
|
|
72437
|
-
{
|
|
72438
|
-
value: currentAnswer || "",
|
|
72439
|
-
onChange: (e2) => handleAnswerChange(e2.target.value),
|
|
72440
|
-
placeholder: "Type your answer here...",
|
|
72441
|
-
className: "min-h-[120px]"
|
|
72442
|
-
}
|
|
72443
|
-
),
|
|
72444
|
-
question.type === "rating" && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
72445
|
-
/* @__PURE__ */ jsx(
|
|
72446
|
-
MoonUISliderPro,
|
|
73018
|
+
index2
|
|
73019
|
+
);
|
|
73020
|
+
}) });
|
|
73021
|
+
case "text":
|
|
73022
|
+
return /* @__PURE__ */ jsx(
|
|
73023
|
+
motion.div,
|
|
73024
|
+
{
|
|
73025
|
+
initial: { opacity: 0, y: 20 },
|
|
73026
|
+
animate: { opacity: 1, y: 0 },
|
|
73027
|
+
children: /* @__PURE__ */ jsx(
|
|
73028
|
+
"textarea",
|
|
72447
73029
|
{
|
|
72448
|
-
|
|
72449
|
-
|
|
72450
|
-
|
|
72451
|
-
|
|
72452
|
-
|
|
72453
|
-
className: "w-full"
|
|
73030
|
+
className: "w-full p-4 rounded-lg border border-input bg-background resize-none",
|
|
73031
|
+
rows: 4,
|
|
73032
|
+
placeholder: "Type your answer here...",
|
|
73033
|
+
value: userAnswer || "",
|
|
73034
|
+
onChange: (e2) => saveAnswer(e2.target.value)
|
|
72454
73035
|
}
|
|
72455
|
-
)
|
|
72456
|
-
|
|
72457
|
-
|
|
72458
|
-
|
|
72459
|
-
|
|
73036
|
+
)
|
|
73037
|
+
}
|
|
73038
|
+
);
|
|
73039
|
+
case "rating":
|
|
73040
|
+
const maxRating = currentQuestion.maxRating || 5;
|
|
73041
|
+
const currentRating = typeof userAnswer === "number" ? userAnswer : 0;
|
|
73042
|
+
return /* @__PURE__ */ jsxs(
|
|
73043
|
+
motion.div,
|
|
73044
|
+
{
|
|
73045
|
+
initial: { opacity: 0, y: 20 },
|
|
73046
|
+
animate: { opacity: 1, y: 0 },
|
|
73047
|
+
className: "space-y-4",
|
|
73048
|
+
children: [
|
|
73049
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center gap-2", children: Array.from({ length: maxRating }, (_, i3) => i3 + 1).map((rating) => /* @__PURE__ */ jsx(
|
|
73050
|
+
"button",
|
|
73051
|
+
{
|
|
73052
|
+
onClick: () => saveAnswer(rating),
|
|
73053
|
+
className: "transition-transform hover:scale-110",
|
|
73054
|
+
children: /* @__PURE__ */ jsx(
|
|
73055
|
+
Star,
|
|
73056
|
+
{
|
|
73057
|
+
className: cn(
|
|
73058
|
+
"w-10 h-10 transition-colors",
|
|
73059
|
+
rating <= currentRating ? "fill-yellow-500 text-yellow-500" : "text-muted-foreground"
|
|
73060
|
+
)
|
|
73061
|
+
}
|
|
73062
|
+
)
|
|
73063
|
+
},
|
|
73064
|
+
rating
|
|
73065
|
+
)) }),
|
|
73066
|
+
currentQuestion.ratingLabels && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm text-muted-foreground", children: [
|
|
73067
|
+
/* @__PURE__ */ jsx("span", { children: currentQuestion.ratingLabels[0] }),
|
|
73068
|
+
/* @__PURE__ */ jsx("span", { children: currentQuestion.ratingLabels[1] })
|
|
73069
|
+
] })
|
|
73070
|
+
]
|
|
73071
|
+
}
|
|
73072
|
+
);
|
|
73073
|
+
case "matching":
|
|
73074
|
+
const matches2 = userAnswer || {};
|
|
73075
|
+
return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-6", children: [
|
|
73076
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
73077
|
+
/* @__PURE__ */ jsx("h4", { className: "font-medium mb-2", children: "Match these items:" }),
|
|
73078
|
+
currentQuestion.leftOptions?.map((left, index2) => /* @__PURE__ */ jsx(
|
|
73079
|
+
motion.div,
|
|
73080
|
+
{
|
|
73081
|
+
initial: { opacity: 0, x: -20 },
|
|
73082
|
+
animate: { opacity: 1, x: 0 },
|
|
73083
|
+
transition: { delay: index2 * 0.1 },
|
|
73084
|
+
className: "p-3 rounded-lg border bg-muted/50",
|
|
73085
|
+
children: left
|
|
73086
|
+
},
|
|
73087
|
+
left
|
|
73088
|
+
))
|
|
72460
73089
|
] }),
|
|
72461
|
-
|
|
72462
|
-
/* @__PURE__ */ jsx("
|
|
72463
|
-
|
|
72464
|
-
|
|
72465
|
-
|
|
72466
|
-
|
|
72467
|
-
|
|
72468
|
-
|
|
72469
|
-
|
|
72470
|
-
|
|
72471
|
-
|
|
72472
|
-
|
|
72473
|
-
|
|
72474
|
-
|
|
72475
|
-
|
|
72476
|
-
|
|
72477
|
-
|
|
72478
|
-
|
|
72479
|
-
|
|
72480
|
-
|
|
72481
|
-
|
|
73090
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
73091
|
+
/* @__PURE__ */ jsx("h4", { className: "font-medium mb-2", children: "With these:" }),
|
|
73092
|
+
currentQuestion.leftOptions?.map((left) => /* @__PURE__ */ jsx(
|
|
73093
|
+
motion.div,
|
|
73094
|
+
{
|
|
73095
|
+
initial: { opacity: 0, x: 20 },
|
|
73096
|
+
animate: { opacity: 1, x: 0 },
|
|
73097
|
+
children: /* @__PURE__ */ jsxs(
|
|
73098
|
+
"select",
|
|
73099
|
+
{
|
|
73100
|
+
className: "w-full p-3 rounded-lg border bg-background",
|
|
73101
|
+
value: matches2[left] || "",
|
|
73102
|
+
onChange: (e2) => saveAnswer({ ...matches2, [left]: e2.target.value }),
|
|
73103
|
+
children: [
|
|
73104
|
+
/* @__PURE__ */ jsx("option", { value: "", children: "Select..." }),
|
|
73105
|
+
currentQuestion.rightOptions?.map((right) => /* @__PURE__ */ jsx("option", { value: right, children: right }, right))
|
|
73106
|
+
]
|
|
73107
|
+
}
|
|
73108
|
+
)
|
|
73109
|
+
},
|
|
73110
|
+
left
|
|
73111
|
+
))
|
|
73112
|
+
] })
|
|
73113
|
+
] });
|
|
73114
|
+
default:
|
|
73115
|
+
return null;
|
|
73116
|
+
}
|
|
73117
|
+
};
|
|
73118
|
+
if (showResults && quizResult) {
|
|
73119
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(quizFormVariants({ variant, size: size4 }), className), ...props, children: /* @__PURE__ */ jsxs(
|
|
72482
73120
|
motion.div,
|
|
72483
73121
|
{
|
|
72484
|
-
initial: { opacity: 0, scale: 0.
|
|
73122
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
72485
73123
|
animate: { opacity: 1, scale: 1 },
|
|
72486
|
-
className:
|
|
72487
|
-
children:
|
|
72488
|
-
/* @__PURE__ */ jsxs(
|
|
72489
|
-
/* @__PURE__ */ jsx("
|
|
72490
|
-
|
|
72491
|
-
|
|
72492
|
-
|
|
72493
|
-
/* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-3xl", children: "Quiz Complete!" }),
|
|
72494
|
-
/* @__PURE__ */ jsx(MoonUICardDescriptionPro, { children: "Here's how you performed" })
|
|
72495
|
-
] }),
|
|
72496
|
-
/* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "space-y-6", children: [
|
|
72497
|
-
/* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
72498
|
-
/* @__PURE__ */ jsxs("div", { className: "text-5xl font-bold mb-2", children: [
|
|
72499
|
-
percentage,
|
|
72500
|
-
"%"
|
|
72501
|
-
] }),
|
|
72502
|
-
/* @__PURE__ */ jsx(MoonUIProgressPro, { value: percentage, className: "h-3 mb-4" }),
|
|
72503
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm text-muted-foreground", children: [
|
|
72504
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
72505
|
-
"Score: ",
|
|
72506
|
-
score,
|
|
72507
|
-
"/",
|
|
72508
|
-
totalScore
|
|
72509
|
-
] }),
|
|
72510
|
-
/* @__PURE__ */ jsx("span", { children: passed ? /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "success", children: "Passed" }) : /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "destructive", children: "Failed" }) })
|
|
72511
|
-
] })
|
|
73124
|
+
className: "space-y-6",
|
|
73125
|
+
children: [
|
|
73126
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
73127
|
+
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold mb-2", children: "Quiz Completed!" }),
|
|
73128
|
+
/* @__PURE__ */ jsxs("div", { className: "text-5xl font-bold mb-4", children: [
|
|
73129
|
+
quizResult.percentage.toFixed(1),
|
|
73130
|
+
"%"
|
|
72512
73131
|
] }),
|
|
72513
|
-
|
|
72514
|
-
|
|
72515
|
-
|
|
72516
|
-
|
|
72517
|
-
|
|
72518
|
-
|
|
72519
|
-
showQuestionNumbers && `Q${index2 + 1}: `,
|
|
72520
|
-
question?.question.substring(0, 50),
|
|
72521
|
-
"..."
|
|
72522
|
-
] }),
|
|
72523
|
-
/* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: result.isCorrect ? "success" : "destructive", children: [
|
|
72524
|
-
result.points,
|
|
72525
|
-
"/",
|
|
72526
|
-
question?.points || 1
|
|
72527
|
-
] })
|
|
72528
|
-
] }, result.questionId);
|
|
72529
|
-
})
|
|
73132
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground", children: [
|
|
73133
|
+
"You scored ",
|
|
73134
|
+
quizResult.score,
|
|
73135
|
+
" out of ",
|
|
73136
|
+
quizResult.totalScore,
|
|
73137
|
+
" points"
|
|
72530
73138
|
] }),
|
|
72531
|
-
/* @__PURE__ */
|
|
72532
|
-
|
|
72533
|
-
|
|
72534
|
-
|
|
72535
|
-
|
|
72536
|
-
|
|
72537
|
-
|
|
72538
|
-
|
|
72539
|
-
|
|
72540
|
-
|
|
72541
|
-
|
|
72542
|
-
|
|
72543
|
-
|
|
72544
|
-
|
|
73139
|
+
quizResult.passed !== void 0 && /* @__PURE__ */ jsx("div", { className: cn(
|
|
73140
|
+
"mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-full",
|
|
73141
|
+
quizResult.passed ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"
|
|
73142
|
+
), children: quizResult.passed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73143
|
+
/* @__PURE__ */ jsx(CheckCircle2, { className: "w-5 h-5" }),
|
|
73144
|
+
"Passed"
|
|
73145
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73146
|
+
/* @__PURE__ */ jsx(XCircle, { className: "w-5 h-5" }),
|
|
73147
|
+
"Failed"
|
|
73148
|
+
] }) })
|
|
73149
|
+
] }),
|
|
73150
|
+
settings.allowReview && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
73151
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold", children: "Review Answers:" }),
|
|
73152
|
+
quizResult.answers.map((answer, index2) => {
|
|
73153
|
+
const question = questions.find((q) => q.id === answer.questionId);
|
|
73154
|
+
if (!question)
|
|
73155
|
+
return null;
|
|
73156
|
+
return /* @__PURE__ */ jsx("div", { className: "p-4 rounded-lg border bg-muted/50", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
73157
|
+
answer.isCorrect ? /* @__PURE__ */ jsx(CheckCircle2, { className: "w-5 h-5 text-green-600 mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { className: "w-5 h-5 text-red-600 mt-0.5" }),
|
|
73158
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
73159
|
+
/* @__PURE__ */ jsxs("p", { className: "font-medium mb-2", children: [
|
|
73160
|
+
index2 + 1,
|
|
73161
|
+
". ",
|
|
73162
|
+
question.question
|
|
73163
|
+
] }),
|
|
73164
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
73165
|
+
"Your answer: ",
|
|
73166
|
+
JSON.stringify(answer.userAnswer)
|
|
73167
|
+
] }),
|
|
73168
|
+
!answer.isCorrect && question.correctAnswer !== void 0 && /* @__PURE__ */ jsxs("p", { className: "text-sm text-green-600 mt-1", children: [
|
|
73169
|
+
"Correct answer: ",
|
|
73170
|
+
JSON.stringify(question.correctAnswer)
|
|
73171
|
+
] }),
|
|
73172
|
+
question.explanation && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-2", children: question.explanation })
|
|
73173
|
+
] })
|
|
73174
|
+
] }) }, answer.questionId);
|
|
73175
|
+
})
|
|
73176
|
+
] }),
|
|
73177
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3 justify-center", children: [
|
|
73178
|
+
(!settings.maxAttempts || attempts < settings.maxAttempts) && /* @__PURE__ */ jsxs(
|
|
73179
|
+
"button",
|
|
73180
|
+
{
|
|
73181
|
+
onClick: handleRestart,
|
|
73182
|
+
className: "inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90",
|
|
73183
|
+
children: [
|
|
73184
|
+
/* @__PURE__ */ jsx(RotateCcw, { className: "w-4 h-4" }),
|
|
73185
|
+
"Try Again"
|
|
73186
|
+
]
|
|
73187
|
+
}
|
|
73188
|
+
),
|
|
73189
|
+
/* @__PURE__ */ jsxs(
|
|
73190
|
+
"button",
|
|
73191
|
+
{
|
|
73192
|
+
onClick: handleDownloadResults,
|
|
73193
|
+
className: "inline-flex items-center gap-2 px-4 py-2 rounded-lg border hover:bg-muted",
|
|
73194
|
+
children: [
|
|
73195
|
+
/* @__PURE__ */ jsx(Download, { className: "w-4 h-4" }),
|
|
73196
|
+
"Download Results"
|
|
73197
|
+
]
|
|
73198
|
+
}
|
|
73199
|
+
)
|
|
72545
73200
|
] })
|
|
72546
|
-
]
|
|
73201
|
+
]
|
|
72547
73202
|
}
|
|
72548
|
-
);
|
|
73203
|
+
) });
|
|
72549
73204
|
}
|
|
72550
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(
|
|
72551
|
-
|
|
72552
|
-
/* @__PURE__ */ jsxs("div", {
|
|
73205
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn(quizFormVariants({ variant, size: size4 }), className), ...props, children: [
|
|
73206
|
+
(title || timeLeft !== null) && /* @__PURE__ */ jsxs("div", { className: "mb-6 flex items-center justify-between", children: [
|
|
73207
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
73208
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: title }),
|
|
73209
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1", children: description })
|
|
73210
|
+
] }),
|
|
73211
|
+
timeLeft !== null && /* @__PURE__ */ jsxs("div", { className: cn(
|
|
73212
|
+
"flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium",
|
|
73213
|
+
timeLeft < 60 ? "bg-red-100 text-red-700" : "bg-muted"
|
|
73214
|
+
), children: [
|
|
72553
73215
|
/* @__PURE__ */ jsx(Clock, { className: "w-4 h-4" }),
|
|
72554
|
-
|
|
72555
|
-
|
|
72556
|
-
|
|
73216
|
+
formatTime(timeLeft)
|
|
73217
|
+
] })
|
|
73218
|
+
] }),
|
|
73219
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-6", children: [
|
|
73220
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm text-muted-foreground mb-2", children: [
|
|
73221
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
73222
|
+
"Question ",
|
|
73223
|
+
currentQuestionIndex + 1,
|
|
73224
|
+
" of ",
|
|
73225
|
+
questions.length
|
|
73226
|
+
] }),
|
|
73227
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
73228
|
+
Math.round((currentQuestionIndex + 1) / questions.length * 100),
|
|
73229
|
+
"%"
|
|
72557
73230
|
] })
|
|
72558
73231
|
] }),
|
|
72559
|
-
/* @__PURE__ */ jsx(
|
|
72560
|
-
|
|
73232
|
+
/* @__PURE__ */ jsx("div", { className: "h-2 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
73233
|
+
motion.div,
|
|
72561
73234
|
{
|
|
72562
|
-
|
|
72563
|
-
|
|
73235
|
+
className: "h-full bg-primary",
|
|
73236
|
+
initial: { width: 0 },
|
|
73237
|
+
animate: { width: `${(currentQuestionIndex + 1) / questions.length * 100}%` },
|
|
73238
|
+
transition: { duration: 0.3 }
|
|
72564
73239
|
}
|
|
72565
|
-
)
|
|
73240
|
+
) })
|
|
72566
73241
|
] }),
|
|
72567
|
-
/* @__PURE__ */ jsx(
|
|
72568
|
-
|
|
73242
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: currentQuestion && /* @__PURE__ */ jsxs(
|
|
73243
|
+
motion.div,
|
|
72569
73244
|
{
|
|
72570
|
-
|
|
72571
|
-
|
|
72572
|
-
|
|
72573
|
-
|
|
72574
|
-
|
|
72575
|
-
|
|
72576
|
-
|
|
72577
|
-
|
|
72578
|
-
|
|
73245
|
+
initial: { opacity: 0, x: 20 },
|
|
73246
|
+
animate: { opacity: 1, x: 0 },
|
|
73247
|
+
exit: { opacity: 0, x: -20 },
|
|
73248
|
+
className: "mb-6",
|
|
73249
|
+
children: [
|
|
73250
|
+
/* @__PURE__ */ jsxs("h3", { className: "text-lg font-semibold mb-4", children: [
|
|
73251
|
+
currentQuestion.question,
|
|
73252
|
+
currentQuestion.required && /* @__PURE__ */ jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
73253
|
+
] }),
|
|
73254
|
+
renderQuestion(),
|
|
73255
|
+
settings.showHints && currentQuestion.hint && /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
73256
|
+
/* @__PURE__ */ jsxs(
|
|
73257
|
+
"button",
|
|
73258
|
+
{
|
|
73259
|
+
onClick: () => setShowHint(!showHint),
|
|
73260
|
+
className: "inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",
|
|
73261
|
+
children: [
|
|
73262
|
+
/* @__PURE__ */ jsx(HelpCircle, { className: "w-4 h-4" }),
|
|
73263
|
+
showHint ? "Hide" : "Show",
|
|
73264
|
+
" Hint"
|
|
73265
|
+
]
|
|
73266
|
+
}
|
|
73267
|
+
),
|
|
73268
|
+
showHint && /* @__PURE__ */ jsx(
|
|
73269
|
+
motion.div,
|
|
73270
|
+
{
|
|
73271
|
+
initial: { opacity: 0, height: 0 },
|
|
73272
|
+
animate: { opacity: 1, height: "auto" },
|
|
73273
|
+
className: "mt-2 p-3 rounded-lg bg-muted/50 text-sm",
|
|
73274
|
+
children: currentQuestion.hint
|
|
73275
|
+
}
|
|
73276
|
+
)
|
|
73277
|
+
] }),
|
|
73278
|
+
settings.showInstantFeedback && userAnswers[currentQuestion.id] && currentQuestion.correctAnswer !== void 0 && /* @__PURE__ */ jsx(
|
|
73279
|
+
motion.div,
|
|
73280
|
+
{
|
|
73281
|
+
initial: { opacity: 0, y: 10 },
|
|
73282
|
+
animate: { opacity: 1, y: 0 },
|
|
73283
|
+
className: "mt-4",
|
|
73284
|
+
children: (() => {
|
|
73285
|
+
const userAnswer = userAnswers[currentQuestion.id].answer;
|
|
73286
|
+
let isCorrect = false;
|
|
73287
|
+
switch (currentQuestion.type) {
|
|
73288
|
+
case "single-choice":
|
|
73289
|
+
case "true-false":
|
|
73290
|
+
isCorrect = userAnswer === currentQuestion.correctAnswer;
|
|
73291
|
+
break;
|
|
73292
|
+
}
|
|
73293
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(
|
|
73294
|
+
"p-3 rounded-lg flex items-start gap-2",
|
|
73295
|
+
isCorrect ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"
|
|
73296
|
+
), children: [
|
|
73297
|
+
isCorrect ? /* @__PURE__ */ jsx(CheckCircle2, { className: "w-5 h-5 mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { className: "w-5 h-5 mt-0.5" }),
|
|
73298
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
73299
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium", children: isCorrect ? "Correct!" : "Incorrect" }),
|
|
73300
|
+
currentQuestion.explanation && /* @__PURE__ */ jsx("p", { className: "text-sm mt-1", children: currentQuestion.explanation })
|
|
73301
|
+
] })
|
|
73302
|
+
] });
|
|
73303
|
+
})()
|
|
73304
|
+
}
|
|
73305
|
+
)
|
|
73306
|
+
]
|
|
73307
|
+
},
|
|
73308
|
+
currentQuestion.id
|
|
73309
|
+
) }),
|
|
73310
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
73311
|
+
/* @__PURE__ */ jsxs(
|
|
73312
|
+
"button",
|
|
73313
|
+
{
|
|
73314
|
+
onClick: handlePrevious,
|
|
73315
|
+
disabled: currentQuestionIndex === 0,
|
|
73316
|
+
className: cn(
|
|
73317
|
+
"inline-flex items-center gap-2 px-4 py-2 rounded-lg transition-colors",
|
|
73318
|
+
currentQuestionIndex === 0 ? "opacity-50 cursor-not-allowed bg-muted text-muted-foreground" : "bg-muted hover:bg-muted/80"
|
|
73319
|
+
),
|
|
73320
|
+
children: [
|
|
73321
|
+
/* @__PURE__ */ jsx(ChevronLeft, { className: "w-4 h-4" }),
|
|
73322
|
+
"Previous"
|
|
73323
|
+
]
|
|
73324
|
+
}
|
|
73325
|
+
),
|
|
73326
|
+
/* @__PURE__ */ jsxs(
|
|
73327
|
+
"button",
|
|
73328
|
+
{
|
|
73329
|
+
onClick: currentQuestionIndex === questions.length - 1 ? handleComplete : handleNext,
|
|
73330
|
+
disabled: currentQuestion?.required && !userAnswers[currentQuestion.id],
|
|
73331
|
+
className: cn(
|
|
73332
|
+
"inline-flex items-center gap-2 px-4 py-2 rounded-lg transition-colors",
|
|
73333
|
+
currentQuestion?.required && !userAnswers[currentQuestion.id] ? "opacity-50 cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
73334
|
+
),
|
|
73335
|
+
children: [
|
|
73336
|
+
currentQuestionIndex === questions.length - 1 ? "Complete" : "Next",
|
|
73337
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
|
|
73338
|
+
]
|
|
73339
|
+
}
|
|
73340
|
+
)
|
|
73341
|
+
] })
|
|
72579
73342
|
] });
|
|
72580
|
-
};
|
|
73343
|
+
});
|
|
73344
|
+
MoonUIQuizFormPro.displayName = "MoonUIQuizFormPro";
|
|
72581
73345
|
|
|
72582
73346
|
// src/components/enhanced/index.ts
|
|
72583
73347
|
var enhanced_exports = {};
|
|
@@ -73477,4 +74241,4 @@ var BadgePro = t__default.forwardRef(({
|
|
|
73477
74241
|
});
|
|
73478
74242
|
BadgePro.displayName = "BadgePro";
|
|
73479
74243
|
|
|
73480
|
-
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, AnimatedButton, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button, Calendar, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, MoonUICheckboxPro as Checkbox, MoonUICollapsiblePro as Collapsible, MoonUICollapsibleContentPro as CollapsibleContent, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIColorPickerPro as ColorPicker, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandInputPro as CommandInput, MoonUICommandItemPro as CommandItem, MoonUICommandListPro as CommandList, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandShortcutPro as CommandShortcut, Dashboard, DataTable, MoonUIDialogPro as Dialog, MoonUIDialogClosePro as DialogClose, MoonUIDialogContentPro as DialogContent, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogTriggerPro as DialogTrigger, DraggableList, MoonUIDropdownMenuPro as DropdownMenu, MoonUIDropdownMenuCheckboxItemPro as DropdownMenuCheckboxItem, MoonUIDropdownMenuContentPro as DropdownMenuContent, MoonUIDropdownMenuGroupPro as DropdownMenuGroup, MoonUIDropdownMenuItemPro as DropdownMenuItem, MoonUIDropdownMenuLabelPro as DropdownMenuLabel, MoonUIDropdownMenuPortalPro as DropdownMenuPortal, MoonUIDropdownMenuRadioGroupPro as DropdownMenuRadioGroup, MoonUIDropdownMenuRadioItemPro as DropdownMenuRadioItem, MoonUIDropdownMenuSeparatorPro as DropdownMenuSeparator, MoonUIDropdownMenuShortcutPro as DropdownMenuShortcut, MoonUIDropdownMenuSubPro as DropdownMenuSub, MoonUIDropdownMenuSubContentPro as DropdownMenuSubContent, MoonUIDropdownMenuSubTriggerPro as DropdownMenuSubTrigger, MoonUIDropdownMenuTriggerPro as DropdownMenuTrigger, enhanced_exports as Enhanced, ErrorBoundary, FileUpload, FloatingActionButton, FormWizardNavigation,
|
|
74244
|
+
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, AnimatedButton, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button, Calendar, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, MoonUICheckboxPro as Checkbox, MoonUICollapsiblePro as Collapsible, MoonUICollapsibleContentPro as CollapsibleContent, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIColorPickerPro as ColorPicker, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandInputPro as CommandInput, MoonUICommandItemPro as CommandItem, MoonUICommandListPro as CommandList, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandShortcutPro as CommandShortcut, Dashboard, DataTable, MoonUIDialogPro as Dialog, MoonUIDialogClosePro as DialogClose, MoonUIDialogContentPro as DialogContent, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogTriggerPro as DialogTrigger, DraggableList, MoonUIDropdownMenuPro as DropdownMenu, MoonUIDropdownMenuCheckboxItemPro as DropdownMenuCheckboxItem, MoonUIDropdownMenuContentPro as DropdownMenuContent, MoonUIDropdownMenuGroupPro as DropdownMenuGroup, MoonUIDropdownMenuItemPro as DropdownMenuItem, MoonUIDropdownMenuLabelPro as DropdownMenuLabel, MoonUIDropdownMenuPortalPro as DropdownMenuPortal, MoonUIDropdownMenuRadioGroupPro as DropdownMenuRadioGroup, MoonUIDropdownMenuRadioItemPro as DropdownMenuRadioItem, MoonUIDropdownMenuSeparatorPro as DropdownMenuSeparator, MoonUIDropdownMenuShortcutPro as DropdownMenuShortcut, MoonUIDropdownMenuSubPro as DropdownMenuSub, MoonUIDropdownMenuSubContentPro as DropdownMenuSubContent, MoonUIDropdownMenuSubTriggerPro as DropdownMenuSubTrigger, MoonUIDropdownMenuTriggerPro as DropdownMenuTrigger, enhanced_exports as Enhanced, ErrorBoundary, FileUpload, FloatingActionButton, FormWizardNavigation, FormWizardProgress, FormWizardStep, GitHubStars, HealthCheck, HoverCard2 as HoverCard, HoverCard3D, HoverCardContent2 as HoverCardContent, HoverCardTrigger2 as HoverCardTrigger, MoonUIInputPro as Input, Kanban, MoonUILabelPro as Label, LazyComponent, LazyImage, LazyList, MagneticButton, MemoryAnalytics, MemoryEfficientData, MoonUIAccordionContentPro, MoonUIAccordionItemPro, MoonUIAccordionPro, MoonUIAccordionTriggerPro, MoonUIAlertDescriptionPro, MoonUIAlertPro, MoonUIAlertTitlePro, MoonUIAspectRatioPro, MoonUIAvatarFallbackPro, MoonUIAvatarImagePro, MoonUIAvatarPro, MoonUIBadgePro, MoonUIBreadcrumbEllipsisPro, MoonUIBreadcrumbItemPro, MoonUIBreadcrumbLinkPro, MoonUIBreadcrumbListPro, MoonUIBreadcrumbPagePro, MoonUIBreadcrumbPro, MoonUIBreadcrumbSeparatorPro, MoonUIButtonPro, MoonUICardContentPro, MoonUICardDescriptionPro, MoonUICardFooterPro, MoonUICardHeaderPro, MoonUICardPro, MoonUICardTitlePro, MoonUICheckboxPro, MoonUICollapsibleContentPro, MoonUICollapsiblePro, MoonUICollapsibleTriggerPro, MoonUIColorPickerPro, MoonUICommandDialogPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandInputPro, MoonUICommandItemPro, MoonUICommandListPro, MoonUICommandPro, MoonUICommandSeparatorPro, MoonUICommandShortcutPro, MoonUICreditCardInputPro, MoonUIDialogClosePro, MoonUIDialogContentPro, MoonUIDialogDescriptionPro, MoonUIDialogFooterPro, MoonUIDialogHeaderPro, MoonUIDialogPro, MoonUIDialogTitlePro, MoonUIDialogTriggerPro, MoonUIDropdownMenuCheckboxItemPro, MoonUIDropdownMenuContentPro, MoonUIDropdownMenuGroupPro, MoonUIDropdownMenuItemPro, MoonUIDropdownMenuLabelPro, MoonUIDropdownMenuPortalPro, MoonUIDropdownMenuPro, MoonUIDropdownMenuRadioGroupPro, MoonUIDropdownMenuRadioItemPro, MoonUIDropdownMenuSeparatorPro, MoonUIDropdownMenuShortcutPro, MoonUIDropdownMenuSubContentPro, MoonUIDropdownMenuSubPro, MoonUIDropdownMenuSubTriggerPro, MoonUIDropdownMenuTriggerPro, MoonUIFormWizardPro, MoonUIInputPro, MoonUILabelPro, MoonUIMultiStepFormPro, MoonUIPaginationContentPro, MoonUIPaginationEllipsisPro, MoonUIPaginationItemPro, MoonUIPaginationLinkPro, MoonUIPaginationNextPro, MoonUIPaginationPreviousPro, MoonUIPaginationPro, MoonUIPhoneNumberInputPro, MoonUIPopoverContentPro, MoonUIPopoverPro, MoonUIPopoverTriggerPro, MoonUIProgressPro, MoonUIQuizFormPro, MoonUIRadioGroupContextPro, MoonUIRadioGroupItemPro, MoonUIRadioGroupPro, MoonUIRadioItemWithLabelPro, MoonUIRadioLabelPro, MoonUISelectContentPro, MoonUISelectGroupPro, MoonUISelectItemPro, MoonUISelectLabelPro, MoonUISelectPro, MoonUISelectSeparatorPro, MoonUISelectTriggerPro, MoonUISelectValuePro, MoonUISeparatorPro, MoonUISkeletonPro, MoonUISliderPro, MoonUISwitchPro, MoonUITableBodyPro, MoonUITableCaptionPro, MoonUITableCellPro, MoonUITableFooterPro, MoonUITableHeadPro, MoonUITableHeaderPro, MoonUITablePro, MoonUITableRowPro, MoonUITabsContentPro, MoonUITabsListPro, MoonUITabsPro, MoonUITabsTriggerPro, MoonUITextareaPro, MoonUIToastPro, MoonUITogglePro, MoonUITooltipContentPro, MoonUITooltipPro, MoonUITooltipProviderPro, MoonUITooltipTriggerPro, MoonUIalertVariantsPro, MoonUIaspectRatioVariantsPro, MoonUIbreadcrumbVariantsPro, MoonUIcollapsibleContentVariantsPro, MoonUIcollapsibleTriggerVariantsPro, MoonUIcommandVariantsPro, MoonUIradioGroupItemVariantsPro, MoonUItableVariantsPro, MoonUItoggleVariantsPro, OptimizedImage, MoonUIPaginationPro as Pagination, MoonUIPaginationContentPro as PaginationContent, MoonUIPaginationEllipsisPro as PaginationEllipsis, MoonUIPaginationItemPro as PaginationItem, MoonUIPaginationLinkPro as PaginationLink, MoonUIPaginationNextPro as PaginationNext, MoonUIPaginationPreviousPro as PaginationPrevious, PerformanceDebugger, PerformanceMonitor, PinchZoom, MoonUIPopoverPro as Popover, MoonUIPopoverContentPro as PopoverContent, MoonUIPopoverTriggerPro as PopoverTrigger, MoonUIProgressPro as Progress, MoonUIRadioGroupPro as RadioGroup, MoonUIRadioGroupContextPro as RadioGroupContext, MoonUIRadioGroupItemPro as RadioGroupItem, MoonUIRadioItemWithLabelPro as RadioItemWithLabel, MoonUIRadioLabelPro as RadioLabel, RichTextEditor, ScrollArea, ScrollBar, MoonUISelectPro as Select, MoonUISelectContentPro as SelectContent, MoonUISelectGroupPro as SelectGroup, MoonUISelectItemPro as SelectItem, MoonUISelectLabelPro as SelectLabel, MoonUISelectSeparatorPro as SelectSeparator, MoonUISelectTriggerPro as SelectTrigger, MoonUISelectValuePro as SelectValue, SelectableVirtualList, MoonUISeparatorPro as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, MoonUISkeletonPro as Skeleton, MoonUISliderPro as Slider, SpotlightCard, SwipeableCard, MoonUISwitchPro as Switch, MoonUITablePro as Table, MoonUITableBodyPro as TableBody, MoonUITableCaptionPro as TableCaption, MoonUITableCellPro as TableCell, MoonUITableFooterPro as TableFooter, MoonUITableHeadPro as TableHead, MoonUITableHeaderPro as TableHeader, MoonUITableRowPro as TableRow, MoonUITabsPro as Tabs, MoonUITabsContentPro as TabsContent, MoonUITabsListPro as TabsList, MoonUITabsTriggerPro as TabsTrigger, MoonUITextareaPro as Textarea, Timeline, MoonUIToastPro as Toast, MoonUITogglePro as Toggle, MoonUITooltipPro as Tooltip, MoonUITooltipContentPro as TooltipContent, MoonUITooltipProviderPro as TooltipProvider, MoonUITooltipTriggerPro as TooltipTrigger, VirtualList, MoonUIalertVariantsPro as alertVariants, animatedButtonVariants, MoonUIaspectRatioVariantsPro as aspectRatioVariants, moonUIBadgeVariantsPro as badgeVariants, MoonUIbreadcrumbVariantsPro as breadcrumbVariants, moonUIButtonProVariants as buttonVariants, cn, MoonUIcollapsibleContentVariantsPro as collapsibleContentVariants, MoonUIcollapsibleTriggerVariantsPro as collapsibleTriggerVariants, MoonUIcommandVariantsPro as commandVariants, getExpandableColumn, moonUIBadgeVariantsPro, moonUIButtonProVariants, moonUISeparatorVariantsPro, countries as phoneCountries, MoonUIradioGroupItemVariantsPro as radioGroupItemVariants, moonUISeparatorVariantsPro as separatorVariants, MoonUItableVariantsPro as tableVariants, MoonUItoggleVariantsPro as toggleVariants, useExpandableRows, useFormWizard, useStreamingData, useVirtualList };
|