@spellix/file-dropzone
Version:
A component that gives ability to add convenient way to manipulate with files
46 lines (41 loc) • 1.38 kB
text/typescript
export const BYTES_IN_KB = 1024;
export const BYTES_IN_MB = BYTES_IN_KB * BYTES_IN_KB;
export const SYMBOLS_AFTER_DOT = 2;
export const DEFAULT_MAX_FILES = 10;
export const DEFAULT_MAX_SIZE_MB = 50;
export const DEFAULT_MAX_SIZE = DEFAULT_MAX_SIZE_MB * BYTES_IN_MB;
export const FILE_EXTENSIONS_COLORS = {
jpg: 'var(--color-blue-500)',
pdf: 'var(--color-red-700)',
png: 'var(--color-yellow-500)',
gif: 'var(--color-red-600)',
docx: 'var(--color-blue-700)',
doc: 'var(--color-blue-700)',
xlsx: 'var(--color-green-700)',
csv: 'var(--color-green-700)',
txt: 'var(--color-neutral-500)',
zip: 'var(--color-teal-600)',
mp4: 'var(--color-orange-600)',
mp3: 'var(--color-sky-600)',
svg: 'var(--color-yellow-600)',
json: 'var(--color-sky-800)',
xml: 'var(--color-orange-700)',
};
export const FILE_EXTENSION_DEFAULT_COLOR = 'var(--color-neutral-500)';
export const FILE_EXTENSION_TYPES_MAP = {
jpg: 'image/jpeg',
pdf: 'application/pdf',
png: 'image/png',
gif: 'image/gif',
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
doc: 'application/msword',
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
csv: 'text/csv',
txt: 'text/plain',
zip: 'application/zip',
mp4: 'video/mp4',
mp3: 'audio/mpeg',
svg: 'image/svg+xml',
json: 'application/json',
xml: 'application/xml',
};