@veeqo/ui 4.1.1 → 4.2.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.
Files changed (25) hide show
  1. package/dist/components/UploadFile/UploadFile.d.ts +3 -0
  2. package/dist/components/UploadFile/UploadFile.test.d.ts +1 -0
  3. package/dist/components/UploadFile/UploadGraphic.d.ts +2 -0
  4. package/dist/components/UploadFile/components/UploadCopy/UploadCopy.d.ts +8 -0
  5. package/dist/components/UploadFile/components/UploadedFile/UploadedFile.d.ts +10 -0
  6. package/dist/components/UploadFile/components/styled.d.ts +2 -0
  7. package/dist/components/UploadFile/constants.d.ts +17 -0
  8. package/dist/components/UploadFile/index.d.ts +2 -0
  9. package/dist/components/UploadFile/styled.d.ts +1 -0
  10. package/dist/components/UploadFile/types.d.ts +9 -0
  11. package/dist/components/UploadFile/utils/getFileSizeString/getFileSizeString.d.ts +24 -0
  12. package/dist/components/UploadFile/utils/getFileSizeString/getFileSizeString.test.d.ts +1 -0
  13. package/dist/components/UploadFile/utils/getTypePropForInputEl/getTypePropForInputEl.d.ts +24 -0
  14. package/dist/components/UploadFile/utils/getTypePropForInputEl/getTypePropForInputEl.test.d.ts +1 -0
  15. package/dist/components/UploadFile/utils/getValidTypesString/getValidTypesString.d.ts +25 -0
  16. package/dist/components/UploadFile/utils/getValidTypesString/getValidTypesString.test.d.ts +1 -0
  17. package/dist/components/UploadFile/utils/index.d.ts +4 -0
  18. package/dist/components/UploadFile/utils/setInputElFile/setInputElFile.d.ts +13 -0
  19. package/dist/components/UploadFile/utils/setInputElFile/setInputElFile.test.d.ts +1 -0
  20. package/dist/components/index.d.ts +1 -0
  21. package/dist/index.esm.js +1 -1
  22. package/dist/index.esm.js.map +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { UploadFileProps } from './types';
