@elliemae/ds-button-v1 3.27.0-next.1 → 3.27.0-next.3
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/cjs/index.js +3 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +2 -2
- package/dist/types/index.d.ts +2 -3
- package/package.json +7 -26
- package/dist/cjs/DSButton.js +0 -156
- package/dist/cjs/DSButton.js.map +0 -7
- package/dist/cjs/constants.js +0 -72
- package/dist/cjs/constants.js.map +0 -7
- package/dist/cjs/defaultProps.js +0 -51
- package/dist/cjs/defaultProps.js.map +0 -7
- package/dist/cjs/propTypes.js +0 -128
- package/dist/cjs/propTypes.js.map +0 -7
- package/dist/esm/DSButton.js +0 -126
- package/dist/esm/DSButton.js.map +0 -7
- package/dist/esm/constants.js +0 -42
- package/dist/esm/constants.js.map +0 -7
- package/dist/esm/defaultProps.js +0 -21
- package/dist/esm/defaultProps.js.map +0 -7
- package/dist/esm/propTypes.js +0 -98
- package/dist/esm/propTypes.js.map +0 -7
- package/dist/types/DSButton.d.ts +0 -68
- package/dist/types/constants.d.ts +0 -26
- package/dist/types/defaultProps.d.ts +0 -15
- package/dist/types/propTypes.d.ts +0 -84
- package/dist/types/tests/DSButton.events.test.d.ts +0 -1
- package/dist/types/tests/DSButton.test.d.ts +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -29,11 +29,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
var src_exports = {};
|
|
31
31
|
__export(src_exports, {
|
|
32
|
-
default: () =>
|
|
32
|
+
default: () => import_ds_legacy_button_v1.default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(src_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
|
-
__reExport(src_exports, require("
|
|
37
|
-
|
|
38
|
-
var import_DSButton = __toESM(require("./DSButton.js"));
|
|
36
|
+
__reExport(src_exports, require("@elliemae/ds-legacy-button-v1"), module.exports);
|
|
37
|
+
var import_ds_legacy_button_v1 = __toESM(require("@elliemae/ds-legacy-button-v1"));
|
|
39
38
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,
|
|
4
|
+
"sourcesContent": ["export * from '@elliemae/ds-legacy-button-v1';\nexport { default } from '@elliemae/ds-legacy-button-v1';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,0CAAd;AACA,iCAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "
|
|
3
|
-
|
|
4
|
-
import { default as default2 } from "./DSButton.js";
|
|
2
|
+
export * from "@elliemae/ds-legacy-button-v1";
|
|
3
|
+
import { default as default2 } from "@elliemae/ds-legacy-button-v1";
|
|
5
4
|
export {
|
|
6
5
|
default2 as default
|
|
7
6
|
};
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from '
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from '@elliemae/ds-legacy-button-v1';\nexport { default } from '@elliemae/ds-legacy-button-v1';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,SAAS,WAAAA,gBAAe;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export
|
|
3
|
-
export { default } from './DSButton.js';
|
|
1
|
+
export * from '@elliemae/ds-legacy-button-v1';
|
|
2
|
+
export { default } from '@elliemae/ds-legacy-button-v1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-button-v1",
|
|
3
|
-
"version": "3.27.0-next.
|
|
3
|
+
"version": "3.27.0-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Button V 1",
|
|
6
6
|
"files": [
|
|
@@ -13,22 +13,6 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./dist/esm/index.js",
|
|
15
15
|
"require": "./dist/cjs/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./propTypes": {
|
|
18
|
-
"import": "./dist/esm/propTypes.js",
|
|
19
|
-
"require": "./dist/cjs/propTypes.js"
|
|
20
|
-
},
|
|
21
|
-
"./DSButton": {
|
|
22
|
-
"import": "./dist/esm/DSButton.js",
|
|
23
|
-
"require": "./dist/cjs/DSButton.js"
|
|
24
|
-
},
|
|
25
|
-
"./defaultProps": {
|
|
26
|
-
"import": "./dist/esm/defaultProps.js",
|
|
27
|
-
"require": "./dist/cjs/defaultProps.js"
|
|
28
|
-
},
|
|
29
|
-
"./constants": {
|
|
30
|
-
"import": "./dist/esm/constants.js",
|
|
31
|
-
"require": "./dist/cjs/constants.js"
|
|
32
16
|
}
|
|
33
17
|
},
|
|
34
18
|
"sideEffects": [
|
|
@@ -51,14 +35,11 @@
|
|
|
51
35
|
"indent": 4
|
|
52
36
|
},
|
|
53
37
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-
|
|
55
|
-
"@elliemae/ds-props-helpers": "3.27.0-next.1",
|
|
56
|
-
"@elliemae/ds-utilities": "3.27.0-next.1",
|
|
57
|
-
"@elliemae/ds-shared": "3.27.0-next.1"
|
|
38
|
+
"@elliemae/ds-legacy-button-v1": "1.0.1"
|
|
58
39
|
},
|
|
59
40
|
"devDependencies": {
|
|
60
41
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
61
|
-
"@elliemae/ds-monorepo-devops": "3.27.0-next.
|
|
42
|
+
"@elliemae/ds-monorepo-devops": "3.27.0-next.3"
|
|
62
43
|
},
|
|
63
44
|
"peerDependencies": {
|
|
64
45
|
"react": "^17.0.2",
|
|
@@ -70,14 +51,14 @@
|
|
|
70
51
|
},
|
|
71
52
|
"scripts": {
|
|
72
53
|
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
73
|
-
"test": "
|
|
74
|
-
"lint": "
|
|
54
|
+
"test": "exit 0 | echo",
|
|
55
|
+
"lint": "exit 0 | echo",
|
|
75
56
|
"eslint:fix": "exit 0 | echo",
|
|
76
57
|
"dts": "exit 0 | echo",
|
|
77
|
-
"dts:withdeps": "exit 0",
|
|
58
|
+
"dts:withdeps": "exit 0 | echo",
|
|
78
59
|
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
79
60
|
"dev:build": "pnpm --filter {.}... build",
|
|
80
61
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
81
|
-
"checkDeps": "
|
|
62
|
+
"checkDeps": "exit 0 | echo"
|
|
82
63
|
}
|
|
83
64
|
}
|
package/dist/cjs/DSButton.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var DSButton_exports = {};
|
|
30
|
-
__export(DSButton_exports, {
|
|
31
|
-
DSButton: () => DSButton,
|
|
32
|
-
DSButtonWithSchema: () => DSButtonWithSchema,
|
|
33
|
-
default: () => DSButton_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(DSButton_exports);
|
|
36
|
-
var React = __toESM(require("react"));
|
|
37
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
-
var import_react = require("react");
|
|
39
|
-
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
40
|
-
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
41
|
-
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
42
|
-
var import_constants = require("./constants.js");
|
|
43
|
-
var import_propTypes = require("./propTypes.js");
|
|
44
|
-
var import_defaultProps = require("./defaultProps.js");
|
|
45
|
-
const blockName = "button";
|
|
46
|
-
const getContainer = (Element) => (0, import_ds_classnames.aggregatedClasses)(Element)(
|
|
47
|
-
blockName,
|
|
48
|
-
null,
|
|
49
|
-
({ iconOnly, variant }) => ({
|
|
50
|
-
"icon-only": iconOnly,
|
|
51
|
-
[variant]: variant
|
|
52
|
-
}),
|
|
53
|
-
{
|
|
54
|
-
propsToRemoveFromFinalElement: ["cx"]
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
const DSButton = ({
|
|
58
|
-
innerRef,
|
|
59
|
-
disabled,
|
|
60
|
-
buttonType,
|
|
61
|
-
fluidWidth,
|
|
62
|
-
size,
|
|
63
|
-
labelText,
|
|
64
|
-
icon,
|
|
65
|
-
onBlur,
|
|
66
|
-
onClick,
|
|
67
|
-
onKeyPress,
|
|
68
|
-
leftIcon,
|
|
69
|
-
tabIndex,
|
|
70
|
-
variant,
|
|
71
|
-
intent,
|
|
72
|
-
containerProps,
|
|
73
|
-
className,
|
|
74
|
-
as: Component,
|
|
75
|
-
type,
|
|
76
|
-
...rest
|
|
77
|
-
}) => {
|
|
78
|
-
(0, import_ds_utilities.useDeprecateComponent)({ componentName: "ds-button-v1", version: "TBD Date: 2023 Q3" });
|
|
79
|
-
const [pressed, setPressed] = (0, import_react.useState)(false);
|
|
80
|
-
const Button = (0, import_react.useMemo)(() => getContainer(Component), [Component]);
|
|
81
|
-
const intentBlockName = `${blockName}${intent ? `-${intent}` : ""}`;
|
|
82
|
-
const { cssClassName: intentClassName } = (0, import_ds_classnames.convertPropToCssClassName)(intentBlockName);
|
|
83
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
84
|
-
Button,
|
|
85
|
-
{
|
|
86
|
-
"data-testid": containerProps && containerProps["data-testid"] || "button-wrapper",
|
|
87
|
-
...rest,
|
|
88
|
-
...containerProps,
|
|
89
|
-
"aria-disabled": rest["aria-disabled"] !== void 0 ? rest["aria-disabled"] : disabled,
|
|
90
|
-
"aria-label": rest["aria-label"] || labelText || "button",
|
|
91
|
-
"aria-pressed": pressed,
|
|
92
|
-
className: (0, import_ds_utilities.cx)(intentClassName, className),
|
|
93
|
-
classProps: {
|
|
94
|
-
disabled,
|
|
95
|
-
// DON'T CHANGE FOR defaultProps
|
|
96
|
-
// using OR to keep ButtonGroup behavior at packages/ds-basic/src/ButtonGroup/DSButtonGroup
|
|
97
|
-
buttonType: buttonType || import_constants.BUTTON_TYPE.PRIMARY,
|
|
98
|
-
// using or to keep ButtonGroup behavior at packages/ds-basic/src/ButtonGroup/DSButtonGroup
|
|
99
|
-
size: size || import_constants.BUTTON_SIZE.M,
|
|
100
|
-
fluidWidth,
|
|
101
|
-
iconOnly: !labelText && (icon || leftIcon),
|
|
102
|
-
variant: disabled ? import_constants.BUTTON_VARIANT.DISABLED : variant
|
|
103
|
-
},
|
|
104
|
-
disabled,
|
|
105
|
-
innerRef,
|
|
106
|
-
onBlur: (e) => {
|
|
107
|
-
if (disabled)
|
|
108
|
-
return;
|
|
109
|
-
setPressed(false);
|
|
110
|
-
if (onBlur)
|
|
111
|
-
onBlur(e);
|
|
112
|
-
},
|
|
113
|
-
onClick: (e) => {
|
|
114
|
-
if (disabled)
|
|
115
|
-
return;
|
|
116
|
-
setPressed(true);
|
|
117
|
-
if (onClick)
|
|
118
|
-
onClick(e);
|
|
119
|
-
},
|
|
120
|
-
onKeyPress: (e) => {
|
|
121
|
-
if (disabled)
|
|
122
|
-
return;
|
|
123
|
-
e.preventDefault();
|
|
124
|
-
if (e.key === "Enter") {
|
|
125
|
-
setPressed(true);
|
|
126
|
-
if (onClick)
|
|
127
|
-
onClick(e);
|
|
128
|
-
}
|
|
129
|
-
if (onKeyPress)
|
|
130
|
-
onKeyPress(e);
|
|
131
|
-
},
|
|
132
|
-
tabIndex,
|
|
133
|
-
type,
|
|
134
|
-
children: [
|
|
135
|
-
leftIcon,
|
|
136
|
-
labelText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
-
"span",
|
|
138
|
-
{
|
|
139
|
-
className: `label-wrapper ${icon || leftIcon ? "with-icon" : "no-icon"}`,
|
|
140
|
-
"data-testid": "button-label",
|
|
141
|
-
role: "presentation",
|
|
142
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: labelText })
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
icon
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
};
|
|
150
|
-
DSButton.defaultProps = import_defaultProps.defaultProps;
|
|
151
|
-
DSButton.propTypes = import_propTypes.btnPropTypes;
|
|
152
|
-
DSButton.displayName = "DSButton";
|
|
153
|
-
const DSButtonWithSchema = (0, import_ds_props_helpers.describe)(DSButton);
|
|
154
|
-
DSButtonWithSchema.propTypes = import_propTypes.btnPropTypes;
|
|
155
|
-
var DSButton_default = DSButton;
|
|
156
|
-
//# sourceMappingURL=DSButton.js.map
|
package/dist/cjs/DSButton.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/DSButton.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable jest/valid-title */\nimport React, { useState, useMemo } from 'react';\nimport { aggregatedClasses, convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { cx, useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { BUTTON_TYPE, BUTTON_SIZE, BUTTON_VARIANT } from './constants.js';\nimport { btnPropTypes } from './propTypes.js';\nimport { defaultProps } from './defaultProps.js';\n\nconst blockName = 'button';\n\nconst getContainer = (Element) =>\n aggregatedClasses(Element)(\n blockName,\n null,\n ({ iconOnly, variant }) => ({\n 'icon-only': iconOnly,\n [variant]: variant,\n }),\n {\n propsToRemoveFromFinalElement: ['cx'],\n },\n );\n\ninterface ButtonPropsT {\n [x: string]: unknown;\n disabled?: boolean;\n fluidWidth?: boolean;\n innerRef?: unknown;\n buttonType?: (typeof BUTTON_TYPE)[keyof typeof BUTTON_TYPE];\n size?: (typeof BUTTON_SIZE)[keyof typeof BUTTON_SIZE];\n variant?: (typeof BUTTON_VARIANT)[keyof typeof BUTTON_VARIANT];\n labelText?: string;\n icon?: JSX.Element;\n leftIcon?: JSX.Element;\n tabIndex?: number;\n intent?: 'success' | 'danger' | 'warning' | 'info';\n containerProps?: { [x: string]: unknown };\n className?: string;\n as?: string | JSX.Element;\n type?: 'button' | 'text';\n onBlur?: React.FocusEventHandler<HTMLElement>;\n onClick?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;\n onKeyPress?: React.KeyboardEventHandler<HTMLElement>;\n}\n\n// eslint-disable-next-line complexity\nconst DSButton = ({\n innerRef,\n disabled,\n buttonType,\n fluidWidth,\n size,\n labelText,\n icon,\n onBlur,\n onClick,\n onKeyPress,\n leftIcon,\n tabIndex,\n variant,\n intent,\n containerProps,\n className,\n as: Component,\n type,\n ...rest\n}: ButtonPropsT) => {\n useDeprecateComponent({ componentName: 'ds-button-v1', version: 'TBD Date: 2023 Q3' });\n\n const [pressed, setPressed] = useState(false);\n const Button = useMemo(() => getContainer(Component), [Component]);\n const intentBlockName = `${blockName}${intent ? `-${intent}` : ''}`;\n const { cssClassName: intentClassName } = convertPropToCssClassName(intentBlockName);\n return (\n <Button\n data-testid={(containerProps && containerProps['data-testid']) || 'button-wrapper'}\n {...rest}\n {...containerProps}\n aria-disabled={rest['aria-disabled'] !== undefined ? rest['aria-disabled'] : disabled}\n aria-label={rest['aria-label'] || labelText || 'button'}\n aria-pressed={pressed}\n className={cx(intentClassName, className)}\n classProps={{\n disabled,\n // DON'T CHANGE FOR defaultProps\n // using OR to keep ButtonGroup behavior at packages/ds-basic/src/ButtonGroup/DSButtonGroup\n buttonType: buttonType || BUTTON_TYPE.PRIMARY,\n // using or to keep ButtonGroup behavior at packages/ds-basic/src/ButtonGroup/DSButtonGroup\n size: size || BUTTON_SIZE.M,\n fluidWidth,\n iconOnly: !labelText && (icon || leftIcon),\n variant: disabled ? BUTTON_VARIANT.DISABLED : variant,\n }}\n disabled={disabled} // https://jira.elliemae.io/browse/PUI-1215\n innerRef={innerRef}\n onBlur={(e: React.FocusEvent<HTMLElement>) => {\n if (disabled) return;\n setPressed(false);\n if (onBlur) onBlur(e);\n }}\n onClick={(e: React.MouseEvent<HTMLElement>) => {\n if (disabled) return;\n setPressed(true);\n if (onClick) onClick(e);\n }}\n onKeyPress={(e: React.KeyboardEvent<HTMLElement>) => {\n if (disabled) return;\n e.preventDefault();\n if (e.key === 'Enter') {\n setPressed(true);\n if (onClick) onClick(e);\n }\n if (onKeyPress) onKeyPress(e);\n }}\n tabIndex={tabIndex}\n type={type}\n >\n {leftIcon}\n {labelText && (\n <span\n className={`label-wrapper ${icon || leftIcon ? 'with-icon' : 'no-icon'}`}\n data-testid=\"button-label\"\n role=\"presentation\"\n >\n <span>{labelText}</span>\n </span>\n )}\n {icon}\n </Button>\n );\n};\n\nDSButton.defaultProps = defaultProps;\nDSButton.propTypes = btnPropTypes;\nDSButton.displayName = 'DSButton';\n\nconst DSButtonWithSchema = describe(DSButton);\nDSButtonWithSchema.propTypes = btnPropTypes;\n\nexport { DSButton, DSButtonWithSchema };\nexport default DSButton;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4EnB;AA1EJ,mBAAyC;AACzC,2BAA6D;AAC7D,0BAA0C;AAC1C,8BAAyB;AACzB,uBAAyD;AACzD,uBAA6B;AAC7B,0BAA6B;AAE7B,MAAM,YAAY;AAElB,MAAM,eAAe,CAAC,gBACpB,wCAAkB,OAAO;AAAA,EACvB;AAAA,EACA;AAAA,EACA,CAAC,EAAE,UAAU,QAAQ,OAAO;AAAA,IAC1B,aAAa;AAAA,IACb,CAAC,OAAO,GAAG;AAAA,EACb;AAAA,EACA;AAAA,IACE,+BAA+B,CAAC,IAAI;AAAA,EACtC;AACF;AAyBF,MAAM,WAAW,CAAC;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,IAAI;AAAA,EACJ;AAAA,EACA,GAAG;AACL,MAAoB;AAClB,iDAAsB,EAAE,eAAe,gBAAgB,SAAS,oBAAoB,CAAC;AAErF,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,KAAK;AAC5C,QAAM,aAAS,sBAAQ,MAAM,aAAa,SAAS,GAAG,CAAC,SAAS,CAAC;AACjE,QAAM,kBAAkB,GAAG,YAAY,SAAS,IAAI,WAAW;AAC/D,QAAM,EAAE,cAAc,gBAAgB,QAAI,gDAA0B,eAAe;AACnF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc,kBAAkB,eAAe,aAAa,KAAM;AAAA,MACjE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,iBAAe,KAAK,eAAe,MAAM,SAAY,KAAK,eAAe,IAAI;AAAA,MAC7E,cAAY,KAAK,YAAY,KAAK,aAAa;AAAA,MAC/C,gBAAc;AAAA,MACd,eAAW,wBAAG,iBAAiB,SAAS;AAAA,MACxC,YAAY;AAAA,QACV;AAAA;AAAA;AAAA,QAGA,YAAY,cAAc,6BAAY;AAAA;AAAA,QAEtC,MAAM,QAAQ,6BAAY;AAAA,QAC1B;AAAA,QACA,UAAU,CAAC,cAAc,QAAQ;AAAA,QACjC,SAAS,WAAW,gCAAe,WAAW;AAAA,MAChD;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,CAAC,MAAqC;AAC5C,YAAI;AAAU;AACd,mBAAW,KAAK;AAChB,YAAI;AAAQ,iBAAO,CAAC;AAAA,MACtB;AAAA,MACA,SAAS,CAAC,MAAqC;AAC7C,YAAI;AAAU;AACd,mBAAW,IAAI;AACf,YAAI;AAAS,kBAAQ,CAAC;AAAA,MACxB;AAAA,MACA,YAAY,CAAC,MAAwC;AACnD,YAAI;AAAU;AACd,UAAE,eAAe;AACjB,YAAI,EAAE,QAAQ,SAAS;AACrB,qBAAW,IAAI;AACf,cAAI;AAAS,oBAAQ,CAAC;AAAA,QACxB;AACA,YAAI;AAAY,qBAAW,CAAC;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,QACA,aACC;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,iBAAiB,QAAQ,WAAW,cAAc;AAAA,YAC7D,eAAY;AAAA,YACZ,MAAK;AAAA,YAEL,sDAAC,UAAM,qBAAU;AAAA;AAAA,QACnB;AAAA,QAED;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,cAAc;AAEvB,MAAM,yBAAqB,kCAAS,QAAQ;AAC5C,mBAAmB,YAAY;AAG/B,IAAO,mBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/constants.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var constants_exports = {};
|
|
30
|
-
__export(constants_exports, {
|
|
31
|
-
BUTTON_INTENT: () => BUTTON_INTENT,
|
|
32
|
-
BUTTON_SIZE: () => BUTTON_SIZE,
|
|
33
|
-
BUTTON_TYPE: () => BUTTON_TYPE,
|
|
34
|
-
BUTTON_VARIANT: () => BUTTON_VARIANT,
|
|
35
|
-
buttonTypes: () => buttonTypes,
|
|
36
|
-
buttonVariants: () => buttonVariants
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(constants_exports);
|
|
39
|
-
var React = __toESM(require("react"));
|
|
40
|
-
const BUTTON_TYPE = {
|
|
41
|
-
PRIMARY: "primary",
|
|
42
|
-
SECONDARY: "secondary",
|
|
43
|
-
TEXT: "text",
|
|
44
|
-
LINK: "link"
|
|
45
|
-
};
|
|
46
|
-
const buttonTypes = ["primary", "secondary", "text", "link"];
|
|
47
|
-
const BUTTON_SIZE = {
|
|
48
|
-
S: "s",
|
|
49
|
-
M: "m",
|
|
50
|
-
L: "l"
|
|
51
|
-
};
|
|
52
|
-
const BUTTON_INTENT = {
|
|
53
|
-
DANGER: "danger",
|
|
54
|
-
SUCCESS: "success",
|
|
55
|
-
WARNING: "warning",
|
|
56
|
-
INFO: "info"
|
|
57
|
-
};
|
|
58
|
-
const BUTTON_VARIANT = {
|
|
59
|
-
DEFAULT: "variant-default",
|
|
60
|
-
FOCUS: "variant-focus",
|
|
61
|
-
ACTIVE: "variant-active",
|
|
62
|
-
DISABLED: "variant-disabled",
|
|
63
|
-
HOVER: "variant-hover"
|
|
64
|
-
};
|
|
65
|
-
const buttonVariants = [
|
|
66
|
-
"variant-default",
|
|
67
|
-
"variant-focus",
|
|
68
|
-
"variant-active",
|
|
69
|
-
"variant-disabled",
|
|
70
|
-
"variant-hover"
|
|
71
|
-
];
|
|
72
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/constants.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const BUTTON_TYPE = {\n PRIMARY: 'primary' as const,\n SECONDARY: 'secondary' as const,\n TEXT: 'text' as const,\n LINK: 'link' as const,\n};\n\nexport const buttonTypes = ['primary' as const, 'secondary' as const, 'text' as const, 'link' as const] as const;\n\nexport const BUTTON_SIZE = {\n S: 's' as const,\n M: 'm' as const,\n L: 'l' as const,\n};\n\nexport const BUTTON_INTENT = {\n DANGER: 'danger' as const,\n SUCCESS: 'success' as const,\n WARNING: 'warning' as const,\n INFO: 'info' as const,\n};\n\nexport const BUTTON_VARIANT = {\n DEFAULT: 'variant-default' as const,\n FOCUS: 'variant-focus' as const,\n ACTIVE: 'variant-active' as const,\n DISABLED: 'variant-disabled' as const,\n HOVER: 'variant-hover' as const,\n};\n\nexport const buttonVariants = [\n 'variant-default' as const,\n 'variant-focus' as const,\n 'variant-active' as const,\n 'variant-disabled' as const,\n 'variant-hover' as const,\n] as const;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,cAAc;AAAA,EACzB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,cAAc,CAAC,WAAoB,aAAsB,QAAiB,MAAe;AAE/F,MAAM,cAAc;AAAA,EACzB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,gBAAgB;AAAA,EAC3B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAEO,MAAM,iBAAiB;AAAA,EAC5B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AACT;AAEO,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/defaultProps.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var defaultProps_exports = {};
|
|
30
|
-
__export(defaultProps_exports, {
|
|
31
|
-
defaultProps: () => defaultProps
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(defaultProps_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_constants = require("./constants.js");
|
|
36
|
-
const defaultProps = {
|
|
37
|
-
disabled: false,
|
|
38
|
-
fluidWidth: false,
|
|
39
|
-
labelText: "",
|
|
40
|
-
icon: null,
|
|
41
|
-
onBlur: () => null,
|
|
42
|
-
onClick: () => null,
|
|
43
|
-
onKeyPress: () => null,
|
|
44
|
-
leftIcon: null,
|
|
45
|
-
tabIndex: 0,
|
|
46
|
-
variant: import_constants.BUTTON_VARIANT.DEFAULT,
|
|
47
|
-
containerProps: {},
|
|
48
|
-
as: "button",
|
|
49
|
-
type: "button"
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/defaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { BUTTON_VARIANT } from './constants.js';\n\nexport const defaultProps = {\n disabled: false,\n fluidWidth: false,\n labelText: '',\n icon: null,\n onBlur: () => null,\n onClick: () => null,\n onKeyPress: () => null,\n leftIcon: null,\n tabIndex: 0,\n variant: BUTTON_VARIANT.DEFAULT,\n containerProps: {},\n as: 'button',\n type: 'button',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA+B;AAExB,MAAM,eAAe;AAAA,EAC1B,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQ,MAAM;AAAA,EACd,SAAS,MAAM;AAAA,EACf,YAAY,MAAM;AAAA,EAClB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS,gCAAe;AAAA,EACxB,gBAAgB,CAAC;AAAA,EACjB,IAAI;AAAA,EACJ,MAAM;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/propTypes.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var propTypes_exports = {};
|
|
30
|
-
__export(propTypes_exports, {
|
|
31
|
-
btnPropTypes: () => btnPropTypes
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(propTypes_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
-
var import_ds_shared = require("@elliemae/ds-shared");
|
|
37
|
-
var import_constants = require("./constants.js");
|
|
38
|
-
const btnPropTypes = {
|
|
39
|
-
/**
|
|
40
|
-
* Tab index
|
|
41
|
-
*/
|
|
42
|
-
tabIndex: import_ds_props_helpers.PropTypes.number.description("Tab index"),
|
|
43
|
-
/**
|
|
44
|
-
* Additional className
|
|
45
|
-
*/
|
|
46
|
-
className: import_ds_props_helpers.PropTypes.string.description("Additional className"),
|
|
47
|
-
/**
|
|
48
|
-
* aria disabled
|
|
49
|
-
*/
|
|
50
|
-
"aria-disabled": import_ds_props_helpers.PropTypes.string.description("aria disabled"),
|
|
51
|
-
/**
|
|
52
|
-
* Html tag. default 'button'
|
|
53
|
-
*/
|
|
54
|
-
as: import_ds_props_helpers.PropTypes.string.description("Html tag").defaultValue("button"),
|
|
55
|
-
/**
|
|
56
|
-
* Whether the button is disabled or not
|
|
57
|
-
*/
|
|
58
|
-
disabled: import_ds_props_helpers.PropTypes.bool.description("Whether the button is disabled or not"),
|
|
59
|
-
/**
|
|
60
|
-
* Make the content of the button fit the button container or not
|
|
61
|
-
*/
|
|
62
|
-
fluidWidth: import_ds_props_helpers.PropTypes.bool.description("Make the content of the button fit the button container or not"),
|
|
63
|
-
/**
|
|
64
|
-
* Displayable label inside the button
|
|
65
|
-
*/
|
|
66
|
-
labelText: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.element]).description(
|
|
67
|
-
"Displayable label inside the button"
|
|
68
|
-
),
|
|
69
|
-
/**
|
|
70
|
-
* Put an icon inside the button
|
|
71
|
-
*/
|
|
72
|
-
icon: import_ds_props_helpers.PropTypes.element.description("Put an icon inside the button"),
|
|
73
|
-
/**
|
|
74
|
-
* Put an icon on the left side of the button
|
|
75
|
-
*/
|
|
76
|
-
leftIcon: import_ds_props_helpers.PropTypes.element.description("Put an icon on the left side of the button"),
|
|
77
|
-
/**
|
|
78
|
-
* ['primary', 'secondary', 'text', 'link']
|
|
79
|
-
*/
|
|
80
|
-
buttonType: import_ds_props_helpers.PropTypes.oneOf(import_constants.buttonTypes).description("type of the button"),
|
|
81
|
-
/**
|
|
82
|
-
* ['s', 'm', 'l']
|
|
83
|
-
*/
|
|
84
|
-
size: import_ds_props_helpers.PropTypes.oneOf(import_ds_shared.dsBasicSizes).description("size of the button"),
|
|
85
|
-
/**
|
|
86
|
-
* submit or button
|
|
87
|
-
*/
|
|
88
|
-
type: import_ds_props_helpers.PropTypes.oneOf(["button", "submit"]).description("type of the button"),
|
|
89
|
-
/**
|
|
90
|
-
* [
|
|
91
|
-
* 'variant-default',
|
|
92
|
-
* 'variant-focus',
|
|
93
|
-
* 'variant-active',
|
|
94
|
-
* 'variant-disabled',
|
|
95
|
-
* ]
|
|
96
|
-
*/
|
|
97
|
-
variant: import_ds_props_helpers.PropTypes.oneOf(import_constants.buttonVariants).description("variant of the button"),
|
|
98
|
-
/**
|
|
99
|
-
* Refence
|
|
100
|
-
*/
|
|
101
|
-
innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.func, import_ds_props_helpers.PropTypes.shape({ current: import_ds_props_helpers.PropTypes.any })]).description(
|
|
102
|
-
"reference to the component"
|
|
103
|
-
),
|
|
104
|
-
/**
|
|
105
|
-
* Onblur callback
|
|
106
|
-
*/
|
|
107
|
-
onBlur: import_ds_props_helpers.PropTypes.func.description("Allows a function that is triggered once the button is blur"),
|
|
108
|
-
/**
|
|
109
|
-
* Apply intent color: ['success', 'warning', 'danger', 'info']
|
|
110
|
-
* Only valid with buttonType="text"
|
|
111
|
-
*/
|
|
112
|
-
intent: import_ds_props_helpers.PropTypes.oneOf(["success", "warning", "danger", "info"]).description(
|
|
113
|
-
'Apply intent color. Only valid with buttonType="text"'
|
|
114
|
-
),
|
|
115
|
-
/**
|
|
116
|
-
* additional props for the container
|
|
117
|
-
*/
|
|
118
|
-
containerProps: import_ds_props_helpers.PropTypes.object.description("additional props for the container"),
|
|
119
|
-
/**
|
|
120
|
-
* Allows a function that is triggered once the button is clicked
|
|
121
|
-
*/
|
|
122
|
-
onClick: import_ds_props_helpers.PropTypes.func.description("Allows a function that is triggered once the button is clicked"),
|
|
123
|
-
/**
|
|
124
|
-
* Allows a function that is triggered once the button is key pressed
|
|
125
|
-
*/
|
|
126
|
-
onKeyPress: import_ds_props_helpers.PropTypes.func.description("Allows a function that is triggered once the button is key pressed")
|
|
127
|
-
};
|
|
128
|
-
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-unused-vars */\n\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { dsBasicSizes } from '@elliemae/ds-shared';\nimport { buttonTypes, buttonVariants } from './constants.js';\n\nexport const btnPropTypes = {\n /**\n * Tab index\n */\n tabIndex: PropTypes.number.description('Tab index'),\n /**\n * Additional className\n */\n className: PropTypes.string.description('Additional className'),\n /**\n * aria disabled\n */\n 'aria-disabled': PropTypes.string.description('aria disabled'),\n /**\n * Html tag. default 'button'\n */\n as: PropTypes.string.description('Html tag').defaultValue('button'),\n /**\n * Whether the button is disabled or not\n */\n disabled: PropTypes.bool.description('Whether the button is disabled or not'),\n /**\n * Make the content of the button fit the button container or not\n */\n fluidWidth: PropTypes.bool.description('Make the content of the button fit the button container or not'),\n /**\n * Displayable label inside the button\n */\n labelText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(\n 'Displayable label inside the button',\n ),\n /**\n * Put an icon inside the button\n */\n icon: PropTypes.element.description('Put an icon inside the button'),\n /**\n * Put an icon on the left side of the button\n */\n leftIcon: PropTypes.element.description('Put an icon on the left side of the button'),\n /**\n * ['primary', 'secondary', 'text', 'link']\n */\n buttonType: PropTypes.oneOf(buttonTypes).description('type of the button'),\n /**\n * ['s', 'm', 'l']\n */\n size: PropTypes.oneOf(dsBasicSizes).description('size of the button'),\n /**\n * submit or button\n */\n type: PropTypes.oneOf(['button', 'submit']).description('type of the button'),\n /**\n * [\n * 'variant-default',\n * 'variant-focus',\n * 'variant-active',\n * 'variant-disabled',\n * ]\n */\n variant: PropTypes.oneOf(buttonVariants).description('variant of the button'),\n /**\n * Refence\n */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'reference to the component',\n ),\n /**\n * Onblur callback\n */\n onBlur: PropTypes.func.description('Allows a function that is triggered once the button is blur'),\n /**\n * Apply intent color: ['success', 'warning', 'danger', 'info']\n * Only valid with buttonType=\"text\"\n */\n intent: PropTypes.oneOf(['success', 'warning', 'danger', 'info']).description(\n 'Apply intent color. Only valid with buttonType=\"text\"',\n ),\n /**\n * additional props for the container\n */\n containerProps: PropTypes.object.description('additional props for the container'),\n /**\n * Allows a function that is triggered once the button is clicked\n */\n onClick: PropTypes.func.description('Allows a function that is triggered once the button is clicked'),\n /**\n * Allows a function that is triggered once the button is key pressed\n */\n onKeyPress: PropTypes.func.description('Allows a function that is triggered once the button is key pressed'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAA0B;AAC1B,uBAA6B;AAC7B,uBAA4C;AAErC,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,EAI1B,UAAU,kCAAU,OAAO,YAAY,WAAW;AAAA;AAAA;AAAA;AAAA,EAIlD,WAAW,kCAAU,OAAO,YAAY,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAI9D,iBAAiB,kCAAU,OAAO,YAAY,eAAe;AAAA;AAAA;AAAA;AAAA,EAI7D,IAAI,kCAAU,OAAO,YAAY,UAAU,EAAE,aAAa,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIlE,UAAU,kCAAU,KAAK,YAAY,uCAAuC;AAAA;AAAA;AAAA;AAAA,EAI5E,YAAY,kCAAU,KAAK,YAAY,gEAAgE;AAAA;AAAA;AAAA;AAAA,EAIvG,WAAW,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,OAAO,CAAC,EAAE;AAAA,IACpE;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,MAAM,kCAAU,QAAQ,YAAY,+BAA+B;AAAA;AAAA;AAAA;AAAA,EAInE,UAAU,kCAAU,QAAQ,YAAY,4CAA4C;AAAA;AAAA;AAAA;AAAA,EAIpF,YAAY,kCAAU,MAAM,4BAAW,EAAE,YAAY,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAIzE,MAAM,kCAAU,MAAM,6BAAY,EAAE,YAAY,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAIpE,MAAM,kCAAU,MAAM,CAAC,UAAU,QAAQ,CAAC,EAAE,YAAY,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS5E,SAAS,kCAAU,MAAM,+BAAc,EAAE,YAAY,uBAAuB;AAAA;AAAA;AAAA;AAAA,EAI5E,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,QAAQ,kCAAU,KAAK,YAAY,6DAA6D;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhG,QAAQ,kCAAU,MAAM,CAAC,WAAW,WAAW,UAAU,MAAM,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,gBAAgB,kCAAU,OAAO,YAAY,oCAAoC;AAAA;AAAA;AAAA;AAAA,EAIjF,SAAS,kCAAU,KAAK,YAAY,gEAAgE;AAAA;AAAA;AAAA;AAAA,EAIpG,YAAY,kCAAU,KAAK,YAAY,oEAAoE;AAC7G;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/DSButton.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useMemo } from "react";
|
|
4
|
-
import { aggregatedClasses, convertPropToCssClassName } from "@elliemae/ds-classnames";
|
|
5
|
-
import { cx, useDeprecateComponent } from "@elliemae/ds-utilities";
|
|
6
|
-
import { describe } from "@elliemae/ds-props-helpers";
|
|
7
|
-
import { BUTTON_TYPE, BUTTON_SIZE, BUTTON_VARIANT } from "./constants.js";
|
|
8
|
-
import { btnPropTypes } from "./propTypes.js";
|
|
9
|
-
import { defaultProps } from "./defaultProps.js";
|
|
10
|
-
const blockName = "button";
|
|
11
|
-
const getContainer = (Element) => aggregatedClasses(Element)(
|
|
12
|
-
blockName,
|
|
13
|
-
null,
|
|
14
|
-
({ iconOnly, variant }) => ({
|
|
15
|
-
"icon-only": iconOnly,
|
|
16
|
-
[variant]: variant
|
|
17
|
-
}),
|
|
18
|
-
{
|
|
19
|
-
propsToRemoveFromFinalElement: ["cx"]
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
const DSButton = ({
|
|
23
|
-
innerRef,
|
|
24
|
-
disabled,
|
|
25
|
-
buttonType,
|
|
26
|
-
fluidWidth,
|
|
27
|
-
size,
|
|
28
|
-
labelText,
|
|
29
|
-
icon,
|
|
30
|
-
onBlur,
|
|
31
|
-
onClick,
|
|
32
|
-
onKeyPress,
|
|
33
|
-
leftIcon,
|
|
34
|
-
tabIndex,
|
|
35
|
-
variant,
|
|
36
|
-
intent,
|
|
37
|
-
containerProps,
|
|
38
|
-
className,
|
|
39
|
-
as: Component,
|
|
40
|
-
type,
|
|
41
|
-
...rest
|
|
42
|
-
}) => {
|
|
43
|
-
useDeprecateComponent({ componentName: "ds-button-v1", version: "TBD Date: 2023 Q3" });
|
|
44
|
-
const [pressed, setPressed] = useState(false);
|
|
45
|
-
const Button = useMemo(() => getContainer(Component), [Component]);
|
|
46
|
-
const intentBlockName = `${blockName}${intent ? `-${intent}` : ""}`;
|
|
47
|
-
const { cssClassName: intentClassName } = convertPropToCssClassName(intentBlockName);
|
|
48
|
-
return /* @__PURE__ */ jsxs(
|
|
49
|
-
Button,
|
|
50
|
-
{
|
|
51
|
-
"data-testid": containerProps && containerProps["data-testid"] || "button-wrapper",
|
|
52
|
-
...rest,
|
|
53
|
-
...containerProps,
|
|
54
|
-
"aria-disabled": rest["aria-disabled"] !== void 0 ? rest["aria-disabled"] : disabled,
|
|
55
|
-
"aria-label": rest["aria-label"] || labelText || "button",
|
|
56
|
-
"aria-pressed": pressed,
|
|
57
|
-
className: cx(intentClassName, className),
|
|
58
|
-
classProps: {
|
|
59
|
-
disabled,
|
|
60
|
-
// DON'T CHANGE FOR defaultProps
|
|
61
|
-
// using OR to keep ButtonGroup behavior at packages/ds-basic/src/ButtonGroup/DSButtonGroup
|
|
62
|
-
buttonType: buttonType || BUTTON_TYPE.PRIMARY,
|
|
63
|
-
// using or to keep ButtonGroup behavior at packages/ds-basic/src/ButtonGroup/DSButtonGroup
|
|
64
|
-
size: size || BUTTON_SIZE.M,
|
|
65
|
-
fluidWidth,
|
|
66
|
-
iconOnly: !labelText && (icon || leftIcon),
|
|
67
|
-
variant: disabled ? BUTTON_VARIANT.DISABLED : variant
|
|
68
|
-
},
|
|
69
|
-
disabled,
|
|
70
|
-
innerRef,
|
|
71
|
-
onBlur: (e) => {
|
|
72
|
-
if (disabled)
|
|
73
|
-
return;
|
|
74
|
-
setPressed(false);
|
|
75
|
-
if (onBlur)
|
|
76
|
-
onBlur(e);
|
|
77
|
-
},
|
|
78
|
-
onClick: (e) => {
|
|
79
|
-
if (disabled)
|
|
80
|
-
return;
|
|
81
|
-
setPressed(true);
|
|
82
|
-
if (onClick)
|
|
83
|
-
onClick(e);
|
|
84
|
-
},
|
|
85
|
-
onKeyPress: (e) => {
|
|
86
|
-
if (disabled)
|
|
87
|
-
return;
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
if (e.key === "Enter") {
|
|
90
|
-
setPressed(true);
|
|
91
|
-
if (onClick)
|
|
92
|
-
onClick(e);
|
|
93
|
-
}
|
|
94
|
-
if (onKeyPress)
|
|
95
|
-
onKeyPress(e);
|
|
96
|
-
},
|
|
97
|
-
tabIndex,
|
|
98
|
-
type,
|
|
99
|
-
children: [
|
|
100
|
-
leftIcon,
|
|
101
|
-
labelText && /* @__PURE__ */ jsx(
|
|
102
|
-
"span",
|
|
103
|
-
{
|
|
104
|
-
className: `label-wrapper ${icon || leftIcon ? "with-icon" : "no-icon"}`,
|
|
105
|
-
"data-testid": "button-label",
|
|
106
|
-
role: "presentation",
|
|
107
|
-
children: /* @__PURE__ */ jsx("span", { children: labelText })
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
icon
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
};
|
|
115
|
-
DSButton.defaultProps = defaultProps;
|
|
116
|
-
DSButton.propTypes = btnPropTypes;
|
|
117
|
-
DSButton.displayName = "DSButton";
|
|
118
|
-
const DSButtonWithSchema = describe(DSButton);
|
|
119
|
-
DSButtonWithSchema.propTypes = btnPropTypes;
|
|
120
|
-
var DSButton_default = DSButton;
|
|
121
|
-
export {
|
|
122
|
-
DSButton,
|
|
123
|
-
DSButtonWithSchema,
|
|
124
|
-
DSButton_default as default
|
|
125
|
-
};
|
|
126
|
-
//# sourceMappingURL=DSButton.js.map
|
package/dist/esm/DSButton.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSButton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable jest/valid-title */\nimport React, { useState, useMemo } from 'react';\nimport { aggregatedClasses, convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { cx, useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { BUTTON_TYPE, BUTTON_SIZE, BUTTON_VARIANT } from './constants.js';\nimport { btnPropTypes } from './propTypes.js';\nimport { defaultProps } from './defaultProps.js';\n\nconst blockName = 'button';\n\nconst getContainer = (Element) =>\n aggregatedClasses(Element)(\n blockName,\n null,\n ({ iconOnly, variant }) => ({\n 'icon-only': iconOnly,\n [variant]: variant,\n }),\n {\n propsToRemoveFromFinalElement: ['cx'],\n },\n );\n\ninterface ButtonPropsT {\n [x: string]: unknown;\n disabled?: boolean;\n fluidWidth?: boolean;\n innerRef?: unknown;\n buttonType?: (typeof BUTTON_TYPE)[keyof typeof BUTTON_TYPE];\n size?: (typeof BUTTON_SIZE)[keyof typeof BUTTON_SIZE];\n variant?: (typeof BUTTON_VARIANT)[keyof typeof BUTTON_VARIANT];\n labelText?: string;\n icon?: JSX.Element;\n leftIcon?: JSX.Element;\n tabIndex?: number;\n intent?: 'success' | 'danger' | 'warning' | 'info';\n containerProps?: { [x: string]: unknown };\n className?: string;\n as?: string | JSX.Element;\n type?: 'button' | 'text';\n onBlur?: React.FocusEventHandler<HTMLElement>;\n onClick?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;\n onKeyPress?: React.KeyboardEventHandler<HTMLElement>;\n}\n\n// eslint-disable-next-line complexity\nconst DSButton = ({\n innerRef,\n disabled,\n buttonType,\n fluidWidth,\n size,\n labelText,\n icon,\n onBlur,\n onClick,\n onKeyPress,\n leftIcon,\n tabIndex,\n variant,\n intent,\n containerProps,\n className,\n as: Component,\n type,\n ...rest\n}: ButtonPropsT) => {\n useDeprecateComponent({ componentName: 'ds-button-v1', version: 'TBD Date: 2023 Q3' });\n\n const [pressed, setPressed] = useState(false);\n const Button = useMemo(() => getContainer(Component), [Component]);\n const intentBlockName = `${blockName}${intent ? `-${intent}` : ''}`;\n const { cssClassName: intentClassName } = convertPropToCssClassName(intentBlockName);\n return (\n <Button\n data-testid={(containerProps && containerProps['data-testid']) || 'button-wrapper'}\n {...rest}\n {...containerProps}\n aria-disabled={rest['aria-disabled'] !== undefined ? rest['aria-disabled'] : disabled}\n aria-label={rest['aria-label'] || labelText || 'button'}\n aria-pressed={pressed}\n className={cx(intentClassName, className)}\n classProps={{\n disabled,\n // DON'T CHANGE FOR defaultProps\n // using OR to keep ButtonGroup behavior at packages/ds-basic/src/ButtonGroup/DSButtonGroup\n buttonType: buttonType || BUTTON_TYPE.PRIMARY,\n // using or to keep ButtonGroup behavior at packages/ds-basic/src/ButtonGroup/DSButtonGroup\n size: size || BUTTON_SIZE.M,\n fluidWidth,\n iconOnly: !labelText && (icon || leftIcon),\n variant: disabled ? BUTTON_VARIANT.DISABLED : variant,\n }}\n disabled={disabled} // https://jira.elliemae.io/browse/PUI-1215\n innerRef={innerRef}\n onBlur={(e: React.FocusEvent<HTMLElement>) => {\n if (disabled) return;\n setPressed(false);\n if (onBlur) onBlur(e);\n }}\n onClick={(e: React.MouseEvent<HTMLElement>) => {\n if (disabled) return;\n setPressed(true);\n if (onClick) onClick(e);\n }}\n onKeyPress={(e: React.KeyboardEvent<HTMLElement>) => {\n if (disabled) return;\n e.preventDefault();\n if (e.key === 'Enter') {\n setPressed(true);\n if (onClick) onClick(e);\n }\n if (onKeyPress) onKeyPress(e);\n }}\n tabIndex={tabIndex}\n type={type}\n >\n {leftIcon}\n {labelText && (\n <span\n className={`label-wrapper ${icon || leftIcon ? 'with-icon' : 'no-icon'}`}\n data-testid=\"button-label\"\n role=\"presentation\"\n >\n <span>{labelText}</span>\n </span>\n )}\n {icon}\n </Button>\n );\n};\n\nDSButton.defaultProps = defaultProps;\nDSButton.propTypes = btnPropTypes;\nDSButton.displayName = 'DSButton';\n\nconst DSButtonWithSchema = describe(DSButton);\nDSButtonWithSchema.propTypes = btnPropTypes;\n\nexport { DSButton, DSButtonWithSchema };\nexport default DSButton;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC4EnB,SAkDM,KAlDN;AA1EJ,SAAgB,UAAU,eAAe;AACzC,SAAS,mBAAmB,iCAAiC;AAC7D,SAAS,IAAI,6BAA6B;AAC1C,SAAS,gBAAgB;AACzB,SAAS,aAAa,aAAa,sBAAsB;AACzD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAE7B,MAAM,YAAY;AAElB,MAAM,eAAe,CAAC,YACpB,kBAAkB,OAAO;AAAA,EACvB;AAAA,EACA;AAAA,EACA,CAAC,EAAE,UAAU,QAAQ,OAAO;AAAA,IAC1B,aAAa;AAAA,IACb,CAAC,OAAO,GAAG;AAAA,EACb;AAAA,EACA;AAAA,IACE,+BAA+B,CAAC,IAAI;AAAA,EACtC;AACF;AAyBF,MAAM,WAAW,CAAC;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,IAAI;AAAA,EACJ;AAAA,EACA,GAAG;AACL,MAAoB;AAClB,wBAAsB,EAAE,eAAe,gBAAgB,SAAS,oBAAoB,CAAC;AAErF,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,SAAS,QAAQ,MAAM,aAAa,SAAS,GAAG,CAAC,SAAS,CAAC;AACjE,QAAM,kBAAkB,GAAG,YAAY,SAAS,IAAI,WAAW;AAC/D,QAAM,EAAE,cAAc,gBAAgB,IAAI,0BAA0B,eAAe;AACnF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc,kBAAkB,eAAe,aAAa,KAAM;AAAA,MACjE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,iBAAe,KAAK,eAAe,MAAM,SAAY,KAAK,eAAe,IAAI;AAAA,MAC7E,cAAY,KAAK,YAAY,KAAK,aAAa;AAAA,MAC/C,gBAAc;AAAA,MACd,WAAW,GAAG,iBAAiB,SAAS;AAAA,MACxC,YAAY;AAAA,QACV;AAAA;AAAA;AAAA,QAGA,YAAY,cAAc,YAAY;AAAA;AAAA,QAEtC,MAAM,QAAQ,YAAY;AAAA,QAC1B;AAAA,QACA,UAAU,CAAC,cAAc,QAAQ;AAAA,QACjC,SAAS,WAAW,eAAe,WAAW;AAAA,MAChD;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,CAAC,MAAqC;AAC5C,YAAI;AAAU;AACd,mBAAW,KAAK;AAChB,YAAI;AAAQ,iBAAO,CAAC;AAAA,MACtB;AAAA,MACA,SAAS,CAAC,MAAqC;AAC7C,YAAI;AAAU;AACd,mBAAW,IAAI;AACf,YAAI;AAAS,kBAAQ,CAAC;AAAA,MACxB;AAAA,MACA,YAAY,CAAC,MAAwC;AACnD,YAAI;AAAU;AACd,UAAE,eAAe;AACjB,YAAI,EAAE,QAAQ,SAAS;AACrB,qBAAW,IAAI;AACf,cAAI;AAAS,oBAAQ,CAAC;AAAA,QACxB;AACA,YAAI;AAAY,qBAAW,CAAC;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,QACA,aACC;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,iBAAiB,QAAQ,WAAW,cAAc;AAAA,YAC7D,eAAY;AAAA,YACZ,MAAK;AAAA,YAEL,8BAAC,UAAM,qBAAU;AAAA;AAAA,QACnB;AAAA,QAED;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,cAAc;AAEvB,MAAM,qBAAqB,SAAS,QAAQ;AAC5C,mBAAmB,YAAY;AAG/B,IAAO,mBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/constants.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const BUTTON_TYPE = {
|
|
3
|
-
PRIMARY: "primary",
|
|
4
|
-
SECONDARY: "secondary",
|
|
5
|
-
TEXT: "text",
|
|
6
|
-
LINK: "link"
|
|
7
|
-
};
|
|
8
|
-
const buttonTypes = ["primary", "secondary", "text", "link"];
|
|
9
|
-
const BUTTON_SIZE = {
|
|
10
|
-
S: "s",
|
|
11
|
-
M: "m",
|
|
12
|
-
L: "l"
|
|
13
|
-
};
|
|
14
|
-
const BUTTON_INTENT = {
|
|
15
|
-
DANGER: "danger",
|
|
16
|
-
SUCCESS: "success",
|
|
17
|
-
WARNING: "warning",
|
|
18
|
-
INFO: "info"
|
|
19
|
-
};
|
|
20
|
-
const BUTTON_VARIANT = {
|
|
21
|
-
DEFAULT: "variant-default",
|
|
22
|
-
FOCUS: "variant-focus",
|
|
23
|
-
ACTIVE: "variant-active",
|
|
24
|
-
DISABLED: "variant-disabled",
|
|
25
|
-
HOVER: "variant-hover"
|
|
26
|
-
};
|
|
27
|
-
const buttonVariants = [
|
|
28
|
-
"variant-default",
|
|
29
|
-
"variant-focus",
|
|
30
|
-
"variant-active",
|
|
31
|
-
"variant-disabled",
|
|
32
|
-
"variant-hover"
|
|
33
|
-
];
|
|
34
|
-
export {
|
|
35
|
-
BUTTON_INTENT,
|
|
36
|
-
BUTTON_SIZE,
|
|
37
|
-
BUTTON_TYPE,
|
|
38
|
-
BUTTON_VARIANT,
|
|
39
|
-
buttonTypes,
|
|
40
|
-
buttonVariants
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/constants.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const BUTTON_TYPE = {\n PRIMARY: 'primary' as const,\n SECONDARY: 'secondary' as const,\n TEXT: 'text' as const,\n LINK: 'link' as const,\n};\n\nexport const buttonTypes = ['primary' as const, 'secondary' as const, 'text' as const, 'link' as const] as const;\n\nexport const BUTTON_SIZE = {\n S: 's' as const,\n M: 'm' as const,\n L: 'l' as const,\n};\n\nexport const BUTTON_INTENT = {\n DANGER: 'danger' as const,\n SUCCESS: 'success' as const,\n WARNING: 'warning' as const,\n INFO: 'info' as const,\n};\n\nexport const BUTTON_VARIANT = {\n DEFAULT: 'variant-default' as const,\n FOCUS: 'variant-focus' as const,\n ACTIVE: 'variant-active' as const,\n DISABLED: 'variant-disabled' as const,\n HOVER: 'variant-hover' as const,\n};\n\nexport const buttonVariants = [\n 'variant-default' as const,\n 'variant-focus' as const,\n 'variant-active' as const,\n 'variant-disabled' as const,\n 'variant-hover' as const,\n] as const;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,cAAc;AAAA,EACzB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,cAAc,CAAC,WAAoB,aAAsB,QAAiB,MAAe;AAE/F,MAAM,cAAc;AAAA,EACzB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,gBAAgB;AAAA,EAC3B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAEO,MAAM,iBAAiB;AAAA,EAC5B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AACT;AAEO,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/defaultProps.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { BUTTON_VARIANT } from "./constants.js";
|
|
3
|
-
const defaultProps = {
|
|
4
|
-
disabled: false,
|
|
5
|
-
fluidWidth: false,
|
|
6
|
-
labelText: "",
|
|
7
|
-
icon: null,
|
|
8
|
-
onBlur: () => null,
|
|
9
|
-
onClick: () => null,
|
|
10
|
-
onKeyPress: () => null,
|
|
11
|
-
leftIcon: null,
|
|
12
|
-
tabIndex: 0,
|
|
13
|
-
variant: BUTTON_VARIANT.DEFAULT,
|
|
14
|
-
containerProps: {},
|
|
15
|
-
as: "button",
|
|
16
|
-
type: "button"
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
defaultProps
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/defaultProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { BUTTON_VARIANT } from './constants.js';\n\nexport const defaultProps = {\n disabled: false,\n fluidWidth: false,\n labelText: '',\n icon: null,\n onBlur: () => null,\n onClick: () => null,\n onKeyPress: () => null,\n leftIcon: null,\n tabIndex: 0,\n variant: BUTTON_VARIANT.DEFAULT,\n containerProps: {},\n as: 'button',\n type: 'button',\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAExB,MAAM,eAAe;AAAA,EAC1B,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQ,MAAM;AAAA,EACd,SAAS,MAAM;AAAA,EACf,YAAY,MAAM;AAAA,EAClB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS,eAAe;AAAA,EACxB,gBAAgB,CAAC;AAAA,EACjB,IAAI;AAAA,EACJ,MAAM;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/propTypes.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
-
import { dsBasicSizes } from "@elliemae/ds-shared";
|
|
4
|
-
import { buttonTypes, buttonVariants } from "./constants.js";
|
|
5
|
-
const btnPropTypes = {
|
|
6
|
-
/**
|
|
7
|
-
* Tab index
|
|
8
|
-
*/
|
|
9
|
-
tabIndex: PropTypes.number.description("Tab index"),
|
|
10
|
-
/**
|
|
11
|
-
* Additional className
|
|
12
|
-
*/
|
|
13
|
-
className: PropTypes.string.description("Additional className"),
|
|
14
|
-
/**
|
|
15
|
-
* aria disabled
|
|
16
|
-
*/
|
|
17
|
-
"aria-disabled": PropTypes.string.description("aria disabled"),
|
|
18
|
-
/**
|
|
19
|
-
* Html tag. default 'button'
|
|
20
|
-
*/
|
|
21
|
-
as: PropTypes.string.description("Html tag").defaultValue("button"),
|
|
22
|
-
/**
|
|
23
|
-
* Whether the button is disabled or not
|
|
24
|
-
*/
|
|
25
|
-
disabled: PropTypes.bool.description("Whether the button is disabled or not"),
|
|
26
|
-
/**
|
|
27
|
-
* Make the content of the button fit the button container or not
|
|
28
|
-
*/
|
|
29
|
-
fluidWidth: PropTypes.bool.description("Make the content of the button fit the button container or not"),
|
|
30
|
-
/**
|
|
31
|
-
* Displayable label inside the button
|
|
32
|
-
*/
|
|
33
|
-
labelText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(
|
|
34
|
-
"Displayable label inside the button"
|
|
35
|
-
),
|
|
36
|
-
/**
|
|
37
|
-
* Put an icon inside the button
|
|
38
|
-
*/
|
|
39
|
-
icon: PropTypes.element.description("Put an icon inside the button"),
|
|
40
|
-
/**
|
|
41
|
-
* Put an icon on the left side of the button
|
|
42
|
-
*/
|
|
43
|
-
leftIcon: PropTypes.element.description("Put an icon on the left side of the button"),
|
|
44
|
-
/**
|
|
45
|
-
* ['primary', 'secondary', 'text', 'link']
|
|
46
|
-
*/
|
|
47
|
-
buttonType: PropTypes.oneOf(buttonTypes).description("type of the button"),
|
|
48
|
-
/**
|
|
49
|
-
* ['s', 'm', 'l']
|
|
50
|
-
*/
|
|
51
|
-
size: PropTypes.oneOf(dsBasicSizes).description("size of the button"),
|
|
52
|
-
/**
|
|
53
|
-
* submit or button
|
|
54
|
-
*/
|
|
55
|
-
type: PropTypes.oneOf(["button", "submit"]).description("type of the button"),
|
|
56
|
-
/**
|
|
57
|
-
* [
|
|
58
|
-
* 'variant-default',
|
|
59
|
-
* 'variant-focus',
|
|
60
|
-
* 'variant-active',
|
|
61
|
-
* 'variant-disabled',
|
|
62
|
-
* ]
|
|
63
|
-
*/
|
|
64
|
-
variant: PropTypes.oneOf(buttonVariants).description("variant of the button"),
|
|
65
|
-
/**
|
|
66
|
-
* Refence
|
|
67
|
-
*/
|
|
68
|
-
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(
|
|
69
|
-
"reference to the component"
|
|
70
|
-
),
|
|
71
|
-
/**
|
|
72
|
-
* Onblur callback
|
|
73
|
-
*/
|
|
74
|
-
onBlur: PropTypes.func.description("Allows a function that is triggered once the button is blur"),
|
|
75
|
-
/**
|
|
76
|
-
* Apply intent color: ['success', 'warning', 'danger', 'info']
|
|
77
|
-
* Only valid with buttonType="text"
|
|
78
|
-
*/
|
|
79
|
-
intent: PropTypes.oneOf(["success", "warning", "danger", "info"]).description(
|
|
80
|
-
'Apply intent color. Only valid with buttonType="text"'
|
|
81
|
-
),
|
|
82
|
-
/**
|
|
83
|
-
* additional props for the container
|
|
84
|
-
*/
|
|
85
|
-
containerProps: PropTypes.object.description("additional props for the container"),
|
|
86
|
-
/**
|
|
87
|
-
* Allows a function that is triggered once the button is clicked
|
|
88
|
-
*/
|
|
89
|
-
onClick: PropTypes.func.description("Allows a function that is triggered once the button is clicked"),
|
|
90
|
-
/**
|
|
91
|
-
* Allows a function that is triggered once the button is key pressed
|
|
92
|
-
*/
|
|
93
|
-
onKeyPress: PropTypes.func.description("Allows a function that is triggered once the button is key pressed")
|
|
94
|
-
};
|
|
95
|
-
export {
|
|
96
|
-
btnPropTypes
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-unused-vars */\n\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { dsBasicSizes } from '@elliemae/ds-shared';\nimport { buttonTypes, buttonVariants } from './constants.js';\n\nexport const btnPropTypes = {\n /**\n * Tab index\n */\n tabIndex: PropTypes.number.description('Tab index'),\n /**\n * Additional className\n */\n className: PropTypes.string.description('Additional className'),\n /**\n * aria disabled\n */\n 'aria-disabled': PropTypes.string.description('aria disabled'),\n /**\n * Html tag. default 'button'\n */\n as: PropTypes.string.description('Html tag').defaultValue('button'),\n /**\n * Whether the button is disabled or not\n */\n disabled: PropTypes.bool.description('Whether the button is disabled or not'),\n /**\n * Make the content of the button fit the button container or not\n */\n fluidWidth: PropTypes.bool.description('Make the content of the button fit the button container or not'),\n /**\n * Displayable label inside the button\n */\n labelText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(\n 'Displayable label inside the button',\n ),\n /**\n * Put an icon inside the button\n */\n icon: PropTypes.element.description('Put an icon inside the button'),\n /**\n * Put an icon on the left side of the button\n */\n leftIcon: PropTypes.element.description('Put an icon on the left side of the button'),\n /**\n * ['primary', 'secondary', 'text', 'link']\n */\n buttonType: PropTypes.oneOf(buttonTypes).description('type of the button'),\n /**\n * ['s', 'm', 'l']\n */\n size: PropTypes.oneOf(dsBasicSizes).description('size of the button'),\n /**\n * submit or button\n */\n type: PropTypes.oneOf(['button', 'submit']).description('type of the button'),\n /**\n * [\n * 'variant-default',\n * 'variant-focus',\n * 'variant-active',\n * 'variant-disabled',\n * ]\n */\n variant: PropTypes.oneOf(buttonVariants).description('variant of the button'),\n /**\n * Refence\n */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'reference to the component',\n ),\n /**\n * Onblur callback\n */\n onBlur: PropTypes.func.description('Allows a function that is triggered once the button is blur'),\n /**\n * Apply intent color: ['success', 'warning', 'danger', 'info']\n * Only valid with buttonType=\"text\"\n */\n intent: PropTypes.oneOf(['success', 'warning', 'danger', 'info']).description(\n 'Apply intent color. Only valid with buttonType=\"text\"',\n ),\n /**\n * additional props for the container\n */\n containerProps: PropTypes.object.description('additional props for the container'),\n /**\n * Allows a function that is triggered once the button is clicked\n */\n onClick: PropTypes.func.description('Allows a function that is triggered once the button is clicked'),\n /**\n * Allows a function that is triggered once the button is key pressed\n */\n onKeyPress: PropTypes.func.description('Allows a function that is triggered once the button is key pressed'),\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,aAAa,sBAAsB;AAErC,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,EAI1B,UAAU,UAAU,OAAO,YAAY,WAAW;AAAA;AAAA;AAAA;AAAA,EAIlD,WAAW,UAAU,OAAO,YAAY,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAI9D,iBAAiB,UAAU,OAAO,YAAY,eAAe;AAAA;AAAA;AAAA;AAAA,EAI7D,IAAI,UAAU,OAAO,YAAY,UAAU,EAAE,aAAa,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIlE,UAAU,UAAU,KAAK,YAAY,uCAAuC;AAAA;AAAA;AAAA;AAAA,EAI5E,YAAY,UAAU,KAAK,YAAY,gEAAgE;AAAA;AAAA;AAAA;AAAA,EAIvG,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC,EAAE;AAAA,IACpE;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,MAAM,UAAU,QAAQ,YAAY,+BAA+B;AAAA;AAAA;AAAA;AAAA,EAInE,UAAU,UAAU,QAAQ,YAAY,4CAA4C;AAAA;AAAA;AAAA;AAAA,EAIpF,YAAY,UAAU,MAAM,WAAW,EAAE,YAAY,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAIzE,MAAM,UAAU,MAAM,YAAY,EAAE,YAAY,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAIpE,MAAM,UAAU,MAAM,CAAC,UAAU,QAAQ,CAAC,EAAE,YAAY,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS5E,SAAS,UAAU,MAAM,cAAc,EAAE,YAAY,uBAAuB;AAAA;AAAA;AAAA;AAAA,EAI5E,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,QAAQ,UAAU,KAAK,YAAY,6DAA6D;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhG,QAAQ,UAAU,MAAM,CAAC,WAAW,WAAW,UAAU,MAAM,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,gBAAgB,UAAU,OAAO,YAAY,oCAAoC;AAAA;AAAA;AAAA;AAAA,EAIjF,SAAS,UAAU,KAAK,YAAY,gEAAgE;AAAA;AAAA;AAAA;AAAA,EAIpG,YAAY,UAAU,KAAK,YAAY,oEAAoE;AAC7G;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/types/DSButton.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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;
|
|
@@ -1,26 +0,0 @@
|
|
|
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"];
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|