@mmb-digital/design-system-web 0.1.76 → 0.1.77

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
@@ -1909,5 +1909,5 @@ function Gu(e,t,n){return t=qu(t),function(e,t){if(t&&("object"==typeof t||"func
1909
1909
  `;case exports.GapSize.XXXXXL:return t.css`
1910
1910
  gap: ${({theme:e})=>e.spacing.xxxxxl};
1911
1911
  `;default:throw new Error("unexpected GapSize enum values in stack.styles.ts")}}}
1912
- `;exports.Accordion=t=>{const{data:n}=t,[r,o]=e.useState(null);return e.createElement(s,null,n.map(((t,n)=>e.createElement(fe,{key:t.id,content:t.content,description:t.description,icon:t.icon,id:t.id,isOpen:r===n,label:t.label,onClick:()=>(e=>{o((t=>t===e?null:e))})(n)}))))},exports.AccordionContent=ge,exports.AccordionItem=fe,exports.AccordionKeyValue=n=>{const{colorScheme:r,label:o,value:a}=n,i=t.useTheme(),s=H(null!=r?r:exports.ColorScheme.light);return e.createElement(ge,{colorScheme:r},e.createElement(be,null,e.createElement(p,{color:s(i.colors.fg.neutral.default),variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.MEDIUM_500},o)),e.createElement(ve,null,e.createElement(p,{color:s(i.colors.fg.neutral.subtle),variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.MEDIUM_500},a)))},exports.AsyncSelect=t=>{const{control:n,defaultPlaceholder:o,name:a,optionIcon:i}=t,s=Ht(t,["control","defaultPlaceholder","name","optionIcon"]),[l,u]=e.useState(),[c,d]=e.useState(o),p=()=>d("");return e.createElement(r.Controller,{control:n,name:a,render:({field:t})=>{var n;return e.createElement(fy,Object.assign({},s,t,{customComponents:{Input:yy,DropdownIndicator:null,Control:xy,Option:t=>((t,n)=>{var{children:r,data:o}=t,a=Ht(t,["children","data"]);return e.createElement(Ub.Option,Object.assign({data:o},a),e.createElement(gy,null,n&&e.createElement(se,{size:n.size,type:n.type}),e.createElement(by,null,r)))})(t,i)},inputValue:null===(n=t.value)||void 0===n?void 0:n.label,isSearchable:!0,loadingMessage:()=>null,noOptionsMessage:()=>null,placeholder:c,type:py.ASYNC_SELECT,value:l,onBlur:()=>(e=>{""===e.label&&d(o)})(t.value),onChange:e=>((e,t)=>{t.onChange(e)})(e,t),onFocus:p,onInputChange:(e,n)=>((e,{action:t},n)=>{"input-change"===t&&(u(null),n.onChange({value:null,label:e}))})(e,n,t)}))}})},exports.Button=Ee,exports.CalculatorResult=Xa,exports.CalculatorResultBox=t=>{const{bodyItems:n,description:r,header:o,main:a,mediaType:i,modal:s,resultWrapperHtmlRef:l}=t,[u,c]=e.useState(!1);return e.createElement($a,{isDescriptionVisible:void 0!==r,mediaType:i},e.createElement(Xa,{bodyItems:n,header:o,htmlRef:l,main:a}),e.createElement(Ya,null,void 0!==r&&e.createElement(ja,null,e.createElement(p,{fullWidth:!0,textAlign:exports.TypographyTextAlign.CENTER,variant:exports.TypographyVariant.TEXT_SM},r)),void 0!==s&&e.createElement(e.Fragment,null,e.createElement(In,{hideCloseButton:!1,isOpen:u,onClose:()=>{c(!1)}},s.content),e.createElement(Za,null,e.createElement(Ua,{onClick:()=>{c(!0)}},e.createElement(p,{variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.MEDIUM_500},s.text,e.createElement(Ja,null,e.createElement(Qa,null,e.createElement(se,{size:exports.IconSystemSize.big,type:exports.IconSystemType.chevronRight})))))))))},exports.Checkbox=zh,exports.DatePicker=Rh,exports.EmailInput=gp,exports.ErrorBox=n=>{const{colorScheme:r,content:o,items:a,title:i}=n,s=t.useTheme(),l=H(r);return e.createElement(Mt,{chooseColor:l},void 0!==i&&e.createElement(p,{color:l(s.colors.fg.error),variant:exports.TypographyVariant.TEXT_LG,weight:exports.TypographyWeight.SEMI_BOLD_600},i),void 0!==a&&a.length>0&&e.createElement(Nt,{colorScheme:r,items:a}),void 0!==o&&o)},exports.FieldWrapper=hp,exports.FormattedAmount=ci,exports.FormattedHtmlMessage=Ta,exports.FormattedMessage=t=>{const{defaultMessage:n,description:r,id:o,values:a}=t;return e.createElement(Sa,{defaultMessage:n,description:r,id:o,values:a},(t=>e.createElement("span",{"data-message-id":o},t)))},exports.FormattedPercentage=li,exports.IconProduct=pn,exports.IconSystem=se,exports.InfoConditional=Da,exports.Infobox=t=>{const{children:n,fullWidth:r,isWarning:o=!1,size:a,variant:i}=t;return e.createElement(Ot,{fullWidth:r,isWarning:o,size:a,variant:i},n)},exports.InputBase=sp,exports.InputLabel=up,exports.Loader=ai,exports.LoaderOverlayBox=t=>{const{colorScheme:n,loaderSize:r}=t;return e.createElement(ii,{colorScheme:n},e.createElement(ai,{colorScheme:n,loaderSize:r}))},exports.MaskedInput=ah,exports.MaskedInputBase=oh,exports.MaskedInputField=sh,exports.Modal=In,exports.NumberInput=lh,exports.NumberInputField=uh,exports.PhoneInput=ch,exports.PhoneInputField=fh,exports.PhoneInputNext=hh,exports.Radio=ef,exports.RadioButton=af,exports.RadioButtonsHorizontal=pf,exports.SearchInput=mh,exports.Select=t=>{const{control:n,name:o}=t,a=Ht(t,["control","name"]);return e.createElement(r.Controller,{control:n,name:o,render:({field:t})=>e.createElement(fy,Object.assign({},a,t))})},exports.SelectBase=fy,exports.SelectField=t=>{const{control:n,errorMessage:o,hasError:a,hintText:i,id:s,label:l,labelSuffix:u,name:c,tooltip:d}=t,p=Ht(t,["control","errorMessage","hasError","hintText","id","label","labelSuffix","name","tooltip"]);return e.createElement(hp,{errorMessage:o,hasError:a,hintText:i,id:s,label:l,labelSuffix:u,tooltip:d},e.createElement(r.Controller,{control:n,name:c,render:({field:t})=>e.createElement(my,Object.assign({},p,{inputId:s,isError:a},t))}))},exports.Slider=Tt,exports.SliderInput=Eh,exports.Stack=t=>{const{children:n,direction:r=exports.StackDirection.column,gap:o=exports.GapSize.MD}=t,a=Ht(t,["children","direction","gap"]);return e.createElement(_y,Object.assign({direction:r,gap:o},a),n)},exports.Table=t=>{const{children:n,variant:r}=t;return e.createElement(Bt,{variant:r},n)},exports.TableBody=t=>{const{children:n,variant:r}=t;return e.createElement(Ft,{variant:r},n)},exports.TableData=t=>{const{align:n,children:r,delimiter:o=!1,variant:a,width:i}=t;return e.createElement(Vt,{align:n,delimiter:o,variant:a,width:i},r)},exports.TableHead=t=>{const{children:n,variant:r}=t;return e.createElement(Wt,{variant:r},n)},exports.TableHeadData=t=>{const{align:n,children:r,width:o}=t,a=Ht(t,["align","children","width"]);return e.createElement(zt,Object.assign({align:n,width:o},a),r)},exports.TableRow=t=>{const{children:n,variant:r}=t;return e.createElement($t,{variant:r},n)},exports.Tabs=t=>{const{colorScheme:n,fullWidth:r,tabItems:o,variant:a}=t,i=H(n);return e.createElement(en,{chooseColor:i,fullWidth:r},o.map((t=>e.createElement(e.Fragment,{key:t.id},e.createElement(qt,{colorScheme:n,fullWidth:r,icon:t.icon,id:t.id,isActive:t.isActive,text:t.text,variant:a,onClick:t.onClick})))))},exports.TabsItem=qt,exports.TextArea=Ay,exports.TextInput=Ih,exports.Toggle=n=>{const{defaultValue:r,disabled:o,id:a,label:i,name:s,onChange:l}=n,u=t.useTheme(),[c,d]=e.useState(r),h=e.useCallback((e=>{d(e),void 0!==l&&l(e)}),[l]);return e.createElement(Ty,{checked:c,disabled:o},e.createElement(Sy,{activeBoxShadow:"",borderRadius:9999,checked:c,checkedIcon:!1,className:"react-switch",disabled:o,handleDiameter:16,height:21,id:a,name:s,offColor:u.colors.bg.neutral.white.light,offHandleColor:u.colors.bg.neutral.white.light,uncheckedIcon:!1,width:36,onChange:h,onColor:!0===o?u.colors.bg.neutral.white.light:u.colors.bg.brand.bold.light,onHandleColor:u.colors.bg.neutral.white.light}),void 0!==i&&e.createElement(My,{htmlFor:a},e.createElement(p,{variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.MEDIUM_500},i)))},exports.TooltipGeneral=ea,exports.TooltipInfo=oa,exports.TooltipInfoDisplayableCheck=t=>{const{body:n,colorScheme:r,displayMethod:o,title:a}=t,i=Ma();return i(n)?e.createElement(e.Fragment,null,o===exports.TooltipInfoDisplayMethod.WITH_NBSP&&" ",e.createElement(oa,{colorScheme:r,floatingElement:{body:e.createElement(Ta,Object.assign({},n)),title:void 0!==a&&i(a)?e.createElement(Ta,Object.assign({},a)):void 0}})):null},exports.TrailingTextInput=Th,exports.Typography=p,exports.getColor=G,exports.theme=Hd,exports.useColorScheme=H,exports.useCreateTooltipFloatingElement=()=>{const t=Ma();return e.useCallback(((n,r)=>{if(t(n))return{body:e.createElement(Ta,Object.assign({},n)),title:void 0!==r&&t(r)?e.createElement(Ta,Object.assign({},r)):void 0}}),[t])},exports.useFormatAmount=ui,exports.useFormattedPercentage=si,exports.useIsMessageDisplayable=Ma,exports.withMaskedInputField=ih;
1912
+ `;exports.Accordion=t=>{const{data:n}=t,[r,o]=e.useState(null);return e.createElement(s,null,n.map(((t,n)=>e.createElement(fe,{key:t.id,content:t.content,description:t.description,icon:t.icon,id:t.id,isOpen:r===n,label:t.label,onClick:()=>(e=>{o((t=>t===e?null:e))})(n)}))))},exports.AccordionContent=ge,exports.AccordionItem=fe,exports.AccordionKeyValue=n=>{const{colorScheme:r,label:o,value:a}=n,i=t.useTheme(),s=H(null!=r?r:exports.ColorScheme.light);return e.createElement(ge,{colorScheme:r},e.createElement(be,null,e.createElement(p,{color:s(i.colors.fg.neutral.default),variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.MEDIUM_500},o)),e.createElement(ve,null,e.createElement(p,{color:s(i.colors.fg.neutral.subtle),variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.MEDIUM_500},a)))},exports.AsyncSelect=t=>{const{control:n,defaultPlaceholder:o,name:a,optionIcon:i}=t,s=Ht(t,["control","defaultPlaceholder","name","optionIcon"]),[l,u]=e.useState(),[c,d]=e.useState(o),p=()=>d("");return e.createElement(r.Controller,{control:n,name:a,render:({field:t})=>{var n;return e.createElement(fy,Object.assign({},s,t,{customComponents:{Input:yy,DropdownIndicator:null,Control:xy,Option:t=>((t,n)=>{var{children:r,data:o}=t,a=Ht(t,["children","data"]);return e.createElement(Ub.Option,Object.assign({data:o},a),e.createElement(gy,null,n&&e.createElement(se,{size:n.size,type:n.type}),e.createElement(by,null,r)))})(t,i)},inputValue:null===(n=t.value)||void 0===n?void 0:n.label,isSearchable:!0,loadingMessage:()=>null,noOptionsMessage:()=>null,placeholder:c,type:py.ASYNC_SELECT,value:l,onBlur:()=>(e=>{""===e.label&&d(o)})(t.value),onChange:e=>((e,t)=>{t.onChange(e)})(e,t),onFocus:p,onInputChange:(e,n)=>((e,{action:t},n)=>{"input-change"===t&&(u(null),n.onChange({value:null,label:e}))})(e,n,t)}))}})},exports.Button=Ee,exports.CalculatorResult=Xa,exports.CalculatorResultBox=t=>{const{bodyItems:n,description:r,header:o,htmlRef:a,main:i,mediaType:s,modal:l,resultWrapperHtmlRef:u}=t,[c,d]=e.useState(!1);return e.createElement($a,{isDescriptionVisible:void 0!==r,mediaType:s,ref:a},e.createElement(Xa,{bodyItems:n,header:o,htmlRef:u,main:i}),e.createElement(Ya,null,void 0!==r&&e.createElement(ja,null,e.createElement(p,{fullWidth:!0,textAlign:exports.TypographyTextAlign.CENTER,variant:exports.TypographyVariant.TEXT_SM},r)),void 0!==l&&e.createElement(e.Fragment,null,e.createElement(In,{hideCloseButton:!1,isOpen:c,onClose:()=>{d(!1)}},l.content),e.createElement(Za,null,e.createElement(Ua,{onClick:()=>{d(!0)}},e.createElement(p,{variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.MEDIUM_500},l.text,e.createElement(Ja,null,e.createElement(Qa,null,e.createElement(se,{size:exports.IconSystemSize.big,type:exports.IconSystemType.chevronRight})))))))))},exports.Checkbox=zh,exports.DatePicker=Rh,exports.EmailInput=gp,exports.ErrorBox=n=>{const{colorScheme:r,content:o,items:a,title:i}=n,s=t.useTheme(),l=H(r);return e.createElement(Mt,{chooseColor:l},void 0!==i&&e.createElement(p,{color:l(s.colors.fg.error),variant:exports.TypographyVariant.TEXT_LG,weight:exports.TypographyWeight.SEMI_BOLD_600},i),void 0!==a&&a.length>0&&e.createElement(Nt,{colorScheme:r,items:a}),void 0!==o&&o)},exports.FieldWrapper=hp,exports.FormattedAmount=ci,exports.FormattedHtmlMessage=Ta,exports.FormattedMessage=t=>{const{defaultMessage:n,description:r,id:o,values:a}=t;return e.createElement(Sa,{defaultMessage:n,description:r,id:o,values:a},(t=>e.createElement("span",{"data-message-id":o},t)))},exports.FormattedPercentage=li,exports.IconProduct=pn,exports.IconSystem=se,exports.InfoConditional=Da,exports.Infobox=t=>{const{children:n,fullWidth:r,isWarning:o=!1,size:a,variant:i}=t;return e.createElement(Ot,{fullWidth:r,isWarning:o,size:a,variant:i},n)},exports.InputBase=sp,exports.InputLabel=up,exports.Loader=ai,exports.LoaderOverlayBox=t=>{const{colorScheme:n,loaderSize:r}=t;return e.createElement(ii,{colorScheme:n},e.createElement(ai,{colorScheme:n,loaderSize:r}))},exports.MaskedInput=ah,exports.MaskedInputBase=oh,exports.MaskedInputField=sh,exports.Modal=In,exports.NumberInput=lh,exports.NumberInputField=uh,exports.PhoneInput=ch,exports.PhoneInputField=fh,exports.PhoneInputNext=hh,exports.Radio=ef,exports.RadioButton=af,exports.RadioButtonsHorizontal=pf,exports.SearchInput=mh,exports.Select=t=>{const{control:n,name:o}=t,a=Ht(t,["control","name"]);return e.createElement(r.Controller,{control:n,name:o,render:({field:t})=>e.createElement(fy,Object.assign({},a,t))})},exports.SelectBase=fy,exports.SelectField=t=>{const{control:n,errorMessage:o,hasError:a,hintText:i,id:s,label:l,labelSuffix:u,name:c,tooltip:d}=t,p=Ht(t,["control","errorMessage","hasError","hintText","id","label","labelSuffix","name","tooltip"]);return e.createElement(hp,{errorMessage:o,hasError:a,hintText:i,id:s,label:l,labelSuffix:u,tooltip:d},e.createElement(r.Controller,{control:n,name:c,render:({field:t})=>e.createElement(my,Object.assign({},p,{inputId:s,isError:a},t))}))},exports.Slider=Tt,exports.SliderInput=Eh,exports.Stack=t=>{const{children:n,direction:r=exports.StackDirection.column,gap:o=exports.GapSize.MD}=t,a=Ht(t,["children","direction","gap"]);return e.createElement(_y,Object.assign({direction:r,gap:o},a),n)},exports.Table=t=>{const{children:n,variant:r}=t;return e.createElement(Bt,{variant:r},n)},exports.TableBody=t=>{const{children:n,variant:r}=t;return e.createElement(Ft,{variant:r},n)},exports.TableData=t=>{const{align:n,children:r,delimiter:o=!1,variant:a,width:i}=t;return e.createElement(Vt,{align:n,delimiter:o,variant:a,width:i},r)},exports.TableHead=t=>{const{children:n,variant:r}=t;return e.createElement(Wt,{variant:r},n)},exports.TableHeadData=t=>{const{align:n,children:r,width:o}=t,a=Ht(t,["align","children","width"]);return e.createElement(zt,Object.assign({align:n,width:o},a),r)},exports.TableRow=t=>{const{children:n,variant:r}=t;return e.createElement($t,{variant:r},n)},exports.Tabs=t=>{const{colorScheme:n,fullWidth:r,tabItems:o,variant:a}=t,i=H(n);return e.createElement(en,{chooseColor:i,fullWidth:r},o.map((t=>e.createElement(e.Fragment,{key:t.id},e.createElement(qt,{colorScheme:n,fullWidth:r,icon:t.icon,id:t.id,isActive:t.isActive,text:t.text,variant:a,onClick:t.onClick})))))},exports.TabsItem=qt,exports.TextArea=Ay,exports.TextInput=Ih,exports.Toggle=n=>{const{defaultValue:r,disabled:o,id:a,label:i,name:s,onChange:l}=n,u=t.useTheme(),[c,d]=e.useState(r),h=e.useCallback((e=>{d(e),void 0!==l&&l(e)}),[l]);return e.createElement(Ty,{checked:c,disabled:o},e.createElement(Sy,{activeBoxShadow:"",borderRadius:9999,checked:c,checkedIcon:!1,className:"react-switch",disabled:o,handleDiameter:16,height:21,id:a,name:s,offColor:u.colors.bg.neutral.white.light,offHandleColor:u.colors.bg.neutral.white.light,uncheckedIcon:!1,width:36,onChange:h,onColor:!0===o?u.colors.bg.neutral.white.light:u.colors.bg.brand.bold.light,onHandleColor:u.colors.bg.neutral.white.light}),void 0!==i&&e.createElement(My,{htmlFor:a},e.createElement(p,{variant:exports.TypographyVariant.TEXT_SM,weight:exports.TypographyWeight.MEDIUM_500},i)))},exports.TooltipGeneral=ea,exports.TooltipInfo=oa,exports.TooltipInfoDisplayableCheck=t=>{const{body:n,colorScheme:r,displayMethod:o,title:a}=t,i=Ma();return i(n)?e.createElement(e.Fragment,null,o===exports.TooltipInfoDisplayMethod.WITH_NBSP&&" ",e.createElement(oa,{colorScheme:r,floatingElement:{body:e.createElement(Ta,Object.assign({},n)),title:void 0!==a&&i(a)?e.createElement(Ta,Object.assign({},a)):void 0}})):null},exports.TrailingTextInput=Th,exports.Typography=p,exports.getColor=G,exports.theme=Hd,exports.useColorScheme=H,exports.useCreateTooltipFloatingElement=()=>{const t=Ma();return e.useCallback(((n,r)=>{if(t(n))return{body:e.createElement(Ta,Object.assign({},n)),title:void 0!==r&&t(r)?e.createElement(Ta,Object.assign({},r)):void 0}}),[t])},exports.useFormatAmount=ui,exports.useFormattedPercentage=si,exports.useIsMessageDisplayable=Ma,exports.withMaskedInputField=ih;
1913
1913
  //# sourceMappingURL=index.cjs.js.map