@pedidopago/ui 1.3.22 → 1.3.25
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.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 +4 -0
- package/dist/components/CollapseCard/index.d.ts.map +1 -0
- package/dist/components/CollapseCard/index.js +119 -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/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/Select/types.d.ts +2 -1
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/shared/hooks/useDisableBodyScroll.d.ts.map +1 -1
- package/dist/shared/hooks/useDisableBodyScroll.js +33 -21
- 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
|
@@ -18,33 +18,45 @@ function enableBodyOverflow() {
|
|
|
18
18
|
document.body.style.paddingRight = '';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} // enable body scroll when type modal:
|
|
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
|
+
|
|
29
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:
|
|
30
33
|
|
|
31
|
-
if (!disable && type === 'modal') {
|
|
32
|
-
document.body.setAttribute('data-modal-open', 'false');
|
|
33
|
-
return enableBodyOverflow();
|
|
34
|
-
} // disable body scroll when type child_element:
|
|
35
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:
|
|
36
39
|
|
|
37
|
-
if (disable && type === 'child_element') {
|
|
38
|
-
if (document.body.getAttribute('data-modal-open') === 'true') return;
|
|
39
|
-
return disableBodyOverflow();
|
|
40
|
-
} // enable body scroll when type child_element:
|
|
41
40
|
|
|
41
|
+
if (!disable && type === 'child_element') {
|
|
42
|
+
if (document.body.getAttribute('data-modal-open') === 'true') return;
|
|
43
|
+
return enableBodyOverflow();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
var useDisableBodyScroll = function useDisableBodyScroll(disable) {
|
|
48
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'child_element';
|
|
49
|
+
(0, _react.useEffect)(function () {
|
|
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]);
|
|
48
60
|
};
|
|
49
61
|
|
|
50
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;
|