@lifesg/react-design-system 1.0.0-alpha.2 → 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 (277) hide show
  1. package/README.md +2 -0
  2. package/accordion/accordion-item.style.d.ts +5 -2
  3. package/accordion/accordion.style.d.ts +1 -1
  4. package/accordion/index.js +165 -172
  5. package/accordion/index.js.map +1 -1
  6. package/alert/alert.style.d.ts +4 -1
  7. package/alert/index.js +107 -119
  8. package/alert/index.js.map +1 -1
  9. package/animations/index.d.ts +1 -0
  10. package/animations/index.js +6 -3
  11. package/animations/index.js.map +1 -1
  12. package/animations/loading-dots-spinner/loading-dots-spinner.d.ts +2 -0
  13. package/animations/loading-dots-spinner/lottie-animation.d.ts +2 -0
  14. package/box-container/box-container.styles.d.ts +8 -1
  15. package/box-container/index.js +69 -74
  16. package/box-container/index.js.map +1 -1
  17. package/breadcrumb/breadcrumb.style.d.ts +4 -4
  18. package/breadcrumb/index.js +102 -106
  19. package/breadcrumb/index.js.map +1 -1
  20. package/breadcrumb/types.d.ts +5 -1
  21. package/button/button.d.ts +2 -2
  22. package/button/index.js +140 -143
  23. package/button/index.js.map +1 -1
  24. package/calendar/calendar-day.d.ts +11 -0
  25. package/calendar/calendar-day.style.d.ts +23 -0
  26. package/calendar/calendar-month.d.ts +12 -0
  27. package/calendar/calendar-month.style.d.ts +12 -0
  28. package/calendar/calendar-year.d.ts +12 -0
  29. package/calendar/calendar-year.style.d.ts +12 -0
  30. package/calendar/calendar.d.ts +4 -0
  31. package/calendar/calendar.style.d.ts +35 -0
  32. package/calendar/index.d.ts +2 -0
  33. package/calendar/index.js +381 -0
  34. package/calendar/index.js.map +1 -0
  35. package/calendar/package.json +7 -0
  36. package/calendar/types.d.ts +15 -0
  37. package/card/card.d.ts +3 -0
  38. package/card/card.style.d.ts +1 -0
  39. package/card/index.d.ts +1 -0
  40. package/card/index.js +132 -0
  41. package/card/index.js.map +1 -0
  42. package/{icon → card}/package.json +1 -1
  43. package/card/types.d.ts +4 -0
  44. package/checkbox/checkbox.d.ts +1 -1
  45. package/checkbox/checkbox.style.d.ts +4 -1
  46. package/checkbox/index.js +11 -21
  47. package/checkbox/index.js.map +1 -1
  48. package/cjs/index.js +2240 -1057
  49. package/cjs/index.js.map +1 -1
  50. package/color/color.d.ts +4 -59
  51. package/color/index.js +1 -1
  52. package/color/index.js.map +1 -1
  53. package/color/types.d.ts +5 -1
  54. package/date-input/date-input.d.ts +1 -1
  55. package/date-input/date-input.style.d.ts +2 -6
  56. package/date-input/index.js +132 -147
  57. package/date-input/index.js.map +1 -1
  58. package/date-input/types.d.ts +14 -16
  59. package/design-token/design-token.d.ts +4 -0
  60. package/design-token/index.d.ts +2 -0
  61. package/design-token/index.js +6 -0
  62. package/design-token/index.js.map +1 -0
  63. package/design-token/package.json +7 -0
  64. package/design-token/types.d.ts +7 -0
  65. package/error-display/error-display-data.d.ts +11 -0
  66. package/error-display/error-display.d.ts +3 -0
  67. package/error-display/error-display.style.d.ts +7 -0
  68. package/error-display/index.d.ts +2 -0
  69. package/error-display/index.js +323 -0
  70. package/error-display/index.js.map +1 -0
  71. package/error-display/package.json +7 -0
  72. package/error-display/types.d.ts +20 -0
  73. package/feedback-rating/feedback-rating-data.d.ts +5 -0
  74. package/feedback-rating/feedback-rating-stars-container-data.d.ts +3 -0
  75. package/feedback-rating/feedback-rating-stars-container.d.ts +3 -0
  76. package/feedback-rating/feedback-rating-stars-container.styles.d.ts +12 -0
  77. package/feedback-rating/feedback-rating.d.ts +3 -0
  78. package/feedback-rating/feedback-rating.styles.d.ts +5 -0
  79. package/feedback-rating/index.d.ts +2 -0
  80. package/feedback-rating/index.js +329 -0
  81. package/feedback-rating/index.js.map +1 -0
  82. package/feedback-rating/package.json +7 -0
  83. package/feedback-rating/types.d.ts +14 -0
  84. package/footer/footer-download-app.d.ts +2 -0
  85. package/footer/footer-download-app.style.d.ts +6 -0
  86. package/footer/footer-helper.d.ts +12 -0
  87. package/footer/footer.d.ts +3 -0
  88. package/footer/footer.style.d.ts +12 -0
  89. package/footer/index.d.ts +2 -0
  90. package/footer/index.js +373 -0
  91. package/footer/index.js.map +1 -0
  92. package/footer/package.json +7 -0
  93. package/footer/types.d.ts +31 -0
  94. package/form/form-custom-field.d.ts +3 -0
  95. package/form/form-input-group.d.ts +1 -1
  96. package/form/form-input.d.ts +1 -1
  97. package/form/form-label-addon.d.ts +1 -2
  98. package/form/form-label.d.ts +1 -1
  99. package/form/form-label.style.d.ts +1 -0
  100. package/form/form-phone-number-input.d.ts +3 -0
  101. package/form/form-textarea.d.ts +1 -1
  102. package/form/form-unit-number-input.d.ts +3 -0
  103. package/form/index.d.ts +9 -6
  104. package/form/index.js +771 -657
  105. package/form/index.js.map +1 -1
  106. package/form/types.d.ts +14 -5
  107. package/icon-button/icon-button.d.ts +1 -1
  108. package/icon-button/icon-button.style.d.ts +6 -1
  109. package/icon-button/index.js +9 -15
  110. package/icon-button/index.js.map +1 -1
  111. package/icon-button/types.d.ts +2 -3
  112. package/index.d.ts +12 -1
  113. package/index.js +2217 -1034
  114. package/index.js.map +1 -1
  115. package/input/index.js +93 -49
  116. package/input/index.js.map +1 -1
  117. package/input/input.d.ts +1 -1
  118. package/input/input.style.d.ts +9 -4
  119. package/input/types.d.ts +2 -0
  120. package/input-group/index.js +435 -343
  121. package/input-group/index.js.map +1 -1
  122. package/input-group/input-group-list-addon.d.ts +1 -1
  123. package/input-group/input-group-list-addon.style.d.ts +13 -2
  124. package/input-group/input-group.d.ts +1 -1
  125. package/input-group/input-group.style.d.ts +4 -8
  126. package/input-group/types.d.ts +11 -10
  127. package/input-select/index.js +286 -244
  128. package/input-select/index.js.map +1 -1
  129. package/input-select/input-select-wrapper.d.ts +1 -1
  130. package/input-select/input-select.d.ts +1 -1
  131. package/input-select/input-select.styles.d.ts +5 -1
  132. package/input-select/types.d.ts +15 -11
  133. package/input-textarea/index.js +132 -121
  134. package/input-textarea/index.js.map +1 -1
  135. package/input-textarea/textarea-counter.d.ts +2 -1
  136. package/input-textarea/textarea.d.ts +2 -2
  137. package/input-textarea/types.d.ts +1 -0
  138. package/layout/container.d.ts +3 -0
  139. package/layout/content.d.ts +3 -0
  140. package/layout/index.d.ts +7 -0
  141. package/layout/index.js +55 -0
  142. package/layout/index.js.map +1 -0
  143. package/layout/package.json +7 -0
  144. package/layout/section.d.ts +3 -0
  145. package/layout/types.d.ts +15 -0
  146. package/link-list/index.js +130 -130
  147. package/link-list/index.js.map +1 -1
  148. package/link-list/link-list.styles.d.ts +12 -2
  149. package/link-list/types.d.ts +1 -1
  150. package/masonry/index.js.map +1 -1
  151. package/masonry/masonry.d.ts +2 -2
  152. package/masthead/index.d.ts +1 -0
  153. package/masthead/index.js +9 -0
  154. package/masthead/index.js.map +1 -0
  155. package/masthead/masthead.d.ts +2 -0
  156. package/masthead/masthead.style.d.ts +1 -0
  157. package/masthead/package.json +7 -0
  158. package/media/index.js +1 -1
  159. package/media/index.js.map +1 -1
  160. package/media/media.d.ts +2 -1
  161. package/modal/index.d.ts +1 -1
  162. package/modal/index.js +30 -43
  163. package/modal/index.js.map +1 -1
  164. package/modal/modal-box.styles.d.ts +5 -2
  165. package/modal/modal.d.ts +1 -1
  166. package/modal/modal.styles.d.ts +1 -0
  167. package/modal/types.d.ts +4 -2
  168. package/navbar/brand.d.ts +10 -0
  169. package/navbar/brand.styles.d.ts +5 -0
  170. package/navbar/drawer.d.ts +3 -0
  171. package/navbar/drawer.styles.d.ts +15 -0
  172. package/navbar/index.d.ts +7 -0
  173. package/navbar/index.js +651 -0
  174. package/navbar/index.js.map +1 -0
  175. package/navbar/navbar-action-buttons.d.ts +10 -0
  176. package/navbar/navbar-action-buttons.styles.d.ts +9 -0
  177. package/navbar/navbar-items.d.ts +11 -0
  178. package/navbar/navbar-items.styles.d.ts +10 -0
  179. package/navbar/navbar.d.ts +3 -0
  180. package/navbar/navbar.styles.d.ts +19 -0
  181. package/navbar/package.json +7 -0
  182. package/navbar/types.d.ts +56 -0
  183. package/notification-banner/index.d.ts +3 -0
  184. package/notification-banner/index.js +266 -0
  185. package/notification-banner/index.js.map +1 -0
  186. package/notification-banner/notification-banner-hoc.d.ts +3 -0
  187. package/notification-banner/notification-banner.d.ts +6 -0
  188. package/notification-banner/notification-banner.styles.d.ts +15 -0
  189. package/notification-banner/package.json +7 -0
  190. package/notification-banner/types.d.ts +22 -0
  191. package/otp-input/index.d.ts +2 -0
  192. package/otp-input/index.js +600 -0
  193. package/otp-input/index.js.map +1 -0
  194. package/otp-input/otp-input.d.ts +3 -0
  195. package/otp-input/otp-input.styles.d.ts +5 -0
  196. package/otp-input/package.json +7 -0
  197. package/otp-input/types.d.ts +22 -0
  198. package/overlay/index.js +1 -1
  199. package/overlay/index.js.map +1 -1
  200. package/overlay/types.d.ts +1 -1
  201. package/package.json +4 -1
  202. package/phone-number-input/data/country-code.d.ts +1 -0
  203. package/phone-number-input/index.d.ts +2 -0
  204. package/phone-number-input/index.js +860 -0
  205. package/phone-number-input/index.js.map +1 -0
  206. package/phone-number-input/package.json +7 -0
  207. package/phone-number-input/phone-number-input-helper.d.ts +5 -0
  208. package/phone-number-input/phone-number-input.d.ts +3 -0
  209. package/phone-number-input/types.d.ts +51 -0
  210. package/popover/index.js +148 -153
  211. package/popover/index.js.map +1 -1
  212. package/popover/popover.styles.d.ts +1 -1
  213. package/popover/types.d.ts +3 -3
  214. package/progress-indicator/index.d.ts +2 -0
  215. package/progress-indicator/index.js +240 -0
  216. package/progress-indicator/index.js.map +1 -0
  217. package/progress-indicator/package.json +7 -0
  218. package/progress-indicator/progress-indicator.d.ts +3 -0
  219. package/progress-indicator/progress-indicator.style.d.ts +19 -0
  220. package/progress-indicator/types.d.ts +9 -0
  221. package/radio-button/index.js +7 -7
  222. package/radio-button/index.js.map +1 -1
  223. package/shared/dropdown-list/dropdown-list.d.ts +1 -1
  224. package/shared/dropdown-list/dropdown-list.styles.d.ts +6 -2
  225. package/shared/dropdown-list/dropdown-search.d.ts +2 -1
  226. package/shared/dropdown-list/dropdown-search.styles.d.ts +9 -1
  227. package/shared/dropdown-list/types.d.ts +22 -12
  228. package/shared/input-wrapper/input-wrapper.d.ts +8 -0
  229. package/smart-app-banner/index.d.ts +2 -0
  230. package/smart-app-banner/index.js +373 -0
  231. package/smart-app-banner/index.js.map +1 -0
  232. package/smart-app-banner/package.json +7 -0
  233. package/smart-app-banner/smart-app-banner.d.ts +3 -0
  234. package/smart-app-banner/smart-app-banner.styles.d.ts +31 -0
  235. package/smart-app-banner/types.d.ts +18 -0
  236. package/spec/design-token-spec/base-design-token-set.d.ts +2 -0
  237. package/text/index.js +62 -65
  238. package/text/index.js.map +1 -1
  239. package/text/text-style.d.ts +4 -100
  240. package/text-list/index.js +7 -7
  241. package/text-list/index.js.map +1 -1
  242. package/theme/design-token-helper.d.ts +2 -0
  243. package/theme/index.js +1 -1
  244. package/theme/index.js.map +1 -1
  245. package/theme/types.d.ts +12 -3
  246. package/timeline/index.js +95 -98
  247. package/timeline/index.js.map +1 -1
  248. package/timepicker/index.js +213 -207
  249. package/timepicker/index.js.map +1 -1
  250. package/timepicker/timepicker-dropdown.styles.d.ts +2 -2
  251. package/timepicker/types.d.ts +3 -3
  252. package/toggle-button/index.js +118 -121
  253. package/toggle-button/index.js.map +1 -1
  254. package/tooltip/index.js +127 -125
  255. package/tooltip/index.js.map +1 -1
  256. package/tooltip/tooltip.styles.d.ts +3 -1
  257. package/unit-number/index.d.ts +2 -0
  258. package/unit-number/index.js +357 -0
  259. package/unit-number/index.js.map +1 -0
  260. package/unit-number/package.json +7 -0
  261. package/unit-number/types.d.ts +27 -0
  262. package/unit-number/unit-number-input.d.ts +3 -0
  263. package/unit-number/unit-number-input.style.d.ts +11 -0
  264. package/util/calendar-helper.d.ts +10 -0
  265. package/util/date-helper.d.ts +19 -0
  266. package/util/index.d.ts +3 -0
  267. package/util/utility-types.d.ts +3 -0
  268. package/icon/arrow-right-icon.d.ts +0 -3
  269. package/icon/icon.d.ts +0 -3
  270. package/icon/index.d.ts +0 -2
  271. package/icon/index.js +0 -12
  272. package/icon/index.js.map +0 -1
  273. package/icon/info-icon.d.ts +0 -3
  274. package/icon/play-alt-icon.d.ts +0 -3
  275. package/icon/search-icon.d.ts +0 -3
  276. package/icon/shared.style.d.ts +0 -1
  277. package/icon/types.d.ts +0 -9
