@ssa-ui-kit/core 3.11.0 → 3.12.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.
@@ -0,0 +1,37 @@
1
+ import { FileUploadProps } from './types';
2
+ /**
3
+ * FileUpload - File input component with optional drag-and-drop support
4
+ *
5
+ * Supports single and multi-file selection with built-in validation for
6
+ * file formats and size. In multi-file mode, selected files are listed
7
+ * below the input with individual remove controls.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * // Single file
12
+ * <FileUpload
13
+ * label="Attachment"
14
+ * placeholder="No file selected"
15
+ * actionText="Choose File"
16
+ * allowedFormats={['pdf', 'doc']}
17
+ * maxFileSize={5 * 1024 * 1024}
18
+ * onChange={(files) => console.log(files)}
19
+ * />
20
+ * ```
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * // Multi-file with drop area
25
+ * <FileUpload
26
+ * label="Documents"
27
+ * isMultiFile
28
+ * maxFiles={5}
29
+ * withDropArea
30
+ * uploadedSectionTitle="Uploaded files"
31
+ * value={files}
32
+ * onChange={setFiles}
33
+ * />
34
+ * ```
35
+ */
36
+ declare const FileUpload: ({ label, placeholder, helperText, actionText, error, disabled, css, className, allowedFormats, maxFileSize, isMultiFile, maxFiles, withDropArea, uploadedSectionTitle, value, onChange, onFileRejected, }: FileUploadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
37
+ export default FileUpload;
@@ -0,0 +1,7 @@
1
+ interface FileUploadItemProps {
2
+ file: File;
3
+ onRemove: (file: File) => void;
4
+ disabled?: boolean;
5
+ }
6
+ declare const FileUploadItem: ({ file, onRemove, disabled }: FileUploadItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export default FileUploadItem;
@@ -0,0 +1,3 @@
1
+ export { default } from './FileUpload';
2
+ export { default as FileUploadItem } from './FileUploadItem';
3
+ export type { FileUploadProps, FileRejectionReason } from './types';
@@ -0,0 +1,24 @@
1
+ import { Theme } from '@emotion/react';
2
+ export declare const wrapper: import("@emotion/react").SerializedStyles;
3
+ export declare const hiddenInput: import("@emotion/react").SerializedStyles;
4
+ export declare const inputRow: (theme: Theme) => import("@emotion/react").SerializedStyles;
5
+ export declare const inputRowError: (theme: Theme) => import("@emotion/react").SerializedStyles;
6
+ export declare const inputRowDisabled: (theme: Theme) => import("@emotion/react").SerializedStyles;
7
+ export declare const fileNameText: (theme: Theme) => import("@emotion/react").SerializedStyles;
8
+ export declare const placeholderText: (theme: Theme) => import("@emotion/react").SerializedStyles;
9
+ export declare const dropArea: (theme: Theme) => import("@emotion/react").SerializedStyles;
10
+ export declare const dropAreaActive: (theme: Theme) => import("@emotion/react").SerializedStyles;
11
+ export declare const dropAreaError: (theme: Theme) => import("@emotion/react").SerializedStyles;
12
+ export declare const dropAreaDisabled: (theme: Theme) => import("@emotion/react").SerializedStyles;
13
+ export declare const dropAreaTitle: (theme: Theme) => import("@emotion/react").SerializedStyles;
14
+ export declare const dropAreaHint: (theme: Theme) => import("@emotion/react").SerializedStyles;
15
+ export declare const dropAreaAction: (theme: Theme) => import("@emotion/react").SerializedStyles;
16
+ export declare const dropAreaClearButton: (theme: Theme) => import("@emotion/react").SerializedStyles;
17
+ export declare const filesList: import("@emotion/react").SerializedStyles;
18
+ export declare const filesListTitle: (theme: Theme) => import("@emotion/react").SerializedStyles;
19
+ export declare const fileItem: (theme: Theme) => import("@emotion/react").SerializedStyles;
20
+ export declare const fileIconWrapper: import("@emotion/react").SerializedStyles;
21
+ export declare const fileInfo: import("@emotion/react").SerializedStyles;
22
+ export declare const fileName: (theme: Theme) => import("@emotion/react").SerializedStyles;
23
+ export declare const fileSize: (theme: Theme) => import("@emotion/react").SerializedStyles;
24
+ export declare const deleteButton: (theme: Theme) => import("@emotion/react").SerializedStyles;
@@ -0,0 +1,21 @@
1
+ import { Interpolation, Theme } from '@emotion/react';
2
+ export type FileRejectionReason = 'size' | 'format';
3
+ export interface FileUploadProps {
4
+ label?: string;
5
+ placeholder?: string;
6
+ helperText?: string;
7
+ actionText?: string;
8
+ error?: string;
9
+ disabled?: boolean;
10
+ css?: Interpolation<Theme>;
11
+ allowedFormats?: string[];
12
+ maxFileSize?: number;
13
+ isMultiFile?: boolean;
14
+ maxFiles?: number;
15
+ withDropArea?: boolean;
16
+ uploadedSectionTitle?: string;
17
+ className?: string;
18
+ value?: File | File[];
19
+ onChange?: (files: File[]) => void;
20
+ onFileRejected?: (file: File, reason: FileRejectionReason) => void;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssa-ui-kit/core",
3
- "version": "3.11.0",
3
+ "version": "3.12.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -39,8 +39,8 @@
39
39
  "luxon": "3.5.0",
40
40
  "plotly.js": "3.0.0",
41
41
  "react-plotly.js": "2.6.0",
42
- "@ssa-ui-kit/hooks": "^3.11.0",
43
- "@ssa-ui-kit/utils": "^3.11.0"
42
+ "@ssa-ui-kit/hooks": "^3.12.0",
43
+ "@ssa-ui-kit/utils": "^3.12.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@emotion/css": "11.13.5",