@lifesg/react-design-system 1.0.0-alpha.20 → 1.0.0-alpha.21

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.
Files changed (63) hide show
  1. package/animations/index.d.ts +1 -0
  2. package/animations/index.js +6 -3
  3. package/animations/index.js.map +1 -1
  4. package/animations/loading-dots-spinner/loading-dots-spinner.d.ts +2 -0
  5. package/animations/loading-dots-spinner/lottie-animation.d.ts +2 -0
  6. package/calendar/calendar-day.d.ts +11 -0
  7. package/calendar/calendar-day.style.d.ts +23 -0
  8. package/calendar/calendar-month.d.ts +12 -0
  9. package/calendar/calendar-month.style.d.ts +12 -0
  10. package/calendar/calendar-year.d.ts +12 -0
  11. package/calendar/calendar-year.style.d.ts +12 -0
  12. package/calendar/calendar.d.ts +4 -0
  13. package/calendar/calendar.style.d.ts +35 -0
  14. package/calendar/index.d.ts +2 -0
  15. package/calendar/index.js +381 -0
  16. package/calendar/index.js.map +1 -0
  17. package/calendar/package.json +7 -0
  18. package/calendar/types.d.ts +15 -0
  19. package/cjs/index.js +426 -221
  20. package/cjs/index.js.map +1 -1
  21. package/date-input/index.js +115 -115
  22. package/date-input/index.js.map +1 -1
  23. package/error-display/index.js +1 -0
  24. package/error-display/index.js.map +1 -1
  25. package/form/index.js +440 -471
  26. package/form/index.js.map +1 -1
  27. package/index.d.ts +1 -0
  28. package/index.js +461 -256
  29. package/index.js.map +1 -1
  30. package/input/index.js +71 -70
  31. package/input/index.js.map +1 -1
  32. package/input/input.style.d.ts +3 -7
  33. package/input-group/index.js +375 -363
  34. package/input-group/index.js.map +1 -1
  35. package/input-group/input-group-list-addon.d.ts +1 -1
  36. package/input-group/input-group-list-addon.style.d.ts +9 -1
  37. package/input-group/input-group.style.d.ts +4 -7
  38. package/input-group/types.d.ts +3 -2
  39. package/input-select/index.js +10 -4
  40. package/input-select/index.js.map +1 -1
  41. package/otp-input/index.d.ts +2 -0
  42. package/otp-input/index.js +600 -0
  43. package/otp-input/index.js.map +1 -0
  44. package/otp-input/otp-input.d.ts +3 -0
  45. package/otp-input/otp-input.styles.d.ts +5 -0
  46. package/otp-input/package.json +7 -0
  47. package/otp-input/types.d.ts +22 -0
  48. package/package.json +1 -1
  49. package/phone-number-input/index.d.ts +1 -0
  50. package/phone-number-input/index.js +375 -365
  51. package/phone-number-input/index.js.map +1 -1
  52. package/phone-number-input/phone-number-input-helper.d.ts +2 -2
  53. package/phone-number-input/phone-number-input.d.ts +1 -1
  54. package/phone-number-input/types.d.ts +9 -0
  55. package/shared/dropdown-list/dropdown-list.d.ts +1 -1
  56. package/shared/dropdown-list/types.d.ts +1 -0
  57. package/shared/input-wrapper/input-wrapper.d.ts +8 -0
  58. package/unit-number/index.js +256 -302
  59. package/unit-number/index.js.map +1 -1
  60. package/unit-number/unit-number-input.style.d.ts +7 -12
  61. package/util/calendar-helper.d.ts +10 -0
  62. package/util/index.d.ts +1 -0
  63. package/phone-number-input/phone-number-input.styles.d.ts +0 -1
