@lifesg/react-design-system 2.0.0-canary.6 → 2.0.0-canary.7

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,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef as i,useImperativeHandle as o,useState as a,useEffect as l}from"react";import s,{css as c}from"styled-components";import{ExternalIcon as u}from"@lifesg/react-icons/external";import{CrossIcon as d}from"@lifesg/react-icons/cross";var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f=Array.isArray,g="object"==typeof h&&h&&h.Object===Object&&h,p="object"==typeof self&&self&&self.Object===Object&&self,m=g||p||Function("return this")(),y=m.Symbol,v=y,$=Object.prototype,F=$.hasOwnProperty,S=$.toString,D=v?v.toStringTag:void 0;var b=function(e){var t=F.call(e,D),n=e[D];try{e[D]=void 0;var r=!0}catch(e){}var i=S.call(e);return r&&(t?e[D]=n:delete e[D]),i},B=Object.prototype.toString;var w=b,x=function(e){return B.call(e)},H=y?y.toStringTag:void 0;var M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":H&&H in Object(e)?w(e):x(e)};var E=M,O=function(e){return null!=e&&"object"==typeof e};var _=function(e){return"symbol"==typeof e||O(e)&&"[object Symbol]"==E(e)},k=f,A=_,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/;var T=function(e,t){if(k(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!A(e))||(C.test(e)||!z.test(e)||null!=t&&e in Object(t))};var W=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Y=M,N=W;var L,I=function(e){if(!N(e))return!1;var t=Y(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},R=m["__core-js_shared__"],V=(L=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"";var P=function(e){return!!V&&V in e},j=Function.prototype.toString;var Z=I,U=P,X=W,G=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""},J=/^\[object .+?Constructor\]$/,q=Function.prototype,K=Object.prototype,Q=q.toString,ee=K.hasOwnProperty,te=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ne=function(e){return!(!X(e)||U(e))&&(Z(e)?te:J).test(G(e))},re=function(e,t){return null==e?void 0:e[t]};var ie=function(e,t){var n=re(e,t);return ne(n)?n:void 0},oe=ie(Object,"create"),ae=oe;var le=function(){this.__data__=ae?ae(null):{},this.size=0};var se=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ce=oe,ue=Object.prototype.hasOwnProperty;var de=function(e){var t=this.__data__;if(ce){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ue.call(t,e)?t[e]:void 0},he=oe,fe=Object.prototype.hasOwnProperty;var ge=oe;var pe=le,me=se,ye=de,ve=function(e){var t=this.__data__;return he?void 0!==t[e]:fe.call(t,e)},$e=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ge&&void 0===t?"__lodash_hash_undefined__":t,this};function Fe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fe.prototype.clear=pe,Fe.prototype.delete=me,Fe.prototype.get=ye,Fe.prototype.has=ve,Fe.prototype.set=$e;var Se=Fe;var De=function(){this.__data__=[],this.size=0};var be=function(e,t){return e===t||e!=e&&t!=t};var Be=function(e,t){for(var n=e.length;n--;)if(be(e[n][0],t))return n;return-1},we=Be,xe=Array.prototype.splice;var He=Be;var Me=Be;var Ee=Be;var Oe=De,_e=function(e){var t=this.__data__,n=we(t,e);return!(n<0)&&(n==t.length-1?t.pop():xe.call(t,n,1),--this.size,!0)},ke=function(e){var t=this.__data__,n=He(t,e);return n<0?void 0:t[n][1]},Ae=function(e){return Me(this.__data__,e)>-1},ze=function(e,t){var n=this.__data__,r=Ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ce.prototype.clear=Oe,Ce.prototype.delete=_e,Ce.prototype.get=ke,Ce.prototype.has=Ae,Ce.prototype.set=ze;var Te=Ce,We=ie(m,"Map"),Ye=Se,Ne=Te,Le=We;var Ie=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Re=function(e,t){var n=e.__data__;return Ie(t)?n["string"==typeof t?"string":"hash"]:n.map},Ve=Re;var Pe=Re;var je=Re;var Ze=Re;var Ue=function(){this.size=0,this.__data__={hash:new Ye,map:new(Le||Ne),string:new Ye}},Xe=function(e){var t=Ve(this,e).delete(e);return this.size-=t?1:0,t},Ge=function(e){return Pe(this,e).get(e)},Je=function(e){return je(this,e).has(e)},qe=function(e,t){var n=Ze(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ke(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ke.prototype.clear=Ue,Ke.prototype.delete=Xe,Ke.prototype.get=Ge,Ke.prototype.has=Je,Ke.prototype.set=qe;var Qe=Ke;function et(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(et.Cache||Qe),n}et.Cache=Qe;var tt=et;var nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/\\(\\)?/g,it=function(e){var t=tt(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(nt,(function(e,n,r,i){t.push(r?i.replace(rt,"$1"):n||e)})),t}));var ot=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},at=f,lt=_,st=y?y.prototype:void 0,ct=st?st.toString:void 0;var ut=function e(t){if("string"==typeof t)return t;if(at(t))return ot(t,e)+"";if(lt(t))return ct?ct.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n},dt=ut;var ht=f,ft=T,gt=it,pt=function(e){return null==e?"":dt(e)};var mt=_;var yt=function(e,t){return ht(e)?e:ft(e,t)?[e]:gt(pt(e))},vt=function(e){if("string"==typeof e||mt(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var $t=function(e,t){for(var n=0,r=(t=yt(t,e)).length;null!=e&&n<r;)e=e[vt(t[n++])];return n&&n==r?e:void 0};var Ft=function(e,t,n){var r=null==e?void 0:$t(e,t);return void 0===r?n:r};const St=(e,t,n)=>t?Ft(n,t)||Ft(e,t):n||e,Dt=(e,t)=>{const n=t||e.defaultValue;return Ft(e.collections,n)};var bt;!function(e){e.colorScheme="colorScheme",e.layout="layout",e.textStyleScheme="textStyleScheme",e.designTokenScheme="designTokenScheme",e.resourceScheme="resourceScheme"}(bt||(bt={}));const Bt={collections:{base:{Brand:{1:"#EF413D",2:"#F26664",3:"#F58E8B",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#1C76D5",PrimaryDark:"#1869BF",Secondary:"#0056b3",Accent:{Dark:{1:"#4B539F",2:"#6D74B1",3:"#959BC5"},Light:{1:"#57A9FF",2:"#81BFFF",3:"#BED7FF",4:"#E2ECFD",5:"#F6F8FF",6:"#FBFCFE"}},Neutral:{1:"#282828",2:"#424242",3:"#686868",4:"#A4A4A4",5:"#E0E4E5",6:"#ECEFEF",7:"#F8F8F8",8:"#FFFFFF"},Validation:{Green:{Text:"#097123",Icon:"#4FC029",Border:"#95D97F",Background:"#F9FDF8"},Orange:{Text:"#B34E00",Icon:"#FEAB10",Border:"#F9CB77",Background:"#FFFCF7",Badge:"#F57F17"},Red:{Text:"#C60000",Icon:"#C60000",Border:"#DD6666",Background:"#FDF7F7"},Blue:{Text:"#064D70",Icon:" #066391",Border:"#84B7DB",Background:"#E8F4FA"}},Shadow:{Accent:"rgba(87, 169, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)",Elevation:"rgba(75, 83, 159, 0.24)"}},bookingsg:{Brand:{1:"#EF413D",2:"#F26664",3:"#F58E8B",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#6F4AB8",PrimaryDark:"#6443A6",Secondary:"#6443A6",Accent:{Dark:{1:"#355985",2:"#68819D",3:"#9AABBE"},Light:{1:"#977ECC",2:"#B5A5D7",3:"#CEC3E4 ",4:"#E2DBEF",5:"#F2EFF8",6:"#F7F6FB"}},Neutral:{1:"#282828",2:"#424242",3:"#686868",4:"#A4A4A4",5:"#E0E4E5",6:"#ECEFEF",7:"#F8F8F8",8:"#FFFFFF"},Validation:{Green:{Text:"#097123",Icon:"#4FC029",Border:"#95D97F",Background:"#F9FDF8"},Orange:{Text:"#B34E00",Icon:"#FEAB10",Border:"#F9CB77",Background:"#FFFCF7",Badge:"#F57F17"},Red:{Text:"#C60000",Icon:"#C60000",Border:"#DD6666",Background:"#FDF7F7"},Blue:{Text:"#064D70",Icon:" #066391",Border:"#84B7DB",Background:"#E8F4FA"}},Shadow:{Accent:"rgba(161, 87, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)",Elevation:"rgba(75, 83, 159, 0.24)"}},rbs:{Brand:{1:"#3E4DFF",2:"#AEACFF",3:"#AD44FF",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#4855D4",PrimaryDark:"#3E49B2",Secondary:"#364891",Accent:{Dark:{1:"#5E516E",2:"#7A6F87",3:"#C5C0CC"},Light:{1:"#8397FC",2:"#ABB8FC",3:"#CED6FD ",4:"#E1E4FA",5:"#F0F2FF",6:"#FAFBFF"}},Neutral:{1:"#282828",2:"#424242",3:"#686868",4:"#A4A4A4",5:"#E0E4E5",6:"#ECEFEF",7:"#F8F8F8",8:"#FFFFFF"},Validation:{Green:{Text:"#097123",Icon:"#4FC029",Border:"#95D97F",Background:"#F9FDF8"},Orange:{Text:"#B34E00",Icon:"#FEAB10",Border:"#F9CB77",Background:"#FFFCF7",Badge:"#F57F17"},Red:{Text:"#C60000",Icon:"#C60000",Border:"#DD6666",Background:"#FDF7F7"},Blue:{Text:"#064D70",Icon:" #066391",Border:"#84B7DB",Background:"#E8F4FA"}},Shadow:{Accent:"rgba(90, 87, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)",Elevation:"rgba(75, 83, 159, 0.24)"}}},defaultValue:"base"},wt=e=>t=>{const n=t.theme,r=Dt(Bt,n[bt.colorScheme]);return n.options&&n.options.color?St(r,e,n.options.color):St(r,e)},xt={Brand:{1:wt("Brand.1"),2:wt("Brand.2"),3:wt("Brand.3"),4:wt("Brand.4"),5:wt("Brand.5"),6:wt("Brand.6")},Primary:wt("Primary"),PrimaryDark:wt("PrimaryDark"),Secondary:wt("Secondary"),Accent:{Light:{1:wt("Accent.Light.1"),2:wt("Accent.Light.2"),3:wt("Accent.Light.3"),4:wt("Accent.Light.4"),5:wt("Accent.Light.5"),6:wt("Accent.Light.6")},Dark:{1:wt("Accent.Dark.1"),2:wt("Accent.Dark.2"),3:wt("Accent.Dark.3")}},Neutral:{1:wt("Neutral.1"),2:wt("Neutral.2"),3:wt("Neutral.3"),4:wt("Neutral.4"),5:wt("Neutral.5"),6:wt("Neutral.6"),7:wt("Neutral.7"),8:wt("Neutral.8")},Validation:{Green:{Text:wt("Validation.Green.Text"),Icon:wt("Validation.Green.Icon"),Border:wt("Validation.Green.Border"),Background:wt("Validation.Green.Background")},Orange:{Text:wt("Validation.Orange.Text"),Icon:wt("Validation.Orange.Icon"),Border:wt("Validation.Orange.Border"),Background:wt("Validation.Orange.Background"),Badge:wt("Validation.Orange.Badge")},Red:{Text:wt("Validation.Red.Text"),Icon:wt("Validation.Red.Icon"),Border:wt("Validation.Red.Border"),Background:wt("Validation.Red.Background")},Blue:{Text:wt("Validation.Blue.Text"),Icon:wt("Validation.Blue.Icon"),Border:wt("Validation.Blue.Border"),Background:wt("Validation.Blue.Background")}},Shadow:{Accent:wt("Shadow.Accent"),Red:wt("Shadow.Red"),Elevation:wt("Shadow.Elevation")}},Ht={collections:{base:{InputBoxShadow:c`
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef as i,useImperativeHandle as o,useState as a,useEffect as l}from"react";import s,{css as c}from"styled-components";import{ExternalIcon as u}from"@lifesg/react-icons/external";import{CrossIcon as d}from"@lifesg/react-icons/cross";var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f=Array.isArray,g="object"==typeof h&&h&&h.Object===Object&&h,p="object"==typeof self&&self&&self.Object===Object&&self,m=g||p||Function("return this")(),y=m.Symbol,v=y,$=Object.prototype,F=$.hasOwnProperty,S=$.toString,D=v?v.toStringTag:void 0;var b=function(e){var t=F.call(e,D),n=e[D];try{e[D]=void 0;var r=!0}catch(e){}var i=S.call(e);return r&&(t?e[D]=n:delete e[D]),i},B=Object.prototype.toString;var w=b,x=function(e){return B.call(e)},H=y?y.toStringTag:void 0;var M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":H&&H in Object(e)?w(e):x(e)};var O=M,E=function(e){return null!=e&&"object"==typeof e};var _=function(e){return"symbol"==typeof e||E(e)&&"[object Symbol]"==O(e)},k=f,A=_,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/;var T=function(e,t){if(k(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!A(e))||(C.test(e)||!z.test(e)||null!=t&&e in Object(t))};var W=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Y=M,N=W;var L,I=function(e){if(!N(e))return!1;var t=Y(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},R=m["__core-js_shared__"],V=(L=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"";var P=function(e){return!!V&&V in e},j=Function.prototype.toString;var Z=I,U=P,X=W,G=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""},J=/^\[object .+?Constructor\]$/,q=Function.prototype,K=Object.prototype,Q=q.toString,ee=K.hasOwnProperty,te=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ne=function(e){return!(!X(e)||U(e))&&(Z(e)?te:J).test(G(e))},re=function(e,t){return null==e?void 0:e[t]};var ie=function(e,t){var n=re(e,t);return ne(n)?n:void 0},oe=ie(Object,"create"),ae=oe;var le=function(){this.__data__=ae?ae(null):{},this.size=0};var se=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ce=oe,ue=Object.prototype.hasOwnProperty;var de=function(e){var t=this.__data__;if(ce){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ue.call(t,e)?t[e]:void 0},he=oe,fe=Object.prototype.hasOwnProperty;var ge=oe;var pe=le,me=se,ye=de,ve=function(e){var t=this.__data__;return he?void 0!==t[e]:fe.call(t,e)},$e=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ge&&void 0===t?"__lodash_hash_undefined__":t,this};function Fe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fe.prototype.clear=pe,Fe.prototype.delete=me,Fe.prototype.get=ye,Fe.prototype.has=ve,Fe.prototype.set=$e;var Se=Fe;var De=function(){this.__data__=[],this.size=0};var be=function(e,t){return e===t||e!=e&&t!=t};var Be=function(e,t){for(var n=e.length;n--;)if(be(e[n][0],t))return n;return-1},we=Be,xe=Array.prototype.splice;var He=Be;var Me=Be;var Oe=Be;var Ee=De,_e=function(e){var t=this.__data__,n=we(t,e);return!(n<0)&&(n==t.length-1?t.pop():xe.call(t,n,1),--this.size,!0)},ke=function(e){var t=this.__data__,n=He(t,e);return n<0?void 0:t[n][1]},Ae=function(e){return Me(this.__data__,e)>-1},ze=function(e,t){var n=this.__data__,r=Oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ce.prototype.clear=Ee,Ce.prototype.delete=_e,Ce.prototype.get=ke,Ce.prototype.has=Ae,Ce.prototype.set=ze;var Te=Ce,We=ie(m,"Map"),Ye=Se,Ne=Te,Le=We;var Ie=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Re=function(e,t){var n=e.__data__;return Ie(t)?n["string"==typeof t?"string":"hash"]:n.map},Ve=Re;var Pe=Re;var je=Re;var Ze=Re;var Ue=function(){this.size=0,this.__data__={hash:new Ye,map:new(Le||Ne),string:new Ye}},Xe=function(e){var t=Ve(this,e).delete(e);return this.size-=t?1:0,t},Ge=function(e){return Pe(this,e).get(e)},Je=function(e){return je(this,e).has(e)},qe=function(e,t){var n=Ze(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ke(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ke.prototype.clear=Ue,Ke.prototype.delete=Xe,Ke.prototype.get=Ge,Ke.prototype.has=Je,Ke.prototype.set=qe;var Qe=Ke;function et(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(et.Cache||Qe),n}et.Cache=Qe;var tt=et;var nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/\\(\\)?/g,it=function(e){var t=tt(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(nt,(function(e,n,r,i){t.push(r?i.replace(rt,"$1"):n||e)})),t}));var ot=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},at=f,lt=_,st=y?y.prototype:void 0,ct=st?st.toString:void 0;var ut=function e(t){if("string"==typeof t)return t;if(at(t))return ot(t,e)+"";if(lt(t))return ct?ct.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n},dt=ut;var ht=f,ft=T,gt=it,pt=function(e){return null==e?"":dt(e)};var mt=_;var yt=function(e,t){return ht(e)?e:ft(e,t)?[e]:gt(pt(e))},vt=function(e){if("string"==typeof e||mt(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var $t=function(e,t){for(var n=0,r=(t=yt(t,e)).length;null!=e&&n<r;)e=e[vt(t[n++])];return n&&n==r?e:void 0};var Ft=function(e,t,n){var r=null==e?void 0:$t(e,t);return void 0===r?n:r};const St=(e,t,n)=>t?Ft(n,t)||Ft(e,t):n||e,Dt=(e,t)=>{const n=t||e.defaultValue;return Ft(e.collections,n)};var bt;!function(e){e.colorScheme="colorScheme",e.layout="layout",e.textStyleScheme="textStyleScheme",e.designTokenScheme="designTokenScheme",e.resourceScheme="resourceScheme"}(bt||(bt={}));const Bt={collections:{base:{Brand:{1:"#EF413D",2:"#F26664",3:"#F58E8B",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#1C76D5",PrimaryDark:"#1869BF",Secondary:"#0056b3",Accent:{Dark:{1:"#4B539F",2:"#6D74B1",3:"#959BC5"},Light:{1:"#57A9FF",2:"#81BFFF",3:"#BED7FF",4:"#E2ECFD",5:"#F6F8FF",6:"#FBFCFE"}},Neutral:{1:"#282828",2:"#424242",3:"#686868",4:"#A4A4A4",5:"#E0E4E5",6:"#ECEFEF",7:"#F8F8F8",8:"#FFFFFF"},Validation:{Green:{Text:"#097123",Icon:"#4FC029",Border:"#95D97F",Background:"#F9FDF8"},Orange:{Text:"#B34E00",Icon:"#FEAB10",Border:"#F9CB77",Background:"#FFFCF7",Badge:"#F57F17"},Red:{Text:"#C60000",Icon:"#C60000",Border:"#DD6666",Background:"#FDF7F7"},Blue:{Text:"#064D70",Icon:" #066391",Border:"#84B7DB",Background:"#E8F4FA"}},Shadow:{Accent:"rgba(87, 169, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)",Elevation:"rgba(75, 83, 159, 0.24)"}},bookingsg:{Brand:{1:"#EF413D",2:"#F26664",3:"#F58E8B",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#6F4AB8",PrimaryDark:"#6443A6",Secondary:"#6443A6",Accent:{Dark:{1:"#355985",2:"#68819D",3:"#9AABBE"},Light:{1:"#977ECC",2:"#B5A5D7",3:"#CEC3E4 ",4:"#E2DBEF",5:"#F2EFF8",6:"#F7F6FB"}},Neutral:{1:"#282828",2:"#424242",3:"#686868",4:"#A4A4A4",5:"#E0E4E5",6:"#ECEFEF",7:"#F8F8F8",8:"#FFFFFF"},Validation:{Green:{Text:"#097123",Icon:"#4FC029",Border:"#95D97F",Background:"#F9FDF8"},Orange:{Text:"#B34E00",Icon:"#FEAB10",Border:"#F9CB77",Background:"#FFFCF7",Badge:"#F57F17"},Red:{Text:"#C60000",Icon:"#C60000",Border:"#DD6666",Background:"#FDF7F7"},Blue:{Text:"#064D70",Icon:" #066391",Border:"#84B7DB",Background:"#E8F4FA"}},Shadow:{Accent:"rgba(161, 87, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)",Elevation:"rgba(75, 83, 159, 0.24)"}},rbs:{Brand:{1:"#3E4DFF",2:"#AEACFF",3:"#AD44FF",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#4855D4",PrimaryDark:"#3E49B2",Secondary:"#364891",Accent:{Dark:{1:"#5E516E",2:"#7A6F87",3:"#C5C0CC"},Light:{1:"#8397FC",2:"#ABB8FC",3:"#CED6FD ",4:"#E1E4FA",5:"#F0F2FF",6:"#FAFBFF"}},Neutral:{1:"#282828",2:"#424242",3:"#686868",4:"#A4A4A4",5:"#E0E4E5",6:"#ECEFEF",7:"#F8F8F8",8:"#FFFFFF"},Validation:{Green:{Text:"#097123",Icon:"#4FC029",Border:"#95D97F",Background:"#F9FDF8"},Orange:{Text:"#B34E00",Icon:"#FEAB10",Border:"#F9CB77",Background:"#FFFCF7",Badge:"#F57F17"},Red:{Text:"#C60000",Icon:"#C60000",Border:"#DD6666",Background:"#FDF7F7"},Blue:{Text:"#064D70",Icon:" #066391",Border:"#84B7DB",Background:"#E8F4FA"}},Shadow:{Accent:"rgba(90, 87, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)",Elevation:"rgba(75, 83, 159, 0.24)"}}},defaultValue:"base"},wt=e=>t=>{const n=t.theme,r=Dt(Bt,n[bt.colorScheme]);return n.options&&n.options.color?St(r,e,n.options.color):St(r,e)},xt={Brand:{1:wt("Brand.1"),2:wt("Brand.2"),3:wt("Brand.3"),4:wt("Brand.4"),5:wt("Brand.5"),6:wt("Brand.6")},Primary:wt("Primary"),PrimaryDark:wt("PrimaryDark"),Secondary:wt("Secondary"),Accent:{Light:{1:wt("Accent.Light.1"),2:wt("Accent.Light.2"),3:wt("Accent.Light.3"),4:wt("Accent.Light.4"),5:wt("Accent.Light.5"),6:wt("Accent.Light.6")},Dark:{1:wt("Accent.Dark.1"),2:wt("Accent.Dark.2"),3:wt("Accent.Dark.3")}},Neutral:{1:wt("Neutral.1"),2:wt("Neutral.2"),3:wt("Neutral.3"),4:wt("Neutral.4"),5:wt("Neutral.5"),6:wt("Neutral.6"),7:wt("Neutral.7"),8:wt("Neutral.8")},Validation:{Green:{Text:wt("Validation.Green.Text"),Icon:wt("Validation.Green.Icon"),Border:wt("Validation.Green.Border"),Background:wt("Validation.Green.Background")},Orange:{Text:wt("Validation.Orange.Text"),Icon:wt("Validation.Orange.Icon"),Border:wt("Validation.Orange.Border"),Background:wt("Validation.Orange.Background"),Badge:wt("Validation.Orange.Badge")},Red:{Text:wt("Validation.Red.Text"),Icon:wt("Validation.Red.Icon"),Border:wt("Validation.Red.Border"),Background:wt("Validation.Red.Background")},Blue:{Text:wt("Validation.Blue.Text"),Icon:wt("Validation.Blue.Icon"),Border:wt("Validation.Blue.Border"),Background:wt("Validation.Blue.Background")}},Shadow:{Accent:wt("Shadow.Accent"),Red:wt("Shadow.Red"),Elevation:wt("Shadow.Elevation")}},Ht={collections:{base:{InputBoxShadow:c`
2
2
  inset 0 0 6px 1px ${xt.Shadow.Accent}
