@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 3 kB
Source Map (JSON)
{"version":3,"file":"Progress.cjs","names":["factory","useProps","useResolvedStylesApi","ProgressRoot","ProgressSection","classes","ProgressLabel"],"sources":["../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import {\n factory,\n Factory,\n MantineColor,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '../../core';\nimport { ProgressLabel } from './ProgressLabel/ProgressLabel';\nimport {\n __ProgressRootProps,\n ProgressRoot,\n ProgressRootCssVariables,\n ProgressRootStylesNames,\n} from './ProgressRoot/ProgressRoot';\nimport { ProgressSection } from './ProgressSection/ProgressSection';\nimport classes from './Progress.module.css';\n\nexport type ProgressStylesNames = ProgressRootStylesNames;\n\nexport interface ProgressProps extends __ProgressRootProps, StylesApiProps<ProgressFactory> {\n /** Value of the progress */\n value: number;\n\n /** Key of `theme.colors` or any valid CSS value @default theme.primaryColor */\n color?: MantineColor;\n\n /** If set, the section has stripes @default false */\n striped?: boolean;\n\n /** If set, the sections stripes are animated (automatically enables striped) @default false */\n animated?: boolean;\n}\n\nexport type ProgressFactory = Factory<{\n props: ProgressProps;\n ref: HTMLDivElement;\n stylesNames: ProgressStylesNames;\n vars: ProgressRootCssVariables;\n staticComponents: {\n Section: typeof ProgressSection;\n Root: typeof ProgressRoot;\n Label: typeof ProgressLabel;\n };\n}>;\n\nexport const Progress = factory<ProgressFactory>((_props) => {\n const props = useProps('Progress', null, _props);\n const {\n value,\n classNames,\n styles,\n vars,\n color,\n striped,\n animated,\n 'aria-label': label,\n ...others\n } = props;\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ProgressFactory>({\n classNames,\n styles,\n props,\n });\n\n return (\n <ProgressRoot\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n vars={vars as any}\n {...others}\n >\n <ProgressSection\n value={value}\n color={color}\n striped={striped}\n animated={animated}\n aria-label={label}\n />\n </ProgressRoot>\n );\n});\n\nProgress.classes = classes;\nProgress.displayName = '@mantine/core/Progress';\nProgress.Section = ProgressSection;\nProgress.Root = ProgressRoot;\nProgress.Label = ProgressLabel;\n"],"mappings":";;;;;;;;;;;AA8CA,MAAa,WAAWA,gBAAAA,SAA0B,WAAW;CAC3D,MAAM,QAAQC,kBAAAA,SAAS,YAAY,MAAM,OAAO;CAChD,MAAM,EACJ,OACA,YACA,QACA,MACA,OACA,SACA,UACA,cAAc,OACd,GAAG,WACD;CAEJ,MAAM,EAAE,oBAAoB,mBAAmBC,gCAAAA,qBAAsC;EACnF;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,qBAAAA,cAAD;EACE,YAAY;EACZ,QAAQ;EACF;EACN,GAAI;YAEJ,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD;GACS;GACA;GACE;GACC;GACV,cAAY;GACZ,CAAA;EACW,CAAA;EAEjB;AAEF,SAAS,UAAUC,wBAAAA;AACnB,SAAS,cAAc;AACvB,SAAS,UAAUD,wBAAAA;AACnB,SAAS,OAAOD,qBAAAA;AAChB,SAAS,QAAQG,sBAAAA"}