@pedidopago/ui 1.3.0 → 1.3.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/components/Alert/alert.test.js +8 -8
- package/dist/components/Alert/index.d.ts +2 -2
- package/dist/components/Alert/index.d.ts.map +1 -1
- package/dist/components/Alert/index.js +7 -26
- package/dist/components/Alert/styles.d.ts +0 -12
- package/dist/components/Alert/styles.d.ts.map +1 -1
- package/dist/components/Alert/styles.js +4 -22
- package/dist/components/Alert/types.d.ts +5 -22
- package/dist/components/Alert/types.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +11 -2
- package/dist/components/Button/styles.js +1 -1
- package/dist/components/Button/types.d.ts +1 -0
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/DateInput/DateInput-example.d.ts +2 -2
- package/dist/components/DateInput/DateInput-example.d.ts.map +1 -1
- package/dist/components/DateInput/DateInput-example.js +10 -15
- package/dist/components/DateInput/dateInput.test.js +4 -4
- package/dist/components/DateInput/index.d.ts +2 -2
- package/dist/components/DateInput/index.d.ts.map +1 -1
- package/dist/components/DateInput/index.js +65 -136
- package/dist/components/DateInput/styles.d.ts +7 -29
- package/dist/components/DateInput/styles.d.ts.map +1 -1
- package/dist/components/DateInput/styles.js +15 -19
- package/dist/components/DateInput/types.d.ts +7 -14
- package/dist/components/DateInput/types.d.ts.map +1 -1
- package/dist/components/DatePicker/datepicker.test.js +8 -8
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +4 -8
- package/dist/components/DatePicker/types.d.ts +3 -4
- package/dist/components/DatePicker/types.d.ts.map +1 -1
- package/dist/components/Input/index.js +14 -15
- package/dist/components/Input/styles.d.ts +1 -0
- package/dist/components/Input/styles.d.ts.map +1 -1
- package/dist/components/Input/styles.js +39 -34
- package/dist/components/Label/index.d.ts +2 -2
- package/dist/components/Label/index.d.ts.map +1 -1
- package/dist/components/Label/index.js +12 -23
- package/dist/components/Label/label.test.d.ts +2 -0
- package/dist/components/Label/label.test.d.ts.map +1 -0
- package/dist/components/Label/label.test.js +105 -0
- package/dist/components/Label/styles.js +1 -1
- package/dist/components/Label/types.d.ts +5 -6
- package/dist/components/Label/types.d.ts.map +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Modal/styles.d.ts.map +1 -1
- package/dist/components/Modal/styles.js +3 -3
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +21 -15
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +13 -3
- package/dist/components/Table/styles.d.ts.map +1 -1
- package/dist/components/Table/styles.js +5 -8
- package/dist/components/Toast/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast/components/Toast.js +6 -7
- package/dist/components/Toast/contexts/ToastProvider.d.ts.map +1 -1
- package/dist/components/Toast/contexts/ToastProvider.js +3 -1
- package/dist/components/Toast/toast.test.js +10 -10
- package/dist/components/Toast/types.d.ts +8 -15
- package/dist/components/Toast/types.d.ts.map +1 -1
- package/dist/components/Tooltip/components/TooltipLabel.d.ts +4 -0
- package/dist/components/Tooltip/components/TooltipLabel.d.ts.map +1 -0
- package/dist/components/Tooltip/components/TooltipLabel.js +59 -0
- package/dist/components/Tooltip/index.d.ts +2 -2
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +91 -74
- package/dist/components/Tooltip/styles.d.ts +6 -14
- package/dist/components/Tooltip/styles.d.ts.map +1 -1
- package/dist/components/Tooltip/styles.js +9 -31
- package/dist/components/Tooltip/types.d.ts +17 -19
- package/dist/components/Tooltip/types.d.ts.map +1 -1
- package/dist/components/Typography/styles.d.ts +2 -2
- package/package.json +1 -1
|
@@ -23,14 +23,14 @@ var setup = function setup(props) {
|
|
|
23
23
|
describe('Alert', function () {
|
|
24
24
|
it('should it render the alert component', function () {
|
|
25
25
|
var container = setup({
|
|
26
|
-
|
|
26
|
+
content: 'test',
|
|
27
27
|
title: 'Test Toast'
|
|
28
28
|
});
|
|
29
29
|
expect(container.getByText('test')).toBeInTheDocument();
|
|
30
30
|
});
|
|
31
31
|
it('should it render the alert component in outlined variant', function () {
|
|
32
32
|
var container = setup({
|
|
33
|
-
|
|
33
|
+
content: 'test',
|
|
34
34
|
title: 'Test Toast',
|
|
35
35
|
variant: 'outlined'
|
|
36
36
|
});
|
|
@@ -38,7 +38,7 @@ describe('Alert', function () {
|
|
|
38
38
|
});
|
|
39
39
|
it('should it render the alert component in closable variant', function () {
|
|
40
40
|
var container = setup({
|
|
41
|
-
|
|
41
|
+
content: 'test',
|
|
42
42
|
title: 'Test Toast',
|
|
43
43
|
variant: 'closable'
|
|
44
44
|
});
|
|
@@ -46,7 +46,7 @@ describe('Alert', function () {
|
|
|
46
46
|
});
|
|
47
47
|
it('should it render the alert component in success type', function () {
|
|
48
48
|
var container = setup({
|
|
49
|
-
|
|
49
|
+
content: 'test',
|
|
50
50
|
title: 'Test Toast',
|
|
51
51
|
type: 'success'
|
|
52
52
|
});
|
|
@@ -54,7 +54,7 @@ describe('Alert', function () {
|
|
|
54
54
|
});
|
|
55
55
|
it('should it render the alert component in error type', function () {
|
|
56
56
|
var container = setup({
|
|
57
|
-
|
|
57
|
+
content: 'test',
|
|
58
58
|
title: 'Test Toast',
|
|
59
59
|
type: 'error'
|
|
60
60
|
});
|
|
@@ -62,7 +62,7 @@ describe('Alert', function () {
|
|
|
62
62
|
});
|
|
63
63
|
it('should it render the alert component in warning type', function () {
|
|
64
64
|
var container = setup({
|
|
65
|
-
|
|
65
|
+
content: 'test',
|
|
66
66
|
title: 'Test Toast',
|
|
67
67
|
type: 'warning'
|
|
68
68
|
});
|
|
@@ -70,7 +70,7 @@ describe('Alert', function () {
|
|
|
70
70
|
});
|
|
71
71
|
it('should it render the alert component in critical type', function () {
|
|
72
72
|
var container = setup({
|
|
73
|
-
|
|
73
|
+
content: 'test',
|
|
74
74
|
title: 'Test Toast',
|
|
75
75
|
type: 'critical'
|
|
76
76
|
});
|
|
@@ -81,7 +81,7 @@ describe('Alert', function () {
|
|
|
81
81
|
|
|
82
82
|
var onClose = jest.fn();
|
|
83
83
|
var container = setup({
|
|
84
|
-
|
|
84
|
+
content: 'test',
|
|
85
85
|
title: 'Test Toast',
|
|
86
86
|
variant: 'closable',
|
|
87
87
|
onClose: onClose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAa3B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CA6BzB,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -16,14 +16,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
18
|
var Alert = function Alert(_ref) {
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
var title = _ref.title,
|
|
20
|
+
content = _ref.content,
|
|
21
|
+
maxWidth = _ref.maxWidth,
|
|
22
22
|
onClose = _ref.onClose,
|
|
23
|
-
title = _ref.title,
|
|
24
|
-
fullWidth = _ref.fullWidth,
|
|
25
|
-
isLoading = _ref.isLoading,
|
|
26
|
-
children = _ref.children,
|
|
27
23
|
_ref$icon = _ref.icon,
|
|
28
24
|
icon = _ref$icon === void 0 ? 'info' : _ref$icon,
|
|
29
25
|
_ref$type = _ref.type,
|
|
@@ -31,13 +27,11 @@ var Alert = function Alert(_ref) {
|
|
|
31
27
|
_ref$variant = _ref.variant,
|
|
32
28
|
variant = _ref$variant === void 0 ? 'filled' : _ref$variant;
|
|
33
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledAlertContainer, {
|
|
34
|
-
children:
|
|
35
|
-
|
|
36
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledAlertWrapper, {
|
|
37
|
-
haveContent: !!message || !!children,
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledAlertWrapper, {
|
|
31
|
+
haveContent: !!content,
|
|
38
32
|
variant: variant,
|
|
39
33
|
type: type,
|
|
40
|
-
|
|
34
|
+
maxWidth: maxWidth,
|
|
41
35
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledIconBox, {
|
|
42
36
|
type: type,
|
|
43
37
|
variant: variant,
|
|
@@ -52,20 +46,7 @@ var Alert = function Alert(_ref) {
|
|
|
52
46
|
fontSize: "xs",
|
|
53
47
|
fontWeight: "bold",
|
|
54
48
|
children: title
|
|
55
|
-
}),
|
|
56
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
57
|
-
fontSize: "xs",
|
|
58
|
-
fontWeight: "400",
|
|
59
|
-
children: message
|
|
60
|
-
}), buttonTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledButtonRow, {
|
|
61
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledButton, {
|
|
62
|
-
onClick: function onClick() {
|
|
63
|
-
return onButtonClick && onButtonClick();
|
|
64
|
-
},
|
|
65
|
-
children: buttonTitle
|
|
66
|
-
})
|
|
67
|
-
})]
|
|
68
|
-
})]
|
|
49
|
+
}), content]
|
|
69
50
|
}), variant === 'closable' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledCloseIcon, {
|
|
70
51
|
onClick: function onClick() {
|
|
71
52
|
return onClose && onClose();
|
|
@@ -22,16 +22,4 @@ export declare const StyledCloseIcon: import("@emotion/styled").StyledComponent<
|
|
|
22
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
23
23
|
as?: import("react").ElementType<any> | undefined;
|
|
24
24
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
25
|
-
export declare const StyledAlertSkeleton: import("@emotion/styled").StyledComponent<{
|
|
26
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
27
|
-
as?: import("react").ElementType<any> | undefined;
|
|
28
|
-
} & IStyledAlert, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
29
|
-
export declare const StyledButtonRow: import("@emotion/styled").StyledComponent<{
|
|
30
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
31
|
-
as?: import("react").ElementType<any> | undefined;
|
|
32
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
33
|
-
export declare const StyledButton: import("@emotion/styled").StyledComponent<{
|
|
34
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
35
|
-
as?: import("react").ElementType<any> | undefined;
|
|
36
|
-
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
37
25
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/styles.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,oBAAoB;;;yGAEhC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/styles.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,oBAAoB;;;yGAEhC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;wHAoD7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;iBAA4C,OAAO;yGA0B3E,CAAC;AAEH,eAAO,MAAM,YAAY;;;wHASxB,CAAC;AAEF,eAAO,MAAM,eAAe;;;yGAS3B,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledIconBox = exports.StyledColumn = exports.StyledCloseIcon = exports.
|
|
6
|
+
exports.StyledIconBox = exports.StyledColumn = exports.StyledCloseIcon = exports.StyledAlertWrapper = exports.StyledAlertContainer = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
|
11
11
|
|
|
12
12
|
var _colorCheck = require("../../utils/colorCheck");
|
|
13
13
|
|
|
14
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5
|
|
14
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@ var StyledAlertWrapper = _styled.default.div(function (props) {
|
|
|
25
25
|
var buttonPrimaryColor = props.type !== 'default' && props.type ? props.theme.colors[props.type].default : props.theme.colors.neutral.neutral3;
|
|
26
26
|
var buttonSecondaryColor = props.type !== 'default' && props.type ? props.theme.colorMode === 'dark' ? props.theme.colors[props.type].dark : props.theme.colors[props.type].blurred : props.theme.colors.neutral.neutral1;
|
|
27
27
|
var secondaryColor = props.type !== 'default' && props.type ? props.theme.colorMode === 'dark' ? props.theme.colors[props.type].dark : props.theme.colors[props.type].blurred : props.theme.colorMode === 'dark' ? props.theme.colors.neutral.neutral6 : props.theme.colors.neutral.neutral1;
|
|
28
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: ", ";\n padding: 1rem;\n gap: 1rem;\n border-radius: 8px;\n
|
|
28
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: ", ";\n padding: 1rem;\n gap: 1rem;\n border-radius: 8px;\n width: 100%;\n background-color: ", ";\n border: ", ";\n color: ", ";\n max-width: ", ";\n\n & button {\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: inherit;\n font-weight: 600;\n cursor: pointer;\n border-radius: 8px;\n padding: 8px 24px;\n background-color: ", ";\n border: ", ";\n color: ", ";\n }\n "])), props.haveContent ? 'flex-start' : 'center', props.variant === 'outlined' ? 'transparent' : secondaryColor, props.variant === 'outlined' ? "2px solid ".concat(secondaryColor, ";") : '', props.variant === 'outlined' ? props.theme.colors.neutral.neutral4 : '', props.maxWidth ? "".concat(props.maxWidth, "px") : '', props.variant === 'outlined' ? buttonSecondaryColor : 'transparent', props.variant !== 'outlined' ? "2px solid ".concat(buttonPrimaryColor) : '0', props.variant === 'outlined' ? buttonPrimaryColor : props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.black);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
exports.StyledAlertWrapper = StyledAlertWrapper;
|
|
@@ -47,22 +47,4 @@ var StyledCloseIcon = _styled.default.div(_templateObject5 || (_templateObject5
|
|
|
47
47
|
return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.black;
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
exports.StyledCloseIcon = StyledCloseIcon;
|
|
51
|
-
|
|
52
|
-
var StyledAlertSkeleton = _styled.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n height: 104px;\n width: ", ";\n border-radius: 8px;\n background-color: ", ";\n overflow: hidden;\n\n &::after {\n content: '';\n inset: 0px;\n width: 100%;\n height: 100%;\n display: block;\n animation: 1.6s linear 0.5s infinite normal none running move;\n transform: translateX(-100%);\n background: linear-gradient(\n 90deg,\n transparent,\n ", ",\n transparent\n );\n }\n\n @keyframes move {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(100%);\n }\n }\n"])), function (props) {
|
|
53
|
-
return props.fullWidth ? '100%' : '459px';
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return props.theme.colors.neutral.neutral1;
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return props.theme.colors.neutral.neutral2;
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
exports.StyledAlertSkeleton = StyledAlertSkeleton;
|
|
61
|
-
|
|
62
|
-
var StyledButtonRow = _styled.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n"])));
|
|
63
|
-
|
|
64
|
-
exports.StyledButtonRow = StyledButtonRow;
|
|
65
|
-
|
|
66
|
-
var StyledButton = _styled.default.button(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral([""])));
|
|
67
|
-
|
|
68
|
-
exports.StyledButton = StyledButton;
|
|
50
|
+
exports.StyledCloseIcon = StyledCloseIcon;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ExtendThemeProps } from 'src';
|
|
3
3
|
import { IconName } from '../Icon/types';
|
|
4
|
-
export declare type
|
|
4
|
+
export declare type AlertProps = {
|
|
5
5
|
/**
|
|
6
6
|
* The icon of the alert.
|
|
7
7
|
* @default 'info'
|
|
@@ -20,32 +20,15 @@ export declare type IAlertProps = {
|
|
|
20
20
|
/**
|
|
21
21
|
* The message of the alert
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* The children of the alert
|
|
26
|
-
* @default undefined
|
|
27
|
-
*/
|
|
28
|
-
children?: ReactNode;
|
|
23
|
+
content?: ReactNode;
|
|
29
24
|
/**
|
|
30
25
|
* The title of the alert
|
|
31
26
|
*/
|
|
32
27
|
title: string;
|
|
33
28
|
/**
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
buttonTitle?: string;
|
|
37
|
-
/**
|
|
38
|
-
* The action of the alert button
|
|
39
|
-
*/
|
|
40
|
-
onButtonClick?: () => void;
|
|
41
|
-
/**
|
|
42
|
-
* Whether the alert is loading
|
|
43
|
-
*/
|
|
44
|
-
isLoading?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Sets a full width alert
|
|
29
|
+
* Sets a max width to alert
|
|
47
30
|
*/
|
|
48
|
-
|
|
31
|
+
maxWidth?: number;
|
|
49
32
|
/**
|
|
50
33
|
* Provides a callback that is called when the close button is clicked.
|
|
51
34
|
* @description This props are available when variant is set to 'closable'
|
|
@@ -53,7 +36,7 @@ export declare type IAlertProps = {
|
|
|
53
36
|
onClose?: () => void;
|
|
54
37
|
};
|
|
55
38
|
export declare type IStyledAlert = {
|
|
56
|
-
|
|
39
|
+
maxWidth?: number;
|
|
57
40
|
variant?: 'outlined' | 'filled' | 'closable';
|
|
58
41
|
type?: 'default' | 'success' | 'warning' | 'error' | 'critical' | 'informative';
|
|
59
42
|
theme?: ExtendThemeProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,oBAAY,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,oBAAY,UAAU,GAAG;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;IAChF;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;IAChF,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAkFtE,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -17,7 +17,7 @@ var _Skeleton = _interopRequireDefault(require("../Skeleton"));
|
|
|
17
17
|
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
|
|
20
|
-
var _excluded = ["children", "leftIcon", "rightIcon", "isLoading", "variant", "bgColor", "size", "fullWidth", "textColor", "type"];
|
|
20
|
+
var _excluded = ["children", "leftIcon", "rightIcon", "isLoading", "variant", "bgColor", "size", "fullWidth", "textColor", "type", "iconColor"];
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
@@ -47,13 +47,16 @@ var Button = function Button(_ref) {
|
|
|
47
47
|
textColor = _ref$textColor === void 0 ? '' : _ref$textColor,
|
|
48
48
|
_ref$type = _ref.type,
|
|
49
49
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
50
|
+
_ref$iconColor = _ref.iconColor,
|
|
51
|
+
iconColor = _ref$iconColor === void 0 ? '' : _ref$iconColor,
|
|
50
52
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
53
|
|
|
52
54
|
var _useTheme = (0, _index.useTheme)(),
|
|
53
55
|
theme = _useTheme.theme;
|
|
54
56
|
|
|
55
57
|
var parsedBgColor = (0, _getColorValue.getColorValue)(bgColor, theme, 'success.default');
|
|
56
|
-
var parsedTextColor = (0, _getColorValue.getColorValue)(textColor, theme, '
|
|
58
|
+
var parsedTextColor = (0, _getColorValue.getColorValue)(textColor, theme, 'neutral.white');
|
|
59
|
+
var parsedIconColor = (0, _getColorValue.getColorValue)(iconColor, theme, 'neutral.white');
|
|
57
60
|
|
|
58
61
|
var getThemeHex = function getThemeHex(path, obj) {
|
|
59
62
|
var separator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
|
|
@@ -79,6 +82,10 @@ var Button = function Button(_ref) {
|
|
|
79
82
|
parsedTextColor = getThemeHex(parsedTextColor, theme);
|
|
80
83
|
}
|
|
81
84
|
|
|
85
|
+
if (parsedIconColor.includes('.')) {
|
|
86
|
+
parsedIconColor = getThemeHex(parsedIconColor, theme);
|
|
87
|
+
}
|
|
88
|
+
|
|
82
89
|
if (isLoading) {
|
|
83
90
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Skeleton.default, {
|
|
84
91
|
width: 200,
|
|
@@ -100,6 +107,7 @@ var Button = function Button(_ref) {
|
|
|
100
107
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.IconContainer, {
|
|
101
108
|
children: [leftIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconWrapper, {
|
|
102
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
110
|
+
color: parsedIconColor,
|
|
103
111
|
name: leftIcon,
|
|
104
112
|
size: iconSize,
|
|
105
113
|
"data-testid": "leftIconId"
|
|
@@ -107,6 +115,7 @@ var Button = function Button(_ref) {
|
|
|
107
115
|
}), children, !leftIcon && rightIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconWrapper, {
|
|
108
116
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
109
117
|
name: rightIcon,
|
|
118
|
+
color: parsedIconColor,
|
|
110
119
|
size: iconSize,
|
|
111
120
|
"data-testid": "rightIconId"
|
|
112
121
|
})
|
|
@@ -62,7 +62,7 @@ var Buttons = _styled.default.button(_templateObject || (_templateObject = _tagg
|
|
|
62
62
|
return (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &:is(&:hover, &:focus):not(:disabled) {\n box-shadow: inset 0 0 40px 40px rgba(0, 0, 0, 0.2);\n }\n "])));
|
|
63
63
|
|
|
64
64
|
case 'outline':
|
|
65
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-color: transparent;\n color: ", ";\n border: 3px ", " solid;\n box-shadow: none;\n &:is(&:hover, &:focus):not(:disabled) {\n filter: var(--button-brightness);\n }\n "])), button.
|
|
65
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-color: transparent;\n color: ", ";\n border: 3px ", " solid;\n box-shadow: none;\n &:is(&:hover, &:focus):not(:disabled) {\n filter: var(--button-brightness);\n }\n "])), button.textColor || button.bgColor || theme.colors.primary.default, button.bgColor || button.textColor || theme.colors.primary.default);
|
|
66
66
|
|
|
67
67
|
case 'ghost':
|
|
68
68
|
return (0, _react.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-inline: 0;\n background-color: transparent;\n color: ", ";\n &:is(&:hover, &:focus):not(:disabled) {\n filter: var(--button-brightness);\n }\n "])), button.bgColor || button.textColor || theme.colors.primary.default);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,aAAK,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAC5D,aAAK,WAAW,GAAG,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACrD,aAAK,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IAChC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,GAAG,CAAC,EAAE,CAAC,CAAC;CACT,CAAC;AACF,aAAK,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;IAErB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,aAAK,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAC5D,aAAK,WAAW,GAAG,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACrD,aAAK,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IAChC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,GAAG,CAAC,EAAE,CAAC,CAAC;CACT,CAAC;AACF,aAAK,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;IAErB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAEvC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAEjD;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED,oBAAY,aAAa,GAAG;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { DateInputProps } from './types';
|
|
3
3
|
export default function DateInputExample({ ...rest }: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
}, props:
|
|
5
|
+
}, props: DateInputProps): JSX.Element;
|
|
6
6
|
//# sourceMappingURL=DateInput-example.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput-example.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/DateInput-example.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DateInput-example.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/DateInput-example.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,GAAG,IAAI,EAAE;;CAAA,EAAE,KAAK,EAAE,cAAc,eAgB1E"}
|
|
@@ -34,26 +34,21 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
34
34
|
function DateInputExample(_ref, props) {
|
|
35
35
|
var rest = _extends({}, _ref);
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// const [selectedPeriod, setSelectedPeriod] = useState<
|
|
38
|
+
// Date | [Date, Date]
|
|
39
|
+
// >(props.selectedPeriod);
|
|
40
|
+
var _useState = (0, _react.useState)(props.type),
|
|
38
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
type = _useState2[0],
|
|
43
|
+
setType = _useState2[1]; // useEffect(() => {
|
|
44
|
+
// setSelectedPeriod(props.selectedPeriod);
|
|
45
|
+
// }, [props.selectedPeriod]);
|
|
41
46
|
|
|
42
|
-
var _useState3 = (0, _react.useState)(props.type),
|
|
43
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
-
type = _useState4[0],
|
|
45
|
-
setType = _useState4[1];
|
|
46
47
|
|
|
47
|
-
(0, _react.useEffect)(function () {
|
|
48
|
-
setSelectedPeriod(props.selectedPeriod);
|
|
49
|
-
}, [props.selectedPeriod]);
|
|
50
48
|
(0, _react.useEffect)(function () {
|
|
51
49
|
setType(props.type);
|
|
52
50
|
}, [props.type]);
|
|
53
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.DateInput, _objectSpread(
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.DateInput, _objectSpread({
|
|
54
52
|
type: type
|
|
55
|
-
}, rest)
|
|
56
|
-
selectedPeriod: selectedPeriod,
|
|
57
|
-
setSelectedPeriod: setSelectedPeriod
|
|
58
|
-
}));
|
|
53
|
+
}, rest));
|
|
59
54
|
}
|
|
@@ -29,10 +29,10 @@ describe('DateInput', function () {
|
|
|
29
29
|
});
|
|
30
30
|
it('should set a value in DateInput', function () {
|
|
31
31
|
var _setup2 = setup({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
type: 'date',
|
|
33
|
+
label: 'label',
|
|
34
|
+
// value:
|
|
35
|
+
onChange: jest.fn()
|
|
36
36
|
}),
|
|
37
37
|
container = _setup2.container;
|
|
38
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare
|
|
2
|
+
import { DateInputProps } from './types';
|
|
3
|
+
export declare function DateInput({ label, placeholder, alert, helperText, value, locales, localeOptions, onChange, ...rest }: DateInputProps): JSX.Element;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/index.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,cAAc,eA0DhB"}
|