3
3
  `,InputErrorBoxShadow:c`
4
4
  inset 0 0 6px 1px ${xt.Shadow.Red}
@@ -10,7 +10,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef
10
10
  inset 0 0 6px 1px ${xt.Shadow.Red}
11
11
  `,ElevationBoxShadow:c`
12
12
  0px 2px 8px ${xt.Shadow.Elevation}
13
- `,Table:{Header:"#F5F5F5",Cell:{Primary:"#FBFBFB",Secondary:"#FFFFFF",Selected:"#F0F6FF",Hover:"#DDE6FD"}}}},defaultValue:"base"},Mt=e=>t=>{const n=t.theme,r=Dt(Ht,n[bt.designTokenScheme]);return n.options?.designToken?St(r,e,n.options.designToken):St(r,e)},Et=Mt("InputBoxShadow"),Ot=Mt("InputErrorBoxShadow"),_t=(Mt("ElevationBoxShadow"),Mt("Table.Header"),Mt("Table.Cell.Primary"),Mt("Table.Cell.Secondary"),Mt("Table.Cell.Selected"),Mt("Table.Cell.Hover"),{Regular:"Open Sans",Semibold:"Open Sans Semibold",Bold:"Open Sans Bold",Light:"Open Sans Light"}),kt={collections:{base:{D1:{fontFamily:_t.Bold,fontSize:3,fontWeight:700,lineHeight:4,letterSpacing:-.056},D2:{fontFamily:_t.Bold,fontSize:2.5,fontWeight:700,lineHeight:3.5,letterSpacing:-.032},D3:{fontFamily:_t.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},D4:{fontFamily:_t.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},DBody:{fontFamily:_t.Regular,fontSize:1.375,lineHeight:1.75},H1:{fontFamily:_t.Bold,fontSize:2,fontWeight:700,lineHeight:2.5},H2:{fontFamily:_t.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},H3:{fontFamily:_t.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},H4:{fontFamily:_t.Bold,fontSize:1.125,fontWeight:700,lineHeight:1.625},H5:{fontFamily:_t.Bold,fontSize:1,fontWeight:700,lineHeight:1.5,letterSpacing:.014},H6:{fontFamily:_t.Bold,fontSize:.875,fontWeight:700,lineHeight:1.6,letterSpacing:.012},Body:{fontFamily:_t.Regular,fontSize:1.125,lineHeight:1.625},BodySmall:{fontFamily:_t.Regular,fontSize:1,lineHeight:1.5,letterSpacing:.014},XSmall:{fontFamily:_t.Regular,fontSize:.75,lineHeight:1.2,letterSpacing:.012}}},defaultValue:"base"},At=e=>t=>{const n=t.theme,r=Dt(kt,n[bt.textStyleScheme]);return n.options&&n.options.textStyle?St(r,e,n.options.textStyle):St(r,e)},zt={D1:{fontFamily:At("D1.fontFamily"),fontSize:At("D1.fontSize"),fontWeight:At("D1.fontWeight"),lineHeight:At("D1.lineHeight"),letterSpacing:At("D1.letterSpacing")},D2:{fontFamily:At("D2.fontFamily"),fontSize:At("D2.fontSize"),fontWeight:At("D2.fontWeight"),lineHeight:At("D2.lineHeight"),letterSpacing:At("D2.letterSpacing")},D3:{fontFamily:At("D3.fontFamily"),fontSize:At("D3.fontSize"),fontWeight:At("D3.fontWeight"),lineHeight:At("D3.lineHeight"),letterSpacing:At("D3.letterSpacing")},D4:{fontFamily:At("D4.fontFamily"),fontSize:At("D4.fontSize"),fontWeight:At("D4.fontWeight"),lineHeight:At("D4.lineHeight"),letterSpacing:At("D4.letterSpacing")},DBody:{fontFamily:At("DBody.fontFamily"),fontSize:At("DBody.fontSize"),fontWeight:At("DBody.fontWeight"),lineHeight:At("DBody.lineHeight"),letterSpacing:At("DBody.letterSpacing")},H1:{fontFamily:At("H1.fontFamily"),fontSize:At("H1.fontSize"),fontWeight:At("H1.fontWeight"),lineHeight:At("H1.lineHeight"),letterSpacing:At("H1.letterSpacing")},H2:{fontFamily:At("H2.fontFamily"),fontSize:At("H2.fontSize"),fontWeight:At("H2.fontWeight"),lineHeight:At("H2.lineHeight"),letterSpacing:At("H2.letterSpacing")},H3:{fontFamily:At("H3.fontFamily"),fontSize:At("H3.fontSize"),fontWeight:At("H3.fontWeight"),lineHeight:At("H3.lineHeight"),letterSpacing:At("H3.letterSpacing")},H4:{fontFamily:At("H4.fontFamily"),fontSize:At("H4.fontSize"),fontWeight:At("H4.fontWeight"),lineHeight:At("H4.lineHeight"),letterSpacing:At("H4.letterSpacing")},H5:{fontFamily:At("H5.fontFamily"),fontSize:At("H5.fontSize"),fontWeight:At("H5.fontWeight"),lineHeight:At("H5.lineHeight"),letterSpacing:At("H5.letterSpacing")},H6:{fontFamily:At("H6.fontFamily"),fontSize:At("H6.fontSize"),fontWeight:At("H6.fontWeight"),lineHeight:At("H6.lineHeight"),letterSpacing:At("H6.letterSpacing")},Body:{fontFamily:At("Body.fontFamily"),fontSize:At("Body.fontSize"),fontWeight:At("Body.fontWeight"),lineHeight:At("Body.lineHeight"),letterSpacing:At("Body.letterSpacing")},BodySmall:{fontFamily:At("BodySmall.fontFamily"),fontSize:At("BodySmall.fontSize"),fontWeight:At("BodySmall.fontWeight"),lineHeight:At("BodySmall.lineHeight"),letterSpacing:At("BodySmall.letterSpacing")},XSmall:{fontFamily:At("XSmall.fontFamily"),fontSize:At("XSmall.fontSize"),fontWeight:At("XSmall.fontWeight"),lineHeight:At("XSmall.lineHeight"),letterSpacing:At("XSmall.letterSpacing")}},Ct=e=>{switch(e){case 700:case"bold":return _t.Bold;case 600:case"semibold":return _t.Semibold;case 300:case"light":return _t.Light;case 400:case"regular":return _t.Regular;default:return""}},Tt=(e,t)=>n=>{const r=zt[e].fontFamily(n),i=zt[e].fontWeight(n);return Object.values(_t).includes(r)?c`
13
+ `,Table:{Header:"#F5F5F5",Cell:{Primary:"#FBFBFB",Secondary:"#FFFFFF",Selected:"#F0F6FF",Hover:"#DDE6FD"}}}},defaultValue:"base"},Mt=e=>t=>{const n=t.theme,r=Dt(Ht,n[bt.designTokenScheme]);return n.options?.designToken?St(r,e,n.options.designToken):St(r,e)},Ot=Mt("InputBoxShadow"),Et=Mt("InputErrorBoxShadow"),_t=(Mt("ElevationBoxShadow"),Mt("Table.Header"),Mt("Table.Cell.Primary"),Mt("Table.Cell.Secondary"),Mt("Table.Cell.Selected"),Mt("Table.Cell.Hover"),{Regular:"Open Sans",Semibold:"Open Sans Semibold",Bold:"Open Sans Bold",Light:"Open Sans Light"}),kt={collections:{base:{D1:{fontFamily:_t.Bold,fontSize:3,fontWeight:700,lineHeight:4,letterSpacing:-.056},D2:{fontFamily:_t.Bold,fontSize:2.5,fontWeight:700,lineHeight:3.5,letterSpacing:-.032},D3:{fontFamily:_t.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},D4:{fontFamily:_t.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},DBody:{fontFamily:_t.Regular,fontSize:1.375,lineHeight:1.75},H1:{fontFamily:_t.Bold,fontSize:2,fontWeight:700,lineHeight:2.5},H2:{fontFamily:_t.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},H3:{fontFamily:_t.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},H4:{fontFamily:_t.Bold,fontSize:1.125,fontWeight:700,lineHeight:1.625},H5:{fontFamily:_t.Bold,fontSize:1,fontWeight:700,lineHeight:1.5,letterSpacing:.014},H6:{fontFamily:_t.Bold,fontSize:.875,fontWeight:700,lineHeight:1.6,letterSpacing:.012},Body:{fontFamily:_t.Regular,fontSize:1.125,lineHeight:1.625},BodySmall:{fontFamily:_t.Regular,fontSize:1,lineHeight:1.5,letterSpacing:.014},XSmall:{fontFamily:_t.Regular,fontSize:.75,lineHeight:1.2,letterSpacing:.012}}},defaultValue:"base"},At=e=>t=>{const n=t.theme,r=Dt(kt,n[bt.textStyleScheme]);return n.options&&n.options.textStyle?St(r,e,n.options.textStyle):St(r,e)},zt={D1:{fontFamily:At("D1.fontFamily"),fontSize:At("D1.fontSize"),fontWeight:At("D1.fontWeight"),lineHeight:At("D1.lineHeight"),letterSpacing:At("D1.letterSpacing")},D2:{fontFamily:At("D2.fontFamily"),fontSize:At("D2.fontSize"),fontWeight:At("D2.fontWeight"),lineHeight:At("D2.lineHeight"),letterSpacing:At("D2.letterSpacing")},D3:{fontFamily:At("D3.fontFamily"),fontSize:At("D3.fontSize"),fontWeight:At("D3.fontWeight"),lineHeight:At("D3.lineHeight"),letterSpacing:At("D3.letterSpacing")},D4:{fontFamily:At("D4.fontFamily"),fontSize:At("D4.fontSize"),fontWeight:At("D4.fontWeight"),lineHeight:At("D4.lineHeight"),letterSpacing:At("D4.letterSpacing")},DBody:{fontFamily:At("DBody.fontFamily"),fontSize:At("DBody.fontSize"),fontWeight:At("DBody.fontWeight"),lineHeight:At("DBody.lineHeight"),letterSpacing:At("DBody.letterSpacing")},H1:{fontFamily:At("H1.fontFamily"),fontSize:At("H1.fontSize"),fontWeight:At("H1.fontWeight"),lineHeight:At("H1.lineHeight"),letterSpacing:At("H1.letterSpacing")},H2:{fontFamily:At("H2.fontFamily"),fontSize:At("H2.fontSize"),fontWeight:At("H2.fontWeight"),lineHeight:At("H2.lineHeight"),letterSpacing:At("H2.letterSpacing")},H3:{fontFamily:At("H3.fontFamily"),fontSize:At("H3.fontSize"),fontWeight:At("H3.fontWeight"),lineHeight:At("H3.lineHeight"),letterSpacing:At("H3.letterSpacing")},H4:{fontFamily:At("H4.fontFamily"),fontSize:At("H4.fontSize"),fontWeight:At("H4.fontWeight"),lineHeight:At("H4.lineHeight"),letterSpacing:At("H4.letterSpacing")},H5:{fontFamily:At("H5.fontFamily"),fontSize:At("H5.fontSize"),fontWeight:At("H5.fontWeight"),lineHeight:At("H5.lineHeight"),letterSpacing:At("H5.letterSpacing")},H6:{fontFamily:At("H6.fontFamily"),fontSize:At("H6.fontSize"),fontWeight:At("H6.fontWeight"),lineHeight:At("H6.lineHeight"),letterSpacing:At("H6.letterSpacing")},Body:{fontFamily:At("Body.fontFamily"),fontSize:At("Body.fontSize"),fontWeight:At("Body.fontWeight"),lineHeight:At("Body.lineHeight"),letterSpacing:At("Body.letterSpacing")},BodySmall:{fontFamily:At("BodySmall.fontFamily"),fontSize:At("BodySmall.fontSize"),fontWeight:At("BodySmall.fontWeight"),lineHeight:At("BodySmall.lineHeight"),letterSpacing:At("BodySmall.letterSpacing")},XSmall:{fontFamily:At("XSmall.fontFamily"),fontSize:At("XSmall.fontSize"),fontWeight:At("XSmall.fontWeight"),lineHeight:At("XSmall.lineHeight"),letterSpacing:At("XSmall.letterSpacing")}},Ct=e=>{switch(e){case 700:case"bold":return _t.Bold;case 600:case"semibold":return _t.Semibold;case 300:case"light":return _t.Light;case 400:case"regular":return _t.Regular;default:return""}},Tt=(e,t)=>n=>{const r=zt[e].fontFamily(n),i=zt[e].fontWeight(n);return Object.values(_t).includes(r)?c`
14
14
  font-family: ${Ct(t)||Ct(i)||r};
