v1.0 with SW PWA enabled
This commit is contained in:
21
frontend/node_modules/@radix-ui/react-alert-dialog/LICENSE
generated
vendored
Normal file
21
frontend/node_modules/@radix-ui/react-alert-dialog/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 WorkOS
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
3
frontend/node_modules/@radix-ui/react-alert-dialog/README.md
generated
vendored
Normal file
3
frontend/node_modules/@radix-ui/react-alert-dialog/README.md
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# `react-alert-dialog`
|
||||
|
||||
View docs [here](https://radix-ui.com/primitives/docs/components/alert-dialog).
|
||||
51
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.d.mts
generated
vendored
Normal file
51
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.d.mts
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
||||
import * as React from 'react';
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
||||
|
||||
declare const createAlertDialogScope: _radix_ui_react_context.CreateScope;
|
||||
type DialogProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
|
||||
interface AlertDialogProps extends Omit<DialogProps, 'modal'> {
|
||||
}
|
||||
declare const AlertDialog: React.FC<AlertDialogProps>;
|
||||
type DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
|
||||
interface AlertDialogTriggerProps extends DialogTriggerProps {
|
||||
}
|
||||
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
type DialogPortalProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;
|
||||
interface AlertDialogPortalProps extends DialogPortalProps {
|
||||
}
|
||||
declare const AlertDialogPortal: React.FC<AlertDialogPortalProps>;
|
||||
type DialogOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
||||
interface AlertDialogOverlayProps extends DialogOverlayProps {
|
||||
}
|
||||
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
|
||||
interface AlertDialogContentProps extends Omit<DialogContentProps, 'onPointerDownOutside' | 'onInteractOutside'> {
|
||||
}
|
||||
declare const AlertDialogContent: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
||||
interface AlertDialogTitleProps extends DialogTitleProps {
|
||||
}
|
||||
declare const AlertDialogTitle: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
||||
type DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
||||
interface AlertDialogDescriptionProps extends DialogDescriptionProps {
|
||||
}
|
||||
declare const AlertDialogDescription: React.ForwardRefExoticComponent<AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
||||
type DialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
|
||||
interface AlertDialogActionProps extends DialogCloseProps {
|
||||
}
|
||||
declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
interface AlertDialogCancelProps extends DialogCloseProps {
|
||||
}
|
||||
declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Root: React.FC<AlertDialogProps>;
|
||||
declare const Trigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Portal: React.FC<AlertDialogPortalProps>;
|
||||
declare const Overlay: React.ForwardRefExoticComponent<AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Content: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Action: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Cancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Title: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
||||
declare const Description: React.ForwardRefExoticComponent<AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
||||
|
||||
export { Action, AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, type AlertDialogPortalProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps, Cancel, Content, Description, Overlay, Portal, Root, Title, Trigger, createAlertDialogScope };
|
||||
51
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.d.ts
generated
vendored
Normal file
51
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
||||
import * as React from 'react';
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
||||
|
||||
declare const createAlertDialogScope: _radix_ui_react_context.CreateScope;
|
||||
type DialogProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
|
||||
interface AlertDialogProps extends Omit<DialogProps, 'modal'> {
|
||||
}
|
||||
declare const AlertDialog: React.FC<AlertDialogProps>;
|
||||
type DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
|
||||
interface AlertDialogTriggerProps extends DialogTriggerProps {
|
||||
}
|
||||
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
type DialogPortalProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;
|
||||
interface AlertDialogPortalProps extends DialogPortalProps {
|
||||
}
|
||||
declare const AlertDialogPortal: React.FC<AlertDialogPortalProps>;
|
||||
type DialogOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
||||
interface AlertDialogOverlayProps extends DialogOverlayProps {
|
||||
}
|
||||
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
|
||||
interface AlertDialogContentProps extends Omit<DialogContentProps, 'onPointerDownOutside' | 'onInteractOutside'> {
|
||||
}
|
||||
declare const AlertDialogContent: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
||||
interface AlertDialogTitleProps extends DialogTitleProps {
|
||||
}
|
||||
declare const AlertDialogTitle: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
||||
type DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
||||
interface AlertDialogDescriptionProps extends DialogDescriptionProps {
|
||||
}
|
||||
declare const AlertDialogDescription: React.ForwardRefExoticComponent<AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
||||
type DialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
|
||||
interface AlertDialogActionProps extends DialogCloseProps {
|
||||
}
|
||||
declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
interface AlertDialogCancelProps extends DialogCloseProps {
|
||||
}
|
||||
declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Root: React.FC<AlertDialogProps>;
|
||||
declare const Trigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Portal: React.FC<AlertDialogPortalProps>;
|
||||
declare const Overlay: React.ForwardRefExoticComponent<AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Content: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Action: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Cancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Title: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
||||
declare const Description: React.ForwardRefExoticComponent<AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
||||
|
||||
export { Action, AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, type AlertDialogPortalProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps, Cancel, Content, Description, Overlay, Portal, Root, Title, Trigger, createAlertDialogScope };
|
||||
202
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.js
generated
vendored
Normal file
202
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.js
generated
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
"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);
|
||||
|
||||
// src/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
Action: () => Action,
|
||||
AlertDialog: () => AlertDialog,
|
||||
AlertDialogAction: () => AlertDialogAction,
|
||||
AlertDialogCancel: () => AlertDialogCancel,
|
||||
AlertDialogContent: () => AlertDialogContent,
|
||||
AlertDialogDescription: () => AlertDialogDescription,
|
||||
AlertDialogOverlay: () => AlertDialogOverlay,
|
||||
AlertDialogPortal: () => AlertDialogPortal,
|
||||
AlertDialogTitle: () => AlertDialogTitle,
|
||||
AlertDialogTrigger: () => AlertDialogTrigger,
|
||||
Cancel: () => Cancel,
|
||||
Content: () => Content2,
|
||||
Description: () => Description2,
|
||||
Overlay: () => Overlay2,
|
||||
Portal: () => Portal2,
|
||||
Root: () => Root2,
|
||||
Title: () => Title2,
|
||||
Trigger: () => Trigger2,
|
||||
createAlertDialogScope: () => createAlertDialogScope
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/alert-dialog.tsx
|
||||
var React = __toESM(require("react"));
|
||||
var import_react_context = require("@radix-ui/react-context");
|
||||
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
||||
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
||||
var import_react_dialog = require("@radix-ui/react-dialog");
|
||||
var import_primitive = require("@radix-ui/primitive");
|
||||
var import_react_slot = require("@radix-ui/react-slot");
|
||||
var import_jsx_runtime = require("react/jsx-runtime");
|
||||
var ROOT_NAME = "AlertDialog";
|
||||
var [createAlertDialogContext, createAlertDialogScope] = (0, import_react_context.createContextScope)(ROOT_NAME, [
|
||||
import_react_dialog.createDialogScope
|
||||
]);
|
||||
var useDialogScope = (0, import_react_dialog.createDialogScope)();
|
||||
var AlertDialog = (props) => {
|
||||
const { __scopeAlertDialog, ...alertDialogProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true });
|
||||
};
|
||||
AlertDialog.displayName = ROOT_NAME;
|
||||
var TRIGGER_NAME = "AlertDialogTrigger";
|
||||
var AlertDialogTrigger = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...triggerProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
AlertDialogTrigger.displayName = TRIGGER_NAME;
|
||||
var PORTAL_NAME = "AlertDialogPortal";
|
||||
var AlertDialogPortal = (props) => {
|
||||
const { __scopeAlertDialog, ...portalProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Portal, { ...dialogScope, ...portalProps });
|
||||
};
|
||||
AlertDialogPortal.displayName = PORTAL_NAME;
|
||||
var OVERLAY_NAME = "AlertDialogOverlay";
|
||||
var AlertDialogOverlay = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...overlayProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
AlertDialogOverlay.displayName = OVERLAY_NAME;
|
||||
var CONTENT_NAME = "AlertDialogContent";
|
||||
var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);
|
||||
var Slottable = (0, import_react_slot.createSlottable)("AlertDialogContent");
|
||||
var AlertDialogContent = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, children, ...contentProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
const contentRef = React.useRef(null);
|
||||
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef);
|
||||
const cancelRef = React.useRef(null);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
DialogPrimitive.WarningProvider,
|
||||
{
|
||||
contentName: CONTENT_NAME,
|
||||
titleName: TITLE_NAME,
|
||||
docsSlug: "alert-dialog",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
||||
DialogPrimitive.Content,
|
||||
{
|
||||
role: "alertdialog",
|
||||
...dialogScope,
|
||||
...contentProps,
|
||||
ref: composedRefs,
|
||||
onOpenAutoFocus: (0, import_primitive.composeEventHandlers)(contentProps.onOpenAutoFocus, (event) => {
|
||||
event.preventDefault();
|
||||
cancelRef.current?.focus({ preventScroll: true });
|
||||
}),
|
||||
onPointerDownOutside: (event) => event.preventDefault(),
|
||||
onInteractOutside: (event) => event.preventDefault(),
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slottable, { children }),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef })
|
||||
]
|
||||
}
|
||||
) })
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
AlertDialogContent.displayName = CONTENT_NAME;
|
||||
var TITLE_NAME = "AlertDialogTitle";
|
||||
var AlertDialogTitle = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...titleProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
AlertDialogTitle.displayName = TITLE_NAME;
|
||||
var DESCRIPTION_NAME = "AlertDialogDescription";
|
||||
var AlertDialogDescription = React.forwardRef((props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...descriptionProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });
|
||||
});
|
||||
AlertDialogDescription.displayName = DESCRIPTION_NAME;
|
||||
var ACTION_NAME = "AlertDialogAction";
|
||||
var AlertDialogAction = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...actionProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
AlertDialogAction.displayName = ACTION_NAME;
|
||||
var CANCEL_NAME = "AlertDialogCancel";
|
||||
var AlertDialogCancel = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...cancelProps } = props;
|
||||
const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
const ref = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, cancelRef);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });
|
||||
}
|
||||
);
|
||||
AlertDialogCancel.displayName = CANCEL_NAME;
|
||||
var DescriptionWarning = ({ contentRef }) => {
|
||||
const MESSAGE = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
||||
|
||||
You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
||||
|
||||
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
|
||||
React.useEffect(() => {
|
||||
const hasDescription = document.getElementById(
|
||||
contentRef.current?.getAttribute("aria-describedby")
|
||||
);
|
||||
if (!hasDescription) console.warn(MESSAGE);
|
||||
}, [MESSAGE, contentRef]);
|
||||
return null;
|
||||
};
|
||||
var Root2 = AlertDialog;
|
||||
var Trigger2 = AlertDialogTrigger;
|
||||
var Portal2 = AlertDialogPortal;
|
||||
var Overlay2 = AlertDialogOverlay;
|
||||
var Content2 = AlertDialogContent;
|
||||
var Action = AlertDialogAction;
|
||||
var Cancel = AlertDialogCancel;
|
||||
var Title2 = AlertDialogTitle;
|
||||
var Description2 = AlertDialogDescription;
|
||||
//# sourceMappingURL=index.js.map
|
||||
7
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.js.map
generated
vendored
Normal file
7
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
170
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
generated
vendored
Normal file
170
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
"use client";
|
||||
|
||||
// src/alert-dialog.tsx
|
||||
import * as React from "react";
|
||||
import { createContextScope } from "@radix-ui/react-context";
|
||||
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import { createDialogScope } from "@radix-ui/react-dialog";
|
||||
import { composeEventHandlers } from "@radix-ui/primitive";
|
||||
import { createSlottable } from "@radix-ui/react-slot";
|
||||
import { jsx, jsxs } from "react/jsx-runtime";
|
||||
var ROOT_NAME = "AlertDialog";
|
||||
var [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
|
||||
createDialogScope
|
||||
]);
|
||||
var useDialogScope = createDialogScope();
|
||||
var AlertDialog = (props) => {
|
||||
const { __scopeAlertDialog, ...alertDialogProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true });
|
||||
};
|
||||
AlertDialog.displayName = ROOT_NAME;
|
||||
var TRIGGER_NAME = "AlertDialogTrigger";
|
||||
var AlertDialogTrigger = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...triggerProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
AlertDialogTrigger.displayName = TRIGGER_NAME;
|
||||
var PORTAL_NAME = "AlertDialogPortal";
|
||||
var AlertDialogPortal = (props) => {
|
||||
const { __scopeAlertDialog, ...portalProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...dialogScope, ...portalProps });
|
||||
};
|
||||
AlertDialogPortal.displayName = PORTAL_NAME;
|
||||
var OVERLAY_NAME = "AlertDialogOverlay";
|
||||
var AlertDialogOverlay = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...overlayProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
AlertDialogOverlay.displayName = OVERLAY_NAME;
|
||||
var CONTENT_NAME = "AlertDialogContent";
|
||||
var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);
|
||||
var Slottable = createSlottable("AlertDialogContent");
|
||||
var AlertDialogContent = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, children, ...contentProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
const contentRef = React.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
||||
const cancelRef = React.useRef(null);
|
||||
return /* @__PURE__ */ jsx(
|
||||
DialogPrimitive.WarningProvider,
|
||||
{
|
||||
contentName: CONTENT_NAME,
|
||||
titleName: TITLE_NAME,
|
||||
docsSlug: "alert-dialog",
|
||||
children: /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs(
|
||||
DialogPrimitive.Content,
|
||||
{
|
||||
role: "alertdialog",
|
||||
...dialogScope,
|
||||
...contentProps,
|
||||
ref: composedRefs,
|
||||
onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
|
||||
event.preventDefault();
|
||||
cancelRef.current?.focus({ preventScroll: true });
|
||||
}),
|
||||
onPointerDownOutside: (event) => event.preventDefault(),
|
||||
onInteractOutside: (event) => event.preventDefault(),
|
||||
children: [
|
||||
/* @__PURE__ */ jsx(Slottable, { children }),
|
||||
/* @__PURE__ */ jsx(DescriptionWarning, { contentRef })
|
||||
]
|
||||
}
|
||||
) })
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
AlertDialogContent.displayName = CONTENT_NAME;
|
||||
var TITLE_NAME = "AlertDialogTitle";
|
||||
var AlertDialogTitle = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...titleProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
AlertDialogTitle.displayName = TITLE_NAME;
|
||||
var DESCRIPTION_NAME = "AlertDialogDescription";
|
||||
var AlertDialogDescription = React.forwardRef((props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...descriptionProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });
|
||||
});
|
||||
AlertDialogDescription.displayName = DESCRIPTION_NAME;
|
||||
var ACTION_NAME = "AlertDialogAction";
|
||||
var AlertDialogAction = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...actionProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef });
|
||||
}
|
||||
);
|
||||
AlertDialogAction.displayName = ACTION_NAME;
|
||||
var CANCEL_NAME = "AlertDialogCancel";
|
||||
var AlertDialogCancel = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...cancelProps } = props;
|
||||
const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
const ref = useComposedRefs(forwardedRef, cancelRef);
|
||||
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });
|
||||
}
|
||||
);
|
||||
AlertDialogCancel.displayName = CANCEL_NAME;
|
||||
var DescriptionWarning = ({ contentRef }) => {
|
||||
const MESSAGE = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
||||
|
||||
You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
||||
|
||||
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
|
||||
React.useEffect(() => {
|
||||
const hasDescription = document.getElementById(
|
||||
contentRef.current?.getAttribute("aria-describedby")
|
||||
);
|
||||
if (!hasDescription) console.warn(MESSAGE);
|
||||
}, [MESSAGE, contentRef]);
|
||||
return null;
|
||||
};
|
||||
var Root2 = AlertDialog;
|
||||
var Trigger2 = AlertDialogTrigger;
|
||||
var Portal2 = AlertDialogPortal;
|
||||
var Overlay2 = AlertDialogOverlay;
|
||||
var Content2 = AlertDialogContent;
|
||||
var Action = AlertDialogAction;
|
||||
var Cancel = AlertDialogCancel;
|
||||
var Title2 = AlertDialogTitle;
|
||||
var Description2 = AlertDialogDescription;
|
||||
export {
|
||||
Action,
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogOverlay,
|
||||
AlertDialogPortal,
|
||||
AlertDialogTitle,
|
||||
AlertDialogTrigger,
|
||||
Cancel,
|
||||
Content2 as Content,
|
||||
Description2 as Description,
|
||||
Overlay2 as Overlay,
|
||||
Portal2 as Portal,
|
||||
Root2 as Root,
|
||||
Title2 as Title,
|
||||
Trigger2 as Trigger,
|
||||
createAlertDialogScope
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
7
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs.map
generated
vendored
Normal file
7
frontend/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
21
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/LICENSE
generated
vendored
Normal file
21
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 WorkOS
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
3
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/README.md
generated
vendored
Normal file
3
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/README.md
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# `react-slot`
|
||||
|
||||
View docs [here](https://radix-ui.com/primitives/docs/utilities/slot).
|
||||
17
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.d.mts
generated
vendored
Normal file
17
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.d.mts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import * as React from 'react';
|
||||
|
||||
interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
declare function createSlot(ownerName: string): React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
||||
declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
||||
interface SlottableProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
interface SlottableComponent extends React.FC<SlottableProps> {
|
||||
__radixId: symbol;
|
||||
}
|
||||
declare function createSlottable(ownerName: string): SlottableComponent;
|
||||
declare const Slottable: SlottableComponent;
|
||||
|
||||
export { Slot as Root, Slot, type SlotProps, Slottable, createSlot, createSlottable };
|
||||
17
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.d.ts
generated
vendored
Normal file
17
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import * as React from 'react';
|
||||
|
||||
interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
declare function createSlot(ownerName: string): React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
||||
declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
||||
interface SlottableProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
interface SlottableComponent extends React.FC<SlottableProps> {
|
||||
__radixId: symbol;
|
||||
}
|
||||
declare function createSlottable(ownerName: string): SlottableComponent;
|
||||
declare const Slottable: SlottableComponent;
|
||||
|
||||
export { Slot as Root, Slot, type SlotProps, Slottable, createSlot, createSlottable };
|
||||
138
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.js
generated
vendored
Normal file
138
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.js
generated
vendored
Normal file
@ -0,0 +1,138 @@
|
||||
"use strict";
|
||||
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);
|
||||
|
||||
// src/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
Root: () => Slot,
|
||||
Slot: () => Slot,
|
||||
Slottable: () => Slottable,
|
||||
createSlot: () => createSlot,
|
||||
createSlottable: () => createSlottable
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/slot.tsx
|
||||
var React = __toESM(require("react"));
|
||||
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
||||
var import_jsx_runtime = require("react/jsx-runtime");
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createSlot(ownerName) {
|
||||
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
||||
const Slot2 = 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 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
||||
}
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
||||
});
|
||||
Slot2.displayName = `${ownerName}.Slot`;
|
||||
return Slot2;
|
||||
}
|
||||
var Slot = /* @__PURE__ */ createSlot("Slot");
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
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 ? (0, import_react_compose_refs.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 = Symbol("radix.slottable");
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createSlottable(ownerName) {
|
||||
const Slottable2 = ({ children }) => {
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
||||
};
|
||||
Slottable2.displayName = `${ownerName}.Slottable`;
|
||||
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
||||
return Slottable2;
|
||||
}
|
||||
var Slottable = /* @__PURE__ */ 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;
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
7
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.js.map
generated
vendored
Normal file
7
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
105
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs
generated
vendored
Normal file
105
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs
generated
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
// src/slot.tsx
|
||||
import * as React from "react";
|
||||
import { composeRefs } from "@radix-ui/react-compose-refs";
|
||||
import { Fragment as Fragment2, jsx } from "react/jsx-runtime";
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createSlot(ownerName) {
|
||||
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
||||
const Slot2 = 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 /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
||||
}
|
||||
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
||||
});
|
||||
Slot2.displayName = `${ownerName}.Slot`;
|
||||
return Slot2;
|
||||
}
|
||||
var Slot = /* @__PURE__ */ createSlot("Slot");
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
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 = Symbol("radix.slottable");
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createSlottable(ownerName) {
|
||||
const Slottable2 = ({ children }) => {
|
||||
return /* @__PURE__ */ jsx(Fragment2, { children });
|
||||
};
|
||||
Slottable2.displayName = `${ownerName}.Slottable`;
|
||||
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
||||
return Slottable2;
|
||||
}
|
||||
var Slottable = /* @__PURE__ */ 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;
|
||||
}
|
||||
export {
|
||||
Slot as Root,
|
||||
Slot,
|
||||
Slottable,
|
||||
createSlot,
|
||||
createSlottable
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
7
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs.map
generated
vendored
Normal file
7
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
63
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/package.json
generated
vendored
Normal file
63
frontend/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/package.json
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
"name": "@radix-ui/react-slot",
|
||||
"version": "1.2.3",
|
||||
"license": "MIT",
|
||||
"source": "./src/index.ts",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"dependencies": {
|
||||
"@radix-ui/react-compose-refs": "1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.0.7",
|
||||
"@types/react-dom": "^19.0.3",
|
||||
"eslint": "^9.18.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"typescript": "^5.7.3",
|
||||
"@repo/eslint-config": "0.0.0",
|
||||
"@repo/typescript-config": "0.0.0",
|
||||
"@repo/builder": "0.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"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"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --max-warnings 0 src",
|
||||
"clean": "rm -rf dist",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "radix-build"
|
||||
},
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
73
frontend/node_modules/@radix-ui/react-alert-dialog/package.json
generated
vendored
Normal file
73
frontend/node_modules/@radix-ui/react-alert-dialog/package.json
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "@radix-ui/react-alert-dialog",
|
||||
"version": "1.1.15",
|
||||
"license": "MIT",
|
||||
"source": "./src/index.ts",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"files": [
|
||||
"src",
|
||||
"dist"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"dependencies": {
|
||||
"@radix-ui/primitive": "1.1.3",
|
||||
"@radix-ui/react-context": "1.1.2",
|
||||
"@radix-ui/react-dialog": "1.1.15",
|
||||
"@radix-ui/react-primitive": "2.1.3",
|
||||
"@radix-ui/react-slot": "1.2.3",
|
||||
"@radix-ui/react-compose-refs": "1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.0.7",
|
||||
"@types/react-dom": "^19.0.3",
|
||||
"eslint": "^9.18.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"typescript": "^5.7.3",
|
||||
"@repo/builder": "0.0.0",
|
||||
"@repo/eslint-config": "0.0.0",
|
||||
"@repo/typescript-config": "0.0.0"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --max-warnings 0 src",
|
||||
"clean": "rm -rf dist",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "radix-build"
|
||||
},
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
64
frontend/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.test.tsx
generated
vendored
Normal file
64
frontend/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.test.tsx
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
import React from 'react';
|
||||
import { axe } from 'vitest-axe';
|
||||
import type { RenderResult } from '@testing-library/react';
|
||||
import { cleanup, render, fireEvent } from '@testing-library/react';
|
||||
import * as AlertDialog from './alert-dialog';
|
||||
import { afterEach, describe, it, beforeEach, expect } from 'vitest';
|
||||
|
||||
const OPEN_TEXT = 'Open';
|
||||
const CANCEL_TEXT = 'Cancel';
|
||||
const ACTION_TEXT = 'Do it';
|
||||
const TITLE_TEXT = 'Warning';
|
||||
const DESC_TEXT = 'This is a warning';
|
||||
const OVERLAY_TEST_ID = 'test-overlay';
|
||||
|
||||
const DialogTest = (props: React.ComponentProps<typeof AlertDialog.Root>) => (
|
||||
<AlertDialog.Root {...props}>
|
||||
<AlertDialog.Trigger>{OPEN_TEXT}</AlertDialog.Trigger>
|
||||
<AlertDialog.Overlay data-testid={OVERLAY_TEST_ID} />
|
||||
<AlertDialog.Content>
|
||||
<AlertDialog.Title>{TITLE_TEXT}</AlertDialog.Title>
|
||||
<AlertDialog.Description>{DESC_TEXT}</AlertDialog.Description>
|
||||
<AlertDialog.Cancel>{CANCEL_TEXT}</AlertDialog.Cancel>
|
||||
<AlertDialog.Action>{ACTION_TEXT}</AlertDialog.Action>
|
||||
</AlertDialog.Content>
|
||||
</AlertDialog.Root>
|
||||
);
|
||||
|
||||
describe('given a default Dialog', () => {
|
||||
let rendered: RenderResult;
|
||||
let title: HTMLElement;
|
||||
let trigger: HTMLElement;
|
||||
let cancelButton: HTMLElement;
|
||||
|
||||
afterEach(cleanup);
|
||||
|
||||
beforeEach(() => {
|
||||
rendered = render(<DialogTest />);
|
||||
trigger = rendered.getByText(OPEN_TEXT);
|
||||
});
|
||||
|
||||
it('should have no accessibility violations in default state', async () => {
|
||||
expect(await axe(rendered.container)).toHaveNoViolations();
|
||||
});
|
||||
|
||||
describe('after clicking the trigger', () => {
|
||||
beforeEach(() => {
|
||||
fireEvent.click(trigger);
|
||||
title = rendered.getByText(TITLE_TEXT);
|
||||
cancelButton = rendered.getByText(CANCEL_TEXT);
|
||||
});
|
||||
|
||||
it('should open the content', () => {
|
||||
expect(title).toBeVisible();
|
||||
});
|
||||
|
||||
it('should have no accessibility violations when open', async () => {
|
||||
expect(await axe(rendered.container)).toHaveNoViolations();
|
||||
});
|
||||
|
||||
it('should focus the cancel button', () => {
|
||||
expect(cancelButton).toHaveFocus();
|
||||
});
|
||||
});
|
||||
});
|
||||
308
frontend/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.tsx
generated
vendored
Normal file
308
frontend/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.tsx
generated
vendored
Normal file
@ -0,0 +1,308 @@
|
||||
import * as React from 'react';
|
||||
import { createContextScope } from '@radix-ui/react-context';
|
||||
import { useComposedRefs } from '@radix-ui/react-compose-refs';
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
||||
import { createDialogScope } from '@radix-ui/react-dialog';
|
||||
import { composeEventHandlers } from '@radix-ui/primitive';
|
||||
import { createSlottable } from '@radix-ui/react-slot';
|
||||
|
||||
import type { Scope } from '@radix-ui/react-context';
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialog
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const ROOT_NAME = 'AlertDialog';
|
||||
|
||||
type ScopedProps<P> = P & { __scopeAlertDialog?: Scope };
|
||||
const [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
|
||||
createDialogScope,
|
||||
]);
|
||||
const useDialogScope = createDialogScope();
|
||||
|
||||
type DialogProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
|
||||
interface AlertDialogProps extends Omit<DialogProps, 'modal'> {}
|
||||
|
||||
const AlertDialog: React.FC<AlertDialogProps> = (props: ScopedProps<AlertDialogProps>) => {
|
||||
const { __scopeAlertDialog, ...alertDialogProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return <DialogPrimitive.Root {...dialogScope} {...alertDialogProps} modal={true} />;
|
||||
};
|
||||
|
||||
AlertDialog.displayName = ROOT_NAME;
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialogTrigger
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
const TRIGGER_NAME = 'AlertDialogTrigger';
|
||||
|
||||
type AlertDialogTriggerElement = React.ComponentRef<typeof DialogPrimitive.Trigger>;
|
||||
type DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
|
||||
interface AlertDialogTriggerProps extends DialogTriggerProps {}
|
||||
|
||||
const AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(
|
||||
(props: ScopedProps<AlertDialogTriggerProps>, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...triggerProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return <DialogPrimitive.Trigger {...dialogScope} {...triggerProps} ref={forwardedRef} />;
|
||||
}
|
||||
);
|
||||
|
||||
AlertDialogTrigger.displayName = TRIGGER_NAME;
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialogPortal
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const PORTAL_NAME = 'AlertDialogPortal';
|
||||
|
||||
type DialogPortalProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;
|
||||
interface AlertDialogPortalProps extends DialogPortalProps {}
|
||||
|
||||
const AlertDialogPortal: React.FC<AlertDialogPortalProps> = (
|
||||
props: ScopedProps<AlertDialogPortalProps>
|
||||
) => {
|
||||
const { __scopeAlertDialog, ...portalProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return <DialogPrimitive.Portal {...dialogScope} {...portalProps} />;
|
||||
};
|
||||
|
||||
AlertDialogPortal.displayName = PORTAL_NAME;
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialogOverlay
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const OVERLAY_NAME = 'AlertDialogOverlay';
|
||||
|
||||
type AlertDialogOverlayElement = React.ComponentRef<typeof DialogPrimitive.Overlay>;
|
||||
type DialogOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
||||
interface AlertDialogOverlayProps extends DialogOverlayProps {}
|
||||
|
||||
const AlertDialogOverlay = React.forwardRef<AlertDialogOverlayElement, AlertDialogOverlayProps>(
|
||||
(props: ScopedProps<AlertDialogOverlayProps>, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...overlayProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return <DialogPrimitive.Overlay {...dialogScope} {...overlayProps} ref={forwardedRef} />;
|
||||
}
|
||||
);
|
||||
|
||||
AlertDialogOverlay.displayName = OVERLAY_NAME;
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialogContent
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const CONTENT_NAME = 'AlertDialogContent';
|
||||
|
||||
type AlertDialogContentContextValue = {
|
||||
cancelRef: React.MutableRefObject<AlertDialogCancelElement | null>;
|
||||
};
|
||||
|
||||
const [AlertDialogContentProvider, useAlertDialogContentContext] =
|
||||
createAlertDialogContext<AlertDialogContentContextValue>(CONTENT_NAME);
|
||||
|
||||
type AlertDialogContentElement = React.ComponentRef<typeof DialogPrimitive.Content>;
|
||||
type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
|
||||
interface AlertDialogContentProps
|
||||
extends Omit<DialogContentProps, 'onPointerDownOutside' | 'onInteractOutside'> {}
|
||||
|
||||
const Slottable = createSlottable('AlertDialogContent');
|
||||
|
||||
const AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(
|
||||
(props: ScopedProps<AlertDialogContentProps>, forwardedRef) => {
|
||||
const { __scopeAlertDialog, children, ...contentProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
const contentRef = React.useRef<AlertDialogContentElement>(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
||||
const cancelRef = React.useRef<AlertDialogCancelElement | null>(null);
|
||||
|
||||
return (
|
||||
<DialogPrimitive.WarningProvider
|
||||
contentName={CONTENT_NAME}
|
||||
titleName={TITLE_NAME}
|
||||
docsSlug="alert-dialog"
|
||||
>
|
||||
<AlertDialogContentProvider scope={__scopeAlertDialog} cancelRef={cancelRef}>
|
||||
<DialogPrimitive.Content
|
||||
role="alertdialog"
|
||||
{...dialogScope}
|
||||
{...contentProps}
|
||||
ref={composedRefs}
|
||||
onOpenAutoFocus={composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
|
||||
event.preventDefault();
|
||||
cancelRef.current?.focus({ preventScroll: true });
|
||||
})}
|
||||
onPointerDownOutside={(event) => event.preventDefault()}
|
||||
onInteractOutside={(event) => event.preventDefault()}
|
||||
>
|
||||
{/**
|
||||
* We have to use `Slottable` here as we cannot wrap the `AlertDialogContentProvider`
|
||||
* around everything, otherwise the `DescriptionWarning` would be rendered straight away.
|
||||
* This is because we want the accessibility checks to run only once the content is actually
|
||||
* open and that behaviour is already encapsulated in `DialogContent`.
|
||||
*/}
|
||||
<Slottable>{children}</Slottable>
|
||||
{process.env.NODE_ENV === 'development' && (
|
||||
<DescriptionWarning contentRef={contentRef} />
|
||||
)}
|
||||
</DialogPrimitive.Content>
|
||||
</AlertDialogContentProvider>
|
||||
</DialogPrimitive.WarningProvider>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
AlertDialogContent.displayName = CONTENT_NAME;
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialogTitle
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const TITLE_NAME = 'AlertDialogTitle';
|
||||
|
||||
type AlertDialogTitleElement = React.ComponentRef<typeof DialogPrimitive.Title>;
|
||||
type DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
||||
interface AlertDialogTitleProps extends DialogTitleProps {}
|
||||
|
||||
const AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(
|
||||
(props: ScopedProps<AlertDialogTitleProps>, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...titleProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return <DialogPrimitive.Title {...dialogScope} {...titleProps} ref={forwardedRef} />;
|
||||
}
|
||||
);
|
||||
|
||||
AlertDialogTitle.displayName = TITLE_NAME;
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialogDescription
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const DESCRIPTION_NAME = 'AlertDialogDescription';
|
||||
|
||||
type AlertDialogDescriptionElement = React.ComponentRef<typeof DialogPrimitive.Description>;
|
||||
type DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
||||
interface AlertDialogDescriptionProps extends DialogDescriptionProps {}
|
||||
|
||||
const AlertDialogDescription = React.forwardRef<
|
||||
AlertDialogDescriptionElement,
|
||||
AlertDialogDescriptionProps
|
||||
>((props: ScopedProps<AlertDialogDescriptionProps>, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...descriptionProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return <DialogPrimitive.Description {...dialogScope} {...descriptionProps} ref={forwardedRef} />;
|
||||
});
|
||||
|
||||
AlertDialogDescription.displayName = DESCRIPTION_NAME;
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialogAction
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const ACTION_NAME = 'AlertDialogAction';
|
||||
|
||||
type AlertDialogActionElement = React.ComponentRef<typeof DialogPrimitive.Close>;
|
||||
type DialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
|
||||
interface AlertDialogActionProps extends DialogCloseProps {}
|
||||
|
||||
const AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(
|
||||
(props: ScopedProps<AlertDialogActionProps>, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...actionProps } = props;
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
return <DialogPrimitive.Close {...dialogScope} {...actionProps} ref={forwardedRef} />;
|
||||
}
|
||||
);
|
||||
|
||||
AlertDialogAction.displayName = ACTION_NAME;
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------
|
||||
* AlertDialogCancel
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const CANCEL_NAME = 'AlertDialogCancel';
|
||||
|
||||
type AlertDialogCancelElement = React.ComponentRef<typeof DialogPrimitive.Close>;
|
||||
interface AlertDialogCancelProps extends DialogCloseProps {}
|
||||
|
||||
const AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(
|
||||
(props: ScopedProps<AlertDialogCancelProps>, forwardedRef) => {
|
||||
const { __scopeAlertDialog, ...cancelProps } = props;
|
||||
const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
|
||||
const dialogScope = useDialogScope(__scopeAlertDialog);
|
||||
const ref = useComposedRefs(forwardedRef, cancelRef);
|
||||
return <DialogPrimitive.Close {...dialogScope} {...cancelProps} ref={ref} />;
|
||||
}
|
||||
);
|
||||
|
||||
AlertDialogCancel.displayName = CANCEL_NAME;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
type DescriptionWarningProps = {
|
||||
contentRef: React.RefObject<AlertDialogContentElement | null>;
|
||||
};
|
||||
|
||||
const DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef }) => {
|
||||
const MESSAGE = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
||||
|
||||
You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
||||
|
||||
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
|
||||
|
||||
React.useEffect(() => {
|
||||
const hasDescription = document.getElementById(
|
||||
contentRef.current?.getAttribute('aria-describedby')!
|
||||
);
|
||||
if (!hasDescription) console.warn(MESSAGE);
|
||||
}, [MESSAGE, contentRef]);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const Root = AlertDialog;
|
||||
const Trigger = AlertDialogTrigger;
|
||||
const Portal = AlertDialogPortal;
|
||||
const Overlay = AlertDialogOverlay;
|
||||
const Content = AlertDialogContent;
|
||||
const Action = AlertDialogAction;
|
||||
const Cancel = AlertDialogCancel;
|
||||
const Title = AlertDialogTitle;
|
||||
const Description = AlertDialogDescription;
|
||||
|
||||
export {
|
||||
createAlertDialogScope,
|
||||
//
|
||||
AlertDialog,
|
||||
AlertDialogTrigger,
|
||||
AlertDialogPortal,
|
||||
AlertDialogOverlay,
|
||||
AlertDialogContent,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogTitle,
|
||||
AlertDialogDescription,
|
||||
//
|
||||
Root,
|
||||
Trigger,
|
||||
Portal,
|
||||
Overlay,
|
||||
Content,
|
||||
Action,
|
||||
Cancel,
|
||||
Title,
|
||||
Description,
|
||||
};
|
||||
export type {
|
||||
AlertDialogProps,
|
||||
AlertDialogTriggerProps,
|
||||
AlertDialogPortalProps,
|
||||
AlertDialogOverlayProps,
|
||||
AlertDialogContentProps,
|
||||
AlertDialogActionProps,
|
||||
AlertDialogCancelProps,
|
||||
AlertDialogTitleProps,
|
||||
AlertDialogDescriptionProps,
|
||||
};
|
||||
35
frontend/node_modules/@radix-ui/react-alert-dialog/src/index.ts
generated
vendored
Normal file
35
frontend/node_modules/@radix-ui/react-alert-dialog/src/index.ts
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
'use client';
|
||||
export {
|
||||
createAlertDialogScope,
|
||||
//
|
||||
AlertDialog,
|
||||
AlertDialogTrigger,
|
||||
AlertDialogPortal,
|
||||
AlertDialogOverlay,
|
||||
AlertDialogContent,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogTitle,
|
||||
AlertDialogDescription,
|
||||
//
|
||||
Root,
|
||||
Trigger,
|
||||
Portal,
|
||||
Overlay,
|
||||
Content,
|
||||
Action,
|
||||
Cancel,
|
||||
Title,
|
||||
Description,
|
||||
} from './alert-dialog';
|
||||
export type {
|
||||
AlertDialogProps,
|
||||
AlertDialogTriggerProps,
|
||||
AlertDialogPortalProps,
|
||||
AlertDialogOverlayProps,
|
||||
AlertDialogContentProps,
|
||||
AlertDialogActionProps,
|
||||
AlertDialogCancelProps,
|
||||
AlertDialogTitleProps,
|
||||
AlertDialogDescriptionProps,
|
||||
} from './alert-dialog';
|
||||
Reference in New Issue
Block a user