@mantine/core 7.17.1 → 8.0.0-alpha.1
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/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 +6 -2
- 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 +2 -1
- 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/Portal.cjs +3 -1
- 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 +1 -0
- 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/core/MantineProvider/MantineProvider.cjs +0 -2
- 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/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 +6 -2
- package/esm/components/Popover/Popover.mjs.map +1 -1
- package/esm/components/Popover/PopoverDropdown/PopoverDropdown.mjs +2 -1
- 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/Portal.mjs +3 -1
- 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 +1 -0
- 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/core/MantineProvider/MantineProvider.mjs +0 -2
- 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/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 +280 -4
- 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 +1 -0
- package/lib/components/Popover/Popover.d.ts +2 -0
- package/lib/components/Portal/Portal.d.ts +1 -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 +1 -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/MantineProvider.d.ts +2 -0
- package/lib/core/index.d.ts +1 -0
- package/lib/core/types.d.ts +3 -0
- package/package.json +3 -3
- 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 +4 -0
- package/styles/ScrollArea.layer.css +4 -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 +507 -0
- package/styles/default-css-variables.layer.css +508 -0
- package/styles/global.css +0 -548
- package/styles/global.layer.css +1 -549
- package/styles.css +114 -144
- package/styles.layer.css +114 -144
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface SubMenuContext {
|
|
2
|
+
opened: boolean;
|
|
3
|
+
close: () => void;
|
|
4
|
+
open: () => void;
|
|
5
|
+
focusFirstItem: () => void;
|
|
6
|
+
focusParentItem: () => void;
|
|
7
|
+
parentContext: SubMenuContext | null;
|
|
8
|
+
}
|
|
9
|
+
export declare const SubMenuProvider: ({ children, value }: {
|
|
10
|
+
value: SubMenuContext;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element, useSubMenuContext: () => SubMenuContext | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ExtendComponent, Factory } from '../../../core';
|
|
2
|
+
import { __PopoverProps } from '../../Popover';
|
|
3
|
+
import { MenuSubTarget } from '../MenuSubTarget/MenuSubTarget';
|
|
4
|
+
export type MenuSubFactory = Factory<{
|
|
5
|
+
props: MenuSubProps;
|
|
6
|
+
}>;
|
|
7
|
+
interface MenuSubProps extends __PopoverProps {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Close delay in ms */
|
|
10
|
+
closeDelay?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function MenuSub(_props: MenuSubProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare namespace MenuSub {
|
|
14
|
+
var extend: (input: ExtendComponent<MenuSubFactory>) => import("../../../core/factory/factory").ExtendsRootComponent<{
|
|
15
|
+
props: MenuSubProps;
|
|
16
|
+
}>;
|
|
17
|
+
var displayName: string;
|
|
18
|
+
var Target: typeof MenuSubTarget;
|
|
19
|
+
var Dropdown: import("../../../core").MantineComponent<{
|
|
20
|
+
props: import("../MenuSubDropdown/MenuSubDropdown").MenuSubDropdownProps;
|
|
21
|
+
ref: HTMLDivElement;
|
|
22
|
+
stylesNames: import("../MenuSubDropdown/MenuSubDropdown").MenuSubDropdownStylesNames;
|
|
23
|
+
compound: true;
|
|
24
|
+
}>;
|
|
25
|
+
var Item: (<C = "button">(props: import("../../../core").PolymorphicComponentProps<C, import("../MenuSubItem/MenuSubItem").MenuSubItemProps>) => React.ReactElement) & Omit<import("react").FunctionComponent<(import("../MenuSubItem/MenuSubItem").MenuSubItemProps & {
|
|
26
|
+
component?: any;
|
|
27
|
+
} & Omit<Omit<any, "ref">, "component" | keyof import("../MenuSubItem/MenuSubItem").MenuSubItemProps> & {
|
|
28
|
+
ref?: any;
|
|
29
|
+
renderRoot?: (props: any) => any;
|
|
30
|
+
}) | (import("../MenuSubItem/MenuSubItem").MenuSubItemProps & {
|
|
31
|
+
component: React.ElementType;
|
|
32
|
+
renderRoot?: (props: Record<string, any>) => any;
|
|
33
|
+
})>, never> & import("../../../core/factory/factory").ThemeExtend<{
|
|
34
|
+
props: import("../MenuSubItem/MenuSubItem").MenuSubItemProps;
|
|
35
|
+
defaultRef: HTMLButtonElement;
|
|
36
|
+
defaultComponent: "button";
|
|
37
|
+
stylesNames: import("../MenuSubItem/MenuSubItem").MenuSubItemStylesNames;
|
|
38
|
+
compound: true;
|
|
39
|
+
}> & import("../../../core/factory/factory").ComponentClasses<{
|
|
40
|
+
props: import("../MenuSubItem/MenuSubItem").MenuSubItemProps;
|
|
41
|
+
defaultRef: HTMLButtonElement;
|
|
42
|
+
defaultComponent: "button";
|
|
43
|
+
stylesNames: import("../MenuSubItem/MenuSubItem").MenuSubItemStylesNames;
|
|
44
|
+
compound: true;
|
|
45
|
+
}> & import("../../../core/factory/polymorphic-factory").PolymorphicComponentWithProps<{
|
|
46
|
+
props: import("../MenuSubItem/MenuSubItem").MenuSubItemProps;
|
|
47
|
+
defaultRef: HTMLButtonElement;
|
|
48
|
+
defaultComponent: "button";
|
|
49
|
+
stylesNames: import("../MenuSubItem/MenuSubItem").MenuSubItemStylesNames;
|
|
50
|
+
compound: true;
|
|
51
|
+
}> & Record<string, never>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BoxProps, CompoundStylesApiProps, ElementProps, Factory } from '../../../core';
|
|
2
|
+
export type MenuSubDropdownStylesNames = 'dropdown';
|
|
3
|
+
export interface MenuSubDropdownProps extends BoxProps, CompoundStylesApiProps<MenuSubDropdownFactory>, ElementProps<'div'> {
|
|
4
|
+
}
|
|
5
|
+
export type MenuSubDropdownFactory = Factory<{
|
|
6
|
+
props: MenuSubDropdownProps;
|
|
7
|
+
ref: HTMLDivElement;
|
|
8
|
+
stylesNames: MenuSubDropdownStylesNames;
|
|
9
|
+
compound: true;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const MenuSubDropdown: import("../../../core").MantineComponent<{
|
|
12
|
+
props: MenuSubDropdownProps;
|
|
13
|
+
ref: HTMLDivElement;
|
|
14
|
+
stylesNames: MenuSubDropdownStylesNames;
|
|
15
|
+
compound: true;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BoxProps, CompoundStylesApiProps, MantineColor, PolymorphicFactory } from '../../../core';
|
|
2
|
+
export type MenuSubItemStylesNames = 'item' | 'itemLabel' | 'itemSection';
|
|
3
|
+
export interface MenuSubItemProps extends BoxProps, CompoundStylesApiProps<MenuSubItemFactory> {
|
|
4
|
+
'data-disabled'?: boolean;
|
|
5
|
+
/** Item label */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/** Key of `theme.colors` or any valid CSS color */
|
|
8
|
+
color?: MantineColor;
|
|
9
|
+
/** Section displayed on the left side of the label */
|
|
10
|
+
leftSection?: React.ReactNode;
|
|
11
|
+
/** Section displayed on the right side of the label */
|
|
12
|
+
rightSection?: React.ReactNode;
|
|
13
|
+
/** Disables item */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Determines whether the menu should be closed when the item is clicked, `false` by default */
|
|
16
|
+
closeMenuOnClick?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export type MenuSubItemFactory = PolymorphicFactory<{
|
|
19
|
+
props: MenuSubItemProps;
|
|
20
|
+
defaultRef: HTMLButtonElement;
|
|
21
|
+
defaultComponent: 'button';
|
|
22
|
+
stylesNames: MenuSubItemStylesNames;
|
|
23
|
+
compound: true;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const MenuSubItem: (<C = "button">(props: import("../../../core").PolymorphicComponentProps<C, MenuSubItemProps>) => React.ReactElement) & Omit<import("react").FunctionComponent<(MenuSubItemProps & {
|
|
26
|
+
component?: any;
|
|
27
|
+
} & Omit<Omit<any, "ref">, "component" | keyof MenuSubItemProps> & {
|
|
28
|
+
ref?: any;
|
|
29
|
+
renderRoot?: (props: any) => any;
|
|
30
|
+
}) | (MenuSubItemProps & {
|
|
31
|
+
component: React.ElementType;
|
|
32
|
+
renderRoot?: (props: Record<string, any>) => any;
|
|
33
|
+
})>, never> & import("../../../core/factory/factory").ThemeExtend<{
|
|
34
|
+
props: MenuSubItemProps;
|
|
35
|
+
defaultRef: HTMLButtonElement;
|
|
36
|
+
defaultComponent: "button";
|
|
37
|
+
stylesNames: MenuSubItemStylesNames;
|
|
38
|
+
compound: true;
|
|
39
|
+
}> & import("../../../core/factory/factory").ComponentClasses<{
|
|
40
|
+
props: MenuSubItemProps;
|
|
41
|
+
defaultRef: HTMLButtonElement;
|
|
42
|
+
defaultComponent: "button";
|
|
43
|
+
stylesNames: MenuSubItemStylesNames;
|
|
44
|
+
compound: true;
|
|
45
|
+
}> & import("../../../core/factory/polymorphic-factory").PolymorphicComponentWithProps<{
|
|
46
|
+
props: MenuSubItemProps;
|
|
47
|
+
defaultRef: HTMLButtonElement;
|
|
48
|
+
defaultComponent: "button";
|
|
49
|
+
stylesNames: MenuSubItemStylesNames;
|
|
50
|
+
compound: true;
|
|
51
|
+
}> & Record<string, never>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface MenuSubTargetProps {
|
|
2
|
+
/** Target element */
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Key of the prop that should be used to get element ref */
|
|
5
|
+
refProp?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function MenuSubTarget({ children, refProp }: MenuSubTargetProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare namespace MenuSubTarget {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
@@ -47,6 +47,7 @@ interface PopoverContext {
|
|
|
47
47
|
getStyles: GetStylesApi<PopoverFactory>;
|
|
48
48
|
resolvedStyles: Record<string, any>;
|
|
49
49
|
floatingStrategy: FloatingStrategy | undefined;
|
|
50
|
+
referenceHidden: boolean | undefined;
|
|
50
51
|
}
|
|
51
52
|
export declare const PopoverContextProvider: ({ children, value }: {
|
|
52
53
|
value: PopoverContext;
|
|
@@ -65,6 +65,8 @@ export interface __PopoverProps {
|
|
|
65
65
|
returnFocus?: boolean;
|
|
66
66
|
/** Changes floating ui [position strategy](https://floating-ui.com/docs/usefloating#strategy), `'absolute'` by default */
|
|
67
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;
|
|
68
70
|
}
|
|
69
71
|
export interface PopoverProps extends __PopoverProps, StylesApiProps<PopoverFactory> {
|
|
70
72
|
__staticSelector?: string;
|
|
@@ -4,7 +4,7 @@ export interface PortalProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
/** Element inside which portal should be created, by default a new div element is created and appended to the `document.body` */
|
|
6
6
|
target?: HTMLElement | string;
|
|
7
|
-
/** If set, all portals are rendered in the same DOM node, `
|
|
7
|
+
/** If set, all portals are rendered in the same DOM node, `true` by default */
|
|
8
8
|
reuseTargetNode?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export type PortalFactory = 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 { 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
|
};
|
|
@@ -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 */
|
|
@@ -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';
|
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.1",
|
|
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.1",
|
|
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": "
|
|
61
|
+
"react": "19.0.0",
|
|
62
62
|
"react-dom": "19.0.0"
|
|
63
63
|
}
|
|
64
64
|
}
|
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
|
@@ -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);
|