@pedidopago/ui 1.13.50 → 1.13.52
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/TooltipV2/root.js +1 -1
- package/dist/components/TooltipV2/types.d.ts +1 -1
- package/dist/components/TooltipV2/types.d.ts.map +1 -1
- package/dist/components/TooltipV2/utils/color.d.ts +1 -1
- package/dist/components/TooltipV2/utils/color.d.ts.map +1 -1
- package/dist/components/TooltipV2/utils/color.js +1 -1
- package/dist/shared/hooks/useBreakpoints.d.ts +1 -8
- package/dist/shared/hooks/useBreakpoints.d.ts.map +1 -1
- package/dist/shared/hooks/useBreakpoints.js +2 -2
- package/dist/shared/hooks/useWindowSize.d.ts +2 -5
- package/dist/shared/hooks/useWindowSize.d.ts.map +1 -1
- package/dist/shared/hooks/useWindowSize.js +1 -1
- package/dist/shared/types/breakpoints.d.ts +9 -0
- package/dist/shared/types/breakpoints.d.ts.map +1 -0
- package/dist/shared/types/breakpoints.js +1 -0
- package/dist/shared/types/window-size.d.ts +5 -0
- package/dist/shared/types/window-size.d.ts.map +1 -0
- package/dist/shared/types/window-size.js +1 -0
- package/dist/utils/breakpoints.d.ts +4 -0
- package/dist/utils/breakpoints.d.ts.map +1 -0
- package/dist/utils/breakpoints.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=require("react"),_theme=require("
|
|
1
|
+
"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=require("react"),_theme=require("../../shared/theme"),_TooltipTrigger=_interopRequireDefault(require("./components/TooltipTrigger")),_TooltipContent=_interopRequireDefault(require("./components/TooltipContent")),_useTooltip2=require("./utils/hooks/useTooltip"),_color=require("./utils/color"),_styles=require("./styles"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["children","position","animationDuration","maxWidth","bgColor","color"];// Libs
|
|
2
2
|
// Hooks
|
|
3
3
|
// Components
|
|
4
4
|
// Utils/Hooks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Placement } from '@floating-ui/react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
import { GlobalColorsProps } from '
|
|
3
|
+
import { GlobalColorsProps } from '../../shared/theme';
|
|
4
4
|
type TooltipColor = GlobalColorsProps | (string & {});
|
|
5
5
|
export type TooltipProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/TooltipV2/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/TooltipV2/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,KAAK,YAAY,GAAG,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC1D,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC9D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC9D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../src/components/TooltipV2/utils/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../src/components/TooltipV2/utils/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,OAGtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _getColorValue=require("
|
|
1
|
+
"use strict";var _getColorValue=require("../../../utils/getColorValue");Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseColor=parseColor;function parseColor(color,theme,defaultColor){var parsedColor=(0,_getColorValue.getColorValue)(color,theme,defaultColor);return parsedColor.includes(".")?(0,_getColorValue.getThemeHex)(parsedColor,theme):parsedColor}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
base: number;
|
|
3
|
-
sm: number;
|
|
4
|
-
md: number;
|
|
5
|
-
lg: number;
|
|
6
|
-
xl: number;
|
|
7
|
-
xxl: number;
|
|
8
|
-
};
|
|
1
|
+
import { BreakpointsConfig } from '../types/breakpoints';
|
|
9
2
|
type BreakpointName = 'base' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
10
3
|
type BreakpointValue<T> = {
|
|
11
4
|
[key in BreakpointName]?: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoints.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useBreakpoints.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useBreakpoints.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useBreakpoints.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,KAAK,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAEjE,KAAK,eAAe,CAAC,CAAC,IAAI;KAEvB,GAAG,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC;CAC5B,CAAC;AAoBF,eAAO,MAAM,cAAc,uBAAwB,iBAAiB;;;CAqEnE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useBreakpoints=void 0;var _react=require("react"),_useWindowSize=require("./useWindowSize");function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useBreakpoints=void 0;var _react=require("react"),_breakpoints=require("../../utils/breakpoints"),_useWindowSize=require("./useWindowSize");function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}/**
|
|
2
2
|
* It returns a function that takes a breakpoint value object and returns the value
|
|
3
3
|
* of the closest breakpoint to the current window size
|
|
4
4
|
* @param {BreakpointsConfig} [breakpointsConfig] - This is an optional parameter
|
|
5
5
|
* that allows you to pass in your own breakpoints.
|
|
6
6
|
* @returns a `breakpointPicker` function, which receives an object with breakpoint keys and values.
|
|
7
7
|
* @example const flexDirection = breapointPicker({ sm: 'column', lg: 'row' });
|
|
8
|
-
*/var defaultBreakpoints={base:1,sm:480,md:768,lg:1024,xl:1280,xxl:1600},useBreakpoints=function(breakpointsConfig){function
|
|
8
|
+
*/var defaultBreakpoints={base:1,sm:480,md:768,lg:1024,xl:1280,xxl:1600},useBreakpoints=function(breakpointsConfig){function getClosestBreakpointName(activeBreakpoint,breakpointValues,breakpoints){var breakpointIndex=Object.keys(breakpointValues).findIndex(function(breakpoint){return breakpoint===activeBreakpoint});if(-1!==breakpointIndex)return activeBreakpoint;for(var key,stopIndex=Object.keys(breakpoints).indexOf(activeBreakpoint);0<=stopIndex;){if(key=Object.keys(breakpoints)[stopIndex],Object.prototype.hasOwnProperty.call(breakpointValues,key)){breakpointIndex=stopIndex;break}stopIndex-=1}if(-1!==breakpointIndex){var _key=Object.keys(breakpoints)[breakpointIndex];return _key}return Object.keys(breakpointValues)[0]}var _useState=(0,_react.useState)(null),_useState2=_slicedToArray(_useState,2),breakpoint=_useState2[0],setBreakpoint=_useState2[1],breakpoints=breakpointsConfig||defaultBreakpoints,windowSize=(0,_useWindowSize.useWindowSize)(breakpoints);return(0,_react.useEffect)(function(){var breakpointWidth=(0,_breakpoints.currentBreakpointWidth)(windowSize,breakpoints);if(breakpointWidth){var activeBreakpoint=Object.keys(breakpoints).filter(function(activeBreakpoint){return breakpoints[activeBreakpoint]===breakpointWidth})[0];setBreakpoint(activeBreakpoint)}},[breakpoints,windowSize]),{breakpoint:breakpoint,breakpointPicker:function(breakpointValues){if(breakpoint){var closestBreakpoint=getClosestBreakpointName(breakpoint,breakpointValues,breakpoints);return closestBreakpoint?breakpointValues[closestBreakpoint]:void 0}}}};exports.useBreakpoints=useBreakpoints;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { BreakpointsConfig } from '
|
|
2
|
-
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
};
|
|
1
|
+
import { BreakpointsConfig } from '../types/breakpoints';
|
|
2
|
+
import { WindowSize } from '../types/window-size';
|
|
6
3
|
export declare function useWindowSize(breakpoints?: BreakpointsConfig): WindowSize;
|
|
7
4
|
//# sourceMappingURL=useWindowSize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowSize.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useWindowSize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useWindowSize.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useWindowSize.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,wBAAgB,aAAa,CAAC,WAAW,CAAC,EAAE,iBAAiB,cAoC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useWindowSize=useWindowSize;var _react=require("react"),_breakpoints=require("../../utils/breakpoints");function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function useWindowSize(breakpoints){var isClient="object"===("undefined"==typeof window?"undefined":_typeof(window)),_useState=(0,_react.useState)({width:isClient?window.innerWidth:0,height:isClient?window.innerHeight:0}),_useState2=_slicedToArray(_useState,2),currentSize=_useState2[0],setCurrentSize=_useState2[1];return(0,_react.useEffect)(function(){var handleResize=function(){var newWindowSize={width:window.innerWidth,height:window.innerHeight};if(!breakpoints)return void setCurrentSize(newWindowSize);var currentBreakpoint=(0,_breakpoints.currentBreakpointWidth)(newWindowSize,breakpoints);currentBreakpoint&&(currentSize.width===currentBreakpoint||setCurrentSize({width:currentBreakpoint,height:newWindowSize.height}))};return window.addEventListener("resize",handleResize),function(){return window.removeEventListener("resize",handleResize)}},[currentSize,breakpoints]),currentSize}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../src/shared/types/breakpoints.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-size.d.ts","sourceRoot":"","sources":["../../../src/shared/types/window-size.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BreakpointsConfig } from '../shared/types/breakpoints';
|
|
2
|
+
import { WindowSize } from '../shared/types/window-size';
|
|
3
|
+
export declare function currentBreakpointWidth(windowSize: WindowSize, breakpoints: BreakpointsConfig): number | undefined;
|
|
4
|
+
//# sourceMappingURL=breakpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../src/utils/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,sBAsB5F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.currentBreakpointWidth=currentBreakpointWidth;function currentBreakpointWidth(windowSize,breakpoints){var response;return breakpoints.base<=windowSize.width&&(response=breakpoints.base),breakpoints.sm<=windowSize.width&&(response=breakpoints.sm),breakpoints.md<=windowSize.width&&(response=breakpoints.md),breakpoints.lg<=windowSize.width&&(response=breakpoints.lg),breakpoints.xl<=windowSize.width&&(response=breakpoints.xl),breakpoints.xxl<=windowSize.width&&(response=breakpoints.xxl),response}
|