registration
This commit is contained in:
13
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/README.md
generated
vendored
Normal file
13
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/README.md
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# `react-dialog`
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ yarn add @radix-ui/react-dialog
|
||||
# or
|
||||
$ npm install @radix-ui/react-dialog
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
View docs [here](https://radix-ui.com/primitives/docs/components/dialog).
|
||||
103
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.d.mts
generated
vendored
Normal file
103
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
||||
import * as React from 'react';
|
||||
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
||||
import { FocusScope } from '@radix-ui/react-focus-scope';
|
||||
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
||||
import { Primitive } from '@radix-ui/react-primitive';
|
||||
|
||||
declare const createDialogScope: _radix_ui_react_context.CreateScope;
|
||||
interface DialogProps {
|
||||
children?: React.ReactNode;
|
||||
open?: boolean;
|
||||
defaultOpen?: boolean;
|
||||
onOpenChange?(open: boolean): void;
|
||||
modal?: boolean;
|
||||
}
|
||||
declare const Dialog: React.FC<DialogProps>;
|
||||
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
||||
interface DialogTriggerProps extends PrimitiveButtonProps {
|
||||
}
|
||||
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
||||
interface DialogPortalProps {
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* Specify a container element to portal the content into.
|
||||
*/
|
||||
container?: PortalProps['container'];
|
||||
/**
|
||||
* Used to force mounting when more control is needed. Useful when
|
||||
* controlling animation with React animation libraries.
|
||||
*/
|
||||
forceMount?: true;
|
||||
}
|
||||
declare const DialogPortal: React.FC<DialogPortalProps>;
|
||||
interface DialogOverlayProps extends DialogOverlayImplProps {
|
||||
/**
|
||||
* Used to force mounting when more control is needed. Useful when
|
||||
* controlling animation with React animation libraries.
|
||||
*/
|
||||
forceMount?: true;
|
||||
}
|
||||
declare const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
||||
interface DialogOverlayImplProps extends PrimitiveDivProps {
|
||||
}
|
||||
interface DialogContentProps extends DialogContentTypeProps {
|
||||
/**
|
||||
* Used to force mounting when more control is needed. Useful when
|
||||
* controlling animation with React animation libraries.
|
||||
*/
|
||||
forceMount?: true;
|
||||
}
|
||||
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
interface DialogContentTypeProps extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
||||
}
|
||||
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
||||
type FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;
|
||||
interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {
|
||||
/**
|
||||
* When `true`, focus cannot escape the `Content` via keyboard,
|
||||
* pointer, or a programmatic focus.
|
||||
* @defaultValue false
|
||||
*/
|
||||
trapFocus?: FocusScopeProps['trapped'];
|
||||
/**
|
||||
* Event handler called when auto-focusing on open.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
||||
/**
|
||||
* Event handler called when auto-focusing on close.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
||||
}
|
||||
type PrimitiveHeading2Props = React.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
||||
interface DialogTitleProps extends PrimitiveHeading2Props {
|
||||
}
|
||||
declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
||||
type PrimitiveParagraphProps = React.ComponentPropsWithoutRef<typeof Primitive.p>;
|
||||
interface DialogDescriptionProps extends PrimitiveParagraphProps {
|
||||
}
|
||||
declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
||||
interface DialogCloseProps extends PrimitiveButtonProps {
|
||||
}
|
||||
declare const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const WarningProvider: React.FC<{
|
||||
contentName: string;
|
||||
titleName: string;
|
||||
docsSlug: string;
|
||||
} & {
|
||||
children: React.ReactNode;
|
||||
}>;
|
||||
declare const Root: React.FC<DialogProps>;
|
||||
declare const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Portal: React.FC<DialogPortalProps>;
|
||||
declare const Overlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
||||
declare const Description: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
||||
declare const Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
|
||||
export { Close, Content, Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Overlay, Portal, Root, Title, Trigger, WarningProvider, createDialogScope };
|
||||
103
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.d.ts
generated
vendored
Normal file
103
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
||||
import * as React from 'react';
|
||||
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
||||
import { FocusScope } from '@radix-ui/react-focus-scope';
|
||||
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
||||
import { Primitive } from '@radix-ui/react-primitive';
|
||||
|
||||
declare const createDialogScope: _radix_ui_react_context.CreateScope;
|
||||
interface DialogProps {
|
||||
children?: React.ReactNode;
|
||||
open?: boolean;
|
||||
defaultOpen?: boolean;
|
||||
onOpenChange?(open: boolean): void;
|
||||
modal?: boolean;
|
||||
}
|
||||
declare const Dialog: React.FC<DialogProps>;
|
||||
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
||||
interface DialogTriggerProps extends PrimitiveButtonProps {
|
||||
}
|
||||
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
||||
interface DialogPortalProps {
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* Specify a container element to portal the content into.
|
||||
*/
|
||||
container?: PortalProps['container'];
|
||||
/**
|
||||
* Used to force mounting when more control is needed. Useful when
|
||||
* controlling animation with React animation libraries.
|
||||
*/
|
||||
forceMount?: true;
|
||||
}
|
||||
declare const DialogPortal: React.FC<DialogPortalProps>;
|
||||
interface DialogOverlayProps extends DialogOverlayImplProps {
|
||||
/**
|
||||
* Used to force mounting when more control is needed. Useful when
|
||||
* controlling animation with React animation libraries.
|
||||
*/
|
||||
forceMount?: true;
|
||||
}
|
||||
declare const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
||||
interface DialogOverlayImplProps extends PrimitiveDivProps {
|
||||
}
|
||||
interface DialogContentProps extends DialogContentTypeProps {
|
||||
/**
|
||||
* Used to force mounting when more control is needed. Useful when
|
||||
* controlling animation with React animation libraries.
|
||||
*/
|
||||
forceMount?: true;
|
||||
}
|
||||
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
interface DialogContentTypeProps extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
||||
}
|
||||
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
||||
type FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;
|
||||
interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {
|
||||
/**
|
||||
* When `true`, focus cannot escape the `Content` via keyboard,
|
||||
* pointer, or a programmatic focus.
|
||||
* @defaultValue false
|
||||
*/
|
||||
trapFocus?: FocusScopeProps['trapped'];
|
||||
/**
|
||||
* Event handler called when auto-focusing on open.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
||||
/**
|
||||
* Event handler called when auto-focusing on close.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
||||
}
|
||||
type PrimitiveHeading2Props = React.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
||||
interface DialogTitleProps extends PrimitiveHeading2Props {
|
||||
}
|
||||
declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
||||
type PrimitiveParagraphProps = React.ComponentPropsWithoutRef<typeof Primitive.p>;
|
||||
interface DialogDescriptionProps extends PrimitiveParagraphProps {
|
||||
}
|
||||
declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
||||
interface DialogCloseProps extends PrimitiveButtonProps {
|
||||
}
|
||||
declare const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const WarningProvider: React.FC<{
|
||||
contentName: string;
|
||||
titleName: string;
|
||||
docsSlug: string;
|
||||
} & {
|
||||
children: React.ReactNode;
|
||||
}>;
|
||||
declare const Root: React.FC<DialogProps>;
|
||||
declare const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Portal: React.FC<DialogPortalProps>;
|
||||
declare const Overlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
||||
declare const Description: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
||||
declare const Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
|
||||
export { Close, Content, Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Overlay, Portal, Root, Title, Trigger, WarningProvider, createDialogScope };
|
||||
372
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.js
generated
vendored
Normal file
372
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,372 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// packages/react/dialog/src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
Close: () => Close,
|
||||
Content: () => Content,
|
||||
Description: () => Description,
|
||||
Dialog: () => Dialog,
|
||||
DialogClose: () => DialogClose,
|
||||
DialogContent: () => DialogContent,
|
||||
DialogDescription: () => DialogDescription,
|
||||
DialogOverlay: () => DialogOverlay,
|
||||
DialogPortal: () => DialogPortal,
|
||||
DialogTitle: () => DialogTitle,
|
||||
DialogTrigger: () => DialogTrigger,
|
||||
Overlay: () => Overlay,
|
||||
Portal: () => Portal,
|
||||
Root: () => Root,
|
||||
Title: () => Title,
|
||||
Trigger: () => Trigger,
|
||||
WarningProvider: () => WarningProvider,
|
||||
createDialogScope: () => createDialogScope
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
|
||||
// packages/react/dialog/src/Dialog.tsx
|
||||
var React = __toESM(require("react"));
|
||||
var import_primitive = require("@radix-ui/primitive");
|
||||
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
||||
var import_react_context = require("@radix-ui/react-context");
|
||||
var import_react_id = require("@radix-ui/react-id");
|
||||
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
|
||||
var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer");
|
||||
var import_react_focus_scope = require("@radix-ui/react-focus-scope");
|
||||
var import_react_portal = require("@radix-ui/react-portal");
|
||||
var import_react_presence = require("@radix-ui/react-presence");
|
||||
var import_react_primitive = require("@radix-ui/react-primitive");
|
||||
var import_react_focus_guards = require("@radix-ui/react-focus-guards");
|
||||
var import_react_remove_scroll = require("react-remove-scroll");
|
||||
var import_aria_hidden = require("aria-hidden");
|
||||
var import_react_slot = require("@radix-ui/react-slot");
|
||||
var import_jsx_runtime = require("react/jsx-runtime");
|
||||
var DIALOG_NAME = "Dialog";
|
||||
var [createDialogContext, createDialogScope] = (0, import_react_context.createContextScope)(DIALOG_NAME);
|
||||
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
||||
var Dialog = (props) => {
|
||||
const {
|
||||
__scopeDialog,
|
||||
children,
|
||||
open: openProp,
|
||||
defaultOpen,
|
||||
onOpenChange,
|
||||
modal = true
|
||||
} = props;
|
||||
const triggerRef = React.useRef(null);
|
||||
const contentRef = React.useRef(null);
|
||||
const [open = false, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
|
||||
prop: openProp,
|
||||
defaultProp: defaultOpen,
|
||||
onChange: onOpenChange
|
||||
});
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
DialogProvider,
|
||||
{
|
||||
scope: __scopeDialog,
|
||||
triggerRef,
|
||||
contentRef,
|
||||
contentId: (0, import_react_id.useId)(),
|
||||
titleId: (0, import_react_id.useId)(),
|
||||
descriptionId: (0, import_react_id.useId)(),
|
||||
open,
|
||||
onOpenChange: setOpen,
|
||||
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
||||
modal,
|
||||
children
|
||||
}
|
||||
);
|
||||
};
|
||||
Dialog.displayName = DIALOG_NAME;
|
||||
var TRIGGER_NAME = "DialogTrigger";
|
||||
var DialogTrigger = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...triggerProps } = props;
|
||||
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
||||
const composedTriggerRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_primitive.Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
"aria-haspopup": "dialog",
|
||||
"aria-expanded": context.open,
|
||||
"aria-controls": context.contentId,
|
||||
"data-state": getState(context.open),
|
||||
...triggerProps,
|
||||
ref: composedTriggerRef,
|
||||
onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onOpenToggle)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
DialogTrigger.displayName = TRIGGER_NAME;
|
||||
var PORTAL_NAME = "DialogPortal";
|
||||
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
|
||||
forceMount: void 0
|
||||
});
|
||||
var DialogPortal = (props) => {
|
||||
const { __scopeDialog, forceMount, children, container } = props;
|
||||
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children: child }) })) });
|
||||
};
|
||||
DialogPortal.displayName = PORTAL_NAME;
|
||||
var OVERLAY_NAME = "DialogOverlay";
|
||||
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 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
||||
}
|
||||
);
|
||||
DialogOverlay.displayName = OVERLAY_NAME;
|
||||
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
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_remove_scroll.RemoveScroll, { as: import_react_slot.Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_primitive.Primitive.div,
|
||||
{
|
||||
"data-state": getState(context.open),
|
||||
...overlayProps,
|
||||
ref: forwardedRef,
|
||||
style: { pointerEvents: "auto", ...overlayProps.style }
|
||||
}
|
||||
) })
|
||||
);
|
||||
}
|
||||
);
|
||||
var CONTENT_NAME = "DialogContent";
|
||||
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 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
||||
}
|
||||
);
|
||||
DialogContent.displayName = CONTENT_NAME;
|
||||
var DialogContentModal = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
||||
const contentRef = React.useRef(null);
|
||||
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.contentRef, contentRef);
|
||||
React.useEffect(() => {
|
||||
const content = contentRef.current;
|
||||
if (content) return (0, import_aria_hidden.hideOthers)(content);
|
||||
}, []);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
DialogContentImpl,
|
||||
{
|
||||
...props,
|
||||
ref: composedRefs,
|
||||
trapFocus: context.open,
|
||||
disableOutsidePointerEvents: true,
|
||||
onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
|
||||
event.preventDefault();
|
||||
context.triggerRef.current?.focus();
|
||||
}),
|
||||
onPointerDownOutside: (0, import_primitive.composeEventHandlers)(props.onPointerDownOutside, (event) => {
|
||||
const originalEvent = event.detail.originalEvent;
|
||||
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
||||
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
||||
if (isRightClick) event.preventDefault();
|
||||
}),
|
||||
onFocusOutside: (0, import_primitive.composeEventHandlers)(
|
||||
props.onFocusOutside,
|
||||
(event) => event.preventDefault()
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
var DialogContentNonModal = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
||||
const hasInteractedOutsideRef = React.useRef(false);
|
||||
const hasPointerDownOutsideRef = React.useRef(false);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
DialogContentImpl,
|
||||
{
|
||||
...props,
|
||||
ref: forwardedRef,
|
||||
trapFocus: false,
|
||||
disableOutsidePointerEvents: false,
|
||||
onCloseAutoFocus: (event) => {
|
||||
props.onCloseAutoFocus?.(event);
|
||||
if (!event.defaultPrevented) {
|
||||
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
||||
event.preventDefault();
|
||||
}
|
||||
hasInteractedOutsideRef.current = false;
|
||||
hasPointerDownOutsideRef.current = false;
|
||||
},
|
||||
onInteractOutside: (event) => {
|
||||
props.onInteractOutside?.(event);
|
||||
if (!event.defaultPrevented) {
|
||||
hasInteractedOutsideRef.current = true;
|
||||
if (event.detail.originalEvent.type === "pointerdown") {
|
||||
hasPointerDownOutsideRef.current = true;
|
||||
}
|
||||
}
|
||||
const target = event.target;
|
||||
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
||||
if (targetIsTrigger) event.preventDefault();
|
||||
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
var DialogContentImpl = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
||||
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
||||
const contentRef = React.useRef(null);
|
||||
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef);
|
||||
(0, import_react_focus_guards.useFocusGuards)();
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_focus_scope.FocusScope,
|
||||
{
|
||||
asChild: true,
|
||||
loop: true,
|
||||
trapped: trapFocus,
|
||||
onMountAutoFocus: onOpenAutoFocus,
|
||||
onUnmountAutoFocus: onCloseAutoFocus,
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_dismissable_layer.DismissableLayer,
|
||||
{
|
||||
role: "dialog",
|
||||
id: context.contentId,
|
||||
"aria-describedby": context.descriptionId,
|
||||
"aria-labelledby": context.titleId,
|
||||
"data-state": getState(context.open),
|
||||
...contentProps,
|
||||
ref: composedRefs,
|
||||
onDismiss: () => context.onOpenChange(false)
|
||||
}
|
||||
)
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleWarning, { titleId: context.titleId }),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
||||
] })
|
||||
] });
|
||||
}
|
||||
);
|
||||
var TITLE_NAME = "DialogTitle";
|
||||
var DialogTitle = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...titleProps } = props;
|
||||
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
DialogTitle.displayName = TITLE_NAME;
|
||||
var DESCRIPTION_NAME = "DialogDescription";
|
||||
var DialogDescription = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...descriptionProps } = props;
|
||||
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
DialogDescription.displayName = DESCRIPTION_NAME;
|
||||
var CLOSE_NAME = "DialogClose";
|
||||
var DialogClose = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...closeProps } = props;
|
||||
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_primitive.Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
...closeProps,
|
||||
ref: forwardedRef,
|
||||
onClick: (0, import_primitive.composeEventHandlers)(props.onClick, () => context.onOpenChange(false))
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
DialogClose.displayName = CLOSE_NAME;
|
||||
function getState(open) {
|
||||
return open ? "open" : "closed";
|
||||
}
|
||||
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
||||
var [WarningProvider, useWarningContext] = (0, import_react_context.createContext)(TITLE_WARNING_NAME, {
|
||||
contentName: CONTENT_NAME,
|
||||
titleName: TITLE_NAME,
|
||||
docsSlug: "dialog"
|
||||
});
|
||||
var TitleWarning = ({ titleId }) => {
|
||||
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
||||
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
||||
|
||||
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}`;
|
||||
React.useEffect(() => {
|
||||
if (titleId) {
|
||||
const hasTitle = document.getElementById(titleId);
|
||||
if (!hasTitle) console.error(MESSAGE);
|
||||
}
|
||||
}, [MESSAGE, titleId]);
|
||||
return null;
|
||||
};
|
||||
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}}.`;
|
||||
React.useEffect(() => {
|
||||
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
||||
if (descriptionId && describedById) {
|
||||
const hasDescription = document.getElementById(descriptionId);
|
||||
if (!hasDescription) console.warn(MESSAGE);
|
||||
}
|
||||
}, [MESSAGE, contentRef, descriptionId]);
|
||||
return null;
|
||||
};
|
||||
var Root = Dialog;
|
||||
var Trigger = DialogTrigger;
|
||||
var Portal = DialogPortal;
|
||||
var Overlay = DialogOverlay;
|
||||
var Content = DialogContent;
|
||||
var Title = DialogTitle;
|
||||
var Description = DialogDescription;
|
||||
var Close = DialogClose;
|
||||
//# sourceMappingURL=index.js.map
|
||||
7
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.js.map
generated
vendored
Normal file
7
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
340
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.mjs
generated
vendored
Normal file
340
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,340 @@
|
||||
"use client";
|
||||
|
||||
// packages/react/dialog/src/Dialog.tsx
|
||||
import * as React from "react";
|
||||
import { composeEventHandlers } from "@radix-ui/primitive";
|
||||
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
||||
import { createContext, createContextScope } from "@radix-ui/react-context";
|
||||
import { useId } from "@radix-ui/react-id";
|
||||
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
||||
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
||||
import { FocusScope } from "@radix-ui/react-focus-scope";
|
||||
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
||||
import { Presence } from "@radix-ui/react-presence";
|
||||
import { Primitive } from "@radix-ui/react-primitive";
|
||||
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
||||
import { RemoveScroll } from "react-remove-scroll";
|
||||
import { hideOthers } from "aria-hidden";
|
||||
import { Slot } from "@radix-ui/react-slot";
|
||||
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
||||
var DIALOG_NAME = "Dialog";
|
||||
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
||||
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
||||
var Dialog = (props) => {
|
||||
const {
|
||||
__scopeDialog,
|
||||
children,
|
||||
open: openProp,
|
||||
defaultOpen,
|
||||
onOpenChange,
|
||||
modal = true
|
||||
} = props;
|
||||
const triggerRef = React.useRef(null);
|
||||
const contentRef = React.useRef(null);
|
||||
const [open = false, setOpen] = useControllableState({
|
||||
prop: openProp,
|
||||
defaultProp: defaultOpen,
|
||||
onChange: onOpenChange
|
||||
});
|
||||
return /* @__PURE__ */ jsx(
|
||||
DialogProvider,
|
||||
{
|
||||
scope: __scopeDialog,
|
||||
triggerRef,
|
||||
contentRef,
|
||||
contentId: useId(),
|
||||
titleId: useId(),
|
||||
descriptionId: useId(),
|
||||
open,
|
||||
onOpenChange: setOpen,
|
||||
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
||||
modal,
|
||||
children
|
||||
}
|
||||
);
|
||||
};
|
||||
Dialog.displayName = DIALOG_NAME;
|
||||
var TRIGGER_NAME = "DialogTrigger";
|
||||
var DialogTrigger = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...triggerProps } = props;
|
||||
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
||||
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
||||
return /* @__PURE__ */ jsx(
|
||||
Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
"aria-haspopup": "dialog",
|
||||
"aria-expanded": context.open,
|
||||
"aria-controls": context.contentId,
|
||||
"data-state": getState(context.open),
|
||||
...triggerProps,
|
||||
ref: composedTriggerRef,
|
||||
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
DialogTrigger.displayName = TRIGGER_NAME;
|
||||
var PORTAL_NAME = "DialogPortal";
|
||||
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
|
||||
forceMount: void 0
|
||||
});
|
||||
var DialogPortal = (props) => {
|
||||
const { __scopeDialog, forceMount, children, container } = props;
|
||||
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
||||
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });
|
||||
};
|
||||
DialogPortal.displayName = PORTAL_NAME;
|
||||
var OVERLAY_NAME = "DialogOverlay";
|
||||
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 ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
||||
}
|
||||
);
|
||||
DialogOverlay.displayName = OVERLAY_NAME;
|
||||
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
|
||||
/* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
|
||||
Primitive.div,
|
||||
{
|
||||
"data-state": getState(context.open),
|
||||
...overlayProps,
|
||||
ref: forwardedRef,
|
||||
style: { pointerEvents: "auto", ...overlayProps.style }
|
||||
}
|
||||
) })
|
||||
);
|
||||
}
|
||||
);
|
||||
var CONTENT_NAME = "DialogContent";
|
||||
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 /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
||||
}
|
||||
);
|
||||
DialogContent.displayName = CONTENT_NAME;
|
||||
var DialogContentModal = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
||||
const contentRef = React.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
||||
React.useEffect(() => {
|
||||
const content = contentRef.current;
|
||||
if (content) return hideOthers(content);
|
||||
}, []);
|
||||
return /* @__PURE__ */ jsx(
|
||||
DialogContentImpl,
|
||||
{
|
||||
...props,
|
||||
ref: composedRefs,
|
||||
trapFocus: context.open,
|
||||
disableOutsidePointerEvents: true,
|
||||
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
||||
event.preventDefault();
|
||||
context.triggerRef.current?.focus();
|
||||
}),
|
||||
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
||||
const originalEvent = event.detail.originalEvent;
|
||||
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
||||
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
||||
if (isRightClick) event.preventDefault();
|
||||
}),
|
||||
onFocusOutside: composeEventHandlers(
|
||||
props.onFocusOutside,
|
||||
(event) => event.preventDefault()
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
var DialogContentNonModal = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
||||
const hasInteractedOutsideRef = React.useRef(false);
|
||||
const hasPointerDownOutsideRef = React.useRef(false);
|
||||
return /* @__PURE__ */ jsx(
|
||||
DialogContentImpl,
|
||||
{
|
||||
...props,
|
||||
ref: forwardedRef,
|
||||
trapFocus: false,
|
||||
disableOutsidePointerEvents: false,
|
||||
onCloseAutoFocus: (event) => {
|
||||
props.onCloseAutoFocus?.(event);
|
||||
if (!event.defaultPrevented) {
|
||||
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
||||
event.preventDefault();
|
||||
}
|
||||
hasInteractedOutsideRef.current = false;
|
||||
hasPointerDownOutsideRef.current = false;
|
||||
},
|
||||
onInteractOutside: (event) => {
|
||||
props.onInteractOutside?.(event);
|
||||
if (!event.defaultPrevented) {
|
||||
hasInteractedOutsideRef.current = true;
|
||||
if (event.detail.originalEvent.type === "pointerdown") {
|
||||
hasPointerDownOutsideRef.current = true;
|
||||
}
|
||||
}
|
||||
const target = event.target;
|
||||
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
||||
if (targetIsTrigger) event.preventDefault();
|
||||
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
var DialogContentImpl = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
||||
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
||||
const contentRef = React.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
||||
useFocusGuards();
|
||||
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
||||
/* @__PURE__ */ jsx(
|
||||
FocusScope,
|
||||
{
|
||||
asChild: true,
|
||||
loop: true,
|
||||
trapped: trapFocus,
|
||||
onMountAutoFocus: onOpenAutoFocus,
|
||||
onUnmountAutoFocus: onCloseAutoFocus,
|
||||
children: /* @__PURE__ */ jsx(
|
||||
DismissableLayer,
|
||||
{
|
||||
role: "dialog",
|
||||
id: context.contentId,
|
||||
"aria-describedby": context.descriptionId,
|
||||
"aria-labelledby": context.titleId,
|
||||
"data-state": getState(context.open),
|
||||
...contentProps,
|
||||
ref: composedRefs,
|
||||
onDismiss: () => context.onOpenChange(false)
|
||||
}
|
||||
)
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ jsxs(Fragment, { children: [
|
||||
/* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),
|
||||
/* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
||||
] })
|
||||
] });
|
||||
}
|
||||
);
|
||||
var TITLE_NAME = "DialogTitle";
|
||||
var DialogTitle = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...titleProps } = props;
|
||||
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
||||
return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
DialogTitle.displayName = TITLE_NAME;
|
||||
var DESCRIPTION_NAME = "DialogDescription";
|
||||
var DialogDescription = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...descriptionProps } = props;
|
||||
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
||||
return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
DialogDescription.displayName = DESCRIPTION_NAME;
|
||||
var CLOSE_NAME = "DialogClose";
|
||||
var DialogClose = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeDialog, ...closeProps } = props;
|
||||
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
||||
return /* @__PURE__ */ jsx(
|
||||
Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
...closeProps,
|
||||
ref: forwardedRef,
|
||||
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
DialogClose.displayName = CLOSE_NAME;
|
||||
function getState(open) {
|
||||
return open ? "open" : "closed";
|
||||
}
|
||||
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
||||
var [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {
|
||||
contentName: CONTENT_NAME,
|
||||
titleName: TITLE_NAME,
|
||||
docsSlug: "dialog"
|
||||
});
|
||||
var TitleWarning = ({ titleId }) => {
|
||||
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
||||
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
||||
|
||||
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}`;
|
||||
React.useEffect(() => {
|
||||
if (titleId) {
|
||||
const hasTitle = document.getElementById(titleId);
|
||||
if (!hasTitle) console.error(MESSAGE);
|
||||
}
|
||||
}, [MESSAGE, titleId]);
|
||||
return null;
|
||||
};
|
||||
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}}.`;
|
||||
React.useEffect(() => {
|
||||
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
||||
if (descriptionId && describedById) {
|
||||
const hasDescription = document.getElementById(descriptionId);
|
||||
if (!hasDescription) console.warn(MESSAGE);
|
||||
}
|
||||
}, [MESSAGE, contentRef, descriptionId]);
|
||||
return null;
|
||||
};
|
||||
var Root = Dialog;
|
||||
var Trigger = DialogTrigger;
|
||||
var Portal = DialogPortal;
|
||||
var Overlay = DialogOverlay;
|
||||
var Content = DialogContent;
|
||||
var Title = DialogTitle;
|
||||
var Description = DialogDescription;
|
||||
var Close = DialogClose;
|
||||
export {
|
||||
Close,
|
||||
Content,
|
||||
Description,
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogOverlay,
|
||||
DialogPortal,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
Overlay,
|
||||
Portal,
|
||||
Root,
|
||||
Title,
|
||||
Trigger,
|
||||
WarningProvider,
|
||||
createDialogScope
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
7
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.mjs.map
generated
vendored
Normal file
7
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
68
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/package.json
generated
vendored
Normal file
68
frontend/style/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/package.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"name": "@radix-ui/react-dialog",
|
||||
"version": "1.1.4",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"source": "./src/index.ts",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"clean": "rm -rf dist",
|
||||
"version": "yarn version"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/primitive": "1.1.1",
|
||||
"@radix-ui/react-compose-refs": "1.1.1",
|
||||
"@radix-ui/react-context": "1.1.1",
|
||||
"@radix-ui/react-dismissable-layer": "1.1.3",
|
||||
"@radix-ui/react-focus-guards": "1.1.1",
|
||||
"@radix-ui/react-focus-scope": "1.1.1",
|
||||
"@radix-ui/react-id": "1.1.0",
|
||||
"@radix-ui/react-portal": "1.1.3",
|
||||
"@radix-ui/react-presence": "1.1.2",
|
||||
"@radix-ui/react-primitive": "2.0.1",
|
||||
"@radix-ui/react-slot": "1.1.1",
|
||||
"@radix-ui/react-use-controllable-state": "1.1.0",
|
||||
"aria-hidden": "^1.1.1",
|
||||
"react-remove-scroll": "^2.6.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"homepage": "https://radix-ui.com/primitives",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/radix-ui/primitives.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/radix-ui/primitives/issues"
|
||||
}
|
||||
}
|
||||
13
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/README.md
generated
vendored
Normal file
13
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/README.md
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# `react-dismissable-layer`
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ yarn add @radix-ui/react-dismissable-layer
|
||||
# or
|
||||
$ npm install @radix-ui/react-dismissable-layer
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
This is an internal utility, not intended for public usage.
|
||||
51
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts
generated
vendored
Normal file
51
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import * as React from 'react';
|
||||
import { Primitive } from '@radix-ui/react-primitive';
|
||||
|
||||
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
||||
interface DismissableLayerProps extends PrimitiveDivProps {
|
||||
/**
|
||||
* When `true`, hover/focus/click interactions will be disabled on elements outside
|
||||
* the `DismissableLayer`. Users will need to click twice on outside elements to
|
||||
* interact with them: once to close the `DismissableLayer`, and again to trigger the element.
|
||||
*/
|
||||
disableOutsidePointerEvents?: boolean;
|
||||
/**
|
||||
* Event handler called when the escape key is down.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
||||
/**
|
||||
* Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
|
||||
/**
|
||||
* Event handler called when the focus moves outside of the `DismissableLayer`.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onFocusOutside?: (event: FocusOutsideEvent) => void;
|
||||
/**
|
||||
* Event handler called when an interaction happens outside the `DismissableLayer`.
|
||||
* Specifically, when a `pointerdown` event happens outside or focus moves outside of it.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;
|
||||
/**
|
||||
* Handler called when the `DismissableLayer` should be dismissed
|
||||
*/
|
||||
onDismiss?: () => void;
|
||||
}
|
||||
declare const DismissableLayer: React.ForwardRefExoticComponent<DismissableLayerProps & React.RefAttributes<HTMLDivElement>>;
|
||||
interface DismissableLayerBranchProps extends PrimitiveDivProps {
|
||||
}
|
||||
declare const DismissableLayerBranch: React.ForwardRefExoticComponent<DismissableLayerBranchProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type PointerDownOutsideEvent = CustomEvent<{
|
||||
originalEvent: PointerEvent;
|
||||
}>;
|
||||
type FocusOutsideEvent = CustomEvent<{
|
||||
originalEvent: FocusEvent;
|
||||
}>;
|
||||
declare const Root: React.ForwardRefExoticComponent<DismissableLayerProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Branch: React.ForwardRefExoticComponent<DismissableLayerBranchProps & React.RefAttributes<HTMLDivElement>>;
|
||||
|
||||
export { Branch, DismissableLayer, DismissableLayerBranch, type DismissableLayerProps, Root };
|
||||
51
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts
generated
vendored
Normal file
51
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import * as React from 'react';
|
||||
import { Primitive } from '@radix-ui/react-primitive';
|
||||
|
||||
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
||||
interface DismissableLayerProps extends PrimitiveDivProps {
|
||||
/**
|
||||
* When `true`, hover/focus/click interactions will be disabled on elements outside
|
||||
* the `DismissableLayer`. Users will need to click twice on outside elements to
|
||||
* interact with them: once to close the `DismissableLayer`, and again to trigger the element.
|
||||
*/
|
||||
disableOutsidePointerEvents?: boolean;
|
||||
/**
|
||||
* Event handler called when the escape key is down.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
||||
/**
|
||||
* Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
|
||||
/**
|
||||
* Event handler called when the focus moves outside of the `DismissableLayer`.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onFocusOutside?: (event: FocusOutsideEvent) => void;
|
||||
/**
|
||||
* Event handler called when an interaction happens outside the `DismissableLayer`.
|
||||
* Specifically, when a `pointerdown` event happens outside or focus moves outside of it.
|
||||
* Can be prevented.
|
||||
*/
|
||||
onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;
|
||||
/**
|
||||
* Handler called when the `DismissableLayer` should be dismissed
|
||||
*/
|
||||
onDismiss?: () => void;
|
||||
}
|
||||
declare const DismissableLayer: React.ForwardRefExoticComponent<DismissableLayerProps & React.RefAttributes<HTMLDivElement>>;
|
||||
interface DismissableLayerBranchProps extends PrimitiveDivProps {
|
||||
}
|
||||
declare const DismissableLayerBranch: React.ForwardRefExoticComponent<DismissableLayerBranchProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type PointerDownOutsideEvent = CustomEvent<{
|
||||
originalEvent: PointerEvent;
|
||||
}>;
|
||||
type FocusOutsideEvent = CustomEvent<{
|
||||
originalEvent: FocusEvent;
|
||||
}>;
|
||||
declare const Root: React.ForwardRefExoticComponent<DismissableLayerProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Branch: React.ForwardRefExoticComponent<DismissableLayerBranchProps & React.RefAttributes<HTMLDivElement>>;
|
||||
|
||||
export { Branch, DismissableLayer, DismissableLayerBranch, type DismissableLayerProps, Root };
|
||||
253
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js
generated
vendored
Normal file
253
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,253 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// packages/react/dismissable-layer/src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
Branch: () => Branch,
|
||||
DismissableLayer: () => DismissableLayer,
|
||||
DismissableLayerBranch: () => DismissableLayerBranch,
|
||||
Root: () => Root
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
|
||||
// packages/react/dismissable-layer/src/DismissableLayer.tsx
|
||||
var React = __toESM(require("react"));
|
||||
var import_primitive = require("@radix-ui/primitive");
|
||||
var import_react_primitive = require("@radix-ui/react-primitive");
|
||||
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
||||
var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref");
|
||||
var import_react_use_escape_keydown = require("@radix-ui/react-use-escape-keydown");
|
||||
var import_jsx_runtime = require("react/jsx-runtime");
|
||||
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
||||
var CONTEXT_UPDATE = "dismissableLayer.update";
|
||||
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
||||
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
||||
var originalBodyPointerEvents;
|
||||
var DismissableLayerContext = React.createContext({
|
||||
layers: /* @__PURE__ */ new Set(),
|
||||
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
||||
branches: /* @__PURE__ */ new Set()
|
||||
});
|
||||
var DismissableLayer = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
disableOutsidePointerEvents = false,
|
||||
onEscapeKeyDown,
|
||||
onPointerDownOutside,
|
||||
onFocusOutside,
|
||||
onInteractOutside,
|
||||
onDismiss,
|
||||
...layerProps
|
||||
} = props;
|
||||
const context = React.useContext(DismissableLayerContext);
|
||||
const [node, setNode] = React.useState(null);
|
||||
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
||||
const [, force] = React.useState({});
|
||||
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node2) => setNode(node2));
|
||||
const layers = Array.from(context.layers);
|
||||
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
||||
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
||||
const index = node ? layers.indexOf(node) : -1;
|
||||
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
||||
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
||||
const pointerDownOutside = usePointerDownOutside((event) => {
|
||||
const target = event.target;
|
||||
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
||||
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
||||
onPointerDownOutside?.(event);
|
||||
onInteractOutside?.(event);
|
||||
if (!event.defaultPrevented) onDismiss?.();
|
||||
}, ownerDocument);
|
||||
const focusOutside = useFocusOutside((event) => {
|
||||
const target = event.target;
|
||||
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
||||
if (isFocusInBranch) return;
|
||||
onFocusOutside?.(event);
|
||||
onInteractOutside?.(event);
|
||||
if (!event.defaultPrevented) onDismiss?.();
|
||||
}, ownerDocument);
|
||||
(0, import_react_use_escape_keydown.useEscapeKeydown)((event) => {
|
||||
const isHighestLayer = index === context.layers.size - 1;
|
||||
if (!isHighestLayer) return;
|
||||
onEscapeKeyDown?.(event);
|
||||
if (!event.defaultPrevented && onDismiss) {
|
||||
event.preventDefault();
|
||||
onDismiss();
|
||||
}
|
||||
}, ownerDocument);
|
||||
React.useEffect(() => {
|
||||
if (!node) return;
|
||||
if (disableOutsidePointerEvents) {
|
||||
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
||||
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
||||
ownerDocument.body.style.pointerEvents = "none";
|
||||
}
|
||||
context.layersWithOutsidePointerEventsDisabled.add(node);
|
||||
}
|
||||
context.layers.add(node);
|
||||
dispatchUpdate();
|
||||
return () => {
|
||||
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
||||
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
||||
}
|
||||
};
|
||||
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
||||
React.useEffect(() => {
|
||||
return () => {
|
||||
if (!node) return;
|
||||
context.layers.delete(node);
|
||||
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
||||
dispatchUpdate();
|
||||
};
|
||||
}, [node, context]);
|
||||
React.useEffect(() => {
|
||||
const handleUpdate = () => force({});
|
||||
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
||||
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
||||
}, []);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_primitive.Primitive.div,
|
||||
{
|
||||
...layerProps,
|
||||
ref: composedRefs,
|
||||
style: {
|
||||
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
||||
...props.style
|
||||
},
|
||||
onFocusCapture: (0, import_primitive.composeEventHandlers)(props.onFocusCapture, focusOutside.onFocusCapture),
|
||||
onBlurCapture: (0, import_primitive.composeEventHandlers)(props.onBlurCapture, focusOutside.onBlurCapture),
|
||||
onPointerDownCapture: (0, import_primitive.composeEventHandlers)(
|
||||
props.onPointerDownCapture,
|
||||
pointerDownOutside.onPointerDownCapture
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
||||
var BRANCH_NAME = "DismissableLayerBranch";
|
||||
var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
||||
const context = React.useContext(DismissableLayerContext);
|
||||
const ref = React.useRef(null);
|
||||
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref);
|
||||
React.useEffect(() => {
|
||||
const node = ref.current;
|
||||
if (node) {
|
||||
context.branches.add(node);
|
||||
return () => {
|
||||
context.branches.delete(node);
|
||||
};
|
||||
}
|
||||
}, [context.branches]);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...props, ref: composedRefs });
|
||||
});
|
||||
DismissableLayerBranch.displayName = BRANCH_NAME;
|
||||
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
||||
const handlePointerDownOutside = (0, import_react_use_callback_ref.useCallbackRef)(onPointerDownOutside);
|
||||
const isPointerInsideReactTreeRef = React.useRef(false);
|
||||
const handleClickRef = React.useRef(() => {
|
||||
});
|
||||
React.useEffect(() => {
|
||||
const handlePointerDown = (event) => {
|
||||
if (event.target && !isPointerInsideReactTreeRef.current) {
|
||||
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
||||
handleAndDispatchCustomEvent(
|
||||
POINTER_DOWN_OUTSIDE,
|
||||
handlePointerDownOutside,
|
||||
eventDetail,
|
||||
{ discrete: true }
|
||||
);
|
||||
};
|
||||
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
||||
const eventDetail = { originalEvent: event };
|
||||
if (event.pointerType === "touch") {
|
||||
ownerDocument.removeEventListener("click", handleClickRef.current);
|
||||
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
||||
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
||||
} else {
|
||||
handleAndDispatchPointerDownOutsideEvent2();
|
||||
}
|
||||
} else {
|
||||
ownerDocument.removeEventListener("click", handleClickRef.current);
|
||||
}
|
||||
isPointerInsideReactTreeRef.current = false;
|
||||
};
|
||||
const timerId = window.setTimeout(() => {
|
||||
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
||||
}, 0);
|
||||
return () => {
|
||||
window.clearTimeout(timerId);
|
||||
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
||||
ownerDocument.removeEventListener("click", handleClickRef.current);
|
||||
};
|
||||
}, [ownerDocument, handlePointerDownOutside]);
|
||||
return {
|
||||
// ensures we check React component tree (not just DOM tree)
|
||||
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
||||
};
|
||||
}
|
||||
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
||||
const handleFocusOutside = (0, import_react_use_callback_ref.useCallbackRef)(onFocusOutside);
|
||||
const isFocusInsideReactTreeRef = React.useRef(false);
|
||||
React.useEffect(() => {
|
||||
const handleFocus = (event) => {
|
||||
if (event.target && !isFocusInsideReactTreeRef.current) {
|
||||
const eventDetail = { originalEvent: event };
|
||||
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
||||
discrete: false
|
||||
});
|
||||
}
|
||||
};
|
||||
ownerDocument.addEventListener("focusin", handleFocus);
|
||||
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
||||
}, [ownerDocument, handleFocusOutside]);
|
||||
return {
|
||||
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
||||
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
||||
};
|
||||
}
|
||||
function dispatchUpdate() {
|
||||
const event = new CustomEvent(CONTEXT_UPDATE);
|
||||
document.dispatchEvent(event);
|
||||
}
|
||||
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
||||
const target = detail.originalEvent.target;
|
||||
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
||||
if (handler) target.addEventListener(name, handler, { once: true });
|
||||
if (discrete) {
|
||||
(0, import_react_primitive.dispatchDiscreteCustomEvent)(target, event);
|
||||
} else {
|
||||
target.dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
var Root = DismissableLayer;
|
||||
var Branch = DismissableLayerBranch;
|
||||
//# sourceMappingURL=index.js.map
|
||||
7
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map
generated
vendored
Normal file
7
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
221
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
generated
vendored
Normal file
221
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,221 @@
|
||||
"use client";
|
||||
|
||||
// packages/react/dismissable-layer/src/DismissableLayer.tsx
|
||||
import * as React from "react";
|
||||
import { composeEventHandlers } from "@radix-ui/primitive";
|
||||
import { Primitive, dispatchDiscreteCustomEvent } from "@radix-ui/react-primitive";
|
||||
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
||||
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
|
||||
import { useEscapeKeydown } from "@radix-ui/react-use-escape-keydown";
|
||||
import { jsx } from "react/jsx-runtime";
|
||||
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
||||
var CONTEXT_UPDATE = "dismissableLayer.update";
|
||||
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
||||
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
||||
var originalBodyPointerEvents;
|
||||
var DismissableLayerContext = React.createContext({
|
||||
layers: /* @__PURE__ */ new Set(),
|
||||
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
||||
branches: /* @__PURE__ */ new Set()
|
||||
});
|
||||
var DismissableLayer = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
disableOutsidePointerEvents = false,
|
||||
onEscapeKeyDown,
|
||||
onPointerDownOutside,
|
||||
onFocusOutside,
|
||||
onInteractOutside,
|
||||
onDismiss,
|
||||
...layerProps
|
||||
} = props;
|
||||
const context = React.useContext(DismissableLayerContext);
|
||||
const [node, setNode] = React.useState(null);
|
||||
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
||||
const [, force] = React.useState({});
|
||||
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
||||
const layers = Array.from(context.layers);
|
||||
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
||||
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
||||
const index = node ? layers.indexOf(node) : -1;
|
||||
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
||||
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
||||
const pointerDownOutside = usePointerDownOutside((event) => {
|
||||
const target = event.target;
|
||||
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
||||
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
||||
onPointerDownOutside?.(event);
|
||||
onInteractOutside?.(event);
|
||||
if (!event.defaultPrevented) onDismiss?.();
|
||||
}, ownerDocument);
|
||||
const focusOutside = useFocusOutside((event) => {
|
||||
const target = event.target;
|
||||
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
||||
if (isFocusInBranch) return;
|
||||
onFocusOutside?.(event);
|
||||
onInteractOutside?.(event);
|
||||
if (!event.defaultPrevented) onDismiss?.();
|
||||
}, ownerDocument);
|
||||
useEscapeKeydown((event) => {
|
||||
const isHighestLayer = index === context.layers.size - 1;
|
||||
if (!isHighestLayer) return;
|
||||
onEscapeKeyDown?.(event);
|
||||
if (!event.defaultPrevented && onDismiss) {
|
||||
event.preventDefault();
|
||||
onDismiss();
|
||||
}
|
||||
}, ownerDocument);
|
||||
React.useEffect(() => {
|
||||
if (!node) return;
|
||||
if (disableOutsidePointerEvents) {
|
||||
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
||||
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
||||
ownerDocument.body.style.pointerEvents = "none";
|
||||
}
|
||||
context.layersWithOutsidePointerEventsDisabled.add(node);
|
||||
}
|
||||
context.layers.add(node);
|
||||
dispatchUpdate();
|
||||
return () => {
|
||||
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
||||
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
||||
}
|
||||
};
|
||||
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
||||
React.useEffect(() => {
|
||||
return () => {
|
||||
if (!node) return;
|
||||
context.layers.delete(node);
|
||||
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
||||
dispatchUpdate();
|
||||
};
|
||||
}, [node, context]);
|
||||
React.useEffect(() => {
|
||||
const handleUpdate = () => force({});
|
||||
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
||||
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
||||
}, []);
|
||||
return /* @__PURE__ */ jsx(
|
||||
Primitive.div,
|
||||
{
|
||||
...layerProps,
|
||||
ref: composedRefs,
|
||||
style: {
|
||||
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
||||
...props.style
|
||||
},
|
||||
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
||||
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
||||
onPointerDownCapture: composeEventHandlers(
|
||||
props.onPointerDownCapture,
|
||||
pointerDownOutside.onPointerDownCapture
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
||||
var BRANCH_NAME = "DismissableLayerBranch";
|
||||
var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
||||
const context = React.useContext(DismissableLayerContext);
|
||||
const ref = React.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, ref);
|
||||
React.useEffect(() => {
|
||||
const node = ref.current;
|
||||
if (node) {
|
||||
context.branches.add(node);
|
||||
return () => {
|
||||
context.branches.delete(node);
|
||||
};
|
||||
}
|
||||
}, [context.branches]);
|
||||
return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
|
||||
});
|
||||
DismissableLayerBranch.displayName = BRANCH_NAME;
|
||||
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
||||
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
||||
const isPointerInsideReactTreeRef = React.useRef(false);
|
||||
const handleClickRef = React.useRef(() => {
|
||||
});
|
||||
React.useEffect(() => {
|
||||
const handlePointerDown = (event) => {
|
||||
if (event.target && !isPointerInsideReactTreeRef.current) {
|
||||
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
||||
handleAndDispatchCustomEvent(
|
||||
POINTER_DOWN_OUTSIDE,
|
||||
handlePointerDownOutside,
|
||||
eventDetail,
|
||||
{ discrete: true }
|
||||
);
|
||||
};
|
||||
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
||||
const eventDetail = { originalEvent: event };
|
||||
if (event.pointerType === "touch") {
|
||||
ownerDocument.removeEventListener("click", handleClickRef.current);
|
||||
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
||||
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
||||
} else {
|
||||
handleAndDispatchPointerDownOutsideEvent2();
|
||||
}
|
||||
} else {
|
||||
ownerDocument.removeEventListener("click", handleClickRef.current);
|
||||
}
|
||||
isPointerInsideReactTreeRef.current = false;
|
||||
};
|
||||
const timerId = window.setTimeout(() => {
|
||||
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
||||
}, 0);
|
||||
return () => {
|
||||
window.clearTimeout(timerId);
|
||||
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
||||
ownerDocument.removeEventListener("click", handleClickRef.current);
|
||||
};
|
||||
}, [ownerDocument, handlePointerDownOutside]);
|
||||
return {
|
||||
// ensures we check React component tree (not just DOM tree)
|
||||
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
||||
};
|
||||
}
|
||||
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
||||
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
||||
const isFocusInsideReactTreeRef = React.useRef(false);
|
||||
React.useEffect(() => {
|
||||
const handleFocus = (event) => {
|
||||
if (event.target && !isFocusInsideReactTreeRef.current) {
|
||||
const eventDetail = { originalEvent: event };
|
||||
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
||||
discrete: false
|
||||
});
|
||||
}
|
||||
};
|
||||
ownerDocument.addEventListener("focusin", handleFocus);
|
||||
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
||||
}, [ownerDocument, handleFocusOutside]);
|
||||
return {
|
||||
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
||||
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
||||
};
|
||||
}
|
||||
function dispatchUpdate() {
|
||||
const event = new CustomEvent(CONTEXT_UPDATE);
|
||||
document.dispatchEvent(event);
|
||||
}
|
||||
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
||||
const target = detail.originalEvent.target;
|
||||
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
||||
if (handler) target.addEventListener(name, handler, { once: true });
|
||||
if (discrete) {
|
||||
dispatchDiscreteCustomEvent(target, event);
|
||||
} else {
|
||||
target.dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
var Root = DismissableLayer;
|
||||
var Branch = DismissableLayerBranch;
|
||||
export {
|
||||
Branch,
|
||||
DismissableLayer,
|
||||
DismissableLayerBranch,
|
||||
Root
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
7
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map
generated
vendored
Normal file
7
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
68
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/package.json
generated
vendored
Normal file
68
frontend/style/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/package.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"name": "@radix-ui/react-dismissable-layer",
|
||||
"version": "1.1.4",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"source": "./src/index.ts",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"clean": "rm -rf dist",
|
||||
"version": "yarn version"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/primitive": "1.1.1",
|
||||
"@radix-ui/react-compose-refs": "1.1.1",
|
||||
"@radix-ui/react-primitive": "2.0.1",
|
||||
"@radix-ui/react-use-callback-ref": "1.1.0",
|
||||
"@radix-ui/react-use-escape-keydown": "1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@repo/typescript-config": "0.0.0",
|
||||
"@types/react": "^19.0.7",
|
||||
"@types/react-dom": "^19.0.3",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-remove-scroll": "^2.6.2",
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"homepage": "https://radix-ui.com/primitives",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/radix-ui/primitives.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/radix-ui/primitives/issues"
|
||||
}
|
||||
}
|
||||
16
frontend/style/node_modules/@radix-ui/react-dialog/package.json
generated
vendored
16
frontend/style/node_modules/@radix-ui/react-dialog/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@radix-ui/react-dialog",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.5",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -31,7 +31,7 @@
|
||||
"@radix-ui/primitive": "1.1.1",
|
||||
"@radix-ui/react-compose-refs": "1.1.1",
|
||||
"@radix-ui/react-context": "1.1.1",
|
||||
"@radix-ui/react-dismissable-layer": "1.1.3",
|
||||
"@radix-ui/react-dismissable-layer": "1.1.4",
|
||||
"@radix-ui/react-focus-guards": "1.1.1",
|
||||
"@radix-ui/react-focus-scope": "1.1.1",
|
||||
"@radix-ui/react-id": "1.1.0",
|
||||
@@ -40,8 +40,16 @@
|
||||
"@radix-ui/react-primitive": "2.0.1",
|
||||
"@radix-ui/react-slot": "1.1.1",
|
||||
"@radix-ui/react-use-controllable-state": "1.1.0",
|
||||
"aria-hidden": "^1.1.1",
|
||||
"react-remove-scroll": "^2.6.1"
|
||||
"aria-hidden": "^1.2.4",
|
||||
"react-remove-scroll": "^2.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@repo/typescript-config": "0.0.0",
|
||||
"@types/react": "^19.0.7",
|
||||
"@types/react-dom": "^19.0.3",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
|
||||
Reference in New Issue
Block a user