@webjet/react 1.3.3 → 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.
@@ -1 +1 @@
1
- !function(){"use strict";var e={3729:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ErrorMessageField=void 0;var n=o(r(6689)),a=(o(r(580)),r(6202)),i=function(e){var t=e.children;return t&&n.default.createElement(a.ErrorMessage,{"data-testid":"error-message",role:"error-message"},t)};t.ErrorMessageField=i,i.defaultProps={children:null};var l=i;t.default=l},6202:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessage=void 0;var n=o(r(7518)),a=r(9193),i=n.default.label.withConfig({displayName:"ErrorMessageFieldstyle__ErrorMessage",componentId:"sc-s1cvz0-0"})(["&&{"," display:block;position:relative;margin-top:10px;background:",";padding:6px 8px 6px 8px;border-radius:",";font-size:14px;color:",";line-height:130%;text-align:left;font-weight:normal;box-sizing:border-box;&:before{width:0;top:-8px;z-index:1;position:absolute;content:'';height:0;left:0;right:0;text-align:center;margin:0 auto;border-left:12px solid transparent;border-right:12px solid transparent;border-bottom:10px solid #f2dede;}}"],a.mixins.globalStyles,a.theme.validationColors.inputErrorBackground,a.theme.borderRadius,a.theme.validationColors.inputErrorText);t.ErrorMessage=i},2367:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(3729)).default;t.default=n},3206:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={dateFormatExtraShort:"d MMM",dateFormatShort:"E d MMM",dateFormat:"E d MMM yyyy",dateFormatLong:"E d MMMM yyyy",timeFormat:"h:mm a",firstDayOfWeek:1,weekFormat:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],scrollToViewOptions:{behavior:"smooth",block:"end",scrollMode:"if-needed"}}},5799:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={notification:{success:{color:"#149000",backgroundColor:"#EEF7EB"},error:{color:"#BE0000",backgroundColor:"#F2DEDE"},warning:{color:"#FF5C00",backgroundColor:"#F6EDE6"},info:{color:"#3D9AF2",backgroundColor:"#ECF5FE"},notice:{color:"#FEB42B",backgroundColor:"#FFF3CD"}},textLink:{color:"#0060BB",hoverColor:"#00509C"}}},9193:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"config",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"identifiers",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"mixins",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"theme",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"themeV2",{enumerable:!0,get:function(){return a.default}});var n=o(r(2594)),a=o(r(6932)),i=o(r(2098)),l=o(r(3206)),d=o(r(5799))},2098:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(7518),a=o(r(2594)),i={globalStyles:(0,n.css)(["font-family:",";font-size:",";color:",";&,> *,> *:before,> *:after{box-sizing:border-box;}"],a.default.fontFamily.primary,a.default.fontSize,a.default.fontColor)};t.default=i},6932:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=["#DC140A","#F5F5F5","#DFDFDF","#EBEBEB","#CCCCCC","#BFBFBF","#999999","#878787","#646464","#4D4D4D","#333333","#FFFFFF","#000000","#3D9AF2","#0060BB","#00509C","#FF8C00","#2DB300","#B0CFE2","#3587D4","#E07B00","#29A300","#D5EFCC","#F6F2E6","#CFCFCF","#454545","#F2DEDE","#B13312","#FFF3CD","#7A7A7A","#FEB42B","#E96962"],o={fontFamily:{primary:"Roboto, Arial, sans-serif",icon:"WebjetIcons"},fontSize:"13px",fontColor:r[10],gutterWidth:"12px",halfGutterWidth:"6px",borderRadius:"4px",borderColor:r[5],hoverColor:r[6],hoverDarkColor:r[7],textHighlight:r[18],activeItemOutline:"0 0 0 4px rgba(135, 135, 135, 0.75)",dropdownShadow:"0 2px 6px rgba(0, 0, 0, 0.7)",userSelection:r[16],inputHoverBackground:"#F6F2E7",inputActiveBackground:r[5],inputIcon:r[9],inputIconBackground:r[2],inputIconHoverBackground:r[5],inputCrossBtn:"#a8a8a8",btnStandard:r[2],btnStandardHover:r[5],btnAction:r[17],btnActionHover:"#259400",btnActive:r[13],btnActiveHover:r[19],btnSelection:r[16],btnSelectionHover:r[20],successBackground:r[22],successText:r[21],errorBackground:r[26],errorText:r[27],sliderPrimary:r[13],color:r,media:{smallMobilePortrait:"only screen and (max-width: 374px)",mobilePortrait:"only screen and (max-width: 567px)",mobileLandscape:"only screen and (min-width: 567px) and (max-width: 767px)",mobile:"only screen and (max-width: 767px)",notMobile:"only screen and (min-width: 768px)",tablet:"only screen and (min-width: 768px) and (max-width: 991px)",mobileAndTablet:"only screen and (max-width: 991px)",tabletAndDesktop:"only screen and (min-width: 768px)",desktop:"only screen and (min-width: 992px) and (max-width: 1199px)",desktopAndWideDesktop:"only screen and (min-width: 992px)",wideDesktop:"only screen and (min-width: 1200px)"},validationColors:{inputErrorBackground:"#F2DEDE",inputErrorHoverBackground:"#E8D5D5",inputErrorText:r[27],inputErrorIcon:"#A1605F",inputErrorIconBackground:"#D4C3C3",inputErrorIconHoverBackground:"#BFB0B0",inputErrorCrossBtn:"#858585"}};t.default=o},2594:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=["#DC140A","#F5F5F5","#DFDFDF","#EBEBEB","#CCCCCC","#BFBFBF","#999999","#878787","#646464","#4D4D4D","#333333","#FFFFFF","#000000","#3D9AF2","#0060BB","#00509C","#FF8C00","#2DB300","#B0CFE2","#3587D4","#E07B00","#29A300","#D5EFCC","#F6F2E6","#CFCFCF","#454545","#F2DEDE","#B13312","#FFF3CD","#7A7A7A","#FEB42B","#E96962"],o={fontFamily:{primary:"Roboto, Arial, sans-serif",icon:"WebjetIcons"},fontSize:"13px",fontColor:r[10],gutterWidth:"12px",halfGutterWidth:"6px",borderRadius:"4px",borderColor:r[5],hoverColor:r[6],hoverDarkColor:r[7],textHighlight:r[18],activeItemOutline:"0 0 0 4px rgba(135, 135, 135, 0.75)",dropdownShadow:"0 2px 6px rgba(0, 0, 0, 0.7)",userSelection:r[16],inputHoverBackground:"#F6F2E7",inputActiveBackground:r[5],inputIcon:r[9],inputIconBackground:r[2],inputIconHoverBackground:r[5],inputCrossBtn:"#a8a8a8",btnStandard:r[2],btnStandardHover:r[5],btnAction:r[17],btnActionHover:"#259400",btnActive:r[13],btnActiveHover:r[19],btnSelection:r[16],btnSelectionHover:r[20],successBackground:r[22],successText:r[21],errorBackground:r[26],errorText:r[27],sliderPrimary:r[13],color:r,media:{smallMobilePortrait:"only screen and (max-width: 374px)",mobilePortrait:"only screen and (max-width: 567px)",mobileLandscape:"only screen and (min-width: 567px) and (max-width: 767px)",mobile:"only screen and (max-width: 767px)",notMobile:"only screen and (min-width: 768px)",tablet:"only screen and (min-width: 768px) and (max-width: 991px)",mobileAndTablet:"only screen and (max-width: 991px)",tabletAndDesktop:"only screen and (min-width: 768px)",desktop:"only screen and (min-width: 992px) and (max-width: 1199px)",desktopAndWideDesktop:"only screen and (min-width: 992px)",wideDesktop:"only screen and (min-width: 1200px)"},validationColors:{inputErrorBackground:"#F2DEDE",inputErrorHoverBackground:"#E8D5D5",inputErrorText:r[27],inputErrorIcon:"#A1605F",inputErrorIconBackground:"#D4C3C3",inputErrorIconHoverBackground:"#BFB0B0",inputErrorCrossBtn:"#858585"}};t.default=o},9715:function(e,t,r){var o=r(7880),n=r(9293);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(r(8213)),i=o(r(353)),l=o(r(3838)),d=f(r(6689)),u=(o(r(580)),o(r(2367))),s=f(r(3265)),c=["buttonLabel","maxLength","type","className","hasClearBtn","value","onChange","onClearBtnClick","size","state","errorMessage","disabled","onSubmit"];function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}var b=d.default.forwardRef((function(e,t){var r=e.buttonLabel,o=e.maxLength,n=e.type,p=e.className,f=e.hasClearBtn,b=e.value,m=e.onChange,h=(e.onClearBtnClick,e.size),g=e.state,v=e.errorMessage,x=e.disabled,y=e.onSubmit,F=(0,l.default)(e,c),B=(0,d.useState)(b),C=(0,i.default)(B,2),E=C[0],k=C[1];(0,d.useEffect)((function(){return k(b)}),[b]);var w=o,D=d.default.createRef(),M=f&&E,S=function(){var e=Boolean(E)||Boolean(b);y&&e&&y(E)};return d.default.createElement(d.default.Fragment,null,d.default.createElement(s.InputWrapper,{ref:t,className:p,state:g,disabled:x,onSubmit:S,size:h,"data-testid":"textfield-wrapper"},d.default.createElement(s.default,(0,a.default)({type:"text",ref:D,value:E,onChange:function(e){var t=e.target.value;if("number"===n&&!/^\d*$/.test(t)){var r=t.replace(/\s/g,"").replace(/\D/g,",").split(",").filter((function(e){return e}));if(r.length<1)return;t=r.sort((function(e,t){return t.length-e.length}))[0]}t&&t.length>w&&(t=t.substring(0,w)),k(t),m&&m(t)},onKeyDown:function(e){"Enter"===e.key&&S()},state:g,disabled:x,$showClearBtn:M},F)),M&&E&&!x&&d.default.createElement(s.ClearBtnIcon,{"data-testid":"clear-icon",role:"input-clear",onClick:function(){k(""),m&&m(""),D.current.focus()}}),d.default.createElement(s.StyledSubmitButton,{type:"submit",disabled:x,"data-testid":"submit-button",onClick:S},r)),"error"===g&&v&&d.default.createElement(u.default,null,v))}));b.defaultProps={value:"",hasClearBtn:!0,type:"text",maxLength:512,size:"lg",state:"initial",errorMessage:null,buttonLabel:"Go"};var m=b;t.default=m},3265:function(e,t,r){var o=r(7880),n=r(9293);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.StyledSubmitButton=t.InputWrapper=t.ClearBtnIcon=void 0;var a=o(r(3682)),i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}(r(7518)),l=r(9193),d=r(8903),u=o(r(2511));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}var c=(0,i.default)(a.default).withConfig({displayName:"TextfieldButtonstyle__ClearBtnIcon",componentId:"sc-1gjo37f-0"})(["position:relative;right:6px;margin-left:-16px;height:100%;fill:",";font-size:16px;cursor:pointer;flex-grow:0;width:16px;flex-shrink:0;"],l.theme.inputCrossBtn);t.ClearBtnIcon=c;var p=i.default.button.withConfig({displayName:"TextfieldButtonstyle__StyledSubmitButton",componentId:"sc-1gjo37f-1"})((function(e){var t=e.disabled;return(0,i.css)(["position:relative;background:",";border:1px solid ",";border-radius:0px "," "," 0px;color:",";font-size:16px;padding:0 20px 0;-webkit-tap-highlight-color:transparent;"," ",""],l.theme.color[2],l.theme.color[4],l.theme.borderRadius,l.theme.borderRadius,l.theme.color[10],!t&&(0,i.css)(["&:active{background:",";}"],(0,u.default)(.12,l.theme.color[3])),t&&(0,i.css)(["opacity:0.5;cursor:default;"]))}));t.StyledSubmitButton=p;var f=i.default.input.withConfig({displayName:"TextfieldButtonstyle__StyledTextfield",componentId:"sc-1gjo37f-2"})((function(e){var t=e.disabled;return(0,i.css)([""," appearance:none;font-size:16px;line-height:normal;padding:0 ",";margin:0;border-radius:"," 0 0 ",";background:",";border:1px solid ",";border-right:none;outline:none;cursor:pointer;min-width:0;&::-ms-clear,&::-ms-reveal{display:none;}&::-moz-selection{background:rgba(99,158,200,0.5);}&::selection{background:rgba(99,158,200,0.5);}&::placeholder{color:",";}"," "," "," "," ",""],l.mixins.globalStyles,l.theme.gutterWidth,l.theme.borderRadius,l.theme.borderRadius,l.theme.color[11],l.theme.color[4],l.theme.color[6],!t&&(0,i.css)(["&:active,&:focus{background:",";}&:focus{","{box-shadow:",";}}"],l.theme.inputHoverBackground,b,l.theme.activeItemOutline),t&&(0,i.css)(["box-shadow:none;opacity:0.5;cursor:default;"]),(function(e){return"error"===e.state&&(0,i.css)(["&&:focus,&&:active{background-color:",";}"],l.theme.validationColors.inputErrorHoverBackground)}),(function(e){return"success"===e.state&&(0,i.css)(["&&:active,&&:focus{filter:brightness(97%);background:",";}"],l.theme.successBackground)}),(function(e){return e.$showClearBtn&&(0,i.css)(["padding-right:28px;"])}))})),b=i.default.div.withConfig({displayName:"TextfieldButtonstyle__InputWrapper",componentId:"sc-1gjo37f-3"})((function(e){var t=e.size,r=(0,d.isSizeSm)(t),o=(0,d.isSizeXs)(t);return(0,i.css)(["display:flex;width:100%;position:relative;vertical-align:top;height:46px;"," "," "," ",""],(r||o)&&(0,i.css)(["height:40px;"]),(function(e){return"error"===e.state&&(0,i.css)(["","{background-color:",";color:",";}&&&:hover{","{background-color:",";}}"],f,l.theme.validationColors.inputErrorBackground,l.theme.validationColors.inputErrorText,f,l.theme.validationColors.inputErrorHoverBackground)}),(function(e){return"success"===e.state&&(0,i.css)(["","{background:",";color:",";}&&&:hover{","{filter:brightness(97%);background:",";}}"],f,l.theme.successBackground,l.theme.successText,f,l.theme.successBackground)}),(function(e){return!e.disabled&&(0,i.css)(["&&:hover{","{background:",";}@media (hover:hover){","{background:",";}}}"],f,l.theme.inputHoverBackground,p,(0,u.default)(.12,l.theme.color[3]))}))}));t.InputWrapper=b;var m=f;t.default=m},8903:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isSizeXs=t.isSizeSm=void 0,t.isSizeSm=function(e){return"sm"===e},t.isSizeXs=function(e){return"xs"===e}},8213:function(e){e.exports=require("@babel/runtime/helpers/extends")},7880:function(e){e.exports=require("@babel/runtime/helpers/interopRequireDefault")},3838:function(e){e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},353:function(e){e.exports=require("@babel/runtime/helpers/slicedToArray")},9293:function(e){e.exports=require("@babel/runtime/helpers/typeof")},3682:function(e){e.exports=require("@webjet/react-icons/common/x-circle-fill")},2511:function(e){e.exports=require("polished/lib/color/darken")},580:function(e){e.exports=require("prop-types")},6689:function(e){e.exports=require("react")},7518:function(e){e.exports=require("styled-components")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}var o={};!function(){var e=o,t=r(7880);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(9715)).default;e.default=n}(),module.exports=o}();
1
+ !function(){"use strict";var e={3729:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ErrorMessageField=void 0;var n=o(r(6689)),a=(o(r(580)),r(6202)),i=function(e){var t=e.children;return t&&n.default.createElement(a.ErrorMessage,{"data-testid":"error-message",role:"error-message"},t)};t.ErrorMessageField=i,i.defaultProps={children:null};var l=i;t.default=l},6202:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessage=void 0;var n=o(r(7518)),a=r(9193),i=n.default.label.withConfig({displayName:"ErrorMessageFieldstyle__ErrorMessage",componentId:"sc-s1cvz0-0"})(["&&{"," display:block;position:relative;margin-top:10px;background:",";padding:6px 8px 6px 8px;border-radius:",";font-size:14px;color:",";line-height:130%;text-align:left;font-weight:normal;box-sizing:border-box;&:before{width:0;top:-8px;z-index:1;position:absolute;content:'';height:0;left:0;right:0;text-align:center;margin:0 auto;border-left:12px solid transparent;border-right:12px solid transparent;border-bottom:10px solid #f2dede;}}"],a.mixins.globalStyles,a.theme.validationColors.inputErrorBackground,a.theme.borderRadius,a.theme.validationColors.inputErrorText);t.ErrorMessage=i},2367:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(3729)).default;t.default=n},3206:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={dateFormatExtraShort:"d MMM",dateFormatShort:"E d MMM",dateFormat:"E d MMM yyyy",dateFormatLong:"E d MMMM yyyy",timeFormat:"h:mm a",firstDayOfWeek:1,weekFormat:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],scrollToViewOptions:{behavior:"smooth",block:"end",scrollMode:"if-needed"}}},5799:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={notification:{success:{color:"#149000",backgroundColor:"#EEF7EB"},error:{color:"#BE0000",backgroundColor:"#F2DEDE"},warning:{color:"#FF5C00",backgroundColor:"#F6EDE6"},info:{color:"#3D9AF2",backgroundColor:"#ECF5FE"},notice:{color:"#FEB42B",backgroundColor:"#FFF3CD"}},textLink:{color:"#0060BB",hoverColor:"#00509C"}}},9193:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"config",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"identifiers",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"mixins",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"theme",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"themeV2",{enumerable:!0,get:function(){return a.default}});var n=o(r(2594)),a=o(r(6932)),i=o(r(2098)),l=o(r(3206)),d=o(r(5799))},2098:function(e,t,r){var o=r(7880);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(7518),a=o(r(2594)),i={globalStyles:(0,n.css)(["font-family:",";font-size:",";color:",";&,> *,> *:before,> *:after{box-sizing:border-box;}"],a.default.fontFamily.primary,a.default.fontSize,a.default.fontColor)};t.default=i},6932:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=["#DC140A","#F5F5F5","#DFDFDF","#EBEBEB","#CCCCCC","#BFBFBF","#999999","#878787","#646464","#4D4D4D","#333333","#FFFFFF","#000000","#3D9AF2","#0060BB","#00509C","#FF8C00","#2DB300","#B0CFE2","#3587D4","#E07B00","#29A300","#D5EFCC","#F6F2E6","#CFCFCF","#454545","#F2DEDE","#B13312","#FFF3CD","#7A7A7A","#FEB42B","#E96962"],o={fontFamily:{primary:"Roboto, Arial, sans-serif",icon:"WebjetIcons"},fontSize:"13px",fontColor:r[10],gutterWidth:"12px",halfGutterWidth:"6px",borderRadius:"4px",borderColor:r[5],hoverColor:r[6],hoverDarkColor:r[7],textHighlight:r[18],activeItemOutline:"0 0 0 4px rgba(135, 135, 135, 0.75)",dropdownShadow:"0 2px 6px rgba(0, 0, 0, 0.7)",userSelection:r[16],inputHoverBackground:"#F6F2E7",inputActiveBackground:r[5],inputIcon:r[9],inputIconBackground:r[2],inputIconHoverBackground:r[5],inputCrossBtn:"#a8a8a8",btnStandard:r[2],btnStandardHover:r[5],btnAction:r[17],btnActionHover:"#259400",btnActive:r[13],btnActiveHover:r[19],btnSelection:r[16],btnSelectionHover:r[20],successBackground:r[22],successText:r[21],errorBackground:r[26],errorText:r[27],sliderPrimary:r[13],color:r,media:{smallMobilePortrait:"only screen and (max-width: 374px)",mobilePortrait:"only screen and (max-width: 567px)",mobileLandscape:"only screen and (min-width: 567px) and (max-width: 767px)",mobile:"only screen and (max-width: 767px)",notMobile:"only screen and (min-width: 768px)",tablet:"only screen and (min-width: 768px) and (max-width: 991px)",mobileAndTablet:"only screen and (max-width: 991px)",tabletAndDesktop:"only screen and (min-width: 768px)",desktop:"only screen and (min-width: 992px) and (max-width: 1199px)",desktopAndWideDesktop:"only screen and (min-width: 992px)",wideDesktop:"only screen and (min-width: 1200px)"},validationColors:{inputErrorBackground:"#F2DEDE",inputErrorHoverBackground:"#E8D5D5",inputErrorText:r[27],inputErrorIcon:"#A1605F",inputErrorIconBackground:"#D4C3C3",inputErrorIconHoverBackground:"#BFB0B0",inputErrorCrossBtn:"#858585"}};t.default=o},2594:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=["#DC140A","#F5F5F5","#DFDFDF","#EBEBEB","#CCCCCC","#BFBFBF","#999999","#878787","#646464","#4D4D4D","#333333","#FFFFFF","#000000","#3D9AF2","#0060BB","#00509C","#FF8C00","#2DB300","#B0CFE2","#3587D4","#E07B00","#29A300","#D5EFCC","#F6F2E6","#CFCFCF","#454545","#F2DEDE","#B13312","#FFF3CD","#7A7A7A","#FEB42B","#E96962"],o={fontFamily:{primary:"Roboto, Arial, sans-serif",icon:"WebjetIcons"},fontSize:"13px",fontColor:r[10],gutterWidth:"12px",halfGutterWidth:"6px",borderRadius:"4px",borderColor:r[5],hoverColor:r[6],hoverDarkColor:r[7],textHighlight:r[18],activeItemOutline:"0 0 0 4px rgba(135, 135, 135, 0.75)",dropdownShadow:"0 2px 6px rgba(0, 0, 0, 0.7)",userSelection:r[16],inputHoverBackground:"#F6F2E7",inputActiveBackground:r[5],inputIcon:r[9],inputIconBackground:r[2],inputIconHoverBackground:r[5],inputCrossBtn:"#a8a8a8",btnStandard:r[2],btnStandardHover:r[5],btnAction:r[17],btnActionHover:"#259400",btnActive:r[13],btnActiveHover:r[19],btnSelection:r[16],btnSelectionHover:r[20],successBackground:r[22],successText:r[21],errorBackground:r[26],errorText:r[27],sliderPrimary:r[13],color:r,media:{smallMobilePortrait:"only screen and (max-width: 374px)",mobilePortrait:"only screen and (max-width: 567px)",mobileLandscape:"only screen and (min-width: 567px) and (max-width: 767px)",mobile:"only screen and (max-width: 767px)",notMobile:"only screen and (min-width: 768px)",tablet:"only screen and (min-width: 768px) and (max-width: 991px)",mobileAndTablet:"only screen and (max-width: 991px)",tabletAndDesktop:"only screen and (min-width: 768px)",desktop:"only screen and (min-width: 992px) and (max-width: 1199px)",desktopAndWideDesktop:"only screen and (min-width: 992px)",wideDesktop:"only screen and (min-width: 1200px)"},validationColors:{inputErrorBackground:"#F2DEDE",inputErrorHoverBackground:"#E8D5D5",inputErrorText:r[27],inputErrorIcon:"#A1605F",inputErrorIconBackground:"#D4C3C3",inputErrorIconHoverBackground:"#BFB0B0",inputErrorCrossBtn:"#858585"}};t.default=o},9715:function(e,t,r){var o=r(7880),n=r(9293);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(r(8213)),i=o(r(353)),l=o(r(3838)),d=f(r(6689)),u=(o(r(580)),o(r(2367))),s=f(r(3265)),c=["buttonLabel","maxLength","type","className","hasClearBtn","value","onChange","onClearBtnClick","size","state","errorMessage","disabled","onSubmit"];function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}var b=d.default.forwardRef((function(e,t){var r=e.buttonLabel,o=e.maxLength,n=e.type,p=e.className,f=e.hasClearBtn,b=e.value,m=e.onChange,h=(e.onClearBtnClick,e.size),g=e.state,v=e.errorMessage,x=e.disabled,y=e.onSubmit,F=(0,l.default)(e,c),B=(0,d.useState)(b),C=(0,i.default)(B,2),E=C[0],k=C[1];(0,d.useEffect)((function(){return k(b)}),[b]),(0,d.useImperativeHandle)(t,(function(){return{setValue:k}}),[]);var w=o,D=d.default.createRef(),M=f&&E,S=function(){var e=Boolean(E)||Boolean(b);y&&e&&y(E)};return d.default.createElement(d.default.Fragment,null,d.default.createElement(s.InputWrapper,{ref:t,className:p,state:g,disabled:x,onSubmit:S,size:h,"data-testid":"textfield-wrapper"},d.default.createElement(s.default,(0,a.default)({type:"text",ref:D,value:E,onChange:function(e){var t=e.target.value;if("number"===n&&!/^\d*$/.test(t)){var r=t.replace(/\s/g,"").replace(/\D/g,",").split(",").filter((function(e){return e}));if(r.length<1)return;t=r.sort((function(e,t){return t.length-e.length}))[0]}t&&t.length>w&&(t=t.substring(0,w)),k(t),m&&m(t)},onKeyDown:function(e){"Enter"===e.key&&S()},state:g,disabled:x,$showClearBtn:M},F)),M&&E&&!x&&d.default.createElement(s.ClearBtnIcon,{"data-testid":"clear-icon",role:"input-clear",onClick:function(){k(""),m&&m(""),D.current.focus()}}),d.default.createElement(s.StyledSubmitButton,{type:"submit",disabled:x,"data-testid":"submit-button",onClick:S},r)),"error"===g&&v&&d.default.createElement(u.default,null,v))}));b.defaultProps={value:"",hasClearBtn:!0,type:"text",maxLength:512,size:"lg",state:"initial",errorMessage:null,buttonLabel:"Go"};var m=b;t.default=m},3265:function(e,t,r){var o=r(7880),n=r(9293);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.StyledSubmitButton=t.InputWrapper=t.ClearBtnIcon=void 0;var a=o(r(3682)),i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}(r(7518)),l=r(9193),d=r(8903),u=o(r(2511));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}var c=(0,i.default)(a.default).withConfig({displayName:"TextfieldButtonstyle__ClearBtnIcon",componentId:"sc-1gjo37f-0"})(["position:relative;right:6px;margin-left:-16px;height:100%;fill:",";font-size:16px;cursor:pointer;flex-grow:0;width:16px;flex-shrink:0;"],l.theme.inputCrossBtn);t.ClearBtnIcon=c;var p=i.default.button.withConfig({displayName:"TextfieldButtonstyle__StyledSubmitButton",componentId:"sc-1gjo37f-1"})((function(e){var t=e.disabled;return(0,i.css)(["position:relative;background:",";border:1px solid ",";border-radius:0px "," "," 0px;color:",";font-size:16px;padding:0 20px 0;-webkit-tap-highlight-color:transparent;"," ",""],l.theme.color[2],l.theme.color[4],l.theme.borderRadius,l.theme.borderRadius,l.theme.color[10],!t&&(0,i.css)(["&:active{background:",";}"],(0,u.default)(.12,l.theme.color[3])),t&&(0,i.css)(["opacity:0.5;cursor:default;"]))}));t.StyledSubmitButton=p;var f=i.default.input.withConfig({displayName:"TextfieldButtonstyle__StyledTextfield",componentId:"sc-1gjo37f-2"})((function(e){var t=e.disabled;return(0,i.css)([""," appearance:none;font-size:16px;line-height:normal;padding:0 ",";margin:0;border-radius:"," 0 0 ",";background:",";border:1px solid ",";border-right:none;outline:none;cursor:pointer;min-width:0;&::-ms-clear,&::-ms-reveal{display:none;}&::-moz-selection{background:rgba(99,158,200,0.5);}&::selection{background:rgba(99,158,200,0.5);}&::placeholder{color:",";}"," "," "," "," ",""],l.mixins.globalStyles,l.theme.gutterWidth,l.theme.borderRadius,l.theme.borderRadius,l.theme.color[11],l.theme.color[4],l.theme.color[6],!t&&(0,i.css)(["&:active,&:focus{background:",";}&:focus{","{box-shadow:",";}}"],l.theme.inputHoverBackground,b,l.theme.activeItemOutline),t&&(0,i.css)(["box-shadow:none;opacity:0.5;cursor:default;"]),(function(e){return"error"===e.state&&(0,i.css)(["&&:focus,&&:active{background-color:",";}"],l.theme.validationColors.inputErrorHoverBackground)}),(function(e){return"success"===e.state&&(0,i.css)(["&&:active,&&:focus{filter:brightness(97%);background:",";}"],l.theme.successBackground)}),(function(e){return e.$showClearBtn&&(0,i.css)(["padding-right:28px;"])}))})),b=i.default.div.withConfig({displayName:"TextfieldButtonstyle__InputWrapper",componentId:"sc-1gjo37f-3"})((function(e){var t=e.size,r=(0,d.isSizeSm)(t),o=(0,d.isSizeXs)(t);return(0,i.css)(["display:flex;width:100%;position:relative;vertical-align:top;height:46px;"," "," "," ",""],(r||o)&&(0,i.css)(["height:40px;"]),(function(e){return"error"===e.state&&(0,i.css)(["","{background-color:",";color:",";}&&&:hover{","{background-color:",";}}"],f,l.theme.validationColors.inputErrorBackground,l.theme.validationColors.inputErrorText,f,l.theme.validationColors.inputErrorHoverBackground)}),(function(e){return"success"===e.state&&(0,i.css)(["","{background:",";color:",";}&&&:hover{","{filter:brightness(97%);background:",";}}"],f,l.theme.successBackground,l.theme.successText,f,l.theme.successBackground)}),(function(e){return!e.disabled&&(0,i.css)(["&&:hover{","{background:",";}@media (hover:hover){","{background:",";}}}"],f,l.theme.inputHoverBackground,p,(0,u.default)(.12,l.theme.color[3]))}))}));t.InputWrapper=b;var m=f;t.default=m},8903:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isSizeXs=t.isSizeSm=void 0,t.isSizeSm=function(e){return"sm"===e},t.isSizeXs=function(e){return"xs"===e}},8213:function(e){e.exports=require("@babel/runtime/helpers/extends")},7880:function(e){e.exports=require("@babel/runtime/helpers/interopRequireDefault")},3838:function(e){e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},353:function(e){e.exports=require("@babel/runtime/helpers/slicedToArray")},9293:function(e){e.exports=require("@babel/runtime/helpers/typeof")},3682:function(e){e.exports=require("@webjet/react-icons/common/x-circle-fill")},2511:function(e){e.exports=require("polished/lib/color/darken")},580:function(e){e.exports=require("prop-types")},6689:function(e){e.exports=require("react")},7518:function(e){e.exports=require("styled-components")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}var o={};!function(){var e=o,t=r(7880);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(9715)).default;e.default=n}(),module.exports=o}();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webjet/react",
3
3
  "side-effects": false,
4
- "version": "1.3.3",
4
+ "version": "1.3.4",
5
5
  "description": "Common react components",
6
6
  "main": "components/index.js",
7
7
  "scripts": {