@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.
- package/README.md +2 -0
- package/accordion/accordion-item.style.d.ts +5 -2
- package/accordion/accordion.style.d.ts +1 -1
- package/accordion/index.js +165 -172
- package/accordion/index.js.map +1 -1
- package/alert/alert.style.d.ts +4 -1
- package/alert/index.js +107 -119
- package/alert/index.js.map +1 -1
- package/animations/index.d.ts +1 -0
- package/animations/index.js +6 -3
- package/animations/index.js.map +1 -1
- package/animations/loading-dots-spinner/loading-dots-spinner.d.ts +2 -0
- package/animations/loading-dots-spinner/lottie-animation.d.ts +2 -0
- package/box-container/box-container.styles.d.ts +8 -1
- package/box-container/index.js +69 -74
- package/box-container/index.js.map +1 -1
- package/breadcrumb/breadcrumb.style.d.ts +4 -4
- package/breadcrumb/index.js +102 -106
- package/breadcrumb/index.js.map +1 -1
- package/breadcrumb/types.d.ts +5 -1
- package/button/button.d.ts +2 -2
- package/button/index.js +140 -143
- package/button/index.js.map +1 -1
- package/calendar/calendar-day.d.ts +11 -0
- package/calendar/calendar-day.style.d.ts +23 -0
- package/calendar/calendar-month.d.ts +12 -0
- package/calendar/calendar-month.style.d.ts +12 -0
- package/calendar/calendar-year.d.ts +12 -0
- package/calendar/calendar-year.style.d.ts +12 -0
- package/calendar/calendar.d.ts +4 -0
- package/calendar/calendar.style.d.ts +35 -0
- package/calendar/index.d.ts +2 -0
- package/calendar/index.js +381 -0
- package/calendar/index.js.map +1 -0
- package/calendar/package.json +7 -0
- package/calendar/types.d.ts +15 -0
- package/card/card.d.ts +3 -0
- package/card/card.style.d.ts +1 -0
- package/card/index.d.ts +1 -0
- package/card/index.js +132 -0
- package/card/index.js.map +1 -0
- package/{icon → card}/package.json +1 -1
- package/card/types.d.ts +4 -0
- package/checkbox/checkbox.d.ts +1 -1
- package/checkbox/checkbox.style.d.ts +4 -1
- package/checkbox/index.js +11 -21
- package/checkbox/index.js.map +1 -1
- package/cjs/index.js +2240 -1057
- package/cjs/index.js.map +1 -1
- package/color/color.d.ts +4 -59
- package/color/index.js +1 -1
- package/color/index.js.map +1 -1
- package/color/types.d.ts +5 -1
- package/date-input/date-input.d.ts +1 -1
- package/date-input/date-input.style.d.ts +2 -6
- package/date-input/index.js +132 -147
- package/date-input/index.js.map +1 -1
- package/date-input/types.d.ts +14 -16
- package/design-token/design-token.d.ts +4 -0
- package/design-token/index.d.ts +2 -0
- package/design-token/index.js +6 -0
- package/design-token/index.js.map +1 -0
- package/design-token/package.json +7 -0
- package/design-token/types.d.ts +7 -0
- package/error-display/error-display-data.d.ts +11 -0
- package/error-display/error-display.d.ts +3 -0
- package/error-display/error-display.style.d.ts +7 -0
- package/error-display/index.d.ts +2 -0
- package/error-display/index.js +323 -0
- package/error-display/index.js.map +1 -0
- package/error-display/package.json +7 -0
- package/error-display/types.d.ts +20 -0
- package/feedback-rating/feedback-rating-data.d.ts +5 -0
- package/feedback-rating/feedback-rating-stars-container-data.d.ts +3 -0
- package/feedback-rating/feedback-rating-stars-container.d.ts +3 -0
- package/feedback-rating/feedback-rating-stars-container.styles.d.ts +12 -0
- package/feedback-rating/feedback-rating.d.ts +3 -0
- package/feedback-rating/feedback-rating.styles.d.ts +5 -0
- package/feedback-rating/index.d.ts +2 -0
- package/feedback-rating/index.js +329 -0
- package/feedback-rating/index.js.map +1 -0
- package/feedback-rating/package.json +7 -0
- package/feedback-rating/types.d.ts +14 -0
- package/footer/footer-download-app.d.ts +2 -0
- package/footer/footer-download-app.style.d.ts +6 -0
- package/footer/footer-helper.d.ts +12 -0
- package/footer/footer.d.ts +3 -0
- package/footer/footer.style.d.ts +12 -0
- package/footer/index.d.ts +2 -0
- package/footer/index.js +373 -0
- package/footer/index.js.map +1 -0
- package/footer/package.json +7 -0
- package/footer/types.d.ts +31 -0
- package/form/form-custom-field.d.ts +3 -0
- package/form/form-input-group.d.ts +1 -1
- package/form/form-input.d.ts +1 -1
- package/form/form-label-addon.d.ts +1 -2
- package/form/form-label.d.ts +1 -1
- package/form/form-label.style.d.ts +1 -0
- package/form/form-phone-number-input.d.ts +3 -0
- package/form/form-textarea.d.ts +1 -1
- package/form/form-unit-number-input.d.ts +3 -0
- package/form/index.d.ts +9 -6
- package/form/index.js +771 -657
- package/form/index.js.map +1 -1
- package/form/types.d.ts +14 -5
- package/icon-button/icon-button.d.ts +1 -1
- package/icon-button/icon-button.style.d.ts +6 -1
- package/icon-button/index.js +9 -15
- package/icon-button/index.js.map +1 -1
- package/icon-button/types.d.ts +2 -3
- package/index.d.ts +12 -1
- package/index.js +2217 -1034
- package/index.js.map +1 -1
- package/input/index.js +93 -49
- package/input/index.js.map +1 -1
- package/input/input.d.ts +1 -1
- package/input/input.style.d.ts +9 -4
- package/input/types.d.ts +2 -0
- package/input-group/index.js +435 -343
- package/input-group/index.js.map +1 -1
- package/input-group/input-group-list-addon.d.ts +1 -1
- package/input-group/input-group-list-addon.style.d.ts +13 -2
- package/input-group/input-group.d.ts +1 -1
- package/input-group/input-group.style.d.ts +4 -8
- package/input-group/types.d.ts +11 -10
- package/input-select/index.js +286 -244
- package/input-select/index.js.map +1 -1
- package/input-select/input-select-wrapper.d.ts +1 -1
- package/input-select/input-select.d.ts +1 -1
- package/input-select/input-select.styles.d.ts +5 -1
- package/input-select/types.d.ts +15 -11
- package/input-textarea/index.js +132 -121
- package/input-textarea/index.js.map +1 -1
- package/input-textarea/textarea-counter.d.ts +2 -1
- package/input-textarea/textarea.d.ts +2 -2
- package/input-textarea/types.d.ts +1 -0
- package/layout/container.d.ts +3 -0
- package/layout/content.d.ts +3 -0
- package/layout/index.d.ts +7 -0
- package/layout/index.js +55 -0
- package/layout/index.js.map +1 -0
- package/layout/package.json +7 -0
- package/layout/section.d.ts +3 -0
- package/layout/types.d.ts +15 -0
- package/link-list/index.js +130 -130
- package/link-list/index.js.map +1 -1
- package/link-list/link-list.styles.d.ts +12 -2
- package/link-list/types.d.ts +1 -1
- package/masonry/index.js.map +1 -1
- package/masonry/masonry.d.ts +2 -2
- package/masthead/index.d.ts +1 -0
- package/masthead/index.js +9 -0
- package/masthead/index.js.map +1 -0
- package/masthead/masthead.d.ts +2 -0
- package/masthead/masthead.style.d.ts +1 -0
- package/masthead/package.json +7 -0
- package/media/index.js +1 -1
- package/media/index.js.map +1 -1
- package/media/media.d.ts +2 -1
- package/modal/index.d.ts +1 -1
- package/modal/index.js +30 -43
- package/modal/index.js.map +1 -1
- package/modal/modal-box.styles.d.ts +5 -2
- package/modal/modal.d.ts +1 -1
- package/modal/modal.styles.d.ts +1 -0
- package/modal/types.d.ts +4 -2
- package/navbar/brand.d.ts +10 -0
- package/navbar/brand.styles.d.ts +5 -0
- package/navbar/drawer.d.ts +3 -0
- package/navbar/drawer.styles.d.ts +15 -0
- package/navbar/index.d.ts +7 -0
- package/navbar/index.js +651 -0
- package/navbar/index.js.map +1 -0
- package/navbar/navbar-action-buttons.d.ts +10 -0
- package/navbar/navbar-action-buttons.styles.d.ts +9 -0
- package/navbar/navbar-items.d.ts +11 -0
- package/navbar/navbar-items.styles.d.ts +10 -0
- package/navbar/navbar.d.ts +3 -0
- package/navbar/navbar.styles.d.ts +19 -0
- package/navbar/package.json +7 -0
- package/navbar/types.d.ts +56 -0
- package/notification-banner/index.d.ts +3 -0
- package/notification-banner/index.js +266 -0
- package/notification-banner/index.js.map +1 -0
- package/notification-banner/notification-banner-hoc.d.ts +3 -0
- package/notification-banner/notification-banner.d.ts +6 -0
- package/notification-banner/notification-banner.styles.d.ts +15 -0
- package/notification-banner/package.json +7 -0
- package/notification-banner/types.d.ts +22 -0
- package/otp-input/index.d.ts +2 -0
- package/otp-input/index.js +600 -0
- package/otp-input/index.js.map +1 -0
- package/otp-input/otp-input.d.ts +3 -0
- package/otp-input/otp-input.styles.d.ts +5 -0
- package/otp-input/package.json +7 -0
- package/otp-input/types.d.ts +22 -0
- package/overlay/index.js +1 -1
- package/overlay/index.js.map +1 -1
- package/overlay/types.d.ts +1 -1
- package/package.json +4 -1
- package/phone-number-input/data/country-code.d.ts +1 -0
- package/phone-number-input/index.d.ts +2 -0
- package/phone-number-input/index.js +860 -0
- package/phone-number-input/index.js.map +1 -0
- package/phone-number-input/package.json +7 -0
- package/phone-number-input/phone-number-input-helper.d.ts +5 -0
- package/phone-number-input/phone-number-input.d.ts +3 -0
- package/phone-number-input/types.d.ts +51 -0
- package/popover/index.js +148 -153
- package/popover/index.js.map +1 -1
- package/popover/popover.styles.d.ts +1 -1
- package/popover/types.d.ts +3 -3
- package/progress-indicator/index.d.ts +2 -0
- package/progress-indicator/index.js +240 -0
- package/progress-indicator/index.js.map +1 -0
- package/progress-indicator/package.json +7 -0
- package/progress-indicator/progress-indicator.d.ts +3 -0
- package/progress-indicator/progress-indicator.style.d.ts +19 -0
- package/progress-indicator/types.d.ts +9 -0
- package/radio-button/index.js +7 -7
- package/radio-button/index.js.map +1 -1
- package/shared/dropdown-list/dropdown-list.d.ts +1 -1
- package/shared/dropdown-list/dropdown-list.styles.d.ts +6 -2
- package/shared/dropdown-list/dropdown-search.d.ts +2 -1
- package/shared/dropdown-list/dropdown-search.styles.d.ts +9 -1
- package/shared/dropdown-list/types.d.ts +22 -12
- package/shared/input-wrapper/input-wrapper.d.ts +8 -0
- package/smart-app-banner/index.d.ts +2 -0
- package/smart-app-banner/index.js +373 -0
- package/smart-app-banner/index.js.map +1 -0
- package/smart-app-banner/package.json +7 -0
- package/smart-app-banner/smart-app-banner.d.ts +3 -0
- package/smart-app-banner/smart-app-banner.styles.d.ts +31 -0
- package/smart-app-banner/types.d.ts +18 -0
- package/spec/design-token-spec/base-design-token-set.d.ts +2 -0
- package/text/index.js +62 -65
- package/text/index.js.map +1 -1
- package/text/text-style.d.ts +4 -100
- package/text-list/index.js +7 -7
- package/text-list/index.js.map +1 -1
- package/theme/design-token-helper.d.ts +2 -0
- package/theme/index.js +1 -1
- package/theme/index.js.map +1 -1
- package/theme/types.d.ts +12 -3
- package/timeline/index.js +95 -98
- package/timeline/index.js.map +1 -1
- package/timepicker/index.js +213 -207
- package/timepicker/index.js.map +1 -1
- package/timepicker/timepicker-dropdown.styles.d.ts +2 -2
- package/timepicker/types.d.ts +3 -3
- package/toggle-button/index.js +118 -121
- package/toggle-button/index.js.map +1 -1
- package/tooltip/index.js +127 -125
- package/tooltip/index.js.map +1 -1
- package/tooltip/tooltip.styles.d.ts +3 -1
- package/unit-number/index.d.ts +2 -0
- package/unit-number/index.js +357 -0
- package/unit-number/index.js.map +1 -0
- package/unit-number/package.json +7 -0
- package/unit-number/types.d.ts +27 -0
- package/unit-number/unit-number-input.d.ts +3 -0
- package/unit-number/unit-number-input.style.d.ts +11 -0
- package/util/calendar-helper.d.ts +10 -0
- package/util/date-helper.d.ts +19 -0
- package/util/index.d.ts +3 -0
- package/util/utility-types.d.ts +3 -0
- package/icon/arrow-right-icon.d.ts +0 -3
- package/icon/icon.d.ts +0 -3
- package/icon/index.d.ts +0 -2
- package/icon/index.js +0 -12
- package/icon/index.js.map +0 -1
- package/icon/info-icon.d.ts +0 -3
- package/icon/play-alt-icon.d.ts +0 -3
- package/icon/search-icon.d.ts +0 -3
- package/icon/shared.style.d.ts +0 -1
- package/icon/types.d.ts +0 -9
package/input/index.js
CHANGED
|
@@ -1,68 +1,112 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import e from"react";import n,{css as r}from"styled-components";var o;!function(t){t.transformWithSpaces=(t,e)=>{const n="(.{"+e+"})";return t.replace(/[^\dA-Z]/gi,"").replace(new RegExp(n,"g"),"$1 ").trim()},t.padValue=(t,e)=>{if("0"===t)return e?t:t.padStart(2,"0");if(""===t)return t;return parseInt(t).toString().padStart(2,"0")},t.shouldTruncateToTwoLines=(t,e)=>{const n=Math.floor(e/9);return t.length>=2*n||1===t.split(" ").length&&t.length>n},t.truncateOneLine=(t,e,n,r)=>{let o=0;e>n&&(o=Math.floor((e-n)/8));const i=r+o;if(i<t.length){const e=Math.floor(i/2);return t.substring(0,e)+" ... "+t.substring(t.length-e,t.length)}return t}}(o||(o={}));var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=Array.isArray,l="object"==typeof i&&i&&i.Object===Object&&i,c="object"==typeof self&&self&&self.Object===Object&&self,f=l||c||Function("return this")(),u=f.Symbol,g=u,d=Object.prototype,h=d.hasOwnProperty,s=d.toString,p=g?g.toStringTag:void 0;var y=function(t){var e=h.call(t,p),n=t[p];try{t[p]=void 0;var r=!0}catch(t){}var o=s.call(t);return r&&(e?t[p]=n:delete t[p]),o},F=Object.prototype.toString;var S=y,m=function(t){return F.call(t)},v=u?u.toStringTag:void 0;var B=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":v&&v in Object(t)?S(t):m(t)};var H=B,b=function(t){return null!=t&&"object"==typeof t};var D=function(t){return"symbol"==typeof t||b(t)&&"[object Symbol]"==H(t)},_=a,z=D,E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/;var x=function(t,e){if(_(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!z(t))||(W.test(t)||!E.test(t)||null!=e&&t in Object(e))};var A=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},O=B,w=A;var k,$=function(t){if(!w(t))return!1;var e=O(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},j=f["__core-js_shared__"],C=(k=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"";var V=function(t){return!!C&&C in t},T=Function.prototype.toString;var R=$,N=V,I=A,L=function(t){if(null!=t){try{return T.call(t)}catch(t){}try{return t+""}catch(t){}}return""},P=/^\[object .+?Constructor\]$/,G=Function.prototype,X=Object.prototype,M=G.toString,U=X.hasOwnProperty,Z=RegExp("^"+M.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var q=function(t){return!(!I(t)||N(t))&&(R(t)?Z:P).test(L(t))},J=function(t,e){return null==t?void 0:t[e]};var K=function(t,e){var n=J(t,e);return q(n)?n:void 0},Q=K(Object,"create"),Y=Q;var tt=function(){this.__data__=Y?Y(null):{},this.size=0};var et=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},nt=Q,rt=Object.prototype.hasOwnProperty;var ot=function(t){var e=this.__data__;if(nt){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return rt.call(e,t)?e[t]:void 0},it=Q,at=Object.prototype.hasOwnProperty;var lt=Q;var ct=tt,ft=et,ut=ot,gt=function(t){var e=this.__data__;return it?void 0!==e[t]:at.call(e,t)},dt=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=lt&&void 0===e?"__lodash_hash_undefined__":e,this};function ht(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ht.prototype.clear=ct,ht.prototype.delete=ft,ht.prototype.get=ut,ht.prototype.has=gt,ht.prototype.set=dt;var st=ht;var pt=function(){this.__data__=[],this.size=0};var yt=function(t,e){return t===e||t!=t&&e!=e};var Ft=function(t,e){for(var n=t.length;n--;)if(yt(t[n][0],e))return n;return-1},St=Ft,mt=Array.prototype.splice;var vt=Ft;var Bt=Ft;var Ht=Ft;var bt=pt,Dt=function(t){var e=this.__data__,n=St(e,t);return!(n<0)&&(n==e.length-1?e.pop():mt.call(e,n,1),--this.size,!0)},_t=function(t){var e=this.__data__,n=vt(e,t);return n<0?void 0:e[n][1]},zt=function(t){return Bt(this.__data__,t)>-1},Et=function(t,e){var n=this.__data__,r=Ht(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};function Wt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Wt.prototype.clear=bt,Wt.prototype.delete=Dt,Wt.prototype.get=_t,Wt.prototype.has=zt,Wt.prototype.set=Et;var xt=Wt,At=K(f,"Map"),Ot=st,wt=xt,kt=At;var $t=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var jt=function(t,e){var n=t.__data__;return $t(e)?n["string"==typeof e?"string":"hash"]:n.map},Ct=jt;var Vt=jt;var Tt=jt;var Rt=jt;var Nt=function(){this.size=0,this.__data__={hash:new Ot,map:new(kt||wt),string:new Ot}},It=function(t){var e=Ct(this,t).delete(t);return this.size-=e?1:0,e},Lt=function(t){return Vt(this,t).get(t)},Pt=function(t){return Tt(this,t).has(t)},Gt=function(t,e){var n=Rt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Xt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Xt.prototype.clear=Nt,Xt.prototype.delete=It,Xt.prototype.get=Lt,Xt.prototype.has=Pt,Xt.prototype.set=Gt;var Mt=Xt;function Ut(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ut.Cache||Mt),n}Ut.Cache=Mt;var Zt=Ut;var qt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jt=/\\(\\)?/g,Kt=function(t){var e=Zt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(qt,(function(t,n,r,o){e.push(r?o.replace(Jt,"$1"):n||t)})),e}));var Qt=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},Yt=a,te=D,ee=u?u.prototype:void 0,ne=ee?ee.toString:void 0;var re=function t(e){if("string"==typeof e)return e;if(Yt(e))return Qt(e,t)+"";if(te(e))return ne?ne.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n},oe=re;var ie=a,ae=x,le=Kt,ce=function(t){return null==t?"":oe(t)};var fe=D;var ue=function(t,e){return ie(t)?t:ae(t,e)?[t]:le(ce(t))},ge=function(t){if("string"==typeof t||fe(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e};var de=function(t,e){for(var n=0,r=(e=ue(e,t)).length;null!=t&&n<r;)t=t[ge(e[n++])];return n&&n==r?t:void 0};var he=function(t,e,n){var r=null==t?void 0:de(t,e);return void 0===r?n:r};const se=(t,e,n)=>e?he(n,e)||he(t,e):n||t,pe=(t,e)=>{const n=e||t.defaultValue;return he(t.collections,n)};var ye;!function(t){t.colorScheme="colorScheme",t.layout="layout",t.textStyleScheme="textStyleScheme"}(ye||(ye={}));const Fe={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"}}},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"}}}},defaultValue:"base"},Se=t=>e=>{const n=e.theme,r=pe(Fe,n[ye.colorScheme]);return n.options&&n.options.color?se(r,t,n.options.color):se(r,t)},me={Brand:{1:Se("Brand.1"),2:Se("Brand.2"),3:Se("Brand.3"),4:Se("Brand.4"),5:Se("Brand.5"),6:Se("Brand.6")},Primary:Se("Primary"),PrimaryDark:Se("PrimaryDark"),Secondary:Se("Secondary"),Accent:{Light:{1:Se("Accent.Light.1"),2:Se("Accent.Light.2"),3:Se("Accent.Light.3"),4:Se("Accent.Light.4"),5:Se("Accent.Light.5"),6:Se("Accent.Light.6")},Dark:{1:Se("Accent.Dark.1"),2:Se("Accent.Dark.2"),3:Se("Accent.Dark.3")}},Neutral:{1:Se("Neutral.1"),2:Se("Neutral.2"),3:Se("Neutral.3"),4:Se("Neutral.4"),5:Se("Neutral.5"),6:Se("Neutral.6"),7:Se("Neutral.7"),8:Se("Neutral.8")},Validation:{Green:{Text:Se("Validation.Green.Text"),Icon:Se("Validation.Green.Icon"),Border:Se("Validation.Green.Border"),Background:Se("Validation.Green.Background")},Orange:{Text:Se("Validation.Orange.Text"),Icon:Se("Validation.Orange.Icon"),Border:Se("Validation.Orange.Border"),Background:Se("Validation.Orange.Background"),Badge:Se("Validation.Orange.Badge")},Red:{Text:Se("Validation.Red.Text"),Icon:Se("Validation.Red.Icon"),Border:Se("Validation.Red.Border"),Background:Se("Validation.Red.Background")}}},ve={Regular:"Open Sans",Semibold:"Open Sans Semibold",Bold:"Open Sans Bold",Light:"Open Sans Light"},Be={collections:{base:{D1:{fontFamily:ve.Bold,fontSize:3,fontWeight:700,lineHeight:4,letterSpacing:-.056},D2:{fontFamily:ve.Bold,fontSize:2.5,fontWeight:700,lineHeight:3.5,letterSpacing:-.032},D3:{fontFamily:ve.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},D4:{fontFamily:ve.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},DBody:{fontFamily:ve.Regular,fontSize:1.375,lineHeight:1.75},H1:{fontFamily:ve.Bold,fontSize:2,fontWeight:700,lineHeight:2.5},H2:{fontFamily:ve.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},H3:{fontFamily:ve.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},H4:{fontFamily:ve.Bold,fontSize:1.125,fontWeight:700,lineHeight:1.625},H5:{fontFamily:ve.Bold,fontSize:1,fontWeight:700,lineHeight:1.5,letterSpacing:.014},H6:{fontFamily:ve.Bold,fontSize:.875,fontWeight:700,lineHeight:1.6,letterSpacing:.012},Body:{fontFamily:ve.Regular,fontSize:1.125,lineHeight:1.625},BodySmall:{fontFamily:ve.Regular,fontSize:1,lineHeight:1.5,letterSpacing:.014},XSmall:{fontFamily:ve.Regular,fontSize:.75,lineHeight:1.2,letterSpacing:.012}}},defaultValue:"base"},He=t=>e=>{const n=e.theme,r=pe(Be,n[ye.textStyleScheme]);return n.options&&n.options.textStyle?se(r,t,n.options.textStyle):se(r,t)},be={D1:{fontFamily:He("D1.fontFamily"),fontSize:He("D1.fontSize"),fontWeight:He("D1.fontWeight"),lineHeight:He("D1.lineHeight"),letterSpacing:He("D1.letterSpacing")},D2:{fontFamily:He("D2.fontFamily"),fontSize:He("D2.fontSize"),fontWeight:He("D2.fontWeight"),lineHeight:He("D2.lineHeight"),letterSpacing:He("D2.letterSpacing")},D3:{fontFamily:He("D3.fontFamily"),fontSize:He("D3.fontSize"),fontWeight:He("D3.fontWeight"),lineHeight:He("D3.lineHeight"),letterSpacing:He("D3.letterSpacing")},D4:{fontFamily:He("D4.fontFamily"),fontSize:He("D4.fontSize"),fontWeight:He("D4.fontWeight"),lineHeight:He("D4.lineHeight"),letterSpacing:He("D4.letterSpacing")},DBody:{fontFamily:He("DBody.fontFamily"),fontSize:He("DBody.fontSize"),fontWeight:He("DBody.fontWeight"),lineHeight:He("DBody.lineHeight"),letterSpacing:He("DBody.letterSpacing")},H1:{fontFamily:He("H1.fontFamily"),fontSize:He("H1.fontSize"),fontWeight:He("H1.fontWeight"),lineHeight:He("H1.lineHeight"),letterSpacing:He("H1.letterSpacing")},H2:{fontFamily:He("H2.fontFamily"),fontSize:He("H2.fontSize"),fontWeight:He("H2.fontWeight"),lineHeight:He("H2.lineHeight"),letterSpacing:He("H2.letterSpacing")},H3:{fontFamily:He("H3.fontFamily"),fontSize:He("H3.fontSize"),fontWeight:He("H3.fontWeight"),lineHeight:He("H3.lineHeight"),letterSpacing:He("H3.letterSpacing")},H4:{fontFamily:He("H4.fontFamily"),fontSize:He("H4.fontSize"),fontWeight:He("H4.fontWeight"),lineHeight:He("H4.lineHeight"),letterSpacing:He("H4.letterSpacing")},H5:{fontFamily:He("H5.fontFamily"),fontSize:He("H5.fontSize"),fontWeight:He("H5.fontWeight"),lineHeight:He("H5.lineHeight"),letterSpacing:He("H5.letterSpacing")},H6:{fontFamily:He("H6.fontFamily"),fontSize:He("H6.fontSize"),fontWeight:He("H6.fontWeight"),lineHeight:He("H6.lineHeight"),letterSpacing:He("H6.letterSpacing")},Body:{fontFamily:He("Body.fontFamily"),fontSize:He("Body.fontSize"),fontWeight:He("Body.fontWeight"),lineHeight:He("Body.lineHeight"),letterSpacing:He("Body.letterSpacing")},BodySmall:{fontFamily:He("BodySmall.fontFamily"),fontSize:He("BodySmall.fontSize"),fontWeight:He("BodySmall.fontWeight"),lineHeight:He("BodySmall.lineHeight"),letterSpacing:He("BodySmall.letterSpacing")},XSmall:{fontFamily:He("XSmall.fontFamily"),fontSize:He("XSmall.fontSize"),fontWeight:He("XSmall.fontWeight"),lineHeight:He("XSmall.lineHeight"),letterSpacing:He("XSmall.letterSpacing")}},De=t=>{switch(t){case 700:case"bold":return ve.Bold;case 600:case"semibold":return ve.Semibold;case 300:case"light":return ve.Light;case 400:case"regular":return ve.Regular;default:return""}},_e=(t,e)=>n=>{const o=be[t].fontFamily(n),i=be[t].fontWeight(n);return Object.values(ve).includes(o)?r`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
line-height: ${i.lineHeight}rem !important;
|
|
11
|
-
letter-spacing: ${i.letterSpacing(o)||0}rem !important;
|
|
12
|
-
${r`
|
|
13
|
-
margin-bottom: ${a*(n?1.05:0)}rem;
|
|
14
|
-
`}
|
|
15
|
-
`},We=n.input`
|
|
16
|
-
${Ee("Body","regular")}
|
|
17
|
-
border: 1px solid ${me.Neutral[5]};
|
|
1
|
+
import t,{jsxs as e,jsx as n}from"react/jsx-runtime";import r,{useRef as o,useImperativeHandle as i}from"react";import a,{css as l}from"styled-components";var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d=Array.isArray,f="object"==typeof c&&c&&c.Object===Object&&c,u="object"==typeof self&&self&&self.Object===Object&&self,g=f||u||Function("return this")(),h=g.Symbol,s=h,p=Object.prototype,y=p.hasOwnProperty,F=p.toString,S=s?s.toStringTag:void 0;var m=function(t){var e=y.call(t,S),n=t[S];try{t[S]=void 0;var r=!0}catch(t){}var o=F.call(t);return r&&(e?t[S]=n:delete t[S]),o},v=Object.prototype.toString;var B=m,b=function(t){return v.call(t)},H=h?h.toStringTag:void 0;var D=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":H&&H in Object(t)?B(t):b(t)};var _=D,w=function(t){return null!=t&&"object"==typeof t};var z=function(t){return"symbol"==typeof t||w(t)&&"[object Symbol]"==_(t)},x=d,C=z,E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var $=function(t,e){if(x(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!C(t))||(A.test(t)||!E.test(t)||null!=e&&t in Object(e))};var k=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},W=D,O=k;var j,T=function(t){if(!O(t))return!1;var e=W(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},R=g["__core-js_shared__"],L=(j=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"";var V=function(t){return!!L&&L in t},I=Function.prototype.toString;var N=T,P=V,G=k,X=function(t){if(null!=t){try{return I.call(t)}catch(t){}try{return t+""}catch(t){}}return""},M=/^\[object .+?Constructor\]$/,Z=Function.prototype,U=Object.prototype,q=Z.toString,J=U.hasOwnProperty,K=RegExp("^"+q.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Q=function(t){return!(!G(t)||P(t))&&(N(t)?K:M).test(X(t))},Y=function(t,e){return null==t?void 0:t[e]};var tt=function(t,e){var n=Y(t,e);return Q(n)?n:void 0},et=tt(Object,"create"),nt=et;var rt=function(){this.__data__=nt?nt(null):{},this.size=0};var ot=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},it=et,at=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(it){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return at.call(e,t)?e[t]:void 0},ct=et,dt=Object.prototype.hasOwnProperty;var ft=et;var ut=rt,gt=ot,ht=lt,st=function(t){var e=this.__data__;return ct?void 0!==e[t]:dt.call(e,t)},pt=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ft&&void 0===e?"__lodash_hash_undefined__":e,this};function yt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}yt.prototype.clear=ut,yt.prototype.delete=gt,yt.prototype.get=ht,yt.prototype.has=st,yt.prototype.set=pt;var Ft=yt;var St=function(){this.__data__=[],this.size=0};var mt=function(t,e){return t===e||t!=t&&e!=e};var vt=function(t,e){for(var n=t.length;n--;)if(mt(t[n][0],e))return n;return-1},Bt=vt,bt=Array.prototype.splice;var Ht=vt;var Dt=vt;var _t=vt;var wt=St,zt=function(t){var e=this.__data__,n=Bt(e,t);return!(n<0)&&(n==e.length-1?e.pop():bt.call(e,n,1),--this.size,!0)},xt=function(t){var e=this.__data__,n=Ht(e,t);return n<0?void 0:e[n][1]},Ct=function(t){return Dt(this.__data__,t)>-1},Et=function(t,e){var n=this.__data__,r=_t(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};function At(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}At.prototype.clear=wt,At.prototype.delete=zt,At.prototype.get=xt,At.prototype.has=Ct,At.prototype.set=Et;var $t=At,kt=tt(g,"Map"),Wt=Ft,Ot=$t,jt=kt;var Tt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Rt=function(t,e){var n=t.__data__;return Tt(e)?n["string"==typeof e?"string":"hash"]:n.map},Lt=Rt;var Vt=Rt;var It=Rt;var Nt=Rt;var Pt=function(){this.size=0,this.__data__={hash:new Wt,map:new(jt||Ot),string:new Wt}},Gt=function(t){var e=Lt(this,t).delete(t);return this.size-=e?1:0,e},Xt=function(t){return Vt(this,t).get(t)},Mt=function(t){return It(this,t).has(t)},Zt=function(t,e){var n=Nt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Ut(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ut.prototype.clear=Pt,Ut.prototype.delete=Gt,Ut.prototype.get=Xt,Ut.prototype.has=Mt,Ut.prototype.set=Zt;var qt=Ut;function Jt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Jt.Cache||qt),n}Jt.Cache=qt;var Kt=Jt;var Qt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yt=/\\(\\)?/g,te=function(t){var e=Kt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Qt,(function(t,n,r,o){e.push(r?o.replace(Yt,"$1"):n||t)})),e}));var ee=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},ne=d,re=z,oe=h?h.prototype:void 0,ie=oe?oe.toString:void 0;var ae=function t(e){if("string"==typeof e)return e;if(ne(e))return ee(e,t)+"";if(re(e))return ie?ie.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n},le=ae;var ce=d,de=$,fe=te,ue=function(t){return null==t?"":le(t)};var ge=z;var he=function(t,e){return ce(t)?t:de(t,e)?[t]:fe(ue(t))},se=function(t){if("string"==typeof t||ge(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e};var pe=function(t,e){for(var n=0,r=(e=he(e,t)).length;null!=t&&n<r;)t=t[se(e[n++])];return n&&n==r?t:void 0};var ye=function(t,e,n){var r=null==t?void 0:pe(t,e);return void 0===r?n:r};const Fe=(t,e,n)=>e?ye(n,e)||ye(t,e):n||t,Se=(t,e)=>{const n=e||t.defaultValue;return ye(t.collections,n)};var me;!function(t){t.colorScheme="colorScheme",t.layout="layout",t.textStyleScheme="textStyleScheme",t.designTokenScheme="designTokenScheme"}(me||(me={}));const ve={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"},Be=t=>e=>{const n=e.theme,r=Se(ve,n[me.colorScheme]);return n.options&&n.options.color?Fe(r,t,n.options.color):Fe(r,t)},be={Brand:{1:Be("Brand.1"),2:Be("Brand.2"),3:Be("Brand.3"),4:Be("Brand.4"),5:Be("Brand.5"),6:Be("Brand.6")},Primary:Be("Primary"),PrimaryDark:Be("PrimaryDark"),Secondary:Be("Secondary"),Accent:{Light:{1:Be("Accent.Light.1"),2:Be("Accent.Light.2"),3:Be("Accent.Light.3"),4:Be("Accent.Light.4"),5:Be("Accent.Light.5"),6:Be("Accent.Light.6")},Dark:{1:Be("Accent.Dark.1"),2:Be("Accent.Dark.2"),3:Be("Accent.Dark.3")}},Neutral:{1:Be("Neutral.1"),2:Be("Neutral.2"),3:Be("Neutral.3"),4:Be("Neutral.4"),5:Be("Neutral.5"),6:Be("Neutral.6"),7:Be("Neutral.7"),8:Be("Neutral.8")},Validation:{Green:{Text:Be("Validation.Green.Text"),Icon:Be("Validation.Green.Icon"),Border:Be("Validation.Green.Border"),Background:Be("Validation.Green.Background")},Orange:{Text:Be("Validation.Orange.Text"),Icon:Be("Validation.Orange.Icon"),Border:Be("Validation.Orange.Border"),Background:Be("Validation.Orange.Background"),Badge:Be("Validation.Orange.Badge")},Red:{Text:Be("Validation.Red.Text"),Icon:Be("Validation.Red.Icon"),Border:Be("Validation.Red.Border"),Background:Be("Validation.Red.Background")}},Shadow:{Accent:Be("Shadow.Accent"),Red:Be("Shadow.Red")}},He={collections:{base:{InputBoxShadow:l`
|
|
2
|
+
inset 0 0 6px 1px ${be.Shadow.Accent}
|
|
3
|
+
`,InputErrorBoxShadow:l`
|
|
4
|
+
inset 0 0 6px 1px ${be.Shadow.Red}
|
|
5
|
+
`}},defaultValue:"base"},De=t=>e=>{const n=e.theme,r=Se(He,n[me.designTokenScheme]);return n.options?.designToken?Fe(r,t,n.options.designToken):Fe(r,t)},_e=De("InputBoxShadow"),we=De("InputErrorBoxShadow"),ze=a.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
position: relative;
|
|
9
|
+
border: 1px solid ${be.Neutral[5]};
|
|
18
10
|
border-radius: 4px;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
height: 3rem;
|
|
11
|
+
background: ${be.Neutral[8]};
|
|
12
|
+
height: max-content;
|
|
22
13
|
width: 100%;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
:focus,
|
|
27
|
-
:active {
|
|
28
|
-
outline: none;
|
|
29
|
-
border: 1px solid ${me.Accent.Light[1]};
|
|
30
|
-
box-shadow: inset 0 0 5px 1px rgba(87, 169, 255, 0.5);
|
|
31
|
-
}
|
|
14
|
+
padding: 0 1rem;
|
|
15
|
+
flex-direction: ${t=>"right"===t.$position?"row-reverse":"row"};
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
:focus-within {
|
|
18
|
+
border: 1px solid ${be.Accent.Light[1]};
|
|
19
|
+
box-shadow: ${_e};
|
|
36
20
|
}
|
|
37
21
|
|
|
38
|
-
${t=>t
|
|
22
|
+
${t=>t.$readOnly?l`
|
|
39
23
|
border: none;
|
|
40
|
-
padding
|
|
24
|
+
padding: 0;
|
|
41
25
|
background: transparent !important;
|
|
42
26
|
|
|
43
|
-
:focus
|
|
44
|
-
:active {
|
|
27
|
+
:focus-within {
|
|
45
28
|
border: none;
|
|
46
29
|
box-shadow: none;
|
|
47
30
|
}
|
|
48
|
-
`:t.disabled?
|
|
49
|
-
background: ${
|
|
31
|
+
`:t.disabled?l`
|
|
32
|
+
background: ${be.Neutral[6](t)};
|
|
50
33
|
cursor: not-allowed;
|
|
51
34
|
|
|
52
|
-
:focus
|
|
53
|
-
|
|
54
|
-
outline: none;
|
|
55
|
-
border: 1px solid ${me.Neutral[5](t)};
|
|
35
|
+
:focus-within {
|
|
36
|
+
border: 1px solid ${be.Neutral[5](t)};
|
|
56
37
|
box-shadow: none;
|
|
57
38
|
}
|
|
58
|
-
`:t
|
|
59
|
-
border: 1px solid ${
|
|
39
|
+
`:t.$error?l`
|
|
40
|
+
border: 1px solid ${be.Validation.Red.Border(t)};
|
|
60
41
|
|
|
61
|
-
:focus
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
box-shadow: inset 0 0 4px 1px rgba(221, 102, 102, 0.8);
|
|
42
|
+
:focus-within {
|
|
43
|
+
border: 1px solid ${be.Validation.Red.Border(t)};
|
|
44
|
+
box-shadow: ${we};
|
|
65
45
|
}
|
|
66
46
|
`:void 0}
|
|
67
|
-
|
|
47
|
+
`;var xe;!function(t){t.transformWithSpaces=(t,e)=>{const n="(.{"+e+"})";return t.replace(/[^\dA-Z]/gi,"").replace(new RegExp(n,"g"),"$1 ").trim()},t.padValue=(t,e)=>{if("0"===t)return e?t:t.padStart(2,"0");if(""===t)return t;return parseInt(t).toString().padStart(2,"0")},t.shouldTruncateToTwoLines=(t,e)=>{const n=Math.floor(e/9);return t.length>=2*n||1===t.split(" ").length&&t.length>n},t.truncateOneLine=(t,e,n,r)=>{let o=0;e>n&&(o=Math.floor((e-n)/8));const i=r+o;if(i<t.length){const e=Math.floor(i/2);return t.substring(0,e)+" ... "+t.substring(t.length-e,t.length)}return t}}(xe||(xe={}));var Ce,Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});var Ae=t;const $e=t=>Ae.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:Ae.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"})});$e.displayName="CrossIcon",Ce=Ee.CrossIcon=$e;const ke={Regular:"Open Sans",Semibold:"Open Sans Semibold",Bold:"Open Sans Bold",Light:"Open Sans Light"},We={collections:{base:{D1:{fontFamily:ke.Bold,fontSize:3,fontWeight:700,lineHeight:4,letterSpacing:-.056},D2:{fontFamily:ke.Bold,fontSize:2.5,fontWeight:700,lineHeight:3.5,letterSpacing:-.032},D3:{fontFamily:ke.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},D4:{fontFamily:ke.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},DBody:{fontFamily:ke.Regular,fontSize:1.375,lineHeight:1.75},H1:{fontFamily:ke.Bold,fontSize:2,fontWeight:700,lineHeight:2.5},H2:{fontFamily:ke.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},H3:{fontFamily:ke.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},H4:{fontFamily:ke.Bold,fontSize:1.125,fontWeight:700,lineHeight:1.625},H5:{fontFamily:ke.Bold,fontSize:1,fontWeight:700,lineHeight:1.5,letterSpacing:.014},H6:{fontFamily:ke.Bold,fontSize:.875,fontWeight:700,lineHeight:1.6,letterSpacing:.012},Body:{fontFamily:ke.Regular,fontSize:1.125,lineHeight:1.625},BodySmall:{fontFamily:ke.Regular,fontSize:1,lineHeight:1.5,letterSpacing:.014},XSmall:{fontFamily:ke.Regular,fontSize:.75,lineHeight:1.2,letterSpacing:.012}}},defaultValue:"base"},Oe=t=>e=>{const n=e.theme,r=Se(We,n[me.textStyleScheme]);return n.options&&n.options.textStyle?Fe(r,t,n.options.textStyle):Fe(r,t)},je={D1:{fontFamily:Oe("D1.fontFamily"),fontSize:Oe("D1.fontSize"),fontWeight:Oe("D1.fontWeight"),lineHeight:Oe("D1.lineHeight"),letterSpacing:Oe("D1.letterSpacing")},D2:{fontFamily:Oe("D2.fontFamily"),fontSize:Oe("D2.fontSize"),fontWeight:Oe("D2.fontWeight"),lineHeight:Oe("D2.lineHeight"),letterSpacing:Oe("D2.letterSpacing")},D3:{fontFamily:Oe("D3.fontFamily"),fontSize:Oe("D3.fontSize"),fontWeight:Oe("D3.fontWeight"),lineHeight:Oe("D3.lineHeight"),letterSpacing:Oe("D3.letterSpacing")},D4:{fontFamily:Oe("D4.fontFamily"),fontSize:Oe("D4.fontSize"),fontWeight:Oe("D4.fontWeight"),lineHeight:Oe("D4.lineHeight"),letterSpacing:Oe("D4.letterSpacing")},DBody:{fontFamily:Oe("DBody.fontFamily"),fontSize:Oe("DBody.fontSize"),fontWeight:Oe("DBody.fontWeight"),lineHeight:Oe("DBody.lineHeight"),letterSpacing:Oe("DBody.letterSpacing")},H1:{fontFamily:Oe("H1.fontFamily"),fontSize:Oe("H1.fontSize"),fontWeight:Oe("H1.fontWeight"),lineHeight:Oe("H1.lineHeight"),letterSpacing:Oe("H1.letterSpacing")},H2:{fontFamily:Oe("H2.fontFamily"),fontSize:Oe("H2.fontSize"),fontWeight:Oe("H2.fontWeight"),lineHeight:Oe("H2.lineHeight"),letterSpacing:Oe("H2.letterSpacing")},H3:{fontFamily:Oe("H3.fontFamily"),fontSize:Oe("H3.fontSize"),fontWeight:Oe("H3.fontWeight"),lineHeight:Oe("H3.lineHeight"),letterSpacing:Oe("H3.letterSpacing")},H4:{fontFamily:Oe("H4.fontFamily"),fontSize:Oe("H4.fontSize"),fontWeight:Oe("H4.fontWeight"),lineHeight:Oe("H4.lineHeight"),letterSpacing:Oe("H4.letterSpacing")},H5:{fontFamily:Oe("H5.fontFamily"),fontSize:Oe("H5.fontSize"),fontWeight:Oe("H5.fontWeight"),lineHeight:Oe("H5.lineHeight"),letterSpacing:Oe("H5.letterSpacing")},H6:{fontFamily:Oe("H6.fontFamily"),fontSize:Oe("H6.fontSize"),fontWeight:Oe("H6.fontWeight"),lineHeight:Oe("H6.lineHeight"),letterSpacing:Oe("H6.letterSpacing")},Body:{fontFamily:Oe("Body.fontFamily"),fontSize:Oe("Body.fontSize"),fontWeight:Oe("Body.fontWeight"),lineHeight:Oe("Body.lineHeight"),letterSpacing:Oe("Body.letterSpacing")},BodySmall:{fontFamily:Oe("BodySmall.fontFamily"),fontSize:Oe("BodySmall.fontSize"),fontWeight:Oe("BodySmall.fontWeight"),lineHeight:Oe("BodySmall.lineHeight"),letterSpacing:Oe("BodySmall.letterSpacing")},XSmall:{fontFamily:Oe("XSmall.fontFamily"),fontSize:Oe("XSmall.fontSize"),fontWeight:Oe("XSmall.fontWeight"),lineHeight:Oe("XSmall.lineHeight"),letterSpacing:Oe("XSmall.letterSpacing")}},Te=t=>{switch(t){case 700:case"bold":return ke.Bold;case 600:case"semibold":return ke.Semibold;case 300:case"light":return ke.Light;case 400:case"regular":return ke.Regular;default:return""}},Re=(t,e)=>n=>{const r=je[t].fontFamily(n),o=je[t].fontWeight(n);return Object.values(ke).includes(r)?l`
|
|
48
|
+
font-family: ${Te(e)||Te(o)||r};
|
|
49
|
+
font-weight: normal !important;
|
|
50
|
+
`:l`
|
|
51
|
+
font-family: ${r};
|
|
52
|
+
font-weight: ${(Le(e)||o)??"normal"};
|
|
53
|
+
`},Le=t=>{switch(t){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""}},Ve=(t,e,n=!1)=>r=>{const o=je[t],i=o.fontSize(r);return l`
|
|
54
|
+
${Re(t,e)}
|
|
55
|
+
font-size: ${i}rem !important;
|
|
56
|
+
line-height: ${o.lineHeight}rem !important;
|
|
57
|
+
letter-spacing: ${o.letterSpacing(r)||0}rem !important;
|
|
58
|
+
${l`
|
|
59
|
+
margin-bottom: ${i*(n?1.05:0)}rem;
|
|
60
|
+
`}
|
|
61
|
+
`},Ie=a.input`
|
|
62
|
+
${Ve("Body","regular")}
|
|
63
|
+
color: ${be.Neutral[1]};
|
|
64
|
+
|
|
65
|
+
// overwrite default styles
|
|
66
|
+
background: transparent;
|
|
67
|
+
border: none;
|
|
68
|
+
height: 3rem;
|
|
69
|
+
width: 100%;
|
|
70
|
+
padding: 0;
|
|
71
|
+
|
|
72
|
+
:focus,
|
|
73
|
+
:active {
|
|
74
|
+
outline: none;
|
|
75
|
+
border: none;
|
|
76
|
+
box-shadow: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
::placeholder,
|
|
80
|
+
::-webkit-input-placeholder {
|
|
81
|
+
color: ${be.Neutral[3]};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
${t=>"number"===t.type?l`
|
|
85
|
+
// Chrome, Safari, Edge, Opera
|
|
86
|
+
::-webkit-outer-spin-button,
|
|
87
|
+
::-webkit-inner-spin-button {
|
|
88
|
+
-webkit-appearance: none;
|
|
89
|
+
margin: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Firefox
|
|
93
|
+
-moz-appearance: textfield;
|
|
94
|
+
`:t.disabled?l`
|
|
95
|
+
cursor: not-allowed;
|
|
96
|
+
`:void 0}
|
|
97
|
+
`,Ne=a.button`
|
|
98
|
+
position: relative;
|
|
99
|
+
height: auto;
|
|
100
|
+
padding: 0 1rem;
|
|
101
|
+
|
|
102
|
+
margin-right: -1rem; // offset the padding
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
|
|
105
|
+
color: ${be.Neutral[3]};
|
|
106
|
+
background-color: transparent;
|
|
107
|
+
border: none;
|
|
108
|
+
`,Pe=a(Ce)`
|
|
109
|
+
height: 1.25rem;
|
|
110
|
+
width: 1.25rem;
|
|
111
|
+
`,Ge=r.forwardRef((({value:t,spacing:r,type:a,error:l,disabled:c,readOnly:d,onChange:f,onClear:u,allowClear:g=!1,className:h,...s},p)=>{const y=o();i(p,(()=>y.current),[]);const F=()=>"tel"===a&&r,S=t=>{const e=t.target,n=e.value,r=e.value.replace(/\s/g,"");e.value=r,f(t),e.value=n},m=t?(t=>t?F()?xe.transformWithSpaces(t,r):t:"")(t):t;return e(ze,{disabled:c,$error:l,$readOnly:d,className:h,children:[n(Ie,{"data-testid":"input",ref:y,disabled:c,value:m,onChange:t=>{f&&(F()?S(t):f(t))},type:a,readOnly:d,...s}),g&&!c&&!d&&!!t&&n(Ne,{onClick:()=>{u&&u(),y&&y.current&&y.current.focus()},children:n(Pe,{})})]})}));export{Ge as Input};
|
|
68
112
|
//# sourceMappingURL=index.js.map
|