New source found from dndbeyond.com
This commit is contained in:
+4
-4
@@ -5,22 +5,22 @@ import type {
|
||||
AllHTMLAttributes,
|
||||
ButtonHTMLAttributes,
|
||||
FC,
|
||||
PropsWithChildren,
|
||||
ReactNode,
|
||||
} from "react";
|
||||
import styles from "./styles/Button.module.css";
|
||||
import sizeStyles from "./styles/ButtonSizes.module.css";
|
||||
import variantStyles from "./styles/ButtonVariants.module.css";
|
||||
|
||||
export interface ButtonProps
|
||||
extends PropsWithChildren,
|
||||
Omit<
|
||||
extends Omit<
|
||||
AllHTMLAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>,
|
||||
"size" | "type"
|
||||
>,
|
||||
Pick<ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
color?: "primary" | "secondary" | "success" | "info" | "warning" | "error";
|
||||
variant?: "solid" | "outline" | "text";
|
||||
variant?: "solid" | "outline" | "text" | "tool";
|
||||
size?: "x-small" | "small" | "medium" | "large" | "x-large";
|
||||
isDiv?: boolean;
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import type { ChangeEvent, FC, ReactNode } from "react";
|
||||
import styles from "./Checkbox.module.css";
|
||||
|
||||
export interface CheckboxProps {
|
||||
id?: string;
|
||||
id: string;
|
||||
label?: ReactNode;
|
||||
defaultChecked?: boolean;
|
||||
checked?: boolean;
|
||||
|
||||
+6
-1
@@ -15,6 +15,7 @@ export interface DialogProps extends HTMLAttributes<HTMLDialogElement> {
|
||||
open: boolean;
|
||||
onClose: (e?: MouseEvent) => void;
|
||||
modal?: boolean;
|
||||
onBackdropClick?: () => void;
|
||||
}
|
||||
|
||||
export const Dialog: React.FC<DialogProps> = ({
|
||||
@@ -23,6 +24,7 @@ export const Dialog: React.FC<DialogProps> = ({
|
||||
modal,
|
||||
children,
|
||||
className,
|
||||
onBackdropClick,
|
||||
...props
|
||||
}) => {
|
||||
const dialogRef = useRef<HTMLDialogElement>(null);
|
||||
@@ -46,7 +48,10 @@ export const Dialog: React.FC<DialogProps> = ({
|
||||
rect.left <= e.clientX &&
|
||||
e.clientX <= rect.left + rect.width;
|
||||
|
||||
if (!isClickInDialog) handleClose();
|
||||
if (!isClickInDialog) {
|
||||
onBackdropClick?.();
|
||||
handleClose();
|
||||
}
|
||||
};
|
||||
|
||||
const handleEsc = (e: KeyboardEvent) => {
|
||||
|
||||
Generated
Vendored
+17
-9
@@ -2,15 +2,23 @@ import type { MegaMenuCardProps } from "../MegaMenuCard";
|
||||
|
||||
const ddbImageBase = "https://media.dndbeyond.com/mega-menu";
|
||||
|
||||
export const characterBuilder: MegaMenuCardProps = {
|
||||
label: "Character Builder",
|
||||
imageUrl: `${ddbImageBase}/323a928e32eff87dee85dfbe0793ce12.jpg`,
|
||||
link: "https://www.dndbeyond.com/characters/builder",
|
||||
};
|
||||
|
||||
export const primaryItems: MegaMenuCardProps[] = [
|
||||
export const groupOne: MegaMenuCardProps[] = [
|
||||
{
|
||||
label: "Maps",
|
||||
label: "Character Builder",
|
||||
imageUrl: `${ddbImageBase}/character_builder.png`,
|
||||
link: "https://www.dndbeyond.com/characters/builder",
|
||||
},
|
||||
{
|
||||
label: "Sigil 3D VTT",
|
||||
imageUrl: `${ddbImageBase}/playtest_sigil.png`,
|
||||
link: "https://www.dndbeyond.com/project-sigil",
|
||||
flags: [{ label: "New", variant: "success" }],
|
||||
},
|
||||
];
|
||||
|
||||
export const groupTwo: MegaMenuCardProps[] = [
|
||||
{
|
||||
label: "Maps VTT",
|
||||
imageUrl: `${ddbImageBase}/049ddb9085342521d25c5230451cfd45.jpg`,
|
||||
link: "https://www.dndbeyond.com/games",
|
||||
flags: [{ label: "Beta", variant: "info" }],
|
||||
@@ -23,7 +31,7 @@ export const primaryItems: MegaMenuCardProps[] = [
|
||||
},
|
||||
];
|
||||
|
||||
export const secondaryItems: MegaMenuCardProps[] = [
|
||||
export const groupThree: MegaMenuCardProps[] = [
|
||||
{
|
||||
label: "Mobile App",
|
||||
imageUrl: `${ddbImageBase}/3aa58aac2d02bb52d62204e158b48ce6.jpg`,
|
||||
|
||||
+14
-11
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import clsx from "clsx";
|
||||
import type { FC } from "react";
|
||||
import { Tooltip as ReactTooltip, type ITooltip } from "react-tooltip";
|
||||
import styles from "./Tooltip.module.css";
|
||||
@@ -7,22 +8,24 @@ import styles from "./Tooltip.module.css";
|
||||
export interface TooltipProps extends ITooltip {
|
||||
id: string;
|
||||
"data-testid"?: string;
|
||||
disableStyleInjection?: "core" | undefined;
|
||||
}
|
||||
|
||||
export const Tooltip: FC<TooltipProps> = ({
|
||||
id,
|
||||
"data-testid": testId,
|
||||
children,
|
||||
disableStyleInjection,
|
||||
...props
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className={styles.container}
|
||||
{...(testId && { "data-testid": testId })}
|
||||
}) => (
|
||||
<div className={styles.container} {...(testId && { "data-testid": testId })}>
|
||||
<ReactTooltip
|
||||
id={id}
|
||||
{...props}
|
||||
className={clsx([styles.tooltip, props.className])}
|
||||
disableStyleInjection={disableStyleInjection}
|
||||
>
|
||||
<ReactTooltip id={id} className={styles.tooltip} {...props}>
|
||||
{children}
|
||||
</ReactTooltip>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
{children}
|
||||
</ReactTooltip>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user