import React, { PropsWithChildren } from 'react'; import type { JSX } from 'react'; import type { BaseProps } from '../component-helpers'; /** * Design tokens */ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/grid/grid.css'; import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css'; type ResponsiveMap = { xsmall?: GridColumnIndex; small?: GridColumnIndex; medium?: GridColumnIndex; large?: GridColumnIndex; xlarge?: GridColumnIndex; xxlarge?: GridColumnIndex; }; export type GridColumnIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; export type GridProps = React.HTMLAttributes & { /** * The HTML element used to render the grid. */ as?: T | 'div' | 'span' | 'section'; /** * Visual aid to help with alignment. */ enableOverlay?: boolean; /** * Enable/disable default gutters */ enableGutters?: boolean; /** * Sets the gap between columns. */ columnGap?: 'none' | 'default'; /** * Sets the gap between rows. */ rowGap?: 'none' | 'default'; /** * Fills the width of the parent container and removes the max-width. */ fullWidth?: boolean; /** * Test id for the root element. */ ['data-testid']?: string; } & (T extends 'span' ? BaseProps : T extends 'section' ? BaseProps : BaseProps); type GridColumnProps = { as?: T | 'div' | 'span' | 'section'; span?: GridColumnIndex | ResponsiveMap; start?: GridColumnIndex | ResponsiveMap; } & (T extends 'span' ? BaseProps & React.HTMLAttributes : T extends 'section' ? BaseProps & React.HTMLAttributes : BaseProps & React.HTMLAttributes); /** * Use Grid to create flexible and responsive grid-based layouts * @see https://primer.style/brand/components/Grid * @example * * * ... * * */ export declare const Grid: React.NamedExoticComponent & { /** * The HTML element used to render the grid. */ as?: "span" | "div" | "section" | undefined; /** * Visual aid to help with alignment. */ enableOverlay?: boolean; /** * Enable/disable default gutters */ enableGutters?: boolean; /** * Sets the gap between columns. */ columnGap?: "none" | "default"; /** * Sets the gap between rows. */ rowGap?: "none" | "default"; /** * Fills the width of the parent container and removes the max-width. */ fullWidth?: boolean; /** * Test id for the root element. */ "data-testid"?: string; } & BaseProps & { children?: React.ReactNode | undefined; }> & { readonly type: ({ className, children, as, fullWidth, enableOverlay, enableGutters, columnGap, rowGap, ["data-testid"]: testId, ...rest }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element; } & { Column: React.MemoExoticComponent<({ children, as, span, start, className, ...rest }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element>; testIds: { root: string; }; }; export {};