@orfium/ictinus 4.22.0 → 4.25.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/dist/components/Button/Button.js +6 -6
- package/dist/components/Button/Button.style.d.ts +0 -2
- package/dist/components/Button/Button.style.js +2 -19
- package/dist/components/Button/ButtonLoader/ButtonLoader.d.ts +7 -0
- package/dist/components/Button/ButtonLoader/ButtonLoader.js +43 -0
- package/dist/components/Button/ButtonLoader/ButtonLoader.style.d.ts +2 -0
- package/dist/components/Button/ButtonLoader/ButtonLoader.style.js +21 -0
- package/dist/components/Button/ButtonLoader/index.d.ts +1 -0
- package/dist/components/Button/ButtonLoader/index.js +10 -0
- package/dist/components/ButtonBase/ButtonBase.d.ts +2 -1
- package/dist/components/ButtonBase/ButtonBase.style.d.ts +22 -16
- package/dist/components/ButtonBase/ButtonBase.style.js +39 -40
- package/dist/components/ButtonBase/config.d.ts +28 -0
- package/dist/components/ButtonBase/config.js +38 -0
- package/dist/components/ButtonBase/utils.d.ts +1 -8
- package/dist/components/ButtonBase/utils.js +4 -29
- package/dist/components/Chip/Chip.d.ts +3 -1
- package/dist/components/Chip/Chip.js +13 -6
- package/dist/components/Chip/Chip.style.d.ts +1 -1
- package/dist/components/Chip/Chip.style.js +32 -22
- package/dist/components/Filter/Filter.style.d.ts +6 -4
- package/dist/components/Filter/Filter.style.js +43 -11
- package/dist/components/Filter/utils.d.ts +3 -3
- package/dist/components/Filter/utils.js +9 -30
- package/dist/components/Icon/assets/iconSelector.js +16 -0
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/Loader/Loader.d.ts +4 -0
- package/dist/components/Loader/Loader.js +3 -2
- package/dist/components/Loader/Loader.utils.d.ts +1 -1
- package/dist/components/Loader/Loader.utils.js +9 -6
- package/dist/components/Loader/components/DotsLoader/DotsLoader.d.ts +1 -0
- package/dist/components/Loader/components/DotsLoader/DotsLoader.js +3 -2
- package/dist/components/Loader/components/DotsLoader/DotsLoader.style.d.ts +3 -2
- package/dist/components/Loader/components/DotsLoader/DotsLoader.style.js +18 -6
- package/dist/components/Loader/components/IndeterminateLoader/IndeterminateLoader.d.ts +1 -0
- package/dist/components/Loader/components/IndeterminateLoader/IndeterminateLoader.js +4 -3
- package/dist/components/Loader/components/IndeterminateLoader/IndeterminateLoader.style.d.ts +2 -2
- package/dist/components/Loader/components/IndeterminateLoader/IndeterminateLoader.style.js +7 -7
- package/dist/components/Loader/components/Spinner/Spinner.d.ts +1 -0
- package/dist/components/Loader/components/Spinner/Spinner.js +3 -2
- package/dist/components/Loader/components/Spinner/Spinner.style.d.ts +1 -1
- package/dist/components/Loader/components/Spinner/Spinner.style.js +2 -2
- package/dist/components/Select/Select.js +0 -3
- package/dist/components/Select/Select.style.d.ts +2 -7
- package/dist/components/Select/Select.style.js +4 -7
- package/dist/components/TextInputBase/TextInputBase.d.ts +2 -1
- package/dist/components/TextInputBase/TextInputBase.js +1 -13
- package/dist/components/TextInputBase/TextInputBase.style.d.ts +2 -1
- package/dist/components/TextInputBase/TextInputBase.style.js +92 -42
- package/dist/components/TextInputBase/config.d.ts +22 -0
- package/dist/components/TextInputBase/config.js +36 -0
- package/dist/theme/palette.d.ts +3 -1
- package/dist/theme/palette.js +9 -5
- package/dist/theme/states/disabled.d.ts +12 -0
- package/dist/theme/states/disabled.js +25 -0
- package/dist/theme/states/focus.d.ts +16 -0
- package/dist/theme/states/focus.js +31 -0
- package/dist/theme/states/hover.d.ts +15 -0
- package/dist/theme/states/hover.js +31 -0
- package/dist/theme/states/index.d.ts +5 -0
- package/dist/theme/states/index.js +19 -0
- package/dist/theme/states/pressed.d.ts +15 -0
- package/dist/theme/states/pressed.js +31 -0
- package/dist/theme/states/statesConfig.d.ts +34 -0
- package/dist/theme/states/statesConfig.js +36 -0
- package/dist/theme/states/utils.d.ts +7 -0
- package/dist/theme/states/utils.js +24 -0
- package/package.json +1 -1
- package/dist/components/AssetMatching/AssetMatching.style.d.ts +0 -11
- package/dist/components/AssetMatching/AssetMatching.style.js +0 -53
- package/dist/components/AssetMatching/Assetmatching.d.ts +0 -35
- package/dist/components/AssetMatching/Assetmatching.js +0 -66
- package/dist/components/AssetMatching/components/ActionsToolbox/ActionsToolbox.d.ts +0 -14
- package/dist/components/AssetMatching/components/ActionsToolbox/ActionsToolbox.js +0 -51
- package/dist/components/AssetMatching/components/ActionsToolbox/ActionsToolbox.style.d.ts +0 -8
- package/dist/components/AssetMatching/components/ActionsToolbox/ActionsToolbox.style.js +0 -42
- package/dist/components/AssetMatching/components/ActionsToolbox/ActionsToolboxWrapper.d.ts +0 -5
- package/dist/components/AssetMatching/components/ActionsToolbox/ActionsToolboxWrapper.js +0 -23
- package/dist/components/AssetMatching/components/ActionsToolbox/PrimaryActions.d.ts +0 -10
- package/dist/components/AssetMatching/components/ActionsToolbox/PrimaryActions.js +0 -42
- package/dist/components/AssetMatching/components/ActionsToolbox/SecondaryActions.d.ts +0 -10
- package/dist/components/AssetMatching/components/ActionsToolbox/SecondaryActions.js +0 -88
- package/dist/components/AssetMatching/components/ActionsToolbox/index.d.ts +0 -2
- package/dist/components/AssetMatching/components/ActionsToolbox/index.js +0 -21
- package/dist/components/AssetMatching/components/Asset/Asset.d.ts +0 -15
- package/dist/components/AssetMatching/components/Asset/Asset.js +0 -38
- package/dist/components/AssetMatching/components/Asset/Asset.style.d.ts +0 -20
- package/dist/components/AssetMatching/components/Asset/Asset.style.js +0 -159
- package/dist/components/AssetMatching/components/Asset/AssetExternalLink.d.ts +0 -7
- package/dist/components/AssetMatching/components/Asset/AssetExternalLink.js +0 -39
- package/dist/components/AssetMatching/components/Asset/AssetHeading.d.ts +0 -12
- package/dist/components/AssetMatching/components/Asset/AssetHeading.js +0 -49
- package/dist/components/AssetMatching/components/Asset/AssetLinkedInfo.d.ts +0 -7
- package/dist/components/AssetMatching/components/Asset/AssetLinkedInfo.js +0 -27
- package/dist/components/AssetMatching/components/Asset/index.d.ts +0 -2
- package/dist/components/AssetMatching/components/Asset/index.js +0 -21
- package/dist/components/AssetMatching/components/Categories/Categories.d.ts +0 -8
- package/dist/components/AssetMatching/components/Categories/Categories.js +0 -37
- package/dist/components/AssetMatching/components/Categories/Categories.style.d.ts +0 -10
- package/dist/components/AssetMatching/components/Categories/Categories.style.js +0 -62
- package/dist/components/AssetMatching/components/Categories/Category.d.ts +0 -12
- package/dist/components/AssetMatching/components/Categories/Category.js +0 -37
- package/dist/components/AssetMatching/components/Categories/CategoryItem.d.ts +0 -6
- package/dist/components/AssetMatching/components/Categories/CategoryItem.js +0 -44
- package/dist/components/AssetMatching/components/Categories/index.d.ts +0 -1
- package/dist/components/AssetMatching/components/Categories/index.js +0 -10
- package/dist/components/AssetMatching/components/CheckBoxContainer/CheckBoxContainer.d.ts +0 -11
- package/dist/components/AssetMatching/components/CheckBoxContainer/CheckBoxContainer.js +0 -48
- package/dist/components/AssetMatching/components/CheckBoxContainer/CheckBoxContainer.style.d.ts +0 -9
- package/dist/components/AssetMatching/components/CheckBoxContainer/CheckBoxContainer.style.js +0 -53
- package/dist/components/AssetMatching/components/CheckBoxContainer/index.d.ts +0 -1
- package/dist/components/AssetMatching/components/CheckBoxContainer/index.js +0 -10
- package/dist/components/AssetMatching/components/SectionHeader/SectionHeader.d.ts +0 -24
- package/dist/components/AssetMatching/components/SectionHeader/SectionHeader.js +0 -59
- package/dist/components/AssetMatching/components/SectionHeader/SectionHeader.style.d.ts +0 -7
- package/dist/components/AssetMatching/components/SectionHeader/SectionHeader.style.js +0 -48
- package/dist/components/AssetMatching/components/SectionHeader/index.d.ts +0 -1
- package/dist/components/AssetMatching/components/SectionHeader/index.js +0 -10
- package/dist/components/AssetMatching/components/SelectedItemContext/SelectedItemProvider.d.ts +0 -4
- package/dist/components/AssetMatching/components/SelectedItemContext/SelectedItemProvider.js +0 -33
- package/dist/components/AssetMatching/components/SelectedItemContext/index.d.ts +0 -2
- package/dist/components/AssetMatching/components/SelectedItemContext/index.js +0 -21
- package/dist/components/AssetMatching/components/index.d.ts +0 -2
- package/dist/components/AssetMatching/components/index.js +0 -19
- package/dist/components/AssetMatching/components/utils.d.ts +0 -13
- package/dist/components/AssetMatching/components/utils.js +0 -98
- package/dist/components/AssetMatching/index.d.ts +0 -5
- package/dist/components/AssetMatching/index.js +0 -34
- package/dist/components/AssetMatching/types.d.ts +0 -6
- package/dist/components/AssetMatching/types.js +0 -3
|
@@ -11,7 +11,7 @@ var _ButtonBase = _interopRequireDefault(require("../ButtonBase/ButtonBase"));
|
|
|
11
11
|
|
|
12
12
|
var _Button = require("./Button.style");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _ButtonLoader = _interopRequireDefault(require("./ButtonLoader"));
|
|
15
15
|
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
17
|
|
|
@@ -73,11 +73,11 @@ var Button = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
73
73
|
disabled: disabled,
|
|
74
74
|
hasChildren: Boolean(_react["default"].Children.count(children))
|
|
75
75
|
})
|
|
76
|
-
}, loading ? (0, _react2.jsx)("
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
type:
|
|
80
|
-
})
|
|
76
|
+
}, loading ? (0, _react2.jsx)(_ButtonLoader["default"], {
|
|
77
|
+
innerButtonWidth: innerButtonWidth,
|
|
78
|
+
color: color,
|
|
79
|
+
type: type
|
|
80
|
+
}) : children), iconRight && (0, _react2.jsx)("span", {
|
|
81
81
|
css: (0, _Button.iconStyle)()
|
|
82
82
|
}, iconRight)));
|
|
83
83
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SerializedStyles } from '@emotion/react';
|
|
2
1
|
import { Theme } from 'theme';
|
|
3
2
|
import { RequiredProperties } from 'utils/common';
|
|
4
3
|
import { Props } from './Button';
|
|
@@ -16,4 +15,3 @@ export declare const childrenWrapperStyle: ({ iconLeft, iconRight, hasChildren,
|
|
|
16
15
|
marginLeft: number | "8";
|
|
17
16
|
marginRight: number | "8";
|
|
18
17
|
};
|
|
19
|
-
export declare const centralizedLoader: (clientWidth?: number) => SerializedStyles;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
5
|
-
|
|
6
|
-
var _react = require("@emotion/react");
|
|
7
|
-
|
|
8
|
-
var _functions = require("../../theme/functions");
|
|
9
|
-
|
|
10
|
-
var _utils = require("../../theme/utils");
|
|
4
|
+
exports.childrenWrapperStyle = exports.iconStyle = exports.buttonSpanStyle = void 0;
|
|
11
5
|
|
|
12
6
|
var buttonSpanStyle = function buttonSpanStyle() {
|
|
13
7
|
return function () {
|
|
@@ -45,15 +39,4 @@ var childrenWrapperStyle = function childrenWrapperStyle(_ref) {
|
|
|
45
39
|
};
|
|
46
40
|
};
|
|
47
41
|
|
|
48
|
-
exports.childrenWrapperStyle = childrenWrapperStyle;
|
|
49
|
-
|
|
50
|
-
var centralizedLoader = function centralizedLoader(clientWidth) {
|
|
51
|
-
return (
|
|
52
|
-
/*#__PURE__*/
|
|
53
|
-
|
|
54
|
-
/*#__PURE__*/
|
|
55
|
-
(0, _react.css)("width:", clientWidth ? (0, _utils.rem)(clientWidth) : 'auto', ";", _functions.flex, ";justify-content:center;" + (process.env.NODE_ENV === "production" ? "" : ";label:centralizedLoader;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0J1dHRvbi9CdXR0b24uc3R5bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0MrRiIsImZpbGUiOiIuLi8uLi8uLi9zcmMvY29tcG9uZW50cy9CdXR0b24vQnV0dG9uLnN0eWxlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBTZXJpYWxpemVkU3R5bGVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgVGhlbWUgfSBmcm9tICd0aGVtZSc7XG5pbXBvcnQgeyBmbGV4IH0gZnJvbSAndGhlbWUvZnVuY3Rpb25zJztcbmltcG9ydCB7IHJlbSB9IGZyb20gJ3RoZW1lL3V0aWxzJztcbmltcG9ydCB7IFJlcXVpcmVkUHJvcGVydGllcyB9IGZyb20gJ3V0aWxzL2NvbW1vbic7XG5cbmltcG9ydCB7IFByb3BzIH0gZnJvbSAnLi9CdXR0b24nO1xuXG5leHBvcnQgY29uc3QgYnV0dG9uU3BhblN0eWxlID0gKCkgPT4gKCkgPT4ge1xuICByZXR1cm4ge1xuICAgIGRpc3BsYXk6ICdmbGV4JyxcbiAgICBhbGlnbkl0ZW1zOiAnY2VudGVyJyxcbiAgICBqdXN0aWZ5Q29udGVudDogJ2NlbnRlcicsXG4gIH07XG59O1xuXG5leHBvcnQgY29uc3QgaWNvblN0eWxlID0gKCkgPT4gKCkgPT4gKHtcbiAgZGlzcGxheTogJ2lubGluZS1mbGV4Jyxcbn0pO1xuXG5leHBvcnQgY29uc3QgY2hpbGRyZW5XcmFwcGVyU3R5bGUgPSAoe1xuICBpY29uTGVmdCxcbiAgaWNvblJpZ2h0LFxuICBoYXNDaGlsZHJlbixcbn06IFJlcXVpcmVkUHJvcGVydGllczxcbiAgT21pdDxQcm9wcywgJ2Jsb2NrJyB8ICdpc0ljb25CdXR0b24nIHwgJ2J1dHRvblR5cGUnIHwgJ2RhdGFUZXN0SWQnIHwgJ29uQ2xpY2snPiAmIHtcbiAgICBoYXNDaGlsZHJlbjogYm9vbGVhbjtcbiAgfVxuPikgPT4gKHRoZW1lOiBUaGVtZSkgPT4ge1xuICBjb25zdCByaWdodEljb25FeGlzdHMgPSBoYXNDaGlsZHJlbiAmJiBpY29uUmlnaHQ7XG4gIGNvbnN0IGxlZnRJY29uRXhpc3RzID0gaGFzQ2hpbGRyZW4gJiYgaWNvbkxlZnQ7XG5cbiAgcmV0dXJuIHtcbiAgICBtYXJnaW5MZWZ0OiBsZWZ0SWNvbkV4aXN0cyA/IHRoZW1lLnNwYWNpbmcuc20gOiAwLFxuICAgIG1hcmdpblJpZ2h0OiByaWdodEljb25FeGlzdHMgPyB0aGVtZS5zcGFjaW5nLnNtIDogMCxcbiAgfTtcbn07XG5cbmV4cG9ydCBjb25zdCBjZW50cmFsaXplZExvYWRlcjogKGNsaWVudFdpZHRoPzogbnVtYmVyKSA9PiBTZXJpYWxpemVkU3R5bGVzID0gY2xpZW50V2lkdGggPT4gY3NzYFxuICB3aWR0aDogJHtjbGllbnRXaWR0aCA/IHJlbShjbGllbnRXaWR0aCkgOiAnYXV0byd9O1xuICAke2ZsZXh9O1xuICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbmA7XG4iXX0= */", process.env.NODE_ENV === "production" ? "" : ";label:centralizedLoader;")
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
exports.centralizedLoader = centralizedLoader;
|
|
42
|
+
exports.childrenWrapperStyle = childrenWrapperStyle;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Props as ButtonBaseProps } from '../../ButtonBase/ButtonBase';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
innerButtonWidth?: number;
|
|
5
|
+
} & Pick<ButtonBaseProps, 'type' | 'color'>;
|
|
6
|
+
declare const ButtonLoader: React.FC<Props>;
|
|
7
|
+
export default ButtonLoader;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _useTypeColorToColorMatch = require("../../../hooks/useTypeColorToColorMatch");
|
|
9
|
+
|
|
10
|
+
var _index = require("../../../index");
|
|
11
|
+
|
|
12
|
+
var _ButtonLoader = require("./ButtonLoader.style");
|
|
13
|
+
|
|
14
|
+
var _Loader = _interopRequireDefault(require("../../Loader"));
|
|
15
|
+
|
|
16
|
+
var _react2 = require("@emotion/react");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
var ButtonLoader = function ButtonLoader(_ref) {
|
|
21
|
+
var innerButtonWidth = _ref.innerButtonWidth,
|
|
22
|
+
_ref$type = _ref.type,
|
|
23
|
+
type = _ref$type === void 0 ? 'primary' : _ref$type,
|
|
24
|
+
_ref$color = _ref.color,
|
|
25
|
+
color = _ref$color === void 0 ? '' : _ref$color;
|
|
26
|
+
var theme = (0, _index.useTheme)();
|
|
27
|
+
|
|
28
|
+
var _useTypeColorToColorM = (0, _useTypeColorToColorMatch.useTypeColorToColorMatch)(),
|
|
29
|
+
calculateColorBetweenColorAndType = _useTypeColorToColorM.calculateColorBetweenColorAndType;
|
|
30
|
+
|
|
31
|
+
var calculatedColor = calculateColorBetweenColorAndType(color, type);
|
|
32
|
+
var spinnerColor = theme.utils.getAAColorFromSwatches(calculatedColor.color, calculatedColor.shade);
|
|
33
|
+
return (0, _react2.jsx)("div", {
|
|
34
|
+
css: (0, _ButtonLoader.centralizedLoader)(innerButtonWidth)
|
|
35
|
+
}, (0, _react2.jsx)(_Loader["default"], {
|
|
36
|
+
type: 'spinner',
|
|
37
|
+
color: spinnerColor
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
ButtonLoader.displayName = 'Button';
|
|
42
|
+
var _default = ButtonLoader;
|
|
43
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.centralizedLoader = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = require("@emotion/react");
|
|
7
|
+
|
|
8
|
+
var _functions = require("../../../theme/functions");
|
|
9
|
+
|
|
10
|
+
var _utils = require("../../../theme/utils");
|
|
11
|
+
|
|
12
|
+
var centralizedLoader = function centralizedLoader(clientWidth) {
|
|
13
|
+
return (
|
|
14
|
+
/*#__PURE__*/
|
|
15
|
+
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
(0, _react.css)("width:", clientWidth ? (0, _utils.rem)(clientWidth) : 'auto', ";", _functions.flex, ";justify-content:center;" + (process.env.NODE_ENV === "production" ? "" : ";label:centralizedLoader;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0J1dHRvbi9CdXR0b25Mb2FkZXIvQnV0dG9uTG9hZGVyLnN0eWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUkrRiIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9CdXR0b24vQnV0dG9uTG9hZGVyL0J1dHRvbkxvYWRlci5zdHlsZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcywgU2VyaWFsaXplZFN0eWxlcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IGZsZXggfSBmcm9tICd0aGVtZS9mdW5jdGlvbnMnO1xuaW1wb3J0IHsgcmVtIH0gZnJvbSAndGhlbWUvdXRpbHMnO1xuXG5leHBvcnQgY29uc3QgY2VudHJhbGl6ZWRMb2FkZXI6IChjbGllbnRXaWR0aD86IG51bWJlcikgPT4gU2VyaWFsaXplZFN0eWxlcyA9IGNsaWVudFdpZHRoID0+IGNzc2BcbiAgd2lkdGg6ICR7Y2xpZW50V2lkdGggPyByZW0oY2xpZW50V2lkdGgpIDogJ2F1dG8nfTtcbiAgJHtmbGV4fTtcbiAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5gO1xuIl19 */", process.env.NODE_ENV === "production" ? "" : ";label:centralizedLoader;")
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.centralizedLoader = centralizedLoader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ButtonLoader';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
|
|
6
|
+
var _ButtonLoader = _interopRequireDefault(require("./ButtonLoader"));
|
|
7
|
+
|
|
8
|
+
exports["default"] = _ButtonLoader["default"];
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ClickEvent } from '../../hooks/useLoading';
|
|
3
3
|
import { AcceptedColorComponentTypes } from '../../utils/themeFunctions';
|
|
4
4
|
import { TestProps } from '../../utils/types';
|
|
5
|
+
import { buttonSizes } from './config';
|
|
5
6
|
export declare type EventButtonProps = {
|
|
6
7
|
onClick?: (event: ClickEvent) => void;
|
|
7
8
|
onBlur?: () => void;
|
|
@@ -12,7 +13,7 @@ export declare type Props = {
|
|
|
12
13
|
/** the color of the button based on our colors eg. red-500 */
|
|
13
14
|
color?: string;
|
|
14
15
|
/** This property define the size of the button. Defaults to 'md' */
|
|
15
|
-
size?:
|
|
16
|
+
size?: typeof buttonSizes[number];
|
|
16
17
|
/** This property will make the button fit to its parent width. Defaults to false */
|
|
17
18
|
block?: boolean;
|
|
18
19
|
/** Property indicating if the component is filled with a color based on the type */
|
|
@@ -2,31 +2,34 @@ import { Theme } from '../../theme';
|
|
|
2
2
|
import { RequiredProperties } from '../../utils/common';
|
|
3
3
|
import { ColorShapeFromComponent } from '../../utils/themeFunctions';
|
|
4
4
|
import { Props } from './ButtonBase';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare const heightBasedOnSize: (size:
|
|
8
|
-
export declare const buttonBaseStyle: ({ type, filled, calculatedColor, size, block,
|
|
5
|
+
import { buttonSizes } from './config';
|
|
6
|
+
/** Calculates the button specific height based on the size passed to it **/
|
|
7
|
+
export declare const heightBasedOnSize: (size: typeof buttonSizes[number]) => string;
|
|
8
|
+
export declare const buttonBaseStyle: ({ type, filled, calculatedColor, size, block, isIconButton, transparent, childrenCount, }: RequiredProperties<Omit<Props, "buttonType"> & {
|
|
9
9
|
calculatedColor: ColorShapeFromComponent;
|
|
10
10
|
childrenCount: number;
|
|
11
11
|
}>) => (theme: Theme) => {
|
|
12
|
-
fontSize:
|
|
12
|
+
fontSize: any;
|
|
13
13
|
fontWeight: 500;
|
|
14
14
|
color: string;
|
|
15
15
|
width: string | undefined;
|
|
16
16
|
backgroundColor: string;
|
|
17
17
|
padding: string;
|
|
18
18
|
height: string;
|
|
19
|
-
opacity: number;
|
|
20
19
|
borderRadius: "4";
|
|
21
20
|
border: string;
|
|
22
21
|
cursor: string;
|
|
23
22
|
transition: string;
|
|
24
|
-
':
|
|
25
|
-
|
|
23
|
+
':focus-visible:not(:disabled)': {
|
|
24
|
+
outline: string;
|
|
26
25
|
};
|
|
27
|
-
':
|
|
28
|
-
backgroundColor: string
|
|
26
|
+
':hover:not(:disabled)': {
|
|
27
|
+
backgroundColor: string;
|
|
29
28
|
};
|
|
29
|
+
':active:not(:disabled)': {
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
};
|
|
32
|
+
':disabled': import("../../theme/states/disabled").GetDisabled;
|
|
30
33
|
} | {
|
|
31
34
|
display: string;
|
|
32
35
|
justifyContent: string;
|
|
@@ -34,21 +37,24 @@ export declare const buttonBaseStyle: ({ type, filled, calculatedColor, size, bl
|
|
|
34
37
|
borderRadius: string;
|
|
35
38
|
padding: number;
|
|
36
39
|
width: string;
|
|
37
|
-
fontSize:
|
|
40
|
+
fontSize: any;
|
|
38
41
|
fontWeight: 500;
|
|
39
42
|
color: string;
|
|
40
43
|
backgroundColor: string;
|
|
41
44
|
height: string;
|
|
42
|
-
opacity: number;
|
|
43
45
|
border: string;
|
|
44
46
|
cursor: string;
|
|
45
47
|
transition: string;
|
|
46
|
-
':
|
|
47
|
-
|
|
48
|
+
':focus-visible:not(:disabled)': {
|
|
49
|
+
outline: string;
|
|
50
|
+
};
|
|
51
|
+
':hover:not(:disabled)': {
|
|
52
|
+
backgroundColor: string;
|
|
48
53
|
};
|
|
49
|
-
':active': {
|
|
50
|
-
backgroundColor: string
|
|
54
|
+
':active:not(:disabled)': {
|
|
55
|
+
backgroundColor: string;
|
|
51
56
|
};
|
|
57
|
+
':disabled': import("../../theme/states/disabled").GetDisabled;
|
|
52
58
|
};
|
|
53
59
|
export declare const buttonSpanStyle: () => () => {
|
|
54
60
|
display: string;
|
|
@@ -3,42 +3,27 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.iconStyle = exports.buttonSpanStyle = exports.buttonBaseStyle = exports.heightBasedOnSize = void 0;
|
|
5
5
|
|
|
6
|
-
var _polished = require("polished");
|
|
7
|
-
|
|
8
6
|
var _utils = require("../../theme/utils");
|
|
9
7
|
|
|
8
|
+
var _states = require("../../theme/states");
|
|
9
|
+
|
|
10
|
+
var _config = require("./config");
|
|
11
|
+
|
|
10
12
|
var _utils2 = require("./utils");
|
|
11
13
|
|
|
12
14
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
15
|
|
|
14
|
-
/** Calculates the button specific height based on the size passed to it
|
|
15
|
-
* These sizes are specific to this button thus these are placed here and not in the config **/
|
|
16
|
+
/** Calculates the button specific height based on the size passed to it **/
|
|
16
17
|
var heightBasedOnSize = function heightBasedOnSize(size) {
|
|
17
|
-
|
|
18
|
-
case 'lg':
|
|
19
|
-
return (0, _utils.rem)(56);
|
|
20
|
-
|
|
21
|
-
case 'sm':
|
|
22
|
-
return (0, _utils.rem)(36);
|
|
23
|
-
|
|
24
|
-
default:
|
|
25
|
-
return (0, _utils.rem)(46);
|
|
26
|
-
}
|
|
18
|
+
return (0, _utils.rem)(_config.buttonConfig.sizes[size] || _config.buttonConfig.sizes["default"]);
|
|
27
19
|
};
|
|
28
|
-
/** Calculates the button specific font size based on the size passed to it
|
|
29
|
-
* These sizes are specific to this button thus these are placed here and not in the config **/
|
|
20
|
+
/** Calculates the button specific font size based on the size passed to it **/
|
|
30
21
|
|
|
31
22
|
|
|
32
23
|
exports.heightBasedOnSize = heightBasedOnSize;
|
|
33
24
|
|
|
34
25
|
var fontSizeBasedOnSize = function fontSizeBasedOnSize(theme, size) {
|
|
35
|
-
|
|
36
|
-
case 'sm':
|
|
37
|
-
return theme.typography.fontSizes['13'];
|
|
38
|
-
|
|
39
|
-
default:
|
|
40
|
-
return theme.typography.fontSizes['16'];
|
|
41
|
-
}
|
|
26
|
+
return theme.typography.fontSizes[_config.buttonConfig.fontSize[size] || _config.buttonConfig.fontSize["default"]];
|
|
42
27
|
};
|
|
43
28
|
|
|
44
29
|
var buttonBaseStyle = function buttonBaseStyle(_ref) {
|
|
@@ -47,46 +32,60 @@ var buttonBaseStyle = function buttonBaseStyle(_ref) {
|
|
|
47
32
|
calculatedColor = _ref.calculatedColor,
|
|
48
33
|
size = _ref.size,
|
|
49
34
|
block = _ref.block,
|
|
50
|
-
iconLeft = _ref.iconLeft,
|
|
51
|
-
iconRight = _ref.iconRight,
|
|
52
35
|
isIconButton = _ref.isIconButton,
|
|
53
|
-
disabled = _ref.disabled,
|
|
54
36
|
transparent = _ref.transparent,
|
|
55
37
|
childrenCount = _ref.childrenCount;
|
|
56
38
|
return function (theme) {
|
|
57
|
-
var
|
|
39
|
+
var backGroundColor = (0, _utils2.defineBackgroundColor)(theme, calculatedColor, type, childrenCount > 0);
|
|
40
|
+
var isOutlined = !filled && !transparent;
|
|
58
41
|
|
|
59
42
|
var calculateButtonColor = function calculateButtonColor() {
|
|
60
43
|
if (type === 'link') {
|
|
61
|
-
|
|
44
|
+
var color = _config.buttonConfig.types.link.color;
|
|
45
|
+
return theme.utils.getColor(color.name, color.shade);
|
|
62
46
|
}
|
|
63
47
|
|
|
64
|
-
if (
|
|
65
|
-
return
|
|
48
|
+
if (isOutlined || transparent) {
|
|
49
|
+
return backGroundColor;
|
|
66
50
|
}
|
|
67
51
|
|
|
68
52
|
return theme.utils.getAAColorFromSwatches(calculatedColor.color, calculatedColor.shade);
|
|
69
53
|
};
|
|
70
54
|
|
|
55
|
+
var borderWidth = isOutlined ? _config.buttonConfig.types.outlined.border.width : 0;
|
|
71
56
|
var baseButtonStyles = {
|
|
72
57
|
fontSize: fontSizeBasedOnSize(theme, size),
|
|
73
58
|
fontWeight: theme.typography.weights.medium,
|
|
74
59
|
color: calculateButtonColor(),
|
|
75
60
|
width: block ? '100%' : undefined,
|
|
76
|
-
backgroundColor:
|
|
77
|
-
padding: size === '
|
|
61
|
+
backgroundColor: isOutlined || transparent ? 'transparent' : backGroundColor,
|
|
62
|
+
padding: size === 'lg' ? theme.spacing.md : "0 " + theme.spacing.md,
|
|
78
63
|
height: heightBasedOnSize(size),
|
|
79
|
-
opacity: disabled ? 0.5 : 1,
|
|
80
64
|
borderRadius: theme.spacing.xsm,
|
|
81
|
-
border:
|
|
65
|
+
border: isOutlined ? "solid " + (0, _utils.rem)(borderWidth) + " " + backGroundColor : 'none',
|
|
82
66
|
cursor: 'pointer',
|
|
83
|
-
transition: 'background-color 150ms linear',
|
|
84
|
-
':
|
|
85
|
-
|
|
67
|
+
transition: 'background-color,border 150ms linear',
|
|
68
|
+
':focus-visible:not(:disabled)': {
|
|
69
|
+
outline: (0, _states.getFocus)({
|
|
70
|
+
theme: theme,
|
|
71
|
+
borderWidth: borderWidth
|
|
72
|
+
}).styleOutline
|
|
86
73
|
},
|
|
87
|
-
':
|
|
88
|
-
backgroundColor:
|
|
89
|
-
|
|
74
|
+
':hover:not(:disabled)': {
|
|
75
|
+
backgroundColor: (0, _states.getHover)({
|
|
76
|
+
theme: theme,
|
|
77
|
+
color: calculatedColor.color,
|
|
78
|
+
shade: isOutlined || transparent ? 0 : calculatedColor.shade
|
|
79
|
+
}).backgroundColor
|
|
80
|
+
},
|
|
81
|
+
':active:not(:disabled)': {
|
|
82
|
+
backgroundColor: (0, _states.getPressed)({
|
|
83
|
+
theme: theme,
|
|
84
|
+
color: calculatedColor.color,
|
|
85
|
+
shade: isOutlined || transparent ? 0 : calculatedColor.shade
|
|
86
|
+
}).backgroundColor
|
|
87
|
+
},
|
|
88
|
+
':disabled': (0, _states.getDisabled)()
|
|
90
89
|
};
|
|
91
90
|
|
|
92
91
|
if (isIconButton) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { colorShades, flatColors } from '../../theme/palette';
|
|
2
|
+
export declare const LG = "lg";
|
|
3
|
+
export declare const MD = "md";
|
|
4
|
+
export declare const SM = "sm";
|
|
5
|
+
export declare const buttonSizes: readonly ["lg", "md", "sm"];
|
|
6
|
+
declare type ButtonConfig = {
|
|
7
|
+
sizes: {
|
|
8
|
+
[key in typeof buttonSizes[number] | 'default']: number;
|
|
9
|
+
};
|
|
10
|
+
fontSize: {
|
|
11
|
+
[key in typeof SM | 'default']: number;
|
|
12
|
+
};
|
|
13
|
+
types: {
|
|
14
|
+
link: {
|
|
15
|
+
color: {
|
|
16
|
+
name: typeof flatColors[number];
|
|
17
|
+
shade: typeof colorShades[number];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
outlined: {
|
|
21
|
+
border: {
|
|
22
|
+
width: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const buttonConfig: ButtonConfig;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.buttonConfig = exports.buttonSizes = exports.SM = exports.MD = exports.LG = void 0;
|
|
5
|
+
var LG = 'lg';
|
|
6
|
+
exports.LG = LG;
|
|
7
|
+
var MD = 'md';
|
|
8
|
+
exports.MD = MD;
|
|
9
|
+
var SM = 'sm';
|
|
10
|
+
exports.SM = SM;
|
|
11
|
+
var buttonSizes = [LG, MD, SM];
|
|
12
|
+
exports.buttonSizes = buttonSizes;
|
|
13
|
+
var buttonConfig = {
|
|
14
|
+
sizes: {
|
|
15
|
+
lg: 56,
|
|
16
|
+
md: 46,
|
|
17
|
+
sm: 36,
|
|
18
|
+
"default": 46
|
|
19
|
+
},
|
|
20
|
+
fontSize: {
|
|
21
|
+
sm: 13,
|
|
22
|
+
"default": 16
|
|
23
|
+
},
|
|
24
|
+
types: {
|
|
25
|
+
link: {
|
|
26
|
+
color: {
|
|
27
|
+
name: 'blue',
|
|
28
|
+
shade: 550
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
outlined: {
|
|
32
|
+
border: {
|
|
33
|
+
width: 1
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.buttonConfig = buttonConfig;
|
|
@@ -5,11 +5,4 @@ import { ColorShapeFromComponent } from '../../utils/themeFunctions';
|
|
|
5
5
|
* if color it retrieves the color directly from the palette
|
|
6
6
|
* if type it gets the specific type color from the palette
|
|
7
7
|
*/
|
|
8
|
-
export declare const defineBackgroundColor: (theme: Theme, color: ColorShapeFromComponent | undefined, type?: "primary" | "secondary" | "success" | "error" | "warning" | "info" | "light" | "link" | undefined,
|
|
9
|
-
/**
|
|
10
|
-
* return the correct color to show based on the state that is passed
|
|
11
|
-
* The state must be 'hover' or 'active' for now
|
|
12
|
-
* It is being defined by the team that the values will always be 10% and 20%
|
|
13
|
-
* for transparentize there is a revert to these values to match 90% and 80% accordingly
|
|
14
|
-
*/
|
|
15
|
-
export declare const stateBackgroundColor: (theme: Theme, state: 'hover' | 'active', calculatedColor: ColorShapeFromComponent, filled: boolean) => string;
|
|
8
|
+
export declare const defineBackgroundColor: (theme: Theme, color: ColorShapeFromComponent | undefined, type?: "primary" | "secondary" | "success" | "error" | "warning" | "info" | "light" | "link" | undefined, childrenExists?: boolean | undefined) => string;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.defineBackgroundColor = void 0;
|
|
5
5
|
|
|
6
6
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
7
7
|
|
|
8
|
-
var _polished = require("polished");
|
|
9
|
-
|
|
10
|
-
var _palette = require("../../theme/palette");
|
|
11
|
-
|
|
12
8
|
var _themeFunctions = require("../../utils/themeFunctions");
|
|
13
9
|
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -18,8 +14,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
18
14
|
* if color it retrieves the color directly from the palette
|
|
19
15
|
* if type it gets the specific type color from the palette
|
|
20
16
|
*/
|
|
21
|
-
var defineBackgroundColor = function defineBackgroundColor(theme, color, type,
|
|
22
|
-
if (
|
|
17
|
+
var defineBackgroundColor = function defineBackgroundColor(theme, color, type, childrenExists) {
|
|
18
|
+
if (type === 'link') {
|
|
23
19
|
return 'transparent';
|
|
24
20
|
}
|
|
25
21
|
|
|
@@ -33,26 +29,5 @@ var defineBackgroundColor = function defineBackgroundColor(theme, color, type, i
|
|
|
33
29
|
|
|
34
30
|
return 'transparent';
|
|
35
31
|
};
|
|
36
|
-
/**
|
|
37
|
-
* return the correct color to show based on the state that is passed
|
|
38
|
-
* The state must be 'hover' or 'active' for now
|
|
39
|
-
* It is being defined by the team that the values will always be 10% and 20%
|
|
40
|
-
* for transparentize there is a revert to these values to match 90% and 80% accordingly
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
exports.defineBackgroundColor = defineBackgroundColor;
|
|
45
|
-
|
|
46
|
-
var stateBackgroundColor = function stateBackgroundColor(theme, state, calculatedColor, filled) {
|
|
47
|
-
var value = state === 'hover' ? 0.1 : 0.2;
|
|
48
|
-
var color = defineBackgroundColor(theme, calculatedColor);
|
|
49
|
-
|
|
50
|
-
if (!filled) {
|
|
51
|
-
// value here is reverted to follow tranparentize e.g (1 - 0.1 = 0.9)
|
|
52
|
-
return (0, _polished.transparentize)(1 - value, color);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return calculatedColor.shade > _palette.BASE_SHADE ? (0, _polished.lighten)(value, color) : (0, _polished.darken)(value, color);
|
|
56
|
-
};
|
|
57
32
|
|
|
58
|
-
exports.
|
|
33
|
+
exports.defineBackgroundColor = defineBackgroundColor;
|
|
@@ -26,9 +26,11 @@ export declare type Props = {
|
|
|
26
26
|
onClick?: (event: ClickEvent) => void;
|
|
27
27
|
/** A callback that is being triggered when type is interactive and you press the X icon. */
|
|
28
28
|
onClear?: () => void;
|
|
29
|
+
/** Boolean defining if the chip is disabled. Interactive only. */
|
|
30
|
+
disabled?: boolean;
|
|
29
31
|
};
|
|
30
32
|
declare type TestProps = {
|
|
31
33
|
dataTestId?: TestId;
|
|
32
34
|
};
|
|
33
|
-
declare const Chip: React.ForwardRefExoticComponent<Pick<Props & TestProps & DivProps, "children" | "onChange" | "color" | "onBlur" | "type" | "autoFocus" | "
|
|
35
|
+
declare const Chip: React.ForwardRefExoticComponent<Pick<Props & TestProps & DivProps, "children" | "onChange" | "color" | "onBlur" | "type" | "autoFocus" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "download" | "encType" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "useMap" | "width" | "wmode" | "wrap" | "key" | "dataTestId" | keyof Props> & React.RefAttributes<HTMLButtonElement>>;
|
|
34
36
|
export default Chip;
|
|
@@ -28,6 +28,8 @@ var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
28
28
|
thumbnail = _ref.thumbnail,
|
|
29
29
|
isSelected = _ref.isSelected,
|
|
30
30
|
isChecked = _ref.isChecked,
|
|
31
|
+
_ref$disabled = _ref.disabled,
|
|
32
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
31
33
|
badgeNumber = _ref.badgeNumber,
|
|
32
34
|
onClick = _ref.onClick,
|
|
33
35
|
onClear = _ref.onClear,
|
|
@@ -35,24 +37,26 @@ var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
35
37
|
dataTestId = _ref$dataTestId === void 0 ? '' : _ref$dataTestId,
|
|
36
38
|
children = _ref.children;
|
|
37
39
|
|
|
38
|
-
if (styleType === 'read-only' && (isSelected || isChecked || badgeNumber)) {
|
|
39
|
-
throw new Error('The properties isSelected, isChecked and
|
|
40
|
+
if (styleType === 'read-only' && (isSelected || isChecked || badgeNumber || disabled)) {
|
|
41
|
+
throw new Error('The properties isSelected, isChecked, badgeNumber and disabled are only for Interactive style type Chips.');
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
if (styleType === 'interactive' && thumbnail) {
|
|
43
45
|
throw new Error('The property thumbnail is only for Read-Only style type Chips.');
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
return (0, _react2.jsx)("
|
|
48
|
+
return (0, _react2.jsx)("button", {
|
|
47
49
|
ref: ref,
|
|
48
50
|
"data-testid": (0, _helpers.generateTestDataId)('chip', dataTestId),
|
|
49
51
|
onClick: onClick,
|
|
52
|
+
disabled: disabled,
|
|
50
53
|
css: (0, _Chip.chipStyle)({
|
|
51
54
|
styleType: styleType,
|
|
52
55
|
fill: fill,
|
|
53
56
|
isSelected: isSelected,
|
|
54
57
|
onClear: onClear,
|
|
55
|
-
onClick: onClick
|
|
58
|
+
onClick: onClick,
|
|
59
|
+
disabled: disabled
|
|
56
60
|
})
|
|
57
61
|
}, isChecked && (0, _react2.jsx)(_Icon["default"], {
|
|
58
62
|
size: 14,
|
|
@@ -69,7 +73,7 @@ var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
69
73
|
isSelected: isSelected,
|
|
70
74
|
dataTestId: dataTestId
|
|
71
75
|
}), onClear && (0, _react2.jsx)("div", {
|
|
72
|
-
css: (0, _Chip.closeIconWrapperStyle)()
|
|
76
|
+
css: (0, _Chip.closeIconWrapperStyle)(disabled)
|
|
73
77
|
}, (0, _react2.jsx)(_Icon["default"], {
|
|
74
78
|
size: 14,
|
|
75
79
|
name: 'close',
|
|
@@ -77,7 +81,10 @@ var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
77
81
|
variant: 850,
|
|
78
82
|
onClick: function onClick(e) {
|
|
79
83
|
e.stopPropagation();
|
|
80
|
-
|
|
84
|
+
|
|
85
|
+
if (!disabled) {
|
|
86
|
+
onClear();
|
|
87
|
+
}
|
|
81
88
|
}
|
|
82
89
|
})));
|
|
83
90
|
});
|