UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 1.98 kB
{"version":3,"file":"EmptyStateTitle.mjs","names":["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,kBAAkB,SAAiC,WAAW;CAEzE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,WAD/D,SAAS,mBAAmB,MAAM,MAC4C;CAE5F,MAAM,MAAM,qBAAqB;CAEjC,OACE,oBAAC,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,UAAUA;AAC1B,gBAAgB,cAAc"}