UNPKG

koval-ui

Version:

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

1 lines 1.42 kB
{"version":3,"file":"Header.cjs","sources":["../../../../src/lib/Layout/Header.tsx"],"sourcesContent":["import {forwardRef} from 'react';\nimport type {FC, ReactNode} from 'react';\nimport classNames from 'classnames';\n\nimport type {DataAttributes, LibraryProps} from '@/internal/LibraryAPI';\n\nimport {Row} from './Row.tsx';\nimport classes from './Layout.module.css';\n\nexport type Props = DataAttributes &\n LibraryProps & {\n children?: ReactNode;\n /** Attach header to the page top */\n sticky?: boolean;\n };\n\nexport const Header: FC<Props> = forwardRef<HTMLDivElement, Props>(\n ({children, sticky = false, className, ...restProps}, ref) => {\n return (\n <Row\n {...restProps}\n as=\"header\"\n ref={ref}\n className={classNames(classes.header, {[classes.sticky]: sticky}, className)}>\n {children}\n </Row>\n );\n }\n);\n\nHeader.displayName = 'Header';\n"],"names":["Header","forwardRef","children","sticky","className","restProps","ref","jsx","Row","classNames","classes"],"mappings":"yOAgBaA,EAAoBC,EAAA,WAC7B,CAAC,CAAC,SAAAC,EAAU,OAAAC,EAAS,GAAO,UAAAC,EAAW,GAAGC,CAAS,EAAGC,IAE9CC,EAAA,IAACC,EAAA,IAAA,CACI,GAAGH,EACJ,GAAG,SACH,IAAAC,EACA,UAAWG,EAAWC,EAAA,QAAQ,OAAQ,CAAC,CAACA,EAAAA,QAAQ,MAAM,EAAGP,CAAM,EAAGC,CAAS,EAC1E,SAAAF,CAAA,CACL,CAGZ,EAEAF,EAAO,YAAc"}