@recursica/mantine-adapter 0.33.0 → 0.34.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/CHANGELOG.md +6 -0
- package/OVERSTYLING.md +56 -0
- package/USAGE.md +6 -4
- package/dist/mantine-adapter.cjs +2 -2
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.js +1765 -1445
- package/dist/mantine-adapter.js.map +1 -1
- package/dist/src/components/Modal/Modal.d.ts +21 -8
- package/dist/src/components/Pagination/Pagination.d.ts +45 -25
- package/dist/src/components/Panel/Panel.d.ts +22 -8
- package/dist/src/components/Stepper/Stepper.d.ts +4 -2
- package/dist/src/components/Table/Table.d.ts +25 -9
- package/dist/src/components/Tooltip/Tooltip.d.ts +4 -2
- package/llms.txt +57 -2
- package/package.json +3 -2
- package/src/OverStyling.tsx +10 -226
- package/src/components/Modal/Modal.tsx +129 -23
- package/src/components/Pagination/Pagination.tsx +73 -17
- package/src/components/Panel/Panel.tsx +134 -14
- package/src/components/Stepper/Stepper.tsx +20 -2
- package/src/components/Table/Table.tsx +153 -16
- package/src/components/Table/USAGE.md +0 -10
- package/src/components/Tooltip/Tooltip.tsx +26 -2
|
@@ -2,6 +2,14 @@ import { forwardRef } from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
Table as MantineTable,
|
|
4
4
|
type TableProps as MantineTableProps,
|
|
5
|
+
type TableTheadProps as MantineTableTheadProps,
|
|
6
|
+
type TableTbodyProps as MantineTableTbodyProps,
|
|
7
|
+
type TableTrProps as MantineTableTrProps,
|
|
8
|
+
type TableThProps as MantineTableThProps,
|
|
9
|
+
type TableTdProps as MantineTableTdProps,
|
|
10
|
+
type TableTfootProps as MantineTableTfootProps,
|
|
11
|
+
type TableCaptionProps as MantineTableCaptionProps,
|
|
12
|
+
type TableScrollContainerProps as MantineTableScrollContainerProps,
|
|
5
13
|
} from "@mantine/core";
|
|
6
14
|
import {
|
|
7
15
|
filterStylingProps,
|
|
@@ -38,23 +46,152 @@ const TableBase = forwardRef<HTMLTableElement, TableProps>(function Table(
|
|
|
38
46
|
|
|
39
47
|
TableBase.displayName = "Table";
|
|
40
48
|
|
|
49
|
+
// ==== EXPLICIT DOT-NOTATION SUB-COMPONENTS ====
|
|
50
|
+
// Each sub-component is wrapped independently so it goes through
|
|
51
|
+
// filterStylingProps/overStyled the same way the root Table does.
|
|
52
|
+
|
|
53
|
+
export type TableTheadProps = RecursicaOverStyled<MantineTableTheadProps>;
|
|
54
|
+
|
|
55
|
+
export const TableThead = forwardRef<HTMLTableSectionElement, TableTheadProps>(
|
|
56
|
+
function TableThead({ overStyled = false, ...rest }, ref) {
|
|
57
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
58
|
+
return (
|
|
59
|
+
<MantineTable.Thead
|
|
60
|
+
ref={ref}
|
|
61
|
+
{...(sanitizedProps as unknown as MantineTableTheadProps)}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
);
|
|
66
|
+
TableThead.displayName = "TableThead";
|
|
67
|
+
|
|
68
|
+
export type TableTbodyProps = RecursicaOverStyled<MantineTableTbodyProps>;
|
|
69
|
+
|
|
70
|
+
export const TableTbody = forwardRef<HTMLTableSectionElement, TableTbodyProps>(
|
|
71
|
+
function TableTbody({ overStyled = false, ...rest }, ref) {
|
|
72
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
73
|
+
return (
|
|
74
|
+
<MantineTable.Tbody
|
|
75
|
+
ref={ref}
|
|
76
|
+
{...(sanitizedProps as unknown as MantineTableTbodyProps)}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
},
|
|
80
|
+
);
|
|
81
|
+
TableTbody.displayName = "TableTbody";
|
|
82
|
+
|
|
83
|
+
export type TableTrProps = RecursicaOverStyled<MantineTableTrProps>;
|
|
84
|
+
|
|
85
|
+
export const TableTr = forwardRef<HTMLTableRowElement, TableTrProps>(
|
|
86
|
+
function TableTr({ overStyled = false, ...rest }, ref) {
|
|
87
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
88
|
+
return (
|
|
89
|
+
<MantineTable.Tr
|
|
90
|
+
ref={ref}
|
|
91
|
+
{...(sanitizedProps as unknown as MantineTableTrProps)}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
);
|
|
96
|
+
TableTr.displayName = "TableTr";
|
|
97
|
+
|
|
98
|
+
export type TableThProps = RecursicaOverStyled<MantineTableThProps>;
|
|
99
|
+
|
|
100
|
+
export const TableTh = forwardRef<HTMLTableCellElement, TableThProps>(
|
|
101
|
+
function TableTh({ overStyled = false, ...rest }, ref) {
|
|
102
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
103
|
+
return (
|
|
104
|
+
<MantineTable.Th
|
|
105
|
+
ref={ref}
|
|
106
|
+
{...(sanitizedProps as unknown as MantineTableThProps)}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
);
|
|
111
|
+
TableTh.displayName = "TableTh";
|
|
112
|
+
|
|
113
|
+
export type TableTdProps = RecursicaOverStyled<MantineTableTdProps>;
|
|
114
|
+
|
|
115
|
+
export const TableTd = forwardRef<HTMLTableCellElement, TableTdProps>(
|
|
116
|
+
function TableTd({ overStyled = false, ...rest }, ref) {
|
|
117
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
118
|
+
return (
|
|
119
|
+
<MantineTable.Td
|
|
120
|
+
ref={ref}
|
|
121
|
+
{...(sanitizedProps as unknown as MantineTableTdProps)}
|
|
122
|
+
/>
|
|
123
|
+
);
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
TableTd.displayName = "TableTd";
|
|
127
|
+
|
|
128
|
+
export type TableTfootProps = RecursicaOverStyled<MantineTableTfootProps>;
|
|
129
|
+
|
|
130
|
+
export const TableTfoot = forwardRef<HTMLTableSectionElement, TableTfootProps>(
|
|
131
|
+
function TableTfoot({ overStyled = false, ...rest }, ref) {
|
|
132
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
133
|
+
return (
|
|
134
|
+
<MantineTable.Tfoot
|
|
135
|
+
ref={ref}
|
|
136
|
+
{...(sanitizedProps as unknown as MantineTableTfootProps)}
|
|
137
|
+
/>
|
|
138
|
+
);
|
|
139
|
+
},
|
|
140
|
+
);
|
|
141
|
+
TableTfoot.displayName = "TableTfoot";
|
|
142
|
+
|
|
143
|
+
export type TableCaptionProps = RecursicaOverStyled<MantineTableCaptionProps>;
|
|
144
|
+
|
|
145
|
+
export const TableCaption = forwardRef<
|
|
146
|
+
HTMLTableCaptionElement,
|
|
147
|
+
TableCaptionProps
|
|
148
|
+
>(function TableCaption({ overStyled = false, ...rest }, ref) {
|
|
149
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
150
|
+
return (
|
|
151
|
+
<MantineTable.Caption
|
|
152
|
+
ref={ref}
|
|
153
|
+
{...(sanitizedProps as unknown as MantineTableCaptionProps)}
|
|
154
|
+
/>
|
|
155
|
+
);
|
|
156
|
+
});
|
|
157
|
+
TableCaption.displayName = "TableCaption";
|
|
158
|
+
|
|
159
|
+
export type TableScrollContainerProps =
|
|
160
|
+
RecursicaOverStyled<MantineTableScrollContainerProps>;
|
|
161
|
+
|
|
162
|
+
export const TableScrollContainer = forwardRef<
|
|
163
|
+
HTMLDivElement,
|
|
164
|
+
TableScrollContainerProps
|
|
165
|
+
>(function TableScrollContainer({ overStyled = false, ...rest }, ref) {
|
|
166
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
167
|
+
return (
|
|
168
|
+
<MantineTable.ScrollContainer
|
|
169
|
+
ref={ref}
|
|
170
|
+
{...(sanitizedProps as unknown as MantineTableScrollContainerProps)}
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
TableScrollContainer.displayName = "TableScrollContainer";
|
|
175
|
+
|
|
176
|
+
// ==== DOT NOTATION EXPORT ====
|
|
177
|
+
|
|
41
178
|
type TableComponent = typeof TableBase & {
|
|
42
|
-
Thead: typeof
|
|
43
|
-
Tbody: typeof
|
|
44
|
-
Tr: typeof
|
|
45
|
-
Th: typeof
|
|
46
|
-
Td: typeof
|
|
47
|
-
Tfoot: typeof
|
|
48
|
-
Caption: typeof
|
|
49
|
-
ScrollContainer: typeof
|
|
179
|
+
Thead: typeof TableThead;
|
|
180
|
+
Tbody: typeof TableTbody;
|
|
181
|
+
Tr: typeof TableTr;
|
|
182
|
+
Th: typeof TableTh;
|
|
183
|
+
Td: typeof TableTd;
|
|
184
|
+
Tfoot: typeof TableTfoot;
|
|
185
|
+
Caption: typeof TableCaption;
|
|
186
|
+
ScrollContainer: typeof TableScrollContainer;
|
|
50
187
|
};
|
|
51
188
|
|
|
52
189
|
export const Table = TableBase as TableComponent;
|
|
53
|
-
Table.Thead =
|
|
54
|
-
Table.Tbody =
|
|
55
|
-
Table.Tr =
|
|
56
|
-
Table.Th =
|
|
57
|
-
Table.Td =
|
|
58
|
-
Table.Tfoot =
|
|
59
|
-
Table.Caption =
|
|
60
|
-
Table.ScrollContainer =
|
|
190
|
+
Table.Thead = TableThead;
|
|
191
|
+
Table.Tbody = TableTbody;
|
|
192
|
+
Table.Tr = TableTr;
|
|
193
|
+
Table.Th = TableTh;
|
|
194
|
+
Table.Td = TableTd;
|
|
195
|
+
Table.Tfoot = TableTfoot;
|
|
196
|
+
Table.Caption = TableCaption;
|
|
197
|
+
Table.ScrollContainer = TableScrollContainer;
|
|
@@ -39,13 +39,3 @@ export default function Demo() {
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
---
|
|
42
|
-
|
|
43
|
-
## 3. Design System Integration
|
|
44
|
-
|
|
45
|
-
All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
|
|
46
|
-
|
|
47
|
-
> [!IMPORTANT]
|
|
48
|
-
>
|
|
49
|
-
> - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
|
|
50
|
-
> - **No Direct Layers**: Do not pass a `layer` prop to this component. To place it on a specific visual layer, wrap it in a `<Layer layer={0|1|2|3}>` component natively.
|
|
51
|
-
> - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
1
2
|
import {
|
|
2
3
|
Tooltip as MantineTooltip,
|
|
3
4
|
type TooltipProps as MantineTooltipProps,
|
|
5
|
+
type TooltipFloatingProps as MantineTooltipFloatingProps,
|
|
4
6
|
} from "@mantine/core";
|
|
5
7
|
import {
|
|
6
8
|
filterStylingProps,
|
|
@@ -95,15 +97,37 @@ const TooltipBase = function Tooltip({
|
|
|
95
97
|
};
|
|
96
98
|
TooltipBase.displayName = "Tooltip";
|
|
97
99
|
|
|
100
|
+
// ============================================================
|
|
101
|
+
// TOOLTIP.FLOATING
|
|
102
|
+
// ============================================================
|
|
103
|
+
|
|
104
|
+
export type TooltipFloatingProps =
|
|
105
|
+
RecursicaOverStyled<MantineTooltipFloatingProps>;
|
|
106
|
+
|
|
107
|
+
export const TooltipFloating = forwardRef<HTMLDivElement, TooltipFloatingProps>(
|
|
108
|
+
function TooltipFloating({ overStyled = false, ...rest }, ref) {
|
|
109
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
110
|
+
return (
|
|
111
|
+
<MantineTooltip.Floating
|
|
112
|
+
ref={ref}
|
|
113
|
+
{...(sanitizedProps as unknown as MantineTooltipFloatingProps)}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
},
|
|
117
|
+
);
|
|
118
|
+
TooltipFloating.displayName = "TooltipFloating";
|
|
119
|
+
|
|
98
120
|
// ============================================================
|
|
99
121
|
// DOT NOTATION EXPORT
|
|
100
122
|
// ============================================================
|
|
101
123
|
|
|
102
124
|
type TooltipComponent = typeof TooltipBase & {
|
|
103
|
-
Floating: typeof
|
|
125
|
+
Floating: typeof TooltipFloating;
|
|
104
126
|
Group: typeof MantineTooltip.Group;
|
|
105
127
|
};
|
|
106
128
|
|
|
107
129
|
export const Tooltip = TooltipBase as TooltipComponent;
|
|
108
|
-
Tooltip.Floating =
|
|
130
|
+
Tooltip.Floating = TooltipFloating;
|
|
131
|
+
// Tooltip.Group has no styling props of its own (no `style`/`className`/BoxProps),
|
|
132
|
+
// so re-exporting Mantine's implementation directly is not a styling-gate gap.
|
|
109
133
|
Tooltip.Group = MantineTooltip.Group;
|