UNPKG

@mantine/spotlight

Version:

Command center components for react and Mantine

1 lines 2.04 kB
{"version":3,"file":"SpotlightActionsGroup.cjs","names":["Box","useSpotlightContext","classes"],"sources":["../src/SpotlightActionsGroup.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '@mantine/core';\nimport { useSpotlightContext } from './Spotlight.context';\nimport classes from './Spotlight.module.css';\n\nexport type SpotlightActionsGroupStylesNames = 'actionsGroup';\n\nexport interface SpotlightActionsGroupProps\n extends BoxProps, CompoundStylesApiProps<SpotlightActionsGroupFactory>, ElementProps<'div'> {\n /** `Spotlight.Action` components */\n children?: React.ReactNode;\n\n /** Group label */\n label?: string;\n}\n\nexport type SpotlightActionsGroupFactory = Factory<{\n props: SpotlightActionsGroupProps;\n ref: HTMLDivElement;\n stylesNames: SpotlightActionsGroupStylesNames;\n compound: true;\n}>;\n\nexport const SpotlightActionsGroup = factory<SpotlightActionsGroupFactory>((props) => {\n const { className, style, styles, classNames, label, children, ...others } = useProps(\n 'SpotlightActionsGroup',\n null,\n props\n );\n\n const ctx = useSpotlightContext();\n\n return (\n <Box\n {...ctx.getStyles('actionsGroup', { className, style, classNames, styles })}\n {...others}\n __vars={{\n '--spotlight-label': `'${label?.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`,\n }}\n >\n {children}\n </Box>\n );\n});\n\nSpotlightActionsGroup.classes = classes;\nSpotlightActionsGroup.displayName = '@mantine/core/SpotlightActionsGroup';\n"],"mappings":";;;;;;AA8BA,MAAa,yBAAA,GAAA,cAAA,UAA+D,UAAU;CACpF,MAAM,EAAE,WAAW,OAAO,QAAQ,YAAY,OAAO,UAAU,GAAG,YAAA,GAAA,cAAA,UAChE,yBACA,MACA,KACF;CAIA,OACE,iBAAA,GAAA,kBAAA,KAACA,cAAAA,KAAD;EACE,GAJQC,0BAAAA,oBAIF,EAAE,UAAU,gBAAgB;GAAE;GAAW;GAAO;GAAY;EAAO,CAAC;EAC1E,GAAI;EACJ,QAAQ,EACN,qBAAqB,IAAI,OAAO,QAAQ,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAK,EAAE,GAC9E;EAEC;CACE,CAAA;AAET,CAAC;AAED,sBAAsB,UAAUC,yBAAAA;AAChC,sBAAsB,cAAc"}