@importcsv/react 0.4.5 → 0.4.7

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 (182) hide show
  1. package/README.md +47 -84
  2. package/build/preact/index.esm.js +2180 -2259
  3. package/build/preact/index.esm.js.map +1 -1
  4. package/build/preact/index.js +16 -117
  5. package/build/preact/index.js.map +1 -1
  6. package/build/react/index.esm.js +2473 -2522
  7. package/build/react/index.esm.js.map +1 -1
  8. package/build/react/index.js +16 -117
  9. package/build/react/index.js.map +1 -1
  10. package/package.json +11 -10
  11. package/build/App.d.ts +0 -2
  12. package/build/bundled/index.esm.js +0 -11531
  13. package/build/bundled/index.esm.js.map +0 -1
  14. package/build/bundled/index.js +0 -139
  15. package/build/bundled/index.js.map +0 -1
  16. package/build/bundled/index.umd.js +0 -139
  17. package/build/bundled/index.umd.js.map +0 -1
  18. package/build/bundled-styles.d.ts +0 -1
  19. package/build/components/CSVImporter/index.d.ts +0 -55
  20. package/build/components/CSVImporter/index.test.d.ts +0 -1
  21. package/build/components/CSVImporterHeadless.d.ts +0 -46
  22. package/build/components/ColumnMapper.d.ts +0 -28
  23. package/build/components/Modal/index.d.ts +0 -12
  24. package/build/components/Uploader.d.ts +0 -27
  25. package/build/components/Validator.d.ts +0 -28
  26. package/build/components/__tests__/CSVImporterHeadless.test.d.ts +0 -1
  27. package/build/components/__tests__/ColumnMapper.test.d.ts +0 -1
  28. package/build/components/__tests__/Uploader.test.d.ts +0 -1
  29. package/build/components/__tests__/Validator.test.d.ts +0 -1
  30. package/build/components/index.d.ts +0 -3
  31. package/build/config/index.d.ts +0 -5
  32. package/build/headless/__tests__/integration.test.d.ts +0 -10
  33. package/build/headless/__tests__/root.test.d.ts +0 -1
  34. package/build/headless/__tests__/root.types.test-d.d.ts +0 -1
  35. package/build/headless/__tests__/slot-components.test.d.ts +0 -1
  36. package/build/headless/__tests__/validator.test.d.ts +0 -1
  37. package/build/headless/back-button.d.ts +0 -29
  38. package/build/headless/index.d.ts +0 -45
  39. package/build/headless/next-button.d.ts +0 -29
  40. package/build/headless/root.d.ts +0 -40
  41. package/build/headless/submit-button.d.ts +0 -29
  42. package/build/headless/types.d.ts +0 -52
  43. package/build/headless/upload-trigger.d.ts +0 -29
  44. package/build/headless/utils/slot.d.ts +0 -20
  45. package/build/headless/utils/zodSchemaToColumns.d.ts +0 -25
  46. package/build/headless/utils/zodSchemaToColumns.test.d.ts +0 -1
  47. package/build/headless/validator.d.ts +0 -28
  48. package/build/i18n/de.d.ts +0 -32
  49. package/build/i18n/es.d.ts +0 -32
  50. package/build/i18n/fr.d.ts +0 -32
  51. package/build/i18n/i18n.d.ts +0 -6
  52. package/build/i18n/it.d.ts +0 -32
  53. package/build/i18n/useTranslation.d.ts +0 -9
  54. package/build/importer/components/Box/index.d.ts +0 -2
  55. package/build/importer/components/Box/index.test.d.ts +0 -1
  56. package/build/importer/components/Box/types/index.d.ts +0 -6
  57. package/build/importer/components/Checkbox/index.d.ts +0 -3
  58. package/build/importer/components/Checkbox/index.test.d.ts +0 -1
  59. package/build/importer/components/Checkbox/types/index.d.ts +0 -8
  60. package/build/importer/components/Errors/index.d.ts +0 -4
  61. package/build/importer/components/Input/index.d.ts +0 -2
  62. package/build/importer/components/Input/index.test.d.ts +0 -1
  63. package/build/importer/components/Input/types/index.d.ts +0 -24
  64. package/build/importer/components/Root/index.d.ts +0 -2
  65. package/build/importer/components/StepLayout/index.d.ts +0 -19
  66. package/build/importer/components/Stepper/hooks/useStepper.d.ts +0 -4
  67. package/build/importer/components/Stepper/hooks/useStepper.test.d.ts +0 -1
  68. package/build/importer/components/Stepper/index.d.ts +0 -2
  69. package/build/importer/components/Stepper/index.test.d.ts +0 -1
  70. package/build/importer/components/Stepper/types/index.d.ts +0 -14
  71. package/build/importer/components/Table/index.d.ts +0 -9
  72. package/build/importer/components/Table/types/index.d.ts +0 -43
  73. package/build/importer/components/ToggleFilter/index.d.ts +0 -3
  74. package/build/importer/components/ToggleFilter/types/index.d.ts +0 -11
  75. package/build/importer/components/Tooltip/index.d.ts +0 -2
  76. package/build/importer/components/Tooltip/types/index.d.ts +0 -11
  77. package/build/importer/components/UploaderWrapper/NativeDropzone.d.ts +0 -12
  78. package/build/importer/components/UploaderWrapper/UploaderWrapper.d.ts +0 -2
  79. package/build/importer/components/UploaderWrapper/types/index.d.ts +0 -2
  80. package/build/importer/components/VirtualTable/index.d.ts +0 -17
  81. package/build/importer/components/VirtualTable/index.test.d.ts +0 -1
  82. package/build/importer/components/ui/alert.d.ts +0 -15
  83. package/build/importer/components/ui/button.d.ts +0 -15
  84. package/build/importer/components/ui/card.d.ts +0 -20
  85. package/build/importer/components/ui/checkbox.d.ts +0 -10
  86. package/build/importer/components/ui/dialog.d.ts +0 -39
  87. package/build/importer/components/ui/flex.d.ts +0 -24
  88. package/build/importer/components/ui/input.d.ts +0 -8
  89. package/build/importer/components/ui/select.d.ts +0 -17
  90. package/build/importer/components/ui/switch.d.ts +0 -11
  91. package/build/importer/components/ui/toast.d.ts +0 -22
  92. package/build/importer/components/ui/toaster.d.ts +0 -2
  93. package/build/importer/components/ui/tooltip.d.ts +0 -25
  94. package/build/importer/components/ui/use-toast.d.ts +0 -46
  95. package/build/importer/features/complete/index.d.ts +0 -2
  96. package/build/importer/features/complete/types/index.d.ts +0 -5
  97. package/build/importer/features/configure-import/index.d.ts +0 -14
  98. package/build/importer/features/configure-import/types/index.d.ts +0 -13
  99. package/build/importer/features/main/hooks/useMutableLocalStorage.d.ts +0 -1
  100. package/build/importer/features/main/hooks/useMutableLocalStorage.test.d.ts +0 -1
  101. package/build/importer/features/main/hooks/useStepNavigation.d.ts +0 -17
  102. package/build/importer/features/main/hooks/useStepNavigation.test.d.ts +0 -1
  103. package/build/importer/features/main/index.d.ts +0 -2
  104. package/build/importer/features/main/types/index.d.ts +0 -16
  105. package/build/importer/features/map-columns/components/DropDownFields.d.ts +0 -22
  106. package/build/importer/features/map-columns/hooks/useMapColumnsTable.d.ts +0 -17
  107. package/build/importer/features/map-columns/index.d.ts +0 -3
  108. package/build/importer/features/map-columns/types/index.d.ts +0 -16
  109. package/build/importer/features/row-selection/index.d.ts +0 -3
  110. package/build/importer/features/row-selection/types/index.d.ts +0 -8
  111. package/build/importer/features/uploader/hooks/useTemplateTable.d.ts +0 -10
  112. package/build/importer/features/uploader/index.d.ts +0 -2
  113. package/build/importer/features/uploader/types/index.d.ts +0 -9
  114. package/build/importer/features/validation/Validation.d.ts +0 -3
  115. package/build/importer/features/validation/__tests__/Validation.zod.test.d.ts +0 -1
  116. package/build/importer/features/validation/components/TransformModal.d.ts +0 -19
  117. package/build/importer/features/validation/components/TransformPanel.d.ts +0 -19
  118. package/build/importer/features/validation/index.d.ts +0 -1
  119. package/build/importer/features/validation/types.d.ts +0 -34
  120. package/build/importer/hooks/useClickOutside.d.ts +0 -1
  121. package/build/importer/hooks/useClickOutside.test.d.ts +0 -1
  122. package/build/importer/hooks/useCustomStyles.d.ts +0 -1
  123. package/build/importer/hooks/useCustomStyles.test.d.ts +0 -1
  124. package/build/importer/hooks/useEventListener.d.ts +0 -4
  125. package/build/importer/hooks/useEventListener.test.d.ts +0 -1
  126. package/build/importer/hooks/useIsomorphicLayoutEffect.d.ts +0 -3
  127. package/build/importer/hooks/useIsomorphicLayoutEffect.test.d.ts +0 -1
  128. package/build/importer/hooks/useRect.d.ts +0 -12
  129. package/build/importer/hooks/useRect.test.d.ts +0 -1
  130. package/build/importer/hooks/useWindowSize.d.ts +0 -1
  131. package/build/importer/hooks/useWindowSize.test.d.ts +0 -1
  132. package/build/importer/providers/Theme.d.ts +0 -10
  133. package/build/importer/providers/index.d.ts +0 -5
  134. package/build/importer/providers/types/index.d.ts +0 -10
  135. package/build/importer/services/api.d.ts +0 -1
  136. package/build/importer/services/mapping.d.ts +0 -31
  137. package/build/importer/services/mapping.test.d.ts +0 -1
  138. package/build/importer/services/transformation.d.ts +0 -70
  139. package/build/importer/services/transformation.test.d.ts +0 -1
  140. package/build/importer/settings/theme/colors.d.ts +0 -4
  141. package/build/importer/settings/theme/index.d.ts +0 -2
  142. package/build/importer/settings/theme/sizes.d.ts +0 -7
  143. package/build/importer/stores/theme.d.ts +0 -17
  144. package/build/importer/theme/index.d.ts +0 -8
  145. package/build/importer/theme/presets.d.ts +0 -314
  146. package/build/importer/theme/runtime.d.ts +0 -66
  147. package/build/importer/theme/styles.d.ts +0 -120
  148. package/build/importer/types/index.d.ts +0 -9
  149. package/build/importer/utils/colorUtils.d.ts +0 -48
  150. package/build/importer/utils/colorUtils.test.d.ts +0 -1
  151. package/build/importer/utils/errorAnalysis.d.ts +0 -25
  152. package/build/importer/utils/errorAnalysis.test.d.ts +0 -1
  153. package/build/importer/utils/getStringLengthOfChildren.d.ts +0 -2
  154. package/build/importer/utils/getStringLengthOfChildren.test.d.ts +0 -1
  155. package/build/importer/utils/stringSimilarity.d.ts +0 -1
  156. package/build/importer/utils/stringSimilarity.test.d.ts +0 -1
  157. package/build/importer/utils/template.d.ts +0 -2
  158. package/build/importer/utils/template.test.d.ts +0 -1
  159. package/build/importer/utils/themeUtils.d.ts +0 -24
  160. package/build/importer/utils/themeUtils.test.d.ts +0 -1
  161. package/build/importer/utils/utils.d.ts +0 -19
  162. package/build/importer/utils/utils.test.d.ts +0 -1
  163. package/build/index.d.ts +0 -10
  164. package/build/index.dev.d.ts +0 -1
  165. package/build/js.d.ts +0 -57
  166. package/build/services/api.d.ts +0 -50
  167. package/build/services/apiClient.d.ts +0 -55
  168. package/build/settings/defaults.d.ts +0 -3
  169. package/build/shims/react-compat-shim.d.ts +0 -43
  170. package/build/shims/react-hooks-shim.d.ts +0 -2
  171. package/build/styles.d.ts +0 -1
  172. package/build/test/helpers.d.ts +0 -28
  173. package/build/test/mocks/api.d.ts +0 -8
  174. package/build/test/mocks/localStorage.d.ts +0 -6
  175. package/build/test/setup.d.ts +0 -1
  176. package/build/types/index.d.ts +0 -137
  177. package/build/types/theme.d.ts +0 -153
  178. package/build/utils/cn.d.ts +0 -6
  179. package/build/utils/cn.test.d.ts +0 -1
  180. package/build/validation/transformationStages.d.ts +0 -26
  181. package/build/validation/transformer.d.ts +0 -17
  182. package/build/validation/validator.d.ts +0 -23