@@ -1,244 +1,93 @@
1
- import e,{jsxs as t,jsx as n}from"react/jsx-runtime";import r,{useState as o,useRef as a,useEffect as i}from"react";import l,{css as d}from"styled-components";var c;!function(e){e.transformWithSpaces=(e,t)=>{const n="(.{"+t+"})";return e.replace(/[^\dA-Z]/gi,"").replace(new RegExp(n,"g"),"$1 ").trim()},e.padValue=(e,t)=>{if("0"===e)return t?e:e.padStart(2,"0");if(""===e)return e;return parseInt(e).toString().padStart(2,"0")},e.shouldTruncateToTwoLines=(e,t)=>{const n=Math.floor(t/9);return e.length>=2*n||1===e.split(" ").length&&e.length>n},e.truncateOneLine=(e,t,n,r)=>{let o=0;t>n&&(o=Math.floor((t-n)/8));const a=r+o;if(a<e.length){const t=Math.floor(a/2);return e.substring(0,t)+" ... "+e.substring(e.length-t,e.length)}return e}}(c||(c={}));var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h=Array.isArray,s="object"==typeof u&&u&&u.Object===Object&&u,g="object"==typeof self&&self&&self.Object===Object&&self,p=s||g||Function("return this")(),f=p.Symbol,y=f,m=Object.prototype,v=m.hasOwnProperty,S=m.toString,b=y?y.toStringTag:void 0;var F=function(e){var t=v.call(e,b),n=e[b];try{e[b]=void 0;var r=!0}catch(e){}var o=S.call(e);return r&&(t?e[b]=n:delete e[b]),o},$=Object.prototype.toString;var w=F,B=function(e){return $.call(e)},H=f?f.toStringTag:void 0;var x=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":H&&H in Object(e)?w(e):B(e)};var D=x,C=function(e){return null!=e&&"object"==typeof e};var _=function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==D(e)},k=h,z=_,E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/;var N=function(e,t){if(k(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!z(e))||(O.test(e)||!E.test(e)||null!=t&&e in Object(t))};var A=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},W=x,L=A;var V,j=function(e){if(!L(e))return!1;var t=W(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},R=p["__core-js_shared__"],T=(V=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"";var I=function(e){return!!T&&T in e},P=Function.prototype.toString;var G=j,M=I,X=A,Z=function(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""},U=/^\[object .+?Constructor\]$/,K=Function.prototype,q=Object.prototype,J=K.toString,Q=q.hasOwnProperty,Y=RegExp("^"+J.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ee=function(e){return!(!X(e)||M(e))&&(G(e)?Y:U).test(Z(e))},te=function(e,t){return null==e?void 0:e[t]};var ne=function(e,t){var n=te(e,t);return ee(n)?n:void 0},re=ne(Object,"create"),oe=re;var ae=function(){this.__data__=oe?oe(null):{},this.size=0};var ie=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},le=re,de=Object.prototype.hasOwnProperty;var ce=function(e){var t=this.__data__;if(le){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return de.call(t,e)?t[e]:void 0},ue=re,he=Object.prototype.hasOwnProperty;var se=re;var ge=ae,pe=ie,fe=ce,ye=function(e){var t=this.__data__;return ue?void 0!==t[e]:he.call(t,e)},me=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=se&&void 0===t?"__lodash_hash_undefined__":t,this};function ve(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])}}ve.prototype.clear=ge,ve.prototype.delete=pe,ve.prototype.get=fe,ve.prototype.has=ye,ve.prototype.set=me;var Se=ve;var be=function(){this.__data__=[],this.size=0};var Fe=function(e,t){return e===t||e!=e&&t!=t};var $e=function(e,t){for(var n=e.length;n--;)if(Fe(e[n][0],t))return n;return-1},we=$e,Be=Array.prototype.splice;var He=$e;var xe=$e;var De=$e;var Ce=be,_e=function(e){var t=this.__data__,n=we(t,e);return!(n<0)&&(n==t.length-1?t.pop():Be.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]},ze=function(e){return xe(this.__data__,e)>-1},Ee=function(e,t){var n=this.__data__,r=De(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Oe(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])}}Oe.prototype.clear=Ce,Oe.prototype.delete=_e,Oe.prototype.get=ke,Oe.prototype.has=ze,Oe.prototype.set=Ee;var Ne=Oe,Ae=ne(p,"Map"),We=Se,Le=Ne,Ve=Ae;var je=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 je(t)?n["string"==typeof t?"string":"hash"]:n.map},Te=Re;var Ie=Re;var Pe=Re;var Ge=Re;var Me=function(){this.size=0,this.__data__={hash:new We,map:new(Ve||Le),string:new We}},Xe=function(e){var t=Te(this,e).delete(e);return this.size-=t?1:0,t},Ze=function(e){return Ie(this,e).get(e)},Ue=function(e){return Pe(this,e).has(e)},Ke=function(e,t){var n=Ge(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function qe(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])}}qe.prototype.clear=Me,qe.prototype.delete=Xe,qe.prototype.get=Ze,qe.prototype.has=Ue,qe.prototype.set=Ke;var Je=qe;function Qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(Qe.Cache||Je),n}Qe.Cache=Je;var Ye=Qe;var et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/\\(\\)?/g,nt=function(e){var t=Ye(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(et,(function(e,n,r,o){t.push(r?o.replace(tt,"$1"):n||e)})),t}));var rt=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},ot=h,at=_,it=f?f.prototype:void 0,lt=it?it.toString:void 0;var dt=function e(t){if("string"==typeof t)return t;if(ot(t))return rt(t,e)+"";if(at(t))return lt?lt.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n},ct=dt;var ut=h,ht=N,st=nt,gt=function(e){return null==e?"":ct(e)};var pt=_;var ft=function(e,t){return ut(e)?e:ht(e,t)?[e]:st(gt(e))},yt=function(e){if("string"==typeof e||pt(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var mt=function(e,t){for(var n=0,r=(t=ft(t,e)).length;null!=e&&n<r;)e=e[yt(t[n++])];return n&&n==r?e:void 0};var vt=function(e,t,n){var r=null==e?void 0:mt(e,t);return void 0===r?n:r};const St=(e,t,n)=>t?vt(n,t)||vt(e,t):n||e,bt=(e,t)=>{const n=t||e.defaultValue;return vt(e.collections,n)};var Ft;!function(e){e.colorScheme="colorScheme",e.layout="layout",e.textStyleScheme="textStyleScheme",e.designTokenScheme="designTokenScheme"}(Ft||(Ft={}));const $t={collections:{base:{Brand:{1:"#EF413D",2:"#F26664",3:"#F58E8B",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#1C76D5",PrimaryDark:"#1869BF",Secondary:"#0056b3",Accent:{Dark:{1:"#465A88",2:"#556D99",3:"#8D8DBF"},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"}},Shadow:{Accent:"rgba(87, 169, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)"}},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:"#9F82D9",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"}},Shadow:{Accent:"rgba(161, 87, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)"}}},defaultValue:"base"},wt=e=>t=>{const n=t.theme,r=bt($t,n[Ft.colorScheme]);return n.options&&n.options.color?St(r,e,n.options.color):St(r,e)},Bt={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")}},Shadow:{Accent:wt("Shadow.Accent"),Red:wt("Shadow.Red")}},Ht={collections:{base:{InputBoxShadow:d`
2
- inset 0 0 6px 1px ${Bt.Shadow.Accent}
3
- `,InputErrorBoxShadow:d`
4
- inset 0 0 6px 1px ${Bt.Shadow.Red}
5
- `}},defaultValue:"base"},xt=e=>t=>{const n=t.theme,r=bt(Ht,n[Ft.designTokenScheme]);return n.options?.designToken?St(r,e,n.options.designToken):St(r,e)},Dt=xt("InputBoxShadow"),Ct=xt("InputErrorBoxShadow"),_t={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"},zt=e=>t=>{const n=t.theme,r=bt(kt,n[Ft.textStyleScheme]);return n.options&&n.options.textStyle?St(r,e,n.options.textStyle):St(r,e)},Et={D1:{fontFamily:zt("D1.fontFamily"),fontSize:zt("D1.fontSize"),fontWeight:zt("D1.fontWeight"),lineHeight:zt("D1.lineHeight"),letterSpacing:zt("D1.letterSpacing")},D2:{fontFamily:zt("D2.fontFamily"),fontSize:zt("D2.fontSize"),fontWeight:zt("D2.fontWeight"),lineHeight:zt("D2.lineHeight"),letterSpacing:zt("D2.letterSpacing")},D3:{fontFamily:zt("D3.fontFamily"),fontSize:zt("D3.fontSize"),fontWeight:zt("D3.fontWeight"),lineHeight:zt("D3.lineHeight"),letterSpacing:zt("D3.letterSpacing")},D4:{fontFamily:zt("D4.fontFamily"),fontSize:zt("D4.fontSize"),fontWeight:zt("D4.fontWeight"),lineHeight:zt("D4.lineHeight"),letterSpacing:zt("D4.letterSpacing")},DBody:{fontFamily:zt("DBody.fontFamily"),fontSize:zt("DBody.fontSize"),fontWeight:zt("DBody.fontWeight"),lineHeight:zt("DBody.lineHeight"),letterSpacing:zt("DBody.letterSpacing")},H1:{fontFamily:zt("H1.fontFamily"),fontSize:zt("H1.fontSize"),fontWeight:zt("H1.fontWeight"),lineHeight:zt("H1.lineHeight"),letterSpacing:zt("H1.letterSpacing")},H2:{fontFamily:zt("H2.fontFamily"),fontSize:zt("H2.fontSize"),fontWeight:zt("H2.fontWeight"),lineHeight:zt("H2.lineHeight"),letterSpacing:zt("H2.letterSpacing")},H3:{fontFamily:zt("H3.fontFamily"),fontSize:zt("H3.fontSize"),fontWeight:zt("H3.fontWeight"),lineHeight:zt("H3.lineHeight"),letterSpacing:zt("H3.letterSpacing")},H4:{fontFamily:zt("H4.fontFamily"),fontSize:zt("H4.fontSize"),fontWeight:zt("H4.fontWeight"),lineHeight:zt("H4.lineHeight"),letterSpacing:zt("H4.letterSpacing")},H5:{fontFamily:zt("H5.fontFamily"),fontSize:zt("H5.fontSize"),fontWeight:zt("H5.fontWeight"),lineHeight:zt("H5.lineHeight"),letterSpacing:zt("H5.letterSpacing")},H6:{fontFamily:zt("H6.fontFamily"),fontSize:zt("H6.fontSize"),fontWeight:zt("H6.fontWeight"),lineHeight:zt("H6.lineHeight"),letterSpacing:zt("H6.letterSpacing")},Body:{fontFamily:zt("Body.fontFamily"),fontSize:zt("Body.fontSize"),fontWeight:zt("Body.fontWeight"),lineHeight:zt("Body.lineHeight"),letterSpacing:zt("Body.letterSpacing")},BodySmall:{fontFamily:zt("BodySmall.fontFamily"),fontSize:zt("BodySmall.fontSize"),fontWeight:zt("BodySmall.fontWeight"),lineHeight:zt("BodySmall.lineHeight"),letterSpacing:zt("BodySmall.letterSpacing")},XSmall:{fontFamily:zt("XSmall.fontFamily"),fontSize:zt("XSmall.fontSize"),fontWeight:zt("XSmall.fontWeight"),lineHeight:zt("XSmall.lineHeight"),letterSpacing:zt("XSmall.letterSpacing")}},Ot=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""}},Nt=(e,t)=>n=>{const r=Et[e].fontFamily(n),o=Et[e].fontWeight(n);return Object.values(_t).includes(r)?d`
6
- font-family: ${Ot(t)||Ot(o)||r};
7
- font-weight: normal !important;
8
- `:d`
9
- font-family: ${r};
10
- font-weight: ${(At(t)||o)??"normal"};
11
- `},At=e=>{switch(e){case 300:case"light":return 300;case 400:case"regular":return 400;case 600:case"semibold":return 600;case 700:case"bold":return 700;case 900:case"black":return 900;default:return""}},Wt=(e,t,n=!1)=>r=>{const o=Et[e],a=o.fontSize(r);return d`
12
- ${Nt(e,t)}
13
- font-size: ${a}rem !important;
14
- line-height: ${o.lineHeight}rem !important;
15
- letter-spacing: ${o.letterSpacing(r)||0}rem !important;
16
- ${d`
17
- margin-bottom: ${a*(n?1.05:0)}rem;
18
- `}
19
- `},Lt=(e=!1,t=!1)=>t?d`
20
- display: block;
21
- `:e?d`
22
- display: inline;
23
- `:d`
24
- display: block;
25
- `;var Vt,jt={};Object.defineProperty(jt,"__esModule",{value:!0});var Rt=e;const Tt=e=>Rt.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Rt.jsx("path",{d:"M4.25 17.5C3.764 17.5 3.35067 17.33 3.01 16.99C2.67 16.6493 2.5 16.236 2.5 15.75V4.25C2.5 3.764 2.67 3.35067 3.01 3.01C3.35067 2.67 3.764 2.5 4.25 2.5H9.208C9.444 2.5 9.649 2.58667 9.823 2.76C9.99633 2.934 10.083 3.139 10.083 3.375C10.083 3.611 9.99633 3.816 9.823 3.99C9.649 4.16333 9.444 4.25 9.208 4.25H4.25V15.75H15.75V10.792C15.75 10.556 15.8367 10.351 16.01 10.177C16.184 10.0037 16.389 9.917 16.625 9.917C16.861 9.917 17.066 10.0037 17.24 10.177C17.4133 10.351 17.5 10.556 17.5 10.792V15.75C17.5 16.236 17.33 16.6493 16.99 16.99C16.6493 17.33 16.236 17.5 15.75 17.5H4.25ZM7.5 12.5C7.33333 12.3333 7.25 12.1283 7.25 11.885C7.25 11.6423 7.33333 11.4377 7.5 11.271L14.521 4.25H12.708C12.472 4.25 12.2673 4.16333 12.094 3.99C11.92 3.816 11.833 3.611 11.833 3.375C11.833 3.139 11.92 2.934 12.094 2.76C12.2673 2.58667 12.472 2.5 12.708 2.5H16.625C16.861 2.5 17.066 2.58667 17.24 2.76C17.4133 2.934 17.5 3.139 17.5 3.375V7.292C17.5 7.528 17.4133 7.73267 17.24 7.906C17.066 8.08 16.861 8.167 16.625 8.167C16.389 8.167 16.184 8.08 16.01 7.906C15.8367 7.73267 15.75 7.528 15.75 7.292V5.479L8.708 12.521C8.54133 12.6877 8.34367 12.771 8.115 12.771C7.88567 12.771 7.68067 12.6807 7.5 12.5Z",fill:"currentColor"})});var It;Tt.displayName="ExternalIcon",Vt=jt.ExternalIcon=Tt,function(e){e.D1=l.h1`
26
- ${e=>d`
27
- ${Wt("D1",e.weight,e.paragraph)}
28
- color: ${Bt.Neutral[1]};
29
- ${Lt(e.inline,e.paragraph)}
30
- `}
31
- `,e.D2=l.h1`
32
- ${e=>d`
33
- ${Wt("D2",e.weight,e.paragraph)}
34
- color: ${Bt.Neutral[1]};
35
- ${Lt(e.inline,e.paragraph)}
36
- `}
37
- `,e.D3=l.h1`
38
- ${e=>d`
39
- ${Wt("D3",e.weight,e.paragraph)}
40
- color: ${Bt.Neutral[1]};
41
- ${Lt(e.inline,e.paragraph)}
42
- `}
43
- `,e.D4=l.h1`
44
- ${e=>d`
45
- ${Wt("D4",e.weight,e.paragraph)}
46
- color: ${Bt.Neutral[1]};
47
- ${Lt(e.inline,e.paragraph)}
48
- `}
49
- `,e.DBody=l.h1`
50
- ${e=>d`
51
- ${Wt("DBody",e.weight,e.paragraph)}
52
- color: ${Bt.Neutral[1]};
53
- ${Lt(e.inline,e.paragraph)}
54
- `}
55
- `,e.H1=l.h1`
56
- ${e=>d`
57
- ${Wt("H1",e.weight,e.paragraph)}
58
- color: ${Bt.Neutral[1]};
59
- ${Lt(e.inline,e.paragraph)}
60
- `}
61
- `,e.H2=l.h2`
62
- ${e=>d`
63
- ${Wt("H2",e.weight,e.paragraph)}
64
- color: ${Bt.Neutral[1]};
65
- ${Lt(e.inline,e.paragraph)}
66
- `}
67
- `,e.H3=l.h3`
68
- ${e=>d`
69
- ${Wt("H3",e.weight,e.paragraph)}
70
- color: ${Bt.Neutral[1]};
71
- ${Lt(e.inline,e.paragraph)}
72
- `}
73
- `,e.H4=l.h4`
74
- ${e=>d`
75
- ${Wt("H4",e.weight,e.paragraph)}
76
- color: ${Bt.Neutral[1]};
77
- ${Lt(e.inline,e.paragraph)}
78
- `}
79
- `,e.H5=l.h5`
80
- ${e=>d`
81
- ${Wt("H5",e.weight,e.paragraph)}
82
- color: ${Bt.Neutral[1]};
83
- ${Lt(e.inline,e.paragraph)}
84
- `}
85
- `,e.H6=l.h6`
86
- ${e=>d`
87
- ${Wt("H6",e.weight,e.paragraph)}
88
- color: ${Bt.Neutral[1]};
89
- ${Lt(e.inline,e.paragraph)}
90
- `}
91
- `,e.Body=l.p`
92
- ${e=>d`
93
- ${Wt("Body",e.weight,e.paragraph)}
94
- color: ${Bt.Neutral[1]};
95
- ${Lt(e.inline,e.paragraph)}
96
- `}
97
- `,e.BodySmall=l.p`
98
- ${e=>d`
99
- ${Wt("BodySmall",e.weight,e.paragraph)}
100
- color: ${Bt.Neutral[1]};
101
- ${Lt(e.inline,e.paragraph)}
102
- `}
103
- `,e.XSmall=l.span`
104
- ${e=>d`
105
- ${Wt("XSmall",e.weight,e.paragraph)}
106
- color: ${Bt.Neutral[1]};
107
- ${Lt(e.inline,e.paragraph)}
108
- `}
109
- `,e.Hyperlink={Default:e=>Mt({...e,textStyle:"Body"}),Small:e=>Mt({...e,textStyle:"BodySmall"})}}(It||(It={}));const Pt=l.a`
110
- ${e=>d`
111
- ${Wt(e.textStyle,e.weight)}
112
- color: ${Bt.Primary};
113
- text-decoration: none;
114
-
115
- :hover,
116
- :active,
117
- :focus {
118
- color: ${Bt.Secondary};
119
-
120
- svg {
121
- color: ${Bt.Secondary};
122
- }
123
- }
124
- `}
125
- `,Gt=l(Vt)`
126
- height: 1rem;
127
- width: 1rem;
128
- margin-left: 0.4rem;
129
- vertical-align: middle;
130
- `,Mt=({external:e=!1,children:r,...o})=>t(Pt,{...o,children:[r,e&&n(Gt,{})]}),Xt=l.div`
1
+ import e,{jsxs as t,jsx as n,Fragment as r}from"react/jsx-runtime";import o,{useRef as i,useImperativeHandle as a,useState as l,useEffect as c}from"react";import d,{css as u}from"styled-components";var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},g=Array.isArray,s="object"==typeof h&&h&&h.Object===Object&&h,p="object"==typeof self&&self&&self.Object===Object&&self,f=s||p||Function("return this")(),y=f.Symbol,m=y,v=Object.prototype,S=v.hasOwnProperty,F=v.toString,b=m?m.toStringTag:void 0;var $=function(e){var t=S.call(e,b),n=e[b];try{e[b]=void 0;var r=!0}catch(e){}var o=F.call(e);return r&&(t?e[b]=n:delete e[b]),o},B=Object.prototype.toString;var w=$,H=function(e){return B.call(e)},x=y?y.toStringTag:void 0;var D=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":x&&x in Object(e)?w(e):H(e)};var C=D,_=function(e){return null!=e&&"object"==typeof e};var k=function(e){return"symbol"==typeof e||_(e)&&"[object Symbol]"==C(e)},z=g,E=k,O=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var N=function(e,t){if(z(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!E(e))||(A.test(e)||!O.test(e)||null!=t&&e in Object(t))};var W=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},j=D,L=W;var V,R=function(e){if(!L(e))return!1;var t=j(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},T=f["__core-js_shared__"],I=(V=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"";var P=function(e){return!!I&&I in e},G=Function.prototype.toString;var M=R,X=P,Z=W,U=function(e){if(null!=e){try{return G.call(e)}catch(e){}try{return e+""}catch(e){}}return""},K=/^\[object .+?Constructor\]$/,q=Function.prototype,J=Object.prototype,Q=q.toString,Y=J.hasOwnProperty,ee=RegExp("^"+Q.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var te=function(e){return!(!Z(e)||X(e))&&(M(e)?ee:K).test(U(e))},ne=function(e,t){return null==e?void 0:e[t]};var re=function(e,t){var n=ne(e,t);return te(n)?n:void 0},oe=re(Object,"create"),ie=oe;var ae=function(){this.__data__=ie?ie(null):{},this.size=0};var le=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ce=oe,de=Object.prototype.hasOwnProperty;var ue=function(e){var t=this.__data__;if(ce){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return de.call(t,e)?t[e]:void 0},he=oe,ge=Object.prototype.hasOwnProperty;var se=oe;var pe=ae,fe=le,ye=ue,me=function(e){var t=this.__data__;return he?void 0!==t[e]:ge.call(t,e)},ve=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=se&&void 0===t?"__lodash_hash_undefined__":t,this};function Se(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])}}Se.prototype.clear=pe,Se.prototype.delete=fe,Se.prototype.get=ye,Se.prototype.has=me,Se.prototype.set=ve;var Fe=Se;var be=function(){this.__data__=[],this.size=0};var $e=function(e,t){return e===t||e!=e&&t!=t};var Be=function(e,t){for(var n=e.length;n--;)if($e(e[n][0],t))return n;return-1},we=Be,He=Array.prototype.splice;var xe=Be;var De=Be;var Ce=Be;var _e=be,ke=function(e){var t=this.__data__,n=we(t,e);return!(n<0)&&(n==t.length-1?t.pop():He.call(t,n,1),--this.size,!0)},ze=function(e){var t=this.__data__,n=xe(t,e);return n<0?void 0:t[n][1]},Ee=function(e){return De(this.__data__,e)>-1},Oe=function(e,t){var n=this.__data__,r=Ce(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Ae(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])}}Ae.prototype.clear=_e,Ae.prototype.delete=ke,Ae.prototype.get=ze,Ae.prototype.has=Ee,Ae.prototype.set=Oe;var Ne=Ae,We=re(f,"Map"),je=Fe,Le=Ne,Ve=We;var Re=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Te=function(e,t){var n=e.__data__;return Re(t)?n["string"==typeof t?"string":"hash"]:n.map},Ie=Te;var Pe=Te;var Ge=Te;var Me=Te;var Xe=function(){this.size=0,this.__data__={hash:new je,map:new(Ve||Le),string:new je}},Ze=function(e){var t=Ie(this,e).delete(e);return this.size-=t?1:0,t},Ue=function(e){return Pe(this,e).get(e)},Ke=function(e){return Ge(this,e).has(e)},qe=function(e,t){var n=Me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Je(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])}}Je.prototype.clear=Xe,Je.prototype.delete=Ze,Je.prototype.get=Ue,Je.prototype.has=Ke,Je.prototype.set=qe;var Qe=Je;function Ye(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ye.Cache||Qe),n}Ye.Cache=Qe;var et=Ye;var tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/\\(\\)?/g,rt=function(e){var t=et(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(tt,(function(e,n,r,o){t.push(r?o.replace(nt,"$1"):n||e)})),t}));var ot=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},it=g,at=k,lt=y?y.prototype:void 0,ct=lt?lt.toString:void 0;var dt=function e(t){if("string"==typeof t)return t;if(it(t))return ot(t,e)+"";if(at(t))return ct?ct.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n},ut=dt;var ht=g,gt=N,st=rt,pt=function(e){return null==e?"":ut(e)};var ft=k;var yt=function(e,t){return ht(e)?e:gt(e,t)?[e]:st(pt(e))},mt=function(e){if("string"==typeof e||ft(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var vt=function(e,t){for(var n=0,r=(t=yt(t,e)).length;null!=e&&n<r;)e=e[mt(t[n++])];return n&&n==r?e:void 0};var St=function(e,t,n){var r=null==e?void 0:vt(e,t);return void 0===r?n:r};const Ft=(e,t,n)=>t?St(n,t)||St(e,t):n||e,bt=(e,t)=>{const n=t||e.defaultValue;return St(e.collections,n)};var $t;!function(e){e.colorScheme="colorScheme",e.layout="layout",e.textStyleScheme="textStyleScheme",e.designTokenScheme="designTokenScheme"}($t||($t={}));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:"#465A88",2:"#556D99",3:"#8D8DBF"},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"}},Shadow:{Accent:"rgba(87, 169, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)"}},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:"#9F82D9",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"}},Shadow:{Accent:"rgba(161, 87, 255, 0.5)",Red:"rgba(221, 102, 102, 0.8)"}}},defaultValue:"base"},wt=e=>t=>{const n=t.theme,r=bt(Bt,n[$t.colorScheme]);return n.options&&n.options.color?Ft(r,e,n.options.color):Ft(r,e)},Ht={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")}},Shadow:{Accent:wt("Shadow.Accent"),Red:wt("Shadow.Red")}},xt={collections:{base:{InputBoxShadow:u`
2
+ inset 0 0 6px 1px ${Ht.Shadow.Accent}
3
+ `,InputErrorBoxShadow:u`
4
+ inset 0 0 6px 1px ${Ht.Shadow.Red}
5
+ `}},defaultValue:"base"},Dt=e=>t=>{const n=t.theme,r=bt(xt,n[$t.designTokenScheme]);return n.options?.designToken?Ft(r,e,n.options.designToken):Ft(r,e)},Ct=Dt("InputBoxShadow"),_t=Dt("InputErrorBoxShadow"),kt=d.div`
131
6
  display: flex;
