@mantine/core 5.2.0-alpha.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/Progress/Progress.js
CHANGED
|
@@ -91,9 +91,9 @@ const Progress = React.forwardRef((props, ref) => {
|
|
|
91
91
|
const { classes, cx, theme } = Progress_styles['default']({ color, size, radius, striped: striped || animate, animate }, { classNames, styles: styles$1, unstyled, name: "Progress" });
|
|
92
92
|
const segments = Array.isArray(sections) ? getCumulativeSections(sections).map((section, index) => /* @__PURE__ */ React__default.createElement(Tooltip.Tooltip.Floating, {
|
|
93
93
|
label: section.tooltip,
|
|
94
|
-
disabled: !section.tooltip
|
|
94
|
+
disabled: !section.tooltip,
|
|
95
|
+
key: index
|
|
95
96
|
}, /* @__PURE__ */ React__default.createElement(Box.Box, {
|
|
96
|
-
key: index,
|
|
97
97
|
className: classes.bar,
|
|
98
98
|
sx: {
|
|
99
99
|
width: `${section.value}%`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","sources":["../../src/Progress/Progress.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineNumberSize,\n MantineColor,\n Selectors,\n useComponentDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport { Text } from '../Text';\nimport { Tooltip } from '../Tooltip';\nimport useStyles, { ProgressStylesParams } from './Progress.styles';\n\nexport type ProgressStylesNames = Selectors<typeof useStyles>;\n\ninterface ProgressSection {\n value: number;\n color: MantineColor;\n label?: string;\n tooltip?: React.ReactNode;\n}\n\nexport interface ProgressProps\n extends DefaultProps<ProgressStylesNames, ProgressStylesParams>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Percent of filled bar (0-100) */\n value?: number;\n\n /** Progress color from theme */\n color?: MantineColor;\n\n /** Predefined progress height or number for height in px */\n size?: MantineNumberSize;\n\n /** Predefined progress radius from theme.radius or number for height in px */\n radius?: MantineNumberSize;\n\n /** Adds stripes */\n striped?: boolean;\n\n /** Whether to animate striped progress bars */\n animate?: boolean;\n\n /** Text to be placed inside the progress bar */\n label?: string;\n\n /** Replaces value if present, renders multiple sections instead of single one */\n sections?: ProgressSection[];\n}\n\nfunction getCumulativeSections(\n sections: ProgressSection[]\n): (ProgressSection & { accumulated: number })[] {\n return sections.reduce(\n (acc, section) => {\n acc.sections.push({ ...section, accumulated: acc.accumulated });\n acc.accumulated += section.value;\n return acc;\n },\n { accumulated: 0, sections: [] }\n ).sections;\n}\n\nconst defaultProps: Partial<ProgressProps> = {\n size: 'md',\n radius: 'sm',\n striped: false,\n animate: false,\n label: '',\n};\n\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>((props, ref) => {\n const {\n className,\n value,\n color,\n size,\n radius,\n striped,\n animate,\n label,\n 'aria-label': ariaLabel,\n classNames,\n styles,\n sections,\n unstyled,\n ...others\n } = useComponentDefaultProps('Progress', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { color, size, radius, striped: striped || animate, animate },\n { classNames, styles, unstyled, name: 'Progress' }\n );\n\n const segments = Array.isArray(sections)\n ? getCumulativeSections(sections).map((section, index) => (\n <Tooltip.Floating label={section.tooltip} disabled={!section.tooltip}>\n <Box\n
|
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../../src/Progress/Progress.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineNumberSize,\n MantineColor,\n Selectors,\n useComponentDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport { Text } from '../Text';\nimport { Tooltip } from '../Tooltip';\nimport useStyles, { ProgressStylesParams } from './Progress.styles';\n\nexport type ProgressStylesNames = Selectors<typeof useStyles>;\n\ninterface ProgressSection {\n value: number;\n color: MantineColor;\n label?: string;\n tooltip?: React.ReactNode;\n}\n\nexport interface ProgressProps\n extends DefaultProps<ProgressStylesNames, ProgressStylesParams>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Percent of filled bar (0-100) */\n value?: number;\n\n /** Progress color from theme */\n color?: MantineColor;\n\n /** Predefined progress height or number for height in px */\n size?: MantineNumberSize;\n\n /** Predefined progress radius from theme.radius or number for height in px */\n radius?: MantineNumberSize;\n\n /** Adds stripes */\n striped?: boolean;\n\n /** Whether to animate striped progress bars */\n animate?: boolean;\n\n /** Text to be placed inside the progress bar */\n label?: string;\n\n /** Replaces value if present, renders multiple sections instead of single one */\n sections?: ProgressSection[];\n}\n\nfunction getCumulativeSections(\n sections: ProgressSection[]\n): (ProgressSection & { accumulated: number })[] {\n return sections.reduce(\n (acc, section) => {\n acc.sections.push({ ...section, accumulated: acc.accumulated });\n acc.accumulated += section.value;\n return acc;\n },\n { accumulated: 0, sections: [] }\n ).sections;\n}\n\nconst defaultProps: Partial<ProgressProps> = {\n size: 'md',\n radius: 'sm',\n striped: false,\n animate: false,\n label: '',\n};\n\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>((props, ref) => {\n const {\n className,\n value,\n color,\n size,\n radius,\n striped,\n animate,\n label,\n 'aria-label': ariaLabel,\n classNames,\n styles,\n sections,\n unstyled,\n ...others\n } = useComponentDefaultProps('Progress', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { color, size, radius, striped: striped || animate, animate },\n { classNames, styles, unstyled, name: 'Progress' }\n );\n\n const segments = Array.isArray(sections)\n ? getCumulativeSections(sections).map((section, index) => (\n <Tooltip.Floating label={section.tooltip} disabled={!section.tooltip} key={index}>\n <Box\n className={classes.bar}\n sx={{\n width: `${section.value}%`,\n left: `${section.accumulated}%`,\n backgroundColor: theme.fn.variant({\n variant: 'filled',\n primaryFallback: false,\n color: section.color || theme.primaryColor,\n }).background,\n }}\n >\n {section.label && <Text className={classes.label}>{section.label}</Text>}\n </Box>\n </Tooltip.Floating>\n ))\n : null;\n\n return (\n <Box className={cx(classes.root, className)} ref={ref} {...others}>\n {segments || (\n <div\n role=\"progressbar\"\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={value}\n aria-label={ariaLabel}\n className={classes.bar}\n style={{ width: `${value}%` }}\n >\n {label ? <Text className={classes.label}>{label}</Text> : ''}\n </div>\n )}\n </Box>\n );\n});\n\nProgress.displayName = '@mantine/core/Progress';\n"],"names":["forwardRef","useComponentDefaultProps","styles","useStyles","React","Tooltip","Box","Text"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CA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Aa,CAACE,OAAG,EAAE,cAAc,CAAC;AACjE,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AAC1C,IAAI,GAAG;AACP,GAAG,EAAE,MAAM,CAAC,EAAE,QAAQ,oBAAoBF,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AACrE,IAAI,IAAI,EAAE,aAAa;AACvB,IAAI,eAAe,EAAE,GAAG;AACxB,IAAI,eAAe,EAAE,CAAC;AACtB,IAAI,eAAe,EAAE,KAAK;AAC1B,IAAI,YAAY,EAAE,SAAS;AAC3B,IAAI,SAAS,EAAE,OAAO,CAAC,GAAG;AAC1B,IAAI,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;AACjC,GAAG,EAAE,KAAK,mBAAmBA,cAAK,CAAC,aAAa,CAACG,SAAI,EAAE;AACvD,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACnB,CAAC,EAAE;AACH,QAAQ,CAAC,WAAW,GAAG,wBAAwB;;;;"}
|
package/esm/Progress/Progress.js
CHANGED
|
@@ -83,9 +83,9 @@ const Progress = forwardRef((props, ref) => {
|
|
|
83
83
|
const { classes, cx, theme } = useStyles({ color, size, radius, striped: striped || animate, animate }, { classNames, styles, unstyled, name: "Progress" });
|
|
84
84
|
const segments = Array.isArray(sections) ? getCumulativeSections(sections).map((section, index) => /* @__PURE__ */ React.createElement(Tooltip.Floating, {
|
|
85
85
|
label: section.tooltip,
|
|
86
|
-
disabled: !section.tooltip
|
|
86
|
+
disabled: !section.tooltip,
|
|
87
|
+
key: index
|
|
87
88
|
}, /* @__PURE__ */ React.createElement(Box, {
|
|
88
|
-
key: index,
|
|
89
89
|
className: classes.bar,
|
|
90
90
|
sx: {
|
|
91
91
|
width: `${section.value}%`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","sources":["../../src/Progress/Progress.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineNumberSize,\n MantineColor,\n Selectors,\n useComponentDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport { Text } from '../Text';\nimport { Tooltip } from '../Tooltip';\nimport useStyles, { ProgressStylesParams } from './Progress.styles';\n\nexport type ProgressStylesNames = Selectors<typeof useStyles>;\n\ninterface ProgressSection {\n value: number;\n color: MantineColor;\n label?: string;\n tooltip?: React.ReactNode;\n}\n\nexport interface ProgressProps\n extends DefaultProps<ProgressStylesNames, ProgressStylesParams>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Percent of filled bar (0-100) */\n value?: number;\n\n /** Progress color from theme */\n color?: MantineColor;\n\n /** Predefined progress height or number for height in px */\n size?: MantineNumberSize;\n\n /** Predefined progress radius from theme.radius or number for height in px */\n radius?: MantineNumberSize;\n\n /** Adds stripes */\n striped?: boolean;\n\n /** Whether to animate striped progress bars */\n animate?: boolean;\n\n /** Text to be placed inside the progress bar */\n label?: string;\n\n /** Replaces value if present, renders multiple sections instead of single one */\n sections?: ProgressSection[];\n}\n\nfunction getCumulativeSections(\n sections: ProgressSection[]\n): (ProgressSection & { accumulated: number })[] {\n return sections.reduce(\n (acc, section) => {\n acc.sections.push({ ...section, accumulated: acc.accumulated });\n acc.accumulated += section.value;\n return acc;\n },\n { accumulated: 0, sections: [] }\n ).sections;\n}\n\nconst defaultProps: Partial<ProgressProps> = {\n size: 'md',\n radius: 'sm',\n striped: false,\n animate: false,\n label: '',\n};\n\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>((props, ref) => {\n const {\n className,\n value,\n color,\n size,\n radius,\n striped,\n animate,\n label,\n 'aria-label': ariaLabel,\n classNames,\n styles,\n sections,\n unstyled,\n ...others\n } = useComponentDefaultProps('Progress', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { color, size, radius, striped: striped || animate, animate },\n { classNames, styles, unstyled, name: 'Progress' }\n );\n\n const segments = Array.isArray(sections)\n ? getCumulativeSections(sections).map((section, index) => (\n <Tooltip.Floating label={section.tooltip} disabled={!section.tooltip}>\n <Box\n
|
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../../src/Progress/Progress.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineNumberSize,\n MantineColor,\n Selectors,\n useComponentDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport { Text } from '../Text';\nimport { Tooltip } from '../Tooltip';\nimport useStyles, { ProgressStylesParams } from './Progress.styles';\n\nexport type ProgressStylesNames = Selectors<typeof useStyles>;\n\ninterface ProgressSection {\n value: number;\n color: MantineColor;\n label?: string;\n tooltip?: React.ReactNode;\n}\n\nexport interface ProgressProps\n extends DefaultProps<ProgressStylesNames, ProgressStylesParams>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Percent of filled bar (0-100) */\n value?: number;\n\n /** Progress color from theme */\n color?: MantineColor;\n\n /** Predefined progress height or number for height in px */\n size?: MantineNumberSize;\n\n /** Predefined progress radius from theme.radius or number for height in px */\n radius?: MantineNumberSize;\n\n /** Adds stripes */\n striped?: boolean;\n\n /** Whether to animate striped progress bars */\n animate?: boolean;\n\n /** Text to be placed inside the progress bar */\n label?: string;\n\n /** Replaces value if present, renders multiple sections instead of single one */\n sections?: ProgressSection[];\n}\n\nfunction getCumulativeSections(\n sections: ProgressSection[]\n): (ProgressSection & { accumulated: number })[] {\n return sections.reduce(\n (acc, section) => {\n acc.sections.push({ ...section, accumulated: acc.accumulated });\n acc.accumulated += section.value;\n return acc;\n },\n { accumulated: 0, sections: [] }\n ).sections;\n}\n\nconst defaultProps: Partial<ProgressProps> = {\n size: 'md',\n radius: 'sm',\n striped: false,\n animate: false,\n label: '',\n};\n\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>((props, ref) => {\n const {\n className,\n value,\n color,\n size,\n radius,\n striped,\n animate,\n label,\n 'aria-label': ariaLabel,\n classNames,\n styles,\n sections,\n unstyled,\n ...others\n } = useComponentDefaultProps('Progress', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { color, size, radius, striped: striped || animate, animate },\n { classNames, styles, unstyled, name: 'Progress' }\n );\n\n const segments = Array.isArray(sections)\n ? getCumulativeSections(sections).map((section, index) => (\n <Tooltip.Floating label={section.tooltip} disabled={!section.tooltip} key={index}>\n <Box\n className={classes.bar}\n sx={{\n width: `${section.value}%`,\n left: `${section.accumulated}%`,\n backgroundColor: theme.fn.variant({\n variant: 'filled',\n primaryFallback: false,\n color: section.color || theme.primaryColor,\n }).background,\n }}\n >\n {section.label && <Text className={classes.label}>{section.label}</Text>}\n </Box>\n </Tooltip.Floating>\n ))\n : null;\n\n return (\n <Box className={cx(classes.root, className)} ref={ref} {...others}>\n {segments || (\n <div\n role=\"progressbar\"\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={value}\n aria-label={ariaLabel}\n className={classes.bar}\n style={{ width: `${value}%` }}\n >\n {label ? <Text className={classes.label}>{label}</Text> : ''}\n </div>\n )}\n </Box>\n );\n});\n\nProgress.displayName = '@mantine/core/Progress';\n"],"names":[],"mappings":";;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE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AAwB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../src/Progress/Progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EAEV,MAAM,iBAAiB,CAAC;AAIzB,OAAO,SAAS,EAAE,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,oBAAY,mBAAmB,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;AAE9D,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,aACf,SAAQ,YAAY,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,EAC7D,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACvC,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,gCAAgC;IAChC,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,iBAAiB,CAAC;IAEzB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,mBAAmB;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,iFAAiF;IACjF,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B;AAuBD,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../src/Progress/Progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EAEV,MAAM,iBAAiB,CAAC;AAIzB,OAAO,SAAS,EAAE,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,oBAAY,mBAAmB,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;AAE9D,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,aACf,SAAQ,YAAY,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,EAC7D,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACvC,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,gCAAgC;IAChC,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,iBAAiB,CAAC;IAEzB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,mBAAmB;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,iFAAiF;IACjF,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B;AAuBD,eAAO,MAAM,QAAQ,sFA6DnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/core",
|
|
3
3
|
"description": "React components library focused on usability, accessibility and developer experience",
|
|
4
|
-
"version": "5.2.0
|
|
4
|
+
"version": "5.2.0",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"emotion"
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@mantine/hooks": "5.2.0
|
|
30
|
+
"@mantine/hooks": "5.2.0",
|
|
31
31
|
"react": ">=16.8.0",
|
|
32
32
|
"react-dom": ">=16.8.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@mantine/utils": "5.2.0
|
|
36
|
-
"@mantine/styles": "5.2.0
|
|
35
|
+
"@mantine/utils": "5.2.0",
|
|
36
|
+
"@mantine/styles": "5.2.0",
|
|
37
37
|
"@radix-ui/react-scroll-area": "1.0.0",
|
|
38
38
|
"react-textarea-autosize": "8.3.4",
|
|
39
39
|
"@floating-ui/react-dom-interactions": "0.6.6"
|