15
15
  font-weight: normal !important;
16
16
  `:c`
@@ -149,7 +149,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef
149
149
 
150
150
  :focus-within {
151
151
  border: 1px solid ${xt.Accent.Light[1]};
152
- box-shadow: ${Et};
152
+ box-shadow: ${Ot};
153
153
  }
154
154
 
155
155
  ${e=>e.$readOnly?c`
@@ -174,7 +174,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef
174
174
 
175
175
  :focus-within {
176
176
  border: 1px solid ${xt.Validation.Red.Border};
177
- box-shadow: ${Ot};
177
+ box-shadow: ${Et};
178
178
  }
179
179
  `:void 0}
180
180
  `;s.input`
@@ -250,7 +250,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef
250
250
  `,yn=s.button`
251
251
  position: relative;
252
252
  height: auto;
253
- padding: 0 1rem;
253
+ padding: 0.75rem 1rem;
254
254
 
255
255
  margin-right: -1rem; // offset the padding
256
256
  cursor: pointer;
@@ -278,7 +278,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef
278
278
 
279
279
  :focus-within {
280
280
  border: 1px solid ${xt.Accent.Light[1]};
281
- box-shadow: ${Et};
281
+ box-shadow: ${Ot};
282
282
  }
283
283
 
284
284
  ${e=>e.$readOnly?c`
@@ -305,7 +305,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef
305
305
 
306
306
  :focus-within {
307
307
  border: 1px solid ${xt.Validation.Red.Border(e)};
308
- box-shadow: ${Ot};
308
+ box-shadow: ${Et};
309
309
  }
310
310
  `:void 0}
