UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

1 lines 1.56 kB
{"version":3,"file":"Row.cjs","sources":["../../../../src/lib/Layout/Row.tsx"],"sourcesContent":["import {forwardRef} from 'react';\nimport type {ReactNode} from 'react';\nimport {useLocalTheme} from 'css-vars-hook';\nimport classNames from 'classnames';\n\nimport type {DataAttributes, LibraryProps} from '@/internal/LibraryAPI';\nimport {useLinkRefs} from '@/internal/hooks/useLinkRefs.ts';\n\nimport classes from './Layout.module.css';\n\ntype RowProps = DataAttributes &\n LibraryProps & {\n /** Select an HTML element to render as a container */\n as?: string;\n children: ReactNode;\n };\n\nexport const Row = forwardRef<HTMLElement, RowProps>(\n ({className, children, as = 'div', ...nativeProps}, ref) => {\n const {LocalRoot, ref: internalRef} = useLocalTheme();\n useLinkRefs(ref, internalRef);\n return (\n <LocalRoot {...nativeProps} as={as} className={classNames(classes.row, className)}>\n {children}\n </LocalRoot>\n );\n }\n);\n\nRow.displayName = 'Row';\n"],"names":["Row","forwardRef","className","children","as","nativeProps","ref","LocalRoot","internalRef","useLocalTheme","useLinkRefs","jsx","classNames","classes"],"mappings":"+RAiBaA,EAAMC,EAAA,WACf,CAAC,CAAC,UAAAC,EAAW,SAAAC,EAAU,GAAAC,EAAK,MAAO,GAAGC,CAAW,EAAGC,IAAQ,CACxD,KAAM,CAAC,UAAAC,EAAW,IAAKC,CAAA,EAAeC,EAAAA,cAAc,EACpDC,OAAAA,EAAA,YAAYJ,EAAKE,CAAW,EAExBG,EAAA,IAACJ,EAAW,CAAA,GAAGF,EAAa,GAAAD,EAAQ,UAAWQ,EAAWC,EAAQ,QAAA,IAAKX,CAAS,EAC3E,SAAAC,CACL,CAAA,CAAA,CAGZ,EAEAH,EAAI,YAAc"}