@pedidopago/ui 1.3.20 → 1.3.23
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/README.md +93 -93
- package/dist/components/Button/Button.test.js +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +38 -45
- package/dist/components/CollapseCard/ExpandButton/index.d.ts +4 -0
- package/dist/components/CollapseCard/ExpandButton/index.d.ts.map +1 -0
- package/dist/components/CollapseCard/ExpandButton/index.js +47 -0
- package/dist/components/CollapseCard/ExpandButton/styles.d.ts +268 -0
- package/dist/components/CollapseCard/ExpandButton/styles.d.ts.map +1 -0
- package/dist/components/CollapseCard/ExpandButton/styles.js +22 -0
- package/dist/components/CollapseCard/ExpandButton/types.d.ts +6 -0
- package/dist/components/CollapseCard/ExpandButton/types.d.ts.map +1 -0
- package/dist/components/CollapseCard/ExpandButton/types.js +1 -0
- package/dist/components/CollapseCard/expand-button.test.d.ts +2 -0
- package/dist/components/CollapseCard/expand-button.test.d.ts.map +1 -0
- package/dist/components/CollapseCard/expand-button.test.js +196 -0
- package/dist/components/CollapseCard/index.d.ts +5 -0
- package/dist/components/CollapseCard/index.d.ts.map +1 -0
- package/dist/components/CollapseCard/index.js +121 -0
- package/dist/components/CollapseCard/styles.d.ts +266 -0
- package/dist/components/CollapseCard/styles.d.ts.map +1 -0
- package/dist/components/CollapseCard/styles.js +32 -0
- package/dist/components/CollapseCard/types.d.ts +13 -0
- package/dist/components/CollapseCard/types.d.ts.map +1 -0
- package/dist/components/CollapseCard/types.js +1 -0
- package/dist/components/DateInput/index.js +1 -1
- package/dist/components/Icon/data/dash.d.ts.map +1 -1
- package/dist/components/Icon/data/dash.js +1 -1
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/Icon/types.d.ts.map +1 -1
- package/dist/components/Illustration/AlternativeOrderSvg/index.d.ts +5 -0
- package/dist/components/Illustration/AlternativeOrderSvg/index.d.ts.map +1 -0
- package/dist/components/Illustration/AlternativeOrderSvg/index.js +107 -0
- package/dist/components/Illustration/CollaboratorSvg/index.d.ts +5 -0
- package/dist/components/Illustration/CollaboratorSvg/index.d.ts.map +1 -0
- package/dist/components/Illustration/CollaboratorSvg/index.js +99 -0
- package/dist/components/Illustration/index.d.ts.map +1 -1
- package/dist/components/Illustration/index.js +14 -0
- package/dist/components/Illustration/styles.d.ts.map +1 -1
- package/dist/components/Illustration/styles.js +7 -1
- package/dist/components/Illustration/types.d.ts +1 -1
- package/dist/components/Illustration/types.d.ts.map +1 -1
- package/dist/components/Label/index.d.ts +2 -3
- package/dist/components/Label/index.d.ts.map +1 -1
- package/dist/components/Label/index.js +23 -11
- package/dist/components/Label/styles.js +1 -1
- package/dist/components/Label/types.d.ts +3 -1
- package/dist/components/Label/types.d.ts.map +1 -1
- package/dist/components/Modal/ModalExample.d.ts +4 -0
- package/dist/components/Modal/ModalExample.d.ts.map +1 -1
- package/dist/components/Modal/ModalExample.js +26 -4
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Progress/style.d.ts.map +1 -1
- package/dist/components/Progress/style.js +1 -1
- package/dist/components/Select/components/OptionsSelect/index.js +1 -1
- package/dist/components/Select/types.d.ts +2 -1
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Skeleton/types.d.ts +2 -2
- package/dist/components/Skeleton/types.d.ts.map +1 -1
- package/dist/components/Toast/contexts/ToastProvider.js +2 -3
- package/dist/shared/hooks/useDisableBodyScroll.d.ts +1 -1
- package/dist/shared/hooks/useDisableBodyScroll.d.ts.map +1 -1
- package/dist/shared/hooks/useDisableBodyScroll.js +48 -9
- package/dist/utils/getColorValue.d.ts +1 -0
- package/dist/utils/getColorValue.d.ts.map +1 -1
- package/dist/utils/getColorValue.js +12 -2
- package/package.json +1 -1
|
@@ -95,7 +95,7 @@ var Value = _styled.default.div(_templateObject5 || (_templateObject5 = _taggedT
|
|
|
95
95
|
|
|
96
96
|
exports.Value = Value;
|
|
97
97
|
|
|
98
|
-
var SVGArea = _styled.default.svg(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n"])), function (_ref19) {
|
|
98
|
+
var SVGArea = _styled.default.svg(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n transform: rotate(-90deg);\n"])), function (_ref19) {
|
|
99
99
|
var size = _ref19.size;
|
|
100
100
|
return size || 101;
|
|
101
101
|
}, function (_ref20) {
|
|
@@ -76,7 +76,7 @@ var OptionsSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
-
(0, _useDisableBodyScroll.useDisableBodyScroll)(open && disableScrollOnOpen);
|
|
79
|
+
(0, _useDisableBodyScroll.useDisableBodyScroll)(open && disableScrollOnOpen, 'child_element');
|
|
80
80
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.OptionsContainer, {
|
|
81
81
|
ref: optionsContainerRef,
|
|
82
82
|
open: open,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export declare type SelectAlertType = 'success' | 'error' | 'warning' | 'informative' | 'critical' | 'success_secondary' | 'warning_secondary';
|
|
2
3
|
export interface SelectOption {
|
|
3
|
-
label:
|
|
4
|
+
label: ReactNode;
|
|
4
5
|
value: string | number;
|
|
5
6
|
}
|
|
6
7
|
export declare type sizeSelect = 'sm' | 'md';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/types.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,GACvB,SAAS,GACT,OAAO,GACP,SAAS,GACT,aAAa,GACb,UAAU,GACV,mBAAmB,GACnB,mBAAmB,CAAC;AAExB,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,oBAAY,eAAe,GACvB,SAAS,GACT,OAAO,GACP,SAAS,GACT,aAAa,GACb,UAAU,GACV,mBAAmB,GACnB,mBAAmB,CAAC;AAExB,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,oBAAY,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB"}
|
|
@@ -15,12 +15,12 @@ export declare type ISkeletonProps = {
|
|
|
15
15
|
* The width of the skeleton
|
|
16
16
|
* @default '100%'
|
|
17
17
|
*/
|
|
18
|
-
width?: number;
|
|
18
|
+
width?: number | string;
|
|
19
19
|
/**
|
|
20
20
|
* The height of the skeleton
|
|
21
21
|
* @default '100%'
|
|
22
22
|
*/
|
|
23
|
-
height?: number;
|
|
23
|
+
height?: number | string;
|
|
24
24
|
/**
|
|
25
25
|
* The color of the skeleton
|
|
26
26
|
* @default '#EEEEEE'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,oBAAY,cAAc,GAAG;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACxC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,oBAAY,cAAc,GAAG;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACxC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
|
|
@@ -50,7 +50,7 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
|
50
50
|
toasts = _useState2[0],
|
|
51
51
|
setToasts = _useState2[1];
|
|
52
52
|
|
|
53
|
-
var addToast = function
|
|
53
|
+
var addToast = (0, _react.useCallback)(function (options) {
|
|
54
54
|
var toastOptions = {
|
|
55
55
|
config: _objectSpread(_objectSpread({}, options), {}, {
|
|
56
56
|
icon: options.icon || 'info',
|
|
@@ -62,8 +62,7 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
|
62
62
|
id: Math.random().toString(36).substring(2, 9)
|
|
63
63
|
};
|
|
64
64
|
setToasts([].concat(_toConsumableArray(toasts), [toastOptions]));
|
|
65
|
-
};
|
|
66
|
-
|
|
65
|
+
}, []);
|
|
67
66
|
var remoteToast = (0, _react.useCallback)(function (id) {
|
|
68
67
|
setToasts(function (prevState) {
|
|
69
68
|
var _filterToast$0$config, _filterToast$0$config2;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const useDisableBodyScroll: (disable: boolean) => void;
|
|
1
|
+
export declare const useDisableBodyScroll: (disable: boolean, type?: 'modal' | 'child_element') => void;
|
|
2
2
|
//# sourceMappingURL=useDisableBodyScroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDisableBodyScroll.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useDisableBodyScroll.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDisableBodyScroll.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useDisableBodyScroll.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,oBAAoB,YACtB,OAAO,SACV,OAAO,GAAG,eAAe,SAehC,CAAC"}
|
|
@@ -7,17 +7,56 @@ exports.useDisableBodyScroll = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
+
function disableBodyOverflow() {
|
|
11
|
+
var scrollBarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
12
|
+
document.body.style.paddingRight = "".concat(scrollBarWidth, "px");
|
|
13
|
+
document.body.style.overflow = 'hidden';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function enableBodyOverflow() {
|
|
17
|
+
document.body.style.overflow = '';
|
|
18
|
+
document.body.style.paddingRight = '';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function setBodyOverflow(disable, type) {
|
|
22
|
+
// disable body scroll when type modal:
|
|
23
|
+
if (disable && type === 'modal') {
|
|
24
|
+
document.body.setAttribute('data-modal-open', 'true');
|
|
25
|
+
return disableBodyOverflow();
|
|
26
|
+
} // enable body scroll when type modal:
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if (!disable && type === 'modal') {
|
|
30
|
+
document.body.setAttribute('data-modal-open', 'false');
|
|
31
|
+
return enableBodyOverflow();
|
|
32
|
+
} // disable body scroll when type child_element:
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if (disable && type === 'child_element') {
|
|
36
|
+
if (document.body.getAttribute('data-modal-open') === 'true') return;
|
|
37
|
+
return disableBodyOverflow();
|
|
38
|
+
} // enable body scroll when type child_element:
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if (!disable && type === 'child_element') {
|
|
42
|
+
if (document.body.getAttribute('data-modal-open') === 'true') return;
|
|
43
|
+
return enableBodyOverflow();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
10
47
|
var useDisableBodyScroll = function useDisableBodyScroll(disable) {
|
|
48
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'child_element';
|
|
11
49
|
(0, _react.useEffect)(function () {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
document.body.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
50
|
+
setBodyOverflow(disable, type);
|
|
51
|
+
document.body.addEventListener('data-modal-open', function () {
|
|
52
|
+
setBodyOverflow(disable, type);
|
|
53
|
+
});
|
|
54
|
+
return function () {
|
|
55
|
+
document.body.removeEventListener('data-modal-open', function () {
|
|
56
|
+
setBodyOverflow(disable, type);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
}, [disable, type]);
|
|
21
60
|
};
|
|
22
61
|
|
|
23
62
|
exports.useDisableBodyScroll = useDisableBodyScroll;
|
|
@@ -289,4 +289,5 @@ export declare const getColorValue: (color: string, theme?: {
|
|
|
289
289
|
level48: string;
|
|
290
290
|
};
|
|
291
291
|
} | undefined, defaultValue?: string | undefined) => string;
|
|
292
|
+
export declare const getThemeHex: (path: string, obj: object, separator?: string) => any;
|
|
292
293
|
//# sourceMappingURL=getColorValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getColorValue.d.ts","sourceRoot":"","sources":["../../src/utils/getColorValue.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,UACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAGZ,MAMF,CAAC"}
|
|
1
|
+
{"version":3,"file":"getColorValue.d.ts","sourceRoot":"","sources":["../../src/utils/getColorValue.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,UACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAGZ,MAMF,CAAC;AAEF,eAAO,MAAM,WAAW,SAAU,MAAM,OAAO,MAAM,yBAAoB,GAGxE,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getColorValue = void 0;
|
|
6
|
+
exports.getThemeHex = exports.getColorValue = void 0;
|
|
7
7
|
|
|
8
8
|
var _colorCheck = require("../utils/colorCheck");
|
|
9
9
|
|
|
@@ -22,4 +22,14 @@ var getColorValue = function getColorValue(color, theme, defaultValue) {
|
|
|
22
22
|
return colorIsThemeColor || defaultValue || 'inherit';
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
exports.getColorValue = getColorValue;
|
|
25
|
+
exports.getColorValue = getColorValue;
|
|
26
|
+
|
|
27
|
+
var getThemeHex = function getThemeHex(path, obj) {
|
|
28
|
+
var separator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
|
|
29
|
+
var properties = path.split(separator);
|
|
30
|
+
return properties.reduce(function (prev, curr) {
|
|
31
|
+
return prev && prev[curr];
|
|
32
|
+
}, obj);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
exports.getThemeHex = getThemeHex;
|