@pedidopago/ui 1.3.1 → 1.3.4
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 +8 -28
- package/dist/components/Alert/styles.d.ts +1 -13
- package/dist/components/Alert/styles.d.ts.map +1 -1
- package/dist/components/Alert/styles.js +4 -24
- package/dist/components/Alert/types.d.ts +6 -23
- package/dist/components/Alert/types.d.ts.map +1 -1
- package/dist/components/Button/Button.test.js +1 -1
- package/dist/components/Button/index.d.ts +3 -4
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +25 -20
- package/dist/components/Button/styles.d.ts +3 -3
- package/dist/components/Button/styles.d.ts.map +1 -1
- package/dist/components/Button/styles.js +42 -43
- package/dist/components/Button/types.d.ts +11 -13
- 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 +40 -35
- 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/ModalExample.d.ts +4 -0
- package/dist/components/Modal/ModalExample.d.ts.map +1 -0
- package/dist/components/Modal/ModalExample.js +66 -0
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +11 -13
- package/dist/components/Modal/modal.test.js +11 -9
- package/dist/components/Modal/styles.d.ts.map +1 -1
- package/dist/components/Modal/styles.js +3 -3
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js +23 -10
- package/dist/components/Pagination/styles.js +3 -2
- package/dist/components/ReactPortal/index.d.ts +8 -0
- package/dist/components/ReactPortal/index.d.ts.map +1 -0
- package/dist/components/ReactPortal/index.js +58 -0
- package/dist/components/ReactPortal/reactPortal.test.d.ts +2 -0
- package/dist/components/ReactPortal/reactPortal.test.d.ts.map +1 -0
- package/dist/components/ReactPortal/reactPortal.test.js +26 -0
- package/dist/components/ReactPortal/utils/createWrapperAndApprendToBody.d.ts +2 -0
- package/dist/components/ReactPortal/utils/createWrapperAndApprendToBody.d.ts.map +1 -0
- package/dist/components/ReactPortal/utils/createWrapperAndApprendToBody.js +13 -0
- package/dist/components/Select/components/OptionsSelect/index.d.ts +4 -0
- package/dist/components/Select/components/OptionsSelect/index.d.ts.map +1 -0
- package/dist/components/Select/components/OptionsSelect/index.js +91 -0
- package/dist/components/Select/components/OptionsSelect/styles.d.ts +265 -0
- package/dist/components/Select/components/OptionsSelect/styles.d.ts.map +1 -0
- package/dist/components/Select/components/OptionsSelect/styles.js +32 -0
- package/dist/components/Select/components/OptionsSelect/types.d.ts +16 -0
- package/dist/components/Select/components/OptionsSelect/types.d.ts.map +1 -0
- package/dist/components/Select/components/OptionsSelect/types.js +1 -0
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +86 -51
- package/dist/components/Select/select.test.js +14 -0
- package/dist/components/Select/styles.d.ts +5 -7
- package/dist/components/Select/styles.d.ts.map +1 -1
- package/dist/components/Select/styles.js +26 -16
- package/dist/components/Select/types.d.ts +7 -2
- package/dist/components/Select/types.d.ts.map +1 -1
- 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 +12 -9
- 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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/package.json +2 -1
|
@@ -5,13 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _framerMotion = require("framer-motion");
|
|
9
|
+
|
|
8
10
|
var _react = require("react");
|
|
9
11
|
|
|
12
|
+
var _TooltipLabel = require("./components/TooltipLabel");
|
|
13
|
+
|
|
10
14
|
var _styles = require("./styles");
|
|
11
15
|
|
|
12
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
17
|
|
|
14
|
-
var _excluded = ["position", "
|
|
18
|
+
var _excluded = ["position", "offset"];
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
24
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
25
|
|
|
16
26
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
27
|
|
|
@@ -31,94 +41,101 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
31
41
|
|
|
32
42
|
var Tooltip = function Tooltip(_ref) {
|
|
33
43
|
var _ref$position = _ref.position,
|
|
34
|
-
position = _ref$position === void 0 ? '
|
|
35
|
-
_ref$
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
labelColor = _ref.labelColor,
|
|
39
|
-
_ref$animationDuratio = _ref.animationDuration,
|
|
40
|
-
animationDuration = _ref$animationDuratio === void 0 ? 0.2 : _ref$animationDuratio,
|
|
41
|
-
backgroundColor = _ref.backgroundColor,
|
|
42
|
-
width = _ref.width,
|
|
43
|
-
children = _ref.children,
|
|
44
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
+
position = _ref$position === void 0 ? 'bottom' : _ref$position,
|
|
45
|
+
_ref$offset = _ref.offset,
|
|
46
|
+
offset = _ref$offset === void 0 ? 10 : _ref$offset,
|
|
47
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
48
|
|
|
46
49
|
var _useState = (0, _react.useState)(false),
|
|
47
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48
51
|
showTooltip = _useState2[0],
|
|
49
52
|
setShowTooltip = _useState2[1];
|
|
50
53
|
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
var _useState3 = (0, _react.useState)({
|
|
55
|
+
top: 0,
|
|
56
|
+
left: 0,
|
|
57
|
+
transform: ''
|
|
58
|
+
}),
|
|
59
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
+
tooltipPositions = _useState4[0],
|
|
61
|
+
setTooltipPositions = _useState4[1];
|
|
62
|
+
|
|
63
|
+
var tooltipContentRef = (0, _react.useRef)(null);
|
|
64
|
+
|
|
65
|
+
function refreshTooltipPosition(newPosition) {
|
|
66
|
+
if (tooltipContentRef.current) {
|
|
67
|
+
var tooltipContentRect = tooltipContentRef.current.getBoundingClientRect();
|
|
68
|
+
|
|
69
|
+
switch (newPosition) {
|
|
70
|
+
case 'top':
|
|
71
|
+
setTooltipPositions({
|
|
72
|
+
top: tooltipContentRect.top - tooltipContentRect.height - offset,
|
|
73
|
+
left: tooltipContentRect.left + tooltipContentRect.width / 2,
|
|
74
|
+
transform: 'translate(-50%, -50%)'
|
|
75
|
+
});
|
|
76
|
+
break;
|
|
77
|
+
|
|
78
|
+
case 'bottom':
|
|
79
|
+
setTooltipPositions({
|
|
80
|
+
top: tooltipContentRect.top + tooltipContentRect.height + offset,
|
|
81
|
+
left: tooltipContentRect.left + tooltipContentRect.width / 2,
|
|
82
|
+
transform: 'translateX(-50%)'
|
|
83
|
+
});
|
|
84
|
+
break;
|
|
85
|
+
|
|
86
|
+
case 'left':
|
|
87
|
+
setTooltipPositions({
|
|
88
|
+
top: tooltipContentRect.top + tooltipContentRect.height / 2,
|
|
89
|
+
left: tooltipContentRect.left - offset,
|
|
90
|
+
transform: 'translate(-100%, -50%)'
|
|
91
|
+
});
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
case 'right':
|
|
95
|
+
setTooltipPositions({
|
|
96
|
+
top: tooltipContentRect.top + tooltipContentRect.height / 2,
|
|
97
|
+
left: tooltipContentRect.left + tooltipContentRect.width + offset,
|
|
98
|
+
transform: 'translateY(-50%)'
|
|
99
|
+
});
|
|
100
|
+
break;
|
|
76
101
|
}
|
|
77
102
|
}
|
|
78
103
|
}
|
|
79
104
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
105
|
+
function handleRepositionTooltip(element) {
|
|
106
|
+
var elementRect = element.getBoundingClientRect();
|
|
107
|
+
var top = elementRect.top,
|
|
108
|
+
left = elementRect.left,
|
|
109
|
+
width = elementRect.width,
|
|
110
|
+
height = elementRect.height;
|
|
111
|
+
|
|
112
|
+
if (left < 0) {
|
|
113
|
+
refreshTooltipPosition('right');
|
|
114
|
+
} else if (left + width > window.innerWidth) {
|
|
115
|
+
refreshTooltipPosition('left');
|
|
116
|
+
} else if (top < 0) {
|
|
117
|
+
refreshTooltipPosition('bottom');
|
|
118
|
+
} else if (top + height > window.innerHeight) {
|
|
119
|
+
refreshTooltipPosition('top');
|
|
83
120
|
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
124
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TooltipWrapper, {
|
|
125
|
+
ref: tooltipContentRef,
|
|
89
126
|
onMouseEnter: function onMouseEnter() {
|
|
90
|
-
|
|
127
|
+
refreshTooltipPosition(position);
|
|
128
|
+
setShowTooltip(true);
|
|
91
129
|
},
|
|
92
130
|
onMouseLeave: function onMouseLeave() {
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
"data-testid": "tooltip-target",
|
|
96
|
-
ref: componentDiv,
|
|
97
|
-
children: children
|
|
98
|
-
}), showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.MotionDiv, {
|
|
99
|
-
initial: {
|
|
100
|
-
opacity: 0
|
|
101
|
-
},
|
|
102
|
-
animate: {
|
|
103
|
-
opacity: 1
|
|
104
|
-
},
|
|
105
|
-
exit: {
|
|
106
|
-
opacity: 0
|
|
107
|
-
},
|
|
108
|
-
transition: {
|
|
109
|
-
duration: animationDuration
|
|
131
|
+
setShowTooltip(false);
|
|
110
132
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
maxWidth: maxWidth,
|
|
118
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TooltipWrapper, {
|
|
119
|
-
labelColor: labelColor,
|
|
120
|
-
children: label
|
|
121
|
-
})
|
|
133
|
+
children: props.children
|
|
134
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
135
|
+
children: showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TooltipLabel.TooltipLabel, _objectSpread({
|
|
136
|
+
tooltipPositions: tooltipPositions,
|
|
137
|
+
handleRepositionTooltip: handleRepositionTooltip
|
|
138
|
+
}, props))
|
|
122
139
|
})]
|
|
123
140
|
});
|
|
124
141
|
};
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
4
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
as?: import("react").ElementType<any> | undefined;
|
|
6
|
-
} & IStyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
-
export declare const TooltipTarget: import("@emotion/styled").StyledComponent<{
|
|
8
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
9
|
-
as?: import("react").ElementType<any> | undefined;
|
|
10
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
-
export declare const MotionDiv: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
import { TooltipProps } from './types';
|
|
3
|
+
export declare const StyledTooltipLabel: import("@emotion/styled").StyledComponent<{
|
|
12
4
|
slot?: string | undefined;
|
|
13
5
|
title?: string | undefined;
|
|
14
6
|
color?: string | undefined;
|
|
15
7
|
translate?: "no" | "yes" | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
16
9
|
hidden?: boolean | undefined;
|
|
17
10
|
className?: string | undefined;
|
|
18
|
-
id?: string | undefined;
|
|
19
11
|
lang?: string | undefined;
|
|
20
12
|
role?: import("react").AriaRole | undefined;
|
|
21
13
|
tabIndex?: number | undefined;
|
|
22
14
|
"aria-activedescendant"?: string | undefined;
|
|
23
15
|
"aria-atomic"?: (boolean | "false" | "true") | undefined;
|
|
24
|
-
"aria-autocomplete"?: "none" | "
|
|
16
|
+
"aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
|
|
25
17
|
"aria-busy"?: (boolean | "false" | "true") | undefined;
|
|
26
18
|
"aria-checked"?: boolean | "mixed" | "false" | "true" | undefined;
|
|
27
19
|
"aria-colcount"?: number | undefined;
|
|
@@ -262,9 +254,9 @@ export declare const MotionDiv: import("@emotion/styled").StyledComponent<{
|
|
|
262
254
|
is?: string | undefined;
|
|
263
255
|
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
264
256
|
theme?: import("@emotion/react").Theme | undefined;
|
|
265
|
-
} &
|
|
257
|
+
} & TooltipProps, {}, {}>;
|
|
266
258
|
export declare const TooltipWrapper: import("@emotion/styled").StyledComponent<{
|
|
267
259
|
theme?: import("@emotion/react").Theme | undefined;
|
|
268
260
|
as?: import("react").ElementType<any> | undefined;
|
|
269
|
-
}
|
|
261
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
270
262
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/styles.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/styles.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAiB7B,CAAC;AAEH,eAAO,MAAM,cAAc;;;yGAG1B,CAAC"}
|
|
@@ -3,49 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TooltipWrapper = exports.
|
|
6
|
+
exports.TooltipWrapper = exports.StyledTooltipLabel = void 0;
|
|
7
7
|
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
9
|
|
|
10
|
-
var _util = require("./util");
|
|
11
|
-
|
|
12
10
|
var _framerMotion = require("framer-motion");
|
|
13
11
|
|
|
14
|
-
var
|
|
12
|
+
var _getColorValue = require("../../utils/getColorValue");
|
|
15
13
|
|
|
16
|
-
var _templateObject
|
|
14
|
+
var _templateObject;
|
|
17
15
|
|
|
18
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
17
|
|
|
20
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
21
19
|
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
return
|
|
20
|
+
var StyledTooltipLabel = (0, _styled.default)(_framerMotion.motion.div)(function (props) {
|
|
21
|
+
var parsedBgColor = (0, _getColorValue.getColorValue)(props.bgColor || 'neutral.black', props.theme);
|
|
22
|
+
var parsedLabelColor = (0, _getColorValue.getColorValue)(props.labelColor || 'neutral.white', props.theme);
|
|
23
|
+
return "\n font-family: inherit;\n font-size: ".concat(props.theme.fontSizes.xxs, ";\n font-weight: 400;\n max-width: ", "".concat(props.maxWidth || 260, "px"), ";\n border-radius: 8px;\n padding: 12px;\n color: ").concat(parsedLabelColor, ";\n background-color: ").concat(parsedBgColor, ";\n position: fixed;\n pointer-events: none;\n z-index: ").concat(props.theme.zIndex.level48, ";\n ");
|
|
26
24
|
});
|
|
25
|
+
exports.StyledTooltipLabel = StyledTooltipLabel;
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var TooltipTarget = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([""]))); // MOTION.DIV class= TooltipArea
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
exports.TooltipTarget = TooltipTarget;
|
|
34
|
-
var MotionDiv = (0, _styled.default)(_framerMotion.motion.div)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref2) {
|
|
35
|
-
var _ref2$position = _ref2.position,
|
|
36
|
-
position = _ref2$position === void 0 ? 'right' : _ref2$position,
|
|
37
|
-
backgroundColor = _ref2.backgroundColor,
|
|
38
|
-
width = _ref2.width,
|
|
39
|
-
maxWidth = _ref2.maxWidth,
|
|
40
|
-
theme = _ref2.theme;
|
|
41
|
-
return (0, _react.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n position: absolute;\n background-color: ", ";\n justify-content: inherit;\n align-items: inherit;\n width: ", ";\n max-width: ", ";\n border-radius: ", ";\n ", ";\n "])), backgroundColor || (theme.colorMode === 'dark' ? theme.colors.neutral.white : theme.colors.neutral.neutral5), width, maxWidth, theme.borderRadius.default, (0, _util.TooltipAreaPositionController)(position));
|
|
42
|
-
});
|
|
43
|
-
exports.MotionDiv = MotionDiv;
|
|
44
|
-
|
|
45
|
-
var TooltipWrapper = _styled.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n height: inherit;\n overflow: hidden;\n\n color: ", ";\n padding: 10px;\n"])), function (_ref3) {
|
|
46
|
-
var labelColor = _ref3.labelColor,
|
|
47
|
-
theme = _ref3.theme;
|
|
48
|
-
return labelColor || (theme.colorMode === 'dark' ? theme.colors.neutral.black : theme.colors.neutral.white);
|
|
49
|
-
});
|
|
27
|
+
var TooltipWrapper = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: fit-content;\n height: fit-content;\n"])));
|
|
50
28
|
|
|
51
29
|
exports.TooltipWrapper = TooltipWrapper;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare type positionType = 'top
|
|
4
|
-
export declare type
|
|
5
|
-
width?: string;
|
|
6
|
-
maxWidth?: string;
|
|
2
|
+
import { GlobalColorsProps } from '../../shared/theme';
|
|
3
|
+
export declare type positionType = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
export declare type TooltipProps = {
|
|
7
5
|
position?: positionType;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare type IInputProps = {
|
|
15
|
-
width?: string;
|
|
16
|
-
maxWidth?: string;
|
|
17
|
-
position?: positionType;
|
|
18
|
-
backgroundColor?: string;
|
|
19
|
-
label?: ReactNode;
|
|
20
|
-
labelColor?: string;
|
|
21
|
-
children?: ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
labelColor?: GlobalColorsProps | (string & {});
|
|
9
|
+
bgColor?: GlobalColorsProps | (string & {});
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
offset?: number;
|
|
22
12
|
animationDuration?: number;
|
|
23
13
|
};
|
|
14
|
+
export declare type TooltipLabelProps = TooltipProps & {
|
|
15
|
+
tooltipPositions: {
|
|
16
|
+
top: number;
|
|
17
|
+
left: number;
|
|
18
|
+
transform: string;
|
|
19
|
+
};
|
|
20
|
+
handleRepositionTooltip: (element: HTMLDivElement) => void;
|
|
21
|
+
};
|
|
24
22
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,oBAAY,YAAY,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/D,oBAAY,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,oBAAY,iBAAiB,GAAG,YAAY,GAAG;IAC7C,gBAAgB,EAAE;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,uBAAuB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5D,CAAC"}
|
|
@@ -8,11 +8,11 @@ export declare const StyledText: import("@emotion/styled").StyledComponent<{
|
|
|
8
8
|
color?: import("../..").GlobalColorsProps | (string & {}) | undefined;
|
|
9
9
|
fontSize?: number | "display" | "tiny" | "xxxs" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "giant" | undefined;
|
|
10
10
|
fontWeight?: "400" | "700" | "100" | "200" | "300" | "500" | "600" | "800" | "900" | "bold" | "normal" | undefined;
|
|
11
|
-
fontStyle?: "inherit" | "initial" | "
|
|
11
|
+
fontStyle?: "inherit" | "initial" | "italic" | "normal" | "oblique" | undefined;
|
|
12
12
|
lineHeight?: string | number | undefined;
|
|
13
13
|
textAlign?: "center" | "end" | "start" | undefined;
|
|
14
14
|
textTransform?: "none" | "capitalize" | "lowercase" | "uppercase" | undefined;
|
|
15
|
-
textDecoration?: "none" | "
|
|
15
|
+
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
16
16
|
letterSpacing?: string | number | undefined;
|
|
17
17
|
children?: import("react").ReactNode;
|
|
18
18
|
} & {
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { default as Grid } from './components/Grid';
|
|
|
12
12
|
export { default as Icon } from './components/Icon';
|
|
13
13
|
export { type IconName } from './components/Icon/types';
|
|
14
14
|
export { default as IconItem } from './components/IconItem';
|
|
15
|
+
export { ReactPortal } from './components/ReactPortal';
|
|
15
16
|
export { default as Label } from './components/Label';
|
|
16
17
|
export { default as List } from './components/List';
|
|
17
18
|
export { Modal } from './components/Modal';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,O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AC1D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAGrF,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var _exportNames = {
|
|
|
17
17
|
Grid: true,
|
|
18
18
|
Icon: true,
|
|
19
19
|
IconItem: true,
|
|
20
|
+
ReactPortal: true,
|
|
20
21
|
Label: true,
|
|
21
22
|
List: true,
|
|
22
23
|
Modal: true,
|
|
@@ -195,6 +196,12 @@ Object.defineProperty(exports, "Rating", {
|
|
|
195
196
|
return _Rating.default;
|
|
196
197
|
}
|
|
197
198
|
});
|
|
199
|
+
Object.defineProperty(exports, "ReactPortal", {
|
|
200
|
+
enumerable: true,
|
|
201
|
+
get: function get() {
|
|
202
|
+
return _ReactPortal.ReactPortal;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
198
205
|
Object.defineProperty(exports, "Select", {
|
|
199
206
|
enumerable: true,
|
|
200
207
|
get: function get() {
|
|
@@ -312,6 +319,8 @@ var _Icon = _interopRequireDefault(require("./components/Icon"));
|
|
|
312
319
|
|
|
313
320
|
var _IconItem = _interopRequireDefault(require("./components/IconItem"));
|
|
314
321
|
|
|
322
|
+
var _ReactPortal = require("./components/ReactPortal");
|
|
323
|
+
|
|
315
324
|
var _Label = _interopRequireDefault(require("./components/Label"));
|
|
316
325
|
|
|
317
326
|
var _List = _interopRequireDefault(require("./components/List"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pedidopago/ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Quick build beatiful Pedido Pago apps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"@testing-library/jest-dom": "^5.11.4",
|
|
92
92
|
"@testing-library/react": "^11.1.0",
|
|
93
93
|
"@testing-library/user-event": "^12.1.10",
|
|
94
|
+
"@types/react-dom": "^18.0.4",
|
|
94
95
|
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
|
95
96
|
"@typescript-eslint/parser": "^5.3.0",
|
|
96
97
|
"chromatic": "^5.9.2",
|