@recursica/mantine-adapter 0.9.4 → 1.0.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/README.md +275 -292
- package/dist/assets/src/components/Accordion/Accordion.css.ts.vanilla-BnZlbbJN.css +31 -0
- package/dist/index.d.ts +38 -8
- package/dist/mantine-adapter.cjs +94 -0
- package/dist/mantine-adapter.cjs.map +1 -0
- package/dist/mantine-adapter.css +0 -0
- package/dist/mantine-adapter.js +90 -0
- package/dist/mantine-adapter.js.map +1 -0
- package/package.json +80 -34
- package/dist/adapter/generateBorderRadiusType.d.ts +0 -3
- package/dist/adapter/generateBorderRadiusType.d.ts.map +0 -1
- package/dist/adapter/generateColorTypes.d.ts +0 -6
- package/dist/adapter/generateColorTypes.d.ts.map +0 -1
- package/dist/adapter/generateIcons.d.ts +0 -8
- package/dist/adapter/generateIcons.d.ts.map +0 -1
- package/dist/adapter/generateMantineTheme.d.ts +0 -19
- package/dist/adapter/generateMantineTheme.d.ts.map +0 -1
- package/dist/adapter/generatePrettierignore.d.ts +0 -3
- package/dist/adapter/generatePrettierignore.d.ts.map +0 -1
- package/dist/adapter/generateRecursicaObject.d.ts +0 -7
- package/dist/adapter/generateRecursicaObject.d.ts.map +0 -1
- package/dist/adapter/generateRecursicaThemes.d.ts +0 -12
- package/dist/adapter/generateRecursicaThemes.d.ts.map +0 -1
- package/dist/adapter/generateRecursicaTokens.d.ts +0 -3
- package/dist/adapter/generateRecursicaTokens.d.ts.map +0 -1
- package/dist/adapter/generateSpacersType.d.ts +0 -3
- package/dist/adapter/generateSpacersType.d.ts.map +0 -1
- package/dist/adapter/generateUiKit.d.ts +0 -8
- package/dist/adapter/generateUiKit.d.ts.map +0 -1
- package/dist/adapter/generateVanillaExtractThemes.d.ts +0 -12
- package/dist/adapter/generateVanillaExtractThemes.d.ts.map +0 -1
- package/dist/adapter/index.d.ts +0 -44
- package/dist/adapter/index.d.ts.map +0 -1
- package/dist/cli.d.ts +0 -6
- package/dist/cli.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -921
- package/dist/index.js.map +0 -1
- package/dist/main.cjs +0 -928
- package/dist/main.cjs.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -926
- package/dist/main.js.map +0 -1
- package/dist/shared/processTokens.d.ts +0 -22
- package/dist/shared/processTokens.d.ts.map +0 -1
- package/dist/types.d.ts +0 -62
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/fileCheck.d.ts +0 -8
- package/dist/utils/fileCheck.d.ts.map +0 -1
- package/dist/utils/loadConfig.d.ts +0 -24
- package/dist/utils/loadConfig.d.ts.map +0 -1
- package/dist/webworker.d.ts +0 -2
- package/dist/webworker.d.ts.map +0 -1
- package/dist/webworker.js +0 -791
package/README.md
CHANGED
|
@@ -1,376 +1,359 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @recursica/mantine-adapter
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
|
|
5
|
-
## What is Recursica Mantine Adapter
|
|
6
|
-
|
|
7
|
-
The Recursica Mantine Adapter processes design token JSON files and generates:
|
|
8
|
-
|
|
9
|
-
- **Mantine Theme**: Complete Mantine theme configuration with colors, typography, spacing, and more
|
|
10
|
-
- **Vanilla Extract Themes**: CSS-in-JS theme files with contract-based theme switching
|
|
11
|
-
- **TypeScript Types**: Type-safe interfaces for colors, spacers, border radius, and other tokens
|
|
12
|
-
- **React Components**: Ready-to-use Icon components with proper TypeScript definitions
|
|
13
|
-
- **UI Kit Objects**: Structured objects containing all design system primitives
|
|
3
|
+
A modern React component library built with TypeScript, Mantine, and Vanilla Extract CSS. This package provides reusable UI components with consistent design tokens and theming support.
|
|
14
4
|
|
|
15
5
|
## Installation
|
|
16
6
|
|
|
17
7
|
```bash
|
|
18
8
|
npm install @recursica/mantine-adapter
|
|
9
|
+
# or
|
|
10
|
+
yarn add @recursica/mantine-adapter
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @recursica/mantine-adapter
|
|
19
13
|
```
|
|
20
14
|
|
|
21
|
-
##
|
|
15
|
+
## Peer Dependencies
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Run the adapter directly without installation:
|
|
17
|
+
This library requires the following peer dependencies to be installed in your project:
|
|
26
18
|
|
|
27
19
|
```bash
|
|
28
|
-
|
|
20
|
+
npm install @mantine/core@>=8.0.0 @mantine/dates@>=8.0.0 @mantine/hooks@>=8.0.0 react@>=16.8.0 react-dom@>=16.8.0
|
|
29
21
|
```
|
|
30
22
|
|
|
31
|
-
|
|
23
|
+
**Important**: Make sure you have these exact versions or higher installed, as the components rely on Mantine 8+ features and React 16.8+ hooks.
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
### 1. Basic Setup
|
|
34
28
|
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
```tsx
|
|
30
|
+
import React from "react";
|
|
31
|
+
import { Button, ThemeProvider } from "@recursica/mantine-adapter";
|
|
32
|
+
import "@recursica/mantine-adapter/style.css";
|
|
33
|
+
|
|
34
|
+
function App() {
|
|
35
|
+
return (
|
|
36
|
+
<ThemeProvider>
|
|
37
|
+
<Button
|
|
38
|
+
label="Click Me"
|
|
39
|
+
variant="solid"
|
|
40
|
+
onClick={() => console.log("Clicked!")}
|
|
41
|
+
/>
|
|
42
|
+
</ThemeProvider>
|
|
43
|
+
);
|
|
40
44
|
}
|
|
41
45
|
```
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
### 2. Importing Components
|
|
44
48
|
|
|
45
|
-
```
|
|
46
|
-
|
|
49
|
+
```tsx
|
|
50
|
+
// Named imports (recommended)
|
|
51
|
+
import {
|
|
52
|
+
Button,
|
|
53
|
+
Textfield,
|
|
54
|
+
Flex,
|
|
55
|
+
Box,
|
|
56
|
+
Badge,
|
|
57
|
+
} from "@recursica/mantine-adapter";
|
|
58
|
+
|
|
59
|
+
// Import types for TypeScript
|
|
60
|
+
import type { ButtonProps, TextfieldProps } from "@recursica/mantine-adapter";
|
|
47
61
|
```
|
|
48
62
|
|
|
49
|
-
|
|
63
|
+
## Available Components
|
|
50
64
|
|
|
51
|
-
|
|
52
|
-
import { runMain } from "@recursica/mantine-adapter";
|
|
65
|
+
### Layout Components
|
|
53
66
|
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
- `Box` - Basic container component
|
|
68
|
+
- `Flex` - Flexbox container with common layouts
|
|
69
|
+
- `ThemeProvider` - Theme context provider
|
|
56
70
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Create a `recursica.json` file in your project root:
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"$schema": "node_modules/@recursica/schemas/RecursicaConfiguration.json",
|
|
64
|
-
"project": "YourProjectName",
|
|
65
|
-
"srcPath": "./src",
|
|
66
|
-
"bundledJson": "./design-tokens.json",
|
|
67
|
-
"iconsJson": "./icons.json",
|
|
68
|
-
"overrides": {
|
|
69
|
-
"mantineTheme": {
|
|
70
|
-
"1-scale": "rem",
|
|
71
|
-
"background": "white"
|
|
72
|
-
},
|
|
73
|
-
"fontWeight": [
|
|
74
|
-
{
|
|
75
|
-
"fontFamily": "Inter",
|
|
76
|
-
"value": 400,
|
|
77
|
-
"alias": "regular"
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
},
|
|
81
|
-
"iconsConfig": {
|
|
82
|
-
"include": {
|
|
83
|
-
"variants": ["Filled", "Outlined"]
|
|
84
|
-
},
|
|
85
|
-
"exclude": {
|
|
86
|
-
"names": ["deprecated_icon"]
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
```
|
|
71
|
+
### Form Components
|
|
91
72
|
|
|
92
|
-
|
|
73
|
+
- `Button` - Interactive button with multiple variants
|
|
74
|
+
- `Textfield` - Text input component
|
|
75
|
+
- `Checkbox` - Checkbox input
|
|
76
|
+
- `Dropdown` - Select dropdown with search
|
|
77
|
+
- `Chip` - Tag/chip component
|
|
78
|
+
- `Radio` - Radio button component
|
|
79
|
+
- `Datepicker` - Date selection component
|
|
93
80
|
|
|
94
|
-
|
|
95
|
-
- `srcPath`: Output directory for generated files (default: `./src`)
|
|
96
|
-
- `bundledJson`: Path to your design tokens JSON file
|
|
97
|
-
- `iconsJson`: Path to your icons JSON file (optional)
|
|
98
|
-
- `overrides`: Custom overrides for theme generation
|
|
99
|
-
- `iconsConfig`: Configuration for icon filtering and processing
|
|
81
|
+
### Navigation Components
|
|
100
82
|
|
|
101
|
-
|
|
83
|
+
- `Tabs` - Tab navigation
|
|
84
|
+
- `Anchor` - Link component
|
|
85
|
+
- `Breadcrumb` - Breadcrumb navigation
|
|
86
|
+
- `Pagination` - Page navigation
|
|
102
87
|
|
|
103
|
-
|
|
88
|
+
### Display Components
|
|
104
89
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
└── components/
|
|
118
|
-
└── Icons/
|
|
119
|
-
├── Icon.tsx # Main Icon component
|
|
120
|
-
├── icon_exports.ts # React icon components
|
|
121
|
-
├── icon_resource_map.ts # Icon name mappings
|
|
122
|
-
└── Svg/ # SVG icon files
|
|
123
|
-
├── icon1.svg
|
|
124
|
-
└── icon2.svg
|
|
125
|
-
```
|
|
90
|
+
- `Text` - Typography component
|
|
91
|
+
- `Typography` - Typography utilities
|
|
92
|
+
- `Badge` - Status indicator
|
|
93
|
+
- `Avatar` - User avatar
|
|
94
|
+
- `Logo` - Logo component
|
|
95
|
+
- `Icon` - Icon component with 240+ icons
|
|
96
|
+
|
|
97
|
+
### Feedback Components
|
|
98
|
+
|
|
99
|
+
- `Loader` - Loading indicator
|
|
100
|
+
- `Accordion` - Collapsible content
|
|
101
|
+
- `Tooltip` - Tooltip component
|
|
126
102
|
|
|
127
|
-
##
|
|
103
|
+
## Component Usage Examples
|
|
128
104
|
|
|
129
|
-
|
|
105
|
+
### Button Component
|
|
130
106
|
|
|
131
107
|
```tsx
|
|
132
|
-
import {
|
|
133
|
-
|
|
108
|
+
import { Button } from "@recursica/mantine-adapter";
|
|
109
|
+
|
|
110
|
+
// Basic button
|
|
111
|
+
<Button label="Click me" variant="solid" />
|
|
112
|
+
|
|
113
|
+
// Different variants
|
|
114
|
+
<Button label="Outline" variant="outline" />
|
|
115
|
+
<Button label="Text" variant="text" />
|
|
134
116
|
|
|
135
|
-
//
|
|
136
|
-
<
|
|
117
|
+
// Different sizes
|
|
118
|
+
<Button label="Small" size="small" />
|
|
119
|
+
<Button label="Default" size="default" />
|
|
137
120
|
|
|
138
|
-
// With
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
121
|
+
// With icons
|
|
122
|
+
<Button
|
|
123
|
+
label="Download"
|
|
124
|
+
leftIcon={<DownloadIcon />}
|
|
125
|
+
variant="solid"
|
|
143
126
|
/>
|
|
144
127
|
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
128
|
+
// Icon-only button
|
|
129
|
+
<Button
|
|
130
|
+
leftIcon={<SettingsIcon />}
|
|
131
|
+
style="icon"
|
|
132
|
+
variant="outline"
|
|
133
|
+
/>
|
|
152
134
|
```
|
|
153
135
|
|
|
154
|
-
|
|
136
|
+
### Form Components
|
|
155
137
|
|
|
156
|
-
|
|
138
|
+
```tsx
|
|
139
|
+
import { Textfield, Checkbox, Dropdown } from "@recursica/mantine-adapter";
|
|
140
|
+
|
|
141
|
+
// Text input
|
|
142
|
+
<Textfield
|
|
143
|
+
label="Email"
|
|
144
|
+
placeholder="Enter your email"
|
|
145
|
+
required
|
|
146
|
+
/>
|
|
157
147
|
|
|
158
|
-
|
|
148
|
+
// Checkbox
|
|
149
|
+
<Checkbox
|
|
150
|
+
label="I agree to terms"
|
|
151
|
+
description="Please read our terms and conditions"
|
|
152
|
+
/>
|
|
159
153
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
154
|
+
// Dropdown
|
|
155
|
+
<Dropdown
|
|
156
|
+
label="Select country"
|
|
157
|
+
placeholder="Choose a country"
|
|
158
|
+
data={[
|
|
159
|
+
{ value: "us", label: "United States" },
|
|
160
|
+
{ value: "uk", label: "United Kingdom" },
|
|
161
|
+
]}
|
|
162
|
+
/>
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
###
|
|
166
|
-
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
165
|
+
### Layout Components
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
import { Box, Flex } from "@recursica/mantine-adapter";
|
|
169
|
+
|
|
170
|
+
// Basic container
|
|
171
|
+
<Box padding="medium" backgroundColor="background">
|
|
172
|
+
<Text>Content here</Text>
|
|
173
|
+
</Box>
|
|
174
|
+
|
|
175
|
+
// Flexbox layouts
|
|
176
|
+
<Flex gap="medium" align="center" justify="space-between">
|
|
177
|
+
<Text>Left content</Text>
|
|
178
|
+
<Button label="Action" />
|
|
179
|
+
</Flex>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Styling with Vanilla Extract
|
|
183
|
+
|
|
184
|
+
This library uses **Vanilla Extract** for styling, which provides:
|
|
185
|
+
|
|
186
|
+
- **Type-safe CSS**: Compile-time CSS validation
|
|
187
|
+
- **Zero runtime**: No CSS-in-JS overhead
|
|
188
|
+
- **Design token integration**: Direct access to design system tokens
|
|
189
|
+
- **Scoped styles**: Automatic CSS class generation
|
|
190
|
+
|
|
191
|
+
### Why Vanilla Extract?
|
|
192
|
+
|
|
193
|
+
Vanilla Extract is chosen because it:
|
|
194
|
+
|
|
195
|
+
- Eliminates runtime CSS-in-JS overhead
|
|
196
|
+
- Provides compile-time type safety
|
|
197
|
+
- Integrates seamlessly with design tokens
|
|
198
|
+
- Generates optimized CSS bundles
|
|
199
|
+
- Supports CSS custom properties and themes
|
|
200
|
+
|
|
201
|
+
### Customizing Component Styles
|
|
202
|
+
|
|
203
|
+
You can customize component styles by extending the existing styles:
|
|
178
204
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
205
|
+
```tsx
|
|
206
|
+
import { style } from "@vanilla-extract/css";
|
|
207
|
+
import { recursica } from "@recursica/mantine-adapter";
|
|
208
|
+
|
|
209
|
+
// Custom button style
|
|
210
|
+
const customButton = style({
|
|
211
|
+
backgroundColor: recursica["color/primary"],
|
|
212
|
+
borderRadius: recursica["border-radius/medium"],
|
|
213
|
+
padding: recursica["spacing/medium"],
|
|
214
|
+
|
|
215
|
+
":hover": {
|
|
216
|
+
backgroundColor: recursica["color/primary-hover"],
|
|
217
|
+
},
|
|
190
218
|
});
|
|
191
219
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// Process generated files
|
|
195
|
-
console.log("Generated files:", files);
|
|
196
|
-
|
|
197
|
-
// Files structure matches the CLI output:
|
|
198
|
-
// - files.recursicaTokens
|
|
199
|
-
// - files.vanillaExtractThemes
|
|
200
|
-
// - files.mantineTheme
|
|
201
|
-
// - files.uiKitObject
|
|
202
|
-
// - files.recursicaObject
|
|
203
|
-
// - files.colorsType
|
|
204
|
-
// - files.iconsObject
|
|
205
|
-
// etc.
|
|
206
|
-
};
|
|
220
|
+
// Usage
|
|
221
|
+
<Button label="Custom Button" className={customButton} />;
|
|
207
222
|
```
|
|
208
223
|
|
|
209
|
-
###
|
|
210
|
-
|
|
211
|
-
```typescript
|
|
212
|
-
interface WorkerResponse {
|
|
213
|
-
recursicaTokens: ExportingResult;
|
|
214
|
-
vanillaExtractThemes: VanillaExtractThemesOutput;
|
|
215
|
-
mantineTheme: GenerateMantineThemeOutput;
|
|
216
|
-
uiKitObject: ExportingResult;
|
|
217
|
-
recursicaObject: ExportingResult;
|
|
218
|
-
colorsType: ExportingResult;
|
|
219
|
-
spacersType: ExportingResult;
|
|
220
|
-
borderRadiusType: ExportingResult;
|
|
221
|
-
iconsObject?: GenerateIconsOutput;
|
|
222
|
-
recursicaThemes: ExportingResult;
|
|
223
|
-
prettierignore: ExportingResult;
|
|
224
|
-
}
|
|
224
|
+
### Using Design Tokens
|
|
225
225
|
|
|
226
|
-
|
|
227
|
-
content: string; // File content
|
|
228
|
-
path: string; // Full file path
|
|
229
|
-
filename: string; // Filename only
|
|
230
|
-
}
|
|
231
|
-
```
|
|
226
|
+
Access design tokens directly from the Recursica system:
|
|
232
227
|
|
|
233
|
-
|
|
228
|
+
```tsx
|
|
229
|
+
import { recursica } from "@recursica/mantine-adapter";
|
|
234
230
|
|
|
235
|
-
|
|
231
|
+
const myStyle = style({
|
|
232
|
+
// Spacing
|
|
233
|
+
padding: recursica["spacing/medium"], // 16px
|
|
234
|
+
margin: recursica["spacing/large"], // 24px
|
|
236
235
|
|
|
237
|
-
|
|
236
|
+
// Colors
|
|
237
|
+
backgroundColor: recursica["color/background"],
|
|
238
|
+
color: recursica["color/text"],
|
|
238
239
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
RecursicaConfigOverrides,
|
|
243
|
-
RecursicaConfigIcons,
|
|
244
|
-
ExportingResult,
|
|
245
|
-
} from "@recursica/mantine-adapter";
|
|
240
|
+
// Typography
|
|
241
|
+
fontSize: recursica["typography/body/font-size"],
|
|
242
|
+
lineHeight: recursica["typography/body/line-height"],
|
|
246
243
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
project: string;
|
|
252
|
-
icons: Record<string, string>;
|
|
253
|
-
iconsConfig: RecursicaConfigIcons | undefined;
|
|
254
|
-
processTokens: ProcessTokens;
|
|
255
|
-
}
|
|
244
|
+
// Border radius
|
|
245
|
+
borderRadius: recursica["border-radius/medium"], // 8px
|
|
246
|
+
});
|
|
247
|
+
```
|
|
256
248
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
249
|
+
### Typography Utilities
|
|
250
|
+
|
|
251
|
+
Use predefined typography styles:
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
import { typographies } from "@recursica/mantine-adapter";
|
|
255
|
+
|
|
256
|
+
const headingStyle = style({
|
|
257
|
+
...typographies.heading,
|
|
258
|
+
color: recursica["color/heading"],
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const bodyStyle = style({
|
|
262
|
+
...typographies.body,
|
|
263
|
+
color: recursica["color/text"],
|
|
264
|
+
});
|
|
266
265
|
```
|
|
267
266
|
|
|
268
|
-
|
|
267
|
+
## Theming
|
|
269
268
|
|
|
270
|
-
|
|
269
|
+
### Using ThemeProvider
|
|
271
270
|
|
|
272
|
-
|
|
273
|
-
// generateCustomTheme.ts
|
|
274
|
-
import type {
|
|
275
|
-
ExportingResult,
|
|
276
|
-
ExportingProps,
|
|
277
|
-
} from "@recursica/mantine-adapter";
|
|
271
|
+
Wrap your app with the ThemeProvider to enable theming:
|
|
278
272
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
)
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
const filename = `${project}CustomTheme.ts`;
|
|
286
|
-
const path = `${outputPath}/${filename}`;
|
|
287
|
-
|
|
288
|
-
const content = `
|
|
289
|
-
// Auto-generated custom theme
|
|
290
|
-
export const customTheme = ${JSON.stringify(tokens, null, 2)};
|
|
291
|
-
`.trim();
|
|
292
|
-
|
|
293
|
-
return {
|
|
294
|
-
content,
|
|
295
|
-
path,
|
|
296
|
-
filename,
|
|
297
|
-
};
|
|
273
|
+
```tsx
|
|
274
|
+
import { ThemeProvider } from "@recursica/mantine-adapter";
|
|
275
|
+
|
|
276
|
+
function App() {
|
|
277
|
+
return <ThemeProvider>{/* Your app components */}</ThemeProvider>;
|
|
298
278
|
}
|
|
299
279
|
```
|
|
300
280
|
|
|
301
|
-
###
|
|
281
|
+
### Custom Themes
|
|
282
|
+
|
|
283
|
+
You can create custom themes by extending the base theme:
|
|
302
284
|
|
|
303
|
-
|
|
285
|
+
```tsx
|
|
286
|
+
import { createTheme } from "@mantine/core";
|
|
304
287
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
- `generateUiKit`: UI component object generation
|
|
288
|
+
const customTheme = createTheme({
|
|
289
|
+
primaryColor: "blue",
|
|
290
|
+
fontFamily: "Inter, sans-serif",
|
|
291
|
+
// ... other theme overrides
|
|
292
|
+
});
|
|
311
293
|
|
|
312
|
-
|
|
294
|
+
<ThemeProvider theme={customTheme}>{/* Your app */}</ThemeProvider>;
|
|
295
|
+
```
|
|
313
296
|
|
|
314
|
-
|
|
297
|
+
## TypeScript Support
|
|
315
298
|
|
|
316
|
-
|
|
317
|
-
import { ProcessTokens } from "@recursica/mantine-adapter";
|
|
299
|
+
All components include full TypeScript support with proper prop types:
|
|
318
300
|
|
|
319
|
-
|
|
320
|
-
|
|
301
|
+
```tsx
|
|
302
|
+
import type { ButtonProps, TextfieldProps } from "@recursica/mantine-adapter";
|
|
321
303
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
const
|
|
304
|
+
interface MyFormProps {
|
|
305
|
+
onSubmit: (data: FormData) => void;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const MyForm: React.FC<MyFormProps> = ({ onSubmit }) => {
|
|
309
|
+
return (
|
|
310
|
+
<form onSubmit={onSubmit}>
|
|
311
|
+
<Textfield
|
|
312
|
+
label="Name"
|
|
313
|
+
required
|
|
314
|
+
// TypeScript will provide autocomplete and type checking
|
|
315
|
+
/>
|
|
316
|
+
</form>
|
|
317
|
+
);
|
|
318
|
+
};
|
|
327
319
|
```
|
|
328
320
|
|
|
329
|
-
|
|
321
|
+
## Storybook Documentation
|
|
330
322
|
|
|
331
|
-
|
|
323
|
+
This library includes comprehensive Storybook documentation for all components. You can:
|
|
332
324
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
325
|
+
- **View live examples** of all components and their variants
|
|
326
|
+
- **Explore component props** and their effects
|
|
327
|
+
- **Test component interactions** and accessibility features
|
|
328
|
+
- **Copy code examples** directly from the documentation
|
|
337
329
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
project,
|
|
352
|
-
iconsConfig,
|
|
353
|
-
});
|
|
354
|
-
```
|
|
330
|
+
### Accessing Storybook
|
|
331
|
+
|
|
332
|
+
- **Online (Recommended)**: Visit the [Storybook documentation](https://borderux.github.io/recursica/) for live examples and documentation
|
|
333
|
+
- **For Contributors**: If you're contributing to the library, clone the repository and run `npm run storybook` in the `packages/mantine-adapter` directory
|
|
334
|
+
|
|
335
|
+
### Using Storybook for Development
|
|
336
|
+
|
|
337
|
+
Storybook is an excellent tool for:
|
|
338
|
+
|
|
339
|
+
- Understanding component capabilities and variants
|
|
340
|
+
- Testing component behavior before integration
|
|
341
|
+
- Exploring design system patterns
|
|
342
|
+
- Copying working code examples for your implementation
|
|
355
343
|
|
|
356
|
-
##
|
|
344
|
+
## Browser Support
|
|
357
345
|
|
|
358
|
-
|
|
346
|
+
This library supports all modern browsers:
|
|
359
347
|
|
|
360
|
-
-
|
|
361
|
-
-
|
|
362
|
-
-
|
|
363
|
-
-
|
|
364
|
-
- `runAdapter()`: Execute the Mantine adapter
|
|
348
|
+
- Chrome 90+
|
|
349
|
+
- Firefox 88+
|
|
350
|
+
- Safari 14+
|
|
351
|
+
- Edge 90+
|
|
365
352
|
|
|
366
|
-
|
|
353
|
+
## Contributing
|
|
367
354
|
|
|
368
|
-
|
|
369
|
-
- `RecursicaConfigOverrides`: Theme override configuration
|
|
370
|
-
- `RecursicaConfigIcons`: Icon processing configuration
|
|
371
|
-
- `ThemeTokens`: Theme token structure
|
|
372
|
-
- `Themes`: Multi-theme structure
|
|
355
|
+
For development and contribution guidelines, see the [CONTRIBUTING.md](./CONTRIBUTING.md) file.
|
|
373
356
|
|
|
374
357
|
## License
|
|
375
358
|
|
|
376
|
-
MIT
|
|
359
|
+
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
|