3
+ export declare const UploadFile: React.ForwardRefExoticComponent<UploadFileProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const UploadGraphic: () => React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type UploadedFileProps = {
3
+ label: string;
4
+ acceptedTypesCopy: string;
5
+ maxSizeCopy: string;
6
+ };
7
+ export declare const UploadCopy: ({ label, acceptedTypesCopy, maxSizeCopy }: UploadedFileProps) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ type UploadedFileProps = {
3
+ file: File;
4
+ label: string;
5
+ fileSizeCopy: string;
6
+ acceptedTypesCopy?: string;
7
+ maxSizeCopy?: string;
8
+ };
9
+ export declare const UploadedFile: ({ file, label, fileSizeCopy, acceptedTypesCopy, maxSizeCopy, }: UploadedFileProps) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const NoPointerStack: import("styled-components").StyledComponent<"div", any, import("../../Stack/types").StackProps, never>;
2
+ export declare const SingleLineText: import("styled-components").StyledComponent<"span", any, {} & import("../../Text/types").TextProps, never>;
@@ -0,0 +1,17 @@
1
+ export declare enum AcceptedFileTypes {
2
+ CSV = ".csv",
3
+ JPEG = ".jpeg",
4
+ JPG = ".jpg",
5
+ GIF = ".gif",
6
+ PNG = ".png"
7
+ }
8
+ export declare enum FileSizeUnit {
9
+ KB = "KB",
10
+ MB = "MB"
11
+ }
12
+ export declare enum InputState {
13
+ VALID = "",
14
+ INVALID_FORMAT = "File is incorrect format",
15
+ INVALID_SIZE = "File size is too big",
16
+ INVALID_FORMAT_AND_SIZE = "File is incorrect format and too big"
17
+ }
@@ -0,0 +1,2 @@
1
+ export { UploadFile } from './UploadFile';
2
+ export { AcceptedFileTypes, FileSizeUnit } from './constants';
@@ -0,0 +1 @@
1
+ export declare const DropZoneLabel: import("styled-components").StyledComponent<"label", any, {}, never>;
@@ -0,0 +1,9 @@
1
+ import { AcceptedFileTypes, FileSizeUnit } from './constants';
2
+ export interface UploadFileProps {
3
+ id: string;
4
+ name?: string;
5
+ fileTypes: Array<AcceptedFileTypes>;
6
+ label?: string;
7
+ format?: FileSizeUnit;
8
+ maxBytes?: number;
9
+ }
@@ -0,0 +1,24 @@
1
+ import { FileSizeUnit } from '../../constants';
2
+ type GetFileSizeStringProps = {
3
+ maxBytes: number;
4
+ format: FileSizeUnit;
5
+ baseString?: string;
6
+ };
7
+ /**
8
+ * Constructs a string intended to be consumed by an <input> element of type "file". This string
9
+ * should go inside the accept property
10
+ *
11
+ * E.g.
12
+ *
13
+ * const maxSizeCopy = getFileSizeString({
14
+ * maxBytes: 10000,
15
+ * format: FileSizeUnit.MB
16
+ * });
17
+ *
18
+ * Where @constant maxSizeCopy would equal "Max size: 1 MB"
19
+ *
20
+ * @param fileTypes - A list of file types, each value being of @type AcceptedFileTypes
21
+ * the returned string
22
+ */
23
+ export declare const getFileSizeString: ({ maxBytes, format, baseString }: GetFileSizeStringProps) => string;
24
+ export {};
@@ -0,0 +1,24 @@
1
+ import { AcceptedFileTypes } from '../../constants';
2
+ type GetValidTypesStringProps = {
3
+ fileTypes: Array<AcceptedFileTypes>;
4
+ baseString?: string;
5
+ };
6
+ /**
7
+ * Constructs a string intended to be consumed by an <input> element of type "file". This string
8
+ * should go inside the accept property.
9
+ *
10
+ * E.g.
11
+ *
12
+ * const inputElAcceptProperty = getTypePropForInputEl({
13
+ * fileTypes: [
14
+ * AcceptedFileTypes.CSV,
15
+ * ]
16
+ * });
17
+ *
18
+ * Where @constant inputElAcceptProperty would equal ".csv"
19
+ *
20
+ * @param fileTypes - A list of file types, each value being of @type AcceptedFileTypes
21
+ * the returned string
22
+ */
23
+ export declare const getTypePropForInputEl: ({ fileTypes }: GetValidTypesStringProps) => string;
24
+ export {};
@@ -0,0 +1,25 @@
1
+ import { AcceptedFileTypes } from '../../constants';
2
+ type GetValidTypesStringProps = {
3
+ fileTypes: Array<AcceptedFileTypes>;
4
+ baseString?: string;
5
+ };
6
+ /**
7
+ * Constructs a user-friendly string of accepted types valid for the UploadFile component based on the
8
+ * fileTypes list passed as parameter.
9
+ *
10
+ * E.g.
11
+ *
12
+ * const validTypesCopy = getValidTypesString({
13
+ * fileTypes: [
14
+ * AcceptedFileTypes.CSV,
15
+ * ]
16
+ * });
17
+ *
18
+ * Where @constant validTypesCopy would equal "Valid types: CSV"
19
+ *
20
+ * @param fileTypes - A list of file types, each value being of @type AcceptedFileTypes
21
+ * @param baseString - An optional string to override the default value of 'Valid types: ' prefixed to
22
+ * the returned string
23
+ */
24
+ export declare const getValidTypesString: ({ fileTypes, baseString }: GetValidTypesStringProps) => string;
25
+ export {};
@@ -0,0 +1,4 @@
1
+ export { getValidTypesString } from './getValidTypesString/getValidTypesString';
2
+ export { getFileSizeString } from './getFileSizeString/getFileSizeString';
3
+ export { getTypePropForInputEl } from './getTypePropForInputEl/getTypePropForInputEl';
4
+ export { setInputElFile } from './setInputElFile/setInputElFile';
@@ -0,0 +1,13 @@
1
+ type SetInputElFileProps = {
2
+ fileList: FileList;
3
+ elementId: string;
4
+ };
5
+ /**
6
+ * Updates the value of the files attribute held within an input elment. Used during DnD operations where
7
+ * the input element's files need to kept in sync and updated.
8
+ *
9
+ * @param fileList - A list of files, typically extracted from the "files" attribute of an input element
10
+ * @param elementId - The ID of the input element
11
+ */
12
+ export declare const setInputElFile: ({ fileList, elementId }: SetInputElFileProps) => void;
13
+ export {};
@@ -47,6 +47,7 @@ export { ToastsLayout } from './ToastsLayout';
47
47
  export { Toggle } from './Toggle';
48
48
  export { ToggleButton } from './ToggleButton';
49
49
  export { Tooltip } from './Tooltip';
50
+ export { UploadFile, AcceptedFileTypes, FileSizeUnit } from './UploadFile';
50
51
  export { VideoModal, Popup } from './VideoModal';
51
52
  export { View } from './View';
52
53
  export { WeightInput } from './WeightInput';