@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.
@@ -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 MantineTable.Thead;
43
- Tbody: typeof MantineTable.Tbody;
44
- Tr: typeof MantineTable.Tr;
45
- Th: typeof MantineTable.Th;
46
- Td: typeof MantineTable.Td;
47
- Tfoot: typeof MantineTable.Tfoot;
48
- Caption: typeof MantineTable.Caption;
49
- ScrollContainer: typeof MantineTable.ScrollContainer;
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 = MantineTable.Thead;
54
- Table.Tbody = MantineTable.Tbody;
55
- Table.Tr = MantineTable.Tr;
56
- Table.Th = MantineTable.Th;
57
- Table.Td = MantineTable.Td;
58
- Table.Tfoot = MantineTable.Tfoot;
59
- Table.Caption = MantineTable.Caption;
60
- Table.ScrollContainer = MantineTable.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 MantineTooltip.Floating;
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 = MantineTooltip.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;