132
- position: relative;
133
7
  align-items: center;
134
- border: 1px solid ${Bt.Neutral[5]};
8
+ position: relative;
9
+ border: 1px solid ${Ht.Neutral[5]};
135
10
  border-radius: 4px;
136
- background: ${Bt.Neutral[8]};
137
- height: 3rem;
11
+ background: ${Ht.Neutral[8]};
12
+ height: max-content;
138
13
  width: 100%;
139
- padding: 0;
14
+ padding: 0 1rem;
15
+ flex-direction: ${e=>"right"===e.$position?"row-reverse":"row"};
140
16
 
141
- :focus,
142
17
  :focus-within {
143
- border: 1px solid ${Bt.Accent.Light[1]};
144
- box-shadow: ${Dt};
18
+ border: 1px solid ${Ht.Accent.Light[1]};
19
+ box-shadow: ${Ct};
145
20
  }
146
21
 
147
- ${e=>e.$readOnly?d`
22
+ ${e=>e.$readOnly?u`
148
23
  border: none;
149
- padding-left: 0rem;
24
+ padding: 0;
150
25
  background: transparent !important;
151
26
 
152
27
  :focus-within {
153
28
  border: none;
154
29
  box-shadow: none;
155
30
  }
156
- `:e.disabled?d`
157
- background: ${Bt.Neutral[6](e)};
158
- :hover {
159
- cursor: not-allowed;
160
- }
31
+ `:e.disabled?u`
32
+ background: ${Ht.Neutral[6](e)};
33
+ cursor: not-allowed;
161
34
 
162
35
  :focus-within {
163
- border: 1px solid ${Bt.Neutral[5](e)};
36
+ border: 1px solid ${Ht.Neutral[5](e)};
164
37
  box-shadow: none;
165
38
  }
166
- `:e.$error?d`
167
- border: 1px solid ${Bt.Validation.Red.Border(e)};
39
+ `:e.$error?u`
40
+ border: 1px solid ${Ht.Validation.Red.Border(e)};
168
41
 
169
42
  :focus-within {
170
- border: 1px solid ${Bt.Validation.Red.Border(e)};
171
- box-shadow: ${Ct};
43
+ border: 1px solid ${Ht.Validation.Red.Border(e)};
44
+ box-shadow: ${_t};
172
45
  }
173
46
  `:void 0}
174
- `,Zt=l.div`
175
- position: absolute;
176
- top: 0;
177
- left: ${e=>e.$readOnly?"1rem":"2rem"};
178
- height: 100%;
179
- display: flex;
180
- align-items: center;
181
- `,Ut=l.input`
182
- ${Wt("Body","regular")}
47
+ `;var zt;!function(e){e.transformWithSpaces=(e,t)=>{const n="(.{"+t+"})";return e.replace(/[^\dA-Z]/gi,"").replace(new RegExp(n,"g"),"$1 ").trim()},e.padValue=(e,t)=>{if("0"===e)return t?e:e.padStart(2,"0");if(""===e)return e;return parseInt(e).toString().padStart(2,"0")},e.shouldTruncateToTwoLines=(e,t)=>{const n=Math.floor(t/9);return e.length>=2*n||1===e.split(" ").length&&e.length>n},e.truncateOneLine=(e,t,n,r)=>{let o=0;t>n&&(o=Math.floor((t-n)/8));const i=r+o;if(i<e.length){const t=Math.floor(i/2);return e.substring(0,t)+" ... "+e.substring(e.length-t,e.length)}return e}}(zt||(zt={}));var Et,Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});var At=e;const Nt=e=>At.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:At.jsx("path",{d:"M9.99991 11.229L5.97891 15.25C5.81224 15.4167 5.61091 15.4967 5.37491 15.49C5.13891 15.4827 4.93757 15.3957 4.77091 15.229C4.60424 15.0623 4.52091 14.8577 4.52091 14.615C4.52091 14.3717 4.60424 14.1667 4.77091 14L8.77091 10L4.74991 5.979C4.58324 5.81233 4.50324 5.60767 4.50991 5.365C4.51724 5.12167 4.60424 4.91667 4.77091 4.75C4.93757 4.58333 5.14224 4.5 5.38491 4.5C5.62824 4.5 5.83324 4.58333 5.99991 4.75L9.99991 8.771L14.0209 4.75C14.1876 4.58333 14.3922 4.5 14.6349 4.5C14.8782 4.5 15.0832 4.58333 15.2499 4.75C15.4166 4.91667 15.4999 5.12167 15.4999 5.365C15.4999 5.60767 15.4166 5.81233 15.2499 5.979L11.2289 10L15.2499 14.021C15.4166 14.1877 15.4999 14.389 15.4999 14.625C15.4999 14.861 15.4166 15.0623 15.2499 15.229C15.0832 15.3957 14.8782 15.479 14.6349 15.479C14.3922 15.479 14.1876 15.3957 14.0209 15.229L9.99991 11.229Z",fill:"currentColor"})});Nt.displayName="CrossIcon",Et=Ot.CrossIcon=Nt;const Wt={Regular:"Open Sans",Semibold:"Open Sans Semibold",Bold:"Open Sans Bold",Light:"Open Sans Light"},jt={collections:{base:{D1:{fontFamily:Wt.Bold,fontSize:3,fontWeight:700,lineHeight:4,letterSpacing:-.056},D2:{fontFamily:Wt.Bold,fontSize:2.5,fontWeight:700,lineHeight:3.5,letterSpacing:-.032},D3:{fontFamily:Wt.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},D4:{fontFamily:Wt.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},DBody:{fontFamily:Wt.Regular,fontSize:1.375,lineHeight:1.75},H1:{fontFamily:Wt.Bold,fontSize:2,fontWeight:700,lineHeight:2.5},H2:{fontFamily:Wt.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},H3:{fontFamily:Wt.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},H4:{fontFamily:Wt.Bold,fontSize:1.125,fontWeight:700,lineHeight:1.625},H5:{fontFamily:Wt.Bold,fontSize:1,fontWeight:700,lineHeight:1.5,letterSpacing:.014},H6:{fontFamily:Wt.Bold,fontSize:.875,fontWeight:700,lineHeight:1.6,letterSpacing:.012},Body:{fontFamily:Wt.Regular,fontSize:1.125,lineHeight:1.625},BodySmall:{fontFamily:Wt.Regular,fontSize:1,lineHeight:1.5,letterSpacing:.014},XSmall:{fontFamily:Wt.Regular,fontSize:.75,lineHeight:1.2,letterSpacing:.012}}},defaultValue:"base"},Lt=e=>t=>{const n=t.theme,r=bt(jt,n[$t.textStyleScheme]);return n.options&&n.options.textStyle?Ft(r,e,n.options.textStyle):Ft(r,e)},Vt={D1:{fontFamily:Lt("D1.fontFamily"),fontSize:Lt("D1.fontSize"),fontWeight:Lt("D1.fontWeight"),lineHeight:Lt("D1.lineHeight"),letterSpacing:Lt("D1.letterSpacing")},D2:{fontFamily:Lt("D2.fontFamily"),fontSize:Lt("D2.fontSize"),fontWeight:Lt("D2.fontWeight"),lineHeight:Lt("D2.lineHeight"),letterSpacing:Lt("D2.letterSpacing")},D3:{fontFamily:Lt("D3.fontFamily"),fontSize:Lt("D3.fontSize"),fontWeight:Lt("D3.fontWeight"),lineHeight:Lt("D3.lineHeight"),letterSpacing:Lt("D3.letterSpacing")},D4:{fontFamily:Lt("D4.fontFamily"),fontSize:Lt("D4.fontSize"),fontWeight:Lt("D4.fontWeight"),lineHeight:Lt("D4.lineHeight"),letterSpacing:Lt("D4.letterSpacing")},DBody:{fontFamily:Lt("DBody.fontFamily"),fontSize:Lt("DBody.fontSize"),fontWeight:Lt("DBody.fontWeight"),lineHeight:Lt("DBody.lineHeight"),letterSpacing:Lt("DBody.letterSpacing")},H1:{fontFamily:Lt("H1.fontFamily"),fontSize:Lt("H1.fontSize"),fontWeight:Lt("H1.fontWeight"),lineHeight:Lt("H1.lineHeight"),letterSpacing:Lt("H1.letterSpacing")},H2:{fontFamily:Lt("H2.fontFamily"),fontSize:Lt("H2.fontSize"),fontWeight:Lt("H2.fontWeight"),lineHeight:Lt("H2.lineHeight"),letterSpacing:Lt("H2.letterSpacing")},H3:{fontFamily:Lt("H3.fontFamily"),fontSize:Lt("H3.fontSize"),fontWeight:Lt("H3.fontWeight"),lineHeight:Lt("H3.lineHeight"),letterSpacing:Lt("H3.letterSpacing")},H4:{fontFamily:Lt("H4.fontFamily"),fontSize:Lt("H4.fontSize"),fontWeight:Lt("H4.fontWeight"),lineHeight:Lt("H4.lineHeight"),letterSpacing:Lt("H4.letterSpacing")},H5:{fontFamily:Lt("H5.fontFamily"),fontSize:Lt("H5.fontSize"),fontWeight:Lt("H5.fontWeight"),lineHeight:Lt("H5.lineHeight"),letterSpacing:Lt("H5.letterSpacing")},H6:{fontFamily:Lt("H6.fontFamily"),fontSize:Lt("H6.fontSize"),fontWeight:Lt("H6.fontWeight"),lineHeight:Lt("H6.lineHeight"),letterSpacing:Lt("H6.letterSpacing")},Body:{fontFamily:Lt("Body.fontFamily"),fontSize:Lt("Body.fontSize"),fontWeight:Lt("Body.fontWeight"),lineHeight:Lt("Body.lineHeight"),letterSpacing:Lt("Body.letterSpacing")},BodySmall:{fontFamily:Lt("BodySmall.fontFamily"),fontSize:Lt("BodySmall.fontSize"),fontWeight:Lt("BodySmall.fontWeight"),lineHeight:Lt("BodySmall.lineHeight"),letterSpacing:Lt("BodySmall.letterSpacing")},XSmall:{fontFamily:Lt("XSmall.fontFamily"),fontSize:Lt("XSmall.fontSize"),fontWeight:Lt("XSmall.fontWeight"),lineHeight:Lt("XSmall.lineHeight"),letterSpacing:Lt("XSmall.letterSpacing")}},Rt=e=>{switch(e){case 700:case"bold":return Wt.Bold;case 600:case"semibold":return Wt.Semibold;case 300:case"light":return Wt.Light;case 400:case"regular":return Wt.Regular;default:return""}},Tt=(e,t)=>n=>{const r=Vt[e].fontFamily(n),o=Vt[e].fontWeight(n);return Object.values(Wt).includes(r)?u`
48
+ font-family: ${Rt(t)||Rt(o)||r};
49
+ font-weight: normal !important;
50
+ `:u`
51
+ font-family: ${r};
52
+ font-weight: ${(It(t)||o)??"normal"};
53
+ `},It=e=>{switch(e){case 300:case"light":return 300;case 400:case"regular":return 400;case 600:case"semibold":return 600;case 700:case"bold":return 700;case 900:case"black":return 900;default:return""}},Pt=(e,t,n=!1)=>r=>{const o=Vt[e],i=o.fontSize(r);return u`
54
+ ${Tt(e,t)}
55
+ font-size: ${i}rem !important;
56
+ line-height: ${o.lineHeight}rem !important;
57
+ letter-spacing: ${o.letterSpacing(r)||0}rem !important;
58
+ ${u`
59
+ margin-bottom: ${i*(n?1.05:0)}rem;
60
+ `}
61
+ `},Gt=(e=!1,t=!1)=>t?u`
62
+ display: block;
63
+ `:e?u`
64
+ display: inline;
65
+ `:u`
66
+ display: block;
67
+ `,Mt=d.input`
68
+ ${Pt("Body","regular")}
69
+ color: ${Ht.Neutral[1]};
70
+
71
+ // overwrite default styles
183
72
  background: transparent;
184
- height: 100%;
185
- width: 3rem;
186
73
  border: none;
187
- text-align: center;
74
+ height: 3rem;
75
+ width: 100%;
188
76
  padding: 0;
189
77
 
190
- // Chrome, Safari, Edge, Opera
191
- ::-webkit-outer-spin-button,
192
- ::-webkit-inner-spin-button {
193
- -webkit-appearance: none;
194
- margin: 0;
195
- }
196
-
197
- // Safari (remove top shadow)
198
- --webkit-appearance: none;
199
-
200
- // Firefox
201
- --moz-appearance: textfield;
202
-
203
78
  :focus,
204
79
  :active {
205
80
  outline: none;
206
- }
207
-
208
- ${e=>{if(e.disabled)return d`
209
- cursor: not-allowed;
210
- `}}
211
- `,Kt=l(Ut)`
212
- width: 4.5rem;
213
- `,qt=l(It.Body)`
214
- margin-left: 0.1rem;
215
- ${e=>{if(e.$hide)return d`
216
- color: ${Bt.Neutral[3]};
217
- `}}
218
- `;var Jt,Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});var Yt=e;const en=e=>Yt.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Yt.jsx("path",{d:"M9.99991 11.229L5.97891 15.25C5.81224 15.4167 5.61091 15.4967 5.37491 15.49C5.13891 15.4827 4.93757 15.3957 4.77091 15.229C4.60424 15.0623 4.52091 14.8577 4.52091 14.615C4.52091 14.3717 4.60424 14.1667 4.77091 14L8.77091 10L4.74991 5.979C4.58324 5.81233 4.50324 5.60767 4.50991 5.365C4.51724 5.12167 4.60424 4.91667 4.77091 4.75C4.93757 4.58333 5.14224 4.5 5.38491 4.5C5.62824 4.5 5.83324 4.58333 5.99991 4.75L9.99991 8.771L14.0209 4.75C14.1876 4.58333 14.3922 4.5 14.6349 4.5C14.8782 4.5 15.0832 4.58333 15.2499 4.75C15.4166 4.91667 15.4999 5.12167 15.4999 5.365C15.4999 5.60767 15.4166 5.81233 15.2499 5.979L11.2289 10L15.2499 14.021C15.4166 14.1877 15.4999 14.389 15.4999 14.625C15.4999 14.861 15.4166 15.0623 15.2499 15.229C15.0832 15.3957 14.8782 15.479 14.6349 15.479C14.3922 15.479 14.1876 15.3957 14.0209 15.229L9.99991 11.229Z",fill:"currentColor"})});en.displayName="CrossIcon",Jt=Qt.CrossIcon=en;const tn=l.div`
219
- ${Wt("Body","regular")}
220
- border: 1px solid ${Bt.Neutral[5]};
221
- border-radius: 4px;
222
- display: flex;
223
- position: relative;
224
- flex-direction: row;
225
- height: 100%;
226
- width: 100%;
227
- background: ${Bt.Neutral[8]};
228
- color: ${Bt.Neutral[1]};
229
-
230
- :focus-within {
231
- outline: none;
232
- border: 1px solid ${Bt.Accent.Light[1]};
233
- box-shadow: ${Dt};
81
+ border: none;
82
+ box-shadow: none;
234
83
  }
235
84
 
236
85
  ::placeholder,
237
86
  ::-webkit-input-placeholder {
238
- color: ${Bt.Neutral[3]};
87
+ color: ${Ht.Neutral[3]};
239
88
  }
240
89
 
241
- ${e=>{if("number"===e.type)return d`
90
+ ${e=>"number"===e.type?u`
242
91
  // Chrome, Safari, Edge, Opera
243
92
  ::-webkit-outer-spin-button,
244
93
  ::-webkit-inner-spin-button {
@@ -248,156 +97,261 @@ import e,{jsxs as t,jsx as n}from"react/jsx-runtime";import r,{useState as o,use
248
97
 
249
98
  // Firefox
250
99
  -moz-appearance: textfield;
251
- `}}
252
-
253
- ${e=>e.readOnly?d`
254
- border: none;
255
- padding: 0.2rem 0 0.3rem;
256
- background: transparent !important;
257
- :focus-within {
258
- border: none;
259
- box-shadow: none;
260
- }
261
- `:e.disabled?d`
262
- background: ${Bt.Neutral[6](e)};
263
- :hover {
264
- cursor: not-allowed;
265
- }
266
-
267
- :focus-within {
268
- outline: none;
269
- border: 1px solid ${Bt.Neutral[5](e)};
270
- box-shadow: none;
271
- }
272
- `:e.error?d`
273
- border: 1px solid ${Bt.Validation.Red.Border(e)};
274
-
275
- :focus-within {
276
- border: 1px solid ${Bt.Validation.Red.Border(e)};
277
- box-shadow: ${Ct};
278
- }
100
+ `:e.disabled?u`
101
+ cursor: not-allowed;
279
102
  `:void 0}
