UEA-PRODEM
This commit is contained in:
+51
-147
@@ -1,7 +1,4 @@
|
||||
"use client";
|
||||
import {
|
||||
Presence
|
||||
} from "./chunk-THQIQPZA.js";
|
||||
import {
|
||||
Combination_default,
|
||||
DismissableLayer,
|
||||
@@ -9,129 +6,36 @@ import {
|
||||
Portal,
|
||||
hideOthers,
|
||||
useFocusGuards
|
||||
} from "./chunk-AFOUPPSL.js";
|
||||
} from "./chunk-NC6JEPWD.js";
|
||||
import {
|
||||
Primitive,
|
||||
Presence,
|
||||
composeEventHandlers,
|
||||
createContext2,
|
||||
createContextScope,
|
||||
useControllableState,
|
||||
useId
|
||||
} from "./chunk-VURJIDBW.js";
|
||||
import "./chunk-YF4B4G2L.js";
|
||||
} from "./chunk-TU5XDRIH.js";
|
||||
import {
|
||||
composeRefs,
|
||||
Primitive
|
||||
} from "./chunk-QPQFA2HW.js";
|
||||
import {
|
||||
createSlot,
|
||||
useComposedRefs
|
||||
} from "./chunk-2VUH7NEY.js";
|
||||
} from "./chunk-7O5GCKER.js";
|
||||
import "./chunk-UEHR66ST.js";
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-2YVA4HRZ.js";
|
||||
} from "./chunk-LPULNKJF.js";
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-WUR7D6NS.js";
|
||||
} from "./chunk-42LCURWG.js";
|
||||
import {
|
||||
__toESM
|
||||
} from "./chunk-G3PMV62Z.js";
|
||||
|
||||
// node_modules/@radix-ui/react-dialog/dist/index.mjs
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs
|
||||
var React = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
function createSlot(ownerName) {
|
||||
const SlotClone = createSlotClone(ownerName);
|
||||
const Slot22 = React.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
const childrenArray = React.Children.toArray(children);
|
||||
const slottable = childrenArray.find(isSlottable);
|
||||
if (slottable) {
|
||||
const newElement = slottable.props.children;
|
||||
const newChildren = childrenArray.map((child) => {
|
||||
if (child === slottable) {
|
||||
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
||||
return React.isValidElement(newElement) ? newElement.props.children : null;
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
});
|
||||
return (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
||||
}
|
||||
return (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
||||
});
|
||||
Slot22.displayName = `${ownerName}.Slot`;
|
||||
return Slot22;
|
||||
}
|
||||
var Slot = createSlot("Slot");
|
||||
function createSlotClone(ownerName) {
|
||||
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
if (React.isValidElement(children)) {
|
||||
const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React.Fragment) {
|
||||
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
||||
}
|
||||
return React.cloneElement(children, props2);
|
||||
}
|
||||
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
||||
});
|
||||
SlotClone.displayName = `${ownerName}.SlotClone`;
|
||||
return SlotClone;
|
||||
}
|
||||
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
||||
function createSlottable(ownerName) {
|
||||
const Slottable2 = ({ children }) => {
|
||||
return (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
||||
};
|
||||
Slottable2.displayName = `${ownerName}.Slottable`;
|
||||
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
||||
return Slottable2;
|
||||
}
|
||||
var Slottable = createSlottable("Slottable");
|
||||
function isSlottable(child) {
|
||||
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
||||
}
|
||||
function mergeProps(slotProps, childProps) {
|
||||
const overrideProps = { ...childProps };
|
||||
for (const propName in childProps) {
|
||||
const slotPropValue = slotProps[propName];
|
||||
const childPropValue = childProps[propName];
|
||||
const isHandler = /^on[A-Z]/.test(propName);
|
||||
if (isHandler) {
|
||||
if (slotPropValue && childPropValue) {
|
||||
overrideProps[propName] = (...args) => {
|
||||
const result = childPropValue(...args);
|
||||
slotPropValue(...args);
|
||||
return result;
|
||||
};
|
||||
} else if (slotPropValue) {
|
||||
overrideProps[propName] = slotPropValue;
|
||||
}
|
||||
} else if (propName === "style") {
|
||||
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
||||
} else if (propName === "className") {
|
||||
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
||||
}
|
||||
}
|
||||
return { ...slotProps, ...overrideProps };
|
||||
}
|
||||
function getElementRef(element) {
|
||||
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
||||
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.ref;
|
||||
}
|
||||
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
||||
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.props.ref;
|
||||
}
|
||||
return element.props.ref || element.ref;
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-dialog/dist/index.mjs
|
||||
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
||||
var DIALOG_NAME = "Dialog";
|
||||
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
||||
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
||||
@@ -144,15 +48,15 @@ var Dialog = (props) => {
|
||||
onOpenChange,
|
||||
modal = true
|
||||
} = props;
|
||||
const triggerRef = React2.useRef(null);
|
||||
const contentRef = React2.useRef(null);
|
||||
const triggerRef = React.useRef(null);
|
||||
const contentRef = React.useRef(null);
|
||||
const [open, setOpen] = useControllableState({
|
||||
prop: openProp,
|
||||
defaultProp: defaultOpen ?? false,
|
||||
onChange: onOpenChange,
|
||||
caller: DIALOG_NAME
|
||||
});
|
||||
return (0, import_jsx_runtime2.jsx)(
|
||||
return (0, import_jsx_runtime.jsx)(
|
||||
DialogProvider,
|
||||
{
|
||||
scope: __scopeDialog,
|
||||
@@ -163,7 +67,7 @@ var Dialog = (props) => {
|
||||
descriptionId: useId(),
|
||||
open,
|
||||
onOpenChange: setOpen,
|
||||
onOpenToggle: React2.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
||||
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
||||
modal,
|
||||
children
|
||||
}
|
||||
@@ -171,18 +75,18 @@ var Dialog = (props) => {
|
||||
};
|
||||
Dialog.displayName = DIALOG_NAME;
|
||||
var TRIGGER_NAME = "DialogTrigger";
|
||||
var DialogTrigger = React2.forwardRef(
|
||||
var DialogTrigger = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...triggerProps } = props;
|
||||
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
||||
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
||||
return (0, import_jsx_runtime2.jsx)(
|
||||
return (0, import_jsx_runtime.jsx)(
|
||||
Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
"aria-haspopup": "dialog",
|
||||
"aria-expanded": context.open,
|
||||
"aria-controls": context.contentId,
|
||||
"aria-controls": context.open ? context.contentId : void 0,
|
||||
"data-state": getState(context.open),
|
||||
...triggerProps,
|
||||
ref: composedTriggerRef,
|
||||
@@ -199,28 +103,28 @@ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
|
||||
var DialogPortal = (props) => {
|
||||
const { __scopeDialog, forceMount, children, container } = props;
|
||||
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
||||
return (0, import_jsx_runtime2.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React2.Children.map(children, (child) => (0, import_jsx_runtime2.jsx)(Presence, { present: forceMount || context.open, children: (0, import_jsx_runtime2.jsx)(Portal, { asChild: true, container, children: child }) })) });
|
||||
return (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => (0, import_jsx_runtime.jsx)(Presence, { present: forceMount || context.open, children: (0, import_jsx_runtime.jsx)(Portal, { asChild: true, container, children: child }) })) });
|
||||
};
|
||||
DialogPortal.displayName = PORTAL_NAME;
|
||||
var OVERLAY_NAME = "DialogOverlay";
|
||||
var DialogOverlay = React2.forwardRef(
|
||||
var DialogOverlay = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
||||
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
||||
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
||||
return context.modal ? (0, import_jsx_runtime2.jsx)(Presence, { present: forceMount || context.open, children: (0, import_jsx_runtime2.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
||||
return context.modal ? (0, import_jsx_runtime.jsx)(Presence, { present: forceMount || context.open, children: (0, import_jsx_runtime.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
||||
}
|
||||
);
|
||||
DialogOverlay.displayName = OVERLAY_NAME;
|
||||
var Slot2 = createSlot("DialogOverlay.RemoveScroll");
|
||||
var DialogOverlayImpl = React2.forwardRef(
|
||||
var Slot = createSlot("DialogOverlay.RemoveScroll");
|
||||
var DialogOverlayImpl = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...overlayProps } = props;
|
||||
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
||||
return (
|
||||
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
||||
// ie. when `Overlay` and `Content` are siblings
|
||||
(0, import_jsx_runtime2.jsx)(Combination_default, { as: Slot2, allowPinchZoom: true, shards: [context.contentRef], children: (0, import_jsx_runtime2.jsx)(
|
||||
(0, import_jsx_runtime.jsx)(Combination_default, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: (0, import_jsx_runtime.jsx)(
|
||||
Primitive.div,
|
||||
{
|
||||
"data-state": getState(context.open),
|
||||
@@ -233,31 +137,31 @@ var DialogOverlayImpl = React2.forwardRef(
|
||||
}
|
||||
);
|
||||
var CONTENT_NAME = "DialogContent";
|
||||
var DialogContent = React2.forwardRef(
|
||||
var DialogContent = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
||||
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
||||
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
||||
return (0, import_jsx_runtime2.jsx)(Presence, { present: forceMount || context.open, children: context.modal ? (0, import_jsx_runtime2.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : (0, import_jsx_runtime2.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
||||
return (0, import_jsx_runtime.jsx)(Presence, { present: forceMount || context.open, children: context.modal ? (0, import_jsx_runtime.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : (0, import_jsx_runtime.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
||||
}
|
||||
);
|
||||
DialogContent.displayName = CONTENT_NAME;
|
||||
var DialogContentModal = React2.forwardRef(
|
||||
var DialogContentModal = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
||||
const contentRef = React2.useRef(null);
|
||||
const contentRef = React.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
||||
React2.useEffect(() => {
|
||||
React.useEffect(() => {
|
||||
const content = contentRef.current;
|
||||
if (content) return hideOthers(content);
|
||||
}, []);
|
||||
return (0, import_jsx_runtime2.jsx)(
|
||||
return (0, import_jsx_runtime.jsx)(
|
||||
DialogContentImpl,
|
||||
{
|
||||
...props,
|
||||
ref: composedRefs,
|
||||
trapFocus: context.open,
|
||||
disableOutsidePointerEvents: true,
|
||||
disableOutsidePointerEvents: context.open,
|
||||
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
||||
event.preventDefault();
|
||||
context.triggerRef.current?.focus();
|
||||
@@ -276,12 +180,12 @@ var DialogContentModal = React2.forwardRef(
|
||||
);
|
||||
}
|
||||
);
|
||||
var DialogContentNonModal = React2.forwardRef(
|
||||
var DialogContentNonModal = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
||||
const hasInteractedOutsideRef = React2.useRef(false);
|
||||
const hasPointerDownOutsideRef = React2.useRef(false);
|
||||
return (0, import_jsx_runtime2.jsx)(
|
||||
const hasInteractedOutsideRef = React.useRef(false);
|
||||
const hasPointerDownOutsideRef = React.useRef(false);
|
||||
return (0, import_jsx_runtime.jsx)(
|
||||
DialogContentImpl,
|
||||
{
|
||||
...props,
|
||||
@@ -316,15 +220,15 @@ var DialogContentNonModal = React2.forwardRef(
|
||||
);
|
||||
}
|
||||
);
|
||||
var DialogContentImpl = React2.forwardRef(
|
||||
var DialogContentImpl = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
||||
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
||||
const contentRef = React2.useRef(null);
|
||||
const contentRef = React.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
||||
useFocusGuards();
|
||||
return (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
||||
(0, import_jsx_runtime2.jsx)(
|
||||
return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
||||
(0, import_jsx_runtime.jsx)(
|
||||
FocusScope,
|
||||
{
|
||||
asChild: true,
|
||||
@@ -332,7 +236,7 @@ var DialogContentImpl = React2.forwardRef(
|
||||
trapped: trapFocus,
|
||||
onMountAutoFocus: onOpenAutoFocus,
|
||||
onUnmountAutoFocus: onCloseAutoFocus,
|
||||
children: (0, import_jsx_runtime2.jsx)(
|
||||
children: (0, import_jsx_runtime.jsx)(
|
||||
DismissableLayer,
|
||||
{
|
||||
role: "dialog",
|
||||
@@ -347,37 +251,37 @@ var DialogContentImpl = React2.forwardRef(
|
||||
)
|
||||
}
|
||||
),
|
||||
(0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
||||
(0, import_jsx_runtime2.jsx)(TitleWarning, { titleId: context.titleId }),
|
||||
(0, import_jsx_runtime2.jsx)(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
||||
(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
||||
(0, import_jsx_runtime.jsx)(TitleWarning, { titleId: context.titleId }),
|
||||
(0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
||||
] })
|
||||
] });
|
||||
}
|
||||
);
|
||||
var TITLE_NAME = "DialogTitle";
|
||||
var DialogTitle = React2.forwardRef(
|
||||
var DialogTitle = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...titleProps } = props;
|
||||
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
||||
return (0, import_jsx_runtime2.jsx)(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
||||
return (0, import_jsx_runtime.jsx)(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
DialogTitle.displayName = TITLE_NAME;
|
||||
var DESCRIPTION_NAME = "DialogDescription";
|
||||
var DialogDescription = React2.forwardRef(
|
||||
var DialogDescription = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...descriptionProps } = props;
|
||||
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
||||
return (0, import_jsx_runtime2.jsx)(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
||||
return (0, import_jsx_runtime.jsx)(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
DialogDescription.displayName = DESCRIPTION_NAME;
|
||||
var CLOSE_NAME = "DialogClose";
|
||||
var DialogClose = React2.forwardRef(
|
||||
var DialogClose = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...closeProps } = props;
|
||||
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
||||
return (0, import_jsx_runtime2.jsx)(
|
||||
return (0, import_jsx_runtime.jsx)(
|
||||
Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
@@ -405,7 +309,7 @@ var TitleWarning = ({ titleId }) => {
|
||||
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
||||
React2.useEffect(() => {
|
||||
React.useEffect(() => {
|
||||
if (titleId) {
|
||||
const hasTitle = document.getElementById(titleId);
|
||||
if (!hasTitle) console.error(MESSAGE);
|
||||
@@ -417,7 +321,7 @@ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
||||
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
||||
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
||||
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
||||
React2.useEffect(() => {
|
||||
React.useEffect(() => {
|
||||
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
||||
if (descriptionId && describedById) {
|
||||
const hasDescription = document.getElementById(descriptionId);
|
||||
|
||||
Reference in New Issue
Block a user