reactaform 1.4.4 → 1.5.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 +72 -12
- package/dist/index.d.ts +1 -0
- package/dist/reactaform.cjs.js +5 -5
- package/dist/reactaform.es.js +1441 -1426
- package/dist/themes/ant-design-dark.css +31 -0
- package/dist/themes/ant-design.css +42 -0
- package/dist/themes/blueprint-dark.css +31 -0
- package/dist/themes/blueprint.css +43 -0
- package/dist/themes/compact-variant.css +8 -0
- package/dist/themes/fluent.css +40 -0
- package/dist/themes/glass-morphism.css +25 -0
- package/dist/themes/high-contrast-accessible.css +22 -0
- package/dist/themes/ios-mobile.css +32 -0
- package/dist/themes/macos-native.css +32 -0
- package/dist/themes/material-dark.css +27 -0
- package/dist/themes/material.css +46 -0
- package/dist/themes/midnight-dark.css +24 -0
- package/dist/themes/modern-light.css +23 -0
- package/dist/themes/neon-cyber-dark.css +24 -0
- package/dist/themes/shadcn.css +40 -0
- package/dist/themes/soft-pastel.css +24 -0
- package/dist/themes/spacious-variant.css +9 -0
- package/dist/themes/tailwind-dark.css +30 -0
- package/dist/themes/tailwind.css +50 -0
- package/package.json +25 -3
package/README.md
CHANGED
|
@@ -193,29 +193,89 @@ interface ReactaDefinition {
|
|
|
193
193
|
|
|
194
194
|
## 🎨 Theming
|
|
195
195
|
|
|
196
|
+
ReactaForm includes **20 pre-built themes** that you can import individually for optimal bundle size.
|
|
197
|
+
|
|
198
|
+
### Quick Start
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
// Import a theme
|
|
202
|
+
import 'reactaform/themes/material.css';
|
|
203
|
+
import { ReactaForm } from 'reactaform';
|
|
204
|
+
|
|
205
|
+
function App() {
|
|
206
|
+
return <ReactaForm theme="material" definitionData={...} />;
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Available Themes
|
|
211
|
+
|
|
212
|
+
**Light Themes:**
|
|
213
|
+
- `material`, `ant-design`, `blueprint`, `fluent`, `shadcn`, `tailwind`
|
|
214
|
+
- `modern-light`, `macos-native`, `ios-mobile`, `soft-pastel`
|
|
215
|
+
- `glass-morphism`, `high-contrast-accessible`
|
|
216
|
+
|
|
217
|
+
**Dark Themes:**
|
|
218
|
+
- `material-dark`, `ant-design-dark`, `blueprint-dark`, `tailwind-dark`
|
|
219
|
+
- `midnight-dark`, `neon-cyber-dark`
|
|
220
|
+
|
|
221
|
+
**Variants:**
|
|
222
|
+
- `compact-variant`, `spacious-variant` (size adjustments)
|
|
223
|
+
|
|
224
|
+
### Theme Switching
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
import 'reactaform/themes/material.css';
|
|
228
|
+
import 'reactaform/themes/material-dark.css';
|
|
229
|
+
import { ReactaForm } from 'reactaform';
|
|
230
|
+
import { useState } from 'react';
|
|
231
|
+
|
|
232
|
+
function App() {
|
|
233
|
+
const [isDark, setIsDark] = useState(false);
|
|
234
|
+
|
|
235
|
+
return (
|
|
236
|
+
<>
|
|
237
|
+
<button onClick={() => setIsDark(!isDark)}>Toggle Theme</button>
|
|
238
|
+
<ReactaForm
|
|
239
|
+
theme={isDark ? 'material-dark' : 'material'}
|
|
240
|
+
definitionData={...}
|
|
241
|
+
/>
|
|
242
|
+
</>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Custom Theme
|
|
248
|
+
|
|
196
249
|
Customize with CSS variables:
|
|
197
250
|
|
|
198
251
|
```css
|
|
199
|
-
|
|
200
|
-
--reactaform-
|
|
201
|
-
--reactaform-
|
|
202
|
-
--reactaform-
|
|
203
|
-
--reactaform-
|
|
252
|
+
[data-reactaform-theme="my-custom"] {
|
|
253
|
+
--reactaform-primary-bg: #ffffff;
|
|
254
|
+
--reactaform-secondary-bg: #f9f9f9;
|
|
255
|
+
--reactaform-text-color: #000000;
|
|
256
|
+
--reactaform-border-color: #cccccc;
|
|
257
|
+
--reactaform-border-radius: 8px;
|
|
258
|
+
/* ... see theme files for all variables */
|
|
204
259
|
}
|
|
260
|
+
```
|
|
205
261
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
--reactaform-bg-primary: #1a1a1a;
|
|
209
|
-
--reactaform-text-color: #ededed;
|
|
210
|
-
}
|
|
262
|
+
```tsx
|
|
263
|
+
<ReactaForm theme="my-custom" definitionData={...} />
|
|
211
264
|
```
|
|
212
265
|
|
|
213
|
-
**
|
|
266
|
+
**Dark Theme Convention:** Include "dark" in your theme name (e.g., `my-custom-dark`) for automatic dark mode detection.
|
|
267
|
+
|
|
268
|
+
### Detect Dark Themes
|
|
214
269
|
|
|
215
270
|
```tsx
|
|
216
|
-
|
|
271
|
+
import { isDarkTheme } from 'reactaform';
|
|
272
|
+
|
|
273
|
+
isDarkTheme('material-dark'); // true
|
|
274
|
+
isDarkTheme('material'); // false
|
|
217
275
|
```
|
|
218
276
|
|
|
277
|
+
📖 **Full theme documentation:** [docs/theme-integration.md](docs/theme-integration.md)
|
|
278
|
+
|
|
219
279
|
## 🌍 Internationalization (i18n)
|
|
220
280
|
|
|
221
281
|
```tsx
|
package/dist/index.d.ts
CHANGED
|
@@ -20,4 +20,5 @@ export { registerFieldValidationHandler, registerFormValidationHandler, } from '
|
|
|
20
20
|
export type { DebouncedCallback } from './hooks/useDebouncedCallback';
|
|
21
21
|
export { useDebouncedCallback } from './hooks/useDebouncedCallback';
|
|
22
22
|
export * as Units from './utils/unitValueMapper';
|
|
23
|
+
export { isDarkTheme } from './utils/themeUtils';
|
|
23
24
|
export { serializeInstance, deserializeInstance, serializeDefinition, deserializeDefinition } from './utils/definitionSerializers';
|