react-native-mantine 0.15.0 → 0.16.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/README.md +45 -345
- package/lib/commonjs/components/Anchor/index.js +5 -5
- package/lib/commonjs/components/Anchor/index.js.map +1 -1
- package/lib/commonjs/components/Avatar/index.js +3 -3
- package/lib/commonjs/components/Avatar/index.js.map +1 -1
- package/lib/commonjs/components/BackgroundImage/index.js +1 -1
- package/lib/commonjs/components/BackgroundImage/index.js.map +1 -1
- package/lib/commonjs/components/Badge/index.js +5 -5
- package/lib/commonjs/components/Badge/index.js.map +1 -1
- package/lib/commonjs/components/Blockquote/index.js +2 -2
- package/lib/commonjs/components/Blockquote/index.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +6 -6
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Card/index.js +3 -3
- package/lib/commonjs/components/Card/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js +3 -3
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +6 -6
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/CloseButton/index.js +3 -3
- package/lib/commonjs/components/CloseButton/index.js.map +1 -1
- package/lib/commonjs/components/ColorSwatch/index.js +4 -4
- package/lib/commonjs/components/ColorSwatch/index.js.map +1 -1
- package/lib/commonjs/components/Dialog/index.js +1 -1
- package/lib/commonjs/components/Dialog/index.js.map +1 -1
- package/lib/commonjs/components/Divider/index.js +4 -4
- package/lib/commonjs/components/Divider/index.js.map +1 -1
- package/lib/commonjs/components/Grid/index.js +6 -6
- package/lib/commonjs/components/Grid/index.js.map +1 -1
- package/lib/commonjs/components/Image/index.js +2 -2
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/commonjs/components/Indicator/index.js +8 -8
- package/lib/commonjs/components/Indicator/index.js.map +1 -1
- package/lib/commonjs/components/List/index.js +2 -2
- package/lib/commonjs/components/List/index.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js +2 -2
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/Overlay/index.js +5 -5
- package/lib/commonjs/components/Overlay/index.js.map +1 -1
- package/lib/commonjs/components/Paper/index.js +2 -2
- package/lib/commonjs/components/Paper/index.js.map +1 -1
- package/lib/commonjs/components/RingProgress/index.js +78 -55
- package/lib/commonjs/components/RingProgress/index.js.map +1 -1
- package/lib/commonjs/components/SimpleGrid/index.js +1 -1
- package/lib/commonjs/components/SimpleGrid/index.js.map +1 -1
- package/lib/commonjs/components/Stepper/index.js +1 -1
- package/lib/commonjs/components/Stepper/index.js.map +1 -1
- package/lib/commonjs/components/Table/index.js +257 -273
- package/lib/commonjs/components/Table/index.js.map +1 -1
- package/lib/commonjs/components/ThemeIcon/index.js +4 -4
- package/lib/commonjs/components/ThemeIcon/index.js.map +1 -1
- package/lib/commonjs/components/Timeline/index.js +1 -1
- package/lib/commonjs/components/Timeline/index.js.map +1 -1
- package/lib/commonjs/components/index.js +29 -29
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/theme/create-styles.js +35 -0
- package/lib/commonjs/theme/create-styles.js.map +1 -1
- package/lib/module/components/Anchor/index.js +5 -5
- package/lib/module/components/Anchor/index.js.map +1 -1
- package/lib/module/components/Avatar/index.js +3 -3
- package/lib/module/components/Avatar/index.js.map +1 -1
- package/lib/module/components/BackgroundImage/index.js +1 -1
- package/lib/module/components/BackgroundImage/index.js.map +1 -1
- package/lib/module/components/Badge/index.js +5 -5
- package/lib/module/components/Badge/index.js.map +1 -1
- package/lib/module/components/Blockquote/index.js +2 -2
- package/lib/module/components/Blockquote/index.js.map +1 -1
- package/lib/module/components/Button/index.js +6 -6
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Card/index.js +3 -3
- package/lib/module/components/Card/index.js.map +1 -1
- package/lib/module/components/Checkbox/index.js +3 -3
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Chip/index.js +6 -6
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/CloseButton/index.js +3 -3
- package/lib/module/components/CloseButton/index.js.map +1 -1
- package/lib/module/components/ColorSwatch/index.js +4 -4
- package/lib/module/components/ColorSwatch/index.js.map +1 -1
- package/lib/module/components/Dialog/index.js +1 -1
- package/lib/module/components/Dialog/index.js.map +1 -1
- package/lib/module/components/Divider/index.js +4 -4
- package/lib/module/components/Divider/index.js.map +1 -1
- package/lib/module/components/Grid/index.js +6 -6
- package/lib/module/components/Grid/index.js.map +1 -1
- package/lib/module/components/Image/index.js +2 -2
- package/lib/module/components/Image/index.js.map +1 -1
- package/lib/module/components/Indicator/index.js +8 -8
- package/lib/module/components/Indicator/index.js.map +1 -1
- package/lib/module/components/List/index.js +2 -2
- package/lib/module/components/List/index.js.map +1 -1
- package/lib/module/components/Menu/index.js +2 -2
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/Overlay/index.js +5 -5
- package/lib/module/components/Overlay/index.js.map +1 -1
- package/lib/module/components/Paper/index.js +2 -2
- package/lib/module/components/Paper/index.js.map +1 -1
- package/lib/module/components/RingProgress/index.js +79 -56
- package/lib/module/components/RingProgress/index.js.map +1 -1
- package/lib/module/components/SimpleGrid/index.js +1 -1
- package/lib/module/components/SimpleGrid/index.js.map +1 -1
- package/lib/module/components/Stepper/index.js +1 -1
- package/lib/module/components/Stepper/index.js.map +1 -1
- package/lib/module/components/Table/index.js +257 -274
- package/lib/module/components/Table/index.js.map +1 -1
- package/lib/module/components/ThemeIcon/index.js +4 -4
- package/lib/module/components/ThemeIcon/index.js.map +1 -1
- package/lib/module/components/Timeline/index.js +1 -1
- package/lib/module/components/Timeline/index.js.map +1 -1
- package/lib/module/components/index.js +3 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/theme/create-styles.js +36 -0
- package/lib/module/theme/create-styles.js.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/Button.styles.d.ts +35 -10
- package/lib/typescript/commonjs/src/components/Button/Button.styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RingProgress/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Table/index.d.ts +17 -83
- package/lib/typescript/commonjs/src/components/Table/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts +14 -3
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/create-styles.d.ts +36 -2
- package/lib/typescript/commonjs/src/theme/create-styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/Button.styles.d.ts +35 -10
- package/lib/typescript/module/src/components/Button/Button.styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RingProgress/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Table/index.d.ts +17 -83
- package/lib/typescript/module/src/components/Table/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts +14 -3
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/index.d.ts +1 -1
- package/lib/typescript/module/src/components/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/create-styles.d.ts +36 -2
- package/lib/typescript/module/src/theme/create-styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Anchor/index.tsx +2 -2
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/BackgroundImage/index.tsx +1 -1
- package/src/components/Badge/index.tsx +2 -2
- package/src/components/Blockquote/index.tsx +1 -1
- package/src/components/Button/index.tsx +6 -6
- package/src/components/Card/index.tsx +3 -3
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Chip/index.tsx +2 -2
- package/src/components/CloseButton/index.tsx +1 -1
- package/src/components/ColorSwatch/index.tsx +1 -1
- package/src/components/Dialog/index.tsx +1 -1
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/Grid/index.tsx +2 -2
- package/src/components/Image/index.tsx +1 -1
- package/src/components/Indicator/index.tsx +1 -1
- package/src/components/List/index.tsx +1 -1
- package/src/components/Menu/index.tsx +1 -1
- package/src/components/Overlay/index.tsx +1 -1
- package/src/components/Paper/index.tsx +1 -1
- package/src/components/RingProgress/index.tsx +89 -56
- package/src/components/SimpleGrid/index.tsx +1 -1
- package/src/components/Stepper/index.tsx +1 -1
- package/src/components/Table/index.tsx +333 -413
- package/src/components/ThemeIcon/index.tsx +1 -1
- package/src/components/Timeline/index.tsx +1 -1
- package/src/components/index.tsx +3 -1
- package/src/theme/create-styles.ts +44 -6
- package/lib/commonjs/components/Table/Table.example.js +0 -323
- package/lib/commonjs/components/Table/Table.example.js.map +0 -1
- package/lib/module/components/Table/Table.example.js +0 -318
- package/lib/module/components/Table/Table.example.js.map +0 -1
- package/lib/typescript/commonjs/src/components/Table/Table.example.d.ts +0 -13
- package/lib/typescript/commonjs/src/components/Table/Table.example.d.ts.map +0 -1
- package/lib/typescript/module/src/components/Table/Table.example.d.ts +0 -13
- package/lib/typescript/module/src/components/Table/Table.example.d.ts.map +0 -1
- package/src/components/Table/Table.example.tsx +0 -215
|
@@ -1,95 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { DefaultProps, SpacingValue } from '../../theme/types';
|
|
4
|
-
import { type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
2
|
+
import type { DefaultProps, MantineNumberSize } from '../../theme/types';
|
|
5
3
|
export interface TableProps extends DefaultProps {
|
|
6
|
-
/**
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
/** Horizontal scroll on overflow */
|
|
9
|
-
horizontalSpacing?: SpacingValue;
|
|
10
|
-
/** Vertical spacing between rows */
|
|
11
|
-
verticalSpacing?: SpacingValue;
|
|
12
|
-
/** Font size */
|
|
13
|
-
fontSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
14
|
-
/** Add striped rows styling */
|
|
4
|
+
/** If true every odd row of table will have gray background color */
|
|
15
5
|
striped?: boolean;
|
|
16
|
-
/**
|
|
6
|
+
/** If true row will have hover color */
|
|
17
7
|
highlightOnHover?: boolean;
|
|
8
|
+
/** Table caption position */
|
|
9
|
+
captionSide?: 'top' | 'bottom';
|
|
10
|
+
/** Horizontal cells spacing from theme.spacing or any valid value */
|
|
11
|
+
horizontalSpacing?: MantineNumberSize;
|
|
12
|
+
/** Vertical cells spacing from theme.spacing or any valid value */
|
|
13
|
+
verticalSpacing?: MantineNumberSize;
|
|
14
|
+
/** Sets font size of all text inside table */
|
|
15
|
+
fontSize?: MantineNumberSize;
|
|
18
16
|
/** Add border to table */
|
|
19
17
|
withBorder?: boolean;
|
|
20
|
-
/** Add
|
|
18
|
+
/** Add border to columns */
|
|
21
19
|
withColumnBorders?: boolean;
|
|
22
|
-
/** Caption
|
|
23
|
-
captionSide?: 'top' | 'bottom';
|
|
24
|
-
/** Table caption */
|
|
25
|
-
caption?: React.ReactNode;
|
|
26
|
-
/** Flex value for the table container (e.g., 1 to fill available space) */
|
|
27
|
-
flex?: number;
|
|
28
|
-
/** Flex grow value for the table container */
|
|
29
|
-
flexGrow?: number;
|
|
30
|
-
/** Flex shrink value for the table container */
|
|
31
|
-
flexShrink?: number;
|
|
32
|
-
/** Flex basis value for the table container */
|
|
33
|
-
flexBasis?: DimensionValue;
|
|
34
|
-
/** Additional styles */
|
|
35
|
-
style?: any;
|
|
36
|
-
}
|
|
37
|
-
export interface TableTheadProps extends DefaultProps {
|
|
38
|
-
/** Thead children */
|
|
39
|
-
children?: React.ReactNode;
|
|
40
|
-
/** Additional styles */
|
|
41
|
-
style?: any;
|
|
42
|
-
}
|
|
43
|
-
export interface TableTbodyProps extends DefaultProps {
|
|
44
|
-
/** Tbody children */
|
|
45
|
-
children?: React.ReactNode;
|
|
46
|
-
/** Additional styles */
|
|
47
|
-
style?: any;
|
|
48
|
-
}
|
|
49
|
-
export interface TableTfootProps extends DefaultProps {
|
|
50
|
-
/** Tfoot children */
|
|
20
|
+
/** Table children (THead, TBody, TFoot, Caption) */
|
|
51
21
|
children?: React.ReactNode;
|
|
52
22
|
/** Additional styles */
|
|
53
23
|
style?: any;
|
|
24
|
+
/** Enable horizontal scrolling */
|
|
25
|
+
horizontallyScrollable?: boolean;
|
|
54
26
|
}
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
children?: React.ReactNode;
|
|
58
|
-
/** Additional styles */
|
|
59
|
-
style?: any;
|
|
60
|
-
/** Internal row index */
|
|
61
|
-
__index?: number;
|
|
62
|
-
}
|
|
63
|
-
export interface TableThProps extends DefaultProps, WithTextWrapperProps {
|
|
64
|
-
/** Th children */
|
|
65
|
-
children?: React.ReactNode;
|
|
66
|
-
/** Additional styles */
|
|
67
|
-
style?: any;
|
|
68
|
-
/** Internal column index */
|
|
69
|
-
__columnIndex?: number;
|
|
70
|
-
}
|
|
71
|
-
export interface TableTdProps extends DefaultProps, WithTextWrapperProps {
|
|
72
|
-
/** Td children */
|
|
73
|
-
children?: React.ReactNode;
|
|
74
|
-
/** Additional styles */
|
|
75
|
-
style?: any;
|
|
76
|
-
/** Internal column index */
|
|
77
|
-
__columnIndex?: number;
|
|
78
|
-
}
|
|
79
|
-
declare const Thead: React.ForwardRefExoticComponent<TableTheadProps & React.RefAttributes<any>>;
|
|
80
|
-
declare const Tbody: React.ForwardRefExoticComponent<TableTbodyProps & React.RefAttributes<any>>;
|
|
81
|
-
declare const Tfoot: React.ForwardRefExoticComponent<TableTfootProps & React.RefAttributes<any>>;
|
|
82
|
-
declare const Tr: React.ForwardRefExoticComponent<TableTrProps & React.RefAttributes<any>>;
|
|
83
|
-
declare const Th: React.ForwardRefExoticComponent<TableThProps & React.RefAttributes<any>>;
|
|
84
|
-
declare const Td: React.ForwardRefExoticComponent<TableTdProps & React.RefAttributes<any>>;
|
|
85
|
-
interface TableComponent extends React.ForwardRefExoticComponent<TableProps & React.RefAttributes<any>> {
|
|
86
|
-
Thead: typeof Thead;
|
|
87
|
-
Tbody: typeof Tbody;
|
|
88
|
-
Tfoot: typeof Tfoot;
|
|
89
|
-
Tr: typeof Tr;
|
|
90
|
-
Th: typeof Th;
|
|
91
|
-
Td: typeof Td;
|
|
92
|
-
}
|
|
93
|
-
declare const TableWithSubComponents: TableComponent;
|
|
94
|
-
export { TableWithSubComponents as Table };
|
|
27
|
+
export declare const _Table: any;
|
|
28
|
+
export declare const Table: any;
|
|
95
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAKzE,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,6BAA6B;IAC7B,WAAW,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAE/B,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC,mEAAmE;IACnE,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAEpC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAE7B,0BAA0B;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,4BAA4B;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,wBAAwB;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ,kCAAkC;IAClC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAqVD,eAAO,MAAM,MAAM,EAwEb,GAAG,CAAC;AAKV,eAAO,MAAM,KAAK,KAQhB,CAAC"}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
declare const _default: (params?: any, variations?: any) => {
|
|
2
|
-
styles: {
|
|
3
|
-
root:
|
|
4
|
-
|
|
2
|
+
styles: Readonly<{
|
|
3
|
+
root: {
|
|
4
|
+
cursor: "pointer";
|
|
5
|
+
border: number;
|
|
6
|
+
padding: number;
|
|
7
|
+
appearance: string;
|
|
8
|
+
fontSize: number;
|
|
9
|
+
textAlign: "left";
|
|
10
|
+
color: string;
|
|
11
|
+
textDecoration: string;
|
|
12
|
+
boxSizing: "border-box";
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
theme: import("../..").MantineTheme;
|
|
6
17
|
sx: (...args: any) => any;
|
|
7
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnstyledButton.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/UnstyledButton/UnstyledButton.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnstyledButton.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/UnstyledButton/UnstyledButton.styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,wBAeI"}
|
|
@@ -45,7 +45,6 @@ export * from './SegmentedControl';
|
|
|
45
45
|
export * from './Pagination';
|
|
46
46
|
export * from './Card';
|
|
47
47
|
export * from './Timeline';
|
|
48
|
-
export * from './Table';
|
|
49
48
|
export * from './List';
|
|
50
49
|
export * from './Image';
|
|
51
50
|
export * from './BackgroundImage';
|
|
@@ -74,4 +73,5 @@ export * from './Select';
|
|
|
74
73
|
export * from './MultiSelect';
|
|
75
74
|
export * from './RingProgress';
|
|
76
75
|
export * from './TransferList';
|
|
76
|
+
export * from './Table';
|
|
77
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAGvB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AAGvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAG7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAGvB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AAGvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAG7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AAGvB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAG7B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAG5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAG7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAG1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AAGvB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAG9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,SAAS,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
2
2
|
import type { MantineTheme } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Type constraint for style objects
|
|
5
|
+
* Ensures each property is a valid React Native style type
|
|
6
|
+
*/
|
|
3
7
|
type NamedStyles<T> = {
|
|
4
8
|
[P in keyof T]: ViewStyle | TextStyle | ImageStyle;
|
|
5
9
|
};
|
|
@@ -7,8 +11,38 @@ type Variations = {
|
|
|
7
11
|
variant?: string;
|
|
8
12
|
size: string | number;
|
|
9
13
|
} | any;
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Creates a styles hook with proper TypeScript inference
|
|
16
|
+
*
|
|
17
|
+
* @template Styles - The shape of the styles object
|
|
18
|
+
* @template Params - The shape of the params object (defaults to any for backward compatibility)
|
|
19
|
+
* @param input - Function that returns style definitions based on theme, params, and variations
|
|
20
|
+
* @returns A hook that returns typed styles
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const useStyles = createStyles(
|
|
25
|
+
* (theme, params: { color: string }) => ({
|
|
26
|
+
* container: {
|
|
27
|
+
* backgroundColor: params.color,
|
|
28
|
+
* padding: theme.spacing.md,
|
|
29
|
+
* },
|
|
30
|
+
* text: {
|
|
31
|
+
* color: theme.colors.dark[0],
|
|
32
|
+
* fontSize: theme.fontSizes.md,
|
|
33
|
+
* },
|
|
34
|
+
* })
|
|
35
|
+
* );
|
|
36
|
+
*
|
|
37
|
+
* // In component:
|
|
38
|
+
* const { styles } = useStyles({ color: 'red' });
|
|
39
|
+
* <View style={styles.container}>
|
|
40
|
+
* <Text style={styles.text}>Hello</Text>
|
|
41
|
+
* </View>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function createStyles<Styles extends NamedStyles<Styles> = any, Params = any>(input: (theme: MantineTheme, params: Params, variations?: Variations) => Styles): (params?: Params, variations?: Variations) => {
|
|
45
|
+
styles: Readonly<Styles>;
|
|
12
46
|
theme: MantineTheme;
|
|
13
47
|
sx: (...args: any) => any;
|
|
14
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-styles.d.ts","sourceRoot":"","sources":["../../../../../src/theme/create-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU;CACnD,CAAC;AAEF,KAAK,UAAU,GACX;IACE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,GACD,GAAG,CAAC;AAER,wBAAgB,YAAY,CAAC,CAAC,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"create-styles.d.ts","sourceRoot":"","sources":["../../../../../src/theme/create-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU;CACnD,CAAC;AAEF,KAAK,UAAU,GACX;IACE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,GACD,GAAG,CAAC;AAER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,YAAY,CAC1B,MAAM,SAAS,WAAW,CAAC,MAAM,CAAC,GAAG,GAAG,EACxC,MAAM,GAAG,GAAG,EAEZ,KAAK,EAAE,CACL,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,UAAU,KACpB,MAAM,aAIiB,MAAM,eAAe,UAAU;YAOb,QAAQ,CAAC,MAAM,CAAC;;kBAJvC,GAAG;EAW3B"}
|
package/package.json
CHANGED
|
@@ -111,8 +111,8 @@ export const Anchor = forwardRef<RNText, AnchorProps>((props, ref) => {
|
|
|
111
111
|
useComponentDefaultProps('Anchor', defaultProps, props);
|
|
112
112
|
|
|
113
113
|
const { styles, sx} = useStyles(
|
|
114
|
-
{ color
|
|
115
|
-
{ name: 'Anchor', variant }
|
|
114
|
+
{ color: color!, size: size!, weight: weight!, underline: underline! },
|
|
115
|
+
{ name: 'Anchor', variant: variant! }
|
|
116
116
|
) as any;
|
|
117
117
|
|
|
118
118
|
const handlePress = () => {
|
|
@@ -121,7 +121,7 @@ export const Avatar = forwardRef<any, AvatarProps>((props, ref) => {
|
|
|
121
121
|
const [imageError, setImageError] = useState(false);
|
|
122
122
|
|
|
123
123
|
const { styles, sx} = useStyles(
|
|
124
|
-
{ color
|
|
124
|
+
{ color: color!, radius: radius!, size: size! },
|
|
125
125
|
{ name: 'Avatar' }
|
|
126
126
|
) as any;
|
|
127
127
|
|
|
@@ -57,7 +57,7 @@ export const BackgroundImage = forwardRef<any, BackgroundImageProps>((props, ref
|
|
|
57
57
|
} = useComponentDefaultProps('BackgroundImage', defaultProps, props);
|
|
58
58
|
|
|
59
59
|
const { styles, sx} = useStyles(
|
|
60
|
-
{ radius },
|
|
60
|
+
{ radius: radius! },
|
|
61
61
|
{ name: 'BackgroundImage' }
|
|
62
62
|
) as any;
|
|
63
63
|
|
|
@@ -189,8 +189,8 @@ export const Badge = forwardRef<any, BadgeProps>((props, ref) => {
|
|
|
189
189
|
} = useComponentDefaultProps('Badge', defaultProps, props);
|
|
190
190
|
|
|
191
191
|
const { styles, sx} = useStyles(
|
|
192
|
-
{ color
|
|
193
|
-
{ name: 'Badge', variant
|
|
192
|
+
{ color: color!, radius: radius!, fullWidth: fullWidth! },
|
|
193
|
+
{ name: 'Badge', variant: variant!, size: size! }
|
|
194
194
|
) as any;
|
|
195
195
|
|
|
196
196
|
// Get the text color from the variant styles
|
|
@@ -85,7 +85,7 @@ export const Blockquote = forwardRef<any, BlockquoteProps>((props, ref) => {
|
|
|
85
85
|
const { color, icon, cite, radius, children, style, withTextWrapper: shouldWrapInText} =
|
|
86
86
|
useComponentDefaultProps('Blockquote', defaultProps, props);
|
|
87
87
|
|
|
88
|
-
const { styles, sx, ...others} = useStyles({ color
|
|
88
|
+
const { styles, sx, ...others} = useStyles({ color: color!, radius: radius! }, { name: 'Blockquote' }) as any;
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
91
|
<BoxView ref={ref} style={sx(styles.root, style)} {...others}>
|
|
@@ -105,18 +105,18 @@ export const _Button = forwardRef<View, ButtonProps>((props, ref) => {
|
|
|
105
105
|
|
|
106
106
|
const { styles, sx, theme } = useStyles(
|
|
107
107
|
{
|
|
108
|
-
radius
|
|
109
|
-
color
|
|
110
|
-
fullWidth
|
|
111
|
-
compact
|
|
108
|
+
radius: radius!,
|
|
109
|
+
color: color!,
|
|
110
|
+
fullWidth: fullWidth!,
|
|
111
|
+
compact: compact!,
|
|
112
112
|
gradient,
|
|
113
113
|
withLeftIcon: !!leftIcon,
|
|
114
114
|
withRightIcon: !!rightIcon,
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
name: 'Button',
|
|
118
|
-
variant
|
|
119
|
-
size
|
|
118
|
+
variant: variant!,
|
|
119
|
+
size: size!,
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
122
|
|
|
@@ -117,7 +117,7 @@ export const Card = forwardRef<any, CardProps>((props, ref) => {
|
|
|
117
117
|
...otherProps
|
|
118
118
|
} = useComponentDefaultProps('Card', defaultCardProps, props);
|
|
119
119
|
|
|
120
|
-
const { styles, sx } = useCardStyles({ padding}, { name: 'Card' }) as any;
|
|
120
|
+
const { styles, sx } = useCardStyles({ padding: padding! }, { name: 'Card' }) as any;
|
|
121
121
|
|
|
122
122
|
// Use p prop for Paper, padding for Card internal logic
|
|
123
123
|
const paperPadding = p !== undefined ? p : 0;
|
|
@@ -145,8 +145,8 @@ export const CardSection = forwardRef<any, CardSectionProps>((props, ref) => {
|
|
|
145
145
|
const { styles, sx} = useCardSectionStyles(
|
|
146
146
|
{
|
|
147
147
|
padding,
|
|
148
|
-
withBorder
|
|
149
|
-
inheritPadding
|
|
148
|
+
withBorder: withBorder!,
|
|
149
|
+
inheritPadding: inheritPadding!,
|
|
150
150
|
cardPadding: cardContext?.padding,
|
|
151
151
|
},
|
|
152
152
|
{ name: 'CardSection' }
|
|
@@ -116,7 +116,7 @@ export const Checkbox = forwardRef<any, CheckboxProps>((props, ref) => {
|
|
|
116
116
|
...otherProps
|
|
117
117
|
} = useComponentDefaultProps('Checkbox', defaultProps, props);
|
|
118
118
|
|
|
119
|
-
const { styles, sx } = useStyles({ size
|
|
119
|
+
const { styles, sx } = useStyles({ size: size!, color: color!, disabled: disabled! }, { name: 'Checkbox' }) as any;
|
|
120
120
|
|
|
121
121
|
const scaleAnim = useRef(new Animated.Value(checked ? 1 : 0)).current;
|
|
122
122
|
|
|
@@ -209,7 +209,7 @@ export const Chip = forwardRef<any, ChipProps>((props, ref) => {
|
|
|
209
209
|
const checked = controlledChecked !== undefined ? controlledChecked : uncontrolledChecked;
|
|
210
210
|
|
|
211
211
|
const { styles, sx} = useStyles(
|
|
212
|
-
{ size
|
|
212
|
+
{ size: size!, color: color!, radius: radius!, variant: variant!, checked, disabled: disabled! },
|
|
213
213
|
{ name: 'Chip' }
|
|
214
214
|
) as any;
|
|
215
215
|
|
|
@@ -306,7 +306,7 @@ export const ChipGroup = forwardRef<any, ChipGroupProps>((props, ref) => {
|
|
|
306
306
|
|
|
307
307
|
const value = controlledValue !== undefined ? controlledValue : uncontrolledValue;
|
|
308
308
|
|
|
309
|
-
const { styles, sx } = useGroupStyles({ spacing}, { name: 'ChipGroup' }) as any;
|
|
309
|
+
const { styles, sx } = useGroupStyles({ spacing: spacing! }, { name: 'ChipGroup' }) as any;
|
|
310
310
|
|
|
311
311
|
const handleChipChange = (chipValue: string, checked: boolean) => {
|
|
312
312
|
let newValue: string | string[];
|
|
@@ -105,7 +105,7 @@ export const CloseButton = forwardRef<any, CloseButtonProps>((props, ref) => {
|
|
|
105
105
|
} = useComponentDefaultProps('CloseButton', defaultProps, props);
|
|
106
106
|
|
|
107
107
|
const { styles, sx, theme} = useStyles(
|
|
108
|
-
{ size
|
|
108
|
+
{ size: size!, radius: radius!, disabled: disabled! },
|
|
109
109
|
{ name: 'CloseButton' }
|
|
110
110
|
) as any;
|
|
111
111
|
|
|
@@ -82,7 +82,7 @@ export const ColorSwatch = forwardRef<any, ColorSwatchProps>((props, ref) => {
|
|
|
82
82
|
useComponentDefaultProps('ColorSwatch', defaultProps, props);
|
|
83
83
|
|
|
84
84
|
const { styles, sx} = useStyles(
|
|
85
|
-
{ color
|
|
85
|
+
{ color: color!, size: size!, radius: radius!, withShadow: withShadow! },
|
|
86
86
|
{ name: 'ColorSwatch' }
|
|
87
87
|
) as any;
|
|
88
88
|
|
|
@@ -163,7 +163,7 @@ export const Dialog = forwardRef<any, DialogProps>((props, ref) => {
|
|
|
163
163
|
...otherProps
|
|
164
164
|
} = useComponentDefaultProps('Dialog', defaultProps, props);
|
|
165
165
|
|
|
166
|
-
const { styles, sx } = useStyles({ size
|
|
166
|
+
const { styles, sx } = useStyles({ size: size!, position, centered }, { name: 'Dialog' }) as any;
|
|
167
167
|
|
|
168
168
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
169
169
|
const slideAnim = useRef(new Animated.Value(50)).current;
|
|
@@ -139,7 +139,7 @@ export const Divider = forwardRef<any, DividerProps>((props, ref) => {
|
|
|
139
139
|
} = useComponentDefaultProps('Divider', defaultProps, props);
|
|
140
140
|
|
|
141
141
|
const { styles, sx} = useStyles(
|
|
142
|
-
{ orientation
|
|
142
|
+
{ orientation: orientation!, color, size: size!, variant: variant!, labelPosition: labelPosition! },
|
|
143
143
|
{ name: 'Divider' }
|
|
144
144
|
) as any;
|
|
145
145
|
|
|
@@ -130,7 +130,7 @@ export const Grid = Object.assign(
|
|
|
130
130
|
useComponentDefaultProps('Grid', defaultGridProps, props);
|
|
131
131
|
|
|
132
132
|
const { styles, sx} = useGridStyles(
|
|
133
|
-
{ gutter
|
|
133
|
+
{ gutter: gutter!, align: align!, justify: justify! },
|
|
134
134
|
{ name: 'Grid' }
|
|
135
135
|
) as any;
|
|
136
136
|
|
|
@@ -155,7 +155,7 @@ export const Grid = Object.assign(
|
|
|
155
155
|
useComponentDefaultProps('GridCol', defaultColProps, props);
|
|
156
156
|
|
|
157
157
|
const { styles, sx} = useColStyles(
|
|
158
|
-
{ span
|
|
158
|
+
{ span: span!, offset: offset!, order: order!, columns, gutter, grow },
|
|
159
159
|
{ name: 'GridCol' }
|
|
160
160
|
) as any;
|
|
161
161
|
|
|
@@ -134,7 +134,7 @@ export const Image = forwardRef<any, ImageProps>((props, ref) => {
|
|
|
134
134
|
const [error, setError] = useState(false);
|
|
135
135
|
|
|
136
136
|
const { styles, sx } = useStyles(
|
|
137
|
-
{ width, height, radius
|
|
137
|
+
{ width, height, radius: radius!, fit: fit! },
|
|
138
138
|
{ name: 'Image' }
|
|
139
139
|
) as any;
|
|
140
140
|
|
|
@@ -210,7 +210,7 @@ export const Indicator = forwardRef<any, IndicatorProps>((props, ref) => {
|
|
|
210
210
|
} = useComponentDefaultProps('Indicator', defaultProps, props);
|
|
211
211
|
|
|
212
212
|
const { styles, sx} = useStyles(
|
|
213
|
-
{ color
|
|
213
|
+
{ color: color!, size: size!, radius: radius!, withBorder: withBorder!, position: position!, offset: offset!, disabled: disabled!, inline: inline! },
|
|
214
214
|
{ name: 'Indicator' }
|
|
215
215
|
) as any;
|
|
216
216
|
|
|
@@ -209,7 +209,7 @@ const ListRoot = forwardRef<any, ListProps>((props, ref) => {
|
|
|
209
209
|
} = useComponentDefaultProps('List', defaultProps, props);
|
|
210
210
|
|
|
211
211
|
const { styles, sx} = useListStyles(
|
|
212
|
-
{ withPadding
|
|
212
|
+
{ withPadding: withPadding!, spacing: spacing! },
|
|
213
213
|
{ name: 'List' }
|
|
214
214
|
) as any;
|
|
215
215
|
|
|
@@ -282,7 +282,7 @@ const MenuItem = forwardRef<any, MenuItemProps>((props, ref) => {
|
|
|
282
282
|
const [isPressed, setIsPressed] = React.useState(false);
|
|
283
283
|
|
|
284
284
|
const { styles, sx } = useItemStyles(
|
|
285
|
-
{ color
|
|
285
|
+
{ color: color!, disabled: disabled! },
|
|
286
286
|
{ name: 'MenuItem' }
|
|
287
287
|
) as any;
|
|
288
288
|
|
|
@@ -76,7 +76,7 @@ export const Overlay = forwardRef<any, OverlayProps>((props, ref) => {
|
|
|
76
76
|
useComponentDefaultProps('Overlay', defaultProps, props);
|
|
77
77
|
|
|
78
78
|
const { styles, sx} = useStyles(
|
|
79
|
-
{ opacity
|
|
79
|
+
{ opacity: opacity!, color: color!, zIndex: zIndex!, radius: radius!, fixed: fixed! },
|
|
80
80
|
{ name: 'Overlay' }
|
|
81
81
|
) as any;
|
|
82
82
|
|
|
@@ -81,7 +81,7 @@ export const Paper = forwardRef<any, PaperProps>((props, ref) => {
|
|
|
81
81
|
const { shadow, radius, p, withBorder, children, style} =
|
|
82
82
|
useComponentDefaultProps('Paper', defaultProps, props);
|
|
83
83
|
|
|
84
|
-
const { styles, sx, ...others} = useStyles({ shadow, radius
|
|
84
|
+
const { styles, sx, ...others} = useStyles({ shadow, radius: radius!, p, withBorder: withBorder! }, { name: 'Paper' }) as any;
|
|
85
85
|
|
|
86
86
|
return (
|
|
87
87
|
<BoxView ref={ref} style={sx(styles.root, style)} {...others}>
|