@pedidopago/ui 1.10.19 → 1.10.20

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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAY,MAAM,OAAO,CAAC;AAqBlE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,QAAA,MAAM,KAAK,sJA4JV,CAAC;AAGF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAY,MAAM,OAAO,CAAC;AAqBlE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,QAAA,MAAM,KAAK,sJA8JV,CAAC;AAGF,eAAe,KAAK,CAAC"}
@@ -1 +1 @@
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"),_Button=_interopRequireDefault(require("../Button")),_styles=require("./styles"),_Typography=_interopRequireDefault(require("../Typography")),_Icon=_interopRequireDefault(require("../Icon")),_formatters=require("../../utils/formatters"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["placeholder","type","disabled","label","labelBackground","hiddenContent","helperText","alert","withAddon","addonContent","withIcon","onLeftIconClick","onRightIconClick","leftIcon","rightIcon","ContainerProps"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}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}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)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}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}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 _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}var Input=/*#__PURE__*/(0,_react.forwardRef)(function(_ref,forwardedRef){function handleInputChange(value){setHasValueOnInput(0<value.length)}var placeholder=_ref.placeholder,type=_ref.type,disabled=_ref.disabled,label=_ref.label,labelBackground=_ref.labelBackground,hiddenContent=_ref.hiddenContent,helperText=_ref.helperText,alert=_ref.alert,withAddon=_ref.withAddon,addonContent=_ref.addonContent,withIcon=_ref.withIcon,onLeftIconClick=_ref.onLeftIconClick,onRightIconClick=_ref.onRightIconClick,leftIcon=_ref.leftIcon,rightIcon=_ref.rightIcon,ContainerProps=_ref.ContainerProps,rest=_objectWithoutProperties(_ref,_excluded),defaultTestId=rest["data-testid"]||rest.name?"input-".concat((0,_formatters.convertToKebabCase)(rest.name||"")):"default-input",_useState=(0,_react.useState)(!1),_useState2=_slicedToArray(_useState,2),hasValueOnInput=_useState2[0],setHasValueOnInput=_useState2[1],_useState3=(0,_react.useState)(hiddenContent||!1),_useState4=_slicedToArray(_useState3,2),hiddenInfo=_useState4[0],setHiddenInfo=_useState4[1];return/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.InputGroupElement,_objectSpread(_objectSpread({withIcon:!!withIcon,hasValueOnInput:!!(placeholder||rest.value||rest.defaultValue)||hasValueOnInput,alert:alert,withAddon:withAddon,hasDisabled:disabled,labelBackground:labelBackground,className:rest.className,style:rest.style},ContainerProps),{},{children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.InputColumn,{children:[withAddon&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.AddonElement,{alert:alert,hasDisabled:disabled,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{fontSize:"xs",children:addonContent})}),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.InputContent,{withAddon:withAddon,children:[label&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.InputLabel,{withIcon:!!withIcon,hasDisabled:disabled,children:label}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.Fieldset,{"aria-hidden":!0,hasDisabled:disabled,withAddon:withAddon,alert:alert,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.Legend,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.LegendText,{children:label})})}),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.InputContentRow,{children:[(withIcon||leftIcon)&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.InputIcon,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Button.default,{type:"button",variant:"ghost",style:{padding:0,cursor:onLeftIconClick?"pointer":"default"},onClick:onLeftIconClick,tabIndex:onLeftIconClick?0:-1,children:withIcon||leftIcon})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.Input,_objectSpread(_objectSpread({"data-input":"input",type:hiddenInfo?"password":type,"aria-label":label,withIcon:withIcon,leftIcon:leftIcon,rightIcon:rightIcon,hiddenContent:hiddenContent,disabled:disabled,alert:alert,"data-testid":defaultTestId,placeholder:placeholder,ref:function inputRef(element){return element&&(forwardedRef&&("function"==typeof forwardedRef?forwardedRef(element):forwardedRef.current=element),(null!==element&&void 0!==element&&element.value||null!==element&&void 0!==element&&element.defaultValue)&&setHasValueOnInput(!0)),element}},rest),{},{onChange:function onChange(e){var _rest$onChange;handleInputChange(e.currentTarget.value),null===(_rest$onChange=rest.onChange)||void 0===_rest$onChange?void 0:_rest$onChange.call(rest,e)}})),hiddenContent&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.InputIcon,{clickable:!0,onClick:function(){setHiddenInfo(!hiddenInfo)},children:hiddenInfo?/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"eye"}):/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"eye-off"})}),rightIcon&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.InputIcon,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Button.default,{type:"button",variant:"ghost",style:{padding:0,cursor:onRightIconClick?"pointer":"default"},onClick:onRightIconClick,tabIndex:onRightIconClick?0:-1,children:rightIcon})})]})]})]}),helperText&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.HelperText,{alert:alert,"data-testid":"".concat(defaultTestId,"-input-helpertext"),children:helperText})]}))});Input.displayName="Input";var _default=Input;exports.default=_default;
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"),_Button=_interopRequireDefault(require("../Button")),_styles=require("./styles"),_Typography=_interopRequireDefault(require("../Typography")),_Icon=_interopRequireDefault(require("../Icon")),_formatters=require("../../utils/formatters"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["placeholder","type","disabled","label","labelBackground","hiddenContent","helperText","alert","withAddon","addonContent","withIcon","onLeftIconClick","onRightIconClick","leftIcon","rightIcon","ContainerProps"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}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}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)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}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}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 _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}var Input=/*#__PURE__*/(0,_react.forwardRef)(function(_ref,forwardedRef){function handleInputChange(value){setHasValueOnInput(0<value.length)}var placeholder=_ref.placeholder,type=_ref.type,disabled=_ref.disabled,label=_ref.label,labelBackground=_ref.labelBackground,hiddenContent=_ref.hiddenContent,helperText=_ref.helperText,alert=_ref.alert,withAddon=_ref.withAddon,addonContent=_ref.addonContent,withIcon=_ref.withIcon,onLeftIconClick=_ref.onLeftIconClick,onRightIconClick=_ref.onRightIconClick,leftIcon=_ref.leftIcon,rightIcon=_ref.rightIcon,ContainerProps=_ref.ContainerProps,rest=_objectWithoutProperties(_ref,_excluded),defaultTestId=rest["data-testid"]||rest.name?"input-".concat((0,_formatters.convertToKebabCase)(rest.name||"")):"default-input",_useState=(0,_react.useState)(!1),_useState2=_slicedToArray(_useState,2),hasValueOnInput=_useState2[0],setHasValueOnInput=_useState2[1],_useState3=(0,_react.useState)(hiddenContent||!1),_useState4=_slicedToArray(_useState3,2),hiddenInfo=_useState4[0],setHiddenInfo=_useState4[1];return/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.InputGroupElement,_objectSpread(_objectSpread({withIcon:!!withIcon,hasValueOnInput:!!(placeholder||rest.value||rest.defaultValue)||hasValueOnInput,alert:alert,withAddon:withAddon,hasDisabled:disabled,labelBackground:labelBackground,className:rest.className,style:rest.style},ContainerProps),{},{children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.InputColumn,{children:[withAddon&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.AddonElement,{alert:alert,hasDisabled:disabled,children:"string"==typeof addonContent?/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{fontSize:"xs",children:addonContent}):addonContent}),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.InputContent,{withAddon:withAddon,children:[label&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.InputLabel,{withIcon:!!withIcon,hasDisabled:disabled,children:label}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.Fieldset,{"aria-hidden":!0,hasDisabled:disabled,withAddon:withAddon,alert:alert,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.Legend,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.LegendText,{children:label})})}),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.InputContentRow,{children:[(withIcon||leftIcon)&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.InputIcon,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Button.default,{type:"button",variant:"ghost",style:{padding:0,cursor:onLeftIconClick?"pointer":"default"},onClick:onLeftIconClick,tabIndex:onLeftIconClick?0:-1,children:withIcon||leftIcon})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.Input,_objectSpread(_objectSpread({"data-input":"input",type:hiddenInfo?"password":type,"aria-label":label,withIcon:withIcon,leftIcon:leftIcon,rightIcon:rightIcon,hiddenContent:hiddenContent,disabled:disabled,alert:alert,"data-testid":defaultTestId,placeholder:placeholder,ref:function inputRef(element){return element&&(forwardedRef&&("function"==typeof forwardedRef?forwardedRef(element):forwardedRef.current=element),setHasValueOnInput(!!(null!==element&&void 0!==element&&element.value)||!!(null!==element&&void 0!==element&&element.defaultValue))),element}},rest),{},{onChange:function onChange(e){var _rest$onChange;handleInputChange(e.currentTarget.value),null===(_rest$onChange=rest.onChange)||void 0===_rest$onChange?void 0:_rest$onChange.call(rest,e)}})),hiddenContent&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.InputIcon,{clickable:!0,onClick:function(){setHiddenInfo(!hiddenInfo)},children:hiddenInfo?/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"eye"}):/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"eye-off"})}),rightIcon&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.InputIcon,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Button.default,{type:"button",variant:"ghost",style:{padding:0,cursor:onRightIconClick?"pointer":"default"},onClick:onRightIconClick,tabIndex:onRightIconClick?0:-1,children:rightIcon})})]})]})]}),helperText&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.HelperText,{alert:alert,"data-testid":"".concat(defaultTestId,"-input-helpertext"),children:helperText})]}))});Input.displayName="Input";var _default=Input;exports.default=_default;
@@ -6,7 +6,7 @@ export interface InputProps extends HTMLAttributes<HTMLInputElement> {
6
6
  hiddenContent?: boolean;
7
7
  helperText?: string;
8
8
  withAddon?: boolean;
9
- addonContent?: string;
9
+ addonContent?: ReactNode;
10
10
  alert?: InputAlertTypes;
11
11
  leftIcon?: ReactNode;
12
12
  rightIcon?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Input/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,OAAO,GACP,SAAS,GACT,aAAa,GACb,UAAU,GACV,mBAAmB,GACnB,mBAAmB,CAAC;AAExB,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;CAC5D;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Input/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,OAAO,GACP,SAAS,GACT,aAAa,GACb,UAAU,GACV,mBAAmB,GACnB,mBAAmB,CAAC;AAExB,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;CAC5D;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAkD,MAAM,OAAO,CAAC;AAoBjG,OAAO,EAAE,WAAW,EAAkB,MAAM,SAAS,CAAC;AAMtD,wBAAgB,KAAK,CAAC,EACpB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,SAAiB,EACjB,YAAgB,EAChB,cAAuB,EACvB,WAAW,EACX,GAAG,IAAI,EACR,EAAE,WAAW,GAAG,wBAAwB,CAAC,OAAO,CAAC,eAkMjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAkD,MAAM,OAAO,CAAC;AAoBjG,OAAO,EAAE,WAAW,EAAkB,MAAM,SAAS,CAAC;AAMtD,wBAAgB,KAAK,CAAC,EACpB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,SAAiB,EACjB,YAAgB,EAChB,cAAuB,EACvB,WAAW,EACX,GAAG,IAAI,EACR,EAAE,WAAW,GAAG,wBAAwB,CAAC,OAAO,CAAC,eAoMjD"}
@@ -2,4 +2,4 @@
2
2
  // Styles
3
3
  // Types
4
4
  // Utils
5
- function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}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}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)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}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}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 _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}function Table(_ref){var selectable=_ref.selectable,primaryActions=_ref.primaryActions,secondaryActions=_ref.secondaryActions,header=_ref.header,rows=_ref.rows,_ref$isLoading=_ref.isLoading,_ref$skeletonRows=_ref.skeletonRows,skeletonRows=void 0===_ref$skeletonRows?5:_ref$skeletonRows,_ref$skeletonHeight=_ref.skeletonHeight,skeletonHeight=void 0===_ref$skeletonHeight?"16px":_ref$skeletonHeight,actionLabel=_ref.actionLabel,rest=_objectWithoutProperties(_ref,_excluded),_useState=(0,_react.useState)([]),_useState2=_slicedToArray(_useState,2),selectedRows=_useState2[0],setSelectedRows=_useState2[1],_useState3=(0,_react.useState)(!1),_useState4=_slicedToArray(_useState3,2),allSelected=_useState4[0],setAllSelected=_useState4[1],_useState5=(0,_react.useState)({state:!1,rowId:""}),_useState6=_slicedToArray(_useState5,2),isMenuOpen=_useState6[0],setIsMenuOpen=_useState6[1],_useState7=(0,_react.useState)(!1),_useState8=_slicedToArray(_useState7,2),openSelectDropDownMenu=_useState8[0],setOpenSelectDropDownMenu=_useState8[1],rowsWithKey=(0,_react.useMemo)(function(){return rows.map(function(row){return _objectSpread({key:(0,_GenerateKey.generateKey)()},row)})},[rows]),haveActions=rows.map(function(row){return!!row.actions}).includes(!0),rowCheckboxHandler=(0,_react.useCallback)(function(rowKey,checked){var selectedRowArrayIndex=selectedRows.findIndex(function(i){return i===rowKey}),selectedList=[];if(checked)0>selectedRowArrayIndex&&(selectedList=[].concat(_toConsumableArray(selectedRows),[rowKey]),setSelectedRows([].concat(_toConsumableArray(selectedRows),[rowKey])));else if(0<=selectedRowArrayIndex){var updatedArray=_toConsumableArray(selectedRows);updatedArray.splice(selectedRowArrayIndex,1),selectedList=updatedArray,setSelectedRows(updatedArray)}selectedList.length===rows.length?setAllSelected(!0):setAllSelected(!1)},[selectedRows,rows]),toggleSelectAll=function(){setSelectedRows(allSelected?[]:rowsWithKey.map(function(row){return row.key})),setAllSelected(!allSelected)};return/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.StyledTable,_objectSpread(_objectSpread({},rest),{},{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("thead",{children:/*#__PURE__*/(0,_jsxRuntime.jsxs)("tr",{children:[selectedRows.length?/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{colSpan:header.length+1,children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.SelectedHeader,{children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.ActionsButton,{onClick:function onClick(){return toggleSelectAll()},children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_CheckboxInput.default,{isInderteminate:0<selectedRows.length&&!allSelected,defaultIsChecked:allSelected||0<selectedRows.length,onChangeValue:function onChangeValue(checked){!checked&&0<selectedRows.length&&(setSelectedRows([]),setAllSelected(!1))}}),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_Typography.default,{fontSize:"xs",fontWeight:"500",children:[selectedRows.length," ",1<selectedRows.length?"selecionados":"selecionado"]})]}),!!primaryActions&&primaryActions.map(function(action){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ActionsButton,{onClick:function onClick(){return action.handler(selectedRows,allSelected)},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{fontSize:"xs",fontWeight:"500",children:action.label})},(0,_GenerateKey.generateKey)())}),!!secondaryActions&&/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.ActionsButton,{onClick:function onClick(){return setOpenSelectDropDownMenu(!openSelectDropDownMenu)},children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_Typography.default,{fontSize:"xs",fontWeight:"500",children:["Mais ",/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"chevron-down"})]}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.MenuItemWrapper,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_MenuItem.MenuItem,{isOpen:openSelectDropDownMenu,items:secondaryActions,onClickOutside:function onClickOutside(){return setOpenSelectDropDownMenu(!1)},top:25,right:-30})})]})]})}):/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[selectable&&/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_CheckboxInput.default,{onChangeValue:function onChangeValue(){return toggleSelectAll()}})}),header.map(function(label){return/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{color:"neutral.black",fontSize:"xxs",fontWeight:"600",children:label})},(0,_GenerateKey.generateKey)())})]}),haveActions&&/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{children:!selectedRows.length&&!!actionLabel&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{color:"neutral.black",fontSize:"xxs",fontWeight:"600",children:actionLabel})})]})}),/*#__PURE__*/(0,_jsxRuntime.jsx)("tbody",{children:void 0!==_ref$isLoading&&_ref$isLoading?(0,_TableSkeleton.TableSkeleton)({skeletonColumns:(null===header||void 0===header?void 0:header.length)||1,skeletonRows:skeletonRows,skeletonHeight:skeletonHeight}):rowsWithKey.map(function(row){return/*#__PURE__*/(0,_jsxRuntime.jsxs)("tr",{tabIndex:selectable?0:void 0,"data-selected":selectedRows.includes(row.key),children:[selectable&&/*#__PURE__*/(0,_jsxRuntime.jsx)("td",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_CheckboxInput.default,{defaultIsChecked:selectedRows.includes(row.key),onChangeValue:function onChangeValue(checked){return rowCheckboxHandler(row.key,checked)}})}),row.items.map(function(cell){return/*#__PURE__*/(0,_jsxRuntime.jsx)("td",{children:"string"==typeof cell?/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{color:"neutral.black",fontSize:"xxs",children:cell}):cell},(0,_GenerateKey.generateKey)())}),!!row.actions&&/*#__PURE__*/(0,_jsxRuntime.jsx)("td",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_FocusLock.default,{isLocked:isMenuOpen.rowId===row.key&&isMenuOpen.state,children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.MenuItemWrapper,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.VerticalPointsButton,{onClick:function onClick(){return setIsMenuOpen({state:isMenuOpen.rowId!==row.key||!isMenuOpen.state,rowId:row.key})},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"more-vertical",color:"neutral.black"})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_MenuItem.MenuItem,{onClickOutside:function onClickOutside(){isMenuOpen.rowId===row.key&&setIsMenuOpen({state:!1,rowId:""})},isOpen:isMenuOpen.rowId===row.key&&isMenuOpen.state,items:row.actions,top:45})]})})})]},row.key)})})]}))}
5
+ function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}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}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)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}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}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 _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}function Table(_ref){var selectable=_ref.selectable,primaryActions=_ref.primaryActions,secondaryActions=_ref.secondaryActions,header=_ref.header,rows=_ref.rows,_ref$isLoading=_ref.isLoading,_ref$skeletonRows=_ref.skeletonRows,skeletonRows=void 0===_ref$skeletonRows?5:_ref$skeletonRows,_ref$skeletonHeight=_ref.skeletonHeight,skeletonHeight=void 0===_ref$skeletonHeight?"16px":_ref$skeletonHeight,actionLabel=_ref.actionLabel,rest=_objectWithoutProperties(_ref,_excluded),_useState=(0,_react.useState)([]),_useState2=_slicedToArray(_useState,2),selectedRows=_useState2[0],setSelectedRows=_useState2[1],_useState3=(0,_react.useState)(!1),_useState4=_slicedToArray(_useState3,2),allSelected=_useState4[0],setAllSelected=_useState4[1],_useState5=(0,_react.useState)({state:!1,rowId:""}),_useState6=_slicedToArray(_useState5,2),isMenuOpen=_useState6[0],setIsMenuOpen=_useState6[1],_useState7=(0,_react.useState)(!1),_useState8=_slicedToArray(_useState7,2),openSelectDropDownMenu=_useState8[0],setOpenSelectDropDownMenu=_useState8[1],rowsWithKey=(0,_react.useMemo)(function(){return rows.map(function(row){return _objectSpread({key:(0,_GenerateKey.generateKey)()},row)})},[rows]),haveActions=rows.map(function(row){return!!row.actions}).includes(!0),rowCheckboxHandler=(0,_react.useCallback)(function(rowKey,checked){var selectedRowArrayIndex=selectedRows.findIndex(function(i){return i===rowKey}),selectedList=[];if(checked)0>selectedRowArrayIndex&&(selectedList=[].concat(_toConsumableArray(selectedRows),[rowKey]),setSelectedRows([].concat(_toConsumableArray(selectedRows),[rowKey])));else if(0<=selectedRowArrayIndex){var updatedArray=_toConsumableArray(selectedRows);updatedArray.splice(selectedRowArrayIndex,1),selectedList=updatedArray,setSelectedRows(updatedArray)}selectedList.length===rows.length?setAllSelected(!0):setAllSelected(!1)},[selectedRows,rows]),toggleSelectAll=function(){setSelectedRows(allSelected?[]:rowsWithKey.map(function(row){return row.key})),setAllSelected(!allSelected)};return/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.StyledTable,_objectSpread(_objectSpread({},rest),{},{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("thead",{children:/*#__PURE__*/(0,_jsxRuntime.jsxs)("tr",{children:[selectedRows.length?/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{colSpan:header.length+1,children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.SelectedHeader,{children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.ActionsButton,{onClick:function onClick(){return toggleSelectAll()},children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_CheckboxInput.default,{isInderteminate:0<selectedRows.length&&!allSelected,defaultIsChecked:allSelected||0<selectedRows.length,onChangeValue:function onChangeValue(checked){!checked&&0<selectedRows.length&&(setSelectedRows([]),setAllSelected(!1))}}),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_Typography.default,{fontSize:"xs",fontWeight:"500",children:[selectedRows.length," ",1<selectedRows.length?"selecionados":"selecionado"]})]}),!!primaryActions&&primaryActions.map(function(action){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ActionsButton,{onClick:function onClick(){return action.handler(selectedRows,allSelected)},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{fontSize:"xs",fontWeight:"500",children:action.label})},(0,_GenerateKey.generateKey)())}),!!secondaryActions&&/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.ActionsButton,{onClick:function onClick(){return setOpenSelectDropDownMenu(!openSelectDropDownMenu)},children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_Typography.default,{fontSize:"xs",fontWeight:"500",children:["Mais ",/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"chevron-down"})]}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.MenuItemWrapper,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_MenuItem.MenuItem,{isOpen:openSelectDropDownMenu,items:secondaryActions,onClickOutside:function onClickOutside(){return setOpenSelectDropDownMenu(!1)},top:25,right:-30})})]})]})}):/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[selectable&&/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_CheckboxInput.default,{onChangeValue:function onChangeValue(){return toggleSelectAll()}})}),header.map(function(label){return/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{color:"neutral.black",fontSize:"xxs",fontWeight:"600",children:label})},(0,_GenerateKey.generateKey)())})]}),haveActions&&/*#__PURE__*/(0,_jsxRuntime.jsx)("th",{children:!selectedRows.length&&!!actionLabel&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{color:"neutral.black",fontSize:"xxs",fontWeight:"600",children:actionLabel})})]})}),/*#__PURE__*/(0,_jsxRuntime.jsx)("tbody",{children:void 0!==_ref$isLoading&&_ref$isLoading?(0,_TableSkeleton.TableSkeleton)({skeletonColumns:(null===header||void 0===header?void 0:header.length)||1,skeletonRows:skeletonRows,skeletonHeight:skeletonHeight}):rowsWithKey.map(function(row,index){return/*#__PURE__*/(0,_jsxRuntime.jsxs)("tr",{tabIndex:selectable?0:void 0,"data-selected":selectedRows.includes(row.key),children:[selectable&&/*#__PURE__*/(0,_jsxRuntime.jsx)("td",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_CheckboxInput.default,{defaultIsChecked:selectedRows.includes(row.key),onChangeValue:function onChangeValue(checked){return rowCheckboxHandler(row.key,checked)}})}),row.items.map(function(cell){return/*#__PURE__*/(0,_jsxRuntime.jsx)("td",{children:"string"==typeof cell?/*#__PURE__*/(0,_jsxRuntime.jsx)(_Typography.default,{color:"neutral.black",fontSize:"xxs",children:cell}):cell},(0,_GenerateKey.generateKey)())}),!!row.actions&&/*#__PURE__*/(0,_jsxRuntime.jsx)("td",{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_FocusLock.default,{isLocked:isMenuOpen.rowId===row.key&&isMenuOpen.state,children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.MenuItemWrapper,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.VerticalPointsButton,{onClick:function onClick(){return setIsMenuOpen({state:isMenuOpen.rowId!==row.key||!isMenuOpen.state,rowId:row.key})},"data-testid":"button_edit_table_row","data-button-index":index,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"more-vertical",color:"neutral.black"})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_MenuItem.MenuItem,{onClickOutside:function onClickOutside(){isMenuOpen.rowId===row.key&&setIsMenuOpen({state:!1,rowId:""})},isOpen:isMenuOpen.rowId===row.key&&isMenuOpen.state,items:row.actions,top:45})]})})})]},row.key)})})]}))}
@@ -4,7 +4,7 @@ type ThemeContextProps = {
4
4
  theme: ExtendThemeProps;
5
5
  colorMode: 'dark' | 'light';
6
6
  switchColorMode: () => void;
7
- colorByTheme<L, D>(light: L, dark: D): L | D;
7
+ colorByTheme<T, P extends T>(light: P, dark: P): T;
8
8
  };