280
- `,nn=l.input`
281
- // overwrite default styles
282
- background: transparent;
283
- border: none;
284
- height: 3rem;
285
- width: 100%;
286
-
287
- ${Wt("Body","regular")}
288
- padding: 0.2rem 1rem 0.3rem; // Somehow the input text appears lower
289
-
290
- :focus,
291
- :active {
292
- outline: none;
293
- border: none;
294
- box-shadow: none;
295
- }
296
- `,rn=l.button`
103
+ `,Xt=d.button`
297
104
  position: relative;
298
- display: flex;
299
- align-items: center;
300
- padding: 0.875rem 1rem;
105
+ height: auto;
106
+ padding: 0 1rem;
107
+
108
+ margin-right: -1rem; // offset the padding
301
109
  cursor: pointer;
302
110
 
303
- color: ${Bt.Neutral[3]};
111
+ color: ${Ht.Neutral[3]};
304
112
  background-color: transparent;
305
113
  border: none;
306
- `,on=l(Jt)`
114
+ `,Zt=d(Et)`
307
115
  height: 1.25rem;
308
116
  width: 1.25rem;
309
- `,an=r.forwardRef((({value:e,spacing:r,type:o,error:a,disabled:i,readOnly:l,onChange:d,onClear:u,allowClear:h=!1,...s},g)=>{const p=()=>"tel"===o&&r,f=e=>{const t=e.target,n=t.value,r=t.value.replace(/\s/g,"");t.value=r,d(e),t.value=n},y=e?(e=>e?p()?c.transformWithSpaces(e,r):e:"")(e):e,m=d?e=>{p()?f(e):d(e)}:void 0,v=h&&!i&&!l&&!a;return t(tn,{error:a,disabled:i,readOnly:l,className:s.className,children:[n(nn,{"data-testid":"input",ref:g,disabled:i,value:y,error:a,onChange:m,type:o,readOnly:l,...s}),v&&n(rn,{onClick:()=>{u&&u()},children:n(on,{})})]})}));var ln;!function(e){e[e.Subpage=0]="Subpage",e[e.Domain=1]="Domain"}(ln||(ln={})),l.div`
117
+ `,Ut=o.forwardRef((({value:e,spacing:r,type:o,error:l,disabled:c,readOnly:d,onChange:u,onClear:h,allowClear:g=!1,className:s,...p},f)=>{const y=i();a(f,(()=>y.current),[]);const m=()=>"tel"===o&&r,v=e=>{const t=e.target,n=t.value,r=t.value.replace(/\s/g,"");t.value=r,u(e),t.value=n},S=e?(e=>e?m()?zt.transformWithSpaces(e,r):e:"")(e):e;return t(kt,{disabled:c,$error:l,$readOnly:d,className:s,children:[n(Mt,{"data-testid":"input",ref:y,disabled:c,value:S,onChange:e=>{u&&(m()?v(e):u(e))},type:o,readOnly:d,...p}),g&&!c&&!d&&!!e&&n(Xt,{onClick:()=>{h&&h(),y&&y.current&&y.current.focus()},children:n(Zt,{})})]})}));var Kt,qt={};Object.defineProperty(qt,"__esModule",{value:!0});var Jt=e;const Qt=e=>Jt.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Jt.jsx("path",{d:"M4.25 17.5C3.764 17.5 3.35067 17.33 3.01 16.99C2.67 16.6493 2.5 16.236 2.5 15.75V4.25C2.5 3.764 2.67 3.35067 3.01 3.01C3.35067 2.67 3.764 2.5 4.25 2.5H9.208C9.444 2.5 9.649 2.58667 9.823 2.76C9.99633 2.934 10.083 3.139 10.083 3.375C10.083 3.611 9.99633 3.816 9.823 3.99C9.649 4.16333 9.444 4.25 9.208 4.25H4.25V15.75H15.75V10.792C15.75 10.556 15.8367 10.351 16.01 10.177C16.184 10.0037 16.389 9.917 16.625 9.917C16.861 9.917 17.066 10.0037 17.24 10.177C17.4133 10.351 17.5 10.556 17.5 10.792V15.75C17.5 16.236 17.33 16.6493 16.99 16.99C16.6493 17.33 16.236 17.5 15.75 17.5H4.25ZM7.5 12.5C7.33333 12.3333 7.25 12.1283 7.25 11.885C7.25 11.6423 7.33333 11.4377 7.5 11.271L14.521 4.25H12.708C12.472 4.25 12.2673 4.16333 12.094 3.99C11.92 3.816 11.833 3.611 11.833 3.375C11.833 3.139 11.92 2.934 12.094 2.76C12.2673 2.58667 12.472 2.5 12.708 2.5H16.625C16.861 2.5 17.066 2.58667 17.24 2.76C17.4133 2.934 17.5 3.139 17.5 3.375V7.292C17.5 7.528 17.4133 7.73267 17.24 7.906C17.066 8.08 16.861 8.167 16.625 8.167C16.389 8.167 16.184 8.08 16.01 7.906C15.8367 7.73267 15.75 7.528 15.75 7.292V5.479L8.708 12.521C8.54133 12.6877 8.34367 12.771 8.115 12.771C7.88567 12.771 7.68067 12.6807 7.5 12.5Z",fill:"currentColor"})});var Yt;Qt.displayName="ExternalIcon",Kt=qt.ExternalIcon=Qt,function(e){e.D1=d.h1`
118
+ ${e=>u`
119
+ ${Pt("D1",e.weight,e.paragraph)}
120
+ color: ${Ht.Neutral[1]};
121
+ ${Gt(e.inline,e.paragraph)}
122
+ `}
123
+ `,e.D2=d.h1`
124
+ ${e=>u`
125
+ ${Pt("D2",e.weight,e.paragraph)}
126
+ color: ${Ht.Neutral[1]};
127
+ ${Gt(e.inline,e.paragraph)}
128
+ `}
129
+ `,e.D3=d.h1`
130
+ ${e=>u`
131
+ ${Pt("D3",e.weight,e.paragraph)}
132
+ color: ${Ht.Neutral[1]};
133
+ ${Gt(e.inline,e.paragraph)}
134
+ `}
135
+ `,e.D4=d.h1`
136
+ ${e=>u`
137
+ ${Pt("D4",e.weight,e.paragraph)}
138
+ color: ${Ht.Neutral[1]};
139
+ ${Gt(e.inline,e.paragraph)}
140
+ `}
141
+ `,e.DBody=d.h1`
142
+ ${e=>u`
143
+ ${Pt("DBody",e.weight,e.paragraph)}
144
+ color: ${Ht.Neutral[1]};
145
+ ${Gt(e.inline,e.paragraph)}
146
+ `}
147
+ `,e.H1=d.h1`
148
+ ${e=>u`
149
+ ${Pt("H1",e.weight,e.paragraph)}
150
+ color: ${Ht.Neutral[1]};
151
+ ${Gt(e.inline,e.paragraph)}
152
+ `}
153
+ `,e.H2=d.h2`
154
+ ${e=>u`
155
+ ${Pt("H2",e.weight,e.paragraph)}
156
+ color: ${Ht.Neutral[1]};
157
+ ${Gt(e.inline,e.paragraph)}
158
+ `}
159
+ `,e.H3=d.h3`
160
+ ${e=>u`
161
+ ${Pt("H3",e.weight,e.paragraph)}
162
+ color: ${Ht.Neutral[1]};
163
+ ${Gt(e.inline,e.paragraph)}
164
+ `}
165
+ `,e.H4=d.h4`
166
+ ${e=>u`
167
+ ${Pt("H4",e.weight,e.paragraph)}
168
+ color: ${Ht.Neutral[1]};
169
+ ${Gt(e.inline,e.paragraph)}
170
+ `}
171
+ `,e.H5=d.h5`
172
+ ${e=>u`
173
+ ${Pt("H5",e.weight,e.paragraph)}
174
+ color: ${Ht.Neutral[1]};
175
+ ${Gt(e.inline,e.paragraph)}
176
+ `}
177
+ `,e.H6=d.h6`
178
+ ${e=>u`
179
+ ${Pt("H6",e.weight,e.paragraph)}
180
+ color: ${Ht.Neutral[1]};
181
+ ${Gt(e.inline,e.paragraph)}
182
+ `}
183
+ `,e.Body=d.p`
184
+ ${e=>u`
185
+ ${Pt("Body",e.weight,e.paragraph)}
186
+ color: ${Ht.Neutral[1]};
187
+ ${Gt(e.inline,e.paragraph)}
188
+ `}
189
+ `,e.BodySmall=d.p`
190
+ ${e=>u`
191
+ ${Pt("BodySmall",e.weight,e.paragraph)}
192
+ color: ${Ht.Neutral[1]};
193
+ ${Gt(e.inline,e.paragraph)}
194
+ `}
195
+ `,e.XSmall=d.span`
196
+ ${e=>u`
197
+ ${Pt("XSmall",e.weight,e.paragraph)}
198
+ color: ${Ht.Neutral[1]};
199
+ ${Gt(e.inline,e.paragraph)}
200
+ `}
201
+ `,e.Hyperlink={Default:e=>nn({...e,textStyle:"Body"}),Small:e=>nn({...e,textStyle:"BodySmall"})}}(Yt||(Yt={}));const en=d.a`
202
+ ${e=>u`
203
+ ${Pt(e.textStyle,e.weight)}
204
+ color: ${Ht.Primary};
205
+ text-decoration: none;
206
+
207
+ :hover,
208
+ :active,
209
+ :focus {
210
+ color: ${Ht.Secondary};
211
+
212
+ svg {
213
+ color: ${Ht.Secondary};
214
+ }
215
+ }
216
+ `}
217
+ `,tn=d(Kt)`
218
+ height: 1rem;
219
+ width: 1rem;
220
+ margin-left: 0.4rem;
221
+ vertical-align: middle;
222
+ `,nn=({external:e=!1,children:r,...o})=>t(en,{...o,children:[r,e&&n(tn,{})]});var rn;!function(e){e[e.Subpage=0]="Subpage",e[e.Domain=1]="Domain"}(rn||(rn={})),d.div`
310
223
  display: flex;
