@importcsv/react 0.2.11 → 0.2.14

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.
Files changed (107) hide show
  1. package/build/react/index.d.ts +151 -3
  2. package/package.json +4 -4
  3. package/build/react/bundled-styles.d.ts +0 -1
  4. package/build/react/components/CSVImporter/index.d.ts +0 -5
  5. package/build/react/components/Modal/index.d.ts +0 -12
  6. package/build/react/i18n/de.d.ts +0 -32
  7. package/build/react/i18n/es.d.ts +0 -32
  8. package/build/react/i18n/fr.d.ts +0 -32
  9. package/build/react/i18n/i18n.d.ts +0 -6
  10. package/build/react/i18n/it.d.ts +0 -32
  11. package/build/react/i18n/useTranslation.d.ts +0 -9
  12. package/build/react/importer/components/Box/index.d.ts +0 -2
  13. package/build/react/importer/components/Box/types/index.d.ts +0 -5
  14. package/build/react/importer/components/Checkbox/index.d.ts +0 -2
  15. package/build/react/importer/components/Checkbox/types/index.d.ts +0 -4
  16. package/build/react/importer/components/Errors/index.d.ts +0 -4
  17. package/build/react/importer/components/Input/index.d.ts +0 -2
  18. package/build/react/importer/components/Input/types/index.d.ts +0 -18
  19. package/build/react/importer/components/Root/index.d.ts +0 -10
  20. package/build/react/importer/components/StepLayout/index.d.ts +0 -18
  21. package/build/react/importer/components/Stepper/hooks/useStepper.d.ts +0 -2
  22. package/build/react/importer/components/Stepper/index.d.ts +0 -2
  23. package/build/react/importer/components/Stepper/types/index.d.ts +0 -14
  24. package/build/react/importer/components/Table/index.d.ts +0 -9
  25. package/build/react/importer/components/Table/types/index.d.ts +0 -42
  26. package/build/react/importer/components/ToggleFilter/index.d.ts +0 -3
  27. package/build/react/importer/components/ToggleFilter/types/index.d.ts +0 -11
  28. package/build/react/importer/components/Tooltip/index.d.ts +0 -2
  29. package/build/react/importer/components/Tooltip/types/index.d.ts +0 -11
  30. package/build/react/importer/components/UploaderWrapper/NativeDropzone.d.ts +0 -11
  31. package/build/react/importer/components/UploaderWrapper/UploaderWrapper.d.ts +0 -2
  32. package/build/react/importer/components/UploaderWrapper/types/index.d.ts +0 -2
  33. package/build/react/importer/components/VirtualTable/index.d.ts +0 -17
  34. package/build/react/importer/components/ui/alert.d.ts +0 -13
  35. package/build/react/importer/components/ui/button.d.ts +0 -12
  36. package/build/react/importer/components/ui/card.d.ts +0 -19
  37. package/build/react/importer/components/ui/checkbox.d.ts +0 -7
  38. package/build/react/importer/components/ui/dialog.d.ts +0 -38
  39. package/build/react/importer/components/ui/flex.d.ts +0 -23
  40. package/build/react/importer/components/ui/input.d.ts +0 -6
  41. package/build/react/importer/components/ui/select.d.ts +0 -13
  42. package/build/react/importer/components/ui/switch.d.ts +0 -7
  43. package/build/react/importer/components/ui/toast.d.ts +0 -22
  44. package/build/react/importer/components/ui/toaster.d.ts +0 -1
  45. package/build/react/importer/components/ui/tooltip.d.ts +0 -24
  46. package/build/react/importer/components/ui/use-toast.d.ts +0 -46
  47. package/build/react/importer/features/complete/index.d.ts +0 -2
  48. package/build/react/importer/features/complete/types/index.d.ts +0 -5
  49. package/build/react/importer/features/configure-import/index.d.ts +0 -13
  50. package/build/react/importer/features/configure-import/types/index.d.ts +0 -13
  51. package/build/react/importer/features/main/hooks/useMutableLocalStorage.d.ts +0 -1
  52. package/build/react/importer/features/main/hooks/useStepNavigation.d.ts +0 -17
  53. package/build/react/importer/features/main/index.d.ts +0 -2
  54. package/build/react/importer/features/main/types/index.d.ts +0 -16
  55. package/build/react/importer/features/map-columns/components/DropDownFields.d.ts +0 -21
  56. package/build/react/importer/features/map-columns/hooks/useMapColumnsTable.d.ts +0 -16
  57. package/build/react/importer/features/map-columns/index.d.ts +0 -2
  58. package/build/react/importer/features/map-columns/types/index.d.ts +0 -16
  59. package/build/react/importer/features/row-selection/index.d.ts +0 -2
  60. package/build/react/importer/features/row-selection/types/index.d.ts +0 -8
  61. package/build/react/importer/features/uploader/hooks/useTemplateTable.d.ts +0 -10
  62. package/build/react/importer/features/uploader/index.d.ts +0 -2
  63. package/build/react/importer/features/uploader/types/index.d.ts +0 -9
  64. package/build/react/importer/features/validation/Validation.d.ts +0 -2
  65. package/build/react/importer/features/validation/components/TransformModal.d.ts +0 -18
  66. package/build/react/importer/features/validation/components/TransformPanel.d.ts +0 -18
  67. package/build/react/importer/features/validation/index.d.ts +0 -1
  68. package/build/react/importer/features/validation/types.d.ts +0 -32
  69. package/build/react/importer/hooks/useClickOutside.d.ts +0 -1
  70. package/build/react/importer/hooks/useCustomStyles.d.ts +0 -1
  71. package/build/react/importer/hooks/useEventListener.d.ts +0 -4
  72. package/build/react/importer/hooks/useIsomorphicLayoutEffect.d.ts +0 -3
  73. package/build/react/importer/hooks/useRect.d.ts +0 -12
  74. package/build/react/importer/hooks/useWindowSize.d.ts +0 -1
  75. package/build/react/importer/providers/Theme.d.ts +0 -10
  76. package/build/react/importer/providers/index.d.ts +0 -5
  77. package/build/react/importer/providers/types/index.d.ts +0 -10
  78. package/build/react/importer/services/api.d.ts +0 -1
  79. package/build/react/importer/services/mapping.d.ts +0 -31
  80. package/build/react/importer/services/transformation.d.ts +0 -70
  81. package/build/react/importer/settings/theme/colors.d.ts +0 -4
  82. package/build/react/importer/settings/theme/index.d.ts +0 -2
  83. package/build/react/importer/settings/theme/sizes.d.ts +0 -7
  84. package/build/react/importer/stores/theme.d.ts +0 -17
  85. package/build/react/importer/theme/index.d.ts +0 -8
  86. package/build/react/importer/theme/presets.d.ts +0 -314
  87. package/build/react/importer/theme/runtime.d.ts +0 -62
  88. package/build/react/importer/theme/styles.d.ts +0 -120
  89. package/build/react/importer/types/index.d.ts +0 -9
  90. package/build/react/importer/utils/colorUtils.d.ts +0 -48
  91. package/build/react/importer/utils/errorAnalysis.d.ts +0 -25
  92. package/build/react/importer/utils/getStringLengthOfChildren.d.ts +0 -2
  93. package/build/react/importer/utils/stringSimilarity.d.ts +0 -1
  94. package/build/react/importer/utils/template.d.ts +0 -2
  95. package/build/react/importer/utils/themeUtils.d.ts +0 -21
  96. package/build/react/importer/utils/utils.d.ts +0 -19
  97. package/build/react/js.d.ts +0 -12
  98. package/build/react/settings/defaults.d.ts +0 -3
  99. package/build/react/shims/react-compat-types-shim.d.ts +0 -67
  100. package/build/react/styles.d.ts +0 -1
  101. package/build/react/types/index.d.ts +0 -132
  102. package/build/react/types/style.d.ts +0 -13
  103. package/build/react/types/theme.d.ts +0 -153
  104. package/build/react/utils/cn.d.ts +0 -6
  105. package/build/react/validation/transformationStages.d.ts +0 -26
  106. package/build/react/validation/transformer.d.ts +0 -17
  107. package/build/react/validation/validator.d.ts +0 -23
