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:
327
node_modules/.vite/deps/@radix-ui_react-radio-group.js
generated
vendored
Normal file
327
node_modules/.vite/deps/@radix-ui_react-radio-group.js
generated
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
"use client";
|
||||
import {
|
||||
usePrevious
|
||||
} from "./chunk-43G6IMPT.js";
|
||||
import {
|
||||
useSize
|
||||
} from "./chunk-SBO4SQHK.js";
|
||||
import {
|
||||
Item,
|
||||
Root,
|
||||
createRovingFocusGroupScope
|
||||
} from "./chunk-I3SFYXRB.js";
|
||||
import {
|
||||
useDirection
|
||||
} from "./chunk-4RO2SXZU.js";
|
||||
import "./chunk-OZYRCYHU.js";
|
||||
import "./chunk-6MTKRYAT.js";
|
||||
import {
|
||||
Presence
|
||||
} from "./chunk-7QGJQHFX.js";
|
||||
import {
|
||||
useControllableState
|
||||
} from "./chunk-PP5CJGVQ.js";
|
||||
import {
|
||||
Primitive,
|
||||
composeEventHandlers,
|
||||
createContextScope
|
||||
} from "./chunk-QWDI7X5E.js";
|
||||
import "./chunk-KCFVMCIE.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-radio-group/dist/index.mjs
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
var React = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
||||
var RADIO_NAME = "Radio";
|
||||
var [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);
|
||||
var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
|
||||
var Radio = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
__scopeRadio,
|
||||
name,
|
||||
checked = false,
|
||||
required,
|
||||
disabled,
|
||||
value = "on",
|
||||
onCheck,
|
||||
form,
|
||||
...radioProps
|
||||
} = 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;
|
||||
return (0, import_jsx_runtime.jsxs)(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
|
||||
(0, import_jsx_runtime.jsx)(
|
||||
Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
role: "radio",
|
||||
"aria-checked": checked,
|
||||
"data-state": getState(checked),
|
||||
"data-disabled": disabled ? "" : void 0,
|
||||
disabled,
|
||||
value,
|
||||
...radioProps,
|
||||
ref: composedRefs,
|
||||
onClick: composeEventHandlers(props.onClick, (event) => {
|
||||
if (!checked) onCheck == null ? void 0 : onCheck();
|
||||
if (isFormControl) {
|
||||
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
||||
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
||||
}
|
||||
})
|
||||
}
|
||||
),
|
||||
isFormControl && (0, import_jsx_runtime.jsx)(
|
||||
RadioBubbleInput,
|
||||
{
|
||||
control: button,
|
||||
bubbles: !hasConsumerStoppedPropagationRef.current,
|
||||
name,
|
||||
value,
|
||||
checked,
|
||||
required,
|
||||
disabled,
|
||||
form,
|
||||
style: { transform: "translateX(-100%)" }
|
||||
}
|
||||
)
|
||||
] });
|
||||
}
|
||||
);
|
||||
Radio.displayName = RADIO_NAME;
|
||||
var INDICATOR_NAME = "RadioIndicator";
|
||||
var RadioIndicator = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeRadio, forceMount, ...indicatorProps } = props;
|
||||
const context = useRadioContext(INDICATOR_NAME, __scopeRadio);
|
||||
return (0, import_jsx_runtime.jsx)(Presence, { present: forceMount || context.checked, children: (0, import_jsx_runtime.jsx)(
|
||||
Primitive.span,
|
||||
{
|
||||
"data-state": getState(context.checked),
|
||||
"data-disabled": context.disabled ? "" : void 0,
|
||||
...indicatorProps,
|
||||
ref: forwardedRef
|
||||
}
|
||||
) });
|
||||
}
|
||||
);
|
||||
RadioIndicator.displayName = INDICATOR_NAME;
|
||||
var BUBBLE_INPUT_NAME = "RadioBubbleInput";
|
||||
var RadioBubbleInput = React.forwardRef(
|
||||
({
|
||||
__scopeRadio,
|
||||
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)(
|
||||
Primitive.input,
|
||||
{
|
||||
type: "radio",
|
||||
"aria-hidden": true,
|
||||
defaultChecked: checked,
|
||||
...props,
|
||||
tabIndex: -1,
|
||||
ref: composedRefs,
|
||||
style: {
|
||||
...props.style,
|
||||
...controlSize,
|
||||
position: "absolute",
|
||||
pointerEvents: "none",
|
||||
opacity: 0,
|
||||
margin: 0
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
RadioBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
||||
function getState(checked) {
|
||||
return checked ? "checked" : "unchecked";
|
||||
}
|
||||
var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
||||
var RADIO_GROUP_NAME = "RadioGroup";
|
||||
var [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [
|
||||
createRovingFocusGroupScope,
|
||||
createRadioScope
|
||||
]);
|
||||
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
||||
var useRadioScope = createRadioScope();
|
||||
var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
|
||||
var RadioGroup = React2.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
__scopeRadioGroup,
|
||||
name,
|
||||
defaultValue,
|
||||
value: valueProp,
|
||||
required = false,
|
||||
disabled = false,
|
||||
orientation,
|
||||
dir,
|
||||
loop = true,
|
||||
onValueChange,
|
||||
...groupProps
|
||||
} = props;
|
||||
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
|
||||
const direction = useDirection(dir);
|
||||
const [value, setValue] = useControllableState({
|
||||
prop: valueProp,
|
||||
defaultProp: defaultValue ?? null,
|
||||
onChange: onValueChange,
|
||||
caller: RADIO_GROUP_NAME
|
||||
});
|
||||
return (0, import_jsx_runtime2.jsx)(
|
||||
RadioGroupProvider,
|
||||
{
|
||||
scope: __scopeRadioGroup,
|
||||
name,
|
||||
required,
|
||||
disabled,
|
||||
value,
|
||||
onValueChange: setValue,
|
||||
children: (0, import_jsx_runtime2.jsx)(
|
||||
Root,
|
||||
{
|
||||
asChild: true,
|
||||
...rovingFocusGroupScope,
|
||||
orientation,
|
||||
dir: direction,
|
||||
loop,
|
||||
children: (0, import_jsx_runtime2.jsx)(
|
||||
Primitive.div,
|
||||
{
|
||||
role: "radiogroup",
|
||||
"aria-required": required,
|
||||
"aria-orientation": orientation,
|
||||
"data-disabled": disabled ? "" : void 0,
|
||||
dir: direction,
|
||||
...groupProps,
|
||||
ref: forwardedRef
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
RadioGroup.displayName = RADIO_GROUP_NAME;
|
||||
var ITEM_NAME = "RadioGroupItem";
|
||||
var RadioGroupItem = React2.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeRadioGroup, disabled, ...itemProps } = props;
|
||||
const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);
|
||||
const isDisabled = context.disabled || disabled;
|
||||
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
|
||||
const radioScope = useRadioScope(__scopeRadioGroup);
|
||||
const ref = React2.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, ref);
|
||||
const checked = context.value === itemProps.value;
|
||||
const isArrowKeyPressedRef = React2.useRef(false);
|
||||
React2.useEffect(() => {
|
||||
const handleKeyDown = (event) => {
|
||||
if (ARROW_KEYS.includes(event.key)) {
|
||||
isArrowKeyPressedRef.current = true;
|
||||
}
|
||||
};
|
||||
const handleKeyUp = () => isArrowKeyPressedRef.current = false;
|
||||
document.addEventListener("keydown", handleKeyDown);
|
||||
document.addEventListener("keyup", handleKeyUp);
|
||||
return () => {
|
||||
document.removeEventListener("keydown", handleKeyDown);
|
||||
document.removeEventListener("keyup", handleKeyUp);
|
||||
};
|
||||
}, []);
|
||||
return (0, import_jsx_runtime2.jsx)(
|
||||
Item,
|
||||
{
|
||||
asChild: true,
|
||||
...rovingFocusGroupScope,
|
||||
focusable: !isDisabled,
|
||||
active: checked,
|
||||
children: (0, import_jsx_runtime2.jsx)(
|
||||
Radio,
|
||||
{
|
||||
disabled: isDisabled,
|
||||
required: context.required,
|
||||
checked,
|
||||
...radioScope,
|
||||
...itemProps,
|
||||
name: context.name,
|
||||
ref: composedRefs,
|
||||
onCheck: () => context.onValueChange(itemProps.value),
|
||||
onKeyDown: composeEventHandlers((event) => {
|
||||
if (event.key === "Enter") event.preventDefault();
|
||||
}),
|
||||
onFocus: composeEventHandlers(itemProps.onFocus, () => {
|
||||
var _a;
|
||||
if (isArrowKeyPressedRef.current) (_a = ref.current) == null ? void 0 : _a.click();
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
RadioGroupItem.displayName = ITEM_NAME;
|
||||
var INDICATOR_NAME2 = "RadioGroupIndicator";
|
||||
var RadioGroupIndicator = React2.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeRadioGroup, ...indicatorProps } = props;
|
||||
const radioScope = useRadioScope(__scopeRadioGroup);
|
||||
return (0, import_jsx_runtime2.jsx)(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
RadioGroupIndicator.displayName = INDICATOR_NAME2;
|
||||
var Root2 = RadioGroup;
|
||||
var Item2 = RadioGroupItem;
|
||||
var Indicator = RadioGroupIndicator;
|
||||
export {
|
||||
Indicator,
|
||||
Item2 as Item,
|
||||
RadioGroup,
|
||||
RadioGroupIndicator,
|
||||
RadioGroupItem,
|
||||
Root2 as Root,
|
||||
createRadioGroupScope
|
||||
};
|
||||
//# sourceMappingURL=@radix-ui_react-radio-group.js.map
|
||||
Reference in New Issue
Block a user