@lifesg/react-design-system 1.0.0-alpha.2 → 1.0.0-alpha.20
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.js +1 -1
- package/animations/index.js.map +1 -1
- 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/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 +1999 -1021
- 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 +121 -136
- 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 +322 -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 +774 -629
- 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 +11 -1
- package/index.js +1997 -1019
- package/index.js.map +1 -1
- package/input/index.js +84 -41
- package/input/index.js.map +1 -1
- package/input/input.d.ts +1 -1
- package/input/input.style.d.ts +9 -0
- package/input/types.d.ts +2 -0
- package/input-group/index.js +392 -312
- 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 +4 -1
- package/input-group/input-group.d.ts +1 -1
- package/input-group/input-group.style.d.ts +1 -2
- package/input-group/types.d.ts +8 -8
- package/input-select/index.js +278 -242
- 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/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 +1 -0
- package/phone-number-input/index.js +850 -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/phone-number-input.styles.d.ts +1 -0
- package/phone-number-input/types.d.ts +42 -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 +21 -12
- 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 +403 -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 +16 -0
- package/util/date-helper.d.ts +19 -0
- package/util/index.d.ts +2 -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
|
@@ -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
|
|
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,403 @@
|
|
|
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`
|
|
131
|
+
display: flex;
|
|
132
|
+
position: relative;
|
|
133
|
+
align-items: center;
|
|
134
|
+
border: 1px solid ${Bt.Neutral[5]};
|
|
135
|
+
border-radius: 4px;
|
|
136
|
+
background: ${Bt.Neutral[8]};
|
|
137
|
+
height: 3rem;
|
|
138
|
+
width: 100%;
|
|
139
|
+
padding: 0;
|
|
140
|
+
|
|
141
|
+
:focus,
|
|
142
|
+
:focus-within {
|
|
143
|
+
border: 1px solid ${Bt.Accent.Light[1]};
|
|
144
|
+
box-shadow: ${Dt};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
${e=>e.$readOnly?d`
|
|
148
|
+
border: none;
|
|
149
|
+
padding-left: 0rem;
|
|
150
|
+
background: transparent !important;
|
|
151
|
+
|
|
152
|
+
:focus-within {
|
|
153
|
+
border: none;
|
|
154
|
+
box-shadow: none;
|
|
155
|
+
}
|
|
156
|
+
`:e.disabled?d`
|
|
157
|
+
background: ${Bt.Neutral[6](e)};
|
|
158
|
+
:hover {
|
|
159
|
+
cursor: not-allowed;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:focus-within {
|
|
163
|
+
border: 1px solid ${Bt.Neutral[5](e)};
|
|
164
|
+
box-shadow: none;
|
|
165
|
+
}
|
|
166
|
+
`:e.$error?d`
|
|
167
|
+
border: 1px solid ${Bt.Validation.Red.Border(e)};
|
|
168
|
+
|
|
169
|
+
:focus-within {
|
|
170
|
+
border: 1px solid ${Bt.Validation.Red.Border(e)};
|
|
171
|
+
box-shadow: ${Ct};
|
|
172
|
+
}
|
|
173
|
+
`: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")}
|
|
183
|
+
background: transparent;
|
|
184
|
+
height: 100%;
|
|
185
|
+
width: 3rem;
|
|
186
|
+
border: none;
|
|
187
|
+
text-align: center;
|
|
188
|
+
padding: 0;
|
|
189
|
+
|
|
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
|
+
:focus,
|
|
204
|
+
:active {
|
|
205
|
+
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};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
::placeholder,
|
|
237
|
+
::-webkit-input-placeholder {
|
|
238
|
+
color: ${Bt.Neutral[3]};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
${e=>{if("number"===e.type)return d`
|
|
242
|
+
// Chrome, Safari, Edge, Opera
|
|
243
|
+
::-webkit-outer-spin-button,
|
|
244
|
+
::-webkit-inner-spin-button {
|
|
245
|
+
-webkit-appearance: none;
|
|
246
|
+
margin: 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Firefox
|
|
250
|
+
-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
|
+
}
|
|
279
|
+
`: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`
|
|
297
|
+
position: relative;
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
padding: 0.875rem 1rem;
|
|
301
|
+
cursor: pointer;
|
|
302
|
+
|
|
303
|
+
color: ${Bt.Neutral[3]};
|
|
304
|
+
background-color: transparent;
|
|
305
|
+
border: none;
|
|
306
|
+
`,on=l(Jt)`
|
|
307
|
+
height: 1.25rem;
|
|
308
|
+
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`
|
|
310
|
+
display: flex;
|
|
311
|
+
position: relative;
|
|
312
|
+
border: 1px solid ${Bt.Neutral[5]};
|
|
313
|
+
border-radius: 4px;
|
|
314
|
+
background: ${Bt.Neutral[8]};
|
|
315
|
+
height: 3rem;
|
|
316
|
+
width: 100%;
|
|
317
|
+
flex-direction: ${e=>"right"===e.$position?"row-reverse":"row"};
|
|
318
|
+
|
|
319
|
+
:focus-within {
|
|
320
|
+
border: 1px solid ${Bt.Accent.Light[1]};
|
|
321
|
+
box-shadow: ${Dt};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
${e=>e.$readOnly?d`
|
|
325
|
+
border: none;
|
|
326
|
+
padding-left: 0rem;
|
|
327
|
+
background: transparent !important;
|
|
328
|
+
|
|
329
|
+
:focus-within {
|
|
330
|
+
border: none;
|
|
331
|
+
box-shadow: none;
|
|
332
|
+
}
|
|
333
|
+
`:e.disabled?d`
|
|
334
|
+
background: ${Bt.Neutral[6](e)};
|
|
335
|
+
:hover {
|
|
336
|
+
cursor: not-allowed;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
:focus-within {
|
|
340
|
+
border: 1px solid ${Bt.Neutral[5](e)};
|
|
341
|
+
box-shadow: none;
|
|
342
|
+
}
|
|
343
|
+
`:e.$error?d`
|
|
344
|
+
border: 1px solid ${Bt.Validation.Red.Border(e)};
|
|
345
|
+
|
|
346
|
+
:focus-within {
|
|
347
|
+
border: 1px solid ${Bt.Validation.Red.Border(e)};
|
|
348
|
+
box-shadow: ${Ct};
|
|
349
|
+
}
|
|
350
|
+
`:void 0}
|
|
351
|
+
`,l(an)`
|
|
352
|
+
// overwrite default styles
|
|
353
|
+
background: transparent;
|
|
354
|
+
border: none;
|
|
355
|
+
|
|
356
|
+
:focus-within {
|
|
357
|
+
outline: none;
|
|
358
|
+
border: none;
|
|
359
|
+
box-shadow: none;
|
|
360
|
+
}
|
|
361
|
+
|
|
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`
|
|
373
|
+
position: relative;
|
|
374
|
+
display: flex;
|
|
375
|
+
align-items: center;
|
|
376
|
+
border-top-left-radius: 4px;
|
|
377
|
+
border-bottom-left-radius: 4px;
|
|
378
|
+
padding: 0 0.6875rem 0 1rem;
|
|
379
|
+
|
|
380
|
+
${Wt("Body","regular")}
|
|
381
|
+
color: ${Bt.Neutral[1]};
|
|
382
|
+
|
|
383
|
+
/* SVG Icon */
|
|
384
|
+
svg {
|
|
385
|
+
height: 1.5rem;
|
|
386
|
+
width: 1.5rem;
|
|
387
|
+
#path {
|
|
388
|
+
fill: ${Bt.Neutral[1]};
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
${e=>e.$readOnly?d`
|
|
393
|
+
padding-left: 0rem;
|
|
394
|
+
`:e.disabled?d`
|
|
395
|
+
color: ${Bt.Neutral[4](e)};
|
|
396
|
+
svg {
|
|
397
|
+
#path {
|
|
398
|
+
fill: ${Bt.Neutral[4](e)};
|
|
399
|
+
}
|
|
400
|
+
}
|
|
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};
|
|
403
|
+
//# sourceMappingURL=index.js.map
|