@elliemae/ds-button-v1 3.17.0-next.2 → 3.17.0-next.21
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/dist/types/DSButton.d.ts +68 -0
- package/dist/types/constants.d.ts +26 -0
- package/dist/types/defaultProps.d.ts +15 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/propTypes.d.ts +84 -0
- package/dist/types/tests/DSButton.events.test.d.ts +1 -0
- package/dist/types/tests/DSButton.test.d.ts +1 -0
- package/package.json +9 -11
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BUTTON_TYPE, BUTTON_SIZE, BUTTON_VARIANT } from './constants.js';
|
|
3
|
+
interface ButtonPropsT {
|
|
4
|
+
[x: string]: unknown;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
fluidWidth?: boolean;
|
|
7
|
+
innerRef?: unknown;
|
|
8
|
+
buttonType?: (typeof BUTTON_TYPE)[keyof typeof BUTTON_TYPE];
|
|
9
|
+
size?: (typeof BUTTON_SIZE)[keyof typeof BUTTON_SIZE];
|
|
10
|
+
variant?: (typeof BUTTON_VARIANT)[keyof typeof BUTTON_VARIANT];
|
|
11
|
+
labelText?: string;
|
|
12
|
+
icon?: JSX.Element;
|
|
13
|
+
leftIcon?: JSX.Element;
|
|
14
|
+
tabIndex?: number;
|
|
15
|
+
intent?: 'success' | 'danger' | 'warning' | 'info';
|
|
16
|
+
containerProps?: {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
className?: string;
|
|
20
|
+
as?: string | JSX.Element;
|
|
21
|
+
type?: 'button' | 'text';
|
|
22
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
23
|
+
onClick?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
|
|
24
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLElement>;
|
|
25
|
+
}
|
|
26
|
+
declare const DSButton: {
|
|
27
|
+
({ innerRef, disabled, buttonType, fluidWidth, size, labelText, icon, onBlur, onClick, onKeyPress, leftIcon, tabIndex, variant, intent, containerProps, className, as: Component, type, ...rest }: ButtonPropsT): import("react/jsx-runtime.js").JSX.Element;
|
|
28
|
+
defaultProps: {
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
fluidWidth: boolean;
|
|
31
|
+
labelText: string;
|
|
32
|
+
icon: null;
|
|
33
|
+
onBlur: () => null;
|
|
34
|
+
onClick: () => null;
|
|
35
|
+
onKeyPress: () => null;
|
|
36
|
+
leftIcon: null;
|
|
37
|
+
tabIndex: number;
|
|
38
|
+
variant: "variant-default";
|
|
39
|
+
containerProps: {};
|
|
40
|
+
as: string;
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
propTypes: {
|
|
44
|
+
tabIndex: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
45
|
+
className: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
46
|
+
'aria-disabled': import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
47
|
+
as: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
48
|
+
disabled: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
49
|
+
fluidWidth: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
50
|
+
labelText: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
51
|
+
icon: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
52
|
+
leftIcon: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
53
|
+
buttonType: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
54
|
+
size: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
55
|
+
type: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
56
|
+
variant: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
57
|
+
innerRef: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
58
|
+
onBlur: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
59
|
+
intent: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
60
|
+
containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
61
|
+
onClick: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
62
|
+
onKeyPress: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
63
|
+
};
|
|
64
|
+
displayName: string;
|
|
65
|
+
};
|
|
66
|
+
declare const DSButtonWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<ButtonPropsT>;
|
|
67
|
+
export { DSButton, DSButtonWithSchema };
|
|
68
|
+
export default DSButton;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const BUTTON_TYPE: {
|
|
2
|
+
PRIMARY: "primary";
|
|
3
|
+
SECONDARY: "secondary";
|
|
4
|
+
TEXT: "text";
|
|
5
|
+
LINK: "link";
|
|
6
|
+
};
|
|
7
|
+
export declare const buttonTypes: readonly ["primary", "secondary", "text", "link"];
|
|
8
|
+
export declare const BUTTON_SIZE: {
|
|
9
|
+
S: "s";
|
|
10
|
+
M: "m";
|
|
11
|
+
L: "l";
|
|
12
|
+
};
|
|
13
|
+
export declare const BUTTON_INTENT: {
|
|
14
|
+
DANGER: "danger";
|
|
15
|
+
SUCCESS: "success";
|
|
16
|
+
WARNING: "warning";
|
|
17
|
+
INFO: "info";
|
|
18
|
+
};
|
|
19
|
+
export declare const BUTTON_VARIANT: {
|
|
20
|
+
DEFAULT: "variant-default";
|
|
21
|
+
FOCUS: "variant-focus";
|
|
22
|
+
ACTIVE: "variant-active";
|
|
23
|
+
DISABLED: "variant-disabled";
|
|
24
|
+
HOVER: "variant-hover";
|
|
25
|
+
};
|
|
26
|
+
export declare const buttonVariants: readonly ["variant-default", "variant-focus", "variant-active", "variant-disabled", "variant-hover"];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const defaultProps: {
|
|
2
|
+
disabled: boolean;
|
|
3
|
+
fluidWidth: boolean;
|
|
4
|
+
labelText: string;
|
|
5
|
+
icon: null;
|
|
6
|
+
onBlur: () => null;
|
|
7
|
+
onClick: () => null;
|
|
8
|
+
onKeyPress: () => null;
|
|
9
|
+
leftIcon: null;
|
|
10
|
+
tabIndex: number;
|
|
11
|
+
variant: "variant-default";
|
|
12
|
+
containerProps: {};
|
|
13
|
+
as: string;
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export declare const btnPropTypes: {
|
|
2
|
+
/**
|
|
3
|
+
* Tab index
|
|
4
|
+
*/
|
|
5
|
+
tabIndex: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
6
|
+
/**
|
|
7
|
+
* Additional className
|
|
8
|
+
*/
|
|
9
|
+
className: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
10
|
+
/**
|
|
11
|
+
* aria disabled
|
|
12
|
+
*/
|
|
13
|
+
'aria-disabled': import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
14
|
+
/**
|
|
15
|
+
* Html tag. default 'button'
|
|
16
|
+
*/
|
|
17
|
+
as: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the button is disabled or not
|
|
20
|
+
*/
|
|
21
|
+
disabled: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
22
|
+
/**
|
|
23
|
+
* Make the content of the button fit the button container or not
|
|
24
|
+
*/
|
|
25
|
+
fluidWidth: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
26
|
+
/**
|
|
27
|
+
* Displayable label inside the button
|
|
28
|
+
*/
|
|
29
|
+
labelText: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
30
|
+
/**
|
|
31
|
+
* Put an icon inside the button
|
|
32
|
+
*/
|
|
33
|
+
icon: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
34
|
+
/**
|
|
35
|
+
* Put an icon on the left side of the button
|
|
36
|
+
*/
|
|
37
|
+
leftIcon: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
38
|
+
/**
|
|
39
|
+
* ['primary', 'secondary', 'text', 'link']
|
|
40
|
+
*/
|
|
41
|
+
buttonType: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
42
|
+
/**
|
|
43
|
+
* ['s', 'm', 'l']
|
|
44
|
+
*/
|
|
45
|
+
size: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
46
|
+
/**
|
|
47
|
+
* submit or button
|
|
48
|
+
*/
|
|
49
|
+
type: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
50
|
+
/**
|
|
51
|
+
* [
|
|
52
|
+
* 'variant-default',
|
|
53
|
+
* 'variant-focus',
|
|
54
|
+
* 'variant-active',
|
|
55
|
+
* 'variant-disabled',
|
|
56
|
+
* ]
|
|
57
|
+
*/
|
|
58
|
+
variant: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
59
|
+
/**
|
|
60
|
+
* Refence
|
|
61
|
+
*/
|
|
62
|
+
innerRef: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
63
|
+
/**
|
|
64
|
+
* Onblur callback
|
|
65
|
+
*/
|
|
66
|
+
onBlur: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
67
|
+
/**
|
|
68
|
+
* Apply intent color: ['success', 'warning', 'danger', 'info']
|
|
69
|
+
* Only valid with buttonType="text"
|
|
70
|
+
*/
|
|
71
|
+
intent: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
72
|
+
/**
|
|
73
|
+
* additional props for the container
|
|
74
|
+
*/
|
|
75
|
+
containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
76
|
+
/**
|
|
77
|
+
* Allows a function that is triggered once the button is clicked
|
|
78
|
+
*/
|
|
79
|
+
onClick: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
80
|
+
/**
|
|
81
|
+
* Allows a function that is triggered once the button is key pressed
|
|
82
|
+
*/
|
|
83
|
+
onKeyPress: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
|
|
84
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-button-v1",
|
|
3
|
-
"version": "3.17.0-next.
|
|
3
|
+
"version": "3.17.0-next.21",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Button V 1",
|
|
6
6
|
"files": [
|
|
@@ -51,20 +51,18 @@
|
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-classnames": "3.17.0-next.
|
|
55
|
-
"@elliemae/ds-props-helpers": "3.17.0-next.
|
|
56
|
-
"@elliemae/ds-
|
|
57
|
-
"@elliemae/ds-
|
|
54
|
+
"@elliemae/ds-classnames": "3.17.0-next.21",
|
|
55
|
+
"@elliemae/ds-props-helpers": "3.17.0-next.21",
|
|
56
|
+
"@elliemae/ds-utilities": "3.17.0-next.21",
|
|
57
|
+
"@elliemae/ds-shared": "3.17.0-next.21"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@testing-library/jest-dom": "~5.16.5",
|
|
61
|
-
"@testing-library/react": "~12.1.3"
|
|
62
|
-
"styled-components": "~5.3.9"
|
|
61
|
+
"@testing-library/react": "~12.1.3"
|
|
63
62
|
},
|
|
64
63
|
"peerDependencies": {
|
|
65
64
|
"react": "^17.0.2",
|
|
66
|
-
"react-dom": "^17.0.2"
|
|
67
|
-
"styled-components": "~5.3.6"
|
|
65
|
+
"react-dom": "^17.0.2"
|
|
68
66
|
},
|
|
69
67
|
"publishConfig": {
|
|
70
68
|
"access": "public",
|
|
@@ -74,8 +72,8 @@
|
|
|
74
72
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
75
73
|
"test": "node ../../scripts/testing/test.mjs",
|
|
76
74
|
"lint": "node ../../scripts/lint.mjs --fix",
|
|
77
|
-
"eslint:fix": "exit 0",
|
|
78
|
-
"dts": "exit 0",
|
|
75
|
+
"eslint:fix": "exit 0 | echo",
|
|
76
|
+
"dts": "exit 0 | echo",
|
|
79
77
|
"dts:withdeps": "exit 0",
|
|
80
78
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
81
79
|
"dev:build": "pnpm --filter {.}... build",
|