@recursica/mantine-adapter 0.33.0 → 0.35.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 +17 -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 +2085 -1707
- package/dist/mantine-adapter.js.map +1 -1
- package/dist/src/components/Grid/Grid.d.ts +91 -0
- 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/dist/src/components/index.d.ts +1 -0
- package/dist/src/index.d.ts +64 -0
- package/llms.txt +58 -2
- package/package.json +3 -2
- package/src/OverStyling.tsx +10 -226
- package/src/components/Grid/GRID_IMPLEMENTATION_NOTES.md +9 -0
- package/src/components/Grid/Grid.module.css +11 -0
- package/src/components/Grid/Grid.stories.tsx +182 -0
- package/src/components/Grid/Grid.tsx +145 -0
- package/src/components/Grid/USAGE.md +47 -0
- 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
- package/src/components/index.ts +1 -0
- package/src/index.ts +2 -0
|
@@ -2,6 +2,12 @@ import React from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
Modal as MantineModal,
|
|
4
4
|
type ModalProps as MantineModalProps,
|
|
5
|
+
type ModalRootProps as MantineModalRootProps,
|
|
6
|
+
type ModalOverlayProps as MantineModalOverlayProps,
|
|
7
|
+
type ModalContentProps as MantineModalContentProps,
|
|
8
|
+
type ModalHeaderProps as MantineModalHeaderProps,
|
|
9
|
+
type ModalTitleProps as MantineModalTitleProps,
|
|
10
|
+
type ModalCloseButtonProps as MantineModalCloseButtonProps,
|
|
5
11
|
} from "@mantine/core";
|
|
6
12
|
import {
|
|
7
13
|
filterStylingProps,
|
|
@@ -114,18 +120,22 @@ ModalInner.displayName = "Modal";
|
|
|
114
120
|
* > primary action button MUST be the right-most element, with the secondary
|
|
115
121
|
* > (outline variant) action placed immediately to the left of it.
|
|
116
122
|
*/
|
|
117
|
-
|
|
118
|
-
HTMLDivElement,
|
|
123
|
+
export type ModalFooterProps = RecursicaOverStyled<
|
|
119
124
|
React.ComponentPropsWithoutRef<"div">
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
125
|
+
>;
|
|
126
|
+
|
|
127
|
+
const ModalFooter = React.forwardRef<HTMLDivElement, ModalFooterProps>(
|
|
128
|
+
function ModalFooter({ overStyled = false, className, ...rest }, ref) {
|
|
129
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
130
|
+
return (
|
|
131
|
+
<div
|
|
132
|
+
ref={ref}
|
|
133
|
+
className={`${styles.footer} ${className || ""}`}
|
|
134
|
+
{...sanitizedProps}
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
},
|
|
138
|
+
);
|
|
129
139
|
ModalFooter.displayName = "Modal.Footer";
|
|
130
140
|
|
|
131
141
|
const ModalBody = React.forwardRef<
|
|
@@ -197,16 +207,112 @@ const ModalBody = React.forwardRef<
|
|
|
197
207
|
});
|
|
198
208
|
ModalBody.displayName = "Modal.Body";
|
|
199
209
|
|
|
210
|
+
// ============================================================
|
|
211
|
+
// MODAL SUB-COMPONENTS (wrapped so overStyled/filterStylingProps applies)
|
|
212
|
+
// ============================================================
|
|
213
|
+
|
|
214
|
+
export type ModalRootProps = RecursicaOverStyled<MantineModalRootProps>;
|
|
215
|
+
|
|
216
|
+
const ModalRoot = React.forwardRef<HTMLDivElement, ModalRootProps>(
|
|
217
|
+
function ModalRoot({ overStyled = false, ...rest }, ref) {
|
|
218
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
219
|
+
return (
|
|
220
|
+
<MantineModal.Root
|
|
221
|
+
ref={ref}
|
|
222
|
+
{...(sanitizedProps as unknown as MantineModalRootProps)}
|
|
223
|
+
/>
|
|
224
|
+
);
|
|
225
|
+
},
|
|
226
|
+
);
|
|
227
|
+
ModalRoot.displayName = "Modal.Root";
|
|
228
|
+
|
|
229
|
+
export type ModalOverlayProps = RecursicaOverStyled<MantineModalOverlayProps>;
|
|
230
|
+
|
|
231
|
+
const ModalOverlay = React.forwardRef<HTMLDivElement, ModalOverlayProps>(
|
|
232
|
+
function ModalOverlay({ overStyled = false, ...rest }, ref) {
|
|
233
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
234
|
+
return (
|
|
235
|
+
<MantineModal.Overlay
|
|
236
|
+
ref={ref}
|
|
237
|
+
{...(sanitizedProps as unknown as MantineModalOverlayProps)}
|
|
238
|
+
/>
|
|
239
|
+
);
|
|
240
|
+
},
|
|
241
|
+
);
|
|
242
|
+
ModalOverlay.displayName = "Modal.Overlay";
|
|
243
|
+
|
|
244
|
+
export type ModalContentProps = RecursicaOverStyled<MantineModalContentProps>;
|
|
245
|
+
|
|
246
|
+
const ModalContent = React.forwardRef<HTMLDivElement, ModalContentProps>(
|
|
247
|
+
function ModalContent({ overStyled = false, ...rest }, ref) {
|
|
248
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
249
|
+
return (
|
|
250
|
+
<MantineModal.Content
|
|
251
|
+
ref={ref}
|
|
252
|
+
{...(sanitizedProps as unknown as MantineModalContentProps)}
|
|
253
|
+
/>
|
|
254
|
+
);
|
|
255
|
+
},
|
|
256
|
+
);
|
|
257
|
+
ModalContent.displayName = "Modal.Content";
|
|
258
|
+
|
|
259
|
+
export type ModalHeaderProps = RecursicaOverStyled<MantineModalHeaderProps>;
|
|
260
|
+
|
|
261
|
+
const ModalHeader = React.forwardRef<HTMLElement, ModalHeaderProps>(
|
|
262
|
+
function ModalHeader({ overStyled = false, ...rest }, ref) {
|
|
263
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
264
|
+
return (
|
|
265
|
+
<MantineModal.Header
|
|
266
|
+
ref={ref}
|
|
267
|
+
{...(sanitizedProps as unknown as MantineModalHeaderProps)}
|
|
268
|
+
/>
|
|
269
|
+
);
|
|
270
|
+
},
|
|
271
|
+
);
|
|
272
|
+
ModalHeader.displayName = "Modal.Header";
|
|
273
|
+
|
|
274
|
+
export type ModalTitleProps = RecursicaOverStyled<MantineModalTitleProps>;
|
|
275
|
+
|
|
276
|
+
const ModalTitle = React.forwardRef<HTMLHeadingElement, ModalTitleProps>(
|
|
277
|
+
function ModalTitle({ overStyled = false, ...rest }, ref) {
|
|
278
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
279
|
+
return (
|
|
280
|
+
<MantineModal.Title
|
|
281
|
+
ref={ref}
|
|
282
|
+
{...(sanitizedProps as unknown as MantineModalTitleProps)}
|
|
283
|
+
/>
|
|
284
|
+
);
|
|
285
|
+
},
|
|
286
|
+
);
|
|
287
|
+
ModalTitle.displayName = "Modal.Title";
|
|
288
|
+
|
|
289
|
+
export type ModalCloseButtonProps =
|
|
290
|
+
RecursicaOverStyled<MantineModalCloseButtonProps>;
|
|
291
|
+
|
|
292
|
+
const ModalCloseButton = React.forwardRef<
|
|
293
|
+
HTMLButtonElement,
|
|
294
|
+
ModalCloseButtonProps
|
|
295
|
+
>(function ModalCloseButton({ overStyled = false, ...rest }, ref) {
|
|
296
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
297
|
+
return (
|
|
298
|
+
<MantineModal.CloseButton
|
|
299
|
+
ref={ref}
|
|
300
|
+
{...(sanitizedProps as unknown as MantineModalCloseButtonProps)}
|
|
301
|
+
/>
|
|
302
|
+
);
|
|
303
|
+
});
|
|
304
|
+
ModalCloseButton.displayName = "Modal.CloseButton";
|
|
305
|
+
|
|
200
306
|
interface ModalComponent
|
|
201
307
|
extends React.ForwardRefExoticComponent<
|
|
202
308
|
ModalProps & React.RefAttributes<HTMLDivElement>
|
|
203
309
|
> {
|
|
204
|
-
Root: typeof
|
|
205
|
-
Overlay: typeof
|
|
206
|
-
Content: typeof
|
|
207
|
-
Header: typeof
|
|
208
|
-
Title: typeof
|
|
209
|
-
CloseButton: typeof
|
|
310
|
+
Root: typeof ModalRoot;
|
|
311
|
+
Overlay: typeof ModalOverlay;
|
|
312
|
+
Content: typeof ModalContent;
|
|
313
|
+
Header: typeof ModalHeader;
|
|
314
|
+
Title: typeof ModalTitle;
|
|
315
|
+
CloseButton: typeof ModalCloseButton;
|
|
210
316
|
Body: typeof ModalBody;
|
|
211
317
|
Footer: typeof ModalFooter;
|
|
212
318
|
}
|
|
@@ -214,11 +320,11 @@ interface ModalComponent
|
|
|
214
320
|
export const Modal = ModalInner as ModalComponent & {
|
|
215
321
|
Footer: typeof ModalFooter;
|
|
216
322
|
};
|
|
217
|
-
Modal.Root =
|
|
218
|
-
Modal.Overlay =
|
|
219
|
-
Modal.Content =
|
|
220
|
-
Modal.Header =
|
|
221
|
-
Modal.Title =
|
|
222
|
-
Modal.CloseButton =
|
|
323
|
+
Modal.Root = ModalRoot;
|
|
324
|
+
Modal.Overlay = ModalOverlay;
|
|
325
|
+
Modal.Content = ModalContent;
|
|
326
|
+
Modal.Header = ModalHeader;
|
|
327
|
+
Modal.Title = ModalTitle;
|
|
328
|
+
Modal.CloseButton = ModalCloseButton;
|
|
223
329
|
Modal.Body = ModalBody;
|
|
224
330
|
Modal.Footer = ModalFooter;
|
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
Pagination as MantinePagination,
|
|
5
5
|
type PaginationProps as MantinePaginationProps,
|
|
6
6
|
type PaginationRootProps as MantinePaginationRootProps,
|
|
7
|
+
type PaginationControlProps as MantinePaginationControlProps,
|
|
8
|
+
type PaginationDotsProps as MantinePaginationDotsProps,
|
|
7
9
|
} from "@mantine/core";
|
|
8
10
|
import {
|
|
9
11
|
filterStylingProps,
|
|
@@ -28,11 +30,13 @@ export type PaginationRootProps =
|
|
|
28
30
|
RecursicaOverStyled<MantinePaginationRootProps>;
|
|
29
31
|
|
|
30
32
|
export type PaginationEdgeProps<T extends React.ElementType> =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
RecursicaOverStyled<
|
|
34
|
+
React.ComponentProps<T> & {
|
|
35
|
+
/** If set to true, displays text labels alongside the icon. */
|
|
36
|
+
withLabel?: boolean;
|
|
37
|
+
icon?: any;
|
|
38
|
+
}
|
|
39
|
+
>;
|
|
36
40
|
|
|
37
41
|
function usePaginationClassNames(restRecord: Record<string, unknown>): {
|
|
38
42
|
className: string;
|
|
@@ -88,14 +92,18 @@ _PaginationRoot.displayName = "Pagination.Root";
|
|
|
88
92
|
const _PaginationNext = forwardRef<
|
|
89
93
|
HTMLButtonElement,
|
|
90
94
|
PaginationEdgeProps<typeof MantinePagination.Next>
|
|
91
|
-
>(function PaginationNext(
|
|
95
|
+
>(function PaginationNext(
|
|
96
|
+
{ overStyled = false, withLabel, icon, ...rest },
|
|
97
|
+
ref,
|
|
98
|
+
) {
|
|
99
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
92
100
|
const renderIcon = icon || (withLabel ? NextWithLabel : undefined);
|
|
93
101
|
return (
|
|
94
102
|
<MantinePagination.Next
|
|
95
103
|
ref={ref}
|
|
96
104
|
data-variant="text"
|
|
97
105
|
icon={renderIcon as any}
|
|
98
|
-
{...
|
|
106
|
+
{...sanitizedProps}
|
|
99
107
|
/>
|
|
100
108
|
);
|
|
101
109
|
});
|
|
@@ -104,14 +112,18 @@ _PaginationNext.displayName = "Pagination.Next";
|
|
|
104
112
|
const _PaginationPrevious = forwardRef<
|
|
105
113
|
HTMLButtonElement,
|
|
106
114
|
PaginationEdgeProps<typeof MantinePagination.Previous>
|
|
107
|
-
>(function PaginationPrevious(
|
|
115
|
+
>(function PaginationPrevious(
|
|
116
|
+
{ overStyled = false, withLabel, icon, ...rest },
|
|
117
|
+
ref,
|
|
118
|
+
) {
|
|
119
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
108
120
|
const renderIcon = icon || (withLabel ? PrevWithLabel : undefined);
|
|
109
121
|
return (
|
|
110
122
|
<MantinePagination.Previous
|
|
111
123
|
ref={ref}
|
|
112
124
|
data-variant="text"
|
|
113
125
|
icon={renderIcon as any}
|
|
114
|
-
{...
|
|
126
|
+
{...sanitizedProps}
|
|
115
127
|
/>
|
|
116
128
|
);
|
|
117
129
|
});
|
|
@@ -120,14 +132,18 @@ _PaginationPrevious.displayName = "Pagination.Previous";
|
|
|
120
132
|
const _PaginationFirst = forwardRef<
|
|
121
133
|
HTMLButtonElement,
|
|
122
134
|
PaginationEdgeProps<typeof MantinePagination.First>
|
|
123
|
-
>(function PaginationFirst(
|
|
135
|
+
>(function PaginationFirst(
|
|
136
|
+
{ overStyled = false, withLabel, icon, ...rest },
|
|
137
|
+
ref,
|
|
138
|
+
) {
|
|
139
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
124
140
|
const renderIcon = icon || (withLabel ? FirstWithLabel : undefined);
|
|
125
141
|
return (
|
|
126
142
|
<MantinePagination.First
|
|
127
143
|
ref={ref}
|
|
128
144
|
data-variant="text"
|
|
129
145
|
icon={renderIcon as any}
|
|
130
|
-
{...
|
|
146
|
+
{...sanitizedProps}
|
|
131
147
|
/>
|
|
132
148
|
);
|
|
133
149
|
});
|
|
@@ -136,14 +152,18 @@ _PaginationFirst.displayName = "Pagination.First";
|
|
|
136
152
|
const _PaginationLast = forwardRef<
|
|
137
153
|
HTMLButtonElement,
|
|
138
154
|
PaginationEdgeProps<typeof MantinePagination.Last>
|
|
139
|
-
>(function PaginationLast(
|
|
155
|
+
>(function PaginationLast(
|
|
156
|
+
{ overStyled = false, withLabel, icon, ...rest },
|
|
157
|
+
ref,
|
|
158
|
+
) {
|
|
159
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
140
160
|
const renderIcon = icon || (withLabel ? LastWithLabel : undefined);
|
|
141
161
|
return (
|
|
142
162
|
<MantinePagination.Last
|
|
143
163
|
ref={ref}
|
|
144
164
|
data-variant="text"
|
|
145
165
|
icon={renderIcon as any}
|
|
146
|
-
{...
|
|
166
|
+
{...sanitizedProps}
|
|
147
167
|
/>
|
|
148
168
|
);
|
|
149
169
|
});
|
|
@@ -192,14 +212,47 @@ const _Pagination = forwardRef<HTMLDivElement, PaginationProps>(
|
|
|
192
212
|
);
|
|
193
213
|
_Pagination.displayName = "Pagination";
|
|
194
214
|
|
|
215
|
+
export type PaginationControlProps =
|
|
216
|
+
RecursicaOverStyled<MantinePaginationControlProps>;
|
|
217
|
+
|
|
218
|
+
const _PaginationControl = forwardRef<
|
|
219
|
+
HTMLButtonElement,
|
|
220
|
+
PaginationControlProps
|
|
221
|
+
>(function PaginationControl({ overStyled = false, ...rest }, ref) {
|
|
222
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
223
|
+
return (
|
|
224
|
+
<MantinePagination.Control
|
|
225
|
+
ref={ref}
|
|
226
|
+
{...(sanitizedProps as unknown as MantinePaginationControlProps)}
|
|
227
|
+
/>
|
|
228
|
+
);
|
|
229
|
+
});
|
|
230
|
+
_PaginationControl.displayName = "Pagination.Control";
|
|
231
|
+
|
|
232
|
+
export type PaginationDotsProps =
|
|
233
|
+
RecursicaOverStyled<MantinePaginationDotsProps>;
|
|
234
|
+
|
|
235
|
+
const _PaginationDots = forwardRef<HTMLDivElement, PaginationDotsProps>(
|
|
236
|
+
function PaginationDots({ overStyled = false, ...rest }, ref) {
|
|
237
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
238
|
+
return (
|
|
239
|
+
<MantinePagination.Dots
|
|
240
|
+
ref={ref}
|
|
241
|
+
{...(sanitizedProps as unknown as MantinePaginationDotsProps)}
|
|
242
|
+
/>
|
|
243
|
+
);
|
|
244
|
+
},
|
|
245
|
+
);
|
|
246
|
+
_PaginationDots.displayName = "Pagination.Dots";
|
|
247
|
+
|
|
195
248
|
/**
|
|
196
249
|
* Recursica Pagination component wrapping Mantine's Pagination.
|
|
197
250
|
*/
|
|
198
251
|
export const Pagination = _Pagination as typeof _Pagination & {
|
|
199
252
|
Root: typeof _PaginationRoot;
|
|
200
253
|
Items: typeof MantinePagination.Items;
|
|
201
|
-
Control: typeof
|
|
202
|
-
Dots: typeof
|
|
254
|
+
Control: typeof _PaginationControl;
|
|
255
|
+
Dots: typeof _PaginationDots;
|
|
203
256
|
Next: typeof _PaginationNext;
|
|
204
257
|
Previous: typeof _PaginationPrevious;
|
|
205
258
|
First: typeof _PaginationFirst;
|
|
@@ -208,9 +261,12 @@ export const Pagination = _Pagination as typeof _Pagination & {
|
|
|
208
261
|
};
|
|
209
262
|
|
|
210
263
|
Pagination.Root = _PaginationRoot;
|
|
264
|
+
// Pagination.Items has no styling props of its own (just a `dotsIcon` prop, no
|
|
265
|
+
// `style`/`className`/BoxProps), so re-exporting Mantine's implementation
|
|
266
|
+
// directly is not a styling-gate gap.
|
|
211
267
|
Pagination.Items = MantinePagination.Items;
|
|
212
|
-
Pagination.Control =
|
|
213
|
-
Pagination.Dots =
|
|
268
|
+
Pagination.Control = _PaginationControl;
|
|
269
|
+
Pagination.Dots = _PaginationDots;
|
|
214
270
|
Pagination.Next = _PaginationNext;
|
|
215
271
|
Pagination.Previous = _PaginationPrevious;
|
|
216
272
|
Pagination.First = _PaginationFirst;
|
|
@@ -2,6 +2,13 @@ import { forwardRef } from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
Drawer as MantineDrawer,
|
|
4
4
|
type DrawerProps as MantineDrawerProps,
|
|
5
|
+
type DrawerRootProps as MantineDrawerRootProps,
|
|
6
|
+
type DrawerOverlayProps as MantineDrawerOverlayProps,
|
|
7
|
+
type DrawerContentProps as MantineDrawerContentProps,
|
|
8
|
+
type DrawerHeaderProps as MantineDrawerHeaderProps,
|
|
9
|
+
type DrawerTitleProps as MantineDrawerTitleProps,
|
|
10
|
+
type DrawerCloseButtonProps as MantineDrawerCloseButtonProps,
|
|
11
|
+
type DrawerBodyProps as MantineDrawerBodyProps,
|
|
5
12
|
} from "@mantine/core";
|
|
6
13
|
import {
|
|
7
14
|
filterStylingProps,
|
|
@@ -128,29 +135,142 @@ export const PanelFooter = forwardRef<HTMLDivElement, PanelFooterProps>(
|
|
|
128
135
|
);
|
|
129
136
|
PanelFooter.displayName = "PanelFooter";
|
|
130
137
|
|
|
138
|
+
// ============================================================
|
|
139
|
+
// PANEL SUB-COMPONENTS (wrapped so overStyled/filterStylingProps applies)
|
|
140
|
+
// ============================================================
|
|
141
|
+
|
|
142
|
+
export type PanelRootProps = RecursicaOverStyled<MantineDrawerRootProps>;
|
|
143
|
+
|
|
144
|
+
export const PanelRoot = forwardRef<HTMLDivElement, PanelRootProps>(
|
|
145
|
+
function PanelRoot({ overStyled = false, ...rest }, ref) {
|
|
146
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
147
|
+
return (
|
|
148
|
+
<MantineDrawer.Root
|
|
149
|
+
ref={ref}
|
|
150
|
+
{...(sanitizedProps as unknown as MantineDrawerRootProps)}
|
|
151
|
+
/>
|
|
152
|
+
);
|
|
153
|
+
},
|
|
154
|
+
);
|
|
155
|
+
PanelRoot.displayName = "PanelRoot";
|
|
156
|
+
|
|
157
|
+
export type PanelOverlayProps = RecursicaOverStyled<MantineDrawerOverlayProps>;
|
|
158
|
+
|
|
159
|
+
export const PanelOverlay = forwardRef<HTMLDivElement, PanelOverlayProps>(
|
|
160
|
+
function PanelOverlay({ overStyled = false, ...rest }, ref) {
|
|
161
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
162
|
+
return (
|
|
163
|
+
<MantineDrawer.Overlay
|
|
164
|
+
ref={ref}
|
|
165
|
+
{...(sanitizedProps as unknown as MantineDrawerOverlayProps)}
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
},
|
|
169
|
+
);
|
|
170
|
+
PanelOverlay.displayName = "PanelOverlay";
|
|
171
|
+
|
|
172
|
+
export type PanelContentProps = RecursicaOverStyled<MantineDrawerContentProps>;
|
|
173
|
+
|
|
174
|
+
export const PanelContent = forwardRef<HTMLDivElement, PanelContentProps>(
|
|
175
|
+
function PanelContent({ overStyled = false, ...rest }, ref) {
|
|
176
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
177
|
+
return (
|
|
178
|
+
<MantineDrawer.Content
|
|
179
|
+
ref={ref}
|
|
180
|
+
{...(sanitizedProps as unknown as MantineDrawerContentProps)}
|
|
181
|
+
/>
|
|
182
|
+
);
|
|
183
|
+
},
|
|
184
|
+
);
|
|
185
|
+
PanelContent.displayName = "PanelContent";
|
|
186
|
+
|
|
187
|
+
export type PanelHeaderProps = RecursicaOverStyled<MantineDrawerHeaderProps>;
|
|
188
|
+
|
|
189
|
+
export const PanelHeader = forwardRef<HTMLElement, PanelHeaderProps>(
|
|
190
|
+
function PanelHeader({ overStyled = false, ...rest }, ref) {
|
|
191
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
192
|
+
return (
|
|
193
|
+
<MantineDrawer.Header
|
|
194
|
+
ref={ref}
|
|
195
|
+
{...(sanitizedProps as unknown as MantineDrawerHeaderProps)}
|
|
196
|
+
/>
|
|
197
|
+
);
|
|
198
|
+
},
|
|
199
|
+
);
|
|
200
|
+
PanelHeader.displayName = "PanelHeader";
|
|
201
|
+
|
|
202
|
+
export type PanelTitleProps = RecursicaOverStyled<MantineDrawerTitleProps>;
|
|
203
|
+
|
|
204
|
+
export const PanelTitle = forwardRef<HTMLHeadingElement, PanelTitleProps>(
|
|
205
|
+
function PanelTitle({ overStyled = false, ...rest }, ref) {
|
|
206
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
207
|
+
return (
|
|
208
|
+
<MantineDrawer.Title
|
|
209
|
+
ref={ref}
|
|
210
|
+
{...(sanitizedProps as unknown as MantineDrawerTitleProps)}
|
|
211
|
+
/>
|
|
212
|
+
);
|
|
213
|
+
},
|
|
214
|
+
);
|
|
215
|
+
PanelTitle.displayName = "PanelTitle";
|
|
216
|
+
|
|
217
|
+
export type PanelCloseButtonProps =
|
|
218
|
+
RecursicaOverStyled<MantineDrawerCloseButtonProps>;
|
|
219
|
+
|
|
220
|
+
export const PanelCloseButton = forwardRef<
|
|
221
|
+
HTMLButtonElement,
|
|
222
|
+
PanelCloseButtonProps
|
|
223
|
+
>(function PanelCloseButton({ overStyled = false, ...rest }, ref) {
|
|
224
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
225
|
+
return (
|
|
226
|
+
<MantineDrawer.CloseButton
|
|
227
|
+
ref={ref}
|
|
228
|
+
{...(sanitizedProps as unknown as MantineDrawerCloseButtonProps)}
|
|
229
|
+
/>
|
|
230
|
+
);
|
|
231
|
+
});
|
|
232
|
+
PanelCloseButton.displayName = "PanelCloseButton";
|
|
233
|
+
|
|
234
|
+
export type PanelBodyProps = RecursicaOverStyled<MantineDrawerBodyProps>;
|
|
235
|
+
|
|
236
|
+
export const PanelBody = forwardRef<HTMLDivElement, PanelBodyProps>(
|
|
237
|
+
function PanelBody({ overStyled = false, ...rest }, ref) {
|
|
238
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
239
|
+
return (
|
|
240
|
+
<MantineDrawer.Body
|
|
241
|
+
ref={ref}
|
|
242
|
+
{...(sanitizedProps as unknown as MantineDrawerBodyProps)}
|
|
243
|
+
/>
|
|
244
|
+
);
|
|
245
|
+
},
|
|
246
|
+
);
|
|
247
|
+
PanelBody.displayName = "PanelBody";
|
|
248
|
+
|
|
131
249
|
// ============================================================
|
|
132
250
|
// DOT NOTATION EXPORT
|
|
133
251
|
// ============================================================
|
|
134
252
|
|
|
135
253
|
type PanelComponent = typeof PanelBase & {
|
|
136
|
-
Root: typeof
|
|
137
|
-
Overlay: typeof
|
|
138
|
-
Content: typeof
|
|
139
|
-
Header: typeof
|
|
140
|
-
Title: typeof
|
|
141
|
-
CloseButton: typeof
|
|
142
|
-
Body: typeof
|
|
254
|
+
Root: typeof PanelRoot;
|
|
255
|
+
Overlay: typeof PanelOverlay;
|
|
256
|
+
Content: typeof PanelContent;
|
|
257
|
+
Header: typeof PanelHeader;
|
|
258
|
+
Title: typeof PanelTitle;
|
|
259
|
+
CloseButton: typeof PanelCloseButton;
|
|
260
|
+
Body: typeof PanelBody;
|
|
143
261
|
Stack: typeof MantineDrawer.Stack;
|
|
144
262
|
Footer: typeof PanelFooter;
|
|
145
263
|
};
|
|
146
264
|
|
|
147
265
|
export const Panel = PanelBase as PanelComponent;
|
|
148
|
-
Panel.Root =
|
|
149
|
-
Panel.Overlay =
|
|
150
|
-
Panel.Content =
|
|
151
|
-
Panel.Header =
|
|
152
|
-
Panel.Title =
|
|
153
|
-
Panel.CloseButton =
|
|
154
|
-
Panel.Body =
|
|
266
|
+
Panel.Root = PanelRoot;
|
|
267
|
+
Panel.Overlay = PanelOverlay;
|
|
268
|
+
Panel.Content = PanelContent;
|
|
269
|
+
Panel.Header = PanelHeader;
|
|
270
|
+
Panel.Title = PanelTitle;
|
|
271
|
+
Panel.CloseButton = PanelCloseButton;
|
|
272
|
+
Panel.Body = PanelBody;
|
|
273
|
+
// Panel.Stack (DrawerStack) only accepts `children` — no styling props to
|
|
274
|
+
// strip, so re-exporting Mantine's implementation directly is not a gap.
|
|
155
275
|
Panel.Stack = MantineDrawer.Stack;
|
|
156
276
|
Panel.Footer = PanelFooter;
|
|
@@ -2,6 +2,7 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
Stepper as MantineStepper,
|
|
4
4
|
type StepperProps as MantineStepperProps,
|
|
5
|
+
type StepperStepProps as MantineStepperStepProps,
|
|
5
6
|
} from "@mantine/core";
|
|
6
7
|
import {
|
|
7
8
|
filterStylingProps,
|
|
@@ -56,12 +57,29 @@ const _Stepper = forwardRef<HTMLDivElement, StepperProps>(
|
|
|
56
57
|
},
|
|
57
58
|
);
|
|
58
59
|
|
|
60
|
+
export type StepperStepProps = RecursicaOverStyled<MantineStepperStepProps>;
|
|
61
|
+
|
|
62
|
+
const _StepperStep = forwardRef<HTMLButtonElement, StepperStepProps>(
|
|
63
|
+
function StepperStep({ overStyled = false, ...rest }, ref) {
|
|
64
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
65
|
+
return (
|
|
66
|
+
<MantineStepper.Step
|
|
67
|
+
ref={ref}
|
|
68
|
+
{...(sanitizedProps as unknown as MantineStepperStepProps)}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
_StepperStep.displayName = "Stepper.Step";
|
|
74
|
+
|
|
59
75
|
// We need to re-export the static components Step and Completed
|
|
60
76
|
export const Stepper: typeof _Stepper & {
|
|
61
|
-
Step: typeof
|
|
77
|
+
Step: typeof _StepperStep;
|
|
62
78
|
Completed: typeof MantineStepper.Completed;
|
|
63
79
|
} = Object.assign(_Stepper, {
|
|
64
|
-
Step:
|
|
80
|
+
Step: _StepperStep,
|
|
81
|
+
// Stepper.Completed only accepts `children` — no styling props to strip,
|
|
82
|
+
// so re-exporting Mantine's implementation directly is not a gap.
|
|
65
83
|
Completed: MantineStepper.Completed,
|
|
66
84
|
});
|
|
67
85
|
|