@mmb-digital/design-system-web 0.1.49 → 0.1.50

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/dist/index.cjs.js CHANGED
@@ -1239,7 +1239,7 @@ function uc(e,t,n){return t=kc(t),function(e,t){if(t&&("object"==typeof t||"func
1239
1239
  1.125 * ${({theme:e})=>e.font.size.body.md}
1240
1240
  );
1241
1241
  line-height: ${({theme:e})=>e.font.lineHeight.body.md};
1242
- color: ${({theme:e})=>e.colors.fg.neutral.subtle.light};
1242
+ color: ${({theme:e})=>e.palette.blue1000};
1243
1243
  `,Sd=t.input`
1244
1244
  ${Ed};
1245
1245
  box-sizing: border-box;
@@ -1387,7 +1387,7 @@ function uc(e,t,n){return t=kc(t),function(e,t){if(t&&("object"==typeof t||"func
1387
1387
  display: flex;
1388
1388
  flex-direction: column;
1389
1389
  ${({childrenWidth:e})=>void 0===e?"":`width: ${e}`};
1390
- `,Bd=n=>{const{children:r,childrenWidth:o,colorScheme:a=exports.ColorScheme.light,errorMessage:i,hasError:s,hintText:l,id:c,label:u,labelSuffix:p,layout:h=exports.FieldWrapperLayout.vertical,tooltip:f}=n,m=t.useTheme(),g=H(a),b=(()=>{switch(h){case exports.FieldWrapperLayout.vertical:return e.Fragment;case exports.FieldWrapperLayout.horizontal:return Rd;default:throw new Error("unexpected value of enum FieldWrapperLayout fieldWrapper.tsx LabelAndHintWrapper")}})(),v=(()=>{switch(h){case exports.FieldWrapperLayout.vertical:return e.Fragment;case exports.FieldWrapperLayout.horizontal:return Wd;default:throw new Error("unexpected value of enum FieldWrapperLayout fieldWrapper.tsx FieldAndErrorWrapper")}})();return e.createElement(Pd,{layout:h},(void 0!==u||void 0!==l)&&e.createElement(b,null,void 0!==u&&e.createElement(Od,{hasError:s,id:c,label:u,suffix:p,tooltip:f}),void 0!==l&&e.createElement(d,{color:g(m.colors.fg.neutral.subtle),variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.REGULAR_400},l)),e.createElement(v,{childrenWidth:o},r,!0===s&&void 0!==i&&""!==i&&e.createElement("div",null,e.createElement(d,{color:g(m.colors.fg.error),variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.REGULAR_400},i))))},Vd=e=>void 0!==e?e:Ct.encode(Math.random().toString()),Gd=t=>e.useMemo((()=>Vd(t)),[t]),Fd=e.forwardRef((function(t,n){const{errorMessage:r,hasError:o,hintText:a,id:i,label:s,labelSuffix:l,layout:c,tooltip:u}=t,d=Po(t,["errorMessage","hasError","hintText","id","label","labelSuffix","layout","tooltip"]),p=Gd(i);return e.createElement(Bd,{errorMessage:r,hasError:o,hintText:a,id:p,label:s,labelSuffix:l,layout:c,tooltip:u},e.createElement(Ad,Object.assign({hasError:o,id:p,ref:n,type:"email"},d)))})),Hd=e.forwardRef((function(t,n){const{errorMessage:r,hasError:o,hintText:a,id:i,label:s,labelSuffix:l,layout:c,tooltip:u}=t,d=Po(t,["errorMessage","hasError","hintText","id","label","labelSuffix","layout","tooltip"]),p=Gd(i);return e.createElement(Bd,{errorMessage:r,hasError:o,hintText:a,id:p,label:s,labelSuffix:l,layout:c,tooltip:u},e.createElement(Ad,Object.assign({hasError:o,id:p,ref:n,type:"tel"},d)))})),_d=e.forwardRef((function(t,n){const{buttonAction:r,buttonText:o,errorMessage:a,hasError:i,hintText:s,id:l,label:c,labelSuffix:u,layout:d,size:p,tooltip:h}=t,f=Po(t,["buttonAction","buttonText","errorMessage","hasError","hintText","id","label","labelSuffix","layout","size","tooltip"]),m=Gd(l);return e.createElement(Bd,{errorMessage:a,hasError:i,hintText:s,id:m,label:c,labelSuffix:u,layout:d,tooltip:h},e.createElement(Ad,Object.assign({button:e.createElement(we,{buttonStyle:exports.ButtonStyle.PRIMARY,disabled:i,size:p===exports.InputSize.XL?exports.ButtonSize.MD:exports.ButtonSize.SM,onClick:r},o),hasError:i,icon:e.createElement(oe,{size:exports.IconSystemSize.big,type:exports.IconSystemType.search}),id:m,ref:n,size:p,type:"text"},f)))})),Xd=t.div`
1390
+ `,Bd=n=>{const{children:r,childrenWidth:o,colorScheme:a=exports.ColorScheme.light,errorMessage:i,hasError:s,hintText:l,id:c,label:u,labelSuffix:p,layout:h=exports.FieldWrapperLayout.vertical,tooltip:f}=n,m=t.useTheme(),g=H(a),b=(()=>{switch(h){case exports.FieldWrapperLayout.vertical:return e.Fragment;case exports.FieldWrapperLayout.horizontal:return Rd;default:throw new Error("unexpected value of enum FieldWrapperLayout fieldWrapper.tsx LabelAndHintWrapper")}})(),v=(()=>{switch(h){case exports.FieldWrapperLayout.vertical:return e.Fragment;case exports.FieldWrapperLayout.horizontal:return Wd;default:throw new Error("unexpected value of enum FieldWrapperLayout fieldWrapper.tsx FieldAndErrorWrapper")}})();return e.createElement(Pd,{layout:h},(void 0!==u||void 0!==l)&&e.createElement(b,null,void 0!==u&&e.createElement(Od,{hasError:s,id:c,label:u,suffix:p,tooltip:f}),void 0!==l&&e.createElement(d,{color:g(m.colors.fg.neutral.subtle),variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.REGULAR_400},l)),e.createElement(v,{childrenWidth:o},r,!0===s&&void 0!==i&&""!==i&&e.createElement("div",null,e.createElement(d,{color:g(m.colors.fg.error),variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.REGULAR_400},i))))},Vd=e=>void 0!==e?e:Ct.encode(Math.random().toString()),Gd=t=>e.useMemo((()=>Vd(t)),[t]),Fd=e.forwardRef((function(t,n){const{colorInput:r,errorMessage:o,hasError:a,hintText:i,id:s,label:l,labelSuffix:c,layout:u,tooltip:d}=t,p=Po(t,["colorInput","errorMessage","hasError","hintText","id","label","labelSuffix","layout","tooltip"]),h=Gd(s);return e.createElement(Bd,{errorMessage:o,hasError:a,hintText:i,id:h,label:l,labelSuffix:c,layout:u,tooltip:d},e.createElement(Ad,Object.assign({colorInput:r,hasError:a,id:h,ref:n,type:"email"},p)))})),Hd=e.forwardRef((function(t,n){const{colorInput:r,errorMessage:o,hasError:a,hintText:i,id:s,label:l,labelSuffix:c,layout:u,tooltip:d}=t,p=Po(t,["colorInput","errorMessage","hasError","hintText","id","label","labelSuffix","layout","tooltip"]),h=Gd(s);return e.createElement(Bd,{errorMessage:o,hasError:a,hintText:i,id:h,label:l,labelSuffix:c,layout:u,tooltip:d},e.createElement(Ad,Object.assign({colorInput:r,hasError:a,id:h,ref:n,type:"tel"},p)))})),_d=e.forwardRef((function(t,n){const{buttonAction:r,buttonText:o,colorInput:a,errorMessage:i,hasError:s,hintText:l,id:c,label:u,labelSuffix:d,layout:p,size:h,tooltip:f}=t,m=Po(t,["buttonAction","buttonText","colorInput","errorMessage","hasError","hintText","id","label","labelSuffix","layout","size","tooltip"]),g=Gd(c);return e.createElement(Bd,{errorMessage:i,hasError:s,hintText:l,id:g,label:u,labelSuffix:d,layout:p,tooltip:f},e.createElement(Ad,Object.assign({button:e.createElement(we,{buttonStyle:exports.ButtonStyle.PRIMARY,disabled:s,size:h===exports.InputSize.XL?exports.ButtonSize.MD:exports.ButtonSize.SM,onClick:r},o),colorInput:a,hasError:s,icon:e.createElement(oe,{size:exports.IconSystemSize.big,type:exports.IconSystemType.search}),id:g,ref:n,size:h,type:"text"},m)))})),Xd=t.div`
1391
1391
  display: grid;
1392
1392
  /* stylelint-disable named-grid-areas-no-invalid */
1393
1393
  grid-template-areas: ${({isInputNoteVisible:e,isInputVisible:t,mediaType:n})=>{switch(!0){case n===exports.MediaType.mobile&&!t:return"\n \t'label'\n \t'slider'\n \t\t";case n===exports.MediaType.mobile&&t&&e:return"\n \t'label input'\n \t'label inputNote'\n \t'slider slider'\n \t\t";case n===exports.MediaType.mobile&&t&&!e:return"\n \t'label input'\n \t'slider slider'\n \t\t";case n===exports.MediaType.desktop&&!t:return"\n \t 'label'\n\t 'slider'\n \t\t ";case n===exports.MediaType.desktop&&t&&e:return"\n \t 'label label'\n\t 'slider input'\n\t '. inputNote'\n \t\t ";case n===exports.MediaType.desktop&&t&&!e:return"\n \t 'label label'\n\t 'slider input'\n \t\t ";default:throw new Error("unexpected MediaType in sliderInput.style.ts Wrapper grid-template-areas")}}};
@@ -1413,7 +1413,7 @@ function uc(e,t,n){return t=kc(t),function(e,t){if(t&&("object"==typeof t||"func
1413
1413
  `,jd=t.div`
1414
1414
  display: flex;
1415
1415
  grid-area: slider;
1416
- `,Zd=e=>e.replace(/[^\d]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g," "),Jd=e=>e.replace(/\s/g,""),Ud=e.forwardRef((function(n,r){const{colorScheme:o=exports.ColorScheme.light,disabled:a,hasError:i=!1,id:s,inputNote:l,isInputHidden:c=!1,label:u,mediaType:p,minMax:h,minMaxLabels:f,name:m,onBlur:g,onChange:b,prefix:v,steps:y,stepType:x,suffix:w}=n,k=t.useTheme(),C=H(o),I=Gd(s),[E,S]=e.useState(void 0),T=e.useRef(null);e.useEffect((()=>{if(null!==r){if("function"==typeof r)return void r(T.current);r.current=T.current}}),[r]),e.useEffect((()=>{var e;if(void 0!==(null===(e=T.current)||void 0===e?void 0:e.value)&&void 0!==E){const e=document.getElementById(I);Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set.call(e,Zd(E.toString()));const t=new Event("input",{bubbles:!0});e.dispatchEvent(t)}}),[I,E]),e.useEffect((()=>{S(T.current.value)}),[]);const D=e.useCallback((e=>{S(e)}),[]),M=e.useCallback((()=>{const e=document.activeElement;if(null!==T.current){if(T.current.focus(),null===e||"function"!=typeof e.focus)return void T.current.blur();e.focus()}}),[]),L=e.useCallback((e=>Ro(this,void 0,void 0,(function*(){const t=e.target.value,n=Number.parseInt(Jd(t));let r;switch(!0){case Number.isNaN(n):case n<h.min:r=h.min;break;case n>h.max:r=h.max;break;default:r=n}e.target.value=Zd(r.toString()),S(r),void 0!==g&&(yield g(e))}))),[h.max,h.min,g]),A=e.useCallback((e=>Ro(this,void 0,void 0,(function*(){e.target.value=Zd(Jd(e.target.value)),void 0!==b&&(yield b(e))}))),[b]);return e.createElement(Xd,{isInputNoteVisible:void 0!==l,isInputVisible:!c,mediaType:p},e.createElement(zd,null,e.createElement("label",{htmlFor:I},e.createElement(d,{color:C(i?k.colors.fg.error:k.colors.fg.neutral.default),variant:exports.TypographyVariant.TEXT_MD,weight:exports.TypographyWeight.MEDIUM_500},u.element,e.createElement(ia,{displayMethod:exports.TooltipInfoDisplayMethod.WITH_NBSP,floatingElement:u.tooltip})))),e.createElement(Yd,{isInputHidden:c},e.createElement(Ad,{colorInput:C(k.colors.fg.neutral.default),disabled:a,hasError:i,id:I,name:m,prefix:v,ref:T,size:exports.InputSize.MD,suffix:w,textAlign:yd.right,onBlur:L,onChange:A})),void 0!==l&&!c&&e.createElement($d,null,e.createElement(d,{variant:exports.TypographyVariant.TEXT_MD},l)),void 0!==E&&e.createElement(jd,null,e.createElement(It,{colorScheme:o,disable:a,max:h.max,min:h.min,minMaxLabels:f,steps:y,stepType:x,value:E,onFinalChange:M,onChange:D})))})),Qd=e.forwardRef((function(t,n){const{errorMessage:r,hasError:o,hintText:a,id:i,label:s,labelSuffix:l,layout:c,tooltip:u}=t,d=Po(t,["errorMessage","hasError","hintText","id","label","labelSuffix","layout","tooltip"]),p=Gd(i);return e.createElement(Bd,{errorMessage:r,hasError:o,hintText:a,id:p,label:s,labelSuffix:l,layout:c,tooltip:u},e.createElement(Ad,Object.assign({hasError:o,id:p,ref:n,type:"text"},d)))})),Kd=t.div`
1416
+ `,Zd=e=>e.replace(/[^\d]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g," "),Jd=e=>e.replace(/\s/g,""),Ud=e.forwardRef((function(n,r){const{colorScheme:o=exports.ColorScheme.light,disabled:a,hasError:i=!1,id:s,inputNote:l,isInputHidden:c=!1,label:u,mediaType:p,minMax:h,minMaxLabels:f,name:m,onBlur:g,onChange:b,prefix:v,steps:y,stepType:x,suffix:w}=n,k=t.useTheme(),C=H(o),I=Gd(s),[E,S]=e.useState(void 0),T=e.useRef(null);e.useEffect((()=>{if(null!==r){if("function"==typeof r)return void r(T.current);r.current=T.current}}),[r]),e.useEffect((()=>{var e;if(void 0!==(null===(e=T.current)||void 0===e?void 0:e.value)&&void 0!==E){const e=document.getElementById(I);Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set.call(e,Zd(E.toString()));const t=new Event("input",{bubbles:!0});e.dispatchEvent(t)}}),[I,E]),e.useEffect((()=>{S(T.current.value)}),[]);const D=e.useCallback((e=>{S(e)}),[]),M=e.useCallback((()=>{const e=document.activeElement;if(null!==T.current){if(T.current.focus(),null===e||"function"!=typeof e.focus)return void T.current.blur();e.focus()}}),[]),L=e.useCallback((e=>Ro(this,void 0,void 0,(function*(){const t=e.target.value,n=Number.parseInt(Jd(t));let r;switch(!0){case Number.isNaN(n):case n<h.min:r=h.min;break;case n>h.max:r=h.max;break;default:r=n}e.target.value=Zd(r.toString()),S(r),void 0!==g&&(yield g(e))}))),[h.max,h.min,g]),A=e.useCallback((e=>Ro(this,void 0,void 0,(function*(){e.target.value=Zd(Jd(e.target.value)),void 0!==b&&(yield b(e))}))),[b]);return e.createElement(Xd,{isInputNoteVisible:void 0!==l,isInputVisible:!c,mediaType:p},e.createElement(zd,null,e.createElement("label",{htmlFor:I},e.createElement(d,{color:C(i?k.colors.fg.error:k.colors.fg.neutral.default),variant:exports.TypographyVariant.TEXT_MD,weight:exports.TypographyWeight.MEDIUM_500},u.element,e.createElement(ia,{displayMethod:exports.TooltipInfoDisplayMethod.WITH_NBSP,floatingElement:u.tooltip})))),e.createElement(Yd,{isInputHidden:c},e.createElement(Ad,{colorInput:C(k.colors.fg.neutral.default),disabled:a,hasError:i,id:I,name:m,prefix:v,ref:T,size:exports.InputSize.MD,suffix:w,textAlign:yd.right,onBlur:L,onChange:A})),void 0!==l&&!c&&e.createElement($d,null,e.createElement(d,{variant:exports.TypographyVariant.TEXT_MD},l)),void 0!==E&&e.createElement(jd,null,e.createElement(It,{colorScheme:o,disable:a,max:h.max,min:h.min,minMaxLabels:f,steps:y,stepType:x,value:E,onFinalChange:M,onChange:D})))})),Qd=e.forwardRef((function(t,n){const{colorInput:r,errorMessage:o,hasError:a,hintText:i,id:s,label:l,labelSuffix:c,layout:u,tooltip:d}=t,p=Po(t,["colorInput","errorMessage","hasError","hintText","id","label","labelSuffix","layout","tooltip"]),h=Gd(s);return e.createElement(Bd,{errorMessage:o,hasError:a,hintText:i,id:h,label:l,labelSuffix:c,layout:u,tooltip:d},e.createElement(Ad,Object.assign({colorInput:r,hasError:a,id:h,ref:n,type:"text"},p)))})),Kd=t.div`
1417
1417
  width: ${({childrenWidth:e})=>null!=e?e:"100%"};
1418
1418
  `,qd=e.forwardRef((function(t,n){const{childrenWidth:r,errorMessage:o,hasError:a,hintText:i,id:s,label:l,labelSuffix:c,layout:u,tooltip:d}=t,p=Po(t,["childrenWidth","errorMessage","hasError","hintText","id","label","labelSuffix","layout","tooltip"]),h=Gd(s);return e.createElement(Bd,{errorMessage:o,hasError:a,hintText:i,id:h,label:l,labelSuffix:c,layout:u,tooltip:d},e.createElement(Kd,{childrenWidth:r},e.createElement(Ad,Object.assign({hasError:a,id:h,ref:n,textAlign:yd.right,type:"text"},p))))})),ep=e.forwardRef(((t,n)=>{const{innerRef:r}=t,a=Po(t,["innerRef"]),i=(s=[r,n],o.useMemo((()=>s.every((e=>null==e))?null:e=>{s.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),s));var s;return e.createElement(Ad,Object.assign({},a,{ref:i}))}));var tp,np,rp;ep.displayName="InputBaseWithInnerRef",tp="cs",np=dd,(rp="undefined"!=typeof window?window:globalThis).__localeData__||(rp.__localeData__={}),rp.__localeData__[tp]=np;const op=["dd.MM.yyyy","dd. MM. yyyy"],ap=e.forwardRef(((t,n)=>{const{hasError:r,locale:o,name:a,nextMonthAriaLabel:i,previousMonthAriaLabel:s,startDate:l}=t,c=Po(t,["hasError","locale","name","nextMonthAriaLabel","previousMonthAriaLabel","startDate"]);return e.createElement(nd,Object.assign({calendarContainer:({children:t})=>e.createElement(wd,{role:"dialog"},e.createElement(kd,{id:"datepicker-prevMonth"},s),e.createElement(kd,{id:"datepicker-nextMonth"},i),t),customInput:e.createElement(ep,{hasError:r,icon:e.createElement(oe,{size:exports.IconSystemSize.small,type:exports.IconSystemType.event}),innerRef:n,name:a,size:exports.InputSize.MD}),dateFormat:op,locale:null!=o?o:"cs",popperContainer:Cd,renderCustomHeader:bd,selected:l,showPopperArrow:!1,showTimeSelect:!1},c))}));var ip;ap.displayName="DatePicker",exports.CheckboxPosition=void 0,(ip=exports.CheckboxPosition||(exports.CheckboxPosition={})).left="left",ip.right="right";const sp="24px",lp=t.label`
1419
1419
  display: flex;
@@ -1484,6 +1484,7 @@ function uc(e,t,n){return t=kc(t),function(e,t){if(t&&("object"==typeof t||"func
1484
1484
  top: calc((${sp} - ${fd.font.lineHeight.body.sm}) / 2);
1485
1485
 
1486
1486
  label {
1487
+ display: inherit;
1487
1488
  margin: 0;
1488
1489
  font-size: inherit;
1489
1490
  font-weight: inherit;