@digital-ai/dot-components 1.3.5 → 1.3.6
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.
- package/README.md +2 -1
- package/dot-components.esm.js +590 -356
- package/dot-components.umd.js +554 -321
- package/lib/components/accordion/Accordion.d.ts +2 -2
- package/lib/components/file-upload/FileListItem.d.ts +10 -0
- package/lib/components/file-upload/FileUpload.d.ts +20 -0
- package/lib/components/file-upload/FileUpload.styles.d.ts +6 -0
- package/lib/components/file-upload/uploadHelpers.d.ts +13 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/input-form-fields/InputFormFields.propTypes.d.ts +3 -1
- package/lib/components/input-form-fields/InputSelect.d.ts +1 -1
- package/lib/components/input-form-fields/InputText.d.ts +1 -1
- package/lib/components/list/List.d.ts +9 -2
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
export interface AccordionProps extends CommonProps {
|
|
4
4
|
/** actionable components (ex: checkbox, button) that can be nested within the expanded Accordion component */
|
|
@@ -18,6 +18,6 @@ export interface AccordionProps extends CommonProps {
|
|
|
18
18
|
/** Icon placed before the children. */
|
|
19
19
|
startIcon?: ReactNode;
|
|
20
20
|
/** The text within the expanded Accordion */
|
|
21
|
-
summary:
|
|
21
|
+
summary: ReactElement;
|
|
22
22
|
}
|
|
23
23
|
export declare const DotAccordion: ({ actions, ariaLabel, children, className, "data-testid": dataTestId, defaultExpanded, disabled, hasElevation, square, startIcon, summary, noWrap, }: AccordionProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FileWithPath } from 'react-dropzone';
|
|
3
|
+
import { CommonProps } from '../CommonProps';
|
|
4
|
+
export interface FileItemProps extends CommonProps {
|
|
5
|
+
deleteFile: (file: FileWithPath) => void;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
errorText?: string;
|
|
8
|
+
file: FileWithPath;
|
|
9
|
+
}
|
|
10
|
+
export declare const DotFileListItem: ({ ariaLabel, className, "data-testid": dataTestId, deleteFile, error, errorText, file, }: FileItemProps) => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonProps } from '../CommonProps';
|
|
3
|
+
import { MappedFile } from './uploadHelpers';
|
|
4
|
+
export interface FileUploadProps extends CommonProps {
|
|
5
|
+
/** Unique file type specifiers <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers" target="_blank">More Info</a> */
|
|
6
|
+
accept?: Array<string>;
|
|
7
|
+
/** If true, will only display the button */
|
|
8
|
+
buttonOnly?: boolean;
|
|
9
|
+
/** If true, the upload zone will be disabled */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Defines the maximum number of files that can be uploaded at once */
|
|
12
|
+
maxFiles?: number;
|
|
13
|
+
/** Defines the maximum file size (in MB) */
|
|
14
|
+
maxSize: number;
|
|
15
|
+
/** callback triggered when files are added or removed */
|
|
16
|
+
onChange: (files: Array<MappedFile>) => void;
|
|
17
|
+
/** callback triggered when dragenter event occurs */
|
|
18
|
+
onDragEnter?: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const DotFileUpload: ({ accept, ariaLabel, buttonOnly, className, "data-testid": dataTestId, disabled, maxFiles, maxSize, onChange, onDragEnter, }: FileUploadProps) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const rootClassName = "dot-file-upload";
|
|
2
|
+
export declare const containerClassName: string;
|
|
3
|
+
export declare const fileClassName: string;
|
|
4
|
+
export declare const dropZoneClassName: string;
|
|
5
|
+
export declare const StyledFileUploadContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const StyledFileUpload: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FileWithPath } from 'react-dropzone';
|
|
3
|
+
export interface MappedFile {
|
|
4
|
+
errors: Array<FileUploadError>;
|
|
5
|
+
file: FileWithPath;
|
|
6
|
+
}
|
|
7
|
+
export interface FileUploadError {
|
|
8
|
+
code: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const parseListItem: (deleteFile: (file: FileWithPath) => void, fileToBeParsed: MappedFile, maxSize: number) => {
|
|
12
|
+
child: JSX.Element;
|
|
13
|
+
};
|
|
@@ -81,3 +81,4 @@ export { DotHeaderRow } from './table/TableHeader';
|
|
|
81
81
|
export { DotTablePagination } from './table/TablePagination';
|
|
82
82
|
export { DotTabs } from './tabs/Tabs';
|
|
83
83
|
export { DotTypography } from './typography/Typography';
|
|
84
|
+
export { DotFileUpload } from './file-upload/FileUpload';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEvent, ReactNode, Ref } from 'react';
|
|
1
|
+
import { ChangeEvent, ReactNode, Ref, KeyboardEvent } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
export declare type inputSizeOptions = 'small' | 'medium';
|
|
4
4
|
export interface InputProps extends CommonProps {
|
|
@@ -33,6 +33,8 @@ export interface InputProps extends CommonProps {
|
|
|
33
33
|
onChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
34
34
|
/** A function that should be executed when the input gains focus */
|
|
35
35
|
onFocus?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
36
|
+
/** A function that should be executed when key is pressed */
|
|
37
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
36
38
|
/** If true, the label is displayed as required and the input element` will be required. */
|
|
37
39
|
required?: boolean;
|
|
38
40
|
/** Size of the input */
|
|
@@ -8,4 +8,4 @@ export interface InputSelectProps extends InputProps {
|
|
|
8
8
|
/** value of input field */
|
|
9
9
|
value?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const DotInputSelect: ({ ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, endIcon, error, fullWidth, helperText, id, inputRef, label, name, onBlur, onChange, onFocus, options, required, size, startIcon, value, warning, }: InputSelectProps) => JSX.Element;
|
|
11
|
+
export declare const DotInputSelect: ({ ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, endIcon, error, fullWidth, helperText, id, inputRef, label, name, onBlur, onChange, onFocus, onKeyDown, options, required, size, startIcon, value, warning, }: InputSelectProps) => JSX.Element;
|
|
@@ -17,4 +17,4 @@ export interface InputTextProps extends InputProps {
|
|
|
17
17
|
/** value of the InputText */
|
|
18
18
|
value?: string;
|
|
19
19
|
}
|
|
20
|
-
export declare const DotInputText: ({ autoFocus, className, defaultValue, "data-testid": dataTestId, disabled, error, fullWidth, hasDebounce, helperText, endIcon, id, inputRef, label, multiline, name, onBlur, onChange, onFocus, placeholder, readOnly, required, rows, rowsMax, startIcon, size, type, value, warning, }: InputTextProps) => JSX.Element;
|
|
20
|
+
export declare const DotInputText: ({ autoFocus, className, defaultValue, "data-testid": dataTestId, disabled, error, fullWidth, hasDebounce, helperText, endIcon, id, inputRef, label, multiline, name, onBlur, onChange, onFocus, onKeyDown, placeholder, readOnly, required, rows, rowsMax, startIcon, size, type, value, warning, }: InputTextProps) => JSX.Element;
|
|
@@ -52,10 +52,11 @@ export interface ListItemProps extends CommonProps {
|
|
|
52
52
|
endIconId?: string;
|
|
53
53
|
/** If provided, the list item will be rendered as a link */
|
|
54
54
|
href?: string;
|
|
55
|
-
/**
|
|
55
|
+
/** DEPRECATED, DO NOT USE */
|
|
56
56
|
index?: number;
|
|
57
57
|
/** If provided, the menu item will display a nested list */
|
|
58
58
|
items?: Array<ListItemProps>;
|
|
59
|
+
isOpened?: boolean;
|
|
59
60
|
/** If nested list type is 'menu', determines the placement of the menu */
|
|
60
61
|
menuPlacement?: PopperPlacement;
|
|
61
62
|
/** If nested type is 'drawer', determines the width of the left spacing */
|
|
@@ -64,6 +65,12 @@ export interface ListItemProps extends CommonProps {
|
|
|
64
65
|
nestedListType?: NestedListType;
|
|
65
66
|
/** Event callback */
|
|
66
67
|
onClick?: (event: MouseEvent) => void;
|
|
68
|
+
/** Menu leave event callback */
|
|
69
|
+
onMenuLeave?: () => void;
|
|
70
|
+
/** The main content element */
|
|
71
|
+
primaryText?: string;
|
|
72
|
+
/** The secondary content element */
|
|
73
|
+
secondaryText?: string;
|
|
67
74
|
/** Selected list item */
|
|
68
75
|
selected?: boolean;
|
|
69
76
|
/** If provided, the icon ID which is displayed on the front of the list item */
|
|
@@ -78,4 +85,4 @@ export interface ListItemProps extends CommonProps {
|
|
|
78
85
|
tooltip?: string;
|
|
79
86
|
}
|
|
80
87
|
export declare const DotList: ({ ariaLabel, children, className, component, "data-testid": dataTestId, dense, disablePadding, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, width, }: ListProps) => JSX.Element;
|
|
81
|
-
export declare const DotListItem: ({ ariaLabel, className, component, "data-testid": dataTestId, divider, endIconId, href,
|
|
88
|
+
export declare const DotListItem: ({ ariaLabel, className, component, "data-testid": dataTestId, divider, endIconId, href, isOpened, onClick, onMenuLeave, index, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIconId, target, text, title, tooltip, }: ListItemProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-ai/dot-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE.md>",
|
|
6
6
|
"contributors": [
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@material-ui/lab": "4.0.0-alpha.56",
|
|
30
30
|
"@material-ui/core": "4.12.3",
|
|
31
|
+
"react-dropzone": "^11.4.2",
|
|
31
32
|
"styled-components": "^5.2.1"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|