@mantine/core 5.0.0-alpha.15 → 5.0.0-alpha.16
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/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/cjs/components/HoverCard/HoverCardTarget/HoverCardTarget.js +2 -3
- package/cjs/components/HoverCard/HoverCardTarget/HoverCardTarget.js.map +1 -1
- package/cjs/components/Menu/MenuTarget/MenuTarget.js +4 -5
- package/cjs/components/Menu/MenuTarget/MenuTarget.js.map +1 -1
- package/cjs/components/Popover/PopoverTarget/PopoverTarget.js +2 -3
- package/cjs/components/Popover/PopoverTarget/PopoverTarget.js.map +1 -1
- package/cjs/components/Tooltip/Tooltip.js +2 -3
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/components/Tooltip/TooltipFloating/TooltipFloating.js +4 -5
- package/cjs/components/Tooltip/TooltipFloating/TooltipFloating.js.map +1 -1
- package/esm/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/esm/components/HoverCard/HoverCardTarget/HoverCardTarget.js +2 -3
- package/esm/components/HoverCard/HoverCardTarget/HoverCardTarget.js.map +1 -1
- package/esm/components/Menu/MenuTarget/MenuTarget.js +4 -5
- package/esm/components/Menu/MenuTarget/MenuTarget.js.map +1 -1
- package/esm/components/Popover/PopoverTarget/PopoverTarget.js +2 -3
- package/esm/components/Popover/PopoverTarget/PopoverTarget.js.map +1 -1
- package/esm/components/Tooltip/Tooltip.js +2 -3
- package/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/esm/components/Tooltip/TooltipFloating/TooltipFloating.js +4 -5
- package/esm/components/Tooltip/TooltipFloating/TooltipFloating.js.map +1 -1
- package/lib/components/AppShell/HorizontalSection/HorizontalSection.d.ts +1 -1
- package/lib/components/Button/Button.styles.d.ts +2 -2
- package/lib/components/HoverCard/HoverCardTarget/HoverCardTarget.d.ts.map +1 -1
- package/lib/components/Input/use-input-props.d.ts +1 -1
- package/lib/components/Menu/MenuTarget/MenuTarget.d.ts.map +1 -1
- package/lib/components/MultiSelect/MultiSelect.styles.d.ts +2 -2
- package/lib/components/Popover/PopoverTarget/PopoverTarget.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/TooltipFloating/TooltipFloating.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { DefaultProps, Selectors, useComponentDefaultProps } from '@mantine/styles';\nimport { isElement } from '@mantine/utils';\nimport { Text } from '../Text';\nimport { Box } from '../Box';\nimport useStyles from './Breadcrumbs.styles';\n\nexport type BreadcrumbsStylesNames = Selectors<typeof useStyles>;\n\nexport interface BreadcrumbsProps\n extends DefaultProps<BreadcrumbsStylesNames>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Separator between breadcrumbs */\n separator?: React.ReactNode;\n\n /** React nodes that should be separated */\n children: React.ReactNode;\n}\n\nconst defaultProps: Partial<BreadcrumbsProps> = {\n separator: '/',\n};\n\nexport const Breadcrumbs = forwardRef<HTMLDivElement, BreadcrumbsProps>(\n (props: BreadcrumbsProps, ref) => {\n const { className, children, separator, classNames, styles, unstyled, ...others } =\n useComponentDefaultProps('Breadcrumbs', defaultProps, props);\n\n const { classes, cx } = useStyles(null, { classNames, styles, unstyled, name: 'Breadcrumbs' });\n\n const items = React.Children.toArray(children).reduce(\n (acc
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { DefaultProps, Selectors, useComponentDefaultProps } from '@mantine/styles';\nimport { isElement } from '@mantine/utils';\nimport { Text } from '../Text';\nimport { Box } from '../Box';\nimport useStyles from './Breadcrumbs.styles';\n\nexport type BreadcrumbsStylesNames = Selectors<typeof useStyles>;\n\nexport interface BreadcrumbsProps\n extends DefaultProps<BreadcrumbsStylesNames>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Separator between breadcrumbs */\n separator?: React.ReactNode;\n\n /** React nodes that should be separated */\n children: React.ReactNode;\n}\n\nconst defaultProps: Partial<BreadcrumbsProps> = {\n separator: '/',\n};\n\nexport const Breadcrumbs = forwardRef<HTMLDivElement, BreadcrumbsProps>(\n (props: BreadcrumbsProps, ref) => {\n const { className, children, separator, classNames, styles, unstyled, ...others } =\n useComponentDefaultProps('Breadcrumbs', defaultProps, props);\n\n const { classes, cx } = useStyles(null, { classNames, styles, unstyled, name: 'Breadcrumbs' });\n\n const items = React.Children.toArray(children).reduce<React.ReactNode[]>(\n (acc, child, index, array) => {\n const item = isElement(child) ? (\n React.cloneElement(child, {\n className: cx(classes.breadcrumb, child.props?.className),\n key: index,\n })\n ) : (\n <div className={classes.breadcrumb} key={index}>\n {child}\n </div>\n );\n\n acc.push(item);\n\n if (index !== array.length - 1) {\n acc.push(\n <Text size=\"sm\" className={classes.separator} key={`separator-${index}`}>\n {separator}\n </Text>\n );\n }\n\n return acc;\n },\n []\n );\n\n return (\n <Box className={cx(classes.root, className)} ref={ref} {...others}>\n {items}\n </Box>\n );\n }\n);\n\nBreadcrumbs.displayName = '@mantine/core/Breadcrumbs';\n"],"names":["forwardRef","useComponentDefaultProps","styles","useStyles","React","isElement","Text","Box"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,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,SAA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K,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC;AAC7F,MAAM,GAAG,EAAE,KAAK;AAChB,KAAK,CAAC,mBAAmBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AACpD,MAAM,SAAS,EAAE,OAAO,CAAC,UAAU;AACnC,MAAM,GAAG,EAAE,KAAK;AAChB,KAAK,EAAE,KAAK,CAAC,CAAC;AACd,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnB,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AACpC,MAAM,GAAG,CAAC,IAAI,iBAAiBA,cAAK,CAAC,aAAa,CAACE,SAAI,EAAE;AACzD,QAAQ,IAAI,EAAE,IAAI;AAClB,QAAQ,SAAS,EAAE,OAAO,CAAC,SAAS;AACpC,QAAQ,GAAG,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACjC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,GAAG,CAAC;AACf,GAAG,EAAE,EAAE,CAAC,CAAC;AACT,EAAE,uBAAuBF,cAAK,CAAC,aAAa,CAACG,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,KAAK,CAAC,CAAC;AACrB,CAAC,EAAE;AACH,WAAW,CAAC,WAAW,GAAG,2BAA2B;;;;"}
|
|
@@ -17,9 +17,8 @@ function HoverCardTarget({ children, refProp }) {
|
|
|
17
17
|
throw new Error(HoverCard_errors.HOVER_CARD_ERRORS.children);
|
|
18
18
|
}
|
|
19
19
|
const ctx = HoverCard_context.useHoverCardContext();
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const onMouseLeave = utils.createEventHandler(target.props.onMouseLeave, ctx.closeDropdown);
|
|
20
|
+
const onMouseEnter = utils.createEventHandler(children.props.onMouseEnter, ctx.openDropdown);
|
|
21
|
+
const onMouseLeave = utils.createEventHandler(children.props.onMouseLeave, ctx.closeDropdown);
|
|
23
22
|
return /* @__PURE__ */ React__default.createElement(Popover.Popover.Target, {
|
|
24
23
|
refProp
|
|
25
24
|
}, React.cloneElement(children, { onMouseEnter, onMouseLeave }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCardTarget.js","sources":["../../../../src/components/HoverCard/HoverCardTarget/HoverCardTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement, createEventHandler } from '@mantine/utils';\nimport { Popover, PopoverTargetProps } from '../../Popover';\nimport { useHoverCardContext } from '../HoverCard.context';\nimport { HOVER_CARD_ERRORS } from '../HoverCard.errors';\n\nexport interface HoverCardTargetProps extends PopoverTargetProps {}\n\nexport function HoverCardTarget({ children, refProp }: HoverCardTargetProps) {\n if (!isElement(children)) {\n throw new Error(HOVER_CARD_ERRORS.children);\n }\n\n const ctx = useHoverCardContext();\n const
|
|
1
|
+
{"version":3,"file":"HoverCardTarget.js","sources":["../../../../src/components/HoverCard/HoverCardTarget/HoverCardTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement, createEventHandler } from '@mantine/utils';\nimport { Popover, PopoverTargetProps } from '../../Popover';\nimport { useHoverCardContext } from '../HoverCard.context';\nimport { HOVER_CARD_ERRORS } from '../HoverCard.errors';\n\nexport interface HoverCardTargetProps extends PopoverTargetProps {}\n\nexport function HoverCardTarget({ children, refProp }: HoverCardTargetProps) {\n if (!isElement(children)) {\n throw new Error(HOVER_CARD_ERRORS.children);\n }\n\n const ctx = useHoverCardContext();\n const onMouseEnter = createEventHandler(children.props.onMouseEnter, ctx.openDropdown);\n const onMouseLeave = createEventHandler(children.props.onMouseLeave, ctx.closeDropdown);\n\n return (\n <Popover.Target refProp={refProp}>\n {cloneElement(children as React.ReactElement, { onMouseEnter, onMouseLeave })}\n </Popover.Target>\n );\n}\n\nHoverCardTarget.displayName = '@mantine/core/HoverCardTarget';\n"],"names":["isElement","HOVER_CARD_ERRORS","useHoverCardContext","createEventHandler","React","Popover","cloneElement"],"mappings":";;;;;;;;;;;;;;AAKO,SAAS,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;AACvD,EAAE,IAAI,CAACA,eAAS,CAAC,QAAQ,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,KAAK,CAACC,kCAAiB,CAAC,QAAQ,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,MAAM,GAAG,GAAGC,qCAAmB,EAAE,CAAC;AACpC,EAAE,MAAM,YAAY,GAAGC,wBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;AACzF,EAAE,MAAM,YAAY,GAAGA,wBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;AAC1F,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAACC,eAAO,CAAC,MAAM,EAAE;AAC7D,IAAI,OAAO;AACX,GAAG,EAAEC,kBAAY,CAAC,QAAQ,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AACD,eAAe,CAAC,WAAW,GAAG,+BAA+B;;;;"}
|
|
@@ -17,14 +17,13 @@ function MenuTarget({ children, refProp = "ref" }) {
|
|
|
17
17
|
throw new Error(Menu_errors.MENU_ERRORS.children);
|
|
18
18
|
}
|
|
19
19
|
const ctx = Menu_context.useMenuContext();
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const onMouseLeave = utils.createEventHandler(target.props.onMouseLeave, () => ctx.trigger === "hover" && ctx.closeDropdown());
|
|
20
|
+
const onClick = utils.createEventHandler(children.props.onClick, () => ctx.trigger === "click" && ctx.toggleDropdown());
|
|
21
|
+
const onMouseEnter = utils.createEventHandler(children.props.onMouseEnter, () => ctx.trigger === "hover" && ctx.openDropdown());
|
|
22
|
+
const onMouseLeave = utils.createEventHandler(children.props.onMouseLeave, () => ctx.trigger === "hover" && ctx.closeDropdown());
|
|
24
23
|
return /* @__PURE__ */ React__default.createElement(Popover.Popover.Target, {
|
|
25
24
|
refProp,
|
|
26
25
|
popupType: "menu"
|
|
27
|
-
}, React.cloneElement(
|
|
26
|
+
}, React.cloneElement(children, {
|
|
28
27
|
onClick,
|
|
29
28
|
onMouseEnter,
|
|
30
29
|
onMouseLeave,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuTarget.js","sources":["../../../../src/components/Menu/MenuTarget/MenuTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement, createEventHandler } from '@mantine/utils';\nimport { useMenuContext } from '../Menu.context';\nimport { Popover } from '../../Popover';\nimport { MENU_ERRORS } from '../Menu.errors';\n\nexport interface MenuTargetProps {\n /** Target element */\n children: React.ReactNode;\n\n /** Key of the prop that should be used to get element ref */\n refProp?: string;\n}\n\nexport function MenuTarget({ children, refProp = 'ref' }: MenuTargetProps) {\n if (!isElement(children)) {\n throw new Error(MENU_ERRORS.children);\n }\n\n const ctx = useMenuContext();\n
|
|
1
|
+
{"version":3,"file":"MenuTarget.js","sources":["../../../../src/components/Menu/MenuTarget/MenuTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement, createEventHandler } from '@mantine/utils';\nimport { useMenuContext } from '../Menu.context';\nimport { Popover } from '../../Popover';\nimport { MENU_ERRORS } from '../Menu.errors';\n\nexport interface MenuTargetProps {\n /** Target element */\n children: React.ReactNode;\n\n /** Key of the prop that should be used to get element ref */\n refProp?: string;\n}\n\nexport function MenuTarget({ children, refProp = 'ref' }: MenuTargetProps) {\n if (!isElement(children)) {\n throw new Error(MENU_ERRORS.children);\n }\n\n const ctx = useMenuContext();\n\n const onClick = createEventHandler(\n children.props.onClick,\n () => ctx.trigger === 'click' && ctx.toggleDropdown()\n );\n\n const onMouseEnter = createEventHandler(\n children.props.onMouseEnter,\n () => ctx.trigger === 'hover' && ctx.openDropdown()\n );\n\n const onMouseLeave = createEventHandler(\n children.props.onMouseLeave,\n () => ctx.trigger === 'hover' && ctx.closeDropdown()\n );\n\n return (\n <Popover.Target refProp={refProp} popupType=\"menu\">\n {cloneElement(children, {\n onClick,\n onMouseEnter,\n onMouseLeave,\n 'data-expanded': ctx.opened ? true : undefined,\n })}\n </Popover.Target>\n );\n}\n\nMenuTarget.displayName = '@mantine/core/MenuTarget';\n"],"names":["isElement","MENU_ERRORS","useMenuContext","createEventHandler","React","Popover","cloneElement"],"mappings":";;;;;;;;;;;;;;AAKO,SAAS,UAAU,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,EAAE,EAAE;AAC1D,EAAE,IAAI,CAACA,eAAS,CAAC,QAAQ,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,KAAK,CAACC,uBAAW,CAAC,QAAQ,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,MAAM,GAAG,GAAGC,2BAAc,EAAE,CAAC;AAC/B,EAAE,MAAM,OAAO,GAAGC,wBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,OAAO,KAAK,OAAO,IAAI,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;AACpH,EAAE,MAAM,YAAY,GAAGA,wBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,OAAO,KAAK,OAAO,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;AAC5H,EAAE,MAAM,YAAY,GAAGA,wBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,OAAO,KAAK,OAAO,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC;AAC7H,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAACC,eAAO,CAAC,MAAM,EAAE;AAC7D,IAAI,OAAO;AACX,IAAI,SAAS,EAAE,MAAM;AACrB,GAAG,EAAEC,kBAAY,CAAC,QAAQ,EAAE;AAC5B,IAAI,OAAO;AACX,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,eAAe,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC;AAC/C,GAAG,CAAC,CAAC,CAAC;AACN,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,0BAA0B;;;;"}
|
|
@@ -36,15 +36,14 @@ function PopoverTarget({
|
|
|
36
36
|
throw new Error(Popover_errors.POPOVER_ERRORS.children);
|
|
37
37
|
}
|
|
38
38
|
const ctx = Popover_context.usePopoverContext();
|
|
39
|
-
const
|
|
40
|
-
const targetRef = hooks.useMergedRef(ctx.reference, target.ref);
|
|
39
|
+
const targetRef = hooks.useMergedRef(ctx.reference, children.ref);
|
|
41
40
|
const accessibleProps = ctx.withRoles ? {
|
|
42
41
|
"aria-haspopup": popupType,
|
|
43
42
|
"aria-expanded": ctx.opened,
|
|
44
43
|
"aria-controls": ctx.getDropdownId(),
|
|
45
44
|
id: ctx.getTargetId()
|
|
46
45
|
} : {};
|
|
47
|
-
return React.cloneElement(
|
|
46
|
+
return React.cloneElement(children, __spreadValues(__spreadProps(__spreadValues(__spreadValues({}, accessibleProps), ctx.targetProps), {
|
|
48
47
|
[refProp]: targetRef
|
|
49
48
|
}), !ctx.controlled ? { onClick: ctx.onToggle } : null));
|
|
50
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverTarget.js","sources":["../../../../src/components/Popover/PopoverTarget/PopoverTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport { isElement } from '@mantine/utils';\nimport { usePopoverContext } from '../Popover.context';\nimport { POPOVER_ERRORS } from '../Popover.errors';\n\nexport interface PopoverTargetProps {\n /** Target element */\n children: React.ReactNode;\n\n /** Key of the prop that should be used to get element ref */\n refProp?: string;\n\n /** Popup accessible type, 'dialog' by default */\n popupType?: string;\n}\n\nexport function PopoverTarget({\n children,\n refProp = 'ref',\n popupType = 'dialog',\n}: PopoverTargetProps) {\n if (!isElement(children)) {\n throw new Error(POPOVER_ERRORS.children);\n }\n\n const ctx = usePopoverContext();\n const
|
|
1
|
+
{"version":3,"file":"PopoverTarget.js","sources":["../../../../src/components/Popover/PopoverTarget/PopoverTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport { isElement } from '@mantine/utils';\nimport { usePopoverContext } from '../Popover.context';\nimport { POPOVER_ERRORS } from '../Popover.errors';\n\nexport interface PopoverTargetProps {\n /** Target element */\n children: React.ReactNode;\n\n /** Key of the prop that should be used to get element ref */\n refProp?: string;\n\n /** Popup accessible type, 'dialog' by default */\n popupType?: string;\n}\n\nexport function PopoverTarget({\n children,\n refProp = 'ref',\n popupType = 'dialog',\n}: PopoverTargetProps) {\n if (!isElement(children)) {\n throw new Error(POPOVER_ERRORS.children);\n }\n\n const ctx = usePopoverContext();\n const targetRef = useMergedRef(ctx.reference, (children as any).ref);\n\n const accessibleProps = ctx.withRoles\n ? {\n 'aria-haspopup': popupType,\n 'aria-expanded': ctx.opened,\n 'aria-controls': ctx.getDropdownId(),\n id: ctx.getTargetId(),\n }\n : {};\n\n return cloneElement(children, {\n ...accessibleProps,\n ...ctx.targetProps,\n [refProp]: targetRef,\n ...(!ctx.controlled ? { onClick: ctx.onToggle } : null),\n });\n}\n\nPopoverTarget.displayName = '@mantine/core/PopoverTarget';\n"],"names":["isElement","POPOVER_ERRORS","usePopoverContext","useMergedRef","cloneElement"],"mappings":";;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAA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,KAAK;AACjB,EAAE,SAAS,GAAG,QAAQ;AACtB,CAAC,EAAE;AACH,EAAE,IAAI,CAACA,eAAS,CAAC,QAAQ,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,KAAK,CAACC,6BAAc,CAAC,QAAQ,CAAC,CAAC;AAC7C,GAAG;AACH,EAAE,MAAM,GAAG,GAAGC,iCAAiB,EAAE,CAAC;AAClC,EAAE,MAAM,SAAS,GAAGC,kBAAY,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9D,EAAE,MAAM,eAAe,GAAG,GAAG,CAAC,SAAS,GAAG;AAC1C,IAAI,eAAe,EAAE,SAAS;AAC9B,IAAI,eAAe,EAAE,GAAG,CAAC,MAAM;AAC/B,IAAI,eAAe,EAAE,GAAG,CAAC,aAAa,EAAE;AACxC,IAAI,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE;AACzB,GAAG,GAAG,EAAE,CAAC;AACT,EAAE,OAAOC,kBAAY,CAAC,QAAQ,EAAE,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,eAAe,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,EAAE;AACnI,IAAI,CAAC,OAAO,GAAG,SAAS;AACxB,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;AAC3D,CAAC;AACD,aAAa,CAAC,WAAW,GAAG,6BAA6B;;;;"}
|
|
@@ -140,8 +140,7 @@ function Tooltip(props) {
|
|
|
140
140
|
if (!utils.isElement(children)) {
|
|
141
141
|
throw new Error(Tooltip_errors.TOOLTIP_ERRORS.children);
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
const targetRef = hooks.useMergedRef(tooltip.reference, target.ref);
|
|
143
|
+
const targetRef = hooks.useMergedRef(tooltip.reference, children.ref);
|
|
145
144
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(OptionalPortal.OptionalPortal, {
|
|
146
145
|
withinPortal
|
|
147
146
|
}, /* @__PURE__ */ React__default.createElement(Transition.Transition, {
|
|
@@ -166,7 +165,7 @@ function Tooltip(props) {
|
|
|
166
165
|
arrowOffset,
|
|
167
166
|
className: classes.arrow
|
|
168
167
|
}));
|
|
169
|
-
})), React.cloneElement(
|
|
168
|
+
})), React.cloneElement(children, tooltip.getReferenceProps(__spreadValues({ [refProp]: targetRef }, children.props))));
|
|
170
169
|
}
|
|
171
170
|
Tooltip.Group = TooltipGroup.TooltipGroup;
|
|
172
171
|
Tooltip.Floating = TooltipFloating.TooltipFloating;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '@mantine/utils';\nimport { useMergedRef } from '@mantine/hooks';\nimport { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles';\nimport { TooltipGroup } from './TooltipGroup/TooltipGroup';\nimport { TooltipFloating } from './TooltipFloating/TooltipFloating';\nimport { useTooltip } from './use-tooltip';\nimport { FloatingArrow, getFloatingPosition, FloatingPosition } from '../Floating';\nimport { MantineTransition, Transition } from '../Transition';\nimport { OptionalPortal } from '../Portal';\nimport { Box } from '../Box';\nimport { TOOLTIP_ERRORS } from './Tooltip.errors';\nimport { TooltipBaseProps } from './Tooltip.types';\nimport useStyles from './Tooltip.styles';\n\nexport interface TooltipProps extends TooltipBaseProps {\n /** Called when tooltip position changes */\n onPositionChange?(position: FloatingPosition): void;\n\n /** Open delay in ms */\n openDelay?: number;\n\n /** Close delay in ms */\n closeDelay?: number;\n\n /** Controls opened state */\n opened?: boolean;\n\n /** Space between target element and tooltip in px */\n offset?: number;\n\n /** Determines whether component should have an arrow */\n withArrow?: boolean;\n\n /** Arrow size in px */\n arrowSize?: number;\n\n /** Arrow offset in px */\n arrowOffset?: number;\n\n /** One of premade transitions ot transition object */\n transition?: MantineTransition;\n\n /** Transition duration in ms */\n transitionDuration?: number;\n\n /** Determines which events will be used to show tooltip */\n events?: { hover: boolean; focus: boolean; touch: boolean };\n\n /** useEffect dependencies to force update tooltip position */\n positionDependencies?: any[];\n}\n\nconst defaultProps: Partial<TooltipProps> = {\n position: 'top',\n refProp: 'ref',\n withinPortal: false,\n arrowSize: 4,\n arrowOffset: 5,\n offset: 5,\n transition: 'fade',\n transitionDuration: 100,\n width: 'auto',\n events: { hover: true, focus: false, touch: false },\n zIndex: getDefaultZIndex('popover'),\n positionDependencies: [],\n};\n\nexport function Tooltip(props: TooltipProps) {\n const {\n children,\n position,\n refProp,\n label,\n openDelay,\n closeDelay,\n onPositionChange,\n opened,\n withinPortal,\n radius,\n color,\n classNames,\n styles,\n unstyled,\n style,\n className,\n withArrow,\n arrowSize,\n arrowOffset,\n offset,\n transition,\n transitionDuration,\n multiline,\n width,\n events,\n zIndex,\n disabled,\n positionDependencies,\n ...others\n } = useComponentDefaultProps('Tooltip', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { radius, color, width, multiline },\n { name: 'Tooltip', classNames, styles, unstyled }\n );\n\n const tooltip = useTooltip({\n position: getFloatingPosition(theme.dir, position),\n closeDelay,\n openDelay,\n onPositionChange,\n opened,\n events,\n offset: offset + (withArrow ? arrowSize / 2 : 0),\n positionDependencies: [...positionDependencies, children],\n });\n\n if (!isElement(children)) {\n throw new Error(TOOLTIP_ERRORS.children);\n }\n\n const target = children as React.ReactElement;\n const targetRef = useMergedRef(tooltip.reference, (target as any).ref);\n\n return (\n <>\n <OptionalPortal withinPortal={withinPortal}>\n <Transition\n mounted={!disabled && tooltip.opened}\n transition={transition}\n duration={tooltip.isGroupPhase ? 10 : transitionDuration}\n >\n {(transitionStyles) => (\n <Box\n {...others}\n {...tooltip.getFloatingProps({\n ref: tooltip.floating,\n className: cx(classes.root, className),\n style: {\n ...style,\n ...transitionStyles,\n zIndex,\n top: tooltip.y ?? '',\n left: tooltip.x ?? '',\n },\n })}\n >\n {label}\n\n <FloatingArrow\n visible={withArrow}\n withBorder={false}\n position={tooltip.placement}\n arrowSize={arrowSize}\n arrowOffset={arrowOffset}\n className={classes.arrow}\n />\n </Box>\n )}\n </Transition>\n </OptionalPortal>\n\n {cloneElement(target, tooltip.getReferenceProps({ [refProp]: targetRef, ...target.props }))}\n </>\n );\n}\n\nTooltip.Group = TooltipGroup;\nTooltip.Floating = TooltipFloating;\n\nTooltip.displayName = '@mantine/core/Tooltip';\n"],"names":["getDefaultZIndex","useComponentDefaultProps","styles","useStyles","useTooltip","getFloatingPosition","isElement","TOOLTIP_ERRORS","useMergedRef","React","OptionalPortal","Transition","Box","FloatingArrow","cloneElement","TooltipGroup","TooltipFloating"],"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,IA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AChD,OAAO,CAAC;AACR,KAAK,CAAC,CAAC,EAAE,KAAK,kBAAkBH,cAAK,CAAC,aAAa,CAACI,2BAAa,EAAE;AACnE,MAAM,OAAO,EAAE,SAAS;AACxB,MAAM,UAAU,EAAE,KAAK;AACvB,MAAM,QAAQ,EAAE,OAAO,CAAC,SAAS;AACjC,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,MAAM,SAAS,EAAE,OAAO,CAAC,KAAK;AAC9B,KAAK,CAAC,CAAC,CAAC;AACR,GAAG,CAAC,CAAC,EAAEC,kBAAY,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,GAAG,SAAS,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAChH,CAAC;AACD,OAAO,CAAC,KAAK,GAAGC,yBAAY,CAAC;AAC7B,OAAO,CAAC,QAAQ,GAAGC,+BAAe,CAAC;AACnC,OAAO,CAAC,WAAW,GAAG,uBAAuB;;;;"}
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '@mantine/utils';\nimport { useMergedRef } from '@mantine/hooks';\nimport { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles';\nimport { TooltipGroup } from './TooltipGroup/TooltipGroup';\nimport { TooltipFloating } from './TooltipFloating/TooltipFloating';\nimport { useTooltip } from './use-tooltip';\nimport { FloatingArrow, getFloatingPosition, FloatingPosition } from '../Floating';\nimport { MantineTransition, Transition } from '../Transition';\nimport { OptionalPortal } from '../Portal';\nimport { Box } from '../Box';\nimport { TOOLTIP_ERRORS } from './Tooltip.errors';\nimport { TooltipBaseProps } from './Tooltip.types';\nimport useStyles from './Tooltip.styles';\n\nexport interface TooltipProps extends TooltipBaseProps {\n /** Called when tooltip position changes */\n onPositionChange?(position: FloatingPosition): void;\n\n /** Open delay in ms */\n openDelay?: number;\n\n /** Close delay in ms */\n closeDelay?: number;\n\n /** Controls opened state */\n opened?: boolean;\n\n /** Space between target element and tooltip in px */\n offset?: number;\n\n /** Determines whether component should have an arrow */\n withArrow?: boolean;\n\n /** Arrow size in px */\n arrowSize?: number;\n\n /** Arrow offset in px */\n arrowOffset?: number;\n\n /** One of premade transitions ot transition object */\n transition?: MantineTransition;\n\n /** Transition duration in ms */\n transitionDuration?: number;\n\n /** Determines which events will be used to show tooltip */\n events?: { hover: boolean; focus: boolean; touch: boolean };\n\n /** useEffect dependencies to force update tooltip position */\n positionDependencies?: any[];\n}\n\nconst defaultProps: Partial<TooltipProps> = {\n position: 'top',\n refProp: 'ref',\n withinPortal: false,\n arrowSize: 4,\n arrowOffset: 5,\n offset: 5,\n transition: 'fade',\n transitionDuration: 100,\n width: 'auto',\n events: { hover: true, focus: false, touch: false },\n zIndex: getDefaultZIndex('popover'),\n positionDependencies: [],\n};\n\nexport function Tooltip(props: TooltipProps) {\n const {\n children,\n position,\n refProp,\n label,\n openDelay,\n closeDelay,\n onPositionChange,\n opened,\n withinPortal,\n radius,\n color,\n classNames,\n styles,\n unstyled,\n style,\n className,\n withArrow,\n arrowSize,\n arrowOffset,\n offset,\n transition,\n transitionDuration,\n multiline,\n width,\n events,\n zIndex,\n disabled,\n positionDependencies,\n ...others\n } = useComponentDefaultProps('Tooltip', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { radius, color, width, multiline },\n { name: 'Tooltip', classNames, styles, unstyled }\n );\n\n const tooltip = useTooltip({\n position: getFloatingPosition(theme.dir, position),\n closeDelay,\n openDelay,\n onPositionChange,\n opened,\n events,\n offset: offset + (withArrow ? arrowSize / 2 : 0),\n positionDependencies: [...positionDependencies, children],\n });\n\n if (!isElement(children)) {\n throw new Error(TOOLTIP_ERRORS.children);\n }\n\n const targetRef = useMergedRef(tooltip.reference, (children as any).ref);\n\n return (\n <>\n <OptionalPortal withinPortal={withinPortal}>\n <Transition\n mounted={!disabled && tooltip.opened}\n transition={transition}\n duration={tooltip.isGroupPhase ? 10 : transitionDuration}\n >\n {(transitionStyles) => (\n <Box\n {...others}\n {...tooltip.getFloatingProps({\n ref: tooltip.floating,\n className: cx(classes.root, className),\n style: {\n ...style,\n ...transitionStyles,\n zIndex,\n top: tooltip.y ?? '',\n left: tooltip.x ?? '',\n },\n })}\n >\n {label}\n\n <FloatingArrow\n visible={withArrow}\n withBorder={false}\n position={tooltip.placement}\n arrowSize={arrowSize}\n arrowOffset={arrowOffset}\n className={classes.arrow}\n />\n </Box>\n )}\n </Transition>\n </OptionalPortal>\n\n {cloneElement(\n children,\n tooltip.getReferenceProps({ [refProp]: targetRef, ...children.props })\n )}\n </>\n );\n}\n\nTooltip.Group = TooltipGroup;\nTooltip.Floating = TooltipFloating;\n\nTooltip.displayName = '@mantine/core/Tooltip';\n"],"names":["getDefaultZIndex","useComponentDefaultProps","styles","useStyles","useTooltip","getFloatingPosition","isElement","TOOLTIP_ERRORS","useMergedRef","React","OptionalPortal","Transition","Box","FloatingArrow","cloneElement","TooltipGroup","TooltipFloating"],"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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,GAAG,EAAE;AACjD,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE;AAChD,OAAO,CAAC;AACR,KAAK,CAAC,CAAC,EAAE,KAAK,kBAAkBH,cAAK,CAAC,aAAa,CAACI,2BAAa,EAAE;AACnE,MAAM,OAAO,EAAE,SAAS;AACxB,MAAM,UAAU,EAAE,KAAK;AACvB,MAAM,QAAQ,EAAE,OAAO,CAAC,SAAS;AACjC,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,MAAM,SAAS,EAAE,OAAO,CAAC,KAAK;AAC9B,KAAK,CAAC,CAAC,CAAC;AACR,GAAG,CAAC,CAAC,EAAEC,kBAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,GAAG,SAAS,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpH,CAAC;AACD,OAAO,CAAC,KAAK,GAAGC,yBAAY,CAAC;AAC7B,OAAO,CAAC,QAAQ,GAAGC,+BAAe,CAAC;AACnC,OAAO,CAAC,WAAW,GAAG,uBAAuB;;;;"}
|
|
@@ -101,17 +101,16 @@ function TooltipFloating(props) {
|
|
|
101
101
|
if (!utils.isElement(children)) {
|
|
102
102
|
throw new Error(Tooltip_errors.TOOLTIP_ERRORS.children);
|
|
103
103
|
}
|
|
104
|
-
const
|
|
105
|
-
const targetRef = hooks.useMergedRef(boundaryRef, target.ref);
|
|
104
|
+
const targetRef = hooks.useMergedRef(boundaryRef, children.ref);
|
|
106
105
|
const onMouseEnter = (event) => {
|
|
107
106
|
var _a2, _b2;
|
|
108
|
-
(_b2 = (_a2 =
|
|
107
|
+
(_b2 = (_a2 = children.props).onMouseEnter) == null ? void 0 : _b2.call(_a2, event);
|
|
109
108
|
handleMouseMove(event);
|
|
110
109
|
setOpened(true);
|
|
111
110
|
};
|
|
112
111
|
const onMouseLeave = (event) => {
|
|
113
112
|
var _a2, _b2;
|
|
114
|
-
(_b2 = (_a2 =
|
|
113
|
+
(_b2 = (_a2 = children.props).onMouseLeave) == null ? void 0 : _b2.call(_a2, event);
|
|
115
114
|
setOpened(false);
|
|
116
115
|
};
|
|
117
116
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(OptionalPortal.OptionalPortal, {
|
|
@@ -125,7 +124,7 @@ function TooltipFloating(props) {
|
|
|
125
124
|
top: y != null ? y : "",
|
|
126
125
|
left: (_b = Math.round(x)) != null ? _b : ""
|
|
127
126
|
})
|
|
128
|
-
}), label)), React.cloneElement(
|
|
127
|
+
}), label)), React.cloneElement(children, __spreadProps(__spreadValues({}, children.props), {
|
|
129
128
|
[refProp]: targetRef,
|
|
130
129
|
onMouseEnter,
|
|
131
130
|
onMouseLeave
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipFloating.js","sources":["../../../../src/components/Tooltip/TooltipFloating/TooltipFloating.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '@mantine/utils';\nimport { useMergedRef } from '@mantine/hooks';\nimport { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles';\nimport { Box } from '../../Box';\nimport { OptionalPortal } from '../../Portal';\nimport { TooltipBaseProps } from '../Tooltip.types';\nimport useStyles from '../Tooltip.styles';\nimport { TOOLTIP_ERRORS } from '../Tooltip.errors';\nimport { useFloatingTooltip } from './use-floating-tooltip';\n\nexport interface TooltipFloatingProps extends TooltipBaseProps {\n /** Offset from mouse in px */\n offset?: number;\n}\n\nconst defaultProps: Partial<TooltipFloatingProps> = {\n refProp: 'ref',\n withinPortal: true,\n offset: 10,\n position: 'right',\n zIndex: getDefaultZIndex('popover'),\n};\n\nexport function TooltipFloating(props: TooltipFloatingProps) {\n const {\n children,\n refProp,\n withinPortal,\n style,\n className,\n classNames,\n styles,\n unstyled,\n radius,\n color,\n label,\n offset,\n position,\n multiline,\n width,\n zIndex,\n disabled,\n ...others\n } = useComponentDefaultProps('TooltipFloating', defaultProps, props);\n\n const { handleMouseMove, x, y, opened, boundaryRef, floating, setOpened } = useFloatingTooltip({\n offset,\n position,\n });\n\n const { classes, cx } = useStyles(\n { radius, color, multiline, width },\n { name: 'Tooltip', classNames, styles, unstyled }\n );\n\n if (!isElement(children)) {\n throw new Error(TOOLTIP_ERRORS.children);\n }\n\n const
|
|
1
|
+
{"version":3,"file":"TooltipFloating.js","sources":["../../../../src/components/Tooltip/TooltipFloating/TooltipFloating.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '@mantine/utils';\nimport { useMergedRef } from '@mantine/hooks';\nimport { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles';\nimport { Box } from '../../Box';\nimport { OptionalPortal } from '../../Portal';\nimport { TooltipBaseProps } from '../Tooltip.types';\nimport useStyles from '../Tooltip.styles';\nimport { TOOLTIP_ERRORS } from '../Tooltip.errors';\nimport { useFloatingTooltip } from './use-floating-tooltip';\n\nexport interface TooltipFloatingProps extends TooltipBaseProps {\n /** Offset from mouse in px */\n offset?: number;\n}\n\nconst defaultProps: Partial<TooltipFloatingProps> = {\n refProp: 'ref',\n withinPortal: true,\n offset: 10,\n position: 'right',\n zIndex: getDefaultZIndex('popover'),\n};\n\nexport function TooltipFloating(props: TooltipFloatingProps) {\n const {\n children,\n refProp,\n withinPortal,\n style,\n className,\n classNames,\n styles,\n unstyled,\n radius,\n color,\n label,\n offset,\n position,\n multiline,\n width,\n zIndex,\n disabled,\n ...others\n } = useComponentDefaultProps('TooltipFloating', defaultProps, props);\n\n const { handleMouseMove, x, y, opened, boundaryRef, floating, setOpened } = useFloatingTooltip({\n offset,\n position,\n });\n\n const { classes, cx } = useStyles(\n { radius, color, multiline, width },\n { name: 'Tooltip', classNames, styles, unstyled }\n );\n\n if (!isElement(children)) {\n throw new Error(TOOLTIP_ERRORS.children);\n }\n\n const targetRef = useMergedRef(boundaryRef, (children as any).ref);\n\n const onMouseEnter = (event: React.MouseEvent<unknown, MouseEvent>) => {\n children.props.onMouseEnter?.(event);\n handleMouseMove(event);\n setOpened(true);\n };\n\n const onMouseLeave = (event: React.MouseEvent<unknown, MouseEvent>) => {\n children.props.onMouseLeave?.(event);\n setOpened(false);\n };\n\n return (\n <>\n <OptionalPortal withinPortal={withinPortal}>\n <Box\n {...others}\n ref={floating}\n className={cx(classes.root, className)}\n style={{\n ...style,\n zIndex,\n display: opened && !disabled ? 'block' : 'none',\n top: y ?? '',\n left: Math.round(x) ?? '',\n }}\n >\n {label}\n </Box>\n </OptionalPortal>\n\n {cloneElement(children, {\n ...children.props,\n [refProp]: targetRef,\n onMouseEnter,\n onMouseLeave,\n })}\n </>\n );\n}\n\nTooltipFloating.displayName = '@mantine/core/TooltipFloating';\n"],"names":["getDefaultZIndex","useComponentDefaultProps","styles","useFloatingTooltip","useStyles","isElement","TOOLTIP_ERRORS","useMergedRef","React","OptionalPortal","Box","cloneElement"],"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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import React, { forwardRef } from 'react';\nimport { DefaultProps, Selectors, useComponentDefaultProps } from '@mantine/styles';\nimport { isElement } from '@mantine/utils';\nimport { Text } from '../Text';\nimport { Box } from '../Box';\nimport useStyles from './Breadcrumbs.styles';\n\nexport type BreadcrumbsStylesNames = Selectors<typeof useStyles>;\n\nexport interface BreadcrumbsProps\n extends DefaultProps<BreadcrumbsStylesNames>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Separator between breadcrumbs */\n separator?: React.ReactNode;\n\n /** React nodes that should be separated */\n children: React.ReactNode;\n}\n\nconst defaultProps: Partial<BreadcrumbsProps> = {\n separator: '/',\n};\n\nexport const Breadcrumbs = forwardRef<HTMLDivElement, BreadcrumbsProps>(\n (props: BreadcrumbsProps, ref) => {\n const { className, children, separator, classNames, styles, unstyled, ...others } =\n useComponentDefaultProps('Breadcrumbs', defaultProps, props);\n\n const { classes, cx } = useStyles(null, { classNames, styles, unstyled, name: 'Breadcrumbs' });\n\n const items = React.Children.toArray(children).reduce(\n (acc
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { DefaultProps, Selectors, useComponentDefaultProps } from '@mantine/styles';\nimport { isElement } from '@mantine/utils';\nimport { Text } from '../Text';\nimport { Box } from '../Box';\nimport useStyles from './Breadcrumbs.styles';\n\nexport type BreadcrumbsStylesNames = Selectors<typeof useStyles>;\n\nexport interface BreadcrumbsProps\n extends DefaultProps<BreadcrumbsStylesNames>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Separator between breadcrumbs */\n separator?: React.ReactNode;\n\n /** React nodes that should be separated */\n children: React.ReactNode;\n}\n\nconst defaultProps: Partial<BreadcrumbsProps> = {\n separator: '/',\n};\n\nexport const Breadcrumbs = forwardRef<HTMLDivElement, BreadcrumbsProps>(\n (props: BreadcrumbsProps, ref) => {\n const { className, children, separator, classNames, styles, unstyled, ...others } =\n useComponentDefaultProps('Breadcrumbs', defaultProps, props);\n\n const { classes, cx } = useStyles(null, { classNames, styles, unstyled, name: 'Breadcrumbs' });\n\n const items = React.Children.toArray(children).reduce<React.ReactNode[]>(\n (acc, child, index, array) => {\n const item = isElement(child) ? (\n React.cloneElement(child, {\n className: cx(classes.breadcrumb, child.props?.className),\n key: index,\n })\n ) : (\n <div className={classes.breadcrumb} key={index}>\n {child}\n </div>\n );\n\n acc.push(item);\n\n if (index !== array.length - 1) {\n acc.push(\n <Text size=\"sm\" className={classes.separator} key={`separator-${index}`}>\n {separator}\n </Text>\n );\n }\n\n return acc;\n },\n []\n );\n\n return (\n <Box className={cx(classes.root, className)} ref={ref} {...others}>\n {items}\n </Box>\n );\n }\n);\n\nBreadcrumbs.displayName = '@mantine/core/Breadcrumbs';\n"],"names":[],"mappings":";;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,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,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iB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;AACzD,QAAQ,IAAI,EAAE,IAAI;AAClB,QAAQ,SAAS,EAAE,OAAO,CAAC,SAAS;AACpC,QAAQ,GAAG,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACjC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,GAAG,CAAC;AACf,GAAG,EAAE,EAAE,CAAC,CAAC;AACT,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC;AACjE,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AAC1C,IAAI,GAAG;AACP,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;AACrB,CAAC,EAAE;AACH,WAAW,CAAC,WAAW,GAAG,2BAA2B;;;;"}
|
|
@@ -9,9 +9,8 @@ function HoverCardTarget({ children, refProp }) {
|
|
|
9
9
|
throw new Error(HOVER_CARD_ERRORS.children);
|
|
10
10
|
}
|
|
11
11
|
const ctx = useHoverCardContext();
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const onMouseLeave = createEventHandler(target.props.onMouseLeave, ctx.closeDropdown);
|
|
12
|
+
const onMouseEnter = createEventHandler(children.props.onMouseEnter, ctx.openDropdown);
|
|
13
|
+
const onMouseLeave = createEventHandler(children.props.onMouseLeave, ctx.closeDropdown);
|
|
15
14
|
return /* @__PURE__ */ React.createElement(Popover.Target, {
|
|
16
15
|
refProp
|
|
17
16
|
}, cloneElement(children, { onMouseEnter, onMouseLeave }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCardTarget.js","sources":["../../../../src/components/HoverCard/HoverCardTarget/HoverCardTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement, createEventHandler } from '@mantine/utils';\nimport { Popover, PopoverTargetProps } from '../../Popover';\nimport { useHoverCardContext } from '../HoverCard.context';\nimport { HOVER_CARD_ERRORS } from '../HoverCard.errors';\n\nexport interface HoverCardTargetProps extends PopoverTargetProps {}\n\nexport function HoverCardTarget({ children, refProp }: HoverCardTargetProps) {\n if (!isElement(children)) {\n throw new Error(HOVER_CARD_ERRORS.children);\n }\n\n const ctx = useHoverCardContext();\n const
|
|
1
|
+
{"version":3,"file":"HoverCardTarget.js","sources":["../../../../src/components/HoverCard/HoverCardTarget/HoverCardTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement, createEventHandler } from '@mantine/utils';\nimport { Popover, PopoverTargetProps } from '../../Popover';\nimport { useHoverCardContext } from '../HoverCard.context';\nimport { HOVER_CARD_ERRORS } from '../HoverCard.errors';\n\nexport interface HoverCardTargetProps extends PopoverTargetProps {}\n\nexport function HoverCardTarget({ children, refProp }: HoverCardTargetProps) {\n if (!isElement(children)) {\n throw new Error(HOVER_CARD_ERRORS.children);\n }\n\n const ctx = useHoverCardContext();\n const onMouseEnter = createEventHandler(children.props.onMouseEnter, ctx.openDropdown);\n const onMouseLeave = createEventHandler(children.props.onMouseLeave, ctx.closeDropdown);\n\n return (\n <Popover.Target refProp={refProp}>\n {cloneElement(children as React.ReactElement, { onMouseEnter, onMouseLeave })}\n </Popover.Target>\n );\n}\n\nHoverCardTarget.displayName = '@mantine/core/HoverCardTarget';\n"],"names":[],"mappings":";;;;;;AAKO,SAAS,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;AACvD,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,MAAM,GAAG,GAAG,mBAAmB,EAAE,CAAC;AACpC,EAAE,MAAM,YAAY,GAAG,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;AACzF,EAAE,MAAM,YAAY,GAAG,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;AAC1F,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE;AAC7D,IAAI,OAAO;AACX,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AACD,eAAe,CAAC,WAAW,GAAG,+BAA+B;;;;"}
|
|
@@ -9,14 +9,13 @@ function MenuTarget({ children, refProp = "ref" }) {
|
|
|
9
9
|
throw new Error(MENU_ERRORS.children);
|
|
10
10
|
}
|
|
11
11
|
const ctx = useMenuContext();
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const onMouseLeave = createEventHandler(target.props.onMouseLeave, () => ctx.trigger === "hover" && ctx.closeDropdown());
|
|
12
|
+
const onClick = createEventHandler(children.props.onClick, () => ctx.trigger === "click" && ctx.toggleDropdown());
|
|
13
|
+
const onMouseEnter = createEventHandler(children.props.onMouseEnter, () => ctx.trigger === "hover" && ctx.openDropdown());
|
|
14
|
+
const onMouseLeave = createEventHandler(children.props.onMouseLeave, () => ctx.trigger === "hover" && ctx.closeDropdown());
|
|
16
15
|
return /* @__PURE__ */ React.createElement(Popover.Target, {
|
|
17
16
|
refProp,
|
|
18
17
|
popupType: "menu"
|
|
19
|
-
}, cloneElement(
|
|
18
|
+
}, cloneElement(children, {
|
|
20
19
|
onClick,
|
|
21
20
|
onMouseEnter,
|
|
22
21
|
onMouseLeave,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuTarget.js","sources":["../../../../src/components/Menu/MenuTarget/MenuTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement, createEventHandler } from '@mantine/utils';\nimport { useMenuContext } from '../Menu.context';\nimport { Popover } from '../../Popover';\nimport { MENU_ERRORS } from '../Menu.errors';\n\nexport interface MenuTargetProps {\n /** Target element */\n children: React.ReactNode;\n\n /** Key of the prop that should be used to get element ref */\n refProp?: string;\n}\n\nexport function MenuTarget({ children, refProp = 'ref' }: MenuTargetProps) {\n if (!isElement(children)) {\n throw new Error(MENU_ERRORS.children);\n }\n\n const ctx = useMenuContext();\n
|
|
1
|
+
{"version":3,"file":"MenuTarget.js","sources":["../../../../src/components/Menu/MenuTarget/MenuTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement, createEventHandler } from '@mantine/utils';\nimport { useMenuContext } from '../Menu.context';\nimport { Popover } from '../../Popover';\nimport { MENU_ERRORS } from '../Menu.errors';\n\nexport interface MenuTargetProps {\n /** Target element */\n children: React.ReactNode;\n\n /** Key of the prop that should be used to get element ref */\n refProp?: string;\n}\n\nexport function MenuTarget({ children, refProp = 'ref' }: MenuTargetProps) {\n if (!isElement(children)) {\n throw new Error(MENU_ERRORS.children);\n }\n\n const ctx = useMenuContext();\n\n const onClick = createEventHandler(\n children.props.onClick,\n () => ctx.trigger === 'click' && ctx.toggleDropdown()\n );\n\n const onMouseEnter = createEventHandler(\n children.props.onMouseEnter,\n () => ctx.trigger === 'hover' && ctx.openDropdown()\n );\n\n const onMouseLeave = createEventHandler(\n children.props.onMouseLeave,\n () => ctx.trigger === 'hover' && ctx.closeDropdown()\n );\n\n return (\n <Popover.Target refProp={refProp} popupType=\"menu\">\n {cloneElement(children, {\n onClick,\n onMouseEnter,\n onMouseLeave,\n 'data-expanded': ctx.opened ? true : undefined,\n })}\n </Popover.Target>\n );\n}\n\nMenuTarget.displayName = '@mantine/core/MenuTarget';\n"],"names":[],"mappings":";;;;;;AAKO,SAAS,UAAU,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,EAAE,EAAE;AAC1D,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;AAC/B,EAAE,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,OAAO,KAAK,OAAO,IAAI,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;AACpH,EAAE,MAAM,YAAY,GAAG,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,OAAO,KAAK,OAAO,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;AAC5H,EAAE,MAAM,YAAY,GAAG,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,OAAO,KAAK,OAAO,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC;AAC7H,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE;AAC7D,IAAI,OAAO;AACX,IAAI,SAAS,EAAE,MAAM;AACrB,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE;AAC5B,IAAI,OAAO;AACX,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,eAAe,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC;AAC/C,GAAG,CAAC,CAAC,CAAC;AACN,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,0BAA0B;;;;"}
|
|
@@ -32,15 +32,14 @@ function PopoverTarget({
|
|
|
32
32
|
throw new Error(POPOVER_ERRORS.children);
|
|
33
33
|
}
|
|
34
34
|
const ctx = usePopoverContext();
|
|
35
|
-
const
|
|
36
|
-
const targetRef = useMergedRef(ctx.reference, target.ref);
|
|
35
|
+
const targetRef = useMergedRef(ctx.reference, children.ref);
|
|
37
36
|
const accessibleProps = ctx.withRoles ? {
|
|
38
37
|
"aria-haspopup": popupType,
|
|
39
38
|
"aria-expanded": ctx.opened,
|
|
40
39
|
"aria-controls": ctx.getDropdownId(),
|
|
41
40
|
id: ctx.getTargetId()
|
|
42
41
|
} : {};
|
|
43
|
-
return cloneElement(
|
|
42
|
+
return cloneElement(children, __spreadValues(__spreadProps(__spreadValues(__spreadValues({}, accessibleProps), ctx.targetProps), {
|
|
44
43
|
[refProp]: targetRef
|
|
45
44
|
}), !ctx.controlled ? { onClick: ctx.onToggle } : null));
|
|
46
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverTarget.js","sources":["../../../../src/components/Popover/PopoverTarget/PopoverTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport { isElement } from '@mantine/utils';\nimport { usePopoverContext } from '../Popover.context';\nimport { POPOVER_ERRORS } from '../Popover.errors';\n\nexport interface PopoverTargetProps {\n /** Target element */\n children: React.ReactNode;\n\n /** Key of the prop that should be used to get element ref */\n refProp?: string;\n\n /** Popup accessible type, 'dialog' by default */\n popupType?: string;\n}\n\nexport function PopoverTarget({\n children,\n refProp = 'ref',\n popupType = 'dialog',\n}: PopoverTargetProps) {\n if (!isElement(children)) {\n throw new Error(POPOVER_ERRORS.children);\n }\n\n const ctx = usePopoverContext();\n const
|
|
1
|
+
{"version":3,"file":"PopoverTarget.js","sources":["../../../../src/components/Popover/PopoverTarget/PopoverTarget.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport { isElement } from '@mantine/utils';\nimport { usePopoverContext } from '../Popover.context';\nimport { POPOVER_ERRORS } from '../Popover.errors';\n\nexport interface PopoverTargetProps {\n /** Target element */\n children: React.ReactNode;\n\n /** Key of the prop that should be used to get element ref */\n refProp?: string;\n\n /** Popup accessible type, 'dialog' by default */\n popupType?: string;\n}\n\nexport function PopoverTarget({\n children,\n refProp = 'ref',\n popupType = 'dialog',\n}: PopoverTargetProps) {\n if (!isElement(children)) {\n throw new Error(POPOVER_ERRORS.children);\n }\n\n const ctx = usePopoverContext();\n const targetRef = useMergedRef(ctx.reference, (children as any).ref);\n\n const accessibleProps = ctx.withRoles\n ? {\n 'aria-haspopup': popupType,\n 'aria-expanded': ctx.opened,\n 'aria-controls': ctx.getDropdownId(),\n id: ctx.getTargetId(),\n }\n : {};\n\n return cloneElement(children, {\n ...accessibleProps,\n ...ctx.targetProps,\n [refProp]: targetRef,\n ...(!ctx.controlled ? { onClick: ctx.onToggle } : null),\n });\n}\n\nPopoverTarget.displayName = '@mantine/core/PopoverTarget';\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,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,IA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G,CAAC,WAAW,CAAC,EAAE;AACnI,IAAI,CAAC,OAAO,GAAG,SAAS;AACxB,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;AAC3D,CAAC;AACD,aAAa,CAAC,WAAW,GAAG,6BAA6B;;;;"}
|
|
@@ -132,8 +132,7 @@ function Tooltip(props) {
|
|
|
132
132
|
if (!isElement(children)) {
|
|
133
133
|
throw new Error(TOOLTIP_ERRORS.children);
|
|
134
134
|
}
|
|
135
|
-
const
|
|
136
|
-
const targetRef = useMergedRef(tooltip.reference, target.ref);
|
|
135
|
+
const targetRef = useMergedRef(tooltip.reference, children.ref);
|
|
137
136
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(OptionalPortal, {
|
|
138
137
|
withinPortal
|
|
139
138
|
}, /* @__PURE__ */ React.createElement(Transition, {
|
|
@@ -158,7 +157,7 @@ function Tooltip(props) {
|
|
|
158
157
|
arrowOffset,
|
|
159
158
|
className: classes.arrow
|
|
160
159
|
}));
|
|
161
|
-
})), cloneElement(
|
|
160
|
+
})), cloneElement(children, tooltip.getReferenceProps(__spreadValues({ [refProp]: targetRef }, children.props))));
|
|
162
161
|
}
|
|
163
162
|
Tooltip.Group = TooltipGroup;
|
|
164
163
|
Tooltip.Floating = TooltipFloating;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '@mantine/utils';\nimport { useMergedRef } from '@mantine/hooks';\nimport { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles';\nimport { TooltipGroup } from './TooltipGroup/TooltipGroup';\nimport { TooltipFloating } from './TooltipFloating/TooltipFloating';\nimport { useTooltip } from './use-tooltip';\nimport { FloatingArrow, getFloatingPosition, FloatingPosition } from '../Floating';\nimport { MantineTransition, Transition } from '../Transition';\nimport { OptionalPortal } from '../Portal';\nimport { Box } from '../Box';\nimport { TOOLTIP_ERRORS } from './Tooltip.errors';\nimport { TooltipBaseProps } from './Tooltip.types';\nimport useStyles from './Tooltip.styles';\n\nexport interface TooltipProps extends TooltipBaseProps {\n /** Called when tooltip position changes */\n onPositionChange?(position: FloatingPosition): void;\n\n /** Open delay in ms */\n openDelay?: number;\n\n /** Close delay in ms */\n closeDelay?: number;\n\n /** Controls opened state */\n opened?: boolean;\n\n /** Space between target element and tooltip in px */\n offset?: number;\n\n /** Determines whether component should have an arrow */\n withArrow?: boolean;\n\n /** Arrow size in px */\n arrowSize?: number;\n\n /** Arrow offset in px */\n arrowOffset?: number;\n\n /** One of premade transitions ot transition object */\n transition?: MantineTransition;\n\n /** Transition duration in ms */\n transitionDuration?: number;\n\n /** Determines which events will be used to show tooltip */\n events?: { hover: boolean; focus: boolean; touch: boolean };\n\n /** useEffect dependencies to force update tooltip position */\n positionDependencies?: any[];\n}\n\nconst defaultProps: Partial<TooltipProps> = {\n position: 'top',\n refProp: 'ref',\n withinPortal: false,\n arrowSize: 4,\n arrowOffset: 5,\n offset: 5,\n transition: 'fade',\n transitionDuration: 100,\n width: 'auto',\n events: { hover: true, focus: false, touch: false },\n zIndex: getDefaultZIndex('popover'),\n positionDependencies: [],\n};\n\nexport function Tooltip(props: TooltipProps) {\n const {\n children,\n position,\n refProp,\n label,\n openDelay,\n closeDelay,\n onPositionChange,\n opened,\n withinPortal,\n radius,\n color,\n classNames,\n styles,\n unstyled,\n style,\n className,\n withArrow,\n arrowSize,\n arrowOffset,\n offset,\n transition,\n transitionDuration,\n multiline,\n width,\n events,\n zIndex,\n disabled,\n positionDependencies,\n ...others\n } = useComponentDefaultProps('Tooltip', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { radius, color, width, multiline },\n { name: 'Tooltip', classNames, styles, unstyled }\n );\n\n const tooltip = useTooltip({\n position: getFloatingPosition(theme.dir, position),\n closeDelay,\n openDelay,\n onPositionChange,\n opened,\n events,\n offset: offset + (withArrow ? arrowSize / 2 : 0),\n positionDependencies: [...positionDependencies, children],\n });\n\n if (!isElement(children)) {\n throw new Error(TOOLTIP_ERRORS.children);\n }\n\n const target = children as React.ReactElement;\n const targetRef = useMergedRef(tooltip.reference, (target as any).ref);\n\n return (\n <>\n <OptionalPortal withinPortal={withinPortal}>\n <Transition\n mounted={!disabled && tooltip.opened}\n transition={transition}\n duration={tooltip.isGroupPhase ? 10 : transitionDuration}\n >\n {(transitionStyles) => (\n <Box\n {...others}\n {...tooltip.getFloatingProps({\n ref: tooltip.floating,\n className: cx(classes.root, className),\n style: {\n ...style,\n ...transitionStyles,\n zIndex,\n top: tooltip.y ?? '',\n left: tooltip.x ?? '',\n },\n })}\n >\n {label}\n\n <FloatingArrow\n visible={withArrow}\n withBorder={false}\n position={tooltip.placement}\n arrowSize={arrowSize}\n arrowOffset={arrowOffset}\n className={classes.arrow}\n />\n </Box>\n )}\n </Transition>\n </OptionalPortal>\n\n {cloneElement(target, tooltip.getReferenceProps({ [refProp]: targetRef, ...target.props }))}\n </>\n );\n}\n\nTooltip.Group = TooltipGroup;\nTooltip.Floating = TooltipFloating;\n\nTooltip.displayName = '@mantine/core/Tooltip';\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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AE,EAAE,KAAK,CAAC,EAAE,gBAAgB,CAAC,EAAE;AACxF,QAAQ,MAAM;AACd,QAAQ,GAAG,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG,GAAG,EAAE;AACjD,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE;AAChD,OAAO,CAAC;AACR,KAAK,CAAC,CAAC,EAAE,KAAK,kBAAkB,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE;AACnE,MAAM,OAAO,EAAE,SAAS;AACxB,MAAM,UAAU,EAAE,KAAK;AACvB,MAAM,QAAQ,EAAE,OAAO,CAAC,SAAS;AACjC,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,MAAM,SAAS,EAAE,OAAO,CAAC,KAAK;AAC9B,KAAK,CAAC,CAAC,CAAC;AACR,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,GAAG,SAAS,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAChH,CAAC;AACD,OAAO,CAAC,KAAK,GAAG,YAAY,CAAC;AAC7B,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAC;AACnC,OAAO,CAAC,WAAW,GAAG,uBAAuB;;;;"}
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '@mantine/utils';\nimport { useMergedRef } from '@mantine/hooks';\nimport { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles';\nimport { TooltipGroup } from './TooltipGroup/TooltipGroup';\nimport { TooltipFloating } from './TooltipFloating/TooltipFloating';\nimport { useTooltip } from './use-tooltip';\nimport { FloatingArrow, getFloatingPosition, FloatingPosition } from '../Floating';\nimport { MantineTransition, Transition } from '../Transition';\nimport { OptionalPortal } from '../Portal';\nimport { Box } from '../Box';\nimport { TOOLTIP_ERRORS } from './Tooltip.errors';\nimport { TooltipBaseProps } from './Tooltip.types';\nimport useStyles from './Tooltip.styles';\n\nexport interface TooltipProps extends TooltipBaseProps {\n /** Called when tooltip position changes */\n onPositionChange?(position: FloatingPosition): void;\n\n /** Open delay in ms */\n openDelay?: number;\n\n /** Close delay in ms */\n closeDelay?: number;\n\n /** Controls opened state */\n opened?: boolean;\n\n /** Space between target element and tooltip in px */\n offset?: number;\n\n /** Determines whether component should have an arrow */\n withArrow?: boolean;\n\n /** Arrow size in px */\n arrowSize?: number;\n\n /** Arrow offset in px */\n arrowOffset?: number;\n\n /** One of premade transitions ot transition object */\n transition?: MantineTransition;\n\n /** Transition duration in ms */\n transitionDuration?: number;\n\n /** Determines which events will be used to show tooltip */\n events?: { hover: boolean; focus: boolean; touch: boolean };\n\n /** useEffect dependencies to force update tooltip position */\n positionDependencies?: any[];\n}\n\nconst defaultProps: Partial<TooltipProps> = {\n position: 'top',\n refProp: 'ref',\n withinPortal: false,\n arrowSize: 4,\n arrowOffset: 5,\n offset: 5,\n transition: 'fade',\n transitionDuration: 100,\n width: 'auto',\n events: { hover: true, focus: false, touch: false },\n zIndex: getDefaultZIndex('popover'),\n positionDependencies: [],\n};\n\nexport function Tooltip(props: TooltipProps) {\n const {\n children,\n position,\n refProp,\n label,\n openDelay,\n closeDelay,\n onPositionChange,\n opened,\n withinPortal,\n radius,\n color,\n classNames,\n styles,\n unstyled,\n style,\n className,\n withArrow,\n arrowSize,\n arrowOffset,\n offset,\n transition,\n transitionDuration,\n multiline,\n width,\n events,\n zIndex,\n disabled,\n positionDependencies,\n ...others\n } = useComponentDefaultProps('Tooltip', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { radius, color, width, multiline },\n { name: 'Tooltip', classNames, styles, unstyled }\n );\n\n const tooltip = useTooltip({\n position: getFloatingPosition(theme.dir, position),\n closeDelay,\n openDelay,\n onPositionChange,\n opened,\n events,\n offset: offset + (withArrow ? arrowSize / 2 : 0),\n positionDependencies: [...positionDependencies, children],\n });\n\n if (!isElement(children)) {\n throw new Error(TOOLTIP_ERRORS.children);\n }\n\n const targetRef = useMergedRef(tooltip.reference, (children as any).ref);\n\n return (\n <>\n <OptionalPortal withinPortal={withinPortal}>\n <Transition\n mounted={!disabled && tooltip.opened}\n transition={transition}\n duration={tooltip.isGroupPhase ? 10 : transitionDuration}\n >\n {(transitionStyles) => (\n <Box\n {...others}\n {...tooltip.getFloatingProps({\n ref: tooltip.floating,\n className: cx(classes.root, className),\n style: {\n ...style,\n ...transitionStyles,\n zIndex,\n top: tooltip.y ?? '',\n left: tooltip.x ?? '',\n },\n })}\n >\n {label}\n\n <FloatingArrow\n visible={withArrow}\n withBorder={false}\n position={tooltip.placement}\n arrowSize={arrowSize}\n arrowOffset={arrowOffset}\n className={classes.arrow}\n />\n </Box>\n )}\n </Transition>\n </OptionalPortal>\n\n {cloneElement(\n children,\n tooltip.getReferenceProps({ [refProp]: targetRef, ...children.props })\n )}\n </>\n );\n}\n\nTooltip.Group = TooltipGroup;\nTooltip.Floating = TooltipFloating;\n\nTooltip.displayName = '@mantine/core/Tooltip';\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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AACd,QAAQ,GAAG,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG,GAAG,EAAE;AACjD,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE;AAChD,OAAO,CAAC;AACR,KAAK,CAAC,CAAC,EAAE,KAAK,kBAAkB,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE;AACnE,MAAM,OAAO,EAAE,SAAS;AACxB,MAAM,UAAU,EAAE,KAAK;AACvB,MAAM,QAAQ,EAAE,OAAO,CAAC,SAAS;AACjC,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,MAAM,SAAS,EAAE,OAAO,CAAC,KAAK;AAC9B,KAAK,CAAC,CAAC,CAAC;AACR,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,GAAG,SAAS,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpH,CAAC;AACD,OAAO,CAAC,KAAK,GAAG,YAAY,CAAC;AAC7B,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAC;AACnC,OAAO,CAAC,WAAW,GAAG,uBAAuB;;;;"}
|
|
@@ -93,17 +93,16 @@ function TooltipFloating(props) {
|
|
|
93
93
|
if (!isElement(children)) {
|
|
94
94
|
throw new Error(TOOLTIP_ERRORS.children);
|
|
95
95
|
}
|
|
96
|
-
const
|
|
97
|
-
const targetRef = useMergedRef(boundaryRef, target.ref);
|
|
96
|
+
const targetRef = useMergedRef(boundaryRef, children.ref);
|
|
98
97
|
const onMouseEnter = (event) => {
|
|
99
98
|
var _a2, _b2;
|
|
100
|
-
(_b2 = (_a2 =
|
|
99
|
+
(_b2 = (_a2 = children.props).onMouseEnter) == null ? void 0 : _b2.call(_a2, event);
|
|
101
100
|
handleMouseMove(event);
|
|
102
101
|
setOpened(true);
|
|
103
102
|
};
|
|
104
103
|
const onMouseLeave = (event) => {
|
|
105
104
|
var _a2, _b2;
|
|
106
|
-
(_b2 = (_a2 =
|
|
105
|
+
(_b2 = (_a2 = children.props).onMouseLeave) == null ? void 0 : _b2.call(_a2, event);
|
|
107
106
|
setOpened(false);
|
|
108
107
|
};
|
|
109
108
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(OptionalPortal, {
|
|
@@ -117,7 +116,7 @@ function TooltipFloating(props) {
|
|
|
117
116
|
top: y != null ? y : "",
|
|
118
117
|
left: (_b = Math.round(x)) != null ? _b : ""
|
|
119
118
|
})
|
|
120
|
-
}), label)), cloneElement(
|
|
119
|
+
}), label)), cloneElement(children, __spreadProps(__spreadValues({}, children.props), {
|
|
121
120
|
[refProp]: targetRef,
|
|
122
121
|
onMouseEnter,
|
|
123
122
|
onMouseLeave
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipFloating.js","sources":["../../../../src/components/Tooltip/TooltipFloating/TooltipFloating.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '@mantine/utils';\nimport { useMergedRef } from '@mantine/hooks';\nimport { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles';\nimport { Box } from '../../Box';\nimport { OptionalPortal } from '../../Portal';\nimport { TooltipBaseProps } from '../Tooltip.types';\nimport useStyles from '../Tooltip.styles';\nimport { TOOLTIP_ERRORS } from '../Tooltip.errors';\nimport { useFloatingTooltip } from './use-floating-tooltip';\n\nexport interface TooltipFloatingProps extends TooltipBaseProps {\n /** Offset from mouse in px */\n offset?: number;\n}\n\nconst defaultProps: Partial<TooltipFloatingProps> = {\n refProp: 'ref',\n withinPortal: true,\n offset: 10,\n position: 'right',\n zIndex: getDefaultZIndex('popover'),\n};\n\nexport function TooltipFloating(props: TooltipFloatingProps) {\n const {\n children,\n refProp,\n withinPortal,\n style,\n className,\n classNames,\n styles,\n unstyled,\n radius,\n color,\n label,\n offset,\n position,\n multiline,\n width,\n zIndex,\n disabled,\n ...others\n } = useComponentDefaultProps('TooltipFloating', defaultProps, props);\n\n const { handleMouseMove, x, y, opened, boundaryRef, floating, setOpened } = useFloatingTooltip({\n offset,\n position,\n });\n\n const { classes, cx } = useStyles(\n { radius, color, multiline, width },\n { name: 'Tooltip', classNames, styles, unstyled }\n );\n\n if (!isElement(children)) {\n throw new Error(TOOLTIP_ERRORS.children);\n }\n\n const
|
|
1
|
+
{"version":3,"file":"TooltipFloating.js","sources":["../../../../src/components/Tooltip/TooltipFloating/TooltipFloating.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { isElement } from '@mantine/utils';\nimport { useMergedRef } from '@mantine/hooks';\nimport { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles';\nimport { Box } from '../../Box';\nimport { OptionalPortal } from '../../Portal';\nimport { TooltipBaseProps } from '../Tooltip.types';\nimport useStyles from '../Tooltip.styles';\nimport { TOOLTIP_ERRORS } from '../Tooltip.errors';\nimport { useFloatingTooltip } from './use-floating-tooltip';\n\nexport interface TooltipFloatingProps extends TooltipBaseProps {\n /** Offset from mouse in px */\n offset?: number;\n}\n\nconst defaultProps: Partial<TooltipFloatingProps> = {\n refProp: 'ref',\n withinPortal: true,\n offset: 10,\n position: 'right',\n zIndex: getDefaultZIndex('popover'),\n};\n\nexport function TooltipFloating(props: TooltipFloatingProps) {\n const {\n children,\n refProp,\n withinPortal,\n style,\n className,\n classNames,\n styles,\n unstyled,\n radius,\n color,\n label,\n offset,\n position,\n multiline,\n width,\n zIndex,\n disabled,\n ...others\n } = useComponentDefaultProps('TooltipFloating', defaultProps, props);\n\n const { handleMouseMove, x, y, opened, boundaryRef, floating, setOpened } = useFloatingTooltip({\n offset,\n position,\n });\n\n const { classes, cx } = useStyles(\n { radius, color, multiline, width },\n { name: 'Tooltip', classNames, styles, unstyled }\n );\n\n if (!isElement(children)) {\n throw new Error(TOOLTIP_ERRORS.children);\n }\n\n const targetRef = useMergedRef(boundaryRef, (children as any).ref);\n\n const onMouseEnter = (event: React.MouseEvent<unknown, MouseEvent>) => {\n children.props.onMouseEnter?.(event);\n handleMouseMove(event);\n setOpened(true);\n };\n\n const onMouseLeave = (event: React.MouseEvent<unknown, MouseEvent>) => {\n children.props.onMouseLeave?.(event);\n setOpened(false);\n };\n\n return (\n <>\n <OptionalPortal withinPortal={withinPortal}>\n <Box\n {...others}\n ref={floating}\n className={cx(classes.root, className)}\n style={{\n ...style,\n zIndex,\n display: opened && !disabled ? 'block' : 'none',\n top: y ?? '',\n left: Math.round(x) ?? '',\n }}\n >\n {label}\n </Box>\n </OptionalPortal>\n\n {cloneElement(children, {\n ...children.props,\n [refProp]: targetRef,\n onMouseEnter,\n onMouseLeave,\n })}\n </>\n );\n}\n\nTooltipFloating.displayName = '@mantine/core/TooltipFloating';\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,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,K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EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,kBAAkB,KAAK,CAAC,aAAa,CAAC,cAAc,EAAE;AACvH,IAAI,YAAY;AAChB,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE;AACxF,IAAI,GAAG,EAAE,QAAQ;AACjB,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AAC1C,IAAI,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AACpD,MAAM,MAAM;AACZ,MAAM,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,GAAG,OAAO,GAAG,MAAM;AACrD,MAAM,GAAG,EAAE,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,EAAE;AAC7B,MAAM,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE;AAClD,KAAK,CAAC;AACN,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE;AACxF,IAAI,CAAC,OAAO,GAAG,SAAS;AACxB,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,GAAG,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AACD,eAAe,CAAC,WAAW,GAAG,+BAA+B;;;;"}
|
|
@@ -23,5 +23,5 @@ export interface HorizontalSectionProps extends HorizontalSectionSharedProps, Om
|
|
|
23
23
|
section: 'navbar' | 'aside';
|
|
24
24
|
__staticSelector: string;
|
|
25
25
|
}
|
|
26
|
-
export declare const HorizontalSection: React.ForwardRefExoticComponent<Pick<HorizontalSectionProps, "
|
|
26
|
+
export declare const HorizontalSection: React.ForwardRefExoticComponent<Pick<HorizontalSectionProps, "children" | "aria-haspopup" | "p" | "slot" | "section" | "style" | "title" | "onClick" | "width" | "zIndex" | "onChange" | "id" | "unstyled" | "classNames" | "styles" | "__staticSelector" | "color" | "height" | "position" | "translate" | "fixed" | "hidden" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "py" | "px" | "pt" | "pb" | "pl" | "pr" | "hiddenBreakpoint"> & React.RefAttributes<HTMLElement>>;
|
|
27
27
|
//# sourceMappingURL=HorizontalSection.d.ts.map
|
|
@@ -63,8 +63,8 @@ export declare const sizes: {
|
|
|
63
63
|
paddingRight: number;
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
-
declare const _default: (params: ButtonStylesParams, options?: import("@mantine/styles").UseStylesOptions<"
|
|
67
|
-
classes: Record<"
|
|
66
|
+
declare const _default: (params: ButtonStylesParams, options?: import("@mantine/styles").UseStylesOptions<"label" | "root" | "icon" | "inner" | "leftIcon" | "rightIcon">) => {
|
|
67
|
+
classes: Record<"label" | "root" | "icon" | "inner" | "leftIcon" | "rightIcon", string>;
|
|
68
68
|
cx: (...args: any) => string;
|
|
69
69
|
theme: MantineTheme;
|
|
70
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCardTarget.d.ts","sourceRoot":"","sources":["../../../../src/components/HoverCard/HoverCardTarget/HoverCardTarget.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAW,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAI5D,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;CAAG;AAEnE,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"HoverCardTarget.d.ts","sourceRoot":"","sources":["../../../../src/components/HoverCard/HoverCardTarget/HoverCardTarget.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAW,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAI5D,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;CAAG;AAEnE,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,oBAAoB,eAc1E;yBAde,eAAe"}
|
|
@@ -5,7 +5,7 @@ interface BaseProps extends InputWrapperBaseProps, InputSharedProps, DefaultProp
|
|
|
5
5
|
__staticSelector?: string;
|
|
6
6
|
id?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function useInputProps<T extends BaseProps>(component: string, defaultProps: Partial<T>, props: T): Omit<import("@mantine/styles").MantineStyleSystemProps & Omit<T, "label" | "style" | "
|
|
8
|
+
export declare function useInputProps<T extends BaseProps>(component: string, defaultProps: Partial<T>, props: T): Omit<import("@mantine/styles").MantineStyleSystemProps & Omit<T, "label" | "style" | "id" | "unstyled" | "classNames" | "styles" | "__staticSelector" | "className" | "sx" | "required" | "size" | "error" | "description" | "labelProps" | "descriptionProps" | "errorProps" | "inputContainer" | "inputWrapperOrder" | "wrapperProps">, "p" | "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "py" | "px" | "pt" | "pb" | "pl" | "pr"> & {
|
|
9
9
|
classNames: Partial<Record<never, string>>;
|
|
10
10
|
styles: import("@mantine/styles").Styles<never, never>;
|
|
11
11
|
unstyled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuTarget.d.ts","sourceRoot":"","sources":["../../../../src/components/Menu/MenuTarget/MenuTarget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAM5C,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,OAAe,EAAE,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"MenuTarget.d.ts","sourceRoot":"","sources":["../../../../src/components/Menu/MenuTarget/MenuTarget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAM5C,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,OAAe,EAAE,EAAE,eAAe,eAgCxE;yBAhCe,UAAU"}
|
|
@@ -3,8 +3,8 @@ export interface MultiSelectStylesParams {
|
|
|
3
3
|
size: MantineSize;
|
|
4
4
|
invalid: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: (params: MultiSelectStylesParams, options?: import("@mantine/styles").UseStylesOptions<"input" | "
|
|
7
|
-
classes: Record<"input" | "
|
|
6
|
+
declare const _default: (params: MultiSelectStylesParams, options?: import("@mantine/styles").UseStylesOptions<"input" | "value" | "values" | "wrapper" | "searchInput" | "searchInputEmpty" | "searchInputInputHidden" | "searchInputPointer">) => {
|
|
7
|
+
classes: Record<"input" | "value" | "values" | "wrapper" | "searchInput" | "searchInputEmpty" | "searchInputInputHidden" | "searchInputPointer", string>;
|
|
8
8
|
cx: (...args: any) => string;
|
|
9
9
|
theme: import("@mantine/styles").MantineTheme;
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverTarget.d.ts","sourceRoot":"","sources":["../../../../src/components/Popover/PopoverTarget/PopoverTarget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAM5C,MAAM,WAAW,kBAAkB;IACjC,qBAAqB;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,OAAe,EACf,SAAoB,GACrB,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"PopoverTarget.d.ts","sourceRoot":"","sources":["../../../../src/components/Popover/PopoverTarget/PopoverTarget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAM5C,MAAM,WAAW,kBAAkB;IACjC,qBAAqB;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,OAAe,EACf,SAAoB,GACrB,EAAE,kBAAkB,sEAuBpB;yBA3Be,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAsC,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAc,MAAM,eAAe,CAAC;AAI9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,W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;IACpD,2CAA2C;IAC3C,gBAAgB,CAAC,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAEpD,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,sDAAsD;IACtD,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAE/B,gCAAgC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,2DAA2D;IAC3D,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAE5D,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,GAAG,EAAE,CAAC;CAC9B;AAiBD,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,eAmG1C;yBAnGe,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipFloating.d.ts","sourceRoot":"","sources":["../../../../src/components/Tooltip/TooltipFloating/TooltipFloating.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKpD,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAUD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"TooltipFloating.d.ts","sourceRoot":"","sources":["../../../../src/components/Tooltip/TooltipFloating/TooltipFloating.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKpD,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAUD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA4E1D;yBA5Ee,eAAe"}
|
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.0.0-alpha.
|
|
4
|
+
"version": "5.0.0-alpha.16",
|
|
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.0.0-alpha.
|
|
30
|
+
"@mantine/hooks": "5.0.0-alpha.16",
|
|
31
31
|
"react": ">=16.8.0",
|
|
32
32
|
"react-dom": ">=16.8.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@mantine/utils": "5.0.0-alpha.
|
|
36
|
-
"@mantine/styles": "5.0.0-alpha.
|
|
35
|
+
"@mantine/utils": "5.0.0-alpha.16",
|
|
36
|
+
"@mantine/styles": "5.0.0-alpha.16",
|
|
37
37
|
"@radix-ui/react-scroll-area": "0.1.4",
|
|
38
38
|
"react-textarea-autosize": "8.3.4",
|
|
39
39
|
"@floating-ui/react-dom-interactions": "0.3.1"
|