UNPKG

@yamada-ui/react

Version:

React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion

1 lines 2.59 kB
{"version":3,"file":"grid.cjs","names":["createComponent","gridStyle"],"sources":["../../../../src/components/grid/grid.tsx"],"sourcesContent":["\"use client\"\n\nimport type { CSSProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { GridStyle } from \"./grid.style\"\nimport { createComponent } from \"../../core\"\nimport { gridStyle } from \"./grid.style\"\n\nexport interface GridProps extends HTMLStyledProps, ThemeProps<GridStyle> {\n /**\n * The CSS `grid-area` property.\n */\n area?: CSSProps[\"gridArea\"]\n /**\n * The CSS `grid-auto-columns` property.\n */\n autoColumns?: CSSProps[\"gridAutoColumns\"]\n /**\n * The CSS `grid-auto-flow` property.\n */\n autoFlow?: CSSProps[\"gridAutoFlow\"]\n /**\n * The CSS `grid-auto-rows` property.\n */\n autoRows?: CSSProps[\"gridAutoRows\"]\n /**\n * The CSS `grid-column` property.\n */\n column?: CSSProps[\"gridColumn\"]\n /**\n * The CSS `grid-row` property.\n */\n row?: CSSProps[\"gridRow\"]\n /**\n * The CSS `grid-template-areas` property.\n */\n templateAreas?: CSSProps[\"gridTemplateAreas\"]\n /**\n * The CSS `grid-template-columns` property.\n */\n templateColumns?: CSSProps[\"gridTemplateColumns\"]\n /**\n * The CSS `grid-template-rows` property.\n */\n templateRows?: CSSProps[\"gridTemplateRows\"]\n}\n\nconst {\n PropsContext: GridPropsContext,\n usePropsContext: useGridPropsContext,\n withContext,\n} = createComponent<GridProps, GridStyle>(\"grid\", gridStyle)\n\nexport { GridPropsContext, useGridPropsContext }\n\n/**\n * `Grid` is a component for managing grid layouts. It also comes with handy style shorthand.\n *\n * @see https://yamada-ui.com/docs/components/grid\n */\nexport const Grid = withContext(\"div\")(\n undefined,\n ({\n area: gridArea,\n autoColumns: gridAutoColumns,\n autoFlow: gridAutoFlow,\n autoRows: gridAutoRows,\n column: gridColumn,\n templateAreas: gridTemplateAreas,\n templateColumns: gridTemplateColumns,\n templateRows: gridTemplateRows,\n ...rest\n }) => ({\n display: \"grid\",\n gridArea,\n gridAutoColumns,\n gridAutoFlow,\n gridAutoRows,\n gridColumn,\n gridTemplateAreas,\n gridTemplateColumns,\n gridTemplateRows,\n ...rest,\n }),\n)\n"],"mappings":";;;;;;;AA8CA,MAAM,EACJ,cAAc,kBACd,iBAAiB,qBACjB,gBACEA,yCAAsC,QAAQC,6BAAU;;;;;;AAS5D,MAAa,OAAO,YAAY,MAAM,CACpC,SACC,EACC,MAAM,UACN,aAAa,iBACb,UAAU,cACV,UAAU,cACV,QAAQ,YACR,eAAe,mBACf,iBAAiB,qBACjB,cAAc,iBACd,GAAG,YACE;CACL,SAAS;CACT;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;CACJ,EACF"}