UNPKG

@grafana/ui

Version:
1 lines 1.58 kB
{"version":3,"file":"Space.mjs","sources":["../../../../src/components/Layout/Space.tsx"],"sourcesContent":["import { ThemeSpacingTokens } from '@grafana/data';\n\nimport { Box } from './Box/Box';\nimport { ResponsiveProp } from './utils/responsiveness';\n\nexport interface SpaceProps {\n /**\n * The amount of vertical space to use.\n */\n v?: ResponsiveProp<ThemeSpacingTokens>;\n /**\n * The amount of horizontal space to use.\n */\n h?: ResponsiveProp<ThemeSpacingTokens>;\n /**\n * The layout of the space. If set to `inline`, the component will behave like an inline-block element,\n * otherwise it will behave like a block element.\n */\n layout?: 'block' | 'inline';\n}\n\n/**\n * The Space component is a component used to add space between elements. Horizontal space is added using the `h` prop, while vertical space is added using the `v` prop. When adding horizontal space between inline or inline-block elements, the `layout` prop should be set to `\"inline\"`, otherwise the `\"block\"` value of the prop can be used.\n *\n * https://developers.grafana.com/ui/latest/index.html?path=/docs/layout-space--docs\n */\nexport const Space = ({ v = 0, h = 0, layout }: SpaceProps) => {\n return <Box paddingRight={h} paddingBottom={v} display={layout === 'inline' ? 'inline-block' : 'block'} />;\n};\n"],"names":[],"mappings":";;;;AA0BO,MAAM,KAAA,GAAQ,CAAC,EAAE,CAAA,GAAI,GAAG,CAAA,GAAI,CAAA,EAAG,QAAO,KAAkB;AAC7D,EAAA,uBAAO,GAAA,CAAC,GAAA,EAAA,EAAI,YAAA,EAAc,CAAA,EAAG,aAAA,EAAe,GAAG,OAAA,EAAS,MAAA,KAAW,QAAA,GAAW,cAAA,GAAiB,OAAA,EAAS,CAAA;AAC1G;;;;"}