feat: redesign Exams List page to show submitted custom exams
- Added Custom Exams tab showing all exams from Generation page - Displays title, module badges, duration, and status - Added Create Exam button - Kept Exam Sessions tab for institutional sessions - Search filters across exams Made-with: Cursor
This commit is contained in:
181
node_modules/.vite/deps/@radix-ui_react-switch.js
generated
vendored
Normal file
181
node_modules/.vite/deps/@radix-ui_react-switch.js
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
"use client";
|
||||
import {
|
||||
usePrevious
|
||||
} from "./chunk-43G6IMPT.js";
|
||||
import {
|
||||
useSize
|
||||
} from "./chunk-SBO4SQHK.js";
|
||||
import {
|
||||
useControllableState
|
||||
} from "./chunk-PP5CJGVQ.js";
|
||||
import {
|
||||
Primitive,
|
||||
composeEventHandlers,
|
||||
createContextScope
|
||||
} from "./chunk-QWDI7X5E.js";
|
||||
import "./chunk-5ZB7HMJW.js";
|
||||
import "./chunk-T2SWDQEL.js";
|
||||
import {
|
||||
useComposedRefs
|
||||
} from "./chunk-JDYSANEB.js";
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-KBTYAULA.js";
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-QCHXOAYK.js";
|
||||
import {
|
||||
__toESM
|
||||
} from "./chunk-WOOG5QLI.js";
|
||||
|
||||
// node_modules/@radix-ui/react-switch/dist/index.mjs
|
||||
var React = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
var SWITCH_NAME = "Switch";
|
||||
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
||||
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
||||
var Switch = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
__scopeSwitch,
|
||||
name,
|
||||
checked: checkedProp,
|
||||
defaultChecked,
|
||||
required,
|
||||
disabled,
|
||||
value = "on",
|
||||
onCheckedChange,
|
||||
form,
|
||||
...switchProps
|
||||
} = props;
|
||||
const [button, setButton] = React.useState(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
||||
const hasConsumerStoppedPropagationRef = React.useRef(false);
|
||||
const isFormControl = button ? form || !!button.closest("form") : true;
|
||||
const [checked, setChecked] = useControllableState({
|
||||
prop: checkedProp,
|
||||
defaultProp: defaultChecked ?? false,
|
||||
onChange: onCheckedChange,
|
||||
caller: SWITCH_NAME
|
||||
});
|
||||
return (0, import_jsx_runtime.jsxs)(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
|
||||
(0, import_jsx_runtime.jsx)(
|
||||
Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
role: "switch",
|
||||
"aria-checked": checked,
|
||||
"aria-required": required,
|
||||
"data-state": getState(checked),
|
||||
"data-disabled": disabled ? "" : void 0,
|
||||
disabled,
|
||||
value,
|
||||
...switchProps,
|
||||
ref: composedRefs,
|
||||
onClick: composeEventHandlers(props.onClick, (event) => {
|
||||
setChecked((prevChecked) => !prevChecked);
|
||||
if (isFormControl) {
|
||||
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
||||
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
||||
}
|
||||
})
|
||||
}
|
||||
),
|
||||
isFormControl && (0, import_jsx_runtime.jsx)(
|
||||
SwitchBubbleInput,
|
||||
{
|
||||
control: button,
|
||||
bubbles: !hasConsumerStoppedPropagationRef.current,
|
||||
name,
|
||||
value,
|
||||
checked,
|
||||
required,
|
||||
disabled,
|
||||
form,
|
||||
style: { transform: "translateX(-100%)" }
|
||||
}
|
||||
)
|
||||
] });
|
||||
}
|
||||
);
|
||||
Switch.displayName = SWITCH_NAME;
|
||||
var THUMB_NAME = "SwitchThumb";
|
||||
var SwitchThumb = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeSwitch, ...thumbProps } = props;
|
||||
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
||||
return (0, import_jsx_runtime.jsx)(
|
||||
Primitive.span,
|
||||
{
|
||||
"data-state": getState(context.checked),
|
||||
"data-disabled": context.disabled ? "" : void 0,
|
||||
...thumbProps,
|
||||
ref: forwardedRef
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
SwitchThumb.displayName = THUMB_NAME;
|
||||
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
||||
var SwitchBubbleInput = React.forwardRef(
|
||||
({
|
||||
__scopeSwitch,
|
||||
control,
|
||||
checked,
|
||||
bubbles = true,
|
||||
...props
|
||||
}, forwardedRef) => {
|
||||
const ref = React.useRef(null);
|
||||
const composedRefs = useComposedRefs(ref, forwardedRef);
|
||||
const prevChecked = usePrevious(checked);
|
||||
const controlSize = useSize(control);
|
||||
React.useEffect(() => {
|
||||
const input = ref.current;
|
||||
if (!input) return;
|
||||
const inputProto = window.HTMLInputElement.prototype;
|
||||
const descriptor = Object.getOwnPropertyDescriptor(
|
||||
inputProto,
|
||||
"checked"
|
||||
);
|
||||
const setChecked = descriptor.set;
|
||||
if (prevChecked !== checked && setChecked) {
|
||||
const event = new Event("click", { bubbles });
|
||||
setChecked.call(input, checked);
|
||||
input.dispatchEvent(event);
|
||||
}
|
||||
}, [prevChecked, checked, bubbles]);
|
||||
return (0, import_jsx_runtime.jsx)(
|
||||
"input",
|
||||
{
|
||||
type: "checkbox",
|
||||
"aria-hidden": true,
|
||||
defaultChecked: checked,
|
||||
...props,
|
||||
tabIndex: -1,
|
||||
ref: composedRefs,
|
||||
style: {
|
||||
...props.style,
|
||||
...controlSize,
|
||||
position: "absolute",
|
||||
pointerEvents: "none",
|
||||
opacity: 0,
|
||||
margin: 0
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
||||
function getState(checked) {
|
||||
return checked ? "checked" : "unchecked";
|
||||
}
|
||||
var Root = Switch;
|
||||
var Thumb = SwitchThumb;
|
||||
export {
|
||||
Root,
|
||||
Switch,
|
||||
SwitchThumb,
|
||||
Thumb,
|
||||
createSwitchScope
|
||||
};
|
||||
//# sourceMappingURL=@radix-ui_react-switch.js.map
|
||||
Reference in New Issue
Block a user