import React from "react"; import { SpaceProps, LayoutProps, FlexboxProps, PositionProps, GridProps } from "styled-system"; import * as DesignTokens from "@sage/design-tokens/js/base/common"; import { type Gap } from "../../style/utils/box-gap"; import { TagProps } from "../../__internal__/utils/helpers/tags"; export type OverflowWrap = "break-word" | "anywhere"; export type ScrollVariant = "light" | "dark"; export type BoxSizing = "content-box" | "border-box"; type DesignTokensType = keyof typeof DesignTokens; type BoxShadowsType = Extract; type BorderRadiusToken = Extract; export type BorderRadiusType = BorderRadiusToken | `${BorderRadiusToken} ${BorderRadiusToken}` | `${BorderRadiusToken} ${BorderRadiusToken} ${BorderRadiusToken}` | `${BorderRadiusToken} ${BorderRadiusToken} ${BorderRadiusToken} ${BorderRadiusToken}`; export interface BoxProps extends FlexboxProps, Omit, LayoutProps, Omit, SpaceProps, TagProps { /** Set the element rendered by the Box component. Only `div` and `span` will be supported in the future. */ as?: keyof JSX.IntrinsicElements | React.ComponentType; /** Set the ID attribute of the Box component */ id?: string; /** Content to be rendered inside the Box component */ children?: React.ReactNode; /** * Set the Role attribute of the Box component * @deprecated `Box` is intended for layout only and this prop will be removed after a grace period. Its behavior will be maintained until removal. Use a semantic HTML element or a Carbon component that provides the required semantics instead. */ role?: string; /** String to set Box content break strategy. Note "anywhere" is not supported in Safari */ overflowWrap?: OverflowWrap; /** * Scroll styling attribute * @deprecated This prop is marked for deprecation. Its behavior will be maintained until removal. */ scrollVariant?: ScrollVariant; /** Set the box-sizing attribute of the Box component */ boxSizing?: BoxSizing; /** Gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */ gap?: Gap; /** Column gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */ columnGap?: Gap; /** Row gap an integer multiplier of the base spacing constant (8px) or any valid CSS string." */ rowGap?: Gap; /** * Design Token for Box Shadow. Note: please check that the box shadow design token you are using is compatible with the Box component. * @deprecated This prop is marked for deprecation. Its behavior will be maintained until removal. */ boxShadow?: BoxShadowsType; /** * Design Token for Border Radius. Note: please check that the border radius design token you are using is compatible with the Box component. * @deprecated This prop is marked for deprecation. Its behavior will be maintained until removal. */ borderRadius?: BorderRadiusType; /** * @private * @ignore * @internal * Sets className for component. INTERNAL USE ONLY. */ className?: string; /** * Set the color attribute of the Box component * @deprecated This prop is marked for deprecation and will have a longer grace period before removal. Its behavior will be maintained until removal. */ color?: string; /** * Set the bg attribute of the Box component * @deprecated This prop is marked for deprecation and will have a longer grace period before removal. Its behavior will be maintained until removal. */ bg?: string; /** * Set the backgroundColor attribute of the Box component * @deprecated This prop is marked for deprecation and will have a longer grace period before removal. Its behavior will be maintained until removal. */ backgroundColor?: string; /** Whether the component is hidden from view. In this state, the component will not be visible to users but will remain in the HTML document */ hidden?: boolean; /** * Set the opacity attribute of the Box component * @deprecated This prop is marked for deprecation. Its behavior will be maintained until removal. */ opacity?: string | number; /** * Set the container to be hidden from screen readers * @deprecated `Box` is intended for layout only and this prop will be removed after a grace period. Its behavior will be maintained until removal. Apply `aria-hidden` to a native HTML element instead. */ "aria-hidden"?: "true" | "false"; /** * Make the container an aria-live region * @deprecated `Box` is intended for layout only and this prop will be removed after a grace period. Its behavior will be maintained until removal. Apply `aria-live` to a native HTML element instead. */ "aria-live"?: "off" | "assertive" | "polite"; /** @private @internal @ignore */ "data-component"?: string; /** * Set the tabIndex attribute of the Box component to control keyboard focus and tab order. * @deprecated This prop is marked for deprecation and will have a longer grace period before removal. Its behavior will be maintained until removal. * @private * @ignore */ tabIndex?: number; /** * Indicates whether AT will announce all, or only parts of, the changed region * @deprecated `Box` is intended for layout only and this prop will be removed after a grace period. Its behavior will be maintained until removal. Apply `aria-atomic` to a native HTML element instead. */ "aria-atomic"?: "true" | "false"; } export declare const Box: React.ForwardRefExoticComponent>; export default Box;