@@ -1,9 +1,11 @@
1
+ /// <reference types="react" />
1
2
  import { TooltipPosition } from "./types";
2
3
  interface TooltipStyleProps {
3
4
  position?: TooltipPosition;
4
5
  visible?: boolean;
5
6
  }
6
- export declare const Bubble: import("styled-components").StyledComponent<"div", any, TooltipStyleProps, never>;
7
+ export declare const BubbleWrap: import("styled-components").StyledComponent<"div", any, TooltipStyleProps, never>;
8
+ export declare const Bubble: import("styled-components").StyledComponent<({ children, ...otherProps }: import("../card/types").CardProps) => JSX.Element, any, {}, never>;
7
9
  export declare const Arrow: import("styled-components").StyledComponent<"div", any, TooltipStyleProps, never>;
8
10
  export declare const HOCWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
9
11
  export {};
@@ -0,0 +1,2 @@
1
+ export * from "./unit-number-input";
2
+ export * from "./types";
@@ -0,0 +1,357 @@
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`
6
+ display: flex;
7
+ align-items: center;
8
+ position: relative;
9
+ border: 1px solid ${Ht.Neutral[5]};
10
+ border-radius: 4px;
11
+ background: ${Ht.Neutral[8]};
12
+ height: max-content;
13
+ width: 100%;
14
+ padding: 0 1rem;
15
+ flex-direction: ${e=>"right"===e.$position?"row-reverse":"row"};
16
+
17
+ :focus-within {
18
+ border: 1px solid ${Ht.Accent.Light[1]};
19
+ box-shadow: ${Ct};
20
+ }
21
+
22
+ ${e=>e.$readOnly?u`
23
+ border: none;
24
+ padding: 0;
25
+ background: transparent !important;
26
+
27
+ :focus-within {
28
+ border: none;
29
+ box-shadow: none;
30
+ }
31
+ `:e.disabled?u`
32
+ background: ${Ht.Neutral[6](e)};
33
+ cursor: not-allowed;
34
+
35
+ :focus-within {
36
+ border: 1px solid ${Ht.Neutral[5](e)};
37
+ box-shadow: none;
38
+ }
39
+ `:e.$error?u`
40
+ border: 1px solid ${Ht.Validation.Red.Border(e)};
41
+
42
+ :focus-within {
43
+ border: 1px solid ${Ht.Validation.Red.Border(e)};
44
+ box-shadow: ${_t};
45
+ }
46
+ `:void 0}
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
72
+ background: transparent;
73
+ border: none;
74
+ height: 3rem;
75
+ width: 100%;
76
+ padding: 0;
77
+
78
+ :focus,
79
+ :active {
80
+ outline: none;
81
+ border: none;
82
+ box-shadow: none;
83
+ }
84
+
85
+ ::placeholder,
86
+ ::-webkit-input-placeholder {
87
+ color: ${Ht.Neutral[3]};
88
+ }
89
+
90
+ ${e=>"number"===e.type?u`
91
+ // Chrome, Safari, Edge, Opera
92
+ ::-webkit-outer-spin-button,
93
+ ::-webkit-inner-spin-button {
94
+ -webkit-appearance: none;
95
+ margin: 0;
96
+ }
97
+
98
+ // Firefox
99
+ -moz-appearance: textfield;
100
+ `:e.disabled?u`
101
+ cursor: not-allowed;
102
+ `:void 0}
103
+ `,Xt=d.button`
104
+ position: relative;
105
+ height: auto;
106
+ padding: 0 1rem;
107
+
108
+ margin-right: -1rem; // offset the padding
109
+ cursor: pointer;
110
+
111
+ color: ${Ht.Neutral[3]};
112
+ background-color: transparent;
113
+ border: none;
114
+ `,Zt=d(Et)`
115
+ height: 1.25rem;
116
+ width: 1.25rem;
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`
223
+ display: flex;
224
+ position: relative;
225
+ border: 1px solid ${Ht.Neutral[5]};
226
+ border-radius: 4px;
227
+ background: ${Ht.Neutral[8]};
228
+ height: max-content;
229
+ width: 100%;
230
+ padding: 0 1rem;
231
+ flex-direction: ${e=>"right"===e.$position?"row-reverse":"row"};
232
+
233
+ :focus-within {
234
+ border: 1px solid ${Ht.Accent.Light[1]};
235
+ box-shadow: ${Ct};
236
+ }
237
+
238
+ ${e=>e.$readOnly?u`
239
+ border: none;
240
+ padding: 0;
241
+ background: transparent !important;
242
+
243
+ :focus-within {
244
+ border: none;
245
+ box-shadow: none;
246
+ }
247
+ `:e.disabled?u`
248
+ background: ${Ht.Neutral[6](e)};
249
+ :hover {
250
+ cursor: not-allowed;
251
+ }
252
+
253
+ :focus-within {
254
+ border: 1px solid ${Ht.Neutral[5](e)};
255
+ box-shadow: none;
256
+ }
257
+ `:e.$error?u`
258
+ border: 1px solid ${Ht.Validation.Red.Border(e)};
259
+
260
+ :focus-within {
261
+ border: 1px solid ${Ht.Validation.Red.Border(e)};
262
+ box-shadow: ${_t};
263
+ }
264
+ `:void 0}
265
+ `,d(Ut)`
266
+ // overwrite default styles
267
+ &&& {
268
+ background: transparent;
269
+ border: none;
270
+ padding: 0 0 1px 0;
271
+
272
+ :focus-within {
273
+ outline: none;
274
+ border: none;
275
+ box-shadow: none;
276
+ }
277
+ }
278
+ `;const on=d.div`
279
+ position: relative;
280
+ display: flex;
281
+ align-items: center;
282
+
283
+ ${Pt("Body","regular")}
284
+ color: ${Ht.Neutral[1]};
285
+
286
+ /* SVG Icon */
287
+ svg {
288
+ height: 1.5rem;
289
+ width: 1.5rem;
290
+ #path {
291
+ fill: ${Ht.Neutral[1]};
292
+ }
293
+ }
294
+
295
+ ${e=>{if(e.disabled)return u`
296
+ color: ${Ht.Neutral[4](e)};
297
+ svg {
298
+ #path {
299
+ fill: ${Ht.Neutral[4](e)};
300
+ }
301
+ }
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};
357
+ //# sourceMappingURL=index.js.map