@@ -1,5 +1,153 @@
1
- import { default as CSVImporter } from './components/CSVImporter';
1
+ import * as React from 'react';
2
+
3
+ export interface Column {
4
+ id: string;
5
+ label: string;
6
+ type?: 'string' | 'number' | 'email' | 'date' | 'phone' | 'select';
7
+ validators?: Validator[];
8
+ transformations?: Transformer[];
9
+ options?: string[];
10
+ description?: string;
11
+ placeholder?: string;
12
+ }
13
+
14
+ export type Validator = {
15
+ type: 'required';
16
+ message?: string;
17
+ } | {
18
+ type: 'unique';
19
+ message?: string;
20
+ } | {
21
+ type: 'regex';
22
+ pattern: string;
23
+ message?: string;
24
+ } | {
25
+ type: 'min';
26
+ value: number;
27
+ message?: string;
28
+ } | {
29
+ type: 'max';
30
+ value: number;
31
+ message?: string;
32
+ } | {
33
+ type: 'min_length';
34
+ value: number;
35
+ message?: string;
36
+ } | {
37
+ type: 'max_length';
38
+ value: number;
39
+ message?: string;
40
+ };
41
+
42
+ export type TransformationStage = 'pre' | 'post';
43
+
44
+ export type Transformer = {
45
+ type: 'trim';
46
+ stage?: TransformationStage;
47
+ } | {
48
+ type: 'uppercase';
49
+ stage?: TransformationStage;
50
+ } | {
51
+ type: 'lowercase';
52
+ stage?: TransformationStage;
53
+ } | {
54
+ type: 'capitalize';
55
+ stage?: TransformationStage;
56
+ } | {
57
+ type: 'remove_special_chars';
58
+ stage?: TransformationStage;
59
+ } | {
60
+ type: 'normalize_phone';
61
+ stage?: TransformationStage;
62
+ } | {
63
+ type: 'normalize_date';
64
+ format?: string;
65
+ stage?: TransformationStage;
66
+ } | {
67
+ type: 'default';
68
+ value: string;
69
+ stage?: TransformationStage;
70
+ } | {
71
+ type: 'replace';
72
+ find: string;
73
+ replace: string;
74
+ stage?: TransformationStage;
75
+ } | {
76
+ type: 'custom';
77
+ fn: (value: any) => any;
78
+ stage?: TransformationStage;
79
+ };
80
+
81
+ export interface ThemeConfig {
82
+ font?: {
83
+ family?: string;
84
+ size?: string;
85
+ };
86
+ colors?: {
87
+ primary?: string;
88
+ secondary?: string;
89
+ background?: string;
90
+ text?: string;
91
+ border?: string;
92
+ hover?: string;
93
+ disabled?: string;
94
+ };
95
+ borderRadius?: string;
96
+ spacing?: {
97
+ small?: string;
98
+ medium?: string;
99
+ large?: string;
100
+ };
101
+ }
102
+
103
+ export interface CSVImporterProps {
104
+ columns?: Column[];
105
+ importerKey?: string;
106
+ onComplete?: (data: any) => void;
107
+ backendUrl?: string;
108
+ user?: Record<string, any>;
109
+ metadata?: Record<string, any>;
110
+ theme?: ThemeConfig | 'default' | 'minimal' | 'modern' | 'compact' | 'dark';
111
+ darkMode?: boolean;
112
+ primaryColor?: string;
113
+ className?: string;
114
+ customStyles?: Record<string, string> | string;
115
+ classNames?: {
116
+ root?: string;
117
+ modal?: string;
118
+ header?: string;
119
+ stepper?: string;
120
+ content?: string;
121
+ footer?: string;
122
+ button?: string;
123
+ input?: string;
124
+ table?: string;
125
+ dropzone?: string;
126
+ };
127
+ showDownloadTemplateButton?: boolean;
128
+ skipHeaderRowSelection?: boolean;
129
+ waitOnComplete?: boolean;
130
+ invalidRowHandling?: 'include' | 'exclude' | 'block';
131
+ includeUnmatchedColumns?: boolean;
132
+ language?: string;
133
+ customTranslations?: {
134
+ [language: string]: {
135
+ [key: string]: string;
136
+ };
137
+ };
138
+ demoData?: {
139
+ fileName: string;
140
+ csvContent: string;
141
+ };
142
+ isModal?: boolean;
143
+ modalIsOpen?: boolean;
144
+ modalOnCloseTriggered?: () => void;
145
+ modalCloseOnOutsideClick?: boolean;
146
+ }
147
+
148
+ declare const CSVImporter: React.FC<CSVImporterProps>;
149
+
2
150
  export { CSVImporter };
