@spark-web/box
Version:
--- title: Box storybookPath: page-layout-box--default isExperimentalPackage: false ---
49 lines (48 loc) • 3.87 kB
TypeScript
import type { CSSObject } from '@emotion/react';
import type { DataAttributeMap } from '@spark-web/utils/internal';
import type { ReactNode } from 'react';
import type { BoxStyleProps } from "./use-box-styles.js";
export type BoxProps = {
/** Children element to be rendered inside the component. */
children?: ReactNode;
/** Sets data attributes on the component. */
data?: DataAttributeMap;
/** An identifier which must be unique in the whole document. */
id?: string;
/** Custom css styles. */
css?: CSSObject;
/**
* When providing a component using the "as" prop, optionally tell the system
* what the underlying element will be. Used internally to manage reset
* styles.
*/
asElement?: keyof HTMLElementTagNameMap;
} & BoxStyleProps;
/** Exposes a prop-based API for adding styles to a view, within the constraints of the theme. */
export declare const Box: <Comp extends import("react").ElementType = "div">(props: {
as?: Comp | undefined;
ref?: import("react").Ref<Comp extends "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
} & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & {
/** Children element to be rendered inside the component. */
children?: ReactNode;
/** Sets data attributes on the component. */
data?: DataAttributeMap;
/** An identifier which must be unique in the whole document. */
id?: string;
/** Custom css styles. */
css?: CSSObject;
/**
* When providing a component using the "as" prop, optionally tell the system
* what the underlying element will be. Used internally to manage reset
* styles.
*/
asElement?: keyof HTMLElementTagNameMap;
} & {
background?: keyof import("@spark-web/theme").SparkTheme["color"]["background"];
cursor?: "default" | "pointer";
minHeight?: 0;
minWidth?: 0;
overflow?: "hidden" | "scroll" | "visible" | "auto";
shadow?: keyof import("@spark-web/theme").SparkTheme["shadow"] | string | null;
userSelect?: "none";
} & import("./use-box-styles.js").ResponsiveBoxProps) => import("react").ReactElement;