@digital-ai/dot-components 1.11.2 → 1.13.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.
- package/CHANGE_LOG.md +64 -2
- package/fonts/dot.woff +0 -0
- package/fonts/selection.json +479 -249
- package/index.esm.js +489 -289
- package/index.umd.js +729 -459
- package/lib/components/button-toggle/ButtonToggle.d.ts +1 -10
- package/lib/components/button-toggle/index.d.ts +3 -1
- package/lib/components/button-toggle/utils/models.d.ts +12 -0
- package/lib/components/draggable-list/DraggableList.d.ts +16 -0
- package/lib/components/draggable-list/DraggableList.stories.data.d.ts +15 -0
- package/lib/components/draggable-list/DraggableList.stories.styles.d.ts +4 -0
- package/lib/components/draggable-list/DraggableList.styles.d.ts +3 -0
- package/lib/components/draggable-list/index.d.ts +2 -0
- package/lib/components/draggable-list/utils/helpers.d.ts +4 -0
- package/lib/components/draggable-list/utils/models.d.ts +5 -0
- package/lib/components/helpers.d.ts +4 -0
- package/lib/components/index.d.ts +11 -5
- package/lib/components/inline-edit/InlineEdit.d.ts +12 -19
- package/lib/components/inline-edit/InlineEdit.styles.d.ts +11 -1
- package/lib/components/inline-edit/index.d.ts +3 -0
- package/lib/components/inline-edit/utils/helpers.d.ts +3 -0
- package/lib/components/inline-edit/utils/models.d.ts +5 -0
- package/lib/components/input-form-fields/InputFormFields.propTypes.d.ts +3 -1
- package/lib/components/input-form-fields/InputText.d.ts +1 -1
- package/lib/components/list/utils/models.d.ts +1 -1
- package/lib/components/progress/index.d.ts +2 -0
- package/lib/components/snackbar/Snackbar.d.ts +5 -1
- package/lib/components/snackbar/index.d.ts +4 -0
- package/lib/components/truncate-with-tooltip/TruncateWithTooltip.d.ts +8 -0
- package/lib/components/truncate-with-tooltip/TruncateWithTooltip.styles.d.ts +3 -0
- package/lib/components/truncate-with-tooltip/index.d.ts +2 -0
- package/lib/components/truncate-with-tooltip/utils/helpers.d.ts +2 -0
- package/package.json +2 -1
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
|
-
|
|
4
|
-
export declare type ButtonToggleOrientation = 'horizontal' | 'vertical';
|
|
5
|
-
export declare type ButtonToggleValue = string | number | boolean;
|
|
6
|
-
export interface ButtonToggleOption extends CommonProps {
|
|
7
|
-
ariaLabel: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
iconId?: string;
|
|
10
|
-
text?: string;
|
|
11
|
-
value: ButtonToggleValue;
|
|
12
|
-
}
|
|
3
|
+
import { ButtonToggleOption, ButtonToggleOrientation, ButtonToggleSize, ButtonToggleValue } from './utils/models';
|
|
13
4
|
export interface ButtonToggleProps extends CommonProps {
|
|
14
5
|
/** button props for each toggle button options*/
|
|
15
6
|
buttonOptions: ButtonToggleOption[];
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { ButtonToggleOrientation, ButtonToggleOption, ButtonToggleSingleValue, ButtonToggleSize, ButtonToggleValue, } from './utils/models';
|
|
2
|
+
export type { ButtonToggleProps } from './ButtonToggle';
|
|
3
|
+
export { DotButtonToggle } from './ButtonToggle';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CommonProps } from '../../CommonProps';
|
|
2
|
+
export declare type ButtonToggleSingleValue = string | number | boolean;
|
|
3
|
+
export declare type ButtonToggleSize = 'small' | 'medium' | 'large';
|
|
4
|
+
export declare type ButtonToggleOrientation = 'horizontal' | 'vertical';
|
|
5
|
+
export declare type ButtonToggleValue = ButtonToggleSingleValue | Array<ButtonToggleSingleValue>;
|
|
6
|
+
export interface ButtonToggleOption extends CommonProps {
|
|
7
|
+
ariaLabel: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
iconId?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
value: ButtonToggleValue;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps } from '../CommonProps';
|
|
3
|
+
import { DraggableItem, DraggableListChangeHandler } from './utils/models';
|
|
4
|
+
export declare const DEFAULT_LIST_WIDTH = 240;
|
|
5
|
+
export declare const DEFAULT_LIST_ITEM_HEIGHT = 36;
|
|
6
|
+
export interface DraggableListProps extends CommonProps {
|
|
7
|
+
/** Array of draggable list items displayed */
|
|
8
|
+
items: DraggableItem[];
|
|
9
|
+
/** Callback function which gets executed when the list changes */
|
|
10
|
+
onChange?: DraggableListChangeHandler;
|
|
11
|
+
/** Height of the list item in pixels, defaults to 36px */
|
|
12
|
+
rowHeight?: number;
|
|
13
|
+
/** Width of the draggable list, defaults to 240px */
|
|
14
|
+
width?: number | string;
|
|
15
|
+
}
|
|
16
|
+
export declare const DotDraggableList: ({ ariaLabel, className, "data-testid": dataTestId, items, onChange, width, rowHeight, }: DraggableListProps) => JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DraggableItem } from './';
|
|
3
|
+
export interface DraggableListWithAvatarArgs {
|
|
4
|
+
primaryText: string;
|
|
5
|
+
secondaryText: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DraggableListWithIconsArgs {
|
|
8
|
+
id: string;
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const DraggableListWithAvatar: ({ primaryText, secondaryText, }: DraggableListWithAvatarArgs) => JSX.Element;
|
|
12
|
+
export declare const DraggableListWithIcons: ({ id, text, }: DraggableListWithIconsArgs) => JSX.Element;
|
|
13
|
+
export declare const draggableListItems: DraggableItem[];
|
|
14
|
+
export declare const draggableListWithAvatar: DraggableItem[];
|
|
15
|
+
export declare const draggableListWithIcons: DraggableItem[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const withIconsClassName = "dot-draggable-list-with-icons";
|
|
2
|
+
export declare const withAvatarClassName = "dot-draggable-list-with-avatar";
|
|
3
|
+
export declare const StyledDraggableListWithAvatar: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const StyledDraggableListWithIcons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Layout } from 'react-grid-layout';
|
|
2
|
+
import { DraggableItem } from './models';
|
|
3
|
+
export declare const getOrderedListItems: (layout: Layout[], listItems: DraggableItem[]) => DraggableItem[];
|
|
4
|
+
export declare const getListItemLayout: (listItems: DraggableItem[]) => Layout[];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TypographyVariant } from './typography/Typography';
|
|
1
3
|
import { AvatarColor } from './avatar/Avatar';
|
|
2
4
|
export declare const calculateNumberFromText: (text: string) => number;
|
|
5
|
+
export declare const calculateWidth: (width: number | string) => string | undefined;
|
|
3
6
|
export declare const getAvatarColorForInputText: (value: string) => AvatarColor;
|
|
4
7
|
export declare const isString: (str: unknown) => boolean;
|
|
5
8
|
export declare const isNumber: (num: unknown) => boolean;
|
|
9
|
+
export declare const renderNodeOrTypography: (content: string | ReactNode, typographyVariant?: TypographyVariant) => ReactNode;
|
|
@@ -3,7 +3,7 @@ export type { AutoCompleteOption, AutoCompleteProps, AutoCompleteValue, Autocomp
|
|
|
3
3
|
export type { AvatarProps } from './avatar/Avatar';
|
|
4
4
|
export type { BreadcrumbItem } from './breadcrumbs/Breadcrumbs';
|
|
5
5
|
export type { ButtonProps } from './button/Button';
|
|
6
|
-
export type { ButtonToggleProps, ButtonToggleValue, ButtonToggleOption, ButtonToggleOrientation, ButtonToggleSize, } from './button-toggle';
|
|
6
|
+
export type { ButtonToggleProps, ButtonToggleValue, ButtonToggleOption, ButtonToggleOrientation, ButtonToggleSingleValue, ButtonToggleSize, } from './button-toggle';
|
|
7
7
|
export type { CheckboxProps } from './checkbox/Checkbox';
|
|
8
8
|
export type { CheckboxGroupProps } from './checkbox/CheckboxGroup';
|
|
9
9
|
export type { SubmitButtonProps } from './dialog/Dialog';
|
|
@@ -27,6 +27,11 @@ export type { ProgressButtonProps } from './progress-button/ProgressButton';
|
|
|
27
27
|
export type { PopperPlacementType } from './popper';
|
|
28
28
|
export type { DividerOrientation, DividerProps, DividerVariant, } from './divider';
|
|
29
29
|
export type { BadgeProps, BadgeOverlap, BadgeVariant } from './badge';
|
|
30
|
+
export type { TruncateWithTooltipProps } from './truncate-with-tooltip';
|
|
31
|
+
export type { DraggableItem, DraggableListChangeHandler, } from './draggable-list';
|
|
32
|
+
export type { SnackbarProps, SnackbarSeverity, SnackbarOrigin, } from './snackbar';
|
|
33
|
+
export type { CharactersLimit, InlineEditProps } from './inline-edit';
|
|
34
|
+
export type { progressColorOptions, progressVariantOptions, ProgressProps, } from './progress';
|
|
30
35
|
export { DotAccordion } from './accordion/Accordion';
|
|
31
36
|
export { DotActionToolbar } from './action-toolbar/ActionToolbar';
|
|
32
37
|
export { DotAlertBanner } from './alert-banner/AlertBanner';
|
|
@@ -58,7 +63,7 @@ export { DotFormGroup } from './form-group/FormGroup';
|
|
|
58
63
|
export { DotDynamicForm } from './dynamic-form/DynamicForm';
|
|
59
64
|
export { DotIcon } from './icon/Icon';
|
|
60
65
|
export { DotIconButton } from './button/IconButton';
|
|
61
|
-
export { DotInlineEdit } from './inline-edit
|
|
66
|
+
export { DotInlineEdit } from './inline-edit';
|
|
62
67
|
export { DotInputText } from './input-form-fields/InputText';
|
|
63
68
|
export { DotInputSelect } from './input-form-fields/InputSelect';
|
|
64
69
|
export { DotLink } from './link/Link';
|
|
@@ -66,13 +71,12 @@ export { DotList } from './list';
|
|
|
66
71
|
export { DotMenu } from './menu/Menu';
|
|
67
72
|
export { DotNavigationRail } from './navigation-rail/NavigationRail';
|
|
68
73
|
export { DotPill } from './pill/Pill';
|
|
69
|
-
export { DotProgress } from './progress
|
|
74
|
+
export { DotProgress } from './progress';
|
|
70
75
|
export { DotRadioButton } from './radio/RadioButton';
|
|
71
76
|
export { DotRadioGroup } from './radio/RadioGroup';
|
|
72
77
|
export { DotSidebar } from './sidebar/Sidebar';
|
|
73
78
|
export { DotSkeleton } from './skeleton/Skeleton';
|
|
74
|
-
export { DotSnackbar } from './snackbar
|
|
75
|
-
export { DotSnackbarContainer, DotSnackbarProvider, useDotSnackbarContext, } from './snackbar/SnackbarProvider';
|
|
79
|
+
export { DotSnackbar, DotSnackbarContainer, DotSnackbarProvider, useDotSnackbarContext, } from './snackbar';
|
|
76
80
|
export { DotSplitButton } from './split-button/SplitButton';
|
|
77
81
|
export { DotProgressButton } from './progress-button/ProgressButton';
|
|
78
82
|
export { DotSwitch } from './switch/Switch';
|
|
@@ -83,3 +87,5 @@ export { DotTypography } from './typography/Typography';
|
|
|
83
87
|
export { DotFileUpload } from './file-upload/FileUpload';
|
|
84
88
|
export { DotDivider } from './divider';
|
|
85
89
|
export { DotPopper } from './popper';
|
|
90
|
+
export { DotTruncateWithTooltip } from './truncate-with-tooltip';
|
|
91
|
+
export { DotDraggableList } from './draggable-list';
|
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
|
-
import {
|
|
3
|
+
import { TypographyVariant } from '../typography/Typography';
|
|
4
|
+
import { CharactersLimit } from './utils/models';
|
|
4
5
|
export interface InlineEditProps extends CommonProps {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
/** If true, the input will be disabled */
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
/** If true, the label will be displayed in an error state. */
|
|
10
|
-
error?: boolean;
|
|
6
|
+
/** Characters limit configuration object */
|
|
7
|
+
charactersLimit?: CharactersLimit;
|
|
11
8
|
/** If true, the input will take up the full width of its container */
|
|
12
9
|
fullWidth?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
|
|
10
|
+
/** If true, `Cancel` and `Save` buttons will be hidden */
|
|
11
|
+
hideActionButtons?: boolean;
|
|
15
12
|
/** The name of input element */
|
|
16
13
|
name: string;
|
|
17
|
-
/**
|
|
18
|
-
onChange
|
|
14
|
+
/** An async function which should be executed when the value of the input changes */
|
|
15
|
+
onChange: (value: string) => Promise<boolean>;
|
|
19
16
|
/** A function that informs the parent of current editing state */
|
|
20
17
|
onEditStateChange?: (editing: boolean) => void;
|
|
21
|
-
/**
|
|
22
|
-
onLabelChange?: (name: string) => Promise<string | null>;
|
|
23
|
-
/** If true, the input will be read-only. */
|
|
18
|
+
/** If true, component will behave like a regular text (editing functionality will be disabled). */
|
|
24
19
|
readOnly?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
/** Size of the input */
|
|
28
|
-
size?: inputSizeOptions;
|
|
20
|
+
/** Typography variant to be used */
|
|
21
|
+
typography?: TypographyVariant;
|
|
29
22
|
/** default value that is displayed on load */
|
|
30
23
|
value?: string;
|
|
31
24
|
}
|
|
32
25
|
/**
|
|
33
26
|
* @experimental This component is still in development
|
|
34
27
|
*/
|
|
35
|
-
export declare const DotInlineEdit: ({ ariaLabel,
|
|
28
|
+
export declare const DotInlineEdit: ({ ariaLabel, charactersLimit, className, "data-testid": dataTestId, fullWidth, hideActionButtons, name, onChange, onEditStateChange, readOnly, typography, value, }: InlineEditProps) => JSX.Element;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
import { TypographyVariant } from '../typography/Typography';
|
|
1
2
|
export declare const rootClassName = "dot-inline-edit";
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const editModeClassName = "dot-edit-mode";
|
|
4
|
+
export declare const viewModeClassName = "dot-view-mode";
|
|
5
|
+
export declare const readOnlyClassName = "dot-read-only";
|
|
6
|
+
export declare const editActionsClassName = "dot-edit-actions";
|
|
7
|
+
export declare const editTextFieldClassName = "dot-edit-text-field";
|
|
8
|
+
export interface StyledInlineEditProps {
|
|
9
|
+
fullWidth: boolean;
|
|
10
|
+
typography?: TypographyVariant;
|
|
11
|
+
}
|
|
12
|
+
export declare const StyledInlineEdit: import("styled-components").StyledComponent<"div", any, StyledInlineEditProps, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEvent, ReactNode, Ref
|
|
1
|
+
import { ChangeEvent, KeyboardEvent, MouseEvent, ReactNode, Ref } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
export declare type inputSizeOptions = 'small' | 'medium';
|
|
4
4
|
export interface InputProps extends CommonProps {
|
|
@@ -35,6 +35,8 @@ export interface InputProps extends CommonProps {
|
|
|
35
35
|
onFocus?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
36
36
|
/** A function that should be executed when key is pressed */
|
|
37
37
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
38
|
+
/** A function that executes when a user releases a mouse button over an element. */
|
|
39
|
+
onMouseUp?: (event: MouseEvent) => void;
|
|
38
40
|
/** If true, the label is displayed as required and the input element` will be required. */
|
|
39
41
|
required?: boolean;
|
|
40
42
|
/** Size of the input */
|
|
@@ -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, onKeyDown, 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, onMouseUp, placeholder, readOnly, required, rows, rowsMax, startIcon, size, type, value, warning, }: InputTextProps) => JSX.Element;
|
|
@@ -50,7 +50,7 @@ export interface ListItemProps extends CommonProps {
|
|
|
50
50
|
/** Event callback */
|
|
51
51
|
onClick?: (event: MouseEvent) => void;
|
|
52
52
|
/** Menu leave event callback */
|
|
53
|
-
onMenuLeave?: () => void;
|
|
53
|
+
onMenuLeave?: (event: MouseEvent | KeyboardEvent) => void;
|
|
54
54
|
/** The main content element */
|
|
55
55
|
primaryText?: string;
|
|
56
56
|
/** The secondary content element */
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
|
+
import { SnackbarOrigin } from './';
|
|
3
4
|
export declare type SnackbarSeverity = 'error' | 'warning' | 'info' | 'success';
|
|
4
5
|
export interface SnackbarProps extends CommonProps {
|
|
5
6
|
/** Property used for creating a custom action button. */
|
|
6
7
|
action?: ReactNode;
|
|
8
|
+
/** The anchor of the Snackbar. On smaller screens, the component grows to occupy all the available width, the horizontal alignment is ignored. */
|
|
9
|
+
anchorOrigin?: SnackbarOrigin;
|
|
7
10
|
/** The message the user sees once the alert displays */
|
|
8
11
|
children: ReactNode;
|
|
9
12
|
/** A callback to handle closing the alert. */
|
|
@@ -12,6 +15,7 @@ export interface SnackbarProps extends CommonProps {
|
|
|
12
15
|
open: boolean;
|
|
13
16
|
/** An alert level, indicating the importance of the message. */
|
|
14
17
|
severity: SnackbarSeverity;
|
|
18
|
+
/** Width of the encapsulated Alert component */
|
|
15
19
|
width?: string;
|
|
16
20
|
}
|
|
17
|
-
export declare const DotSnackbar: ({ action, ariaLabel, children, className, "data-testid": dataTestId, onClose, open, severity, width, }: SnackbarProps) => JSX.Element;
|
|
21
|
+
export declare const DotSnackbar: ({ action, anchorOrigin, ariaLabel, children, className, "data-testid": dataTestId, onClose, open, severity, width, }: SnackbarProps) => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { SnackbarOrigin } from '@material-ui/core';
|
|
2
|
+
export type { SnackbarProps, SnackbarSeverity } from './Snackbar';
|
|
3
|
+
export { DotSnackbar } from './Snackbar';
|
|
4
|
+
export { DotSnackbarContainer, DotSnackbarProvider, useDotSnackbarContext, } from './SnackbarProvider';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps } from '../CommonProps';
|
|
3
|
+
export interface TruncateWithTooltipProps extends CommonProps {
|
|
4
|
+
charactersLimit?: number;
|
|
5
|
+
label: string;
|
|
6
|
+
width?: number | string;
|
|
7
|
+
}
|
|
8
|
+
export declare const DotTruncateWithTooltip: ({ ariaLabel, charactersLimit, className, "data-testid": dataTestId, label, width, }: TruncateWithTooltipProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-ai/dot-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE.md>",
|
|
6
6
|
"contributors": [
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@material-ui/lab": "4.0.0-alpha.56",
|
|
30
30
|
"@material-ui/core": "4.12.3",
|
|
31
31
|
"react-dropzone": "^11.4.2",
|
|
32
|
+
"react-grid-layout": "^1.3.4",
|
|
32
33
|
"styled-components": "^5.2.1"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|