@pedidopago/ui 1.6.6 → 1.6.8

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.
@@ -1,5 +1,5 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
- import { ICheckboxForwardProps, ICheckboxInputProps } from './types';
3
- declare const CheckboxInput: import("react").ForwardRefExoticComponent<ICheckboxInputProps & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<ICheckboxForwardProps>>;
2
+ import { ICheckboxInputProps } from './types';
3
+ declare const CheckboxInput: import("react").ForwardRefExoticComponent<ICheckboxInputProps & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
4
4
  export default CheckboxInput;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CheckboxInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EAMpB,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAErE,QAAA,MAAM,aAAa,+JA8ElB,CAAC;AAIF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CheckboxInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EAMpB,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,QAAA,MAAM,aAAa,0JAuElB,CAAC;AAIF,eAAe,aAAa,CAAC"}
@@ -58,27 +58,19 @@ var CheckboxInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
58
58
  var _useState = (0, _react.useState)(defaultIsChecked || false),
59
59
  _useState2 = _slicedToArray(_useState, 2),
60
60
  checked = _useState2[0],
61
- _setChecked = _useState2[1];
61
+ setChecked = _useState2[1];
62
62
 
63
63
  var inputRef = (0, _react.useRef)(null);
64
64
  (0, _react.useImperativeHandle)(ref, function () {
65
- return {
66
- setChecked: function setChecked(value) {
67
- return _setChecked(value);
68
- },
69
- toggle: function toggle() {
70
- return _setChecked(!checked);
71
- }
72
- };
73
- }, [checked]);
65
+ return inputRef.current;
66
+ });
74
67
  (0, _react.useEffect)(function () {
75
- _setChecked(defaultIsChecked || false);
68
+ setChecked(defaultIsChecked || false);
76
69
  }, [defaultIsChecked]);
77
70
 
78
71
  function handleChange(e) {
79
72
  if (e !== null && e !== void 0 && e.currentTarget) {
80
- _setChecked(e.currentTarget.checked);
81
-
73
+ setChecked(e.currentTarget.checked);
82
74
  onChangeValue === null || onChangeValue === void 0 ? void 0 : onChangeValue(e.currentTarget.checked);
83
75
  }
84
76
  }
@@ -1,13 +1,10 @@
1
+ import { InputHTMLAttributes } from 'react';
1
2
  export declare type CheckboxChildren = {
2
3
  label: string;
3
4
  value: string;
4
5
  id: string;
5
6
  };
6
- export interface ICheckboxForwardProps {
7
- setChecked: (value: boolean) => void;
8
- toggle: () => void;
9
- }
10
- export interface ICheckboxInputProps {
7
+ export interface ICheckboxInputProps extends InputHTMLAttributes<HTMLInputElement> {
11
8
  label?: string;
12
9
  id?: string;
13
10
  color?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/CheckboxInput/types.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,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AAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,EAAE,KAAK,IAAI,CAAC;CACjE;AAED,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC;IACrF,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/MultipleSelect/components/OptionsArea/styles.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmC9B,CAAC;AAEF,eAAO,MAAM,UAAU;;;yGAuBtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;mBAAiC,OAAO;gBAAc,UAAU;kHAe7F,CAAC;AAEF,eAAO,MAAM,IAAI;;;2GAIhB,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/MultipleSelect/components/OptionsArea/styles.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqC9B,CAAC;AAEF,eAAO,MAAM,UAAU;;;yGAuBtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;mBAAiC,OAAO;gBAAc,UAAU;kHAe7F,CAAC;AAEF,eAAO,MAAM,IAAI;;;2GAIhB,CAAC"}
@@ -21,8 +21,9 @@ var OptionsAreaWrapper = (0, _styled.default)(_framerMotion.motion.div)(function
21
21
  var theme = _ref.theme,
22
22
  top = _ref.top,
23
23
  selectType = _ref.selectType,
24
- width = _ref.width;
25
- return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n top: ", ";\n display: flex;\n scroll-behavior: smooth;\n flex-direction: column;\n box-sizing: border-box;\n background-color: ", ";\n\n color: ", ";\n\n width: ", ";\n max-height: 248px;\n border-radius: ", ";\n\n overflow-y: auto;\n\n padding: 8px;\n\n box-shadow: ", ";\n\n &::-webkit-scrollbar {\n width: 6px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: ", ";\n }\n "])), top, theme.colors.body.light, theme.colors.neutral.black, width + 'px', theme.borderRadius.default, theme.shadow.level3, selectType ? theme.colors[selectType].default : theme.colors.primary.default, theme.borderRadius.default);
24
+ width = _ref.width,
25
+ left = _ref.left;
26
+ return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n top: ", ";\n left: ", ";\n z-index: 999;\n display: flex;\n scroll-behavior: smooth;\n flex-direction: column;\n box-sizing: border-box;\n background-color: ", ";\n\n color: ", ";\n\n width: ", ";\n max-height: 248px;\n border-radius: ", ";\n\n overflow-y: auto;\n\n padding: 8px;\n\n box-shadow: ", ";\n\n &::-webkit-scrollbar {\n width: 6px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: ", ";\n }\n "])), top, left, theme.colors.body.light, theme.colors.neutral.black, width + 'px', theme.borderRadius.default, theme.shadow.level3, selectType ? theme.colors[selectType].default : theme.colors.primary.default, theme.borderRadius.default);
26
27
  });
27
28
  exports.OptionsAreaWrapper = OptionsAreaWrapper;
28
29
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MultipleSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,EAAE,EAOH,MAAM,OAAO,CAAC;AAYf,OAAO,EAAc,iBAAiB,EAAc,MAAM,SAAS,CAAC;AAEpE,aAAK,KAAK,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;AAI3C,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,GAAG,KAAK,CA6KjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MultipleSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,EAAE,EAOH,MAAM,OAAO,CAAC;AAaf,OAAO,EAAc,iBAAiB,EAAc,MAAM,SAAS,CAAC;AAEpE,aAAK,KAAK,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;AAI3C,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,GAAG,KAAK,CA4KjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -9,6 +9,8 @@ var _react = require("react");
9
9
 
10
10
  var _framerMotion = require("framer-motion");
11
11
 
12
+ var _ReactPortal = require("../ReactPortal");
13
+
12
14
  var _Flex = _interopRequireDefault(require("../Flex"));
13
15
 
14
16
  var _useDisableBodyScroll = require("../../shared/hooks/useDisableBodyScroll");
@@ -156,10 +158,12 @@ var MultipleSelect = function MultipleSelect(_ref) {
156
158
  }, 500);
