raft-ui
Version:
React UI components for Raft.
314 lines • 7.71 kB
text/typescript
import { Dialog } from "@base-ui/react/dialog";
import { VariantProps } from "tailwind-variants/lite";
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
import { Button } from "@base-ui/react/button";
import { useRender } from "@base-ui/react/use-render";
//#region src/lib/styled-props.d.ts
/**
* Base UI components type `className` as `string | ((state) => string)`, but our
* tv() recipes only accept a plain string. `StyledProps` narrows a Base UI
* component's props to a string `className` so they can flow into a recipe.
*
* The state-callback form is intentionally dropped: our components express every
* state through `data-*` variants in the recipe, so a caller never needs it.
*/
type StyledProps<P> = Omit<P, "className" | "style"> & {
className?: string;
style?: CSSProperties;
};
//#endregion
//#region src/lib/data-attributes.d.ts
type DataAttributes = Record<`data-${string}`, string | undefined>;
//#endregion
//#region src/components/button/button.d.ts
declare const buttonVariants: import("tailwind-variants/lite").TVReturnType<{
theme: {
brutal: {
root: string[];
};
elegant: {
root: string[];
};
};
variant: {
primary: {
root: string[];
};
default: {
root: string[];
};
information: {
root: string[];
};
muted: {
root: string[];
};
accent: {
root: string[];
};
warning: {
root: string[];
};
success: {
root: string[];
};
outline: {
root: string[];
};
ghost: {
root: string[];
};
link: {
root: string[];
};
"danger-secondary": {
root: string[];
};
danger: {
root: string[];
};
"danger-outline": {
root: string[];
};
};
size: {
xs: {
root: string[];
};
sm: {
root: string[];
};
md: {
root: string[];
};
lg: {
root: string[];
};
inline: {
root: string[];
};
"icon-xs": {
root: string[];
};
"icon-sm": {
root: string[];
};
"icon-md": {
root: string;
};
"icon-lg": {
root: string;
};
};
}, {
root: string[];
content: string;
loadingIndicator: string;
}, undefined, {
theme: {
brutal: {
root: string[];
};
elegant: {
root: string[];
};
};
variant: {
primary: {
root: string[];
};
default: {
root: string[];
};
information: {
root: string[];
};
muted: {
root: string[];
};
accent: {
root: string[];
};
warning: {
root: string[];
};
success: {
root: string[];
};
outline: {
root: string[];
};
ghost: {
root: string[];
};
link: {
root: string[];
};
"danger-secondary": {
root: string[];
};
danger: {
root: string[];
};
"danger-outline": {
root: string[];
};
};
size: {
xs: {
root: string[];
};
sm: {
root: string[];
};
md: {
root: string[];
};
lg: {
root: string[];
};
inline: {
root: string[];
};
"icon-xs": {
root: string[];
};
"icon-sm": {
root: string[];
};
"icon-md": {
root: string;
};
"icon-lg": {
root: string;
};
};
}, {
root: string[];
content: string;
loadingIndicator: string;
}, import("tailwind-variants/lite").TVReturnTypeLike<{
theme: {
brutal: {
root: string[];
};
elegant: {
root: string[];
};
};
variant: {
primary: {
root: string[];
};
default: {
root: string[];
};
information: {
root: string[];
};
muted: {
root: string[];
};
accent: {
root: string[];
};
warning: {
root: string[];
};
success: {
root: string[];
};
outline: {
root: string[];
};
ghost: {
root: string[];
};
link: {
root: string[];
};
"danger-secondary": {
root: string[];
};
danger: {
root: string[];
};
"danger-outline": {
root: string[];
};
};
size: {
xs: {
root: string[];
};
sm: {
root: string[];
};
md: {
root: string[];
};
lg: {
root: string[];
};
inline: {
root: string[];
};
"icon-xs": {
root: string[];
};
"icon-sm": {
root: string[];
};
"icon-md": {
root: string;
};
"icon-lg": {
root: string;
};
};
}, {
root: string[];
content: string;
loadingIndicator: string;
}>>;
type ButtonProps = StyledProps<Button.Props> & Omit<VariantProps<typeof buttonVariants>, "theme"> & DataAttributes & {
loading?: boolean;
loadingLabel?: string;
};
declare function Button$1({ variant, size, loading, loadingLabel, disabled, className, children, render, nativeButton, ...props }: ButtonProps): import("react").JSX.Element;
//#endregion
//#region src/components/dialog/dialog.d.ts
type DialogProps = Dialog.Root.Props;
declare function Dialog$1(props: DialogProps): import("react").JSX.Element;
type DialogTriggerProps = Dialog.Trigger.Props;
declare function DialogTrigger(props: DialogTriggerProps): import("react").JSX.Element;
type DialogPortalProps = Dialog.Portal.Props;
declare function DialogPortal(props: DialogPortalProps): import("react").JSX.Element;
type DialogOverlayProps = StyledProps<Dialog.Backdrop.Props> & {
layer?: 0 | 1;
};
declare function DialogOverlay({ className, layer, ...props }: DialogOverlayProps): import("react").JSX.Element;
type DialogContentProps = StyledProps<Dialog.Popup.Props> & {
portalProps?: DialogPortalProps;
overlay?: false | DialogOverlayProps;
size?: "sm" | "md" | "lg";
layer?: 0 | 1;
};
declare function DialogContent({ className, children, portalProps, overlay, size, layer, ...props }: DialogContentProps): import("react").JSX.Element;
type DialogCloseProps = Dialog.Close.Props & Pick<ButtonProps, "variant" | "size"> & {
className?: string;
children?: ReactNode;
};
declare function DialogClose({ className, variant, size, children, render, "aria-label": ariaLabel, ...props }: DialogCloseProps): import("react").JSX.Element;
type DialogHeaderProps = ComponentPropsWithRef<"div">;
declare function DialogHeader({ className, ...props }: DialogHeaderProps): import("react").JSX.Element;
type DialogBodyProps = ComponentPropsWithRef<"div">;
declare function DialogBody({ className, ...props }: DialogBodyProps): import("react").JSX.Element;
type DialogFooterProps = ComponentPropsWithRef<"div">;
declare function DialogFooter({ className, ...props }: DialogFooterProps): import("react").JSX.Element;
type DialogTitleProps = StyledProps<Dialog.Title.Props>;
declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react").JSX.Element;
type DialogDescriptionProps = StyledProps<Dialog.Description.Props>;
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react").JSX.Element;
//#endregion
export { Button$1 as C, DataAttributes as D, VariantProps as E, StyledProps as O, DialogTriggerProps as S, buttonVariants as T, DialogPortalProps as _, DialogCloseProps as a, DialogTitleProps as b, DialogDescription as c, DialogFooterProps as d, DialogHeader as f, DialogPortal as g, DialogOverlayProps as h, DialogClose as i, DialogDescriptionProps as l, DialogOverlay as m, DialogBody as n, DialogContent as o, DialogHeaderProps as p, DialogBodyProps as r, DialogContentProps as s, Dialog$1 as t, DialogFooter as u, DialogProps as v, ButtonProps as w, DialogTrigger as x, DialogTitle as y };