311
224
  position: relative;
312
- border: 1px solid ${Bt.Neutral[5]};
225
+ border: 1px solid ${Ht.Neutral[5]};
313
226
  border-radius: 4px;
314
- background: ${Bt.Neutral[8]};
315
- height: 3rem;
227
+ background: ${Ht.Neutral[8]};
228
+ height: max-content;
316
229
  width: 100%;
230
+ padding: 0 1rem;
317
231
  flex-direction: ${e=>"right"===e.$position?"row-reverse":"row"};
318
232
 
319
233
  :focus-within {
320
- border: 1px solid ${Bt.Accent.Light[1]};
321
- box-shadow: ${Dt};
234
+ border: 1px solid ${Ht.Accent.Light[1]};
235
+ box-shadow: ${Ct};
322
236
  }
323
237
 
324
- ${e=>e.$readOnly?d`
238
+ ${e=>e.$readOnly?u`
325
239
  border: none;
326
- padding-left: 0rem;
240
+ padding: 0;
327
241
  background: transparent !important;
328
242
 
329
243
  :focus-within {
330
244
  border: none;
331
245
  box-shadow: none;
332
246
  }
333
- `:e.disabled?d`
334
- background: ${Bt.Neutral[6](e)};
247
+ `:e.disabled?u`
248
+ background: ${Ht.Neutral[6](e)};
335
249
  :hover {
336
250
  cursor: not-allowed;
337
251
  }
338
252
 
339
253
  :focus-within {
340
- border: 1px solid ${Bt.Neutral[5](e)};
254
+ border: 1px solid ${Ht.Neutral[5](e)};
341
255
  box-shadow: none;
342
256
  }
343
- `:e.$error?d`
344
- border: 1px solid ${Bt.Validation.Red.Border(e)};
257
+ `:e.$error?u`
258
+ border: 1px solid ${Ht.Validation.Red.Border(e)};
345
259
 
346
260
  :focus-within {
347
- border: 1px solid ${Bt.Validation.Red.Border(e)};
348
- box-shadow: ${Ct};
261
+ border: 1px solid ${Ht.Validation.Red.Border(e)};
262
+ box-shadow: ${_t};
349
263
  }
350
264
  `:void 0}
351
- `,l(an)`
265
+ `,d(Ut)`
352
266
  // overwrite default styles
353
- background: transparent;
354
- border: none;
355
-
356
- :focus-within {
357
- outline: none;
267
+ &&& {
268
+ background: transparent;
358
269
  border: none;
359
- box-shadow: none;
360
- }
270
+ padding: 0 0 1px 0;
361
271
 
362
- ${e=>"right"===e.$position?d`
363
- :not(:only-child) {
364
- padding-right: 0;
365
- }
366
- `:d`
367
- padding: unset;
368
- :not(:only-child) {
369
- padding-left: 0;
370
- }
371
- `}
372
- `;const dn=l.div`
272
+ :focus-within {
273
+ outline: none;
274
+ border: none;
275
+ box-shadow: none;
276
+ }
277
+ }
278
+ `;const on=d.div`
373
279
  position: relative;
374
280
  display: flex;
375
281
  align-items: center;
376
- border-top-left-radius: 4px;
377
- border-bottom-left-radius: 4px;
378
- padding: 0 0.6875rem 0 1rem;
379
282
 
380
- ${Wt("Body","regular")}
381
- color: ${Bt.Neutral[1]};
283
+ ${Pt("Body","regular")}
284
+ color: ${Ht.Neutral[1]};
382
285
 
383
286
  /* SVG Icon */
384
287
  svg {
385
288
  height: 1.5rem;
386
289
  width: 1.5rem;
387
290
  #path {
388
- fill: ${Bt.Neutral[1]};
291
+ fill: ${Ht.Neutral[1]};
389
292
  }
390
293
  }
391
294
 
392
- ${e=>e.$readOnly?d`
393
- padding-left: 0rem;
394
- `:e.disabled?d`
395
- color: ${Bt.Neutral[4](e)};
295
+ ${e=>{if(e.disabled)return u`
296
+ color: ${Ht.Neutral[4](e)};
396
297
  svg {
397
298
  #path {
398
- fill: ${Bt.Neutral[4](e)};
299
+ fill: ${Ht.Neutral[4](e)};
399
300
  }
400
301
  }
401
- `:void 0}
402
- `,cn=({disabled:e,error:r,value:l,onChange:d,onBlur:u,onChangeRaw:h,onBlurRaw:s,readOnly:g,placeholder:p="00-8888",...f})=>{const[y,m]=o(""),[v,S]=o(""),[b,F]=o("none"),$=a(null),w=a(null),B=a(null),H=a(y),x=a(v),D=a(b),C=e=>{H.current=e,m(e)},_=e=>{x.current=e,S(e)},k=e=>{D.current=e,F(e)};i((()=>(document.addEventListener("mousedown",z),$.current&&$.current.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",z),$.current&&$.current.removeEventListener("keydown",E)})),[b]),i((()=>{"floor"===b&&3===y.length&&B.current&&B.current.focus()}),[y]),i((()=>{L(l)}),[l]);const z=t=>{e||g||$&&$.current.contains(t.target)||"none"!==D.current&&(k("none"),j())},E=e=>{"unit"===e.target.name&&"Tab"===e.code&&(k("none"),j())},O=e=>{k(e.target.name),e.target.select()},N=e=>{const t=e.target.name,n=e.target.value;"floor"===t?C(W(n)):_(W(n))},A=e=>{const t=e.target.name,n=e.target.value.toLocaleUpperCase().replace(/[^0-9A-Za-z]/,"");"floor"===t?(C(n),V(n,t)):(_(n),V(n,t))},W=e=>/^[0-9]$/.test(e)?c.padValue(e,!0):e.toLocaleUpperCase(),L=e=>{if(e!==un)if(void 0===e||0===e.length)C(""),_("");else{const t=e.split("-");if(2===t.length){const e=t[0],n=t[1];C("floor"===b?e:W(e)),_("unit"===b?n:W(n))}}},V=(e,t)=>{if(!d&&!h)return;const n={floor:H.current,unit:x.current};if(n[t]=e,d){const e=R(n);d(e)}h&&h([n.floor,n.unit])},j=()=>{if(!u&&!s)return;const e={floor:W(H.current),unit:W(x.current)};if(u){const t=R(e);u(t)}s&&s([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))?"":un},T=e=>e.split("-");return t(Xt,{ref:$,onClick:()=>{"none"===b&&w.current&&w.current.focus()},disabled:e,$error:r,$readOnly:g,"data-testid":f["data-testid"],children:[n(dn,{"data-testid":"addon",disabled:e,$readOnly:g,children:"#"}),t(Zt,{$readOnly:g,children:[n(Ut,{name:"floor",maxLength:3,value:y,ref:w,onFocus:O,onBlur:N,onChange:A,disabled:e,readOnly:g,type:"text",pattern:"[0-9A-Z]{2,3}","data-testid":"floor-input","aria-label":"floor-input",placeholder:"floor"!==b||g?T(p)[0]:""}),n(qt,{$hide:0===y.length,children:"-"}),n(Kt,{name:"unit",maxLength:5,value:v,ref:B,onFocus:O,onBlur:N,onChange:A,onKeyDown:e=>{"Backspace"!==e.code&&"Backspace"!==e.key||"unit"===b&&0===v.length&&w.current.focus()},disabled:e,readOnly:g,type:"text",pattern:"[0-9A-Z]{2,5}","data-testid":"unit-input","aria-label":"unit-input",placeholder:"unit"!==b||g?T(p)[1]:""})]})]})},un="Invalid unit number";export{cn as UnitNumberInput};
302
+ `}}
303
+
304
+ ${e=>"right"===e.$position?u`
305
+ margin-left: ${e.$readOnly?"0.25rem":"0.75rem"};
306
+ `:u`
307
+ margin-right: ${e.$readOnly?"0.25rem":"0.75rem"};
308
+ `};
309
+ `,an=d(on)`
310
+ margin-right: 0.25rem;
311
+ `,ln=d(Ut)`
312
+ // overwrite default styles
313
+ background: transparent;
314
+ border: none;
315
+ /* border: 1px dotted red; */
316
+ padding: 0;
317
+ width: 2.5rem;
318
+
319
+ :focus-within {
320
+ outline: none;
321
+ border: none;
322
+ box-shadow: none;
323
+ }
324
+
325
+ input {
326
+ text-align: center;
327
+ // Chrome, Safari, Edge, Opera
328
+ ::-webkit-outer-spin-button,
329
+ ::-webkit-inner-spin-button {
330
+ -webkit-appearance: none;
331
+ margin: 0;
332
+ }
333
+
334
+ // Firefox
335
+ -moz-appearance: textfield;
336
+ }
337
+ `,cn=d(ln)`
338
+ // Cheat to balance the placeholder look while ensuring enough width
339
+ margin-left: 0.5rem;
340
+ width: 6rem;
341
+
342
+ input {
343
+ text-align: left;
344
+ }
345
+ `,dn=d(Yt.Body)`
346
+ margin: 0 0.25rem;
347
+ ${e=>{if(e.$inactive)return u`
348
+ color: ${Ht.Neutral[3]};
349
+ `}}
350
+ `,un=d.div`
351
+ display: flex;
352
+ `,hn=d(Yt.Body)`
353
+ ${e=>{if(e.$inactive)return u`
354
+ color: ${Ht.Neutral[3]};
355
+ `}}
356
+ `,gn=({disabled:e,error:o,value:a,onChange:d,onBlur:u,onChangeRaw:h,onBlurRaw:g,readOnly:s,placeholder:p="00-8888",...f})=>{const[y,m]=l(""),[v,S]=l(""),[F,b]=l("none"),$=i(null),B=i(null),w=i(null),H=i(y),x=i(v),D=i(F),C=e=>{H.current=e,m(e)},_=e=>{x.current=e,S(e)},k=e=>{D.current=e,b(e)};c((()=>(document.addEventListener("mousedown",z),$.current&&$.current.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",z),$.current&&$.current.removeEventListener("keydown",E)})),[F]),c((()=>{"floor"===F&&3===y.length&&w.current&&w.current.focus()}),[y]),c((()=>{L(a)}),[a]);const z=t=>{e||s||$&&$.current.contains(t.target)||"none"!==D.current&&(k("none"),R())},E=e=>{"unit"===e.target.name&&"Tab"===e.code&&(k("none"),R())},O=e=>{k(e.target.name),e.target.select()},A=e=>{const t=e.target.name,n=e.target.value;"floor"===t?C(j(n)):_(j(n))},N=e=>{const t=e.target.name,n=e.target.value.toLocaleUpperCase().replace(/[^0-9A-Za-z]/,"");"floor"===t?(C(n),V(n,t)):(_(n),V(n,t))},W=e=>{"Backspace"!==e.code&&"Backspace"!==e.key||"unit"===F&&0===v.length&&B.current.focus()},j=e=>/^[0-9]$/.test(e)?zt.padValue(e,!0):e.toLocaleUpperCase(),L=e=>{if(e!==sn)if(void 0===e||0===e.length)C(""),_("");else{const t=e.split("-");if(2===t.length){const e=t[0],n=t[1];C("floor"===F?e:j(e)),_("unit"===F?n:j(n))}}},V=(e,t)=>{if(!d&&!h)return;const n={floor:H.current,unit:x.current};if(n[t]=e,d){const e=T(n);d(e)}h&&h([n.floor,n.unit])},R=()=>{if(!u&&!g)return;const e={floor:j(H.current),unit:j(x.current)};if(u){const t=T(e);u(t)}g&&g([e.floor,e.unit])},T=e=>{const t=[e.floor,e.unit];return e.floor.length>0&&e.unit.length>0?t.join("-"):t.every((e=>""===e))?"":sn},I=e=>e.split("-");return t(kt,{ref:$,onClick:()=>{"none"===F&&B.current&&B.current.focus()},disabled:e,$error:o,$readOnly:s,"data-testid":f["data-testid"],children:[n(an,{"data-testid":"addon",disabled:e,$readOnly:s,children:"#"}),s&&a?(()=>{const e=a.split("-");return t(un,{children:[n(hn,{children:e[0]}),n(dn,{children:"-"}),n(hn,{children:e[1]})]})})():t(r,{children:[n(ln,{name:"floor",maxLength:3,value:y,ref:B,onFocus:O,onBlur:A,onChange:N,disabled:e,readOnly:s,type:"text",pattern:"[0-9A-Z]{2,3}","data-testid":"floor-input","aria-label":"floor-input",placeholder:"floor"!==F||s?I(p)[0]:""}),n(dn,{$inactive:0===y.length,children:"-"}),n(cn,{name:"unit",maxLength:5,value:v,ref:w,onFocus:O,onBlur:A,onChange:N,onKeyDown:W,disabled:e,readOnly:s,type:"text",pattern:"[0-9A-Z]{2,5}","data-testid":"unit-input","aria-label":"unit-input",placeholder:"unit"!==F||s?I(p)[1]:""})]})]})},sn="Invalid unit number";export{gn as UnitNumberInput};
403
357
  //# sourceMappingURL=index.js.map