UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 1.91 kB
{"version":3,"file":"EmptyStateIndicator.mjs","names":["classes"],"sources":["../../../../src/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.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 EmptyStateIndicatorStylesNames = 'indicator';\n\nexport interface EmptyStateIndicatorProps\n extends BoxProps, CompoundStylesApiProps<EmptyStateIndicatorFactory>, ElementProps<'div'> {\n /** Icon or illustration displayed inside the indicator */\n children?: React.ReactNode;\n}\n\nexport type EmptyStateIndicatorFactory = Factory<{\n props: EmptyStateIndicatorProps;\n ref: HTMLDivElement;\n stylesNames: EmptyStateIndicatorStylesNames;\n compound: true;\n}>;\n\nexport const EmptyStateIndicator = factory<EmptyStateIndicatorFactory>((_props) => {\n const props = useProps('EmptyStateIndicator', null, _props);\n const { classNames, className, style, styles, vars, children, mod, ...others } = props;\n\n const ctx = useEmptyStateContext();\n\n return (\n <Box\n mod={[{ 'with-background': ctx.withIndicatorBackground }, mod]}\n {...ctx.getStyles('indicator', { className, style, classNames, styles })}\n {...others}\n >\n {children}\n </Box>\n );\n});\n\nEmptyStateIndicator.classes = classes;\nEmptyStateIndicator.displayName = '@mantine/core/EmptyStateIndicator';\n"],"mappings":";;;;;;;;AA2BA,MAAa,sBAAsB,SAAqC,WAAW;CAEjF,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,UAAU,KAAK,GAAG,WADxD,SAAS,uBAAuB,MAAM,MACiC;CAErF,MAAM,MAAM,qBAAqB;CAEjC,OACE,oBAAC,KAAD;EACE,KAAK,CAAC,EAAE,mBAAmB,IAAI,wBAAwB,GAAG,GAAG;EAC7D,GAAI,IAAI,UAAU,aAAa;GAAE;GAAW;GAAO;GAAY;EAAO,CAAC;EACvE,GAAI;EAEH;CACE,CAAA;AAET,CAAC;AAED,oBAAoB,UAAUA;AAC9B,oBAAoB,cAAc"}