@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 2.09 kB
Source Map (JSON)
{"version":3,"file":"EmptyStateTitle.cjs","names":["factory","useProps","useEmptyStateContext","Box","classes"],"sources":["../../../../src/components/EmptyState/EmptyStateTitle/EmptyStateTitle.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { useEmptyStateContext } from '../EmptyState.context';\nimport classes from '../EmptyState.module.css';\n\nexport type EmptyStateTitleStylesNames = 'title';\n\nexport interface EmptyStateTitleProps\n extends BoxProps, CompoundStylesApiProps<EmptyStateTitleFactory>, ElementProps<'div'> {\n /** Title content */\n children?: React.ReactNode;\n\n /** Heading order, renders the title as `h1`–`h6` element. By default, the title is rendered as a `div` without semantic heading level */\n order?: 1 | 2 | 3 | 4 | 5 | 6;\n}\n\nexport type EmptyStateTitleFactory = Factory<{\n props: EmptyStateTitleProps;\n ref: HTMLDivElement;\n stylesNames: EmptyStateTitleStylesNames;\n compound: true;\n}>;\n\nexport const EmptyStateTitle = factory<EmptyStateTitleFactory>((_props) => {\n const props = useProps('EmptyStateTitle', null, _props);\n const { classNames, className, style, styles, vars, children, order, mod, ...others } = props;\n\n const ctx = useEmptyStateContext();\n\n return (\n <Box<any>\n component={order ? `h${order}` : 'div'}\n mod={mod}\n {...ctx.getStyles('title', { className, style, classNames, styles })}\n {...others}\n >\n {children}\n </Box>\n );\n});\n\nEmptyStateTitle.classes = classes;\nEmptyStateTitle.displayName = '@mantine/core/EmptyStateTitle';\n"],"mappings":";;;;;;;;AA8BA,MAAa,kBAAkBA,gBAAAA,SAAiC,WAAW;CAEzE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,WAD/DC,kBAAAA,SAAS,mBAAmB,MAAM,MAC4C;CAE5F,MAAM,MAAMC,2BAAAA,qBAAqB;CAEjC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;EACE,WAAW,QAAQ,IAAI,UAAU;EAC5B;EACL,GAAI,IAAI,UAAU,SAAS;GAAE;GAAW;GAAO;GAAY;EAAO,CAAC;EACnE,GAAI;EAEH;CACE,CAAA;AAET,CAAC;AAED,gBAAgB,UAAUC,0BAAAA;AAC1B,gBAAgB,cAAc"}