@mantine/core 7.16.3 → 8.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Affix/Affix.cjs +5 -5
- package/cjs/components/Affix/Affix.cjs.map +1 -1
- package/cjs/components/Anchor/Anchor.cjs.map +1 -1
- package/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
- package/cjs/components/Chip/Chip.cjs.map +1 -1
- package/cjs/components/Input/Input.cjs.map +1 -1
- package/cjs/components/InputBase/InputBase.cjs.map +1 -1
- package/cjs/components/Kbd/Kbd.cjs +1 -4
- package/cjs/components/Kbd/Kbd.cjs.map +1 -1
- package/cjs/components/Menu/Menu.cjs +2 -7
- package/cjs/components/Menu/Menu.cjs.map +1 -1
- package/cjs/components/Menu/Menu.context.cjs.map +1 -1
- package/cjs/components/Menu/Menu.module.css.cjs +1 -1
- package/cjs/components/Menu/MenuItem/MenuItem.cjs +10 -15
- package/cjs/components/Menu/MenuItem/MenuItem.cjs.map +1 -1
- package/cjs/components/Menu/MenuSub/MenuSub.cjs +71 -0
- package/cjs/components/Menu/MenuSub/MenuSub.cjs.map +1 -0
- package/cjs/components/Menu/MenuSub/MenuSub.context.cjs +21 -0
- package/cjs/components/Menu/MenuSub/MenuSub.context.cjs.map +1 -0
- package/cjs/components/Menu/MenuSubDropdown/MenuSubDropdown.cjs +70 -0
- package/cjs/components/Menu/MenuSubDropdown/MenuSubDropdown.cjs.map +1 -0
- package/cjs/components/Menu/MenuSubItem/MenuSubItem.cjs +115 -0
- package/cjs/components/Menu/MenuSubItem/MenuSubItem.cjs.map +1 -0
- package/cjs/components/Menu/MenuSubTarget/MenuSubTarget.cjs +33 -0
- package/cjs/components/Menu/MenuSubTarget/MenuSubTarget.cjs.map +1 -0
- package/cjs/components/Popover/Popover.cjs +19 -6
- package/cjs/components/Popover/Popover.cjs.map +1 -1
- package/cjs/components/Popover/Popover.context.cjs.map +1 -1
- package/cjs/components/Popover/PopoverDropdown/PopoverDropdown.cjs +13 -6
- package/cjs/components/Popover/PopoverDropdown/PopoverDropdown.cjs.map +1 -1
- package/cjs/components/Popover/use-popover.cjs +1 -1
- package/cjs/components/Popover/use-popover.cjs.map +1 -1
- package/cjs/components/Portal/OptionalPortal.cjs +19 -5
- package/cjs/components/Portal/OptionalPortal.cjs.map +1 -1
- package/cjs/components/Portal/Portal.cjs +32 -6
- package/cjs/components/Portal/Portal.cjs.map +1 -1
- package/cjs/components/Radio/Radio.cjs.map +1 -1
- package/cjs/components/Radio/RadioGroup/RadioGroup.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.cjs +10 -5
- package/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.context.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.module.css.cjs +1 -1
- package/cjs/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.cjs +7 -3
- package/cjs/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.cjs +1 -1
- package/cjs/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.cjs.map +1 -1
- package/cjs/components/Switch/Switch.cjs +12 -2
- package/cjs/components/Switch/Switch.cjs.map +1 -1
- package/cjs/components/Switch/SwitchGroup/SwitchGroup.cjs.map +1 -1
- package/cjs/components/Tabs/Tabs.module.css.cjs +1 -1
- package/cjs/components/Transition/Transition.cjs +12 -1
- package/cjs/components/Transition/Transition.cjs.map +1 -1
- package/cjs/core/MantineProvider/Mantine.context.cjs +4 -0
- package/cjs/core/MantineProvider/Mantine.context.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineProvider.cjs +4 -4
- package/cjs/core/MantineProvider/MantineProvider.cjs.map +1 -1
- package/cjs/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs +8 -0
- package/cjs/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs.map +1 -1
- package/cjs/index.cjs +1 -0
- package/cjs/index.cjs.map +1 -1
- package/esm/components/Affix/Affix.mjs +5 -5
- package/esm/components/Affix/Affix.mjs.map +1 -1
- package/esm/components/Anchor/Anchor.mjs.map +1 -1
- package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
- package/esm/components/Chip/Chip.mjs.map +1 -1
- package/esm/components/Input/Input.mjs.map +1 -1
- package/esm/components/InputBase/InputBase.mjs.map +1 -1
- package/esm/components/Kbd/Kbd.mjs +1 -4
- package/esm/components/Kbd/Kbd.mjs.map +1 -1
- package/esm/components/Menu/Menu.context.mjs.map +1 -1
- package/esm/components/Menu/Menu.mjs +3 -8
- package/esm/components/Menu/Menu.mjs.map +1 -1
- package/esm/components/Menu/Menu.module.css.mjs +1 -1
- package/esm/components/Menu/MenuItem/MenuItem.mjs +10 -15
- package/esm/components/Menu/MenuItem/MenuItem.mjs.map +1 -1
- package/esm/components/Menu/MenuSub/MenuSub.context.mjs +18 -0
- package/esm/components/Menu/MenuSub/MenuSub.context.mjs.map +1 -0
- package/esm/components/Menu/MenuSub/MenuSub.mjs +69 -0
- package/esm/components/Menu/MenuSub/MenuSub.mjs.map +1 -0
- package/esm/components/Menu/MenuSubDropdown/MenuSubDropdown.mjs +68 -0
- package/esm/components/Menu/MenuSubDropdown/MenuSubDropdown.mjs.map +1 -0
- package/esm/components/Menu/MenuSubItem/MenuSubItem.mjs +113 -0
- package/esm/components/Menu/MenuSubItem/MenuSubItem.mjs.map +1 -0
- package/esm/components/Menu/MenuSubTarget/MenuSubTarget.mjs +31 -0
- package/esm/components/Menu/MenuSubTarget/MenuSubTarget.mjs.map +1 -0
- package/esm/components/Popover/Popover.context.mjs.map +1 -1
- package/esm/components/Popover/Popover.mjs +19 -6
- package/esm/components/Popover/Popover.mjs.map +1 -1
- package/esm/components/Popover/PopoverDropdown/PopoverDropdown.mjs +13 -6
- package/esm/components/Popover/PopoverDropdown/PopoverDropdown.mjs.map +1 -1
- package/esm/components/Popover/use-popover.mjs +2 -2
- package/esm/components/Popover/use-popover.mjs.map +1 -1
- package/esm/components/Portal/OptionalPortal.mjs +19 -5
- package/esm/components/Portal/OptionalPortal.mjs.map +1 -1
- package/esm/components/Portal/Portal.mjs +33 -7
- package/esm/components/Portal/Portal.mjs.map +1 -1
- package/esm/components/Radio/Radio.mjs.map +1 -1
- package/esm/components/Radio/RadioGroup/RadioGroup.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollArea.context.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollArea.mjs +10 -5
- package/esm/components/ScrollArea/ScrollArea.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollArea.module.css.mjs +1 -1
- package/esm/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.mjs +7 -3
- package/esm/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.mjs +1 -1
- package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.mjs.map +1 -1
- package/esm/components/Switch/Switch.mjs +12 -2
- package/esm/components/Switch/Switch.mjs.map +1 -1
- package/esm/components/Switch/SwitchGroup/SwitchGroup.mjs.map +1 -1
- package/esm/components/Tabs/Tabs.module.css.mjs +1 -1
- package/esm/components/Transition/Transition.mjs +12 -1
- package/esm/components/Transition/Transition.mjs.map +1 -1
- package/esm/core/MantineProvider/Mantine.context.mjs +4 -1
- package/esm/core/MantineProvider/Mantine.context.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineProvider.mjs +4 -4
- package/esm/core/MantineProvider/MantineProvider.mjs.map +1 -1
- package/esm/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs +8 -0
- package/esm/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs.map +1 -1
- package/esm/index.mjs +1 -1
- package/lib/components/Affix/Affix.d.ts +5 -5
- package/lib/components/Anchor/Anchor.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +2 -2
- package/lib/components/Chip/Chip.d.ts +2 -2
- package/lib/components/Input/Input.d.ts +3 -3
- package/lib/components/Input/use-input-props.d.ts +281 -5
- package/lib/components/InputBase/InputBase.d.ts +2 -2
- package/lib/components/Kbd/Kbd.d.ts +3 -3
- package/lib/components/Menu/Menu.context.d.ts +0 -2
- package/lib/components/Menu/Menu.d.ts +3 -3
- package/lib/components/Menu/MenuSub/MenuSub.context.d.ts +13 -0
- package/lib/components/Menu/MenuSub/MenuSub.d.ts +53 -0
- package/lib/components/Menu/MenuSubDropdown/MenuSubDropdown.d.ts +16 -0
- package/lib/components/Menu/MenuSubItem/MenuSubItem.d.ts +51 -0
- package/lib/components/Menu/MenuSubTarget/MenuSubTarget.d.ts +10 -0
- package/lib/components/Popover/Popover.context.d.ts +2 -0
- package/lib/components/Popover/Popover.d.ts +4 -0
- package/lib/components/Popover/use-popover.d.ts +1 -0
- package/lib/components/Portal/OptionalPortal.d.ts +9 -4
- package/lib/components/Portal/Portal.d.ts +11 -1
- package/lib/components/Radio/Radio.d.ts +2 -2
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +2 -2
- package/lib/components/ScrollArea/ScrollArea.context.d.ts +3 -0
- package/lib/components/ScrollArea/ScrollArea.d.ts +3 -1
- package/lib/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.d.ts +3 -11
- package/lib/components/Switch/Switch.d.ts +4 -2
- package/lib/components/Switch/SwitchGroup/SwitchGroup.d.ts +2 -2
- package/lib/core/MantineProvider/Mantine.context.d.ts +2 -0
- package/lib/core/MantineProvider/MantineProvider.d.ts +5 -1
- package/lib/core/MantineProvider/index.d.ts +1 -1
- package/lib/core/MantineProvider/use-mantine-color-scheme/use-computed-color-scheme.d.ts +1 -1
- package/lib/core/index.d.ts +1 -0
- package/lib/core/types.d.ts +3 -0
- package/package.json +4 -4
- package/styles/Anchor.css +18 -0
- package/styles/Anchor.layer.css +18 -0
- package/styles/Code.css +2 -4
- package/styles/Code.layer.css +2 -4
- package/styles/Image.css +0 -1
- package/styles/Image.layer.css +0 -1
- package/styles/Kbd.css +2 -8
- package/styles/Kbd.layer.css +2 -8
- package/styles/Menu.css +14 -2
- package/styles/Menu.layer.css +14 -2
- package/styles/ScrollArea.css +5 -0
- package/styles/ScrollArea.layer.css +5 -0
- package/styles/SegmentedControl.css +5 -5
- package/styles/SegmentedControl.layer.css +5 -5
- package/styles/Switch.css +17 -20
- package/styles/Switch.layer.css +17 -20
- package/styles/Tabs.css +39 -74
- package/styles/Tabs.layer.css +39 -74
- package/styles/baseline.css +40 -0
- package/styles/baseline.layer.css +41 -0
- package/styles/default-css-variables.css +501 -0
- package/styles/default-css-variables.layer.css +502 -0
- package/styles/global.css +0 -548
- package/styles/global.layer.css +1 -549
- package/styles.css +133 -150
- package/styles.layer.css +133 -150
|
@@ -19,6 +19,8 @@ export interface __PopoverProps {
|
|
|
19
19
|
positionDependencies?: any[];
|
|
20
20
|
/** Called when dropdown closes */
|
|
21
21
|
onClose?: () => void;
|
|
22
|
+
/** Called when the popover is dismissed by clicking outside or by pressing escape */
|
|
23
|
+
onDismiss?: () => void;
|
|
22
24
|
/** Called when dropdown opens */
|
|
23
25
|
onOpen?: () => void;
|
|
24
26
|
/** If set dropdown will not be unmounted from the DOM when it is hidden, `display: none` styles will be added instead */
|
|
@@ -63,6 +65,8 @@ export interface __PopoverProps {
|
|
|
63
65
|
returnFocus?: boolean;
|
|
64
66
|
/** Changes floating ui [position strategy](https://floating-ui.com/docs/usefloating#strategy), `'absolute'` by default */
|
|
65
67
|
floatingStrategy?: FloatingStrategy;
|
|
68
|
+
/** If set, the dropdown is hidden when the element is hidden with styles or not visible on the screen, `true` by default */
|
|
69
|
+
hideDetached?: boolean;
|
|
66
70
|
}
|
|
67
71
|
export interface PopoverProps extends __PopoverProps, StylesApiProps<PopoverFactory> {
|
|
68
72
|
__staticSelector?: string;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { Factory } from '../../core';
|
|
1
2
|
import { PortalProps } from './Portal';
|
|
2
3
|
export interface OptionalPortalProps extends PortalProps {
|
|
3
4
|
/** Determines whether children should be rendered inside `<Portal />` */
|
|
4
5
|
withinPortal?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
7
|
+
export type OptionalPortalFactory = Factory<{
|
|
8
|
+
props: OptionalPortalProps;
|
|
9
|
+
ref: HTMLDivElement;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const OptionalPortal: import("../../core").MantineComponent<{
|
|
12
|
+
props: OptionalPortalProps;
|
|
13
|
+
ref: HTMLDivElement;
|
|
14
|
+
}>;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import { Factory } from '../../core';
|
|
1
2
|
export interface PortalProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
2
3
|
/** Portal children, for example, custom modal or popover */
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
/** Element inside which portal should be created, by default a new div element is created and appended to the `document.body` */
|
|
5
6
|
target?: HTMLElement | string;
|
|
7
|
+
/** If set, all portals are rendered in the same DOM node, `true` by default */
|
|
8
|
+
reuseTargetNode?: boolean;
|
|
6
9
|
}
|
|
7
|
-
export
|
|
10
|
+
export type PortalFactory = Factory<{
|
|
11
|
+
props: PortalProps;
|
|
12
|
+
ref: HTMLDivElement;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const Portal: import("../../core").MantineComponent<{
|
|
15
|
+
props: PortalProps;
|
|
16
|
+
ref: HTMLDivElement;
|
|
17
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoxProps, ElementProps, Factory, MantineColor, MantineRadius, MantineSize, StylesApiProps } from '../../core';
|
|
1
|
+
import { BoxProps, DataAttributes, ElementProps, Factory, MantineColor, MantineRadius, MantineSize, StylesApiProps } from '../../core';
|
|
2
2
|
import { InlineInputStylesNames } from '../InlineInput';
|
|
3
3
|
import { RadioCard } from './RadioCard/RadioCard';
|
|
4
4
|
import { RadioGroup } from './RadioGroup/RadioGroup';
|
|
@@ -19,7 +19,7 @@ export interface RadioProps extends BoxProps, StylesApiProps<RadioFactory>, Elem
|
|
|
19
19
|
/** A component that replaces default check icon */
|
|
20
20
|
icon?: React.FC<RadioIconProps>;
|
|
21
21
|
/** Props passed down to the root element */
|
|
22
|
-
wrapperProps?:
|
|
22
|
+
wrapperProps?: React.ComponentPropsWithoutRef<'div'> & DataAttributes;
|
|
23
23
|
/** Position of the label relative to the input, `'right'` by default */
|
|
24
24
|
labelPosition?: 'left' | 'right';
|
|
25
25
|
/** Description displayed below the label */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Factory, MantineSize } from '../../../core';
|
|
1
|
+
import { DataAttributes, Factory, MantineSize } from '../../../core';
|
|
2
2
|
import { InputWrapperProps, InputWrapperStylesNames } from '../../Input';
|
|
3
3
|
export type RadioGroupStylesNames = InputWrapperStylesNames;
|
|
4
4
|
export interface RadioGroupProps extends Omit<InputWrapperProps, 'onChange' | 'value' | 'defaultValue'> {
|
|
@@ -11,7 +11,7 @@ export interface RadioGroupProps extends Omit<InputWrapperProps, 'onChange' | 'v
|
|
|
11
11
|
/** Called when value changes */
|
|
12
12
|
onChange?: (value: string) => void;
|
|
13
13
|
/** Props passed down to the `Input.Wrapper` */
|
|
14
|
-
wrapperProps?:
|
|
14
|
+
wrapperProps?: React.ComponentPropsWithoutRef<'div'> & DataAttributes;
|
|
15
15
|
/** Controls size of the `Input.Wrapper`, `'sm'` by default */
|
|
16
16
|
size?: MantineSize;
|
|
17
17
|
/** `name` attribute of child radio inputs. By default, `name` is generated randomly. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { GetStylesApi } from '../../core';
|
|
2
|
+
import type { ScrollAreaFactory } from './ScrollArea';
|
|
1
3
|
export interface ScrollAreaContextValue {
|
|
2
4
|
type: 'auto' | 'always' | 'scroll' | 'hover' | 'never';
|
|
3
5
|
scrollHideDelay: number;
|
|
@@ -16,6 +18,7 @@ export interface ScrollAreaContextValue {
|
|
|
16
18
|
onScrollbarYEnabledChange: (rendered: boolean) => void;
|
|
17
19
|
onCornerWidthChange: (width: number) => void;
|
|
18
20
|
onCornerHeightChange: (height: number) => void;
|
|
21
|
+
getStyles: GetStylesApi<ScrollAreaFactory>;
|
|
19
22
|
}
|
|
20
23
|
export declare const ScrollAreaProvider: ({ children, value }: {
|
|
21
24
|
value: ScrollAreaContextValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoxProps, ElementProps, Factory, StylesApiProps } from '../../core';
|
|
2
|
-
export type ScrollAreaStylesNames = 'root' | 'viewport' | 'scrollbar' | 'thumb' | 'corner';
|
|
2
|
+
export type ScrollAreaStylesNames = 'root' | 'viewport' | 'scrollbar' | 'thumb' | 'corner' | 'content';
|
|
3
3
|
export type ScrollAreaCssVariables = {
|
|
4
4
|
root: '--scrollarea-scrollbar-size';
|
|
5
5
|
};
|
|
@@ -34,6 +34,8 @@ export interface ScrollAreaProps extends BoxProps, StylesApiProps<ScrollAreaFact
|
|
|
34
34
|
onBottomReached?: () => void;
|
|
35
35
|
/** Called when scrollarea is scrolled all the way to the top */
|
|
36
36
|
onTopReached?: () => void;
|
|
37
|
+
/** Defines `overscroll-behavior` of the viewport */
|
|
38
|
+
overscrollBehavior?: React.CSSProperties['overscrollBehavior'];
|
|
37
39
|
}
|
|
38
40
|
export interface ScrollAreaAutosizeProps extends ScrollAreaProps {
|
|
39
41
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BoxProps, ElementProps, Factory } from '../../../core';
|
|
1
|
+
import { BoxProps, ElementProps, Factory, GetStylesApi } from '../../../core';
|
|
2
|
+
import type { ScrollAreaFactory } from '../ScrollArea';
|
|
2
3
|
export type ScrollAreaRootStylesNames = 'root' | 'viewport' | 'viewportInner' | 'scrollbar' | 'thumb' | 'corner';
|
|
3
4
|
export type ScrollAreaRootCssVariables = {
|
|
4
5
|
root: '--sa-corner-width' | '--sa-corner-height';
|
|
@@ -8,18 +9,9 @@ export interface ScrollAreaRootStylesCtx {
|
|
|
8
9
|
cornerHeight: number;
|
|
9
10
|
}
|
|
10
11
|
export interface ScrollAreaRootProps extends BoxProps, ElementProps<'div'> {
|
|
11
|
-
|
|
12
|
-
* Defines scrollbars behavior, `hover` by default
|
|
13
|
-
* - `hover` – scrollbars are visible when mouse is over the scroll area
|
|
14
|
-
* - `scroll` – scrollbars are visible when the scroll area is scrolled
|
|
15
|
-
* - `always` – scrollbars are always visible
|
|
16
|
-
* - `never` – scrollbars are always hidden
|
|
17
|
-
* - `auto` – similar to `overflow: auto` – scrollbars are always visible when the content is overflowing
|
|
18
|
-
* */
|
|
12
|
+
getStyles: GetStylesApi<ScrollAreaFactory>;
|
|
19
13
|
type?: 'auto' | 'always' | 'scroll' | 'hover' | 'never';
|
|
20
|
-
/** Axis at which scrollbars must be rendered, `'xy'` by default */
|
|
21
14
|
scrollbars?: 'x' | 'y' | 'xy' | false;
|
|
22
|
-
/** Scroll hide delay in ms, applicable only when type is set to `hover` or `scroll`, `1000` by default */
|
|
23
15
|
scrollHideDelay?: number;
|
|
24
16
|
}
|
|
25
17
|
export type ScrollAreaRootFactory = Factory<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoxProps, ElementProps, Factory, MantineColor, MantineRadius, MantineSize, StylesApiProps } from '../../core';
|
|
1
|
+
import { BoxProps, DataAttributes, ElementProps, Factory, MantineColor, MantineRadius, MantineSize, StylesApiProps } from '../../core';
|
|
2
2
|
import { InlineInputStylesNames } from '../InlineInput';
|
|
3
3
|
import { SwitchGroup } from './SwitchGroup/SwitchGroup';
|
|
4
4
|
export type SwitchStylesNames = 'root' | 'track' | 'trackLabel' | 'thumb' | 'input' | InlineInputStylesNames;
|
|
@@ -21,7 +21,7 @@ export interface SwitchProps extends BoxProps, StylesApiProps<SwitchFactory>, El
|
|
|
21
21
|
/** Key of `theme.radius` or any valid CSS value to set `border-radius,` "xl" by default */
|
|
22
22
|
radius?: MantineRadius;
|
|
23
23
|
/** Props passed down to the root element */
|
|
24
|
-
wrapperProps?:
|
|
24
|
+
wrapperProps?: React.ComponentPropsWithoutRef<'div'> & DataAttributes;
|
|
25
25
|
/** Icon inside the thumb of the switch */
|
|
26
26
|
thumbIcon?: React.ReactNode;
|
|
27
27
|
/** Position of the label relative to the input, `'right'` by default */
|
|
@@ -32,6 +32,8 @@ export interface SwitchProps extends BoxProps, StylesApiProps<SwitchFactory>, El
|
|
|
32
32
|
error?: React.ReactNode;
|
|
33
33
|
/** Assigns ref of the root element */
|
|
34
34
|
rootRef?: React.ForwardedRef<HTMLDivElement>;
|
|
35
|
+
/** If set, the indicator will be displayed inside thumb, `true` by default */
|
|
36
|
+
withThumbIndicator?: boolean;
|
|
35
37
|
}
|
|
36
38
|
export type SwitchFactory = Factory<{
|
|
37
39
|
props: SwitchProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Factory, MantineSize } from '../../../core';
|
|
1
|
+
import { DataAttributes, Factory, MantineSize } from '../../../core';
|
|
2
2
|
import { InputWrapperProps, InputWrapperStylesNames } from '../../Input';
|
|
3
3
|
export type SwitchGroupStylesNames = InputWrapperStylesNames;
|
|
4
4
|
export interface SwitchGroupProps extends Omit<InputWrapperProps, 'onChange'> {
|
|
@@ -11,7 +11,7 @@ export interface SwitchGroupProps extends Omit<InputWrapperProps, 'onChange'> {
|
|
|
11
11
|
/** Called when value changes */
|
|
12
12
|
onChange?: (value: string[]) => void;
|
|
13
13
|
/** Props passed down to the `Input.Wrapper` */
|
|
14
|
-
wrapperProps?:
|
|
14
|
+
wrapperProps?: React.ComponentPropsWithoutRef<'div'> & DataAttributes;
|
|
15
15
|
/** Controls size of the `Input.Wrapper`, `'sm'` by default */
|
|
16
16
|
size?: MantineSize | (string & {});
|
|
17
17
|
/** If set, value cannot be changed */
|
|
@@ -16,6 +16,7 @@ interface MantineContextValue {
|
|
|
16
16
|
withStaticClasses: boolean;
|
|
17
17
|
headless?: boolean;
|
|
18
18
|
stylesTransform?: MantineStylesTransform;
|
|
19
|
+
env?: 'default' | 'test';
|
|
19
20
|
}
|
|
20
21
|
export declare const MantineContext: import("react").Context<MantineContextValue | null>;
|
|
21
22
|
export declare function useMantineContext(): MantineContextValue;
|
|
@@ -26,4 +27,5 @@ export declare function useMantineWithStaticClasses(): boolean;
|
|
|
26
27
|
export declare function useMantineIsHeadless(): boolean | undefined;
|
|
27
28
|
export declare function useMantineSxTransform(): (() => (sx: any) => string) | undefined;
|
|
28
29
|
export declare function useMantineStylesTransform(): (() => (styles: any, payload: any) => Record<string, string>) | undefined;
|
|
30
|
+
export declare function useMantineEnv(): "default" | "test";
|
|
29
31
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import './baseline.css';
|
|
1
2
|
import './global.css';
|
|
3
|
+
import './default-css-variables.css';
|
|
2
4
|
import { MantineColorSchemeManager } from './color-scheme-managers';
|
|
3
5
|
import { MantineStylesTransform } from './Mantine.context';
|
|
4
6
|
import { CSSVariablesResolver } from './MantineCssVariables';
|
|
@@ -34,8 +36,10 @@ export interface MantineProviderProps {
|
|
|
34
36
|
stylesTransform?: MantineStylesTransform;
|
|
35
37
|
/** Your application */
|
|
36
38
|
children?: React.ReactNode;
|
|
39
|
+
/** Environment at which the provider is used, `'test'` environment disables all transitions and portals */
|
|
40
|
+
env?: 'default' | 'test';
|
|
37
41
|
}
|
|
38
|
-
export declare function MantineProvider({ theme, children, getStyleNonce, withStaticClasses, withGlobalClasses, deduplicateCssVariables, withCssVariables, cssVariablesSelector, classNamesPrefix, colorSchemeManager, defaultColorScheme, getRootElement, cssVariablesResolver, forceColorScheme, stylesTransform, }: MantineProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function MantineProvider({ theme, children, getStyleNonce, withStaticClasses, withGlobalClasses, deduplicateCssVariables, withCssVariables, cssVariablesSelector, classNamesPrefix, colorSchemeManager, defaultColorScheme, getRootElement, cssVariablesResolver, forceColorScheme, stylesTransform, env, }: MantineProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
43
|
export declare namespace MantineProvider {
|
|
40
44
|
var displayName: string;
|
|
41
45
|
}
|
|
@@ -6,7 +6,7 @@ export * from './ColorSchemeScript';
|
|
|
6
6
|
export { DEFAULT_THEME } from './default-theme';
|
|
7
7
|
export { validateMantineTheme, mergeMantineTheme } from './merge-mantine-theme';
|
|
8
8
|
export { MantineProvider, HeadlessMantineProvider } from './MantineProvider';
|
|
9
|
-
export { MantineContext, useMantineContext, useMantineClassNamesPrefix, useMantineStyleNonce, useMantineCssVariablesResolver, useMantineWithStaticClasses, useMantineIsHeadless, useMantineSxTransform, useMantineStylesTransform, } from './Mantine.context';
|
|
9
|
+
export { MantineContext, useMantineContext, useMantineClassNamesPrefix, useMantineStyleNonce, useMantineCssVariablesResolver, useMantineWithStaticClasses, useMantineIsHeadless, useMantineSxTransform, useMantineStylesTransform, useMantineEnv, } from './Mantine.context';
|
|
10
10
|
export { useMantineTheme, useSafeMantineTheme, MantineThemeContext, MantineThemeProvider, } from './MantineThemeProvider';
|
|
11
11
|
export type { MantineThemeProviderProps } from './MantineThemeProvider';
|
|
12
12
|
export type { MantineProviderProps, HeadlessMantineProviderProps } from './MantineProvider';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UseMediaQueryOptions } from '@mantine/hooks';
|
|
2
|
-
export declare function useComputedColorScheme(defaultValue?: 'light' | 'dark', options?: UseMediaQueryOptions): "
|
|
2
|
+
export declare function useComputedColorScheme(defaultValue?: 'light' | 'dark', options?: UseMediaQueryOptions): "dark" | "light";
|
package/lib/core/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.0",
|
|
4
4
|
"description": "React components library focused on usability, accessibility and developer experience",
|
|
5
5
|
"homepage": "https://mantine.dev/",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"directory": "packages/@mantine/core"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@mantine/hooks": "
|
|
46
|
+
"@mantine/hooks": "8.0.0-alpha.0",
|
|
47
47
|
"react": "^18.x || ^19.x",
|
|
48
48
|
"react-dom": "^18.x || ^19.x"
|
|
49
49
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@mantine-tests/core": "workspace:*",
|
|
60
60
|
"@mantine/hooks": "workspace:*",
|
|
61
|
-
"react": "
|
|
62
|
-
"react-dom": "
|
|
61
|
+
"react": "19.0.0",
|
|
62
|
+
"react-dom": "19.0.0"
|
|
63
63
|
}
|
|
64
64
|
}
|
package/styles/Anchor.css
CHANGED
|
@@ -24,6 +24,24 @@
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
.m_849cf0da:where([data-underline='not-hover']) {
|
|
28
|
+
text-decoration: underline;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media (hover: hover) {
|
|
32
|
+
|
|
33
|
+
.m_849cf0da:where([data-underline='not-hover']):hover {
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (hover: none) {
|
|
39
|
+
|
|
40
|
+
.m_849cf0da:where([data-underline='not-hover']):active {
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
27
45
|
.m_849cf0da:where([data-underline='always']) {
|
|
28
46
|
text-decoration: underline;
|
|
29
47
|
}
|
package/styles/Anchor.layer.css
CHANGED
|
@@ -24,6 +24,24 @@
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
.m_849cf0da:where([data-underline='not-hover']) {
|
|
28
|
+
text-decoration: underline;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media (hover: hover) {
|
|
32
|
+
|
|
33
|
+
.m_849cf0da:where([data-underline='not-hover']):hover {
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (hover: none) {
|
|
39
|
+
|
|
40
|
+
.m_849cf0da:where([data-underline='not-hover']):active {
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
27
45
|
.m_849cf0da:where([data-underline='always']) {
|
|
28
46
|
text-decoration: underline;
|
|
29
47
|
}
|
package/styles/Code.css
CHANGED
|
@@ -9,13 +9,11 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
:where([data-mantine-color-scheme='light']) .m_b183c0a2 {
|
|
12
|
-
background-color: var(--code-bg, var(--mantine-color-gray-
|
|
13
|
-
color: var(--mantine-color-black);
|
|
12
|
+
background-color: var(--code-bg, var(--mantine-color-gray-0));
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
:where([data-mantine-color-scheme='dark']) .m_b183c0a2 {
|
|
17
|
-
background-color: var(--code-bg, var(--mantine-color-dark-
|
|
18
|
-
color: var(--mantine-color-white);
|
|
16
|
+
background-color: var(--code-bg, var(--mantine-color-dark-6));
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
.m_b183c0a2[data-block] {
|
package/styles/Code.layer.css
CHANGED
|
@@ -9,13 +9,11 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
:where([data-mantine-color-scheme='light']) .m_b183c0a2 {
|
|
12
|
-
background-color: var(--code-bg, var(--mantine-color-gray-
|
|
13
|
-
color: var(--mantine-color-black);
|
|
12
|
+
background-color: var(--code-bg, var(--mantine-color-gray-0));
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
:where([data-mantine-color-scheme='dark']) .m_b183c0a2 {
|
|
17
|
-
background-color: var(--code-bg, var(--mantine-color-dark-
|
|
18
|
-
color: var(--mantine-color-white);
|
|
16
|
+
background-color: var(--code-bg, var(--mantine-color-dark-6));
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
.m_b183c0a2[data-block] {
|
package/styles/Image.css
CHANGED
package/styles/Image.layer.css
CHANGED
package/styles/Kbd.css
CHANGED
|
@@ -6,22 +6,16 @@
|
|
|
6
6
|
--kbd-fz-xl: 20px;
|
|
7
7
|
--kbd-fz: var(--kbd-fz-sm);
|
|
8
8
|
|
|
9
|
-
--kbd-padding-xs: 2px 4px;
|
|
10
|
-
--kbd-padding-sm: 3px 5px;
|
|
11
|
-
--kbd-padding-md: 4px 7px;
|
|
12
|
-
--kbd-padding-lg: 5px 9px;
|
|
13
|
-
--kbd-padding-xl: 8px 14px;
|
|
14
|
-
--kbd-padding: var(--kbd-padding-sm);
|
|
15
|
-
|
|
16
9
|
font-family: var(--mantine-font-family-monospace);
|
|
17
10
|
line-height: var(--mantine-line-height);
|
|
18
11
|
font-weight: 700;
|
|
19
|
-
padding: var(--kbd-padding);
|
|
20
12
|
font-size: var(--kbd-fz);
|
|
21
13
|
border-radius: var(--mantine-radius-sm);
|
|
22
14
|
border: 1px solid;
|
|
23
15
|
border-bottom-width: 3px;
|
|
24
16
|
unicode-bidi: embed;
|
|
17
|
+
text-align: center;
|
|
18
|
+
padding: 0.12em 0.45em;
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
:where([data-mantine-color-scheme='light']) .m_dc6f14e2 {
|
package/styles/Kbd.layer.css
CHANGED
|
@@ -6,22 +6,16 @@
|
|
|
6
6
|
--kbd-fz-xl: 20px;
|
|
7
7
|
--kbd-fz: var(--kbd-fz-sm);
|
|
8
8
|
|
|
9
|
-
--kbd-padding-xs: 2px 4px;
|
|
10
|
-
--kbd-padding-sm: 3px 5px;
|
|
11
|
-
--kbd-padding-md: 4px 7px;
|
|
12
|
-
--kbd-padding-lg: 5px 9px;
|
|
13
|
-
--kbd-padding-xl: 8px 14px;
|
|
14
|
-
--kbd-padding: var(--kbd-padding-sm);
|
|
15
|
-
|
|
16
9
|
font-family: var(--mantine-font-family-monospace);
|
|
17
10
|
line-height: var(--mantine-line-height);
|
|
18
11
|
font-weight: 700;
|
|
19
|
-
padding: var(--kbd-padding);
|
|
20
12
|
font-size: var(--kbd-fz);
|
|
21
13
|
border-radius: var(--mantine-radius-sm);
|
|
22
14
|
border: 1px solid;
|
|
23
15
|
border-bottom-width: 3px;
|
|
24
16
|
unicode-bidi: embed;
|
|
17
|
+
text-align: center;
|
|
18
|
+
padding: 0.12em 0.45em;
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
:where([data-mantine-color-scheme='light']) .m_dc6f14e2 {
|
package/styles/Menu.css
CHANGED
|
@@ -41,14 +41,18 @@
|
|
|
41
41
|
cursor: not-allowed;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
:where([data-mantine-color-scheme='light']) .m_99ac2aa1:where(
|
|
44
|
+
:where([data-mantine-color-scheme='light']) .m_99ac2aa1:where(:hover, :focus):where(:not(:disabled, [data-disabled])) {
|
|
45
45
|
background-color: var(--menu-item-hover, var(--mantine-color-gray-1));
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
:where([data-mantine-color-scheme='dark']) .m_99ac2aa1:where(
|
|
48
|
+
:where([data-mantine-color-scheme='dark']) .m_99ac2aa1:where(:hover, :focus):where(:not(:disabled, [data-disabled])) {
|
|
49
49
|
background-color: var(--menu-item-hover, var(--mantine-color-dark-4));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.m_99ac2aa1:where([data-sub-menu-item]) {
|
|
53
|
+
padding-inline-end: 5px;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
.m_5476e0d3 {
|
|
53
57
|
flex: 1;
|
|
54
58
|
}
|
|
@@ -66,3 +70,11 @@
|
|
|
66
70
|
.m_8b75e504:where([data-position='right']) {
|
|
67
71
|
margin-inline-start: var(--mantine-spacing-xs);
|
|
68
72
|
}
|
|
73
|
+
|
|
74
|
+
.m_b85b0bed {
|
|
75
|
+
transform: rotate(-90deg);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:where([dir="rtl"]) .m_b85b0bed {
|
|
79
|
+
transform: rotate(90deg);
|
|
80
|
+
}
|
package/styles/Menu.layer.css
CHANGED
|
@@ -41,14 +41,18 @@
|
|
|
41
41
|
cursor: not-allowed;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
:where([data-mantine-color-scheme='light']) .m_99ac2aa1:where(
|
|
44
|
+
:where([data-mantine-color-scheme='light']) .m_99ac2aa1:where(:hover, :focus):where(:not(:disabled, [data-disabled])) {
|
|
45
45
|
background-color: var(--menu-item-hover, var(--mantine-color-gray-1));
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
:where([data-mantine-color-scheme='dark']) .m_99ac2aa1:where(
|
|
48
|
+
:where([data-mantine-color-scheme='dark']) .m_99ac2aa1:where(:hover, :focus):where(:not(:disabled, [data-disabled])) {
|
|
49
49
|
background-color: var(--menu-item-hover, var(--mantine-color-dark-4));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.m_99ac2aa1:where([data-sub-menu-item]) {
|
|
53
|
+
padding-inline-end: 5px;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
.m_5476e0d3 {
|
|
53
57
|
flex: 1;
|
|
54
58
|
}
|
|
@@ -66,4 +70,12 @@
|
|
|
66
70
|
.m_8b75e504:where([data-position='right']) {
|
|
67
71
|
margin-inline-start: var(--mantine-spacing-xs);
|
|
68
72
|
}
|
|
73
|
+
|
|
74
|
+
.m_b85b0bed {
|
|
75
|
+
transform: rotate(-90deg);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:where([dir="rtl"]) .m_b85b0bed {
|
|
79
|
+
transform: rotate(90deg);
|
|
80
|
+
}
|
|
69
81
|
}
|
package/styles/ScrollArea.css
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
.m_c0783ff9 {
|
|
9
9
|
scrollbar-width: none;
|
|
10
|
+
overscroll-behavior: var(--scrollarea-over-scroll-behavior);
|
|
10
11
|
-ms-overflow-style: none;
|
|
11
12
|
-webkit-overflow-scrolling: touch;
|
|
12
13
|
width: 100%;
|
|
@@ -153,3 +154,7 @@
|
|
|
153
154
|
.m_21657268:where([data-hidden]) {
|
|
154
155
|
display: none;
|
|
155
156
|
}
|
|
157
|
+
|
|
158
|
+
.m_b1336c6 {
|
|
159
|
+
min-width: 100%;
|
|
160
|
+
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
.m_c0783ff9 {
|
|
9
9
|
scrollbar-width: none;
|
|
10
|
+
overscroll-behavior: var(--scrollarea-over-scroll-behavior);
|
|
10
11
|
-ms-overflow-style: none;
|
|
11
12
|
-webkit-overflow-scrolling: touch;
|
|
12
13
|
width: 100%;
|
|
@@ -153,4 +154,8 @@
|
|
|
153
154
|
.m_21657268:where([data-hidden]) {
|
|
154
155
|
display: none;
|
|
155
156
|
}
|
|
157
|
+
|
|
158
|
+
.m_b1336c6 {
|
|
159
|
+
min-width: 100%;
|
|
160
|
+
}
|
|
156
161
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.m_cf365364 {
|
|
2
|
-
--sc-padding-xs:
|
|
3
|
-
--sc-padding-sm:
|
|
4
|
-
--sc-padding-md:
|
|
5
|
-
--sc-padding-lg:
|
|
6
|
-
--sc-padding-xl:
|
|
2
|
+
--sc-padding-xs: 2px 6px;
|
|
3
|
+
--sc-padding-sm: 3px 10px;
|
|
4
|
+
--sc-padding-md: 4px 14px;
|
|
5
|
+
--sc-padding-lg: 7px 16px;
|
|
6
|
+
--sc-padding-xl: 10px 20px;
|
|
7
7
|
|
|
8
8
|
--sc-transition-duration: 200ms;
|
|
9
9
|
--sc-padding: var(--sc-padding-sm);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
@layer mantine {.m_cf365364 {
|
|
2
|
-
--sc-padding-xs:
|
|
3
|
-
--sc-padding-sm:
|
|
4
|
-
--sc-padding-md:
|
|
5
|
-
--sc-padding-lg:
|
|
6
|
-
--sc-padding-xl:
|
|
2
|
+
--sc-padding-xs: 2px 6px;
|
|
3
|
+
--sc-padding-sm: 3px 10px;
|
|
4
|
+
--sc-padding-md: 4px 14px;
|
|
5
|
+
--sc-padding-lg: 7px 16px;
|
|
6
|
+
--sc-padding-xl: 10px 20px;
|
|
7
7
|
|
|
8
8
|
--sc-transition-duration: 200ms;
|
|
9
9
|
--sc-padding: var(--sc-padding-sm);
|