reactaform 1.4.4 → 1.8.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/components/LayoutComponents.d.ts +77 -0
- package/dist/components/PopupOptionMenu.d.ts +16 -0
- package/dist/components/ReactaForm.d.ts +4 -0
- package/dist/components/ReactaFormProvider.d.ts +3 -0
- package/dist/components/ReactaFormRenderer.d.ts +10 -0
- package/dist/components/Tooltip.d.ts +8 -0
- package/dist/components/fields/CheckboxInput.d.ts +5 -0
- package/dist/components/fields/ColorInput.d.ts +16 -0
- package/dist/components/fields/DateInput.d.ts +11 -0
- package/dist/components/fields/DropdownInput.d.ts +16 -0
- package/dist/components/fields/EmailInput.d.ts +6 -0
- package/dist/components/fields/FileInput.d.ts +5 -0
- package/dist/components/fields/FloatArrayInput.d.ts +8 -0
- package/dist/components/fields/FloatInput.d.ts +9 -0
- package/dist/components/fields/ImageDisplay.d.ts +18 -0
- package/dist/components/fields/IntegerArrayInput.d.ts +9 -0
- package/dist/components/fields/IntegerInput.d.ts +6 -0
- package/dist/components/fields/MultiSelection.d.ts +9 -0
- package/dist/components/fields/MultilineTextInput.d.ts +6 -0
- package/dist/components/fields/NumericStepperInput.d.ts +6 -0
- package/dist/components/fields/PasswordInput.d.ts +6 -0
- package/dist/components/fields/PhoneInput.d.ts +6 -0
- package/dist/components/fields/RadioInput.d.ts +8 -0
- package/dist/components/fields/RatingInput.d.ts +9 -0
- package/dist/components/fields/Separator.d.ts +21 -0
- package/dist/components/fields/SliderInput.d.ts +5 -0
- package/dist/components/fields/SpinInput.d.ts +5 -0
- package/dist/components/fields/SwitchInput.d.ts +13 -0
- package/dist/components/fields/TextInput.d.ts +6 -0
- package/dist/components/fields/TimeInput.d.ts +6 -0
- package/dist/components/fields/UnitValueInput.d.ts +8 -0
- package/dist/components/fields/UrlInput.d.ts +21 -0
- package/dist/components/renderFields.d.ts +3 -0
- package/dist/core/baseRegistry.d.ts +15 -0
- package/dist/core/componentRegistry.d.ts +8 -0
- package/dist/core/debounceConfig.d.ts +6 -0
- package/dist/core/debounceEnv.d.ts +1 -0
- package/dist/core/fieldVisibility.d.ts +25 -0
- package/dist/core/index.d.ts +23 -0
- package/dist/core/pluginRegistry.d.ts +44 -0
- package/dist/core/reactaFormModel.d.ts +31 -0
- package/dist/core/reactaFormTypes.d.ts +141 -0
- package/dist/core/submissionHandlerRegistry.d.ts +7 -0
- package/dist/core/submitForm.d.ts +9 -0
- package/dist/hooks/useDebouncedCallback.d.ts +27 -0
- package/dist/hooks/useDropdownPosition.d.ts +6 -0
- package/dist/hooks/useReactaFormContext.d.ts +4 -0
- package/dist/hooks/useUncontrolledValidatedInput.d.ts +18 -0
- package/dist/hooks/useUnitValueField.d.ts +13 -0
- package/dist/index.d.ts +9 -6
- package/dist/reactaform.cjs.js +18 -5
- package/dist/reactaform.css +1 -1
- package/dist/reactaform.es.js +2771 -2738
- 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/dist/utils/cssClasses.d.ts +14 -0
- package/dist/utils/definitionSerializers.d.ts +62 -0
- package/dist/utils/groupingHelpers.d.ts +24 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/themeUtils.d.ts +31 -0
- package/dist/utils/translationCache.d.ts +43 -0
- package/dist/utils/unitValueMapper.d.ts +14 -0
- package/dist/validation/index.d.ts +13 -0
- package/dist/validation/validateColorField.d.ts +2 -0
- package/dist/validation/validateDateField.d.ts +2 -0
- package/dist/validation/validateEmailField.d.ts +2 -0
- package/dist/validation/validateFieldPattern.d.ts +3 -0
- package/dist/validation/validateFloatField.d.ts +3 -0
- package/dist/validation/validateIntegerField.d.ts +3 -0
- package/dist/validation/validatePhoneField.d.ts +2 -0
- package/dist/validation/validateRatingField.d.ts +2 -0
- package/dist/validation/validateSelectionFields.d.ts +3 -0
- package/dist/validation/validateTextField.d.ts +2 -0
- package/dist/validation/validateTimeField.d.ts +2 -0
- package/dist/validation/validateUnitValueField.d.ts +2 -0
- package/dist/validation/validateUrlField.d.ts +2 -0
- package/dist/validation/validation.d.ts +12 -0
- package/dist/validation/validationHandlerRegistry.d.ts +19 -0
- package/package.json +15 -13
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ReactaDefinition, DefinitionPropertyField } from "../core/reactaFormTypes";
|
|
2
|
+
export declare function isDefinitionPropertyField(obj: unknown): obj is DefinitionPropertyField;
|
|
3
|
+
export declare function isReactaDefinition(obj: unknown): obj is ReactaDefinition;
|
|
4
|
+
/**
|
|
5
|
+
* Enhanced serialization options for better control over the process
|
|
6
|
+
*/
|
|
7
|
+
export interface SerializationOptions {
|
|
8
|
+
includeMetadata?: boolean;
|
|
9
|
+
dateFormat?: 'iso' | 'timestamp' | 'locale';
|
|
10
|
+
fileHandling?: 'metadata' | 'skip' | 'base64';
|
|
11
|
+
prettify?: boolean;
|
|
12
|
+
excludeFields?: string[];
|
|
13
|
+
includeOnlyFields?: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Enhanced deserialization options
|
|
17
|
+
*/
|
|
18
|
+
export interface DeserializationOptions {
|
|
19
|
+
strict?: boolean;
|
|
20
|
+
validateTypes?: boolean;
|
|
21
|
+
preserveUnknownFields?: boolean;
|
|
22
|
+
dateFormat?: 'auto' | 'iso' | 'timestamp';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Serialization result with metadata
|
|
26
|
+
*/
|
|
27
|
+
export interface SerializationResult {
|
|
28
|
+
success: boolean;
|
|
29
|
+
data?: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
metadata?: {
|
|
32
|
+
fieldCount: number;
|
|
33
|
+
excludedFields: string[];
|
|
34
|
+
warnings: string[];
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Deserialization result with validation info
|
|
39
|
+
*/
|
|
40
|
+
export interface DeserializationResult<T = unknown> {
|
|
41
|
+
success: boolean;
|
|
42
|
+
data?: T;
|
|
43
|
+
error?: string;
|
|
44
|
+
warnings?: string[];
|
|
45
|
+
validationErrors?: string[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Enhanced instance serialization with comprehensive options and error handling
|
|
49
|
+
*/
|
|
50
|
+
export declare function serializeInstance(instance: Record<string, unknown>, definition?: ReactaDefinition | Record<string, unknown>, options?: SerializationOptions): SerializationResult;
|
|
51
|
+
/**
|
|
52
|
+
* Enhanced instance deserialization with comprehensive validation and error handling
|
|
53
|
+
*/
|
|
54
|
+
export declare function deserializeInstance(serialized: string, definition?: ReactaDefinition | Record<string, unknown>, options?: DeserializationOptions): DeserializationResult<Record<string, unknown>>;
|
|
55
|
+
/**
|
|
56
|
+
* Enhanced definition serialization with validation and metadata
|
|
57
|
+
*/
|
|
58
|
+
export declare function serializeDefinition(definition: ReactaDefinition | Record<string, unknown>, options?: SerializationOptions): SerializationResult;
|
|
59
|
+
/**
|
|
60
|
+
* Enhanced definition deserialization with comprehensive validation
|
|
61
|
+
*/
|
|
62
|
+
export declare function deserializeDefinition(input: string | Record<string, unknown>, options?: DeserializationOptions): DeserializationResult<ReactaDefinition>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DefinitionPropertyField } from "../core/reactaFormTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Enhanced rename duplicated groups with better conflict resolution
|
|
4
|
+
* For example: g1, g1, g2, g1 becomes g1, g1, g2, g1(1)
|
|
5
|
+
* This mutates the provided nameToField map so downstream code sees the
|
|
6
|
+
* renamed group values.
|
|
7
|
+
*/
|
|
8
|
+
export declare const renameDuplicatedGroups: (properties: DefinitionPropertyField[], nameToField: Record<string, DefinitionPropertyField>) => number;
|
|
9
|
+
/**
|
|
10
|
+
* Enhanced consecutive field grouping with metadata
|
|
11
|
+
*/
|
|
12
|
+
export declare const groupConsecutiveFields: (items: DefinitionPropertyField[], options?: {
|
|
13
|
+
includeEmpty?: boolean;
|
|
14
|
+
}) => {
|
|
15
|
+
groups: Array<{
|
|
16
|
+
name: string | null;
|
|
17
|
+
fields: DefinitionPropertyField[];
|
|
18
|
+
}>;
|
|
19
|
+
metadata: {
|
|
20
|
+
totalGroups: number;
|
|
21
|
+
emptyGroups: number;
|
|
22
|
+
largestGroup: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReactaForm Utils - Comprehensive utility functions
|
|
3
|
+
*
|
|
4
|
+
* This module provides enhanced utility functions for form building,
|
|
5
|
+
* styling, serialization, translation, and component management.
|
|
6
|
+
*/
|
|
7
|
+
export { combineClasses, CSS_CLASSES, } from './cssClasses';
|
|
8
|
+
export { serializeInstance, deserializeInstance, serializeDefinition, deserializeDefinition, type SerializationOptions, type DeserializationOptions, type SerializationResult, type DeserializationResult } from './definitionSerializers';
|
|
9
|
+
export { renameDuplicatedGroups, groupConsecutiveFields } from './groupingHelpers';
|
|
10
|
+
export { loadCommonTranslation, loadUserTranslation, createTranslationFunction, } from './translationCache';
|
|
11
|
+
export * from './unitValueMapper';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for theme detection and management
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Determines if a theme is dark-themed based on naming convention.
|
|
6
|
+
*
|
|
7
|
+
* Convention: Theme names containing "dark" are considered dark themes.
|
|
8
|
+
*
|
|
9
|
+
* When creating custom themes:
|
|
10
|
+
* - Include "dark" in the theme name for dark themes (e.g., "my-theme-dark")
|
|
11
|
+
* - Or rely on CSS variables only and avoid theme-specific logic
|
|
12
|
+
*
|
|
13
|
+
* @param themeName - The theme name from the `theme` prop
|
|
14
|
+
* @returns true if the theme is dark-themed
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* isDarkTheme('material-dark') // true
|
|
18
|
+
* isDarkTheme('dark') // true
|
|
19
|
+
* isDarkTheme('midnight-dark') // true
|
|
20
|
+
* isDarkTheme('my-custom-dark') // true
|
|
21
|
+
* isDarkTheme('material') // false
|
|
22
|
+
*/
|
|
23
|
+
export declare function isDarkTheme(themeName: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Determines if a color string represents a dark color.
|
|
26
|
+
* Supports hex (3, 4, 6, 8 digits) and rgb/rgba formats.
|
|
27
|
+
*
|
|
28
|
+
* @param color - The color string to check
|
|
29
|
+
* @returns true if the color is considered dark (luminance < 128)
|
|
30
|
+
*/
|
|
31
|
+
export declare function isDarkColor(color: string): boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { TranslationMap, TranslationCache } from "../core/reactaFormTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Translation loading result
|
|
4
|
+
*/
|
|
5
|
+
export interface TranslationLoadResult {
|
|
6
|
+
success: boolean;
|
|
7
|
+
translations: TranslationMap;
|
|
8
|
+
error?: string;
|
|
9
|
+
fromCache?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const userTranslationCache: TranslationCache;
|
|
12
|
+
export declare const userFailedSet: Set<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Enhanced common translation loader with better error handling
|
|
15
|
+
*/
|
|
16
|
+
export declare const loadCommon: (language: string) => Promise<TranslationLoadResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Enhanced common translation loading with caching and metadata
|
|
19
|
+
*/
|
|
20
|
+
export declare const loadCommonTranslation: (language: string) => Promise<TranslationLoadResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Enhanced user translation loading with better error handling and caching
|
|
23
|
+
*/
|
|
24
|
+
export declare const loadUserTranslation: (language: string, localizeName: string) => Promise<TranslationLoadResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Return whether translation subsystem should run in debug mode.
|
|
27
|
+
* Checks multiple env sources (Vite, webpack, Next.js, etc.) for dev/debug mode.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isDebugMode(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Create a translation function using provided maps
|
|
32
|
+
* @returns A translation function
|
|
33
|
+
* This function processes text using only dictionary lookups and basic string interpolation.
|
|
34
|
+
* Note: handling pluralization is not supported now
|
|
35
|
+
* @example
|
|
36
|
+
* const t = createTranslationFunction('fr', commonMap, userMap);
|
|
37
|
+
* const translated = t("Hello, {{1}}!", "world");
|
|
38
|
+
*/
|
|
39
|
+
export declare const createTranslationFunction: (language: string, commonMap: TranslationMap, userMap: TranslationMap) => (defaultText: string, ...args: unknown[]) => string;
|
|
40
|
+
/**
|
|
41
|
+
* Clear all caches
|
|
42
|
+
*/
|
|
43
|
+
export declare function clearTranslationCaches(): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const dimensionUnitsMap: Record<string, string[]>;
|
|
2
|
+
export declare const dimensionUnitDisplayMap: Record<string, Record<string, string>>;
|
|
3
|
+
export declare const dimensonUnitFactorsMap: Record<string, Record<string, number>>;
|
|
4
|
+
export declare const unitsByDimension: Record<string, Record<string, {
|
|
5
|
+
name: string;
|
|
6
|
+
shortName: string;
|
|
7
|
+
factor?: number;
|
|
8
|
+
}>>;
|
|
9
|
+
export declare function convertTemperature(fromUnit: string, toUnit: string, value: number): number;
|
|
10
|
+
export declare function getUnitFactors(dimension: string): {
|
|
11
|
+
default: string;
|
|
12
|
+
units: string[];
|
|
13
|
+
factors: Record<string, number>;
|
|
14
|
+
} | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './validateIntegerField';
|
|
2
|
+
import './validateFloatField';
|
|
3
|
+
import './validateTextField';
|
|
4
|
+
import './validateEmailField';
|
|
5
|
+
import './validateDateField';
|
|
6
|
+
import './validateTimeField';
|
|
7
|
+
import './validateUnitValueField';
|
|
8
|
+
import './validateRatingField';
|
|
9
|
+
import './validateUrlField';
|
|
10
|
+
import './validatePhoneField';
|
|
11
|
+
import './validateSelectionFields';
|
|
12
|
+
import './validateColorField';
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefinitionPropertyField, FieldValueType, TranslationFunction } from "../core/reactaFormTypes";
|
|
2
|
+
export declare function validateFieldPattern(field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction, fallbackMessage?: string, ...args: unknown[]): string | null;
|
|
3
|
+
export default validateFieldPattern;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefinitionPropertyField, FieldValueType, TranslationFunction } from "../core/reactaFormTypes";
|
|
2
|
+
export declare function validateFloatField(field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction): string | null;
|
|
3
|
+
export declare function validateFloatArrayField(field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction): string | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefinitionPropertyField, FieldValueType, TranslationFunction } from "../core/reactaFormTypes";
|
|
2
|
+
export declare const validateIntegerField: (field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction) => string | null;
|
|
3
|
+
export declare function validateIntegerArrayField(field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction): string | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefinitionPropertyField, FieldValueType, TranslationFunction } from "../core/reactaFormTypes";
|
|
2
|
+
export declare function validateDropdownField(field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction): string | null;
|
|
3
|
+
export declare function validateMultiSelectionField(field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction): string | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactaDefinition, FieldValueType, DefinitionPropertyField, TranslationFunction } from "../core/reactaFormTypes";
|
|
2
|
+
export declare function validateFieldWithHandler(definitionName: string, field: DefinitionPropertyField, value: FieldValueType, t: TranslationFunction): string | null;
|
|
3
|
+
export declare function validateFieldValue(definitionName: string, field: DefinitionPropertyField, value: FieldValueType | unknown, t: TranslationFunction): string | null;
|
|
4
|
+
export declare function validateField(definitionName: string, field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction): string | null;
|
|
5
|
+
export declare function validateFormValues(definition: ReactaDefinition | null, valuesMap: Record<string, FieldValueType | unknown>, t: (key: string) => string): Promise<string[] | null>;
|
|
6
|
+
export declare function clearValidationCache(): void;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
validateFieldValue: typeof validateFieldValue;
|
|
9
|
+
validateFormValues: typeof validateFormValues;
|
|
10
|
+
clearValidationCache: typeof clearValidationCache;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DefinitionPropertyField, FieldValidationHandler, FieldValueType, FormValidationHandler, TranslationFunction } from "../core/reactaFormTypes";
|
|
2
|
+
export type BuiltinFieldValidationHandler = (field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction) => string | null;
|
|
3
|
+
export declare function registerFormValidationHandler(name: string, fn: FormValidationHandler): void;
|
|
4
|
+
export declare function registerFieldValidationHandler(category: string, name: string, fn: FieldValidationHandler): void;
|
|
5
|
+
export declare function registerBuiltinFieldValidationHandler(name: string, fn: BuiltinFieldValidationHandler): void;
|
|
6
|
+
export declare function getFieldValidationHandler(category: string, name: string): FieldValidationHandler | null;
|
|
7
|
+
export declare function getFormValidationHandler(name: string): FormValidationHandler | null;
|
|
8
|
+
export declare function getBuiltinFieldValidationHandler(name: string): BuiltinFieldValidationHandler | null;
|
|
9
|
+
export declare function listFieldValidationHandlers(category?: string): string[];
|
|
10
|
+
export declare function listFormValidationHandlers(): string[];
|
|
11
|
+
declare const _default: {
|
|
12
|
+
registerFormValidationHandler: typeof registerFormValidationHandler;
|
|
13
|
+
registerFieldValidationHandler: typeof registerFieldValidationHandler;
|
|
14
|
+
getFieldValidationHandler: typeof getFieldValidationHandler;
|
|
15
|
+
getFormValidationHandler: typeof getFormValidationHandler;
|
|
16
|
+
listFieldValidationHandlers: typeof listFieldValidationHandlers;
|
|
17
|
+
listFormValidationHandlers: typeof listFormValidationHandlers;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactaform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "A powerful, type-safe React form builder library with dynamic field rendering, conditional visibility, multi-language support, and extensible validation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -34,27 +34,29 @@
|
|
|
34
34
|
"import": "./dist/reactaform.es.js",
|
|
35
35
|
"require": "./dist/reactaform.cjs.js"
|
|
36
36
|
},
|
|
37
|
-
"./style.css": "./dist/reactaform.css"
|
|
37
|
+
"./style.css": "./dist/reactaform.css",
|
|
38
|
+
"./themes/*.css": "./dist/themes/*.css"
|
|
38
39
|
},
|
|
39
40
|
"files": [
|
|
40
|
-
"dist
|
|
41
|
-
"dist/*.mjs",
|
|
42
|
-
"dist/*.cjs.js",
|
|
43
|
-
"dist/*.es.js",
|
|
44
|
-
"dist/*.css",
|
|
45
|
-
"dist/*.map",
|
|
46
|
-
"dist/*.d.ts",
|
|
41
|
+
"dist",
|
|
47
42
|
"README.md",
|
|
48
43
|
"LICENSE"
|
|
49
44
|
],
|
|
45
|
+
"sideEffects": [
|
|
46
|
+
"*.css",
|
|
47
|
+
"dist/**/*.css"
|
|
48
|
+
],
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"react": ">=18.0.0 <20",
|
|
52
51
|
"react-dom": ">=18.0.0 <20"
|
|
53
52
|
},
|
|
54
53
|
"scripts": {
|
|
54
|
+
"clean": "node -e \"require('fs').rmSync('dist', {recursive: true, force: true})\"",
|
|
55
55
|
"build:types": "tsc -p tsconfig.build.json --noEmit false",
|
|
56
|
-
"build:lib": "vite build --config vite.lib.config.ts && npm run build:types",
|
|
57
|
-
"build:
|
|
56
|
+
"build:lib": "cross-env NODE_ENV=development vite build --mode development --config vite.lib.config.ts && npm run build:types && node scripts/copy-themes.js",
|
|
57
|
+
"build:prod": "cross-env NODE_ENV=production vite build --config vite.lib.config.ts && npm run build:types && node scripts/copy-themes.js",
|
|
58
|
+
"build:pack": "npm run build:prod && npm pack",
|
|
59
|
+
"prepublishOnly": "npm run build:prod",
|
|
58
60
|
"test": "vitest run --config ./vitest.config.ts",
|
|
59
61
|
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|
|
60
62
|
"lint": "eslint -c eslint.config.mjs \"src/**/*.{ts,tsx}\" \"tests/**/*.{ts,tsx}\" --max-warnings=0"
|
|
@@ -71,6 +73,7 @@
|
|
|
71
73
|
"@typescript-eslint/parser": "^8.49.0",
|
|
72
74
|
"@vitejs/plugin-react": "^5.1.2",
|
|
73
75
|
"c8": "^10.1.3",
|
|
76
|
+
"cross-env": "^7.0.3",
|
|
74
77
|
"eslint": "^9.39.1",
|
|
75
78
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
76
79
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
@@ -79,8 +82,7 @@
|
|
|
79
82
|
"typescript": "^5.9.3",
|
|
80
83
|
"vite": "^7.2.7",
|
|
81
84
|
"vitest": "^4.0.15"
|
|
82
|
-
}
|
|
83
|
-
,
|
|
85
|
+
},
|
|
84
86
|
"optionalDependencies": {},
|
|
85
87
|
"engines": {
|
|
86
88
|
"node": ">=18"
|