311
311
  `,s(Fn)`
@@ -399,5 +399,5 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useRef
399
399
  ${e=>{if(e.$inactive)return c`
400
400
  color: ${xt.Neutral[3]};
401
401
  `}}
402
- `,Mn=({disabled:r,error:o,value:s,onChange:c,onBlur:u,onChangeRaw:d,onBlurRaw:h,readOnly:f,placeholder:g="00-8888",...p})=>{const[m,y]=a(""),[v,$]=a(""),[F,S]=a("none"),D=i(null),b=i(null),B=i(null),w=i(m),x=i(v),H=i(F),M=e=>e.toLocaleUpperCase().replace(/[^0-9A-Za-z]/g,""),E=pn({ref:b,formatter:M}),O=pn({ref:B,formatter:M}),_=e=>{w.current=e,y(e)},k=e=>{x.current=e,$(e)},A=e=>{H.current=e,S(e)};l((()=>(document.addEventListener("mousedown",z),D.current&&D.current.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",z),D.current&&D.current.removeEventListener("keydown",C)})),[F]),l((()=>{"floor"===F&&3===m.length&&B.current&&B.current.focus()}),[m]),l((()=>{I(s)}),[s]);const z=e=>{r||f||D&&D.current.contains(e.target)||"none"!==H.current&&(A("none"),V())},C=e=>{"unit"===e.target.name&&"Tab"===e.code&&(A("none"),V())},T=e=>{A(e.target.name),e.target.select()},W=e=>{const t=e.target.name,n=e.target.value;"floor"===t?_(L(n)):k(L(n))},Y=e=>{const t=e.target.name;if("floor"===t){const{nextValue:e,updateCaretPosition:n}=E();n(),_(e),R(e,t)}else{const{nextValue:e,updateCaretPosition:n}=O();n(),k(e),R(e,t)}},N=e=>{"Backspace"!==e.code&&"Backspace"!==e.key||"unit"===F&&0===v.length&&b.current.focus()},L=e=>/^[0-9]$/.test(e)?gn.padValue(e,!0):e.toLocaleUpperCase(),I=e=>{if(e!==En)if(void 0===e||0===e.length)_(""),k("");else{const t=e.split("-");if(2===t.length){const e=t[0],n=t[1];_("floor"===F?e:L(e)),k("unit"===F?n:L(n))}}},R=(e,t)=>{if(!c&&!d)return;const n={floor:w.current,unit:x.current};if(n[t]=e,c){const e=P(n);c(e)}d&&d([n.floor,n.unit])},V=()=>{if(!u&&!h)return;const e={floor:L(w.current),unit:L(x.current)};if(u){const t=P(e);u(t)}h&&h([e.floor,e.unit])},P=e=>{const t=[e.floor,e.unit];return e.floor.length>0&&e.unit.length>0?t.join("-"):t.every((e=>""===e))?"":En},j=e=>e.split("-");return e(jt,{ref:D,onClick:()=>{"none"===F&&b.current&&b.current.focus()},$disabled:r,$error:o,$readOnly:f,"data-testid":p["data-testid"],children:[t(Dn,{"data-testid":"addon",disabled:r,$readOnly:f,children:"#"}),f&&s?(()=>{const n=s.split("-");return e(xn,{children:[t(Hn,{children:n[0]}),t(wn,{children:"-"}),t(Hn,{children:n[1]})]})})():e(n,{children:[t(bn,{name:"floor",maxLength:3,value:m,ref:b,onFocus:T,onBlur:W,onChange:Y,disabled:r,readOnly:f,type:"text",pattern:"[0-9A-Z]{2,3}","data-testid":"floor-input","aria-label":"floor-input",placeholder:"floor"!==F||f?j(g)[0]:""}),t(wn,{$inactive:0===m.length,children:"-"}),t(Bn,{name:"unit",maxLength:5,value:v,ref:B,onFocus:T,onBlur:W,onChange:Y,onKeyDown:N,disabled:r,readOnly:f,type:"text",pattern:"[0-9A-Z]{2,5}","data-testid":"unit-input","aria-label":"unit-input",placeholder:"unit"!==F||f?j(g)[1]:""})]})]})},En="Invalid unit number";export{Mn as UnitNumberInput};
402
+ `,Mn=({disabled:r,error:o,value:s,onChange:c,onBlur:u,onChangeRaw:d,onBlurRaw:h,readOnly:f,placeholder:g="00-8888",...p})=>{const[m,y]=a(""),[v,$]=a(""),[F,S]=a("none"),D=i(null),b=i(null),B=i(null),w=i(m),x=i(v),H=i(F),M=e=>e.toLocaleUpperCase().replace(/[^0-9A-Za-z]/g,""),O=pn({ref:b,formatter:M}),E=pn({ref:B,formatter:M}),_=e=>{w.current=e,y(e)},k=e=>{x.current=e,$(e)},A=e=>{H.current=e,S(e)};l((()=>{"floor"===F&&3===m.length&&B.current&&B.current.focus()}),[m]),l((()=>{N(s)}),[s]);const z=e=>{A(e.target.name),e.target.select()},C=e=>{const t=e.target.name,n=e.target.value,r=Y(n);"floor"===t?(_(r),r!==m&&L(r,t)):(k(r),r!==v&&L(r,t))},T=e=>{const t=e.target.name;if("floor"===t){const{nextValue:e,updateCaretPosition:n}=O();n(),_(e),L(e,t)}else{const{nextValue:e,updateCaretPosition:n}=E();n(),k(e),L(e,t)}},W=e=>{"Backspace"!==e.code&&"Backspace"!==e.key||"unit"===F&&0===v.length&&b.current.focus()},Y=e=>/^[0-9]$/.test(e)?gn.padValue(e,!0):e.toLocaleUpperCase(),N=e=>{if(e!==On)if(void 0===e||0===e.length)_(""),k("");else{const t=e.split("-");if(2===t.length){const e=t[0],n=t[1];_("floor"===F?e:Y(e)),k("unit"===F?n:Y(n))}}},L=(e,t)=>{if(!c&&!d)return;const n={floor:w.current,unit:x.current};if(n[t]=e,c){const e=R(n);c(e)}d&&d([n.floor,n.unit])},I=()=>{if(!u&&!h)return;const e={floor:Y(w.current),unit:Y(x.current)};if(u){const t=R(e);u(t)}h&&h([e.floor,e.unit])},R=e=>{const t=[e.floor,e.unit];return e.floor.length>0&&e.unit.length>0?t.join("-"):t.every((e=>""===e))?"":On},V=e=>e.split("-");return e(jt,{ref:D,onClick:()=>{"none"===F&&b.current&&b.current.focus()},$disabled:r,$error:o,$readOnly:f,"data-testid":p["data-testid"],tabIndex:-1,onBlur:e=>{D.current&&D.current.contains(e.relatedTarget)||"none"!==H.current&&(A("none"),I())},children:[t(Dn,{"data-testid":"addon",disabled:r,$readOnly:f,children:"#"}),f&&s?(()=>{const n=s.split("-");return e(xn,{children:[t(Hn,{children:n[0]}),t(wn,{children:"-"}),t(Hn,{children:n[1]})]})})():e(n,{children:[t(bn,{name:"floor",maxLength:3,value:m,ref:b,onFocus:z,onBlur:C,onChange:T,disabled:r,readOnly:f,type:"text",pattern:"[0-9A-Z]{2,3}","data-testid":"floor-input","aria-label":"floor-input",placeholder:"floor"!==F||f?V(g)[0]:""}),t(wn,{$inactive:0===m.length,children:"-"}),t(Bn,{name:"unit",maxLength:5,value:v,ref:B,onFocus:z,onBlur:C,onChange:T,onKeyDown:W,disabled:r,readOnly:f,type:"text",pattern:"[0-9A-Z]{2,5}","data-testid":"unit-input","aria-label":"unit-input",placeholder:"unit"!==F||f?V(g)[1]:""})]})]})},On="Invalid unit number";export{Mn as UnitNumberInput};
403
403
  //# sourceMappingURL=index.js.map