3
151
  export default CSVImporter;
4
- export { importcsvStyles } from './styles';
5
- export type { Column, Validator, Transformer } from './types';
152
+
153
+ export declare const importcsvStyles: string;
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@importcsv/react",
3
- "version": "0.2.11",
3
+ "version": "0.2.14",
4
4
  "description": "AI-powered CSV importer for React. Smart column mapping with OpenAI, natural language transformations. Self-hosted.",
5
5
  "main": "build/react/index.js",
6
6
  "module": "build/react/index.esm.js",
7
7
  "exports": {
8
8
  ".": {
9
- "types": "./build/react/types/index.d.ts",
9
+ "types": "./build/react/index.d.ts",
10
10
  "import": "./build/react/index.esm.js",
11
11
  "require": "./build/react/index.js"
12
12
  },
13
13
  "./react": {
14
- "types": "./build/react/types/index.d.ts",
14
+ "types": "./build/react/index.d.ts",
15
15
  "import": "./build/react/index.esm.js",
16
16
  "require": "./build/react/index.js"
17
17
  },
@@ -52,7 +52,7 @@
52
52
  "homepage": "https://github.com/importcsv/importcsv#readme",
53
53
  "types": "build/react/index.d.ts",
54
54
  "scripts": {
55
- "build:react": "vite build --mode react",
55
+ "build:react": "vite build --mode react && cp types/index.d.ts build/react/index.d.ts",
56
56
  "build:preact": "vite build --mode preact",
57
57
  "build:bundled": "vite build --mode bundled",
58
58
  "build": "npm-run-all --parallel build:react build:preact build:bundled",