@mantine/core 4.1.1 → 4.1.4
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/ActionIcon/ActionIcon.js.map +1 -1
- package/cjs/components/Alert/Alert.js +12 -0
- package/cjs/components/Alert/Alert.js.map +1 -1
- package/cjs/components/Anchor/Anchor.js.map +1 -1
- package/cjs/components/AppShell/HorizontalSection/HorizontalSection.js +2 -1
- package/cjs/components/AppShell/HorizontalSection/HorizontalSection.js.map +1 -1
- package/cjs/components/AppShell/HorizontalSection/HorizontalSection.styles.js +2 -2
- package/cjs/components/AppShell/HorizontalSection/HorizontalSection.styles.js.map +1 -1
- package/cjs/components/AppShell/HorizontalSection/Section/Section.js.map +1 -1
- package/cjs/components/Autocomplete/Autocomplete.js +10 -3
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Avatar/Avatar.js.map +1 -1
- package/cjs/components/Badge/Badge.js.map +1 -1
- package/cjs/components/Box/Box.js.map +1 -1
- package/cjs/components/Burger/Burger.js +2 -4
- package/cjs/components/Burger/Burger.js.map +1 -1
- package/cjs/components/Burger/Burger.styles.js +6 -27
- package/cjs/components/Burger/Burger.styles.js.map +1 -1
- package/cjs/components/Button/Button.js.map +1 -1
- package/cjs/components/Button/UnstyledButton/UnstyledButton.js +2 -2
- package/cjs/components/Button/UnstyledButton/UnstyledButton.js.map +1 -1
- package/cjs/components/Card/Card.js +1 -1
- package/cjs/components/Card/Card.js.map +1 -1
- package/cjs/components/Card/CardSection/CardSection.js.map +1 -1
- package/cjs/components/Center/Center.js.map +1 -1
- package/cjs/components/ColorSwatch/ColorSwatch.js.map +1 -1
- package/cjs/components/Grid/Col/Col.js +4 -3
- package/cjs/components/Grid/Col/Col.js.map +1 -1
- package/cjs/components/Highlight/Highlight.js.map +1 -1
- package/cjs/components/Image/BackgroundImage/BackgroundImage.js.map +1 -1
- package/cjs/components/Input/Input.js.map +1 -1
- package/cjs/components/InputWrapper/InputWrapper.js +2 -1
- package/cjs/components/InputWrapper/InputWrapper.js.map +1 -1
- package/cjs/components/Modal/Modal.js +2 -0
- package/cjs/components/Modal/Modal.js.map +1 -1
- package/cjs/components/MultiSelect/MultiSelect.js +20 -8
- package/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/cjs/components/MultiSelect/MultiSelect.styles.js +2 -1
- package/cjs/components/MultiSelect/MultiSelect.styles.js.map +1 -1
- package/cjs/components/Notification/Notification.js +1 -1
- package/cjs/components/Notification/Notification.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +3 -2
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/NumberInput/NumberInput.js +3 -1
- package/cjs/components/NumberInput/NumberInput.js.map +1 -1
- package/cjs/components/Overlay/Overlay.js.map +1 -1
- package/cjs/components/Paper/Paper.js.map +1 -1
- package/cjs/components/Popper/Popper.js +3 -4
- package/cjs/components/Popper/Popper.js.map +1 -1
- package/cjs/components/SegmentedControl/SegmentedControl.js +10 -4
- package/cjs/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/cjs/components/SegmentedControl/SegmentedControl.styles.js +5 -2
- package/cjs/components/SegmentedControl/SegmentedControl.styles.js.map +1 -1
- package/cjs/components/Select/Select.js +32 -19
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/Select.styles.js +4 -1
- package/cjs/components/Select/Select.styles.js.map +1 -1
- package/cjs/components/Select/SelectItems/SelectItems.js +1 -1
- package/cjs/components/Select/SelectItems/SelectItems.js.map +1 -1
- package/cjs/components/Select/SelectRightSection/SelectRightSection.js +4 -2
- package/cjs/components/Select/SelectRightSection/SelectRightSection.js.map +1 -1
- package/cjs/components/Select/filter-data/filter-data.js +13 -1
- package/cjs/components/Select/filter-data/filter-data.js.map +1 -1
- package/cjs/components/Slider/RangeSlider/RangeSlider.js +2 -1
- package/cjs/components/Slider/RangeSlider/RangeSlider.js.map +1 -1
- package/cjs/components/Slider/Track/Track.js +5 -3
- package/cjs/components/Slider/Track/Track.js.map +1 -1
- package/cjs/components/Text/Text.js.map +1 -1
- package/cjs/components/Tooltip/FloatingTooltip/FloatingTooltip.js +40 -32
- package/cjs/components/Tooltip/FloatingTooltip/FloatingTooltip.js.map +1 -1
- package/cjs/components/Tooltip/FloatingTooltip/FloatingTooltip.styles.js +3 -2
- package/cjs/components/Tooltip/FloatingTooltip/FloatingTooltip.styles.js.map +1 -1
- package/esm/components/ActionIcon/ActionIcon.js.map +1 -1
- package/esm/components/Alert/Alert.js +12 -0
- package/esm/components/Alert/Alert.js.map +1 -1
- package/esm/components/Anchor/Anchor.js.map +1 -1
- package/esm/components/AppShell/HorizontalSection/HorizontalSection.js +2 -1
- package/esm/components/AppShell/HorizontalSection/HorizontalSection.js.map +1 -1
- package/esm/components/AppShell/HorizontalSection/HorizontalSection.styles.js +2 -2
- package/esm/components/AppShell/HorizontalSection/HorizontalSection.styles.js.map +1 -1
- package/esm/components/AppShell/HorizontalSection/Section/Section.js.map +1 -1
- package/esm/components/Autocomplete/Autocomplete.js +10 -3
- package/esm/components/Autocomplete/Autocomplete.js.map +1 -1
- package/esm/components/Avatar/Avatar.js.map +1 -1
- package/esm/components/Badge/Badge.js.map +1 -1
- package/esm/components/Box/Box.js.map +1 -1
- package/esm/components/Burger/Burger.js +2 -4
- package/esm/components/Burger/Burger.js.map +1 -1
- package/esm/components/Burger/Burger.styles.js +6 -27
- package/esm/components/Burger/Burger.styles.js.map +1 -1
- package/esm/components/Button/Button.js.map +1 -1
- package/esm/components/Button/UnstyledButton/UnstyledButton.js +2 -2
- package/esm/components/Button/UnstyledButton/UnstyledButton.js.map +1 -1
- package/esm/components/Card/Card.js +1 -1
- package/esm/components/Card/Card.js.map +1 -1
- package/esm/components/Card/CardSection/CardSection.js.map +1 -1
- package/esm/components/Center/Center.js.map +1 -1
- package/esm/components/ColorSwatch/ColorSwatch.js.map +1 -1
- package/esm/components/Grid/Col/Col.js +4 -3
- package/esm/components/Grid/Col/Col.js.map +1 -1
- package/esm/components/Highlight/Highlight.js.map +1 -1
- package/esm/components/Image/BackgroundImage/BackgroundImage.js.map +1 -1
- package/esm/components/Input/Input.js.map +1 -1
- package/esm/components/InputWrapper/InputWrapper.js +2 -1
- package/esm/components/InputWrapper/InputWrapper.js.map +1 -1
- package/esm/components/Modal/Modal.js +2 -0
- package/esm/components/Modal/Modal.js.map +1 -1
- package/esm/components/MultiSelect/MultiSelect.js +20 -8
- package/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/esm/components/MultiSelect/MultiSelect.styles.js +2 -1
- package/esm/components/MultiSelect/MultiSelect.styles.js.map +1 -1
- package/esm/components/Notification/Notification.js +1 -1
- package/esm/components/Notification/Notification.js.map +1 -1
- package/esm/components/Notification/Notification.styles.js +3 -2
- package/esm/components/Notification/Notification.styles.js.map +1 -1
- package/esm/components/NumberInput/NumberInput.js +3 -1
- package/esm/components/NumberInput/NumberInput.js.map +1 -1
- package/esm/components/Overlay/Overlay.js.map +1 -1
- package/esm/components/Paper/Paper.js.map +1 -1
- package/esm/components/Popper/Popper.js +3 -4
- package/esm/components/Popper/Popper.js.map +1 -1
- package/esm/components/SegmentedControl/SegmentedControl.js +11 -5
- package/esm/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/esm/components/SegmentedControl/SegmentedControl.styles.js +5 -2
- package/esm/components/SegmentedControl/SegmentedControl.styles.js.map +1 -1
- package/esm/components/Select/Select.js +32 -19
- package/esm/components/Select/Select.js.map +1 -1
- package/esm/components/Select/Select.styles.js +4 -1
- package/esm/components/Select/Select.styles.js.map +1 -1
- package/esm/components/Select/SelectItems/SelectItems.js +1 -1
- package/esm/components/Select/SelectItems/SelectItems.js.map +1 -1
- package/esm/components/Select/SelectRightSection/SelectRightSection.js +4 -2
- package/esm/components/Select/SelectRightSection/SelectRightSection.js.map +1 -1
- package/esm/components/Select/filter-data/filter-data.js +13 -1
- package/esm/components/Select/filter-data/filter-data.js.map +1 -1
- package/esm/components/Slider/RangeSlider/RangeSlider.js +2 -1
- package/esm/components/Slider/RangeSlider/RangeSlider.js.map +1 -1
- package/esm/components/Slider/Track/Track.js +5 -3
- package/esm/components/Slider/Track/Track.js.map +1 -1
- package/esm/components/Text/Text.js.map +1 -1
- package/esm/components/Tooltip/FloatingTooltip/FloatingTooltip.js +40 -32
- package/esm/components/Tooltip/FloatingTooltip/FloatingTooltip.js.map +1 -1
- package/esm/components/Tooltip/FloatingTooltip/FloatingTooltip.styles.js +3 -2
- package/esm/components/Tooltip/FloatingTooltip/FloatingTooltip.styles.js.map +1 -1
- package/lib/components/ActionIcon/ActionIcon.d.ts.map +1 -1
- package/lib/components/ActionIcon/CloseButton/CloseButton.d.ts +1 -1
- package/lib/components/Alert/Alert.d.ts.map +1 -1
- package/lib/components/Anchor/Anchor.d.ts.map +1 -1
- package/lib/components/AppShell/HorizontalSection/HorizontalSection.d.ts.map +1 -1
- package/lib/components/AppShell/HorizontalSection/HorizontalSection.styles.d.ts +1 -0
- package/lib/components/AppShell/HorizontalSection/HorizontalSection.styles.d.ts.map +1 -1
- package/lib/components/AppShell/HorizontalSection/Section/Section.d.ts.map +1 -1
- package/lib/components/Autocomplete/Autocomplete.d.ts +4 -0
- package/lib/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Box/Box.d.ts.map +1 -1
- package/lib/components/Burger/Burger.d.ts.map +1 -1
- package/lib/components/Burger/Burger.styles.d.ts.map +1 -1
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.styles.d.ts +2 -2
- package/lib/components/Button/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- package/lib/components/Card/CardSection/CardSection.d.ts.map +1 -1
- package/lib/components/Center/Center.d.ts.map +1 -1
- package/lib/components/ColorSwatch/ColorSwatch.d.ts +4 -2
- package/lib/components/ColorSwatch/ColorSwatch.d.ts.map +1 -1
- package/lib/components/ColorSwatch/index.d.ts +1 -1
- package/lib/components/ColorSwatch/index.d.ts.map +1 -1
- package/lib/components/Grid/Col/Col.d.ts.map +1 -1
- package/lib/components/Highlight/Highlight.d.ts.map +1 -1
- package/lib/components/Image/BackgroundImage/BackgroundImage.d.ts.map +1 -1
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/InputWrapper/InputWrapper.d.ts.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -0
- package/lib/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/lib/components/MultiSelect/MultiSelect.styles.d.ts.map +1 -1
- package/lib/components/Notification/Notification.styles.d.ts +0 -1
- package/lib/components/Notification/Notification.styles.d.ts.map +1 -1
- package/lib/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/lib/components/Overlay/Overlay.d.ts.map +1 -1
- package/lib/components/Paper/Paper.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts +2 -2
- package/lib/components/Popper/Popper.d.ts +1 -6
- package/lib/components/Popper/Popper.d.ts.map +1 -1
- package/lib/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/lib/components/SegmentedControl/SegmentedControl.styles.d.ts.map +1 -1
- package/lib/components/Select/Select.d.ts +4 -0
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.styles.d.ts.map +1 -1
- package/lib/components/Select/SelectRightSection/SelectRightSection.d.ts +2 -1
- package/lib/components/Select/SelectRightSection/SelectRightSection.d.ts.map +1 -1
- package/lib/components/Select/filter-data/filter-data.d.ts +3 -1
- package/lib/components/Select/filter-data/filter-data.d.ts.map +1 -1
- package/lib/components/Slider/RangeSlider/RangeSlider.d.ts.map +1 -1
- package/lib/components/Slider/Track/Track.d.ts +3 -2
- package/lib/components/Slider/Track/Track.d.ts.map +1 -1
- package/lib/components/Tabs/TabControl/TabControl.d.ts +1 -1
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Tooltip/FloatingTooltip/FloatingTooltip.d.ts +14 -4
- package/lib/components/Tooltip/FloatingTooltip/FloatingTooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/FloatingTooltip/FloatingTooltip.styles.d.ts.map +1 -1
- package/package.json +3 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionIcon.js","sources":["../../../src/components/ActionIcon/ActionIcon.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineNumberSize,\n getSharedColorScheme,\n MantineColor,\n PolymorphicComponentProps,\n PolymorphicRef,\n ClassNames,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport useStyles, { sizes, ActionIconVariant } from './ActionIcon.styles';\nimport { Loader, LoaderProps } from '../Loader';\n\nexport type ActionIconStylesNames = ClassNames<typeof useStyles>;\n\ninterface _ActionIconProps extends DefaultProps<ActionIconStylesNames> {\n /** Icon rendered inside button */\n children?: React.ReactNode;\n\n /** Controls appearance */\n variant?: ActionIconVariant;\n\n /** Button hover, active and icon colors from theme, defaults to gray */\n color?: MantineColor;\n\n /** Button border-radius from theme or number to set border-radius in px */\n radius?: MantineNumberSize;\n\n /** Predefined icon size or number to set width and height in px */\n size?: MantineNumberSize;\n\n /** Props spread to Loader component */\n loaderProps?: LoaderProps;\n\n /** Indicate loading state */\n loading?: boolean;\n}\n\nexport type ActionIconProps<C> = PolymorphicComponentProps<C, _ActionIconProps>;\n\ntype ActionIconComponent = (<C = 'button'>(props: ActionIconProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nconst defaultProps: Partial<ActionIconProps<any>> = {\n color: 'gray',\n size: 'md',\n variant: 'hover',\n disabled: false,\n loading: false,\n};\n\nexport const ActionIcon: ActionIconComponent = forwardRef(\n
|
|
1
|
+
{"version":3,"file":"ActionIcon.js","sources":["../../../src/components/ActionIcon/ActionIcon.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineNumberSize,\n getSharedColorScheme,\n MantineColor,\n PolymorphicComponentProps,\n PolymorphicRef,\n ClassNames,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport useStyles, { sizes, ActionIconVariant } from './ActionIcon.styles';\nimport { Loader, LoaderProps } from '../Loader';\n\nexport type ActionIconStylesNames = ClassNames<typeof useStyles>;\n\ninterface _ActionIconProps extends DefaultProps<ActionIconStylesNames> {\n /** Icon rendered inside button */\n children?: React.ReactNode;\n\n /** Controls appearance */\n variant?: ActionIconVariant;\n\n /** Button hover, active and icon colors from theme, defaults to gray */\n color?: MantineColor;\n\n /** Button border-radius from theme or number to set border-radius in px */\n radius?: MantineNumberSize;\n\n /** Predefined icon size or number to set width and height in px */\n size?: MantineNumberSize;\n\n /** Props spread to Loader component */\n loaderProps?: LoaderProps;\n\n /** Indicate loading state */\n loading?: boolean;\n}\n\nexport type ActionIconProps<C> = PolymorphicComponentProps<C, _ActionIconProps>;\n\ntype ActionIconComponent = (<C = 'button'>(props: ActionIconProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nconst defaultProps: Partial<ActionIconProps<any>> = {\n color: 'gray',\n size: 'md',\n variant: 'hover',\n disabled: false,\n loading: false,\n};\n\nexport const ActionIcon: ActionIconComponent = forwardRef(\n (props: ActionIconProps<'button'>, ref: PolymorphicRef<'button'>) => {\n const {\n className,\n color,\n children,\n radius,\n size,\n variant,\n disabled,\n loaderProps,\n loading,\n component,\n styles,\n classNames,\n ...others\n } = useMantineDefaultProps('ActionIcon', defaultProps, props);\n\n const { classes, cx, theme } = useStyles(\n { size, radius, color },\n { name: 'ActionIcon', classNames, styles }\n );\n const colors = getSharedColorScheme({ color, theme, variant: 'light' });\n\n const loader = (\n <Loader color={colors.color} size={theme.fn.size({ size, sizes }) - 12} {...loaderProps} />\n );\n\n return (\n <Box<any>\n component={component || 'button'}\n className={cx(classes[variant], classes.root, { [classes.loading]: loading }, className)}\n type=\"button\"\n ref={ref}\n disabled={disabled || loading}\n {...others}\n >\n {loading ? loader : children}\n </Box>\n );\n }\n) as any;\n\nActionIcon.displayName = '@mantine/core/ActionIcon';\n"],"names":["forwardRef","useMantineDefaultProps","styles","useStyles","getSharedColorScheme","React","Loader","sizes","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,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,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,EAAE,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I,EAAE,QAAQ;AAClB,IAAI,GAAG;AACP,IAAI,QAAQ,EAAE,QAAQ,IAAI,OAAO;AACjC,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAC3C,CAAC,EAAE;AACH,UAAU,CAAC,WAAW,GAAG,0BAA0B;;;;"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var styles = require('@mantine/styles');
|
|
7
|
+
var hooks = require('@mantine/hooks');
|
|
7
8
|
var Alert_styles = require('./Alert.styles.js');
|
|
8
9
|
var Box = require('../Box/Box.js');
|
|
9
10
|
var CloseButton = require('../ActionIcon/CloseButton/CloseButton.js');
|
|
@@ -45,6 +46,7 @@ const defaultProps = {
|
|
|
45
46
|
};
|
|
46
47
|
const Alert = React.forwardRef((props, ref) => {
|
|
47
48
|
const _a = styles.useMantineDefaultProps("Alert", defaultProps, props), {
|
|
49
|
+
id,
|
|
48
50
|
className,
|
|
49
51
|
title,
|
|
50
52
|
variant,
|
|
@@ -58,6 +60,7 @@ const Alert = React.forwardRef((props, ref) => {
|
|
|
58
60
|
withCloseButton,
|
|
59
61
|
closeButtonLabel
|
|
60
62
|
} = _a, others = __objRest(_a, [
|
|
63
|
+
"id",
|
|
61
64
|
"className",
|
|
62
65
|
"title",
|
|
63
66
|
"variant",
|
|
@@ -72,7 +75,14 @@ const Alert = React.forwardRef((props, ref) => {
|
|
|
72
75
|
"closeButtonLabel"
|
|
73
76
|
]);
|
|
74
77
|
const { classes, cx } = Alert_styles['default']({ color, radius, variant }, { classNames, styles: styles$1, name: "Alert" });
|
|
78
|
+
const rootId = hooks.useUuid(id);
|
|
79
|
+
const titleId = title && id && `${rootId}-title`;
|
|
80
|
+
const bodyId = `${rootId}-body`;
|
|
75
81
|
return /* @__PURE__ */ React__default.createElement(Box.Box, __spreadValues({
|
|
82
|
+
id: rootId,
|
|
83
|
+
role: "alert",
|
|
84
|
+
"aria-labelledby": titleId,
|
|
85
|
+
"aria-describedby": bodyId,
|
|
76
86
|
className: cx(classes.root, classes[variant], className),
|
|
77
87
|
ref
|
|
78
88
|
}, others), /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -84,6 +94,7 @@ const Alert = React.forwardRef((props, ref) => {
|
|
|
84
94
|
}, title && /* @__PURE__ */ React__default.createElement("div", {
|
|
85
95
|
className: classes.title
|
|
86
96
|
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
97
|
+
id: titleId,
|
|
87
98
|
className: classes.label
|
|
88
99
|
}, title), withCloseButton && /* @__PURE__ */ React__default.createElement(CloseButton.CloseButton, {
|
|
89
100
|
className: classes.closeButton,
|
|
@@ -93,6 +104,7 @@ const Alert = React.forwardRef((props, ref) => {
|
|
|
93
104
|
iconSize: 16,
|
|
94
105
|
"aria-label": closeButtonLabel
|
|
95
106
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107
|
+
id: bodyId,
|
|
96
108
|
className: classes.message
|
|
97
109
|
}, children))));
|
|
98
110
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineColor,\n ClassNames,\n MantineNumberSize,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport {
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineColor,\n ClassNames,\n MantineNumberSize,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { useUuid } from '@mantine/hooks';\nimport { CloseButton } from '../ActionIcon';\nimport { Box } from '../Box';\nimport useStyles from './Alert.styles';\n\nexport type AlertVariant = 'filled' | 'outline' | 'light';\nexport type AlertStylesNames = ClassNames<typeof useStyles>;\n\nexport interface AlertProps\n extends DefaultProps<AlertStylesNames>,\n Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> {\n /** Alert title */\n title?: React.ReactNode;\n\n /** Controls Alert background, color and border styles, defaults to light */\n variant?: AlertVariant;\n\n /** Alert message */\n children: React.ReactNode;\n\n /** Color from theme.colors */\n color?: MantineColor;\n\n /** Icon displayed next to title */\n icon?: React.ReactNode;\n\n /** True to display close button */\n withCloseButton?: boolean;\n\n /** Called when close button is clicked */\n onClose?(): void;\n\n /** Close button aria-label */\n closeButtonLabel?: string;\n\n /** Radius from theme.radius, or number to set border-radius in px, defaults to theme.defaultRadius */\n radius?: MantineNumberSize;\n}\n\nconst defaultProps: Partial<AlertProps> = {\n variant: 'light',\n};\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>((props: AlertProps, ref) => {\n const {\n id,\n className,\n title,\n variant,\n children,\n color,\n classNames,\n icon,\n styles,\n onClose,\n radius,\n withCloseButton,\n closeButtonLabel,\n ...others\n } = useMantineDefaultProps('Alert', defaultProps, props);\n\n const { classes, cx } = useStyles(\n { color, radius, variant },\n { classNames, styles, name: 'Alert' }\n );\n\n const rootId = useUuid(id);\n\n const titleId = title && id && `${rootId}-title`;\n const bodyId = `${rootId}-body`;\n\n return (\n <Box\n id={rootId}\n role=\"alert\"\n aria-labelledby={titleId}\n aria-describedby={bodyId}\n className={cx(classes.root, classes[variant], className)}\n ref={ref}\n {...others}\n >\n <div className={classes.wrapper}>\n {icon && <div className={classes.icon}>{icon}</div>}\n\n <div className={classes.body}>\n {title && (\n <div className={classes.title}>\n <span id={titleId} className={classes.label}>\n {title}\n </span>\n\n {withCloseButton && (\n <CloseButton\n className={classes.closeButton}\n onClick={() => onClose?.()}\n variant=\"transparent\"\n size={16}\n iconSize={16}\n aria-label={closeButtonLabel}\n />\n )}\n </div>\n )}\n\n <div id={bodyId} className={classes.message}>\n {children}\n </div>\n </div>\n </div>\n </Box>\n );\n});\n\nAlert.displayName = '@mantine/core/Alert';\n"],"names":["forwardRef","useMant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IAAI;AAC3B,GAAG,EAAE,KAAK,oBAAoBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AACzD,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,GAAG,kBAAkBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE;AACjD,IAAI,EAAE,EAAE,OAAO;AACf,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,GAAG,EAAE,KAAK,CAAC,EAAE,eAAe,oBAAoBA,cAAK,CAAC,aAAa,CAACE,uBAAW,EAAE;AACjF,IAAI,SAAS,EAAE,OAAO,CAAC,WAAW;AAClC,IAAI,OAAO,EAAE,MAAM,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,EAAE;AACvD,IAAI,OAAO,EAAE,aAAa;AAC1B,IAAI,IAAI,EAAE,EAAE;AACZ,IAAI,QAAQ,EAAE,EAAE;AAChB,IAAI,YAAY,EAAE,gBAAgB;AAClC,GAAG,CAAC,CAAC,kBAAkBF,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AAClD,IAAI,EAAE,EAAE,MAAM;AACd,IAAI,SAAS,EAAE,OAAO,CAAC,OAAO;AAC9B,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,EAAE;AACH,KAAK,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Anchor.js","sources":["../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { PolymorphicComponentProps, PolymorphicRef, useMantineDefaultProps } from '@mantine/styles';\nimport { Text, SharedTextProps } from '../Text/Text';\nimport useStyles from './Anchor.styles';\n\nexport type AnchorProps<C> = PolymorphicComponentProps<C, SharedTextProps>;\n\ntype AnchorComponent = (<C = 'a'>(props: AnchorProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nconst defaultProps: Partial<AnchorProps<any>> = {};\n\nexport const Anchor: AnchorComponent = forwardRef(\n
|
|
1
|
+
{"version":3,"file":"Anchor.js","sources":["../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { PolymorphicComponentProps, PolymorphicRef, useMantineDefaultProps } from '@mantine/styles';\nimport { Text, SharedTextProps } from '../Text/Text';\nimport useStyles from './Anchor.styles';\n\nexport type AnchorProps<C> = PolymorphicComponentProps<C, SharedTextProps>;\n\ntype AnchorComponent = (<C = 'a'>(props: AnchorProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nconst defaultProps: Partial<AnchorProps<any>> = {};\n\nexport const Anchor: AnchorComponent = forwardRef(\n (props: AnchorProps<'a'>, ref: PolymorphicRef<'a'>) => {\n const { component, className, classNames, styles, ...others } = useMantineDefaultProps(\n 'Anchor',\n defaultProps,\n props\n );\n const { classes, cx } = useStyles(null, { name: 'Anchor', classNames, styles });\n const buttonProps = component === 'button' ? { type: 'button' } : null;\n\n return (\n <Text\n component={component || 'a'}\n variant=\"link\"\n ref={ref}\n className={cx(classes.root, className)}\n {...buttonProps}\n {...others}\n />\n );\n }\n) as any;\n\nAnchor.displayName = '@mantine/core/Anchor';\n"],"names":["forwardRef","useMantineDefaultProps","styles","useStyles","React","Text"],"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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
hiddenBreakpoint,
|
|
82
|
-
zIndex: ctx.zIndex || zIndex
|
|
82
|
+
zIndex: ctx.zIndex || zIndex,
|
|
83
|
+
section
|
|
83
84
|
}, { classNames, styles: styles$1, name: __staticSelector });
|
|
84
85
|
const breakpoints = getSortedBreakpoints.getSortedBreakpoints(width, theme).reduce((acc, [breakpoint, breakpointSize]) => {
|
|
85
86
|
acc[`@media (min-width: ${breakpoint + 1}px)`] = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalSection.js","sources":["../../../../src/components/AppShell/HorizontalSection/HorizontalSection.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n ClassNames,\n DefaultProps,\n MantineNumberSize,\n getDefaultZIndex,\n ForwardRefWithStaticComponents,\n Global,\n} from '@mantine/styles';\nimport { Box } from '../../Box';\nimport { useAppShellContext } from '../AppShell.context';\nimport { getSortedBreakpoints } from './get-sorted-breakpoints/get-sorted-breakpoints';\nimport { Section } from './Section/Section';\nimport useStyles, {\n HorizontalSectionPosition,\n HorizontalSectionWidth,\n} from './HorizontalSection.styles';\n\nexport type HorizontalSectionStylesNames = ClassNames<typeof useStyles>;\n\nexport interface HorizontalSectionSharedProps extends DefaultProps<HorizontalSectionStylesNames> {\n /** Component width with breakpoints */\n width?: HorizontalSectionWidth;\n\n /** Component height */\n height?: string | number;\n\n /** HorizontalSection content */\n children: React.ReactNode;\n\n /** Set position to fixed */\n fixed?: boolean;\n\n /** Position for fixed variant */\n position?: HorizontalSectionPosition;\n\n /** Breakpoint at which component will be hidden if hidden prop is true */\n hiddenBreakpoint?: MantineNumberSize;\n\n /** Set to true to hide component at hiddenBreakpoint */\n hidden?: boolean;\n\n /** z-index */\n zIndex?: number;\n}\n\nexport interface HorizontalSectionProps\n extends HorizontalSectionSharedProps,\n Omit<React.ComponentPropsWithRef<'nav'>, 'children'> {\n section: 'navbar' | 'aside';\n __staticSelector: string;\n}\n\ntype HorizontalSectionComponent = ForwardRefWithStaticComponents<\n HorizontalSectionProps,\n { Section: typeof Section }\n>;\n\nexport const HorizontalSection: HorizontalSectionComponent = forwardRef<\n HTMLElement,\n HorizontalSectionProps\n>(\n (\n {\n width,\n height,\n fixed = false,\n position,\n zIndex = getDefaultZIndex('app'),\n hiddenBreakpoint = 'md',\n hidden = false,\n className,\n classNames,\n styles,\n children,\n section,\n __staticSelector,\n ...others\n }: HorizontalSectionProps,\n ref\n ) => {\n const ctx = useAppShellContext();\n\n const { classes, cx, theme } = useStyles(\n {\n width,\n height,\n fixed: ctx.fixed || fixed,\n position,\n hiddenBreakpoint,\n zIndex: ctx.zIndex || zIndex,\n },\n { classNames, styles, name: __staticSelector }\n );\n\n const breakpoints = getSortedBreakpoints(width, theme).reduce(\n (acc, [breakpoint, breakpointSize]) => {\n acc[`@media (min-width: ${breakpoint + 1}px)`] = {\n [`--mantine-${section}-width`]: `${breakpointSize}px`,\n };\n\n return acc;\n },\n {}\n );\n\n return (\n <Box\n component={section === 'navbar' ? 'nav' : 'aside'}\n ref={ref}\n className={cx(classes.root, { [classes.hidden]: hidden }, className)}\n {...others}\n >\n {children}\n\n <Global\n styles={() => ({\n ':root': {\n [`--mantine-${section}-width`]: width?.base ? `${width.base}px` : '0px',\n ...breakpoints,\n },\n })}\n />\n </Box>\n );\n }\n) as any;\n\nHorizontalSection.Section = Section;\nHorizontalSection.displayName = '@mantine/core/HorizontalSection';\n"],"names":["forwardRef","getDefaultZIndex","styles","useAppShellContext","useStyles","getSortedBreakpoints","React","Box","Global","Section"],"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,GA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AAE,CAAC,GAAG,KAAK;AACzG,OAAO,EAAE,WAAW,CAAC;AACrB,KAAK,CAAC;AACN,GAAG,CAAC,CAAC,CAAC;AACN,CAAC,EAAE;AACH,iBAAiB,CAAC,OAAO,GAAGC,eAAO,CAAC;AACpC,iBAAiB,CAAC,WAAW,GAAG,iCAAiC;;;;"}
|
|
1
|
+
{"version":3,"file":"HorizontalSection.js","sources":["../../../../src/components/AppShell/HorizontalSection/HorizontalSection.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n ClassNames,\n DefaultProps,\n MantineNumberSize,\n getDefaultZIndex,\n ForwardRefWithStaticComponents,\n Global,\n} from '@mantine/styles';\nimport { Box } from '../../Box';\nimport { useAppShellContext } from '../AppShell.context';\nimport { getSortedBreakpoints } from './get-sorted-breakpoints/get-sorted-breakpoints';\nimport { Section } from './Section/Section';\nimport useStyles, {\n HorizontalSectionPosition,\n HorizontalSectionWidth,\n} from './HorizontalSection.styles';\n\nexport type HorizontalSectionStylesNames = ClassNames<typeof useStyles>;\n\nexport interface HorizontalSectionSharedProps extends DefaultProps<HorizontalSectionStylesNames> {\n /** Component width with breakpoints */\n width?: HorizontalSectionWidth;\n\n /** Component height */\n height?: string | number;\n\n /** HorizontalSection content */\n children: React.ReactNode;\n\n /** Set position to fixed */\n fixed?: boolean;\n\n /** Position for fixed variant */\n position?: HorizontalSectionPosition;\n\n /** Breakpoint at which component will be hidden if hidden prop is true */\n hiddenBreakpoint?: MantineNumberSize;\n\n /** Set to true to hide component at hiddenBreakpoint */\n hidden?: boolean;\n\n /** z-index */\n zIndex?: number;\n}\n\nexport interface HorizontalSectionProps\n extends HorizontalSectionSharedProps,\n Omit<React.ComponentPropsWithRef<'nav'>, 'children'> {\n section: 'navbar' | 'aside';\n __staticSelector: string;\n}\n\ntype HorizontalSectionComponent = ForwardRefWithStaticComponents<\n HorizontalSectionProps,\n { Section: typeof Section }\n>;\n\nexport const HorizontalSection: HorizontalSectionComponent = forwardRef<\n HTMLElement,\n HorizontalSectionProps\n>(\n (\n {\n width,\n height,\n fixed = false,\n position,\n zIndex = getDefaultZIndex('app'),\n hiddenBreakpoint = 'md',\n hidden = false,\n className,\n classNames,\n styles,\n children,\n section,\n __staticSelector,\n ...others\n }: HorizontalSectionProps,\n ref\n ) => {\n const ctx = useAppShellContext();\n\n const { classes, cx, theme } = useStyles(\n {\n width,\n height,\n fixed: ctx.fixed || fixed,\n position,\n hiddenBreakpoint,\n zIndex: ctx.zIndex || zIndex,\n section,\n },\n { classNames, styles, name: __staticSelector }\n );\n\n const breakpoints = getSortedBreakpoints(width, theme).reduce(\n (acc, [breakpoint, breakpointSize]) => {\n acc[`@media (min-width: ${breakpoint + 1}px)`] = {\n [`--mantine-${section}-width`]: `${breakpointSize}px`,\n };\n\n return acc;\n },\n {}\n );\n\n return (\n <Box\n component={section === 'navbar' ? 'nav' : 'aside'}\n ref={ref}\n className={cx(classes.root, { [classes.hidden]: hidden }, className)}\n {...others}\n >\n {children}\n\n <Global\n styles={() => ({\n ':root': {\n [`--mantine-${section}-width`]: width?.base ? `${width.base}px` : '0px',\n ...breakpoints,\n },\n })}\n />\n </Box>\n );\n }\n) as any;\n\nHorizontalSection.Section = Section;\nHorizontalSection.displayName = '@mantine/core/HorizontalSection';\n"],"names":["forwardRef","getDefaultZIndex","styles","useAppShellContext","useStyles","getSortedBreakpoints","React","Box","Global","Section"],"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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,CAAC;AACN,GAAG,CAAC,CAAC,CAAC;AACN,CAAC,EAAE;AACH,iBAAiB,CAAC,OAAO,GAAGC,eAAO,CAAC;AACpC,iBAAiB,CAAC,WAAW,GAAG,iCAAiC;;;;"}
|
|
@@ -24,7 +24,7 @@ var __spreadValues = (a, b) => {
|
|
|
24
24
|
return a;
|
|
25
25
|
};
|
|
26
26
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
-
var useStyles = styles.createStyles((theme, { height, width, fixed, position, hiddenBreakpoint, zIndex }) => {
|
|
27
|
+
var useStyles = styles.createStyles((theme, { height, width, fixed, position, hiddenBreakpoint, zIndex, section }) => {
|
|
28
28
|
const breakpoints = typeof width === "object" && width !== null ? getSortedBreakpoints.getSortedBreakpoints(width, theme).reduce((acc, [breakpoint, breakpointSize]) => {
|
|
29
29
|
acc[`@media (min-width: ${breakpoint + 1}px)`] = {
|
|
30
30
|
width: breakpointSize,
|
|
@@ -43,7 +43,7 @@ var useStyles = styles.createStyles((theme, { height, width, fixed, position, hi
|
|
|
43
43
|
display: "flex",
|
|
44
44
|
flexDirection: "column",
|
|
45
45
|
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white,
|
|
46
|
-
borderRight: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2]}`
|
|
46
|
+
[section === "navbar" ? "borderRight" : "borderLeft"]: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2]}`
|
|
47
47
|
}), breakpoints),
|
|
48
48
|
hidden: {
|
|
49
49
|
[`@media (max-width: ${theme.fn.size({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalSection.styles.js","sources":["../../../../src/components/AppShell/HorizontalSection/HorizontalSection.styles.ts"],"sourcesContent":["import { createStyles, MantineNumberSize } from '@mantine/styles';\nimport { getSortedBreakpoints } from './get-sorted-breakpoints/get-sorted-breakpoints';\n\nexport type HorizontalSectionWidth = Partial<Record<string, string | number>>;\n\nexport interface HorizontalSectionPosition {\n top?: number;\n left?: number;\n bottom?: number;\n right?: number;\n}\n\ninterface HorizontalSectionStyles {\n width: Partial<Record<string, string | number>>;\n height: string | number;\n position: HorizontalSectionPosition;\n hiddenBreakpoint: MantineNumberSize;\n fixed: boolean;\n zIndex: number;\n}\n\nexport default createStyles(\n (\n theme,\n { height, width, fixed, position, hiddenBreakpoint, zIndex }: HorizontalSectionStyles\n ) => {\n const breakpoints =\n typeof width === 'object' && width !== null\n ? getSortedBreakpoints(width, theme).reduce((acc, [breakpoint, breakpointSize]) => {\n acc[`@media (min-width: ${breakpoint + 1}px)`] = {\n width: breakpointSize,\n minWidth: breakpointSize,\n };\n\n return acc;\n }, {})\n : null;\n\n return {\n root: {\n ...theme.fn.fontStyles(),\n ...position,\n top: position?.top || 'var(--mantine-header-height)',\n zIndex,\n height:\n height ||\n 'calc(100vh - var(--mantine-header-height, 0px) - var(--mantine-footer-height, 0px))',\n width: width?.base || '100%',\n position: fixed ? 'fixed' : 'static',\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n borderRight: `1px solid ${\n theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2]\n }`,\n ...breakpoints,\n },\n\n hidden: {\n [`@media (max-width: ${theme.fn.size({\n size: hiddenBreakpoint,\n sizes: theme.breakpoints,\n })}px)`]: {\n display: 'none',\n },\n },\n };\n }\n);\n"],"names":["createStyles","getSortedBreakpoints"],"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,S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","sources":["../../../../src/components/AppShell/HorizontalSection/HorizontalSection.styles.ts"],"sourcesContent":["import { createStyles, MantineNumberSize } from '@mantine/styles';\nimport { getSortedBreakpoints } from './get-sorted-breakpoints/get-sorted-breakpoints';\n\nexport type HorizontalSectionWidth = Partial<Record<string, string | number>>;\n\nexport interface HorizontalSectionPosition {\n top?: number;\n left?: number;\n bottom?: number;\n right?: number;\n}\n\ninterface HorizontalSectionStyles {\n width: Partial<Record<string, string | number>>;\n height: string | number;\n position: HorizontalSectionPosition;\n hiddenBreakpoint: MantineNumberSize;\n fixed: boolean;\n zIndex: number;\n section: 'navbar' | 'aside';\n}\n\nexport default createStyles(\n (\n theme,\n { height, width, fixed, position, hiddenBreakpoint, zIndex, section }: HorizontalSectionStyles\n ) => {\n const breakpoints =\n typeof width === 'object' && width !== null\n ? getSortedBreakpoints(width, theme).reduce((acc, [breakpoint, breakpointSize]) => {\n acc[`@media (min-width: ${breakpoint + 1}px)`] = {\n width: breakpointSize,\n minWidth: breakpointSize,\n };\n\n return acc;\n }, {})\n : null;\n\n return {\n root: {\n ...theme.fn.fontStyles(),\n ...position,\n top: position?.top || 'var(--mantine-header-height)',\n zIndex,\n height:\n height ||\n 'calc(100vh - var(--mantine-header-height, 0px) - var(--mantine-footer-height, 0px))',\n width: width?.base || '100%',\n position: fixed ? 'fixed' : 'static',\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n [section === 'navbar' ? 'borderRight' : 'borderLeft']: `1px solid ${\n theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2]\n }`,\n ...breakpoints,\n },\n\n hidden: {\n [`@media (max-width: ${theme.fn.size({\n size: hiddenBreakpoint,\n sizes: theme.breakpoints,\n })}px)`]: {\n display: 'none',\n },\n },\n };\n }\n);\n"],"names":["createStyles","getSortedBreakpoints"],"mappings":";;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC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AAM,eAAe,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK;AACxF,MAAM,CAAC,OAAO,KAAK,QAAQ,GAAG,aAAa,GAAG,YAAY,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACtJ,KAAK,CAAC,EAAE,WAAW,CAAC;AACpB,IAAI,MAAM,EAAE;AACZ,MAAM,CAAC,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC;AAC3C,QAAQ,IAAI,EAAE,gBAAgB;AAC9B,QAAQ,KAAK,EAAE,KAAK,CAAC,WAAW;AAChC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG;AAChB,QAAQ,OAAO,EAAE,MAAM;AACvB,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.js","sources":["../../../../../src/components/AppShell/HorizontalSection/Section/Section.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { DefaultProps, PolymorphicComponentProps, PolymorphicRef } from '@mantine/styles';\nimport { Box } from '../../../Box';\n\ninterface _SectionProps extends DefaultProps {\n /** Section children */\n children: React.ReactNode;\n\n /** Force section to take all available height */\n grow?: boolean;\n}\n\nexport type SectionProps<C> = PolymorphicComponentProps<C, _SectionProps>;\n\ntype SectionComponent = <C = 'div'>(props: SectionProps<C>) => React.ReactElement;\n\nexport const Section: SectionComponent & { displayName?: string } = forwardRef(\n
|
|
1
|
+
{"version":3,"file":"Section.js","sources":["../../../../../src/components/AppShell/HorizontalSection/Section/Section.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { DefaultProps, PolymorphicComponentProps, PolymorphicRef } from '@mantine/styles';\nimport { Box } from '../../../Box';\n\ninterface _SectionProps extends DefaultProps {\n /** Section children */\n children: React.ReactNode;\n\n /** Force section to take all available height */\n grow?: boolean;\n}\n\nexport type SectionProps<C> = PolymorphicComponentProps<C, _SectionProps>;\n\ntype SectionComponent = <C = 'div'>(props: SectionProps<C>) => React.ReactElement;\n\nexport const Section: SectionComponent & { displayName?: string } = forwardRef(\n (\n { component, children, grow = false, sx, ...others }: SectionProps<'div'>,\n ref: PolymorphicRef<'div'>\n ) => (\n <Box\n component={component || 'div'}\n ref={ref}\n sx={[{ flex: grow ? 1 : 0, boxSizing: 'border-box' }, ...(Array.isArray(sx) ? sx : [sx])]}\n {...others}\n >\n {children}\n </Box>\n )\n) as any;\n\nSection.displayName = '@mantine/core/Section';\n"],"names":["forwardRef","React","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,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,CA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,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,GAAG,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/H,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAACC,OAAG,EAAE,cAAc,CAAC;AACjE,IAAI,SAAS,EAAE,SAAS,IAAI,KAAK;AACjC,IAAI,GAAG;AACP,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAC3F,GAAG,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AACxB,CAAC,EAAE;AACH,OAAO,CAAC,WAAW,GAAG,uBAAuB;;;;"}
|
|
@@ -8,6 +8,7 @@ var styles = require('@mantine/styles');
|
|
|
8
8
|
var SelectDropdown = require('../Select/SelectDropdown/SelectDropdown.js');
|
|
9
9
|
var SelectItems = require('../Select/SelectItems/SelectItems.js');
|
|
10
10
|
var DefaultItem = require('../Select/DefaultItem/DefaultItem.js');
|
|
11
|
+
var SelectScrollArea = require('../Select/SelectScrollArea/SelectScrollArea.js');
|
|
11
12
|
var filterData = require('./filter-data/filter-data.js');
|
|
12
13
|
var Autocomplete_styles = require('./Autocomplete.styles.js');
|
|
13
14
|
var InputWrapper = require('../InputWrapper/InputWrapper.js');
|
|
@@ -63,7 +64,8 @@ const defaultProps = {
|
|
|
63
64
|
filter: defaultFilter,
|
|
64
65
|
switchDirectionOnFlip: false,
|
|
65
66
|
zIndex: styles.getDefaultZIndex("popover"),
|
|
66
|
-
dropdownPosition: "
|
|
67
|
+
dropdownPosition: "flip",
|
|
68
|
+
maxDropdownHeight: "auto"
|
|
67
69
|
};
|
|
68
70
|
const Autocomplete = React.forwardRef((props, ref) => {
|
|
69
71
|
const _a = styles.useMantineDefaultProps("Autocomplete", defaultProps, props), {
|
|
@@ -102,7 +104,9 @@ const Autocomplete = React.forwardRef((props, ref) => {
|
|
|
102
104
|
withinPortal,
|
|
103
105
|
switchDirectionOnFlip = false,
|
|
104
106
|
zIndex = styles.getDefaultZIndex("popover"),
|
|
105
|
-
dropdownPosition
|
|
107
|
+
dropdownPosition,
|
|
108
|
+
maxDropdownHeight,
|
|
109
|
+
dropdownComponent,
|
|
106
110
|
errorProps,
|
|
107
111
|
labelProps,
|
|
108
112
|
descriptionProps
|
|
@@ -143,6 +147,8 @@ const Autocomplete = React.forwardRef((props, ref) => {
|
|
|
143
147
|
"switchDirectionOnFlip",
|
|
144
148
|
"zIndex",
|
|
145
149
|
"dropdownPosition",
|
|
150
|
+
"maxDropdownHeight",
|
|
151
|
+
"dropdownComponent",
|
|
146
152
|
"errorProps",
|
|
147
153
|
"labelProps",
|
|
148
154
|
"descriptionProps"
|
|
@@ -284,7 +290,8 @@ const Autocomplete = React.forwardRef((props, ref) => {
|
|
|
284
290
|
transitionTimingFunction,
|
|
285
291
|
uuid,
|
|
286
292
|
shadow,
|
|
287
|
-
maxDropdownHeight
|
|
293
|
+
maxDropdownHeight,
|
|
294
|
+
dropdownComponent: dropdownComponent || SelectScrollArea.SelectScrollArea,
|
|
288
295
|
classNames,
|
|
289
296
|
styles: styles$1,
|
|
290
297
|
__staticSelector: "Autocomplete",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.js","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import React, { useState, forwardRef, useRef } from 'react';\nimport { useUncontrolled, useDidUpdate, useMergedRef, useUuid } from '@mantine/hooks';\nimport {\n DefaultProps,\n ClassNames,\n extractSystemStyles,\n getDefaultZIndex,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { InputWrapper, InputWrapperBaseProps, InputWrapperStylesNames } from '../InputWrapper';\nimport { Input, InputBaseProps, InputStylesNames } from '../Input';\nimport { SelectDropdown, SelectDropdownStylesNames } from '../Select/SelectDropdown/SelectDropdown';\nimport { SelectItems } from '../Select/SelectItems/SelectItems';\nimport { DefaultItem } from '../Select/DefaultItem/DefaultItem';\nimport { filterData } from './filter-data/filter-data';\nimport useStyles from './Autocomplete.styles';\nimport { SelectSharedProps } from '../Select/Select';\n\nexport type AutocompleteStylesNames =\n | InputStylesNames\n | InputWrapperStylesNames\n | SelectDropdownStylesNames\n | ClassNames<typeof useStyles>;\n\nexport interface AutocompleteItem {\n value: string;\n [key: string]: any;\n}\n\nexport interface AutocompleteProps\n extends DefaultProps<AutocompleteStylesNames>,\n InputBaseProps,\n InputWrapperBaseProps,\n SelectSharedProps<AutocompleteItem, string>,\n Omit<React.ComponentPropsWithoutRef<'input'>, 'size' | 'onChange' | 'value' | 'defaultValue'> {\n /** Called when item from dropdown was selected */\n onItemSubmit?(item: AutocompleteItem): void;\n}\n\nexport function defaultFilter(value: string, item: AutocompleteItem) {\n return item.value.toLowerCase().trim().includes(value.toLowerCase().trim());\n}\n\nconst defaultProps: Partial<AutocompleteProps> = {\n required: false,\n size: 'sm',\n shadow: 'sm',\n limit: 5,\n itemComponent: DefaultItem,\n transition: 'pop',\n transitionDuration: 0,\n initiallyOpened: false,\n filter: defaultFilter,\n switchDirectionOnFlip: false,\n zIndex: getDefaultZIndex('popover'),\n dropdownPosition: 'bottom',\n};\n\nexport const Autocomplete = forwardRef<HTMLInputElement, AutocompleteProps>(\n (props: AutocompleteProps, ref) => {\n const {\n className,\n style,\n sx,\n required = false,\n label,\n id,\n error,\n description,\n size = 'sm',\n shadow = 'sm',\n data,\n limit = 5,\n value,\n defaultValue,\n onChange,\n itemComponent = DefaultItem,\n onItemSubmit,\n onKeyDown,\n onFocus,\n onBlur,\n onClick,\n transition = 'skew-up',\n transitionDuration = 0,\n initiallyOpened = false,\n transitionTimingFunction,\n wrapperProps,\n classNames,\n styles,\n filter = defaultFilter,\n nothingFound,\n onDropdownClose,\n onDropdownOpen,\n withinPortal,\n switchDirectionOnFlip = false,\n zIndex = getDefaultZIndex('popover'),\n dropdownPosition = 'bottom',\n errorProps,\n labelProps,\n descriptionProps,\n ...others\n } = useMantineDefaultProps('Autocomplete', defaultProps, props);\n const { classes } = useStyles({ size }, { classNames, styles, name: 'Autocomplete' });\n const { systemStyles, rest } = extractSystemStyles(others);\n const [dropdownOpened, _setDropdownOpened] = useState(initiallyOpened);\n const [hovered, setHovered] = useState(-1);\n const [direction, setDirection] = useState<React.CSSProperties['flexDirection']>('column');\n const inputRef = useRef<HTMLInputElement>(null);\n const uuid = useUuid(id);\n const [_value, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: '',\n onChange,\n rule: (val) => typeof val === 'string',\n });\n\n const setDropdownOpened = (opened: boolean) => {\n _setDropdownOpened(opened);\n const handler = opened ? onDropdownOpen : onDropdownClose;\n typeof handler === 'function' && handler();\n };\n\n useDidUpdate(() => {\n setHovered(0);\n }, [_value]);\n\n const handleItemClick = (item: AutocompleteItem) => {\n handleChange(item.value);\n typeof onItemSubmit === 'function' && onItemSubmit(item);\n setDropdownOpened(false);\n };\n\n const formattedData = data.map((item) => (typeof item === 'string' ? { value: item } : item));\n const filteredData = filterData({ data: formattedData, value: _value, limit, filter });\n\n const handleInputKeydown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n typeof onKeyDown === 'function' && onKeyDown(event);\n\n const isColumn = direction === 'column';\n\n const handleNext = () => {\n setHovered((current) => (current < filteredData.length - 1 ? current + 1 : current));\n };\n\n const handlePrevious = () => {\n setHovered((current) => (current > 0 ? current - 1 : current));\n };\n\n switch (event.nativeEvent.code) {\n case 'ArrowUp': {\n event.preventDefault();\n isColumn ? handlePrevious() : handleNext();\n break;\n }\n\n case 'ArrowDown': {\n event.preventDefault();\n isColumn ? handleNext() : handlePrevious();\n break;\n }\n\n case 'Enter': {\n if (dropdownOpened) {\n event.preventDefault();\n }\n\n if (filteredData[hovered] && dropdownOpened) {\n handleChange(filteredData[hovered].value);\n typeof onItemSubmit === 'function' && onItemSubmit(filteredData[hovered]);\n setDropdownOpened(false);\n }\n break;\n }\n\n case 'Escape': {\n if (dropdownOpened) {\n event.preventDefault();\n setDropdownOpened(false);\n }\n }\n }\n };\n\n const handleInputFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event);\n setDropdownOpened(true);\n };\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onBlur === 'function' && onBlur(event);\n setDropdownOpened(false);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => {\n typeof onClick === 'function' && onClick(event);\n setDropdownOpened(true);\n };\n\n const shouldRenderDropdown =\n dropdownOpened && (filteredData.length > 0 || (filteredData.length === 0 && !!nothingFound));\n\n return (\n <InputWrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n size={size}\n className={className}\n classNames={classNames}\n styles={styles}\n __staticSelector=\"Autocomplete\"\n sx={sx}\n style={style}\n errorProps={errorProps}\n descriptionProps={descriptionProps}\n labelProps={labelProps}\n {...systemStyles}\n {...wrapperProps}\n >\n <div\n className={classes.wrapper}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-owns={`${uuid}-items`}\n aria-controls={uuid}\n aria-expanded={shouldRenderDropdown}\n onMouseLeave={() => setHovered(-1)}\n tabIndex={-1}\n >\n <Input<'input'>\n {...rest}\n data-mantine-stop-propagation={dropdownOpened}\n required={required}\n ref={useMergedRef(ref, inputRef)}\n id={uuid}\n type=\"string\"\n invalid={!!error}\n size={size}\n onKeyDown={handleInputKeydown}\n classNames={classNames}\n styles={styles}\n __staticSelector=\"Autocomplete\"\n value={_value}\n onChange={(event) => {\n handleChange(event.currentTarget.value);\n setDropdownOpened(true);\n }}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n onClick={handleInputClick}\n autoComplete=\"nope\"\n aria-autocomplete=\"list\"\n aria-controls={shouldRenderDropdown ? `${uuid}-items` : null}\n aria-activedescendant={hovered !== -1 ? `${uuid}-${hovered}` : null}\n />\n\n <SelectDropdown\n mounted={shouldRenderDropdown}\n transition={transition}\n transitionDuration={transitionDuration}\n transitionTimingFunction={transitionTimingFunction}\n uuid={uuid}\n shadow={shadow}\n maxDropdownHeight=\"auto\"\n classNames={classNames}\n styles={styles}\n __staticSelector=\"Autocomplete\"\n direction={direction}\n onDirectionChange={setDirection}\n switchDirectionOnFlip={switchDirectionOnFlip}\n referenceElement={inputRef.current}\n withinPortal={withinPortal}\n zIndex={zIndex}\n dropdownPosition={dropdownPosition}\n >\n <SelectItems\n data={filteredData}\n hovered={hovered}\n classNames={classNames}\n styles={styles}\n uuid={uuid}\n __staticSelector=\"Autocomplete\"\n onItemHover={setHovered}\n onItemSelect={handleItemClick}\n itemComponent={itemComponent}\n size={size}\n nothingFound={nothingFound}\n />\n </SelectDropdown>\n </div>\n </InputWrapper>\n );\n }\n);\n\nAutocomplete.displayName = '@mantine/core/Autocomplete';\n"],"names":["DefaultItem","getDefaultZIndex","forwardRef","useMantineDefaultProps","styles","useStyles","extractSystemStyles","useState","useRef","useUuid","useUncontrolled","useDidUpdate","filterData","React","InputWrapper","Input","useMergedRef","SelectDropdown","SelectItems"],"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,KA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AC,EAAE,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI;AACzE,GAAG,CAAC,CAAC,kBAAkBS,cAAK,CAAC,aAAa,CAACI,6BAAc,EAAE;AAC3D,IAAI,OAAO,EAAE,oBAAoB;AACjC,IAAI,UAAU;AACd,IAAI,kBAAkB;AACtB,IAAI,wBAAwB;AAC5B,IAAI,IAAI;AACR,IAAI,MAAM;AACV,IAAI,iBAAiB,EAAE,MAAM;AAC7B,IAAI,UAAU;AACd,YAAIb,QAAM;AACV,IAAI,gBAAgB,EAAE,cAAc;AACpC,IAAI,SAAS;AACb,IAAI,iBAAiB,EAAE,YAAY;AACnC,IAAI,qBAAqB;AACzB,IAAI,gBAAgB,EAAE,QAAQ,CAAC,OAAO;AACtC,IAAI,YAAY;AAChB,IAAI,MAAM;AACV,IAAI,gBAAgB;AACpB,GAAG,kBAAkBS,cAAK,CAAC,aAAa,CAACK,uBAAW,EAAE;AACtD,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,OAAO;AACX,IAAI,UAAU;AACd,YAAId,QAAM;AACV,IAAI,IAAI;AACR,IAAI,gBAAgB,EAAE,cAAc;AACpC,IAAI,WAAW,EAAE,UAAU;AAC3B,IAAI,YAAY,EAAE,eAAe;AACjC,IAAI,aAAa;AACjB,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACR,CAAC,EAAE;AACH,YAAY,CAAC,WAAW,GAAG,4BAA4B;;;;;"}
|
|
1
|
+
{"version":3,"file":"Autocomplete.js","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import React, { useState, forwardRef, useRef } from 'react';\nimport { useUncontrolled, useDidUpdate, useMergedRef, useUuid } from '@mantine/hooks';\nimport {\n DefaultProps,\n ClassNames,\n extractSystemStyles,\n getDefaultZIndex,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { InputWrapper, InputWrapperBaseProps, InputWrapperStylesNames } from '../InputWrapper';\nimport { Input, InputBaseProps, InputStylesNames } from '../Input';\nimport { SelectDropdown, SelectDropdownStylesNames } from '../Select/SelectDropdown/SelectDropdown';\nimport { SelectItems } from '../Select/SelectItems/SelectItems';\nimport { DefaultItem } from '../Select/DefaultItem/DefaultItem';\nimport { SelectScrollArea } from '../Select/SelectScrollArea/SelectScrollArea';\nimport { filterData } from './filter-data/filter-data';\nimport useStyles from './Autocomplete.styles';\nimport { SelectSharedProps } from '../Select/Select';\n\nexport type AutocompleteStylesNames =\n | InputStylesNames\n | InputWrapperStylesNames\n | SelectDropdownStylesNames\n | ClassNames<typeof useStyles>;\n\nexport interface AutocompleteItem {\n value: string;\n [key: string]: any;\n}\n\nexport interface AutocompleteProps\n extends DefaultProps<AutocompleteStylesNames>,\n InputBaseProps,\n InputWrapperBaseProps,\n SelectSharedProps<AutocompleteItem, string>,\n Omit<React.ComponentPropsWithoutRef<'input'>, 'size' | 'onChange' | 'value' | 'defaultValue'> {\n /** Maximum dropdown height */\n maxDropdownHeight?: number | string;\n\n /** Change dropdown component, can be used to add native scrollbars */\n dropdownComponent?: any;\n\n /** Called when item from dropdown was selected */\n onItemSubmit?(item: AutocompleteItem): void;\n}\n\nexport function defaultFilter(value: string, item: AutocompleteItem) {\n return item.value.toLowerCase().trim().includes(value.toLowerCase().trim());\n}\n\nconst defaultProps: Partial<AutocompleteProps> = {\n required: false,\n size: 'sm',\n shadow: 'sm',\n limit: 5,\n itemComponent: DefaultItem,\n transition: 'pop',\n transitionDuration: 0,\n initiallyOpened: false,\n filter: defaultFilter,\n switchDirectionOnFlip: false,\n zIndex: getDefaultZIndex('popover'),\n dropdownPosition: 'flip',\n maxDropdownHeight: 'auto',\n};\n\nexport const Autocomplete = forwardRef<HTMLInputElement, AutocompleteProps>(\n (props: AutocompleteProps, ref) => {\n const {\n className,\n style,\n sx,\n required = false,\n label,\n id,\n error,\n description,\n size = 'sm',\n shadow = 'sm',\n data,\n limit = 5,\n value,\n defaultValue,\n onChange,\n itemComponent = DefaultItem,\n onItemSubmit,\n onKeyDown,\n onFocus,\n onBlur,\n onClick,\n transition = 'skew-up',\n transitionDuration = 0,\n initiallyOpened = false,\n transitionTimingFunction,\n wrapperProps,\n classNames,\n styles,\n filter = defaultFilter,\n nothingFound,\n onDropdownClose,\n onDropdownOpen,\n withinPortal,\n switchDirectionOnFlip = false,\n zIndex = getDefaultZIndex('popover'),\n dropdownPosition,\n maxDropdownHeight,\n dropdownComponent,\n errorProps,\n labelProps,\n descriptionProps,\n ...others\n } = useMantineDefaultProps('Autocomplete', defaultProps, props);\n const { classes } = useStyles({ size }, { classNames, styles, name: 'Autocomplete' });\n const { systemStyles, rest } = extractSystemStyles(others);\n const [dropdownOpened, _setDropdownOpened] = useState(initiallyOpened);\n const [hovered, setHovered] = useState(-1);\n const [direction, setDirection] = useState<React.CSSProperties['flexDirection']>('column');\n const inputRef = useRef<HTMLInputElement>(null);\n const uuid = useUuid(id);\n const [_value, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: '',\n onChange,\n rule: (val) => typeof val === 'string',\n });\n\n const setDropdownOpened = (opened: boolean) => {\n _setDropdownOpened(opened);\n const handler = opened ? onDropdownOpen : onDropdownClose;\n typeof handler === 'function' && handler();\n };\n\n useDidUpdate(() => {\n setHovered(0);\n }, [_value]);\n\n const handleItemClick = (item: AutocompleteItem) => {\n handleChange(item.value);\n typeof onItemSubmit === 'function' && onItemSubmit(item);\n setDropdownOpened(false);\n };\n\n const formattedData = data.map((item) => (typeof item === 'string' ? { value: item } : item));\n const filteredData = filterData({ data: formattedData, value: _value, limit, filter });\n\n const handleInputKeydown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n typeof onKeyDown === 'function' && onKeyDown(event);\n\n const isColumn = direction === 'column';\n\n const handleNext = () => {\n setHovered((current) => (current < filteredData.length - 1 ? current + 1 : current));\n };\n\n const handlePrevious = () => {\n setHovered((current) => (current > 0 ? current - 1 : current));\n };\n\n switch (event.nativeEvent.code) {\n case 'ArrowUp': {\n event.preventDefault();\n isColumn ? handlePrevious() : handleNext();\n break;\n }\n\n case 'ArrowDown': {\n event.preventDefault();\n isColumn ? handleNext() : handlePrevious();\n break;\n }\n\n case 'Enter': {\n if (dropdownOpened) {\n event.preventDefault();\n }\n\n if (filteredData[hovered] && dropdownOpened) {\n handleChange(filteredData[hovered].value);\n typeof onItemSubmit === 'function' && onItemSubmit(filteredData[hovered]);\n setDropdownOpened(false);\n }\n break;\n }\n\n case 'Escape': {\n if (dropdownOpened) {\n event.preventDefault();\n setDropdownOpened(false);\n }\n }\n }\n };\n\n const handleInputFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event);\n setDropdownOpened(true);\n };\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onBlur === 'function' && onBlur(event);\n setDropdownOpened(false);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => {\n typeof onClick === 'function' && onClick(event);\n setDropdownOpened(true);\n };\n\n const shouldRenderDropdown =\n dropdownOpened && (filteredData.length > 0 || (filteredData.length === 0 && !!nothingFound));\n\n return (\n <InputWrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n size={size}\n className={className}\n classNames={classNames}\n styles={styles}\n __staticSelector=\"Autocomplete\"\n sx={sx}\n style={style}\n errorProps={errorProps}\n descriptionProps={descriptionProps}\n labelProps={labelProps}\n {...systemStyles}\n {...wrapperProps}\n >\n <div\n className={classes.wrapper}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-owns={`${uuid}-items`}\n aria-controls={uuid}\n aria-expanded={shouldRenderDropdown}\n onMouseLeave={() => setHovered(-1)}\n tabIndex={-1}\n >\n <Input<'input'>\n {...rest}\n data-mantine-stop-propagation={dropdownOpened}\n required={required}\n ref={useMergedRef(ref, inputRef)}\n id={uuid}\n type=\"string\"\n invalid={!!error}\n size={size}\n onKeyDown={handleInputKeydown}\n classNames={classNames}\n styles={styles}\n __staticSelector=\"Autocomplete\"\n value={_value}\n onChange={(event) => {\n handleChange(event.currentTarget.value);\n setDropdownOpened(true);\n }}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n onClick={handleInputClick}\n autoComplete=\"nope\"\n aria-autocomplete=\"list\"\n aria-controls={shouldRenderDropdown ? `${uuid}-items` : null}\n aria-activedescendant={hovered !== -1 ? `${uuid}-${hovered}` : null}\n />\n\n <SelectDropdown\n mounted={shouldRenderDropdown}\n transition={transition}\n transitionDuration={transitionDuration}\n transitionTimingFunction={transitionTimingFunction}\n uuid={uuid}\n shadow={shadow}\n maxDropdownHeight={maxDropdownHeight}\n dropdownComponent={dropdownComponent || SelectScrollArea}\n classNames={classNames}\n styles={styles}\n __staticSelector=\"Autocomplete\"\n direction={direction}\n onDirectionChange={setDirection}\n switchDirectionOnFlip={switchDirectionOnFlip}\n referenceElement={inputRef.current}\n withinPortal={withinPortal}\n zIndex={zIndex}\n dropdownPosition={dropdownPosition}\n >\n <SelectItems\n data={filteredData}\n hovered={hovered}\n classNames={classNames}\n styles={styles}\n uuid={uuid}\n __staticSelector=\"Autocomplete\"\n onItemHover={setHovered}\n onItemSelect={handleItemClick}\n itemComponent={itemComponent}\n size={size}\n nothingFound={nothingFound}\n />\n </SelectDropdown>\n </div>\n </InputWrapper>\n );\n }\n);\n\nAutocomplete.displayName = '@mantine/core/Autocomplete';\n"],"names":["DefaultItem","getDefaultZIndex","forwardRef","useMantineDefaultProps","styles","useStyles","extractSystemStyles","useState","useRef","useUuid","useUncontrolled","useDidUpdate","filterData","React","InputWrapper","Input","useMergedRef","SelectDropdown","SelectScrollArea","SelectItems"],"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,MAA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AAE;AACH,YAAY,CAAC,WAAW,GAAG,4BAA4B;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { useEffect, useState, forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineNumberSize,\n MantineColor,\n ClassNames,\n PolymorphicComponentProps,\n PolymorphicRef,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport { AvatarPlaceholderIcon } from './AvatarPlaceholderIcon';\nimport useStyles from './Avatar.styles';\n\nexport type AvatarStylesNames = ClassNames<typeof useStyles>;\n\ninterface _AvatarProps extends DefaultProps<AvatarStylesNames> {\n /** Image url */\n src?: string | null;\n\n /** Image alt text or title for placeholder variant */\n alt?: string;\n\n /** Avatar width and height */\n size?: MantineNumberSize;\n\n /** Value from theme.radius or number to set border-radius in px */\n radius?: MantineNumberSize;\n\n /** Color from theme.colors used for letter and icon placeholders */\n color?: MantineColor;\n\n /** `img` element attributes */\n imageProps?: React.ComponentPropsWithoutRef<'img'>;\n\n /** Custom placeholder */\n children?: React.ReactNode;\n}\n\nexport type AvatarProps<C> = PolymorphicComponentProps<C, _AvatarProps>;\n\ntype AvatarComponent = (<C = 'div'>(props: AvatarProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nconst defaultProps: Partial<AvatarProps<any>> = {\n size: 'md',\n color: 'gray',\n};\n\nexport const Avatar: AvatarComponent = forwardRef(\n
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { useEffect, useState, forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineNumberSize,\n MantineColor,\n ClassNames,\n PolymorphicComponentProps,\n PolymorphicRef,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport { AvatarPlaceholderIcon } from './AvatarPlaceholderIcon';\nimport useStyles from './Avatar.styles';\n\nexport type AvatarStylesNames = ClassNames<typeof useStyles>;\n\ninterface _AvatarProps extends DefaultProps<AvatarStylesNames> {\n /** Image url */\n src?: string | null;\n\n /** Image alt text or title for placeholder variant */\n alt?: string;\n\n /** Avatar width and height */\n size?: MantineNumberSize;\n\n /** Value from theme.radius or number to set border-radius in px */\n radius?: MantineNumberSize;\n\n /** Color from theme.colors used for letter and icon placeholders */\n color?: MantineColor;\n\n /** `img` element attributes */\n imageProps?: React.ComponentPropsWithoutRef<'img'>;\n\n /** Custom placeholder */\n children?: React.ReactNode;\n}\n\nexport type AvatarProps<C> = PolymorphicComponentProps<C, _AvatarProps>;\n\ntype AvatarComponent = (<C = 'div'>(props: AvatarProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nconst defaultProps: Partial<AvatarProps<any>> = {\n size: 'md',\n color: 'gray',\n};\n\nexport const Avatar: AvatarComponent = forwardRef(\n (props: AvatarProps<'div'>, ref: PolymorphicRef<'div'>) => {\n const {\n component,\n className,\n size,\n src,\n alt,\n radius,\n children,\n color,\n classNames,\n styles,\n imageProps,\n ...others\n } = useMantineDefaultProps('Avatar', defaultProps, props);\n const { classes, cx } = useStyles(\n { color, radius, size },\n { classNames, styles, name: 'Avatar' }\n );\n const [error, setError] = useState(!src);\n\n useEffect(() => {\n !src ? setError(true) : setError(false);\n }, [src]);\n\n return (\n <Box\n component={component || 'div'}\n className={cx(classes.root, className)}\n ref={ref}\n {...others}\n >\n {error ? (\n <div className={classes.placeholder} title={alt}>\n {children || <AvatarPlaceholderIcon className={classes.placeholderIcon} />}\n </div>\n ) : (\n <img\n {...imageProps}\n className={classes.image}\n src={src}\n alt={alt}\n onError={() => setError(true)}\n />\n )}\n </Box>\n );\n }\n) as any;\n\nAvatar.displayName = '@mantine/core/Avatar';\n"],"names":["forwardRef","useMantineDefaultProps","styles","useStyles","useState","useEffect","React","Box","AvatarPlaceholderIcon"],"mappings":";;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAA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,cAAc,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE;AACjG,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,IAAI,GAAG;AACP,IAAI,GAAG;AACP,IAAI,OAAO,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC;AACjC,GAAG,CAAC,CAAC,CAAC,CAAC;AACP,CAAC,EAAE;AACH,MAAM,CAAC,WAAW,GAAG,sBAAsB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineSize,\n MantineNumberSize,\n MantineGradient,\n MantineColor,\n ClassNames,\n PolymorphicComponentProps,\n PolymorphicRef,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport useStyles from './Badge.styles';\n\nexport type BadgeVariant = 'light' | 'filled' | 'outline' | 'dot' | 'gradient';\nexport type BadgeStylesNames = ClassNames<typeof useStyles>;\n\ninterface _BadgeProps extends DefaultProps<BadgeStylesNames> {\n /** Badge color from theme */\n color?: MantineColor;\n\n /** Controls badge background, color and border styles */\n variant?: BadgeVariant;\n\n /** Controls gradient settings in gradient variant only */\n gradient?: MantineGradient;\n\n /** Defines badge height and font-size */\n size?: MantineSize;\n\n /** Predefined border-radius value from theme.radius or number for border-radius in px */\n radius?: MantineNumberSize;\n\n /** Sets badge width to 100% of parent element, hides overflow text with text-overflow: ellipsis */\n fullWidth?: boolean;\n\n /** Section rendered on the left side of label */\n leftSection?: React.ReactNode;\n\n /** Section rendered on the right side of label */\n rightSection?: React.ReactNode;\n\n /** Badge label */\n children?: React.ReactNode;\n}\n\nexport type BadgeProps<C> = PolymorphicComponentProps<C, _BadgeProps>;\n\ntype BadgeComponent = (<C = 'div'>(props: BadgeProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nconst defaultProps: Partial<BadgeProps<any>> = {\n variant: 'light',\n size: 'md',\n radius: 'xl',\n gradient: { from: 'blue', to: 'cyan', deg: 45 },\n};\n\nexport const Badge: BadgeComponent = forwardRef(\n
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n MantineSize,\n MantineNumberSize,\n MantineGradient,\n MantineColor,\n ClassNames,\n PolymorphicComponentProps,\n PolymorphicRef,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { Box } from '../Box';\nimport useStyles from './Badge.styles';\n\nexport type BadgeVariant = 'light' | 'filled' | 'outline' | 'dot' | 'gradient';\nexport type BadgeStylesNames = ClassNames<typeof useStyles>;\n\ninterface _BadgeProps extends DefaultProps<BadgeStylesNames> {\n /** Badge color from theme */\n color?: MantineColor;\n\n /** Controls badge background, color and border styles */\n variant?: BadgeVariant;\n\n /** Controls gradient settings in gradient variant only */\n gradient?: MantineGradient;\n\n /** Defines badge height and font-size */\n size?: MantineSize;\n\n /** Predefined border-radius value from theme.radius or number for border-radius in px */\n radius?: MantineNumberSize;\n\n /** Sets badge width to 100% of parent element, hides overflow text with text-overflow: ellipsis */\n fullWidth?: boolean;\n\n /** Section rendered on the left side of label */\n leftSection?: React.ReactNode;\n\n /** Section rendered on the right side of label */\n rightSection?: React.ReactNode;\n\n /** Badge label */\n children?: React.ReactNode;\n}\n\nexport type BadgeProps<C> = PolymorphicComponentProps<C, _BadgeProps>;\n\ntype BadgeComponent = (<C = 'div'>(props: BadgeProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nconst defaultProps: Partial<BadgeProps<any>> = {\n variant: 'light',\n size: 'md',\n radius: 'xl',\n gradient: { from: 'blue', to: 'cyan', deg: 45 },\n};\n\nexport const Badge: BadgeComponent = forwardRef(\n (props: BadgeProps<'div'>, ref: PolymorphicRef<'div'>) => {\n const {\n component,\n className,\n color,\n variant,\n fullWidth,\n children,\n size,\n leftSection,\n rightSection,\n radius,\n gradient,\n classNames,\n styles,\n ...others\n } = useMantineDefaultProps('Badge', defaultProps, props);\n\n const { classes, cx } = useStyles(\n {\n size,\n fullWidth,\n color,\n radius,\n gradientFrom: gradient.from,\n gradientTo: gradient.to,\n gradientDeg: gradient.deg,\n },\n { classNames, styles, name: 'Badge' }\n );\n\n return (\n <Box\n component={component || 'div'}\n className={cx(classes[variant], classes.root, className)}\n ref={ref}\n {...others}\n >\n {leftSection && <span className={classes.leftSection}>{leftSection}</span>}\n <span className={classes.inner}>{children}</span>\n {rightSection && <span className={classes.rightSection}>{rightSection}</span>}\n </Box>\n );\n }\n) as any;\n\nBadge.displayName = '@mantine/core/Badge';\n"],"names":["forwardRef","useMantineDefaultProps","styles","useStyles","React","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,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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OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AAC5D,IAAI,GAAG;AACP,GAAG,EAAE,MAAM,CAAC,EAAE,WAAW,oBAAoBD,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE;AACzE,IAAI,SAAS,EAAE,OAAO,CAAC,WAAW;AAClC,GAAG,EAAE,WAAW,CAAC,kBAAkBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE;AAC/D,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,GAAG,EAAE,QAAQ,CAAC,EAAE,YAAY,oBAAoBA,cAAK,CAAC,aAAa,CAAC,MAAM,EAAE;AAC5E,IAAI,SAAS,EAAE,OAAO,CAAC,YAAY;AACnC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;AACpB,CAAC,EAAE;AACH,KAAK,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","sources":["../../../src/components/Box/Box.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n PolymorphicComponentProps,\n PolymorphicRef,\n extractSystemStyles,\n} from '@mantine/styles';\nimport { useSx, BoxSx } from './use-sx/use-sx';\n\ninterface _BoxProps extends Omit<DefaultProps, 'sx'> {\n sx?: BoxSx;\n}\n\nexport type BoxProps<C> = PolymorphicComponentProps<C, _BoxProps>;\n\ntype BoxComponent = (<C = 'div'>(props: BoxProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nexport const Box: BoxComponent = forwardRef(\n
|
|
1
|
+
{"version":3,"file":"Box.js","sources":["../../../src/components/Box/Box.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n DefaultProps,\n PolymorphicComponentProps,\n PolymorphicRef,\n extractSystemStyles,\n} from '@mantine/styles';\nimport { useSx, BoxSx } from './use-sx/use-sx';\n\ninterface _BoxProps extends Omit<DefaultProps, 'sx'> {\n sx?: BoxSx;\n}\n\nexport type BoxProps<C> = PolymorphicComponentProps<C, _BoxProps>;\n\ntype BoxComponent = (<C = 'div'>(props: BoxProps<C>) => React.ReactElement) & {\n displayName?: string;\n};\n\nexport const Box: BoxComponent = forwardRef(\n ({ className, component, style, sx, ...others }: BoxProps<'div'>, ref: PolymorphicRef<'div'>) => {\n const { systemStyles, rest } = extractSystemStyles(others);\n const Element = component || 'div';\n return (\n <Element ref={ref} className={useSx(sx, systemStyles, className)} style={style} {...rest} />\n );\n }\n) as any;\n\nBox.displayName = '@mantine/core/Box';\n"],"names":["forwardRef","extractSystemStyles","React","useSx"],"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,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBA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C3H,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,GAAGC,0BAAmB,CAAC,MAAM,CAAC,CAAC;AAC7D,EAAE,MAAM,OAAO,GAAG,SAAS,IAAI,KAAK,CAAC;AACrC,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAAC,OAAO,EAAE,cAAc,CAAC;AACrE,IAAI,GAAG;AACP,IAAI,SAAS,EAAEC,WAAK,CAAC,EAAE,EAAE,YAAY,EAAE,SAAS,CAAC;AACjD,IAAI,KAAK;AACT,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACZ,CAAC,EAAE;AACH,GAAG,CAAC,WAAW,GAAG,mBAAmB;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var styles = require('@mantine/styles');
|
|
7
7
|
var Burger_styles = require('./Burger.styles.js');
|
|
8
|
-
var
|
|
8
|
+
var UnstyledButton = require('../Button/UnstyledButton/UnstyledButton.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
11
11
|
|
|
@@ -61,9 +61,7 @@ const Burger = React.forwardRef((props, ref) => {
|
|
|
61
61
|
const theme = styles.useMantineTheme();
|
|
62
62
|
const _color = color || (theme.colorScheme === "dark" ? theme.white : theme.black);
|
|
63
63
|
const { classes, cx } = Burger_styles['default']({ color: _color, size }, { classNames, styles: styles$1, name: "Burger" });
|
|
64
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
65
|
-
component: "button",
|
|
66
|
-
type: "button",
|
|
64
|
+
return /* @__PURE__ */ React__default.createElement(UnstyledButton.UnstyledButton, __spreadValues({
|
|
67
65
|
className: cx(classes.root, className),
|
|
68
66
|
ref
|
|
69
67
|
}, others), /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Burger.js","sources":["../../../src/components/Burger/Burger.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n useMantineTheme,\n DefaultProps,\n MantineNumberSize,\n MantineColor,\n ClassNames,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport {
|
|
1
|
+
{"version":3,"file":"Burger.js","sources":["../../../src/components/Burger/Burger.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport {\n useMantineTheme,\n DefaultProps,\n MantineNumberSize,\n MantineColor,\n ClassNames,\n useMantineDefaultProps,\n} from '@mantine/styles';\nimport { UnstyledButton } from '../Button';\nimport useStyles from './Burger.styles';\n\nexport type BurgerStylesNames = Exclude<ClassNames<typeof useStyles>, 'opened'>;\n\nexport interface BurgerProps\n extends DefaultProps<BurgerStylesNames>,\n React.ComponentPropsWithoutRef<'button'> {\n /** Burger state: true for cross, false for burger */\n opened: boolean;\n\n /** Burger color value, not connected to theme.colors, defaults to theme.black with light color scheme and theme.white with dark */\n color?: MantineColor;\n\n /** Predefined burger size or number to set width and height in px */\n size?: MantineNumberSize;\n}\n\nconst defaultProps: Partial<BurgerProps> = {\n size: 'md',\n};\n\nexport const Burger = forwardRef<HTMLButtonElement, BurgerProps>((props: BurgerProps, ref) => {\n const {\n className,\n opened,\n color,\n size = 'md',\n classNames,\n styles,\n ...others\n } = useMantineDefaultProps('Burger', defaultProps, props);\n const theme = useMantineTheme();\n const _color = color || (theme.colorScheme === 'dark' ? theme.white : theme.black);\n const { classes, cx } = useStyles(\n { color: _color, size },\n { classNames, styles, name: 'Burger' }\n );\n\n return (\n <UnstyledButton className={cx(classes.root, className)} ref={ref} {...others}>\n <div className={cx(classes.burger, { [classes.opened]: opened })} />\n </UnstyledButton>\n );\n});\n\nBurger.displayName = '@mantine/core/Burger';\n"],"names":["forwardRef","useMantineDefaultProps","styles","useMantineTheme","useStyles","React","UnstyledButton"],"mappings":";;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,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