157
159
  }
158
160
  }, [onFinished]);
159
- var toggleOptionsAreaView = (0, _react.useCallback)(function (event) {
161
+
162
+ var toggleOptionsAreaView = function toggleOptionsAreaView(event) {
160
163
  event.stopPropagation();
161
164
  !disabled && setShowOptionsArea(!showOptionsArea);
162
- }, [disabled, setShowOptionsArea, showOptionsArea]);
165
+ };
166
+
163
167
  var chooseOption = (0, _react.useCallback)(function (option) {
164
168
  if (multiple) {
165
169
  if (!(selectedOptions.length >= maxSelects)) {
@@ -209,28 +213,31 @@ var MultipleSelect = function MultipleSelect(_ref) {
209
213
  inputAlert: inputAlert,
210
214
  placeholder: placeholder,
211
215
  dropDownIcon: dropDownIcon
212
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
213
- exitBeforeEnter: true,
214
- children: showOptionsArea && /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.motion.div, _objectSpread(_objectSpread({}, _animations.multipleSelectAnimations), {}, {
215
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.OptionsArea, {
216
- positionOptions: positionOptions || 0,
217
- parentRef: selectAreaRef,
218
- infiniteScroll: infiniteScroll,
219
- AutoComplete: AutoComplete,
220
- setShowOptionsArea: setShowOptionsArea,
221
- inputAlert: inputAlert,
222
- chooseOption: chooseOption,
223
- selectedOptions: selectedOptions,
224
- data: data,
225
- loadMoreData: loadMoreData,
226
- hasMoreData: hasMoreData,
227
- scrollHandler: scrollHandler,
228
- showOptionsArea: showOptionsArea,
229
- onChangeSearch: onChangeSearch,
230
- isLoadingData: isLoadingData,
231
- autoCompleteHelperText: autoCompleteHelperText
232
- })
233
- }))
216
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ReactPortal.ReactPortal, {
217
+ wrapperId: "portal-root",
218
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
219
+ exitBeforeEnter: true,
220
+ children: showOptionsArea && /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.motion.div, _objectSpread(_objectSpread({}, _animations.multipleSelectAnimations), {}, {
221
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.OptionsArea, {
222
+ positionOptions: positionOptions || 0,
223
+ parentRef: selectAreaRef,
224
+ infiniteScroll: infiniteScroll,
225
+ AutoComplete: AutoComplete,
226
+ setShowOptionsArea: setShowOptionsArea,
227
+ inputAlert: inputAlert,
228
+ chooseOption: chooseOption,
229
+ selectedOptions: selectedOptions,
230
+ data: data,
231
+ loadMoreData: loadMoreData,
232
+ hasMoreData: hasMoreData,
233
+ scrollHandler: scrollHandler,
234
+ showOptionsArea: showOptionsArea,
235
+ onChangeSearch: onChangeSearch,
236
+ isLoadingData: isLoadingData,
237
+ autoCompleteHelperText: autoCompleteHelperText
238
+ })
239
+ }))
240
+ })
234
241
  })]
235
242
  }), !!helperText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.HelperText, {
236
243
  selectType: selectType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pedidopago/ui",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
4
4
  "description": "Quick build beatiful Pedido Pago apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",