9
9
  type ThemeProviderProps = {
10
10
  theme?: ExtendThemeProps;
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/contexts/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAStE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKlD,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC9C,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,4CAAyC,CAAC;AAEnE,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAsE1F"}
1
+ {"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/contexts/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAStE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKlD,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;CACpD,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,4CAAyC,CAAC;AAEnE,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAsE1F"}
@@ -3,7 +3,7 @@ type UseThemeReturn = {
3
3
  theme: ExtendThemeProps;
4
4
  colorMode: 'dark' | 'light';
5
5
  switchColorMode: () => void;
6
- colorByTheme<L, D>(light: L, dark: D): L | D;
6
+ colorByTheme<T, P extends T>(light: P, dark: P): T;
7
7
  };
8
8
  export declare function useTheme(): UseThemeReturn;
9
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/hooks/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,IAAI,CAAC;AAGpD,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC9C,CAAC;AAEF,wBAAgB,QAAQ,IAAI,cAAc,CAOzC"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/hooks/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,IAAI,CAAC;AAGpD,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;CACpD,CAAC;AAEF,wBAAgB,QAAQ,IAAI,cAAc,CAOzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pedidopago/ui",
3
- "version": "1.10.19",
3
+ "version": "1.10.20",
4
4
  "description": "Quick build beatiful Pedido Pago apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",