@@ -1,27 +0,0 @@
1
- import { h } from 'preact';
2
- import { z } from 'zod';
3
- import type { Column } from '../headless/types';
4
- interface UploaderProps {
5
- schema?: z.ZodSchema<any>;
6
- columns?: Column[];
7
- onUpload: (data: {
8
- rows: any[];
9
- }) => void;
10
- onError?: (error: {
11
- code: string;
12
- message: string;
13
- }) => void;
14
- placeholder?: string;
15
- maxSize?: number;
16
- acceptedFormats?: string[];
17
- className?: string;
18
- theme?: 'light' | 'dark';
19
- appearance?: {
20
- variables?: {
21
- colorPrimary?: string;
22
- borderRadius?: string;
23
- };
24
- };
25
- }
26
- export declare const Uploader: ({ schema, columns, onUpload, ...props }: UploaderProps) => h.JSX.Element;
27
- export default Uploader;
@@ -1,28 +0,0 @@
1
- import { h } from 'preact';
2
- import { z } from 'zod';
3
- import type { Column } from '../headless/types';
4
- interface ValidatorProps {
5
- schema?: z.ZodSchema<any>;
6
- columns?: Column[];
7
- data: {
8
- rows: any[];
9
- };
10
- mapping?: Record<string, string>;
11
- onComplete: (validData: any[]) => void;
12
- autoValidate?: boolean;
13
- allowInlineEdit?: boolean;
14
- allowRemoveRows?: boolean;
15
- allowSubmitWithErrors?: boolean;
16
- allowExportErrors?: boolean;
17
- className?: string;
18
- theme?: 'light' | 'dark';
19
- appearance?: {
20
- variables?: {
21
- colorError?: string;
22
- colorSuccess?: string;
23
- };
24
- };
25
- errorsPerPage?: number;
26
- }
27
- export declare const Validator: ({ schema, columns, data, mapping, onComplete, autoValidate, allowInlineEdit, allowRemoveRows, allowSubmitWithErrors, allowExportErrors, className, theme, appearance, errorsPerPage }: ValidatorProps) => h.JSX.Element;
28
- export default Validator;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export { Uploader } from './Uploader';
2
- export { ColumnMapper } from './ColumnMapper';
3
- export { Validator } from './Validator';
@@ -1,5 +0,0 @@
1
- export function getApiBaseUrl(backendUrl: string): string;
2
- declare namespace _default {
3
- export { getApiBaseUrl };
4
- }
5
- export default _default;
@@ -1,10 +0,0 @@
1
- /**
2
- * Integration tests for building a complete CSV importer using headless components
3
- *
4
- * These tests verify that:
5
- * 1. Headless components can build a full CSV import workflow
6
- * 2. The workflow matches the behavior of the existing CSVImporter
7
- * 3. All features work together seamlessly
8
- * 4. Backward compatibility with legacy API is maintained
9
- */
10
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,29 +0,0 @@
1
- import { type ComponentChildren } from 'preact';
2
- export interface BackButtonProps {
3
- asChild?: boolean;
4
- onClick?: () => void;
5
- children: ComponentChildren;
6
- [key: string]: any;
7
- }
8
- /**
9
- * BackButton component - Go to previous step
10
- *
11
- * @example
12
- * // Default button
13
- * <BackButton onClick={goToPreviousStep}>Back</BackButton>
14
- *
15
- * @example
16
- * // With shadcn/ui Button
17
- * import { Button } from '@/components/ui/button';
18
- * <BackButton asChild>
19
- * <Button variant="outline">Back</Button>
20
- * </BackButton>
21
- *
22
- * @example
23
- * // With Chakra UI Button
24
- * import { Button } from '@chakra-ui/react';
25
- * <BackButton asChild>
26
- * <Button colorScheme="gray">Back</Button>
27
- * </BackButton>
28
- */
29
- export declare function BackButton({ asChild, children, onClick, ...props }: BackButtonProps): import("preact").JSX.Element;
@@ -1,45 +0,0 @@
1
- /**
2
- * Headless CSV Importer Components
3
- *
4
- * Domain logic primitives with no UI dependencies.
5
- * Works with any design system (shadcn/ui, MUI, Chakra, etc.)
6
- *
7
- * @example
8
- * // With Zod schema
9
- * import * as CSV from '@importcsv/react/headless';
10
- * import { z } from 'zod';
11
- *
12
- * const schema = z.object({
13
- * name: z.string(),
14
- * email: z.string().email()
15
- * });
16
- *
17
- * <CSV.Root schema={schema} onComplete={handleComplete}>
18
- * <CSV.Validator>
19
- * {({ errors, validate }) => (
20
- * // Your custom UI here
21
- * )}
22
- * </CSV.Validator>
23
- * </CSV.Root>
24
- *
25
- * @example
26
- * // With design system components (asChild pattern)
27
- * import { Button } from '@/components/ui/button';
28
- *
29
- * <CSV.UploadTrigger asChild>
30
- * <Button variant="primary">Upload CSV</Button>
31
- * </CSV.UploadTrigger>
32
- */
33
- export { Root, useCSV } from './root';
34
- export { Validator } from './validator';
35
- export { UploadTrigger } from './upload-trigger';
36
- export { NextButton } from './next-button';
37
- export { BackButton } from './back-button';
38
- export { SubmitButton } from './submit-button';
39
- export type { Column, ValidationError, CSVContextValue, RootProps, ValidatorProps, ValidatorChildProps } from './types';
40
- export type { UploadTriggerProps } from './upload-trigger';
41
- export type { NextButtonProps } from './next-button';
42
- export type { BackButtonProps } from './back-button';
43
- export type { SubmitButtonProps } from './submit-button';
44
- export { zodSchemaToColumns } from './utils/zodSchemaToColumns';
45
- export { Slot } from './utils/slot';
@@ -1,29 +0,0 @@
1
- import { type ComponentChildren } from 'preact';
2
- export interface NextButtonProps {
3
- asChild?: boolean;
4
- onClick?: () => void;
5
- children: ComponentChildren;
6
- [key: string]: any;
7
- }
8
- /**
9
- * NextButton component - Proceed to next step
10
- *
11
- * @example
12
- * // Default button
13
- * <NextButton onClick={goToNextStep}>Next</NextButton>
14
- *
15
- * @example
16
- * // With shadcn/ui Button
17
- * import { Button } from '@/components/ui/button';
18
- * <NextButton asChild>
19
- * <Button variant="primary">Next</Button>
20
- * </NextButton>
21
- *
22
- * @example
23
- * // With Material-UI Button
24
- * import { Button } from '@mui/material';
25
- * <NextButton asChild>
26
- * <Button variant="contained">Next</Button>
27
- * </NextButton>
28
- */
29
- export declare function NextButton({ asChild, children, onClick, ...props }: NextButtonProps): import("preact").JSX.Element;
@@ -1,40 +0,0 @@
1
- import type { CSVContextValue, RootProps } from './types';
2
- export declare const CSVContext: import("preact").Context<CSVContextValue<any> | null>;
3
- /**
4
- * CSV Root context provider with Zod schema support
5
- *
6
- * @example
7
- * // With Zod schema (recommended)
8
- * const schema = z.object({
9
- * name: z.string(),
10
- * email: z.string().email()
11
- * });
12
- *
13
- * <CSV.Root schema={schema} onComplete={(data) => console.log(data)}>
14
- * <CSV.Uploader />
15
- * <CSV.Validator />
16
- * </CSV.Root>
17
- *
18
- * @example
19
- * // With legacy columns array (backward compatibility)
20
- * <CSV.Root
21
- * columns={[
22
- * { id: 'name', label: 'Name', type: 'string', required: true },
23
- * { id: 'email', label: 'Email', type: 'email', required: true }
24
- * ]}
25
- * onComplete={(data) => console.log(data)}
26
- * >
27
- * <CSV.Uploader />
28
- * </CSV.Root>
29
- */
30
- export declare function Root<TSchema = any>({ children, schema, columns, onComplete, data }: RootProps<TSchema>): import("preact").JSX.Element;
31
- /**
32
- * Hook to access CSV context
33
- *
34
- * @example
35
- * function MyComponent() {
36
- * const { columns, validate, schema } = useCSV();
37
- * return <div>{columns.length} columns</div>;
38
- * }
39
- */
40
- export declare function useCSV(): CSVContextValue<any>;
@@ -1,29 +0,0 @@
1
- import { type ComponentChildren } from 'preact';
2
- export interface SubmitButtonProps {
3
- asChild?: boolean;
4
- onClick?: () => void;
5
- children: ComponentChildren;
6
- [key: string]: any;
7
- }
8
- /**
9
- * SubmitButton component - Submit final data
10
- *
11
- * @example
12
- * // Default button
13
- * <SubmitButton>Submit</SubmitButton>
14
- *
15
- * @example
16
- * // With shadcn/ui Button
17
- * import { Button } from '@/components/ui/button';
18
- * <SubmitButton asChild>
19
- * <Button variant="primary">Submit</Button>
20
- * </SubmitButton>
21
- *
22
- * @example
23
- * // With Material-UI Button
24
- * import { Button } from '@mui/material';
25
- * <SubmitButton asChild>
26
- * <Button variant="contained" type="submit">Submit</Button>
27
- * </SubmitButton>
28
- */
29
- export declare function SubmitButton({ asChild, children, onClick, ...props }: SubmitButtonProps): import("preact").JSX.Element;
@@ -1,52 +0,0 @@
1
- import { z } from 'zod';
2
- import { ComponentChildren } from 'preact';
3
- export interface Column {
4
- id: string;
5
- label?: string;
6
- type?: string;
7
- required?: boolean;
8
- validators?: Array<{
9
- type: string;
10
- value?: any;
11
- message?: string;
12
- pattern?: string;
13
- }>;
14
- transformations?: Array<{
15
- type: string;
16
- [key: string]: any;
17
- }>;
18
- options?: string[];
19
- description?: string;
20
- placeholder?: string;
21
- }
22
- export interface ValidationError {
23
- row: number;
24
- column: string;
25
- message: string;
26
- }
27
- export interface CSVContextValue<TSchema = any> {
28
- columns: Column[];
29
- schema?: z.ZodSchema<TSchema>;
30
- validate: (row: any) => z.SafeParseReturnType<TSchema, TSchema>;
31
- onComplete: (data: TSchema[]) => void | Promise<void>;
32
- data?: {
33
- rows: any[];
34
- };
35
- }
36
- export interface RootProps<TSchema = any> {
37
- children: ComponentChildren;
38
- schema?: z.ZodSchema<TSchema>;
39
- columns?: Column[];
40
- onComplete: (data: TSchema[]) => void | Promise<void>;
41
- data?: {
42
- rows: any[];
43
- };
44
- }
45
- export interface ValidatorChildProps {
46
- errors: ValidationError[];
47
- validate: () => Promise<ValidationError[]>;
48
- isValidating: boolean;
49
- }
50
- export interface ValidatorProps {
51
- children: (props: ValidatorChildProps) => any;
52
- }
@@ -1,29 +0,0 @@
1
- import { type ComponentChildren } from 'preact';
2
- export interface UploadTriggerProps {
3
- asChild?: boolean;
4
- onClick?: () => void;
5
- children: ComponentChildren;
6
- [key: string]: any;
7
- }
8
- /**
9
- * UploadTrigger component - Trigger file picker
10
- *
11
- * @example
12
- * // Default button
13
- * <UploadTrigger>Upload CSV</UploadTrigger>
14
- *
15
- * @example
16
- * // With shadcn/ui Button
17
- * import { Button } from '@/components/ui/button';
18
- * <UploadTrigger asChild>
19
- * <Button variant="primary">Upload CSV</Button>
20
- * </UploadTrigger>
21
- *
22
- * @example
23
- * // With Material-UI Button
24
- * import { Button } from '@mui/material';
25
- * <UploadTrigger asChild>
26
- * <Button variant="contained">Upload CSV</Button>
27
- * </UploadTrigger>
28
- */
29
- export declare function UploadTrigger({ asChild, children, onClick, ...props }: UploadTriggerProps): import("preact").JSX.Element;
@@ -1,20 +0,0 @@
1
- import { type ComponentChildren, type VNode } from 'preact';
2
- interface SlotProps {
3
- children: ComponentChildren;
4
- onClick?: (...args: any[]) => void;
5
- className?: string;
6
- [key: string]: any;
7
- }
8
- /**
9
- * Slot component for Preact - enables composition pattern (asChild)
10
- *
11
- * Merges props from parent to child element, similar to Radix UI's Slot
12
- *
13
- * @example
14
- * const Comp = asChild ? Slot : 'button';
15
- * <Comp onClick={handleClick} className="btn">
16
- * <CustomButton>Click me</CustomButton>
17
- * </Comp>
18
- */
19
- export declare function Slot({ children, ...props }: SlotProps): VNode<any> | null;
20
- export {};
@@ -1,25 +0,0 @@
1
- import { z } from 'zod';
2
- import type { Column } from '../../types';
3
- /**
4
- * Converts a Zod schema to Column[] with full validator/transformer extraction
5
- *
6
- * @example
7
- * const schema = z.object({
8
- * name: z.string().min(1, 'Name is required'),
9
- * email: z.string().email('Must be a valid email'),
10
- * age: z.number().min(18).optional(),
11
- * department: z.enum(['engineering', 'sales', 'marketing'])
12
- * });
13
- *
14
- * const columns = zodSchemaToColumns(schema);
15
- * // Result: [
16
- * // { id: 'name', label: 'Name', type: 'string', validators: [...] },
17
- * // { id: 'email', label: 'Email', type: 'email', validators: [...] },
18
- * // { id: 'age', label: 'Age', type: 'number', validators: [...] },
19
- * // { id: 'department', label: 'Department', type: 'select', options: [...] }
20
- * // ]
21
- *
22
- * @note Boolean fields are mapped to 'string' type for CSV compatibility,
23
- * as CSV data is text-based and typically represents booleans as 'true'/'false' strings.
24
- */
25
- export declare function zodSchemaToColumns<T>(schema: z.ZodSchema<T>): Column[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,28 +0,0 @@
1
- import type { ValidatorProps } from './types';
2
- /**
3
- * CSV Validator component with Zod integration
4
- *
5
- * Provides validation functionality using Zod schemas or custom validation logic
6
- *
7
- * @example
8
- * <CSV.Validator>
9
- * {({ errors, validate, isValidating }) => (
10
- * <div>
11
- * <button onClick={validate} disabled={isValidating}>
12
- * {isValidating ? 'Validating...' : 'Validate Data'}
13
- * </button>
14
- * {errors.length > 0 && (
15
- * <div>
16
- * <h3>Validation Errors:</h3>
17
- * {errors.map((error, i) => (
18
- * <div key={i}>
19
- * Row {error.row + 1}, Column {error.column}: {error.message}
20
- * </div>
21
- * ))}
22
- * </div>
23
- * )}
24
- * </div>
25
- * )}
26
- * </CSV.Validator>
27
- */
28
- export declare function Validator({ children }: ValidatorProps): any;
@@ -1,32 +0,0 @@
1
- declare const translations: {
2
- Upload: string;
3
- "Select Header": string;
4
- "Map Columns": string;
5
- "Expected Column": string;
6
- Required: string;
7
- "Drop your file here": string;
8
- or: string;
9
- "Browse files": string;
10
- "Download Template": string;
11
- "Only CSV, XLS, and XLSX files can be uploaded": string;
12
- "Select Header Row": string;
13
- "Select the row which contains the column headers": string;
14
- "Only the first sheet (&quot;{{sheet}}&quot;) of the Excel file will be imported. To import multiple sheets, please upload each sheet individually.": string;
15
- Cancel: string;
16
- Continue: string;
17
- "Your File Column": string;
18
- "Your Sample Data": string;
19
- "Destination Column": string;
20
- Include: string;
21
- Submit: string;
22
- "Loading...": string;
23
- "Please include all required columns": string;
24
- Back: string;
25
- "- Select one -": string;
26
- "- empty -": string;
27
- "Import Successful": string;
28
- "Upload Successful": string;
29
- Done: string;
30
- "Upload another file": string;
31
- };
32
- export default translations;
@@ -1,32 +0,0 @@
1
- declare const translations: {
2
- Upload: string;
3
- "Select Header": string;
4
- "Map Columns": string;
5
- "Expected Column": string;
6
- Required: string;
7
- "Drop your file here": string;
8
- or: string;
9
- "Browse files": string;
10
- "Download Template": string;
11
- "Only CSV, XLS, and XLSX files can be uploaded": string;
12
- "Select Header Row": string;
13
- "Select the row which contains the column headers": string;
14
- "Only the first sheet (&quot;{{sheet}}&quot;) of the Excel file will be imported. To import multiple sheets, please upload each sheet individually.": string;
15
- Cancel: string;
16
- Continue: string;
17
- "Your File Column": string;
18
- "Your Sample Data": string;
19
- "Destination Column": string;
20
- Include: string;
21
- Submit: string;
22
- "Loading...": string;
23
- "Please include all required columns": string;
24
- Back: string;
25
- "- Select one -": string;
26
- "- empty -": string;
27
- "Import Successful": string;
28
- "Upload Successful": string;
29
- Done: string;
30
- "Upload another file": string;
31
- };
32
- export default translations;
@@ -1,32 +0,0 @@
1
- declare const translations: {
2
- Upload: string;
3
- "Select Header": string;
4
- "Map Columns": string;
5
- "Expected Column": string;
6
- Required: string;
7
- "Drop your file here": string;
8
- or: string;
9
- "Browse files": string;
10
- "Download Template": string;
11
- "Only CSV, XLS, and XLSX files can be uploaded": string;
12
- "Select Header Row": string;
13
- "Select the row which contains the column headers": string;
14
- "Only the first sheet (&quot;{{sheet}}&quot;) of the Excel file will be imported. To import multiple sheets, please upload each sheet individually.": string;
15
- Cancel: string;
16
- Continue: string;
17
- "Your File Column": string;
18
- "Your Sample Data": string;
19
- "Destination Column": string;
20
- Include: string;
21
- Submit: string;
22
- "Loading...": string;
23
- "Please include all required columns": string;
24
- Back: string;
25
- "- Select one -": string;
26
- "- empty -": string;
27
- "Import Successful": string;
28
- "Upload Successful": string;
29
- Done: string;
30
- "Upload another file": string;
31
- };
32
- export default translations;
@@ -1,6 +0,0 @@
1
- declare const dummyI18n: {
2
- t: (key: string, options?: any) => string;
3
- changeLanguage: () => Promise<void>;
4
- addResourceBundle: () => boolean;
5
- };
6
- export default dummyI18n;
@@ -1,32 +0,0 @@
1
- declare const translations: {
2
- Upload: string;
3
- "Select Header": string;
4
- "Map Columns": string;
5
- "Expected Column": string;
6
- Required: string;
7
- "Drop your file here": string;
8
- or: string;
9
- "Browse files": string;
10
- "Download Template": string;
11
- "Only CSV, XLS, and XLSX files can be uploaded": string;
12
- "Select Header Row": string;
13
- "Select the row which contains the column headers": string;
14
- "Only the first sheet (&quot;{{sheet}}&quot;) of the Excel file will be imported. To import multiple sheets, please upload each sheet individually.": string;
15
- Cancel: string;
16
- Continue: string;
17
- "Your File Column": string;
18
- "Your Sample Data": string;
19
- "Destination Column": string;
20
- Include: string;
21
- Submit: string;
22
- "Loading...": string;
23
- "Please include all required columns": string;
24
- Back: string;
25
- "- Select one -": string;
26
- "- empty -": string;
27
- "Import Successful": string;
28
- "Upload Successful": string;
29
- Done: string;
30
- "Upload another file": string;
31
- };
32
- export default translations;
@@ -1,9 +0,0 @@
1
- export declare const useTranslation: () => {
2
- t: (key: string, options?: any) => string;
3
- i18n: {
4
- t: (key: string, options?: any) => string;
5
- changeLanguage: () => Promise<void>;
6
- addResourceBundle: () => boolean;
7
- };
8
- };
9
- export default useTranslation;
@@ -1,2 +0,0 @@
1
- import { BoxProps } from "./types";
2
- export default function Box({ className, variants, ...props }: BoxProps): import("preact").JSX.Element;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import { JSX } from "preact";
2
- export type BoxVariant = "fluid" | "mid" | "wide" | "space-l" | "space-mid" | "space-none" | "bg-shade";
3
- export type BoxProps = JSX.HTMLAttributes<HTMLDivElement> & {
4
- variants?: BoxVariant[];
5
- };
6
- export declare const boxVariants: BoxVariant[];
@@ -1,3 +0,0 @@
1
- import type { JSX } from "preact";
2
- import { CheckboxProps } from "./types";
3
- export default function Checkbox({ label, className, ...props }: CheckboxProps): JSX.Element;
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { JSX, VNode } from "preact";
2
- export type CheckboxProps = Omit<JSX.HTMLAttributes<HTMLInputElement>, 'label'> & {
3
- label?: string | VNode;
4
- name?: string;
5
- checked?: boolean;
6
- disabled?: boolean;
7
- onChange?: (e: JSX.TargetedEvent<HTMLInputElement, Event>) => void;
8
- };
@@ -1,4 +0,0 @@
1
- export default function Errors({ error, centered }: {
2
- error?: unknown;
3
- centered?: boolean;
4
- }): import("preact").JSX.Element | null;
@@ -1,2 +0,0 @@
1
- import { InputProps } from "./types";
2
- export default function Input({ as, label, icon, iconAfter, error, options, className, variants, children, ...props }: InputProps): import("preact/compat").JSX.Element;
@@ -1 +0,0 @@
1
- export {};